swh:1:snp:0c004a03453a29b80f921a24433f7e780b9ceb53
Raw File
Tip revision: 0c033b47255ebef5d3e17b1a3b4dee9a8abe6387 authored by Alexey Sergushichev on 27 February 2018, 15:55:49 UTC
js tests doesn't work on appveyor :(
Tip revision: 0c033b4
phantasus-external-plotly-echarts.min.js
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Plotly=t()}}(function(){var t;return function t(e,r,n){function i(o,s){if(!r[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[o]={exports:{}};e[o][0].call(c.exports,function(t){var r=e[o][1][t];return i(r?r:t)},c,c.exports,t,e,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(t,e,r){"use strict";var n=t("../src/lib"),i={"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-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .modebar":"position:absolute;top:2px;right:2px;z-index:1001;background:rgba(255,255,255,0.7);","X .modebar--hover":"opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;","X:hover .modebar--hover":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;margin-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group:first-child":"margin-left:0px;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar-btn path":"fill:rgba(0,31,95,0.3);","X .modebar-btn.active path,X .modebar-btn:hover path":"fill:rgba(0,22,72,0.5);","X .modebar-btn.modebar-btn--logo":"padding:3px 1px;","X .modebar-btn.modebar-btn--logo path":"fill:#447adb !important;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":"content:'';position:absolute;background:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;","X [data-title]:after":"content:attr(data-title);background:#69738a;color:white;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:white;","X .select-outline-2":"stroke:black;stroke-dasharray:2px 2px;",Y:"font-family:'Open Sans';position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;","Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,0.9);color:#fff;padding:10px;","Y .notifier-close":"color:#fff;opacity:0.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(var a in i){var o=a.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(o,i[a])}},{"../src/lib":658}],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}}},{}],3:[function(t,e,r){"use strict";e.exports=t("../src/traces/bar")},{"../src/traces/bar":780}],4:[function(t,e,r){"use strict";e.exports=t("../src/traces/box")},{"../src/traces/box":792}],5:[function(t,e,r){"use strict";e.exports=t("../src/components/calendars")},{"../src/components/calendars":556}],6:[function(t,e,r){"use strict";e.exports=t("../src/traces/candlestick")},{"../src/traces/candlestick":800}],7:[function(t,e,r){"use strict";e.exports=t("../src/traces/choropleth")},{"../src/traces/choropleth":805}],8:[function(t,e,r){"use strict";e.exports=t("../src/traces/contour")},{"../src/traces/contour":815}],9:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":644}],10:[function(t,e,r){"use strict";e.exports=t("../src/transforms/filter")},{"../src/transforms/filter":946}],11:[function(t,e,r){"use strict";e.exports=t("../src/transforms/groupby")},{"../src/transforms/groupby":947}],12:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmap")},{"../src/traces/heatmap":830}],13:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmapgl")},{"../src/traces/heatmapgl":839}],14:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram")},{"../src/traces/histogram":847}],15:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2d")},{"../src/traces/histogram2d":852}],16:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2dcontour")},{"../src/traces/histogram2dcontour":856}],17:[function(t,e,r){"use strict";var n=t("./core");n.register([t("./bar"),t("./box"),t("./heatmap"),t("./histogram"),t("./histogram2d"),t("./histogram2dcontour"),t("./pie"),t("./contour"),t("./scatterternary"),t("./scatter3d"),t("./surface"),t("./mesh3d"),t("./scattergeo"),t("./choropleth"),t("./scattergl"),t("./pointcloud"),t("./heatmapgl"),t("./scattermapbox"),t("./ohlc"),t("./candlestick")]),n.register([t("./filter"),t("./groupby")]),n.register([t("./calendars")]),e.exports=n},{"./bar":3,"./box":4,"./calendars":5,"./candlestick":6,"./choropleth":7,"./contour":8,"./core":9,"./filter":10,"./groupby":11,"./heatmap":12,"./heatmapgl":13,"./histogram":14,"./histogram2d":15,"./histogram2dcontour":16,"./mesh3d":18,"./ohlc":19,"./pie":20,"./pointcloud":21,"./scatter3d":22,"./scattergeo":23,"./scattergl":24,"./scattermapbox":25,"./scatterternary":26,"./surface":27}],18:[function(t,e,r){"use strict";e.exports=t("../src/traces/mesh3d")},{"../src/traces/mesh3d":860}],19:[function(t,e,r){"use strict";e.exports=t("../src/traces/ohlc")},{"../src/traces/ohlc":865}],20:[function(t,e,r){"use strict";e.exports=t("../src/traces/pie")},{"../src/traces/pie":873}],21:[function(t,e,r){"use strict";e.exports=t("../src/traces/pointcloud")},{"../src/traces/pointcloud":882}],22:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatter3d")},{"../src/traces/scatter3d":912}],23:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattergeo")},{"../src/traces/scattergeo":918}],24:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattergl")},{"../src/traces/scattergl":923}],25:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattermapbox")},{"../src/traces/scattermapbox":930}],26:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterternary")},{"../src/traces/scatterternary":936}],27:[function(t,e,r){"use strict";e.exports=t("../src/traces/surface")},{"../src/traces/surface":945}],28:[function(t,e,r){"use strict";function n(t,e){t=t||document.body,e=e||{};var r=[.01,1/0];"distanceLimits"in e&&(r[0]=e.distanceLimits[0],r[1]=e.distanceLimits[1]),"zoomMin"in e&&(r[0]=e.zoomMin),"zoomMax"in e&&(r[1]=e.zoomMax);var n=a({center:e.center||[0,0,0],up:e.up||[0,1,0],eye:e.eye||[0,0,10],mode:e.mode||"orbit",distanceLimits:r}),l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0,c=t.clientWidth,h=t.clientHeight,f={view:n,element:t,delay:e.delay||16,rotateSpeed:e.rotateSpeed||1,zoomSpeed:e.zoomSpeed||1,translateSpeed:e.translateSpeed||1,flipX:!!e.flipX,flipY:!!e.flipY,modes:n.modes,tick:function(){var e=i(),r=this.delay;n.idle(e-r),n.flush(e-(100+2*r));var a=e-2*r;n.recalcMatrix(a);for(var o=!0,s=n.computedMatrix,f=0;f<16;++f)o=o&&l[f]===s[f],l[f]=s[f];var d=t.clientWidth===c&&t.clientHeight===h;return c=t.clientWidth,h=t.clientHeight,o?!d:(u=Math.exp(n.computedRadius[0]),!0)},lookAt:function(t,e,r){n.lookAt(n.lastT(),t,e,r)},rotate:function(t,e,r){n.rotate(n.lastT(),t,e,r)},pan:function(t,e,r){n.pan(n.lastT(),t,e,r)},translate:function(t,e,r){n.translate(n.lastT(),t,e,r)}};Object.defineProperties(f,{matrix:{get:function(){return n.computedMatrix},set:function(t){return n.setMatrix(n.lastT(),t),n.computedMatrix},enumerable:!0},mode:{get:function(){return n.getMode()},set:function(t){return n.setMode(t),n.getMode()},enumerable:!0},center:{get:function(){return n.computedCenter},set:function(t){return n.lookAt(n.lastT(),t),n.computedCenter},enumerable:!0},eye:{get:function(){return n.computedEye},set:function(t){return n.lookAt(n.lastT(),null,t),n.computedEye},enumerable:!0},up:{get:function(){return n.computedUp},set:function(t){return n.lookAt(n.lastT(),null,null,t),n.computedUp},enumerable:!0},distance:{get:function(){return u},set:function(t){return n.setDistance(n.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return n.getDistanceLimits(r)},set:function(t){return n.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener("contextmenu",function(t){return t.preventDefault(),!1});var d=0,p=0;return o(t,function(e,r,a,o){var s=1/t.clientHeight,l=s*(r-d),c=s*(a-p),h=f.flipX?1:-1,m=f.flipY?1:-1,g=Math.PI*f.rotateSpeed,v=i();if(1&e)o.shift?n.rotate(v,0,0,-l*g):n.rotate(v,h*g*l,-m*g*c,0);else if(2&e)n.pan(v,-f.translateSpeed*l*u,f.translateSpeed*c*u,0);else if(4&e){var y=f.zoomSpeed*c/window.innerHeight*(v-n.lastT())*50;n.pan(v,0,0,u*(Math.exp(y)-1))}d=r,p=a}),s(t,function(t,e,r){var a=f.flipX?1:-1,o=f.flipY?1:-1,s=i();if(Math.abs(t)>Math.abs(e))n.rotate(s,0,0,-t*a*Math.PI*f.rotateSpeed/window.innerWidth);else{var l=f.zoomSpeed*o*e/window.innerHeight*(s-n.lastT())/100;n.pan(s,0,0,u*(Math.exp(l)-1))}},!0),f}e.exports=n;var i=t("right-now"),a=t("3d-view"),o=t("mouse-change"),s=t("mouse-wheel")},{"3d-view":29,"mouse-change":418,"mouse-wheel":420,"right-now":465}],29:[function(t,e,r){"use strict";function n(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map(function(e){return t[e]}),this._mode=e,this._active=t[e],this._active||(this._mode="turntable",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}function i(t){t=t||{};var e=t.eye||[0,0,1],r=t.center||[0,0,0],i=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],u=t.mode||"turntable",c=a(),h=o(),f=s();return c.setDistanceLimits(l[0],l[1]),c.lookAt(0,e,r,i),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,i),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,i),new n({turntable:c,orbit:h,matrix:f},u)}e.exports=i;var a=t("turntable-camera-controller"),o=t("orbit-camera-controller"),s=t("matrix-camera-controller"),l=n.prototype,u=[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]];u.forEach(function(t){for(var e=t[0],r=[],n=0;n<t[1];++n)r.push("a"+n);var i="var cc=this._controllerList;for(var i=0;i<cc.length;++i){cc[i]."+t[0]+"("+r.join()+")}";l[e]=Function.apply(null,r.concat(i))}),l.recalcMatrix=function(t){this._active.recalcMatrix(t)},l.getDistance=function(t){return this._active.getDistance(t)},l.getDistanceLimits=function(t){return this._active.getDistanceLimits(t)},l.lastT=function(){return this._active.lastT()},l.setMode=function(t){if(t!==this._mode){var e=this._controllerNames.indexOf(t);if(!(e<0)){var r=this._active,n=this._controllerList[e],i=Math.max(r.lastT(),n.lastT());r.recalcMatrix(i),n.setMatrix(i,r.computedMatrix),this._active=n,this._mode=t,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}}},l.getMode=function(){return this._mode}},{"matrix-camera-controller":416,"orbit-camera-controller":437,"turntable-camera-controller":499}],30:[function(t,e,r){"use strict";function n(t){var e=s.get(t);if(!e||!t.isBuffer(e._triangleBuffer.buffer)){var r=a(t,new Float32Array([-1,-1,-1,4,4,-1]));e=o(t,[{buffer:r,type:t.FLOAT,size:2}]),e._triangleBuffer=r,s.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}var i="undefined"==typeof WeakMap?t("weak-map"):WeakMap,a=t("gl-buffer"),o=t("gl-vao"),s=new i;e.exports=n},{"gl-buffer":130,"gl-vao":241,"weak-map":520}],31:[function(t,e,r){function n(t,e,r){e="number"==typeof e?e:1,r=r||": ";var n=t.split(/\r?\n/),a=String(n.length+e-1).length;return n.map(function(t,n){var o=n+e,s=String(o).length,l=i(o,a-s);return l+r+t}).join("\n")}var i=t("pad-left");e.exports=n},{"pad-left":438}],32:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(e+1),n=0;n<t.length;++n)r[n]=t[n];for(var n=0;n<=t.length;++n){for(var i=t.length;i<=e;++i){for(var o=new Array(e),s=0;s<e;++s)o[s]=Math.pow(i+1-n,s);r[i]=o}var l=a.apply(void 0,r);if(l)return!0}return!1}function i(t){var e=t.length;if(0===e)return[];if(1===e)return[0];for(var r=t[0].length,i=[t[0]],a=[0],o=1;o<e;++o)if(i.push(t[o]),n(i,r)){if(a.push(o),a.length===r+1)return a}else i.pop();return a}e.exports=i;var a=t("robust-orientation")},{"robust-orientation":471}],33:[function(t,e,r){"use strict";function n(t,e){return i(e).filter(function(r){for(var n=new Array(r.length),i=0;i<r.length;++i)n[i]=e[r[i]];return a(n)*t<1})}e.exports=n;var i=t("delaunay-triangulate"),a=t("circumradius")},{circumradius:77,"delaunay-triangulate":98}],34:[function(t,e,r){function n(t,e){return a(i(t,e))}e.exports=n;var i=t("alpha-complex"),a=t("simplicial-complex-boundary")},{"alpha-complex":33,"simplicial-complex-boundary":479}],35:[function(t,e,r){"use strict";var n=function(){function t(t){return!Array.isArray(t)&&null!==t&&"object"==typeof t}function e(t,e,r){for(var n=(e-t)/Math.max(r-1,1),i=[],a=0;a<r;a++)i.push(t+a*n);return i}function r(){for(var t=[].slice.call(arguments),e=t.map(function(t){return t.length}),r=Math.min.apply(null,e),n=[],i=0;i<r;i++){n[i]=[];for(var a=0;a<t.length;++a)n[i][a]=t[a][i]}return n}function n(t,e,r){for(var n=Math.min.apply(null,[t.length,e.length,r.length]),i=[],a=0;a<n;a++)i.push([t[a],e[a],r[a]]);return i}function i(t){function e(t){for(var n=0;n<t.length;n++)Array.isArray(t[n])?e(t[n],r):r+=t[n]}var r=0;return e(t,r),r}function a(t){for(var e=[],r=0;r<t.length;++r){e[r]=[];for(var n=0;n<t[r].length;++n)e[r][n]=t[r][n]}return e}function o(t){for(var e=[],r=0;r<t.length;++r)e[r]=t[r];return e}function s(t,e){if(t.length!==e.length)return!1;for(var r=t.length;r--;)if(t[r]!==e[r])return!1;return!0}function l(t,e){var r,n;if("string"!=typeof t)return t;if(r=[],"#"===t[0]?(t=t.substr(1),3===t.length&&(t+=t),n=parseInt(t,16),r[0]=n>>16&255,r[1]=n>>8&255,r[2]=255&n):h.test(t)&&(n=t.match(f),r[0]=parseInt(n[1]),r[1]=parseInt(n[2]),r[2]=parseInt(n[3])),!e)for(var i=0;i<3;++i)r[i]=r[i]/255;return r}function u(t,e){var r,n;if("string"!=typeof t)return t;if(r=[],"#"===t[0]?(t=t.substr(1),3===t.length&&(t+=t),n=parseInt(t,16),r[0]=n>>16&255,r[1]=n>>8&255,r[2]=255&n):h.test(t)&&(n=t.match(f),r[0]=parseInt(n[1]),r[1]=parseInt(n[2]),r[2]=parseInt(n[3]),n[4]?r[3]=parseFloat(n[4]):r[3]=1),!e)for(var i=0;i<3;++i)r[i]=r[i]/255;return r}var c={},h=/^rgba?\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*(,.*)?\)$/,f=/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,?\s*(.*)?\)$/;return c.isPlainObject=t,c.linspace=e,c.zip3=n,c.sum=i,c.zip=r,c.isEqual=s,c.copy2D=a,c.copy1D=o,c.str2RgbArray=l,c.str2RgbaArray=u,c};e.exports=n()},{}],36:[function(t,e,r){(function(r){"use strict";function n(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i<a;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}function i(t){return r.Buffer&&"function"==typeof r.Buffer.isBuffer?r.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}function a(t){return Object.prototype.toString.call(t)}function o(t){return!i(t)&&("function"==typeof r.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}function s(t){if(b.isFunction(t)){if(M)return t.name;var e=t.toString(),r=e.match(k);return r&&r[1]}}function l(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function u(t){if(M||!b.isFunction(t))return b.inspect(t);var e=s(t),r=e?": "+e:"";return"[Function"+r+"]"}function c(t){return l(u(t.actual),128)+" "+t.operator+" "+l(u(t.expected),128)}function h(t,e,r,n,i){throw new A.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:i})}function f(t,e){t||h(t,!0,e,"==",A.ok)}function d(t,e,r,s){if(t===e)return!0;if(i(t)&&i(e))return 0===n(t,e);if(b.isDate(t)&&b.isDate(e))return t.getTime()===e.getTime();if(b.isRegExp(t)&&b.isRegExp(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&"object"==typeof t||null!==e&&"object"==typeof e){if(o(t)&&o(e)&&a(t)===a(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===n(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(i(t)!==i(e))return!1;s=s||{actual:[],expected:[]};var l=s.actual.indexOf(t);return l!==-1&&l===s.expected.indexOf(e)||(s.actual.push(t),s.expected.push(e),m(t,e,r,s))}return r?t===e:t==e}function p(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function m(t,e,r,n){if(null===t||void 0===t||null===e||void 0===e)return!1;if(b.isPrimitive(t)||b.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var i=p(t),a=p(e);if(i&&!a||!i&&a)return!1;if(i)return t=w.call(t),e=w.call(e),d(t,e,r);var o,s,l=T(t),u=T(e);if(l.length!==u.length)return!1;for(l.sort(),u.sort(),s=l.length-1;s>=0;s--)if(l[s]!==u[s])return!1;for(s=l.length-1;s>=0;s--)if(o=l[s],!d(t[o],e[o],r,n))return!1;return!0}function g(t,e,r){d(t,e,!0)&&h(t,e,r,"notDeepStrictEqual",g)}function v(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&e.call({},t)===!0}function y(t){var e;try{t()}catch(t){e=t}return e}function x(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=y(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&h(i,r,"Missing expected exception"+n);var a="string"==typeof n,o=!t&&b.isError(i),s=!t&&i&&!r;if((o&&a&&v(i,r)||s)&&h(i,r,"Got unwanted exception"+n),t&&i&&r&&!v(i,r)||!t&&i)throw i}var b=t("util/"),_=Object.prototype.hasOwnProperty,w=Array.prototype.slice,M=function(){return"foo"===function(){}.name}(),A=e.exports=f,k=/\s*function\s+([^\(\s]*)\s*/;A.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=c(this),this.generatedMessage=!0);var e=t.stackStartFunction||h;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=s(e),a=n.indexOf("\n"+i);if(a>=0){var o=n.indexOf("\n",a+1);n=n.substring(o+1)}this.stack=n}}},b.inherits(A.AssertionError,Error),A.fail=h,A.ok=f,A.equal=function(t,e,r){t!=e&&h(t,e,r,"==",A.equal)},A.notEqual=function(t,e,r){t==e&&h(t,e,r,"!=",A.notEqual)},A.deepEqual=function(t,e,r){d(t,e,!1)||h(t,e,r,"deepEqual",A.deepEqual)},A.deepStrictEqual=function(t,e,r){d(t,e,!0)||h(t,e,r,"deepStrictEqual",A.deepStrictEqual)},A.notDeepEqual=function(t,e,r){d(t,e,!1)&&h(t,e,r,"notDeepEqual",A.notDeepEqual)},A.notDeepStrictEqual=g,A.strictEqual=function(t,e,r){t!==e&&h(t,e,r,"===",A.strictEqual)},A.notStrictEqual=function(t,e,r){t===e&&h(t,e,r,"!==",A.notStrictEqual)},A.throws=function(t,e,r){x(!0,t,e,r)},A.doesNotThrow=function(t,e,r){x(!1,t,e,r)},A.ifError=function(t){if(t)throw t};var T=Object.keys||function(t){var e=[];for(var r in t)_.call(t,r)&&e.push(r);return e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":510}],37:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],38:[function(t,e,r){"use strict";function n(t){for(var e=0,r=0;r<t.length;++r)e+=t[r];return e}function i(t,e){for(var r=e.length,i=new Array(r+1),o=0;o<r;++o){for(var s=new Array(r+1),l=0;l<=r;++l)s[l]=t[l][o];i[o]=s}i[r]=new Array(r+1);for(var o=0;o<=r;++o)i[r][o]=1;for(var u=new Array(r+1),o=0;o<r;++o)u[o]=e[o];u[r]=1;var c=a(i,u),h=n(c[r+1]);0===h&&(h=1);for(var f=new Array(r+1),o=0;o<=r;++o)f[o]=n(c[o])/h;return f}e.exports=i;var a=t("robust-linear-solve")},{"robust-linear-solve":470}],39:[function(t,e,r){"use strict";function n(t,e){return i(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}var i=t("./lib/rationalize");e.exports=n},{"./lib/rationalize":49}],40:[function(t,e,r){"use strict";function n(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}e.exports=n},{}],41:[function(t,e,r){"use strict";function n(t,e){return i(t[0].mul(e[1]),t[1].mul(e[0]))}var i=t("./lib/rationalize");e.exports=n},{"./lib/rationalize":49}],42:[function(t,e,r){"use strict";function n(t,e){if(i(t))return e?u(t,n(e)):[t[0].clone(),t[1].clone()];var r,c,h=0;if(a(t))r=t.clone();else if("string"==typeof t)r=s(t);else{if(0===t)return[o(0),o(1)];if(t===Math.floor(t))r=o(t);else{for(;t!==Math.floor(t);)t*=Math.pow(2,256),h-=256;r=o(t)}}if(i(e))r.mul(e[1]),c=e[0].clone();else if(a(e))c=e.clone();else if("string"==typeof e)c=s(e);else if(e)if(e===Math.floor(e))c=o(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),h+=256;c=o(e)}else c=o(1);return h>0?r=r.shln(h):h<0&&(c=c.shln(-h)),l(r,c)}var i=t("./is-rat"),a=t("./lib/is-bn"),o=t("./lib/num-to-bn"),s=t("./lib/str-to-bn"),l=t("./lib/rationalize"),u=t("./div");e.exports=n},{"./div":41,"./is-rat":43,"./lib/is-bn":47,"./lib/num-to-bn":48,"./lib/rationalize":49,"./lib/str-to-bn":50}],43:[function(t,e,r){"use strict";function n(t){return Array.isArray(t)&&2===t.length&&i(t[0])&&i(t[1])}var i=t("./lib/is-bn");e.exports=n},{"./lib/is-bn":47}],44:[function(t,e,r){"use strict";function n(t){return t.cmp(new i(0))}var i=t("bn.js");e.exports=n},{"bn.js":57}],45:[function(t,e,r){"use strict";function n(t){var e=t.length,r=t.words,n=0;if(1===e)n=r[0];else if(2===e)n=r[0]+67108864*r[1];else for(var n=0,i=0;i<e;i++){var a=r[i];n+=a*Math.pow(67108864,i)}return t.sign?-n:n}e.exports=n},{}],46:[function(t,e,r){"use strict";function n(t){var e=a(i.lo(t));if(e<32)return e;var r=a(i.hi(t));return r>20?52:r+32}var i=t("double-bits"),a=t("bit-twiddle").countTrailingZeros;e.exports=n},{"bit-twiddle":56,"double-bits":99}],47:[function(t,e,r){"use strict";function n(t){return t&&"object"==typeof t&&Boolean(t.words)}t("bn.js");e.exports=n},{"bn.js":57}],48:[function(t,e,r){"use strict";function n(t){var e=a.exponent(t);return e<52?new i(t):new i(t*Math.pow(2,52-e)).shln(e-52)}var i=t("bn.js"),a=t("double-bits");e.exports=n},{"bn.js":57,"double-bits":99}],49:[function(t,e,r){"use strict";function n(t,e){var r=a(t),n=a(e);if(0===r)return[i(0),i(1)];if(0===n)return[i(0),i(0)];n<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);return o.cmpn(1)?[t.div(o),e.div(o)]:[t,e]}var i=t("./num-to-bn"),a=t("./bn-sign");e.exports=n},{"./bn-sign":44,"./num-to-bn":48}],50:[function(t,e,r){"use strict";function n(t){return new i(t)}var i=t("bn.js");e.exports=n},{"bn.js":57}],51:[function(t,e,r){"use strict";function n(t,e){return i(t[0].mul(e[0]),t[1].mul(e[1]))}var i=t("./lib/rationalize");e.exports=n},{"./lib/rationalize":49}],52:[function(t,e,r){"use strict";function n(t){return i(t[0])*i(t[1])}var i=t("./lib/bn-sign");e.exports=n},{"./lib/bn-sign":44}],53:[function(t,e,r){"use strict";function n(t,e){return i(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}var i=t("./lib/rationalize");e.exports=n},{"./lib/rationalize":49}],54:[function(t,e,r){"use strict";function n(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var n=e.divmod(r),o=n.div,s=i(o),l=n.mod;if(0===l.cmpn(0))return s;if(s){var u=a(s)+4,c=i(l.shln(u).divRound(r));return s<0&&(c=-c),s+c*Math.pow(2,-u)}var h=r.bitLength()-l.bitLength()+53,c=i(l.shln(h).divRound(r));return h<1023?c*Math.pow(2,-h):(c*=Math.pow(2,-1023),c*Math.pow(2,1023-h))}var i=t("./lib/bn-to-num"),a=t("./lib/ctz");e.exports=n},{"./lib/bn-to-num":45,"./lib/ctz":46}],55:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=["function ",t,"(a,l,h,",n.join(","),"){",a?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return a?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),r?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),a?o.push("return -1};"):o.push("return i};"),o.join("")}function i(t,e,r,i){var a=new Function([n("A","x"+t+"y",e,["y"],!1,i),n("B","x"+t+"y",e,["y"],!0,i),n("P","c(x,y)"+t+"0",e,["y","c"],!1,i),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""));return a()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],56:[function(t,e,r){"use strict";"use restrict";function n(t){var e=32;return t&=-t,t&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}var i=32;r.INT_BITS=i,r.INT_MAX=2147483647,r.INT_MIN=-1<<i-1,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>i-1;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t<e)},r.max=function(t,e){return t^(t^e)&-(t<e)},r.isPow2=function(t){return!(t&t-1||!t)},r.log2=function(t){var e,r;return e=(t>65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,e|=r,e|t>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return t-=t>>>1&1431655765,t=(858993459&t)+(t>>>2&858993459),16843009*(t+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,t&=15,27030>>>t&1};var a=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<<i&255}}(a),r.reverse=function(t){return a[255&t]<<24|a[t>>>8&255]<<16|a[t>>>16&255]<<8|a[t>>>24&255]},r.interleave2=function(t,e){return t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},r.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),t=65535&(t|t>>>16),t<<16>>16},r.interleave3=function(t,e,r){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),t|r<<2},r.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),t=1023&(t|t>>>16),t<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],57:[function(t,e,r){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function i(t,e,r){return null!==t&&"object"==typeof t&&Array.isArray(t.words)?t:(this.sign=!1,this.words=null,this.length=0,this.red=null,"le"!==e&&"be"!==e||(r=e,e=10),void(null!==t&&this._init(t||0,e||10,r||"be")))}function a(t,e,r){for(var n=0,i=Math.min(t.length,r),a=e;a<i;a++){var o=t.charCodeAt(a)-48;n<<=4,n|=o>=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function o(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o<a;o++){var s=t.charCodeAt(o)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}function s(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).ishln(this.n).isub(this.p),this.tmp=this._tmp()}function l(){s.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function u(){s.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function c(){s.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function h(){s.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function f(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function d(t){f.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).ishln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv.sign=!0,this.minv=this.minv.mod(this.r)}"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26,i.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36),t=t.toString().replace(/\s+/g,"");var i=0;"-"===t[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.sign=!0),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initNumber=function(t,e,n){t<0&&(this.sign=!0,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initArray=function(t,e,n){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a=0;if("be"===n)for(var i=t.length-1,o=0;i>=0;i-=3){var s=t[i]|t[i-1]<<8|t[i-2]<<16;this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,a+=24,a>=26&&(a-=26,o++)}else if("le"===n)for(var i=0,o=0;i<t.length;i+=3){var s=t[i]|t[i+1]<<8|t[i+2]<<16;this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,a+=24,a>=26&&(a-=26,o++)}return this.strip()},i.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;for(var n=0,r=t.length-6,i=0;r>=e;r-=6){var o=a(t,r,r+6);this.words[i]|=o<<n&67108863,this.words[i+1]|=o>>>26-n&4194303,n+=24,n>=26&&(n-=26,i++)}if(r+6!==e){var o=a(t,e,r+6);this.words[i]|=o<<n&67108863,this.words[i+1]|=o>>>26-n&4194303}this.strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,s=a%n,l=Math.min(a,a-s)+r,u=0,c=r;c<l;c+=n)u=o(t,c,c+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){for(var h=1,u=o(t,c,t.length,e),c=0;c<s;c++)h*=e;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},i.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.sign=this.sign,t.red=this.red},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.sign=!1),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],m=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],g=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(t,e){if(t=t||10,16===t||"hex"===t){for(var n="",i=0,e=0|e||1,a=0,o=0;o<this.length;o++){var s=this.words[o],l=(16777215&(s<<i|a)).toString(16);a=s>>>24-i&16777215,n=0!==a||o!==this.length-1?p[6-l.length]+l+n:l+n,i+=2,i>=26&&(i-=26,o--)}for(0!==a&&(n=a.toString(16)+n);n.length%e!==0;)n="0"+n;return this.sign&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var u=m[t],c=g[t],n="",h=this.clone();for(h.sign=!1;0!==h.cmpn(0);){var f=h.modn(c).toString(t);h=h.idivn(c),n=0!==h.cmpn(0)?p[u-f.length]+f+n:f+n}return 0===this.cmpn(0)&&(n="0"+n),this.sign&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toArray=function(t){this.strip();var e=new Array(this.byteLength());e[0]=0;var r=this.clone();if("le"!==t)for(var n=0;0!==r.cmpn(0);n++){var i=r.andln(255);r.ishrn(8),e[e.length-n-1]=i}else for(var n=0;0!==r.cmpn(0);n++){var i=r.andln(255);r.ishrn(8),e[n]=i}return e},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},i.prototype.bitLength=function(){var t=0,e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(0===this.cmpn(0))return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.neg=function(){if(0===this.cmpn(0))return this.clone();var t=this.clone();return t.sign=!this.sign,t},i.prototype.ior=function(t){for(this.sign=this.sign||t.sign;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.iand=function(t){this.sign=this.sign&&t.sign;var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.ixor=function(t){this.sign=this.sign||t.sign;var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);for(var n=t/26|0,i=t%26;this.length<=n;)this.words[this.length++]=0;return e?this.words[n]=this.words[n]|1<<i:this.words[n]=this.words[n]&~(1<<i),this.strip()},i.prototype.iadd=function(t){if(this.sign&&!t.sign){this.sign=!1;var e=this.isub(t);return this.sign=!this.sign,this._normSign()}if(!this.sign&&t.sign){t.sign=!1;var e=this.isub(t);return t.sign=!0,e._normSign()}var r,n;this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a<n.length;a++){var e=r.words[a]+n.words[a]+i;this.words[a]=67108863&e,i=e>>>26}for(;0!==i&&a<r.length;a++){var e=r.words[a]+i;this.words[a]=67108863&e,i=e>>>26}if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},i.prototype.add=function(t){if(t.sign&&!this.sign){t.sign=!1;var e=this.sub(t);return t.sign=!0,e}if(!t.sign&&this.sign){this.sign=!1;var e=t.sub(this);return this.sign=!0,e}return this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(t.sign){t.sign=!1;var e=this.iadd(t);return t.sign=!0,e._normSign()}if(this.sign)return this.sign=!1,this.iadd(t),this.sign=!0,this._normSign();var r=this.cmp(t);if(0===r)return this.sign=!1,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=t):(n=t,i=this);for(var a=0,o=0;o<i.length;o++){var e=n.words[o]-i.words[o]+a;a=e>>26,this.words[o]=67108863&e}for(;0!==a&&o<n.length;o++){var e=n.words[o]+a;a=e>>26,this.words[o]=67108863&e}if(0===a&&o<n.length&&n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this.length=Math.max(this.length,o),n!==this&&(this.sign=!0),this.strip()},i.prototype.sub=function(t){return this.clone().isub(t)},i.prototype._smallMulTo=function(t,e){e.sign=t.sign!==this.sign,e.length=this.length+t.length;for(var r=0,n=0;n<e.length-1;n++){for(var i=r>>>26,a=67108863&r,o=Math.min(n,t.length-1),s=Math.max(0,n-this.length+1);s<=o;s++){var l=n-s,u=0|this.words[l],c=0|t.words[s],h=u*c,f=67108863&h;i=i+(h/67108864|0)|0,f=f+a|0,a=67108863&f,i=i+(f>>>26)|0}e.words[n]=a,r=i}return 0!==r?e.words[n]=r:e.length--,e.strip()},i.prototype._bigMulTo=function(t,e){e.sign=t.sign!==this.sign,e.length=this.length+t.length;for(var r=0,n=0,i=0;i<e.length-1;i++){var a=n;n=0;for(var o=67108863&r,s=Math.min(i,t.length-1),l=Math.max(0,i-this.length+1);l<=s;l++){var u=i-l,c=0|this.words[u],h=0|t.words[l],f=c*h,d=67108863&f;a=a+(f/67108864|0)|0,d=d+o|0,o=67108863&d,a=a+(d>>>26)|0,n+=a>>>26,a&=67108863}e.words[i]=o,r=a,a=n}return 0!==r?e.words[i]=r:e.length--,e.strip()},i.prototype.mulTo=function(t,e){var r;return r=this.length+t.length<63?this._smallMulTo(t,e):this._bigMulTo(t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.imul=function(t){if(0===this.cmpn(0)||0===t.cmpn(0))return this.words[0]=0,this.length=1,this;var e=this.length,r=t.length;this.sign=t.sign!==this.sign,this.length=this.length+t.length,this.words[this.length-1]=0;for(var n=this.length-2;n>=0;n--){for(var i=0,a=0,o=Math.min(n,r-1),s=Math.max(0,n-e+1);s<=o;s++){var l=n-s,u=this.words[l],c=t.words[s],h=u*c,f=67108863&h;i+=h/67108864|0,f+=a,a=67108863&f,i+=f>>>26}this.words[n]=a,this.words[n+1]+=i,i=0}for(var i=0,l=1;l<this.length;l++){var d=this.words[l]+i;this.words[l]=67108863&d,i=d>>>26}return this.strip()},i.prototype.imuln=function(t){r("number"==typeof t);for(var e=0,n=0;n<this.length;n++){var i=this.words[n]*t,a=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=a>>>26,this.words[n]=67108863&a}return 0!==e&&(this.words[n]=e,this.length++),this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.mul(this)},i.prototype.ishln=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=67108863>>>26-e<<26-e;if(0!==e){for(var a=0,o=0;o<this.length;o++){var s=this.words[o]&i,l=this.words[o]-s<<e;this.words[o]=l|a,a=s>>>26-e}a&&(this.words[o]=a,this.length++)}if(0!==n){for(var o=this.length-1;o>=0;o--)this.words[o+n]=this.words[o];for(var o=0;o<n;o++)this.words[o]=0;this.length+=n}return this.strip()},i.prototype.ishrn=function(t,e,n){r("number"==typeof t&&t>=0);var i;i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<<a,l=n;if(i-=o,i=Math.max(0,i),l){for(var u=0;u<o;u++)l.words[u]=this.words[u];l.length=o}if(0===o);else if(this.length>o){this.length-=o;for(var u=0;u<this.length;u++)this.words[u]=this.words[u+o]}else this.words[0]=0,this.length=1;for(var c=0,u=this.length-1;u>=0&&(0!==c||u>=i);u--){var h=this.words[u];this.words[u]=c<<26-a|h>>>a,c=h&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),this},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<<e;if(this.length<=n)return!1;var a=this.words[n];return!!(a&i)},i.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26;if(r(!this.sign,"imaskn works only with positive numbers"),0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.prototype.iaddn=function(t){return r("number"==typeof t),t<0?this.isubn(-t):this.sign?1===this.length&&this.words[0]<t?(this.words[0]=t-this.words[0],this.sign=!1,this):(this.sign=!1,this.isubn(t),this.sign=!0,this):this._iaddn(t)},i.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(r("number"==typeof t),t<0)return this.iaddn(-t);if(this.sign)return this.sign=!1,this.iaddn(t),this.sign=!0,this;this.words[0]-=t;for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.sign=!1,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,n){var i,a=t.length+n;if(this.words.length<a){for(var o=new Array(a),i=0;i<this.length;i++)o[i]=this.words[i];this.words=o}else i=this.length;for(this.length=Math.max(this.length,a);i<this.length;i++)this.words[i]=0;for(var s=0,i=0;i<t.length;i++){var l=this.words[i+n]+s,u=t.words[i]*e;l-=67108863&u,s=(l>>26)-(u/67108864|0),this.words[i+n]=67108863&l}for(;i<this.length-n;i++){var l=this.words[i+n]+s;s=l>>26,this.words[i+n]=67108863&l}if(0===s)return this.strip();r(s===-1),s=0;for(var i=0;i<this.length;i++){var l=-this.words[i]+s;s=l>>26,this.words[i]=67108863&l}return this.sign=!0,this.strip()},i.prototype._wordDiv=function(t,e){var r=this.length-t.length,n=this.clone(),a=t,o=a.words[a.length-1],s=this._countBits(o);r=26-s,0!==r&&(a=a.shln(r),n.ishln(r),o=a.words[a.length-1]);var l,u=n.length-a.length;if("mod"!==e){l=new i(null),l.length=u+1,l.words=new Array(l.length);for(var c=0;c<l.length;c++)l.words[c]=0}var h=n.clone()._ishlnsubmul(a,1,u);h.sign||(n=h,l&&(l.words[u]=1));for(var f=u-1;f>=0;f--){var d=67108864*n.words[a.length+f]+n.words[a.length+f-1];for(d=Math.min(d/o|0,67108863),n._ishlnsubmul(a,d,f);n.sign;)d--,n.sign=!1,n._ishlnsubmul(a,1,f),0!==n.cmpn(0)&&(n.sign=!n.sign);l&&(l.words[f]=d)}return l&&l.strip(),n.strip(),"div"!==e&&0!==r&&n.ishrn(r),{div:l?l:null,mod:n}},i.prototype.divmod=function(t,e){if(r(0!==t.cmpn(0)),this.sign&&!t.sign){var n,a,o=this.neg().divmod(t,e);return"mod"!==e&&(n=o.div.neg()),"div"!==e&&(a=0===o.mod.cmpn(0)?o.mod:t.sub(o.mod)),{div:n,mod:a}}if(!this.sign&&t.sign){var n,o=this.divmod(t.neg(),e);return"mod"!==e&&(n=o.div.neg()),{div:n,mod:o.mod}}return this.sign&&t.sign?this.neg().divmod(t.neg(),e):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,e)},i.prototype.div=function(t){return this.divmod(t,"div").div},i.prototype.mod=function(t){return this.divmod(t,"mod").mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(0===e.mod.cmpn(0))return e.div;var r=e.div.sign?e.mod.isub(t):e.mod,n=t.shrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:e.div.sign?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,n=0,i=this.length-1;i>=0;i--)n=(e*n+this.words[i])%t;return n},i.prototype.idivn=function(t){r(t<=67108863);for(var e=0,n=this.length-1;n>=0;n--){var i=this.words[n]+67108864*e;this.words[n]=i/t|0,e=i%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(!t.sign),r(0!==t.cmpn(0));var e=this,n=t.clone();e=e.sign?e.mod(t):e.clone();for(var a=new i(1),o=new i(0),s=new i(0),l=new i(1),u=0;e.isEven()&&n.isEven();)e.ishrn(1),n.ishrn(1),++u;for(var c=n.clone(),h=e.clone();0!==e.cmpn(0);){for(;e.isEven();)e.ishrn(1),a.isEven()&&o.isEven()?(a.ishrn(1),o.ishrn(1)):(a.iadd(c).ishrn(1),o.isub(h).ishrn(1));for(;n.isEven();)n.ishrn(1),s.isEven()&&l.isEven()?(s.ishrn(1),l.ishrn(1)):(s.iadd(c).ishrn(1),l.isub(h).ishrn(1));e.cmp(n)>=0?(e.isub(n),a.isub(s),o.isub(l)):(n.isub(e),s.isub(a),l.isub(o))}return{a:s,b:l,gcd:n.ishln(u)}},i.prototype._invmp=function(t){r(!t.sign),r(0!==t.cmpn(0));var e=this,n=t.clone();e=e.sign?e.mod(t):e.clone();for(var a=new i(1),o=new i(0),s=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(;e.isEven();)e.ishrn(1),a.isEven()?a.ishrn(1):a.iadd(s).ishrn(1);for(;n.isEven();)n.ishrn(1),o.isEven()?o.ishrn(1):o.iadd(s).ishrn(1);e.cmp(n)>=0?(e.isub(n),a.isub(o)):(n.isub(e),o.isub(a))}return 0===e.cmpn(1)?a:o},i.prototype.gcd=function(t){if(0===this.cmpn(0))return t.clone();if(0===t.cmpn(0))return this.clone();var e=this.clone(),r=t.clone();e.sign=!1,r.sign=!1;for(var n=0;e.isEven()&&r.isEven();n++)e.ishrn(1),r.ishrn(1);for(;;){for(;e.isEven();)e.ishrn(1);for(;r.isEven();)r.ishrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.ishln(n)},i.prototype.invm=function(t){return this.egcd(t).a.mod(t)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<<e;if(this.length<=n){for(var a=this.length;a<n+1;a++)this.words[a]=0;return this.words[n]|=i,this.length=n+1,this}for(var o=i,a=n;0!==o&&a<this.length;a++){var s=this.words[a];s+=o,o=s>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.cmpn=function(t){var e=t<0;if(e&&(t=-t),this.sign&&!e)return-1;if(!this.sign&&e)return 1;t&=67108863,this.strip();var r;if(this.length>1)r=1;else{var n=this.words[0];r=n===t?0:n<t?-1:1}return this.sign&&(r=-r),r},i.prototype.cmp=function(t){if(this.sign&&!t.sign)return-1;if(!this.sign&&t.sign)return 1;var e=this.ucmp(t);return this.sign?-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=this.words[r],i=t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},i.red=function(t){return new f(t)},i.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(!this.sign,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};s.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},s.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),e=r.bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):r.strip(),r},s.prototype.split=function(t,e){t.ishrn(this.n,0,e)},s.prototype.imulK=function(t){return t.imul(this.k)},n(l,s),l.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var a=t.words[9];e.words[e.length++]=a&r;for(var i=10;i<t.length;i++){var o=t.words[i];t.words[i-10]=(o&r)<<4|a>>>22,a=o}t.words[i-10]=a>>>22,t.length-=9},l.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e,r=0,n=0;n<t.length;n++){var i=t.words[n];e=64*i,r+=977*i,e+=r/67108864|0,r&=67108863,t.words[n]=r,r=e}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(u,s),n(c,s),n(h,s),h.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*t.words[r]+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function t(e){if(v[e])return v[e];var t;if("k256"===e)t=new l;else if("p224"===e)t=new u;else if("p192"===e)t=new c;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new h}return v[e]=t,t},f.prototype._verify1=function(t){r(!t.sign,"red works only with positives"),r(t.red,"red works only with red numbers")},f.prototype._verify2=function(t,e){r(!t.sign&&!e.sign,"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},f.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.mod(this.m)._forceRed(this)},f.prototype.neg=function(t){var e=t.clone();return e.sign=!e.sign,e.iadd(this.m)._forceRed(this)},f.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},f.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},f.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},f.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},f.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.shln(e))},f.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},f.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},f.prototype.isqr=function(t){return this.imul(t,t)},f.prototype.sqr=function(t){return this.mul(t,t)},f.prototype.sqrt=function(t){if(0===t.cmpn(0))return t.clone();var e=this.m.andln(3);if(r(e%2===1),3===e){var n=this.m.add(new i(1)).ishrn(2),a=this.pow(t,n);return a}for(var o=this.m.subn(1),s=0;0!==o.cmpn(0)&&0===o.andln(1);)s++,o.ishrn(1);r(0!==o.cmpn(0));var l=new i(1).toRed(this),u=l.redNeg(),c=this.m.subn(1).ishrn(1),h=this.m.bitLength();for(h=new i(2*h*h).toRed(this);0!==this.pow(h,c).cmp(u);)h.redIAdd(u);for(var f=this.pow(h,o),a=this.pow(t,o.addn(1).ishrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(l);){for(var m=d,g=0;0!==m.cmp(l);g++)m=m.redSqr();r(g<p);var v=this.pow(f,new i(1).ishln(p-g-1));a=a.redMul(v),f=v.redSqr(),d=d.redMul(f),p=g}return a},f.prototype.invm=function(t){var e=t._invmp(this.m);return e.sign?(e.sign=!1,this.imod(e).redNeg()):this.imod(e)},f.prototype.pow=function(t,e){var r=[];if(0===e.cmpn(0))return new i(1);for(var n=e.clone();0!==n.cmpn(0);)r.push(n.andln(1)),n.ishrn(1);for(var a=t,o=0;o<r.length&&0===r[o];o++,a=this.sqr(a));if(++o<r.length)for(var n=this.sqr(a);o<r.length;o++,n=this.sqr(n))0!==r[o]&&(a=this.mul(a,n));return a},f.prototype.convertTo=function(t){var e=t.mod(this.m);return e===t?e.clone():e},f.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new d(t)},n(d,f),d.prototype.convertTo=function(t){return this.imod(t.shln(this.shift))},d.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},d.prototype.imul=function(t,e){if(0===t.cmpn(0)||0===e.cmpn(0))return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).ishrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},d.prototype.mul=function(t,e){if(0===t.cmpn(0)||0===e.cmpn(0))return new i(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).ishrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},d.prototype.invm=function(t){var e=this.imod(t._invmp(this.m).mul(this.r2));return e._forceRed(this)}}("undefined"==typeof e||e,this)},{}],58:[function(t,e,r){"use strict";function n(t){var e,r,n,i=t.length,a=0;for(e=0;e<i;++e)a+=t[e].length;var o=new Array(a),s=0;for(e=0;e<i;++e){var l=t[e],u=l.length;for(r=0;r<u;++r){var c=o[s++]=new Array(u-1),h=0;for(n=0;n<u;++n)n!==r&&(c[h++]=l[n]);if(1&r){var f=c[1];c[1]=c[0],c[0]=f}}}return o}e.exports=n},{}],59:[function(t,e,r){"use strict";function n(t,e){for(var r=0;r<t;++r)if(!(e[r]<=e[r+t]))return!0;return!1}function i(t,e,r,i){for(var a=0,o=0,s=0,l=t.length;s<l;++s){var u=t[s];if(!n(e,u)){for(var c=0;c<2*e;++c)r[a++]=u[c];i[o++]=s}}return o}function a(t,e,r,n){var a=t.length,o=e.length;if(!(a<=0||o<=0)){var s=t[0].length>>>1;if(!(s<=0)){var l,u=h.mallocDouble(2*s*a),c=h.mallocInt32(a);if(a=i(t,s,u,c),a>0){if(1===s&&n)f.init(a),l=f.sweepComplete(s,r,0,a,u,c,0,a,u,c);else{var p=h.mallocDouble(2*s*o),m=h.mallocInt32(o);o=i(e,s,p,m),o>0&&(f.init(a+o),l=1===s?f.sweepBipartite(s,r,0,a,u,c,0,o,p,m):d(s,r,n,a,u,c,o,p,m),h.free(p),h.free(m))}h.free(u),h.free(c)}return l}}}function o(t,e){c.push([t,e])}function s(t){return c=[],a(t,t,o,!0),c}function l(t,e){return c=[],a(t,e,o,!1),c}function u(t,e,r){switch(arguments.length){case 1:return s(t);case 2:return"function"==typeof e?a(t,t,e,!0):l(t,e);case 3:return a(t,e,r,!1);default:throw new Error("box-intersect: Invalid arguments")}}e.exports=u;var c,h=t("typedarray-pool"),f=t("./lib/sweep"),d=t("./lib/intersect")},{"./lib/intersect":61,"./lib/sweep":65,"typedarray-pool":502}],60:[function(t,e,r){"use strict";function n(t,e,r){var n="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),i=["function ",n,"(",w.join(),"){","var ",u,"=2*",a,";"],l="for(var i="+c+","+p+"="+u+"*"+c+";i<"+h+";++i,"+p+"+="+u+"){var x0="+f+"["+o+"+"+p+"],x1="+f+"["+o+"+"+p+"+"+a+"],xi="+d+"[i];",M="for(var j="+m+","+x+"="+u+"*"+m+";j<"+g+";++j,"+x+"+="+u+"){var y0="+v+"["+o+"+"+x+"],"+(r?"y1="+v+"["+o+"+"+x+"+"+a+"],":"")+"yi="+y+"[j];";return t?i.push(l,_,":",M):i.push(M,_,":",l),r?i.push("if(y1<x0||x1<y0)continue;"):e?i.push("if(y0<=x0||x1<y0)continue;"):i.push("if(y0<x0||x1<y0)continue;"),i.push("for(var k="+o+"+1;k<"+a+";++k){var r0="+f+"[k+"+p+"],r1="+f+"[k+"+a+"+"+p+"],b0="+v+"[k+"+x+"],b1="+v+"[k+"+a+"+"+x+"];if(r1<b0||b1<r0)continue "+_+";}var "+b+"="+s+"("),e?i.push("yi,xi"):i.push("xi,yi"),i.push(");if("+b+"!==void 0)return "+b+";}}}"),{name:n,code:i.join("")}}function i(t){function e(e,r){var a=n(e,r,t);i.push(a.code),o.push("return "+a.name+"("+w.join()+");")}var r="bruteForce"+(t?"Full":"Partial"),i=[],a=w.slice();t||a.splice(3,0,l);var o=["function "+r+"("+a.join()+"){"];o.push("if("+h+"-"+c+">"+g+"-"+m+"){"),t?(e(!0,!1),o.push("}else{"),e(!1,!1)):(o.push("if("+l+"){"),e(!0,!0),o.push("}else{"),e(!0,!1),o.push("}}else{if("+l+"){"),e(!1,!0),o.push("}else{"),e(!1,!1),o.push("}")),o.push("}}return "+r);var s=i.join("")+o.join(""),u=new Function(s);return u()}var a="d",o="ax",s="vv",l="fp",u="es",c="rs",h="re",f="rb",d="ri",p="rp",m="bs",g="be",v="bb",y="bi",x="bp",b="rv",_="Q",w=[a,o,s,c,h,f,d,m,g,v,y];r.partial=i(!1),r.full=i(!0)},{}],61:[function(t,e,r){"use strict";function n(t,e){var r=8*u.log2(e+1)*(t+1)|0,n=u.nextPow2(k*r);S.length<n&&(l.free(S),S=l.mallocInt32(n));var i=u.nextPow2(T*r);L<i&&(l.free(L),L=l.mallocDouble(i))}function i(t,e,r,n,i,a,o,s,l){var u=k*t;S[u]=e,S[u+1]=r,S[u+2]=n,S[u+3]=i,S[u+4]=a,S[u+5]=o;var c=T*t;L[c]=s,L[c+1]=l}function a(t,e,r,n,i,a,o,s,l,u,c){var h=2*t,f=l*h,d=u[f+e];t:for(var p=i,m=i*h;p<a;++p,m+=h){var g=o[m+e],v=o[m+e+t];if(!(d<g||v<d||n&&d===g)){for(var y=s[p],x=e+1;x<t;++x){var g=o[m+x],v=o[m+x+t],b=u[f+x],_=u[f+x+t];if(v<b||_<g)continue t}var w;if(w=n?r(c,y):r(y,c),void 0!==w)return w}}}function o(t,e,r,n,i,a,o,s,l,u){var c=2*t,h=s*c,f=l[h+e];t:for(var d=n,p=n*c;d<i;++d,p+=c){var m=o[d];if(m!==u){var g=a[p+e],v=a[p+e+t];if(!(f<g||v<f)){for(var y=e+1;y<t;++y){var g=a[p+y],v=a[p+y+t],x=l[h+y],b=l[h+y+t];if(v<x||b<g)continue t}var _=r(m,u);if(void 0!==_)return _}}}}function s(t,e,r,s,l,u,c,m,E){n(t,s+c);var C,I=0,z=2*t;for(i(I++,0,0,s,0,c,r?16:0,-(1/0),1/0),r||i(I++,0,0,c,0,s,1,-(1/0),1/0);I>0;){I-=1;var D=I*k,P=S[D],O=S[D+1],R=S[D+2],F=S[D+3],j=S[D+4],N=S[D+5],B=I*T,U=L[B],V=L[B+1],q=1&N,H=!!(16&N),Y=l,G=u,X=m,W=E;if(q&&(Y=m,G=E,X=l,W=u),!(2&N&&(R=_(t,P,O,R,Y,G,V),O>=R)||4&N&&(O=w(t,P,O,R,Y,G,U),O>=R))){var Z=R-O,J=j-F;if(H){if(t*Z*(Z+J)<y){if(C=d.scanComplete(t,P,e,O,R,Y,G,F,j,X,W),void 0!==C)return C;continue}}else{if(t*Math.min(Z,J)<g){if(C=h(t,P,e,q,O,R,Y,G,F,j,X,W),void 0!==C)return C;continue}if(t*Z*J<v){if(C=d.scanBipartite(t,P,e,q,O,R,Y,G,F,j,X,W),void 0!==C)return C;continue}}var K=x(t,P,O,R,Y,G,U,V);if(O<K)if(t*(K-O)<g){if(C=f(t,P+1,e,O,K,Y,G,F,j,X,W),void 0!==C)return C}else if(P===t-2){if(C=q?d.sweepBipartite(t,e,F,j,X,W,O,K,Y,G):d.sweepBipartite(t,e,O,K,Y,G,F,j,X,W),void 0!==C)return C}else i(I++,P+1,O,K,F,j,q,-(1/0),1/0),i(I++,P+1,F,j,O,K,1^q,-(1/0),1/0);if(K<R){var Q=p(t,P,F,j,X,W),$=X[z*Q+P],tt=b(t,P,Q,j,X,W,$);if(tt<j&&i(I++,P,K,R,tt,j,(4|q)+(H?16:0),$,V),F<Q&&i(I++,P,K,R,F,Q,(2|q)+(H?16:0),U,$),Q+1===tt){if(C=H?o(t,P,e,K,R,Y,G,Q,X,W[Q]):a(t,P,e,q,K,R,Y,G,Q,X,W[Q]),void 0!==C)return C}else if(Q<tt){var et;if(H){if(et=M(t,P,K,R,Y,G,$),K<et){var rt=b(t,P,K,et,Y,G,$);if(P===t-2){if(K<rt&&(C=d.sweepComplete(t,e,K,rt,Y,G,Q,tt,X,W),void 0!==C))return C;if(rt<et&&(C=d.sweepBipartite(t,e,rt,et,Y,G,Q,tt,X,W),void 0!==C))return C}else K<rt&&i(I++,P+1,K,rt,Q,tt,16,-(1/0),1/0),rt<et&&(i(I++,P+1,rt,et,Q,tt,0,-(1/0),1/0),i(I++,P+1,Q,tt,rt,et,1,-(1/0),1/0))}}else et=q?A(t,P,K,R,Y,G,$):M(t,P,K,R,Y,G,$),K<et&&(P===t-2?C=q?d.sweepBipartite(t,e,Q,tt,X,W,K,et,Y,G):d.sweepBipartite(t,e,K,et,Y,G,Q,tt,X,W):(i(I++,P+1,K,et,Q,tt,q,-(1/0),1/0),i(I++,P+1,Q,tt,K,et,1^q,-(1/0),1/0)))}}}}}e.exports=s;var l=t("typedarray-pool"),u=t("bit-twiddle"),c=t("./brute"),h=c.partial,f=c.full,d=t("./sweep"),p=t("./median"),m=t("./partition"),g=128,v=1<<22,y=1<<22,x=m("!(lo>=p0)&&!(p1>=hi)",["p0","p1"]),b=m("lo===p0",["p0"]),_=m("lo<p0",["p0"]),w=m("hi<=p0",["p0"]),M=m("lo<=p0&&p0<=hi",["p0"]),A=m("lo<p0&&p0<=hi",["p0"]),k=6,T=2,E=1024,S=l.mallocInt32(E),L=l.mallocDouble(E)},{"./brute":60,"./median":62,"./partition":63,"./sweep":65,"bit-twiddle":56,"typedarray-pool":502}],62:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){for(var o=2*t,s=o*(r+1)+e,l=r+1;l<n;++l,s+=o)for(var u=i[s],c=l,h=o*(l-1);c>r&&i[h+e]>u;--c,h-=o){for(var f=h,d=h+o,p=0;p<o;++p,++f,++d){var m=i[f];i[f]=i[d],i[d]=m}var g=a[c];a[c]=a[c-1],a[c-1]=g}}function i(t,e,r,i,a,l){if(i<=r+1)return r;for(var u=r,c=i,h=i+r>>>1,f=2*t,d=h,p=a[f*h+e];u<c;){if(c-u<s){n(t,e,u,c,a,l),p=a[f*h+e];break}var m=c-u,g=Math.random()*m+u|0,v=a[f*g+e],y=Math.random()*m+u|0,x=a[f*y+e],b=Math.random()*m+u|0,_=a[f*b+e];v<=x?_>=x?(d=y,p=x):v>=_?(d=g,p=v):(d=b,p=_):x>=_?(d=y,p=x):_>=v?(d=g,p=v):(d=b,p=_);for(var w=f*(c-1),M=f*d,A=0;A<f;++A,++w,++M){var k=a[w];a[w]=a[M],a[M]=k}var T=l[c-1];l[c-1]=l[d],l[d]=T,d=o(t,e,u,c-1,a,l,p);for(var w=f*(c-1),M=f*d,A=0;A<f;++A,++w,++M){var k=a[w];a[w]=a[M],a[M]=k}var T=l[c-1];if(l[c-1]=l[d],l[d]=T,h<d){for(c=d-1;u<c&&a[f*(c-1)+e]===p;)c-=1;c+=1}else{if(!(d<h))break;for(u=d+1;u<c&&a[f*u+e]===p;)u+=1}}return o(t,e,r,h,a,l,a[f*h+e])}e.exports=i;var a=t("./partition"),o=a("lo<p0",["p0"]),s=8},{"./partition":63}],63:[function(t,e,r){"use strict";function n(t,e){var r="abcdef".split("").concat(e),n=[];return t.indexOf("lo")>=0&&n.push("lo=e[k+n]"),t.indexOf("hi")>=0&&n.push("hi=e[k+o]"),r.push(i.replace("_",n.join()).replace("$",t)),Function.apply(void 0,r)}e.exports=n;var i="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m"},{}],64:[function(t,e,r){"use strict";function n(t,e){e<=4*f?i(0,e-1,t):h(0,e-1,t)}function i(t,e,r){for(var n=2*(t+1),i=t+1;i<=e;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-- >t;){var u=r[l-2],c=r[l-1];if(u<a)break;if(u===a&&c<o)break;r[l]=u,r[l+1]=c,l-=2}r[l]=a,r[l+1]=o}}function a(t,e,r){t*=2,e*=2;var n=r[t],i=r[t+1];r[t]=r[e],r[t+1]=r[e+1],r[e]=n,r[e+1]=i}function o(t,e,r){t*=2,e*=2,r[t]=r[e],r[t+1]=r[e+1]}function s(t,e,r,n){t*=2,e*=2,r*=2;var i=n[t],a=n[t+1];n[t]=n[e],n[t+1]=n[e+1],n[e]=n[r],n[e+1]=n[r+1],n[r]=i,n[r+1]=a}function l(t,e,r,n,i){t*=2,e*=2,i[t]=i[e],i[e]=r,i[t+1]=i[e+1],i[e+1]=n}function u(t,e,r){t*=2,e*=2;var n=r[t],i=r[e];return!(n<i)&&(n!==i||r[t+1]>r[e+1])}function c(t,e,r,n){t*=2;var i=n[t];return i<e||i===e&&n[t+1]<r}function h(t,e,r){var n=(e-t+1)/6|0,d=t+n,p=e-n,m=t+e>>1,g=m-n,v=m+n,y=d,x=g,b=m,_=v,w=p,M=t+1,A=e-1,k=0;u(y,x,r)&&(k=y,y=x,x=k),u(_,w,r)&&(k=_,_=w,w=k),u(y,b,r)&&(k=y,y=b,b=k),u(x,b,r)&&(k=x,x=b,b=k),u(y,_,r)&&(k=y,y=_,_=k),u(b,_,r)&&(k=b,b=_,_=k),u(x,w,r)&&(k=x,x=w,w=k),u(x,b,r)&&(k=x,x=b,b=k),u(_,w,r)&&(k=_,_=w,w=k);for(var T=r[2*x],E=r[2*x+1],S=r[2*_],L=r[2*_+1],C=2*y,I=2*b,z=2*w,D=2*d,P=2*m,O=2*p,R=0;R<2;++R){var F=r[C+R],j=r[I+R],N=r[z+R];r[D+R]=F,r[P+R]=j,r[O+R]=N}o(g,t,r),o(v,e,r);for(var B=M;B<=A;++B)if(c(B,T,E,r))B!==M&&a(B,M,r),++M;else if(!c(B,S,L,r))for(;;){if(c(A,S,L,r)){c(A,T,E,r)?(s(B,M,A,r),++M,--A):(a(B,A,r),--A);break}if(--A<B)break}l(t,M-1,T,E,r),l(e,A+1,S,L,r),M-2-t<=f?i(t,M-2,r):h(t,M-2,r),e-(A+2)<=f?i(A+2,e,r):h(A+2,e,r),A-M<=f?i(M,A,r):h(M,A,r)}e.exports=n;var f=32},{}],65:[function(t,e,r){"use strict";function n(t){var e=h.nextPow2(t);m.length<e&&(c.free(m),m=c.mallocInt32(e)),g.length<e&&(c.free(g),g=c.mallocInt32(e)),v.length<e&&(c.free(v),v=c.mallocInt32(e)),y.length<e&&(c.free(y),y=c.mallocInt32(e)),x.length<e&&(c.free(x),x=c.mallocInt32(e)),b.length<e&&(c.free(b),b=c.mallocInt32(e));var r=8*e;_.length<r&&(c.free(_),_=c.mallocDouble(r))}function i(t,e,r,n){var i=e[n],a=t[r-1];t[i]=a,e[a]=i}function a(t,e,r,n){t[r]=n,e[n]=r}function o(t,e,r,n,o,s,l,u,c,h){for(var p=0,x=2*t,b=t-1,w=x-1,M=r;M<n;++M){var A=s[M],k=x*M;_[p++]=o[k+b],_[p++]=-(A+1),_[p++]=o[k+w],_[p++]=A}for(var M=l;M<u;++M){var A=h[M]+d,T=x*M;_[p++]=c[T+b],_[p++]=-A,_[p++]=c[T+w],_[p++]=A}var E=p>>>1;f(_,E);for(var S=0,L=0,M=0;M<E;++M){var C=0|_[2*M+1];if(C>=d)C=C-d|0,i(v,y,L--,C);else if(C>=0)i(m,g,S--,C);else if(C<=-d){C=-C-d|0;for(var I=0;I<S;++I){var z=e(m[I],C);if(void 0!==z)return z}a(v,y,L++,C)}else{C=-C-1|0;for(var I=0;I<L;++I){var z=e(C,v[I]);if(void 0!==z)return z}a(m,g,S++,C)}}}function s(t,e,r,n,o,s,l,u,c,h){for(var d=0,p=2*t,w=t-1,M=p-1,A=r;A<n;++A){var k=s[A]+1<<1,T=p*A;_[d++]=o[T+w],_[d++]=-k,_[d++]=o[T+M],_[d++]=k}for(var A=l;A<u;++A){var k=h[A]+1<<1,E=p*A;_[d++]=c[E+w],_[d++]=1|-k,_[d++]=c[E+M],_[d++]=1|k}var S=d>>>1;f(_,S);for(var L=0,C=0,I=0,A=0;A<S;++A){var z=0|_[2*A+1],D=1&z;if(A<S-1&&z>>1===_[2*A+3]>>1&&(D=2,A+=1),z<0){for(var P=-(z>>1)-1,O=0;O<I;++O){var R=e(x[O],P);if(void 0!==R)return R}if(0!==D)for(var O=0;O<L;++O){var R=e(m[O],P);if(void 0!==R)return R}if(1!==D)for(var O=0;O<C;++O){var R=e(v[O],P);if(void 0!==R)return R}0===D?a(m,g,L++,P):1===D?a(v,y,C++,P):2===D&&a(x,b,I++,P)}else{var P=(z>>1)-1;0===D?i(m,g,L--,P):1===D?i(v,y,C--,P):2===D&&i(x,b,I--,P)}}}function l(t,e,r,n,o,s,l,u,c,h,p,v){var y=0,x=2*t,b=e,w=e+t,M=1,A=1;n?A=d:M=d;for(var k=o;k<s;++k){var T=k+M,E=x*k;_[y++]=l[E+b],_[y++]=-T,_[y++]=l[E+w],_[y++]=T}for(var k=c;k<h;++k){var T=k+A,S=x*k;_[y++]=p[S+b],_[y++]=-T}var L=y>>>1;f(_,L);for(var C=0,k=0;k<L;++k){var I=0|_[2*k+1];if(I<0){var T=-I,z=!1;if(T>=d?(z=!n,T-=d):(z=!!n,T-=1),z)a(m,g,C++,T);else{var D=v[T],P=x*T,O=p[P+e+1],R=p[P+e+1+t];t:for(var F=0;F<C;++F){var j=m[F],N=x*j;if(!(R<l[N+e+1]||l[N+e+1+t]<O)){for(var B=e+2;B<t;++B)if(p[P+B+t]<l[N+B]||l[N+B+t]<p[P+B])continue t;var U,V=u[j];if(U=n?r(D,V):r(V,D),void 0!==U)return U}}}}else i(m,g,C--,I-M)}}function u(t,e,r,n,i,a,o,s,l,u,c){for(var h=0,p=2*t,g=e,v=e+t,y=n;y<i;++y){var x=y+d,b=p*y;_[h++]=a[b+g],_[h++]=-x,_[h++]=a[b+v],_[h++]=x}for(var y=s;y<l;++y){var x=y+1,w=p*y;_[h++]=u[w+g],_[h++]=-x}var M=h>>>1;f(_,M);for(var A=0,y=0;y<M;++y){var k=0|_[2*y+1];if(k<0){var x=-k;if(x>=d)m[A++]=x-d;else{x-=1;var T=c[x],E=p*x,S=u[E+e+1],L=u[E+e+1+t];t:for(var C=0;C<A;++C){var I=m[C],z=o[I];if(z===T)break;var D=p*I;if(!(L<a[D+e+1]||a[D+e+1+t]<S)){for(var P=e+2;P<t;++P)if(u[E+P+t]<a[D+P]||a[D+P+t]<u[E+P])continue t;var O=r(z,T);if(void 0!==O)return O}}}}else{for(var x=k-d,C=A-1;C>=0;--C)if(m[C]===x){for(var P=C+1;P<A;++P)m[P-1]=m[P];break}--A}}}e.exports={init:n,sweepBipartite:o,sweepComplete:s,scanBipartite:l,scanComplete:u};var c=t("typedarray-pool"),h=t("bit-twiddle"),f=t("./sort"),d=1<<28,p=1024,m=c.mallocInt32(p),g=c.mallocInt32(p),v=c.mallocInt32(p),y=c.mallocInt32(p),x=c.mallocInt32(p),b=c.mallocInt32(p),_=c.mallocDouble(8*p)},{"./sort":64,"bit-twiddle":56,"typedarray-pool":502}],66:[function(t,e,r){(function(e){"use strict";function n(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}function i(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(i()<e)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=o.prototype):(null===t&&(t=new o(e)),t.length=e),t}function o(t,e,r){if(!(o.TYPED_ARRAY_SUPPORT||this instanceof o))return new o(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return s(this,t,e,r)}function s(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?d(t,e,r,n):"string"==typeof e?h(t,e,r):p(t,e)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function u(t,e,r,n){return l(e),e<=0?a(t,e):void 0!==r?"string"==typeof n?a(t,e).fill(r,n):a(t,e).fill(r):a(t,e)}function c(t,e){if(l(e),t=a(t,e<0?0:0|m(e)),!o.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function h(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!o.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(e,r);t=a(t,n);var i=t.write(e,r);return i!==n&&(t=t.slice(0,i)),t}function f(t,e){var r=e.length<0?0:0|m(e.length);t=a(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function d(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),o.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=o.prototype):t=f(t,e),t}function p(t,e){if(o.isBuffer(e)){var r=0|m(e.length);return t=a(t,r),0===t.length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||J(e.length)?a(t,0):f(t,e);if("Buffer"===e.type&&$(e.data))return f(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function m(t){if(t>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function g(t){return+t!=t&&(t=0),o.alloc(+t)}function v(t,e){if(o.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Y(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(t).length;default:if(n)return Y(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return D(this,e,r);case"utf8":case"utf-8":return L(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return z(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function x(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=o.from(e,n)),o.isBuffer(e))return 0===e.length?-1:_(t,e,r,n,i);if("number"==typeof e)return e&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):_(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function _(t,e,r,n,i){function a(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var o=1,s=t.length,l=e.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}var u;if(i){var c=-1;for(u=r;u<s;u++)if(a(t,u)===a(e,c===-1?0:u-c)){if(c===-1&&(c=u),u-c+1===l)return c*o}else c!==-1&&(u-=u-c),c=-1}else for(r+l>s&&(r=s-l),u=r;u>=0;u--){for(var h=!0,f=0;f<l;f++)if(a(t,u+f)!==a(e,f)){h=!1;break}if(h)return u}return-1}function w(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var a=e.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(e.substr(2*o,2),16);if(isNaN(s))return o;t[r+o]=s}return o}function M(t,e,r,n){return Z(Y(e,t.length-r),t,r,n)}function A(t,e,r,n){return Z(G(e),t,r,n)}function k(t,e,r,n){return A(t,e,r,n)}function T(t,e,r,n){return Z(W(e),t,r,n)}function E(t,e,r,n){return Z(X(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?K.fromByteArray(t):K.fromByteArray(t.slice(e,r))}function L(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var a=t[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=r){var l,u,c,h;switch(s){case 1:a<128&&(o=a);break;case 2:l=t[i+1],128===(192&l)&&(h=(31&a)<<6|63&l,h>127&&(o=h));break;case 3:l=t[i+1],u=t[i+2],128===(192&l)&&128===(192&u)&&(h=(15&a)<<12|(63&l)<<6|63&u,h>2047&&(h<55296||h>57343)&&(o=h));break;case 4:l=t[i+1],u=t[i+2],c=t[i+3],128===(192&l)&&128===(192&u)&&128===(192&c)&&(h=(15&a)<<18|(63&l)<<12|(63&u)<<6|63&c,h>65535&&h<1114112&&(o=h))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return C(n)}function C(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=tt));return r}function I(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function z(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function D(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=e;a<r;++a)i+=H(t[a]);return i}function P(t,e,r){for(var n=t.slice(e,r),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function O(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function R(t,e,r,n,i,a){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<a)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function F(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,a=Math.min(t.length-r,2);i<a;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function j(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,a=Math.min(t.length-r,4);i<a;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function N(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(t,e,r,n,i){return i||N(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(t,e,r,n,23,4),r+4}function U(t,e,r,n,i){return i||N(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(t,e,r,n,52,8),r+8}function V(t){if(t=q(t).replace(et,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function q(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function H(t){return t<16?"0"+t.toString(16):t.toString(16)}function Y(t,e){e=e||1/0;for(var r,n=t.length,i=null,a=[],o=0;o<n;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function G(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function X(t,e){for(var r,n,i,a=[],o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),n=r>>8,i=r%256,a.push(i),a.push(n);return a}function W(t){return K.toByteArray(V(t))}function Z(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function J(t){return t!==t}var K=t("base64-js"),Q=t("ieee754"),$=t("isarray");r.Buffer=o,r.SlowBuffer=g,r.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:n(),r.kMaxLength=i(),o.poolSize=8192,o._augment=function(t){return t.__proto__=o.prototype,t},o.from=function(t,e,r){return s(null,t,e,r)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(t,e,r){return u(null,t,e,r)},o.allocUnsafe=function(t){return c(null,t)},o.allocUnsafeSlow=function(t){return c(null,t)},o.isBuffer=function(t){return!(null==t||!t._isBuffer)},o.compare=function(t,e){if(!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i<a;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},o.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(t,e){if(!$(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return o.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=o.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var a=t[r];if(!o.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},o.byteLength=v,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)x(this,e,e+1);return this},o.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)x(this,e,e+3),x(this,e+1,e+2);return this},o.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)x(this,e,e+7),x(this,e+1,e+6),x(this,e+2,e+5),x(this,e+3,e+4);return this},o.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?L(this,0,t):y.apply(this,arguments)},o.prototype.equals=function(t){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===o.compare(this,t)},o.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},o.prototype.compare=function(t,e,r,n,i){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var a=i-n,s=r-e,l=Math.min(a,s),u=this.slice(n,i),c=t.slice(e,r),h=0;h<l;++h)if(u[h]!==c[h]){a=u[h],s=c[h];break}return a<s?-1:s<a?1:0},o.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1},o.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},o.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},o.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return M(this,t,e,r);case"ascii":return A(this,t,e,r);case"latin1":case"binary":return k(this,t,e,r);case"base64":return T(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;o.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e<t&&(e=t);var n;if(o.TYPED_ARRAY_SUPPORT)n=this.subarray(t,e),n.__proto__=o.prototype;else{var i=e-t;n=new o(i,void 0);for(var a=0;a<i;++a)n[a]=this[a+t]}return n},o.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||O(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return n},o.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||O(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},o.prototype.readUInt8=function(t,e){return e||O(t,1,this.length),this[t]},o.prototype.readUInt16LE=function(t,e){return e||O(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUInt16BE=function(t,e){return e||O(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUInt32LE=function(t,e){return e||O(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUInt32BE=function(t,e){return e||O(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||O(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},o.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||O(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},o.prototype.readInt8=function(t,e){return e||O(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},o.prototype.readInt16LE=function(t,e){e||O(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(t,e){e||O(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(t,e){return e||O(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return e||O(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,e){return e||O(t,4,this.length),Q.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return e||O(t,4,this.length),Q.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return e||O(t,8,this.length),Q.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return e||O(t,8,this.length),Q.read(this,t,!1,52,8)},o.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){var i=Math.pow(2,8*r)-1;R(this,t,e,r,i,0)}var a=1,o=0;for(this[e]=255&t;++o<r&&(a*=256);)this[e+o]=t/a&255;return e+r},o.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){var i=Math.pow(2,8*r)-1;R(this,t,e,r,i,0)}var a=r-1,o=1;for(this[e+a]=255&t;--a>=0&&(o*=256);)this[e+a]=t/o&255;return e+r},o.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,1,255,0),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},o.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):F(this,t,e,!0),e+2},o.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):F(this,t,e,!1),e+2},o.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):j(this,t,e,!0),e+4},o.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},o.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);R(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a<r&&(o*=256);)t<0&&0===s&&0!==this[e+a-1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},o.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);R(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},o.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,1,127,-128),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):F(this,t,e,!0),e+2},o.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):F(this,t,e,!1),e+2},o.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):j(this,t,e,!0),e+4},o.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},o.prototype.writeFloatLE=function(t,e,r){return B(this,t,e,!0,r)},o.prototype.writeFloatBE=function(t,e,r){return B(this,t,e,!1,r)},o.prototype.writeDoubleLE=function(t,e,r){return U(this,t,e,!0,r)},o.prototype.writeDoubleBE=function(t,e,r){return U(this,t,e,!1,r)},o.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,a=n-r;if(this===t&&r<e&&e<n)for(i=a-1;i>=0;--i)t[i+e]=this[i+r];else if(a<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+a),e);return a},o.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var a;if("number"==typeof t)for(a=e;a<r;++a)this[a]=t;else{var s=o.isBuffer(t)?t:Y(new o(t,n).toString()),l=s.length;for(a=0;a<r-e;++a)this[a+e]=s[a%l]}return this};var et=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":67,ieee754:258,isarray:68}],67:[function(t,e,r){"use strict";function n(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return 3*t.length/4-n(t)}function a(t){var e,r,i,a,o,s,l=t.length;o=n(t),s=new h(3*l/4-o),i=o>0?l-4:l;var u=0;for(e=0,r=0;e<i;e+=4,r+=3)a=c[t.charCodeAt(e)]<<18|c[t.charCodeAt(e+1)]<<12|c[t.charCodeAt(e+2)]<<6|c[t.charCodeAt(e+3)],s[u++]=a>>16&255,s[u++]=a>>8&255,s[u++]=255&a;return 2===o?(a=c[t.charCodeAt(e)]<<2|c[t.charCodeAt(e+1)]>>4,s[u++]=255&a):1===o&&(a=c[t.charCodeAt(e)]<<10|c[t.charCodeAt(e+1)]<<4|c[t.charCodeAt(e+2)]>>2,s[u++]=a>>8&255,s[u++]=255&a),s}function o(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function s(t,e,r){for(var n,i=[],a=e;a<r;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],i.push(o(n));return i.join("")}function l(t){for(var e,r=t.length,n=r%3,i="",a=[],o=16383,l=0,c=r-n;l<c;l+=o)a.push(s(t,l,l+o>c?c:l+o));return 1===n?(e=t[r-1],i+=u[e>>2],i+=u[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=u[e>>10],i+=u[e>>4&63],i+=u[e<<2&63],i+="="),a.push(i),a.join("")}r.byteLength=i,r.toByteArray=a,r.fromByteArray=l;for(var u=[],c=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,p=f.length;d<p;++d)u[d]=f[d],c[f.charCodeAt(d)]=d;c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},{}],68:[function(t,e,r){var n={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}],69:[function(t,e,r){"use strict";function n(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function i(t,e){return t[0]-e[0]||t[1]-e[1]}function a(t){return t.map(n).sort(i)}function o(t,e,r){return e in t?t[e]:r}function s(t,e,r){Array.isArray(e)?(r=r||{},e=e||[]):(r=e||{},e=[]);var n=!!o(r,"delaunay",!0),i=!!o(r,"interior",!0),s=!!o(r,"exterior",!0),f=!!o(r,"infinity",!1);if(!i&&!s||0===t.length)return[];var d=l(t,e);if(n||i!==s||f){for(var p=u(t.length,a(e)),m=0;m<d.length;++m){var g=d[m];p.addTriangle(g[0],g[1],g[2])}return n&&c(t,p),s?i?f?h(p,0,f):p.cells():h(p,1,f):h(p,-1)}return d}var l=t("./lib/monotone"),u=t("./lib/triangulation"),c=t("./lib/delaunay"),h=t("./lib/filter");e.exports=s},{"./lib/delaunay":70,"./lib/filter":71,"./lib/monotone":72,"./lib/triangulation":73}],70:[function(t,e,r){"use strict";function n(t,e,r,n,i,o){var s=e.opposite(n,i);if(!(s<0)){if(i<n){var l=n;n=i,i=l,l=o,o=s,s=l}e.isConstraint(n,i)||a(t[n],t[i],t[o],t[s])<0&&r.push(n,i)}}function i(t,e){for(var r=[],i=t.length,o=e.stars,s=0;s<i;++s)for(var l=o[s],u=1;u<l.length;u+=2){var c=l[u];if(!(c<s||e.isConstraint(s,c))){for(var h=l[u-1],f=-1,d=1;d<l.length;d+=2)if(l[d-1]===c){f=l[d];break}f<0||a(t[s],t[c],t[h],t[f])<0&&r.push(s,c)}}for(;r.length>0;){for(var c=r.pop(),s=r.pop(),h=-1,f=-1,l=o[s],p=1;p<l.length;p+=2){var m=l[p-1],g=l[p];m===c?f=g:g===c&&(h=m)}h<0||f<0||a(t[s],t[c],t[h],t[f])>=0||(e.flip(s,c),n(t,e,r,h,s,f),n(t,e,r,s,f,h),n(t,e,r,f,c,h),n(t,e,r,c,h,f))}}var a=t("robust-in-sphere")[4];t("binary-search-bounds");e.exports=i},{"binary-search-bounds":74,"robust-in-sphere":469}],71:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function i(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}function a(t,e){for(var r=t.cells(),a=r.length,o=0;o<a;++o){var s=r[o],l=s[0],u=s[1],c=s[2];u<c?u<l&&(s[0]=u,s[1]=c,s[2]=l):c<l&&(s[0]=c,s[1]=l,s[2]=u)}r.sort(i);for(var h=new Array(a),o=0;o<h.length;++o)h[o]=0;var f=[],d=[],p=new Array(3*a),m=new Array(3*a),g=null;e&&(g=[]);for(var v=new n(r,p,m,h,f,d,g),o=0;o<a;++o)for(var s=r[o],y=0;y<3;++y){var l=s[y],u=s[(y+1)%3],x=p[3*o+y]=v.locate(u,l,t.opposite(u,l)),b=m[3*o+y]=t.isConstraint(l,u);x<0&&(b?d.push(o):(f.push(o),h[o]=1),e&&g.push([u,l,-1]))}return v}function o(t,e,r){for(var n=0,i=0;i<t.length;++i)e[i]===r&&(t[n++]=t[i]);return t.length=n,t}function s(t,e,r){var n=a(t,r);if(0===e)return r?n.cells.concat(n.boundary):n.cells;for(var i=1,s=n.active,l=n.next,u=n.flags,c=n.cells,h=n.constraint,f=n.neighbor;s.length>0||l.length>0;){for(;s.length>0;){var d=s.pop();if(u[d]!==-i){u[d]=i;for(var p=(c[d],0);p<3;++p){var m=f[3*d+p];m>=0&&0===u[m]&&(h[3*d+p]?l.push(m):(s.push(m),u[m]=i))}}}var g=l;l=s,s=g,l.length=0,i=-i}var v=o(c,u,e);return r?v.concat(n.boundary):v}var l=t("binary-search-bounds");e.exports=s;var u=n.prototype;u.locate=function(){var t=[0,0,0];return function(e,r,n){var a=e,o=r,s=n;return r<n?r<e&&(a=r,o=n,s=e):n<e&&(a=n,o=e,s=r),a<0?-1:(t[0]=a,t[1]=o,t[2]=s,l.eq(this.cells,t,i))}}()},{"binary-search-bounds":74}],72:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.a=t,this.b=e,this.idx=r,this.lowerIds=n,this.upperIds=i}function i(t,e,r,n){this.a=t,this.b=e,this.type=r,this.idx=n}function a(t,e){var r=t.a[0]-e.a[0]||t.a[1]-e.a[1]||t.type-e.type;return r?r:t.type!==p&&(r=d(t.a,t.b,e.b))?r:t.idx-e.idx}function o(t,e){return d(t.a,t.b,e)}function s(t,e,r,n,i){for(var a=f.lt(e,n,o),s=f.gt(e,n,o),l=a;l<s;++l){for(var u=e[l],c=u.lowerIds,h=c.length;h>1&&d(r[c[h-2]],r[c[h-1]],n)>0;)t.push([c[h-1],c[h-2],i]),h-=1;c.length=h,c.push(i);for(var p=u.upperIds,h=p.length;h>1&&d(r[p[h-2]],r[p[h-1]],n)<0;)t.push([p[h-2],p[h-1],i]),h-=1;p.length=h,p.push(i)}}function l(t,e){var r;return(r=t.a[0]<e.a[0]?d(t.a,t.b,e.a):d(e.b,e.a,t.a))?r:(r=e.b[0]<t.b[0]?d(t.a,t.b,e.b):d(e.b,e.a,t.b),r||t.idx-e.idx)}function u(t,e,r){var i=f.le(t,r,l),a=t[i],o=a.upperIds,s=o[o.length-1];a.upperIds=[s],t.splice(i+1,0,new n(r.a,r.b,r.idx,[s],o))}function c(t,e,r){var n=r.a;r.a=r.b,r.b=n;var i=f.eq(t,r,l),a=t[i],o=t[i-1];o.upperIds=a.upperIds,t.splice(i,1)}function h(t,e){for(var r=t.length,o=e.length,l=[],h=0;h<r;++h)l.push(new i(t[h],null,p,h));for(var h=0;h<o;++h){var f=e[h],d=t[f[0]],v=t[f[1]];d[0]<v[0]?l.push(new i(d,v,g,h),new i(v,d,m,h)):d[0]>v[0]&&l.push(new i(v,d,g,h),new i(d,v,m,h))}l.sort(a);for(var y=l[0].a[0]-(1+Math.abs(l[0].a[0]))*Math.pow(2,-52),x=[new n([y,1],[y,0],-1,[],[],[],[])],b=[],h=0,_=l.length;h<_;++h){var w=l[h],M=w.type;M===p?s(b,x,t,w.a,w.idx):M===g?u(x,t,w):c(x,t,w)}return b}var f=t("binary-search-bounds"),d=t("robust-orientation")[3],p=0,m=1,g=2;e.exports=h},{"binary-search-bounds":74,"robust-orientation":471}],73:[function(t,e,r){"use strict";function n(t,e){this.stars=t,this.edges=e}function i(t,e,r){for(var n=1,i=t.length;n<i;n+=2)if(t[n-1]===e&&t[n]===r)return t[n-1]=t[i-2],t[n]=t[i-1],void(t.length=i-2)}function a(t,e){for(var r=new Array(t),i=0;i<t;++i)r[i]=[];return new n(r,e)}var o=t("binary-search-bounds");e.exports=a;var s=n.prototype;s.isConstraint=function(){function t(t,e){return t[0]-e[0]||t[1]-e[1]}var e=[0,0];return function(r,n){return e[0]=Math.min(r,n),e[1]=Math.max(r,n),o.eq(this.edges,e,t)>=0}}(),s.removeTriangle=function(t,e,r){var n=this.stars;i(n[t],e,r),i(n[e],r,t),i(n[r],t,e)},s.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},s.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;n<i;n+=2)if(r[n]===t)return r[n-1];return-1},s.flip=function(t,e){var r=this.opposite(t,e),n=this.opposite(e,t);this.removeTriangle(t,e,r),this.removeTriangle(e,t,n),this.addTriangle(t,n,r),this.addTriangle(e,r,n)},s.edges=function(){for(var t=this.stars,e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,o=i.length;a<o;a+=2)e.push([i[a],i[a+1]]);return e},s.cells=function(){for(var t=this.stars,e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,o=i.length;a<o;a+=2){var s=i[a],l=i[a+1];r<Math.min(s,l)&&e.push([r,s,l])}return e}},{"binary-search-bounds":74}],74:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=["function ",t,"(a,l,h,",n.join(","),"){",i?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a[m]"];return i?e.indexOf("c")<0?a.push(";if(x===y){return m}else if(x<=y){"):a.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):a.push(";if(",e,"){i=m;"),r?a.push("l=m+1}else{h=m-1}"):a.push("h=m-1}else{l=m+1}"),a.push("}"),i?a.push("return -1};"):a.push("return i};"),a.join("")}function i(t,e,r,i){var a=new Function([n("A","x"+t+"y",e,["y"],i),n("P","c(x,y)"+t+"0",e,["y","c"],i),"function dispatchBsearch",r,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",r].join(""));return a()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],75:[function(t,e,r){"use strict";function n(t){for(var e=1,r=1;r<t.length;++r)for(var n=0;n<r;++n)if(t[r]<t[n])e=-e;else if(t[n]===t[r])return 0;return e}e.exports=n},{}],76:[function(t,e,r){"use strict";function n(t,e){for(var r=0,n=t.length,i=0;i<n;++i)r+=t[i]*e[i];return r}function i(t){var e=t.length;if(0===e)return[];var r=(t[0].length,o([t.length+1,t.length+1],1)),i=o([t.length+1],1);r[e][e]=0;for(var a=0;a<e;++a){for(var l=0;l<=a;++l)r[l][a]=r[a][l]=2*n(t[a],t[l]);i[a]=n(t[a],t[a])}for(var u=s(r,i),c=0,h=u[e+1],a=0;a<h.length;++a)c+=h[a];for(var f=new Array(e),a=0;a<e;++a){for(var h=u[a],d=0,l=0;l<h.length;++l)d+=h[l];f[a]=d/c}return f}function a(t){if(0===t.length)return[];for(var e=t[0].length,r=o([e]),n=i(t),a=0;a<t.length;++a)for(var s=0;s<e;++s)r[s]+=t[a][s]*n[a];return r}var o=t("dup"),s=t("robust-linear-solve");a.barycenetric=i,e.exports=a},{dup:100,"robust-linear-solve":470}],77:[function(t,e,r){function n(t){for(var e=i(t),r=0,n=0;n<t.length;++n)for(var a=t[n],o=0;o<e.length;++o)r+=Math.pow(a[o]-e[o],2);return Math.sqrt(r/t.length)}e.exports=n;var i=t("circumcenter")},{circumcenter:76}],78:[function(t,e,r){"use strict";function n(t){var e=b(t),r=x(y(e),t);return r<0?[e,w(e,1/0)]:r>0?[w(e,-(1/0)),e]:[e,e]}function i(t,e){for(var r=new Array(e.length),n=0;n<e.length;++n){var i=e[n],a=t[i[0]],o=t[i[1]];r[n]=[Math.min(a[0],o[0]),Math.min(a[1],o[1]),Math.max(a[0],o[0]),Math.max(a[1],o[1])]}return r}function a(t){for(var e=new Array(t.length),r=0;r<t.length;++r){var n=t[r];e[r]=[n[0],n[1],n[0],n[1]]}return e}function o(t,e,r){var n=[];return g(r,function(r,i){var a=e[r],o=e[i];if(a[0]!==o[0]&&a[0]!==o[1]&&a[1]!==o[0]&&a[1]!==o[1]){var s=t[a[0]],l=t[a[1]],u=t[o[0]],c=t[o[1]];v(s,l,u,c)&&n.push([r,i])}}),n}function s(t,e,r,n){var i=[];return g(r,n,function(r,n){var a=e[r];if(a[0]!==n&&a[1]!==n){var o=t[n],s=t[a[0]],l=t[a[1]];v(s,l,o,o)&&i.push([r,n])}}),i}function l(t,e,r,n,i){function a(e){if(e>=t.length)return o[e-t.length];var r=t[e];return[y(r[0]),y(r[1])]}for(var o=[],s=0;s<r.length;++s){var l=r[s],u=l[0],c=l[1],h=e[u],f=e[c],d=M(_(t[h[0]]),_(t[h[1]]),_(t[f[0]]),_(t[f[1]]));if(d){var p=o.length+t.length;o.push(d),n.push([u,p],[c,p])}}n.sort(function(t,e){if(t[0]!==e[0])return t[0]-e[0];var r=a(t[1]),n=a(e[1]);return x(r[0],n[0])||x(r[1],n[1])});for(var s=n.length-1;s>=0;--s){var m=n[s],u=m[0],g=e[u],v=g[0],b=g[1],w=t[v],A=t[b];if((w[0]-A[0]||w[1]-A[1])<0){var k=v;v=b,b=k}g[0]=v;var T,E=g[1]=m[1];for(i&&(T=g[2]);s>0&&n[s-1][0]===u;){var m=n[--s],S=m[1];i?e.push([E,S,T]):e.push([E,S]),E=S}i?e.push([E,b,T]):e.push([E,b])}return o}function u(t,e,r){for(var i=t.length+e.length,a=new m(i),o=r,s=0;s<e.length;++s){var l=e[s],u=n(l[0]),c=n(l[1]);o.push([u[0],c[0],u[1],c[1]]),t.push([b(l[0]),b(l[1])])}g(o,function(t,e){a.link(t,e)});for(var h=0,f=!0,d=new Array(i),s=0;s<i;++s){var p=a.find(s);p===s?(d[s]=h,t[h++]=t[s]):(f=!1,d[s]=-1)}if(t.length=h,f)return null;for(var s=0;s<i;++s)d[s]<0&&(d[s]=d[a.find(s)]);return d}function c(t,e){return t[0]-e[0]||t[1]-e[1]}function h(t,e){var r=t[0]-e[0]||t[1]-e[1];return r?r:t[2]<e[2]?-1:t[2]>e[2]?1:0}function f(t,e,r){if(0!==t.length){if(e)for(var n=0;n<t.length;++n){var i=t[n],a=e[i[0]],o=e[i[1]];i[0]=Math.min(a,o),i[1]=Math.max(a,o)}else for(var n=0;n<t.length;++n){var i=t[n],a=i[0],o=i[1];i[0]=Math.min(a,o),i[1]=Math.max(a,o)}r?t.sort(h):t.sort(c);for(var s=1,n=1;n<t.length;++n){var l=t[n-1],u=t[n];(u[0]!==l[0]||u[1]!==l[1]||r&&u[2]!==l[2])&&(t[s++]=u)}t.length=s}}function d(t,e,r){var n=i(t,e),c=o(t,e,n),h=a(t),d=s(t,e,n,h),p=l(t,e,c,d,r),m=u(t,p,h);return f(e,m,r),!!m||(c.length>0||d.length>0)}function p(t,e,r){var n,i=!1;if(r){n=e;for(var a=new Array(e.length),o=0;o<e.length;++o){var s=e[o];a[o]=[s[0],s[1],r[o]]}e=a}for(;d(t,e,!!r);)i=!0;if(r&&i){n.length=0,r.length=0;for(var o=0;o<e.length;++o){var s=e[o];n.push([s[0],s[1]]),r.push(s[2])}}return i}e.exports=p;var m=t("union-find"),g=t("box-intersect"),v=(t("compare-cell"),t("robust-segment-intersect")),y=t("big-rat"),x=t("big-rat/cmp"),b=t("big-rat/to-float"),_=t("rat-vec"),w=t("nextafter"),M=t("./lib/rat-seg-intersect")},{"./lib/rat-seg-intersect":79,"big-rat":42,"big-rat/cmp":40,"big-rat/to-float":54,"box-intersect":59,"compare-cell":84,nextafter:433,"rat-vec":459,"robust-segment-intersect":474,"union-find":503}],79:[function(t,e,r){"use strict";function n(t,e){return s(a(t[0],e[1]),a(t[1],e[0]))}function i(t,e,r,i){var a=u(e,t),s=u(i,r),f=n(a,s);if(0===l(f))return null;var d=u(t,r),p=n(s,d),m=o(p,f);return c(t,h(a,m))}e.exports=i;var a=t("big-rat/mul"),o=t("big-rat/div"),s=t("big-rat/sub"),l=t("big-rat/sign"),u=t("rat-vec/sub"),c=t("rat-vec/add"),h=t("rat-vec/muls");t("big-rat/to-float")},{"big-rat/div":41,"big-rat/mul":51,"big-rat/sign":52,"big-rat/sub":53,"big-rat/to-float":54,"rat-vec/add":458,"rat-vec/muls":460,"rat-vec/sub":461}],80:[function(t,e,r){(function(t){var r=function(){"use strict";function e(r,n,i,a){function s(r,i){if(null===r)return null;if(0==i)return r;var l,f;if("object"!=typeof r)return r;if(e.__isArray(r))l=[];else if(e.__isRegExp(r))l=new RegExp(r.source,o(r)),r.lastIndex&&(l.lastIndex=r.lastIndex);else if(e.__isDate(r))l=new Date(r.getTime());else{if(h&&t.isBuffer(r))return l=new t(r.length),r.copy(l),l;"undefined"==typeof a?(f=Object.getPrototypeOf(r),l=Object.create(f)):(l=Object.create(a),f=a)}if(n){var d=u.indexOf(r);if(d!=-1)return c[d];u.push(r),c.push(l)}for(var p in r){var m;f&&(m=Object.getOwnPropertyDescriptor(f,p)),m&&null==m.set||(l[p]=s(r[p],i-1))}return l}var l;"object"==typeof n&&(i=n.depth,a=n.prototype,l=n.filter,n=n.circular);var u=[],c=[],h="undefined"!=typeof t;return"undefined"==typeof n&&(n=!0),"undefined"==typeof i&&(i=1/0),s(r,i)}function r(t){return Object.prototype.toString.call(t)}function n(t){return"object"==typeof t&&"[object Date]"===r(t)}function i(t){return"object"==typeof t&&"[object Array]"===r(t)}function a(t){return"object"==typeof t&&"[object RegExp]"===r(t)}function o(t){var e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),e}return e.clonePrototype=function(t){if(null===t)return null;var e=function(){};return e.prototype=t,new e},e.__objToStr=r,e.__isDate=n,e.__isArray=i,e.__isRegExp=a,e.__getRegExpFlags=o,e}();"object"==typeof e&&e.exports&&(e.exports=r)}).call(this,t("buffer").Buffer)},{buffer:66}],81:[function(t,e,r){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:0,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},{}],82:[function(t,e,r){"use strict";function n(t){var e,r,n,u,c,h,f,d,p,m,g,v,y,x=[],b=[],_=[],w=[];if(o.isPlainObject(t)||(t={}),p=t.nshades||72,d=t.format||"hex",f=t.colormap,f||(f="jet"),"string"==typeof f){if(f=f.toLowerCase(),!l[f])throw Error(f+" not a supported colorscale");h=s(l[f])}else{if(!Array.isArray(f))throw Error("unsupported colormap option",f);h=s(f)}if(h.length>p)throw new Error(f+" map requires nshades to be at least size "+h.length);for(g=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:s(t.alpha):"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1],e=h.map(function(t){return Math.round(t.index*p)}),g[0]<0&&(g[0]=0),g[1]<0&&(g[0]=0),g[0]>1&&(g[0]=1),g[1]>1&&(g[0]=1),y=0;y<e.length;++y)v=h[y].index,r=h[y].rgb,4===r.length&&r[3]>=0&&r[3]<=1||(r[3]=g[0]+(g[1]-g[0])*v);for(y=0;y<e.length-1;++y)c=e[y+1]-e[y],n=h[y].rgb,u=h[y+1].rgb,x=x.concat(o.linspace(n[0],u[0],c)),b=b.concat(o.linspace(n[1],u[1],c)),_=_.concat(o.linspace(n[2],u[2],c)),w=w.concat(o.linspace(n[3],u[3],c));return x=x.map(Math.round),b=b.map(Math.round),_=_.map(Math.round),m=o.zip(x,b,_,w),"hex"===d&&(m=m.map(i)),"rgbaString"===d&&(m=m.map(a)),m}function i(t){for(var e,r="#",n=0;n<3;++n)e=t[n],e=e.toString(16),r+=("00"+e).substr(e.length);return r}function a(t){return"rgba("+t.join(",")+")"}var o=t("arraytools"),s=t("clone"),l=t("./colorScales");e.exports=n},{"./colorScales":81,arraytools:35,clone:80}],83:[function(t,e,r){"use strict";function n(t,e,r){var n=s(t[0],-e[0]),i=s(t[1],-e[1]),a=s(r[0],-e[0]),o=s(r[1],-e[1]),c=u(l(n,a),l(i,o));return c[c.length-1]>=0}function i(t,e,r,i){var s=a(e,r,i);if(0===s){var l=o(a(t,e,r)),u=o(a(t,e,i));if(l===u){if(0===l){var c=n(t,e,r),h=n(t,e,i);return c===h?0:c?1:-1}return 0}return 0===u?l>0?-1:n(t,e,i)?-1:1:0===l?u>0?1:n(t,e,r)?1:-1:o(u-l)}var f=a(t,e,r);if(f>0)return s>0&&a(t,e,i)>0?1:-1;if(f<0)return s>0||a(t,e,i)>0?1:-1;var d=a(t,e,i);return d>0?1:n(t,e,r)?1:-1}e.exports=i;var a=t("robust-orientation"),o=t("signum"),s=t("two-sum"),l=t("robust-product"),u=t("robust-sum")},{"robust-orientation":471,"robust-product":472,"robust-sum":476,signum:478,"two-sum":501}],84:[function(t,e,r){function n(t,e){return t-e}function i(t,e){var r=t.length,i=t.length-e.length;if(i)return i;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||a(t[0],t[1])-a(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(i=o+t[2]-(s+e[2]))return i;var l=a(t[0],t[1]),u=a(e[0],e[1]);return a(l,t[2])-a(u,e[2])||a(l+t[2],o)-a(u+e[2],s);case 4:var c=t[0],h=t[1],f=t[2],d=t[3],p=e[0],m=e[1],g=e[2],v=e[3];return c+h+f+d-(p+m+g+v)||a(c,h,f,d)-a(p,m,g,v,p)||a(c+h,c+f,c+d,h+f,h+d,f+d)-a(p+m,p+g,p+v,m+g,m+v,g+v)||a(c+h+f,c+h+d,c+f+d,h+f+d)-a(p+m+g,p+m+v,p+g+v,m+g+v);default:for(var y=t.slice().sort(n),x=e.slice().sort(n),b=0;b<r;++b)if(i=y[b]-x[b])return i;return 0}}e.exports=i;var a=Math.min},{}],85:[function(t,e,r){"use strict";function n(t,e){return i(t,e)||a(t)-a(e)}var i=t("compare-cell"),a=t("cell-orientation");e.exports=n},{"cell-orientation":75,"compare-cell":84}],86:[function(t,e,r){"use strict";function n(t){var e=t.length;if(0===e)return[];if(1===e)return[[0]];var r=t[0].length;return 0===r?[]:1===r?i(t):2===r?a(t):o(t,r)}var i=t("./lib/ch1d"),a=t("./lib/ch2d"),o=t("./lib/chnd");e.exports=n},{"./lib/ch1d":87,"./lib/ch2d":88,"./lib/chnd":89}],87:[function(t,e,r){"use strict";function n(t){for(var e=0,r=0,n=1;n<t.length;++n)t[n][0]<t[e][0]&&(e=n),t[n][0]>t[r][0]&&(r=n);return e<r?[[e],[r]]:e>r?[[r],[e]]:[[e]]}e.exports=n},{}],88:[function(t,e,r){"use strict";function n(t){var e=i(t),r=e.length;if(r<=2)return[];for(var n=new Array(r),a=e[r-1],o=0;o<r;++o){var s=e[o];n[o]=[a,s],a=s}return n}e.exports=n;var i=t("monotone-convex-hull-2d")},{"monotone-convex-hull-2d":417}],89:[function(t,e,r){"use strict";function n(t,e){for(var r=t.length,n=new Array(r),i=0;i<e.length;++i)n[i]=t[e[i]];for(var a=e.length,i=0;i<r;++i)e.indexOf(i)<0&&(n[a++]=t[i]);return n}function i(t,e){for(var r=t.length,n=e.length,i=0;i<r;++i)for(var a=t[i],o=0;o<a.length;++o){var s=a[o];if(s<n)a[o]=e[s];else{s-=n;for(var l=0;l<n;++l)s>=e[l]&&(s+=1);a[o]=s}}return t}function a(t,e){try{return o(t,!0)}catch(u){var r=s(t);if(r.length<=e)return[];var a=n(t,r),l=o(a,!0);return i(l,r)}}e.exports=a;var o=t("incremental-convex-hull"),s=t("affine-hull")},{"affine-hull":32,"incremental-convex-hull":259}],90:[function(t,e,r){e.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CPV:"verde",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bdr|\\bdr.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",COG:"^(?!.*\\bdem)(?!.*\\bdr)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|ç)ao",CYP:"cyprus",CZE:"^(?=.*rep).*czech|czechia|bohemia",CSK:"czechoslovakia",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"ireland",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat).*\\bkorea|^(?=.*people).*\\bkorea|^(?=.*north).*\\bkorea|dprk",KOR:"^(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MKD:"macedonia|fyrom",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"micronesia",MDA:"moldov|b(a|e)ssarabia",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",REU:"r(e|é)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|é)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|ã)o.?tom(e|é)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"\\bs\\w*.?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",TZA:"tanzania",THA:"thailand|\\bsiam",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",USA:"united.?states|\\bu\\.?s\\.?a\\.?\\b|\\bu\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},{}],91:[function(t,e,r){function n(t){return t=Math.round(t),t<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return i("%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function l(t){var e=t.replace(/ /g,"").toLowerCase();if(e in u)return u[e].slice();if("#"===e[0]){if(4===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=4095?[(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1]:null}if(7===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=16777215?[(16711680&r)>>16,(65280&r)>>8,255&r,1]:null}return null}var i=e.indexOf("("),l=e.indexOf(")");if(i!==-1&&l+1===e.length){var c=e.substr(0,i),h=e.substr(i+1,l-(i+1)).split(","),f=1;switch(c){case"rgba":if(4!==h.length)return null;f=o(h.pop());case"rgb":return 3!==h.length?null:[a(h[0]),a(h[1]),a(h[2]),f];case"hsla":if(4!==h.length)return null;f=o(h.pop());case"hsl":if(3!==h.length)return null;var d=(parseFloat(h[0])%360+360)%360/360,p=o(h[1]),m=o(h[2]),g=m<=.5?m*(p+1):m+p-m*p,v=2*m-g;return[n(255*s(v,g,d+1/3)),n(255*s(v,g,d)),n(255*s(v,g,d-1/3)),f];default:return null}}return null}var u={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};try{r.parseCSSColor=l}catch(t){}},{}],92:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,u=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var c=t.length-1;c>=0;--c)a[c]=o*t[c]+s*e[c]+l*r[c]+u*n[c];return a}return o*t+s*e+l*r[c]+u*n}function i(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,u=(1+2*i)*l,c=i*l,h=s*(3-2*i),f=s*o;if(t.length){a||(a=new Array(t.length));for(var d=t.length-1;d>=0;--d)a[d]=u*t[d]+c*e[d]+h*r[d]+f*n[d];return a}return u*t+c*e+h*r+f*n}e.exports=i,e.exports.derivative=n},{}],93:[function(t,e,r){"use strict";function n(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}function i(t){var e=new n;e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var i=0;i<r.length;++i){var o=r[i];if("array"===o||"object"==typeof o&&o.blockIndices){if(e.argTypes[i]="array",e.arrayArgs.push(i),e.arrayBlockIndices.push(o.blockIndices?o.blockIndices:0),e.shimArgs.push("array"+i),i<e.pre.args.length&&e.pre.args[i].count>0)throw new Error("cwise: pre() block may not reference array args");if(i<e.post.args.length&&e.post.args[i].count>0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===o)e.scalarArgs.push(i),e.shimArgs.push("scalar"+i);else if("index"===o){if(e.indexArgs.push(i),i<e.pre.args.length&&e.pre.args[i].count>0)throw new Error("cwise: pre() block may not reference array index");if(i<e.body.args.length&&e.body.args[i].lvalue)throw new Error("cwise: body() block may not write to array index");if(i<e.post.args.length&&e.post.args[i].count>0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===o){if(e.shapeArgs.push(i),i<e.pre.args.length&&e.pre.args[i].lvalue)throw new Error("cwise: pre() block may not write to array shape");if(i<e.body.args.length&&e.body.args[i].lvalue)throw new Error("cwise: body() block may not write to array shape");if(i<e.post.args.length&&e.post.args[i].lvalue)throw new Error("cwise: post() block may not write to array shape")}else{if("object"!=typeof o||!o.offset)throw new Error("cwise: Unknown argument type "+r[i]);e.argTypes[i]="offset",e.offsetArgs.push({array:o.array,offset:o.offset}),e.offsetArgIndex.push(i)}}if(e.arrayArgs.length<=0)throw new Error("cwise: No array arguments specified");if(e.pre.args.length>r.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,a(e)}var a=t("./lib/thunk.js");e.exports=i},{"./lib/thunk.js":95}],94:[function(t,e,r){"use strict";function n(t,e,r){var n,i,a=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],u=[],c=0,h=0;for(n=0;n<a;++n)u.push(["i",n,"=0"].join(""));for(i=0;i<o;++i)for(n=0;n<a;++n)h=c,c=t[n],0===n?u.push(["d",i,"s",n,"=t",i,"p",c].join("")):u.push(["d",i,"s",n,"=(t",i,"p",c,"-s",h,"*t",i,"p",h,")"].join(""));for(l.push("var "+u.join(",")),n=a-1;n>=0;--n)c=t[n],l.push(["for(i",n,"=0;i",n,"<s",c,";++i",n,"){"].join(""));for(l.push(r),n=0;n<a;++n){for(h=c,c=t[n],i=0;i<o;++i)l.push(["p",i,"+=d",i,"s",n].join(""));s&&(n>0&&l.push(["index[",h,"]-=s",h].join("")),l.push(["++index[",c,"]"].join(""))),l.push("}")}return l.join("\n")}function i(t,e,r,i){for(var a=e.length,o=r.arrayArgs.length,s=r.blockSize,l=r.indexArgs.length>0,u=[],c=0;c<o;++c)u.push(["var offset",c,"=p",c].join(""));for(var c=t;c<a;++c)u.push(["for(var j"+c+"=SS[",e[c],"]|0;j",c,">0;){"].join("")),u.push(["if(j",c,"<",s,"){"].join("")),u.push(["s",e[c],"=j",c].join("")),u.push(["j",c,"=0"].join("")),u.push(["}else{s",e[c],"=",s].join("")),u.push(["j",c,"-=",s,"}"].join("")),l&&u.push(["index[",e[c],"]=j",c].join(""));for(var c=0;c<o;++c){for(var h=["offset"+c],f=t;f<a;++f)h.push(["j",f,"*t",c,"p",e[f]].join(""));u.push(["p",c,"=(",h.join("+"),")"].join(""))}u.push(n(e,r,i));for(var c=t;c<a;++c)u.push("}");return u.join("\n")}function a(t){for(var e=0,r=t[0].length;e<r;){for(var n=1;n<t.length;++n)if(t[n][e]!==t[0][e])return e;++e}return e}function o(t,e,r){for(var n=t.body,i=[],a=[],o=0;o<t.args.length;++o){var s=t.args[o];if(!(s.count<=0)){var l=new RegExp(s.name,"g"),u="",c=e.arrayArgs.indexOf(o);switch(e.argTypes[o]){case"offset":var h=e.offsetArgIndex.indexOf(o),f=e.offsetArgs[h];c=f.array,u="+q"+h;case"array":u="p"+c+u;var d="l"+o,p="a"+c;if(0===e.arrayBlockIndices[c])1===s.count?"generic"===r[c]?s.lvalue?(i.push(["var ",d,"=",p,".get(",u,")"].join("")),n=n.replace(l,d),a.push([p,".set(",u,",",d,")"].join(""))):n=n.replace(l,[p,".get(",u,")"].join("")):n=n.replace(l,[p,"[",u,"]"].join("")):"generic"===r[c]?(i.push(["var ",d,"=",p,".get(",u,")"].join("")),n=n.replace(l,d),s.lvalue&&a.push([p,".set(",u,",",d,")"].join(""))):(i.push(["var ",d,"=",p,"[",u,"]"].join("")),n=n.replace(l,d),s.lvalue&&a.push([p,"[",u,"]=",d].join("")));else{for(var m=[s.name],g=[u],v=0;v<Math.abs(e.arrayBlockIndices[c]);v++)m.push("\\s*\\[([^\\]]+)\\]"),g.push("$"+(v+1)+"*t"+c+"b"+v);if(l=new RegExp(m.join(""),"g"),u=g.join("+"),"generic"===r[c])throw new Error("cwise: Generic arrays not supported in combination with blocks!");n=n.replace(l,[p,"[",u,"]"].join(""))}break;case"scalar":n=n.replace(l,"Y"+e.scalarArgs.indexOf(o));break;case"index":n=n.replace(l,"index");break;case"shape":n=n.replace(l,"shape")}}}return[i.join("\n"),n,a.join("\n")].join("\n").trim()}function s(t){for(var e=new Array(t.length),r=!0,n=0;n<t.length;++n){var i=t[n],a=i.match(/\d+/);a=a?a[0]:"",0===i.charAt(0)?e[n]="u"+i.charAt(1)+a:e[n]=i.charAt(0)+a,n>0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}function l(t,e){for(var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,l=new Array(t.arrayArgs.length),c=new Array(t.arrayArgs.length),h=0;h<t.arrayArgs.length;++h)c[h]=e[2*h],l[h]=e[2*h+1];for(var f=[],d=[],p=[],m=[],g=[],h=0;h<t.arrayArgs.length;++h){t.arrayBlockIndices[h]<0?(p.push(0),m.push(r),f.push(r),d.push(r+t.arrayBlockIndices[h])):(p.push(t.arrayBlockIndices[h]),m.push(t.arrayBlockIndices[h]+r),f.push(0),d.push(t.arrayBlockIndices[h]));for(var v=[],y=0;y<l[h].length;y++)p[h]<=l[h][y]&&l[h][y]<m[h]&&v.push(l[h][y]-p[h]);g.push(v)}for(var x=["SS"],b=["'use strict'"],_=[],y=0;y<r;++y)_.push(["s",y,"=SS[",y,"]"].join(""));for(var h=0;h<t.arrayArgs.length;++h){x.push("a"+h),x.push("t"+h),x.push("p"+h);for(var y=0;y<r;++y)_.push(["t",h,"p",y,"=t",h,"[",p[h]+y,"]"].join(""));for(var y=0;y<Math.abs(t.arrayBlockIndices[h]);++y)_.push(["t",h,"b",y,"=t",h,"[",f[h]+y,"]"].join(""))}for(var h=0;h<t.scalarArgs.length;++h)x.push("Y"+h);if(t.shapeArgs.length>0&&_.push("shape=SS.slice(0)"),t.indexArgs.length>0){for(var w=new Array(r),h=0;h<r;++h)w[h]="0";_.push(["index=[",w.join(","),"]"].join(""))}for(var h=0;h<t.offsetArgs.length;++h){for(var M=t.offsetArgs[h],A=[],y=0;y<M.offset.length;++y)0!==M.offset[y]&&(1===M.offset[y]?A.push(["t",M.array,"p",y].join("")):A.push([M.offset[y],"*t",M.array,"p",y].join("")));0===A.length?_.push("q"+h+"=0"):_.push(["q",h,"=",A.join("+")].join(""))}var k=u([].concat(t.pre.thisVars).concat(t.body.thisVars).concat(t.post.thisVars));_=_.concat(k),b.push("var "+_.join(","));for(var h=0;h<t.arrayArgs.length;++h)b.push("p"+h+"|=0");t.pre.body.length>3&&b.push(o(t.pre,t,c));var T=o(t.body,t,c),E=a(g);E<r?b.push(i(E,g[0],t,T)):b.push(n(g[0],t,T)),t.post.body.length>3&&b.push(o(t.post,t,c)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+b.join("\n")+"\n----------");var S=[t.funcName||"unnamed","_cwise_loop_",l[0].join("s"),"m",E,s(c)].join(""),L=new Function(["function ",S,"(",x.join(","),"){",b.join("\n"),"} return ",S].join(""));return L()}var u=t("uniq");e.exports=l},{uniq:504}],95:[function(t,e,r){"use strict";function n(t){var e=["'use strict'","var CACHED={}"],r=[],n=t.funcName+"_cwise_thunk";e.push(["return function ",n,"(",t.shimArgs.join(","),"){"].join(""));for(var a=[],o=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],l=[],u=[],c=0;c<t.arrayArgs.length;++c){var h=t.arrayArgs[c];r.push(["t",h,"=array",h,".dtype,","r",h,"=array",h,".order"].join("")),a.push("t"+h),a.push("r"+h),o.push("t"+h),o.push("r"+h+".join()"),s.push("array"+h+".data"),s.push("array"+h+".stride"),s.push("array"+h+".offset|0"),c>0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+h+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[c]))),u.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+h+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[c])+"]"))}t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}"));for(var c=0;c<t.scalarArgs.length;++c)s.push("scalar"+t.scalarArgs[c]);r.push(["type=[",o.join(","),"].join()"].join("")),r.push("proc=CACHED[type]"),e.push("var "+r.join(",")),e.push(["if(!proc){","CACHED[type]=proc=compile([",a.join(","),"])}","return proc(",s.join(","),")}"].join("")),t.debug&&console.log("-----Generated thunk:\n"+e.join("\n")+"\n----------");var f=new Function("compile",e.join("\n"));return f(i.bind(void 0,t))}var i=t("./compile.js");e.exports=n},{"./compile.js":94}],96:[function(t,e,r){e.exports=t("cwise-compiler")},{"cwise-compiler":93}],97:[function(e,r,n){!function(){function e(t){return t&&(t.ownerDocument||t.document||t).documentElement}function n(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function i(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function a(t){return null===t?NaN:+t}function o(t){return!isNaN(t)}function s(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}function l(t){return t.length}function u(t){for(var e=1;t*e%1;)e*=10;return e}function c(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function h(){this._=Object.create(null)}function f(t){return(t+="")===_o||t[0]===wo?wo+t:t}function d(t){return(t+="")[0]===wo?t.slice(1):t}function p(t){return f(t)in this._}function m(t){return(t=f(t))in this._&&delete this._[t]}function g(){var t=[];for(var e in this._)t.push(d(e));return t}function v(){var t=0;for(var e in this._)++t;return t}function y(){for(var t in this._)return!1;return!0}function x(){this._=Object.create(null)}function b(t){return t}function _(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function w(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=Mo.length;r<n;++r){var i=Mo[r]+e;if(i in t)return i}}function M(){}function A(){}function k(t){function e(){for(var e,n=r,i=-1,a=n.length;++i<a;)(e=n[i].on)&&e.apply(this,arguments);return t}var r=[],n=new h;return e.on=function(e,i){var a,o=n.get(e);return arguments.length<2?o&&o.on:(o&&(o.on=null,r=r.slice(0,a=r.indexOf(o)).concat(r.slice(a+1)),n.remove(e)),i&&r.push(n.set(e,{on:i})),t)},e}function T(){uo.event.preventDefault()}function E(){for(var t,e=uo.event;t=e.sourceEvent;)e=t;return e}function S(t){for(var e=new A,r=0,n=arguments.length;++r<n;)e[arguments[r]]=k(e);return e.of=function(r,n){return function(i){try{var a=i.sourceEvent=uo.event;i.target=t,uo.event=i,e[i.type].apply(r,n)}finally{uo.event=a}}},e}function L(t){return ko(t,Lo),t}function C(t){return"function"==typeof t?t:function(){return To(t,this)}}function I(t){return"function"==typeof t?t:function(){return Eo(t,this)}}function z(t,e){function r(){this.removeAttribute(t)}function n(){this.removeAttributeNS(t.space,t.local)}function i(){this.setAttribute(t,e)}function a(){this.setAttributeNS(t.space,t.local,e)}function o(){var r=e.apply(this,arguments);null==r?this.removeAttribute(t):this.setAttribute(t,r)}function s(){var r=e.apply(this,arguments);null==r?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}return t=uo.ns.qualify(t),null==e?t.local?n:r:"function"==typeof e?t.local?s:o:t.local?a:i}function D(t){return t.trim().replace(/\s+/g," ")}function P(t){return new RegExp("(?:^|\\s+)"+uo.requote(t)+"(?:\\s+|$)","g")}function O(t){return(t+"").trim().split(/^|\s+/)}function R(t,e){function r(){for(var r=-1;++r<i;)t[r](this,e)}function n(){for(var r=-1,n=e.apply(this,arguments);++r<i;)t[r](this,n)}t=O(t).map(F);var i=t.length;return"function"==typeof e?n:r}function F(t){var e=P(t);return function(r,n){if(i=r.classList)return n?i.add(t):i.remove(t);var i=r.getAttribute("class")||"";n?(e.lastIndex=0,e.test(i)||r.setAttribute("class",D(i+" "+t))):r.setAttribute("class",D(i.replace(e," ")))}}function j(t,e,r){function n(){this.style.removeProperty(t)}function i(){this.style.setProperty(t,e,r)}function a(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}return null==e?n:"function"==typeof e?a:i}function N(t,e){function r(){delete this[t]}function n(){this[t]=e}function i(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}return null==e?r:"function"==typeof e?i:n}function B(t){function e(){var e=this.ownerDocument,r=this.namespaceURI;return r===Co&&e.documentElement.namespaceURI===Co?e.createElement(t):e.createElementNS(r,t)}function r(){return this.ownerDocument.createElementNS(t.space,t.local)}return"function"==typeof t?t:(t=uo.ns.qualify(t)).local?r:e}function U(){var t=this.parentNode;t&&t.removeChild(this)}function V(t){return{__data__:t}}function q(t){return function(){return So(this,t)}}function H(t){return arguments.length||(t=i),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}function Y(t,e){for(var r=0,n=t.length;r<n;r++)for(var i,a=t[r],o=0,s=a.length;o<s;o++)(i=a[o])&&e(i,o,r);return t}function G(t){return ko(t,zo),t}function X(t){var e,r;return function(n,i,a){var o,s=t[a].update,l=s.length;for(a!=r&&(r=a,e=0),i>=e&&(e=i+1);!(o=s[e])&&++e<l;);return o}}function W(t,e,r){function n(){var e=this[o];e&&(this.removeEventListener(t,e,e.$),delete this[o])}function i(){var i=l(e,ho(arguments));n.call(this),this.addEventListener(t,this[o]=i,i.$=r),i._=e}function a(){var e,r=new RegExp("^__on([^.]+)"+uo.requote(t)+"$");for(var n in this)if(e=n.match(r)){var i=this[n];this.removeEventListener(e[1],i,i.$),delete this[n]}}var o="__on"+t,s=t.indexOf("."),l=Z;s>0&&(t=t.slice(0,s));var u=Do.get(t);return u&&(t=u,l=J),s?e?i:n:e?M:a}function Z(t,e){return function(r){var n=uo.event;uo.event=r,e[0]=this.__data__;try{t.apply(this,e)}finally{uo.event=n}}}function J(t,e){var r=Z(t,e);return function(t){var e=this,n=t.relatedTarget;n&&(n===e||8&n.compareDocumentPosition(e))||r.call(e,t)}}function K(t){var r=".dragsuppress-"+ ++Oo,i="click"+r,a=uo.select(n(t)).on("touchmove"+r,T).on("dragstart"+r,T).on("selectstart"+r,T);if(null==Po&&(Po=!("onselectstart"in t)&&w(t.style,"userSelect")),Po){var o=e(t).style,s=o[Po];o[Po]="none"}return function(t){if(a.on(r,null),Po&&(o[Po]=s),t){var e=function(){a.on(i,null)};a.on(i,function(){T(),e()},!0),setTimeout(e,0)}}}function Q(t,e){e.changedTouches&&(e=e.changedTouches[0]);var r=t.ownerSVGElement||t;if(r.createSVGPoint){var i=r.createSVGPoint();if(Ro<0){var a=n(t);if(a.scrollX||a.scrollY){r=uo.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=r[0][0].getScreenCTM();Ro=!(o.f||o.e),r.remove()}}return Ro?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}function $(){return uo.event.changedTouches[0].identifier}function tt(t){return t>0?1:t<0?-1:0}function et(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function rt(t){return t>1?0:t<-1?No:Math.acos(t)}function nt(t){return t>1?Vo:t<-1?-Vo:Math.asin(t)}function it(t){return((t=Math.exp(t))-1/t)/2}function at(t){return((t=Math.exp(t))+1/t)/2}function ot(t){return((t=Math.exp(2*t))-1)/(t+1)}function st(t){return(t=Math.sin(t/2))*t}function lt(){}function ut(t,e,r){return this instanceof ut?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof ut?new ut(t.h,t.s,t.l):Mt(""+t,At,ut):new ut(t,e,r)}function ct(t,e,r){function n(t){return t>360?t-=360:t<0&&(t+=360),t<60?a+(o-a)*t/60:t<180?o:t<240?a+(o-a)*(240-t)/60:a}function i(t){return Math.round(255*n(t))}var a,o;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,r=r<0?0:r>1?1:r,o=r<=.5?r*(1+e):r+e-r*e,a=2*r-o,new xt(i(t+120),i(t),i(t-120))}function ht(t,e,r){return this instanceof ht?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof ht?new ht(t.h,t.c,t.l):t instanceof dt?mt(t.l,t.a,t.b):mt((t=kt((t=uo.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new ht(t,e,r)}function ft(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new dt(r,Math.cos(t*=qo)*e,Math.sin(t)*e)}function dt(t,e,r){return this instanceof dt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof dt?new dt(t.l,t.a,t.b):t instanceof ht?ft(t.h,t.c,t.l):kt((t=xt(t)).r,t.g,t.b):new dt(t,e,r)}function pt(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return i=gt(i)*ts,n=gt(n)*es,a=gt(a)*rs,new xt(yt(3.2404542*i-1.5371385*n-.4985314*a),yt(-.969266*i+1.8760108*n+.041556*a),yt(.0556434*i-.2040259*n+1.0572252*a))}function mt(t,e,r){return t>0?new ht(Math.atan2(r,e)*Ho,Math.sqrt(e*e+r*r),t):new ht(NaN,NaN,t)}function gt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function vt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function yt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function xt(t,e,r){return this instanceof xt?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof xt?new xt(t.r,t.g,t.b):Mt(""+t,xt,ct):new xt(t,e,r)}function bt(t){return new xt(t>>16,t>>8&255,255&t)}function _t(t){return bt(t)+""}function wt(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function Mt(t,e,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(Et(i[0]),Et(i[1]),Et(i[2]))}return(a=as.get(t))?e(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function At(t,e,r){var n,i,a=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=t==o?(e-r)/s+(e<r?6:0):e==o?(r-t)/s+2:(t-e)/s+4,n*=60):(n=NaN,i=l>0&&l<1?0:n),new ut(n,i,l)}function kt(t,e,r){t=Tt(t),e=Tt(e),r=Tt(r);var n=vt((.4124564*t+.3575761*e+.1804375*r)/ts),i=vt((.2126729*t+.7151522*e+.072175*r)/es),a=vt((.0193339*t+.119192*e+.9503041*r)/rs);return dt(116*i-16,500*(n-i),200*(i-a))}function Tt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Et(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function St(t){return"function"==typeof t?t:function(){return t}}function Lt(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),Ct(e,r,t,n)}}function Ct(t,e,r,n){function i(){var t,e=l.status;if(!e&&zt(l)||e>=200&&e<300||304===e){try{t=r.call(a,l)}catch(t){return void o.error.call(a,t)}o.load.call(a,t)}else o.error.call(a,l)}var a={},o=uo.dispatch("beforesend","progress","load","error"),s={},l=new XMLHttpRequest,u=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(t){var e=uo.event;uo.event=t;try{o.progress.call(a,l)}finally{uo.event=e}},a.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",a)},a.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",a):e},a.responseType=function(t){return arguments.length?(u=t,a):u},a.response=function(t){return r=t,a},["get","post"].forEach(function(t){a[t]=function(){return a.send.apply(a,[t].concat(ho(arguments)))}}),a.send=function(r,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),l.open(r,t,!0),null==e||"accept"in s||(s.accept=e+",*/*"),l.setRequestHeader)for(var c in s)l.setRequestHeader(c,s[c]);return null!=e&&l.overrideMimeType&&l.overrideMimeType(e),null!=u&&(l.responseType=u),null!=i&&a.on("error",i).on("load",function(t){i(null,t)}),o.beforesend.call(a,l),l.send(null==n?null:n),a},a.abort=function(){return l.abort(),a},uo.rebind(a,o,"on"),null==n?a:a.get(It(n))}function It(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}function zt(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function Dt(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var i=r+e,a={c:t,t:i,n:null};return ss?ss.n=a:os=a,ss=a,ls||(us=clearTimeout(us),ls=1,cs(Pt)),a}function Pt(){var t=Ot(),e=Rt()-t;e>24?(isFinite(e)&&(clearTimeout(us),us=setTimeout(Pt,e)),ls=0):(ls=1,cs(Pt))}function Ot(){for(var t=Date.now(),e=os;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Rt(){for(var t,e=os,r=1/0;e;)e.c?(e.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:os=e.n;return ss=t,r}function Ft(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function jt(t,e){var r=Math.pow(10,3*bo(8-e));return{scale:e>8?function(t){return t/r}:function(t){return t*r},symbol:t}}function Nt(t){var e=t.decimal,r=t.thousands,n=t.grouping,i=t.currency,a=n&&r?function(t,e){for(var i=t.length,a=[],o=0,s=n[0],l=0;i>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(i-=s,i+s)),!((l+=s+1)>e));)s=n[o=(o+1)%n.length];return a.reverse().join(r)}:b;return function(t){var r=fs.exec(t),n=r[1]||" ",o=r[2]||">",s=r[3]||"-",l=r[4]||"",u=r[5],c=+r[6],h=r[7],f=r[8],d=r[9],p=1,m="",g="",v=!1,y=!0;switch(f&&(f=+f.substring(1)),(u||"0"===n&&"="===o)&&(u=n="0",o="="),d){case"n":h=!0,d="g";break;case"%":p=100,g="%",d="f";break;case"p":p=100,g="%",d="r";break;case"b":case"o":case"x":case"X":"#"===l&&(m="0"+d.toLowerCase());case"c":y=!1;case"d":v=!0,f=0;break;case"s":p=-1,d="r"}"$"===l&&(m=i[0],g=i[1]),"r"!=d||f||(d="g"),null!=f&&("g"==d?f=Math.max(1,Math.min(21,f)):"e"!=d&&"f"!=d||(f=Math.max(0,Math.min(20,f)))),d=ds.get(d)||Bt;var x=u&&h;return function(t){var r=g;if(v&&t%1)return"";var i=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===s?"":s;if(p<0){var l=uo.formatPrefix(t,f);t=l.scale(t),r=l.symbol+g}else t*=p;t=d(t,f);var b,_,w=t.lastIndexOf(".");if(w<0){var M=y?t.lastIndexOf("e"):-1;M<0?(b=t,_=""):(b=t.substring(0,M),_=t.substring(M))}else b=t.substring(0,w),_=e+t.substring(w+1);!u&&h&&(b=a(b,1/0));var A=m.length+b.length+_.length+(x?0:i.length),k=A<c?new Array(A=c-A+1).join(n):"";return x&&(b=a(k+b,k.length?c-_.length:1/0)),i+=m,t=b+_,("<"===o?i+t+k:">"===o?k+i+t:"^"===o?k.substring(0,A>>=1)+i+t+k.substring(A):i+(x?t:k+t))+r}}}function Bt(t){return t+""}function Ut(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Vt(t,e,r){function n(e){var r=t(e),n=a(r,1);return e-r<n-e?r:n}function i(r){return e(r=t(new ms(r-1)),1),r}function a(t,r){return e(t=new ms(+t),r),t}function o(t,n,a){var o=i(t),s=[];if(a>1)for(;o<n;)r(o)%a||s.push(new Date(+o)),e(o,1);else for(;o<n;)s.push(new Date(+o)),e(o,1);return s}function s(t,e,r){try{ms=Ut;var n=new Ut;return n._=t,o(n,e,r)}finally{ms=Date}}t.floor=t,t.round=n,t.ceil=i,t.offset=a,t.range=o;var l=t.utc=qt(t);return l.floor=l,l.round=qt(n),l.ceil=qt(i),l.offset=qt(a),l.range=s,t}function qt(t){return function(e,r){try{ms=Ut;var n=new Ut;return n._=e,t(n,r)._}finally{ms=Date}}}function Ht(t){function e(t){function e(e){for(var r,i,a,o=[],s=-1,l=0;++s<n;)37===t.charCodeAt(s)&&(o.push(t.slice(l,s)),null!=(i=vs[r=t.charAt(++s)])&&(r=t.charAt(++s)),(a=S[r])&&(r=a(e,null==i?"e"===r?" ":"0":i)),o.push(r),l=s+1);return o.push(t.slice(l,s)),o.join("")}var n=t.length;return e.parse=function(e){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},i=r(n,t,e,0);if(i!=e.length)return null;"p"in n&&(n.H=n.H%12+12*n.p);var a=null!=n.Z&&ms!==Ut,o=new(a?Ut:ms);return"j"in n?o.setFullYear(n.y,0,n.j):"W"in n||"U"in n?("w"in n||(n.w="W"in n?1:0),o.setFullYear(n.y,0,1),o.setFullYear(n.y,0,"W"in n?(n.w+6)%7+7*n.W-(o.getDay()+5)%7:n.w+7*n.U-(o.getDay()+6)%7)):o.setFullYear(n.y,n.m,n.d),o.setHours(n.H+(n.Z/100|0),n.M+n.Z%100,n.S,n.L),a?o._:o},e.toString=function(){return t},e}function r(t,e,r,n){for(var i,a,o,s=0,l=e.length,u=r.length;s<l;){if(n>=u)return-1;if(i=e.charCodeAt(s++),37===i){if(o=e.charAt(s++),a=L[o in vs?e.charAt(s++):o],!a||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}function n(t,e,r){w.lastIndex=0;var n=w.exec(e.slice(r));return n?(t.w=M.get(n[0].toLowerCase()),r+n[0].length):-1}function i(t,e,r){b.lastIndex=0;var n=b.exec(e.slice(r));return n?(t.w=_.get(n[0].toLowerCase()),r+n[0].length):-1}function a(t,e,r){T.lastIndex=0;var n=T.exec(e.slice(r));return n?(t.m=E.get(n[0].toLowerCase()),r+n[0].length):-1}function o(t,e,r){A.lastIndex=0;var n=A.exec(e.slice(r));return n?(t.m=k.get(n[0].toLowerCase()),r+n[0].length):-1}function s(t,e,n){return r(t,S.c.toString(),e,n)}function l(t,e,n){return r(t,S.x.toString(),e,n)}function u(t,e,n){return r(t,S.X.toString(),e,n)}function c(t,e,r){var n=x.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)}var h=t.dateTime,f=t.date,d=t.time,p=t.periods,m=t.days,g=t.shortDays,v=t.months,y=t.shortMonths;e.utc=function(t){function r(t){try{ms=Ut;var e=new ms;return e._=t,n(e)}finally{ms=Date}}var n=e(t);return r.parse=function(t){try{ms=Ut;var e=n.parse(t);return e&&e._}finally{ms=Date}},r.toString=n.toString,r},e.multi=e.utc.multi=ce;var x=uo.map(),b=Gt(m),_=Xt(m),w=Gt(g),M=Xt(g),A=Gt(v),k=Xt(v),T=Gt(y),E=Xt(y);p.forEach(function(t,e){x.set(t.toLowerCase(),e)});var S={a:function(t){return g[t.getDay()]},A:function(t){return m[t.getDay()]},b:function(t){return y[t.getMonth()]},B:function(t){return v[t.getMonth()]},c:e(h),d:function(t,e){return Yt(t.getDate(),e,2)},e:function(t,e){return Yt(t.getDate(),e,2)},H:function(t,e){return Yt(t.getHours(),e,2)},I:function(t,e){return Yt(t.getHours()%12||12,e,2)},j:function(t,e){return Yt(1+ps.dayOfYear(t),e,3)},L:function(t,e){return Yt(t.getMilliseconds(),e,3)},m:function(t,e){return Yt(t.getMonth()+1,e,2)},M:function(t,e){return Yt(t.getMinutes(),e,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,e){return Yt(t.getSeconds(),e,2)},U:function(t,e){return Yt(ps.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Yt(ps.mondayOfYear(t),e,2)},x:e(f),X:e(d),y:function(t,e){return Yt(t.getFullYear()%100,e,2)},Y:function(t,e){return Yt(t.getFullYear()%1e4,e,4)},Z:le,"%":function(){return"%"}},L={a:n,A:i,b:a,B:o,c:s,d:re,e:re,H:ie,I:ie,j:ne,L:se,m:ee,M:ae,p:c,S:oe,U:Zt,w:Wt,W:Jt,x:l,X:u,y:Qt,Y:Kt,Z:$t,"%":ue};return e}function Yt(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(e)+i:i)}function Gt(t){return new RegExp("^(?:"+t.map(uo.requote).join("|")+")","i")}function Xt(t){for(var e=new h,r=-1,n=t.length;++r<n;)e.set(t[r].toLowerCase(),r);return e}function Wt(t,e,r){ys.lastIndex=0;var n=ys.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Zt(t,e,r){ys.lastIndex=0;var n=ys.exec(e.slice(r));return n?(t.U=+n[0],r+n[0].length):-1}function Jt(t,e,r){ys.lastIndex=0;var n=ys.exec(e.slice(r));return n?(t.W=+n[0],r+n[0].length):-1}function Kt(t,e,r){ys.lastIndex=0;var n=ys.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Qt(t,e,r){ys.lastIndex=0;var n=ys.exec(e.slice(r,r+2));return n?(t.y=te(+n[0]),r+n[0].length):-1}function $t(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function te(t){return t+(t>68?1900:2e3)}function ee(t,e,r){ys.lastIndex=0;var n=ys.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function re(t,e,r){ys.lastIndex=0;var n=ys.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function ne(t,e,r){ys.lastIndex=0;var n=ys.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function ie(t,e,r){ys.lastIndex=0;var n=ys.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function ae(t,e,r){ys.lastIndex=0;var n=ys.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function oe(t,e,r){ys.lastIndex=0;var n=ys.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function se(t,e,r){ys.lastIndex=0;var n=ys.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function le(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=bo(e)/60|0,i=bo(e)%60;return r+Yt(n,"0",2)+Yt(i,"0",2)}function ue(t,e,r){xs.lastIndex=0;var n=xs.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function ce(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)}}function he(){}function fe(t,e,r){var n=r.s=t+e,i=n-t,a=n-i;r.t=t-a+(e-i)}function de(t,e){t&&Ms.hasOwnProperty(t.type)&&Ms[t.type](t,e)}function pe(t,e,r){var n,i=-1,a=t.length-r;for(e.lineStart();++i<a;)n=t[i],e.point(n[0],n[1],n[2]);e.lineEnd()}function me(t,e){var r=-1,n=t.length;for(e.polygonStart();++r<n;)pe(t[r],e,1);e.polygonEnd()}function ge(){function t(t,e){t*=qo,e=e*qo/2+No/4;var r=t-n,o=r>=0?1:-1,s=o*r,l=Math.cos(e),u=Math.sin(e),c=a*u,h=i*l+c*Math.cos(s),f=c*o*Math.sin(s);ks.add(Math.atan2(f,h)),n=t,i=l,a=u}var e,r,n,i,a;Ts.point=function(o,s){Ts.point=t,n=(e=o)*qo,i=Math.cos(s=(r=s)*qo/2+No/4),a=Math.sin(s)},Ts.lineEnd=function(){t(e,r)}}function ve(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 ye(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function xe(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 be(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function _e(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function we(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 Me(t){return[Math.atan2(t[1],t[0]),nt(t[2])]}function Ae(t,e){return bo(t[0]-e[0])<Fo&&bo(t[1]-e[1])<Fo}function ke(t,e){t*=qo;var r=Math.cos(e*=qo);Te(r*Math.cos(t),r*Math.sin(t),Math.sin(e))}function Te(t,e,r){++Es,Ls+=(t-Ls)/Es,Cs+=(e-Cs)/Es,Is+=(r-Is)/Es}function Ee(){function t(t,i){t*=qo;var a=Math.cos(i*=qo),o=a*Math.cos(t),s=a*Math.sin(t),l=Math.sin(i),u=Math.atan2(Math.sqrt((u=r*l-n*s)*u+(u=n*o-e*l)*u+(u=e*s-r*o)*u),e*o+r*s+n*l);Ss+=u,zs+=u*(e+(e=o)),Ds+=u*(r+(r=s)),Ps+=u*(n+(n=l)),Te(e,r,n)}var e,r,n;js.point=function(i,a){i*=qo;var o=Math.cos(a*=qo);e=o*Math.cos(i),r=o*Math.sin(i),n=Math.sin(a),js.point=t,Te(e,r,n)}}function Se(){js.point=ke}function Le(){function t(t,e){t*=qo;var r=Math.cos(e*=qo),o=r*Math.cos(t),s=r*Math.sin(t),l=Math.sin(e),u=i*l-a*s,c=a*o-n*l,h=n*s-i*o,f=Math.sqrt(u*u+c*c+h*h),d=n*o+i*s+a*l,p=f&&-rt(d)/f,m=Math.atan2(f,d);Os+=p*u,Rs+=p*c,Fs+=p*h,Ss+=m,zs+=m*(n+(n=o)),Ds+=m*(i+(i=s)),Ps+=m*(a+(a=l)),Te(n,i,a)}var e,r,n,i,a;js.point=function(o,s){e=o,r=s,js.point=t,o*=qo;var l=Math.cos(s*=qo);n=l*Math.cos(o),i=l*Math.sin(o),a=Math.sin(s),Te(n,i,a)},js.lineEnd=function(){t(e,r),js.lineEnd=Se,js.point=ke}}function Ce(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),r&&t.invert(r[0],r[1])}),r}function Ie(){return!0}function ze(t,e,r,n,i){var a=[],o=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,r=t[0],n=t[e];if(Ae(r,n)){i.lineStart();for(var s=0;s<e;++s)i.point((r=t[s])[0],r[1]);return void i.lineEnd()}var l=new Pe(r,t,null,!0),u=new Pe(r,null,l,!1);l.o=u,a.push(l),o.push(u),l=new Pe(n,t,null,!1),u=new Pe(n,null,l,!0),l.o=u,a.push(l),o.push(u)}}),o.sort(e),De(a),De(o),a.length){for(var s=0,l=r,u=o.length;s<u;++s)o[s].e=l=!l;for(var c,h,f=a[0];;){for(var d=f,p=!0;d.v;)if((d=d.n)===f)return;c=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(p)for(var s=0,u=c.length;s<u;++s)i.point((h=c[s])[0],h[1]);else n(d.x,d.n.x,1,i);d=d.n}else{if(p){c=d.p.z;for(var s=c.length-1;s>=0;--s)i.point((h=c[s])[0],h[1])}else n(d.x,d.p.x,-1,i);d=d.p}d=d.o,c=d.z,p=!p}while(!d.v);i.lineEnd()}}}function De(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n<e;)i.n=r=t[n],r.p=i,i=r;i.n=r=t[0],r.p=i}}function Pe(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 Oe(t,e,r,n){return function(i,a){function o(e,r){var n=i(e,r);t(e=n[0],r=n[1])&&a.point(e,r)}function s(t,e){var r=i(t,e);g.point(r[0],r[1])}function l(){y.point=s,g.lineStart()}function u(){y.point=o,g.lineEnd()}function c(t,e){m.push([t,e]);var r=i(t,e);b.point(r[0],r[1])}function h(){b.lineStart(),m=[]}function f(){c(m[0][0],m[0][1]),b.lineEnd();var t,e=b.clean(),r=x.buffer(),n=r.length;if(m.pop(),p.push(m),m=null,n)if(1&e){t=r[0];var i,n=t.length-1,o=-1;if(n>0){for(_||(a.polygonStart(),_=!0),a.lineStart();++o<n;)a.point((i=t[o])[0],i[1]);a.lineEnd()}}else n>1&&2&e&&r.push(r.pop().concat(r.shift())),d.push(r.filter(Re))}var d,p,m,g=e(a),v=i.invert(n[0],n[1]),y={point:o,lineStart:l,lineEnd:u,polygonStart:function(){y.point=c,y.lineStart=h,y.lineEnd=f,d=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=l,y.lineEnd=u,d=uo.merge(d);var t=Ve(v,p);d.length?(_||(a.polygonStart(),_=!0),ze(d,je,t,r,a)):t&&(_||(a.polygonStart(),_=!0),a.lineStart(),r(null,null,1,a),a.lineEnd()),_&&(a.polygonEnd(),_=!1),d=p=null},sphere:function(){a.polygonStart(),a.lineStart(),r(null,null,1,a),a.lineEnd(),a.polygonEnd()}},x=Fe(),b=e(x),_=!1;return y}}function Re(t){return t.length>1}function Fe(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:M,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function je(t,e){return((t=t.x)[0]<0?t[1]-Vo-Fo:Vo-t[1])-((e=e.x)[0]<0?e[1]-Vo-Fo:Vo-e[1])}function Ne(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?No:-No,l=bo(a-r);bo(l-No)<Fo?(t.point(r,n=(n+o)/2>0?Vo:-Vo),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=No&&(bo(r-i)<Fo&&(r-=i*Fo),bo(a-s)<Fo&&(a-=s*Fo),n=Be(r,n,a,o),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=a,n=o),i=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}function Be(t,e,r,n){var i,a,o=Math.sin(t-r);return bo(o)>Fo?Math.atan((Math.sin(e)*(a=Math.cos(n))*Math.sin(r)-Math.sin(n)*(i=Math.cos(e))*Math.sin(t))/(i*a*o)):(e+n)/2}function Ue(t,e,r,n){var i;if(null==t)i=r*Vo,n.point(-No,i),n.point(0,i),n.point(No,i),n.point(No,0),n.point(No,-i),n.point(0,-i),n.point(-No,-i),n.point(-No,0),n.point(-No,i);else if(bo(t[0]-e[0])>Fo){var a=t[0]<e[0]?No:-No;i=r*a/2,n.point(-a,i),n.point(0,i),n.point(a,i)}else n.point(e[0],e[1])}function Ve(t,e){var r=t[0],n=t[1],i=[Math.sin(r),-Math.cos(r),0],a=0,o=0;ks.reset();for(var s=0,l=e.length;s<l;++s){var u=e[s],c=u.length;if(c)for(var h=u[0],f=h[0],d=h[1]/2+No/4,p=Math.sin(d),m=Math.cos(d),g=1;;){g===c&&(g=0),t=u[g];var v=t[0],y=t[1]/2+No/4,x=Math.sin(y),b=Math.cos(y),_=v-f,w=_>=0?1:-1,M=w*_,A=M>No,k=p*x;if(ks.add(Math.atan2(k*w*Math.sin(M),m*b+k*Math.cos(M))),a+=A?_+w*Bo:_,A^f>=r^v>=r){var T=xe(ve(h),ve(t));we(T);var E=xe(i,T);we(E);var S=(A^_>=0?-1:1)*nt(E[2]);(n>S||n===S&&(T[0]||T[1]))&&(o+=A^_>=0?1:-1)}if(!g++)break;f=v,p=x,m=b,h=t}}return(a<-Fo||a<Fo&&ks<-Fo)^1&o}function qe(t){function e(t,e){return Math.cos(t)*Math.cos(e)>a}function r(t){var r,a,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(h,f){var d,p=[h,f],m=e(h,f),g=o?m?0:i(h,f):m?i(h+(h<0?No:-No),f):0;if(!r&&(u=l=m)&&t.lineStart(),m!==l&&(d=n(r,p),(Ae(r,d)||Ae(p,d))&&(p[0]+=Fo,p[1]+=Fo,m=e(p[0],p[1]))),m!==l)c=0,m?(t.lineStart(),d=n(p,r),t.point(d[0],d[1])):(d=n(r,p),t.point(d[0],d[1]),t.lineEnd()),r=d;else if(s&&r&&o^m){var v;g&a||!(v=n(p,r,!0))||(c=0,o?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!m||r&&Ae(r,p)||t.point(p[0],p[1]),r=p,l=m,a=g},lineEnd:function(){l&&t.lineEnd(),r=null},clean:function(){return c|(u&&l)<<1}}}function n(t,e,r){var n=ve(t),i=ve(e),o=[1,0,0],s=xe(n,i),l=ye(s,s),u=s[0],c=l-u*u;if(!c)return!r&&t;var h=a*l/c,f=-a*u/c,d=xe(o,s),p=_e(o,h),m=_e(s,f);be(p,m);var g=d,v=ye(p,g),y=ye(g,g),x=v*v-y*(ye(p,p)-1);if(!(x<0)){var b=Math.sqrt(x),_=_e(g,(-v-b)/y);if(be(_,p),_=Me(_),!r)return _;var w,M=t[0],A=e[0],k=t[1],T=e[1];A<M&&(w=M,M=A,A=w);var E=A-M,S=bo(E-No)<Fo,L=S||E<Fo;if(!S&&T<k&&(w=k,k=T,T=w),L?S?k+T>0^_[1]<(bo(_[0]-M)<Fo?k:T):k<=_[1]&&_[1]<=T:E>No^(M<=_[0]&&_[0]<=A)){var C=_e(g,(-v+b)/y);return be(C,p),[_,Me(C)]}}}function i(e,r){var n=o?t:No-t,i=0;return e<-n?i|=1:e>n&&(i|=2),r<-n?i|=4:r>n&&(i|=8),i}var a=Math.cos(t),o=a>0,s=bo(a)>Fo,l=gr(t,6*qo);return Oe(e,r,l,o?[0,-t]:[-No,t-No])}function He(t,e,r,n){return function(i){var a,o=i.a,s=i.b,l=o.x,u=o.y,c=s.x,h=s.y,f=0,d=1,p=c-l,m=h-u;if(a=t-l,p||!(a>0)){if(a/=p,p<0){if(a<f)return;a<d&&(d=a)}else if(p>0){if(a>d)return;a>f&&(f=a)}if(a=r-l,p||!(a<0)){if(a/=p,p<0){if(a>d)return;a>f&&(f=a)}else if(p>0){if(a<f)return;a<d&&(d=a)}if(a=e-u,m||!(a>0)){if(a/=m,m<0){if(a<f)return;a<d&&(d=a)}else if(m>0){if(a>d)return;a>f&&(f=a)}if(a=n-u,m||!(a<0)){if(a/=m,m<0){if(a>d)return;a>f&&(f=a)}else if(m>0){if(a<f)return;a<d&&(d=a)}return f>0&&(i.a={x:l+f*p,y:u+f*m}),d<1&&(i.b={x:l+d*p,y:u+d*m}),i}}}}}}function Ye(t,e,r,n){function i(n,i){return bo(n[0]-t)<Fo?i>0?0:3:bo(n[0]-r)<Fo?i>0?2:1:bo(n[1]-e)<Fo?i>0?1:0:i>0?3:2}function a(t,e){return o(t.x,e.x)}function o(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]}return function(s){function l(t){for(var e=0,r=g.length,n=t[1],i=0;i<r;++i)for(var a,o=1,s=g[i],l=s.length,u=s[0];o<l;++o)a=s[o],u[1]<=n?a[1]>n&&et(u,a,t)>0&&++e:a[1]<=n&&et(u,a,t)<0&&--e,u=a;return 0!==e}function u(a,s,l,u){var c=0,h=0;if(null==a||(c=i(a,l))!==(h=i(s,l))||o(a,s)<0^l>0){do{u.point(0===c||3===c?t:r,c>1?n:e)}while((c=(c+l+4)%4)!==h)}else u.point(s[0],s[1])}function c(i,a){return t<=i&&i<=r&&e<=a&&a<=n}function h(t,e){c(t,e)&&s.point(t,e)}function f(){L.point=p,g&&g.push(v=[]),A=!0,M=!1,_=w=NaN}function d(){m&&(p(y,x),b&&M&&E.rejoin(),m.push(E.buffer())),L.point=h,M&&s.lineEnd()}function p(t,e){t=Math.max(-Bs,Math.min(Bs,t)),e=Math.max(-Bs,Math.min(Bs,e));var r=c(t,e);if(g&&v.push([t,e]),A)y=t,x=e,b=r,A=!1,r&&(s.lineStart(),s.point(t,e));else if(r&&M)s.point(t,e);else{var n={a:{x:_,y:w},b:{x:t,y:e}};S(n)?(M||(s.lineStart(),s.point(n.a.x,n.a.y)),s.point(n.b.x,n.b.y),r||s.lineEnd(),k=!1):r&&(s.lineStart(),s.point(t,e),k=!1)}_=t,w=e,M=r}var m,g,v,y,x,b,_,w,M,A,k,T=s,E=Fe(),S=He(t,e,r,n),L={point:h,lineStart:f,lineEnd:d,polygonStart:function(){s=E,m=[],g=[],k=!0},polygonEnd:function(){s=T,m=uo.merge(m);var e=l([t,n]),r=k&&e,i=m.length;(r||i)&&(s.polygonStart(),r&&(s.lineStart(),u(null,null,1,s),s.lineEnd()),i&&ze(m,a,e,u,s),s.polygonEnd()),m=g=v=null}};return L}}function Ge(t){var e=0,r=No/3,n=lr(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*No/180,r=t[1]*No/180):[e/No*180,r/No*180]},i}function Xe(t,e){function r(t,e){var r=Math.sqrt(a-2*i*Math.sin(e))/i;return[r*Math.sin(t*=i),o-r*Math.cos(t)]}var n=Math.sin(t),i=(n+Math.sin(e))/2,a=1+n*(2*i-n),o=Math.sqrt(a)/i;return r.invert=function(t,e){var r=o-e;return[Math.atan2(t,r)/i,nt((a-(t*t+r*r)*i*i)/(2*i))]},r}function We(){function t(t,e){Vs+=i*t-n*e,n=t,i=e}var e,r,n,i;Xs.point=function(a,o){Xs.point=t,e=n=a,r=i=o},Xs.lineEnd=function(){t(e,r)}}function Ze(t,e){t<qs&&(qs=t),t>Ys&&(Ys=t),e<Hs&&(Hs=e),e>Gs&&(Gs=e)}function Je(){function t(t,e){o.push("M",t,",",e,a)}function e(t,e){o.push("M",t,",",e),s.point=r}function r(t,e){o.push("L",t,",",e)}function n(){s.point=t}function i(){o.push("Z")}var a=Ke(4.5),o=[],s={point:t,lineStart:function(){s.point=e},lineEnd:n,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=n,s.point=t},pointRadius:function(t){return a=Ke(t),s},result:function(){if(o.length){var t=o.join("");return o=[],t}}};return s}function Ke(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Qe(t,e){Ls+=t,Cs+=e,++Is}function $e(){function t(t,n){var i=t-e,a=n-r,o=Math.sqrt(i*i+a*a);zs+=o*(e+t)/2,Ds+=o*(r+n)/2,Ps+=o,Qe(e=t,r=n)}var e,r;Zs.point=function(n,i){Zs.point=t,Qe(e=n,r=i)}}function tr(){Zs.point=Qe}function er(){function t(t,e){var r=t-n,a=e-i,o=Math.sqrt(r*r+a*a);zs+=o*(n+t)/2,Ds+=o*(i+e)/2,Ps+=o,o=i*t-n*e,Os+=o*(n+t),Rs+=o*(i+e),Fs+=3*o,Qe(n=t,i=e)}var e,r,n,i;Zs.point=function(a,o){Zs.point=t,Qe(e=n=a,r=i=o)},Zs.lineEnd=function(){t(e,r)}}function rr(t){function e(e,r){t.moveTo(e+o,r),t.arc(e,r,o,0,Bo)}function r(e,r){t.moveTo(e,r),s.point=n}function n(e,r){t.lineTo(e,r)}function i(){s.point=e}function a(){t.closePath()}var o=4.5,s={point:e,lineStart:function(){s.point=r},lineEnd:i,polygonStart:function(){s.lineEnd=a},polygonEnd:function(){s.lineEnd=i,s.point=e},pointRadius:function(t){return o=t,s},result:M};return s}function nr(t){function e(t){return(s?n:r)(t)}function r(e){return or(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})}function n(e){function r(r,n){r=t(r,n),e.point(r[0],r[1])}function n(){x=NaN,A.point=a,e.lineStart()}function a(r,n){var a=ve([r,n]),o=t(r,n);i(x,b,y,_,w,M,x=o[0],b=o[1],y=r,_=a[0],w=a[1],M=a[2],s,e),e.point(x,b)}function o(){A.point=r,e.lineEnd()}function l(){n(),A.point=u,A.lineEnd=c}function u(t,e){a(h=t,f=e),d=x,p=b,m=_,g=w,v=M,A.point=a}function c(){i(x,b,y,_,w,M,d,p,h,m,g,v,s,e),A.lineEnd=o,o()}var h,f,d,p,m,g,v,y,x,b,_,w,M,A={point:r,lineStart:n,lineEnd:o,polygonStart:function(){e.polygonStart(),A.lineStart=l},polygonEnd:function(){e.polygonEnd(),A.lineStart=n}};return A}function i(e,r,n,s,l,u,c,h,f,d,p,m,g,v){var y=c-e,x=h-r,b=y*y+x*x;if(b>4*a&&g--){var _=s+d,w=l+p,M=u+m,A=Math.sqrt(_*_+w*w+M*M),k=Math.asin(M/=A),T=bo(bo(M)-1)<Fo||bo(n-f)<Fo?(n+f)/2:Math.atan2(w,_),E=t(T,k),S=E[0],L=E[1],C=S-e,I=L-r,z=x*C-y*I;(z*z/b>a||bo((y*C+x*I)/b-.5)>.3||s*d+l*p+u*m<o)&&(i(e,r,n,s,l,u,S,L,T,_/=A,w/=A,M,g,v),v.point(S,L),i(S,L,T,_,w,M,c,h,f,d,p,m,g,v))}}var a=.5,o=Math.cos(30*qo),s=16;return e.precision=function(t){return arguments.length?(s=(a=t*t)>0&&16,e):Math.sqrt(a)},e}function ir(t){var e=nr(function(e,r){return t([e*Ho,r*Ho])});return function(t){return ur(e(t))}}function ar(t){this.stream=t}function or(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 sr(t){return lr(function(){return t})()}function lr(t){function e(t){return t=s(t[0]*qo,t[1]*qo),[t[0]*f+l,u-t[1]*f]}function r(t){return t=s.invert((t[0]-l)/f,(u-t[1])/f),t&&[t[0]*Ho,t[1]*Ho]}function n(){s=Ce(o=fr(v,y,x),a);var t=a(m,g);return l=d-t[0]*f,u=p+t[1]*f,i()}function i(){return c&&(c.valid=!1,c=null),e}var a,o,s,l,u,c,h=nr(function(t,e){return t=a(t,e),[t[0]*f+l,u-t[1]*f]}),f=150,d=480,p=250,m=0,g=0,v=0,y=0,x=0,_=Ns,w=b,M=null,A=null;return e.stream=function(t){return c&&(c.valid=!1),c=ur(_(o,h(w(t)))),c.valid=!0,c},e.clipAngle=function(t){return arguments.length?(_=null==t?(M=t,Ns):qe((M=+t)*qo),i()):M},e.clipExtent=function(t){return arguments.length?(A=t,w=t?Ye(t[0][0],t[0][1],t[1][0],t[1][1]):b,i()):A},e.scale=function(t){return arguments.length?(f=+t,n()):f},e.translate=function(t){return arguments.length?(d=+t[0],p=+t[1],n()):[d,p]},e.center=function(t){return arguments.length?(m=t[0]%360*qo,g=t[1]%360*qo,n()):[m*Ho,g*Ho]},e.rotate=function(t){return arguments.length?(v=t[0]%360*qo,y=t[1]%360*qo,x=t.length>2?t[2]%360*qo:0,n()):[v*Ho,y*Ho,x*Ho]},uo.rebind(e,h,"precision"),function(){return a=t.apply(this,arguments),e.invert=a.invert&&r,n()}}function ur(t){return or(t,function(e,r){t.point(e*qo,r*qo)})}function cr(t,e){return[t,e]}function hr(t,e){return[t>No?t-Bo:t<-No?t+Bo:t,e]}function fr(t,e,r){return t?e||r?Ce(pr(t),mr(e,r)):pr(t):e||r?mr(e,r):hr}function dr(t){return function(e,r){return e+=t,[e>No?e-Bo:e<-No?e+Bo:e,r]}}function pr(t){var e=dr(t);return e.invert=dr(-t),e}function mr(t,e){function r(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,u=Math.sin(e),c=u*n+s*i;return[Math.atan2(l*a-c*o,s*n-u*i),nt(c*a+l*o)]}var n=Math.cos(t),i=Math.sin(t),a=Math.cos(e),o=Math.sin(e);return r.invert=function(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,u=Math.sin(e),c=u*a-l*o;return[Math.atan2(l*a+u*o,s*n+c*i),nt(c*n-s*i)]},r}function gr(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=vr(r,i),a=vr(r,a),(o>0?i<a:i>a)&&(i+=o*Bo)):(i=t+o*Bo,a=t-.5*l);for(var u,c=i;o>0?c>a:c<a;c-=l)s.point((u=Me([r,-n*Math.cos(c),-n*Math.sin(c)]))[0],u[1])}}function vr(t,e){var r=ve(e);r[0]-=t,we(r);var n=rt(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-Fo)%(2*Math.PI)}function yr(t,e,r){var n=uo.range(t,e-Fo,r).concat(e);return function(t){return n.map(function(e){return[t,e]})}}function xr(t,e,r){var n=uo.range(t,e-Fo,r).concat(e);return function(t){return n.map(function(e){return[e,t]})}}function br(t){return t.source}function _r(t){return t.target}function wr(t,e,r,n){var i=Math.cos(e),a=Math.sin(e),o=Math.cos(n),s=Math.sin(n),l=i*Math.cos(t),u=i*Math.sin(t),c=o*Math.cos(r),h=o*Math.sin(r),f=2*Math.asin(Math.sqrt(st(n-e)+i*o*st(r-t))),d=1/Math.sin(f),p=f?function(t){var e=Math.sin(t*=f)*d,r=Math.sin(f-t)*d,n=r*l+e*c,i=r*u+e*h,o=r*a+e*s;return[Math.atan2(i,n)*Ho,Math.atan2(o,Math.sqrt(n*n+i*i))*Ho]}:function(){return[t*Ho,e*Ho]};return p.distance=f,p}function Mr(){function t(t,i){var a=Math.sin(i*=qo),o=Math.cos(i),s=bo((t*=qo)-e),l=Math.cos(s);Js+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=n*a-r*o*l)*s),r*a+n*o*l),e=t,r=a,n=o}var e,r,n;Ks.point=function(i,a){e=i*qo,r=Math.sin(a*=qo),n=Math.cos(a),Ks.point=t},Ks.lineEnd=function(){Ks.point=Ks.lineEnd=M}}function Ar(t,e){function r(e,r){var n=Math.cos(e),i=Math.cos(r),a=t(n*i);return[a*i*Math.sin(e),a*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),i=e(n),a=Math.sin(i),o=Math.cos(i);return[Math.atan2(t*a,n*o),Math.asin(n&&r*a/n)]},r}function kr(t,e){function r(t,e){o>0?e<-Vo+Fo&&(e=-Vo+Fo):e>Vo-Fo&&(e=Vo-Fo);var r=o/Math.pow(i(e),a);return[r*Math.sin(a*t),o-r*Math.cos(a*t)]}var n=Math.cos(t),i=function(t){return Math.tan(No/4+t/2)},a=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(i(e)/i(t)),o=n*Math.pow(i(t),a)/a;return a?(r.invert=function(t,e){var r=o-e,n=tt(a)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/a,2*Math.atan(Math.pow(o/n,1/a))-Vo]},r):Er}function Tr(t,e){function r(t,e){var r=a-e;return[r*Math.sin(i*t),a-r*Math.cos(i*t)]}var n=Math.cos(t),i=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),a=n/i+t;return bo(i)<Fo?cr:(r.invert=function(t,e){var r=a-e;return[Math.atan2(t,r)/i,a-tt(i)*Math.sqrt(t*t+r*r)]},r)}function Er(t,e){return[t,Math.log(Math.tan(No/4+e/2))]}function Sr(t){var e,r=sr(t),n=r.scale,i=r.translate,a=r.clipExtent;return r.scale=function(){var t=n.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.translate=function(){var t=i.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.clipExtent=function(t){var o=a.apply(r,arguments);if(o===r){if(e=null==t){var s=No*n(),l=i();a([[l[0]-s,l[1]-s],[l[0]+s,l[1]+s]])}}else e&&(o=null);return o},r.clipExtent(null)}function Lr(t,e){return[Math.log(Math.tan(No/4+e/2)),-t]}function Cr(t){return t[0]}function Ir(t){return t[1]}function zr(t){for(var e=t.length,r=[0,1],n=2,i=2;i<e;i++){for(;n>1&&et(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function Dr(t,e){return t[0]-e[0]||t[1]-e[1]}function Pr(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function Or(t,e,r,n){var i=t[0],a=r[0],o=e[0]-i,s=n[0]-a,l=t[1],u=r[1],c=e[1]-l,h=n[1]-u,f=(s*(l-u)-h*(i-a))/(h*o-s*c);return[i+f*o,l+f*c]}function Rr(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}function Fr(){an(this),this.edge=this.site=this.circle=null}function jr(t){var e=ul.pop()||new Fr;return e.site=t,e}function Nr(t){Zr(t),ol.remove(t),ul.push(t),an(t)}function Br(t){var e=t.circle,r=e.x,n=e.cy,i={x:r,y:n},a=t.P,o=t.N,s=[t];Nr(t);for(var l=a;l.circle&&bo(r-l.circle.x)<Fo&&bo(n-l.circle.cy)<Fo;)a=l.P,s.unshift(l),Nr(l),l=a;s.unshift(l),Zr(l);for(var u=o;u.circle&&bo(r-u.circle.x)<Fo&&bo(n-u.circle.cy)<Fo;)o=u.N,s.push(u),Nr(u),u=o;s.push(u),Zr(u);var c,h=s.length;for(c=1;c<h;++c)u=s[c],l=s[c-1],en(u.edge,l.site,u.site,i);l=s[0],u=s[h-1],u.edge=$r(l.site,u.site,null,i),Wr(l),Wr(u)}function Ur(t){for(var e,r,n,i,a=t.x,o=t.y,s=ol._;s;)if(n=Vr(s,o)-a,n>Fo)s=s.L;else{if(i=a-qr(s,o),!(i>Fo)){n>-Fo?(e=s.P,r=s):i>-Fo?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=jr(t);if(ol.insert(e,l),e||r){if(e===r)return Zr(e),r=jr(e.site),ol.insert(l,r),l.edge=r.edge=$r(e.site,l.site),Wr(e),void Wr(r);if(!r)return void(l.edge=$r(e.site,l.site));Zr(e),Zr(r);var u=e.site,c=u.x,h=u.y,f=t.x-c,d=t.y-h,p=r.site,m=p.x-c,g=p.y-h,v=2*(f*g-d*m),y=f*f+d*d,x=m*m+g*g,b={x:(g*y-d*x)/v+c,y:(f*x-m*y)/v+h};en(r.edge,u,p,b),l.edge=$r(u,t,null,b),r.edge=$r(t,p,null,b),Wr(e),Wr(r)}}function Vr(t,e){var r=t.site,n=r.x,i=r.y,a=i-e;if(!a)return n;var o=t.P;if(!o)return-(1/0);r=o.site;var s=r.x,l=r.y,u=l-e;if(!u)return s;var c=s-n,h=1/a-1/u,f=c/u;return h?(-f+Math.sqrt(f*f-2*h*(c*c/(-2*u)-l+u/2+i-a/2)))/h+n:(n+s)/2}function qr(t,e){var r=t.N;if(r)return Vr(r,e);var n=t.site;return n.y===e?n.x:1/0}function Hr(t){this.site=t,this.edges=[]}function Yr(t){for(var e,r,n,i,a,o,s,l,u,c,h=t[0][0],f=t[1][0],d=t[0][1],p=t[1][1],m=al,g=m.length;g--;)if(a=m[g],a&&a.prepare())for(s=a.edges,l=s.length,o=0;o<l;)c=s[o].end(),n=c.x,i=c.y,u=s[++o%l].start(),e=u.x,r=u.y,(bo(n-e)>Fo||bo(i-r)>Fo)&&(s.splice(o,0,new rn(tn(a.site,c,bo(n-h)<Fo&&p-i>Fo?{x:h,y:bo(e-h)<Fo?r:p}:bo(i-p)<Fo&&f-n>Fo?{x:bo(r-p)<Fo?e:f,y:p}:bo(n-f)<Fo&&i-d>Fo?{x:f,y:bo(e-f)<Fo?r:d}:bo(i-d)<Fo&&n-h>Fo?{x:bo(r-d)<Fo?e:h,y:d}:null),a.site,null)),++l)}function Gr(t,e){return e.angle-t.angle}function Xr(){an(this),this.x=this.y=this.arc=this.site=this.cy=null}function Wr(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,i=t.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,u=n.y-s,c=a.x-o,h=a.y-s,f=2*(l*h-u*c);if(!(f>=-jo)){var d=l*l+u*u,p=c*c+h*h,m=(h*d-u*p)/f,g=(l*p-c*d)/f,h=g+s,v=cl.pop()||new Xr;v.arc=t,v.site=i,v.x=m+o,v.y=h+Math.sqrt(m*m+g*g),v.cy=h,t.circle=v;for(var y=null,x=ll._;x;)if(v.y<x.y||v.y===x.y&&v.x<=x.x){if(!x.L){y=x.P;break}x=x.L}else{if(!x.R){y=x;break}x=x.R}ll.insert(y,v),y||(sl=v)}}}}function Zr(t){var e=t.circle;e&&(e.P||(sl=e.N),ll.remove(e),cl.push(e),an(e),t.circle=null)}function Jr(t){for(var e,r=il,n=He(t[0][0],t[0][1],t[1][0],t[1][1]),i=r.length;i--;)e=r[i],(!Kr(e,t)||!n(e)||bo(e.a.x-e.b.x)<Fo&&bo(e.a.y-e.b.y)<Fo)&&(e.a=e.b=null,r.splice(i,1))}function Kr(t,e){var r=t.b;if(r)return!0;var n,i,a=t.a,o=e[0][0],s=e[1][0],l=e[0][1],u=e[1][1],c=t.l,h=t.r,f=c.x,d=c.y,p=h.x,m=h.y,g=(f+p)/2,v=(d+m)/2;if(m===d){if(g<o||g>=s)return;if(f>p){if(a){if(a.y>=u)return}else a={x:g,y:l};r={x:g,y:u}}else{if(a){if(a.y<l)return}else a={x:g,y:u};r={x:g,y:l}}}else if(n=(f-p)/(m-d),i=v-n*g,n<-1||n>1)if(f>p){if(a){if(a.y>=u)return}else a={x:(l-i)/n,y:l};r={x:(u-i)/n,y:u}}else{if(a){if(a.y<l)return}else a={x:(u-i)/n,y:u};r={x:(l-i)/n,y:l}}else if(d<m){if(a){if(a.x>=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.x<o)return}else a={x:s,y:n*s+i};r={x:o,y:n*o+i}}return t.a=a,t.b=r,!0}function Qr(t,e){this.l=t,this.r=e,this.a=this.b=null}function $r(t,e,r,n){var i=new Qr(t,e);return il.push(i),r&&en(i,t,e,r),n&&en(i,e,t,n),al[t.i].edges.push(new rn(i,t,e)),al[e.i].edges.push(new rn(i,e,t)),i}function tn(t,e,r){var n=new Qr(t,null);return n.a=e,n.b=r,il.push(n),n}function en(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 rn(t,e,r){var n=t.a,i=t.b;this.edge=t,this.site=e,this.angle=r?Math.atan2(r.y-e.y,r.x-e.x):t.l===e?Math.atan2(i.x-n.x,n.y-i.y):Math.atan2(n.x-i.x,i.y-n.y)}function nn(){this._=null}function an(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function on(t,e){var r=e,n=e.R,i=r.U;i?i.L===r?i.L=n:i.R=n:t._=n,n.U=i,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}function sn(t,e){var r=e,n=e.L,i=r.U;i?i.L===r?i.L=n:i.R=n:t._=n,n.U=i,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}function ln(t){for(;t.L;)t=t.L;return t}function un(t,e){var r,n,i,a=t.sort(cn).pop();for(il=[],al=new Array(t.length),ol=new nn,ll=new nn;;)if(i=sl,a&&(!i||a.y<i.y||a.y===i.y&&a.x<i.x))a.x===r&&a.y===n||(al[a.i]=new Hr(a),Ur(a),r=a.x,n=a.y),a=t.pop();else{if(!i)break;Br(i.arc)}e&&(Jr(e),Yr(e));var o={cells:al,edges:il};return ol=ll=il=al=null,o}function cn(t,e){return e.y-t.y||e.x-t.x}function hn(t,e,r){return(t.x-r.x)*(e.y-t.y)-(t.x-e.x)*(r.y-t.y)}function fn(t){return t.x}function dn(t){return t.y}function pn(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function mn(t,e,r,n,i,a){if(!t(e,r,n,i,a)){var o=.5*(r+i),s=.5*(n+a),l=e.nodes;l[0]&&mn(t,l[0],r,n,o,s),l[1]&&mn(t,l[1],o,n,i,s),l[2]&&mn(t,l[2],r,s,o,a),l[3]&&mn(t,l[3],o,s,i,a)}}function gn(t,e,r,n,i,a,o){var s,l=1/0;return function t(u,c,h,f,d){if(!(c>a||h>o||f<n||d<i)){if(p=u.point){var p,m=e-u.x,g=r-u.y,v=m*m+g*g;if(v<l){var y=Math.sqrt(l=v);n=e-y,i=r-y,a=e+y,o=r+y,s=p}}for(var x=u.nodes,b=.5*(c+f),_=.5*(h+d),w=e>=b,M=r>=_,A=M<<1|w,k=A+4;A<k;++A)if(u=x[3&A])switch(3&A){case 0:t(u,c,h,b,_);break;case 1:t(u,b,h,f,_);break;case 2:t(u,c,_,b,d);break;case 3:t(u,b,_,f,d)}}}(t,n,i,a,o),s}function vn(t,e){t=uo.rgb(t),e=uo.rgb(e);var r=t.r,n=t.g,i=t.b,a=e.r-r,o=e.g-n,s=e.b-i;return function(t){return"#"+wt(Math.round(r+a*t))+wt(Math.round(n+o*t))+wt(Math.round(i+s*t))}}function yn(t,e){var r,n={},i={};for(r in t)r in e?n[r]=_n(t[r],e[r]):i[r]=t[r];for(r in e)r in t||(i[r]=e[r]);return function(t){for(r in n)i[r]=n[r](t);return i}}function xn(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function bn(t,e){var r,n,i,a=fl.lastIndex=dl.lastIndex=0,o=-1,s=[],l=[];for(t+="",e+="";(r=fl.exec(t))&&(n=dl.exec(e));)(i=n.index)>a&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:xn(r,n)})),a=dl.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?(e=l[0].x,function(t){return e(t)+""}):function(){return e}:(e=l.length,function(t){for(var r,n=0;n<e;++n)s[(r=l[n]).i]=r.x(t);return s.join("")})}function _n(t,e){for(var r,n=uo.interpolators.length;--n>=0&&!(r=uo.interpolators[n](t,e)););return r}function wn(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r<s;++r)n.push(_n(t[r],e[r]));for(;r<a;++r)i[r]=t[r];for(;r<o;++r)i[r]=e[r];return function(t){for(r=0;r<s;++r)i[r]=n[r](t);return i}}function Mn(t){return function(e){return e<=0?0:e>=1?1:t(e)}}function An(t){return function(e){return 1-t(1-e)}}function kn(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Tn(t){return t*t}function En(t){return t*t*t}function Sn(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 Ln(t){return function(e){return Math.pow(e,t)}}function Cn(t){return 1-Math.cos(t*Vo)}function In(t){return Math.pow(2,10*(t-1))}function zn(t){return 1-Math.sqrt(1-t*t)}function Dn(t,e){var r;return arguments.length<2&&(e=.45),arguments.length?r=e/Bo*Math.asin(1/t):(t=1,r=e/4),function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*Bo/e)}}function Pn(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function On(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 Rn(t,e){t=uo.hcl(t),e=uo.hcl(e);var r=t.h,n=t.c,i=t.l,a=e.h-r,o=e.c-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.c:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return ft(r+a*t,n+o*t,i+s*t)+""}}function Fn(t,e){t=uo.hsl(t),e=uo.hsl(e);var r=t.h,n=t.s,i=t.l,a=e.h-r,o=e.s-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.s:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return ct(r+a*t,n+o*t,i+s*t)+""}}function jn(t,e){t=uo.lab(t),e=uo.lab(e);var r=t.l,n=t.a,i=t.b,a=e.l-r,o=e.a-n,s=e.b-i;return function(t){return pt(r+a*t,n+o*t,i+s*t)+""}}function Nn(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function Bn(t){var e=[t.a,t.b],r=[t.c,t.d],n=Vn(e),i=Un(e,r),a=Vn(qn(r,e,-i))||0;e[0]*r[1]<r[0]*e[1]&&(e[0]*=-1,e[1]*=-1,n*=-1,i*=-1),this.rotate=(n?Math.atan2(e[1],e[0]):Math.atan2(-r[0],r[1]))*Ho,this.translate=[t.e,t.f],this.scale=[n,a],this.skew=a?Math.atan2(i,a)*Ho:0}function Un(t,e){return t[0]*e[0]+t[1]*e[1]}function Vn(t){var e=Math.sqrt(Un(t,t));return e&&(t[0]/=e,t[1]/=e),e}function qn(t,e,r){return t[0]+=r*e[0],t[1]+=r*e[1],t}function Hn(t){return t.length?t.pop()+",":""}function Yn(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push("translate(",null,",",null,")");n.push({i:i-4,x:xn(t[0],e[0])},{i:i-2,x:xn(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}function Gn(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(Hn(r)+"rotate(",null,")")-2,x:xn(t,e)})):e&&r.push(Hn(r)+"rotate("+e+")")}function Xn(t,e,r,n){t!==e?n.push({i:r.push(Hn(r)+"skewX(",null,")")-2,x:xn(t,e)}):e&&r.push(Hn(r)+"skewX("+e+")")}function Wn(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(Hn(r)+"scale(",null,",",null,")");n.push({i:i-4,x:xn(t[0],e[0])},{i:i-2,x:xn(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(Hn(r)+"scale("+e+")")}function Zn(t,e){var r=[],n=[];return t=uo.transform(t),e=uo.transform(e),Yn(t.translate,e.translate,r,n),Gn(t.rotate,e.rotate,r,n),Xn(t.skew,e.skew,r,n),Wn(t.scale,e.scale,r,n),t=e=null,function(t){for(var e,i=-1,a=n.length;++i<a;)r[(e=n[i]).i]=e.x(t);return r.join("")}}function Jn(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function Kn(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function Qn(t){for(var e=t.source,r=t.target,n=ti(e,r),i=[e];e!==n;)e=e.parent,i.push(e);for(var a=i.length;r!==n;)i.splice(a,0,r),r=r.parent;return i}function $n(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function ti(t,e){if(t===e)return t;for(var r=$n(t),n=$n(e),i=r.pop(),a=n.pop(),o=null;i===a;)o=i,i=r.pop(),a=n.pop();return o}function ei(t){t.fixed|=2}function ri(t){t.fixed&=-7}function ni(t){t.fixed|=4,t.px=t.x,t.py=t.y}function ii(t){t.fixed&=-5}function ai(t,e,r){var n=0,i=0;if(t.charge=0,!t.leaf)for(var a,o=t.nodes,s=o.length,l=-1;++l<s;)a=o[l],null!=a&&(ai(a,e,r),t.charge+=a.charge,n+=a.charge*a.cx,i+=a.charge*a.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var u=e*r[t.point.index];t.charge+=t.pointCharge=u,n+=u*t.point.x,i+=u*t.point.y}t.cx=n/t.charge,t.cy=i/t.charge}function oi(t,e){return uo.rebind(t,e,"sort","children","value"),t.nodes=t,t.links=fi,t}function si(t,e){for(var r=[t];null!=(t=r.pop());)if(e(t),(i=t.children)&&(n=i.length))for(var n,i;--n>=0;)r.push(i[n])}function li(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(a=t.children)&&(i=a.length))for(var i,a,o=-1;++o<i;)r.push(a[o]);for(;null!=(t=n.pop());)e(t)}function ui(t){return t.children}function ci(t){return t.value}function hi(t,e){return e.value-t.value}function fi(t){return uo.merge(t.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}function di(t){return t.x}function pi(t){return t.y}function mi(t,e,r){t.y0=e,t.y=r}function gi(t){return uo.range(t.length)}function vi(t){for(var e=-1,r=t[0].length,n=[];++e<r;)n[e]=0;return n}function yi(t){for(var e,r=1,n=0,i=t[0][1],a=t.length;r<a;++r)(e=t[r][1])>i&&(n=r,i=e);return n}function xi(t){return t.reduce(bi,0)}function bi(t,e){return t+e[1]}function _i(t,e){return wi(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function wi(t,e){for(var r=-1,n=+t[0],i=(t[1]-n)/e,a=[];++r<=e;)a[r]=i*r+n;return a}function Mi(t){return[uo.min(t),uo.max(t)]}function Ai(t,e){return t.value-e.value}function ki(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Ti(t,e){t._pack_next=e,e._pack_prev=t}function Ei(t,e){var r=e.x-t.x,n=e.y-t.y,i=t.r+e.r;return.999*i*i>r*r+n*n}function Si(t){function e(t){c=Math.min(t.x-t.r,c),h=Math.max(t.x+t.r,h),f=Math.min(t.y-t.r,f),d=Math.max(t.y+t.r,d)}if((r=t.children)&&(u=r.length)){var r,n,i,a,o,s,l,u,c=1/0,h=-(1/0),f=1/0,d=-(1/0);if(r.forEach(Li),n=r[0],n.x=-n.r,n.y=0,e(n),u>1&&(i=r[1],i.x=i.r,i.y=0,e(i),u>2))for(a=r[2],zi(n,i,a),e(a),ki(n,a),n._pack_prev=a,ki(a,i),i=n._pack_next,o=3;o<u;o++){zi(n,i,a=r[o]);var p=0,m=1,g=1;for(s=i._pack_next;s!==i;s=s._pack_next,m++)if(Ei(s,a)){p=1;break}if(1==p)for(l=n._pack_prev;l!==s._pack_prev&&!Ei(l,a);l=l._pack_prev,g++);p?(m<g||m==g&&i.r<n.r?Ti(n,i=s):Ti(n=l,i),o--):(ki(n,a),i=a,e(a))}var v=(c+h)/2,y=(f+d)/2,x=0;for(o=0;o<u;o++)a=r[o],a.x-=v,a.y-=y,x=Math.max(x,a.r+Math.sqrt(a.x*a.x+a.y*a.y));t.r=x,r.forEach(Ci)}}function Li(t){t._pack_next=t._pack_prev=t}function Ci(t){delete t._pack_next,delete t._pack_prev}function Ii(t,e,r,n){var i=t.children;if(t.x=e+=n*t.x,t.y=r+=n*t.y,t.r*=n,i)for(var a=-1,o=i.length;++a<o;)Ii(i[a],e,r,n)}function zi(t,e,r){var n=t.r+r.r,i=e.x-t.x,a=e.y-t.y;if(n&&(i||a)){var o=e.r+r.r,s=i*i+a*a;o*=o,n*=n;var l=.5+(n-o)/(2*s),u=Math.sqrt(Math.max(0,2*o*(n+s)-(n-=s)*n-o*o))/(2*s);r.x=t.x+l*i+u*a,r.y=t.y+l*a-u*i}else r.x=t.x+n,r.y=t.y}function Di(t,e){return t.parent==e.parent?1:2}function Pi(t){var e=t.children;return e.length?e[0]:t.t}function Oi(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function Ri(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 Fi(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)e=i[a],e.z+=r,e.m+=r,r+=e.s+(n+=e.c)}function ji(t,e,r){return t.a.parent===e.parent?t.a:r}function Ni(t){return 1+uo.max(t,function(t){return t.y})}function Bi(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Ui(t){var e=t.children;return e&&e.length?Ui(e[0]):t}function Vi(t){var e,r=t.children;return r&&(e=r.length)?Vi(r[e-1]):t}function qi(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Hi(t,e){var r=t.x+e[3],n=t.y+e[0],i=t.dx-e[1]-e[3],a=t.dy-e[0]-e[2];return i<0&&(r+=i/2,i=0),a<0&&(n+=a/2,a=0),{x:r,y:n,dx:i,dy:a}}function Yi(t){var e=t[0],r=t[t.length-1];return e<r?[e,r]:[r,e]}function Gi(t){return t.rangeExtent?t.rangeExtent():Yi(t.range())}function Xi(t,e,r,n){var i=r(t[0],t[1]),a=n(e[0],e[1]);return function(t){return a(i(t))}}function Wi(t,e){var r,n=0,i=t.length-1,a=t[n],o=t[i];return o<a&&(r=n,n=i,i=r,r=a,a=o,o=r),t[n]=e.floor(a),t[i]=e.ceil(o),t}function Zi(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:Al}function Ji(t,e,r,n){var i=[],a=[],o=0,s=Math.min(t.length,e.length)-1;for(t[s]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<=s;)i.push(r(t[o-1],t[o])),a.push(n(e[o-1],e[o]));return function(e){var r=uo.bisect(t,e,1,s)-1;return a[r](i[r](e))}}function Ki(t,e,r,n){function i(){var i=Math.min(t.length,e.length)>2?Ji:Xi,l=n?Kn:Jn;return o=i(t,e,l,r),s=i(e,t,l,_n),a}function a(t){return o(t)}var o,s;return a.invert=function(t){return s(t)},a.domain=function(e){return arguments.length?(t=e.map(Number),i()):t},a.range=function(t){return arguments.length?(e=t,i()):e},a.rangeRound=function(t){return a.range(t).interpolate(Nn)},a.clamp=function(t){return arguments.length?(n=t,i()):n},a.interpolate=function(t){return arguments.length?(r=t,i()):r},a.ticks=function(e){return ea(t,e)},a.tickFormat=function(e,r){return ra(t,e,r)},a.nice=function(e){return $i(t,e),i()},a.copy=function(){return Ki(t,e,r,n)},i()}function Qi(t,e){return uo.rebind(t,e,"range","rangeRound","interpolate","clamp")}function $i(t,e){return Wi(t,Zi(ta(t,e)[2])),Wi(t,Zi(ta(t,e)[2])),t}function ta(t,e){null==e&&(e=10);var r=Yi(t),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),a=e/n*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function ea(t,e){return uo.range.apply(uo,ta(t,e))}function ra(t,e,r){var n=ta(t,e);if(r){var i=fs.exec(r);if(i.shift(),"s"===i[8]){var a=uo.formatPrefix(Math.max(bo(n[0]),bo(n[1])));return i[7]||(i[7]="."+na(a.scale(n[2]))),i[8]="f",r=uo.format(i.join("")),function(t){return r(a.scale(t))+a.symbol}}i[7]||(i[7]="."+ia(i[8],n)),r=i.join("")}else r=",."+na(n[2])+"f";return uo.format(r)}function na(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function ia(t,e){var r=na(e[2]);return t in kl?Math.abs(r-na(Math.max(bo(e[0]),bo(e[1]))))+ +("e"!==t):r-2*("%"===t)}function aa(t,e,r,n){function i(t){return(r?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function a(t){return r?Math.pow(e,t):-Math.pow(e,-t)}function o(e){return t(i(e))}return o.invert=function(e){return a(t.invert(e))},o.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((n=e.map(Number)).map(i)),o):n},o.base=function(r){return arguments.length?(e=+r,t.domain(n.map(i)),o):e},o.nice=function(){var e=Wi(n.map(i),r?Math:El);return t.domain(e),n=e.map(a),o},o.ticks=function(){var t=Yi(n),o=[],s=t[0],l=t[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),h=e%1?2:e;if(isFinite(c-u)){if(r){for(;u<c;u++)for(var f=1;f<h;f++)o.push(a(u)*f);o.push(a(u))}else for(o.push(a(u));u++<c;)for(var f=h-1;f>0;f--)o.push(a(u)*f);for(u=0;o[u]<s;u++);for(c=o.length;o[c-1]>l;c--);o=o.slice(u,c)}return o},o.tickFormat=function(t,r){if(!arguments.length)return Tl;arguments.length<2?r=Tl:"function"!=typeof r&&(r=uo.format(r));var n=Math.max(1,e*t/o.ticks().length);return function(t){var o=t/a(Math.round(i(t)));return o*e<e-.5&&(o*=e),o<=n?r(t):""}},o.copy=function(){return aa(t.copy(),e,r,n)},Qi(o,t)}function oa(t,e,r){function n(e){return t(i(e))}var i=sa(e),a=sa(1/e);return n.invert=function(e){return a(t.invert(e))},n.domain=function(e){return arguments.length?(t.domain((r=e.map(Number)).map(i)),n):r},n.ticks=function(t){return ea(r,t)},n.tickFormat=function(t,e){return ra(r,t,e)},n.nice=function(t){return n.domain($i(r,t))},n.exponent=function(o){return arguments.length?(i=sa(e=o),a=sa(1/e),t.domain(r.map(i)),n):e},n.copy=function(){return oa(t.copy(),e,r)},Qi(n,t)}function sa(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function la(t,e){function r(r){return a[((i.get(r)||("range"===e.t?i.set(r,t.push(r)):NaN))-1)%a.length]}function n(e,r){return uo.range(t.length).map(function(t){return e+r*t})}var i,a,o;return r.domain=function(n){if(!arguments.length)return t;t=[],i=new h;for(var a,o=-1,s=n.length;++o<s;)i.has(a=n[o])||i.set(a,t.push(a));return r[e.t].apply(r,e.a)},r.range=function(t){return arguments.length?(a=t,o=0,e={t:"range",a:arguments},r):a},r.rangePoints=function(i,s){arguments.length<2&&(s=0);var l=i[0],u=i[1],c=t.length<2?(l=(l+u)/2,0):(u-l)/(t.length-1+s);return a=n(l+c*s/2,c),o=0,e={t:"rangePoints",a:arguments},r},r.rangeRoundPoints=function(i,s){arguments.length<2&&(s=0);var l=i[0],u=i[1],c=t.length<2?(l=u=Math.round((l+u)/2),0):(u-l)/(t.length-1+s)|0;return a=n(l+Math.round(c*s/2+(u-l-(t.length-1+s)*c)/2),c),o=0,e={t:"rangeRoundPoints",a:arguments},r},r.rangeBands=function(i,s,l){arguments.length<2&&(s=0),arguments.length<3&&(l=s);var u=i[1]<i[0],c=i[u-0],h=i[1-u],f=(h-c)/(t.length-s+2*l);return a=n(c+f*l,f),u&&a.reverse(),o=f*(1-s),e={t:"rangeBands",a:arguments},r},r.rangeRoundBands=function(i,s,l){arguments.length<2&&(s=0),arguments.length<3&&(l=s);var u=i[1]<i[0],c=i[u-0],h=i[1-u],f=Math.floor((h-c)/(t.length-s+2*l));return a=n(c+Math.round((h-c-(t.length-s)*f)/2),f),u&&a.reverse(),o=Math.round(f*(1-s)),e={t:"rangeRoundBands",a:arguments},r},r.rangeBand=function(){return o},r.rangeExtent=function(){return Yi(e.a[0])},r.copy=function(){return la(t,e)},r.domain(t)}function ua(t,e){function r(){var r=0,i=e.length;for(s=[];++r<i;)s[r-1]=uo.quantile(t,r/i);return n}function n(t){if(!isNaN(t=+t))return e[uo.bisect(s,t)]}var s;return n.domain=function(e){return arguments.length?(t=e.map(a).filter(o).sort(i),r()):t},n.range=function(t){return arguments.length?(e=t,r()):e},n.quantiles=function(){return s},n.invertExtent=function(r){return r=e.indexOf(r),r<0?[NaN,NaN]:[r>0?s[r-1]:t[0],r<s.length?s[r]:t[t.length-1]]},n.copy=function(){return ua(t,e)},r()}function ca(t,e,r){function n(e){return r[Math.max(0,Math.min(o,Math.floor(a*(e-t))))]}function i(){return a=r.length/(e-t),o=r.length-1,n}var a,o;return n.domain=function(r){return arguments.length?(t=+r[0],e=+r[r.length-1],i()):[t,e]},n.range=function(t){return arguments.length?(r=t,i()):r},n.invertExtent=function(e){return e=r.indexOf(e),e=e<0?NaN:e/a+t,[e,e+1/a]},n.copy=function(){return ca(t,e,r)},i()}function ha(t,e){function r(r){if(r<=r)return e[uo.bisect(t,r)]}return r.domain=function(e){return arguments.length?(t=e,r):t},r.range=function(t){return arguments.length?(e=t,r):e},r.invertExtent=function(r){return r=e.indexOf(r),[t[r-1],t[r]]},r.copy=function(){return ha(t,e)},r}function fa(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(r){return arguments.length?(t=r.map(e),e):t},e.ticks=function(e){return ea(t,e)},e.tickFormat=function(e,r){return ra(t,e,r)},e.copy=function(){return fa(t)},e}function da(){return 0}function pa(t){return t.innerRadius}function ma(t){return t.outerRadius}function ga(t){return t.startAngle}function va(t){return t.endAngle}function ya(t){return t&&t.padAngle}function xa(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function ba(t,e,r,n,i){var a=t[0]-e[0],o=t[1]-e[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,u=-s*a,c=t[0]+l,h=t[1]+u,f=e[0]+l,d=e[1]+u,p=(c+f)/2,m=(h+d)/2,g=f-c,v=d-h,y=g*g+v*v,x=r-n,b=c*d-f*h,_=(v<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*v-g*_)/y,M=(-b*g-v*_)/y,A=(b*v+g*_)/y,k=(-b*g+v*_)/y,T=w-p,E=M-m,S=A-p,L=k-m;return T*T+E*E>S*S+L*L&&(w=A,M=k),[[w-l,M-u],[w*r/x,M*r/x]]}function _a(t){function e(e){function o(){u.push("M",a(t(c),s))}for(var l,u=[],c=[],h=-1,f=e.length,d=St(r),p=St(n);++h<f;)i.call(this,l=e[h],h)?c.push([+d.call(this,l,h),+p.call(this,l,h)]):c.length&&(o(),c=[]);return c.length&&o(),u.length?u.join(""):null}var r=Cr,n=Ir,i=Ie,a=wa,o=a.key,s=.7;return e.x=function(t){return arguments.length?(r=t,e):r},e.y=function(t){return arguments.length?(n=t,e):n},e.defined=function(t){return arguments.length?(i=t,e):i},e.interpolate=function(t){return arguments.length?(o="function"==typeof t?a=t:(a=Dl.get(t)||wa).key,e):o},e.tension=function(t){return arguments.length?(s=t,e):s},e}function wa(t){return t.length>1?t.join("L"):t+"Z"}function Ma(t){return t.join("L")+"Z"}function Aa(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e<r;)i.push("H",(n[0]+(n=t[e])[0])/2,"V",n[1]);return r>1&&i.push("H",n[0]),i.join("")}function ka(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e<r;)i.push("V",(n=t[e])[1],"H",n[0]);return i.join("")}function Ta(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e<r;)i.push("H",(n=t[e])[0],"V",n[1]);return i.join("")}function Ea(t,e){return t.length<4?wa(t):t[1]+Ca(t.slice(1,-1),Ia(t,e))}function Sa(t,e){return t.length<3?Ma(t):t[0]+Ca((t.push(t[0]),t),Ia([t[t.length-2]].concat(t,[t[1]]),e))}function La(t,e){return t.length<3?wa(t):t[0]+Ca(t,Ia(t,e))}function Ca(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return wa(t);var r=t.length!=e.length,n="",i=t[0],a=t[1],o=e[0],s=o,l=1;if(r&&(n+="Q"+(a[0]-2*o[0]/3)+","+(a[1]-2*o[1]/3)+","+a[0]+","+a[1],i=t[1],l=2),e.length>1){s=e[1],a=t[l],l++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var u=2;u<e.length;u++,l++)a=t[l],s=e[u],n+="S"+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1]}if(r){var c=t[l];n+="Q"+(a[0]+2*s[0]/3)+","+(a[1]+2*s[1]/3)+","+c[0]+","+c[1]}return n}function Ia(t,e){for(var r,n=[],i=(1-e)/2,a=t[0],o=t[1],s=1,l=t.length;++s<l;)r=a,a=o,o=t[s],n.push([i*(o[0]-r[0]),i*(o[1]-r[1])]);return n}function za(t){if(t.length<3)return wa(t);var e=1,r=t.length,n=t[0],i=n[0],a=n[1],o=[i,i,i,(n=t[1])[0]],s=[a,a,a,n[1]],l=[i,",",a,"L",Ra(Rl,o),",",Ra(Rl,s)];for(t.push(t[r-1]);++e<=r;)n=t[e],o.shift(),o.push(n[0]),s.shift(),s.push(n[1]),Fa(l,o,s);return t.pop(),l.push("L",n),l.join("")}function Da(t){if(t.length<4)return wa(t);for(var e,r=[],n=-1,i=t.length,a=[0],o=[0];++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);for(r.push(Ra(Rl,a)+","+Ra(Rl,o)),--n;++n<i;)e=t[n],a.shift(),a.push(e[0]),o.shift(),o.push(e[1]),Fa(r,a,o);return r.join("")}function Pa(t){for(var e,r,n=-1,i=t.length,a=i+4,o=[],s=[];++n<4;)r=t[n%i],o.push(r[0]),s.push(r[1]);for(e=[Ra(Rl,o),",",Ra(Rl,s)],--n;++n<a;)r=t[n%i],o.shift(),o.push(r[0]),s.shift(),s.push(r[1]),Fa(e,o,s);return e.join("")}function Oa(t,e){var r=t.length-1;if(r)for(var n,i,a=t[0][0],o=t[0][1],s=t[r][0]-a,l=t[r][1]-o,u=-1;++u<=r;)n=t[u],i=u/r,n[0]=e*n[0]+(1-e)*(a+i*s),n[1]=e*n[1]+(1-e)*(o+i*l);return za(t)}function Ra(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Fa(t,e,r){t.push("C",Ra(Pl,e),",",Ra(Pl,r),",",Ra(Ol,e),",",Ra(Ol,r),",",Ra(Rl,e),",",Ra(Rl,r))}function ja(t,e){return(e[1]-t[1])/(e[0]-t[0])}function Na(t){for(var e=0,r=t.length-1,n=[],i=t[0],a=t[1],o=n[0]=ja(i,a);++e<r;)n[e]=(o+(o=ja(i=a,a=t[e+1])))/2;return n[e]=o,n}function Ba(t){for(var e,r,n,i,a=[],o=Na(t),s=-1,l=t.length-1;++s<l;)e=ja(t[s],t[s+1]),bo(e)<Fo?o[s]=o[s+1]=0:(r=o[s]/e,n=o[s+1]/e,i=r*r+n*n,i>9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n));for(s=-1;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}function Ua(t){return t.length<3?wa(t):t[0]+Ca(t,Ba(t))}function Va(t){for(var e,r,n,i=-1,a=t.length;++i<a;)e=t[i],r=e[0],n=e[1]-Vo,e[0]=r*Math.cos(n),e[1]=r*Math.sin(n);return t}function qa(t){function e(e){function l(){m.push("M",s(t(v),h),c,u(t(g.reverse()),h),"Z")}for(var f,d,p,m=[],g=[],v=[],y=-1,x=e.length,b=St(r),_=St(i),w=r===n?function(){return d}:St(n),M=i===a?function(){return p}:St(a);++y<x;)o.call(this,f=e[y],y)?(g.push([d=+b.call(this,f,y),p=+_.call(this,f,y)]),v.push([+w.call(this,f,y),+M.call(this,f,y)])):g.length&&(l(),g=[],v=[]);return g.length&&l(),m.length?m.join(""):null}var r=Cr,n=Cr,i=0,a=Ir,o=Ie,s=wa,l=s.key,u=s,c="L",h=.7;return e.x=function(t){return arguments.length?(r=n=t,e):n},e.x0=function(t){return arguments.length?(r=t,e):r},e.x1=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(i=a=t,e):a},e.y0=function(t){return arguments.length?(i=t,e):i},e.y1=function(t){return arguments.length?(a=t,e):a},e.defined=function(t){return arguments.length?(o=t,e):o},e.interpolate=function(t){return arguments.length?(l="function"==typeof t?s=t:(s=Dl.get(t)||wa).key,u=s.reverse||s,c=s.closed?"M":"L",e):l},e.tension=function(t){return arguments.length?(h=t,e):h},e}function Ha(t){return t.radius}function Ya(t){return[t.x,t.y]}function Ga(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Vo;return[r*Math.cos(n),r*Math.sin(n)]}}function Xa(){return 64}function Wa(){return"circle"}function Za(t){var e=Math.sqrt(t/No);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}function Ja(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 Ka(t,e,r){return ko(t,ql),t.namespace=e,t.id=r,t}function Qa(t,e,r,n){var i=t.id,a=t.namespace;return Y(t,"function"==typeof r?function(t,o,s){t[a][i].tween.set(e,n(r.call(t,t.__data__,o,s)))}:(r=n(r),function(t){t[a][i].tween.set(e,r)}))}function $a(t){return null==t&&(t=""),function(){this.textContent=t}}function to(t){return null==t?"__transition__":"__transition_"+t+"__"}function eo(t,e,r,n,i){function a(t){var e=m.delay;return u.t=e+l,e<=t?o(t-e):void(u.c=o)}function o(r){var i=p.active,a=p[i];a&&(a.timer.c=null,a.timer.t=NaN,--p.count,delete p[i],a.event&&a.event.interrupt.call(t,t.__data__,a.index));for(var o in p)if(+o<n){var h=p[o];h.timer.c=null,h.timer.t=NaN,--p.count,delete p[o]}u.c=s,Dt(function(){return u.c&&s(r||1)&&(u.c=null,u.t=NaN),1},0,l),p.active=n,m.event&&m.event.start.call(t,t.__data__,e),d=[],m.tween.forEach(function(r,n){(n=n.call(t,t.__data__,e))&&d.push(n)}),f=m.ease,c=m.duration}function s(i){for(var a=i/c,o=f(a),s=d.length;s>0;)d[--s].call(t,o);if(a>=1)return m.event&&m.event.end.call(t,t.__data__,e),--p.count?delete p[n]:delete t[r],1}var l,u,c,f,d,p=t[r]||(t[r]={active:0,count:0}),m=p[n];m||(l=i.time,u=Dt(a,0,l),m=p[n]={tween:new h,time:l,timer:u,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++p.count)}function ro(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"})}function no(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"})}function io(t){return t.toISOString()}function ao(t,e,r){function n(e){return t(e)}function i(t,r){var n=t[1]-t[0],i=n/r,a=uo.bisect(Ql,i);return a==Ql.length?[e.year,ta(t.map(function(t){return t/31536e6}),r)[2]]:a?e[i/Ql[a-1]<Ql[a]/i?a-1:a]:[eu,ta(t,r)[2]]}return n.invert=function(e){return oo(t.invert(e))},n.domain=function(e){return arguments.length?(t.domain(e),n):t.domain().map(oo)},n.nice=function(t,e){function r(r){return!isNaN(r)&&!t.range(r,oo(+r+1),e).length}var a=n.domain(),o=Yi(a),s=null==t?i(o,10):"number"==typeof t&&i(o,t);return s&&(t=s[0],e=s[1]),n.domain(Wi(a,e>1?{floor:function(e){for(;r(e=t.floor(e));)e=oo(e-1);return e},ceil:function(e){for(;r(e=t.ceil(e));)e=oo(+e+1);return e}}:t))},n.ticks=function(t,e){var r=Yi(n.domain()),a=null==t?i(r,10):"number"==typeof t?i(r,t):!t.range&&[{range:t},e];return a&&(t=a[0],e=a[1]),t.range(r[0],oo(+r[1]+1),e<1?1:e)},n.tickFormat=function(){return r},n.copy=function(){return ao(t.copy(),e,r)},Qi(n,t)}function oo(t){return new Date(t)}function so(t){return JSON.parse(t.responseText)}function lo(t){var e=fo.createRange();return e.selectNode(fo.body),e.createContextualFragment(t.responseText)}var uo={version:"3.5.17"},co=[].slice,ho=function(t){return co.call(t)},fo=this.document;if(fo)try{ho(fo.documentElement.childNodes)[0].nodeType}catch(t){ho=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}),fo)try{fo.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var po=this.Element.prototype,mo=po.setAttribute,go=po.setAttributeNS,vo=this.CSSStyleDeclaration.prototype,yo=vo.setProperty;po.setAttribute=function(t,e){mo.call(this,t,e+"")},po.setAttributeNS=function(t,e,r){go.call(this,t,e,r+"")},vo.setProperty=function(t,e,r){yo.call(this,t,e+"",r)}}uo.ascending=i,uo.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},uo.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i<a;)if(null!=(n=t[i])&&n>=n){r=n;break}for(;++i<a;)null!=(n=t[i])&&r>n&&(r=n)}else{for(;++i<a;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=n;break}for(;++i<a;)null!=(n=e.call(t,t[i],i))&&r>n&&(r=n)}return r},uo.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i<a;)if(null!=(n=t[i])&&n>=n){r=n;break}for(;++i<a;)null!=(n=t[i])&&n>r&&(r=n)}else{for(;++i<a;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=n;break}for(;++i<a;)null!=(n=e.call(t,t[i],i))&&n>r&&(r=n)}return r},uo.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a<o;)if(null!=(n=t[a])&&n>=n){r=i=n;break}for(;++a<o;)null!=(n=t[a])&&(r>n&&(r=n),i<n&&(i=n))}else{for(;++a<o;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=i=n;break}for(;++a<o;)null!=(n=e.call(t,t[a],a))&&(r>n&&(r=n),i<n&&(i=n))}return[r,i]},uo.sum=function(t,e){var r,n=0,i=t.length,a=-1;if(1===arguments.length)for(;++a<i;)o(r=+t[a])&&(n+=r);else for(;++a<i;)o(r=+e.call(t,t[a],a))&&(n+=r);return n},uo.mean=function(t,e){var r,n=0,i=t.length,s=-1,l=i;if(1===arguments.length)for(;++s<i;)o(r=a(t[s]))?n+=r:--l;else for(;++s<i;)o(r=a(e.call(t,t[s],s)))?n+=r:--l;if(l)return n/l},uo.quantile=function(t,e){var r=(t.length-1)*e+1,n=Math.floor(r),i=+t[n-1],a=r-n;return a?i+a*(t[n]-i):i},uo.median=function(t,e){var r,n=[],s=t.length,l=-1;if(1===arguments.length)for(;++l<s;)o(r=a(t[l]))&&n.push(r);else for(;++l<s;)o(r=a(e.call(t,t[l],l)))&&n.push(r);if(n.length)return uo.quantile(n.sort(i),.5)},uo.variance=function(t,e){var r,n,i=t.length,s=0,l=0,u=-1,c=0;if(1===arguments.length)for(;++u<i;)o(r=a(t[u]))&&(n=r-s,s+=n/++c,l+=n*(r-s));else for(;++u<i;)o(r=a(e.call(t,t[u],u)))&&(n=r-s,s+=n/++c,l+=n*(r-s));if(c>1)return l/(c-1)},uo.deviation=function(){var t=uo.variance.apply(this,arguments);return t?Math.sqrt(t):t};var xo=s(i);uo.bisectLeft=xo.left,uo.bisect=uo.bisectRight=xo.right,uo.bisector=function(t){return s(1===t.length?function(e,r){return i(t(e),r)}:t)},uo.shuffle=function(t,e,r){(a=arguments.length)<3&&(r=t.length,a<2&&(e=0));for(var n,i,a=r-e;a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},uo.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},uo.pairs=function(t){for(var e,r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r<n;)a[r]=[e=i,i=t[++r]];return a},uo.transpose=function(t){if(!(i=t.length))return[];for(var e=-1,r=uo.min(t,l),n=new Array(r);++e<r;)for(var i,a=-1,o=n[e]=new Array(i);++a<i;)o[a]=t[a][e];return n},uo.zip=function(){return uo.transpose(arguments)},uo.keys=function(t){var e=[];for(var r in t)e.push(r);return e},uo.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},uo.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},uo.merge=function(t){for(var e,r,n,i=t.length,a=-1,o=0;++a<i;)o+=t[a].length;for(r=new Array(o);--i>=0;)for(n=t[i],e=n.length;--e>=0;)r[--o]=n[e];return r};var bo=Math.abs;uo.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r===1/0)throw new Error("infinite range");var n,i=[],a=u(bo(r)),o=-1;if(t*=a,e*=a,r*=a,r<0)for(;(n=t+r*++o)>e;)i.push(n/a);else for(;(n=t+r*++o)<e;)i.push(n/a);return i},uo.map=function(t,e){var r=new h;if(t instanceof h)t.forEach(function(t,e){r.set(t,e)});else if(Array.isArray(t)){var n,i=-1,a=t.length;if(1===arguments.length)for(;++i<a;)r.set(i,t[i]);else for(;++i<a;)r.set(e.call(t,n=t[i],i),n)}else for(var o in t)r.set(o,t[o]);return r};var _o="__proto__",wo="\0";c(h,{has:p,get:function(t){return this._[f(t)]},set:function(t,e){return this._[f(t)]=e},remove:m,keys:g,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:d(e),value:this._[e]});return t},size:v,empty:y,forEach:function(t){for(var e in this._)t.call(this,d(e),this._[e])}}),uo.nest=function(){function t(e,o,s){if(s>=a.length)return n?n.call(i,o):r?o.sort(r):o;for(var l,u,c,f,d=-1,p=o.length,m=a[s++],g=new h;++d<p;)(f=g.get(l=m(u=o[d])))?f.push(u):g.set(l,[u]);return e?(u=e(),c=function(r,n){u.set(r,t(e,n,s))}):(u={},c=function(r,n){u[r]=t(e,n,s)}),g.forEach(c),u}function e(t,r){if(r>=a.length)return t;var n=[],i=o[r++];return t.forEach(function(t,i){n.push({key:t,values:e(i,r)})}),i?n.sort(function(t,e){return i(t.key,e.key)}):n}var r,n,i={},a=[],o=[];return i.map=function(e,r){return t(r,e,0)},i.entries=function(r){return e(t(uo.map,r,0),0)},i.key=function(t){return a.push(t),i},i.sortKeys=function(t){return o[a.length-1]=t,i},i.sortValues=function(t){return r=t,i},i.rollup=function(t){return n=t,i},i},uo.set=function(t){var e=new x;if(t)for(var r=0,n=t.length;r<n;++r)e.add(t[r]);return e},c(x,{has:p,add:function(t){return this._[f(t+="")]=!0,t},remove:m,values:g,size:v,empty:y,forEach:function(t){for(var e in this._)t.call(this,d(e))}}),uo.behavior={},uo.rebind=function(t,e){for(var r,n=1,i=arguments.length;++n<i;)t[r=arguments[n]]=_(t,e,e[r]);return t};var Mo=["webkit","ms","moz","Moz","o","O"];uo.dispatch=function(){for(var t=new A,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=k(t);return t},A.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}},uo.event=null,uo.requote=function(t){return t.replace(Ao,"\\$&")};var Ao=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,ko={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]},To=function(t,e){return e.querySelector(t)},Eo=function(t,e){return e.querySelectorAll(t)},So=function(t,e){var r=t.matches||t[w(t,"matchesSelector")];return(So=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(To=function(t,e){return Sizzle(t,e)[0]||null},Eo=Sizzle,So=Sizzle.matchesSelector),uo.selection=function(){return uo.select(fo.documentElement)};var Lo=uo.selection.prototype=[];Lo.select=function(t){var e,r,n,i,a=[];t=C(t);for(var o=-1,s=this.length;++o<s;){a.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var l=-1,u=n.length;++l<u;)(i=n[l])?(e.push(r=t.call(i,i.__data__,l,o)),r&&"__data__"in i&&(r.__data__=i.__data__)):e.push(null)}return L(a)},Lo.selectAll=function(t){var e,r,n=[];t=I(t);for(var i=-1,a=this.length;++i<a;)for(var o=this[i],s=-1,l=o.length;++s<l;)(r=o[s])&&(n.push(e=ho(t.call(r,r.__data__,s,i))),e.parentNode=r);return L(n)};var Co="http://www.w3.org/1999/xhtml",Io={svg:"http://www.w3.org/2000/svg",xhtml:Co,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};uo.ns={prefix:Io,qualify:function(t){var e=t.indexOf(":"),r=t;return e>=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),Io.hasOwnProperty(r)?{space:Io[r],local:t}:t}},Lo.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node();return t=uo.ns.qualify(t),t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(z(e,t[e]));return this}return this.each(z(t,e))},Lo.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=O(t)).length,i=-1;if(e=r.classList){for(;++i<n;)if(!e.contains(t[i]))return!1}else for(e=r.getAttribute("class");++i<n;)if(!P(t[i]).test(e))return!1;return!0}for(e in t)this.each(R(e,t[e]));return this}return this.each(R(t,e))},Lo.style=function(t,e,r){var i=arguments.length;if(i<3){if("string"!=typeof t){i<2&&(e="");for(r in t)this.each(j(r,t[r],e));return this}if(i<2){var a=this.node();return n(a).getComputedStyle(a,null).getPropertyValue(t)}r=""}return this.each(j(t,e,r))},Lo.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(N(e,t[e]));return this}return this.each(N(t,e))},Lo.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},Lo.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},Lo.append=function(t){return t=B(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},Lo.insert=function(t,e){return t=B(t),e=C(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},Lo.remove=function(){return this.each(U)},Lo.data=function(t,e){function r(t,r){var n,i,a,o=t.length,c=r.length,f=Math.min(o,c),d=new Array(c),p=new Array(c),m=new Array(o);if(e){var g,v=new h,y=new Array(o);for(n=-1;++n<o;)(i=t[n])&&(v.has(g=e.call(i,i.__data__,n))?m[n]=i:v.set(g,i),y[n]=g);for(n=-1;++n<c;)(i=v.get(g=e.call(r,a=r[n],n)))?i!==!0&&(d[n]=i,i.__data__=a):p[n]=V(a),v.set(g,!0);for(n=-1;++n<o;)n in y&&v.get(y[n])!==!0&&(m[n]=t[n])}else{for(n=-1;++n<f;)i=t[n],a=r[n],i?(i.__data__=a,d[n]=i):p[n]=V(a);for(;n<c;++n)p[n]=V(r[n]);for(;n<o;++n)m[n]=t[n]}p.update=d,p.parentNode=d.parentNode=m.parentNode=t.parentNode,s.push(p),l.push(d),u.push(m)}var n,i,a=-1,o=this.length;if(!arguments.length){for(t=new Array(o=(n=this[0]).length);++a<o;)(i=n[a])&&(t[a]=i.__data__);return t}var s=G([]),l=L([]),u=L([]);if("function"==typeof t)for(;++a<o;)r(n=this[a],t.call(n,n.parentNode.__data__,a));else for(;++a<o;)r(n=this[a],t);return l.enter=function(){return s},l.exit=function(){return u},l},Lo.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},Lo.filter=function(t){var e,r,n,i=[];"function"!=typeof t&&(t=q(t));for(var a=0,o=this.length;a<o;a++){i.push(e=[]),e.parentNode=(r=this[a]).parentNode;for(var s=0,l=r.length;s<l;s++)(n=r[s])&&t.call(n,n.__data__,s,a)&&e.push(n)}return L(i)},Lo.order=function(){for(var t=-1,e=this.length;++t<e;)for(var r,n=this[t],i=n.length-1,a=n[i];--i>=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},Lo.sort=function(t){t=H.apply(this,arguments);for(var e=-1,r=this.length;++e<r;)this[e].sort(t);return this.order()},Lo.each=function(t){return Y(this,function(e,r,n){t.call(e,e.__data__,r,n)})},Lo.call=function(t){var e=ho(arguments);return t.apply(e[0]=this,e),this},Lo.empty=function(){return!this.node()},Lo.node=function(){for(var t=0,e=this.length;t<e;t++)for(var r=this[t],n=0,i=r.length;n<i;n++){var a=r[n];if(a)return a}return null},Lo.size=function(){var t=0;return Y(this,function(){++t}),t};var zo=[];uo.selection.enter=G,uo.selection.enter.prototype=zo,zo.append=Lo.append,zo.empty=Lo.empty,zo.node=Lo.node,zo.call=Lo.call,zo.size=Lo.size,zo.select=function(t){for(var e,r,n,i,a,o=[],s=-1,l=this.length;++s<l;){n=(i=this[s]).update,o.push(e=[]),e.parentNode=i.parentNode;for(var u=-1,c=i.length;++u<c;)(a=i[u])?(e.push(n[u]=r=t.call(i.parentNode,a.__data__,u,s)),r.__data__=a.__data__):e.push(null)}return L(o)},zo.insert=function(t,e){return arguments.length<2&&(e=X(this)),Lo.insert.call(this,t,e)},uo.select=function(t){var r;return"string"==typeof t?(r=[To(t,fo)],r.parentNode=fo.documentElement):(r=[t],r.parentNode=e(t)),L([r])},uo.selectAll=function(t){var e;return"string"==typeof t?(e=ho(Eo(t,fo)),e.parentNode=fo.documentElement):(e=ho(t),e.parentNode=null),L([e])},Lo.on=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){n<2&&(e=!1);for(r in t)this.each(W(r,t[r],e));return this}if(n<2)return(n=this.node()["__on"+t])&&n._;r=!1}return this.each(W(t,e,r))};var Do=uo.map({mouseenter:"mouseover",mouseleave:"mouseout"});fo&&Do.forEach(function(t){"on"+t in fo&&Do.remove(t)});var Po,Oo=0;uo.mouse=function(t){return Q(t,E())};var Ro=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;uo.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=E().changedTouches),e)for(var n,i=0,a=e.length;i<a;++i)if((n=e[i]).identifier===r)return Q(t,n)},uo.behavior.drag=function(){function t(){this.on("mousedown.drag",a).on("touchstart.drag",o)}function e(t,e,n,a,o){return function(){function s(){var t,r,n=e(f,m);n&&(t=n[0]-x[0],r=n[1]-x[1],p|=t|r,x=n,d({type:"drag",x:n[0]+u[0],y:n[1]+u[1],dx:t,dy:r}))}function l(){e(f,m)&&(v.on(a+g,null).on(o+g,null),y(p),d({type:"dragend"}))}var u,c=this,h=uo.event.target.correspondingElement||uo.event.target,f=c.parentNode,d=r.of(c,arguments),p=0,m=t(),g=".drag"+(null==m?"":"-"+m),v=uo.select(n(h)).on(a+g,s).on(o+g,l),y=K(h),x=e(f,m);i?(u=i.apply(c,arguments),u=[u.x-x[0],u.y-x[1]]):u=[0,0],d({type:"dragstart"})}}var r=S(t,"drag","dragstart","dragend"),i=null,a=e(M,uo.mouse,n,"mousemove","mouseup"),o=e($,uo.touch,b,"touchmove","touchend");return t.origin=function(e){return arguments.length?(i=e,t):i},uo.rebind(t,r,"on")},uo.touches=function(t,e){return arguments.length<2&&(e=E().touches),e?ho(e).map(function(e){var r=Q(t,e);return r.identifier=e.identifier,r}):[]};var Fo=1e-6,jo=Fo*Fo,No=Math.PI,Bo=2*No,Uo=Bo-Fo,Vo=No/2,qo=No/180,Ho=180/No,Yo=Math.SQRT2,Go=2,Xo=4;uo.interpolateZoom=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],u=e[2],c=s-i,h=l-a,f=c*c+h*h;if(f<jo)n=Math.log(u/o)/Yo,r=function(t){return[i+t*c,a+t*h,o*Math.exp(Yo*t*n)]};else{var d=Math.sqrt(f),p=(u*u-o*o+Xo*f)/(2*o*Go*d),m=(u*u-o*o-Xo*f)/(2*u*Go*d),g=Math.log(Math.sqrt(p*p+1)-p),v=Math.log(Math.sqrt(m*m+1)-m);n=(v-g)/Yo,r=function(t){var e=t*n,r=at(g),s=o/(Go*d)*(r*ot(Yo*e+g)-it(g));return[i+s*c,a+s*h,o*r/at(Yo*e+g)]}}return r.duration=1e3*n,r},uo.behavior.zoom=function(){function t(t){t.on(I,h).on(Zo+".zoom",d).on("dblclick.zoom",p).on(P,f)}function e(t){return[(t[0]-A.x)/A.k,(t[1]-A.y)/A.k]}function r(t){return[t[0]*A.k+A.x,t[1]*A.k+A.y]}function i(t){A.k=Math.max(E[0],Math.min(E[1],t))}function a(t,e){e=r(e),A.x+=t[0]-e[0],A.y+=t[1]-e[1]}function o(e,r,n,o){e.__chart__={x:A.x,y:A.y,k:A.k},i(Math.pow(2,o)),a(g=r,n),e=uo.select(e),L>0&&(e=e.transition().duration(L)),e.call(t.event)}function s(){_&&_.domain(b.range().map(function(t){return(t-A.x)/A.k}).map(b.invert)),M&&M.domain(w.range().map(function(t){return(t-A.y)/A.k}).map(w.invert))}function l(t){C++||t({type:"zoomstart"})}function u(t){s(),t({type:"zoom",scale:A.k,translate:[A.x,A.y]})}function c(t){--C||(t({type:"zoomend"}),g=null)}function h(){function t(){s=1,a(uo.mouse(i),f),u(o)}function r(){h.on(z,null).on(D,null),d(s),c(o)}var i=this,o=O.of(i,arguments),s=0,h=uo.select(n(i)).on(z,t).on(D,r),f=e(uo.mouse(i)),d=K(i);Vl.call(i),l(o)}function f(){function t(){var t=uo.touches(p);return d=A.k,t.forEach(function(t){t.identifier in g&&(g[t.identifier]=e(t))}),t}function r(){var e=uo.event.target;uo.select(e).on(b,n).on(_,s),w.push(e);for(var r=uo.event.changedTouches,i=0,a=r.length;i<a;++i)g[r[i].identifier]=null;var l=t(),u=Date.now();if(1===l.length){if(u-x<500){var c=l[0];o(p,c,g[c.identifier],Math.floor(Math.log(A.k)/Math.LN2)+1),T()}x=u}else if(l.length>1){var c=l[0],h=l[1],f=c[0]-h[0],d=c[1]-h[1];v=f*f+d*d}}function n(){var t,e,r,n,o=uo.touches(p);Vl.call(p);for(var s=0,l=o.length;s<l;++s,n=null)if(r=o[s],n=g[r.identifier]){if(e)break;t=r,e=n}if(n){var c=(c=r[0]-t[0])*c+(c=r[1]-t[1])*c,h=v&&Math.sqrt(c/v);t=[(t[0]+r[0])/2,(t[1]+r[1])/2],e=[(e[0]+n[0])/2,(e[1]+n[1])/2],i(h*d)}x=null,a(t,e),u(m)}function s(){if(uo.event.touches.length){for(var e=uo.event.changedTouches,r=0,n=e.length;r<n;++r)delete g[e[r].identifier];for(var i in g)return void t()}uo.selectAll(w).on(y,null),M.on(I,h).on(P,f),k(),c(m)}var d,p=this,m=O.of(p,arguments),g={},v=0,y=".zoom-"+uo.event.changedTouches[0].identifier,b="touchmove"+y,_="touchend"+y,w=[],M=uo.select(p),k=K(p);r(),l(m),M.on(I,null).on(P,r)}function d(){var t=O.of(this,arguments);y?clearTimeout(y):(Vl.call(this),m=e(g=v||uo.mouse(this)),l(t)),y=setTimeout(function(){y=null,c(t)},50),T(),i(Math.pow(2,.002*Wo())*A.k),a(g,m),u(t)}function p(){var t=uo.mouse(this),r=Math.log(A.k)/Math.LN2;o(this,t,e(t),uo.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}var m,g,v,y,x,b,_,w,M,A={x:0,y:0,k:1},k=[960,500],E=Jo,L=250,C=0,I="mousedown.zoom",z="mousemove.zoom",D="mouseup.zoom",P="touchstart.zoom",O=S(t,"zoomstart","zoom","zoomend");return Zo||(Zo="onwheel"in fo?(Wo=function(){return-uo.event.deltaY*(uo.event.deltaMode?120:1)},"wheel"):"onmousewheel"in fo?(Wo=function(){return uo.event.wheelDelta},"mousewheel"):(Wo=function(){return-uo.event.detail},"MozMousePixelScroll")),t.event=function(t){t.each(function(){var t=O.of(this,arguments),e=A;Bl?uo.select(this).transition().each("start.zoom",function(){A=this.__chart__||{x:0,y:0,k:1},l(t)}).tween("zoom:zoom",function(){var r=k[0],n=k[1],i=g?g[0]:r/2,a=g?g[1]:n/2,o=uo.interpolateZoom([(i-A.x)/A.k,(a-A.y)/A.k,r/A.k],[(i-e.x)/e.k,(a-e.y)/e.k,r/e.k]);return function(e){var n=o(e),s=r/n[2];this.__chart__=A={x:i-n[0]*s,y:a-n[1]*s,k:s},u(t)}}).each("interrupt.zoom",function(){c(t)}).each("end.zoom",function(){c(t)}):(this.__chart__=A,l(t),u(t),c(t))})},t.translate=function(e){return arguments.length?(A={x:+e[0],y:+e[1],k:A.k},s(),t):[A.x,A.y]},t.scale=function(e){return arguments.length?(A={x:A.x,y:A.y,k:null},i(+e),s(),t):A.k},t.scaleExtent=function(e){return arguments.length?(E=null==e?Jo:[+e[0],+e[1]],t):E},t.center=function(e){return arguments.length?(v=e&&[+e[0],+e[1]],t):v},t.size=function(e){return arguments.length?(k=e&&[+e[0],+e[1]],t):k},t.duration=function(e){return arguments.length?(L=+e,t):L},t.x=function(e){return arguments.length?(_=e,b=e.copy(),A={x:0,y:0,k:1},t):_},t.y=function(e){return arguments.length?(M=e,w=e.copy(),A={x:0,y:0,k:1},t):M},uo.rebind(t,O,"on")};var Wo,Zo,Jo=[0,1/0];uo.color=lt,lt.prototype.toString=function(){return this.rgb()+""},uo.hsl=ut;var Ko=ut.prototype=new lt;Ko.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new ut(this.h,this.s,this.l/t)},Ko.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new ut(this.h,this.s,t*this.l)},Ko.rgb=function(){return ct(this.h,this.s,this.l)},uo.hcl=ht;var Qo=ht.prototype=new lt;Qo.brighter=function(t){return new ht(this.h,this.c,Math.min(100,this.l+$o*(arguments.length?t:1)))},Qo.darker=function(t){return new ht(this.h,this.c,Math.max(0,this.l-$o*(arguments.length?t:1)))},Qo.rgb=function(){return ft(this.h,this.c,this.l).rgb()},uo.lab=dt;var $o=18,ts=.95047,es=1,rs=1.08883,ns=dt.prototype=new lt;ns.brighter=function(t){return new dt(Math.min(100,this.l+$o*(arguments.length?t:1)),this.a,this.b)},ns.darker=function(t){return new dt(Math.max(0,this.l-$o*(arguments.length?t:1)),this.a,this.b)},ns.rgb=function(){return pt(this.l,this.a,this.b)},uo.rgb=xt;var is=xt.prototype=new lt;is.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,i=30;return e||r||n?(e&&e<i&&(e=i),r&&r<i&&(r=i),n&&n<i&&(n=i),new xt(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new xt(i,i,i)},is.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new xt(t*this.r,t*this.g,t*this.b)},is.hsl=function(){return At(this.r,this.g,this.b)},is.toString=function(){return"#"+wt(this.r)+wt(this.g)+wt(this.b)};var as=uo.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});as.forEach(function(t,e){as.set(t,bt(e))}),uo.functor=St,uo.xhr=Lt(b),uo.dsv=function(t,e){function r(t,r,a){arguments.length<3&&(a=r,r=null);var o=Ct(t,e,null==r?n:i(r),a);return o.row=function(t){return arguments.length?o.response(null==(r=t)?n:i(t)):r},o}function n(t){return r.parse(t.responseText)}function i(t){return function(e){return r.parse(e.responseText,t)}}function a(e){return e.map(o).join(t)}function o(t){return s.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var s=new RegExp('["'+t+"\n]"),l=t.charCodeAt(0);return r.parse=function(t,e){var n;return r.parseRows(t,function(t,r){if(n)return n(t,r-1);var i=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");n=e?function(t,r){return e(i(t),r)}:i})},r.parseRows=function(t,e){function r(){if(c>=u)return o;if(i)return i=!1,a;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++<u;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}c=r+2;var n=t.charCodeAt(r+1);return 13===n?(i=!0,10===t.charCodeAt(r+2)&&++c):10===n&&(i=!0),t.slice(e+1,r).replace(/""/g,'"')}for(;c<u;){var n=t.charCodeAt(c++),s=1;if(10===n)i=!0;else if(13===n)i=!0,10===t.charCodeAt(c)&&(++c,++s);else if(n!==l)continue;return t.slice(e,c-s)}return t.slice(e)}for(var n,i,a={},o={},s=[],u=t.length,c=0,h=0;(n=r())!==o;){for(var f=[];n!==a&&n!==o;)f.push(n),n=r();e&&null==(f=e(f,h++))||s.push(f)}return s},r.format=function(e){if(Array.isArray(e[0]))return r.formatRows(e);var n=new x,i=[];return e.forEach(function(t){for(var e in t)n.has(e)||i.push(n.add(e))}),[i.map(o).join(t)].concat(e.map(function(e){return i.map(function(t){return o(e[t])}).join(t)})).join("\n")},r.formatRows=function(t){return t.map(a).join("\n")},r},uo.csv=uo.dsv(",","text/csv"),uo.tsv=uo.dsv("\t","text/tab-separated-values");var os,ss,ls,us,cs=this[w(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};uo.timer=function(){Dt.apply(this,arguments)},uo.timer.flush=function(){Ot(),Rt()},uo.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var hs=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(jt);uo.formatPrefix=function(t,e){var r=0;return(t=+t)&&(t<0&&(t*=-1),e&&(t=uo.round(t,Ft(t,e))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((r-1)/3)))),hs[8+r/3]};var fs=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,ds=uo.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(t,e){return(t=uo.round(t,Ft(t,e))).toFixed(Math.max(0,Math.min(20,Ft(t*(1+1e-15),e))))}}),ps=uo.time={},ms=Date;Ut.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(){gs.setUTCDate.apply(this._,arguments)},setDay:function(){gs.setUTCDay.apply(this._,arguments)},setFullYear:function(){gs.setUTCFullYear.apply(this._,arguments)},setHours:function(){gs.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){gs.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){gs.setUTCMinutes.apply(this._,arguments)},setMonth:function(){gs.setUTCMonth.apply(this._,arguments)},setSeconds:function(){gs.setUTCSeconds.apply(this._,arguments)},setTime:function(){gs.setTime.apply(this._,arguments)}};var gs=Date.prototype;ps.year=Vt(function(t){return t=ps.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),ps.years=ps.year.range,ps.years.utc=ps.year.utc.range,ps.day=Vt(function(t){var e=new ms(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}),ps.days=ps.day.range,ps.days.utc=ps.day.utc.range,ps.dayOfYear=function(t){var e=ps.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=ps[t]=Vt(function(t){return(t=ps.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=ps.year(t).getDay();return Math.floor((ps.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});ps[t+"s"]=r.range,ps[t+"s"].utc=r.utc.range,ps[t+"OfYear"]=function(t){var r=ps.year(t).getDay();return Math.floor((ps.dayOfYear(t)+(r+e)%7)/7)}}),ps.week=ps.sunday,ps.weeks=ps.sunday.range,ps.weeks.utc=ps.sunday.utc.range,ps.weekOfYear=ps.sundayOfYear;var vs={"-":"",_:" ",0:"0"},ys=/^\s*\d+/,xs=/^%/;uo.locale=function(t){return{numberFormat:Nt(t),timeFormat:Ht(t)}};var bs=uo.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"]});uo.format=bs.numberFormat,uo.geo={},he.prototype={s:0,t:0,add:function(t){fe(t,this.t,_s),fe(_s.s,this.s,this),this.s?this.t+=_s.t:this.s=_s.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var _s=new he;uo.geo.stream=function(t,e){t&&ws.hasOwnProperty(t.type)?ws[t.type](t,e):de(t,e)};var ws={Feature:function(t,e){de(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n<i;)de(r[n].geometry,e)}},Ms={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)t=r[n],e.point(t[0],t[1],t[2])},LineString:function(t,e){pe(t.coordinates,e,0)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)pe(r[n],e,0)},Polygon:function(t,e){me(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)me(r[n],e)},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,i=r.length;++n<i;)de(r[n],e)}};uo.geo.area=function(t){return As=0,uo.geo.stream(t,Ts),As};var As,ks=new he,Ts={sphere:function(){As+=4*No},point:M,lineStart:M,lineEnd:M,polygonStart:function(){ks.reset(),Ts.lineStart=ge},polygonEnd:function(){var t=2*ks;As+=t<0?4*No+t:t,Ts.lineStart=Ts.lineEnd=Ts.point=M}};uo.geo.bounds=function(){function t(t,e){x.push(b=[c=t,f=t]),e<h&&(h=e),e>d&&(d=e)}function e(e,r){var n=ve([e*qo,r*qo]);if(v){var i=xe(v,n),a=[i[1],-i[0],0],o=xe(a,i);we(o),o=Me(o);var l=e-p,u=l>0?1:-1,m=o[0]*Ho*u,g=bo(l)>180;if(g^(u*p<m&&m<u*e)){var y=o[1]*Ho;y>d&&(d=y)}else if(m=(m+360)%360-180,g^(u*p<m&&m<u*e)){var y=-o[1]*Ho;y<h&&(h=y)}else r<h&&(h=r),r>d&&(d=r);g?e<p?s(c,e)>s(c,f)&&(f=e):s(e,f)>s(c,f)&&(c=e):f>=c?(e<c&&(c=e),e>f&&(f=e)):e>p?s(c,e)>s(c,f)&&(f=e):s(e,f)>s(c,f)&&(c=e)}else t(e,r);v=n,p=e}function r(){_.point=e}function n(){b[0]=c,b[1]=f,_.point=t,v=null}function i(t,r){if(v){var n=t-p;y+=bo(n)>180?n+(n>0?360:-360):n}else m=t,g=r;Ts.point(t,r),e(t,r)}function a(){Ts.lineStart()}function o(){i(m,g),Ts.lineEnd(),bo(y)>Fo&&(c=-(f=180)),b[0]=c,b[1]=f,v=null}function s(t,e){return(e-=t)<0?e+360:e}function l(t,e){return t[0]-e[0]}function u(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}var c,h,f,d,p,m,g,v,y,x,b,_={point:t,lineStart:r,lineEnd:n,polygonStart:function(){_.point=i,_.lineStart=a,_.lineEnd=o,y=0,Ts.polygonStart()},polygonEnd:function(){Ts.polygonEnd(),_.point=t,_.lineStart=r,_.lineEnd=n,ks<0?(c=-(f=180),h=-(d=90)):y>Fo?d=90:y<-Fo&&(h=-90),b[0]=c,b[1]=f}};return function(t){d=f=-(c=h=1/0),x=[],uo.geo.stream(t,_);var e=x.length;if(e){x.sort(l);for(var r,n=1,i=x[0],a=[i];n<e;++n)r=x[n],u(r[0],i)||u(r[1],i)?(s(i[0],r[1])>s(i[0],i[1])&&(i[1]=r[1]),s(r[0],i[1])>s(i[0],i[1])&&(i[0]=r[0])):a.push(i=r);for(var o,r,p=-(1/0),e=a.length-1,n=0,i=a[e];n<=e;i=r,++n)r=a[n],(o=s(i[1],r[0]))>p&&(p=o,c=r[0],f=i[1])}return x=b=null,c===1/0||h===1/0?[[NaN,NaN],[NaN,NaN]]:[[c,h],[f,d]]}}(),uo.geo.centroid=function(t){Es=Ss=Ls=Cs=Is=zs=Ds=Ps=Os=Rs=Fs=0,uo.geo.stream(t,js);var e=Os,r=Rs,n=Fs,i=e*e+r*r+n*n;return i<jo&&(e=zs,r=Ds,n=Ps,Ss<Fo&&(e=Ls,r=Cs,n=Is),i=e*e+r*r+n*n,i<jo)?[NaN,NaN]:[Math.atan2(r,e)*Ho,nt(n/Math.sqrt(i))*Ho]};var Es,Ss,Ls,Cs,Is,zs,Ds,Ps,Os,Rs,Fs,js={sphere:M,point:ke,lineStart:Ee,lineEnd:Se,polygonStart:function(){js.lineStart=Le},polygonEnd:function(){js.lineStart=Ee}},Ns=Oe(Ie,Ne,Ue,[-No,-No/2]),Bs=1e9;uo.geo.clipExtent=function(){var t,e,r,n,i,a,o={stream:function(t){return i&&(i.valid=!1),i=a(t),i.valid=!0,i},extent:function(s){return arguments.length?(a=Ye(t=+s[0][0],e=+s[0][1],r=+s[1][0],n=+s[1][1]),i&&(i.valid=!1,i=null),o):[[t,e],[r,n]]}};return o.extent([[0,0],[960,500]])},(uo.geo.conicEqualArea=function(){return Ge(Xe)}).raw=Xe,uo.geo.albers=function(){return uo.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},uo.geo.albersUsa=function(){function t(t){var a=t[0],o=t[1];return e=null,r(a,o),e||(n(a,o),e)||i(a,o),e}var e,r,n,i,a=uo.geo.albers(),o=uo.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=uo.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,r){e=[t,r]}};return t.invert=function(t){var e=a.scale(),r=a.translate(),n=(t[0]-r[0])/e,i=(t[1]-r[1])/e;return(i>=.12&&i<.234&&n>=-.425&&n<-.214?o:i>=.166&&i<.234&&n>=-.214&&n<-.115?s:a).invert(t)},t.stream=function(t){var e=a.stream(t),r=o.stream(t),n=s.stream(t);return{point:function(t,i){e.point(t,i),r.point(t,i),n.point(t,i)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},t.precision=function(e){return arguments.length?(a.precision(e),o.precision(e),s.precision(e),t):a.precision()},t.scale=function(e){return arguments.length?(a.scale(e),o.scale(.35*e),s.scale(e),t.translate(a.translate())):a.scale()},t.translate=function(e){if(!arguments.length)return a.translate();var u=a.scale(),c=+e[0],h=+e[1];return r=a.translate(e).clipExtent([[c-.455*u,h-.238*u],[c+.455*u,h+.238*u]]).stream(l).point,n=o.translate([c-.307*u,h+.201*u]).clipExtent([[c-.425*u+Fo,h+.12*u+Fo],[c-.214*u-Fo,h+.234*u-Fo]]).stream(l).point,i=s.translate([c-.205*u,h+.212*u]).clipExtent([[c-.214*u+Fo,h+.166*u+Fo],[c-.115*u-Fo,h+.234*u-Fo]]).stream(l).point,t},t.scale(1070)};var Us,Vs,qs,Hs,Ys,Gs,Xs={point:M,lineStart:M,lineEnd:M,polygonStart:function(){Vs=0,Xs.lineStart=We},polygonEnd:function(){Xs.lineStart=Xs.lineEnd=Xs.point=M,Us+=bo(Vs/2)}},Ws={point:Ze,lineStart:M,lineEnd:M,polygonStart:M,polygonEnd:M},Zs={point:Qe,lineStart:$e,lineEnd:tr,polygonStart:function(){Zs.lineStart=er},polygonEnd:function(){Zs.point=Qe,Zs.lineStart=$e,Zs.lineEnd=tr}};uo.geo.path=function(){function t(t){return t&&("function"==typeof s&&a.pointRadius(+s.apply(this,arguments)),o&&o.valid||(o=i(a)),uo.geo.stream(t,o)),a.result()}function e(){return o=null,t}var r,n,i,a,o,s=4.5;return t.area=function(t){return Us=0,uo.geo.stream(t,i(Xs)),Us},t.centroid=function(t){return Ls=Cs=Is=zs=Ds=Ps=Os=Rs=Fs=0,uo.geo.stream(t,i(Zs)),Fs?[Os/Fs,Rs/Fs]:Ps?[zs/Ps,Ds/Ps]:Is?[Ls/Is,Cs/Is]:[NaN,NaN]},t.bounds=function(t){return Ys=Gs=-(qs=Hs=1/0),uo.geo.stream(t,i(Ws)),[[qs,Hs],[Ys,Gs]]},t.projection=function(t){return arguments.length?(i=(r=t)?t.stream||ir(t):b,e()):r},t.context=function(t){return arguments.length?(a=null==(n=t)?new Je:new rr(t),"function"!=typeof s&&a.pointRadius(s),e()):n},t.pointRadius=function(e){return arguments.length?(s="function"==typeof e?e:(a.pointRadius(+e),+e),t):s},t.projection(uo.geo.albersUsa()).context(null)},uo.geo.transform=function(t){return{stream:function(e){var r=new ar(e);for(var n in t)r[n]=t[n];return r}}},ar.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()}},uo.geo.projection=sr,uo.geo.projectionMutator=lr,(uo.geo.equirectangular=function(){return sr(cr)}).raw=cr.invert=cr,uo.geo.rotation=function(t){function e(e){return e=t(e[0]*qo,e[1]*qo),e[0]*=Ho,e[1]*=Ho,e}return t=fr(t[0]%360*qo,t[1]*qo,t.length>2?t[2]*qo:0),e.invert=function(e){return e=t.invert(e[0]*qo,e[1]*qo),e[0]*=Ho,e[1]*=Ho,e},e},hr.invert=cr,uo.geo.circle=function(){function t(){var t="function"==typeof n?n.apply(this,arguments):n,e=fr(-t[0]*qo,-t[1]*qo,0).invert,i=[];return r(null,null,1,{point:function(t,r){i.push(t=e(t,r)),t[0]*=Ho,t[1]*=Ho}}),{type:"Polygon",coordinates:[i]}}var e,r,n=[0,0],i=6;return t.origin=function(e){return arguments.length?(n=e,t):n},t.angle=function(n){return arguments.length?(r=gr((e=+n)*qo,i*qo),t):e},t.precision=function(n){return arguments.length?(r=gr(e*qo,(i=+n)*qo),t):i},t.angle(90)},uo.geo.distance=function(t,e){var r,n=(e[0]-t[0])*qo,i=t[1]*qo,a=e[1]*qo,o=Math.sin(n),s=Math.cos(n),l=Math.sin(i),u=Math.cos(i),c=Math.sin(a),h=Math.cos(a);return Math.atan2(Math.sqrt((r=h*o)*r+(r=u*c-l*h*s)*r),l*c+u*h*s)},uo.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return uo.range(Math.ceil(a/g)*g,i,g).map(f).concat(uo.range(Math.ceil(u/v)*v,l,v).map(d)).concat(uo.range(Math.ceil(n/p)*p,r,p).filter(function(t){return bo(t%g)>Fo}).map(c)).concat(uo.range(Math.ceil(s/m)*m,o,m).filter(function(t){return bo(t%v)>Fo}).map(h))}var r,n,i,a,o,s,l,u,c,h,f,d,p=10,m=p,g=90,v=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(l).slice(1),f(i).reverse().slice(1),d(u).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(a=+e[0][0],i=+e[1][0],u=+e[0][1],l=+e[1][1],a>i&&(e=a,a=i,i=e),u>l&&(e=u,u=l,l=e),t.precision(y)):[[a,u],[i,l]]},t.minorExtent=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],s=+e[0][1],o=+e[1][1],n>r&&(e=n,n=r,r=e),s>o&&(e=s,s=o,o=e),t.precision(y)):[[n,s],[r,o]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(g=+e[0],v=+e[1],t):[g,v]},t.minorStep=function(e){return arguments.length?(p=+e[0],m=+e[1],t):[p,m]},t.precision=function(e){return arguments.length?(y=+e,c=yr(s,o,90),h=xr(n,r,y),f=yr(u,l,90),d=xr(a,i,y),t):y},t.majorExtent([[-180,-90+Fo],[180,90-Fo]]).minorExtent([[-180,-80-Fo],[180,80+Fo]])},uo.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}var e,r,n=br,i=_r;return t.distance=function(){return uo.geo.distance(e||n.apply(this,arguments),r||i.apply(this,arguments))},t.source=function(r){return arguments.length?(n=r,e="function"==typeof r?null:r,t):n},t.target=function(e){return arguments.length?(i=e,r="function"==typeof e?null:e,t):i},t.precision=function(){return arguments.length?t:0},t},uo.geo.interpolate=function(t,e){return wr(t[0]*qo,t[1]*qo,e[0]*qo,e[1]*qo)},uo.geo.length=function(t){return Js=0,uo.geo.stream(t,Ks),Js};var Js,Ks={sphere:M,point:M,lineStart:Mr,lineEnd:M,polygonStart:M,polygonEnd:M},Qs=Ar(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(uo.geo.azimuthalEqualArea=function(){return sr(Qs)}).raw=Qs;var $s=Ar(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},b);(uo.geo.azimuthalEquidistant=function(){return sr($s)}).raw=$s,(uo.geo.conicConformal=function(){return Ge(kr)}).raw=kr,(uo.geo.conicEquidistant=function(){return Ge(Tr)}).raw=Tr;var tl=Ar(function(t){return 1/t},Math.atan);(uo.geo.gnomonic=function(){return sr(tl)}).raw=tl,Er.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Vo]},(uo.geo.mercator=function(){return Sr(Er)}).raw=Er;var el=Ar(function(){return 1},Math.asin);(uo.geo.orthographic=function(){return sr(el)}).raw=el;var rl=Ar(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(uo.geo.stereographic=function(){return sr(rl)}).raw=rl,Lr.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Vo]},(uo.geo.transverseMercator=function(){var t=Sr(Lr),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):(t=r(),[t[0],t[1],t[2]-90])},r([0,0,90])}).raw=Lr,uo.geom={},uo.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=St(r),a=St(n),o=t.length,s=[],l=[];for(e=0;e<o;e++)s.push([+i.call(this,t[e],e),+a.call(this,t[e],e),e]);for(s.sort(Dr),e=0;e<o;e++)l.push([s[e][0],-s[e][1]]);var u=zr(s),c=zr(l),h=c[0]===u[0],f=c[c.length-1]===u[u.length-1],d=[];for(e=u.length-1;e>=0;--e)d.push(t[s[u[e]][2]]);for(e=+h;e<c.length-f;++e)d.push(t[s[c[e]][2]]);return d}var r=Cr,n=Ir;return arguments.length?e(t):(e.x=function(t){return arguments.length?(r=t,e):r},e.y=function(t){return arguments.length?(n=t,e):n},e)},uo.geom.polygon=function(t){return ko(t,nl),t};var nl=uo.geom.polygon.prototype=[];nl.area=function(){for(var t,e=-1,r=this.length,n=this[r-1],i=0;++e<r;)t=n,n=this[e],i+=t[1]*n[0]-t[0]*n[1];return.5*i},nl.centroid=function(t){var e,r,n=-1,i=this.length,a=0,o=0,s=this[i-1];for(arguments.length||(t=-1/(6*this.area()));++n<i;)e=s,s=this[n],r=e[0]*s[1]-s[0]*e[1],a+=(e[0]+s[0])*r,o+=(e[1]+s[1])*r;return[a*t,o*t]},nl.clip=function(t){for(var e,r,n,i,a,o,s=Rr(t),l=-1,u=this.length-Rr(this),c=this[u-1];++l<u;){for(e=t.slice(),t.length=0,i=this[l],a=e[(n=e.length-s)-1],r=-1;++r<n;)o=e[r],Pr(o,c,i)?(Pr(a,c,i)||t.push(Or(a,o,c,i)),t.push(o)):Pr(a,c,i)&&t.push(Or(a,o,c,i)),a=o;s&&t.push(t[0]),c=i}return t};var il,al,ol,sl,ll,ul=[],cl=[];Hr.prototype.prepare=function(){for(var t,e=this.edges,r=e.length;r--;)t=e[r].edge,t.b&&t.a||e.splice(r,1);return e.sort(Gr),e.length},rn.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}},nn.prototype={insert:function(t,e){var r,n,i;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;r=t}else this._?(t=ln(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;)n=r.U,r===n.L?(i=n.R,i&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.R&&(on(this,r),t=r,r=t.U),r.C=!1,n.C=!0,sn(this,n))):(i=n.L,i&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.L&&(sn(this,r),t=r,r=t.U),r.C=!1,n.C=!0,on(this,n))),r=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,r,n,i=t.U,a=t.L,o=t.R;if(r=a?o?ln(o):a:o,i?i.L===t?i.L=r:i.R=r:this._=r,a&&o?(n=r.C,r.C=t.C,r.L=a,a.U=r,r!==o?(i=r.U,r.U=t.U,t=r.R,i.L=t,r.R=o,o.U=r):(r.U=i,i=r,t=r.R)):(n=t.C,t=r),t&&(t.U=i),!n){if(t&&t.C)return void(t.C=!1);do{if(t===this._)break;if(t===i.L){if(e=i.R,e.C&&(e.C=!1,i.C=!0,on(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,sn(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,on(this,i),t=this._;break}}else if(e=i.L,e.C&&(e.C=!1,i.C=!0,sn(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,on(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,sn(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}},uo.geom.voronoi=function(t){function e(t){var e=new Array(t.length),n=s[0][0],i=s[0][1],a=s[1][0],o=s[1][1];return un(r(t),s).cells.forEach(function(r,s){var l=r.edges,u=r.site,c=e[s]=l.length?l.map(function(t){var e=t.start();return[e.x,e.y]}):u.x>=n&&u.x<=a&&u.y>=i&&u.y<=o?[[n,o],[a,o],[a,i],[n,i]]:[];c.point=t[s]}),e}function r(t){return t.map(function(t,e){return{x:Math.round(a(t,e)/Fo)*Fo,y:Math.round(o(t,e)/Fo)*Fo,i:e}})}var n=Cr,i=Ir,a=n,o=i,s=hl;return t?e(t):(e.links=function(t){return un(r(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return un(r(t)).cells.forEach(function(r,n){for(var i,a,o=r.site,s=r.edges.sort(Gr),l=-1,u=s.length,c=s[u-1].edge,h=c.l===o?c.r:c.l;++l<u;)i=c,a=h,c=s[l].edge,h=c.l===o?c.r:c.l,n<a.i&&n<h.i&&hn(o,a,h)<0&&e.push([t[n],t[a.i],t[h.i]])}),e},e.x=function(t){return arguments.length?(a=St(n=t),e):n},e.y=function(t){return arguments.length?(o=St(i=t),e):i},e.clipExtent=function(t){return arguments.length?(s=null==t?hl:t,e):s===hl?null:s},e.size=function(t){return arguments.length?e.clipExtent(t&&[[0,0],t]):s===hl?null:s&&s[1]},e)};var hl=[[-1e6,-1e6],[1e6,1e6]];uo.geom.delaunay=function(t){return uo.geom.voronoi().triangles(t)},uo.geom.quadtree=function(t,e,r,n,i){function a(t){function a(t,e,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,c=t.y;if(null!=l)if(bo(l-r)+bo(c-n)<.01)u(t,e,r,n,i,a,o,s);else{var h=t.point;t.x=t.y=t.point=null,u(t,h,l,c,i,a,o,s),u(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else u(t,e,r,n,i,a,o,s)}function u(t,e,r,n,i,o,s,l){var u=.5*(i+s),c=.5*(o+l),h=r>=u,f=n>=c,d=f<<1|h;t.leaf=!1,t=t.nodes[d]||(t.nodes[d]=pn()),h?i=u:s=u,f?o=c:l=c,a(t,e,r,n,i,o,s,l)}var c,h,f,d,p,m,g,v,y,x=St(s),b=St(l);if(null!=e)m=e,g=r,v=n,y=i;else if(v=y=-(m=g=1/0),h=[],f=[],p=t.length,o)for(d=0;d<p;++d)c=t[d],c.x<m&&(m=c.x),c.y<g&&(g=c.y),c.x>v&&(v=c.x),c.y>y&&(y=c.y),h.push(c.x),f.push(c.y);else for(d=0;d<p;++d){var _=+x(c=t[d],d),w=+b(c,d);_<m&&(m=_),w<g&&(g=w),_>v&&(v=_),w>y&&(y=w),h.push(_),f.push(w)}var M=v-m,A=y-g;M>A?y=g+M:v=m+A;var k=pn();if(k.add=function(t){a(k,t,+x(t,++d),+b(t,d),m,g,v,y)},k.visit=function(t){mn(t,k,m,g,v,y)},k.find=function(t){return gn(k,t[0],t[1],m,g,v,y)},d=-1,null==e){for(;++d<p;)a(k,t[d],h[d],f[d],m,g,v,y);--d}else t.forEach(k.add);return h=f=t=c=null,k}var o,s=Cr,l=Ir;return(o=arguments.length)?(s=fn,l=dn,3===o&&(i=r,n=e,r=e=0),a(t)):(a.x=function(t){return arguments.length?(s=t,a):s},a.y=function(t){return arguments.length?(l=t,a):l},a.extent=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=+t[0][0],r=+t[0][1],n=+t[1][0],i=+t[1][1]),a):null==e?null:[[e,r],[n,i]]},a.size=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=r=0,n=+t[0],i=+t[1]),a):null==e?null:[n-e,i-r]},a)},uo.interpolateRgb=vn,uo.interpolateObject=yn,uo.interpolateNumber=xn,uo.interpolateString=bn;var fl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,dl=new RegExp(fl.source,"g");uo.interpolate=_n,uo.interpolators=[function(t,e){var r=typeof e;return("string"===r?as.has(e.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(e)?vn:bn:e instanceof lt?vn:Array.isArray(e)?wn:"object"===r&&isNaN(e)?yn:xn)(t,e)}],uo.interpolateArray=wn;var pl=function(){return b},ml=uo.map({linear:pl,poly:Ln,quad:function(){return Tn},cubic:function(){return En},sin:function(){return Cn},exp:function(){return In},circle:function(){return zn},elastic:Dn,back:Pn,bounce:function(){return On}}),gl=uo.map({in:b,out:An,"in-out":kn,"out-in":function(t){return kn(An(t))}});uo.ease=function(t){var e=t.indexOf("-"),r=e>=0?t.slice(0,e):t,n=e>=0?t.slice(e+1):"in";return r=ml.get(r)||pl,n=gl.get(n)||b,Mn(n(r.apply(null,co.call(arguments,1))))},uo.interpolateHcl=Rn,uo.interpolateHsl=Fn,uo.interpolateLab=jn,uo.interpolateRound=Nn,uo.transform=function(t){var e=fo.createElementNS(uo.ns.prefix.svg,"g");return(uo.transform=function(t){if(null!=t){e.setAttribute("transform",t);var r=e.transform.baseVal.consolidate()}return new Bn(r?r.matrix:vl)})(t)},Bn.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var vl={a:1,b:0,c:0,d:1,e:0,f:0};uo.interpolateTransform=Zn,uo.layout={},uo.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r<n;)e.push(Qn(t[r]));return e}},uo.layout.chord=function(){function t(){var t,u,h,f,d,p={},m=[],g=uo.range(a),v=[];for(r=[],n=[],t=0,f=-1;++f<a;){for(u=0,d=-1;++d<a;)u+=i[f][d];m.push(u),v.push(uo.range(a)),t+=u}for(o&&g.sort(function(t,e){return o(m[t],m[e])}),s&&v.forEach(function(t,e){t.sort(function(t,r){return s(i[e][t],i[e][r])})}),t=(Bo-c*a)/t,u=0,f=-1;++f<a;){for(h=u,d=-1;++d<a;){var y=g[f],x=v[y][d],b=i[y][x],_=u,w=u+=b*t;p[y+"-"+x]={index:y,subindex:x,startAngle:_,endAngle:w,value:b}}n[y]={index:y,startAngle:h,endAngle:u,value:m[y]},u+=c}for(f=-1;++f<a;)for(d=f-1;++d<a;){var M=p[f+"-"+d],A=p[d+"-"+f];(M.value||A.value)&&r.push(M.value<A.value?{source:A,target:M}:{source:M,target:A})}l&&e()}function e(){r.sort(function(t,e){return l((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}var r,n,i,a,o,s,l,u={},c=0;return u.matrix=function(t){return arguments.length?(a=(i=t)&&i.length,r=n=null,u):i},u.padding=function(t){return arguments.length?(c=t,r=n=null,u):c},u.sortGroups=function(t){return arguments.length?(o=t,r=n=null,u):o},u.sortSubgroups=function(t){return arguments.length?(s=t,r=null,u):s},u.sortChords=function(t){return arguments.length?(l=t,r&&e(),u):l},u.chords=function(){return r||t(),r},u.groups=function(){return n||t(),n},u},uo.layout.force=function(){function t(t){return function(e,r,n,i){if(e.point!==t){var a=e.cx-t.x,o=e.cy-t.y,s=i-r,l=a*a+o*o;if(s*s/v<l){if(l<m){var u=e.charge/l;t.px-=a*u,t.py-=o*u}return!0}if(e.point&&l&&l<m){var u=e.pointCharge/l;t.px-=a*u,t.py-=o*u}}return!e.charge}}function e(t){t.px=uo.event.x,t.py=uo.event.y,l.resume()}var r,n,i,a,o,s,l={},u=uo.dispatch("start","tick","end"),c=[1,1],h=.9,f=yl,d=xl,p=-30,m=bl,g=.1,v=.64,y=[],x=[];return l.tick=function(){if((i*=.99)<.005)return r=null,u.end({type:"end",alpha:i=0}),!0;var e,n,l,f,d,m,v,b,_,w=y.length,M=x.length;for(n=0;n<M;++n)l=x[n],f=l.source,d=l.target,b=d.x-f.x,_=d.y-f.y,(m=b*b+_*_)&&(m=i*o[n]*((m=Math.sqrt(m))-a[n])/m,b*=m,_*=m,d.x-=b*(v=f.weight+d.weight?f.weight/(f.weight+d.weight):.5),d.y-=_*v,f.x+=b*(v=1-v),f.y+=_*v);if((v=i*g)&&(b=c[0]/2,_=c[1]/2,n=-1,v))for(;++n<w;)l=y[n],l.x+=(b-l.x)*v,l.y+=(_-l.y)*v;if(p)for(ai(e=uo.geom.quadtree(y),i,s),n=-1;++n<w;)(l=y[n]).fixed||e.visit(t(l));for(n=-1;++n<w;)l=y[n],l.fixed?(l.x=l.px,l.y=l.py):(l.x-=(l.px-(l.px=l.x))*h,l.y-=(l.py-(l.py=l.y))*h);u.tick({type:"tick",alpha:i})},l.nodes=function(t){return arguments.length?(y=t,l):y},l.links=function(t){return arguments.length?(x=t,l):x},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?(h=+t,l):h},l.charge=function(t){return arguments.length?(p="function"==typeof t?t:+t,l):p},l.chargeDistance=function(t){return arguments.length?(m=t*t,l):Math.sqrt(m)},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,i?t>0?i=t:(r.c=null,r.t=NaN,r=null,u.end({type:"end",alpha:i=0})):t>0&&(u.start({type:"start",alpha:i=t}),r=Dt(l.tick)),l):i},l.start=function(){function t(t,n){if(!r){for(r=new Array(i),l=0;l<i;++l)r[l]=[];for(l=0;l<u;++l){var a=x[l];r[a.source.index].push(a.target),r[a.target.index].push(a.source)}}for(var o,s=r[e],l=-1,c=s.length;++l<c;)if(!isNaN(o=s[l][t]))return o;return Math.random()*n}var e,r,n,i=y.length,u=x.length,h=c[0],m=c[1];for(e=0;e<i;++e)(n=y[e]).index=e,n.weight=0;for(e=0;e<u;++e)n=x[e],"number"==typeof n.source&&(n.source=y[n.source]),"number"==typeof n.target&&(n.target=y[n.target]),++n.source.weight,++n.target.weight;for(e=0;e<i;++e)n=y[e],isNaN(n.x)&&(n.x=t("x",h)),isNaN(n.y)&&(n.y=t("y",m)),isNaN(n.px)&&(n.px=n.x),isNaN(n.py)&&(n.py=n.y);if(a=[],"function"==typeof f)for(e=0;e<u;++e)a[e]=+f.call(this,x[e],e);else for(e=0;e<u;++e)a[e]=f;if(o=[],"function"==typeof d)for(e=0;e<u;++e)o[e]=+d.call(this,x[e],e);else for(e=0;e<u;++e)o[e]=d;if(s=[],"function"==typeof p)for(e=0;e<i;++e)s[e]=+p.call(this,y[e],e);else for(e=0;e<i;++e)s[e]=p;return l.resume()},l.resume=function(){return l.alpha(.1)},l.stop=function(){return l.alpha(0)},l.drag=function(){return n||(n=uo.behavior.drag().origin(b).on("dragstart.force",ei).on("drag.force",e).on("dragend.force",ri)),arguments.length?void this.on("mouseover.force",ni).on("mouseout.force",ii).call(n):n},uo.rebind(l,u,"on")};var yl=20,xl=1,bl=1/0;uo.layout.hierarchy=function(){function t(i){var a,o=[i],s=[];for(i.depth=0;null!=(a=o.pop());)if(s.push(a),(u=r.call(t,a,a.depth))&&(l=u.length)){for(var l,u,c;--l>=0;)o.push(c=u[l]),c.parent=a,c.depth=a.depth+1;n&&(a.value=0),a.children=u}else n&&(a.value=+n.call(t,a,a.depth)||0),delete a.children;return li(i,function(t){var r,i;e&&(r=t.children)&&r.sort(e),n&&(i=t.parent)&&(i.value+=t.value)}),s}var e=hi,r=ui,n=ci;return t.sort=function(r){return arguments.length?(e=r,t):e},t.children=function(e){return arguments.length?(r=e,t):r},t.value=function(e){return arguments.length?(n=e,t):n},t.revalue=function(e){return n&&(si(e,function(t){t.children&&(t.value=0)}),li(e,function(e){var r;e.children||(e.value=+n.call(t,e,e.depth)||0),(r=e.parent)&&(r.value+=e.value)})),e},t},uo.layout.partition=function(){function t(e,r,n,i){var a=e.children;if(e.x=r,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(o=a.length)){var o,s,l,u=-1;for(n=e.value?n/e.value:0;++u<o;)t(s=a[u],r,l=s.value*n,i),r+=l}}function e(t){var r=t.children,n=0;if(r&&(i=r.length))for(var i,a=-1;++a<i;)n=Math.max(n,e(r[a]));return 1+n}function r(r,a){var o=n.call(this,r,a);return t(o[0],0,i[0],i[1]/e(o[0])),o}var n=uo.layout.hierarchy(),i=[1,1];return r.size=function(t){return arguments.length?(i=t,r):i},oi(r,n)},uo.layout.pie=function(){function t(o){var s,l=o.length,u=o.map(function(r,n){return+e.call(t,r,n)}),c=+("function"==typeof n?n.apply(this,arguments):n),h=("function"==typeof i?i.apply(this,arguments):i)-c,f=Math.min(Math.abs(h)/l,+("function"==typeof a?a.apply(this,arguments):a)),d=f*(h<0?-1:1),p=uo.sum(u),m=p?(h-l*d)/p:0,g=uo.range(l),v=[];return null!=r&&g.sort(r===_l?function(t,e){return u[e]-u[t]}:function(t,e){return r(o[t],o[e])}),g.forEach(function(t){v[t]={data:o[t],value:s=u[t],startAngle:c,endAngle:c+=s*m+d,padAngle:f}}),v}var e=Number,r=_l,n=0,i=Bo,a=0;return t.value=function(r){return arguments.length?(e=r,t):e},t.sort=function(e){return arguments.length?(r=e,t):r},t.startAngle=function(e){return arguments.length?(n=e,t):n},t.endAngle=function(e){return arguments.length?(i=e,t):i},t.padAngle=function(e){return arguments.length?(a=e,t):a},t};var _l={};uo.layout.stack=function(){function t(s,l){if(!(f=s.length))return s;var u=s.map(function(r,n){return e.call(t,r,n)}),c=u.map(function(e){return e.map(function(e,r){return[a.call(t,e,r),o.call(t,e,r)]})}),h=r.call(t,c,l);u=uo.permute(u,h),c=uo.permute(c,h);var f,d,p,m,g=n.call(t,c,l),v=u[0].length;for(p=0;p<v;++p)for(i.call(t,u[0][p],m=g[p],c[0][p][1]),d=1;d<f;++d)i.call(t,u[d][p],m+=c[d-1][p][1],c[d][p][1]);return s}var e=b,r=gi,n=vi,i=mi,a=di,o=pi;return t.values=function(r){return arguments.length?(e=r,t):e},t.order=function(e){return arguments.length?(r="function"==typeof e?e:wl.get(e)||gi,t):r},t.offset=function(e){return arguments.length?(n="function"==typeof e?e:Ml.get(e)||vi,t):n},t.x=function(e){return arguments.length?(a=e,t):a},t.y=function(e){return arguments.length?(o=e,t):o},t.out=function(e){return arguments.length?(i=e,t):i},t};var wl=uo.map({"inside-out":function(t){var e,r,n=t.length,i=t.map(yi),a=t.map(xi),o=uo.range(n).sort(function(t,e){return i[t]-i[e]}),s=0,l=0,u=[],c=[];for(e=0;e<n;++e)r=o[e],s<l?(s+=a[r],u.push(r)):(l+=a[r],c.push(r));return c.reverse().concat(u)},reverse:function(t){return uo.range(t.length).reverse()},default:gi}),Ml=uo.map({silhouette:function(t){var e,r,n,i=t.length,a=t[0].length,o=[],s=0,l=[];for(r=0;r<a;++r){for(e=0,n=0;e<i;e++)n+=t[e][r][1];n>s&&(s=n),o.push(n)}for(r=0;r<a;++r)l[r]=(s-o[r])/2;return l},wiggle:function(t){var e,r,n,i,a,o,s,l,u,c=t.length,h=t[0],f=h.length,d=[];for(d[0]=l=u=0,r=1;r<f;++r){for(e=0,i=0;e<c;++e)i+=t[e][r][1];for(e=0,a=0,s=h[r][0]-h[r-1][0];e<c;++e){for(n=0,o=(t[e][r][1]-t[e][r-1][1])/(2*s);n<e;++n)o+=(t[n][r][1]-t[n][r-1][1])/s;a+=o*t[e][r][1]}d[r]=l-=i?a/i*s:0,l<u&&(u=l)}for(r=0;r<f;++r)d[r]-=u;return d},expand:function(t){var e,r,n,i=t.length,a=t[0].length,o=1/i,s=[];for(r=0;r<a;++r){for(e=0,n=0;e<i;e++)n+=t[e][r][1];if(n)for(e=0;e<i;e++)t[e][r][1]/=n;else for(e=0;e<i;e++)t[e][r][1]=o}for(r=0;r<a;++r)s[r]=0;return s},zero:vi});uo.layout.histogram=function(){function t(t,a){for(var o,s,l=[],u=t.map(r,this),c=n.call(this,u,a),h=i.call(this,c,u,a),a=-1,f=u.length,d=h.length-1,p=e?1:1/f;++a<d;)o=l[a]=[],o.dx=h[a+1]-(o.x=h[a]),o.y=0;if(d>0)for(a=-1;++a<f;)s=u[a],s>=c[0]&&s<=c[1]&&(o=l[uo.bisect(h,s,1,d)-1],o.y+=p,o.push(t[a]));return l}var e=!0,r=Number,n=Mi,i=_i;return t.value=function(e){return arguments.length?(r=e,t):r},t.range=function(e){return arguments.length?(n=St(e),t):n},t.bins=function(e){return arguments.length?(i="number"==typeof e?function(t){return wi(t,e)}:St(e),t):i},t.frequency=function(r){return arguments.length?(e=!!r,t):e},t},uo.layout.pack=function(){function t(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],u=i[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,li(s,function(t){t.r=+c(t.value)}),li(s,Si),n){var h=n*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;li(s,function(t){t.r+=h}),li(s,Si),li(s,function(t){t.r-=h})}return Ii(s,l/2,u/2,e?1:1/Math.max(2*s.r/l,2*s.r/u)),o}var e,r=uo.layout.hierarchy().sort(Ai),n=0,i=[1,1];return t.size=function(e){return arguments.length?(i=e,t):i},t.radius=function(r){return arguments.length?(e=null==r||"function"==typeof r?r:+r,t):e},t.padding=function(e){return arguments.length?(n=+e,t):n},oi(t,r)},uo.layout.tree=function(){function t(t,i){var c=o.call(this,t,i),h=c[0],f=e(h);if(li(f,r),f.parent.m=-f.z,si(f,n),u)si(h,a);else{var d=h,p=h,m=h;si(h,function(t){t.x<d.x&&(d=t),t.x>p.x&&(p=t),t.depth>m.depth&&(m=t)});var g=s(d,p)/2-d.x,v=l[0]/(p.x+s(p,d)/2+g),y=l[1]/(m.depth||1);si(h,function(t){t.x=(t.x+g)*v,t.y=t.depth*y})}return c}function e(t){for(var e,r={A:null,children:[t]},n=[r];null!=(e=n.pop());)for(var i,a=e.children,o=0,s=a.length;o<s;++o)n.push((a[o]=i={_:a[o],parent:e,children:(i=a[o].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=i);return r.children[0]}function r(t){var e=t.children,r=t.parent.children,n=t.i?r[t.i-1]:null;if(e.length){Fi(t);var a=(e[0].z+e[e.length-1].z)/2;n?(t.z=n.z+s(t._,n._),t.m=t.z-a):t.z=a}else n&&(t.z=n.z+s(t._,n._));t.parent.A=i(t,n,t.parent.A||r[0])}function n(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function i(t,e,r){if(e){for(var n,i=t,a=t,o=e,l=i.parent.children[0],u=i.m,c=a.m,h=o.m,f=l.m;o=Oi(o),i=Pi(i),o&&i;)l=Pi(l),a=Oi(a),a.a=t,n=o.z+h-i.z-u+s(o._,i._),n>0&&(Ri(ji(o,t,r),t,n),u+=n,c+=n),h+=o.m,u+=i.m,f+=l.m,c+=a.m;o&&!Oi(a)&&(a.t=o,a.m+=h-c),i&&!Pi(l)&&(l.t=i,l.m+=u-f,r=t)}return r}function a(t){t.x*=l[0],t.y=t.depth*l[1]}var o=uo.layout.hierarchy().sort(null).value(null),s=Di,l=[1,1],u=null;return t.separation=function(e){return arguments.length?(s=e,t):s},t.size=function(e){return arguments.length?(u=null==(l=e)?a:null,t):u?null:l},t.nodeSize=function(e){return arguments.length?(u=null==(l=e)?null:a,t):u?l:null},oi(t,o)},uo.layout.cluster=function(){function t(t,a){var o,s=e.call(this,t,a),l=s[0],u=0;li(l,function(t){var e=t.children;e&&e.length?(t.x=Bi(e),t.y=Ni(e)):(t.x=o?u+=r(t,o):0,t.y=0,o=t)});var c=Ui(l),h=Vi(l),f=c.x-r(c,h)/2,d=h.x+r(h,c)/2;return li(l,i?function(t){t.x=(t.x-l.x)*n[0],t.y=(l.y-t.y)*n[1]}:function(t){t.x=(t.x-f)/(d-f)*n[0],t.y=(1-(l.y?t.y/l.y:1))*n[1]}),s}var e=uo.layout.hierarchy().sort(null).value(null),r=Di,n=[1,1],i=!1;return t.separation=function(e){return arguments.length?(r=e,t):r},t.size=function(e){return arguments.length?(i=null==(n=e),t):i?null:n},t.nodeSize=function(e){return arguments.length?(i=null!=(n=e),t):i?n:null},oi(t,e)},uo.layout.treemap=function(){function t(t,e){for(var r,n,i=-1,a=t.length;++i<a;)n=(r=t[i]).value*(e<0?0:e),r.area=isNaN(n)||n<=0?0:n}function e(r){var a=r.children;if(a&&a.length){var o,s,l,u=h(r),c=[],f=a.slice(),p=1/0,m="slice"===d?u.dx:"dice"===d?u.dy:"slice-dice"===d?1&r.depth?u.dy:u.dx:Math.min(u.dx,u.dy);for(t(f,u.dx*u.dy/r.value),c.area=0;(l=f.length)>0;)c.push(o=f[l-1]),c.area+=o.area,"squarify"!==d||(s=n(c,m))<=p?(f.pop(),p=s):(c.area-=c.pop().area,i(c,m,u,!1),m=Math.min(u.dx,u.dy),c.length=c.area=0,p=1/0);c.length&&(i(c,m,u,!0),c.length=c.area=0),a.forEach(e)}}function r(e){var n=e.children;if(n&&n.length){var a,o=h(e),s=n.slice(),l=[];for(t(s,o.dx*o.dy/e.value),l.area=0;a=s.pop();)l.push(a),l.area+=a.area,null!=a.z&&(i(l,a.z?o.dx:o.dy,o,!s.length),l.length=l.area=0);n.forEach(r)}}function n(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++o<s;)(r=t[o].area)&&(r<a&&(a=r),r>i&&(i=r));return n*=n,e*=e,n?Math.max(e*i*p/n,n/(e*a*p)):1/0}function i(t,e,r,n){var i,a=-1,o=t.length,s=r.x,u=r.y,c=e?l(t.area/e):0;if(e==r.dx){for((n||c>r.dy)&&(c=r.dy);++a<o;)i=t[a],i.x=s,i.y=u,i.dy=c,s+=i.dx=Math.min(r.x+r.dx-s,c?l(i.area/c):0);i.z=!0,i.dx+=r.x+r.dx-s,r.y+=c,r.dy-=c}else{for((n||c>r.dx)&&(c=r.dx);++a<o;)i=t[a],i.x=s,i.y=u,i.dx=c,u+=i.dy=Math.min(r.y+r.dy-u,c?l(i.area/c):0);i.z=!1,i.dy+=r.y+r.dy-u,r.x+=c,r.dx-=c}}function a(n){var i=o||s(n),a=i[0];return a.x=a.y=0,a.value?(a.dx=u[0],a.dy=u[1]):a.dx=a.dy=0,o&&s.revalue(a),t([a],a.dx*a.dy/a.value),(o?r:e)(a),f&&(o=i),i}var o,s=uo.layout.hierarchy(),l=Math.round,u=[1,1],c=null,h=qi,f=!1,d="squarify",p=.5*(1+Math.sqrt(5));return a.size=function(t){return arguments.length?(u=t,a):u},a.padding=function(t){function e(e){var r=t.call(a,e,e.depth);return null==r?qi(e):Hi(e,"number"==typeof r?[r,r,r,r]:r)}function r(e){return Hi(e,t)}if(!arguments.length)return c;var n;return h=null==(c=t)?qi:"function"==(n=typeof t)?e:"number"===n?(t=[t,t,t,t],r):r,a},a.round=function(t){return arguments.length?(l=t?Math.round:Number,a):l!=Number},a.sticky=function(t){return arguments.length?(f=t,o=null,a):f},a.ratio=function(t){return arguments.length?(p=t,a):p},a.mode=function(t){return arguments.length?(d=t+"",a):d},oi(a,s)},uo.random={normal:function(t,e){var r=arguments.length;return r<2&&(e=1),r<1&&(t=0),function(){var r,n,i;do{r=2*Math.random()-1,n=2*Math.random()-1,i=r*r+n*n}while(!i||i>1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=uo.random.normal.apply(uo,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=uo.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,r=0;r<t;r++)e+=Math.random();return e}}},uo.scale={};var Al={floor:b,ceil:b};uo.scale.linear=function(){return Ki([0,1],[0,1],_n,!1)};var kl={s:1,g:1,p:1,r:1,e:1};uo.scale.log=function(){return aa(uo.scale.linear().domain([0,1]),10,!0,[1,10])};var Tl=uo.format(".0e"),El={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};uo.scale.pow=function(){return oa(uo.scale.linear(),1,[0,1])},uo.scale.sqrt=function(){return uo.scale.pow().exponent(.5)},uo.scale.ordinal=function(){return la([],{t:"range",a:[[]]})},uo.scale.category10=function(){return uo.scale.ordinal().range(Sl)},uo.scale.category20=function(){return uo.scale.ordinal().range(Ll)},uo.scale.category20b=function(){return uo.scale.ordinal().range(Cl)},uo.scale.category20c=function(){return uo.scale.ordinal().range(Il)};var Sl=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(_t),Ll=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(_t),Cl=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(_t),Il=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(_t);uo.scale.quantile=function(){return ua([],[])},uo.scale.quantize=function(){return ca(0,1,[0,1])},uo.scale.threshold=function(){return ha([.5],[0,1])},uo.scale.identity=function(){return fa([0,1])},uo.svg={},uo.svg.arc=function(){function t(){var t=Math.max(0,+r.apply(this,arguments)),u=Math.max(0,+n.apply(this,arguments)),c=o.apply(this,arguments)-Vo,h=s.apply(this,arguments)-Vo,f=Math.abs(h-c),d=c>h?0:1;if(u<t&&(p=u,u=t,t=p),f>=Uo)return e(u,d)+(t?e(t,1-d):"")+"Z";var p,m,g,v,y,x,b,_,w,M,A,k,T=0,E=0,S=[];if((v=(+l.apply(this,arguments)||0)/2)&&(g=a===zl?Math.sqrt(t*t+u*u):+a.apply(this,arguments),d||(E*=-1),u&&(E=nt(g/u*Math.sin(v))),t&&(T=nt(g/t*Math.sin(v)))),u){y=u*Math.cos(c+E),x=u*Math.sin(c+E),b=u*Math.cos(h-E),_=u*Math.sin(h-E);var L=Math.abs(h-c-2*E)<=No?0:1;if(E&&xa(y,x,b,_)===d^L){var C=(c+h)/2;y=u*Math.cos(C),x=u*Math.sin(C),b=_=null}}else y=x=0;if(t){w=t*Math.cos(h-T),M=t*Math.sin(h-T),A=t*Math.cos(c+T),k=t*Math.sin(c+T);var I=Math.abs(c-h+2*T)<=No?0:1;if(T&&xa(w,M,A,k)===1-d^I){var z=(c+h)/2;w=t*Math.cos(z),M=t*Math.sin(z),A=k=null}}else w=M=0;if(f>Fo&&(p=Math.min(Math.abs(u-t)/2,+i.apply(this,arguments)))>.001){m=t<u^d?0:1;var D=p,P=p;if(f<No){var O=null==A?[w,M]:null==b?[y,x]:Or([y,x],[A,k],[b,_],[w,M]),R=y-O[0],F=x-O[1],j=b-O[0],N=_-O[1],B=1/Math.sin(Math.acos((R*j+F*N)/(Math.sqrt(R*R+F*F)*Math.sqrt(j*j+N*N)))/2),U=Math.sqrt(O[0]*O[0]+O[1]*O[1]);P=Math.min(p,(t-U)/(B-1)),D=Math.min(p,(u-U)/(B+1))}if(null!=b){var V=ba(null==A?[w,M]:[A,k],[y,x],u,D,d),q=ba([b,_],[w,M],u,D,d);p===D?S.push("M",V[0],"A",D,",",D," 0 0,",m," ",V[1],"A",u,",",u," 0 ",1-d^xa(V[1][0],V[1][1],q[1][0],q[1][1]),",",d," ",q[1],"A",D,",",D," 0 0,",m," ",q[0]):S.push("M",V[0],"A",D,",",D," 0 1,",m," ",q[0])}else S.push("M",y,",",x);if(null!=A){var H=ba([y,x],[A,k],t,-P,d),Y=ba([w,M],null==b?[y,x]:[b,_],t,-P,d);p===P?S.push("L",Y[0],"A",P,",",P," 0 0,",m," ",Y[1],"A",t,",",t," 0 ",d^xa(Y[1][0],Y[1][1],H[1][0],H[1][1]),",",1-d," ",H[1],"A",P,",",P," 0 0,",m," ",H[0]):S.push("L",Y[0],"A",P,",",P," 0 0,",m," ",H[0])}else S.push("L",w,",",M)}else S.push("M",y,",",x),null!=b&&S.push("A",u,",",u," 0 ",L,",",d," ",b,",",_),S.push("L",w,",",M),null!=A&&S.push("A",t,",",t," 0 ",I,",",1-d," ",A,",",k);return S.push("Z"),S.join("")}function e(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}var r=pa,n=ma,i=da,a=zl,o=ga,s=va,l=ya;return t.innerRadius=function(e){return arguments.length?(r=St(e),t):r},t.outerRadius=function(e){return arguments.length?(n=St(e),t):n},t.cornerRadius=function(e){return arguments.length?(i=St(e),t):i},t.padRadius=function(e){return arguments.length?(a=e==zl?zl:St(e),t):a},t.startAngle=function(e){return arguments.length?(o=St(e),t):o},t.endAngle=function(e){return arguments.length?(s=St(e),t):s},t.padAngle=function(e){return arguments.length?(l=St(e),t):l},t.centroid=function(){var t=(+r.apply(this,arguments)+ +n.apply(this,arguments))/2,e=(+o.apply(this,arguments)+ +s.apply(this,arguments))/2-Vo;return[Math.cos(e)*t,Math.sin(e)*t]},t};var zl="auto";uo.svg.line=function(){return _a(b)};var Dl=uo.map({linear:wa,"linear-closed":Ma,step:Aa,"step-before":ka,"step-after":Ta,basis:za,"basis-open":Da,"basis-closed":Pa,bundle:Oa,cardinal:La,"cardinal-open":Ea,"cardinal-closed":Sa,monotone:Ua});Dl.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Pl=[0,2/3,1/3,0],Ol=[0,1/3,2/3,0],Rl=[0,1/6,2/3,1/6];uo.svg.line.radial=function(){var t=_a(Va);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},ka.reverse=Ta,Ta.reverse=ka,uo.svg.area=function(){return qa(b)},uo.svg.area.radial=function(){var t=qa(Va);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},uo.svg.chord=function(){function t(t,s){var l=e(this,a,t,s),u=e(this,o,t,s);return"M"+l.p0+n(l.r,l.p1,l.a1-l.a0)+(r(l,u)?i(l.r,l.p1,l.r,l.p0):i(l.r,l.p1,u.r,u.p0)+n(u.r,u.p1,u.a1-u.a0)+i(u.r,u.p1,l.r,l.p0))+"Z"}function e(t,e,r,n){var i=e.call(t,r,n),a=s.call(t,i,n),o=l.call(t,i,n)-Vo,c=u.call(t,i,n)-Vo;return{r:a,a0:o,a1:c,p0:[a*Math.cos(o),a*Math.sin(o)],p1:[a*Math.cos(c),a*Math.sin(c)]}}function r(t,e){return t.a0==e.a0&&t.a1==e.a1}function n(t,e,r){return"A"+t+","+t+" 0 "+ +(r>No)+",1 "+e}function i(t,e,r,n){return"Q 0,0 "+n}var a=br,o=_r,s=Ha,l=ga,u=va;return t.radius=function(e){return arguments.length?(s=St(e),t):s},t.source=function(e){return arguments.length?(a=St(e),t):a},t.target=function(e){return arguments.length?(o=St(e),t):o},t.startAngle=function(e){return arguments.length?(l=St(e),t):l},t.endAngle=function(e){return arguments.length?(u=St(e),t):u},t},uo.svg.diagonal=function(){function t(t,i){var a=e.call(this,t,i),o=r.call(this,t,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return l=l.map(n),"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var e=br,r=_r,n=Ya;return t.source=function(r){return arguments.length?(e=St(r),t):e},t.target=function(e){return arguments.length?(r=St(e),t):r},t.projection=function(e){return arguments.length?(n=e,t):n},t},uo.svg.diagonal.radial=function(){var t=uo.svg.diagonal(),e=Ya,r=t.projection;return t.projection=function(t){return arguments.length?r(Ga(e=t)):e},t},uo.svg.symbol=function(){function t(t,n){return(Fl.get(e.call(this,t,n))||Za)(r.call(this,t,n))}var e=Wa,r=Xa;return t.type=function(r){return arguments.length?(e=St(r),t):e},t.size=function(e){return arguments.length?(r=St(e),t):r},t};var Fl=uo.map({circle:Za,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*Nl)),r=e*Nl;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/jl),r=e*jl/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/jl),r=e*jl/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});uo.svg.symbolTypes=Fl.keys();var jl=Math.sqrt(3),Nl=Math.tan(30*qo);Lo.transition=function(t){for(var e,r,n=Bl||++Hl,i=to(t),a=[],o=Ul||{time:Date.now(),ease:Sn,delay:0,duration:250},s=-1,l=this.length;++s<l;){a.push(e=[]);for(var u=this[s],c=-1,h=u.length;++c<h;)(r=u[c])&&eo(r,c,i,n,o),e.push(r)}return Ka(a,i,n)},Lo.interrupt=function(t){return this.each(null==t?Vl:Ja(to(t)))};var Bl,Ul,Vl=Ja(to()),ql=[],Hl=0;ql.call=Lo.call,ql.empty=Lo.empty,ql.node=Lo.node,ql.size=Lo.size,uo.transition=function(t,e){return t&&t.transition?Bl?t.transition(e):t:uo.selection().transition(t)},uo.transition.prototype=ql,ql.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=C(t);for(var s=-1,l=this.length;++s<l;){o.push(e=[]);for(var u=this[s],c=-1,h=u.length;++c<h;)(n=u[c])&&(r=t.call(n,n.__data__,c,s))?("__data__"in n&&(r.__data__=n.__data__),eo(r,c,a,i,n[a][i]),e.push(r)):e.push(null)}return Ka(o,a,i)},ql.selectAll=function(t){var e,r,n,i,a,o=this.id,s=this.namespace,l=[];t=I(t);for(var u=-1,c=this.length;++u<c;)for(var h=this[u],f=-1,d=h.length;++f<d;)if(n=h[f]){a=n[s][o],r=t.call(n,n.__data__,f,u),l.push(e=[]);for(var p=-1,m=r.length;++p<m;)(i=r[p])&&eo(i,p,s,o,a),e.push(i)}return Ka(l,s,o)},ql.filter=function(t){var e,r,n,i=[];"function"!=typeof t&&(t=q(t));for(var a=0,o=this.length;a<o;a++){i.push(e=[]);for(var r=this[a],s=0,l=r.length;s<l;s++)(n=r[s])&&t.call(n,n.__data__,s,a)&&e.push(n)}return Ka(i,this.namespace,this.id)},ql.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):Y(this,null==e?function(e){e[n][r].tween.remove(t)}:function(i){i[n][r].tween.set(t,e)})},ql.attr=function(t,e){function r(){this.removeAttribute(s)}function n(){this.removeAttributeNS(s.space,s.local)}function i(t){return null==t?r:(t+="",function(){var e,r=this.getAttribute(s);return r!==t&&(e=o(r,t),function(t){this.setAttribute(s,e(t))})})}function a(t){return null==t?n:(t+="",function(){var e,r=this.getAttributeNS(s.space,s.local);return r!==t&&(e=o(r,t),function(t){this.setAttributeNS(s.space,s.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var o="transform"==t?Zn:_n,s=uo.ns.qualify(t);return Qa(this,"attr."+t,e,s.local?a:i)},ql.attrTween=function(t,e){function r(t,r){var n=e.call(this,t,r,this.getAttribute(i));return n&&function(t){this.setAttribute(i,n(t))}}function n(t,r){var n=e.call(this,t,r,this.getAttributeNS(i.space,i.local));return n&&function(t){this.setAttributeNS(i.space,i.local,n(t))}}var i=uo.ns.qualify(t);return this.tween("attr."+t,i.local?n:r)},ql.style=function(t,e,r){function i(){this.style.removeProperty(t)}function a(e){return null==e?i:(e+="",function(){var i,a=n(this).getComputedStyle(this,null).getPropertyValue(t);return a!==e&&(i=_n(a,e),function(e){this.style.setProperty(t,i(e),r)})})}var o=arguments.length;if(o<3){if("string"!=typeof t){o<2&&(e="");for(r in t)this.style(r,t[r],e);return this}r=""}return Qa(this,"style."+t,e,a)},ql.styleTween=function(t,e,r){function i(i,a){var o=e.call(this,i,a,n(this).getComputedStyle(this,null).getPropertyValue(t));return o&&function(e){this.style.setProperty(t,o(e),r)}}return arguments.length<3&&(r=""),this.tween("style."+t,i)},ql.text=function(t){return Qa(this,"text",t,$a)},ql.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},ql.ease=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].ease:("function"!=typeof t&&(t=uo.ease.apply(uo,arguments)),Y(this,function(n){n[r][e].ease=t}))},ql.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:Y(this,"function"==typeof t?function(n,i,a){n[r][e].delay=+t.call(n,n.__data__,i,a)}:(t=+t,function(n){n[r][e].delay=t}))},ql.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:Y(this,"function"==typeof t?function(n,i,a){n[r][e].duration=Math.max(1,t.call(n,n.__data__,i,a))}:(t=Math.max(1,t),function(n){n[r][e].duration=t}))},ql.each=function(t,e){var r=this.id,n=this.namespace;if(arguments.length<2){var i=Ul,a=Bl;try{Bl=r,Y(this,function(e,i,a){Ul=e[n][r],t.call(e,e.__data__,i,a)})}finally{Ul=i,Bl=a}}else Y(this,function(i){var a=i[n][r];(a.event||(a.event=uo.dispatch("start","end","interrupt"))).on(t,e)});return this},ql.transition=function(){for(var t,e,r,n,i=this.id,a=++Hl,o=this.namespace,s=[],l=0,u=this.length;l<u;l++){s.push(t=[]);for(var e=this[l],c=0,h=e.length;c<h;c++)(r=e[c])&&(n=r[o][i],eo(r,c,o,a,{time:n.time,ease:n.ease,delay:n.delay+n.duration,duration:n.duration})),t.push(r)}return Ka(s,o,a)},uo.svg.axis=function(){function t(t){t.each(function(){var t,u=uo.select(this),c=this.__chart__||r,h=this.__chart__=r.copy(),f=null==l?h.ticks?h.ticks.apply(h,s):h.domain():l,d=null==e?h.tickFormat?h.tickFormat.apply(h,s):b:e,p=u.selectAll(".tick").data(f,h),m=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Fo),g=uo.transition(p.exit()).style("opacity",Fo).remove(),v=uo.transition(p.order()).style("opacity",1),y=Math.max(i,0)+o,x=Gi(h),_=u.selectAll(".domain").data([0]),w=(_.enter().append("path").attr("class","domain"),uo.transition(_));m.append("line"),m.append("text");var M,A,k,T,E=m.select("line"),S=v.select("line"),L=p.select("text").text(d),C=m.select("text"),I=v.select("text"),z="top"===n||"left"===n?-1:1;if("bottom"===n||"top"===n?(t=ro,M="x",k="y",A="x2",T="y2",L.attr("dy",z<0?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+x[0]+","+z*a+"V0H"+x[1]+"V"+z*a)):(t=no,M="y",k="x",A="y2",T="x2",L.attr("dy",".32em").style("text-anchor",z<0?"end":"start"),w.attr("d","M"+z*a+","+x[0]+"H0V"+x[1]+"H"+z*a)),E.attr(T,z*i),C.attr(k,z*y),S.attr(A,0).attr(T,z*i),I.attr(M,0).attr(k,z*y),h.rangeBand){var D=h,P=D.rangeBand()/2;c=h=function(t){return D(t)+P}}else c.rangeBand?c=h:g.call(t,h,c);m.call(t,c,h),v.call(t,h,h)})}var e,r=uo.scale.linear(),n=Yl,i=6,a=6,o=3,s=[10],l=null;return t.scale=function(e){return arguments.length?(r=e,t):r},t.orient=function(e){return arguments.length?(n=e in Gl?e+"":Yl,t):n},t.ticks=function(){return arguments.length?(s=ho(arguments),t):s},t.tickValues=function(e){return arguments.length?(l=e,t):l},t.tickFormat=function(r){return arguments.length?(e=r,t):e},t.tickSize=function(e){var r=arguments.length;return r?(i=+e,a=+arguments[r-1],t):i},t.innerTickSize=function(e){return arguments.length?(i=+e,t):i},t.outerTickSize=function(e){return arguments.length?(a=+e,t):a},t.tickPadding=function(e){return arguments.length?(o=+e,t):o},t.tickSubdivide=function(){return arguments.length&&t},t};var Yl="bottom",Gl={top:1,right:1,bottom:1,left:1};uo.svg.brush=function(){function t(n){n.each(function(){var n=uo.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",a).on("touchstart.brush",a),o=n.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),n.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var s=n.selectAll(".resize").data(m,b);s.exit().remove(),s.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Xl[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"),s.style("display",t.empty()?"none":null);var l,h=uo.transition(n),f=uo.transition(o);u&&(l=Gi(u),f.attr("x",l[0]).attr("width",l[1]-l[0]),r(h)),c&&(l=Gi(c),f.attr("y",l[0]).attr("height",l[1]-l[0]),i(h)),e(h)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+h[+/e$/.test(t)]+","+f[+/^s/.test(t)]+")"})}function r(t){t.select(".extent").attr("x",h[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",h[1]-h[0])}function i(t){t.select(".extent").attr("y",f[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",f[1]-f[0])}function a(){function a(){32==uo.event.keyCode&&(L||(x=null,I[0]-=h[1],I[1]-=f[1],L=2),T())}function m(){32==uo.event.keyCode&&2==L&&(I[0]+=h[1],I[1]+=f[1],L=0,T())}function g(){var t=uo.mouse(_),n=!1;b&&(t[0]+=b[0],t[1]+=b[1]),L||(uo.event.altKey?(x||(x=[(h[0]+h[1])/2,(f[0]+f[1])/2]),I[0]=h[+(t[0]<x[0])],I[1]=f[+(t[1]<x[1])]):x=null),E&&v(t,u,0)&&(r(A),n=!0),S&&v(t,c,1)&&(i(A),n=!0),n&&(e(A),M({type:"brush",mode:L?"move":"resize"}))}function v(t,e,r){var n,i,a=Gi(e),l=a[0],u=a[1],c=I[r],m=r?f:h,g=m[1]-m[0];if(L&&(l-=c,u-=g+c),n=(r?p:d)?Math.max(l,Math.min(u,t[r])):t[r],L?i=(n+=c)+g:(x&&(c=Math.max(l,Math.min(u,2*x[r]-n))),c<n?(i=n,n=c):i=c),m[0]!=n||m[1]!=i)return r?s=null:o=null,m[0]=n,m[1]=i,!0}function y(){g(),A.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),uo.select("body").style("cursor",null),z.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),C(),M({type:"brushend"})}var x,b,_=this,w=uo.select(uo.event.target),M=l.of(_,arguments),A=uo.select(_),k=w.datum(),E=!/^(n|s)$/.test(k)&&u,S=!/^(e|w)$/.test(k)&&c,L=w.classed("extent"),C=K(_),I=uo.mouse(_),z=uo.select(n(_)).on("keydown.brush",a).on("keyup.brush",m);if(uo.event.changedTouches?z.on("touchmove.brush",g).on("touchend.brush",y):z.on("mousemove.brush",g).on("mouseup.brush",y),A.interrupt().selectAll("*").interrupt(),L)I[0]=h[0]-I[0],I[1]=f[0]-I[1];else if(k){var D=+/w$/.test(k),P=+/^n/.test(k);b=[h[1-D]-I[0],f[1-P]-I[1]],I[0]=h[D],I[1]=f[P]}else uo.event.altKey&&(x=I.slice());A.style("pointer-events","none").selectAll(".resize").style("display",null),uo.select("body").style("cursor",w.style("cursor")),M({type:"brushstart"}),g()}var o,s,l=S(t,"brushstart","brush","brushend"),u=null,c=null,h=[0,0],f=[0,0],d=!0,p=!0,m=Wl[0];return t.event=function(t){t.each(function(){var t=l.of(this,arguments),e={x:h,y:f,i:o,j:s},r=this.__chart__||e;this.__chart__=e,Bl?uo.select(this).transition().each("start.brush",function(){o=r.i,s=r.j,h=r.x,f=r.y,t({type:"brushstart"})}).tween("brush:brush",function(){var r=wn(h,e.x),n=wn(f,e.y);return o=s=null,function(i){h=e.x=r(i),f=e.y=n(i),t({type:"brush",mode:"resize"})}}).each("end.brush",function(){o=e.i,s=e.j,t({type:"brush",mode:"resize"}),t({type:"brushend"})}):(t({type:"brushstart"}),t({type:"brush",mode:"resize"}),t({type:"brushend"}))})},t.x=function(e){return arguments.length?(u=e,m=Wl[!u<<1|!c],t):u},t.y=function(e){return arguments.length?(c=e,m=Wl[!u<<1|!c],t):c},t.clamp=function(e){return arguments.length?(u&&c?(d=!!e[0],p=!!e[1]):u?d=!!e:c&&(p=!!e),t):u&&c?[d,p]:u?d:c?p:null},t.extent=function(e){var r,n,i,a,l;return arguments.length?(u&&(r=e[0],n=e[1],c&&(r=r[0],n=n[0]),o=[r,n],u.invert&&(r=u(r),n=u(n)),n<r&&(l=r,r=n,n=l),r==h[0]&&n==h[1]||(h=[r,n])),c&&(i=e[0],a=e[1],u&&(i=i[1],a=a[1]),s=[i,a],c.invert&&(i=c(i),a=c(a)),a<i&&(l=i,i=a,a=l),i==f[0]&&a==f[1]||(f=[i,a])),t):(u&&(o?(r=o[0],n=o[1]):(r=h[0],n=h[1],u.invert&&(r=u.invert(r),n=u.invert(n)),n<r&&(l=r,r=n,n=l))),c&&(s?(i=s[0],a=s[1]):(i=f[0],a=f[1],c.invert&&(i=c.invert(i),a=c.invert(a)),a<i&&(l=i,i=a,a=l))),u&&c?[[r,i],[n,a]]:u?[r,n]:c&&[i,a])},t.clear=function(){return t.empty()||(h=[0,0],f=[0,0],o=s=null),t},t.empty=function(){return!!u&&h[0]==h[1]||!!c&&f[0]==f[1]},uo.rebind(t,l,"on")};var Xl={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Wl=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Zl=ps.format=bs.timeFormat,Jl=Zl.utc,Kl=Jl("%Y-%m-%dT%H:%M:%S.%LZ");Zl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?io:Kl,io.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},io.toString=Kl.toString,ps.second=Vt(function(t){return new ms(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),ps.seconds=ps.second.range,ps.seconds.utc=ps.second.utc.range,ps.minute=Vt(function(t){return new ms(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),ps.minutes=ps.minute.range,ps.minutes.utc=ps.minute.utc.range,ps.hour=Vt(function(t){var e=t.getTimezoneOffset()/60;return new ms(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),ps.hours=ps.hour.range,ps.hours.utc=ps.hour.utc.range,ps.month=Vt(function(t){return t=ps.day(t),t.setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),ps.months=ps.month.range,ps.months.utc=ps.month.utc.range;var Ql=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],$l=[[ps.second,1],[ps.second,5],[ps.second,15],[ps.second,30],[ps.minute,1],[ps.minute,5],[ps.minute,15],[ps.minute,30],[ps.hour,1],[ps.hour,3],[ps.hour,6],[ps.hour,12],[ps.day,1],[ps.day,2],[ps.week,1],[ps.month,1],[ps.month,3],[ps.year,1]],tu=Zl.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",Ie]]),eu={range:function(t,e,r){return uo.range(Math.ceil(t/r)*r,+e,r).map(oo)},floor:b,ceil:b};$l.year=ps.year,ps.scale=function(){return ao(uo.scale.linear(),$l,tu)};var ru=$l.map(function(t){return[t[0].utc,t[1]]}),nu=Jl.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",Ie]]);ru.year=ps.year.utc,ps.scale.utc=function(){return ao(uo.scale.linear(),ru,nu)},uo.text=Lt(function(t){return t.responseText}),uo.json=function(t,e){return Ct(t,"application/json",so,e)},uo.html=function(t,e){return Ct(t,"text/html",lo,e)},uo.xml=Lt(function(t){return t.responseXML}),"function"==typeof t&&t.amd?(this.d3=uo,t(uo)):"object"==typeof r&&r.exports?r.exports=uo:this.d3=uo}()},{}],98:[function(t,e,r){"use strict";function n(t,e){this.point=t,this.index=e}function i(t,e){for(var r=t.point,n=e.point,i=r.length,a=0;a<i;++a){var o=n[a]-r[a];if(o)return o}return 0}function a(t,e,r){if(1===t)return r?[[-1,0]]:[];var n=e.map(function(t,e){return[t[0],e]});n.sort(function(t,e){return t[0]-e[0]});for(var i=new Array(t-1),a=1;a<t;++a){var o=n[a-1],s=n[a];i[a-1]=[o[1],s[1]]}return r&&i.push([-1,i[0][1]],[i[t-1][1],-1]),i}function o(t,e){var r=t.length;if(0===r)return[];var o=t[0].length;if(o<1)return[];if(1===o)return a(r,t,e);for(var u=new Array(r),c=1,h=0;h<r;++h){for(var f=t[h],d=new Array(o+1),p=0,m=0;m<o;++m){var g=f[m];d[m]=g,p+=g*g}d[o]=p,u[h]=new n(d,h),c=Math.max(p,c)}l(u,i),r=u.length;for(var v=new Array(r+o+1),y=new Array(r+o+1),x=(o+1)*(o+1)*c,b=new Array(o+1),h=0;h<=o;++h)b[h]=0;b[o]=x,v[0]=b.slice(),y[0]=-1;for(var h=0;h<=o;++h){var d=b.slice();d[h]=1,v[h+1]=d,y[h+1]=-1}for(var h=0;h<r;++h){var _=u[h];v[h+o+1]=_.point,y[h+o+1]=_.index}var w=s(v,!1);if(w=e?w.filter(function(t){for(var e=0,r=0;r<=o;++r){var n=y[t[r]];if(n<0&&++e>=2)return!1;t[r]=n}return!0}):w.filter(function(t){for(var e=0;e<=o;++e){var r=y[t[e]];if(r<0)return!1;t[e]=r}return!0}),1&o)for(var h=0;h<w.length;++h){var _=w[h],d=_[0];_[0]=_[1],_[1]=d}return w}var s=t("incremental-convex-hull"),l=t("uniq");e.exports=o},{"incremental-convex-hull":259,uniq:504}],99:[function(t,e,r){(function(t){function r(t,e){return d[0]=t,d[1]=e,f[0]}function n(t){return f[0]=t,d[0]}function i(t){return f[0]=t,d[1]}function a(t,e){return d[1]=t,d[0]=e,f[0]}function o(t){return f[0]=t,d[1]}function s(t){return f[0]=t,d[0]}function l(t,e){return p.writeUInt32LE(t,0,!0),p.writeUInt32LE(e,4,!0),p.readDoubleLE(0,!0)}function u(t){return p.writeDoubleLE(t,0,!0),p.readUInt32LE(0,!0)}function c(t){return p.writeDoubleLE(t,0,!0),p.readUInt32LE(4,!0)}var h=!1;if("undefined"!=typeof Float64Array){var f=new Float64Array(1),d=new Uint32Array(f.buffer);f[0]=1,h=!0,1072693248===d[1]?(e.exports=function(t){return f[0]=t,[d[0],d[1]]},e.exports.pack=r,e.exports.lo=n,e.exports.hi=i):1072693248===d[0]?(e.exports=function(t){return f[0]=t,[d[1],d[0]]},e.exports.pack=a,e.exports.lo=o,e.exports.hi=s):h=!1}if(!h){var p=new t(8);e.exports=function(t){return p.writeDoubleLE(t,0,!0),[p.readUInt32LE(0,!0),p.readUInt32LE(4,!0)]},e.exports.pack=l,e.exports.lo=u,e.exports.hi=c}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){var r=e.exports.hi(t);return(r<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){var r=e.exports.hi(t);return!(2146435072&r)}}).call(this,t("buffer").Buffer)},{buffer:66}],100:[function(t,e,r){"use strict";function n(t,e,r){var i=0|t[r];if(i<=0)return[];var a,o=new Array(i);if(r===t.length-1)for(a=0;a<i;++a)o[a]=e;else for(a=0;a<i;++a)o[a]=n(t,e,r+1);return o}function i(t,e){var r,n;for(r=new Array(t),n=0;n<t;++n)r[n]=e;return r}function a(t,e){switch("undefined"==typeof e&&(e=0),typeof t){case"number":if(t>0)return i(0|t,e);break;case"object":if("number"==typeof t.length)return n(t,e,0)}return[]}e.exports=a},{}],101:[function(t,e,r){"use strict";function n(t,e,r){r=r||2;var n=e&&e.length,a=n?e[0]*r:t.length,s=i(t,0,a,r,!0),l=[];if(!s)return l;var u,c,f,d,p,m,g;if(n&&(s=h(t,e,s,r)),t.length>80*r){u=f=t[0],c=d=t[1];for(var v=r;v<a;v+=r)p=t[v],m=t[v+1],p<u&&(u=p),m<c&&(c=m),p>f&&(f=p),m>d&&(d=m);g=Math.max(f-u,d-c)}return o(s,l,r,u,c,g),l}function i(t,e,r,n,i){var a,o;if(i===I(t,e,r,n)>0)for(a=e;a<r;a+=n)o=S(a,t[a],t[a+1],o);else for(a=r-n;a>=e;a-=n)o=S(a,t[a],t[a+1],o);return o&&w(o,o.next)&&(L(o),o=o.next),o}function a(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!w(n,n.next)&&0!==_(n.prev,n,n.next))n=n.next;else{if(L(n),n=e=n.prev,n===n.next)return null;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,i,h,f){if(t){!f&&h&&m(t,n,i,h);for(var d,p,g=t;t.prev!==t.next;)if(d=t.prev,p=t.next,h?l(t,n,i,h):s(t))e.push(d.i/r),e.push(t.i/r),e.push(p.i/r),L(t),t=p.next,g=p.next;else if(t=p,t===g){f?1===f?(t=u(t,e,r),o(t,e,r,n,i,h,2)):2===f&&c(t,e,r,n,i,h):o(a(t),e,r,n,i,h,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(_(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(x(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&_(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function l(t,e,r,n){var i=t.prev,a=t,o=t.next;if(_(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,l=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,u=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=v(s,l,e,r,n),f=v(u,c,e,r,n),d=t.nextZ;d&&d.z<=f;){if(d!==t.prev&&d!==t.next&&x(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=t.prevZ;d&&d.z>=h;){if(d!==t.prev&&d!==t.next&&x(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function u(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!w(i,a)&&M(i,n,n.next,a)&&k(i,a)&&k(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),L(n),L(n.next),n=t=a),n=n.next}while(n!==t);return n}function c(t,e,r,n,i,s){var l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&b(l,u)){var c=E(l,u);return l=a(l,l.next),c=a(c,c.next),o(l,e,r,n,i,s),void o(c,e,r,n,i,s)}u=u.next}l=l.next}while(l!==t)}function h(t,e,r,n){var o,s,l,u,c,h=[];for(o=0,s=e.length;o<s;o++)l=e[o]*n,u=o<s-1?e[o+1]*n:t.length,c=i(t,l,u,n,!1),c===c.next&&(c.steiner=!0),h.push(y(c));for(h.sort(f),o=0;o<h.length;o++)d(h[o],r),r=a(r,r.next);return r}function f(t,e){return t.x-e.x}function d(t,e){if(e=p(t,e)){var r=E(e,t);a(r,r.next)}}function p(t,e){var r,n=e,i=t.x,a=t.y,o=-(1/0);do{if(a<=n.y&&a>=n.next.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!r)return null;if(i===o)return r.prev;var l,u=r,c=r.x,h=r.y,f=1/0;for(n=r.next;n!==u;)i>=n.x&&n.x>=c&&x(a<h?i:o,a,c,h,a<h?o:i,a,n.x,n.y)&&(l=Math.abs(a-n.y)/(i-n.x),(l<f||l===f&&n.x>r.x)&&k(n,t)&&(r=n,f=l)),n=n.next;return r}function m(t,e,r,n){var i=t;do{null===i.z&&(i.z=v(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,g(i)}function g(t){var e,r,n,i,a,o,s,l,u=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e<u&&(s++,n=n.nextZ,n);e++);for(l=u;s>0||l>0&&n;)0===s?(i=n,n=n.nextZ,l--):0!==l&&n?r.z<=n.z?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--):(i=r,r=r.nextZ,s--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,u*=2}while(o>1);return t}function v(t,e,r,n,i){return t=32767*(t-r)/i,e=32767*(e-n)/i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function y(t){var e=t,r=t;do{e.x<r.x&&(r=e),e=e.next}while(e!==t);return r}function x(t,e,r,n,i,a,o,s){return(i-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function b(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!A(t,e)&&k(t,e)&&k(e,t)&&T(t,e)}function _(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function w(t,e){return t.x===e.x&&t.y===e.y}function M(t,e,r,n){return!!(w(t,e)&&w(r,n)||w(t,n)&&w(r,e))||_(t,e,r)>0!=_(t,e,n)>0&&_(r,n,t)>0!=_(r,n,e)>0}function A(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&M(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function k(t,e){return _(t.prev,t,t.next)<0?_(t,e,t.next)>=0&&_(t,t.prev,e)>=0:_(t,e,t.prev)<0||_(t,t.next,e)<0}function T(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}function E(t,e){var r=new C(t.i,t.x,t.y),n=new C(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function S(t,e,r,n){var i=new C(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function L(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function C(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function I(t,e,r,n){for(var i=0,a=e,o=r-n;a<r;a+=n)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}e.exports=n,n.deviation=function(t,e,r,n){var i=e&&e.length,a=i?e[0]*r:t.length,o=Math.abs(I(t,0,a,r));if(i)for(var s=0,l=e.length;s<l;s++){var u=e[s]*r,c=s<l-1?e[s+1]*r:t.length;o-=Math.abs(I(t,u,c,r))}var h=0;for(s=0;s<n.length;s+=3){var f=n[s]*r,d=n[s+1]*r,p=n[s+2]*r;h+=Math.abs((t[f]-t[p])*(t[d+1]-t[f+1])-(t[f]-t[d])*(t[p+1]-t[f+1]))}return 0===o&&0===h?0:Math.abs((h-o)/o)},n.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var a=0;a<t[i].length;a++)for(var o=0;o<e;o++)r.vertices.push(t[i][a][o]);i>0&&(n+=t[i-1].length,r.holes.push(n))}return r}},{}],102:[function(t,e,r){"use strict";function n(t,e){var r=t.length;if("number"!=typeof e){e=0;for(var n=0;n<r;++n){var a=t[n];e=Math.max(e,a[0],a[1])}e=(0|e)+1}e|=0;for(var o=new Array(e),n=0;n<e;++n)o[n]=[];for(var n=0;n<r;++n){var a=t[n];o[a[0]].push(a[1]),o[a[1]].push(a[0])}for(var s=0;s<e;++s)i(o[s],function(t,e){return t-e});return o}e.exports=n;var i=t("uniq")},{uniq:504}],103:[function(e,r,n){(function(i,a){!function(e,i){"object"==typeof n&&"undefined"!=typeof r?r.exports=i():"function"==typeof t&&t.amd?t(i):e.ES6Promise=i()}(this,function(){"use strict";function t(t){return"function"==typeof t||"object"==typeof t&&null!==t}function r(t){return"function"==typeof t}function n(t){Z=t}function o(t){J=t}function s(){return function(){return i.nextTick(f)}}function l(){return function(){W(f)}}function u(){var t=0,e=new $(f),r=document.createTextNode("");return e.observe(r,{characterData:!0}),function(){r.data=t=++t%2}}function c(){var t=new MessageChannel;return t.port1.onmessage=f,function(){return t.port2.postMessage(0)}}function h(){var t=setTimeout;return function(){return t(f,1)}}function f(){for(var t=0;t<X;t+=2){var e=rt[t],r=rt[t+1];e(r),rt[t]=void 0,rt[t+1]=void 0}X=0}function d(){try{var t=e,r=t("vertx");return W=r.runOnLoop||r.runOnContext,l()}catch(t){return h()}}function p(t,e){var r=arguments,n=this,i=new this.constructor(g);void 0===i[it]&&O(i);var a=n._state;return a?!function(){var t=r[a-1];J(function(){return z(a,i,t,n._result)})}():S(n,i,t,e),i}function m(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var r=new e(g);return A(r,t),r}function g(){}function v(){return new TypeError("You cannot resolve a promise with itself")}function y(){return new TypeError("A promises callback cannot return that same promise.")}function x(t){try{return t.then}catch(t){return lt.error=t,lt}}function b(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}function _(t,e,r){J(function(t){var n=!1,i=b(r,e,function(r){n||(n=!0,e!==r?A(t,r):T(t,r))},function(e){n||(n=!0,E(t,e))},"Settle: "+(t._label||" unknown promise"));!n&&i&&(n=!0,E(t,i))},t)}function w(t,e){e._state===ot?T(t,e._result):e._state===st?E(t,e._result):S(e,void 0,function(e){return A(t,e)},function(e){return E(t,e)})}function M(t,e,n){e.constructor===t.constructor&&n===p&&e.constructor.resolve===m?w(t,e):n===lt?E(t,lt.error):void 0===n?T(t,e):r(n)?_(t,e,n):T(t,e)}function A(e,r){e===r?E(e,v()):t(r)?M(e,r,x(r)):T(e,r)}function k(t){t._onerror&&t._onerror(t._result),L(t)}function T(t,e){t._state===at&&(t._result=e,t._state=ot,0!==t._subscribers.length&&J(L,t))}function E(t,e){t._state===at&&(t._state=st,t._result=e,J(k,t))}function S(t,e,r,n){var i=t._subscribers,a=i.length;t._onerror=null,i[a]=e,i[a+ot]=r,i[a+st]=n,0===a&&t._state&&J(L,t)}function L(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,i=void 0,a=t._result,o=0;o<e.length;o+=3)n=e[o],i=e[o+r],n?z(r,n,i,a):i(a);t._subscribers.length=0}}function C(){this.error=null}function I(t,e){try{return t(e)}catch(t){return ut.error=t,ut}}function z(t,e,n,i){var a=r(n),o=void 0,s=void 0,l=void 0,u=void 0;if(a){if(o=I(n,i),o===ut?(u=!0,s=o.error,o=null):l=!0,e===o)return void E(e,y())}else o=i,l=!0;e._state!==at||(a&&l?A(e,o):u?E(e,s):t===ot?T(e,o):t===st&&E(e,o))}function D(t,e){try{e(function(e){A(t,e)},function(e){E(t,e)})}catch(e){E(t,e)}}function P(){return ct++}function O(t){t[it]=ct++,t._state=void 0,t._result=void 0,t._subscribers=[]}function R(t,e){this._instanceConstructor=t,this.promise=new t(g),this.promise[it]||O(this.promise),G(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?T(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&T(this.promise,this._result))):E(this.promise,F())}function F(){return new Error("Array Methods must be provided an Array")}function j(t){return new R(this,t).promise}function N(t){var e=this;return new e(G(t)?function(r,n){for(var i=t.length,a=0;a<i;a++)e.resolve(t[a]).then(r,n)}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function B(t){var e=this,r=new e(g);return E(r,t),r}function U(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function V(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function q(t){this[it]=P(),this._result=this._state=void 0,this._subscribers=[],g!==t&&("function"!=typeof t&&U(),this instanceof q?D(this,t):V())}function H(){var t=void 0;if("undefined"!=typeof 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=q}var Y=void 0;Y=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var G=Y,X=0,W=void 0,Z=void 0,J=function(t,e){rt[X]=t,rt[X+1]=e,X+=2,2===X&&(Z?Z(f):nt())},K="undefined"!=typeof window?window:void 0,Q=K||{},$=Q.MutationObserver||Q.WebKitMutationObserver,tt="undefined"==typeof self&&"undefined"!=typeof i&&"[object process]"==={}.toString.call(i),et="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,rt=new Array(1e3),nt=void 0;nt=tt?s():$?u():et?c():void 0===K&&"function"==typeof e?d():h();var it=Math.random().toString(36).substring(16),at=void 0,ot=1,st=2,lt=new C,ut=new C,ct=0;return R.prototype._enumerate=function(){for(var t=this.length,e=this._input,r=0;this._state===at&&r<t;r++)this._eachEntry(e[r],r)},R.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===m){var i=x(t);if(i===p&&t._state!==at)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(r===q){var a=new r(g);M(a,t,i),this._willSettleAt(a,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},R.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===at&&(this._remaining--,t===st?E(n,r):this._result[e]=r),0===this._remaining&&T(n,this._result)},R.prototype._willSettleAt=function(t,e){var r=this;S(t,void 0,function(t){return r._settledAt(ot,e,t)},function(t){return r._settledAt(st,e,t)})},q.all=j,q.race=N,q.resolve=m,q.reject=B,q._setScheduler=n,q._setAsap=o,q._asap=J,q.prototype={constructor:q,then:p,catch:function(t){return this.then(null,t)}},H(),q.polyfill=H,q.Promise=q,q})}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:451}],104:[function(t,e,r){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function a(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function s(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(!a(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,a,l,u;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;var c=new Error('Uncaught, unspecified "error" event. ('+e+")");throw c.context=e,c}if(r=this._events[t],s(r))return!1;if(i(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:a=Array.prototype.slice.call(arguments,1),r.apply(this,a)}else if(o(r))for(a=Array.prototype.slice.call(arguments,1),u=r.slice(),n=u.length,l=0;l<n;l++)u[l].apply(this,a);return!0},n.prototype.addListener=function(t,e){var r;if(!i(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,i(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned&&(r=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,r&&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){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,a,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],a=r.length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(r)){for(s=a;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;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(r=this._events[t],i(r))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){var e;return e=this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],105:[function(t,e,r){"use strict";function n(t,e,r){var n=e||0,i=r||1;return[[t[12]+t[0],t[13]+t[1],t[14]+t[2],t[15]+t[3]],[t[12]-t[0],t[13]-t[1],t[14]-t[2],t[15]-t[3]],[t[12]+t[4],t[13]+t[5],t[14]+t[6],t[15]+t[7]],[t[12]-t[4],t[13]-t[5],t[14]-t[6],t[15]-t[7]],[n*t[12]+t[8],n*t[13]+t[9],n*t[14]+t[10],n*t[15]+t[11]],[i*t[12]-t[8],i*t[13]-t[9],i*t[14]-t[10],i*t[15]-t[11]]]}e.exports=n},{}],106:[function(t,e,r){"use strict";function n(t){for(var e,r=t.length,n=0;n<r;n++)if(e=t.charCodeAt(n),(e<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}e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(t=+t,0===t&&n(r))return!1}else if("number"!==e)return!1;return t-t<1}},{}],107:[function(t,e,r){"use strict";function n(t){return new Function("f","var p = (f && f.properties || {}); return "+i(t))}function i(t){if(!t)return"true";var e=t[0];if(t.length<=1)return"any"===e?"false":"true";var r="=="===e?o(t[1],t[2],"===",!1):"!="===e?o(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?o(t[1],t[2],e,!0):"any"===e?s(t.slice(1),"||"):"all"===e?s(t.slice(1),"&&"):"none"===e?c(s(t.slice(1),"||")):"in"===e?l(t[1],t.slice(2)):"!in"===e?c(l(t[1],t.slice(2))):"has"===e?u(t[1]):"!has"===e?c(u([t[1]])):"true";return"("+r+")"}function a(t){return"$type"===t?"f.type":"$id"===t?"f.id":"p["+JSON.stringify(t)+"]"}function o(t,e,r,n){var i=a(t),o="$type"===t?f.indexOf(e):JSON.stringify(e);return(n?"typeof "+i+"=== typeof "+o+"&&":"")+i+r+o}function s(t,e){return t.map(i).join(e)}function l(t,e){"$type"===t&&(e=e.map(function(t){return f.indexOf(t)}));var r=JSON.stringify(e.sort(h)),n=a(t);return e.length<=200?r+".indexOf("+n+") !== -1":"function(v, a, i, j) {while (i <= j) { var m = (i + j) >> 1;    if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;}return false; }("+n+", "+r+",0,"+(e.length-1)+")"}function u(t){return JSON.stringify(t)+" in p"}function c(t){return"!("+t+")"}function h(t,e){return t<e?-1:t>e?1:0}e.exports=n;var f=["Unknown","Point","LineString","Polygon"]},{}],108:[function(t,e,r){"use strict";function n(t,e,r){return Math.min(e,Math.max(t,r))}function i(t,e,r){this.dimension=t.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;n<this.dimension;++n)this.bounds[0][n]=-(1/0),this.bounds[1][n]=1/0;this._state=t.slice().reverse(),this._velocity=e.slice().reverse(),this._time=[r],this._scratch=[t.slice(),t.slice(),t.slice(),t.slice(),t.slice()]}function a(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=0;return e}function o(t,e,r){switch(arguments.length){case 0:return new i([0],[0],0);case 1:if("number"==typeof t){var n=a(t);return new i(n,n,0)}return new i(t,a(t.length),0);case 2:if("number"==typeof e){var n=a(t.length);return new i(t,n,+e)}r=0;case 3:if(t.length!==e.length)throw new Error("state and velocity lengths must match");return new i(t,e,r)}}e.exports=o;var s=t("cubic-hermite"),l=t("binary-search-bounds"),u=i.prototype;u.flush=function(t){var e=l.gt(this._time,t)-1;e<=0||(this._time.splice(0,e),this._state.splice(0,e*this.dimension),this._velocity.splice(0,e*this.dimension))},u.curve=function(t){var e=this._time,r=e.length,i=l.le(e,t),a=this._scratch[0],o=this._state,u=this._velocity,c=this.dimension,h=this.bounds;if(i<0)for(var f=c-1,d=0;d<c;++d,--f)a[d]=o[f];else if(i>=r-1)for(var f=o.length-1,p=t-e[r-1],d=0;d<c;++d,--f)a[d]=o[f]+p*u[f];else{for(var f=c*(i+1)-1,m=e[i],g=e[i+1],v=g-m||1,y=this._scratch[1],x=this._scratch[2],b=this._scratch[3],_=this._scratch[4],w=!0,d=0;d<c;++d,--f)y[d]=o[f],b[d]=u[f]*v,x[d]=o[f+c],_[d]=u[f+c]*v,w=w&&y[d]===x[d]&&b[d]===_[d]&&0===b[d];if(w)for(var d=0;d<c;++d)a[d]=y[d];else s(y,b,x,_,(t-m)/v,a)}for(var M=h[0],A=h[1],d=0;d<c;++d)a[d]=n(M[d],A[d],a[d]);return a},u.dcurve=function(t){var e=this._time,r=e.length,n=l.le(e,t),i=this._scratch[0],a=this._state,o=this._velocity,u=this.dimension;if(n>=r-1)for(var c=a.length-1,h=(t-e[r-1],0);h<u;++h,--c)i[h]=o[c];else{for(var c=u*(n+1)-1,f=e[n],d=e[n+1],p=d-f||1,m=this._scratch[1],g=this._scratch[2],v=this._scratch[3],y=this._scratch[4],x=!0,h=0;h<u;++h,--c)m[h]=a[c],v[h]=o[c]*p,g[h]=a[c+u],y[h]=o[c+u]*p,x=x&&m[h]===g[h]&&v[h]===y[h]&&0===v[h];if(x)for(var h=0;h<u;++h)i[h]=0;else{s.derivative(m,v,g,y,(t-f)/p,i);for(var h=0;h<u;++h)i[h]/=p}}return i},u.lastT=function(){var t=this._time;return t[t.length-1]},u.stable=function(){for(var t=this._velocity,e=t.length,r=this.dimension-1;r>=0;--r)if(t[--e])return!1;return!0},u.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t<e||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],u=s[1];this._time.push(e,t);for(var c=0;c<2;++c)for(var h=0;h<r;++h)i.push(i[o++]),a.push(0);this._time.push(t);for(var h=r;h>0;--h)i.push(n(l[h-1],u[h-1],arguments[h])),a.push(0)}},u.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t<e||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=t-e,l=this.bounds,u=l[0],c=l[1],h=s>1e-6?1/s:0;this._time.push(t);for(var f=r;f>0;--f){var d=n(u[f-1],c[f-1],arguments[f]);i.push(d),a.push((d-i[o++])*h)}}},u.set=function(t){var e=this.dimension;if(!(t<this.lastT()||arguments.length!==e+1)){var r=this._state,i=this._velocity,a=this.bounds,o=a[0],s=a[1];this._time.push(t);for(var l=e;l>0;--l)r.push(n(o[l-1],s[l-1],arguments[l])),i.push(0)}},u.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],u=s[1],c=t-e,h=c>1e-6?1/c:0;this._time.push(t);for(var f=r;f>0;--f){var d=arguments[f];i.push(n(l[f-1],u[f-1],i[o++]+d)),a.push(d*h)}}},u.idle=function(t){var e=this.lastT();if(!(t<e)){var r=this.dimension,i=this._state,a=this._velocity,o=i.length-r,s=this.bounds,l=s[0],u=s[1],c=t-e;this._time.push(t);for(var h=r-1;h>=0;--h)i.push(n(l[h],u[h],i[o]+c*a[o])),a.push(0),o+=1}}},{"binary-search-bounds":55,"cubic-hermite":92}],109:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=a}function i(t){return new n(t._color,t.key,t.value,t.left,t.right,t._count)}function a(t,e){return new n(t,e.key,e.value,e.left,e.right,e._count)}function o(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function s(t,e){this._compare=t,this.root=e}function l(t,e){if(e.left){var r=l(t,e.left);if(r)return r}var r=t(e.key,e.value);return r?r:e.right?l(t,e.right):void 0}function u(t,e,r,n){var i=e(t,n.key);if(i<=0){if(n.left){var a=u(t,e,r,n.left);if(a)return a}var a=r(n.key,n.value);if(a)return a}if(n.right)return u(t,e,r,n.right)}function c(t,e,r,n,i){var a,o=r(t,i.key),s=r(e,i.key);if(o<=0){if(i.left&&(a=c(t,e,r,n,i.left)))return a;if(s>0&&(a=n(i.key,i.value)))return a}if(s>0&&i.right)return c(t,e,r,n,i.right)}function h(t,e){this.tree=t,this._stack=e}function f(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function d(t){for(var e,r,n,s,l=t.length-1;l>=0;--l){if(e=t[l],0===l)return void(e._color=v);if(r=t[l-1],r.left===e){if(n=r.right,n.right&&n.right._color===g){if(n=r.right=i(n),s=n.right=i(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=v,r._color=v,s._color=v,o(r),o(n),l>1){var u=t[l-2];u.left===r?u.left=n:u.right=n}return void(t[l-1]=n)}if(n.left&&n.left._color===g){if(n=r.right=i(n),s=n.left=i(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=v,n._color=v,e._color=v,o(r),o(n),o(s),l>1){var u=t[l-2];u.left===r?u.left=s:u.right=s}return void(t[l-1]=s)}if(n._color===v){if(r._color===g)return r._color=v,void(r.right=a(g,n));r.right=a(g,n);continue}if(n=i(n),r.right=n.left,n.left=r,n._color=r._color,r._color=g,o(r),o(n),l>1){var u=t[l-2];u.left===r?u.left=n:u.right=n}t[l-1]=n,t[l]=r,l+1<t.length?t[l+1]=e:t.push(e),l+=2}else{if(n=r.left,n.left&&n.left._color===g){if(n=r.left=i(n),s=n.left=i(n.left),r.left=n.right,n.right=r,n.left=s,n._color=r._color,e._color=v,r._color=v,s._color=v,o(r),o(n),l>1){var u=t[l-2];u.right===r?u.right=n:u.left=n}return void(t[l-1]=n)}if(n.right&&n.right._color===g){if(n=r.left=i(n),s=n.right=i(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=v,n._color=v,e._color=v,o(r),o(n),o(s),l>1){var u=t[l-2];u.right===r?u.right=s:u.left=s}return void(t[l-1]=s)}if(n._color===v){if(r._color===g)return r._color=v,void(r.left=a(g,n));r.left=a(g,n);continue}if(n=i(n),r.left=n.right,n.right=r,n._color=r._color,r._color=g,o(r),o(n),l>1){var u=t[l-2];u.right===r?u.right=n:u.left=n}t[l-1]=n,t[l]=r,l+1<t.length?t[l+1]=e:t.push(e),l+=2}}}function p(t,e){return t<e?-1:t>e?1:0}function m(t){return new s(t||p,null)}e.exports=m;var g=0,v=1,y=s.prototype;Object.defineProperty(y,"keys",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(y,"values",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(y,"length",{get:function(){return this.root?this.root._count:0}}),y.insert=function(t,e){for(var r=this._compare,i=this.root,l=[],u=[];i;){var c=r(t,i.key);l.push(i),u.push(c),i=c<=0?i.left:i.right}l.push(new n(g,t,e,null,null,1));for(var h=l.length-2;h>=0;--h){var i=l[h];u[h]<=0?l[h]=new n(i._color,i.key,i.value,l[h+1],i.right,i._count+1):l[h]=new n(i._color,i.key,i.value,i.left,l[h+1],i._count+1)}for(var h=l.length-1;h>1;--h){var f=l[h-1],i=l[h];if(f._color===v||i._color===v)break;var d=l[h-2];if(d.left===f)if(f.left===i){var p=d.right;if(!p||p._color!==g){if(d._color=g,d.left=f.right,f._color=v,f.right=d,l[h-2]=f,l[h-1]=i,o(d),o(f),h>=3){var m=l[h-3];m.left===d?m.left=f:m.right=f}break}f._color=v,d.right=a(v,p),d._color=g,h-=1}else{var p=d.right;if(!p||p._color!==g){if(f.right=i.left,d._color=g,d.left=i.right,i._color=v,i.left=f,i.right=d,l[h-2]=i,l[h-1]=f,o(d),o(f),o(i),h>=3){var m=l[h-3];m.left===d?m.left=i:m.right=i}break}f._color=v,d.right=a(v,p),d._color=g,h-=1}else if(f.right===i){var p=d.left;if(!p||p._color!==g){if(d._color=g,d.right=f.left,f._color=v,f.left=d,l[h-2]=f,l[h-1]=i,o(d),o(f),h>=3){var m=l[h-3];m.right===d?m.right=f:m.left=f}break}f._color=v,d.left=a(v,p),d._color=g,h-=1}else{var p=d.left;if(!p||p._color!==g){if(f.left=i.right,d._color=g,d.right=i.left,i._color=v,i.right=f,i.left=d,l[h-2]=i,l[h-1]=f,o(d),o(f),o(i),h>=3){var m=l[h-3];m.right===d?m.right=i:m.left=i}break}f._color=v,d.left=a(v,p),d._color=g,h-=1}}return l[0]._color=v,new s(r,l[0])},y.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return l(t,this.root);case 2:return u(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return c(e,r,this._compare,t,this.root)}},Object.defineProperty(y,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new h(this,t)}}),Object.defineProperty(y,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new h(this,t)}}),y.at=function(t){if(t<0)return new h(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t<e.left._count){e=e.left;continue}t-=e.left._count}if(!t)return new h(this,r);if(t-=1,!e.right)break;if(t>=e.right._count)break;e=e.right}return new h(this,[])},y.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new h(this,n)},y.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new h(this,n)},y.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new h(this,n)},y.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new h(this,n)},y.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new h(this,n);r=i<=0?r.left:r.right}return new h(this,[])},y.remove=function(t){var e=this.find(t);return e?e.remove():this},y.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var x=h.prototype;Object.defineProperty(x,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(x,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),x.clone=function(){return new h(this.tree,this._stack.slice())},x.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new n(r._color,r.key,r.value,r.left,r.right,r._count);for(var i=t.length-2;i>=0;--i){var r=t[i];r.left===t[i+1]?e[i]=new n(r._color,r.key,r.value,e[i+1],r.right,r._count):e[i]=new n(r._color,r.key,r.value,r.left,e[i+1],r._count)}if(r=e[e.length-1],r.left&&r.right){var a=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var o=e[a-1];e.push(new n(r._color,o.key,o.value,r.left,r.right,r._count)),e[a-1].key=r.key,e[a-1].value=r.value;for(var i=e.length-2;i>=a;--i)r=e[i],e[i]=new n(r._color,r.key,r.value,r.left,e[i+1],r._count);e[a-1].left=e[a]}if(r=e[e.length-1],r._color===g){var l=e[e.length-2];l.left===r?l.left=null:l.right===r&&(l.right=null),e.pop();for(var i=0;i<e.length;++i)e[i]._count--;return new s(this.tree._compare,e[0])}if(r.left||r.right){r.left?f(r,r.left):r.right&&f(r,r.right),r._color=v;for(var i=0;i<e.length-1;++i)e[i]._count--;return new s(this.tree._compare,e[0])}if(1===e.length)return new s(this.tree._compare,null);for(var i=0;i<e.length;++i)e[i]._count--;var u=e[e.length-2];return d(e),u.left===r?u.left=null:u.right=null,new s(this.tree._compare,e[0])},Object.defineProperty(x,"key",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(x,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(x,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),x.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(x,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),x.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var r=new Array(e.length),i=e[e.length-1];r[r.length-1]=new n(i._color,i.key,t,i.left,i.right,i._count);for(var a=e.length-2;a>=0;--a)i=e[a],i.left===e[a+1]?r[a]=new n(i._color,i.key,i.value,r[a+1],i.right,i._count):r[a]=new n(i._color,i.key,i.value,i.left,r[a+1],i._count);return new s(this.tree._compare,r[0])},x.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(x,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},{}],110:[function(t,e,r){function n(t){if(t<0)return Number("0/0");for(var e=s[0],r=s.length-1;r>0;--r)e+=s[r]/(t+r);var n=t+o+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}var i=7,a=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],o=607/128,s=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];e.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(n(e));e-=1;for(var r=a[0],o=1;o<i+2;o++)r+=a[o]/(e+o);var s=e+i+.5;return Math.sqrt(2*Math.PI)*Math.pow(s,e+.5)*Math.exp(-s)*r},e.exports.log=n},{}],111:[function(t,e,r){function n(t){if("Polygon"===t.type)return i(t.coordinates);if("MultiPolygon"===t.type){for(var e=0,r=0;r<t.coordinates.length;r++)e+=i(t.coordinates[r]);return e}return null}function i(t){var e=0;if(t&&t.length>0){e+=Math.abs(a(t[0]));for(var r=1;r<t.length;r++)e-=Math.abs(a(t[r]))}return e}function a(t){var e=0;if(t.length>2){for(var r,n,i=0;i<t.length-1;i++)r=t[i],n=t[i+1],e+=o(n[0]-r[0])*(2+Math.sin(o(r[1]))+Math.sin(o(n[1])));e=e*s.RADIUS*s.RADIUS/2}return e}function o(t){return t*Math.PI/180}var s=t("wgs84");e.exports.geometry=n,e.exports.ring=a},{wgs84:526}],112:[function(t,e,r){function n(t,e){switch(t&&t.type||null){case"FeatureCollection":return t.features=t.features.map(i(n,e)),t;case"Feature":return t.geometry=n(t.geometry,e),t;case"Polygon":case"MultiPolygon":return a(t,e);default:return t}}function i(t,e){return function(r){return t(r,e)}}function a(t,e){return"Polygon"===t.type?t.coordinates=o(t.coordinates,e):"MultiPolygon"===t.type&&(t.coordinates=t.coordinates.map(i(o,e))),t}function o(t,e){e=!!e,t[0]=s(t[0],!e);for(var r=1;r<t.length;r++)t[r]=s(t[r],e);return t}function s(t,e){return l(t)===e?t:t.reverse()}function l(t){return u.ring(t)>=0}var u=t("geojson-area");e.exports=n},{"geojson-area":111}],113:[function(t,e,r){"use strict";function n(t,e,r,n,o,l,u,c){if(r/=e,n/=e,u>=r&&c<=n)return t;if(u>n||c<r)return null;for(var h=[],f=0;f<t.length;f++){var d,p,m=t[f],g=m.geometry,v=m.type;if(d=m.min[o],p=m.max[o],d>=r&&p<=n)h.push(m);else if(!(d>n||p<r)){var y=1===v?i(g,r,n,o):a(g,r,n,o,l,3===v);y.length&&h.push(s(m.tags,v,y,m.id))}}return h.length?h:null}function i(t,e,r,n){for(var i=[],a=0;a<t.length;a++){var o=t[a],s=o[n];s>=e&&s<=r&&i.push(o)}return i}function a(t,e,r,n,i,a){for(var s=[],l=0;l<t.length;l++){var u,c,h,f=0,d=0,p=null,m=t[l],g=m.area,v=m.dist,y=m.outer,x=m.length,b=[];for(c=0;c<x-1;c++)u=p||m[c],p=m[c+1],f=d||u[n],d=p[n],f<e?d>r?(b.push(i(u,p,e),i(u,p,r)),a||(b=o(s,b,g,v,y))):d>=e&&b.push(i(u,p,e)):f>r?d<e?(b.push(i(u,p,r),i(u,p,e)),a||(b=o(s,b,g,v,y))):d<=r&&b.push(i(u,p,r)):(b.push(u),d<e?(b.push(i(u,p,e)),a||(b=o(s,b,g,v,y))):d>r&&(b.push(i(u,p,r)),a||(b=o(s,b,g,v,y))));u=m[x-1],f=u[n],f>=e&&f<=r&&b.push(u),h=b[b.length-1],a&&h&&(b[0][0]!==h[0]||b[0][1]!==h[1])&&b.push(b[0]),o(s,b,g,v,y)}return s}function o(t,e,r,n,i){return e.length&&(e.area=r,e.dist=n,void 0!==i&&(e.outer=i),t.push(e)),[]}e.exports=n;var s=t("./feature")},{"./feature":115}],114:[function(t,e,r){"use strict";function n(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)i(r,t.features[n],e);else"Feature"===t.type?i(r,t,e):i(r,{geometry:t},e);return r}function i(t,e,r){if(null!==e.geometry){var n,s,l,c,h=e.geometry,f=h.type,d=h.coordinates,p=e.properties,m=e.id;if("Point"===f)t.push(u(p,1,[o(d)],m));else if("MultiPoint"===f)t.push(u(p,1,a(d),m));else if("LineString"===f)t.push(u(p,2,[a(d,r)],m));else if("MultiLineString"===f||"Polygon"===f){for(l=[],n=0;n<d.length;n++)c=a(d[n],r),"Polygon"===f&&(c.outer=0===n),l.push(c);t.push(u(p,"Polygon"===f?3:2,l,m))}else if("MultiPolygon"===f){for(l=[],n=0;n<d.length;n++)for(s=0;s<d[n].length;s++)c=a(d[n][s],r),c.outer=0===s,l.push(c);t.push(u(p,3,l,m))}else{if("GeometryCollection"!==f)throw new Error("Input data is not a valid GeoJSON object.");for(n=0;n<h.geometries.length;n++)i(t,{geometry:h.geometries[n],properties:p},r)}}}function a(t,e){for(var r=[],n=0;n<t.length;n++)r.push(o(t[n]));return e&&(l(r,e),s(r)),r}function o(t){var e=Math.sin(t[1]*Math.PI/180),r=t[0]/360+.5,n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n=n<0?0:n>1?1:n,[r,n,0]}function s(t){for(var e,r,n=0,i=0,a=0;a<t.length-1;a++)e=r||t[a],r=t[a+1],n+=e[0]*r[1]-r[0]*e[1],i+=Math.abs(r[0]-e[0])+Math.abs(r[1]-e[1]);t.area=Math.abs(n/2),t.dist=i}e.exports=n;var l=t("./simplify"),u=t("./feature")},{"./feature":115,"./simplify":117}],115:[function(t,e,r){"use strict";function n(t,e,r,n){var a={id:n||null,type:e,geometry:r,tags:t||null,min:[1/0,1/0],max:[-(1/0),-(1/0)]};return i(a),a}function i(t){var e=t.geometry,r=t.min,n=t.max;if(1===t.type)a(r,n,e);else for(var i=0;i<e.length;i++)a(r,n,e[i]);return t}function a(t,e,r){for(var n,i=0;i<r.length;i++)n=r[i],t[0]=Math.min(n[0],t[0]),e[0]=Math.max(n[0],e[0]),t[1]=Math.min(n[1],t[1]),e[1]=Math.max(n[1],e[1])}e.exports=n},{}],116:[function(t,e,r){"use strict";function n(t,e){return new i(t,e)}function i(t,e){e=this.options=l(Object.create(this.options),e);var r=e.debug;r&&console.time("preprocess data");var n=1<<e.maxZoom,i=c(t,e.tolerance/(n*e.extent));this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),i=d(i,e.buffer/e.extent,o),i.length&&this.splitTile(i,0,0,0),r&&(i.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function a(t,e,r){return 32*((1<<t)*r+e)+t}function o(t,e,r){return[r,(r-t[0])*(e[1]-t[1])/(e[0]-t[0])+t[1],1]}function s(t,e,r){return[(r-t[1])*(e[0]-t[0])/(e[1]-t[1])+t[0],r,1]}function l(t,e){for(var r in e)t[r]=e[r];return t}function u(t,e,r){var n=t.source;if(1!==n.length)return!1;var i=n[0];if(3!==i.type||i.geometry.length>1)return!1;var a=i.geometry[0].length;if(5!==a)return!1;for(var o=0;o<a;o++){var s=h.point(i.geometry[0][o],e,t.z2,t.x,t.y);if(s[0]!==-r&&s[0]!==e+r||s[1]!==-r&&s[1]!==e+r)return!1}return!0}e.exports=n;var c=t("./convert"),h=t("./transform"),f=t("./clip"),d=t("./wrap"),p=t("./tile");i.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,solidChildren:!1,tolerance:3,extent:4096,buffer:64,debug:0},i.prototype.splitTile=function(t,e,r,n,i,l,c){for(var h=[t,e,r,n],d=this.options,m=d.debug,g=null;h.length;){n=h.pop(),r=h.pop(),e=h.pop(),t=h.pop();var v=1<<e,y=a(e,r,n),x=this.tiles[y],b=e===d.maxZoom?0:d.tolerance/(v*d.extent);if(!x&&(m>1&&console.time("creation"),x=this.tiles[y]=p(t,v,r,n,b,e===d.maxZoom),this.tileCoords.push({z:e,x:r,y:n}),m)){m>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,x.numFeatures,x.numPoints,x.numSimplified),console.timeEnd("creation"));var _="z"+e;this.stats[_]=(this.stats[_]||0)+1,this.total++}if(x.source=t,i){if(e===d.maxZoom||e===i)continue;var w=1<<i-e;if(r!==Math.floor(l/w)||n!==Math.floor(c/w))continue}else if(e===d.indexMaxZoom||x.numPoints<=d.indexMaxPoints)continue;if(d.solidChildren||!u(x,d.extent,d.buffer)){x.source=null,m>1&&console.time("clipping");var M,A,k,T,E,S,L=.5*d.buffer/d.extent,C=.5-L,I=.5+L,z=1+L;M=A=k=T=null,E=f(t,v,r-L,r+I,0,o,x.min[0],x.max[0]),S=f(t,v,r+C,r+z,0,o,x.min[0],x.max[0]),E&&(M=f(E,v,n-L,n+I,1,s,x.min[1],x.max[1]),A=f(E,v,n+C,n+z,1,s,x.min[1],x.max[1])),S&&(k=f(S,v,n-L,n+I,1,s,x.min[1],x.max[1]),T=f(S,v,n+C,n+z,1,s,x.min[1],x.max[1])),m>1&&console.timeEnd("clipping"),t.length&&(h.push(M||[],e+1,2*r,2*n),h.push(A||[],e+1,2*r,2*n+1),h.push(k||[],e+1,2*r+1,2*n),h.push(T||[],e+1,2*r+1,2*n+1))}else i&&(g=e)}return g},i.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,o=n.debug,s=1<<t;e=(e%s+s)%s;var l=a(t,e,r);if(this.tiles[l])return h.tile(this.tiles[l],i);o>1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var c,f=t,d=e,p=r;!c&&f>0;)f--,d=Math.floor(d/2),p=Math.floor(p/2),c=this.tiles[a(f,d,p)];if(!c||!c.source)return null;if(o>1&&console.log("found parent tile z%d-%d-%d",f,d,p),u(c,i,n.buffer))return h.tile(c,i);o>1&&console.time("drilling down");var m=this.splitTile(c.source,f,d,p,t,e,r);if(o>1&&console.timeEnd("drilling down"),null!==m){var g=1<<t-m;l=a(m,Math.floor(e/g),Math.floor(r/g))}return this.tiles[l]?h.tile(this.tiles[l],i):null}},{"./clip":113,"./convert":114,"./tile":118,"./transform":119,"./wrap":120}],117:[function(t,e,r){"use strict";function n(t,e){var r,n,a,o,s=e*e,l=t.length,u=0,c=l-1,h=[];for(t[u][2]=1,t[c][2]=1;c;){for(n=0,r=u+1;r<c;r++)a=i(t[r],t[u],t[c]),a>n&&(o=r,n=a);n>s?(t[o][2]=n,h.push(u),h.push(o),u=o):(c=h.pop(),u=h.pop())}}function i(t,e,r){var n=e[0],i=e[1],a=r[0],o=r[1],s=t[0],l=t[1],u=a-n,c=o-i;if(0!==u||0!==c){var h=((s-n)*u+(l-i)*c)/(u*u+c*c);h>1?(n=a,i=o):h>0&&(n+=u*h,i+=c*h)}return u=s-n,c=l-i,u*u+c*c}e.exports=n},{}],118:[function(t,e,r){"use strict";function n(t,e,r,n,a,o){for(var s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z2:e,transformed:!1,min:[2,1],max:[-1,0]},l=0;l<t.length;l++){s.numFeatures++,i(s,t[l],a,o);var u=t[l].min,c=t[l].max;u[0]<s.min[0]&&(s.min[0]=u[0]),u[1]<s.min[1]&&(s.min[1]=u[1]),c[0]>s.max[0]&&(s.max[0]=c[0]),c[1]>s.max[1]&&(s.max[1]=c[1])}return s}function i(t,e,r,n){var i,o,s,l,u=e.geometry,c=e.type,h=[],f=r*r;if(1===c)for(i=0;i<u.length;i++)h.push(u[i]),t.numPoints++,t.numSimplified++;else for(i=0;i<u.length;i++)if(s=u[i],n||!(2===c&&s.dist<r||3===c&&s.area<f)){var d=[];for(o=0;o<s.length;o++)l=s[o],(n||l[2]>f)&&(d.push(l),t.numSimplified++),t.numPoints++;3===c&&a(d,s.outer),h.push(d)}else t.numPoints+=s.length;if(h.length){var p={geometry:h,type:c,tags:e.tags||null};null!==e.id&&(p.id=e.id),t.features.push(p)}}function a(t,e){var r=o(t);r<0===e&&t.reverse()}function o(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i<a;o=i++)e=t[i],r=t[o],n+=(r[0]-e[0])*(e[1]+r[1]);return n}e.exports=n},{}],119:[function(t,e,r){"use strict";function n(t,e){if(t.transformed)return t;var r,n,a,o=t.z2,s=t.x,l=t.y;for(r=0;r<t.features.length;r++){var u=t.features[r],c=u.geometry,h=u.type;if(1===h)for(n=0;n<c.length;n++)c[n]=i(c[n],e,o,s,l);else for(n=0;n<c.length;n++){var f=c[n];for(a=0;a<f.length;a++)f[a]=i(f[a],e,o,s,l)}}return t.transformed=!0,t}function i(t,e,r,n,i){var a=Math.round(e*(t[0]*r-n)),o=Math.round(e*(t[1]*r-i));return[a,o]}r.tile=n,r.point=i},{}],120:[function(t,e,r){"use strict";function n(t,e,r){var n=t,a=o(t,1,-1-e,e,0,r,-1,2),s=o(t,1,1-e,2+e,0,r,-1,2);return(a||s)&&(n=o(t,1,-e,1+e,0,r,-1,2)||[],a&&(n=i(a,1).concat(n)),s&&(n=n.concat(i(s,-1)))),n}function i(t,e){for(var r=[],n=0;n<t.length;n++){var i,o=t[n],l=o.type;if(1===l)i=a(o.geometry,e);else{i=[];for(var u=0;u<o.geometry.length;u++)i.push(a(o.geometry[u],e))}r.push(s(o.tags,l,i,o.id))}return r}function a(t,e){var r=[];r.area=t.area,r.dist=t.dist;for(var n=0;n<t.length;n++)r.push([t[n][0]+e,t[n][1],t[n][2]]);return r}var o=t("./clip"),s=t("./feature");e.exports=n},{"./clip":113,"./feature":115}],121:[function(t,e,r){function n(t,e){if("string"!=typeof t)throw new TypeError("must specify type string");if(e=e||{},"undefined"==typeof document&&!e.canvas)return null;var r=e.canvas||document.createElement("canvas");"number"==typeof e.width&&(r.width=e.width),"number"==typeof e.height&&(r.height=e.height);var n,i=e;try{var a=[t];0===t.indexOf("webgl")&&a.push("experimental-"+t);for(var o=0;o<a.length;o++)if(n=r.getContext(a[o],i))return n}catch(t){n=null}return n||null}e.exports=n},{}],122:[function(t,e,r){"use strict";function n(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function i(t){this.gl=t,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont="sans-serif",this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=c(t)}function a(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}function o(t,e,r,n,i){for(var a=t.primalOffset,o=t.primalMinor,s=t.mirrorOffset,l=t.mirrorMinor,u=n[e],c=0;c<3;++c)if(e!==c){var h=a,f=s,d=o,p=l;u&1<<c&&(h=s,f=a,d=l,p=o),h[c]=r[0][c],f[c]=r[1][c],i[c]>0?(d[c]=-1,p[c]=0):(d[c]=0,p[c]=1)}}function s(t,e){var r=new i(t);return r.update(e),r}e.exports=s;var l=t("./lib/text.js"),u=t("./lib/lines.js"),c=t("./lib/background.js"),h=t("./lib/cube.js"),f=t("./lib/ticks.js"),d=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),p=i.prototype;p.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?Array.isArray(a)&&Array.isArray(a[0]):Array.isArray(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}t=t||{};var r,n=e.bind(this,!1,Number),i=e.bind(this,!1,Boolean),a=e.bind(this,!1,String),o=e.bind(this,!0,function(t){if(Array.isArray(t)){if(3===t.length)return[+t[0],+t[1],+t[2],1];if(4===t.length)return[+t[0],+t[1],+t[2],+t[3]]}return[0,0,0,1]}),s=!1,c=!1;if("bounds"in t)for(var h=t.bounds,d=0;d<2;++d)for(var p=0;p<3;++p)h[d][p]!==this.bounds[d][p]&&(c=!0),this.bounds[d][p]=h[d][p];if("ticks"in t){r=t.ticks,s=!0,this.autoTicks=!1;for(var d=0;d<3;++d)this.tickSpacing[d]=0}else n("tickSpacing")&&(this.autoTicks=!0,c=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),c=!0,s=!0,this._firstInit=!1),c&&this.autoTicks&&(r=f.create(this.bounds,this.tickSpacing),s=!0),s){for(var d=0;d<3;++d)r[d].sort(function(t,e){return t.x-e.x});f.equal(r,this.ticks)?s=!1:this.ticks=r}i("tickEnable"),a("tickFont")&&(s=!0),n("tickSize"),n("tickAngle"),n("tickPad"),o("tickColor");var m=a("labels");a("labelFont")&&(m=!0),i("labelEnable"),n("labelSize"),n("labelPad"),o("labelColor"),i("lineEnable"),i("lineMirror"),n("lineWidth"),o("lineColor"),i("lineTickEnable"),i("lineTickMirror"),n("lineTickLength"),n("lineTickWidth"),o("lineTickColor"),i("gridEnable"),n("gridWidth"),o("gridColor"),i("zeroEnable"),o("zeroLineColor"),n("zeroLineWidth"),i("backgroundEnable"),o("backgroundColor"),this._text?this._text&&(m||s)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=l(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&s&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=u(this.gl,this.bounds,this.ticks))};var m=[new a,new a,new a],g=[0,0,0],v={model:d,view:d,projection:d};p.isOpaque=function(){return!0},p.isTransparent=function(){return!1},p.drawTransparent=function(t){};var y=[0,0,0],x=[0,0,0],b=[0,0,0];p.draw=function(t){t=t||v;for(var e=this.gl,r=t.model||d,i=t.view||d,a=t.projection||d,s=this.bounds,l=h(r,i,a,s),u=l.cubeEdges,c=l.axis,f=i[12],p=i[13],_=i[14],w=i[15],M=this.pixelRatio*(a[3]*f+a[7]*p+a[11]*_+a[15]*w)/e.drawingBufferHeight,A=0;A<3;++A)this.lastCubeProps.cubeEdges[A]=u[A],this.lastCubeProps.axis[A]=c[A];for(var k=m,A=0;A<3;++A)o(m[A],A,this.bounds,u,c);for(var e=this.gl,T=g,A=0;A<3;++A)this.backgroundEnable[A]?T[A]=c[A]:T[A]=0;this._background.draw(r,i,a,s,T,this.backgroundColor),this._lines.bind(r,i,a,this);for(var A=0;A<3;++A){var E=[0,0,0];c[A]>0?E[A]=s[1][A]:E[A]=s[0][A];for(var S=0;S<2;++S){var L=(A+1+S)%3,C=(A+1+(1^S))%3;this.gridEnable[L]&&this._lines.drawGrid(L,C,this.bounds,E,this.gridColor[L],this.gridWidth[L]*this.pixelRatio)}for(var S=0;S<2;++S){var L=(A+1+S)%3,C=(A+1+(1^S))%3;this.zeroEnable[C]&&s[0][C]<=0&&s[1][C]>=0&&this._lines.drawZero(L,C,this.bounds,E,this.zeroLineColor[C],this.zeroLineWidth[C]*this.pixelRatio)}}for(var A=0;A<3;++A){this.lineEnable[A]&&this._lines.drawAxisLine(A,this.bounds,k[A].primalOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio),this.lineMirror[A]&&this._lines.drawAxisLine(A,this.bounds,k[A].mirrorOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio);for(var I=n(y,k[A].primalMinor),z=n(x,k[A].mirrorMinor),D=this.lineTickLength,S=0;S<3;++S){var P=M/r[5*S];I[S]*=D[S]*P,z[S]*=D[S]*P}this.lineTickEnable[A]&&this._lines.drawAxisTicks(A,k[A].primalOffset,I,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio),this.lineTickMirror[A]&&this._lines.drawAxisTicks(A,k[A].mirrorOffset,z,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio)}this._text.bind(r,i,a,this.pixelRatio);for(var A=0;A<3;++A){for(var O=k[A].primalMinor,R=n(b,k[A].primalOffset),S=0;S<3;++S)this.lineTickEnable[A]&&(R[S]+=M*O[S]*Math.max(this.lineTickLength[S],0)/r[5*S]);if(this.tickEnable[A]){for(var S=0;S<3;++S)R[S]+=M*O[S]*this.tickPad[S]/r[5*S];this._text.drawTicks(A,this.tickSize[A],this.tickAngle[A],R,this.tickColor[A])}if(this.labelEnable[A]){for(var S=0;S<3;++S)R[S]+=M*O[S]*this.labelPad[S]/r[5*S];R[A]+=.5*(s[0][A]+s[1][A]),this._text.drawLabel(A,this.labelSize[A],this.labelAngle[A],R,this.labelColor[A])}}},p.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{"./lib/background.js":123,"./lib/cube.js":124,"./lib/lines.js":125,"./lib/text.js":127,"./lib/ticks.js":128}],123:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}function i(t){for(var e=[],r=[],i=0,l=0;l<3;++l)for(var u=(l+1)%3,c=(l+2)%3,h=[0,0,0],f=[0,0,0],d=-1;d<=1;d+=2){r.push(i,i+2,i+1,i+1,i+2,i+3),h[l]=d,f[l]=d;for(var p=-1;p<=1;p+=2){h[u]=p;for(var m=-1;m<=1;m+=2)h[c]=m,e.push(h[0],h[1],h[2],f[0],f[1],f[2]),i+=1}var g=u;u=c,c=g}var v=a(t,new Float32Array(e)),y=a(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),x=o(t,[{buffer:v,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:v,type:t.FLOAT,size:3,offset:12,stride:24}],y),b=s(t);return b.attributes.position.location=0,b.attributes.normal.location=1,new n(t,v,x,b)}e.exports=i;var a=t("gl-buffer"),o=t("gl-vao"),s=t("./shaders").bg,l=n.prototype;l.draw=function(t,e,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),l.disable(l.POLYGON_OFFSET_FILL)}},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":126,"gl-buffer":130,"gl-vao":241}],124:[function(t,e,r){"use strict";function n(t,e,r){for(var n=0;n<4;++n){t[n]=r[12+n];for(var i=0;i<3;++i)t[n]+=e[i]*r[4*i+n]}}function i(t){for(var e=0;e<m.length;++e)if(t=l.positive(t,m[e]),t.length<3)return 0;for(var r=t[0],n=r[0]/r[3],i=r[1]/r[3],a=0,e=1;e+1<t.length;++e){var o=t[e],s=t[e+1],u=o[0]/o[3],c=o[1]/o[3],h=s[0]/s[3],f=s[1]/s[3],d=u-n,p=c-i,g=h-n,v=f-i;a+=Math.abs(d*v-p*g)}return a}function a(t,e,r,a){s(c,e,t),s(c,r,c);for(var l=0,m=0;m<2;++m){d[2]=a[m][2];for(var x=0;x<2;++x){d[1]=a[x][1];for(var b=0;b<2;++b)d[0]=a[b][0],n(h[l],d,c),l+=1}}for(var _=-1,m=0;m<8;++m){for(var w=h[m][3],M=0;M<3;++M)f[m][M]=h[m][M]/w;w<0&&(_<0?_=m:f[m][2]<f[_][2]&&(_=m))}if(_<0){_=0;for(var A=0;A<3;++A){for(var k=(A+2)%3,T=(A+1)%3,E=-1,S=-1,L=0;L<2;++L){var C=L<<A,I=C+(L<<k)+(1-L<<T),z=C+(1-L<<k)+(L<<T);u(f[C],f[I],f[z],p)<0||(L?E=1:S=1)}if(E<0||S<0)S>E&&(_|=1<<A);else{for(var L=0;L<2;++L){var C=L<<A,I=C+(L<<k)+(1-L<<T),z=C+(1-L<<k)+(L<<T),D=i([h[C],h[I],h[z],h[C+(1<<k)+(1<<T)]]);L?E=D:S=D}S>E&&(_|=1<<A)}}}for(var P=7^_,O=-1,m=0;m<8;++m)m!==_&&m!==P&&(O<0?O=m:f[O][1]>f[m][1]&&(O=m));for(var R=-1,m=0;m<3;++m){var F=O^1<<m;if(F!==_&&F!==P){R<0&&(R=F);var T=f[F];T[0]<f[R][0]&&(R=F)}}for(var j=-1,m=0;m<3;++m){var F=O^1<<m;if(F!==_&&F!==P&&F!==R){j<0&&(j=F);var T=f[F];T[0]>f[j][0]&&(j=F)}}var N=g;N[0]=N[1]=N[2]=0,N[o.log2(R^O)]=O&R,N[o.log2(O^j)]=O&j;var B=7^j;B===_||B===P?(B=7^R,N[o.log2(j^B)]=B&j):N[o.log2(R^B)]=B&R;for(var U=v,V=_,A=0;A<3;++A)V&1<<A?U[A]=-1:U[A]=1;return y}e.exports=a;var o=t("bit-twiddle"),s=t("gl-mat4/multiply"),l=(t("gl-mat4/invert"),t("split-polygon")),u=t("robust-orientation"),c=new Array(16),h=(new Array(16),new Array(8)),f=new Array(8),d=new Array(3),p=[0,0,0];!function(){for(var t=0;t<8;++t)h[t]=[1,1,1,1],f[t]=[1,1,1]}();var m=[[0,0,1,0,0],[0,0,-1,1,0],[0,-1,0,1,0],[0,1,0,1,0],[-1,0,0,1,0],[1,0,0,1,0]],g=[1,1,1],v=[0,0,0],y={cubeEdges:g,axis:v}},{"bit-twiddle":56,"gl-mat4/invert":154,"gl-mat4/multiply":156,"robust-orientation":471,"split-polygon":489}],125:[function(t,e,r){"use strict";function n(t){return t[0]=t[1]=t[2]=0,t}function i(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function a(t,e,r,n,i,a,o,s){this.gl=t,this.vertBuffer=e,this.vao=r,this.shader=n,this.tickCount=i,this.tickOffset=a,this.gridCount=o,this.gridOffset=s}function o(t,e,r){var n=[],i=[0,0,0],o=[0,0,0],c=[0,0,0],h=[0,0,0];n.push(0,0,1,0,1,1,0,0,-1,0,0,-1,0,1,1,0,1,-1);for(var f=0;f<3;++f){for(var d=n.length/3|0,p=0;p<r[f].length;++p){var m=+r[f][p].x;n.push(m,0,1,m,1,1,m,0,-1,m,0,-1,m,1,1,m,1,-1)}var g=n.length/3|0;i[f]=d,o[f]=g-d;for(var d=n.length/3|0,v=0;v<r[f].length;++v){var m=+r[f][v].x;n.push(m,0,1,m,1,1,m,0,-1,m,0,-1,m,1,1,m,1,-1)}var g=n.length/3|0;c[f]=d,h[f]=g-d}var y=s(t,new Float32Array(n)),x=l(t,[{buffer:y,type:t.FLOAT,size:3,stride:0,offset:0}]),b=u(t);return b.attributes.position.location=0,new a(t,y,x,b,o,i,h,c)}e.exports=o;var s=t("gl-buffer"),l=t("gl-vao"),u=t("./shaders").line,c=[0,0,0],h=[0,0,0],f=[0,0,0],d=[0,0,0],p=[1,1],m=a.prototype;m.bind=function(t,e,r){this.shader.bind(),this.shader.uniforms.model=t,this.shader.uniforms.view=e,this.shader.uniforms.projection=r,p[0]=this.gl.drawingBufferWidth,p[1]=this.gl.drawingBufferHeight,this.shader.uniforms.screenShape=p,this.vao.bind()},m.drawAxisLine=function(t,e,r,a,o){var s=n(h);this.shader.uniforms.majorAxis=h,s[t]=e[1][t]-e[0][t],this.shader.uniforms.minorAxis=s;var l=i(d,r);l[t]+=e[0][t],this.shader.uniforms.offset=l,this.shader.uniforms.lineWidth=o,this.shader.uniforms.color=a;var u=n(f);u[(t+2)%3]=1,this.shader.uniforms.screenAxis=u,this.vao.draw(this.gl.TRIANGLES,6);var u=n(f);u[(t+1)%3]=1,this.shader.uniforms.screenAxis=u,this.vao.draw(this.gl.TRIANGLES,6)},m.drawAxisTicks=function(t,e,r,i,a){if(this.tickCount[t]){var o=n(c);o[t]=1,this.shader.uniforms.majorAxis=o,this.shader.uniforms.offset=e,this.shader.uniforms.minorAxis=r,this.shader.uniforms.color=i,this.shader.uniforms.lineWidth=a;var s=n(f);s[t]=1,this.shader.uniforms.screenAxis=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[t],this.tickOffset[t])}},m.drawGrid=function(t,e,r,a,o,s){if(this.gridCount[t]){var l=n(h);l[e]=r[1][e]-r[0][e],this.shader.uniforms.minorAxis=l;var u=i(d,a);u[e]+=r[0][e],this.shader.uniforms.offset=u;var p=n(c);p[t]=1,this.shader.uniforms.majorAxis=p;var m=n(f);m[t]=1,this.shader.uniforms.screenAxis=m,this.shader.uniforms.lineWidth=s,this.shader.uniforms.color=o,this.vao.draw(this.gl.TRIANGLES,this.gridCount[t],this.gridOffset[t])}},m.drawZero=function(t,e,r,a,o,s){var l=n(h);this.shader.uniforms.majorAxis=l,l[t]=r[1][t]-r[0][t],this.shader.uniforms.minorAxis=l;var u=i(d,a);u[t]+=r[0][t],this.shader.uniforms.offset=u;var c=n(f);c[e]=1,this.shader.uniforms.screenAxis=c,this.shader.uniforms.lineWidth=s,this.shader.uniforms.color=o,this.vao.draw(this.gl.TRIANGLES,6)},m.dispose=function(){this.vao.dispose(),this.vertBuffer.dispose(),this.shader.dispose()}},{"./shaders":126,"gl-buffer":130,"gl-vao":241}],126:[function(t,e,r){"use strict";var n=t("gl-shader"),i="#define GLSLIFY 1\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\nuniform vec3 offset, majorAxis, minorAxis, screenAxis;\nuniform float lineWidth;\nuniform vec2 screenShape;\n\nvec3 project(vec3 p) {\n  vec4 pp = projection * view * model * vec4(p, 1.0);\n  return pp.xyz / max(pp.w, 0.0001);\n}\n\nvoid main() {\n  vec3 major = position.x * majorAxis;\n  vec3 minor = position.y * minorAxis;\n\n  vec3 vPosition = major + minor + offset;\n  vec3 pPosition = project(vPosition);\n  vec3 offset = project(vPosition + screenAxis * position.z);\n\n  vec2 screen = normalize((offset - pPosition).xy * screenShape) / screenShape;\n\n  gl_Position = vec4(pPosition + vec3(0.5 * screen * lineWidth, 0), 1.0);\n}\n",a="precision mediump float;\n#define GLSLIFY 1\nuniform vec4 color;\nvoid main() {\n  gl_FragColor = color;\n}";r.line=function(t){return n(t,i,a,null,[{name:"position",type:"vec3"}])};var o="#define GLSLIFY 1\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\nuniform vec3 offset, axis;\nuniform float scale, angle, pixelScale;\nuniform vec2 resolution;\n\nvoid main() {  \n  //Compute plane offset\n  vec2 planeCoord = position.xy * pixelScale;\n  mat2 planeXform = scale * mat2(cos(angle), sin(angle),\n                                -sin(angle), cos(angle));\n  vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n  //Compute world offset\n  float axisDistance = position.z;\n  vec3 dataPosition = axisDistance * axis + offset;\n  vec4 worldPosition = model * vec4(dataPosition, 1);\n  \n  //Compute clip position\n  vec4 viewPosition = view * worldPosition;\n  vec4 clipPosition = projection * viewPosition;\n  clipPosition /= clipPosition.w;\n\n  //Apply text offset in clip coordinates\n  clipPosition += vec4(viewOffset, 0, 0);\n\n  //Done\n  gl_Position = clipPosition;\n}",s="precision mediump float;\n#define GLSLIFY 1\nuniform vec4 color;\nvoid main() {\n  gl_FragColor = color;\n}";r.text=function(t){return n(t,o,s,null,[{name:"position",type:"vec3"}])};var l="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection;\nuniform vec3 enable;\nuniform vec3 bounds[2];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n  if(dot(normal, enable) > 0.0) {\n    vec3 nPosition = mix(bounds[0], bounds[1], 0.5 * (position + 1.0));\n    gl_Position = projection * view * model * vec4(nPosition, 1.0);\n  } else {\n    gl_Position = vec4(0,0,0,0);\n  }\n  colorChannel = abs(normal);\n}",u="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n  gl_FragColor = colorChannel.x * colors[0] + \n                 colorChannel.y * colors[1] +\n                 colorChannel.z * colors[2];\n}";r.bg=function(t){return n(t,l,u,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":225}],127:[function(t,e,r){(function(r){"use strict";function n(t,e,r,n){this.gl=t,this.shader=e,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}function i(t,e){try{return l(t,e)}catch(t){return console.warn("error vectorizing text:",t),{cells:[],positions:[]}}}function a(t,e,r,i,a,l){var c=o(t),h=s(t,[{buffer:c,size:3}]),f=u(t);f.attributes.position.location=0;var d=new n(t,f,c,h);return d.update(e,r,i,a,l),d}e.exports=a;var o=t("gl-buffer"),s=t("gl-vao"),l=t("vectorize-text"),u=t("./shaders").text,c=window||r.global||{},h=c.__TEXT_CACHE||{};c.__TEXT_CACHE={};var f=3,d=n.prototype,p=[0,0];d.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=t,i.view=e,i.projection=r,i.pixelScale=n,p[0]=this.gl.drawingBufferWidth,p[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=p},d.update=function(t,e,r,n,a){function o(t,e,r,n){var a=h[r];a||(a=h[r]={});var o=a[e];o||(o=a[e]=i(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle"}));for(var l=(n||12)/12,u=o.positions,c=o.cells,f=0,d=c.length;f<d;++f)for(var p=c[f],m=2;m>=0;--m){var g=u[p[m]];s.push(l*g[0],-l*g[1],t)}}for(var s=(this.gl,[]),l=[0,0,0],u=[0,0,0],c=[0,0,0],d=[0,0,0],p=0;p<3;++p){c[p]=s.length/f|0,o(.5*(t[0][p]+t[1][p]),e[p],r),d[p]=(s.length/f|0)-c[p],l[p]=s.length/f|0;for(var m=0;m<n[p].length;++m)n[p][m].text&&o(n[p][m].x,n[p][m].text,n[p][m].font||a,n[p][m].fontSize||12);u[p]=(s.length/f|0)-l[p]}this.buffer.update(s),this.tickOffset=l,this.tickCount=u,this.labelOffset=c,this.labelCount=d};var m=[0,0,0];d.drawTicks=function(t,e,r,n,i){if(this.tickCount[t]){var a=m;a[0]=a[1]=a[2]=0,a[t]=1,this.shader.uniforms.axis=a,this.shader.uniforms.color=i,this.shader.uniforms.angle=r,this.shader.uniforms.scale=e,this.shader.uniforms.offset=n,this.vao.draw(this.gl.TRIANGLES,this.tickCount[t],this.tickOffset[t])}};var g=[0,0,0];d.drawLabel=function(t,e,r,n,i){this.labelCount[t]&&(this.shader.uniforms.axis=g,this.shader.uniforms.color=i,this.shader.uniforms.angle=r,this.shader.uniforms.scale=e,this.shader.uniforms.offset=n,this.vao.draw(this.gl.TRIANGLES,this.labelCount[t],this.labelOffset[t]))},d.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()}}).call(this,t("_process"))},{"./shaders":126,_process:451,"gl-buffer":130,"gl-vao":241,"vectorize-text":515}],128:[function(t,e,r){"use strict";function n(t,e){var r=t+"",n=r.indexOf("."),i=0;n>=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(t*e*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,u=o%a;o<0?(l=0|-Math.ceil(l),u=0|-u):(l=0|Math.floor(l),u|=0);var c=""+l;if(o<0&&(c="-"+c),i){for(var h=""+u;h.length<i;)h="0"+h;return c+"."+h}return c}function i(t,e){for(var r=[],i=0;i<3;++i){for(var a=[],o=(.5*(t[0][i]+t[1][i]),0);o*e[i]<=t[1][i];++o)a.push({x:o*e[i],text:n(e[i],o)});for(var o=-1;o*e[i]>=t[0][i];--o)a.push({x:o*e[i],text:n(e[i],o)});r.push(a)}return r}function a(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;++n){var i=t[r][n],a=e[r][n];if(i.x!==a.x||i.text!==a.text||i.font!==a.font||i.fontColor!==a.fontColor||i.fontSize!==a.fontSize||i.dx!==a.dx||i.dy!==a.dy)return!1}}return!0}r.create=i,r.equal=a},{}],129:[function(t,e,r){"use strict";function n(t,e,r){this.lo=t,this.hi=e,this.pixelsPerDataUnit=r}function i(t,e,r,n,i){for(var a=0;a<3;++a){for(var o=p,s=m,l=0;l<3;++l)s[l]=o[l]=r[l];s[3]=o[3]=1,s[a]+=1,h(s,s,e),s[3]<0&&(t[a]=1/0),o[a]-=1,h(o,o,e),o[3]<0&&(t[a]=1/0);var u=(o[0]/o[3]-s[0]/s[3])*n,c=(o[1]/o[3]-s[1]/s[3])*i;t[a]=.25*Math.sqrt(u*u+c*c)}return t}function a(t,e,r,n,a){var h=e.model||f,p=e.view||f,m=e.projection||f,y=t.bounds,a=a||l(h,p,m,y),x=a.axis;a.edges;u(d,p,h),u(d,m,d);for(var b=g,_=0;_<3;++_)b[_].lo=1/0,b[_].hi=-(1/0),b[_].pixelsPerDataUnit=1/0;var w=o(c(d,d));c(d,d);for(var M=0;M<3;++M){var A=(M+1)%3,k=(M+2)%3,T=v;t:for(var _=0;_<2;++_){var E=[];if(x[M]<0!=!!_){T[M]=y[_][M];for(var S=0;S<2;++S){T[A]=y[S^_][A];for(var L=0;L<2;++L)T[k]=y[L^S^_][k],E.push(T.slice())}for(var S=0;S<w.length;++S){if(0===E.length)continue t;E=s.positive(E,w[S])}for(var S=0;S<E.length;++S)for(var k=E[S],C=i(v,d,k,r,n),L=0;L<3;++L)b[L].lo=Math.min(b[L].lo,k[L]),b[L].hi=Math.max(b[L].hi,k[L]),L!==M&&(b[L].pixelsPerDataUnit=Math.min(b[L].pixelsPerDataUnit,Math.abs(C[L])))}}}return b}e.exports=a;var o=t("extract-frustum-planes"),s=t("split-polygon"),l=t("./lib/cube.js"),u=t("gl-mat4/multiply"),c=t("gl-mat4/transpose"),h=t("gl-vec4/transformMat4"),f=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),d=new Float32Array(16),p=[0,0,0,1],m=[0,0,0,1],g=[new n(1/0,-(1/0),1/0),new n(1/0,-(1/0),1/0),new n(1/0,-(1/0),1/0)],v=[0,0,0]},{"./lib/cube.js":124,"extract-frustum-planes":105,"gl-mat4/multiply":156,"gl-mat4/transpose":164,"gl-vec4/transformMat4":247,"split-polygon":489}],130:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.gl=t,this.type=e,this.handle=r,this.length=n,this.usage=i}function i(t,e,r,n,i,a){var o=i.length*i.BYTES_PER_ELEMENT;if(a<0)return t.bufferData(e,i,n),o;if(o+a>r)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,a,i),r}function a(t,e){for(var r=l.malloc(t.length,e),n=t.length,i=0;i<n;++i)r[i]=t[i];return r}function o(t,e){for(var r=1,n=e.length-1;n>=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}function s(t,e,r,i){if(r=r||t.ARRAY_BUFFER,i=i||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(i!==t.DYNAMIC_DRAW&&i!==t.STATIC_DRAW&&i!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var a=t.createBuffer(),o=new n(t,r,a,0,i);return o.update(e),o}var l=t("typedarray-pool"),u=t("ndarray-ops"),c=t("ndarray"),h=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"],f=n.prototype;f.bind=function(){this.gl.bindBuffer(this.type,this.handle)},f.unbind=function(){this.gl.bindBuffer(this.type,null)},f.dispose=function(){this.gl.deleteBuffer(this.handle)},f.update=function(t,e){if("number"!=typeof e&&(e=-1),this.bind(),"object"==typeof t&&"undefined"!=typeof t.shape){var r=t.dtype;if(h.indexOf(r)<0&&(r="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){var n=gl.getExtension("OES_element_index_uint");r=n&&"uint16"!==r?"uint32":"uint16"}if(r===t.dtype&&o(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=i(this.gl,this.type,this.length,this.usage,t.data,e):this.length=i(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=l.malloc(t.size,r),f=c(s,t.shape);u.assign(f,t),e<0?this.length=i(this.gl,this.type,this.length,this.usage,s,e):this.length=i(this.gl,this.type,this.length,this.usage,s.subarray(0,t.size),e),l.free(s)}}else if(Array.isArray(t)){var d;d=this.type===this.gl.ELEMENT_ARRAY_BUFFER?a(t,"uint16"):a(t,"float32"),e<0?this.length=i(this.gl,this.type,this.length,this.usage,d,e):this.length=i(this.gl,this.type,this.length,this.usage,d.subarray(0,t.length),e),l.free(d)}else if("object"==typeof t&&"number"==typeof t.length)this.length=i(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");t|=0,t<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=s},{ndarray:432,"ndarray-ops":426,"typedarray-pool":502}],131:[function(t,e,r){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34000:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},{}],132:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":131}],133:[function(t,e,r){"use strict";function n(t,e,r,n){this.plot=t,this.shader=e,this.bufferHi=r,this.bufferLo=n,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.numPoints=0,this.color=[0,0,0,1]}function i(t,e){var r=a(t.gl,l.vertex,l.fragment),i=o(t.gl),s=o(t.gl),u=new n(t,r,i,s);return u.update(e),t.addObject(u),u}var a=t("gl-shader"),o=t("gl-buffer"),s=t("typedarray-pool"),l=t("./lib/shaders");e.exports=i;var u=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]],c=n.prototype;c.draw=function(){var t=new Float32Array([0,0]),e=new Float32Array([0,0]),r=new Float32Array([0,0]),n=new Float32Array([0,0]),i=[1,1];return function(){var a=this.plot,o=this.shader,s=this.bounds,l=this.numPoints;if(l){var c=a.gl,h=a.dataBox,f=a.viewBox,d=a.pixelRatio,p=s[2]-s[0],m=s[3]-s[1],g=h[2]-h[0],v=h[3]-h[1],y=2*p/g,x=2*m/v,b=(s[0]-h[0]-.5*g)/p,_=(s[1]-h[1]-.5*v)/m;t[0]=y,t[1]=x,e[0]=y-t[0],e[1]=x-t[1],r[0]=b,r[1]=_,n[0]=b-r[0],n[1]=_-r[1];var w=f[2]-f[0],M=f[3]-f[1];i[0]=2*d/w,i[1]=2*d/M,o.bind(),o.uniforms.scaleHi=t,o.uniforms.scaleLo=e,o.uniforms.translateHi=r,o.uniforms.translateLo=n,o.uniforms.pixelScale=i,o.uniforms.color=this.color,this.bufferLo.bind(),o.attributes.positionLo.pointer(c.FLOAT,!1,16,0),this.bufferHi.bind(),o.attributes.positionHi.pointer(c.FLOAT,!1,16,0),o.attributes.pixelOffset.pointer(c.FLOAT,!1,16,8),c.drawArrays(c.TRIANGLES,0,l*u.length)}}}(),c.drawPick=function(t){return t},c.pick=function(){return null},c.update=function(t){t=t||{};var e,r,n,i=t.positions||[],a=t.errors||[],o=1;"lineWidth"in t&&(o=+t.lineWidth);var l=5;"capSize"in t&&(l=+t.capSize),this.color=(t.color||[0,0,0,1]).slice();var c=this.bounds=[1/0,1/0,-(1/0),-(1/0)],h=this.numPoints=i.length>>1;for(e=0;e<h;++e)r=i[2*e],n=i[2*e+1],c[0]=Math.min(r,c[0]),c[1]=Math.min(n,c[1]),c[2]=Math.max(r,c[2]),c[3]=Math.max(n,c[3]);c[2]===c[0]&&(c[2]+=1),c[3]===c[1]&&(c[3]+=1);var f=1/(c[2]-c[0]),d=1/(c[3]-c[1]),p=c[0],m=c[1],g=s.mallocFloat64(h*u.length*4),v=s.mallocFloat32(h*u.length*4),y=s.mallocFloat32(h*u.length*4),x=0;for(e=0;e<h;++e){r=i[2*e],n=i[2*e+1];for(var b=a[4*e],_=a[4*e+1],w=a[4*e+2],M=a[4*e+3],A=0;A<u.length;++A){var k=u[A],T=k[0],E=k[1];T<0?T*=b:T>0&&(T*=_),E<0?E*=w:E>0&&(E*=M),g[x++]=f*(r-p+T),g[x++]=d*(n-m+E),g[x++]=o*k[2]+(l+o)*k[4],g[x++]=o*k[3]+(l+o)*k[5]}}for(e=0;e<g.length;e++)v[e]=g[e],y[e]=g[e]-v[e];this.bufferHi.update(v),this.bufferLo.update(y),s.free(g)},c.dispose=function(){this.plot.removeObject(this),this.shader.dispose(),this.bufferHi.dispose(),this.bufferLo.dispose()}},{"./lib/shaders":134,"gl-buffer":130,"gl-shader":225,"typedarray-pool":502}],134:[function(t,e,r){e.exports={vertex:"precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 positionHi;\nattribute vec2 positionLo;\nattribute vec2 pixelOffset;\n\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo, pixelScale;\n\nvec2 project(vec2 scHi, vec2 trHi, vec2 scLo, vec2 trLo, vec2 posHi, vec2 posLo) {\n  return (posHi + trHi) * scHi\n       + (posLo + trLo) * scHi\n       + (posHi + trHi) * scLo\n       + (posLo + trLo) * scLo;\n}\n\nvoid main() {\n  vec3 scrPosition = vec3(\n         project(scaleHi, translateHi, scaleLo, translateLo, positionHi, positionLo),\n         1);\n  gl_Position = vec4(\n    scrPosition.xy + scrPosition.z * pixelScale * pixelOffset,\n    0,\n    scrPosition.z);\n}\n",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color;\n\nvoid main() {\n  gl_FragColor = vec4(color.rgb * color.a, color.a);\n}\n"}},{}],135:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],this.clipBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1}function i(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}function a(t,e,r,n){for(var i=f[n],a=0;a<i.length;++a){var o=i[a];t.push(e[0],e[1],e[2],r[0],r[1],r[2],r[3],o[0],o[1],o[2])}return i.length}function o(t){var e=t.gl,r=s(e),i=l(e,[{buffer:r,type:e.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:e.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:e.FLOAT,size:3,offset:28,stride:40}]),a=u(e);a.attributes.position.location=0,a.attributes.color.location=1,a.attributes.offset.location=2;var o=new n(e,r,i,a);return o.update(t),o}e.exports=o;var s=t("gl-buffer"),l=t("gl-vao"),u=t("./shaders/index"),c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],h=n.prototype;h.isOpaque=function(){return this.opacity>=1},h.isTransparent=function(){return this.opacity<1},h.drawTransparent=h.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||c,i=r.projection=t.projection||c;r.model=t.model||c,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],o=n[13],s=n[14],l=n[15],u=this.pixelRatio*(i[3]*a+i[7]*o+i[11]*s+i[15]*l)/e.drawingBufferHeight;this.vao.bind();for(var h=0;h<3;++h)e.lineWidth(this.lineWidth[h]),r.capSize=this.capSize[h]*u,e.drawArrays(e.LINES,this.lineOffset[h],this.lineCount[h]);this.vao.unbind()};var f=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=(n+e)%3,o=[0,0,0];o[a]=i,r.push(o)}t[e]=r}return t}();h.update=function(t){t=t||{},"lineWidth"in t&&(this.lineWidth=t.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),"capSize"in t&&(this.capSize=t.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),"opacity"in t&&(this.opacity=t.opacity);var e=t.color||[[0,0,0],[0,0,0],[0,0,0]],r=t.position,n=t.error;if(Array.isArray(e[0])||(e=[e,e,e]),r&&n){var o=[],s=r.length,l=0;this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],this.lineCount=[0,0,0];for(var u=0;u<3;++u){this.lineOffset[u]=l;t:for(var c=0;c<s;++c){for(var h=r[c],f=0;f<3;++f)if(isNaN(h[f])||!isFinite(h[f]))continue t;var d=n[c],p=e[u];if(Array.isArray(p[0])&&(p=e[c]),3===p.length&&(p=[p[0],p[1],p[2],1]),!isNaN(d[0][u])&&!isNaN(d[1][u])){if(d[0][u]<0){var m=h.slice();m[u]+=d[0][u],o.push(h[0],h[1],h[2],p[0],p[1],p[2],p[3],0,0,0,m[0],m[1],m[2],p[0],p[1],p[2],p[3],0,0,0),i(this.bounds,m),l+=2+a(o,m,p,u)}if(d[1][u]>0){var m=h.slice();m[u]+=d[1][u],o.push(h[0],h[1],h[2],p[0],p[1],p[2],p[3],0,0,0,m[0],m[1],m[2],p[0],p[1],p[2],p[3],0,0,0),i(this.bounds,m),l+=2+a(o,m,p,u)}}}this.lineCount[u]=l-this.lineOffset[u]}this.buffer.update(o)}},h.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":136,"gl-buffer":130,"gl-vao":241}],136:[function(t,e,r){"use strict";var n=t("gl-shader"),i="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n  vec4 worldPosition  = model * vec4(position, 1.0);\n  worldPosition       = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n  gl_Position         = projection * view * worldPosition;\n  fragColor           = color;\n  fragPosition        = position;\n}",a="precision mediump float;\n#define GLSLIFY 1\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n  if(any(lessThan(fragPosition, clipBounds[0])) || any(greaterThan(fragPosition, clipBounds[1]))) {\n    discard;\n  }\n  gl_FragColor = opacity * fragColor;\n}";e.exports=function(t){return n(t,i,a,null,[{name:"position",type:"vec3"},{name:"offset",type:"vec3"},{name:"color",type:"vec4"}])}},{"gl-shader":225}],137:[function(t,e,r){"use strict";function n(t){var e=t.getParameter(t.FRAMEBUFFER_BINDING),r=t.getParameter(t.RENDERBUFFER_BINDING),n=t.getParameter(t.TEXTURE_BINDING_2D);return[e,r,n]}function i(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function a(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);y=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;a<n;++a)i[a]=t.COLOR_ATTACHMENT0+a;for(var a=n;a<r;++a)i[a]=t.NONE;y[n]=i}}function o(t){switch(t){case p:throw new Error("gl-fbo: Framebuffer unsupported");case m:throw new Error("gl-fbo: Framebuffer incomplete attachment");case g:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case v:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function s(t,e,r,n,i,a){if(!n)return null;var o=d(t,e,r,i,n);return o.magFilter=t.NEAREST,o.minFilter=t.NEAREST,o.mipSamples=1,o.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,a,t.TEXTURE_2D,o.handle,0),o}function l(t,e,r,n,i){var a=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,a),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,i,t.RENDERBUFFER,a),a}function u(t){var e=n(t.gl),r=t.gl,a=t.handle=r.createFramebuffer(),u=t._shape[0],c=t._shape[1],h=t.color.length,f=t._ext,d=t._useStencil,p=t._useDepth,m=t._colorType;r.bindFramebuffer(r.FRAMEBUFFER,a);for(var g=0;g<h;++g)t.color[g]=s(r,u,c,m,r.RGBA,r.COLOR_ATTACHMENT0+g);0===h?(t._color_rb=l(r,u,c,r.RGBA4,r.COLOR_ATTACHMENT0),f&&f.drawBuffersWEBGL(y[0])):h>1&&f.drawBuffersWEBGL(y[h]);var v=r.getExtension("WEBGL_depth_texture");v?d?t.depth=s(r,u,c,v.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p&&(t.depth=s(r,u,c,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):p&&d?t._depth_rb=l(r,u,c,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p?t._depth_rb=l(r,u,c,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=l(r,u,c,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==r.FRAMEBUFFER_COMPLETE){t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null);for(var g=0;g<t.color.length;++g)t.color[g].dispose(),t.color[g]=null;t._color_rb&&(r.deleteRenderbuffer(t._color_rb),t._color_rb=null),i(r,e),o(x)}i(r,e)}function c(t,e,r,n,i,a,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var l=0;l<i;++l)this.color[l]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=n,this._useDepth=a,this._useStencil=o;var c=this,h=[0|e,0|r];Object.defineProperties(h,{0:{get:function(){return c._shape[0]},set:function(t){return c.width=t}},1:{get:function(){return c._shape[1]},set:function(t){return c.height=t}}}),this._shapeVector=h,u(this)}function h(t,e,r){if(t._destroyed)throw new Error("gl-fbo: Can't resize destroyed FBO");if(t._shape[0]!==e||t._shape[1]!==r){var a=t.gl,s=a.getParameter(a.MAX_RENDERBUFFER_SIZE);if(e<0||e>s||r<0||r>s)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var l=n(a),u=0;u<t.color.length;++u)t.color[u].shape=t._shape;t._color_rb&&(a.bindRenderbuffer(a.RENDERBUFFER,t._color_rb),a.renderbufferStorage(a.RENDERBUFFER,a.RGBA4,t._shape[0],t._shape[1])),t.depth&&(t.depth.shape=t._shape),t._depth_rb&&(a.bindRenderbuffer(a.RENDERBUFFER,t._depth_rb),t._useDepth&&t._useStencil?a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_STENCIL,t._shape[0],t._shape[1]):t._useDepth?a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_COMPONENT16,t._shape[0],t._shape[1]):t._useStencil&&a.renderbufferStorage(a.RENDERBUFFER,a.STENCIL_INDEX,t._shape[0],t._shape[1])),a.bindFramebuffer(a.FRAMEBUFFER,t.handle);var c=a.checkFramebufferStatus(a.FRAMEBUFFER);c!==a.FRAMEBUFFER_COMPLETE&&(t.dispose(),i(a,l),o(c)),i(a,l)}}function f(t,e,r,n){p||(p=t.FRAMEBUFFER_UNSUPPORTED,m=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,g=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,v=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var i=t.getExtension("WEBGL_draw_buffers");if(!y&&i&&a(t,i),Array.isArray(e)&&(n=r,r=0|e[1],e=0|e[0]),"number"!=typeof e)throw new Error("gl-fbo: Missing shape parameter");var o=t.getParameter(t.MAX_RENDERBUFFER_SIZE);if(e<0||e>o||r<0||r>o)throw new Error("gl-fbo: Parameters are too large for FBO");n=n||{};var s=1;if("color"in n){if(s=Math.max(0|n.color,0),s<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(s>1){if(!i)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(s>t.getParameter(i.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+s+" draw buffers")}}var l=t.UNSIGNED_BYTE,u=t.getExtension("OES_texture_float");if(n.float&&s>0){if(!u)throw new Error("gl-fbo: Context does not support floating point textures");l=t.FLOAT}else n.preferFloat&&s>0&&u&&(l=t.FLOAT);var h=!0;"depth"in n&&(h=!!n.depth);var f=!1;return"stencil"in n&&(f=!!n.stencil),new c(t,e,r,l,s,h,f,i)}var d=t("gl-texture2d");e.exports=f;var p,m,g,v,y=null,x=c.prototype;Object.defineProperties(x,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(t){if(Array.isArray(t)||(t=[0|t,0|t]),2!==t.length)throw new Error("gl-fbo: Shape vector must be length 2");var e=0|t[0],r=0|t[1];return h(this,e,r),[e,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return t|=0,h(this,t,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t|=0,h(this,this._shape[0],t),t},enumerable:!1}}),x.bind=function(){if(!this._destroyed){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.handle),t.viewport(0,0,this._shape[0],this._shape[1])}},x.dispose=function(){if(!this._destroyed){this._destroyed=!0;var t=this.gl;t.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(t.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var e=0;e<this.color.length;++e)this.color[e].dispose(),this.color[e]=null;this._color_rb&&(t.deleteRenderbuffer(this._color_rb),this._color_rb=null)}}},{"gl-texture2d":237}],138:[function(t,e,r){function n(t,e,r){"use strict";var n=o(e)||"of unknown name (see npm glsl-shader-name)",l="unknown type";void 0!==r&&(l=r===a.FRAGMENT_SHADER?"fragment":"vertex");for(var u=i("Error compiling %s shader %s:\n",l,n),c=i("%s%s",u,t),h=t.split("\n"),f={},d=0;d<h.length;d++){var p=h[d];if(""!==p){var m=parseInt(p.split(":")[2]);if(isNaN(m))throw new Error(i("Could not parse error: %s",p));f[m]=p}}for(var g=s(e).split("\n"),d=0;d<g.length;d++)if(f[d+3]||f[d+2]||f[d+1]){var v=g[d];if(u+=v+"\n",f[d+1]){var y=f[d+1];y=y.substr(y.split(":",3).join(":").length+1).trim(),u+=i("^^^ %s\n\n",y)}}return{long:u.trim(),short:c.trim()}}var i=t("sprintf-js").sprintf,a=t("gl-constants/lookup"),o=t("glsl-shader-name"),s=t("add-line-numbers");e.exports=n},{"add-line-numbers":31,"gl-constants/lookup":132,"glsl-shader-name":249,"sprintf-js":490}],139:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o){this.plot=t,this.shader=e,this.pickShader=r,this.positionBuffer=n,this.weightBuffer=i,this.colorBuffer=a,this.idBuffer=o,this.xData=[],this.yData=[],this.shape=[0,0],this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.pickOffset=0}function i(t,e){var r=t.gl,i=l(r,c.vertex,c.fragment),a=l(r,c.pickVertex,c.pickFragment),o=u(r),s=u(r),h=u(r),f=u(r),d=new n(t,i,a,o,s,h,f);return d.update(e),t.addObject(d),d}e.exports=i;var a=t("binary-search-bounds"),o=t("iota-array"),s=t("typedarray-pool"),l=t("gl-shader"),u=t("gl-buffer"),c=t("./lib/shaders"),h=n.prototype,f=[0,0,1,0,0,1,1,0,1,1,0,1];h.draw=function(){var t=[1,0,0,0,1,0,0,0,1];return function(){var e=this.plot,r=this.shader,n=this.bounds,i=this.numVertices;if(!(i<=0)){var a=e.gl,o=e.dataBox,s=n[2]-n[0],l=n[3]-n[1],u=o[2]-o[0],c=o[3]-o[1];t[0]=2*s/u,t[4]=2*l/c,t[6]=2*(n[0]-o[0])/u-1,t[7]=2*(n[1]-o[1])/c-1,r.bind();var h=r.uniforms;h.viewTransform=t,h.shape=this.shape;var f=r.attributes;this.positionBuffer.bind(),f.position.pointer(),this.weightBuffer.bind(),f.weight.pointer(a.UNSIGNED_BYTE,!1),this.colorBuffer.bind(),f.color.pointer(a.UNSIGNED_BYTE,!0),a.drawArrays(a.TRIANGLES,0,i)}}}(),h.drawPick=function(){var t=[1,0,0,0,1,0,0,0,1],e=[0,0,0,0];return function(r){var n=this.plot,i=this.pickShader,a=this.bounds,o=this.numVertices;if(!(o<=0)){var s=n.gl,l=n.dataBox,u=a[2]-a[0],c=a[3]-a[1],h=l[2]-l[0],f=l[3]-l[1];t[0]=2*u/h,t[4]=2*c/f,t[6]=2*(a[0]-l[0])/h-1,t[7]=2*(a[1]-l[1])/f-1;for(var d=0;d<4;++d)e[d]=r>>8*d&255;this.pickOffset=r,i.bind();var p=i.uniforms;p.viewTransform=t,p.pickOffset=e,p.shape=this.shape;var m=i.attributes;return this.positionBuffer.bind(),m.position.pointer(),this.weightBuffer.bind(),m.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),m.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),h.pick=function(t,e,r){var n=this.pickOffset,i=this.shape[0]*this.shape[1];if(r<n||r>=n+i)return null;var a=r-n,o=this.xData,s=this.yData;return{object:this,pointId:a,dataCoord:[o[a%this.shape[0]],s[a/this.shape[0]|0]]}},h.update=function(t){t=t||{};var e=t.shape||[0,0],r=t.x||o(e[0]),n=t.y||o(e[1]),i=t.z||new Float32Array(e[0]*e[1]);this.xData=r,this.yData=n;var l=t.colorLevels||[0],u=t.colorValues||[0,0,0,1],c=l.length,h=this.bounds,d=h[0]=r[0],p=h[1]=n[0],m=h[2]=r[r.length-1],g=h[3]=n[n.length-1],v=1/(m-d),y=1/(g-p),x=e[0],b=e[1];this.shape=[x,b];var _=(x-1)*(b-1)*(f.length>>>1);this.numVertices=_;for(var w=s.mallocUint8(4*_),M=s.mallocFloat32(2*_),A=s.mallocUint8(2*_),k=s.mallocUint32(_),T=0,E=0;E<b-1;++E)for(var S=y*(n[E]-p),L=y*(n[E+1]-p),C=0;C<x-1;++C)for(var I=v*(r[C]-d),z=v*(r[C+1]-d),D=0;D<f.length;D+=2){var P,O,R,F,j=f[D],N=f[D+1],B=(E+N)*x+(C+j),U=i[B],V=a.le(l,U);if(V<0)P=u[0],O=u[1],R=u[2],F=u[3];else if(V===c-1)P=u[4*c-4],O=u[4*c-3],R=u[4*c-2],F=u[4*c-1];else{var q=(U-l[V])/(l[V+1]-l[V]),H=1-q,Y=4*V,G=4*(V+1);P=H*u[Y]+q*u[G],O=H*u[Y+1]+q*u[G+1],R=H*u[Y+2]+q*u[G+2],F=H*u[Y+3]+q*u[G+3]}w[4*T]=255*P,w[4*T+1]=255*O,w[4*T+2]=255*R,w[4*T+3]=255*F,M[2*T]=.5*I+.5*z,M[2*T+1]=.5*S+.5*L,A[2*T]=j,A[2*T+1]=N,k[T]=E*x+C,T+=1}this.positionBuffer.update(M),this.weightBuffer.update(A),this.colorBuffer.update(w),this.idBuffer.update(k),s.free(M),s.free(w),s.free(A),s.free(k)},h.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.positionBuffer.dispose(),this.weightBuffer.dispose(),this.colorBuffer.dispose(),this.idBuffer.dispose(),this.plot.removeObject(this)}},{"./lib/shaders":140,"binary-search-bounds":141,"gl-buffer":130,"gl-shader":225,"iota-array":262,"typedarray-pool":502}],140:[function(t,e,r){"use strict";e.exports={fragment:"precision lowp float;\n#define GLSLIFY 1\nvarying vec4 fragColor;\nvoid main() {\n  gl_FragColor = vec4(fragColor.rgb * fragColor.a, fragColor.a);\n}\n",vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 color;\nattribute vec2 weight;\n\nuniform vec2 shape;\nuniform mat3 viewTransform;\n\nvarying vec4 fragColor;\n\nvoid main() {\n  vec3 vPosition = viewTransform * vec3( position + (weight-.5)/(shape-1.) , 1.0);\n  fragColor = color;\n  gl_Position = vec4(vPosition.xy, 0, vPosition.z);\n}\n",pickFragment:"precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragId;\nvarying vec2 vWeight;\n\nuniform vec2 shape;\nuniform vec4 pickOffset;\n\nvoid main() {\n  vec2 d = step(.5, vWeight);\n  vec4 id = fragId + pickOffset;\n  id.x += d.x + d.y*shape.x;\n\n  id.y += floor(id.x / 256.0);\n  id.x -= floor(id.x / 256.0) * 256.0;\n\n  id.z += floor(id.y / 256.0);\n  id.y -= floor(id.y / 256.0) * 256.0;\n\n  id.w += floor(id.z / 256.0);\n  id.z -= floor(id.z / 256.0) * 256.0;\n\n  gl_FragColor = id/255.;\n}\n",pickVertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 pickId;\nattribute vec2 weight;\n\nuniform vec2 shape;\nuniform mat3 viewTransform;\n\nvarying vec4 fragId;\nvarying vec2 vWeight;\n\nvoid main() {\n  vWeight = weight;\n\n  fragId = pickId;\n\n  vec3 vPosition = viewTransform * vec3( position + (weight-.5)/(shape-1.) , 1.0);\n  gl_Position = vec4(vPosition.xy, 0, vPosition.z);\n}\n"}},{}],141:[function(t,e,r){arguments[4][74][0].apply(r,arguments)},{dup:74}],142:[function(t,e,r){r.lineVertex="precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 aHi, aLo, dHi, dLo;\n\nuniform vec2 scaleHi, translateHi, scaleLo, translateLo, screenShape;\nuniform float width;\n\nvarying vec2 direction;\n\n\nvec2 project_1_0(vec2 scHi, vec2 trHi, vec2 scLo, vec2 trLo, vec2 posHi, vec2 posLo) {\n  return (posHi + trHi) * scHi\n       + (posLo + trLo) * scHi\n       + (posHi + trHi) * scLo\n       + (posLo + trLo) * scLo;\n}\n\n\nvec2 project_2_1(vec2 scHi, vec2 scLo, vec2 posHi, vec2 posLo) {\n  return scHi * posHi\n       + scLo * posHi\n       + scHi * posLo\n       + scLo * posLo;\n}\n\nvoid main() {\n  vec2 p = project_1_0(scaleHi, translateHi, scaleLo, translateLo, aHi, aLo);\n  vec2 dir = project_2_1(scaleHi, scaleLo, dHi, dLo);\n  vec2 n = 0.5 * width * normalize(screenShape.yx * vec2(dir.y, -dir.x)) / screenShape.xy;\n  vec2 tangent = normalize(screenShape.xy * dir);\n  if(dir.x < 0.0 || (dir.x == 0.0 && dir.y < 0.0)) {\n    direction = -tangent;\n  } else {\n    direction = tangent;\n  }\n  gl_Position = vec4(p + n, 0.0, 1.0);\n}",r.lineFragment="precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nuniform vec2 screenShape;\nuniform sampler2D dashPattern;\nuniform float dashLength;\n\nvarying vec2 direction;\n\nvoid main() {\n  float t = fract(dot(direction, gl_FragCoord.xy) / dashLength);\n  vec4 pcolor = color * texture2D(dashPattern, vec2(t, 0.0)).r;\n  gl_FragColor = vec4(pcolor.rgb * pcolor.a, pcolor.a);\n}",r.mitreVertex="precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 aHi, aLo;\n\nuniform vec2 scaleHi, translateHi, scaleLo, translateLo;\nuniform float radius;\n\n\nvec2 project_1_0(vec2 scHi, vec2 trHi, vec2 scLo, vec2 trLo, vec2 posHi, vec2 posLo) {\n  return (posHi + trHi) * scHi\n       + (posLo + trLo) * scHi\n       + (posHi + trHi) * scLo\n       + (posLo + trLo) * scLo;\n}\n\n\nvoid main() {\n  vec2 p = project_1_0(scaleHi, translateHi, scaleLo, translateLo, aHi, aLo);\n  gl_Position = vec4(p, 0.0, 1.0);\n  gl_PointSize = radius;\n}",r.mitreFragment="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color;\n\nvoid main() {\n  if(length(gl_PointCoord.xy - 0.5) > 0.25) {\n    discard;\n  }\n  gl_FragColor = vec4(color.rgb, color.a);\n}",r.pickVertex="precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 aHi, aLo, dHi;\nattribute vec4 pick0, pick1;\n\nuniform vec2 scaleHi, translateHi, scaleLo, translateLo, screenShape;\nuniform float width;\n\nvarying vec4 pickA, pickB;\n\n\nvec2 project_1_0(vec2 scHi, vec2 trHi, vec2 scLo, vec2 trLo, vec2 posHi, vec2 posLo) {\n  return (posHi + trHi) * scHi\n       + (posLo + trLo) * scHi\n       + (posHi + trHi) * scLo\n       + (posLo + trLo) * scLo;\n}\n\n\nvoid main() {\n  vec2 p = project_1_0(scaleHi, translateHi, scaleLo, translateLo, aHi, aLo);\n  vec2 n = width * normalize(screenShape.yx * vec2(dHi.y, -dHi.x)) / screenShape.xy;\n  gl_Position = vec4(p + n, 0, 1);\n  pickA = pick0;\n  pickB = pick1;\n}",r.pickFragment="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 pickOffset;\n\nvarying vec4 pickA, pickB;\n\nvoid main() {\n  vec4 fragId = vec4(pickA.xyz, 0.0);\n  if(pickB.w > pickA.w) {\n    fragId.xyz = pickB.xyz;\n  }\n\n  fragId += pickOffset;\n\n  fragId.y += floor(fragId.x / 256.0);\n  fragId.x -= floor(fragId.x / 256.0) * 256.0;\n\n  fragId.z += floor(fragId.y / 256.0);\n  fragId.y -= floor(fragId.y / 256.0) * 256.0;\n\n  fragId.w += floor(fragId.z / 256.0);\n  fragId.z -= floor(fragId.z / 256.0) * 256.0;\n\n  gl_FragColor = fragId / 255.0;\n}",r.fillVertex="precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 aHi, aLo, dHi;\n\nuniform vec2 scaleHi, translateHi, scaleLo, translateLo, projectAxis;\nuniform float projectValue, depth;\n\n\nvec2 project_1_0(vec2 scHi, vec2 trHi, vec2 scLo, vec2 trLo, vec2 posHi, vec2 posLo) {\n  return (posHi + trHi) * scHi\n       + (posLo + trLo) * scHi\n       + (posHi + trHi) * scLo\n       + (posLo + trLo) * scLo;\n}\n\n\nvoid main() {\n  vec2 p = project_1_0(scaleHi, translateHi, scaleLo, translateLo, aHi, aLo);\n  if(dHi.y < 0.0 || (dHi.y == 0.0 && dHi.x < 0.0)) {\n    if(dot(p, projectAxis) < projectValue) {\n      p = p * (1.0 - abs(projectAxis)) + projectAxis * projectValue;\n    }\n  }\n  gl_Position = vec4(p, depth, 1);\n}",r.fillFragment="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color;\n\nvoid main() {\n  gl_FragColor = vec4(color.rgb * color.a, color.a);\n}"},{}],143:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l){this.plot=t,this.dashPattern=e,this.lineBufferHi=r,this.lineBufferLo=n,this.pickBuffer=i,this.lineShader=a,this.mitreShader=o,this.fillShader=s,this.pickShader=l,this.usingDashes=!1,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.width=1,this.color=[0,0,1,1],this.fill=[!1,!1,!1,!1],this.fillColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.data=null,this.numPoints=0,this.vertCount=0,this.pickOffset=0}function i(t){return t.map(function(t){return t.slice()})}function a(t,e){var r=t.gl,i=s(r),a=s(r),u=s(r),c=l(r,[1,1]),f=o(r,h.lineVertex,h.lineFragment),d=o(r,h.mitreVertex,h.mitreFragment),p=o(r,h.fillVertex,h.fillFragment),m=o(r,h.pickVertex,h.pickFragment),g=new n(t,c,i,a,u,f,d,p,m);return t.addObject(g),g.update(e),g}e.exports=a;var o=t("gl-shader"),s=t("gl-buffer"),l=t("gl-texture2d"),u=t("ndarray"),c=t("typedarray-pool"),h=t("./lib/shaders"),f=n.prototype;f.setProjectionModel=function(){var t={scaleHi:new Float32Array([0,0]),scaleLo:new Float32Array([0,0]),translateHi:new Float32Array([0,0]),translateLo:new Float32Array([0,0]),screenShape:[0,0]};return function(){var e=this.bounds,r=this.plot.viewBox,n=this.plot.dataBox,i=e[2]-e[0],a=e[3]-e[1],o=n[2]-n[0],s=n[3]-n[1],l=r[2]-r[0],u=r[3]-r[1],c=2*i/o,h=2*a/s,f=(e[0]-n[0]-.5*o)/i,d=(e[1]-n[1]-.5*s)/a;return t.scaleHi[0]=c,t.scaleHi[1]=h,t.scaleLo[0]=c-t.scaleHi[0],t.scaleLo[1]=h-t.scaleHi[1],t.translateHi[0]=f,t.translateHi[1]=d,t.translateLo[0]=f-t.translateHi[0],t.translateLo[1]=d-t.translateHi[1],t.screenShape[0]=l,t.screenShape[1]=u,t}}(),f.setProjectionUniforms=function(t,e){t.scaleHi=e.scaleHi,t.scaleLo=e.scaleLo,t.translateHi=e.translateHi,t.translateLo=e.translateLo,t.screenShape=e.screenShape},f.draw=function(){var t=[1,0],e=[-1,0],r=[0,1],n=[0,-1];return function(){var i=this.vertCount;if(i){var a=this.setProjectionModel(),o=this.plot,s=this.width,l=o.gl,u=o.pixelRatio,c=this.color,h=this.fillShader.attributes;this.lineBufferLo.bind(),h.aLo.pointer(l.FLOAT,!1,16,0),this.lineBufferHi.bind();var f=this.fill;if(f[0]||f[1]||f[2]||f[3]){var d=this.fillShader;d.bind();var p=d.uniforms;this.setProjectionUniforms(p,a),p.depth=o.nextDepthValue(),h.aHi.pointer(l.FLOAT,!1,16,0),h.dHi.pointer(l.FLOAT,!1,16,8),l.depthMask(!0),l.enable(l.DEPTH_TEST);var m=this.fillColor;f[0]&&(p.color=m[0],p.projectAxis=e,p.projectValue=1,l.drawArrays(l.TRIANGLES,0,i)),f[1]&&(p.color=m[1],p.projectAxis=n,p.projectValue=1,l.drawArrays(l.TRIANGLES,0,i)),f[2]&&(p.color=m[2],p.projectAxis=t,p.projectValue=1,l.drawArrays(l.TRIANGLES,0,i)),f[3]&&(p.color=m[3],p.projectAxis=r,p.projectValue=1,l.drawArrays(l.TRIANGLES,0,i)),l.depthMask(!1),l.disable(l.DEPTH_TEST)}var g=this.lineShader;g.bind(),this.lineBufferLo.bind(),g.attributes.aLo.pointer(l.FLOAT,!1,16,0),g.attributes.dLo.pointer(l.FLOAT,!1,16,8),this.lineBufferHi.bind();var v=g.uniforms;this.setProjectionUniforms(v,a),v.color=c,v.width=s*u,v.dashPattern=this.dashPattern.bind(),v.dashLength=this.dashLength*u;var y=g.attributes;if(y.aHi.pointer(l.FLOAT,!1,16,0),y.dHi.pointer(l.FLOAT,!1,16,8),l.drawArrays(l.TRIANGLES,0,i),s>2&&!this.usingDashes){var x=this.mitreShader;this.lineBufferLo.bind(),x.attributes.aLo.pointer(l.FLOAT,!1,48,0),this.lineBufferHi.bind(),x.bind();var b=x.uniforms;this.setProjectionUniforms(b,a),b.color=c,b.radius=s*u,x.attributes.aHi.pointer(l.FLOAT,!1,48,0),l.drawArrays(l.POINTS,0,i/3|0)}}}}(),f.drawPick=function(){var t=[0,0,0,0];return function(e){var r=this.vertCount,n=this.numPoints;if(this.pickOffset=e,!r)return e+n;var i=this.setProjectionModel(),a=this.plot,o=this.width,s=a.gl,l=a.pickPixelRatio,u=this.pickShader,c=this.pickBuffer;t[0]=255&e,t[1]=e>>>8&255,t[2]=e>>>16&255,t[3]=e>>>24,u.bind();var h=u.uniforms;this.setProjectionUniforms(h,i),h.width=o*l,h.pickOffset=t;var f=u.attributes;return this.lineBufferHi.bind(),f.aHi.pointer(s.FLOAT,!1,16,0),f.dHi.pointer(s.FLOAT,!1,16,8),this.lineBufferLo.bind(),f.aLo.pointer(s.FLOAT,!1,16,0),c.bind(),f.pick0.pointer(s.UNSIGNED_BYTE,!1,8,0),f.pick1.pointer(s.UNSIGNED_BYTE,!1,8,4),s.drawArrays(s.TRIANGLES,0,r),e+n}}(),f.pick=function(t,e,r){var n=this.pickOffset,i=this.numPoints;if(r<n||r>=n+i)return null;var a=r-n,o=this.data;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}},f.update=function(t){t=t||{};var e,r,n,a,o,s=this.plot.gl;this.color=(t.color||[0,0,1,1]).slice(),this.width=+(t.width||1),this.fill=(t.fill||[!1,!1,!1,!1]).slice(),this.fillColor=i(t.fillColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);var h=t.dashes||[1],f=0;for(e=0;e<h.length;++e)f+=h[e];var d=c.mallocUint8(f);n=0;var p=255;for(e=0;e<h.length;++e){for(r=0;r<h[e];++r)d[n++]=p;p^=255}this.dashPattern.dispose(),this.usingDashes=h.length>1,this.dashPattern=l(s,u(d,[f,1,4],[1,0,0])),this.dashPattern.minFilter=s.NEAREST,this.dashPattern.magFilter=s.NEAREST,this.dashLength=f,c.free(d);var m=t.positions;this.data=m;var g=this.bounds;g[0]=g[1]=1/0,g[2]=g[3]=-(1/0);var v=this.numPoints=m.length>>>1;if(0!==v){for(e=0;e<v;++e)a=m[2*e],o=m[2*e+1],isNaN(a)||isNaN(o)||(g[0]=Math.min(g[0],a),g[1]=Math.min(g[1],o),g[2]=Math.max(g[2],a),g[3]=Math.max(g[3],o));g[0]===g[2]&&(g[2]+=1),g[3]===g[1]&&(g[3]+=1);var y=c.mallocFloat64(24*(v-1)),x=c.mallocFloat32(24*(v-1)),b=c.mallocFloat32(24*(v-1)),_=c.mallocUint32(12*(v-1)),w=x.length,M=_.length;n=v;for(var A=0;n>1;){var k=--n;a=m[2*n],o=m[2*n+1];var T=k-1,E=m[2*T],S=m[2*T+1];if(!(isNaN(a)||isNaN(o)||isNaN(E)||isNaN(S))){A+=1,a=(a-g[0])/(g[2]-g[0]),o=(o-g[1])/(g[3]-g[1]),E=(E-g[0])/(g[2]-g[0]),S=(S-g[1])/(g[3]-g[1]);var L=E-a,C=S-o,I=k|1<<24,z=k-1,D=k,P=k-1|1<<24;y[--w]=-C,y[--w]=-L,y[--w]=o,y[--w]=a,_[--M]=I,_[--M]=z,y[--w]=C,y[--w]=L,y[--w]=S,y[--w]=E,_[--M]=D,_[--M]=P,y[--w]=-C,y[--w]=-L,y[--w]=S,y[--w]=E,_[--M]=D,_[--M]=P,y[--w]=C,y[--w]=L,y[--w]=S,y[--w]=E,_[--M]=D,_[--M]=P,y[--w]=-C,y[--w]=-L,y[--w]=o,y[--w]=a,_[--M]=I,_[--M]=z,y[--w]=C,y[--w]=L,y[--w]=o,y[--w]=a,_[--M]=I,_[--M]=z}}for(e=0;e<y.length;e++)x[e]=y[e],b[e]=y[e]-x[e];this.vertCount=6*A,this.lineBufferHi.update(x.subarray(w)),this.lineBufferLo.update(b.subarray(w)),this.pickBuffer.update(_.subarray(M)),c.free(y),c.free(x),c.free(b),c.free(_)}},f.dispose=function(){this.plot.removeObject(this),this.lineBufferLo.dispose(),this.lineBufferHi.dispose(),this.pickBuffer.dispose(),this.lineShader.dispose(),this.mitreShader.dispose(),this.fillShader.dispose(),this.pickShader.dispose(),this.dashPattern.dispose()}},{"./lib/shaders":142,"gl-buffer":130,"gl-shader":225,"gl-texture2d":237,ndarray:432,"typedarray-pool":502}],144:[function(t,e,r){var n=t("gl-shader"),i="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, nextPosition;\nattribute float arcLength, lineWidth;\nattribute vec4 color;\n\nuniform vec2 screenShape;\nuniform float pixelRatio;\nuniform mat4 model, view, projection;\n\nvarying vec4 fragColor;\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\n\nvoid main() {\n  vec4 projected = projection * view * model * vec4(position, 1.0);\n  vec4 tangentClip = projection * view * model * vec4(nextPosition - position, 0.0);\n  vec2 tangent = normalize(screenShape * tangentClip.xy);\n  vec2 offset = 0.5 * pixelRatio * lineWidth * vec2(tangent.y, -tangent.x) / screenShape;\n\n  gl_Position = vec4(projected.xy + projected.w * offset, projected.zw);\n\n  worldPosition = position;\n  pixelArcLength = arcLength;\n  fragColor = color;\n}\n",a="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3      clipBounds[2];\nuniform sampler2D dashTexture;\nuniform float     dashScale;\nuniform float     opacity;\n\nvarying vec3    worldPosition;\nvarying float   pixelArcLength;\nvarying vec4    fragColor;\n\nvoid main() {\n  if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\n    discard;\n  }\n  float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n  if(dashWeight < 0.5) {\n    discard;\n  }\n  gl_FragColor = fragColor * opacity;\n}\n",o="precision mediump float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX  1.70141184e38\n#define FLOAT_MIN  1.17549435e-38\n\nlowp vec4 encode_float_1_0(highp float v) {\n  highp float av = abs(v);\n\n  //Handle special cases\n  if(av < FLOAT_MIN) {\n    return vec4(0.0, 0.0, 0.0, 0.0);\n  } else if(v > FLOAT_MAX) {\n    return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n  } else if(v < -FLOAT_MAX) {\n    return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n  }\n\n  highp vec4 c = vec4(0,0,0,0);\n\n  //Compute exponent and mantissa\n  highp float e = floor(log2(av));\n  highp float m = av * pow(2.0, -e) - 1.0;\n  \n  //Unpack mantissa\n  c[1] = floor(128.0 * m);\n  m -= c[1] / 128.0;\n  c[2] = floor(32768.0 * m);\n  m -= c[2] / 32768.0;\n  c[3] = floor(8388608.0 * m);\n  \n  //Unpack exponent\n  highp float ebias = e + 127.0;\n  c[0] = floor(ebias / 2.0);\n  ebias -= c[0] * 2.0;\n  c[1] += floor(ebias) * 128.0; \n\n  //Unpack sign bit\n  c[0] += 128.0 * step(0.0, -v);\n\n  //Scale back to range\n  return c / 255.0;\n}\n\n\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n  if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\n    discard;\n  }\n  gl_FragColor = vec4(pickId/255.0, encode_float_1_0(pixelArcLength).xyz);\n}",s=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];r.createShader=function(t){return n(t,i,a,null,s)},r.createPickShader=function(t){return n(t,i,o,null,s)}},{"gl-shader":225}],145:[function(t,e,r){"use strict";function n(t,e){for(var r=0,n=0;n<3;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function i(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function a(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function o(t,e,r,n,i,a){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.dirty=!0,this.pixelRatio=1}function s(t){var e=t.gl||t.scene&&t.scene.gl,r=m(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var n=g(e);n.attributes.position.location=0,n.attributes.nextPosition.location=1,n.attributes.arcLength.location=2,n.attributes.lineWidth.location=3,n.attributes.color.location=4;for(var i=l(e),a=u(e,[{buffer:i,size:3,offset:0,stride:48},{buffer:i,size:3,offset:12,stride:48},{buffer:i,size:1,offset:24,stride:48},{buffer:i,size:1,offset:28,stride:48},{buffer:i,size:4,offset:32,stride:48}]),s=d(new Array(1024),[256,1,4]),h=0;h<1024;++h)s.data[h]=255;var f=c(e,s);f.wrap=e.REPEAT;var p=new o(e,r,n,i,a,f);return p.update(t),p}e.exports=s;var l=t("gl-buffer"),u=t("gl-vao"),c=t("gl-texture2d"),h=t("glsl-read-float"),f=t("binary-search-bounds"),d=t("ndarray"),p=t("./lib/shaders"),m=p.createShader,g=p.createPickShader,v=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],y=o.prototype;y.isTransparent=function(){return this.opacity<1},y.isOpaque=function(){return this.opacity>=1},y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.drawTransparent=y.draw=function(t){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||v,view:t.view||v,projection:t.projection||v,clipBounds:i(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},y.drawPick=function(t){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||v,view:t.view||v,projection:t.projection||v,pickId:this.pickId,clipBounds:i(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},y.update=function(t){var e,r;this.dirty=!0;var i=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),"opacity"in t&&(this.opacity=+t.opacity);var a=t.position||t.positions;if(a){var o=t.color||t.colors||[0,0,0,1],s=t.lineWidth||1,l=[],u=[],c=[],h=0,p=0,m=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],g=!1;t:for(e=1;e<a.length;++e){var v=a[e-1],y=a[e];for(u.push(h),c.push(v.slice()),r=0;r<3;++r){if(isNaN(v[r])||isNaN(y[r])||!isFinite(v[r])||!isFinite(y[r])){if(!i&&l.length>0){for(var x=0;x<24;++x)l.push(l[l.length-12]);p+=2,g=!0}continue t}m[0][r]=Math.min(m[0][r],v[r],y[r]),m[1][r]=Math.max(m[1][r],v[r],y[r])}var b,_;Array.isArray(o[0])?(b=o[e-1],_=o[e]):b=_=o,3===b.length&&(b=[b[0],b[1],b[2],1]),3===_.length&&(_=[_[0],_[1],_[2],1]);var w;w=Array.isArray(s)?s[e-1]:s;var M=h;if(h+=n(v,y),g){for(r=0;r<2;++r)l.push(v[0],v[1],v[2],y[0],y[1],y[2],M,w,b[0],b[1],b[2],b[3]);p+=2,g=!1}l.push(v[0],v[1],v[2],y[0],y[1],y[2],M,w,b[0],b[1],b[2],b[3],v[0],v[1],v[2],y[0],y[1],y[2],M,-w,b[0],b[1],b[2],b[3],y[0],y[1],y[2],v[0],v[1],v[2],h,-w,_[0],_[1],_[2],_[3],y[0],y[1],y[2],v[0],v[1],v[2],h,w,_[0],_[1],_[2],_[3]),p+=4}if(this.buffer.update(l),u.push(h),c.push(a[a.length-1].slice()),this.bounds=m,this.vertexCount=p,this.points=c,this.arcLength=u,"dashes"in t){var A=t.dashes,k=A.slice();for(k.unshift(0),e=1;e<k.length;++e)k[e]=k[e-1]+k[e];var T=d(new Array(1024),[256,1,4]);for(e=0;e<256;++e){for(r=0;r<4;++r)T.set(e,0,r,0);1&f.le(k,k[k.length-1]*e/255)?T.set(e,0,0,0):T.set(e,0,0,255)}this.texture.setPixels(T)}}},y.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()},y.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=h(t.value[0],t.value[1],t.value[2],0),r=f.le(this.arcLength,e);if(r<0)return null;if(r===this.arcLength.length-1)return new a(this.arcLength[this.arcLength.length-1],this.points[this.points.length-1].slice(),r);for(var n=this.points[r],i=this.points[Math.min(r+1,this.points.length-1)],o=(e-this.arcLength[r])/(this.arcLength[r+1]-this.arcLength[r]),s=1-o,l=[0,0,0],u=0;u<3;++u)l[u]=s*n[u]+o*i[u];var c=Math.min(o<.5?r:r+1,this.points.length-1);return new a(e,l,c,this.points[c])}},{"./lib/shaders":144,"binary-search-bounds":55,"gl-buffer":130,"gl-texture2d":237,"gl-vao":241,"glsl-read-float":248,ndarray:432}],146:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*a-i*n;return o?(o=1/o,t[0]=a*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}e.exports=n},{}],147:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=c*o-s*u,f=-c*a+s*l,d=u*a-o*l,p=r*h+n*f+i*d;return p?(p=1/p,t[0]=h*p,t[1]=(-c*n+i*u)*p,t[2]=(s*n-i*o)*p,t[3]=f*p,t[4]=(c*r-i*l)*p,t[5]=(-s*r+i*a)*p,t[6]=d*p,t[7]=(-u*r+n*l)*p,t[8]=(o*r-n*a)*p,t):null}e.exports=n},{}],148:[function(t,e,r){function n(t){var e=new Float32Array(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}e.exports=n},{}],149:[function(t,e,r){function n(){var t=new Float32Array(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}e.exports=n},{}],150:[function(t,e,r){function n(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15],v=e*o-r*a,y=e*s-n*a,x=e*l-i*a,b=r*s-n*o,_=r*l-i*o,w=n*l-i*s,M=u*p-c*d,A=u*m-h*d,k=u*g-f*d,T=c*m-h*p,E=c*g-f*p,S=h*g-f*m;return v*S-y*E+x*T+b*k-_*A+w*M}e.exports=n},{}],151:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,u=r*o,c=n*o,h=n*s,f=i*o,d=i*s,p=i*l,m=a*o,g=a*s,v=a*l;return t[0]=1-h-p,t[1]=c+v,t[2]=f-g,t[3]=0,t[4]=c-v,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=f+g,t[9]=d-m,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}e.exports=n},{}],152:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=n+n,l=i+i,u=a+a,c=n*s,h=n*l,f=n*u,d=i*l,p=i*u,m=a*u,g=o*s,v=o*l,y=o*u;return t[0]=1-(d+m),t[1]=h+y,t[2]=f-v,t[3]=0,t[4]=h-y,t[5]=1-(c+m),t[6]=p+g,t[7]=0,t[8]=f+v,t[9]=p-g,t[10]=1-(c+d),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}e.exports=n},{}],153:[function(t,e,r){function n(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}e.exports=n},{}],154:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*s-n*o,x=r*l-i*o,b=r*u-a*o,_=n*l-i*s,w=n*u-a*s,M=i*u-a*l,A=c*m-h*p,k=c*g-f*p,T=c*v-d*p,E=h*g-f*m,S=h*v-d*m,L=f*v-d*g,C=y*L-x*S+b*E+_*T-w*k+M*A;return C?(C=1/C,t[0]=(s*L-l*S+u*E)*C,t[1]=(i*S-n*L-a*E)*C,t[2]=(m*M-g*w+v*_)*C,t[3]=(f*w-h*M-d*_)*C,t[4]=(l*T-o*L-u*k)*C,t[5]=(r*L-i*T+a*k)*C,t[6]=(g*b-p*M-v*x)*C,t[7]=(c*M-f*b+d*x)*C,t[8]=(o*S-s*T+u*A)*C,t[9]=(n*T-r*S-a*A)*C,t[10]=(p*w-m*b+v*y)*C,t[11]=(h*b-c*w-d*y)*C,t[12]=(s*k-o*E-l*A)*C,t[13]=(r*E-n*k+i*A)*C,t[14]=(m*x-p*_-g*y)*C,t[15]=(c*_-h*x+f*y)*C,t):null}e.exports=n},{}],155:[function(t,e,r){function n(t,e,r,n){var a,o,s,l,u,c,h,f,d,p,m=e[0],g=e[1],v=e[2],y=n[0],x=n[1],b=n[2],_=r[0],w=r[1],M=r[2];return Math.abs(m-_)<1e-6&&Math.abs(g-w)<1e-6&&Math.abs(v-M)<1e-6?i(t):(h=m-_,f=g-w,d=v-M,p=1/Math.sqrt(h*h+f*f+d*d),h*=p,f*=p,d*=p,a=x*d-b*f,o=b*h-y*d,s=y*f-x*h,p=Math.sqrt(a*a+o*o+s*s),p?(p=1/p,a*=p,o*=p,s*=p):(a=0,o=0,s=0),l=f*s-d*o,u=d*a-h*s,c=h*o-f*a,p=Math.sqrt(l*l+u*u+c*c),p?(p=1/p,l*=p,u*=p,c*=p):(l=0,u=0,c=0),t[0]=a,t[1]=l,t[2]=h,t[3]=0,t[4]=o,t[5]=u,t[6]=f,t[7]=0,t[8]=s,t[9]=c,t[10]=d,t[11]=0,t[12]=-(a*m+o*g+s*v),t[13]=-(l*m+u*g+c*v),t[14]=-(h*m+f*g+d*v),t[15]=1,t)}var i=t("./identity");e.exports=n},{"./identity":153}],156:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=e[9],d=e[10],p=e[11],m=e[12],g=e[13],v=e[14],y=e[15],x=r[0],b=r[1],_=r[2],w=r[3];return t[0]=x*n+b*s+_*h+w*m,t[1]=x*i+b*l+_*f+w*g,t[2]=x*a+b*u+_*d+w*v,t[3]=x*o+b*c+_*p+w*y,x=r[4],b=r[5],_=r[6],w=r[7],t[4]=x*n+b*s+_*h+w*m,t[5]=x*i+b*l+_*f+w*g,t[6]=x*a+b*u+_*d+w*v,t[7]=x*o+b*c+_*p+w*y,x=r[8],b=r[9],_=r[10],w=r[11],t[8]=x*n+b*s+_*h+w*m,t[9]=x*i+b*l+_*f+w*g,t[10]=x*a+b*u+_*d+w*v,t[11]=x*o+b*c+_*p+w*y,x=r[12],b=r[13],_=r[14],w=r[15],t[12]=x*n+b*s+_*h+w*m,t[13]=x*i+b*l+_*f+w*g,t[14]=x*a+b*u+_*d+w*v,t[15]=x*o+b*c+_*p+w*y,t}e.exports=n},{}],157:[function(t,e,r){function n(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t}e.exports=n},{}],158:[function(t,e,r){function n(t,e,r,n){var i,a,o,s,l,u,c,h,f,d,p,m,g,v,y,x,b,_,w,M,A,k,T,E,S=n[0],L=n[1],C=n[2],I=Math.sqrt(S*S+L*L+C*C);return Math.abs(I)<1e-6?null:(I=1/I,S*=I,L*=I,C*=I,i=Math.sin(r),a=Math.cos(r),o=1-a,s=e[0],l=e[1],u=e[2],c=e[3],h=e[4],f=e[5],d=e[6],p=e[7],m=e[8],g=e[9],v=e[10],y=e[11],x=S*S*o+a,b=L*S*o+C*i,_=C*S*o-L*i,w=S*L*o-C*i,M=L*L*o+a,A=C*L*o+S*i,k=S*C*o+L*i,T=L*C*o-S*i,E=C*C*o+a,t[0]=s*x+h*b+m*_,t[1]=l*x+f*b+g*_,t[2]=u*x+d*b+v*_,t[3]=c*x+p*b+y*_,t[4]=s*w+h*M+m*A,t[5]=l*w+f*M+g*A,t[6]=u*w+d*M+v*A,t[7]=c*w+p*M+y*A,t[8]=s*k+h*T+m*E,t[9]=l*k+f*T+g*E,t[10]=u*k+d*T+v*E,t[11]=c*k+p*T+y*E,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}e.exports=n},{}],159:[function(t,e,r){function n(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+u*n,t[5]=o*i+c*n,t[6]=s*i+h*n,t[7]=l*i+f*n,t[8]=u*i-a*n,t[9]=c*i-o*n,t[10]=h*i-s*n,t[11]=f*i-l*n,t}e.exports=n},{}],160:[function(t,e,r){function n(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i-u*n,t[1]=o*i-c*n,t[2]=s*i-h*n,t[3]=l*i-f*n,t[8]=a*n+u*i,t[9]=o*n+c*i,t[10]=s*n+h*i,t[11]=l*n+f*i,t}e.exports=n},{}],161:[function(t,e,r){function n(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[4],c=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+u*n,t[1]=o*i+c*n,t[2]=s*i+h*n,t[3]=l*i+f*n,t[4]=u*i-a*n,t[5]=c*i-o*n,t[6]=h*i-s*n,t[7]=f*i-l*n,t}e.exports=n},{}],162:[function(t,e,r){function n(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}e.exports=n},{}],163:[function(t,e,r){function n(t,e,r){var n,i,a,o,s,l,u,c,h,f,d,p,m=r[0],g=r[1],v=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*v+e[12],t[13]=e[1]*m+e[5]*g+e[9]*v+e[13],t[14]=e[2]*m+e[6]*g+e[10]*v+e[14],t[15]=e[3]*m+e[7]*g+e[11]*v+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=f,t[10]=d,t[11]=p,t[12]=n*m+s*g+h*v+e[12],t[13]=i*m+l*g+f*v+e[13],t[14]=a*m+u*g+d*v+e[14],t[15]=o*m+c*g+p*v+e[15]),t}e.exports=n},{}],164:[function(t,e,r){function n(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}e.exports=n},{}],165:[function(t,e,r){"use strict";function n(t,e){switch(e.length){case 0:break;case 1:t[0]=1/e[0];break;case 4:i(t,e);break;case 9:a(t,e);break;case 16:o(t,e);break;default:throw new Error("currently supports matrices up to 4x4")}return t}e.exports=n;var i=t("gl-mat2/invert"),a=t("gl-mat3/invert"),o=t("gl-mat4/invert")},{"gl-mat2/invert":146,"gl-mat3/invert":147,"gl-mat4/invert":154}],166:[function(t,e,r){r.glMatrix=t("./gl-matrix/common.js"),r.mat2=t("./gl-matrix/mat2.js"),r.mat2d=t("./gl-matrix/mat2d.js"),r.mat3=t("./gl-matrix/mat3.js"),r.mat4=t("./gl-matrix/mat4.js"),r.quat=t("./gl-matrix/quat.js"),r.vec2=t("./gl-matrix/vec2.js"),r.vec3=t("./gl-matrix/vec3.js"),r.vec4=t("./gl-matrix/vec4.js")},{"./gl-matrix/common.js":167,"./gl-matrix/mat2.js":168,"./gl-matrix/mat2d.js":169,"./gl-matrix/mat3.js":170,"./gl-matrix/mat4.js":171,"./gl-matrix/quat.js":172,"./gl-matrix/vec2.js":173,"./gl-matrix/vec3.js":174,"./gl-matrix/vec4.js":175}],167:[function(t,e,r){var n={};n.EPSILON=1e-6,n.ARRAY_TYPE="undefined"!=typeof Float32Array?Float32Array:Array,n.RANDOM=Math.random,n.ENABLE_SIMD=!1,n.SIMD_AVAILABLE=n.ARRAY_TYPE===Float32Array&&"SIMD"in this,n.USE_SIMD=n.ENABLE_SIMD&&n.SIMD_AVAILABLE,n.setMatrixArrayType=function(t){n.ARRAY_TYPE=t};var i=Math.PI/180;n.toRadian=function(t){return t*i},n.equals=function(t,e){return Math.abs(t-e)<=n.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))},e.exports=n},{}],168:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},i.clone=function(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},i.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},i.fromValues=function(t,e,r,i){var a=new n.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a},i.set=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t},i.transpose=function(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},i.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*a-i*n;return o?(o=1/o,t[0]=a*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null},i.adjoint=function(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t},i.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},i.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1],u=r[2],c=r[3];return t[0]=n*s+a*l,t[1]=i*s+o*l,t[2]=n*u+a*c,t[3]=i*u+o*c,t},i.mul=i.multiply,i.rotate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+a*s,t[1]=i*l+o*s,t[2]=n*-s+a*l,t[3]=i*-s+o*l,t},i.scale=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1];return t[0]=n*s,t[1]=i*s,t[2]=a*l,t[3]=o*l,t},i.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t},i.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t},i.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},i.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},i.LDU=function(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t},i.sub=i.subtract,i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=e[0],l=e[1],u=e[2],c=e[3];return Math.abs(r-s)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-l)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-u)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(u))&&Math.abs(o-c)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))},i.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},i.multiplyScalarAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t},e.exports=i},{"./common.js":167}],169:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(6);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},i.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},i.fromValues=function(t,e,r,i,a,o){var s=new n.ARRAY_TYPE(6);return s[0]=t,s[1]=e,s[2]=r,s[3]=i,s[4]=a,s[5]=o,s},i.set=function(t,e,r,n,i,a,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t},i.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=r*a-n*i;return l?(l=1/l,t[0]=a*l,t[1]=-n*l,t[2]=-i*l,t[3]=r*l,t[4]=(i*s-a*o)*l,t[5]=(n*o-r*s)*l,t):null},i.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},i.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=r[0],c=r[1],h=r[2],f=r[3],d=r[4],p=r[5];return t[0]=n*u+a*c,t[1]=i*u+o*c,t[2]=n*h+a*f,t[3]=i*h+o*f,t[4]=n*d+a*p+s,t[5]=i*d+o*p+l,t},i.mul=i.multiply,i.rotate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=Math.sin(r),c=Math.cos(r);return t[0]=n*c+a*u,t[1]=i*c+o*u,t[2]=n*-u+a*c,t[3]=i*-u+o*c,t[4]=s,t[5]=l,t},i.scale=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=r[0],c=r[1];return t[0]=n*u,t[1]=i*u,t[2]=a*c,t[3]=o*c,t[4]=s,t[5]=l,t},i.translate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=n*u+a*c+s,t[5]=i*u+o*c+l,t},i.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t},i.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},i.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t},i.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},i.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t},i.sub=i.subtract,i.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t},i.multiplyScalarAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=e[0],c=e[1],h=e[2],f=e[3],d=e[4],p=e[5];return Math.abs(r-u)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-c)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(a-h)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(o-f)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(s-d)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(l-p)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(p))},e.exports=i},{"./common.js":167}],170:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},i.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},i.clone=function(t){var e=new n.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},i.fromValues=function(t,e,r,i,a,o,s,l,u){var c=new n.ARRAY_TYPE(9);return c[0]=t,c[1]=e,c[2]=r,c[3]=i,c[4]=a,c[5]=o,c[6]=s,c[7]=l,c[8]=u,c},i.set=function(t,e,r,n,i,a,o,s,l,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=l,t[8]=u,t},i.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},i.transpose=function(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},i.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=c*o-s*u,f=-c*a+s*l,d=u*a-o*l,p=r*h+n*f+i*d;return p?(p=1/p,t[0]=h*p,t[1]=(-c*n+i*u)*p,t[2]=(s*n-i*o)*p,t[3]=f*p,t[4]=(c*r-i*l)*p,t[5]=(-s*r+i*a)*p,t[6]=d*p,t[7]=(-u*r+n*l)*p,t[8]=(o*r-n*a)*p,t):null},i.adjoint=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8];return t[0]=o*c-s*u,t[1]=i*u-n*c,t[2]=n*s-i*o,t[3]=s*l-a*c,t[4]=r*c-i*l,t[5]=i*a-r*s,t[6]=a*u-o*l,t[7]=n*l-r*u,t[8]=r*o-n*a,t},i.determinant=function(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8];return e*(u*a-o*l)+r*(-u*i+o*s)+n*(l*i-a*s)},i.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=r[0],d=r[1],p=r[2],m=r[3],g=r[4],v=r[5],y=r[6],x=r[7],b=r[8];return t[0]=f*n+d*o+p*u,t[1]=f*i+d*s+p*c,t[2]=f*a+d*l+p*h,t[3]=m*n+g*o+v*u,t[4]=m*i+g*s+v*c,t[5]=m*a+g*l+v*h,t[6]=y*n+x*o+b*u,t[7]=y*i+x*s+b*c,t[8]=y*a+x*l+b*h,t},i.mul=i.multiply,i.translate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=f*n+d*o+u,t[7]=f*i+d*s+c,t[8]=f*a+d*l+h,t},i.rotate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=Math.sin(r),d=Math.cos(r);return t[0]=d*n+f*o,t[1]=d*i+f*s,t[2]=d*a+f*l,t[3]=d*o-f*n,t[4]=d*s-f*i,t[5]=d*l-f*a,t[6]=u,t[7]=c,t[8]=h,t},i.scale=function(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},i.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},i.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},i.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},i.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},i.fromQuat=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,u=r*o,c=n*o,h=n*s,f=i*o,d=i*s,p=i*l,m=a*o,g=a*s,v=a*l;return t[0]=1-h-p,t[3]=c-v,t[6]=f+g,t[1]=c+v,t[4]=1-u-p,t[7]=d-m,t[2]=f-g,t[5]=d+m,t[8]=1-u-h,t},i.normalFromMat4=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*s-n*o,x=r*l-i*o,b=r*u-a*o,_=n*l-i*s,w=n*u-a*s,M=i*u-a*l,A=c*m-h*p,k=c*g-f*p,T=c*v-d*p,E=h*g-f*m,S=h*v-d*m,L=f*v-d*g,C=y*L-x*S+b*E+_*T-w*k+M*A;return C?(C=1/C,t[0]=(s*L-l*S+u*E)*C,t[1]=(l*T-o*L-u*k)*C,t[2]=(o*S-s*T+u*A)*C,t[3]=(i*S-n*L-a*E)*C,t[4]=(r*L-i*T+a*k)*C,t[5]=(n*T-r*S-a*A)*C,t[6]=(m*M-g*w+v*_)*C,t[7]=(g*b-p*M-v*x)*C,t[8]=(p*w-m*b+v*y)*C,t):null},i.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},i.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t},i.sub=i.subtract,i.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t},i.multiplyScalarAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],f=e[0],d=e[1],p=e[2],m=e[3],g=e[4],v=e[5],y=t[6],x=e[7],b=e[8];return Math.abs(r-f)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(i-d)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(a-p)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(o-m)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(s-g)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(l-v)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(v))&&Math.abs(u-y)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-x)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(x))&&Math.abs(h-b)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(b))},e.exports=i},{"./common.js":167}],171:[function(t,e,r){var n=t("./common.js"),i={scalar:{},SIMD:{}};i.create=function(){var t=new n.ARRAY_TYPE(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.clone=function(t){var e=new n.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},i.fromValues=function(t,e,r,i,a,o,s,l,u,c,h,f,d,p,m,g){var v=new n.ARRAY_TYPE(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=i,v[4]=a,v[5]=o,v[6]=s,v[7]=l,v[8]=u,v[9]=c,v[10]=h,v[11]=f,v[12]=d,v[13]=p,v[14]=m,v[15]=g,v},i.set=function(t,e,r,n,i,a,o,s,l,u,c,h,f,d,p,m,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=l,t[8]=u,t[9]=c,t[10]=h,t[11]=f,t[12]=d,t[13]=p,t[14]=m,t[15]=g,t},i.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.scalar.transpose=function(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},i.SIMD.transpose=function(t,e){var r,n,i,a,o,s,l,u,c,h;return r=SIMD.Float32x4.load(e,0),n=SIMD.Float32x4.load(e,4),i=SIMD.Float32x4.load(e,8),a=SIMD.Float32x4.load(e,12),o=SIMD.Float32x4.shuffle(r,n,0,1,4,5),s=SIMD.Float32x4.shuffle(i,a,0,1,4,5),l=SIMD.Float32x4.shuffle(o,s,0,2,4,6),u=SIMD.Float32x4.shuffle(o,s,1,3,5,7),SIMD.Float32x4.store(t,0,l),SIMD.Float32x4.store(t,4,u),o=SIMD.Float32x4.shuffle(r,n,2,3,6,7),s=SIMD.Float32x4.shuffle(i,a,2,3,6,7),c=SIMD.Float32x4.shuffle(o,s,0,2,4,6),h=SIMD.Float32x4.shuffle(o,s,1,3,5,7),SIMD.Float32x4.store(t,8,c),SIMD.Float32x4.store(t,12,h),t},i.transpose=n.USE_SIMD?i.SIMD.transpose:i.scalar.transpose,i.scalar.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*s-n*o,x=r*l-i*o,b=r*u-a*o,_=n*l-i*s,w=n*u-a*s,M=i*u-a*l,A=c*m-h*p,k=c*g-f*p,T=c*v-d*p,E=h*g-f*m,S=h*v-d*m,L=f*v-d*g,C=y*L-x*S+b*E+_*T-w*k+M*A;return C?(C=1/C,t[0]=(s*L-l*S+u*E)*C,t[1]=(i*S-n*L-a*E)*C,t[2]=(m*M-g*w+v*_)*C,t[3]=(f*w-h*M-d*_)*C,t[4]=(l*T-o*L-u*k)*C,t[5]=(r*L-i*T+a*k)*C,t[6]=(g*b-p*M-v*x)*C,t[7]=(c*M-f*b+d*x)*C,t[8]=(o*S-s*T+u*A)*C,t[9]=(n*T-r*S-a*A)*C,t[10]=(p*w-m*b+v*y)*C,t[11]=(h*b-c*w-d*y)*C,t[12]=(s*k-o*E-l*A)*C,t[13]=(r*E-n*k+i*A)*C,t[14]=(m*x-p*_-g*y)*C,t[15]=(c*_-h*x+f*y)*C,t):null},i.SIMD.invert=function(t,e){var r,n,i,a,o,s,l,u,c,h,f=SIMD.Float32x4.load(e,0),d=SIMD.Float32x4.load(e,4),p=SIMD.Float32x4.load(e,8),m=SIMD.Float32x4.load(e,12);return o=SIMD.Float32x4.shuffle(f,d,0,1,4,5),n=SIMD.Float32x4.shuffle(p,m,0,1,4,5),r=SIMD.Float32x4.shuffle(o,n,0,2,4,6),n=SIMD.Float32x4.shuffle(n,o,1,3,5,7),o=SIMD.Float32x4.shuffle(f,d,2,3,6,7),a=SIMD.Float32x4.shuffle(p,m,2,3,6,7),i=SIMD.Float32x4.shuffle(o,a,0,2,4,6),a=SIMD.Float32x4.shuffle(a,o,1,3,5,7),o=SIMD.Float32x4.mul(i,a),o=SIMD.Float32x4.swizzle(o,1,0,3,2),s=SIMD.Float32x4.mul(n,o),l=SIMD.Float32x4.mul(r,o),o=SIMD.Float32x4.swizzle(o,2,3,0,1),s=SIMD.Float32x4.sub(SIMD.Float32x4.mul(n,o),s),l=SIMD.Float32x4.sub(SIMD.Float32x4.mul(r,o),l),l=SIMD.Float32x4.swizzle(l,2,3,0,1),o=SIMD.Float32x4.mul(n,i),o=SIMD.Float32x4.swizzle(o,1,0,3,2),s=SIMD.Float32x4.add(SIMD.Float32x4.mul(a,o),s),c=SIMD.Float32x4.mul(r,o),o=SIMD.Float32x4.swizzle(o,2,3,0,1),s=SIMD.Float32x4.sub(s,SIMD.Float32x4.mul(a,o)),c=SIMD.Float32x4.sub(SIMD.Float32x4.mul(r,o),c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),o=SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(n,2,3,0,1),a),o=SIMD.Float32x4.swizzle(o,1,0,3,2),i=SIMD.Float32x4.swizzle(i,2,3,0,1),s=SIMD.Float32x4.add(SIMD.Float32x4.mul(i,o),s),u=SIMD.Float32x4.mul(r,o),o=SIMD.Float32x4.swizzle(o,2,3,0,1),s=SIMD.Float32x4.sub(s,SIMD.Float32x4.mul(i,o)),u=SIMD.Float32x4.sub(SIMD.Float32x4.mul(r,o),u),u=SIMD.Float32x4.swizzle(u,2,3,0,1),o=SIMD.Float32x4.mul(r,n),o=SIMD.Float32x4.swizzle(o,1,0,3,2),u=SIMD.Float32x4.add(SIMD.Float32x4.mul(a,o),u),c=SIMD.Float32x4.sub(SIMD.Float32x4.mul(i,o),c),o=SIMD.Float32x4.swizzle(o,2,3,0,1),u=SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,o),u),c=SIMD.Float32x4.sub(c,SIMD.Float32x4.mul(i,o)),o=SIMD.Float32x4.mul(r,a),o=SIMD.Float32x4.swizzle(o,1,0,3,2),l=SIMD.Float32x4.sub(l,SIMD.Float32x4.mul(i,o)),u=SIMD.Float32x4.add(SIMD.Float32x4.mul(n,o),u),o=SIMD.Float32x4.swizzle(o,2,3,0,1),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(i,o),l),u=SIMD.Float32x4.sub(u,SIMD.Float32x4.mul(n,o)),o=SIMD.Float32x4.mul(r,i),o=SIMD.Float32x4.swizzle(o,1,0,3,2),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(a,o),l),c=SIMD.Float32x4.sub(c,SIMD.Float32x4.mul(n,o)),o=SIMD.Float32x4.swizzle(o,2,3,0,1),l=SIMD.Float32x4.sub(l,SIMD.Float32x4.mul(a,o)),c=SIMD.Float32x4.add(SIMD.Float32x4.mul(n,o),c),h=SIMD.Float32x4.mul(r,s),h=SIMD.Float32x4.add(SIMD.Float32x4.swizzle(h,2,3,0,1),h),h=SIMD.Float32x4.add(SIMD.Float32x4.swizzle(h,1,0,3,2),h),o=SIMD.Float32x4.reciprocalApproximation(h),h=SIMD.Float32x4.sub(SIMD.Float32x4.add(o,o),SIMD.Float32x4.mul(h,SIMD.Float32x4.mul(o,o))),(h=SIMD.Float32x4.swizzle(h,0,0,0,0))?(SIMD.Float32x4.store(t,0,SIMD.Float32x4.mul(h,s)),SIMD.Float32x4.store(t,4,SIMD.Float32x4.mul(h,l)),SIMD.Float32x4.store(t,8,SIMD.Float32x4.mul(h,u)),SIMD.Float32x4.store(t,12,SIMD.Float32x4.mul(h,c)),t):null},i.invert=n.USE_SIMD?i.SIMD.invert:i.scalar.invert,i.scalar.adjoint=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15];return t[0]=s*(f*v-d*g)-h*(l*v-u*g)+m*(l*d-u*f),t[1]=-(n*(f*v-d*g)-h*(i*v-a*g)+m*(i*d-a*f)),t[2]=n*(l*v-u*g)-s*(i*v-a*g)+m*(i*u-a*l),t[3]=-(n*(l*d-u*f)-s*(i*d-a*f)+h*(i*u-a*l)),t[4]=-(o*(f*v-d*g)-c*(l*v-u*g)+p*(l*d-u*f)),t[5]=r*(f*v-d*g)-c*(i*v-a*g)+p*(i*d-a*f),t[6]=-(r*(l*v-u*g)-o*(i*v-a*g)+p*(i*u-a*l)),t[7]=r*(l*d-u*f)-o*(i*d-a*f)+c*(i*u-a*l),t[8]=o*(h*v-d*m)-c*(s*v-u*m)+p*(s*d-u*h),t[9]=-(r*(h*v-d*m)-c*(n*v-a*m)+p*(n*d-a*h)),t[10]=r*(s*v-u*m)-o*(n*v-a*m)+p*(n*u-a*s),t[11]=-(r*(s*d-u*h)-o*(n*d-a*h)+c*(n*u-a*s)),t[12]=-(o*(h*g-f*m)-c*(s*g-l*m)+p*(s*f-l*h)),t[13]=r*(h*g-f*m)-c*(n*g-i*m)+p*(n*f-i*h),t[14]=-(r*(s*g-l*m)-o*(n*g-i*m)+p*(n*l-i*s)),t[15]=r*(s*f-l*h)-o*(n*f-i*h)+c*(n*l-i*s),t},i.SIMD.adjoint=function(t,e){var r,n,i,a,o,s,l,u,c,h,f,d,p,r=SIMD.Float32x4.load(e,0),n=SIMD.Float32x4.load(e,4),i=SIMD.Float32x4.load(e,8),a=SIMD.Float32x4.load(e,12);return c=SIMD.Float32x4.shuffle(r,n,0,1,4,5),s=SIMD.Float32x4.shuffle(i,a,0,1,4,5),o=SIMD.Float32x4.shuffle(c,s,0,2,4,6),s=SIMD.Float32x4.shuffle(s,c,1,3,5,7),c=SIMD.Float32x4.shuffle(r,n,2,3,6,7),u=SIMD.Float32x4.shuffle(i,a,2,3,6,7),l=SIMD.Float32x4.shuffle(c,u,0,2,4,6),u=SIMD.Float32x4.shuffle(u,c,1,3,5,7),c=SIMD.Float32x4.mul(l,u),c=SIMD.Float32x4.swizzle(c,1,0,3,2),h=SIMD.Float32x4.mul(s,c),f=SIMD.Float32x4.mul(o,c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),h=SIMD.Float32x4.sub(SIMD.Float32x4.mul(s,c),h),f=SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,c),f),f=SIMD.Float32x4.swizzle(f,2,3,0,1),c=SIMD.Float32x4.mul(s,l),c=SIMD.Float32x4.swizzle(c,1,0,3,2),h=SIMD.Float32x4.add(SIMD.Float32x4.mul(u,c),h),p=SIMD.Float32x4.mul(o,c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),h=SIMD.Float32x4.sub(h,SIMD.Float32x4.mul(u,c)),p=SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,c),p),p=SIMD.Float32x4.swizzle(p,2,3,0,1),c=SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,2,3,0,1),u),c=SIMD.Float32x4.swizzle(c,1,0,3,2),l=SIMD.Float32x4.swizzle(l,2,3,0,1),h=SIMD.Float32x4.add(SIMD.Float32x4.mul(l,c),h),d=SIMD.Float32x4.mul(o,c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),h=SIMD.Float32x4.sub(h,SIMD.Float32x4.mul(l,c)),d=SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,c),d),d=SIMD.Float32x4.swizzle(d,2,3,0,1),c=SIMD.Float32x4.mul(o,s),c=SIMD.Float32x4.swizzle(c,1,0,3,2),d=SIMD.Float32x4.add(SIMD.Float32x4.mul(u,c),d),p=SIMD.Float32x4.sub(SIMD.Float32x4.mul(l,c),p),c=SIMD.Float32x4.swizzle(c,2,3,0,1),d=SIMD.Float32x4.sub(SIMD.Float32x4.mul(u,c),d),p=SIMD.Float32x4.sub(p,SIMD.Float32x4.mul(l,c)),c=SIMD.Float32x4.mul(o,u),c=SIMD.Float32x4.swizzle(c,1,0,3,2),f=SIMD.Float32x4.sub(f,SIMD.Float32x4.mul(l,c)),d=SIMD.Float32x4.add(SIMD.Float32x4.mul(s,c),d),c=SIMD.Float32x4.swizzle(c,2,3,0,1),f=SIMD.Float32x4.add(SIMD.Float32x4.mul(l,c),f),d=SIMD.Float32x4.sub(d,SIMD.Float32x4.mul(s,c)),c=SIMD.Float32x4.mul(o,l),c=SIMD.Float32x4.swizzle(c,1,0,3,2),f=SIMD.Float32x4.add(SIMD.Float32x4.mul(u,c),f),p=SIMD.Float32x4.sub(p,SIMD.Float32x4.mul(s,c)),c=SIMD.Float32x4.swizzle(c,2,3,0,1),f=SIMD.Float32x4.sub(f,SIMD.Float32x4.mul(u,c)),p=SIMD.Float32x4.add(SIMD.Float32x4.mul(s,c),p),SIMD.Float32x4.store(t,0,h),SIMD.Float32x4.store(t,4,f),SIMD.Float32x4.store(t,8,d),SIMD.Float32x4.store(t,12,p),t},i.adjoint=n.USE_SIMD?i.SIMD.adjoint:i.scalar.adjoint,i.determinant=function(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15],v=e*o-r*a,y=e*s-n*a,x=e*l-i*a,b=r*s-n*o,_=r*l-i*o,w=n*l-i*s,M=u*p-c*d,A=u*m-h*d,k=u*g-f*d,T=c*m-h*p,E=c*g-f*p,S=h*g-f*m;return v*S-y*E+x*T+b*k-_*A+w*M},i.SIMD.multiply=function(t,e,r){var n=SIMD.Float32x4.load(e,0),i=SIMD.Float32x4.load(e,4),a=SIMD.Float32x4.load(e,8),o=SIMD.Float32x4.load(e,12),s=SIMD.Float32x4.load(r,0),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,0,0,0,0),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,1,1,1,1),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,2,2,2,2),a),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,3,3,3,3),o))));SIMD.Float32x4.store(t,0,l);var u=SIMD.Float32x4.load(r,4),c=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,0,0,0,0),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,1,1,1,1),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,2,2,2,2),a),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,3,3,3,3),o))));SIMD.Float32x4.store(t,4,c);var h=SIMD.Float32x4.load(r,8),f=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,0,0,0,0),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,1,1,1,1),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,2,2,2,2),a),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,3,3,3,3),o))));SIMD.Float32x4.store(t,8,f);var d=SIMD.Float32x4.load(r,12),p=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,0,0,0,0),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,1,1,1,1),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,2,2,2,2),a),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,3,3,3,3),o))));return SIMD.Float32x4.store(t,12,p),t},i.scalar.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=e[9],d=e[10],p=e[11],m=e[12],g=e[13],v=e[14],y=e[15],x=r[0],b=r[1],_=r[2],w=r[3];return t[0]=x*n+b*s+_*h+w*m,t[1]=x*i+b*l+_*f+w*g,t[2]=x*a+b*u+_*d+w*v,t[3]=x*o+b*c+_*p+w*y,x=r[4],b=r[5],_=r[6],w=r[7],t[4]=x*n+b*s+_*h+w*m,t[5]=x*i+b*l+_*f+w*g,t[6]=x*a+b*u+_*d+w*v,t[7]=x*o+b*c+_*p+w*y,x=r[8],b=r[9],_=r[10],w=r[11],t[8]=x*n+b*s+_*h+w*m,t[9]=x*i+b*l+_*f+w*g,t[10]=x*a+b*u+_*d+w*v,t[11]=x*o+b*c+_*p+w*y,x=r[12],b=r[13],_=r[14],w=r[15],t[12]=x*n+b*s+_*h+w*m,t[13]=x*i+b*l+_*f+w*g,t[14]=x*a+b*u+_*d+w*v,t[15]=x*o+b*c+_*p+w*y,t},i.multiply=n.USE_SIMD?i.SIMD.multiply:i.scalar.multiply,i.mul=i.multiply,i.scalar.translate=function(t,e,r){var n,i,a,o,s,l,u,c,h,f,d,p,m=r[0],g=r[1],v=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*v+e[12],t[13]=e[1]*m+e[5]*g+e[9]*v+e[13],t[14]=e[2]*m+e[6]*g+e[10]*v+e[14],t[15]=e[3]*m+e[7]*g+e[11]*v+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=f,t[10]=d,t[11]=p,t[12]=n*m+s*g+h*v+e[12],t[13]=i*m+l*g+f*v+e[13],t[14]=a*m+u*g+d*v+e[14],t[15]=o*m+c*g+p*v+e[15]),t},i.SIMD.translate=function(t,e,r){var n=SIMD.Float32x4.load(e,0),i=SIMD.Float32x4.load(e,4),a=SIMD.Float32x4.load(e,8),o=SIMD.Float32x4.load(e,12),s=SIMD.Float32x4(r[0],r[1],r[2],0);e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11]),n=SIMD.Float32x4.mul(n,SIMD.Float32x4.swizzle(s,0,0,0,0)),i=SIMD.Float32x4.mul(i,SIMD.Float32x4.swizzle(s,1,1,1,1)),a=SIMD.Float32x4.mul(a,SIMD.Float32x4.swizzle(s,2,2,2,2));var l=SIMD.Float32x4.add(n,SIMD.Float32x4.add(i,SIMD.Float32x4.add(a,o)));return SIMD.Float32x4.store(t,12,l),t},i.translate=n.USE_SIMD?i.SIMD.translate:i.scalar.translate,i.scalar.scale=function(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},i.SIMD.scale=function(t,e,r){var n,i,a,o=SIMD.Float32x4(r[0],r[1],r[2],0);return n=SIMD.Float32x4.load(e,0),SIMD.Float32x4.store(t,0,SIMD.Float32x4.mul(n,SIMD.Float32x4.swizzle(o,0,0,0,0))),i=SIMD.Float32x4.load(e,4),SIMD.Float32x4.store(t,4,SIMD.Float32x4.mul(i,SIMD.Float32x4.swizzle(o,1,1,1,1))),a=SIMD.Float32x4.load(e,8),SIMD.Float32x4.store(t,8,SIMD.Float32x4.mul(a,SIMD.Float32x4.swizzle(o,2,2,2,2))),t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},i.scale=n.USE_SIMD?i.SIMD.scale:i.scalar.scale,i.rotate=function(t,e,r,i){var a,o,s,l,u,c,h,f,d,p,m,g,v,y,x,b,_,w,M,A,k,T,E,S,L=i[0],C=i[1],I=i[2],z=Math.sqrt(L*L+C*C+I*I);return Math.abs(z)<n.EPSILON?null:(z=1/z,L*=z,C*=z,I*=z,a=Math.sin(r),o=Math.cos(r),s=1-o,l=e[0],u=e[1],c=e[2],h=e[3],f=e[4],d=e[5],p=e[6],m=e[7],g=e[8],v=e[9],y=e[10],x=e[11],b=L*L*s+o,_=C*L*s+I*a,w=I*L*s-C*a,M=L*C*s-I*a,A=C*C*s+o,k=I*C*s+L*a,T=L*I*s+C*a,E=C*I*s-L*a,S=I*I*s+o,t[0]=l*b+f*_+g*w,t[1]=u*b+d*_+v*w,t[2]=c*b+p*_+y*w,t[3]=h*b+m*_+x*w,t[4]=l*M+f*A+g*k,t[5]=u*M+d*A+v*k,t[6]=c*M+p*A+y*k,t[7]=h*M+m*A+x*k,t[8]=l*T+f*E+g*S,t[9]=u*T+d*E+v*S,t[10]=c*T+p*E+y*S,t[11]=h*T+m*E+x*S,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},i.scalar.rotateX=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+u*n,t[5]=o*i+c*n,t[6]=s*i+h*n,t[7]=l*i+f*n,t[8]=u*i-a*n,t[9]=c*i-o*n,t[10]=h*i-s*n,t[11]=f*i-l*n,t},i.SIMD.rotateX=function(t,e,r){var n=SIMD.Float32x4.splat(Math.sin(r)),i=SIMD.Float32x4.splat(Math.cos(r));e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);var a=SIMD.Float32x4.load(e,4),o=SIMD.Float32x4.load(e,8);return SIMD.Float32x4.store(t,4,SIMD.Float32x4.add(SIMD.Float32x4.mul(a,i),SIMD.Float32x4.mul(o,n))),SIMD.Float32x4.store(t,8,SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,i),SIMD.Float32x4.mul(a,n))),t},i.rotateX=n.USE_SIMD?i.SIMD.rotateX:i.scalar.rotateX,i.scalar.rotateY=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i-u*n,t[1]=o*i-c*n,t[2]=s*i-h*n,t[3]=l*i-f*n,t[8]=a*n+u*i,t[9]=o*n+c*i,t[10]=s*n+h*i,t[11]=l*n+f*i,t},i.SIMD.rotateY=function(t,e,r){var n=SIMD.Float32x4.splat(Math.sin(r)),i=SIMD.Float32x4.splat(Math.cos(r));e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);var a=SIMD.Float32x4.load(e,0),o=SIMD.Float32x4.load(e,8);return SIMD.Float32x4.store(t,0,SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,i),SIMD.Float32x4.mul(o,n))),SIMD.Float32x4.store(t,8,SIMD.Float32x4.add(SIMD.Float32x4.mul(a,n),SIMD.Float32x4.mul(o,i))),t},i.rotateY=n.USE_SIMD?i.SIMD.rotateY:i.scalar.rotateY,i.scalar.rotateZ=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[4],c=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+u*n,t[1]=o*i+c*n,t[2]=s*i+h*n,t[3]=l*i+f*n,t[4]=u*i-a*n,t[5]=c*i-o*n,t[6]=h*i-s*n,t[7]=f*i-l*n,t},i.SIMD.rotateZ=function(t,e,r){var n=SIMD.Float32x4.splat(Math.sin(r)),i=SIMD.Float32x4.splat(Math.cos(r));e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);var a=SIMD.Float32x4.load(e,0),o=SIMD.Float32x4.load(e,4);return SIMD.Float32x4.store(t,0,SIMD.Float32x4.add(SIMD.Float32x4.mul(a,i),SIMD.Float32x4.mul(o,n))),SIMD.Float32x4.store(t,4,SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,i),SIMD.Float32x4.mul(a,n))),t},i.rotateZ=n.USE_SIMD?i.SIMD.rotateZ:i.scalar.rotateZ,i.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t},i.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.fromRotation=function(t,e,r){var i,a,o,s=r[0],l=r[1],u=r[2],c=Math.sqrt(s*s+l*l+u*u);return Math.abs(c)<n.EPSILON?null:(c=1/c,s*=c,l*=c,u*=c,i=Math.sin(e),a=Math.cos(e),o=1-a,t[0]=s*s*o+a,t[1]=l*s*o+u*i,t[2]=u*s*o-l*i,t[3]=0,t[4]=s*l*o-u*i,t[5]=l*l*o+a,t[6]=u*l*o+s*i,t[7]=0,t[8]=s*u*o+l*i,t[9]=l*u*o-s*i,t[10]=u*u*o+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},i.fromXRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.fromYRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.fromZRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.fromRotationTranslation=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=n+n,l=i+i,u=a+a,c=n*s,h=n*l,f=n*u,d=i*l,p=i*u,m=a*u,g=o*s,v=o*l,y=o*u;return t[0]=1-(d+m),t[1]=h+y,t[2]=f-v,t[3]=0,t[4]=h-y,t[5]=1-(c+m),t[6]=p+g,t[7]=0,t[8]=f+v,t[9]=p-g,t[10]=1-(c+d),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},i.getTranslation=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},i.getRotation=function(t,e){var r=e[0]+e[5]+e[10],n=0;return r>0?(n=2*Math.sqrt(r+1),t[3]=.25*n,t[0]=(e[6]-e[9])/n,t[1]=(e[8]-e[2])/n,t[2]=(e[1]-e[4])/n):e[0]>e[5]&e[0]>e[10]?(n=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/n,t[0]=.25*n,t[1]=(e[1]+e[4])/n,t[2]=(e[8]+e[2])/n):e[5]>e[10]?(n=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/n,t[0]=(e[1]+e[4])/n,t[1]=.25*n,t[2]=(e[6]+e[9])/n):(n=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/n,t[0]=(e[8]+e[2])/n,t[1]=(e[6]+e[9])/n,t[2]=.25*n),t},i.fromRotationTranslationScale=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3],l=i+i,u=a+a,c=o+o,h=i*l,f=i*u,d=i*c,p=a*u,m=a*c,g=o*c,v=s*l,y=s*u,x=s*c,b=n[0],_=n[1],w=n[2];return t[0]=(1-(p+g))*b,t[1]=(f+x)*b,t[2]=(d-y)*b,t[3]=0,t[4]=(f-x)*_,t[5]=(1-(h+g))*_,t[6]=(m+v)*_,t[7]=0,t[8]=(d+y)*w,t[9]=(m-v)*w,t[10]=(1-(h+p))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},i.fromRotationTranslationScaleOrigin=function(t,e,r,n,i){var a=e[0],o=e[1],s=e[2],l=e[3],u=a+a,c=o+o,h=s+s,f=a*u,d=a*c,p=a*h,m=o*c,g=o*h,v=s*h,y=l*u,x=l*c,b=l*h,_=n[0],w=n[1],M=n[2],A=i[0],k=i[1],T=i[2];return t[0]=(1-(m+v))*_,t[1]=(d+b)*_,t[2]=(p-x)*_,t[3]=0,t[4]=(d-b)*w,t[5]=(1-(f+v))*w,t[6]=(g+y)*w,t[7]=0,t[8]=(p+x)*M,t[9]=(g-y)*M,t[10]=(1-(f+m))*M,t[11]=0,t[12]=r[0]+A-(t[0]*A+t[4]*k+t[8]*T),t[13]=r[1]+k-(t[1]*A+t[5]*k+t[9]*T),t[14]=r[2]+T-(t[2]*A+t[6]*k+t[10]*T),t[15]=1,t},i.fromQuat=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,u=r*o,c=n*o,h=n*s,f=i*o,d=i*s,p=i*l,m=a*o,g=a*s,v=a*l;return t[0]=1-h-p,t[1]=c+v,t[2]=f-g,t[3]=0,t[4]=c-v,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=f+g,t[9]=d-m,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.frustum=function(t,e,r,n,i,a,o){var s=1/(r-e),l=1/(i-n),u=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*l,t[10]=(o+a)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*u,t[15]=0,t},i.perspective=function(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t},i.perspectiveFromFieldOfView=function(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),u=2/(i+a);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-((o-s)*l*.5),t[9]=(i-a)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t},i.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),u=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*u,t[15]=1,t},i.lookAt=function(t,e,r,a){var o,s,l,u,c,h,f,d,p,m,g=e[0],v=e[1],y=e[2],x=a[0],b=a[1],_=a[2],w=r[0],M=r[1],A=r[2];return Math.abs(g-w)<n.EPSILON&&Math.abs(v-M)<n.EPSILON&&Math.abs(y-A)<n.EPSILON?i.identity(t):(f=g-w,d=v-M,p=y-A,m=1/Math.sqrt(f*f+d*d+p*p),f*=m,d*=m,p*=m,o=b*p-_*d,s=_*f-x*p,l=x*d-b*f,m=Math.sqrt(o*o+s*s+l*l),m?(m=1/m,o*=m,s*=m,l*=m):(o=0,s=0,l=0),u=d*l-p*s,c=p*o-f*l,h=f*s-d*o,m=Math.sqrt(u*u+c*c+h*h),m?(m=1/m,u*=m,c*=m,h*=m):(u=0,c=0,h=0),t[0]=o,t[1]=u,t[2]=f,t[3]=0,t[4]=s,t[5]=c,t[6]=d,t[7]=0,t[8]=l,t[9]=h,t[10]=p,t[11]=0,t[12]=-(o*g+s*v+l*y),t[13]=-(u*g+c*v+h*y),t[14]=-(f*g+d*v+p*y),t[15]=1,t)},i.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},i.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t},i.sub=i.subtract,i.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t},i.multiplyScalarAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],f=t[9],d=t[10],p=t[11],m=t[12],g=t[13],v=t[14],y=t[15],x=e[0],b=e[1],_=e[2],w=e[3],M=e[4],A=e[5],k=e[6],T=e[7],E=e[8],S=e[9],L=e[10],C=e[11],I=e[12],z=e[13],D=e[14],P=e[15];return Math.abs(r-x)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(x))&&Math.abs(i-b)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(a-_)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(o-w)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-M)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(l-A)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(A))&&Math.abs(u-k)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(k))&&Math.abs(c-T)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(h-E)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(E))&&Math.abs(f-S)<=n.EPSILON*Math.max(1,Math.abs(f),Math.abs(S))&&Math.abs(d-L)<=n.EPSILON*Math.max(1,Math.abs(d),Math.abs(L))&&Math.abs(p-C)<=n.EPSILON*Math.max(1,Math.abs(p),Math.abs(C))&&Math.abs(m-I)<=n.EPSILON*Math.max(1,Math.abs(m),Math.abs(I))&&Math.abs(g-z)<=n.EPSILON*Math.max(1,Math.abs(g),Math.abs(z))&&Math.abs(v-D)<=n.EPSILON*Math.max(1,Math.abs(v),Math.abs(D))&&Math.abs(y-P)<=n.EPSILON*Math.max(1,Math.abs(y),Math.abs(P))},e.exports=i},{"./common.js":167}],172:[function(t,e,r){var n=t("./common.js"),i=t("./mat3.js"),a=t("./vec3.js"),o=t("./vec4.js"),s={};s.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},s.rotationTo=function(){var t=a.create(),e=a.fromValues(1,0,0),r=a.fromValues(0,1,0);return function(n,i,o){var l=a.dot(i,o);return l<-.999999?(a.cross(t,e,i),a.length(t)<1e-6&&a.cross(t,r,i),a.normalize(t,t),s.setAxisAngle(n,t,Math.PI),n):l>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(a.cross(t,i,o),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+l,s.normalize(n,n))}}(),s.setAxes=function(){var t=i.create();return function(e,r,n,i){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],s.normalize(e,s.fromMat3(e,t))}}(),s.clone=o.clone,s.fromValues=o.fromValues,s.copy=o.copy,s.set=o.set,s.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},s.setAxisAngle=function(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t},s.getAxisAngle=function(t,e){var r=2*Math.acos(e[3]),n=Math.sin(r/2);return 0!=n?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r},s.add=o.add,s.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1],u=r[2],c=r[3];return t[0]=n*c+o*s+i*u-a*l,t[1]=i*c+o*l+a*s-n*u,t[2]=a*c+o*u+n*l-i*s,t[3]=o*c-n*s-i*l-a*u,t},s.mul=s.multiply,s.scale=o.scale,s.rotateX=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+o*s,t[1]=i*l+a*s,t[2]=a*l-i*s,t[3]=o*l-n*s,t},s.rotateY=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l-a*s,t[1]=i*l+o*s,t[2]=a*l+n*s,t[3]=o*l-i*s,t},s.rotateZ=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+i*s,t[1]=i*l-n*s,t[2]=a*l+o*s,t[3]=o*l-a*s,t},s.calculateW=function(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t},s.dot=o.dot,s.lerp=o.lerp,s.slerp=function(t,e,r,n){var i,a,o,s,l,u=e[0],c=e[1],h=e[2],f=e[3],d=r[0],p=r[1],m=r[2],g=r[3];return a=u*d+c*p+h*m+f*g,a<0&&(a=-a,d=-d,p=-p,m=-m,g=-g),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*u+l*d,t[1]=s*c+l*p,t[2]=s*h+l*m,t[3]=s*f+l*g,t},s.sqlerp=function(){var t=s.create(),e=s.create();return function(r,n,i,a,o,l){return s.slerp(t,n,o,l),s.slerp(e,i,a,l),s.slerp(r,t,e,2*l*(1-l)),r}}(),s.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;return t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=a*s,t},s.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},s.length=o.length,s.len=s.length,s.squaredLength=o.squaredLength,s.sqrLen=s.squaredLength,s.normalize=o.normalize,s.fromMat3=function(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*a+a]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*a+o]-e[3*o+a])*r,t[a]=(e[3*a+i]+e[3*i+a])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t},s.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},s.exactEquals=o.exactEquals,s.equals=o.equals,e.exports=s},{"./common.js":167,"./mat3.js":170,"./vec3.js":174,"./vec4.js":175}],173:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},i.fromValues=function(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},i.set=function(t,e,r){return t[0]=e,t[1]=r,t},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t},i.sub=i.subtract,i.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t},i.mul=i.multiply,i.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},i.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t},i.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},i.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t},i.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t},i.distance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(r*r+n*n)},i.dist=i.distance,i.squaredDistance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],r=t[1];return Math.sqrt(e*e+r*r)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1];return e*e+r*r},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},i.cross=function(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t},i.lerp=function(t,e,r,n){var i=e[0],a=e[1];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t},i.transformMat2=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t},i.transformMat2d=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t},i.transformMat3=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=2),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s<l;s+=r)t[0]=e[s],t[1]=e[s+1],a(t,t,o),e[s]=t[0],e[s+1]=t[1];return e}}(),i.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},i.equals=function(t,e){var r=t[0],i=t[1],a=e[0],o=e[1];return Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-o)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))},e.exports=i},{"./common.js":167}],174:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(3);return t[0]=0,t[1]=0,t[2]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},i.fromValues=function(t,e,r){var i=new n.ARRAY_TYPE(3);return i[0]=t,i[1]=e,i[2]=r,i},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},i.set=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t},i.sub=i.subtract,i.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t},i.mul=i.multiply,i.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t},i.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t},i.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t},i.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t},i.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t},i.distance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(r*r+n*n+i*i)},i.dist=i.distance,i.squaredDistance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},i.cross=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t},i.lerp=function(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t},i.hermite=function(t,e,r,n,i,a){var o=a*a,s=o*(2*a-3)+1,l=o*(a-2)+a,u=o*(a-1),c=o*(3-2*a);return t[0]=e[0]*s+r[0]*l+n[0]*u+i[0]*c,t[1]=e[1]*s+r[1]*l+n[1]*u+i[1]*c,t[2]=e[2]*s+r[2]*l+n[2]*u+i[2]*c,t},i.bezier=function(t,e,r,n,i,a){var o=1-a,s=o*o,l=a*a,u=s*o,c=3*a*s,h=3*l*o,f=l*a;return t[0]=e[0]*u+r[0]*c+n[0]*h+i[0]*f,t[1]=e[1]*u+r[1]*c+n[1]*h+i[1]*f,t[2]=e[2]*u+r[2]*c+n[2]*h+i[2]*f,t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI,i=2*n.RANDOM()-1,a=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*a,t[1]=Math.sin(r)*a,t[2]=i*e,t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,t},i.transformMat3=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,h=u*i+l*n-o*a,f=u*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=c*u+d*-o+h*-l-f*-s,t[1]=h*u+d*-s+f*-o-c*-l,t[2]=f*u+d*-l+c*-s-h*-o,t},i.rotateX=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateY=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateZ=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=3),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s<l;s+=r)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],a(t,t,o),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2];return e}}(),i.angle=function(t,e){var r=i.fromValues(t[0],t[1],t[2]),n=i.fromValues(e[0],e[1],e[2]);i.normalize(r,r),i.normalize(n,n);var a=i.dot(r,n);return a>1?0:Math.acos(a)},i.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=e[0],s=e[1],l=e[2];return Math.abs(r-o)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(l))},e.exports=i},{"./common.js":167}],175:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},i.fromValues=function(t,e,r,i){var a=new n.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},i.set=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t},i.sub=i.subtract,i.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t},i.mul=i.multiply,i.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},i.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t},i.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},i.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},i.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t},i.distance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(r*r+n*n+i*i+a*a)},i.dist=i.distance,i.squaredDistance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return r*r+n*n+i*i+a*a},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},i.lerp=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t},i.random=function(t,e){return e=e||1,t[0]=n.RANDOM(),t[1]=n.RANDOM(),t[2]=n.RANDOM(),t[3]=n.RANDOM(),i.normalize(t,t),i.scale(t,t,e),t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,h=u*i+l*n-o*a,f=u*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=c*u+d*-o+h*-l-f*-s,t[1]=h*u+d*-s+f*-o-c*-l,t[2]=f*u+d*-l+c*-s-h*-o,t[3]=e[3],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=4),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s<l;s+=r)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],t[3]=e[s+3],a(t,t,o),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2],e[s+3]=t[3];return e}}(),i.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=e[0],l=e[1],u=e[2],c=e[3];return Math.abs(r-s)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-l)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-u)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(u))&&Math.abs(o-c)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))},e.exports=i},{"./common.js":167}],176:[function(t,e,r){"use strict";function n(t,e){for(var r=[0,0,0,0],n=0;n<4;++n)for(var i=0;i<4;++i)r[i]+=t[4*n+i]*e[n];return r}function i(t,e,r,i,a){for(var o=n(i,n(r,n(e,[t[0],t[1],t[2],1]))),s=0;s<3;++s)o[s]/=o[3];return[.5*a[0]*(1+o[0]),.5*a[1]*(1-o[1])]}function a(t,e){if(2===t.length){for(var r=0,n=0,i=0;i<2;++i)r+=Math.pow(e[i]-t[0][i],2),n+=Math.pow(e[i]-t[1][i],2);return r=Math.sqrt(r),n=Math.sqrt(n),r+n<1e-6?[1,0]:[n/(r+n),r/(n+r)]}if(3===t.length){var a=[0,0];return u(t[0],t[1],t[2],e,a),l(t,a)}return[]}function o(t,e){for(var r=[0,0,0],n=0;n<t.length;++n)for(var i=t[n],a=e[n],o=0;o<3;++o)r[o]+=a*i[o];return r}function s(t,e,r,n,s,l){if(1===t.length)return[0,t[0].slice()];for(var u=new Array(t.length),c=0;c<t.length;++c)u[c]=i(t[c],r,n,s,l);for(var h=0,f=1/0,c=0;c<u.length;++c){for(var d=0,p=0;p<2;++p)d+=Math.pow(u[c][p]-e[p],2);d<f&&(f=d,h=c)}for(var m=a(u,e),g=0,c=0;c<3;++c){if(m[c]<-.001||m[c]>1.0001)return null;g+=m[c]}return Math.abs(g-1)>.001?null:[h,o(t,m),m]}var l=t("barycentric"),u=t("polytope-closest-point/lib/closest_point_2d.js");e.exports=s},{barycentric:38,"polytope-closest-point/lib/closest_point_2d.js":450}],177:[function(t,e,r){var n="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n           , view\n           , projection;\nuniform vec3 eyePosition\n           , lightPosition;\n\nvarying vec3 f_normal\n           , f_lightDirection\n           , f_eyeDirection\n           , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n  vec4 m_position  = model * vec4(position, 1.0);\n  vec4 t_position  = view * m_position;\n  gl_Position      = projection * t_position;\n  f_color          = color;\n  f_normal         = normal;\n  f_data           = position;\n  f_eyeDirection   = eyePosition   - position;\n  f_lightDirection = lightPosition - position;\n  f_uv             = uv;\n}",i="precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution_2_0(float x, float roughness) {\n  float NdotH = max(x, 0.0001);\n  float cos2Alpha = NdotH * NdotH;\n  float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n  float roughness2 = roughness * roughness;\n  float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n  return exp(tan2Alpha / roughness2) / denom;\n}\n\n\n\nfloat cookTorranceSpecular_1_1(\n  vec3 lightDirection,\n  vec3 viewDirection,\n  vec3 surfaceNormal,\n  float roughness,\n  float fresnel) {\n\n  float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n  float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n  //Half angle vector\n  vec3 H = normalize(lightDirection + viewDirection);\n\n  //Geometric term\n  float NdotH = max(dot(surfaceNormal, H), 0.0);\n  float VdotH = max(dot(viewDirection, H), 0.000001);\n  float LdotH = max(dot(lightDirection, H), 0.000001);\n  float G1 = (2.0 * NdotH * VdotN) / VdotH;\n  float G2 = (2.0 * NdotH * LdotN) / LdotH;\n  float G = min(1.0, min(G1, G2));\n  \n  //Distribution term\n  float D = beckmannDistribution_2_0(NdotH, roughness);\n\n  //Fresnel term\n  float F = pow(1.0 - VdotN, fresnel);\n\n  //Multiply terms and done\n  return  G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n            , fresnel\n            , kambient\n            , kdiffuse\n            , kspecular\n            , opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n           , f_lightDirection\n           , f_eyeDirection\n           , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n  if(any(lessThan(f_data, clipBounds[0])) || \n     any(greaterThan(f_data, clipBounds[1]))) {\n    discard;\n  }\n\n  vec3 N = normalize(f_normal);\n  vec3 L = normalize(f_lightDirection);\n  vec3 V = normalize(f_eyeDirection);\n  \n  if(!gl_FrontFacing) {\n    N = -N;\n  }\n\n  float specular = cookTorranceSpecular_1_1(L, V, N, roughness, fresnel);\n  float diffuse  = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n  vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n  vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular,  1.0);\n\n  gl_FragColor = litColor * opacity;\n}",a="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n  gl_Position = projection * view * model * vec4(position, 1.0);\n  f_color = color;\n  f_data  = position;\n  f_uv    = uv;\n}",o="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n  if(any(lessThan(f_data, clipBounds[0])) || \n     any(greaterThan(f_data, clipBounds[1]))) {\n    discard;\n  }\n\n  gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",s="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n  if(any(lessThan(position, clipBounds[0])) || \n     any(greaterThan(position, clipBounds[1]))) {\n    gl_Position = vec4(0,0,0,0);\n  } else {\n    gl_Position = projection * view * model * vec4(position, 1.0);\n  }\n  gl_PointSize = pointSize;\n  f_color = color;\n  f_uv = uv;\n}",l="precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n  vec2 pointR = gl_PointCoord.xy - vec2(0.5,0.5);\n  if(dot(pointR, pointR) > 0.25) {\n    discard;\n  }\n  gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",u="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n  gl_Position = projection * view * model * vec4(position, 1.0);\n  f_id        = id;\n  f_position  = position;\n}",c="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3  clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n  if(any(lessThan(f_position, clipBounds[0])) || \n     any(greaterThan(f_position, clipBounds[1]))) {\n    discard;\n  }\n  gl_FragColor = vec4(pickId, f_id.xyz);\n}",h="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3  position;\nattribute float pointSize;\nattribute vec4  id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n  if(any(lessThan(position, clipBounds[0])) || \n     any(greaterThan(position, clipBounds[1]))) {\n    gl_Position = vec4(0,0,0,0);\n  } else {\n    gl_Position  = projection * view * model * vec4(position, 1.0);\n    gl_PointSize = pointSize;\n  }\n  f_id         = id;\n  f_position   = position;\n}",f="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n  gl_Position = projection * view * model * vec4(position, 1.0);\n}",d="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n  gl_FragColor = vec4(contourColor,1);\n}\n";r.meshShader={vertex:n,fragment:i,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:a,fragment:o,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:s,fragment:l,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:u,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:h,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:f,fragment:d,attributes:[{name:"position",type:"vec3"}]}},{}],178:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,u,c,h,f,d,p,m,g,v,y,x,b,_,w,M,A,k,T){this.gl=t,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=c,this.triangleNormals=f,this.triangleUVs=h,this.triangleIds=u,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=g,this.edgeUVs=v,this.edgeIds=m,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=w,this.pointSizes=M,this.pointIds=b,this.pointVAO=A,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=k,this.contourVAO=T,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],this.clipBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this._model=O,this._view=O,this._projection=O,this._resolution=[1,1]}function i(t){for(var e=A({colormap:t,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var i=e[n],a=0;a<3;++a)r[4*n+a]=i[a];r[4*n+3]=255*i[3]}return M(r,[256,256,4],[4,0,1])}function a(t,e,r){for(var n=new Array(e),i=0;i<e;++i)n[i]=0;for(var a=t.length,i=0;i<a;++i)for(var o=t[i],s=0;s<o.length;++s)n[o[s]]=r[i];return n}function o(t){for(var e=t.length,r=new Array(e),n=0;n<e;++n)r[n]=t[n][2];return r}function s(t){var e=g(t,L);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.normal.location=4,e}function l(t){var e=g(t,C);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e}function u(t){var e=g(t,I);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}function c(t){var e=g(t,z);return e.attributes.position.location=0,e.attributes.id.location=1,e}function h(t){var e=g(t,D);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function f(t){var e=g(t,P);return e.attributes.position.location=0,e}function d(t){var e=t.gl,r=s(e),i=l(e),a=u(e),o=c(e),d=h(e),p=f(e),m=x(e,M(new Uint8Array([255,255,255,255]),[1,1,4]));m.generateMipmap(),m.minFilter=e.LINEAR_MIPMAP_LINEAR,m.magFilter=e.LINEAR;var g=v(e),b=v(e),_=v(e),w=v(e),A=v(e),k=y(e,[{buffer:g,type:e.FLOAT,size:3},{buffer:A,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:b,type:e.FLOAT,size:4},{buffer:_,type:e.FLOAT,size:2},{buffer:w,type:e.FLOAT,size:3}]),T=v(e),E=v(e),S=v(e),L=v(e),C=y(e,[{buffer:T,type:e.FLOAT,size:3},{buffer:L,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:E,type:e.FLOAT,size:4},{buffer:S,type:e.FLOAT,size:2}]),I=v(e),z=v(e),D=v(e),P=v(e),O=v(e),R=y(e,[{buffer:I,type:e.FLOAT,size:3},{buffer:O,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:z,type:e.FLOAT,size:4},{buffer:D,type:e.FLOAT,size:2},{buffer:P,type:e.FLOAT,size:1}]),F=v(e),j=y(e,[{buffer:F,type:e.FLOAT,size:3}]),N=new n(e,m,r,i,a,o,d,p,g,A,b,_,w,k,T,L,E,S,C,I,O,z,D,P,R,F,j);return N.update(t),N}var p=1e-6,m=1e-6,g=t("gl-shader"),v=t("gl-buffer"),y=t("gl-vao"),x=t("gl-texture2d"),b=t("normals"),_=t("gl-mat4/multiply"),w=t("gl-mat4/invert"),M=t("ndarray"),A=t("colormap"),k=t("simplicial-complex-contour"),T=t("typedarray-pool"),E=t("./lib/shaders"),S=t("./lib/closest-point"),L=E.meshShader,C=E.wireShader,I=E.pointShader,z=E.pickShader,D=E.pointPickShader,P=E.contourShader,O=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],R=n.prototype;R.isOpaque=function(){return this.opacity>=1},R.isTransparent=function(){return this.opacity<1},R.pickSlots=1,R.setPickBase=function(t){this.pickId=t},R.highlight=function(t){if(!t||!this.contourEnable)return void(this.contourCount=0);for(var e=k(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=T.mallocFloat32(6*a),s=0,l=0;l<a;++l)for(var u=r[l],c=0;c<2;++c){var h=u[0];2===u.length&&(h=u[c]);for(var f=n[h][0],d=n[h][1],p=i[h],m=1-p,g=this.positions[f],v=this.positions[d],y=0;y<3;++y)o[s++]=p*g[y]+m*v[y]}this.contourCount=s/3|0,this.contourPositions.update(o.subarray(0,s)),T.free(o)},R.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,"contourEnable"in t&&(this.contourEnable=t.contourEnable),"contourColor"in t&&(this.contourColor=t.contourColor),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"lightPosition"in t&&(this.lightPosition=t.lightPosition),"opacity"in t&&(this.opacity=t.opacity),"ambient"in t&&(this.ambientLight=t.ambient),"diffuse"in t&&(this.diffuseLight=t.diffuse),"specular"in t&&(this.specularLight=t.specular),"roughness"in t&&(this.roughness=t.roughness),"fresnel"in t&&(this.fresnel=t.fresnel),t.texture?(this.texture.dispose(),this.texture=x(e,t.texture)):t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(i(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions;if(n&&r){var s=[],l=[],u=[],c=[],h=[],f=[],d=[],g=[],v=[],y=[],_=[],w=[],M=[],A=[];this.cells=r,this.positions=n;var k=t.vertexNormals,T=t.cellNormals,E=void 0===t.vertexNormalsEpsilon?p:t.vertexNormalsEpsilon,S=void 0===t.faceNormalsEpsilon?m:t.faceNormalsEpsilon;t.useFacetNormals&&!T&&(T=b.faceNormals(r,n,S)),T||k||(k=b.vertexNormals(r,n,E));var L=t.vertexColors,C=t.cellColors,I=t.meshColor||[1,1,1,1],z=t.vertexUVs,D=t.vertexIntensity,P=t.cellUVs,O=t.cellIntensity,R=1/0,F=-(1/0);if(!z&&!P)if(D)for(var j=0;j<D.length;++j){var N=D[j];R=Math.min(R,N),F=Math.max(F,N)}else if(O)for(var j=0;j<O.length;++j){var N=O[j];R=Math.min(R,N),F=Math.max(F,N)}else for(var j=0;j<n.length;++j){var N=n[j][2];R=Math.min(R,N),F=Math.max(F,N)}D?this.intensity=D:O?this.intensity=a(r,n.length,O):this.intensity=o(n);var B=t.pointSizes,U=t.pointSize||1;this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]];for(var j=0;j<n.length;++j)for(var V=n[j],q=0;q<3;++q)!isNaN(V[q])&&isFinite(V[q])&&(this.bounds[0][q]=Math.min(this.bounds[0][q],V[q]),this.bounds[1][q]=Math.max(this.bounds[1][q],V[q]));var H=0,Y=0,G=0;t:for(var j=0;j<r.length;++j){var X=r[j];switch(X.length){case 1:for(var W=X[0],V=n[W],q=0;q<3;++q)if(isNaN(V[q])||!isFinite(V[q]))continue t;y.push(V[0],V[1],V[2]);var Z;Z=L?L[W]:C?C[j]:I,3===Z.length?_.push(Z[0],Z[1],Z[2],1):_.push(Z[0],Z[1],Z[2],Z[3]);var J;J=z?z[W]:D?[(D[W]-R)/(F-R),0]:P?P[j]:O?[(O[j]-R)/(F-R),0]:[(V[2]-R)/(F-R),0],w.push(J[0],J[1]),B?M.push(B[W]):M.push(U),A.push(j),G+=1;break;case 2:for(var q=0;q<2;++q)for(var W=X[q],V=n[W],K=0;K<3;++K)if(isNaN(V[K])||!isFinite(V[K]))continue t;for(var q=0;q<2;++q){var W=X[q],V=n[W];f.push(V[0],V[1],V[2]);var Z;Z=L?L[W]:C?C[j]:I,3===Z.length?d.push(Z[0],Z[1],Z[2],1):d.push(Z[0],Z[1],Z[2],Z[3]);var J;J=z?z[W]:D?[(D[W]-R)/(F-R),0]:P?P[j]:O?[(O[j]-R)/(F-R),0]:[(V[2]-R)/(F-R),0],g.push(J[0],J[1]),v.push(j)}Y+=1;break;case 3:for(var q=0;q<3;++q)for(var W=X[q],V=n[W],K=0;K<3;++K)if(isNaN(V[K])||!isFinite(V[K]))continue t;for(var q=0;q<3;++q){var W=X[q],V=n[W];s.push(V[0],V[1],V[2]);var Z;Z=L?L[W]:C?C[j]:I,3===Z.length?l.push(Z[0],Z[1],Z[2],1):l.push(Z[0],Z[1],Z[2],Z[3]);var J;J=z?z[W]:D?[(D[W]-R)/(F-R),0]:P?P[j]:O?[(O[j]-R)/(F-R),0]:[(V[2]-R)/(F-R),0],c.push(J[0],J[1]);var Q;Q=k?k[W]:T[j],u.push(Q[0],Q[1],Q[2]),h.push(j)}H+=1}}this.pointCount=G,this.edgeCount=Y,this.triangleCount=H,this.pointPositions.update(y),this.pointColors.update(_),this.pointUVs.update(w),this.pointSizes.update(M),this.pointIds.update(new Uint32Array(A)),this.edgePositions.update(f),this.edgeColors.update(d),this.edgeUVs.update(g),this.edgeIds.update(new Uint32Array(v)),this.trianglePositions.update(s),this.triangleColors.update(l),this.triangleUVs.update(c),this.triangleNormals.update(u),this.triangleIds.update(new Uint32Array(h))}},R.drawTransparent=R.draw=function(t){t=t||{};for(var e=this.gl,r=t.model||O,n=t.view||O,i=t.projection||O,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);var s={model:r,view:n,projection:i,clipBounds:a,kambient:this.ambientLight,kdiffuse:this.diffuseLight,kspecular:this.specularLight,roughness:this.roughness,fresnel:this.fresnel,eyePosition:[0,0,0],lightPosition:[0,0,0],opacity:this.opacity,contourColor:this.contourColor,texture:0};this.texture.bind(0);var l=new Array(16);_(l,s.view,s.model),_(l,s.projection,l),w(l,l);for(var o=0;o<3;++o)s.eyePosition[o]=l[12+o]/l[15];for(var u=l[15],o=0;o<3;++o)u+=this.lightPosition[o]*l[4*o+3];for(var o=0;o<3;++o){for(var c=l[12+o],h=0;h<3;++h)c+=l[4*h+o]*this.lightPosition[h];s.lightPosition[o]=c/u}if(this.triangleCount>0){var f=this.triShader;f.bind(),f.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var f=this.lineShader;f.bind(),f.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()}if(this.pointCount>0){var f=this.pointShader;f.bind(),f.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var f=this.contourShader;f.bind(),f.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind()}},R.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||O,n=t.view||O,i=t.projection||O,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255},l=this.pickShader;if(l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0){var l=this.pointPickShader;l.bind(),l.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}},R.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,i=new Array(r.length),a=0;a<r.length;++a)i[a]=n[r[a]];var o=S(i,[t.coord[0],this._resolution[1]-t.coord[1]],this._model,this._view,this._projection,this._resolution);if(!o)return null;for(var s=o[2],l=0,a=0;a<r.length;++a)l+=s[a]*this.intensity[r[a]];return{position:o[1],index:r[o[0]],cell:r,cellId:e,intensity:l,dataCoordinate:this.positions[r[o[0]]]}},R.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.lineShader.dispose(),this.pointShader.dispose(),this.pickShader.dispose(),this.pointPickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose(),this.contourShader.dispose()},e.exports=d},{"./lib/closest-point":176,"./lib/shaders":177,colormap:82,"gl-buffer":130,"gl-mat4/invert":154,"gl-mat4/multiply":156,"gl-shader":225,"gl-texture2d":237,"gl-vao":241,ndarray:432,normals:434,"simplicial-complex-contour":480,"typedarray-pool":502}],179:[function(t,e,r){"use strict";function n(t,e,r){this.plot=t,this.vbo=e,this.shader=r}function i(t){var e=t.gl,r=a(e,[0,0,0,1,1,0,1,1]),i=o(e,s.boxVert,s.lineFrag);return new n(t,r,i)}e.exports=i;var a=t("gl-buffer"),o=t("gl-shader"),s=t("./shaders"),l=n.prototype;l.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},l.drawBox=function(){var t=[0,0],e=[0,0];return function(r,n,i,a,o){var s=this.plot,l=this.shader,u=s.gl;t[0]=r,t[1]=n,e[0]=i,e[1]=a,l.uniforms.lo=t,l.uniforms.hi=e,l.uniforms.color=o,u.drawArrays(u.TRIANGLE_STRIP,0,4)}}(),l.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":182,"gl-buffer":130,"gl-shader":185}],180:[function(t,e,r){"use strict";function n(t,e,r,n){this.plot=t,this.vbo=e,this.shader=r,this.tickShader=n,this.ticks=[[],[]]}function i(t,e){return t-e}function a(t){var e=t.gl,r=o(e),i=s(e,u.gridVert,u.gridFrag),a=s(e,u.tickVert,u.gridFrag),l=new n(t,r,i,a);return l}e.exports=a;var o=t("gl-buffer"),s=t("gl-shader"),l=t("binary-search-bounds"),u=t("./shaders"),c=n.prototype;c.draw=function(){var t=[0,0],e=[0,0],r=[0,0];return function(){for(var n=this.plot,i=this.vbo,a=this.shader,o=this.ticks,s=n.gl,l=n._tickBounds,u=n.dataBox,c=n.viewBox,h=n.gridLineWidth,f=n.gridLineColor,d=n.gridLineEnable,p=n.pixelRatio,m=0;m<2;++m){var g=l[m],v=l[m+2],y=v-g,x=.5*(u[m+2]+u[m]),b=u[m+2]-u[m];e[m]=2*y/b,t[m]=2*(g-x)/b}a.bind(),i.bind(),a.attributes.dataCoord.pointer(),a.uniforms.dataShift=t,a.uniforms.dataScale=e;for(var _=0,m=0;m<2;++m){r[0]=r[1]=0,r[m]=1,a.uniforms.dataAxis=r,a.uniforms.lineWidth=h[m]/(c[m+2]-c[m])*p,a.uniforms.color=f[m];var w=6*o[m].length;d[m]&&w&&s.drawArrays(s.TRIANGLES,_,w),_+=w}}}(),c.drawTickMarks=function(){var t=[0,0],e=[0,0],r=[1,0],n=[0,1],a=[0,0],o=[0,0];return function(){for(var s=this.plot,u=this.vbo,c=this.tickShader,h=this.ticks,f=s.gl,d=s._tickBounds,p=s.dataBox,m=s.viewBox,g=s.pixelRatio,v=s.screenBox,y=v[2]-v[0],x=v[3]-v[1],b=m[2]-m[0],_=m[3]-m[1],w=0;w<2;++w){var M=d[w],A=d[w+2],k=A-M,T=.5*(p[w+2]+p[w]),E=p[w+2]-p[w];e[w]=2*k/E,t[w]=2*(M-T)/E}e[0]*=b/y,t[0]*=b/y,e[1]*=_/x,t[1]*=_/x,c.bind(),u.bind(),c.attributes.dataCoord.pointer();var S=c.uniforms;S.dataShift=t,S.dataScale=e;var L=s.tickMarkLength,C=s.tickMarkWidth,I=s.tickMarkColor,z=0,D=6*h[0].length,P=Math.min(l.ge(h[0],(p[0]-d[0])/(d[2]-d[0]),i),h[0].length),O=Math.min(l.gt(h[0],(p[2]-d[0])/(d[2]-d[0]),i),h[0].length),R=z+6*P,F=6*Math.max(0,O-P),j=Math.min(l.ge(h[1],(p[1]-d[1])/(d[3]-d[1]),i),h[1].length),N=Math.min(l.gt(h[1],(p[3]-d[1])/(d[3]-d[1]),i),h[1].length),B=D+6*j,U=6*Math.max(0,N-j);a[0]=2*(m[0]-L[1])/y-1,a[1]=(m[3]+m[1])/x-1,o[0]=L[1]*g/y,o[1]=C[1]*g/x,U&&(S.color=I[1],S.tickScale=o,S.dataAxis=n,S.screenOffset=a,f.drawArrays(f.TRIANGLES,B,U)),a[0]=(m[2]+m[0])/y-1,a[1]=2*(m[1]-L[0])/x-1,o[0]=C[0]*g/y,o[1]=L[0]*g/x,F&&(S.color=I[0],S.tickScale=o,S.dataAxis=r,S.screenOffset=a,f.drawArrays(f.TRIANGLES,R,F)),a[0]=2*(m[2]+L[3])/y-1,a[1]=(m[3]+m[1])/x-1,o[0]=L[3]*g/y,o[1]=C[3]*g/x,U&&(S.color=I[3],S.tickScale=o,S.dataAxis=n,S.screenOffset=a,f.drawArrays(f.TRIANGLES,B,U)),a[0]=(m[2]+m[0])/y-1,a[1]=2*(m[3]+L[2])/x-1,o[0]=C[2]*g/y,o[1]=L[2]*g/x,F&&(S.color=I[2],S.tickScale=o,S.dataAxis=r,S.screenOffset=a,f.drawArrays(f.TRIANGLES,R,F))}}(),c.update=function(){var t=[1,1,-1,-1,1,-1],e=[1,-1,1,1,-1,-1];return function(r){for(var n=r.ticks,i=r.bounds,a=new Float32Array(18*(n[0].length+n[1].length)),o=(this.plot.zeroLineEnable,0),s=[[],[]],l=0;l<2;++l)for(var u=s[l],c=n[l],h=i[l],f=i[l+2],d=0;d<c.length;++d){var p=(c[d].x-h)/(f-h);u.push(p);for(var m=0;m<6;++m)a[o++]=p,a[o++]=t[m],a[o++]=e[m]}this.ticks=s,this.vbo.update(a)}}(),c.dispose=function(){this.vbo.dispose(),this.shader.dispose(),this.tickShader.dispose()}},{"./shaders":182,"binary-search-bounds":184,"gl-buffer":130,"gl-shader":185}],181:[function(t,e,r){"use strict";function n(t,e,r){this.plot=t,this.vbo=e,this.shader=r}function i(t){var e=t.gl,r=a(e,[-1,-1,-1,1,1,-1,1,1]),i=o(e,s.lineVert,s.lineFrag),l=new n(t,r,i);return l}e.exports=i;var a=t("gl-buffer"),o=t("gl-shader"),s=t("./shaders"),l=n.prototype;l.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},l.drawLine=function(){var t=[0,0],e=[0,0];return function(r,n,i,a,o,s){var l=this.plot,u=this.shader,c=l.gl;t[0]=r,t[1]=n,e[0]=i,e[1]=a,u.uniforms.start=t,u.uniforms.end=e,u.uniforms.width=o*l.pixelRatio,u.uniforms.color=s,c.drawArrays(c.TRIANGLE_STRIP,0,4)}}(),l.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":182,"gl-buffer":130,"gl-shader":185}],182:[function(t,e,r){"use strict";var n="precision lowp float;\n#define GLSLIFY 1\nuniform vec4 color;\nvoid main() {\n  gl_FragColor = vec4(color.xyz * color.w, color.w);\n}\n";e.exports={lineVert:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 coord;\n\nuniform vec4 screenBox;\nuniform vec2 start, end;\nuniform float width;\n\nvec2 perp(vec2 v) {\n  return vec2(v.y, -v.x);\n}\n\nvec2 screen(vec2 v) {\n  return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\n}\n\nvoid main() {\n  vec2 delta = normalize(perp(start - end));\n  vec2 offset = mix(start, end, 0.5 * (coord.y+1.0));\n  gl_Position = vec4(screen(offset + 0.5 * width * delta * coord.x), 0, 1);\n}\n",lineFrag:n,textVert:"#define GLSLIFY 1\nattribute vec3 textCoordinate;\n\nuniform vec2 dataScale, dataShift, dataAxis, screenOffset, textScale;\nuniform float angle;\n\nvoid main() {\n  float dataOffset  = textCoordinate.z;\n  vec2 glyphOffset  = textCoordinate.xy;\n  mat2 glyphMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n  vec2 screenCoordinate = dataAxis * (dataScale * dataOffset + dataShift) +\n    glyphMatrix * glyphOffset * textScale + screenOffset;\n  gl_Position = vec4(screenCoordinate, 0, 1);\n}\n",textFrag:n,gridVert:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 dataCoord;\n\nuniform vec2 dataAxis, dataShift, dataScale;\nuniform float lineWidth;\n\nvoid main() {\n  vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\n  pos += 10.0 * dataCoord.y * vec2(dataAxis.y, -dataAxis.x) + dataCoord.z * lineWidth;\n  gl_Position = vec4(pos, 0, 1);\n}\n",gridFrag:n,boxVert:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 coord;\n\nuniform vec4 screenBox;\nuniform vec2 lo, hi;\n\nvec2 screen(vec2 v) {\n  return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\n}\n\nvoid main() {\n  gl_Position = vec4(screen(mix(lo, hi, coord)), 0, 1);\n}\n",tickVert:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 dataCoord;\n\nuniform vec2 dataAxis, dataShift, dataScale, screenOffset, tickScale;\n\nvoid main() {\n  vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\n  gl_Position = vec4(pos + tickScale*dataCoord.yz + screenOffset, 0, 1);\n}\n"}},{}],183:[function(t,e,r){"use strict";function n(t,e,r){this.plot=t,this.vbo=e,this.shader=r,this.tickOffset=[[],[]],this.tickX=[[],[]],this.labelOffset=[0,0],this.labelCount=[0,0]}function i(t){var e=t.gl,r=a(e),i=o(e,u.textVert,u.textFrag),s=new n(t,r,i);return s}e.exports=i;var a=t("gl-buffer"),o=t("gl-shader"),s=t("text-cache"),l=t("binary-search-bounds"),u=t("./shaders"),c=n.prototype;c.drawTicks=function(){var t=[0,0],e=[0,0],r=[0,0];return function(n){var i=this.plot,a=this.shader,o=this.tickX[n],s=this.tickOffset[n],u=i.gl,c=i.viewBox,h=i.dataBox,f=i.screenBox,d=i.pixelRatio,p=i.tickEnable,m=i.tickPad,g=i.tickColor,v=i.tickAngle,y=i.labelEnable,x=i.labelPad,b=i.labelColor,_=i.labelAngle,w=this.labelOffset[n],M=this.labelCount[n],A=l.lt(o,h[n]),k=l.le(o,h[n+2]);t[0]=t[1]=0,t[n]=1,e[n]=(c[2+n]+c[n])/(f[2+n]-f[n])-1;var T=2/f[2+(1^n)]-f[1^n];e[1^n]=T*c[1^n]-1,p[n]&&(e[1^n]-=T*d*m[n],A<k&&s[k]>s[A]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=g[n],a.uniforms.angle=v[n],u.drawArrays(u.TRIANGLES,s[A],s[k]-s[A]))),y[n]&&M&&(e[1^n]-=T*d*x[n],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=b[n],a.uniforms.angle=_[n],u.drawArrays(u.TRIANGLES,w,M)),e[1^n]=T*c[2+(1^n)]-1,p[n+2]&&(e[1^n]+=T*d*m[n+2],A<k&&s[k]>s[A]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=g[n+2],a.uniforms.angle=v[n+2],u.drawArrays(u.TRIANGLES,s[A],s[k]-s[A]))),y[n+2]&&M&&(e[1^n]+=T*d*x[n+2],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=b[n+2],a.uniforms.angle=_[n+2],u.drawArrays(u.TRIANGLES,w,M))}}(),c.drawTitle=function(){var t=[0,0],e=[0,0];return function(){var r=this.plot,n=this.shader,i=r.gl,a=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,u=r.pixelRatio;if(this.titleCount){for(var c=0;c<2;++c)e[c]=2*(o[c]*u-a[c])/(a[2+c]-a[c])-1;n.bind(),n.uniforms.dataAxis=t,n.uniforms.screenOffset=e,n.uniforms.angle=s,n.uniforms.color=l,i.drawArrays(i.TRIANGLES,this.titleOffset,this.titleCount)}}}(),c.bind=function(){var t=[0,0],e=[0,0],r=[0,0];return function(){var n=this.plot,i=this.shader,a=n._tickBounds,o=n.dataBox,s=n.screenBox,l=n.viewBox;i.bind();for(var u=0;u<2;++u){var c=a[u],h=a[u+2],f=h-c,d=.5*(o[u+2]+o[u]),p=o[u+2]-o[u],m=l[u],g=l[u+2],v=g-m,y=s[u],x=s[u+2],b=x-y;e[u]=2*f/p*v/b,t[u]=2*(c-d)/p*v/b}r[1]=2*n.pixelRatio/(s[3]-s[1]),r[0]=r[1]*(s[3]-s[1])/(s[2]-s[0]),i.uniforms.dataScale=e,i.uniforms.dataShift=t,i.uniforms.textScale=r,this.vbo.bind(),i.attributes.textCoordinate.pointer()}}(),c.update=function(t){var e,r,n,i,a,o=[],l=t.ticks,u=t.bounds;for(a=0;a<2;++a){var c=[Math.floor(o.length/3)],h=[-(1/0)],f=l[a];for(e=0;e<f.length;++e){var d=f[e],p=d.x,m=d.text,g=d.font||"sans-serif";i=d.fontSize||12;for(var v=1/(u[a+2]-u[a]),y=u[a],x=m.split("\n"),b=0;b<x.length;b++)for(n=s(g,x[b]).data,r=0;r<n.length;r+=2)o.push(n[r]*i,-n[r+1]*i-b*i*1.2,(p-y)*v);c.push(Math.floor(o.length/3)),h.push(p)}this.tickOffset[a]=c,this.tickX[a]=h}for(a=0;a<2;++a){for(this.labelOffset[a]=Math.floor(o.length/3),n=s(t.labelFont[a],t.labels[a],{textAlign:"center"}).data,i=t.labelSize[a],e=0;e<n.length;e+=2)o.push(n[e]*i,-n[e+1]*i,0);this.labelCount[a]=Math.floor(o.length/3)-this.labelOffset[a]}for(this.titleOffset=Math.floor(o.length/3),n=s(t.titleFont,t.title).data,i=t.titleSize,e=0;e<n.length;e+=2)o.push(n[e]*i,-n[e+1]*i,0);this.titleCount=Math.floor(o.length/3)-this.titleOffset,this.vbo.update(o)},c.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":182,"binary-search-bounds":184,"gl-buffer":130,"gl-shader":185,"text-cache":494}],184:[function(t,e,r){arguments[4][74][0].apply(r,arguments)},{dup:74}],185:[function(t,e,r){"use strict";function n(t){this.gl=t,this.gl.lastAttribCount=0,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}function i(t,e){return t.name<e.name?-1:1}function a(t,e,r,i,a){var o=new n(t);return o.update(e,r,i,a),o}var o=t("./lib/create-uniforms"),s=t("./lib/create-attributes"),l=t("./lib/reflect"),u=t("./lib/shader-cache"),c=t("./lib/runtime-reflect"),h=t("./lib/GLError"),f=n.prototype;f.bind=function(){this.program||this._relink();var t,e=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES),r=this.gl.lastAttribCount;if(e>r)for(t=r;t<e;t++)this.gl.enableVertexAttribArray(t);else if(r>e)for(t=e;t<r;t++)this.gl.disableVertexAttribArray(t);this.gl.lastAttribCount=e,this.gl.useProgram(this.program)},f.dispose=function(){for(var t=this.gl.lastAttribCount,e=0;e<t;e++)this.gl.disableVertexAttribArray(e);this.gl.lastAttribCount=0,this._fref&&this._fref.dispose(),this._vref&&this._vref.dispose(),this.attributes=this.types=this.vertShader=this.fragShader=this.program=this._relink=this._fref=this._vref=null},f.update=function(t,e,r,n){function a(){d.program=u.program(p,d._vref,d._fref,_,w);for(var t=0;t<r.length;++t)S[t]=p.getUniformLocation(d.program,r[t].name)}if(!e||1===arguments.length){var f=t;t=f.vertex,e=f.fragment,r=f.uniforms,n=f.attributes}var d=this,p=d.gl,m=d._vref;d._vref=u.shader(p,p.VERTEX_SHADER,t),m&&m.dispose(),d.vertShader=d._vref.shader;var g=this._fref;if(d._fref=u.shader(p,p.FRAGMENT_SHADER,e),g&&g.dispose(),d.fragShader=d._fref.shader,!r||!n){var v=p.createProgram();if(p.attachShader(v,d.fragShader),p.attachShader(v,d.vertShader),p.linkProgram(v),!p.getProgramParameter(v,p.LINK_STATUS)){var y=p.getProgramInfoLog(v);throw new h(y,"Error linking program:"+y)}r=r||c.uniforms(p,v),n=n||c.attributes(p,v),p.deleteProgram(v)}n=n.slice(),n.sort(i);var x,b=[],_=[],w=[];for(x=0;x<n.length;++x){var M=n[x];if(M.type.indexOf("mat")>=0){for(var A=0|M.type.charAt(M.type.length-1),k=new Array(A),T=0;T<A;++T)k[T]=w.length,_.push(M.name+"["+T+"]"),"number"==typeof M.location?w.push(M.location+T):Array.isArray(M.location)&&M.location.length===A&&"number"==typeof M.location[T]?w.push(0|M.location[T]):w.push(-1);b.push({name:M.name,type:M.type,locations:k})}else b.push({name:M.name,type:M.type,locations:[w.length]}),_.push(M.name),"number"==typeof M.location?w.push(0|M.location):w.push(-1)}var E=0;for(x=0;x<w.length;++x)if(w[x]<0){for(;w.indexOf(E)>=0;)E+=1;w[x]=E}var S=new Array(r.length);a(),d._relink=a,d.types={uniforms:l(r),attributes:l(n)},d.attributes=s(p,d,b,w),Object.defineProperty(d,"uniforms",o(p,d,r,S))},e.exports=a},{"./lib/GLError":186,"./lib/create-attributes":187,"./lib/create-uniforms":188,"./lib/reflect":189,"./lib/runtime-reflect":190,"./lib/shader-cache":191}],186:[function(t,e,r){function n(t,e,r){this.shortMessage=e||"",this.longMessage=r||"",this.rawError=t||"",this.message="gl-shader: "+(e||t||"")+(r?"\n"+r:""),this.stack=(new Error).stack}n.prototype=new Error,n.prototype.name="GLError",n.prototype.constructor=n,e.exports=n},{}],187:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}function i(t,e,r,i,a,o,s){for(var l=["gl","v"],u=[],c=0;c<a;++c)l.push("x"+c),u.push("x"+c);l.push("if(x0.length===void 0){return gl.vertexAttrib"+a+"f(v,"+u.join()+")}else{return gl.vertexAttrib"+a+"fv(v,x0)}");var h=Function.apply(null,l),f=new n(t,e,r,i,a,h);Object.defineProperty(o,s,{set:function(e){return t.disableVertexAttribArray(i[r]),h(t,i[r],e),e},get:function(){return f},enumerable:!0})}function a(t,e,r,n,a,o,s){for(var l=new Array(a),u=new Array(a),c=0;c<a;++c)i(t,e,r[c],n,a,l,c),u[c]=l[c];Object.defineProperty(l,"location",{set:function(t){if(Array.isArray(t))for(var e=0;e<a;++e)u[e].location=t[e];else for(var e=0;e<a;++e)u[e].location=t+e;return t},get:function(){for(var t=new Array(a),e=0;e<a;++e)t[e]=n[r[e]];return t},enumerable:!0}),l.pointer=function(e,i,o,s){e=e||t.FLOAT,i=!!i,o=o||a*a,s=s||0;for(var l=0;l<a;++l){var u=n[r[l]];t.vertexAttribPointer(u,a,e,i,o,s+l*a),t.enableVertexAttribArray(u)}};var h=new Array(a),f=t["vertexAttrib"+a+"fv"];Object.defineProperty(o,s,{set:function(e){for(var i=0;i<a;++i){var o=n[r[i]];if(t.disableVertexAttribArray(o),Array.isArray(e[0]))f.call(t,o,e[i]);else{for(var s=0;s<a;++s)h[s]=e[a*i+s];f.call(t,o,h)}}return e},get:function(){return l},enumerable:!0})}function o(t,e,r,n){for(var o={},l=0,u=r.length;l<u;++l){var c=r[l],h=c.name,f=c.type,d=c.locations;switch(f){case"bool":case"int":case"float":i(t,e,d[0],n,1,o,h);break;default:if(f.indexOf("vec")>=0){var p=f.charCodeAt(f.length-1)-48;if(p<2||p>4)throw new s("","Invalid data type for attribute "+h+": "+f);i(t,e,d[0],n,p,o,h)}else{if(!(f.indexOf("mat")>=0))throw new s("","Unknown data type for attribute "+h+": "+f);var p=f.charCodeAt(f.length-1)-48;if(p<2||p>4)throw new s("","Invalid data type for attribute "+h+": "+f);a(t,e,d,n,p,o,h)}}}return o}e.exports=o;var s=t("./GLError"),l=n.prototype;l.pointer=function(t,e,r,n){var i=this,a=i._gl,o=i._locations[i._index];a.vertexAttribPointer(o,i._dimension,t||a.FLOAT,!!e,r||0,n||0),a.enableVertexAttribArray(o)},l.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(l,"location",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}})},{"./GLError":186}],188:[function(t,e,r){"use strict";function n(t){var e=new Function("y","return function(){return y}");return e(t)}function i(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=e;return r}function a(t,e,r,a){function l(r){var n=new Function("gl","wrapper","locations","return function(){return gl.getUniform(wrapper.program,locations["+r+"])}");return n(t,e,a)}function u(t,e,r){switch(r){case"bool":case"int":case"sampler2D":case"samplerCube":return"gl.uniform1i(locations["+e+"],obj"+t+")";case"float":return"gl.uniform1f(locations["+e+"],obj"+t+")";default:var n=r.indexOf("vec");if(!(0<=n&&n<=1&&r.length===4+n)){if(0===r.indexOf("mat")&&4===r.length){var i=r.charCodeAt(r.length-1)-48;if(i<2||i>4)throw new s("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+i+"fv(locations["+e+"],false,obj"+t+")"}throw new s("","Unknown uniform data type for "+name+": "+r)}var i=r.charCodeAt(r.length-1)-48;if(i<2||i>4)throw new s("","Invalid data type");switch(r.charAt(0)){case"b":case"i":return"gl.uniform"+i+"iv(locations["+e+"],obj"+t+")";case"v":return"gl.uniform"+i+"fv(locations["+e+"],obj"+t+")";default:throw new s("","Unrecognized data type for vector "+name+": "+r)}}}function c(t,e){if("object"!=typeof e)return[[t,e]];var r=[];for(var n in e){var i=e[n],a=t;a+=parseInt(n)+""===n?"["+n+"]":"."+n,"object"==typeof i?r.push.apply(r,c(a,i)):r.push([a,i])}return r}function h(e){for(var n=["return function updateProperty(obj){"],i=c("",e),o=0;o<i.length;++o){var s=i[o],l=s[0],h=s[1];a[h]&&n.push(u(l,h,r[h].type))}n.push("return obj}");var f=new Function("gl","locations",n.join("\n"));return f(t,a)}function f(t){switch(t){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":return 0;case"float":return 0;default:var e=t.indexOf("vec");if(0<=e&&e<=1&&t.length===4+e){var r=t.charCodeAt(t.length-1)-48;if(r<2||r>4)throw new s("","Invalid data type");return"b"===t.charAt(0)?i(r,!1):i(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r=t.charCodeAt(t.length-1)-48;if(r<2||r>4)throw new s("","Invalid uniform dimension type for matrix "+name+": "+t);return i(r*r,0)}throw new s("","Unknown uniform data type for "+name+": "+t)}}function d(t,e,i){if("object"==typeof i){var o=p(i);Object.defineProperty(t,e,{get:n(o),set:h(i),enumerable:!0,configurable:!1})}else a[i]?Object.defineProperty(t,e,{get:l(i),set:h(i),enumerable:!0,configurable:!1}):t[e]=f(r[i].type)}function p(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r<t.length;++r)d(e,r,t[r])}else{e={};for(var n in t)d(e,n,t[n])}return e}var m=o(r,!0);return{get:n(p(m)),set:h(m),enumerable:!0,configurable:!0}}var o=t("./reflect"),s=t("./GLError");e.exports=a},{"./GLError":186,"./reflect":189}],189:[function(t,e,r){"use strict";function n(t,e){for(var r={},n=0;n<t.length;++n)for(var i=t[n].name,a=i.split("."),o=r,s=0;s<a.length;++s){var l=a[s].split("[");if(l.length>1){l[0]in o||(o[l[0]]=[]),o=o[l[0]];for(var u=1;u<l.length;++u){var c=parseInt(l[u]);u<l.length-1||s<a.length-1?(c in o||(u<l.length-1?o[c]=[]:o[c]={}),o=o[c]):e?o[c]=n:o[c]=t[n].type}}else s<a.length-1?(l[0]in o||(o[l[0]]={}),o=o[l[0]]):e?o[l[0]]=n:o[l[0]]=t[n].type}return r}e.exports=n},{}],190:[function(t,e,r){"use strict";function n(t,e){if(!s){var r=Object.keys(o);s={};for(var n=0;n<r.length;++n){var i=r[n];s[t[i]]=o[i]}}return s[e]}function i(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),i=[],a=0;a<r;++a){var o=t.getActiveUniform(e,a);if(o){var s=n(t,o.type);if(o.size>1)for(var l=0;l<o.size;++l)i.push({name:o.name.replace("[0]","["+l+"]"),type:s});else i.push({name:o.name,type:s})}}return i}function a(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),i=[],a=0;a<r;++a){var o=t.getActiveAttrib(e,a);o&&i.push({name:o.name,type:n(t,o.type)})}return i}r.uniforms=i,r.attributes=a;var o={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},s=null},{}],191:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o){this.id=t,this.src=e,this.type=r,this.shader=n,this.count=a,this.programs=[],this.cache=o}function i(t){this.gl=t,this.shaders=[{},{}],this.programs={}}function a(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS)){var i=t.getShaderInfoLog(n);try{var a=h(i,r,e)}catch(t){throw console.warn("Failed to format compiler error: "+t),new c(i,"Error compiling shader:\n"+i)}throw new c(i,a.short,a.long)}return n}function o(t,e,r,n,i){var a=t.createProgram();t.attachShader(a,e),t.attachShader(a,r);for(var o=0;o<n.length;++o)t.bindAttribLocation(a,i[o],n[o]);if(t.linkProgram(a),!t.getProgramParameter(a,t.LINK_STATUS)){var s=t.getProgramInfoLog(a);throw new c(s,"Error linking program: "+s)}return a}function s(t){var e=d.get(t);return e||(e=new i(t),d.set(t,e)),e}function l(t,e,r){return s(t).getShaderReference(e,r)}function u(t,e,r,n,i){return s(t).getProgram(e,r,n,i)}r.shader=l,r.program=u;var c=t("./GLError"),h=t("gl-format-compiler-error"),f="undefined"==typeof WeakMap?t("weakmap-shim"):WeakMap,d=new f,p=0;n.prototype.dispose=function(){if(0===--this.count){for(var t=this.cache,e=t.gl,r=this.programs,n=0,i=r.length;n<i;++n){var a=t.programs[r[n]];a&&(delete t.programs[n],e.deleteProgram(a))}e.deleteShader(this.shader),delete t.shaders[this.type===e.FRAGMENT_SHADER|0][this.src]}};var m=i.prototype;m.getShaderReference=function(t,e){var r=this.gl,i=this.shaders[t===r.FRAGMENT_SHADER|0],o=i[e];if(o&&r.isShader(o.shader))o.count+=1;else{var s=a(r,t,e);o=i[e]=new n(p++,e,t,s,[],1,this)}return o},m.getProgram=function(t,e,r,n){var i=[t.id,e.id,r.join(":"),n.join(":")].join("@"),a=this.programs[i];return a&&this.gl.isProgram(a)||(this.programs[i]=a=o(this.gl,t.shader,e.shader,r,n),t.programs.push(i),e.programs.push(i)),a}},{"./GLError":186,"gl-format-compiler-error":138,"weakmap-shim":523}],192:[function(t,e,r){"use strict";function n(t,e){this.gl=t,this.pickBuffer=e,this.screenBox=[0,0,t.drawingBufferWidth,t.drawingBufferHeight],this.viewBox=[0,0,0,0],this.dataBox=[-10,-10,10,10],this.gridLineEnable=[!0,!0],this.gridLineWidth=[1,1],this.gridLineColor=[[0,0,0,1],[0,0,0,1]],this.pixelRatio=1,this.tickMarkLength=[0,0,0,0],this.tickMarkWidth=[0,0,0,0],this.tickMarkColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[15,15,15,15],this.tickAngle=[0,0,0,0],this.tickEnable=[!0,!0,!0,!0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[15,15,15,15],this.labelAngle=[0,Math.PI/2,0,3*Math.PI/2],this.labelEnable=[!0,!0,!0,!0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.titleCenter=[0,0],this.titleEnable=!0,this.titleAngle=0,this.titleColor=[0,0,0,1],this.borderColor=[0,0,0,0],this.backgroundColor=[0,0,0,0],this.zeroLineEnable=[!0,!0],this.zeroLineWidth=[4,4],this.zeroLineColor=[[0,0,0,1],[0,0,0,1]],this.borderLineEnable=[!0,!0,!0,!0],this.borderLineWidth=[2,2,2,2],this.borderLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.grid=null,this.text=null,this.line=null,this.box=null,this.objects=[],this.overlays=[],this._tickBounds=[1/0,1/0,-(1/0),-(1/0)],this.static=!1,this.dirty=!1,this.pickDirty=!1,this.pickDelay=120,this.pickRadius=10,this._pickTimeout=null,this._drawPick=this.drawPick.bind(this),this._depthCounter=0}function i(t){for(var e=t.slice(),r=0;r<e.length;++r)e[r]=e[r].slice();return e}function a(t,e){return t.x-e.x}function o(t){var e=t.gl,r=s(e,[e.drawingBufferWidth,e.drawingBufferHeight]),i=new n(e,r);return i.grid=l(i),i.text=u(i),i.line=c(i),i.box=h(i),i.update(t),i}e.exports=o;var s=t("gl-select-static"),l=t("./lib/grid"),u=t("./lib/text"),c=t("./lib/line"),h=t("./lib/box"),f=n.prototype;f.setDirty=function(){this.dirty=this.pickDirty=!0},f.setOverlayDirty=function(){this.dirty=!0},f.nextDepthValue=function(){return this._depthCounter++/65536},f.draw=function(){return function(){var t=this.gl,e=this.screenBox,r=this.viewBox,n=this.dataBox,i=this.pixelRatio,a=this.grid,o=this.line,s=this.text,l=this.objects;if(this._depthCounter=0,this.pickDirty&&(this._pickTimeout&&clearTimeout(this._pickTimeout),this.pickDirty=!1,this._pickTimeout=setTimeout(this._drawPick,this.pickDelay)),this.dirty){this.dirty=!1,t.bindFramebuffer(t.FRAMEBUFFER,null),t.enable(t.SCISSOR_TEST),t.disable(t.DEPTH_TEST),t.depthFunc(t.LESS),t.depthMask(!1),t.enable(t.BLEND),t.blendEquation(t.FUNC_ADD,t.FUNC_ADD),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),t.scissor(e[0],e[1],e[2]-e[0],e[3]-e[1]);var u=this.borderColor;t.clearColor(u[0]*u[3],u[1]*u[3],u[2]*u[3],u[3]),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),t.scissor(r[0],r[1],r[2]-r[0],r[3]-r[1]),t.viewport(r[0],r[1],r[2]-r[0],r[3]-r[1]);var c=this.backgroundColor;t.clearColor(c[0]*c[3],c[1]*c[3],c[2]*c[3],c[3]),t.clear(t.COLOR_BUFFER_BIT),a.draw();var h=this.zeroLineEnable,f=this.zeroLineColor,d=this.zeroLineWidth;if(h[0]||h[1]){o.bind();for(var p=0;p<2;++p)if(h[p]&&n[p]<=0&&n[p+2]>=0){var m=e[p]-n[p]*(e[p+2]-e[p])/(n[p+2]-n[p]);0===p?o.drawLine(m,e[1],m,e[3],d[p],f[p]):o.drawLine(e[0],m,e[2],m,d[p],f[p])}}for(var p=0;p<l.length;++p)l[p].draw();t.viewport(e[0],e[1],e[2]-e[0],e[3]-e[1]),t.scissor(e[0],e[1],e[2]-e[0],e[3]-e[1]),this.grid.drawTickMarks(),o.bind();var g=this.borderLineEnable,v=this.borderLineWidth,y=this.borderLineColor;g[1]&&o.drawLine(r[0],r[1]-.5*v[1]*i,r[0],r[3]+.5*v[3]*i,v[1],y[1]),g[0]&&o.drawLine(r[0]-.5*v[0]*i,r[1],r[2]+.5*v[2]*i,r[1],v[0],y[0]),g[3]&&o.drawLine(r[2],r[1]-.5*v[1]*i,r[2],r[3]+.5*v[3]*i,v[3],y[3]),g[2]&&o.drawLine(r[0]-.5*v[0]*i,r[3],r[2]+.5*v[2]*i,r[3],v[2],y[2]),s.bind();for(var p=0;p<2;++p)s.drawTicks(p);this.titleEnable&&s.drawTitle();for(var x=this.overlays,p=0;p<x.length;++p)x[p].draw();t.disable(t.SCISSOR_TEST),t.disable(t.BLEND),t.depthMask(!0)}}}(),f.drawPick=function(){return function(){if(!this.static){var t=this.pickBuffer;this.gl;this._pickTimeout=null,t.begin();for(var e=1,r=this.objects,n=0;n<r.length;++n)e=r[n].drawPick(e);t.end()}}}(),f.pick=function(){return function(t,e){if(!this.static){var r=this.pixelRatio,n=this.pickPixelRatio,i=this.viewBox,a=0|Math.round((t-i[0]/r)*n),o=0|Math.round((e-i[1]/r)*n),s=this.pickBuffer.query(a,o,this.pickRadius);if(!s)return null;for(var l=s.id+(s.value[0]<<8)+(s.value[1]<<16)+(s.value[2]<<24),u=this.objects,c=0;c<u.length;++c){var h=u[c].pick(a,o,l);if(h)return h}return null}}}(),f.setScreenBox=function(t){var e=this.screenBox,r=this.pixelRatio;e[0]=0|Math.round(t[0]*r),e[1]=0|Math.round(t[1]*r),e[2]=0|Math.round(t[2]*r),e[3]=0|Math.round(t[3]*r),this.setDirty()},f.setDataBox=function(t){var e=this.dataBox,r=e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3];r&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],this.setDirty())},f.setViewBox=function(t){var e=this.pixelRatio,r=this.viewBox;r[0]=0|Math.round(t[0]*e),r[1]=0|Math.round(t[1]*e),r[2]=0|Math.round(t[2]*e),r[3]=0|Math.round(t[3]*e);var n=this.pickPixelRatio;this.pickBuffer.shape=[0|Math.round((t[2]-t[0])*n),0|Math.round((t[3]-t[1])*n)],this.setDirty()},f.update=function(t){t=t||{};var e=this.gl;this.pixelRatio=t.pixelRatio||1;var r=this.pixelRatio;this.pickPixelRatio=Math.max(r,1),this.setScreenBox(t.screenBox||[0,0,e.drawingBufferWidth/r,e.drawingBufferHeight/r]);this.screenBox;this.setViewBox(t.viewBox||[.125*(this.screenBox[2]-this.screenBox[0])/r,.125*(this.screenBox[3]-this.screenBox[1])/r,.875*(this.screenBox[2]-this.screenBox[0])/r,.875*(this.screenBox[3]-this.screenBox[1])/r]);var n=this.viewBox,o=(n[2]-n[0])/(n[3]-n[1]);this.setDataBox(t.dataBox||[-10,-10/o,10,10/o]),this.borderColor=(t.borderColor||[0,0,0,0]).slice(),this.backgroundColor=(t.backgroundColor||[0,0,0,0]).slice(),this.gridLineEnable=(t.gridLineEnable||[!0,!0]).slice(),this.gridLineWidth=(t.gridLineWidth||[1,1]).slice(),this.gridLineColor=i(t.gridLineColor||[[.5,.5,.5,1],[.5,.5,.5,1]]),this.zeroLineEnable=(t.zeroLineEnable||[!0,!0]).slice(),this.zeroLineWidth=(t.zeroLineWidth||[4,4]).slice(),this.zeroLineColor=i(t.zeroLineColor||[[0,0,0,1],[0,0,0,1]]),this.tickMarkLength=(t.tickMarkLength||[0,0,0,0]).slice(),this.tickMarkWidth=(t.tickMarkWidth||[0,0,0,0]).slice(),this.tickMarkColor=i(t.tickMarkColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.titleCenter=(t.titleCenter||[.5*(n[0]+n[2])/r,(n[3]+120)/r]).slice(),this.titleEnable=!("titleEnable"in t&&!t.titleEnable),this.titleAngle=t.titleAngle||0,this.titleColor=(t.titleColor||[0,0,0,1]).slice(),this.labelPad=(t.labelPad||[15,15,15,15]).slice(),this.labelAngle=(t.labelAngle||[0,Math.PI/2,0,3*Math.PI/2]).slice(),this.labelEnable=(t.labelEnable||[!0,!0,!0,!0]).slice(),this.labelColor=i(t.labelColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.tickPad=(t.tickPad||[15,15,15,15]).slice(),this.tickAngle=(t.tickAngle||[0,0,0,0]).slice(),this.tickEnable=(t.tickEnable||[!0,!0,!0,!0]).slice(),this.tickColor=i(t.tickColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.borderLineEnable=(t.borderLineEnable||[!0,!0,!0,!0]).slice(),this.borderLineWidth=(t.borderLineWidth||[2,2,2,2]).slice(),this.borderLineColor=i(t.borderLineColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);var s=t.ticks||[[],[]],l=this._tickBounds;l[0]=l[1]=1/0,l[2]=l[3]=-(1/0);for(var u=0;u<2;++u){var c=s[u].slice(0);0!==c.length&&(c.sort(a),l[u]=Math.min(l[u],c[0].x),l[u+2]=Math.max(l[u+2],c[c.length-1].x))}this.grid.update({bounds:l,ticks:s}),this.text.update({bounds:l,ticks:s,labels:t.labels||["x","y"],labelSize:t.labelSize||[12,12],labelFont:t.labelFont||["sans-serif","sans-serif"],title:t.title||"",titleSize:t.titleSize||18,titleFont:t.titleFont||"sans-serif"}),this.static=!!t.static,this.setDirty()},f.dispose=function(){this.box.dispose(),this.grid.dispose(),this.text.dispose(),this.line.dispose();for(var t=this.objects.length-1;t>=0;--t)this.objects[t].dispose();this.objects.length=0;for(var t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},f.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},f.removeObject=function(t){for(var e=this.objects,r=0;r<e.length;++r)if(e[r]===t){e.splice(r,1),this.setDirty();break}},f.addOverlay=function(t){this.overlays.indexOf(t)<0&&(this.overlays.push(t),this.setOverlayDirty())},f.removeOverlay=function(t){for(var e=this.overlays,r=0;r<e.length;++r)if(e[r]===t){e.splice(r,1),this.setOverlayDirty();break}}},{"./lib/box":179,"./lib/grid":180,"./lib/line":181,"./lib/text":183,"gl-select-static":224}],193:[function(t,e,r){var n=t("gl-shader"),i="precision mediump float;\n#define GLSLIFY 1\nattribute vec2 position;\nvarying vec2 uv;\nvoid main() {\n  uv = position;\n  gl_Position = vec4(position, 0, 1);\n}",a="precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n  vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n  gl_FragColor = min(vec4(1,1,1,1), accum);\n}";e.exports=function(t){return n(t,i,a,null,[{name:"position",type:"vec2"}])}},{"gl-shader":225}],194:[function(t,e,r){"use strict";function n(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function i(t,e){var r=null;try{r=t.getContext("webgl",e),r||(r=t.getContext("experimental-webgl",e))}catch(t){return null}return r}function a(t){var e=Math.round(Math.log(Math.abs(t))/Math.log(10));if(e<0){var r=Math.round(Math.pow(10,-e));return Math.ceil(t*r)/r}if(e>0){var r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function o(t){return"boolean"!=typeof t||t}function s(t){function e(){if(!_&&H.autoResize){var t=w.parentNode,e=1,r=1;t&&t!==document.body?(e=t.clientWidth,r=t.clientHeight):(e=window.innerWidth,r=window.innerHeight);var n=0|Math.ceil(e*H.pixelRatio),i=0|Math.ceil(r*H.pixelRatio);if(n!==w.width||i!==w.height){w.width=n,w.height=i;var a=w.style;a.position=a.position||"absolute",a.left="0px",a.top="0px",a.width=e+"px",a.height=r+"px",j=!0}}}function r(){for(var t=P.length,e=F.length,r=0;r<e;++r)R[r]=0;t:for(var r=0;r<t;++r){var n=P[r],i=n.pickSlots;if(i){for(var a=0;a<e;++a)if(R[a]+i<255){O[r]=a,n.setPickBase(R[a]+1),R[a]+=i;continue t}var o=f(A,q);O[r]=e,F.push(o),R.push(i),n.setPickBase(1),e+=1}else O[r]=-1}for(;e>0&&0===R[e-1];)R.pop(),F.pop().dispose()}function s(){return!!H.contextLost||void(A.isContextLost()&&(H.contextLost=!0,H.mouseListener.enabled=!1,H.selection.object=null,H.oncontextloss&&H.oncontextloss()))}function y(){if(!s()){A.colorMask(!0,!0,!0,!0),A.depthMask(!0),A.disable(A.BLEND),A.enable(A.DEPTH_TEST);for(var t=P.length,e=F.length,r=0;r<e;++r){var n=F[r];n.shape=Y,n.begin();for(var i=0;i<t;++i)if(O[i]===r){var a=P[i];a.drawPick&&(a.pixelRatio=1,a.drawPick(V))}n.end()}}}function x(){if(!s()){e();var t=H.camera.tick();V.view=H.camera.matrix,j=j||t,N=N||t,I.pixelRatio=H.pixelRatio,D.pixelRatio=H.pixelRatio;var r=P.length,n=W[0],i=W[1];n[0]=n[1]=n[2]=1/0,i[0]=i[1]=i[2]=-(1/0);for(var o=0;o<r;++o){var l=P[o];l.pixelRatio=H.pixelRatio,l.axes=H.axes,j=j||!!l.dirty,N=N||!!l.dirty;var u=l.bounds;if(u)for(var h=u[0],f=u[1],d=0;d<3;++d)n[d]=Math.min(n[d],h[d]),i[d]=Math.max(i[d],f[d])}var m=H.bounds;if(H.autoBounds)for(var d=0;d<3;++d){if(i[d]<n[d])n[d]=-1,i[d]=1;else{n[d]===i[d]&&(n[d]-=1,i[d]+=1);var v=.05*(i[d]-n[d]);n[d]=n[d]-v,i[d]=i[d]+v}m[0][d]=n[d],m[1][d]=i[d]}for(var x=!1,d=0;d<3;++d)x=x||Z[0][d]!==m[0][d]||Z[1][d]!==m[1][d],Z[0][d]=m[0][d],Z[1][d]=m[1][d];if(x){for(var b=[0,0,0],o=0;o<3;++o)b[o]=a((m[1][o]-m[0][o])/10);I.autoTicks?I.update({bounds:m,tickSpacing:b}):I.update({bounds:m})}N=N||x,j=j||x;var _=A.drawingBufferWidth,w=A.drawingBufferHeight;q[0]=_,q[1]=w,Y[0]=0|Math.max(_/H.pixelRatio,1),Y[1]=0|Math.max(w/H.pixelRatio,1),g(B,H.fovy,_/w,H.zNear,H.zFar);for(var o=0;o<16;++o)U[o]=0;U[15]=1;for(var M=0,o=0;o<3;++o)M=Math.max(M,m[1][o]-m[0][o]);for(var o=0;o<3;++o)H.autoScale?U[5*o]=H.aspect[o]/(m[1][o]-m[0][o]):U[5*o]=1/M,H.autoCenter&&(U[12+o]=.5*-U[5*o]*(m[0][o]+m[1][o]));for(var o=0;o<r;++o){var l=P[o];l.axesBounds=m,H.clipToBounds&&(l.clipBounds=m)}if(T.object&&(H.snapToData?D.position=T.dataCoordinate:D.position=T.dataPosition,D.bounds=m),N&&(N=!1,y()),j){H.axesPixels=c(H.axes,V,_,w),H.onrender&&H.onrender(),A.bindFramebuffer(A.FRAMEBUFFER,null),A.viewport(0,0,_,w);var k=H.clearColor;A.clearColor(k[0],k[1],k[2],k[3]),A.clear(A.COLOR_BUFFER_BIT|A.DEPTH_BUFFER_BIT),A.depthMask(!0),A.colorMask(!0,!0,!0,!0),A.enable(A.DEPTH_TEST),A.depthFunc(A.LEQUAL),A.disable(A.BLEND),A.disable(A.CULL_FACE);var L=!1;I.enable&&(L=L||I.isTransparent(),I.draw(V)),D.axes=I,T.object&&D.draw(V),A.disable(A.CULL_FACE);for(var o=0;o<r;++o){var l=P[o];l.axes=I,l.pixelRatio=H.pixelRatio,l.isOpaque&&l.isOpaque()&&l.draw(V),l.isTransparent&&l.isTransparent()&&(L=!0)}if(L){E.shape=q,E.bind(),A.clear(A.DEPTH_BUFFER_BIT),A.colorMask(!1,!1,!1,!1),A.depthMask(!0),A.depthFunc(A.LESS),I.enable&&I.isTransparent()&&I.drawTransparent(V);for(var o=0;o<r;++o){var l=P[o];l.isOpaque&&l.isOpaque()&&l.draw(V)}A.enable(A.BLEND),A.blendEquation(A.FUNC_ADD),A.blendFunc(A.ONE,A.ONE_MINUS_SRC_ALPHA),A.colorMask(!0,!0,!0,!0),A.depthMask(!1),A.clearColor(0,0,0,0),A.clear(A.COLOR_BUFFER_BIT),I.isTransparent()&&I.drawTransparent(V);for(var o=0;o<r;++o){var l=P[o];l.isTransparent&&l.isTransparent()&&l.drawTransparent(V)}A.bindFramebuffer(A.FRAMEBUFFER,null),A.blendFunc(A.ONE,A.ONE_MINUS_SRC_ALPHA),A.disable(A.DEPTH_TEST),S.bind(),E.color[0].bind(0),S.uniforms.accumBuffer=0,p(A),A.disable(A.BLEND)}j=!1;for(var o=0;o<r;++o)P[o].dirty=!1}}}function b(){_||H.contextLost||(requestAnimationFrame(b),x())}t=t||{};var _=!1,w=(t.pixelRatio||parseFloat(window.devicePixelRatio),t.canvas);if(!w)if(w=document.createElement("canvas"),t.container){var M=t.container;M.appendChild(w)}else document.body.appendChild(w);var A=t.gl;if(A||(A=i(w,t.glOptions||{premultipliedAlpha:!0,antialias:!0})),!A)throw new Error("webgl not supported");var k=t.bounds||[[-10,-10,-10],[10,10,10]],T=new n,E=d(A,[A.drawingBufferWidth,A.drawingBufferHeight],{preferFloat:!0}),S=v(A),L=t.camera||{eye:[2,0,0],center:[0,0,0],up:[0,1,0],zoomMin:.1,zoomMax:100,mode:"turntable"},C=t.axes||{},I=u(A,C);I.enable=!C.disable;var z=t.spikes||{},D=h(A,z),P=[],O=[],R=[],F=[],j=!0,N=!0,B=new Array(16),U=new Array(16),V={view:null,projection:B,model:U},N=!0,q=[A.drawingBufferWidth,A.drawingBufferHeight],H={gl:A,contextLost:!1,pixelRatio:t.pixelRatio||parseFloat(window.devicePixelRatio),canvas:w,selection:T,camera:l(w,L),axes:I,axesPixels:null,spikes:D,bounds:k,objects:P,shape:q,aspect:t.aspectRatio||[1,1,1],pickRadius:t.pickRadius||10,zNear:t.zNear||.01,zFar:t.zFar||1e3,fovy:t.fovy||Math.PI/4,clearColor:t.clearColor||[0,0,0,0],autoResize:o(t.autoResize),autoBounds:o(t.autoBounds),autoScale:!!t.autoScale,autoCenter:o(t.autoCenter),clipToBounds:o(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:V,oncontextloss:null,mouseListener:null},Y=[A.drawingBufferWidth/H.pixelRatio|0,A.drawingBufferHeight/H.pixelRatio|0];H.autoResize&&e(),window.addEventListener("resize",e),H.update=function(t){_||(t=t||{},j=!0,N=!0)},H.add=function(t){_||(t.axes=I,P.push(t),O.push(-1),j=!0,N=!0,r())},H.remove=function(t){if(!_){var e=P.indexOf(t);e<0||(P.splice(e,1),O.pop(),j=!0,N=!0,r())}},H.dispose=function(){if(!_&&(_=!0,window.removeEventListener("resize",e),w.removeEventListener("webglcontextlost",s),H.mouseListener.enabled=!1,!H.contextLost)){I.dispose(),D.dispose();for(var t=0;t<P.length;++t)P[t].dispose();E.dispose();for(var t=0;t<F.length;++t)F[t].dispose();S.dispose(),A=null,I=null,D=null,P=[]}};var G=!1,X=0;H.mouseListener=m(w,function(t,e,r){if(!_){var n=F.length,i=P.length,a=T.object;T.distance=1/0,T.mouse[0]=e,T.mouse[1]=r,T.object=null,T.screen=null,T.dataCoordinate=T.dataPosition=null;var o=!1;if(t&&X)G=!0;else{G&&(N=!0),G=!1;for(var s=0;s<n;++s){var l=F[s].query(e,Y[1]-r-1,H.pickRadius);if(l){if(l.distance>T.distance)continue;for(var u=0;u<i;++u){var c=P[u];if(O[u]===s){var h=c.pick(l);h&&(T.buttons=t,T.screen=l.coord,T.distance=l.distance,T.object=c,T.index=h.distance,T.dataPosition=h.position,T.dataCoordinate=h.dataCoordinate,T.data=h,o=!0)}}}}}a&&a!==T.object&&(a.highlight&&a.highlight(null),j=!0),T.object&&(T.object.highlight&&T.object.highlight(T.data),j=!0),o=o||T.object!==a,o&&H.onselect&&H.onselect(T),1&t&&!(1&X)&&H.onclick&&H.onclick(T),X=t}}),w.addEventListener("webglcontextlost",s);var W=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],Z=[W[0].slice(),W[1].slice()];return b(),H.redraw=function(){_||(j=!0,x())},H}e.exports=s;var l=t("3d-view-controls"),u=t("gl-axes3d"),c=t("gl-axes3d/properties"),h=t("gl-spikes3d"),f=t("gl-select-static"),d=t("gl-fbo"),p=t("a-big-triangle"),m=t("mouse-change"),g=t("gl-mat4/perspective"),v=t("./lib/shader")},{"./lib/shader":193,"3d-view-controls":28,"a-big-triangle":30,"gl-axes3d":122,"gl-axes3d/properties":129,"gl-fbo":137,"gl-mat4/perspective":157,"gl-select-static":224,"gl-spikes3d":234,"mouse-change":418}],195:[function(t,e,r){r.pointVertex="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\n\nuniform mat3 matrix;\nuniform float pointSize;\nuniform float pointCloud;\n\nhighp float rand(vec2 co) {\n  highp float a = 12.9898;\n  highp float b = 78.233;\n  highp float c = 43758.5453;\n  highp float d = dot(co.xy, vec2(a, b));\n  highp float e = mod(d, 3.14);\n  return fract(sin(e) * c);\n}\n\nvoid main() {\n  vec3 hgPosition = matrix * vec3(position, 1);\n  gl_Position  = vec4(hgPosition.xy, 0, hgPosition.z);\n    // if we don't jitter the point size a bit, overall point cloud\n    // saturation 'jumps' on zooming, which is disturbing and confusing\n  gl_PointSize = pointSize * ((19.5 + rand(position)) / 20.0);\n  if(pointCloud != 0.0) { // pointCloud is truthy\n    // get the same square surface as circle would be\n    gl_PointSize *= 0.886;\n  }\n}",r.pointFragment="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color, borderColor;\nuniform float centerFraction;\nuniform float pointCloud;\n\nvoid main() {\n  float radius;\n  vec4 baseColor;\n  if(pointCloud != 0.0) { // pointCloud is truthy\n    if(centerFraction == 1.0) {\n      gl_FragColor = color;\n    } else {\n      gl_FragColor = mix(borderColor, color, centerFraction);\n    }\n  } else {\n    radius = length(2.0 * gl_PointCoord.xy - 1.0);\n    if(radius > 1.0) {\n      discard;\n    }\n    baseColor = mix(borderColor, color, step(radius, centerFraction));\n    gl_FragColor = vec4(baseColor.rgb * baseColor.a, baseColor.a);\n  }\n}\n",r.pickVertex="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 pickId;\n\nuniform mat3 matrix;\nuniform float pointSize;\nuniform vec4 pickOffset;\n\nvarying vec4 fragId;\n\nvoid main() {\n  vec3 hgPosition = matrix * vec3(position, 1);\n  gl_Position  = vec4(hgPosition.xy, 0, hgPosition.z);\n  gl_PointSize = pointSize;\n\n  vec4 id = pickId + pickOffset;\n  id.y += floor(id.x / 256.0);\n  id.x -= floor(id.x / 256.0) * 256.0;\n\n  id.z += floor(id.y / 256.0);\n  id.y -= floor(id.y / 256.0) * 256.0;\n\n  id.w += floor(id.z / 256.0);\n  id.z -= floor(id.z / 256.0) * 256.0;\n\n  fragId = id;\n}\n",r.pickFragment="precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragId;\n\nvoid main() {\n  float radius = length(2.0 * gl_PointCoord.xy - 1.0);\n  if(radius > 1.0) {\n    discard;\n  }\n  gl_FragColor = fragId / 255.0;\n}\n"},{}],196:[function(t,e,r){arguments[4][185][0].apply(r,arguments)},{"./lib/GLError":197,"./lib/create-attributes":198,"./lib/create-uniforms":199,"./lib/reflect":200,"./lib/runtime-reflect":201,"./lib/shader-cache":202,dup:185}],197:[function(t,e,r){arguments[4][186][0].apply(r,arguments)},{dup:186}],198:[function(t,e,r){arguments[4][187][0].apply(r,arguments)},{"./GLError":197,dup:187}],199:[function(t,e,r){arguments[4][188][0].apply(r,arguments)},{"./GLError":197,"./reflect":200,dup:188}],200:[function(t,e,r){arguments[4][189][0].apply(r,arguments)},{dup:189}],201:[function(t,e,r){arguments[4][190][0].apply(r,arguments)},{dup:190}],202:[function(t,e,r){arguments[4][191][0].apply(r,arguments)},{"./GLError":197,dup:191,"gl-format-compiler-error":138,"weakmap-shim":523}],203:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.plot=t,this.offsetBuffer=e,this.pickBuffer=r,this.shader=n,this.pickShader=i,this.sizeMin=.5,this.sizeMinCap=2,this.sizeMax=20,this.areaRatio=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.blend=!1,this.pickOffset=0,this.points=null}function i(t,e){var r,n=0,i=t.length>>>1;for(r=0;r<i;r++){var a=t[2*r],o=t[2*r+1];a>=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}function a(t,e){var r=t.gl,i=s(r),a=s(r),l=o(r,u.pointVertex,u.pointFragment),c=o(r,u.pickVertex,u.pickFragment),h=new n(t,i,a,l,c);return h.update(e),t.addObject(h),h}var o=t("gl-shader"),s=t("gl-buffer"),l=t("typedarray-pool"),u=t("./lib/shader");e.exports=a;var c=n.prototype;c.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},c.update=function(t){function e(e,r){return e in t?t[e]:r}var r;t=t||{},this.sizeMin=e("sizeMin",.5),this.sizeMax=e("sizeMax",20),this.color=e("color",[1,0,0,1]).slice(),this.areaRatio=e("areaRatio",1),this.borderColor=e("borderColor",[0,0,0,1]).slice(),this.blend=e("blend",!1);var n=t.positions.length>>>1,i=t.positions instanceof Float32Array,a=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,o=t.positions,s=i?o:l.mallocFloat32(o.length),u=a?t.idToIndex:l.mallocInt32(n);if(i||s.set(o),!a)for(s.set(o),r=0;r<n;r++)u[r]=r;this.points=o,this.offsetBuffer.update(s),this.pickBuffer.update(u),i||l.free(s),a||l.free(u),this.pointCount=n,this.pickOffset=0},c.unifiedDraw=function(){var t=[1,0,0,0,1,0,0,0,1],e=[0,0,0,0];return function(r){var n=void 0!==r,a=n?this.pickShader:this.shader,o=this.plot.gl,s=this.plot.dataBox;if(0===this.pointCount)return r;var l=s[2]-s[0],u=s[3]-s[1],c=i(this.points,s),h=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(c,.33333)));t[0]=2/l,t[4]=2/u,t[6]=-2*s[0]/l-1,t[7]=-2*s[1]/u-1,this.offsetBuffer.bind(),a.bind(),a.attributes.position.pointer(),a.uniforms.matrix=t,a.uniforms.color=this.color,a.uniforms.borderColor=this.borderColor,a.uniforms.pointCloud=h<5,a.uniforms.pointSize=h,a.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),n&&(e[0]=255&r,e[1]=r>>8&255,e[2]=r>>16&255,e[3]=r>>24&255,this.pickBuffer.bind(),a.attributes.pickId.pointer(o.UNSIGNED_BYTE),a.uniforms.pickOffset=e,this.pickOffset=r);var f=o.getParameter(o.BLEND),d=o.getParameter(o.DITHER);return f&&!this.blend&&o.disable(o.BLEND),d&&o.disable(o.DITHER),o.drawArrays(o.POINTS,0,this.pointCount),f&&!this.blend&&o.enable(o.BLEND),d&&o.enable(o.DITHER),r+this.pointCount}}(),c.draw=c.unifiedDraw,c.drawPick=c.unifiedDraw,c.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(r<n||r>=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}}},{"./lib/shader":195,"gl-buffer":130,"gl-shader":196,"typedarray-pool":502}],204:[function(t,e,r){function n(t,e,r,n){var i,a,o,s,l,u=e[0],c=e[1],h=e[2],f=e[3],d=r[0],p=r[1],m=r[2],g=r[3];return a=u*d+c*p+h*m+f*g,a<0&&(a=-a,d=-d,p=-p,m=-m,g=-g),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*u+l*d,t[1]=s*c+l*p,t[2]=s*h+l*m,t[3]=s*f+l*g,t}e.exports=n},{}],205:[function(t,e,r){"use strict";e.exports={vertex:"precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 positionHi, positionLo;\nattribute vec2 offset;\nattribute vec4 color;\n\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo, pixelScale;\n\nvarying vec4 fragColor;\n\n\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo, vec2 screenScale, vec2 screenOffset) {\n  return vec4((posHi + trHi) * scHi\n            + (posLo + trLo) * scHi\n            + (posHi + trHi) * scLo\n            + (posLo + trLo) * scLo\n            + screenScale * screenOffset, 0, 1);\n}\n\nvoid main() {\n  fragColor = color;\n\n  gl_Position = computePosition_1_0(\n    positionHi, positionLo,\n    scaleHi, scaleLo,\n    translateHi, translateLo,\n    pixelScale, offset);\n}\n",fragment:"precision lowp float;\n#define GLSLIFY 1\nvarying vec4 fragColor;\nvoid main() {\n  gl_FragColor = vec4(fragColor.rgb * fragColor.a, fragColor.a);\n}\n",pickVertex:"precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 positionHi, positionLo;\nattribute vec2 offset;\nattribute vec4 id;\n\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo, pixelScale;\nuniform vec4 pickOffset;\n\nvarying vec4 fragColor;\n\n\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo, vec2 screenScale, vec2 screenOffset) {\n  return vec4((posHi + trHi) * scHi\n            + (posLo + trLo) * scHi\n            + (posHi + trHi) * scLo\n            + (posLo + trLo) * scLo\n            + screenScale * screenOffset, 0, 1);\n}\n\nvoid main() {\n  vec4 fragId = id + pickOffset;\n\n  fragId.y += floor(fragId.x / 256.0);\n  fragId.x -= floor(fragId.x / 256.0) * 256.0;\n\n  fragId.z += floor(fragId.y / 256.0);\n  fragId.y -= floor(fragId.y / 256.0) * 256.0;\n\n  fragId.w += floor(fragId.z / 256.0);\n  fragId.z -= floor(fragId.z / 256.0) * 256.0;\n\n  fragColor = fragId / 255.0;\n\n  gl_Position = computePosition_1_0(\n    positionHi, positionLo,\n    scaleHi, scaleLo,\n    translateHi, translateLo,\n    pixelScale, offset);\n}\n",pickFragment:"precision lowp float;\n#define GLSLIFY 1\nvarying vec4 fragColor;\nvoid main() {\n  gl_FragColor = fragColor;\n}\n"}},{}],206:[function(t,e,r){arguments[4][185][0].apply(r,arguments)},{"./lib/GLError":207,"./lib/create-attributes":208,"./lib/create-uniforms":209,"./lib/reflect":210,"./lib/runtime-reflect":211,"./lib/shader-cache":212,dup:185}],207:[function(t,e,r){arguments[4][186][0].apply(r,arguments)},{dup:186}],208:[function(t,e,r){arguments[4][187][0].apply(r,arguments)},{"./GLError":207,dup:187}],209:[function(t,e,r){arguments[4][188][0].apply(r,arguments)},{"./GLError":207,"./reflect":210,dup:188}],210:[function(t,e,r){arguments[4][189][0].apply(r,arguments)},{dup:189}],211:[function(t,e,r){arguments[4][190][0].apply(r,arguments)},{dup:190}],212:[function(t,e,r){arguments[4][191][0].apply(r,arguments)},{"./GLError":207,dup:191,"gl-format-compiler-error":138,"weakmap-shim":523}],213:[function(t,e,r){"use strict";function n(t){if(t in f)return f[t];var e=c(t,{polygons:!0,font:"sans-serif",textAlign:"left",textBaseline:"alphabetic"}),r=[],n=[];e.forEach(function(t){t.forEach(function(t){for(var e=0;e<t.length;++e){var i=t[(e+t.length-1)%t.length],a=t[e],o=t[(e+1)%t.length],s=t[(e+2)%t.length],l=a[0]-i[0],u=a[1]-i[1],c=Math.sqrt(l*l+u*u);l/=c,u/=c,r.push(i[0],i[1]+1.4),n.push(u,-l),r.push(i[0],i[1]+1.4),n.push(-u,l),r.push(a[0],a[1]+1.4),n.push(-u,l),r.push(a[0],a[1]+1.4),n.push(-u,l),r.push(i[0],i[1]+1.4),n.push(u,-l),r.push(a[0],a[1]+1.4),n.push(u,-l);var h=s[0]-o[0],f=s[1]-o[1],d=Math.sqrt(h*h+f*f);h/=d,f/=d,r.push(a[0],a[1]+1.4),n.push(u,-l),r.push(a[0],a[1]+1.4),n.push(-u,l),r.push(o[0],o[1]+1.4),n.push(-f,h),r.push(o[0],o[1]+1.4),n.push(-f,h),r.push(a[0],a[1]+1.4),n.push(f,-h),r.push(o[0],o[1]+1.4),n.push(f,-h)}})});for(var i=[1/0,1/0,-(1/0),-(1/0)],a=0;a<r.length;a+=2)for(var o=0;o<2;++o)i[o]=Math.min(i[o],r[a+o]),i[2+o]=Math.max(i[2+o],r[a+o]);return f[t]={coords:r,normals:n,bounds:i}}function i(t,e,r,n,i,a,o,s){this.plot=t,this.shader=e,this.pickShader=r,this.posHiBuffer=n,this.posLoBuffer=i,this.offsetBuffer=a,this.colorBuffer=o,this.idBuffer=s,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.numPoints=0,this.numVertices=0,this.pickOffset=0,this.points=null}function a(t,e){var r=t.gl,n=o(r,h.vertex,h.fragment),a=o(r,h.pickVertex,h.pickFragment),l=s(r),u=s(r),c=s(r),f=s(r),d=s(r),p=new i(t,n,a,l,u,c,f,d);return p.update(e),t.addObject(p),p}e.exports=a;var o=t("gl-shader"),s=t("gl-buffer"),l=t("text-cache"),u=t("typedarray-pool"),c=t("vectorize-text"),h=t("./lib/shaders"),f={},d=i.prototype;!function(){function t(){var t=this.plot,o=this.bounds,s=t.viewBox,l=t.dataBox,u=t.pixelRatio,c=o[2]-o[0],h=o[3]-o[1],f=l[2]-l[0],d=l[3]-l[1],p=2*c/f,m=2*h/d,g=(o[0]-l[0]-.5*f)/c,v=(o[1]-l[1]-.5*d)/h;e[0]=p,r[0]=p-e[0],e[1]=m,r[1]=m-e[1],n[0]=g,i[0]=g-n[0],n[1]=v,i[1]=v-n[1];var y=s[2]-s[0],x=s[3]-s[1];a[0]=2*u/y,a[1]=2*u/x}var e=new Float32Array([0,0]),r=new Float32Array([0,0]),n=new Float32Array([0,0]),i=new Float32Array([0,0]),a=[0,0],o=[0,0,0,0];d.drawPick=function(s){var l=void 0!==s,u=this.plot,c=this.numVertices;if(!c)return s;t.call(this);var h=u.gl,f=l?this.pickShader:this.shader;if(f.bind(),l){this.pickOffset=s;for(var d=0;d<4;++d)o[d]=s>>8*d&255;f.uniforms.pickOffset=o,this.idBuffer.bind(),f.attributes.id.pointer(h.UNSIGNED_BYTE,!1)}else this.colorBuffer.bind(),f.attributes.color.pointer(h.UNSIGNED_BYTE,!0);return this.posHiBuffer.bind(),f.attributes.positionHi.pointer(),this.posLoBuffer.bind(),f.attributes.positionLo.pointer(),this.offsetBuffer.bind(),f.attributes.offset.pointer(),f.uniforms.pixelScale=a,f.uniforms.scaleHi=e,f.uniforms.scaleLo=r,f.uniforms.translateHi=n,f.uniforms.translateLo=i,h.drawArrays(h.TRIANGLES,0,c),l?s+this.numPoints:void 0}}(),d.draw=d.drawPick,d.pick=function(t,e,r){var n=this.pickOffset,i=this.numPoints;if(r<n||r>=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}},d.update=function(t){t=t||{};var e,r,i=t.positions||[],a=t.colors||[],o=t.glyphs||[],s=t.sizes||[],c=t.borderWidths||[],h=t.borderColors||[];this.points=i;var f,d,p=this.bounds=[1/0,1/0,-(1/0),-(1/0)],m=0,g=[],v=[];for(e=0;e<o.length;++e)for(f=l("sans-serif",o[e]),d=n(o[e]),g.push(f),v.push(d),m+=f.data.length+d.coords.length>>1,r=0;r<2;++r)p[r]=Math.min(p[r],i[2*e+r]),p[2+r]=Math.max(p[2+r],i[2*e+r]);p[0]===p[2]&&(p[2]+=1),p[3]===p[1]&&(p[3]+=1);var y=1/(p[2]-p[0]),x=1/(p[3]-p[1]),b=p[0],_=p[1],w=u.mallocFloat64(2*m),M=u.mallocFloat32(2*m),A=u.mallocFloat32(2*m),k=u.mallocFloat32(2*m),T=u.mallocUint8(4*m),E=u.mallocUint32(m),S=0;for(e=0;e<o.length;++e){f=g[e],d=v[e];var L=y*(i[2*e]-b),C=x*(i[2*e+1]-_),I=s[e],z=255*a[4*e],D=255*a[4*e+1],P=255*a[4*e+2],O=255*a[4*e+3],R=.5*(d.bounds[0]+d.bounds[2]),F=.5*(d.bounds[1]+d.bounds[3]);for(r=0;r<f.data.length;r+=2)w[2*S]=L,w[2*S+1]=C,k[2*S]=-I*(f.data[r]-R),k[2*S+1]=-I*(f.data[r+1]-F),T[4*S]=z,T[4*S+1]=D,T[4*S+2]=P,T[4*S+3]=O,E[S]=e,S+=1;var j=c[e];for(z=255*h[4*e],D=255*h[4*e+1],P=255*h[4*e+2],O=255*h[4*e+3],r=0;r<d.coords.length;r+=2)w[2*S]=L,w[2*S+1]=C,k[2*S]=-(I*(d.coords[r]-R)+j*d.normals[r]),k[2*S+1]=-(I*(d.coords[r+1]-F)+j*d.normals[r+1]),T[4*S]=z,T[4*S+1]=D,T[4*S+2]=P,T[4*S+3]=O,E[S]=e,S+=1}for(this.numPoints=o.length,this.numVertices=m,M.set(w),e=0;e<w.length;e++)A[e]=w[e]-M[e];this.posHiBuffer.update(M),this.posLoBuffer.update(A),this.offsetBuffer.update(k),this.colorBuffer.update(T),this.idBuffer.update(E),u.free(w),u.free(M),u.free(A),u.free(k),u.free(T),u.free(E)},d.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.posHiBuffer.dispose(),this.posLoBuffer.dispose(),this.offsetBuffer.dispose(),this.colorBuffer.dispose(),this.idBuffer.dispose(),this.plot.removeObject(this)}},{"./lib/shaders":205,"gl-buffer":130,"gl-shader":206,"text-cache":494,"typedarray-pool":502,"vectorize-text":515}],214:[function(t,e,r){r.pointVertex="precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 positionHi, positionLo;\nattribute float weight;\n\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\nuniform float pointSize, useWeight;\n\nvarying float fragWeight;\n\n\nvec4 pfx_1_0(vec2 scaleHi, vec2 scaleLo, vec2 translateHi, vec2 translateLo, vec2 positionHi, vec2 positionLo) {\n  return vec4((positionHi + translateHi) * scaleHi\n            + (positionLo + translateLo) * scaleHi\n            + (positionHi + translateHi) * scaleLo\n            + (positionLo + translateLo) * scaleLo, 0.0, 1.0);\n}\n\nvoid main() {\n  gl_Position = pfx_1_0(scaleHi, scaleLo, translateHi, translateLo, positionHi, positionLo);\n  gl_PointSize = pointSize;\n  fragWeight = mix(1.0, weight, useWeight);\n}",r.pointFragment="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color, borderColor;\nuniform float centerFraction;\n\nvarying float fragWeight;\n\nfloat smoothStep(float x, float y) {\n  return 1.0 / (1.0 + exp(50.0*(x - y)));\n}\n\nvoid main() {\n  float radius = length(2.0*gl_PointCoord.xy-1.0);\n  if(radius > 1.0) {\n    discard;\n  }\n  vec4 baseColor = mix(borderColor, color, smoothStep(radius, centerFraction));\n  float alpha = 1.0 - pow(1.0 - baseColor.a, fragWeight);\n  gl_FragColor = vec4(baseColor.rgb * alpha, alpha);\n}",r.pickVertex="precision highp float;\n#define GLSLIFY 1\n\nvec4 pfx_1_0(vec2 scaleHi, vec2 scaleLo, vec2 translateHi, vec2 translateLo, vec2 positionHi, vec2 positionLo) {\n  return vec4((positionHi + translateHi) * scaleHi\n            + (positionLo + translateLo) * scaleHi\n            + (positionHi + translateHi) * scaleLo\n            + (positionLo + translateLo) * scaleLo, 0.0, 1.0);\n}\n\nattribute vec2 positionHi, positionLo;\nattribute vec4 pickId;\n\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\nuniform float pointSize;\nuniform vec4 pickOffset;\n\nvarying vec4 fragId;\n\nvoid main() {\n\n  vec4 id = pickId + pickOffset;\n  id.y += floor(id.x / 256.0);\n  id.x -= floor(id.x / 256.0) * 256.0;\n\n  id.z += floor(id.y / 256.0);\n  id.y -= floor(id.y / 256.0) * 256.0;\n\n  id.w += floor(id.z / 256.0);\n  id.z -= floor(id.z / 256.0) * 256.0;\n\n  gl_Position = pfx_1_0(scaleHi, scaleLo, translateHi, translateLo, positionHi, positionLo);\n  gl_PointSize = pointSize;\n  fragId = id;\n}",r.pickFragment="precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragId;\n\nvoid main() {\n  float radius = length(2.0 * gl_PointCoord.xy - 1.0);\n  if(radius > 1.0) {\n    discard;\n  }\n  gl_FragColor = fragId / 255.0;\n}"},{}],215:[function(t,e,r){arguments[4][74][0].apply(r,arguments)},{dup:74}],216:[function(t,e,r){"use strict";function n(t,e,r,n,a){a<=4*f?i(0,a-1,t,e,r,n):h(0,a-1,t,e,r,n)}function i(t,e,r,n,i,a){for(var o=t+1;o<=e;++o){for(var s=r[o],l=n[2*o],u=n[2*o+1],c=i[o],h=a[o],f=o;f>t;){var d=r[f-1],p=n[2*(f-1)];if((d-s||l-p)>=0)break;r[f]=d,n[2*f]=p,n[2*f+1]=n[2*f-1],i[f]=i[f-1],a[f]=a[f-1],f-=1}r[f]=s,n[2*f]=l,n[2*f+1]=u,i[f]=c,a[f]=h}}function a(t,e,r,n,i,a){var o=r[t],s=n[2*t],l=n[2*t+1],u=i[t],c=a[t];r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e],r[e]=o,n[2*e]=s,n[2*e+1]=l,i[e]=u,a[e]=c}function o(t,e,r,n,i,a){r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e]}function s(t,e,r,n,i,a,o){var s=n[t],l=i[2*t],u=i[2*t+1],c=a[t],h=o[t];n[t]=n[e],i[2*t]=i[2*e],i[2*t+1]=i[2*e+1],a[t]=a[e],o[t]=o[e],n[e]=n[r],i[2*e]=i[2*r],i[2*e+1]=i[2*r+1],a[e]=a[r],o[e]=o[r],n[r]=s,i[2*r]=l,i[2*r+1]=u,a[r]=c,o[r]=h}function l(t,e,r,n,i,a,o,s,l,u,c){s[t]=s[e],l[2*t]=l[2*e],l[2*t+1]=l[2*e+1],u[t]=u[e],c[t]=c[e],s[e]=r,l[2*e]=n,l[2*e+1]=i,u[e]=a,c[e]=o}function u(t,e,r,n,i){return(r[t]-r[e]||n[2*e]-n[2*t]||i[t]-i[e])<0}function c(t,e,r,n,i,a,o,s){return(e-a[t]||o[2*t]-r||i-s[t])<0}function h(t,e,r,n,d,p){var m=(e-t+1)/6|0,g=t+m,v=e-m,y=t+e>>1,x=y-m,b=y+m,_=g,w=x,M=y,A=b,k=v,T=t+1,E=e-1,S=0;u(_,w,r,n,d,p)&&(S=_,_=w,w=S),u(A,k,r,n,d,p)&&(S=A,A=k,k=S),u(_,M,r,n,d,p)&&(S=_,_=M,M=S),u(w,M,r,n,d,p)&&(S=w,w=M,M=S),u(_,A,r,n,d,p)&&(S=_,_=A,A=S),u(M,A,r,n,d,p)&&(S=M,M=A,A=S),u(w,k,r,n,d,p)&&(S=w,w=k,k=S),u(w,M,r,n,d,p)&&(S=w,w=M,M=S),u(A,k,r,n,d,p)&&(S=A,A=k,k=S);var L=r[w],C=n[2*w],I=n[2*w+1],z=d[w],D=p[w],P=r[A],O=n[2*A],R=n[2*A+1],F=d[A],j=p[A],N=_,B=M,U=k,V=g,q=y,H=v,Y=r[N],G=r[B],X=r[U];r[V]=Y,r[q]=G,r[H]=X;for(var W=0;W<2;++W){var Z=n[2*N+W],J=n[2*B+W],K=n[2*U+W];n[2*V+W]=Z,n[2*q+W]=J,n[2*H+W]=K}var Q=d[N],$=d[B],tt=d[U];d[V]=Q,d[q]=$,d[H]=tt;var et=p[N],rt=p[B],nt=p[U];p[V]=et,p[q]=rt,p[H]=nt,o(x,t,r,n,d,p),o(b,e,r,n,d,p);for(var it=T;it<=E;++it)if(c(it,L,C,I,z,r,n,d))it!==T&&a(it,T,r,n,d,p),++T;else if(!c(it,P,O,R,F,r,n,d))for(;;){if(c(E,P,O,R,F,r,n,d)){c(E,L,C,I,z,r,n,d)?(s(it,T,E,r,n,d,p),++T,--E):(a(it,E,r,n,d,p),--E);break}if(--E<it)break}l(t,T-1,L,C,I,z,D,r,n,d,p),l(e,E+1,P,O,R,F,j,r,n,d,p),T-2-t<=f?i(t,T-2,r,n,d,p):h(t,T-2,r,n,d,p),e-(E+2)<=f?i(E+2,e,r,n,d,p):h(E+2,e,r,n,d,p),E-T<=f?i(T,E,r,n,d,p):h(T,E,r,n,d,p)}e.exports=n;var f=32},{}],217:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s){for(var l=r,u=r;u<n;++u){var c=t[2*u],h=t[2*u+1],f=e[u];i<=c&&c<=o&&a<=h&&h<=s&&(u===l?l+=1:(t[2*u]=t[2*l],t[2*u+1]=t[2*l+1],e[u]=e[l],t[2*l]=c,t[2*l+1]=h,e[l]=f,l+=1))}return l}function i(t,e,r){this.pixelSize=t,this.offset=e,this.count=r}function a(t,e,r,a){function l(i,a,o,s,u,c){var h=.5*o,f=s+1,d=u-s;r[_]=d,b[_++]=c;for(var p=0;p<2;++p)for(var m=0;m<2;++m){var g=i+p*h,v=a+m*h,y=n(t,e,f,u,g,v,g+h,v+h);if(y!==f){if(y-f>=Math.max(.9*d,32)){var x=u+s>>>1;l(g,v,h,f,x,c+1),f=x}l(g,v,h,f,y,c+1),f=y}}}var u=t.length>>>1;if(u<1)return[];for(var c=1/0,h=1/0,f=-(1/0),d=-(1/0),p=0;p<u;++p){var m=t[2*p],g=t[2*p+1];c=Math.min(c,m),f=Math.max(f,m),h=Math.min(h,g),d=Math.max(d,g),e[p]=p}c===f&&(f+=1+Math.abs(f)),h===d&&(d+=1+Math.abs(f));var v=1/(f-c),y=1/(d-h),x=Math.max(f-c,d-h);a=a||[0,0,0,0],a[0]=c,a[1]=h,a[2]=f,a[3]=d;var b=o.mallocInt32(u),_=0;l(c,h,x,0,u,0),s(b,t,e,r,u);for(var w=[],M=0,A=u,_=u-1;_>=0;--_){t[2*_]=(t[2*_]-c)*v,t[2*_+1]=(t[2*_+1]-h)*y;var k=b[_];k!==M&&(w.push(new i(x*Math.pow(.5,k),_+1,A-(_+1))),A=_+1,M=k)}return w.push(new i(x*Math.pow(.5,k+1),0,A)),o.free(b),w}var o=t("typedarray-pool"),s=t("./lib/sort");e.exports=a},{"./lib/sort":216,"typedarray-pool":502}],218:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o){this.plot=t,this.positionBufferHi=e,this.positionBufferLo=r,this.pickBuffer=n,this.weightBuffer=i,this.shader=a,this.pickShader=o,this.scales=[],this.size=12,this.borderSize=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.pickOffset=0,this.points=null,this.xCoords=null}function i(t,e){var r=t.gl,i=o(r),s=o(r),l=o(r),u=o(r),h=a(r,c.pointVertex,c.pointFragment),f=a(r,c.pickVertex,c.pickFragment),d=new n(t,i,s,l,u,h,f);return d.update(e),t.addObject(d),d}var a=t("gl-shader"),o=t("gl-buffer"),s=t("binary-search-bounds"),l=t("snap-points-2d"),u=t("typedarray-pool"),c=t("./lib/shader");e.exports=i;var h=n.prototype,f=new Float32Array(2),d=new Float32Array(2),p=new Float32Array(2),m=new Float32Array(2),g=[0,0,0,0];h.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.positionBufferHi.dispose(),this.positionBufferLo.dispose(),this.pickBuffer.dispose(),this.xCoords&&u.free(this.xCoords),this.plot.removeObject(this)},h.update=function(t){function e(e,r){return e in t?t[e]:r}t=t||{},this.size=e("size",12),this.color=e("color",[1,0,0,1]).slice(),this.borderSize=e("borderSize",1),this.borderColor=e("borderColor",[0,0,0,1]).slice(),this.xCoords&&u.free(this.xCoords),this.points=t.positions;var r=this.points.length>>>1,n=u.mallocInt32(r),i=u.mallocFloat32(2*r),a=u.mallocFloat64(2*r);a.set(this.points),this.scales=l(a,n,i,this.bounds);var o=u.mallocFloat64(r),s=u.mallocFloat32(2*r),c=u.mallocFloat32(2*r);s.set(a);for(var h=0,f=0;h<r;h++,f+=2)c[f]=a[f]-s[f],c[f+1]=a[f+1]-s[f+1],o[h]=a[f];this.positionBufferHi.update(s),this.positionBufferLo.update(c),this.pickBuffer.update(n),this.weightBuffer.update(i),u.free(n),u.free(a),u.free(s),u.free(c),u.free(i),this.xCoords=o,this.pointCount=r,this.pickOffset=0},h.draw=function(t){var e=void 0!==t,r=this.plot,n=e?this.pickShader:this.shader,i=this.scales,a=this.positionBufferHi,o=this.positionBufferLo,l=this.pickBuffer,u=this.bounds,c=this.size,h=this.borderSize,v=r.gl,y=e?r.pickPixelRatio:r.pixelRatio,x=r.viewBox,b=r.dataBox;if(0===this.pointCount)return t;var _=u[2]-u[0],w=u[3]-u[1],M=b[2]-b[0],A=b[3]-b[1],k=(x[2]-x[0])*y/r.pixelRatio,T=(x[3]-x[1])*y/r.pixelRatio,E=Math.min(M/k,A/T),S=2*_/M,L=2*w/A;f[0]=S,f[1]=L,d[0]=S-f[0],d[1]=L-f[1];var C=(u[0]-b[0]-.5*M)/_,I=(u[1]-b[1]-.5*A)/w;p[0]=C,p[1]=I,m[0]=C-p[0],m[1]=I-p[1],n.bind(),n.uniforms.scaleHi=f,n.uniforms.scaleLo=d,n.uniforms.translateHi=p,n.uniforms.translateLo=m,n.uniforms.color=this.color,n.uniforms.borderColor=this.borderColor,n.uniforms.pointSize=y*(c+h),n.uniforms.centerFraction=0===this.borderSize?2:c/(c+h+1.25),a.bind(),n.attributes.positionHi.pointer(),o.bind(),n.attributes.positionLo.pointer(),e?(this.pickOffset=t,g[0]=255&t,g[1]=t>>8&255,g[2]=t>>16&255,g[3]=t>>24&255,n.uniforms.pickOffset=g,l.bind(),n.attributes.pickId.pointer(v.UNSIGNED_BYTE)):(n.uniforms.useWeight=1,this.weightBuffer.bind(),n.attributes.weight.pointer());for(var z=this.xCoords,D=(b[0]-u[0]-E*c*y)/_,P=(b[2]-u[0]+E*c*y)/_,O=!0,R=i.length-1;R>=0;R--){var F=i[R];if(!(F.pixelSize<E&&R>1)){var j=F.offset,N=F.count+j,B=s.ge(z,D,j,N-1),U=s.lt(z,P,B,N-1)+1;U>B&&v.drawArrays(v.POINTS,B,U-B),!e&&O&&(O=!1,n.uniforms.useWeight=0)}}return t+this.pointCount},h.drawPick=h.draw,h.pick=function(t,e,r){var n=r-this.pickOffset;return n<0||n>=this.pointCount?null:{object:this,pointId:n,dataCoord:[this.points[2*n],this.points[2*n+1]]}}},{"./lib/shader":214,"binary-search-bounds":215,"gl-buffer":130,"gl-shader":225,"snap-points-2d":217,"typedarray-pool":502}],219:[function(t,e,r){"use strict";function n(t,e){var r=a[e];if(r||(r=a[e]={}),t in r)return r[t];for(var n=i(t,{textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),o=i(t,{triangles:!0,textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),s=[[1/0,1/0],[-(1/0),-(1/0)]],l=0;l<n.positions.length;++l)for(var u=n.positions[l],c=0;c<2;++c)s[0][c]=Math.min(s[0][c],u[c]),s[1][c]=Math.max(s[1][c],u[c]);return r[t]=[o,n,s]}var i=t("vectorize-text");e.exports=n;var a={}},{"vectorize-text":515}],220:[function(t,e,r){function n(t,e){var r=i(t,e),n=r.attributes;return n.position.location=0,n.color.location=1,n.glyph.location=2,n.id.location=3,r}var i=t("gl-shader"),a="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n  if(any(lessThan(position, clipBounds[0]))   || \n     any(greaterThan(position, clipBounds[1])) ) {\n    gl_Position = vec4(0,0,0,0);\n  } else {\n    float scale = 1.0;\n    if(distance(highlightId, id) < 0.0001) {\n      scale = highlightScale;\n    }\n\n    vec4 worldPosition = model * vec4(position, 1);\n    vec4 viewPosition = view * worldPosition;\n    viewPosition = viewPosition / viewPosition.w;\n    vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\n    \n    gl_Position = clipPosition;\n    interpColor = color;\n    pickId = id;\n    dataCoordinate = position;\n  }\n}",o="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float highlightScale, pixelRatio;\nuniform vec4 highlightId;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n  if(any(lessThan(position, clipBounds[0])) || any(greaterThan(position, clipBounds[1]))) {\n    gl_Position = vec4(0,0,0,0);\n  } else {\n    float scale = pixelRatio;\n    if(distance(highlightId.bgr, id.bgr) < 0.001) {\n      scale *= highlightScale;\n    }\n\n    vec4 worldPosition = model * vec4(position, 1.0);\n    vec4 viewPosition = view * worldPosition;\n    vec4 clipPosition = projection * viewPosition;\n    clipPosition /= clipPosition.w;\n    \n    gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\n    interpColor = color;\n    pickId = id;\n    dataCoordinate = position;\n  }\n}",s="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform float highlightScale;\nuniform vec4 highlightId;\nuniform vec3 axes[2];\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float scale, pixelRatio;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n  if(any(lessThan(position, clipBounds[0]))   ||\n     any(greaterThan(position, clipBounds[1])) ) {\n    gl_Position = vec4(0,0,0,0);\n  } else {\n    float lscale = pixelRatio * scale;\n    if(distance(highlightId, id) < 0.0001) {\n      lscale *= highlightScale;\n    }\n\n    vec4 clipCenter   = projection * view * model * vec4(position, 1);\n    vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\n    vec4 clipPosition = projection * view * model * vec4(dataPosition, 1);\n\n    gl_Position = clipPosition;\n    interpColor = color;\n    pickId = id;\n    dataCoordinate = dataPosition;\n  }\n}\n",l="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n  if(any(lessThan(dataCoordinate, fragClipBounds[0]))   ||\n     any(greaterThan(dataCoordinate, fragClipBounds[1])) ) {\n    discard;\n  } else {\n    gl_FragColor = interpColor * opacity;\n  }\n}\n",u="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n  if(any(lessThan(dataCoordinate, fragClipBounds[0]))   || \n     any(greaterThan(dataCoordinate, fragClipBounds[1])) ) {\n    discard;\n  } else {\n    gl_FragColor = vec4(pickGroup, pickId.bgr);\n  }\n}",c=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],h={vertex:a,fragment:l,attributes:c},f={vertex:o,fragment:l,attributes:c},d={vertex:s,fragment:l,attributes:c},p={vertex:a,fragment:u,attributes:c},m={vertex:o,fragment:u,attributes:c},g={vertex:s,fragment:u,attributes:c};r.createPerspective=function(t){return n(t,h)},r.createOrtho=function(t){return n(t,f)},r.createProject=function(t){return n(t,d)},r.createPickPerspective=function(t){return n(t,p)},r.createPickOrtho=function(t){return n(t,m)},r.createPickProject=function(t){return n(t,g)}},{"gl-shader":225}],221:[function(t,e,r){"use strict";function n(t,e){var r=t[0],n=t[1],i=t[2],a=t[3];return t[0]=e[0]*r+e[4]*n+e[8]*i+e[12]*a,t[1]=e[1]*r+e[5]*n+e[9]*i+e[13]*a,t[2]=e[2]*r+e[6]*n+e[10]*i+e[14]*a,t[3]=e[3]*r+e[7]*n+e[11]*i+e[15]*a,t}function i(t,e,r,i){return n(i,i,r),n(i,i,e),n(i,i,t)}function a(t,e){this.index=t,this.dataCoordinate=this.position=e}function o(t,e,r,n,i,o,s,l,u,c,h,f){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=o,this.glyphBuffer=s,this.idBuffer=l,this.vao=u,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.pickId=0,this.pickPerspectiveShader=c,this.pickOrthoShader=h,this.pickProjectShader=f,this.points=[],this._selectResult=new a(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.dirty=!0}function s(t){return t[0]=t[1]=t[2]=0,t}function l(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function u(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function c(t){for(var e=L,r=0;r<2;++r)for(var n=0;n<3;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}function h(t,e,r,n,a){var o,h=e.axesProject,f=e.gl,d=t.uniforms,p=r.model||b,m=r.view||b,g=r.projection||b,y=e.axesBounds,x=c(e.clipBounds);o=e.axes?e.axes.lastCubeProps.axis:[1,1,1],w[0]=2/f.drawingBufferWidth,w[1]=2/f.drawingBufferHeight,t.bind(),d.view=m,d.projection=g,d.screenSize=w,d.highlightId=e.highlightId,d.highlightScale=e.highlightScale,d.clipBounds=x,d.pickGroup=e.pickId/255,d.pixelRatio=e.pixelRatio;for(var _=0;_<3;++_)if(h[_]&&e.projectOpacity[_]<1===n){d.scale=e.projectScale[_],d.opacity=e.projectOpacity[_];for(var L=E,C=0;C<16;++C)L[C]=0;for(var C=0;C<4;++C)L[5*C]=1;L[5*_]=0,o[_]<0?L[12+_]=y[0][_]:L[12+_]=y[1][_],v(L,p,L),d.model=L;var I=(_+1)%3,z=(_+2)%3,D=s(M),P=s(A);D[I]=1,P[z]=1;var O=i(g,m,p,l(k,D)),R=i(g,m,p,l(T,P));if(Math.abs(O[1])>Math.abs(R[1])){var F=O;O=R,R=F,F=D,D=P,P=F;var j=I;I=z,z=j}O[0]<0&&(D[I]=-1),R[1]>0&&(P[z]=-1);for(var N=0,B=0,C=0;C<4;++C)N+=Math.pow(p[4*I+C],2),B+=Math.pow(p[4*z+C],2);D[I]/=Math.sqrt(N),P[z]/=Math.sqrt(B),d.axes[0]=D,d.axes[1]=P,d.fragClipBounds[0]=u(S,x[0],_,-1e8),d.fragClipBounds[1]=u(S,x[1],_,1e8),e.vao.draw(f.TRIANGLES,e.vertexCount),e.lineWidth>0&&(f.lineWidth(e.lineWidth),e.vao.draw(f.LINES,e.lineVertexCount,e.vertexCount))}}function f(t,e,r,n,i,a){var o=r.gl;if(r.vao.bind(),i===r.opacity<1||a){t.bind();var s=t.uniforms;s.model=n.model||b,s.view=n.view||b,s.projection=n.projection||b,w[0]=2/o.drawingBufferWidth,w[1]=2/o.drawingBufferHeight,s.screenSize=w,s.highlightId=r.highlightId,s.highlightScale=r.highlightScale,s.fragClipBounds=z,s.clipBounds=r.axes.bounds,s.opacity=r.opacity,s.pickGroup=r.pickId/255,s.pixelRatio=r.pixelRatio,r.vao.draw(o.TRIANGLES,r.vertexCount),r.lineWidth>0&&(o.lineWidth(r.lineWidth),r.vao.draw(o.LINES,r.lineVertexCount,r.vertexCount))}h(e,r,n,i,a),r.vao.unbind()}function d(t){var e=t.gl,r=y.createPerspective(e),n=y.createOrtho(e),i=y.createProject(e),a=y.createPickPerspective(e),s=y.createPickOrtho(e),l=y.createPickProject(e),u=p(e),c=p(e),h=p(e),f=p(e),d=m(e,[{buffer:u,size:3,type:e.FLOAT},{buffer:c,size:4,type:e.FLOAT},{buffer:h,size:2,type:e.FLOAT},{buffer:f,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),g=new o(e,r,n,i,u,c,h,f,d,a,s,l);return g.update(t),g}var p=t("gl-buffer"),m=t("gl-vao"),g=t("typedarray-pool"),v=t("gl-mat4/multiply"),y=t("./lib/shaders"),x=t("./lib/glyphs"),b=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];e.exports=d;var _=o.prototype;_.pickSlots=1,_.setPickBase=function(t){this.pickId=t},_.isTransparent=function(){if(this.opacity<1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]<1)return!0;return!1},_.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var w=[0,0],M=[0,0,0],A=[0,0,0],k=[0,0,0,1],T=[0,0,0,1],E=b.slice(),S=[0,0,0],L=[[0,0,0],[0,0,0]],C=[-1e8,-1e8,-1e8],I=[1e8,1e8,1e8],z=[C,I];_.draw=function(t){var e=this.useOrtho?this.orthoShader:this.shader;f(e,this.projectShader,this,t,!1,!1)},_.drawTransparent=function(t){var e=this.useOrtho?this.orthoShader:this.shader;f(e,this.projectShader,this,t,!0,!1)},_.drawPick=function(t){var e=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;f(e,this.pickProjectShader,this,t,!1,!0)},_.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(e>=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},_.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},_.update=function(t){if(t=t||{},"perspective"in t&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if("projectOpacity"in t)if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{var r=+t.projectOpacity;this.projectOpacity=[r,r,r]}"opacity"in t&&(this.opacity=t.opacity),this.dirty=!0;var n=t.position;if(n){var i=t.font||"normal",a=t.alignment||[0,0],o=[1/0,1/0,1/0],s=[-(1/0),-(1/0),-(1/0)],l=t.glyph,u=t.color,c=t.size,h=t.angle,f=t.lineColor,d=0,p=0,m=0,v=n.length;t:for(var y=0;y<v;++y){for(var b=n[y],_=0;_<3;++_)if(isNaN(b[_])||!isFinite(b[_]))continue t;var w;w=Array.isArray(l)?x(l[y],i):l?x(l,i):x("●",i);var M=w[0],A=w[1],k=w[2];p+=3*M.cells.length,m+=2*A.edges.length}var T=p+m,E=g.mallocFloat(3*T),S=g.mallocFloat(4*T),L=g.mallocFloat(2*T),C=g.mallocUint32(T),I=[0,a[1]],z=0,D=p,P=[0,0,0,1],O=[0,0,0,1],R=Array.isArray(u)&&Array.isArray(u[0]),F=Array.isArray(f)&&Array.isArray(f[0]);t:for(var y=0;y<v;++y){for(var b=n[y],_=0;_<3;++_){if(isNaN(b[_])||!isFinite(b[_])){d+=1;continue t}s[_]=Math.max(s[_],b[_]),o[_]=Math.min(o[_],b[_])}var w;w=Array.isArray(l)?x(l[y],i):l?x(l,i):x("●",i);var M=w[0],A=w[1],k=w[2];if(Array.isArray(u)){var j;if(j=R?u[y]:u,3===j.length){for(var _=0;_<3;++_)P[_]=j[_];P[3]=1}else if(4===j.length)for(var _=0;_<4;++_)P[_]=j[_]}else P[0]=P[1]=P[2]=0,P[3]=1;if(Array.isArray(f)){var j;if(j=F?f[y]:f,3===j.length){for(var _=0;_<3;++_)O[_]=j[_];O[_]=1}else if(4===j.length)for(var _=0;_<4;++_)O[_]=j[_]}else O[0]=O[1]=O[2]=0,O[3]=1;var N=.5;Array.isArray(c)?N=+c[y]:c?N=+c:this.useOrtho&&(N=12);var B=0;Array.isArray(h)?B=+h[y]:h&&(B=+h);for(var U=Math.cos(B),V=Math.sin(B),b=n[y],_=0;_<3;++_)s[_]=Math.max(s[_],b[_]),o[_]=Math.min(o[_],b[_]);a[0]<0?I[0]=a[0]*(1+k[1][0]):a[0]>0&&(I[0]=-a[0]*(1+k[0][0]));for(var q=M.cells,H=M.positions,_=0;_<q.length;++_)for(var Y=q[_],G=0;G<3;++G){for(var X=0;X<3;++X)E[3*z+X]=b[X];for(var X=0;X<4;++X)S[4*z+X]=P[X];C[z]=d;var W=H[Y[G]];L[2*z]=N*(U*W[0]-V*W[1]+I[0]),L[2*z+1]=N*(V*W[0]+U*W[1]+I[1]),z+=1}for(var q=A.edges,H=A.positions,_=0;_<q.length;++_)for(var Y=q[_],G=0;G<2;++G){for(var X=0;X<3;++X)E[3*D+X]=b[X];for(var X=0;X<4;++X)S[4*D+X]=O[X];C[D]=d;var W=H[Y[G]];L[2*D]=N*(U*W[0]-V*W[1]+I[0]),L[2*D+1]=N*(V*W[0]+U*W[1]+I[1]),D+=1}d+=1}this.vertexCount=p,this.lineVertexCount=m,this.pointBuffer.update(E),this.colorBuffer.update(S),this.glyphBuffer.update(L),this.idBuffer.update(new Uint32Array(C)),g.free(E),g.free(S),g.free(L),g.free(C),this.bounds=[o,s],this.points=n,this.pointCount=n.length}},_.dispose=function(){this.shader.dispose(),this.orthoShader.dispose(),this.pickPerspectiveShader.dispose(),this.pickOrthoShader.dispose(),this.vao.dispose(),this.pointBuffer.dispose(),this.colorBuffer.dispose(),this.glyphBuffer.dispose(),this.idBuffer.dispose()}},{"./lib/glyphs":219,"./lib/shaders":220,"gl-buffer":130,"gl-mat4/multiply":156,"gl-vao":241,"typedarray-pool":502}],222:[function(t,e,r){"use strict";r.boxVertex="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 vertex;\n\nuniform vec2 cornerA, cornerB;\n\nvoid main() {\n  gl_Position = vec4(mix(cornerA, cornerB, vertex), 0, 1);\n}\n",r.boxFragment="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color;\n\nvoid main() {\n  gl_FragColor = color;\n}\n"},{}],223:[function(t,e,r){"use strict";function n(t,e,r){this.plot=t,this.boxBuffer=e,this.boxShader=r,this.enabled=!0,this.selectBox=[1/0,1/0,-(1/0),-(1/0)],this.borderColor=[0,0,0,1],this.innerFill=!1,this.innerColor=[0,0,0,.25],this.outerFill=!0,this.outerColor=[0,0,0,.5],this.borderWidth=10}function i(t,e){var r=t.gl,i=o(r,[0,0,0,1,1,0,1,1]),l=a(r,s.boxVertex,s.boxFragment),u=new n(t,i,l);return u.update(e),t.addOverlay(u),u}var a=t("gl-shader"),o=t("gl-buffer"),s=t("./lib/shaders");e.exports=i;var l=n.prototype;l.draw=function(){if(this.enabled){var t=this.plot,e=this.selectBox,r=this.borderWidth,n=(this.innerFill,this.innerColor),i=(this.outerFill,this.outerColor),a=this.borderColor,o=t.box,s=t.screenBox,l=t.dataBox,u=t.viewBox,c=t.pixelRatio,h=(e[0]-l[0])*(u[2]-u[0])/(l[2]-l[0])+u[0],f=(e[1]-l[1])*(u[3]-u[1])/(l[3]-l[1])+u[1],d=(e[2]-l[0])*(u[2]-u[0])/(l[2]-l[0])+u[0],p=(e[3]-l[1])*(u[3]-u[1])/(l[3]-l[1])+u[1];if(h=Math.max(h,u[0]),f=Math.max(f,u[1]),d=Math.min(d,u[2]),p=Math.min(p,u[3]),!(d<h||p<f)){o.bind();var m=s[2]-s[0],g=s[3]-s[1];if(this.outerFill&&(o.drawBox(0,0,m,f,i),o.drawBox(0,f,h,p,i),o.drawBox(0,p,m,g,i),o.drawBox(d,f,m,p,i)),this.innerFill&&o.drawBox(h,f,d,p,n),r>0){var v=r*c;o.drawBox(h-v,f-v,d+v,f+v,a),o.drawBox(h-v,p-v,d+v,p+v,a),o.drawBox(h-v,f-v,h+v,p+v,a),o.drawBox(d-v,f-v,d+v,p+v,a)}}}},l.update=function(t){t=t||{},this.innerFill=!!t.innerFill,this.outerFill=!!t.outerFill,this.innerColor=(t.innerColor||[0,0,0,.5]).slice(),this.outerColor=(t.outerColor||[0,0,0,.5]).slice(),this.borderColor=(t.borderColor||[0,0,0,1]).slice(),this.borderWidth=t.borderWidth||0,this.selectBox=(t.selectBox||this.selectBox).slice()},l.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":222,"gl-buffer":130,"gl-shader":225}],224:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.coord=[t,e],this.id=r,this.value=n,this.distance=i}function i(t,e,r){this.gl=t,this.fbo=e,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}function a(t,e){var r=o(t,e),n=s.mallocUint8(e[0]*e[1]*4);return new i(t,r,n)}e.exports=a;var o=t("gl-fbo"),s=t("typedarray-pool"),l=t("ndarray"),u=t("bit-twiddle").nextPow2,c=t("cwise/lib/wrapper")({args:["array",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},"scalar","scalar","index"],pre:{body:"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},body:{body:"{if(_inline_46_arg0_<255||_inline_46_arg1_<255||_inline_46_arg2_<255||_inline_46_arg3_<255){var _inline_46_l=_inline_46_arg4_-_inline_46_arg6_[0],_inline_46_a=_inline_46_arg5_-_inline_46_arg6_[1],_inline_46_f=_inline_46_l*_inline_46_l+_inline_46_a*_inline_46_a;_inline_46_f<this_closestD2&&(this_closestD2=_inline_46_f,this_closestX=_inline_46_arg6_[0],this_closestY=_inline_46_arg6_[1])}}",args:[{name:"_inline_46_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_46_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_46_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_46_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_46_arg4_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_46_arg5_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_46_arg6_",lvalue:!1,rvalue:!0,count:4}],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:["_inline_46_a","_inline_46_f","_inline_46_l"]},post:{body:"{return[this_closestX,this_closestY,this_closestD2]}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},debug:!1,funcName:"cwise",blockSize:64}),h=i.prototype;Object.defineProperty(h,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(t){if(this.gl){this.fbo.shape=t;var e=this.fbo.shape[0],r=this.fbo.shape[1];if(r*e*4>this.buffer.length){s.free(this.buffer);for(var n=this.buffer=s.mallocUint8(u(r*e*4)),i=0;i<r*e*4;++i)n[i]=255}return t}}}),h.begin=function(){var t=this.gl;this.shape;t&&(this.fbo.bind(),t.clearColor(1,1,1,1),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT))},h.end=function(){var t=this.gl;t&&(t.bindFramebuffer(t.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},h.query=function(t,e,r){if(!this.gl)return null;var i=this.fbo.shape.slice();t|=0,e|=0,"number"!=typeof r&&(r=1);var a=0|Math.min(Math.max(t-r,0),i[0]),o=0|Math.min(Math.max(t+r,0),i[0]),s=0|Math.min(Math.max(e-r,0),i[1]),u=0|Math.min(Math.max(e+r,0),i[1]);if(o<=a||u<=s)return null;var h=[o-a,u-s],f=l(this.buffer,[h[0],h[1],4],[4,4*i[0],1],4*(a+i[0]*s)),d=c(f.hi(h[0],h[1],1),r,r),p=d[0],m=d[1];if(p<0||Math.pow(this.radius,2)<d[2])return null;var g=f.get(p,m,0),v=f.get(p,m,1),y=f.get(p,m,2),x=f.get(p,m,3);return new n(p+a|0,m+s|0,g,[v,y,x],Math.sqrt(d[2]))},h.dispose=function(){this.gl&&(this.fbo.dispose(),s.free(this.buffer),this.gl=null,this._readTimeout&&clearTimeout(this._readTimeout))}},{"bit-twiddle":56,"cwise/lib/wrapper":96,"gl-fbo":137,ndarray:432,"typedarray-pool":502}],225:[function(t,e,r){"use strict";function n(t){this.gl=t,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}function i(t,e){return t.name<e.name?-1:1}function a(t,e,r,i,a){var o=new n(t);return o.update(e,r,i,a),o}var o=t("./lib/create-uniforms"),s=t("./lib/create-attributes"),l=t("./lib/reflect"),u=t("./lib/shader-cache"),c=t("./lib/runtime-reflect"),h=t("./lib/GLError"),f=n.prototype;f.bind=function(){this.program||this._relink(),this.gl.useProgram(this.program)},f.dispose=function(){this._fref&&this._fref.dispose(),this._vref&&this._vref.dispose(),this.attributes=this.types=this.vertShader=this.fragShader=this.program=this._relink=this._fref=this._vref=null},f.update=function(t,e,r,n){function a(){d.program=u.program(p,d._vref,d._fref,b,_);for(var t=0;t<r.length;++t)S[t]=p.getUniformLocation(d.program,r[t].name)}if(!e||1===arguments.length){var f=t;t=f.vertex,e=f.fragment,r=f.uniforms,n=f.attributes}var d=this,p=d.gl,m=d._vref;d._vref=u.shader(p,p.VERTEX_SHADER,t),m&&m.dispose(),d.vertShader=d._vref.shader;var g=this._fref;if(d._fref=u.shader(p,p.FRAGMENT_SHADER,e),g&&g.dispose(),d.fragShader=d._fref.shader,!r||!n){var v=p.createProgram();if(p.attachShader(v,d.fragShader),p.attachShader(v,d.vertShader),p.linkProgram(v),!p.getProgramParameter(v,p.LINK_STATUS)){var y=p.getProgramInfoLog(v);throw new h(y,"Error linking program:"+y)}r=r||c.uniforms(p,v),n=n||c.attributes(p,v),p.deleteProgram(v)}n=n.slice(),n.sort(i);for(var x=[],b=[],_=[],w=0;w<n.length;++w){var M=n[w];if(M.type.indexOf("mat")>=0){for(var A=0|M.type.charAt(M.type.length-1),k=new Array(A),T=0;T<A;++T)k[T]=_.length,b.push(M.name+"["+T+"]"),"number"==typeof M.location?_.push(M.location+T):Array.isArray(M.location)&&M.location.length===A&&"number"==typeof M.location[T]?_.push(0|M.location[T]):_.push(-1);x.push({name:M.name,type:M.type,locations:k})}else x.push({name:M.name,type:M.type,locations:[_.length]}),b.push(M.name),"number"==typeof M.location?_.push(0|M.location):_.push(-1)}for(var E=0,w=0;w<_.length;++w)if(_[w]<0){for(;_.indexOf(E)>=0;)E+=1;_[w]=E}var S=new Array(r.length);a(),d._relink=a,d.types={uniforms:l(r),attributes:l(n)},d.attributes=s(p,d,x,_),Object.defineProperty(d,"uniforms",o(p,d,r,S))},e.exports=a},{"./lib/GLError":226,"./lib/create-attributes":227,"./lib/create-uniforms":228,"./lib/reflect":229,"./lib/runtime-reflect":230,"./lib/shader-cache":231}],226:[function(t,e,r){arguments[4][186][0].apply(r,arguments)},{dup:186}],227:[function(t,e,r){arguments[4][187][0].apply(r,arguments)},{"./GLError":226,dup:187}],228:[function(t,e,r){arguments[4][188][0].apply(r,arguments)},{"./GLError":226,"./reflect":229,dup:188}],229:[function(t,e,r){arguments[4][189][0].apply(r,arguments)},{dup:189}],230:[function(t,e,r){arguments[4][190][0].apply(r,arguments)},{dup:190}],231:[function(t,e,r){arguments[4][191][0].apply(r,arguments)},{"./GLError":226,dup:191,"gl-format-compiler-error":138,"weakmap-shim":523}],232:[function(t,e,r){"use strict";function n(t){this.plot=t,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}function i(t,e){var r=new n(t);return r.update(e),t.addOverlay(r),r}e.exports=i;var a=n.prototype;a.update=function(t){t=t||{},this.enable=(t.enable||[!0,!0,!1,!1]).slice(),this.width=(t.width||[1,1,1,1]).slice(),this.color=(t.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map(function(t){return t.slice()}),this.center=(t.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},a.draw=function(){var t=this.enable,e=this.width,r=this.color,n=this.center,i=this.plot,a=i.line,o=i.dataBox,s=i.viewBox;if(a.bind(),o[0]<=n[0]&&n[0]<=o[2]&&o[1]<=n[1]&&n[1]<=o[3]){var l=s[0]+(n[0]-o[0])/(o[2]-o[0])*(s[2]-s[0]),u=s[1]+(n[1]-o[1])/(o[3]-o[1])*(s[3]-s[1]);t[0]&&a.drawLine(l,u,s[0],u,e[0],r[0]),t[1]&&a.drawLine(l,u,l,s[1],e[1],r[1]),t[2]&&a.drawLine(l,u,s[2],u,e[2],r[2]),t[3]&&a.drawLine(l,u,l,s[3],e[3],r[3])}},a.dispose=function(){this.plot.removeOverlay(this)}},{}],233:[function(t,e,r){"use strict";var n=t("gl-shader"),i="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, color;\nattribute float weight;\n\nuniform mat4 model, view, projection;\nuniform vec3 coordinates[3];\nuniform vec4 colors[3];\nuniform vec2 screenShape;\nuniform float lineWidth;\n\nvarying vec4 fragColor;\n\nvoid main() {\n  vec3 vertexPosition = mix(coordinates[0],\n    mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\n\n  vec4 clipPos = projection * view * model * vec4(vertexPosition, 1.0);\n  vec2 clipOffset = (projection * view * model * vec4(color, 0.0)).xy;\n  vec2 delta = weight * clipOffset * screenShape;\n  vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\n\n  gl_Position   = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\n  fragColor     = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\n}\n",a="precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n  gl_FragColor = fragColor;\n}";e.exports=function(t){return n(t,i,a,null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},{"gl-shader":225}],234:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}function i(t,e){function r(t,e,r,n,a,o){var s=[t,e,r,0,0,0,1];s[n+3]=1,s[n]=a,i.push.apply(i,s),s[6]=-1,i.push.apply(i,s),s[n]=o,i.push.apply(i,s),i.push.apply(i,s),s[6]=1,i.push.apply(i,s),s[n]=a,i.push.apply(i,s)}var i=[];r(0,0,0,0,0,1),r(0,0,0,1,0,1),r(0,0,0,2,0,1),r(1,0,0,1,-1,1),r(1,0,0,2,-1,1),r(0,1,0,0,-1,1),r(0,1,0,2,-1,1),r(0,0,1,0,-1,1),r(0,0,1,1,-1,1);var l=a(t,i),u=o(t,[{type:t.FLOAT,buffer:l,size:3,offset:0,stride:28},{type:t.FLOAT,buffer:l,size:3,offset:12,stride:28},{type:t.FLOAT,buffer:l,size:1,offset:24,stride:28}]),c=s(t);c.attributes.position.location=0,c.attributes.color.location=1,c.attributes.weight.location=2;var h=new n(t,l,u,c);return h.update(e),h}var a=t("gl-buffer"),o=t("gl-vao"),s=t("./shaders/index");e.exports=i;var l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],u=n.prototype,c=[0,0,0],h=[0,0,0],f=[0,0];u.isTransparent=function(){return!1},u.drawTransparent=function(t){},u.draw=function(t){var e=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var i,a=t.model||l,o=t.view||l,s=t.projection||l;this.axes&&(i=this.axes.lastCubeProps.axis);for(var u=c,d=h,p=0;p<3;++p)i&&i[p]<0?(u[p]=this.bounds[0][p],d[p]=this.bounds[1][p]):(u[p]=this.bounds[1][p],d[p]=this.bounds[0][p]);f[0]=e.drawingBufferWidth,f[1]=e.drawingBufferHeight,n.uniforms.model=a,n.uniforms.view=o,n.uniforms.projection=s,n.uniforms.coordinates=[this.position,u,d],n.uniforms.colors=this.colors,n.uniforms.screenShape=f;for(var p=0;p<3;++p)n.uniforms.lineWidth=this.lineWidth[p]*this.pixelRatio,this.enabled[p]&&(r.draw(e.TRIANGLES,6,6*p),this.drawSides[p]&&r.draw(e.TRIANGLES,12,18+12*p));r.unbind()},u.update=function(t){t&&("bounds"in t&&(this.bounds=t.bounds),"position"in t&&(this.position=t.position),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"colors"in t&&(this.colors=t.colors),"enabled"in t&&(this.enabled=t.enabled),"drawSides"in t&&(this.drawSides=t.drawSides))},u.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders/index":233,"gl-buffer":130,"gl-vao":241}],235:[function(t,e,r){var n=t("gl-shader"),i="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n  worldCoordinate = vec3(uv.zw, f.x);\n  vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n  vec4 clipPosition = projection * view * worldPosition;\n  gl_Position = clipPosition;\n  kill = f.y;\n  value = f.z;\n  planeCoordinate = uv.xy;\n\n  vColor = texture2D(colormap, vec2(value, value));\n\n  //Lighting geometry parameters\n  vec4 cameraCoordinate = view * worldPosition;\n  cameraCoordinate.xyz /= cameraCoordinate.w;\n  lightDirection = lightPosition - cameraCoordinate.xyz;\n  eyeDirection   = eyePosition - cameraCoordinate.xyz;\n  surfaceNormal  = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n",a="precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution_2_0(float x, float roughness) {\n  float NdotH = max(x, 0.0001);\n  float cos2Alpha = NdotH * NdotH;\n  float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n  float roughness2 = roughness * roughness;\n  float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n  return exp(tan2Alpha / roughness2) / denom;\n}\n\n\n\nfloat beckmannSpecular_1_1(\n  vec3 lightDirection,\n  vec3 viewDirection,\n  vec3 surfaceNormal,\n  float roughness) {\n  return beckmannDistribution_2_0(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\n\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n  if (kill > 0.0 ||\n    any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n    discard;\n  }\n\n  vec3 N = normalize(surfaceNormal);\n  vec3 V = normalize(eyeDirection);\n  vec3 L = normalize(lightDirection);\n\n  if(gl_FrontFacing) {\n    N = -N;\n  }\n\n  float specular = beckmannSpecular_1_1(L, V, N, roughness);\n  float diffuse  = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n  //decide how to interpolate color — in vertex or in fragment\n  vec4 surfaceColor = step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + step(.5, vertexColor) * vColor;\n\n  vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular,  1.0);\n\n  gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n",o="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n  vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n  vec4 worldPosition = model * vec4(dataCoordinate, 1.0);\n\n  vec4 clipPosition = projection * view * worldPosition;\n  clipPosition.z = clipPosition.z + zOffset;\n\n  gl_Position = clipPosition;\n  value = f;\n  kill = -1.0;\n  worldCoordinate = dataCoordinate;\n  planeCoordinate = uv.zw;\n\n  vColor = texture2D(colormap, vec2(value, value));\n\n  //Don't do lighting for contours\n  surfaceNormal   = vec3(1,0,0);\n  eyeDirection    = vec3(0,1,0);\n  lightDirection  = vec3(0,0,1);\n}\n",s="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n  float vh = 255.0 * v;\n  float upper = floor(vh);\n  float lower = fract(vh);\n  return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n  if(kill > 0.0 ||\n    any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n    discard;\n  }\n  vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n  vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n  gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n";r.createShader=function(t){var e=n(t,i,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createPickShader=function(t){var e=n(t,i,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createContourShader=function(t){var e=n(t,o,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,o,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":225}],236:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}function i(t){var e=b([y({colormap:t,nshades:R,format:"rgba"}).map(function(t){return[t[0],t[1],t[2],255*t[3]]})]);return x.divseq(e,255),e}function a(t,e,r,i,a,o,s,l,u,c,h,f,d,p){this.gl=t,this.shape=e,this.bounds=r,this.intensityBounds=[],this._shader=i,this._pickShader=a,this._coordinateBuffer=o,this._vao=s,this._colorMap=l,this._contourShader=u,this._contourPickShader=c,this._contourBuffer=h,this._contourVAO=f,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new n([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=p,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[_(v.mallocFloat(1024),[0,0]),_(v.mallocFloat(1024),[0,0]),_(v.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.snapToData=!1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}function o(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||j,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=N.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(a[r]>0)][r],M(l,t.model,l);var u=N.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)u[i][n]=t.clipBounds[i][n];u[0][r]=-1e8,u[1][r]=1e8}return N.showSurface=o,N.showContour=s,N}function s(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=B;n.model=t.model||D,n.view=t.view||D,n.projection=t.projection||D,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.contourColor=this.contourColor[0],n.inverseModel=A(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],s=0;s<3;++s)a[s]=Math.min(Math.max(this.clipBounds[i][s],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=V,n.vertexColor=this.vertexColor;var l=U;for(M(l,n.view,n.model),M(l,n.projection,l),A(l,l),i=0;i<3;++i)n.eyePosition[i]=l[12+i]/l[15];var u=l[15];for(i=0;i<3;++i)u+=this.lightPosition[i]*l[4*i+3];for(i=0;i<3;++i){var c=l[12+i];for(s=0;s<3;++s)c+=l[4*s+i]*this.lightPosition[s];n.lightPosition[i]=c/u}var h=o(n,this);if(h.showSurface&&e===this.opacity<1){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=h.projections[i],this._shader.uniforms.clipBounds=h.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(h.showContour&&!e){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var d=this._contourVAO;for(d.bind(),i=0;i<3;++i)for(f.uniforms.permutation=O[i],r.lineWidth(this.contourWidth[i]),s=0;s<this.contourLevels[i].length;++s)this._contourCounts[i][s]&&(s===this.highlightLevel[i]?(f.uniforms.contourColor=this.highlightColor[i],f.uniforms.contourTint=this.highlightTint[i]):0!==s&&s-1!==this.highlightLevel[i]||(f.uniforms.contourColor=this.contourColor[i],f.uniforms.contourTint=this.contourTint[i]),f.uniforms.height=this.contourLevels[i][s],d.draw(r.LINES,this._contourCounts[i][s],this._contourOffsets[i][s]));for(i=0;i<3;++i)for(f.uniforms.model=h.projections[i],f.uniforms.clipBounds=h.clipBounds[i],s=0;s<3;++s)if(this.contourProject[i][s]){f.uniforms.permutation=O[s],r.lineWidth(this.contourWidth[s]);for(var p=0;p<this.contourLevels[s].length;++p)p===this.highlightLevel[s]?(f.uniforms.contourColor=this.highlightColor[s],f.uniforms.contourTint=this.highlightTint[s]):0!==p&&p-1!==this.highlightLevel[s]||(f.uniforms.contourColor=this.contourColor[s],f.uniforms.contourTint=this.contourTint[s]),f.uniforms.height=this.contourLevels[s][p],d.draw(r.LINES,this._contourCounts[s][p],this._contourOffsets[s][p])}for(d=this._dynamicVAO,d.bind(),i=0;i<3;++i)if(0!==this._dynamicCounts[i])for(f.uniforms.model=n.model,f.uniforms.clipBounds=n.clipBounds,f.uniforms.permutation=O[i],r.lineWidth(this.dynamicWidth[i]),f.uniforms.contourColor=this.dynamicColor[i],f.uniforms.contourTint=this.dynamicTint[i],f.uniforms.height=this.dynamicLevel[i],d.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]),s=0;s<3;++s)this.contourProject[s][i]&&(f.uniforms.model=h.projections[s],f.uniforms.clipBounds=h.clipBounds[s],d.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]));d.unbind()}}function l(t,e){var r=e.shape.slice(),n=t.shape.slice();x.assign(t.lo(1,1).hi(r[0],r[1]),e),x.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),x.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),x.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),x.assign(t.lo(n[0]-1,1).hi(1,r[1]),e.lo(r[0]-1)),t.set(0,0,e.get(0,0)),t.set(0,n[1]-1,e.get(0,r[1]-1)),t.set(n[0]-1,0,e.get(r[0]-1,0)),t.set(n[0]-1,n[1]-1,e.get(r[0]-1,r[1]-1))}function u(t,e){return Array.isArray(t)?[e(t[0]),e(t[1]),e(t[2])]:[e(t),e(t),e(t)]}function c(t){return Array.isArray(t)?3===t.length?[t[0],t[1],t[2],1]:[t[0],t[1],t[2],t[3]]:[0,0,0,1]}function h(t){if(Array.isArray(t)){if(Array.isArray(t))return[c(t[0]),c(t[1]),c(t[2])];var e=c(t);return[e.slice(),e.slice(),e.slice()]}}function f(t){var e=t.gl,r=S(e),n=C(e),i=L(e),o=I(e),s=p(e),l=m(e,[{buffer:s,size:4,stride:z,offset:0},{buffer:s,size:3,stride:z,offset:16},{buffer:s,size:3,stride:z,offset:28}]),u=p(e),c=m(e,[{buffer:u,size:4,stride:20,offset:0},{buffer:u,size:1,stride:20,offset:16}]),h=p(e),f=m(e,[{buffer:h,size:2,type:e.FLOAT}]),d=g(e,1,R,e.RGBA,e.UNSIGNED_BYTE);d.minFilter=e.LINEAR,d.magFilter=e.LINEAR;var v=new a(e,[0,0],[[0,0,0],[0,0,0]],r,n,s,l,d,i,o,u,c,h,f),y={levels:[[],[],[]]};for(var x in t)y[x]=t[x];return y.colormap=y.colormap||"jet",v.update(y),v}e.exports=f;var d=t("bit-twiddle"),p=t("gl-buffer"),m=t("gl-vao"),g=t("gl-texture2d"),v=t("typedarray-pool"),y=t("colormap"),x=t("ndarray-ops"),b=t("ndarray-pack"),_=t("ndarray"),w=t("surface-nets"),M=t("gl-mat4/multiply"),A=t("gl-mat4/invert"),k=t("binary-search-bounds"),T=t("ndarray-gradient"),E=t("./lib/shaders"),S=E.createShader,L=E.createContourShader,C=E.createPickShader,I=E.createPickContourShader,z=40,D=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],P=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],O=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];!function(){for(var t=0;t<3;++t){var e=O[t],r=(t+1)%3,n=(t+2)%3;e[r+0]=1,e[n+3]=1,e[t+6]=1}}();var R=256,F=a.prototype;F.isTransparent=function(){return this.opacity<1},F.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},F.pickSlots=1,F.setPickBase=function(t){this.pickId=t};var j=[0,0,0],N={showSurface:!1,showContour:!1,projections:[D.slice(),D.slice(),D.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]},B={model:D,view:D,projection:D,inverseModel:D.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},U=D.slice(),V=[1,0,0,0,1,0,0,0,1];F.draw=function(t){return s.call(this,t,!1)},F.drawTransparent=function(t){return s.call(this,t,!0)};var q={model:D,view:D,projection:D,inverseModel:D,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};F.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=q;r.model=t.model||D,r.view=t.view||D,r.projection=t.projection||D,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.permutation=V;for(var n=0;n<2;++n)for(var i=r.clipBounds[n],a=0;a<3;++a)i[a]=Math.min(Math.max(this.clipBounds[n][a],-1e8),1e8);var s=o(r,this);if(s.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(e.TRIANGLES,this._vertexCount),n=0;n<3;++n)this.surfaceProject[n]&&(this._pickShader.uniforms.model=s.projections[n],this._pickShader.uniforms.clipBounds=s.clipBounds[n],this._vao.draw(e.TRIANGLES,this._vertexCount));this._vao.unbind()}if(s.showContour){var l=this._contourPickShader;l.bind(),l.uniforms=r;var u=this._contourVAO;for(u.bind(),a=0;a<3;++a)for(e.lineWidth(this.contourWidth[a]),l.uniforms.permutation=O[a],n=0;n<this.contourLevels[a].length;++n)this._contourCounts[a][n]&&(l.uniforms.height=this.contourLevels[a][n],u.draw(e.LINES,this._contourCounts[a][n],this._contourOffsets[a][n]));for(n=0;n<3;++n)for(l.uniforms.model=s.projections[n],l.uniforms.clipBounds=s.clipBounds[n],a=0;a<3;++a)if(this.contourProject[n][a]){l.uniforms.permutation=O[a],e.lineWidth(this.contourWidth[a]);for(var c=0;c<this.contourLevels[a].length;++c)this._contourCounts[a][c]&&(l.uniforms.height=this.contourLevels[a][c],u.draw(e.LINES,this._contourCounts[a][c],this._contourOffsets[a][c]))}u.unbind()}},F.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=this._field[2].shape,r=this._pickResult,n=e[0]*(t.value[0]+(t.value[2]>>4)/16)/255,i=Math.floor(n),a=n-i,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var u=r.position;u[0]=u[1]=u[2]=0;for(var c=0;c<2;++c)for(var h=c?a:1-a,f=0;f<2;++f)for(var d=f?l:1-l,p=i+c,m=s+f,g=h*d,v=0;v<3;++v)u[v]+=this._field[v].get(p,m)*g;for(var y=this._pickResult.level,x=0;x<3;++x)if(y[x]=k.le(this.contourLevels[x],u[x]),y[x]<0)this.contourLevels[x].length>0&&(y[x]=0);else if(y[x]<this.contourLevels[x].length-1){var b=this.contourLevels[x][y[x]],_=this.contourLevels[x][y[x]+1];Math.abs(b-u[x])>Math.abs(_-u[x])&&(y[x]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],v=0;v<3;++v)r.dataCoordinate[v]=this._field[v].get(r.index[0],r.index[1]);return r},F.update=function(t){t=t||{},this.dirty=!0,"contourWidth"in t&&(this.contourWidth=u(t.contourWidth,Number)),"showContour"in t&&(this.showContour=u(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=u(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=h(t.contourColor)),"contourProject"in t&&(this.contourProject=u(t.contourProject,function(t){return u(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=h(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=u(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=u(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0);var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var n=(e.shape[0]+2)*(e.shape[1]+2);n>this._field[2].data.length&&(v.freeFloat(this._field[2].data),this._field[2].data=v.mallocFloat(d.nextPow2(n))),this._field[2]=_(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),l(this._field[2],e),this.shape=e.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(v.freeFloat(this._field[o].data),this._field[o].data=v.mallocFloat(this._field[2].size)),this._field[o]=_(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var s=t.coords;if(!Array.isArray(s)||3!==s.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var c=s[o];for(y=0;y<2;++y)if(c.shape[y]!==a[y])throw new Error("gl-surface: coords have incorrect shape");l(this._field[o],c)}}else if(t.ticks){var f=t.ticks;if(!Array.isArray(f)||2!==f.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var p=f[o];if((Array.isArray(p)||p.length)&&(p=_(p)),p.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var m=_(p.data,a);m.stride[o]=p.stride[0],m.stride[1^o]=0,l(this._field[o],m)}}else{for(o=0;o<2;++o){var g=[0,0];g[o]=1,this._field[o]=_(this._field[o].data,[a[0]+2,a[1]+2],g,0)}this._field[0].set(0,0,0);for(var y=0;y<a[0];++y)this._field[0].set(y+1,0,y);for(this._field[0].set(a[0]+1,0,a[0]-1),this._field[1].set(0,0,0),y=0;y<a[1];++y)this._field[1].set(0,y+1,y);this._field[1].set(0,a[1]+1,a[1]-1)}var x=this._field,b=_(v.mallocFloat(3*x[2].size*2),[3,a[0]+2,a[1]+2,2]);for(o=0;o<3;++o)T(b.pick(o),x[o],"mirror");var M=_(v.mallocFloat(3*x[2].size),[a[0]+2,a[1]+2,3]);for(o=0;o<a[0]+2;++o)for(y=0;y<a[1]+2;++y){var A=b.get(0,o,y,0),k=b.get(0,o,y,1),E=b.get(1,o,y,0),S=b.get(1,o,y,1),L=b.get(2,o,y,0),C=b.get(2,o,y,1),I=E*C-S*L,z=L*k-C*A,D=A*S-k*E,O=Math.sqrt(I*I+z*z+D*D);O<1e-8?(O=Math.max(Math.abs(I),Math.abs(z),Math.abs(D)),O<1e-8?(D=1,z=I=0,O=1):O=1/O):O=1/Math.sqrt(O),M.set(o,y,0,I*O),M.set(o,y,1,z*O),M.set(o,y,2,D*O)}v.free(b.data);var R=[1/0,1/0,1/0],F=[-(1/0),-(1/0),-(1/0)],j=1/0,N=-(1/0),B=(a[0]-1)*(a[1]-1)*6,U=v.mallocFloat(d.nextPow2(10*B)),V=0,q=0;for(o=0;o<a[0]-1;++o)t:for(y=0;y<a[1]-1;++y){for(var H=0;H<2;++H)for(var Y=0;Y<2;++Y)for(var G=0;G<3;++G){var X=this._field[G].get(1+o+H,1+y+Y);if(isNaN(X)||!isFinite(X))continue t}for(G=0;G<6;++G){var W=o+P[G][0],Z=y+P[G][1],J=this._field[0].get(W+1,Z+1),K=this._field[1].get(W+1,Z+1);X=this._field[2].get(W+1,Z+1);var Q=X;I=M.get(W+1,Z+1,0),z=M.get(W+1,Z+1,1),D=M.get(W+1,Z+1,2),t.intensity&&(Q=t.intensity.get(W,Z)),U[V++]=W,U[V++]=Z,U[V++]=J,U[V++]=K,U[V++]=X,U[V++]=0,U[V++]=Q,U[V++]=I,U[V++]=z,U[V++]=D,R[0]=Math.min(R[0],J),R[1]=Math.min(R[1],K),R[2]=Math.min(R[2],X),j=Math.min(j,Q),F[0]=Math.max(F[0],J),F[1]=Math.max(F[1],K),F[2]=Math.max(F[2],X),N=Math.max(N,Q),q+=1}}for(t.intensityBounds&&(j=+t.intensityBounds[0],N=+t.intensityBounds[1]),o=6;o<V;o+=10)U[o]=(U[o]-j)/(N-j);this._vertexCount=q,this._coordinateBuffer.update(U.subarray(0,V)),v.freeFloat(U),v.free(M.data),this.bounds=[R,F],this.intensity=t.intensity||this._field[2],this.intensityBounds[0]===j&&this.intensityBounds[1]===N||(r=!0),this.intensityBounds=[j,N]}if("levels"in t){var $=t.levels;for($=Array.isArray($[0])?$.slice():[[],[],$],o=0;o<3;++o)$[o]=$[o].slice(),$.sort(function(t,e){return t-e});t:for(o=0;o<3;++o){if($[o].length!==this.contourLevels[o].length){r=!0;break}for(y=0;y<$[o].length;++y)if($[o][y]!==this.contourLevels[o][y]){r=!0;break t}}this.contourLevels=$}if(r){x=this._field,a=this.shape;for(var tt=[],et=0;et<3;++et){$=this.contourLevels[et];var rt=[],nt=[],it=[0,0,0];for(o=0;o<$.length;++o){var at=w(this._field[et],$[o]);rt.push(tt.length/5|0),q=0;t:for(y=0;y<at.cells.length;++y){var ot=at.cells[y];for(G=0;G<2;++G){var st=at.positions[ot[G]],lt=st[0],ut=0|Math.floor(lt),ct=lt-ut,ht=st[1],ft=0|Math.floor(ht),dt=ht-ft,pt=!1;e:for(var mt=0;mt<3;++mt){it[mt]=0;var gt=(et+mt+1)%3;for(H=0;H<2;++H){var vt=H?ct:1-ct;for(W=0|Math.min(Math.max(ut+H,0),a[0]),Y=0;Y<2;++Y){var yt=Y?dt:1-dt;if(Z=0|Math.min(Math.max(ft+Y,0),a[1]),X=mt<2?this._field[gt].get(W,Z):(this.intensity.get(W,Z)-this.intensityBounds[0])/(this.intensityBounds[1]-this.intensityBounds[0]),!isFinite(X)||isNaN(X)){pt=!0;break e}var xt=vt*yt;it[mt]+=xt*X}}}if(pt){if(G>0){for(var bt=0;bt<5;++bt)tt.pop();q-=1}continue t}tt.push(it[0],it[1],st[0],st[1],it[2]),q+=1}}nt.push(q)}this._contourOffsets[et]=rt,this._contourCounts[et]=nt}var _t=v.mallocFloat(tt.length);for(o=0;o<tt.length;++o)_t[o]=tt[o];this._contourBuffer.update(_t),v.freeFloat(_t)}t.colormap&&this._colorMap.setPixels(i(t.colormap))},F.dispose=function(){this._shader.dispose(),this._vao.dispose(),this._coordinateBuffer.dispose(),this._colorMap.dispose(),this._contourBuffer.dispose(),this._contourVAO.dispose(),this._contourShader.dispose(),this._contourPickShader.dispose(),this._dynamicBuffer.dispose(),this._dynamicVAO.dispose();for(var t=0;t<3;++t)v.freeFloat(this._field[t].data)},F.highlight=function(t){if(!t)return this._dynamicCounts=[0,0,0],this.dyanamicLevel=[NaN,NaN,NaN],void(this.highlightLevel=[-1,-1,-1]);for(var e=0;e<3;++e)this.enableHighlight[e]?this.highlightLevel[e]=t.level[e]:this.highlightLevel[e]=-1;var r;if(r=this.snapToData?t.dataCoordinate:t.position,this.enableDynamic[0]&&r[0]!==this.dynamicLevel[0]||this.enableDynamic[1]&&r[1]!==this.dynamicLevel[1]||this.enableDynamic[2]&&r[2]!==this.dynamicLevel[2]){for(var n=0,i=this.shape,a=v.mallocFloat(12*i[0]*i[1]),o=0;o<3;++o)if(this.enableDynamic[o]){this.dynamicLevel[o]=r[o];var s=(o+1)%3,l=(o+2)%3,u=this._field[o],c=this._field[s],h=this._field[l],f=(this.intensity,w(u,r[o])),d=f.cells,p=f.positions;for(this._dynamicOffsets[o]=n,e=0;e<d.length;++e)for(var m=d[e],g=0;g<2;++g){var y=p[m[g]],x=+y[0],b=0|x,_=0|Math.min(b+1,i[0]),M=x-b,A=1-M,k=+y[1],T=0|k,E=0|Math.min(T+1,i[1]),S=k-T,L=1-S,C=A*L,I=A*S,z=M*L,D=M*S,P=C*c.get(b,T)+I*c.get(b,E)+z*c.get(_,T)+D*c.get(_,E),O=C*h.get(b,T)+I*h.get(b,E)+z*h.get(_,T)+D*h.get(_,E);if(isNaN(P)||isNaN(O)){g&&(n-=1);break}a[2*n+0]=P,a[2*n+1]=O,n+=1}this._dynamicCounts[o]=n-this._dynamicOffsets[o]}else this.dynamicLevel[o]=NaN,this._dynamicCounts[o]=0;this._dynamicBuffer.update(a.subarray(0,2*n)),v.freeFloat(a)}}},{"./lib/shaders":235,"binary-search-bounds":55,"bit-twiddle":56,colormap:82,"gl-buffer":130,"gl-mat4/invert":154,"gl-mat4/multiply":156,"gl-texture2d":237,"gl-vao":241,ndarray:432,"ndarray-gradient":423,"ndarray-ops":426,"ndarray-pack":427,"surface-nets":493,"typedarray-pool":502}],237:[function(t,e,r){"use strict";function n(t){v=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],y=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],x=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}function i(t){return"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement||"undefined"!=typeof ImageData&&t instanceof ImageData}function a(t,e,r){var n=t.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function o(t,e,r,n,i,a){this.gl=t,this.handle=e,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}function s(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function l(t,e,r,n,i,a,o,l){var u=l.dtype,c=l.shape.slice();if(c.length<2||c.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var h=0,f=0,d=s(c,l.stride.slice());"float32"===u?h=t.FLOAT:"float64"===u?(h=t.FLOAT,d=!1,u="float32"):"uint8"===u?h=t.UNSIGNED_BYTE:(h=t.UNSIGNED_BYTE,d=!1,u="uint8");var v=1;if(2===c.length)f=t.LUMINANCE,c=[c[0],c[1],1],l=p(l.data,c,[l.stride[0],l.stride[1],1],l.offset);else{if(3!==c.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===c[2])f=t.ALPHA;else if(2===c[2])f=t.LUMINANCE_ALPHA;else if(3===c[2])f=t.RGB;else{if(4!==c[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");f=t.RGBA}v=c[2]}if(f!==t.LUMINANCE&&f!==t.ALPHA||i!==t.LUMINANCE&&i!==t.ALPHA||(f=i),f!==i)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=l.size,x=o.indexOf(n)<0;if(x&&o.push(n),h===a&&d)0===l.offset&&l.data.length===y?x?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,l.data):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,l.data):x?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,l.data.subarray(l.offset,l.offset+y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,l.data.subarray(l.offset,l.offset+y));else{var _;_=a===t.FLOAT?g.mallocFloat32(y):g.mallocUint8(y);var w=p(_,c,[c[2],c[2]*c[0],1]);h===t.FLOAT&&a===t.UNSIGNED_BYTE?b(w,l):m.assign(w,l),x?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,_.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,_.subarray(0,y)),a===t.FLOAT?g.freeFloat32(_):g.freeUint8(_)}}function u(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function c(t,e,r,n,i){var a=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var s=u(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new o(t,s,e,r,n,i)}function h(t,e,r,n){var i=u(t);return t.texImage2D(t.TEXTURE_2D,0,r,r,n,e),new o(t,i,0|e.width,0|e.height,r,n)}function f(t,e){var r=e.dtype,n=e.shape.slice(),i=t.getParameter(t.MAX_TEXTURE_SIZE);if(n[0]<0||n[0]>i||n[1]<0||n[1]>i)throw new Error("gl-texture2d: Invalid texture size");var a=s(n,e.stride.slice()),l=0;"float32"===r?l=t.FLOAT:"float64"===r?(l=t.FLOAT,a=!1,r="float32"):"uint8"===r?l=t.UNSIGNED_BYTE:(l=t.UNSIGNED_BYTE,a=!1,r="uint8");var c=0;if(2===n.length)c=t.LUMINANCE,n=[n[0],n[1],1],e=p(e.data,n,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==n.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===n[2])c=t.ALPHA;else if(2===n[2])c=t.LUMINANCE_ALPHA;else if(3===n[2])c=t.RGB;else{if(4!==n[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");c=t.RGBA}}l!==t.FLOAT||t.getExtension("OES_texture_float")||(l=t.UNSIGNED_BYTE,a=!1);var h,f,d=e.size;if(a)h=0===e.offset&&e.data.length===d?e.data:e.data.subarray(e.offset,e.offset+d);else{var v=[n[2],n[2]*n[0],1];f=g.malloc(d,r);var y=p(f,n,v,0);"float32"!==r&&"float64"!==r||l!==t.UNSIGNED_BYTE?m.assign(y,e):b(y,e),h=f.subarray(0,d)}var x=u(t);return t.texImage2D(t.TEXTURE_2D,0,c,n[0],n[1],0,c,l,h),a||g.free(f),new o(t,x,n[0],n[1],c,l)}function d(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(v||n(t),"number"==typeof arguments[1])return c(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return c(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1];if(i(e))return h(t,e,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return f(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}var p=t("ndarray"),m=t("ndarray-ops"),g=t("typedarray-pool");e.exports=d;var v=null,y=null,x=null,b=function(t,e){m.muls(t,e,255)},_=o.prototype;Object.defineProperties(_,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&v.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),y.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&v.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),y.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),x.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),x.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(x.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return a(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return t|=0,a(this,t,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,a(this,this._shape[0],t),t}}}),_.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},_.dispose=function(){this.gl.deleteTexture(this.handle)},_.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},_.setPixels=function(t,e,r,n){var a=this.gl;if(this.bind(),Array.isArray(e)?(n=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),n=n||0,i(t)){var o=this._mipLevels.indexOf(n)<0;o?(a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,this.type,t),this._mipLevels.push(n)):a.texSubImage2D(a.TEXTURE_2D,n,e,r,this.format,this.type,t)}else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>n||r+t.shape[0]>this._shape[0]>>>n||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");l(a,e,r,n,this.format,this.type,this._mipLevels,t)}}},{ndarray:432,"ndarray-ops":426,"typedarray-pool":502}],238:[function(t,e,r){"use strict";function n(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i<r.length;++i){var a=r[i];if(a.buffer){var o=a.buffer,s=a.size||4,l=a.type||t.FLOAT,u=!!a.normalized,c=a.stride||0,h=a.offset||0;o.bind(),t.enableVertexAttribArray(i),t.vertexAttribPointer(i,s,l,u,c,h)}else{if("number"==typeof a)t.vertexAttrib1f(i,a);else if(1===a.length)t.vertexAttrib1f(i,a[0]);else if(2===a.length)t.vertexAttrib2f(i,a[0],a[1]);else if(3===a.length)t.vertexAttrib3f(i,a[0],a[1],a[2]);else{if(4!==a.length)throw new Error("gl-vao: Invalid vertex attribute");t.vertexAttrib4f(i,a[0],a[1],a[2],a[3])}t.disableVertexAttribArray(i)}}for(;i<n;++i)t.disableVertexAttribArray(i)}else{t.bindBuffer(t.ARRAY_BUFFER,null);for(var i=0;i<n;++i)t.disableVertexAttribArray(i)}}e.exports=n},{}],239:[function(t,e,r){"use strict";function n(t){this.gl=t,this._elements=null,this._attributes=null,this._elementsType=t.UNSIGNED_SHORT}function i(t){return new n(t)}var a=t("./do-bind.js");n.prototype.bind=function(){a(this.gl,this._elements,this._attributes)},n.prototype.update=function(t,e,r){this._elements=e,this._attributes=t,this._elementsType=r||this.gl.UNSIGNED_SHORT},n.prototype.dispose=function(){},n.prototype.unbind=function(){},n.prototype.draw=function(t,e,r){r=r||0;var n=this.gl;this._elements?n.drawElements(t,e,this._elementsType,r):n.drawArrays(t,r,e)},e.exports=i},{"./do-bind.js":238}],240:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this.location=t,this.dimension=e,this.a=r,this.b=n,this.c=i,this.d=a}function i(t,e,r){this.gl=t,this._ext=e,this.handle=r,this._attribs=[],this._useElements=!1,this._elementsType=t.UNSIGNED_SHORT}function a(t,e){return new i(t,e,e.createVertexArrayOES())}var o=t("./do-bind.js");n.prototype.bind=function(t){switch(this.dimension){case 1:t.vertexAttrib1f(this.location,this.a);break;case 2:t.vertexAttrib2f(this.location,this.a,this.b);break;case 3:t.vertexAttrib3f(this.location,this.a,this.b,this.c);break;case 4:t.vertexAttrib4f(this.location,this.a,this.b,this.c,this.d)}},i.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var t=0;t<this._attribs.length;++t)this._attribs[t].bind(this.gl)},i.prototype.unbind=function(){this._ext.bindVertexArrayOES(null)},i.prototype.dispose=function(){this._ext.deleteVertexArrayOES(this.handle)},i.prototype.update=function(t,e,r){if(this.bind(),o(this.gl,e,t),this.unbind(),this._attribs.length=0,t)for(var i=0;i<t.length;++i){var a=t[i];"number"==typeof a?this._attribs.push(new n(i,1,a)):Array.isArray(a)&&this._attribs.push(new n(i,a.length,a[0],a[1],a[2],a[3]))}this._useElements=!!e,this._elementsType=r||this.gl.UNSIGNED_SHORT},i.prototype.draw=function(t,e,r){r=r||0;var n=this.gl;this._useElements?n.drawElements(t,e,this._elementsType,r):n.drawArrays(t,r,e)},e.exports=a},{"./do-bind.js":238}],241:[function(t,e,r){"use strict";function n(t){this.bindVertexArrayOES=t.bindVertexArray.bind(t),this.createVertexArrayOES=t.createVertexArray.bind(t),this.deleteVertexArrayOES=t.deleteVertexArray.bind(t)}function i(t,e,r,i){var s,l=t.createVertexArray?new n(t):t.getExtension("OES_vertex_array_object");return s=l?a(t,l):o(t),s.update(e,r,i),s}var a=t("./lib/vao-native.js"),o=t("./lib/vao-emulated.js");e.exports=i},{"./lib/vao-emulated.js":239,"./lib/vao-native.js":240}],242:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}e.exports=n},{}],243:[function(t,e,r){function n(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}e.exports=n},{}],244:[function(t,e,r){function n(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}e.exports=n},{}],245:[function(t,e,r){function n(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t}e.exports=n},{}],246:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}e.exports=n},{}],247:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}e.exports=n},{}],248:[function(t,e,r){function n(t,e,r,n){return i[0]=n,i[1]=r,i[2]=e,i[3]=t,a[0]}e.exports=n;var i=new Uint8Array(4),a=new Float32Array(i.buffer)},{}],249:[function(t,e,r){function n(t){for(var e=Array.isArray(t)?t:i(t),r=0;r<e.length;r++){var n=e[r];if("preprocessor"===n.type){var o=n.data.match(/\#define\s+SHADER_NAME(_B64)?\s+(.+)$/);if(o&&o[2]){var s=o[1],l=o[2];return(s?a(l):l).trim()}}}}var i=t("glsl-tokenizer"),a=t("atob-lite");e.exports=n},{"atob-lite":37,"glsl-tokenizer":256}],250:[function(t,e,r){function n(t){function e(t){t.length&&V.push({type:M[B],data:t,position:Y,line:q,column:H})}function r(t){j=0,W+=t,F=W.length;for(var e;O=W[j],j<F;){switch(e=j,B){case h:j=S();break;case f:j=E();break;case d:j=T();break;case p:j=L();break;case m:j=z();break;case w:j=I();break;case g:j=D();break;case c:j=P();break;case b:j=k();break;case u:j=A()}if(e!==j)switch(W[e]){case"\n":H=0,++q;break;default:++H}}return N+=j,W=W.slice(j),V}function n(t){return U.length&&e(U.join("")),B=_,e("(eof)"),V}function A(){return U=U.length?[]:U,"/"===R&&"*"===O?(Y=N+j-1,B=h,R=O,j+1):"/"===R&&"/"===O?(Y=N+j-1,B=f,R=O,j+1):"#"===O?(B=d,Y=N+j,j):/\s/.test(O)?(B=b,Y=N+j,j):(G=/\d/.test(O),X=/[^\w_]/.test(O),Y=N+j,B=G?m:X?p:c,j)}function k(){return/[^\s]/g.test(O)?(e(U.join("")),B=u,j):(U.push(O),R=O,j+1)}function T(){return"\r"!==O&&"\n"!==O||"\\"===R?(U.push(O),R=O,j+1):(e(U.join("")),B=u,j)}function E(){return T()}function S(){return"/"===O&&"*"===R?(U.push(O),e(U.join("")),B=u,j+1):(U.push(O),R=O,j+1)}function L(){if("."===R&&/\d/.test(O))return B=g,j;if("/"===R&&"*"===O)return B=h,j;if("/"===R&&"/"===O)return B=f,j;if("."===O&&U.length){for(;C(U););return B=g,j}if(";"===O||")"===O||"("===O){if(U.length)for(;C(U););return e(O),B=u,j+1}var t=2===U.length&&"="!==O;if(/[\w_\d\s]/.test(O)||t){for(;C(U););return B=u,j}return U.push(O),R=O,j+1}function C(t){for(var r,n,i=0;;){if(r=a.indexOf(t.slice(0,t.length+i).join("")),n=a[r],r===-1){if(i--+t.length>0)continue;n=t.slice(0,1).join("")}return e(n),Y+=n.length,U=U.slice(n.length),U.length}}function I(){return/[^a-fA-F0-9]/.test(O)?(e(U.join("")),B=u,j):(U.push(O),R=O,j+1)}function z(){return"."===O?(U.push(O),B=g,R=O,j+1):/[eE]/.test(O)?(U.push(O),B=g,R=O,j+1):"x"===O&&1===U.length&&"0"===U[0]?(B=w,U.push(O),R=O,j+1):/[^\d]/.test(O)?(e(U.join("")),B=u,j):(U.push(O),R=O,j+1)}function D(){return"f"===O&&(U.push(O),R=O,j+=1),/[eE]/.test(O)?(U.push(O),R=O,j+1):"-"===O&&/[eE]/.test(R)?(U.push(O),R=O,j+1):/[^\d]/.test(O)?(e(U.join("")),B=u,j):(U.push(O),R=O,j+1)}function P(){if(/[^\d\w_]/.test(O)){var t=U.join("");return B=J.indexOf(t)>-1?x:Z.indexOf(t)>-1?y:v,e(U.join("")),B=u,j}return U.push(O),R=O,j+1}var O,R,F,j=0,N=0,B=u,U=[],V=[],q=1,H=0,Y=0,G=!1,X=!1,W="";t=t||{};var Z=o,J=i;return"300 es"===t.version&&(Z=l,J=s),function(t){return V=[],null!==t?r(t.replace?t.replace(/\r\n/g,"\n"):t):n()}}e.exports=n;var i=t("./lib/literals"),a=t("./lib/operators"),o=t("./lib/builtins"),s=t("./lib/literals-300es"),l=t("./lib/builtins-300es"),u=999,c=9999,h=0,f=1,d=2,p=3,m=4,g=5,v=6,y=7,x=8,b=9,_=10,w=11,M=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":252,"./lib/builtins-300es":251,"./lib/literals":254,"./lib/literals-300es":253,"./lib/operators":255}],251:[function(t,e,r){var n=t("./builtins");n=n.slice().filter(function(t){return!/^(gl\_|texture)/.test(t)}),e.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},{"./builtins":252}],252:[function(t,e,r){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},{}],253:[function(t,e,r){var n=t("./literals");e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},{"./literals":254}],254:[function(t,e,r){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],255:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],256:[function(t,e,r){function n(t,e){var r=i(e),n=[];return n=n.concat(r(t)),n=n.concat(r(null))}var i=t("./index");e.exports=n},{"./index":250}],257:[function(t,e,r){"use strict";function n(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var a=new Int32Array(this.arrayBuffer);t=a[0],e=a[1],r=a[2],this.d=e+2*r;for(var o=0;o<this.d*this.d;o++){var s=a[i+o],l=a[i+o+1];n.push(s===l?null:a.subarray(s,l))}var u=a[i+n.length],c=a[i+n.length+1];this.keys=a.subarray(u,c),this.bboxes=a.subarray(c),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var h=0;h<this.d*this.d;h++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var f=r/e*t;this.min=-f,this.max=t+f}e.exports=n;var i=3;n.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},n.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},n.prototype._insertCell=function(t,e,r,n,i,a){this.cells[i].push(a)},n.prototype.query=function(t,e,r,n){var i=this.min,a=this.max;if(t<=i&&e<=i&&a<=r&&a<=n)return Array.prototype.slice.call(this.keys);var o=[],s={};return this._forEachCell(t,e,r,n,this._queryCell,o,s),o},n.prototype._queryCell=function(t,e,r,n,i,a,o){var s=this.cells[i];if(null!==s)for(var l=this.keys,u=this.bboxes,c=0;c<s.length;c++){var h=s[c];if(void 0===o[h]){var f=4*h;t<=u[f+2]&&e<=u[f+3]&&r>=u[f+0]&&n>=u[f+1]?(o[h]=!0,a.push(l[h])):o[h]=!1}}},n.prototype._forEachCell=function(t,e,r,n,i,a,o){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),u=this._convertToCellCoord(r),c=this._convertToCellCoord(n),h=s;h<=u;h++)for(var f=l;f<=c;f++){var d=this.d*f+h;if(i.call(this,t,e,r,n,d,a,o))return}},n.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},n.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=i+this.cells.length+1+1,r=0,n=0;n<this.cells.length;n++)r+=this.cells[n].length;var a=new Int32Array(e+r+this.keys.length+this.bboxes.length);a[0]=this.extent,a[1]=this.n,a[2]=this.padding;for(var o=e,s=0;s<t.length;s++){var l=t[s];a[i+s]=o,a.set(l,o),o+=l.length}return a[i+t.length]=o,a.set(this.keys,o),o+=this.keys.length,a[i+t.length+1]=o,a.set(this.bboxes,o),o+=this.bboxes.length,a.buffer}},{}],258:[function(t,e,r){r.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,u=l>>1,c=-7,h=r?i-1:0,f=r?-1:1,d=t[e+h];for(h+=f,a=d&(1<<-c)-1,d>>=-c,c+=s;c>0;a=256*a+t[e+h],h+=f,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+h],h+=f,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:(d?-1:1)*(1/0);o+=Math.pow(2,n),a-=u}return(d?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<<u)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),e+=o+h>=1?f/l:f*Math.pow(2,1-h),e*l>=2&&(o++,l/=2),o+h>=c?(s=0,o=c):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<<i|s,u+=i;u>0;t[r+d]=255&o,d+=p,o/=256,u-=8);t[r+d-p]|=128*m}},{}],259:[function(t,e,r){"use strict";function n(t,e,r){this.vertices=t,this.adjacent=e,this.boundary=r,this.lastVisited=-1}function i(t,e,r){this.vertices=t,this.cell=e,this.index=r}function a(t,e){return c(t.vertices,e.vertices)}function o(t){for(var e=["function orient(){var tuple=this.tuple;return test("],r=0;r<=t;++r)r>0&&e.push(","),e.push("tuple[",r,"]");e.push(")}return orient");var n=new Function("test",e.join("")),i=u[t+1];return i||(i=u),n(i)}function s(t,e,r){this.dimension=t,this.vertices=e,this.simplices=r,this.interior=r.filter(function(t){return!t.boundary}),this.tuple=new Array(t+1);for(var n=0;n<=t;++n)this.tuple[n]=this.vertices[n];var i=h[t];i||(i=h[t]=o(t)),this.orient=i}function l(t,e){var r=t.length;if(0===r)throw new Error("Must have at least d+1 points");var i=t[0].length;if(r<=i)throw new Error("Must input at least d+1 points");var a=t.slice(0,i+1),o=u.apply(void 0,a);if(0===o)throw new Error("Input not in general position");for(var l=new Array(i+1),c=0;c<=i;++c)l[c]=c;o<0&&(l[0]=1,l[1]=0);for(var h=new n(l,new Array(i+1),!1),f=h.adjacent,d=new Array(i+2),c=0;c<=i;++c){for(var p=l.slice(),m=0;m<=i;++m)m===c&&(p[m]=-1);var g=p[0];p[0]=p[1],p[1]=g;var v=new n(p,new Array(i+1),!0);f[c]=v,d[c]=v}d[i+1]=h;for(var c=0;c<=i;++c)for(var p=f[c].vertices,y=f[c].adjacent,m=0;m<=i;++m){var x=p[m];if(x<0)y[m]=h;else for(var b=0;b<=i;++b)f[b].vertices.indexOf(x)<0&&(y[m]=f[b])}for(var _=new s(i,a,d),w=!!e,c=i+1;c<r;++c)_.insert(t[c],w);return _.boundary()}e.exports=l;var u=t("robust-orientation"),c=t("simplicial-complex").compareCells;n.prototype.flip=function(){var t=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=t;var e=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=e};var h=[],f=s.prototype;f.handleBoundaryDegeneracy=function(t,e){var r=this.dimension,n=this.vertices.length-1,i=this.tuple,a=this.vertices,o=[t];for(t.lastVisited=-n;o.length>0;){t=o.pop();for(var s=(t.vertices,t.adjacent),l=0;l<=r;++l){var u=s[l];if(u.boundary&&!(u.lastVisited<=-n)){for(var c=u.vertices,h=0;h<=r;++h){var f=c[h];f<0?i[h]=e:i[h]=a[f]}var d=this.orient();if(d>0)return u;u.lastVisited=-n,0===d&&o.push(u)}}}return null},f.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,u=s.adjacent,c=0;c<=n;++c)a[c]=i[l[c]];s.lastVisited=r;for(var c=0;c<=n;++c){var h=u[c];if(!(h.lastVisited>=r)){var f=a[c];a[c]=t;var d=this.orient();if(a[c]=f,d<0){s=h;continue t}h.boundary?h.lastVisited=-r:h.lastVisited=r}}return}return s},f.addPeaks=function(t,e){var r=this.vertices.length-1,o=this.dimension,s=this.vertices,l=this.tuple,u=this.interior,c=this.simplices,h=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,u.push(e);for(var f=[];h.length>0;){var e=h.pop(),d=e.vertices,p=e.adjacent,m=d.indexOf(r);if(!(m<0))for(var g=0;g<=o;++g)if(g!==m){var v=p[g];if(v.boundary&&!(v.lastVisited>=r)){var y=v.vertices;if(v.lastVisited!==-r){for(var x=0,b=0;b<=o;++b)y[b]<0?(x=b,l[b]=t):l[b]=s[y[b]];var _=this.orient();if(_>0){y[x]=r,v.boundary=!1,u.push(v),h.push(v),v.lastVisited=r;continue}v.lastVisited=-r}var w=v.adjacent,M=d.slice(),A=p.slice(),k=new n(M,A,!0);c.push(k);var T=w.indexOf(e);if(!(T<0)){w[T]=k,A[m]=v,M[g]=-1,A[g]=e,p[g]=k,k.flip();for(var b=0;b<=o;++b){var E=M[b];if(!(E<0||E===r)){for(var S=new Array(o-1),L=0,C=0;C<=o;++C){var I=M[C];I<0||C===b||(S[L++]=I)}f.push(new i(S,k,b))}}}}}}f.sort(a);for(var g=0;g+1<f.length;g+=2){var z=f[g],D=f[g+1],P=z.index,O=D.index;P<0||O<0||(z.cell.adjacent[z.index]=D.cell,D.cell.adjacent[D.index]=z.cell)}},f.insert=function(t,e){var r=this.vertices;r.push(t);var n=this.walk(t,e);if(n){for(var i=this.dimension,a=this.tuple,o=0;o<=i;++o){var s=n.vertices[o];s<0?a[o]=t:a[o]=r[s]}var l=this.orient(a);l<0||(0!==l||(n=this.handleBoundaryDegeneracy(n,t)))&&this.addPeaks(t,n)}},f.boundary=function(){for(var t=this.dimension,e=[],r=this.simplices,n=r.length,i=0;i<n;++i){var a=r[i];if(a.boundary){for(var o=new Array(t),s=a.vertices,l=0,u=0,c=0;c<=t;++c)s[c]>=0?o[l++]=s[c]:u=1&c;if(u===(1&t)){var h=o[0];o[0]=o[1],o[1]=h}e.push(o)}}return e}},{"robust-orientation":471,"simplicial-complex":482}],260:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}function i(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function a(t,e){var r=p(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function o(t,e){var r=t.intervals([]);r.push(e),a(t,r)}function s(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?y:(r.splice(n,1),a(t,r),x)}function l(t,e,r){for(var n=0;n<t.length&&t[n][0]<=e;++n){var i=r(t[n]);if(i)return i}}function u(t,e,r){for(var n=t.length-1;n>=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function c(t,e){for(var r=0;r<t.length;++r){var n=e(t[r]);if(n)return n}}function h(t,e){return t-e}function f(t,e){var r=t[0]-e[0];return r?r:t[1]-e[1]}function d(t,e){var r=t[1]-e[1];return r?r:t[0]-e[0]}function p(t){if(0===t.length)return null;for(var e=[],r=0;r<t.length;++r)e.push(t[r][0],t[r][1]);e.sort(h);for(var i=e[e.length>>1],a=[],o=[],s=[],r=0;r<t.length;++r){var l=t[r];l[1]<i?a.push(l):i<l[0]?o.push(l):s.push(l)}var u=s,c=s.slice();return u.sort(f),c.sort(d),new n(i,p(a),p(o),u,c)}function m(t){this.root=t}function g(t){return new m(t&&0!==t.length?p(t):null)}var v=t("binary-search-bounds"),y=0,x=1,b=2;e.exports=g;var _=n.prototype;_.intervals=function(t){return t.push.apply(t,this.leftPoints),this.left&&this.left.intervals(t),this.right&&this.right.intervals(t),t},_.insert=function(t){var e=this.count-this.leftPoints.length;if(this.count+=1,t[1]<this.mid)this.left?4*(this.left.count+1)>3*(e+1)?o(this,t):this.left.insert(t):this.left=p([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?o(this,t):this.right.insert(t):this.right=p([t]);else{var r=v.ge(this.leftPoints,t,f),n=v.ge(this.rightPoints,t,d);this.leftPoints.splice(r,0,t),this.rightPoints.splice(n,0,t)}},_.remove=function(t){var e=this.count-this.leftPoints;if(t[1]<this.mid){if(!this.left)return y;var r=this.right?this.right.count:0;if(4*r>3*(e-1))return s(this,t);var n=this.left.remove(t);return n===b?(this.left=null,this.count-=1,x):(n===x&&(this.count-=1),n)}if(t[0]>this.mid){if(!this.right)return y;var a=this.left?this.left.count:0;if(4*a>3*(e-1))return s(this,t);var n=this.right.remove(t);return n===b?(this.right=null,this.count-=1,x):(n===x&&(this.count-=1),n)}if(1===this.count)return this.leftPoints[0]===t?b:y;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var o=this,l=this.left;l.right;)o=l,l=l.right;if(o===this)l.right=this.right;else{var u=this.left,n=this.right;o.count-=l.count,o.right=l.left,l.left=u,l.right=n}i(this,l),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?i(this,this.left):i(this,this.right);return x}for(var u=v.ge(this.leftPoints,t,f);u<this.leftPoints.length&&this.leftPoints[u][0]===t[0];++u)if(this.leftPoints[u]===t){this.count-=1,this.leftPoints.splice(u,1);for(var n=v.ge(this.rightPoints,t,d);n<this.rightPoints.length&&this.rightPoints[n][1]===t[1];++n)if(this.rightPoints[n]===t)return this.rightPoints.splice(n,1),x}return y},_.queryPoint=function(t,e){if(t<this.mid){if(this.left){var r=this.left.queryPoint(t,e);if(r)return r}return l(this.leftPoints,t,e)}if(t>this.mid){if(this.right){var r=this.right.queryPoint(t,e);if(r)return r}return u(this.rightPoints,t,e)}return c(this.leftPoints,e)},_.queryInterval=function(t,e,r){if(t<this.mid&&this.left){var n=this.left.queryInterval(t,e,r);if(n)return n}if(e>this.mid&&this.right){var n=this.right.queryInterval(t,e,r);if(n)return n}return e<this.mid?l(this.leftPoints,e,r):t>this.mid?u(this.rightPoints,t,r):c(this.leftPoints,r)};var w=m.prototype;w.insert=function(t){this.root?this.root.insert(t):this.root=new n(t[0],null,null,[t],[t])},w.remove=function(t){if(this.root){var e=this.root.remove(t);return e===b&&(this.root=null),e!==y}return!1},w.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},w.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(w,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(w,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":55}],261:[function(t,e,r){"use strict";function n(t,e){e=e||new Array(t.length);for(var r=0;r<t.length;++r)e[t[r]]=r;return e}e.exports=n},{}],262:[function(t,e,r){"use strict";function n(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=r;return e}e.exports=n},{}],263:[function(t,e,r){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function i(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}e.exports=function(t){return null!=t&&(n(t)||i(t)||!!t._isBuffer)}},{}],264:[function(t,e,r){"use strict";function n(t,e,r,n,a){return new i(t,e,r,n,a)}function i(t,e,r,n,i){e=e||a,r=r||o,i=i||Array,this.nodeSize=n||64,this.points=t,this.ids=new i(t.length),this.coords=new i(2*t.length);for(var l=0;l<t.length;l++)this.ids[l]=l,this.coords[2*l]=e(t[l]),this.coords[2*l+1]=r(t[l]);s(this.ids,this.coords,this.nodeSize,0,this.ids.length-1,0)}function a(t){return t[0]}function o(t){return t[1]}var s=t("./sort"),l=t("./range"),u=t("./within");e.exports=n,i.prototype={range:function(t,e,r,n){return l(this.ids,this.coords,t,e,r,n,this.nodeSize)},within:function(t,e,r){return u(this.ids,this.coords,t,e,r,this.nodeSize)}}},{"./range":265,"./sort":266,"./within":267}],265:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o){for(var s,l,u=[0,t.length-1,0],c=[];u.length;){var h=u.pop(),f=u.pop(),d=u.pop();if(f-d<=o)for(var p=d;p<=f;p++)s=e[2*p],l=e[2*p+1],s>=r&&s<=i&&l>=n&&l<=a&&c.push(t[p]);else{var m=Math.floor((d+f)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&c.push(t[m]);var g=(h+1)%2;(0===h?r<=s:n<=l)&&(u.push(d),u.push(m-1),u.push(g)),(0===h?i>=s:a>=l)&&(u.push(m+1),u.push(f),u.push(g))}}return c}e.exports=n},{}],266:[function(t,e,r){"use strict";function n(t,e,r,a,o,s){if(!(o-a<=r)){var l=Math.floor((a+o)/2);i(t,e,l,a,o,s%2),n(t,e,r,a,l-1,s+1),n(t,e,r,l+1,o,s+1)}}function i(t,e,r,n,o,s){for(;o>n;){if(o-n>600){var l=o-n+1,u=r-n+1,c=Math.log(l),h=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1),d=Math.max(n,Math.floor(r-u*h/l+f)),p=Math.min(o,Math.floor(r+(l-u)*h/l+f));i(t,e,r,d,p,s)}var m=e[2*r+s],g=n,v=o;for(a(t,e,n,r),e[2*o+s]>m&&a(t,e,n,o);g<v;){for(a(t,e,g,v),g++,v--;e[2*g+s]<m;)g++;for(;e[2*v+s]>m;)v--}e[2*n+s]===m?a(t,e,n,v):(v++,a(t,e,v,o)),v<=r&&(n=v+1),r<=v&&(o=v-1)}}function a(t,e,r,n){o(t,r,n),o(e,2*r,2*n),o(e,2*r+1,2*n+1)}function o(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],267:[function(t,e,r){"use strict";function n(t,e,r,n,a,o){for(var s=[0,t.length-1,0],l=[],u=a*a;s.length;){var c=s.pop(),h=s.pop(),f=s.pop();if(h-f<=o)for(var d=f;d<=h;d++)i(e[2*d],e[2*d+1],r,n)<=u&&l.push(t[d]);else{var p=Math.floor((f+h)/2),m=e[2*p],g=e[2*p+1];i(m,g,r,n)<=u&&l.push(t[p]);var v=(c+1)%2;(0===c?r-a<=m:n-a<=g)&&(s.push(f),s.push(p-1),s.push(v)),(0===c?r+a>=m:n+a>=g)&&(s.push(p+1),s.push(h),s.push(v))}}return l}function i(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}e.exports=n},{}],268:[function(t,e,r){"use strict";function n(t,e){var r;if(h(t)){var l,u=t.stops&&"object"==typeof t.stops[0][0],c=u||void 0!==t.property,f=u||!c,d=t.type||e||"exponential";if("exponential"===d)l=o;else if("interval"===d)l=a;else if("categorical"===d)l=i;else{if("identity"!==d)throw new Error('Unknown function type "'+d+'"');l=s}if(u){for(var p={},m=[],g=0;g<t.stops.length;g++){var v=t.stops[g];void 0===p[v[0].zoom]&&(p[v[0].zoom]={zoom:v[0].zoom,type:t.type,property:t.property,stops:[]}),p[v[0].zoom].stops.push([v[0].value,v[1]])}for(var y in p)m.push([p[y].zoom,n(p[y])]);r=function(e,r){return o({stops:m,base:t.base},e)(e,r)},r.isFeatureConstant=!1,r.isZoomConstant=!1}else f?(r=function(e){return l(t,e)},r.isFeatureConstant=!0,r.isZoomConstant=!1):(r=function(e,r){return l(t,r[t.property])},r.isFeatureConstant=!1,r.isZoomConstant=!0)}else r=function(){return t},r.isFeatureConstant=!0,r.isZoomConstant=!0;return r}function i(t,e){for(var r=0;r<t.stops.length;r++)if(e===t.stops[r][0])return t.stops[r][1];return t.stops[0][1]}function a(t,e){for(var r=0;r<t.stops.length&&!(e<t.stops[r][0]);r++);return t.stops[Math.max(r-1,0)][1]}function o(t,e){for(var r=void 0!==t.base?t.base:1,n=0;;){if(n>=t.stops.length)break;if(e<=t.stops[n][0])break;n++}return 0===n?t.stops[n][1]:n===t.stops.length?t.stops[n-1][1]:l(e,r,t.stops[n-1][0],t.stops[n][0],t.stops[n-1][1],t.stops[n][1])}function s(t,e){return e}function l(t,e,r,n,i,a){return"function"==typeof i?function(){var o=i.apply(void 0,arguments),s=a.apply(void 0,arguments);return l(t,e,r,n,o,s)}:i.length?c(t,e,r,n,i,a):u(t,e,r,n,i,a)}function u(t,e,r,n,i,a){var o,s=n-r,l=t-r;return o=1===e?l/s:(Math.pow(e,l)-1)/(Math.pow(e,s)-1),i*(1-o)+a*o}function c(t,e,r,n,i,a){for(var o=[],s=0;s<i.length;s++)o[s]=u(t,e,r,n,i[s],a[s]);return o}function h(t){return"object"==typeof t&&(t.stops||"identity"===t.type)}e.exports.isFunctionDefinition=h,e.exports.interpolated=function(t){return n(t,"exponential")},e.exports["piecewise-constant"]=function(t){return n(t,"interval")}},{}],269:[function(t,e,r){t("path");e.exports={debug:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform lowp vec4 u_color;\n\nvoid main() {\n    gl_FragColor = u_color;\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n    gl_Position = u_matrix * vec4(a_pos, step(32767.0, a_pos.x), 1);\n}\n"},fill:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n    #pragma mapbox: initialize lowp vec4 color\n    #pragma mapbox: initialize lowp float opacity\n\n    gl_FragColor = color * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n    #pragma mapbox: initialize lowp vec4 color\n    #pragma mapbox: initialize lowp float opacity\n\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},circle:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_extrude;\nvarying lowp float v_antialiasblur;\n\nvoid main() {\n    #pragma mapbox: initialize lowp vec4 color\n    #pragma mapbox: initialize lowp float blur\n    #pragma mapbox: initialize lowp float opacity\n\n    float t = smoothstep(1.0 - max(blur, v_antialiasblur), 1.0, length(v_extrude));\n    gl_FragColor = color * (1.0 - t) * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform bool u_scale_with_map;\nuniform vec2 u_extrude_scale;\nuniform float u_devicepixelratio;\n\nattribute vec2 a_pos;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_extrude;\nvarying lowp float v_antialiasblur;\n\nvoid main(void) {\n    #pragma mapbox: initialize lowp vec4 color\n    #pragma mapbox: initialize mediump float radius\n    #pragma mapbox: initialize lowp float blur\n    #pragma mapbox: initialize lowp float opacity\n\n    // unencode the extrusion vector that we snuck into the a_pos vector\n    v_extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\n\n    vec2 extrude = v_extrude * radius * u_extrude_scale;\n    // multiply a_pos by 0.5, since we had it * 2 in order to sneak\n    // in extrusion data\n    gl_Position = u_matrix * vec4(floor(a_pos * 0.5), 0, 1);\n\n    if (u_scale_with_map) {\n        gl_Position.xy += extrude;\n    } else {\n        gl_Position.xy += extrude * gl_Position.w;\n    }\n\n    // This is a minimum blur distance that serves as a faux-antialiasing for\n    // the circle. since blur is a ratio of the circle's size and the intent is\n    // to keep the blur at roughly 1px, the two are inversely related.\n    v_antialiasblur = 1.0 / u_devicepixelratio / radius;\n}\n"},line:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\nuniform float u_blur;\n\nvarying vec2 v_linewidth;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\n\nvoid main() {\n    // Calculate the distance of the pixel from the line in pixels.\n    float dist = length(v_normal) * v_linewidth.s;\n\n    // Calculate the antialiasing fade factor. This is either when fading in\n    // the line in case of an offset line (v_linewidth.t) or when fading out\n    // (v_linewidth.s)\n    float blur = u_blur * v_gamma_scale;\n    float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n    gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform mediump float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\nuniform mediump float u_blur;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_gamma_scale;\n\nvoid main() {\n    vec2 a_extrude = a_data.xy - 128.0;\n    float a_direction = mod(a_data.z, 4.0) - 1.0;\n\n    // We store the texture normals in the most insignificant bit\n    // transform y so that 0 => -1 and 1 => 1\n    // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n    // y is 1 if the normal points up, and -1 if it points down\n    mediump vec2 normal = mod(a_pos, 2.0);\n    normal.y = sign(normal.y - 0.5);\n    v_normal = normal;\n\n    float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n    float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n    // Scale the extrusion vector down to a normal and then up by the line width\n    // of this vertex.\n    mediump vec2 dist = outset * a_extrude * scale;\n\n    // Calculate the offset when drawing a line that is to the side of the actual line.\n    // We do this by creating a vector that points towards the extrude, but rotate\n    // it when we're drawing round end points (a_direction = -1 or 1) since their\n    // extrude vector points in another direction.\n    mediump float u = 0.5 * a_direction;\n    mediump float t = 1.0 - abs(u);\n    mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n    // Remove the texture normal bit of the position before scaling it with the\n    // model/view matrix.\n    gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n\n    // position of y on the screen\n    float y = gl_Position.y / gl_Position.w;\n\n    // how much features are squished in the y direction by the tilt\n    float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n    // how much features are squished in all directions by the perspectiveness\n    float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n    v_linewidth = vec2(outset, inset);\n    v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_blur;\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_fade;\nuniform float u_opacity;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n    // Calculate the distance of the pixel from the line in pixels.\n    float dist = length(v_normal) * v_linewidth.s;\n\n    // Calculate the antialiasing fade factor. This is either when fading in\n    // the line in case of an offset line (v_linewidth.t) or when fading out\n    // (v_linewidth.s)\n    float blur = u_blur * v_gamma_scale;\n    float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n    float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n    float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n    float y_a = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_a.y);\n    float y_b = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_b.y);\n    vec2 pos_a = mix(u_pattern_tl_a, u_pattern_br_a, vec2(x_a, y_a));\n    vec2 pos_b = mix(u_pattern_tl_b, u_pattern_br_b, vec2(x_b, y_b));\n\n    vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n    alpha *= u_opacity;\n\n    gl_FragColor = color * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform mediump float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n    vec2 a_extrude = a_data.xy - 128.0;\n    float a_direction = mod(a_data.z, 4.0) - 1.0;\n    float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n    // We store the texture normals in the most insignificant bit\n    // transform y so that 0 => -1 and 1 => 1\n    // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n    // y is 1 if the normal points up, and -1 if it points down\n    mediump vec2 normal = mod(a_pos, 2.0);\n    normal.y = sign(normal.y - 0.5);\n    v_normal = normal;\n\n    float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n    float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n    // Scale the extrusion vector down to a normal and then up by the line width\n    // of this vertex.\n    mediump vec2 dist = outset * a_extrude * scale;\n\n    // Calculate the offset when drawing a line that is to the side of the actual line.\n    // We do this by creating a vector that points towards the extrude, but rotate\n    // it when we're drawing round end points (a_direction = -1 or 1) since their\n    // extrude vector points in another direction.\n    mediump float u = 0.5 * a_direction;\n    mediump float t = 1.0 - abs(u);\n    mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n    // Remove the texture normal bit of the position before scaling it with the\n    // model/view matrix.\n    gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n    v_linesofar = a_linesofar;\n\n    // position of y on the screen\n    float y = gl_Position.y / gl_Position.w;\n\n    // how much features are squished in the y direction by the tilt\n    float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n    // how much features are squished in all directions by the perspectiveness\n    float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n    v_linewidth = vec2(outset, inset);\n    v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linesdfpattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\n\nuniform float u_blur;\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n    // Calculate the distance of the pixel from the line in pixels.\n    float dist = length(v_normal) * v_linewidth.s;\n\n    // Calculate the antialiasing fade factor. This is either when fading in\n    // the line in case of an offset line (v_linewidth.t) or when fading out\n    // (v_linewidth.s)\n    float blur = u_blur * v_gamma_scale;\n    float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n    float sdfdist_a = texture2D(u_image, v_tex_a).a;\n    float sdfdist_b = texture2D(u_image, v_tex_b).a;\n    float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n    alpha *= smoothstep(0.5 - u_sdfgamma, 0.5 + u_sdfgamma, sdfdist);\n\n    gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n    vec2 a_extrude = a_data.xy - 128.0;\n    float a_direction = mod(a_data.z, 4.0) - 1.0;\n    float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n    // We store the texture normals in the most insignificant bit\n    // transform y so that 0 => -1 and 1 => 1\n    // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n    // y is 1 if the normal points up, and -1 if it points down\n    mediump vec2 normal = mod(a_pos, 2.0);\n    normal.y = sign(normal.y - 0.5);\n    v_normal = normal;\n\n    float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n    float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n    // Scale the extrusion vector down to a normal and then up by the line width\n    // of this vertex.\n    mediump vec2 dist = outset * a_extrude * scale;\n\n    // Calculate the offset when drawing a line that is to the side of the actual line.\n    // We do this by creating a vector that points towards the extrude, but rotate\n    // it when we're drawing round end points (a_direction = -1 or 1) since their\n    // extrude vector points in another direction.\n    mediump float u = 0.5 * a_direction;\n    mediump float t = 1.0 - abs(u);\n    mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n    // Remove the texture normal bit of the position before scaling it with the\n    // model/view matrix.\n    gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n\n    v_tex_a = vec2(a_linesofar * u_patternscale_a.x, normal.y * u_patternscale_a.y + u_tex_y_a);\n    v_tex_b = vec2(a_linesofar * u_patternscale_b.x, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n    // position of y on the screen\n    float y = gl_Position.y / gl_Position.w;\n\n    // how much features are squished in the y direction by the tilt\n    float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n    // how much features are squished in all directions by the perspectiveness\n    float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n    v_linewidth = vec2(outset, inset);\n    v_gamma_scale = perspective_scale * squish_scale;\n}\n"},outline:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n    #pragma mapbox: initialize lowp vec4 outline_color\n    #pragma mapbox: initialize lowp float opacity\n\n    float dist = length(v_pos - gl_FragCoord.xy);\n    float alpha = smoothstep(1.0, 0.0, dist);\n    gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n    #pragma mapbox: initialize lowp vec4 outline_color\n    #pragma mapbox: initialize lowp float opacity\n\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n    v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},outlinepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n    vec2 imagecoord = mod(v_pos_a, 1.0);\n    vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n    vec4 color1 = texture2D(u_image, pos);\n\n    vec2 imagecoord_b = mod(v_pos_b, 1.0);\n    vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n    vec4 color2 = texture2D(u_image, pos2);\n\n    // find distance to outline for alpha interpolation\n\n    float dist = length(v_pos - gl_FragCoord.xy);\n    float alpha = smoothstep(1.0, 0.0, dist);\n    \n\n    gl_FragColor = mix(color1, color2, u_mix) * alpha * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n    vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n    vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n    // the correct offset needs to be calculated.\n    //\n    // The offset depends on how many pixels are between the world origin and\n    // the edge of the tile:\n    // vec2 offset = mod(pixel_coord, size)\n    //\n    // At high zoom levels there are a ton of pixels between the world origin\n    // and the edge of the tile. The glsl spec only guarantees 16 bits of\n    // precision for highp floats. We need more than that.\n    //\n    // The pixel_coord is passed in as two 16 bit values:\n    // pixel_coord_upper = floor(pixel_coord / 2^16)\n    // pixel_coord_lower = mod(pixel_coord, 2^16)\n    //\n    // The offset is calculated in a series of steps that should preserve this precision:\n    vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n    vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n    v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n    v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n\n    v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},pattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n\n    vec2 imagecoord = mod(v_pos_a, 1.0);\n    vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n    vec4 color1 = texture2D(u_image, pos);\n\n    vec2 imagecoord_b = mod(v_pos_b, 1.0);\n    vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n    vec4 color2 = texture2D(u_image, pos2);\n\n    gl_FragColor = mix(color1, color2, u_mix) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n    vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n    vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n    // the correct offset needs to be calculated.\n    //\n    // The offset depends on how many pixels are between the world origin and\n    // the edge of the tile:\n    // vec2 offset = mod(pixel_coord, size)\n    //\n    // At high zoom levels there are a ton of pixels between the world origin\n    // and the edge of the tile. The glsl spec only guarantees 16 bits of\n    // precision for highp floats. We need more than that.\n    //\n    // The pixel_coord is passed in as two 16 bit values:\n    // pixel_coord_upper = floor(pixel_coord / 2^16)\n    // pixel_coord_lower = mod(pixel_coord, 2^16)\n    //\n    // The offset is calculated in a series of steps that should preserve this precision:\n    vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n    vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n    v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n    v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n}\n"},raster:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity0;\nuniform float u_opacity1;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n    // read and cross-fade colors from the main and parent tiles\n    vec4 color0 = texture2D(u_image0, v_pos0);\n    vec4 color1 = texture2D(u_image1, v_pos1);\n    vec4 color = color0 * u_opacity0 + color1 * u_opacity1;\n    vec3 rgb = color.rgb;\n\n    // spin\n    rgb = vec3(\n        dot(rgb, u_spin_weights.xyz),\n        dot(rgb, u_spin_weights.zxy),\n        dot(rgb, u_spin_weights.yzx));\n\n    // saturation\n    float average = (color.r + color.g + color.b) / 3.0;\n    rgb += (average - rgb) * u_saturation_factor;\n\n    // contrast\n    rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n    // brightness\n    vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n    vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n    gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb), color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n    v_pos0 = (((a_texture_pos / 32767.0) - 0.5) / u_buffer_scale ) + 0.5;\n    v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},icon:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp float u_opacity;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n    lowp float alpha = texture2D(u_fadetexture, v_fade_tex).a * u_opacity;\n    gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n    vec2 a_tex = a_texture_pos.xy;\n    mediump float a_labelminzoom = a_data[0];\n    mediump vec2 a_zoom = a_data.pq;\n    mediump float a_minzoom = a_zoom[0];\n    mediump float a_maxzoom = a_zoom[1];\n\n    // u_zoom is the current zoom level adjusted for the change in font size\n    mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n    vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n    if (u_rotate_with_map) {\n        gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n        gl_Position.z += z * gl_Position.w;\n    } else {\n        gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n    }\n\n    v_tex = a_tex / u_texsize;\n    v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},sdf:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\nuniform lowp float u_buffer;\nuniform lowp float u_gamma;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n    lowp float dist = texture2D(u_texture, v_tex).a;\n    lowp float fade_alpha = texture2D(u_fadetexture, v_fade_tex).a;\n    lowp float gamma = u_gamma * v_gamma_scale;\n    lowp float alpha = smoothstep(u_buffer - gamma, u_buffer + gamma, dist) * fade_alpha;\n\n    gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nconst float PI = 3.141592653589793;\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform bool u_pitch_with_map;\nuniform mediump float u_pitch;\nuniform mediump float u_bearing;\nuniform mediump float u_aspect_ratio;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n    vec2 a_tex = a_texture_pos.xy;\n    mediump float a_labelminzoom = a_data[0];\n    mediump vec2 a_zoom = a_data.pq;\n    mediump float a_minzoom = a_zoom[0];\n    mediump float a_maxzoom = a_zoom[1];\n\n    // u_zoom is the current zoom level adjusted for the change in font size\n    mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n    // pitch-alignment: map\n    // rotation-alignment: map | viewport\n    if (u_pitch_with_map) {\n        lowp float angle = u_rotate_with_map ? (a_data[1] / 256.0 * 2.0 * PI) : u_bearing;\n        lowp float asin = sin(angle);\n        lowp float acos = cos(angle);\n        mat2 RotationMatrix = mat2(acos, asin, -1.0 * asin, acos);\n        vec2 offset = RotationMatrix * a_offset;\n        vec2 extrude = u_extrude_scale * (offset / 64.0);\n        gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n        gl_Position.z += z * gl_Position.w;\n    // pitch-alignment: viewport\n    // rotation-alignment: map\n    } else if (u_rotate_with_map) {\n        // foreshortening factor to apply on pitched maps\n        // as a label goes from horizontal <=> vertical in angle\n        // it goes from 0% foreshortening to up to around 70% foreshortening\n        lowp float pitchfactor = 1.0 - cos(u_pitch * sin(u_pitch * 0.75));\n\n        lowp float lineangle = a_data[1] / 256.0 * 2.0 * PI;\n\n        // use the lineangle to position points a,b along the line\n        // project the points and calculate the label angle in projected space\n        // this calculation allows labels to be rendered unskewed on pitched maps\n        vec4 a = u_matrix * vec4(a_pos, 0, 1);\n        vec4 b = u_matrix * vec4(a_pos + vec2(cos(lineangle),sin(lineangle)), 0, 1);\n        lowp float angle = atan((b[1]/b[3] - a[1]/a[3])/u_aspect_ratio, b[0]/b[3] - a[0]/a[3]);\n        lowp float asin = sin(angle);\n        lowp float acos = cos(angle);\n        mat2 RotationMatrix = mat2(acos, -1.0 * asin, asin, acos);\n\n        vec2 offset = RotationMatrix * (vec2((1.0-pitchfactor)+(pitchfactor*cos(angle*2.0)), 1.0) * a_offset);\n        vec2 extrude = u_extrude_scale * (offset / 64.0);\n        gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n        gl_Position.z += z * gl_Position.w;\n    // pitch-alignment: viewport\n    // rotation-alignment: viewport\n    } else {\n        vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n        gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n    }\n\n    v_gamma_scale = (gl_Position.w - 0.5);\n\n    v_tex = a_tex / u_texsize;\n    v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},collisionbox:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_zoom;\nuniform float u_maxzoom;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n\n    float alpha = 0.5;\n\n    gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0) * alpha;\n\n    if (v_placement_zoom > u_zoom) {\n        gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n    }\n\n    if (u_zoom >= v_max_zoom) {\n        gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0) * alpha * 0.25;\n    }\n\n    if (v_placement_zoom >= u_maxzoom) {\n        gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0) * alpha * 0.2;\n    }\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_data;\n\nuniform mat4 u_matrix;\nuniform float u_scale;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n    gl_Position = u_matrix * vec4(a_pos + a_extrude / u_scale, 0.0, 1.0);\n\n    v_max_zoom = a_data.x;\n    v_placement_zoom = a_data.y;\n}\n"}},e.exports.util="float evaluate_zoom_function_1(const vec4 values, const float t) {\n    if (t < 1.0) {\n        return mix(values[0], values[1], t);\n    } else if (t < 2.0) {\n        return mix(values[1], values[2], t - 1.0);\n    } else {\n        return mix(values[2], values[3], t - 2.0);\n    }\n}\nvec4 evaluate_zoom_function_4(const vec4 value0, const vec4 value1, const vec4 value2, const vec4 value3, const float t) {\n    if (t < 1.0) {\n        return mix(value0, value1, t);\n    } else if (t < 2.0) {\n        return mix(value1, value2, t - 1.0);\n    } else {\n        return mix(value2, value3, t - 2.0);\n    }\n}\n"},{path:440}],270:[function(t,e,r){"use strict";function n(t,e){this.message=(t?t+": ":"")+i.apply(i,Array.prototype.slice.call(arguments,2)),null!==e&&void 0!==e&&e.__line__&&(this.line=e.__line__)}var i=t("util").format;e.exports=n},{util:510}],271:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)t[n]=r[n]}return t}},{}],272:[function(t,e,r){"use strict";e.exports=function(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}},{}],273:[function(t,e,r){"use strict";e.exports=function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}},{}],274:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),a=t("../util/extend");e.exports=function(e){var r=t("./validate_function"),o=t("./validate_object"),s={"*":function(){return[]},array:t("./validate_array"),boolean:t("./validate_boolean"),number:t("./validate_number"),color:t("./validate_color"),constants:t("./validate_constants"),enum:t("./validate_enum"),filter:t("./validate_filter"),function:t("./validate_function"),layer:t("./validate_layer"),object:t("./validate_object"),source:t("./validate_source"),string:t("./validate_string")},l=e.value,u=e.valueSpec,c=e.key,h=e.styleSpec,f=e.style;if("string"===i(l)&&"@"===l[0]){if(h.$version>7)return[new n(c,l,"constants have been deprecated as of v8")];if(!(l in f.constants))return[new n(c,l,'constant "%s" not found',l)];e=a({},e,{value:f.constants[l]})}return u.function&&"object"===i(l)?r(e):u.type&&s[u.type]?s[u.type](e):o(a({},e,{valueSpec:u.type?h[u.type]:u}))}},{"../error/validation_error":270,"../util/extend":271,"../util/get_type":272,"./validate_array":275,"./validate_boolean":276,"./validate_color":277,"./validate_constants":278,"./validate_enum":279,"./validate_filter":280,"./validate_function":281,"./validate_layer":283,"./validate_number":285,"./validate_object":286,"./validate_source":288,"./validate_string":289}],275:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("./validate"),a=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.valueSpec,o=t.style,s=t.styleSpec,l=t.key,u=t.arrayElementValidator||i;if("array"!==n(e))return[new a(l,e,"array expected, %s found",n(e))];if(r.length&&e.length!==r.length)return[new a(l,e,"array length %d expected, length %d found",r.length,e.length)];if(r["min-length"]&&e.length<r["min-length"])return[new a(l,e,"array length at least %d expected, length %d found",r["min-length"],e.length)];var c={type:r.value};s.$version<7&&(c.function=r.function),"object"===n(r.value)&&(c=r.value);for(var h=[],f=0;f<e.length;f++)h=h.concat(u({array:e,arrayIndex:f,value:e[f],valueSpec:c,style:o,styleSpec:s,key:l+"["+f+"]"}));return h}},{"../error/validation_error":270,"../util/get_type":272,"./validate":274}],276:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.key,a=n(e);return"boolean"!==a?[new i(r,e,"boolean expected, %s found",a)]:[]}},{"../error/validation_error":270,"../util/get_type":272}],277:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),a=t("csscolorparser").parseCSSColor;e.exports=function(t){var e=t.key,r=t.value,o=i(r);return"string"!==o?[new n(e,r,"color expected, %s found",o)]:null===a(r)?[new n(e,r,'color expected, "%s" found',r)]:[]}},{"../error/validation_error":270,"../util/get_type":272,csscolorparser:91}],278:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type");e.exports=function(t){var e=t.key,r=t.value,a=t.styleSpec;if(a.$version>7)return r?[new n(e,r,"constants have been deprecated as of v8")]:[];var o=i(r);if("object"!==o)return[new n(e,r,"object expected, %s found",o)];var s=[];for(var l in r)"@"!==l[0]&&s.push(new n(e+"."+l,r[l],'constants must start with "@"'));return s}},{"../error/validation_error":270,"../util/get_type":272}],279:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec,o=[];return a.values.indexOf(i(r))===-1&&o.push(new n(e,r,"expected one of [%s], %s found",a.values.join(", "),r)),o}},{"../error/validation_error":270,"../util/unbundle_jsonlint":273}],280:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_enum"),a=t("../util/get_type"),o=t("../util/unbundle_jsonlint");e.exports=function t(e){var r,s=e.value,l=e.key,u=e.styleSpec,c=[];if("array"!==a(s))return[new n(l,s,"array expected, %s found",a(s))];if(s.length<1)return[new n(l,s,"filter array must have at least 1 element")];switch(c=c.concat(i({key:l+"[0]",value:s[0],valueSpec:u.filter_operator,style:e.style,styleSpec:e.styleSpec})),o(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"==s[1]&&c.push(new n(l,s,'"$type" cannot be use with operator "%s"',s[0]));case"==":case"!=":3!=s.length&&c.push(new n(l,s,'filter array for operator "%s" must have 3 elements',s[0]));case"in":case"!in":s.length>=2&&(r=a(s[1]),"string"!==r?c.push(new n(l+"[1]",s[1],"string expected, %s found",r)):"@"===s[1][0]&&c.push(new n(l+"[1]",s[1],"filter key cannot be a constant")));for(var h=2;h<s.length;h++)r=a(s[h]),"$type"==s[1]?c=c.concat(i({key:l+"["+h+"]",value:s[h],valueSpec:u.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"===r&&"@"===s[h][0]?c.push(new n(l+"["+h+"]",s[h],"filter value cannot be a constant")):"string"!==r&&"number"!==r&&"boolean"!==r&&c.push(new n(l+"["+h+"]",s[h],"string, number, or boolean expected, %s found",r));break;case"any":case"all":case"none":for(h=1;h<s.length;h++)c=c.concat(t({key:l+"["+h+"]",value:s[h],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":r=a(s[1]),2!==s.length?c.push(new n(l,s,'filter array for "%s" operator must have 2 elements',s[0])):"string"!==r?c.push(new n(l+"[1]",s[1],"string expected, %s found",r)):"@"===s[1][0]&&c.push(new n(l+"[1]",s[1],"filter key cannot be a constant"))}return c}},{"../error/validation_error":270,"../util/get_type":272,"../util/unbundle_jsonlint":273,"./validate_enum":279}],281:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),a=t("./validate"),o=t("./validate_object"),s=t("./validate_array"),l=t("./validate_number");e.exports=function(t){function e(t){var e=[],a=t.value;return e=e.concat(s({key:t.key,value:a,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:r})),"array"===i(a)&&0===a.length&&e.push(new n(t.key,a,"array must have at least one stop")),e}function r(t){var e=[],r=t.value,s=t.key;if("array"!==i(r))return[new n(s,r,"array expected, %s found",i(r))];if(2!==r.length)return[new n(s,r,"array length %d expected, length %d found",2,r.length)];var f=i(r[0]);if(c||(c=f),f!==c)return[new n(s,r,"%s stop key type must match previous stop key type %s",f,c)];if("object"===f){if(void 0===r[0].zoom)return[new n(s,r,"object stop key must have zoom")];if(void 0===r[0].value)return[new n(s,r,"object stop key must have value")];e=e.concat(o({key:s+"[0]",value:r[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:l,value:u}}))}else e=e.concat((d?l:u)({key:s+"[0]",value:r[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec}));return e=e.concat(a({key:s+"[1]",value:r[1],valueSpec:h,style:t.style,styleSpec:t.styleSpec})),"number"===i(r[0])&&("piecewise-constant"===h.function&&r[0]%1!==0&&e.push(new n(s+"[0]",r[0],"zoom level for piecewise-constant functions must be an integer")),0!==t.arrayIndex&&r[0]<t.array[t.arrayIndex-1][0]&&e.push(new n(s+"[0]",r[0],"array stops must appear in ascending order"))),e}function u(t){var e=[],r=i(t.value);return"number"!==r&&"string"!==r&&"array"!==r&&e.push(new n(t.key,t.value,"property value must be a number, string or array")),e}var c,h=t.valueSpec,f=void 0!==t.value.property||"object"===c,d=void 0===t.value.property||"object"===c,p=o({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:e}});return t.styleSpec.$version>=8&&(f&&!t.valueSpec["property-function"]?p.push(new n(t.key,t.value,"property functions not supported")):d&&!t.valueSpec["zoom-function"]&&p.push(new n(t.key,t.value,"zoom functions not supported"))),p}},{"../error/validation_error":270,"../util/get_type":272,"./validate":274,"./validate_array":275,"./validate_number":285,"./validate_object":286}],282:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_string");e.exports=function(t){var e=t.value,r=t.key,a=i(t);return a.length?a:(e.indexOf("{fontstack}")===-1&&a.push(new n(r,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&a.push(new n(r,e,'"glyphs" url must include a "{range}" token')),a)}},{"../error/validation_error":270,"./validate_string":289}],283:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),a=t("./validate_object"),o=t("./validate_filter"),s=t("./validate_paint_property"),l=t("./validate_layout_property"),u=t("../util/extend");e.exports=function(t){var e=[],r=t.value,c=t.key,h=t.style,f=t.styleSpec;r.type||r.ref||e.push(new n(c,r,'either "type" or "ref" is required'));var d=i(r.type),p=i(r.ref);if(r.id)for(var m=0;m<t.arrayIndex;m++){var g=h.layers[m];i(g.id)===i(r.id)&&e.push(new n(c,r.id,'duplicate layer id "%s", previously used at line %d',r.id,g.id.__line__))}if("ref"in r){["type","source","source-layer","filter","layout"].forEach(function(t){t in r&&e.push(new n(c,r[t],'"%s" is prohibited for ref layers',t))});var v;h.layers.forEach(function(t){t.id==p&&(v=t)}),v?v.ref?e.push(new n(c,r.ref,"ref cannot reference another ref layer")):d=i(v.type):e.push(new n(c,r.ref,'ref layer "%s" not found',p))}else if("background"!==d)if(r.source){var y=h.sources&&h.sources[r.source];y?"vector"==y.type&&"raster"==d?e.push(new n(c,r.source,'layer "%s" requires a raster source',r.id)):"raster"==y.type&&"raster"!=d?e.push(new n(c,r.source,'layer "%s" requires a vector source',r.id)):"vector"!=y.type||r["source-layer"]||e.push(new n(c,r,'layer "%s" must specify a "source-layer"',r.id)):e.push(new n(c,r.source,'source "%s" not found',r.source))}else e.push(new n(c,r,'missing required property "source"'));return e=e.concat(a({key:c,value:r,valueSpec:f.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{filter:o,layout:function(t){return a({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return l(u({layerType:d},t))}}})},paint:function(t){return a({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return s(u({layerType:d},t))}}})}}}))}},{"../error/validation_error":270,"../util/extend":271,"../util/unbundle_jsonlint":273,"./validate_filter":280,"./validate_layout_property":284,"./validate_object":286,"./validate_paint_property":287}],284:[function(t,e,r){"use strict";var n=t("./validate"),i=t("../error/validation_error");e.exports=function(t){var e=t.key,r=t.style,a=t.styleSpec,o=t.value,s=t.objectKey,l=a["layout_"+t.layerType];if(t.valueSpec||l[s]){var u=[];return"symbol"===t.layerType&&("icon-image"===s&&r&&!r.sprite?u.push(new i(e,o,'use of "icon-image" requires a style "sprite" property')):"text-field"===s&&r&&!r.glyphs&&u.push(new i(e,o,'use of "text-field" requires a style "glyphs" property'))),u.concat(n({key:t.key,value:o,valueSpec:t.valueSpec||l[s],style:r,styleSpec:a}))}return[new i(e,o,'unknown property "%s"',s)]}},{"../error/validation_error":270,"./validate":274}],285:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("../error/validation_error");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec,o=n(r);return"number"!==o?[new i(e,r,"number expected, %s found",o)]:"minimum"in a&&r<a.minimum?[new i(e,r,"%s is less than the minimum value %s",r,a.minimum)]:"maximum"in a&&r>a.maximum?[new i(e,r,"%s is greater than the maximum value %s",r,a.maximum)]:[]}},{"../error/validation_error":270,"../util/get_type":272}],286:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),a=t("./validate");e.exports=function(t){var e=t.key,r=t.value,o=t.valueSpec,s=t.objectElementValidators||{},l=t.style,u=t.styleSpec,c=[],h=i(r);if("object"!==h)return[new n(e,r,"object expected, %s found",h)];for(var f in r){var d=f.split(".")[0],p=o&&(o[d]||o["*"]),m=s[d]||s["*"];p||m?c=c.concat((m||a)({key:(e?e+".":e)+f,value:r[f],valueSpec:p,style:l,styleSpec:u,object:r,objectKey:f})):""!==e&&1!==e.split(".").length&&c.push(new n(e,r[f],'unknown property "%s"',f))}for(d in o)o[d].required&&void 0===o[d].default&&void 0===r[d]&&c.push(new n(e,r,'missing required property "%s"',d));return c}},{"../error/validation_error":270,"../util/get_type":272,"./validate":274}],287:[function(t,e,r){"use strict";var n=t("./validate"),i=t("../error/validation_error");e.exports=function(t){var e=t.key,r=t.style,a=t.styleSpec,o=t.value,s=t.objectKey,l=a["paint_"+t.layerType],u=s.match(/^(.*)-transition$/);return u&&l[u[1]]&&l[u[1]].transition?n({key:e,value:o,valueSpec:a.transition,style:r,styleSpec:a}):t.valueSpec||l[s]?n({key:t.key,value:o,valueSpec:t.valueSpec||l[s],style:r,styleSpec:a}):[new i(e,o,'unknown property "%s"',s)]}},{"../error/validation_error":270,"./validate":274}],288:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),a=t("./validate_object"),o=t("./validate_enum");e.exports=function(t){var e=t.value,r=t.key,s=t.styleSpec,l=t.style;if(!e.type)return[new n(r,e,'"type" is required')];var u=i(e.type);switch(u){case"vector":case"raster":var c=[];if(c=c.concat(a({key:r,value:e,valueSpec:s.source_tile,style:t.style,styleSpec:s})),"url"in e)for(var h in e)["type","url","tileSize"].indexOf(h)<0&&c.push(new n(r+"."+h,e[h],'a source with a "url" property may not include a "%s" property',h));return c;case"geojson":return a({key:r,value:e,valueSpec:s.source_geojson,style:l,styleSpec:s});case"video":return a({key:r,value:e,valueSpec:s.source_video,style:l,styleSpec:s});case"image":return a({key:r,value:e,valueSpec:s.source_image,style:l,styleSpec:s});default:return o({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","geojson","video","image"]},style:l,styleSpec:s})}}},{"../error/validation_error":270,"../util/unbundle_jsonlint":273,"./validate_enum":279,"./validate_object":286}],289:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.key,a=n(e);return"string"!==a?[new i(r,e,"string expected, %s found",a)]:[]}},{"../error/validation_error":270,"../util/get_type":272}],290:[function(t,e,r){"use strict";function n(t,e){e=e||l;var r=[];return r=r.concat(s({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:u}})),e.$version>7&&t.constants&&(r=r.concat(o({key:"constants",value:t.constants,style:t,styleSpec:e}))),i(r)}function i(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function a(t){return function(){return i(t.apply(this,arguments))}}var o=t("./validate/validate_constants"),s=t("./validate/validate"),l=t("../reference/latest.min"),u=t("./validate/validate_glyphs_url");n.source=a(t("./validate/validate_source")),n.layer=a(t("./validate/validate_layer")),n.filter=a(t("./validate/validate_filter")),n.paintProperty=a(t("./validate/validate_paint_property")),n.layoutProperty=a(t("./validate/validate_layout_property")),e.exports=n},{"../reference/latest.min":291,"./validate/validate":274,"./validate/validate_constants":278,"./validate/validate_filter":280,"./validate/validate_glyphs_url":282,"./validate/validate_layer":283,"./validate/validate_layout_property":284,"./validate/validate_paint_property":287,"./validate/validate_source":288}],291:[function(t,e,r){e.exports=t("./v8.min.json")},{"./v8.min.json":292}],292:[function(t,e,r){e.exports={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_tile","source_geojson","source_video","source_image"],source_tile:{type:{required:!0,type:"enum",values:["vector","raster"]},url:{type:"string"},tiles:{type:"array",value:"string"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:["geojson"]},data:{type:"*"},maxzoom:{type:"number",default:14},buffer:{type:"number",default:64},tolerance:{type:"number",default:3},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:400},clusterMaxZoom:{type:"number"}},source_video:{type:{required:!0,type:"enum",values:["video"]},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:["image"]},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:["fill","line","symbol","circle","raster","background"]},metadata:{type:"*"},ref:{type:"string"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:22},maxzoom:{type:"number",minimum:0,maximum:22},interactive:{type:"boolean",default:!1},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"},"paint.*":{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_symbol","layout_raster","layout_background"],layout_background:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_fill:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_circle:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_line:{"line-cap":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["butt","round","square"],default:"butt"},"line-join":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["bevel","round","miter"],default:"miter"},"line-miter-limit":{type:"number",default:2,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number",default:1.05,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"round"}]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_symbol:{"symbol-placement":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["point","line"],default:"point"},"symbol-spacing":{type:"number",default:250,minimum:1,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1},"icon-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image","text-field"]},"icon-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["icon-image"]},"icon-size":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"icon-text-fit":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!1,values:["none","both","width","height"],default:"none",requires:["icon-image","text-field"]},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image","icon-text-fit","text-field"]},"icon-image":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,tokens:!0},"icon-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,"property-function":!0,units:"degrees",requires:["icon-image"]},"icon-padding":{type:"number",default:2,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:["icon-image"]},"icon-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}]},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"text-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],requires:["text-field"]},"text-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["text-field"]},"text-field":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:"",tokens:!0},"text-font":{type:"array",value:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"]},"text-size":{type:"number",default:16,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-max-width":{type:"number",default:10,minimum:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-line-height":{type:"number",default:1.2,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-letter-spacing":{type:"number",default:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-justify":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["left","center","right"],default:"center",requires:["text-field"]},"text-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],default:"center",requires:["text-field"]},"text-max-angle":{type:"number",default:45,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field",{"symbol-placement":"line"}]},"text-rotate":{type:"number",default:0,period:360,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["none","uppercase","lowercase"],default:"none",requires:["text-field"]},"text-offset":{type:"array",value:"number",units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,length:2,default:[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field","icon-image"]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_raster:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:["==","!=",">",">=","<","<=","in","!in","all","any","none","has","!has"]},geometry_type:{type:"enum",values:["Point","LineString","Polygon"]},color_operation:{type:"enum",values:["lighten","saturate","spin","fade","mix"]},function:{stops:{type:"array",required:!0,value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:["exponential","interval","categorical"],default:"exponential"}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},paint:["paint_fill","paint_line","paint_circle","paint_symbol","paint_raster","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0},"fill-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"fill-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"}]},"fill-outline-color":{type:"color",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}]},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"fill-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["fill-translate"]},"fill-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_line:{"line-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"line-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["line-translate"]},"line-width":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-gap-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-offset":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-dasharray":{type:"array",value:"number",function:"piecewise-constant","zoom-function":!0,"property-function":!0,minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-blur":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["circle-translate"]},"circle-pitch-scale":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["icon-image","icon-translate"]},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["text-field","text-translate"]}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-hue-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,transition:!0,units:"degrees"},"raster-brightness-min":{type:"number",function:"interpolated","zoom-function":!0,default:0,minimum:0,maximum:1,transition:!0},"raster-brightness-max":{type:"number",function:"interpolated","zoom-function":!0,default:1,minimum:0,maximum:1,transition:!0},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-fade-duration":{type:"number",default:300,minimum:0,function:"interpolated","zoom-function":!0,transition:!0,units:"milliseconds"}},paint_background:{"background-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}}}},{}],293:[function(t,e,r){"use strict";function n(t){return!!(i()&&a()&&o()&&s()&&l()&&u()&&c()&&h(t&&t.failIfMajorPerformanceCaveat))}function i(){return"undefined"!=typeof window&&"undefined"!=typeof document}function a(){return Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray}function o(){return Function.prototype&&Function.prototype.bind}function s(){return Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions}function l(){return"JSON"in window&&"parse"in JSON&&"stringify"in JSON}function u(){return"Worker"in window}function c(){return"Uint8ClampedArray"in window}function h(t){return void 0===d[t]&&(d[t]=f(t)),d[t]}function f(t){var e=document.createElement("canvas"),r=Object.create(n.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,e.probablySupportsContext?e.probablySupportsContext("webgl",r)||e.probablySupportsContext("experimental-webgl",r):e.supportsContext?e.supportsContext("webgl",r)||e.supportsContext("experimental-webgl",r):e.getContext("webgl",r)||e.getContext("experimental-webgl",r)}"undefined"!=typeof e&&e.exports?e.exports=n:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=n);var d={};n.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],294:[function(t,e,r){"use strict";function n(t){var e=t.layoutVertexArrayType;this.layoutVertexArray=new e;var r=t.elementArrayType;r&&(this.elementArray=new r);var n=t.elementArrayType2;n&&(this.elementArray2=new n),this.paintVertexArrays=i.mapObject(t.paintVertexArrayTypes,function(t){return new t})}var i=t("../util/util");e.exports=n,n.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,n.prototype.hasCapacityFor=function(t){return this.layoutVertexArray.length+t<=n.MAX_VERTEX_ARRAY_LENGTH},n.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},n.prototype.trim=function(){this.layoutVertexArray.trim(),this.elementArray&&this.elementArray.trim(),this.elementArray2&&this.elementArray2.trim();for(var t in this.paintVertexArrays)this.paintVertexArrays[t].trim()},n.prototype.serialize=function(){return{layoutVertexArray:this.layoutVertexArray.serialize(),elementArray:this.elementArray&&this.elementArray.serialize(),elementArray2:this.elementArray2&&this.elementArray2.serialize(),paintVertexArrays:i.mapObject(this.paintVertexArrays,function(t){return t.serialize()})}},n.prototype.getTransferables=function(t){t.push(this.layoutVertexArray.arrayBuffer),this.elementArray&&t.push(this.elementArray.arrayBuffer),this.elementArray2&&t.push(this.elementArray2.arrayBuffer);for(var e in this.paintVertexArrays)t.push(this.paintVertexArrays[e].arrayBuffer)}},{"../util/util":408}],295:[function(t,e,r){"use strict";function n(t){if(this.zoom=t.zoom,this.overscaling=t.overscaling,this.layer=t.layer,this.childLayers=t.childLayers,this.type=this.layer.type,this.features=[],this.id=this.layer.id,this.index=t.index,this.sourceLayer=this.layer.sourceLayer,this.sourceLayerIndex=t.sourceLayerIndex,this.minZoom=this.layer.minzoom,this.maxZoom=this.layer.maxzoom,this.paintAttributes=i(this),t.arrays){var e=this.programInterfaces;this.bufferGroups=c.mapObject(t.arrays,function(r,n){var i=e[n],a=t.paintVertexArrayTypes[n];return r.map(function(t){return new u(t,{layoutVertexArrayType:i.layoutVertexArrayType.serialize(),elementArrayType:i.elementArrayType&&i.elementArrayType.serialize(),elementArrayType2:i.elementArrayType2&&i.elementArrayType2.serialize(),paintVertexArrayTypes:a})})})}}function i(t){var e={};for(var r in t.programInterfaces){for(var n=e[r]={},i=0;i<t.childLayers.length;i++){var s=t.childLayers[i];n[s.id]={attributes:[],uniforms:[],defines:[],vertexPragmas:{define:{},initialize:{}},fragmentPragmas:{define:{},initialize:{}}}}var l=t.programInterfaces[r];if(l.paintAttributes)for(var u="{precision}",h="{type}",d=0;d<l.paintAttributes.length;d++){var p=l.paintAttributes[d];p.multiplier=p.multiplier||1;for(var m=0;m<t.childLayers.length;m++){var g=t.childLayers[m],v=n[g.id],y=p.name;f("a_"===p.name.slice(0,2));var x,b=p.name.slice(2);if(v.fragmentPragmas.initialize[b]="",g.isPaintValueFeatureConstant(p.paintProperty))v.uniforms.push(p),v.fragmentPragmas.define[b]=v.vertexPragmas.define[b]=["uniform",u,h,y].join(" ")+";",v.fragmentPragmas.initialize[b]=v.vertexPragmas.initialize[b]=[u,h,b,"=",y].join(" ")+";\n";else if(g.isPaintValueZoomConstant(p.paintProperty)){v.attributes.push(c.extend({},p,{name:y})),x=["varying",u,h,b].join(" ")+";\n";var _=[v.fragmentPragmas.define[b],"attribute",u,h,y].join(" ")+";\n";v.fragmentPragmas.define[b]=x,v.vertexPragmas.define[b]=x+_,v.vertexPragmas.initialize[b]=[b,"=",y,"/",p.multiplier.toFixed(1)].join(" ")+";\n"}else{for(var w="u_"+y.slice(2)+"_t",M=g.getPaintValueStopZoomLevels(p.paintProperty),A=0;A<M.length&&M[A]<t.zoom;)A++;for(var k=Math.max(0,Math.min(M.length-4,A-2)),T=[],E=0;E<4;E++)T.push(M[Math.min(k+E,M.length-1)]);x=["varying",u,h,b].join(" ")+";\n",v.vertexPragmas.define[b]=x+["uniform","lowp","float",w].join(" ")+";\n",v.fragmentPragmas.define[b]=x,v.uniforms.push(c.extend({},p,{name:w,getValue:o(p,k),components:1}));var S=p.components;if(1===S)v.attributes.push(c.extend({},p,{getValue:a(p,T),isFunction:!0,components:4*S})),v.vertexPragmas.define[b]+=["attribute",u,"vec4",y].join(" ")+";\n",v.vertexPragmas.initialize[b]=[b,"=","evaluate_zoom_function_1("+y+", "+w+")","/",p.multiplier.toFixed(1)].join(" ")+";\n";else{for(var L=[],C=0;C<4;C++)L.push(y+C),v.attributes.push(c.extend({},p,{getValue:a(p,[T[C]]),isFunction:!0,name:y+C})),v.vertexPragmas.define[b]+=["attribute",u,h,y+C].join(" ")+";\n";v.vertexPragmas.initialize[b]=[b," = ","evaluate_zoom_function_4("+L.join(", ")+", "+w+")","/",p.multiplier.toFixed(1)].join(" ")+";\n"}}}}}return e}function a(t,e){return function(r,n,i){if(1===e.length)return t.getValue(r,c.extend({},n,{zoom:e[0]}),i);for(var a=[],o=0;o<e.length;o++){var s=e[o];a.push(t.getValue(r,c.extend({},n,{zoom:s}),i)[0])}return a}}function o(t,e){return function(r,n){var i=r.getPaintInterpolationT(t.paintProperty,n.zoom);return[Math.max(0,Math.min(4,i-e))]}}var s=t("feature-filter"),l=t("./array_group"),u=t("./buffer_group"),c=t("../util/util"),h=t("../util/struct_array"),f=t("assert");e.exports=n,n.create=function(e){var r={fill:t("./bucket/fill_bucket"),line:t("./bucket/line_bucket"),circle:t("./bucket/circle_bucket"),symbol:t("./bucket/symbol_bucket")};return new r[e.layer.type](e)},n.EXTENT=8192,n.prototype.populateArrays=function(){this.createArrays(),this.recalculateStyleLayers();for(var t=0;t<this.features.length;t++)this.addFeature(this.features[t]);this.trimArrays()},n.prototype.prepareArrayGroup=function(t,e){var r=this.arrayGroups[t],n=r.length&&r[r.length-1];return n&&n.hasCapacityFor(e)||(n=new l({layoutVertexArrayType:this.programInterfaces[t].layoutVertexArrayType,elementArrayType:this.programInterfaces[t].elementArrayType,elementArrayType2:this.programInterfaces[t].elementArrayType2,paintVertexArrayTypes:this.paintVertexArrayTypes[t]}),n.index=r.length,r.push(n)),n},n.prototype.createArrays=function(){this.arrayGroups={},this.paintVertexArrayTypes={};for(var t in this.programInterfaces){this.arrayGroups[t]=[];var e=this.paintVertexArrayTypes[t]={},r=this.paintAttributes[t];for(var i in r)e[i]=new n.VertexArrayType(r[i].attributes)}},n.prototype.destroy=function(t){for(var e in this.bufferGroups)for(var r=this.bufferGroups[e],n=0;n<r.length;n++)r[n].destroy(t)},n.prototype.trimArrays=function(){for(var t in this.arrayGroups)for(var e=this.arrayGroups[t],r=0;r<e.length;r++)e[r].trim()},n.prototype.isEmpty=function(){for(var t in this.arrayGroups)for(var e=this.arrayGroups[t],r=0;r<e.length;r++)if(!e[r].isEmpty())return!1;return!0},n.prototype.getTransferables=function(t){for(var e in this.arrayGroups)for(var r=this.arrayGroups[e],n=0;n<r.length;n++)r[n].getTransferables(t)},n.prototype.setUniforms=function(t,e,r,n,i){for(var a=this.paintAttributes[e][n.id].uniforms,o=0;o<a.length;o++){var s=a[o],l=r[s.name];t["uniform"+s.components+"fv"](l,s.getValue(n,i))}},n.prototype.serialize=function(){return{layerId:this.layer.id,zoom:this.zoom,arrays:c.mapObject(this.arrayGroups,function(t){return t.map(function(t){return t.serialize()})}),paintVertexArrayTypes:c.mapObject(this.paintVertexArrayTypes,function(t){return c.mapObject(t,function(t){return t.serialize()})}),childLayerIds:this.childLayers.map(function(t){return t.id})}},n.prototype.createFilter=function(){this.filter||(this.filter=s(this.layer.filter))};var d={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0};n.prototype.recalculateStyleLayers=function(){for(var t=0;t<this.childLayers.length;t++)this.childLayers[t].recalculate(this.zoom,d)},n.prototype.populatePaintArrays=function(t,e,r,n,i){for(var a=0;a<this.childLayers.length;a++)for(var o=this.childLayers[a],s=this.arrayGroups[t],l=n.index;l<s.length;l++){var u=s[l],c=u.layoutVertexArray.length,h=u.paintVertexArrays[o.id];h.resize(c);for(var f=this.paintAttributes[t][o.id].attributes,d=0;d<f.length;d++)for(var p=f[d],m=p.getValue(o,e,r),g=p.multiplier||1,v=p.components||1,y=l===n.index?i:0,x=y;x<c;x++)for(var b=h.get(x),_=0;_<v;_++){var w=v>1?p.name+_:p.name;b[w]=m[_]*g}}},n.VertexArrayType=function(t){return new h({members:t,alignment:4})},n.ElementArrayType=function(t){return new h({members:[{type:"Uint16",name:"vertices",components:t||3}]})}},{"../util/struct_array":406,"../util/util":408,"./array_group":294,"./bucket/circle_bucket":296,"./bucket/fill_bucket":297,"./bucket/line_bucket":298,"./bucket/symbol_bucket":299,"./buffer_group":301,assert:36,"feature-filter":107}],296:[function(t,e,r){"use strict";function n(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=i.EXTENT;e.exports=n,n.prototype=a.inherit(i,{}),n.prototype.addCircleVertex=function(t,e,r,n,i){return t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)},n.prototype.programInterfaces={circle:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType,paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("circle-color",e,r)},multiplier:255,paintProperty:"circle-color"},{name:"a_radius",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-radius",e,r)]},multiplier:10,paintProperty:"circle-radius"},{name:"a_blur",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-blur",e,r)]},multiplier:10,paintProperty:"circle-blur"},{name:"a_opacity",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-opacity",e,r)]},multiplier:255,paintProperty:"circle-opacity"}]}},n.prototype.addFeature=function(t){for(var e={zoom:this.zoom},r=o(t),n=this.prepareArrayGroup("circle",0),i=n.layoutVertexArray.length,a=0;a<r.length;a++)for(var l=0;l<r[a].length;l++){var u=r[a][l].x,c=r[a][l].y;if(!(u<0||u>=s||c<0||c>=s)){var h=this.prepareArrayGroup("circle",4),f=h.layoutVertexArray,d=this.addCircleVertex(f,u,c,-1,-1);this.addCircleVertex(f,u,c,1,-1),this.addCircleVertex(f,u,c,1,1),this.addCircleVertex(f,u,c,-1,1),h.elementArray.emplaceBack(d,d+1,d+2),h.elementArray.emplaceBack(d,d+3,d+2)}}this.populatePaintArrays("circle",e,t.properties,n,i)}},{"../../util/util":408,"../bucket":295,"../load_geometry":303}],297:[function(t,e,r){"use strict";function n(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=t("earcut"),l=t("../../util/classify_rings"),u=500;e.exports=n,n.prototype=a.inherit(i,{}),n.prototype.programInterfaces={fill:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType(1),elementArrayType2:new i.ElementArrayType(2),paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("fill-color",e,r)},multiplier:255,paintProperty:"fill-color"},{name:"a_outline_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("fill-outline-color",e,r)},multiplier:255,paintProperty:"fill-outline-color"},{name:"a_opacity",components:1,type:"Uint8",getValue:function(t,e,r){return[t.getPaintValue("fill-opacity",e,r)]},multiplier:255,paintProperty:"fill-opacity"}]}},n.prototype.addFeature=function(t){for(var e=o(t),r=l(e,u),n=this.prepareArrayGroup("fill",0),i=n.layoutVertexArray.length,a=0;a<r.length;a++)this.addPolygon(r[a]);this.populatePaintArrays("fill",{zoom:this.zoom},t.properties,n,i)},n.prototype.addPolygon=function(t){for(var e=0,r=0;r<t.length;r++)e+=t[r].length;for(var n=this.prepareArrayGroup("fill",e),i=[],a=[],o=n.layoutVertexArray.length,l=0;l<t.length;l++){var u=t[l];l>0&&a.push(i.length/2);for(var c=0;c<u.length;c++){var h=u[c],f=n.layoutVertexArray.emplaceBack(h.x,h.y);c>=1&&n.elementArray2.emplaceBack(f-1,f),i.push(h.x),i.push(h.y)}}for(var d=s(i,a),p=0;p<d.length;p++)n.elementArray.emplaceBack(d[p]+o)}},{"../../util/classify_rings":396,"../../util/util":408,"../bucket":295,"../load_geometry":303,earcut:101}],298:[function(t,e,r){"use strict";function n(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=i.EXTENT,l=63,u=Math.cos(37.5*(Math.PI/180)),c=15,h=15,f=.5,d=Math.pow(2,h-1)/f;e.exports=n,n.prototype=a.inherit(i,{}),n.prototype.addLineVertex=function(t,e,r,n,i,a,o){return t.emplaceBack(e.x<<1|n,e.y<<1|i,Math.round(l*r.x)+128,Math.round(l*r.y)+128,(0===a?0:a<0?-1:1)+1|(o*f&63)<<2,o*f>>6)},n.prototype.programInterfaces={line:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}]),elementArrayType:new i.ElementArrayType}},n.prototype.addFeature=function(t){for(var e=o(t,h),r=0;r<e.length;r++)this.addLine(e[r],this.layer.layout["line-join"],this.layer.layout["line-cap"],this.layer.layout["line-miter-limit"],this.layer.layout["line-round-limit"])},n.prototype.addLine=function(t,e,r,n,i){for(var a=t.length;a>2&&t[a-1].equals(t[a-2]);)a--;if(!(t.length<2)){"bevel"===e&&(n=1.05);var o=c*(s/(512*this.overscaling)),l=t[0],h=t[a-1],f=l.equals(h);if(this.prepareArrayGroup("line",10*a),2!==a||!f){this.distance=0;var d,p,m,g,v,y,x,b=r,_=f?"butt":r,w=!0;this.e1=this.e2=this.e3=-1,f&&(d=t[a-2],v=l.sub(d)._unit()._perp());for(var M=0;M<a;M++)if(m=f&&M===a-1?t[1]:t[M+1],!m||!t[M].equals(m)){v&&(g=v),d&&(p=d),d=t[M],v=m?m.sub(d)._unit()._perp():g,g=g||v;var A=g.add(v)._unit(),k=A.x*v.x+A.y*v.y,T=1/k,E=k<u&&p&&m;if(E&&M>0){var S=d.dist(p);if(S>2*o){var L=d.sub(d.sub(p)._mult(o/S)._round());this.distance+=L.dist(p),this.addCurrentVertex(L,this.distance,g.mult(1),0,0,!1),p=L}}var C=p&&m,I=C?e:m?b:_;if(C&&"round"===I&&(T<i?I="miter":T<=2&&(I="fakeround")),"miter"===I&&T>n&&(I="bevel"),"bevel"===I&&(T>2&&(I="flipbevel"),T<n&&(I="miter")),p&&(this.distance+=d.dist(p)),"miter"===I)A._mult(T),this.addCurrentVertex(d,this.distance,A,0,0,!1);else if("flipbevel"===I){if(T>100)A=v.clone();else{var z=g.x*v.y-g.y*v.x>0?-1:1,D=T*g.add(v).mag()/g.sub(v).mag();A._perp()._mult(D*z)}this.addCurrentVertex(d,this.distance,A,0,0,!1),this.addCurrentVertex(d,this.distance,A.mult(-1),0,0,!1)}else if("bevel"===I||"fakeround"===I){var P=g.x*v.y-g.y*v.x>0,O=-Math.sqrt(T*T-1);if(P?(x=0,y=O):(y=0,x=O),w||this.addCurrentVertex(d,this.distance,g,y,x,!1),"fakeround"===I){for(var R,F=Math.floor(8*(.5-(k-.5))),j=0;j<F;j++)R=v.mult((j+1)/(F+1))._add(g)._unit(),this.addPieSliceVertex(d,this.distance,R,P);this.addPieSliceVertex(d,this.distance,A,P);for(var N=F-1;N>=0;N--)R=g.mult((N+1)/(F+1))._add(v)._unit(),this.addPieSliceVertex(d,this.distance,R,P)}m&&this.addCurrentVertex(d,this.distance,v,-y,-x,!1)}else"butt"===I?(w||this.addCurrentVertex(d,this.distance,g,0,0,!1),m&&this.addCurrentVertex(d,this.distance,v,0,0,!1)):"square"===I?(w||(this.addCurrentVertex(d,this.distance,g,1,1,!1),this.e1=this.e2=-1),m&&this.addCurrentVertex(d,this.distance,v,-1,-1,!1)):"round"===I&&(w||(this.addCurrentVertex(d,this.distance,g,0,0,!1),this.addCurrentVertex(d,this.distance,g,1,1,!0),this.e1=this.e2=-1),m&&(this.addCurrentVertex(d,this.distance,v,-1,-1,!0),this.addCurrentVertex(d,this.distance,v,0,0,!1)));if(E&&M<a-1){var B=d.dist(m);if(B>2*o){var U=d.add(m.sub(d)._mult(o/B)._round());this.distance+=U.dist(d),this.addCurrentVertex(U,this.distance,v.mult(1),0,0,!1),d=U}}w=!1}}}},n.prototype.addCurrentVertex=function(t,e,r,n,i,a){var o,s=a?1:0,l=this.arrayGroups.line[this.arrayGroups.line.length-1],u=l.layoutVertexArray,c=l.elementArray;o=r.clone(),n&&o._sub(r.perp()._mult(n)),this.e3=this.addLineVertex(u,t,o,s,0,n,e),this.e1>=0&&this.e2>=0&&c.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,o=r.mult(-1),i&&o._sub(r.perp()._mult(i)),this.e3=this.addLineVertex(u,t,o,s,1,-i,e),this.e1>=0&&this.e2>=0&&c.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,e>d/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,i,a))},n.prototype.addPieSliceVertex=function(t,e,r,n){var i=n?1:0;r=r.mult(n?-1:1);var a=this.arrayGroups.line[this.arrayGroups.line.length-1],o=a.layoutVertexArray,s=a.elementArray;this.e3=this.addLineVertex(o,t,r,0,i,0,e),this.e1>=0&&this.e2>=0&&s.emplaceBack(this.e1,this.e2,this.e3),n?this.e2=this.e3:this.e1=this.e3}},{"../../util/util":408,"../bucket":295,"../load_geometry":303}],299:[function(t,e,r){"use strict";function n(t){o.apply(this,arguments),this.showCollisionBoxes=t.showCollisionBoxes,this.overscaling=t.overscaling,this.collisionBoxArray=t.collisionBoxArray,this.symbolQuadsArray=t.symbolQuadsArray,this.symbolInstancesArray=t.symbolInstancesArray,this.sdfIcons=t.sdfIcons,this.iconsNeedLinear=t.iconsNeedLinear,this.adjustedTextSize=t.adjustedTextSize,this.adjustedIconSize=t.adjustedIconSize,this.fontstack=t.fontstack}function i(t,e,r,n,i,a,o,s,l,u,c){return t.emplaceBack(e,r,Math.round(64*n),Math.round(64*i),a/4,o/4,10*(u||0),c,10*(s||0),10*Math.min(l||25,25))}var a=t("point-geometry"),o=t("../bucket"),s=t("../../symbol/anchor"),l=t("../../symbol/get_anchors"),u=t("../../util/token"),c=t("../../symbol/quads"),h=t("../../symbol/shaping"),f=t("../../symbol/resolve_text"),d=t("../../symbol/mergelines"),p=t("../../symbol/clip_line"),m=t("../../util/util"),g=t("../load_geometry"),v=t("../../symbol/collision_feature"),y=h.shapeText,x=h.shapeIcon,b=c.getGlyphQuads,_=c.getIconQuads,w=o.EXTENT;e.exports=n,n.MAX_QUADS=65535,n.prototype=m.inherit(o,{}),n.prototype.serialize=function(){var t=o.prototype.serialize.apply(this);return t.sdfIcons=this.sdfIcons,t.iconsNeedLinear=this.iconsNeedLinear,t.adjustedTextSize=this.adjustedTextSize,t.adjustedIconSize=this.adjustedIconSize,t.fontstack=this.fontstack,t};var M=new o.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_offset",components:2,type:"Int16"},{name:"a_texture_pos",components:2,type:"Uint16"},{name:"a_data",components:4,type:"Uint8"}]),A=new o.ElementArrayType;n.prototype.addCollisionBoxVertex=function(t,e,r,n,i){return t.emplaceBack(e.x,e.y,Math.round(r.x),Math.round(r.y),10*n,10*i)},n.prototype.programInterfaces={glyph:{layoutVertexArrayType:M,elementArrayType:A},icon:{layoutVertexArrayType:M,elementArrayType:A},collisionBox:{layoutVertexArrayType:new o.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"},{name:"a_data",components:2,type:"Uint8"}])}},n.prototype.populateArrays=function(t,e,r){var n={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0};this.adjustedTextMaxSize=this.layer.getLayoutValue("text-size",{zoom:18,zoomHistory:n}),this.adjustedTextSize=this.layer.getLayoutValue("text-size",{zoom:this.zoom+1,zoomHistory:n}),this.adjustedIconMaxSize=this.layer.getLayoutValue("icon-size",{zoom:18,zoomHistory:n}),this.adjustedIconSize=this.layer.getLayoutValue("icon-size",{zoom:this.zoom+1,zoomHistory:n});var i=512*this.overscaling;this.tilePixelRatio=w/i,this.compareText={},this.iconsNeedLinear=!1,this.symbolInstancesStartIndex=this.symbolInstancesArray.length;var a=this.layer.layout,o=this.features,s=this.textFeatures,l=.5,c=.5;switch(a["text-anchor"]){case"right":case"top-right":case"bottom-right":l=1;break;case"left":case"top-left":case"bottom-left":l=0}switch(a["text-anchor"]){case"bottom":case"bottom-right":case"bottom-left":c=1;break;case"top":case"top-right":case"top-left":c=0}for(var h="right"===a["text-justify"]?1:"left"===a["text-justify"]?0:.5,f=24,p=a["text-line-height"]*f,v="line"!==a["symbol-placement"]?a["text-max-width"]*f:0,b=a["text-letter-spacing"]*f,_=[a["text-offset"][0]*f,a["text-offset"][1]*f],M=this.fontstack=a["text-font"].join(","),A=[],k=0;k<o.length;k++)A.push(g(o[k]));if("line"===a["symbol-placement"]){var T=d(o,s,A);A=T.geometries,o=T.features,s=T.textFeatures}for(var E,S,L=0;L<o.length;L++)if(A[L]){if(E=s[L]?y(s[L],e[M],v,p,l,c,h,b,_):null,a["icon-image"]){var C=u(o[L].properties,a["icon-image"]),I=r[C];S=x(I,a),I&&(void 0===this.sdfIcons?this.sdfIcons=I.sdf:this.sdfIcons!==I.sdf&&m.warnOnce("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),1!==I.pixelRatio?this.iconsNeedLinear=!0:0===a["icon-rotate"]&&this.layer.isLayoutValueFeatureConstant("icon-rotate")||(this.iconsNeedLinear=!0))}else S=null;(E||S)&&this.addFeature(A[L],E,S,o[L])}this.symbolInstancesEndIndex=this.symbolInstancesArray.length,this.placeFeatures(t,this.showCollisionBoxes),this.trimArrays()},n.prototype.addFeature=function(t,e,r,n){var i=this.layer.layout,a=24,o=this.adjustedTextSize/a,u=void 0!==this.adjustedTextMaxSize?this.adjustedTextMaxSize:this.adjustedTextSize,c=this.tilePixelRatio*o,h=this.tilePixelRatio*u/a,f=this.tilePixelRatio*this.adjustedIconSize,d=this.tilePixelRatio*i["symbol-spacing"],m=i["symbol-avoid-edges"],g=i["text-padding"]*this.tilePixelRatio,v=i["icon-padding"]*this.tilePixelRatio,y=i["text-max-angle"]/180*Math.PI,x="map"===i["text-rotation-alignment"]&&"line"===i["symbol-placement"],b="map"===i["icon-rotation-alignment"]&&"line"===i["symbol-placement"],_=i["text-allow-overlap"]||i["icon-allow-overlap"]||i["text-ignore-placement"]||i["icon-ignore-placement"],M="line"===i["symbol-placement"],A=d/2;M&&(t=p(t,0,0,w,w));for(var k=0;k<t.length;k++){var T,E=t[k];T=M?l(E,d,y,e,r,a,h,this.overscaling,w):[new s(E[0].x,E[0].y,0)];for(var S=0,L=T.length;S<L;S++){var C=T[S];if(!(e&&M&&this.anchorIsTooClose(e.text,A,C))){var I=!(C.x<0||C.x>w||C.y<0||C.y>w);if(!m||I){var z=I||_;this.addSymbolInstance(C,E,e,r,this.layer,z,this.symbolInstancesArray.length,this.collisionBoxArray,n.index,this.sourceLayerIndex,this.index,c,g,x,f,v,b,{zoom:this.zoom},n.properties)}}}}},n.prototype.anchorIsTooClose=function(t,e,r){var n=this.compareText;if(t in n){for(var i=n[t],a=i.length-1;a>=0;a--)if(r.dist(i[a])<e)return!0}else n[t]=[];return n[t].push(r),!1},n.prototype.placeFeatures=function(t,e){this.recalculateStyleLayers(),this.createArrays();var r=this.layer.layout,n=t.maxScale,i="map"===r["text-rotation-alignment"]&&"line"===r["symbol-placement"],a="map"===r["icon-rotation-alignment"]&&"line"===r["symbol-placement"],o=r["text-allow-overlap"]||r["icon-allow-overlap"]||r["text-ignore-placement"]||r["icon-ignore-placement"];if(o){var s=this.symbolInstancesArray.toArray(this.symbolInstancesStartIndex,this.symbolInstancesEndIndex),l=t.angle,u=Math.sin(l),c=Math.cos(l);this.sortedSymbolInstances=s.sort(function(t,e){var r=u*t.anchorPointX+c*t.anchorPointY|0,n=u*e.anchorPointX+c*e.anchorPointY|0;return r-n||e.index-t.index})}for(var h=this.symbolInstancesStartIndex;h<this.symbolInstancesEndIndex;h++){var f=this.sortedSymbolInstances?this.sortedSymbolInstances[h-this.symbolInstancesStartIndex]:this.symbolInstancesArray.get(h),d={boxStartIndex:f.textBoxStartIndex,boxEndIndex:f.textBoxEndIndex},p={boxStartIndex:f.iconBoxStartIndex,boxEndIndex:f.iconBoxEndIndex},m=!(f.textBoxStartIndex===f.textBoxEndIndex),g=!(f.iconBoxStartIndex===f.iconBoxEndIndex),v=r["text-optional"]||!m,y=r["icon-optional"]||!g,x=m?t.placeCollisionFeature(d,r["text-allow-overlap"],r["symbol-avoid-edges"]):t.minScale,b=g?t.placeCollisionFeature(p,r["icon-allow-overlap"],r["symbol-avoid-edges"]):t.minScale;v||y?!y&&x?x=Math.max(b,x):!v&&b&&(b=Math.max(b,x)):b=x=Math.max(b,x),m&&(t.insertCollisionFeature(d,x,r["text-ignore-placement"]),x<=n&&this.addSymbols("glyph",f.glyphQuadStartIndex,f.glyphQuadEndIndex,x,r["text-keep-upright"],i,t.angle)),g&&(t.insertCollisionFeature(p,b,r["icon-ignore-placement"]),b<=n&&this.addSymbols("icon",f.iconQuadStartIndex,f.iconQuadEndIndex,b,r["icon-keep-upright"],a,t.angle))}e&&this.addToDebugBuffers(t)},n.prototype.addSymbols=function(t,e,r,n,a,o,s){for(var l=this.prepareArrayGroup(t,4*(r-e)),u=l.elementArray,c=l.layoutVertexArray,h=this.zoom,f=Math.max(Math.log(n)/Math.LN2+h,0),d=e;d<r;d++){var p=this.symbolQuadsArray.get(d).SymbolQuad,m=(p.anchorAngle+s+Math.PI)%(2*Math.PI);if(!(a&&o&&(m<=Math.PI/2||m>3*Math.PI/2))){var g=p.tl,v=p.tr,y=p.bl,x=p.br,b=p.tex,_=p.anchorPoint,w=Math.max(h+Math.log(p.minScale)/Math.LN2,f),M=Math.min(h+Math.log(p.maxScale)/Math.LN2,25);if(!(M<=w)){w===f&&(w=0);var A=Math.round(p.glyphAngle/(2*Math.PI)*256),k=i(c,_.x,_.y,g.x,g.y,b.x,b.y,w,M,f,A);i(c,_.x,_.y,v.x,v.y,b.x+b.w,b.y,w,M,f,A),i(c,_.x,_.y,y.x,y.y,b.x,b.y+b.h,w,M,f,A),i(c,_.x,_.y,x.x,x.y,b.x+b.w,b.y+b.h,w,M,f,A),u.emplaceBack(k,k+1,k+2),u.emplaceBack(k+1,k+2,k+3)}}}},n.prototype.updateIcons=function(t){this.recalculateStyleLayers();var e=this.layer.layout["icon-image"];if(e)for(var r=0;r<this.features.length;r++){var n=u(this.features[r].properties,e);n&&(t[n]=!0)}},n.prototype.updateFont=function(t){this.recalculateStyleLayers();var e=this.layer.layout["text-font"],r=t[e]=t[e]||{};this.textFeatures=f(this.features,this.layer.layout,r)},n.prototype.addToDebugBuffers=function(t){for(var e=this.prepareArrayGroup("collisionBox",0),r=e.layoutVertexArray,n=-t.angle,i=t.yStretch,o=this.symbolInstancesStartIndex;o<this.symbolInstancesEndIndex;o++){var s=this.symbolInstancesArray.get(o);s.textCollisionFeature={boxStartIndex:s.textBoxStartIndex,boxEndIndex:s.textBoxEndIndex},s.iconCollisionFeature={boxStartIndex:s.iconBoxStartIndex,boxEndIndex:s.iconBoxEndIndex};for(var l=0;l<2;l++){var u=s[0===l?"textCollisionFeature":"iconCollisionFeature"];if(u)for(var c=u.boxStartIndex;c<u.boxEndIndex;c++){var h=this.collisionBoxArray.get(c),f=h.anchorPoint,d=new a(h.x1,h.y1*i)._rotate(n),p=new a(h.x2,h.y1*i)._rotate(n),m=new a(h.x1,h.y2*i)._rotate(n),g=new a(h.x2,h.y2*i)._rotate(n),v=Math.max(0,Math.min(25,this.zoom+Math.log(h.maxScale)/Math.LN2)),y=Math.max(0,Math.min(25,this.zoom+Math.log(h.placementScale)/Math.LN2));this.addCollisionBoxVertex(r,f,d,v,y),this.addCollisionBoxVertex(r,f,p,v,y),this.addCollisionBoxVertex(r,f,p,v,y),this.addCollisionBoxVertex(r,f,g,v,y),this.addCollisionBoxVertex(r,f,g,v,y),this.addCollisionBoxVertex(r,f,m,v,y),this.addCollisionBoxVertex(r,f,m,v,y),this.addCollisionBoxVertex(r,f,d,v,y)}}}},n.prototype.addSymbolInstance=function(t,e,r,i,a,o,s,l,u,c,h,f,d,p,g,y,x,w,M){var A,k,T,E,S,L,C,I;if(r&&(C=o?b(t,r,f,e,a,p):[],S=new v(l,e,t,u,c,h,r,f,d,p,!1)),A=this.symbolQuadsArray.length,C&&C.length)for(var z=0;z<C.length;z++)this.addSymbolQuad(C[z]);k=this.symbolQuadsArray.length;var D=S?S.boxStartIndex:this.collisionBoxArray.length,P=S?S.boxEndIndex:this.collisionBoxArray.length;i&&(I=o?_(t,i,g,e,a,x,r,w,M):[],L=new v(l,e,t,u,c,h,i,g,y,x,!0)),T=this.symbolQuadsArray.length,I&&1===I.length&&this.addSymbolQuad(I[0]),E=this.symbolQuadsArray.length;var O=L?L.boxStartIndex:this.collisionBoxArray.length,R=L?L.boxEndIndex:this.collisionBoxArray.length;return E>n.MAX_QUADS&&m.warnOnce("Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),k>n.MAX_QUADS&&m.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),this.symbolInstancesArray.emplaceBack(D,P,O,R,A,k,T,E,t.x,t.y,s)},n.prototype.addSymbolQuad=function(t){return this.symbolQuadsArray.emplaceBack(t.anchorPoint.x,t.anchorPoint.y,t.tl.x,t.tl.y,t.tr.x,t.tr.y,t.bl.x,t.bl.y,t.br.x,t.br.y,t.tex.h,t.tex.w,t.tex.x,t.tex.y,t.anchorAngle,t.glyphAngle,t.maxScale,t.minScale)}},{"../../symbol/anchor":357,"../../symbol/clip_line":359,"../../symbol/collision_feature":361,"../../symbol/get_anchors":363,"../../symbol/mergelines":366,"../../symbol/quads":367,"../../symbol/resolve_text":368,"../../symbol/shaping":369,"../../util/token":407,"../../util/util":408,"../bucket":295,"../load_geometry":303,"point-geometry":448}],300:[function(t,e,r){"use strict";function n(t,e,r){this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.attributes=e.members,this.itemSize=e.bytesPerElement,this.type=r,this.arrayType=e}e.exports=n,n.prototype.bind=function(t){var e=t[this.type];this.buffer?t.bindBuffer(e,this.buffer):(this.buffer=t.createBuffer(),t.bindBuffer(e,this.buffer),t.bufferData(e,this.arrayBuffer,t.STATIC_DRAW),this.arrayBuffer=null)};var i={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT"};n.prototype.setVertexAttribPointers=function(t,e){for(var r=0;r<this.attributes.length;r++){var n=this.attributes[r],a=e[n.name];void 0!==a&&t.vertexAttribPointer(a,n.components,t[i[n.type]],!1,this.arrayType.bytesPerElement,n.offset)}},n.prototype.destroy=function(t){this.buffer&&t.deleteBuffer(this.buffer)},n.BufferType={VERTEX:"ARRAY_BUFFER",ELEMENT:"ELEMENT_ARRAY_BUFFER"}},{}],301:[function(t,e,r){"use strict";function n(t,e){this.layoutVertexBuffer=new a(t.layoutVertexArray,e.layoutVertexArrayType,a.BufferType.VERTEX),t.elementArray&&(this.elementBuffer=new a(t.elementArray,e.elementArrayType,a.BufferType.ELEMENT));var r,n=this.vaos={};t.elementArray2&&(this.elementBuffer2=new a(t.elementArray2,e.elementArrayType2,a.BufferType.ELEMENT),r=this.secondVaos={}),this.paintVertexBuffers=i.mapObject(t.paintVertexArrays,function(i,s){return n[s]=new o,t.elementArray2&&(r[s]=new o),new a(i,e.paintVertexArrayTypes[s],a.BufferType.VERTEX)})}var i=t("../util/util"),a=t("./buffer"),o=t("../render/vertex_array_object");e.exports=n,n.prototype.destroy=function(t){this.layoutVertexBuffer.destroy(t),this.elementBuffer&&this.elementBuffer.destroy(t),this.elementBuffer2&&this.elementBuffer2.destroy(t);for(var e in this.paintVertexBuffers)this.paintVertexBuffers[e].destroy(t);for(var r in this.vaos)this.vaos[r].destroy(t);for(var n in this.secondVaos)this.secondVaos[n].destroy(t)}},{"../render/vertex_array_object":323,"../util/util":408,"./buffer":300}],302:[function(t,e,r){"use strict";function n(t,e,r){if(t.grid){var n=t,i=e;t=n.coord,e=n.overscaling,this.grid=new p(n.grid),this.featureIndexArray=new A(n.featureIndexArray),this.rawTileData=i,this.bucketLayerIDs=n.bucketLayerIDs}else this.grid=new p(h,16,0),this.featureIndexArray=new A;this.coord=t,this.overscaling=e,this.x=t.x,this.y=t.y,this.z=t.z-Math.log(e)/Math.LN2,this.setCollisionTile(r)}function i(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function a(t,e){return e-t}function o(t){return t["line-gap-width"]>0?t["line-gap-width"]+2*t["line-width"]:t["line-width"]}function s(t,e,r,n,i){if(!e[0]&&!e[1])return t;e=u.convert(e),"viewport"===r&&e._rotate(-n);for(var a=[],o=0;o<t.length;o++){for(var s=t[o],l=[],c=0;c<s.length;c++)l.push(s[c].sub(e._mult(i)));a.push(l)}return a}function l(t,e){for(var r=[],n=new u(0,0),i=0;i<t.length;i++){for(var a=t[i],o=[],s=0;s<a.length;s++){var l=a[s-1],c=a[s],h=a[s+1],f=0===s?n:c.sub(l)._unit()._perp(),d=s===a.length-1?n:h.sub(c)._unit()._perp(),p=f._add(d)._unit(),m=p.x*d.x+p.y*d.y;p._mult(1/m),o.push(p._mult(e)._add(c))}r.push(o)}return r}var u=t("point-geometry"),c=t("./load_geometry"),h=t("./bucket").EXTENT,f=t("feature-filter"),d=t("../util/struct_array"),p=t("grid-index"),m=t("../util/dictionary_coder"),g=t("vector-tile"),v=t("pbf"),y=t("../util/vectortile_to_geojson"),x=t("../util/util").arraysIntersect,b=t("../util/intersection_tests"),_=b.multiPolygonIntersectsBufferedMultiPoint,w=b.multiPolygonIntersectsMultiPolygon,M=b.multiPolygonIntersectsBufferedMultiLine,A=new d({members:[{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]});e.exports=n,n.prototype.insert=function(t,e,r,n){var i=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(e,r,n);for(var a=c(t),o=0;o<a.length;o++){for(var s=a[o],l=[1/0,1/0,-(1/0),-(1/0)],u=0;u<s.length;u++){var h=s[u];l[0]=Math.min(l[0],h.x),l[1]=Math.min(l[1],h.y),l[2]=Math.max(l[2],h.x),l[3]=Math.max(l[3],h.y)}this.grid.insert(i,l[0],l[1],l[2],l[3])}},n.prototype.setCollisionTile=function(t){this.collisionTile=t},n.prototype.serialize=function(){var t={coord:this.coord,overscaling:this.overscaling,grid:this.grid.toArrayBuffer(),featureIndexArray:this.featureIndexArray.serialize(),bucketLayerIDs:this.bucketLayerIDs};return{data:t,transferables:[t.grid,t.featureIndexArray.arrayBuffer]}},n.prototype.query=function(t,e){this.vtLayers||(this.vtLayers=new g.VectorTile(new v(new Uint8Array(this.rawTileData))).layers,this.sourceLayerCoder=new m(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]));var r={},n=t.params||{},s=h/t.tileSize/t.scale,l=f(n.filter),c=0;for(var d in e){var p=e[d],y=p.paint,x=0;"line"===p.type?x=o(y)/2+Math.abs(y["line-offset"])+i(y["line-translate"]):"fill"===p.type?x=i(y["fill-translate"]):"circle"===p.type&&(x=y["circle-radius"]+i(y["circle-translate"])),c=Math.max(c,x*s)}for(var b=t.queryGeometry.map(function(t){return t.map(function(t){return new u(t.x,t.y)})}),_=1/0,w=1/0,M=-(1/0),A=-(1/0),k=0;k<b.length;k++)for(var T=b[k],E=0;E<T.length;E++){var S=T[E];_=Math.min(_,S.x),w=Math.min(w,S.y),M=Math.max(M,S.x),A=Math.max(A,S.y)}var L=this.grid.query(_-c,w-c,M+c,A+c);L.sort(a),this.filterMatching(r,L,this.featureIndexArray,b,l,n.layers,e,t.bearing,s);var C=this.collisionTile.queryRenderedSymbols(_,w,M,A,t.scale);return C.sort(),this.filterMatching(r,C,this.collisionTile.collisionBoxArray,b,l,n.layers,e,t.bearing,s),r},n.prototype.filterMatching=function(t,e,r,n,i,a,u,h,f){for(var d,p=0;p<e.length;p++){var m=e[p];if(m!==d){d=m;var g=r.get(m),v=this.bucketLayerIDs[g.bucketIndex];if(!a||x(a,v)){var b=this.sourceLayerCoder.decode(g.sourceLayerIndex),A=this.vtLayers[b],k=A.feature(g.featureIndex);if(i(k))for(var T=null,E=0;E<v.length;E++){var S=v[E];if(!(a&&a.indexOf(S)<0)){var L=u[S];if(L){var C;if("symbol"!==L.type){T||(T=c(k));var I=L.paint;if("line"===L.type){C=s(n,I["line-translate"],I["line-translate-anchor"],h,f);var z=o(I)/2*f;if(I["line-offset"]&&(T=l(T,I["line-offset"]*f)),!M(C,T,z))continue}else if("fill"===L.type){if(C=s(n,I["fill-translate"],I["fill-translate-anchor"],h,f),!w(C,T))continue}else if("circle"===L.type){C=s(n,I["circle-translate"],I["circle-translate-anchor"],h,f);var D=I["circle-radius"]*f;if(!_(C,T,D))continue}}var P=new y(k,this.z,this.x,this.y);P.layer=L.serialize({includeRefProperties:!0});var O=t[S];void 0===O&&(O=t[S]=[]),O.push(P)}}}}}}}},{"../util/dictionary_coder":398,"../util/intersection_tests":403,"../util/struct_array":406,"../util/util":408,"../util/vectortile_to_geojson":409,"./bucket":295,"./load_geometry":303,"feature-filter":107,"grid-index":257,pbf:442,"point-geometry":448,"vector-tile":511}],303:[function(t,e,r){"use strict";function n(t){return{min:-1*Math.pow(2,t-1),max:Math.pow(2,t-1)-1}}var i=t("../util/util"),a=t("./bucket").EXTENT,o=t("assert"),s={15:n(15),16:n(16)};e.exports=function(t,e){var r=s[e||16];o(r);for(var n=a/t.extent,l=t.loadGeometry(),u=0;u<l.length;u++)for(var c=l[u],h=0;h<c.length;h++){var f=c[h];f.x=Math.round(f.x*n),f.y=Math.round(f.y*n),(f.x<r.min||f.x>r.max||f.y<r.min||f.y>r.max)&&i.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return l}},{"../util/util":408,"./bucket":295,assert:36}],304:[function(t,e,r){"use strict";function n(t,e,r){this.column=t,this.row=e,this.zoom=r}e.exports=n,n.prototype={clone:function(){return new n(this.column,this.row,this.zoom)},zoomTo:function(t){return this.clone()._zoomTo(t)},sub:function(t){return this.clone()._sub(t)},_zoomTo:function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this},_sub:function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this}}},{}],305:[function(t,e,r){"use strict";function n(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}e.exports=n;var i=t("../util/util").wrap;n.prototype.wrap=function(){return new n(i(this.lng,-180,180),this.lat)},n.prototype.toArray=function(){return[this.lng,this.lat]},n.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{"../util/util":408}],306:[function(t,e,r){"use strict";function n(t,e){t&&(e?this.extend(t).extend(e):4===t.length?this.extend([t[0],t[1]]).extend([t[2],t[3]]):this.extend(t[0]).extend(t[1]))}e.exports=n;var i=t("./lng_lat");n.prototype={extend:function(t){var e,r,a=this._sw,o=this._ne;if(t instanceof i)e=t,r=t;else{if(!(t instanceof n))return t?this.extend(i.convert(t)||n.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return a||o?(a.lng=Math.min(e.lng,a.lng),a.lat=Math.min(e.lat,a.lat),o.lng=Math.max(r.lng,o.lng),o.lat=Math.max(r.lat,o.lat)):(this._sw=new i(e.lng,e.lat),this._ne=new i(r.lng,r.lat)),this},getCenter:function(){return new i((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},getSouthWest:function(){return this._sw},getNorthEast:function(){return this._ne},getNorthWest:function(){return new i(this.getWest(),this.getNorth())},getSouthEast:function(){return new i(this.getEast(),this.getSouth())},getWest:function(){return this._sw.lng},getSouth:function(){return this._sw.lat},getEast:function(){return this._ne.lng},getNorth:function(){return this._ne.lat},toArray:function(){return[this._sw.toArray(),this._ne.toArray()]},toString:function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"}},n.convert=function(t){return!t||t instanceof n?t:new n(t)}},{"./lng_lat":305}],307:[function(t,e,r){"use strict";function n(t,e){this.tileSize=512,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new i(0,0),this.zoom=0,this.angle=0,this._altitude=1.5,this._pitch=0,this._unmodified=!0}var i=t("./lng_lat"),a=t("point-geometry"),o=t("./coordinate"),s=t("../util/util").wrap,l=t("../util/interpolate"),u=t("../source/tile_coord"),c=t("../data/bucket").EXTENT,h=t("gl-matrix"),f=h.vec4,d=h.mat4,p=h.mat2;e.exports=n,n.prototype={get minZoom(){return this._minZoom},set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},get maxZoom(){return this._maxZoom},set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},get worldSize(){return this.tileSize*this.scale},get centerPoint(){return this.size._div(2)},get size(){return new a(this.width,this.height)},get bearing(){return-this.angle/Math.PI*180},set bearing(t){var e=-s(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=p.create(),p.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},get pitch(){return this._pitch/Math.PI*180},set pitch(t){var e=Math.min(60,t)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},get altitude(){return this._altitude},set altitude(t){var e=Math.max(.75,t);this._altitude!==e&&(this._unmodified=!1,this._altitude=e,this._calcMatrices())},get zoom(){return this._zoom},set zoom(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._calcMatrices(),this._constrain())},get center(){return this._center},set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._calcMatrices(),this._constrain())},coveringZoomLevel:function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},coveringTiles:function(t){var e=this.coveringZoomLevel(t),r=e;if(e<t.minzoom)return[];e>t.maxzoom&&(e=t.maxzoom);var n=this,i=n.locationCoordinate(n.center)._zoomTo(e),o=new a(i.column-.5,i.row-.5);return u.cover(e,[n.pointCoordinate(new a(0,0))._zoomTo(e),n.pointCoordinate(new a(n.width,0))._zoomTo(e),n.pointCoordinate(new a(n.width,n.height))._zoomTo(e),n.pointCoordinate(new a(0,n.height))._zoomTo(e)],t.reparseOverscaled?r:e).sort(function(t,e){return o.dist(t)-o.dist(e)})},resize:function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._calcMatrices(),this._constrain()},get unmodified(){return this._unmodified},zoomScale:function(t){return Math.pow(2,t)},scaleZoom:function(t){return Math.log(t)/Math.LN2},project:function(t,e){return new a(this.lngX(t.lng,e),this.latY(t.lat,e))},unproject:function(t,e){return new i(this.xLng(t.x,e),this.yLat(t.y,e))},get x(){return this.lngX(this.center.lng)},get y(){return this.latY(this.center.lat)},get point(){return new a(this.x,this.y)},lngX:function(t,e){return(180+t)*(e||this.worldSize)/360},latY:function(t,e){var r=180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360));return(180-r)*(e||this.worldSize)/360},xLng:function(t,e){return 360*t/(e||this.worldSize)-180},yLat:function(t,e){var r=180-360*t/(e||this.worldSize);return 360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90},panBy:function(t){var e=this.centerPoint._add(t);this.center=this.pointLocation(e)},setLocationAtPoint:function(t,e){var r=this.locationCoordinate(t),n=this.pointCoordinate(e),i=this.pointCoordinate(this.centerPoint),a=n._sub(r);this._unmodified=!1,this.center=this.coordinateLocation(i._sub(a))},locationPoint:function(t){return this.coordinatePoint(this.locationCoordinate(t))},pointLocation:function(t){return this.coordinateLocation(this.pointCoordinate(t))},locationCoordinate:function(t){var e=this.zoomScale(this.tileZoom)/this.worldSize,r=i.convert(t);return new o(this.lngX(r.lng)*e,this.latY(r.lat)*e,this.tileZoom)},coordinateLocation:function(t){var e=this.zoomScale(t.zoom);return new i(this.xLng(t.column,e),this.yLat(t.row,e))},pointCoordinate:function(t){var e=0,r=[t.x,t.y,0,1],n=[t.x,t.y,1,1];f.transformMat4(r,r,this.pixelMatrixInverse),f.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],a=n[3],s=r[0]/i,u=n[0]/a,c=r[1]/i,h=n[1]/a,d=r[2]/i,p=n[2]/a,m=d===p?0:(e-d)/(p-d),g=this.worldSize/this.zoomScale(this.tileZoom);return new o(l(s,u,m)/g,l(c,h,m)/g,this.tileZoom)},coordinatePoint:function(t){var e=this.worldSize/this.zoomScale(t.zoom),r=[t.column*e,t.row*e,0,1];return f.transformMat4(r,r,this.pixelMatrix),new a(r[0]/r[3],r[1]/r[3])},calculatePosMatrix:function(t,e){void 0===e&&(e=1/0),t instanceof u&&(t=t.toCoordinate(e));var r=Math.min(t.zoom,e),n=this.worldSize/Math.pow(2,r),i=new Float64Array(16);return d.identity(i),d.translate(i,i,[t.column*n,t.row*n,0]),d.scale(i,i,[n/c,n/c,1]),d.multiply(i,this.projMatrix,i),new Float32Array(i)},_constrain:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,n,i,o,s,l,u=this.size,c=this._unmodified;this.latRange&&(t=this.latY(this.latRange[1]),e=this.latY(this.latRange[0]),i=e-t<u.y?u.y/(e-t):0),this.lngRange&&(r=this.lngX(this.lngRange[0]),n=this.lngX(this.lngRange[1]),o=n-r<u.x?u.x/(n-r):0);var h=Math.max(o||0,i||0);if(h)return this.center=this.unproject(new a(o?(n+r)/2:this.x,i?(e+t)/2:this.y)),this.zoom+=this.scaleZoom(h),this._unmodified=c,void(this._constraining=!1);if(this.latRange){var f=this.y,d=u.y/2;f-d<t&&(l=t+d),f+d>e&&(l=e-d)}if(this.lngRange){var p=this.x,m=u.x/2;p-m<r&&(s=r+m),p+m>n&&(s=n-m)}void 0===s&&void 0===l||(this.center=this.unproject(new a(void 0!==s?s:this.x,void 0!==l?l:this.y))),this._unmodified=c,this._constraining=!1}},_calcMatrices:function(){if(this.height){var t=Math.atan(.5/this.altitude),e=Math.sin(t)*this.altitude/Math.sin(Math.PI/2-this._pitch-t),r=Math.cos(Math.PI/2-this._pitch)*e+this.altitude,n=new Float64Array(16);if(d.perspective(n,2*Math.atan(this.height/2/this.altitude),this.width/this.height,.1,r),d.translate(n,n,[0,0,-this.altitude]),d.scale(n,n,[1,-1,1/this.height]),d.rotateX(n,n,this._pitch),d.rotateZ(n,n,this.angle),d.translate(n,n,[-this.x,-this.y,0]),this.projMatrix=n,n=d.create(),d.scale(n,n,[this.width/2,-this.height/2,1]),d.translate(n,n,[1,-1,0]),this.pixelMatrix=d.multiply(new Float64Array(16),n,this.projMatrix),n=d.invert(new Float64Array(16),this.pixelMatrix),!n)throw new Error("failed to invert matrix");this.pixelMatrixInverse=n}}}},{"../data/bucket":295,"../source/tile_coord":335,"../util/interpolate":402,"../util/util":408,"./coordinate":304,"./lng_lat":305,"gl-matrix":166,"point-geometry":448}],308:[function(t,e,r){"use strict";var n={" ":[16,[]],"!":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'"':[16,[4,21,4,14,-1,-1,12,21,12,14]],"#":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],"%":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],"&":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],"'":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],"(":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],")":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],"*":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],"+":[26,[13,18,13,0,-1,-1,4,9,22,9]],",":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"-":[26,[4,9,22,9]],".":[10,[5,2,4,1,5,0,6,1,5,2]],"/":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],":":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],";":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"<":[24,[20,18,4,9,20,0]],"=":[26,[4,12,22,12,-1,-1,4,6,22,6]],">":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]};e.exports=function(t,e,r,i){i=i||1;var a,o,s,l,u,c,h,f,d=[];for(a=0,o=t.length;a<o;a++)if(u=n[t[a]]){for(f=null,s=0,l=u[1].length;s<l;s+=2)u[1][s]===-1&&u[1][s+1]===-1?f=null:(c=e+u[1][s]*i,h=r-u[1][s+1]*i,f&&d.push(f.x,f.y,c,h),f={x:c,y:h});e+=u[0]*i}return d}},{}],309:[function(t,e,r){"use strict";var n=e.exports={};n.version=t("../package.json").version,n.Map=t("./ui/map"),n.Control=t("./ui/control/control"),n.Navigation=t("./ui/control/navigation"),n.Geolocate=t("./ui/control/geolocate"),n.Attribution=t("./ui/control/attribution"),n.Popup=t("./ui/popup"),n.Marker=t("./ui/marker"),n.Style=t("./style/style"),n.LngLat=t("./geo/lng_lat"),n.LngLatBounds=t("./geo/lng_lat_bounds"),n.Point=t("point-geometry"),n.Evented=t("./util/evented"),n.util=t("./util/util"),n.supported=t("./util/browser").supported;var i=t("./util/ajax");n.util.getJSON=i.getJSON,n.util.getArrayBuffer=i.getArrayBuffer;var a=t("./util/config");n.config=a,Object.defineProperty(n,"accessToken",{get:function(){return a.ACCESS_TOKEN},set:function(t){a.ACCESS_TOKEN=t}})},{"../package.json":410,"./geo/lng_lat":305,"./geo/lng_lat_bounds":306,"./style/style":344,"./ui/control/attribution":375,"./ui/control/control":376,"./ui/control/geolocate":377,"./ui/control/navigation":378,"./ui/map":387,"./ui/marker":388,"./ui/popup":389,"./util/ajax":391,"./util/browser":392,"./util/config":397,"./util/evented":400,"./util/util":408,"point-geometry":448}],310:[function(t,e,r){"use strict";var n=t("assert");e.exports=function(t){for(var e={define:{},initialize:{}},r=0;r<t.length;r++){var i=t[r];n("u_"===i.name.slice(0,2));var a="{precision} "+(1===i.components?"float":"vec"+i.components);e.define[i.name.slice(2)]="uniform "+a+" "+i.name+";\n",e.initialize[i.name.slice(2)]=a+" "+i.name.slice(2)+" = "+i.name+";\n"}return e}},{assert:36}],311:[function(t,e,r){"use strict";function n(t,e,r){var n,s=t.gl,l=t.transform,u=r.paint["background-color"],c=r.paint["background-pattern"],h=r.paint["background-opacity"],f=c?t.spriteAtlas.getPosition(c.from,!0):null,d=c?t.spriteAtlas.getPosition(c.to,!0):null;if(t.setDepthSublayer(0),f&&d){if(t.isOpaquePass)return;n=t.useProgram("pattern"),s.uniform1i(n.u_image,0),s.uniform2fv(n.u_pattern_tl_a,f.tl),s.uniform2fv(n.u_pattern_br_a,f.br),s.uniform2fv(n.u_pattern_tl_b,d.tl),s.uniform2fv(n.u_pattern_br_b,d.br),s.uniform1f(n.u_opacity,h),s.uniform1f(n.u_mix,c.t),s.uniform2fv(n.u_pattern_size_a,f.size),s.uniform2fv(n.u_pattern_size_b,d.size),s.uniform1f(n.u_scale_a,c.fromScale),s.uniform1f(n.u_scale_b,c.toScale),s.activeTexture(s.TEXTURE0),t.spriteAtlas.bind(s,!0),t.tileExtentPatternVAO.bind(s,n,t.tileExtentBuffer)}else{if(t.isOpaquePass!==(1===u[3]))return;var p=a([{name:"u_color",components:4},{name:"u_opacity",components:1}]);n=t.useProgram("fill",[],p,p),s.uniform4fv(n.u_color,u),s.uniform1f(n.u_opacity,h),t.tileExtentVAO.bind(s,n,t.tileExtentBuffer)}s.disable(s.STENCIL_TEST);for(var m=l.coveringTiles({tileSize:o}),g=0;g<m.length;g++){var v=m[g];if(f&&d){var y={coord:v,tileSize:o};s.uniform1f(n.u_tile_units_to_pixels,1/i(y,1,t.transform.tileZoom));var x=y.tileSize*Math.pow(2,t.transform.tileZoom-y.coord.z),b=x*(y.coord.x+v.w*Math.pow(2,y.coord.z)),_=x*y.coord.y;s.uniform2f(n.u_pixel_coord_upper,b>>16,_>>16),s.uniform2f(n.u_pixel_coord_lower,65535&b,65535&_)}s.uniformMatrix4fv(n.u_matrix,!1,t.transform.calculatePosMatrix(v)),s.drawArrays(s.TRIANGLE_STRIP,0,t.tileExtentBuffer.length)}s.stencilMask(0),s.stencilFunc(s.EQUAL,128,128)}var i=t("../source/pixels_to_tile_units"),a=t("./create_uniform_pragmas"),o=512;e.exports=n},{"../source/pixels_to_tile_units":329,"./create_uniform_pragmas":310}],312:[function(t,e,r){"use strict";function n(t,e,r,n){if(!t.isOpaquePass){var a=t.gl;t.setDepthSublayer(0),t.depthMask(!1),a.disable(a.STENCIL_TEST);for(var o=0;o<n.length;o++){var s=n[o],l=e.getTile(s),u=l.getBucket(r);if(u){var c=u.bufferGroups.circle;if(c){var h=u.paintAttributes.circle[r.id],f=t.useProgram("circle",h.defines,h.vertexPragmas,h.fragmentPragmas);"map"===r.paint["circle-pitch-scale"]?(a.uniform1i(f.u_scale_with_map,!0),a.uniform2f(f.u_extrude_scale,t.transform.pixelsToGLUnits[0]*t.transform.altitude,t.transform.pixelsToGLUnits[1]*t.transform.altitude)):(a.uniform1i(f.u_scale_with_map,!1),a.uniform2fv(f.u_extrude_scale,t.transform.pixelsToGLUnits)),a.uniform1f(f.u_devicepixelratio,i.devicePixelRatio),a.uniformMatrix4fv(f.u_matrix,!1,t.translatePosMatrix(s.posMatrix,l,r.paint["circle-translate"],r.paint["circle-translate-anchor"])),u.setUniforms(a,"circle",f,r,{zoom:t.transform.zoom});for(var d=0;d<c.length;d++){var p=c[d];p.vaos[r.id].bind(a,f,p.layoutVertexBuffer,p.elementBuffer,p.paintVertexBuffers[r.id]),a.drawElements(a.TRIANGLES,3*p.elementBuffer.length,a.UNSIGNED_SHORT,0)}}}}}}var i=t("../util/browser");e.exports=n},{"../util/browser":392}],313:[function(t,e,r){"use strict";function n(t,e,r,n){var i=t.gl;i.enable(i.STENCIL_TEST);for(var a=t.useProgram("collisionbox"),o=0;o<n.length;o++){var s=n[o],l=e.getTile(s),u=l.getBucket(r);if(u){var c=u.bufferGroups.collisionBox;if(c&&c.length){var h=c[0];0!==h.layoutVertexBuffer.length&&(i.uniformMatrix4fv(a.u_matrix,!1,s.posMatrix),t.enableTileClippingMask(s),t.lineWidth(1),i.uniform1f(a.u_scale,Math.pow(2,t.transform.zoom-l.coord.z)),i.uniform1f(a.u_zoom,10*t.transform.zoom),i.uniform1f(a.u_maxzoom,10*(l.coord.z+1)),h.vaos[r.id].bind(i,a,h.layoutVertexBuffer),i.drawArrays(i.LINES,0,h.layoutVertexBuffer.length))}}}}e.exports=n},{}],314:[function(t,e,r){"use strict";function n(t,e,r){if(!t.isOpaquePass&&t.options.debug)for(var n=0;n<r.length;n++)i(t,e,r[n])}function i(t,e,r){var n=t.gl;n.disable(n.STENCIL_TEST),t.lineWidth(1*o.devicePixelRatio);var i=r.posMatrix,h=t.useProgram("debug");n.uniformMatrix4fv(h.u_matrix,!1,i),n.uniform4f(h.u_color,1,0,0,1),t.debugVAO.bind(n,h,t.debugBuffer),n.drawArrays(n.LINE_STRIP,0,t.debugBuffer.length);for(var f=a(r.toString(),50,200,5),d=new t.PosArray,p=0;p<f.length;p+=2)d.emplaceBack(f[p],f[p+1]);var m=new u(d.serialize(),t.PosArray.serialize(),u.BufferType.VERTEX),g=new c;g.bind(n,h,m),n.uniform4f(h.u_color,1,1,1,1);for(var v=e.getTile(r).tileSize,y=l/(Math.pow(2,t.transform.zoom-r.z)*v),x=[[-1,-1],[-1,1],[1,-1],[1,1]],b=0;b<x.length;b++){var _=x[b];n.uniformMatrix4fv(h.u_matrix,!1,s.translate([],i,[y*_[0],y*_[1],0])),n.drawArrays(n.LINES,0,m.length)}n.uniform4f(h.u_color,0,0,0,1),n.uniformMatrix4fv(h.u_matrix,!1,i),n.drawArrays(n.LINES,0,m.length)}var a=t("../lib/debugtext"),o=t("../util/browser"),s=t("gl-matrix").mat4,l=t("../data/bucket").EXTENT,u=t("../data/buffer"),c=t("./vertex_array_object");e.exports=n},{"../data/bucket":295,"../data/buffer":300,"../lib/debugtext":308,"../util/browser":392,"./vertex_array_object":323,"gl-matrix":166}],315:[function(t,e,r){"use strict";function n(t,e,r,n){var o=t.gl;o.enable(o.STENCIL_TEST);var s;if(s=!r.paint["fill-pattern"]&&(r.isPaintValueFeatureConstant("fill-color")&&r.isPaintValueFeatureConstant("fill-opacity")&&1===r.paint["fill-color"][3]&&1===r.paint["fill-opacity"]),t.isOpaquePass===s){t.setDepthSublayer(1);for(var l=0;l<n.length;l++)i(t,e,r,n[l])}if(!t.isOpaquePass&&r.paint["fill-antialias"]){t.lineWidth(2),t.depthMask(!1);var u=r.getPaintProperty("fill-outline-color");(u||!r.paint["fill-pattern"])&&u?t.setDepthSublayer(2):t.setDepthSublayer(0);for(var c=0;c<n.length;c++)a(t,e,r,n[c])}}function i(t,e,r,n){var i=e.getTile(n),a=i.getBucket(r);if(a){var s=a.bufferGroups.fill;if(s){var l,u=t.gl,c=r.paint["fill-pattern"];if(c)l=t.useProgram("pattern"),o(c,r.paint["fill-opacity"],i,n,t,l),u.activeTexture(u.TEXTURE0),t.spriteAtlas.bind(u,!0);else{var h=a.paintAttributes.fill[r.id];l=t.useProgram("fill",h.defines,h.vertexPragmas,h.fragmentPragmas),a.setUniforms(u,"fill",l,r,{zoom:t.transform.zoom})}u.uniformMatrix4fv(l.u_matrix,!1,t.translatePosMatrix(n.posMatrix,i,r.paint["fill-translate"],r.paint["fill-translate-anchor"])),t.enableTileClippingMask(n);for(var f=0;f<s.length;f++){var d=s[f];d.vaos[r.id].bind(u,l,d.layoutVertexBuffer,d.elementBuffer,d.paintVertexBuffers[r.id]),u.drawElements(u.TRIANGLES,d.elementBuffer.length,u.UNSIGNED_SHORT,0)}}}}function a(t,e,r,n){var i=e.getTile(n),a=i.getBucket(r);if(a){var s,l=t.gl,u=a.bufferGroups.fill,c=r.paint["fill-pattern"],h=r.paint["fill-opacity"],f=r.getPaintProperty("fill-outline-color");if(c&&!f)s=t.useProgram("outlinepattern"),l.uniform2f(s.u_world,l.drawingBufferWidth,l.drawingBufferHeight);else{var d=a.paintAttributes.fill[r.id];s=t.useProgram("outline",d.defines,d.vertexPragmas,d.fragmentPragmas),l.uniform2f(s.u_world,l.drawingBufferWidth,l.drawingBufferHeight),l.uniform1f(s.u_opacity,h),a.setUniforms(l,"fill",s,r,{zoom:t.transform.zoom})}l.uniformMatrix4fv(s.u_matrix,!1,t.translatePosMatrix(n.posMatrix,i,r.paint["fill-translate"],r.paint["fill-translate-anchor"])),c&&o(c,h,i,n,t,s),t.enableTileClippingMask(n);for(var p=0;p<u.length;p++){var m=u[p];m.secondVaos[r.id].bind(l,s,m.layoutVertexBuffer,m.elementBuffer2,m.paintVertexBuffers[r.id]),l.drawElements(l.LINES,2*m.elementBuffer2.length,l.UNSIGNED_SHORT,0)}}}function o(t,e,r,n,i,a){var o=i.gl,l=i.spriteAtlas.getPosition(t.from,!0),u=i.spriteAtlas.getPosition(t.to,!0);if(l&&u){o.uniform1i(a.u_image,0),o.uniform2fv(a.u_pattern_tl_a,l.tl),o.uniform2fv(a.u_pattern_br_a,l.br),o.uniform2fv(a.u_pattern_tl_b,u.tl),o.uniform2fv(a.u_pattern_br_b,u.br),o.uniform1f(a.u_opacity,e),o.uniform1f(a.u_mix,t.t),o.uniform1f(a.u_tile_units_to_pixels,1/s(r,1,i.transform.tileZoom)),o.uniform2fv(a.u_pattern_size_a,l.size),o.uniform2fv(a.u_pattern_size_b,u.size),o.uniform1f(a.u_scale_a,t.fromScale),o.uniform1f(a.u_scale_b,t.toScale);var c=r.tileSize*Math.pow(2,i.transform.tileZoom-r.coord.z),h=c*(r.coord.x+n.w*Math.pow(2,r.coord.z)),f=c*r.coord.y;o.uniform2f(a.u_pixel_coord_upper,h>>16,f>>16),o.uniform2f(a.u_pixel_coord_lower,65535&h,65535&f),o.activeTexture(o.TEXTURE0),i.spriteAtlas.bind(o,!0)}}var s=t("../source/pixels_to_tile_units");e.exports=n},{"../source/pixels_to_tile_units":329}],316:[function(t,e,r){"use strict";var n=t("../util/browser"),i=t("gl-matrix").mat2,a=t("../source/pixels_to_tile_units");e.exports=function(t,e,r,o){if(!t.isOpaquePass){t.setDepthSublayer(0),t.depthMask(!1);var s=t.gl;if(s.enable(s.STENCIL_TEST),!(r.paint["line-width"]<=0)){var l=1/n.devicePixelRatio,u=r.paint["line-blur"]+l,c=r.paint["line-color"],h=t.transform,f=i.create();i.scale(f,f,[1,Math.cos(h._pitch)]),i.rotate(f,f,t.transform.angle);var d,p,m,g,v,y=Math.sqrt(h.height*h.height/4*(1+h.altitude*h.altitude)),x=h.height/2*Math.tan(h._pitch),b=(y+x)/y-1,_=r.paint["line-dasharray"],w=r.paint["line-pattern"];if(_)d=t.useProgram("linesdfpattern"),s.uniform1f(d.u_linewidth,r.paint["line-width"]/2),s.uniform1f(d.u_gapwidth,r.paint["line-gap-width"]/2),s.uniform1f(d.u_antialiasing,l/2),s.uniform1f(d.u_blur,u),s.uniform4fv(d.u_color,c),s.uniform1f(d.u_opacity,r.paint["line-opacity"]),p=t.lineAtlas.getDash(_.from,"round"===r.layout["line-cap"]),m=t.lineAtlas.getDash(_.to,"round"===r.layout["line-cap"]),s.uniform1i(d.u_image,0),s.activeTexture(s.TEXTURE0),t.lineAtlas.bind(s),s.uniform1f(d.u_tex_y_a,p.y),s.uniform1f(d.u_tex_y_b,m.y),s.uniform1f(d.u_mix,_.t),s.uniform1f(d.u_extra,b),s.uniform1f(d.u_offset,-r.paint["line-offset"]),s.uniformMatrix2fv(d.u_antialiasingmatrix,!1,f);else if(w){if(g=t.spriteAtlas.getPosition(w.from,!0),v=t.spriteAtlas.getPosition(w.to,!0),!g||!v)return;d=t.useProgram("linepattern"),s.uniform1i(d.u_image,0),s.activeTexture(s.TEXTURE0),t.spriteAtlas.bind(s,!0),s.uniform1f(d.u_linewidth,r.paint["line-width"]/2),s.uniform1f(d.u_gapwidth,r.paint["line-gap-width"]/2),s.uniform1f(d.u_antialiasing,l/2),s.uniform1f(d.u_blur,u),s.uniform2fv(d.u_pattern_tl_a,g.tl),s.uniform2fv(d.u_pattern_br_a,g.br),s.uniform2fv(d.u_pattern_tl_b,v.tl),s.uniform2fv(d.u_pattern_br_b,v.br),s.uniform1f(d.u_fade,w.t),s.uniform1f(d.u_opacity,r.paint["line-opacity"]),s.uniform1f(d.u_extra,b),s.uniform1f(d.u_offset,-r.paint["line-offset"]),s.uniformMatrix2fv(d.u_antialiasingmatrix,!1,f)}else d=t.useProgram("line"),s.uniform1f(d.u_linewidth,r.paint["line-width"]/2),s.uniform1f(d.u_gapwidth,r.paint["line-gap-width"]/2),s.uniform1f(d.u_antialiasing,l/2),s.uniform1f(d.u_blur,u),s.uniform1f(d.u_extra,b),s.uniform1f(d.u_offset,-r.paint["line-offset"]),s.uniformMatrix2fv(d.u_antialiasingmatrix,!1,f),s.uniform4fv(d.u_color,c),s.uniform1f(d.u_opacity,r.paint["line-opacity"]);for(var M=0;M<o.length;M++){var A=o[M],k=e.getTile(A),T=k.getBucket(r);if(T){var E=T.bufferGroups.line;if(E){t.enableTileClippingMask(A);var S=t.translatePosMatrix(A.posMatrix,k,r.paint["line-translate"],r.paint["line-translate-anchor"]);s.uniformMatrix4fv(d.u_matrix,!1,S);var L=1/a(k,1,t.transform.zoom);if(_){var C=p.width*_.fromScale,I=m.width*_.toScale,z=[1/a(k,C,t.transform.tileZoom),-p.height/2],D=[1/a(k,I,t.transform.tileZoom),-m.height/2],P=t.lineAtlas.width/(256*Math.min(C,I)*n.devicePixelRatio)/2;s.uniform1f(d.u_ratio,L),s.uniform2fv(d.u_patternscale_a,z),s.uniform2fv(d.u_patternscale_b,D),s.uniform1f(d.u_sdfgamma,P)}else w?(s.uniform1f(d.u_ratio,L),s.uniform2fv(d.u_pattern_size_a,[a(k,g.size[0]*w.fromScale,t.transform.tileZoom),v.size[1]]),s.uniform2fv(d.u_pattern_size_b,[a(k,v.size[0]*w.toScale,t.transform.tileZoom),v.size[1]])):s.uniform1f(d.u_ratio,L);for(var O=0;O<E.length;O++){var R=E[O];R.vaos[r.id].bind(s,d,R.layoutVertexBuffer,R.elementBuffer),s.drawElements(s.TRIANGLES,3*R.elementBuffer.length,s.UNSIGNED_SHORT,0)}}}}}}}},{"../source/pixels_to_tile_units":329,"../util/browser":392,"gl-matrix":166}],317:[function(t,e,r){"use strict";function n(t,e,r,n){if(!t.isOpaquePass){var a=t.gl;a.enable(a.DEPTH_TEST),t.depthMask(!0),a.depthFunc(a.LESS);for(var o=n.length&&n[0].z,s=0;s<n.length;s++){var l=n[s];t.setDepthSublayer(l.z-o),i(t,e,r,l)}a.depthFunc(a.LEQUAL)}}function i(t,e,r,n){var i=t.gl;i.disable(i.STENCIL_TEST);var u=e.getTile(n),c=t.transform.calculatePosMatrix(n,e.maxzoom),h=t.useProgram("raster");i.uniformMatrix4fv(h.u_matrix,!1,c),i.uniform1f(h.u_brightness_low,r.paint["raster-brightness-min"]),i.uniform1f(h.u_brightness_high,r.paint["raster-brightness-max"]),i.uniform1f(h.u_saturation_factor,s(r.paint["raster-saturation"])),i.uniform1f(h.u_contrast_factor,o(r.paint["raster-contrast"])),i.uniform3fv(h.u_spin_weights,a(r.paint["raster-hue-rotate"]));var f,d,p=u.source&&u.source.findLoadedParent(n,0,{}),m=l(u,p,r,t.transform);i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,u.texture),i.activeTexture(i.TEXTURE1),p?(i.bindTexture(i.TEXTURE_2D,p.texture),f=Math.pow(2,p.coord.z-u.coord.z),d=[u.coord.x*f%1,u.coord.y*f%1]):(i.bindTexture(i.TEXTURE_2D,u.texture),m[1]=0),i.uniform2fv(h.u_tl_parent,d||[0,0]),i.uniform1f(h.u_scale_parent,f||1),i.uniform1f(h.u_buffer_scale,1),i.uniform1f(h.u_opacity0,m[0]),i.uniform1f(h.u_opacity1,m[1]),i.uniform1i(h.u_image0,0),i.uniform1i(h.u_image1,1);var g=u.boundsBuffer||t.rasterBoundsBuffer,v=u.boundsVAO||t.rasterBoundsVAO;v.bind(i,h,g),i.drawArrays(i.TRIANGLE_STRIP,0,g.length)}function a(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}function o(t){return t>0?1/(1-t):1+t}function s(t){return t>0?1-1/(1.001-t):-t}function l(t,e,r,n){var i=[1,0],a=r.paint["raster-fade-duration"];if(t.source&&a>0){var o=(new Date).getTime(),s=(o-t.timeAdded)/a,l=e?(o-e.timeAdded)/a:-1,c=n.coveringZoomLevel(t.source),h=!!e&&Math.abs(e.coord.z-c)>Math.abs(t.coord.z-c);!e||h?(i[0]=u.clamp(s,0,1),i[1]=1-i[0]):(i[0]=u.clamp(1-l,0,1),i[1]=1-i[0])}var f=r.paint["raster-opacity"];return i[0]*=f,i[1]*=f,i}var u=t("../util/util"),c=t("../util/struct_array");e.exports=n,n.RasterBoundsArray=new c({members:[{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]})},{"../util/struct_array":406,"../util/util":408}],318:[function(t,e,r){"use strict";function n(t,e,r,n){if(!t.isOpaquePass){var a=!(r.layout["text-allow-overlap"]||r.layout["icon-allow-overlap"]||r.layout["text-ignore-placement"]||r.layout["icon-ignore-placement"]),o=t.gl;a?o.disable(o.STENCIL_TEST):o.enable(o.STENCIL_TEST),t.setDepthSublayer(0),t.depthMask(!1),o.disable(o.DEPTH_TEST),i(t,e,r,n,!1,r.paint["icon-translate"],r.paint["icon-translate-anchor"],r.layout["icon-rotation-alignment"],r.layout["icon-rotation-alignment"],r.layout["icon-size"],r.paint["icon-halo-width"],r.paint["icon-halo-color"],r.paint["icon-halo-blur"],r.paint["icon-opacity"],r.paint["icon-color"]),i(t,e,r,n,!0,r.paint["text-translate"],r.paint["text-translate-anchor"],r.layout["text-rotation-alignment"],r.layout["text-pitch-alignment"],r.layout["text-size"],r.paint["text-halo-width"],r.paint["text-halo-color"],r.paint["text-halo-blur"],r.paint["text-opacity"],r.paint["text-color"]),o.enable(o.DEPTH_TEST),e.map.showCollisionBoxes&&s(t,e,r,n)}}function i(t,e,r,n,i,o,s,l,u,c,h,f,d,p,m){for(var g=0;g<n.length;g++){var v=e.getTile(n[g]),y=v.getBucket(r);if(y){var x=y.bufferGroups,b=i?x.glyph:x.icon;b.length&&(t.enableTileClippingMask(n[g]),a(t,r,n[g].posMatrix,v,y,b,i,i||y.sdfIcons,!i&&y.iconsNeedLinear,i?y.adjustedTextSize:y.adjustedIconSize,y.fontstack,o,s,l,u,c,h,f,d,p,m))}}}function a(t,e,r,n,i,a,s,u,c,h,f,d,p,m,g,v,y,x,b,_,w){var M,A,k,T=t.gl,E=t.transform,S="map"===m,L="map"===g,C=s?24:1,I=v/C;if(L?(A=l(n,1,t.transform.zoom)*I,k=1/Math.cos(E._pitch),M=[A,A]):(A=t.transform.altitude*I,k=1,M=[E.pixelsToGLUnits[0]*A,E.pixelsToGLUnits[1]*A]),s||t.style.sprite.loaded()){var z=t.useProgram(u?"sdf":"icon");if(T.uniformMatrix4fv(z.u_matrix,!1,t.translatePosMatrix(r,n,d,p)),T.uniform1i(z.u_rotate_with_map,S),T.uniform1i(z.u_pitch_with_map,L),T.uniform2fv(z.u_extrude_scale,M),T.activeTexture(T.TEXTURE0),T.uniform1i(z.u_texture,0),s){var D=f&&t.glyphSource.getGlyphAtlas(f);if(!D)return;D.updateTexture(T),T.uniform2f(z.u_texsize,D.width/4,D.height/4)}else{var P=t.options.rotating||t.options.zooming,O=1!==I||o.devicePixelRatio!==t.spriteAtlas.pixelRatio||c,R=L||t.transform.pitch;t.spriteAtlas.bind(T,u||P||O||R),T.uniform2f(z.u_texsize,t.spriteAtlas.width/4,t.spriteAtlas.height/4)}var F=Math.log(v/h)/Math.LN2||0;T.uniform1f(z.u_zoom,10*(t.transform.zoom-F)),T.activeTexture(T.TEXTURE1),t.frameHistory.bind(T),T.uniform1i(z.u_fadetexture,1);var j;if(u){var N=8,B=1.19,U=6,V=.105*C/v/o.devicePixelRatio;if(y){T.uniform1f(z.u_gamma,(b*B/I/N+V)*k),T.uniform4fv(z.u_color,x),T.uniform1f(z.u_opacity,_),T.uniform1f(z.u_buffer,(U-y/I)/N);for(var q=0;q<a.length;q++)j=a[q],j.vaos[e.id].bind(T,z,j.layoutVertexBuffer,j.elementBuffer),T.drawElements(T.TRIANGLES,3*j.elementBuffer.length,T.UNSIGNED_SHORT,0)}T.uniform1f(z.u_gamma,V*k),T.uniform4fv(z.u_color,w),T.uniform1f(z.u_opacity,_),T.uniform1f(z.u_buffer,.75),T.uniform1f(z.u_pitch,E.pitch/360*2*Math.PI),T.uniform1f(z.u_bearing,E.bearing/360*2*Math.PI),T.uniform1f(z.u_aspect_ratio,E.width/E.height);for(var H=0;H<a.length;H++)j=a[H],j.vaos[e.id].bind(T,z,j.layoutVertexBuffer,j.elementBuffer),T.drawElements(T.TRIANGLES,3*j.elementBuffer.length,T.UNSIGNED_SHORT,0)}else{T.uniform1f(z.u_opacity,_);for(var Y=0;Y<a.length;Y++)j=a[Y],j.vaos[e.id].bind(T,z,j.layoutVertexBuffer,j.elementBuffer),T.drawElements(T.TRIANGLES,3*j.elementBuffer.length,T.UNSIGNED_SHORT,0)}}}var o=t("../util/browser"),s=t("./draw_collision_debug"),l=t("../source/pixels_to_tile_units");e.exports=n},{"../source/pixels_to_tile_units":329,"../util/browser":392,"./draw_collision_debug":313}],319:[function(t,e,r){"use strict";function n(){this.changeTimes=new Float64Array(256),this.changeOpacities=new Uint8Array(256),this.opacities=new Uint8ClampedArray(256),this.array=new Uint8Array(this.opacities.buffer),this.fadeDuration=300,this.previousZoom=0,this.firstFrame=!0}e.exports=n,n.prototype.record=function(t){var e=Date.now();this.firstFrame&&(e=0,this.firstFrame=!1),t=Math.floor(10*t);var r;if(t<this.previousZoom)for(r=t+1;r<=this.previousZoom;r++)this.changeTimes[r]=e,this.changeOpacities[r]=this.opacities[r];else for(r=t;r>this.previousZoom;r--)this.changeTimes[r]=e,this.changeOpacities[r]=this.opacities[r];for(r=0;r<256;r++){var n=e-this.changeTimes[r],i=n/this.fadeDuration*255;r<=t?this.opacities[r]=this.changeOpacities[r]+i:this.opacities[r]=this.changeOpacities[r]-i}this.changed=!0,this.previousZoom=t},n.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.changed&&(t.texSubImage2D(t.TEXTURE_2D,0,0,0,256,1,t.ALPHA,t.UNSIGNED_BYTE,this.array),this.changed=!1)):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,256,1,0,t.ALPHA,t.UNSIGNED_BYTE,this.array))}},{}],320:[function(t,e,r){"use strict";function n(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}}var i=t("../util/util");e.exports=n,n.prototype.setSprite=function(t){this.sprite=t},n.prototype.getDash=function(t,e){var r=t.join(",")+e;return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},n.prototype.addDash=function(t,e){var r=e?7:0,n=2*r+1,a=128;if(this.nextRow+n>this.height)return i.warnOnce("LineAtlas out of space"),null;for(var o=0,s=0;s<t.length;s++)o+=t[s];for(var l=this.width/o,u=l/2,c=t.length%2===1,h=-r;h<=r;h++)for(var f=this.nextRow+r+h,d=this.width*f,p=c?-t[t.length-1]:0,m=t[0],g=1,v=0;v<this.width;v++){for(;m<v/l;)p=m,m+=t[g],c&&g===t.length-1&&(m+=t[0]),g++;var y,x=Math.abs(v-p*l),b=Math.abs(v-m*l),_=Math.min(x,b),w=g%2===1;if(e){var M=r?h/r*(u+1):0;if(w){var A=u-Math.abs(M);y=Math.sqrt(_*_+A*A)}else y=u-Math.sqrt(_*_+M*M)}else y=(w?1:-1)*_;this.data[3+4*(d+v)]=Math.max(0,Math.min(255,y+a))}var k={y:(this.nextRow+r+.5)/this.height,height:2*r/this.height,width:o};return this.nextRow+=n,this.dirty=!0,k},n.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.RGBA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,this.data))}},{"../util/util":408}],321:[function(t,e,r){"use strict";function n(t,e){this.gl=t,this.transform=e,this.reusableTextures={},this.preFbos={},this.frameHistory=new o,this.setup(),this.numSublayers=s.maxUnderzooming+s.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.lineWidthRange=t.getParameter(t.ALIASED_LINE_WIDTH_RANGE)}var i=t("../util/browser"),a=t("gl-matrix").mat4,o=t("./frame_history"),s=t("../source/source_cache"),l=t("../data/bucket").EXTENT,u=t("../source/pixels_to_tile_units"),c=t("../util/util"),h=t("../util/struct_array"),f=t("../data/buffer"),d=t("./vertex_array_object"),p=t("./draw_raster").RasterBoundsArray,m=t("./create_uniform_pragmas");e.exports=n,c.extend(n.prototype,t("./painter/use_program")),n.prototype.resize=function(t,e){var r=this.gl;this.width=t*i.devicePixelRatio,this.height=e*i.devicePixelRatio,r.viewport(0,0,this.width,this.height)},n.prototype.setup=function(){var t=this.gl;t.verbose=!0,t.enable(t.BLEND),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),t.enable(t.STENCIL_TEST),t.enable(t.DEPTH_TEST),t.depthFunc(t.LEQUAL),this._depthMask=!1,t.depthMask(!1);var e=this.PosArray=new h({members:[{name:"a_pos",type:"Int16",components:2}]}),r=new e;r.emplaceBack(0,0),r.emplaceBack(l,0),r.emplaceBack(0,l),r.emplaceBack(l,l),this.tileExtentBuffer=new f(r.serialize(),e.serialize(),f.BufferType.VERTEX),this.tileExtentVAO=new d,this.tileExtentPatternVAO=new d;var n=new e;n.emplaceBack(0,0),n.emplaceBack(l,0),n.emplaceBack(l,l),n.emplaceBack(0,l),n.emplaceBack(0,0),this.debugBuffer=new f(n.serialize(),e.serialize(),f.BufferType.VERTEX),this.debugVAO=new d;var i=new p;i.emplaceBack(0,0,0,0),i.emplaceBack(l,0,32767,0),i.emplaceBack(0,l,0,32767),i.emplaceBack(l,l,32767,32767),this.rasterBoundsBuffer=new f(i.serialize(),p.serialize(),f.BufferType.VERTEX),this.rasterBoundsVAO=new d},n.prototype.clearColor=function(){var t=this.gl;t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT)},n.prototype.clearStencil=function(){var t=this.gl;t.clearStencil(0),t.stencilMask(255),t.clear(t.STENCIL_BUFFER_BIT)},n.prototype.clearDepth=function(){var t=this.gl;t.clearDepth(1),this.depthMask(!0),t.clear(t.DEPTH_BUFFER_BIT)},n.prototype._renderTileClippingMasks=function(t){var e=this.gl;e.colorMask(!1,!1,!1,!1),this.depthMask(!1),e.disable(e.DEPTH_TEST),e.enable(e.STENCIL_TEST),e.stencilMask(248),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE);var r=1;this._tileClippingMaskIDs={};for(var n=0;n<t.length;n++){var i=t[n],a=this._tileClippingMaskIDs[i.id]=r++<<3;e.stencilFunc(e.ALWAYS,a,248);var o=m([{name:"u_color",components:4},{name:"u_opacity",components:1}]),s=this.useProgram("fill",[],o,o);e.uniformMatrix4fv(s.u_matrix,!1,i.posMatrix),this.tileExtentVAO.bind(e,s,this.tileExtentBuffer),e.drawArrays(e.TRIANGLE_STRIP,0,this.tileExtentBuffer.length)}e.stencilMask(0),e.colorMask(!0,!0,!0,!0),this.depthMask(!0),e.enable(e.DEPTH_TEST)},n.prototype.enableTileClippingMask=function(t){var e=this.gl;e.stencilFunc(e.EQUAL,this._tileClippingMaskIDs[t.id],248)},n.prototype.prepareBuffers=function(){},n.prototype.bindDefaultFramebuffer=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,null)};var g={symbol:t("./draw_symbol"),circle:t("./draw_circle"),line:t("./draw_line"),fill:t("./draw_fill"),raster:t("./draw_raster"),background:t("./draw_background"),debug:t("./draw_debug")};n.prototype.render=function(t,e){this.style=t,this.options=e,this.lineAtlas=t.lineAtlas,this.spriteAtlas=t.spriteAtlas,this.spriteAtlas.setSprite(t.sprite),this.glyphSource=t.glyphSource,this.frameHistory.record(this.transform.zoom),this.prepareBuffers(),this.clearColor(),this.clearDepth(),this.showOverdrawInspector(e.showOverdrawInspector),this.depthRange=(t._order.length+2)*this.numSublayers*this.depthEpsilon,this.renderPass({isOpaquePass:!0}),this.renderPass({isOpaquePass:!1})},n.prototype.renderPass=function(t){var e=this.style._groups,r=t.isOpaquePass;this.currentLayer=r?this.style._order.length:-1;for(var n=0;n<e.length;n++){var i,a=e[r?e.length-1-n:n],o=this.style.sources[a.source],s=[];if(o){for(s=o.getVisibleCoordinates(),i=0;i<s.length;i++)s[i].posMatrix=this.transform.calculatePosMatrix(s[i],o.maxzoom);this.clearStencil(),o.prepare&&o.prepare(),o.isTileClipped&&this._renderTileClippingMasks(s)}for(r?(this._showOverdrawInspector||this.gl.disable(this.gl.BLEND),this.isOpaquePass=!0):(this.gl.enable(this.gl.BLEND),this.isOpaquePass=!1,s.reverse()),i=0;i<a.length;i++){var l=a[r?a.length-1-i:i];this.currentLayer+=r?-1:1,this.renderLayer(this,o,l,s)}o&&g.debug(this,o,s)}},n.prototype.depthMask=function(t){t!==this._depthMask&&(this._depthMask=t,this.gl.depthMask(t))},n.prototype.renderLayer=function(t,e,r,n){r.isHidden(this.transform.zoom)||("background"===r.type||n.length)&&(this.id=r.id,g[r.type](t,e,r,n))},n.prototype.setDepthSublayer=function(t){var e=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon,r=e-1+this.depthRange;this.gl.depthRange(r,e)},n.prototype.translatePosMatrix=function(t,e,r,n){if(!r[0]&&!r[1])return t;if("viewport"===n){var i=Math.sin(-this.transform.angle),o=Math.cos(-this.transform.angle);r=[r[0]*o-r[1]*i,r[0]*i+r[1]*o]}var s=[u(e,r[0],this.transform.zoom),u(e,r[1],this.transform.zoom),0],l=new Float32Array(16);return a.translate(l,t,s),l},n.prototype.saveTexture=function(t){var e=this.reusableTextures[t.size];e?e.push(t):this.reusableTextures[t.size]=[t]},n.prototype.getTexture=function(t){var e=this.reusableTextures[t];return e&&e.length>0?e.pop():null},n.prototype.lineWidth=function(t){this.gl.lineWidth(c.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},n.prototype.showOverdrawInspector=function(t){if(t||this._showOverdrawInspector){this._showOverdrawInspector=t;var e=this.gl;if(t){e.blendFunc(e.CONSTANT_COLOR,e.ONE);var r=8,n=1/r;e.blendColor(n,n,n,0),e.clearColor(0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)}else e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}}},{"../data/bucket":295,"../data/buffer":300,"../source/pixels_to_tile_units":329,"../source/source_cache":333,"../util/browser":392,"../util/struct_array":406,"../util/util":408,"./create_uniform_pragmas":310,"./draw_background":311,"./draw_circle":312,"./draw_debug":314,"./draw_fill":315,"./draw_line":316,"./draw_raster":317,"./draw_symbol":318,"./frame_history":319,"./painter/use_program":322,"./vertex_array_object":323,"gl-matrix":166}],322:[function(t,e,r){"use strict";function n(t,e){return t.replace(/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,function(t,r,n,i,a){return e[r][a].replace(/{type}/g,i).replace(/{precision}/g,n)})}var i=t("assert"),a=t("../../util/util"),o=t("mapbox-gl-shaders"),s=o.util;e.exports._createProgram=function(t,e,r,l){for(var u=this.gl,c=u.createProgram(),h=o[t],f="#define MAPBOX_GL_JS;\n",d=0;d<e.length;d++)f+="#define "+e[d]+";\n";var p=u.createShader(u.FRAGMENT_SHADER);u.shaderSource(p,n(f+h.fragmentSource,l)),u.compileShader(p),i(u.getShaderParameter(p,u.COMPILE_STATUS),u.getShaderInfoLog(p)),u.attachShader(c,p);var m=u.createShader(u.VERTEX_SHADER);u.shaderSource(m,n(f+s+h.vertexSource,r)),u.compileShader(m),i(u.getShaderParameter(m,u.COMPILE_STATUS),u.getShaderInfoLog(m)),u.attachShader(c,m),u.linkProgram(c),i(u.getProgramParameter(c,u.LINK_STATUS),u.getProgramInfoLog(c));for(var g={},v=u.getProgramParameter(c,u.ACTIVE_ATTRIBUTES),y=0;y<v;y++){var x=u.getActiveAttrib(c,y);g[x.name]=u.getAttribLocation(c,x.name)}for(var b={},_=u.getProgramParameter(c,u.ACTIVE_UNIFORMS),w=0;w<_;w++){var M=u.getActiveUniform(c,w);b[M.name]=u.getUniformLocation(c,M.name)}return a.extend({program:c,definition:h,attributes:g,numAttributes:v},g,b)},e.exports._createProgramCached=function(t,e,r,n){this.cache=this.cache||{};var i=JSON.stringify({name:t,defines:e,vertexPragmas:r,fragmentPragmas:n});return this.cache[i]||(this.cache[i]=this._createProgram(t,e,r,n)),this.cache[i]},e.exports.useProgram=function(t,e,r,n){var i=this.gl;e=e||[],this._showOverdrawInspector&&(e=e.concat("OVERDRAW_INSPECTOR"));var a=this._createProgramCached(t,e,r,n),o=this.currentProgram;return o!==a&&(i.useProgram(a.program),this.currentProgram=a),a}},{"../../util/util":408,assert:36,"mapbox-gl-shaders":269}],323:[function(t,e,r){"use strict";function n(){this.boundProgram=null,this.boundVertexBuffer=null,this.boundVertexBuffer2=null,this.boundElementBuffer=null,this.vao=null}var i=t("assert");e.exports=n,n.prototype.bind=function(t,e,r,n,i){void 0===t.extVertexArrayObject&&(t.extVertexArrayObject=t.getExtension("OES_vertex_array_object"));var a=!this.vao||this.boundProgram!==e||this.boundVertexBuffer!==r||this.boundVertexBuffer2!==i||this.boundElementBuffer!==n;!t.extVertexArrayObject||a?this.freshBind(t,e,r,n,i):t.extVertexArrayObject.bindVertexArrayOES(this.vao)},n.prototype.freshBind=function(t,e,r,n,a){var o,s=e.numAttributes;if(t.extVertexArrayObject)this.vao&&this.destroy(t),this.vao=t.extVertexArrayObject.createVertexArrayOES(),t.extVertexArrayObject.bindVertexArrayOES(this.vao),o=0,this.boundProgram=e,this.boundVertexBuffer=r,this.boundVertexBuffer2=a,this.boundElementBuffer=n;else{o=t.currentNumAttributes||0;for(var l=s;l<o;l++)i(0!==l),t.disableVertexAttribArray(l)}for(var u=o;u<s;u++)t.enableVertexAttribArray(u);r.bind(t),r.setVertexAttribPointers(t,e),a&&(a.bind(t),a.setVertexAttribPointers(t,e)),n&&n.bind(t),t.currentNumAttributes=s},n.prototype.unbind=function(t){var e=t.extVertexArrayObject;e&&e.bindVertexArrayOES(null)},n.prototype.destroy=function(t){var e=t.extVertexArrayObject;e&&this.vao&&(e.deleteVertexArrayOES(this.vao),this.vao=null)}},{assert:36}],324:[function(t,e,r){"use strict";function n(t,e,r){e=e||{},this.id=t,this.dispatcher=r,this._data=e.data,void 0!==e.maxzoom&&(this.maxzoom=e.maxzoom),e.type&&(this.type=e.type);var n=s/this.tileSize;this.workerOptions=a.extend({source:this.id,cluster:e.cluster||!1,geojsonVtOptions:{buffer:(void 0!==e.buffer?e.buffer:128)*n,tolerance:(void 0!==e.tolerance?e.tolerance:.375)*n,extent:s,maxZoom:this.maxzoom},superclusterOptions:{maxZoom:Math.min(e.clusterMaxZoom,this.maxzoom-1)||this.maxzoom-1,extent:s,radius:(e.clusterRadius||50)*n,log:!1}},e.workerOptions),this._updateWorkerData(function(t){return t?void this.fire("error",{error:t}):void this.fire("load")}.bind(this))}var i=t("../util/evented"),a=t("../util/util"),o=t("resolve-url"),s=t("../data/bucket").EXTENT;e.exports=n,n.prototype=a.inherit(i,{type:"geojson",minzoom:0,maxzoom:18,tileSize:512,isTileClipped:!0,reparseOverscaled:!0,onAdd:function(t){this.map=t},setData:function(t){return this._data=t,this._updateWorkerData(function(t){return t?this.fire("error",{error:t}):void this.fire("change")}.bind(this)),this},_updateWorkerData:function(t){var e=a.extend({},this.workerOptions),r=this._data;"string"==typeof r?e.url="undefined"!=typeof window?o(window.location.href,r):r:e.data=JSON.stringify(r),this.workerID=this.dispatcher.send(this.type+".loadData",e,function(e){this._loaded=!0,t(e)}.bind(this))},loadTile:function(t,e){var r=t.coord.z>this.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,n={type:this.type,uid:t.uid,coord:t.coord,zoom:t.coord.z,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,overscaling:r,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send("load tile",n,function(r,n){if(t.unloadVectorData(this.map.painter),!t.aborted)return r?e(r):(t.loadVectorData(n,this.map.style),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(this)),e(null))}.bind(this),this.workerID)},abortTile:function(t){t.aborted=!0},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},function(){},t.workerID)},serialize:function(){return{type:this.type,data:this._data}}})},{"../data/bucket":295,"../util/evented":400,"../util/util":408,"resolve-url":464}],325:[function(t,e,r){"use strict";function n(t,e,r){r&&(this.loadGeoJSON=r),h.call(this,t,e)}var i=t("../util/util"),a=t("../util/ajax"),o=t("geojson-rewind"),s=t("./geojson_wrapper"),l=t("vt-pbf"),u=t("supercluster"),c=t("geojson-vt"),h=t("./vector_tile_worker_source");e.exports=n,n.prototype=i.inherit(h,{_geoJSONIndexes:{},loadVectorData:function(t,e){var r=t.source,n=t.coord;if(!this._geoJSONIndexes[r])return e(null,null);var i=this._geoJSONIndexes[r].getTile(Math.min(n.z,t.maxZoom),n.x,n.y);if(!i)return e(null,null);var a=new s(i.features);a.name="_geojsonTileLayer";var o=l({layers:{_geojsonTileLayer:a}});0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{tile:a,rawTileData:o.buffer})},loadData:function(t,e){var r=function(r,n){return r?e(r):"object"!=typeof n?e(new Error("Input data is not a valid GeoJSON object.")):(o(n,!0),void this._indexData(n,t,function(r,n){return r?e(r):(this._geoJSONIndexes[t.source]=n,void e(null))}.bind(this)))}.bind(this);this.loadGeoJSON(t,r)},loadGeoJSON:function(t,e){if(t.url)a.getJSON(t.url,e);else{if("string"!=typeof t.data)return e(new Error("Input data is not a valid GeoJSON object."));try{return e(null,JSON.parse(t.data))}catch(t){return e(new Error("Input data is not a valid GeoJSON object."))}}},_indexData:function(t,e,r){try{e.cluster?r(null,u(e.superclusterOptions).load(t.features)):r(null,c(t,e.geojsonVtOptions))}catch(t){return r(t)}}})},{"../util/ajax":391,"../util/util":408,"./geojson_wrapper":326,"./vector_tile_worker_source":337,"geojson-rewind":112,"geojson-vt":116,supercluster:491,"vt-pbf":517}],326:[function(t,e,r){"use strict";function n(t){this.features=t,this.length=t.length,this.extent=s}function i(t){if(this.type=t.type,1===t.type){this.rawGeometry=[];for(var e=0;e<t.geometry.length;e++)this.rawGeometry.push([t.geometry[e]])}else this.rawGeometry=t.geometry;this.properties=t.tags,this.extent=s}var a=t("point-geometry"),o=t("vector-tile").VectorTileFeature,s=t("../data/bucket").EXTENT;e.exports=n,n.prototype.feature=function(t){return new i(this.features[t])},i.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var r=t[e],n=[],i=0;i<r.length;i++)n.push(new a(r[i][0],r[i][1]));this.geometry.push(n)}return this.geometry},i.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-(1/0),n=1/0,i=-(1/0),a=0;a<t.length;a++)for(var o=t[a],s=0;s<o.length;s++){var l=o[s];e=Math.min(e,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.y)}return[e,n,r,i]},i.prototype.toGeoJSON=o.prototype.toGeoJSON},{"../data/bucket":295,"point-geometry":448,"vector-tile":511}],327:[function(t,e,r){"use strict";function n(t,e,r){this.id=t,this.dispatcher=r,this.url=e.url,this.coordinates=e.coordinates,u.getImage(e.url,function(t,r){return t?this.fire("error",{error:t}):(this.image=r,this.image.addEventListener("load",function(){this.map._rerender()}.bind(this)),this._loaded=!0,this.fire("load"),void(this.map&&this.setCoordinates(e.coordinates)))}.bind(this))}var i=t("../util/util"),a=t("./tile_coord"),o=t("../geo/lng_lat"),s=t("point-geometry"),l=t("../util/evented"),u=t("../util/ajax"),c=t("../data/bucket").EXTENT,h=t("../render/draw_raster").RasterBoundsArray,f=t("../data/buffer"),d=t("../render/vertex_array_object");e.exports=n,n.prototype=i.inherit(l,{minzoom:0,maxzoom:22,tileSize:512,onAdd:function(t){this.map=t,this.image&&this.setCoordinates(this.coordinates)},setCoordinates:function(t){this.coordinates=t;var e=this.map,r=t.map(function(t){return e.transform.locationCoordinate(o.convert(t)).zoomTo(0)}),n=this.centerCoord=i.getCoordinatesCenter(r);return n.column=Math.round(n.column),n.row=Math.round(n.row),this.minzoom=this.maxzoom=n.zoom,this._coord=new a(n.zoom,n.column,n.row),this._tileCoords=r.map(function(t){var e=t.zoomTo(n.zoom);return new s(Math.round((e.column-n.column)*c),Math.round((e.row-n.row)*c))}),this.fire("change"),this},_setTile:function(t){this._prepared=!1,this.tile=t;var e=32767,r=new h;r.emplaceBack(this._tileCoords[0].x,this._tileCoords[0].y,0,0),r.emplaceBack(this._tileCoords[1].x,this._tileCoords[1].y,e,0),r.emplaceBack(this._tileCoords[3].x,this._tileCoords[3].y,0,e),r.emplaceBack(this._tileCoords[2].x,this._tileCoords[2].y,e,e),this.tile.buckets={},this.tile.boundsBuffer=new f(r.serialize(),h.serialize(),f.BufferType.VERTEX),this.tile.boundsVAO=new d,this.tile.state="loaded"},prepare:function(){if(this._loaded&&this.image&&this.image.complete&&this.tile){var t=this.map.painter,e=t.gl;this._prepared?(e.bindTexture(e.TEXTURE_2D,this.tile.texture),e.texSubImage2D(e.TEXTURE_2D,0,0,0,e.RGBA,e.UNSIGNED_BYTE,this.image)):(this.tile.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.tile.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.image))}},loadTile:function(t,e){this._coord&&this._coord.toString()===t.coord.toString()?(this._setTile(t),e(null)):(t.state="errored",e(null))},serialize:function(){return{type:"image",urls:this.url,coordinates:this.coordinates}}})},{"../data/bucket":295,"../data/buffer":300,"../geo/lng_lat":305,"../render/draw_raster":317,"../render/vertex_array_object":323,"../util/ajax":391,"../util/evented":400,"../util/util":408,"./tile_coord":335,"point-geometry":448}],328:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/ajax"),a=t("../util/browser"),o=t("../util/mapbox").normalizeSourceURL;e.exports=function(t,e){var r=function(t,r){if(t)return e(t);var i=n.pick(r,["tiles","minzoom","maxzoom","attribution"]);r.vector_layers&&(i.vectorLayers=r.vector_layers,i.vectorLayerIds=i.vectorLayers.map(function(t){return t.id})),e(null,i)};t.url?i.getJSON(o(t.url),r):a.frame(r.bind(null,null,t))}},{"../util/ajax":391,"../util/browser":392,"../util/mapbox":405,"../util/util":408}],329:[function(t,e,r){"use strict";var n=t("../data/bucket");e.exports=function(t,e,r){return e*(n.EXTENT/(t.tileSize*Math.pow(2,r-t.coord.z)))}},{"../data/bucket":295}],330:[function(t,e,r){"use strict";function n(t,e){var r=t.coord,n=e.coord;return r.z-n.z||r.y-n.y||r.w-n.w||r.x-n.x}function i(t){for(var e=t[0]||{},r=1;r<t.length;r++){var n=t[r];for(var i in n){var a=n[i],o=e[i];if(void 0===o)o=e[i]=a;else for(var s=0;s<a.length;s++)o.push(a[s])}}return e}var a=t("./tile_coord");r.rendered=function(t,e,r,a,o,s){var l=t.tilesIn(r);l.sort(n);for(var u=[],c=0;c<l.length;c++){var h=l[c];h.tile.featureIndex&&u.push(h.tile.featureIndex.query({queryGeometry:h.queryGeometry,scale:h.scale,tileSize:h.tile.tileSize,bearing:s,params:a},e))}return i(u)},r.source=function(t,e){for(var r=t.getRenderableIds().map(function(e){return t.getTileByID(e)}),n=[],i={},o=0;o<r.length;o++){var s=r[o],l=new a(Math.min(s.sourceMaxZoom,s.coord.z),s.coord.x,s.coord.y,0).id;i[l]||(i[l]=!0,s.querySourceFeatures(n,e))}return n}},{"./tile_coord":335}],331:[function(t,e,r){"use strict";function n(t,e,r){this.id=t,this.dispatcher=r,i.extend(this,i.pick(e,["url","scheme","tileSize"])),s(e,function(t,e){return t?this.fire("error",t):(i.extend(this,e),void this.fire("load"))}.bind(this))}var i=t("../util/util"),a=t("../util/ajax"),o=t("../util/evented"),s=t("./load_tilejson"),l=t("../util/mapbox").normalizeTileURL;e.exports=n,n.prototype=i.inherit(o,{minzoom:0,maxzoom:22,roundZoom:!0,scheme:"xyz",tileSize:512,_loaded:!1,onAdd:function(t){this.map=t},serialize:function(){return{type:"raster",url:this.url,tileSize:this.tileSize}},loadTile:function(t,e){function r(r,n){if(delete t.request,!t.aborted){if(r)return e(r);var i=this.map.painter.gl;t.texture=this.map.painter.getTexture(n.width),t.texture?(i.bindTexture(i.TEXTURE_2D,t.texture),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,n)):(t.texture=i.createTexture(),i.bindTexture(i.TEXTURE_2D,t.texture),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR_MIPMAP_NEAREST),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,n),t.texture.size=n.width),i.generateMipmap(i.TEXTURE_2D),this.map.animationLoop.set(this.map.style.rasterFadeDuration),t.state="loaded",e(null)}}var n=l(t.coord.url(this.tiles,null,this.scheme),this.url,this.tileSize);t.request=a.getImage(n,r.bind(this))},abortTile:function(t){t.request&&(t.request.abort(),delete t.request)},unloadTile:function(t){t.texture&&this.map.painter.saveTexture(t.texture)}})},{"../util/ajax":391,"../util/evented":400,"../util/mapbox":405,"../util/util":408,"./load_tilejson":328}],332:[function(t,e,r){"use strict";var n=t("../util/util"),i={vector:t("../source/vector_tile_source"),raster:t("../source/raster_tile_source"),geojson:t("../source/geojson_source"),video:t("../source/video_source"),image:t("../source/image_source")};r.create=function(t,e,r){if(e=new i[e.type](t,e,r),e.id!==t)throw new Error("Expected Source id to be "+t+" instead of "+e.id);return n.bindAll(["load","abort","unload","serialize","prepare"],e),e},r.getType=function(t){return i[t]},r.setType=function(t,e){i[t]=e}},{"../source/geojson_source":324,"../source/image_source":327,"../source/raster_tile_source":331,"../source/vector_tile_source":336,"../source/video_source":338,"../util/util":408}],333:[function(t,e,r){"use strict";function n(t,e,r){this.id=t,this.dispatcher=r;var n=this._source=o.create(t,e,r).on("load",function(){this.map&&this._source.onAdd&&this._source.onAdd(this.map),this._sourceLoaded=!0,this.tileSize=n.tileSize,this.minzoom=n.minzoom,this.maxzoom=n.maxzoom,this.roundZoom=n.roundZoom,this.reparseOverscaled=n.reparseOverscaled,this.isTileClipped=n.isTileClipped,this.attribution=n.attribution,this.vectorLayerIds=n.vectorLayerIds,this.fire("load")}.bind(this)).on("error",function(t){this._sourceErrored=!0,this.fire("error",t)}.bind(this)).on("change",function(){this.reload(),this.transform&&this.update(this.transform,this.map&&this.map.style.rasterFadeDuration),this.fire("change")}.bind(this));this._tiles={},this._cache=new c(0,this.unloadTile.bind(this)),this._isIdRenderable=this._isIdRenderable.bind(this)}function i(t,e,r){var n=r.zoomTo(Math.min(t.z,e));return{x:(n.column-(t.x+t.w*Math.pow(2,t.z)))*d,y:(n.row-t.y)*d}}function a(t,e){return t%32-e%32}var o=t("./source"),s=t("./tile"),l=t("../util/evented"),u=t("./tile_coord"),c=t("../util/lru_cache"),h=t("../geo/coordinate"),f=t("../util/util"),d=t("../data/bucket").EXTENT;e.exports=n,n.maxOverzooming=10,n.maxUnderzooming=3,n.prototype=f.inherit(l,{onAdd:function(t){this.map=t,this._source&&this._source.onAdd&&this._source.onAdd(t)},loaded:function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0},getSource:function(){return this._source},loadTile:function(t,e){return this._source.loadTile(t,e)},unloadTile:function(t){if(this._source.unloadTile)return this._source.unloadTile(t)},abortTile:function(t){if(this._source.abortTile)return this._source.abortTile(t)},serialize:function(){return this._source.serialize()},prepare:function(){if(this._sourceLoaded&&this._source.prepare)return this._source.prepare()},getIds:function(){return Object.keys(this._tiles).map(Number).sort(a)},getRenderableIds:function(){return this.getIds().filter(this._isIdRenderable)},_isIdRenderable:function(t){return this._tiles[t].isRenderable()&&!this._coveredTiles[t]},reload:function(){this._cache.reset();for(var t in this._tiles){var e=this._tiles[t];"loading"!==e.state&&(e.state="reloading"),this.loadTile(this._tiles[t],this._tileLoaded.bind(this,this._tiles[t]))}},_tileLoaded:function(t,e){return e?(t.state="errored",this.fire("tile.error",{tile:t,error:e}),void this._source.fire("tile.error",{tile:t,error:e})):(t.source=this,t.timeAdded=(new Date).getTime(),this.fire("tile.load",{tile:t}),void this._source.fire("tile.load",{tile:t}))},getTile:function(t){return this.getTileByID(t.id)},getTileByID:function(t){return this._tiles[t]},getZoom:function(t){return t.zoom+t.scaleZoom(t.tileSize/this.tileSize)},findLoadedChildren:function(t,e,r){var n=!1;for(var i in this._tiles){var a=this._tiles[i];if(!(r[i]||!a.isRenderable()||a.coord.z<=t.z||a.coord.z>e)){var o=Math.pow(2,Math.min(a.coord.z,this.maxzoom)-Math.min(t.z,this.maxzoom));if(Math.floor(a.coord.x/o)===t.x&&Math.floor(a.coord.y/o)===t.y)for(r[i]=!0,n=!0;a&&a.coord.z-1>t.z;){var s=a.coord.parent(this.maxzoom).id;a=this._tiles[s],a&&a.isRenderable()&&(delete r[i],r[s]=!0)}}}return n},findLoadedParent:function(t,e,r){for(var n=t.z-1;n>=e;n--){t=t.parent(this.maxzoom);var i=this._tiles[t.id];if(i&&i.isRenderable())return r[t.id]=!0,i;if(this._cache.has(t.id))return this.addTile(t),r[t.id]=!0,this._tiles[t.id]}},updateCacheSize:function(t){var e=Math.ceil(t.width/t.tileSize)+1,r=Math.ceil(t.height/t.tileSize)+1,n=e*r,i=5;this._cache.setMaxSize(Math.floor(n*i))},update:function(t,e){if(this._sourceLoaded){var r,i,a;this.updateCacheSize(t);var o=(this.roundZoom?Math.round:Math.floor)(this.getZoom(t)),s=Math.max(o-n.maxOverzooming,this.minzoom),l=Math.max(o+n.maxUnderzooming,this.minzoom),c={},h=(new Date).getTime();this._coveredTiles={};var d=this.used?t.coveringTiles(this._source):[];for(r=0;r<d.length;r++)i=d[r],a=this.addTile(i),c[i.id]=!0,a.isRenderable()||this.findLoadedChildren(i,l,c)||this.findLoadedParent(i,s,c);for(var p={},m=Object.keys(c),g=0;g<m.length;g++){var v=m[g];i=u.fromID(v),a=this._tiles[v],a&&a.timeAdded>h-(e||0)&&(this.findLoadedChildren(i,l,c)&&(c[v]=!0),this.findLoadedParent(i,s,p))}var y;for(y in p)c[y]||(this._coveredTiles[y]=!0);for(y in p)c[y]=!0;var x=f.keysDifference(this._tiles,c);for(r=0;r<x.length;r++)this.removeTile(+x[r]);this.transform=t}},addTile:function(t){var e=this._tiles[t.id];if(e)return e;var r=t.wrapped();if(e=this._tiles[r.id],e||(e=this._cache.get(r.id),e&&this._redoPlacement&&this._redoPlacement(e)),!e){var n=t.z,i=n>this.maxzoom?Math.pow(2,n-this.maxzoom):1;e=new s(r,this.tileSize*i,this.maxzoom),this.loadTile(e,this._tileLoaded.bind(this,e))}return e.uses++,this._tiles[t.id]=e,this.fire("tile.add",{tile:e}),this._source.fire("tile.add",{tile:e}),e},removeTile:function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this.fire("tile.remove",{tile:e}),this._source.fire("tile.remove",{tile:e}),e.uses>0||(e.isRenderable()?this._cache.add(e.coord.wrapped().id,e):(e.aborted=!0,this.abortTile(e),this.unloadTile(e))))},clearTiles:function(){for(var t in this._tiles)this.removeTile(t);this._cache.reset()},tilesIn:function(t){for(var e={},r=this.getIds(),n=1/0,a=1/0,o=-(1/0),s=-(1/0),l=t[0].zoom,c=0;c<t.length;c++){var f=t[c];n=Math.min(n,f.column),a=Math.min(a,f.row),o=Math.max(o,f.column),s=Math.max(s,f.row)}for(var p=0;p<r.length;p++){var m=this._tiles[r[p]],g=u.fromID(r[p]),v=[i(g,m.sourceMaxZoom,new h(n,a,l)),i(g,m.sourceMaxZoom,new h(o,s,l))];if(v[0].x<d&&v[0].y<d&&v[1].x>=0&&v[1].y>=0){for(var y=[],x=0;x<t.length;x++)y.push(i(g,m.sourceMaxZoom,t[x]));var b=e[m.coord.id];void 0===b&&(b=e[m.coord.id]={tile:m,coord:g,queryGeometry:[],scale:Math.pow(2,this.transform.zoom-m.coord.z)}),b.queryGeometry.push(y)}}var _=[];for(var w in e)_.push(e[w]);return _},redoPlacement:function(){for(var t=this.getIds(),e=0;e<t.length;e++){var r=this.getTileByID(t[e]);r.redoPlacement(this)}},getVisibleCoordinates:function(){return this.getRenderableIds().map(u.fromID)}})},{"../data/bucket":295,"../geo/coordinate":304,"../util/evented":400,"../util/lru_cache":404,"../util/util":408,"./source":332,"./tile":334,"./tile_coord":335}],334:[function(t,e,r){"use strict";function n(t,e,r){this.coord=t,this.uid=a.uniqueId(),this.uses=0,this.tileSize=e,this.sourceMaxZoom=r,this.buckets={},this.state="loading"}function i(t,e){if(e){for(var r={},n=0;n<t.length;n++){var i=e.getLayer(t[n].layerId);if(i){var s=o.create(a.extend({layer:i,childLayers:t[n].childLayerIds.map(e.getLayer.bind(e)).filter(function(t){return t})},t[n]));r[s.id]=s}}return r}}var a=t("../util/util"),o=t("../data/bucket"),s=t("../data/feature_index"),l=t("vector-tile"),u=t("pbf"),c=t("../util/vectortile_to_geojson"),h=t("feature-filter"),f=t("../symbol/collision_tile"),d=t("../symbol/collision_box"),p=t("../symbol/symbol_instances"),m=t("../symbol/symbol_quads");e.exports=n,n.prototype={loadVectorData:function(t,e){this.state="loaded",t&&(this.collisionBoxArray=new d(t.collisionBoxArray),this.collisionTile=new f(t.collisionTile,this.collisionBoxArray),this.symbolInstancesArray=new p(t.symbolInstancesArray),this.symbolQuadsArray=new m(t.symbolQuadsArray),this.featureIndex=new s(t.featureIndex,t.rawTileData,this.collisionTile),this.rawTileData=t.rawTileData,this.buckets=i(t.buckets,e))},reloadSymbolData:function(t,e,r){if("unloaded"!==this.state){this.collisionTile=new f(t.collisionTile,this.collisionBoxArray),this.featureIndex.setCollisionTile(this.collisionTile);for(var n in this.buckets){var o=this.buckets[n];"symbol"===o.type&&(o.destroy(e.gl),delete this.buckets[n])}a.extend(this.buckets,i(t.buckets,r))}},unloadVectorData:function(t){for(var e in this.buckets){var r=this.buckets[e];r.destroy(t.gl)}this.collisionBoxArray=null,this.symbolQuadsArray=null,this.symbolInstancesArray=null,this.collisionTile=null,this.featureIndex=null,this.rawTileData=null,this.buckets=null,this.state="unloaded"},redoPlacement:function(t){function e(e,r){this.reloadSymbolData(r,t.map.painter,t.map.style),t.fire("tile.load",{tile:this}),this.state="loaded",this.redoWhenDone&&(this.redoPlacement(t),this.redoWhenDone=!1)}return"loaded"!==this.state||"reloading"===this.state?void(this.redoWhenDone=!0):(this.state="reloading",void t.dispatcher.send("redo placement",{uid:this.uid,source:t.id,angle:t.map.transform.angle,pitch:t.map.transform.pitch,showCollisionBoxes:t.map.showCollisionBoxes},e.bind(this),this.workerID))},getBucket:function(t){return this.buckets&&this.buckets[t.ref||t.id]},querySourceFeatures:function(t,e){if(this.rawTileData){this.vtLayers||(this.vtLayers=new l.VectorTile(new u(new Uint8Array(this.rawTileData))).layers);var r=this.vtLayers._geojsonTileLayer||this.vtLayers[e.sourceLayer];if(r)for(var n=h(e.filter),i={z:this.coord.z,x:this.coord.x,y:this.coord.y},a=0;a<r.length;a++){var o=r.feature(a);if(n(o)){var s=new c(o,this.coord.z,this.coord.x,this.coord.y);s.tile=i,t.push(s)}}}},isRenderable:function(){return"loaded"===this.state||"reloading"===this.state}}},{"../data/bucket":295,"../data/feature_index":302,"../symbol/collision_box":360,"../symbol/collision_tile":362,"../symbol/symbol_instances":371,"../symbol/symbol_quads":372,"../util/util":408,"../util/vectortile_to_geojson":409,"feature-filter":107,pbf:442,"vector-tile":511}],335:[function(t,e,r){"use strict";function n(t,e,r,n){l(!isNaN(t)&&t>=0&&t%1===0),l(!isNaN(e)&&e>=0&&e%1===0),l(!isNaN(r)&&r>=0&&r%1===0),isNaN(n)&&(n=0),this.z=+t,this.x=+e,this.y=+r,this.w=+n,n*=2,n<0&&(n=n*-1-1);var i=1<<this.z;this.id=32*(i*i*n+i*this.y+this.x)+this.z,this.posMatrix=null}function i(t,e,r){for(var n,i="",a=t;a>0;a--)n=1<<a-1,i+=(e&n?1:0)+(r&n?2:0);return i}function a(t,e){if(t.row>e.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function o(t,e,r,n,i){var a=Math.max(r,Math.floor(e.y0)),o=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx<e.x1:t.x1-e.dy/t.dy*t.dx<e.x0){var s=t;t=e,e=s}for(var l=t.dx/t.dy,u=e.dx/e.dy,c=t.dx>0,h=e.dx<0,f=a;f<o;f++){var d=l*Math.max(0,Math.min(t.dy,f+c-t.y0))+t.x0,p=u*Math.max(0,Math.min(e.dy,f+h-e.y0))+e.x0;i(Math.floor(p),Math.ceil(d),f)}}function s(t,e,r,n,i,s){var l,u=a(t,e),c=a(e,r),h=a(r,t);u.dy>c.dy&&(l=u,u=c,c=l),u.dy>h.dy&&(l=u,u=h,h=l),c.dy>h.dy&&(l=c,c=h,h=l),u.dy&&o(h,u,n,i,s),c.dy&&o(h,c,n,i,s)}var l=t("assert"),u=t("whoots-js"),c=t("../geo/coordinate");e.exports=n,n.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y},n.prototype.toCoordinate=function(t){var e=Math.min(this.z,t),r=Math.pow(2,e),n=this.y,i=this.x+r*this.w;return new c(i,n,e)},n.fromID=function(t){var e=t%32,r=1<<e,i=(t-e)/32,a=i%r,o=(i-a)/r%r,s=Math.floor(i/(r*r));return s%2!==0&&(s=s*-1-1),s/=2,new n(e,a,o,s)},n.prototype.url=function(t,e,r){var n=u.getTileBBox(this.x,this.y,this.z),a=i(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",Math.min(this.z,e||this.z)).replace("{x}",this.x).replace("{y}","tms"===r?Math.pow(2,this.z)-this.y-1:this.y).replace("{quadkey}",a).replace("{bbox-epsg-3857}",n)},n.prototype.parent=function(t){return 0===this.z?null:this.z>t?new n(this.z-1,this.x,this.y,this.w):new n(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},n.prototype.wrapped=function(){return new n(this.z,this.x,this.y,0)},n.prototype.children=function(t){if(this.z>=t)return[new n(this.z+1,this.x,this.y,this.w)];var e=this.z+1,r=2*this.x,i=2*this.y;return[new n(e,r,i,this.w),new n(e,r+1,i,this.w),new n(e,r,i+1,this.w),new n(e,r+1,i+1,this.w)]},n.cover=function(t,e,r){function i(t,e,i){var s,l,u;if(i>=0&&i<=a)for(s=t;s<e;s++)l=(s%a+a)%a,u=new n(r,l,i,Math.floor(s/a)),o[u.id]=u}var a=1<<t,o={};return s(e[0],e[1],e[2],0,a,i),s(e[2],e[3],e[0],0,a,i),Object.keys(o).map(function(t){return o[t]})}},{"../geo/coordinate":304,assert:36,"whoots-js":527}],336:[function(t,e,r){"use strict";function n(t,e,r){if(this.id=t,this.dispatcher=r,a.extend(this,a.pick(e,["url","scheme","tileSize"])),this._options=a.extend({type:"vector"},e),512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");o(e,function(t,e){return t?void this.fire("error",t):(a.extend(this,e),void this.fire("load"))}.bind(this))}var i=t("../util/evented"),a=t("../util/util"),o=t("./load_tilejson"),s=t("../util/mapbox").normalizeTileURL;e.exports=n,n.prototype=a.inherit(i,{minzoom:0,maxzoom:22,scheme:"xyz",tileSize:512,reparseOverscaled:!0,isTileClipped:!0,onAdd:function(t){this.map=t},serialize:function(){return a.extend({},this._options)},loadTile:function(t,e){function r(r,n){if(!t.aborted){if(r)return e(r);t.loadVectorData(n,this.map.style),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(this)),e(null),t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)}}var n=t.coord.z>this.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i={url:s(t.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),uid:t.uid,coord:t.coord,zoom:t.coord.z,tileSize:this.tileSize*n,source:this.id,overscaling:n,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID?"loading"===t.state?t.reloadCallback=e:(i.rawTileData=t.rawTileData,this.dispatcher.send("reload tile",i,r.bind(this),t.workerID)):t.workerID=this.dispatcher.send("load tile",i,r.bind(this))},abortTile:function(t){this.dispatcher.send("abort tile",{uid:t.uid,source:this.id},null,t.workerID)},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},null,t.workerID)}})},{"../util/evented":400,"../util/mapbox":405,"../util/util":408,"./load_tilejson":328}],337:[function(t,e,r){"use strict";function n(t,e,r){this.actor=t,this.styleLayers=e,r&&(this.loadVectorData=r),this.loading={},this.loaded={}}var i=t("../util/ajax"),a=t("vector-tile"),o=t("pbf"),s=t("./worker_tile");e.exports=n,n.prototype={loadTile:function(t,e){function r(t,r){return delete this.loading[n][i],t?e(t):r?(a.data=r.tile,a.parse(a.data,this.styleLayers.getLayerFamilies(),this.actor,r.rawTileData,e),this.loaded[n]=this.loaded[n]||{},void(this.loaded[n][i]=a)):e(null,null)}var n=t.source,i=t.uid;this.loading[n]||(this.loading[n]={});var a=this.loading[n][i]=new s(t);a.abort=this.loadVectorData(t,r.bind(this))},reloadTile:function(t,e){var r=this.loaded[t.source],n=t.uid;if(r&&r[n]){var i=r[n];i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,t.rawTileData,e)}},abortTile:function(t){var e=this.loading[t.source],r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort(),delete e[r])},removeTile:function(t){var e=this.loaded[t.source],r=t.uid;e&&e[r]&&delete e[r]},loadVectorData:function(t,e){function r(t,r){if(t)return e(t);var n=new a.VectorTile(new o(new Uint8Array(r)));e(t,{tile:n,rawTileData:r})}var n=i.getArrayBuffer(t.url,r.bind(this));return function(){n.abort()}},redoPlacement:function(t,e){var r=this.loaded[t.source],n=this.loading[t.source],i=t.uid;if(r&&r[i]){var a=r[i],o=a.redoPlacement(t.angle,t.pitch,t.showCollisionBoxes);o.result&&e(null,o.result,o.transferables)}else n&&n[i]&&(n[i].angle=t.angle)}}},{"../util/ajax":391,"./worker_tile":340,pbf:442,"vector-tile":511}],338:[function(t,e,r){"use strict";function n(t,e){this.id=t,this.urls=e.urls,this.coordinates=e.coordinates,u.getVideo(e.urls,function(t,r){if(t)return this.fire("error",{error:t});this.video=r,this.video.loop=!0;var n;this.video.addEventListener("playing",function(){n=this.map.style.animationLoop.set(1/0),this.map._rerender()}.bind(this)),this.video.addEventListener("pause",function(){this.map.style.animationLoop.cancel(n)}.bind(this)),this.map&&(this.video.play(),this.setCoordinates(e.coordinates)),this.fire("load")}.bind(this))}var i=t("../util/util"),a=t("./tile_coord"),o=t("../geo/lng_lat"),s=t("point-geometry"),l=t("../util/evented"),u=t("../util/ajax"),c=t("../data/bucket").EXTENT,h=t("../render/draw_raster").RasterBoundsArray,f=t("../data/buffer"),d=t("../render/vertex_array_object");e.exports=n,n.prototype=i.inherit(l,{minzoom:0,maxzoom:22,tileSize:512,roundZoom:!0,getVideo:function(){return this.video},onAdd:function(t){this.map||(this.map=t,this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},setCoordinates:function(t){this.coordinates=t;var e=this.map,r=t.map(function(t){return e.transform.locationCoordinate(o.convert(t)).zoomTo(0)}),n=this.centerCoord=i.getCoordinatesCenter(r);return n.column=Math.round(n.column),n.row=Math.round(n.row),this.minzoom=this.maxzoom=n.zoom,this._coord=new a(n.zoom,n.column,n.row),this._tileCoords=r.map(function(t){var e=t.zoomTo(n.zoom);return new s(Math.round((e.column-n.column)*c),Math.round((e.row-n.row)*c))}),this.fire("change"),this},_setTile:function(t){this._prepared=!1,this.tile=t;var e=32767,r=new h;r.emplaceBack(this._tileCoords[0].x,this._tileCoords[0].y,0,0),r.emplaceBack(this._tileCoords[1].x,this._tileCoords[1].y,e,0),r.emplaceBack(this._tileCoords[3].x,this._tileCoords[3].y,0,e),r.emplaceBack(this._tileCoords[2].x,this._tileCoords[2].y,e,e),this.tile.buckets={},this.tile.boundsBuffer=new f(r.serialize(),h.serialize(),f.BufferType.VERTEX),this.tile.boundsVAO=new d,this.tile.state="loaded"},prepare:function(){if(!(this.video.readyState<2)&&this.tile){var t=this.map.painter.gl;this._prepared?(t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,this.video)):(this._prepared=!0,this.tile.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.video)),this._currentTime=this.video.currentTime}},loadTile:function(t,e){this._coord&&this._coord.toString()===t.coord.toString()?(this._setTile(t),e(null)):(t.state="errored",e(null))},serialize:function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}})},{"../data/bucket":295,"../data/buffer":300,"../geo/lng_lat":305,"../render/draw_raster":317,"../render/vertex_array_object":323,"../util/ajax":391,"../util/evented":400,"../util/util":408,"./tile_coord":335,"point-geometry":448}],339:[function(t,e,r){"use strict";function n(t){this.self=t,this.actor=new a(t,this);var e={getLayers:function(){return this.layers}.bind(this),getLayerFamilies:function(){return this.layerFamilies}.bind(this)};this.workerSources={vector:new l(this.actor,e),geojson:new u(this.actor,e)},this.self.registerWorkerSource=function(t,r){if(this.workerSources[t])throw new Error('Worker source with name "'+t+'" already registered.');this.workerSources[t]=new r(this.actor,e)}.bind(this)}function i(t){var e={};for(var r in t){var n=t[r],i=n.ref||n.id,a=t[i];a.layout&&"none"===a.layout.visibility||(e[i]=e[i]||[],r===i?e[i].unshift(n):e[i].push(n))}return e}var a=t("../util/actor"),o=t("../style/style_layer"),s=t("../util/util"),l=t("./vector_tile_worker_source"),u=t("./geojson_worker_source");e.exports=function(t){return new n(t)},s.extend(n.prototype,{"set layers":function(t){function e(t){var e=o.create(t,t.ref&&r.layers[t.ref]);e.updatePaintTransitions({},{transition:!1}),r.layers[e.id]=e}this.layers={};for(var r=this,n=[],a=0;a<t.length;a++){var s=t[a];"fill"!==s.type&&"line"!==s.type&&"circle"!==s.type&&"symbol"!==s.type||(s.ref?n.push(a):e(s))}for(var l=0;l<n.length;l++)e(t[n[l]]);this.layerFamilies=i(this.layers)},"update layers":function(t){function e(t){var e=a.layers[t.ref];a.layers[t.id]?a.layers[t.id].set(t,e):a.layers[t.id]=o.create(t,e),a.layers[t.id].updatePaintTransitions({},{transition:!1})}var r,n,a=this;for(r in t)n=t[r],n.ref&&e(n);for(r in t)n=t[r],n.ref||e(n);this.layerFamilies=i(this.layers)},"load tile":function(t,e){var r=t.type||"vector";this.workerSources[r].loadTile(t,e)},"reload tile":function(t,e){var r=t.type||"vector";this.workerSources[r].reloadTile(t,e)},"abort tile":function(t){var e=t.type||"vector";this.workerSources[e].abortTile(t)},"remove tile":function(t){var e=t.type||"vector";this.workerSources[e].removeTile(t)},"redo placement":function(t,e){var r=t.type||"vector";this.workerSources[r].redoPlacement(t,e)},"load worker source":function(t,e){try{this.self.importScripts(t.url),e()}catch(t){e(t)}}})},{"../style/style_layer":347,"../util/actor":390,"../util/util":408,"./geojson_worker_source":325,"./vector_tile_worker_source":337}],340:[function(t,e,r){"use strict";function n(t){this.coord=t.coord,this.uid=t.uid,this.zoom=t.zoom,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=t.overscaling,this.angle=t.angle,this.pitch=t.pitch,this.showCollisionBoxes=t.showCollisionBoxes}function i(t){return!t.isEmpty()}function a(t){return t.serialize()}function o(t){var e=[];for(var r in t)t[r].getTransferables(e);return e}function s(t){return t.id}var l=t("../data/feature_index"),u=t("../symbol/collision_tile"),c=t("../data/bucket"),h=t("../symbol/collision_box"),f=t("../util/dictionary_coder"),d=t("../util/util"),p=t("../symbol/symbol_instances"),m=t("../symbol/symbol_quads");e.exports=n,n.prototype.parse=function(t,e,r,n,g){function v(t,e){for(var r=0;r<t.length;r++){var n=t.feature(r);n.index=r;for(var i in e)e[i].filter(n)&&e[i].features.push(n)}}function y(t){if(t)return g(t);if(N++,2===N){for(var e=P.length-1;e>=0;e--)x(S,P[e]);b()}}function x(t,e){if(e.populateArrays(k,j,F),"symbol"!==e.type)for(var r=0;r<e.features.length;r++){var n=e.features[r];T.insert(n,n.index,e.sourceLayerIndex,e.index)}e.features=null}function b(){S.status="done",S.redoPlacementAfterDone&&(S.redoPlacement(S.angle,S.pitch,null),S.redoPlacementAfterDone=!1);var t=T.serialize(),e=k.serialize(),r=S.collisionBoxArray.serialize(),s=S.symbolInstancesArray.serialize(),l=S.symbolQuadsArray.serialize(),u=[n].concat(t.transferables).concat(e.transferables),c=D.filter(i);g(null,{buckets:c.map(a),featureIndex:t.data,collisionTile:e.data,collisionBoxArray:r,symbolInstancesArray:s,symbolQuadsArray:l,rawTileData:n},o(c).concat(u))}this.status="parsing",this.data=t,this.collisionBoxArray=new h,this.symbolInstancesArray=new p,this.symbolQuadsArray=new m;var _,w,M,A,k=new u(this.angle,this.pitch,this.collisionBoxArray),T=new l(this.coord,this.overscaling,k,t.layers),E=new f(t.layers?Object.keys(t.layers).sort():["_geojsonTileLayer"]),S=this,L={},C={},I=0;for(var z in e)w=e[z][0],w.source===this.source&&(w.ref||w.minzoom&&this.zoom<w.minzoom||w.maxzoom&&this.zoom>=w.maxzoom||w.layout&&"none"===w.layout.visibility||t.layers&&!t.layers[w.sourceLayer]||(A=c.create({layer:w,index:I++,childLayers:e[z],zoom:this.zoom,overscaling:this.overscaling,showCollisionBoxes:this.showCollisionBoxes,collisionBoxArray:this.collisionBoxArray,symbolQuadsArray:this.symbolQuadsArray,symbolInstancesArray:this.symbolInstancesArray,sourceLayerIndex:E.encode(w.sourceLayer||"_geojsonTileLayer")}),A.createFilter(),L[w.id]=A,t.layers&&(M=w.sourceLayer,C[M]=C[M]||{},C[M][w.id]=A)));if(t.layers)for(M in C)1===w.version&&d.warnOnce('Vector tile source "'+this.source+'" layer "'+M+'" does not use vector tile spec v2 and therefore may have some rendering errors.'),w=t.layers[M],w&&v(w,C[M]);else v(t,L);var D=[],P=this.symbolBuckets=[],O=[];T.bucketLayerIDs={};for(var R in L)A=L[R],0!==A.features.length&&(T.bucketLayerIDs[A.index]=A.childLayers.map(s),D.push(A),"symbol"===A.type?P.push(A):O.push(A));var F={},j={},N=0;if(P.length>0){for(_=P.length-1;_>=0;_--)P[_].updateIcons(F),P[_].updateFont(j);for(var B in j)j[B]=Object.keys(j[B]).map(Number);F=Object.keys(F),r.send("get glyphs",{uid:this.uid,stacks:j},function(t,e){j=e,y(t)}),F.length?r.send("get icons",{icons:F},function(t,e){F=e,y(t)}):y()}for(_=O.length-1;_>=0;_--)x(this,O[_]);if(0===P.length)return b()},n.prototype.redoPlacement=function(t,e,r){if("done"!==this.status)return this.redoPlacementAfterDone=!0,this.angle=t,{};for(var n=new u(t,e,this.collisionBoxArray),s=this.symbolBuckets,l=s.length-1;l>=0;l--)s[l].placeFeatures(n,r);var c=n.serialize(),h=s.filter(i);return{result:{buckets:h.map(a),collisionTile:c.data},transferables:o(h).concat(c.transferables)}}},{"../data/bucket":295,"../data/feature_index":302,"../symbol/collision_box":360,"../symbol/collision_tile":362,"../symbol/symbol_instances":371,"../symbol/symbol_quads":372,"../util/dictionary_coder":398,"../util/util":408}],341:[function(t,e,r){"use strict";function n(){this.n=0,this.times=[]}e.exports=n,n.prototype.stopped=function(){return this.times=this.times.filter(function(t){return t.time>=(new Date).getTime()}),!this.times.length},n.prototype.set=function(t){return this.times.push({id:this.n,time:t+(new Date).getTime()}),this.n++},n.prototype.cancel=function(t){this.times=this.times.filter(function(e){return e.id!==t})}},{}],342:[function(t,e,r){"use strict";function n(t){this.base=t,this.retina=s.devicePixelRatio>1;var e=this.retina?"@2x":"";o.getJSON(l(t,e,".json"),function(t,e){return t?void this.fire("error",{error:t}):(this.data=e,void(this.img&&this.fire("load")))}.bind(this)),o.getImage(l(t,e,".png"),function(t,e){if(t)return void this.fire("error",{error:t});for(var r=e.getData(),n=e.data=new Uint8Array(r.length),i=0;i<r.length;i+=4){var a=r[i+3]/255;n[i+0]=r[i+0]*a,n[i+1]=r[i+1]*a,n[i+2]=r[i+2]*a,n[i+3]=r[i+3]}this.img=e,this.data&&this.fire("load")}.bind(this))}function i(){}var a=t("../util/evented"),o=t("../util/ajax"),s=t("../util/browser"),l=t("../util/mapbox").normalizeSpriteURL;e.exports=n,n.prototype=Object.create(a),n.prototype.toJSON=function(){return this.base},n.prototype.loaded=function(){return!(!this.data||!this.img)},n.prototype.resize=function(){if(s.devicePixelRatio>1!==this.retina){var t=new n(this.base);t.on("load",function(){this.img=t.img,this.data=t.data,this.retina=t.retina}.bind(this))}},i.prototype={x:0,y:0,width:0,height:0,pixelRatio:1,sdf:!1},n.prototype.getSpritePosition=function(t){if(!this.loaded())return new i;var e=this.data&&this.data[t];return e&&this.img?e:new i}},{"../util/ajax":391,"../util/browser":392,"../util/evented":400,"../util/mapbox":405}],343:[function(t,e,r){"use strict";var n=t("csscolorparser").parseCSSColor,i=t("../util/util"),a=t("./style_function"),o={};e.exports=function t(e){if(a.isFunctionDefinition(e))return i.extend({},e,{stops:e.stops.map(function(e){return[e[0],t(e[1])]})});if("string"==typeof e){if(!o[e]){var r=n(e);if(!r)throw new Error("Invalid color "+e);o[e]=[r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]]}return o[e]}throw new Error("Invalid color "+e)}},{"../util/util":408,"./style_function":346,csscolorparser:91}],344:[function(t,e,r){"use strict";function n(t,e,r){this.animationLoop=e||new m,this.dispatcher=new p(r||1,this),this.spriteAtlas=new l(1024,1024),this.lineAtlas=new u(256,512),this._layers={},this._order=[],this._groups=[],this.sources={},this.zoomHistory={},c.bindAll(["_forwardSourceEvent","_forwardTileEvent","_forwardLayerEvent","_redoPlacement"],this),this._resetUpdates();var n=function(t,e){if(t)return void this.fire("error",{error:t});if(!g.emitErrors(this,g(e))){this._loaded=!0,this.stylesheet=e,this.updateClasses();var r=e.sources;for(var n in r)this.addSource(n,r[n]);e.sprite&&(this.sprite=new o(e.sprite),this.sprite.on("load",this.fire.bind(this,"change"))),this.glyphSource=new s(e.glyphs),this._resolve(),this.fire("load")}}.bind(this);"string"==typeof t?h.getJSON(f(t),n):d.frame(n.bind(this,null,t)),this.on("source.load",function(t){var e=t.source;if(e&&e.vectorLayerIds)for(var r in this._layers){var n=this._layers[r];n.source===e.id&&this._validateLayer(n)}})}var i=t("../util/evented"),a=t("./style_layer"),o=t("./image_sprite"),s=t("../symbol/glyph_source"),l=t("../symbol/sprite_atlas"),u=t("../render/line_atlas"),c=t("../util/util"),h=t("../util/ajax"),f=t("../util/mapbox").normalizeStyleURL,d=t("../util/browser"),p=t("../util/dispatcher"),m=t("./animation_loop"),g=t("./validate_style"),v=t("../source/source"),y=t("../source/query_features"),x=t("../source/source_cache"),b=t("./style_spec"),_=t("./style_function");e.exports=n,n.prototype=c.inherit(i,{_loaded:!1,_validateLayer:function(t){var e=this.sources[t.source];t.sourceLayer&&e&&e.vectorLayerIds&&e.vectorLayerIds.indexOf(t.sourceLayer)===-1&&this.fire("error",{error:new Error('Source layer "'+t.sourceLayer+'" does not exist on source "'+e.id+'" as specified by style layer "'+t.id+'"')})},loaded:function(){if(!this._loaded)return!1;if(Object.keys(this._updates.sources).length)return!1;for(var t in this.sources)if(!this.sources[t].loaded())return!1;return!(this.sprite&&!this.sprite.loaded())},_resolve:function(){var t,e;this._layers={},this._order=this.stylesheet.layers.map(function(t){return t.id});for(var r=0;r<this.stylesheet.layers.length;r++)e=this.stylesheet.layers[r],e.ref||(t=a.create(e),this._layers[t.id]=t,t.on("error",this._forwardLayerEvent));for(var n=0;n<this.stylesheet.layers.length;n++)if(e=this.stylesheet.layers[n],e.ref){var i=this.getLayer(e.ref);t=a.create(e,i),this._layers[t.id]=t,t.on("error",this._forwardLayerEvent)}this._groupLayers(),this._updateWorkerLayers()},_groupLayers:function(){var t;this._groups=[];for(var e=0;e<this._order.length;++e){var r=this._layers[this._order[e]];t&&r.source===t.source||(t=[],t.source=r.source,this._groups.push(t)),t.push(r)}},_updateWorkerLayers:function(t){this.dispatcher.broadcast(t?"update layers":"set layers",this._serializeLayers(t))},_serializeLayers:function(t){t=t||this._order;for(var e=[],r={includeRefProperties:!0},n=0;n<t.length;n++)e.push(this._layers[t[n]].serialize(r));return e},_applyClasses:function(t,e){if(this._loaded){t=t||[],e=e||{transition:!0};var r=this.stylesheet.transition||{},n=this._updates.allPaintProps?this._layers:this._updates.paintProps;for(var i in n){var a=this._layers[i],o=this._updates.paintProps[i];if(this._updates.allPaintProps||o.all)a.updatePaintTransitions(t,e,r,this.animationLoop);else for(var s in o)this._layers[i].updatePaintTransition(s,t,e,r,this.animationLoop)}}},_recalculate:function(t){for(var e in this.sources)this.sources[e].used=!1;this._updateZoomHistory(t),this.rasterFadeDuration=300;for(var r in this._layers){var n=this._layers[r];n.recalculate(t,this.zoomHistory),!n.isHidden(t)&&n.source&&(this.sources[n.source].used=!0)}var i=300;Math.floor(this.z)!==Math.floor(t)&&this.animationLoop.set(i),this.z=t,this.fire("zoom")},_updateZoomHistory:function(t){var e=this.zoomHistory;void 0===e.lastIntegerZoom&&(e.lastIntegerZoom=Math.floor(t),e.lastIntegerZoomTime=0,e.lastZoom=t),Math.floor(e.lastZoom)<Math.floor(t)?(e.lastIntegerZoom=Math.floor(t),e.lastIntegerZoomTime=Date.now()):Math.floor(e.lastZoom)>Math.floor(t)&&(e.lastIntegerZoom=Math.floor(t+1),e.lastIntegerZoomTime=Date.now()),e.lastZoom=t},_checkLoaded:function(){if(!this._loaded)throw new Error("Style is not done loading")},update:function(t,e){if(!this._updates.changed)return this;if(this._updates.allLayers)this._groupLayers(),this._updateWorkerLayers();else{var r=Object.keys(this._updates.layers);r.length&&this._updateWorkerLayers(r)}var n,i=Object.keys(this._updates.sources);for(n=0;n<i.length;n++)this._reloadSource(i[n]);for(n=0;n<this._updates.events.length;n++){var a=this._updates.events[n];this.fire(a[0],a[1])}return this._applyClasses(t,e),this._updates.changed&&this.fire("change"),this._resetUpdates(),this},_resetUpdates:function(){this._updates={events:[],layers:{},sources:{},paintProps:{}}},addSource:function(t,e){if(this._checkLoaded(),void 0!==this.sources[t])throw new Error("There is already a source with this ID");if(!e.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(e)+".");var r=["vector","raster","geojson","video","image"],n=r.indexOf(e.type)>=0;return n&&this._handleErrors(g.source,"sources."+t,e)?this:(e=new x(t,e,this.dispatcher),this.sources[t]=e,e.style=this,e.on("load",this._forwardSourceEvent).on("error",this._forwardSourceEvent).on("change",this._forwardSourceEvent).on("tile.add",this._forwardTileEvent).on("tile.load",this._forwardTileEvent).on("tile.error",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.add",{source:e}]),this._updates.changed=!0,this)},removeSource:function(t){if(this._checkLoaded(),void 0===this.sources[t])throw new Error("There is no source with this ID");var e=this.sources[t];return delete this.sources[t],delete this._updates.sources[t],e.off("load",this._forwardSourceEvent).off("error",this._forwardSourceEvent).off("change",this._forwardSourceEvent).off("tile.add",this._forwardTileEvent).off("tile.load",this._forwardTileEvent).off("tile.error",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.remove",{source:e}]),this._updates.changed=!0,this},getSource:function(t){return this.sources[t]&&this.sources[t].getSource()},addLayer:function(t,e){if(this._checkLoaded(),!(t instanceof a)){if(this._handleErrors(g.layer,"layers."+t.id,t,!1,{arrayIndex:-1}))return this;var r=t.ref&&this.getLayer(t.ref);t=a.create(t,r)}return this._validateLayer(t),t.on("error",this._forwardLayerEvent),this._layers[t.id]=t,this._order.splice(e?this._order.indexOf(e):1/0,0,t.id),this._updates.allLayers=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.events.push(["layer.add",{layer:t}]),this.updateClasses(t.id)},removeLayer:function(t){this._checkLoaded();var e=this._layers[t];if(void 0===e)throw new Error("There is no layer with this ID");for(var r in this._layers)this._layers[r].ref===t&&this.removeLayer(r);return e.off("error",this._forwardLayerEvent),delete this._layers[t],delete this._updates.layers[t],delete this._updates.paintProps[t],this._order.splice(this._order.indexOf(t),1),this._updates.allLayers=!0,this._updates.events.push(["layer.remove",{layer:e}]),this._updates.changed=!0,this},getLayer:function(t){return this._layers[t]},getReferentLayer:function(t){var e=this.getLayer(t);return e.ref&&(e=this.getLayer(e.ref)),e},setLayerZoomRange:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return n.minzoom===e&&n.maxzoom===r?this:(null!=e&&(n.minzoom=e),null!=r&&(n.maxzoom=r),this._updateLayer(n))},setFilter:function(t,e){this._checkLoaded();var r=this.getReferentLayer(t);return null!==e&&this._handleErrors(g.filter,"layers."+r.id+".filter",e)?this:c.deepEqual(r.filter,e)?this:(r.filter=c.clone(e),this._updateLayer(r))},getFilter:function(t){return this.getReferentLayer(t).filter},setLayoutProperty:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return c.deepEqual(n.getLayoutProperty(e),r)?this:(n.setLayoutProperty(e,r),this._updateLayer(n))},getLayoutProperty:function(t,e){return this.getReferentLayer(t).getLayoutProperty(e)},setPaintProperty:function(t,e,r,n){this._checkLoaded();var i=this.getLayer(t);if(c.deepEqual(i.getPaintProperty(e,n),r))return this;var a=i.isPaintValueFeatureConstant(e);i.setPaintProperty(e,r,n);var o=!(r&&_.isFunctionDefinition(r)&&"$zoom"!==r.property&&void 0!==r.property);return o&&a||(this._updates.layers[t]=!0,i.source&&(this._updates.sources[i.source]=!0)),this.updateClasses(t,e)},getPaintProperty:function(t,e,r){return this.getLayer(t).getPaintProperty(e,r)},updateClasses:function(t,e){if(this._updates.changed=!0,t){var r=this._updates.paintProps;r[t]||(r[t]={}),r[t][e||"all"]=!0}else this._updates.allPaintProps=!0;return this},serialize:function(){return c.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:c.mapObject(this.sources,function(t){return t.serialize()}),layers:this._order.map(function(t){return this._layers[t].serialize()},this)},function(t){return void 0!==t})},_updateLayer:function(t){return this._updates.layers[t.id]=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.changed=!0,this},_flattenRenderedFeatures:function(t){for(var e=[],r=this._order.length-1;r>=0;r--)for(var n=this._order[r],i=0;i<t.length;i++){var a=t[i][n];if(a)for(var o=0;o<a.length;o++)e.push(a[o])}return e},queryRenderedFeatures:function(t,e,r,n){e&&e.filter&&this._handleErrors(g.filter,"queryRenderedFeatures.filter",e.filter,!0);var i={};if(e&&e.layers)for(var a=0;a<e.layers.length;a++){var o=e.layers[a];i[this._layers[o].source]=!0}var s=[];for(var l in this.sources)if(!e.layers||i[l]){var u=this.sources[l],c=y.rendered(u,this._layers,t,e,r,n);s.push(c)}return this._flattenRenderedFeatures(s)},querySourceFeatures:function(t,e){e&&e.filter&&this._handleErrors(g.filter,"querySourceFeatures.filter",e.filter,!0);var r=this.sources[t];return r?y.source(r,e):[]},addSourceType:function(t,e,r){return v.getType(t)?r(new Error('A source type called "'+t+'" already exists.')):(v.setType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("load worker source",{name:t,url:e.workerSourceURL},r):r(null,null))},_handleErrors:function(t,e,r,n,i){var a=n?g.throwErrors:g.emitErrors,o=t.call(g,c.extend({key:e,style:this.serialize(),value:r,styleSpec:b},i));return a.call(g,this,o)},_remove:function(){this.dispatcher.remove()},_reloadSource:function(t){this.sources[t].reload()},_updateSources:function(t){for(var e in this.sources)this.sources[e].update(t)},_redoPlacement:function(){for(var t in this.sources)this.sources[t].redoPlacement&&this.sources[t].redoPlacement()},_forwardSourceEvent:function(t){this.fire("source."+t.type,c.extend({source:t.target.getSource()},t))},_forwardTileEvent:function(t){this.fire(t.type,c.extend({source:t.target},t))},_forwardLayerEvent:function(t){this.fire("layer."+t.type,c.extend({layer:{id:t.target.id}},t))},"get sprite json":function(t,e){var r=this.sprite;r.loaded()?e(null,{sprite:r.data,retina:r.retina}):r.on("load",function(){e(null,{sprite:r.data,retina:r.retina})})},"get icons":function(t,e){var r=this.sprite,n=this.spriteAtlas;r.loaded()?(n.setSprite(r),n.addIcons(t.icons,e)):r.on("load",function(){n.setSprite(r),n.addIcons(t.icons,e)})},"get glyphs":function(t,e){function r(t,r,n){t&&console.error(t),a[n]=r,i--,0===i&&e(null,a)}var n=t.stacks,i=Object.keys(n).length,a={};for(var o in n)this.glyphSource.getSimpleGlyphs(o,n[o],t.uid,r)}})},{"../render/line_atlas":320,"../source/query_features":330,"../source/source":332,"../source/source_cache":333,"../symbol/glyph_source":365,"../symbol/sprite_atlas":370,"../util/ajax":391,"../util/browser":392,"../util/dispatcher":399,"../util/evented":400,"../util/mapbox":405,"../util/util":408,"./animation_loop":341,"./image_sprite":342,"./style_function":346,"./style_layer":347,"./style_spec":354,"./validate_style":356}],345:[function(t,e,r){"use strict";function n(t,e){this.value=s.clone(e),this.isFunction=a.isFunctionDefinition(e),this.json=JSON.stringify(this.value);var r="color"===t.type&&this.value?o(this.value):e;if(this.calculate=a[t.function||"piecewise-constant"](r),this.isFeatureConstant=this.calculate.isFeatureConstant,this.isZoomConstant=this.calculate.isZoomConstant,"piecewise-constant"===t.function&&t.transition&&(this.calculate=i(this.calculate)),!this.isFeatureConstant&&!this.isZoomConstant){this.stopZoomLevels=[];for(var n=[],l=this.value.stops,u=0;u<this.value.stops.length;u++){var c=l[u][0].zoom;this.stopZoomLevels.indexOf(c)<0&&(this.stopZoomLevels.push(c),n.push([c,n.length]))}this.calculateInterpolationT=a.interpolated({stops:n,base:e.base})}}function i(t){return function(e,r){var n,i,a,o=e.zoom,s=e.zoomHistory,l=e.duration,u=o%1,c=Math.min((Date.now()-s.lastIntegerZoomTime)/l,1),h=1,f=1;return o>s.lastIntegerZoom?(n=u+(1-u)*c,h*=2,i=t({zoom:o-1},r),a=t({zoom:o},r)):(n=1-(1-c)*u,a=t({zoom:o},r),i=t({zoom:o+1},r),h/=2),void 0===i||void 0===a?void 0:{from:i,fromScale:h,to:a,toScale:f,t:n}}}var a=t("./style_function"),o=t("./parse_color"),s=t("../util/util");e.exports=n},{"../util/util":408,"./parse_color":343,"./style_function":346}],346:[function(t,e,r){"use strict";var n=t("mapbox-gl-function");r.interpolated=function(t){var e=n.interpolated(t),r=function(t,r){return e(t&&t.zoom,r||{})};return r.isFeatureConstant=e.isFeatureConstant,r.isZoomConstant=e.isZoomConstant,r},r["piecewise-constant"]=function(t){var e=n["piecewise-constant"](t),r=function(t,r){return e(t&&t.zoom,r||{})};return r.isFeatureConstant=e.isFeatureConstant,r.isZoomConstant=e.isZoomConstant,r},r.isFunctionDefinition=n.isFunctionDefinition},{"mapbox-gl-function":268}],347:[function(t,e,r){"use strict";function n(t,e){this.set(t,e)}function i(t){return t.value}var a=t("../util/util"),o=t("./style_transition"),s=t("./style_declaration"),l=t("./style_spec"),u=t("./validate_style"),c=t("./parse_color"),h=t("../util/evented");e.exports=n;var f="-transition";n.create=function(e,r){var n={background:t("./style_layer/background_style_layer"),circle:t("./style_layer/circle_style_layer"),fill:t("./style_layer/fill_style_layer"),line:t("./style_layer/line_style_layer"),raster:t("./style_layer/raster_style_layer"),symbol:t("./style_layer/symbol_style_layer")};return new n[(r||e).type](e,r)},n.prototype=a.inherit(h,{set:function(t,e){this.id=t.id,this.ref=t.ref,this.metadata=t.metadata,this.type=(e||t).type,this.source=(e||t).source,this.sourceLayer=(e||t)["source-layer"],this.minzoom=(e||t).minzoom,this.maxzoom=(e||t).maxzoom,this.filter=(e||t).filter,this.paint={},this.layout={},this._paintSpecifications=l["paint_"+this.type],this._layoutSpecifications=l["layout_"+this.type],this._paintTransitions={},this._paintTransitionOptions={},this._paintDeclarations={},this._layoutDeclarations={},this._layoutFunctions={};var r,n;for(var i in t){var a=i.match(/^paint(?:\.(.*))?$/);if(a){var o=a[1]||"";for(r in t[i])this.setPaintProperty(r,t[i][r],o)}}if(this.ref)this._layoutDeclarations=e._layoutDeclarations;else for(n in t.layout)this.setLayoutProperty(n,t.layout[n]);for(r in this._paintSpecifications)this.paint[r]=this.getPaintValue(r);for(n in this._layoutSpecifications)this._updateLayoutValue(n)},setLayoutProperty:function(t,e){if(null==e)delete this._layoutDeclarations[t];else{var r="layers."+this.id+".layout."+t;if(this._handleErrors(u.layoutProperty,r,t,e))return;this._layoutDeclarations[t]=new s(this._layoutSpecifications[t],e)}this._updateLayoutValue(t)},getLayoutProperty:function(t){return this._layoutDeclarations[t]&&this._layoutDeclarations[t].value},getLayoutValue:function(t,e,r){var n=this._layoutSpecifications[t],i=this._layoutDeclarations[t];return i?i.calculate(e,r):n.default},setPaintProperty:function(t,e,r){var n="layers."+this.id+(r?'["paint.'+r+'"].':".paint.")+t;if(a.endsWith(t,f))if(this._paintTransitionOptions[r||""]||(this._paintTransitionOptions[r||""]={}),null===e||void 0===e)delete this._paintTransitionOptions[r||""][t];else{if(this._handleErrors(u.paintProperty,n,t,e))return;this._paintTransitionOptions[r||""][t]=e}else if(this._paintDeclarations[r||""]||(this._paintDeclarations[r||""]={}),null===e||void 0===e)delete this._paintDeclarations[r||""][t];else{if(this._handleErrors(u.paintProperty,n,t,e))return;this._paintDeclarations[r||""][t]=new s(this._paintSpecifications[t],e)}},getPaintProperty:function(t,e){return e=e||"",a.endsWith(t,f)?this._paintTransitionOptions[e]&&this._paintTransitionOptions[e][t]:this._paintDeclarations[e]&&this._paintDeclarations[e][t]&&this._paintDeclarations[e][t].value},getPaintValue:function(t,e,r){var n=this._paintSpecifications[t],i=this._paintTransitions[t];return i?i.calculate(e,r):"color"===n.type&&n.default?c(n.default):n.default},getPaintValueStopZoomLevels:function(t){var e=this._paintTransitions[t];return e?e.declaration.stopZoomLevels:[]},getPaintInterpolationT:function(t,e){var r=this._paintTransitions[t];return r.declaration.calculateInterpolationT({zoom:e})},isPaintValueFeatureConstant:function(t){var e=this._paintTransitions[t];return!e||e.declaration.isFeatureConstant},isLayoutValueFeatureConstant:function(t){var e=this._layoutDeclarations[t];return!e||e.isFeatureConstant},isPaintValueZoomConstant:function(t){var e=this._paintTransitions[t];return!e||e.declaration.isZoomConstant},isHidden:function(t){return!!(this.minzoom&&t<this.minzoom)||(!!(this.maxzoom&&t>=this.maxzoom)||("none"===this.layout.visibility||0===this.paint[this.type+"-opacity"]))},updatePaintTransitions:function(t,e,r,n){for(var i=a.extend({},this._paintDeclarations[""]),o=0;o<t.length;o++)a.extend(i,this._paintDeclarations[t[o]]);var s;for(s in i)this._applyPaintDeclaration(s,i[s],e,r,n);for(s in this._paintTransitions)s in i||this._applyPaintDeclaration(s,null,e,r,n)},updatePaintTransition:function(t,e,r,n,i){for(var a=this._paintDeclarations[""][t],o=0;o<e.length;o++){var s=this._paintDeclarations[e[o]];s&&s[t]&&(a=s[t])}this._applyPaintDeclaration(t,a,r,n,i)},recalculate:function(t,e){for(var r in this._paintTransitions)this.paint[r]=this.getPaintValue(r,{zoom:t,zoomHistory:e});for(var n in this._layoutFunctions)this.layout[n]=this.getLayoutValue(n,{zoom:t,zoomHistory:e})},serialize:function(t){var e={id:this.id,ref:this.ref,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom};for(var r in this._paintDeclarations){var n=""===r?"paint":"paint."+r;e[n]=a.mapObject(this._paintDeclarations[r],i)}return(!this.ref||t&&t.includeRefProperties)&&a.extend(e,{type:this.type,source:this.source,"source-layer":this.sourceLayer,filter:this.filter,layout:a.mapObject(this._layoutDeclarations,i)}),a.filterObject(e,function(t,e){return void 0!==t&&!("layout"===e&&!Object.keys(t).length)})},_applyPaintDeclaration:function(t,e,r,n,i){var l=r.transition?this._paintTransitions[t]:void 0,u=this._paintSpecifications[t];if(null!==e&&void 0!==e||(e=new s(u,u.default)),!l||l.declaration.json!==e.json){var c=a.extend({duration:300,delay:0},n,this.getPaintProperty(t+f)),h=this._paintTransitions[t]=new o(u,e,l,c);h.instant()||(h.loopID=i.set(h.endTime-Date.now())),l&&i.cancel(l.loopID)}},_updateLayoutValue:function(t){var e=this._layoutDeclarations[t];e&&e.isFunction?this._layoutFunctions[t]=!0:(delete this._layoutFunctions[t],this.layout[t]=this.getLayoutValue(t))},_handleErrors:function(t,e,r,n){return u.emitErrors(this,t.call(u,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:l,style:{glyphs:!0,sprite:!0}}))}})},{"../util/evented":400,"../util/util":408,"./parse_color":343,"./style_declaration":345,"./style_layer/background_style_layer":348,"./style_layer/circle_style_layer":349,"./style_layer/fill_style_layer":350,"./style_layer/line_style_layer":351,"./style_layer/raster_style_layer":352,"./style_layer/symbol_style_layer":353,"./style_spec":354,"./style_transition":355,"./validate_style":356}],348:[function(t,e,r){"use strict";function n(){a.apply(this,arguments)}var i=t("../../util/util"),a=t("../style_layer");e.exports=n,n.prototype=i.inherit(a,{})},{"../../util/util":408,"../style_layer":347}],349:[function(t,e,r){"use strict";function n(){a.apply(this,arguments)}var i=t("../../util/util"),a=t("../style_layer");e.exports=n,n.prototype=i.inherit(a,{})},{"../../util/util":408,"../style_layer":347}],350:[function(t,e,r){"use strict";function n(){a.apply(this,arguments)}var i=t("../../util/util"),a=t("../style_layer");n.prototype=i.inherit(a,{getPaintValue:function(t,e,r){return"fill-outline-color"===t&&void 0===this.getPaintProperty("fill-outline-color")?a.prototype.getPaintValue.call(this,"fill-color",e,r):a.prototype.getPaintValue.call(this,t,e,r)},getPaintValueStopZoomLevels:function(t){return"fill-outline-color"===t&&void 0===this.getPaintProperty("fill-outline-color")?a.prototype.getPaintValueStopZoomLevels.call(this,"fill-color"):a.prototype.getPaintValueStopZoomLevels.call(this,arguments)},getPaintInterpolationT:function(t,e){return"fill-outline-color"===t&&void 0===this.getPaintProperty("fill-outline-color")?a.prototype.getPaintInterpolationT.call(this,"fill-color",e):a.prototype.getPaintInterpolationT.call(this,t,e)},isPaintValueFeatureConstant:function(t){return"fill-outline-color"===t&&void 0===this.getPaintProperty("fill-outline-color")?a.prototype.isPaintValueFeatureConstant.call(this,"fill-color"):a.prototype.isPaintValueFeatureConstant.call(this,t)},isPaintValueZoomConstant:function(t){return"fill-outline-color"===t&&void 0===this.getPaintProperty("fill-outline-color")?a.prototype.isPaintValueZoomConstant.call(this,"fill-color"):a.prototype.isPaintValueZoomConstant.call(this,t)}}),e.exports=n},{"../../util/util":408,"../style_layer":347}],351:[function(t,e,r){"use strict";function n(){a.apply(this,arguments)}var i=t("../../util/util"),a=t("../style_layer");e.exports=n,n.prototype=i.inherit(a,{getPaintValue:function(t,e,r){var n=a.prototype.getPaintValue.apply(this,arguments);if(n&&"line-dasharray"===t){var i=Math.floor(e.zoom);this._flooredZoom!==i&&(this._flooredZoom=i,this._flooredLineWidth=this.getPaintValue("line-width",e,r)),n.fromScale*=this._flooredLineWidth,n.toScale*=this._flooredLineWidth}return n}})},{"../../util/util":408,"../style_layer":347}],352:[function(t,e,r){"use strict";function n(){a.apply(this,arguments)}var i=t("../../util/util"),a=t("../style_layer");e.exports=n,n.prototype=i.inherit(a,{})},{"../../util/util":408,"../style_layer":347}],353:[function(t,e,r){"use strict";function n(){a.apply(this,arguments)}var i=t("../../util/util"),a=t("../style_layer");e.exports=n,n.prototype=i.inherit(a,{isHidden:function(){if(a.prototype.isHidden.apply(this,arguments))return!0;var t=0===this.paint["text-opacity"]||!this.layout["text-field"],e=0===this.paint["icon-opacity"]||!this.layout["icon-image"];return!(!t||!e)},getLayoutValue:function(t,e,r){return("text-rotation-alignment"!==t||"line"!==this.getLayoutValue("symbol-placement",e,r)||this.getLayoutProperty("text-rotation-alignment"))&&("icon-rotation-alignment"!==t||"line"!==this.getLayoutValue("symbol-placement",e,r)||this.getLayoutProperty("icon-rotation-alignment"))?"text-pitch-alignment"!==t||this.getLayoutProperty("text-pitch-alignment")?a.prototype.getLayoutValue.apply(this,arguments):this.getLayoutValue("text-rotation-alignment"):"map"}})},{"../../util/util":408,"../style_layer":347}],354:[function(t,e,r){"use strict";e.exports=t("mapbox-gl-style-spec/reference/latest.min")},{"mapbox-gl-style-spec/reference/latest.min":291}],355:[function(t,e,r){"use strict";function n(t,e,r,n){this.declaration=e,this.startTime=this.endTime=(new Date).getTime(),"piecewise-constant"===t.function&&t.transition?this.interp=i:this.interp=o[t.type],this.oldTransition=r,this.duration=n.duration||0,this.delay=n.delay||0,this.instant()||(this.endTime=this.startTime+this.duration+this.delay,this.ease=a.easeCubicInOut),r&&r.endTime<=this.startTime&&delete r.oldTransition}function i(t,e,r){return void 0===(t&&t.to)||void 0===(e&&e.to)?void 0:{from:t.to,fromScale:t.toScale,to:e.to,toScale:e.toScale,t:r}}var a=t("../util/util"),o=t("../util/interpolate");e.exports=n,n.prototype.instant=function(){return!this.oldTransition||!this.interp||0===this.duration&&0===this.delay},n.prototype.calculate=function(t,e){var r=this.declaration.calculate(a.extend({},t,{duration:this.duration}),e);if(this.instant())return r;var n=t.time||Date.now();if(n<this.endTime){var i=this.oldTransition.calculate(a.extend({},t,{time:this.startTime}),e),o=this.ease((n-this.startTime-this.delay)/this.duration);r=this.interp(i,r,o)}return r}},{"../util/interpolate":402,"../util/util":408}],356:[function(t,e,r){"use strict";e.exports=t("mapbox-gl-style-spec/lib/validate_style.min"),e.exports.emitErrors=function(t,e){if(e&&e.length){for(var r=0;r<e.length;r++)t.fire("error",{error:new Error(e[r].message)});return!0}return!1},e.exports.throwErrors=function(t,e){if(e)for(var r=0;r<e.length;r++)throw new Error(e[r].message)}},{"mapbox-gl-style-spec/lib/validate_style.min":290}],357:[function(t,e,r){"use strict";function n(t,e,r,n){this.x=t,this.y=e,this.angle=r,void 0!==n&&(this.segment=n)}var i=t("point-geometry");e.exports=n,n.prototype=Object.create(i.prototype),n.prototype.clone=function(){return new n(this.x,this.y,this.angle,this.segment)}},{"point-geometry":448}],358:[function(t,e,r){"use strict";function n(t,e,r,n,i){if(void 0===e.segment)return!0;for(var a=e,o=e.segment+1,s=0;s>-r/2;){if(o--,o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],u=0;s<r/2;){var c=t[o-1],h=t[o],f=t[o+1];if(!f)return!1;var d=c.angleTo(h)-h.angleTo(f);for(d=Math.abs((d+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:d}),u+=d;s-l[0].distance>n;)u-=l.shift().angleDelta;if(u>i)return!1;o++,s+=h.dist(f)}return!0}e.exports=n},{}],359:[function(t,e,r){"use strict";function n(t,e,r,n,a){for(var o=[],s=0;s<t.length;s++)for(var l,u=t[s],c=0;c<u.length-1;c++){var h=u[c],f=u[c+1];h.x<e&&f.x<e||(h.x<e?h=new i(e,h.y+(f.y-h.y)*((e-h.x)/(f.x-h.x)))._round():f.x<e&&(f=new i(e,h.y+(f.y-h.y)*((e-h.x)/(f.x-h.x)))._round()),h.y<r&&f.y<r||(h.y<r?h=new i(h.x+(f.x-h.x)*((r-h.y)/(f.y-h.y)),r)._round():f.y<r&&(f=new i(h.x+(f.x-h.x)*((r-h.y)/(f.y-h.y)),r)._round()),h.x>=n&&f.x>=n||(h.x>=n?h=new i(n,h.y+(f.y-h.y)*((n-h.x)/(f.x-h.x)))._round():f.x>=n&&(f=new i(n,h.y+(f.y-h.y)*((n-h.x)/(f.x-h.x)))._round()),h.y>=a&&f.y>=a||(h.y>=a?h=new i(h.x+(f.x-h.x)*((a-h.y)/(f.y-h.y)),a)._round():f.y>=a&&(f=new i(h.x+(f.x-h.x)*((a-h.y)/(f.y-h.y)),a)._round()),l&&h.equals(l[l.length-1])||(l=[h],o.push(l)),l.push(f)))))}return o}var i=t("point-geometry");e.exports=n},{"point-geometry":448}],360:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("../util/util"),a=t("point-geometry"),o=e.exports=new n({members:[{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Float32",name:"maxScale"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"bbox0"},{type:"Int16",name:"bbox1"},{type:"Int16",name:"bbox2"},{type:"Int16",name:"bbox3"},{type:"Float32",name:"placementScale"}]});i.extendAll(o.prototype.StructType.prototype,{get anchorPoint(){return new a(this.anchorPointX,this.anchorPointY)}})},{"../util/struct_array":406,"../util/util":408,"point-geometry":448}],361:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,u,c){var h=o.top*s-l,f=o.bottom*s+l,d=o.left*s-l,p=o.right*s+l;if(this.boxStartIndex=t.length,u){var m=f-h,g=p-d;if(m>0)if(m=Math.max(10*s,m),c){var v=e[r.segment+1].sub(e[r.segment])._unit()._mult(g),y=[r.sub(v),r.add(v)];this._addLineCollisionBoxes(t,y,r,0,g,m,n,i,a)}else this._addLineCollisionBoxes(t,e,r,r.segment,g,m,n,i,a)}else t.emplaceBack(r.x,r.y,d,h,p,f,1/0,n,i,a,0,0,0,0,0);this.boxEndIndex=t.length}e.exports=n,n.prototype._addLineCollisionBoxes=function(t,e,r,n,i,a,o,s,l){var u=a/2,c=Math.floor(i/u),h=-a/2,f=this.boxes,d=r,p=n+1,m=h;do{if(p--,p<0)return f;m-=e[p].dist(d),d=e[p]}while(m>-i/2);for(var g=e[p].dist(e[p+1]),v=0;v<c;v++){for(var y=-i/2+v*u;m+g<y;){if(m+=g,p++,p+1>=e.length)return f;g=e[p].dist(e[p+1])}var x=y-m,b=e[p],_=e[p+1],w=_.sub(b)._unit()._mult(x)._add(b)._round(),M=Math.max(Math.abs(y-h)-u/2,0),A=i/2/M;t.emplaceBack(w.x,w.y,-a/2,-a/2,a/2,a/2,A,o,s,l,0,0,0,0,0)}return f}},{}],362:[function(t,e,r){"use strict";function n(t,e,r){if("object"==typeof t){var n=t;r=e,t=n.angle,e=n.pitch,this.grid=new o(n.grid),this.ignoredGrid=new o(n.ignoredGrid)}else this.grid=new o(a,12,6),this.ignoredGrid=new o(a,12,0);this.angle=t,this.pitch=e;var i=Math.sin(t),s=Math.cos(t);if(this.rotationMatrix=[s,-i,i,s],this.reverseRotationMatrix=[s,i,-i,s],this.yStretch=1/Math.cos(e/180*Math.PI),this.yStretch=Math.pow(this.yStretch,1.3),this.collisionBoxArray=r,0===r.length){r.emplaceBack();var l=32767;r.emplaceBack(0,0,0,-l,0,l,l,0,0,0,0,0,0,0,0,0),r.emplaceBack(a,0,0,-l,0,l,l,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,0,-l,0,l,0,l,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,a,-l,0,l,0,l,0,0,0,0,0,0,0,0,0)}this.tempCollisionBox=r.get(0),this.edges=[r.get(1),r.get(2),r.get(3),r.get(4)]}var i=t("point-geometry"),a=t("../data/bucket").EXTENT,o=t("grid-index");e.exports=n,n.prototype.serialize=function(){var t={angle:this.angle,pitch:this.pitch,grid:this.grid.toArrayBuffer(),ignoredGrid:this.ignoredGrid.toArrayBuffer()};return{data:t,transferables:[t.grid,t.ignoredGrid]}},n.prototype.minScale=.25,n.prototype.maxScale=2,n.prototype.placeCollisionFeature=function(t,e,r){for(var n=this.collisionBoxArray,a=this.minScale,o=this.rotationMatrix,s=this.yStretch,l=t.boxStartIndex;l<t.boxEndIndex;l++){var u=n.get(l),c=u.anchorPoint._matMult(o),h=c.x,f=c.y,d=h+u.x1,p=f+u.y1*s,m=h+u.x2,g=f+u.y2*s;if(u.bbox0=d,u.bbox1=p,u.bbox2=m,u.bbox3=g,!e)for(var v=this.grid.query(d,p,m,g),y=0;y<v.length;y++){var x=n.get(v[y]),b=x.anchorPoint._matMult(o);if(a=this.getPlacementScale(a,c,u,b,x),a>=this.maxScale)return a}if(r){var _;if(this.angle){var w=this.reverseRotationMatrix,M=new i(u.x1,u.y1).matMult(w),A=new i(u.x2,u.y1).matMult(w),k=new i(u.x1,u.y2).matMult(w),T=new i(u.x2,u.y2).matMult(w);_=this.tempCollisionBox,_.anchorPointX=u.anchorPoint.x,_.anchorPointY=u.anchorPoint.y,_.x1=Math.min(M.x,A.x,k.x,T.x),_.y1=Math.min(M.y,A.x,k.x,T.x),_.x2=Math.max(M.x,A.x,k.x,T.x),_.y2=Math.max(M.y,A.x,k.x,T.x),_.maxScale=u.maxScale}else _=u;for(var E=0;E<this.edges.length;E++){var S=this.edges[E];if(a=this.getPlacementScale(a,u.anchorPoint,_,S.anchorPoint,S),a>=this.maxScale)return a}}}return a},n.prototype.queryRenderedSymbols=function(t,e,r,n,a){var o={},s=[],l=this.collisionBoxArray,u=this.rotationMatrix,c=new i(t,e)._matMult(u),h=this.tempCollisionBox;h.anchorX=c.x,h.anchorY=c.y,h.x1=0,h.y1=0,h.x2=r-t,h.y2=n-e,h.maxScale=a,a=h.maxScale;for(var f=[c.x+h.x1/a,c.y+h.y1/a*this.yStretch,c.x+h.x2/a,c.y+h.y2/a*this.yStretch],d=this.grid.query(f[0],f[1],f[2],f[3]),p=this.ignoredGrid.query(f[0],f[1],f[2],f[3]),m=0;m<p.length;m++)d.push(p[m]);for(var g=0;g<d.length;g++){var v=l.get(d[g]),y=v.sourceLayerIndex,x=v.featureIndex;if(void 0===o[y]&&(o[y]={}),!o[y][x]){var b=v.anchorPoint.matMult(u),_=this.getPlacementScale(this.minScale,c,h,b,v);_>=a&&(o[y][x]=!0,s.push(d[g]))}}return s},n.prototype.getPlacementScale=function(t,e,r,n,i){var a=e.x-n.x,o=e.y-n.y,s=(i.x1-r.x2)/a,l=(i.x2-r.x1)/a,u=(i.y1-r.y2)*this.yStretch/o,c=(i.y2-r.y1)*this.yStretch/o;(isNaN(s)||isNaN(l))&&(s=l=1),(isNaN(u)||isNaN(c))&&(u=c=1);var h=Math.min(Math.max(s,l),Math.max(u,c)),f=i.maxScale,d=r.maxScale;return h>f&&(h=f),h>d&&(h=d),h>t&&h>=i.placementScale&&(t=h),t},n.prototype.insertCollisionFeature=function(t,e,r){for(var n=r?this.ignoredGrid:this.grid,i=this.collisionBoxArray,a=t.boxStartIndex;a<t.boxEndIndex;a++){var o=i.get(a);o.placementScale=e,e<this.maxScale&&n.insert(a,o.bbox0,o.bbox1,o.bbox2,o.bbox3)}}},{"../data/bucket":295,"grid-index":257,"point-geometry":448}],363:[function(t,e,r){"use strict";function n(t,e,r,n,a,o,s,l,u){var c=n?.6*o*s:0,h=Math.max(n?n.right-n.left:0,a?a.right-a.left:0),f=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;e-h*s<e/4&&(e=h*s+e/4);var d=2*o,p=f?e/2*l%e:(h/2+d)*s*l%e;return i(t,p,e,c,r,h*s,f,!1,u)}function i(t,e,r,n,l,u,c,h,f){for(var d=u/2,p=0,m=0;m<t.length-1;m++)p+=t[m].dist(t[m+1]);for(var g=0,v=e-r,y=[],x=0;x<t.length-1;x++){for(var b=t[x],_=t[x+1],w=b.dist(_),M=_.angleTo(b);v+r<g+w;){v+=r;var A=(v-g)/w,k=a(b.x,_.x,A),T=a(b.y,_.y,A);if(k>=0&&k<f&&T>=0&&T<f&&v-d>=0&&v+d<=p){var E=new o(k,T,M,x)._round();n&&!s(t,E,u,n,l)||y.push(E)}}g+=w}return h||y.length||c||(y=i(t,g/2,r,n,l,u,c,!0,f)),y}var a=t("../util/interpolate"),o=t("../symbol/anchor"),s=t("./check_max_angle");e.exports=n},{"../symbol/anchor":357,"../util/interpolate":402,"./check_max_angle":358}],364:[function(t,e,r){"use strict";function n(){this.width=s,this.height=s,this.bin=new i(this.width,this.height),this.index={},this.ids={},this.data=new Uint8Array(this.width*this.height)}var i=t("shelf-pack"),a=t("../util/util"),o=4,s=128,l=2048;e.exports=n,n.prototype.getGlyphs=function(){var t,e,r,n={};for(var i in this.ids)t=i.split("#"),e=t[0],r=t[1],n[e]||(n[e]=[]),n[e].push(r);return n},n.prototype.getRects=function(){var t,e,r,n={};for(var i in this.ids)t=i.split("#"),e=t[0],r=t[1],n[e]||(n[e]={}),n[e][r]=this.index[i];return n},n.prototype.addGlyph=function(t,e,r,n){if(!r)return null;var i=e+"#"+r.id;if(this.index[i])return this.ids[i].indexOf(t)<0&&this.ids[i].push(t),this.index[i];if(!r.bitmap)return null;var o=r.width+2*n,s=r.height+2*n,l=1,u=o+2*l,c=s+2*l;u+=4-u%4,c+=4-c%4;var h=this.bin.packOne(u,c);if(h||(this.resize(),h=this.bin.packOne(u,c)),!h)return a.warnOnce("glyph bitmap overflow"),null;this.index[i]=h,this.ids[i]=[t];for(var f=this.data,d=r.bitmap,p=0;p<s;p++)for(var m=this.width*(h.y+p+l)+h.x+l,g=o*p,v=0;v<o;v++)f[m+v]=d[g+v];return this.dirty=!0,h},n.prototype.resize=function(){var t=this.width,e=this.height;if(!(t>=l||e>=l)){this.texture&&(this.gl&&this.gl.deleteTexture(this.texture),this.texture=null),this.width*=o,this.height*=o,this.bin.resize(this.width,this.height);for(var r=new ArrayBuffer(this.width*this.height),n=0;n<e;n++){var i=new Uint8Array(this.data.buffer,e*n,t),a=new Uint8Array(r,e*n*o,t);a.set(i)}this.data=new Uint8Array(r)}},n.prototype.bind=function(t){this.gl=t,this.texture?t.bindTexture(t.TEXTURE_2D,this.texture):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,this.width,this.height,0,t.ALPHA,t.UNSIGNED_BYTE,null))},n.prototype.updateTexture=function(t){this.bind(t),this.dirty&&(t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.ALPHA,t.UNSIGNED_BYTE,this.data),this.dirty=!1)}},{"../util/util":408,"shelf-pack":477}],365:[function(t,e,r){"use strict";function n(t){this.url=t&&o(t),this.atlases={},this.stacks={},this.loading={}}function i(t,e,r){var n=1;this.advance=t.advance,this.left=t.left-r-n,this.top=t.top+r+n,this.rect=e}function a(t,e,r,n){return n=n||"abc",r.replace("{s}",n[t.length%n.length]).replace("{fontstack}",t).replace("{range}",e)}var o=t("../util/mapbox").normalizeGlyphsURL,s=t("../util/ajax").getArrayBuffer,l=t("../util/glyphs"),u=t("../symbol/glyph_atlas"),c=t("pbf");e.exports=n,n.prototype.getSimpleGlyphs=function(t,e,r,n){void 0===this.stacks[t]&&(this.stacks[t]={}),void 0===this.atlases[t]&&(this.atlases[t]=new u);for(var a,o={},s=this.stacks[t],l=this.atlases[t],c=3,h={},f=0,d=0;d<e.length;d++){var p=e[d];if(a=Math.floor(p/256),s[a]){var m=s[a].glyphs[p],g=l.addGlyph(r,t,m,c);m&&(o[p]=new i(m,g,c))}else void 0===h[a]&&(h[a]=[],f++),h[a].push(p)}f||n(void 0,o,t);var v=function(e,a,s){if(!e)for(var u=this.stacks[t][a]=s.stacks[0],d=0;d<h[a].length;d++){var p=h[a][d],m=u.glyphs[p],g=l.addGlyph(r,t,m,c);m&&(o[p]=new i(m,g,c))}f--,f||n(void 0,o,t)}.bind(this);for(var y in h)this.loadRange(t,y,v)},n.prototype.loadRange=function(t,e,r){if(256*e>65535)return r("glyphs > 65535 not supported");void 0===this.loading[t]&&(this.loading[t]={});var n=this.loading[t];if(n[e])n[e].push(r);else{n[e]=[r];var i=256*e+"-"+(256*e+255),o=a(t,i,this.url);s(o,function(t,r){for(var i=!t&&new l(new c(new Uint8Array(r))),a=0;a<n[e].length;a++)n[e][a](t,e,i);delete n[e]})}},n.prototype.getGlyphAtlas=function(t){return this.atlases[t]}},{"../symbol/glyph_atlas":364,"../util/ajax":391,"../util/glyphs":401,"../util/mapbox":405,pbf:442}],366:[function(t,e,r){"use strict";e.exports=function(t,e,r){function n(n){c.push(t[n]),h.push(r[n]),f.push(e[n]),d++}function i(t,e,r){var n=u[t];return delete u[t],u[e]=n,h[n][0].pop(),h[n][0]=h[n][0].concat(r[0]),n}function a(t,e,r){var n=l[e];return delete l[e],l[t]=n,h[n][0].shift(),h[n][0]=r[0].concat(h[n][0]),n}function o(t,e,r){var n=r?e[0][e[0].length-1]:e[0][0];return t+":"+n.x+":"+n.y}var s,l={},u={},c=[],h=[],f=[],d=0;for(s=0;s<t.length;s++){var p=r[s],m=e[s];if(m){var g=o(m,p),v=o(m,p,!0);if(g in u&&v in l&&u[g]!==l[v]){var y=a(g,v,p),x=i(g,v,h[y]);delete l[g],delete u[v],u[o(m,h[x],!0)]=x,h[y]=null}else g in u?i(g,v,p):v in l?a(g,v,p):(n(s),l[g]=d-1,u[v]=d-1)}else n(s)}return{features:c,textFeatures:f,geometries:h}}},{}],367:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,u){this.anchorPoint=t,this.tl=e,this.tr=r,this.bl=n,this.br=i,this.tex=a,this.anchorAngle=o,this.glyphAngle=s,this.minScale=l,this.maxScale=u}function i(t,e,r,i,a,o,u,c,h){var f,d,p,m,g=e.image.rect,v=a.layout,y=1,x=e.left-y,b=x+g.w/e.image.pixelRatio,_=e.top-y,w=_+g.h/e.image.pixelRatio;if("none"!==v["icon-text-fit"]&&u){var M=b-x,A=w-_,k=v["text-size"]/24,T=u.left*k,E=u.right*k,S=u.top*k,L=u.bottom*k,C=E-T,I=L-S,z=v["icon-text-fit-padding"][0],D=v["icon-text-fit-padding"][1],P=v["icon-text-fit-padding"][2],O=v["icon-text-fit-padding"][3],R="width"===v["icon-text-fit"]?.5*(I-A):0,F="height"===v["icon-text-fit"]?.5*(C-M):0,j="width"===v["icon-text-fit"]||"both"===v["icon-text-fit"]?C:M,N="height"===v["icon-text-fit"]||"both"===v["icon-text-fit"]?I:A;f=new s(T+F-O,S+R-z),d=new s(T+F+D+j,S+R-z),p=new s(T+F+D+j,S+R+P+N),m=new s(T+F-O,S+R+P+N)}else f=new s(x,_),d=new s(b,_),p=new s(b,w),m=new s(x,w);var B=a.getLayoutValue("icon-rotate",c,h)*Math.PI/180;if(o){var U=i[t.segment];if(t.y===U.y&&t.x===U.x&&t.segment+1<i.length){var V=i[t.segment+1];B+=Math.atan2(t.y-V.y,t.x-V.x)+Math.PI}else B+=Math.atan2(t.y-U.y,t.x-U.x)}if(B){var q=Math.sin(B),H=Math.cos(B),Y=[H,-q,q,H];f=f.matMult(Y),d=d.matMult(Y),m=m.matMult(Y),p=p.matMult(Y)}return[new n(new s(t.x,t.y),f,d,m,p,e.image.rect,0,0,l,1/0)]}function a(t,e,r,i,a,u){for(var c=a.layout["text-rotate"]*Math.PI/180,h=a.layout["text-keep-upright"],f=e.positionedGlyphs,d=[],p=0;p<f.length;p++){var m=f[p],g=m.glyph,v=g.rect;if(v){var y,x=(m.x+g.advance/2)*r,b=l;u?(y=[],b=o(y,t,x,i,t.segment,!0),h&&(b=Math.min(b,o(y,t,x,i,t.segment,!1)))):y=[{anchorPoint:new s(t.x,t.y),offset:0,angle:0,maxScale:1/0,minScale:l}];for(var _=m.x+g.left,w=m.y-g.top,M=_+v.w,A=w+v.h,k=new s(_,w),T=new s(M,w),E=new s(_,A),S=new s(M,A),L=0;L<y.length;L++){var C=y[L],I=k,z=T,D=E,P=S;if(c){var O=Math.sin(c),R=Math.cos(c),F=[R,-O,O,R];I=I.matMult(F),z=z.matMult(F),D=D.matMult(F),P=P.matMult(F)}var j=Math.max(C.minScale,b),N=(t.angle+C.offset+2*Math.PI)%(2*Math.PI),B=(C.angle+C.offset+2*Math.PI)%(2*Math.PI);d.push(new n(C.anchorPoint,I,z,D,P,v,N,B,j,C.maxScale))}}}return d}function o(t,e,r,n,i,a){var o=!a;r<0&&(a=!a),a&&i++;var u=new s(e.x,e.y),c=n[i],h=1/0;r=Math.abs(r);for(var f=l;;){var d=u.dist(c),p=r/d,m=Math.atan2(c.y-u.y,c.x-u.x);if(a||(m+=Math.PI),t.push({anchorPoint:u,offset:o?Math.PI:0,minScale:p,maxScale:h,angle:(m+2*Math.PI)%(2*Math.PI)}),p<=f)break;for(u=c;u.equals(c);)if(i+=a?1:-1,c=n[i],!c)return p;var g=c.sub(u)._unit();u=u.sub(g._mult(d)),h=p}return f}var s=t("point-geometry");e.exports={getIconQuads:i,getGlyphQuads:a,SymbolQuad:n};var l=.5},{"point-geometry":448}],368:[function(t,e,r){"use strict";function n(t,e,r){for(var n=[],a=0,o=t.length;a<o;a++){var s=i(t[a].properties,e["text-field"]);if(s){s=s.toString();var l=e["text-transform"];"uppercase"===l?s=s.toLocaleUpperCase():"lowercase"===l&&(s=s.toLocaleLowerCase());for(var u=0;u<s.length;u++)r[s.charCodeAt(u)]=!0;n[a]=s}else n[a]=null}return n}var i=t("../util/token");e.exports=n},{"../util/token":407}],369:[function(t,e,r){"use strict";function n(t,e,r,n){this.codePoint=t,this.x=e,this.y=r,this.glyph=n}function i(t,e,r,n,i,a){this.positionedGlyphs=t,this.text=e,this.top=r,this.bottom=n,this.left=i,this.right=a}function a(t,e,r,a,s,l,u,c,h){for(var f=[],d=new i(f,t,h[1],h[1],h[0],h[0]),p=-17,m=0,g=p,v=0;v<t.length;v++){var y=t.charCodeAt(v),x=e[y];x&&(f.push(new n(y,m,g,x)),m+=x.advance+c)}return!!f.length&&(o(d,e,a,r,s,l,u,h),d)}function o(t,e,r,n,i,a,o,u){var c=null,d=0,p=0,m=0,g=0,v=t.positionedGlyphs;if(n)for(var y=0;y<v.length;y++){var x=v[y];if(x.x-=d,x.y+=r*m,x.x>n&&null!==c){var b=v[c+1].x;g=Math.max(b,g);for(var _=c+1;_<=y;_++)v[_].y+=r,v[_].x-=b;if(o){var w=c;h[v[c].codePoint]&&w--,s(v,e,p,w,o)}p=c+1,c=null,d+=b,m++}f[x.codePoint]&&(c=y)}var M=v[v.length-1],A=M.x+e[M.codePoint].advance;g=Math.max(g,A);var k=(m+1)*r;s(v,e,p,v.length-1,o),l(v,o,i,a,g,r,m,u),t.top+=-a*k,t.bottom=t.top+k,t.left+=-i*g,t.right=t.left+g}function s(t,e,r,n,i){for(var a=e[t[n].codePoint].advance,o=(t[n].x+a)*i,s=r;s<=n;s++)t[s].x-=o}function l(t,e,r,n,i,a,o,s){for(var l=(e-r)*i+s[0],u=(-n*(o+1)+.5)*a+s[1],c=0;c<t.length;c++)t[c].x+=l,t[c].y+=u}function u(t,e){if(!t||!t.rect)return null;var r=e["icon-offset"][0],n=e["icon-offset"][1],i=r-t.width/2,a=i+t.width,o=n-t.height/2,s=o+t.height;return new c(t,o,s,i,a)}function c(t,e,r,n,i){this.image=t,this.top=e,this.bottom=r,this.left=n,this.right=i}e.exports={shapeText:a,shapeIcon:u};var h={32:!0,8203:!0},f={32:!0,38:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0}},{}],370:[function(t,e,r){"use strict";function n(t,e){this.width=t,this.height=e,this.bin=new o(t,e),this.images={},this.data=!1,this.texture=0,this.filter=0,this.pixelRatio=1,this.dirty=!0}function i(t,e,r,n,i,a,o,s,l,u,c){var h,f,d=n*e+r,p=s*a+o;if(c)for(p-=a,f=-1;f<=u;f++,d=((f+u)%u+n)*e+r,p+=a)for(h=-1;h<=l;h++)i[p+h]=t[d+(h+l)%l];else for(f=0;f<u;f++,d+=e,p+=a)for(h=0;h<l;h++)i[p+h]=t[d+h]}function a(t,e,r,n,i){this.rect=t,this.width=e,this.height=r,this.sdf=n,this.pixelRatio=i}var o=t("shelf-pack"),s=t("../util/browser"),l=t("../util/util");e.exports=n,n.prototype.allocateImage=function(t,e){t/=this.pixelRatio,e/=this.pixelRatio;var r=2,n=t+r+(4-(t+r)%4),i=e+r+(4-(e+r)%4),a=this.bin.packOne(n,i);return a?a:(l.warnOnce("SpriteAtlas out of space."),null)},n.prototype.getImage=function(t,e){if(this.images[t])return this.images[t];if(!this.sprite)return null;var r=this.sprite.getSpritePosition(t);if(!r.width||!r.height)return null;var n=this.allocateImage(r.width,r.height);if(!n)return null;var i=new a(n,r.width/r.pixelRatio,r.height/r.pixelRatio,r.sdf,r.pixelRatio/this.pixelRatio);return this.images[t]=i,this.copy(n,r,e),i},n.prototype.getPosition=function(t,e){var r=this.getImage(t,e),n=r&&r.rect;if(!n)return null;var i=r.width*r.pixelRatio,a=r.height*r.pixelRatio,o=1;return{size:[r.width,r.height],tl:[(n.x+o)/this.width,(n.y+o)/this.height],br:[(n.x+o+i)/this.width,(n.y+o+a)/this.height]}},n.prototype.allocate=function(){if(!this.data){var t=Math.floor(this.width*this.pixelRatio),e=Math.floor(this.height*this.pixelRatio);this.data=new Uint32Array(t*e);for(var r=0;r<this.data.length;r++)this.data[r]=0}},n.prototype.copy=function(t,e,r){if(this.sprite.img.data){var n=new Uint32Array(this.sprite.img.data.buffer);this.allocate();var a=this.data,o=1;i(n,this.sprite.img.width,e.x,e.y,a,this.width*this.pixelRatio,(t.x+o)*this.pixelRatio,(t.y+o)*this.pixelRatio,e.width,e.height,r),this.dirty=!0}},n.prototype.setSprite=function(t){t&&(this.pixelRatio=s.devicePixelRatio>1?2:1,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio)),this.sprite=t},n.prototype.addIcons=function(t,e){for(var r=0;r<t.length;r++)this.getImage(t[r]);e(null,this.images)},n.prototype.bind=function(t,e){var r=!1;this.texture?t.bindTexture(t.TEXTURE_2D,this.texture):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),r=!0);var n=e?t.LINEAR:t.NEAREST;n!==this.filter&&(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n),this.filter=n),this.dirty&&(this.allocate(),r?t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width*this.pixelRatio,this.height*this.pixelRatio,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(this.data.buffer)):t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width*this.pixelRatio,this.height*this.pixelRatio,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(this.data.buffer)),this.dirty=!1)}},{"../util/browser":392,"../util/util":408,"shelf-pack":477}],371:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("../util/util"),a=t("point-geometry"),o=e.exports=new n({members:[{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"glyphQuadStartIndex"},{type:"Uint16",name:"glyphQuadEndIndex"},{type:"Uint16",name:"iconQuadStartIndex"},{type:"Uint16",name:"iconQuadEndIndex"},{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int8",name:"index"}]});i.extendAll(o.prototype.StructType.prototype,{get anchorPoint(){return new a(this.anchorPointX,this.anchorPointY)}})},{"../util/struct_array":406,"../util/util":408,"point-geometry":448}],372:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("../util/util"),a=t("point-geometry"),o=t("./quads").SymbolQuad,s=e.exports=new n({members:[{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Float32",name:"tlX"},{type:"Float32",name:"tlY"},{type:"Float32",name:"trX"},{type:"Float32",name:"trY"},{type:"Float32",name:"blX"},{type:"Float32",name:"blY"},{type:"Float32",name:"brX"},{type:"Float32",name:"brY"},{type:"Int16",name:"texH"},{type:"Int16",name:"texW"},{type:"Int16",name:"texX"},{type:"Int16",name:"texY"},{type:"Float32",name:"anchorAngle"},{type:"Float32",name:"glyphAngle"},{type:"Float32",name:"maxScale"},{type:"Float32",name:"minScale"}]});i.extendAll(s.prototype.StructType.prototype,{get anchorPoint(){return new a(this.anchorPointX,this.anchorPointY)},get SymbolQuad(){return new o(this.anchorPoint,new a(this.tlX,this.tlY),new a(this.trX,this.trY),new a(this.blX,this.blY),new a(this.brX,this.brY),{x:this.texX,y:this.texY,h:this.texH,w:this.texW,height:this.texH,width:this.texW},this.anchorAngle,this.glyphAngle,this.minScale,this.maxScale)}})},{"../util/struct_array":406,"../util/util":408,"./quads":367,"point-geometry":448}],373:[function(t,e,r){"use strict";var n=t("../util/dom"),i=t("point-geometry"),a={scrollZoom:t("./handler/scroll_zoom"),boxZoom:t("./handler/box_zoom"),dragRotate:t("./handler/drag_rotate"),dragPan:t("./handler/drag_pan"),keyboard:t("./handler/keyboard"),doubleClickZoom:t("./handler/dblclick_zoom"),touchZoomRotate:t("./handler/touch_zoom_rotate")};e.exports=function(t,e){function r(t){v("mouseout",t)}function o(e){t.stop(),_=n.mousePos(x,e),v("mousedown",e)}function s(e){var r=t.dragRotate&&t.dragRotate.isActive();b&&!r&&v("contextmenu",b),b=null,v("mouseup",e)}function l(e){if(!(t.dragPan&&t.dragPan.isActive()||t.dragRotate&&t.dragRotate.isActive())){for(var r=e.toElement||e.target;r&&r!==x;)r=r.parentNode;r===x&&v("mousemove",e)}}function u(e){t.stop(),y("touchstart",e),!e.touches||e.touches.length>1||(w?(clearTimeout(w),w=null,v("dblclick",e)):w=setTimeout(d,300))}function c(t){y("touchmove",t)}function h(t){y("touchend",t)}function f(t){y("touchcancel",t)}function d(){w=null}function p(t){var e=n.mousePos(x,t);e.equals(_)&&v("click",t)}function m(t){v("dblclick",t),t.preventDefault()}function g(t){b=t,t.preventDefault()}function v(e,r){var i=n.mousePos(x,r);return t.fire(e,{lngLat:t.unproject(i),point:i,originalEvent:r})}function y(e,r){var a=n.touchPos(x,r),o=a.reduce(function(t,e,r,n){return t.add(e.div(n.length))},new i(0,0));return t.fire(e,{lngLat:t.unproject(o),point:o,lngLats:a.map(function(e){return t.unproject(e)},this),points:a,originalEvent:r})}var x=t.getCanvasContainer(),b=null,_=null,w=null;for(var M in a)t[M]=new a[M](t,e),e.interactive&&e[M]&&t[M].enable();x.addEventListener("mouseout",r,!1),x.addEventListener("mousedown",o,!1),x.addEventListener("mouseup",s,!1),x.addEventListener("mousemove",l,!1),x.addEventListener("touchstart",u,!1),x.addEventListener("touchend",h,!1),x.addEventListener("touchmove",c,!1),x.addEventListener("touchcancel",f,!1),x.addEventListener("click",p,!1),x.addEventListener("dblclick",m,!1),x.addEventListener("contextmenu",g,!1)}},{"../util/dom":394,"./handler/box_zoom":379,"./handler/dblclick_zoom":380,"./handler/drag_pan":381,"./handler/drag_rotate":382,"./handler/keyboard":383,"./handler/scroll_zoom":384,"./handler/touch_zoom_rotate":385,"point-geometry":448}],374:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/interpolate"),a=t("../util/browser"),o=t("../geo/lng_lat"),s=t("../geo/lng_lat_bounds"),l=t("point-geometry"),u=e.exports=function(){};n.extend(u.prototype,{getCenter:function(){return this.transform.center},setCenter:function(t,e){return this.jumpTo({center:t},e),this},panBy:function(t,e,r){return this.panTo(this.transform.center,n.extend({offset:l.convert(t).mult(-1)},e),r),this},panTo:function(t,e,r){return this.easeTo(n.extend({center:t},e),r)},getZoom:function(){return this.transform.zoom},setZoom:function(t,e){return this.jumpTo({zoom:t},e),this},zoomTo:function(t,e,r){return this.easeTo(n.extend({zoom:t},e),r)},zoomIn:function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},zoomOut:function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},getBearing:function(){return this.transform.bearing},setBearing:function(t,e){return this.jumpTo({bearing:t},e),this},rotateTo:function(t,e,r){return this.easeTo(n.extend({bearing:t},e),r)},resetNorth:function(t,e){return this.rotateTo(0,n.extend({duration:1e3},t),e),this},snapToNorth:function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},getPitch:function(){return this.transform.pitch},setPitch:function(t,e){return this.jumpTo({pitch:t},e),this},fitBounds:function(t,e,r){e=n.extend({padding:0,offset:[0,0],maxZoom:1/0},e),t=s.convert(t);var i=l.convert(e.offset),a=this.transform,o=a.project(t.getNorthWest()),u=a.project(t.getSouthEast()),c=u.sub(o),h=(a.width-2*e.padding-2*Math.abs(i.x))/c.x,f=(a.height-2*e.padding-2*Math.abs(i.y))/c.y;return e.center=a.unproject(o.add(u).div(2)),e.zoom=Math.min(a.scaleZoom(a.scale*Math.min(h,f)),e.maxZoom),e.bearing=0,e.linear?this.easeTo(e,r):this.flyTo(e,r)},jumpTo:function(t,e){this.stop();var r=this.transform,n=!1,i=!1,a=!1;return"zoom"in t&&r.zoom!==+t.zoom&&(n=!0,r.zoom=+t.zoom),"center"in t&&(r.center=o.convert(t.center)),"bearing"in t&&r.bearing!==+t.bearing&&(i=!0,r.bearing=+t.bearing),"pitch"in t&&r.pitch!==+t.pitch&&(a=!0,r.pitch=+t.pitch),this.fire("movestart",e).fire("move",e),n&&this.fire("zoomstart",e).fire("zoom",e).fire("zoomend",e),i&&this.fire("rotate",e),a&&this.fire("pitch",e),this.fire("moveend",e)},easeTo:function(t,e){this.stop(),t=n.extend({offset:[0,0],duration:500,easing:n.ease},t);var r,a,s=this.transform,u=l.convert(t.offset),c=this.getZoom(),h=this.getBearing(),f=this.getPitch(),d="zoom"in t?+t.zoom:c,p="bearing"in t?this._normalizeBearing(t.bearing,h):h,m="pitch"in t?+t.pitch:f;"center"in t?(r=o.convert(t.center),a=s.centerPoint.add(u)):"around"in t?(r=o.convert(t.around),a=s.locationPoint(r)):(a=s.centerPoint.add(u),r=s.pointLocation(a));var g=s.locationPoint(r);return t.animate===!1&&(t.duration=0),this.zooming=d!==c,this.rotating=h!==p,this.pitching=m!==f,t.noMoveStart||this.fire("movestart",e),this.zooming&&this.fire("zoomstart",e),clearTimeout(this._onEaseEnd),this._ease(function(t){this.zooming&&(s.zoom=i(c,d,t)),this.rotating&&(s.bearing=i(h,p,t)),this.pitching&&(s.pitch=i(f,m,t)),s.setLocationAtPoint(r,g.add(a.sub(g)._mult(t))),this.fire("move",e),this.zooming&&this.fire("zoom",e),this.rotating&&this.fire("rotate",e),this.pitching&&this.fire("pitch",e)},function(){t.delayEndEvents?this._onEaseEnd=setTimeout(this._easeToEnd.bind(this,e),t.delayEndEvents):this._easeToEnd(e)}.bind(this),t),this},_easeToEnd:function(t){var e=this.zooming;this.zooming=!1,this.rotating=!1,this.pitching=!1,e&&this.fire("zoomend",t),this.fire("moveend",t)},flyTo:function(t,e){function r(t){var e=(k*k-A*A+(t?-1:1)*L*L*T*T)/(2*(t?k:A)*L*T);return Math.log(Math.sqrt(e*e+1)-e)}function a(t){return(Math.exp(t)-Math.exp(-t))/2}function s(t){return(Math.exp(t)+Math.exp(-t))/2}function u(t){return a(t)/s(t)}this.stop(),t=n.extend({offset:[0,0],speed:1.2,curve:1.42,easing:n.ease},t);var c=this.transform,h=l.convert(t.offset),f=this.getZoom(),d=this.getBearing(),p=this.getPitch(),m="center"in t?o.convert(t.center):this.getCenter(),g="zoom"in t?+t.zoom:f,v="bearing"in t?this._normalizeBearing(t.bearing,d):d,y="pitch"in t?+t.pitch:p;Math.abs(c.center.lng)+Math.abs(m.lng)>180&&(c.center.lng>0&&m.lng<0?m.lng+=360:c.center.lng<0&&m.lng>0&&(m.lng-=360));var x=c.zoomScale(g-f),b=c.point,_="center"in t?c.project(m).sub(h.div(x)):b,w=c.worldSize,M=t.curve,A=Math.max(c.width,c.height),k=A/x,T=_.sub(b).mag();if("minZoom"in t){var E=n.clamp(Math.min(t.minZoom,f,g),c.minZoom,c.maxZoom),S=A/c.zoomScale(E-f);M=Math.sqrt(S/T*2)}var L=M*M,C=r(0),I=function(t){return s(C)/s(C+M*t)},z=function(t){return A*((s(C)*u(C+M*t)-a(C))/L)/T},D=(r(1)-C)/M;if(Math.abs(T)<1e-6){if(Math.abs(A-k)<1e-6)return this.easeTo(t);var P=k<A?-1:1;D=Math.abs(Math.log(k/A))/M,z=function(){return 0},I=function(t){return Math.exp(P*M*t)}}if("duration"in t)t.duration=+t.duration;else{var O="screenSpeed"in t?+t.screenSpeed/M:+t.speed;t.duration=1e3*D/O}return this.zooming=!0,d!==v&&(this.rotating=!0),p!==y&&(this.pitching=!0),this.fire("movestart",e),this.fire("zoomstart",e),this._ease(function(t){var r=t*D,n=z(r);c.zoom=f+c.scaleZoom(1/I(r)),c.center=c.unproject(b.add(_.sub(b).mult(n)),w),this.rotating&&(c.bearing=i(d,v,t)),this.pitching&&(c.pitch=i(p,y,t)),this.fire("move",e),this.fire("zoom",e),this.rotating&&this.fire("rotate",e),this.pitching&&this.fire("pitch",e)},function(){this.zooming=!1,this.rotating=!1,this.pitching=!1,this.fire("zoomend",e),this.fire("moveend",e)},t),this},isEasing:function(){return!!this._abortFn},stop:function(){return this._abortFn&&(this._abortFn(),this._finishEase()),this},_ease:function(t,e,r){this._finishFn=e,this._abortFn=a.timed(function(e){t.call(this,r.easing(e)),1===e&&this._finishEase()},r.animate===!1?0:r.duration,this)},_finishEase:function(){delete this._abortFn;var t=this._finishFn;delete this._finishFn,t.call(this)},_normalizeBearing:function(t,e){t=n.wrap(t,-180,180);var r=Math.abs(t-e);return Math.abs(t-360-e)<r&&(t-=360),Math.abs(t+360-e)<r&&(t+=360),t},_updateEasing:function(t,e,r){var i;if(this.ease){var a=this.ease,o=(Date.now()-a.start)/a.duration,s=a.easing(o+.01)-a.easing(o),l=.27/Math.sqrt(s*s+1e-4)*.01,u=Math.sqrt(.0729-l*l);i=n.bezier(l,u,.25,1)}else i=r?n.bezier.apply(n,r):n.ease;return this.ease={start:(new Date).getTime(),to:Math.pow(2,e),duration:t,easing:i},i}})},{"../geo/lng_lat":305,"../geo/lng_lat_bounds":306,"../util/browser":392,"../util/interpolate":402,"../util/util":408,"point-geometry":448}],375:[function(t,e,r){"use strict";function n(t){o.setOptions(this,t)}var i=t("./control"),a=t("../../util/dom"),o=t("../../util/util");e.exports=n,n.createAttributionString=function(t){var e=[];for(var r in t){var n=t[r];n.attribution&&e.indexOf(n.attribution)<0&&e.push(n.attribution)}return e.sort(function(t,e){return t.length-e.length}),e=e.filter(function(t,r){for(var n=r+1;n<e.length;n++)if(e[n].indexOf(t)>=0)return!1;return!0}),e.join(" | ")},n.prototype=o.inherit(i,{options:{position:"bottom-right"},onAdd:function(t){var e="mapboxgl-ctrl-attrib",r=this._container=a.create("div",e,t.getContainer());return this._update(),t.on("source.load",this._update.bind(this)),t.on("source.change",this._update.bind(this)),t.on("source.remove",this._update.bind(this)),t.on("moveend",this._updateEditLink.bind(this)),r},_update:function(){this._map.style&&(this._container.innerHTML=n.createAttributionString(this._map.style.sources)),this._editLink=this._container.getElementsByClassName("mapbox-improve-map")[0],this._updateEditLink()},_updateEditLink:function(){if(this._editLink){var t=this._map.getCenter();this._editLink.href="https://www.mapbox.com/map-feedback/#/"+t.lng+"/"+t.lat+"/"+Math.round(this._map.getZoom()+1)}}})},{"../../util/dom":394,"../../util/util":408,"./control":376}],376:[function(t,e,r){"use strict";function n(){}var i=t("../../util/util"),a=t("../../util/evented");e.exports=n,n.prototype={addTo:function(t){this._map=t;var e=this._container=this.onAdd(t);if(this.options&&this.options.position){var r=this.options.position,n=t._controlCorners[r];e.className+=" mapboxgl-ctrl",r.indexOf("bottom")!==-1?n.insertBefore(e,n.firstChild):n.appendChild(e)}return this},remove:function(){return this._container.parentNode.removeChild(this._container),this.onRemove&&this.onRemove(this._map),this._map=null,this}},i.extend(n.prototype,a)},{"../../util/evented":400,"../../util/util":408}],377:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}var i=t("./control"),a=t("../../util/browser"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n;var l={enableHighAccuracy:!1,timeout:6e3};n.prototype=s.inherit(i,{options:{position:"top-right"},onAdd:function(t){var e="mapboxgl-ctrl",r=this._container=o.create("div",e+"-group",t.getContainer());return a.supportsGeolocation?(this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._geolocateButton=o.create("button",e+"-icon "+e+"-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)),r):r},_onContextMenu:function(t){t.preventDefault()},_onClickGeolocate:function(){navigator.geolocation.getCurrentPosition(this._success.bind(this),this._error.bind(this),l),this._timeoutId=setTimeout(this._finish.bind(this),1e4)},_success:function(t){this._map.jumpTo({center:[t.coords.longitude,t.coords.latitude],zoom:17,bearing:0,pitch:0}),this.fire("geolocate",t),this._finish()},_error:function(t){this.fire("error",t),this._finish()},_finish:function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}})},{"../../util/browser":392,"../../util/dom":394,"../../util/util":408,"./control":376}],378:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}function i(t){return new MouseEvent(t.type,{button:2,buttons:2,bubbles:!0,cancelable:!0,detail:t.detail,view:t.view,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY,movementX:t.movementX,movementY:t.movementY,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey})}var a=t("./control"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n,n.prototype=s.inherit(a,{options:{position:"top-right"},onAdd:function(t){var e="mapboxgl-ctrl",r=this._container=o.create("div",e+"-group",t.getContainer());return this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._zoomInButton=this._createButton(e+"-icon "+e+"-zoom-in",t.zoomIn.bind(t)),this._zoomOutButton=this._createButton(e+"-icon "+e+"-zoom-out",t.zoomOut.bind(t)),this._compass=this._createButton(e+"-icon "+e+"-compass",t.resetNorth.bind(t)),this._compassArrow=o.create("div","arrow",this._compass),this._compass.addEventListener("mousedown",this._onCompassDown.bind(this)),this._onCompassMove=this._onCompassMove.bind(this),this._onCompassUp=this._onCompassUp.bind(this),t.on("rotate",this._rotateCompassArrow.bind(this)),this._rotateCompassArrow(),this._el=t.getCanvasContainer(),r},_onContextMenu:function(t){t.preventDefault()},_onCompassDown:function(t){0===t.button&&(o.disableDrag(),document.addEventListener("mousemove",this._onCompassMove),document.addEventListener("mouseup",this._onCompassUp),this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassMove:function(t){0===t.button&&(this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassUp:function(t){0===t.button&&(document.removeEventListener("mousemove",this._onCompassMove),document.removeEventListener("mouseup",this._onCompassUp),o.enableDrag(),this._el.dispatchEvent(i(t)),t.stopPropagation())},_createButton:function(t,e){var r=o.create("button",t,this._container);return r.type="button",r.addEventListener("click",function(){e()}),r},_rotateCompassArrow:function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t}})},{"../../util/dom":394,"../../util/util":408,"./control":376}],379:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../geo/lng_lat_bounds"),o=t("../../util/util");e.exports=n,n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onMouseDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},_onMouseDown:function(t){t.shiftKey&&0===t.button&&(document.addEventListener("mousemove",this._onMouseMove,!1),document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("mouseup",this._onMouseUp,!1),i.disableDrag(),this._startPos=i.mousePos(this._el,t),this._active=!0)},_onMouseMove:function(t){var e=this._startPos,r=i.mousePos(this._el,t);this._box||(this._box=i.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var n=Math.min(e.x,r.x),a=Math.max(e.x,r.x),o=Math.min(e.y,r.y),s=Math.max(e.y,r.y);i.setTransform(this._box,"translate("+n+"px,"+o+"px)"),this._box.style.width=a-n+"px",this._box.style.height=s-o+"px"},_onMouseUp:function(t){if(0===t.button){var e=this._startPos,r=i.mousePos(this._el,t),n=new a(this._map.unproject(e),this._map.unproject(r));this._finish(),e.x===r.x&&e.y===r.y?this._fireEvent("boxzoomcancel",t):this._map.fitBounds(n,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},_finish:function(){this._active=!1,document.removeEventListener("mousemove",this._onMouseMove,!1),document.removeEventListener("keydown",this._onKeyDown,!1),document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.parentNode.removeChild(this._box),this._box=null),i.enableDrag()},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})}}},{"../../geo/lng_lat_bounds":306,"../../util/dom":394,"../../util/util":408}],380:[function(t,e,r){"use strict";function n(t){this._map=t,this._onDblClick=this._onDblClick.bind(this)}e.exports=n,n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)},_onDblClick:function(t){this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)}}},{}],381:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=.3,s=a.bezier(0,0,o,1),l=1400,u=2500;n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)},_onDown:function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(document.addEventListener("touchmove",this._onMove),document.addEventListener("touchend",this._onTouchEnd)):(document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onMouseUp)),this._active=!1,this._startPos=this._pos=i.mousePos(this._el,t),this._inertia=[[Date.now(),this._pos]])},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("dragstart",t),this._fireEvent("movestart",t));var e=i.mousePos(this._el,t),r=this._map;r.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),r.transform.setLocationAtPoint(r.transform.pointLocation(this._pos),e),this._fireEvent("drag",t),this._fireEvent("move",t),this._pos=e,t.preventDefault()}},_onUp:function(t){if(this.isActive()){this._active=!1,this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=function(){this._fireEvent("moveend",t)}.bind(this),r=this._inertia;if(r.length<2)return void e();var n=r[r.length-1],i=r[0],a=n[1].sub(i[1]),c=(n[0]-i[0])/1e3;if(0===c||n[1].equals(i[1]))return void e();var h=a.mult(o/c),f=h.mag();f>l&&(f=l,h._unit()._mult(f));var d=f/(u*o),p=h.mult(-d/2);this._map.panBy(p,{duration:1e3*d,easing:s,noMoveStart:!0},{originalEvent:t})}},_onMouseUp:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onMouseUp))},_onTouchEnd:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onTouchEnd))},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})},_ignoreEvent:function(t){var e=this._map;if(e.boxZoom&&e.boxZoom.isActive())return!0;if(e.dragRotate&&e.dragRotate.isActive())return!0;if(t.touches)return t.touches.length>1;if(t.ctrlKey)return!0;var r=1,n=0;return"mousemove"===t.type?t.buttons&0===r:t.button!==n},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now(),r=160;t.length>0&&e-t[0][0]>r;)t.shift()}}},{"../../util/dom":394,"../../util/util":408}],382:[function(t,e,r){"use strict";function n(t,e){this._map=t,this._el=t.getCanvasContainer(),this._bearingSnap=e.bearingSnap,o.bindHandlers(this)}var i=t("../../util/dom"),a=t("point-geometry"),o=t("../../util/util");e.exports=n;var s=.25,l=o.bezier(0,0,s,1),u=180,c=720;n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},_onDown:function(t){if(!this._ignoreEvent(t)&&!this.isActive()){document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onUp),this._active=!1,this._inertia=[[Date.now(),this._map.getBearing()]],this._startPos=this._pos=i.mousePos(this._el,t),this._center=this._map.transform.centerPoint;var e=this._startPos.sub(this._center),r=e.mag();r<200&&(this._center=this._startPos.add(new a(-200,0)._rotate(e.angle()))),t.preventDefault()}},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("rotatestart",t),this._fireEvent("movestart",t));var e=this._map;e.stop();var r=this._pos,n=i.mousePos(this._el,t),a=this._center,o=r.sub(a).angleWith(n.sub(a))/Math.PI*180,s=e.getBearing()-o,l=this._inertia,u=l[l.length-1];this._drainInertiaBuffer(),l.push([Date.now(),e._normalizeBearing(s,u[1])]),e.transform.bearing=s,this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=n}},_onUp:function(t){if(!this._ignoreEvent(t)&&(document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onUp),this.isActive())){this._active=!1,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var e=this._map,r=e.getBearing(),n=this._inertia,i=function(){Math.abs(r)<this._bearingSnap?e.resetNorth({noMoveStart:!0},{originalEvent:t}):this._fireEvent("moveend",t)}.bind(this);if(n.length<2)return void i();var a=n[0],o=n[n.length-1],h=n[n.length-2],f=e._normalizeBearing(r,h[1]),d=o[1]-a[1],p=d<0?-1:1,m=(o[0]-a[0])/1e3;if(0===d||0===m)return void i();var g=Math.abs(d*(s/m));g>u&&(g=u);var v=g/(c*s),y=p*g*(v/2);f+=y,Math.abs(e._normalizeBearing(f,0))<this._bearingSnap&&(f=e._normalizeBearing(0,f)),e.rotateTo(f,{duration:1e3*v,easing:l,noMoveStart:!0},{originalEvent:t})}},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})},_ignoreEvent:function(t){var e=this._map;if(e.boxZoom&&e.boxZoom.isActive())return!0;if(e.dragPan&&e.dragPan.isActive())return!0;if(t.touches)return t.touches.length>1;var r=t.ctrlKey?1:2,n=t.ctrlKey?0:2;return"mousemove"===t.type?t.buttons&0===r:t.button!==n},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now(),r=160;t.length>0&&e-t[0][0]>r;)t.shift()}}},{"../../util/dom":394,"../../util/util":408,"point-geometry":448}],383:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)}e.exports=n;var i=80,a=2,o=5;n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=this._map,r={originalEvent:t};if(!e.isEasing())switch(t.keyCode){case 61:case 107:case 171:case 187:e.zoomTo(Math.round(e.getZoom())+(t.shiftKey?2:1),r);break;case 189:case 109:case 173:e.zoomTo(Math.round(e.getZoom())-(t.shiftKey?2:1),r);break;case 37:t.shiftKey?e.easeTo({bearing:e.getBearing()-a},r):(t.preventDefault(),e.panBy([-i,0],r));break;case 39:t.shiftKey?e.easeTo({bearing:e.getBearing()+a},r):(t.preventDefault(),e.panBy([i,0],r));break;case 38:t.shiftKey?e.easeTo({pitch:e.getPitch()+o},r):(t.preventDefault(),e.panBy([0,-i],r));break;case 40:t.shiftKey?e.easeTo({pitch:Math.max(e.getPitch()-o,0)},r):(t.preventDefault(),e.panBy([0,i],r))}}}}},{}],384:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/browser"),o=t("../../util/util");e.exports=n;var s="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",l=s.indexOf("firefox")!==-1,u=s.indexOf("safari")!==-1&&s.indexOf("chrom")===-1;n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)},_onWheel:function(t){var e;"wheel"===t.type?(e=t.deltaY,l&&t.deltaMode===window.WheelEvent.DOM_DELTA_PIXEL&&(e/=a.devicePixelRatio),t.deltaMode===window.WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"===t.type&&(e=-t.wheelDeltaY,u&&(e/=3));var r=a.now(),n=r-(this._time||0);this._pos=i.mousePos(this._el,t),this._time=r,0!==e&&e%4.000244140625===0?(this._type="wheel",e=Math.floor(e/4)):0!==e&&Math.abs(e)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(n*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&this._zoom(-e,t),t.preventDefault()},_onTimeout:function(){this._type="wheel",this._zoom(-this._lastValue)},_zoom:function(t,e){if(0!==t){var r=this._map,n=2/(1+Math.exp(-Math.abs(t/100)));t<0&&0!==n&&(n=1/n);var i=r.ease?r.ease.to:r.transform.scale,a=r.transform.scaleZoom(i*n);r.zoomTo(a,{duration:0,around:r.unproject(this._pos),delayEndEvents:200},{originalEvent:e})}}}},{"../../util/browser":392,"../../util/dom":394,"../../util/util":408}],385:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=.15,s=a.bezier(0,0,o,1),l=12,u=2.5,c=.15,h=4;n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)},disableRotation:function(){this._rotationDisabled=!0},enableRotation:function(){this._rotationDisabled=!1},_onStart:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]);this._startVec=e.sub(r),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],document.addEventListener("touchmove",this._onMove,!1),document.addEventListener("touchend",this._onEnd,!1)}},_onMove:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]),n=e.add(r).div(2),a=e.sub(r),o=a.mag()/this._startVec.mag(),s=this._rotationDisabled?0:180*a.angleWith(this._startVec)/Math.PI,l=this._map;if(this._gestureIntent){var u={duration:0,around:l.unproject(n)};"rotate"===this._gestureIntent&&(u.bearing=this._startBearing+s),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(u.zoom=l.transform.scaleZoom(this._startScale*o)),l.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),o,n]),l.easeTo(u,{originalEvent:t})}else{var f=Math.abs(1-o)>c,d=Math.abs(s)>h;d?this._gestureIntent="rotate":f&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=a,this._startScale=l.transform.scale,this._startBearing=l.transform.bearing)}t.preventDefault()}},_onEnd:function(t){document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,r=this._map;if(e.length<2)return void r.snapToNorth({},{originalEvent:t});var n=e[e.length-1],i=e[0],a=r.transform.scaleZoom(this._startScale*n[1]),c=r.transform.scaleZoom(this._startScale*i[1]),h=a-c,f=(n[0]-i[0])/1e3,d=n[2];if(0===f||a===c)return void r.snapToNorth({},{originalEvent:t});var p=h*o/f;Math.abs(p)>u&&(p=p>0?u:-u);var m=1e3*Math.abs(p/(l*o)),g=a+p*m/2e3;g<0&&(g=0),r.easeTo({zoom:g,duration:m,easing:s,around:r.unproject(d)},{originalEvent:t})},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now(),r=160;t.length>2&&e-t[0][0]>r;)t.shift()}}},{"../../util/dom":394,"../../util/util":408}],386:[function(t,e,r){"use strict";function n(){i.bindAll(["_onHashChange","_updateHash"],this)}e.exports=n;var i=t("../util/util");n.prototype={addTo:function(t){return this._map=t,window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},remove:function(){return window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this},_onHashChange:function(){var t=location.hash.replace("#","").split("/");return t.length>=3&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0)}),!0)},_updateHash:function(){var t=this._map.getCenter(),e=this._map.getZoom(),r=this._map.getBearing(),n=Math.max(0,Math.ceil(Math.log(e)/Math.LN2)),i="#"+Math.round(100*e)/100+"/"+t.lat.toFixed(n)+"/"+t.lng.toFixed(n)+(r?"/"+Math.round(10*r)/10:"");window.history.replaceState("","",i)}}},{"../util/util":408}],387:[function(t,e,r){"use strict";function n(t){t.parentNode&&t.parentNode.removeChild(t)}var i=t("../util/canvas"),a=t("../util/util"),o=t("../util/browser"),s=t("../util/browser").window,l=t("../util/evented"),u=t("../util/dom"),c=t("../style/style"),h=t("../style/animation_loop"),f=t("../render/painter"),d=t("../geo/transform"),p=t("./hash"),m=t("./bind_handlers"),g=t("./camera"),v=t("../geo/lng_lat"),y=t("../geo/lng_lat_bounds"),x=t("point-geometry"),b=t("./control/attribution"),_=0,w=20,M={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:_,maxZoom:w,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,workerCount:Math.max(o.hardwareConcurrency-1,1)},A=e.exports=function(t){if(t=a.extend({},M,t),t.workerCount<1)throw new Error("workerCount must an integer greater than or equal to 1.");this._interactive=t.interactive,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._trackResize=t.trackResize,this._workerCount=t.workerCount,this._bearingSnap=t.bearingSnap,"string"==typeof t.container?this._container=document.getElementById(t.container):this._container=t.container,this.animationLoop=new h,this.transform=new d(t.minZoom,t.maxZoom),t.maxBounds&&this.setMaxBounds(t.maxBounds),a.bindAll(["_forwardStyleEvent","_forwardSourceEvent","_forwardLayerEvent","_forwardTileEvent","_onStyleLoad","_onStyleChange","_onSourceAdd","_onSourceRemove","_onSourceUpdate","_onWindowOnline","_onWindowResize","_update","_render"],this),this._setupContainer(),this._setupPainter(),this.on("move",this._update.bind(this,!1)),this.on("zoom",this._update.bind(this,!0)),this.on("moveend",function(){this.animationLoop.set(300),this._rerender()}.bind(this)),"undefined"!=typeof s&&(s.addEventListener("online",this._onWindowOnline,!1),s.addEventListener("resize",this._onWindowResize,!1)),m(this,t),this._hash=t.hash&&(new p).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),this.stacks={},this._classes=[],this.resize(),t.classes&&this.setClasses(t.classes),t.style&&this.setStyle(t.style),t.attributionControl&&this.addControl(new b(t.attributionControl));var e=this.fire.bind(this,"error");this.on("style.error",e),this.on("source.error",e),this.on("tile.error",e),this.on("layer.error",e)};a.extend(A.prototype,l),a.extend(A.prototype,g.prototype),a.extend(A.prototype,{addControl:function(t){return t.addTo(this),this},addClass:function(t,e){return this._classes.indexOf(t)>=0||""===t?this:(this._classes.push(t),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},removeClass:function(t,e){var r=this._classes.indexOf(t);return r<0||""===t?this:(this._classes.splice(r,1),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},setClasses:function(t,e){for(var r={},n=0;n<t.length;n++)""!==t[n]&&(r[t[n]]=!0);return this._classes=Object.keys(r),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0)},hasClass:function(t){return this._classes.indexOf(t)>=0},getClasses:function(){return this._classes},resize:function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),this._canvas.resize(t,e),this.transform.resize(t,e),this.painter.resize(t,e),this.fire("movestart").fire("move").fire("resize").fire("moveend")},getBounds:function(){var t=new y(this.transform.pointLocation(new x(0,0)),this.transform.pointLocation(this.transform.size));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new x(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new x(0,this.transform.size.y)))),t},setMaxBounds:function(t){if(t){var e=y.convert(t);this.transform.lngRange=[e.getWest(),e.getEast()],this.transform.latRange=[e.getSouth(),e.getNorth()],this.transform._constrain(),this._update()}else null!==t&&void 0!==t||(this.transform.lngRange=[],this.transform.latRange=[],this._update());return this},setMinZoom:function(t){if(t=null===t||void 0===t?_:t,t>=_&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between "+_+" and the current maxZoom, inclusive")},setMaxZoom:function(t){if(t=null===t||void 0===t?w:t,t>=this.transform.minZoom&&t<=w)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be between the current minZoom and "+w+", inclusive")},project:function(t){return this.transform.locationPoint(v.convert(t))},unproject:function(t){return this.transform.pointLocation(x.convert(t))},queryRenderedFeatures:function(){function t(t){return t instanceof x||Array.isArray(t)}var e,r={};return 2===arguments.length?(e=arguments[0],r=arguments[1]):1===arguments.length&&t(arguments[0])?e=arguments[0]:1===arguments.length&&(r=arguments[0]),this.style.queryRenderedFeatures(this._makeQueryGeometry(e),r,this.transform.zoom,this.transform.angle)},_makeQueryGeometry:function(t){void 0===t&&(t=[x.convert([0,0]),x.convert([this.transform.width,this.transform.height])]);var e,r=t instanceof x||"number"==typeof t[0];if(r){var n=x.convert(t);e=[n]}else{var i=[x.convert(t[0]),x.convert(t[1])];e=[i[0],new x(i[1].x,i[0].y),i[1],new x(i[0].x,i[1].y),i[0]]}return e=e.map(function(t){return this.transform.pointCoordinate(t)}.bind(this))},querySourceFeatures:function(t,e){return this.style.querySourceFeatures(t,e)},setStyle:function(t){return this.style&&(this.style.off("load",this._onStyleLoad).off("error",this._forwardStyleEvent).off("change",this._onStyleChange).off("source.add",this._onSourceAdd).off("source.remove",this._onSourceRemove).off("source.load",this._onSourceUpdate).off("source.error",this._forwardSourceEvent).off("source.change",this._onSourceUpdate).off("layer.add",this._forwardLayerEvent).off("layer.remove",this._forwardLayerEvent).off("layer.error",this._forwardLayerEvent).off("tile.add",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.load",this._update).off("tile.error",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent)._remove(),this.off("rotate",this.style._redoPlacement),this.off("pitch",this.style._redoPlacement)),t?(t instanceof c?this.style=t:this.style=new c(t,this.animationLoop,this._workerCount),this.style.on("load",this._onStyleLoad).on("error",this._forwardStyleEvent).on("change",this._onStyleChange).on("source.add",this._onSourceAdd).on("source.remove",this._onSourceRemove).on("source.load",this._onSourceUpdate).on("source.error",this._forwardSourceEvent).on("source.change",this._onSourceUpdate).on("layer.add",this._forwardLayerEvent).on("layer.remove",this._forwardLayerEvent).on("layer.error",this._forwardLayerEvent).on("tile.add",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.load",this._update).on("tile.error",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this.on("rotate",this.style._redoPlacement),this.on("pitch",this.style._redoPlacement),this):(this.style=null,this)},getStyle:function(){if(this.style)return this.style.serialize()},addSource:function(t,e){return this.style.addSource(t,e),this._update(!0),this},addSourceType:function(t,e,r){return this.style.addSourceType(t,e,r)},removeSource:function(t){return this.style.removeSource(t),this._update(!0),this},getSource:function(t){return this.style.getSource(t)},addLayer:function(t,e){return this.style.addLayer(t,e),this._update(!0),this},removeLayer:function(t){return this.style.removeLayer(t),this._update(!0),this},getLayer:function(t){return this.style.getLayer(t)},setFilter:function(t,e){return this.style.setFilter(t,e),this._update(!0),this},setLayerZoomRange:function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0),this},getFilter:function(t){return this.style.getFilter(t)},setPaintProperty:function(t,e,r,n){return this.style.setPaintProperty(t,e,r,n),this._update(!0),this},getPaintProperty:function(t,e,r){return this.style.getPaintProperty(t,e,r)},setLayoutProperty:function(t,e,r){return this.style.setLayoutProperty(t,e,r),this._update(!0),this},getLayoutProperty:function(t,e){return this.style.getLayoutProperty(t,e)},getContainer:function(){return this._container},getCanvasContainer:function(){return this._canvasContainer},getCanvas:function(){return this._canvas.getElement()},_setupContainer:function(){var t=this._container;t.classList.add("mapboxgl-map");var e=this._canvasContainer=u.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=new i(this,e);var r=this._controlContainer=u.create("div","mapboxgl-control-container",t),n=this._controlCorners={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){n[t]=u.create("div","mapboxgl-ctrl-"+t,r)})},_setupPainter:function(){var t=this._canvas.getWebGLContext({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer});return t?void(this.painter=new f(t,this.transform)):void this.fire("error",{error:new Error("Failed to initialize WebGL")})},_contextLost:function(t){t.preventDefault(),this._frameId&&o.cancelFrame(this._frameId),this.fire("webglcontextlost",{originalEvent:t})},_contextRestored:function(t){this._setupPainter(),this.resize(),this._update(),this.fire("webglcontextrestored",{originalEvent:t})},loaded:function(){return!this._styleDirty&&!this._sourcesDirty&&!(!this.style||!this.style.loaded())},_update:function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender(),this):this},_render:function(){try{this.style&&this._styleDirty&&(this._styleDirty=!1,this.style.update(this._classes,this._classOptions),this._classOptions=null,this.style._recalculate(this.transform.zoom)),this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.painter.render(this.style,{debug:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,vertices:this.vertices,rotating:this.rotating,zooming:this.zooming}),this.fire("render"),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire("load")),this._frameId=null,this.animationLoop.stopped()||(this._styleDirty=!0),(this._sourcesDirty||this._repaint||this._styleDirty)&&this._rerender()}catch(t){this.fire("error",{error:t})}return this},remove:function(){this._hash&&this._hash.remove(),o.cancelFrame(this._frameId),this.setStyle(null),"undefined"!=typeof s&&s.removeEventListener("resize",this._onWindowResize,!1);var t=this.painter.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),n(this._canvasContainer),n(this._controlContainer),this._container.classList.remove("mapboxgl-map")},_rerender:function(){this.style&&!this._frameId&&(this._frameId=o.frame(this._render))},_forwardStyleEvent:function(t){this.fire("style."+t.type,a.extend({style:t.target},t))},_forwardSourceEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardLayerEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardTileEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_onStyleLoad:function(t){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style.update(this._classes,{transition:!1}),this._forwardStyleEvent(t)},_onStyleChange:function(t){this._update(!0),this._forwardStyleEvent(t)},_onSourceAdd:function(t){var e=t.source;e.onAdd&&e.onAdd(this),this._forwardSourceEvent(t)},_onSourceRemove:function(t){var e=t.source;e.onRemove&&e.onRemove(this),this._forwardSourceEvent(t)},_onSourceUpdate:function(t){this._update(),this._forwardSourceEvent(t)},_onWindowOnline:function(){this._update()},_onWindowResize:function(){this._trackResize&&this.stop().resize()._update()}}),a.extendAll(A.prototype,{_showTileBoundaries:!1,get showTileBoundaries(){return this._showTileBoundaries},set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},_showCollisionBoxes:!1,get showCollisionBoxes(){return this._showCollisionBoxes},set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,this.style._redoPlacement())},_showOverdrawInspector:!1,get showOverdrawInspector(){return this._showOverdrawInspector},set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},_repaint:!1,get repaint(){return this._repaint},set repaint(t){this._repaint=t,this._update()},_vertices:!1,get vertices(){return this._vertices},set vertices(t){this._vertices=t,this._update()}})},{"../geo/lng_lat":305,"../geo/lng_lat_bounds":306,"../geo/transform":307,"../render/painter":321,"../style/animation_loop":341,"../style/style":344,"../util/browser":392,"../util/canvas":393,"../util/dom":394,"../util/evented":400,"../util/util":408,"./bind_handlers":373,"./camera":374,"./control/attribution":375,"./hash":386,"point-geometry":448}],388:[function(t,e,r){"use strict";function n(t,e){t||(t=i.create("div")),t.classList.add("mapboxgl-marker"),this._el=t,this._offset=o.convert(e&&e.offset||[0,0]),this._update=this._update.bind(this)}e.exports=n;var i=t("../util/dom"),a=t("../geo/lng_lat"),o=t("point-geometry");n.prototype={addTo:function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._el),t.on("move",this._update),this._update(),this},remove:function(){this._map&&(this._map.off("move",this._update),this._map=null);var t=this._el.parentNode;return t&&t.removeChild(this._el),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=a.convert(t),this._update(),this},getElement:function(){return this._el},_update:function(){if(this._map){var t=this._map.project(this._lngLat)._add(this._offset);i.setTransform(this._el,"translate("+t.x+"px,"+t.y+"px)")}}}},{"../geo/lng_lat":305,"../util/dom":394,"point-geometry":448}],389:[function(t,e,r){"use strict";function n(t){i.setOptions(this,t),i.bindAll(["_update","_onClickClose"],this)}e.exports=n;var i=t("../util/util"),a=t("../util/evented"),o=t("../util/dom"),s=t("../geo/lng_lat");n.prototype=i.inherit(a,{options:{closeButton:!0,closeOnClick:!0},addTo:function(t){return this._map=t,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this},remove:function(){return this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._container&&(this._container.parentNode.removeChild(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire("close"),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=s.convert(t),this._update(),this},setText:function(t){return this.setDOMContent(document.createTextNode(t))},setHTML:function(t){var e,r=document.createDocumentFragment(),n=document.createElement("body");for(n.innerHTML=t;;){if(e=n.firstChild,!e)break;r.appendChild(e)}return this.setDOMContent(r)},setDOMContent:function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},_createContent:function(){this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._content=o.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=o.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClickClose))},_update:function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=o.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=o.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content));var t=this._map.project(this._lngLat).round(),e=this.options.anchor;if(!e){var r=this._container.offsetWidth,n=this._container.offsetHeight;e=t.y<n?["top"]:t.y>this._map.transform.height-n?["bottom"]:[],t.x<r/2?e.push("left"):t.x>this._map.transform.width-r/2&&e.push("right"),e=0===e.length?"bottom":e.join("-")}var i={top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"},a=this._container.classList;for(var s in i)a.remove("mapboxgl-popup-anchor-"+s);a.add("mapboxgl-popup-anchor-"+e),o.setTransform(this._container,i[e]+" translate("+t.x+"px,"+t.y+"px)")}},_onClickClose:function(){this.remove()}})},{"../geo/lng_lat":305,"../util/dom":394,"../util/evented":400,"../util/util":408}],390:[function(t,e,r){"use strict";function n(t,e){this.target=t,this.parent=e,this.callbacks={},this.callbackID=0,this.receive=this.receive.bind(this),this.target.addEventListener("message",this.receive,!1)}e.exports=n,n.prototype.receive=function(t){function e(t,e,r){this.postMessage({type:"<response>",id:String(i),error:t?String(t):null,data:e},r)}var r,n=t.data,i=n.id;if("<response>"===n.type)r=this.callbacks[n.id],delete this.callbacks[n.id],r&&r(n.error||null,n.data);else if("undefined"!=typeof n.id&&this.parent[n.type])this.parent[n.type](n.data,e.bind(this));else if("undefined"!=typeof n.id&&this.parent.workerSources){var a=n.type.split(".");this.parent.workerSources[a[0]][a[1]](n.data,e.bind(this))}else this.parent[n.type](n.data)},n.prototype.send=function(t,e,r,n){var i=null;r&&(this.callbacks[i=this.callbackID++]=r),this.postMessage({type:t,id:String(i),data:e},n)},n.prototype.postMessage=function(t,e){this.target.postMessage(t,e)}},{}],391:[function(t,e,r){"use strict";function n(t){var e=document.createElement("a");return e.href=t,e.protocol===document.location.protocol&&e.host===document.location.host}r.getJSON=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.setRequestHeader("Accept","application/json"),r.onerror=function(t){e(t)},r.onload=function(){if(r.status>=200&&r.status<300&&r.response){var t;try{t=JSON.parse(r.response)}catch(t){return e(t)}e(null,t)}else e(new Error(r.statusText))},r.send(),r},r.getArrayBuffer=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.responseType="arraybuffer",r.onerror=function(t){e(t)},r.onload=function(){r.status>=200&&r.status<300&&r.response?e(null,r.response):e(new Error(r.statusText))},r.send(),r},r.getImage=function(t,e){return r.getArrayBuffer(t,function(t,r){if(t)return e(t);var n=new Image;n.onload=function(){e(null,n),(window.URL||window.webkitURL).revokeObjectURL(n.src)};var i=new Blob([new Uint8Array(r)],{type:"image/png"});return n.src=(window.URL||window.webkitURL).createObjectURL(i),n.getData=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return t.width=n.width,t.height=n.height,e.drawImage(n,0,0),e.getImageData(0,0,n.width,n.height).data},n})},r.getVideo=function(t,e){var r=document.createElement("video");r.onloadstart=function(){e(null,r)};for(var i=0;i<t.length;i++){var a=document.createElement("source");n(t[i])||(r.crossOrigin="Anonymous"),a.src=t[i],r.appendChild(a)}return r.getData=function(){return r},r}},{}],392:[function(t,e,r){"use strict";r.window=window,e.exports.now=function(){return window.performance&&window.performance.now?window.performance.now.bind(window.performance):Date.now.bind(Date)}();var n=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;r.frame=function(t){return n(t)};var i=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame;r.cancelFrame=function(t){i(t)},r.timed=function(t,n,i){function a(l){o||(l=e.exports.now(),l>=s+n?t.call(i,1):(t.call(i,(l-s)/n),r.frame(a)))}if(!n)return t.call(i,1),null;var o=!1,s=e.exports.now();return r.frame(a),function(){o=!0}},r.supported=t("mapbox-gl-supported"),r.hardwareConcurrency=navigator.hardwareConcurrency||4,Object.defineProperty(r,"devicePixelRatio",{get:function(){return window.devicePixelRatio}}),r.supportsWebp=!1;var a=document.createElement("img");a.onload=function(){r.supportsWebp=!0},a.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=",r.supportsGeolocation=!!navigator.geolocation},{"mapbox-gl-supported":293}],393:[function(t,e,r){"use strict";function n(t,e){this.canvas=document.createElement("canvas"),t&&e&&(this.canvas.style.position="absolute",this.canvas.classList.add("mapboxgl-canvas"),this.canvas.addEventListener("webglcontextlost",t._contextLost.bind(t),!1),this.canvas.addEventListener("webglcontextrestored",t._contextRestored.bind(t),!1),this.canvas.setAttribute("tabindex",0),e.appendChild(this.canvas))}var i=t("../util"),a=t("mapbox-gl-supported");e.exports=n,n.prototype.resize=function(t,e){var r=window.devicePixelRatio||1;this.canvas.width=r*t,this.canvas.height=r*e,this.canvas.style.width=t+"px",this.canvas.style.height=e+"px"},n.prototype.getWebGLContext=function(t){return t=i.extend({},t,a.webGLContextAttributes),this.canvas.getContext("webgl",t)||this.canvas.getContext("experimental-webgl",t)},n.prototype.getElement=function(){return this.canvas}},{"../util":408,"mapbox-gl-supported":293}],394:[function(t,e,r){"use strict";function n(t){for(var e=0;e<t.length;e++)if(t[e]in s)return t[e]}function i(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",i,!0)}var a=t("point-geometry");r.create=function(t,e,r){var n=document.createElement(t);return e&&(n.className=e),r&&r.appendChild(n),n};var o,s=document.documentElement.style,l=n(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);r.disableDrag=function(){l&&(o=s[l],s[l]="none")},r.enableDrag=function(){l&&(s[l]=o)};var u=n(["transform","WebkitTransform"]);r.setTransform=function(t,e){t.style[u]=e},r.suppressClick=function(){window.addEventListener("click",i,!0),window.setTimeout(function(){window.removeEventListener("click",i,!0)},0)},r.mousePos=function(t,e){var r=t.getBoundingClientRect();return e=e.touches?e.touches[0]:e,new a(e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop)},r.touchPos=function(t,e){for(var r=t.getBoundingClientRect(),n=[],i=0;i<e.touches.length;i++)n.push(new a(e.touches[i].clientX-r.left-t.clientLeft,e.touches[i].clientY-r.top-t.clientTop));return n}},{"point-geometry":448}],395:[function(t,e,r){"use strict";var n=t("webworkify");e.exports=function(){return new n(t("../../source/worker"))}},{"../../source/worker":339,webworkify:525}],396:[function(t,e,r){"use strict";function n(t,e){return e.area-t.area}function i(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i<a;o=i++)e=t[i],r=t[o],n+=(r.x-e.x)*(e.y+r.y);return n}var a=t("quickselect");e.exports=function(t,e){var r=t.length;if(r<=1)return[t];for(var o,s,l=[],u=0;u<r;u++){var c=i(t[u]);0!==c&&(t[u].area=Math.abs(c),void 0===s&&(s=c<0),s===c<0?(o&&l.push(o),o=[t[u]]):o.push(t[u]))}if(o&&l.push(o),e>1)for(var h=0;h<l.length;h++)l[h].length<=e||(a(l[h],e,1,l[h].length-1,n),l[h]=l[h].slice(0,e));return l}},{quickselect:457}],397:[function(t,e,r){"use strict";e.exports={API_URL:"https://api.mapbox.com",REQUIRE_ACCESS_TOKEN:!0}},{}],398:[function(t,e,r){"use strict";function n(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r}}var i=t("assert");e.exports=n,n.prototype.encode=function(t){return i(t in this._stringToNumber),this._stringToNumber[t]},n.prototype.decode=function(t){return i(t<this._numberToString.length),this._numberToString[t]}},{assert:36}],399:[function(t,e,r){"use strict";function n(t,e){this.actors=[],this.currentActor=0;for(var r=0;r<t;r++){var n=new o,i=new a(n,e);i.name="Worker "+r,this.actors.push(i)}}var i=t("./util"),a=t("./actor"),o=t("./web_worker");e.exports=n,n.prototype={broadcast:function(t,e,r){r=r||function(){},i.asyncAll(this.actors,function(r,n){r.send(t,e,n)},r)},send:function(t,e,r,n,i){return("number"!=typeof n||isNaN(n))&&(n=this.currentActor=(this.currentActor+1)%this.actors.length),this.actors[n].send(t,e,r,i),n},remove:function(){for(var t=0;t<this.actors.length;t++)this.actors[t].target.terminate();this.actors=[]}}},{"./actor":390,"./util":408,"./web_worker":395}],400:[function(t,e,r){"use strict";var n=t("./util"),i={on:function(t,e){return this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(e),this},off:function(t,e){if(!t)return delete this._events,this;if(!this.listens(t))return this;if(e){var r=this._events[t].indexOf(e);r>=0&&this._events[t].splice(r,1),this._events[t].length||delete this._events[t]}else delete this._events[t];return this},once:function(t,e){var r=function(n){this.off(t,r),e.call(this,n)}.bind(this);return this.on(t,r),this},fire:function(t,e){if(!this.listens(t))return n.endsWith(t,"error")&&console.error(e&&e.error||e||"Empty error event"),this;e=n.extend({},e),n.extend(e,{type:t,target:this});for(var r=this._events[t].slice(),i=0;i<r.length;i++)r[i].call(this,e);return this},listens:function(t){return!(!this._events||!this._events[t])}};e.exports=i},{"./util":408}],401:[function(t,e,r){"use strict";function n(t,e){this.stacks=t.readFields(i,[],e)}function i(t,e,r){if(1===t){var n=r.readMessage(a,{glyphs:{}});e.push(n)}}function a(t,e,r){if(1===t)e.name=r.readString();else if(2===t)e.range=r.readString();else if(3===t){var n=r.readMessage(o,{});e.glyphs[n.id]=n}}function o(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}e.exports=n},{}],402:[function(t,e,r){"use strict";function n(t,e,r){return t*(1-r)+e*r}e.exports=n,n.number=n,n.vec2=function(t,e,r){return[n(t[0],e[0],r),n(t[1],e[1],r)]},n.color=function(t,e,r){return[n(t[0],e[0],r),n(t[1],e[1],r),n(t[2],e[2],r),n(t[3],e[3],r)]},n.array=function(t,e,r){return t.map(function(t,i){return n(t,e[i],r)})}},{}],403:[function(t,e,r){"use strict";function n(t,e,r){for(var n=0;n<t.length;n++)for(var i=t[n],a=0;a<e.length;a++)for(var o=e[a],s=0;s<o.length;s++){var l=o[s];if(d(i,l))return!0;if(c(l,i,r))return!0}return!1}function i(t,e){if(1===t.length&&1===t[0].length)return f(e,t[0][0]);for(var r=0;r<e.length;r++)for(var n=e[r],i=0;i<n.length;i++)if(f(t,n[i]))return!0;for(var a=0;a<t.length;a++){for(var o=t[a],l=0;l<o.length;l++)if(f(e,o[l]))return!0;for(var u=0;u<e.length;u++)if(s(o,e[u]))return!0}return!1}function a(t,e,r){for(var n=0;n<e.length;n++)for(var i=e[n],a=0;a<t.length;a++){var s=t[a];if(s.length>=3)for(var l=0;l<i.length;l++)if(d(s,i[l]))return!0;if(o(s,i,r))return!0}return!1}function o(t,e,r){if(t.length>1){if(s(t,e))return!0;for(var n=0;n<e.length;n++)if(c(e[n],t,r))return!0}for(var i=0;i<t.length;i++)if(c(t[i],e,r))return!0;return!1}function s(t,e){for(var r=0;r<t.length-1;r++)for(var n=t[r],i=t[r+1],a=0;a<e.length-1;a++){var o=e[a],s=e[a+1];if(u(n,i,o,s))return!0}return!1}function l(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function u(t,e,r,n){return l(t,r,n)!==l(e,r,n)&&l(t,e,r)!==l(t,e,n)}function c(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])<n;for(var i=1;i<e.length;i++){var a=e[i-1],o=e[i];if(h(t,a,o)<n)return!0}return!1}function h(t,e,r){var n=e.distSqr(r);if(0===n)return t.distSqr(e);var i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return i<0?t.distSqr(e):i>1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function f(t,e){for(var r,n,i,a=!1,o=0;o<t.length;o++){r=t[o];for(var s=0,l=r.length-1;s<r.length;l=s++)n=r[s],i=r[l],n.y>e.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a)}return a}function d(t,e){for(var r=!1,n=0,i=t.length-1;n<t.length;i=n++){var a=t[n],o=t[i];a.y>e.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}e.exports={multiPolygonIntersectsBufferedMultiPoint:n,multiPolygonIntersectsMultiPolygon:i,multiPolygonIntersectsBufferedMultiLine:a}},{}],404:[function(t,e,r){"use strict";function n(t,e){this.max=t,this.onRemove=e,this.reset()}e.exports=n,n.prototype.reset=function(){for(var t in this.data)this.onRemove(this.data[t]);return this.data={},this.order=[],this},n.prototype.add=function(t,e){if(this.has(t))this.order.splice(this.order.indexOf(t),1),this.data[t]=e,this.order.push(t);else if(this.data[t]=e,this.order.push(t),this.order.length>this.max){var r=this.get(this.order[0]);r&&this.onRemove(r)}return this},n.prototype.has=function(t){return t in this.data},n.prototype.keys=function(){return this.order},n.prototype.get=function(t){if(!this.has(t))return null;var e=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),e},n.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this.get(this.order[0]);e&&this.onRemove(e)}return this}},{}],405:[function(t,e,r){"use strict";function n(t,e,r){if(r=r||o.ACCESS_TOKEN,!r&&o.REQUIRE_ACCESS_TOKEN)throw new Error("An API access token is required to use Mapbox GL. See https://www.mapbox.com/developers/api/#access-tokens");if(t=t.replace(/^mapbox:\/\//,o.API_URL+e),t+=t.indexOf("?")!==-1?"&access_token=":"?access_token=",o.REQUIRE_ACCESS_TOKEN){if("s"===r[0])throw new Error("Use a public access token (pk.*) with Mapbox GL JS, not a secret access token (sk.*). See https://www.mapbox.com/developers/api/#access-tokens");t+=r}return t}function i(t){return t?"?"+t:""}function a(t){return t.access_token&&"tk."===t.access_token.slice(0,3)?u.extend({},t,{access_token:o.ACCESS_TOKEN}):t}var o=t("./config"),s=t("./browser"),l=t("url"),u=t("./util");e.exports.normalizeStyleURL=function(t,e){var r=l.parse(t);return"mapbox:"!==r.protocol?t:n("mapbox:/"+r.pathname+i(r.query),"/styles/v1/",e)},e.exports.normalizeSourceURL=function(t,e){var r=l.parse(t);return"mapbox:"!==r.protocol?t:n(t+".json","/v4/",e)+"&secure"},e.exports.normalizeGlyphsURL=function(t,e){var r=l.parse(t);if("mapbox:"!==r.protocol)return t;var a=r.pathname.split("/")[1];return n("mapbox://"+a+"/{fontstack}/{range}.pbf"+i(r.query),"/fonts/v1/",e)},e.exports.normalizeSpriteURL=function(t,e,r,a){var o=l.parse(t);return"mapbox:"!==o.protocol?(o.pathname+=e+r,l.format(o)):n("mapbox:/"+o.pathname+"/sprite"+e+r+i(o.query),"/styles/v1/",a)},e.exports.normalizeTileURL=function(t,e,r){var n=l.parse(t,!0);if(!e)return t;var i=l.parse(e);if("mapbox:"!==i.protocol)return t;var o=s.supportsWebp?".webp":"$1",u=s.devicePixelRatio>=2||512===r?"@2x":"";return l.format({protocol:n.protocol,hostname:n.hostname,pathname:n.pathname.replace(/(\.(?:png|jpg)\d*)/,u+o),query:a(n.query)})}},{"./browser":392,"./config":397,"./util":408,url:506}],406:[function(t,e,r){"use strict";function n(t){function e(){f.apply(this,arguments)}function r(){d.apply(this,arguments),this.members=e.prototype.members}var n=JSON.stringify(t);if(g[n])return g[n];void 0===t.alignment&&(t.alignment=1),e.prototype=Object.create(f.prototype);var s=0,u=0,v=["Uint8"];return e.prototype.members=t.members.map(function(r){r={name:r.name,type:r.type,components:r.components||1},p(r.name.length),p(r.type in m),v.indexOf(r.type)<0&&v.push(r.type);var n=o(r.type);u=Math.max(u,n),r.offset=s=a(s,Math.max(t.alignment,n));for(var i=0;i<r.components;i++)Object.defineProperty(e.prototype,r.name+(1===r.components?"":i),{get:c(r,i),set:h(r,i)});return s+=n*r.components,r}),e.prototype.alignment=t.alignment,e.prototype.size=a(s,Math.max(u,t.alignment)),r.serialize=i,r.prototype=Object.create(d.prototype),r.prototype.StructType=e,r.prototype.bytesPerElement=e.prototype.size,r.prototype.emplaceBack=l(e.prototype.members,e.prototype.size),r.prototype._usedTypes=v,g[n]=r,r}function i(){return{members:this.prototype.StructType.prototype.members,alignment:this.prototype.StructType.prototype.alignment,bytesPerElement:this.prototype.bytesPerElement}}function a(t,e){return Math.ceil(t/e)*e}function o(t){return m[t].BYTES_PER_ELEMENT}function s(t){return t.toLowerCase()}function l(t,e){for(var r=[],n=[],i="var i = this.length;\nthis.resize(this.length + 1);\n",a=0;a<t.length;a++){var l=t[a],u=o(l.type);r.indexOf(u)<0&&(r.push(u),i+="var o"+u.toFixed(0)+" = i * "+(e/u).toFixed(0)+";\n");for(var c=0;c<l.components;c++){var h="v"+n.length,f="o"+u.toFixed(0)+" + "+(l.offset/u+c).toFixed(0);i+="this."+s(l.type)+"["+f+"] = "+h+";\n",n.push(h)}}return i+="return i;",new Function(n,i)}function u(t,e){var r="this._pos"+o(t.type).toFixed(0),n=(t.offset/o(t.type)+e).toFixed(0),i=r+" + "+n;return"this._structArray."+s(t.type)+"["+i+"]"}function c(t,e){return new Function([],"return "+u(t,e)+";")}function h(t,e){return new Function(["x"],u(t,e)+" = x;")}function f(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}function d(t){void 0!==t?(this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.capacity=this.arrayBuffer.byteLength/this.bytesPerElement,this._refreshViews()):(this.capacity=-1,this.resize(0))}var p=t("assert");e.exports=n;var m={Int8:Int8Array,Uint8:Uint8Array,Uint8Clamped:Uint8ClampedArray,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array,Float64:Float64Array},g={};d.prototype.DEFAULT_CAPACITY=128,d.prototype.RESIZE_MULTIPLIER=5,d.prototype.serialize=function(){return this.trim(),{length:this.length,arrayBuffer:this.arrayBuffer}},d.prototype.get=function(t){return new this.StructType(this,t)},d.prototype.trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},d.prototype.resize=function(t){if(this.length=t,t>this.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*this.RESIZE_MULTIPLIER),this.DEFAULT_CAPACITY),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},d.prototype._refreshViews=function(){for(var t=0;t<this._usedTypes.length;t++){var e=this._usedTypes[t];this[s(e)]=new m[e](this.arrayBuffer)}},d.prototype.toArray=function(t,e){for(var r=[],n=t;n<e;n++){var i=this.get(n);r.push(i)}return r}},{assert:36}],407:[function(t,e,r){"use strict";function n(t,e){return e.replace(/{([^{}]+)}/g,function(e,r){return r in t?t[r]:""})}e.exports=n},{}],408:[function(t,e,r){"use strict";var n=t("unitbezier"),i=t("../geo/coordinate");r.easeCubicInOut=function(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)},r.bezier=function(t,e,r,i){var a=new n(t,e,r,i);return function(t){return a.solve(t)}},r.ease=r.bezier(.25,.1,.25,1),r.clamp=function(t,e,r){return Math.min(r,Math.max(e,t))},r.wrap=function(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i},r.coalesce=function(){for(var t=0;t<arguments.length;t++){var e=arguments[t];if(null!==e&&void 0!==e)return e}},r.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var n=t.length,i=new Array(t.length),a=null;t.forEach(function(t,o){e(t,function(t,e){t&&(a=t),i[o]=e,0===--n&&r(a,i)})})},r.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},r.extend=function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)t[n]=r[n]}return t},r.extendAll=function(t,e){for(var r in e)Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r));return t},r.inherit=function(t,e){var n="function"==typeof t?t.prototype:t,i=Object.create(n);return r.extendAll(i,e),i},r.pick=function(t,e){for(var r={},n=0;n<e.length;n++){var i=e[n];i in t&&(r[i]=t[i])}return r};var a=1;r.uniqueId=function(){return a++},r.debounce=function(t,e){var r,n;return function(){n=arguments,clearTimeout(r),r=setTimeout(function(){t.apply(null,n)},e)}},r.bindAll=function(t,e){t.forEach(function(t){e[t]&&(e[t]=e[t].bind(e))})},r.bindHandlers=function(t){for(var e in t)"function"==typeof t[e]&&0===e.indexOf("_on")&&(t[e]=t[e].bind(t))},r.setOptions=function(t,e){t.hasOwnProperty("options")||(t.options=t.options?Object.create(t.options):{});for(var r in e)t.options[r]=e[r];return t.options},r.getCoordinatesCenter=function(t){for(var e=1/0,r=1/0,n=-(1/0),a=-(1/0),o=0;o<t.length;o++)e=Math.min(e,t[o].column),r=Math.min(r,t[o].row),n=Math.max(n,t[o].column),a=Math.max(a,t[o].row);var s=n-e,l=a-r,u=Math.max(s,l);return new i((e+n)/2,(r+a)/2,0).zoomTo(Math.floor(-Math.log(u)/Math.LN2))},r.endsWith=function(t,e){return t.indexOf(e,t.length-e.length)!==-1},r.startsWith=function(t,e){return 0===t.indexOf(e)},r.mapObject=function(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n},r.filterObject=function(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n},r.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0;n<e.length;n++)if(!t(e[n],r[n]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==r){if("object"!=typeof r)return!1;var i=Object.keys(e);if(i.length!==Object.keys(r).length)return!1;for(var a in e)if(!t(e[a],r[a]))return!1;return!0}return e===r},r.clone=function(t){return Array.isArray(t)?t.map(r.clone):"object"==typeof t?r.mapObject(t,r.clone):t},r.arraysIntersect=function(t,e){for(var r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1};var o={};r.warnOnce=function(t){o[t]||("undefined"!=typeof console&&console.warn(t),o[t]=!0)}},{"../geo/coordinate":304,unitbezier:505}],409:[function(t,e,r){"use strict";function n(t,e,r,n){this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id)}e.exports=n,n.prototype={type:"Feature",get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},set geometry(t){this._geometry=t},toJSON:function(){var t={};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&"toJSON"!==e&&(t[e]=this[e]);return t}}},{}],410:[function(t,e,r){e.exports={_args:[[{raw:"mapbox-gl@^0.22.0",scope:null,escapedName:"mapbox-gl",name:"mapbox-gl",rawSpec:"^0.22.0",spec:">=0.22.0 <0.23.0",type:"range"},"/home/etienne/Documents/plotly/plotly.js"]],_from:"mapbox-gl@>=0.22.0 <0.23.0",_id:"mapbox-gl@0.22.1",_inCache:!0,_location:"/mapbox-gl",_nodeVersion:"4.4.5",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/mapbox-gl-0.22.1.tgz_1471549891670_0.8762630566488951"},_npmUser:{name:"lucaswoj",email:"lucas@lucaswoj.com"},_npmVersion:"2.15.5",_phantomChildren:{},_requested:{raw:"mapbox-gl@^0.22.0",scope:null,escapedName:"mapbox-gl",name:"mapbox-gl",rawSpec:"^0.22.0",spec:">=0.22.0 <0.23.0",type:"range"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz",_shasum:"92a965547d4c2f24c22cbc487eeda48694cb627a",_shrinkwrap:null,_spec:"mapbox-gl@^0.22.0",_where:"/home/etienne/Documents/plotly/plotly.js",browser:{"./js/util/ajax.js":"./js/util/browser/ajax.js","./js/util/browser.js":"./js/util/browser/browser.js","./js/util/canvas.js":"./js/util/browser/canvas.js","./js/util/dom.js":"./js/util/browser/dom.js","./js/util/web_worker.js":"./js/util/browser/web_worker.js"},bugs:{url:"https://github.com/mapbox/mapbox-gl-js/issues"},dependencies:{csscolorparser:"^1.0.2",earcut:"^2.0.3","feature-filter":"^2.2.0","geojson-rewind":"^0.1.0","geojson-vt":"^2.4.0","gl-matrix":"^2.3.1","grid-index":"^1.0.0","mapbox-gl-function":"^1.2.1","mapbox-gl-shaders":"github:mapbox/mapbox-gl-shaders#de2ab007455aa2587c552694c68583f94c9f2747","mapbox-gl-style-spec":"github:mapbox/mapbox-gl-style-spec#83b1a3e5837d785af582efd5ed1a212f2df6a4ae","mapbox-gl-supported":"^1.2.0",pbf:"^1.3.2",pngjs:"^2.2.0","point-geometry":"^0.0.0",quickselect:"^1.0.0",request:"^2.39.0","resolve-url":"^0.2.1","shelf-pack":"^1.0.0",supercluster:"^2.0.1",unassertify:"^2.0.0",unitbezier:"^0.0.0","vector-tile":"^1.3.0","vt-pbf":"^2.0.2",webworkify:"^1.3.0","whoots-js":"^2.0.0"},description:"A WebGL interactive maps library",devDependencies:{"babel-preset-react":"^6.11.1",babelify:"^7.3.0",benchmark:"~2.1.0",browserify:"^13.0.0",clipboard:"^1.5.12","concat-stream":"1.5.1",coveralls:"^2.11.8",doctrine:"^1.2.1",documentation:"https://github.com/documentationjs/documentation/archive/bb41619c734e59ef3fbc3648610032efcfdaaace.tar.gz","documentation-theme-utils":"3.0.0",envify:"^3.4.0",eslint:"^2.5.3","eslint-config-mourner":"^2.0.0","eslint-plugin-html":"^1.5.1",gl:"^4.0.1",handlebars:"4.0.5","highlight.js":"9.3.0",istanbul:"^0.4.2","json-loader":"^0.5.4",lodash:"^4.13.1","mapbox-gl-test-suite":"github:mapbox/mapbox-gl-test-suite#7babab52fb02788ebbc38384139bf350e8e38552","memory-fs":"^0.3.0",minifyify:"^7.0.1","npm-run-all":"^3.0.0",nyc:"6.4.0",proxyquire:"^1.7.9",remark:"4.2.2","remark-html":"3.0.0",sinon:"^1.15.4",st:"^1.2.0",tap:"^5.7.0","transform-loader":"^0.2.3","unist-util-visit":"1.1.0",vinyl:"1.1.1","vinyl-fs":"2.4.3",watchify:"^3.7.0",webpack:"^1.13.1","webworkify-webpack":"^1.1.3"},directories:{},dist:{shasum:"92a965547d4c2f24c22cbc487eeda48694cb627a",tarball:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz"},engines:{node:">=4.0.0"},gitHead:"13a9015341f0602ccb55c98c53079838ad4b70b5",homepage:"https://github.com/mapbox/mapbox-gl-js#readme",license:"BSD-3-Clause",main:"js/mapbox-gl.js",maintainers:[{name:"aaronlidman",email:"aaronlidman@gmail.com"},{name:"ajashton",email:"aj.ashton@gmail.com"},{name:"ansis",email:"ansis.brammanis@gmail.com"},{name:"bergwerkgis",email:"wb@bergwerk-gis.at"},{name:"bhousel",email:"bryan@mapbox.com"},{name:"bsudekum",email:"bobby@mapbox.com"},{name:"camilleanne",email:"camille@mapbox.com"},{name:"dnomadb",email:"damon@mapbox.com"},{name:"dthompson",email:"dthompson@gmail.com"},{name:"emilymcafee",email:"emily@mapbox.com"},{name:"flippmoke",email:"flippmoke@gmail.com"},{name:"freenerd",email:"spam@freenerd.de"},{name:"gretacb",email:"carol@mapbox.com"},{name:"ian29",email:"ian.villeda@gmail.com"},{name:"ianshward",email:"ian@mapbox.com"},{name:"ingalls",email:"nicholas.ingalls@gmail.com"},{name:"jfirebaugh",email:"john.firebaugh@gmail.com"},{name:"jrpruit1",email:"jake@jakepruitt.com"},{name:"karenzshea",email:"karen@mapbox.com"},{name:"kkaefer",email:"kkaefer@gmail.com"},{name:"lbud",email:"lauren@mapbox.com"},{name:"lucaswoj",email:"lucas@lucaswoj.com"},{name:"lxbarth",email:"alex@mapbox.com"},{name:"lyzidiamond",email:"lyzi@mapbox.com"},{name:"mapbox-admin",email:"accounts@mapbox.com"},{name:"mateov",email:"matt@mapbox.com"},{name:"mcwhittemore",email:"mcwhittemore@gmail.com"},{name:"miccolis",email:"jeff@miccolis.net"},{name:"mikemorris",email:"michael.patrick.morris@gmail.com"},{name:"morganherlocker",email:"morgan.herlocker@gmail.com"},{name:"mourner",email:"agafonkin@gmail.com"},{name:"nickidlugash",email:"nicki@mapbox.com"},{name:"rclark",email:"ryan.clark.j@gmail.com"},{name:"samanbb",email:"saman@mapbox.com"},{name:"sbma44",email:"tlee@mapbox.com"},{name:"scothis",email:"scothis@gmail.com"},{name:"sgillies",email:"sean@mapbox.com"},{name:"springmeyer",email:"dane@mapbox.com"},{name:"themarex",email:"patrick@mapbox.com"},{name:"tmcw",email:"tom@macwright.org"},{name:"tristen",email:"tristen.brown@gmail.com"},{name:"willwhite",email:"will@mapbox.com"},{name:"yhahn",email:"young@mapbox.com"}],name:"mapbox-gl",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/mapbox/mapbox-gl-js.git"},scripts:{build:"npm run build-docs # invoked by publisher when publishing docs on the mb-pages branch","build-dev":"browserify js/mapbox-gl.js --debug --standalone mapboxgl > dist/mapbox-gl-dev.js && tap --no-coverage test/build/dev.test.js","build-docs":"documentation build --github --format html -c documentation.yml --theme ./docs/_theme --output docs/api/","build-min":"browserify js/mapbox-gl.js --debug -t unassertify --plugin [minifyify --map mapbox-gl.js.map --output dist/mapbox-gl.js.map] --standalone mapboxgl > dist/mapbox-gl.js && tap --no-coverage test/build/min.test.js","build-token":"browserify debug/access-token-src.js --debug -t envify > debug/access-token.js",lint:"eslint  --ignore-path .gitignore js test bench docs/_posts/examples/*.html","open-changed-examples":"git diff --name-only mb-pages HEAD -- docs/_posts/examples/*.html | awk '{print \"http://127.0.0.1:4000/mapbox-gl-js/example/\" substr($0,33,length($0)-37)}' | xargs open",start:"run-p build-token watch-dev watch-bench start-server","start-bench":"run-p build-token watch-bench start-server","start-debug":"run-p build-token watch-dev start-server","start-docs":"npm run build-min && npm run build-docs && jekyll serve -w","start-server":"st --no-cache --localhost --port 9966 --index index.html .",test:"npm run lint && tap --reporter dot test/js/*/*.js test/build/webpack.test.js","test-suite":"node test/render.test.js && node test/query.test.js","watch-bench":"node bench/download-data.js && watchify bench/index.js --plugin [minifyify --no-map] -t [babelify --presets react] -t unassertify -t envify -o bench/bench.js -v","watch-dev":"watchify js/mapbox-gl.js --debug --standalone mapboxgl -o dist/mapbox-gl-dev.js -v"},version:"0.22.1"}},{}],411:[function(t,e,r){"use strict";function n(t,e,r){for(var n=new Array(t),i=0;i<t;++i)n[i]=0,i===e&&(n[i]+=.5),i===r&&(n[i]+=.5);return n}function i(t,e){if(0===e||e===(1<<t+1)-1)return[];for(var r=[],i=[],a=0;a<=t;++a)if(e&1<<a){r.push(n(t,a-1,a-1)),i.push(null);for(var s=0;s<=t;++s)~e&1<<s&&(r.push(n(t,a-1,s-1)),i.push([a,s]))}var l=o(r),u=[];t:for(var a=0;a<l.length;++a){for(var c=l[a],h=[],s=0;s<c.length;++s){if(!i[c[s]])continue t;h.push(i[c[s]].slice())}u.push(h)}return u}function a(t){for(var e=1<<t+1,r=new Array(e),n=0;n<e;++n)r[n]=i(t,n);return r}e.exports=a;var o=t("convex-hull")},{"convex-hull":86}],412:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}function i(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}function a(t,e,r,n,i){t[0]=e[0]*n+r[0]*i,t[1]=e[1]*n+r[1]*i,t[2]=e[2]*n+r[2]*i}var o=t("./normalize"),s=t("gl-mat4/create"),l=t("gl-mat4/clone"),u=t("gl-mat4/determinant"),c=t("gl-mat4/invert"),h=t("gl-mat4/transpose"),f={length:t("gl-vec3/length"),normalize:t("gl-vec3/normalize"),dot:t("gl-vec3/dot"),cross:t("gl-vec3/cross")},d=s(),p=s(),m=[0,0,0,0],g=[[0,0,0],[0,0,0],[0,0,0]],v=[0,0,0];e.exports=function(t,e,r,s,y,x){if(e||(e=[0,0,0]),r||(r=[0,0,0]),s||(s=[0,0,0]),y||(y=[0,0,0,1]),x||(x=[0,0,0,1]),!o(d,t))return!1;if(l(p,d),p[3]=0,p[7]=0,p[11]=0,p[15]=1,Math.abs(u(p)<1e-8))return!1;var b=d[3],_=d[7],w=d[11],M=d[12],A=d[13],k=d[14],T=d[15];if(0!==b||0!==_||0!==w){m[0]=b,m[1]=_,m[2]=w,m[3]=T;var E=c(p,p);if(!E)return!1;h(p,p),n(y,m,p)}else y[0]=y[1]=y[2]=0,y[3]=1;if(e[0]=M,e[1]=A,e[2]=k,i(g,d),r[0]=f.length(g[0]),f.normalize(g[0],g[0]),s[0]=f.dot(g[0],g[1]),a(g[1],g[1],g[0],1,-s[0]),r[1]=f.length(g[1]),f.normalize(g[1],g[1]),s[0]/=r[1],s[1]=f.dot(g[0],g[2]),a(g[2],g[2],g[0],1,-s[1]),s[2]=f.dot(g[1],g[2]),a(g[2],g[2],g[1],1,-s[2]),r[2]=f.length(g[2]),f.normalize(g[2],g[2]),s[1]/=r[2],s[2]/=r[2],f.cross(v,g[1],g[2]),f.dot(g[0],v)<0)for(var S=0;S<3;S++)r[S]*=-1,g[S][0]*=-1,g[S][1]*=-1,g[S][2]*=-1;return x[0]=.5*Math.sqrt(Math.max(1+g[0][0]-g[1][1]-g[2][2],0)),x[1]=.5*Math.sqrt(Math.max(1-g[0][0]+g[1][1]-g[2][2],0)),x[2]=.5*Math.sqrt(Math.max(1-g[0][0]-g[1][1]+g[2][2],0)),x[3]=.5*Math.sqrt(Math.max(1+g[0][0]+g[1][1]+g[2][2],0)),g[2][1]>g[1][2]&&(x[0]=-x[0]),g[0][2]>g[2][0]&&(x[1]=-x[1]),g[1][0]>g[0][1]&&(x[2]=-x[2]),!0}},{"./normalize":413,"gl-mat4/clone":148,"gl-mat4/create":149,"gl-mat4/determinant":150,"gl-mat4/invert":154,"gl-mat4/transpose":164,"gl-vec3/cross":242,"gl-vec3/dot":243,"gl-vec3/length":244,"gl-vec3/normalize":246}],413:[function(t,e,r){e.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)t[i]=e[i]*n;return!0}},{}],414:[function(t,e,r){function n(t,e,r,n){if(0===c(e)||0===c(r))return!1;var i=u(e,f.translate,f.scale,f.skew,f.perspective,f.quaternion),a=u(r,d.translate,d.scale,d.skew,d.perspective,d.quaternion);return!(!i||!a)&&(s(p.translate,f.translate,d.translate,n),s(p.skew,f.skew,d.skew,n),s(p.scale,f.scale,d.scale,n),s(p.perspective,f.perspective,d.perspective,n),h(p.quaternion,f.quaternion,d.quaternion,n),l(t,p.translate,p.scale,p.skew,p.perspective,p.quaternion),!0)}function i(){return{translate:a(),scale:a(1),skew:a(),perspective:o(),quaternion:o()}}function a(t){return[t||0,t||0,t||0]}function o(){return[0,0,0,1]}var s=t("gl-vec3/lerp"),l=t("mat4-recompose"),u=t("mat4-decompose"),c=t("gl-mat4/determinant"),h=t("quat-slerp"),f=i(),d=i(),p=i();e.exports=n},{"gl-mat4/determinant":150,"gl-vec3/lerp":245,"mat4-decompose":412,"mat4-recompose":415,"quat-slerp":453}],415:[function(t,e,r){var n={identity:t("gl-mat4/identity"),translate:t("gl-mat4/translate"),multiply:t("gl-mat4/multiply"),create:t("gl-mat4/create"),scale:t("gl-mat4/scale"),fromRotationTranslation:t("gl-mat4/fromRotationTranslation")},i=(n.create(),n.create());e.exports=function(t,e,r,a,o,s){return n.identity(t),n.fromRotationTranslation(t,s,e),t[3]=o[0],t[7]=o[1],t[11]=o[2],t[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(t,t,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(t,t,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(t,t,i)),n.scale(t,t,r),t}},{"gl-mat4/create":149,"gl-mat4/fromRotationTranslation":152,"gl-mat4/identity":153,"gl-mat4/multiply":156,"gl-mat4/scale":162,"gl-mat4/translate":163}],416:[function(t,e,r){"use strict";function n(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-(1/0),1/0]}function i(t){t=t||{};var e=t.matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return new n(e)}var a=t("binary-search-bounds"),o=t("mat4-interpolate"),s=t("gl-mat4/invert"),l=t("gl-mat4/rotateX"),u=t("gl-mat4/rotateY"),c=t("gl-mat4/rotateZ"),h=t("gl-mat4/lookAt"),f=t("gl-mat4/translate"),d=(t("gl-mat4/scale"),t("gl-vec3/normalize")),p=[0,0,0];e.exports=i;var m=n.prototype;m.recalcMatrix=function(t){var e=this._time,r=a.le(e,t),n=this.computedMatrix;if(!(r<0)){var i=this._components;if(r===e.length-1)for(var l=16*r,u=0;u<16;++u)n[u]=i[l++];else{for(var c=e[r+1]-e[r],l=16*r,h=this.prevMatrix,f=!0,u=0;u<16;++u)h[u]=i[l++];for(var p=this.nextMatrix,u=0;u<16;++u)p[u]=i[l++],f=f&&h[u]===p[u];if(c<1e-6||f)for(var u=0;u<16;++u)n[u]=h[u];else o(n,h,p,(t-e[r])/c)}var m=this.computedUp;m[0]=n[1],m[1]=n[5],m[2]=n[6],d(m,m);var g=this.computedInverse;s(g,n);var v=this.computedEye,y=g[15];v[0]=g[12]/y,v[1]=g[13]/y,v[2]=g[14]/y;for(var x=this.computedCenter,b=Math.exp(this.computedRadius[0]),u=0;u<3;++u)x[u]=v[u]-n[2+4*u]*b}},m.idle=function(t){if(!(t<this.lastT())){for(var e=this._components,r=e.length-16,n=0;n<16;++n)e.push(e[r++]);this._time.push(t)}},m.flush=function(t){var e=a.gt(this._time,t)-2;e<0||(this._time.slice(0,e),this._components.slice(0,16*e))},m.lastT=function(){return this._time[this._time.length-1]},m.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||p,n=n||this.computedUp,this.setMatrix(t,h(this.computedMatrix,e,r,n));for(var i=0,a=0;a<3;++a)i+=Math.pow(r[a]-e[a],2);i=Math.log(Math.sqrt(i)),this.computedRadius[0]=i},m.rotate=function(t,e,r,n){this.recalcMatrix(t);var i=this.computedInverse;e&&u(i,i,e),r&&l(i,i,r),n&&c(i,i,n),this.setMatrix(t,s(this.computedMatrix,i))};var g=[0,0,0];m.pan=function(t,e,r,n){g[0]=-(e||0),g[1]=-(r||0),g[2]=-(n||0),this.recalcMatrix(t);var i=this.computedInverse;f(i,i,g),this.setMatrix(t,s(i,i))},m.translate=function(t,e,r,n){g[0]=e||0,g[1]=r||0,g[2]=n||0,this.recalcMatrix(t);var i=this.computedMatrix;f(i,i,g),this.setMatrix(t,i)},m.setMatrix=function(t,e){if(!(t<this.lastT())){this._time.push(t);for(var r=0;r<16;++r)this._components.push(e[r])}},m.setDistance=function(t,e){this.computedRadius[0]=e},m.setDistanceLimits=function(t,e){var r=this._limits;r[0]=t,r[1]=e},m.getDistanceLimits=function(t){var e=this._limits;return t?(t[0]=e[0],t[1]=e[1],t):e}},{"binary-search-bounds":55,"gl-mat4/invert":154,"gl-mat4/lookAt":155,"gl-mat4/rotateX":159,"gl-mat4/rotateY":160,"gl-mat4/rotateZ":161,"gl-mat4/scale":162,"gl-mat4/translate":163,"gl-vec3/normalize":246,"mat4-interpolate":414}],417:[function(t,e,r){"use strict";function n(t){var e=t.length;if(e<3){for(var r=new Array(e),n=0;n<e;++n)r[n]=n;return 2===e&&t[0][0]===t[1][0]&&t[0][1]===t[1][1]?[0]:r}for(var a=new Array(e),n=0;n<e;++n)a[n]=n;a.sort(function(e,r){var n=t[e][0]-t[r][0];return n?n:t[e][1]-t[r][1]});for(var o=[a[0],a[1]],s=[a[0],a[1]],n=2;n<e;++n){for(var l=a[n],u=t[l],c=o.length;c>1&&i(t[o[c-2]],t[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(l),c=s.length;c>1&&i(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(l)}for(var r=new Array(s.length+o.length-2),h=0,n=0,f=o.length;n<f;++n)r[h++]=o[n];for(var d=s.length-2;d>0;--d)r[h++]=s[d];return r}e.exports=n;var i=t("robust-orientation")[3]},{"robust-orientation":471}],418:[function(t,e,r){"use strict";function n(t,e){function r(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==g.alt,g.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==g.shift,g.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==g.control,g.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==g.meta,g.meta=!!t.metaKey),e}function n(t,n){var a=i.x(n),o=i.y(n);"buttons"in n&&(t=0|n.buttons),(t!==d||a!==p||o!==m||r(n))&&(d=0|t,p=a||0,m=o||0,e&&e(d,p,m,g))}function a(t){n(0,t)}function o(){(d||p||m||g.shift||g.alt||g.meta||g.control)&&(p=m=0,d=0,g.shift=g.alt=g.control=g.meta=!1,e&&e(0,0,0,g))}function s(t){r(t)&&e&&e(d,p,m,g)}function l(t){0===i.buttons(t)?n(0,t):n(d,t)}function u(t){n(d|i.buttons(t),t)}function c(t){n(d&~i.buttons(t),t)}function h(){v||(v=!0,t.addEventListener("mousemove",l),t.addEventListener("mousedown",u),t.addEventListener("mouseup",c),t.addEventListener("mouseleave",a),t.addEventListener("mouseenter",a),t.addEventListener("mouseout",a),t.addEventListener("mouseover",a),t.addEventListener("blur",o),t.addEventListener("keyup",s),t.addEventListener("keydown",s),t.addEventListener("keypress",s),t!==window&&(window.addEventListener("blur",o),window.addEventListener("keyup",s),window.addEventListener("keydown",s),window.addEventListener("keypress",s)))}function f(){v&&(v=!1,t.removeEventListener("mousemove",l),t.removeEventListener("mousedown",u),t.removeEventListener("mouseup",c),t.removeEventListener("mouseleave",a),t.removeEventListener("mouseenter",a),t.removeEventListener("mouseout",a),t.removeEventListener("mouseover",a),t.removeEventListener("blur",o),t.removeEventListener("keyup",s),t.removeEventListener("keydown",s),t.removeEventListener("keypress",s),t!==window&&(window.removeEventListener("blur",o),window.removeEventListener("keyup",s),window.removeEventListener("keydown",s),window.removeEventListener("keypress",s)))}e||(e=t,t=window);var d=0,p=0,m=0,g={shift:!1,alt:!1,control:!1,meta:!1},v=!1;h();var y={element:t};return Object.defineProperties(y,{enabled:{get:function(){return v},set:function(t){t?h():f()},enumerable:!0},buttons:{get:function(){return d},enumerable:!0},x:{get:function(){return p},enumerable:!0},y:{get:function(){return m},enumerable:!0},mods:{get:function(){return g},enumerable:!0}}),y}e.exports=n;var i=t("mouse-event")},{"mouse-event":419}],419:[function(t,e,r){"use strict";function n(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){var e=t.which;if(2===e)return 4;if(3===e)return 2;if(e>0)return 1<<e-1}else if("button"in t){var e=t.button;if(1===e)return 4;if(2===e)return 2;if(e>=0)return 1<<e}}return 0}function i(t){return t.target||t.srcElement||window}function a(t){if("object"==typeof t){if("offsetX"in t)return t.offsetX;var e=i(t),r=e.getBoundingClientRect();return t.clientX-r.left}return 0}function o(t){if("object"==typeof t){if("offsetY"in t)return t.offsetY;var e=i(t),r=e.getBoundingClientRect();return t.clientY-r.top}return 0}r.buttons=n,r.element=i,r.x=a,r.y=o},{}],420:[function(t,e,r){"use strict";function n(t,e,r){"function"==typeof t&&(r=!!e,e=t,t=window);var n=i("ex",t),a=function(t){r&&t.preventDefault();var i=t.deltaX||0,a=t.deltaY||0,o=t.deltaZ||0,s=t.deltaMode,l=1;switch(s){case 1:l=n;break;case 2:l=window.innerHeight}if(i*=l,a*=l,o*=l,i||a||o)return e(i,a,o,t)};return t.addEventListener("wheel",a),a}var i=t("to-px");e.exports=n},{"to-px":496}],421:[function(t,e,r){"use strict";function n(t){return"a"+t}function i(t){return"d"+t}function a(t,e){return"c"+t+"_"+e}function o(t){return"s"+t}function s(t,e){return"t"+t+"_"+e}function l(t){return"o"+t}function u(t){return"x"+t}function c(t){return"p"+t}function h(t,e){return"d"+t+"_"+e}function f(t){return"i"+t}function d(t,e){return"u"+t+"_"+e}function p(t){return"b"+t}function m(t){return"y"+t}function g(t){return"e"+t}function v(t){return"v"+t}function y(t,e,r){for(var n=0,i=0;i<t;++i)e&1<<i&&(n|=1<<r[i]);return n}function x(t,e,r,x,b,S){function L(t,e){j.push("for(",f(b[t]),"=",e,";",f(b[t]),"<",o(b[t]),";","++",f(b[t]),"){")}function C(t){for(var e=0;e<O;++e)j.push(c(e),"+=",d(e,b[t]),";");j.push("}")}function I(t){for(var e=t-1;e>=0;--e)L(e,0);for(var r=[],e=0;e<O;++e)S[e]?r.push(i(e)+".get("+c(e)+")"):r.push(i(e)+"["+c(e)+"]");for(var e=0;e<x;++e)r.push(u(e));j.push(M,"[",T,"++]=phase(",r.join(),");");for(var e=0;e<t;++e)C(e);for(var n=0;n<O;++n)j.push(c(n),"+=",d(n,b[t]),";")}function z(t){for(var e=0;e<O;++e)S[e]?j.push(a(e,0),"=",i(e),".get(",c(e),");"):j.push(a(e,0),"=",i(e),"[",c(e),"];");for(var r=[],e=0;e<O;++e)r.push(a(e,0));for(var e=0;e<x;++e)r.push(u(e));j.push(p(0),"=",M,"[",T,"]=phase(",r.join(),");");for(var n=1;n<1<<R;++n)j.push(p(n),"=",M,"[",T,"+",g(n),"];");for(var o=[],n=1;n<1<<R;++n)o.push("("+p(0)+"!=="+p(n)+")");j.push("if(",o.join("||"),"){");for(var s=[],e=0;e<R;++e)s.push(f(e));for(var e=0;e<O;++e){s.push(a(e,0));for(var n=1;n<1<<R;++n)S[e]?j.push(a(e,n),"=",i(e),".get(",c(e),"+",h(e,n),");"):j.push(a(e,n),"=",i(e),"[",c(e),"+",h(e,n),"];"),s.push(a(e,n))}for(var e=0;e<1<<R;++e)s.push(p(e));for(var e=0;e<x;++e)s.push(u(e));j.push("vertex(",s.join(),");",v(0),"=",w,"[",T,"]=",A,"++;");for(var l=(1<<R)-1,d=p(l),n=0;n<R;++n)if(0===(t&~(1<<n))){for(var m=l^1<<n,y=p(m),b=[],_=m;_>0;_=_-1&m)b.push(w+"["+T+"+"+g(_)+"]");b.push(v(0));for(var _=0;_<O;++_)1&n?b.push(a(_,l),a(_,m)):b.push(a(_,m),a(_,l));1&n?b.push(d,y):b.push(y,d);for(var _=0;_<x;++_)b.push(u(_));j.push("if(",d,"!==",y,"){","face(",b.join(),")}")}j.push("}",T,"+=1;")}function D(){for(var t=1;t<1<<R;++t)j.push(E,"=",g(t),";",g(t),"=",m(t),";",m(t),"=",E,";")}function P(t,e){if(t<0)return void z(e);I(t),j.push("if(",o(b[t]),">0){",f(b[t]),"=1;"),P(t-1,e|1<<b[t]);for(var r=0;r<O;++r)j.push(c(r),"+=",d(r,b[t]),";");t===R-1&&(j.push(T,"=0;"),D()),L(t,2),P(t-1,e),t===R-1&&(j.push("if(",f(b[R-1]),"&1){",T,"=0;}"),D()),C(t),j.push("}")}var O=S.length,R=b.length;if(R<2)throw new Error("ndarray-extract-contour: Dimension must be at least 2");for(var F="extractContour"+b.join("_"),j=[],N=[],B=[],U=0;U<O;++U)B.push(n(U));for(var U=0;U<x;++U)B.push(u(U));for(var U=0;U<R;++U)N.push(o(U)+"="+n(0)+".shape["+U+"]|0");for(var U=0;U<O;++U){N.push(i(U)+"="+n(U)+".data",l(U)+"="+n(U)+".offset|0");for(var V=0;V<R;++V)N.push(s(U,V)+"="+n(U)+".stride["+V+"]|0")}for(var U=0;U<O;++U){N.push(c(U)+"="+l(U)),N.push(a(U,0));for(var V=1;V<1<<R;++V){for(var q=[],H=0;H<R;++H)V&1<<H&&q.push("-"+s(U,H));N.push(h(U,V)+"=("+q.join("")+")|0"),N.push(a(U,V)+"=0")}}for(var U=0;U<O;++U)for(var V=0;V<R;++V){var Y=[s(U,b[V])];V>0&&Y.push(s(U,b[V-1])+"*"+o(b[V-1])),N.push(d(U,b[V])+"=("+Y.join("-")+")|0")}for(var U=0;U<R;++U)N.push(f(U)+"=0");N.push(A+"=0");for(var G=["2"],U=R-2;U>=0;--U)G.push(o(b[U]));N.push(k+"=("+G.join("*")+")|0",M+"=mallocUint32("+k+")",w+"=mallocUint32("+k+")",T+"=0"),N.push(p(0)+"=0");for(var V=1;V<1<<R;++V){for(var X=[],W=[],H=0;H<R;++H)V&1<<H&&(0===W.length?X.push("1"):X.unshift(W.join("*"))),W.push(o(b[H]));var Z="";X[0].indexOf(o(b[R-2]))<0&&(Z="-");var J=y(R,V,b);N.push(g(J)+"=(-"+X.join("-")+")|0",m(J)+"=("+Z+X.join("-")+")|0",p(J)+"=0")}N.push(v(0)+"=0",E+"=0"),P(R-1,0),j.push("freeUint32(",w,");freeUint32(",M,");");var K=["'use strict';","function ",F,"(",B.join(),"){","var ",N.join(),";",j.join(""),"}","return ",F].join(""),Q=new Function("vertex","face","phase","mallocUint32","freeUint32",K);return Q(t,e,r,_.mallocUint32,_.freeUint32)}function b(t){function e(t){throw new Error("ndarray-extract-contour: "+t)}"object"!=typeof t&&e("Must specify arguments");var r=t.order;Array.isArray(r)||e("Must specify order");var n=t.arrayArguments||1;n<1&&e("Must have at least one array argument");var i=t.scalarArguments||0;i<0&&e("Scalar arg count must be > 0"),"function"!=typeof t.vertex&&e("Must specify vertex creation function"),"function"!=typeof t.cell&&e("Must specify cell creation function"),"function"!=typeof t.phase&&e("Must specify phase function");for(var a=t.getters||[],o=new Array(n),s=0;s<n;++s)a.indexOf(s)>=0?o[s]=!0:o[s]=!1;return x(t.vertex,t.cell,t.phase,i,r,o)}var _=t("typedarray-pool");e.exports=b;var w="V",M="P",A="N",k="Q",T="X",E="T"},{"typedarray-pool":502}],422:[function(t,e,r){"use strict";var n=t("cwise/lib/wrapper")({args:["index","array","scalar"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{_inline_1_arg1_=_inline_1_arg2_.apply(void 0,_inline_1_arg0_)}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"cwise",blockSize:64});e.exports=function(t,e){return n(t,e),t}},{"cwise/lib/wrapper":96}],423:[function(t,e,r){"use strict";function n(t){if(t in l)return l[t];for(var e=[],r=0;r<t;++r)e.push("out",r,"s=0.5*(inp",r,"l-inp",r,"r);");for(var n=["array"],i=["junk"],r=0;r<t;++r){n.push("array"),i.push("out"+r+"s");var a=o(t);a[r]=-1,n.push({array:0,offset:a.slice()}),a[r]=1,n.push({array:0,offset:a.slice()}),i.push("inp"+r+"l","inp"+r+"r")}return l[t]=s({args:n,pre:c,post:c,body:{body:e.join(""),args:i.map(function(t){return{name:t,lvalue:0===t.indexOf("out"),rvalue:0===t.indexOf("inp"),count:"junk"!==t|0}}),thisVars:[],localVars:[]},funcName:"fdTemplate"+t})}function i(t){function e(e){for(var r=a-e.length,n=[],i=[],s=[],l=0;l<a;++l)e.indexOf(l+1)>=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),n.push("1"),i.push("s["+l+"]-2"));var u=".lo("+n.join()+").hi("+i.join()+")";if(0===n.length&&(u=""),r>0){o.push("if(1");for(var l=0;l<a;++l)e.indexOf(l+1)>=0||e.indexOf(-(l+1))>=0||o.push("&&s[",l,"]>2");o.push("){grad",r,"(src.pick(",s.join(),")",u);for(var l=0;l<a;++l)e.indexOf(l+1)>=0||e.indexOf(-(l+1))>=0||o.push(",dst.pick(",s.join(),",",l,")",u);o.push(");")}for(var l=0;l<e.length;++l){var c=Math.abs(e[l])-1,h="dst.pick("+s.join()+","+c+")"+u;switch(t[c]){case"clamp":var f=s.slice(),d=s.slice();e[l]<0?f[c]="s["+c+"]-2":d[c]="1",0===r?o.push("if(s[",c,"]>1){dst.set(",s.join(),",",c,",0.5*(src.get(",f.join(),")-src.get(",d.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):o.push("if(s[",c,"]>1){diff(",h,",src.pick(",f.join(),")",u,",src.pick(",d.join(),")",u,");}else{zero(",h,");};");break;case"mirror":0===r?o.push("dst.set(",s.join(),",",c,",0);"):o.push("zero(",h,");");break;case"wrap":var p=s.slice(),m=s.slice();e[l]<0?(p[c]="s["+c+"]-2",m[c]="0"):(p[c]="s["+c+"]-1",m[c]="1"),0===r?o.push("if(s[",c,"]>2){dst.set(",s.join(),",",c,",0.5*(src.get(",p.join(),")-src.get(",m.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):o.push("if(s[",c,"]>2){diff(",h,",src.pick(",p.join(),")",u,",src.pick(",m.join(),")",u,");}else{zero(",h,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}r>0&&o.push("};")}var r=t.join(),i=u[r];if(i)return i;for(var a=t.length,o=["function gradient(dst,src){var s=src.shape.slice();"],s=0;s<1<<a;++s){for(var c=[],d=0;d<a;++d)s&1<<d&&c.push(d+1);for(var p=0;p<1<<c.length;++p){for(var m=c.slice(),d=0;d<c.length;++d)p&1<<d&&(m[d]=-m[d]);e(m)}}o.push("return dst;};return gradient");for(var g=["diff","zero"],v=[h,f],s=1;s<=a;++s)g.push("grad"+s),v.push(n(s));g.push(o.join(""));var y=Function.apply(void 0,g),i=y.apply(void 0,v);return l[r]=i,i}function a(t,e,r){if(Array.isArray(r)){if(r.length!==e.dimension)throw new Error("ndarray-gradient: invalid boundary conditions")}else r="string"==typeof r?o(e.dimension,r):o(e.dimension,"clamp");if(t.dimension!==e.dimension+1)throw new Error("ndarray-gradient: output dimension must be +1 input dimension");if(t.shape[e.dimension]!==e.dimension)throw new Error("ndarray-gradient: output shape must match input shape");for(var n=0;n<e.dimension;++n)if(t.shape[n]!==e.shape[n])throw new Error("ndarray-gradient: shape mismatch");if(0===e.size)return t;if(e.dimension<=0)return t.set(0),t;var a=i(r);return a(t,e)}e.exports=a;var o=t("dup"),s=t("cwise-compiler"),l={},u={},c={body:"",args:[],thisVars:[],localVars:[]},h=s({args:["array","array","array"],pre:c,post:c,body:{args:[{name:"out",lvalue:!0,rvalue:!1,count:1},{name:"left",lvalue:!1,rvalue:!0,count:1},{name:"right",lvalue:!1,rvalue:!0,count:1}],body:"out=0.5*(left-right)",thisVars:[],localVars:[]},funcName:"cdiff"}),f=s({args:["array"],pre:c,post:c,body:{args:[{name:"out",lvalue:!0,rvalue:!1,count:1}],body:"out=0",thisVars:[],localVars:[]},funcName:"zero"})},{"cwise-compiler":93,dup:100}],424:[function(t,e,r){"use strict";function n(t,e,r){var n=e.dimension,o=a([],r);return i(t,e,function(t,e){for(var r=0;r<n;++r){t[r]=o[(n+1)*n+r];for(var i=0;i<n;++i)t[r]+=o[(n+1)*i+r]*e[i]}for(var a=o[(n+1)*(n+1)-1],i=0;i<n;++i)a+=o[(n+1)*i+n]*e[i];for(var s=1/a,r=0;r<n;++r)t[r]*=s;return t}),t}var i=t("ndarray-warp"),a=t("gl-matrix-invert");e.exports=n},{"gl-matrix-invert":165,"ndarray-warp":431}],425:[function(t,e,r){"use strict";function n(t,e){var r=Math.floor(e),n=e-r,i=0<=r&&r<t.shape[0],a=0<=r+1&&r+1<t.shape[0],o=i?+t.get(r):0,s=a?+t.get(r+1):0;return(1-n)*o+n*s}function i(t,e,r){var n=Math.floor(e),i=e-n,a=0<=n&&n<t.shape[0],o=0<=n+1&&n+1<t.shape[0],s=Math.floor(r),l=r-s,u=0<=s&&s<t.shape[1],c=0<=s+1&&s+1<t.shape[1],h=a&&u?t.get(n,s):0,f=a&&c?t.get(n,s+1):0,d=o&&u?t.get(n+1,s):0,p=o&&c?t.get(n+1,s+1):0;return(1-l)*((1-i)*h+i*d)+l*((1-i)*f+i*p)}function a(t,e,r,n){var i=Math.floor(e),a=e-i,o=0<=i&&i<t.shape[0],s=0<=i+1&&i+1<t.shape[0],l=Math.floor(r),u=r-l,c=0<=l&&l<t.shape[1],h=0<=l+1&&l+1<t.shape[1],f=Math.floor(n),d=n-f,p=0<=f&&f<t.shape[2],m=0<=f+1&&f+1<t.shape[2],g=o&&c&&p?t.get(i,l,f):0,v=o&&h&&p?t.get(i,l+1,f):0,y=s&&c&&p?t.get(i+1,l,f):0,x=s&&h&&p?t.get(i+1,l+1,f):0,b=o&&c&&m?t.get(i,l,f+1):0,_=o&&h&&m?t.get(i,l+1,f+1):0,w=s&&c&&m?t.get(i+1,l,f+1):0,M=s&&h&&m?t.get(i+1,l+1,f+1):0;return(1-d)*((1-u)*((1-a)*g+a*y)+u*((1-a)*v+a*x))+d*((1-u)*((1-a)*b+a*w)+u*((1-a)*_+a*M))}function o(t){var e,r,n=0|t.shape.length,i=new Array(n),a=new Array(n),o=new Array(n),s=new Array(n);for(e=0;e<n;++e)r=+arguments[e+1],i[e]=Math.floor(r),a[e]=r-i[e],o[e]=0<=i[e]&&i[e]<t.shape[e],s[e]=0<=i[e]+1&&i[e]+1<t.shape[e];var l,u,c,h=0;t:for(e=0;e<1<<n;++e){for(u=1,c=t.offset,l=0;l<n;++l)if(e&1<<l){if(!s[l])continue t;u*=a[l],c+=t.stride[l]*(i[l]+1)}else{if(!o[l])continue t;u*=1-a[l],c+=t.stride[l]*i[l]}h+=u*t.data[c]}return h}function s(t,e,r,s){switch(t.shape.length){case 0:return 0;case 1:return n(t,e);case 2:return i(t,e,r);case 3:return a(t,e,r,s);default:return o.apply(void 0,arguments)}}e.exports=s,e.exports.d1=n,e.exports.d2=i,e.exports.d3=a},{}],426:[function(t,e,r){"use strict";function n(t){if(!t)return s;for(var e=0;e<t.args.length;++e){var r=t.args[e];0===e?t.args[e]={name:r,lvalue:!0,rvalue:!!t.rvalue,count:t.count||1}:t.args[e]={name:r,lvalue:!1,rvalue:!0,count:1}}return t.thisVars||(t.thisVars=[]),t.localVars||(t.localVars=[]),t}function i(t){return o({args:t.args,pre:n(t.pre),body:n(t.body),post:n(t.proc),funcName:t.funcName})}function a(t){for(var e=[],r=0;r<t.args.length;++r)e.push("a"+r);var n=new Function("P",["return function ",t.funcName,"_ndarrayops(",e.join(","),") {P(",e.join(","),");return a0}"].join(""));return n(i(t))}var o=t("cwise-compiler"),s={body:"",args:[],thisVars:[],localVars:[]},l={add:"+",sub:"-",mul:"*",div:"/",mod:"%",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"};!function(){for(var t in l){var e=l[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var u={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in u){var e=u[t];r[t]=a({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=a({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in c){var e=c[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var h=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;t<h.length;++t){var e=h[t];r[e]=a({args:["array","array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b)",thisVars:["this_f"]},funcName:e}),r[e+"eq"]=a({args:["array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a"],body:"a=this_f(a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:e+"eq"})}}();var f=["max","min","atan2","pow"];!function(){for(var t=0;t<f.length;++t){var e=f[t];r[e]=a({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:e}),r[e+"s"]=a({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:e+"s"}),r[e+"eq"]=a({args:["array","array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:e+"eq"}),r[e+"seq"]=a({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:e+"seq"})}}();var d=["atan2","pow"];!function(){for(var t=0;t<d.length;++t){var e=d[t];r[e+"op"]=a({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:e+"op"}),r[e+"ops"]=a({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:e+"ops"}),r[e+"opeq"]=a({args:["array","array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:e+"opeq"}),r[e+"opseq"]=a({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:e+"opseq"})}}(),r.any=o({args:["array"],pre:s,body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"if(a){return true}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return false"},funcName:"any"}),r.all=o({args:["array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1}],body:"if(!x){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"all"}),r.sum=o({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s+=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"sum"}),r.prod=o({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=1"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s*=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"prod"}),r.norm2squared=o({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm2squared"}),r.norm2=o({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return Math.sqrt(this_s)"},funcName:"norm2"}),r.norminf=o({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:4}],body:"if(-a>this_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=o({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=o({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=o({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_<this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.argmin=o({args:["index","array","shape"],pre:{body:"{this_v=Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_<this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.argmax=o({args:["index","array","shape"],pre:{body:"{this_v=-Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_>this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=a({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=a({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=a({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=o({args:["array","array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":93}],427:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("./doConvert.js");e.exports=function(t,e){for(var r=[],a=t,o=1;Array.isArray(a);)r.push(a.length),o*=a.length,a=a[0];return 0===r.length?n():(e||(e=n(new Float64Array(o),r)),i(e,t),e)}},{"./doConvert.js":428,ndarray:432}],428:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":93}],429:[function(t,e,r){"use strict";function n(t){switch(t){case"uint8":return[l.mallocUint8,l.freeUint8];case"uint16":return[l.mallocUint16,l.freeUint16];case"uint32":return[l.mallocUint32,l.freeUint32];case"int8":return[l.mallocInt8,l.freeInt8];case"int16":return[l.mallocInt16,l.freeInt16];case"int32":return[l.mallocInt32,l.freeInt32];case"float32":return[l.mallocFloat,l.freeFloat];case"float64":return[l.mallocDouble,l.freeDouble];default:return null}}function i(t){for(var e=[],r=0;r<t;++r)e.push("s"+r);for(var r=0;r<t;++r)e.push("n"+r);for(var r=1;r<t;++r)e.push("d"+r);for(var r=1;r<t;++r)e.push("e"+r);for(var r=1;r<t;++r)e.push("f"+r);return e}function a(t,e){function r(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function a(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}var o=["'use strict'"],s=["ndarrayInsertionSort",t.join("d"),e].join(""),l=["left","right","data","offset"].concat(i(t.length)),u=n(e),c=["i,j,cptr,ptr=left*s0+offset"];if(t.length>1){for(var h=[],f=1;f<t.length;++f)c.push("i"+f),h.push("n"+f);u?c.push("scratch=malloc("+h.join("*")+")"):c.push("scratch=new Array("+h.join("*")+")"),c.push("dptr","sptr","a","b")}else c.push("scratch");if(o.push(["function ",s,"(",l.join(","),"){var ",c.join(",")].join(""),"for(i=left+1;i<=right;++i){","j=i;ptr+=s0","cptr=ptr"),t.length>1){o.push("dptr=0;sptr=ptr");for(var f=t.length-1;f>=0;--f){var d=t[f];0!==d&&o.push(["for(i",d,"=0;i",d,"<n",d,";++i",d,"){"].join(""))}o.push("scratch[dptr++]=",r("sptr"));for(var f=0;f<t.length;++f){var d=t[f];0!==d&&o.push("sptr+=d"+d,"}")}o.push("__g:while(j--\x3eleft){","dptr=0","sptr=cptr-s0");for(var f=1;f<t.length;++f)1===f&&o.push("__l:"),o.push(["for(i",f,"=0;i",f,"<n",f,";++i",f,"){"].join(""));o.push(["a=",r("sptr"),"\nb=scratch[dptr]\nif(a<b){break __g}\nif(a>b){break __l}"].join(""));for(var f=t.length-1;f>=1;--f)o.push("sptr+=e"+f,"dptr+=f"+f,"}");o.push("dptr=cptr;sptr=cptr-s0");for(var f=t.length-1;f>=0;--f){var d=t[f];0!==d&&o.push(["for(i",d,"=0;i",d,"<n",d,";++i",d,"){"].join(""))}o.push(a("dptr",r("sptr")));for(var f=0;f<t.length;++f){var d=t[f];0!==d&&o.push(["dptr+=d",d,";sptr+=d",d].join(""),"}")}o.push("cptr-=s0\n}"),o.push("dptr=cptr;sptr=0");for(var f=t.length-1;f>=0;--f){var d=t[f];0!==d&&o.push(["for(i",d,"=0;i",d,"<n",d,";++i",d,"){"].join(""))}o.push(a("dptr","scratch[sptr++]"));for(var f=0;f<t.length;++f){var d=t[f];0!==d&&o.push("dptr+=d"+d,"}")}}else o.push("scratch="+r("ptr"),"while((j--\x3eleft)&&("+r("cptr-s0")+">scratch)){",a("cptr",r("cptr-s0")),"cptr-=s0","}",a("cptr","scratch"));if(o.push("}"),t.length>1&&u&&o.push("free(scratch)"),o.push("} return "+s),u){var p=new Function("malloc","free",o.join("\n"));return p(u[0],u[1])}var p=new Function(o.join("\n"));return p()}function o(t,e,r){function a(t){return["(offset+",t,"*s0)"].join("")}function o(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function s(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}function l(e,r,n){if(1===e.length)_.push("ptr0="+a(e[0]));else for(var i=0;i<e.length;++i)_.push(["b_ptr",i,"=s0*",e[i]].join(""));r&&_.push("pivot_ptr=0"),_.push("ptr_shift=offset");for(var i=t.length-1;i>=0;--i){var o=t[i];0!==o&&_.push(["for(i",o,"=0;i",o,"<n",o,";++i",o,"){"].join(""))}if(e.length>1)for(var i=0;i<e.length;++i)_.push(["ptr",i,"=b_ptr",i,"+ptr_shift"].join(""));_.push(n),r&&_.push("++pivot_ptr");for(var i=0;i<t.length;++i){var o=t[i];0!==o&&(e.length>1?_.push("ptr_shift+=d"+o):_.push("ptr0+=d"+o),_.push("}"))}}function c(e,r,n,i){if(1===r.length)_.push("ptr0="+a(r[0]));else{for(var o=0;o<r.length;++o)_.push(["b_ptr",o,"=s0*",r[o]].join(""));_.push("ptr_shift=offset")}n&&_.push("pivot_ptr=0"),e&&_.push(e+":");for(var o=1;o<t.length;++o)_.push(["for(i",o,"=0;i",o,"<n",o,";++i",o,"){"].join(""));if(r.length>1)for(var o=0;o<r.length;++o)_.push(["ptr",o,"=b_ptr",o,"+ptr_shift"].join(""));_.push(i);for(var o=t.length-1;o>=1;--o)n&&_.push("pivot_ptr+=f"+o),r.length>1?_.push("ptr_shift+=e"+o):_.push("ptr0+=e"+o),_.push("}")}function h(){t.length>1&&A&&_.push("free(pivot1)","free(pivot2)")}function f(e,r){var n="el"+e,i="el"+r;if(t.length>1){var s="__l"+ ++k;c(s,[n,i],!1,["comp=",o("ptr0"),"-",o("ptr1"),"\n","if(comp>0){tmp0=",n,";",n,"=",i,";",i,"=tmp0;break ",s,"}\n","if(comp<0){break ",s,"}"].join(""))}else _.push(["if(",o(a(n)),">",o(a(i)),"){tmp0=",n,";",n,"=",i,";",i,"=tmp0}"].join(""))}function d(e,r){t.length>1?l([e,r],!1,s("ptr0",o("ptr1"))):_.push(s(a(e),o(a(r))))}function p(e,r,n){if(t.length>1){var i="__l"+ ++k;c(i,[r],!0,[e,"=",o("ptr0"),"-pivot",n,"[pivot_ptr]\n","if(",e,"!==0){break ",i,"}"].join(""))}else _.push([e,"=",o(a(r)),"-pivot",n].join(""))}function m(e,r){t.length>1?l([e,r],!1,["tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1","tmp")].join("")):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1","tmp")].join(""))}function g(e,r,n){t.length>1?(l([e,r,n],!1,["tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1",o("ptr2")),"\n",s("ptr2","tmp")].join("")),_.push("++"+r,"--"+n)):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","ptr2=",a(n),"\n","++",r,"\n","--",n,"\n","tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1",o("ptr2")),"\n",s("ptr2","tmp")].join(""))}function v(t,e){m(t,e),_.push("--"+e)}function y(e,r,n){t.length>1?l([e,r],!0,[s("ptr0",o("ptr1")),"\n",s("ptr1",["pivot",n,"[pivot_ptr]"].join(""))].join("")):_.push(s(a(e),o(a(r))),s(a(r),"pivot"+n))}function x(e,r){_.push(["if((",r,"-",e,")<=",u,"){\n","insertionSort(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}else{\n",w,"(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}"].join(""))}function b(e,r,n){t.length>1?(_.push(["__l",++k,":while(true){"].join("")),l([e],!0,["if(",o("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",k,"}"].join("")),_.push(n,"}")):_.push(["while(",o(a(e)),"===pivot",r,"){",n,"}"].join(""))}var _=["'use strict'"],w=["ndarrayQuickSort",t.join("d"),e].join(""),M=["left","right","data","offset"].concat(i(t.length)),A=n(e),k=0;_.push(["function ",w,"(",M.join(","),"){"].join(""));var T=["sixth=((right-left+1)/6)|0","index1=left+sixth","index5=right-sixth","index3=(left+right)>>1","index2=index3-sixth","index4=index3+sixth","el1=index1","el2=index2","el3=index3","el4=index4","el5=index5","less=left+1","great=right-1","pivots_are_equal=true","tmp","tmp0","x","y","z","k","ptr0","ptr1","ptr2","comp_pivot1=0","comp_pivot2=0","comp=0"];if(t.length>1){for(var E=[],S=1;S<t.length;++S)E.push("n"+S),T.push("i"+S);for(var S=0;S<8;++S)T.push("b_ptr"+S);T.push("ptr3","ptr4","ptr5","ptr6","ptr7","pivot_ptr","ptr_shift","elementSize="+E.join("*")),A?T.push("pivot1=malloc(elementSize)","pivot2=malloc(elementSize)"):T.push("pivot1=new Array(elementSize),pivot2=new Array(elementSize)")}else T.push("pivot1","pivot2");if(_.push("var "+T.join(",")),f(1,2),f(4,5),f(1,3),f(2,3),f(1,4),f(3,4),f(2,5),f(2,3),f(4,5),t.length>1?l(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",o("ptr1"),"\n","pivot2[pivot_ptr]=",o("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",o("ptr0"),"\n","y=",o("ptr2"),"\n","z=",o("ptr4"),"\n",s("ptr5","x"),"\n",s("ptr6","y"),"\n",s("ptr7","z")].join("")):_.push(["pivot1=",o(a("el2")),"\n","pivot2=",o(a("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",o(a("el1")),"\n","y=",o(a("el3")),"\n","z=",o(a("el5")),"\n",s(a("index1"),"x"),"\n",s(a("index3"),"y"),"\n",s(a("index5"),"z")].join("")),d("index2","left"),d("index4","right"),_.push("if(pivots_are_equal){"),_.push("for(k=less;k<=great;++k){"),p("comp","k",1),_.push("if(comp===0){continue}"),_.push("if(comp<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),_.push("while(true){"),p("comp","great",1),_.push("if(comp>0){"),_.push("great--"),_.push("}else if(comp<0){"),g("k","less","great"),_.push("break"),_.push("}else{"),v("k","great"),_.push("break"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}else{"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2>0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp>0){"),_.push("if(--great<k){break}"),_.push("continue"),_.push("}else{"),p("comp","great",1),_.push("if(comp<0){"),g("k","less","great"),_.push("}else{"),v("k","great"),_.push("}"),_.push("break"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),y("left","(less-1)",1),y("right","(great+1)",2),x("left","(less-2)"),x("(great+2)","right"),_.push("if(pivots_are_equal){"),h(),_.push("return"),_.push("}"),_.push("if(less<index1&&great>index5){"),b("less",1,"++less"),b("great",2,"--great"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1===0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2===0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp===0){"),_.push("if(--great<k){break}"),_.push("continue"),_.push("}else{"),p("comp","great",1),_.push("if(comp<0){"),g("k","less","great"),_.push("}else{"),v("k","great"),_.push("}"),_.push("break"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),h(),x("less","great"),_.push("}return "+w),t.length>1&&A){var L=new Function("insertionSort","malloc","free",_.join("\n"));return L(r,A[0],A[1])}var L=new Function("insertionSort",_.join("\n"));return L(r)}function s(t,e){var r=["'use strict'"],n=["ndarraySortWrapper",t.join("d"),e].join(""),s=["array"];r.push(["function ",n,"(",s.join(","),"){"].join(""));for(var l=["data=array.data,offset=array.offset|0,shape=array.shape,stride=array.stride"],c=0;c<t.length;++c)l.push(["s",c,"=stride[",c,"]|0,n",c,"=shape[",c,"]|0"].join(""));for(var h=new Array(t.length),f=[],c=0;c<t.length;++c){var d=t[c];0!==d&&(0===f.length?h[d]="1":h[d]=f.join("*"),f.push("n"+d))}for(var p=-1,m=-1,c=0;c<t.length;++c){var g=t[c];0!==g&&(p>0?l.push(["d",g,"=s",g,"-d",p,"*n",p].join("")):l.push(["d",g,"=s",g].join("")),p=g);var d=t.length-1-c;0!==d&&(m>0?l.push(["e",d,"=s",d,"-e",m,"*n",m,",f",d,"=",h[d],"-f",m,"*n",m].join("")):l.push(["e",d,"=s",d,",f",d,"=",h[d]].join("")),m=d)}r.push("var "+l.join(","));var v=["0","n0-1","data","offset"].concat(i(t.length));r.push(["if(n0<=",u,"){","insertionSort(",v.join(","),")}else{","quickSort(",v.join(","),")}"].join("")),r.push("}return "+n);var y=new Function("insertionSort","quickSort",r.join("\n")),x=a(t,e),b=o(t,e,x);return y(x,b)}var l=t("typedarray-pool"),u=32;e.exports=s},{"typedarray-pool":502}],430:[function(t,e,r){"use strict";function n(t){var e=t.order,r=t.dtype,n=[e,r],o=n.join(":"),s=a[o];return s||(a[o]=s=i(e,r)),s(t),t}var i=t("./lib/compile_sort.js"),a={};e.exports=n},{"./lib/compile_sort.js":429}],431:[function(t,e,r){"use strict";var n=t("ndarray-linear-interpolate"),i=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=new Array(_inline_9_arg4_)}",args:[{name:"_inline_9_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg2_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg3_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_10_arg2_(this_warped,_inline_10_arg0_),_inline_10_arg1_=_inline_10_arg3_.apply(void 0,this_warped)}",args:[{name:"_inline_10_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_10_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg4_",lvalue:!1,rvalue:!1,count:0}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warpND",blockSize:64}),a=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_13_arg2_(this_warped,_inline_13_arg0_),_inline_13_arg1_=_inline_13_arg3_(_inline_13_arg4_,this_warped[0])}",args:[{name:"_inline_13_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_13_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp1D",blockSize:64}),o=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_16_arg2_(this_warped,_inline_16_arg0_),_inline_16_arg1_=_inline_16_arg3_(_inline_16_arg4_,this_warped[0],this_warped[1])}",args:[{name:"_inline_16_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_16_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp2D",blockSize:64}),s=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_19_arg2_(this_warped,_inline_19_arg0_),_inline_19_arg1_=_inline_19_arg3_(_inline_19_arg4_,this_warped[0],this_warped[1],this_warped[2])}",args:[{name:"_inline_19_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_19_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp3D",blockSize:64});e.exports=function(t,e,r){switch(e.shape.length){case 1:a(t,r,n.d1,e);break;case 2:o(t,r,n.d2,e);break;case 3:s(t,r,n.d3,e);break;default:i(t,r,n.bind(void 0,e),e.shape.length)}return t}},{"cwise/lib/wrapper":96,"ndarray-linear-interpolate":425}],432:[function(t,e,r){function n(t,e){return t[0]-e[0]}function i(){var t,e=this.stride,r=new Array(e.length);for(t=0;t<r.length;++t)r[t]=[Math.abs(e[t]),t];r.sort(n);var i=new Array(r.length);for(t=0;t<i.length;++t)i[t]=r[t][1];return i}function a(t,e){var r=["View",e,"d",t].join("");e<0&&(r="View_Nil"+t);var n="generic"===t;if(e===-1){var a="function "+r+"(a){this.data=a;};var proto="+r+".prototype;proto.dtype='"+t+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+r+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+r+"(a){return new "+r+"(a);}",o=new Function(a);return o()}if(0===e){var a="function "+r+"(a,d) {this.data = a;this.offset = d};var proto="+r+".prototype;proto.dtype='"+t+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+r+"_copy() {return new "+r+"(this.data,this.offset)};proto.pick=function "+r+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+r+"_get(){return "+(n?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+r+"_set(v){return "+(n?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+r+"(a,b,c,d){return new "+r+"(a,d)}",o=new Function("TrivialArray",a);return o(h[t][0])}var a=["'use strict'"],s=l(e),u=s.map(function(t){return"i"+t}),c="this.offset+"+s.map(function(t){return"this.stride["+t+"]*i"+t}).join("+"),f=s.map(function(t){return"b"+t}).join(","),d=s.map(function(t){return"c"+t}).join(",");a.push("function "+r+"(a,"+f+","+d+",d){this.data=a","this.shape=["+f+"]","this.stride=["+d+"]","this.offset=d|0}","var proto="+r+".prototype","proto.dtype='"+t+"'","proto.dimension="+e),a.push("Object.defineProperty(proto,'size',{get:function "+r+"_size(){return "+s.map(function(t){return"this.shape["+t+"]"}).join("*"),"}})"),1===e?a.push("proto.order=[0]"):(a.push("Object.defineProperty(proto,'order',{get:"),e<4?(a.push("function "+r+"_order(){"),2===e?a.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&a.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):a.push("ORDER})")),a.push("proto.set=function "+r+"_set("+u.join(",")+",v){"),n?a.push("return this.data.set("+c+",v)}"):a.push("return this.data["+c+"]=v}"),a.push("proto.get=function "+r+"_get("+u.join(",")+"){"),n?a.push("return this.data.get("+c+")}"):a.push("return this.data["+c+"]}"),a.push("proto.index=function "+r+"_index(",u.join(),"){return "+c+"}"),a.push("proto.hi=function "+r+"_hi("+u.join(",")+"){return new "+r+"(this.data,"+s.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+s.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var p=s.map(function(t){return"a"+t+"=this.shape["+t+"]"}),m=s.map(function(t){return"c"+t+"=this.stride["+t+"]"});a.push("proto.lo=function "+r+"_lo("+u.join(",")+"){var b=this.offset,d=0,"+p.join(",")+","+m.join(","));for(var g=0;g<e;++g)a.push("if(typeof i"+g+"==='number'&&i"+g+">=0){d=i"+g+"|0;b+=c"+g+"*d;a"+g+"-=d}");a.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"c"+t}).join(",")+",b)}"),a.push("proto.step=function "+r+"_step("+u.join(",")+"){var "+s.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+s.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var g=0;g<e;++g)a.push("if(typeof i"+g+"==='number'){d=i"+g+"|0;if(d<0){c+=b"+g+"*(a"+g+"-1);a"+g+"=ceil(-a"+g+"/d)}else{a"+g+"=ceil(a"+g+"/d)}b"+g+"*=d}");a.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"b"+t}).join(",")+",c)}");for(var v=new Array(e),y=new Array(e),g=0;g<e;++g)v[g]="a[i"+g+"]",y[g]="b[i"+g+"]";a.push("proto.transpose=function "+r+"_transpose("+u+"){"+u.map(function(t,e){return t+"=("+t+"===undefined?"+e+":"+t+"|0)"}).join(";"),"var a=this.shape,b=this.stride;return new "+r+"(this.data,"+v.join(",")+","+y.join(",")+",this.offset)}"),a.push("proto.pick=function "+r+"_pick("+u+"){var a=[],b=[],c=this.offset");for(var g=0;g<e;++g)a.push("if(typeof i"+g+"==='number'&&i"+g+">=0){c=(c+this.stride["+g+"]*i"+g+")|0}else{a.push(this.shape["+g+"]);b.push(this.stride["+g+"])}");a.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),a.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+s.map(function(t){return"shape["+t+"]"}).join(",")+","+s.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}");var o=new Function("CTOR_LIST","ORDER",a.join("\n"));return o(h[t],i)}function o(t){if(u(t))return"buffer";if(c)switch(Object.prototype.toString.call(t)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped"}return Array.isArray(t)?"array":"generic"}function s(t,e,r,n){if(void 0===t){var i=h.array[0];return i([])}"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var s=e.length;if(void 0===r){r=new Array(s);for(var l=s-1,u=1;l>=0;--l)r[l]=u,u*=e[l]}if(void 0===n){n=0;for(var l=0;l<s;++l)r[l]<0&&(n-=(e[l]-1)*r[l])}for(var c=o(t),f=h[c];f.length<=s+1;)f.push(a(c,f.length-1));var i=f[s+1];return i(t,e,r,n)}var l=t("iota-array"),u=t("is-buffer"),c="undefined"!=typeof Float64Array,h={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=s},{"iota-array":262,"is-buffer":263}],433:[function(t,e,r){"use strict";function n(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return e<0?-a:a;var r=i.hi(t),n=i.lo(t);return e>t==t>0?n===o?(r+=1,n=0):n+=1:0===n?(n=o,r-=1):n-=1,i.pack(n,r)}var i=t("double-bits"),a=Math.pow(2,-1074),o=-1>>>0;e.exports=n},{"double-bits":99}],434:[function(t,e,r){var n=1e-6,i=1e-6;r.vertexNormals=function(t,e,r){for(var i=e.length,a=new Array(i),o=void 0===r?n:r,s=0;s<i;++s)a[s]=[0,0,0];for(var s=0;s<t.length;++s)for(var l=t[s],u=0,c=l[l.length-1],h=l[0],f=0;f<l.length;++f){u=c,c=h,h=l[(f+1)%l.length];for(var d=e[u],p=e[c],m=e[h],g=new Array(3),v=0,y=new Array(3),x=0,b=0;b<3;++b)g[b]=d[b]-p[b],v+=g[b]*g[b],y[b]=m[b]-p[b],x+=y[b]*y[b];if(v*x>o)for(var _=a[c],w=1/Math.sqrt(v*x),b=0;b<3;++b){var M=(b+1)%3,A=(b+2)%3;_[b]+=w*(y[M]*g[A]-y[A]*g[M])}}for(var s=0;s<i;++s){for(var _=a[s],k=0,b=0;b<3;++b)k+=_[b]*_[b];if(k>o)for(var w=1/Math.sqrt(k),b=0;b<3;++b)_[b]*=w;else for(var b=0;b<3;++b)_[b]=0}return a},r.faceNormals=function(t,e,r){for(var n=t.length,a=new Array(n),o=void 0===r?i:r,s=0;s<n;++s){for(var l=t[s],u=new Array(3),c=0;c<3;++c)u[c]=e[l[c]];for(var h=new Array(3),f=new Array(3),c=0;c<3;++c)h[c]=u[1][c]-u[0][c],f[c]=u[2][c]-u[0][c];for(var d=new Array(3),p=0,c=0;c<3;++c){var m=(c+1)%3,g=(c+2)%3;d[c]=h[m]*f[g]-h[g]*f[m],p+=d[c]*d[c]}p=p>o?1/Math.sqrt(p):0;for(var c=0;c<3;++c)d[c]*=p;a[s]=d}return a}},{}],435:[function(t,e,r){"use strict";function n(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function i(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==n.join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(t){i[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(t){return!1}}var a=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;e.exports=i()?Object.assign:function(t,e){for(var r,i,s=n(t),l=1;l<arguments.length;l++){r=Object(arguments[l]);for(var u in r)a.call(r,u)&&(s[u]=r[u]);if(Object.getOwnPropertySymbols){i=Object.getOwnPropertySymbols(r);for(var c=0;c<i.length;c++)o.call(r,i[c])&&(s[i[c]]=r[i[c]])}}return s}},{}],436:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,u){var c=e+a+u;if(h>0){var h=Math.sqrt(c+1);t[0]=.5*(o-l)/h,t[1]=.5*(s-n)/h,t[2]=.5*(r-a)/h,t[3]=.5*h}else{var f=Math.max(e,a,u),h=Math.sqrt(2*f-c+1);e>=f?(t[0]=.5*h,t[1]=.5*(i+r)/h,t[2]=.5*(s+n)/h,t[3]=.5*(o-l)/h):a>=f?(t[0]=.5*(r+i)/h,t[1]=.5*h,t[2]=.5*(l+o)/h,t[3]=.5*(s-n)/h):(t[0]=.5*(n+s)/h,t[1]=.5*(o+l)/h,t[2]=.5*h,t[3]=.5*(r-i)/h)}return t}e.exports=n},{}],437:[function(t,e,r){"use strict";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function a(t,e){var r=e[0],n=e[1],a=e[2],o=e[3],s=i(r,n,a,o);s>1e-6?(t[0]=r/s,t[1]=n/s,t[2]=a/s,t[3]=o/s):(t[0]=t[1]=t[2]=0,t[3]=1)}function o(t,e,r){this.radius=l([r]),this.center=l(e),this.rotation=l(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}function s(t){t=t||{};var e=t.center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),r=[].slice.call(r,0,4),a(r,r);var i=new o(r,e,Math.log(n));return i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up),i}e.exports=s;var l=t("filtered-vector"),u=t("gl-mat4/lookAt"),c=t("gl-mat4/fromQuat"),h=t("gl-mat4/invert"),f=t("./lib/quatFromFrame"),d=o.prototype;d.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},d.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;a(e,e);var r=this.computedMatrix;c(r,e);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var u=0,h=0;h<3;++h)u+=r[l+4*h]*i[h];r[12+l]=-u}},d.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r},d.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},d.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},d.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=a[1],s=a[5],l=a[9],u=n(o,s,l);o/=u,s/=u,l/=u;var c=a[0],h=a[4],f=a[8],d=c*o+h*s+f*l;c-=o*d,h-=s*d,f-=l*d;var p=n(c,h,f);c/=p,h/=p,f/=p;var m=a[2],g=a[6],v=a[10],y=m*o+g*s+v*l,x=m*c+g*h+v*f;m-=y*o+x*c,g-=y*s+x*h,v-=y*l+x*f;var b=n(m,g,v);m/=b,g/=b,v/=b;var _=c*e+o*r,w=h*e+s*r,M=f*e+l*r;this.center.move(t,_,w,M);var A=Math.exp(this.computedRadius[0]);A=Math.max(1e-4,A+i),this.radius.set(t,Math.log(A))},d.rotate=function(t,e,r,a){this.recalcMatrix(t),e=e||0,r=r||0;var o=this.computedMatrix,s=o[0],l=o[4],u=o[8],c=o[1],h=o[5],f=o[9],d=o[2],p=o[6],m=o[10],g=e*s+r*c,v=e*l+r*h,y=e*u+r*f,x=-(p*y-m*v),b=-(m*g-d*y),_=-(d*v-p*g),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(b,2)-Math.pow(_,2))),M=i(x,b,_,w);M>1e-6?(x/=M,b/=M,_/=M,w/=M):(x=b=_=0,w=1);var A=this.computedRotation,k=A[0],T=A[1],E=A[2],S=A[3],L=k*w+S*x+T*_-E*b,C=T*w+S*b+E*x-k*_,I=E*w+S*_+k*b-T*x,z=S*w-k*x-T*b-E*_;if(a){x=d,b=p,_=m;var D=Math.sin(a)/n(x,b,_);x*=D,b*=D,_*=D,w=Math.cos(e),L=L*w+z*x+C*_-I*b,C=C*w+z*b+I*x-L*_,I=I*w+z*_+L*b-C*x,z=z*w-L*x-C*b-I*_}var P=i(L,C,I,z);P>1e-6?(L/=P,C/=P,I/=P,z/=P):(L=C=I=0,z=1),this.rotation.set(t,L,C,I,z)},d.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var i=this.computedMatrix;u(i,e,r,n);var o=this.computedRotation;f(o,i[0],i[1],i[2],i[4],i[5],i[6],i[8],i[9],i[10]),a(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var s=0,l=0;l<3;++l)s+=Math.pow(r[l]-e[l],2);this.radius.set(t,.5*Math.log(Math.max(s,1e-6))),this.center.set(t,r[0],r[1],r[2])},d.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},d.setMatrix=function(t,e){var r=this.computedRotation;f(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),a(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;h(n,e);var i=n[15];if(Math.abs(i)>1e-6){var o=n[12]/i,s=n[13]/i,l=n[14]/i;this.recalcMatrix(t);var u=Math.exp(this.computedRadius[0]);this.center.set(t,o-n[2]*u,s-n[6]*u,l-n[10]*u),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},d.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},d.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-(1/0),e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},d.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},d.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},d.fromJSON=function(t){var e=this.lastT(),r=t.center;r&&this.center.set(e,r[0],r[1],r[2]);var n=t.rotation;n&&this.rotation.set(e,n[0],n[1],n[2],n[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},{"./lib/quatFromFrame":436,"filtered-vector":108,"gl-mat4/fromQuat":151,"gl-mat4/invert":154,"gl-mat4/lookAt":155}],438:[function(t,e,r){"use strict";var n=t("repeat-string");e.exports=function(t,e,r){return r="undefined"!=typeof r?r+"":" ",n(r,e)+t}},{"repeat-string":463}],439:[function(t,e,r){e.exports=function(t,e){e||(e=[0,""]),t=String(t);var r=parseFloat(t,10);return e[0]=r,e[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",e}},{}],440:[function(t,e,r){(function(t){function e(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n<t.length;n++)e(t[n],n,t)&&r.push(t[n]);return r}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a=function(t){return i.exec(t).slice(1)};r.resolve=function(){for(var r="",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var o=a>=0?arguments[a]:t.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(r=o+"/"+r,i="/"===o.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var i=r.isAbsolute(t),a="/"===o(t,-1);return t=e(n(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&a&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;r>=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),a=n(e.split("/")),o=Math.min(i.length,a.length),s=o,l=0;l<o;l++)if(i[l]!==a[l]){s=l;break}for(var u=[],l=s;l<i.length;l++)u.push("..");return u=u.concat(a.slice(s)),u.join("/")},r.sep="/",r.delimiter=":",r.dirname=function(t){var e=a(t),r=e[0],n=e[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},r.basename=function(t,e){var r=a(t)[2];return e&&r.substr(-1*e.length)===e&&(r=r.substr(0,r.length-e.length)),r},r.extname=function(t){return a(t)[3]};var o="b"==="ab".substr(-1)?function(t,e,r){return t.substr(e,r)}:function(t,e,r){return e<0&&(e=t.length+e),t.substr(e,r)}}).call(this,t("_process"))},{_process:451}],441:[function(t,e,r){"use strict";function n(t){var e;t&&t.length&&(e=t,t=e.length);var r=new Uint8Array(t||0);return e&&r.set(e),r.readUInt32LE=a.readUInt32LE,r.writeUInt32LE=a.writeUInt32LE,r.readInt32LE=a.readInt32LE,r.writeInt32LE=a.writeInt32LE,r.readFloatLE=a.readFloatLE,r.writeFloatLE=a.writeFloatLE,r.readDoubleLE=a.readDoubleLE,r.writeDoubleLE=a.writeDoubleLE,r.toString=a.toString,r.write=a.write,r.slice=a.slice,r.copy=a.copy,r._isBuffer=!0,r}function i(t){for(var e,r,n=t.length,i=[],a=0;a<n;a++){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!r){e>56319||a+1===n?i.push(239,191,189):r=e;continue}if(e<56320){i.push(239,191,189),r=e;continue}e=r-55296<<10|e-56320|65536,r=null}else r&&(i.push(239,191,189),r=null);e<128?i.push(e):e<2048?i.push(e>>6|192,63&e|128):e<65536?i.push(e>>12|224,e>>6&63|128,63&e|128):i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}return i}e.exports=n;var a,o,s,l=t("ieee754");a={readUInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},writeUInt32LE:function(t,e){this[e]=t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24},readInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+(this[t+3]<<24)},readFloatLE:function(t){return l.read(this,t,!0,23,4)},readDoubleLE:function(t){return l.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return l.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return l.write(this,t,e,!0,52,8)},toString:function(t,e,r){var n="",i="";e=e||0,r=Math.min(this.length,r||this.length);for(var a=e;a<r;a++){var o=this[a];o<=127?(n+=decodeURIComponent(i)+String.fromCharCode(o),i=""):i+="%"+o.toString(16)}return n+=decodeURIComponent(i)},write:function(t,e){for(var r=t===o?s:i(t),n=0;n<r.length;n++)this[e+n]=r[n]},slice:function(t,e){return this.subarray(t,e)},copy:function(t,e){e=e||0;for(var r=0;r<this.length;r++)t[e+r]=this[r]}},a.writeInt32LE=a.writeUInt32LE,n.byteLength=function(t){return o=t,s=i(t),s.length},n.isBuffer=function(t){return!(!t||!t._isBuffer)}},{ieee754:258}],442:[function(t,e,r){(function(r){"use strict";function n(t){this.buf=g.isBuffer(t)?t:new g(t||0),this.pos=0,this.length=this.buf.length}function i(t,e){var r,n=e.buf;if(r=n[e.pos++],t+=268435456*(127&r),r<128)return t;if(r=n[e.pos++],t+=34359738368*(127&r),r<128)return t;if(r=n[e.pos++],t+=4398046511104*(127&r),r<128)return t;if(r=n[e.pos++],t+=562949953421312*(127&r),r<128)return t;if(r=n[e.pos++],t+=72057594037927940*(127&r),r<128)return t;if(r=n[e.pos++],t+=0x8000000000000000*(127&r),r<128)return t;throw new Error("Expected varint not more than 10 bytes")}function a(t,e){e.realloc(10);for(var r=e.pos+10;t>=1;){if(e.pos>=r)throw new Error("Given varint doesn't fit into 10 bytes");var n=255&t;e.buf[e.pos++]=n|(t>=128?128:0),t/=128}}function o(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function s(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function l(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function u(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function c(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function h(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function f(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function d(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function p(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function m(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}e.exports=n;var g=r.Buffer||t("./buffer");n.Varint=0,n.Fixed64=1,n.Bytes=2,n.Fixed32=5;var v=4294967296,y=1/v,x=Math.pow(2,63);n.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,a=this.pos;t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=this.buf.readUInt32LE(this.pos);return this.pos+=4,t},readSFixed32:function(){var t=this.buf.readInt32LE(this.pos);return this.pos+=4,t},readFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+this.buf.readUInt32LE(this.pos+4)*v;return this.pos+=8,t},readSFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+this.buf.readInt32LE(this.pos+4)*v;return this.pos+=8,t},readFloat:function(){var t=this.buf.readFloatLE(this.pos);return this.pos+=4,t},readDouble:function(){var t=this.buf.readDoubleLE(this.pos);return this.pos+=8,t},readVarint:function(){var t,e,r=this.buf;return e=r[this.pos++],t=127&e,e<128?t:(e=r[this.pos++],t|=(127&e)<<7,e<128?t:(e=r[this.pos++],t|=(127&e)<<14,e<128?t:(e=r[this.pos++],t|=(127&e)<<21,e<128?t:i(t,this))))},readVarint64:function(){var t=this.pos,e=this.readVarint();if(e<x)return e;for(var r=this.pos-2;255===this.buf[r];)r--;r<t&&(r=t),e=0;for(var n=0;n<r-t+1;n++){var i=127&~this.buf[t+n];e+=n<4?i<<7*n:i*Math.pow(2,7*n)}return-e-1},readSVarint:function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.buf.toString("utf8",this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.slice(this.pos,t);return this.pos=t,e},readPackedVarint:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readVarint());return e},readPackedSVarint:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(t){var e=7&t;if(e===n.Varint)for(;this.buf[this.pos++]>127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new g(e);this.buf.copy(r),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.slice(0,this.length)},writeFixed32:function(t){this.realloc(4),this.buf.writeUInt32LE(t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),this.buf.writeInt32LE(t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),this.buf.writeInt32LE(t&-1,this.pos),this.buf.writeUInt32LE(Math.floor(t*y),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),this.buf.writeInt32LE(t&-1,this.pos),this.buf.writeInt32LE(Math.floor(t*y),this.pos+4),this.pos+=8},writeVarint:function(t){return t=+t,t>268435455?void a(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),void(t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127)))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t);var e=g.byteLength(t);this.writeVarint(e),this.realloc(e),this.buf.write(t,this.pos),this.pos+=e},writeFloat:function(t){this.realloc(4),this.buf.writeFloatLE(t,this.pos),this.pos+=4},writeDouble:function(t){this.realloc(8),this.buf.writeDoubleLE(t,this.pos),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&o(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,s,e)},writePackedSVarint:function(t,e){this.writeMessage(t,l,e)},writePackedBoolean:function(t,e){this.writeMessage(t,h,e)},writePackedFloat:function(t,e){this.writeMessage(t,u,e)},writePackedDouble:function(t,e){this.writeMessage(t,c,e)},writePackedFixed32:function(t,e){this.writeMessage(t,f,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,d,e)},writePackedFixed64:function(t,e){this.writeMessage(t,p,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,m,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./buffer":441}],443:[function(t,e,r){"use strict";function n(t){var e=t.length;if(e<i){for(var r=1,n=0;n<e;++n)for(var o=0;o<n;++o)if(t[n]<t[o])r=-r;else if(t[n]===t[o])return 0;return r}for(var s=a.mallocUint8(e),n=0;n<e;++n)s[n]=0;for(var r=1,n=0;n<e;++n)if(!s[n]){var l=1;s[n]=1;for(var o=t[n];o!==n;o=t[o]){if(s[o])return a.freeUint8(s),0;l+=1,s[o]=1}1&l||(r=-r)}return a.freeUint8(s),r}e.exports=n;var i=32,a=t("typedarray-pool")},{"typedarray-pool":502}],444:[function(t,e,r){"use strict";function n(t){var e=t.length;switch(e){case 0:case 1:return 0;case 2:return t[1]}var r,n,i,s=a.mallocUint32(e),l=a.mallocUint32(e),u=0;for(o(t,l),i=0;i<e;++i)s[i]=t[i];for(i=e-1;i>0;--i)n=l[i],r=s[i],s[i]=s[n],s[n]=r,l[i]=l[r],l[r]=n,u=(u+r)*i;return a.freeUint32(l),a.freeUint32(s),u}function i(t,e,r){switch(t){case 0:return r?r:[];case 1:return r?(r[0]=0,r):[0];case 2:return r?(e?(r[0]=0,r[1]=1):(r[0]=1,r[1]=0),r):e?[0,1]:[1,0]}r=r||new Array(t);var n,i,a,o=1;for(r[0]=0,a=1;a<t;++a)r[a]=a,o=o*a|0;for(a=t-1;a>0;--a)n=e/o|0,e=e-n*o|0,o=o/a|0,i=0|r[a],r[a]=0|r[n],r[n]=0|i;return r}var a=t("typedarray-pool"),o=t("invert-permutation");r.rank=n,r.unrank=i},{"invert-permutation":261,"typedarray-pool":502}],445:[function(t,e,r){"use strict";function n(t,e){function r(t,e){var r=u[e][t[e]];r.splice(r.indexOf(t),1)}function n(t,n,a){for(var o,s,l,c=0;c<2;++c)if(u[c][n].length>0){o=u[c][n][0],l=c;break}s=o[1^l];for(var h=0;h<2;++h)for(var f=u[h][n],d=0;d<f.length;++d){var p=f[d],m=p[1^h],g=i(e[t],e[n],e[s],e[m]);g>0&&(o=p,s=m,l=h)}return a?s:(o&&r(o,l),s)}function a(t,a){var o=u[a][t][0],s=[t];r(o,a);for(var l=o[1^a];;){for(;l!==t;)s.push(l),l=n(s[s.length-2],l,!1);if(u[0][t].length+u[1][t].length===0)break;var c=s[s.length-1],h=t,f=s[1],d=n(c,h,!0);if(i(e[c],e[h],e[f],e[d])<0)break;s.push(t),l=n(c,h)}return s}function o(t,e){return e[1]===e[e.length-1]}for(var s=0|e.length,l=t.length,u=[new Array(s),new Array(s)],c=0;c<s;++c)u[0][c]=[],u[1][c]=[];for(var c=0;c<l;++c){var h=t[c];u[0][h[0]].push(h),u[1][h[1]].push(h)}for(var f=[],c=0;c<s;++c)u[0][c].length+u[1][c].length===0&&f.push([c]);for(var c=0;c<s;++c)for(var d=0;d<2;++d){for(var p=[];u[d][c].length>0;){var m=(u[0][c].length,a(c,d));o(p,m)?p.push.apply(p,m):(p.length>0&&f.push(p),p=m)}p.length>0&&f.push(p)}return f}e.exports=n;var i=t("compare-angle")},{"compare-angle":83}],446:[function(t,e,r){"use strict";function n(t,e){for(var r=i(t,e.length),n=new Array(e.length),a=new Array(e.length),o=[],s=0;s<e.length;++s){var l=r[s].length;a[s]=l,n[s]=!0,l<=1&&o.push(s)}for(;o.length>0;){var u=o.pop();n[u]=!1;for(var c=r[u],s=0;s<c.length;++s){var h=c[s];0===--a[h]&&o.push(h)}}for(var f=new Array(e.length),d=[],s=0;s<e.length;++s)if(n[s]){var u=d.length;f[s]=u,d.push(e[s])}else f[s]=-1;for(var p=[],s=0;s<t.length;++s){var m=t[s];n[m[0]]&&n[m[1]]&&p.push([f[m[0]],f[m[1]]])}return[p,d]}e.exports=n;var i=t("edges-to-adjacency-list")},{"edges-to-adjacency-list":102}],447:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=e;return r}function i(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=[];return e}function a(t,e){function r(t){for(var r=t.length,n=[0],i=0;i<r;++i){var a=e[t[i]],o=e[t[(i+1)%r]],s=u(-a[0],a[1]),l=u(-a[0],o[1]),h=u(o[0],a[1]),f=u(o[0],o[1]);n=c(n,c(c(s,l),c(h,f)))}return n[n.length-1]>0}function a(t){for(var e=t.length,r=0;r<e;++r)if(!P[t[r]])return!1;return!0}var d=f(t,e);t=d[0],e=d[1];for(var p=e.length,m=(t.length,o(t,e.length)),g=0;g<p;++g)if(m[g].length%2===1)throw new Error("planar-graph-to-polyline: graph must be manifold");var v=s(t,e);v=v.filter(r);for(var y=v.length,x=new Array(y),b=new Array(y),g=0;g<y;++g){x[g]=g;var _=new Array(y),w=v[g].map(function(t){return e[t]}),M=l([w]),A=0;t:for(var k=0;k<y;++k)if(_[k]=0,g!==k){for(var T=v[k],E=T.length,S=0;S<E;++S){var L=M(e[T[S]]);if(0!==L){L<0&&(_[k]=1,A+=1);continue t}}_[k]=1,A+=1}b[g]=[A,g,_]}b.sort(function(t,e){return e[0]-t[0]});for(var g=0;g<y;++g)for(var _=b[g],C=_[1],I=_[2],k=0;k<y;++k)I[k]&&(x[k]=C);for(var z=i(y),g=0;g<y;++g)z[g].push(x[g]),z[x[g]].push(g);for(var D={},P=n(p,!1),g=0;g<y;++g)for(var T=v[g],E=T.length,k=0;k<E;++k){var O=T[k],R=T[(k+1)%E],F=Math.min(O,R)+":"+Math.max(O,R);if(F in D){var j=D[F];z[j].push(g),z[g].push(j),P[O]=P[R]=!0}else D[F]=g}for(var N=[],B=n(y,-1),g=0;g<y;++g)x[g]!==g||a(v[g])?B[g]=-1:(N.push(g),B[g]=0);for(var d=[];N.length>0;){var U=N.pop(),V=z[U];h(V,function(t,e){return t-e});var q,H=V.length,Y=B[U];if(0===Y){var T=v[U];q=[T]}for(var g=0;g<H;++g){var G=V[g];if(!(B[G]>=0)&&(B[G]=1^Y,N.push(G),0===Y)){var T=v[G];a(T)||(T.reverse(),q.push(T))}}0===Y&&d.push(q)}return d}e.exports=a;var o=t("edges-to-adjacency-list"),s=t("planar-dual"),l=t("point-in-big-polygon"),u=t("two-product"),c=t("robust-sum"),h=t("uniq"),f=t("./lib/trim-leaves")},{"./lib/trim-leaves":446,"edges-to-adjacency-list":102,"planar-dual":445,"point-in-big-polygon":449,"robust-sum":476,"two-product":500,uniq:504}],448:[function(t,e,r){"use strict";function n(t,e){this.x=t,this.y=e}e.exports=n,n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{}],449:[function(t,e,r){function n(){return!0}function i(t){return function(e,r){var i=t[e];return!!i&&!!i.queryPoint(r,n)}}function a(t){for(var e={},r=0;r<t.length;++r){var n=t[r],a=n[0][0],o=n[0][1],s=n[1][1],l=[Math.min(o,s),Math.max(o,s)];a in e?e[a].push(l):e[a]=[l]}for(var u={},c=Object.keys(e),r=0;r<c.length;++r){var h=e[c[r]];u[c[r]]=d(h)}return i(u)}function o(t,e){return function(r){var n=p.le(e,r[0]);if(n<0)return 1;var i=t[n];if(!i){if(!(n>0&&e[n]===r[0]))return 1;i=t[n-1]}for(var a=1;i;){var o=i.key,s=h(r,o[0],o[1]);if(o[0][0]<o[1][0])if(s<0)i=i.left;else{if(!(s>0))return 0;a=-1,i=i.right}else if(s>0)i=i.left;else{if(!(s<0))return 0;a=1,i=i.right}}return a}}function s(t){return 1}function l(t){return function(e){return t(e[0],e[1])?0:1}}function u(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}function c(t){for(var e=t.length,r=[],n=[],i=0;i<e;++i)for(var c=t[i],h=c.length,d=h-1,p=0;p<h;d=p++){var m=c[d],g=c[p];m[0]===g[0]?n.push([m,g]):r.push([m,g])}if(0===r.length)return 0===n.length?s:l(a(n));var v=f(r),y=o(v.slabs,v.coordinates);return 0===n.length?y:u(a(n),y)}e.exports=c;var h=t("robust-orientation")[3],f=t("slab-decomposition"),d=t("interval-tree-1d"),p=t("binary-search-bounds")},{"binary-search-bounds":55,"interval-tree-1d":260,"robust-orientation":471,"slab-decomposition":488}],450:[function(t,e,r){"use strict";function n(t,e,r,n,s){i.length<n.length&&(i=new Float64Array(n.length),a=new Float64Array(n.length),o=new Float64Array(n.length));for(var l=0;l<n.length;++l)i[l]=t[l]-n[l],a[l]=e[l]-t[l],o[l]=r[l]-t[l];for(var u=0,c=0,h=0,f=0,d=0,p=0,l=0;l<n.length;++l){var m=a[l],g=o[l],v=i[l];u+=m*m,c+=m*g,h+=g*g,f+=v*m,d+=v*g,p+=v*v}var y,x=Math.abs(u*h-c*c),b=c*d-h*f,_=c*f-u*d;if(b+_<=x)if(b<0)_<0&&f<0?(_=0,-f>=u?(b=1,y=u+2*f+p):(b=-f/u,y=f*b+p)):(b=0,d>=0?(_=0,y=p):-d>=h?(_=1,y=h+2*d+p):(_=-d/h,y=d*_+p));else if(_<0)_=0,f>=0?(b=0,y=p):-f>=u?(b=1,y=u+2*f+p):(b=-f/u,y=f*b+p);else{var w=1/x;b*=w,_*=w,y=b*(u*b+c*_+2*f)+_*(c*b+h*_+2*d)+p}else{var M,A,k,T;b<0?(M=c+f,A=h+d,A>M?(k=A-M,T=u-2*c+h,k>=T?(b=1,_=0,y=u+2*f+p):(b=k/T,_=1-b,y=b*(u*b+c*_+2*f)+_*(c*b+h*_+2*d)+p)):(b=0,A<=0?(_=1,y=h+2*d+p):d>=0?(_=0,y=p):(_=-d/h,y=d*_+p))):_<0?(M=c+d,A=u+f,A>M?(k=A-M,T=u-2*c+h,k>=T?(_=1,b=0,y=h+2*d+p):(_=k/T,b=1-_,y=b*(u*b+c*_+2*f)+_*(c*b+h*_+2*d)+p)):(_=0,A<=0?(b=1,y=u+2*f+p):f>=0?(b=0,y=p):(b=-f/u,y=f*b+p))):(k=h+d-c-f,k<=0?(b=0,_=1,y=h+2*d+p):(T=u-2*c+h,k>=T?(b=1,_=0,y=u+2*f+p):(b=k/T,_=1-b,y=b*(u*b+c*_+2*f)+_*(c*b+h*_+2*d)+p)))}for(var E=1-b-_,l=0;l<n.length;++l)s[l]=E*t[l]+b*e[l]+_*r[l];return y<0?0:y}var i=new Float64Array(4),a=new Float64Array(4),o=new Float64Array(4);e.exports=n},{}],451:[function(t,e,r){function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(t){if(h===setTimeout)return setTimeout(t,0);if((h===n||!h)&&setTimeout)return h=setTimeout,setTimeout(t,0);try{return h(t,0)}catch(e){try{return h.call(null,t,0)}catch(e){return h.call(this,t,0)}}}function o(t){if(f===clearTimeout)return clearTimeout(t);if((f===i||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(t);try{return f(t)}catch(e){try{return f.call(null,t)}catch(e){return f.call(this,t)}}}function s(){g&&p&&(g=!1,p.length?m=p.concat(m):v=-1,m.length&&l())}function l(){if(!g){var t=a(s);g=!0;for(var e=m.length;e;){for(p=m,m=[];++v<e;)p&&p[v].run();v=-1,e=m.length}p=null,g=!1,o(t)}}function u(t,e){this.fun=t,this.array=e}function c(){}var h,f,d=e.exports={};!function(){try{h="function"==typeof setTimeout?setTimeout:n}catch(t){h=n}try{f="function"==typeof clearTimeout?clearTimeout:i}catch(t){f=i}}();var p,m=[],g=!1,v=-1;d.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];m.push(new u(t,e)),1!==m.length||g||a(l)},u.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=c,d.addListener=c,d.once=c,d.off=c,d.removeListener=c,d.removeAllListeners=c,d.emit=c,d.binding=function(t){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(t){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},{}],452:[function(e,r,n){(function(e){!function(i){function a(t){throw new RangeError(P[t])}function o(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function s(t,e){var r=t.split("@"),n="";r.length>1&&(n=r[0]+"@",t=r[1]),t=t.replace(D,".");var i=t.split("."),a=o(i,e).join(".");return n+a}function l(t){for(var e,r,n=[],i=0,a=t.length;i<a;)e=t.charCodeAt(i++),e>=55296&&e<=56319&&i<a?(r=t.charCodeAt(i++),56320==(64512&r)?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--)):n.push(e);return n}function u(t){return o(t,function(t){var e="";return t>65535&&(t-=65536,e+=F(t>>>10&1023|55296),t=56320|1023&t),e+=F(t)}).join("")}function c(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:M}function h(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function f(t,e,r){var n=0;for(t=r?R(t/E):t>>1,t+=R(t/e);t>O*k>>1;n+=M)t=R(t/O);return R(n+(O+1)*t/(t+T))}function d(t){var e,r,n,i,o,s,l,h,d,p,m=[],g=t.length,v=0,y=L,x=S;for(r=t.lastIndexOf(C),r<0&&(r=0),n=0;n<r;++n)t.charCodeAt(n)>=128&&a("not-basic"),m.push(t.charCodeAt(n));for(i=r>0?r+1:0;i<g;){for(o=v,s=1,l=M;i>=g&&a("invalid-input"),h=c(t.charCodeAt(i++)),(h>=M||h>R((w-v)/s))&&a("overflow"),v+=h*s,d=l<=x?A:l>=x+k?k:l-x,!(h<d);l+=M)p=M-d,s>R(w/p)&&a("overflow"),s*=p;e=m.length+1,x=f(v-o,e,0==o),R(v/e)>w-y&&a("overflow"),y+=R(v/e),v%=e,m.splice(v++,0,y)}return u(m)}function p(t){var e,r,n,i,o,s,u,c,d,p,m,g,v,y,x,b=[];for(t=l(t),g=t.length,e=L,r=0,o=S,s=0;s<g;++s)m=t[s],m<128&&b.push(F(m));for(n=i=b.length,i&&b.push(C);n<g;){for(u=w,s=0;s<g;++s)m=t[s],m>=e&&m<u&&(u=m);for(v=n+1,u-e>R((w-r)/v)&&a("overflow"),r+=(u-e)*v,e=u,s=0;s<g;++s)if(m=t[s],m<e&&++r>w&&a("overflow"),m==e){for(c=r,d=M;p=d<=o?A:d>=o+k?k:d-o,!(c<p);d+=M)x=c-p,y=M-p,b.push(F(h(p+x%y,0))),c=R(x/y);b.push(F(h(c,0))),o=f(r,v,n==i),r=0,++n}++r,++e}return b.join("")}function m(t){return s(t,function(t){return I.test(t)?d(t.slice(4).toLowerCase()):t})}function g(t){return s(t,function(t){return z.test(t)?"xn--"+p(t):t})}var v="object"==typeof n&&n&&!n.nodeType&&n,y="object"==typeof r&&r&&!r.nodeType&&r,x="object"==typeof e&&e;x.global!==x&&x.window!==x&&x.self!==x||(i=x);var b,_,w=2147483647,M=36,A=1,k=26,T=38,E=700,S=72,L=128,C="-",I=/^xn--/,z=/[^\x20-\x7E]/,D=/[\x2E\u3002\uFF0E\uFF61]/g,P={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},O=M-A,R=Math.floor,F=String.fromCharCode;if(b={version:"1.4.1",ucs2:{decode:l,encode:u},decode:d,encode:p,toASCII:g,toUnicode:m},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return b});else if(v&&y)if(r.exports==v)y.exports=b;else for(_ in b)b.hasOwnProperty(_)&&(v[_]=b[_]);else i.punycode=b}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],453:[function(t,e,r){e.exports=t("gl-quat/slerp")},{"gl-quat/slerp":204}],454:[function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,a){e=e||"&",r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;var s=/\+/g;t=t.split(e);var l=1e3;a&&"number"==typeof a.maxKeys&&(l=a.maxKeys);var u=t.length;l>0&&u>l&&(u=l);for(var c=0;c<u;++c){var h,f,d,p,m=t[c].replace(s,"%20"),g=m.indexOf(r);g>=0?(h=m.substr(0,g),f=m.substr(g+1)):(h=m,f=""),d=decodeURIComponent(h),p=decodeURIComponent(f),n(o,d)?i(o[d])?o[d].push(p):o[d]=[o[d],p]:o[d]=p}return o};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],455:[function(t,e,r){"use strict";function n(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n<t.length;n++)r.push(e(t[n],n));return r}var i=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};e.exports=function(t,e,r,s){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?n(o(t),function(o){var s=encodeURIComponent(i(o))+r;return a(t[o])?n(t[o],function(t){return s+encodeURIComponent(i(t))}).join(e):s+encodeURIComponent(i(t[o]))}).join(e):s?encodeURIComponent(i(s))+r+encodeURIComponent(i(t)):""};var a=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},o=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}},{}],456:[function(t,e,r){"use strict";r.decode=r.parse=t("./decode"),r.encode=r.stringify=t("./encode")},{"./decode":454,"./encode":455}],457:[function(t,e,r){"use strict";function n(t,e,r,o,s){for(r=r||0,o=o||t.length-1,s=s||a;o>r;){if(o-r>600){var l=o-r+1,u=e-r+1,c=Math.log(l),h=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1),d=Math.max(r,Math.floor(e-u*h/l+f)),p=Math.min(o,Math.floor(e+(l-u)*h/l+f));n(t,e,d,p,s)}var m=t[e],g=r,v=o;for(i(t,r,e),s(t[o],m)>0&&i(t,r,o);g<v;){for(i(t,g,v),g++,v--;s(t[g],m)<0;)g++;for(;s(t[v],m)>0;)v--}0===s(t[r],m)?i(t,r,v):(v++,i(t,v,o)),v<=e&&(r=v+1),e<=v&&(o=v-1)}}function i(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function a(t,e){return t<e?-1:t>e?1:0}e.exports=n},{}],458:[function(t,e,r){"use strict";function n(t,e){for(var r=t.length,n=new Array(r),a=0;a<r;++a)n[a]=i(t[a],e[a]);return n}var i=t("big-rat/add");e.exports=n},{"big-rat/add":39}],459:[function(t,e,r){"use strict";function n(t){for(var e=new Array(t.length),r=0;r<t.length;++r)e[r]=i(t[r]);return e}e.exports=n;var i=t("big-rat")},{"big-rat":42}],460:[function(t,e,r){"use strict";function n(t,e){for(var r=i(e),n=t.length,o=new Array(n),s=0;s<n;++s)o[s]=a(t[s],r);return o}var i=t("big-rat"),a=t("big-rat/mul");e.exports=n},{"big-rat":42,"big-rat/mul":51}],461:[function(t,e,r){"use strict";function n(t,e){for(var r=t.length,n=new Array(r),a=0;a<r;++a)n[a]=i(t[a],e[a]);return n}var i=t("big-rat/sub");e.exports=n},{"big-rat/sub":53}],462:[function(t,e,r){"use strict";function n(t){t.sort(a);for(var e=t.length,r=0,n=0;n<e;++n){var s=t[n],l=o(s);if(0!==l){if(r>0){var u=t[r-1];if(0===i(s,u)&&o(u)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}var i=t("compare-cell"),a=t("compare-oriented-cell"),o=t("cell-orientation");e.exports=n},{"cell-orientation":75,"compare-cell":84,"compare-oriented-cell":85}],463:[function(t,e,r){"use strict";function n(t,e){if("string"!=typeof t)throw new TypeError("expected a string");if(1===e)return t;if(2===e)return t+t;var r=t.length*e;if(i!==t||"undefined"==typeof i)i=t,a="";else if(a.length>=r)return a.substr(0,r);for(;r>a.length&&e>1;)1&e&&(a+=t),e>>=1,t+=t;return a+=t,a=a.substr(0,r)}var i,a="";e.exports=n},{}],464:[function(e,r,n){void function(e,i){"function"==typeof t&&t.amd?t(i):"object"==typeof n?r.exports=i():e.resolveUrl=i()}(this,function(){function t(){var t=arguments.length;if(0===t)throw new Error("resolveUrl requires at least one argument; got none.");var e=document.createElement("base");if(e.href=arguments[0],1===t)return e.href;var r=document.getElementsByTagName("head")[0];r.insertBefore(e,r.firstChild);for(var n,i=document.createElement("a"),a=1;a<t;a++)i.href=arguments[a],n=i.href,e.href=n;return r.removeChild(e),n}return t})},{}],465:[function(t,e,r){(function(t){e.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],466:[function(t,e,r){"use strict";function n(t){for(var e=t.length,r=t[t.length-1],n=e,i=e-2;i>=0;--i){var a=r,o=t[i];r=a+o;var s=r-a,l=o-s;l&&(t[--n]=r,r=l)}for(var u=0,i=n;i<e;++i){var a=t[i],o=r;r=a+o;var s=r-a,l=o-s;l&&(t[u++]=l)}return t[u++]=r,t.length=u,t}e.exports=n},{}],467:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t.length-1),n=1;n<t.length;++n)for(var i=r[n-1]=new Array(t.length-1),a=0,o=0;a<t.length;++a)a!==e&&(i[o++]=t[n][a]);return r}function i(t){for(var e=new Array(t),r=0;r<t;++r){e[r]=new Array(t);for(var n=0;n<t;++n)e[r][n]=["m[",r,"][",n,"]"].join("")}return e}function a(t){return 1&t?"-":""}function o(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",o(t.slice(0,e)),",",o(t.slice(e)),")"].join("")}function s(t){if(2===t.length)return["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("");for(var e=[],r=0;r<t.length;++r)e.push(["scale(",s(n(t,r)),",",a(r),t[0][r],")"].join(""));return o(e)}function l(t){var e=new Function("sum","scale","prod","compress",["function robustDeterminant",t,"(m){return compress(",s(i(t)),")};return robustDeterminant",t].join(""));return e(h,f,c,d)}function u(){for(;m.length<p;)m.push(l(m.length));for(var t=[],r=["function robustDeterminant(m){switch(m.length){"],n=0;n<p;++n)t.push("det"+n),r.push("case ",n,":return det",n,"(m);");r.push("}var det=CACHE[m.length];if(!det)det=CACHE[m.length]=gen(m.length);return det(m);}return robustDeterminant"),t.push("CACHE","gen",r.join(""));var i=Function.apply(void 0,t);e.exports=i.apply(void 0,m.concat([m,l]));for(var n=0;n<m.length;++n)e.exports[n]=m[n]}var c=t("two-product"),h=t("robust-sum"),f=t("robust-scale"),d=t("robust-compress"),p=6,m=[function(){return[0]},function(t){return[t[0][0]]}];u()},{"robust-compress":466,"robust-scale":473,"robust-sum":476,"two-product":500}],468:[function(t,e,r){"use strict";function n(t,e){for(var r=i(t[0],e[0]),n=1;n<t.length;++n)r=a(r,i(t[n],e[n]));return r}var i=t("two-product"),a=t("robust-sum");e.exports=n},{"robust-sum":476,"two-product":500}],469:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t.length-1),n=1;n<t.length;++n)for(var i=r[n-1]=new Array(t.length-1),a=0,o=0;a<t.length;++a)a!==e&&(i[o++]=t[n][a]);return r}function i(t){for(var e=new Array(t),r=0;r<t;++r){e[r]=new Array(t);for(var n=0;n<t;++n)e[r][n]=["m",n,"[",t-r-2,"]"].join("")}return e}function a(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function o(t,e){if("m"===t.charAt(0)){if("w"===e.charAt(0)){var r=t.split("[");return["w",e.substr(1),"m",r[0].substr(1)].join("")}return["prod(",t,",",e,")"].join("")}return o(e,t)}function s(t){return t&!0?"-":""}function l(t){if(2===t.length)return[["diff(",o(t[0][0],t[1][1]),",",o(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r<t.length;++r)e.push(["scale(",a(l(n(t,r))),",",s(r),t[0][r],")"].join(""));return e}function u(t,e){for(var r=[],n=0;n<e-2;++n)r.push(["prod(m",t,"[",n,"],m",t,"[",n,"])"].join(""));return a(r)}function c(t){for(var e=[],r=[],o=i(t),s=0;s<t;++s)o[0][s]="1",o[t-1][s]="w"+s;for(var s=0;s<t;++s)0===(1&s)?e.push.apply(e,l(n(o,s))):r.push.apply(r,l(n(o,s)));for(var c=a(e),h=a(r),f="exactInSphere"+t,d=[],s=0;s<t;++s)d.push("m"+s);for(var p=["function ",f,"(",d.join(),"){"],s=0;s<t;++s){p.push("var w",s,"=",u(s,t),";");for(var m=0;m<t;++m)m!==s&&p.push("var w",s,"m",m,"=scale(w",s,",m",m,"[0]);")}p.push("var p=",c,",n=",h,",d=diff(p,n);return d[d.length-1];}return ",f);var b=new Function("sum","diff","prod","scale",p.join(""));return b(v,y,g,x)}function h(){return 0}function f(){return 0}function d(){return 0}function p(t){var e=_[t.length];return e||(e=_[t.length]=c(t.length)),e.apply(void 0,t)}function m(){for(;_.length<=b;)_.push(c(_.length));for(var t=[],r=["slow"],n=0;n<=b;++n)t.push("a"+n),r.push("o"+n);for(var i=["function testInSphere(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"],n=2;n<=b;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return testInSphere"),r.push(i.join(""));var a=Function.apply(void 0,r);e.exports=a.apply(void 0,[p].concat(_));for(var n=0;n<=b;++n)e.exports[n]=_[n]}var g=t("two-product"),v=t("robust-sum"),y=t("robust-subtract"),x=t("robust-scale"),b=6,_=[h,f,d];m()},{"robust-scale":473,"robust-subtract":475,"robust-sum":476,"two-product":500}],470:[function(t,e,r){"use strict";function n(t){for(var e="robustLinearSolve"+t+"d",r=["function ",e,"(A,b){return ["],n=0;n<t;++n){r.push("det([");for(var i=0;i<t;++i){i>0&&r.push(","),r.push("[");for(var a=0;a<t;++a)a>0&&r.push(","),a===n?r.push("+b[",i,"]"):r.push("+A[",i,"][",a,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var o=new Function("det",r.join(""));return o(t<6?s[t]:s)}function i(){return[0]}function a(t,e){return[[e[0]],[t[0][0]]]}function o(){for(;u.length<l;)u.push(n(u.length));for(var t=[],r=["function dispatchLinearSolve(A,b){switch(A.length){"],i=0;i<l;++i)t.push("s"+i),r.push("case ",i,":return s",i,"(A,b);");r.push("}var s=CACHE[A.length];if(!s)s=CACHE[A.length]=g(A.length);return s(A,b)}return dispatchLinearSolve"),t.push("CACHE","g",r.join(""));var a=Function.apply(void 0,t);e.exports=a.apply(void 0,u.concat([u,n]));for(var i=0;i<l;++i)e.exports[i]=u[i]}var s=t("robust-determinant"),l=6,u=[i,a];o()},{"robust-determinant":467}],471:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t.length-1),n=1;n<t.length;++n)for(var i=r[n-1]=new Array(t.length-1),a=0,o=0;a<t.length;++a)a!==e&&(i[o++]=t[n][a]);return r}function i(t){for(var e=new Array(t),r=0;r<t;++r){e[r]=new Array(t);for(var n=0;n<t;++n)e[r][n]=["m",n,"[",t-r-1,"]"].join("")}return e}function a(t){return 1&t?"-":""}function o(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",o(t.slice(0,e)),",",o(t.slice(e)),")"].join("")}function s(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;r<t.length;++r)e.push(["scale(",o(s(n(t,r))),",",a(r),t[0][r],")"].join(""));return e}function l(t){for(var e=[],r=[],a=i(t),l=[],u=0;u<t;++u)0===(1&u)?e.push.apply(e,s(n(a,u))):r.push.apply(r,s(n(a,u))),l.push("m"+u);var c=o(e),m=o(r),g="orientation"+t+"Exact",v=["function ",g,"(",l.join(),"){var p=",c,",n=",m,",d=sub(p,n);return d[d.length-1];};return ",g].join(""),y=new Function("sum","prod","scale","sub",v);return y(f,h,d,p)}function u(t){var e=_[t.length];return e||(e=_[t.length]=l(t.length)),e.apply(void 0,t)}function c(){for(;_.length<=m;)_.push(l(_.length));for(var t=[],r=["slow"],n=0;n<=m;++n)t.push("a"+n),r.push("o"+n);for(var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"],n=2;n<=m;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return getOrientation"),r.push(i.join(""));var a=Function.apply(void 0,r);e.exports=a.apply(void 0,[u].concat(_));for(var n=0;n<=m;++n)e.exports[n]=_[n]}var h=t("two-product"),f=t("robust-sum"),d=t("robust-scale"),p=t("robust-subtract"),m=5,g=1.1102230246251565e-16,v=(3+16*g)*g,y=(7+56*g)*g,x=l(3),b=l(4),_=[function(){return 0},function(){return 0},function(t,e){return e[0]-t[0]},function(t,e,r){var n,i=(t[1]-r[1])*(e[0]-r[0]),a=(t[0]-r[0])*(e[1]-r[1]),o=i-a;if(i>0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=v*n;return o>=s||o<=-s?o:x(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],u=r[1]-n[1],c=t[2]-n[2],h=e[2]-n[2],f=r[2]-n[2],d=a*u,p=o*l,m=o*s,g=i*u,v=i*l,x=a*s,_=c*(d-p)+h*(m-g)+f*(v-x),w=(Math.abs(d)+Math.abs(p))*Math.abs(c)+(Math.abs(m)+Math.abs(g))*Math.abs(h)+(Math.abs(v)+Math.abs(x))*Math.abs(f),M=y*w;return _>M||-_>M?_:b(t,e,r,n)}];c()},{"robust-scale":473,"robust-subtract":475,"robust-sum":476,"two-product":500}],472:[function(t,e,r){"use strict";function n(t,e){if(1===t.length)return a(e,t[0]);if(1===e.length)return a(t,e[0]);if(0===t.length||0===e.length)return[0];var r=[0];if(t.length<e.length)for(var n=0;n<t.length;++n)r=i(r,a(e,t[n]));else for(var n=0;n<e.length;++n)r=i(r,a(t,e[n]));return r}var i=t("robust-sum"),a=t("robust-scale");e.exports=n},{"robust-scale":473,"robust-sum":476}],473:[function(t,e,r){"use strict";function n(t,e){var r=t.length;if(1===r){var n=i(t[0],e);return n[0]?n:[n[1]]}var o=new Array(2*r),s=[.1,.1],l=[.1,.1],u=0;i(t[0],e,s),s[0]&&(o[u++]=s[0]);for(var c=1;c<r;++c){i(t[c],e,l);var h=s[1];a(h,l[0],s),s[0]&&(o[u++]=s[0]);var f=l[1],d=s[1],p=f+d,m=p-f,g=d-m;s[1]=p,g&&(o[u++]=g)}return s[1]&&(o[u++]=s[1]),0===u&&(o[u++]=0),o.length=u,o}var i=t("two-product"),a=t("two-sum");e.exports=n},{"two-product":500,"two-sum":501}],474:[function(t,e,r){"use strict";function n(t,e,r,n){for(var i=0;i<2;++i){var a=t[i],o=e[i],s=Math.min(a,o),l=Math.max(a,o),u=r[i],c=n[i],h=Math.min(u,c),f=Math.max(u,c);if(f<s||l<h)return!1}return!0}function i(t,e,r,i){var o=a(t,r,i),s=a(e,r,i);if(o>0&&s>0||o<0&&s<0)return!1;var l=a(r,t,e),u=a(i,t,e);return!(l>0&&u>0||l<0&&u<0)&&(0!==o||0!==s||0!==l||0!==u||n(t,e,r,i))}e.exports=i;var a=t("robust-orientation")[3]},{"robust-orientation":471}],475:[function(t,e,r){"use strict";function n(t,e){var r=t+e,n=r-t,i=r-n,a=e-n,o=t-i,s=o+a;return s?[s,r]:[r]}function i(t,e){var r=0|t.length,i=0|e.length;if(1===r&&1===i)return n(t[0],-e[0]);var a,o,s=r+i,l=new Array(s),u=0,c=0,h=0,f=Math.abs,d=t[c],p=f(d),m=-e[h],g=f(m);p<g?(o=d,c+=1,c<r&&(d=t[c],p=f(d))):(o=m,h+=1,h<i&&(m=-e[h],g=f(m))),c<r&&p<g||h>=i?(a=d,c+=1,c<r&&(d=t[c],p=f(d))):(a=m,h+=1,h<i&&(m=-e[h],g=f(m)));for(var v,y,x,b,_,w=a+o,M=w-a,A=o-M,k=A,T=w;c<r&&h<i;)p<g?(a=d,c+=1,c<r&&(d=t[c],p=f(d))):(a=m,h+=1,h<i&&(m=-e[h],g=f(m))),o=k,w=a+o,M=w-a,A=o-M,A&&(l[u++]=A),v=T+w,y=v-T,x=v-y,b=w-y,_=T-x,k=_+b,T=v;for(;c<r;)a=d,o=k,w=a+o,M=w-a,A=o-M,A&&(l[u++]=A),v=T+w,y=v-T,x=v-y,b=w-y,_=T-x,k=_+b,T=v,c+=1,c<r&&(d=t[c]);for(;h<i;)a=m,o=k,w=a+o,M=w-a,A=o-M,A&&(l[u++]=A),v=T+w,y=v-T,x=v-y,b=w-y,_=T-x,k=_+b,T=v,h+=1,h<i&&(m=-e[h]);return k&&(l[u++]=k),T&&(l[u++]=T),u||(l[u++]=0),l.length=u,l}e.exports=i},{}],476:[function(t,e,r){"use strict";function n(t,e){var r=t+e,n=r-t,i=r-n,a=e-n,o=t-i,s=o+a;return s?[s,r]:[r]}function i(t,e){var r=0|t.length,i=0|e.length;if(1===r&&1===i)return n(t[0],e[0]);var a,o,s=r+i,l=new Array(s),u=0,c=0,h=0,f=Math.abs,d=t[c],p=f(d),m=e[h],g=f(m);p<g?(o=d,c+=1,c<r&&(d=t[c],p=f(d))):(o=m,h+=1,h<i&&(m=e[h],g=f(m))),c<r&&p<g||h>=i?(a=d,c+=1,c<r&&(d=t[c],p=f(d))):(a=m,h+=1,h<i&&(m=e[h],g=f(m)));for(var v,y,x,b,_,w=a+o,M=w-a,A=o-M,k=A,T=w;c<r&&h<i;)p<g?(a=d,c+=1,c<r&&(d=t[c],p=f(d))):(a=m,h+=1,h<i&&(m=e[h],g=f(m))),o=k,w=a+o,M=w-a,A=o-M,A&&(l[u++]=A),v=T+w,y=v-T,x=v-y,b=w-y,_=T-x,k=_+b,T=v;for(;c<r;)a=d,o=k,w=a+o,M=w-a,A=o-M,A&&(l[u++]=A),v=T+w,y=v-T,x=v-y,b=w-y,_=T-x,k=_+b,T=v,c+=1,c<r&&(d=t[c]);for(;h<i;)a=m,o=k,w=a+o,M=w-a,A=o-M,A&&(l[u++]=A),v=T+w,y=v-T,x=v-y,b=w-y,_=T-x,k=_+b,T=v,h+=1,h<i&&(m=e[h]);return k&&(l[u++]=k),T&&(l[u++]=T),u||(l[u++]=0),l.length=u,l}e.exports=i},{}],477:[function(e,r,n){!function(e,i){"object"==typeof n&&"undefined"!=typeof r?r.exports=i():"function"==typeof t&&t.amd?t(i):e.ShelfPack=i()}(this,function(){function t(t,e,r){r=r||{},this.w=t||64,this.h=e||64,this.autoResize=!!r.autoResize,this.shelves=[],this.stats={},this.count=function(t){this.stats[t]=(0|this.stats[t])+1}}function e(t,e,r){this.x=0,this.y=t,this.w=this.free=e,this.h=r}return t.prototype.pack=function(t,e){t=[].concat(t),e=e||{};for(var r,n,i,a=[],o=0;o<t.length;o++)if(r=t[o].w||t[o].width,n=t[o].h||t[o].height,r&&n){if(i=this.packOne(r,n),!i)continue;e.inPlace&&(t[o].x=i.x,t[o].y=i.y),a.push(i)}if(this.shelves.length>0){for(var s=0,l=0,u=0;u<this.shelves.length;u++){var c=this.shelves[u];l+=c.h,s=Math.max(c.w-c.free,s)}this.resize(s,l)}return a},t.prototype.packOne=function(t,r){for(var n,i,a=0,o={shelf:-1,waste:1/0},s=0;s<this.shelves.length;s++){if(n=this.shelves[s],a+=n.h,r===n.h&&t<=n.free)return this.count(r),n.alloc(t,r);r>n.h||t>n.free||r<n.h&&t<=n.free&&(i=n.h-r,i<o.waste&&(o.waste=i,o.shelf=s))}if(o.shelf!==-1)return n=this.shelves[o.shelf],this.count(r),n.alloc(t,r);if(r<=this.h-a&&t<=this.w)return n=new e(a,this.w,r),this.shelves.push(n),this.count(r),n.alloc(t,r);if(this.autoResize){var l,u,c,h;return l=u=this.h,c=h=this.w,(c<=l||t>c)&&(h=2*Math.max(t,c)),(l<c||r>l)&&(u=2*Math.max(r,l)),this.resize(h,u),this.packOne(t,r)}return null},t.prototype.clear=function(){this.shelves=[],this.stats={}},t.prototype.resize=function(t,e){this.w=t,this.h=e;for(var r=0;r<this.shelves.length;r++)this.shelves[r].resize(t);return!0},e.prototype.alloc=function(t,e){if(t>this.free||e>this.h)return null;var r=this.x;return this.x+=t,this.free-=t,{x:r,y:this.y,w:t,h:e,width:t,height:e}},e.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0},t})},{}],478:[function(t,e,r){"use strict";e.exports=function(t){return t<0?-1:t>0?1:0}},{}],479:[function(t,e,r){"use strict";function n(t){return a(i(t))}e.exports=n;var i=t("boundary-cells"),a=t("reduce-simplicial-complex")},{"boundary-cells":58,"reduce-simplicial-complex":462}],480:[function(t,e,r){"use strict";function n(t){for(var e=t.length,r=0,n=0;n<e;++n)r=0|Math.max(r,t[n].length);return r-1}function i(t,e){for(var r=t.length,n=h.mallocUint8(r),i=0;i<r;++i)n[i]=t[i]<e|0;return n}function a(t,e){for(var r=t.length,n=e*(e+1)/2*r|0,i=h.mallocUint32(2*n),a=0,o=0;o<r;++o)for(var s=t[o],e=s.length,l=0;l<e;++l)for(var u=0;u<l;++u){var d=s[u],p=s[l];i[a++]=0|Math.min(d,p),i[a++]=0|Math.max(d,p)}var m=a/2|0;f(c(i,[m,2]));for(var g=2,o=2;o<a;o+=2)i[o-2]===i[o]&&i[o-1]===i[o+1]||(i[g++]=i[o],i[g++]=i[o+1]);return c(i,[g/2|0,2])}function o(t,e,r,n){for(var i=t.data,a=t.shape[0],o=h.mallocDouble(a),s=0,l=0;l<a;++l){var u=i[2*l],f=i[2*l+1];if(r[u]!==r[f]){var d=e[u],p=e[f];i[2*s]=u,i[2*s+1]=f,o[s++]=(p-n)/(p-d)}}return t.shape[0]=s,c(o,[s])}function s(t,e){var r=h.mallocInt32(2*e),n=t.shape[0],i=t.data;r[0]=0;for(var a=0,o=0;o<n;++o){var s=i[2*o];if(s!==a){for(r[2*a+1]=o;++a<s;)r[2*a]=o,r[2*a+1]=o;r[2*a]=o}}for(r[2*a+1]=n;++a<e;)r[2*a]=r[2*a+1]=n;return r}function l(t){for(var e=0|t.shape[0],r=t.data,n=new Array(e),i=0;i<e;++i)n[i]=[r[2*i],r[2*i+1]];return n}function u(t,e,r,u){r=r||0,"undefined"==typeof u&&(u=n(t));var c=t.length;if(0===c||u<1)return{cells:[],vertexIds:[],vertexWeights:[]};var f=i(e,+r),p=a(t,u),m=o(p,e,f,+r),g=s(p,0|e.length),v=d(u)(t,p.data,g,f),y=l(p),x=[].slice.call(m.data,0,m.shape[0]);return h.free(f),h.free(p.data),h.free(m.data),h.free(g),{cells:v,vertexIds:y,vertexWeights:x}}e.exports=u;var c=t("ndarray"),h=t("typedarray-pool"),f=t("ndarray-sort"),d=t("./lib/codegen")},{"./lib/codegen":481,ndarray:432,"ndarray-sort":430,"typedarray-pool":502}],481:[function(t,e,r){"use strict";function n(t){function e(t){if(!(t.length<=0)){u.push("R.push(");for(var e=0;e<t.length;++e){var r=t[e];e>0&&u.push(","),u.push("[");for(var n=0;n<r.length;++n){var i=r[n];n>0&&u.push(","),u.push("B(C,E,c[",i[0],"],c[",i[1],"])")}u.push("]")}u.push(");")}}var r=0,n=new Array(t+1);n[0]=[[]];for(var i=1;i<=t;++i)for(var s=n[i]=o(i),l=0;l<s.length;++l)r=Math.max(r,s[i].length);for(var u=["function B(C,E,i,j){","var a=Math.min(i,j)|0,b=Math.max(i,j)|0,l=C[2*a],h=C[2*a+1];","while(l<h){","var m=(l+h)>>1,v=E[2*m+1];","if(v===b){return m}","if(b<v){h=m}else{l=m+1}","}","return l;","};","function getContour",t,"d(F,E,C,S){","var n=F.length,R=[];","for(var i=0;i<n;++i){var c=F[i],l=c.length;"],i=t+1;i>1;--i){i<t+1&&u.push("else "),u.push("if(l===",i,"){");for(var c=[],l=0;l<i;++l)c.push("(S[c["+l+"]]<<"+l+")");u.push("var M=",c.join("+"),";if(M===0||M===",(1<<i)-1,"){continue}switch(M){");for(var s=n[i-1],l=0;l<s.length;++l)u.push("case ",l,":"),e(s[l]),u.push("break;");u.push("}}")}u.push("}return R;};return getContour",t,"d");var h=new Function("pool",u.join(""));return h(a)}function i(t){var e=s[t];return e||(e=s[t]=n(t)),e}e.exports=i;var a=t("typedarray-pool"),o=t("marching-simplex-table"),s={}},{"marching-simplex-table":411,"typedarray-pool":502}],482:[function(t,e,r){"use strict";"use restrict";function n(t){for(var e=0,r=Math.max,n=0,i=t.length;n<i;++n)e=r(e,t[n].length);return e-1}function i(t){for(var e=-1,r=Math.max,n=0,i=t.length;n<i;++n)for(var a=t[n],o=0,s=a.length;o<s;++o)e=r(e,a[o]);return e+1}function a(t){for(var e=new Array(t.length),r=0,n=t.length;r<n;++r)e[r]=t[r].slice(0);return e}function o(t,e){var r=t.length,n=t.length-e.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:var a=t[0]+t[1]-e[0]-e[1];return a?a:i(t[0],t[1])-i(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(a=o+t[2]-(s+e[2]))return a;var l=i(t[0],t[1]),u=i(e[0],e[1]),a=i(l,t[2])-i(u,e[2]);return a?a:i(l+t[2],o)-i(u+e[2],s);default:var c=t.slice(0);c.sort();var h=e.slice(0);h.sort();for(var f=0;f<r;++f)if(n=c[f]-h[f])return n;return 0}}function s(t,e){return o(t[0],e[0])}function l(t,e){if(e){for(var r=t.length,n=new Array(r),i=0;i<r;++i)n[i]=[t[i],e[i]];n.sort(s);for(var i=0;i<r;++i)t[i]=n[i][0],e[i]=n[i][1];return t}return t.sort(o),t}function u(t){if(0===t.length)return[];for(var e=1,r=t.length,n=1;n<r;++n){var i=t[n];if(o(i,t[n-1])){if(n===e){e++;continue}t[e++]=i}}return t.length=e,t}function c(t,e){for(var r=0,n=t.length-1,i=-1;r<=n;){var a=r+n>>1,s=o(t[a],e);s<=0?(0===s&&(i=a),r=a+1):s>0&&(n=a-1)}return i}function h(t,e){for(var r=new Array(t.length),n=0,i=r.length;n<i;++n)r[n]=[];for(var a=[],n=0,s=e.length;n<s;++n)for(var l=e[n],u=l.length,h=1,f=1<<u;h<f;++h){a.length=x.popCount(h);for(var d=0,p=0;p<u;++p)h&1<<p&&(a[d++]=l[p]);var m=c(t,a);if(!(m<0))for(;;)if(r[m++].push(n),m>=t.length||0!==o(t[m],a))break}return r}function f(t,e){if(!e)return h(u(p(t,0)),t,0);for(var r=new Array(e),n=0;n<e;++n)r[n]=[];for(var n=0,i=t.length;n<i;++n)for(var a=t[n],o=0,s=a.length;o<s;++o)r[a[o]].push(n);return r}function d(t){for(var e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0|i.length,o=1,s=1<<a;o<s;++o){for(var u=[],c=0;c<a;++c)o>>>c&1&&u.push(i[c]);e.push(u)}return l(e)}function p(t,e){if(e<0)return[];for(var r=[],n=(1<<e+1)-1,i=0;i<t.length;++i)for(var a=t[i],o=n;o<1<<a.length;o=x.nextCombination(o)){for(var s=new Array(e+1),u=0,c=0;c<a.length;++c)o&1<<c&&(s[u++]=a[c]);r.push(s)}return l(r)}function m(t){for(var e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,o=i.length;a<o;++a){for(var s=new Array(i.length-1),u=0,c=0;u<o;++u)u!==a&&(s[c++]=i[u]);e.push(s)}return l(e)}function g(t,e){for(var r=new b(e),n=0;n<t.length;++n)for(var i=t[n],a=0;a<i.length;++a)for(var o=a+1;o<i.length;++o)r.link(i[a],i[o]);for(var s=[],l=r.ranks,n=0;n<l.length;++n)l[n]=-1;for(var n=0;n<t.length;++n){var u=r.find(t[n][0]);l[u]<0?(l[u]=s.length,s.push([t[n].slice(0)])):s[l[u]].push(t[n].slice(0))}return s}function v(t){for(var e=u(l(p(t,0))),r=new b(e.length),n=0;n<t.length;++n)for(var i=t[n],a=0;a<i.length;++a)for(var o=c(e,[i[a]]),s=a+1;s<i.length;++s)r.link(o,c(e,[i[s]]));for(var h=[],f=r.ranks,n=0;n<f.length;++n)f[n]=-1;for(var n=0;n<t.length;++n){var d=r.find(c(e,[t[n][0]]));f[d]<0?(f[d]=h.length,h.push([t[n].slice(0)])):h[f[d]].push(t[n].slice(0))}return h}function y(t,e){return e?g(t,e):v(t)}var x=t("bit-twiddle"),b=t("union-find");r.dimension=n,r.countVertices=i,r.cloneCells=a,r.compareCells=o,r.normalize=l,r.unique=u,r.findCell=c,r.incidence=h,r.dual=f,r.explode=d,r.skeleton=p,r.boundary=m,r.connectedComponents=y},{"bit-twiddle":56,"union-find":503}],483:[function(t,e,r){arguments[4][56][0].apply(r,arguments)},{dup:56}],484:[function(t,e,r){arguments[4][482][0].apply(r,arguments)},{"bit-twiddle":483,dup:482,"union-find":485}],485:[function(t,e,r){"use strict";"use restrict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e<t;++e)this.roots[e]=e,this.ranks[e]=0}e.exports=n,n.prototype.length=function(){return this.roots.length},n.prototype.makeSet=function(){var t=this.roots.length;return this.roots.push(t),this.ranks.push(0),t},n.prototype.find=function(t){for(var e=this.roots;e[t]!==t;){var r=e[t];e[t]=e[r],t=r}return t},n.prototype.link=function(t,e){var r=this.find(t),n=this.find(e);if(r!==n){var i=this.ranks,a=this.roots,o=i[r],s=i[n];o<s?a[r]=n:s<o?a[n]=r:(a[n]=r,++i[r])}}},{}],486:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.abs(a(t,e,r)),i=Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2));return n/i}function i(t,e,r){function i(t){if(b[t])return 1/0;var r=v[t],i=y[t];return r<0||i<0?1/0:n(e[t],e[r],e[i])}function a(t,e){var r=k[t],n=k[e];k[t]=n,k[e]=r,T[r]=e,T[n]=t}function s(t){return x[k[t]]}function l(t){return 1&t?t-1>>1:(t>>1)-1}function u(t){for(var e=s(t);;){var r=e,n=2*t+1,i=2*(t+1),o=t;if(n<S){var l=s(n);l<r&&(o=n,r=l)}if(i<S){var u=s(i);u<r&&(o=i)}if(o===t)return t;a(t,o),t=o}}function c(t){for(var e=s(t);t>0;){var r=l(t);if(r>=0){var n=s(r);if(e<n){a(t,r),t=r;continue}}return t}}function h(){if(S>0){var t=k[0];return a(0,S-1),S-=1,u(0),t}return-1}function f(t,e){var r=k[t];return x[r]===e?t:(x[r]=-(1/0),c(t),h(),x[r]=e,S+=1,c(S-1))}function d(t){if(!b[t]){b[t]=!0;var e=v[t],r=y[t];v[r]>=0&&(v[r]=e),y[e]>=0&&(y[e]=r),T[e]>=0&&f(T[e],i(e)),T[r]>=0&&f(T[r],i(r))}}function p(t,e){if(t[e]<0)return e;var r=e,n=e;do{var i=t[n];if(!b[n]||i<0||i===n)break;if(n=i,i=t[n],!b[n]||i<0||i===n)break;n=i,r=t[r]}while(r!==n);for(var a=e;a!==n;a=t[a])t[a]=n;return n}for(var m=e.length,g=t.length,v=new Array(m),y=new Array(m),x=new Array(m),b=new Array(m),_=0;_<m;++_)v[_]=y[_]=-1,x[_]=1/0,b[_]=!1;for(var _=0;_<g;++_){var w=t[_];if(2!==w.length)throw new Error("Input must be a graph");var M=w[1],A=w[0];y[A]!==-1?y[A]=-2:y[A]=M,v[M]!==-1?v[M]=-2:v[M]=A}for(var k=[],T=new Array(m),_=0;_<m;++_){var E=x[_]=i(_);E<1/0?(T[_]=k.length,k.push(_)):T[_]=-1}for(var S=k.length,_=S>>1;_>=0;--_)u(_);for(;;){var L=h();if(L<0||x[L]>r)break;d(L)}for(var C=[],_=0;_<m;++_)b[_]||(T[_]=C.length,C.push(e[_].slice()));var I=(C.length,[]);return t.forEach(function(t){var e=p(v,t[0]),r=p(y,t[1]);if(e>=0&&r>=0&&e!==r){var n=T[e],i=T[r];n!==i&&I.push([n,i])}}),o.unique(o.normalize(I)),{positions:C,edges:I}}e.exports=i;var a=t("robust-orientation"),o=t("simplicial-complex")},{"robust-orientation":471,"simplicial-complex":484}],487:[function(t,e,r){"use strict";function n(t,e){var r,n;if(e[0][0]<e[1][0])r=e[0],n=e[1];else{if(!(e[0][0]>e[1][0])){var i=Math.min(t[0][1],t[1][1]),o=Math.max(t[0][1],t[1][1]),s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]);return o<s?o-s:i>l?i-l:o-l}r=e[1],n=e[0]}var u,c;t[0][1]<t[1][1]?(u=t[0],c=t[1]):(u=t[1],c=t[0]);var h=a(n,r,u);return h?h:(h=a(n,r,c),h?h:c-n)}function i(t,e){var r,i;if(e[0][0]<e[1][0])r=e[0],i=e[1];else{if(!(e[0][0]>e[1][0]))return n(e,t);r=e[1],i=e[0]}var o,s;if(t[0][0]<t[1][0])o=t[0],s=t[1];else{if(!(t[0][0]>t[1][0]))return-n(t,e);o=t[1],s=t[0]}var l=a(r,i,s),u=a(r,i,o);if(l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;if(l=a(s,o,i),u=a(s,o,r),l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;return i[0]-s[0]}e.exports=i;var a=t("robust-orientation")},{"robust-orientation":471}],488:[function(t,e,r){"use strict";function n(t,e,r){this.slabs=t,this.coordinates=e,this.horizontal=r}function i(t,e){return t.y-e}function a(t,e){for(var r=null;t;){var n,i,o=t.key;o[0][0]<o[1][0]?(n=o[0],i=o[1]):(n=o[1],i=o[0]);var s=h(n,i,e);if(s<0)t=t.left;else if(s>0)if(e[0]!==o[1][0])r=t,t=t.right;else{var l=a(t.right,e);if(l)return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l=a(t.right,e);if(l)return l;t=t.left}}return r}function o(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function s(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}function l(t){for(var e=t.length,r=2*e,i=new Array(r),a=0;a<e;++a){var l=t[a],u=l[0][0]<l[1][0];i[2*a]=new s(l[0][0],l,u,a),i[2*a+1]=new s(l[1][0],l,!u,a)}i.sort(function(t,e){var r=t.x-e.x;return r?r:(r=t.create-e.create,r?r:Math.min(t.segment[0][1],t.segment[1][1])-Math.min(e.segment[0][1],e.segment[1][1]))});for(var h=c(f),d=[],p=[],m=[],a=0;a<r;){for(var g=i[a].x,v=[];a<r;){var y=i[a];if(y.x!==g)break;a+=1,y.segment[0][0]===y.x&&y.segment[1][0]===y.x?y.create&&(y.segment[0][1]<y.segment[1][1]?(v.push(new o(y.segment[0][1],y.index,!0,!0)),v.push(new o(y.segment[1][1],y.index,!1,!1))):(v.push(new o(y.segment[1][1],y.index,!0,!1)),v.push(new o(y.segment[0][1],y.index,!1,!0)))):h=y.create?h.insert(y.segment,y.index):h.remove(y.segment)}d.push(h.root),p.push(g),m.push(v)}return new n(d,p,m)}e.exports=l;var u=t("binary-search-bounds"),c=t("functional-red-black-tree"),h=t("robust-orientation"),f=t("./lib/order-segments"),d=n.prototype;d.castUp=function(t){var e=u.le(this.coordinates,t[0]);if(e<0)return-1;var r=(this.slabs[e],a(this.slabs[e],t)),n=-1;if(r&&(n=r.value),this.coordinates[e]===t[0]){var o=null;if(r&&(o=r.key),e>0){var s=a(this.slabs[e-1],t);s&&(o?f(s.key,o)>0&&(o=s.key,n=s.value):(n=s.value,o=s.key))}var l=this.horizontal[e];if(l.length>0){var c=u.ge(l,t[1],i);if(c<l.length){var d=l[c];if(t[1]===d.y){if(d.closed)return d.index;for(;c<l.length-1&&l[c+1].y===t[1];)if(c+=1,d=l[c],d.closed)return d.index;if(d.y===t[1]&&!d.start){if(c+=1,c>=l.length)return n;d=l[c]}}if(d.start)if(o){var p=h(o[0],o[1],[t[0],d.y]);o[0][0]>o[1][0]&&(p=-p),p>0&&(n=d.index)}else n=d.index;else d.y!==t[1]&&(n=d.index)}}}return n}},{"./lib/order-segments":487,"binary-search-bounds":55,"functional-red-black-tree":109,"robust-orientation":471}],489:[function(t,e,r){"use strict";function n(t,e){var r=u(l(t,e),[e[e.length-1]]);return r[r.length-1]}function i(t,e,r,n){var i=n-e,a=-e/i;a<0?a=0:a>1&&(a=1);for(var o=1-a,s=t.length,l=new Array(s),u=0;u<s;++u)l[u]=a*t[u]+o*r[u];return l}function a(t,e){for(var r=[],a=[],o=n(t[t.length-1],e),s=t[t.length-1],l=t[0],u=0;u<t.length;++u,s=l){l=t[u];var c=n(l,e);if(o<0&&c>0||o>0&&c<0){var h=i(s,c,l,o);r.push(h),a.push(h.slice())}c<0?a.push(l.slice()):c>0?r.push(l.slice()):(r.push(l.slice()),a.push(l.slice())),o=c}return{positive:r,negative:a}}function o(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l<t.length;++l,o=s){s=t[l];var u=n(s,e);(a<0&&u>0||a>0&&u<0)&&r.push(i(o,u,s,a)),u>=0&&r.push(s.slice()),a=u}return r}function s(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l<t.length;++l,o=s){s=t[l];var u=n(s,e);(a<0&&u>0||a>0&&u<0)&&r.push(i(o,u,s,a)),u<=0&&r.push(s.slice()),a=u}return r}var l=t("robust-dot-product"),u=t("robust-sum");e.exports=a,e.exports.positive=o,e.exports.negative=s},{"robust-dot-product":468,"robust-sum":476}],490:[function(e,r,n){!function(e){function r(){var t=arguments[0],e=r.cache;return e[t]&&e.hasOwnProperty(t)||(e[t]=r.parse(t)),r.format.call(null,e[t],arguments)}function i(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function a(t,e){return Array(e+1).join(t)}var o={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};r.format=function(t,e){var n,s,l,u,c,h,f,d=1,p=t.length,m="",g=[],v=!0,y="";for(s=0;s<p;s++)if(m=i(t[s]),"string"===m)g[g.length]=t[s];else if("array"===m){if(u=t[s],u[2])for(n=e[d],l=0;l<u[2].length;l++){if(!n.hasOwnProperty(u[2][l]))throw new Error(r("[sprintf] property '%s' does not exist",u[2][l]));n=n[u[2][l]]}else n=u[1]?e[u[1]]:e[d++];if("function"==i(n)&&(n=n()),o.not_string.test(u[8])&&o.not_json.test(u[8])&&"number"!=i(n)&&isNaN(n))throw new TypeError(r("[sprintf] expecting number but found %s",i(n)));switch(o.number.test(u[8])&&(v=n>=0),u[8]){case"b":n=n.toString(2);break;case"c":n=String.fromCharCode(n);break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,u[6]?parseInt(u[6]):0);break;case"e":n=u[7]?n.toExponential(u[7]):n.toExponential();break;case"f":n=u[7]?parseFloat(n).toFixed(u[7]):parseFloat(n);break;case"g":n=u[7]?parseFloat(n).toPrecision(u[7]):parseFloat(n);break;case"o":n=n.toString(8);break;case"s":n=(n=String(n))&&u[7]?n.substring(0,u[7]):n;break;case"u":n>>>=0;break;case"x":n=n.toString(16);break;case"X":n=n.toString(16).toUpperCase()}o.json.test(u[8])?g[g.length]=n:(!o.number.test(u[8])||v&&!u[3]?y="":(y=v?"+":"-",n=n.toString().replace(o.sign,"")),h=u[4]?"0"===u[4]?"0":u[4].charAt(1):" ",f=u[6]-(y+n).length,c=u[6]&&f>0?a(h,f):"",g[g.length]=u[5]?y+n+c:"0"===h?y+c+n:c+y+n)}return g.join("")},r.cache={},r.parse=function(t){for(var e=t,r=[],n=[],i=0;e;){if(null!==(r=o.text.exec(e)))n[n.length]=r[0];else if(null!==(r=o.modulo.exec(e)))n[n.length]="%";else{if(null===(r=o.placeholder.exec(e)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){i|=1;var a=[],s=r[2],l=[];if(null===(l=o.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a[a.length]=l[1];""!==(s=s.substring(l[0].length));)if(null!==(l=o.key_access.exec(s)))a[a.length]=l[1];else{if(null===(l=o.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");a[a.length]=l[1]}r[2]=a}else i|=2;if(3===i)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n[n.length]=r}e=e.substring(r[0].length)}return n};var s=function(t,e,n){return n=(e||[]).slice(0),n.splice(0,0,t),r.apply(null,n)};"undefined"!=typeof n?(n.sprintf=r,n.vsprintf=s):(e.sprintf=r,e.vsprintf=s,"function"==typeof t&&t.amd&&t(function(){return{sprintf:r,vsprintf:s}}))}("undefined"==typeof window?this:window)},{}],491:[function(t,e,r){"use strict";function n(t){return new i(t)}function i(t){this.options=d(Object.create(this.options),t),this.trees=new Array(this.options.maxZoom+1)}function a(t,e,r,n){return{x:t,y:e,zoom:1/0,id:n,numPoints:r}}function o(t,e){var r=t.geometry.coordinates;return a(u(r[0]),c(r[1]),1,e)}function s(t){return{type:"Feature",properties:l(t),geometry:{type:"Point",coordinates:[h(t.x),f(t.y)]}}}function l(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return{cluster:!0,point_count:e,point_count_abbreviated:r}}function u(t){return t/360+.5}function c(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function h(t){return 360*(t-.5)}function f(t){var e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function d(t,e){for(var r in e)t[r]=e[r];return t}function p(t){return t.x}function m(t){return t.y}var g=t("kdbush");e.exports=n,i.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1},load:function(t){var e=this.options.log;e&&console.time("total time");var r="prepare "+t.length+" points";e&&console.time(r),this.points=t;var n=t.map(o);e&&console.timeEnd(r);for(var i=this.options.maxZoom;i>=this.options.minZoom;i--){var a=+Date.now();this.trees[i+1]=g(n,p,m,this.options.nodeSize,Float32Array),n=this._cluster(n,i),e&&console.log("z%d: %d clusters in %dms",i,n.length,+Date.now()-a)}return this.trees[this.options.minZoom]=g(n,p,m,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var r=this.trees[this._limitZoom(e)],n=r.range(u(t[0]),c(t[3]),u(t[2]),c(t[1])),i=[],a=0;a<n.length;a++){var o=r.points[n[a]];i.push(o.id!==-1?this.points[o.id]:s(o))}return i},getTile:function(t,e,r){var n=this.trees[this._limitZoom(t)],i=Math.pow(2,t),a=this.options.extent,o=this.options.radius,s=o/a,l=(r-s)/i,u=(r+1+s)/i,c={features:[]};return this._addTileFeatures(n.range((e-s)/i,l,(e+1+s)/i,u),n.points,e,r,i,c),0===e&&this._addTileFeatures(n.range(1-s/i,l,1,u),n.points,i,r,i,c),e===i-1&&this._addTileFeatures(n.range(0,l,s/i,u),n.points,-1,r,i,c),c.features.length?c:null},_addTileFeatures:function(t,e,r,n,i,a){for(var o=0;o<t.length;o++){var s=e[t[o]];a.features.push({type:1,geometry:[[Math.round(this.options.extent*(s.x*i-r)),Math.round(this.options.extent*(s.y*i-n))]],tags:s.id!==-1?this.points[s.id].properties:l(s)})}},_limitZoom:function(t){return Math.max(this.options.minZoom,Math.min(t,this.options.maxZoom+1))},_cluster:function(t,e){for(var r=[],n=this.options.radius/(this.options.extent*Math.pow(2,e)),i=0;i<t.length;i++){var o=t[i];if(!(o.zoom<=e)){o.zoom=e;for(var s=this.trees[e+1],l=s.within(o.x,o.y,n),u=!1,c=o.numPoints,h=o.x*c,f=o.y*c,d=0;d<l.length;d++){var p=s.points[l[d]];e<p.zoom&&(u=!0,p.zoom=e,h+=p.x*p.numPoints,f+=p.y*p.numPoints,c+=p.numPoints)}r.push(u?a(h/c,f/c,c,-1):o)}}return r}}},{kdbush:264}],492:[function(t,e,r){"use strict";function n(t){return t.split("").map(function(t){return t in i?i[t]:""}).join("")}e.exports=n;var i={" ":" ",0:"⁰",1:"¹",2:"²",3:"³",4:"⁴",5:"⁵",6:"⁶",7:"⁷",8:"⁸",9:"⁹","+":"⁺","-":"⁻",a:"ᵃ",b:"ᵇ",c:"ᶜ",d:"ᵈ",e:"ᵉ",f:"ᶠ",g:"ᵍ",h:"ʰ",i:"ⁱ",j:"ʲ",k:"ᵏ",l:"ˡ",m:"ᵐ",n:"ⁿ",o:"ᵒ",p:"ᵖ",r:"ʳ",s:"ˢ",t:"ᵗ",u:"ᵘ",v:"ᵛ",w:"ʷ",x:"ˣ",y:"ʸ",z:"ᶻ"}},{}],493:[function(t,e,r){"use strict";function n(t,e){var r=t.length,n=["'use strict';"],i="surfaceNets"+t.join("_")+"d"+e;n.push("var contour=genContour({","order:[",t.join(),"],","scalarArguments: 3,","phase:function phaseFunc(p,a,b,c) { return (p > c)|0 },"),"generic"===e&&n.push("getters:[0],");for(var a=[],l=[],u=0;u<r;++u)a.push("d"+u),l.push("d"+u);for(var u=0;u<1<<r;++u)a.push("v"+u),l.push("v"+u);for(var u=0;u<1<<r;++u)a.push("p"+u),l.push("p"+u);a.push("a","b","c"),l.push("a","c"),n.push("vertex:function vertexFunc(",a.join(),"){");for(var c=[],u=0;u<1<<r;++u)c.push("(p"+u+"<<"+u+")");n.push("var m=(",c.join("+"),")|0;if(m===0||m===",(1<<(1<<r))-1,"){return}");var h=[],f=[];1<<(1<<r)<=128?(n.push("switch(m){"),f=n):n.push("switch(m>>>7){");for(var u=0;u<1<<(1<<r);++u){if(1<<(1<<r)>128&&u%128===0){h.length>0&&f.push("}}");var d="vExtra"+h.length;n.push("case ",u>>>7,":",d,"(m&0x7f,",l.join(),");break;"),f=["function ",d,"(m,",l.join(),"){switch(m){"],h.push(f)}f.push("case ",127&u,":");for(var p=new Array(r),m=new Array(r),g=new Array(r),v=new Array(r),y=0,x=0;x<r;++x)p[x]=[],m[x]=[],g[x]=0,v[x]=0;for(var x=0;x<1<<r;++x)for(var b=0;b<r;++b){var _=x^1<<b;if(!(_>x)&&!(u&1<<_)!=!(u&1<<x)){var w=1;u&1<<_?m[b].push("v"+_+"-v"+x):(m[b].push("v"+x+"-v"+_),w=-w),w<0?(p[b].push("-v"+x+"-v"+_),g[b]+=2):(p[b].push("v"+x+"+v"+_),g[b]-=2),y+=1;for(var M=0;M<r;++M)M!==b&&(_&1<<M?v[M]+=1:v[M]-=1)}}for(var A=[],b=0;b<r;++b)if(0===p[b].length)A.push("d"+b+"-0.5");else{var k="";g[b]<0?k=g[b]+"*c":g[b]>0&&(k="+"+g[b]+"*c");var T=.5*(p[b].length/y),E=.5+.5*(v[b]/y);A.push("d"+b+"-"+E+"-"+T+"*("+p[b].join("+")+k+")/("+m[b].join("+")+")")}f.push("a.push([",A.join(),"]);","break;")}n.push("}},"),h.length>0&&f.push("}}");for(var S=[],u=0;u<1<<r-1;++u)S.push("v"+u);S.push("c0","c1","p0","p1","a","b","c"),n.push("cell:function cellFunc(",S.join(),"){");var L=s(r-1);n.push("if(p0){b.push(",L.map(function(t){return"["+t.map(function(t){return"v"+t})+"]"}).join(),")}else{b.push(",L.map(function(t){var e=t.slice();return e.reverse(),"["+e.map(function(t){return"v"+t})+"]"}).join(),")}}});function ",i,"(array,level){var verts=[],cells=[];contour(array,verts,cells,level);return {positions:verts,cells:cells};} return ",i,";");for(var u=0;u<h.length;++u)n.push(h[u].join(""));var C=new Function("genContour",n.join(""));return C(o)}function i(t,e){for(var r=l(t,e),n=r.length,i=new Array(n),a=new Array(n),o=0;o<n;++o)i[o]=[r[o]],a[o]=[o];return{positions:i,cells:a}}function a(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return i(t,e);var r=t.order.join()+"-"+t.dtype,a=u[r],e=+e||0;return a||(a=u[r]=n(t.order,t.dtype)),a(t,e)}e.exports=a;var o=t("ndarray-extract-contour"),s=t("triangulate-hypercube"),l=t("zero-crossings"),u={}},{"ndarray-extract-contour":421,"triangulate-hypercube":498,"zero-crossings":545}],494:[function(t,e,r){(function(r){"use strict";function n(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),i=0,a=0,o=0;o<e.length;++o)for(var s=e[o],l=0;l<3;++l){var u=r[s[l]];n[i++]=u[0],n[i++]=u[1]+1.4,a=Math.max(u[0],a)}return{data:n,shape:a}}function i(t,e,r){var r=r||{},o=s[t];o||(o=s[t]={" ":{data:new Float32Array(0),shape:.2}});var l=o[e];if(!l)if(e.length<=1||!/\d/.test(e))l=o[e]=n(a(e,{triangles:!0,font:t,textAlign:r.textAlign||"left",textBaseline:"alphabetic"}));else{for(var u=e.split(/(\d|\s)/),c=new Array(u.length),h=0,f=0,d=0;d<u.length;++d)c[d]=i(t,u[d]),h+=c[d].data.length,f+=c[d].shape,d>0&&(f+=.02);for(var p=new Float32Array(h),m=0,g=-.5*f,d=0;d<c.length;++d){for(var v=c[d].data,y=0;y<v.length;y+=2)p[m++]=v[y]+g,p[m++]=v[y+1];g+=c[d].shape+.02}l=o[e]={data:p,shape:f}}return l}e.exports=i;var a=t("vectorize-text"),o=window||r.global||{},s=o.__TEXT_CACHE||{};o.__TEXT_CACHE={}}).call(this,t("_process"))},{_process:451,"vectorize-text":515}],495:[function(e,r,n){!function(e){function n(t,e){if(t=t?t:"",e=e||{},t instanceof n)return t;if(!(this instanceof n))return new n(t,e);var r=i(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=q(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=q(this._r)),this._g<1&&(this._g=q(this._g)),this._b<1&&(this._b=q(this._b)),this._ok=r.ok,this._tc_id=V++}function i(t){var e={r:0,g:0,b:0},r=1,n=null,i=null,o=null,l=!1,c=!1;return"string"==typeof t&&(t=j(t)),"object"==typeof t&&(F(t.r)&&F(t.g)&&F(t.b)?(e=a(t.r,t.g,t.b),l=!0,c="%"===String(t.r).substr(-1)?"prgb":"rgb"):F(t.h)&&F(t.s)&&F(t.v)?(n=P(t.s),i=P(t.v),e=u(t.h,n,i),l=!0,c="hsv"):F(t.h)&&F(t.s)&&F(t.l)&&(n=P(t.s),o=P(t.l),e=s(t.h,n,o),l=!0,c="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=E(r),{ok:l,format:t.format||c,r:H(255,Y(e.r,0)),g:H(255,Y(e.g,0)),b:H(255,Y(e.b,0)),a:r}}function a(t,e,r){return{r:255*S(t,255),g:255*S(e,255),b:255*S(r,255)}}function o(t,e,r){t=S(t,255),e=S(e,255),r=S(r,255);var n,i,a=Y(t,e,r),o=H(t,e,r),s=(a+o)/2;if(a==o)n=i=0;else{var l=a-o;switch(i=s>.5?l/(2-a-o):l/(a+o),a){case t:n=(e-r)/l+(e<r?6:0);break;case e:n=(r-t)/l+2;break;case r:n=(t-e)/l+4}n/=6}return{h:n,s:i,l:s}}function s(t,e,r){function n(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}var i,a,o;if(t=S(t,360),e=S(e,100),r=S(r,100),0===e)i=a=o=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;i=n(l,s,t+1/3),a=n(l,s,t),o=n(l,s,t-1/3)}return{r:255*i,g:255*a,b:255*o}}function l(t,e,r){t=S(t,255),e=S(e,255),r=S(r,255);var n,i,a=Y(t,e,r),o=H(t,e,r),s=a,l=a-o;if(i=0===a?0:l/a,a==o)n=0;else{switch(a){case t:n=(e-r)/l+(e<r?6:0);break;case e:n=(r-t)/l+2;break;case r:n=(t-e)/l+4}n/=6}return{h:n,s:i,v:s}}function u(t,r,n){t=6*S(t,360),r=S(r,100),n=S(n,100);var i=e.floor(t),a=t-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),u=i%6,c=[n,s,o,o,l,n][u],h=[l,n,n,s,o,o][u],f=[o,o,l,n,n,s][u];return{r:255*c,g:255*h,b:255*f}}function c(t,e,r,n){var i=[D(q(t).toString(16)),D(q(e).toString(16)),D(q(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function h(t,e,r,n,i){var a=[D(q(t).toString(16)),D(q(e).toString(16)),D(q(r).toString(16)),D(O(n))];return i&&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[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function f(t,e,r,n){var i=[D(O(n)),D(q(t).toString(16)),D(q(e).toString(16)),D(q(r).toString(16))];return i.join("")}function d(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.s-=e/100,r.s=L(r.s),n(r)}function p(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.s+=e/100,r.s=L(r.s),n(r)}function m(t){return n(t).desaturate(100)}function g(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.l+=e/100,r.l=L(r.l),n(r)}function v(t,e){e=0===e?0:e||10;var r=n(t).toRgb();return r.r=Y(0,H(255,r.r-q(255*-(e/100)))),r.g=Y(0,H(255,r.g-q(255*-(e/100)))),r.b=Y(0,H(255,r.b-q(255*-(e/100)))),n(r)}function y(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.l-=e/100,r.l=L(r.l),n(r)}function x(t,e){var r=n(t).toHsl(),i=(r.h+e)%360;return r.h=i<0?360+i:i,n(r)}function b(t){var e=n(t).toHsl();return e.h=(e.h+180)%360,n(e)}function _(t){var e=n(t).toHsl(),r=e.h;return[n(t),n({h:(r+120)%360,s:e.s,l:e.l}),n({h:(r+240)%360,s:e.s,l:e.l})]}function w(t){var e=n(t).toHsl(),r=e.h;return[n(t),n({h:(r+90)%360,s:e.s,l:e.l}),n({h:(r+180)%360,s:e.s,l:e.l}),n({h:(r+270)%360,s:e.s,l:e.l})]}function M(t){var e=n(t).toHsl(),r=e.h;return[n(t),n({h:(r+72)%360,s:e.s,l:e.l}),n({h:(r+216)%360,s:e.s,l:e.l})]}function A(t,e,r){e=e||6,r=r||30;var i=n(t).toHsl(),a=360/r,o=[n(t)];for(i.h=(i.h-(a*e>>1)+720)%360;--e;)i.h=(i.h+a)%360,o.push(n(i));return o}function k(t,e){e=e||6;for(var r=n(t).toHsv(),i=r.h,a=r.s,o=r.v,s=[],l=1/e;e--;)s.push(n({h:i,s:a,v:o})),o=(o+l)%1;return s}function T(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}function E(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function S(t,r){I(t)&&(t="100%");var n=z(t);return t=H(r,Y(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function L(t){return H(1,Y(0,t))}function C(t){return parseInt(t,16)}function I(t){return"string"==typeof t&&t.indexOf(".")!=-1&&1===parseFloat(t)}function z(t){return"string"==typeof t&&t.indexOf("%")!=-1}function D(t){return 1==t.length?"0"+t:""+t}function P(t){return t<=1&&(t=100*t+"%"),t}function O(t){return e.round(255*parseFloat(t)).toString(16)}function R(t){return C(t)/255}function F(t){return!!Z.CSS_UNIT.exec(t)}function j(t){t=t.replace(B,"").replace(U,"").toLowerCase();var e=!1;if(X[t])t=X[t],e=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=Z.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=Z.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=Z.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=Z.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=Z.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=Z.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=Z.hex8.exec(t))?{r:C(r[1]),g:C(r[2]),b:C(r[3]),a:R(r[4]),format:e?"name":"hex8"}:(r=Z.hex6.exec(t))?{r:C(r[1]),g:C(r[2]),b:C(r[3]),format:e?"name":"hex"}:(r=Z.hex4.exec(t))?{r:C(r[1]+""+r[1]),g:C(r[2]+""+r[2]),b:C(r[3]+""+r[3]),a:R(r[4]+""+r[4]),format:e?"name":"hex8"}:!!(r=Z.hex3.exec(t))&&{r:C(r[1]+""+r[1]),g:C(r[2]+""+r[2]),b:C(r[3]+""+r[3]),format:e?"name":"hex"}}function N(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}var B=/^\s+/,U=/\s+$/,V=0,q=e.round,H=e.min,Y=e.max,G=e.random;n.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 t,r,n,i,a,o,s=this.toRgb();return t=s.r/255,r=s.g/255,n=s.b/255,i=t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4),a=r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4),o=n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4),.2126*i+.7152*a+.0722*o},setAlpha:function(t){return this._a=E(t),this._roundA=q(100*this._a)/100,this},toHsv:function(){var t=l(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=l(this._r,this._g,this._b),e=q(360*t.h),r=q(100*t.s),n=q(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=o(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=o(this._r,this._g,this._b),e=q(360*t.h),r=q(100*t.s),n=q(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return c(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return h(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:q(this._r),g:q(this._g),b:q(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+q(this._r)+", "+q(this._g)+", "+q(this._b)+")":"rgba("+q(this._r)+", "+q(this._g)+", "+q(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:q(100*S(this._r,255))+"%",g:q(100*S(this._g,255))+"%",b:q(100*S(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+q(100*S(this._r,255))+"%, "+q(100*S(this._g,255))+"%, "+q(100*S(this._b,255))+"%)":"rgba("+q(100*S(this._r,255))+"%, "+q(100*S(this._g,255))+"%, "+q(100*S(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(W[c(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+f(this._r,this._g,this._b,this._a),r=e,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=n(t);r="#"+f(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0,i=!e&&n&&("hex"===t||"hex6"===t||"hex3"===t||"hex4"===t||"hex8"===t||"name"===t);return i?"name"===t&&0===this._a?this.toName():this.toRgbString():("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return n(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(g,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(y,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(p,arguments)},greyscale:function(){return this._applyModification(m,arguments)},spin:function(){return this._applyModification(x,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(b,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(_,arguments)},tetrad:function(){return this._applyCombination(w,arguments)}},n.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var i in t)t.hasOwnProperty(i)&&("a"===i?r[i]=t[i]:r[i]=P(t[i]));t=r}return n(t,e)},n.equals=function(t,e){return!(!t||!e)&&n(t).toRgbString()==n(e).toRgbString()},n.random=function(){return n.fromRatio({r:G(),g:G(),b:G()})},n.mix=function(t,e,r){r=0===r?0:r||50;var i=n(t).toRgb(),a=n(e).toRgb(),o=r/100,s={r:(a.r-i.r)*o+i.r,g:(a.g-i.g)*o+i.g,b:(a.b-i.b)*o+i.b,a:(a.a-i.a)*o+i.a};return n(s)},n.readability=function(t,r){var i=n(t),a=n(r);return(e.max(i.getLuminance(),a.getLuminance())+.05)/(e.min(i.getLuminance(),a.getLuminance())+.05)},n.isReadable=function(t,e,r){var i,a,o=n.readability(t,e);switch(a=!1,i=N(r),i.level+i.size){case"AAsmall":case"AAAlarge":a=o>=4.5;break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7}return a},n.mostReadable=function(t,e,r){var i,a,o,s,l=null,u=0;r=r||{},a=r.includeFallbackColors,o=r.level,s=r.size;for(var c=0;c<e.length;c++)i=n.readability(t,e[c]),i>u&&(u=i,l=n(e[c]));return n.isReadable(t,l,{level:o,size:s})||!a?l:(r.includeFallbackColors=!1,n.mostReadable(t,["#fff","#000"],r))};var X=n.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"},W=n.hexNames=T(X),Z=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",r="(?:"+e+")|(?:"+t+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),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})$/}}();"undefined"!=typeof r&&r.exports?r.exports=n:"function"==typeof t&&t.amd?t(function(){return n}):window.tinycolor=n}(Math)},{}],496:[function(t,e,r){"use strict";function n(t,e){var r=o(getComputedStyle(t).getPropertyValue(e));return r[0]*a(r[1],t)}function i(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var i=n(r,"font-size")/128;return e.removeChild(r),i}function a(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),e!==window&&e!==document||(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return i(t,e);case"em":return n(e,"font-size");case"rem":return n(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return s;case"cm":return s/2.54;case"mm":return s/25.4;case"pt":return s/72;case"pc":return s/6}return 1}var o=t("parse-unit");e.exports=a;var s=96},{"parse-unit":439}],497:[function(e,r,n){!function(e,i){"object"==typeof n&&"undefined"!=typeof r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.topojson=e.topojson||{})}(this,function(t){"use strict";function e(t,e){var n=e.id,i=e.bbox,a=null==e.properties?{}:e.properties,o=r(t,e);return null==n&&null==i?{type:"Feature",properties:a,geometry:o}:null==i?{type:"Feature",id:n,properties:a,geometry:o}:{type:"Feature",id:n,bbox:i,properties:a,geometry:o}}function r(t,e){function r(t,e){e.length&&e.pop();for(var r=h[t<0?~t:t],n=0,i=r.length;n<i;++n)e.push(u(r[n].slice(),n));t<0&&c(e,i)}function n(t){return u(t.slice())}function i(t){for(var e=[],n=0,i=t.length;n<i;++n)r(t[n],e);return e.length<2&&e.push(e[0].slice()),e}function a(t){for(var e=i(t);e.length<4;)e.push(e[0].slice());return e}function o(t){return t.map(a)}function s(t){var e,r=t.type;switch(r){case"GeometryCollection":return{type:r,geometries:t.geometries.map(s)};case"Point":e=n(t.coordinates);break;case"MultiPoint":e=t.coordinates.map(n);break;case"LineString":e=i(t.arcs);break;case"MultiLineString":e=t.arcs.map(i);break;case"Polygon":e=o(t.arcs);break;case"MultiPolygon":e=t.arcs.map(o);break;default:return null}return{type:r,coordinates:e}}var u=l(t),h=t.arcs;return s(e)}function n(t,e,r){var n,a,o;if(arguments.length>1)n=i(t,e,r);else for(a=0,n=new Array(o=t.arcs.length);a<o;++a)n[a]=a;return{type:"MultiLineString",arcs:f(t,n)}}function i(t,e,r){function n(t){var e=t<0?~t:t;(c[e]||(c[e]=[])).push({i:t,g:l})}function i(t){t.forEach(n)}function a(t){t.forEach(i)}function o(t){t.forEach(a)}function s(t){switch(l=t,t.type){case"GeometryCollection":t.geometries.forEach(s);break;case"LineString":i(t.arcs);break;case"MultiLineString":case"Polygon":a(t.arcs);break;case"MultiPolygon":o(t.arcs)}}var l,u=[],c=[];return s(e),c.forEach(null==r?function(t){u.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&u.push(t[0].i)}),u}function a(t){for(var e,r=-1,n=t.length,i=t[n-1],a=0;++r<n;)e=i,i=t[r],a+=e[0]*i[1]-e[1]*i[0];return Math.abs(a)}function o(t,e){function n(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(n);break;case"Polygon":i(t.arcs);break;case"MultiPolygon":t.arcs.forEach(i)}}function i(t){t.forEach(function(e){e.forEach(function(e){(s[e=e<0?~e:e]||(s[e]=[])).push(t)})}),l.push(t)}function o(e){return a(r(t,{type:"Polygon",arcs:[e]}).coordinates[0])}var s={},l=[],u=[];return e.forEach(n),l.forEach(function(t){if(!t._){var e=[],r=[t];for(t._=1,u.push(e);t=r.pop();)e.push(t),t.forEach(function(t){t.forEach(function(t){s[t<0?~t:t].forEach(function(t){t._||(t._=1,r.push(t))})})})}}),l.forEach(function(t){delete t._}),{type:"MultiPolygon",arcs:u.map(function(e){var r,n=[];if(e.forEach(function(t){t.forEach(function(t){t.forEach(function(t){s[t<0?~t:t].length<2&&n.push(t)})})}),n=f(t,n),(r=n.length)>1)for(var i,a,l=1,u=o(n[0]);l<r;++l)(i=o(n[l]))>u&&(a=n[0],n[0]=n[l],n[l]=a,u=i);return n})}}var s=function(t){return t},l=function(t){if(null==(e=t.transform))return s;var e,r,n,i=e.scale[0],a=e.scale[1],o=e.translate[0],l=e.translate[1];return function(t,e){return e||(r=n=0),t[0]=(r+=t[0])*i+o,t[1]=(n+=t[1])*a+l,t}},u=function(t){function e(t){s[0]=t[0],s[1]=t[1],o(s),s[0]<u&&(u=s[0]),s[0]>h&&(h=s[0]),s[1]<c&&(c=s[1]),s[1]>f&&(f=s[1])}function r(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(r);break;case"Point":e(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(e)}}var n=t.bbox;if(!n){var i,a,o=l(t),s=new Array(2),u=1/0,c=u,h=-u,f=-u;t.arcs.forEach(function(t){for(var e=-1,r=t.length;++e<r;)i=t[e],s[0]=i[0],s[1]=i[1],o(s,e),s[0]<u&&(u=s[0]),s[0]>h&&(h=s[0]),s[1]<c&&(c=s[1]),s[1]>f&&(f=s[1])});for(a in t.objects)r(t.objects[a]);n=t.bbox=[u,c,h,f]}return n},c=function(t,e){for(var r,n=t.length,i=n-e;i<--n;)r=t[i],t[i++]=t[n],t[n]=r},h=function(t,r){return"GeometryCollection"===r.type?{type:"FeatureCollection",features:r.geometries.map(function(r){return e(t,r)})}:e(t,r)},f=function(t,e){function r(e){var r,n=t.arcs[e<0?~e:e],i=n[0];return t.transform?(r=[0,0],n.forEach(function(t){r[0]+=t[0],r[1]+=t[1]})):r=n[n.length-1],e<0?[r,i]:[i,r]}function n(t,e){for(var r in t){var n=t[r];delete e[n.start],delete n.start,delete n.end,n.forEach(function(t){i[t<0?~t:t]=1}),s.push(n)}}var i={},a={},o={},s=[],l=-1;return e.forEach(function(r,n){var i,a=t.arcs[r<0?~r:r];a.length<3&&!a[1][0]&&!a[1][1]&&(i=e[++l],e[l]=r,e[n]=i)}),e.forEach(function(t){var e,n,i=r(t),s=i[0],l=i[1];if(e=o[s])if(delete o[e.end],e.push(t),e.end=l,n=a[l]){delete a[n.start];var u=n===e?e:e.concat(n);a[u.start=e.start]=o[u.end=n.end]=u}else a[e.start]=o[e.end]=e;else if(e=a[l])if(delete a[e.start],e.unshift(t),e.start=s,n=o[s]){delete o[n.end];var c=n===e?e:n.concat(e);a[c.start=n.start]=o[c.end=e.end]=c}else a[e.start]=o[e.end]=e;else e=[t],a[e.start=s]=o[e.end=l]=e}),n(o,a),n(a,o),e.forEach(function(t){i[t<0?~t:t]||s.push([t])}),s},d=function(t){return r(t,n.apply(this,arguments))},p=function(t){return r(t,o.apply(this,arguments))},m=function(t,e){for(var r=0,n=t.length;r<n;){var i=r+n>>>1;t[i]<e?r=i+1:n=i}return r},g=function(t){function e(t,e){t.forEach(function(t){t<0&&(t=~t);var r=i[t];r?r.push(e):i[t]=[e]})}function r(t,r){t.forEach(function(t){e(t,r)})}function n(t,e){"GeometryCollection"===t.type?t.geometries.forEach(function(t){n(t,e)}):t.type in o&&o[t.type](t.arcs,e)}var i={},a=t.map(function(){return[]}),o={LineString:e,MultiLineString:r,Polygon:r,MultiPolygon:function(t,e){t.forEach(function(t){r(t,e)})}};t.forEach(n);for(var s in i)for(var l=i[s],u=l.length,c=0;c<u;++c)for(var h=c+1;h<u;++h){var f,d=l[c],p=l[h];(f=a[d])[s=m(f,p)]!==p&&f.splice(s,0,p),(f=a[p])[s=m(f,d)]!==d&&f.splice(s,0,d)}return a},v=function(t,e){function r(t){t[0]=Math.round((t[0]-o)/s),t[1]=Math.round((t[1]-l)/c)}function n(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(n);break;case"Point":r(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(r)}}if(!((e=Math.floor(e))>=2))throw new Error("n must be ≥2");if(t.transform)throw new Error("already quantized");var i,a=u(t),o=a[0],s=(a[2]-o)/(e-1)||1,l=a[1],c=(a[3]-l)/(e-1)||1;t.arcs.forEach(function(t){for(var e,r,n,i=1,a=1,u=t.length,h=t[0],f=h[0]=Math.round((h[0]-o)/s),d=h[1]=Math.round((h[1]-l)/c);i<u;++i)h=t[i],r=Math.round((h[0]-o)/s),n=Math.round((h[1]-l)/c),r===f&&n===d||(e=t[a++],e[0]=r-f,f=r,e[1]=n-d,d=n);a<2&&(e=t[a++],e[0]=0,e[1]=0),t.length=a});for(i in t.objects)n(t.objects[i]);return t.transform={scale:[s,c],translate:[o,l]},t},y=function(t){if(null==(e=t.transform))return s;var e,r,n,i=e.scale[0],a=e.scale[1],o=e.translate[0],l=e.translate[1];return function(t,e){e||(r=n=0);var s=Math.round((t[0]-o)/i),u=Math.round((t[1]-l)/a);return t[0]=s-r,r=s,t[1]=u-n,n=u,t}};t.bbox=u,t.feature=h,t.mesh=d,t.meshArcs=n,t.merge=p,t.mergeArcs=o,t.neighbors=g,t.quantize=v,t.transform=l,t.untransform=y,Object.defineProperty(t,"__esModule",{value:!0})})},{}],498:[function(t,e,r){"use strict";function n(t){if(t<0)return[];if(0===t)return[[0]];for(var e=0|Math.round(o(t+1)),r=[],n=0;n<e;++n){for(var s=i.unrank(t,n),l=[0],u=0,c=0;c<s.length;++c)u+=1<<s[c],l.push(u);a(s)<1&&(l[0]=u,l[t]=0),r.push(l)}return r}e.exports=n;var i=t("permutation-rank"),a=t("permutation-parity"),o=t("gamma")},{gamma:110,"permutation-parity":443,"permutation-rank":444}],499:[function(t,e,r){"use strict";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t){return Math.min(1,Math.max(-1,t))}function a(t){var e=Math.abs(t[0]),r=Math.abs(t[1]),n=Math.abs(t[2]),i=[0,0,0];e>Math.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,s=0;s<3;++s)a+=t[s]*t[s],o+=i[s]*t[s];for(var s=0;s<3;++s)i[s]-=o/a*t[s];return f(i,i),i}function o(t,e,r,n,i,a,o,s){this.center=l(r),this.up=l(n),this.right=l(i),this.radius=l([a]),this.angle=l([o,s]),this.angle.bounds=[[-(1/0),-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var u=0;u<16;++u)this.computedMatrix[u]=.5;this.recalcMatrix(0)}function s(t){t=t||{};var e=t.center||[0,0,0],r=t.up||[0,1,0],i=t.right||a(r),s=t.radius||1,l=t.theta||0,u=t.phi||0;if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),f(r,r),i=[].slice.call(i,0,3),f(i,i),"eye"in t){var c=t.eye,p=[c[0]-e[0],c[1]-e[1],c[2]-e[2]];h(i,p,r),n(i[0],i[1],i[2])<1e-6?i=a(r):f(i,i),s=n(p[0],p[1],p[2]);var m=d(r,p)/s,g=d(i,p)/s;u=Math.acos(m),l=Math.acos(g)}return s=Math.log(s),new o(t.zoomMin,t.zoomMax,e,r,i,s,l,u)}e.exports=s;var l=t("filtered-vector"),u=t("gl-mat4/invert"),c=t("gl-mat4/rotate"),h=t("gl-vec3/cross"),f=t("gl-vec3/normalize"),d=t("gl-vec3/dot"),p=o.prototype;p.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-(1/0),e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},p.getDistanceLimits=function(t){var e=this.radius.bounds[0];return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},p.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,i=0,a=0,o=0;o<3;++o)a+=e[o]*r[o],i+=e[o]*e[o];for(var s=Math.sqrt(i),l=0,o=0;o<3;++o)r[o]-=e[o]*a/i,l+=r[o]*r[o],e[o]/=s;for(var u=Math.sqrt(l),o=0;o<3;++o)r[o]/=u;var c=this.computedToward;h(c,e,r),f(c,c);for(var d=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],m=this.computedAngle[1],g=Math.cos(p),v=Math.sin(p),y=Math.cos(m),x=Math.sin(m),b=this.computedCenter,_=g*y,w=v*y,M=x,A=-g*x,k=-v*x,T=y,E=this.computedEye,S=this.computedMatrix,o=0;o<3;++o){var L=_*r[o]+w*c[o]+M*e[o];S[4*o+1]=A*r[o]+k*c[o]+T*e[o],S[4*o+2]=L,S[4*o+3]=0}var C=S[1],I=S[5],z=S[9],D=S[2],P=S[6],O=S[10],R=I*O-z*P,F=z*D-C*O,j=C*P-I*D,N=n(R,F,j);R/=N,F/=N,j/=N,S[0]=R,S[4]=F,S[8]=j;for(var o=0;o<3;++o)E[o]=b[o]+S[2+4*o]*d;for(var o=0;o<3;++o){for(var l=0,B=0;B<3;++B)l+=S[o+4*B]*E[B];S[12+o]=-l}S[15]=1},p.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r};var m=[0,0,0];p.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;m[0]=i[2],m[1]=i[6],m[2]=i[10];for(var a=this.computedUp,o=this.computedRight,s=this.computedToward,l=0;l<3;++l)i[4*l]=a[l],i[4*l+1]=o[l],i[4*l+2]=s[l];c(i,i,n,m);for(var l=0;l<3;++l)a[l]=i[4*l],o[l]=i[4*l+1];this.up.set(t,a[0],a[1],a[2]),this.right.set(t,o[0],o[1],o[2])}},p.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=(Math.exp(this.computedRadius[0]),a[1]),s=a[5],l=a[9],u=n(o,s,l);o/=u,s/=u,l/=u;var c=a[0],h=a[4],f=a[8],d=c*o+h*s+f*l;c-=o*d,h-=s*d,f-=l*d;var p=n(c,h,f);c/=p,h/=p,f/=p;var m=c*e+o*r,g=h*e+s*r,v=f*e+l*r;this.center.move(t,m,g,v);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+i),this.radius.set(t,Math.log(y))},p.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},p.setMatrix=function(t,e,r,a){var o=1;"number"==typeof r&&(o=0|r),(o<0||o>3)&&(o=1);var s=(o+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var l=e[o],c=e[o+4],h=e[o+8];if(a){var f=Math.abs(l),d=Math.abs(c),p=Math.abs(h),m=Math.max(f,d,p);f===m?(l=l<0?-1:1,c=h=0):p===m?(h=h<0?-1:1,l=c=0):(c=c<0?-1:1,l=h=0)}else{var g=n(l,c,h);l/=g,c/=g,h/=g}var v=e[s],y=e[s+4],x=e[s+8],b=v*l+y*c+x*h;v-=l*b,y-=c*b,x-=h*b;var _=n(v,y,x);v/=_,y/=_,x/=_;var w=c*x-h*y,M=h*v-l*x,A=l*y-c*v,k=n(w,M,A);w/=k,M/=k,A/=k,this.center.jump(t,H,Y,G),this.radius.idle(t),this.up.jump(t,l,c,h),this.right.jump(t,v,y,x);var T,E;if(2===o){var S=e[1],L=e[5],C=e[9],I=S*v+L*y+C*x,z=S*w+L*M+C*A;T=R<0?-Math.PI/2:Math.PI/2,E=Math.atan2(z,I)}else{var D=e[2],P=e[6],O=e[10],R=D*l+P*c+O*h,F=D*v+P*y+O*x,j=D*w+P*M+O*A;T=Math.asin(i(R)),E=Math.atan2(j,F)}this.angle.jump(t,E,T),this.recalcMatrix(t);var N=e[2],B=e[6],U=e[10],V=this.computedMatrix;u(V,e);var q=V[15],H=V[12]/q,Y=V[13]/q,G=V[14]/q,X=Math.exp(this.computedRadius[0]);this.center.jump(t,H-N*X,Y-B*X,G-U*X)},p.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},p.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},p.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},p.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},p.lookAt=function(t,e,r,a){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter,a=a||this.computedUp;var o=a[0],s=a[1],l=a[2],u=n(o,s,l);if(!(u<1e-6)){o/=u,s/=u,l/=u;var c=e[0]-r[0],h=e[1]-r[1],f=e[2]-r[2],d=n(c,h,f);if(!(d<1e-6)){c/=d,h/=d,f/=d;var p=this.computedRight,m=p[0],g=p[1],v=p[2],y=o*m+s*g+l*v;m-=y*o,g-=y*s,v-=y*l;var x=n(m,g,v);if(!(x<.01&&(m=s*f-l*h,g=l*c-o*f,v=o*h-s*c,x=n(m,g,v),x<1e-6))){m/=x,g/=x,v/=x,this.up.set(t,o,s,l),this.right.set(t,m,g,v),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(d));var b=s*v-l*g,_=l*m-o*v,w=o*g-s*m,M=n(b,_,w);b/=M,_/=M,w/=M;var A=o*c+s*h+l*f,k=m*c+g*h+v*f,T=b*c+_*h+w*f,E=Math.asin(i(A)),S=Math.atan2(T,k),L=this.angle._state,C=L[L.length-1],I=L[L.length-2];C%=2*Math.PI;var z=Math.abs(C+2*Math.PI-S),D=Math.abs(C-S),P=Math.abs(C-2*Math.PI-S);z<D&&(C+=2*Math.PI),P<D&&(C-=2*Math.PI),this.angle.jump(this.angle.lastT(),C,I),this.angle.set(t,S,E)}}}}},{"filtered-vector":108,"gl-mat4/invert":154,"gl-mat4/rotate":158,"gl-vec3/cross":242,"gl-vec3/dot":243,"gl-vec3/normalize":246}],500:[function(t,e,r){"use strict";function n(t,e,r){var n=t*e,a=i*t,o=a-t,s=a-o,l=t-s,u=i*e,c=u-e,h=u-c,f=e-h,d=n-s*h,p=d-l*h,m=p-s*f,g=l*f-m;return r?(r[0]=g,r[1]=n,r):[g,n]}e.exports=n;var i=+(Math.pow(2,27)+1)},{}],501:[function(t,e,r){"use strict";function n(t,e,r){var n=t+e,i=n-t,a=n-i,o=e-i,s=t-a;return r?(r[0]=s+o,r[1]=n,r):[s+o,n]}e.exports=n},{}],502:[function(t,e,r){(function(e,n){"use strict";function i(t){if(t){var e=t.length||t.byteLength,r=y.log2(e);w[r].push(t)}}function a(t){i(t.buffer)}function o(t){var t=y.nextPow2(t),e=y.log2(t),r=w[e];return r.length>0?r.pop():new ArrayBuffer(t)}function s(t){return new Uint8Array(o(t),0,t)}function l(t){return new Uint16Array(o(2*t),0,t)}function u(t){return new Uint32Array(o(4*t),0,t)}function c(t){return new Int8Array(o(t),0,t)}function h(t){return new Int16Array(o(2*t),0,t)}function f(t){return new Int32Array(o(4*t),0,t)}function d(t){return new Float32Array(o(4*t),0,t)}function p(t){return new Float64Array(o(8*t),0,t)}function m(t){return b?new Uint8ClampedArray(o(t),0,t):s(t)}function g(t){return new DataView(o(t),0,t)}function v(t){t=y.nextPow2(t);var e=y.log2(t),r=M[e];return r.length>0?r.pop():new n(t)}var y=t("bit-twiddle"),x=t("dup");e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:x([32,0]),UINT16:x([32,0]),UINT32:x([32,0]),INT8:x([32,0]),INT16:x([32,0]),INT32:x([32,0]),FLOAT:x([32,0]),DOUBLE:x([32,0]),DATA:x([32,0]),UINT8C:x([32,0]),BUFFER:x([32,0])});var b="undefined"!=typeof Uint8ClampedArray,_=e.__TYPEDARRAY_POOL;_.UINT8C||(_.UINT8C=x([32,0])),_.BUFFER||(_.BUFFER=x([32,0]));var w=_.DATA,M=_.BUFFER;r.free=function(t){if(n.isBuffer(t))M[y.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|y.log2(e);w[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=a,r.freeArrayBuffer=i,r.freeBuffer=function(t){M[y.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return o(t);switch(e){case"uint8":return s(t);case"uint16":return l(t);case"uint32":return u(t);case"int8":return c(t);case"int16":return h(t);case"int32":return f(t);case"float":case"float32":return d(t);case"double":case"float64":return p(t);case"uint8_clamped":return m(t);case"buffer":return v(t);case"data":case"dataview":return g(t);default:return null}return null},r.mallocArrayBuffer=o,r.mallocUint8=s,r.mallocUint16=l,r.mallocUint32=u,r.mallocInt8=c,r.mallocInt16=h,r.mallocInt32=f,r.mallocFloat32=r.mallocFloat=d,r.mallocFloat64=r.mallocDouble=p,r.mallocUint8Clamped=m,r.mallocDataView=g,r.mallocBuffer=v,r.clearCache=function(){for(var t=0;t<32;++t)_.UINT8[t].length=0,_.UINT16[t].length=0,_.UINT32[t].length=0,_.INT8[t].length=0,_.INT16[t].length=0,_.INT32[t].length=0,_.FLOAT[t].length=0,_.DOUBLE[t].length=0,_.UINT8C[t].length=0,w[t].length=0,M[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":56,buffer:66,dup:100}],503:[function(t,e,r){"use strict";"use restrict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e<t;++e)this.roots[e]=e,this.ranks[e]=0}e.exports=n;var i=n.prototype;Object.defineProperty(i,"length",{get:function(){return this.roots.length}}),i.makeSet=function(){var t=this.roots.length;return this.roots.push(t),this.ranks.push(0),t},i.find=function(t){for(var e=t,r=this.roots;r[t]!==t;)t=r[t];for(;r[e]!==t;){var n=r[e];r[e]=t,e=n}return t},i.link=function(t,e){var r=this.find(t),n=this.find(e);if(r!==n){var i=this.ranks,a=this.roots,o=i[r],s=i[n];o<s?a[r]=n:s<o?a[n]=r:(a[n]=r,++i[r])}}},{}],504:[function(t,e,r){"use strict";function n(t,e){for(var r=1,n=t.length,i=t[0],a=t[0],o=1;o<n;++o)if(a=i,i=t[o],e(i,a)){if(o===r){r++;continue}t[r++]=i}return t.length=r,t}function i(t){for(var e=1,r=t.length,n=t[0],i=t[0],a=1;a<r;++a,i=n)if(i=n,n=t[a],n!==i){if(a===e){e++;continue}t[e++]=n}return t.length=e,t}function a(t,e,r){return 0===t.length?t:e?(r||t.sort(e),n(t,e)):(r||t.sort(),i(t))}e.exports=a},{}],505:[function(t,e,r){function n(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n}e.exports=n,n.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},n.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},n.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},n.prototype.solveCurveX=function(t,e){"undefined"==typeof e&&(e=1e-6);var r,n,i,a,o;for(i=t,o=0;o<8;o++){if(a=this.sampleCurveX(i)-t,Math.abs(a)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=a/s}if(r=0,n=1,i=t,i<r)return r;if(i>n)return n;for(;r<n;){if(a=this.sampleCurveX(i),Math.abs(a-t)<e)return i;t>a?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},{}],506:[function(t,e,r){"use strict";function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(t,e,r){if(t&&u.isObject(t)&&t instanceof n)return t;var i=new n;return i.parse(t,e,r),i}function a(t){return u.isString(t)&&(t=i(t)),t instanceof n?t.format():n.prototype.format.call(t)}function o(t,e){return i(t,!1,!0).resolve(e)}function s(t,e){return t?i(t,!1,!0).resolveObject(e):e}var l=t("punycode"),u=t("./util");r.parse=i,r.resolve=o,r.resolveObject=s,r.format=a,r.Url=n;var c=/^([a-z0-9.+-]+:)/i,h=/:[0-9]*$/,f=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,d=["<",">",'"',"`"," ","\r","\n","\t"],p=["{","}","|","\\","^","`"].concat(d),m=["'"].concat(p),g=["%","/","?",";","#"].concat(m),v=["/","?","#"],y=255,x=/^[+a-z0-9A-Z_-]{0,63}$/,b=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,_={javascript:!0,"javascript:":!0},w={javascript:!0,"javascript:":!0},M={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},A=t("querystring");n.prototype.parse=function(t,e,r){if(!u.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t.indexOf("?"),i=n!==-1&&n<t.indexOf("#")?"?":"#",a=t.split(i),o=/\\/g;a[0]=a[0].replace(o,"/"),t=a.join(i);var s=t;if(s=s.trim(),!r&&1===t.split("#").length){var h=f.exec(s);if(h)return this.path=s,this.href=s,this.pathname=h[1],h[2]?(this.search=h[2],e?this.query=A.parse(this.search.substr(1)):this.query=this.search.substr(1)):e&&(this.search="",this.query={}),this}var d=c.exec(s);if(d){d=d[0];var p=d.toLowerCase();this.protocol=p,s=s.substr(d.length)}if(r||d||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var k="//"===s.substr(0,2);!k||d&&w[d]||(s=s.substr(2),this.slashes=!0)}if(!w[d]&&(k||d&&!M[d])){for(var T=-1,E=0;E<v.length;E++){var S=s.indexOf(v[E]);S!==-1&&(T===-1||S<T)&&(T=S)}var L,C;C=T===-1?s.lastIndexOf("@"):s.lastIndexOf("@",T),C!==-1&&(L=s.slice(0,C),s=s.slice(C+1),this.auth=decodeURIComponent(L)),T=-1;for(var E=0;E<g.length;E++){var S=s.indexOf(g[E]);S!==-1&&(T===-1||S<T)&&(T=S)}T===-1&&(T=s.length),this.host=s.slice(0,T),s=s.slice(T),this.parseHost(),this.hostname=this.hostname||"";var I="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!I)for(var z=this.hostname.split(/\./),E=0,D=z.length;E<D;E++){var P=z[E];if(P&&!P.match(x)){for(var O="",R=0,F=P.length;R<F;R++)O+=P.charCodeAt(R)>127?"x":P[R];if(!O.match(x)){var j=z.slice(0,E),N=z.slice(E+1),B=P.match(b);B&&(j.push(B[1]),N.unshift(B[2])),N.length&&(s="/"+N.join(".")+s),this.hostname=j.join(".");break}}}this.hostname.length>y?this.hostname="":this.hostname=this.hostname.toLowerCase(),I||(this.hostname=l.toASCII(this.hostname));var U=this.port?":"+this.port:"",V=this.hostname||"";this.host=V+U,this.href+=this.host,I&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!_[p])for(var E=0,D=m.length;E<D;E++){var q=m[E];if(s.indexOf(q)!==-1){var H=encodeURIComponent(q);H===q&&(H=escape(q)),s=s.split(q).join(H)}}var Y=s.indexOf("#");Y!==-1&&(this.hash=s.substr(Y),s=s.slice(0,Y));var G=s.indexOf("?");if(G!==-1?(this.search=s.substr(G),this.query=s.substr(G+1),e&&(this.query=A.parse(this.query)),s=s.slice(0,G)):e&&(this.search="",this.query={}),s&&(this.pathname=s),M[p]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var U=this.pathname||"",X=this.search||"";this.path=U+X}return this.href=this.format(),this},n.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,a="";this.host?i=t+this.host:this.hostname&&(i=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&u.isObject(this.query)&&Object.keys(this.query).length&&(a=A.stringify(this.query));var o=this.search||a&&"?"+a||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||M[e])&&i!==!1?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),o&&"?"!==o.charAt(0)&&(o="?"+o),r=r.replace(/[?#]/g,function(t){return encodeURIComponent(t)}),o=o.replace("#","%23"),e+i+r+o+n},n.prototype.resolve=function(t){return this.resolveObject(i(t,!1,!0)).format()},n.prototype.resolveObject=function(t){if(u.isString(t)){var e=new n;e.parse(t,!1,!0),t=e}for(var r=new n,i=Object.keys(this),a=0;a<i.length;a++){var o=i[a];r[o]=this[o]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),l=0;l<s.length;l++){var c=s[l];"protocol"!==c&&(r[c]=t[c])}return M[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!M[t.protocol]){for(var h=Object.keys(t),f=0;f<h.length;f++){var d=h[f];r[d]=t[d]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||w[t.protocol])r.pathname=t.pathname;else{for(var p=(t.pathname||"").split("/");p.length&&!(t.host=p.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var m=r.pathname||"",g=r.search||"";r.path=m+g}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var v=r.pathname&&"/"===r.pathname.charAt(0),y=t.host||t.pathname&&"/"===t.pathname.charAt(0),x=y||v||r.host&&t.pathname,b=x,_=r.pathname&&r.pathname.split("/")||[],p=t.pathname&&t.pathname.split("/")||[],A=r.protocol&&!M[r.protocol];if(A&&(r.hostname="",r.port=null,r.host&&(""===_[0]?_[0]=r.host:_.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===p[0]?p[0]=t.host:p.unshift(t.host)),t.host=null),x=x&&(""===p[0]||""===_[0])),y)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,_=p;else if(p.length)_||(_=[]),_.pop(),_=_.concat(p),r.search=t.search,r.query=t.query;else if(!u.isNullOrUndefined(t.search)){if(A){r.hostname=r.host=_.shift();var k=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");k&&(r.auth=k.shift(),r.host=r.hostname=k.shift())}return r.search=t.search,r.query=t.query,u.isNull(r.pathname)&&u.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!_.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var T=_.slice(-1)[0],E=(r.host||t.host||_.length>1)&&("."===T||".."===T)||""===T,S=0,L=_.length;L>=0;L--)T=_[L],"."===T?_.splice(L,1):".."===T?(_.splice(L,1),S++):S&&(_.splice(L,1),S--);if(!x&&!b)for(;S--;S)_.unshift("..");!x||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),E&&"/"!==_.join("/").substr(-1)&&_.push("");var C=""===_[0]||_[0]&&"/"===_[0].charAt(0);if(A){r.hostname=r.host=C?"":_.length?_.shift():"";var k=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");k&&(r.auth=k.shift(),r.host=r.hostname=k.shift())}return x=x||r.host&&_.length,x&&!C&&_.unshift(""),_.length?r.pathname=_.join("/"):(r.pathname=null,r.path=null),u.isNull(r.pathname)&&u.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var t=this.host,e=h.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":507,punycode:452,querystring:456}],507:[function(t,e,r){"use strict";e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],508:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],509:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],510:[function(t,e,r){(function(e,n){function i(t,e){var n={seen:[],stylize:o};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(e)?n.showHidden=e:e&&r._extend(n,e),_(n.showHidden)&&(n.showHidden=!1),_(n.depth)&&(n.depth=2),_(n.colors)&&(n.colors=!1),_(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a),l(n,t,n.depth)}function a(t,e){var r=i.styles[e];return r?"["+i.colors[r][0]+"m"+t+"["+i.colors[r][1]+"m":t}function o(t,e){return t}function s(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}function l(t,e,n){if(t.customInspect&&e&&T(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return x(i)||(i=l(t,i,n)),i}var a=u(t,e);if(a)return a;var o=Object.keys(e),m=s(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),k(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return c(e);if(0===o.length){if(T(e)){var g=e.name?": "+e.name:"";return t.stylize("[Function"+g+"]","special")}if(w(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(A(e))return t.stylize(Date.prototype.toString.call(e),"date");if(k(e))return c(e)}var v="",y=!1,b=["{","}"];if(p(e)&&(y=!0,b=["[","]"]),T(e)){var _=e.name?": "+e.name:"";v=" [Function"+_+"]"}if(w(e)&&(v=" "+RegExp.prototype.toString.call(e)),A(e)&&(v=" "+Date.prototype.toUTCString.call(e)),k(e)&&(v=" "+c(e)),0===o.length&&(!y||0==e.length))return b[0]+v+b[1];if(n<0)return w(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var M;return M=y?h(t,e,n,m,o):o.map(function(r){return f(t,e,n,m,r,y)}),t.seen.pop(),d(M,v,b)}function u(t,e){if(_(e))return t.stylize("undefined","undefined");if(x(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return y(e)?t.stylize(""+e,"number"):m(e)?t.stylize(""+e,"boolean"):g(e)?t.stylize("null","null"):void 0}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,i){for(var a=[],o=0,s=e.length;o<s;++o)I(e,String(o))?a.push(f(t,e,r,n,String(o),!0)):a.push("");return i.forEach(function(i){i.match(/^\d+$/)||a.push(f(t,e,r,n,i,!0))}),a}function f(t,e,r,n,i,a){var o,s,u;if(u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},u.get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),I(n,i)||(o="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=g(r)?l(t,u.value,null):l(t,u.value,r-1),s.indexOf("\n")>-1&&(s=a?s.split("\n").map(function(t){return"  "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return"   "+t}).join("\n"))):s=t.stylize("[Circular]","special")),_(o)){if(a&&i.match(/^\d+$/))return s;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+s}function d(t,e,r){var n=0,i=t.reduce(function(t,e){return n++,e.indexOf("\n")>=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n  ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function p(t){return Array.isArray(t)}function m(t){return"boolean"==typeof t}function g(t){return null===t}function v(t){return null==t}function y(t){return"number"==typeof t}function x(t){return"string"==typeof t}function b(t){return"symbol"==typeof t}function _(t){return void 0===t}function w(t){return M(t)&&"[object RegExp]"===S(t)}function M(t){return"object"==typeof t&&null!==t}function A(t){return M(t)&&"[object Date]"===S(t)}function k(t){return M(t)&&("[object Error]"===S(t)||t instanceof Error)}function T(t){return"function"==typeof t}function E(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function S(t){return Object.prototype.toString.call(t)}function L(t){return t<10?"0"+t.toString(10):t.toString(10)}function C(){var t=new Date,e=[L(t.getHours()),L(t.getMinutes()),L(t.getSeconds())].join(":");return[t.getDate(),O[t.getMonth()],e].join(" ")}function I(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var z=/%[sdj%]/g;r.format=function(t){if(!x(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(i(arguments[r]));return e.join(" ")}for(var r=1,n=arguments,a=n.length,o=String(t).replace(z,function(t){if("%%"===t)return"%";if(r>=a)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r<a;s=n[++r])o+=g(s)||!M(s)?" "+s:" "+i(s);return o},r.deprecate=function(t,i){function a(){if(!o){if(e.throwDeprecation)throw new Error(i);e.traceDeprecation?console.trace(i):console.error(i),o=!0}return t.apply(this,arguments)}if(_(n.process))return function(){return r.deprecate(t,i).apply(this,arguments)};if(e.noDeprecation===!0)return t;var o=!1;return a};var D,P={};r.debuglog=function(t){if(_(D)&&(D=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!P[t])if(new RegExp("\\b"+t+"\\b","i").test(D)){var n=e.pid;P[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else P[t]=function(){};return P[t]},r.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=p,r.isBoolean=m,r.isNull=g,r.isNullOrUndefined=v,r.isNumber=y,r.isString=x,r.isSymbol=b,r.isUndefined=_,r.isRegExp=w,r.isObject=M,r.isDate=A,r.isError=k,r.isFunction=T,r.isPrimitive=E,r.isBuffer=t("./support/isBuffer");var O=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];r.log=function(){console.log("%s - %s",C(),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!M(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":509,_process:451,inherits:508}],511:[function(t,e,r){e.exports.VectorTile=t("./lib/vectortile.js"),e.exports.VectorTileFeature=t("./lib/vectortilefeature.js"),e.exports.VectorTileLayer=t("./lib/vectortilelayer.js")},{"./lib/vectortile.js":512,"./lib/vectortilefeature.js":513,"./lib/vectortilelayer.js":514}],512:[function(t,e,r){"use strict";function n(t,e){this.layers=t.readFields(i,{},e)}function i(t,e,r){if(3===t){var n=new a(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}var a=t("./vectortilelayer");e.exports=n},{"./vectortilelayer":514}],513:[function(t,e,r){"use strict";function n(t,e,r,n,a){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=a,t.readFields(i,this,e)}function i(t,e,r){1==t?e.id=r.readVarint():2==t?a(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function a(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}function o(t){var e=t.length;if(e<=1)return[t];for(var r,n,i=[],a=0;a<e;a++){var o=s(t[a]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(r&&i.push(r),r=[t[a]]):r.push(t[a]))}return r&&i.push(r),i}function s(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i<a;o=i++)e=t[i],r=t[o],n+=(r.x-e.x)*(e.y+r.y);return n}var l=t("point-geometry");e.exports=n,n.types=["Unknown","Point","LineString","Polygon"],n.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,i=0,a=0,o=0,s=[];t.pos<r;){if(!i){var u=t.readVarint();n=7&u,i=u>>3}if(i--,1===n||2===n)a+=t.readSVarint(),o+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e.push(new l(a,o));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&s.push(e),s},n.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-(1/0),l=1/0,u=-(1/0);t.pos<e;){if(!n){var c=t.readVarint();r=7&c,n=c>>3}if(n--,1===r||2===r)i+=t.readSVarint(),a+=t.readSVarint(),i<o&&(o=i),i>s&&(s=i),a<l&&(l=a),a>u&&(u=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,u]},n.prototype.toGeoJSON=function(t,e,r){function i(t){for(var e=0;e<t.length;e++){var r=t[e],n=180-360*(r.y+c)/l;t[e]=[360*(r.x+u)/l-180,360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90]}}var a,s,l=this.extent*Math.pow(2,r),u=this.extent*t,c=this.extent*e,h=this.loadGeometry(),f=n.types[this.type];switch(this.type){case 1:var d=[];for(a=0;a<h.length;a++)d[a]=h[a][0];h=d,i(h);break;case 2:for(a=0;a<h.length;a++)i(h[a]);break;case 3:for(h=o(h),a=0;a<h.length;a++)for(s=0;s<h[a].length;s++)i(h[a][s])}1===h.length?h=h[0]:f="Multi"+f;var p={type:"Feature",geometry:{type:f,coordinates:h},properties:this.properties};return"id"in this&&(p.id=this.id),p}},{"point-geometry":448}],514:[function(t,e,r){"use strict";function n(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(i,this,e),this.length=this._features.length}function i(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(a(r))}function a(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}var o=t("./vectortilefeature.js");e.exports=n,n.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new o(this._pbf,e,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":513}],515:[function(t,e,r){"use strict";function n(t,e){return"object"==typeof e&&null!==e||(e={}),i(t,e.canvas||a,e.context||o,e)}e.exports=n;var i=t("./lib/vtext"),a=null,o=null;"undefined"!=typeof document&&(a=document.createElement("canvas"),a.width=8192,a.height=1024,o=a.getContext("2d"))},{"./lib/vtext":516}],516:[function(t,e,r){"use strict";function n(t,e,r){for(var n=e.textAlign||"start",i=e.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l<s;++l)for(var u=t[l],c=0;c<2;++c)a[c]=0|Math.min(a[c],u[c]),o[c]=0|Math.max(o[c],u[c]);var h=0;switch(n){case"center":h=-.5*(a[0]+o[0]);break;case"right":case"end":h=-o[0];break;case"left":case"start":h=-a[0];break;default:throw new Error("vectorize-text: Unrecognized textAlign: '"+n+"'")}var f=0;switch(i){case"hanging":case"top":f=-a[1];break;case"middle":f=-.5*(a[1]+o[1]);break;case"alphabetic":case"ideographic":f=-3*r;break;case"bottom":f=-o[1];break;default:throw new Error("vectorize-text: Unrecoginized textBaseline: '"+i+"'")}var d=1/r;return"lineHeight"in e?d*=+e.lineHeight:"width"in e?d=e.width/(o[0]-a[0]):"height"in e&&(d=e.height/(o[1]-a[1])),t.map(function(t){return[d*(t[0]+h),d*(t[1]+f)]})}function i(t,e,r,n){var i=0|Math.ceil(e.measureText(r).width+2*n);if(i>8192)throw new Error("vectorize-text: String too long (sorry, this will get fixed later)");var a=3*n;t.height<a&&(t.height=a),e.fillStyle="#000",e.fillRect(0,0,t.width,t.height),e.fillStyle="#fff",e.fillText(r,n,2*n);var o=e.getImageData(0,0,i,a),s=c(o.data,[a,i,4]);return s.pick(-1,-1,0).transpose(1,0)}function a(t,e){var r=u(t,128);return e?h(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function o(t,e,r,i){var o=a(t,i),s=n(o.positions,e,r),l=o.edges,u="ccw"===e.orientation;if(f(s,l),e.polygons||e.polygon||e.polyline){for(var c=p(l,s),h=new Array(c.length),m=0;m<c.length;++m){for(var g=c[m],v=new Array(g.length),y=0;y<g.length;++y){for(var x=g[y],b=new Array(x.length),_=0;_<x.length;++_)b[_]=s[x[_]].slice();u&&b.reverse(),v[y]=b}h[m]=v}return h}return e.triangles||e.triangulate||e.triangle?{cells:d(s,l,{delaunay:!1,exterior:!1,interior:!0}),positions:s}:{edges:l,positions:s}}function s(t,e,r){try{return o(t,e,r,!0)}catch(t){}try{return o(t,e,r,!1)}catch(t){}return e.polygons||e.polyline||e.polygon?[]:e.triangles||e.triangulate||e.triangle?{cells:[],positions:[]}:{edges:[],positions:[]}}function l(t,e,r,n){var a=n.size||64,o=n.font||"normal";r.font=a+"px "+o,r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr";var l=i(e,r,t,a);return s(l,n,a)}e.exports=l,e.exports.processPixels=s;var u=t("surface-nets"),c=t("ndarray"),h=t("simplify-planar-graph"),f=t("clean-pslg"),d=t("cdt2d"),p=t("planar-graph-to-polyline")},{cdt2d:69,"clean-pslg":78,ndarray:432,"planar-graph-to-polyline":447,"simplify-planar-graph":486,"surface-nets":493}],517:[function(t,e,r){function n(t){var e=[];for(var r in t.layers)e.push(a(t.layers[r]));var n=new c;return h.tile.write({layers:e},n),n.finish()}function i(t){var e={};for(var r in t)e[r]=new f(t[r].features),e[r].name=r;return n({layers:e})}function a(t){for(var e={name:t.name||"",version:t.version||1,extent:t.extent||4096,keys:[],values:[],features:[]},r={},n={},i=0;i<t.length;i++){var a=t.feature(i);a.geometry=l(a.loadGeometry());var o=[];for(var s in a.properties){var c=r[s];"undefined"==typeof c&&(e.keys.push(s),c=e.keys.length-1,r[s]=c);var h=u(a.properties[s]),f=n[h.key];"undefined"==typeof f&&(e.values.push(h),f=e.values.length-1,n[h.key]=f),o.push(c),o.push(f)}a.tags=o,e.features.push(a)}return e}function o(t,e){return(e<<3)+(7&t)}function s(t){return t<<1^t>>31}function l(t){for(var e=[],r=0,n=0,i=t.length,a=0;a<i;a++){var l=t[a];e.push(o(1,1));for(var u=0;u<l.length;u++){1===u&&e.push(o(2,l.length-1));var c=l[u].x-r,h=l[u].y-n;e.push(s(c),s(h)),r+=c,n+=h}}return e}function u(t){var e,r=typeof t;return"string"===r?e={string_value:t}:"boolean"===r?e={bool_value:t}:"number"===r?e=t%1!==0?{double_value:t}:t<0?{sint_value:t}:{uint_value:t}:(t=JSON.stringify(t),e={string_value:t}),e.key=r+":"+t,e}var c=t("pbf"),h=t("./vector-tile-pb"),f=t("./lib/geojson_wrapper");e.exports=n,e.exports.fromVectorTileJs=n,e.exports.fromGeojsonVt=i,e.exports.GeoJSONWrapper=f},{"./lib/geojson_wrapper":518,"./vector-tile-pb":519,pbf:442}],518:[function(t,e,r){"use strict";function n(t){this.features=t,this.length=t.length}function i(t){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=4096}var a=t("point-geometry"),o=t("vector-tile").VectorTileFeature;e.exports=n,n.prototype.feature=function(t){return new i(this.features[t])},i.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var r=t[e],n=[],i=0;i<r.length;i++)n.push(new a(r[i][0],r[i][1]));this.geometry.push(n)}return this.geometry},i.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-(1/0),n=1/0,i=-(1/0),a=0;a<t.length;a++)for(var o=t[a],s=0;s<o.length;s++){var l=o[s];e=Math.min(e,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.y)}return[e,n,r,i]},i.prototype.toGeoJSON=o.prototype.toGeoJSON},{"point-geometry":448,"vector-tile":511}],519:[function(t,e,r){"use strict";function n(t,e){return t.readFields(i,{layers:[]},e)}function i(t,e,r){3===t&&e.layers.push(f(r,r.readVarint()+r.pos))}function a(t,e){var r;if(void 0!==t.layers)for(r=0;r<t.layers.length;r++)e.writeMessage(3,p,t.layers[r])}function o(t,e){return t.readFields(s,{},e)}function s(t,e,r){1===t?e.string_value=r.readString():2===t?e.float_value=r.readFloat():3===t?e.double_value=r.readDouble():4===t?e.int_value=r.readVarint():5===t?e.uint_value=r.readVarint():6===t?e.sint_value=r.readSVarint():7===t&&(e.bool_value=r.readBoolean())}function l(t,e){void 0!==t.string_value&&e.writeStringField(1,t.string_value),void 0!==t.float_value&&e.writeFloatField(2,t.float_value),void 0!==t.double_value&&e.writeDoubleField(3,t.double_value),void 0!==t.int_value&&e.writeVarintField(4,t.int_value),void 0!==t.uint_value&&e.writeVarintField(5,t.uint_value),void 0!==t.sint_value&&e.writeSVarintField(6,t.sint_value),void 0!==t.bool_value&&e.writeBooleanField(7,t.bool_value)}function u(t,e){var r=t.readFields(c,{},e);return void 0===r.type&&(r.type="Unknown"),r}function c(t,e,r){1===t?e.id=r.readVarint():2===t?e.tags=r.readPackedVarint():3===t?e.type=r.readVarint():4===t&&(e.geometry=r.readPackedVarint())}function h(t,e){void 0!==t.id&&e.writeVarintField(1,t.id),void 0!==t.tags&&e.writePackedVarint(2,t.tags),void 0!==t.type&&e.writeVarintField(3,t.type),void 0!==t.geometry&&e.writePackedVarint(4,t.geometry)}function f(t,e){return t.readFields(d,{features:[],keys:[],values:[]},e)}function d(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():2===t?e.features.push(u(r,r.readVarint()+r.pos)):3===t?e.keys.push(r.readString()):4===t?e.values.push(o(r,r.readVarint()+r.pos)):5===t&&(e.extent=r.readVarint())}function p(t,e){void 0!==t.version&&e.writeVarintField(15,t.version),void 0!==t.name&&e.writeStringField(1,t.name);var r;if(void 0!==t.features)for(r=0;r<t.features.length;r++)e.writeMessage(2,h,t.features[r]);if(void 0!==t.keys)for(r=0;r<t.keys.length;r++)e.writeStringField(3,t.keys[r]);if(void 0!==t.values)for(r=0;r<t.values.length;r++)e.writeMessage(4,l,t.values[r]);void 0!==t.extent&&e.writeVarintField(5,t.extent)}var m=r.tile={read:n,write:a};m.GeomType={Unknown:0,Point:1,LineString:2,Polygon:3},m.value={read:o,write:l},m.feature={read:u,write:h},m.layer={read:f,write:p}},{}],520:[function(t,e,r){!function(){"use strict";function t(e){e.permitHostObjects___&&e.permitHostObjects___(t)}function r(t){return!(t.substr(0,d.length)==d&&"___"===t.substr(t.length-3))}function n(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[p];if(e&&e.key===t)return e;if(f(t)){e={key:t};try{return h(t,p,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function i(t){return t.prototype=null,Object.freeze(t)}function a(){y||"undefined"==typeof console||(y=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}if("undefined"==typeof ses||!ses.ok||ses.ok()){"undefined"!=typeof ses&&(ses.weakMapPermitHostObjects=t);var o=!1;if("function"==typeof WeakMap){var s=WeakMap;if("undefined"!=typeof navigator&&/Firefox/.test(navigator.userAgent));else{var l=new s,u=Object.freeze({});if(l.set(u,1),1===l.get(u))return void(e.exports=WeakMap);o=!0}}var c=(Object.prototype.hasOwnProperty,Object.getOwnPropertyNames),h=Object.defineProperty,f=Object.isExtensible,d="weakmap:",p=d+"ident:"+Math.random()+"___";if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues&&"function"==typeof ArrayBuffer&&"function"==typeof Uint8Array){var m=new ArrayBuffer(25),g=new Uint8Array(m);crypto.getRandomValues(g),p=d+"rand:"+Array.prototype.map.call(g,function(t){return(t%36).toString(36)}).join("")+"___"}if(h(Object,"getOwnPropertyNames",{value:function(t){return c(t).filter(r)}}),"getPropertyNames"in Object){var v=Object.getPropertyNames;h(Object,"getPropertyNames",{value:function(t){return v(t).filter(r)}})}!function(){var t=Object.freeze;h(Object,"freeze",{value:function(e){return n(e),t(e)}});var e=Object.seal;h(Object,"seal",{value:function(t){return n(t),e(t)}});var r=Object.preventExtensions;h(Object,"preventExtensions",{value:function(t){return n(t),r(t)}})}();var y=!1,x=0,b=function(){function t(t,e){var r,i=n(t);return i?u in i?i[u]:e:(r=s.indexOf(t),r>=0?l[r]:e)}function e(t){var e=n(t);return e?u in e:s.indexOf(t)>=0}function r(t,e){var r,i=n(t);return i?i[u]=e:(r=s.indexOf(t),r>=0?l[r]=e:(r=s.length,l[r]=e,s[r]=t)),this}function o(t){var e,r,i=n(t);return i?u in i&&delete i[u]:(e=s.indexOf(t),!(e<0)&&(r=s.length-1,s[e]=void 0,l[e]=l[r],s[e]=s[r],s.length=r,l.length=r,!0))}this instanceof b||a();var s=[],l=[],u=x++;return Object.create(b.prototype,{get___:{value:i(t)},has___:{value:i(e)},set___:{value:i(r)},delete___:{value:i(o)}})};b.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof s?!function(){function r(){function e(t,e){return c?u.has(t)?u.get(t):c.get___(t,e):u.get(t,e)}function r(t){return u.has(t)||!!c&&c.has___(t)}function n(t){var e=!!u.delete(t);return c?c.delete___(t)||e:e}this instanceof b||a();var l,u=new s,c=void 0,h=!1;return l=o?function(t,e){return u.set(t,e),u.has(t)||(c||(c=new b),c.set(t,e)),this}:function(t,e){if(h)try{u.set(t,e)}catch(r){c||(c=new b),c.set___(t,e)}else u.set(t,e);return this},Object.create(b.prototype,{get___:{value:i(e)},has___:{value:i(r)},set___:{value:i(l)},delete___:{value:i(n)},permitHostObjects___:{value:i(function(e){if(e!==t)throw new Error("bogus call to permitHostObjects___");h=!0})}})}o&&"undefined"!=typeof Proxy&&(Proxy=void 0),r.prototype=b.prototype,e.exports=r,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=b)}}()},{}],521:[function(t,e,r){function n(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:i(e,t)}}var i=t("./hidden-store.js");e.exports=n},{"./hidden-store.js":522}],522:[function(t,e,r){function n(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}e.exports=n},{}],523:[function(t,e,r){function n(){var t=i();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){t(e).value=r},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}var i=t("./create-store.js");e.exports=n},{"./create-store.js":521}],524:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":121}],525:[function(t,e,r){var n=arguments[3],i=arguments[4],a=arguments[5],o=JSON.stringify;e.exports=function(t,e){function r(t){g[t]=!0;for(var e in i[t][1]){var n=i[t][1][e];g[n]||r(n)}}for(var s,l=Object.keys(a),u=0,c=l.length;u<c;u++){var h=l[u],f=a[h].exports;if(f===t||f&&f.default===t){s=h;break}}if(!s){s=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var d={},u=0,c=l.length;u<c;u++){var h=l[u];d[h]=h}i[s]=[Function(["require","module","exports"],"("+t+")(self)"),d]}var p=Math.floor(Math.pow(16,8)*Math.random()).toString(16),m={};m[s]=s,i[p]=[Function(["require"],"var f = require("+o(s)+");(f.default ? f.default : f)(self);"),m];var g={};r(p);var v="("+n+")({"+Object.keys(g).map(function(t){return o(t)+":["+i[t][0]+","+o(i[t][1])+"]"}).join(",")+"},{},["+o(p)+"])",y=window.URL||window.webkitURL||window.mozURL||window.msURL,x=new Blob([v],{type:"text/javascript"});if(e&&e.bare)return x;var b=y.createObjectURL(x),_=new Worker(b);return _.objectURL=b,_}},{}],526:[function(t,e,r){e.exports.RADIUS=6378137,e.exports.FLATTENING=1/298.257223563,e.exports.POLAR_RADIUS=6356752.3142},{}],527:[function(e,r,n){!function(e,i){"object"==typeof n&&"undefined"!=typeof r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.WhooTS=e.WhooTS||{})}(this,function(t){function e(t,e,n,i,a,o){o=o||{};var s=t+"?"+["bbox="+r(n,i,a),"format="+(o.format||"image/png"),"service="+(o.service||"WMS"),"version="+(o.version||"1.1.1"),"request="+(o.request||"GetMap"),"srs="+(o.srs||"EPSG:3857"),"width="+(o.width||256),"height="+(o.height||256),"layers="+e].join("&");return s}function r(t,e,r){e=Math.pow(2,r)-e-1;var i=n(256*t,256*e,r),a=n(256*(t+1),256*(e+1),r);return i[0]+","+i[1]+","+a[0]+","+a[1]}function n(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r),i=t*n-2*Math.PI*6378137/2,a=e*n-2*Math.PI*6378137/2;return[i,a]}t.getURL=e,t.getTileBBox=r,t.getMercCoords=n,Object.defineProperty(t,"__esModule",{value:!0})})},{}],528:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e,r,n){var i,a;if("object"==typeof t)i=t,a=e||{};else{var o="number"==typeof t&&t>=1888&&t<=2111;if(!o)throw new Error("Solar year outside range 1888-2111");var s="number"==typeof e&&e>=1&&e<=12;if(!s)throw new Error("Solar month outside range 1 - 12");var l="number"==typeof r&&r>=1&&r<=31;if(!l)throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a=n||{}}var u=p[i.year-p[0]],c=i.year<<9|i.month<<5|i.day;a.year=c>=u?i.year:i.year-1,u=p[a.year-p[0]];var h,f=u>>9&4095,m=u>>5&15,g=31&u,v=new Date(f,m-1,g),y=new Date(i.year,i.month-1,i.day);h=Math.round((y-v)/864e5);var x,b=d[a.year-d[0]];for(x=0;x<13;x++){var _=b&1<<12-x?30:29;if(h<_)break;h-=_}var w=b>>13;return!w||x<w?(a.isIntercalary=!1,a.month=1+x):x===w?(a.isIntercalary=!0,a.month=x):(a.isIntercalary=!1,a.month=x),a.day=1+h,a}function a(t,e,r,n,i){var a,o;if("object"==typeof t)o=t,a=e||{};else{var s="number"==typeof t&&t>=1888&&t<=2111;if(!s)throw new Error("Lunar year outside range 1888-2111");var l="number"==typeof e&&e>=1&&e<=12;if(!l)throw new Error("Lunar month outside range 1 - 12");var u="number"==typeof r&&r>=1&&r<=30;if(!u)throw new Error("Lunar day outside range 1 - 30");var c;"object"==typeof n?(c=!1,a=n):(c=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:c}}var h;h=o.day-1;var f,m=d[o.year-d[0]],g=m>>13;f=g?o.month>g?o.month:o.isIntercalary?o.month:o.month-1:o.month-1;for(var v=0;v<f;v++){var y=m&1<<12-v?30:29;h+=y}var x=p[o.year-p[0]],b=x>>9&4095,_=x>>5&15,w=31&x,M=new Date(b,_-1,w+h);return a.year=M.getFullYear(),a.month=1+M.getMonth(),a.day=M.getDate(),a}var o=t("../main"),s=t("object-assign"),l=o.instance();n.prototype=new o.baseCalendar,s(n.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(t,e){if("string"==typeof t){var r=t.match(c);return r?r[0]:""}var n=this._validateYear(t),i=t.month(),a=""+this.toChineseMonth(n,i);return e&&a.length<2&&(a="0"+a),this.isIntercalaryMonth(n,i)&&(a+="i"),a},monthNames:function(t){if("string"==typeof t){var e=t.match(h);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=this.toChineseMonth(r,n),a=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][i-1];return this.isIntercalaryMonth(r,n)&&(a="闰"+a),a},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(f);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=this.toChineseMonth(r,n),a=["一","二","三","四","五","六","七","八","九","十","十一","十二"][i-1];return this.isIntercalaryMonth(r,n)&&(a="闰"+a),a},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))"闰"===e[0]&&(r=!0,e=e.substring(1)),"月"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(e);else{var i=e[e.length-1];r="i"===i||"I"===i}var a=this.toMonthIndex(t,n,r);return a},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(t,e){if(t.year&&(t=t.year()),"number"!=typeof t||t<1888||t>2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var n=this.intercalaryMonth(t),i=r&&e!==n;if(i||e<1||e>12)throw o.local.invalidMonth.replace(/\{0\}/,this.local.name);var a;return a=n?!r&&e<=n?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(t=t.year(),e=t.month());var r=this.intercalaryMonth(t),n=r?12:11;if(e<0||e>n)throw o.local.invalidMonth.replace(/\{0\}/,this.local.name);var i;return i=r?e<r?e+1:e:e+1},intercalaryMonth:function(t){t=this._validateYear(t);var e=d[t-d[0]],r=e>>13;return r},isIntercalaryMonth:function(t,e){t.year&&(t=t.year(),e=t.month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var n,i=this._validateYear(t,o.local.invalidyear),a=p[i-p[0]],s=a>>9&4095,u=a>>5&15,c=31&a;n=l.newDate(s,u,c),n.add(4-(n.dayOfWeek()||7),"d");var h=this.toJD(t,e,r)-n.toJD();return 1+Math.floor(h/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(t,e){t.year&&(e=t.month(),t=t.year()),t=this._validateYear(t);var r=d[t-d[0]],n=r>>13,i=n?12:11;if(e>i)throw o.local.invalidMonth.replace(/\{0\}/,this.local.name);var a=r&1<<12-e?30:29;return a},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,s,r,o.local.invalidDate);t=this._validateYear(n.year()),e=n.month(),r=n.day();var i=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),u=a(t,s,r,i);return l.toJD(u.year,u.month,u.day)},fromJD:function(t){var e=l.fromJD(t),r=i(e.year(),e.month(),e.day()),n=this.toMonthIndex(r.year,r.month,r.isIntercalary);return this.newDate(r.year,n,r.day)},fromString:function(t){var e=t.match(u),r=this._validateYear(+e[1]),n=+e[2],i=!!e[3],a=this.toMonthIndex(r,n,i),o=+e[4];return this.newDate(r,a,o)},add:function(t,e,r){var i=t.year(),a=t.month(),o=this.isIntercalaryMonth(i,a),s=this.toChineseMonth(i,a),l=Object.getPrototypeOf(n.prototype).add.call(this,t,e,r);if("y"===r){var u=l.year(),c=l.month(),h=this.isIntercalaryMonth(u,s),f=o&&h?this.toMonthIndex(u,s,!0):this.toMonthIndex(u,s,!1);f!==c&&l.month(f)}return l}});var u=/^\s*(-?\d\d\d\d|\d\d)[-\/](\d?\d)([iI]?)[-\/](\d?\d)/m,c=/^\d?\d[iI]?/m,h=/^\u95f0?\u5341?[\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]?\u6708/m,f=/^\u95f0?\u5341?[\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]?/m;o.calendars.chinese=n;var d=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],p=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904]},{"../main":542,"object-assign":435}],529:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Coptic",jdEpoch:1825029.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=e.year()+(e.year()<0?1:0);return t%4===3||t%4===-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear||i.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),t<0&&t++,n.day()+30*(n.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),i.calendars.coptic=n},{"../main":542,"object-assign":435}],530:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Discworld",jdEpoch:1721425.5,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),!1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),13},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),400},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/8)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return(n.day()+1)%8},weekDay:function(t,e,r){var n=this.dayOfWeek(t,e,r);return n>=2&&n<=6},extraInfo:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return{century:o[Math.floor((n.year()-1)/100)+1]||""}},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year()+(n.year()<0?1:0),e=n.month(),r=n.day(),r+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};i.calendars.discworld=n},{"../main":542,"object-assign":435}],531:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=e.year()+(e.year()<0?1:0);return t%4===3||t%4===-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear||i.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),t<0&&t++,n.day()+30*(n.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),i.calendars.ethiopian=n},{"../main":542,"object-assign":435}],532:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}var a=t("../main"),o=t("object-assign");n.prototype=new a.baseCalendar,o(n.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,a.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return t=t<0?t+1:t,i(7*t+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,a.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,a.local.invalidYear);return t=e.year(),this.toJD(t===-1?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,a.local.invalidMonth),12===e&&this.leapYear(t)?30:8===e&&5===i(this.daysInYear(t),10)?30:9===e&&3===i(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);return{yearType:(this.leapYear(n)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(n)%10-3]}},toJD:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var i=t<=0?t+1:t,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(e<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(var s=1;s<e;s++)o+=this.daysInMonth(t,s)}else for(var s=7;s<e;s++)o+=this.daysInMonth(t,s);return o},_delay1:function(t){var e=Math.floor((235*t-234)/19),r=12084+13753*e,n=29*e+Math.floor(r/25920);return i(3*(n+1),7)<3&&n++,n},_delay2:function(t){var e=this._delay1(t-1),r=this._delay1(t),n=this._delay1(t+1);return n-r===356?2:r-e===382?1:0},fromJD:function(t){t=Math.floor(t)+.5;for(var e=Math.floor(98496*(t-this.jdEpoch)/35975351)-1;t>=this.toJD(e===-1?1:e+1,7,1);)e++;for(var r=t<this.toJD(e,1,1)?7:1;t>this.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),a.calendars.hebrew=n},{"../main":542,"object-assign":435}],533:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-khamīs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);return(11*e.year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t=t<=0?t+1:t,r+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),i.calendars.islamic=n},{"../main":542,"object-assign":435}],534:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=e.year()<0?e.year()+1:e.year();return t%4===0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5),r=e+1524,n=Math.floor((r-122.1)/365.25),i=Math.floor(365.25*n),a=Math.floor((r-i)/30.6001),o=a-Math.floor(a<14?1:13),s=n-Math.floor(o>2?4716:4715),l=r-i-Math.floor(30.6001*a);return s<=0&&s--,this.newDate(s,o,l)}}),i.calendars.julian=n},{"../main":542,"object-assign":435}],535:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}function a(t,e){return i(t-1,e)+1}var o=t("../main"),s=t("object-assign");n.prototype=new o.baseCalendar,s(n.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,o.local.invalidYear),!1},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,o.local.invalidYear);t=e.year();var r=Math.floor(t/400);t%=400,t+=t<0?400:0;var n=Math.floor(t/20);return r+"."+n+"."+t%20},forYear:function(t){if(t=t.split("."),t.length<3)throw"Invalid Mayan year";for(var e=0,r=0;r<t.length;r++){var n=parseInt(t[r],10);if(Math.abs(n)>19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,o.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,o.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,o.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate);return n.day()},weekDay:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),!0},extraInfo:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate),i=n.toJD(),a=this._toHaab(i),s=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[s[0]-1],tzolkinDay:s[0],tzolkinTrecena:s[1]}},_toHaab:function(t){t-=this.jdEpoch;var e=i(t+8+340,365);return[Math.floor(e/20)+1,i(e,20)]},_toTzolkin:function(t){return t-=this.jdEpoch,[a(t+20,20),a(t+4,13)]},toJD:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate);return n.day()+20*n.month()+360*n.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),o.calendars.mayan=n},{"../main":542,"object-assign":435}],536:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar;var o=i.instance("gregorian");a(n.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear||i.regionalOptions[""].invalidYear);return o.leapYear(e.year()+(e.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidMonth),t=n.year();t<0&&t++;for(var a=n.day(),s=1;s<n.month();s++)a+=this.daysPerMonth[s-1];return a+o.toJD(t+1468,3,13)},fromJD:function(t){t=Math.floor(t+.5);for(var e=Math.floor((t-(this.jdEpoch-1))/366);t>=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),i.calendars.nanakshahi=n},{"../main":542,"object-assign":435}],537:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);if(t=e.year(),"undefined"==typeof this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var r=0,n=this.minMonth;n<=12;n++)r+=this.NEPALI_CALENDAR_DATA[t][n];return r},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,i.local.invalidMonth),"undefined"==typeof this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var a=i.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var u=t-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==e&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===e?(o+=r-this.NEPALI_CALENDAR_DATA[l][0],o<0&&(o+=a.daysInYear(u))):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(u,1,1).add(o,"d").toJD()},fromJD:function(t){var e=i.instance(),r=e.fromJD(t),n=r.year(),a=r.dayOfYear(),o=n+56;this._createMissingCalendarData(o);for(var s=9,l=this.NEPALI_CALENDAR_DATA[o][0],u=this.NEPALI_CALENDAR_DATA[o][s]-l+1;a>u;)s++,s>12&&(s=1,o++),u+=this.NEPALI_CALENDAR_DATA[o][s];var c=this.NEPALI_CALENDAR_DATA[o][s]-(u-a);return this.newDate(o,s,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r<t+2;r++)"undefined"==typeof this.NEPALI_CALENDAR_DATA[r]&&(this.NEPALI_CALENDAR_DATA[r]=e)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2000:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),i.calendars.nepali=n},{"../main":542,"object-assign":435}],538:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}var a=t("../main"),o=t("object-assign");n.prototype=new a.baseCalendar,o(n.prototype,{name:"Persian",jdEpoch:1948320.5,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Day","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Day","Bah","Esf"],dayNames:["Yekshambe","Doshambe","Seshambe","Chæharshambe","Panjshambe","Jom'e","Shambe"],dayNamesShort:["Yek","Do","Se","Chæ","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,a.local.invalidYear);return 682*((e.year()-(e.year()>0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-((n.dayOfWeek()+1)%7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,a.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var o=t-(t>=0?474:473),s=474+i(o,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(o/2820)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=t-this.toJD(475,1,1),r=Math.floor(e/1029983),n=i(e,1029983),a=2820;if(1029982!==n){var o=Math.floor(n/366),s=i(n,366);a=Math.floor((2134*o+2816*s+2815)/1028522)+o+1}var l=a+2820*r+474;l=l<=0?l-1:l;var u=t-this.toJD(l,1,1)+1,c=u<=186?Math.ceil(u/31):Math.ceil((u-6)/30),h=t-this.toJD(l,c,1)+1;return this.newDate(l,c,h)}}),a.calendars.persian=n,a.calendars.jalali=n},{"../main":542,"object-assign":435}],539:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign"),o=i.instance();n.prototype=new i.baseCalendar,a(n.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate),t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),i.calendars.taiwan=n},{"../main":542,"object-assign":435}],540:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign"),o=i.instance();n.prototype=new i.baseCalendar,a(n.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate),t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),i.calendars.thai=n},{"../main":542,"object-assign":435}],541:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);return 355===this.daysInYear(e.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(t,e){for(var r=this._validate(t,e,this.minDay,i.local.invalidMonth),n=r.toJD()-24e5+.5,a=0,s=0;s<o.length;s++){if(o[s]>n)return o[a]-o[a-1];a++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate),a=12*(n.year()-1)+n.month()-15292,s=n.day()+o[a-1]-1;return s+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;n<o.length&&!(o[n]>e);n++)r++;var i=r+15292,a=Math.floor((i-1)/12),s=a+1,l=i-12*a,u=e-o[r-1]+1;return this.newDate(s,l,u)},isValid:function(t,e,r){var n=i.baseCalendar.prototype.isValid.apply(this,arguments);return n&&(t=null!=t.year?t.year:t,n=t>=1276&&t<=1500),n},_validate:function(t,e,r,n){var a=i.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw n.replace(/\{0\}/,this.local.name);return a}}),i.calendars.ummalqura=n;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":542,"object-assign":435}],542:[function(t,e,r){function n(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function a(t,e){return t=""+t,"000000".substring(0,e-t.length)+t}function o(){this.shortYearCutoff="+10"}function s(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}var l=t("object-assign");l(n.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,i){return n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,i):n)||this.instance(),n.newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,function(e){return t[e]})}},substituteChineseDigits:function(t,e){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":t[a]+e[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),l(i.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(u.local.differentCalendars||u.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+a(Math.abs(this.year()),4)+"-"+a(this.month(),2)+"-"+a(this.day(),2)}}),l(o.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new i(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return e.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+a(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),i=t.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0),i=t.day(),s=function(t){for(;o<t.minMonth;)a--,o+=t.monthsInYear(a);for(var e=t.monthsInYear(a);o>e-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)};"y"===r?(t.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(s(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var l=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,l}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;e=this._add(t,r*i[0]+a*i[1],i[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),i="m"===r?e:t.month(),a="d"===r?e:t.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),t.date(n,i,a)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var i=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth<this.monthsInYear(i)&&r>=this.minDay&&r-this.minDay<this.daysInMonth(i)}return this._validateLevel--,n},toJSDate:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);return u.instance().fromJD(this.toJD(n)).toJSDate()},fromJSDate:function(t){return this.fromJD(u.instance().fromJSDate(t).toJD())},_validate:function(t,e,r,n){if(t.year){if(0===this._validateLevel&&this.name!==t.calendar().name)throw(u.local.differentCalendars||u.regionalOptions[""].differentCalendars).replace(/\{0\}/,this.local.name).replace(/\{1\}/,t.calendar().local.name);return t}try{if(this._validateLevel++,1===this._validateLevel&&!this.isValid(t,e,r))throw n.replace(/\{0\}/,this.local.name);var i=this.newDate(t,e,r);return this._validateLevel--,i}catch(t){throw this._validateLevel--,t}}}),s.prototype=new o,l(s.prototype,{name:"Gregorian",jdEpoch:1721425.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Gregorian",epochs:["BCE","CE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear),t=e.year()+(e.year()<0?1:0);return t%4===0&&(t%100!==0||t%400===0)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);t=n.year(),e=n.month(),r=n.day(),t<0&&t++,e<3&&(e+=12,t--);var i=Math.floor(t/100),a=2-i+Math.floor(i/4);return Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r+a-1524.5},fromJD:function(t){var e=Math.floor(t+.5),r=Math.floor((e-1867216.25)/36524.25);r=e+1+r-Math.floor(r/4);var n=r+1524,i=Math.floor((n-122.1)/365.25),a=Math.floor(365.25*i),o=Math.floor((n-a)/30.6001),s=n-a-Math.floor(30.6001*o),l=o-(o>13.5?13:1),u=i-(l>2.5?4716:4715);return u<=0&&u--,this.newDate(u,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var u=e.exports=new n;u.cdate=i,u.baseCalendar=o,u.calendars.gregorian=s},{"object-assign":435}],543:[function(t,e,r){var n=t("object-assign"),i=t("./main");n(i.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),i.local=i.regionalOptions[""],n(i.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(i.baseCalendar.prototype,{UNIX_EPOCH:i.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:i.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,e,r){if("string"!=typeof t&&(r=e,e=t,t=""),!e)return"";if(e.calendar()!==this)throw i.local.invalidFormat||i.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat,r=r||{};for(var n=r.dayNamesShort||this.local.dayNamesShort,a=r.dayNames||this.local.dayNames,o=r.monthNumbers||this.local.monthNumbers,s=r.monthNamesShort||this.local.monthNamesShort,l=r.monthNames||this.local.monthNames,u=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;x+n<t.length&&t.charAt(x+n)===e;)n++;return x+=n-1,Math.floor(n/(r||1))>1}),c=function(t,e,r,n){var i=""+e;if(u(t,n))for(;i.length<r;)i="0"+i;return i},h=function(t,e,r,n){return u(t)?n[e]:r[e]},f=this,d=function(t){return"function"==typeof o?o.call(f,t,u("m")):g(c("m",t.month(),2))},p=function(t,e){return e?"function"==typeof l?l.call(f,t):l[t.month()-f.minMonth]:"function"==typeof s?s.call(f,t):s[t.month()-f.minMonth]},m=this.local.digits,g=function(t){return r.localNumbers&&m?m(t):t},v="",y=!1,x=0;x<t.length;x++)if(y)"'"!==t.charAt(x)||u("'")?v+=t.charAt(x):y=!1;else switch(t.charAt(x)){case"d":v+=g(c("d",e.day(),2));break;case"D":v+=h("D",e.dayOfWeek(),n,a);break;case"o":v+=c("o",e.dayOfYear(),3);break;case"w":v+=c("w",e.weekOfYear(),2);break;case"m":v+=d(e);break;case"M":v+=p(e,u("M"));break;case"y":v+=u("y",2)?e.year():(e.year()%100<10?"0":"")+e.year()%100;break;case"Y":u("Y",2),v+=e.formatYear();break;case"J":v+=e.toJD();break;case"@":v+=(e.toJD()-this.UNIX_EPOCH)*this.SECS_PER_DAY;break;case"!":v+=(e.toJD()-this.TICKS_EPOCH)*this.TICKS_PER_DAY;break;case"'":u("'")?v+="'":y=!0;break;default:v+=t.charAt(x)}return v},parseDate:function(t,e,r){if(null==e)throw i.local.invalidArguments||i.regionalOptions[""].invalidArguments;if(e="object"==typeof e?e.toString():e+"",""===e)return null;t=t||this.local.dateFormat,r=r||{};var n=r.shortYearCutoff||this.shortYearCutoff;n="string"!=typeof n?n:this.today().year()%100+parseInt(n,10);for(var a=r.dayNamesShort||this.local.dayNamesShort,o=r.dayNames||this.local.dayNames,s=r.parseMonth||this.local.parseMonth,l=r.monthNumbers||this.local.monthNumbers,u=r.monthNamesShort||this.local.monthNamesShort,c=r.monthNames||this.local.monthNames,h=-1,f=-1,d=-1,p=-1,m=-1,g=!1,v=!1,y=function(e,r){for(var n=1;T+n<t.length&&t.charAt(T+n)===e;)n++;return T+=n-1,Math.floor(n/(r||1))>1},x=function(t,r){var n=y(t,r),a=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=e.substring(k).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,k);return k+=s[0].length,parseInt(s[0],10)},b=this,_=function(){if("function"==typeof l){y("m");var t=l.call(b,e.substring(k));return k+=t.length,t}return x("m")},w=function(t,r,n,a){for(var o=y(t,a)?n:r,s=0;s<o.length;s++)if(e.substr(k,o[s].length).toLowerCase()===o[s].toLowerCase())return k+=o[s].length,s+b.minMonth;throw(i.local.unknownNameAt||i.regionalOptions[""].unknownNameAt).replace(/\{0\}/,k)},M=function(){if("function"==typeof c){var t=y("M")?c.call(b,e.substring(k)):u.call(b,e.substring(k));return k+=t.length,t}return w("M",u,c)},A=function(){if(e.charAt(k)!==t.charAt(T))throw(i.local.unexpectedLiteralAt||i.regionalOptions[""].unexpectedLiteralAt).replace(/\{0\}/,k);k++},k=0,T=0;T<t.length;T++)if(v)"'"!==t.charAt(T)||y("'")?A():v=!1;else switch(t.charAt(T)){case"d":p=x("d");break;case"D":w("D",a,o);break;case"o":m=x("o");break;case"w":x("w");break;case"m":d=_();break;case"M":d=M();break;case"y":var E=T;g=!y("y",2),T=E,f=x("y",2);break;case"Y":f=x("Y",2);break;case"J":h=x("J")+.5,"."===e.charAt(k)&&(k++,x("J"));break;case"@":h=x("@")/this.SECS_PER_DAY+this.UNIX_EPOCH;break;case"!":h=x("!")/this.TICKS_PER_DAY+this.TICKS_EPOCH;break;case"*":k=e.length;break;case"'":y("'")?A():v=!0;break;default:A()}if(k<e.length)throw i.local.unexpectedText||i.regionalOptions[""].unexpectedText;if(f===-1?f=this.today().year():f<100&&g&&(f+=n===-1?1900:this.today().year()-this.today().year()%100-(f<=n?0:100)),"string"==typeof d&&(d=s.call(this,f,d)),m>-1){d=1,p=m;for(var S=this.daysInMonth(f,d);p>S;S=this.daysInMonth(f,d))d++,p-=S}return h>-1?this.fromJD(h):this.newDate(f,d,p)},determineDate:function(t,e,r,n,i){r&&"object"!=typeof r&&(i=n,n=r,r=null),"string"!=typeof n&&(i=n,n="");var a=this,o=function(t){try{return a.parseDate(n,t,i)}catch(t){}t=t.toLowerCase();for(var e=(t.match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e};return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?o(t):"number"==typeof t?isNaN(t)||t===1/0||t===-(1/0)?e:a.today().add(t,"d"):a.newDate(t)}})},{"./main":542,"object-assign":435}],544:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n        var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n        var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n        if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n          _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n        }\n      }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":93}],545:[function(t,e,r){"use strict";function n(t,e){var r=[];return e=+e||0,i(t.hi(t.shape[0]-1),r,e),r}e.exports=n;var i=t("./lib/zc-core")},{"./lib/zc-core":544}],546:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../color"),a=t("../../plots/cartesian/axes"),o=t("./attributes");e.exports=function(t,e,r,s,l){function u(r,i){return n.coerce(t,e,o,r,i)}s=s||{},l=l||{};var c=u("visible",!l.itemIsNotPlainObject),h=u("clicktoshow");if(!c&&!h)return e;u("opacity"),u("align"),u("bgcolor");var f=u("bordercolor"),d=i.opacity(f);u("borderpad");var p=u("borderwidth"),m=u("showarrow");u("text",m?" ":"new text"),u("textangle"),n.coerceFont(u,"font",r.font);for(var g=["x","y"],v=[-10,-30],y={_fullLayout:r},x=0;x<2;x++){var b=g[x],_=a.coerceRef(t,e,y,b,"","paper");if(a.coercePosition(e,y,u,_,b,.5),m){var w="a"+b,M=a.coerceRef(t,e,y,w,"pixel");"pixel"!==M&&M!==_&&(M=e[w]="pixel");var A="pixel"===M?v[x]:.4;a.coercePosition(e,y,u,M,w,A)}u(b+"anchor")}if(n.noneOrAll(t,e,["x","y"]),m&&(u("arrowcolor",d?e.bordercolor:i.defaultLine),u("arrowhead"),u("arrowsize"),u("arrowwidth",2*(d&&p||1)),u("standoff"),n.noneOrAll(t,e,["ax","ay"])),h){var k=u("xclick"),T=u("yclick");e._xclick=void 0===k?e.x:k,e._yclick=void 0===T?e.y:T}return e}},{"../../lib":658,"../../plots/cartesian/axes":691,"../color":558,"./attributes":548}],547:[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},{path:"M2,2V-2H-2V2Z",backoff:0}]},{}],548:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants"),o=t("../../lib/extend").extendFlat;e.exports={_isLinkedToArray:"annotation",visible:{valType:"boolean",dflt:!0},text:{valType:"string"},textangle:{valType:"angle",dflt:0},font:o({},i,{}),opacity:{valType:"number",min:0,max:1,dflt:1},align:{valType:"enumerated",values:["left","center","right"],dflt:"center"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)"},borderpad:{valType:"number",min:0,dflt:1},borderwidth:{valType:"number",min:0,dflt:1},showarrow:{valType:"boolean",dflt:!0},arrowcolor:{valType:"color"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1},arrowsize:{valType:"number",min:.3,dflt:1},arrowwidth:{valType:"number",min:.1},standoff:{valType:"number",min:0,dflt:0},ax:{valType:"any"},ay:{valType:"any"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.x.toString()]},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()]},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()]},x:{valType:"any"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()]},y:{valType:"any"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1},xclick:{valType:"any"},yclick:{valType:"any"},_deprecated:{ref:{valType:"string"}}}},{"../../lib/extend":651,"../../plots/cartesian/constants":696,"../../plots/font_attributes":711,"./arrow_paths":547}],549:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;i.filterVisible(e.annotations).forEach(function(e){var r=a.getFromId(t,e.xref),n=a.getFromId(t,e.yref),i=3*e.arrowsize*e.arrowwidth||0;r&&r.autorange&&(e.axref===e.xref?(a.expand(r,[r.r2c(e.x)],{ppadplus:i,ppadminus:i}),a.expand(r,[r.r2c(e.ax)],{ppadplus:e._xpadplus,ppadminus:e._xpadminus})):a.expand(r,[r.r2c(e.x)],{ppadplus:Math.max(e._xpadplus,i),ppadminus:Math.max(e._xpadminus,i)})),n&&n.autorange&&(e.ayref===e.yref?(a.expand(n,[n.r2c(e.y)],{ppadplus:i,ppadminus:i}),a.expand(n,[n.r2c(e.ay)],{ppadplus:e._ypadplus,ppadminus:e._ypadminus})):a.expand(n,[n.r2c(e.y)],{ppadplus:Math.max(e._ypadplus,i),ppadminus:Math.max(e._ypadminus,i)}))})}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./draw").draw;e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.annotations);if(r.length&&t._fullData.length){var s={};r.forEach(function(t){s[t.xref]=!0,s[t.yref]=!0});var l=a.list(t).filter(function(t){return t.autorange&&s[t._id]});if(l.length)return i.syncOrAsync([o,n],t)}}},{"../../lib":658,"../../plots/cartesian/axes":691,"./draw":552}],550:[function(t,e,r){"use strict";function n(t,e){var r=a(t,e);return r.on.length>0||r.explicitOff.length>0}function i(t,e){var r,n=a(t,e),i=n.on,s=n.off.concat(n.explicitOff),l={};if(i.length||s.length){for(r=0;r<i.length;r++)l["annotations["+i[r]+"].visible"]=!0;for(r=0;r<s.length;r++)l["annotations["+s[r]+"].visible"]=!1;return o.update(t,{},l)}}function a(t,e){var r,n,i,a,o,s,l=t._fullLayout.annotations,u=[],c=[],h=[],f=(e||[]).length;for(r=0;r<l.length;r++)if(i=l[r],a=i.clicktoshow){for(n=0;n<f;n++)if(o=e[n],o.x===i._xclick&&o.y===i._yclick&&o.xaxis._id===i.xref&&o.yaxis._id===i.yref){s=i.visible?"onout"===a?c:h:u,s.push(r);break}n===f&&i.visible&&"onout"===a&&c.push(r)}return{on:u,off:c,explicitOff:h}}var o=t("../../plotly");e.exports={hasClickToShow:n,onClick:i}},{"../../plotly":686}],551:[function(t,e,r){"use strict";var n=t("../../plots/array_container_defaults"),i=t("./annotation_defaults");e.exports=function(t,e){var r={name:"annotations",handleItemDefaults:i};n(t,e,r)}},{"../../plots/array_container_defaults":688,"./annotation_defaults":546}],552:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r<e.annotations.length;r++)e.annotations[r].visible&&i(t,r);return u.previousPromises(t)}function i(t,e,r,u){function b(t){return t.call(d.font,rt).attr({"text-anchor":{left:"start",right:"end"}[H.align]||"middle"}),p.convertToTspans(t,_),t}function _(){function r(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]}nt.selectAll("tspan.line").attr({y:0,x:0});var n=K.select(".annotation-math-group"),i=!n.empty(),s=d.bBox((i?n:nt).node()),u=s.width,p=s.height,v=Math.round(u+2*tt),y=Math.round(p+2*tt);H._w=u,H._h=p;var b=!1;if(["x","y"].forEach(function(e){var n,i,a,o,s,l=H[e+"ref"]||e,u=H["a"+e+"ref"],f=h.getFromId(t,l),d=(W+("x"===e?0:-90))*Math.PI/180,p=v*Math.cos(d),m=y*Math.sin(d),g=Math.abs(p)+Math.abs(m),x=H[e+"anchor"],_=X[e];if(f){var w=f.r2fraction(H[e]);if((t._dragging||!f.autorange)&&(w<0||w>1)&&(u===l?(w=f.r2fraction(H["a"+e]),(w<0||w>1)&&(b=!0)):b=!0,b))return;n=f._offset+f.r2p(H[e]),o=.5}else"x"===e?(a=H[e],n=I.l+I.w*a):(a=1-H[e],n=I.t+I.h*a),o=H.showarrow?.5:a;if(H.showarrow){_.head=n;var M=H["a"+e];s=p*r(.5,H.xanchor)-m*r(.5,H.yanchor),u===l?(_.tail=f._offset+f.r2p(M),i=s):(_.tail=n+M,i=s+M),_.text=_.tail+s;var k=A["x"===e?"width":"height"];if("paper"===l&&(_.head=c.constrain(_.head,1,k-1)),"pixel"===u){var T=-Math.max(_.tail-3,_.text),E=Math.min(_.tail+3,_.text)-k;T>0?(_.tail+=T,_.text+=T):E>0&&(_.tail-=E,_.text-=E)}}else s=g*r(o,x),i=s,_.text=n+s;H["_"+e+"padplus"]=g/2+i,H["_"+e+"padminus"]=g/2-i,H["_"+e+"type"]=f&&f.type}),b)return void K.remove();if(i)n.select("svg").attr({x:tt-1,y:tt});else{var _=tt-s.top,w=tt-s.left;nt.attr({x:w,y:_}),nt.selectAll("tspan.line").attr({y:_,x:w})}et.call(d.setRect,Q/2,Q/2,v-Q,y-Q),K.call(c.setTranslate,Math.round(X.x.text-v/2),Math.round(X.y.text-y/2)),J.attr({transform:"rotate("+W+","+X.x.text+","+X.y.text+")"});var M="annotations["+e+"]",k=function(r,n){o.select(t).selectAll('.annotation-arrow-g[data-index="'+e+'"]').remove();var i=X.x.head,s=X.y.head,u=X.x.tail+r,h=X.y.tail+n,d=X.x.text+r,p=X.y.text+n,m=c.rotationXYMatrix(W,d,p),v=c.apply2DTransform(m),y=c.apply2DTransform2(m),b=+et.attr("width"),_=+et.attr("height"),w=d-.5*b,A=w+b,k=p-.5*_,T=k+_,E=[[w,k,w,T],[w,T,A,T],[A,T,A,k],[A,k,w,k]].map(y);if(!E.reduce(function(t,e){return t^!!a(i,s,i+1e6,s+1e6,e[0],e[1],e[2],e[3])},!1)){E.forEach(function(t){var e=a(u,h,i,s,t[0],t[1],t[2],t[3]);e&&(u=e.x,h=e.y)});var S=H.arrowwidth,L=H.arrowcolor,C=Z.append("g").style({opacity:f.opacity(L)}).classed("annotation-arrow-g",!0).attr("data-index",String(e)),z=C.append("path").attr("d","M"+u+","+h+"L"+i+","+s).style("stroke-width",S+"px").call(f.stroke,f.rgb(L));if(x(z,H.arrowhead,"end",H.arrowsize,H.standoff),t._context.editable&&z.node().parentNode){var D=i,P=s;if(H.standoff){var O=Math.sqrt(Math.pow(i-u,2)+Math.pow(s-h,2));D+=H.standoff*(u-i)/O,P+=H.standoff*(h-s)/O}var R,F,j,N=C.append("path").classed("annotation",!0).classed("anndrag",!0).attr({"data-index":String(e),d:"M3,3H-3V-3H3ZM0,0L"+(u-D)+","+(h-P),transform:"translate("+D+","+P+")"}).style("stroke-width",S+6+"px").call(f.stroke,"rgba(0,0,0,0)").call(f.fill,"rgba(0,0,0,0)");g.init({element:N.node(),prepFn:function(){var t=c.getTranslate(K);F=t.x,j=t.y,R={},Y&&Y.autorange&&(R[Y._name+".autorange"]=!0),G&&G.autorange&&(R[G._name+".autorange"]=!0)},moveFn:function(t,e){var r=v(F,j),n=r[0]+t,a=r[1]+e;K.call(c.setTranslate,n,a),R[M+".x"]=Y?Y.p2r(Y.r2p(H.x)+t):(i+t-I.l)/I.w,R[M+".y"]=G?G.p2r(G.r2p(H.y)+e):1-(s+e-I.t)/I.h,H.axref===H.xref&&(R[M+".ax"]=Y?Y.p2r(Y.r2p(H.ax)+t):(i+t-I.l)/I.w),H.ayref===H.yref&&(R[M+".ay"]=G?G.p2r(G.r2p(H.ay)+e):1-(s+e-I.t)/I.h),C.attr("transform","translate("+t+","+e+")"),J.attr({transform:"rotate("+W+","+n+","+a+")"})},doneFn:function(e){if(e){l.relayout(t,R);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}};if(H.showarrow&&k(0,0),t._context.editable){var T,E;g.init({element:K.node(),prepFn:function(){E=J.attr("transform"),T={}},moveFn:function(t,e){var r="pointer";if(H.showarrow)H.axref===H.xref?T[M+".ax"]=Y.p2r(Y.r2p(H.ax)+t):T[M+".ax"]=H.ax+t,H.ayref===H.yref?T[M+".ay"]=G.p2r(G.r2p(H.ay)+e):T[M+".ay"]=H.ay+e,k(t,e);else{if(Y)T[M+".x"]=H.x+t/Y._m;else{var n=H._xsize/I.w,i=H.x+H._xshift/I.w-n/2;T[M+".x"]=g.align(i+t/I.w,n,0,1,H.xanchor)}if(G)T[M+".y"]=H.y+e/G._m;else{var a=H._ysize/I.h,o=H.y-H._yshift/I.h-a/2;T[M+".y"]=g.align(o-e/I.h,a,0,1,H.yanchor)}Y&&G||(r=g.getCursor(Y?.5:T[M+".x"],G?.5:T[M+".y"],H.xanchor,H.yanchor))}J.attr({transform:"translate("+t+","+e+")"+E}),m(K,r)},doneFn:function(e){if(m(K),e){l.relayout(t,T);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}var w,M=t.layout,A=t._fullLayout;if(!s(e)||e===-1){if(!e&&Array.isArray(u))return M.annotations=u,y(M,A),void n(t);if("remove"===u)return delete M.annotations,A.annotations=[],void n(t);if(r&&"add"!==u){for(w=0;w<A.annotations.length;w++)i(t,w,r,u);return}e=A.annotations.length,A.annotations.push({})}if(!r&&u){if("remove"===u){for(A._infolayer.selectAll('.annotation[data-index="'+e+'"]').remove(),A.annotations.splice(e,1),M.annotations.splice(e,1),w=e;w<A.annotations.length;w++)A._infolayer.selectAll('.annotation[data-index="'+(w+1)+'"]').attr("data-index",String(w)),i(t,w);return}if("add"===u||c.isPlainObject(u)){A.annotations.splice(e,0,{});var k=c.isPlainObject(u)?c.extendFlat({},u):{text:"New text"};for(M.annotations?M.annotations.splice(e,0,k):M.annotations=[k],w=A.annotations.length-1;w>e;w--)A._infolayer.selectAll('.annotation[data-index="'+(w-1)+'"]').attr("data-index",String(w)),i(t,w)}}A._infolayer.selectAll('.annotation[data-index="'+e+'"]').remove();var T=M.annotations[e],E=A.annotations[e];if(T){var S={};"string"==typeof r&&r?S[r]=u:c.isPlainObject(r)&&(S=r);var L=Object.keys(S);for(w=0;w<L.length;w++){var C=L[w];c.nestedProperty(T,C).set(S[C])}if(T.visible!==!1){var I=A._size,z={xref:T.xref,yref:T.yref},D=["x","y"];for(w=0;w<2;w++){var P=D[w];if(void 0===S[P]&&void 0!==T[P]){var O=h.getFromId(t,h.coerceRef(z,{},t,P,"","paper")),R=h.getFromId(t,h.coerceRef(T,{},t,P,"","paper")),F=T[P],j=E["_"+P+"type"];if(void 0!==S[P+"ref"]){var N="auto"===T[P+"anchor"],B="x"===P?I.w:I.h,U=(E["_"+P+"size"]||0)/(2*B);if(O&&R)F=R.fraction2r(O.r2fraction(F));else if(O){if(F=O.r2fraction(F),F=O.domain[0]+F*(O.domain[1]-O.domain[0]),N){var V=F+U,q=F-U;F+q<2/3?F=q:F+V>4/3&&(F=V)}}else R&&(N&&(F<1/3?F+=U:F>2/3&&(F-=U)),F=(F-R.domain[0])/(R.domain[1]-R.domain[0]),F=R.fraction2r(F))}R&&R===O&&j&&("log"===j&&"log"!==R.type?F=Math.pow(10,F):"log"!==j&&"log"===R.type&&(F=F>0?Math.log(F)/Math.LN10:void 0)),T[P]=F}}var H={};v(T,H,A),A.annotations[e]=H;var Y=h.getFromId(t,H.xref),G=h.getFromId(t,H.yref),X={x:{},y:{}},W=+H.textangle||0,Z=A._infolayer.append("g").classed("annotation",!0).attr("data-index",String(e)).style("opacity",H.opacity).on("click",function(){t._dragging=!1,t.emit("plotly_clickannotation",{index:e,annotation:T,fullAnnotation:H})}),J=Z.append("g").classed("annotation-text-g",!0).attr("data-index",String(e)),K=J.append("g"),Q=H.borderwidth,$=H.borderpad,tt=Q+$,et=K.append("rect").attr("class","bg").style("stroke-width",Q+"px").call(f.stroke,H.bordercolor).call(f.fill,H.bgcolor),rt=H.font,nt=K.append("text").classed("annotation",!0).attr("data-unformatted",H.text).text(H.text);t._context.editable?nt.call(p.makeEditable,K).call(b).on("edit",function(r){H.text=r,this.attr({"data-unformatted":H.text}),this.call(b);var n={};n["annotations["+e+"].text"]=H.text,Y&&Y.autorange&&(n[Y._name+".autorange"]=!0),G&&G.autorange&&(n[G._name+".autorange"]=!0),l.relayout(t,n)}):nt.call(b)}}}function a(t,e,r,n,i,a,o,s){var l=r-t,u=i-t,c=o-i,h=n-e,f=a-e,d=s-a,p=l*d-c*h;if(0===p)return null;var m=(u*d-c*f)/p,g=(u*h-l*f)/p;return g<0||g>1||m<0||m>1?null:{x:t+l*m,y:e+h*m}}var o=t("d3"),s=t("fast-isnumeric"),l=t("../../plotly"),u=t("../../plots/plots"),c=t("../../lib"),h=t("../../plots/cartesian/axes"),f=t("../color"),d=t("../drawing"),p=t("../../lib/svg_text_utils"),m=t("../../lib/setcursor"),g=t("../dragelement"),v=t("./annotation_defaults"),y=t("./defaults"),x=t("./draw_arrow_head");e.exports={draw:n,drawOne:i}},{"../../lib":658,"../../lib/setcursor":670,"../../lib/svg_text_utils":674,"../../plotly":686,"../../plots/cartesian/axes":691,"../../plots/plots":751,"../color":558,"../dragelement":579,"../drawing":581,"./annotation_defaults":546,"./defaults":551,"./draw_arrow_head":553,d3:97,"fast-isnumeric":106}],553:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../color"),o=t("../drawing"),s=t("./arrow_paths");e.exports=function(t,e,r,l,u){function c(){t.style("stroke-dasharray","0px,100px")}function h(r,i){d.path&&(e>5&&(i=0),n.select(f.parentElement).append("path").attr({class:t.attr("class"),d:d.path,transform:"translate("+r.x+","+r.y+")rotate("+180*i/Math.PI+")scale("+y+")"}).style({fill:x,opacity:b,"stroke-width":0}))}i(l)||(l=1);var f=t.node(),d=s[e||0];"string"==typeof r&&r||(r="end");var p,m,g,v,y=(o.getPx(t,"stroke-width")||1)*l,x=t.style("stroke")||a.defaultLine,b=t.style("stroke-opacity")||1,_=r.indexOf("start")>=0,w=r.indexOf("end")>=0,M=d.backoff*y+u;if("line"===f.nodeName){p={x:+t.attr("x1"),y:+t.attr("y1")},m={x:+t.attr("x2"),y:+t.attr("y2")};var A=p.x-m.x,k=p.y-m.y;if(g=Math.atan2(k,A),v=g+Math.PI,M){if(M*M>A*A+k*k)return void c();var T=M*Math.cos(g),E=M*Math.sin(g);_&&(p.x-=T,p.y-=E,t.attr({x1:p.x,y1:p.y})),w&&(m.x+=T,m.y+=E,t.attr({x2:m.x,y2:m.y}))}}else if("path"===f.nodeName){var S=f.getTotalLength(),L="";if(S<M)return void c();if(_){var C=f.getPointAtLength(0),I=f.getPointAtLength(.1);g=Math.atan2(C.y-I.y,C.x-I.x),p=f.getPointAtLength(Math.min(M,S)),M&&(L="0px,"+M+"px,")}if(w){var z=f.getPointAtLength(S),D=f.getPointAtLength(S-.1);if(v=Math.atan2(z.y-D.y,z.x-D.x),m=f.getPointAtLength(Math.max(0,S-M)),M){var P=L?2*M:M;L+=S-P+"px,"+S+"px"}}else L&&(L+=S+"px");L&&t.style("stroke-dasharray",L)}_&&h(p,g),w&&h(m,v)}},{"../color":558,"../drawing":581,"./arrow_paths":547,d3:97,"fast-isnumeric":106}],554:[function(t,e,r){"use strict";var n=t("./draw"),i=t("./click");e.exports={moduleType:"component",name:"annotations",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne,hasClickToShow:i.hasClickToShow,onClick:i.onClick}},{"./attributes":548,"./calc_autorange":549,"./click":550,"./defaults":551,"./draw":552}],555:[function(t,e,r){"use strict";e.exports=t("world-calendars/dist/main"),t("world-calendars/dist/plus"),t("world-calendars/dist/calendars/chinese"),t("world-calendars/dist/calendars/coptic"),t("world-calendars/dist/calendars/discworld"),t("world-calendars/dist/calendars/ethiopian"),t("world-calendars/dist/calendars/hebrew"),t("world-calendars/dist/calendars/islamic"),t("world-calendars/dist/calendars/julian"),t("world-calendars/dist/calendars/mayan"),t("world-calendars/dist/calendars/nanakshahi"),t("world-calendars/dist/calendars/nepali"),t("world-calendars/dist/calendars/persian"),t("world-calendars/dist/calendars/taiwan"),t("world-calendars/dist/calendars/thai"),t("world-calendars/dist/calendars/ummalqura")},{"world-calendars/dist/calendars/chinese":528,"world-calendars/dist/calendars/coptic":529,"world-calendars/dist/calendars/discworld":530,"world-calendars/dist/calendars/ethiopian":531,"world-calendars/dist/calendars/hebrew":532,"world-calendars/dist/calendars/islamic":533,"world-calendars/dist/calendars/julian":534,"world-calendars/dist/calendars/mayan":535,"world-calendars/dist/calendars/nanakshahi":536,"world-calendars/dist/calendars/nepali":537,"world-calendars/dist/calendars/persian":538,"world-calendars/dist/calendars/taiwan":539,"world-calendars/dist/calendars/thai":540,"world-calendars/dist/calendars/ummalqura":541,"world-calendars/dist/main":542,"world-calendars/dist/plus":543}],556:[function(t,e,r){"use strict";function n(t,e,r){for(var n,a,o,s,l,u=Math.floor((e+.05)/h)+c,f=i(r).fromJD(u),d=0;(d=t.indexOf("%",d))!==-1;)n=t.charAt(d+1),"0"===n||"-"===n||"_"===n?(o=3,a=t.charAt(d+2),"_"===n&&(n="-")):(a=n,n="0",o=2),s=x[a],s?(l=s===y?y:f.formatDate(s[n]),t=t.substr(0,d)+l+t.substr(d+o),d+=l.length):d+=o;return t}function i(t){var e=b[t];return e?e:e=b[t]=s.instance(t)}function a(t){return l.extendFlat({},f,{description:t})}function o(t){return"Sets the calendar system to use with `"+t+"` date data."}var s=t("./calendars"),l=t("../../lib"),u=t("../../constants/numerical"),c=u.EPOCHJD,h=u.ONEDAY,f={valType:"enumerated",values:Object.keys(s.calendars),dflt:"gregorian"},d=function(t,e,r,n){var i={};return i[r]=f,l.coerce(t,e,i,r,n)},p=function(t,e,r,n){for(var i=0;i<r.length;i++)d(t,e,r[i]+"calendar",n.calendar)},m={chinese:"2000-01-01",coptic:"2000-01-01",discworld:"2000-01-01",ethiopian:"2000-01-01",hebrew:"5000-01-01",islamic:"1000-01-01",julian:"2000-01-01",mayan:"5000-01-01",nanakshahi:"1000-01-01",nepali:"2000-01-01",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-01",thai:"2000-01-01",ummalqura:"1400-01-01"},g={chinese:"2000-01-02",coptic:"2000-01-03",discworld:"2000-01-03",ethiopian:"2000-01-05",hebrew:"5000-01-01",islamic:"1000-01-02",julian:"2000-01-03",mayan:"5000-01-01",nanakshahi:"1000-01-05",nepali:"2000-01-05",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-04",thai:"2000-01-04",ummalqura:"1400-01-06"},v={chinese:["2000-01-01","2001-01-01"],coptic:["1700-01-01","1701-01-01"],discworld:["1800-01-01","1801-01-01"],ethiopian:["2000-01-01","2001-01-01"],hebrew:["5700-01-01","5701-01-01"],islamic:["1400-01-01","1401-01-01"],julian:["2000-01-01","2001-01-01"],mayan:["5200-01-01","5201-01-01"],nanakshahi:["0500-01-01","0501-01-01"],nepali:["2000-01-01","2001-01-01"],persian:["1400-01-01","1401-01-01"],jalali:["1400-01-01","1401-01-01"],taiwan:["0100-01-01","0101-01-01"],thai:["2500-01-01","2501-01-01"],ummalqura:["1400-01-01","1401-01-01"]},y="##",x={d:{0:"dd","-":"d"},e:{0:"d","-":"d"},a:{0:"D","-":"D"},A:{0:"DD","-":"DD"},j:{0:"oo","-":"o"},W:{0:"ww","-":"w"},m:{0:"mm","-":"m"},b:{0:"M","-":"M"},B:{0:"MM","-":"MM"},y:{0:"yy","-":"yy"},Y:{0:"yyyy","-":"yyyy"},U:y,w:y,c:{0:"D M d %X yyyy","-":"D M d %X yyyy"},x:{0:"mm/dd/yyyy","-":"mm/dd/yyyy"}},b={},_={xcalendar:a(o("x"))},w=l.extendFlat({},_,{ycalendar:a(o("y"))}),M=l.extendFlat({},w,{zcalendar:a(o("z"))}),A=a(["Sets the calendar system to use for `range` and `tick0`","if this is a date axis. This does not set the calendar for","interpreting data on this axis, that's specified in the trace","or via the global `layout.calendar`"].join(" "));e.exports={moduleType:"component",name:"calendars",schema:{traces:{scatter:w,bar:w,heatmap:w,contour:w,histogram:w,histogram2d:w,histogram2dcontour:w,scatter3d:M,surface:M,mesh3d:M,scattergl:w,ohlc:_,candlestick:_},layout:{calendar:a(["Sets the default calendar system to use for interpreting and","displaying dates throughout the plot."].join(" ")),"xaxis.calendar":A,"yaxis.calendar":A,"scene.xaxis.calendar":A,"scene.yaxis.calendar":A,"scene.zaxis.calendar":A},transforms:{filter:{valuecalendar:a(["Sets the calendar system to use for `value`, if it is a date."].join(" ")),targetcalendar:a(["Sets the calendar system to use for `target`, if it is an","array of dates. If `target` is a string (eg *x*) we use the","corresponding trace attribute (eg `xcalendar`) if it exists,","even if `targetcalendar` is provided."].join(" "))}}},layoutAttributes:f,handleDefaults:d,handleTraceDefaults:p,CANONICAL_SUNDAY:g,CANONICAL_TICK:m,DFLTRANGE:v,getCal:i,worldCalFmt:n}},{"../../constants/numerical":641,"../../lib":658,"./calendars":555}],557:[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},{}],558:[function(t,e,r){"use strict";function n(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 s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}var i=t("tinycolor2"),a=t("fast-isnumeric"),o=e.exports={},s=t("./attributes");o.defaults=s.defaults,o.defaultLine=s.defaultLine,o.lightLine=s.lightLine,o.background=s.background,o.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},o.rgb=function(t){return o.tinyRGB(i(t))},o.opacity=function(t){return t?i(t).getAlpha():0},o.addOpacity=function(t,e){var r=i(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=i(t).toRgb();if(1===r.a)return i(t).toRgbString();var n=i(e||o.background).toRgb(),a=1===n.a?n:{r:255*(1-n.a)+n.r*n.a,g:255*(1-n.a)+n.g*n.a,b:255*(1-n.a)+n.b*n.a},s={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return i(s).toRgbString()},o.contrast=function(t,e,r){var n=i(t),a=n.isLight()?n.darken(r):n.lighten(e);return a.toString()},o.stroke=function(t,e){var r=i(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=i(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,i,a,s=Object.keys(t);for(e=0;e<s.length;e++)if(i=s[e],a=t[i],"color"===i.substr(i.length-5))if(Array.isArray(a))for(r=0;r<a.length;r++)a[r]=n(a[r]);else t[i]=n(a);else if("colorscale"===i.substr(i.length-10)&&Array.isArray(a))for(r=0;r<a.length;r++)Array.isArray(a[r])&&(a[r][1]=n(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++)o.clean(a[r])}else a&&"object"==typeof a&&o.clean(a)}}},{"./attributes":557,"fast-isnumeric":106,tinycolor2:495}],559:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/layout_attributes"),i=t("../../plots/font_attributes"),a=t("../../lib/extend").extendFlat;e.exports={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:a({},n.ticks,{dflt:""}),ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,tickfont:n.tickfont,tickangle:n.tickangle,tickformat:n.tickformat,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,separatethousands:n.separatethousands,exponentformat:n.exponentformat,showexponent:n.showexponent,title:{valType:"string",dflt:"Click to enter colorscale title"},titlefont:a({},i,{}),titleside:{valType:"enumerated",values:["right","top","bottom"],dflt:"top"}}},{"../../lib/extend":651,"../../plots/cartesian/layout_attributes":700,"../../plots/font_attributes":711}],560:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/tick_value_defaults"),a=t("../../plots/cartesian/tick_mark_defaults"),o=t("../../plots/cartesian/tick_label_defaults"),s=t("./attributes");e.exports=function(t,e,r){function l(t,e){return n.coerce(c,u,s,t,e)}var u=e.colorbar={},c=t.colorbar||{},h=l("thicknessmode");l("thickness","fraction"===h?30/(r.width-r.margin.l-r.margin.r):30);var f=l("lenmode");l("len","fraction"===f?1:r.height-r.margin.t-r.margin.b),l("x"),l("xanchor"),l("xpad"),l("y"),l("yanchor"),l("ypad"),n.noneOrAll(c,u,["x","y"]),l("outlinecolor"),l("outlinewidth"),l("bordercolor"),l("borderwidth"),l("bgcolor"),i(c,u,l,"linear"),o(c,u,l,"linear",{outerTicks:!1,font:r.font,noHover:!0}),a(c,u,l,"linear",{outerTicks:!1,font:r.font,noHover:!0}),l("title"),n.coerceFont(l,"titlefont",r.font),l("titleside")}},{"../../lib":658,"../../plots/cartesian/tick_label_defaults":706,"../../plots/cartesian/tick_mark_defaults":707,"../../plots/cartesian/tick_value_defaults":708,"./attributes":559}],561:[function(t,e,r){"use strict";var n=t("d3"),i=t("tinycolor2"),a=t("../../plotly"),o=t("../../plots/plots"),s=t("../../registry"),l=t("../../plots/cartesian/axes"),u=t("../dragelement"),c=t("../../lib"),h=t("../../lib/extend").extendFlat,f=t("../../lib/setcursor"),d=t("../drawing"),p=t("../color"),m=t("../titles"),g=t("../../plots/cartesian/axis_defaults"),v=t("../../plots/cartesian/position_defaults"),y=t("../../plots/cartesian/layout_attributes"),x=t("./attributes");e.exports=function(t,e){function r(){function x(t,e){return c.coerce(Q,$,y,t,e)}function w(){if(["top","bottom"].indexOf(_.titleside)!==-1){var e=at.select(".cbtitle"),r=e.select("text"),a=[-_.outlinewidth/2,_.outlinewidth/2],o=e.select(".h"+$._id+"title-math-group").node(),s=15.6;if(r.node()&&(s=1.3*parseInt(r.style("font-size"),10)),o?(st=d.bBox(o).height,st>s&&(a[1]-=(st-s)/2)):r.node()&&!r.classed("js-placeholder")&&(st=d.bBox(e.node()).height),st){if(st+=5,"top"===_.titleside)$.domain[1]-=st/T.h,a[1]*=-1;else{$.domain[0]+=st/T.h;var u=Math.max(1,r.selectAll("tspan.line").size());a[1]+=(1-u)*s}e.attr("transform","translate("+a+")"),$.setScale()}}at.selectAll(".cbfills,.cblines,.cbaxis").attr("transform","translate(0,"+Math.round(T.h*(1-$.domain[1]))+")");var h=at.select(".cbfills").selectAll("rect.cbfill").data(C);h.enter().append("rect").classed("cbfill",!0).style("stroke","none"),h.exit().remove(),h.each(function(t,e){var r=[0===e?S[0]:(C[e]+C[e-1])/2,e===C.length-1?S[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 a=z(t).replace("e-",""),o=i(a).toHexString();n.select(this).attr({x:X,width:Math.max(B,2),y:n.min(r),height:Math.max(n.max(r)-n.min(r),2),fill:o})});var f=at.select(".cblines").selectAll("path.cbline").data(_.line.color&&_.line.width?L:[]);return f.enter().append("path").classed("cbline",!0),f.exit().remove(),f.each(function(t){n.select(this).attr("d","M"+X+","+(Math.round($.c2p(t))+_.line.width/2%1)+"h"+B).call(d.lineGroupStyle,_.line.width,I(t),_.line.dash)}),$._axislayer.selectAll("g."+$._id+"tick,path").remove(),$._pos=X+B+(_.outlinewidth||0)/2-("outside"===_.ticks?1:0),$.side="right",c.syncOrAsync([function(){return l.doTicks(t,$,!0)},function(){if(["top","bottom"].indexOf(_.titleside)===-1){var e=$.titlefont.size,r=$._offset+$._length/2,i=T.l+($.position||0)*T.w+("right"===$.side?10+e*($.showticklabels?1:.5):-10-e*($.showticklabels?.5:0));M("h"+$._id+"title",{avoid:{selection:n.select(t).selectAll("g."+$._id+"tick"),side:_.titleside,offsetLeft:T.l,offsetTop:T.t,maxShift:k.width},attributes:{x:i,y:r,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])}function M(e,r){var n,i=b();n=s.traceIs(i,"markerColorscale")?"marker.colorbar.title":"colorbar.title";var a={propContainer:$,propName:n,traceIndex:i.index,dfltName:"colorscale",containerGroup:at.select(".cbtitle")},o="h"===e.charAt(0)?e.substr(1):"h"+e;at.selectAll("."+o+",."+o+"-math-group").remove(),m.draw(t,e,h(a,r||{}))}function A(){var r=B+_.outlinewidth/2+d.bBox($._axislayer.node()).width;if(F=ot.select("text"),F.node()&&!F.classed("js-placeholder")){var n,i=ot.select(".h"+$._id+"title-math-group").node();n=i&&["top","bottom"].indexOf(_.titleside)!==-1?d.bBox(i).width:d.bBox(ot.node()).right-X-T.l,r=Math.max(r,n)}var a=2*_.xpad+r+_.borderwidth+_.outlinewidth/2,s=J-K;at.select(".cbbg").attr({x:X-_.xpad-(_.borderwidth+_.outlinewidth)/2,y:K-Y,width:Math.max(a,2),height:Math.max(s+2*Y,2)}).call(p.fill,_.bgcolor).call(p.stroke,_.bordercolor).style({"stroke-width":_.borderwidth}),at.selectAll(".cboutline").attr({x:X,y:K+_.ypad+("top"===_.titleside?st:0),width:Math.max(B,2),height:Math.max(s-2*_.ypad-st,2)}).call(p.stroke,_.outlinecolor).style({fill:"None","stroke-width":_.outlinewidth});var l=({center:.5,right:1}[_.xanchor]||0)*a;at.attr("transform","translate("+(T.l-l)+","+T.t+")"),o.autoMargin(t,e,{x:_.x,y:_.y,l:a*({right:1,center:.5}[_.xanchor]||0),r:a*({left:1,center:.5}[_.xanchor]||0),t:s*({bottom:1,middle:.5}[_.yanchor]||0),b:s*({top:1,middle:.5}[_.yanchor]||0)})}var k=t._fullLayout,T=k._size;if("function"!=typeof _.fillcolor&&"function"!=typeof _.line.color)return void k._infolayer.selectAll("g."+e).remove();var E,S=n.extent(("function"==typeof _.fillcolor?_.fillcolor:_.line.color).domain()),L=[],C=[],I="function"==typeof _.line.color?_.line.color:function(){return _.line.color},z="function"==typeof _.fillcolor?_.fillcolor:function(){return _.fillcolor},D=_.levels.end+_.levels.size/100,P=_.levels.size,O=1.001*S[0]-.001*S[1],R=1.001*S[1]-.001*S[0];for(E=_.levels.start;(E-D)*P<0;E+=P)E>O&&E<R&&L.push(E);if("function"==typeof _.fillcolor)if(_.filllevels)for(D=_.filllevels.end+_.filllevels.size/100,P=_.filllevels.size,E=_.filllevels.start;(E-D)*P<0;E+=P)E>S[0]&&E<S[1]&&C.push(E);else C=L.map(function(t){return t-_.levels.size/2}),C.push(C[C.length-1]+_.levels.size);else _.fillcolor&&"string"==typeof _.fillcolor&&(C=[0]);_.levels.size<0&&(L.reverse(),C.reverse());var F,j=k.height-k.margin.t-k.margin.b,N=k.width-k.margin.l-k.margin.r,B=Math.round(_.thickness*("fraction"===_.thicknessmode?N:1)),U=B/T.w,V=Math.round(_.len*("fraction"===_.lenmode?j:1)),q=V/T.h,H=_.xpad/T.w,Y=(_.borderwidth+_.outlinewidth)/2,G=_.ypad/T.h,X=Math.round(_.x*T.w+_.xpad),W=_.x-U*({middle:.5,right:1}[_.xanchor]||0),Z=_.y+q*(({top:-.5,bottom:.5}[_.yanchor]||0)-.5),J=Math.round(T.h*(1-Z)),K=J-V,Q={type:"linear",range:S,tickmode:_.tickmode,nticks:_.nticks,tick0:_.tick0,dtick:_.dtick,tickvals:_.tickvals,ticktext:_.ticktext,ticks:_.ticks,ticklen:_.ticklen,tickwidth:_.tickwidth,tickcolor:_.tickcolor,showticklabels:_.showticklabels,tickfont:_.tickfont,tickangle:_.tickangle,tickformat:_.tickformat,exponentformat:_.exponentformat,separatethousands:_.separatethousands,showexponent:_.showexponent,showtickprefix:_.showtickprefix,tickprefix:_.tickprefix,showticksuffix:_.showticksuffix,ticksuffix:_.ticksuffix,title:_.title,titlefont:_.titlefont,anchor:"free",position:1},$={},tt={letter:"y",font:k.font,noHover:!0,calendar:k.calendar};if(g(Q,$,x,tt),v(Q,$,x,tt),$._id="y"+e,$._gd=t,$.position=_.x+H+U,r.axis=$,["top","bottom"].indexOf(_.titleside)!==-1&&($.titleside=_.titleside,$.titlex=_.x+H,$.titley=Z+("top"===_.titleside?q-G:G)),_.line.color&&"auto"===_.tickmode){$.tickmode="linear",$.tick0=_.levels.start;var et=_.levels.size,rt=c.constrain((J-K)/50,4,15)+1,nt=(S[1]-S[0])/((_.nticks||rt)*et);if(nt>1){var it=Math.pow(10,Math.floor(Math.log(nt)/Math.LN10));et*=it*c.roundUp(nt/it,[2,5,10]),(Math.abs(_.levels.start)/_.levels.size+1e-6)%1<2e-6&&($.tick0=0)}$.dtick=et}$.domain=[Z+G,Z+q-G],$.setScale();var at=k._infolayer.selectAll("g."+e).data([0]);at.enter().append("g").classed(e,!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(T.l)+","+Math.round(T.t)+")");var ot=at.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(T.l)+",-"+Math.round(T.t)+")");$._axislayer=at.select(".cbaxis");var st=0;if(["top","bottom"].indexOf(_.titleside)!==-1){var lt,ut=T.l+(_.x+H)*T.w,ct=$.titlefont.size;lt="top"===_.titleside?(1-(Z+q-G))*T.h+T.t+3+.75*ct:(1-(Z+G))*T.h+T.t-3-.25*ct,M($._id+"title",{attributes:{x:ut,y:lt,"text-anchor":"start"}})}var ht=c.syncOrAsync([o.previousPromises,w,o.previousPromises,A],t);if(ht&&ht.then&&(t._promises||[]).push(ht),t._context.editable){var ft,dt,pt;u.init({element:at.node(),prepFn:function(){ft=at.attr("transform"),f(at)},moveFn:function(t,e){at.attr("transform",ft+" translate("+t+","+e+")"),dt=u.align(W+t/T.w,U,0,1,_.xanchor),pt=u.align(Z-e/T.h,q,0,1,_.yanchor);var r=u.getCursor(dt,pt,_.xanchor,_.yanchor);f(at,r)},doneFn:function(e){f(at),e&&void 0!==dt&&void 0!==pt&&a.restyle(t,{"colorbar.x":dt,"colorbar.y":pt},b().index)}})}return ht}function b(){var r,n,i=e.substr(2);for(r=0;r<t._fullData.length;r++)if(n=t._fullData[r],n.uid===i)return n}var _={};return Object.keys(x).forEach(function(t){_[t]=null}),_.fillcolor=null,_.line={color:null,width:null,dash:null},_.levels={start:null,end:null,size:null},_.filllevels=null,Object.keys(_).forEach(function(t){r[t]=function(e){return arguments.length?(_[t]=c.isPlainObject(_[t])?c.extendFlat(_[t],e):e,r):_[t]}}),r.options=function(t){return Object.keys(t).forEach(function(e){"function"==typeof r[e]&&r[e](t[e])}),r},r._opts=_,r}},{"../../lib":658,"../../lib/extend":651,"../../lib/setcursor":670,"../../plotly":686,"../../plots/cartesian/axes":691,"../../plots/cartesian/axis_defaults":693,"../../plots/cartesian/layout_attributes":700,"../../plots/cartesian/position_defaults":703,"../../plots/plots":751,"../../registry":766,"../color":558,"../dragelement":579,"../drawing":581,"../titles":632,"./attributes":559,d3:97,tinycolor2:495}],562:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":658}],563:[function(t,e,r){"use strict";e.exports={zauto:{valType:"boolean",dflt:!0},zmin:{valType:"number",dflt:null},zmax:{valType:"number",dflt:null},colorscale:{valType:"colorscale"},autocolorscale:{valType:"boolean",dflt:!0},reversescale:{valType:"boolean",dflt:!1},showscale:{valType:"boolean",dflt:!0}}},{}],564:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./scales"),a=t("./flip_scale");e.exports=function(t,e,r,o){var s,l;r?(s=n.nestedProperty(t,r).get(),l=n.nestedProperty(t._input,r).get()):(s=t,l=t._input);var u=s[o+"auto"],c=s[o+"min"],h=s[o+"max"],f=s.colorscale;u===!1&&void 0!==c||(c=n.aggNums(Math.min,null,e)),u===!1&&void 0!==h||(h=n.aggNums(Math.max,null,e)),c===h&&(c-=.5,h+=.5),s[o+"min"]=c,s[o+"max"]=h,l[o+"min"]=c,l[o+"max"]=h,s.autocolorscale&&(f=c*h<0?i.RdBu:c>=0?i.Reds:i.Blues,l.colorscale=f,s.reversescale&&(f=a(f)),s.colorscale=f)}},{"../../lib":658,"./flip_scale":569,"./scales":576}],565:[function(t,e,r){"use strict";var n=t("./attributes"),i=t("../../lib/extend").extendDeep;t("./scales.js");e.exports=function(t){return{color:{valType:"color",arrayOk:!0},colorscale:i({},n.colorscale,{}),cauto:i({},n.zauto,{}),cmax:i({},n.zmax,{}),cmin:i({},n.zmin,{}),autocolorscale:i({},n.autocolorscale,{}),reversescale:i({},n.reversescale,{})}}},{"../../lib/extend":651,"./attributes":563,"./scales.js":576}],566:[function(t,e,r){"use strict";var n=t("./scales");e.exports=n.RdBu},{"./scales":576}],567:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),s=t("./is_valid_scale"),l=t("./flip_scale");e.exports=function(t,e,r,u,c){var h=c.prefix,f=c.cLetter,d=h.slice(0,h.length-1),p=h?i.nestedProperty(t,d).get()||{}:t,m=h?i.nestedProperty(e,d).get()||{}:e,g=p[f+"min"],v=p[f+"max"],y=p.colorscale,x=n(g)&&n(v)&&g<v;u(h+f+"auto",!x),u(h+f+"min"),u(h+f+"max");var b;void 0!==y&&(b=!s(y)),u(h+"autocolorscale",b);var _=u(h+"colorscale"),w=u(h+"reversescale");if(w&&(m.colorscale=l(_)),"marker.line."!==h){var M;h&&(M=a(p));var A=u(h+"showscale",M);A&&o(p,m,r)}}},{"../../lib":658,"../colorbar/defaults":560,"../colorbar/has_colorbar":562,"./flip_scale":569,"./is_valid_scale":573,"fast-isnumeric":106}],568:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n=t.length,i=new Array(n),a=new Array(n),o=0;o<n;o++){var s=t[o];i[o]=e+s[0]*(r-e),a[o]=s[1]}return{domain:i,range:a}}},{}],569:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=new Array(r),i=r-1,a=0;i>=0;i--,a++)e=t[i],n[a]=[1-e[0],e[1]];return n}},{}],570:[function(t,e,r){"use strict";var n=t("./scales"),i=t("./default_scale"),a=t("./is_valid_scale_array");e.exports=function(t,e){function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return e||(e=i),t?("string"==typeof t&&(r(),"string"==typeof t&&r()),a(t)?t:e):e}},{"./default_scale":566,"./is_valid_scale_array":574,"./scales":576}],571:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./is_valid_scale");e.exports=function(t,e){var r=e?i.nestedProperty(t,e).get()||{}:t,o=r.color,s=!1;if(Array.isArray(o))for(var l=0;l<o.length;l++)if(n(o[l])){s=!0;break}return i.isPlainObject(r)&&(s||r.showscale===!0||n(r.cmin)&&n(r.cmax)||a(r.colorscale)||i.isPlainObject(r.colorbar))}},{"../../lib":658,"./is_valid_scale":573,"fast-isnumeric":106}],572:[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":563,"./calc":564,"./default_scale":566,"./defaults":567,"./extract_scale":568,"./flip_scale":569,"./get_scale":570,"./has_colorscale":571,"./is_valid_scale":573,"./make_color_scale_func":575,"./scales":576}],573:[function(t,e,r){"use strict";var n=t("./scales"),i=t("./is_valid_scale_array");e.exports=function(t){return void 0!==n[t]||i(t)}},{"./is_valid_scale_array":574,"./scales":576}],574:[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 i=t[r];if(2!==i.length||+i[0]<e||!n(i[1]).isValid())return!1;e=+i[0]}return!0}},{tinycolor2:495}],575:[function(t,e,r){"use strict";function n(t){var e={r:t[0],g:t[1],b:t[2],a:t[3]};return a(e).toRgbString()}var i=t("d3"),a=t("tinycolor2"),o=t("fast-isnumeric"),s=t("../color");e.exports=function(t,e){e=e||{};for(var r=t.domain,l=t.range,u=l.length,c=new Array(u),h=0;h<u;h++){var f=a(l[h]).toRgb();c[h]=[f.r,f.g,f.b,f.a]}var d,p=i.scale.linear().domain(r).range(c).clamp(!0),m=e.noNumericCheck,g=e.returnArray;return d=m&&g?p:m?function(t){return n(p(t))}:g?function(t){return o(t)?p(t):a(t).isValid()?t:s.defaultLine}:function(t){return o(t)?n(p(t)):a(t).isValid()?t:s.defaultLine},d.domain=p.domain,d.range=function(){return l},d}},{"../color":558,d3:97,"fast-isnumeric":106,tinycolor2:495}],576:[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"]]}},{}],577:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){var a=(t-r)/(n-r),o=a+e/(n-r),s=(a+o)/2;return"left"===i||"bottom"===i?a:"center"===i||"middle"===i?s:"right"===i||"top"===i?o:a<2/3-s?a:o>4/3-s?o:s}},{}],578:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":658}],579:[function(t,e,r){"use strict";function n(){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 i(t){t._dragging=!1,t._replotPending&&a.plot(t)}var a=t("../../plotly"),o=t("../../lib"),s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var u=t("./unhover");l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(t){function e(e){return t.element.onmousemove=p,m._dragged=!1,m._dragging=!0,u=e.clientX,c=e.clientY,d=e.target,h=(new Date).getTime(),h-m._mouseDownTime<v?g+=1:(g=1,m._mouseDownTime=h),t.prepFn&&t.prepFn(e,u,c),f=n(),f.onmousemove=r,f.onmouseup=a,f.onmouseout=a,f.style.cursor=window.getComputedStyle(t.element).cursor,o.pauseEvent(e)}function r(e){var r=e.clientX-u,n=e.clientY-c,i=t.minDrag||s.MINDRAG;return Math.abs(r)<i&&(r=0),Math.abs(n)<i&&(n=0),(r||n)&&(m._dragged=!0,l.unhover(m)),t.moveFn&&t.moveFn(r,n,m._dragged),o.pauseEvent(e)}function a(e){if(p=t.element.onmousemove,t.setCursor&&(t.element.onmousemove=t.setCursor),f.onmousemove=null,f.onmouseup=null,f.onmouseout=null,o.removeElement(f),!m._dragging)return void(m._dragged=!1);if(m._dragging=!1,(new Date).getTime()-m._mouseDownTime>v&&(g=Math.max(g-1,1)),t.doneFn&&t.doneFn(m._dragged,g),!m._dragged){var r=document.createEvent("MouseEvents");r.initEvent("click",!0,!0),d.dispatchEvent(r)}return i(m),m._dragged=!1,o.pauseEvent(e)}var u,c,h,f,d,p,m=o.getPlotDiv(t.element)||{},g=1,v=s.DBLCLICKDELAY;m._mouseDownTime||(m._mouseDownTime=0),p=t.element.onmousemove,t.setCursor&&(t.element.onmousemove=t.setCursor),t.element.onmousedown=e,t.element.style.pointerEvents="all"},l.coverSlip=n},{"../../lib":658,"../../plotly":686,"../../plots/cartesian/constants":696,"./align":577,"./cursor":578,"./unhover":580}],580:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=e.exports={};i.wrapped=function(t,e,r){"string"==typeof t&&(t=document.getElementById(t)),t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),i.raw(t,e,r)},i.raw=function(t,e){var r=t._fullLayout;e||(e={}),e.target&&n.triggerHandler(t,"plotly_beforehover",e)===!1||(r._hoverlayer.selectAll("g").remove(),e.target&&t._hoverdata&&t.emit("plotly_unhover",{points:t._hoverdata}),t._hoverdata=void 0)}},{"../../lib/events":650}],581:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o){if(s.traceIs(r,"symbols")){var u=p(r);e.attr("d",function(t){var e;e="various"===t.ms||"various"===a.size?3:d.isBubble(r)?u(t.ms):(a.size||6)/2,t.mrc=e;var n=m.symbolNumber(t.mx||a.symbol)||0,i=n%100;return t.om=n%200>=100,m.symbolFuncs[i](e)+(n>=200?y:"")}).style("opacity",function(t){return(t.mo+1||a.opacity+1)-1})}var c,h,f;t.so?(f=o.outlierwidth,h=o.outliercolor,c=a.outliercolor):(f=(t.mlw+1||o.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,h="mlc"in t?t.mlcc=i(t.mlc):Array.isArray(o.color)?l.defaultLine:o.color,c="mc"in t?t.mcc=n(t.mc):Array.isArray(a.color)?l.defaultLine:a.color||"rgba(0,0,0,0)"),t.om?e.call(l.stroke,c).style({"stroke-width":(f||1)+"px",fill:"none"}):(e.style("stroke-width",f+"px").call(l.fill,c),f&&e.call(l.stroke,h))}function i(t,e,r,n){var i=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],u=Math.pow(i*i+o*o,_/2),c=Math.pow(s*s+l*l,_/2),h=(c*c*i-u*u*s)*n,f=(c*c*o-u*u*l)*n,d=3*c*(u+c),p=3*u*(u+c);return[[a.round(e[0]+(d&&h/d),2),a.round(e[1]+(d&&f/d),2)],[a.round(e[0]-(p&&h/p),2),a.round(e[1]-(p&&f/p),2)]]}var a=t("d3"),o=t("fast-isnumeric"),s=t("../../registry"),l=t("../color"),u=t("../colorscale"),c=t("../../lib"),h=t("../../lib/svg_text_utils"),f=t("../../constants/xmlns_namespaces"),d=t("../../traces/scatter/subtypes"),p=t("../../traces/scatter/make_bubble_size_func"),m=e.exports={};m.font=function(t,e,r,n){e&&e.family&&(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)},m.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},m.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},m.setRect=function(t,e,r,n,i){t.call(m.setPosition,e,r).call(m.setSize,n,i)},m.translatePoint=function(t,e,r,n){var i=t.xp||r.c2p(t.x),a=t.yp||n.c2p(t.y);o(i)&&o(a)?"text"===e.node().nodeName?e.attr("x",i).attr("y",a):e.attr("transform","translate("+i+","+a+")"):e.remove()},m.translatePoints=function(t,e,r,n){t.each(function(t){var i=a.select(this);m.translatePoint(t,i,e,r,n)})},m.getPx=function(t,e){return Number(t.style(e).replace(/px$/,""))},m.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},m.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,s=i||a.dash||"";l.stroke(e,n||a.color),m.dashLine(e,s,o)},m.lineGroupStyle=function(t,e,r,n){t.style("fill","none").each(function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},o=e||i.width||0,s=n||i.dash||"";a.select(this).call(l.stroke,r||i.color).call(m.dashLine,s,o)})},m.dashLine=function(t,e,r){var n=Math.max(r,3);"solid"===e?e="":"dot"===e?e=n+"px,"+n+"px":"dash"===e?e=3*n+"px,"+3*n+"px":"longdash"===e?e=5*n+"px,"+5*n+"px":"dashdot"===e?e=3*n+"px,"+n+"px,"+n+"px,"+n+"px":"longdashdot"===e&&(e=5*n+"px,"+2*n+"px,"+n+"px,"+2*n+"px"),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},m.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=a.select(this);try{r.call(l.fill,e[0].trace.fillcolor)}catch(e){c.error(e,t),r.remove()}})};var g=t("./symbol_defs");m.symbolNames=[],m.symbolFuncs=[],m.symbolNeedLines={},m.symbolNoDot={},m.symbolList=[],Object.keys(g).forEach(function(t){var e=g[t];m.symbolList=m.symbolList.concat([e.n,t,e.n+100,t+"-open"]),m.symbolNames[e.n]=t,m.symbolFuncs[e.n]=e.f,e.needLine&&(m.symbolNeedLines[e.n]=!0),e.noDot?m.symbolNoDot[e.n]=!0:m.symbolList=m.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"])});var v=m.symbolNames.length,y="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";m.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),t=m.symbolNames.indexOf(t),t>=0&&(t+=e)}return t%100>=v||t>=400?0:Math.floor(Math.max(t,0))},m.singlePointStyle=function(t,e,r){var i=r.marker,a=i.line,o=m.tryColorscale(i,""),s=m.tryColorscale(i,"line");n(t,e,r,o,s,i,a)},m.pointStyle=function(t,e){if(t.size()){var r=e.marker,n=m.tryColorscale(r,""),i=m.tryColorscale(r,"line");t.each(function(t){m.singlePointStyle(t,a.select(this),e,n,i)})}},m.tryColorscale=function(t,e){var r=e?c.nestedProperty(t,e).get():t,n=r.colorscale,i=r.color;return n&&Array.isArray(i)?u.makeColorScaleFunc(u.extractScale(n,r.cmin,r.cmax)):c.identity};var x={start:1,end:-1,middle:0,bottom:1,top:-1},b=1.3;m.textPointStyle=function(t,e){t.each(function(t){var r=a.select(this),n=t.tx||e.text;if(!n||Array.isArray(n))return void r.remove();var i=t.tp||e.textposition,s=i.indexOf("top")!==-1?"top":i.indexOf("bottom")!==-1?"bottom":"middle",l=i.indexOf("left")!==-1?"end":i.indexOf("right")!==-1?"start":"middle",u=t.ts||e.textfont.size,c=t.mrc?t.mrc/.8+1:0;u=o(u)&&u>0?u:0,r.call(m.font,t.tf||e.textfont.family,u,t.tc||e.textfont.color).attr("text-anchor",l).text(n).call(h.convertToTspans);var f=a.select(this.parentNode),d=r.selectAll("tspan.line"),p=((d[0].length||1)-1)*b+1,g=x[l]*c,v=.75*u+x[s]*c+(x[s]-1)*p*u/2;f.attr("transform","translate("+g+","+v+")"),p>1&&d.attr({x:r.attr("x"),y:r.attr("y")})})};var _=.5;m.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(i(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]},m.smoothclosed=function(t,e){if(t.length<3)return"M"+t.join("L")+"Z";var r,n="M"+t[0],a=t.length-1,o=[i(t[a],t[0],t[1],e)];for(r=1;r<a;r++)o.push(i(t[r-1],t[r],t[r+1],e));for(o.push(i(t[a-1],t[a],t[0],e)),r=1;r<=a;r++)n+="C"+o[r-1][1]+" "+o[r][0]+" "+t[r];return n+="C"+o[a][1]+" "+o[0][0]+" "+t[0]+"Z"};var w={hv:function(t,e){return"H"+a.round(e[0],2)+"V"+a.round(e[1],2)},vh:function(t,e){return"V"+a.round(e[1],2)+"H"+a.round(e[0],2)},hvh:function(t,e){return"H"+a.round((t[0]+e[0])/2,2)+"V"+a.round(e[1],2)+"H"+a.round(e[0],2)},vhv:function(t,e){return"V"+a.round((t[1]+e[1])/2,2)+"H"+a.round(e[0],2)+"V"+a.round(e[1],2)}},M=function(t,e){return"L"+a.round(e[0],2)+","+a.round(e[1],2)};m.steps=function(t){var e=w[t]||M;return function(t){for(var r="M"+a.round(t[0][0],2)+","+a.round(t[0][1],2),n=1;n<t.length;n++)r+=e(t[n-1],t[n]);return r}},m.makeTester=function(t){var e=a.select("body").selectAll("#js-plotly-tester").data([0]);e.enter().append("svg").attr("id","js-plotly-tester").attr(f.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"});var r=e.selectAll(".js-reference-point").data([0]);r.enter().append("path").classed("js-reference-point",!0).attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"}),e.node()._cache||(e.node()._cache={}),t._tester=e,t._testref=r};var A=[],k=1e4;m.bBox=function(t){var e=t.attributes["data-bb"];if(e&&e.value)return c.extendFlat({},A[e.value]);var r=a.select("#js-plotly-tester"),n=r.node(),i=t.cloneNode(!0);n.appendChild(i),a.select(i).attr({x:0,y:0,transform:""});var o=i.getBoundingClientRect(),s=r.select(".js-reference-point").node().getBoundingClientRect();n.removeChild(i);var l={height:o.height,width:o.width,left:o.left-s.left,top:o.top-s.top,right:o.right-s.left,bottom:o.bottom-s.top};return A.length>=k&&(a.selectAll("[data-bb]").attr("data-bb",null),A=[]),t.setAttribute("data-bb",A.length),A.push(l),c.extendFlat({},l)},m.setClipUrl=function(t,e){if(!e)return void t.attr("clip-path",null);var r="#"+e,n=a.select("base");n.size()&&n.attr("href")&&(r=window.location.href.split("#")[0]+r),t.attr("clip-path","url("+r+")")}},{"../../constants/xmlns_namespaces":643,"../../lib":658,"../../lib/svg_text_utils":674,"../../registry":766,"../../traces/scatter/make_bubble_size_func":899,"../../traces/scatter/subtypes":904,"../color":558,"../colorscale":572,"./symbol_defs":582,d3:97,"fast-isnumeric":106}],582:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,i="l"+e+",-"+e,a="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+i+a+i+a+o+a+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+e+","+r+"H"+e+"L0,-"+i+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+e+",-"+r+"H"+e+"L0,"+i+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M"+r+",-"+e+"V"+e+"L-"+i+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+r+",-"+e+"V"+e+"L"+i+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),a=n.round(t*-.309,2),o=n.round(.809*t,2);return"M"+e+","+a+"L"+r+","+o+"H-"+r+"L-"+e+","+a+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),a=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(e*-.309,2),u=n.round(.118*e,2),c=n.round(.809*e,2),h=n.round(.382*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+u+"L"+o+","+c+"L0,"+h+"L-"+o+","+c+"L-"+a+","+u+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+i+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+i+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0},"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},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},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},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!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},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!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}}},{d3:97}],583:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"]},symmetric:{valType:"boolean"},array:{valType:"data_array"},arrayminus:{valType:"data_array"},value:{valType:"number",min:0,dflt:10},valueminus:{valType:"number",min:0,dflt:10},traceref:{valType:"integer",min:0,dflt:0},tracerefminus:{valType:"integer",min:0,dflt:0},copy_ystyle:{valType:"boolean"},copy_zstyle:{valType:"boolean"},color:{valType:"color"},thickness:{valType:"number",min:0,dflt:2},width:{valType:"number",min:0},_deprecated:{opacity:{valType:"number"}}}},{}],584:[function(t,e,r){"use strict";function n(t,e,r,n){var a=e["error_"+n]||{},l=a.visible&&["linear","log"].indexOf(r.type)!==-1,u=[];if(l){for(var c=s(a),h=0;h<t.length;h++){var f=t[h],d=f[n];if(i(r.c2l(d))){var p=c(d,h);if(i(p[0])&&i(p[1])){var m=f[n+"s"]=d-p[0],g=f[n+"h"]=d+p[1];u.push(m,g)}}}o.expand(r,u,{padded:!0})}}var i=t("fast-isnumeric"),a=t("../../registry"),o=t("../../plots/cartesian/axes"),s=t("./compute_error");e.exports=function(t){for(var e=t.calcdata,r=0;r<e.length;r++){var i=e[r],s=i[0].trace;if(a.traceIs(s,"errorBarsOK")){var l=o.getFromId(t,s.xaxis),u=o.getFromId(t,s.yaxis);n(i,s,l,"x"),n(i,s,u,"y")}}}},{"../../plots/cartesian/axes":691,"../../registry":766,"./compute_error":585,"fast-isnumeric":106}],585:[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 i=t.array,a=t.arrayminus;return r||void 0===a?function(t,e){var r=+i[e];return[r,r]}:function(t,e){return[+a[e],+i[e]]}}var o=n(e,t.value),s=n(e,t.valueminus);return r||void 0===t.valueminus?function(t){var e=o(t);return[e,e]}:function(t){return[s(t),o(t)]}}},{}],586:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../registry"),a=t("../../lib"),o=t("./attributes");e.exports=function(t,e,r,s){function l(t,e){return a.coerce(h,c,o,t,e)}var u="error_"+s.axis,c=e[u]={},h=t[u]||{},f=void 0!==h.array||void 0!==h.value||"sqrt"===h.type,d=l("visible",f);if(d!==!1){var p=l("type","array"in h?"data":"percent"),m=!0;if("sqrt"!==p&&(m=l("symmetric",!(("data"===p?"arrayminus":"valueminus")in h))),"data"===p){var g=l("array");if(g||(c.array=[]),l("traceref"),!m){var v=l("arrayminus");v||(c.arrayminus=[]),l("tracerefminus")}}else"percent"!==p&&"constant"!==p||(l("value"),m||l("valueminus"));var y="copy_"+s.inherit+"style";if(s.inherit){var x=e["error_"+s.inherit];(x||{}).visible&&l(y,!(h.color||n(h.thickness)||n(h.width)))}s.inherit&&c[y]||(l("color",r),l("thickness"),l("width",i.traceIs(e,"gl3d")?0:4))}}},{"../../lib":658,"../../registry":766,"./attributes":583,"fast-isnumeric":106}],587:[function(t,e,r){"use strict";var n=e.exports={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.calcFromTrace=function(t,e){for(var r=t.x||[],i=t.y,a=r.length||i.length,o=new Array(a),s=0;s<a;s++)o[s]={x:r[s],y:i[s]};return o[0].trace=t,n.calc({calcdata:[o],_fullLayout:e}),o},n.plot=t("./plot"),n.style=t("./style"),n.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))}},{"./attributes":583,"./calc":584,"./defaults":586,"./plot":588,"./style":589}],588:[function(t,e,r){"use strict";function n(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),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))),n}var i=t("d3"),a=t("fast-isnumeric"),o=t("../../traces/scatter/subtypes");e.exports=function(t,e,r){var s,l=e.xaxis,u=e.yaxis,c=r&&r.duration>0;t.each(function(t){var e,h=t[0].trace,f=h.error_x||{},d=h.error_y||{};h.ids&&(e=function(t){return t.id});var p=o.hasMarkers(h)&&h.marker.maxdisplayed>0;if(d.visible||f.visible){var m=i.select(this).selectAll("g.errorbar").data(t,e);m.exit().remove(),m.style("opacity",1);var g=m.enter().append("g").classed("errorbar",!0);c&&g.style("opacity",0).transition().duration(r.duration).style("opacity",1),m.each(function(t){var e=i.select(this),o=n(t,l,u);if(!p||t.vis){var h;if(d.visible&&a(o.x)&&a(o.yh)&&a(o.ys)){var m=d.width;h="M"+(o.x-m)+","+o.yh+"h"+2*m+"m-"+m+",0V"+o.ys,o.noYS||(h+="m-"+m+",0h"+2*m);var g=e.select("path.yerror");s=!g.size(),s?g=e.append("path").classed("yerror",!0):c&&(g=g.transition().duration(r.duration).ease(r.easing)),g.attr("d",h)}if(f.visible&&a(o.y)&&a(o.xh)&&a(o.xs)){var v=(f.copy_ystyle?d:f).width;h="M"+o.xh+","+(o.y-v)+"v"+2*v+"m0,-"+v+"H"+o.xs,o.noXS||(h+="m0,-"+v+"v"+2*v);var y=e.select("path.xerror");s=!y.size(),s?y=e.append("path").classed("xerror",!0):c&&(y=y.transition().duration(r.duration).ease(r.easing)),y.attr("d",h)}}})}})}},{"../../traces/scatter/subtypes":904,d3:97,"fast-isnumeric":106}],589:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)})}},{"../color":558,d3:97}],590:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:"image",visible:{valType:"boolean",dflt:!0},source:{valType:"string"},layer:{valType:"enumerated",values:["below","above"],dflt:"above"},sizex:{valType:"number",dflt:0},sizey:{valType:"number",dflt:0},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain"},opacity:{valType:"number",min:0,max:1,dflt:1},x:{valType:"any",dflt:0},y:{valType:"any",dflt:0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top"},xref:{valType:"enumerated",values:["paper",n.idRegex.x.toString()],dflt:"paper"},yref:{valType:"enumerated",values:["paper",n.idRegex.y.toString()],dflt:"paper"}}},{"../../plots/cartesian/constants":696}],591:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,s,r,n)}var o=n("source"),l=n("visible",!!o);if(!l)return e;n("layer"),n("x"),n("y"),n("xanchor"),n("yanchor"),n("sizex"),n("sizey"),n("sizing"),n("opacity");for(var u={_fullLayout:r},c=["x","y"],h=0;h<2;h++)a.coerceRef(t,e,u,c[h],"paper");return e}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../../plots/array_container_defaults"),s=t("./attributes"),l="images";e.exports=function(t,e){var r={name:l,handleItemDefaults:n};o(t,e,r)}},{"../../lib":658,"../../plots/array_container_defaults":688,"../../plots/cartesian/axes":691,"./attributes":590}],592:[function(t,e,r){"use strict";var n=t("d3"),i=t("../drawing"),a=t("../../plots/cartesian/axes"),o=t("../../constants/xmlns_namespaces");e.exports=function(t){function e(e){var r=n.select(this);if(!this.img||this.img.src!==e.source){r.attr("xmlns",o.svg);var i=new Promise(function(t){function n(){r.remove(),t()}var i=new Image;this.img=i,i.setAttribute("crossOrigin","anonymous"),i.onerror=n,i.onload=function(){var t=document.createElement("canvas");t.width=this.width,t.height=this.height;var e=t.getContext("2d");e.drawImage(this,0,0);var n=t.toDataURL("image/png");r.attr("xlink:href",n)},r.on("error",n),r.on("load",t),i.src=e.source}.bind(this));t._promises.push(i)}}function r(e){var r=n.select(this),o=a.getFromId(t,e.xref),l=a.getFromId(t,e.yref),u=s._size,c=o?Math.abs(o.l2p(e.sizex)-o.l2p(0)):e.sizex*u.w,h=l?Math.abs(l.l2p(e.sizey)-l.l2p(0)):e.sizey*u.h,f=c*d.x[e.xanchor].offset,p=h*d.y[e.yanchor].offset,m=d.x[e.xanchor].sizing+d.y[e.yanchor].sizing,g=(o?o.r2p(e.x)+o._offset:e.x*u.w+u.l)+f,v=(l?l.r2p(e.y)+l._offset:u.h-e.y*u.h+u.t)+p;switch(e.sizing){case"fill":m+=" slice";break;case"stretch":m="none"}r.attr({x:g,y:v,width:c,height:h,preserveAspectRatio:m,opacity:e.opacity});var y=o?o._id:"",x=l?l._id:"",b=y+x;b&&r.call(i.setClipUrl,"clip"+s._uid+b)}for(var s=t._fullLayout,l=[],u=[],c=[],h=0;h<s.images.length;h++){var f=s.images[h];f.visible&&("below"===f.layer&&"paper"!==f.xref&&"paper"!==f.yref?u.push(f):"above"===f.layer?l.push(f):c.push(f))}var d={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}}},p=s._imageLowerLayer.selectAll("image").data(c),m=s._imageSubplotLayer.selectAll("image").data(u),g=s._imageUpperLayer.selectAll("image").data(l);p.enter().append("image"),m.enter().append("image"),g.enter().append("image"),p.exit().remove(),m.exit().remove(),g.exit().remove(),p.each(function(t){e.bind(this)(t),r.bind(this)(t)}),m.each(function(t){e.bind(this)(t),r.bind(this)(t)}),g.each(function(t){e.bind(this)(t),r.bind(this)(t)})}},{"../../constants/xmlns_namespaces":643,"../../plots/cartesian/axes":691,"../drawing":581,d3:97}],593:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"images",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":590,"./defaults":591,"./draw":592}],594:[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}},{}],595:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat;e.exports={bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.defaultLine},borderwidth:{valType:"number",min:0,dflt:0},font:a({},n,{}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"]},tracegroupgap:{valType:"number",min:0,dflt:10},x:{valType:"number",min:-2,max:3,dflt:1.02},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"}}},{"../../lib/extend":651,"../../plots/font_attributes":711,"../color/attributes":557}],596:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],597:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("./attributes"),o=t("../../plots/layout_attributes"),s=t("./helpers");e.exports=function(t,e,r){function l(t,e){return i.coerce(d,p,a,t,e)}for(var u,c,h,f,d=t.legend||{},p=e.legend={},m=0,g="normal",v=0;v<r.length;v++){var y=r[v];s.legendGetsTrace(y)&&(m++,n.traceIs(y,"pie")&&m++),(n.traceIs(y,"bar")&&"stack"===e.barmode||["tonextx","tonexty"].indexOf(y.fill)!==-1)&&(g=s.isGrouped({traceorder:g})?"grouped+reversed":"reversed"),void 0!==y.legendgroup&&""!==y.legendgroup&&(g=s.isReversed({traceorder:g})?"reversed+grouped":"grouped")}var x=i.coerce(t,e,o,"showlegend",m>1);if(x!==!1){if(l("bgcolor",e.paper_bgcolor),l("bordercolor"),l("borderwidth"),i.coerceFont(l,"font",e.font),l("orientation"),"h"===p.orientation){var b=t.xaxis;b&&b.rangeslider&&b.rangeslider.visible?(u=0,h="left",c=1.1,f="bottom"):(u=0,h="left",c=-.1,f="top")}l("traceorder",g),s.isGrouped(e.legend)&&l("tracegroupgap"),l("x",u),l("xanchor",h),l("y",c),l("yanchor",f),i.noneOrAll(d,p,["x","y"])}}},{"../../lib":658,"../../plots/layout_attributes":742,"../../registry":766,"./attributes":595,"./helpers":600}],598:[function(t,e,r){"use strict";function n(t,e){function r(r){v.convertToTspans(r,function(){r.selectAll("tspan.line").attr({x:r.attr("x")}),t.call(a,e)})}var n=t.data()[0][0],i=e._fullLayout,o=n.trace,s=d.traceIs(o,"pie"),l=o.index,u=s?n.label:o.name,h=t.selectAll("text.legendtext").data([0]);h.enter().append("text").classed("legendtext",!0),h.attr({x:40,y:0,"data-unformatted":u}).style("text-anchor","start").classed("user-select-none",!0).call(m.font,i.legend.font).text(u),e._context.editable&&!s?h.call(v.makeEditable).call(r).on("edit",function(t){this.attr({"data-unformatted":t}),this.text(t).call(r),this.text()||(t="    ");var i,a=n.trace._fullInput||{};if(["ohlc","candlestick"].indexOf(a.type)!==-1){var o=n.trace.transforms,s=o[o.length-1].direction;i=s+".legenditem.name"}else i="name";c.restyle(e,i,t,l)}):h.call(r)}function i(t,e){var r=e._fullLayout.hiddenlabels?e._fullLayout.hiddenlabels.slice():[],n=t.selectAll("rect").data([0]);n.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(g.fill,"rgba(0,0,0,0)"),n.on("click",function(){if(!e._dragged){var n,i,a=t.data()[0][0],o=e._fullData,s=a.trace,l=s.legendgroup,u=[];if(d.traceIs(s,"pie")){var h=a.label,f=r.indexOf(h);f===-1?r.push(h):r.splice(f,1),c.relayout(e,"hiddenlabels",r)}else{if(""===l)u=[s.index];else for(var p=0;p<o.length;p++)n=o[p],n.legendgroup===l&&u.push(n.index);i=s.visible!==!0||"legendonly",c.restyle(e,"visible",i,u)}}})}function a(t,e){var r,n,i=t.data()[0][0],a=t.select("g[class*=math-group]"),o=e._fullLayout.legend,s=1.3*o.font.size;if(!i.trace.showlegend)return void t.remove();if(a.node()){var l=m.bBox(a.node());r=l.height,n=l.width,h.setTranslate(a,0,r/4)}else{var u=t.selectAll(".legendtext"),c=t.selectAll(".legendtext>tspan"),f=c[0].length||1;r=s*f,n=u.node()&&m.bBox(u.node()).width;var d=s*(.3+(1-f)/2);u.attr("y",d),c.attr("y",d)}r=Math.max(r,16)+3,i.height=r,i.width=n}function o(t,e,r){var n=t._fullLayout,i=n.legend,a=i.borderwidth,o=_.isGrouped(i);if(_.isVertical(i))o&&e.each(function(t,e){h.setTranslate(this,0,e*i.tracegroupgap)}),i.width=0,i.height=0,r.each(function(t){var e=t[0],r=e.height,n=e.width;h.setTranslate(this,a,5+a+i.height+r/2),i.height+=r,i.width=Math.max(i.width,n)}),i.width+=45+2*a,i.height+=10+2*a,o&&(i.height+=(i._lgroupsLength-1)*i.tracegroupgap),i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.each(function(e){var r=e[0],n=u.select(this).select(".legendtoggle");n.call(m.setRect,0,-r.height/2,(t._context.editable?0:i.width)+40,r.height)});else if(o){i.width=0,i.height=0;for(var s=[i.width],l=e.data(),c=0,f=l.length;c<f;c++){var d=l[c].map(function(t){return t[0].width}),p=40+Math.max.apply(null,d);i.width+=i.tracegroupgap+p,s.push(i.width)}e.each(function(t,e){h.setTranslate(this,s[e],0)}),e.each(function(){var t=u.select(this),e=t.selectAll("g.traces"),r=0;e.each(function(t){var e=t[0],n=e.height;h.setTranslate(this,0,5+a+r+n/2),r+=n}),i.height=Math.max(i.height,r)}),i.height+=10+2*a,i.width+=2*a,i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.each(function(e){var r=e[0],n=u.select(this).select(".legendtoggle");n.call(m.setRect,0,-r.height/2,t._context.editable?0:i.width,r.height)})}else{i.width=0,i.height=0;var g=0,v=0,y=0,x=0;r.each(function(t){y=Math.max(40+t[0].width,y)}),r.each(function(t){var e=t[0],r=y,o=i.tracegroupgap||5;a+x+o+r>n.width-(n.margin.r+n.margin.l)&&(x=0,g+=v,i.height=i.height+v,v=0),h.setTranslate(this,a+x,5+a+e.height/2+g),i.width+=o+r,i.height=Math.max(i.height,e.height),x+=o+r,v=Math.max(e.height,v)}),i.width+=2*a,i.height+=10+2*a,i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.each(function(e){var r=e[0],n=u.select(this).select(".legendtoggle");n.call(m.setRect,0,-r.height/2,t._context.editable?0:i.width,r.height)})}}function s(t){var e=t._fullLayout,r=e.legend,n="left";w.isRightAnchor(r)?n="right":w.isCenterAnchor(r)&&(n="center");var i="top";w.isBottomAnchor(r)?i="bottom":w.isMiddleAnchor(r)&&(i="middle"),f.autoMargin(t,"legend",{x:r.x,y:r.y,l:r.width*({right:1,center:.5}[n]||0),r:r.width*({left:1,center:.5}[n]||0),b:r.height*({top:1,middle:.5}[i]||0),t:r.height*({bottom:1,middle:.5}[i]||0)})}function l(t){var e=t._fullLayout,r=e.legend,n="left";w.isRightAnchor(r)?n="right":w.isCenterAnchor(r)&&(n="center"),f.autoMargin(t,"legend",{x:r.x,y:.5,l:r.width*({right:1,center:.5}[n]||0),r:r.width*({left:1,center:.5}[n]||0),b:0,t:0})}var u=t("d3"),c=t("../../plotly"),h=t("../../lib"),f=t("../../plots/plots"),d=t("../../registry"),p=t("../dragelement"),m=t("../drawing"),g=t("../color"),v=t("../../lib/svg_text_utils"),y=t("./constants"),x=t("./get_legend_data"),b=t("./style"),_=t("./helpers"),w=t("./anchor_utils");e.exports=function(t){function e(t,e){E.attr("data-scroll",e).call(h.setTranslate,0,e),S.call(m.setRect,N,t,y.scrollBarWidth,y.scrollBarHeight),k.select("rect").attr({y:v.borderwidth-e})}var r=t._fullLayout,a="legend"+r._uid;if(r._infolayer&&t.calcdata){var v=r.legend,_=r.showlegend&&x(t.calcdata,v),M=r.hiddenlabels||[];if(!r.showlegend||!_.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+a).remove(),void f.autoMargin(t,"legend");var A=r._infolayer.selectAll("g.legend").data([0]);A.enter().append("g").attr({class:"legend","pointer-events":"all"});var k=r._topdefs.selectAll("#"+a).data([0]);k.enter().append("clipPath").attr("id",a).append("rect");var T=A.selectAll("rect.bg").data([0]);T.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),T.call(g.stroke,v.bordercolor),T.call(g.fill,v.bgcolor),T.style("stroke-width",v.borderwidth+"px");var E=A.selectAll("g.scrollbox").data([0]);E.enter().append("g").attr("class","scrollbox");var S=A.selectAll("rect.scrollbar").data([0]);S.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(g.fill,"#808BA4");var L=E.selectAll("g.groups").data(_);L.enter().append("g").attr("class","groups"),L.exit().remove();var C=L.selectAll("g.traces").data(h.identity);C.enter().append("g").attr("class","traces"),C.exit().remove(),C.call(b).style("opacity",function(t){var e=t[0].trace;return d.traceIs(e,"pie")?M.indexOf(t[0].label)!==-1?.5:1:"legendonly"===e.visible?.5:1}).each(function(){u.select(this).call(n,t).call(i,t)});var I=0!==A.enter().size();I&&(o(t,L,C),s(t));var z=0,D=r.width,P=0,O=r.height;o(t,L,C),v.height>O?l(t):s(t);var R=r._size,F=R.l+R.w*v.x,j=R.t+R.h*(1-v.y);w.isRightAnchor(v)?F-=v.width:w.isCenterAnchor(v)&&(F-=v.width/2),w.isBottomAnchor(v)?j-=v.height:w.isMiddleAnchor(v)&&(j-=v.height/2);var N=v.width,B=R.w;N>B?(F=R.l,N=B):(F+N>D&&(F=D-N),F<z&&(F=z),N=Math.min(D-F,v.width));var U=v.height,V=R.h;U>V?(j=R.t,U=V):(j+U>O&&(j=O-U),j<P&&(j=P),U=Math.min(O-j,v.height)),h.setTranslate(A,F,j);var q,H,Y=U-y.scrollBarHeight-2*y.scrollBarMargin,G=v.height-U;if(v.height<=U||t._context.staticPlot)T.attr({width:N-v.borderwidth,height:U-v.borderwidth,x:v.borderwidth/2,y:v.borderwidth/2}),h.setTranslate(E,0,0),k.select("rect").attr({width:N-2*v.borderwidth,height:U-2*v.borderwidth,x:v.borderwidth,y:v.borderwidth}),E.call(m.setClipUrl,a);else{q=y.scrollBarMargin,H=E.attr("data-scroll")||0,T.attr({width:N-2*v.borderwidth+y.scrollBarWidth+y.scrollBarMargin,height:U-v.borderwidth,x:v.borderwidth/2,y:v.borderwidth/2}),k.select("rect").attr({width:N-2*v.borderwidth+y.scrollBarWidth+y.scrollBarMargin,height:U-2*v.borderwidth,x:v.borderwidth,y:v.borderwidth-H}),E.call(m.setClipUrl,a),I&&e(q,H),A.on("wheel",null),A.on("wheel",function(){H=h.constrain(E.attr("data-scroll")-u.event.deltaY/Y*G,-G,0),q=y.scrollBarMargin-H/G*Y,e(q,H),u.event.preventDefault()}),S.on(".drag",null),E.on(".drag",null);var X=u.behavior.drag().on("drag",function(){q=h.constrain(u.event.y-y.scrollBarHeight/2,y.scrollBarMargin,y.scrollBarMargin+Y),H=-(q-y.scrollBarMargin)/Y*G,e(q,H)});S.call(X),E.call(X)}if(t._context.editable){var W,Z,J,K;A.classed("cursor-move",!0),p.init({element:A.node(),prepFn:function(){var t=h.getTranslate(A);J=t.x,K=t.y},moveFn:function(t,e){var r=J+t,n=K+e;h.setTranslate(A,r,n),W=p.align(r,0,R.l,R.l+R.w,v.xanchor),Z=p.align(n,0,R.t+R.h,R.t,v.yanchor)},doneFn:function(e){e&&void 0!==W&&void 0!==Z&&c.relayout(t,{"legend.x":W,"legend.y":Z})}})}}}},{"../../lib":658,"../../lib/svg_text_utils":674,"../../plotly":686,"../../plots/plots":751,"../../registry":766,"../color":558,"../dragelement":579,"../drawing":581,"./anchor_utils":594,"./constants":596,"./get_legend_data":599,"./helpers":600,"./style":602,d3:97}],599:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&i.isGrouped(e))l.indexOf(t)===-1?(l.push(t),u=!0,s[t]=[[r]]):s[t].push([r]);else{var n="~~i"+h;l.push(n),s[n]=[[r]],h++}}var a,o,s={},l=[],u=!1,c={},h=0;for(a=0;a<t.length;a++){var f=t[a],d=f[0],p=d.trace,m=p.legendgroup;if(i.legendGetsTrace(p)&&p.showlegend)if(n.traceIs(p,"pie"))for(c[m]||(c[m]={}),o=0;o<f.length;o++){var g=f[o].label;c[m][g]||(r(m,{label:g,color:f[o].color,i:f[o].i,trace:p}),c[m][g]=!0)}else r(m,d)}if(!l.length)return[];var v,y,x=l.length;if(u&&i.isGrouped(e))for(y=new Array(x),a=0;a<x;a++)v=s[l[a]],y[a]=i.isReversed(e)?v.reverse():v;else{for(y=[new Array(x)],a=0;a<x;a++)v=s[l[a]][0],y[0][i.isReversed(e)?x-a-1:a]=v;x=1}return e._lgroupsLength=x,y}},{"../../registry":766,"./helpers":600}],600:[function(t,e,r){"use strict";var n=t("../../registry");r.legendGetsTrace=function(t){return t.visible&&n.traceIs(t,"showLegend")},r.isGrouped=function(t){return(t.traceorder||"").indexOf("grouped")!==-1},r.isVertical=function(t){return"h"!==t.orientation},r.isReversed=function(t){return(t.traceorder||"").indexOf("reversed")!==-1}},{"../../registry":766}],601:[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":595,"./defaults":597,"./draw":598,"./style":602}],602:[function(t,e,r){"use strict";function n(t){var e=t[0].trace,r=e.visible&&e.fill&&"none"!==e.fill,n=d.hasLines(e),i=l.select(this).select(".legendfill").selectAll("path").data(r?[t]:[]);i.enter().append("path").classed("js-fill",!0),i.exit().remove(),i.attr("d","M5,0h30v6h-30z").call(h.fillGroupStyle);var a=l.select(this).select(".legendlines").selectAll("path").data(n?[t]:[]);a.enter().append("path").classed("js-line",!0).attr("d","M5,0h30"),a.exit().remove(),a.call(h.lineGroupStyle)}function i(t){function e(t,e,r){var n=c.nestedProperty(o,t).get(),i=Array.isArray(n)&&e?e(n):n;if(r){if(i<r[0])return r[0];if(i>r[1])return r[1]}return i}function r(t){return t[0]}var n,i,a=t[0],o=a.trace,s=d.hasMarkers(o),u=d.hasText(o),f=d.hasLines(o);if(s||u||f){var p={},m={};s&&(p.mc=e("marker.color",r),p.mo=e("marker.opacity",c.mean,[.2,1]),p.ms=e("marker.size",c.mean,[2,16]),p.mlc=e("marker.line.color",r),p.mlw=e("marker.line.width",c.mean,[0,5]),m.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),f&&(m.line={width:e("line.width",r,[0,10])}),u&&(p.tx="Aa",p.tp=e("textposition",r),p.ts=10,p.tc=e("textfont.color",r),p.tf=e("textfont.family",r)),n=[c.minExtend(a,p)],i=c.minExtend(o,m)}var g=l.select(this).select("g.legendpoints"),v=g.selectAll("path.scatterpts").data(s?n:[]);v.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),v.exit().remove(),v.call(h.pointStyle,i),s&&(n[0].mrc=3);var y=g.selectAll("g.pointtext").data(u?n:[]);y.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),y.exit().remove(),y.selectAll("text").call(h.textPointStyle,i)}function a(t){var e=t[0].trace,r=e.marker||{},n=r.line||{},i=l.select(this).select("g.legendpoints").selectAll("path.legendbar").data(u.traceIs(e,"bar")?[t]:[]);i.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),i.exit().remove(),i.each(function(t){var e=l.select(this),i=t[0],a=(i.mlw+1||n.width+1)-1;e.style("stroke-width",a+"px").call(f.fill,i.mc||r.color),a&&e.call(f.stroke,i.mlc||n.color)})}function o(t){var e=t[0].trace,r=l.select(this).select("g.legendpoints").selectAll("path.legendbox").data(u.traceIs(e,"box")&&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=l.select(this);r.style("stroke-width",t+"px").call(f.fill,e.fillcolor),t&&r.call(f.stroke,e.line.color)})}function s(t){var e=t[0].trace,r=l.select(this).select("g.legendpoints").selectAll("path.legendpie").data(u.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(p,t[0],e)}var l=t("d3"),u=t("../../registry"),c=t("../../lib"),h=t("../drawing"),f=t("../color"),d=t("../../traces/scatter/subtypes"),p=t("../../traces/pie/style_one");e.exports=function(t){t.each(function(t){var e=l.select(this),r=e.selectAll("g.layers").data([0]);r.enter().append("g").classed("layers",!0),r.style("opacity",t[0].trace.opacity);var n=r.selectAll("g.legendfill").data([t]);n.enter().append("g").classed("legendfill",!0);var i=r.selectAll("g.legendlines").data([t]);i.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(a).each(o).each(s).each(n).each(i)}},{"../../lib":658,"../../registry":766,"../../traces/pie/style_one":878,"../../traces/scatter/subtypes":904,"../color":558,"../drawing":581,d3:97}],603:[function(t,e,r){"use strict";function n(t,e){var r=e.currentTarget,n=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,a=t._fullLayout,o={};if("zoom"===n){for(var s,l,c="in"===i?.5:2,f=(1+c)/2,d=(1-c)/2,p=h.list(t,null,!0),m=0;m<p.length;m++)if(s=p[m],!s.fixedrange)if(l=s._name,"auto"===i)o[l+".autorange"]=!0;else if("reset"===i)if(void 0===s._rangeInitial)o[l+".autorange"]=!0;else{var g=s._rangeInitial.slice();o[l+".range[0]"]=g[0],o[l+".range[1]"]=g[1]}else{var v=[s.r2l(s.range[0]),s.r2l(s.range[1])],y=[f*v[0]+d*v[1],f*v[1]+d*v[0]];o[l+".range[0]"]=s.l2r(y[0]),o[l+".range[1]"]=s.l2r(y[1])}}else"hovermode"!==n||"x"!==i&&"y"!==i||(i=a._isHoriz?"y":"x",r.setAttribute("data-val",i)),o[n]=i;u.relayout(t,o)}function i(t,e){for(var r=e.currentTarget,n=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,a=t._fullLayout,o=c.getSubplotIds(a,"gl3d"),s={},l=n.split("."),h=0;h<o.length;h++)s[o[h]+"."+l[1]]=i;u.relayout(t,s)}function a(t,e){for(var r=e.currentTarget,n=r.getAttribute("data-attr"),i=t._fullLayout,a=c.getSubplotIds(i,"gl3d"),o=0;o<a.length;o++){var s=a[o],l=i[s],u=l._scene;"resetDefault"===n?u.setCameraToDefault():"resetLastSave"===n&&u.setCamera(l.camera)}}function o(t,e){var r=e.currentTarget,n=r._previousVal||!1,i=t.layout,a=t._fullLayout,o=c.getSubplotIds(a,"gl3d"),s=["xaxis","yaxis","zaxis"],l=["showspikes","spikesides","spikethickness","spikecolor"],h={},d={},p={};if(n)p=f.extendDeep(i,n),r._previousVal=null;else{p={"allaxes.showspikes":!1};for(var m=0;m<o.length;m++){var g=o[m],v=a[g],y=h[g]={};y.hovermode=v.hovermode,p[g+".hovermode"]=!1;for(var x=0;x<3;x++){var b=s[x];d=y[b]={};for(var _=0;_<l.length;_++){var w=l[_];d[w]=v[b][w]}}}r._previousVal=f.extendDeep({},h)}u.relayout(t,p)}function s(t,e){for(var r=e.currentTarget,n=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,a=t._fullLayout,o=c.getSubplotIds(a,"geo"),s=0;s<o.length;s++){var l=a[o[s]]._subplot;if("zoom"===n){var u=l.projection.scale(),h="in"===i?2*u:.5*u;l.projection.scale(h),l.zoom.scale(h),l.render()}else"reset"===n&&l.zoomReset()}}function l(t){var e,r=t._fullLayout;e=r._has("cartesian")?r._isHoriz?"y":"x":"closest";var n=!t._fullLayout.hovermode&&e;u.relayout(t,"hovermode",n)}var u=t("../../plotly"),c=t("../../plots/plots"),h=t("../../plots/cartesian/axes"),f=t("../../lib"),d=t("../../snapshot/download"),p=t("../../../build/ploticon"),m=e.exports={};m.toImage={name:"toImage",title:"Download plot as a png",icon:p.camera,click:function(t){var e="png";f.notifier("Taking snapshot - this may take a few seconds","long"),f.isIE()&&(f.notifier("IE only supports svg.  Changing format to svg.","long"),e="svg"),d(t,{format:e}).then(function(t){f.notifier("Snapshot succeeded - "+t,"long")}).catch(function(){f.notifier("Sorry there was a problem downloading your snapshot!","long")})}},m.sendDataToCloud={name:"sendDataToCloud",title:"Save and edit plot in cloud",icon:p.disk,click:function(t){c.sendDataToCloud(t)}},m.zoom2d={name:"zoom2d",title:"Zoom",attr:"dragmode",val:"zoom",icon:p.zoombox,click:n},m.pan2d={name:"pan2d",title:"Pan",attr:"dragmode",val:"pan",icon:p.pan,click:n},m.select2d={name:"select2d",title:"Box Select",attr:"dragmode",val:"select",icon:p.selectbox,click:n},m.lasso2d={name:"lasso2d",title:"Lasso Select",attr:"dragmode",val:"lasso",icon:p.lasso,click:n},m.zoomIn2d={name:"zoomIn2d",title:"Zoom in",attr:"zoom",val:"in",icon:p.zoom_plus,click:n},m.zoomOut2d={name:"zoomOut2d",title:"Zoom out",attr:"zoom",val:"out",icon:p.zoom_minus,click:n},m.autoScale2d={name:"autoScale2d",title:"Autoscale",attr:"zoom",val:"auto",icon:p.autoscale,click:n},m.resetScale2d={name:"resetScale2d",title:"Reset axes",attr:"zoom",val:"reset",icon:p.home,click:n},m.hoverClosestCartesian={name:"hoverClosestCartesian",title:"Show closest data on hover",attr:"hovermode",val:"closest",icon:p.tooltip_basic,gravity:"ne",click:n},m.hoverCompareCartesian={name:"hoverCompareCartesian",title:"Compare data on hover",attr:"hovermode",val:function(t){return t._fullLayout._isHoriz?"y":"x"},icon:p.tooltip_compare,gravity:"ne",click:n},m.zoom3d={name:"zoom3d",title:"Zoom",attr:"scene.dragmode",val:"zoom",icon:p.zoombox,click:i},m.pan3d={name:"pan3d",title:"Pan",attr:"scene.dragmode",val:"pan",icon:p.pan,click:i},m.orbitRotation={name:"orbitRotation",title:"orbital rotation",attr:"scene.dragmode",val:"orbit",icon:p["3d_rotate"],click:i},m.tableRotation={name:"tableRotation",title:"turntable rotation",attr:"scene.dragmode",val:"turntable",icon:p["z-axis"],click:i},m.resetCameraDefault3d={name:"resetCameraDefault3d",title:"Reset camera to default",attr:"resetDefault",icon:p.home,click:a},m.resetCameraLastSave3d={name:"resetCameraLastSave3d",title:"Reset camera to last save",attr:"resetLastSave",icon:p.movie,click:a},m.hoverClosest3d={name:"hoverClosest3d",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:p.tooltip_basic,gravity:"ne",click:o},m.zoomInGeo={name:"zoomInGeo",title:"Zoom in",attr:"zoom",val:"in",icon:p.zoom_plus,click:s},m.zoomOutGeo={name:"zoomOutGeo",title:"Zoom out",attr:"zoom",val:"out",icon:p.zoom_minus,click:s},m.resetGeo={name:"resetGeo",title:"Reset",attr:"reset",val:null,icon:p.autoscale,click:s},m.hoverClosestGeo={name:"hoverClosestGeo",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:p.tooltip_basic,gravity:"ne",click:l},m.hoverClosestGl2d={name:"hoverClosestGl2d",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:p.tooltip_basic,gravity:"ne",click:l},m.hoverClosestPie={name:"hoverClosestPie",title:"Toggle show closest data on hover",attr:"hovermode",val:"closest",icon:p.tooltip_basic,gravity:"ne",click:l},m.toggleHover={name:"toggleHover",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:p.tooltip_basic,gravity:"ne",click:function(t,e){l(t),o(t,e)}},m.resetViews={name:"resetViews",title:"Reset views",icon:p.home,click:function(t,e){var r=e.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),n(t,e),r.setAttribute("data-attr","resetLastSave"),a(t,e)}}},{"../../../build/ploticon":2,"../../lib":658,"../../plotly":686,"../../plots/cartesian/axes":691,"../../plots/plots":751,"../../snapshot/download":768}],604:[function(t,e,r){"use strict";r.manage=t("./manage")},{"./manage":605}],605:[function(t,e,r){"use strict";function n(t,e,r){function n(t){for(var r=[],n=0;n<t.length;n++){var i=t[n];e.indexOf(i)===-1&&r.push(h[i])}g.push(r)}var s=t._fullLayout,l=t._fullData,u=s._has("cartesian"),c=s._has("gl3d"),f=s._has("geo"),d=s._has("pie"),p=s._has("gl2d"),m=s._has("ternary"),g=[];if(n(["toImage","sendDataToCloud"]),(u||p||d||m)+f+c>1)return n(["resetViews","toggleHover"]),o(g,r);c&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"])),f&&(n(["zoomInGeo","zoomOutGeo","resetGeo"]),n(["hoverClosestGeo"]));var v=i(s),y=[];return((u||p)&&!v||m)&&(y=["zoom2d","pan2d"]),(u||m)&&a(l)&&(y.push("select2d"),y.push("lasso2d")),y.length&&n(y),!u&&!p||v||m||n(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),u&&d?n(["toggleHover"]):p?n(["hoverClosestGl2d"]):u?n(["hoverClosestCartesian","hoverCompareCartesian"]):d&&n(["hoverClosestPie"]),o(g,r)}function i(t){for(var e=l.list({_fullLayout:t},null,!0),r=!0,n=0;n<e.length;n++)if(!e[n].fixedrange){r=!1;break}return r}function a(t){for(var e=!1,r=0;r<t.length&&!e;r++){var n=t[r];n._module&&n._module.selectPoints&&("scatter"===n.type||"scatterternary"===n.type?(u.hasMarkers(n)||u.hasText(n))&&(e=!0):e=!0)}return e}function o(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}function s(t){for(var e=0;e<t.length;e++)for(var r=t[e],n=0;n<r.length;n++){var i=r[n];if("string"==typeof i){if(void 0===h[i])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));t[e][n]=h[i]}}return t}var l=t("../../plots/cartesian/axes"),u=t("../../traces/scatter/subtypes"),c=t("./modebar"),h=t("./buttons");e.exports=function(t){var e=t._fullLayout,r=t._context,i=e._modeBar;if(!r.displayModeBar)return void(i&&(i.destroy(),delete e._modeBar));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 a,o=r.modeBarButtons;a=Array.isArray(o)&&o.length?s(o):n(t,r.modeBarButtonsToRemove,r.modeBarButtonsToAdd),i?i.update(t,a):e._modeBar=c(t,a)}},{"../../plots/cartesian/axes":691,"../../traces/scatter/subtypes":904,"./buttons":603,"./modebar":606}],606:[function(t,e,r){"use strict";function n(t){this.container=t.container,this.element=document.createElement("div"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}function i(t,e){var r=t._fullLayout,i=new n({graphInfo:t,container:r._paperdiv.node(),buttons:e});return r._privateplot&&a.select(i.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),i}var a=t("d3"),o=t("../../lib"),s=t("../../../build/ploticon"),l=n.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),i=this.hasLogo!==r.displaylogo;(n||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(e.buttonsNames.indexOf(n)!==-1)throw new Error("button name '"+n+"' is taken");e.buttonsNames.push(n);var i=e.createButton(t);e.buttonElements.push(i),r.appendChild(i)}),e.element.appendChild(r)})},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 n=t.title;void 0===n&&(n=t.name),(n||0===n)&&r.setAttribute("data-title",n),void 0!==t.attr&&r.setAttribute("data-attr",t.attr);var i=t.val;void 0!==i&&("function"==typeof i&&(i=i(this.graphInfo)),r.setAttribute("data-val",i));var a=t.click;if("function"!=typeof a)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&&r.classList.add("active"),r.appendChild(this.createIcon(t.icon||s.question)),r.setAttribute("data-gravity",t.gravity||"n"),r},l.createIcon=function(t){var e=t.ascent-t.descent,r="http://www.w3.org/2000/svg",n=document.createElementNS(r,"svg"),i=document.createElementNS(r,"path");return n.setAttribute("height","1em"),n.setAttribute("width",t.width/e+"em"),n.setAttribute("viewBox",[0,0,t.width,e].join(" ")),i.setAttribute("d",t.path),i.setAttribute("transform","matrix(1 0 0 -1 0 "+t.ascent+")"),n.appendChild(i),n},l.updateActiveButton=function(t){var e=this.graphInfo._fullLayout,r=void 0!==t?t.getAttribute("data-attr"):null;this.buttonElements.forEach(function(t){var n=t.getAttribute("data-val")||!0,i=t.getAttribute("data-attr"),s="true"===t.getAttribute("data-toggle"),l=a.select(t);if(s)i===r&&l.classed("active",!l.classed("active"));else{var u=null===i?i:o.nestedProperty(e,i).get();l.classed("active",u===n)}})},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","Produced with Plotly"),e.className="modebar-btn plotlyjsicon modebar-btn--logo",e.appendChild(this.createIcon(s.plotlylogo)),t.appendChild(e),t},l.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},l.destroy=function(){o.removeElement(this.container.querySelector(".modebar"))},e.exports=i},{"../../../build/ploticon":2,"../../lib":658,d3:97}],607:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("./button_attributes");o=a(o,{_isLinkedToArray:"button"}),e.exports={visible:{valType:"boolean"},buttons:o,x:{valType:"number",min:-2,max:3},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom"},font:a({},n,{}),bgcolor:{valType:"color",dflt:i.lightLine},activecolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.defaultLine},borderwidth:{valType:"number",min:0,dflt:0}}},{"../../lib/extend":651,"../../plots/font_attributes":711,"../color/attributes":557,"./button_attributes":608}],608:[function(t,e,r){"use strict";e.exports={step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward"},count:{valType:"number",min:0,dflt:1},label:{valType:"string"}}},{}],609:[function(t,e,r){"use strict";e.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}},{}],610:[function(t,e,r){"use strict";function n(t,e,r){function n(t,e){return a.coerce(i,o,l,t,e)}for(var i,o,s=t.buttons||[],u=e.buttons=[],c=0;c<s.length;c++)if(i=s[c],o={},a.isPlainObject(i)){var h=n("step");"all"!==h&&(!r||"gregorian"===r||"month"!==h&&"year"!==h?n("stepmode"):o.stepmode="backward",n("count")),n("label"),o._index=c,u.push(o)}return u}function i(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),i=0,a=0;a<n.length;a++){var o=e[n[a]].domain;o&&(i=Math.max(o[1],i))}return[t.domain[0],i+u.yPad]}var a=t("../../lib"),o=t("../color"),s=t("./attributes"),l=t("./button_attributes"),u=t("./constants");e.exports=function(t,e,r,l,c){function h(t,e){return a.coerce(f,d,s,t,e)}var f=t.rangeselector||{},d=e.rangeselector={},p=n(f,d,c),m=h("visible",p.length>0);if(m){var g=i(e,r,l);h("x",g[0]),h("y",g[1]),a.noneOrAll(t,e,["x","y"]),h("xanchor"),h("yanchor"),a.coerceFont(h,"font",r.font);var v=h("bgcolor");h("activecolor",o.contrast(v,u.lightAmount,u.darkAmount)),h("bordercolor"),h("borderwidth")}}},{"../../lib":658,"../color":558,"./attributes":607,"./button_attributes":608,"./constants":609}],611:[function(t,e,r){"use strict";function n(t){for(var e=v.list(t,"x",!0),r=[],n=0;n<e.length;n++){var i=e[n];i.rangeselector&&i.rangeselector.visible&&r.push(i)}return r}function i(t){return t._id}function a(t,e,r){if("all"===e.step)return t.autorange===!0;var n=Object.keys(r);return t.range[0]===r[n[0]]&&t.range[1]===r[n[1]]}function o(t,e,r){var n=t.selectAll("rect").data([0]);n.enter().append("rect").classed("selector-rect",!0),n.attr("shape-rendering","crispEdges"),n.attr({rx:x.rx,ry:x.ry}),n.call(p.stroke,e.bordercolor).call(p.fill,s(e,r)).style("stroke-width",e.borderwidth+"px")}function s(t,e){return e.isActive||e.isHovered?t.activecolor:t.bgcolor}function l(t,e,r){function n(t){g.convertToTspans(t)}var i=t.selectAll("text").data([0]);i.enter().append("text").classed("selector-text",!0).classed("user-select-none",!0),i.attr("text-anchor","middle"),i.call(m.font,e.font).text(u(r)).call(n)}function u(t){return t.label?t.label:"all"===t.step?"all":t.count+t.step.charAt(0)}function c(t,e,r,n){r.width=0,r.height=0;var i=r.borderwidth;e.each(function(){var t=h.select(this),e=t.select(".selector-text"),n=e.selectAll("tspan"),i=1.3*r.font.size,a=n[0].length||1,o=Math.max(i*a,16)+3;r.height=Math.max(r.height,o)}),e.each(function(){var t=h.select(this),e=t.select(".selector-rect"),n=t.select(".selector-text"),a=n.selectAll("tspan"),o=n.node()&&m.bBox(n.node()).width,s=1.3*r.font.size,l=a[0].length||1,u=Math.max(o+10,x.minButtonWidth);t.attr("transform","translate("+(i+r.width)+","+i+")"),e.attr({x:0,y:0,width:u,height:r.height});var c={x:u/2,y:r.height/2-(l-1)*s/2+3};n.attr(c),a.attr(c),r.width+=u+5}),e.selectAll("rect").attr("height",r.height);var a=t._fullLayout._size;r.lx=a.l+a.w*r.x,r.ly=a.t+a.h*(1-r.y);var o="left";y.isRightAnchor(r)&&(r.lx-=r.width,o="right"),y.isCenterAnchor(r)&&(r.lx-=r.width/2,o="center");var s="top";y.isBottomAnchor(r)&&(r.ly-=r.height,s="bottom"),y.isMiddleAnchor(r)&&(r.ly-=r.height/2,s="middle"),r.width=Math.ceil(r.width),r.height=Math.ceil(r.height),r.lx=Math.round(r.lx),r.ly=Math.round(r.ly),d.autoMargin(t,n+"-range-selector",{x:r.x,y:r.y,l:r.width*({right:1,center:.5}[o]||0),r:r.width*({left:1,center:.5}[o]||0),b:r.height*({top:1,middle:.5}[s]||0),t:r.height*({bottom:1,middle:.5}[s]||0)})}var h=t("d3"),f=t("../../plotly"),d=t("../../plots/plots"),p=t("../color"),m=t("../drawing"),g=t("../../lib/svg_text_utils"),v=t("../../plots/cartesian/axis_ids"),y=t("../legend/anchor_utils"),x=t("./constants"),b=t("./get_update_object");e.exports=function(t){var e=t._fullLayout,r=e._infolayer.selectAll(".rangeselector").data(n(t),i);r.enter().append("g").classed("rangeselector",!0),r.exit().remove(),r.style({cursor:"pointer","pointer-events":"all"}),r.each(function(e){var r=h.select(this),n=e,i=n.rangeselector,s=r.selectAll("g.button").data(i.buttons);s.enter().append("g").classed("button",!0),s.exit().remove(),s.each(function(e){var r=h.select(this),s=b(n,e);e.isActive=a(n,e,s),r.call(o,i,e),r.call(l,i,e),r.on("click",function(){t._dragged||f.relayout(t,s)}),r.on("mouseover",function(){e.isHovered=!0,r.call(o,i,e)}),r.on("mouseout",function(){e.isHovered=!1,r.call(o,i,e)})}),c(t,s,i,n._name),r.attr("transform","translate("+i.lx+","+i.ly+")")})}},{"../../lib/svg_text_utils":674,"../../plotly":686,"../../plots/cartesian/axis_ids":694,"../../plots/plots":751,"../color":558,"../drawing":581,"../legend/anchor_utils":594,"./constants":609,"./get_update_object":612,d3:97}],612:[function(t,e,r){"use strict";function n(t,e){var r,n=t.range,a=new Date(t.r2l(n[1])),o=e.step,s=e.count;switch(e.stepmode){case"backward":r=t.l2r(+i.time[o].utc.offset(a,-s));break;case"todate":var l=i.time[o].utc.offset(a,-s);r=t.l2r(+i.time[o].utc.ceil(l))}var u=n[1];return[r,u]}var i=t("d3");e.exports=function(t,e){var r=t._name,i={};if("all"===e.step)i[r+".autorange"]=!0;else{var a=n(t,e);i[r+".range[0]"]=a[0],i[r+".range[1]"]=a[1]}return i}},{d3:97}],613:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"rangeselector",schema:{layout:{"xaxis.rangeselector":t("./attributes")}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":607,"./defaults":610,"./draw":611}],614:[function(t,e,r){"use strict";var n=t("../color/attributes");e.exports={bgcolor:{valType:"color",dflt:n.background},bordercolor:{valType:"color",dflt:n.defaultLine},borderwidth:{valType:"integer",dflt:0,min:0},range:{valType:"info_array",items:[{valType:"any"},{valType:"any"}]},thickness:{valType:"number",dflt:.15,min:0,max:1},visible:{valType:"boolean",dflt:!0}}},{"../color/attributes":557}],615:[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",maskColor:"rgba(0,0,0,0.4)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,grabAreaMinOffset:-6,grabAreaMaxOffset:-2,handleWidth:2,handleRadius:1,handleFill:"#fff",handleStroke:"#666"}},{}],616:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){function a(t,e){return n.coerce(o,l,i,t,e)}if(t[r].rangeslider){n.isPlainObject(t[r].rangeslider)||(t[r].rangeslider={});var o=t[r].rangeslider,s=e[r],l=s.rangeslider={};if(a("bgcolor",e.plot_bgcolor),a("bordercolor"),a("borderwidth"),a("thickness"),a("visible"),a("range"),l.range&&!s.autorange){var u=l.range,c=s.range;u[0]=s.l2r(Math.min(s.r2l(u[0]),s.r2l(c[0]))),u[1]=s.l2r(Math.max(s.r2l(u[1]),s.r2l(c[1])))}else s._needsExpand=!0;l._input=o}}},{"../../lib":658,"./attributes":614}],617:[function(t,e,r){"use strict";function n(t){return t.xaxis&&t.xaxis[k.name]&&t.xaxis[k.name].visible?t._has("gl2d")?[]:[t.xaxis]:[]}function i(t,e,r,n){var i=t.select("rect."+k.slideBoxClassName).node(),o=t.select("rect."+k.grabAreaMinClassName).node(),s=t.select("rect."+k.grabAreaMaxClassName).node();t.on("mousedown",function(){function l(l){var u,c,y,x=+l.clientX-f;switch(h){case i:y="ew-resize",u=p+x,c=g+x;break;case o:y="col-resize",u=p+x,c=g;break;case s:y="col-resize",u=p,c=g+x;break;default:y="ew-resize",u=d,c=d+x}if(c<u){var b=c;c=u,u=b}n._pixelMin=u,n._pixelMax=c,A(m.select(v),y),a(t,e,r,n)}function u(){v.removeEventListener("mousemove",l),v.removeEventListener("mouseup",u),y.removeElement(v)}var c=m.event,h=c.target,f=c.clientX,d=f-t.node().getBoundingClientRect().left,p=n.d2p(r._rl[0]),g=n.d2p(r._rl[1]),v=M.coverSlip();v.addEventListener("mousemove",l),v.addEventListener("mouseup",u)})}function a(t,e,r,n){function i(t){return r.l2r(y.constrain(t,n._rl[0],n._rl[1]))}var a=i(n.p2d(n._pixelMin)),o=i(n.p2d(n._pixelMax));window.requestAnimationFrame(function(){g.relayout(e,"xaxis.range",[a,o])})}function o(t,e,r,n){function i(t){return y.constrain(t,0,n._width)}var a=i(n.d2p(r._rl[0])),o=i(n.d2p(r._rl[1]));t.select("rect."+k.slideBoxClassName).attr("x",a).attr("width",o-a),t.select("rect."+k.maskMinClassName).attr("width",a),t.select("rect."+k.maskMaxClassName).attr("x",o).attr("width",n._width-o),t.select("g."+k.grabberMinClassName).attr("transform","translate("+(a-k.handleWidth-1)+",0)"),t.select("g."+k.grabberMaxClassName).attr("transform","translate("+o+",0)")}function s(t,e,r,n){var i=t.selectAll("rect."+k.bgClassName).data([0]);i.enter().append("rect").classed(k.bgClassName,!0).attr({x:0,y:0,"shape-rendering":"crispEdges"});var a=n.borderwidth%2===0?n.borderwidth:n.borderwidth-1,o=-n._offsetShift;i.attr({width:n._width+a,height:n._height+a,transform:"translate("+o+","+o+")",fill:n.bgcolor,stroke:n.bordercolor,"stroke-width":n.borderwidth})}function l(t,e,r,n){var i=e._fullLayout,a=i._topdefs.selectAll("#"+n._clipId).data([0]);a.enter().append("clipPath").attr("id",n._clipId).append("rect").attr({x:0,y:0}),a.select("rect").attr({width:n._width,height:n._height})}function u(t,e,r,n){var i=w.getSubplots(e,r),a=e.calcdata,o=t.selectAll("g."+k.rangePlotClassName).data(i,y.identity);o.enter().append("g").attr("class",function(t){return k.rangePlotClassName+" "+t}).call(x.setClipUrl,n._clipId),o.order(),o.exit().remove();var s;o.each(function(t,i){var o=m.select(this),l=0===i,u=w.getFromId(e,t,"y"),h=u._name,f={data:[],layout:{xaxis:{type:r.type,domain:[0,1],range:n.range.slice(),calendar:r.calendar},width:n._width,height:n._height,margin:{t:0,b:0,l:0,r:0}}};f.layout[h]={domain:[0,1],range:u.range.slice(),calendar:u.calendar},v.supplyDefaults(f);var d=f._fullLayout.xaxis,p=f._fullLayout[h],g={id:t,plotgroup:o,xaxis:d,yaxis:p};l?s=g:(g.mainplot="xy",g.mainplotinfo=s),_.rangePlot(e,g,c(a,t)),l&&g.bg.remove()})}function c(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n],a=i[0].trace;a.xaxis+a.yaxis===e&&r.push(i)}return r}function h(t,e,r,n){var i=t.selectAll("rect."+k.maskMinClassName).data([0]);i.enter().append("rect").classed(k.maskMinClassName,!0).attr({x:0,y:0}),i.attr("height",n._height).call(b.fill,k.maskColor);var a=t.selectAll("rect."+k.maskMaxClassName).data([0]);a.enter().append("rect").classed(k.maskMaxClassName,!0).attr("y",0),a.attr("height",n._height).call(b.fill,k.maskColor)}function f(t,e,r,n){if(!e._context.staticPlot){var i=t.selectAll("rect."+k.slideBoxClassName).data([0]);i.enter().append("rect").classed(k.slideBoxClassName,!0).attr("y",0).attr("cursor",k.slideBoxCursor),i.attr({height:n._height,fill:k.slideBoxFill})}}function d(t,e,r,n){var i=t.selectAll("g."+k.grabberMinClassName).data([0]);i.enter().append("g").classed(k.grabberMinClassName,!0);var a=t.selectAll("g."+k.grabberMaxClassName).data([0]);a.enter().append("g").classed(k.grabberMaxClassName,!0);var o={x:0,width:k.handleWidth,rx:k.handleRadius,fill:k.handleFill,stroke:k.handleStroke,"shape-rendering":"crispEdges"},s={y:n._height/4,height:n._height/2},l=i.selectAll("rect."+k.handleMinClassName).data([0]);l.enter().append("rect").classed(k.handleMinClassName,!0).attr(o),l.attr(s);var u=a.selectAll("rect."+k.handleMaxClassName).data([0]);if(u.enter().append("rect").classed(k.handleMaxClassName,!0).attr(o),u.attr(s),!e._context.staticPlot){var c={width:k.grabAreaWidth,y:0,fill:k.grabAreaFill,cursor:k.grabAreaCursor},h=i.selectAll("rect."+k.grabAreaMinClassName).data([0]);h.enter().append("rect").classed(k.grabAreaMinClassName,!0).attr(c),h.attr({x:k.grabAreaMinOffset,height:n._height});var f=a.selectAll("rect."+k.grabAreaMaxClassName).data([0]);f.enter().append("rect").classed(k.grabAreaMaxClassName,!0).attr(c),f.attr({x:k.grabAreaMaxOffset,height:n._height})}}function p(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var i=r[n];i.indexOf(k.name)!==-1&&v.autoMargin(t,i)}}var m=t("d3"),g=t("../../plotly"),v=t("../../plots/plots"),y=t("../../lib"),x=t("../drawing"),b=t("../color"),_=t("../../plots/cartesian"),w=t("../../plots/cartesian/axes"),M=t("../dragelement"),A=t("../../lib/setcursor"),k=t("./constants");e.exports=function(t){function e(t){return t._name}var r=t._fullLayout,a=n(r),c=r._infolayer.selectAll("g."+k.containerClassName).data(a,e);c.enter().append("g").classed(k.containerClassName,!0).attr("pointer-events","all"),c.exit().each(function(t){var e=m.select(this),n=t[k.name];e.remove(),r._topdefs.select("#"+n._clipId).remove()}),c.exit().size()&&p(t),0!==a.length&&c.each(function(e){var n=m.select(this),a=e[k.name];a.range||(a._input.range=a.range=w.getAutoRange(e));var c=r.margin,p=r._size,g=e.domain;a._id=k.name+e._id,a._clipId=a._id+"-"+r._uid,a._width=p.w*(g[1]-g[0]),a._height=(r.height-c.b-c.t)*a.thickness,a._offsetShift=Math.floor(a.borderwidth/2);var y=c.l+p.w*g[0],x=r.height-a._height-c.b;n.attr("transform","translate("+y+","+x+")");var b=e.r2l(a.range[0]),_=e.r2l(a.range[1]),M=_-b;a.p2d=function(t){return t/a._width*M+b},a.d2p=function(t){return(t-b)/M*a._width},a._rl=[b,_],n.call(s,t,e,a).call(l,t,e,a).call(u,t,e,a).call(h,t,e,a).call(f,t,e,a).call(d,t,e,a),i(n,t,e,a),o(n,t,e,a);var A=e._boundingBox?e._boundingBox.height:0;v.autoMargin(t,a._id,{x:0,y:0,l:0,r:0,t:0,b:a._height+r.margin.b+A,pad:15+2*a._offsetShift})})}},{"../../lib":658,"../../lib/setcursor":670,"../../plotly":686,"../../plots/cartesian":699,"../../plots/cartesian/axes":691,"../../plots/plots":751,"../color":558,"../dragelement":579,"../drawing":581,"./constants":615,d3:97}],618:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"rangeslider",schema:{layout:{"xaxis.rangeslider":t("./attributes")}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":614,"./defaults":616,"./draw":617}],619:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),i=t("../../traces/scatter/attributes"),a=t("../../lib/extend").extendFlat,o=i.line;e.exports={_isLinkedToArray:"shape",visible:{valType:"boolean",dflt:!0},type:{valType:"enumerated",values:["circle","rect","path","line"]},layer:{valType:"enumerated",values:["below","above"],dflt:"above"},xref:a({},n.xref,{}),x0:{valType:"any"},x1:{valType:"any"},yref:a({},n.yref,{}),y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string"},opacity:{valType:"number",min:0,max:1,dflt:1},line:{color:o.color,width:o.width,dash:o.dash},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"}}},{"../../lib/extend":651,"../../traces/scatter/attributes":884,"../annotations/attributes":548}],620:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a="category"===t.type?Number:t.d2c;if(void 0!==e)return[a(e),a(r)];if(n){var l,u,c,h,f,d=1/0,p=-(1/0),m=n.match(o.segmentRE);for("date"===t.type&&(a=s.decodeDate(a)),l=0;l<m.length;l++)u=m[l],c=i[u.charAt(0)].drawn,void 0!==c&&(h=m[l].substr(1).match(o.paramRE),!h||h.length<c||(f=a(h[c]),f<d&&(d=f),f>p&&(p=f)));return p>=d?[d,p]:void 0}}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./constants"),s=t("./helpers");e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var s=0;s<r.length;s++){var l,u,c=r[s],h=c.line.width/2;"paper"!==c.xref&&(l=a.getFromId(t,c.xref),u=n(l,c.x0,c.x1,c.path,o.paramIsX),u&&a.expand(l,u,{ppad:h})),"paper"!==c.yref&&(l=a.getFromId(t,c.yref),u=n(l,c.y0,c.y1,c.path,o.paramIsY),u&&a.expand(l,u,{ppad:h}))}}},{"../../lib":658,"../../plots/cartesian/axes":691,"./constants":621,"./helpers":624}],621:[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}}},{}],622:[function(t,e,r){"use strict";var n=t("../../plots/array_container_defaults"),i=t("./shape_defaults");e.exports=function(t,e){var r={name:"shapes",handleItemDefaults:i};n(t,e,r)}},{"../../plots/array_container_defaults":688,"./shape_defaults":626}],623:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._shapeSubplotLayer.selectAll("path").remove();for(var r=0;r<e.shapes.length;r++)e.shapes[r].visible&&i(t,r)}function i(t,e,r,n){if(!v(e)||e===-1){if(!e&&Array.isArray(n))return void a(t,n);if("remove"===n)return void o(t);if(r&&"add"!==n)return void s(t,r,n);e=t._fullLayout.shapes.length,t._fullLayout.shapes.push({})}if(!r&&n){if("remove"===n)return void l(t,e);("add"===n||x.isPlainObject(n))&&u(t,e,n)}c(t,e,r,n)}function a(t,e){t.layout.shapes=e,S(t.layout,t._fullLayout),n(t)}function o(t){delete t.layout.shapes,t._fullLayout.shapes=[],n(t)}function s(t,e,r){for(var n=0;n<t._fullLayout.shapes.length;n++)i(t,n,e,r)}function l(t,e){f(t,e).selectAll('[data-index="'+e+'"]').remove(),t._fullLayout.shapes.splice(e,1),t.layout.shapes.splice(e,1);for(var r=e;r<t._fullLayout.shapes.length;r++)f(t,r).selectAll('[data-index="'+(r+1)+'"]').attr("data-index",r),i(t,r)}function u(t,e,r){t._fullLayout.shapes.splice(e,0,{});var n=x.isPlainObject(r)?x.extendFlat({},r):{text:"New text"};t.layout.shapes?t.layout.shapes.splice(e,0,n):t.layout.shapes=[n];for(var a=t._fullLayout.shapes.length-1;a>e;a--)f(t,a).selectAll('[data-index="'+(a-1)+'"]').attr("data-index",a),i(t,a)}function c(t,e,r,n){function i(r){var n={"data-index":e,"fill-rule":"evenodd",d:p(t,L)},i=L.line.width?L.line.color:"rgba(0,0,0,0)",a=r.append("path").attr(n).style("opacity",L.opacity).call(_.stroke,i).call(_.fill,L.fillcolor).call(w.dashLine,L.line.dash,L.line.width);C&&a.call(w.setClipUrl,"clip"+t._fullLayout._uid+C),t._context.editable&&h(t,a,L,e)}var a,o;f(t,e).selectAll('[data-index="'+e+'"]').remove();var s=t.layout.shapes[e];if(s){var l={};"string"==typeof r&&r?l[r]=n:x.isPlainObject(r)&&(l=r);var u=Object.keys(l);for(a=0;a<u.length;a++){var c=u[a];x.nestedProperty(s,c).set(l[c])}if(s.visible!==!1){var m={xref:s.xref,yref:s.yref},g=["x0","x1","y0","y1"];for(a=0;a<4;a++){var v=g[a];if(void 0===l[v]&&void 0!==s[v]){var y,M=v.charAt(0),A=b.getFromId(t,b.coerceRef(m,{},t,M,"","paper")),k=b.getFromId(t,b.coerceRef(s,{},t,M,"","paper")),S=s[v];void 0!==l[M+"ref"]&&(A?(y=T.shapePositionToRange(A)(S),S=A.r2fraction(y)):S=(S-k.domain[0])/(k.domain[1]-k.domain[0]),k?(y=k.fraction2r(S),S=T.rangeToShapePosition(k)(y)):S=A.domain[0]+S*(A.domain[1]-A.domain[0])),s[v]=S}}var L={};E(s,L,t._fullLayout),t._fullLayout.shapes[e]=L;var C;if("below"!==L.layer)C=(L.xref+L.yref).replace(/paper/g,""),i(t._fullLayout._shapeUpperLayer);else if("paper"===L.xref&&"paper"===L.yref)C="",i(t._fullLayout._shapeLowerLayer);else{var I,z=t._fullLayout._plots||{},D=Object.keys(z);for(a=0,o=D.length;a<o;a++)I=z[D[a]],C=D[a],d(t,L,I)&&i(I.shapelayer)}}}}function h(t,e,r,n){function i(t){var r=Z.right-Z.left,n=Z.bottom-Z.top,i=t.clientX-Z.left,a=t.clientY-Z.top,o=r>G&&n>X&&!t.shiftKey?M.getCursor(i/r,1-a/n):"move";A(e,o),Y=o.split("-")[0]}function a(e){N=b.getFromId(t,r.xref),B=b.getFromId(t,r.yref),U=T.getDataToPixel(t,N),V=T.getDataToPixel(t,B,!0),q=T.getPixelToData(t,N),H=T.getPixelToData(t,B,!0);var a="shapes["+n+"]";"path"===r.type?(F=r.path,j=a+".path"):(c=U(r.x0),h=V(r.y0),f=U(r.x1),d=V(r.y1),m=a+".x0",v=a+".y0",x=a+".x1",_=a+".y1"),c<f?(E=c,I=a+".x0",O="x0",S=f,z=a+".x1",R="x1"):(E=f,I=a+".x1",O="x1",S=c,z=a+".x0",R="x0"),h<d?(w=h,L=a+".y0",D="y0",k=d,C=a+".y1",P="y1"):(w=d,L=a+".y1",D="y1",k=h,C=a+".y0",P="y0"),u={},i(e),W.moveFn="move"===Y?s:l}function o(r){A(e),r&&y.relayout(t,u)}function s(n,i){if("path"===r.type){var a=function(t){return q(U(t)+n)};N&&"date"===N.type&&(a=T.encodeDate(a));var o=function(t){return H(V(t)+i)};B&&"date"===B.type&&(o=T.encodeDate(o)),r.path=g(F,a,o),u[j]=r.path}else u[m]=r.x0=q(c+n),u[v]=r.y0=H(h+i),u[x]=r.x1=q(f+n),u[_]=r.y1=H(d+i);e.attr("d",p(t,r))}function l(n,i){if("path"===r.type){var a=function(t){return q(U(t)+n)};N&&"date"===N.type&&(a=T.encodeDate(a));var o=function(t){return H(V(t)+i)};B&&"date"===B.type&&(o=T.encodeDate(o)),r.path=g(F,a,o),u[j]=r.path}else{var s=~Y.indexOf("n")?w+i:w,l=~Y.indexOf("s")?k+i:k,c=~Y.indexOf("w")?E+n:E,h=~Y.indexOf("e")?S+n:S;l-s>X&&(u[L]=r[D]=H(s),u[C]=r[P]=H(l)),h-c>G&&(u[I]=r[O]=q(c),u[z]=r[R]=q(h))}e.attr("d",p(t,r))}var u,c,h,f,d,m,v,x,_,w,k,E,S,L,C,I,z,D,P,O,R,F,j,N,B,U,V,q,H,Y,G=10,X=10,W={setCursor:i,element:e.node(),prepFn:a,doneFn:o},Z=W.element.getBoundingClientRect();M.init(W)}function f(t,e){var r=t._fullLayout.shapes[e],n=t._fullLayout._shapeUpperLayer;return r?"below"===r.layer&&(n="paper"===r.xref&&"paper"===r.yref?t._fullLayout._shapeLowerLayer:t._fullLayout._shapeSubplotLayer):x.log("getShapeLayer: undefined shape: index",e),n}function d(t,e,r){var n=b.getFromId(t,r.id,"x")._id,i=b.getFromId(t,r.id,"y")._id,a="below"===e.layer,o=n===e.xref||i===e.yref,s=!!r.shapelayer;return a&&o&&s}function p(t,e){var r,n,i,a,o=e.type,s=b.getFromId(t,e.xref),l=b.getFromId(t,e.yref),u=t._fullLayout._size;if(s?(r=T.shapePositionToRange(s),n=function(t){return s._offset+s.r2p(r(t,!0))}):n=function(t){return u.l+u.w*t},l?(i=T.shapePositionToRange(l),a=function(t){return l._offset+l.r2p(i(t,!0))}):a=function(t){return u.t+u.h*(1-t)},"path"===o)return s&&"date"===s.type&&(n=T.decodeDate(n)),l&&"date"===l.type&&(a=T.decodeDate(a)),m(e.path,n,a);var c=n(e.x0),h=n(e.x1),f=a(e.y0),d=a(e.y1);if("line"===o)return"M"+c+","+f+"L"+h+","+d;if("rect"===o)return"M"+c+","+f+"H"+h+"V"+d+"H"+c+"Z";var p=(c+h)/2,g=(f+d)/2,v=Math.abs(p-c),y=Math.abs(g-f),x="A"+v+","+y,_=p+v+","+g,w=p+","+(g-y);return"M"+_+x+" 0 1,1 "+w+x+" 0 0,1 "+_+"Z"}function m(t,e,r){return t.replace(k.segmentRE,function(t){var n=0,i=t.charAt(0),a=k.paramIsX[i],o=k.paramIsY[i],s=k.numParams[i],l=t.substr(1).replace(k.paramRE,function(t){return a[n]?t=e(t):o[n]&&(t=r(t)),n++,n>s&&(t="X"),t});return n>s&&(l=l.replace(/[\s,]*X.*/,""),x.log("Ignoring extra params in segment "+t)),i+l})}function g(t,e,r){return t.replace(k.segmentRE,function(t){var n=0,i=t.charAt(0),a=k.paramIsX[i],o=k.paramIsY[i],s=k.numParams[i],l=t.substr(1).replace(k.paramRE,function(t){return n>=s?t:(a[n]?t=e(t):o[n]&&(t=r(t)),n++,t)});return i+l})}var v=t("fast-isnumeric"),y=t("../../plotly"),x=t("../../lib"),b=t("../../plots/cartesian/axes"),_=t("../color"),w=t("../drawing"),M=t("../dragelement"),A=t("../../lib/setcursor"),k=t("./constants"),T=t("./helpers"),E=t("./shape_defaults"),S=t("./defaults");e.exports={draw:n,drawOne:i}},{"../../lib":658,"../../lib/setcursor":670,"../../plotly":686,"../../plots/cartesian/axes":691,"../color":558,"../dragelement":579,"../drawing":581,"./constants":621,"./defaults":622,"./helpers":624,"./shape_defaults":626,"fast-isnumeric":106}],624:[function(t,e,r){"use strict";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.getDataToPixel=function(t,e,n){var i,a=t._fullLayout._size;if(e){var o=r.shapePositionToRange(e);i=function(t){return e._offset+e.r2p(o(t,!0))},"date"===e.type&&(i=r.decodeDate(i))}else i=n?function(t){return a.t+a.h*(1-t)}:function(t){return a.l+a.w*t};return i},r.getPixelToData=function(t,e,n){var i,a=t._fullLayout._size;if(e){var o=r.rangeToShapePosition(e);i=function(t){return o(e.p2r(t-e._offset))}}else i=n?function(t){return 1-(t-a.t)/a.h}:function(t){return(t-a.l)/a.w};return i}},{}],625:[function(t,e,r){"use strict";var n=t("./draw");e.exports={moduleType:"component",name:"shapes",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"./attributes":619,"./calc_autorange":620,"./defaults":622,"./draw":623}],626:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./attributes"),o=t("./helpers");e.exports=function(t,e,r,s,l){function u(r,i){return n.coerce(t,e,a,r,i)}s=s||{},l=l||{};var c=u("visible",!l.itemIsNotPlainObject);if(!c)return e;u("layer"),u("opacity"),u("fillcolor"),u("line.color"),u("line.width"),u("line.dash");for(var h=t.path?"path":"rect",f=u("type",h),d=["x","y"],p=0;p<2;p++){var m=d[p],g={_fullLayout:r},v=i.coerceRef(t,e,g,m,"","paper");if("path"!==f){var y,x,b,_=.25,w=.75;"paper"!==v?(y=i.getFromId(g,v),b=o.rangeToShapePosition(y),x=o.shapePositionToRange(y)):x=b=n.identity;var M=m+"0",A=m+"1",k=t[M],T=t[A];t[M]=x(t[M],!0),t[A]=x(t[A],!0),i.coercePosition(e,g,u,v,M,_),i.coercePosition(e,g,u,v,A,w),e[M]=b(e[M]),e[A]=b(e[A]),t[M]=k,t[A]=T}}return"path"===f?u("path"):n.noneOrAll(t,e,["x0","x1","y0","y1"]),e}},{"../../lib":658,"../../plots/cartesian/axes":691,"./attributes":619,"./helpers":624}],627:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/pad_attributes"),a=t("../../lib/extend").extendFlat,o=t("../../lib/extend").extendDeep,s=t("../../plots/animation_attributes"),l=t("./constants"),u={_isLinkedToArray:"step",method:{valType:"enumerated",values:["restyle","relayout","animate","update"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"}};e.exports={_isLinkedToArray:"slider",visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:u,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:o({},i,{},{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:s.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:a({},n,{})},font:a({},n,{}),activebgcolor:{valType:"color",dflt:l.gripBgActiveColor},bgcolor:{valType:"color",dflt:l.railBgColor},bordercolor:{valType:"color",dflt:l.railBorderColor},borderwidth:{valType:"number",min:0,dflt:l.railBorderWidth},ticklen:{valType:"number",min:0,dflt:l.tickLength},tickcolor:{valType:"color",dflt:l.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:l.minorTickLength}}},{"../../lib/extend":651,"../../plots/animation_attributes":687,"../../plots/font_attributes":711,"../../plots/pad_attributes":750,"./constants":628}],628:[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,fontSizeToHeight:1.3,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}},{}],629:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return a.coerce(t,e,s,r,n)}var o=i(t,e),l=n("visible",o.length>0);if(l){n("active"),n("x"),n("y"),a.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("len"),n("lenmode"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),a.coerceFont(n,"font",r.font);var u=n("currentvalue.visible");u&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),a.coerceFont(n,"currentvalue.font",e.font)),n("transition.duration"),n("transition.easing"),n("bgcolor"),n("activebgcolor"),n("bordercolor"),n("borderwidth"),n("ticklen"),n("tickwidth"),n("tickcolor"),n("minorticklen")}}function i(t,e){function r(t,e){return a.coerce(n,i,c,t,e)}for(var n,i,o=t.steps||[],s=e.steps=[],l=0;l<o.length;l++)n=o[l],i={},a.isPlainObject(n)&&Array.isArray(n.args)&&(r("method"),r("args"),r("label","step-"+l),r("value",i.label),s.push(i));return s}var a=t("../../lib"),o=t("../../plots/array_container_defaults"),s=t("./attributes"),l=t("./constants"),u=l.name,c=s.steps;e.exports=function(t,e){var r={name:u,handleItemDefaults:n};o(t,e,r)}},{"../../lib":658,"../../plots/array_container_defaults":688,"./attributes":627,"./constants":628}],630:[function(t,e,r){"use strict";function n(t){for(var e=t[L.name],r=[],n=0;n<e.length;n++){var i=e[n];i.visible&&i.steps.length&&r.push(i)}return r}function i(t){return t._index}function a(t,e){var r=t._tester.selectAll("g."+L.labelGroupClass).data(e.steps);r.enter().append("g").classed(L.labelGroupClass,!0);var n=0,i=0;if(r.each(function(t){var r=w.select(this),a=u(r,{step:t},e),o=a.node()&&T.bBox(a.node()).width||0;i=a.node()&&T.bBox(a.node()).height||0,n=Math.max(n,o)}),r.remove(),e.inputAreaWidth=Math.max(L.railWidth,L.gripHeight),e.currentValueMaxWidth=0,e.currentValueHeight=0,e.currentValueTotalHeight=0,e.currentvalue.visible){var a=t._tester.append("g");r.each(function(t){var r=s(a,e,t.label),n=r.node()&&T.bBox(r.node())||{width:0,height:0};e.currentValueMaxWidth=Math.max(e.currentValueMaxWidth,Math.ceil(n.width)),e.currentValueHeight=Math.max(e.currentValueHeight,Math.ceil(n.height))}),e.currentValueTotalHeight=e.currentValueHeight+e.currentvalue.offset,a.remove()}var o=t._fullLayout._size;e.lx=o.l+o.w*e.x,e.ly=o.t+o.h*(1-e.y),"fraction"===e.lenmode?e.outerLength=Math.round(o.w*e.len):e.outerLength=e.len,e.lenPad=Math.round(.5*L.gripWidth),e.inputAreaStart=0,e.inputAreaLength=Math.round(e.outerLength-e.pad.l-e.pad.r);var l=e.inputAreaLength-2*L.stepInset,c=l/(e.steps.length-1),h=n+L.labelPadding;e.labelStride=Math.max(1,Math.ceil(h/c)),e.labelHeight=i,e.height=e.currentValueTotalHeight+L.tickOffset+e.ticklen+L.labelOffset+e.labelHeight+e.pad.t+e.pad.b;var f="left";S.isRightAnchor(e)&&(e.lx-=e.outerLength,f="right"),S.isCenterAnchor(e)&&(e.lx-=e.outerLength/2,f="center");var d="top";S.isBottomAnchor(e)&&(e.ly-=e.height,d="bottom"),S.isMiddleAnchor(e)&&(e.ly-=e.height/2,d="middle"),e.outerLength=Math.ceil(e.outerLength),e.height=Math.ceil(e.height),e.lx=Math.round(e.lx),e.ly=Math.round(e.ly),M.autoMargin(t,L.autoMarginIdRoot+e._index,{x:e.x,y:e.y,l:e.outerLength*({right:1,center:.5}[f]||0),r:e.outerLength*({left:1,center:.5}[f]||0),b:e.height*({top:1,middle:.5}[d]||0),t:e.height*({bottom:1,middle:.5}[d]||0)})}function o(t,e,r){r.active>=r.steps.length&&(r.active=0),e.call(s,r).call(b,r).call(c,r).call(p,r).call(x,t,r).call(l,t,r),A.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(g,r,r.active/(r.steps.length-1),!1),e.call(s,r)}function s(t,e,r){if(e.currentvalue.visible){var n,i,a=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":n=e.inputAreaLength-L.currentValueInset-e.currentValueMaxWidth,i="left";break;case"center":n=.5*e.inputAreaLength,i="middle";break;default:n=L.currentValueInset,i="left"}a.enter().append("text").classed(L.labelClass,!0).classed("user-select-none",!0).attr("text-anchor",i);var o=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)o+=r;else{var s=e.steps[e.active].label;o+=s}return e.currentvalue.suffix&&(o+=e.currentvalue.suffix),a.call(T.font,e.currentvalue.font).text(o).call(E.convertToTspans),A.setTranslate(a,n,e.currentValueHeight),a}}function l(t,e,r){var n=t.selectAll("rect."+L.gripRectClass).data([0]);n.enter().append("rect").classed(L.gripRectClass,!0).call(d,e,t,r).style("pointer-events","all"),n.attr({width:L.gripWidth,height:L.gripHeight,rx:L.gripRadius,ry:L.gripRadius}).call(k.stroke,r.bordercolor).call(k.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function u(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(L.labelClass,!0).classed("user-select-none",!0).attr("text-anchor","middle"),n.call(T.font,r.font).text(e.step.label).call(E.convertToTspans),n}function c(t,e){var r=t.selectAll("g."+L.labelsClass).data([0]);r.enter().append("g").classed(L.labelsClass,!0);var n=r.selectAll("g."+L.labelGroupClass).data(e.labelSteps);n.enter().append("g").classed(L.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=w.select(this);r.call(u,t,e),A.setTranslate(r,v(e,t.fraction),L.tickOffset+e.ticklen+e.labelHeight+L.labelOffset+e.currentValueTotalHeight)})}function h(t,e,r,n,i){var a=Math.round(n*(r.steps.length-1));a!==r.active&&f(t,e,r,a,!0,i)}function f(t,e,r,n,i,a){var o=r.active;r._input.active=r.active=n;var l=r.steps[r.active];e.call(g,r,r.active/(r.steps.length-1),a),e.call(s,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:i,previousActive:o}),l&&l.method&&i&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=i,e._nextMethod.doTransition=a):(e._nextMethod={step:l,doCallback:i,doTransition:a},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(M.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function d(t,e,r){function n(){return r.data()[0]}var i=r.node(),a=w.select(e);t.on("mousedown",function(){var t=n();e.emit("plotly_sliderstart",{slider:t});var o=r.select("."+L.gripRectClass);w.event.stopPropagation(),w.event.preventDefault(),o.call(k.fill,t.activebgcolor);var s=y(t,w.mouse(i)[0]);h(e,r,t,s,!0),t._dragging=!0,a.on("mousemove",function(){var t=n(),a=y(t,w.mouse(i)[0]);h(e,r,t,a,!1)}),a.on("mouseup",function(){var t=n();t._dragging=!1,o.call(k.fill,t.bgcolor),a.on("mouseup",null),a.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function p(t,e){var r=t.selectAll("rect."+L.tickRectClass).data(e.steps);r.enter().append("rect").classed(L.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var n=r%e.labelStride===0,i=w.select(this);i.attr({height:n?e.ticklen:e.minorticklen}).call(k.fill,n?e.tickcolor:e.tickcolor),A.setTranslate(i,v(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?L.tickOffset:L.minorTickOffset)+e.currentValueTotalHeight)})}function m(t){t.labelSteps=[];for(var e=0,r=t.steps.length,n=e;n<r;n+=t.labelStride)t.labelSteps.push({fraction:n/(r-1),step:t.steps[n]})}function g(t,e,r,n){var i=t.select("rect."+L.gripRectClass),a=v(e,r);if(!e._invokingCommand){var o=i;n&&e.transition.duration>0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(a-.5*L.gripWidth)+","+e.currentValueTotalHeight+")")}}function v(t,e){return t.inputAreaStart+L.stepInset+(t.inputAreaLength-2*L.stepInset)*Math.min(1,Math.max(0,e))}function y(t,e){return Math.min(1,Math.max(0,(e-L.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*L.stepInset-2*t.inputAreaStart)))}function x(t,e,r){var n=t.selectAll("rect."+L.railTouchRectClass).data([0]);n.enter().append("rect").classed(L.railTouchRectClass,!0).call(d,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,L.tickOffset+r.ticklen+r.labelHeight)}).call(k.fill,r.bgcolor).attr("opacity",0),A.setTranslate(n,0,r.currentValueTotalHeight)}function b(t,e){var r=t.selectAll("rect."+L.railRectClass).data([0]);r.enter().append("rect").classed(L.railRectClass,!0);var n=e.inputAreaLength-2*L.railInset;r.attr({width:n,height:L.railWidth,rx:L.railRadius,ry:L.railRadius,"shape-rendering":"crispEdges"}).call(k.stroke,e.bordercolor).call(k.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),A.setTranslate(r,L.railInset,.5*(e.inputAreaWidth-L.railWidth)+e.currentValueTotalHeight)}function _(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var i=r[n];i.indexOf(L.autoMarginIdRoot)!==-1&&M.autoMargin(t,i)}}var w=t("d3"),M=t("../../plots/plots"),A=t("../../lib"),k=t("../color"),T=t("../drawing"),E=t("../../lib/svg_text_utils"),S=t("../legend/anchor_utils"),L=t("./constants");e.exports=function(t){var e=t._fullLayout,r=n(e),s=e._infolayer.selectAll("g."+L.containerClassName).data(r.length>0?[0]:[]);if(s.enter().append("g").classed(L.containerClassName,!0).style("cursor","ew-resize"),s.exit().remove(),s.exit().size()&&_(t),0!==r.length){var l=s.selectAll("g."+L.groupClassName).data(r,i);l.enter().append("g").classed(L.groupClassName,!0),l.exit().each(function(e){w.select(this).remove(),e._commandObserver.remove(),delete e._commandObserver,M.autoMargin(t,L.autoMarginIdRoot+e._index)});for(var u=0;u<r.length;u++){var c=r[u];a(t,c)}l.each(function(e){if(!(e.steps.length<2)){var r=w.select(this);m(e),M.manageCommandObserver(t,e,e.steps,function(e){var n=r.data()[0];n.active!==e.index&&(n._dragging||f(t,r,n,e.index,!1,!0))}),o(t,w.select(this),e)}})}}},{"../../lib":658,"../../lib/svg_text_utils":674,"../../plots/plots":751,"../color":558,"../drawing":581,"../legend/anchor_utils":594,"./constants":628,d3:97}],631:[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":627,"./constants":628,"./defaults":629,"./draw":630}],632:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plotly"),o=t("../../plots/plots"),s=t("../../lib"),l=t("../drawing"),u=t("../color"),c=t("../../lib/svg_text_utils"),h=e.exports={};h.draw=function(t,e,r){function h(t){s.syncOrAsync([f,d],t)}function f(e){return e.attr("transform",_?"rotate("+[_.rotate,b.x,b.y]+") translate(0, "+_.offset+")":null),e.style({"font-family":A,"font-size":n.round(k,2)+"px",fill:u.rgb(T),opacity:E*u.opacity(T),"font-weight":o.fontWeight}).attr(b).call(c.convertToTspans).attr(b),e.selectAll("tspan.line").attr(b),o.previousPromises(t)}function d(t){var e=n.select(t.node().parentNode);if(x&&x.selection&&x.side&&L){e.attr("transform",null);var r=0,a={left:"right",right:"left",top:"bottom",bottom:"top"}[x.side],o=["left","top"].indexOf(x.side)!==-1?-1:1,u=i(x.pad)?x.pad:2,c=l.bBox(e.node()),h={left:0,top:0,right:M.width,bottom:M.height},f=x.maxShift||(h[x.side]-c[x.side])*("left"===x.side||"top"===x.side?-1:1);if(f<0?r=f:(c.left-=x.offsetLeft,c.right-=x.offsetLeft,c.top-=x.offsetTop,c.bottom-=x.offsetTop,x.selection.each(function(){var t=l.bBox(this);s.bBoxIntersect(c,t,u)&&(r=Math.max(r,o*(t[x.side]-c[a])+u))}),r=Math.min(f,r)),r>0||f<0){var d={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[x.side];e.attr("transform","translate("+d+")")}}}function p(){E=0,S=!0,L=I,M._infolayer.select("."+e).attr({"data-unformatted":L}).text(L).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 m=r.propContainer,g=r.propName,v=r.traceIndex,y=r.dfltName,x=r.avoid||{},b=r.attributes,_=r.transform,w=r.containerGroup,M=t._fullLayout,A=m.titlefont.family,k=m.titlefont.size,T=m.titlefont.color,E=1,S=!1,L=m.title.trim();""===L&&(E=0),L.match(/Click to enter .+ title/)&&(E=.2,S=!0),w||(w=M._infolayer.selectAll(".g-"+e).data([0]),w.enter().append("g").classed("g-"+e,!0));var C=w.selectAll("text").data([0]);C.enter().append("text"),C.text(L).attr("class",e),C.attr({"data-unformatted":L}).call(h);var I="Click to enter "+y+" title";t._context.editable?(L||p(),C.call(c.makeEditable).on("edit",function(e){void 0!==v?a.restyle(t,g,e,v):a.relayout(t,g,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(h)}).on("input",function(t){this.text(t||" ").attr(b).selectAll("tspan.line").attr(b)})):L&&!L.match(/Click to enter .+ title/)||C.remove(),C.classed("js-placeholder",S)}},{"../../lib":658,"../../lib/svg_text_utils":674,"../../plotly":686,"../../plots/plots":751,"../color":558,"../drawing":581,d3:97,"fast-isnumeric":106}],633:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plots/pad_attributes"),s={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""}};e.exports={_isLinkedToArray:"updatemenu",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:s,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:a({},o,{}),font:a({},n,{}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1}}},{"../../lib/extend":651,"../../plots/font_attributes":711,"../../plots/pad_attributes":750,"../color/attributes":557}],634:[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,fontSizeToHeight:1.3,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF"}},{}],635:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return a.coerce(t,e,s,r,n)}var o=i(t,e),l=n("visible",o.length>0);l&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),a.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),a.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}function i(t,e){function r(t,e){return a.coerce(n,i,c,t,e)}for(var n,i,o=t.buttons||[],s=e.buttons=[],l=0;l<o.length;l++)n=o[l],i={},a.isPlainObject(n)&&Array.isArray(n.args)&&(r("method"),r("args"),r("label"),i._index=l,s.push(i));return s}var a=t("../../lib"),o=t("../../plots/array_container_defaults"),s=t("./attributes"),l=t("./constants"),u=l.name,c=s.buttons;e.exports=function(t,e){var r={name:u,handleItemDefaults:n};o(t,e,r)}},{"../../lib":658,"../../plots/array_container_defaults":688,"./attributes":633,"./constants":634}],636:[function(t,e,r){"use strict";function n(t){for(var e=t[T.name],r=[],n=0;n<e.length;n++){var i=e[n];i.visible&&r.push(i)}return r}function i(t){return t._index}function a(t,e){var r=+t.attr(T.menuIndexAttrName);return r===e._index}function o(t,e,r,n){var i=e.selectAll("g."+T.headerClassName).data([0]);i.enter().append("g").classed(T.headerClassName,!0).style("pointer-events","all");var o=n.active,l=n.buttons[o]||T.blankHeaderOpts,c={y:n.pad.t,yPad:0,x:n.pad.l,xPad:0,index:0},h={width:n.headerWidth,height:n.headerHeight};i.call(u,n,l).call(g,n,c,h);var f=e.selectAll("text."+T.headerArrowClassName).data([0]);f.enter().append("text").classed(T.headerArrowClassName,!0).classed("user-select-none",!0).attr("text-anchor","end").call(M.font,n.font).text("▼"),f.attr({x:n.headerWidth-T.arrowOffsetX+n.pad.l,y:n.headerHeight/2+T.textOffsetY+n.pad.t}),i.on("click",function(){r.call(v),r.attr(T.menuIndexAttrName,a(r,n)?"-1":String(n._index)),s(t,e,r,n)}),i.on("mouseover",function(){i.call(d)}),i.on("mouseout",function(){i.call(p,n)}),_.setTranslate(e,n.lx,n.ly)}function s(t,e,r,n){r||(r=e,r.attr("pointer-events","all"));var i="-1"!==r.attr(T.menuIndexAttrName)||"buttons"===n.type?n.buttons:[],a="dropdown"===n.type?T.dropdownButtonClassName:T.buttonClassName,o=r.selectAll("g."+a).data(i),s=o.enter().append("g").classed(a,!0),c=o.exit();"dropdown"===n.type?(s.attr("opacity","0").transition().attr("opacity","1"),c.transition().attr("opacity","0").remove()):c.remove();var h=0,m=0,v=["up","down"].indexOf(n.direction)!==-1;"dropdown"===n.type&&(v?m=n.headerHeight+T.gapButtonHeader:h=n.headerWidth+T.gapButtonHeader),"dropdown"===n.type&&"up"===n.direction&&(m=-T.gapButtonHeader+T.gapButton-n.openHeight),"dropdown"===n.type&&"left"===n.direction&&(h=-T.gapButtonHeader+T.gapButton-n.openWidth);var y={x:h+n.pad.l,y:m+n.pad.t,yPad:T.gapButton,xPad:T.gapButton,index:0};o.each(function(i,a){var s=x.select(this);s.call(u,n,i).call(g,n,y),s.on("click",function(){l(t,n,i,e,r,a),b.executeAPICommand(t,i.method,i.args),t.emit("plotly_buttonclicked",{menu:n,button:i,active:n.active})}),s.on("mouseover",function(){s.call(d)}),s.on("mouseout",function(){s.call(p,n),o.call(f,n)})}),o.call(f,n),_.setTranslate(r,n.lx,n.ly)}function l(t,e,r,n,i,a,l){e._input.active=e.active=a,"dropdown"===e.type&&(i.attr(T.menuIndexAttrName,"-1"),o(t,n,i,e)),l&&"buttons"!==e.type||s(t,n,i,e)}function u(t,e,r){t.call(c,e).call(h,e,r)}function c(t,e){var r=t.selectAll("rect").data([0]);r.enter().append("rect").classed(T.itemRectClassName,!0).attr({rx:T.rx,ry:T.ry,"shape-rendering":"crispEdges"}),r.call(w.stroke,e.bordercolor).call(w.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px")}function h(t,e,r){var n=t.selectAll("text").data([0]);n.enter().append("text").classed(T.itemTextClassName,!0).classed("user-select-none",!0).attr("text-anchor","start"),n.call(M.font,e.font).text(r.label).call(A.convertToTspans)}function f(t,e){var r=e.active;t.each(function(t,n){var i=x.select(this);n===r&&e.showactive&&i.select("rect."+T.itemRectClassName).call(w.fill,T.activeColor)})}function d(t){t.select("rect."+T.itemRectClassName).call(w.fill,T.hoverColor)}function p(t,e){t.select("rect."+T.itemRectClassName).call(w.fill,e.bgcolor)}function m(t,e){e.width1=0,e.height1=0,e.heights=[],e.widths=[],e.totalWidth=0,e.totalHeight=0,e.openWidth=0,e.openHeight=0,e.lx=0,e.ly=0;var r=t._tester.selectAll("g."+T.dropdownButtonClassName).data(e.buttons);r.enter().append("g").classed(T.dropdownButtonClassName,!0);var n=["up","down"].indexOf(e.direction)!==-1;r.each(function(t,r){var i=x.select(this);i.call(u,e,t);var a=i.select("."+T.itemTextClassName),o=a.selectAll("tspan"),s=a.node()&&M.bBox(a.node()).width,l=Math.max(s+T.textPadX,T.minWidth),c=e.font.size*T.fontSizeToHeight,h=o[0].length||1,f=Math.max(c*h,T.minHeight)+T.textOffsetY;f=Math.ceil(f),l=Math.ceil(l),e.widths[r]=l,e.heights[r]=f,e.height1=Math.max(e.height1,f),e.width1=Math.max(e.width1,l),n?(e.totalWidth=Math.max(e.totalWidth,l),e.openWidth=e.totalWidth,e.totalHeight+=f+T.gapButton,e.openHeight+=f+T.gapButton):(e.totalWidth+=l+T.gapButton,e.openWidth+=l+T.gapButton,e.totalHeight=Math.max(e.totalHeight,f),e.openHeight=e.totalHeight)}),n?e.totalHeight-=T.gapButton:e.totalWidth-=T.gapButton,e.headerWidth=e.width1+T.arrowPadX,e.headerHeight=e.height1,"dropdown"===e.type&&(n?(e.width1+=T.arrowPadX,e.totalHeight=e.height1):e.totalWidth=e.width1,e.totalWidth+=T.arrowPadX),r.remove();var i=e.totalWidth+e.pad.l+e.pad.r,a=e.totalHeight+e.pad.t+e.pad.b,o=t._fullLayout._size;e.lx=o.l+o.w*e.x,e.ly=o.t+o.h*(1-e.y);var s="left";k.isRightAnchor(e)&&(e.lx-=i,s="right"),k.isCenterAnchor(e)&&(e.lx-=i/2,s="center");var l="top";k.isBottomAnchor(e)&&(e.ly-=a,l="bottom"),k.isMiddleAnchor(e)&&(e.ly-=a/2,l="middle"),e.totalWidth=Math.ceil(e.totalWidth),e.totalHeight=Math.ceil(e.totalHeight),e.lx=Math.round(e.lx),e.ly=Math.round(e.ly),b.autoMargin(t,T.autoMarginIdRoot+e._index,{x:e.x,y:e.y,l:i*({right:1,center:.5}[s]||0),r:i*({left:1,center:.5}[s]||0),b:a*({top:1,middle:.5}[l]||0),t:a*({bottom:1,middle:.5}[l]||0)})}function g(t,e,r,n){n=n||{};var i=t.select("."+T.itemRectClassName),a=t.select("."+T.itemTextClassName),o=a.selectAll("tspan"),s=e.borderwidth,l=r.index;_.setTranslate(t,s+r.x,s+r.y);var u=["up","down"].indexOf(e.direction)!==-1;i.attr({x:0,y:0,width:n.width||(u?e.width1:e.widths[l]),height:n.height||(u?e.heights[l]:e.height1)});var c=e.font.size*T.fontSizeToHeight,h=o[0].length||1,f=(h-1)*c/4,d={x:T.textOffsetX,y:e.heights[l]/2-f+T.textOffsetY};a.attr(d),o.attr(d),u?r.y+=e.heights[l]+r.yPad:r.x+=e.widths[l]+r.xPad,r.index++}function v(t){t.selectAll("g."+T.dropdownButtonClassName).remove()}function y(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var i=r[n];i.indexOf(T.autoMarginIdRoot)!==-1&&b.autoMargin(t,i)}}var x=t("d3"),b=t("../../plots/plots"),_=t("../../lib"),w=t("../color"),M=t("../drawing"),A=t("../../lib/svg_text_utils"),k=t("../legend/anchor_utils"),T=t("./constants");e.exports=function(t){var e=t._fullLayout,r=n(e),u=e._infolayer.selectAll("g."+T.containerClassName).data(r.length>0?[0]:[]);if(u.enter().append("g").classed(T.containerClassName,!0).style("cursor","pointer"),u.exit().remove(),u.exit().size()&&y(t),0!==r.length){var c=u.selectAll("g."+T.headerGroupClassName).data(r,i);c.enter().append("g").classed(T.headerGroupClassName,!0);var h=u.selectAll("g."+T.dropdownButtonGroupClassName).data([0]);h.enter().append("g").classed(T.dropdownButtonGroupClassName,!0).style("pointer-events","all"),c.enter().size()&&h.call(v).attr(T.menuIndexAttrName,"-1"),c.exit().each(function(e){x.select(this).remove(),h.call(v).attr(T.menuIndexAttrName,"-1"),b.autoMargin(t,T.autoMarginIdRoot+e._index)});for(var f=0;f<r.length;f++){var d=r[f];m(t,d)}c.each(function(e){var r=x.select(this),n="dropdown"===e.type?h:null;b.manageCommandObserver(t,e,e.buttons,function(i){l(t,e,e.buttons[i.index],r,n,i.index,!0)}),"dropdown"===e.type?(o(t,r,h,e),a(h,e)&&s(t,r,h,e)):s(t,r,null,e)})}}},{"../../lib":658,"../../lib/svg_text_utils":674,"../../plots/plots":751,"../color":558,"../drawing":581,"../legend/anchor_utils":594,"./constants":634,d3:97}],637:[function(t,e,r){arguments[4][631][0].apply(r,arguments)},{"./attributes":633,"./constants":634,"./defaults":635,"./draw":636,dup:631}],638:[function(t,e,r){"use strict";e.exports={solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}},{}],639:[function(t,e,r){"use strict";e.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},{}],640:[function(t,e,r){"use strict";e.exports={circle:"●","circle-open":"○",square:"■","square-open":"□",diamond:"◆","diamond-open":"◇",cross:"+",x:"❌"}},{}],641:[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}},{}],642:[function(t,e,r){"use strict";e.exports={entityToUnicode:{mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},unicodeToEntity:{"&":"amp","<":"lt",">":"gt",'"':"quot","'":"#x27","/":"#x2F"}}},{}],643:[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}},{}],644:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.22.0",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),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.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.setPlotConfig=t("./plot_api/set_plot_config"),r.register=t("./plot_api/register"),r.toImage=t("./plot_api/to_image"),r.downloadImage=t("./snapshot/download"),r.validate=t("./plot_api/validate"),r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.register(t("./traces/scatter")),r.register([t("./components/legend"),t("./components/annotations"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=n.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":554,"./components/images":593,"./components/legend":601,"./components/rangeselector":613,"./components/rangeslider":618,"./components/shapes":625,"./components/sliders":631,"./components/updatemenus":637,"./fonts/mathjax_config":645,"./lib/queue":668,"./plot_api/plot_schema":680,"./plot_api/register":681,"./plot_api/set_plot_config":682,"./plot_api/to_image":684,"./plot_api/validate":685,"./plotly":686,"./snapshot":771,"./snapshot/download":768,"./traces/scatter":894,d3:97,"es6-promise":103}],645:[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},{}],646:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){Array.isArray(t)&&(e[r]=t[n])}},{}],647:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../constants/numerical").BADNUM,a=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(a,"")),n(t)?Number(t):i}},{"../constants/numerical":641,"fast-isnumeric":106}],648:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../components/colorscale/get_scale"),o=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),s=/^([2-9]|[1-9][0-9]+)$/;r.valObjects={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),n.values.indexOf(t)===-1?e.set(r):e.set(t)}},boolean:{coerceFunction:function(t,e,r){t===!0||t===!1?e.set(t):e.set(r)}},number:{coerceFunction:function(t,e,r,i){!n(t)||void 0!==i.min&&t<i.min||void 0!==i.max&&t>i.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&t<i.min||void 0!==i.max&&t>i.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;n.strict!==!0&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(a(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r){var n=r.length;return"string"==typeof t&&t.substr(0,n)===r&&s.test(t.substr(n))?void e.set(t):void e.set(r)},validateFunction:function(t,e){var r=e.dflt,n=r.length;return t===r||"string"==typeof t&&!(t.substr(0,n)!==r||!s.test(t.substr(n)))}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if((n.extras||[]).indexOf(t)!==-1)return void e.set(t);for(var i=t.split("+"),a=0;a<i.length;){var o=i[a];n.flags.indexOf(o)===-1||i.indexOf(o)<a?i.splice(a,1):a++}i.length?e.set(i.join("+")):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,i){if(!Array.isArray(t))return void e.set(n);var a=i.items,o=[];n=Array.isArray(n)?n:[];for(var s=0;s<a.length;s++)r.coerce(t,o,a,"["+s+"]",n[s]);e.set(o)},validateFunction:function(t,e){if(!Array.isArray(t))return!1;var n=e.items;if(!e.freeLength&&t.length!==n.length)return!1;for(var i=0;i<t.length;i++){var a=r.validate(t[i],e.items[i]);if(!a)return!1}return!0}}},r.coerce=function(t,e,n,i,a){var s=o(n,i).get(),l=o(t,i),u=o(e,i),c=l.get();return void 0===a&&(a=s.dflt),s.arrayOk&&Array.isArray(c)?(u.set(c),c):(r.valObjects[s.valType].coerceFunction(c,u,a,s),u.get())},r.coerce2=function(t,e,n,i,a){var s=o(t,i),l=r.coerce(t,e,n,i,a),u=s.get();return void 0!==u&&null!==u&&l},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.validate=function(t,e){var n=r.valObjects[e.valType];if(e.arrayOk&&Array.isArray(t))return!0;if(n.validateFunction)return n.validateFunction(t,e);var i={},a=i,o={set:function(t){a=t}};return n.coerceFunction(t,o,i,e),a!==i}},{"../components/colorscale/get_scale":570,"../components/colorscale/scales":576,"./nested_property":664,"fast-isnumeric":106,tinycolor2:495}],649:[function(t,e,r){"use strict";function n(t){return t&&M.componentsRegistry.calendars&&"string"==typeof t&&"gregorian"!==t}function i(t,e){return String(t+Math.pow(10,e)).substr(1)}function a(t,e,r,n,a){if((e||r||n||a)&&(t+=" "+i(e,2)+":"+i(r,2),(n||a)&&(t+=":"+i(n,2),a))){for(var o=4;a%10===0;)o-=1,a/=10;t+="."+i(a,o)}return t}function o(t,e,r){t=t.replace(D,function(t){var r=Math.min(+t.charAt(1)||6,6),n=(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0";return n});var i=new Date(Math.floor(e+.05));if(n(r))try{t=M.getComponentMethod("calendars","worldCalFmt")(t,e,r)}catch(t){return"Invalid"}return A(t)(i)}function s(t,e){var r=m(t+.05,y),n=i(Math.floor(r/x),2)+":"+i(m(Math.floor(r/b),60),2);if("M"!==e){d(e)||(e=0);var a=Math.min(m(t/_,60),P[e]),o=(100+a).toFixed(e).substr(1);e>0&&(o=o.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+o}return n}function l(t){return t.formatDate("yyyy")}function u(t){return t.formatDate("M yyyy")}function c(t){return t.formatDate("M d")}function h(t){return t.formatDate("M d, yyyy")}var f=t("d3"),d=t("fast-isnumeric"),p=t("./loggers").error,m=t("./mod"),g=t("../constants/numerical"),v=g.BADNUM,y=g.ONEDAY,x=g.ONEHOUR,b=g.ONEMIN,_=g.ONESEC,w=g.EPOCHJD,M=t("../registry"),A=f.time.format.utc,k=/^\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,T=/^\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,E=(new Date).getFullYear()-70;r.dateTick0=function(t,e){return n(t)?e?M.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:M.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return n(t)?M.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var S,L;r.dateTime2ms=function(t,e){if(r.isJSDate(t))return t=Number(t)-t.getTimezoneOffset()*b,t>=S&&t<=L?t:v;if("string"!=typeof t&&"number"!=typeof t)return v;t=String(t);var i=n(e),a=t.charAt(0);!i||"G"!==a&&"g"!==a||(t=t.substr(1),e="");var o=i&&"chinese"===e.substr(0,7),s=t.match(o?T:k);if(!s)return v;var l=s[1],u=s[3]||"1",c=Number(s[5]||1),h=Number(s[7]||0),f=Number(s[9]||0),d=Number(s[11]||0);if(i){if(2===l.length)return v;l=Number(l);var p;try{var m=M.getComponentMethod("calendars","getCal")(e);if(o){var g="i"===u.charAt(u.length-1);u=parseInt(u,10),p=m.newDate(l,m.toMonthIndex(l,u,g),c)}else p=m.newDate(l,Number(u),c)}catch(t){return v}return p?(p.toJD()-w)*y+h*x+f*b+d*_:v}l=2===l.length?(Number(l)+2e3-E)%100+E:Number(l),u-=1;var A=new Date(Date.UTC(2e3,u,c,h,f));return A.setUTCFullYear(l),A.getUTCMonth()!==u?v:A.getUTCDate()!==c?v:A.getTime()+d*_},S=r.MIN_MS=r.dateTime2ms("-9999"),L=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==v};var C=90*y,I=3*x,z=5*b;r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=S&&t<=L))return v;e||(e=0);var i,o,s,l,u,c,h=Math.floor(10*m(t+.05,1)),f=Math.round(t-h/10);if(n(r)){var d=Math.floor(f/y)+w,p=Math.floor(m(t,y));try{i=M.getComponentMethod("calendars","getCal")(r).fromJD(d).formatDate("yyyy-mm-dd")}catch(t){i=A("G%Y-%m-%d")(new Date(f))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e<C?Math.floor(p/x):0,s=e<C?Math.floor(p%x/b):0,l=e<I?Math.floor(p%b/_):0,u=e<z?p%_*10+h:0}else c=new Date(f),i=A("%Y-%m-%d")(c),o=e<C?c.getUTCHours():0,s=e<C?c.getUTCMinutes():0,l=e<I?c.getUTCSeconds():0,u=e<z?10*c.getUTCMilliseconds()+h:0;return a(i,o,s,l,u)},r.ms2DateTimeLocal=function(t){if(!(t>=S+y&&t<=L-y))return v;var e=Math.floor(10*m(t+.05,1)),r=new Date(Math.round(t-e/10)),n=f.time.format("%Y-%m-%d")(r),i=r.getHours(),o=r.getMinutes(),s=r.getSeconds(),l=10*r.getUTCMilliseconds()+e;return a(n,i,o,s,l)},r.cleanDate=function(t,e,i){if(r.isJSDate(t)||"number"==typeof t){if(n(i))return p("JS Dates and milliseconds are incompatible with world calendars",t),e;if(t=r.ms2DateTimeLocal(+t),!t&&void 0!==e)return e}else if(!r.isDateTime(t,i))return p("unrecognized date",t),e;return t};var D=/%\d?f/g,P=[59,59.9,59.99,59.999,59.9999],O=A("%Y"),R=A("%b %Y"),F=A("%b %-d"),j=A("%b %-d, %Y");r.formatDate=function(t,e,r,i){var a,f;if(i=n(i)&&i,e)return o(e,t,i);if(i)try{var d=Math.floor((t+.05)/y)+w,p=M.getComponentMethod("calendars","getCal")(i).fromJD(d);"y"===r?f=l(p):"m"===r?f=u(p):"d"===r?(a=l(p),f=c(p)):(a=h(p),f=s(t,r))}catch(t){return"Invalid"}else{var m=new Date(Math.floor(t+.05));"y"===r?f=O(m):"m"===r?f=R(m):"d"===r?(a=O(m),f=F(m)):(a=j(m),f=s(t,r))}return f+(a?"\n"+a:"")};var N=3*y;r.incrementMonth=function(t,e,r){r=n(r)&&r;var i=m(t,y);if(t=Math.round(t-i),r)try{var a=Math.round(t/y)+w,o=M.getComponentMethod("calendars","getCal")(r),s=o.fromJD(a);return e%12?o.add(s,e,"m"):o.add(s,e/12,"y"),(s.toJD()-w)*y+i}catch(e){p("invalid ms "+t+" in calendar "+r)}var l=new Date(t+N);return l.setUTCMonth(l.getUTCMonth()+e)+i-N},r.findExactDates=function(t,e){for(var r,i,a=0,o=0,s=0,l=0,u=n(e)&&M.getComponentMethod("calendars","getCal")(e),c=0;c<t.length;c++)if(i=t[c],d(i)){if(!(i%y))if(u)try{r=u.fromJD(i/y+w),1===r.day()?1===r.month()?a++:o++:s++}catch(t){}else r=new Date(i),1===r.getUTCDate()?0===r.getUTCMonth()?a++:o++:s++}else l++;o+=a,s+=o;var h=t.length-l;return{exactYears:a/h,exactMonths:o/h,exactDays:s/h}}},{"../constants/numerical":641,"../registry":766,"./loggers":661,"./mod":663,d3:97,"fast-isnumeric":106}],650:[function(t,e,r){"use strict";var n=t("events").EventEmitter,i={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,i){"undefined"!=typeof jQuery&&jQuery(t).trigger(n,i),e.emit(n,i),r.emit(n,i)},t},triggerHandler:function(t,e,r){var n,i;"undefined"!=typeof jQuery&&(n=jQuery(t).triggerHandler(e,r));var a=t._ev;if(!a)return n;var o=a._events[e];if(!o)return n;"function"==typeof o&&(o=[o]);for(var s=o.pop(),l=0;l<o.length;l++)o[l](r);return i=s(r),void 0!==n?n:i},purge:function(t){return delete t._ev,delete t.on,delete t.once,delete t.removeListener,delete t.removeAllListeners,delete t.emit,delete t._ev,delete t._internalEv,delete t._internalOn,delete t._internalOnce,delete t._removeInternalListener,delete t._removeAllInternalListeners,t}};e.exports=i},{events:104}],651:[function(t,e,r){"use strict";function n(t,e){var r,n;for(r=0;r<t.length;r++){if(n=t[r],null!==n&&"object"==typeof n)return!1;void 0!==n&&(e[r]=n)}return!0}function i(t,e,r,s){var l,u,c,h,f,d,p,m=t[0],g=t.length;if(2===g&&o(m)&&o(t[1])&&0===m.length){if(p=n(t[1],m))return m;m.splice(0,m.length)}for(var v=1;v<g;v++){l=t[v];for(u in l)c=m[u],h=l[u],s&&o(h)?m[u]=h:e&&h&&(a(h)||(f=o(h)))?(f?(f=!1,d=c&&o(c)?c:[]):d=c&&a(c)?c:{},m[u]=i([d,h],e,r,s)):("undefined"!=typeof h||r)&&(m[u]=h)}return m}var a=t("./is_plain_object.js"),o=Array.isArray;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":660}],652:[function(t,e,r){"use strict";e.exports=function(t){for(var e={},r=[],n=0,i=0;i<t.length;i++){var a=t[i];1!==e[a]&&(e[a]=1,r[n++]=a)}return r}},{}],653:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];n.visible===!0&&e.push(n)}return e}},{}],654:[function(t,e,r){"use strict";function n(t,e){var r=l[t];return r(e)}function i(t){for(var e=0;e<s.length;e++){var r=s[e],n=new RegExp(a[r]);if(n.test(t.toLowerCase()))return r}return o.warn("Unrecognized country name: "+t+"."),!1}var a=t("country-regex"),o=t("../lib"),s=Object.keys(a),l={"ISO-3":o.identity,"USA-states":o.identity,"country names":i};r.locationToFeature=function(t,e,r){var i=n(t,e);if(i){for(var a=0;a<r.length;a++){var s=r[a];if(s.id===i)return s}o.warn(["Location with id",i,"does not have a matching topojson feature at this resolution."].join(" "))}return!1}},{"../lib":658,"country-regex":90}],655:[function(t,e,r){"use strict";r.calcTraceToLineCoords=function(t){for(var e=t[0].trace,r=e.connectgaps,n=[],i=[],a=0;a<t.length;a++){var o=t[a];i.push(o.lonlat),!r&&o.gapAfter&&i.length>0&&(n.push(i),i=[])}return n.push(i),n},r.makeLine=function(t,e){var r={};return r=1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t},e&&(r.trace=e),r},r.makePolygon=function(t,e){var r={};if(1===t.length)r={type:"Polygon",coordinates:t};else{for(var n=new Array(t.length),i=0;i<t.length;i++)n[i]=[t[i]];r={type:"MultiPolygon",coordinates:n}}return e&&(r.trace=e),r},r.makeBlank=function(){return{type:"Point",coordinates:[]}}},{}],656:[function(t,e,r){"use strict";function n(t,e){var r=h(t);return r[3]*=e,r}function i(t){return s(t).isValid()?t:c}function a(t){return l(t)?t:f}function o(t,e,r){var o,s,l,h,d,p=t.color,m=Array.isArray(p),g=Array.isArray(e),v=[];if(o=void 0!==t.colorscale?u.makeColorScaleFunc(u.extractScale(t.colorscale,t.cmin,t.cmax)):i,s=m?function(t,e){return void 0===t[e]?c:o(t[e])}:i,l=g?function(t,e){return void 0===t[e]?f:a(t[e])}:a,m||g)for(var y=0;y<r;y++)h=s(p,y),d=l(e,y),v[y]=n(h,d);else v=n(p,e);return v}var s=t("tinycolor2"),l=t("fast-isnumeric"),u=t("../components/colorscale"),c=t("../components/color/attributes").defaultLine,h=t("./str2rgbarray"),f=1;e.exports=o},{"../components/color/attributes":557,"../components/colorscale":572,"./str2rgbarray":673,"fast-isnumeric":106,tinycolor2:495}],657:[function(t,e,r){"use strict";function n(t){for(var e=0;(e=t.indexOf("<sup>",e))>=0;){var r=t.indexOf("</sup>",e);if(r<e)break;t=t.slice(0,e)+l(t.slice(e+5,r))+t.slice(r+6)}return t}function i(t){return t.replace(/\<br\>/g,"\n")}function a(t){return t.replace(/\<.*\>/g,"")}function o(t){for(var e=u.entityToUnicode,r=0;(r=t.indexOf("&",r))>=0;){var n=t.indexOf(";",r);if(n<r)r+=1;else{var i=e[t.slice(r+1,n)];t=i?t.slice(0,r)+i+t.slice(n+1):t.slice(0,r)+t.slice(n+1)}}return t}function s(t){return""+o(a(n(i(t))))}var l=t("superscript-text"),u=t("../constants/string_mappings");e.exports=s},{"../constants/string_mappings":642,"superscript-text":492}],658:[function(t,e,r){"use strict";var n=t("d3"),i=e.exports={};i.nestedProperty=t("./nested_property"),i.isPlainObject=t("./is_plain_object"),i.isArray=t("./is_array"),i.mod=t("./mod");var a=t("./coerce");i.valObjects=a.valObjects,i.coerce=a.coerce,i.coerce2=a.coerce2,i.coerceFont=a.coerceFont,i.validate=a.validate;var o=t("./dates");i.dateTime2ms=o.dateTime2ms,i.isDateTime=o.isDateTime,i.ms2DateTime=o.ms2DateTime,i.ms2DateTimeLocal=o.ms2DateTimeLocal,i.cleanDate=o.cleanDate,i.isJSDate=o.isJSDate,i.formatDate=o.formatDate,i.incrementMonth=o.incrementMonth,i.dateTick0=o.dateTick0,i.dfltRange=o.dfltRange,i.findExactDates=o.findExactDates,i.MIN_MS=o.MIN_MS,i.MAX_MS=o.MAX_MS;var s=t("./search");i.findBin=s.findBin,i.sorterAsc=s.sorterAsc,i.sorterDes=s.sorterDes,i.distinctVals=s.distinctVals,i.roundUp=s.roundUp;var l=t("./stats");i.aggNums=l.aggNums,i.len=l.len,i.mean=l.mean,i.variance=l.variance,i.stdev=l.stdev,i.interp=l.interp;var u=t("./matrix");i.init2dArray=u.init2dArray,i.transposeRagged=u.transposeRagged,i.dot=u.dot,i.translationMatrix=u.translationMatrix,i.rotationMatrix=u.rotationMatrix,i.rotationXYMatrix=u.rotationXYMatrix,i.apply2DTransform=u.apply2DTransform,i.apply2DTransform2=u.apply2DTransform2;var c=t("./extend");i.extendFlat=c.extendFlat,i.extendDeep=c.extendDeep,i.extendDeepAll=c.extendDeepAll,i.extendDeepNoArrays=c.extendDeepNoArrays;var h=t("./loggers");i.log=h.log,i.warn=h.warn,i.error=h.error,i.notifier=t("./notifier"),i.filterUnique=t("./filter_unique"),i.filterVisible=t("./filter_visible"),i.cleanNumber=t("./clean_number"),i.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var a=0;a<e.length;a++){var o=e[a],s=i.nestedProperty(t,o.replace("?",r)),l=i.nestedProperty(t,o.replace("?",n)),u=s.get();s.set(l.get()),l.set(u)}},i.pauseEvent=function(t){return t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.cancelBubble=!0,!1},i.constrain=function(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},i.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},i.identity=function(t){return t},i.noop=function(){},i.simpleMap=function(t,e,r,n){for(var i=t.length,a=new Array(i),o=0;o<i;o++)a[o]=e(t[o],r,n);return a},i.randstr=function t(e,r,n){if(n||(n=16),void 0===r&&(r=24),r<=0)return"0";var i,a,o,s=Math.log(Math.pow(2,r))/Math.log(n),l="";for(i=2;s===1/0;i*=2)s=Math.log(Math.pow(2,r/i))/Math.log(n)*i;var u=s-Math.floor(s);for(i=0;i<Math.floor(s);i++)o=Math.floor(Math.random()*n).toString(n),l=o+l;u&&(a=Math.pow(n,u),o=Math.floor(Math.random()*a).toString(n),l=o+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},i.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)},r["_"+e]=t,r},i.smooth=function(t,e){if(e=Math.round(e)||0,e<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r<l;r++)u[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;r<o;r++){for(a=0,n=0;n<l;n++)i=r+n+1-e,i<-o?i-=s*Math.round(i/s):i>=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[n];c[r]=a}return c},i.syncOrAsync=function(t,e,r){function n(){return i.syncOrAsync(t,e,r)}for(var a,o;t.length;)if(o=t.splice(0,1)[0],a=o(e),a&&a.then)return a.then(n).then(void 0,i.promiseError);return r&&r(e)},i.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},i.noneOrAll=function(t,e,r){if(t){var n,i,a=!1,o=!0;for(n=0;n<r.length;n++)i=t[r[n]],void 0!==i&&null!==i?a=!0:o=!1;if(a&&!o)for(n=0;n<r.length;n++)t[r[n]]=e[r[n]]}},i.pushUnique=function(t,e){return e&&t.indexOf(e)===-1&&t.push(e),t},i.mergeArray=function(t,e,r){if(Array.isArray(t))for(var n=Math.min(t.length,e.length),i=0;i<n;i++)e[i][r]=t[i]},i.minExtend=function(t,e){var r={};"object"!=typeof e&&(e={});var n,a,o,s=3,l=Object.keys(t);for(n=0;n<l.length;n++)a=l[n],o=t[a],"_"!==a.charAt(0)&&"function"!=typeof o&&("module"===a?r[a]=o:Array.isArray(o)?r[a]=o.slice(0,s):o&&"object"==typeof o?r[a]=i.minExtend(t[a],e[a]):r[a]=o);for(l=Object.keys(e),n=0;n<l.length;n++)a=l[n],o=e[a],"object"==typeof o&&a in r&&"object"==typeof r[a]||(r[a]=o);return r},i.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)},i.containsAny=function(t,e){for(var r=0;r<e.length;r++)if(t.indexOf(e[r])!==-1)return!0;return!1},i.getPlotDiv=function(t){for(;t&&t.removeAttribute;t=t.parentNode)if(i.isPlotDiv(t))return t},i.isPlotDiv=function(t){var e=n.select(t);return e.node()instanceof HTMLElement&&e.size()&&e.classed("js-plotly-plot")},i.removeElement=function(t){var e=t&&t.parentNode;e&&e.removeChild(t)},i.addStyleRule=function(t,e){if(!i.styleSheet){var r=document.createElement("style");r.appendChild(document.createTextNode("")),document.head.appendChild(r),i.styleSheet=r.sheet}var n=i.styleSheet;n.insertRule?n.insertRule(t+"{"+e+"}",0):n.addRule?n.addRule(t,e,0):i.warn("addStyleRule failed")},i.getTranslate=function(t){var e=/.*\btranslate\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,r=t.attr?"attr":"getAttribute",n=t[r]("transform")||"",i=n.replace(e,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+i[0]||0,y:+i[1]||0}},i.setTranslate=function(t,e,r){var n=/(\btranslate\(.*?\);?)/,i=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",o=t[i]("transform")||"";return e=e||0,r=r||0,o=o.replace(n,"").trim(),o+=" translate("+e+", "+r+")",o=o.trim(),t[a]("transform",o),o},i.getScale=function(t){var e=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,r=t.attr?"attr":"getAttribute",n=t[r]("transform")||"",i=n.replace(e,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+i[0]||1,y:+i[1]||1}},i.setScale=function(t,e,r){var n=/(\bscale\(.*?\);?)/,i=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",o=t[i]("transform")||"";return e=e||1,r=r||1,o=o.replace(n,"").trim(),o+=" scale("+e+", "+r+")",o=o.trim(),t[a]("transform",o),o},i.setPointGroupScale=function(t,e,r){var n,i,a;return e=e||1,r=r||1,i=1===e&&1===r?"":" scale("+e+","+r+")",a=/\s*sc.*/,t.each(function(){n=(this.getAttribute("transform")||"").replace(a,""),n+=i,n=n.trim(),this.setAttribute("transform",n)}),i},i.isIE=function(){return"undefined"!=typeof window.navigator.msSaveBlob},i.objectFromPath=function(t,e){for(var r,n=t.split("."),i=r={},a=0;a<n.length;a++){var o=n[a],s=null,l=n[a].match(/(.*)\[([0-9]+)\]/);l?(o=l[1],s=l[2],r=r[o]=[],a===n.length-1?r[s]=e:r[s]={},r=r[s]):(a===n.length-1?r[o]=e:r[o]={},r=r[o])}return i};var f=/^([^\[\.]+)\.(.+)?/,d=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;i.expandObjectPaths=function(t){var e,r,n,a,o,s,l;if("object"==typeof t&&!Array.isArray(t))for(r in t)t.hasOwnProperty(r)&&((e=r.match(f))?(a=t[r],n=e[1],delete t[r],t[n]=i.extendDeepNoArrays(t[n]||{},i.objectFromPath(r,i.expandObjectPaths(a))[n])):(e=r.match(d))?(a=t[r],n=e[1],o=parseInt(e[2]),delete t[r],t[n]=t[n]||[],"."===e[3]?(l=e[4],s=t[n][o]=t[n][o]||{},i.extendDeepNoArrays(s,i.objectFromPath(l,i.expandObjectPaths(a)))):t[n][o]=i.expandObjectPaths(a)):t[r]=i.expandObjectPaths(t[r]));return t},i.numSeparate=function(t,e,r){if(r||(r=!1),"string"!=typeof e||0===e.length)throw new Error("Separator string required for formatting!");"number"==typeof t&&(t=String(t));var n=/(\d+)(\d{3})/,i=e.charAt(0),a=e.charAt(1),o=t.split("."),s=o[0],l=o.length>1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l}},{"./clean_number":647,"./coerce":648,"./dates":649,"./extend":651,"./filter_unique":652,"./filter_visible":653,"./is_array":659,"./is_plain_object":660,"./loggers":661,"./matrix":662,"./mod":663,"./nested_property":664,"./notifier":665,"./search":669,"./stats":672,d3:97}],659:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||n.isView(t)}},{}],660:[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}},{}],661:[function(t,e,r){"use strict";var n=t("../plot_api/plot_config"),i=e.exports={};i.log=function(){if(n.logging>1){for(var t=["LOG:"],e=0;e<arguments.length;e++)t.push(arguments[e]);console.trace?console.trace.apply(console,t):console.log.apply(console,t)}},i.warn=function(){if(n.logging>0){for(var t=["WARN:"],e=0;e<arguments.length;e++)t.push(arguments[e]);console.trace?console.trace.apply(console,t):console.log.apply(console,t)}},i.error=function(){if(n.logging>0){for(var t=["ERROR:"],e=0;e<arguments.length;e++)t.push(arguments[e]);console.error.apply(console,arguments)}}},{"../plot_api/plot_config":679}],662:[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,i=t.length;for(e=0;e<i;e++)n=Math.max(n,t[e].length);var a=new Array(n);for(e=0;e<n;e++)for(a[e]=new Array(i),r=0;r<i;r++)a[e][r]=t[r][e];return a},r.dot=function(t,e){if(!t.length||!e.length||t.length!==e.length)return null;var n,i,a=t.length;if(t[0].length)for(n=new Array(a),i=0;i<a;i++)n[i]=r.dot(t[i],e);else if(e[0].length){var o=r.transposeRagged(e);for(n=new Array(o.length),i=0;i<o.length;i++)n[i]=r.dot(t,o[i])}else for(n=0,i=0;i<a;i++)n+=t[i]*e[i];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)))}}},{}],663:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t%e;return r<0?r+e:r}},{}],664:[function(t,e,r){"use strict";function n(t,e){return function(){var r,i,a,o,s,l=t;for(o=0;o<e.length-1;o++){if(r=e[o],r===-1){for(i=!0,a=[],s=0;s<l.length;s++)a[s]=n(l[s],e.slice(o+1))(),a[s]!==a[0]&&(i=!1);return i?a[0]:a}if("number"==typeof r&&!f(l))return;if(l=l[r],"object"!=typeof l||null===l)return}if("object"==typeof l&&null!==l&&(a=l[e[o]],null!==a))return a}}function i(t,e){var r=["annotations","shapes","range","domain","buttons"],n=r.indexOf(e)===-1;return f(t)&&n}function a(t,e){return function(r){var n,a,c=t,h=[t],d=u(r)&&!i(r,e[e.length-1]);for(a=0;a<e.length-1;a++){if(n=e[a],"number"==typeof n&&!f(c))throw"array index but container is not an array";if(n===-1){if(d=!o(c,e.slice(a+1),r))break;return}if(!s(c,n,e[a+1],d))break;if(c=c[n],"object"!=typeof c||null===c)throw"container is not an object";h.push(c)}d?(a===e.length-1&&delete c[e[a]],l(h)):c[e[a]]=r}}function o(t,e,r){var n,i=f(r),o=!0,l=r,c=!i&&u(r),h=e[0];for(n=0;n<t.length;n++)i&&(l=r[n%r.length],c=u(l)),c&&(o=!1),s(t,n,h,c)&&a(t[n],e)(l);return o}function s(t,e,r,n){if(void 0===t[e]){if(n)return!1;"number"==typeof r?t[e]=[]:t[e]={}}return!0}function l(t){var e,r,n,a,o;for(e=t.length-1;e>=0;e--){if(n=t[e],o=!1,f(n))for(r=n.length-1;r>=0;r--)u(n[r])?o?n[r]=void 0:n.pop():o=!0;else if("object"==typeof n&&null!==n)for(a=Object.keys(n),o=!1,r=a.length-1;r>=0;r--)u(n[a[r]])&&!i(n[a[r]],a[r])?delete n[a[r]]:o=!0;if(o)return}}function u(t){return void 0===t||null===t||"object"==typeof t&&(f(t)?!t.length:!Object.keys(t).length)}function c(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var h=t("fast-isnumeric"),f=t("./is_array");e.exports=function(t,e){if(h(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,l=e.split(".");s<l.length;){if(r=String(l[s]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(r[1])l[s]=r[1];else{if(0!==s)throw"bad property string";l.splice(0,1)}for(i=r[2].substr(1,r[2].length-2).split("]["),o=0;o<i.length;o++)s++,l.splice(s,0,Number(i[o]))}s++}return"object"!=typeof t?c(t,e,l):{set:a(t,l),get:n(t,l),astr:e,parts:l,obj:t}}},{"./is_array":659,"fast-isnumeric":106}],665:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=[];e.exports=function(t,e){function r(t){t.duration(700).style("opacity",0).each("end",function(t){var e=a.indexOf(t);e!==-1&&a.splice(e,1),n.select(this).remove()})}if(a.indexOf(t)===-1){a.push(t);var o=1e3;i(e)?o=e:"long"===e&&(o=3e3);var s=n.select("body").selectAll(".plotly-notifier").data([0]);s.enter().append("div").classed("plotly-notifier",!0);var l=s.selectAll(".notifier-note").data(a);l.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("&times;").on("click",function(){e.transition().call(r)});for(var i=e.append("p"),a=t.split(/<br\s*\/?>/g),s=0;s<a.length;s++)s&&i.append("br"),i.append("span").text(a[s]);e.transition().duration(700).style("opacity",1).transition().delay(o).call(r)})}}},{d3:97,"fast-isnumeric":106}],666:[function(t,e,r){"use strict";var n=t("./setcursor"),i="data-savedcursor",a="!!";e.exports=function(t,e){var r=t.attr(i);if(e){if(!r){for(var o=(t.attr("class")||"").split(" "),s=0;s<o.length;s++){var l=o[s];0===l.indexOf("cursor-")&&t.attr(i,l.substr(7)).classed(l,!1)}t.attr(i)||t.attr(i,a)}n(t,e)}else r&&(t.attr(i,null),r===a?n(t):n(t,r))}},{"./setcursor":670}],667:[function(t,e,r){"use strict";var n=t("./matrix").dot,i=e.exports={};i.tester=function(t){function e(t,e){var r=t[0],n=t[1];return!(r<i||r>a||n<o||n>s)&&(!e||!u(t))}function r(t,e){var r=t[0],l=t[1];if(r<i||r>a||l<o||l>s)return!1;var u,c,h,f,d,p=n.length,m=n[0][0],g=n[0][1],v=0;for(u=1;u<p;u++)if(c=m,h=g,m=n[u][0],g=n[u][1],f=Math.min(c,m),!(r<f||r>Math.max(c,m)||l>Math.max(h,g)))if(l<Math.min(h,g))r!==f&&v++;else{if(d=m===c?l:h+(r-c)*(g-h)/(m-c),l===d)return 1!==u||!e;l<=d&&r!==f&&v++}return v%2===1}var n=t.slice(),i=n[0][0],a=i,o=n[0][1],s=o;n.push(n[0]);for(var l=1;l<n.length;l++)i=Math.min(i,n[l][0]),a=Math.max(a,n[l][0]),o=Math.min(o,n[l][1]),s=Math.max(s,n[l][1]);var u,c=!1;return 5===n.length&&(n[0][0]===n[1][0]?n[2][0]===n[3][0]&&n[0][1]===n[3][1]&&n[1][1]===n[2][1]&&(c=!0,u=function(t){return t[0]===n[0][0]}):n[0][1]===n[1][1]&&n[2][1]===n[3][1]&&n[0][0]===n[3][0]&&n[1][0]===n[2][0]&&(c=!0,u=function(t){return t[1]===n[0][1]})),{xmin:i,xmax:a,ymin:o,ymax:s,pts:n,contains:c?e:r,isRect:c}};var a=i.isSegmentBent=function(t,e,r,i){var a,o,s,l=t[e],u=[t[r][0]-l[0],t[r][1]-l[1]],c=n(u,u),h=Math.sqrt(c),f=[-u[1]/h,u[0]/h];for(a=e+1;a<r;a++)if(o=[t[a][0]-l[0],t[a][1]-l[1]],s=n(o,u),s<0||s>c||Math.abs(n(o,f))>i)return!0;return!1};i.filter=function(t,e){function r(r){t.push(r);var s=n.length,l=i;n.splice(o+1);for(var u=l+1;u<t.length;u++)(u===t.length-1||a(t,l,u+1,e))&&(n.push(t[u]),n.length<s-2&&(i=u,o=n.length-1),l=u)}var n=[t[0]],i=0,o=0;if(t.length>1){var s=t.pop();r(s)}return{addPt:r,raw:t,filtered:n}}},{"./matrix":662}],668:[function(t,e,r){"use strict";function n(t,e){for(var r,n=[],a=0;a<e.length;a++)r=e[a],r===t?n[a]=r:"object"==typeof r?n[a]=Array.isArray(r)?i.extendDeep([],r):i.extendDeepAll({},r):n[a]=r;return n}var i=t("../lib"),a=t("../plot_api/plot_config"),o={};o.add=function(t,e,r,n,i){var o,s;return t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},s=t.undoQueue.index,t.autoplay?void(t.undoQueue.inSequence||(t.autoplay=!1)):(!t.undoQueue.sequence||t.undoQueue.beginSequence?(o={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},t.undoQueue.queue.splice(s,t.undoQueue.queue.length-s,o),t.undoQueue.index+=1):o=t.undoQueue.queue[s-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)),void(t.undoQueue.queue.length>a.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)))},o.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},o.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},o.undo=function(t){var e,r;if(t.framework&&t.framework.isPolar)return void t.framework.undo();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++)o.plotDo(t,e.undo.calls[r],e.undo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1}},o.redo=function(t){var e,r;if(t.framework&&t.framework.isPolar)return void t.framework.redo();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++)o.plotDo(t,e.redo.calls[r],e.redo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1,t.undoQueue.index++}},o.plotDo=function(t,e,r){t.autoplay=!0,r=n(t,r),e.apply(null,r)},e.exports=o},{"../lib":658,"../plot_api/plot_config":679}],669:[function(t,e,r){"use strict";function n(t,e){return t<e}function i(t,e){return t<=e}function a(t,e){return t>e}function o(t,e){return t>=e}var s=t("fast-isnumeric"),l=t("./loggers");r.findBin=function(t,e,r){if(s(e.start))return r?Math.ceil((t-e.start)/e.size)-1:Math.floor((t-e.start)/e.size);var u,c,h=0,f=e.length,d=0;for(c=e[e.length-1]>=e[0]?r?n:i:r?o:a;h<f&&d++<100;)u=Math.floor((h+f)/2),c(e[u],t)?h=u+1:f=u;return d>90&&l.log("Long binary search..."),h-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,i=e[n]-e[0]||1,a=i/(n||1)/1e4,o=[e[0]],s=0;s<n;s++)e[s+1]>e[s]+a&&(i=Math.min(i,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:i}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;i<a&&o++<100;)n=u((i+a)/2),e[n]<=t?i=n+s:a=n-l;return e[i]}},{"./loggers":661,"fast-isnumeric":106}],670:[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)}},{}],671:[function(t,e,r){"use strict";var n=t("../components/color"),i=function(){};e.exports=function(t){for(var e in t)"function"==typeof t[e]&&(t[e]=i);t.destroy=function(){t.container.parentNode.removeChild(t.container)};var r=document.createElement("div");return r.textContent="Webgl is not supported by your browser - visit http://get.webgl.org for more info",r.style.cursor="pointer",r.style.fontSize="24px",r.style.color=n.defaults[0],t.container.appendChild(r),t.container.style.background="#FFFFFF",t.container.onclick=function(){window.open("http://get.webgl.org")},!1}},{"../components/color":558}],672:[function(t,e,r){"use strict";var n=t("fast-isnumeric");r.aggNums=function(t,e,i,a){var o,s;if(a||(a=i.length),n(e)||(e=!1),Array.isArray(i[0])){for(s=new Array(a),o=0;o<a;o++)s[o]=r.aggNums(t,e,i[o]);i=s}for(o=0;o<a;o++)n(e)?n(i[o])&&(e=t(+e,+i[o])):e=i[o];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.variance=function(t,e,i){return e||(e=r.len(t)),n(i)||(i=r.mean(t,e)),r.aggNums(function(t,e){return t+Math.pow(e-i,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,e<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)]}},{"fast-isnumeric":106}],673:[function(t,e,r){"use strict";function n(t){return t=i(t),a.str2RgbaArray(t.toRgbString())}var i=t("tinycolor2"),a=t("arraytools");e.exports=n},{arraytools:35,tinycolor2:495}],674:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function i(t){return t.replace(/(<|&lt;|&#60;)/g,"\\lt ").replace(/(>|&gt;|&#62;)/g,"\\gt ")}function a(t,e,r){var n="math-output-"+f.randstr([],64),a=h.select("body").append("div").attr({id:n}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(i(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,a.node()],function(){var e=h.select("body").select("#MathJax_SVG_glyphs");if(a.select(".MathJax_SVG").empty()||!a.select("svg").node())f.log("There was an error in the tex syntax.",t),r();else{var n=a.select("svg").node().getBoundingClientRect();r(a.select(".MathJax_SVG"),e,n)}a.remove()})}function o(t,e){for(var r=t||"",n=0;n<e.length;n++){var i=e[n];r=r.replace(i.regExp,i.sub)}return r}function s(t){return o(t,y)}function l(t){return o(t,x)}function u(t){t=s(t);for(var e=t.split(/(<[^<>]*>)/).map(function(t){var e=t.match(/<(\/?)([^ >]*)\s*(.*)>/i),n=e&&e[2].toLowerCase(),i=m[n];if(void 0!==i){var a=e[1],o=e[3],s=o.match(/^style\s*=\s*"([^"]+)"\s*/i);if("a"===n){if(a)return"</a>";if("href"!==o.substr(0,4).toLowerCase())return"<a>";var u=o.substr(4).replace(/["']/g,"").replace(/=/,""),c=document.createElement("a");return c.href=u,g.indexOf(c.protocol)===-1?"<a>":'<a xlink:show="new" xlink:href="'+l(u)+'">'}if("br"===n)return"<br>";if(a)return"sup"===n?'</tspan><tspan dy="0.42em">&#x200b;</tspan>':"sub"===n?'</tspan><tspan dy="-0.21em">&#x200b;</tspan>':"</tspan>";var h="<tspan";return"sup"!==n&&"sub"!==n||(h="&#x200b;"+h),s&&(s=s[1].replace(/(^|;)\s*color:/,"$1 fill:"),i=l(s)+(i?";"+i:"")),h+(i?' style="'+i+'"':"")+">"}return r.xml_entity_encode(t).replace(/</g,"&lt;")}),n=[],i=e.indexOf("<br>");i>0;i=e.indexOf("<br>",i+1))n.push(i);var a=0;n.forEach(function(t){for(var r=t+a,n=e.slice(0,r),i="",o=n.length-1;o>=0;o--){var s=n[o].match(/<(\/?).*>/i);if(s&&"<br>"!==n[o]){s[1]||(i=n[o]);break}}i&&(e.splice(r+1,0,i),e.splice(r,0,"</tspan>"),a+=2)});var o=e.join(""),u=o.split(/<br>/gi);return u.length>1&&(e=u.map(function(t,e){return'<tspan class="line" dy="'+1.3*e+'em">'+t+"</tspan>"})),e.join("")}function c(t,e,r){var n,i,a,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return i="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},a="right"===o?function(){return l.right-n.width}:"center"===o?function(){return l.left+(l.width-n.width)/2}:function(){return l.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:i()-u.top+"px",left:a()-u.left+"px","z-index":1e3}),this}}var h=t("d3"),f=t("../lib"),d=t("../constants/xmlns_namespaces"),p=t("../constants/string_mappings");h.selection.prototype.appendSVG=function(t){for(var e=['<svg xmlns="',d.svg,'" ','xmlns:xlink="',d.xlink,'">',t,"</svg>"].join(""),r=(new DOMParser).parseFromString(e,"application/xml"),n=r.documentElement.firstChild;n;)this.node().appendChild(this.node().ownerDocument.importNode(n,!0)),n=n.nextSibling;return r.querySelector("parsererror")?(f.log(r.querySelector("parsererror div").textContent),null):h.select(this.node().lastChild)},r.html_entity_decode=function(t){var e=h.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(t){return"&lt;"===t?"&#60;":"&rt;"===t?"&#62;":t.indexOf("<")!==-1||t.indexOf(">")!==-1?"":e.html(t).text()});return e.remove(),r},r.xml_entity_encode=function(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&amp;")},r.convertToTspans=function(t,e){function r(){d.empty()||(p=s.attr("class")+"-math",d.select("svg."+p).remove()),t.text("").style({visibility:"inherit","white-space":"pre"}),c=t.appendSVG(o),c||t.text(i),t.select("a").size()&&t.style("pointer-events","all"),e&&e.call(s)}var i=t.text(),o=u(i),s=t,l=!s.attr("data-notex")&&o.match(/([^$]*)([$]+[^$]*[$]+)([^$]*)/),c=i,d=h.select(s.node().parentNode);if(!d.empty()){var p=s.attr("class")?s.attr("class").split(" ")[0]:"text";p+="-math",d.selectAll("svg."+p).remove(),d.selectAll("g."+p+"-group").remove(),t.style({visibility:null});for(var m=t.node();m&&m.removeAttribute;m=m.parentNode)m.removeAttribute("data-bb");if(l){var g=f.getPlotDiv(s.node());(g&&g._promises||[]).push(new Promise(function(t){s.style({visibility:"hidden"});var i={fontSize:parseInt(s.style("font-size"),10)};a(l[2],i,function(i,a,o){d.selectAll("svg."+p).remove(),d.selectAll("g."+p+"-group").remove();var l=i&&i.select("svg");if(!l||!l.node())return r(),void t();var u=d.append("g").classed(p+"-group",!0).attr({"pointer-events":"none"});u.node().appendChild(l.node()),a&&a.node()&&l.node().insertBefore(a.node().cloneNode(!0),l.node().firstChild),l.attr({class:p,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=s.style("fill")||"black";l.select("g").attr({fill:c,stroke:c});var h=n(l,"width"),f=n(l,"height"),m=+s.attr("x")-h*{start:0,middle:.5,end:1}[s.attr("text-anchor")||"start"],g=parseInt(s.style("font-size"),10)||n(s,"height"),v=-g/4;"y"===p[0]?(u.attr({transform:"rotate("+[-90,+s.attr("x"),+s.attr("y")]+") translate("+[-h/2,v-f/2]+")"}),l.attr({x:+s.attr("x"),y:+s.attr("y")})):"l"===p[0]?l.attr({x:s.attr("x"),y:v-f/2}):"a"===p[0]?l.attr({x:0,y:v}):l.attr({x:m,y:+s.attr("y")+v-f/2}),e&&e.call(s,u),t(u)})}))}else r();return t}};var m={sup:'font-size:70%" dy="-0.6em',sub:'font-size:70%" dy="0.3em',b:"font-weight:bold",i:"font-style:italic",a:"",span:"",br:"",em:"font-style:italic;font-weight:bold"},g=["http:","https:","mailto:"],v=new RegExp("</?("+Object.keys(m).join("|")+")( [^>]*)?/?>","g"),y=Object.keys(p.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:p.entityToUnicode[t]}}),x=Object.keys(p.unicodeToEntity).map(function(t){return{regExp:new RegExp(t,"g"),sub:"&"+p.unicodeToEntity[t]+";"}});r.plainText=function(t){return(t||"").replace(v," ")},r.makeEditable=function(t,e,r){function n(){a(),o.style({opacity:0});var t,e=u.attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&h.select(o.node().parentNode).select(t).style({opacity:0})}function i(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}function a(){var t=h.select(f.getPlotDiv(o.node())),e=t.select(".svg-container"),n=e.append("div");n.classed("plugin-editable editable",!0).style({position:"absolute","font-family":o.style("font-family")||"Arial","font-size":o.style("font-size")||12,color:r.fill||o.style("fill")||"black",opacity:1,"background-color":r.background||"transparent",outline:"#ffffff33 1px solid",margin:[-parseFloat(o.style("font-size"))/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(r.text||o.attr("data-unformatted")).call(c(o,e,r)).on("blur",function(){o.text(this.textContent).style({opacity:1});var t,e=h.select(this).attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&h.select(o.node().parentNode).select(t).style({opacity:0});var r=this.textContent;h.select(this).transition().duration(0).remove(),h.select(document).on("mouseup",null),s.edit.call(o,r)}).on("focus",function(){var t=this;h.select(document).on("mouseup",function(){return h.event.target!==t&&void(document.activeElement===n.node()&&n.node().blur())})}).on("keyup",function(){27===h.event.which?(o.style({opacity:1}),h.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),s.cancel.call(o,this.textContent)):(s.input.call(o,this.textContent),h.select(this).call(c(o,e,r)))}).on("keydown",function(){13===h.event.which&&this.blur()}).call(i)}r||(r={});var o=this,s=h.dispatch("edit","input","cancel"),l=h.select(this.node()).style({"pointer-events":"all"}),u=e||l;return e&&l.style({"pointer-events":"none"}),r.immediate?n():u.on("click",n),h.rebind(this,s,"on")}},{"../constants/string_mappings":642,"../constants/xmlns_namespaces":643,"../lib":658,d3:97}],675:[function(t,e,r){"use strict";var n=e.exports={},i=t("../plots/geo/constants").locationmodeToLayer,a=t("topojson-client").feature;n.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(t,e){return t+e+".json"},n.getTopojsonFeatures=function(t,e){var r=i[t.locationmode],n=e.objects[r];return a(e,n).features}},{"../plots/geo/constants":713,"topojson-client":497}],676:[function(t,e,r){"use strict";function n(t,e){for(var r=new Float32Array(e),n=0;n<e;n++)r[n]=t[n];return r}function i(t,e){for(var r=new Float64Array(e),n=0;n<e;n++)r[n]=t[n];return r}e.exports=function(t,e){if(t instanceof Float32Array)return n(t,e);if(t instanceof Float64Array)return i(t,e);throw new Error("This array type is not yet supported by `truncate`.")}},{}],677:[function(t,e,r){"use strict";function n(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=h.cleanId(r,n))}function i(t){var e="middle",r="center";return t.indexOf("top")!==-1?e="top":t.indexOf("bottom")!==-1&&(e="bottom"),t.indexOf("left")!==-1?r="left":t.indexOf("right")!==-1&&(r="right"),e+" "+r}function a(t,e){return e in t&&"object"==typeof t[e]&&0===Object.keys(t[e]).length}var o=t("fast-isnumeric"),s=t("gl-mat4/fromQuat"),l=t("../registry"),u=t("../lib"),c=t("../plots/plots"),h=t("../plots/cartesian/axes"),f=t("../components/color");r.getGraphDiv=function(t){var e;if("string"==typeof t){if(e=document.getElementById(t),null===e)throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t},r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&u.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);var i=h.list({_fullLayout:t});for(e=0;e<i.length;e++){var o=i[e];o.anchor&&"free"!==o.anchor&&(o.anchor=h.cleanId(o.anchor)),o.overlaying&&(o.overlaying=h.cleanId(o.overlaying)),o.type||(o.isdate?o.type="date":o.islog?o.type="log":o.isdate===!1&&o.islog===!1&&(o.type="linear")),"withzero"!==o.autorange&&"tozero"!==o.autorange||(o.autorange=!0,o.rangemode="tozero"),delete o.islog,delete o.isdate,delete o.categories,a(o,"domain")&&delete o.domain,void 0!==o.autotick&&(void 0===o.tickmode&&(o.tickmode=o.autotick?"auto":"linear"),delete o.autotick)}var l=Array.isArray(t.annotations)?t.annotations.length:0;for(e=0;e<l;e++){var d=t.annotations[e];u.isPlainObject(d)&&(d.ref&&("paper"===d.ref?(d.xref="paper",d.yref="paper"):"data"===d.ref&&(d.xref="x",d.yref="y"),delete d.ref),n(d,"xref"),n(d,"yref"))}var p=Array.isArray(t.shapes)?t.shapes.length:0;for(e=0;e<p;e++){var m=t.shapes[e];u.isPlainObject(m)&&(n(m,"xref"),n(m,"yref"))}var g=t.legend;g&&(g.x>3?(g.x=1.02,g.xanchor="left"):g.x<-2&&(g.x=-.02,g.xanchor="right"),g.y>3?(g.y=1.02,g.yanchor="bottom"):g.y<-2&&(g.y=-.02,g.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var v=c.getSubplotIds(t,"gl3d");for(e=0;e<v.length;e++){var y=t[v[e]],x=y.cameraposition;if(Array.isArray(x)&&4===x[0].length){var b=x[0],_=x[1],w=x[2],M=s([],b),A=[];for(r=0;r<3;++r)A[r]=_[e]+w*M[2+4*r];y.camera={eye:{x:A[0],y:A[1],z:A[2]},center:{x:_[0],y:_[1],z:_[2]},up:{x:M[1],y:M[5],z:M[9]}},delete y.cameraposition}}return f.clean(t),t},r.cleanData=function(t,e){for(var n=[],o=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 d,p=t[s];if(!("uid"in p)||n.indexOf(p.uid)!==-1){var m;for(d=0;d<100&&(m=u.randstr(o),n.indexOf(m)!==-1);d++);p.uid=u.randstr(o),o.push(p.uid)}if(n.push(p.uid),"histogramy"===p.type&&"xbins"in p&&!("ybins"in p)&&(p.ybins=p.xbins,delete p.xbins),p.error_y&&"opacity"in p.error_y){var g=f.defaults,v=p.error_y.color||(l.traceIs(p,"bar")?f.defaultLine:g[s%g.length]);p.error_y.color=f.addOpacity(f.rgb(v),f.opacity(v)*p.error_y.opacity),delete p.error_y.opacity}if("bardir"in p&&("h"!==p.bardir||!l.traceIs(p,"bar")&&"histogram"!==p.type.substr(0,9)||(p.orientation="h",r.swapXYData(p)),delete p.bardir),"histogramy"===p.type&&r.swapXYData(p),"histogramx"!==p.type&&"histogramy"!==p.type||(p.type="histogram"),"scl"in p&&(p.colorscale=p.scl,delete p.scl),"reversescl"in p&&(p.reversescale=p.reversescl,delete p.reversescl),p.xaxis&&(p.xaxis=h.cleanId(p.xaxis,"x")),p.yaxis&&(p.yaxis=h.cleanId(p.yaxis,"y")),l.traceIs(p,"gl3d")&&p.scene&&(p.scene=c.subplotsRegistry.gl3d.cleanId(p.scene)),l.traceIs(p,"pie")||l.traceIs(p,"bar")||(Array.isArray(p.textposition)?p.textposition=p.textposition.map(i):p.textposition&&(p.textposition=i(p.textposition))),l.traceIs(p,"2dMap")&&("YIGnBu"===p.colorscale&&(p.colorscale="YlGnBu"),"YIOrRd"===p.colorscale&&(p.colorscale="YlOrRd")),l.traceIs(p,"markerColorscale")&&p.marker){var y=p.marker;"YIGnBu"===y.colorscale&&(y.colorscale="YlGnBu"),"YIOrRd"===y.colorscale&&(y.colorscale="YlOrRd")}if("surface"===p.type&&u.isPlainObject(p.contours)){var x=["x","y","z"];for(d=0;d<x.length;d++){var b=p.contours[x[d]];u.isPlainObject(b)&&(b.highlightColor&&(b.highlightcolor=b.highlightColor,delete b.highlightColor),b.highlightWidth&&(b.highlightwidth=b.highlightWidth,delete b.highlightWidth))}}if(Array.isArray(p.transforms)){var _=p.transforms;for(d=0;d<_.length;d++){var w=_[d];u.isPlainObject(w)&&"filter"===w.type&&(w.filtersrc&&(w.target=w.filtersrc,delete w.filtersrc),w.calendar&&(w.valuecalendar||(w.valuecalendar=w.calendar),delete w.calendar))}}a(p,"line")&&delete p.line,"marker"in p&&(a(p.marker,"line")&&delete p.marker.line,a(p,"marker")&&delete p.marker),f.clean(p)}},r.swapXYData=function(t){var e;if(u.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);u.swapAttrs(t,["error_?.copy_ystyle"]),n&&u.swapAttrs(t,["error_?.color","error_?.thickness","error_?.width"])}if(t.hoverinfo){var i=t.hoverinfo.split("+");for(e=0;e<i.length;e++)"x"===i[e]?i[e]="y":"y"===i[e]&&(i[e]="x");t.hoverinfo=i.join("+")}},r.coerceTraceIndices=function(t,e){return o(e)?[e]:Array.isArray(e)&&e.length?e:t.data.map(function(t,e){return e})},r.manageArrayContainers=function(t,e,r){var n=t.obj,i=t.parts,a=i.length,s=i[a-1],l=o(s);if(l&&null===e){var c=i.slice(0,a-1).join("."),h=u.nestedProperty(n,c).get();h.splice(s,1)}else l&&void 0===t.get()?(void 0===t.get()&&(r[t.astr]=null),t.set(e)):t.set(e)}},{"../components/color":558,"../lib":658,"../plots/cartesian/axes":691,"../plots/plots":751,"../registry":766,"fast-isnumeric":106,"gl-mat4/fromQuat":151}],678:[function(t,e,r){"use strict";function n(t,e){t._fullLayout._paperdiv.style("background","white"),y.defaultConfig.setBackground(t,e)}function i(t,e){t._context||(t._context=x.extendFlat({},y.defaultConfig));var r=t._context;e&&(Object.keys(e).forEach(function(t){t in r&&("setBackground"===t&&"opaque"===e[t]?r[t]=n:r[t]=e[t])}),e.plot3dPixelRatio&&!r.plotGlPixelRatio&&(r.plotGlPixelRatio=r.plot3dPixelRatio)),r.staticPlot&&(r.editable=!1,r.autosizable=!1,r.scrollZoom=!1,r.doubleClick=!1,r.showTips=!1,r.showLink=!1,r.displayModeBar=!1)}function a(t,e,r){var n=g.select(t).selectAll(".plot-container").data([0]);n.enter().insert("div",":first-child").classed("plot-container plotly",!0);var i=n.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),k.manager.fillLayout(t),i.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=k.manager.framework(t),t.framework({data:t.data,layout:t.layout},i.node()),t.framework.setUndoPoint();var a=t.framework.svg(),o=1,s=t._fullLayout.title;""!==s&&s||(o=0);var l="Click to enter title",u=function(){this.call(L.convertToTspans)},c=a.select(".title-group text").call(u);if(t._context.editable){c.attr({"data-unformatted":s}),s&&s!==l||(o=.2,c.attr({"data-unformatted":l}).text(l).style({opacity:o}).on("mouseover.opacity",function(){g.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){g.select(this).transition().duration(1e3).style("opacity",0)}));var h=function(){this.call(L.makeEditable).on("edit",function(e){t.framework({layout:{title:e}}),this.attr({"data-unformatted":e}).text(e).call(u),this.call(h)}).on("cancel",function(){var t=this.attr("data-unformatted");this.text(t).call(u)})};c.call(h)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),M.addLinks(t),Promise.resolve()}function o(t,e){var r,n,i=e+1,a=[];for(r=0;r<t.length;r++)n=t[r],n<0?a.push(i+n):a.push(n);return a}function s(t,e,r){var n,i;for(n=0;n<e.length;n++){if(i=e[n],i!==parseInt(i,10))throw new Error("all values in "+r+" must be integers");if(i>=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function l(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),s(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&s(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function u(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n<e.length;n++)if(i=e[n],"object"!=typeof i||Array.isArray(i)||null===i)throw new Error("all values in traces array must be non-array objects");if("undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&r.length!==e.length)throw new Error("if indices is specified, traces.length must equal indices.length")}function c(t,e,r,n){var i=x.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!x.isPlainObject(e))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");s(t,r,"indices");for(var a in e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}function h(t,e,r,n){var i,a,s,l,u,c=x.isPlainObject(n),h=[];Array.isArray(r)||(r=[r]),r=o(r,t.data.length-1);for(var f in e)for(var d=0;d<r.length;d++){if(i=t.data[r[d]],s=x.nestedProperty(i,f),a=s.get(),l=e[f][d],!Array.isArray(l))throw new Error("attribute: "+f+" index: "+d+" must be an array");if(!Array.isArray(a))throw new Error("cannot extend missing or non-array attribute: "+f);u=c?n[f][d]:n,v(u)||(u=-1),h.push({prop:s,target:a,insert:l,maxp:Math.floor(u)})}return h}function f(t,e,r,n,i,a){c(t,e,r,n);for(var o,s,l,u=h(t,e,r,n),f=[],d={},p={},m=0;m<u.length;m++)s=u[m].prop,l=u[m].maxp,o=i(u[m].target,u[m].insert),l>=0&&l<o.length&&(f=a(o,l)),l=u[m].target.length,s.set(o),Array.isArray(d[s.astr])||(d[s.astr]=[]),Array.isArray(p[s.astr])||(p[s.astr]=[]),d[s.astr].push(f),p[s.astr].push(l);return{update:d,maxPoints:p}}function d(t,e,r){function n(){return d.map(function(){})}function i(t){var e=y.Axes.id2name(t);u.indexOf(e)===-1&&u.push(e)}function a(t){return"LAYOUT"+t+".autorange"}function o(t){return"LAYOUT"+t+".range"}function s(r,i,a){if(Array.isArray(r))return void r.forEach(function(t){s(t,i,a)});if(!(r in e)){var o;o="LAYOUT"===r.substr(0,6)?x.nestedProperty(t.layout,r.replace("LAYOUT","")):x.nestedProperty(f[d[a]],r),r in g||(g[r]=n()),void 0===g[r][a]&&(g[r][a]=o.get()),void 0!==i&&o.set(i)}}var l,u,c=t._fullLayout,h=t._fullData,f=t.data,d=C.coerceTraceIndices(t,r),p={docalc:!1,docalcAutorange:!1,doplot:!1,dostyle:!1,docolorbars:!1,autorangeOn:!1,clearCalc:!1,fullReplot:!1},m={},g={},v={},b=["mode","visible","type","orientation","fill","histfunc","histnorm","text","x","y","z","a","b","c","open","high","low","close","base","width","offset","xtype","x0","dx","ytype","y0","dy","xaxis","yaxis","line.width","connectgaps","transpose","zsmooth","showscale","marker.showscale","zauto","marker.cauto","autocolorscale","marker.autocolorscale","colorscale","marker.colorscale","reversescale","marker.reversescale","autobinx","nbinsx","xbins","xbins.start","xbins.end","xbins.size","autobiny","nbinsy","ybins","ybins.start","ybins.end","ybins.size","autocontour","ncontours","contours","contours.coloring","error_y","error_y.visible","error_y.value","error_y.type","error_y.traceref","error_y.array","error_y.symmetric","error_y.arrayminus","error_y.valueminus","error_y.tracerefminus","error_x","error_x.visible","error_x.value","error_x.type","error_x.traceref","error_x.array","error_x.symmetric","error_x.arrayminus","error_x.valueminus","error_x.tracerefminus","swapxy","swapxyaxes","orientationaxes","marker.colors","values","labels","label0","dlabel","sort","textinfo","textposition","textfont.size","textfont.family","textfont.color","insidetextfont.size","insidetextfont.family","insidetextfont.color","outsidetextfont.size","outsidetextfont.family","outsidetextfont.color","hole","scalegroup","domain","domain.x","domain.y","domain.x[0]","domain.x[1]","domain.y[0]","domain.y[1]","tilt","tiltaxis","depth","direction","rotation","pull","line.showscale","line.cauto","line.autocolorscale","line.reversescale","marker.line.showscale","marker.line.cauto","marker.line.autocolorscale","marker.line.reversescale","xcalendar","ycalendar","cumulative","cumulative.enabled","cumulative.direction","cumulative.currentbin"];for(l=0;l<d.length;l++)if(w.traceIs(h[d[l]],"box")){b.push("name");break}var _=["marker","marker.size","textfont","boxpoints","jitter","pointpos","whiskerwidth","boxmean","tickwidth"],A=["zmin","zmax","zauto","xgap","ygap","marker.cmin","marker.cmax","marker.cauto","line.cmin","line.cmax","marker.line.cmin","marker.line.cmax","contours.start","contours.end","contours.size","contours.showlines","line","line.smoothing","line.shape","error_y.width","error_x.width","error_x.copy_ystyle","marker.maxdisplayed"],k=["type","x","y","x0","y0","orientation","xaxis","yaxis"],T=["zmin","zmax"],E=["xbins.start","xbins.end","xbins.size"],S=["ybins.start","ybins.end","ybins.size"],L=["contours.start","contours.end","contours.size"],I=["cartesian","pie","ternary"];c._basePlotModules.forEach(function(t){I.indexOf(t.name)===-1&&(p.docalc=!0)});for(var z in e){var D,P,O,R,F,j=e[z];if(m[z]=j,"LAYOUT"!==z.substr(0,6)){for(g[z]=n(),l=0;l<d.length;l++)if(D=f[d[l]],P=h[d[l]],O=x.nestedProperty(D,z),R=O.get(),F=Array.isArray(j)?j[l%j.length]:j,void 0!==F){if(T.indexOf(z)!==-1)s("zauto",!1,l);else if("colorscale"===z)s("autocolorscale",!1,l);else if("autocolorscale"===z)s("colorscale",void 0,l);else if("marker.colorscale"===z)s("marker.autocolorscale",!1,l);else if("marker.autocolorscale"===z)s("marker.colorscale",void 0,l);else if("zauto"===z)s(T,void 0,l);else if(E.indexOf(z)!==-1)s("autobinx",!1,l);else if("autobinx"===z)s(E,void 0,l);else if(S.indexOf(z)!==-1)s("autobiny",!1,l);else if("autobiny"===z)s(S,void 0,l);else if(L.indexOf(z)!==-1)s("autocontour",!1,l);else if("autocontour"===z)s(L,void 0,l);else if(["x0","dx"].indexOf(z)!==-1&&P.x&&"scaled"!==P.xtype)s("xtype","scaled",l);else if(["y0","dy"].indexOf(z)!==-1&&P.y&&"scaled"!==P.ytype)s("ytype","scaled",l);else if("colorbar.thicknessmode"===z&&O.get()!==F&&["fraction","pixels"].indexOf(F)!==-1&&P.colorbar){var N=["top","bottom"].indexOf(P.colorbar.orient)!==-1?c.height-c.margin.t-c.margin.b:c.width-c.margin.l-c.margin.r;s("colorbar.thickness",P.colorbar.thickness*("fraction"===F?1/N:N),l)}else if("colorbar.lenmode"===z&&O.get()!==F&&["fraction","pixels"].indexOf(F)!==-1&&P.colorbar){var B=["top","bottom"].indexOf(P.colorbar.orient)!==-1?c.width-c.margin.l-c.margin.r:c.height-c.margin.t-c.margin.b;s("colorbar.len",P.colorbar.len*("fraction"===F?1/B:B),l)}else"colorbar.tick0"===z||"colorbar.dtick"===z?s("colorbar.tickmode","linear",l):"colorbar.tickmode"===z&&s(["colorbar.tick0","colorbar.dtick"],void 0,l);if("type"===z&&"pie"===F!=("pie"===R)){var U="x",V="y";"bar"!==F&&"bar"!==R||"h"!==D.orientation||(U="y",V="x"),x.swapAttrs(D,["?","?src"],"labels",U),x.swapAttrs(D,["d?","?0"],"label",U),x.swapAttrs(D,["?","?src"],"values",V),"pie"===R?(x.nestedProperty(D,"marker.color").set(x.nestedProperty(D,"marker.colors").get()),c._pielayer.selectAll("g.trace").remove()):w.traceIs(D,"cartesian")&&(x.nestedProperty(D,"marker.colors").set(x.nestedProperty(D,"marker.color").get()),v[D.xaxis||"x"]=!0,v[D.yaxis||"y"]=!0)}g[z][l]=R;var q=["swapxy","swapxyaxes","orientation","orientationaxes"];if(q.indexOf(z)!==-1){if("orientation"===z){if(O.set(F),O.get()===g[z][l])continue}else"orientationaxes"===z&&(D.orientation={v:"h",h:"v"}[P.orientation]);C.swapXYData(D)}else M.dataArrayContainers.indexOf(O.parts[0])!==-1?(C.manageArrayContainers(O,F,g),p.docalc=!0):O.set(F)}if(["swapxyaxes","orientationaxes"].indexOf(z)!==-1&&y.Axes.swap(t,d),"orientationaxes"===z){var H=x.nestedProperty(t.layout,"hovermode");"x"===H.get()?H.set("y"):"y"===H.get()&&H.set("x")}if(d.indexOf(0)!==-1&&k.indexOf(z)!==-1&&(y.Axes.clearTypes(t,d),p.docalc=!0),["autobinx","autobiny","zauto"].indexOf(z)!==-1&&F===!1||(p.dostyle=!0),(["colorbar","line"].indexOf(O.parts[0])!==-1||"marker"===O.parts[0]&&"colorbar"===O.parts[1])&&(p.docolorbars=!0),b.indexOf(z)!==-1){if(["orientation","type"].indexOf(z)!==-1){for(u=[],l=0;l<d.length;l++){var Y=f[d[l]];w.traceIs(Y,"cartesian")&&(i(Y.xaxis||"x"),i(Y.yaxis||"y"),"type"===z&&s(["autobinx","autobiny"],!0,l))}s(u.map(a),!0,0),s(u.map(o),[0,1],0)}p.docalc=!0}else A.indexOf(z)!==-1?p.doplot=!0:_.indexOf(z)!==-1&&(p.docalcAutorange=!0)}else O=x.nestedProperty(t.layout,z.replace("LAYOUT","")),g[z]=[O.get()],O.set(Array.isArray(j)?j[0]:j),p.docalc=!0}y.Axes.list(t).forEach(function(t){t.autorange&&(p.autorangeOn=!0)});var G=Object.keys(v);t:for(l=0;l<G.length;l++){for(var X=G[l],W=X.charAt(0),Z=W+"axis",J=0;J<f.length;J++)if(w.traceIs(f[J],"cartesian")&&(f[J][Z]||W)===X)continue t;s("LAYOUT"+y.Axes.id2name(X),null,0)}return(p.docalc||p.docalcAutorange&&p.autorangeOn)&&(p.clearCalc=!0),(p.docalc||p.doplot||p.docalcAutorange)&&(p.fullReplot=!0),{flags:p,undoit:g,redoit:m,traces:d,eventData:x.extendDeepNoArrays([],[m,d])}}function p(t,e){function r(t,n){if(Array.isArray(t))return void t.forEach(function(t){r(t,n)});if(!(t in e)){var i=x.nestedProperty(a,t);t in m||(m[t]=i.get()),void 0!==n&&i.set(n)}}function n(t,e){var r=y.Axes.id2name(t[e+"ref"]||e);return(o[r]||{}).autorange}var i,a=t.layout,o=t._fullLayout,s=Object.keys(e),l=y.Axes.list(t);for(i=0;i<s.length;i++)if(0===s[i].indexOf("allaxes")){for(var u=0;u<l.length;u++){var c=l[u]._id.substr(1),h=c.indexOf("scene")!==-1?c+".":"",f=s[i].replace("allaxes",h+l[u]._name);e[f]||(e[f]=e[s[i]])}delete e[s[i]]}var d={dolegend:!1,doticks:!1,dolayoutstyle:!1,doplot:!1,docalc:!1,domodebar:!1,layoutReplot:!1},p={},m={};for(var g in e){var v=x.nestedProperty(a,g),b=e[g],_=v.parts.length,A="string"==typeof v.parts[_-1]?_-1:_-2,k=v.parts[A],T=v.parts[A-1]+"."+k,E=v.parts.slice(0,A).join("."),S=x.nestedProperty(t.layout,E).get(),L=x.nestedProperty(o,E).get();if(void 0!==b){if(p[g]=b,m[g]="reverse"===k?b:v.get(),["width","height"].indexOf(g)!==-1&&null===b?t._fullLayout[g]=t._initialAutoSize[g]:T.match(/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/)?r(E+".autorange",!1):T.match(/^[xyz]axis[0-9]*\.autorange$/)?r([E+".range[0]",E+".range[1]"],void 0):T.match(/^aspectratio\.[xyz]$/)?r(v.parts[0]+".aspectmode","manual"):T.match(/^aspectmode$/)?r([E+".x",E+".y",E+".z"],void 0):"tick0"===k||"dtick"===k?r(E+".tickmode","linear"):"tickmode"===k?r([E+".tick0",E+".dtick"],void 0):/[xy]axis[0-9]*?$/.test(k)&&!Object.keys(b||{}).length?d.docalc=!0:/[xy]axis[0-9]*\.categoryorder$/.test(T)?d.docalc=!0:/[xy]axis[0-9]*\.categoryarray/.test(T)&&(d.docalc=!0),T.indexOf("rangeslider")!==-1&&(d.docalc=!0),"type"===k&&"log"===L.type!=("log"===b)){var I=S;if(I&&I.range)if(L.autorange)"log"===b&&(I.range=I.range[1]>I.range[0]?[1,2]:[2,1]);else{var z=I.range[0],D=I.range[1];"log"===b?(z<=0&&D<=0&&r(E+".autorange",!0),z<=0?z=D/1e6:D<=0&&(D=z/1e6),r(E+".range[0]",Math.log(z)/Math.LN10),r(E+".range[1]",Math.log(D)/Math.LN10)):(r(E+".range[0]",Math.pow(10,z)),r(E+".range[1]",Math.pow(10,D)))}else r(E+".autorange",!0)}if("reverse"===k)S.range?S.range.reverse():(r(E+".autorange",!0),S.range=[1,0]),L.autorange?d.docalc=!0:d.doplot=!0;else if("annotations"===v.parts[0]||"shapes"===v.parts[0]){var P=v.parts[1],O=v.parts[0],R=a[O]||[],F=R[P]||{};2===v.parts.length&&(null===b&&(e[g]="remove"),"add"===e[g]||x.isPlainObject(e[g])?m[g]="remove":"remove"===e[g]?P===-1?(m[O]=R,delete m[g]):m[g]=F:x.log("???",e)),!n(F,"x")&&!n(F,"y")||x.containsAny(g,["color","opacity","align","dash"])||(d.docalc=!0);var j=w.getComponentMethod(O,"drawOne");j(t,P,v.parts.slice(2).join("."),e[g]),delete e[g]}else if(M.layoutArrayContainers.indexOf(v.parts[0])!==-1||"mapbox"===v.parts[0]&&"layers"===v.parts[1])C.manageArrayContainers(v,b,m),d.doplot=!0;else{var N=String(v.parts[1]||"");0===v.parts[0].indexOf("scene")?d.doplot=!0:0===v.parts[0].indexOf("geo")?d.doplot=!0:0===v.parts[0].indexOf("ternary")?d.doplot=!0:"paper_bgcolor"===g?d.doplot=!0:!o._has("gl2d")||g.indexOf("axis")===-1&&"plot_bgcolor"!==v.parts[0]?"hiddenlabels"===g?d.docalc=!0:v.parts[0].indexOf("legend")!==-1?d.dolegend=!0:g.indexOf("title")!==-1?d.doticks=!0:v.parts[0].indexOf("bgcolor")!==-1?d.dolayoutstyle=!0:v.parts.length>1&&x.containsAny(N,["tick","exponent","grid","zeroline"])?d.doticks=!0:g.indexOf(".linewidth")!==-1&&g.indexOf("axis")!==-1?d.doticks=d.dolayoutstyle=!0:v.parts.length>1&&N.indexOf("line")!==-1?d.dolayoutstyle=!0:v.parts.length>1&&"mirror"===N?d.doticks=d.dolayoutstyle=!0:"margin.pad"===g?d.doticks=d.dolayoutstyle=!0:"margin"===v.parts[0]||"autorange"===v.parts[1]||"rangemode"===v.parts[1]||"type"===v.parts[1]||"domain"===v.parts[1]||g.indexOf("calendar")!==-1||g.match(/^(bar|box|font)/)?d.docalc=!0:["hovermode","dragmode"].indexOf(g)!==-1?d.domodebar=!0:["hovermode","dragmode","height","width","autosize"].indexOf(g)===-1&&(d.doplot=!0):d.doplot=!0,v.set(b)}}}var B=t._fullLayout.width,U=t._fullLayout.height;M.supplyDefaults(t),t.layout.autosize&&M.plotAutoSize(t,t.layout,t._fullLayout);var V=e.height||e.width||t._fullLayout.width!==B||t._fullLayout.height!==U;return V&&(d.docalc=!0),(d.doplot||d.docalc)&&(d.layoutReplot=!0),{flags:d,undoit:m,redoit:p,eventData:x.extendDeep({},p)}}function m(t){var e=g.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([0]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._geocontainer=r._paperdiv.selectAll(".geo-container").data([0]),r._geocontainer.enter().append("div").classed("geo-container",!0),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 n=[];g.selectAll("defs").each(function(){this.id&&n.push(this.id.split("-")[1])}),r._uid=x.randstr(n)}r._paperdiv.selectAll(".main-svg").attr(S.svgAttrs),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._topdefs=r._toppaper.append("defs").attr("id","topdefs-"+r._uid),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._ternarylayer=r._paper.append("g").classed("ternarylayer",!0);var a=r._paper.append("g").classed("layer-above",!0);r._imageUpperLayer=a.append("g").classed("imagelayer",!0),r._shapeUpperLayer=a.append("g").classed("shapelayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0),r._geoimages=r._paper.append("g").classed("geoimages",!0),r._infolayer=r._toppaper.append("g").classed("infolayer",!0),r._zoomlayer=r._toppaper.append("g").classed("zoomlayer",!0),r._hoverlayer=r._toppaper.append("g").classed("hoverlayer",!0),t.emit("plotly_framework")}var g=t("d3"),v=t("fast-isnumeric"),y=t("../plotly"),x=t("../lib"),b=t("../lib/events"),_=t("../lib/queue"),w=t("../registry"),M=t("../plots/plots"),A=t("../plots/cartesian/graph_interact"),k=t("../plots/polar"),T=t("../components/drawing"),E=t("../components/errorbars"),S=t("../constants/xmlns_namespaces"),L=t("../lib/svg_text_utils"),C=t("./helpers"),I=t("./subroutines");y.plot=function(t,e,r,n){function o(){if(_)return y.addFrames(t,_)}function s(){for(var e=z._basePlotModules,r=0;r<e.length;r++)e[r].drawFramework&&e[r].drawFramework(t);return x.syncOrAsync([I.layoutStyles,f,A.init],t)}function l(){var e,r,n,i=t.calcdata;for(w.getComponentMethod("legend","draw")(t),w.getComponentMethod("rangeselector","draw")(t),w.getComponentMethod("sliders","draw")(t),w.getComponentMethod("updatemenus","draw")(t),e=0;e<i.length;e++)r=i[e],n=r[0].trace,n.visible===!0&&n._module.colorbar?n._module.colorbar(t,r):M.autoMargin(t,"cb"+n.uid);return M.doAutoMargin(t),M.previousPromises(t)}function u(){var e=JSON.stringify(z._size)===O?[]:[l,I.layoutStyles];return e=e.concat(A.init),x.syncOrAsync(e,t)}function c(){if(D){for(var e,r,n=M.getSubplotIds(z,"cartesian"),i=z._modules,a=0;a<n.length;a++){e=z._plots[n[a]];for(var o=0;o<i.length;o++)r=i[o],r.setPositions&&r.setPositions(t,e)}return E.calc(t),x.syncOrAsync([w.getComponentMethod("shapes","calcAutorange"),w.getComponentMethod("annotations","calcAutorange"),h],t)}}function h(){if(!t._transitioning)for(var e=y.Axes.list(t,"",!0),r=0;r<e.length;r++)y.Axes.doAutoRange(e[r])}function f(){return y.Axes.doTicks(t,"redraw")}function d(){var e,r=t.calcdata;for(e=0;e<r.length;e++){var n=r[e][0].trace,i=n.visible===!0,a=n.uid;i&&w.traceIs(n,"2dMap")||z._paper.selectAll(".hm"+a+",.contour"+a+",#clip"+a).remove(),i&&n._module.colorbar||z._infolayer.selectAll(".cb"+a).remove()}var o=z._basePlotModules;for(e=0;e<o.length;e++)o[e].plot(t);var s=z._paper.selectAll(".layer-subplot");return z._imageSubplotLayer=s.selectAll(".imagelayer"),z._shapeSubplotLayer=s.selectAll(".shapelayer"),M.style(t),w.getComponentMethod("shapes","draw")(t),w.getComponentMethod("annotations","draw")(t),M.addLinks(t),t._replotting=!1,M.previousPromises(t)}function p(){w.getComponentMethod("shapes","draw")(t),w.getComponentMethod("images","draw")(t),w.getComponentMethod("annotations","draw")(t),w.getComponentMethod("legend","draw")(t),w.getComponentMethod("rangeslider","draw")(t),w.getComponentMethod("rangeselector","draw")(t),w.getComponentMethod("sliders","draw")(t),w.getComponentMethod("updatemenus","draw")(t)}function v(){t.emit("plotly_afterplot")}var _;if(t=C.getGraphDiv(t),b.init(t),x.isPlainObject(e)){var k=e;e=k.data,r=k.layout,n=k.config,_=k.frames}var S=b.triggerHandler(t,"plotly_beforeplot",[e,r,n]);if(S===!1)return Promise.reject();e||r||x.isPlotDiv(t)||x.warn("Calling Plotly.plot as if redrawing but this container doesn't yet have a plot.",t),i(t,n),r||(r={}),g.select(t).classed("js-plotly-plot",!0),T.makeTester(t),t._promises=[];var L=0===(t.data||[]).length&&Array.isArray(e);if(Array.isArray(e)&&(C.cleanData(e,t.data),L?t.data=e:t.data.push.apply(t.data,e),t.empty=!1),t.layout&&!L||(t.layout=C.cleanLayout(r)),t._dragging&&!t._transitioning)return t._replotPending=!0,Promise.reject();if(t._replotPending=!1,M.supplyDefaults(t),e&&e[0]&&e[0].r)return a(t,e,r);t._replotting=!0,L&&m(t),t.framework!==m&&(t.framework=m,m(t)),L&&y.Axes.saveRangeInitial(t);var z=t._fullLayout,D=!t.calcdata||t.calcdata.length!==(t._fullData||[]).length;D&&M.doCalcdata(t);for(var P=0;P<t.calcdata.length;P++)t.calcdata[P][0].trace=t._fullData[P];var O=JSON.stringify(z._size);return x.syncOrAsync([M.previousPromises,o,s,l,u,c,I.layoutStyles,f,d,p],t,v),Promise.all(t._promises).then(function(){return t})},y.redraw=function(t){if(t=C.getGraphDiv(t),!x.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);return C.cleanData(t.data,t.data),C.cleanLayout(t.layout),t.calcdata=void 0,y.plot(t).then(function(){return t.emit("plotly_redraw"),t})},y.newPlot=function(t,e,r,n){return t=C.getGraphDiv(t),M.cleanPlot([],{},t._fullData||{},t._fullLayout||{}),M.purge(t),y.plot(t,e,r,n)},y.extendTraces=function t(e,r,n,i){e=C.getGraphDiv(e);var a=f(e,r,n,i,function(t,e){return t.concat(e)},function(t,e){return t.splice(0,t.length-e)}),o=y.redraw(e),s=[e,a.update,n,a.maxPoints];return _.add(e,y.prependTraces,s,t,arguments),o},y.prependTraces=function t(e,r,n,i){e=C.getGraphDiv(e);var a=f(e,r,n,i,function(t,e){return e.concat(t)},function(t,e){return t.splice(e,t.length)}),o=y.redraw(e),s=[e,a.update,n,a.maxPoints];return _.add(e,y.extendTraces,s,t,arguments),o},y.addTraces=function t(e,r,n){e=C.getGraphDiv(e);var i,a,o=[],s=y.deleteTraces,c=t,h=[e,o],f=[e,r];for(u(e,r,n),Array.isArray(r)||(r=[r]),r=r.map(function(t){return x.extendFlat({},t)}),C.cleanData(r,e.data),i=0;i<r.length;i++)e.data.push(r[i]);for(i=0;i<r.length;i++)o.push(-r.length+i);if("undefined"==typeof n)return a=y.redraw(e),_.add(e,s,h,c,f),a;Array.isArray(n)||(n=[n]);try{l(e,o,n)}catch(t){throw e.data.splice(e.data.length-r.length,r.length),t}return _.startSequence(e),_.add(e,s,h,c,f),a=y.moveTraces(e,o,n),_.stopSequence(e),a},y.deleteTraces=function t(e,r){e=C.getGraphDiv(e);var n,i,a=[],l=y.addTraces,u=t,c=[e,a,r],h=[e,r];if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(r)||(r=[r]),s(e,r,"indices"),r=o(r,e.data.length-1),r.sort(x.sorterDes),n=0;n<r.length;n+=1)i=e.data.splice(r[n],1)[0],a.push(i);var f=y.redraw(e);return _.add(e,l,c,u,h),f},y.moveTraces=function t(e,r,n){e=C.getGraphDiv(e);var i,a=[],s=[],u=t,c=t,h=[e,n,r],f=[e,r,n];if(l(e,r,n),r=Array.isArray(r)?r:[r],"undefined"==typeof n)for(n=[],i=0;i<r.length;i++)n.push(-r.length+i);for(n=Array.isArray(n)?n:[n],r=o(r,e.data.length-1),n=o(n,e.data.length-1),i=0;i<e.data.length;i++)r.indexOf(i)===-1&&a.push(e.data[i]);for(i=0;i<r.length;i++)s.push({newIndex:n[i],trace:e.data[r[i]]});for(s.sort(function(t,e){return t.newIndex-e.newIndex}),i=0;i<s.length;i+=1)a.splice(s[i].newIndex,0,s[i].trace);e.data=a;var d=y.redraw(e);return _.add(e,u,h,c,f),d},y.restyle=function t(e,r,n,i){e=C.getGraphDiv(e),C.clearPromiseQueue(e);var a={};if("string"==typeof r)a[r]=n;else{if(!x.isPlainObject(r))return x.warn("Restyle fail.",r,n,i),Promise.reject();a=r,void 0===i&&(i=n)}Object.keys(a).length&&(e.changed=!0);var o=d(e,a,i),s=o.flags;s.clearCalc&&(e.calcdata=void 0);var l=[];s.fullReplot?l.push(y.plot):(l.push(M.previousPromises),M.supplyDefaults(e),s.dostyle&&l.push(I.doTraceStyle),s.docolorbars&&l.push(I.doColorBars)),_.add(e,t,[e,o.undoit,o.traces],t,[e,o.redoit,o.traces]);var u=x.syncOrAsync(l,e);return u&&u.then||(u=Promise.resolve()),u.then(function(){return e.emit("plotly_restyle",o.eventData),e})},y.relayout=function t(e,r,n){if(e=C.getGraphDiv(e),C.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);var i={};if("string"==typeof r)i[r]=n;else{if(!x.isPlainObject(r))return x.warn("Relayout fail.",r,n),Promise.reject();i=r}Object.keys(i).length&&(e.changed=!0);var a=p(e,i),o=a.flags;o.docalc&&(e.calcdata=void 0);var s=[];o.layoutReplot?s.push(I.layoutReplot):Object.keys(i).length&&(s.push(M.previousPromises),M.supplyDefaults(e),o.dolegend&&s.push(I.doLegend),o.dolayoutstyle&&s.push(I.layoutStyles),o.doticks&&s.push(I.doTicksRelayout),o.domodebar&&s.push(I.doModeBar)),_.add(e,t,[e,a.undoit],t,[e,a.redoit]);var l=x.syncOrAsync(s,e);return l&&l.then||(l=Promise.resolve(e)),l.then(function(){return e.emit("plotly_relayout",a.eventData),e})},y.update=function t(e,r,n,i){if(e=C.getGraphDiv(e),C.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);x.isPlainObject(r)||(r={}),x.isPlainObject(n)||(n={}),Object.keys(r).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var a=d(e,r,i),o=a.flags,s=p(e,n),l=s.flags;(o.clearCalc||l.docalc)&&(e.calcdata=void 0);var u=[];if(o.fullReplot&&l.layoutReplot){var c=e.data,h=e.layout;e.data=void 0,e.layout=void 0,u.push(function(){return y.plot(e,c,h)})}else o.fullReplot?u.push(y.plot):l.layoutReplot?u.push(I.layoutReplot):(u.push(M.previousPromises),M.supplyDefaults(e),o.dostyle&&u.push(I.doTraceStyle),o.docolorbars&&u.push(I.doColorBars),l.dolegend&&u.push(I.doLegend),l.dolayoutstyle&&u.push(I.layoutStyles),l.doticks&&u.push(I.doTicksRelayout),l.domodebar&&u.push(I.doModeBar));_.add(e,t,[e,a.undoit,s.undoit,a.traces],t,[e,a.redoit,s.redoit,a.traces]);var f=x.syncOrAsync(u,e);return f&&f.then||(f=Promise.resolve(e)),f.then(function(){return e.emit("plotly_update",{data:a.eventData,layout:s.eventData}),e})},y.animate=function(t,e,r){function n(t){return Array.isArray(s)?t>=s.length?s[0]:s[t]:s}function i(t){return Array.isArray(l)?t>=l.length?l[0]:l[t]:l}function a(t,e){var r=0;return function(){if(t&&++r===e)return t()}}if(t=C.getGraphDiv(t),!x.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 o=t._transitionData;o._frameQueue||(o._frameQueue=[]),r=M.supplyAnimationDefaults(r);var s=r.transition,l=r.frame;return void 0===o._frameWaitingCnt&&(o._frameWaitingCnt=0),new Promise(function(l,u){function c(){if(0!==o._frameQueue.length){for(;o._frameQueue.length;){var e=o._frameQueue.pop();e.onInterrupt&&e.onInterrupt()}t.emit("plotly_animationinterrupted",[])}}function h(e){if(0!==e.length){for(var s=0;s<e.length;s++){var c;c="byname"===e[s].type?M.computeFrame(t,e[s].name):e[s].data;var h=i(s),f=n(s);f.duration=Math.min(f.duration,h.duration);var d={frame:c,name:e[s].name,frameOpts:h,transitionOpts:f};s===e.length-1&&(d.onComplete=a(l,2),d.onInterrupt=u),o._frameQueue.push(d)}"immediate"===r.mode&&(o._lastFrameAt=-(1/0)),o._animationRaf||p()}}function f(){t.emit("plotly_animated"),window.cancelAnimationFrame(o._animationRaf),o._animationRaf=null}function d(){o._currentFrame&&o._currentFrame.onComplete&&o._currentFrame.onComplete();var e=o._currentFrame=o._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,o._lastFrameAt=Date.now(),o._timeToNext=e.frameOpts.duration,M.transition(t,e.frame.data,e.frame.layout,C.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 f()}function p(){t.emit("plotly_animating"),o._lastFrameAt=-(1/0),o._timeToNext=0,o._runningTransitions=0,o._currentFrame=null;var e=function(){o._animationRaf=window.requestAnimationFrame(e),Date.now()-o._lastFrameAt>o._timeToNext&&d()};e()}function m(t){return Array.isArray(s)?y>=s.length?t.transitionOpts=s[y]:t.transitionOpts=s[0]:t.transitionOpts=s,y++,t}var g,v,y=0,b=[],_=void 0===e||null===e,w=Array.isArray(e),A=!_&&!w&&x.isPlainObject(e);if(A)b.push({type:"object",data:m(x.extendFlat({},e))});else if(_||["string","number"].indexOf(typeof e)!==-1)for(g=0;g<o._frames.length;g++)v=o._frames[g],v&&(_||String(v.group)===String(e))&&b.push({type:"byname",name:String(v.name),data:m({name:v.name})});else if(w)for(g=0;g<e.length;g++){var k=e[g];["number","string"].indexOf(typeof k)!==-1?(k=String(k),b.push({type:"byname",name:k,data:m({name:k})})):x.isPlainObject(k)&&b.push({type:"object",data:m(x.extendFlat({},k))})}for(g=0;g<b.length;g++)if(v=b[g],"byname"===v.type&&!o._frameHash[v.data.name])return x.warn('animate failure: frame not found: "'+v.data.name+'"'),void u();["next","immediate"].indexOf(r.mode)!==-1&&c(),"reverse"===r.direction&&b.reverse();var T=t._fullLayout._currentFrame;if(T&&r.fromcurrent){var E=-1;for(g=0;g<b.length;g++)if(v=b[g],"byname"===v.type&&v.name===T){E=g;break}if(E>0&&E<b.length-1){var S=[];for(g=0;g<b.length;g++)v=b[g],("byname"!==b[g].type||g>E)&&S.push(v);b=S}}b.length>0?h(b):(t.emit("plotly_animated"),l())})},y.addFrames=function(t,e,r){t=C.getGraphDiv(t);var n=0;if(null===e||void 0===e)return Promise.resolve();if(!x.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 i,a,o,s,l=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 c=l.length+2*e.length,h=[];for(i=e.length-1;i>=0;i--)if(x.isPlainObject(e[i])){var f=(u[e[i].name]||{}).name,d=e[i].name;f&&d&&"number"==typeof d&&u[f]&&(n++,x.warn('addFrames: overwriting frame "'+u[f].name+'" with a frame whose name of type "number" also equates to "'+f+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),n>5&&x.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h.push({frame:M.supplyFrameDefaults(e[i]),index:r&&void 0!==r[i]&&null!==r[i]?r[i]:c+i})}h.sort(function(t,e){return t.index>e.index?-1:t.index<e.index?1:0});var p=[],m=[],g=l.length;for(i=h.length-1;i>=0;i--){if(a=h[i].frame,"number"==typeof a.name&&x.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(o=0;o<l.length&&(l[o]||{}).name!==a.name;o++);p.push({type:"replace",index:o,value:a}),m.unshift({type:"replace",index:o,value:l[o]})}else s=Math.max(0,Math.min(h[i].index,g)),p.push({type:"insert",index:s,value:a}),m.unshift({type:"delete",index:s}),g++}var v=M.modifyFrames,y=M.modifyFrames,b=[t,m],w=[t,p];return _&&_.add(t,v,b,y,w),M.modifyFrames(t,p)},y.deleteFrames=function(t,e){if(t=C.getGraphDiv(t),!x.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);var r,n,i=t._transitionData._frames,a=[],o=[];for(e=e.slice(0),e.sort(),r=e.length-1;r>=0;r--)n=e[r],a.push({type:"delete",index:n}),o.unshift({type:"insert",index:n,value:i[n]});var s=M.modifyFrames,l=M.modifyFrames,u=[t,o],c=[t,a];return _&&_.add(t,s,u,l,c),M.modifyFrames(t,a)},y.purge=function(t){t=C.getGraphDiv(t);var e=t._fullLayout||{},r=t._fullData||[];return M.cleanPlot([],{},r,e),M.purge(t),b.purge(t),e._container&&e._container.remove(),delete t._context,delete t._replotPending,delete t._mouseDownTime,delete t._hmpixcount,delete t._hmlumcount,t}},{"../components/drawing":581,"../components/errorbars":587,"../constants/xmlns_namespaces":643,"../lib":658,"../lib/events":650,"../lib/queue":668,"../lib/svg_text_utils":674,"../plotly":686,"../plots/cartesian/graph_interact":698,"../plots/plots":751,"../plots/polar":754,"../registry":766,"./helpers":677,"./subroutines":683,d3:97,"fast-isnumeric":106}],679:[function(t,e,r){"use strict";function n(t,r){try{t._fullLayout._paper.style("background",r)}catch(t){e.exports.logging>0&&console.error(t)}}e.exports={staticPlot:!1,editable:!1,autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:n,topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:!1,globalTransforms:[]}},{}],680:[function(t,e,r){"use strict";function n(t){var e,r;"area"===t?(e={attributes:x},r={}):(e=d.modules[t]._module,r=e.basePlotModule);var n={};n.type=null,w(n,m),w(n,e.attributes),r.attributes&&w(n,r.attributes),Object.keys(d.componentsRegistry).forEach(function(e){var r=d.componentsRegistry[e];r.schema&&r.schema.traces&&r.schema.traces[t]&&Object.keys(r.schema.traces[t]).forEach(function(e){f(n,r.schema.traces[t][e],e)})}),n.type=t;var i={meta:e.meta||{},attributes:s(n)};if(e.layoutAttributes){var a={};w(a,e.layoutAttributes),i.layoutAttributes=s(a)}return i}function i(){var t={};return w(t,g),Object.keys(d.subplotsRegistry).forEach(function(e){var r=d.subplotsRegistry[e];if(r.layoutAttributes)if("cartesian"===r.name)h(t,r,"xaxis"),h(t,r,"yaxis");else{var n="subplot"===r.attr?r.name:r.attr;h(t,r,n)}}),t=c(t),Object.keys(d.componentsRegistry).forEach(function(e){var r=d.componentsRegistry[e];r.layoutAttributes&&(r.schema&&r.schema.layout?Object.keys(r.schema.layout).forEach(function(e){f(t,r.schema.layout[e],e)}):f(t,r.layoutAttributes,r.name))}),{layoutAttributes:s(t)}}function a(t){var e=d.transformsRegistry[t],r=w({},e.attributes);return Object.keys(d.componentsRegistry).forEach(function(e){var n=d.componentsRegistry[e];n.schema&&n.schema.transforms&&n.schema.transforms[t]&&Object.keys(n.schema.transforms[t]).forEach(function(e){f(r,n.schema.transforms[t][e],e)})}),{attributes:s(r)}}function o(){var t={frames:p.extendDeep({},v)};return s(t),t.frames}function s(t){return l(t),u(t),t}function l(t){function e(t){return{valType:"string"}}function n(t,n,i){r.isValObject(t)?"data_array"===t.valType?(t.role="data",i[n+"src"]=e(n)):t.arrayOk===!0&&(i[n+"src"]=e(n)):p.isPlainObject(t)&&(t.role="object")}r.crawl(t,n)}function u(t){function e(t,e,r){if(t){var n=t[A];n&&(delete t[A],r[e]={items:{}},r[e].items[n]=t,r[e].role="object")}}r.crawl(t,e)}function c(t){return _(t,{radialaxis:b.radialaxis,angularaxis:b.angularaxis}),_(t,b.layout),t}function h(t,e,r){var n=p.nestedProperty(t,r),i=w({},e.layoutAttributes);i[M]=!0,n.set(i)}function f(t,e,r){var n=p.nestedProperty(t,r);n.set(w(n.get()||{},e))}var d=t("../registry"),p=t("../lib"),m=t("../plots/attributes"),g=t("../plots/layout_attributes"),v=t("../plots/frame_attributes"),y=t("../plots/animation_attributes"),x=t("../plots/polar/area_attributes"),b=t("../plots/polar/axis_attributes"),_=p.extendFlat,w=p.extendDeep,M="_isSubplotObj",A="_isLinkedToArray",k="_deprecated",T=[M,A,k];r.IS_SUBPLOT_OBJ=M,r.IS_LINKED_TO_ARRAY=A,r.DEPRECATED=k,r.UNDERSCORE_ATTRS=T,r.get=function(){var t={};d.allTypes.concat("area").forEach(function(e){t[e]=n(e)});var e={};return Object.keys(d.transformsRegistry).forEach(function(t){e[t]=a(t)}),{defs:{valObjects:p.valObjects,metaKeys:T.concat(["description","role"])},traces:t,layout:i(),transforms:e,frames:o(),animation:s(y)}},r.crawl=function(t,e,n){var i=n||0;Object.keys(t).forEach(function(n){var a=t[n];T.indexOf(n)===-1&&(e(a,n,t,i),r.isValObject(a)||p.isPlainObject(a)&&r.crawl(a,e,i+1))})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){function e(e,r,o,s){a=a.slice(0,s).concat([r]);var l=e&&("data_array"===e.valType||e.arrayOk===!0);if(l){var u=n(a),c=p.nestedProperty(t,u).get();Array.isArray(c)&&i.push(u)}}function n(t){return t.join(".")}var i=[],a=[];if(r.crawl(t._module.attributes,e),t.transforms)for(var o=t.transforms,s=0;s<o.length;s++){var l=o[s];a=["transforms["+s+"]"],r.crawl(l._module.attributes,e,1)}return t._fullInput&&(r.crawl(t._fullInput._module.attributes,e),i=p.filterUnique(i)),i}},{"../lib":658,"../plots/animation_attributes":687,"../plots/attributes":689,"../plots/frame_attributes":712,"../plots/layout_attributes":742,"../plots/polar/area_attributes":752,"../plots/polar/axis_attributes":753,"../registry":766}],681:[function(t,e,r){"use strict";function n(t){o.register(t,t.name,t.categories,t.meta),o.subplotsRegistry[t.basePlotModule.name]||o.registerSubplot(t.basePlotModule)}function i(t){if("string"!=typeof t.name)throw new Error("Transform module *name* must be a string.");var e="Transform module "+t.name,r="function"==typeof t.transform,n="function"==typeof t.calcTransform;if(!r&&!n)throw new Error(e+" is missing a *transform* or *calcTransform* method.");r&&n&&s.log([e+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),s.isPlainObject(t.attributes)||s.log(e+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&s.log(e+" registered without a *supplyDefaults* method."),o.transformsRegistry[t.name]=t}function a(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");o.registerComponent(t)}var o=t("../registry"),s=t("../lib");e.exports=function(t){if(!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;e<t.length;e++){var r=t[e];if(!r)throw new Error("Invalid module was attempted to be registered!");switch(r.moduleType){case"trace":n(r);break;case"transform":i(r);break;case"component":a(r);break;default:throw new Error("Invalid module was attempted to be registered!")}}}},{"../lib":658,"../registry":766}],682:[function(t,e,r){"use strict";var n=t("../plotly"),i=t("../lib");e.exports=function(t){return i.extendFlat(n.defaultConfig,t)}},{"../lib":658,"../plotly":686}],683:[function(t,e,r){"use strict";var n=t("../plotly"),i=t("../registry"),a=t("../plots/plots"),o=t("../lib"),s=t("../components/color"),l=t("../components/drawing"),u=t("../components/titles"),c=t("../components/modebar");r.layoutStyles=function(t){return o.syncOrAsync([a.doAutoMargin,r.lsInner],t)},r.lsInner=function(t){var e,i=t._fullLayout,a=i._size,u=n.Axes.list(t);for(e=0;e<u.length;e++)u[e]._linepositions={};i._paperdiv.style({width:i.width+"px",height:i.height+"px"}).selectAll(".main-svg").call(l.setSize,i.width,i.height),t._context.setBackground(t,i.paper_bgcolor);var h=[];return i._paper.selectAll("g.subplot").each(function(e){var r=i._plots[e],u=n.Axes.getFromId(t,e,"x"),c=n.Axes.getFromId(t,e,"y");u.setScale(),c.setScale(),r.bg&&r.bg.call(l.setRect,u._offset-a.p,c._offset-a.p,u._length+2*a.p,c._length+2*a.p).call(s.fill,i.plot_bgcolor),r.clipId="clip"+i._uid+e+"plot";var f=i._defs.selectAll("g.clips").selectAll("#"+r.clipId).data([0]);f.enter().append("clipPath").attr({class:"plotclip",id:r.clipId}).append("rect"),f.selectAll("rect").attr({width:u._length,height:c._length}),r.plot.call(o.setTranslate,u._offset,c._offset),r.plot.call(l.setClipUrl,r.clipId);var d=l.crispRound(t,u.linewidth,1),p=l.crispRound(t,c.linewidth,1),m=a.p+p,g="M"+-m+",",v="h"+(u._length+2*m),y="free"===u.anchor&&h.indexOf(u._id)===-1,x=a.h*(1-(u.position||0))+d/2%1,b=u.anchor===c._id&&(u.mirror||"top"!==u.side)||"all"===u.mirror||"allticks"===u.mirror||u.mirrors&&u.mirrors[c._id+"bottom"],_=c._length+a.p+d/2,w=u.anchor===c._id&&(u.mirror||"top"===u.side)||"all"===u.mirror||"allticks"===u.mirror||u.mirrors&&u.mirrors[c._id+"top"],M=-a.p-d/2,A=a.p,k=b?0:d,T=w?0:d,E=","+(-A-T)+"v"+(c._length+2*A+T+k),S="free"===c.anchor&&h.indexOf(c._id)===-1,L=a.w*(c.position||0)+p/2%1,C=c.anchor===u._id&&(c.mirror||"right"!==c.side)||"all"===c.mirror||"allticks"===c.mirror||c.mirrors&&c.mirrors[u._id+"left"],I=-a.p-p/2,z=c.anchor===u._id&&(c.mirror||"right"===c.side)||"all"===c.mirror||"allticks"===c.mirror||c.mirrors&&c.mirrors[u._id+"right"],D=u._length+a.p+p/2;u._linepositions[e]=[b?_:void 0,w?M:void 0,y?x:void 0],u.anchor===c._id?u._linepositions[e][3]="top"===u.side?M:_:y&&(u._linepositions[e][3]=x),c._linepositions[e]=[C?I:void 0,z?D:void 0,S?L:void 0],c.anchor===u._id?c._linepositions[e][3]="right"===c.side?D:I:S&&(c._linepositions[e][3]=L);var P="translate("+u._offset+","+c._offset+")",O=P,R=P;y&&(O="translate("+u._offset+","+a.t+")",M+=c._offset-a.t,_+=c._offset-a.t),S&&(R="translate("+a.l+","+c._offset+")",I+=u._offset-a.l,D+=u._offset-a.l),r.xlines.attr("transform",O).attr("d",(b?g+_+v:"")+(w?g+M+v:"")+(y?g+x+v:"")||"M0,0").style("stroke-width",d+"px").call(s.stroke,u.showline?u.linecolor:"rgba(0,0,0,0)"),r.ylines.attr("transform",R).attr("d",(C?"M"+I+E:"")+(z?"M"+D+E:"")+(S?"M"+L+E:"")||"M0,0").attr("stroke-width",p+"px").call(s.stroke,c.showline?c.linecolor:"rgba(0,0,0,0)"),r.xaxislayer.attr("transform",O),r.yaxislayer.attr("transform",R),r.gridlayer.attr("transform",P),r.zerolinelayer.attr("transform",P),r.draglayer.attr("transform",P),y&&h.push(u._id),S&&h.push(c._id)}),n.Axes.makeClipPaths(t),r.drawMainTitle(t),c.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",dfltName:"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||{},o=n.arraysToCalcdata;o&&o(r,r[0].trace)}return a.style(t),i.getComponentMethod("legend","draw")(t),a.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;i.traceIs(n,"contour")&&o.line({width:n.contours.showlines!==!1?n.line.width:0,dash:n.line.dash,color:"line"===n.contours.coloring?o._opts.line.color:n.line.color}),i.traceIs(n,"markerColorscale")?o.options(n.marker.colorbar)():o.options(n.colorbar)()}}return a.previousPromises(t)},r.layoutReplot=function(t){var e=t.layout;return t.layout=void 0,n.plot(t,"",e)},r.doLegend=function(t){return i.getComponentMethod("legend","draw")(t),a.previousPromises(t)},r.doTicksRelayout=function(t){return n.Axes.doTicks(t,"redraw"),r.drawMainTitle(t),a.previousPromises(t)},r.doModeBar=function(t){var e,r,i=t._fullLayout;for(c.manage(t),n.Fx.init(t),e=a.getSubplotIds(i,"gl3d"),r=0;r<e.length;r++){var o=i[e[r]]._scene;o.updateFx(i.dragmode,i.hovermode)}for(e=a.getSubplotIds(i,"geo"),r=0;r<e.length;r++){var s=i[e[r]]._subplot;s.updateFx(i.hovermode)}return a.previousPromises(t)}},{"../components/color":558,"../components/drawing":581,"../components/modebar":604,"../components/titles":632,"../lib":658,"../plotly":686,"../plots/plots":751,"../registry":766}],684:[function(t,e,r){"use strict";function n(t,e){var r=new Promise(function(r,n){function h(){var t=s.getDelay(p._fullLayout);return new Promise(function(r,n){setTimeout(function(){var t=u(p),i=document.createElement("canvas");i.id=o.randstr(),c({format:e.format,width:p._fullLayout.width,height:p._fullLayout.height,canvas:i,svg:t,promise:!0}).then(function(t){p&&document.body.removeChild(p),r(t)}).catch(function(t){n(t)})},t)})}e=e||{},e.format=e.format||"png";var f=function(t){return void 0===t||null===t||!!(i(t)&&t>1)};f(e.width)&&f(e.height)||n(new Error("Height and width should be pixel values."));var d=l(t,{format:"png",height:e.height,width:e.width}),p=d.gd;p.style.position="absolute",p.style.left="-5000px",document.body.appendChild(p);var m=s.getRedrawFunc(p);a.plot(p,d.data,d.layout,d.config).then(m).then(h).then(function(t){r(t)}).catch(function(t){n(t)})});return r}var i=t("fast-isnumeric"),a=t("../plotly"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/cloneplot"),u=t("../snapshot/tosvg"),c=t("../snapshot/svgtoimg");e.exports=n},{"../lib":658,"../plotly":686,"../snapshot/cloneplot":767,"../snapshot/helpers":770,"../snapshot/svgtoimg":772,"../snapshot/tosvg":774,"fast-isnumeric":106}],685:[function(t,e,r){"use strict";function n(t,e,r,i,a,u){u=u||[];for(var c=Object.keys(t),f=0;f<c.length;f++){var d=c[f];if("transforms"!==d){var g=u.slice();g.push(d);var v=t[d],y=e[d],x=l(r,d),b="info_array"===(x||{}).valType;if(s(r,d))if(p(v)&&p(y))n(v,y,x,i,a,g);else if(x.items&&!b&&m(v)){var _,w,M=x.items,A=M[Object.keys(M)[0]],k=[];for(_=0;_<y.length;_++){var T=y[_]._index||_;w=g.slice(),w.push(T),p(v[T])&&p(y[_])&&(k.push(T),n(v[T],y[_],A,i,a,w))}for(_=0;_<v.length;_++)w=g.slice(),w.push(_),p(v[_])?k.indexOf(_)===-1&&i.push(o("unused",a,w)):i.push(o("object",a,w,v[_]))}else!p(v)&&p(y)?i.push(o("object",a,g,v)):m(v)||!m(y)||b?d in e?h.validate(v,x)||i.push(o("value",a,g,v)):i.push(o("unused",a,g,v)):i.push(o("array",a,g,v));else i.push(o("schema",a,g))}}return i}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r].type,i=t.traces[n].layoutAttributes;i&&h.extendFlat(t.layout.layoutAttributes,i)}return t.layout.layoutAttributes}function a(t){return m(t)?"In data trace "+t[1]+", ":"In "+t+", "}function o(t,e,r,n){r=r||"";var i,a;m(e)?(i=e[0],a=e[1]):(i=e,a=null);var o=c(r),s=g[t](e,o,n);return h.log(s),{code:t,container:i,trace:a,path:r,astr:o,msg:s}}function s(t,e){var r=u(e),n=r.keyMinusId,i=r.id;return!!(n in t&&t[n]._isSubplotObj&&i)||e in t}function l(t,e){var r=u(e);return t[r.keyMinusId]}function u(t){var e=/([2-9]|[1-9][0-9]+)$/,r=t.split(e)[0],n=t.substr(r.length,t.length);return{keyMinusId:r,id:n}}function c(t){if(!m(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}var h=t("../lib"),f=t("../plots/plots"),d=t("./plot_schema"),p=h.isPlainObject,m=Array.isArray;e.exports=function(t,e){var r,a,s=d.get(),l=[],u={};m(t)?(u.data=h.extendDeep([],t),r=t):(u.data=[],r=[],l.push(o("array","data"))),p(e)?(u.layout=h.extendDeep({},e),a=e):(u.layout={},a={},arguments.length>1&&l.push(o("object","layout"))),f.supplyDefaults(u);for(var c=u._fullData,g=r.length,v=0;v<g;v++){var y=r[v],x=["data",v];if(p(y)){var b=c[v],_=b.type,w=s.traces[_].attributes;w.type={valType:"enumerated",values:[_]},b.visible===!1&&y.visible!==!1&&l.push(o("invisible",x)),n(y,b,w,l,x);var M=y.transforms,A=b.transforms;if(M){m(M)||l.push(o("array",x,["transforms"])),x.push("transforms");for(var k=0;k<M.length;k++){var T=["transforms",k],E=M[k].type;if(p(M[k])){var S=s.transforms[E]?s.transforms[E].attributes:{};S.type={valType:"enumerated",values:Object.keys(s.transforms)},n(M[k],A[k],S,l,x,T)}else l.push(o("object",x,T))}}}else l.push(o("object",x))}var L=u._fullLayout,C=i(s,c);return n(a,L,C,l,"layout"),0===l.length?void 0:l};var g={object:function(t,e){var r;return r="layout"===t&&""===e?"The layout argument":"data"===t[0]&&""===e?"Trace "+t[1]+" in the data argument":a(t)+"key "+e,r+" must be linked to an object container"},array:function(t,e){var r;return r="data"===t?"The data argument":a(t)+"key "+e,r+" must be linked to an array container"},schema:function(t,e){return a(t)+"key "+e+" is not part of the schema"},unused:function(t,e,r){var n=p(r)?"container":"key";return a(t)+n+" "+e+" did not get coerced"},invisible:function(t){return"Trace "+t[1]+" got defaulted to be not visible"},value:function(t,e,r){return[a(t)+"key "+e,"is set to an invalid value ("+r+")"].join(" ")}}},{"../lib":658,"../plots/plots":751,"./plot_schema":680}],686:[function(t,e,r){"use strict";r.defaultConfig=t("./plot_api/plot_config"),r.Plots=t("./plots/plots"),r.Axes=t("./plots/cartesian/axes"),r.Fx=t("./plots/cartesian/graph_interact"),r.ModeBar=t("./components/modebar"),t("./plot_api/plot_api")},{"./components/modebar":604,"./plot_api/plot_api":678,"./plot_api/plot_config":679,"./plots/cartesian/axes":691,"./plots/cartesian/graph_interact":698,"./plots/plots":751}],687:[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"]}}}},{}],688:[function(t,e,r){"use strict";var n=t("../lib");e.exports=function(t,e,r){for(var i=r.name,a=Array.isArray(t[i])?t[i]:[],o=e[i]=[],s=0;s<a.length;s++){var l=a[s],u={},c={};n.isPlainObject(l)||(c.itemIsNotPlainObject=!0,l={}),r.handleItemDefaults(l,u,e,r,c),u._input=l,u._index=s,o.push(u)}}},{"../lib":658}],689:[function(t,e,r){"use strict";e.exports={type:{valType:"enumerated",values:[],dflt:"scatter"},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0},showlegend:{valType:"boolean",dflt:!0},legendgroup:{valType:"string",dflt:""},opacity:{valType:"number",min:0,max:1,dflt:1},name:{valType:"string"},uid:{valType:"string",dflt:""},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],dflt:"all"},stream:{token:{valType:"string",noBlank:!0,strict:!0},maxpoints:{valType:"number",min:0,max:1e4,dflt:500}}}},{}],690:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x"},yaxis:{valType:"subplotid",dflt:"y"}}},{}],691:[function(t,e,r){"use strict";function n(t,e,r,n,i){function a(e){return(1+100*(e-t)/r.dtick)%100<2}for(var o=0,s=0,l=0,u=0,c=0;c<e.length;c++)e[c]%1===0?l++:x(e[c])||u++,a(e[c])&&o++,a(e[c]+r.dtick/2)&&s++;var h=e.length-u;if(l===h&&"date"!==r.type)r.dtick<1?t=n-.5*r.dtick:(t-=.5,t+r.dtick<n&&(t+=r.dtick));else if(s<.1*h&&(o>.3*h||a(n)||a(i))){var f=r.dtick/2;t+=t+f<n?f:-f}return t}function i(t,e,r,n,i){var a=_.findExactDates(e,i),o=.8;if(a.exactDays>o){var s=Number(r.substr(1));a.exactYears>o&&s%12===0?t=O.tickIncrement(t,"M6","reverse")+1.5*C:a.exactMonths>o?t=O.tickIncrement(t,"M1","reverse")+15.5*C:t-=C/2;var l=O.tickIncrement(t,r);if(l<=n)return l}return t}function a(t){var e,r,n=t.tickvals,i=t.ticktext,a=new Array(n.length),o=_.simpleMap(t.range,t.r2l),s=1.0001*o[0]-1e-4*o[1],u=1.0001*o[1]-1e-4*o[0],c=Math.min(s,u),h=Math.max(s,u),f=0;Array.isArray(i)||(i=[]);var d="category"===t.type?t.d2l_noadd:t.d2l;for("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)),r=0;r<n.length;r++)e=d(n[r]),e>c&&e<h&&(void 0===i[r]?a[f]=O.tickText(t,e):a[f]=l(t,e,String(i[r])),f++);return f<n.length&&a.splice(f,n.length-f),a}function o(t,e,r){return e*_.roundUp(t/e,r)}function s(t){var e=t.dtick;if(t._tickexponent=0,x(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>=C&&i<=10||e>=15*C)t._tickround="d";else if(e>=z&&i<=16||e>=I)t._tickround="M";else if(e>=D&&i<=19||e>=z)t._tickround="S";else{var a=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,a)-20}}else if(x(e)||"L"===e.charAt(0)){var o=t.range.map(t.r2d||Number);x(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(o[0]),Math.abs(o[1])),l=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(l)>3&&("SI"===t.exponentformat||"B"===t.exponentformat?t._tickexponent=3*Math.round((l-1)/3):t._tickexponent=l)}else t._tickround=null}function l(t,e,r){var n=t.tickfont||t._gd._fullLayout.font;return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function u(t,e,r,n){var i=t._tickround,a=r&&t.hoverformat||t.tickformat;n&&(i=x(i)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[i]);var o,s=_.formatDate(e.x,a,i,t.calendar),l=s.indexOf("\n");l!==-1&&(o=s.substr(l+1),s=s.substr(0,l)),n&&("00:00:00"===s||"00:00"===s?(s=o,o=""):8===s.length&&(s=s.replace(/:00$/,""))),o&&(r?"d"===i?s+=", "+o:s=o+(s?", "+s:""):t._inCalcTicks&&o===t._prevDateHead||(s+="<br>"+o,t._prevDateHead=o)),e.text=s}function c(t,e,r,n,i){var a=t.dtick,o=e.x;if(!n||"string"==typeof a&&"L"===a.charAt(0)||(a="L3"),t.tickformat||"string"==typeof a&&"L"===a.charAt(0))e.text=d(Math.pow(10,o),t,i,n);else if(x(a)||"D"===a.charAt(0)&&_.mod(o+.01,1)<.1)if(["e","E","power"].indexOf(t.exponentformat)!==-1){var s=Math.round(o);0===s?e.text=1:1===s?e.text="10":s>1?e.text="10<sup>"+s+"</sup>":e.text="10<sup>−"+-s+"</sup>",e.fontSize*=1.25}else e.text=d(Math.pow(10,o),t,"","fakehover"),"D1"===a&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6);else{if("D"!==a.charAt(0))throw"unrecognized dtick "+String(a);e.text=String(Math.round(Math.pow(10,_.mod(o,1)))),e.fontSize*=.75}if("D1"===t.dtick){var l=String(e.text).charAt(0);"0"!==l&&"1"!==l||("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*(o<0?.5:.25)))}}function h(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}function f(t,e,r,n,i){"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=d(e.x,t,i,n)}function d(t,e,r,n){var i=t<0,a=e._tickround,o=r||e.exponentformat||"B",l=e._tickexponent,u=e.tickformat,c=e.separatethousands;if(n){var h={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:x(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};s(h),a=(Number(h._tickround)||0)+4,l=h._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return y.format(u)(t).replace(/-/g,"−");var f=Math.pow(10,-a)/2;if("none"===o&&(l=0),t=Math.abs(t),t<f)t="0",i=!1;else{if(t+=f,l&&(t*=Math.pow(10,-l),a+=l),0===a)t=String(Math.floor(t));else if(a<0){t=String(Math.round(t)),t=t.substr(0,t.length+a);for(var d=a;d<0;d++)t+="0"}else{t=String(t);var p=t.indexOf(".")+1;p&&(t=t.substr(0,p+a).replace(/\.?0+$/,""))}t=_.numSeparate(t,e._gd._fullLayout.separators,c)}if(l&&"hide"!==o){var m;m=l<0?"−"+-l:"power"!==o?"+"+l:String(l),"e"===o||("SI"===o||"B"===o)&&(l>12||l<-15)?t+="e"+m:"E"===o?t+="E"+m:"power"===o?t+="×10<sup>"+m+"</sup>":"B"===o&&9===l?t+="B":"SI"!==o&&"B"!==o||(t+=q[l/3+5])}return i?"−"+t:t}function p(t,e){var r,n,i=[];for(r=0;r<e.length;r++){var a=[],o=t._fullData[e[r]].xaxis,s=t._fullData[e[r]].yaxis;if(o&&s){for(n=0;n<i.length;n++)i[n].x.indexOf(o)===-1&&i[n].y.indexOf(s)===-1||a.push(n);if(a.length){var l,u=i[a[0]];if(a.length>1)for(n=1;n<a.length;n++)l=i[a[n]],m(u.x,l.x),m(u.y,l.y);m(u.x,[o]),m(u.y,[s])}else i.push({x:[o],y:[s]})}}return i}function m(t,e){for(var r=0;r<e.length;r++)t.indexOf(e[r])===-1&&t.push(e[r])}function g(t,e,r){var n,i,a=[],o=[],s=t.layout;for(n=0;n<e.length;n++)a.push(O.getFromId(t,e[n]));for(n=0;n<r.length;n++)o.push(O.getFromId(t,r[n]));var l=Object.keys(a[0]),u=["anchor","domain","overlaying","position","side","tickangle"],c=["linear","log"];for(n=0;n<l.length;n++){var h=l[n],f=a[0][h],d=o[0][h],p=!0,m=!1,g=!1;if("_"!==h.charAt(0)&&"function"!=typeof f&&u.indexOf(h)===-1){for(i=1;i<a.length&&p;i++){var y=a[i][h];"type"===h&&c.indexOf(f)!==-1&&c.indexOf(y)!==-1&&f!==y?m=!0:y!==f&&(p=!1)}for(i=1;i<o.length&&p;i++){var x=o[i][h];"type"===h&&c.indexOf(d)!==-1&&c.indexOf(x)!==-1&&d!==x?g=!0:o[i][h]!==d&&(p=!1)}p&&(m&&(s[a[0]._name].type="linear"),g&&(s[o[0]._name].type="linear"),v(s,h,a,o))}}for(n=0;n<t._fullLayout.annotations.length;n++){var b=t._fullLayout.annotations[n];e.indexOf(b.xref)!==-1&&r.indexOf(b.yref)!==-1&&_.swapAttrs(s.annotations[n],["?"])}}function v(t,e,r,n){var i,a=_.nestedProperty,o=a(t[r[0]._name],e).get(),s=a(t[n[0]._name],e).get();for("title"===e&&("Click to enter X axis title"===o&&(o="Click to enter Y axis title"),"Click to enter Y axis title"===s&&(s="Click to enter X axis title")),i=0;i<r.length;i++)a(t,r[i]._name+"."+e).set(s);for(i=0;i<n.length;i++)a(t,n[i]._name+"."+e).set(o)}var y=t("d3"),x=t("fast-isnumeric"),b=t("../../registry"),_=t("../../lib"),w=t("../../lib/svg_text_utils"),M=t("../../components/titles"),A=t("../../components/color"),k=t("../../components/drawing"),T=t("../../constants/numerical"),E=T.FP_SAFE,S=T.ONEAVGYEAR,L=T.ONEAVGMONTH,C=T.ONEDAY,I=T.ONEHOUR,z=T.ONEMIN,D=T.ONESEC,P=T.BADNUM,O=e.exports={};O.layoutAttributes=t("./layout_attributes"),O.supplyLayoutDefaults=t("./layout_defaults"),O.setConvert=t("./set_convert");var R=t("./axis_ids");O.id2name=R.id2name,O.cleanId=R.cleanId,O.list=R.list,O.listIds=R.listIds,O.getFromId=R.getFromId,O.getFromTrace=R.getFromTrace,O.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),s=O.listIds(r,o),l=n+"ref",u={};return i||(i=s[0]||a),a||(a=i),u[l]={valType:"enumerated",values:s.concat(a?[a]:[]),dflt:i},_.coerce(t,e,u,l)},O.coercePosition=function(t,e,r,n,i,a){var o,s;if("paper"===n||"pixel"===n)o=r(i,a);else{var l=O.getFromId(e,n);if(a=l.fraction2r(a),o=r(i,a),"category"===l.type){if("string"==typeof o&&(l._categories||[]).length)return s=l._categories.indexOf(o),void(t[i]=s===-1?a:s)}else if("date"===l.type)return void(t[i]=_.cleanDate(o,P,l.calendar))}t[i]=x(o)?Number(o):a},O.clearTypes=function(t,e){Array.isArray(e)&&e.length||(e=t._fullData.map(function(t,e){return e})),e.forEach(function(e){var r=t.data[e];delete(O.getFromId(t,r.xaxis)||{}).type,delete(O.getFromId(t,r.yaxis)||{}).type})},O.counterLetter=function(t){var e=t.charAt(0);return"x"===e?"y":"y"===e?"x":void 0},O.minDtick=function(t,e,r,n){["log","category"].indexOf(t.type)===-1&&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},O.getAutoRange=function(t){var e,r=[],n=t._min[0].val,i=t._max[0].val;for(e=1;e<t._min.length&&n===i;e++)n=Math.min(n,t._min[e].val);for(e=1;e<t._max.length&&n===i;e++)i=Math.max(i,t._max[e].val);var a,o,s,l,u,c,h,f=0,d=!1;if(t.range){var p=_.simpleMap(t.range,t.r2l);d=p[1]<p[0]}for("reversed"===t.autorange&&(d=!0,t.autorange=!0),e=0;e<t._min.length;e++)for(o=t._min[e],a=0;a<t._max.length;a++)s=t._max[a],h=s.val-o.val,c=t._length-o.pad-s.pad,h>0&&c>0&&h/c>f&&(l=o,u=s,f=h/c);if(n===i){var m=n-1,g=n+1;r="tozero"===t.rangemode?n<0?[m,0]:[0,g]:"nonnegative"===t.rangemode?[Math.max(0,m),Math.max(0,g)]:[m,g]}else f&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(l.val>=0&&(l={val:0,pad:0}),u.val<=0&&(u={val:0,pad:0})):"nonnegative"===t.rangemode&&(l.val-f*l.pad<0&&(l={val:0,pad:0}),u.val<0&&(u={val:1,pad:0})),f=(u.val-l.val)/(t._length-l.pad-u.pad)),r=[l.val-f*l.pad,u.val+f*u.pad]);return r[0]===r[1]&&("tozero"===t.rangemode?r=r[0]<0?[r[0],0]:r[0]>0?[0,r[0]]:[0,1]:(r=[r[0]-1,r[0]+1],"nonnegative"===t.rangemode&&(r[0]=Math.max(0,r[0])))),d&&r.reverse(),_.simpleMap(r,t.l2r||Number)},O.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=O.getAutoRange(t);var r=t._gd.layout[t._name];r||(t._gd.layout[t._name]=r={}),r!==t&&(r.range=t.range.slice(),r.autorange=t.autorange)}},O.saveRangeInitial=function(t,e){for(var r=O.list(t,"",!0),n=!1,i=0;i<r.length;i++){var a=r[i],o=void 0===a._rangeInitial,s=o||!(a.range[0]===a._rangeInitial[0]&&a.range[1]===a._rangeInitial[1]);(o&&a.autorange===!1||e&&s)&&(a._rangeInitial=a.range.slice(),n=!0)}return n},O.expand=function(t,e,r){function n(t){if(Array.isArray(t))return function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}function i(r){function n(t){return x(t)&&Math.abs(t)<E}if(l=e[r],x(l)){if(h=b(r)+v,f=_(r)+v,p=l-M(r),m=l+w(r),"log"===t.type&&p<m/10&&(p=m/10),u=t.c2l(p),c=t.c2l(m),y&&(u=Math.min(0,u),c=Math.max(0,c)),n(u)){for(d=!0,o=0;o<t._min.length&&d;o++)s=t._min[o],s.val<=u&&s.pad>=f?d=!1:s.val>=u&&s.pad<=f&&(t._min.splice(o,1),o--);d&&t._min.push({val:u,pad:y&&0===u?0:f})}if(n(c)){for(d=!0,o=0;o<t._max.length&&d;o++)s=t._max[o],s.val>=c&&s.pad>=h?d=!1:s.val<=c&&s.pad<=h&&(t._max.splice(o,1),o--);d&&t._max.push({val:c,pad:y&&0===c?0:h})}}}if((t.autorange||t._needsExpand)&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var a,o,s,l,u,c,h,f,d,p,m,g=e.length,v=r.padded?.05*t._length:0,y=r.tozero&&("linear"===t.type||"-"===t.type),b=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),_=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),w=n(r.vpadplus||r.vpad),M=n(r.vpadminus||r.vpad);for(a=0;a<6;a++)i(a);for(a=g-1;a>5;a--)i(a)}},O.autoBin=function(t,e,r,a,o){var s=_.aggNums(Math.min,null,t),l=_.aggNums(Math.max,null,t);if(o||(o=e.calendar),"category"===e.type)return{start:s-.5,end:l+.5,size:1};var u;if(r)u=(l-s)/r;else{var c=_.distinctVals(t),h=Math.pow(10,Math.floor(Math.log(c.minDiff)/Math.LN10)),f=h*_.roundUp(c.minDiff/h,[.9,1.9,4.9,9.9],!0);u=Math.max(f,2*_.stdev(t)/Math.pow(t.length,a?.25:.4)),x(u)||(u=1)}var d;d="log"===e.type?{type:"linear",range:[s,l]}:{type:e.type,range:_.simpleMap([s,l],e.c2r,0,o),calendar:o},O.setConvert(d),O.autoTicks(d,u);var p,m=O.tickIncrement(O.tickFirst(d),d.dtick,"reverse",o);if("number"==typeof d.dtick){m=n(m,t,d,s,l);var g=1+Math.floor((l-m)/d.dtick);p=m+g*d.dtick}else for("M"===d.dtick.charAt(0)&&(m=i(m,t,d.dtick,s,o)),p=m;p<=l;)p=O.tickIncrement(p,d.dtick,!1,o);return{start:e.c2r(m,0,o),end:e.c2r(p,0,o),size:d.dtick}},O.calcTicks=function(t){var e=_.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=_.constrain(t._length/r,4,9)+1)),"array"===t.tickmode&&(n*=100),O.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))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),s(t),"array"===t.tickmode)return a(t);t._tmin=O.tickFirst(t);var i=e[1]<e[0],o=[],l=1.0001*e[1]-1e-4*e[0];"category"===t.type&&(l=i?Math.max(-.5,l):Math.min(t._categories.length-.5,l));for(var u=t._tmin;(i?u>=l:u<=l)&&(o.push(u),!(o.length>1e3));u=O.tickIncrement(u,t.dtick,i,t.calendar));t._tmax=o[o.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var c=new Array(o.length),h=0;h<o.length;h++)c[h]=O.tickText(t,o[h]);return t._inCalcTicks=!1,c};var F=[2,5,10],j=[1,2,3,6,12],N=[1,2,5,10,15,30],B=[1,2,3,7,14],U=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],V=[-.301,0,.301,.699,1];O.autoTicks=function(t,e){var r;if("date"===t.type){t.tick0=_.dateTick0(t.calendar);var n=2*e;n>S?(e/=S,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*o(e,r,F)):n>L?(e/=L,t.dtick="M"+o(e,1,j)):n>C?(t.dtick=o(e,C,B),t.tick0=_.dateTick0(t.calendar,!0)):n>I?t.dtick=o(e,I,j):n>z?t.dtick=o(e,z,N):n>D?t.dtick=o(e,D,N):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=o(e,r,F))}else if("log"===t.type){t.tick0=0;var i=_.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(i[1]-i[0])<1){var a=1.5*Math.abs((i[1]-i[0])/e);e=Math.abs(Math.pow(10,i[1])-Math.pow(10,i[0]))/a,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+o(e,r,F)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):(t.tick0=0,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=o(e,r,F));if(0===t.dtick&&(t.dtick=1),!x(t.dtick)&&"string"!=typeof t.dtick){var s=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(s)}},O.tickIncrement=function(t,e,r,n){var i=r?-1:1;if(x(e))return t+i*e;var a=e.charAt(0),o=i*Number(e.substr(1));if("M"===a)return _.incrementMonth(t,o,n);if("L"===a)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===a){var s="D2"===e?V:U,l=t+.01*i,u=_.roundUp(_.mod(l,1),s,r);return Math.floor(l)+Math.log(y.round(Math.pow(10,u),1))/Math.LN10}throw"unrecognized dtick "+String(e)},O.tickFirst=function(t){var e=t.r2l||Number,r=_.simpleMap(t.range,e),n=r[1]<r[0],i=n?Math.floor:Math.ceil,a=1.0001*r[0]-1e-4*r[1],o=t.dtick,s=e(t.tick0);if(x(o)){var l=i((a-s)/o)*o+s;return"category"===t.type&&(l=_.constrain(l,0,t._categories.length-1)),l}var u=o.charAt(0),c=Number(o.substr(1));if("M"===u){for(var h,f,d,p=0,m=s;p<10;){if(h=O.tickIncrement(m,o,n,t.calendar),(h-a)*(m-a)<=0)return n?Math.min(m,h):Math.max(m,h);f=(a-(m+h)/2)/(h-m),d=u+(Math.abs(Math.round(f))||1)*c,m=O.tickIncrement(m,d,f<0?!n:n,t.calendar),p++}return _.error("tickFirst did not converge",t),m}if("L"===u)return Math.log(i((Math.pow(10,a)-s)/c)*c+s)/Math.LN10;if("D"===u){var g="D2"===o?V:U,v=_.roundUp(_.mod(a,1),g,n);return Math.floor(a)+Math.log(y.round(Math.pow(10,v),1))/Math.LN10}throw"unrecognized dtick "+String(o)},O.tickText=function(t,e,r){function n(n){var i;return void 0===n||(r?"none"===n:(i={first:t._tmin,last:t._tmax}[n],"all"!==n&&e!==i))}var i,a,o=l(t,e),s="array"===t.tickmode,d=r||s,p="category"===t.type?t.d2l_noadd:t.d2l;if(s&&Array.isArray(t.ticktext)){var m=_.simpleMap(t.range,t.r2l),g=Math.abs(m[1]-m[0])/1e4;for(a=0;a<t.ticktext.length&&!(Math.abs(e-p(t.tickvals[a]))<g);a++);if(a<t.ticktext.length)return o.text=String(t.ticktext[a]),o}return i="none"!==t.exponentformat&&n(t.showexponent)?"hide":"","date"===t.type?u(t,o,r,d):"log"===t.type?c(t,o,r,d,i):"category"===t.type?h(t,o):f(t,o,r,d,i),t.tickprefix&&!n(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!n(t.showticksuffix)&&(o.text+=t.ticksuffix),o};var q=["f","p","n","μ","m","","k","M","G","T"];O.subplotMatch=/^x([0-9]*)y([0-9]*)$/,O.getSubplots=function(t,e){function r(t,e){return t.indexOf(e._id)!==-1}var n,i,a,o=[],s=t._fullData||t.data||[];for(n=0;n<s.length;n++){var l=s[n];if(l.visible!==!1&&"legendonly"!==l.visible&&(b.traceIs(l,"cartesian")||b.traceIs(l,"gl2d"))){var u=l.xaxis||"x",c=l.yaxis||"y";a=u+c,o.indexOf(a)===-1&&o.push(a)}}var h=O.list(t,"",!0);for(n=0;n<h.length;n++){var f=h[n],d=f._id.charAt(0),p="free"===f.anchor?"x"===d?"y":"x":f.anchor,m=O.getFromId(t,p),g=!1;for(i=0;i<o.length;i++)if(r(o[i],f)){g=!0;break}"free"===f.anchor&&g||m&&(a="x"===d?f._id+m._id:m._id+f._id,o.indexOf(a)===-1&&o.push(a))}var v=O.subplotMatch,y=[];for(n=0;n<o.length;n++)a=o[n],v.test(a)&&y.push(a);return y.sort(function(t,e){var r=t.match(v),n=e.match(v);return r[1]===n[1]?+(r[2]||1)-(n[2]||1):+(r[1]||0)-(n[1]||0)}),e?O.findSubplotsWithAxis(y,e):y},O.findSubplotsWithAxis=function(t,e){for(var r=new RegExp("x"===e._id.charAt(0)?"^"+e._id+"y":e._id+"$"),n=[],i=0;i<t.length;i++){var a=t[i];r.test(a)&&n.push(a)}return n},O.makeClipPaths=function(t){var e,r,n=t._fullLayout,i=n._defs,a={_offset:0,_length:n.width,_id:""},o={_offset:0,_length:n.height,_id:""},s=O.list(t,"x",!0),l=O.list(t,"y",!0),u=[];for(e=0;e<s.length;e++)for(u.push({x:s[e],y:o}),r=0;r<l.length;r++)0===e&&u.push({x:a,y:l[r]}),u.push({x:s[e],y:l[r]});var c=i.selectAll("g.clips").data([0]);c.enter().append("g").classed("clips",!0);var h=c.selectAll(".axesclip").data(u,function(t){return t.x._id+t.y._id});h.enter().append("clipPath").classed("axesclip",!0).attr("id",function(t){return"clip"+n._uid+t.x._id+t.y._id}).append("rect"),h.exit().remove(),h.each(function(t){y.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})})},O.doTicks=function(t,e,r){function n(t){var e=u.l2p(t.x);return e>1&&e<u._length-1}function i(t,e){var r=t.selectAll("path."+S).data("inside"===u.ticks?V:T,E);e&&u.ticks?(r.enter().append("path").classed(S,1).classed("ticks",1).classed("crisp",1).call(A.stroke,u.tickcolor).style("stroke-width",j+"px").attr("d",e),r.attr("transform",d),r.exit().remove()):r.remove()}function a(r,n){function i(t,e){t.each(function(t){var r=p(e),n=y.select(this),i=n.select(".text-math-group"),a=d(t)+(x(e)&&0!==+e?" rotate("+e+","+h(t)+","+(f(t)-t.fontSize/2)+")":"");if(i.empty()){var o=n.select("text").attr({transform:a,"text-anchor":r});o.empty()||o.selectAll("tspan.line").attr({x:o.attr("x"),y:o.attr("y")})}else{var s=k.bBox(i.node()).width*{end:-.5,start:.5}[r];i.attr("transform",a+(s?"translate("+s+",0)":""))}})}function a(){return L.length&&Promise.all(L)}function s(){if(i(c,u.tickangle),"x"===g&&!x(u.tickangle)&&("log"!==u.type||"D"!==String(u.dtick).charAt(0))){var t=[];for(c.each(function(e){var r=y.select(this),n=r.select(".text-math-group"),i=u.l2p(e.x);n.empty()&&(n=r.select("text"));var a=k.bBox(n.node());t.push({top:0,bottom:10,height:10,left:i-a.width/2,right:i+a.width/2+2,width:a.width+2})}),m=0;m<t.length-1;m++)if(_.bBoxIntersect(t[m],t[m+1])){A=30;break}if(A){var r=Math.abs((T[T.length-1].x-T[0].x)*u._m)/(T.length-1);r<2.5*M&&(A=90),i(c,A)}u._lastangle=A}return o(e),e+" done"}function l(){u._boundingBox=r.node().getBoundingClientRect()}var c=r.selectAll("g."+S).data(T,E);if(!u.showticklabels||!x(n))return c.remove(),void o(e);var h,f,p,v,b;"x"===g?(b="bottom"===B?1:-1,h=function(t){return t.dx+D*b},v=n+(z+I)*b,f=function(t){return t.dy+v+t.fontSize*("bottom"===B?1:-.5)},p=function(t){return x(t)&&0!==t&&180!==t?t*b<0?"end":"start":"middle"}):(b="right"===B?1:-1,f=function(t){return t.dy+t.fontSize/2-D*b},h=function(t){return t.dx+n+(z+I+(90===Math.abs(u.tickangle)?t.fontSize/2:0))*b},p=function(t){return x(t)&&90===Math.abs(t)?"middle":"right"===B?"start":"end"});var M=0,A=0,L=[];c.enter().append("g").classed(S,1).append("text").attr("text-anchor","middle").each(function(e){var r=y.select(this),n=t._promises.length;r.call(k.setPosition,h(e),f(e)).call(k.font,e.font,e.fontSize,e.fontColor).text(e.text).call(w.convertToTspans),n=t._promises[n],n?L.push(t._promises.pop().then(function(){i(r,u.tickangle)})):i(r,u.tickangle)}),c.exit().remove(),c.each(function(t){M=Math.max(M,t.fontSize)}),i(c,u._lastangle||u.tickangle);var C=_.syncOrAsync([a,s,l]);return C&&C.then&&t._promises.push(C),C}function o(e){if(!r){var n,i,a,o,s=R.getFromId(t,e),l=y.select(t).selectAll("g."+e+"tick"),u={selection:l,side:s.side},h=e.charAt(0),f=t._fullLayout._size,d=1.5,p=s.titlefont.size;if(l.size()){var m=y.select(l.node().parentNode).attr("transform").match(/translate\(([-\.\d]+),([-\.\d]+)\)/);m&&(u.offsetLeft=+m[1],u.offsetTop=+m[2])}"x"===h?(i="free"===s.anchor?{_offset:f.t+(1-(s.position||0))*f.h,_length:0}:R.getFromId(t,s.anchor),a=s._offset+s._length/2,o=i._offset+("top"===s.side?-10-p*(d+(s.showticklabels?1:0)):i._length+10+p*(d+(s.showticklabels?1.5:.5))),s.rangeslider&&s.rangeslider.visible&&s._boundingBox&&(o+=(c.height-c.margin.b-c.margin.t)*s.rangeslider.thickness+s._boundingBox.height),u.side||(u.side="bottom")):(i="free"===s.anchor?{_offset:f.l+(s.position||0)*f.w,_length:0}:R.getFromId(t,s.anchor),o=s._offset+s._length/2,a=i._offset+("right"===s.side?i._length+10+p*(d+(s.showticklabels?1:.5)):-10-p*(d+(s.showticklabels?.5:0))),n={rotate:"-90",offset:0},u.side||(u.side="left")),M.draw(t,e+"title",{propContainer:s,propName:s._name+".title",dfltName:h.toUpperCase()+" axis",avoid:u,transform:n,attributes:{x:a,y:o,"text-anchor":"middle"}})}}function s(t,e){return t.visible===!0&&t.xaxis+t.yaxis===e&&(!(!b.traceIs(t,"bar")||t.orientation!=={x:"h",y:"v"}[g])||t.fill&&t.fill.charAt(t.fill.length-1)===g)}function l(e,r,i){var a=e.gridlayer,o=e.zerolinelayer,l=e["hidegrid"+g]?[]:V,c=u._gridpath||"M0,0"+("x"===g?"v":"h")+r._length,h=a.selectAll("path."+L).data(u.showgrid===!1?[]:l,E);if(h.enter().append("path").classed(L,1).classed("crisp",1).attr("d",c).each(function(t){u.zeroline&&("linear"===u.type||"-"===u.type)&&Math.abs(t.x)<u.dtick/100&&y.select(this).remove()}),h.attr("transform",d).call(A.stroke,u.gridcolor||"#ddd").style("stroke-width",P+"px"),h.exit().remove(),o){for(var f=!1,p=0;p<t._fullData.length;p++)if(s(t._fullData[p],i)){f=!0;break}var m=_.simpleMap(u.range,u.r2l),v=m[0]*m[1]<=0&&u.zeroline&&("linear"===u.type||"-"===u.type)&&l.length&&(f||n({x:0})||!u.showline),x=o.selectAll("path."+C).data(v?[{x:0}]:[]);x.enter().append("path").classed(C,1).classed("zl",1).classed("crisp",1).attr("d",c),x.attr("transform",d).call(A.stroke,u.zerolinecolor||A.defaultLine).style("stroke-width",F+"px"),x.exit().remove()}}var u,c=t._fullLayout,h=!1;if("object"==typeof e)u=e,e=u._id,h=!0;else if(u=O.getFromId(t,e),"redraw"===e&&c._paper.selectAll("g.subplot").each(function(t){var e=c._plots[t],r=e.xaxis,n=e.yaxis;e.xaxislayer.selectAll("."+r._id+"tick").remove(),e.yaxislayer.selectAll("."+n._id+"tick").remove(),e.gridlayer.selectAll("path").remove(),e.zerolinelayer.selectAll("path").remove()}),!e||"redraw"===e)return _.syncOrAsync(O.list(t,"",!0).map(function(r){return function(){if(r._id){var n=O.doTicks(t,r._id);return"redraw"===e&&(r._r=r.range.slice(),r._rl=_.simpleMap(r._r,r.r2l)),n}}}));u.tickformat||(["none","e","E","power","SI","B"].indexOf(u.exponentformat)===-1&&(u.exponentformat="e"),["all","first","last","none"].indexOf(u.showexponent)===-1&&(u.showexponent="all")),u.setScale();var f,d,p,m,g=e.charAt(0),v=O.counterLetter(e),T=O.calcTicks(u),E=function(t){return t.text+t.x+u.mirror},S=e+"tick",L=e+"grid",C=e+"zl",I=(u.linewidth||1)/2,z=("outside"===u.ticks?u.ticklen:1)+(u.linewidth||0),D=0,P=k.crispRound(t,u.gridwidth,1),F=k.crispRound(t,u.zerolinewidth,P),j=k.crispRound(t,u.tickwidth,1);if(u._counterangle&&"outside"===u.ticks){var N=u._counterangle*Math.PI/180;z=u.ticklen*Math.cos(N)+(u.linewidth||0),D=u.ticklen*Math.sin(N)}if("x"===g)f=["bottom","top"],d=function(t){return"translate("+u.l2p(t.x)+",0)"},p=function(t,e){if(u._counterangle){var r=u._counterangle*Math.PI/180;return"M0,"+t+"l"+Math.sin(r)*e+","+Math.cos(r)*e}return"M0,"+t+"v"+e};else{if("y"!==g)return void _.warn("Unrecognized doTicks axis:",e);f=["left","right"],d=function(t){return"translate(0,"+u.l2p(t.x)+")"},p=function(t,e){if(u._counterangle){var r=u._counterangle*Math.PI/180;return"M"+t+",0l"+Math.cos(r)*e+","+-Math.sin(r)*e}return"M"+t+",0h"+e}}var B=u.side||f[0],U=[-1,1,B===f[1]?1:-1];"inside"!==u.ticks==("x"===g)&&(U=U.map(function(t){return-t}));var V=T.filter(n);if(h){if(i(u._axislayer,p(u._pos+I*U[2],U[2]*u.ticklen)),u._counteraxis){var q={gridlayer:u._gridlayer,zerolinelayer:u._zerolinelayer};l(q,u._counteraxis)}return a(u._axislayer,u._pos)}var H=O.getSubplots(t,u).map(function(t){var e=c._plots[t];if(c._has("cartesian")){var r=e[g+"axislayer"],n=u._linepositions[t]||[],o=e[v+"axis"],s=o._id===u.anchor,h=[!1,!1,!1],d="";if("allticks"===u.mirror?h=[!0,!0,!1]:s&&("ticks"===u.mirror?h=[!0,!0,!1]:h[f.indexOf(B)]=!0),u.mirrors)for(m=0;m<2;m++){var y=u.mirrors[o._id+f[m]];"ticks"!==y&&"labels"!==y||(h[m]=!0)}return void 0!==n[2]&&(h[2]=!0),h.forEach(function(t,e){var r=n[e],i=U[e];t&&x(r)&&(d+=p(r+I*i,i*u.ticklen))}),i(r,d),l(e,o,t),a(r,n[3])}}).filter(function(t){return t&&t.then});return H.length?Promise.all(H):0},O.swap=function(t,e){for(var r=p(t,e),n=0;n<r.length;n++)g(t,r[n].x,r[n].y)}},{"../../components/color":558,"../../components/drawing":581,"../../components/titles":632,"../../constants/numerical":641,"../../lib":658,"../../lib/svg_text_utils":674,"../../registry":766,"./axis_ids":694,"./layout_attributes":700,"./layout_defaults":701,"./set_convert":705,d3:97,"fast-isnumeric":106}],692:[function(t,e,r){"use strict";function n(t){if(!t)return!1;for(var e=0;e<t.length;e++)if(o(t[e]))return!0;return!1}function i(t,e){for(var r,n=0,i=0,a=Math.max(1,(t.length-1)/1e3),l=0;l<t.length;l+=a)r=t[Math.round(l)],s.isDateTime(r,e)&&(n+=1),o(r)&&(i+=1);return n>2*i}function a(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,i=0,a=0;a<t.length;a+=r)e=t[Math.round(a)],s.cleanNumber(e)!==l?n++:"string"==typeof e&&""!==e&&"None"!==e&&i++;return i>2*n}var o=t("fast-isnumeric"),s=t("../../lib"),l=t("../../constants/numerical").BADNUM;e.exports=function(t,e){return i(t,e)?"date":a(t)?"category":n(t)?"linear":"-"}},{"../../constants/numerical":641,"../../lib":658,"fast-isnumeric":106}],693:[function(t,e,r){"use strict";function n(t,e){if("-"===t.type){var r=t._id,n=r.charAt(0);r.indexOf("scene")!==-1&&(r=n);var s=o(e,r,n);if(s){if("histogram"===s.type&&n==={v:"y",h:"x"}[s.orientation||"v"])return void(t.type="linear");var l=n+"calendar",c=s[l];if(a(s,n)){for(var h,f=i(s),d=[],p=0;p<e.length;p++)h=e[p],u.traceIs(h,"box")&&(h[n+"axis"]||n)===r&&(void 0!==h[f]?d.push(h[f][0]):void 0!==h.name?d.push(h.name):d.push("text"),h[l]!==c&&(c=void 0));t.type=b(d,c)}else t.type=b(s[n]||[s[n+"0"]],c)}}}function i(t){return{v:"x",h:"y"}[t.orientation||"v"]}function a(t,e){var r=i(t);return u.traceIs(t,"box")&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}function o(t,e,r){for(var n=0;n<t.length;n++){var i=t[n];if((i[r+"axis"]||r)===e){if(a(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}var s=t("fast-isnumeric"),l=t("tinycolor2").mix,u=t("../../registry"),c=t("../../lib"),h=t("../../components/color/attributes").lightFraction,f=t("./layout_attributes"),d=t("./tick_value_defaults"),p=t("./tick_mark_defaults"),m=t("./tick_label_defaults"),g=t("./category_order_defaults"),v=t("./set_convert"),y=t("./ordered_categories"),x=t("./axis_ids"),b=t("./axis_autotype");e.exports=function(t,e,r,i){function a(r,n){return c.coerce2(t,e,f,r,n)}var o=i.letter,b=i.font||{},_="Click to enter "+(i.title||o.toUpperCase()+" axis")+" title";i.name&&(e._name=i.name,e._id=x.name2id(i.name));var w=r("type");if("-"===w&&(n(e,i.data),"-"===e.type?e.type="linear":w=t.type=e.type),"date"===w){var M=u.getComponentMethod("calendars","handleDefaults");M(t,e,"calendar",i.calendar)}v(e);var A=r("color"),k=A===t.color?A:b.color;r("title",_),c.coerceFont(r,"titlefont",{family:b.family,size:Math.round(1.2*b.size),color:k});var T=2===(t.range||[]).length&&s(e.r2l(t.range[0]))&&s(e.r2l(t.range[1])),E=r("autorange",!T);E&&r("rangemode"),r("range"),e.cleanRange(),d(t,e,r,w),m(t,e,r,w,i),p(t,e,r,i),g(t,e,r);var S=a("linecolor",A),L=a("linewidth"),C=r("showline",!!S||!!L);C||(delete e.linecolor,delete e.linewidth),(C||e.ticks)&&r("mirror");var I=a("gridcolor",l(A,i.bgColor,h).toRgbString()),z=a("gridwidth"),D=r("showgrid",i.showGrid||!!I||!!z);D||(delete e.gridcolor,delete e.gridwidth);var P=a("zerolinecolor",A),O=a("zerolinewidth"),R=r("zeroline",i.showGrid||!!P||!!O);return R||(delete e.zerolinecolor,delete e.zerolinewidth),e._initialCategories="category"===w?y(o,e.categoryorder,e.categoryarray,i.data):[],e}},{"../../components/color/attributes":557,"../../lib":658,"../../registry":766,"./axis_autotype":692,"./axis_ids":694,"./category_order_defaults":695,"./layout_attributes":700,"./ordered_categories":702,"./set_convert":705,"./tick_label_defaults":706,"./tick_mark_defaults":707,"./tick_value_defaults":708,"fast-isnumeric":106,tinycolor2:495}],694:[function(t,e,r){"use strict";function n(t,e,r){function n(t,r){for(var n=Object.keys(t),i=/^[xyz]axis[0-9]*/,a=[],o=0;o<n.length;o++){var s=n[o];e&&s.charAt(0)!==e||i.test(s)&&a.push(r+s)}return a.sort()}var i=t._fullLayout;if(!i)return[];var o=n(i,"");if(r)return o;for(var s=a.getSubplotIds(i,"gl3d")||[],l=0;l<s.length;l++){var u=s[l];o=o.concat(n(i[u],u+"."))}return o}var i=t("../../registry"),a=t("../plots"),o=t("../../lib"),s=t("./constants");r.id2name=function(t){if("string"==typeof t&&t.match(s.AX_ID_PATTERN)){var e=t.substr(1);return"1"===e&&(e=""),t.charAt(0)+"axis"+e}},r.name2id=function(t){if(t.match(s.AX_NAME_PATTERN)){var e=t.substr(5);return"1"===e&&(e=""),t.charAt(0)+e}},r.cleanId=function(t,e){if(t.match(s.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,r){return n(t,e,r).map(function(e){return o.nestedProperty(t._fullLayout,e).get()})},r.listIds=function(t,e){return n(t,e,!0).map(r.name2id)},r.getFromId=function(t,e,n){var i=t._fullLayout;return"x"===n?e=e.replace(/y[0-9]*/,""):"y"===n&&(e=e.replace(/x[0-9]*/,"")),i[r.id2name(e)]},r.getFromTrace=function(t,e,n){var a=t._fullLayout,o=null;if(i.traceIs(e,"gl3d")){var s=e.scene;"scene"===s.substr(0,5)&&(o=a[s][n+"axis"])}else o=r.getFromId(t,e[n+"axis"]||n);return o}},{"../../lib":658,"../../registry":766,"../plots":751,"./constants":696}],695:[function(t,e,r){"use strict";e.exports=function(t,e,r){if("category"===e.type){var n,i=t.categoryarray,a=Array.isArray(i)&&i.length>0;a&&(n="array");var o=r("categoryorder",n);"array"===o&&r("categoryarray"),a||"array"!==o||(e.categoryorder="trace")}}},{}],696:[function(t,e,r){"use strict";e.exports={idRegex:{x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},attrRegex:{x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},xAxisMatch:/^xaxis[0-9]*$/,yAxisMatch:/^yaxis[0-9]*$/,AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,DBLCLICKDELAY:300,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,MAXDIST:20,YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,BENDPX:1.5,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4]}},{}],697:[function(t,e,r){"use strict";function n(t,e){var r,n=t.range[e],i=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,s.format("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,s.format("."+String(r)+"g")(n))}function i(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function a(t){s.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function o(t){var e=["lasso","select"];return e.indexOf(t)!==-1}var s=t("d3"),l=t("tinycolor2"),u=t("../../plotly"),c=t("../../registry"),h=t("../../lib"),f=t("../../lib/svg_text_utils"),d=t("../../components/color"),p=t("../../components/drawing"),m=t("../../lib/setcursor"),g=t("../../components/dragelement"),v=t("./axes"),y=t("./select"),x=t("./constants"),b=!0;e.exports=function(t,e,r,s,_,w,M,A){function k(t,e){for(var r=0;r<t.length;r++)if(!t[r].fixedrange)return e;return""}function T(){U=[e.xaxis],V=[e.yaxis],q=U[0]._length,H=V[0]._length;for(var t=1;t<B.length;t++){var r=B[t].xaxis,n=B[t].yaxis;U.indexOf(r)===-1&&U.push(r),V.indexOf(n)===-1&&V.push(n)}K=U.concat(V),Q=k(U,A),$=k(V,M),tt=i($+Q,N.dragmode),mt=e.xaxis._offset,gt=e.yaxis._offset,it.xa=U,it.ya=V}function E(e,r,n){var i=nt.getBoundingClientRect();at=r-i.left,ot=n-i.top,st={l:at,r:at,w:0,t:ot,b:ot,h:0},lt=t._hmpixcount?t._hmlumcount/t._hmpixcount:l(t._fullLayout.plot_bgcolor).getLuminance(),ut="M0,0H"+q+"V"+H+"H0V0",ct=!1,ht="xy",ft=pt.append("path").attr("class","zoombox").style({fill:lt>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+mt+", "+gt+")").attr("d",ut+"Z"),dt=pt.append("path").attr("class","zoombox-corners").style({fill:d.background,stroke:d.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+mt+", "+gt+")").attr("d","M0,0Z"),S()}function S(){pt.selectAll(".select-outline").remove()}function L(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(q,e+at)),i=Math.max(0,Math.min(H,r+ot)),a=Math.abs(n-at),o=Math.abs(i-ot),s=Math.floor(Math.min(o,a,G)/2);st.l=Math.min(at,n),st.r=Math.max(at,n),st.t=Math.min(ot,i),st.b=Math.max(ot,i),!$||o<Math.min(Math.max(.6*a,Y),G)?a<Y?(ht="",st.r=st.l,st.t=st.b,dt.attr("d","M0,0Z")):(st.t=0,st.b=H,ht="x",dt.attr("d","M"+(st.l-.5)+","+(ot-G-.5)+"h-3v"+(2*G+1)+"h3ZM"+(st.r+.5)+","+(ot-G-.5)+"h3v"+(2*G+1)+"h-3Z")):!Q||a<Math.min(.6*o,G)?(st.l=0,st.r=q,ht="y",dt.attr("d","M"+(at-G-.5)+","+(st.t-.5)+"v-3h"+(2*G+1)+"v3ZM"+(at-G-.5)+","+(st.b+.5)+"v3h"+(2*G+1)+"v-3Z")):(ht="xy",dt.attr("d","M"+(st.l-3.5)+","+(st.t-.5+s)+"h3v"+-s+"h"+s+"v-3h-"+(s+3)+"ZM"+(st.r+3.5)+","+(st.t-.5+s)+"h-3v"+-s+"h"+-s+"v-3h"+(s+3)+"ZM"+(st.r+3.5)+","+(st.b+.5-s)+"h-3v"+s+"h"+-s+"v3h"+(s+3)+"ZM"+(st.l-3.5)+","+(st.b+.5-s)+"h3v"+s+"h"+s+"v3h-"+(s+3)+"Z")),st.w=st.r-st.l,st.h=st.b-st.t,ft.attr("d",ut+"M"+st.l+","+st.t+"v"+st.h+"h"+st.w+"v-"+st.h+"h-"+st.w+"Z"),ct||(ft.transition().style("fill",lt>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),dt.transition().style("opacity",1).duration(200),ct=!0)}function C(t,e,r){var n,i,a,o;for(n=0;n<t.length;n++)i=t[n],i.fixedrange||(a=i._rl[0],o=i._rl[1]-a,i.range=[i.l2r(a+o*e),i.l2r(a+o*r)])}function I(e,r){return Math.min(st.h,st.w)<2*Y?(2===r&&R(),a(t)):("xy"!==ht&&"x"!==ht||C(U,st.l/q,st.r/q),"xy"!==ht&&"y"!==ht||C(V,(H-st.b)/H,(H-st.t)/H),a(t),F(ht),void(b&&t.data&&t._context.showTips&&(h.notifier("Double-click to<br>zoom back out","long"),b=!1)))}function z(e,r){var i=1===(M+A).length;if(e)F();else if(2!==r||i){if(1===r&&i){var a=M?V[0]:U[0],o="s"===M||"w"===A?0:1,s=a._name+".range["+o+"]",l=n(a,o),c="left",h="middle";if(a.fixedrange)return;M?(h="n"===M?"top":"bottom","right"===a.side&&(c="right")):"e"===A&&(c="right"),rt.call(f.makeEditable,null,{immediate:!0,background:N.paper_bgcolor,text:String(l),fill:a.tickfont?a.tickfont.color:"#444",horizontalAlign:c,verticalAlign:h}).on("edit",function(e){var r=a.d2r(e);void 0!==r&&u.relayout(t,s,r)})}}else R()}function D(e){function r(t,e,r){function n(e){return t.l2r(a+(e-a)*r)}if(!t.fixedrange){var i=h.simpleMap(t.range,t.r2l),a=i[0]+(i[1]-i[0])*e;t.range=i.map(n)}}if(t._context.scrollZoom||N._enablescrollzoom){if(t._transitioningWithDuration)return h.pauseEvent(e);var n=t.querySelector(".plotly");if(T(),!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(yt);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),!isFinite(i))return void h.log("Did not find wheel motion attributes: ",e);var a,o=Math.exp(-Math.min(Math.max(i,-20),20)/100),s=bt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(e.clientX-s.left)/s.width,u=vt[0]+vt[2]*l,c=(s.bottom-e.clientY)/s.height,f=vt[1]+vt[3]*(1-c);if(A){for(a=0;a<U.length;a++)r(U[a],l,o);vt[2]*=o,vt[0]=u-vt[2]*l}if(M){for(a=0;a<V.length;a++)r(V[a],c,o);vt[3]*=o,vt[1]=f-vt[3]*(1-c)}return j(vt),O(M,A),yt=setTimeout(function(){vt=[0,0,q,H],F()},xt),h.pauseEvent(e)}}}function P(e,r){function n(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 i(t){return 1-(t>=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function a(t,e,r){for(var n,a,o=1-e,s=0;s<t.length;s++){var l=t[s];if(!l.fixedrange){n=l,a=l._rl[o]+(l._rl[e]-l._rl[o])/i(r/l._length);var u=l.l2r(a);u!==!1&&void 0!==u&&(l.range[e]=u)}}return n._length*(n._rl[e]-a)/(n._rl[e]-n._rl[o])}if(!t._transitioningWithDuration){if(T(),"ew"===Q||"ns"===$)return Q&&n(U,e),$&&n(V,r),j([Q?-e:0,$?-r:0,q,H]),void O($,Q);"w"===Q?e=a(U,0,e):"e"===Q?e=a(U,1,-e):Q||(e=0),"n"===$?r=a(V,1,r):"s"===$?r=a(V,0,-r):$||(r=0),j(["w"===Q?e:0,"n"===$?r:0,q-e,H-r]),O($,Q)}}function O(e,r){function n(t){for(a=0;a<t.length;a++)t[a].fixedrange||o.push(t[a]._id)}function i(n,i){for(a=0;a<n.length;a++){var s=n[a];(r&&o.indexOf(s.xref)!==-1||e&&o.indexOf(s.yref)!==-1)&&i(t,a)}}var a,o=[];for(r&&n(U),e&&n(V),a=0;a<o.length;a++)v.doTicks(t,o[a],!0);i(N.annotations||[],c.getComponentMethod("annotations","drawOne")),i(N.shapes||[],c.getComponentMethod("shapes","drawOne")),i(N.images||[],c.getComponentMethod("images","draw"))}function R(){if(!t._transitioningWithDuration){var e,r,n,i=t._context.doubleClick,a=(Q?U:[]).concat($?V:[]),o={};if("autosize"===i)for(r=0;r<a.length;r++)e=a[r],e.fixedrange||(o[e._name+".autorange"]=!0);else if("reset"===i)for(r=0;r<a.length;r++)e=a[r],e._rangeInitial?(n=e._rangeInitial.slice(),o[e._name+".range[0]"]=n[0],o[e._name+".range[1]"]=n[1]):o[e._name+".autorange"]=!0;else if("reset+autosize"===i)for(r=0;r<a.length;r++)e=a[r],e.fixedrange||(void 0===e._rangeInitial||e.range[0]===e._rangeInitial[0]&&e.range[1]===e._rangeInitial[1]?o[e._name+".autorange"]=!0:(n=e._rangeInitial.slice(),o[e._name+".range[0]"]=n[0],o[e._name+".range[1]"]=n[1]));t.emit("plotly_doubleclick",null),u.relayout(t,o)}}function F(e){for(var r={},n=0;n<K.length;n++){var i=K[n];e&&e.indexOf(i._id.charAt(0))===-1||(i._r[0]!==i.range[0]&&(r[i._name+".range[0]"]=i.range[0]),i._r[1]!==i.range[1]&&(r[i._name+".range[1]"]=i.range[1]),i.range=i._r.slice())}j([0,0,q,H]),u.relayout(t,r)}function j(t){for(var e,r=N._plots,n=Object.keys(r),i=0;i<n.length;i++){var a=r[n[i]],o=a.xaxis,s=a.yaxis,l=A&&!o.fixedrange,u=M&&!s.fixedrange;if(l){var c=!1;for(e=0;e<U.length;e++)if(U[e]._id===o._id){c=!0;break}l=l&&c}if(u){var f=!1;for(e=0;e<V.length;e++)if(V[e]._id===s._id){f=!0;break}u=u&&f}var d=l?o._length/t[2]:1,p=u?s._length/t[3]:1,m=l?t[0]:0,g=u?t[1]:0,v=l?t[0]/t[2]*o._length:0,y=u?t[1]/t[3]*s._length:0,x=o._offset-v,b=s._offset-y;N._defs.selectAll("#"+a.clipId).call(h.setTranslate,m,g).call(h.setScale,1/d,1/p),a.plot.call(h.setTranslate,x,b).call(h.setScale,d,p).selectAll(".points").selectAll(".point").call(h.setPointGroupScale,1/d,1/p)}}for(var N=t._fullLayout,B=[e].concat(M&&A?e.overlays:[]),U=[e.xaxis],V=[e.yaxis],q=U[0]._length,H=V[0]._length,Y=x.MINDRAG,G=x.MINZOOM,X=M+A==="nsew",W=1;W<B.length;W++){var Z=B[W].xaxis,J=B[W].yaxis;U.indexOf(Z)===-1&&U.push(Z),V.indexOf(J)===-1&&V.push(J)}var K=U.concat(V),Q=k(U,A),$=k(V,M),tt=i($+Q,N.dragmode),et=M+A+"drag",rt=e.draglayer.selectAll("."+et).data([0]);rt.enter().append("rect").classed("drag",!0).classed(et,!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",e.id),rt.call(p.setRect,r,s,_,w).call(m,tt);var nt=rt.node();if(!$&&!Q&&!o(N.dragmode))return nt.onmousedown=null,nt.style.pointerEvents=X?"all":"none",nt;var it={element:nt,gd:t,plotinfo:e,xaxes:U,yaxes:V,doubleclick:R,prepFn:function(e,r,n){var i=t._fullLayout.dragmode;X?e.shiftKey&&(i="pan"===i?"zoom":"pan"):i="pan","lasso"===i?it.minDrag=1:it.minDrag=void 0,"zoom"===i?(it.moveFn=L,it.doneFn=I,E(e,r,n)):"pan"===i?(it.moveFn=P,it.doneFn=z,S()):o(i)&&y(e,r,n,it,i)}};g.init(it);var at,ot,st,lt,ut,ct,ht,ft,dt,pt=t._fullLayout._zoomlayer,mt=e.xaxis._offset,gt=e.yaxis._offset,vt=[0,0,q,H],yt=null,xt=x.REDRAWDELAY,bt=e.mainplot?N._plots[e.mainplot]:e;return M.length*A.length!==1&&(void 0!==nt.onwheel?nt.onwheel=D:void 0!==nt.onmousewheel&&(nt.onmousewheel=D)),nt}},{"../../components/color":558,"../../components/dragelement":579,"../../components/drawing":581,"../../lib":658,"../../lib/setcursor":670,"../../lib/svg_text_utils":674,"../../plotly":686,"../../registry":766,"./axes":691,"./constants":696,"./select":704,d3:97,tinycolor2:495}],698:[function(t,e,r){"use strict";function n(t,e){for(var r=[],n=t.length;n>0;n--)r.push(e);return r}function i(t,e){for(var r=[],n=0;n<t.length;n++)r.push(t[n].p2c(e));return r}function a(t,e){return function(r){var n=t(r),i=e(r);return Math.sqrt(n*n+i*i)}}function o(t,e,r){if("pie"===r)return void t.emit("plotly_hover",{points:[e]});r||(r="xy");var a=Array.isArray(r)?r:[r],o=t._fullLayout,p=o._plots||[],y=p[r];if(y){var b=y.overlays.map(function(t){return t.id});a=a.concat(b)}for(var T=a.length,E=new Array(T),S=new Array(T),L=0;L<T;L++){var C=a[L],I=p[C];if(I)E[L]=A.getFromId(t,I.xaxis._id),S[L]=A.getFromId(t,I.yaxis._id);else{var z=o[C]._subplot;E[L]=z.xaxis,S[L]=z.yaxis}}var D=e.hovermode||o.hovermode;if(["x","y","closest"].indexOf(D)===-1||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return _.unhoverRaw(t,e);var P,O,R,F,j,N,B,U,V,q,H,Y,G,X=[],W=[];if(Array.isArray(e))for(D="array",R=0;R<e.length;R++)j=t.calcdata[e[R].curveNumber||0],"skip"!==j[0].trace.hoverinfo&&W.push(j);else{for(F=0;F<t.calcdata.length;F++)j=t.calcdata[F],N=j[0].trace,"skip"!==N.hoverinfo&&a.indexOf(s(N))!==-1&&W.push(j);var Z,J;if(e.target&&"clientX"in e&&"clientY"in e){if(v.triggerHandler(t,"plotly_beforehover",e)===!1)return;var K=e.target.getBoundingClientRect();if(Z=e.clientX-K.left,J=e.clientY-K.top,Z<0||Z>K.width||J<0||J>K.height)return _.unhoverRaw(t,e)}else Z="xpx"in e?e.xpx:E[0]._length/2,J="ypx"in e?e.ypx:S[0]._length/2;if(P="xval"in e?n(a,e.xval):i(E,Z),O="yval"in e?n(a,e.yval):i(S,J),!m(P[0])||!m(O[0]))return g.warn("Fx.hover failed",e,t),_.unhoverRaw(t,e)}var Q=1/0;for(F=0;F<W.length;F++)if(j=W[F],j&&j[0]&&j[0].trace&&j[0].trace.visible===!0){if(N=j[0].trace,B=s(N),U=a.indexOf(B),V=D,Y={cd:j,trace:N,xa:E[U],ya:S[U],name:t.data.length>1||N.hoverinfo.indexOf("name")!==-1?N.name:void 0,index:!1,distance:Math.min(Q,k.MAXDIST),color:x.defaultLine,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},o[B]&&(Y.subplot=o[B]._subplot),G=X.length,"array"===V){var $=e[F];"pointNumber"in $?(Y.index=$.pointNumber,V="closest"):(V="","xval"in $&&(q=$.xval,V="x"),"yval"in $&&(H=$.yval,V=V?"closest":"y"))}else q=P[U],H=O[U];if(N._module&&N._module.hoverPoints){var tt=N._module.hoverPoints(Y,q,H,V);if(tt)for(var et,rt=0;rt<tt.length;rt++)et=tt[rt],m(et.x0)&&m(et.y0)&&X.push(l(et,D))}else g.log("Unrecognized trace type in hover:",N);"closest"===D&&X.length>G&&(X.splice(0,G),Q=X[0].distance)}if(0===X.length)return _.unhoverRaw(t,e);var nt="y"===D&&W.length>1;X.sort(function(t,e){return t.distance-e.distance});var it=x.combine(o.plot_bgcolor||x.background,o.paper_bgcolor),at={hovermode:D,rotateLabels:nt,bgColor:it,container:o._hoverlayer,outerContainer:o._paperdiv},ot=u(X,at);c(X,nt?"xa":"ya"),h(ot,nt);var st=t._hoverdata,lt=[];for(R=0;R<X.length;R++){var ut=X[R],ct={data:ut.trace._input,fullData:ut.trace,curveNumber:ut.trace.index,pointNumber:ut.index};ut.trace._module.eventData?ct=ut.trace._module.eventData(ct,ut):(ct.x=ut.xVal,ct.y=ut.yVal,ct.xaxis=ut.xa,ct.yaxis=ut.ya,void 0!==ut.zLabelVal&&(ct.z=ut.zLabelVal)),lt.push(ct)}if(t._hoverdata=lt,e.target&&e.target.tagName){var ht=M.getComponentMethod("annotations","hasClickToShow")(t,lt);w(d.select(e.target),ht?"pointer":"")}f(t,e,st)&&(st&&t.emit("plotly_unhover",{points:st}),t.emit("plotly_hover",{points:t._hoverdata,xaxes:E,yaxes:S,xvals:P,yvals:O}))}function s(t){return t.subplot||t.xaxis+t.yaxis||t.geo}function l(t,e){t.posref="y"===e?(t.x0+t.x1)/2:(t.y0+t.y1)/2,t.x0=g.constrain(t.x0,0,t.xa._length),t.x1=g.constrain(t.x1,0,t.xa._length),t.y0=g.constrain(t.y0,0,t.ya._length),t.y1=g.constrain(t.y1,0,t.ya._length);var r;if(void 0!==t.xLabelVal){r="log"===t.xa.type&&t.xLabelVal<=0;var n=A.tickText(t.xa,t.xa.c2l(r?-t.xLabelVal:t.xLabelVal),"hover");r?0===t.xLabelVal?t.xLabel="0":t.xLabel="-"+n.text:t.xLabel=n.text,t.xVal=t.xa.c2d(t.xLabelVal)}if(void 0!==t.yLabelVal){r="log"===t.ya.type&&t.yLabelVal<=0;var i=A.tickText(t.ya,t.ya.c2l(r?-t.yLabelVal:t.yLabelVal),"hover");r?0===t.yLabelVal?t.yLabel="0":t.yLabel="-"+i.text:t.yLabel=i.text,t.yVal=t.ya.c2d(t.yLabelVal)}if(void 0!==t.zLabelVal&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var a=A.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+a+" / -"+A.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" ± "+a,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var o=A.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+o+" / -"+A.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" ± "+o,"y"===e&&(t.distance+=1)}var s=t.trace.hoverinfo;return"all"!==s&&(s=s.split("+"),s.indexOf("x")===-1&&(t.xLabel=void 0),s.indexOf("y")===-1&&(t.yLabel=void 0),s.indexOf("z")===-1&&(t.zLabel=void 0),s.indexOf("text")===-1&&(t.text=void 0),s.indexOf("name")===-1&&(t.name=void 0)),t}function u(t,e){var r,n,i=e.hovermode,a=e.rotateLabels,o=e.bgColor,s=e.container,l=e.outerContainer,u=t[0],c=u.xa,h=u.ya,f="y"===i?"yLabel":"xLabel",m=u[f],g=(String(m)||"").split(" ")[0],v=l.node().getBoundingClientRect(),_=v.top,w=v.width,M=v.height,A=u.distance<=k.MAXDIST&&("x"===i||"y"===i);for(r=0;r<t.length;r++){n=t[r].trace.hoverinfo;var T=n.split("+");if(T.indexOf("all")===-1&&T.indexOf(i)===-1){A=!1;break}}var E=s.selectAll("g.axistext").data(A?[0]:[]);E.enter().append("g").classed("axistext",!0),E.exit().remove(),E.each(function(){var e=d.select(this),r=e.selectAll("path").data([0]),n=e.selectAll("text").data([0]);r.enter().append("path").style({fill:x.defaultLine,"stroke-width":"1px",stroke:x.background}),n.enter().append("text").call(b.font,F,R,x.background).attr("data-notex",1),n.text(m).call(y.convertToTspans).call(b.setPosition,0,0).selectAll("tspan.line").call(b.setPosition,0,0),e.attr("transform","");var a=n.node().getBoundingClientRect();if("x"===i){n.attr("text-anchor","middle").call(b.setPosition,0,"top"===c.side?_-a.bottom-P-O:_-a.top+P+O).selectAll("tspan.line").attr({x:n.attr("x"),y:n.attr("y")});var o="top"===c.side?"-":"";r.attr("d","M0,0L"+P+","+o+P+"H"+(O+a.width/2)+"v"+o+(2*O+a.height)+"H-"+(O+a.width/2)+"V"+o+P+"H-"+P+"Z"),e.attr("transform","translate("+(c._offset+(u.x0+u.x1)/2)+","+(h._offset+("top"===c.side?0:h._length))+")")}else{n.attr("text-anchor","right"===h.side?"start":"end").call(b.setPosition,("right"===h.side?1:-1)*(O+P),_-a.top-a.height/2).selectAll("tspan.line").attr({x:n.attr("x"),y:n.attr("y")});var s="right"===h.side?"":"-";r.attr("d","M0,0L"+s+P+","+P+"V"+(O+a.height/2)+"h"+s+(2*O+a.width)+"V-"+(O+a.height/2)+"H"+s+P+"V-"+P+"Z"),e.attr("transform","translate("+(c._offset+("right"===h.side?c._length:0))+","+(h._offset+(u.y0+u.y1)/2)+")")}t=t.filter(function(t){return void 0!==t.zLabelVal||(t[f]||"").split(" ")[0]===g})});var S=s.selectAll("g.hovertext").data(t,function(t){return[t.trace.index,t.index,t.x0,t.y0,t.name,t.attr,t.xa,t.ya||""].join(",")});return S.enter().append("g").classed("hovertext",!0).each(function(){var t=d.select(this);t.append("rect").call(x.fill,x.addOpacity(o,.8)),t.append("text").classed("name",!0).call(b.font,F,R),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(b.font,F,R)}),S.exit().remove(),S.each(function(t){var e=d.select(this).attr("transform",""),r="",n="",s=x.opacity(t.color)?t.color:x.defaultLine,l=x.combine(s,o),u=p(l).getBrightness()>128?"#000":x.background;t.name&&void 0===t.zLabelVal&&(r=y.plainText(t.name||""),r.length>15&&(r=r.substr(0,12)+"...")),void 0!==t.extraText&&(n+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(n+="x: "+t.xLabel+"<br>"),void 0!==t.yLabel&&(n+="y: "+t.yLabel+"<br>"),n+=(n?"z: ":"")+t.zLabel):A&&t[i+"Label"]===m?n=t[("x"===i?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(n=t.yLabel):n=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(n+=(n?"<br>":"")+t.text),""===n&&(""===r&&e.remove(),n=r);var c=e.select("text.nums").style("fill",u).call(b.setPosition,0,0).text(n).attr("data-notex",1).call(y.convertToTspans);c.selectAll("tspan.line").call(b.setPosition,0,0);var h=e.select("text.name"),f=0;r&&r!==n?(h.style("fill",l).text(r).call(b.setPosition,0,0).attr("data-notex",1).call(y.convertToTspans),h.selectAll("tspan.line").call(b.setPosition,0,0),f=h.node().getBoundingClientRect().width+2*O):(h.remove(),e.select("rect").remove()),e.select("path").style({fill:l,stroke:u});var g,v,k=c.node().getBoundingClientRect(),T=t.xa._offset+(t.x0+t.x1)/2,E=t.ya._offset+(t.y0+t.y1)/2,S=Math.abs(t.x1-t.x0),C=Math.abs(t.y1-t.y0),I=k.width+P+O+f;t.ty0=_-k.top,t.bx=k.width+2*O,t.by=k.height+2*O,t.anchor="start",t.txwidth=k.width,t.tx2width=f,t.offset=0,a?(t.pos=T,g=E+C/2+I<=M,v=E-C/2-I>=0,"top"!==t.idealAlign&&g||!v?g?(E+=C/2,t.anchor="start"):t.anchor="middle":(E-=C/2,t.anchor="end")):(t.pos=E,g=T+S/2+I<=w,v=T-S/2-I>=0,"left"!==t.idealAlign&&g||!v?g?(T+=S/2,t.anchor="start"):t.anchor="middle":(T-=S/2,t.anchor="end")),c.attr("text-anchor",t.anchor),f&&h.attr("text-anchor",t.anchor),e.attr("transform","translate("+T+","+E+")"+(a?"rotate("+L+")":""))}),S}function c(t,e){function r(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var u=0;for(o=0;o<t.length;o++)l=t[o],l.pos+l.dp+l.size>e.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)l=t[o],l.pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o<t.length&&!(u<=0);o++)if(l=t[o],l.pos<e.pmin+1)for(l.del=!0,u--,a=2*l.size,s=t.length-1;s>=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(u<=0);o--)l=t[o],l.pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}for(var n,i,a,o,s,l,u,c=0,h=t.map(function(t,r){var n=t[e];return[{i:r,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===n._id.charAt(0)?I:1)/2,pmin:n._offset,pmax:n._offset+n._length}]}).sort(function(t,e){return t[0].posref-e[0].posref});!n&&c<=t.length;){for(c++,n=!0,o=0;o<h.length-1;){var f=h[o],d=h[o+1],p=f[f.length-1],m=d[0];if(i=p.pos+p.dp+p.size-m.pos-m.dp+m.size,i>.01&&p.pmin===m.pmin&&p.pmax===m.pmax){for(s=d.length-1;s>=0;s--)d[s].dp+=i;for(f.push.apply(f,d),h.splice(o+1,1),u=0,s=f.length-1;s>=0;s--)u+=f[s].dp;for(a=u/f.length,s=f.length-1;s>=0;s--)f[s].dp-=a;n=!1}else o++}h.forEach(r)}for(o=h.length-1;o>=0;o--){var g=h[o];for(s=g.length-1;s>=0;s--){var v=g[s],y=t[v.i];y.offset=v.dp,y.del=v.del}}}function h(t,e){t.each(function(t){var r=d.select(this);if(t.del)return void r.remove();var n="end"===t.anchor?-1:1,i=r.select("text.nums"),a={start:1,end:-1,middle:0}[t.anchor],o=a*(P+O),s=o+a*(t.txwidth+O),l=0,u=t.offset;"middle"===t.anchor&&(o-=t.tx2width/2,s-=t.tx2width/2),e&&(u*=-D,l=t.offset*z),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*P+l)+","+(P+u)+"v"+(t.by/2-P)+"h"+n*t.bx+"v-"+t.by+"H"+(n*P+l)+"V"+(u-P)+"Z"),i.call(b.setPosition,o+l,u+t.ty0-t.by/2+O).selectAll("tspan.line").attr({x:i.attr("x"),y:i.attr("y")}),t.tx2width&&(r.select("text.name, text.name tspan.line").call(b.setPosition,s+a*O+l,u+t.ty0-t.by/2+O),r.select("rect").call(b.setRect,s+(a-1)*t.tx2width/2+l,u-t.by/2-1,t.tx2width,t.by+2))})}function f(t,e,r){if(!e.target)return!1;if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber))return!0}return!1}var d=t("d3"),p=t("tinycolor2"),m=t("fast-isnumeric"),g=t("../../lib"),v=t("../../lib/events"),y=t("../../lib/svg_text_utils"),x=t("../../components/color"),b=t("../../components/drawing"),_=t("../../components/dragelement"),w=t("../../lib/override_cursor"),M=t("../../registry"),A=t("./axes"),k=t("./constants"),T=t("./dragbox"),E=t("../layout_attributes"),S=e.exports={};S.unhover=_.unhover,S.supplyLayoutDefaults=function(t,e,r){function n(r,n){return g.coerce(t,e,E,r,n)}n("dragmode");var i;if(e._has("cartesian")){var a=e._isHoriz=S.isHoriz(r);i=a?"y":"x"}else i="closest";n("hovermode",i)},S.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},S.init=function(t){var e=t._fullLayout;if(e._has("cartesian")&&!t._context.staticPlot){var r=Object.keys(e._plots||{}).sort(function(t,r){if((e._plots[t].mainplot&&!0)===(e._plots[r].mainplot&&!0)){var n=t.split("y"),i=r.split("y");return n[0]===i[0]?Number(n[1]||1)-Number(i[1]||1):Number(n[0]||1)-Number(i[0]||1)}return e._plots[t].mainplot?1:-1});r.forEach(function(r){var n=e._plots[r];if(e._has("cartesian")){var i=n.xaxis,a=n.yaxis,o=(i._linepositions[r]||[])[3],s=(a._linepositions[r]||[])[3],l=k.DRAGGERSIZE;if(m(o)&&"top"===i.side&&(o-=l),m(s)&&"right"!==a.side&&(s-=l),!n.mainplot){var u=T(t,n,0,0,i._length,a._length,"ns","ew");u.onmousemove=function(n){S.hover(t,n,r),e._lasthover=u,e._hoversubplot=r},u.onmouseout=function(e){t._dragging||_.unhover(t,e)},u.onclick=function(e){S.click(t,e)},T(t,n,-l,-l,l,l,"n","w"),T(t,n,i._length,-l,l,l,"n","e"),T(t,n,-l,a._length,l,l,"s","w"),T(t,n,i._length,a._length,l,l,"s","e")}m(o)&&("free"===i.anchor&&(o-=e._size.h*(1-a.domain[1])),T(t,n,.1*i._length,o,.8*i._length,l,"","ew"),T(t,n,0,o,.1*i._length,l,"","w"),T(t,n,.9*i._length,o,.1*i._length,l,"","e")),m(s)&&("free"===a.anchor&&(s-=e._size.w*i.domain[0]),T(t,n,s,.1*a._length,l,.8*a._length,"ns",""),T(t,n,s,.9*a._length,l,.1*a._length,"s",""),T(t,n,s,0,l,.1*a._length,"n",""))}});var n=e._hoverlayer.node();n.onmousemove=function(r){r.target=e._lasthover,S.hover(t,r,e._hoversubplot)},n.onclick=function(r){r.target=e._lasthover,S.click(t,r)},n.onmousedown=function(t){e._lasthover.onmousedown(t)}}};var L=k.YANGLE,C=Math.PI*L/180,I=1/Math.sin(C),z=Math.cos(C),D=Math.sin(C),P=k.HOVERARROWSIZE,O=k.HOVERTEXTPAD,R=k.HOVERFONTSIZE,F=k.HOVERFONT;S.hover=function(t,e,r){return"string"==typeof t&&(t=document.getElementById(t)),void 0===t._lastHoverTime&&(t._lastHoverTime=0),void 0!==t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),Date.now()>t._lastHoverTime+k.HOVERMINTIME?(o(t,e,r),void(t._lastHoverTime=Date.now())):void(t._hoverTimer=setTimeout(function(){o(t,e,r),t._lastHoverTime=Date.now(),t._hoverTimer=void 0},k.HOVERMINTIME))},S.getDistanceFunction=function(t,e,r,n){return"closest"===t?n||a(e,r):"x"===t?e:r},S.getClosest=function(t,e,r){if(r.index!==!1)r.index>=0&&r.index<t.length?r.distance=0:r.index=!1;else for(var n=0;n<t.length;n++){var i=e(t[n]);i<=r.distance&&(r.index=n,r.distance=i)}return r},S.loneHover=function(t,e){var r={color:t.color||x.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,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},n=d.select(e.container),i=e.outerContainer?d.select(e.outerContainer):n,a={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||x.background,container:n,outerContainer:i},o=u([r],a);return h(o,a.rotateLabels),o.node()},S.loneUnhover=function(t){var e=t instanceof d.selection?t:d.select(t);e.selectAll("g.hovertext").remove()},S.click=function(t,e){function r(){t.emit("plotly_click",{points:t._hoverdata})}var n=M.getComponentMethod("annotations","onClick")(t,t._hoverdata);t._hoverdata&&e&&e.target&&(n&&n.then?n.then(r):r(),e.stopImmediatePropagation&&e.stopImmediatePropagation())},S.inbox=function(t,e){return t*e<0||0===t?k.MAXDIST*(.6-.3/Math.max(3,Math.abs(t-e))):1/0}},{"../../components/color":558,"../../components/dragelement":579,"../../components/drawing":581,"../../lib":658,"../../lib/events":650,"../../lib/override_cursor":666,"../../lib/svg_text_utils":674,"../../registry":766,"../layout_attributes":742,"./axes":691,"./constants":696,"./dragbox":697,d3:97,"fast-isnumeric":106,tinycolor2:495}],699:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=t._fullLayout,o=a._modules;e.plot&&e.plot.selectAll("g:not(.scatterlayer)").selectAll("g.trace").remove();for(var s=0;s<o.length;s++){var l=o[s];if("cartesian"===l.basePlotModule.name){for(var u=[],c=0;c<r.length;c++){var h=r[c],f=h[0].trace;f._module===l&&f.visible===!0&&u.push(h)}l.plot(t,e,u,n,i)}}}function i(t){for(var e=t._fullLayout,r=Object.keys(e._plots),n=[],i=[],a=0;a<r.length;a++){var o=r[a],s=e._plots[o],l=s.xaxis,u=s.yaxis,c=h.getFromId(t,l.overlaying)||l;c!==l&&c.overlaying&&(c=l,l.overlaying=!1);var f=h.getFromId(t,u.overlaying)||u;f!==u&&f.overlaying&&(f=u,u.overlaying=!1);var d=c._id+f._id;d!==o&&r.indexOf(d)!==-1?(s.mainplot=d,s.mainplotinfo=e._plots[d],i.push(o),l.domain=c.domain.slice(),u.domain=f.domain.slice()):n.push(o)}return n=n.concat(i)}function a(t){function e(t){s(t,"g","imagelayer"),s(t,"g","maplayer"),s(t,"g","barlayer"),s(t,"g","boxlayer"),s(t,"g","scatterlayer")}var r=t.plotgroup,n=t.id;if(t.mainplot){var i=t.mainplotinfo;t.gridlayer=s(i.overgrid,"g",n),t.zerolinelayer=s(i.overzero,"g",n),t.plot=s(i.overplot,"g",n),t.xlines=s(i.overlines,"path",n),t.ylines=s(i.overlines,"path",n),t.xaxislayer=s(i.overaxes,"g",n),t.yaxislayer=s(i.overaxes,"g",n)}else{t.bg=s(r,"rect","bg"),t.bg.style("stroke-width",0);var a=s(r,"g","layer-subplot");t.shapelayer=s(a,"g","shapelayer"),t.imagelayer=s(a,"g","imagelayer"),t.gridlayer=s(r,"g","gridlayer"),t.overgrid=s(r,"g","overgrid"),t.zerolinelayer=s(r,"g","zerolinelayer"),t.overzero=s(r,"g","overzero"),t.plot=s(r,"g","plot"),t.overplot=s(r,"g","overplot"),t.xlines=s(r,"path","xlines"),t.ylines=s(r,"path","ylines"),t.overlines=s(r,"g","overlines"),t.xaxislayer=s(r,"g","xaxislayer"),t.yaxislayer=s(r,"g","yaxislayer"),t.overaxes=s(r,"g","overaxes")}t.plot.call(e),t.xlines.style("fill","none").classed("crisp",!0),t.ylines.style("fill","none").classed("crisp",!0)}function o(t,e){t&&t.each(function(t){var r=l.select(this),n="clip"+e._uid+t+"plot";r.remove(),e._draggers.selectAll("g."+t).remove(),e._defs.select("#"+n).remove()})}function s(t,e,r){var n=t.selectAll("."+r).data([0]);return n.enter().append(e).classed(r,!0),n}var l=t("d3"),u=t("../../lib"),c=t("../plots"),h=t("./axes"),f=t("./constants");r.name="cartesian",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=f.idRegex,r.attrRegex=f.attrRegex,r.attributes=t("./attributes"),r.layoutAttributes=t("./layout_attributes"),r.transitionAxes=t("./transition_axes"),r.plot=function(t,e,r,i){var a,o=t._fullLayout,s=c.getSubplotIds(o,"cartesian"),l=t.calcdata;if(!Array.isArray(e))for(e=[],a=0;a<l.length;a++)e.push(a);for(a=0;a<s.length;a++){for(var u,h=s[a],f=o._plots[h],d=[],p=0;p<l.length;p++){var m=l[p],g=m[0].trace;g.xaxis+g.yaxis===h&&(e.indexOf(g.index)!==-1&&(u&&u[0].trace.xaxis+u[0].trace.yaxis===h&&["tonextx","tonexty","tonext"].indexOf(g.fill)!==-1&&d.indexOf(u)===-1&&d.push(u),d.push(m)),u=m)}n(t,f,d,r,i)}},r.clean=function(t,e,r,n){var i,a,s,l=n._modules||[],u=e._modules||[];for(s=0;s<l.length;s++)if("scatter"===l[s].name){i=!0;break}for(s=0;s<u.length;s++)if("scatter"===u[s].name){a=!0;break}if(i&&!a){var c=n._plots,h=Object.keys(c||{});for(s=0;s<h.length;s++){var f=c[h[s]];f.plot&&f.plot.select("g.scatterlayer").selectAll("g.trace").remove()}}var d=n._has&&n._has("cartesian"),p=e._has&&e._has("cartesian");if(d&&!p){var m=n._cartesianlayer.selectAll(".subplot");m.call(o,n),n._defs.selectAll(".axesclip").remove()}},r.drawFramework=function(t){var e=t._fullLayout,r=i(t),n=e._cartesianlayer.selectAll(".subplot").data(r,u.identity);n.enter().append("g").attr("class",function(t){return"subplot "+t}),n.order(),n.exit().call(o,e),n.each(function(t){var r=e._plots[t];if(r.plotgroup=l.select(this),r.overlays=[],a(r),r.mainplot){var n=e._plots[r.mainplot];n.overlays.push(r)}r.draglayer=s(e._draggers,"g",t)})},r.rangePlot=function(t,e,r){a(e),n(t,e,r),c.style(t)}},{"../../lib":658,"../plots":751,"./attributes":690,"./axes":691,"./constants":696,"./layout_attributes":700,"./transition_axes":709,d3:97}],700:[function(t,e,r){"use strict";var n=t("../font_attributes"),i=t("../../components/color/attributes"),a=t("../../lib/extend").extendFlat,o=t("./constants");e.exports={color:{valType:"color",dflt:i.defaultLine},title:{valType:"string"},titlefont:a({},n,{}),type:{valType:"enumerated",values:["-","linear","log","date","category"],dflt:"-"},autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal"},range:{valType:"info_array",items:[{valType:"any"},{valType:"any"}]},fixedrange:{valType:"boolean",dflt:!1},tickmode:{valType:"enumerated",values:["auto","linear","array"]},nticks:{valType:"integer",min:0,dflt:0},tick0:{valType:"any"},dtick:{valType:"any"},tickvals:{valType:"data_array"},ticktext:{valType:"data_array"},ticks:{valType:"enumerated",values:["outside","inside",""]},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1},ticklen:{valType:"number",min:0,dflt:5},tickwidth:{valType:"number",min:0,dflt:1},tickcolor:{valType:"color",dflt:i.defaultLine},showticklabels:{valType:"boolean",dflt:!0},tickfont:a({},n,{}),tickangle:{valType:"angle",dflt:"auto"},tickprefix:{valType:"string",dflt:""},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},ticksuffix:{valType:"string",dflt:""},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B"},separatethousands:{valType:"boolean",dflt:!1},tickformat:{valType:"string",dflt:""},hoverformat:{valType:"string",dflt:""},showline:{valType:"boolean",dflt:!1},linecolor:{valType:"color",dflt:i.defaultLine},linewidth:{valType:"number",min:0,dflt:1},showgrid:{valType:"boolean"},gridcolor:{valType:"color",dflt:i.lightLine},gridwidth:{valType:"number",min:0,dflt:1},zeroline:{valType:"boolean"},zerolinecolor:{valType:"color",dflt:i.defaultLine},zerolinewidth:{valType:"number",dflt:1},anchor:{valType:"enumerated",values:["free",o.idRegex.x.toString(),o.idRegex.y.toString()]},side:{valType:"enumerated",values:["top","bottom","left","right"]},overlaying:{valType:"enumerated",values:["free",o.idRegex.x.toString(),o.idRegex.y.toString()]},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},position:{valType:"number",min:0,max:1,dflt:0},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace"},categoryarray:{valType:"data_array"},_deprecated:{autotick:{valType:"boolean"}}}},{"../../components/color/attributes":557,"../../lib/extend":651,"../font_attributes":711,"./constants":696}],701:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/color"),o=t("../layout_attributes"),s=t("./constants"),l=t("./layout_attributes"),u=t("./axis_defaults"),c=t("./position_defaults"),h=t("./axis_ids");e.exports=function(t,e,r){function f(t,e){var r=Number(t.substr(5)||1),n=Number(e.substr(5)||1);return r-n}function d(t,e){return i.coerce(P,O,l,t,e)}var p,m=Object.keys(t),g=[],v=[],y=[],x=[],b={},_={};for(p=0;p<r.length;p++){var w,M,A=r[p];if(n.traceIs(A,"cartesian"))w=g,M=v;else{if(!n.traceIs(A,"gl2d"))continue;w=y,M=x}var k=h.id2name(A.xaxis),T=h.id2name(A.yaxis);if(k&&w.indexOf(k)===-1&&w.push(k),T&&M.indexOf(T)===-1&&M.push(T),n.traceIs(A,"2dMap")&&(b[k]=!0,b[T]=!0),n.traceIs(A,"oriented")){var E="h"===A.orientation?T:k;_[E]=!0}}var S=e._has("gl3d")||e._has("geo");if(!S)for(p=0;p<m.length;p++){var L=m[p];y.indexOf(L)===-1&&g.indexOf(L)===-1&&s.xAxisMatch.test(L)?g.push(L):x.indexOf(L)===-1&&v.indexOf(L)===-1&&s.yAxisMatch.test(L)&&v.push(L)}g.length&&v.length&&i.pushUnique(e._basePlotModules,n.subplotsRegistry.cartesian);var C=g.concat(y).sort(f),I=v.concat(x).sort(f),z=C.concat(I),D=a.background;C.length&&I.length&&(D=i.coerce(t,e,o,"plot_bgcolor"));var P,O,R=a.combine(D,e.paper_bgcolor);z.forEach(function(n){var i=n.charAt(0);P=t[n]||{},O={};var a={letter:i,font:e.font,outerTicks:b[n],showGrid:!_[n],name:n,data:r,bgColor:R,calendar:e.calendar};u(P,O,d,a,e);var o={letter:i,counterAxes:{x:I,y:C}[i].map(h.name2id),overlayableAxes:{x:C,y:I}[i].filter(function(e){return e!==n&&!(t[e]||{}).overlaying}).map(h.name2id)};c(P,O,d,o),e[n]=O,t[n]||"-"===P.type||(t[n]={type:P.type})});var F=n.getComponentMethod("rangeslider","handleDefaults"),j=n.getComponentMethod("rangeselector","handleDefaults");C.forEach(function(r){P=t[r],O=e[r],F(t,e,r),"date"===O.type&&j(P,O,e,I,O.calendar),d("fixedrange")}),I.forEach(function(r){P=t[r],O=e[r];var n=e[h.id2name(O.anchor)],i=n&&n.rangeslider&&n.rangeslider.visible;d("fixedrange",i)})}},{"../../components/color":558,"../../lib":658,"../../registry":766,"../layout_attributes":742,"./axis_defaults":693,"./axis_ids":694,"./constants":696,"./layout_attributes":700,"./position_defaults":703}],702:[function(t,e,r){"use strict";function n(t,e,r){var n,a,o,s,l,u=[],c=r.map(function(e){return e[t]}),h=i.bisector(e).left;for(n=0;n<c.length;n++)for(o=c[n],a=0;a<o.length;a++)s=o[a],null!==s&&void 0!==s&&(l=h(u,s),l<u.length&&u[l]===s||u.splice(l,0,s));return u}var i=t("d3");e.exports=function(t,e,r,a){switch(e){case"array":return Array.isArray(r)?r.slice():[];case"category ascending":return n(t,i.ascending,a);case"category descending":return n(t,i.descending,a);case"trace":return[];default:return[]}}},{d3:97}],703:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib");e.exports=function(t,e,r,a){var o=a.counterAxes||[],s=a.overlayableAxes||[],l=a.letter,u=i.coerce(t,e,{anchor:{valType:"enumerated",values:["free"].concat(o),dflt:n(t.position)?"free":o[0]||"free"}},"anchor");"free"===u&&r("position"),i.coerce(t,e,{side:{valType:"enumerated",values:"x"===l?["bottom","top"]:["left","right"],dflt:"x"===l?"bottom":"left"}},"side");var c=!1;if(s.length&&(c=i.coerce(t,e,{overlaying:{valType:"enumerated",values:[!1].concat(s),dflt:!1}},"overlaying")),!c){var h=r("domain");h[0]>h[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return e}},{"../../lib":658,"fast-isnumeric":106}],704:[function(t,e,r){"use strict";function n(t){return t._id}var i=t("../../lib/polygon"),a=t("../../components/color"),o=t("./axes"),s=t("./constants"),l=i.filter,u=i.tester,c=s.MINSELECT;e.exports=function(t,e,r,i,h){function f(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return t.p2d(r[e])}}function d(t,e){return t-e}var p,m=i.gd._fullLayout._zoomlayer,g=i.element.getBoundingClientRect(),v=i.plotinfo.xaxis._offset,y=i.plotinfo.yaxis._offset,x=e-g.left,b=r-g.top,_=x,w=b,M="M"+x+","+b,A=i.xaxes[0]._length,k=i.yaxes[0]._length,T=i.xaxes.map(n),E=i.yaxes.map(n),S=i.xaxes.concat(i.yaxes);"lasso"===h&&(p=l([[x,b]],s.BENDPX));var L=m.selectAll("path.select-outline").data([1,2]);L.enter().append("path").attr("class",function(t){return"select-outline select-outline-"+t}).attr("transform","translate("+v+", "+y+")").attr("d",M+"Z");var C,I,z,D,P,O=m.append("path").attr("class","zoombox-corners").style({fill:a.background,stroke:a.defaultLine,"stroke-width":1}).attr("transform","translate("+v+", "+y+")").attr("d","M0,0Z"),R=[],F=i.gd,j=[];for(C=0;C<F.calcdata.length;C++)if(I=F.calcdata[C],z=I[0].trace,z._module&&z._module.selectPoints)if(i.subplot){if(z.subplot!==i.subplot)continue;R.push({selectPoints:z._module.selectPoints,cd:I,xaxis:i.xaxes[0],yaxis:i.yaxes[0]})}else{if(T.indexOf(z.xaxis)===-1)continue;if(E.indexOf(z.yaxis)===-1)continue;R.push({selectPoints:z._module.selectPoints,cd:I,xaxis:o.getFromId(F,z.xaxis),yaxis:o.getFromId(F,z.yaxis)})}i.moveFn=function(t,e){var r,n;_=Math.max(0,Math.min(A,t+x)),w=Math.max(0,Math.min(k,e+b));var a=Math.abs(_-x),o=Math.abs(w-b);for("select"===h?(o<Math.min(.6*a,c)?(r=u([[x,0],[x,k],[_,k],[_,0]]),O.attr("d","M"+r.xmin+","+(b-c)+"h-4v"+2*c+"h4ZM"+(r.xmax-1)+","+(b-c)+"h4v"+2*c+"h-4Z")):a<Math.min(.6*o,c)?(r=u([[0,b],[0,w],[A,w],[A,b]]),O.attr("d","M"+(x-c)+","+r.ymin+"v-4h"+2*c+"v4ZM"+(x-c)+","+(r.ymax-1)+"v4h"+2*c+"v-4Z")):(r=u([[x,b],[x,w],[_,w],[_,b]]),O.attr("d","M0,0Z")),L.attr("d","M"+r.xmin+","+r.ymin+"H"+(r.xmax-1)+"V"+(r.ymax-1)+"H"+r.xmin+"Z")):"lasso"===h&&(p.addPt([_,w]),r=u(p.filtered),L.attr("d","M"+p.filtered.join("L")+"Z")),j=[],C=0;C<R.length;C++)D=R[C],[].push.apply(j,D.selectPoints(D,r));if(P={points:j},"select"===h){var s,l=P.range={};for(C=0;C<S.length;C++)n=S[C],s=n._id.charAt(0),l[n._id]=[n.p2d(r[s+"min"]),n.p2d(r[s+"max"])].sort(d)}else{var m=P.lassoPoints={};for(C=0;C<S.length;C++)n=S[C],m[n._id]=p.filtered.map(f(n))}i.gd.emit("plotly_selecting",P)},i.doneFn=function(t,e){if(O.remove(),t||2!==e)i.gd.emit("plotly_selected",P);else{for(L.remove(),C=0;C<R.length;C++)D=R[C],D.selectPoints(D,!1);F.emit("plotly_deselect",null)}}}},{"../../components/color":558,"../../lib/polygon":667,"./axes":691,"./constants":696}],705:[function(t,e,r){"use strict";function n(t){return Math.pow(10,t)}function i(t){return o(t)?(t=Number(t),t<-f||t>f?d:o(t)?Number(t):d):d}var a=t("d3"),o=t("fast-isnumeric"),s=t("../../lib"),l=s.cleanNumber,u=s.ms2DateTime,c=s.dateTime2ms,h=t("../../constants/numerical"),f=h.FP_SAFE,d=h.BADNUM,p=t("./constants"),m=t("./axis_ids");e.exports=function(t){function e(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-3*_*Math.abs(n-i))}return d}function r(e,r,n){var i=c(e,n||t.calendar);if(i===d){if(!o(e))return d;i=c(new Date(+e))}return i}function h(e,r,n){return u(e,r,n||t.calendar)}function g(e){return t._categories[Math.round(e)]}function v(e){if(null!==e&&void 0!==e){var r=t._categories.indexOf(e);return r===-1?(t._categories.push(e),t._categories.length-1):r}return d}function y(e){var r=t._categories.indexOf(e);return r!==-1?r:"number"==typeof e?e:void 0}function x(e){return o(e)?a.round(t._b+t._m*e,2):d}function b(e){return(e-t._b)/t._m}var _=10;t.c2l="log"===t.type?e:i,t.l2c="log"===t.type?n:i,t.l2p=x,t.p2l=b,t.c2p="log"===t.type?function(t,r){return x(e(t,r))}:x,t.p2c="log"===t.type?function(t){return n(b(t))}:b,["linear","-"].indexOf(t.type)!==-1?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=i,t.d2p=t.r2p=function(t){return x(l(t))},t.p2d=t.p2r=b):"log"===t.type?(t.d2r=t.d2l=function(t,r){return e(l(t),r)},t.r2d=t.r2c=function(t){return n(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=i,t.c2r=e,t.l2d=n,t.d2p=function(e,r){return x(t.d2r(e,r))},t.p2d=function(t){return n(b(t))},t.r2p=function(t){return x(l(t))},t.p2r=b):"date"===t.type?(t.d2r=t.r2d=s.identity,t.d2c=t.r2c=t.d2l=t.r2l=r,t.c2d=t.c2r=t.l2d=t.l2r=h,t.d2p=t.r2p=function(t,e,n){return x(r(t,0,n))},t.p2d=t.p2r=function(t,e,r){return h(b(t),e,r)}):"category"===t.type&&(t.d2r=t.d2c=t.d2l=v,t.r2d=t.c2d=t.l2d=g,t.d2l_noadd=y,t.r2l=t.l2r=t.r2c=t.c2r=i,t.d2p=function(t){return x(y(t))},t.p2d=function(t){return g(b(t))},t.r2p=x,t.p2r=b),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){e||(e="range");var r,n,i=t[e],a=(t._id||"x").charAt(0);if(n="date"===t.type?s.dfltRange(t.calendar):"y"===a?p.DFLTRANGEY:p.DFLTRANGEX,n=n.slice(),!i||2!==i.length)return void(t[e]=n);for("date"===t.type&&(i[0]=s.cleanDate(i[0],d,t.calendar),i[1]=s.cleanDate(i[1],d,t.calendar)),r=0;r<2;r++)if("date"===t.type){if(!s.isDateTime(i[r],t.calendar)){t[e]=n;break}if(t.r2l(i[0])===t.r2l(i[1])){var l=s.constrain(t.r2l(i[0]),s.MIN_MS+1e3,s.MAX_MS-1e3);i[0]=t.l2r(l-1e3),i[1]=t.l2r(l+1e3);break}}else{if(!o(i[r])){if(!o(i[1-r])){t[e]=n;break}i[r]=i[1-r]*(r?10:.1)}if(i[r]<-f?i[r]=-f:i[r]>f&&(i[r]=f),i[0]===i[1]){var u=Math.max(1,Math.abs(1e-6*i[0]));i[0]-=u,i[1]+=u}}},t.setScale=function(e){var r=t._gd._fullLayout._size,n=t._id.charAt(0);if(t._categories||(t._categories=[]),t.overlaying){var i=m.getFromId(t._gd,t.overlaying);t.domain=i.domain}var a=e&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var l=t.r2l(t[a][0],o),u=t.r2l(t[a][1],o);if("y"===n?(t._offset=r.t+(1-t.domain[1])*r.h,t._length=r.h*(t.domain[1]-t.domain[0]),t._m=t._length/(l-u),t._b=-t._m*u):(t._offset=r.l+t.domain[0]*r.w,t._length=r.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-l),t._b=-t._m*l),!isFinite(t._m)||!isFinite(t._b))throw s.notifier("Something went wrong with axis scaling","long"),t._gd._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,r){var n,i,a,o="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],i=new Array(n.length),a=0;a<n.length;a++)i[a]=t.d2c(n[a],0,o);else{var s=r+"0"in e?t.d2c(e[r+"0"],0,o):0,l=e["d"+r]?Number(e["d"+r]):1;for(n=e[{x:"y",y:"x"}[r]],i=new Array(n.length),a=0;a<n.length;a++)i[a]=s+a*l}return i},t._min=[],t._max=[],delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":641,"../../lib":658,"./axis_ids":694,"./constants":696,d3:97,"fast-isnumeric":106}],706:[function(t,e,r){"use strict";function n(t){var e=["showexponent","showtickprefix","showticksuffix"],r=e.filter(function(e){return void 0!==t[e]}),n=function(e){return t[e]===t[r[0]]};if(r.every(n)||1===r.length)return t[r[0]]}var i=t("../../lib");e.exports=function(t,e,r,a,o){var s=n(t),l=r("tickprefix");l&&r("showtickprefix",s);var u=r("ticksuffix");u&&r("showticksuffix",s);var c=r("showticklabels");if(c){var h=o.font||{},f=e.color===t.color?e.color:h.color;if(i.coerceFont(r,"tickfont",{family:h.family,size:h.size,color:f}),r("tickangle"),"category"!==a){var d=r("tickformat");d||"date"===a||(r("showexponent",s),r("exponentformat"),r("separatethousands"))}}"category"===a||o.noHover||r("hoverformat")}},{"../../lib":658}],707:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r,a){var o=n.coerce2(t,e,i,"ticklen"),s=n.coerce2(t,e,i,"tickwidth"),l=n.coerce2(t,e,i,"tickcolor",e.color),u=r("ticks",a.outerTicks||o||s||l?"outside":"");u||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":658,"./layout_attributes":700}],708:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,r,o){var s="auto";"array"!==t.tickmode||"log"!==o&&"date"!==o||(t.tickmode="auto"),Array.isArray(t.tickvals)?s="array":t.dtick&&(s="linear");var l=r("tickmode",s);if("auto"===l)r("nticks");else if("linear"===l){var u="date"===o?a:1,c=r("dtick",u);if(n(c))e.dtick=c>0?Number(c):u;else if("string"!=typeof c)e.dtick=u;else{var h=c.charAt(0),f=c.substr(1);f=n(f)?Number(f):0,(f<=0||!("date"===o&&"M"===h&&f===Math.round(f)||"log"===o&&"L"===h||"log"===o&&"D"===h&&(1===f||2===f)))&&(e.dtick=u)}var d="date"===o?i.dateTick0(e.calendar):0,p=r("tick0",d);"date"===o?e.tick0=i.cleanDate(p,d):n(p)&&"D1"!==c&&"D2"!==c?e.tick0=Number(p):e.tick0=d}else{var m=r("tickvals");void 0===m?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":641,"../../lib":658,"fast-isnumeric":106}],709:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plotly"),a=t("../../registry"),o=t("../../lib"),s=t("./axes"),l=/((x|y)([2-9]|[1-9][0-9]+)?)axis$/;e.exports=function(t,e,r,u){function c(t){var e,r,n,i,a,o={};for(e in t)if(r=e.split("."),n=r[0].match(l)){var s=n[1],u=s+"axis";if(i=y[u],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=u,a.length=i._length,x.push(s),o[s]=a}return o}function h(t,e,r){var n,i,a,o=t._plots,s=[];for(n in o){var l=o[n];if(s.indexOf(l)===-1){var u=l.xaxis._id,c=l.yaxis._id,h=l.xaxis.range,f=l.yaxis.range;l.xaxis._r=l.xaxis.range.slice(),l.yaxis._r=l.yaxis.range.slice(),i=r[u]?r[u].to:h,a=r[c]?r[c].to:f,h[0]===i[0]&&h[1]===i[1]&&f[0]===a[0]&&f[1]===a[1]||e.indexOf(u)===-1&&e.indexOf(c)===-1||s.push(l)}}return s}function f(e,r){function n(e,r){for(i=0;i<e.length;i++){var n=e[i];o.indexOf(n.xref)===-1&&o.indexOf(n.yref)===-1||r(t,i)}}var i,o=[];for(o=[e._id,r._id],i=0;i<o.length;i++)s.doTicks(t,o[i],!0);n(y.annotations||[],a.getComponentMethod("annotations","drawOne")),n(y.shapes||[],a.getComponentMethod("shapes","drawOne")),n(y.images||[],a.getComponentMethod("images","draw"))}function d(t){var e=t.xaxis,r=t.yaxis;y._defs.selectAll("#"+t.clipId).call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1,1)}function p(e,r){var n,i,a,s=b[e.xaxis._id],l=b[e.yaxis._id],u=[];if(s){n=t._fullLayout[s.axisName],i=n._r,a=s.to,u[0]=(i[0]*(1-r)+r*a[0]-i[0])/(i[1]-i[0])*e.xaxis._length;var c=i[1]-i[0],h=a[1]-a[0];n.range[0]=i[0]*(1-r)+r*a[0],n.range[1]=i[1]*(1-r)+r*a[1],u[2]=e.xaxis._length*(1-r+r*h/c)}else u[0]=0,u[2]=e.xaxis._length;if(l){n=t._fullLayout[l.axisName],i=n._r,a=l.to,u[1]=(i[1]*(1-r)+r*a[1]-i[1])/(i[0]-i[1])*e.yaxis._length;var d=i[1]-i[0],p=a[1]-a[0];n.range[0]=i[0]*(1-r)+r*a[0],n.range[1]=i[1]*(1-r)+r*a[1],u[3]=e.yaxis._length*(1-r+r*p/d)}else u[1]=0,u[3]=e.yaxis._length;f(e.xaxis,e.yaxis);var m=e.xaxis,g=e.yaxis,v=!!s,x=!!l,_=v?m._length/u[2]:1,w=x?g._length/u[3]:1,M=v?u[0]:0,A=x?u[1]:0,k=v?u[0]/u[2]*m._length:0,T=x?u[1]/u[3]*g._length:0,E=m._offset-k,S=g._offset-T;y._defs.selectAll("#"+e.clipId).call(o.setTranslate,M,A).call(o.setScale,1/_,1/w),e.plot.call(o.setTranslate,E,S).call(o.setScale,_,w).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/_,1/w)}function m(){for(var e={},r=0;r<_.length;r++){var n=t._fullLayout[b[_[r]].axisName],a=b[_[r]].to;e[n._name+".range[0]"]=a[0],e[n._name+".range[1]"]=a[1],n.range=a.slice()}return M&&M(),i.relayout(t,e).then(function(){for(var t=0;t<w.length;t++)d(w[t])})}function g(){for(var e={},r=0;r<_.length;r++){var n=t._fullLayout[_[r]+"axis"];e[n._name+".range[0]"]=n.range[0],e[n._name+".range[1]"]=n.range[1],n.range=n._r.slice()}return i.relayout(t,e).then(function(){for(var t=0;t<w.length;t++)d(w[t])})}function v(){k=Date.now();for(var t=Math.min(1,(k-A)/r.duration),e=E(t),n=0;n<w.length;n++)p(w[n],e);k-A>r.duration?(m(),T=window.cancelAnimationFrame(v)):T=window.requestAnimationFrame(v)}var y=t._fullLayout,x=[],b=c(e),_=Object.keys(b),w=h(y,_,b);if(!w.length)return!1;var M;u&&(M=u());var A,k,T,E=n.ease(r.easing);return t._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(T),T=null,g()}),A=Date.now(),T=window.requestAnimationFrame(v),Promise.resolve()}},{"../../lib":658,"../../plotly":686,"../../registry":766,"./axes":691,d3:97}],710:[function(t,e,r){"use strict";function n(t,e,r){var n,i,a,o=!1;if("data"===e.type)n=t._fullData[null!==e.traces?e.traces[0]:0];else{if("layout"!==e.type)return!1;n=t._fullLayout}return i=u.nestedProperty(n,e.prop).get(),a=r[e.type]=r[e.type]||{},a.hasOwnProperty(e.prop)&&a[e.prop]!==i&&(o=!0),a[e.prop]=i,{changed:o,value:i}}function i(t,e){return Array.isArray(e[0])&&1===e[0].length&&["string","number"].indexOf(typeof e[0][0])!==-1?[{type:"layout",prop:"_currentFrame",value:e[0][0].toString()}]:[]}function a(t,e){var r=[],n=e[0],i={};if("string"==typeof n)i[n]=e[1];else{if(!u.isPlainObject(n))return r;i=n}return s(i,function(t,e,n){r.push({type:"layout",prop:t,value:n})},"",0),r}function o(t,e){var r,n,i,a,o=[];if(n=e[0],i=e[1],r=e[2],a={},"string"==typeof n)a[n]=i;else{if(!u.isPlainObject(n))return o;a=n,void 0===r&&(r=i)}return void 0===r&&(r=null),s(a,function(e,n,i){var a;if(Array.isArray(i)){var s=Math.min(i.length,t.data.length);r&&(s=Math.min(s,r.length)),a=[];for(var l=0;l<s;l++)a[l]=r?r[l]:l}else a=r?r.slice(0):null;if(null===a)Array.isArray(i)&&(i=i[0]);else if(Array.isArray(a)){if(!Array.isArray(i)){var u=i;i=[];for(var c=0;c<a.length;c++)i[c]=u}i.length=Math.min(a.length,i.length)}o.push({type:"data",prop:e,traces:a,value:i})},"",0),o}function s(t,e,r,n){Object.keys(t).forEach(function(i){var a=t[i];if("_"!==i[0]){var o=r+(n>0?".":"")+i;u.isPlainObject(a)?s(a,e,o,n+1):e(o,i,a)}})}var l=t("../plotly"),u=t("../lib");r.manageCommandObserver=function(t,e,i,a){var o={},s=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var l=r.hasSimpleAPICommandBindings(t,i,o.lookupTable);if(e&&e._commandObserver){if(l)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(l){n(t,l,o.cache),o.check=function(){if(s){var e=n(t,l,o.cache);return e.changed&&a&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(a({value:e.value,type:l.type,prop:l.prop,traces:l.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],h=0;h<c.length;h++)t._internalOn(c[h],o.check);o.remove=function(){for(var e=0;e<c.length;e++)t._removeInternalListener(c[e],o.check)}}else u.warn("Unable to automatically bind plot updates to API command"),o.lookupTable={},o.remove=function(){};return o.disable=function(){s=!1},o.enable=function(){s=!0},e&&(e._commandObserver=o),o},r.hasSimpleAPICommandBindings=function(t,e,n){var i,a,o=e.length;for(i=0;i<o;i++){var s,l=e[i],u=l.method,c=l.args;if(!u)return!1;var h=r.computeAPICommandBindings(t,u,c);if(1!==h.length)return!1;if(a){if(s=h[0],s.type!==a.type)return!1;if(s.prop!==a.prop)return!1;if(Array.isArray(a.traces)){if(!Array.isArray(s.traces))return!1;s.traces.sort();for(var f=0;f<a.traces.length;f++)if(a.traces[f]!==s.traces[f])return!1}else if(s.prop!==a.prop)return!1}else a=h[0],Array.isArray(a.traces)&&a.traces.sort();s=h[0];var d=s.value;if(Array.isArray(d)){if(1!==d.length)return!1;d=d[0]}n&&(n[d]=i)}return a},r.executeAPICommand=function(t,e,r){for(var n=l[e],i=[t],a=0;a<r.length;a++)i.push(r[a]);return n.apply(null,i).catch(function(t){return u.warn("API call to Plotly."+e+" rejected.",t),Promise.reject(t)})},r.computeAPICommandBindings=function(t,e,r){var n;switch(e){case"restyle":n=o(t,r);break;case"relayout":n=a(t,r);break;case"update":n=o(t,[r[0],r[2]]).concat(a(t,[r[1]]));break;case"animate":n=i(t,r);break;default:n=[]}return n}},{"../lib":658,"../plotly":686}],711:[function(t,e,r){"use strict";e.exports={family:{valType:"string",noBlank:!0,strict:!0},size:{valType:"number",min:1},color:{valType:"color"}}},{}],712:[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"}}},{}],713:[function(t,e,r){"use strict";var n=e.exports={};n.projNames={equirectangular:"equirectangular",mercator:"mercator",orthographic:"orthographic","natural earth":"naturalEarth",kavrayskiy7:"kavrayskiy7",miller:"miller",robinson:"robinson",eckert4:"eckert4","azimuthal equal area":"azimuthalEqualArea","azimuthal equidistant":"azimuthalEquidistant","conic equal area":"conicEqualArea","conic conformal":"conicConformal","conic equidistant":"conicEquidistant",gnomonic:"gnomonic",stereographic:"stereographic",mollweide:"mollweide",hammer:"hammer","transverse mercator":"transverseMercator","albers usa":"albersUsa","winkel tripel":"winkel3"},n.axesNames=["lonaxis","lataxis"],n.lonaxisSpan={orthographic:180,"azimuthal equal area":360,"azimuthal equidistant":360,"conic conformal":180,gnomonic:160,stereographic:180,"transverse mercator":180,"*":360},n.lataxisSpan={"conic conformal":150,stereographic:179.5,"*":180},n.scopeDefaults={world:{lonaxisRange:[-180,180],lataxisRange:[-90,90],projType:"equirectangular",projRotate:[0,0,0]},usa:{lonaxisRange:[-180,-50],lataxisRange:[15,80],projType:"albers usa"},europe:{lonaxisRange:[-30,60],lataxisRange:[30,80],projType:"conic conformal",projRotate:[15,0,0],projParallels:[0,60]},asia:{lonaxisRange:[22,160],lataxisRange:[-15,55],projType:"mercator",projRotate:[0,0,0]},africa:{lonaxisRange:[-30,60],lataxisRange:[-40,40],projType:"mercator",projRotate:[0,0,0]},"north america":{lonaxisRange:[-180,-45],lataxisRange:[5,85],projType:"conic conformal",projRotate:[-100,0,0],projParallels:[29.5,45.5]},"south america":{lonaxisRange:[-100,-30],lataxisRange:[-60,15],projType:"mercator",projRotate:[0,0,0]}},n.clipPad=.001,n.precision=.1,n.landColor="#F0DC82",n.waterColor="#3399FF",n.locationmodeToLayer={"ISO-3":"countries","USA-states":"subunits","country names":"countries"},n.sphereSVG={type:"Sphere"},n.fillLayers=["ocean","land","lakes"],n.lineLayers=["subunits","countries","coastlines","rivers","frame"],n.baseLayers=["ocean","land","lakes","subunits","countries","coastlines","rivers","lataxis","lonaxis","frame"],n.layerNameToAdjective={ocean:"ocean",land:"land",lakes:"lake",subunits:"subunit",countries:"country",coastlines:"coastline",rivers:"river",frame:"frame"},n.baseLayersOverChoropleth=["rivers","lakes"]},{}],714:[function(t,e,r){"use strict";function n(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.container=t.container,this.topojsonURL=t.topojsonURL,this.hoverContainer=null,this.topojsonName=null,this.topojson=null,this.projectionType=null,this.projection=null,this.clipAngle=null,this.setScale=null,this.path=null,this.zoom=null,this.zoomReset=null,this.xaxis=null,this.yaxis=null,this.makeFramework(),this.updateFx(e.hovermode),this.traceHash={}}function i(t,e,r){return u.geo.graticule().extent([[t[0],e[0]],[t[1],e[1]]]).step(r)}function a(t,e,r){var n=x.layerNameToAdjective[e];t.select("."+e).selectAll("path").attr("stroke","none").call(c.fill,r[n+"color"])}function o(t,e,r){var n=x.layerNameToAdjective[e];t.select("."+e).selectAll("path").attr("fill","none").call(c.stroke,r[n+"color"]).call(h.dashLine,"",r[n+"width"])}function s(t,e,r){t.select("."+e+"graticule").selectAll("path").attr("fill","none").call(c.stroke,r[e].gridcolor).call(h.dashLine,"",r[e].gridwidth)}function l(t){var e={type:"linear",showexponent:"all",exponentformat:d.layoutAttributes.exponentformat.dflt,_gd:{_fullLayout:t}};return d.setConvert(e),e}var u=t("d3"),c=t("../../components/color"),h=t("../../components/drawing"),f=t("../plots"),d=t("../cartesian/axes"),p=t("../cartesian/graph_interact"),m=t("./projections"),g=t("./set_scale"),v=t("./zoom"),y=t("./zoom_reset"),x=t("./constants"),b=t("../../constants/xmlns_namespaces"),_=t("../../lib/topojson_utils"),w=t("topojson-client").feature;m(u),e.exports=n;var M=n.prototype;M.plot=function(t,e,r){var n,i,a=this,o=e[a.id],s=e._size;a.projection=null,a.setScale=g(o,s),a.makeProjection(o),a.makePath(),a.adjustLayout(o,s),a.zoom=v(a,o),a.zoomReset=y(a,o),a.mockAxis=l(e),a.framework.call(a.zoom).on("dblclick.zoom",a.zoomReset),a.framework.on("mousemove",function(){var t=u.mouse(this),e=a.projection.invert(t);if(!isNaN(e[0])&&!isNaN(e[1])){var r={target:!0,xpx:t[0],ypx:t[1]};a.xaxis.c2p=function(){return t[0]},a.xaxis.p2c=function(){return e[0]},a.yaxis.c2p=function(){return t[1]},a.yaxis.p2c=function(){return e[1]},p.hover(a.graphDiv,r,a.id)}}),a.framework.on("mouseout",function(){p.loneUnhover(e._toppaper)}),a.framework.on("click",function(){p.click(a.graphDiv,{target:!0})}),n=_.getTopojsonName(o),null===a.topojson||n!==a.topojsonName?(a.topojsonName=n,void 0!==PlotlyGeoAssets.topojson[a.topojsonName]?(a.topojson=PlotlyGeoAssets.topojson[a.topojsonName],a.onceTopojsonIsLoaded(t,o)):(i=_.getTopojsonPath(a.topojsonURL,a.topojsonName),r.push(new Promise(function(e,r){u.json(i,function(n,s){return n?void r(404===n.status?new Error(["plotly.js could not find topojson file at",i,".","Make sure the *topojsonURL* plot config option","is set properly."].join(" ")):new Error(["unexpected error while fetching topojson file at",i].join(" "))):(a.topojson=s,PlotlyGeoAssets.topojson[a.topojsonName]=s,a.onceTopojsonIsLoaded(t,o),void e())})})))):a.onceTopojsonIsLoaded(t,o)},M.onceTopojsonIsLoaded=function(t,e){this.drawLayout(e),f.generalUpdatePerTraceModule(this,t,e),this.render()},M.updateFx=function(t){this.showHover=t!==!1},M.makeProjection=function(t){var e,r=t.projection,n=r.type,i=null===this.projection||n!==this.projectionType;i?(this.projectionType=n,e=this.projection=u.geo[x.projNames[n]]()):e=this.projection,e.translate(r._translate0).precision(x.precision),t._isAlbersUsa||e.rotate(r._rotate).center(r._center),t._clipAngle?(this.clipAngle=t._clipAngle,e.clipAngle(t._clipAngle-x.clipPad)):this.clipAngle=null,r.parallels&&e.parallels(r.parallels),i&&this.setScale(e),e.translate(r._translate).scale(r._scale)},M.makePath=function(){this.path=u.geo.path().projection(this.projection)},M.makeFramework=function(){var t=this.geoDiv=u.select(this.container).append("div");t.attr("id",this.id).style("position","absolute");var e=this.hoverContainer=t.append("svg");e.attr(b.svgAttrs).style({position:"absolute","z-index":20,"pointer-events":"none"});var r=this.framework=t.append("svg");r.attr(b.svgAttrs).attr({position:"absolute",preserveAspectRatio:"none"}),r.append("g").attr("class","bglayer").append("rect"),r.append("g").attr("class","baselayer"),r.append("g").attr("class","choroplethlayer"),r.append("g").attr("class","baselayeroverchoropleth"),r.append("g").attr("class","scattergeolayer"),r.on("dblclick.zoom",null),this.xaxis={_id:"x"},this.yaxis={_id:"y"}},M.adjustLayout=function(t,e){var r=t.domain,n=e.l+e.w*r.x[0]+t._marginX,i=e.t+e.h*(1-r.y[1])+t._marginY;this.geoDiv.style({left:n+"px",top:i+"px",width:t._width+"px",height:t._height+"px"}),this.hoverContainer.attr({width:t._width,height:t._height}),this.framework.attr({width:t._width,height:t._height}),this.framework.select(".bglayer").select("rect").attr({width:t._width,height:t._height}).call(c.fill,t.bgcolor),this.xaxis._offset=n,this.xaxis._length=t._width,this.yaxis._offset=i,this.yaxis._length=t._height},M.drawTopo=function(t,e,r){if(r["show"+e]===!0){var n=this.topojson,i="frame"===e?x.sphereSVG:w(n,n.objects[e]);t.append("g").datum(i).attr("class",e).append("path").attr("class","basepath")}},M.drawGraticule=function(t,e,r){var n=r[e];if(n.showgrid===!0){var a=x.scopeDefaults[r.scope],o=a.lonaxisRange,s=a.lataxisRange,l="lonaxis"===e?[n.dtick]:[0,n.dtick],u=i(o,s,l);t.append("g").datum(u).attr("class",e+"graticule").append("path").attr("class","graticulepath")}},M.drawLayout=function(t){var e,r=this.framework.select("g.baselayer"),n=x.baseLayers,i=x.axesNames;r.selectAll("*").remove();for(var a=0;a<n.length;a++)e=n[a],i.indexOf(e)!==-1?this.drawGraticule(r,e,t):this.drawTopo(r,e,t);this.styleLayout(t)},M.styleLayer=function(t,e,r){var n=x.fillLayers,i=x.lineLayers;n.indexOf(e)!==-1?a(t,e,r):i.indexOf(e)!==-1&&o(t,e,r)},M.styleLayout=function(t){for(var e,r=this.framework.select("g.baselayer"),n=x.baseLayers,i=x.axesNames,a=0;a<n.length;a++)e=n[a],i.indexOf(e)!==-1?s(r,e,t):this.styleLayer(r,e,t)},M.isLonLatOverEdges=function(t){var e=this.clipAngle;if(null===e)return!1;var r=this.projection.rotate(),n=u.geo.distance(t,[-r[0],-r[1]]),i=e*Math.PI/180;return n>i},M.render=function(){function t(t){var e=r.projection(t.lonlat);return e?"translate("+e[0]+","+e[1]+")":null}function e(t){return r.isLonLatOverEdges(t.lonlat)?"0":"1.0"}var r=this,n=r.framework,i=n.select("g.choroplethlayer"),a=n.select("g.scattergeolayer"),o=r.path;n.selectAll("path.basepath").attr("d",o),n.selectAll("path.graticulepath").attr("d",o),i.selectAll("path.choroplethlocation").attr("d",o),i.selectAll("path.basepath").attr("d",o),a.selectAll("path.js-line").attr("d",o),null!==r.clipAngle?(a.selectAll("path.point").style("opacity",e).attr("transform",t),a.selectAll("text").style("opacity",e).attr("transform",t)):(a.selectAll("path.point").attr("transform",t),a.selectAll("text").attr("transform",t))}},{"../../components/color":558,"../../components/drawing":581,"../../constants/xmlns_namespaces":643,"../../lib/topojson_utils":675,"../cartesian/axes":691,"../cartesian/graph_interact":698,"../plots":751,"./constants":713,"./projections":721,"./set_scale":722,"./zoom":723,"./zoom_reset":724,d3:97,"topojson-client":497}],715:[function(t,e,r){"use strict";var n=t("./geo"),i=t("../../plots/plots");r.name="geo",r.attr="geo",r.idRoot="geo",r.idRegex=/^geo([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^geo([2-9]|[1-9][0-9]+)?$/,r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,a=i.getSubplotIds(e,"geo");void 0===window.PlotlyGeoAssets&&(window.PlotlyGeoAssets={topojson:{}});for(var o=0;o<a.length;o++){var s=a[o],l=i.getSubplotCalcData(r,"geo",s),u=e[s]._subplot;u||(u=new n({id:s,graphDiv:t,container:e._geocontainer.node(),topojsonURL:t._context.topojsonURL},e),e[s]._subplot=u),u.plot(l,e,t._promises)}},r.clean=function(t,e,r,n){for(var a=i.getSubplotIds(n,"geo"),o=0;o<a.length;o++){var s=a[o],l=n[s]._subplot;!e[s]&&l&&l.geoDiv.remove()}},r.toSVG=function(t){for(var e=t._fullLayout,r=i.getSubplotIds(e,"geo"),n=e._size,a=0;a<r.length;a++){var o=e[r[a]],s=o.domain,l=o._subplot.framework;l.attr("style",null),l.attr({x:n.l+n.w*s.x[0]+o._marginX,y:n.t+n.h*(1-s.y[1])+o._marginY,width:o._width,height:o._height}),e._geoimages.node().appendChild(l.node())}}},{"../../plots/plots":751,"./geo":714,"./layout/attributes":716,"./layout/defaults":719,"./layout/layout_attributes":720}],716:[function(t,e,r){"use strict";e.exports={geo:{valType:"subplotid",dflt:"geo"}}},{}],717:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes");e.exports={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number"},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:n.lightLine},gridwidth:{valType:"number",min:0,dflt:1}}},{"../../../components/color/attributes":557}],718:[function(t,e,r){"use strict";var n=t("../../../lib"),i=t("../constants"),a=t("./axis_attributes");e.exports=function(t,e){function r(t,e){return n.coerce(s,l,a,t,e)}function o(t){var r,n,a,o,s,l,u=e.scope;return"world"===u?(r=e.projection,n=r.type,a=r.rotation,s=i[t+"Span"],l=void 0!==s[n]?s[n]/2:s["*"]/2,o="lonaxis"===t?a.lon:a.lat,[o-l,o+l]):i.scopeDefaults[u][t+"Range"]}for(var s,l,u=i.axesNames,c=0;c<u.length;c++){var h=u[c];s=t[h]||{},l={};var f=o(h),d=r("range",f);n.noneOrAll(s.range,l.range,[0,1]),r("tick0",d[0]),r("dtick","lonaxis"===h?30:10);var p=r("showgrid");p&&(r("gridcolor"),r("gridwidth")),e[h]=l,e[h]._fullRange=f}}},{"../../../lib":658,"../constants":713,"./axis_attributes":717}],719:[function(t,e,r){"use strict";function n(t,e,r){var n,i=r("scope"),o="world"!==i,l=a.scopeDefaults[i],u=r("resolution"),c=r("projection.type",l.projType),h="albers usa"===c,f=c.indexOf("conic")!==-1;if(f){var d=l.projParallels||[0,60];r("projection.parallels",d)}if(h)e.scope="usa";else{var p=l.projRotate||[0,0,0];r("projection.rotation.lon",p[0]),r("projection.rotation.lat",p[1]),r("projection.rotation.roll",p[2]),n=r("showcoastlines",!o),n&&(r("coastlinecolor"),r("coastlinewidth")),n=r("showocean"),n&&r("oceancolor")}r("projection.scale"),n=r("showland"),n&&r("landcolor"),n=r("showlakes"),n&&r("lakecolor"),n=r("showrivers"),n&&(r("rivercolor"),r("riverwidth")),n=r("showcountries",o&&"usa"!==i),n&&(r("countrycolor"),r("countrywidth")),("usa"===i||"north america"===i&&50===u)&&(r("showsubunits",!0),r("subunitcolor"),r("subunitwidth")),o||(n=r("showframe",!0),n&&(r("framecolor"),r("framewidth"))),r("bgcolor"),s(t,e),e._isHighRes=50===u,e._clipAngle=a.lonaxisSpan[c]/2,e._isAlbersUsa=h,e._isConic=f,e._isScoped=o;var m=e.projection.rotation||{};e.projection._rotate=[-m.lon||0,-m.lat||0,m.roll||0]}var i=t("../../subplot_defaults"),a=t("../constants"),o=t("./layout_attributes"),s=t("./axis_defaults");e.exports=function(t,e,r){i(t,e,r,{type:"geo",attributes:o,handleDefaults:n,partition:"y"})}},{"../../subplot_defaults":758,"../constants":713,"./axis_defaults":718,"./layout_attributes":720}],720:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("../constants"),a=t("./axis_attributes");e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:Object.keys(i.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:Object.keys(i.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,max:10,dflt:1}},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:n.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:i.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:i.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:i.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:i.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:n.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:n.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:n.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:n.background},lonaxis:a,lataxis:a}},{"../../../components/color/attributes":557,"../constants":713,"./axis_attributes":717}],721:[function(t,e,r){"use strict";function n(t){function e(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:r(t.geometry,e)}}function r(e,n){if(!e)return null;if("GeometryCollection"===e.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return r(t,n)})};if(!S.hasOwnProperty(e.type))return null;var i=S[e.type];return t.geo.stream(e,n(i)),i.result()}function n(){}function i(t){if((e=t.length)<4)return!1;for(var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++r<e;)n+=t[r-1][1]*t[r][0]-t[r-1][0]*t[r][1];return n<=0}function a(t,e){for(var r=e[0],n=e[1],i=!1,a=0,o=t.length,s=o-1;a<o;s=a++){var l=t[a],u=l[0],c=l[1],h=t[s],f=h[0],d=h[1];c>n^d>n&&r<(f-u)*(n-c)/(d-c)+u&&(i=!i)}return i}function o(t){return t?t/Math.sin(t):1}function s(t){return t>1?z:t<-1?-z:Math.asin(t)}function l(t){return t>1?0:t<-1?I:Math.acos(t)}function u(t,e){var r=(2+z)*Math.sin(e);e/=2;for(var n=0,i=1/0;n<10&&Math.abs(i)>L;n++){var a=Math.cos(e);e-=i=(e+Math.sin(e)*(a+2)-r)/(2*a*(1+a))}return[2/Math.sqrt(I*(4+I))*t*(1+Math.cos(e)),2*Math.sqrt(I/(4+I))*Math.sin(e)]}function c(t,e){function r(r,n){var i=F(r/e,n);return i[0]*=t,i}return arguments.length<2&&(e=t),1===e?F:e===1/0?f:(r.invert=function(r,n){var i=F.invert(r/t,n);return i[0]*=e,i},r)}function h(){var t=2,e=R(c),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}function f(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function d(t,e){return[3*t/(2*I)*Math.sqrt(I*I/3-e*e),e]}function p(t,e){return[t,1.25*Math.log(Math.tan(I/4+.4*e))]}function m(t){return function(e){var r,n=t*Math.sin(e),i=30;do{e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e))}while(Math.abs(r)>L&&--i>0);return e/2}}function g(t,e,r){function n(r,n){return[t*r*Math.cos(n=i(n)),e*Math.sin(n)]}var i=m(r);return n.invert=function(n,i){var a=s(i/e);return[n/(t*Math.cos(a)),s((2*a+Math.sin(2*a))/r)]},n}function v(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(-.013791+n*(.003971*r-.001529*n))),e*(1.007226+r*(.015085+n*(-.044475+.028874*r-.005916*n)))]}function y(t,e){var r,n=Math.min(18,36*Math.abs(e)/I),i=Math.floor(n),a=n-i,o=(r=N[i])[0],s=r[1],l=(r=N[++i])[0],u=r[1],c=(r=N[Math.min(19,++i)])[0],h=r[1];return[t*(l+a*(c-o)/2+a*a*(c-2*l+o)/2),(e>0?z:-z)*(u+a*(h-s)/2+a*a*(h-2*u+s)/2)]}function x(t,e){return[t*Math.cos(e),e]}function b(t,e){var r=Math.cos(e),n=o(l(r*Math.cos(t/=2)));return[2*r*Math.sin(t)*n,Math.sin(e)*n]}function _(t,e){var r=b(t,e);return[(r[0]+t/z)/2,(r[1]+e)/2]}t.geo.project=function(t,e){var n=e.stream;if(!n)throw new Error("not yet supported");return(t&&w.hasOwnProperty(t.type)?w[t.type]:r)(t,n)};var w={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,r)})}}},M=[],A=[],k={point:function(t,e){M.push([t,e])},result:function(){var t=M.length?M.length<2?{type:"Point",coordinates:M[0]}:{type:"MultiPoint",coordinates:M}:null;return M=[],t}},T={lineStart:n,point:function(t,e){M.push([t,e])},lineEnd:function(){M.length&&(A.push(M),M=[])},result:function(){var t=A.length?A.length<2?{type:"LineString",coordinates:A[0]}:{type:"MultiLineString",coordinates:A}:null;return A=[],t}},E={polygonStart:n,lineStart:n,point:function(t,e){M.push([t,e])},lineEnd:function(){var t=M.length;if(t){do{M.push(M[0].slice())}while(++t<4);A.push(M),M=[]}},polygonEnd:n,result:function(){if(!A.length)return null;var t=[],e=[];return A.forEach(function(r){i(r)?t.push([r]):e.push(r)}),e.forEach(function(e){var r=e[0];t.some(function(t){if(a(t[0],r))return t.push(e),!0})||t.push([e])}),A=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},S={Point:k,MultiPoint:k,LineString:T,MultiLineString:T,Polygon:E,MultiPolygon:E,Sphere:E},L=1e-6,C=L*L,I=Math.PI,z=I/2,D=(Math.sqrt(I),I/180),P=180/I,O=t.geo.projection,R=t.geo.projectionMutator;t.geo.interrupt=function(e){function r(t,r){for(var n=r<0?-1:1,i=l[+(r<0)],a=0,o=i.length-1;a<o&&t>i[a][2][0];++a);var s=e(t-i[a][1][0],r);return s[0]+=e(i[a][1][0],n*r>n*i[a][0][1]?i[a][0][1]:r)[0],s}function n(){s=l.map(function(t){return t.map(function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]})})}function i(){for(var e=1e-6,r=[],n=0,i=l[0].length;n<i;++n){var o=l[0][n],s=180*o[0][0]/I,u=180*o[0][1]/I,c=180*o[1][1]/I,h=180*o[2][0]/I,f=180*o[2][1]/I;r.push(a([[s+e,u+e],[s+e,c-e],[h-e,c-e],[h-e,f+e]],30))}for(var n=l[1].length-1;n>=0;--n){var o=l[1][n],s=180*o[0][0]/I,u=180*o[0][1]/I,c=180*o[1][1]/I,h=180*o[2][0]/I,f=180*o[2][1]/I;r.push(a([[h-e,f-e],[h-e,c+e],[s+e,c+e],[s+e,u-e]],30))}return{type:"Polygon",coordinates:[t.merge(r)]}}function a(t,e){for(var r,n,i,a=-1,o=t.length,s=t[0],l=[];++a<o;){r=t[a],n=(r[0]-s[0])/e,i=(r[1]-s[1])/e;for(var u=0;u<e;++u)l.push([s[0]+u*n,s[1]+u*i]);s=r}return l.push(r),l}function o(t,e){return Math.abs(t[0]-e[0])<L&&Math.abs(t[1]-e[1])<L}var s,l=[[[[-I,0],[0,z],[I,0]]],[[[-I,0],[0,-z],[I,0]]]];e.invert&&(r.invert=function(t,n){for(var i=s[+(n<0)],a=l[+(n<0)],u=0,c=i.length;u<c;++u){var h=i[u];if(h[0][0]<=t&&t<h[1][0]&&h[0][1]<=n&&n<h[1][1]){var f=e.invert(t-e(a[u][1][0],0)[0],n);return f[0]+=a[u][1][0],o(r(f[0],f[1]),[t,n])?f:null}}});var u=t.geo.projection(r),c=u.stream;return u.stream=function(e){var r=u.rotate(),n=c(e),a=(u.rotate([0,0]),c(e));return u.rotate(r),n.sphere=function(){t.geo.stream(i(),a)},n},u.lobes=function(t){return arguments.length?(l=t.map(function(t){return t.map(function(t){return[[t[0][0]*I/180,t[0][1]*I/180],[t[1][0]*I/180,t[1][1]*I/180],[t[2][0]*I/180,t[2][1]*I/180]]})}),n(),u):l.map(function(t){return t.map(function(t){return[[180*t[0][0]/I,180*t[0][1]/I],[180*t[1][0]/I,180*t[1][1]/I],[180*t[2][0]/I,180*t[2][1]/I]]})})},u},u.invert=function(t,e){var r=.5*e*Math.sqrt((4+I)/I),n=s(r),i=Math.cos(n);return[t/(2/Math.sqrt(I*(4+I))*(1+i)),s((n+r*(i+2))/(2+z))]},(t.geo.eckert4=function(){return O(u)}).raw=u;var F=t.geo.azimuthalEqualArea.raw;f.invert=function(t,e){var r=2*s(e/2);return[t*Math.cos(r/2)/Math.cos(r),r]},(t.geo.hammer=h).raw=c,d.invert=function(t,e){return[2/3*I*t/Math.sqrt(I*I/3-e*e),e]},(t.geo.kavrayskiy7=function(){return O(d)}).raw=d,p.invert=function(t,e){return[t,2.5*Math.atan(Math.exp(.8*e))-.625*I]},(t.geo.miller=function(){return O(p)}).raw=p;var j=(m(I),g(Math.SQRT2/z,Math.SQRT2,I));(t.geo.mollweide=function(){return O(j)}).raw=j,v.invert=function(t,e){var r,n=e,i=25;do{var a=n*n,o=a*a;n-=r=(n*(1.007226+a*(.015085+o*(-.044475+.028874*a-.005916*o)))-e)/(1.007226+a*(.045255+o*(-.311325+.259866*a-.005916*11*o)))}while(Math.abs(r)>L&&--i>0);return[t/(.8707+(a=n*n)*(-.131979+a*(-.013791+a*a*a*(.003971-.001529*a)))),n]},(t.geo.naturalEarth=function(){return O(v)}).raw=v;var N=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];N.forEach(function(t){t[1]*=1.0144}),y.invert=function(t,e){var r=e/z,n=90*r,i=Math.min(18,Math.abs(n/5)),a=Math.max(0,Math.floor(i));do{var o=N[a][1],s=N[a+1][1],l=N[Math.min(19,a+2)][1],u=l-o,c=l-2*s+o,h=2*(Math.abs(r)-s)/u,f=c/u,d=h*(1-f*h*(1-2*f*h));if(d>=0||1===a){n=(e>=0?5:-5)*(d+i);var p,m=50;do{i=Math.min(18,Math.abs(n)/5),a=Math.floor(i),d=i-a,o=N[a][1],s=N[a+1][1],l=N[Math.min(19,a+2)][1],n-=(p=(e>=0?z:-z)*(s+d*(l-o)/2+d*d*(l-2*s+o)/2)-e)*P}while(Math.abs(p)>C&&--m>0);break}}while(--a>=0);var g=N[a][0],v=N[a+1][0],y=N[Math.min(19,a+2)][0];return[t/(v+d*(y-g)/2+d*d*(y-2*v+g)/2),n*D]},(t.geo.robinson=function(){return O(y)}).raw=y,x.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return O(x)}).raw=x,b.invert=function(t,e){if(!(t*t+4*e*e>I*I+L)){var r=t,n=e,i=25;do{var a,o=Math.sin(r),s=Math.sin(r/2),u=Math.cos(r/2),c=Math.sin(n),h=Math.cos(n),f=Math.sin(2*n),d=c*c,p=h*h,m=s*s,g=1-p*u*u,v=g?l(h*u)*Math.sqrt(a=1/g):a=0,y=2*v*h*s-t,x=v*c-e,b=a*(p*m+v*h*u*d),_=a*(.5*o*f-2*v*c*s),w=.25*a*(f*s-v*c*p*o),M=a*(d*u+v*m*h),A=_*w-M*b;if(!A)break;var k=(x*_-y*M)/A,T=(y*w-x*b)/A;r-=k,n-=T}while((Math.abs(k)>L||Math.abs(T)>L)&&--i>0);return[r,n]}},(t.geo.aitoff=function(){return O(b)}).raw=b,_.invert=function(t,e){var r=t,n=e,i=25;do{var a,o=Math.cos(n),s=Math.sin(n),u=Math.sin(2*n),c=s*s,h=o*o,f=Math.sin(r),d=Math.cos(r/2),p=Math.sin(r/2),m=p*p,g=1-h*d*d,v=g?l(o*d)*Math.sqrt(a=1/g):a=0,y=.5*(2*v*o*p+r/z)-t,x=.5*(v*s+n)-e,b=.5*a*(h*m+v*o*d*c)+.5/z,_=a*(f*u/4-v*s*p),w=.125*a*(u*p-v*s*h*f),M=.5*a*(c*d+v*m*o)+.5,A=_*w-M*b,k=(x*_-y*M)/A,T=(y*w-x*b)/A;r-=k,n-=T}while((Math.abs(k)>L||Math.abs(T)>L)&&--i>0);return[r,n]},(t.geo.winkel3=function(){return O(_)}).raw=_}e.exports=n},{}],722:[function(t,e,r){"use strict";function n(t,e){var r=t.projection,n=t.lonaxis,o=t.lataxis,l=t.domain,u=t.framewidth||0,c=e.w*(l.x[1]-l.x[0]),h=e.h*(l.y[1]-l.y[0]),f=n.range[0]+s,d=n.range[1]-s,p=o.range[0]+s,m=o.range[1]-s,g=n._fullRange[0]+s,v=n._fullRange[1]-s,y=o._fullRange[0]+s,x=o._fullRange[1]-s;r._translate0=[e.l+c/2,e.t+h/2];var b=d-f,_=m-p,w=[f+b/2,p+_/2],M=r._rotate;r._center=[w[0]+M[0],w[1]+M[1]];var A=function(e){function n(t){return Math.min(_*c/(t[1][0]-t[0][0]),_*h/(t[1][1]-t[0][1]))}var o,s,l,b,_=e.scale(),w=r._translate0,M=i(f,p,d,m),A=i(g,y,v,x);l=a(e,M),o=n(l),b=a(e,A),r._fullScale=n(b),e.scale(o),l=a(e,M),s=[w[0]-l[0][0]+u,w[1]-l[0][1]+u],r._translate=s,e.translate(s),l=a(e,M),t._isAlbersUsa||e.clipExtent(l),o=r.scale*o,r._scale=o,t._width=Math.round(l[1][0])+u,t._height=Math.round(l[1][1])+u,t._marginX=(c-Math.round(l[1][0]))/2,t._marginY=(h-Math.round(l[1][1]))/2};return A}function i(t,e,r,n){var i=(r-t)/4;return{type:"Polygon",coordinates:[[[t,e],[t,n],[t+i,n],[t+2*i,n],[t+3*i,n],[r,n],[r,e],[r-i,e],[r-2*i,e],[r-3*i,e],[t,e]]]}}function a(t,e){return o.geo.path().projection(t).bounds(e)}var o=t("d3"),s=t("./constants").clipPad;e.exports=n},{"./constants":713,d3:97}],723:[function(t,e,r){"use strict";function n(t,e){var r;return(r=e._isScoped?a:e._clipAngle?s:o)(t,e.projection)}function i(t,e){var r=e._fullScale;return _.behavior.zoom().translate(t.translate()).scale(t.scale()).scaleExtent([.5*r,100*r])}function a(t,e){function r(){_.select(this).style(A)}function n(){o.scale(_.event.scale).translate(_.event.translate),t.render()}function a(){_.select(this).style(k)}var o=t.projection,s=i(o,e);return s.on("zoomstart",r).on("zoom",n).on("zoomend",a),s}function o(t,e){function r(t){return g.invert(t)}function n(t){var e=g(r(t));return Math.abs(e[0]-t[0])>y||Math.abs(e[1]-t[1])>y}function a(){_.select(this).style(A),l=_.mouse(this),u=g.rotate(),c=g.translate(),h=u,f=r(l)}function o(){return d=_.mouse(this),n(l)?(v.scale(g.scale()),void v.translate(g.translate())):(g.scale(_.event.scale),g.translate([c[0],_.event.translate[1]]),f?r(d)&&(m=r(d),p=[h[0]+(m[0]-f[0]),u[1],u[2]],g.rotate(p),h=p):(l=d,f=r(l)),void t.render())}function s(){_.select(this).style(k)}var l,u,c,h,f,d,p,m,g=t.projection,v=i(g,e),y=2;return v.on("zoomstart",a).on("zoom",o).on("zoomend",s),v}function s(t,e){function r(t){v++||t({type:"zoomstart"})}function n(t){t({type:"zoom"})}function a(t){--v||t({type:"zoomend"})}var o,s=t.projection,d={r:s.rotate(),k:s.scale()},p=i(s,e),m=b(p,"zoomstart","zoom","zoomend"),v=0,y=p.on;return p.on("zoomstart",function(){_.select(this).style(A);var t=_.mouse(this),e=s.rotate(),i=e,a=s.translate(),v=u(e);o=l(s,t),y.call(p,"zoom",function(){var r=_.mouse(this);if(s.scale(d.k=_.event.scale),o){if(l(s,r)){s.rotate(e).translate(a);var u=l(s,r),p=h(o,u),y=g(c(v,p)),x=d.r=f(y,o,i);isFinite(x[0])&&isFinite(x[1])&&isFinite(x[2])||(x=i),s.rotate(x),i=x}}else t=r,o=l(s,t);n(m.of(this,arguments))}),r(m.of(this,arguments))}).on("zoomend",function(){_.select(this).style(k),y.call(p,"zoom",null),a(m.of(this,arguments))}).on("zoom.redraw",function(){t.render()}),_.rebind(p,m,"on")}function l(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&v(r)}function u(t){var e=.5*t[0]*w,r=.5*t[1]*w,n=.5*t[2]*w,i=Math.sin(e),a=Math.cos(e),o=Math.sin(r),s=Math.cos(r),l=Math.sin(n),u=Math.cos(n);return[a*s*u+i*o*l,i*s*u-a*o*l,a*o*u+i*s*l,a*s*l-i*o*u]}function c(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=e[0],s=e[1],l=e[2],u=e[3];return[r*o-n*s-i*l-a*u,r*s+n*o+i*u-a*l,r*l-n*u+i*o+a*s,r*u+n*l-i*s+a*o]}function h(t,e){if(t&&e){var r=x(t,e),n=Math.sqrt(y(r,r)),i=.5*Math.acos(Math.max(-1,Math.min(1,y(t,e)))),a=Math.sin(i)/n;return n&&[Math.cos(i),r[2]*a,-r[1]*a,r[0]*a]}}function f(t,e,r){var n=m(e,2,t[0]);n=m(n,1,t[1]),n=m(n,0,t[2]-r[2]);var i,a,o=e[0],s=e[1],l=e[2],u=n[0],c=n[1],h=n[2],f=Math.atan2(s,o)*M,p=Math.sqrt(o*o+s*s);Math.abs(c)>p?(a=(c>0?90:-90)-f,i=0):(a=Math.asin(c/p)*M-f,i=Math.sqrt(p*p-c*c));var g=180-a-2*f,v=(Math.atan2(h,u)-Math.atan2(l,i))*M,y=(Math.atan2(h,u)-Math.atan2(l,-i))*M,x=d(r[0],r[1],a,v),b=d(r[0],r[1],g,y);return x<=b?[a,v,r[2]]:[g,y,r[2]]}function d(t,e,r,n){var i=p(r-t),a=p(n-e);return Math.sqrt(i*i+a*a)}function p(t){return(t%360+540)%360-180}function m(t,e,r){var n=r*w,i=t.slice(),a=0===e?1:0,o=2===e?1:2,s=Math.cos(n),l=Math.sin(n);return i[a]=t[a]*s-t[o]*l,i[o]=t[o]*s+t[a]*l,i}function g(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*M,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*M,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*M]}function v(t){var e=t[0]*w,r=t[1]*w,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function y(t,e){for(var r=0,n=0,i=t.length;n<i;++n)r+=t[n]*e[n];return r}function x(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 b(t){for(var e=0,r=arguments.length,n=[];++e<r;)n.push(arguments[e]);var i=_.dispatch.apply(null,n);return i.of=function(e,r){return function(n){var a;try{a=n.sourceEvent=_.event,n.target=t,_.event=n,i[n.type].apply(e,r)}finally{_.event=a}}},i}var _=t("d3"),w=Math.PI/180,M=180/Math.PI,A={cursor:"pointer"},k={cursor:"auto"};e.exports=n},{d3:97}],724:[function(t,e,r){"use strict";function n(t,e){var r=t.projection,n=t.zoom,a=function(){t.makeProjection(e),t.makePath(),n.scale(r.scale()),n.translate(r.translate()),i.loneUnhover(t.hoverContainer),t.render()};return a}var i=t("../cartesian/graph_interact");e.exports=n},{"../cartesian/graph_interact":698}],725:[function(t,e,r){"use strict";function n(t,e){this.element=t,this.plot=e,this.mouseListener=null,this.wheelListener=null,this.lastInputTime=Date.now(),this.lastPos=[0,0],this.boxEnabled=!1,this.boxStart=[0,0],this.boxEnd=[0,0]}function i(t){function e(){t.xaxis.autorange=!1,t.yaxis.autorange=!1}var r=t.mouseContainer,i=t.glplot,s=new n(r,i);return s.mouseListener=a(r,function(r,n,a){function o(e,r,n){var i=Math.min(r,n),a=Math.max(r,n);i!==a?(l[e]=i,l[e+2]=a,s.dataBox=l,t.setRanges(l)):(t.selectBox.selectBox=[0,0,1,1],t.glplot.setDirty())}var l=t.calcDataBox(),u=i.viewBox,c=s.lastPos[0],h=s.lastPos[1];switch(n*=i.pixelRatio,a*=i.pixelRatio,a=u[3]-u[1]-a,t.fullLayout.dragmode){case"zoom":if(r){var f=n/(u[2]-u[0])*(l[2]-l[0])+l[0],d=a/(u[3]-u[1])*(l[3]-l[1])+l[1];s.boxEnabled||(s.boxStart[0]=f,s.boxStart[1]=d),s.boxEnd[0]=f,s.boxEnd[1]=d,s.boxEnabled=!0}else s.boxEnabled&&(o(0,s.boxStart[0],s.boxEnd[0]),o(1,s.boxStart[1],s.boxEnd[1]),e(),s.boxEnabled=!1,t.relayoutCallback());break;case"pan":if(s.boxEnabled=!1,r){var p=(c-n)*(l[2]-l[0])/(i.viewBox[2]-i.viewBox[0]),m=(h-a)*(l[3]-l[1])/(i.viewBox[3]-i.viewBox[1]);l[0]+=p,l[2]+=p,l[1]+=m,l[3]+=m,t.setRanges(l),s.panning=!0,s.lastInputTime=Date.now(),e(),t.cameraChanged(),t.handleAnnotations()}else s.panning&&(s.panning=!1,t.relayoutCallback())}s.lastPos[0]=n,s.lastPos[1]=a}),s.wheelListener=o(r,function(r,n){var a=t.calcDataBox(),o=i.viewBox,l=s.lastPos[0],u=s.lastPos[1];switch(t.fullLayout.dragmode){case"zoom":break;case"pan":var c=Math.exp(.1*n/(o[3]-o[1])),h=l/(o[2]-o[0])*(a[2]-a[0])+a[0],f=u/(o[3]-o[1])*(a[3]-a[1])+a[1];a[0]=(a[0]-h)*c+h,a[2]=(a[2]-h)*c+h,a[1]=(a[1]-f)*c+f,a[3]=(a[3]-f)*c+f,t.setRanges(a),s.lastInputTime=Date.now(),e(),t.cameraChanged(),t.handleAnnotations(),t.relayoutCallback()}return!0}),s}var a=t("mouse-change"),o=t("mouse-wheel");e.exports=i},{"mouse-change":418,"mouse-wheel":420}],726:[function(t,e,r){"use strict";function n(t){this.scene=t,this.gl=t.gl,this.pixelRatio=t.pixelRatio,this.screenBox=[0,0,1,1],this.viewBox=[0,0,1,1],this.dataBox=[-1,-1,1,1],this.borderLineEnable=[!1,!1,!1,!1],this.borderLineWidth=[1,1,1,1],this.borderLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.ticks=[[],[]],this.tickEnable=[!0,!0,!1,!1],this.tickPad=[15,15,15,15],this.tickAngle=[0,0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickMarkLength=[0,0,0,0],this.tickMarkWidth=[0,0,0,0],this.tickMarkColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labels=["x","y"],this.labelEnable=[!0,!0,!1,!1],this.labelAngle=[0,Math.PI/2,0,3*Math.PI/2],this.labelPad=[15,15,15,15],this.labelSize=[12,12],this.labelFont=["sans-serif","sans-serif"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.title="",this.titleEnable=!0,this.titleCenter=[0,0,0,0],this.titleAngle=0,this.titleColor=[0,0,0,1],this.titleFont="sans-serif",this.titleSize=18,this.gridLineEnable=[!0,!0],this.gridLineColor=[[0,0,0,.5],[0,0,0,.5]],this.gridLineWidth=[1,1],this.zeroLineEnable=[!0,!0],this.zeroLineWidth=[1,1],this.zeroLineColor=[[0,0,0,1],[0,0,0,1]],this.borderColor=[0,0,0,0],this.backgroundColor=[0,0,0,0],this.static=this.scene.staticPlot}function i(t){return new n(t)}var a=t("../plots"),o=t("../cartesian/axes"),s=t("../../lib/html2unicode"),l=t("../../lib/str2rgbarray"),u=n.prototype,c=["xaxis","yaxis"];u.merge=function(t){this.titleEnable=!1,this.backgroundColor=l(t.plot_bgcolor);var e,r,n,i,a,o,u,h,f,d,p;for(d=0;d<2;++d){for(e=c[d],r=t[this.scene[e]._name],n=/Click to enter .+ title/.test(r.title)?"":r.title,p=0;p<=2;p+=2)this.labelEnable[d+p]=!1,this.labels[d+p]=s(n),this.labelColor[d+p]=l(r.titlefont.color),this.labelFont[d+p]=r.titlefont.family,this.labelSize[d+p]=r.titlefont.size,this.labelPad[d+p]=this.getLabelPad(e,r),this.tickEnable[d+p]=!1,this.tickColor[d+p]=l((r.tickfont||{}).color),this.tickAngle[d+p]="auto"===r.tickangle?0:Math.PI*-r.tickangle/180,this.tickPad[d+p]=this.getTickPad(r),this.tickMarkLength[d+p]=0,this.tickMarkWidth[d+p]=r.tickwidth||0,this.tickMarkColor[d+p]=l(r.tickcolor),this.borderLineEnable[d+p]=!1,this.borderLineColor[d+p]=l(r.linecolor),this.borderLineWidth[d+p]=r.linewidth||0;u=this.hasSharedAxis(r),a=this.hasAxisInDfltPos(e,r)&&!u,o=this.hasAxisInAltrPos(e,r)&&!u,i=r.mirror||!1,h=u?String(i).indexOf("all")!==-1:!!i,f=u?"allticks"===i:String(i).indexOf("ticks")!==-1,a?this.labelEnable[d]=!0:o&&(this.labelEnable[d+2]=!0),a?this.tickEnable[d]=r.showticklabels:o&&(this.tickEnable[d+2]=r.showticklabels),(a||h)&&(this.borderLineEnable[d]=r.showline),(o||h)&&(this.borderLineEnable[d+2]=r.showline),(a||f)&&(this.tickMarkLength[d]=this.getTickMarkLength(r)),(o||f)&&(this.tickMarkLength[d+2]=this.getTickMarkLength(r)),this.gridLineEnable[d]=r.showgrid,this.gridLineColor[d]=l(r.gridcolor),this.gridLineWidth[d]=r.gridwidth,this.zeroLineEnable[d]=r.zeroline,this.zeroLineColor[d]=l(r.zerolinecolor),this.zeroLineWidth[d]=r.zerolinewidth}},u.hasSharedAxis=function(t){var e=this.scene,r=a.getSubplotIds(e.fullLayout,"gl2d"),n=o.findSubplotsWithAxis(r,t);return 0!==n.indexOf(e.id)},u.hasAxisInDfltPos=function(t,e){var r=e.side;return"xaxis"===t?"bottom"===r:"yaxis"===t?"left"===r:void 0},u.hasAxisInAltrPos=function(t,e){var r=e.side;return"xaxis"===t?"top"===r:"yaxis"===t?"right"===r:void 0},u.getLabelPad=function(t,e){var r=1.5,n=e.titlefont.size,i=e.showticklabels;return"xaxis"===t?"top"===e.side?-10+n*(r+(i?1:0)):-10+n*(r+(i?.5:0)):"yaxis"===t?"right"===e.side?10+n*(r+(i?1:.5)):10+n*(r+(i?.5:0)):void 0},u.getTickPad=function(t){return"outside"===t.ticks?10+t.ticklen:15},u.getTickMarkLength=function(t){if(!t.ticks)return 0;var e=t.ticklen;return"inside"===t.ticks?-e:e},e.exports=i},{"../../lib/html2unicode":657,"../../lib/str2rgbarray":673,"../cartesian/axes":691,"../plots":751}],727:[function(t,e,r){"use strict";var n=t("./scene2d"),i=t("../plots"),a=t("../../constants/xmlns_namespaces");r.name="gl2d",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex={x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},r.attrRegex={x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},r.attributes=t("../cartesian/attributes"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,a=i.getSubplotIds(e,"gl2d"),o=0;o<a.length;o++){var s=a[o],l=e._plots[s],u=i.getSubplotData(r,"gl2d",s),c=l._scene2d;void 0===c&&(c=new n({id:s,graphDiv:t,container:t.querySelector(".gl-container"),staticPlot:t._context.staticPlot,plotGlPixelRatio:t._context.plotGlPixelRatio},e),l._scene2d=c),c.plot(u,t.calcdata,e,t.layout)}},r.clean=function(t,e,r,n){for(var a=i.getSubplotIds(n,"gl2d"),o=0;o<a.length;o++){var s=a[o],l=n._plots[s];if(l._scene2d){var u=i.getSubplotData(t,"gl2d",s);0===u.length&&(l._scene2d.destroy(),delete n._plots[s])}}},r.toSVG=function(t){for(var e=t._fullLayout,r=i.getSubplotIds(e,"gl2d"),n=0;n<r.length;n++){var o=e._plots[r[n]],s=o._scene2d,l=s.toImage("png"),u=e._glimages.append("svg:image");u.attr({xmlns:a.svg,"xlink:href":l,x:0,y:0,width:"100%",height:"100%",preserveAspectRatio:"none"}),s.destroy()}}},{"../../constants/xmlns_namespaces":643,"../cartesian/attributes":690,"../plots":751,"./scene2d":728}],728:[function(t,e,r){"use strict";function n(t,e){this.container=t.container,this.graphDiv=t.graphDiv,this.pixelRatio=t.plotGlPixelRatio||window.devicePixelRatio,this.id=t.id,this.staticPlot=!!t.staticPlot,this.fullData=null,this.updateRefs(e),this.makeFramework(),this.glplotOptions=p(this),this.glplotOptions.merge(e),this.glplot=c(this.glplotOptions),this.camera=m(this),this.traces={},this._inputs={},this.spikes=h(this.glplot),this.selectBox=f(this.glplot,{innerFill:!1,outerFill:!0}),this.lastButtonState=0,this.pickResult=null,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.stopped=!1,this.redraw=this.draw.bind(this),this.redraw()}function i(t,e){for(var r=0;r<2;++r){var n=t[r],i=e[r];if(n.length!==i.length)return!0;for(var a=0;a<n.length;++a)if(n[a].x!==i[a].x)return!0}return!1}var a,o,s=t("../../registry"),l=t("../../plots/cartesian/axes"),u=t("../../plots/cartesian/graph_interact"),c=t("gl-plot2d"),h=t("gl-spikes2d"),f=t("gl-select-box"),d=t("webgl-context"),p=t("./convert"),m=t("./camera"),g=t("../../lib/html2unicode"),v=t("../../lib/show_no_webgl_msg"),y=["xaxis","yaxis"];e.exports=n;var x=n.prototype;x.makeFramework=function(){if(this.staticPlot){if(!o&&(a=document.createElement("canvas"),o=d({canvas:a,preserveDrawingBuffer:!1,premultipliedAlpha:!0,antialias:!0}),!o))throw new Error("Error creating static canvas/context for image server");this.canvas=a,this.gl=o}else{var t=document.createElement("canvas"),e=d({canvas:t,premultipliedAlpha:!0});e||v(this),this.canvas=t,this.gl=e}var r=this.canvas;r.style.width="100%",r.style.height="100%",r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style["pointer-events"]="none",this.updateSize(r),r.className+="user-select-none";var n=this.svgContainer=document.createElementNS("http://www.w3.org/2000/svg","svg");n.style.position="absolute",n.style.top=n.style.left="0px",n.style.width=n.style.height="100%",n.style["z-index"]=20,n.style["pointer-events"]="none";var i=this.mouseContainer=document.createElement("div");i.style.position="absolute";var s=this.container;s.appendChild(r),s.appendChild(n),s.appendChild(i)},x.toImage=function(t){t||(t="png"),this.stopped=!0,this.staticPlot&&this.container.appendChild(a),this.updateSize(this.canvas),this.glplot.setDirty(),this.glplot.draw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var o=0,s=n-1;o<s;++o,--s)for(var l=0;l<r;++l)for(var u=0;u<4;++u){var c=i[4*(r*o+l)+u];i[4*(r*o+l)+u]=i[4*(r*s+l)+u],i[4*(r*s+l)+u]=c}var h=document.createElement("canvas");h.width=r,h.height=n;var f=h.getContext("2d"),d=f.createImageData(r,n);d.data.set(i),f.putImageData(d,0,0);var p;switch(t){case"jpeg":p=h.toDataURL("image/jpeg");break;case"webp":p=h.toDataURL("image/webp");break;default:p=h.toDataURL("image/png")}return this.staticPlot&&this.container.removeChild(a),p},x.updateSize=function(t){t||(t=this.canvas);var e=this.pixelRatio,r=this.fullLayout,n=r.width,i=r.height,a=0|Math.ceil(e*n),o=0|Math.ceil(e*i);return t.width===a&&t.height===o||(t.width=a,t.height=o),t},x.computeTickMarks=function(){this.xaxis.setScale(),this.yaxis.setScale(),this.xaxis._length=this.glplot.viewBox[2]-this.glplot.viewBox[0],this.yaxis._length=this.glplot.viewBox[3]-this.glplot.viewBox[1];for(var t=[l.calcTicks(this.xaxis),l.calcTicks(this.yaxis)],e=0;e<2;++e)for(var r=0;r<t[e].length;++r)t[e][r].text=g(t[e][r].text+"");return t},x.updateRefs=function(t){this.fullLayout=t;var e=l.subplotMatch,r="xaxis"+this.id.match(e)[1],n="yaxis"+this.id.match(e)[2];this.xaxis=this.fullLayout[r],this.yaxis=this.fullLayout[n]},x.relayoutCallback=function(){var t=this.graphDiv,e=this.xaxis,r=this.yaxis,n=t.layout;n.xaxis.autorange=e.autorange,n.xaxis.range=e.range.slice(0),n.yaxis.autorange=r.autorange,n.yaxis.range=r.range.slice(0);var i={lastInputTime:this.camera.lastInputTime};i[e._name]=e.range.slice(0),i[r._name]=r.range.slice(0),t.emit("plotly_relayout",i)},x.cameraChanged=function(){var t=this.camera;this.glplot.setDataBox(this.calcDataBox());var e=this.computeTickMarks(),r=this.glplotOptions.ticks;i(e,r)&&(this.glplotOptions.ticks=e,this.glplotOptions.dataBox=t.dataBox,this.glplot.update(this.glplotOptions),this.handleAnnotations())},x.handleAnnotations=function(){for(var t=this.graphDiv,e=this.fullLayout.annotations,r=0;r<e.length;r++){var n=e[r];n.xref===this.xaxis._id&&n.yref===this.yaxis._id&&s.getComponentMethod("annotations","drawOne")(t,r)}},x.destroy=function(){var t=this.traces;t&&Object.keys(t).map(function(e){t[e].dispose(),delete t[e]}),this.glplot.dispose(),this.staticPlot||this.container.removeChild(this.canvas),this.container.removeChild(this.svgContainer),this.container.removeChild(this.mouseContainer),this.fullData=null,this._inputs=null,this.glplot=null,this.stopped=!0},x.plot=function(t,e,r){var n=this.glplot;this.updateRefs(r),this.updateTraces(t,e);var i=r.width,a=r.height;this.updateSize(this.canvas);var o=this.glplotOptions;o.merge(r),o.screenBox=[0,0,i,a];var s=r._size,u=this.xaxis.domain,c=this.yaxis.domain;o.viewBox=[s.l+u[0]*s.w,s.b+c[0]*s.h,i-s.r-(1-u[1])*s.w,a-s.t-(1-c[1])*s.h],this.mouseContainer.style.width=s.w*(u[1]-u[0])+"px",this.mouseContainer.style.height=s.h*(c[1]-c[0])+"px",this.mouseContainer.height=s.h*(c[1]-c[0]),this.mouseContainer.style.left=s.l+u[0]*s.w+"px",this.mouseContainer.style.top=s.t+(1-c[1])*s.h+"px";var h=this.bounds;h[0]=h[1]=1/0,h[2]=h[3]=-(1/0);var f,d,p=Object.keys(this.traces);for(d=0;d<p.length;++d)for(var m=this.traces[p[d]],g=0;g<2;++g)h[g]=Math.min(h[g],m.bounds[g]),h[g+2]=Math.max(h[g+2],m.bounds[g+2]);for(d=0;d<2;++d)h[d]>h[d+2]&&(h[d]=-1,h[d+2]=1),f=this[y[d]],f._length=o.viewBox[d+2]-o.viewBox[d],l.doAutoRange(f),f.setScale();o.ticks=this.computeTickMarks(),o.dataBox=this.calcDataBox(),o.merge(r),n.update(o),this.glplot.draw()},x.calcDataBox=function(){var t=this.xaxis,e=this.yaxis,r=t.range,n=e.range,i=t.r2l,a=e.r2l;return[i(r[0]),a(n[0]),i(r[1]),a(n[1])]},x.setRanges=function(t){var e=this.xaxis,r=this.yaxis,n=e.l2r,i=r.l2r;e.range=[n(t[0]),n(t[2])],r.range=[i(t[1]),i(t[3])]},x.updateTraces=function(t,e){var r,n,i,a=Object.keys(this.traces);this.fullData=t;t:for(r=0;r<a.length;r++){var o=a[r],s=this.traces[o];for(n=0;n<t.length;n++)if(i=t[n],i.uid===o&&i.type===s.type)continue t;s.dispose(),delete this.traces[o]}for(r=0;r<t.length;r++){i=t[r],this._inputs[i.uid]=r;var l=e[r],u=this.traces[i.uid];u?u.update(i,l):(u=i._module.plot(this,i,l),this.traces[i.uid]=u)}},x.emitPointAction=function(t,e){var r=this._inputs[t.trace.uid];this.graphDiv.emit(e,{points:[{x:t.traceCoord[0],y:t.traceCoord[1],curveNumber:r,pointNumber:t.pointIndex,data:this.fullData[r]._input,fullData:this.fullData,xaxis:this.xaxis,yaxis:this.yaxis}]})},x.draw=function(){if(!this.stopped){requestAnimationFrame(this.redraw);var t=this.glplot,e=this.camera,r=e.mouseListener,n=1===this.lastButtonState&&0===r.buttons,i=this.fullLayout;this.lastButtonState=r.buttons,this.cameraChanged();var a=r.x*t.pixelRatio,o=this.canvas.height-t.pixelRatio*r.y;if(e.boxEnabled&&"zoom"===i.dragmode)this.selectBox.enabled=!0,this.selectBox.selectBox=[Math.min(e.boxStart[0],e.boxEnd[0]),Math.min(e.boxStart[1],e.boxEnd[1]),Math.max(e.boxStart[0],e.boxEnd[0]),Math.max(e.boxStart[1],e.boxEnd[1])],t.setDirty();else{this.selectBox.enabled=!1;var s=i._size,l=this.xaxis.domain,c=this.yaxis.domain,h=t.pick(a/t.pixelRatio+s.l+l[0]*s.w,o/t.pixelRatio-(s.t+(1-c[1])*s.h)),f=h&&h.object._trace.handlePick(h);if(f&&n&&this.emitPointAction(f,"plotly_click"),h&&"skip"!==h.object._trace.hoverinfo&&i.hovermode){if(f&&(!this.lastPickResult||this.lastPickResult.traceUid!==f.trace.uid||this.lastPickResult.dataCoord[0]!==f.dataCoord[0]||this.lastPickResult.dataCoord[1]!==f.dataCoord[1])){var d=f;this.lastPickResult={traceUid:f.trace?f.trace.uid:null,dataCoord:f.dataCoord.slice()},this.spikes.update({center:h.dataCoord}),d.screenCoord=[((t.viewBox[2]-t.viewBox[0])*(h.dataCoord[0]-t.dataBox[0])/(t.dataBox[2]-t.dataBox[0])+t.viewBox[0])/t.pixelRatio,(this.canvas.height-(t.viewBox[3]-t.viewBox[1])*(h.dataCoord[1]-t.dataBox[1])/(t.dataBox[3]-t.dataBox[1])-t.viewBox[1])/t.pixelRatio],this.emitPointAction(f,"plotly_hover");var p=d.hoverinfo;if("all"!==p){var m=p.split("+");m.indexOf("x")===-1&&(d.traceCoord[0]=void 0),m.indexOf("y")===-1&&(d.traceCoord[1]=void 0),m.indexOf("z")===-1&&(d.traceCoord[2]=void 0),m.indexOf("text")===-1&&(d.textLabel=void 0),m.indexOf("name")===-1&&(d.name=void 0)}u.loneHover({x:d.screenCoord[0],y:d.screenCoord[1],xLabel:this.hoverFormatter("xaxis",d.traceCoord[0]),yLabel:this.hoverFormatter("yaxis",d.traceCoord[1]),zLabel:d.traceCoord[2],text:d.textLabel,name:d.name,color:d.color},{container:this.svgContainer})}}else!h&&this.lastPickResult&&(this.spikes.update({}),this.lastPickResult=null,this.graphDiv.emit("plotly_unhover"),u.loneUnhover(this.svgContainer))}t.draw()}},x.hoverFormatter=function(t,e){if(void 0!==e){var r=this[t];return l.tickText(r,r.c2l(e),"hover").text}}},{"../../lib/html2unicode":657,"../../lib/show_no_webgl_msg":671,"../../plots/cartesian/axes":691,"../../plots/cartesian/graph_interact":698,"../../registry":766,"./camera":725,"./convert":726,"gl-plot2d":192,"gl-select-box":223,"gl-spikes2d":232,"webgl-context":524}],729:[function(t,e,r){"use strict";function n(t,e){t=t||document.body,e=e||{};var r=[.01,1/0];"distanceLimits"in e&&(r[0]=e.distanceLimits[0],r[1]=e.distanceLimits[1]),"zoomMin"in e&&(r[0]=e.zoomMin),"zoomMax"in e&&(r[1]=e.zoomMax);var n=a({center:e.center||[0,0,0],up:e.up||[0,1,0],eye:e.eye||[0,0,10],mode:e.mode||"orbit",distanceLimits:r}),l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0,c=t.clientWidth,h=t.clientHeight,f={keyBindingMode:"rotate",view:n,element:t,delay:e.delay||16,rotateSpeed:e.rotateSpeed||1,zoomSpeed:e.zoomSpeed||1,translateSpeed:e.translateSpeed||1,flipX:!!e.flipX,flipY:!!e.flipY,modes:n.modes,tick:function(){var e=i(),r=this.delay,a=e-2*r;n.idle(e-r),n.recalcMatrix(a),n.flush(e-(100+2*r));for(var o=!0,s=n.computedMatrix,f=0;f<16;++f)o=o&&l[f]===s[f],l[f]=s[f];var d=t.clientWidth===c&&t.clientHeight===h;return c=t.clientWidth,h=t.clientHeight,o?!d:(u=Math.exp(n.computedRadius[0]),!0)},lookAt:function(t,e,r){n.lookAt(n.lastT(),t,e,r)},rotate:function(t,e,r){n.rotate(n.lastT(),t,e,r)},pan:function(t,e,r){n.pan(n.lastT(),t,e,r)},translate:function(t,e,r){n.translate(n.lastT(),t,e,r)}};Object.defineProperties(f,{matrix:{get:function(){return n.computedMatrix},set:function(t){return n.setMatrix(n.lastT(),t),n.computedMatrix},enumerable:!0},mode:{get:function(){return n.getMode()},set:function(t){var e=n.computedUp.slice(),r=n.computedEye.slice(),a=n.computedCenter.slice();if(n.setMode(t),"turntable"===t){var o=i();n._active.lookAt(o,r,a,e),n._active.lookAt(o+500,r,a,[0,0,1]),n._active.flush(o)}return n.getMode()},enumerable:!0},center:{get:function(){return n.computedCenter},set:function(t){return n.lookAt(n.lastT(),null,t),n.computedCenter},enumerable:!0},eye:{get:function(){return n.computedEye},set:function(t){return n.lookAt(n.lastT(),t),n.computedEye},enumerable:!0},up:{get:function(){return n.computedUp},set:function(t){return n.lookAt(n.lastT(),null,null,t),n.computedUp},enumerable:!0},distance:{get:function(){return u},set:function(t){return n.setDistance(n.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return n.getDistanceLimits(r)},set:function(t){return n.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener("contextmenu",function(t){return t.preventDefault(),!1});var d=0,p=0;return o(t,function(e,r,a,o){var s="rotate"===f.keyBindingMode,l="pan"===f.keyBindingMode,c="zoom"===f.keyBindingMode,h=!!o.control,m=!!o.alt,g=!!o.shift,v=!!(1&e),y=!!(2&e),x=!!(4&e),b=1/t.clientHeight,_=b*(r-d),w=b*(a-p),M=f.flipX?1:-1,A=f.flipY?1:-1,k=i(),T=Math.PI*f.rotateSpeed;if((s&&v&&!h&&!m&&!g||v&&!h&&!m&&g)&&n.rotate(k,M*T*_,-A*T*w,0),(l&&v&&!h&&!m&&!g||y||v&&h&&!m&&!g)&&n.pan(k,-f.translateSpeed*_*u,f.translateSpeed*w*u,0),c&&v&&!h&&!m&&!g||x||v&&!h&&m&&!g){var E=-f.zoomSpeed*w/window.innerHeight*(k-n.lastT())*100;n.pan(k,0,0,u*(Math.exp(E)-1))}return d=r,p=a,!0}),s(t,function(t,e){var r=f.flipX?1:-1,a=f.flipY?1:-1,o=i();if(Math.abs(t)>Math.abs(e))n.rotate(o,0,0,-t*r*Math.PI*f.rotateSpeed/window.innerWidth);else{var s=-f.zoomSpeed*a*e/window.innerHeight*(o-n.lastT())/100;n.pan(o,0,0,u*(Math.exp(s)-1))}},!0),f}e.exports=n;var i=t("right-now"),a=t("3d-view"),o=t("mouse-change"),s=t("mouse-wheel")},{"3d-view":29,"mouse-change":418,"mouse-wheel":420,"right-now":465}],730:[function(t,e,r){"use strict";function n(t,e){for(var r=0;r<3;++r){var n=s[r];e[n]._gd=t}}var i=t("./scene"),a=t("../plots"),o=t("../../constants/xmlns_namespaces"),s=["xaxis","yaxis","zaxis"];r.name="gl3d",r.attr="scene",r.idRoot="scene",r.idRegex=/^scene([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^scene([2-9]|[1-9][0-9]+)?$/,r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){var e=t._fullLayout,r=t._fullData,o=a.getSubplotIds(e,"gl3d");e._paperdiv.style({width:e.width+"px",height:e.height+"px"}),t._context.setBackground(t,e.paper_bgcolor);for(var s=0;s<o.length;s++){var l=o[s],u=a.getSubplotData(r,"gl3d",l),c=e[l],h=c._scene;void 0===h&&(n(t,c),h=new i({id:l,graphDiv:t,container:t.querySelector(".gl-container"),staticPlot:t._context.staticPlot,plotGlPixelRatio:t._context.plotGlPixelRatio},e),c._scene=h),h.plot(u,e,t.layout)}},r.clean=function(t,e,r,n){for(var i=a.getSubplotIds(n,"gl3d"),o=0;o<i.length;o++){var s=i[o];!e[s]&&n[s]._scene&&n[s]._scene.destroy()}},r.toSVG=function(t){for(var e=t._fullLayout,r=a.getSubplotIds(e,"gl3d"),n=e._size,i=0;i<r.length;i++){var s=e[r[i]],l=s.domain,u=s._scene,c=u.toImage("png"),h=e._glimages.append("svg:image");h.attr({xmlns:o.svg,"xlink:href":c,x:n.l+n.w*l.x[0],y:n.t+n.h*(1-l.y[1]),width:n.w*(l.x[1]-l.x[0]),height:n.h*(l.y[1]-l.y[0]),preserveAspectRatio:"none"}),u.destroy()}},r.cleanId=function(t){if(t.match(/^scene[0-9]*$/)){var e=t.substr(5);return"1"===e&&(e=""),"scene"+e}},r.setConvert=t("./set_convert")},{"../../constants/xmlns_namespaces":643,"../plots":751,"./layout/attributes":731,"./layout/defaults":735,"./layout/layout_attributes":736,"./scene":740,"./set_convert":741}],731:[function(t,e,r){"use strict";e.exports={scene:{valType:"subplotid",dflt:"scene"}}},{}],732:[function(t,e,r){"use strict";var n=t("../../../components/color"),i=t("../../cartesian/layout_attributes"),a=t("../../../lib/extend").extendFlat;e.exports={showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:n.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:i.color,categoryorder:i.categoryorder,categoryarray:i.categoryarray,title:i.title,titlefont:i.titlefont,type:i.type,autorange:i.autorange,rangemode:i.rangemode,range:i.range,tickmode:i.tickmode,nticks:i.nticks,tick0:i.tick0,dtick:i.dtick,tickvals:i.tickvals,ticktext:i.ticktext,ticks:i.ticks,mirror:i.mirror,ticklen:i.ticklen,tickwidth:i.tickwidth,tickcolor:i.tickcolor,showticklabels:i.showticklabels,tickfont:i.tickfont,tickangle:i.tickangle,tickprefix:i.tickprefix,showtickprefix:i.showtickprefix,ticksuffix:i.ticksuffix,showticksuffix:i.showticksuffix,showexponent:i.showexponent,exponentformat:i.exponentformat,separatethousands:i.separatethousands,tickformat:i.tickformat,hoverformat:i.hoverformat,showline:i.showline,linecolor:i.linecolor,linewidth:i.linewidth,showgrid:i.showgrid,gridcolor:a({},i.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:i.gridwidth,zeroline:i.zeroline,zerolinecolor:i.zerolinecolor,zerolinewidth:i.zerolinewidth}},{"../../../components/color":558,"../../../lib/extend":651,"../../cartesian/layout_attributes":700}],733:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,i=t("../../../lib"),a=t("./axis_attributes"),o=t("../../cartesian/axis_defaults"),s=["xaxis","yaxis","zaxis"],l=13600/187;e.exports=function(t,e,r){function u(t,e){return i.coerce(c,h,a,t,e)}for(var c,h,f=0;f<s.length;f++){var d=s[f];c=t[d]||{},h={_id:d[0]+r.scene,_name:d},e[d]=h=o(c,h,u,{font:r.font,letter:d[0],data:r.data,showGrid:!0,bgColor:r.bgColor,calendar:r.calendar}),u("gridcolor",n(h.color,r.bgColor,l).toRgbString()),u("title",d[0]),h.setScale=i.noop,u("showspikes")&&(u("spikesides"),u("spikethickness"),u("spikecolor",h.color)),u("showaxeslabels"),u("showbackground")&&u("backgroundcolor")}}},{"../../../lib":658,"../../cartesian/axis_defaults":693,"./axis_attributes":732,tinycolor2:495}],734:[function(t,e,r){"use strict";function n(){this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[18,18,18],this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["Open Sans","Open Sans","Open Sans"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[30,30,30],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[10,10,10],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!0,!0,!0],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._defaultTickPad=l(this.tickPad),this._defaultLabelPad=l(this.labelPad),this._defaultLineTickLength=l(this.lineTickLength)}function i(t){var e=new n;return e.merge(t),e}var a=t("arraytools"),o=t("../../../lib/html2unicode"),s=t("../../../lib/str2rgbarray"),l=a.copy1D,u=["xaxis","yaxis","zaxis"],c=n.prototype;c.merge=function(t){for(var e=this,r=0;r<3;++r){var n=t[u[r]];e.labels[r]=o(n.title),"titlefont"in n&&(n.titlefont.color&&(e.labelColor[r]=s(n.titlefont.color)),n.titlefont.family&&(e.labelFont[r]=n.titlefont.family),n.titlefont.size&&(e.labelSize[r]=n.titlefont.size)),"showline"in n&&(e.lineEnable[r]=n.showline),"linecolor"in n&&(e.lineColor[r]=s(n.linecolor)),"linewidth"in n&&(e.lineWidth[r]=n.linewidth),"showgrid"in n&&(e.gridEnable[r]=n.showgrid),"gridcolor"in n&&(e.gridColor[r]=s(n.gridcolor)),"gridwidth"in n&&(e.gridWidth[r]=n.gridwidth),"log"===n.type?e.zeroEnable[r]=!1:"zeroline"in n&&(e.zeroEnable[r]=n.zeroline),"zerolinecolor"in n&&(e.zeroLineColor[r]=s(n.zerolinecolor)),"zerolinewidth"in n&&(e.zeroLineWidth[r]=n.zerolinewidth),"ticks"in n&&n.ticks?e.lineTickEnable[r]=!0:e.lineTickEnable[r]=!1,"ticklen"in n&&(e.lineTickLength[r]=e._defaultLineTickLength[r]=n.ticklen),"tickcolor"in n&&(e.lineTickColor[r]=s(n.tickcolor)),"tickwidth"in n&&(e.lineTickWidth[r]=n.tickwidth),"tickangle"in n&&(e.tickAngle[r]="auto"===n.tickangle?0:Math.PI*-n.tickangle/180),"showticklabels"in n&&(e.tickEnable[r]=n.showticklabels),"tickfont"in n&&(n.tickfont.color&&(e.tickColor[r]=s(n.tickfont.color)),n.tickfont.family&&(e.tickFont[r]=n.tickfont.family),n.tickfont.size&&(e.tickSize[r]=n.tickfont.size)),"mirror"in n?["ticks","all","allticks"].indexOf(n.mirror)!==-1?(e.lineTickMirror[r]=!0,e.lineMirror[r]=!0):n.mirror===!0?(e.lineTickMirror[r]=!1,e.lineMirror[r]=!0):(e.lineTickMirror[r]=!1,e.lineMirror[r]=!1):e.lineMirror[r]=!1,"showbackground"in n&&n.showbackground!==!1?(e.backgroundEnable[r]=!0,e.backgroundColor[r]=s(n.backgroundcolor)):e.backgroundEnable[r]=!1}},e.exports=i},{"../../../lib/html2unicode":657,"../../../lib/str2rgbarray":673,arraytools:35}],735:[function(t,e,r){"use strict";function n(t,e,r,n){for(var a=r("bgcolor"),l=i.combine(a,n.paper_bgcolor),u=Object.keys(o.camera),c=0;c<u.length;c++)r("camera."+u[c]+".x"),r("camera."+u[c]+".y"),r("camera."+u[c]+".z");var h=!!r("aspectratio.x")&&!!r("aspectratio.y")&&!!r("aspectratio.z"),f=h?"manual":"auto",d=r("aspectmode",f);h||(t.aspectratio=e.aspectratio={x:1,y:1,z:1},"manual"===d&&(e.aspectmode="auto")),s(t,e,{font:n.font,scene:n.id,data:n.fullData,bgColor:l,calendar:n.calendar}),r("dragmode",n.getDfltFromLayout("dragmode")),r("hovermode",n.getDfltFromLayout("hovermode"))}var i=t("../../../components/color"),a=t("../../subplot_defaults"),o=t("./layout_attributes"),s=t("./axis_defaults");e.exports=function(t,e,r){function i(e){if(!s){var r=o[e].values.indexOf(t[e])!==-1;return r?t[e]:void 0}}var s=e._has("cartesian")||e._has("geo")||e._has("gl2d")||e._has("pie")||e._has("ternary");a(t,e,r,{type:"gl3d",attributes:o,handleDefaults:n,font:e.font,fullData:r,getDfltFromLayout:i,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":558,"../../subplot_defaults":758,"./axis_defaults":733,"./layout_attributes":736}],736:[function(t,e,r){"use strict";function n(t,e,r){return{x:{valType:"number",dflt:t},y:{valType:"number",dflt:e},z:{valType:"number",dflt:r}}}var i=t("./axis_attributes"),a=t("../../../lib/extend").extendFlat;e.exports={bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},camera:{up:a(n(0,0,1),{}),center:a(n(0,0,0),{}),eye:a(n(1.25,1.25,1.25),{})},domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto"},aspectratio:{x:{valType:"number",min:0},y:{valType:"number",min:0},z:{valType:"number",min:0}},xaxis:i,yaxis:i,zaxis:i,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan"],dflt:"turntable"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest"},_deprecated:{cameraposition:{valType:"info_array"}}}},{"../../../lib/extend":651,"./axis_attributes":732}],737:[function(t,e,r){"use strict";function n(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}function i(t){var e=new n;return e.merge(t),e}var a=t("../../../lib/str2rgbarray"),o=["xaxis","yaxis","zaxis"],s=n.prototype;s.merge=function(t){for(var e=0;e<3;++e){var r=t[o[e]];this.enabled[e]=r.showspikes,this.colors[e]=a(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness}},e.exports=i},{"../../../lib/str2rgbarray":673}],738:[function(t,e,r){"use strict";function n(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;a<n.length;++a)i[a]=n[a].x;e[r]=i}return e}function i(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,i=t.fullSceneLayout,c=[[],[],[]],h=0;h<3;++h){var f=i[l[h]];if(f._length=(r[h].hi-r[h].lo)*r[h].pixelsPerDataUnit/t.dataScale[h],Math.abs(f._length)===1/0)c[h]=[];else{f.range[0]=r[h].lo/t.dataScale[h],f.range[1]=r[h].hi/t.dataScale[h],f._m=1/(t.dataScale[h]*r[h].pixelsPerDataUnit),f.range[0]===f.range[1]&&(f.range[0]-=1,f.range[1]+=1);var d=f.tickmode;if("auto"===f.tickmode){f.tickmode="linear";var p=f.nticks||o.constrain(f._length/40,4,9);a.autoTicks(f,Math.abs(f.range[1]-f.range[0])/p)}for(var m=a.calcTicks(f),g=0;g<m.length;++g)m[g].x=m[g].x*t.dataScale[h],m[g].text=s(m[g].text);c[h]=m,f.tickmode=d}}e.ticks=c;for(var h=0;h<3;++h){u[h]=.5*(t.glplot.bounds[0][h]+t.glplot.bounds[1][h]);for(var g=0;g<2;++g)e.bounds[g][h]=t.glplot.bounds[g][h]}t.contourLevels=n(c)}e.exports=i;var a=t("../../cartesian/axes"),o=t("../../../lib"),s=t("../../../lib/html2unicode"),l=["xaxis","yaxis","zaxis"],u=[0,0,0]},{"../../../lib":658,"../../../lib/html2unicode":657,"../../cartesian/axes":691}],739:[function(t,e,r){"use strict";function n(t,e){var r,n,i=[0,0,0,0];for(r=0;r<4;++r)for(n=0;n<4;++n)i[n]+=t[4*r+n]*e[r];return i}function i(t,e){var r=n(t.projection,n(t.view,n(t.model,[e[0],e[1],e[2],1])));return r}e.exports=i},{}],740:[function(t,e,r){"use strict";function n(t){function e(e,r){if("string"==typeof r)return r;var n=t.fullSceneLayout[e];return m.tickText(n,n.c2l(r),"hover").text}var r,n=t.svgContainer,i=t.container.getBoundingClientRect(),a=i.width,o=i.height;n.setAttributeNS(null,"viewBox","0 0 "+a+" "+o),n.setAttributeNS(null,"width",a),n.setAttributeNS(null,"height",o),A(t),t.glplot.axes.update(t.axesOptions);for(var s=Object.keys(t.traces),l=null,u=t.glplot.selection,c=0;c<s.length;++c)r=t.traces[s[c]],"skip"!==r.data.hoverinfo&&r.handlePick(u)&&(l=r),r.setContourLevels&&r.setContourLevels();var h;if(null!==l){var f=b(t.glplot.cameraParams,u.dataCoordinate);r=l.data;var d=r.hoverinfo,p=e("xaxis",u.traceCoordinate[0]),v=e("yaxis",u.traceCoordinate[1]),y=e("zaxis",u.traceCoordinate[2]);if("all"!==d){var x=d.split("+");x.indexOf("x")===-1&&(p=void 0),x.indexOf("y")===-1&&(v=void 0),x.indexOf("z")===-1&&(y=void 0),x.indexOf("text")===-1&&(u.textLabel=void 0),x.indexOf("name")===-1&&(l.name=void 0)}t.fullSceneLayout.hovermode&&g.loneHover({x:(.5+.5*f[0]/f[3])*a,y:(.5-.5*f[1]/f[3])*o,xLabel:p,yLabel:v,zLabel:y,text:u.textLabel,name:l.name,color:l.color},{container:n});var _={points:[{x:p,y:v,z:y,data:r._input,fullData:r,curveNumber:r.index,pointNumber:u.data.index}]};u.buttons&&u.distance<5?t.graphDiv.emit("plotly_click",_):t.graphDiv.emit("plotly_hover",_),h=_}else g.loneUnhover(n),t.graphDiv.emit("plotly_unhover",h)}function i(t,e,r,i){var a={canvas:r,gl:i,container:t.container,axes:t.axesOptions,spikes:t.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1};if(t.staticMode){if(!h&&(c=document.createElement("canvas"),h=d({canvas:c,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}),!h))throw new Error("error creating static canvas/context for image server");a.pixelRatio=t.pixelRatio,a.gl=h,a.canvas=c}try{t.glplot=f(a)}catch(e){y(t)}var o=function(t){var e={};e[t.id]=u(t.camera),t.saveCamera(t.graphDiv.layout),t.graphDiv.emit("plotly_relayout",e)};if(t.glplot.canvas.addEventListener("mouseup",o.bind(null,t)),t.glplot.canvas.addEventListener("wheel",o.bind(null,t)),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",function(t){p.warn("Lost WebGL context."),t.preventDefault()}),!t.camera){var s=t.fullSceneLayout.camera;t.camera=x(t.container,{center:[s.center.x,s.center.y,s.center.z],eye:[s.eye.x,s.eye.y,s.eye.z],up:[s.up.x,s.up.y,s.up.z],zoomMin:.1,zoomMax:100,mode:"orbit"})}return t.glplot.camera=t.camera,t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=n.bind(null,t),t.traces={},!0}function a(t,e){var r=document.createElement("div"),n=t.container;this.graphDiv=t.graphDiv;var a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.style.position="absolute",a.style.top=a.style.left="0px",a.style.width=a.style.height="100%",a.style["z-index"]=20,a.style["pointer-events"]="none",r.appendChild(a),this.svgContainer=a,r.id=t.id,r.style.position="absolute",r.style.top=r.style.left="0px",r.style.width=r.style.height="100%",n.appendChild(r),this.fullLayout=e,this.id=t.id||"scene",this.fullSceneLayout=e[this.id],this.plotArgs=[[],{},{}],this.axesOptions=w(e[this.id]),this.spikeOptions=M(e[this.id]),this.container=r,this.staticMode=!!t.staticPlot,this.pixelRatio=t.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],!i(this,e)}function o(t,e,r,n,i){for(var a,o=0;o<e.length;++o)if(Array.isArray(e[o]))for(var s=0;s<e[o].length;++s)a=t.d2l(e[o][s],0,i),!isNaN(a)&&isFinite(a)&&(n[0][r]=Math.min(n[0][r],a),n[1][r]=Math.max(n[1][r],a));else a=t.d2l(e[o],0,i),!isNaN(a)&&isFinite(a)&&(n[0][r]=Math.min(n[0][r],a),n[1][r]=Math.max(n[1][r],a))}function s(t,e,r){var n=t.fullSceneLayout;o(n.xaxis,e.x,0,r,e.xcalendar),o(n.yaxis,e.y,1,r,e.ycalendar),o(n.zaxis,e.z,2,r,e.zcalendar)}function l(t){return[[t.eye.x,t.eye.y,t.eye.z],[t.center.x,t.center.y,t.center.z],[t.up.x,t.up.y,t.up.z]]}function u(t){return{up:{x:t.up[0],y:t.up[1],z:t.up[2]},center:{x:t.center[0],y:t.center[1],z:t.center[2]},eye:{x:t.eye[0],y:t.eye[1],z:t.eye[2]}}}var c,h,f=t("gl-plot3d"),d=t("webgl-context"),p=t("../../lib"),m=t("../../plots/cartesian/axes"),g=t("../../plots/cartesian/graph_interact"),v=t("../../lib/str2rgbarray"),y=t("../../lib/show_no_webgl_msg"),x=t("./camera"),b=t("./project"),_=t("./set_convert"),w=t("./layout/convert"),M=t("./layout/spikes"),A=t("./layout/tick_marks"),k=a.prototype;k.recoverContext=function(){function t(){return r.isContextLost()?void requestAnimationFrame(t):i(e,e.fullLayout,n,r)?void e.plot.apply(e,e.plotArgs):void p.error("Catastrophic and unrecoverable WebGL error. Context lost.")}var e=this,r=this.glplot.gl,n=this.glplot.canvas;this.glplot.dispose(),requestAnimationFrame(t)};var T=["xaxis","yaxis","zaxis"];k.plot=function(t,e,r){if(this.plotArgs=[t,e,r],!this.glplot.contextLost){var n,i,a,o,l,u,c=e[this.id],h=r[this.id];for(c.bgcolor?this.glplot.clearColor=v(c.bgcolor):this.glplot.clearColor=[0,0,0,0],this.glplot.snapToData=!0,this.fullSceneLayout=c,this.glplotLayout=c,this.axesOptions.merge(c),this.spikeOptions.merge(c),this.updateFx(c.dragmode,c.hovermode),this.glplot.update({}),a=0;a<3;++a)l=c[T[a]],_(l);t?Array.isArray(t)||(t=[t]):t=[];var f=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]];for(a=0;a<t.length;++a)n=t[a],n.visible===!0&&s(this,n,f);var d=[1,1,1];for(o=0;o<3;++o)f[0][o]>f[1][o]?d[o]=1:f[1][o]===f[0][o]?d[o]=1:d[o]=1/(f[1][o]-f[0][o]);for(this.dataScale=d,a=0;a<t.length;++a)n=t[a],n.visible===!0&&(i=this.traces[n.uid],i?i.update(n):(i=n._module.plot(this,n),this.traces[n.uid]=i),i.name=n.name);var p=Object.keys(this.traces);t:for(a=0;a<p.length;++a){for(o=0;o<t.length;++o)if(t[o].uid===p[a]&&t[o].visible===!0)continue t;i=this.traces[p[a]],i.dispose(),delete this.traces[p[a]]}var m=[[0,0,0],[0,0,0]],g=[],y={};for(a=0;a<3;++a){if(l=c[T[a]],u=l.type,u in y?(y[u].acc*=d[a],y[u].count+=1):y[u]={acc:d[a],count:1},l.autorange){for(m[0][a]=1/0,m[1][a]=-(1/0),o=0;o<this.glplot.objects.length;++o){var x=this.glplot.objects[o].bounds;m[0][a]=Math.min(m[0][a],x[0][a]/d[a]),m[1][a]=Math.max(m[1][a],x[1][a]/d[a])}if("rangemode"in l&&"tozero"===l.rangemode&&(m[0][a]=Math.min(m[0][a],0),m[1][a]=Math.max(m[1][a],0)),m[0][a]>m[1][a])m[0][a]=-1,m[1][a]=1;else{var b=m[1][a]-m[0][a];m[0][a]-=b/32,m[1][a]+=b/32}}else{var w=c[T[a]].range;m[0][a]=w[0],m[1][a]=w[1]}m[0][a]===m[1][a]&&(m[0][a]-=1,m[1][a]+=1),g[a]=m[1][a]-m[0][a],this.glplot.bounds[0][a]=m[0][a]*d[a],this.glplot.bounds[1][a]=m[1][a]*d[a]}var M=[1,1,1];for(a=0;a<3;++a){l=c[T[a]],u=l.type;var A=y[u];M[a]=Math.pow(A.acc,1/A.count)/d[a]}var k,E=4;if("auto"===c.aspectmode)k=Math.max.apply(null,M)/Math.min.apply(null,M)<=E?M:[1,1,1];else if("cube"===c.aspectmode)k=[1,1,1];else if("data"===c.aspectmode)k=M;else{if("manual"!==c.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var S=c.aspectratio;k=[S.x,S.y,S.z]}c.aspectratio.x=h.aspectratio.x=k[0],c.aspectratio.y=h.aspectratio.y=k[1],c.aspectratio.z=h.aspectratio.z=k[2],this.glplot.aspect=k;var L=c.domain||null,C=e._size||null;if(L&&C){var I=this.container.style;I.position="absolute",I.left=C.l+L.x[0]*C.w+"px",I.top=C.t+(1-L.y[1])*C.h+"px",I.width=C.w*(L.x[1]-L.x[0])+"px",I.height=C.h*(L.y[1]-L.y[0])+"px"}this.glplot.redraw()}},k.destroy=function(){this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null},k.setCameraToDefault=function(){this.setCamera({eye:{x:1.25,y:1.25,z:1.25},center:{x:0,y:0,z:0},up:{x:0,y:0,z:1}})},k.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),u(this.glplot.camera)},k.setCamera=function(t){var e={};e[this.id]=t,this.glplot.camera.lookAt.apply(this,l(t)),this.graphDiv.emit("plotly_relayout",e)},k.saveCamera=function(t){function e(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return e[i[r]]&&t[i[r]][a[n]]===e[i[r]][a[n]]}var r=this.getCamera(),n=p.nestedProperty(t,this.id+".camera"),i=n.get(),a=!1;if(void 0===i)a=!0;else for(var o=0;o<3;o++)for(var s=0;s<3;s++)if(!e(r,i,o,s)){a=!0;break}return a&&n.set(r),a},k.updateFx=function(t,e){var r=this.camera;r&&("orbit"===t?(r.mode="orbit",r.keyBindingMode="rotate"):"turntable"===t?(r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate"):r.keyBindingMode=t),this.fullSceneLayout.hovermode=e},k.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(c),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var a=0,o=n-1;a<o;++a,--o)for(var s=0;s<r;++s)for(var l=0;l<4;++l){var u=i[4*(r*a+s)+l];i[4*(r*a+s)+l]=i[4*(r*o+s)+l],i[4*(r*o+s)+l]=u}var h=document.createElement("canvas");h.width=r,h.height=n;var f=h.getContext("2d"),d=f.createImageData(r,n);d.data.set(i),f.putImageData(d,0,0);var p;switch(t){case"jpeg":p=h.toDataURL("image/jpeg");break;case"webp":p=h.toDataURL("image/webp");break;default:p=h.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(c),p},e.exports=a},{"../../lib":658,"../../lib/show_no_webgl_msg":671,"../../lib/str2rgbarray":673,"../../plots/cartesian/axes":691,"../../plots/cartesian/graph_interact":698,"./camera":729,"./layout/convert":734,"./layout/spikes":737,"./layout/tick_marks":738,"./project":739,"./set_convert":741,"gl-plot3d":194,"webgl-context":524}],741:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../cartesian/axes");e.exports=function(t){i.setConvert(t),t.setScale=n.noop}},{"../../lib":658,"../cartesian/axes":691}],742:[function(t,e,r){"use strict";var n=t("../lib"),i=n.extendFlat,a=t("./font_attributes"),o=t("../components/color/attributes");e.exports={font:{family:i({},a.family,{dflt:'"Open Sans", verdana, arial, sans-serif'}),size:i({},a.size,{dflt:12}),color:i({},a.color,{dflt:o.defaultLine})},title:{valType:"string",dflt:"Click to enter Plot title"},titlefont:i({},a,{}),autosize:{valType:"boolean",dflt:!1},width:{valType:"number",min:10,dflt:700},height:{valType:"number",min:10,dflt:450},margin:{l:{valType:"number",min:0,dflt:80},r:{valType:"number",min:0,dflt:80},t:{valType:"number",min:0,dflt:100},b:{valType:"number",min:0,dflt:80},pad:{valType:"number",min:0,dflt:0},autoexpand:{valType:"boolean",dflt:!0}},paper_bgcolor:{valType:"color",dflt:o.background},plot_bgcolor:{valType:"color",dflt:o.background},separators:{valType:"string",dflt:".,"},hidesources:{valType:"boolean",dflt:!1},smith:{valType:"enumerated",values:[!1],dflt:!1},showlegend:{valType:"boolean"},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom"},hovermode:{valType:"enumerated",values:["x","y","closest",!1]}}},{"../components/color/attributes":557,"../lib":658,"./font_attributes":711}],743:[function(t,e,r){"use strict";e.exports={styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",controlContainerClassName:"mapboxgl-control-container",noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:","  Plotly.plot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),mapOnErrorMsg:"Mapbox error."}},{}],744:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r=t.split(" "),i=r[0],a=r[1],o=Array.isArray(e)?n.mean(e):e,s=.5+o/100,l=1.5+o/100,u=["",""],c=[0,0];switch(i){case"top":u[0]="top",c[1]=-l;break;case"bottom":u[0]="bottom",c[1]=l}switch(a){case"left":u[1]="right",c[0]=-s;break;case"right":u[1]="left",c[0]=s}var h;return h=u[0]&&u[1]?u.join("-"):u[0]?u[0]:u[1]?u[1]:"center",{anchor:h,offset:c}}},{"../../lib":658}],745:[function(t,e,r){"use strict";function n(t,e){var r=t._fullLayout,n=t._context;if(""===n.mapboxAccessToken)return"";for(var i=n.mapboxAccessToken,a=0;a<e.length;a++){var o=r[e[a]];if(o.accesstoken){i=o.accesstoken;break}}if(!i)throw new Error(l.noAccessTokenErrorMsg);return i}var i=t("mapbox-gl"),a=t("../plots"),o=t("../../constants/xmlns_namespaces"),s=t("./mapbox"),l=t("./constants");r.name="mapbox",r.attr="subplot",r.idRoot="mapbox",r.idRegex=/^mapbox([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^mapbox([2-9]|[1-9][0-9]+)?$/,r.attributes={subplot:{valType:"subplotid",dflt:"mapbox"}},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,o=a.getSubplotIds(e,"mapbox"),l=n(t,o);i.accessToken=l;for(var u=0;u<o.length;u++){var c=o[u],h=a.getSubplotCalcData(r,"mapbox",c),f=e[c],d=f._subplot;f.accesstoken=l,d||(d=s({gd:t,container:e._glcontainer.node(),id:c,fullLayout:e,staticPlot:t._context.staticPlot}),e[c]._subplot=d),d.plot(h,e,t._promises)}},r.clean=function(t,e,r,n){for(var i=a.getSubplotIds(n,"mapbox"),o=0;o<i.length;o++){var s=i[o];!e[s]&&n[s]._subplot&&n[s]._subplot.destroy()}},r.toSVG=function(t){for(var e=t._fullLayout,r=a.getSubplotIds(e,"mapbox"),n=e._size,i=0;i<r.length;i++){var s=e[r[i]],l=s.domain,u=s._subplot,c=u.toImage("png"),h=e._glimages.append("svg:image");h.attr({xmlns:o.svg,"xlink:href":c,x:n.l+n.w*l.x[0],y:n.t+n.h*(1-l.y[1]),width:n.w*(l.x[1]-l.x[0]),height:n.h*(l.y[1]-l.y[0]),preserveAspectRatio:"none"}),u.destroy()}}},{"../../constants/xmlns_namespaces":643,"../plots":751,"./constants":743,"./layout_attributes":747,"./layout_defaults":748,"./mapbox":749,"mapbox-gl":309}],746:[function(t,e,r){"use strict";function n(t,e){this.mapbox=t,this.map=t.map,this.uid=t.uid+"-layer"+e,this.idSource=this.uid+"-source",this.idLayer=this.uid+"-layer",this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}function i(t){var e=t.source;return s.isPlainObject(e)||"string"==typeof e&&e.length>0}function a(t){var e={},r={};switch(t.type){case"circle":s.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":s.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity});break;case"fill":s.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var n=t.symbol,i=l(n.textposition,n.iconsize);s.extendFlat(e,{"icon-image":n.icon+"-15","icon-size":n.iconsize/10,"text-field":n.text,"text-size":n.textfont.size,"text-anchor":i.anchor,"text-offset":i.offset}),s.extendFlat(r,{"icon-color":t.color,"text-color":n.textfont.color,"text-opacity":t.opacity})}return{layout:e,paint:r}}function o(t){var e,r=t.sourcetype,n=t.source,i={type:r},a="string"==typeof n;return"geojson"===r?e="data":"vector"===r&&(e=a?"url":"tiles"),i[e]=n,i}var s=t("../../lib"),l=t("./convert_text_opts"),u=n.prototype;u.update=function(t){this.visible?this.needsNewSource(t)?(this.updateLayer(t),this.updateSource(t)):this.needsNewLayer(t)&&this.updateLayer(t):(this.updateSource(t),this.updateLayer(t)),this.updateStyle(t),this.visible=i(t)},u.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},u.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==t.below},u.updateSource=function(t){var e=this.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,i(t)){var r=o(t);e.addSource(this.idSource,r)}},u.updateLayer=function(t){var e=this.map;if(e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),this.layerType=t.type,i(t)){e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type},t.below);var r={visibility:"visible"};this.mapbox.setOptions(this.idLayer,"setLayoutProperty",r)}},u.updateStyle=function(t){var e=a(t);i(t)&&(this.mapbox.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.mapbox.setOptions(this.idLayer,"setPaintProperty",e.paint))},u.dispose=function(){var t=this.map;t.removeLayer(this.idLayer),t.removeSource(this.idSource)},e.exports=function(t,e,r){var i=new n(t,e);return i.update(r),i}},{"../../lib":658,"./convert_text_opts":744}],747:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color").defaultLine,a=t("../font_attributes"),o=t("../../traces/scatter/attributes").textposition;e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],dflt:"basic"},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},layers:{_isLinkedToArray:"layer",sourcetype:{valType:"enumerated",values:["geojson","vector"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},type:{valType:"enumerated",values:["circle","line","fill","symbol"],dflt:"circle"},below:{valType:"string",dflt:""},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},textfont:n.extendDeep({},a,{family:{dflt:"Open Sans Regular, Arial Unicode MS Regular"}}),textposition:n.extendFlat({},o,{arrayOk:!1})}}}},{"../../components/color":558,"../../lib":658,"../../traces/scatter/attributes":884,"../font_attributes":711}],748:[function(t,e,r){"use strict";function n(t,e,r){r("accesstoken"),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch"),i(t,e),e._input=t}function i(t,e){function r(t,e){return a.coerce(n,i,s.layers,t,e)}for(var n,i,o=t.layers||[],l=e.layers=[],u=0;u<o.length;u++)if(n=o[u],i={},a.isPlainObject(n)){var c=r("sourcetype");r("source"),"vector"===c&&r("sourcelayer");var h=r("type");r("below"),r("color"),r("opacity"),"circle"===h&&r("circle.radius"),"line"===h&&r("line.width"),"fill"===h&&r("fill.outlinecolor"),"symbol"===h&&(r("symbol.icon"),r("symbol.iconsize"),r("symbol.text"),a.coerceFont(r,"symbol.textfont"),r("symbol.textposition")),i._index=u,l.push(i)}}var a=t("../../lib"),o=t("../subplot_defaults"),s=t("./layout_attributes");e.exports=function(t,e,r){o(t,e,r,{type:"mapbox",attributes:s,handleDefaults:n,partition:"y"})}},{"../../lib":658,"../subplot_defaults":758,"./layout_attributes":747}],749:[function(t,e,r){"use strict";function n(t){this.id=t.id,this.gd=t.gd,this.container=t.container,this.isStatic=t.staticPlot;var e=t.fullLayout;this.uid=e._uid+"-"+this.id,this.opts=e[this.id],this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(e),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[]}function i(t){var e=h.style.values,r=h.style.dflt,n={};return u.isPlainObject(t)?(n.id=t.id,n.style=t):"string"==typeof t?(n.id=t,n.style=e.indexOf(t)!==-1?a(t):t):(n.id=r,n.style=a(r)),n}function a(t){return c.styleUrlPrefix+t+"-"+c.styleUrlSuffix}function o(t){return[t.lon,t.lat]}var s=t("mapbox-gl"),l=t("../cartesian/graph_interact"),u=t("../../lib"),c=t("./constants"),h=t("./layout_attributes"),f=t("./layers"),d=n.prototype;e.exports=function(t){var e=new n(t);return e},d.plot=function(t,e,r){var n=this,i=n.opts=e[this.id];n.map&&i.accesstoken!==n.accessToken&&(n.map.remove(),n.map=null,n.styleObj=null,n.traceHash=[],n.layerList={});var a;a=n.map?new Promise(function(r,i){n.updateMap(t,e,r,i)}):new Promise(function(r,i){n.createMap(t,e,r,i)}),r.push(a)},d.createMap=function(t,e,r,n){function a(){l.loneUnhover(e._toppaper)}var h=this,f=h.gd,d=h.opts,p=h.styleObj=i(d.style);h.accessToken=d.accesstoken;var m=h.map=new s.Map({container:h.div,style:p.style,center:o(d.center),zoom:d.zoom,bearing:d.bearing,pitch:d.pitch,interactive:!h.isStatic,preserveDrawingBuffer:h.isStatic}),g=c.controlContainerClassName,v=h.div.getElementsByClassName(g)[0];h.div.removeChild(v),h.rejectOnError(n),m.once("load",function(){h.updateData(t),h.updateLayout(e),h.resolveOnRender(r)}),m.on("moveend",function(t){if(h.map){var e=h.getView();if(d._input.center=d.center=e.center,d._input.zoom=d.zoom=e.zoom,d._input.bearing=d.bearing=e.bearing,d._input.pitch=d.pitch=e.pitch,t.originalEvent){var r={};r[h.id]=u.extendFlat({},e),f.emit("plotly_relayout",r)}}}),m.on("mousemove",function(t){var e=h.div.getBoundingClientRect();t.clientX=t.point.x+e.left,t.clientY=t.point.y+e.top,t.target.getBoundingClientRect=function(){return e},h.xaxis.p2c=function(){return t.lngLat.lng},h.yaxis.p2c=function(){return t.lngLat.lat},l.hover(f,t,h.id)}),m.on("click",function(){l.click(f,{target:!0})}),m.on("dragstart",a),m.on("zoomstart",a)},d.updateMap=function(t,e,r,n){var a=this,o=a.map;a.rejectOnError(n);var s=i(a.opts.style);a.styleObj.id!==s.id?(a.styleObj=s,o.setStyle(s.style),o.style.once("load",function(){a.traceHash={},a.updateData(t),a.updateLayout(e),a.resolveOnRender(r)})):(a.updateData(t),a.updateLayout(e),a.resolveOnRender(r))},d.updateData=function(t){var e,r,n,i,a=this.traceHash;for(n=0;n<t.length;n++){var o=t[n];r=o[0].trace,e=a[r.uid],e?e.update(o):r._module&&(a[r.uid]=r._module.plot(this,o))}var s=Object.keys(a);t:for(n=0;n<s.length;n++){var l=s[n];for(i=0;i<t.length;i++)if(r=t[i][0].trace,l===r.uid)continue t;e=a[l],e.dispose(),delete a[l]}},d.updateLayout=function(t){var e=this.map,r=this.opts;e.setCenter(o(r.center)),e.setZoom(r.zoom),e.setBearing(r.bearing),e.setPitch(r.pitch),this.updateLayers(),this.updateFramework(t),this.map.resize()},d.resolveOnRender=function(t){var e=this.map;e.on("render",function r(){e.loaded()&&(e.off("render",r),t())})},d.rejectOnError=function(t){function e(){t(new Error(c.mapOnErrorMsg))}var r=this.map;r.once("error",e),r.once("style.error",e),r.once("source.error",e),r.once("tile.error",e),r.once("layer.error",e)},d.createFramework=function(t){var e=this,r=e.div=document.createElement("div");r.id=e.uid,r.style.position="absolute",e.container.appendChild(r),e.xaxis={_id:"x",c2p:function(t){return e.project(t).x}},e.yaxis={_id:"y",c2p:function(t){return e.project(t).y}},e.updateFramework(t)},d.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},d.updateLayers=function(){var t,e=this.opts,r=e.layers,n=this.layerList;if(r.length!==n.length){for(t=0;t<n.length;t++)n[t].dispose();for(n=this.layerList=[],t=0;t<r.length;t++)n.push(f(this,t,r[t]))}else for(t=0;t<r.length;t++)n[t].update(r[t])},d.destroy=function(){this.map&&(this.map.remove(),this.map=null),this.container.removeChild(this.div)},d.toImage=function(){return this.map.getCanvas().toDataURL()},d.initSource=function(t){var e={type:"geojson",data:{type:"Feature",geometry:{type:"Point",coordinates:[]}}};return this.map.addSource(t,e)},d.setSourceData=function(t,e){this.map.getSource(t).setData(e)},d.setOptions=function(t,e,r){for(var n=this.map,i=Object.keys(r),a=0;a<i.length;a++){var o=i[a];n[e](t,o,r[o])}},d.project=function(t){return this.map.project(new s.LngLat(t[0],t[1]))},d.getView=function(){var t=this.map,e=t.getCenter(),r={lon:e.lng,lat:e.lat};return{center:r,zoom:t.getZoom(),bearing:t.getBearing(),pitch:t.getPitch()}}},{"../../lib":658,"../cartesian/graph_interact":698,"./constants":743,"./layers":746,"./layout_attributes":747,"mapbox-gl":309}],750:[function(t,e,r){"use strict";e.exports={t:{valType:"number",dflt:0},r:{valType:"number",dflt:0},b:{valType:"number",dflt:0},l:{valType:"number",dflt:0}}},{}],751:[function(t,e,r){"use strict";function n(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(){p.sendDataToCloud(t)});else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}function i(t,e){for(var r=f.isPlainObject,n=Array.isArray,a=Object.keys(e||{}),o=0;o<a.length;o++){var s=a[o],l=e[s],u=t[s];if("_"===s.charAt(0)||"function"==typeof l){if(s in t)continue;t[s]=l}else if(n(l)&&n(u)&&r(l[0]))for(var c=0;c<l.length;c++)r(l[c])&&r(u[c])&&i(u[c],l[c]);else r(l)&&r(u)&&(i(u,l),Object.keys(u).length||delete t[s])}}function a(t,e,r){var n=r._globalTransforms||[];if(Array.isArray(t.transforms)||0!==n.length)for(var i=t.transforms||[],a=n.concat(i),o=e.transforms=[],s=0;s<a.length;s++){var l,u=a[s],c=u.type,h=y[c];h||f.warn("Unrecognized transform type "+c+"."),h&&h.supplyDefaults?(l=h.supplyDefaults(u,e,r,t),l.type=c,l._module=h,f.pushUnique(r._transformModules,h)):l=f.extendFlat({},u),o.push(l)}}function o(t,e,r,n){for(var i=t.transforms,a=[t],o=0;o<i.length;o++){var s=i[o],l=y[s.type];l&&l.transform&&(a=l.transform(a,{transform:s,fullTrace:t,fullData:e,layout:r,fullLayout:n,transformIndex:o}))}return a}function s(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}var l=t("d3"),u=t("fast-isnumeric"),c=t("../plotly"),h=t("../registry"),f=t("../lib"),d=t("../components/color"),p=e.exports={},m=t("./animation_attributes"),g=t("./frame_attributes");f.extendFlat(p,h),p.attributes=t("./attributes"),p.attributes.type.values=p.allTypes,p.fontAttrs=t("./font_attributes"),p.layoutAttributes=t("./layout_attributes"),p.fontWeight="normal";var v=p.subplotsRegistry,y=p.transformsRegistry,x=t("../components/errorbars"),b=t("./command");p.executeAPICommand=b.executeAPICommand,p.computeAPICommandBindings=b.computeAPICommandBindings,p.manageCommandObserver=b.manageCommandObserver,p.hasSimpleAPICommandBindings=b.hasSimpleAPICommandBindings,p.findSubplotIds=function(t,e){var r=[];if(!p.subplotsRegistry[e])return r;for(var n=p.subplotsRegistry[e].attr,i=0;i<t.length;i++){var a=t[i];p.traceIs(a,e)&&r.indexOf(a[n])===-1&&r.push(a[n])}return r},p.getSubplotIds=function(t,e){var r=p.subplotsRegistry[e];if(!r)return[];if(!("cartesian"!==e||t._has&&t._has("cartesian")))return[];if(!("gl2d"!==e||t._has&&t._has("gl2d")))return[];if("cartesian"===e||"gl2d"===e)return Object.keys(t._plots||{});for(var n=r.idRegex,i=Object.keys(t),a=[],o=0;o<i.length;o++){var s=i[o];n.test(s)&&a.push(s)}var l=r.idRoot.length;return a.sort(function(t,e){var r=+(t.substr(l)||1),n=+(e.substr(l)||1);return r-n}),a},p.getSubplotData=function(t,e,r){if(!p.subplotsRegistry[e])return[];for(var n,i=p.subplotsRegistry[e].attr,a=[],o=0;o<t.length;o++)if(n=t[o],"gl2d"===e&&p.traceIs(n,"gl2d")){var s=c.Axes.subplotMatch,l="x"+r.match(s)[1],u="y"+r.match(s)[2];n[i[0]]===l&&n[i[1]]===u&&a.push(n)}else n[i]===r&&a.push(n);return a},p.getSubplotCalcData=function(t,e,r){if(!p.subplotsRegistry[e])return[];for(var n=p.subplotsRegistry[e].attr,i=[],a=0;a<t.length;a++){var o=t[a],s=o[0].trace;s[n]===r&&i.push(o)}return i},p.redrawText=function(t){if(!(t.data&&t.data[0]&&t.data[0].r))return new Promise(function(e){setTimeout(function(){h.getComponentMethod("annotations","draw")(t),h.getComponentMethod("legend","draw")(t),(t.calcdata||[]).forEach(function(t){t[0]&&t[0].t&&t[0].t.cb&&t[0].t.cb()}),e(p.previousPromises(t))},300)})},p.resize=function(t){return new Promise(function(e,r){t&&"none"!==l.select(t).style("display")||r(new Error("Resize must be passed a plot div element.")),t._redrawTimer&&clearTimeout(t._redrawTimer),t._redrawTimer=setTimeout(function(){if(t.layout.width&&t.layout.height)return void e(t);delete t.layout.width,delete t.layout.height;var r=t.changed;t.autoplay=!0,c.relayout(t,{autosize:!0}).then(function(){t.changed=r,e(t)})},100)})},p.previousPromises=function(t){if((t._promises||[]).length)return Promise.all(t._promises).then(function(){t._promises=[]})},p.addLinks=function(t){var e=t._fullLayout,r=e._paper.selectAll("text.js-plot-link-container").data([0]);r.enter().append("text").classed("js-plot-link-container",!0).style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:d.defaultLine,"pointer-events":"all"}).each(function(){var t=l.select(this);t.append("tspan").classed("js-link-to-tool",!0),t.append("tspan").classed("js-link-spacer",!0),t.append("tspan").classed("js-sourcelinks",!0)});var i=r.node(),a={y:e._paper.attr("height")-9};document.body.contains(i)&&i.getComputedTextLength()>=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&n(t,o),s.text(o.text()&&u.text()?" - ":"")},p.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=l.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"}),i=n.append("input").attr({type:"text",name:"data"});return i.node().value=p.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},p.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},a=t.layout||{},o=t._fullData||[],s=t._fullData=[],l=t.data||[];if(t._transitionData||p.createTransitionData(t),r._initialAutoSizeIsDone){var u=r.width,h=r.height;p.supplyLayoutGlobalDefaults(a,n),a.width||(n.width=u),a.height||(n.height=h)}else{p.supplyLayoutGlobalDefaults(a,n);var f=!a.width||!a.height,d=n.autosize,m=t._context&&t._context.autosizable,g=f&&(d||m);g?p.plotAutoSize(t,a,n):f&&p.sanitizeMargins(t),!d&&f&&(a.width=n.width,a.height=n.height)}n._initialAutoSizeIsDone=!0,n._dataLength=l.length,n._globalTransforms=(t._context||{}).globalTransforms,p.supplyDataDefaults(l,s,a,n),n._has=p._hasPlotType.bind(n);var v=n._modules;for(e=0;e<v.length;e++){var y=v[e];y.cleanData&&y.cleanData(s)}if(o.length===l.length)for(e=0;e<s.length;e++)i(s[e],o[e]);p.supplyLayoutModuleDefaults(a,n,s,t._transitionData),n._hasCartesian=n._has("cartesian"),n._hasGeo=n._has("geo"),n._hasGL3D=n._has("gl3d"),n._hasGL2D=n._has("gl2d"),n._hasTernary=n._has("ternary"),n._hasPie=n._has("pie"),p.cleanPlot(s,n,o,r),p.linkSubplots(s,n,o,r),i(n,r),p.doAutoMargin(t);var x=c.Axes.list(t);for(e=0;e<x.length;e++){var b=x[e];b._gd=t,b.setScale()}if((t.calcdata||[]).length===s.length)for(e=0;e<s.length;e++){var _=s[e];(t.calcdata[e][0]||{}).trace=_}},p.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=[])},p._hasPlotType=function(t){for(var e=this._basePlotModules||[],r=0;r<e.length;r++){var n=e[r];if(n.name===t)return!0}return!1},p.cleanPlot=function(t,e,r,n){var i,a,o=n._basePlotModules||[];for(i=0;i<o.length;i++){var s=o[i];s.clean&&s.clean(t,e,r,n)}var l=!!n._paper,u=!!n._infolayer;t:for(i=0;i<r.length;i++){var c=r[i],h=c.uid;for(a=0;a<t.length;a++){var f=t[a];if(h===f.uid)continue t}l&&n._paper.selectAll(".hm"+h+",.contour"+h+",#clip"+h+",.trace"+h).remove(),u&&n._infolayer.selectAll(".cb"+h).remove()}},p.linkSubplots=function(t,e,r,n){for(var i=n._plots||{},a=e._plots={},o={_fullData:t,_fullLayout:e},s=c.Axes.getSubplots(o),l=0;l<s.length;l++){var u,h=s[l],f=i[h];f?(u=a[h]=f,u._scene2d&&u._scene2d.updateRefs(e)):(u=a[h]={},u.id=h),u.xaxis=c.Axes.getFromId(o,h,"x"),u.yaxis=c.Axes.getFromId(o,h,"y")}},p.supplyDataDefaults=function(t,e,r,n){function i(t){e.push(t);var r=t._module;r&&(f.pushUnique(a,r),f.pushUnique(s,t._module.basePlotModule),l++)}var a=n._modules=[],s=n._basePlotModules=[],l=0;n._transformModules=[];for(var u=0;u<t.length;u++){var c=t[u],h=p.supplyTraceDefaults(c,l,n,u);if(h.index=u,h._input=c,h._expandedIndex=l,h.transforms&&h.transforms.length)for(var d=o(h,e,r,n),m=0;m<d.length;m++){var g=d[m],v=p.supplyTraceDefaults(g,l,n,u);g.uid=v.uid=h.uid+m,v.index=u,v._input=c,v._fullInput=h,v._expandedIndex=l,v._expandedInput=g,i(v)}else h._fullInput=h,h._expandedInput=h,i(h)}},p.supplyAnimationDefaults=function(t){function e(e,r){return f.coerce(t||{},n,m,e,r)}t=t||{};var r,n={};if(e("mode"),e("direction"),e("fromcurrent"),Array.isArray(t.frame))for(n.frame=[],r=0;r<t.frame.length;r++)n.frame[r]=p.supplyAnimationFrameDefaults(t.frame[r]||{});else n.frame=p.supplyAnimationFrameDefaults(t.frame||{});if(Array.isArray(t.transition))for(n.transition=[],r=0;r<t.transition.length;r++)n.transition[r]=p.supplyAnimationTransitionDefaults(t.transition[r]||{});else n.transition=p.supplyAnimationTransitionDefaults(t.transition||{});return n},p.supplyAnimationFrameDefaults=function(t){function e(e,n){return f.coerce(t||{},r,m.frame,e,n)}var r={};return e("duration"),e("redraw"),r},p.supplyAnimationTransitionDefaults=function(t){function e(e,n){return f.coerce(t||{},r,m.transition,e,n)}var r={};return e("duration"),e("easing"),r},p.supplyFrameDefaults=function(t){function e(e,n){return f.coerce(t,r,g,e,n)}var r={};return e("group"),e("name"),e("traces"),e("baseframe"),e("data"),e("layout"),r},p.supplyTraceDefaults=function(t,e,r,n){function i(e,r){return f.coerce(t,s,p.attributes,e,r)}function o(e,r){if(p.traceIs(s,e))return f.coerce(t,s,p.subplotsRegistry[e].attributes,r)}var s={},l=d.defaults[e%d.defaults.length],u=i("visible");i("type"),i("uid"),i("name","trace "+n);for(var c=Object.keys(v),h=0;h<c.length;h++){var m=c[h];if(["cartesian","gl2d"].indexOf(m)===-1){var g=v[m].attr;g&&o(m,g)}}if(u){var y=p.getModule(s);s._module=y,i("hoverinfo",1===r._dataLength?"x+y+z+text":void 0),y&&y.supplyDefaults(t,s,l,r),p.traceIs(s,"noOpacity")||i("opacity"),o("cartesian","xaxis"),o("cartesian","yaxis"),o("gl2d","xaxis"),o("gl2d","yaxis"),p.traceIs(s,"showLegend")&&(i("showlegend"),i("legendgroup")),a(t,s,r)}return s},p.supplyLayoutGlobalDefaults=function(t,e){function r(r,n){return f.coerce(t,e,p.layoutAttributes,r,n)}var n=f.coerceFont(r,"font");r("title"),f.coerceFont(r,"titlefont",{family:n.family,size:Math.round(1.4*n.size),color:n.color}),r("autosize",!(t.width&&t.height)),r("width"),r("height"),r("margin.l"),r("margin.r"),r("margin.t"),r("margin.b"),r("margin.pad"),r("margin.autoexpand"),t.width&&t.height&&p.sanitizeMargins(e),r("paper_bgcolor"),r("separators"),r("hidesources"),r("smith");var i=h.getComponentMethod("calendars","handleDefaults");i(t,e,"calendar")},p.plotAutoSize=function(t,e,r){var n,i,a=t._context||{},o=a.frameMargins,l=f.isPlotDiv(t);if(l&&t.emit("plotly_autosize"),a.fillFrame)n=window.innerWidth,i=window.innerHeight,document.body.style.overflow="hidden";else if(u(o)&&o>0){var c=s(t._boundingBoxMargins),h=c.left+c.right,d=c.bottom+c.top,m=1-2*o,g=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(m*(g.width-h)),i=Math.round(m*(g.height-d))}else{var v=l?window.getComputedStyle(t):{};n=parseFloat(v.width)||r.width,i=parseFloat(v.height)||r.height}var y=p.layoutAttributes.width.min,x=p.layoutAttributes.height.min;n<y&&(n=y),i<x&&(i=x);var b=!e.width&&Math.abs(r.width-n)>1,_=!e.height&&Math.abs(r.height-i)>1;(_||b)&&(b&&(r.width=n),_&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),p.sanitizeMargins(r)},p.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a;c.Axes.supplyLayoutDefaults(t,e,r);var o=e._basePlotModules;for(i=0;i<o.length;i++)a=o[i],"cartesian"!==a.name&&a.supplyLayoutDefaults&&a.supplyLayoutDefaults(t,e,r);var s=e._modules;for(i=0;i<s.length;i++)a=s[i],a.supplyLayoutDefaults&&a.supplyLayoutDefaults(t,e,r);var l=e._transformModules;for(i=0;i<l.length;i++)a=l[i],a.supplyLayoutDefaults&&a.supplyLayoutDefaults(t,e,r,n);c.Fx.supplyLayoutDefaults(t,e,r);var u=Object.keys(h.componentsRegistry);for(i=0;i<u.length;i++)a=h.componentsRegistry[u[i]],a.supplyLayoutDefaults&&a.supplyLayoutDefaults(t,e,r)},p.purge=function(t){var e=t._fullLayout||{};void 0!==e._glcontainer&&e._glcontainer.remove(),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)),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._tester,delete t._testref,delete t._promises,delete t._redrawTimer,delete t._replotting,delete t.firstscatter,delete t.hmlumcount,delete t.hmpixcount,delete t.numboxes,delete t._hoverTimer,delete t._lastHoverTime,delete t._transitionData,delete t._transitioning,delete t._initialAutoSize,t.removeAllListeners&&t.removeAllListeners()},p.style=function(t){for(var e=t._fullLayout._modules,r=0;r<e.length;r++){var n=e[r];n.style&&n.style(t)}},p.sanitizeMargins=function(t){if(t&&t.margin){var e,r=t.width,n=t.height,i=t.margin,a=r-(i.l+i.r),o=n-(i.t+i.b);a<0&&(e=(r-1)/(i.l+i.r),i.l=Math.floor(e*i.l),i.r=Math.floor(e*i.r)),o<0&&(e=(n-1)/(i.t+i.b),i.t=Math.floor(e*i.t),i.b=Math.floor(e*i.b))}},p.autoMargin=function(t,e,r){var n=t._fullLayout;if(n._pushmargin||(n._pushmargin={}),n.margin.autoexpand!==!1){if(r){var i=void 0===r.pad?12:r.pad;r.l+r.r>.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+i},r:{val:r.x,size:r.r+i},b:{val:r.y,size:r.b+i},t:{val:r.y,size:r.t+i}}}else delete n._pushmargin[e];t._replotting||p.doAutoMargin(t)}},p.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),i=Math.max(e.margin.l||0,0),a=Math.max(e.margin.r||0,0),o=Math.max(e.margin.t||0,0),s=Math.max(e.margin.b||0,0),l=e._pushmargin;if(e.margin.autoexpand!==!1&&(l.base={l:{val:0,size:i},r:{val:1,size:a},t:{val:1,size:o},b:{val:0,size:s}},Object.keys(l).forEach(function(t){var r=l[t].l||{},n=l[t].b||{},c=r.val,h=r.size,f=n.val,d=n.size;Object.keys(l).forEach(function(t){if(u(h)&&l[t].r){var r=l[t].r.val,n=l[t].r.size;if(r>c){var p=(h*r+(n-e.width)*c)/(r-c),m=(n*(1-c)+(h-e.width)*(1-r))/(r-c);p>=0&&m>=0&&p+m>i+a&&(i=p,a=m)}}if(u(d)&&l[t].t){var g=l[t].t.val,v=l[t].t.size;if(g>f){var y=(d*g+(v-e.height)*f)/(g-f),x=(v*(1-f)+(d-e.height)*(1-g))/(g-f);y>=0&&x>=0&&y+x>s+o&&(s=y,o=x)}}})})),r.l=Math.round(i),r.r=Math.round(a),r.t=Math.round(o),r.b=Math.round(s),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,!t._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return c.plot(t)},p.graphJson=function(t,e,r,n,i){function a(t){if("function"==typeof t)return null;if(f.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&["_","["].indexOf(e.charAt(0))===-1){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if(n=t[e+"src"],"string"==typeof n&&n.indexOf(":")>0&&!f.isPlainObject(t.stream))continue}else if("keepall"!==r&&(n=t[e+"src"],"string"==typeof n&&n.indexOf(":")>0))continue;i[e]=a(t[e])}return i}return Array.isArray(t)?t.map(a):f.isJSDate(t)?f.ms2DateTimeLocal(+t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&p.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames,u={data:(o||[]).map(function(t){var r=a(t);return e&&delete r.fit,r})};return e||(u.layout=a(s)),t.framework&&t.framework.isPolar&&(u=t.framework.getConfig()),l&&(u.frames=a(l)),"object"===n?u:JSON.stringify(u)},p.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r<e.length;r++)switch(n=e[r],n.type){case"replace":i=n.value;var s=(a[n.index]||{}).name,l=i.name;a[n.index]=o[l]=i,l!==s&&(delete o[s],o[l]=i);break;case"insert":i=n.value,o[i.name]=i,a.splice(n.index,0,i);break;case"delete":i=a[n.index],delete o[i.name],a.splice(n.index,1)}return Promise.resolve()},p.computeFrame=function(t,e){var r,n,i,a,o=t._transitionData._frameHash;if(!e)throw new Error("computeFrame must be given a string frame name");var s=o[e.toString()];if(!s)return!1;for(var l=[s],u=[s.name];s.baseframe&&(s=o[s.baseframe.toString()])&&u.indexOf(s.name)===-1;)l.push(s),u.push(s.name);for(var c={};s=l.pop();)if(s.layout&&(c.layout=p.extendLayout(c.layout,s.layout)),s.data){if(c.data||(c.data=[]),n=s.traces,!n)for(n=[],r=0;r<s.data.length;r++)n[r]=r;for(c.traces||(c.traces=[]),r=0;r<s.data.length;r++)i=n[r],void 0!==i&&null!==i&&(a=c.traces.indexOf(i),a===-1&&(a=c.data.length,c.traces[a]=i),c.data[a]=p.extendTrace(c.data[a],s.data[r]))}return c},p.recomputeFrameHash=function(t){for(var e=t._transitionData._frameHash={},r=t._transitionData._frames,n=0;n<r.length;n++){var i=r[n];i&&i.name&&(e[i.name]=i)}},p.extendObjectWithContainers=function(t,e,r){var n,i,a,o,s,l,u,c,h=f.extendDeepNoArrays({},e||{}),d=f.expandObjectPaths(h),m={};if(r&&r.length)for(a=0;a<r.length;a++)n=f.nestedProperty(d,r[a]),i=n.get(),void 0===i?f.nestedProperty(m,r[a]).set(null):(n.set(null),f.nestedProperty(m,r[a]).set(i));if(t=f.extendDeepNoArrays(t||{},d),r&&r.length)for(a=0;a<r.length;a++)if(s=f.nestedProperty(m,r[a]),u=s.get()){for(l=f.nestedProperty(t,r[a]),c=l.get(),Array.isArray(c)||(c=[],l.set(c)),o=0;o<u.length;o++){var g=u[o];null===g?c[o]=null:c[o]=p.extendObjectWithContainers(c[o],g)}l.set(c)}return t},p.dataArrayContainers=["transforms"],p.layoutArrayContainers=h.layoutArrayContainers,p.extendTrace=function(t,e){return p.extendObjectWithContainers(t,e,p.dataArrayContainers)},p.extendLayout=function(t,e){return p.extendObjectWithContainers(t,e,p.layoutArrayContainers)},p.transition=function(t,e,r,n,i,a){function o(){var n;for(n=0;n<y.length;n++){var i=y[n],a=t._fullData[i],o=a._module;o&&(o.animatable&&b.push(i),t.data[y[n]]=p.extendTrace(t.data[y[n]],e[n]))}var s=f.expandObjectPaths(f.extendDeepNoArrays({},r)),l=/^[xy]axis[0-9]*$/;for(var u in s)l.test(u)&&delete s[u].range;return p.extendLayout(t.layout,s),p.supplyDefaults(t),p.doCalcdata(t),x.calc(t),Promise.resolve()}function s(t){var e=Promise.resolve();if(!t)return e;for(;t.length;)e=e.then(t.shift());return e}function l(t){if(t)for(;t.length;)t.shift()}function u(){return t.emit("plotly_transitioning",[]),new Promise(function(e){function n(){return l++,function(){u++,_||u!==l||h(e)}}t._transitioning=!0,a.duration>0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){_=!0}),i.redraw&&t._transitionData._interruptCallbacks.push(function(){return c.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var o,s,l=0,u=0,d=t._fullLayout._basePlotModules,p=!1;if(r)for(s=0;s<d.length;s++)if(d[s].transitionAxes){var m=f.expandObjectPaths(r);p=d[s].transitionAxes(t,m,a,n)||p}for(p?(o=f.extendFlat({},a),o.duration=0):o=a,s=0;s<d.length;s++)d[s].plot(t,b,o,n);setTimeout(n())})}function h(e){if(t._transitionData)return l(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(i.redraw)return c.redraw(t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])}).then(e)}function d(){if(t._transitionData)return t._transitioning=!1,s(t._transitionData._interruptCallbacks)}var m,g,v=Array.isArray(e)?e.length:0,y=n.slice(0,v),b=[],_=!1;for(m=0;m<y.length;m++){g=y[m];var w=t._fullData[g],M=w._module;if(M&&!M.animatable){var A={};for(var k in e[m])A[k]=[e[m][k]]}}var T=[p.previousPromises,d,o,u],E=f.syncOrAsync(T,t);return E&&E.then||(E=Promise.resolve()),E.then(function(){return t})},p.doCalcdata=function(t,e){var r,n,i,a,o=c.Axes.list(t),s=t._fullData,l=t._fullLayout,u=new Array(s.length),h=(t.calcdata||[]).slice(0);for(t.calcdata=u,t.firstscatter=!0,t.numboxes=0,t._hmpixcount=0,t._hmlumcount=0,l._piecolormap={},l._piedefaultcolorcount=0,i=0;i<o.length;i++)o[i]._categories=o[i]._initialCategories.slice();for(i=0;i<s.length;i++)Array.isArray(e)&&e.indexOf(i)===-1&&(u[i]=h[i]);var f=!1;for(i=0;i<s.length;i++)if(r=s[i],r.visible===!0&&r.transforms)for(n=r._module,n&&n.calc&&n.calc(t,r),a=0;a<r.transforms.length;a++){var d=r.transforms[a];n=y[d.type],n&&n.calcTransform&&(f=!0,n.calcTransform(t,r,d))}if(f)for(i=0;i<o.length;i++)o[i]._min=[],o[i]._max=[],o[i]._categories=[];for(i=0;i<s.length;i++){var p=[];r=s[i],r.visible===!0&&(n=r._module,n&&n.calc&&(p=n.calc(t,r))),Array.isArray(p)&&p[0]||(p=[{x:!1,y:!1,placeholder:!0}]),p[0].t||(p[0].t={}),p[0].trace=r,u[i]=p}},p.generalUpdatePerTraceModule=function(t,e,r){function n(t){for(var e=[],r=0;r<t.length;r++){var n=t[r],i=n[0].trace;i.visible===!0&&e.push(n)}return e}var i,a=t.traceHash,o={};for(i=0;i<e.length;i++){var s=e[i],l=s[0].trace;l.visible&&(o[l.type]=o[l.type]||[],o[l.type].push(s))}var u=Object.keys(a),c=Object.keys(o);for(i=0;i<u.length;i++){var h=u[i];if(c.indexOf(h)===-1){var f=a[h][0],d=f[0].trace;d.visible=!1,o[h]=[f]}}for(c=Object.keys(o),i=0;i<c.length;i++){var p=o[c[i]],m=p[0][0].trace._module;m.plot(t,n(p),r)}t.traceHash=o}},{"../components/color":558,"../components/errorbars":587,"../lib":658,"../plotly":686,"../registry":766,"./animation_attributes":687,"./attributes":689,"./command":710,"./font_attributes":711,"./frame_attributes":712,"./layout_attributes":742,d3:97,"fast-isnumeric":106}],752:[function(t,e,r){"use strict";var n=t("../../traces/scatter/attributes"),i=n.marker;e.exports={r:n.r,t:n.t,marker:{color:i.color,size:i.size,symbol:i.symbol,opacity:i.opacity}}},{"../../traces/scatter/attributes":884}],753:[function(t,e,r){"use strict";function n(t,e){var r={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"}};return a({},e,r)}var i=t("../cartesian/layout_attributes"),a=t("../../lib/extend").extendFlat,o=a({},i.domain,{});e.exports={radialaxis:n("radial",{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:o,orientation:{valType:"number"}}),angularaxis:n("angular",{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"}}}},{"../../lib/extend":651,"../cartesian/layout_attributes":700}],754:[function(t,e,r){"use strict";var n=e.exports=t("./micropolar");n.manager=t("./micropolar_manager")},{"./micropolar":755,"./micropolar_manager":756}],755:[function(t,e,r){var n=t("d3"),i=t("../../lib"),a=i.extendDeepAll,o=e.exports={version:"0.2.2"};o.Axis=function(){function t(t){r=t||r;var u=l.data,h=l.layout;return("string"==typeof r||r.nodeName)&&(r=n.select(r)),r.datum(u).each(function(t,r){function l(t,e){return s(t)%360+h.orientation}var u=t.slice();c={data:o.util.cloneJson(u),layout:o.util.cloneJson(h)};var f=0;u.forEach(function(t,e){t.color||(t.color=h.defaultColorRange[f],f=(f+1)%h.defaultColorRange.length),t.strokeColor||(t.strokeColor="LinePlot"===t.geometry?t.color:n.rgb(t.color).darker().toString()),c.data[e].color=t.color,c.data[e].strokeColor=t.strokeColor,c.data[e].strokeDash=t.strokeDash,c.data[e].strokeSize=t.strokeSize});var d=u.filter(function(t,e){var r=t.visible;return"undefined"==typeof r||r===!0}),p=!1,m=d.map(function(t,e){return p=p||"undefined"!=typeof t.groupId,t});if(p){var g=n.nest().key(function(t,e){return"undefined"!=typeof t.groupId?t.groupId:"unstacked"}).entries(m),v=[],y=g.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],v.push(r),r=o.util.sumArrays(t.r,r)}),t.values});d=n.merge(y)}d.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(h.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2;x=Math.max(10,x);var b,_=[h.margin.left+x,h.margin.top+x];if(p){var w=n.max(o.util.sumArrays(o.util.arrayLast(d).r[0],o.util.arrayLast(v)));b=[0,w]}else b=n.extent(o.util.flattenArray(d.map(function(t,e){return t.r})));h.radialAxis.domain!=o.DATAEXTENT&&(b[0]=0),i=n.scale.linear().domain(h.radialAxis.domain!=o.DATAEXTENT&&h.radialAxis.domain?h.radialAxis.domain:b).range([0,x]),c.layout.radialAxis.domain=i.domain();var M,A=o.util.flattenArray(d.map(function(t,e){return t.t})),k="string"==typeof A[0];k&&(A=o.util.deduplicate(A),M=A.slice(),A=n.range(A.length),d=d.map(function(t,e){var r=t;return t.t=[A],p&&(r.yStack=t.yStack),r}));var T=d.filter(function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry}).length===d.length,E=null===h.needsEndSpacing?k||!T:h.needsEndSpacing,S=h.angularAxis.domain&&h.angularAxis.domain!=o.DATAEXTENT&&!k&&h.angularAxis.domain[0]>=0,L=S?h.angularAxis.domain:n.extent(A),C=Math.abs(A[1]-A[0]);T&&!k&&(C=0);var I=L.slice();E&&k&&(I[1]+=C);var z=h.angularAxis.ticksCount||4;z>8&&(z=z/(z/8)+z%8),h.angularAxis.ticksStep&&(z=(I[1]-I[0])/z);var D=h.angularAxis.ticksStep||(I[1]-I[0])/(z*(h.minorTicks+1));M&&(D=Math.max(Math.round(D),1)),I[2]||(I[2]=D);var P=n.range.apply(this,I);if(P=P.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=n.scale.linear().domain(I.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),c.layout.angularAxis.domain=s.domain(),c.layout.angularAxis.endPadding=E?C:0,e=n.select(this).select("svg.chart-root"),"undefined"==typeof e||e.empty()){var O="<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>",R=(new DOMParser).parseFromString(O,"application/xml"),F=this.appendChild(this.ownerDocument.importNode(R.documentElement,!0));e=n.select(F)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var j,N=e.select(".chart-group"),B={fill:"none",stroke:h.tickColor},U={"font-size":h.font.size,"font-family":h.font.family,fill:h.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+h.font.outlineColor}).join(",")};if(h.showLegend){j=e.select(".legend-group").attr({transform:"translate("+[x,h.margin.top]+")"}).style({display:"block"});var V=d.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="undefined"==typeof t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});o.Legend().config({data:d.map(function(t,e){return t.name||"Element"+e}),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:j,elements:V,reverseOrder:h.legend.reverseOrder})})();var q=j.node().getBBox();x=Math.min(h.width-q.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2,x=Math.max(10,x),_=[h.margin.left+x,h.margin.top+x],i.range([0,x]),c.layout.radialAxis.domain=i.domain(),j.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else j=e.select(".legend-group").style({display:"none"});e.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),N.attr("transform","translate("+_+")").style({cursor:"crosshair"});var H=[(h.width-(h.margin.left+h.margin.right+2*x+(q?q.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*x))/2];if(H[0]=Math.max(0,H[0]),H[1]=Math.max(0,H[1]),e.select(".outer-group").attr("transform","translate("+H+")"),h.title){var Y=e.select("g.title-group text").style(U).text(h.title),G=Y.node().getBBox();Y.attr({x:_[0]-G.width/2,y:_[1]-x-20})}var X=e.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var W=X.selectAll("circle.grid-circle").data(i.ticks(5));W.enter().append("circle").attr({class:"grid-circle"}).style(B),W.attr("r",i),W.exit().remove()}X.select("circle.outside-circle").attr({r:x}).style(B);var Z=e.select("circle.background-circle").attr({r:x}).style({fill:h.backgroundColor,stroke:h.stroke});if(h.radialAxis.visible){var J=n.svg.axis().scale(i).ticks(5).tickSize(5);X.call(J).attr({transform:"rotate("+h.radialAxis.orientation+")"}),X.selectAll(".domain").style(B),X.selectAll("g>text").text(function(t,e){return this.textContent+h.radialAxis.ticksSuffix}).style(U).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===h.radialAxis.tickOrientation?"rotate("+-h.radialAxis.orientation+") translate("+[0,U["font-size"]]+")":"translate("+[0,U["font-size"]]+")"}}),X.selectAll("g>line").style({stroke:"black"})}var K=e.select(".angular.axis-group").selectAll("g.angular-tick").data(P),Q=K.enter().append("g").classed("angular-tick",!0);K.attr({transform:function(t,e){return"rotate("+l(t,e)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),K.exit().remove(),Q.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(h.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(h.minorTicks+1)==0)}).style(B),Q.selectAll(".minor").style({stroke:h.minorTickColor}),K.select("line.grid-line").attr({x1:h.tickLength?x-h.tickLength:0,x2:x}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),Q.append("text").classed("axis-text",!0).style(U);var $=K.select("text.axis-text").attr({x:x+h.labelOffset,dy:".35em",transform:function(t,e){var r=l(t,e),n=x+h.labelOffset,i=h.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:h.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(h.minorTicks+1)!=0?"":M?M[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix}).style(U);h.angularAxis.rewriteTicks&&$.text(function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)});var tt=n.max(N.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));j.attr({transform:"translate("+[x+tt,h.margin.top]+")"});var et=e.select("g.geometry-group").selectAll("g").size()>0,rt=e.select("g.geometry-group").selectAll("g.geometry").data(d);if(rt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),rt.exit().remove(),d[0]||et){var nt=[];d.forEach(function(t,e){var r={};r.radialScale=i,r.angularScale=s,r.container=rt.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=h.orientation,r.direction=h.direction,r.index=e,nt.push({data:t,geometryConfig:r})});var it=n.nest().key(function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"}).entries(nt),at=[];it.forEach(function(t,e){"unstacked"===t.key?at=at.concat(t.values.map(function(t,e){return[t]})):at.push(t.values)}),at.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 ot,st,lt=e.select(".guides-group"),ut=e.select(".tooltips-group"),ct=o.tooltipPanel().config({container:ut,fontSize:8})(),ht=o.tooltipPanel().config({container:ut,fontSize:8})(),ft=o.tooltipPanel().config({container:ut,hasTick:!0})();if(!k){var dt=lt.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});N.on("mousemove.angular-guide",function(t,e){var r=o.util.getMousePos(Z).angle;dt.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;ot=s.invert(n);var i=o.util.convertToCartesian(x+12,r+180);ct.text(o.util.round(ot)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){lt.select("line").style({opacity:0})})}var pt=lt.select("circle").style({stroke:"grey",fill:"none"});N.on("mousemove.radial-guide",function(t,e){var r=o.util.getMousePos(Z).radius;pt.attr({r:r}).style({opacity:.5}),st=i.invert(o.util.getMousePos(Z).radius);var n=o.util.convertToCartesian(r,h.radialAxis.orientation);ht.text(o.util.round(st)).move([n[0]+_[0],n[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){pt.style({opacity:0}),ft.hide(),ct.hide(),ht.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var i=n.select(this),a=i.style("fill"),s="black",l=i.style("opacity")||1;if(i.attr({"data-opacity":l}),"none"!=a){i.attr({"data-fill":a}),s=n.hsl(a).darker().toString(),i.style({fill:s,opacity:1});var u={t:o.util.round(t[0]),r:o.util.round(t[1])};k&&(u.t=M[t[0]]);var c="t: "+u.t+", r: "+u.r,h=this.getBoundingClientRect(),f=e.node().getBoundingClientRect(),d=[h.left+h.width/2-H[0]-f.left,h.top+h.height/2-H[1]-f.top];ft.config({color:s}).text(c),ft.move(d)}else a=i.style("stroke"),i.attr({"data-stroke":a}),s=n.hsl(a).darker().toString(),i.style({stroke:s,opacity:1})}).on("mousemove.tooltip",function(t,e){return 0==n.event.which&&void(n.select(this).attr("data-fill")&&ft.show())}).on("mouseout.tooltip",function(t,e){ft.hide();var r=n.select(this),i=r.attr("data-fill");i?r.style({fill:i,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})}),f}var e,r,i,s,l={data:[],layout:{}},u={},c={},h=n.dispatch("hover"),f={};return f.render=function(e){return t(e),this},f.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach(function(t,e){l.data[e]||(l.data[e]={}),a(l.data[e],o.Axis.defaultConfig().data[0]),a(l.data[e],t)}),a(l.layout,o.Axis.defaultConfig().layout),a(l.layout,e.layout),this},f.getLiveConfig=function(){return c},f.getinputConfig=function(){return u},f.radialScale=function(t){return i},f.angularScale=function(t){return s},f.svg=function(){return e},n.rebind(f,h,"on"),f},o.Axis.defaultConfig=function(t,e){var r={data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}};return r},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,i=n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180,i=t(n);return[e,i]});return i},o.util.dataFromEquation=function(t,e,r){var i=e||6,a=[],o=[];n.range(0,360+i,i).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);a.push(e),o.push(i)});var s={t:a,r:o};return r&&(s.name=r),s},o.util.ensureArray=function(t,e){if("undefined"==typeof 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 r===-2},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,n=t*Math.cos(r),i=t*Math.sin(r);return[n,i]},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],i=e[1],a={};return a.x=r,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+i*i),a},o.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i<a;i++)e=t[i],e 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 i=r.slice();r=e,e=i}var a=e.reduce(function(t,e){if("undefined"!=typeof t)return t[e]},t);"undefined"!=typeof a&&(e.reduce(function(t,r,n){if("undefined"!=typeof t)return n===e.length-1&&delete t[r],t[r]},t),r.reduce(function(t,e,n){return"undefined"==typeof t[e]&&(t[e]={}),n===r.length-1&&(t[e]=a),t[e]},t))},o.PolyChart=function(){function t(){var t=r[0].geometryConfig,e=t.container;"string"==typeof e&&(e=n.select(e)),e.datum(r).each(function(e,r){function i(e,r){var n=t.radialScale(e[1]),i=(t.angularScale(e[0])+t.orientation)*Math.PI/180;return{r:n,t:i}}function a(t){var e=t.r*Math.cos(t.t),r=t.r*Math.sin(t.t);return{x:e,y:r}}var o=!!e[0].data.yStack,l=e.map(function(t,e){return o?n.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):n.zip(t.data.t[0],t.data.r[0])}),u=t.angularScale,c=t.radialScale.domain()[0],h={};h.bar=function(r,i,a){var o=e[a].data,s=t.radialScale(r[1])-t.radialScale(0),l=t.radialScale(r[2]||0),c=o.barWidth;n.select(this).attr({class:"mark bar",d:"M"+[[s+l,-c/2],[s+l,c/2],[l,c/2],[l,-c/2]].join("L")+"Z",transform:function(e,r){return"rotate("+(t.orientation+u(e[0]))+")"}})},h.dot=function(t,r,o){var s=t[2]?[t[0],t[1]+t[2]]:t,l=n.svg.symbol().size(e[o].data.dotSize).type(e[o].data.dotType)(t,r);n.select(this).attr({class:"mark dot",d:l,transform:function(t,e){var r=a(i(s));return"translate("+[r.x,r.y]+")"}})};var f=n.svg.line.radial().interpolate(e[0].data.lineInterpolation).radius(function(e){return t.radialScale(e[1])}).angle(function(e){return t.angularScale(e[0])*Math.PI/180});h.line=function(r,i,a){var o=r[2]?l[a].map(function(t,e){return[t[0],t[1]+t[2]]}):l[a];if(n.select(this).each(h.dot).style({opacity:function(t,r){return+e[a].data.dotVisible},fill:g.stroke(r,i,a)}).attr({class:"mark dot"}),!(i>0)){var s=n.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:f(o),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return g.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return g.stroke(r,i,a)},"stroke-width":function(t,e){return g["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return g["stroke-dasharray"](r,i,a)},opacity:function(t,e){return g.opacity(r,i,a)},display:function(t,e){return g.display(r,i,a)}})}};var d=t.angularScale.range(),p=Math.abs(d[1]-d[0])/l[0].length*Math.PI/180,m=n.svg.arc().startAngle(function(t){return-p/2}).endAngle(function(t){return p/2}).innerRadius(function(e){return t.radialScale(c+(e[2]||0))}).outerRadius(function(e){return t.radialScale(c+(e[2]||0))+t.radialScale(e[1])});h.arc=function(e,r,i){n.select(this).attr({class:"mark arc",d:m,transform:function(e,r){return"rotate("+(t.orientation+u(e[0])+90)+")"}})};var g={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},"stroke-width":function(t,r,n){return e[n].data.strokeSize+"px"},"stroke-dasharray":function(t,r,n){return s[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return"undefined"==typeof e[n].data.visible||e[n].data.visible?"block":"none"}},v=n.select(this).selectAll("g.layer").data(l);v.enter().append("g").attr({class:"layer"});var y=v.selectAll("path.mark").data(function(t,e){return t});y.enter().append("path").attr({class:"mark"}),y.style(g).each(h[t.geometryType]),y.exit().remove(),v.exit().remove()})}var e,r=[o.PolyChart.defaultConfig()],i=n.dispatch("hover"),s={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,e){r[e]||(r[e]={}),a(r[e],o.PolyChart.defaultConfig()),a(r[e],t)}),this):r},t.getColorScale=function(){return e},n.rebind(t,i,"on"),t},o.PolyChart.defaultConfig=function(){var t={data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}};return t},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"bar"}};return t},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"arc"}};return t},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"dot",dotType:"circle"}};return t},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"line"}};return t},o.Legend=function(){function t(){var r=e.legendConfig,i=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var i=a({},r.elements[e]);return i.name=t,i.color=[].concat(r.elements[e].color)[n],i})}),o=n.merge(i);o=o.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||"undefined"==typeof r.elements[e].visibleInLegend)}),r.reverseOrder&&(o=o.reverse());var s=r.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map(function(t,e){return t.color}),u=r.fontSize,c=null==r.isContinuous?"number"==typeof o[0]:r.isContinuous,h=c?r.height:u*o.length,f=s.classed("legend-group",!0),d=f.selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:h+u,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 m=n.range(o.length),g=n.scale[c?"linear":"ordinal"]().domain(m).range(l),v=n.scale[c?"linear":"ordinal"]().domain(m)[c?"range":"rangePoints"]([0,h]),y=function(t,e){var r=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":n.svg.symbolTypes.indexOf(t)!=-1?n.svg.symbol().type(t).size(r)():n.svg.symbol().type("square").size(r)()};if(c){var x=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);x.enter().append("stop"),x.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),d.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var b=d.select(".legend-marks").selectAll("path.legend-mark").data(o);b.enter().append("path").classed("legend-mark",!0),b.attr({transform:function(t,e){return"translate("+[u/2,v(e)+u/2]+")"},d:function(t,e){var r=t.symbol;return y(r,u)},fill:function(t,e){return g(e)}}),b.exit().remove()}var _=n.svg.axis().scale(v).orient("right"),w=d.select("g.legend-axis").attr({transform:"translate("+[c?r.colorBandWidth:u,u/2]+")"}).call(_);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:c?r.textColor:"none"}),w.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return o[e].name}),t}var e=o.Legend.defaultConfig(),r=n.dispatch("hover");return t.config=function(t){return arguments.length?(a(e,t),this):e},n.rebind(t,r,"on"),t},o.Legend.defaultConfig=function(t,e){var r={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}};return r},o.tooltipPanel=function(){var t,e,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,u=function(){t=i.container.selectAll("g."+s).data([0]);var n=t.enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:i.padding+l,dy:.3*+i.fontSize}),u};return u.text=function(a){var o=n.hsl(i.color).l,s=o>=.5?"#aaa":"white",c=o>=.5?"black":"white",h=a||"";e.style({fill:c,"font-size":i.fontSize+"px"}).text(h);var f=i.padding,d=e.node().getBBox(),p={fill:i.color,stroke:s,"stroke-width":"2px"},m=d.width+2*f+l,g=d.height+2*f;return r.attr({d:"M"+[[l,-g/2],[l,-g/4],[i.hasTick?0:l,0],[l,g/4],[l,g/2],[m,g/2],[m,-g/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[l,-g/2+2*f]+")"}),t.style({display:"block"}),u},u.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),u},u.hide=function(){if(t)return t.style({display:"none"}),u},u.show=function(){if(t)return t.style({display:"block"}),u},u.config=function(t){return a(i,t),u},u},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=a({},t),i=[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]];return i.forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",n.dotVisible===!0?(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);n!=-1&&(r.data[e].groupId=n)})}if(t.layout){var s=a({},t.layout),l=[[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]];if(l.forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e?("undefined"!=typeof s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&"undefined"!=typeof s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&"undefined"!=typeof s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&"undefined"!=typeof s.margin.t){var u=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],h={};n.entries(s.margin).forEach(function(t,e){h[c[u.indexOf(t.key)]]=t.value}),s.margin=h}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),r.layout=s}return r},t}},{"../../lib":658,d3:97}],756:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,u=e.exports={};u.framework=function(t){function e(e,i){return i&&(h=i),n.select(n.select(h).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?l(r,e):e,a||(a=o.Axis()),c=o.adapter.plotly().convert(r),a.config(c).render(h),t.data=r.data,t.layout=r.layout,u.fillLayout(t),r}var r,i,a,c,h,f=new s;return e.isPolar=!0,e.svg=function(){return a.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},e.setUndoPoint=function(){var t=this,e=o.util.cloneJson(r);!function(e,r){f.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,i),i=o.util.cloneJson(e)},e.undo=function(){f.undo()},e.redo=function(){f.redo()},e},u.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../components/color":558,"../../lib":658,"./micropolar":755,"./undo_manager":757,d3:97}],757:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(i=!0,t[e](),i=!1,this):this}var e,r=[],n=-1,i=!1;return{add:function(t){return i?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var i=r[n];return i?(t(i,"undo"),n-=1,e&&e(i.undo),this):this},redo:function(){var i=r[n+1];return i?(t(i,"redo"),n+=1,e&&e(i.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return n!==-1},hasRedo:function(){return n<r.length-1},getCommands:function(){return r},getPreviousCommand:function(){return r[n-1]},getIndex:function(){return n}}}},{}],758:[function(t,e,r){"use strict";var n=t("../lib"),i=t("./plots");e.exports=function(t,e,r,a){function o(t,e){return n.coerce(s,l,c,t,e)}for(var s,l,u=a.type,c=a.attributes,h=a.handleDefaults,f=a.partition||"x",d=i.findSubplotIds(r,u),p=d.length,m=0;m<p;m++){var g=d[m];s=t[g]?t[g]:t[g]={},e[g]=l={},o("domain."+f,[m/p,(m+1)/p]),o("domain."+{x:"y",y:"x"}[f]),a.id=g,h(s,l,o,a)}}},{"../lib":658,"./plots":751}],759:[function(t,e,r){"use strict";var n=t("./ternary"),i=t("../../plots/plots");r.name="ternary",r.attr="subplot",r.idRoot="ternary",r.idRegex=/^ternary([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^ternary([2-9]|[1-9][0-9]+)?$/,r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t.calcdata,a=i.getSubplotIds(e,"ternary"),o=0;o<a.length;o++){var s=a[o],l=i.getSubplotCalcData(r,"ternary",s),u=e[s]._subplot;u||(u=new n({id:s,graphDiv:t,container:e._ternarylayer.node()},e),e[s]._subplot=u),u.plot(l,e,t._promises)}},r.clean=function(t,e,r,n){for(var a=i.getSubplotIds(n,"ternary"),o=0;o<a.length;o++){var s=a[o],l=n[s]._subplot;!e[s]&&l&&(l.plotContainer.remove(),l.clipDef.remove())}}},{"../../plots/plots":751,"./layout/attributes":760,"./layout/defaults":763,"./layout/layout_attributes":764,"./ternary":765}],760:[function(t,e,r){"use strict";e.exports={subplot:{valType:"subplotid",dflt:"ternary"}}},{}],761:[function(t,e,r){"use strict";var n=t("../../cartesian/layout_attributes"),i=t("../../../lib/extend").extendFlat;e.exports={title:n.title,titlefont:n.titlefont,color:n.color,tickmode:n.tickmode,nticks:i({},n.nticks,{dflt:6,min:1}),tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:n.ticks,ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,showtickprefix:n.showtickprefix,tickprefix:n.tickprefix,showticksuffix:n.showticksuffix,ticksuffix:n.ticksuffix,showexponent:n.showexponent,exponentformat:n.exponentformat,separatethousands:n.separatethousands,tickfont:n.tickfont,tickangle:n.tickangle,tickformat:n.tickformat,hoverformat:n.hoverformat,showline:i({},n.showline,{dflt:!0}),linecolor:n.linecolor,linewidth:n.linewidth,showgrid:i({},n.showgrid,{dflt:!0}),gridcolor:n.gridcolor,gridwidth:n.gridwidth,min:{valType:"number",dflt:0,min:0}}},{"../../../lib/extend":651,"../../cartesian/layout_attributes":700}],762:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,i=t("../../../lib"),a=t("./axis_attributes"),o=t("../../cartesian/tick_label_defaults"),s=t("../../cartesian/tick_mark_defaults"),l=t("../../cartesian/tick_value_defaults");e.exports=function(t,e,r){function u(r,n){return i.coerce(t,e,a,r,n)}e.type="linear";var c=u("color"),h=c===t.color?c:r.font.color,f=e._name,d=f.charAt(0).toUpperCase(),p="Component "+d,m=u("title",p);e._hovertitle=m===p?m:d,i.coerceFont(u,"titlefont",{family:r.font.family,size:Math.round(1.2*r.font.size),color:h}),u("min"),l(t,e,u,"linear"),o(t,e,u,"linear",{noHover:!1}),s(t,e,u,{outerTicks:!0});var g=u("showticklabels");g&&(i.coerceFont(u,"tickfont",{family:r.font.family,size:r.font.size,color:h}),u("tickangle"),u("tickformat")),u("hoverformat");var v=u("showline");v&&(u("linecolor",c),u("linewidth"));var y=u("showgrid");y&&(u("gridcolor",n(c,r.bgColor,60).toRgbString()),u("gridwidth"))}},{"../../../lib":658,"../../cartesian/tick_label_defaults":706,"../../cartesian/tick_mark_defaults":707,"../../cartesian/tick_value_defaults":708,"./axis_attributes":761,tinycolor2:495}],763:[function(t,e,r){"use strict";function n(t,e,r,n){var a=r("bgcolor"),o=r("sum");n.bgColor=i.combine(a,n.paper_bgcolor);for(var u,c,h,f=0;f<l.length;f++)u=l[f],c=t[u]||{},h=e[u]={_name:u},s(c,h,n);var d=e.aaxis,p=e.baxis,m=e.caxis;d.min+p.min+m.min>=o&&(d.min=0,p.min=0,m.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}var i=t("../../../components/color"),a=t("../../subplot_defaults"),o=t("./layout_attributes"),s=t("./axis_defaults"),l=["aaxis","baxis","caxis"];e.exports=function(t,e,r){a(t,e,r,{type:"ternary",attributes:o,handleDefaults:n,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../../components/color":558,"../../subplot_defaults":758,"./axis_defaults":762,"./layout_attributes":764}],764:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("./axis_attributes");e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},bgcolor:{valType:"color",dflt:n.background},sum:{valType:"number",dflt:1,min:0},aaxis:i,baxis:i,caxis:i}},{"../../../components/color/attributes":557,"./axis_attributes":761}],765:[function(t,e,r){"use strict";function n(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework()}function i(t){a.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}var a=t("d3"),o=t("tinycolor2"),s=t("../../plotly"),l=t("../../lib"),u=t("../../components/color"),c=t("../../components/drawing"),h=t("../cartesian/set_convert"),f=t("../../lib/extend").extendFlat,d=t("../plots"),p=t("../cartesian/axes"),m=t("../../components/dragelement"),g=t("../../components/titles"),v=t("../cartesian/select"),y=t("../cartesian/constants"),x=t("../cartesian/graph_interact");e.exports=n;var b=n.prototype;b.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={}},b.plot=function(t,e){var r=this,n=e[r.id],i=e._size;r.adjustLayout(n,i),d.generalUpdatePerTraceModule(r,t,n),r.layers.plotbg.select("path").call(u.fill,n.bgcolor)},b.makeFramework=function(){var t=this,e=t.defs.selectAll("g.clips").data([0]);e.enter().append("g").classed("clips",!0);var r="clip"+t.layoutId+t.id;t.clipDef=e.selectAll("#"+r).data([0]),t.clipDef.enter().append("clipPath").attr("id",r).append("path").attr("d","M0,0Z"),t.plotContainer=t.container.selectAll("g."+t.id).data([0]),t.plotContainer.enter().append("g").classed(t.id,!0),t.layers={};var n=["draglayer","plotbg","backplot","grids","frontplot","zoom","aaxis","baxis","caxis","axlines"],i=t.plotContainer.selectAll("g.toplevel").data(n);i.enter().append("g").attr("class",function(t){return"toplevel "+t}).each(function(e){var r=a.select(this);t.layers[e]=r,"frontplot"===e?r.append("g").classed("scatterlayer",!0):"backplot"===e?r.append("g").classed("maplayer",!0):"plotbg"===e?r.append("path").attr("d","M0,0Z"):"axlines"===e&&r.selectAll("path").data(["aline","bline","cline"]).enter().append("path").each(function(t){a.select(this).classed(t,!0)})});var o=t.plotContainer.select(".grids").selectAll("g.grid").data(["agrid","bgrid","cgrid"]);o.enter().append("g").attr("class",function(t){return"grid "+t}).each(function(e){t.layers[e]=a.select(this)}),t.plotContainer.selectAll(".backplot,.frontplot,.grids").call(c.setClipUrl,r),t.graphDiv._context.staticPlot||t.initInteractions()};var _=Math.sqrt(4/3);b.adjustLayout=function(t,e){var r,n,i,a,o,s,l=this,c=t.domain,d=(c.x[0]+c.x[1])/2,p=(c.y[0]+c.y[1])/2,m=c.x[1]-c.x[0],g=c.y[1]-c.y[0],v=m*e.w,y=g*e.h,x=t.sum,b=t.aaxis.min,w=t.baxis.min,M=t.caxis.min;v>_*y?(a=y,i=a*_):(i=v,a=i/_),o=m*i/v,s=g*a/y,r=e.l+e.w*d-i/2,n=e.t+e.h*(1-p)-a/2,l.x0=r,l.y0=n,l.w=i,l.h=a,l.sum=x,l.xaxis={type:"linear",range:[b+2*M-x,x-b-2*w],domain:[d-o/2,d+o/2],_id:"x",_gd:l.graphDiv},h(l.xaxis),l.xaxis.setScale(),l.yaxis={type:"linear",range:[b,x-w-M],domain:[p-s/2,p+s/2],_id:"y",_gd:l.graphDiv},h(l.yaxis),l.yaxis.setScale();var A=l.yaxis.domain[0],k=l.aaxis=f({},t.aaxis,{range:[b,x-w-M],side:"left",_counterangle:30,tickangle:(+t.aaxis.tickangle||0)-30,domain:[A,A+s*_],_axislayer:l.layers.aaxis,_gridlayer:l.layers.agrid,_pos:0,_gd:l.graphDiv,_id:"y",_length:i,_gridpath:"M0,0l"+a+",-"+i/2});h(k);var T=l.baxis=f({},t.baxis,{range:[x-b-M,w],side:"bottom",_counterangle:30,domain:l.xaxis.domain,_axislayer:l.layers.baxis,_gridlayer:l.layers.bgrid,_counteraxis:l.aaxis,_pos:0,_gd:l.graphDiv,_id:"x",_length:i,_gridpath:"M0,0l-"+i/2+",-"+a});h(T),k._counteraxis=T;var E=l.caxis=f({},t.caxis,{range:[x-b-w,M],side:"right",_counterangle:30,tickangle:(+t.caxis.tickangle||0)+30,domain:[A,A+s*_],_axislayer:l.layers.caxis,_gridlayer:l.layers.cgrid,_counteraxis:l.baxis,_pos:0,_gd:l.graphDiv,_id:"y",_length:i,_gridpath:"M0,0l-"+a+","+i/2});h(E);var S="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";l.clipDef.select("path").attr("d",S),l.layers.plotbg.select("path").attr("d",S);var L="translate("+r+","+n+")";l.plotContainer.selectAll(".scatterlayer,.maplayer,.zoom").attr("transform",L);var C="translate("+r+","+(n+a)+")";l.layers.baxis.attr("transform",C),l.layers.bgrid.attr("transform",C);var I="translate("+(r+i/2)+","+n+")rotate(30)";l.layers.aaxis.attr("transform",I),l.layers.agrid.attr("transform",I);var z="translate("+(r+i/2)+","+n+")rotate(-30)";l.layers.caxis.attr("transform",z),l.layers.cgrid.attr("transform",z),l.drawAxes(!0),l.plotContainer.selectAll(".crisp").classed("crisp",!1);var D=l.layers.axlines;D.select(".aline").attr("d",k.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(u.stroke,k.linecolor||"#000").style("stroke-width",(k.linewidth||0)+"px"),D.select(".bline").attr("d",T.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(u.stroke,T.linecolor||"#000").style("stroke-width",(T.linewidth||0)+"px"),D.select(".cline").attr("d",E.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(u.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px")},b.drawAxes=function(t){var e=this,r=e.graphDiv,n=e.id.substr(7)+"title",i=e.aaxis,a=e.baxis,o=e.caxis;if(p.doTicks(r,i,!0),p.doTicks(r,a,!0),p.doTicks(r,o,!0),t){var s=Math.max(i.showticklabels?i.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0));g.draw(r,"a"+n,{propContainer:i,propName:e.id+".aaxis.title",dfltName:"Component A",attributes:{x:e.x0+e.w/2,y:e.y0-i.titlefont.size/3-s,"text-anchor":"middle"}});var l=(a.showticklabels?a.tickfont.size:0)+("outside"===a.ticks?a.ticklen:0)+3;g.draw(r,"b"+n,{propContainer:a,propName:e.id+".baxis.title",dfltName:"Component B",attributes:{x:e.x0-l,y:e.y0+e.h+.83*a.titlefont.size+l,"text-anchor":"middle"}}),g.draw(r,"c"+n,{propContainer:o,propName:e.id+".caxis.title",dfltName:"Component C",attributes:{x:e.x0+e.w+l,y:e.y0+e.h+.83*o.titlefont.size+l,"text-anchor":"middle"}})}};var w=y.MINZOOM/2+.87,M="m-0.87,.5h"+w+"v3h-"+(w+5.2)+"l"+(w/2+2.6)+",-"+(.87*w+4.5)+"l2.6,1.5l-"+w/2+","+.87*w+"Z",A="m0.87,.5h-"+w+"v3h"+(w+5.2)+"l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-2.6,1.5l"+w/2+","+.87*w+"Z",k="m0,1l"+w/2+","+.87*w+"l2.6,-1.5l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-"+(w/2+2.6)+","+(.87*w+4.5)+"l2.6,1.5l"+w/2+",-"+.87*w+"Z",T="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",E=!0;b.initInteractions=function(){function t(t,e,r){var n=F.getBoundingClientRect();b=e-n.left,w=r-n.top,S={a:R.aaxis.range[0],b:R.baxis.range[1],c:R.caxis.range[1]},C=S,L=R.aaxis.range[1]-S.a,I=o(R.graphDiv._fullLayout[R.id].bgcolor).getLuminance(),z="M0,"+R.h+"L"+R.w/2+", 0L"+R.w+","+R.h+"Z",D=!1,P=N.append("path").attr("class","zoombox").style({fill:I>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",z),O=N.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),p()}function e(t,e){return 1-e/R.h}function r(t,e){return 1-(t+(R.h-e)/Math.sqrt(3))/R.w}function n(t,e){return(t-(R.h-e)/Math.sqrt(3))/R.w}function a(t,i){var a=b+t,o=w+i,s=Math.max(0,Math.min(1,e(b,w),e(a,o))),l=Math.max(0,Math.min(1,r(b,w),r(a,o))),u=Math.max(0,Math.min(1,n(b,w),n(a,o))),c=(s/2+u)*R.w,h=(1-s/2-l)*R.w,f=(c+h)/2,d=h-c,p=(1-s)*R.h,m=p-d/_;d<y.MINZOOM?(C=S,P.attr("d",z),O.attr("d","M0,0Z")):(C={a:S.a+s*L,b:S.b+l*L,c:S.c+u*L},P.attr("d",z+"M"+c+","+p+"H"+h+"L"+f+","+m+"L"+c+","+p+"Z"),O.attr("d","M"+b+","+w+T+"M"+c+","+p+M+"M"+h+","+p+A+"M"+f+","+m+k)),D||(P.transition().style("fill",I>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),O.transition().style("opacity",1).duration(200),D=!0)}function c(t,e){if(C===S)return 2===e&&g(),i(j);i(j);var r={};r[R.id+".aaxis.min"]=C.a,r[R.id+".baxis.min"]=C.b,r[R.id+".caxis.min"]=C.c,s.relayout(j,r),E&&j.data&&j._context.showTips&&(l.notifier("Double-click to<br>zoom back out","long"),E=!1)}function h(){S={a:R.aaxis.range[0],b:R.baxis.range[1],c:R.caxis.range[1]},C=S}function f(t,e){var r=t/R.xaxis._m,n=e/R.yaxis._m;C={a:S.a-n,b:S.b+(r+n)/2,c:S.c-(r-n)/2};var i=[C.a,C.b,C.c].sort(),a={a:i.indexOf(C.a),b:i.indexOf(C.b),c:i.indexOf(C.c)};i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),C={a:i[a.a],b:i[a.b],c:i[a.c]},e=(S.a-C.a)*R.yaxis._m,t=(S.c-C.c-S.b+C.b)*R.xaxis._m);var o="translate("+(R.x0+t)+","+(R.y0+e)+")";R.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",o),R.aaxis.range=[C.a,R.sum-C.b-C.c],R.baxis.range=[R.sum-C.a-C.c,C.b],R.caxis.range=[R.sum-C.a-C.b,C.c],R.drawAxes(!1),R.plotContainer.selectAll(".crisp").classed("crisp",!1)}function d(t,e){if(t){var r={};r[R.id+".aaxis.min"]=C.a,r[R.id+".baxis.min"]=C.b,r[R.id+".caxis.min"]=C.c,s.relayout(j,r)}else 2===e&&g()}function p(){R.plotContainer.selectAll(".select-outline").remove()}function g(){var t={};t[R.id+".aaxis.min"]=0,t[R.id+".baxis.min"]=0,t[R.id+".caxis.min"]=0,j.emit("plotly_doubleclick",null),s.relayout(j,t)}var b,w,S,L,C,I,z,D,P,O,R=this,F=R.layers.plotbg.select("path").node(),j=R.graphDiv,N=R.layers.zoom,B={element:F,gd:j,plotinfo:{plot:N},doubleclick:g,subplot:R.id,prepFn:function(e,r,n){B.xaxes=[R.xaxis],B.yaxes=[R.yaxis];var i=j._fullLayout.dragmode;e.shiftKey&&(i="pan"===i?"zoom":"pan"),"lasso"===i?B.minDrag=1:B.minDrag=void 0,"zoom"===i?(B.moveFn=a,B.doneFn=c,t(e,r,n)):"pan"===i?(B.moveFn=f,B.doneFn=d,h(),p()):"select"!==i&&"lasso"!==i||v(e,r,n,B,i)}};F.onmousemove=function(t){x.hover(j,t,R.id),j._fullLayout._lasthover=F,j._fullLayout._hoversubplot=R.id},F.onmouseout=function(t){j._dragging||m.unhover(j,t)},F.onclick=function(t){x.click(j,t)},m.init(B)}},{"../../components/color":558,"../../components/dragelement":579,"../../components/drawing":581,"../../components/titles":632,"../../lib":658,"../../lib/extend":651,"../../plotly":686,"../cartesian/axes":691,"../cartesian/constants":696,"../cartesian/graph_interact":698,"../cartesian/select":704,"../cartesian/set_convert":705,"../plots":751,d3:97,tinycolor2:495}],766:[function(t,e,r){"use strict";function n(t){return"object"==typeof t&&(t=t.type),t}var i=t("./lib"),a=t("./plots/attributes");r.modules={},r.allCategories={},r.allTypes=[],r.subplotsRegistry={},r.transformsRegistry={},r.componentsRegistry={},r.layoutArrayContainers=[],r.register=function(t,e,n,a){if(r.modules[e])return void i.log("Type "+e+" already registered");for(var o={},s=0;s<n.length;s++)o[n[s]]=!0,r.allCategories[n[s]]=!0;r.modules[e]={_module:t,categories:o},a&&Object.keys(a).length&&(r.modules[e].meta=a),r.allTypes.push(e)},r.registerSubplot=function(t){var e=t.name;return r.subplotsRegistry[e]?void i.log("Plot type "+e+" already registered."):void(r.subplotsRegistry[e]=t)},r.registerComponent=function(t){var e=t.name;r.componentsRegistry[e]=t,t.layoutAttributes&&t.layoutAttributes._isLinkedToArray&&i.pushUnique(r.layoutArrayContainers,e)},r.getModule=function(t){if(void 0!==t.r)return i.warn("Tried to put a polar trace on an incompatible graph of cartesian data. Ignoring this dataset.",t),!1;var e=r.modules[n(t)];return!!e&&e._module},r.traceIs=function(t,e){if(t=n(t),"various"===t)return!1;var o=r.modules[t];return o||(t&&"area"!==t&&i.log("Unrecognized trace type "+t+"."),o=r.modules[a.type.dflt]),!!o.categories[e]},r.getComponentMethod=function(t,e){var n=r.componentsRegistry[t];return n?n[e]:i.noop}},{"./lib":658,"./plots/attributes":689}],767:[function(t,e,r){"use strict";function n(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}function i(t){var e=["xaxis","yaxis","zaxis"];return e.indexOf(t.slice(0,5))>-1}var a=t("../lib"),o=t("../plots/plots"),s=a.extendFlat,l=a.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,a=t.data,u=t.layout,c=l([],a),h=l({},u,n(e.tileClass));if(e.width&&(h.width=e.width),e.height&&(h.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){h.annotations=[];var f=Object.keys(h);for(r=0;r<f.length;r++)i(f[r])&&(h[f[r]].title="");for(r=0;r<c.length;r++){var d=c[r];d.showscale=!1,d.marker&&(d.marker.showscale=!1),"pie"===d.type&&(d.textposition="none")}}if(Array.isArray(e.annotations))for(r=0;r<e.annotations.length;r++)h.annotations.push(e.annotations[r]);var p=o.getSubplotIds(h,"gl3d");if(p.length){var m={};for("thumbnail"===e.tileClass&&(m={title:"",showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),r=0;r<p.length;r++){var g=p[r];s(h[g].xaxis,m),s(h[g].yaxis,m),s(h[g].zaxis,m),h[g]._scene=null}}var v=document.createElement("div");e.tileClass&&(v.className=e.tileClass);var y={gd:v,td:v,layout:h,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}};return"transparent"!==e.setBackground&&(y.config.setBackground=e.setBackground||"opaque"),y.gd.defaultLayout=n(e.tileClass),y}},{"../lib":658,"../plots/plots":751}],768:[function(t,e,r){"use strict";function n(t,e){return e=e||{},e.format=e.format||"png",new Promise(function(r,n){t._snapshotInProgress&&n(new Error("Snapshotting already in progress.")),a.isIE()&&"svg"!==e.format&&n(new Error("Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.")),t._snapshotInProgress=!0;var s=i(t,e),l=e.filename||t.fn||"newplot";l+="."+e.format,s.then(function(e){return t._snapshotInProgress=!1,o(e,l)}).then(function(t){r(t)}).catch(function(e){t._snapshotInProgress=!1,n(e)})})}var i=t("../plot_api/to_image"),a=t("../lib"),o=t("./filesaver");e.exports=n},{"../lib":658,"../plot_api/to_image":684,"./filesaver":769}],769:[function(t,e,r){"use strict";var n=function(t,e){var r=document.createElement("a"),n="download"in r,i=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),a=new Promise(function(a,o){"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent)&&o(new Error("IE < 10 unsupported")),i&&(document.location.href="data:application/octet-stream"+t.slice(t.search(/[,;]/)),a(e)),e||(e="download"),n&&(r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r),a(e)),"undefined"!=typeof navigator&&navigator.msSaveBlob&&(navigator.msSaveBlob(new Blob([t]),e),a(e)),o(new Error("download error"))});return a};e.exports=n},{}],770:[function(t,e,r){"use strict";r.getDelay=function(t){return t._has&&(t._has("gl3d")||t._has("gl2d"))?500:0},r.getRedrawFunc=function(t){if(!(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()})}}},{}],771:[function(t,e,r){"use strict";var n=t("./helpers"),i={getDelay:n.getDelay,getRedrawFunc:n.getRedrawFunc,clone:t("./cloneplot"),toSVG:t("./tosvg"),svgToImg:t("./svgtoimg"),toImage:t("./toimage"),downloadImage:t("./download")};e.exports=i},{"./cloneplot":767,"./download":768,"./helpers":770,"./svgtoimg":772,"./toimage":773,"./tosvg":774}],772:[function(t,e,r){"use strict";function n(t){var e=t.emitter||new a,r=new Promise(function(n,a){var o=window.Image,s=t.svg,l=t.format||"png";if(i.isIE()&&(s=s.replace(/"/gi,"'"),s=s.replace(/(\('#)(.*)('\))/gi,'("$2")'),s=s.replace(/(\\')/gi,'"'),"svg"!==l)){var u=new Error("Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.");return a(u),t.promise?r:e.emit("error",u)}var c=t.canvas,h=c.getContext("2d"),f=new o,d="data:image/svg+xml,"+encodeURIComponent(s);c.height=t.height||150,c.width=t.width||300,f.onload=function(){var r;switch("svg"!==l&&h.drawImage(f,0,0),l){case"jpeg":r=c.toDataURL("image/jpeg");break;case"png":r=c.toDataURL("image/png");break;case"webp":r=c.toDataURL("image/webp");break;case"svg":r=d;break;default:if(a(new Error("Image format is not jpeg, png or svg")),!t.promise)return e.emit("error","Image format is not jpeg, png or svg")}n(r),t.promise||e.emit("success",r)},f.onerror=function(r){if(a(r),!t.promise)return e.emit("error",r)},f.src=d});return t.promise?r:e}var i=t("../lib"),a=t("events").EventEmitter;e.exports=n},{"../lib":658,events:104}],773:[function(t,e,r){"use strict";function n(t,e){function r(){var t=s.getDelay(f._fullLayout);setTimeout(function(){var t=u(f),r=document.createElement("canvas");r.id=o.randstr(),n=c({format:e.format,width:f._fullLayout.width,height:f._fullLayout.height,canvas:r,emitter:n,svg:t}),n.clean=function(){f&&document.body.removeChild(f)}},t)}var n=new i,h=l(t,{format:"png"}),f=h.gd;f.style.position="absolute",f.style.left="-5000px",document.body.appendChild(f);var d=s.getRedrawFunc(f);return a.plot(f,h.data,h.layout,h.config).then(d).then(r).catch(function(t){n.emit("error",t)}),n}var i=t("events").EventEmitter,a=t("../plotly"),o=t("../lib"),s=t("./helpers"),l=t("./cloneplot"),u=t("./tosvg"),c=t("./svgtoimg");e.exports=n},{"../lib":658,"../plotly":686,"./cloneplot":767,"./helpers":770,"./svgtoimg":772,"./tosvg":774,events:104}],774:[function(t,e,r){"use strict";var n=t("d3"),i=t("../lib/svg_text_utils"),a=t("../components/drawing"),o=t("../components/color"),s=t("../constants/xmlns_namespaces");e.exports=function(t,e){var r,l=t._fullLayout,u=l._paper,c=l._toppaper;u.insert("rect",":first-child").call(a.setRect,0,0,l.width,l.height).call(o.fill,l.paper_bgcolor);var h=l._basePlotModules||[];for(r=0;r<h.length;r++){var f=h[r];f.toSVG&&f.toSVG(t)}if(c){var d=c.node().childNodes,p=Array.prototype.slice.call(d);for(r=0;r<p.length;r++){var m=p[r];m.childNodes.length&&u.node().appendChild(m)}}l._draggers&&l._draggers.remove(),u.node().style.background="",u.selectAll("text").attr("data-unformatted",null).each(function(){var t=n.select(this);if("hidden"===t.style("visibility"))return void t.remove();t.style("visibility","visible");var e=t.style("font-family");e&&e.indexOf('"')!==-1&&t.style("font-family",e.replace(/"/g,"TOBESTRIPPED"))}),"pdf"!==e&&"eps"!==e||u.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),u.node().setAttributeNS(s.xmlns,"xmlns",s.svg),u.node().setAttributeNS(s.xmlns,"xmlns:xlink",s.xlink);var g=(new window.XMLSerializer).serializeToString(u.node());return g=i.html_entity_decode(g),g=i.xml_entity_encode(g),g=g.replace(/("TOBESTRIPPED)|(TOBESTRIPPED")/g,"'")}},{"../components/color":558,"../components/drawing":581,"../constants/xmlns_namespaces":643,"../lib/svg_text_utils":674,d3:97}],775:[function(t,e,r){"use strict";var n=t("../../lib").mergeArray;e.exports=function(t,e){n(e.text,t,"tx");var r=e.marker;if(r){n(r.opacity,t,"mo"),n(r.color,t,"mc");var i=r.line;i&&(n(i.color,t,"mlc"),n(i.width,t,"mlw"))}}},{"../../lib":658}],776:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/colorscale/color_attributes"),a=t("../../components/errorbars/attributes"),o=t("../../components/colorbar/attributes"),s=t("../../plots/font_attributes"),l=t("../../lib/extend").extendFlat,u=t("../../lib/extend").extendDeep,c=u({},s);c.family.arrayOk=!0,c.size.arrayOk=!0,c.color.arrayOk=!0;var h=n.marker,f=h.line,d=l({},f.width,{dflt:0}),p=l({},{width:d},i("marker.line")),m=l({},{line:p},i("marker"),{showscale:h.showscale,colorbar:o});e.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:n.text,textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"none",arrayOk:!0},textfont:l({},c,{}),insidetextfont:l({},c,{}),outsidetextfont:l({},c,{}),orientation:{valType:"enumerated",values:["v","h"]},base:{valType:"any",dflt:null,arrayOk:!0},offset:{valType:"number",dflt:null,arrayOk:!0},width:{valType:"number",dflt:null,min:0,arrayOk:!0},marker:m,r:n.r,t:n.t,error_y:a,error_x:a,_deprecated:{bardir:{valType:"enumerated",values:["v","h"]}}}},{"../../components/colorbar/attributes":559,"../../components/colorscale/color_attributes":565,"../../components/errorbars/attributes":583,"../../lib/extend":651,"../../plots/font_attributes":711,"../scatter/attributes":884}],777:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/calc"),s=t("./arrays_to_calcdata");e.exports=function(t,e){var r,l,u,c,h,f=i.getFromId(t,e.xaxis||"x"),d=i.getFromId(t,e.yaxis||"y"),p=e.orientation||(e.x&&!e.y?"h":"v");"h"===p?(r=f,u=f.makeCalcdata(e,"x"),l=d.makeCalcdata(e,"y"),h=e.xcalendar):(r=d,u=d.makeCalcdata(e,"y"),l=f.makeCalcdata(e,"x"),h=e.ycalendar);var m=Math.min(l.length,u.length),g=[];for(c=0;c<m;c++)n(l[c])&&g.push({p:l[c]});var v,y=e.base;if(Array.isArray(y)){for(c=0;c<Math.min(y.length,g.length);c++)v=r.d2c(y[c],0,h),g[c].b=n(v)?v:0;for(;c<g.length;c++)g[c].b=0}else for(v=r.d2c(y,0,h),v=n(v)?v:0,c=0;c<g.length;c++)g[c].b=v;for(c=0;c<g.length;c++)n(u[c])&&(g[c].s=u[c]);return a(e,"marker")&&o(e,e.marker.color,"marker","c"),a(e,"marker.line")&&o(e,e.marker.line.color,"marker.line","c"),s(g,e),g}},{"../../components/colorscale/calc":564,"../../components/colorscale/has_colorscale":571,"../../plots/cartesian/axes":691,"./arrays_to_calcdata":775,"fast-isnumeric":106}],778:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color"),a=t("../scatter/xy_defaults"),o=t("../bar/style_defaults"),s=t("../../components/errorbars/defaults"),l=t("./attributes");e.exports=function(t,e,r,u){function c(r,i){return n.coerce(t,e,l,r,i)}var h=n.coerceFont,f=a(t,e,u,c);if(!f)return void(e.visible=!1);c("orientation",e.x&&!e.y?"h":"v"),c("base"),c("offset"),c("width"),c("text");var d=c("textposition"),p=Array.isArray(d)||"auto"===d,m=p||"inside"===d,g=p||"outside"===d;if(m||g){var v=h(c,"textfont",u.font);m&&h(c,"insidetextfont",v),g&&h(c,"outsidetextfont",v)}o(t,e,c,r,u),s(t,e,i.defaultLine,{axis:"y"}),s(t,e,i.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":558,"../../components/errorbars/defaults":586,"../../lib":658,"../bar/style_defaults":787,"../scatter/xy_defaults":906,"./attributes":776}],779:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/graph_interact"),i=t("../../components/errorbars"),a=t("../../components/color");e.exports=function(t,e,r,o){var s,l=t.cd,u=l[0].trace,c=l[0].t,h=t.xa,f=t.ya,d="closest"===o?c.barwidth/2:c.bargroupwidth/2;s="closest"!==o?function(t){return t.p}:"h"===u.orientation?function(t){return t.y}:function(t){return t.x};var p,m;"h"===u.orientation?(p=function(t){return n.inbox(t.b-e,t.x-e)+(t.x-e)/(t.x-t.b)},m=function(t){var e=s(t)-r;return n.inbox(e-d,e+d)}):(m=function(t){return n.inbox(t.b-r,t.y-r)+(t.y-r)/(t.y-t.b)},p=function(t){var r=s(t)-e;return n.inbox(r-d,r+d)});var g=n.getDistanceFunction(o,p,m);if(n.getClosest(l,g,t),t.index!==!1){var v=l[t.index],y=v.mcc||u.marker.color,x=v.mlcc||u.marker.line.color,b=v.mlw||u.marker.line.width;a.opacity(y)?t.color=y:a.opacity(x)&&b&&(t.color=x);var _=u.base?v.b+v.s:v.s;return"h"===u.orientation?(t.x0=t.x1=h.c2p(v.x,!0),t.xLabelVal=_,t.y0=f.c2p(s(v)-d,!0),t.y1=f.c2p(s(v)+d,!0),t.yLabelVal=v.p):(t.y0=t.y1=f.c2p(v.y,!0),t.yLabelVal=_,t.x0=h.c2p(s(v)-d,!0),t.x1=h.c2p(s(v)+d,!0),t.xLabelVal=v.p),v.tx&&(t.text=v.tx),i.hoverInfo(v,u,t),[t]}}},{"../../components/color":558,"../../components/errorbars":587,"../../plots/cartesian/graph_interact":698}],780:[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"),n.hoverPoints=t("./hover"),n.moduleType="trace",n.name="bar",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","bar","oriented","markerColorscale","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":699,"../scatter/colorbar":887,"./arrays_to_calcdata":775,"./attributes":776,"./calc":777,"./defaults":778,"./hover":779,"./layout_attributes":781,"./layout_defaults":782,"./plot":783,"./set_positions":784,"./style":786}],781:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:""},bargap:{valType:"number",min:0,max:1},bargroupgap:{valType:"number",min:0,max:1,dflt:0}}},{}],782:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/cartesian/axes"),a=t("../../lib"),o=t("./layout_attributes");e.exports=function(t,e,r){function s(r,n){return a.coerce(t,e,o,r,n)}for(var l=!1,u=!1,c=!1,h={},f=0;f<r.length;f++){var d=r[f];if(n.traceIs(d,"bar")){if(l=!0,"overlay"!==t.barmode&&"stack"!==t.barmode){var p=d.xaxis+d.yaxis;h[p]&&(c=!0),h[p]=!0}if(d.visible&&"histogram"===d.type){var m=i.getFromId({_fullLayout:e},d["v"===d.orientation?"xaxis":"yaxis"]);"category"!==m.type&&(u=!0)}}}if(l){var g=s("barmode");"overlay"!==g&&s("barnorm"),s("bargap",u&&!c?0:.2),s("bargroupgap")}}},{"../../lib":658,"../../plots/cartesian/axes":691,"../../registry":766,"./layout_attributes":781}],783:[function(t,e,r){"use strict";function n(t,e,r,n,o,f,d,p){function m(t,e,r){var n=t.append("text").attr("data-notex",1).text(e).attr({class:"bartext",transform:"","data-bb":"","text-anchor":"middle",x:0,y:0}).call(A.font,r);return n.call(w.convertToTspans),n.selectAll("tspan.line").attr({x:0,y:0}),n}var g=r[0].trace,v=g.orientation,y=s(g,n);if(y){var x=l(g,n);if("none"!==x){var b,_,M,k,T=u(g,n,t._fullLayout.font),E=c(g,n,T),S=h(g,n,T),L=t._fullLayout.barmode,C="stack"===L,I="relative"===L,D=C||I,P=r[n],O=!D||P._outmost,R=Math.abs(f-o)-2*z,F=Math.abs(p-d)-2*z;if("outside"===x&&(O||(x="inside")),"auto"===x)if(O){b=m(e,y,E),_=A.bBox(b.node()),M=_.width,k=_.height;var j=M>0&&k>0,N=M<=R&&k<=F,B=M<=F&&k<=R,U="h"===v?R>=M*(F/k):F>=k*(R/M);j&&(N||B||U)?x="inside":(x="outside",b.remove(),b=null)}else x="inside";if(!b&&(b=m(e,y,"outside"===x?S:E),_=A.bBox(b.node()),M=_.width,k=_.height,M<=0||k<=0))return void b.remove();var V;V="outside"===x?a(o,f,d,p,_,v):i(o,f,d,p,_,v),b.attr("transform",V)}}}function i(t,e,r,n,i,a){var s,l,u,c,h,f=i.width,d=i.height,p=(i.left+i.right)/2,m=(i.top+i.bottom)/2,g=Math.abs(e-t),v=Math.abs(n-r);g>2*z&&v>2*z?(h=z,g-=2*h,v-=2*h):h=0;var y,x;return f<=g&&d<=v?(y=!1,x=1):f<=v&&d<=g?(y=!0,x=1):f<d==g<v?(y=!1,x=Math.min(g/f,v/d)):(y=!0,x=Math.min(v/f,g/d)),y&&(y=90),y?(s=x*d,l=x*f):(s=x*f,l=x*d),"h"===a?e<t?(u=e+h+s/2,c=(r+n)/2):(u=e-h-s/2,c=(r+n)/2):n>r?(u=(t+e)/2,c=n-h-l/2):(u=(t+e)/2,c=n+h+l/2),o(p,m,u,c,x,y)}function a(t,e,r,n,i,a){var s,l="h"===a?Math.abs(n-r):Math.abs(e-t);l>2*z&&(s=z,l-=2*s);var u,c,h,f,d=!1,p="h"===a?Math.min(1,l/i.height):Math.min(1,l/i.width),m=(i.left+i.right)/2,g=(i.top+i.bottom)/2;return d?(u=p*i.height,c=p*i.width):(u=p*i.width,c=p*i.height),"h"===a?e<t?(h=e-s-u/2,f=(r+n)/2):(h=e+s+u/2,f=(r+n)/2):n>r?(h=(t+e)/2,f=n+s+c/2):(h=(t+e)/2,f=n-s-c/2),o(m,g,h,f,p,d)}function o(t,e,r,n,i,a){var o,s,l;i<1?o="scale("+i+") ":(i=1,o=""),s=a?"rotate("+a+" "+t+" "+e+") ":"";var u=r-i*t,c=n-i*e;return l="translate("+u+" "+c+")",l+o+s}function s(t,e){var r=d(t.text,e);return p(E,r)}function l(t,e){var r=d(t.textposition,e);return m(S,r)}function u(t,e,r){return f(L,t.textfont,e,r)}function c(t,e,r){return f(C,t.insidetextfont,e,r)}function h(t,e,r){return f(I,t.outsidetextfont,e,r)}function f(t,e,r,n){e=e||{};var i=d(e.family,r),a=d(e.size,r),o=d(e.color,r);return{family:p(t.family,i,n.family),size:g(t.size,a,n.size),color:v(t.color,o,n.color)}}function d(t,e){var r;return Array.isArray(t)?e<t.length&&(r=t[e]):r=t,r}function p(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}function m(t,e,r){return t.coerceNumber&&(e=+e),t.values.indexOf(e)!==-1?e:void 0!==r?r:t.dflt}function g(t,e,r){if(x(e)){e=+e;var n=t.min,i=t.max,a=void 0!==n&&e<n||void 0!==i&&e>i;if(!a)return e}return void 0!==r?r:t.dflt}function v(t,e,r){return b(e).isValid()?e:void 0!==r?r:t.dflt}var y=t("d3"),x=t("fast-isnumeric"),b=t("tinycolor2"),_=t("../../lib"),w=t("../../lib/svg_text_utils"),M=t("../../components/color"),A=t("../../components/drawing"),k=t("../../components/errorbars"),T=t("./attributes"),E=T.text,S=T.textposition,L=T.textfont,C=T.insidetextfont,I=T.outsidetextfont,z=3;e.exports=function(t,e,r){var i=e.xaxis,a=e.yaxis,o=t._fullLayout,s=e.plot.select(".barlayer").selectAll("g.trace.bars").data(r).enter().append("g").attr("class","trace bars");s.append("g").attr("class","points").each(function(e){var r=e[0].t,s=e[0].trace,l=r.poffset,u=Array.isArray(l),c=r.barwidth,h=Array.isArray(c);y.select(this).selectAll("g.point").data(_.identity).enter().append("g").classed("point",!0).each(function(r,f){function d(t){return 0===o.bargap&&0===o.bargroupgap?y.round(Math.round(t)-E,2):t}function p(t,e){return Math.abs(t-e)>=2?d(t):t>e?Math.ceil(t):Math.floor(t)}var m,g,v,b,_=r.p+(u?l[f]:l),w=_+(h?c[f]:c),A=r.b,k=A+r.s;if("h"===s.orientation?(v=a.c2p(_,!0),b=a.c2p(w,!0),m=i.c2p(A,!0),g=i.c2p(k,!0)):(m=i.c2p(_,!0),g=i.c2p(w,!0),v=a.c2p(A,!0),b=a.c2p(k,!0)),!(x(m)&&x(g)&&x(v)&&x(b)&&m!==g&&v!==b))return void y.select(this).remove();var T=(r.mlw+1||s.marker.line.width+1||(r.trace?r.trace.marker.line.width:0)+1)-1,E=y.round(T/2%1,2);if(!t._context.staticPlot){var S=M.opacity(r.mc||s.marker.color),L=S<1||T>.01?d:p;m=L(m,g),g=L(g,m),v=L(v,b),b=L(b,v)}var C=y.select(this);C.append("path").attr("d","M"+m+","+v+"V"+b+"H"+g+"V"+v+"Z"),n(t,C,e,f,m,g,v,b)})}),s.call(k.plot,e)}},{"../../components/color":558,"../../components/drawing":581,"../../components/errorbars":587,"../../lib":658,"../../lib/svg_text_utils":674,"./attributes":776,d3:97,"fast-isnumeric":106,tinycolor2:495}],784:[function(t,e,r){"use strict";function n(t,e,r,n){if(n.length){var s,l,u,c,h,f=t._fullLayout.barmode,d="overlay"===f,p="group"===f;if(d)i(t,e,r,n);else if(p){for(s=[],l=[],u=0;u<n.length;u++)c=n[u],h=c[0].trace,void 0===h.offset?l.push(c):s.push(c);l.length&&a(t,e,r,l),s.length&&i(t,e,r,s)}else{for(s=[],l=[],u=0;u<n.length;u++)c=n[u],h=c[0].trace,void 0===h.base?l.push(c):s.push(c);l.length&&o(t,e,r,l),s.length&&i(t,e,r,s)}}}function i(t,e,r,n){for(var i=t._fullLayout.barnorm,a=!1,o=!i,l=0;l<n.length;l++){var u=n[l],c=new b([u],a,o);s(t,e,c),i?(p(t,r,c),m(t,r,c)):f(t,r,c)}}function a(t,e,r,n){var i=t._fullLayout,a=i.barnorm,o=!1,s=!a,u=new b(n,o,s);l(t,e,u),a?(p(t,r,u),m(t,r,u)):f(t,r,u)}function o(t,e,r,n){var i=t._fullLayout,a=i.barmode,o="stack"===a,l="relative"===a,u=t._fullLayout.barnorm,c=l,h=!(u||o||l),f=new b(n,c,h);s(t,e,f),d(t,r,f);for(var p=0;p<n.length;p++)for(var g=n[p],y=0;y<g.length;y++){var x=g[y];if(v(x.s)){var _=x.b+x.s===f.get(x.p,x.s);_&&(x._outmost=!0)}}u&&m(t,r,f)}function s(t,e,r){var n,i,a,o,s=t._fullLayout,l=s.bargap,f=s.bargroupgap,d=r.minDiff,p=r.traces,m=d*(1-l),g=m,v=g*(1-f),y=-v/2;for(n=0;n<p.length;n++)i=p[n],a=i[0],o=a.t,o.barwidth=v,o.poffset=y,o.bargroupwidth=m;r.binWidth=p[0][0].t.barwidth/100,u(r),c(t,e,r),h(t,e,r)}function l(t,e,r){var n,i,a,o,s=t._fullLayout,l=s.bargap,f=s.bargroupgap,d=r.positions,p=r.distinctPositions,m=r.minDiff,g=r.traces,v=d.length!==p.length,y=g.length,x=m*(1-l),b=v?x/y:x,_=b*(1-f);for(n=0;n<y;n++){i=g[n],a=i[0];var w=v?((2*n+1-y)*b-_)/2:-_/2;o=a.t,o.barwidth=_,o.poffset=w,o.bargroupwidth=x}r.binWidth=g[0][0].t.barwidth/100,u(r),c(t,e,r),h(t,e,r,v)}function u(t){var e,r,n,i,a,o,s=t.traces;for(e=0;e<s.length;e++){r=s[e],n=r[0],i=n.trace,o=n.t;var l,u=i.offset,c=o.poffset;if(Array.isArray(u)){for(l=u.slice(0,r.length),a=0;a<l.length;a++)v(l[a])||(l[a]=c);for(a=l.length;a<r.length;a++)l.push(c);o.poffset=l}else void 0!==u&&(o.poffset=u);var h=i.width,f=o.barwidth;if(Array.isArray(h)){var d=h.slice(0,r.length);for(a=0;a<d.length;a++)v(d[a])||(d[a]=f);for(a=d.length;a<r.length;a++)d.push(f);if(o.barwidth=d,void 0===u){for(l=[],a=0;a<r.length;a++)l.push(c+(f-d[a])/2);o.poffset=l}}else void 0!==h&&(o.barwidth=h,void 0===u&&(o.poffset=c+(f-h)/2))}}function c(t,e,r){for(var n=r.traces,i=g(e),a=0;a<n.length;a++)for(var o=n[a],s=o[0].t,l=s.poffset,u=Array.isArray(l),c=s.barwidth,h=Array.isArray(c),f=0;f<o.length;f++){var d=o[f];d[i]=d.p+(u?l[f]:l)+(h?c[f]:c)/2}}function h(t,e,r,n){var i=r.traces,a=r.distinctPositions,o=a[0],s=r.minDiff,l=s/2;x.minDtick(e,s,o,n);for(var u=Math.min.apply(Math,a)-l,c=Math.max.apply(Math,a)+l,h=0;h<i.length;h++){var f=i[h],d=f[0],p=d.trace;if(void 0!==p.width||void 0!==p.offset)for(var m=d.t,g=m.poffset,v=m.barwidth,y=Array.isArray(g),b=Array.isArray(v),_=0;_<f.length;_++){var w=f[_],M=y?g[_]:g,A=b?v[_]:v,k=w.p,T=k+M,E=T+A;u=Math.min(u,T),c=Math.max(c,E)}}x.expand(e,[u,c],{padded:!1})}function f(t,e,r){for(var n=r.traces,i=g(e),a=e.l2c(e.c2l(0)),o=a,s=0;s<n.length;s++)for(var l=n[s],u=0;u<l.length;u++){var c=l[u],h=c.b,f=h+c.s;c[i]=f,v(e.c2l(f))&&(a=Math.max(a,f),o=Math.min(o,f)),v(e.c2l(h))&&(a=Math.max(a,h),o=Math.min(o,h))}x.expand(e,[o,a],{tozero:!0,padded:!0})}function d(t,e,r){var n,i,a,o,s=t._fullLayout,l=s.barnorm,u=g(e),c=r.traces,h=e.l2c(e.c2l(0)),f=h;for(n=0;n<c.length;n++)for(i=c[n],a=0;a<i.length;a++)if(o=i[a],v(o.s)){var d=r.put(o.p,o.b+o.s),p=d+o.b+o.s;o.b=d,o[u]=p,l||(v(e.c2l(p))&&(h=Math.max(h,p),f=Math.min(f,p)),v(e.c2l(d))&&(h=Math.max(h,d),f=Math.min(f,d)))}l||x.expand(e,[f,h],{tozero:!0,padded:!0})}function p(t,e,r){for(var n=r.traces,i=0;i<n.length;i++)for(var a=n[i],o=0;o<a.length;o++){var s=a[o];v(s.s)&&r.put(s.p,s.b+s.s)}}function m(t,e,r){for(var n=r.traces,i=g(e),a="fraction"===t._fullLayout.barnorm?1:100,o=a/1e9,s=0,l="stack"===t._fullLayout.barmode?a:0,u=!1,c=0;c<n.length;c++)for(var h=n[c],f=0;f<h.length;f++){var d=h[f];if(v(d.s)){var p=Math.abs(a/r.get(d.p,d.s));d.b*=p,d.s*=p;var m=d.b,y=m+d.s;d[i]=y,v(e.c2l(y))&&(y<s-o&&(u=!0,s=y),y>l+o&&(u=!0,l=y)),v(e.c2l(m))&&(m<s-o&&(u=!0,s=m),m>l+o&&(u=!0,l=m))}}x.expand(e,[s,l],{tozero:!0,padded:u})}function g(t){return t._id.charAt(0)}var v=t("fast-isnumeric"),y=t("../../registry"),x=t("../../plots/cartesian/axes"),b=t("./sieve.js");e.exports=function(t,e){var r,i=e.xaxis,a=e.yaxis,o=t._fullData,s=t.calcdata,l=[],u=[];for(r=0;r<o.length;r++){var c=o[r];c.visible===!0&&y.traceIs(c,"bar")&&c.xaxis===i._id&&c.yaxis===a._id&&("h"===c.orientation?l.push(s[r]):u.push(s[r]))}n(t,i,a,u),n(t,a,i,l)}},{"../../plots/cartesian/axes":691,"../../registry":766,"./sieve.js":785,"fast-isnumeric":106}],785:[function(t,e,r){"use strict";function n(t,e,r){this.traces=t,this.separateNegativeValues=e,this.dontMergeOverlappingData=r;for(var n=[],a=0;a<t.length;a++)for(var o=t[a],s=0;s<o.length;s++){var l=o[s];n.push(l.p)}this.positions=n;var u=i.distinctVals(this.positions);this.distinctPositions=u.vals,this.minDiff=u.minDiff,this.binWidth=this.minDiff,this.bins={}}e.exports=n;var i=t("../../lib");n.prototype.put=function(t,e){var r=this.getLabel(t,e),n=this.bins[r]||0;return this.bins[r]=n+e,n},n.prototype.get=function(t,e){var r=this.getLabel(t,e);return this.bins[r]||0},n.prototype.getLabel=function(t,e){var r=e<0&&this.separateNegativeValues?"v":"^",n=this.dontMergeOverlappingData?t:Math.round(t/this.binWidth);return r+n}},{"../../lib":658}],786:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/color"),a=t("../../components/drawing"),o=t("../../components/errorbars");e.exports=function(t){var e=n.select(t).selectAll("g.trace.bars"),r=e.size(),s=t._fullLayout;e.style("opacity",function(t){return t[0].trace.opacity}).each(function(t){("stack"===s.barmode&&r>1||0===s.bargap&&0===s.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),e.selectAll("g.points").each(function(t){var e=t[0].trace,r=e.marker,o=r.line,s=a.tryColorscale(r,""),l=a.tryColorscale(r,"line");n.select(this).selectAll("path").each(function(t){var e,a,u=(t.mlw+1||o.width+1)-1,c=n.select(this);e="mc"in t?t.mcc=s(t.mc):Array.isArray(r.color)?i.defaultLine:r.color,c.style("stroke-width",u+"px").call(i.fill,e),u&&(a="mlc"in t?t.mlcc=l(t.mlc):Array.isArray(o.color)?i.defaultLine:o.color,c.call(i.stroke,a))})}),e.call(o.style)}},{"../../components/color":558,"../../components/drawing":581,"../../components/errorbars":587,d3:97}],787:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s){r("marker.color",o),i(t,"marker")&&a(t,e,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&a(t,e,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width")}},{"../../components/color":558,"../../components/colorscale/defaults":567,"../../components/colorscale/has_colorscale":571}],788:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/color/attributes"),a=t("../../lib/extend").extendFlat,o=n.marker,s=o.line;e.exports={y:{valType:"data_array"},x:{valType:"data_array"},x0:{valType:"any"},y0:{valType:"any"},xcalendar:n.xcalendar,ycalendar:n.ycalendar,whiskerwidth:{valType:"number",min:0,max:1,dflt:.5},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1},jitter:{valType:"number",min:0,max:1},pointpos:{valType:"number",min:-2,max:2},orientation:{valType:"enumerated",values:["v","h"]},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)"},symbol:a({},o.symbol,{arrayOk:!1}),opacity:a({},o.opacity,{arrayOk:!1,dflt:1}),size:a({},o.size,{arrayOk:!1}),color:a({},o.color,{arrayOk:!1}),line:{color:a({},s.color,{arrayOk:!1,dflt:i.defaultLine}),width:a({},s.width,{arrayOk:!1,dflt:0}),outliercolor:{valType:"color"},outlierwidth:{valType:"number",min:0,dflt:1}}},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2}},fillcolor:n.fillcolor}},{"../../components/color/attributes":557,"../../lib/extend":651,"../scatter/attributes":884}],789:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/cartesian/axes");e.exports=function(t,e){function r(t,e,r,a,o){var s;return r in e?p=a.makeCalcdata(e,r):(s=r+"0"in e?e[r+"0"]:"name"in e&&("category"===a.type||n(e.name)&&["linear","log"].indexOf(a.type)!==-1||i.isDateTime(e.name)&&"date"===a.type)?e.name:t.numboxes,s=a.d2c(s,0,e[r+"calendar"]),p=o.map(function(){return s})),p}function o(t,e,r,a,o){var s,l,u,c,h=a.length,f=e.length,d=[],p=[];for(s=0;s<h;++s)l=a[s],t[s]={pos:l},p[s]=l-o,d[s]=[];for(p.push(a[h-1]+o),s=0;s<f;++s)c=e[s],n(c)&&(u=i.findBin(r[s],p),u>=0&&u<f&&d[u].push(c));return d}function s(t,e){var r,n,a,o;for(o=0;o<e.length;++o)r=e[o].sort(i.sorterAsc),n=r.length,a=t[o],a.val=r,a.min=r[0],a.max=r[n-1],a.mean=i.mean(r,n),a.sd=i.stdev(r,n,a.mean),a.q1=i.interp(r,.25),a.med=i.interp(r,.5),a.q3=i.interp(r,.75),a.lf=Math.min(a.q1,r[Math.min(i.findBin(2.5*a.q1-1.5*a.q3,r,!0)+1,n-1)]),a.uf=Math.max(a.q3,r[Math.max(i.findBin(2.5*a.q3-1.5*a.q1,r),0)]),a.lo=4*a.q1-3*a.q3,a.uo=4*a.q3-3*a.q1}var l,u,c,h,f,d,p,m,g,v=a.getFromId(t,e.xaxis||"x"),y=a.getFromId(t,e.yaxis||"y"),x=e.orientation,b=[];"h"===x?(l=v,u="x",f=y,d="y"):(l=y,u="y",f=v,d="x"),c=l.makeCalcdata(e,u),a.expand(l,c,{padded:!0}),p=r(t,e,d,f,c);var _=i.distinctVals(p);return m=_.vals,g=_.minDiff/2,h=o(b,c,p,m,g),s(b,h),b=b.filter(function(t){return t.val&&t.val.length}),b.length?(b[0].t={boxnum:t.numboxes,dPos:g},t.numboxes++,b):[{t:{emptybox:!0}}]}},{"../../lib":658,"../../plots/cartesian/axes":691,"fast-isnumeric":106}],790:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../components/color"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,i){return n.coerce(t,e,o,r,i)}var u,c=l("y"),h=l("x");if(c&&c.length)u="v",h||l("x0");else{if(!h||!h.length)return void(e.visible=!1);u="h",l("y0")}var f=i.getComponentMethod("calendars","handleTraceDefaults");f(t,e,["x","y"],s),l("orientation",u),l("line.color",(t.marker||{}).color||r),l("line.width",2),l("fillcolor",a.addOpacity(e.line.color,.5)),l("whiskerwidth"),l("boxmean");var d=n.coerce2(t,e,o,"marker.outliercolor"),p=l("marker.line.outliercolor"),m=d||p?l("boxpoints","suspectedoutliers"):l("boxpoints");m&&(l("jitter","all"===m?.3:0),l("pointpos","all"===m?-1.5:0),l("marker.symbol"),l("marker.opacity"),l("marker.size"),l("marker.color",e.line.color),l("marker.line.color"),l("marker.line.width"),"suspectedoutliers"===m&&(l("marker.line.outliercolor",e.marker.color),l("marker.line.outlierwidth")))}},{"../../components/color":558,"../../lib":658,"../../registry":766,"./attributes":788}],791:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../plots/cartesian/graph_interact"),a=t("../../lib"),o=t("../../components/color");e.exports=function(t,e,r,s){var l,u,c,h,f,d,p,m,g,v=t.cd,y=v[0].trace,x=v[0].t,b=t.xa,_=t.ya,w=[];if(h="closest"===s?2.5*x.bdPos:x.bdPos,"h"===y.orientation?(l=function(t){return i.inbox(t.min-e,t.max-e)},u=function(t){var e=t.pos+x.bPos-r;return i.inbox(e-h,e+h)},f="y",d=_,m="x",g=b):(l=function(t){var r=t.pos+x.bPos-e;return i.inbox(r-h,r+h)},u=function(t){return i.inbox(t.min-r,t.max-r)},f="x",d=b,m="y",g=_),c=i.getDistanceFunction(s,l,u),i.getClosest(v,c,t),t.index!==!1){var M=v[t.index],A=y.line.color,k=(y.marker||{}).color;o.opacity(A)&&y.line.width?t.color=A:o.opacity(k)&&y.boxpoints?t.color=k:t.color=y.fillcolor,t[f+"0"]=d.c2p(M.pos+x.bPos-x.bdPos,!0),t[f+"1"]=d.c2p(M.pos+x.bPos+x.bdPos,!0),n.tickText(d,d.c2l(M.pos),"hover").text,t[f+"LabelVal"]=M.pos;var T,E,S={},L=["med","min","q1","q3","max"];y.boxmean&&L.push("mean"),y.boxpoints&&[].push.apply(L,["lf","uf"]);for(var C=0;C<L.length;C++)T=L[C],T in M&&!(M[T]in S)&&(S[M[T]]=!0,p=g.c2p(M[T],!0),E=a.extendFlat({},t),E[m+"0"]=E[m+"1"]=p,E[m+"LabelVal"]=M[T],E.attr=T,"mean"===T&&"sd"in M&&"sd"===y.boxmean&&(E[m+"err"]=M.sd),t.name="",w.push(E));return w}}},{"../../components/color":558,"../../lib":658,"../../plots/cartesian/axes":691,"../../plots/cartesian/graph_interact":698}],792:[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.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.moduleType="trace",n.name="box",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","symbols","oriented","box","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":699,"./attributes":788,"./calc":789,"./defaults":790,"./hover":791,"./layout_attributes":793,"./layout_defaults":794,"./plot":795,"./set_positions":796,"./style":797}],793:[function(t,e,r){"use strict";e.exports={boxmode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay"},boxgap:{valType:"number",min:0,max:1,dflt:.3},boxgroupgap:{valType:"number",min:0,max:1,dflt:.3}}},{}],794:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){function o(r,n){return i.coerce(t,e,a,r,n)}for(var s,l=0;l<r.length;l++)if(n.traceIs(r[l],"box")){s=!0;break}s&&(o("boxmode"),o("boxgap"),o("boxgroupgap"))}},{"../../lib":658,"../../registry":766,"./layout_attributes":793}],795:[function(t,e,r){"use strict";function n(){l=2e9}function i(){var t=l;return l=(69069*l+1)%4294967296,Math.abs(l-t)<429496729?i():l/4294967296}var a=t("d3"),o=t("../../lib"),s=t("../../components/drawing"),l=2e9,u=5,c=.01;e.exports=function(t,e,r){var l,h,f=t._fullLayout,d=e.xaxis,p=e.yaxis,m=e.plot.select(".boxlayer").selectAll("g.trace.boxes").data(r).enter().append("g").attr("class","trace boxes");m.each(function(e){var r=e[0].t,m=e[0].trace,g="group"===f.boxmode&&t.numboxes>1,v=r.dPos*(1-f.boxgap)*(1-f.boxgroupgap)/(g?t.numboxes:1),y=g?2*r.dPos*(-.5+(r.boxnum+.5)/t.numboxes)*(1-f.boxgap):0,x=v*m.whiskerwidth;return m.visible!==!0||r.emptybox?void a.select(this).remove():("h"===m.orientation?(l=p,h=d):(l=d,h=p),r.bPos=y,r.bdPos=v,n(),a.select(this).selectAll("path.box").data(o.identity).enter().append("path").attr("class","box").each(function(t){var e=l.c2p(t.pos+y,!0),r=l.c2p(t.pos+y-v,!0),n=l.c2p(t.pos+y+v,!0),i=l.c2p(t.pos+y-x,!0),s=l.c2p(t.pos+y+x,!0),u=h.c2p(t.q1,!0),c=h.c2p(t.q3,!0),f=o.constrain(h.c2p(t.med,!0),Math.min(u,c)+1,Math.max(u,c)-1),d=h.c2p(m.boxpoints===!1?t.min:t.lf,!0),p=h.c2p(m.boxpoints===!1?t.max:t.uf,!0);"h"===m.orientation?a.select(this).attr("d","M"+f+","+r+"V"+n+"M"+u+","+r+"V"+n+"H"+c+"V"+r+"ZM"+u+","+e+"H"+d+"M"+c+","+e+"H"+p+(0===m.whiskerwidth?"":"M"+d+","+i+"V"+s+"M"+p+","+i+"V"+s)):a.select(this).attr("d","M"+r+","+f+"H"+n+"M"+r+","+u+"H"+n+"V"+c+"H"+r+"ZM"+e+","+u+"V"+d+"M"+e+","+c+"V"+p+(0===m.whiskerwidth?"":"M"+i+","+d+"H"+s+"M"+i+","+p+"H"+s))}),m.boxpoints&&a.select(this).selectAll("g.points").data(function(t){return t.forEach(function(t){t.t=r,t.trace=m}),t}).enter().append("g").attr("class","points").selectAll("path").data(function(t){var e,r,n,a,s,l,h,f="all"===m.boxpoints?t.val:t.val.filter(function(e){return e<t.lf||e>t.uf}),d=Math.max((t.max-t.min)/10,t.q3-t.q1),p=1e-9*d,g=d*c,x=[],b=0;if(m.jitter){if(0===d)for(b=1,x=new Array(f.length),e=0;e<f.length;e++)x[e]=1;else for(e=0;e<f.length;e++)r=Math.max(0,e-u),a=f[r],n=Math.min(f.length-1,e+u),s=f[n],"all"!==m.boxpoints&&(f[e]<t.lf?s=Math.min(s,t.lf):a=Math.max(a,t.uf)),l=Math.sqrt(g*(n-r)/(s-a+p))||0,l=o.constrain(Math.abs(l),0,1),x.push(l),b=Math.max(l,b);h=2*m.jitter/b}return f.map(function(e,r){var n,a=m.pointpos;return m.jitter&&(a+=h*x[r]*(i()-.5)),n="h"===m.orientation?{y:t.pos+a*v+y,x:e}:{x:t.pos+a*v+y,y:e},"suspectedoutliers"===m.boxpoints&&e<t.uo&&e>t.lo&&(n.so=!0),n})}).enter().append("path").call(s.translatePoints,d,p),void(m.boxmean&&a.select(this).selectAll("path.mean").data(o.identity).enter().append("path").attr("class","mean").style("fill","none").each(function(t){var e=l.c2p(t.pos+y,!0),r=l.c2p(t.pos+y-v,!0),n=l.c2p(t.pos+y+v,!0),i=h.c2p(t.mean,!0),o=h.c2p(t.mean-t.sd,!0),s=h.c2p(t.mean+t.sd,!0);"h"===m.orientation?a.select(this).attr("d","M"+i+","+r+"V"+n+("sd"!==m.boxmean?"":"m0,0L"+o+","+e+"L"+i+","+r+"L"+s+","+e+"Z")):a.select(this).attr("d","M"+r+","+i+"H"+n+("sd"!==m.boxmean?"":"m0,0L"+e+","+o+"L"+r+","+i+"L"+e+","+s+"Z"))})))})}},{"../../components/drawing":581,"../../lib":658,d3:97}],796:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/cartesian/axes"),a=t("../../lib");e.exports=function(t,e){var r,o,s,l,u=t._fullLayout,c=e.xaxis,h=e.yaxis,f=["v","h"];for(o=0;o<f.length;++o){var d,p,m,g=f[o],v=[],y=[],x=0,b=0;for(r="h"===g?h:c,s=0;s<t.calcdata.length;++s)d=t.calcdata[s],p=d[0].t,m=d[0].trace,m.visible===!0&&n.traceIs(m,"box")&&!p.emptybox&&m.orientation===g&&m.xaxis===c._id&&m.yaxis===h._id&&(v.push(s),m.boxpoints!==!1&&(x=Math.max(x,m.jitter-m.pointpos-1),b=Math.max(b,m.jitter+m.pointpos-1)));for(s=0;s<v.length;s++)for(d=t.calcdata[v[s]],l=0;l<d.length;l++)y.push(d[l].pos);if(y.length){var _=a.distinctVals(y),w=_.minDiff/2;for(y.length===_.vals.length&&(t.numboxes=1),i.minDtick(r,_.minDiff,_.vals[0],!0),o=0;o<v.length;o++){var M=v[o];t.calcdata[M][0].t.dPos=w}var A=(1-u.boxgap)*(1-u.boxgroupgap)*w/t.numboxes;i.expand(r,_.vals,{vpadminus:w+x*A,vpadplus:w+b*A})}}}},{"../../lib":658,"../../plots/cartesian/axes":691,"../../registry":766}],797:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/color"),a=t("../../components/drawing");e.exports=function(t){var e=n.select(t).selectAll("g.trace.boxes");e.style("opacity",function(t){return t[0].trace.opacity}).each(function(t){var e=t[0].trace,r=e.line.width;n.select(this).selectAll("path.box").style("stroke-width",r+"px").call(i.stroke,e.line.color).call(i.fill,e.fillcolor),n.select(this).selectAll("path.mean").style({"stroke-width":r,"stroke-dasharray":2*r+"px,"+r+"px"}).call(i.stroke,e.line.color),n.select(this).selectAll("g.points path").call(a.pointStyle,e)})}},{"../../components/color":558,"../../components/drawing":581,d3:97}],798:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../ohlc/attributes"),a=t("../box/attributes"),o={name:i.increasing.name,showlegend:i.increasing.showlegend,line:{color:n.extendFlat({},a.line.color),width:n.extendFlat({},a.line.width)},fillcolor:n.extendFlat({},a.fillcolor)};e.exports={x:i.x,open:i.open,high:i.high,low:i.low,close:i.close,line:{width:n.extendFlat({},a.line.width,{})},increasing:n.extendDeep({},o,{line:{color:{dflt:i.increasing.line.color.dflt}}}),decreasing:n.extendDeep({},o,{line:{color:{dflt:i.decreasing.line.color.dflt}}}),text:i.text,whiskerwidth:n.extendFlat({},a.whiskerwidth,{dflt:0})}},{"../../lib":658,"../box/attributes":788,"../ohlc/attributes":861}],799:[function(t,e,r){"use strict";function n(t,e,r,n){o(t,e,r,n),r(n+".line.color"),r(n+".line.width",e.line.width),r(n+".fillcolor")}var i=t("../../lib"),a=t("../ohlc/ohlc_defaults"),o=t("../ohlc/direction_defaults"),s=t("../ohlc/helpers"),l=t("./attributes");e.exports=function(t,e,r,o){function u(r,n){return i.coerce(t,e,l,r,n)}s.pushDummyTransformOpts(t,e);var c=a(t,e,u,o);return 0===c?void(e.visible=!1):(u("line.width"),n(t,e,u,"increasing"),n(t,e,u,"decreasing"),u("text"),void u("whiskerwidth"))}},{"../../lib":658,"../ohlc/direction_defaults":863,"../ohlc/helpers":864,"../ohlc/ohlc_defaults":866,"./attributes":798}],800:[function(t,e,r){"use strict";var n=t("../../plot_api/register");e.exports={moduleType:"trace",name:"candlestick",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","showLegend"],meta:{},attributes:t("./attributes"),supplyDefaults:t("./defaults")},n(t("../box")),n(t("./transform"))},{"../../plot_api/register":681,"../../plots/cartesian":699,"../box":792,"./attributes":798,"./defaults":799,"./transform":801}],801:[function(t,e,r){"use strict";function n(t,e,r){var n={type:"box",boxpoints:!1,visible:t.visible,hoverinfo:t.hoverinfo,opacity:t.opacity,xaxis:t.xaxis,yaxis:t.yaxis,transforms:a.makeTransform(t,e,r)},o=t[r];return o&&i.extendFlat(n,{x:t.x||[0],xcalendar:t.xcalendar,y:[].concat(t.low).concat(t.high),whiskerwidth:t.whiskerwidth,text:t.text,name:o.name,showlegend:o.showlegend,line:o.line,fillcolor:o.fillcolor}),n}var i=t("../../lib"),a=t("../ohlc/helpers");r.moduleType="transform",r.name="candlestick",r.attributes={},r.supplyDefaults=function(t,e,r,n){return a.clearEphemeralTransformOpts(n),a.copyOHLC(t,e),t},r.transform=function(t,e){for(var r=[],i=0;i<t.length;i++){var o=t[i];"candlestick"===o.type?r.push(n(o,e,"increasing"),n(o,e,"decreasing")):r.push(o)}return a.addRangeSlider(e.layout),r},r.calcTransform=function(t,e,r){for(var n=r.direction,i=a.getFilterFn(n),o=e.open,s=e.high,l=e.low,u=e.close,c=o.length,h=[],f=[],d=e._fullInput.x?function(t){var r=e.x[t];h.push(r,r,r,r,r,r)}:function(t){h.push(t,t,t,t,t,t)},p=function(t,e,r,n){f.push(r,t,n,n,n,e)},m=0;m<c;m++)i(o[m],u[m])&&(d(m),p(o[m],s[m],l[m],u[m]));e.x=h,e.y=f}},{"../../lib":658,"../ohlc/helpers":864}],802:[function(t,e,r){"use strict";var n=t("../scattergeo/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l=n.marker.line;e.exports=s({},{locations:{valType:"data_array"},locationmode:n.locationmode,z:{valType:"data_array"},text:{valType:"data_array"},marker:{line:{color:l.color,width:l.width}},hoverinfo:s({},o.hoverinfo,{flags:["location","z","text","name"]})},i,{colorbar:a})},{"../../components/colorbar/attributes":559,"../../components/colorscale/attributes":563,"../../lib/extend":651,"../../plots/attributes":689,"../scattergeo/attributes":913}],803:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){n(e,e.z,"","z")}},{"../../components/colorscale/calc":564}],804:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/colorscale/defaults"),a=t("./attributes");e.exports=function(t,e,r,o){function s(r,i){return n.coerce(t,e,a,r,i)}var l,u=s("locations");if(u&&(l=u.length),!u||!l)return void(e.visible=!1);var c=s("z");return Array.isArray(c)?(c.length>l&&(e.z=c.slice(0,l)),s("locationmode"),s("text"),s("marker.line.color"),s("marker.line.width"),i(t,e,o,s,{prefix:"",cLetter:"z"}),void s("hoverinfo",1===o._dataLength?"location+z+text":void 0)):void(e.visible=!1)}},{"../../components/colorscale/defaults":567,"../../lib":658,"./attributes":802}],805:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../heatmap/colorbar"),n.calc=t("./calc"),n.plot=t("./plot").plot,n.hoverPoints=function(){},n.moduleType="trace",n.name="choropleth",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","noOpacity"],n.meta={},e.exports=n},{"../../plots/geo":715,"../heatmap/colorbar":824,"./attributes":802,"./calc":803,"./defaults":804,"./plot":806}],806:[function(t,e,r){"use strict";function n(t,e){function r(e){var r=t.mockAxis;return o.tickText(r,r.c2l(e),"hover").text}var n=e.hoverinfo;if("none"===n||"skip"===n)return function(t){delete t.nameLabel,delete t.textLabel};var i="all"===n?m.hoverinfo.flags:n.split("+"),a=i.indexOf("name")!==-1,s=i.indexOf("location")!==-1,l=i.indexOf("z")!==-1,u=i.indexOf("text")!==-1,c=!a&&s;return function(t){var n=[];c?t.nameLabel=t.id:(a&&(t.nameLabel=e.name),s&&n.push(t.id)),l&&n.push(r(t.z)),u&&n.push(t.tx),t.textLabel=n.join("<br>")}}function i(t){return function(e,r){return{points:[{data:t._input,fullData:t,curveNumber:t.index,pointNumber:r,location:e.id,z:e.z}]}}}var a=t("d3"),o=t("../../plots/cartesian/axes"),s=t("../../plots/cartesian/graph_interact"),l=t("../../components/color"),u=t("../../components/drawing"),c=t("../../components/colorscale"),h=t("../../lib/topojson_utils").getTopojsonFeatures,f=t("../../lib/geo_location_utils").locationToFeature,d=t("../../lib/array_to_calc_item"),p=t("../../plots/geo/constants"),m=t("./attributes"),g=e.exports={};g.calcGeoJSON=function(t,e){for(var r,n=[],i=t.locations,a=i.length,o=h(t,e),s=(t.marker||{}).line||{},l=0;l<a;l++)r=f(t.locationmode,i[l],o),r&&(r.z=t.z[l],void 0!==t.text&&(r.tx=t.text[l]),d(s.color,r,"mlc",l),d(s.width,r,"mlw",l),n.push(r));return n.length>0&&(n[0].trace=t),n},g.plot=function(t,e,r){function o(t){return t[0].trace.uid}var l,u=t.framework,c=u.select("g.choroplethlayer"),h=u.select("g.baselayer"),f=u.select("g.baselayeroverchoropleth"),d=p.baseLayersOverChoropleth,m=c.selectAll("g.trace.choropleth").data(e,o);m.enter().append("g").attr("class","trace choropleth"),m.exit().remove(),m.each(function(e){function r(e,r){if(t.showHover){var n=t.projection(e.properties.ct);c(e),s.loneHover({x:n[0],y:n[1],name:e.nameLabel,text:e.textLabel},{container:t.hoverContainer.node()}),f=h(e,r),t.graphDiv.emit("plotly_hover",f)}}function o(e,r){t.graphDiv.emit("plotly_click",h(e,r))}var l=e[0].trace,u=g.calcGeoJSON(l,t.topojson),c=n(t,l),h=i(l),f=null,d=a.select(this).selectAll("path.choroplethlocation").data(u);d.enter().append("path").classed("choroplethlocation",!0).on("mouseover",r).on("click",o).on("mouseout",function(){s.loneUnhover(t.hoverContainer),t.graphDiv.emit("plotly_unhover",f)}).on("mousedown",function(){s.loneUnhover(t.hoverContainer)}).on("mouseup",r),d.exit().remove()}),f.selectAll("*").remove();for(var v=0;v<d.length;v++)l=d[v],h.select("g."+l).remove(),t.drawTopo(f,l,r),t.styleLayer(f,l,r);g.style(t)},g.style=function(t){t.framework.selectAll("g.trace.choropleth").each(function(t){var e=t[0].trace,r=a.select(this),n=e.marker||{},i=n.line||{},o=c.makeColorScaleFunc(c.extractScale(e.colorscale,e.zmin,e.zmax));r.selectAll("path.choroplethlocation").each(function(t){a.select(this).attr("fill",function(t){return o(t.z)}).call(l.stroke,t.mlc||i.color).call(u.dashLine,"",t.mlw||i.width)})})}},{"../../components/color":558,"../../components/colorscale":572,"../../components/drawing":581,"../../lib/array_to_calc_item":646,"../../lib/geo_location_utils":654,"../../lib/topojson_utils":675,"../../plots/cartesian/axes":691,"../../plots/cartesian/graph_interact":698,"../../plots/geo/constants":713,"./attributes":802,d3:97}],807:[function(t,e,r){"use strict";var n=t("../heatmap/attributes"),i=t("../scatter/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat,l=i.line;e.exports=s({},{z:n.z,x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:n.text,transpose:n.transpose,xtype:n.xtype,ytype:n.ytype,connectgaps:n.connectgaps,autocontour:{valType:"boolean",dflt:!0},ncontours:{valType:"integer",dflt:15,min:1},contours:{start:{valType:"number",dflt:null},end:{valType:"number",dflt:null},size:{valType:"number",dflt:null,min:0},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill"},showlines:{valType:"boolean",dflt:!0}},line:{color:s({},l.color,{}),width:l.width,dash:l.dash,smoothing:s({},l.smoothing,{})}},a,{autocolorscale:s({},a.autocolorscale,{dflt:!1})},{colorbar:o})},{"../../components/colorbar/attributes":559,"../../components/colorscale/attributes":563,"../../lib/extend":651,"../heatmap/attributes":821,"../scatter/attributes":884}],808:[function(t,e,r){"use strict";function n(t,e,r){var n={type:"linear",range:[t,e]};return i.autoTicks(n,(e-t)/(r||15)),n}var i=t("../../plots/cartesian/axes"),a=t("../../lib").extendFlat,o=t("../heatmap/calc");e.exports=function(t,e){var r=o(t,e),s=e.contours;if(e.autocontour!==!1){var l=n(e.zmin,e.zmax,e.ncontours);s.size=l.dtick,s.start=i.tickFirst(l),l.range.reverse(),s.end=i.tickFirst(l),s.start===e.zmin&&(s.start+=s.size),s.end===e.zmax&&(s.end-=s.size),s.start>s.end&&(s.start=s.end=(s.start+s.end)/2),e._input.contours=a({},s)}else{var u=s.start,c=s.end,h=e._input.contours;if(u>c&&(s.start=h.start=c,c=s.end=h.end=u,u=s.start),!(s.size>0)){var f;f=u===c?1:n(u,c,e.ncontours).dtick,h.size=s.size=f}}return r}},{"../../lib":658,"../../plots/cartesian/axes":691,"../heatmap/calc":822}],809:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("../../components/colorbar/draw"),a=t("./make_color_map"),o=t("./end_plus");e.exports=function(t,e){var r=e[0].trace,s="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+s).remove(),r.showscale===!1)return void n.autoMargin(t,s);var l=i(t,s);e[0].t.cb=l;var u=r.contours,c=r.line,h=u.size||1,f=u.coloring,d=a(r,{isColorbar:!0});"heatmap"===f&&l.filllevels({start:r.zmin,end:r.zmax,size:(r.zmax-r.zmin)/254}),l.fillcolor("fill"===f||"heatmap"===f?d:"").line({color:"lines"===f?d:c.color,width:u.showlines!==!1?c.width:0,dash:c.dash}).levels({start:u.start,end:o(u),size:h}).options(r.colorbar)()}},{"../../components/colorbar/draw":561,"../../plots/plots":751,"./end_plus":812,"./make_color_map":816}],810:[function(t,e,r){"use strict";e.exports.BOTTOMSTART=[1,9,13,104,713],e.exports.TOPSTART=[4,6,7,104,713],e.exports.LEFTSTART=[8,12,14,208,1114],e.exports.RIGHTSTART=[2,3,11,208,1114],e.exports.NEWDELTA=[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],e.exports.CHOOSESADDLE={104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},e.exports.SADDLEREMAINDER={1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11}},{}],811:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/has_columns"),a=t("../heatmap/xyz_defaults"),o=t("../contour/style_defaults"),s=t("./attributes");e.exports=function(t,e,r,l){function u(r,i){return n.coerce(t,e,s,r,i)}var c=a(t,e,u,l);if(!c)return void(e.visible=!1);u("text"),u("connectgaps",i(e));var h,f=n.coerce2(t,e,s,"contours.start"),d=n.coerce2(t,e,s,"contours.end"),p=f===!1||d===!1,m=u("contours.size");h=p?e.autocontour=!0:u("autocontour",!1),!h&&m||u("ncontours"),o(t,e,u,l)}},{"../../lib":658,"../contour/style_defaults":820,"../heatmap/has_columns":828,"../heatmap/xyz_defaults":836,"./attributes":807}],812:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],813:[function(t,e,r){"use strict";function n(t,e){return Math.abs(t[0]-e[0])<.01&&Math.abs(t[1]-e[1])<.01}function i(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function a(t,e,r){function a(t){return m[t%m.length]}var c,h=e.join(","),f=h,d=t.crossings[f],p=o(d,r,e),m=[s(t,e,[-p[0],-p[1]])],g=p.join(","),v=t.z.length,y=t.z[0].length;for(c=0;c<1e4;c++){if(d>20?(d=u.CHOOSESADDLE[d][(p[0]||p[1])<0?0:1],t.crossings[f]=u.SADDLEREMAINDER[d]):delete t.crossings[f],p=u.NEWDELTA[d],!p){l.log("Found bad marching index:",d,e,t.level);break}m.push(s(t,e,p)),e[0]+=p[0],e[1]+=p[1],n(m[m.length-1],m[m.length-2])&&m.pop(),f=e.join(",");var x=p[0]&&(e[0]<0||e[0]>y-2)||p[1]&&(e[1]<0||e[1]>v-2),b=f===h&&p.join(",")===g;if(b||r&&x)break;d=t.crossings[f]}1e4===c&&l.log("Infinite loop in contour?");var _,w,M,A,k,T,E,S=n(m[0],m[m.length-1]),L=0,C=.2*t.smoothing,I=[],z=0;for(c=1;c<m.length;c++)E=i(m[c],m[c-1]),L+=E,I.push(E);var D=L/I.length*C;for(c=m.length-2;c>=z;c--)if(_=I[c],_<D){for(M=0,w=c-1;w>=z&&_+I[w]<D;w--)_+=I[w];if(S&&c===m.length-2)for(M=0;M<w&&_+I[M]<D;M++)_+=I[M];k=c-w+M+1,T=Math.floor((c+w+M+2)/2),A=S||c!==m.length-2?S||w!==-1?k%2?a(T):[(a(T)[0]+a(T+1)[0])/2,(a(T)[1]+a(T+1)[1])/2]:m[0]:m[m.length-1],m.splice(w+1,c-w+1,A),c=w+1,M&&(z=M),S&&(c===m.length-2?m[M]=m[m.length-1]:0===c&&(m[m.length-1]=m[0]))}if(m.splice(0,z),!(m.length<2))if(S)m.pop(),t.paths.push(m);else{r||l.log("Unclosed interior contour?",t.level,h,m.join("L"));var P=!1;t.edgepaths.forEach(function(e,r){if(!P&&n(e[0],m[m.length-1])){m.pop(),P=!0;var i=!1;t.edgepaths.forEach(function(e,a){!i&&n(e[e.length-1],m[0])&&(i=!0,m.splice(0,1),t.edgepaths.splice(r,1),a===r?t.paths.push(m.concat(e)):t.edgepaths[a]=t.edgepaths[a].concat(m,e))}),i||(t.edgepaths[r]=m.concat(e))}}),t.edgepaths.forEach(function(e,r){!P&&n(e[e.length-1],m[0])&&(m.splice(0,1),t.edgepaths[r]=e.concat(m),P=!0)}),P||t.edgepaths.push(m)}}function o(t,e,r){var n=0,i=0;return t>20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:u.BOTTOMSTART.indexOf(t)!==-1?i=1:u.LEFTSTART.indexOf(t)!==-1?n=1:u.TOPSTART.indexOf(t)!==-1?i=-1:n=-1,[n,i]}function s(t,e,r){var n=e[0]+Math.max(r[0],0),i=e[1]+Math.max(r[1],0),a=t.z[i][n],o=t.xaxis,s=t.yaxis;if(r[1]){var l=(t.level-a)/(t.z[i][n+1]-a);return[o.c2p((1-l)*t.x[n]+l*t.x[n+1],!0),s.c2p(t.y[i],!0)]}var u=(t.level-a)/(t.z[i+1][n]-a);return[o.c2p(t.x[n],!0),s.c2p((1-u)*t.y[i]+u*t.y[i+1],!0)]}var l=t("../../lib"),u=t("./constants");e.exports=function(t){var e,r,n,i,o;for(n=0;n<t.length;n++){for(i=t[n],o=0;o<i.starts.length;o++)r=i.starts[o],a(i,r,"edge");for(e=0;Object.keys(i.crossings).length&&e<1e4;)e++,r=Object.keys(i.crossings)[0].split(",").map(Number),a(i,r);1e4===e&&l.log("Infinite loop in contour?")}}},{"../../lib":658,"./constants":810}],814:[function(t,e,r){"use strict";var n=t("../heatmap/hover");e.exports=function(t,e,r,i){return n(t,e,r,i,!0)}},{"../heatmap/hover":829}],815:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.colorbar=t("./colorbar"),n.hoverPoints=t("./hover"),n.moduleType="trace",n.name="contour",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","2dMap","contour"],n.meta={},e.exports=n},{"../../plots/cartesian":699,"./attributes":807,"./calc":808,"./colorbar":809,"./defaults":811,"./hover":814,"./plot":818,"./style":819}],816:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/colorscale"),a=t("./end_plus");e.exports=function(t){var e,r,o=t.contours,s=o.start,l=a(o),u=o.size||1,c=Math.floor((l-s)/u)+1,h="lines"===o.coloring?0:1,f=t.colorscale,d=f.length,p=new Array(d),m=new Array(d);if("heatmap"===o.coloring){for(t.zauto&&t.autocontour===!1&&(t.zmin=s-u/2,t.zmax=t.zmin+c*u),r=0;r<d;r++)e=f[r],p[r]=e[0]*(t.zmax-t.zmin)+t.zmin,m[r]=e[1];var g=n.extent([t.zmin,t.zmax,o.start,o.start+u*(c-1)]),v=g[t.zmin<t.zmax?0:1],y=g[t.zmin<t.zmax?1:0];v!==t.zmin&&(p.splice(0,0,v),m.splice(0,0,Range[0])),y!==t.zmax&&(p.push(y),m.push(m[m.length-1]))}else for(r=0;r<d;r++)e=f[r],p[r]=(e[0]*(c+h-1)-h/2)*u+s,m[r]=e[1];return i.makeColorScaleFunc({domain:p,range:m},{noNumericCheck:!0})}},{"../../components/colorscale":572,"./end_plus":812,d3:97}],817:[function(t,e,r){"use strict";function n(t,e){var r=(e[0][0]>t?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);if(5===r||10===r){var n=(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4;return t>n?5===r?713:1114:5===r?104:208}return 15===r?0:r}var i=t("./constants");e.exports=function(t){var e,r,a,o,s,l,u,c,h,f=t[0].z,d=f.length,p=f[0].length,m=2===d||2===p;for(r=0;r<d-1;r++)for(o=[],0===r&&(o=o.concat(i.BOTTOMSTART)),r===d-2&&(o=o.concat(i.TOPSTART)),e=0;e<p-1;e++)for(a=o.slice(),0===e&&(a=a.concat(i.LEFTSTART)),e===p-2&&(a=a.concat(i.RIGHTSTART)),s=e+","+r,l=[[f[r][e],f[r][e+1]],[f[r+1][e],f[r+1][e+1]]],h=0;h<t.length;h++)c=t[h],u=n(c.level,l),u&&(c.crossings[s]=u,a.indexOf(u)!==-1&&(c.starts.push([e,r]),m&&a.indexOf(u,a.indexOf(u)+1)!==-1&&c.starts.push([e,r])))}},{"./constants":810}],818:[function(t,e,r){"use strict";function n(t,e,r){var n=r[0].trace,l=r[0].x,h=r[0].y,f=n.contours,d=n.uid,p=e.xaxis,y=e.yaxis,x=t._fullLayout,b="contour"+d,_=i(f,e,r[0]);if(n.visible!==!0)return x._paper.selectAll("."+b+",.hm"+d).remove(),void x._infolayer.selectAll(".cb"+d).remove();"heatmap"===f.coloring?(n.zauto&&n.autocontour===!1&&(n._input.zmin=n.zmin=f.start-f.size/2,n._input.zmax=n.zmax=n.zmin+_.length*f.size),m(t,e,[r])):x._paper.selectAll(".hm"+d).remove(),g(_),v(_);var w=p.c2p(l[0],!0),M=p.c2p(l[l.length-1],!0),A=y.c2p(h[0],!0),k=y.c2p(h[h.length-1],!0),T=[[w,k],[M,k],[M,A],[w,A]],E=a(e,r,b);o(E,T,f),s(E,_,T,f),u(E,_,f),c(E,e,r[0],T)}function i(t,e,r){for(var n=t.size,i=[],a=y(t),o=t.start;o<a;o+=n)if(i.push({level:o,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:e.xaxis,yaxis:e.yaxis,x:r.x,y:r.y,z:r.z,smoothing:r.trace.line.smoothing}),i.length>1e3){d.warn("Too many contours, clipping at 1000",t);break}return i}function a(t,e,r){var n=t.plot.select(".maplayer").selectAll("g.contour."+r).data(e);return n.enter().append("g").classed("contour",!0).classed(r,!0),n.exit().remove(),n}function o(t,e,r){var n=t.selectAll("g.contourbg").data([0]);n.enter().append("g").classed("contourbg",!0);var i=n.selectAll("path").data("fill"===r.coloring?[0]:[]);i.enter().append("path"),i.exit().remove(),i.attr("d","M"+e.join("L")+"Z").style("stroke","none")}function s(t,e,r,n){var i=t.selectAll("g.contourfill").data([0]);i.enter().append("g").classed("contourfill",!0);var a=i.selectAll("path").data("fill"===n.coloring?e:[]);a.enter().append("path"),a.exit().remove(),a.each(function(t){var e=l(t,r);e?f.select(this).attr("d",e).style("stroke","none"):f.select(this).remove()})}function l(t,e){function r(t){return Math.abs(t[1]-e[0][1])<.01}function n(t){return Math.abs(t[1]-e[2][1])<.01}function i(t){return Math.abs(t[0]-e[0][0])<.01}function a(t){return Math.abs(t[0]-e[2][0])<.01}for(var o,s,l,u,c,h,f=Math.min(t.z[0][0],t.z[0][1]),m=t.edgepaths.length||f<=t.level?"":"M"+e.join("L")+"Z",g=0,v=t.edgepaths.map(function(t,e){return e}),y=!0;v.length;){for(h=p.smoothopen(t.edgepaths[g],t.smoothing),m+=y?h:h.replace(/^M/,"L"),v.splice(v.indexOf(g),1),o=t.edgepaths[g][t.edgepaths[g].length-1],u=-1,l=0;l<4;l++){if(!o){d.log("Missing end?",g,t);break}for(r(o)&&!a(o)?s=e[1]:i(o)?s=e[0]:n(o)?s=e[3]:a(o)&&(s=e[2]),c=0;c<t.edgepaths.length;c++){var x=t.edgepaths[c][0];Math.abs(o[0]-s[0])<.01?Math.abs(o[0]-x[0])<.01&&(x[1]-o[1])*(s[1]-x[1])>=0&&(s=x,u=c):Math.abs(o[1]-s[1])<.01?Math.abs(o[1]-x[1])<.01&&(x[0]-o[0])*(s[0]-x[0])>=0&&(s=x,u=c):d.log("endpt to newendpt is not vert. or horz.",o,s,x)}if(o=s,u>=0)break;m+="L"+s}if(u===t.edgepaths.length){d.log("unclosed perimeter path");break}g=u,y=v.indexOf(g)===-1,y&&(g=v[0],m+="Z")}for(g=0;g<t.paths.length;g++)m+=p.smoothclosed(t.paths[g],t.smoothing);return m}function u(t,e,r){var n=e[0].smoothing,i=t.selectAll("g.contourlevel").data(r.showlines===!1?[]:e);i.enter().append("g").classed("contourlevel",!0),i.exit().remove();var a=i.selectAll("path.openline").data(function(t){return t.edgepaths});a.enter().append("path").classed("openline",!0),a.exit().remove(),a.attr("d",function(t){return p.smoothopen(t,n)}).style("stroke-miterlimit",1);var o=i.selectAll("path.closedline").data(function(t){return t.paths});o.enter().append("path").classed("closedline",!0),o.exit().remove(),o.attr("d",function(t){return p.smoothclosed(t,n)}).style("stroke-miterlimit",1)}function c(t,e,r,n){var i="clip"+r.trace.uid,a=e.plot.selectAll("defs").data([0]);a.enter().append("defs");var o=a.selectAll("#"+i).data(r.trace.connectgaps?[]:[0]);if(o.enter().append("clipPath").attr("id",i),o.exit().remove(),r.trace.connectgaps===!1){var s={level:.9,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:e.xaxis,yaxis:e.yaxis,x:r.x,y:r.y,z:h(r),smoothing:0};g([s]),v([s]);var u=l(s,n),c=o.selectAll("path").data([0]);c.enter().append("path"),c.attr("d",u)}else i=null;t.call(p.setClipUrl,i),e.plot.selectAll(".hm"+r.trace.uid).call(p.setClipUrl,i)}function h(t){var e,r,n=t.trace._emptypoints,i=[],a=t.z.length,o=t.z[0].length,s=[];for(e=0;e<o;e++)s.push(1);for(e=0;e<a;e++)i.push(s.slice());for(e=0;e<n.length;e++)r=n[e],i[r[0]][r[1]]=0;return t.zmask=i,i}var f=t("d3"),d=t("../../lib"),p=t("../../components/drawing"),m=t("../heatmap/plot"),g=t("./make_crossings"),v=t("./find_all_paths"),y=t("./end_plus");e.exports=function(t,e,r){for(var i=0;i<r.length;i++)n(t,e,r[i])}},{"../../components/drawing":581,"../../lib":658,"../heatmap/plot":834,"./end_plus":812,"./find_all_paths":813,"./make_crossings":817,d3:97}],819:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/drawing"),a=t("../heatmap/style"),o=t("./make_color_map");e.exports=function(t){var e=n.select(t).selectAll("g.contour");e.style("opacity",function(t){return t.trace.opacity}),e.each(function(t){var e=n.select(this),r=t.trace,a=r.contours,s=r.line,l=a.size||1,u=a.start,c=o(r);e.selectAll("g.contourlevel").each(function(t){n.select(this).selectAll("path").call(i.lineGroupStyle,s.width,"lines"===a.coloring?c(t.level):s.color,s.dash)});var h;e.selectAll("g.contourfill path").style("fill",function(t){return void 0===h&&(h=t.level),c(t.level+.5*l)}),void 0===h&&(h=u),e.selectAll("g.contourbg path").style("fill",c(h-.5*l))}),a(t)}},{"../../components/drawing":581,"../heatmap/style":835,"./make_color_map":816,d3:97}],820:[function(t,e,r){"use strict";var n=t("../../components/colorscale/defaults");e.exports=function(t,e,r,i){var a,o=r("contours.coloring");"fill"===o&&(a=r("contours.showlines")),a!==!1&&("lines"!==o&&r("line.color","#000"),r("line.width",.5),r("line.dash")),r("line.smoothing"),"none"!==(e.contours||{}).coloring&&n(t,e,i,r,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":567}],821:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../lib/extend").extendFlat;e.exports=o({},{z:{valType:"data_array"},x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:{valType:"data_array"},transpose:{valType:"boolean",dflt:!1},xtype:{valType:"enumerated",values:["array","scaled"]},ytype:{valType:"enumerated",values:["array","scaled"]},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1},connectgaps:{valType:"boolean",dflt:!1},xgap:{valType:"number",dflt:0,min:0},ygap:{valType:"number",dflt:0,min:0}},i,{autocolorscale:o({},i.autocolorscale,{dflt:!1})},{colorbar:a})},{"../../components/colorbar/attributes":559,"../../components/colorscale/attributes":563,"../../lib/extend":651,"../scatter/attributes":884}],822:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../histogram2d/calc"),s=t("../../components/colorscale/calc"),l=t("./has_columns"),u=t("./convert_column_xyz"),c=t("./max_row_length"),h=t("./clean_2d_array"),f=t("./interp2d"),d=t("./find_empties"),p=t("./make_bound_array");e.exports=function(t,e){function r(t){S=e._input.zsmooth=e.zsmooth=!1,i.notifier("cannot fast-zsmooth: "+t)}var m,g,v,y,x,b,_,w,M=a.getFromId(t,e.xaxis||"x"),A=a.getFromId(t,e.yaxis||"y"),k=n.traceIs(e,"contour"),T=n.traceIs(e,"histogram"),E=n.traceIs(e,"gl2d"),S=k?"best":e.zsmooth;if(M._minDtick=0,A._minDtick=0,T){var L=o(t,e);m=L.x,g=L.x0,v=L.dx,y=L.y,x=L.y0,b=L.dy,_=L.z}else l(e)&&u(e,M,A),m=e.x?M.makeCalcdata(e,"x"):[],y=e.y?A.makeCalcdata(e,"y"):[],g=e.x0||0,v=e.dx||1,x=e.y0||0,b=e.dy||1,_=h(e.z,e.transpose),(k||e.connectgaps)&&(e._emptypoints=d(_),e._interpz=f(_,e._emptypoints,e._interpz));if("fast"===S)if("log"===M.type||"log"===A.type)r("log axis found");else if(!T){if(m.length){var C=(m[m.length-1]-m[0])/(m.length-1),I=Math.abs(C/100);for(w=0;w<m.length-1;w++)if(Math.abs(m[w+1]-m[w]-C)>I){r("x scale is not linear");break}}if(y.length&&"fast"===S){var z=(y[y.length-1]-y[0])/(y.length-1),D=Math.abs(z/100);for(w=0;w<y.length-1;w++)if(Math.abs(y[w+1]-y[w]-z)>D){r("y scale is not linear");break}}}var P=c(_),O="scaled"===e.xtype?"":m,R=p(e,O,g,v,P,M),F="scaled"===e.ytype?"":y,j=p(e,F,x,b,_.length,A);E||(a.expand(M,R),a.expand(A,j));var N={x:R,y:j,z:_};if(s(e,_,"","z"),k&&e.contours&&"heatmap"===e.contours.coloring){var B={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};N.xfill=p(B,O,g,v,P,M),N.yfill=p(B,F,x,b,_.length,A)}return[N]}},{"../../components/colorscale/calc":564,"../../lib":658,"../../plots/cartesian/axes":691,"../../registry":766,"../histogram2d/calc":850,"./clean_2d_array":823,"./convert_column_xyz":825,"./find_empties":827,"./has_columns":828,"./interp2d":831,"./make_bound_array":832,"./max_row_length":833}],823:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){function r(t){if(n(t))return+t}var i,a,o,s,l,u;if(e){for(i=0,l=0;l<t.length;l++)i=Math.max(i,t[l].length);if(0===i)return!1;o=function(t){return t.length},s=function(t,e,r){return t[r][e]}}else i=t.length,o=function(t,e){return t[e].length},s=function(t,e,r){return t[e][r]};var c=new Array(i);for(l=0;l<i;l++)for(a=o(t,l),c[l]=new Array(a),u=0;u<a;u++)c[l][u]=r(s(t,l,u));return c}},{"fast-isnumeric":106}],824:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l="cb"+r.uid,u=r.zmin,c=r.zmax;if(n(u)||(u=i.aggNums(Math.min,null,r.z)),n(c)||(c=i.aggNums(Math.max,null,r.z)),t._fullLayout._infolayer.selectAll("."+l).remove(),!r.showscale)return void a.autoMargin(t,l);var h=e[0].t.cb=s(t,l),f=o.makeColorScaleFunc(o.extractScale(r.colorscale,u,c),{noNumericCheck:!0});h.fillcolor(f).filllevels({start:u,end:c,size:(c-u)/254}).options(r.colorbar)()}},{"../../components/colorbar/draw":561,"../../components/colorscale":572,"../../lib":658,"../../plots/plots":751,"fast-isnumeric":106}],825:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var i,a=t.x.slice(),o=t.y.slice(),s=t.z,l=t.text,u=Math.min(a.length,o.length,s.length),c=void 0!==l&&!Array.isArray(l[0]),h=t.xcalendar,f=t.ycalendar;for(u<a.length&&(a=a.slice(0,u)),u<o.length&&(o=o.slice(0,u)),i=0;i<u;i++)a[i]=e.d2c(a[i],0,h),o[i]=r.d2c(o[i],0,f);var d,p,m,g=n.distinctVals(a),v=g.vals,y=n.distinctVals(o),x=y.vals,b=n.init2dArray(x.length,v.length);for(c&&(m=n.init2dArray(x.length,v.length)),i=0;i<u;i++)d=n.findBin(a[i]+g.minDiff/2,v),p=n.findBin(o[i]+y.minDiff/2,x),b[p][d]=s[i],c&&(m[p][d]=l[i]);t.x=v,t.y=x,t.z=b,c&&(t.text=m)}},{"../../lib":658}],826:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./has_columns"),a=t("./xyz_defaults"),o=t("../../components/colorscale/defaults"),s=t("./attributes");e.exports=function(t,e,r,l){function u(r,i){return n.coerce(t,e,s,r,i)}var c=a(t,e,u,l);if(!c)return void(e.visible=!1);u("text");var h=u("zsmooth");h===!1&&(u("xgap"),u("ygap")),u("connectgaps",i(e)&&e.zsmooth!==!1),o(t,e,l,u,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":567,"../../lib":658,"./attributes":821,"./has_columns":828,"./xyz_defaults":836}],827:[function(t,e,r){"use strict";var n=t("./max_row_length");e.exports=function(t){var e,r,i,a,o,s,l,u,c=[],h={},f=[],d=t[0],p=[],m=[0,0,0],g=n(t);for(r=0;r<t.length;r++)for(e=p,p=d,d=t[r+1]||[],i=0;i<g;i++)void 0===p[i]&&(s=(void 0!==p[i-1]?1:0)+(void 0!==p[i+1]?1:0)+(void 0!==e[i]?1:0)+(void 0!==d[i]?1:0),s?(0===r&&s++,0===i&&s++,r===t.length-1&&s++,i===p.length-1&&s++,s<4&&(h[[r,i]]=[r,i,s]),c.push([r,i,s])):f.push([r,i]));for(;f.length;){for(l={},u=!1,o=f.length-1;o>=0;o--)a=f[o],r=a[0],i=a[1],s=((h[[r-1,i]]||m)[2]+(h[[r+1,i]]||m)[2]+(h[[r,i-1]]||m)[2]+(h[[r,i+1]]||m)[2])/20,s&&(l[a]=[r,i,s],f.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(a in l)h[a]=l[a],c.push(l[a])}return c.sort(function(t,e){return e[2]-t[2]})}},{"./max_row_length":833}],828:[function(t,e,r){"use strict";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],829:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/graph_interact"),i=t("../../lib"),a=t("../../plots/cartesian/constants").MAXDIST;e.exports=function(t,e,r,o,s){if(!(t.distance<a)){var l,u,c,h,f=t.cd[0],d=f.trace,p=t.xa,m=t.ya,g=f.x,v=f.y,y=f.z,x=f.zmask,b=g,_=v;if(t.index!==!1){try{c=Math.round(t.index[1]),h=Math.round(t.index[0])}catch(e){return void i.error("Error hovering on heatmap, pointNumber must be [row,col], found:",t.index)}if(c<0||c>=y[0].length||h<0||h>y.length)return}else{if(n.inbox(e-g[0],e-g[g.length-1])>a||n.inbox(r-v[0],r-v[v.length-1])>a)return;if(s){var w;for(b=[2*g[0]-g[1]],w=1;w<g.length;w++)b.push((g[w]+g[w-1])/2);for(b.push([2*g[g.length-1]-g[g.length-2]]),_=[2*v[0]-v[1]],w=1;w<v.length;w++)_.push((v[w]+v[w-1])/2);_.push([2*v[v.length-1]-v[v.length-2]])}c=Math.max(0,Math.min(b.length-2,i.findBin(e,b))),h=Math.max(0,Math.min(_.length-2,i.findBin(r,_)))}var M=p.c2p(g[c]),A=p.c2p(g[c+1]),k=m.c2p(v[h]),T=m.c2p(v[h+1]);s?(A=M,l=g[c],T=k,u=v[h]):(l=(g[c]+g[c+1])/2,u=(v[h]+v[h+1])/2,d.zsmooth&&(M=A=(M+A)/2,k=T=(k+T)/2));var E=y[h][c];x&&!x[h][c]&&(E=void 0);var S;return Array.isArray(d.text)&&Array.isArray(d.text[h])&&(S=d.text[h][c]),[i.extendFlat(t,{index:[h,c],distance:a+10,x0:M,x1:A,y0:k,y1:T,xLabelVal:l,yLabelVal:u,zLabelVal:E,text:S})]}}},{"../../lib":658,"../../plots/cartesian/constants":696,"../../plots/cartesian/graph_interact":698}],830:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.moduleType="trace",n.name="heatmap",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","2dMap"],n.meta={},e.exports=n},{"../../plots/cartesian":699,"./attributes":821,"./calc":822,"./colorbar":824,"./defaults":826,"./hover":829,"./plot":834,"./style":835}],831:[function(t,e,r){"use strict";function n(t){return.5-.25*Math.min(1,.5*t)}function i(t,e,r){var n,i,a,o,l,u,c,h,f,d,p,m,g,v=0;for(o=0;o<e.length;o++){for(n=e[o],i=n[0],a=n[1],p=t[i][a],d=0,f=0,l=0;l<4;l++)u=s[l],c=t[i+u[0]],c&&(h=c[a+u[1]],void 0!==h&&(0===d?m=g=h:(m=Math.min(m,h),g=Math.max(g,h)),f++,d+=h));if(0===f)throw"iterateInterp2d order is wrong: no defined neighbors";t[i][a]=d/f,void 0===p?f<4&&(v=1):(t[i][a]=(1+r)*t[i][a]-r*p,g>m&&(v=Math.max(v,Math.abs(t[i][a]-p)/(g-m))))}return v}var a=t("../../lib"),o=.01,s=[[-1,0],[1,0],[0,-1],[0,1]];e.exports=function(t,e,r){var s,l,u=1;if(Array.isArray(r))for(s=0;s<e.length;s++)l=e[s],t[l[0]][l[1]]=r[l[0]][l[1]];else i(t,e);for(s=0;s<e.length&&!(e[s][2]<4);s++);for(e=e.slice(s),s=0;s<100&&u>o;s++)u=i(t,e,n(u));return u>o&&a.log("interp2d didn't converge quickly",u),t}},{"../../lib":658}],832:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,i,a,o){var s,l,u,c=[],h=n.traceIs(t,"contour"),f=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d"),p=Array.isArray(e)&&e.length>1;if(p&&!f&&"category"!==o.type){var m=e.length;if(!(m<=a))return h?e.slice(0,a):e.slice(0,a+1);if(h||d)c=e.slice(0,a);else if(1===a)c=[e[0]-.5,e[0]+.5];else{for(c=[1.5*e[0]-.5*e[1]],u=1;u<m;u++)c.push(.5*(e[u-1]+e[u]));c.push(1.5*e[m-1]-.5*e[m-2])}if(m<a){var g=c[c.length-1],v=g-c[c.length-2];for(u=m;u<a;u++)g+=v,c.push(g)}}else{l=i||1;var y=t[o._id.charAt(0)+"calendar"];for(s=f||"category"===o.type?o.r2c(r,0,y)||0:Array.isArray(e)&&1===e.length?e[0]:void 0===r?0:o.d2c(r,0,y),u=h||d?0:-.5;u<a;u++)c.push(s+l*u)}return c}},{"../../registry":766}],833:[function(t,e,r){"use strict";e.exports=function(t){for(var e=0,r=0;r<t.length;r++)e=Math.max(e,t[r].length);return e}},{}],834:[function(t,e,r){"use strict";function n(t,e,r){function n(t,e){var r=e.length-2,n=o.constrain(o.findBin(t,e),0,r),i=e[n],a=e[n+1],s=o.constrain(n+(t-i)/(a-i)-.5,0,r),l=Math.round(s),u=Math.abs(s-l);return s&&s!==r&&u?{bin0:l,frac:u,bin1:Math.round(l+u/(s-l))}:{bin0:l,bin1:l,frac:0}}function c(t,e,r,n,i,a,o,s,l){var u={x0:e,x1:r,y0:n,y1:i},c=2*t.xgap/3,h=2*t.ygap/3,f=t.xgap/3,d=t.ygap/3;return s===l-1&&(u.y1=i-h),a===o-1&&(u.x0=e+c),0===s&&(u.y0=n+h),0===a&&(u.x1=r-c),a>0&&a<o-1&&(u.x0=e+f,u.x1=r-f),s>0&&s<l-1&&(u.y0=n+d,u.y1=i-d),u}function h(t,e){if(void 0!==t){var r=G(t);return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),it+=e,at+=r[0]*e,ot+=r[1]*e,st+=r[2]*e,r}return[0,0,0,0]}function f(t,e,r){t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=Math.round(255*r[3])}function d(t,e,r,n){var i=t[r.bin0];if(void 0===i)return h(void 0,1);var a,o=t[r.bin1],s=e[r.bin0],l=e[r.bin1],u=o-i||0,c=s-i||0;return a=void 0===o?void 0===l?0:void 0===s?2*(l-i):2*(2*l-s-i)/3:void 0===l?void 0===s?0:2*(2*i-o-s)/3:void 0===s?2*(2*l-o-i)/3:l+i-o-s,h(i+r.frac*u+n.frac*(c+r.frac*a))}var p=r[0].trace,m=p.uid,g=e.xaxis,v=e.yaxis,y=t._fullLayout,x="hm"+m;if(y._paper.selectAll(".contour"+m).remove(),p.visible!==!0)return y._paper.selectAll("."+x).remove(),void y._infolayer.selectAll(".cb"+m).remove();var b,_,w,M,A,k,T=r[0].z,E=r[0].x,S=r[0].y,L=a.traceIs(p,"contour"),C=L?"best":p.zsmooth,I=T.length,z=u(T),D=!1,P=!1;for(k=0;void 0===b&&k<E.length-1;)b=g.c2p(E[k]),k++;for(k=E.length-1;void 0===_&&k>0;)_=g.c2p(E[k]),k--;for(_<b&&(w=_,_=b,b=w,D=!0),k=0;void 0===M&&k<S.length-1;)M=v.c2p(S[k]),k++;for(k=S.length-1;void 0===A&&k>0;)A=v.c2p(S[k]),k--;if(A<M&&(w=M,M=A,A=w,P=!0),L&&(E=r[0].xfill,S=r[0].yfill),"fast"!==C){var O="best"===C?0:.5;b=Math.max(-O*g._length,b),_=Math.min((1+O)*g._length,_),M=Math.max(-O*v._length,M),A=Math.min((1+O)*v._length,A)}var R=Math.round(_-b),F=Math.round(A-M),j=R<=0||F<=0,N=e.plot.select(".imagelayer").selectAll("g.hm."+x).data(j?[]:[0]);if(N.enter().append("g").classed("hm",!0).classed(x,!0),N.exit().remove(),!j){var B,U;"fast"===C?(B=z,U=I):(B=R,U=F);var V=document.createElement("canvas");V.width=B,V.height=U;var q,H,Y=V.getContext("2d"),G=s.makeColorScaleFunc(s.extractScale(p.colorscale,p.zmin,p.zmax),{noNumericCheck:!0,returnArray:!0});"fast"===C?(q=D?function(t){return z-1-t}:o.identity,H=P?function(t){return I-1-t}:o.identity):(q=function(t){return o.constrain(Math.round(g.c2p(E[t])-b),0,R)},H=function(t){return o.constrain(Math.round(v.c2p(S[t])-M),0,F)});var X,W,Z,J,K,Q,$,tt=H(0),et=[tt,tt],rt=D?0:1,nt=P?0:1,it=0,at=0,ot=0,st=0;if(C){var lt,ut=0;try{lt=new Uint8Array(R*F*4)}catch(t){lt=new Array(R*F*4)}if("best"===C){var ct,ht,ft,dt=new Array(E.length),pt=new Array(S.length),mt=new Array(R);for(k=0;k<E.length;k++)dt[k]=Math.round(g.c2p(E[k])-b);for(k=0;k<S.length;k++)pt[k]=Math.round(v.c2p(S[k])-M);for(k=0;k<R;k++)mt[k]=n(k,dt);for(Z=0;Z<F;Z++)for(ct=n(Z,pt),ht=T[ct.bin0],ft=T[ct.bin1],k=0;k<R;k++,ut+=4)$=d(ht,ft,mt[k],ct),f(lt,ut,$)}else for(Z=0;Z<I;Z++)for(Q=T[Z],et=H(Z),k=0;k<R;k++)$=h(Q[k],1),ut=4*(et*R+q(k)),f(lt,ut,$);var gt=Y.createImageData(R,F);try{gt.data.set(lt)}catch(t){var vt=gt.data,yt=vt.length;for(Z=0;Z<yt;Z++)vt[Z]=lt[Z]}Y.putImageData(gt,0,0)}else for(Z=0;Z<I;Z++)if(Q=T[Z],et.reverse(),et[nt]=H(Z+1),et[0]!==et[1]&&void 0!==et[0]&&void 0!==et[1])for(J=q(0),W=[J,J],k=0;k<z;k++)W.reverse(),W[rt]=q(k+1),W[0]!==W[1]&&void 0!==W[0]&&void 0!==W[1]&&(K=Q[k],$=h(K,(W[1]-W[0])*(et[1]-et[0])),Y.fillStyle="rgba("+$.join(",")+")",X=c(p,W[0],W[1],et[0],et[1],k,z,Z,I),Y.fillRect(X.x0,X.y0,X.x1-X.x0,X.y1-X.y0));at=Math.round(at/it),ot=Math.round(ot/it),st=Math.round(st/it);var xt=i("rgb("+at+","+ot+","+st+")");t._hmpixcount=(t._hmpixcount||0)+it,t._hmlumcount=(t._hmlumcount||0)+it*xt.getLuminance();var bt=N.selectAll("image").data(r);bt.enter().append("svg:image").attr({xmlns:l.svg,preserveAspectRatio:"none"}),bt.attr({height:F,width:R,x:b,y:M,"xlink:href":V.toDataURL("image/png")}),bt.exit().remove()}}var i=t("tinycolor2"),a=t("../../registry"),o=t("../../lib"),s=t("../../components/colorscale"),l=t("../../constants/xmlns_namespaces"),u=t("./max_row_length");e.exports=function(t,e,r){for(var i=0;i<r.length;i++)n(t,e,r[i])}},{"../../components/colorscale":572,"../../constants/xmlns_namespaces":643,"../../lib":658,"../../registry":766,"./max_row_length":833,tinycolor2:495}],835:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t){n.select(t).selectAll(".hm image").style("opacity",function(t){return t.trace.opacity})}},{d3:97}],836:[function(t,e,r){"use strict";function n(t,e){var r=e(t),n=r?e(t+"type","array"):"scaled";return"scaled"===n&&(e(t+"0"),e("d"+t)),r}function i(t){for(var e,r=!0,n=!1,i=!1,o=0;o<t.length;o++){if(e=t[o],!Array.isArray(e)){r=!1;break}e.length>0&&(n=!0);for(var s=0;s<e.length;s++)if(a(e[s])){i=!0;break}}return r&&n&&i}var a=t("fast-isnumeric"),o=t("../../registry"),s=t("./has_columns");e.exports=function(t,e,r,a){var l,u,c=r("z");if(void 0===c||!c.length)return 0;if(s(t)){if(l=r("x"),u=r("y"),!l||!u)return 0}else{if(l=n("x",r),u=n("y",r),!i(c))return 0;r("transpose")}var h=o.getComponentMethod("calendars","handleTraceDefaults");return h(t,e,["x","y"],a),e.z.length}},{"../../registry":766,"./has_columns":828,"fast-isnumeric":106}],837:[function(t,e,r){"use strict";for(var n=t("../heatmap/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../lib/extend").extendFlat,s=["z","x","x0","dx","y","y0","dy","text","transpose","xtype","ytype"],l={},u=0;u<s.length;u++){var c=s[u];l[c]=n[c]}o(l,i,{autocolorscale:o({},i.autocolorscale,{dflt:!1})},{colorbar:a}),e.exports=l},{"../../components/colorbar/attributes":559,"../../components/colorscale/attributes":563,"../../lib/extend":651,"../heatmap/attributes":821}],838:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.type="heatmapgl",this.name="",this.hoverinfo="all",this.xData=[],this.yData=[],this.zData=[],this.textLabels=[],this.idToIndex=[],this.bounds=[0,0,0,0],this.options={z:[],x:[],y:[],shape:[0,0],colorLevels:[0],colorValues:[0,0,0,1]},this.heatmap=o(t.glplot,this.options),this.heatmap._trace=this}function i(t){for(var e=t.colorscale,r=t.zmin,n=t.zmax,i=e.length,a=new Array(i),o=new Array(4*i),s=0;s<i;s++){var u=e[s],c=l(u[1]);a[s]=r+u[0]*(n-r);for(var h=0;h<4;h++)o[4*s+h]=c[h]}return{colorLevels:a,colorValues:o}}function a(t,e,r){var i=new n(t,e.uid);return i.update(e,r),i}var o=t("gl-heatmap2d"),s=t("../../plots/cartesian/axes"),l=t("../../lib/str2rgbarray"),u=n.prototype;u.handlePick=function(t){var e=this.options,r=e.shape,n=t.pointId,i=n%r[0],a=Math.floor(n/r[0]),o=n;return{trace:this,dataCoord:t.dataCoord,traceCoord:[e.x[i],e.y[a],e.z[o]],textLabel:this.textLabels[n],name:this.name,pointIndex:[i,a],hoverinfo:this.hoverinfo}},u.update=function(t,e){var r=e[0];this.name=t.name,this.hoverinfo=t.hoverinfo;var n=r.z;this.options.z=[].concat.apply([],n);var a=n[0].length,o=n.length;this.options.shape=[a,o],this.options.x=r.x,this.options.y=r.y;var l=i(t);this.options.colorLevels=l.colorLevels,this.options.colorValues=l.colorValues,this.textLabels=[].concat.apply([],t.text),this.heatmap.update(this.options),s.expand(this.scene.xaxis,r.x),s.expand(this.scene.yaxis,r.y)},u.dispose=function(){this.heatmap.dispose()},e.exports=a},{"../../lib/str2rgbarray":673,"../../plots/cartesian/axes":691,"gl-heatmap2d":139}],839:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("../heatmap/defaults"),n.colorbar=t("../heatmap/colorbar"),n.calc=t("../heatmap/calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="heatmapgl",n.basePlotModule=t("../../plots/gl2d"),n.categories=["gl2d","2dMap"],n.meta={},e.exports=n},{"../../plots/gl2d":727,"../heatmap/calc":822,"../heatmap/colorbar":824,"../heatmap/defaults":826,"./attributes":837,"./convert":838}],840:[function(t,e,r){"use strict";function n(t){return{start:{valType:"any",dflt:null},end:{valType:"any",dflt:null},size:{valType:"any",dflt:null}}}var i=t("../bar/attributes");e.exports={x:{valType:"data_array"},y:{valType:"data_array"},text:i.text,orientation:i.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:""},cumulative:{enabled:{valType:"boolean",dflt:!1},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing"},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include"}},autobinx:{valType:"boolean",dflt:null},nbinsx:{valType:"integer",min:0,dflt:0},xbins:n("x"),autobiny:{valType:"boolean",dflt:null},nbinsy:{valType:"integer",min:0,dflt:0},ybins:n("y"),marker:i.marker,error_y:i.error_y,error_x:i.error_x,_deprecated:{bardir:i._deprecated.bardir}}},{"../bar/attributes":776}],841:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=t.length,n=0,i=0;i<r;i++)e[i]?(t[i]/=e[i],n+=t[i]):t[i]=null;return n}},{}],842:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){return r("histnorm"),n.forEach(function(t){r(t+"bins.start"),r(t+"bins.end"),r(t+"bins.size"),r("autobin"+t),r("nbins"+t)}),e}},{}],843:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports={count:function(t,e,r){return r[t]++,1},sum:function(t,e,r,i){var a=i[e];return n(a)?(a=Number(a),r[t]+=a,a):0},avg:function(t,e,r,i,a){var o=i[e];return n(o)&&(o=Number(o),r[t]+=o,a[t]++),0},min:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]>a){var o=a-r[t];return r[t]=a,o}}return 0},max:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]<a){var o=a-r[t];return r[t]=a,o}}return 0}}},{"fast-isnumeric":106}],844:[function(t,e,r){"use strict";function n(t,e,r){function n(e){s=t[e],t[e]/=2}function i(e){o=t[e],t[e]=s+o/2,s+=o}var a,o,s;if("half"===r)if("increasing"===e)for(n(0),a=1;a<t.length;a++)i(a);else for(n(t.length-1),a=t.length-2;a>=0;a--)i(a);else if("increasing"===e){for(a=1;a<t.length;a++)t[a]+=t[a-1];"exclude"===r&&(t.unshift(0),t.pop())}else{for(a=t.length-2;a>=0;a--)t[a]+=t[a+1];"exclude"===r&&(t.push(0),t.shift())}}var i=t("fast-isnumeric"),a=t("../../lib"),o=t("../../plots/cartesian/axes"),s=t("./bin_functions"),l=t("./norm_functions"),u=t("./average"),c=t("./clean_bins");e.exports=function(t,e){if(e.visible===!0){var r,h=[],f=[],d=o.getFromId(t,"h"===e.orientation?e.yaxis||"y":e.xaxis||"x"),p="h"===e.orientation?"y":"x",m={x:"y",y:"x"}[p],g=e[p+"calendar"],v=e.cumulative;c(e,d,p);var y,x=d.makeCalcdata(e,p),b=p+"bins";e["autobin"+p]===!1&&b in e?y=e[b]:(y=o.autoBin(x,d,e["nbins"+p],!1,g),v.enabled&&"include"!==v.currentbin&&("decreasing"===v.direction?y.start=d.c2r(d.r2c(y.start)-y.size):y.end=d.c2r(d.r2c(y.end)+y.size)),e._input[b]=e[b]=y);var _,w,M,A="string"==typeof y.size,k=A?[]:y,T=[],E=[],S=0,L=e.histnorm,C=e.histfunc,I=L.indexOf("density")!==-1;v.enabled&&I&&(L=L.replace(/ ?density$/,""),I=!1);var z,D="max"===C||"min"===C,P=D?null:0,O=s.count,R=l[L],F=!1,j=function(t){return d.r2c(t,0,g)};for(Array.isArray(e[m])&&"count"!==C&&(z=e[m],F="avg"===C,O=s[C]),r=j(y.start),w=j(y.end)+(r-o.tickIncrement(r,y.size,!1,g))/1e6;r<w&&h.length<5e3;)_=o.tickIncrement(r,y.size,!1,g),h.push((r+_)/2),f.push(P),A&&k.push(r),I&&T.push(1/(_-r)),F&&E.push(0),r=_;A||"date"!==d.type||(k={start:j(k.start),end:j(k.end),size:k.size});var N=f.length;for(r=0;r<x.length;r++)M=a.findBin(x[r],k),M>=0&&M<N&&(S+=O(M,r,f,z,E));F&&(S=u(f,E)),R&&R(f,S,T),v.enabled&&n(f,v.direction,v.currentbin);var B=Math.min(h.length,f.length),U=[],V=0,q=B-1;for(r=0;r<B;r++)if(f[r]){V=r;break}for(r=B-1;r>V;r--)if(f[r]){q=r;break}for(r=V;r<=q;r++)i(h[r])&&i(f[r])&&U.push({p:h[r],s:f[r],b:0});return U}}},{"../../lib":658,"../../plots/cartesian/axes":691,"./average":841,"./bin_functions":843,"./clean_bins":845,"./norm_functions":848,"fast-isnumeric":106}],845:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib").cleanDate,a=t("../../constants/numerical"),o=a.ONEDAY,s=a.BADNUM;e.exports=function(t,e,r){var a=e.type,l=r+"bins",u=t[l];u||(u=t[l]={});var c="date"===a?function(t){return t||0===t?i(t,s,u.calendar):null}:function(t){return n(t)?Number(t):null};u.start=c(u.start),u.end=c(u.end);var h="date"===a?o:1,f=u.size;if(n(f))u.size=f>0?Number(f):h;else if("string"!=typeof f)u.size=h;else{var d=f.charAt(0),p=f.substr(1);p=n(p)?Number(p):0,(p<=0||"date"!==a||"M"!==d||p!==Math.round(p))&&(u.size=h)}var m="autobin"+r;"boolean"!=typeof t[m]&&(t[m]=!((u.start||0===u.start)&&(u.end||0===u.end))),t[m]||delete t["nbins"+r]}},{"../../constants/numerical":641,"../../lib":658,"fast-isnumeric":106}],846:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/color"),o=t("./bin_defaults"),s=t("../bar/style_defaults"),l=t("../../components/errorbars/defaults"),u=t("./attributes");e.exports=function(t,e,r,c){function h(r,n){return i.coerce(t,e,u,r,n)}var f=h("x"),d=h("y"),p=h("cumulative.enabled");p&&(h("cumulative.direction"),h("cumulative.currentbin")),h("text");var m=h("orientation",d&&!f?"h":"v"),g=e["v"===m?"x":"y"];if(!g||!g.length)return void(e.visible=!1);var v=n.getComponentMethod("calendars","handleTraceDefaults");v(t,e,["x","y"],c);var y=e["h"===m?"x":"y"];y&&h("histfunc");var x="h"===m?["y"]:["x"];o(t,e,h,x),s(t,e,h,r,c),l(t,e,a.defaultLine,{axis:"y"}),l(t,e,a.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":558,"../../components/errorbars/defaults":586,"../../lib":658,"../../registry":766,"../bar/style_defaults":787,"./attributes":840,"./bin_defaults":842}],847:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("../bar/layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("../bar/layout_defaults"),n.calc=t("./calc"),n.setPositions=t("../bar/set_positions"),n.plot=t("../bar/plot"),n.style=t("../bar/style"),n.colorbar=t("../scatter/colorbar"),n.hoverPoints=t("../bar/hover"),n.moduleType="trace",n.name="histogram",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","bar","histogram","oriented","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":699,"../bar/hover":779,"../bar/layout_attributes":781,"../bar/layout_defaults":782,"../bar/plot":783,"../bar/set_positions":784,"../bar/style":786,"../scatter/colorbar":887,"./attributes":840,"./calc":844,"./defaults":846}],848:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,i=0;i<r;i++)t[i]*=n},probability:function(t,e){for(var r=t.length,n=0;n<r;n++)t[n]/=e},density:function(t,e,r,n){var i=t.length;n=n||1;for(var a=0;a<i;a++)t[a]*=r[a]*n},"probability density":function(t,e,r,n){var i=t.length;n&&(e/=n);for(var a=0;a<i;a++)t[a]*=r[a]/e}}},{}],849:[function(t,e,r){"use strict";var n=t("../histogram/attributes"),i=t("../heatmap/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({},{x:n.x,y:n.y,z:{valType:"data_array"},marker:{color:{valType:"data_array"}},histnorm:n.histnorm,histfunc:n.histfunc,autobinx:n.autobinx,nbinsx:n.nbinsx,xbins:n.xbins,autobiny:n.autobiny,nbinsy:n.nbinsy,ybins:n.ybins,xgap:i.xgap,ygap:i.ygap,zsmooth:i.zsmooth},a,{autocolorscale:s({},a.autocolorscale,{dflt:!1})},{colorbar:o})},{"../../components/colorbar/attributes":559,"../../components/colorscale/attributes":563,"../../lib/extend":651,"../heatmap/attributes":821,"../histogram/attributes":840}],850:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("../histogram/bin_functions"),o=t("../histogram/norm_functions"),s=t("../histogram/average"),l=t("../histogram/clean_bins");e.exports=function(t,e){var r,u,c,h,f,d,p=i.getFromId(t,e.xaxis||"x"),m=e.x?p.makeCalcdata(e,"x"):[],g=i.getFromId(t,e.yaxis||"y"),v=e.y?g.makeCalcdata(e,"y"):[],y=e.xcalendar,x=e.ycalendar,b=function(t){return p.r2c(t,0,y)},_=function(t){return g.r2c(t,0,x)},w=function(t){return p.c2r(t,0,y)},M=function(t){return g.c2r(t,0,x)};l(e,p,"x"),l(e,g,"y");var A=Math.min(m.length,v.length);m.length>A&&m.splice(A,m.length-A),v.length>A&&v.splice(A,v.length-A),!e.autobinx&&"xbins"in e||(e.xbins=i.autoBin(m,p,e.nbinsx,"2d",y),"histogram2dcontour"===e.type&&(e.xbins.start=w(i.tickIncrement(b(e.xbins.start),e.xbins.size,!0,y)),e.xbins.end=w(i.tickIncrement(b(e.xbins.end),e.xbins.size,!1,y))),e._input.xbins=e.xbins),!e.autobiny&&"ybins"in e||(e.ybins=i.autoBin(v,g,e.nbinsy,"2d",x),"histogram2dcontour"===e.type&&(e.ybins.start=M(i.tickIncrement(_(e.ybins.start),e.ybins.size,!0,x)),e.ybins.end=M(i.tickIncrement(_(e.ybins.end),e.ybins.size,!1,x))),e._input.ybins=e.ybins),f=[];var k,T,E=[],S=[],L="string"==typeof e.xbins.size,C="string"==typeof e.ybins.size,I=L?[]:e.xbins,z=C?[]:e.ybins,D=0,P=[],O=e.histnorm,R=e.histfunc,F=O.indexOf("density")!==-1,j="max"===R||"min"===R,N=j?null:0,B=a.count,U=o[O],V=!1,q=[],H=[],Y="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";Y&&"count"!==R&&(V="avg"===R,B=a[R]);var G=e.xbins,X=b(G.start),W=b(G.end)+(X-i.tickIncrement(X,G.size,!1,y))/1e6;for(d=X;d<W;d=i.tickIncrement(d,G.size,!1,y))E.push(N),L&&I.push(d),V&&S.push(0);L&&I.push(d);var Z=E.length;r=e.xbins.start;var J=b(r);for(u=(d-J)/Z,r=w(J+u/2),G=e.ybins,X=_(G.start),W=_(G.end)+(X-i.tickIncrement(X,G.size,!1,x))/1e6,d=X;d<W;d=i.tickIncrement(d,G.size,!1,x))f.push(E.concat()),C&&z.push(d),V&&P.push(S.concat());C&&z.push(d);var K=f.length;c=e.ybins.start;var Q=_(c);for(h=(d-Q)/K,c=M(Q+h/2),F&&(q=E.map(function(t,e){return L?1/(I[e+1]-I[e]):1/u}),H=f.map(function(t,e){return C?1/(z[e+1]-z[e]):1/h})),L||"date"!==p.type||(I={start:b(I.start),end:b(I.end),size:I.size}),C||"date"!==g.type||(z={start:_(z.start),end:_(z.end),size:z.size}),d=0;d<A;d++)k=n.findBin(m[d],I),T=n.findBin(v[d],z),k>=0&&k<Z&&T>=0&&T<K&&(D+=B(k,d,f[T],Y,P[T]));if(V)for(T=0;T<K;T++)D+=s(f[T],P[T]);if(U)for(T=0;T<K;T++)U(f[T],D,q,H[T]);return{x:m,x0:r,dx:u,y:v,y0:c,dy:h,z:f}}},{"../../lib":658,"../../plots/cartesian/axes":691,"../histogram/average":841,"../histogram/bin_functions":843,"../histogram/clean_bins":845,"../histogram/norm_functions":848}],851:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./sample_defaults"),a=t("../../components/colorscale/defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,i){return n.coerce(t,e,o,r,i)}i(t,e,l,s);var u=l("zsmooth");u===!1&&(l("xgap"),l("ygap")),a(t,e,s,l,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":567,"../../lib":658,"./attributes":849,"./sample_defaults":853}],852:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../heatmap/calc"),n.plot=t("../heatmap/plot"),n.colorbar=t("../heatmap/colorbar"),n.style=t("../heatmap/style"),n.hoverPoints=t("../heatmap/hover"),n.moduleType="trace",n.name="histogram2d",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","2dMap","histogram"],n.meta={},e.exports=n},{"../../plots/cartesian":699,"../heatmap/calc":822,"../heatmap/colorbar":824,"../heatmap/hover":829,"../heatmap/plot":834,"../heatmap/style":835,"./attributes":849,"./defaults":851}],853:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../histogram/bin_defaults");e.exports=function(t,e,r,a){var o=r("x"),s=r("y");if(!(o&&o.length&&s&&s.length))return void(e.visible=!1);var l=n.getComponentMethod("calendars","handleTraceDefaults");l(t,e,["x","y"],a);var u=r("z")||r("marker.color");u&&r("histfunc");var c=["x","y"];i(t,e,r,c)}},{"../../registry":766,"../histogram/bin_defaults":842}],854:[function(t,e,r){"use strict";var n=t("../histogram2d/attributes"),i=t("../contour/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({},{x:n.x,y:n.y,z:n.z,marker:n.marker,histnorm:n.histnorm,histfunc:n.histfunc,autobinx:n.autobinx,nbinsx:n.nbinsx,xbins:n.xbins,autobiny:n.autobiny,nbinsy:n.nbinsy,ybins:n.ybins,autocontour:i.autocontour,ncontours:i.ncontours,contours:i.contours,line:i.line},a,{colorbar:o})},{"../../components/colorbar/attributes":559,"../../components/colorscale/attributes":563,"../../lib/extend":651,"../contour/attributes":807,"../histogram2d/attributes":849}],855:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../histogram2d/sample_defaults"),a=t("../contour/style_defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,i){return n.coerce(t,e,o,r,i)}i(t,e,l,s);var u=n.coerce2(t,e,o,"contours.start"),c=n.coerce2(t,e,o,"contours.end"),h=l("autocontour",!(u&&c));l(h?"ncontours":"contours.size"),a(t,e,l,s)}},{"../../lib":658,"../contour/style_defaults":820,"../histogram2d/sample_defaults":853,"./attributes":854}],856:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../contour/calc"),n.plot=t("../contour/plot"),n.style=t("../contour/style"),n.colorbar=t("../contour/colorbar"),n.hoverPoints=t("../contour/hover"),n.moduleType="trace",n.name="histogram2dcontour",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","2dMap","contour","histogram"],n.meta={},e.exports=n},{"../../plots/cartesian":699,"../contour/calc":808,"../contour/colorbar":809,"../contour/hover":814,"../contour/plot":818,"../contour/style":819,"./attributes":854,"./defaults":855}],857:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../components/colorbar/attributes"),a=t("../surface/attributes"),o=t("../../lib/extend").extendFlat;e.exports={x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},i:{valType:"data_array"},j:{valType:"data_array"},k:{valType:"data_array"},delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z"},alphahull:{valType:"number",dflt:-1},intensity:{valType:"data_array"},color:{valType:"color"},vertexcolor:{valType:"data_array"},facecolor:{valType:"data_array"},opacity:o({},a.opacity),flatshading:{valType:"boolean",dflt:!1},contour:{show:o({},a.contours.x.show,{}),color:o({},a.contours.x.color),width:o({},a.contours.x.width)},colorscale:n.colorscale,reversescale:n.reversescale,showscale:n.showscale,colorbar:i,lightposition:{x:o({},a.lightposition.x,{dflt:1e5}),y:o({},a.lightposition.y,{dflt:1e5}),z:o({},a.lightposition.z,{dflt:0})},lighting:o({},{vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6}},a.lighting)}},{"../../components/colorbar/attributes":559,"../../components/colorscale/attributes":563,"../../lib/extend":651,"../surface/attributes":940}],858:[function(t,e,r){"use strict";function n(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}function i(t){return t.map(function(t){var e=t[0],r=u(t[1]),n=r.toRgb();return{index:e,rgb:[n.r,n.g,n.b,1]}})}function a(t){return t.map(d)}function o(t,e,r){for(var n=new Array(t.length),i=0;i<t.length;++i)n[i]=[t[i],e[i],r[i]];return n}function s(t,e){var r=t.glplot.gl,i=l({gl:r}),a=new n(t,i,e.uid);return a.update(e),t.glplot.add(i),a}var l=t("gl-mesh3d"),u=t("tinycolor2"),c=t("delaunay-triangulate"),h=t("alpha-shape"),f=t("convex-hull"),d=t("../../lib/str2rgbarray"),p=n.prototype;p.handlePick=function(t){if(t.object===this.mesh){var e=t.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},p.update=function(t){function e(t,e,r,n){return e.map(function(e){return t.d2l(e,0,n)*r})}var r=this.scene,n=r.fullSceneLayout;this.data=t;var s,l=o(e(n.xaxis,t.x,r.dataScale[0],t.xcalendar),e(n.yaxis,t.y,r.dataScale[1],t.ycalendar),e(n.zaxis,t.z,r.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k)s=o(t.i,t.j,t.k);else if(0===t.alphahull)s=f(l);else if(t.alphahull>0)s=h(t.alphahull,l);else{var u=["x","y","z"].indexOf(t.delaunayaxis);s=c(l.map(function(t){return[t[(u+1)%3],t[(u+2)%3]]}))}var p={positions:l,cells:s,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:d(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color="#fff",p.vertexIntensity=t.intensity,p.colormap=i(t.colorscale)):t.vertexcolor?(this.color=t.vertexcolors[0],p.vertexColors=a(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],p.cellColors=a(t.facecolor)):(this.color=t.color,p.meshColor=d(t.color)),this.mesh.update(p)},p.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=s},{"../../lib/str2rgbarray":673,"alpha-shape":34,"convex-hull":86,"delaunay-triangulate":98,"gl-mesh3d":178,tinycolor2:495}],859:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/colorbar/defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,n){return i.coerce(t,e,o,r,n)}function u(t){var e=t.map(function(t){var e=l(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var c=u(["x","y","z"]),h=u(["i","j","k"]);if(!c)return void(e.visible=!1);h&&h.forEach(function(t){for(var e=0;e<t.length;++e)t[e]|=0});var f=n.getComponentMethod("calendars","handleTraceDefaults");f(t,e,["x","y","z"],s),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","contour.show","contour.color","contour.width","colorscale","reversescale","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(t){l(t)}),"intensity"in t?(l("intensity"),l("showscale",!0)):(e.showscale=!1,"vertexcolor"in t?l("vertexcolor"):"facecolor"in t?l("facecolor"):l("color",r)),e.reversescale&&(e.colorscale=e.colorscale.map(function(t){return[1-t[0],t[1]]}).reverse()),e.showscale&&a(t,e,s)}},{"../../components/colorbar/defaults":560,"../../lib":658,"../../registry":766,"./attributes":857}],860:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../heatmap/colorbar"),n.plot=t("./convert"),n.moduleType="trace",n.name="mesh3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d"],n.meta={},e.exports=n},{"../../plots/gl3d":730,"../heatmap/colorbar":824,"./attributes":857,"./convert":858,"./defaults":859}],861:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/attributes"),a="#3D9970",o="#FF4136",s=i.line,l={name:{valType:"string"},showlegend:{valType:"boolean",dflt:!0},line:{color:n.extendFlat({},s.color),width:n.extendFlat({},s.width),dash:n.extendFlat({},s.dash)}};e.exports={x:{valType:"data_array"},open:{valType:"data_array",dflt:[]},high:{valType:"data_array",dflt:[]},low:{valType:"data_array",dflt:[]},close:{valType:"data_array",dflt:[]},line:{width:n.extendFlat({},s.width,{}),dash:n.extendFlat({},s.dash,{})},increasing:n.extendDeep({},l,{line:{color:{dflt:a}}}),decreasing:n.extendDeep({},l,{line:{color:{dflt:o}}}),text:{valType:"string",dflt:"",arrayOk:!0},tickwidth:{valType:"number",min:0,max:.5,dflt:.3}}},{"../../lib":658,"../scatter/attributes":884}],862:[function(t,e,r){"use strict";function n(t,e,r,n){o(t,e,r,n),r(n+".line.color"),r(n+".line.width",e.line.width),r(n+".line.dash",e.line.dash)}var i=t("../../lib"),a=t("./ohlc_defaults"),o=t("./direction_defaults"),s=t("./attributes"),l=t("./helpers");e.exports=function(t,e,r,o){function u(r,n){return i.coerce(t,e,s,r,n)}l.pushDummyTransformOpts(t,e);var c=a(t,e,u,o);return 0===c?void(e.visible=!1):(u("line.width"),u("line.dash"),n(t,e,u,"increasing"),n(t,e,u,"decreasing"),u("text"),void u("tickwidth"))}},{"../../lib":658,"./attributes":861,"./direction_defaults":863,"./helpers":864,"./ohlc_defaults":866}],863:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){r(n+".showlegend"),t.showlegend===!1&&(e[n].showlegend=!1);var i=e.name+" - "+n;r(n+".name",i)}},{}],864:[function(t,e,r){"use strict";var n=t("../../lib");r.pushDummyTransformOpts=function(t,e){var r={type:e.type,_ephemeral:!0};Array.isArray(t.transforms)?t.transforms.push(r):t.transforms=[r]},r.clearEphemeralTransformOpts=function(t){var e=t.transforms;if(Array.isArray(e)){for(var r=0;r<e.length;r++)e[r]._ephemeral&&e.splice(r,1);0===e.length&&delete t.transforms}},r.copyOHLC=function(t,e){t.open&&(e.open=t.open),t.high&&(e.high=t.high),t.low&&(e.low=t.low),t.close&&(e.close=t.close)},r.makeTransform=function(t,e,r){var i=n.extendFlat([],t.transforms);return i[e.transformIndex]={type:t.type,direction:r,open:t.open,high:t.high,low:t.low,close:t.close},i},r.getFilterFn=function(t){switch(t){case"increasing":return function(t,e){return t<=e};case"decreasing":return function(t,e){return t>e}}},r.addRangeSlider=function(t){t.xaxis||(t.xaxis={}),t.xaxis.rangeslider||(t.xaxis.rangeslider={})}},{"../../lib":658}],865:[function(t,e,r){"use strict";var n=t("../../plot_api/register");e.exports={moduleType:"trace",name:"ohlc",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","showLegend"],meta:{},attributes:t("./attributes"),supplyDefaults:t("./defaults")},n(t("../scatter")),n(t("./transform"))},{"../../plot_api/register":681,"../../plots/cartesian":699,"../scatter":894,"./attributes":861,"./defaults":862,"./transform":867}],866:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,i){var a,o=r("x"),s=r("open"),l=r("high"),u=r("low"),c=r("close"),h=n.getComponentMethod("calendars","handleTraceDefaults");return h(t,e,["x"],i),a=Math.min(s.length,l.length,u.length,c.length),o&&(a=Math.min(a,o.length),a<o.length&&(e.x=o.slice(0,a))),a<s.length&&(e.open=s.slice(0,a)),a<l.length&&(e.high=l.slice(0,a)),a<u.length&&(e.low=u.slice(0,a)),a<c.length&&(e.close=c.slice(0,a)),a}},{"../../registry":766}],867:[function(t,e,r){"use strict";function n(t,e,r){var n={type:"scatter",mode:"lines",connectgaps:!1,visible:t.visible,opacity:t.opacity,xaxis:t.xaxis,yaxis:t.yaxis,hoverinfo:i(t),transforms:s.makeTransform(t,e,r)},a=t[r];return a&&o.extendFlat(n,{x:t.x||[0],xcalendar:t.xcalendar,y:[].concat(t.low).concat(t.high),text:t.text,name:a.name,showlegend:a.showlegend,line:a.line}),n}function i(t){var e=t.hoverinfo;if("all"===e)return"x+text+name";var r=e.split("+"),n=r.indexOf("y"),i=r.indexOf("text");return n!==-1&&(r.splice(n,1),i===-1&&r.push("text")),r.join("+")}function a(t,e,r){var n=r._fullInput,i=n.tickwidth,a=n._minDiff;if(!a){var s=t._fullData,l=[];a=1/0;var u;for(u=0;u<s.length;u++){var c=s[u]._fullInput;if("ohlc"===c.type&&c.visible===!0&&c.xaxis===e._id&&(l.push(c),c.x&&c.x.length>1)){var h=o.simpleMap(c.x,e.d2c,0,r.xcalendar),f=o.distinctVals(h).minDiff;a=Math.min(a,f)}}for(a===1/0&&(a=1),u=0;u<l.length;u++)l[u]._minDiff=a}return a*i}var o=t("../../lib"),s=t("./helpers"),l=t("../../plots/cartesian/axes"),u=t("../../plots/cartesian/axis_ids");r.moduleType="transform",r.name="ohlc",r.attributes={},r.supplyDefaults=function(t,e,r,n){return s.clearEphemeralTransformOpts(n),s.copyOHLC(t,e),t},r.transform=function(t,e){for(var r=[],i=0;i<t.length;i++){var a=t[i];"ohlc"===a.type?r.push(n(a,e,"increasing"),n(a,e,"decreasing")):r.push(a)}return s.addRangeSlider(e.layout),r},r.calcTransform=function(t,e,r){var n,i=r.direction,o=s.getFilterFn(i),c=u.getFromTrace(t,e,"x"),h=u.getFromTrace(t,e,"y"),f=a(t,c,e),d=e.open,p=e.high,m=e.low,g=e.close,v=e.text,y=d.length,x=[],b=[],_=[];n=e._fullInput.x?function(t){var r=e.x[t],n=e.xcalendar,i=c.d2c(r,0,n);x.push(c.c2d(i-f,0,n),r,r,r,r,c.c2d(i+f,0,n),null)}:function(t){x.push(t-f,t,t,t,t,t+f,null)};for(var w=function(t,e,r,n){b.push(t,t,e,r,n,n,null)},M=function(t,e){return l.tickText(t,t.c2l(e),"hover").text},A=e._fullInput.hoverinfo,k=A.split("+"),T="all"===A,E=T||k.indexOf("y")!==-1,S=T||k.indexOf("text")!==-1,L=Array.isArray(v)?function(t){return v[t]||""}:function(){return v},C=function(t,e,r,n,i){var a=[];E&&(a.push("Open: "+M(h,e)),a.push("High: "+M(h,r)),a.push("Low: "+M(h,n)),a.push("Close: "+M(h,i))),S&&a.push(L(t));var o=a.join("<br>");_.push(o,o,o,o,o,o,null)},I=0;I<y;I++)o(d[I],g[I])&&(n(I),w(d[I],p[I],m[I],g[I]),C(I,d[I],p[I],m[I],g[I]));e.x=x,e.y=b,e.text=_}},{"../../lib":658,"../../plots/cartesian/axes":691,"../../plots/cartesian/axis_ids":694,"./helpers":864}],868:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),i=t("../../plots/font_attributes"),a=t("../../plots/attributes"),o=t("../../lib/extend").extendFlat;e.exports={labels:{valType:"data_array"},label0:{valType:"number",dflt:0},dlabel:{valType:"number",dflt:1},values:{valType:"data_array"},marker:{colors:{valType:"data_array"},line:{color:{valType:"color",dflt:n.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}}},text:{valType:"data_array"},scalegroup:{valType:"string",dflt:""},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"]},hoverinfo:o({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0},textfont:o({},i,{}),insidetextfont:o({},i,{}),outsidetextfont:o({},i,{}),domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},hole:{valType:"number",min:0,max:1,dflt:0},sort:{valType:"boolean",dflt:!0},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise"},rotation:{valType:"number",min:-360,max:360,dflt:0},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0}}},{"../../components/color/attributes":557,"../../lib/extend":651,"../../plots/attributes":689,"../../plots/font_attributes":711}],869:[function(t,e,r){"use strict";function n(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n],a=i[0].trace;a._module===e&&a.visible===!0&&r.push(i)}return r}var i=t("../../registry");r.name="pie",r.plot=function(t){var e=i.getModule("pie"),r=n(t.calcdata,e);r.length&&e.plot(t,r)},r.clean=function(t,e,r,n){var i=n._has&&n._has("pie"),a=e._has&&e._has("pie");i&&!a&&n._pielayer.selectAll("g.trace").remove()}},{"../../registry":766}],870:[function(t,e,r){"use strict";function n(t){if(!l){var e=o.defaults;l=e.slice();var r;for(r=0;r<e.length;r++)l.push(a(e[r]).lighten(20).toHexString());for(r=0;r<o.defaults.length;r++)l.push(a(e[r]).darken(20).toHexString())}return l[t%l.length]}var i=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../../components/color"),s=t("./helpers");e.exports=function(t,e){var r,l,u,c,h,f,d=e.values,p=e.labels,m=[],g=t._fullLayout,v=g._piecolormap,y={},x=!1,b=0,_=g.hiddenlabels||[];if(e.dlabel)for(p=new Array(d.length),r=0;r<d.length;r++)p[r]=String(e.label0+r*e.dlabel);for(r=0;r<d.length;r++)l=d[r],i(l)&&(l=+l,l<0||(u=p[r],void 0!==u&&""!==u||(u=r),u=String(u),void 0===y[u]&&(y[u]=!0,c=a(e.marker.colors[r]),c.isValid()?(c=o.addOpacity(c,c.getAlpha()),v[u]||(v[u]=c)):v[u]?c=v[u]:(c=!1,x=!0),h=_.indexOf(u)!==-1,h||(b+=l),m.push({v:l,label:u,color:c,i:r,hidden:h}))));if(e.sort&&m.sort(function(t,e){return e.v-t.v}),x)for(r=0;r<m.length;r++)f=m[r],f.color===!1&&(v[f.label]=f.color=n(g._piedefaultcolorcount),g._piedefaultcolorcount++);if(m[0]&&(m[0].vTotal=b),e.textinfo&&"none"!==e.textinfo){var w,M=e.textinfo.indexOf("label")!==-1,A=e.textinfo.indexOf("text")!==-1,k=e.textinfo.indexOf("value")!==-1,T=e.textinfo.indexOf("percent")!==-1,E=g.separators;for(r=0;r<m.length;r++)f=m[r],w=M?[f.label]:[],A&&e.text[f.i]&&w.push(e.text[f.i]),k&&w.push(s.formatPieValue(f.v,E)),T&&w.push(s.formatPiePercent(f.v/b,E)),f.text=w.join("<br>")}return m};var l},{"../../components/color":558,"./helpers":872,"fast-isnumeric":106,tinycolor2:495}],871:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,a){function o(r,a){return n.coerce(t,e,i,r,a)}var s=n.coerceFont,l=o("values");if(!Array.isArray(l)||!l.length)return void(e.visible=!1);var u=o("labels");Array.isArray(u)||(o("label0"),o("dlabel"));var c=o("marker.line.width");c&&o("marker.line.color");var h=o("marker.colors");Array.isArray(h)||(e.marker.colors=[]),o("scalegroup");var f=o("text"),d=o("textinfo",Array.isArray(f)?"text+percent":"percent");if(o("hoverinfo",1===a._dataLength?"label+text+value+percent":void 0),d&&"none"!==d){var p=o("textposition"),m=Array.isArray(p)||"auto"===p,g=m||"inside"===p,v=m||"outside"===p;if(g||v){var y=s(o,"textfont",a.font);g&&s(o,"insidetextfont",y),v&&s(o,"outsidetextfont",y)}}o("domain.x"),o("domain.y"),o("hole"),o("sort"),o("direction"),o("rotation"),o("pull")}},{"../../lib":658,"./attributes":868}],872:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return r.lastIndexOf(".")!==-1&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return r.lastIndexOf(".")!==-1&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)}},{"../../lib":658}],873:[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":868,"./base_plot":869,"./calc":870,"./defaults":871,"./layout_attributes":874,"./layout_defaults":875,"./plot":876,"./style":877,"./style_one":878}],874:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array"}}},{}],875:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}r("hiddenlabels")}},{"../../lib":658,"./layout_attributes":874}],876:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),a=t.width/t.height,o=Math.PI*Math.min(e.v/r.vTotal,.5),s=1-r.trace.hole,l=i(e,r),u={scale:l*r.r*2/n,rCenter:1-l,rotate:0};if(u.scale>=1)return u;var c=a+1/(2*Math.tan(o)),h=r.r*Math.min(1/(Math.sqrt(c*c+.5)+c),s/(Math.sqrt(a*a+s/2)+a)),f={scale:2*h/t.height,rCenter:Math.cos(h/r.r)-h*a/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},d=1/a,p=d+1/(2*Math.tan(o)),m=r.r*Math.min(1/(Math.sqrt(p*p+.5)+p),s/(Math.sqrt(d*d+s/2)+d)),g={scale:2*m/t.width,rCenter:Math.cos(m/r.r)-m/a/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},v=g.scale>f.scale?g:f;return u.scale<1&&v.scale>u.scale?v:u}function i(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 a(t,e){var r=e.pxmid[0],n=e.pxmid[1],i=t.width/2,a=t.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function o(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}function i(t,r){r||(r={});var n,i,a,s,f,d,m=r.labelExtraY+(o?r.yLabelMax:r.yLabelMin),g=o?t.yLabelMin:t.yLabelMax,v=o?t.yLabelMax:t.yLabelMin,y=t.cyFinal+u(t.px0[1],t.px1[1]),x=m-g;if(x*h>0&&(t.labelExtraY=x),Array.isArray(e.pull))for(i=0;i<p.length;i++)a=p[i],a===t||(e.pull[t.i]||0)>=e.pull[a.i]||((t.pxmid[1]-a.pxmid[1])*h>0?(s=a.cyFinal+u(a.px0[1],a.px1[1]),x=s-g-t.labelExtraY,x*h>0&&(t.labelExtraY+=x)):(v+t.labelExtraY-y)*h>0&&(n=3*c*Math.abs(i-p.indexOf(t)),f=a.cxFinal+l(a.px0[0],a.px1[0]),d=f+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX,d*c>0&&(t.labelExtraX+=d)))}var a,o,s,l,u,c,h,f,d,p,m,g,v;for(o=0;o<2;o++)for(s=o?r:n,u=o?Math.max:Math.min,h=o?1:-1,a=0;a<2;a++){for(l=a?Math.max:Math.min,c=a?1:-1,f=t[o][a],f.sort(s),d=t[1-o][a],p=d.concat(f),g=[],m=0;m<f.length;m++)void 0!==f[m].yLabelMid&&g.push(f[m]);for(v=!1,m=0;o&&m<d.length;m++)if(void 0!==d[m].yLabelMid){v=d[m];break}for(m=0;m<g.length;m++){var y=m&&g[m-1];v&&!m&&(y=v),i(g[m],y)}}}function s(t,e){var r,n,i,a,o,s,l,c,h,f,d=[];for(i=0;i<t.length;i++){if(o=t[i][0],s=o.trace,r=e.w*(s.domain.x[1]-s.domain.x[0]),n=e.h*(s.domain.y[1]-s.domain.y[0]),l=s.tiltaxis*Math.PI/180,c=s.pull,Array.isArray(c))for(c=0,a=0;a<s.pull.length;a++)s.pull[a]>c&&(c=s.pull[a]);o.r=Math.min(r/u(s.tilt,Math.sin(l),s.depth),n/u(s.tilt,Math.cos(l),s.depth))/(2+2*c),o.cx=e.l+e.w*(s.domain.x[1]+s.domain.x[0])/2,o.cy=e.t+e.h*(2-s.domain.y[1]-s.domain.y[0])/2,s.scalegroup&&d.indexOf(s.scalegroup)===-1&&d.push(s.scalegroup)}for(a=0;a<d.length;a++){for(f=1/0,h=d[a],i=0;i<t.length;i++)o=t[i][0],o.trace.scalegroup===h&&(f=Math.min(f,o.r*o.r/o.vTotal));for(i=0;i<t.length;i++)o=t[i][0],o.trace.scalegroup===h&&(o.r=Math.sqrt(f*o.vTotal))}}function l(t){function e(t){var e=h.r*Math.sin(t),r=-h.r*Math.cos(t);return d?[e*(1-s*n*n)+r*o*s,e*o*s+r*(1-s*i*i),Math.sin(a)*(r*i-e*n)]:[e,r]}var r,n,i,a,o,s,l,u,c,h=t[0],f=h.trace,d=f.tilt,p=f.rotation*Math.PI/180,m=2*Math.PI/h.vTotal,g="px0",v="px1";if("counterclockwise"===f.direction){for(l=0;l<t.length&&t[l].hidden;l++);if(l===t.length)return;p+=m*t[l].v,m*=-1,g="px1",v="px0"}for(d&&(a=d*Math.PI/180,r=f.tiltaxis*Math.PI/180,o=Math.sin(r)*Math.cos(r),s=1-Math.cos(a),n=Math.sin(r),i=Math.cos(r)),c=e(p),l=0;l<t.length;l++)u=t[l],u.hidden||(u[g]=c,p+=m*u.v/2,u.pxmid=e(p),u.midangle=p,p+=m*u.v/2,c=e(p),u[v]=c,u.largeArc=u.v>h.vTotal/2?1:0)}function u(t,e,r){if(!t)return 1;var n=Math.sin(t*Math.PI/180);return Math.max(.01,r*n*Math.abs(e)+2*Math.sqrt(1-n*n*e*e))}var c=t("d3"),h=t("../../plots/cartesian/graph_interact"),f=t("../../components/color"),d=t("../../components/drawing"),p=t("../../lib/svg_text_utils"),m=t("./helpers");e.exports=function(t,e){var r=t._fullLayout;s(e,r._size);var u=r._pielayer.selectAll("g.trace").data(e);u.enter().append("g").attr({"stroke-linejoin":"round",class:"trace"}),u.exit().remove(),u.order(),u.each(function(e){var s=c.select(this),u=e[0],g=u.trace,v=0,y=(g.depth||0)*u.r*Math.sin(v)/2,x=g.tiltaxis||0,b=x*Math.PI/180,_=[y*Math.sin(b),y*Math.cos(b)],w=u.r*Math.cos(v),M=s.selectAll("g.part").data(g.tilt?["top","sides"]:["top"]);M.enter().append("g").attr("class",function(t){return t+" part"}),M.exit().remove(),M.order(),l(e),s.selectAll(".top").each(function(){var s=c.select(this).selectAll("g.slice").data(e);s.enter().append("g").classed("slice",!0),s.exit().remove();var l=[[[],[]],[[],[]]],v=!1;s.each(function(o){function s(e){var n=t._fullLayout,a=t._fullData[g.index],s=a.hoverinfo;if("all"===s&&(s="label+text+value+percent+name"),!t._dragging&&n.hovermode!==!1&&"none"!==s&&"skip"!==s&&s){var l=i(o,u),c=M+o.pxmid[0]*(1-l),f=A+o.pxmid[1]*(1-l),d=r.separators,p=[];s.indexOf("label")!==-1&&p.push(o.label),a.text&&a.text[o.i]&&s.indexOf("text")!==-1&&p.push(a.text[o.i]),s.indexOf("value")!==-1&&p.push(m.formatPieValue(o.v,d)),s.indexOf("percent")!==-1&&p.push(m.formatPiePercent(o.v/u.vTotal,d)),h.loneHover({x0:c-l*u.r,x1:c+l*u.r,y:f,text:p.join("<br>"),name:s.indexOf("name")!==-1?a.name:void 0,color:o.color,idealAlign:o.pxmid[0]<0?"left":"right"},{container:n._hoverlayer.node(),outerContainer:n._paper.node()}),h.hover(t,e,"pie"),E=!0}}function f(e){t.emit("plotly_unhover",{points:[e]}),E&&(h.loneUnhover(r._hoverlayer.node()),E=!1)}function y(){t._hoverdata=[o],t._hoverdata.trace=e.trace,h.click(t,{target:!0})}function b(t,e,r,n){return"a"+n*u.r+","+n*w+" "+x+" "+o.largeArc+(r?" 1 ":" 0 ")+n*(e[0]-t[0])+","+n*(e[1]-t[1])}if(o.hidden)return void c.select(this).selectAll("path,g").remove();l[o.pxmid[1]<0?0:1][o.pxmid[0]<0?0:1].push(o);var M=u.cx+_[0],A=u.cy+_[1],k=c.select(this),T=k.selectAll("path.surface").data([o]),E=!1;if(T.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),k.select("path.textline").remove(),k.on("mouseover",s).on("mouseout",f).on("click",y),g.pull){var S=+(Array.isArray(g.pull)?g.pull[o.i]:g.pull)||0;S>0&&(M+=S*o.pxmid[0],A+=S*o.pxmid[1])}o.cxFinal=M,o.cyFinal=A;var L=g.hole;if(o.v===u.vTotal){var C="M"+(M+o.px0[0])+","+(A+o.px0[1])+b(o.px0,o.pxmid,!0,1)+b(o.pxmid,o.px0,!0,1)+"Z";L?T.attr("d","M"+(M+L*o.px0[0])+","+(A+L*o.px0[1])+b(o.px0,o.pxmid,!1,L)+b(o.pxmid,o.px0,!1,L)+"Z"+C):T.attr("d",C)}else{var I=b(o.px0,o.px1,!0,1);if(L){var z=1-L;T.attr("d","M"+(M+L*o.px1[0])+","+(A+L*o.px1[1])+b(o.px1,o.px0,!1,L)+"l"+z*o.px0[0]+","+z*o.px0[1]+I+"Z")}else T.attr("d","M"+M+","+A+"l"+o.px0[0]+","+o.px0[1]+I+"Z")}var D=Array.isArray(g.textposition)?g.textposition[o.i]:g.textposition,P=k.selectAll("g.slicetext").data(o.text&&"none"!==D?[0]:[]);P.enter().append("g").classed("slicetext",!0),P.exit().remove(),P.each(function(){var t=c.select(this).selectAll("text").data([0]);t.enter().append("text").attr("data-notex",1),t.exit().remove(),t.text(o.text).attr({class:"slicetext",transform:"","data-bb":"","text-anchor":"middle",x:0,y:0}).call(d.font,"outside"===D?g.outsidetextfont:g.insidetextfont).call(p.convertToTspans),t.selectAll("tspan.line").attr({x:0,y:0});var e,r=d.bBox(t.node());"outside"===D?e=a(r,o):(e=n(r,o,u),"auto"===D&&e.scale<1&&(t.call(d.font,g.outsidetextfont),g.outsidetextfont.family===g.insidetextfont.family&&g.outsidetextfont.size===g.insidetextfont.size||(t.attr({"data-bb":""}),r=d.bBox(t.node())),e=a(r,o)));var i=M+o.pxmid[0]*e.rCenter+(e.x||0),s=A+o.pxmid[1]*e.rCenter+(e.y||0);e.outside&&(o.yLabelMin=s-r.height/2,o.yLabelMid=s,o.yLabelMax=s+r.height/2,o.labelExtraX=0,o.labelExtraY=0,v=!0),t.attr("transform","translate("+i+","+s+")"+(e.scale<1?"scale("+e.scale+")":"")+(e.rotate?"rotate("+e.rotate+")":"")+"translate("+-(r.left+r.right)/2+","+-(r.top+r.bottom)/2+")")})}),v&&o(l,g),s.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=c.select(this),r=e.select("g.slicetext text");r.attr("transform","translate("+t.labelExtraX+","+t.labelExtraY+")"+r.attr("transform"));var n=t.cxFinal+t.pxmid[0],i=t.cyFinal+t.pxmid[1],a="M"+n+","+i,o=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var s=t.labelExtraX*t.pxmid[1]/t.pxmid[0],l=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);a+=Math.abs(s)>Math.abs(l)?"l"+l*t.pxmid[0]/t.pxmid[1]+","+l+"H"+(n+t.labelExtraX+o):"l"+t.labelExtraX+","+s+"v"+(l-s)+"h"+o}else a+="V"+(t.yLabelMid+t.labelExtraY)+"h"+o;e.append("path").classed("textline",!0).call(f.stroke,g.outsidetextfont.color).attr({"stroke-width":Math.min(2,g.outsidetextfont.size/8),d:a,fill:"none"})}})})}),setTimeout(function(){u.selectAll("tspan").each(function(){var t=c.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":558,"../../components/drawing":581,"../../lib/svg_text_utils":674,"../../plots/cartesian/graph_interact":698,"./helpers":872,d3:97}],877:[function(t,e,r){"use strict";var n=t("d3"),i=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0],r=e.trace,a=n.select(this);a.style({opacity:r.opacity}),a.selectAll(".top path.surface").each(function(t){n.select(this).call(i,t,r)})})}},{"./style_one":878,d3:97}],878:[function(t,e,r){"use strict";var n=t("../../components/color");e.exports=function(t,e,r){var i=r.marker.line.color;Array.isArray(i)&&(i=i[e.i]||n.defaultLine);var a=r.marker.line.width||0;Array.isArray(a)&&(a=a[e.i]||0),t.style({"stroke-width":a,fill:e.color}).call(n.stroke,i)}},{"../../components/color":558}],879:[function(t,e,r){"use strict";var n=t("../scattergl/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array"},indices:{valType:"data_array"},xbounds:{valType:"data_array"},ybounds:{valType:"data_array"},text:n.text,marker:{color:{valType:"color",arrayOk:!1},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1},blend:{valType:"boolean",dflt:null},sizemin:{valType:"number",min:.1,max:2,dflt:.5},sizemax:{valType:"number",min:.1,dflt:20},border:{color:{valType:"color",arrayOk:!1},arearatio:{valType:"number",min:0,max:1,dflt:0}}}}},{"../scattergl/attributes":920}],880:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=a(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}function i(t,e){var r=new n(t,e.uid);return r.update(e),r}var a=t("gl-pointcloud2d"),o=t("../../lib/str2rgbarray"),s=t("../scatter/get_trace_color"),l=["xaxis","yaxis"],u=n.prototype;u.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},u.update=function(t){this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.updateFast(t),this.color=s(t,{})},u.updateFast=function(t){var e,r,n,i,a,s,l=this.xData=this.pickXData=t.x,u=this.yData=this.pickYData=t.y,c=this.pickXYData=t.xy,h=t.xbounds&&t.ybounds,f=t.indices,d=this.bounds;if(c){if(n=c,e=c.length>>>1,h)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(s=0;s<e;s++)i=n[2*s],a=n[2*s+1],i<d[0]&&(d[0]=i),i>d[2]&&(d[2]=i),a<d[1]&&(d[1]=a),a>d[3]&&(d[3]=a);if(f)r=f;else for(r=new Int32Array(e),s=0;s<e;s++)r[s]=s}else for(e=l.length,n=new Float32Array(2*e),r=new Int32Array(e),s=0;s<e;s++)i=l[s],a=u[s],r[s]=s,n[2*s]=i,n[2*s+1]=a,i<d[0]&&(d[0]=i),i>d[2]&&(d[2]=i),a<d[1]&&(d[1]=a),a>d[3]&&(d[3]=a);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var p=o(t.marker.color),m=o(t.marker.border.color),g=t.opacity*t.marker.opacity;p[3]*=g,this.pointcloudOptions.color=p;var v=t.marker.blend;if(null===v){var y=100;v=l.length<y||u.length<y}this.pointcloudOptions.blend=v,m[3]*=g,this.pointcloudOptions.borderColor=m;var x=t.marker.sizemin,b=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=x,this.pointcloudOptions.sizeMax=b,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions),this.expandAxesFast(d,b/2)},u.expandAxesFast=function(t,e){for(var r,n,i,a=e||.5,o=0;o<2;o++)r=this.scene[l[o]],n=r._min,n||(n=[]),n.push({val:t[o],pad:a}),i=r._max,i||(i=[]),i.push({val:t[o+2],pad:a})},u.dispose=function(){this.pointcloud.dispose()},e.exports=i},{"../../lib/str2rgbarray":673,"../scatter/get_trace_color":892,"gl-pointcloud2d":203}],881:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}a("x"),a("y"),a("xbounds"),a("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),a("text"),a("marker.color",r),a("marker.opacity"),a("marker.blend"),a("marker.sizemin"),a("marker.sizemax"),a("marker.border.color",r),a("marker.border.arearatio")}},{"../../lib":658,"./attributes":879}],882:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../scatter3d/calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="pointcloud",n.basePlotModule=t("../../plots/gl2d"),n.categories=["gl2d","showLegend"],n.meta={},e.exports=n},{"../../plots/gl2d":727,"../scatter3d/calc":908,"./attributes":879,"./convert":880,"./defaults":881}],883:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){n.mergeArray(e.text,t,"tx"),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 r=e.marker;if(r){n.mergeArray(r.size,t,"ms"),n.mergeArray(r.opacity,t,"mo"),n.mergeArray(r.symbol,t,"mx"),n.mergeArray(r.color,t,"mc");var i=r.line;r.line&&(n.mergeArray(i.color,t,"mlc"),n.mergeArray(i.width,t,"mlw"))}}},{"../../lib":658}],884:[function(t,e,r){"use strict";var n=t("../../components/colorscale/color_attributes"),i=t("../../components/errorbars/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../components/drawing"),s=(t("./constants"),t("../../lib/extend").extendFlat);e.exports={x:{valType:"data_array"},x0:{valType:"any",dflt:0},dx:{valType:"number",dflt:1},y:{valType:"data_array"},y0:{valType:"any",dflt:0},dy:{valType:"number",dflt:1},ids:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},hoveron:{valType:"flaglist",flags:["points","fills"]},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear"},smoothing:{valType:"number",min:0,max:1.3,dflt:1},dash:{valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid"},simplify:{valType:"boolean",dflt:!0}},connectgaps:{valType:"boolean",dflt:!1},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],dflt:"none"},fillcolor:{valType:"color"},marker:s({},{symbol:{valType:"enumerated",values:o.symbolList,dflt:"circle",arrayOk:!0},opacity:{valType:"number",min:0,max:1,arrayOk:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0},maxdisplayed:{valType:"number",min:0,dflt:0},sizeref:{valType:"number",dflt:1},sizemin:{valType:"number",min:0,dflt:0},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter"},showscale:{valType:"boolean",dflt:!1},colorbar:a,line:s({},{width:{valType:"number",min:0,arrayOk:!0}},n("marker.line"))},n("marker")),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},textfont:{family:{valType:"string",noBlank:!0,strict:!0,arrayOk:!0},size:{valType:"number",min:1,arrayOk:!0},color:{valType:"color",arrayOk:!0}},r:{valType:"data_array"},t:{valType:"data_array"},error_y:i,error_x:i}},{"../../components/colorbar/attributes":559,"../../components/colorscale/color_attributes":565,"../../components/drawing":581,"../../components/errorbars/attributes":583,"../../lib/extend":651,"./constants":889}],885:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("./subtypes"),o=t("./colorscale_calc"),s=t("./arrays_to_calcdata");e.exports=function(t,e){var r,l,u,c=i.getFromId(t,e.xaxis||"x"),h=i.getFromId(t,e.yaxis||"y"),f=c.makeCalcdata(e,"x"),d=h.makeCalcdata(e,"y"),p=Math.min(f.length,d.length);c._minDtick=0,h._minDtick=0,f.length>p&&f.splice(p,f.length-p),d.length>p&&d.splice(p,d.length-p);var m={padded:!0},g={padded:!0};if(a.hasMarkers(e)){if(r=e.marker,l=r.size,Array.isArray(l)){var v={type:"linear"};i.setConvert(v),l=v.makeCalcdata(e.marker,"size"),l.length>p&&l.splice(p,l.length-p)}var y,x=1.6*(e.marker.sizeref||1);y="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/x),3)}:function(t){return Math.max((t||0)/x,3)},m.ppad=g.ppad=Array.isArray(l)?l.map(y):y(l)}o(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||f[0]===f[p-1]&&d[0]===d[p-1]?e.error_y.visible||["tonexty","tozeroy"].indexOf(e.fill)===-1&&(a.hasMarkers(e)||a.hasText(e))||(m.padded=!1,m.ppad=0):m.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||f[0]===f[p-1]&&d[0]===d[p-1]?["tonextx","tozerox"].indexOf(e.fill)!==-1&&(g.padded=!1):g.tozero=!0,i.expand(c,f,m),i.expand(h,d,g);var b=new Array(p);for(u=0;u<p;u++)b[u]=n(f[u])&&n(d[u])?{x:f[u],y:d[u]}:{x:!1,y:!1},e.ids&&(b[u].id=String(e.ids[u]));return s(b,e),t.firstscatter=!1,b}},{"../../plots/cartesian/axes":691,"./arrays_to_calcdata":883,"./colorscale_calc":888,"./subtypes":904,"fast-isnumeric":106}],886:[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 i=e-1;i>=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],887:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l=r.marker,u="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+u).remove(),void 0===l||!l.showscale)return void a.autoMargin(t,u);var c=l.color,h=l.cmin,f=l.cmax;n(h)||(h=i.aggNums(Math.min,null,c)),n(f)||(f=i.aggNums(Math.max,null,c));var d=e[0].t.cb=s(t,u),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,h,f),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:h,end:f,size:(f-h)/254}).options(l.colorbar)()}},{"../../components/colorbar/draw":561,"../../components/colorscale":572,"../../lib":658,"../../plots/plots":751,"fast-isnumeric":106}],888:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("./subtypes");e.exports=function(t){a.hasLines(t)&&n(t,"line")&&i(t,t.line.color,"line","c"),a.hasMarkers(t)&&(n(t,"marker")&&i(t,t.marker.color,"marker","c"),n(t,"marker.line")&&i(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":564,"../../components/colorscale/has_colorscale":571,"./subtypes":904}],889:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20}},{}],890:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("./constants"),o=t("./subtypes"),s=t("./xy_defaults"),l=t("./marker_defaults"),u=t("./line_defaults"),c=t("./line_shape_defaults"),h=t("./text_defaults"),f=t("./fillcolor_defaults"),d=t("../../components/errorbars/defaults");e.exports=function(t,e,r,p){function m(r,a){return n.coerce(t,e,i,r,a)}var g=s(t,e,p,m),v=g<a.PTS_LINESONLY?"lines+markers":"lines";if(!g)return void(e.visible=!1);m("text"),m("mode",v),m("ids"),o.hasLines(e)&&(u(t,e,r,p,m),c(t,e,m),m("connectgaps"),m("line.simplify")),o.hasMarkers(e)&&l(t,e,r,p,m),o.hasText(e)&&h(t,e,p,m);var y=[];(o.hasMarkers(e)||o.hasText(e))&&(m("marker.maxdisplayed"),y.push("points")),m("fill"),"none"!==e.fill&&(f(t,e,r,m),o.hasLines(e)||c(t,e,m)),"tonext"!==e.fill&&"toself"!==e.fill||y.push("fills"),m("hoveron",y.join("+")||"points"),d(t,e,r,{axis:"y"}),d(t,e,r,{axis:"x",inherit:"y"})}},{"../../components/errorbars/defaults":586,"../../lib":658,"./attributes":884,"./constants":889,"./fillcolor_defaults":891,"./line_defaults":895,"./line_shape_defaults":897,"./marker_defaults":900,"./subtypes":904,"./text_defaults":905,"./xy_defaults":906}],891:[function(t,e,r){"use strict";var n=t("../../components/color");e.exports=function(t,e,r,i){var a=!1;if(e.marker){var o=e.marker.color,s=(e.marker.line||{}).color;o&&!Array.isArray(o)?a=o:s&&!Array.isArray(s)&&(a=s)}i("fillcolor",n.addOpacity((e.line||{}).color||a||r,.5))}},{"../../components/color":558}],892:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("./subtypes");e.exports=function(t,e){var r,a;if("lines"===t.mode)return r=t.line.color,r&&n.opacity(r)?r:t.fillcolor;if("none"===t.mode)return t.fill?t.fillcolor:"";var o=e.mcc||(t.marker||{}).color,s=e.mlcc||((t.marker||{}).line||{}).color;return a=o&&n.opacity(o)?o:s&&n.opacity(s)&&(e.mlw||((t.marker||{}).line||{}).width)?s:"",a?n.opacity(a)<.3?n.addOpacity(a,.3):a:(r=(t.line||{}).color,r&&n.opacity(r)&&i.hasLines(t)&&t.line.width?r:t.fillcolor)}},{"../../components/color":558,"./subtypes":904}],893:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/graph_interact"),a=t("../../plots/cartesian/constants"),o=t("../../components/errorbars"),s=t("./get_trace_color"),l=t("../../components/color");e.exports=function(t,e,r,u){var c=t.cd,h=c[0].trace,f=t.xa,d=t.ya,p=f.c2p(e),m=d.c2p(r),g=[p,m];if(h.hoveron.indexOf("points")!==-1){var v=function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(f.c2p(t.x)-p)-e,1-3/e)},y=function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(d.c2p(t.y)-m)-e,1-3/e)},x=function(t){var e=Math.max(3,t.mrc||0),r=f.c2p(t.x)-p,n=d.c2p(t.y)-m;return Math.max(Math.sqrt(r*r+n*n)-e,1-3/e)},b=i.getDistanceFunction(u,v,y,x);if(i.getClosest(c,b,t),t.index!==!1){var _=c[t.index],w=f.c2p(_.x,!0),M=d.c2p(_.y,!0),A=_.mrc||1;return n.extendFlat(t,{color:s(h,_),x0:w-A,x1:w+A,xLabelVal:_.x,y0:M-A,y1:M+A,yLabelVal:_.y}),_.tx?t.text=_.tx:h.text&&(t.text=h.text),o.hoverInfo(_,h,t),[t]}}if(h.hoveron.indexOf("fills")!==-1&&h._polygons){var k,T,E,S,L,C,I,z,D,P=h._polygons,O=[],R=!1,F=1/0,j=-(1/0),N=1/0,B=-(1/0);for(k=0;k<P.length;k++)E=P[k],E.contains(g)&&(R=!R,O.push(E),N=Math.min(N,E.ymin),B=Math.max(B,E.ymax));if(R){N=Math.max(N,0),B=Math.min(B,d._length);var U=(N+B)/2;for(k=0;k<O.length;k++)for(S=O[k].pts,T=1;T<S.length;T++)z=S[T-1][1],D=S[T][1],z>U!=D>=U&&(C=S[T-1][0],I=S[T][0],L=C+(I-C)*(U-z)/(D-z),F=Math.min(F,L),j=Math.max(j,L));F=Math.max(F,0),j=Math.min(j,f._length);var V=l.defaultLine;return l.opacity(h.fillcolor)?V=h.fillcolor:l.opacity((h.line||{}).color)&&(V=h.line.color),n.extendFlat(t,{distance:a.MAXDIST+10,x0:F,x1:j,y0:U,y1:U,color:V}),delete t.index,h.text&&!Array.isArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}},{"../../components/color":558,"../../components/errorbars":587,"../../lib":658,"../../plots/cartesian/constants":696,"../../plots/cartesian/graph_interact":698,"./get_trace_color":892}],894:[function(t,e,r){"use strict";var n={},i=t("./subtypes");n.hasLines=i.hasLines,n.hasMarkers=i.hasMarkers,n.hasText=i.hasText,n.isBubble=i.isBubble,n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.cleanData=t("./clean_data"),n.calc=t("./calc"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style"),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","symbols","markerColorscale","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":699,"./arrays_to_calcdata":883,"./attributes":884,"./calc":885,"./clean_data":886,"./colorbar":887,"./defaults":890,"./hover":893,"./plot":901,"./select":902,"./style":903,"./subtypes":904}],895:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,a,o){var s=(t.marker||{}).color;if(o("line.color",r),n(t,"line"))i(t,e,a,o,{prefix:"line.",cLetter:"c"});else{var l=!Array.isArray(s)&&s||r;o("line.color",l)}o("line.width"),o("line.dash")}},{"../../components/colorscale/defaults":567,"../../components/colorscale/has_colorscale":571}],896:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM;e.exports=function(t,e){function r(e){var r=w.c2p(t[e].x),i=M.c2p(t[e].y);return r!==n&&i!==n&&[r,i]}function i(t){var e=t[0]/w._length,r=t[1]/M._length;return(1+10*Math.max(0,-e,e-1,-r,r-1))*T}function a(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}var o,s,l,u,c,h,f,d,p,m,g,v,y,x,b,_,w=e.xaxis,M=e.yaxis,A=e.simplify,k=e.connectGaps,T=e.baseTolerance,E=e.linear,S=[],L=.2,C=new Array(t.length),I=0;for(A||(T=L=-1),o=0;o<t.length;o++)if(s=r(o)){for(I=0,C[I++]=s,o++;o<t.length;o++){if(u=r(o),!u){if(k)continue;break}if(E){if(f=a(u,s),!(f<i(u)*L)){for(p=[(u[0]-s[0])/f,(u[1]-s[1])/f],c=s,g=f,v=x=b=0,d=!1,l=u,o++;o<t.length;o++){if(h=r(o),!h){if(k)continue;break}if(m=[h[0]-s[0],h[1]-s[1]],_=m[0]*p[1]-m[1]*p[0],x=Math.min(x,_),b=Math.max(b,_),b-x>i(h))break;l=h,y=m[0]*p[0]+m[1]*p[1],y>g?(g=y,u=h,d=!1):y<v&&(v=y,c=h,d=!0)}if(d?(C[I++]=u,l!==c&&(C[I++]=c)):(c!==s&&(C[I++]=c),l!==u&&(C[I++]=u)),C[I++]=l,o>=t.length||!h)break;C[I++]=h,s=h}}else C[I++]=u}S.push(C.slice(0,I))}return S}},{"../../constants/numerical":641}],897:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=r("line.shape");"spline"===n&&r("line.smoothing")}},{}],898:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,i,a=null,o=0;o<r.length;++o)n=r[o],i=n[0].trace,i.visible===!0?(i._nexttrace=null,["tonextx","tonexty","tonext"].indexOf(i.fill)!==-1&&(i._prevtrace=a,a&&(a._nexttrace=i)),a=i):i._prevtrace=i._nexttrace=null}},{}],899:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t){var e=t.marker,r=e.sizeref||1,i=e.sizemin||0,a="area"===e.sizemode?function(t){return Math.sqrt(t/r)}:function(t){return t/r};return function(t){var e=a(t/2);return n(e)&&e>0?Math.max(e,i):0}}},{"fast-isnumeric":106}],900:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l){var u,c=o.isBubble(t),h=(t.line||{}).color;h&&(r=h),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u=h&&!Array.isArray(h)&&e.marker.color!==h?h:c?n.background:n.defaultLine,l("marker.line.color",u),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode"))}},{"../../components/color":558,"../../components/colorscale/defaults":567,"../../components/colorscale/has_colorscale":571,"./subtypes":904}],901:[function(t,e,r){"use strict";function n(t,e){var r;e.selectAll("g.trace").each(function(t){var e=o.select(this);if(r=t[0].trace,r._nexttrace){if(r._nextFill=e.select(".js-fill.js-tonext"),!r._nextFill.size()){var n=":first-child";e.select(".js-fill.js-tozero").size()&&(n+=" + *"),r._nextFill=e.insert("path",n).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),r._nextFill=null;r.fill&&("tozero"===r.fill.substr(0,6)||"toself"===r.fill||"to"===r.fill.substr(0,2)&&!r._prevtrace)?(r._ownFill=e.select(".js-fill.js-tozero"),r._ownFill.size()||(r._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),r._ownFill=null)})}function i(t,e,r,n,i,f,p){function m(t){return M?t.transition():t}function g(t){return t.filter(function(t){return t.vis})}function v(t){return t.id}function y(t){if(t.ids)return v}function x(){return!1}function b(t){var e,r,n=t[0].trace,i=o.select(this),a=c.hasMarkers(n),u=c.hasText(n),h=y(n),f=x,d=x;a&&(f=n.marker.maxdisplayed?g:s.identity),u&&(d=n.marker.maxdisplayed?g:s.identity),r=i.selectAll("path.point"),e=r.data(f,h);var p=e.enter().append("path").classed("point",!0);p.call(l.pointStyle,n).call(l.translatePoints,A,k,n),M&&p.style("opacity",0).transition().style("opacity",1),e.each(function(t){var e=m(o.select(this));l.translatePoint(t,e,A,k),l.singlePointStyle(t,e,n)}),M?e.exit().transition().style("opacity",0).remove():e.exit().remove(),r=i.selectAll("g"),e=r.data(d,h),e.enter().append("g").append("text"),e.each(function(t){var e=m(o.select(this).select("text"));l.translatePoint(t,e,A,k)}),e.selectAll("text").call(l.textPointStyle,n).each(function(t){var e=t.xp||A.c2p(t.x),r=t.yp||k.c2p(t.y);o.select(this).selectAll("tspan").each(function(){m(o.select(this)).attr({x:e,y:r})})}),e.exit().remove()}var _,w;a(t,e,r,n,i);var M=!!p&&p.duration>0,A=r.xaxis,k=r.yaxis,T=n[0].trace,E=T.line,S=o.select(f);if(S.call(u.plot,r,p),T.visible===!0){m(S).style("opacity",T.opacity);var L,C,I=T.fill.charAt(T.fill.length-1);"x"!==I&&"y"!==I&&(I=""),n[0].node3=S;var z="",D=[],P=T._prevtrace;P&&(z=P._prevRevpath||"",C=P._nextFill,D=P._polygons);var O,R,F,j,N,B,U,V,q,H="",Y="",G=[],X=[],W=s.noop;if(L=T._ownFill,c.hasLines(T)||"none"!==T.fill){for(C&&C.datum(n),["hv","vh","hvh","vhv"].indexOf(E.shape)!==-1?(F=l.steps(E.shape),j=l.steps(E.shape.split("").reverse().join(""))):F=j="spline"===E.shape?function(t){var e=t[t.length-1];return t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),E.smoothing):l.smoothopen(t,E.smoothing)}:function(t){return"M"+t.join("L")},N=function(t){return j(t.reverse())},G=h(n,{xaxis:A,yaxis:k,connectGaps:T.connectgaps,baseTolerance:Math.max(E.width||1,3)/4,linear:"linear"===E.shape,simplify:E.simplify}),q=T._polygons=new Array(G.length),w=0;w<G.length;w++)T._polygons[w]=d(G[w]);G.length&&(B=G[0][0],U=G[G.length-1],V=U[U.length-1]),X=G.filter(function(t){return t.length>1}),W=function(t){return function(e){if(O=F(e),R=N(e),H?I?(H+="L"+O.substr(1),Y=R+("L"+Y.substr(1))):(H+="Z"+O,Y=R+"Z"+Y):(H=O,Y=R),c.hasLines(T)&&e.length>1){var r=o.select(this);if(r.datum(n),t)m(r.style("opacity",0).attr("d",O).call(l.lineGroupStyle)).style("opacity",1);else{var i=m(r);i.attr("d",O),l.singleLineStyle(n,i)}}}}}var Z=S.selectAll(".js-line").data(X);m(Z.exit()).style("opacity",0).remove(),Z.each(W(!1)),Z.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(W(!0)),G.length&&(L?B&&V&&(I?("y"===I?B[1]=V[1]=k.c2p(0,!0):"x"===I&&(B[0]=V[0]=A.c2p(0,!0)),m(L).attr("d","M"+V+"L"+B+"L"+H.substr(1))):m(L).attr("d",H+"Z")):"tonext"===T.fill.substr(0,6)&&H&&z&&("tonext"===T.fill?m(C).attr("d",H+"Z"+z+"Z"):m(C).attr("d",H+"L"+z.substr(1)+"Z"),T._polygons=T._polygons.concat(D)),T._prevRevpath=Y,T._prevPolygons=q);var J=S.selectAll(".points");_=J.data([n]),J.each(b),_.enter().append("g").classed("points",!0).each(b),_.exit().remove()}}function a(t,e,r,n,i){var a=r.xaxis,l=r.yaxis,u=o.extent(s.simpleMap(a.range,a.r2c)),h=o.extent(s.simpleMap(l.range,l.r2c)),f=n[0].trace;if(c.hasMarkers(f)){var d=f.marker.maxdisplayed;if(0!==d){var p=n.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=h[0]&&t.y<=h[1]}),m=Math.ceil(p.length/d),g=0;i.forEach(function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r<e&&g++});var v=Math.round(g*m/3+Math.floor(g/3)*m/7.1);n.forEach(function(t){delete t.vis}),p.forEach(function(t,e){0===Math.round((e+v)%m)&&(t.vis=!0)})}}}var o=t("d3"),s=t("../../lib"),l=t("../../components/drawing"),u=t("../../components/errorbars"),c=t("./subtypes"),h=t("./line_points"),f=t("./link_traces"),d=t("../../lib/polygon").tester;e.exports=function(t,e,r,a,s){var l,u,c,h,d,p=e.plot.select("g.scatterlayer"),m=!a,g=!!a&&a.duration>0;for(c=p.selectAll("g.trace"),h=c.data(r,function(t){return t[0].trace.uid}),h.enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),f(t,e,r),n(t,p),l=0,u=[];l<r.length;l++)u[l]=r[l][0].trace.uid;if(p.selectAll("g.trace").sort(function(t,e){var r=u.indexOf(t[0].trace.uid),n=u.indexOf(e[0].trace.uid);return r>n?1:-1}),g){s&&(d=s());var v=o.transition().duration(a.duration).ease(a.easing).each("end",function(){d&&d()}).each("interrupt",function(){d&&d()});v.each(function(){p.selectAll("g.trace").each(function(n,o){i(t,o,e,n,r,this,a)})})}else p.selectAll("g.trace").each(function(n,o){i(t,o,e,n,r,this,a)});m&&h.exit().remove(),p.selectAll("path:not([d])").remove()}},{"../../components/drawing":581,"../../components/errorbars":587,"../../lib":658,"../../lib/polygon":667,"./line_points":896,"./link_traces":898,"./subtypes":904,d3:97}],902:[function(t,e,r){"use strict";var n=t("./subtypes"),i=.2;e.exports=function(t,e){var r,a,o,s,l=t.cd,u=t.xaxis,c=t.yaxis,h=[],f=l[0].trace,d=f.index,p=f.marker,m=!n.hasMarkers(f)&&!n.hasText(f);if(f.visible===!0&&!m){var g=Array.isArray(p.opacity)?1:p.opacity;if(e===!1)for(r=0;r<l.length;r++)l[r].dim=0;else for(r=0;r<l.length;r++)a=l[r],o=u.c2p(a.x),s=c.c2p(a.y),e.contains([o,s])?(h.push({curveNumber:d,pointNumber:r,x:a.x,y:a.y,id:a.id}),a.dim=0):a.dim=1;return l[0].node3.selectAll("path.point").style("opacity",function(t){return((t.mo+1||g+1)-1)*(t.dim?i:1)}),l[0].node3.selectAll("text").style("opacity",function(t){return t.dim?i:1}),h}}},{"./subtypes":904}],903:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/drawing"),a=t("../../components/errorbars");e.exports=function(t){var e=n.select(t).selectAll("g.trace.scatter");e.style("opacity",function(t){return t[0].trace.opacity}),e.selectAll("g.points").each(function(t){n.select(this).selectAll("path.point").call(i.pointStyle,t.trace||t[0].trace),n.select(this).selectAll("text").call(i.textPointStyle,t.trace||t[0].trace)}),e.selectAll("g.trace path.js-line").call(i.lineGroupStyle),e.selectAll("g.trace path.js-fill").call(i.fillGroupStyle),e.call(a.style)}},{"../../components/drawing":581,"../../components/errorbars":587,d3:97}],904:[function(t,e,r){"use strict";var n=t("../../lib");e.exports={hasLines:function(t){return t.visible&&t.mode&&t.mode.indexOf("lines")!==-1},hasMarkers:function(t){return t.visible&&t.mode&&t.mode.indexOf("markers")!==-1},hasText:function(t){return t.visible&&t.mode&&t.mode.indexOf("text")!==-1},isBubble:function(t){return n.isPlainObject(t.marker)&&Array.isArray(t.marker.size)}}},{"../../lib":658}],905:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,i){i("textposition"),n.coerceFont(i,"textfont",r.font)}},{"../../lib":658}],906:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,i){var a,o=i("x"),s=i("y"),l=n.getComponentMethod("calendars","handleTraceDefaults");if(l(t,e,["x","y"],r),o)s?(a=Math.min(o.length,s.length),a<o.length&&(e.x=o.slice(0,a)),a<s.length&&(e.y=s.slice(0,a))):(a=o.length,i("y0"),i("dy"));else{if(!s)return 0;a=e.y.length,i("x0"),i("dx")}return a}},{"../../registry":766}],907:[function(t,e,r){"use strict";function n(t){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var i=t("../scatter/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/errorbars/attributes"),s=t("../../constants/gl_markers"),l=t("../../lib/extend").extendFlat,u=i.line,c=i.marker,h=c.line;e.exports={x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},text:l({},i.text,{}),mode:l({},i.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:n("x"),y:n("y"),z:n("z")},connectgaps:i.connectgaps,line:l({},{width:u.width,dash:u.dash,showscale:{valType:"boolean",dflt:!1}},a("line")),marker:l({},{symbol:{valType:"enumerated",values:Object.keys(s),dflt:"circle",arrayOk:!0},size:l({},c.size,{dflt:8}),sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,opacity:l({},c.opacity,{arrayOk:!1}),showscale:c.showscale,colorbar:c.colorbar,line:l({},{width:l({},h.width,{arrayOk:!1})},a("marker.line"))},a("marker")),textposition:l({},i.textposition,{dflt:"top center"}),textfont:i.textfont,error_x:o,error_y:o,error_z:o}},{"../../components/colorscale/color_attributes":565,"../../components/errorbars/attributes":583,"../../constants/gl_markers":640,"../../lib/extend":651,"../scatter/attributes":884}],908:[function(t,e,r){"use strict";var n=t("../scatter/arrays_to_calcdata"),i=t("../scatter/colorscale_calc");e.exports=function(t,e){var r=[{x:!1,y:!1,trace:e,t:{}}];return n(r,e),i(e),r}},{"../scatter/arrays_to_calcdata":883,"../scatter/colorscale_calc":888}],909:[function(t,e,r){"use strict";function n(t,e,r){if(!e||!e.visible)return null;for(var n=o(e),i=new Array(t.length),a=0;a<t.length;a++){var s=n(+t[a],a);i[a]=[-s[0]*r,s[1]*r]}return i}function i(t){for(var e=0;e<t.length;e++)if(t[e])return t[e].length;return 0}function a(t,e){var r=[n(t.x,t.error_x,e[0]),n(t.y,t.error_y,e[1]),n(t.z,t.error_z,e[2])],a=i(r);if(0===a)return null;for(var o=new Array(a),s=0;s<a;s++){for(var l=[[0,0,0],[0,0,0]],u=0;u<3;u++)if(r[u])for(var c=0;c<2;c++)l[c][u]=r[u][s][c];o[s]=l}return o}var o=t("../../components/errorbars/compute_error");e.exports=a},{"../../components/errorbars/compute_error":585}],910:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode="",this.dataPoints=[],this.axesBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}function i(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],s=[];for(n=0;n<t.length;++n){var l=t[n];!isNaN(l[i])&&isFinite(l[i])&&!isNaN(l[a])&&isFinite(l[a])&&(o.push([l[i],l[a]]),s.push(n))}var u=v(o);for(n=0;n<u.length;++n)for(var c=u[n],h=0;h<c.length;++h)c[h]=s[c[h]];return{positions:t,cells:u,meshColor:e}}function a(t){for(var e=[0,0,0],r=[[0,0,0],[0,0,0],[0,0,0]],n=[0,0,0],i=0;i<3;i++){var a=t[i];a&&a.copy_zstyle!==!1&&(a=t[2]),a&&(e[i]=a.width/2,r[i]=x(a.color),n=a.thickness)}return{capSize:e,color:r,lineWidth:n}}function o(t){var e=[0,0];return Array.isArray(t)?[0,-1]:(t.indexOf("bottom")>=0&&(e[1]+=1),t.indexOf("top")>=0&&(e[1]-=1),t.indexOf("left")>=0&&(e[0]-=1),t.indexOf("right")>=0&&(e[0]+=1),e)}function s(t,e){return e(4*t)}function l(t){return M[t]}function u(t,e,r,n,i){var a=null;if(Array.isArray(t)){a=[];for(var o=0;o<e;o++)void 0===t[o]?a[o]=n:a[o]=r(t[o],i)}else a=r(t,y.identity);return a}function c(t,e){var r,n,i,c,h,f,d=[],p=t.fullSceneLayout,m=t.dataScale,g=p.xaxis,v=p.yaxis,w=p.zaxis,M=e.marker,k=e.line,T=e.x||[],E=e.y||[],S=e.z||[],L=T.length,C=e.xcalendar,I=e.ycalendar,z=e.zcalendar;for(n=0;n<L;n++)i=g.d2l(T[n],0,C)*m[0],c=v.d2l(E[n],0,I)*m[1],h=w.d2l(S[n],0,z)*m[2],d[n]=[i,c,h];if(Array.isArray(e.text))f=e.text;else if(void 0!==e.text)for(f=new Array(L),n=0;n<L;n++)f[n]=e.text;if(r={position:d,mode:e.mode,text:f},"line"in e&&(r.lineColor=b(k,1,L),r.lineWidth=k.width,r.lineDashes=k.dash),"marker"in e){var D=_(e);r.scatterColor=b(M,1,L),r.scatterSize=u(M.size,L,s,20,D),r.scatterMarker=u(M.symbol,L,l,"●"),r.scatterLineWidth=M.line.width,r.scatterLineColor=b(M.line,1,L),r.scatterAngle=0}"textposition"in e&&(r.textOffset=o(e.textposition),r.textColor=b(e.textfont,1,L),r.textSize=u(e.textfont.size,L,y.identity,12),r.textFont=e.textfont.family,r.textAngle=0);var P=["x","y","z"];for(r.project=[!1,!1,!1],r.projectScale=[1,1,1],r.projectOpacity=[1,1,1],n=0;n<3;++n){var O=e.projection[P[n]];(r.project[n]=O.show)&&(r.projectOpacity[n]=O.opacity,r.projectScale[n]=O.scale)}r.errorBounds=A(e,m);var R=a([e.error_x,e.error_y,e.error_z]);return r.errorColor=R.color,r.errorLineWidth=R.lineWidth,r.errorCapSize=R.capSize,r.delaunayAxis=e.surfaceaxis,r.delaunayColor=x(e.surfacecolor),r}function h(t){if(Array.isArray(t)){var e=t[0];return Array.isArray(e)&&(t=e),"rgb("+t.slice(0,3).map(function(t){return Math.round(255*t)})+")"}return null}function f(t,e){var r=new n(t,e.uid);return r.update(e),r}var d=t("gl-line3d"),p=t("gl-scatter3d"),m=t("gl-error3d"),g=t("gl-mesh3d"),v=t("delaunay-triangulate"),y=t("../../lib"),x=t("../../lib/str2rgbarray"),b=t("../../lib/gl_format_color"),_=t("../scatter/make_bubble_size_func"),w=t("../../constants/gl3d_dashes"),M=t("../../constants/gl_markers"),A=t("./calc_errors"),k=n.prototype;k.handlePick=function(t){if(t.object&&(t.object===this.linePlot||t.object===this.delaunayMesh||t.object===this.textMarkers||t.object===this.scatterPlot)){t.object.highlight&&t.object.highlight(null),this.scatterPlot&&(t.object=this.scatterPlot,this.scatterPlot.highlight(t.data)),this.textLabels&&void 0!==this.textLabels[t.data.index]?t.textLabel=this.textLabels[t.data.index]:t.textLabel="";var e=t.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},k.update=function(t){var e,r,n,a,o=this.scene.glplot.gl,s=w.solid;this.data=t;var l=c(this.scene,t);"mode"in l&&(this.mode=l.mode),"lineDashes"in l&&l.lineDashes in w&&(s=w[l.lineDashes]),this.color=h(l.scatterColor)||h(l.lineColor),this.dataPoints=l.position,e={gl:o,position:l.position,color:l.lineColor,lineWidth:l.lineWidth||1,dashes:s[0],dashScale:s[1],opacity:t.opacity,connectGaps:t.connectgaps},this.mode.indexOf("lines")!==-1?this.linePlot?this.linePlot.update(e):(this.linePlot=d(e),this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var u=t.opacity;if(t.marker&&t.marker.opacity&&(u*=t.marker.opacity),r={gl:o,position:l.position,color:l.scatterColor,size:l.scatterSize,glyph:l.scatterMarker,opacity:u,orthographic:!0,lineWidth:l.scatterLineWidth,lineColor:l.scatterLineColor,project:l.project,projectScale:l.projectScale,projectOpacity:l.projectOpacity},this.mode.indexOf("markers")!==-1?this.scatterPlot?this.scatterPlot.update(r):(this.scatterPlot=p(r),this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),a={gl:o,position:l.position,glyph:l.text,color:l.textColor,size:l.textSize,angle:l.textAngle,alignment:l.textOffset,font:l.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:t.opacity},this.textLabels=l.text,this.mode.indexOf("text")!==-1?this.textMarkers?this.textMarkers.update(a):(this.textMarkers=p(a),this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),n={gl:o,position:l.position,color:l.errorColor,error:l.errorBounds,lineWidth:l.errorLineWidth,capSize:l.errorCapSize,opacity:t.opacity},this.errorBars?l.errorBounds?this.errorBars.update(n):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):l.errorBounds&&(this.errorBars=m(n),this.scene.glplot.add(this.errorBars)),l.delaunayAxis>=0){var f=i(l.position,l.delaunayColor,l.delaunayAxis);f.opacity=t.opacity,this.delaunayMesh?this.delaunayMesh.update(f):(f.gl=o,this.delaunayMesh=g(f),this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},k.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())},e.exports=f},{"../../constants/gl3d_dashes":639,"../../constants/gl_markers":640,"../../lib":658,"../../lib/gl_format_color":656,"../../lib/str2rgbarray":673,"../scatter/make_bubble_size_func":899,"./calc_errors":909,"delaunay-triangulate":98,"gl-error3d":135,"gl-line3d":145,"gl-mesh3d":178,"gl-scatter3d":221}],911:[function(t,e,r){"use strict";function n(t,e,r,n){var a=0,o=r("x"),s=r("y"),l=r("z"),u=i.getComponentMethod("calendars","handleTraceDefaults");return u(t,e,["x","y","z"],n),o&&s&&l&&(a=Math.min(o.length,s.length,l.length),a<o.length&&(e.x=o.slice(0,a)),a<s.length&&(e.y=s.slice(0,a)),a<l.length&&(e.z=l.slice(0,a))),a}var i=t("../../registry"),a=t("../../lib"),o=t("../scatter/subtypes"),s=t("../scatter/marker_defaults"),l=t("../scatter/line_defaults"),u=t("../scatter/text_defaults"),c=t("../../components/errorbars/defaults"),h=t("./attributes");e.exports=function(t,e,r,i){function f(r,n){return a.coerce(t,e,h,r,n)}var d=n(t,e,f,i);if(!d)return void(e.visible=!1);f("text"),f("mode"),o.hasLines(e)&&(f("connectgaps"),l(t,e,r,i,f)),o.hasMarkers(e)&&s(t,e,r,i,f),o.hasText(e)&&u(t,e,i,f);var p=(e.line||{}).color,m=(e.marker||{}).color;f("surfaceaxis")>=0&&f("surfacecolor",p||m);for(var g=["x","y","z"],v=0;v<3;++v){var y="projection."+g[v];f(y+".show")&&(f(y+".opacity"),f(y+".scale"))}c(t,e,r,{axis:"z"}),c(t,e,r,{axis:"y",inherit:"z"}),c(t,e,r,{axis:"x",inherit:"z"})}},{"../../components/errorbars/defaults":586,"../../lib":658,"../../registry":766,"../scatter/line_defaults":895,"../scatter/marker_defaults":900,"../scatter/subtypes":904,"../scatter/text_defaults":905,"./attributes":907}],912:[function(t,e,r){"use strict";var n={};n.plot=t("./convert"),n.attributes=t("./attributes"),n.markerSymbols=t("../../constants/gl_markers"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.moduleType="trace",n.name="scatter3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../constants/gl_markers":640,"../../plots/gl3d":730,"../scatter/colorbar":887,"./attributes":907,"./calc":908,"./convert":910,"./defaults":911}],913:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../lib/extend").extendFlat,s=n.marker,l=n.line,u=s.line;e.exports={lon:{valType:"data_array"},lat:{valType:"data_array"},locations:{valType:"data_array"},locationmode:{valType:"enumerated",values:["ISO-3","USA-states","country names"],dflt:"ISO-3"},mode:o({},n.mode,{dflt:"markers"}),text:o({},n.text,{}),textfont:n.textfont,textposition:n.textposition,line:{color:l.color,width:l.width,dash:l.dash},connectgaps:n.connectgaps,marker:o({},{symbol:s.symbol,opacity:s.opacity,size:s.size,sizeref:s.sizeref,sizemin:s.sizemin,sizemode:s.sizemode,showscale:s.showscale,colorbar:s.colorbar,line:o({},{width:u.width},a("marker.line"))},a("marker")),fill:{valType:"enumerated",values:["none","toself"],dflt:"none"},fillcolor:n.fillcolor,hoverinfo:o({},i.hoverinfo,{flags:["lon","lat","location","text","name"]})}},{"../../components/colorscale/color_attributes":565,"../../lib/extend":651,"../../plots/attributes":689,"../scatter/attributes":884}],914:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../scatter/colorscale_calc");e.exports=function(t,e){for(var r=Array.isArray(e.locations),a=r?e.locations.length:e.lon.length,o=[],s=0,l=0;l<a;l++){var u,c={};if(r){var h=e.locations[l];c.loc=h,u="string"!=typeof h}else{var f=e.lon[l],d=e.lat[l];c.lonlat=[+f,+d],u=!n(f)||!n(d)}u?s>0&&(o[s-1].gapAfter=!0):(s++,o.push(c))}return i(e),o}},{"../scatter/colorscale_calc":888,"fast-isnumeric":106}],915:[function(t,e,r){"use strict";function n(t,e,r){var n,i,a=0,o=r("locations");return o?(r("locationmode"),a=o.length):(n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length),a<n.length&&(e.lon=n.slice(0,a)),a<i.length&&(e.lat=i.slice(0,a)),a)}var i=t("../../lib"),a=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/text_defaults"),u=t("../scatter/fillcolor_defaults"),c=t("./attributes");e.exports=function(t,e,r,h){function f(r,n){return i.coerce(t,e,c,r,n)}var d=n(t,e,f);return d?(f("text"),f("mode"),a.hasLines(e)&&(s(t,e,r,h,f),f("connectgaps")),a.hasMarkers(e)&&o(t,e,r,h,f),a.hasText(e)&&l(t,e,h,f),f("fill"),"none"!==e.fill&&u(t,e,r,f),void f("hoverinfo",1===h._dataLength?"lon+lat+location+text":void 0)):void(e.visible=!1)}},{"../../lib":658,"../scatter/fillcolor_defaults":891,"../scatter/line_defaults":895,"../scatter/marker_defaults":900,"../scatter/subtypes":904,"../scatter/text_defaults":905,"./attributes":913}],916:[function(t,e,r){"use strict";e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.location=e.lon?e.lon:null,t}},{}],917:[function(t,e,r){"use strict";function n(t,e,r){function n(t){return a.tickText(r,r.c2l(t),"hover").text+"°"}var i=t.hoverinfo,o="all"===i?s.hoverinfo.flags:i.split("+"),l=o.indexOf("location")!==-1&&Array.isArray(t.locations),u=o.indexOf("lon")!==-1,c=o.indexOf("lat")!==-1,h=o.indexOf("text")!==-1,f=[];if(l?f.push(e.loc):u&&c?f.push("("+n(e.lonlat[0])+", "+n(e.lonlat[1])+")"):u?f.push("lon: "+n(e.lonlat[0])):c&&f.push("lat: "+n(e.lonlat[1])),h){var d=e.tx||t.text;Array.isArray(d)||f.push(d)}return f.join("<br>")}var i=t("../../plots/cartesian/graph_interact"),a=t("../../plots/cartesian/axes"),o=t("../scatter/get_trace_color"),s=t("./attributes");e.exports=function(t){function e(t){return c.projection(t)}function r(t){var r=t.lonlat;if(null===r[0]||null===r[1])return 1/0;if(c.isLonLatOverEdges(r))return 1/0;var n=e(r),i=l.c2p(),a=u.c2p(),o=Math.abs(i-n[0]),s=Math.abs(a-n[1]),h=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(o*o+s*s)-h,1-3/h)}var a=t.cd,s=a[0].trace,l=t.xa,u=t.ya,c=t.subplot;if(!a[0].placeholder&&(i.getClosest(a,r,t),t.index!==!1)){var h=a[t.index],f=h.lonlat,d=e(f),p=h.mrc||1;return t.x0=d[0]-p,t.x1=d[0]+p,t.y0=d[1]-p,t.y1=d[1]+p,t.loc=h.loc,t.lat=f[0],t.lon=f[1],t.color=o(s,h),t.extraText=n(s,h,c.mockAxis),[t]}}},{"../../plots/cartesian/axes":691,"../../plots/cartesian/graph_interact":698,"../scatter/get_trace_color":892,"./attributes":913}],918:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="scattergeo",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../plots/geo":715,"../scatter/colorbar":887,"./attributes":913,"./calc":914,"./defaults":915,"./event_data":916,"./hover":917,"./plot":919}],919:[function(t,e,r){"use strict";function n(t,e){if(!Array.isArray(t.locations))return u.identity;var r=c(t,e),n=t.locationmode;return function(t){var e=h(n,t.loc,r);return e?(t.lonlat=e.properties.ct,t):(t.lonlat=[null,null],!1)}}function i(t,e,r){function n(t,n){d(t,e,n,r)}var i=t.marker;if(n(t.text,"tx"),n(t.textposition,"tp"),t.textfont&&(n(t.textfont.size,"ts"),n(t.textfont.color,"tc"),n(t.textfont.family,"tf")),i&&i.line){var a=i.line;n(i.opacity,"mo"),n(i.symbol,"mx"),n(i.color,"mc"),n(i.size,"ms"),n(a.color,"mlc"),n(a.width,"mlw")}}function a(t){var e=t.framework.selectAll("g.trace.scattergeo");e.style("opacity",function(t){return t[0].trace.opacity}),e.each(function(t){var e=t[0].trace,r=o.select(this);r.selectAll("path.point").call(s.pointStyle,e),r.selectAll("text").call(s.textPointStyle,e)}),e.selectAll("path.js-line").style("fill","none").each(function(t){var e=o.select(this),r=t.trace,n=r.line||{};e.call(l.stroke,n.color).call(s.dashLine,n.dash||"",n.width||0),"none"!==r.fill&&e.call(l.fill,r.fillcolor)})}var o=t("d3"),s=t("../../components/drawing"),l=t("../../components/color"),u=t("../../lib"),c=t("../../lib/topojson_utils").getTopojsonFeatures,h=t("../../lib/geo_location_utils").locationToFeature,f=t("../../lib/geojson_utils"),d=t("../../lib/array_to_calc_item"),p=t("../scatter/subtypes");e.exports=function(t,e){function r(t){return t[0].trace.uid}var s=t.framework.select(".scattergeolayer").selectAll("g.trace.scattergeo").data(e,r);s.enter().append("g").attr("class","trace scattergeo"),s.exit().remove(),s.selectAll("*").remove(),s.each(function(e){var r=o.select(this),a=e[0].trace,s=n(a,t.topojson);e[0].placeholder&&r.remove();for(var l=[],u=0;u<e.length;u++){var c=s(e[u]);c&&(i(a,e[u],u),l.push(c))}if(p.hasLines(a)||"none"!==a.fill){var h=f.calcTraceToLineCoords(l),d="none"!==a.fill?f.makePolygon(h,a):f.makeLine(h,a);r.selectAll("path.js-line").data([d]).enter().append("path").classed("js-line",!0)}p.hasMarkers(a)&&r.selectAll("path.point").data(l).enter().append("path").classed("point",!0),p.hasText(a)&&r.selectAll("g").data(l).enter().append("g").append("text")}),a(t)}},{"../../components/color":558,"../../components/drawing":581,"../../lib":658,"../../lib/array_to_calc_item":646,"../../lib/geo_location_utils":654,"../../lib/geojson_utils":655,"../../lib/topojson_utils":675,"../scatter/subtypes":904,d3:97}],920:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/colorscale/color_attributes"),a=t("../../constants/gl2d_dashes"),o=t("../../constants/gl_markers"),s=t("../../lib/extend").extendFlat,l=t("../../lib/extend").extendDeep,u=n.line,c=n.marker,h=c.line;e.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:s({},n.text,{}),mode:{valType:"flaglist",flags:["lines","markers"],extras:["none"]},line:{color:u.color,width:u.width,dash:{valType:"enumerated",values:Object.keys(a),dflt:"solid"}},marker:l({},i("marker"),{symbol:{valType:"enumerated",values:Object.keys(o),dflt:"circle",arrayOk:!0},size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,opacity:c.opacity,showscale:c.showscale,colorbar:c.colorbar,line:l({},i("marker.line"),{width:h.width})}),connectgaps:n.connectgaps,fill:s({},n.fill,{values:["none","tozeroy","tozerox"]}),fillcolor:n.fillcolor,error_y:n.error_y,error_x:n.error_x}},{"../../components/colorscale/color_attributes":565,"../../constants/gl2d_dashes":638,"../../constants/gl_markers":640,"../../lib/extend":651,"../scatter/attributes":884}],921:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.type="scattergl",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.connectgaps=!0,this.idToIndex=[],this.bounds=[0,0,0,0],this.hasLines=!1,this.lineOptions={positions:new Float64Array(0),color:[0,0,0,1],width:1,fill:[!1,!1,!1,!1],fillColor:[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],dashes:[1]},this.line=d(t.glplot,this.lineOptions),this.line._trace=this,this.hasErrorX=!1,this.errorXOptions={positions:new Float64Array(0),errors:new Float64Array(0),lineWidth:1,capSize:0,color:[0,0,0,1]},this.errorX=p(t.glplot,this.errorXOptions),this.errorX._trace=this,this.hasErrorY=!1,this.errorYOptions={positions:new Float64Array(0),errors:new Float64Array(0),lineWidth:1,capSize:0,color:[0,0,0,1]},this.errorY=p(t.glplot,this.errorYOptions),this.errorY._trace=this,this.hasMarkers=!1,this.scatterOptions={positions:new Float64Array(0),sizes:[],colors:[],glyphs:[],borderWidths:[],borderColors:[],size:12,color:[0,0,0,1],borderSize:1,borderColor:[0,0,0,1]},this.scatter=h(t.glplot,this.scatterOptions),this.scatter._trace=this,this.fancyScatter=f(t.glplot,this.scatterOptions),this.fancyScatter._trace=this,this.isVisible=!1}function i(t,e,r){return Array.isArray(e)||(e=[e]),a(t,e,r)}function a(t,e,r){for(var n=new Array(r),i=e[0],a=0;a<r;++a)n[a]=t(a>=e.length?i:e[a]);return n}function o(t,e,r){return l(I(t,r),C(e,r),r)}function s(t,e,r,n){var i=w(t,e,n);return i=Array.isArray(i[0])?i:a(g.identity,[i],n),l(i,C(r,n),n)}function l(t,e,r){for(var n=new Array(4*r),i=0;i<r;++i){for(var a=0;a<3;++a)n[4*i+a]=t[i][a];n[4*i+3]=t[i][3]*e[i]}return n}function u(t){for(var e,r=t.length,n=Math.max(1,(r-1)/Math.min(Math.max(r,1),1e3)),i=0;i<r;i+=n)if(e=t[Math.floor(i)],!(m(e)||e instanceof Date))return!1;return!0}function c(t,e){var r=new n(t,e.uid);return r.update(e),r}var h=t("gl-scatter2d"),f=t("gl-scatter2d-fancy"),d=t("gl-line2d"),p=t("gl-error2d"),m=t("fast-isnumeric"),g=t("../../lib"),v=t("../../plots/cartesian/axes"),y=t("../../plots/cartesian/axis_autotype"),x=t("../../components/errorbars"),b=t("../../lib/str2rgbarray"),_=t("../../lib/typed_array_truncate"),w=t("../../lib/gl_format_color"),M=t("../scatter/subtypes"),A=t("../scatter/make_bubble_size_func"),k=t("../scatter/get_trace_color"),T=t("../../constants/gl_markers"),E=t("../../constants/gl2d_dashes"),S=["xaxis","yaxis"],L=n.prototype;L.handlePick=function(t){var e=t.pointId;(t.object!==this.line||this.connectgaps)&&(e=this.idToIndex[t.pointId]);var r=this.pickXData[e];return{trace:this,dataCoord:t.dataCoord,traceCoord:[m(r)||!g.isDateTime(r)?r:g.dateTime2ms(r),this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:Array.isArray(this.color)?this.color[e]:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},L.isFancy=function(t){if("linear"!==this.scene.xaxis.type&&"date"!==this.scene.xaxis.type)return!0;if("linear"!==this.scene.yaxis.type)return!0;if(!t.x||!t.y)return!0;if(this.hasMarkers){var e=t.marker||{};if(Array.isArray(e.symbol)||"circle"!==e.symbol||Array.isArray(e.size)||Array.isArray(e.color)||Array.isArray(e.line.width)||Array.isArray(e.line.color)||Array.isArray(e.opacity))return!0}return!(!this.hasLines||this.connectgaps)||(!!this.hasErrorX||!!this.hasErrorY)};var C=i.bind(null,function(t){return+t}),I=i.bind(null,b),z=i.bind(null,function(t){return T[t]||"●"});L.update=function(t){t.visible!==!0?(this.isVisible=!1,this.hasLines=!1,this.hasErrorX=!1,this.hasErrorY=!1,this.hasMarkers=!1):(this.isVisible=!0,this.hasLines=M.hasLines(t),this.hasErrorX=t.error_x.visible===!0,this.hasErrorY=t.error_y.visible===!0,this.hasMarkers=M.hasMarkers(t)),this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.connectgaps=!!t.connectgaps,this.isVisible?this.isFancy(t)?this.updateFancy(t):this.updateFast(t):this.clear(),this.color=k(t,{})},L.clear=function(){this.lineOptions.positions=new Float64Array(0),this.line.update(this.lineOptions),this.errorXOptions.positions=new Float64Array(0),this.errorX.update(this.errorXOptions),this.errorYOptions.positions=new Float64Array(0),this.errorY.update(this.errorYOptions),this.scatterOptions.positions=new Float64Array(0),this.scatterOptions.glyphs=[],this.scatter.update(this.scatterOptions),this.fancyScatter.update(this.scatterOptions)},L.updateFast=function(t){var e,r,n=this.xData=this.pickXData=t.x,i=this.yData=this.pickYData=t.y,a=n.length,o=new Array(a),s=new Float64Array(2*a),l=this.bounds,c=0,h=0,f=t.xcalendar,d=u(n),p=!d&&"date"===y(n,f);if(d||p)for(var v=0;v<a;++v)e=n[v],r=i[v],m(r)&&(d||(e=g.dateTime2ms(e,f)),o[c++]=v,s[h++]=e,s[h++]=r,l[0]=Math.min(l[0],e),l[1]=Math.min(l[1],r),l[2]=Math.max(l[2],e),l[3]=Math.max(l[3],r));s=_(s,h),this.idToIndex=o,this.updateLines(t,s),this.updateError("X",t),this.updateError("Y",t);var x;if(this.hasMarkers){this.scatterOptions.positions=s;var w=b(t.marker.color),M=b(t.marker.line.color),A=t.opacity*t.marker.opacity;w[3]*=A,this.scatterOptions.color=w,M[3]*=A,this.scatterOptions.borderColor=M,x=t.marker.size,this.scatterOptions.size=x,this.scatterOptions.borderSize=t.marker.line.width,this.scatter.update(this.scatterOptions)}else this.scatterOptions.positions=new Float64Array(0),this.scatterOptions.glyphs=[],this.scatter.update(this.scatterOptions);this.scatterOptions.positions=new Float64Array(0),this.scatterOptions.glyphs=[],this.fancyScatter.update(this.scatterOptions),this.expandAxesFast(l,x)},L.updateFancy=function(t){var e=this.scene,r=e.xaxis,n=e.yaxis,a=this.bounds,o=this.pickXData=r.makeCalcdata(t,"x").slice(),l=this.pickYData=n.makeCalcdata(t,"y").slice();this.xData=o.slice(),this.yData=l.slice();var u,c,h,f,d,p,m,g,v=x.calcFromTrace(t,e.fullLayout),y=o.length,b=new Array(y),w=new Float64Array(2*y),M=new Float64Array(4*y),k=new Float64Array(4*y),T=0,E=0,S=0,L=0,I="log"===r.type?r.d2l:function(t){return t},D="log"===n.type?n.d2l:function(t){return t};for(u=0;u<y;++u)this.xData[u]=h=I(o[u]),this.yData[u]=f=D(l[u]),isNaN(h)||isNaN(f)||(b[T++]=u,w[E++]=h,w[E++]=f,d=M[S++]=h-v[u].xs||0,p=M[S++]=v[u].xh-h||0,M[S++]=0,M[S++]=0,k[L++]=0,k[L++]=0,m=k[L++]=f-v[u].ys||0,g=k[L++]=v[u].yh-f||0,a[0]=Math.min(a[0],h-d),a[1]=Math.min(a[1],f-m),a[2]=Math.max(a[2],h+p),a[3]=Math.max(a[3],f+g));w=_(w,E),this.idToIndex=b,this.updateLines(t,w),this.updateError("X",t,w,M),this.updateError("Y",t,w,k);var P;if(this.hasMarkers){this.scatterOptions.positions=w,this.scatterOptions.sizes=new Array(T),this.scatterOptions.glyphs=new Array(T),this.scatterOptions.borderWidths=new Array(T),this.scatterOptions.colors=new Array(4*T),this.scatterOptions.borderColors=new Array(4*T);var O,R=A(t),F=t.marker,j=F.opacity,N=t.opacity,B=s(F,j,N,y),U=z(F.symbol,y),V=C(F.line.width,y),q=s(F.line,j,N,y);for(P=i(R,F.size,y),u=0;u<T;++u)for(O=b[u],this.scatterOptions.sizes[u]=4*P[O],this.scatterOptions.glyphs[u]=U[O],this.scatterOptions.borderWidths[u]=.5*V[O],c=0;c<4;++c)this.scatterOptions.colors[4*u+c]=B[4*O+c],this.scatterOptions.borderColors[4*u+c]=q[4*O+c];this.fancyScatter.update(this.scatterOptions)}else this.scatterOptions.positions=new Float64Array(0),this.scatterOptions.glyphs=[],this.fancyScatter.update(this.scatterOptions);this.scatterOptions.positions=new Float64Array(0),this.scatterOptions.glyphs=[],this.scatter.update(this.scatterOptions),this.expandAxesFancy(o,l,P)},L.updateLines=function(t,e){var r;if(this.hasLines){var n=e;if(!t.connectgaps){var i=0,a=this.xData,s=this.yData;for(n=new Float64Array(2*a.length),r=0;r<a.length;++r)n[i++]=a[r],n[i++]=s[r]}this.lineOptions.positions=n;var l=o(t.line.color,t.opacity,1),u=Math.round(.5*this.lineOptions.width),c=(E[t.line.dash]||[1]).slice();for(r=0;r<c.length;++r)c[r]*=u;switch(t.fill){case"tozeroy":this.lineOptions.fill=[!1,!0,!1,!1];break;case"tozerox":this.lineOptions.fill=[!0,!1,!1,!1];break;default:this.lineOptions.fill=[!1,!1,!1,!1]}var h=b(t.fillcolor);this.lineOptions.color=l,this.lineOptions.width=2*t.line.width,this.lineOptions.dashes=c,this.lineOptions.fillColor=[h,h,h,h]}else this.lineOptions.positions=new Float64Array(0);this.line.update(this.lineOptions)},L.updateError=function(t,e,r,n){var i=this["error"+t],a=e["error_"+t.toLowerCase()],s=this["error"+t+"Options"];"x"===t.toLowerCase()&&a.copy_ystyle&&(a=e.error_y),this["hasError"+t]?(s.positions=r,s.errors=n,s.capSize=a.width,s.lineWidth=a.thickness/2,s.color=o(a.color,1,1)):s.positions=new Float64Array(0),i.update(s)},L.expandAxesFast=function(t,e){for(var r,n,i,a=e||10,o=0;o<2;o++)r=this.scene[S[o]],n=r._min,n||(n=[]),n.push({val:t[o],pad:a}),i=r._max,i||(i=[]),i.push({val:t[o+2],pad:a})},L.expandAxesFancy=function(t,e,r){var n=this.scene,i={padded:!0,ppad:r};v.expand(n.xaxis,t,i),v.expand(n.yaxis,e,i)},L.dispose=function(){this.line.dispose(),this.errorX.dispose(),this.errorY.dispose(),this.scatter.dispose(),this.fancyScatter.dispose()},e.exports=c},{"../../components/errorbars":587,"../../constants/gl2d_dashes":638,"../../constants/gl_markers":640,"../../lib":658,"../../lib/gl_format_color":656,"../../lib/str2rgbarray":673,"../../lib/typed_array_truncate":676,"../../plots/cartesian/axes":691,"../../plots/cartesian/axis_autotype":692,"../scatter/get_trace_color":892,"../scatter/make_bubble_size_func":899,"../scatter/subtypes":904,"fast-isnumeric":106,"gl-error2d":133,"gl-line2d":143,"gl-scatter2d":218,"gl-scatter2d-fancy":213}],922:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/constants"),a=t("../scatter/subtypes"),o=t("../scatter/xy_defaults"),s=t("../scatter/marker_defaults"),l=t("../scatter/line_defaults"),u=t("../scatter/fillcolor_defaults"),c=t("../../components/errorbars/defaults"),h=t("./attributes");e.exports=function(t,e,r,f){function d(r,i){return n.coerce(t,e,h,r,i)}var p=o(t,e,f,d);return p?(d("text"),d("mode",p<i.PTS_LINESONLY?"lines+markers":"lines"),a.hasLines(e)&&(d("connectgaps"),l(t,e,r,f,d)),a.hasMarkers(e)&&s(t,e,r,f,d),d("fill"),"none"!==e.fill&&u(t,e,r,d),c(t,e,r,{axis:"y"}),void c(t,e,r,{axis:"x",inherit:"y"})):void(e.visible=!1)}},{"../../components/errorbars/defaults":586,"../../lib":658,"../scatter/constants":889,"../scatter/fillcolor_defaults":891,"../scatter/line_defaults":895,"../scatter/marker_defaults":900,"../scatter/subtypes":904,"../scatter/xy_defaults":906,"./attributes":920}],923:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("../scatter3d/calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="scattergl",n.basePlotModule=t("../../plots/gl2d"),n.categories=["gl2d","symbols","errorBarsOK","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../plots/gl2d":727,"../scatter/colorbar":887,"../scatter3d/calc":908,"./attributes":920,"./convert":921,"./defaults":922}],924:[function(t,e,r){"use strict";var n=t("../scattergeo/attributes"),i=t("../scatter/attributes"),a=t("../../plots/mapbox/layout_attributes"),o=t("../../plots/attributes"),s=t("../../components/colorbar/attributes"),l=t("../../lib/extend").extendFlat,u=n.line,c=n.marker;e.exports={lon:n.lon,lat:n.lat,mode:{valType:"flaglist",flags:["lines","markers","text"],dflt:"markers",extras:["none"]},text:l({},i.text,{}),line:{color:u.color,width:u.width,dash:u.dash},connectgaps:i.connectgaps,marker:{symbol:{valType:"string",dflt:"circle",arrayOk:!0},opacity:l({},c.opacity,{arrayOk:!1}),size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,color:c.color,colorscale:c.colorscale,cauto:c.cauto,cmax:c.cmax,cmin:c.cmin,autocolorscale:c.autocolorscale,reversescale:c.reversescale,showscale:c.showscale,colorbar:s},fill:n.fill,fillcolor:i.fillcolor,textfont:a.layers.symbol.textfont,textposition:a.layers.symbol.textposition,hoverinfo:l({},o.hoverinfo,{flags:["lon","lat","text","name"]})}},{"../../components/colorbar/attributes":559,"../../lib/extend":651,"../../plots/attributes":689,"../../plots/mapbox/layout_attributes":747,"../scatter/attributes":884,"../scattergeo/attributes":913}],925:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../components/colorscale"),o=t("../scatter/subtypes"),s=t("../scatter/colorscale_calc"),l=t("../scatter/make_bubble_size_func");e.exports=function(t,e){var r=e.lon.length,u=e.marker,c=o.hasMarkers(e),h=c&&Array.isArray(u.color),f=c&&Array.isArray(u.size),d=c&&Array.isArray(u.symbol),p=Array.isArray(e.text);s(e);for(var m=a.hasColorscale(e,"marker")?a.makeColorScaleFunc(a.extractScale(u.colorscale,u.cmin,u.cmax)):i.identity,g=o.isBubble(e)?l(e):i.identity,v=[],y=0,x=0;x<r;x++){var b=e.lon[x],_=e.lat[x];if(n(b)&&n(_)){var w={};if(y++,w.lonlat=[+b,+_],c){if(h){var M=u.color[x];w.mc=M,w.mcc=m(M)}if(f){var A=u.size[x];w.ms=A,w.mrc=g(A)}if(d){var k=u.symbol[x];w.mx="string"==typeof k?k:"circle"}}if(p){var T=e.text[x];w.tx="string"==typeof T?T:""}v.push(w)}else y>0&&(v[y-1].gapAfter=!0)}return v}},{"../../components/colorscale":572,"../../lib":658,"../scatter/colorscale_calc":888,"../scatter/make_bubble_size_func":899,"../scatter/subtypes":904,"fast-isnumeric":106}],926:[function(t,e,r){"use strict";function n(){return{geojson:h.makeBlank(),layout:{visibility:"none"},paint:{}}}function i(t,e){function r(t,r,n,i){void 0===e[r][n]&&(e[r][n]=i),t[r]=e[r][n]}for(var n=t[0].trace,i=n.marker,a=Array.isArray(i.color),o=Array.isArray(i.size),s=[],l=0;l<t.length;l++){var u=t[l],c={};a&&r(c,p,u.mcc,l),o&&r(c,m,u.mrc,l),s.push({type:"Feature",geometry:{type:"Point",coordinates:u.lonlat},properties:c})}return{type:"FeatureCollection",features:s}}function a(t){for(var e=t[0].trace,r=e.marker||{},n=r.symbol,i=e.text,a="circle"!==n?l(n):u,o=f.hasText(e)?l(i):u,s=[],c=0;c<t.length;c++){var h=t[c];s.push({type:"Feature",geometry:{type:"Point",coordinates:h.lonlat},properties:{symbol:a(h.mx),text:o(h.tx)}})}return{type:"FeatureCollection",features:s}}function o(t,e){var r,n=t.marker;if(Array.isArray(n.color)){for(var i=Object.keys(e[p]),a=[],o=0;o<i.length;o++){var s=i[o];a.push([e[p][s],s])}r={property:p,stops:a}}else r=n.color;return r}function s(t,e){var r,n=t.marker;if(Array.isArray(n.size)){for(var i=Object.keys(e[m]),a=[],o=0;o<i.length;o++){var s=i[o];a.push([e[m][s],+s])}a.sort(function(t,e){return t[0]-e[0]}),r={property:m,stops:a}}else r=n.size/2;return r}function l(t){return Array.isArray(t)?function(t){return t}:t?function(){return t}:u}function u(){return""}var c=t("../../lib"),h=t("../../lib/geojson_utils"),f=t("../scatter/subtypes"),d=t("../../plots/mapbox/convert_text_opts"),p="circle-color",m="circle-radius";e.exports=function(t){var e=t[0].trace,r=e.visible===!0,l="none"!==e.fill,u=f.hasLines(e),g=f.hasMarkers(e),v=f.hasText(e),y=g&&"circle"===e.marker.symbol,x=g&&"circle"!==e.marker.symbol,b=n(),_=n(),w=n(),M=n(),A={fill:b,line:_,circle:w,symbol:M};if(!r||t[0].placeholder)return A;var k;if((l||u)&&(k=h.calcTraceToLineCoords(t)),l&&(b.geojson=h.makePolygon(k),b.layout.visibility="visible",c.extendFlat(b.paint,{"fill-color":e.fillcolor})),u&&(_.geojson=h.makeLine(k),_.layout.visibility="visible",c.extendFlat(_.paint,{"line-width":e.line.width,"line-color":e.line.color,"line-opacity":e.opacity})),y){var T={};T[p]={},T[m]={},w.geojson=i(t,T),w.layout.visibility="visible",c.extendFlat(w.paint,{"circle-opacity":e.opacity*e.marker.opacity,"circle-color":o(e,T),"circle-radius":s(e,T)})}if((x||v)&&(M.geojson=a(t),c.extendFlat(M.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),x&&(c.extendFlat(M.layout,{"icon-size":e.marker.size/10}),c.extendFlat(M.paint,{"icon-opacity":e.opacity*e.marker.opacity,"icon-color":e.marker.color})),v)){var E=(e.marker||{}).size,S=d(e.textposition,E);c.extendFlat(M.layout,{"text-size":e.textfont.size,"text-anchor":S.anchor,"text-offset":S.offset}),c.extendFlat(M.paint,{"text-color":e.textfont.color,"text-opacity":e.opacity})}return A}},{"../../lib":658,"../../lib/geojson_utils":655,"../../plots/mapbox/convert_text_opts":744,"../scatter/subtypes":904}],927:[function(t,e,r){"use strict";function n(t,e,r){var n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length);return a<n.length&&(e.lon=n.slice(0,a)),a<i.length&&(e.lat=i.slice(0,a)),a}var i=t("../../lib"),a=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/text_defaults"),u=t("../scatter/fillcolor_defaults"),c=t("./attributes"),h=t("../scatter/attributes");e.exports=function(t,e,r,f){function d(r,n){return i.coerce(t,e,c,r,n)}function p(r,n){var a=r.indexOf(".line")===-1?c:h;return i.coerce(t,e,a,r,n)}var m=n(t,e,d);if(!m)return void(e.visible=!1);if(d("text"),d("mode"),a.hasLines(e)&&(s(t,e,r,f,d),d("connectgaps")),a.hasMarkers(e)){o(t,e,r,f,p);var g=e.marker;"circle"!==g.symbol&&(Array.isArray(g.size)&&(g.size=g.size[0]),Array.isArray(g.color)&&(g.color=g.color[0]))}a.hasText(e)&&l(t,e,f,d),d("fill"),"none"!==e.fill&&u(t,e,r,d),d("hoverinfo",1===f._dataLength?"lon+lat+text":void 0)}},{"../../lib":658,"../scatter/attributes":884,"../scatter/fillcolor_defaults":891,"../scatter/line_defaults":895,"../scatter/marker_defaults":900,"../scatter/subtypes":904,"../scatter/text_defaults":905,"./attributes":924}],928:[function(t,e,r){"use strict";e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t}},{}],929:[function(t,e,r){"use strict";function n(t,e){function r(t){return t+"°"}var n=t.hoverinfo.split("+"),i=n.indexOf("all")!==-1,a=n.indexOf("lon")!==-1,o=n.indexOf("lat")!==-1,s=e.lonlat,l=[];if(i||a&&o?l.push("("+r(s[0])+", "+r(s[1])+")"):a?l.push("lon: "+r(s[0])):o&&l.push("lat: "+r(s[1])),i||n.indexOf("text")!==-1){var u=e.tx||t.text;Array.isArray(u)||l.push(u)}return l.join("<br>")}var i=t("../../plots/cartesian/graph_interact"),a=t("../scatter/get_trace_color");e.exports=function(t,e,r){function o(t){var e=t.lonlat,n=Math.abs(u.c2p(e)-u.c2p([d,e[1]])),i=Math.abs(c.c2p(e)-c.c2p([e[0],r])),a=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(n*n+i*i)-a,1-3/a)}var s=t.cd,l=s[0].trace,u=t.xa,c=t.ya;if(!s[0].placeholder){var h=e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360),f=360*h,d=e-f;if(i.getClosest(s,o,t),t.index!==!1){var p=s[t.index],m=p.lonlat,g=[m[0]+f,m[1]],v=u.c2p(g),y=c.c2p(g),x=p.mrc||1;return t.x0=v-x,t.x1=v+x,t.y0=y-x,t.y1=y+x,t.color=a(l,p),t.extraText=n(l,p),[t]}}}},{"../../plots/cartesian/graph_interact":698,"../scatter/get_trace_color":892}],930:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.plot=t("./plot"),n.moduleType="trace",n.name="scattermapbox",n.basePlotModule=t("../../plots/mapbox"),n.categories=["mapbox","gl","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../plots/mapbox":745,"../scatter/colorbar":887,"./attributes":924,"./calc":925,"./defaults":927,"./event_data":928,"./hover":929,"./plot":931}],931:[function(t,e,r){"use strict";function n(t,e){this.mapbox=t,this.map=t.map,this.uid=e,this.idSourceFill=e+"-source-fill",this.idSourceLine=e+"-source-line",this.idSourceCircle=e+"-source-circle",this.idSourceSymbol=e+"-source-symbol",this.idLayerFill=e+"-layer-fill",this.idLayerLine=e+"-layer-line",this.idLayerCircle=e+"-layer-circle",this.idLayerSymbol=e+"-layer-symbol",this.mapbox.initSource(this.idSourceFill),this.mapbox.initSource(this.idSourceLine),this.mapbox.initSource(this.idSourceCircle),this.mapbox.initSource(this.idSourceSymbol),this.map.addLayer({id:this.idLayerFill,source:this.idSourceFill,type:"fill"}),this.map.addLayer({id:this.idLayerLine,source:this.idSourceLine,type:"line"}),this.map.addLayer({id:this.idLayerCircle,source:this.idSourceCircle,type:"circle"}),this.map.addLayer({id:this.idLayerSymbol,source:this.idSourceSymbol,type:"symbol"})}function i(t){return"visible"===t.layout.visibility}var a=t("./convert"),o=n.prototype;o.update=function(t){var e=this.mapbox,r=a(t);e.setOptions(this.idLayerFill,"setLayoutProperty",r.fill.layout),e.setOptions(this.idLayerLine,"setLayoutProperty",r.line.layout),e.setOptions(this.idLayerCircle,"setLayoutProperty",r.circle.layout),e.setOptions(this.idLayerSymbol,"setLayoutProperty",r.symbol.layout),i(r.fill)&&(e.setSourceData(this.idSourceFill,r.fill.geojson),e.setOptions(this.idLayerFill,"setPaintProperty",r.fill.paint)),i(r.line)&&(e.setSourceData(this.idSourceLine,r.line.geojson),e.setOptions(this.idLayerLine,"setPaintProperty",r.line.paint)),i(r.circle)&&(e.setSourceData(this.idSourceCircle,r.circle.geojson),e.setOptions(this.idLayerCircle,"setPaintProperty",r.circle.paint)),i(r.symbol)&&(e.setSourceData(this.idSourceSymbol,r.symbol.geojson),e.setOptions(this.idLayerSymbol,"setPaintProperty",r.symbol.paint))},o.dispose=function(){var t=this.map;t.removeLayer(this.idLayerFill),t.removeLayer(this.idLayerLine),t.removeLayer(this.idLayerCircle),t.removeLayer(this.idLayerSymbol),t.removeSource(this.idSourceFill),t.removeSource(this.idSourceLine),t.removeSource(this.idSourceCircle),t.removeSource(this.idSourceSymbol)},e.exports=function(t,e){var r=e[0].trace,i=new n(t,r.uid);return i.update(e),i}},{"./convert":926}],932:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat,l=n.marker,u=n.line,c=l.line;e.exports={a:{valType:"data_array"},b:{valType:"data_array"},c:{valType:"data_array"},sum:{valType:"number",dflt:0,min:0},mode:s({},n.mode,{dflt:"markers"}),text:s({},n.text,{}),line:{color:u.color,width:u.width,dash:u.dash,shape:s({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing},connectgaps:n.connectgaps,fill:s({},n.fill,{values:["none","toself","tonext"]}),fillcolor:n.fillcolor,marker:s({},{symbol:l.symbol,opacity:l.opacity,maxdisplayed:l.maxdisplayed,size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,line:s({},{width:c.width},a("marker".line))},a("marker"),{showscale:l.showscale,colorbar:o}),textfont:n.textfont,textposition:n.textposition,hoverinfo:s({},i.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:n.hoveron}},{"../../components/colorbar/attributes":559,"../../components/colorscale/color_attributes":565,"../../lib/extend":651,"../../plots/attributes":689,"../scatter/attributes":884}],933:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("../scatter/subtypes"),o=t("../scatter/colorscale_calc"),s=t("../scatter/arrays_to_calcdata"),l=["a","b","c"],u={a:["b","c"],b:["a","c"],c:["a","b"]};e.exports=function(t,e){var r,c,h,f,d,p,m=t._fullLayout[e.subplot],g=m.sum,v=e.sum||g;for(r=0;r<l.length;r++)if(h=l[r],!e[h]){for(d=e[u[h][0]],p=e[u[h][1]],f=new Array(d.length),c=0;c<d.length;c++)f[c]=v-d[c]-p[c];e[h]=f}var y,x,b,_,w,M,A=e.a.length,k=new Array(A);for(r=0;r<A;r++)y=e.a[r],x=e.b[r],b=e.c[r],n(y)&&n(x)&&n(b)?(y=+y,x=+x,b=+b,_=g/(y+x+b),1!==_&&(y*=_,x*=_,b*=_),M=y,w=b-x,k[r]={x:w,y:M,a:y,b:x,c:b}):k[r]={x:!1,y:!1};var T,E;if(a.hasMarkers(e)&&(T=e.marker,E=T.size,Array.isArray(E))){var S={type:"linear"};i.setConvert(S),E=S.makeCalcdata(e.marker,"size"),E.length>A&&E.splice(A,E.length-A)}return o(e),s(k,e),k}},{"../../plots/cartesian/axes":691,"../scatter/arrays_to_calcdata":883,"../scatter/colorscale_calc":888,"../scatter/subtypes":904,"fast-isnumeric":106}],934:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/constants"),a=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/line_shape_defaults"),u=t("../scatter/text_defaults"),c=t("../scatter/fillcolor_defaults"),h=t("./attributes");e.exports=function(t,e,r,f){function d(r,i){return n.coerce(t,e,h,r,i)}var p,m=d("a"),g=d("b"),v=d("c");if(m?(p=m.length,g?(p=Math.min(p,g.length),v&&(p=Math.min(p,v.length))):p=v?Math.min(p,v.length):0):g&&v&&(p=Math.min(g.length,v.length)),!p)return void(e.visible=!1);m&&p<m.length&&(e.a=m.slice(0,p)),g&&p<g.length&&(e.b=g.slice(0,p)),v&&p<v.length&&(e.c=v.slice(0,p)),d("sum"),d("text");var y=p<i.PTS_LINESONLY?"lines+markers":"lines";d("mode",y),a.hasLines(e)&&(s(t,e,r,f,d),l(t,e,d),d("connectgaps")),a.hasMarkers(e)&&o(t,e,r,f,d),a.hasText(e)&&u(t,e,f,d);var x=[];(a.hasMarkers(e)||a.hasText(e))&&(d("marker.maxdisplayed"),x.push("points")),d("fill"),"none"!==e.fill&&(c(t,e,r,d),a.hasLines(e)||l(t,e,d)),d("hoverinfo",1===f._dataLength?"a+b+c+text":void 0),"tonext"!==e.fill&&"toself"!==e.fill||x.push("fills"),d("hoveron",x.join("+")||"points")}},{"../../lib":658,"../scatter/constants":889,"../scatter/fillcolor_defaults":891,"../scatter/line_defaults":895,"../scatter/line_shape_defaults":897,"../scatter/marker_defaults":900,"../scatter/subtypes":904,"../scatter/text_defaults":905,"./attributes":932}],935:[function(t,e,r){"use strict";var n=t("../scatter/hover"),i=t("../../plots/cartesian/axes");e.exports=function(t,e,r,a){function o(t,e){v.push(t._hovertitle+": "+i.tickText(t,e,"hover").text)}var s=n(t,e,r,a);if(s&&s[0].index!==!1){var l=s[0];if(void 0===l.index){var u=1-l.y0/t.ya._length,c=t.xa._length,h=c*u/2,f=c-h;return l.x0=Math.max(Math.min(l.x0,f),h),l.x1=Math.max(Math.min(l.x1,f),h),s}var d=l.cd[l.index];l.a=d.a,l.b=d.b,l.c=d.c,l.xLabelVal=void 0,l.yLabelVal=void 0;var p=l.trace,m=p._ternary,g=p.hoverinfo.split("+"),v=[];return g.indexOf("all")!==-1&&(g=["a","b","c"]),g.indexOf("a")!==-1&&o(m.aaxis,d.a),g.indexOf("b")!==-1&&o(m.baxis,d.b),g.indexOf("c")!==-1&&o(m.caxis,d.c),l.extraText=v.join("<br>"),s}}},{"../../plots/cartesian/axes":691,"../scatter/hover":893}],936:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scatterternary",n.basePlotModule=t("../../plots/ternary"),n.categories=["ternary","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../plots/ternary":759,"../scatter/colorbar":887,"./attributes":932,"./calc":933,"./defaults":934,"./hover":935,"./plot":937,"./select":938,"./style":939}],937:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e){var r=t.plotContainer;r.select(".scatterlayer").selectAll("*").remove();for(var i={xaxis:t.xaxis,yaxis:t.yaxis,plot:r},a=0;a<e.length;a++)e[a][0].trace._ternary=t;n(t.graphDiv,i,e)}},{"../scatter/plot":901}],938:[function(t,e,r){"use strict";var n=t("../scatter/select");e.exports=function(t,e){var r=n(t,e);if(r){var i,a,o,s=t.cd;for(o=0;o<r.length;o++)i=r[o],a=s[i.pointNumber],i.a=a.a,i.b=a.b,i.c=a.c,delete i.x,delete i.y;return r}}},{"../scatter/select":902}],939:[function(t,e,r){"use strict";var n=t("../scatter/style");e.exports=function(t){for(var e=t._fullLayout._modules,r=0;r<e.length;r++)if("scatter"===e[r].name)return;n(t)}},{"../scatter/style":903}],940:[function(t,e,r){"use strict";function n(t){return{valType:"boolean",dflt:!1}}function i(t){return{show:{valType:"boolean",dflt:!1},project:{x:n("x"),y:n("y"),z:n("z")},color:{valType:"color",dflt:a.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:a.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var a=t("../../components/color"),o=t("../../components/colorscale/attributes"),s=t("../../components/colorbar/attributes"),l=t("../../lib/extend").extendFlat;e.exports={z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"data_array"},surfacecolor:{valType:"data_array"},cauto:o.zauto,cmin:o.zmin,cmax:o.zmax,colorscale:o.colorscale,autocolorscale:l({},o.autocolorscale,{dflt:!1}),reversescale:o.reversescale,showscale:o.showscale,colorbar:s,contours:{x:i("x"),y:i("y"),z:i("z")},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},_deprecated:{zauto:l({},o.zauto,{}),zmin:l({},o.zmin,{}),zmax:l({},o.zmax,{})}}},{"../../components/color":558,"../../components/colorbar/attributes":559,"../../components/colorscale/attributes":563,"../../lib/extend":651}],941:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.surfacecolor?n(e,e.surfacecolor,"","c"):n(e,e.z,"","c")}},{"../../components/colorscale/calc":564}],942:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l="cb"+r.uid,u=r.cmin,c=r.cmax,h=r.surfacecolor||r.z;if(n(u)||(u=i.aggNums(Math.min,null,h)),n(c)||(c=i.aggNums(Math.max,null,h)),t._fullLayout._infolayer.selectAll("."+l).remove(),!r.showscale)return void a.autoMargin(t,l);var f=e[0].t.cb=s(t,l),d=o.makeColorScaleFunc(o.extractScale(r.colorscale,u,c),{noNumericCheck:!0});f.fillcolor(d).filllevels({start:u,end:c,size:(c-u)/254}).options(r.colorbar)()}},{"../../components/colorbar/draw":561,"../../components/colorscale":572,"../../lib":658,"../../plots/plots":751,"fast-isnumeric":106}],943:[function(t,e,r){"use strict";function n(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.dataScale=1}function i(t,e){return void 0===e&&(e=1),t.map(function(t){var r=t[0],n=p(t[1]),i=n.toRgb();return{index:r,rgb:[i.r,i.g,i.b,e]}})}function a(t){var e=t[0].rgb,r=t[t.length-1].rgb;return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]}function o(t){var e=t.shape,r=[e[0]+2,e[1]+2],n=c(new Float32Array(r[0]*r[1]),r);return d.assign(n.lo(1,1).hi(e[0],e[1]),t),d.assign(n.lo(1).hi(e[0],1),t.hi(e[0],1)),d.assign(n.lo(1,r[1]-1).hi(e[0],1),t.lo(0,e[1]-1).hi(e[0],1)),d.assign(n.lo(0,1).hi(1,e[1]),t.hi(1)),d.assign(n.lo(r[0]-1,1).hi(1,e[1]),t.lo(e[0]-1)),n.set(0,0,t.get(0,0)),n.set(0,r[1]-1,t.get(0,e[1]-1)),n.set(r[0]-1,0,t.get(e[0]-1,0)),n.set(r[0]-1,r[1]-1,t.get(e[0]-1,e[1]-1)),n}function s(t){var e=Math.max(t[0].shape[0],t[0].shape[1]);if(e<g){for(var r=g/e,n=[0|Math.floor(t[0].shape[0]*r+1),0|Math.floor(t[0].shape[1]*r+1)],i=n[0]*n[1],a=0;a<t.length;++a){var s=o(t[a]),l=c(new Float32Array(i),n);h(l,s,[r,0,0,0,r,0,0,0,1]),t[a]=l}return r}return 1}function l(t,e){var r=t.glplot.gl,i=u({gl:r}),a=new n(t,i,e.uid);return a.update(e),t.glplot.add(i),a}var u=t("gl-surface3d"),c=t("ndarray"),h=t("ndarray-homography"),f=t("ndarray-fill"),d=t("ndarray-ops"),p=t("tinycolor2"),m=t("../../lib/str2rgbarray"),g=128,v=n.prototype;v.handlePick=function(t){if(t.object===this.surface){var e=[Math.min(0|Math.round(t.data.index[0]/this.dataScale-1),this.data.z[0].length-1),Math.min(0|Math.round(t.data.index[1]/this.dataScale-1),this.data.z.length-1)],r=[0,0,0];Array.isArray(this.data.x[0])?r[0]=this.data.x[e[1]][e[0]]:r[0]=this.data.x[e[0]],Array.isArray(this.data.y[0])?r[1]=this.data.y[e[1]][e[0]]:r[1]=this.data.y[e[1]],r[2]=this.data.z[e[1]][e[0]],t.traceCoordinate=r;var n=this.scene.fullSceneLayout;t.dataCoordinate=[n.xaxis.d2l(r[0],0,this.data.xcalendar)*this.scene.dataScale[0],n.yaxis.d2l(r[1],0,this.data.ycalendar)*this.scene.dataScale[1],n.zaxis.d2l(r[2],0,this.data.zcalendar)*this.scene.dataScale[2]];var i=this.data.text;return i&&i[e[1]]&&void 0!==i[e[1]][e[0]]?t.textLabel=i[e[1]][e[0]]:t.textLabel="",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}},v.setContourLevels=function(){for(var t=[[],[],[]],e=!1,r=0;r<3;++r)this.showContour[r]&&(e=!0,t[r]=this.scene.contourLevels[r]);e&&this.surface.update({levels:t})},v.update=function(t){var e,r=this.scene,n=r.fullSceneLayout,o=this.surface,l=t.opacity,u=i(t.colorscale,l),h=t.z,d=t.x,p=t.y,g=n.xaxis,v=n.yaxis,y=n.zaxis,x=r.dataScale,b=h[0].length,_=h.length,w=[c(new Float32Array(b*_),[b,_]),c(new Float32Array(b*_),[b,_]),c(new Float32Array(b*_),[b,_])],M=w[0],A=w[1],k=r.contourLevels;this.data=t;var T=t.xcalendar,E=t.ycalendar,S=t.zcalendar;f(w[2],function(t,e){return y.d2l(h[e][t],0,S)*x[2]}),Array.isArray(d[0])?f(M,function(t,e){return g.d2l(d[e][t],0,T)*x[0]}):f(M,function(t){return g.d2l(d[t],0,T)*x[0]}),Array.isArray(p[0])?f(A,function(t,e){return v.d2l(p[e][t],0,E)*x[1]}):f(A,function(t,e){return v.d2l(p[e],0,E)*x[1]});var L={colormap:u,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!t.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacity:1};if(L.intensityBounds=[t.cmin,t.cmax],t.surfacecolor){var C=c(new Float32Array(b*_),[b,_]);f(C,function(e,r){return t.surfacecolor[r][e]}),w.push(C)}else L.intensityBounds[0]*=x[2],L.intensityBounds[1]*=x[2];this.dataScale=s(w),t.surfacecolor&&(L.intensity=w.pop()),"opacity"in t&&t.opacity<1&&(L.opacity=.25*t.opacity);var I=[!0,!0,!0],z=["x","y","z"];for(e=0;e<3;++e){var D=t.contours[z[e]];I[e]=D.highlight,L.showContour[e]=D.show||D.highlight,L.showContour[e]&&(L.contourProject[e]=[D.project.x,D.project.y,D.project.z],D.show?(this.showContour[e]=!0,L.levels[e]=k[e],o.highlightColor[e]=L.contourColor[e]=m(D.color),D.usecolormap?o.highlightTint[e]=L.contourTint[e]=0:o.highlightTint[e]=L.contourTint[e]=1,L.contourWidth[e]=D.width):this.showContour[e]=!1,D.highlight&&(L.dynamicColor[e]=m(D.highlightcolor),L.dynamicWidth[e]=D.highlightwidth))}a(u)&&(L.vertexColor=!0),L.coords=w,o.update(L),o.visible=t.visible,o.enableDynamic=I,o.snapToData=!0,"lighting"in t&&(o.ambientLight=t.lighting.ambient,o.diffuseLight=t.lighting.diffuse,o.specularLight=t.lighting.specular,o.roughness=t.lighting.roughness,o.fresnel=t.lighting.fresnel),"lightposition"in t&&(o.lightPosition=[t.lightposition.x,t.lightposition.y,t.lightposition.z]),l&&l<1&&(o.supportsTransparency=!0)},v.dispose=function(){this.scene.glplot.remove(this.surface),this.surface.dispose()},e.exports=l},{"../../lib/str2rgbarray":673,"gl-surface3d":236,ndarray:432,"ndarray-fill":422,"ndarray-homography":424,"ndarray-ops":426,tinycolor2:495}],944:[function(t,e,r){"use strict";function n(t,e,r){e in t&&!(r in t)&&(t[r]=t[e])}var i=t("../../registry"),a=t("../../lib"),o=t("../../components/colorscale/defaults"),s=t("./attributes");e.exports=function(t,e,r,l){function u(r,n){return a.coerce(t,e,s,r,n)}var c,h,f=u("z");if(!f)return void(e.visible=!1);var d=f[0].length,p=f.length;u("x"),u("y");var m=i.getComponentMethod("calendars","handleTraceDefaults");if(m(t,e,["x","y","z"],l),!Array.isArray(e.x))for(e.x=[],c=0;c<d;++c)e.x[c]=c;if(u("text"),!Array.isArray(e.y))for(e.y=[],c=0;c<p;++c)e.y[c]=c;["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lightposition.x","lightposition.y","lightposition.z","hidesurface","opacity"].forEach(function(t){u(t)});var g=u("surfacecolor");u("colorscale");var v=["x","y","z"];for(c=0;c<3;++c){var y="contours."+v[c],x=u(y+".show"),b=u(y+".highlight");if(x||b)for(h=0;h<3;++h)u(y+".project."+v[h]);x&&(u(y+".color"),u(y+".width"),u(y+".usecolormap")),b&&(u(y+".highlightcolor"),u(y+".highlightwidth"))}g||(n(t,"zmin","cmin"),n(t,"zmax","cmax"),n(t,"zauto","cauto")),o(t,e,l,u,{prefix:"",cLetter:"c"})}},{"../../components/colorscale/defaults":567,"../../lib":658,"../../registry":766,"./attributes":940}],945:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("./colorbar"),n.calc=t("./calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="surface",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","noOpacity"],n.meta={},e.exports=n},{"../../plots/gl3d":730,"./attributes":940,"./calc":941,"./colorbar":942,"./convert":943,"./defaults":944}],946:[function(t,e,r){"use strict";function n(t,e){if("string"==typeof e&&e){var r=o.nestedProperty(t,e).get();return Array.isArray(r)?r:[]}return!!Array.isArray(e)&&e.slice()}function i(t,e,r){var n;if(Array.isArray(r)){if(n={type:c(r),_categories:[]},h(n),"category"===n.type)for(var i=0;i<r.length;i++)n.d2c(r[i])}else n=u.getFromTrace(t,e,r);return n?n.d2c:"ids"===r?function(t){return String(t)}:function(t){return+t}}function a(t,e,r){function n(t){return t.indexOf(a)!==-1}var i,a=t.operation,o=t.value,s=Array.isArray(o),l=function(r){return e(r,0,t.valuecalendar)},u=function(t){return e(t,0,r)};switch(n(f)?i=l(s?o[0]:o):n(d)?i=s?[l(o[0]),l(o[1])]:[l(o),l(o)]:n(p)&&(i=s?o.map(l):[l(o)]),a){case"=":return function(t){return u(t)===i};case"<":return function(t){return u(t)<i};case"<=":return function(t){return u(t)<=i};case">":return function(t){return u(t)>i};case">=":return function(t){return u(t)>=i};case"[]":return function(t){var e=u(t);return e>=i[0]&&e<=i[1]};case"()":return function(t){var e=u(t);return e>i[0]&&e<i[1]};case"[)":return function(t){var e=u(t);return e>=i[0]&&e<i[1]};case"(]":return function(t){var e=u(t);return e>i[0]&&e<=i[1]};case"][":return function(t){var e=u(t);return e<=i[0]||e>=i[1]};case")(":return function(t){var e=u(t);return e<i[0]||e>i[1]};case"](":return function(t){var e=u(t);return e<=i[0]||e>i[1]};case")[":return function(t){var e=u(t);return e<i[0]||e>=i[1]};case"{}":return function(t){return i.indexOf(u(t))!==-1};case"}{":return function(t){return i.indexOf(u(t))===-1}}}var o=t("../lib"),s=t("../registry"),l=t("../plot_api/plot_schema"),u=t("../plots/cartesian/axis_ids"),c=t("../plots/cartesian/axis_autotype"),h=t("../plots/cartesian/set_convert"),f=["=","<",">=",">","<="],d=["[]","()","[)","(]","][",")(","](",")["],p=["{}","}{"];r.moduleType="transform",r.name="filter",r.attributes={enabled:{valType:"boolean",dflt:!0},target:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x"},operation:{valType:"enumerated",values:[].concat(f).concat(d).concat(p),dflt:"="},value:{valType:"any",dflt:0}},r.supplyDefaults=function(t){function e(e,i){return o.coerce(t,n,r.attributes,e,i)}var n={},i=e("enabled");if(i){e("operation"),e("value"),e("target");var a=s.getComponentMethod("calendars","handleDefaults");a(t,n,"valuecalendar",null),a(t,n,"targetcalendar",null)}return n},r.calcTransform=function(t,e,r){function s(t,r){var n=y[t],i=o.nestedProperty(e,t).get();i.push(n[r])}if(r.enabled){var u=r.target,c=n(e,u),h=c.length;if(h){var f=r.targetcalendar;if("string"==typeof u){var d=o.nestedProperty(e,u+"calendar").get();d&&(f=d)}for(var p="x"===u||"y"===u||"z"===u?u:c,m=i(t,e,p),g=a(r,m,f),v=l.findArrayAttributes(e),y={},x=0;x<v.length;x++){var b=v[x],_=o.nestedProperty(e,b);y[b]=o.extendDeep([],_.get()),_.set([])}for(var w=0;w<h;w++){var M=c[w];if(g(M))for(var A=0;A<v.length;A++)s(v[A],w)}}}}},{"../lib":658,"../plot_api/plot_schema":680,"../plots/cartesian/axis_autotype":692,"../plots/cartesian/axis_ids":694,"../plots/cartesian/set_convert":705,"../registry":766}],947:[function(t,e,r){"use strict";function n(t,e){o.nestedProperty(t,e).set([])}function i(t,e,r,n){o.nestedProperty(t,n).set(o.nestedProperty(t,n).get().concat([o.nestedProperty(e,n).get()[r]]))}function a(t,e){var r=e.transform,a=t.transforms[e.transformIndex].groups;if(!Array.isArray(a)||0===a.length)return t;for(var l=o.filterUnique(a),u=new Array(l.length),c=a.length,h=s.findArrayAttributes(t),f=r.style||{},d=0;d<l.length;d++){var p=l[d],m=u[d]=o.extendDeepNoArrays({},t);h.forEach(n.bind(null,m));for(var g=0;g<c;g++)a[g]===p&&h.forEach(i.bind(0,m,t,g));m.name=p,m=o.extendDeepNoArrays(m,f[p]||{})}return u}var o=t("../lib"),s=t("../plot_api/plot_schema");r.moduleType="transform",r.name="groupby",r.attributes={enabled:{valType:"boolean",dflt:!0},groups:{valType:"data_array",dflt:[]},style:{valType:"any",dflt:{}}},r.supplyDefaults=function(t){function e(e,i){return o.coerce(t,n,r.attributes,e,i)}var n={},i=e("enabled");return i?(e("groups"),e("style"),n):n},r.transform=function(t,e){for(var r=[],n=0;n<t.length;n++)r=r.concat(a(t[n],e));return r}},{"../lib":658,"../plot_api/plot_schema":680}]},{},[17])(17)});!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.echarts=e():t.echarts=e()}(this,function(){return function(t){function e(n){if(i[n])return i[n].exports;var o=i[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){t.exports=i(2),i(108),i(102),i(112),i(191),i(331),i(319),i(346),i(293),i(289),i(285),i(326),i(336),i(270),i(275),i(282),i(314),i(306),i(330),i(341),i(281),i(207),i(208),i(209),i(232),i(55),i(373),i(370),i(252),i(253),i(361),i(368),i(223),i(197),i(387),i(216),i(215),i(214),i(377),i(224),i(240)},function(t,e){function i(t){if(null==t||"object"!=typeof t)return t;var e=t,n=N.call(t);if("[object Array]"===n){e=[];for(var o=0,a=t.length;o<a;o++)e[o]=i(t[o])}else if(R[n])e=t.constructor.from(t);else if(!E[n]&&!P(t)&&!I(t)){e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]=i(t[r]))}return e}function n(t,e,o){if(!S(e)||!S(t))return o?i(e):t;for(var a in e)if(e.hasOwnProperty(a)){var r=t[a],s=e[a];!S(s)||!S(r)||_(s)||_(r)||I(s)||I(r)||M(s)||M(r)||P(s)||P(r)?!o&&a in t||(t[a]=i(e[a],!0)):n(r,s,o)}return t}function o(t,e){for(var i=t[0],o=1,a=t.length;o<a;o++)i=n(i,t[o],e);return i}function a(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function r(t,e,i){for(var n in e)e.hasOwnProperty(n)&&(i?null!=e[n]:null==t[n])&&(t[n]=e[n]);return t}function s(){return document.createElement("canvas")}function l(){return z||(z=U.createCanvas().getContext("2d")),z}function u(t,e){if(t){if(t.indexOf)return t.indexOf(e);for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i}return-1}function c(t,e){function i(){}var n=t.prototype;i.prototype=e.prototype,t.prototype=new i;for(var o in n)t.prototype[o]=n[o];t.prototype.constructor=t,t.superClass=e}function h(t,e,i){t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,r(t,e,i)}function d(t){if(t)return"string"!=typeof t&&"number"==typeof t.length}function f(t,e,i){if(t&&e)if(t.forEach&&t.forEach===B)t.forEach(e,i);else if(t.length===+t.length)for(var n=0,o=t.length;n<o;n++)e.call(i,t[n],n,t);else for(var a in t)t.hasOwnProperty(a)&&e.call(i,t[a],a,t)}function p(t,e,i){if(t&&e){if(t.map&&t.map===F)return t.map(e,i);for(var n=[],o=0,a=t.length;o<a;o++)n.push(e.call(i,t[o],o,t));return n}}function g(t,e,i,n){if(t&&e){if(t.reduce&&t.reduce===W)return t.reduce(e,i,n);for(var o=0,a=t.length;o<a;o++)i=e.call(n,i,t[o],o,t);return i}}function m(t,e,i){if(t&&e){if(t.filter&&t.filter===G)return t.filter(e,i);for(var n=[],o=0,a=t.length;o<a;o++)e.call(i,t[o],o,t)&&n.push(t[o]);return n}}function v(t,e,i){if(t&&e)for(var n=0,o=t.length;n<o;n++)if(e.call(i,t[n],n,t))return t[n]}function y(t,e){var i=H.call(arguments,2);return function(){return t.apply(e,i.concat(H.call(arguments)))}}function x(t){var e=H.call(arguments,1);return function(){return t.apply(this,e.concat(H.call(arguments)))}}function _(t){return"[object Array]"===N.call(t)}function b(t){return"function"==typeof t}function w(t){return"[object String]"===N.call(t)}function S(t){var e=typeof t;return"function"===e||!!t&&"object"==e}function M(t){return!!E[N.call(t)]}function I(t){return"object"==typeof t&&"number"==typeof t.nodeType&&"object"==typeof t.ownerDocument}function T(t){return t!==t}function A(t){for(var e=0,i=arguments.length;e<i;e++)if(null!=arguments[e])return arguments[e]}function C(){return Function.call.apply(H,arguments)}function L(t,e){if(!t)throw new Error(e)}function D(t){t[Z]=!0}function P(t){return t[Z]}function k(t){t&&f(t,function(t,e){this.set(e,t)},this)}function O(t){return new k(t)}var z,E={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},R={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},N=Object.prototype.toString,V=Array.prototype,B=V.forEach,G=V.filter,H=V.slice,F=V.map,W=V.reduce,Z="__ec_primitive__",q="_ec_",j=4;k.prototype={constructor:k,get:function(t){return this[q+t]},set:function(t,e){return this[q+t]=e,e},each:function(t,e){void 0!==e&&(t=y(t,e));for(var i in this)this.hasOwnProperty(i)&&t(this[i],i.slice(j))},removeKey:function(t){delete this[t]}};var U={inherits:c,mixin:h,clone:i,merge:n,mergeAll:o,extend:a,defaults:r,getContext:l,createCanvas:s,indexOf:u,slice:C,find:v,isArrayLike:d,each:f,map:p,reduce:g,filter:m,bind:y,curry:x,isArray:_,isString:w,isObject:S,isFunction:b,isBuiltInObject:M,isDom:I,eqNaN:T,retrieve:A,assert:L,setAsPrimitive:D,createHashMap:O,noop:function(){}};t.exports=U},function(t,e,i){function n(t){return function(e,i,n){e=e&&e.toLowerCase(),V.prototype[t].call(this,e,i,n)}}function o(){V.call(this)}function a(t,e,i){function n(t,e){return t.prio-e.prio}i=i||{},"string"==typeof e&&(e=lt[e]),this.id,this.group,this._dom=t;var a=this._zr=E.init(t,{renderer:i.renderer||"canvas",devicePixelRatio:i.devicePixelRatio,width:i.width,height:i.height});this._throttledZrFlush=z.throttle(R.bind(a.flush,a),17),this._theme=R.clone(e),this._chartsViews=[],this._chartsMap={},this._componentsViews=[],this._componentsMap={},this._coordSysMgr=new T,this._api=b(this),V.call(this),this._messageCenter=new o,this._initEvents(),this.resize=R.bind(this.resize,this),this._pendingActions=[],B(st,n),B(ot,n),a.animation.on("frame",this._onframe,this),R.setAsPrimitive(this)}function r(t,e,i){var n,o=this._model,a=this._coordSysMgr.getCoordinateSystems();e=O.parseFinder(o,e);for(var r=0;r<a.length;r++){var s=a[r];if(s[t]&&null!=(n=s[t](o,e,i)))return n}}function s(t,e,i,n,o){function a(n){n&&n.__alive&&n[e]&&n[e](n.__model,r,t._api,i)}var r=t._model;if(!n)return void G(t._componentsViews.concat(t._chartsViews),a);var s={};s[n+"Id"]=i[n+"Id"],s[n+"Index"]=i[n+"Index"],s[n+"Name"]=i[n+"Name"];var l={mainType:n,query:s};o&&(l.subType=o),r&&r.eachComponent(l,function(e,i){a(t["series"===n?"_chartsMap":"_componentsMap"][e.__viewId])},t)}function l(t,e){var i=t.type,n=t.escapeConnect,o=it[i],a=o.actionInfo,r=(a.update||"update").split(":"),l=r.pop();r=null!=r[0]&&H(r[0]),this[Y]=!0;var u=[t],c=!1;t.batch&&(c=!0,u=R.map(t.batch,function(e){return e=R.defaults(R.extend({},e),t),e.batch=null,e}));var h,d=[],f="highlight"===i||"downplay"===i;G(u,function(t){h=o.action(t,this._model,this._api),h=h||R.extend({},t),h.type=a.event||h.type,d.push(h),f?s(this,l,t,"series"):r&&s(this,l,t,r.main,r.sub)},this),"none"===l||f||r||(this[K]?(tt.prepareAndUpdate.call(this,t),this[K]=!1):tt[l].call(this,t)),h=c?{type:a.event||i,escapeConnect:n,batch:d}:d[0],this[Y]=!1,!e&&this._messageCenter.trigger(h.type,h)}function u(t){for(var e=this._pendingActions;e.length;){var i=e.shift();l.call(this,i,t)}}function c(t){!t&&this.trigger("updated")}function h(t,e,i){var n=this._api;G(this._componentsViews,function(o){var a=o.__model;o[t](a,e,n,i),_(a,o)},this),e.eachSeries(function(o,a){var r=this._chartsMap[o.__viewId];r[t](o,e,n,i),_(o,r),x(o,r)},this),y(this._zr,e),G(rt,function(t){t(e,n)})}function d(t,e){for(var i="component"===t,n=i?this._componentsViews:this._chartsViews,o=i?this._componentsMap:this._chartsMap,a=this._zr,r=0;r<n.length;r++)n[r].__alive=!1;e[i?"eachComponent":"eachSeries"](function(t,r){if(i){if("series"===t)return}else r=t;var s="_ec_"+r.id+"_"+r.type,l=o[s];if(!l){var u=H(r.type),c=i?D.getClass(u.main,u.sub):P.getClass(u.sub);if(!c)return;l=new c,l.init(e,this._api),o[s]=l,n.push(l),a.add(l.group)}r.__viewId=l.__id=s,l.__alive=!0,l.__model=r,l.group.__ecComponentInfo={mainType:r.mainType,index:r.componentIndex}},this);for(var r=0;r<n.length;){var s=n[r];s.__alive?r++:(a.remove(s.group),s.dispose(e,this._api),n.splice(r,1),delete o[s.__id],s.__id=s.group.__ecComponentInfo=null)}}function f(t,e){G(ot,function(i){i.func(t,e)})}function p(t){var e={};t.eachSeries(function(t){var i=t.get("stack"),n=t.getData();if(i&&"list"===n.type){var o=e[i];e.hasOwnProperty(i)&&o&&(n.stackedOn=o),e[i]=n}})}function g(t,e){var i=this._api;G(st,function(n){n.isLayout&&n.func(t,i,e)})}function m(t,e,i){var n=this._api;t.clearColorPalette(),t.eachSeries(function(t){t.clearColorPalette()}),G(st,function(o){(!i||!o.isLayout)&&o.func(t,n,e)})}function v(t,e){var i=this._api;G(this._componentsViews,function(n){var o=n.__model;n.render(o,t,i,e),_(o,n)},this),G(this._chartsViews,function(t){t.__alive=!1},this),t.eachSeries(function(n,o){var a=this._chartsMap[n.__viewId];a.__alive=!0,a.render(n,t,i,e),a.group.silent=!!n.get("silent"),_(n,a),x(n,a)},this),y(this._zr,t),G(this._chartsViews,function(e){e.__alive||e.remove(t,i)},this)}function y(t,e){var i=t.storage,n=0;i.traverse(function(t){t.isGroup||n++}),n>e.get("hoverLayerThreshold")&&!S.node&&i.traverse(function(t){t.isGroup||(t.useHoverLayer=!0)})}function x(t,e){var i=0;e.group.traverse(function(t){"group"===t.type||t.ignore||i++});var n=+t.get("progressive"),o=i>t.get("progressiveThreshold")&&n&&!S.node;o&&e.group.traverse(function(t){t.isGroup||(t.progressive=o?Math.floor(i++/n):-1,o&&t.stopAnimation(!0))});var a=t.get("blendMode")||null;e.group.traverse(function(t){t.isGroup||t.setStyle("blend",a)})}function _(t,e){var i=t.get("z"),n=t.get("zlevel");e.group.traverse(function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=n&&(t.zlevel=n))})}function b(t){var e=t._coordSysMgr;return R.extend(new I(t),{getCoordinateSystems:R.bind(e.getCoordinateSystems,e),getComponentByElement:function(e){for(;e;){var i=e.__ecComponentInfo;if(null!=i)return t._model.getComponent(i.mainType,i.index);e=e.parent}}})}function w(t){function e(t,e){for(var i=0;i<t.length;i++){var n=t[i];n[a]=e}}var i=0,n=1,o=2,a="__connectUpdateStatus";R.each(nt,function(r,s){t._messageCenter.on(s,function(r){if(ht[t.group]&&t[a]!==i){if(r&&r.escapeConnect)return;var s=t.makeActionFromEvent(r),l=[];R.each(ct,function(e){e!==t&&e.group===t.group&&l.push(e)}),e(l,i),G(l,function(t){t[a]!==n&&t.dispatchAction(s)}),e(l,o)}})})}var S=i(9),M=i(137),I=i(101),T=i(26),A=i(138),C=i(13),L=i(17),D=i(65),P=i(30),k=i(3),O=i(5),z=i(37),E=i(88),R=i(1),N=i(22),V=i(23),B=i(51),G=R.each,H=C.parseClassType,F=1e3,W=5e3,Z=1e3,q=2e3,j=3e3,U=4e3,X=5e3,Y="__flagInMainProcess",$="__hasGradientOrPatternBg",K="__optionUpdated",J=/^[a-zA-Z0-9_]+$/;o.prototype.on=n("on"),o.prototype.off=n("off"),o.prototype.one=n("one"),R.mixin(o,V);var Q=a.prototype;Q._onframe=function(){if(this[K]){var t=this[K].silent;this[Y]=!0,tt.prepareAndUpdate.call(this),this[Y]=!1,this[K]=!1,u.call(this,t),c.call(this,t)}},Q.getDom=function(){return this._dom},Q.getZr=function(){return this._zr},Q.setOption=function(t,e,i){var n;if(R.isObject(e)&&(i=e.lazyUpdate,n=e.silent,e=e.notMerge),this[Y]=!0,!this._model||e){var o=new A(this._api),a=this._theme,r=this._model=new M(null,null,a,o);r.init(null,null,a,o)}this._model.setOption(t,at),i?(this[K]={silent:n},this[Y]=!1):(tt.prepareAndUpdate.call(this),this._zr.flush(),this[K]=!1,this[Y]=!1,u.call(this,n),c.call(this,n))},Q.setTheme=function(){console.log("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},Q.getModel=function(){return this._model},Q.getOption=function(){return this._model&&this._model.getOption()},Q.getWidth=function(){return this._zr.getWidth()},Q.getHeight=function(){return this._zr.getHeight()},Q.getDevicePixelRatio=function(){return this._zr.painter.dpr||window.devicePixelRatio||1},Q.getRenderedCanvas=function(t){if(S.canvasSupported){t=t||{},t.pixelRatio=t.pixelRatio||1,t.backgroundColor=t.backgroundColor||this._model.get("backgroundColor");var e=this._zr,i=e.storage.getDisplayList();return R.each(i,function(t){t.stopAnimation(!0)}),e.painter.getRenderedCanvas(t)}},Q.getDataURL=function(t){t=t||{};var e=t.excludeComponents,i=this._model,n=[],o=this;G(e,function(t){i.eachComponent({mainType:t},function(t){var e=o._componentsMap[t.__viewId];e.group.ignore||(n.push(e),e.group.ignore=!0)})});var a=this.getRenderedCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return G(n,function(t){t.group.ignore=!1}),a},Q.getConnectedDataURL=function(t){if(S.canvasSupported){var e=this.group,i=Math.min,n=Math.max,o=1/0;if(ht[e]){var a=o,r=o,s=-o,l=-o,u=[],c=t&&t.pixelRatio||1;R.each(ct,function(o,c){if(o.group===e){var h=o.getRenderedCanvas(R.clone(t)),d=o.getDom().getBoundingClientRect();a=i(d.left,a),r=i(d.top,r),s=n(d.right,s),l=n(d.bottom,l),u.push({dom:h,left:d.left,top:d.top})}}),a*=c,r*=c,s*=c,l*=c;var h=s-a,d=l-r,f=R.createCanvas();f.width=h,f.height=d;var p=E.init(f);return G(u,function(t){var e=new k.Image({style:{x:t.left*c-a,y:t.top*c-r,image:t.dom}});p.add(e)}),p.refreshImmediately(),f.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}},Q.convertToPixel=R.curry(r,"convertToPixel"),Q.convertFromPixel=R.curry(r,"convertFromPixel"),Q.containPixel=function(t,e){var i,n=this._model;return t=O.parseFinder(n,t),R.each(t,function(t,n){n.indexOf("Models")>=0&&R.each(t,function(t){var o=t.coordinateSystem;if(o&&o.containPoint)i|=!!o.containPoint(e);else if("seriesModels"===n){var a=this._chartsMap[t.__viewId];a&&a.containPoint&&(i|=a.containPoint(e,t))}},this)},this),!!i},Q.getVisual=function(t,e){var i=this._model;t=O.parseFinder(i,t,{defaultMainType:"series"});var n=t.seriesModel,o=n.getData(),a=t.hasOwnProperty("dataIndexInside")?t.dataIndexInside:t.hasOwnProperty("dataIndex")?o.indexOfRawIndex(t.dataIndex):null;return null!=a?o.getItemVisual(a,e):o.getVisual(e)},Q.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},Q.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]};var tt={update:function(t){var e=this._model,i=this._api,n=this._coordSysMgr,o=this._zr;if(e){e.restoreData(),n.create(this._model,this._api),f.call(this,e,i),p.call(this,e),n.update(e,i),m.call(this,e,t),v.call(this,e,t);var a=e.get("backgroundColor")||"transparent",r=o.painter;if(r.isSingleCanvas&&r.isSingleCanvas())o.configLayer(0,{clearColor:a});else{if(!S.canvasSupported){var s=N.parse(a);a=N.stringify(s,"rgb"),0===s[3]&&(a="transparent")}a.colorStops||a.image?(o.configLayer(0,{clearColor:a}),this[$]=!0,this._dom.style.background="transparent"):(this[$]&&o.configLayer(0,{clearColor:null}),this[$]=!1,this._dom.style.background=a)}G(rt,function(t){t(e,i)})}},updateView:function(t){var e=this._model;e&&(e.eachSeries(function(t){t.getData().clearAllVisual()}),m.call(this,e,t),h.call(this,"updateView",e,t))},updateVisual:function(t){var e=this._model;e&&(e.eachSeries(function(t){t.getData().clearAllVisual()}),m.call(this,e,t,!0),h.call(this,"updateVisual",e,t))},updateLayout:function(t){var e=this._model;e&&(g.call(this,e,t),h.call(this,"updateLayout",e,t))},prepareAndUpdate:function(t){var e=this._model;d.call(this,"component",e),d.call(this,"chart",e),tt.update.call(this,t)}};Q.resize=function(t){this[Y]=!0,this._zr.resize(t);var e=this._model&&this._model.resetOption("media"),i=e?"prepareAndUpdate":"update";tt[i].call(this),this._loadingFX&&this._loadingFX.resize(),this[Y]=!1;var n=t&&t.silent;u.call(this,n),c.call(this,n)},Q.showLoading=function(t,e){if(R.isObject(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),ut[t]){var i=ut[t](this._api,e),n=this._zr;this._loadingFX=i,n.add(i)}},Q.hideLoading=function(){this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},Q.makeActionFromEvent=function(t){var e=R.extend({},t);return e.type=nt[t.type],e},Q.dispatchAction=function(t,e){if(R.isObject(e)||(e={silent:!!e}),it[t.type]){if(this[Y])return void this._pendingActions.push(t);l.call(this,t,e.silent),e.flush?this._zr.flush(!0):e.flush!==!1&&S.browser.weChat&&this._throttledZrFlush(),u.call(this,e.silent),c.call(this,e.silent)}},Q.on=n("on"),Q.off=n("off"),Q.one=n("one");var et=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];Q._initEvents=function(){G(et,function(t){this._zr.on(t,function(e){var i,n=this.getModel(),o=e.target;if("globalout"===t)i={};else if(o&&null!=o.dataIndex){var a=o.dataModel||n.getSeriesByIndex(o.seriesIndex);i=a&&a.getDataParams(o.dataIndex,o.dataType)||{}}else o&&o.eventData&&(i=R.extend({},o.eventData));i&&(i.event=e,i.type=t,this.trigger(t,i))},this)},this),G(nt,function(t,e){this._messageCenter.on(e,function(t){this.trigger(e,t)},this)},this)},Q.isDisposed=function(){return this._disposed},Q.clear=function(){this.setOption({series:[]},!0)},Q.dispose=function(){if(!this._disposed){this._disposed=!0;var t=this._api,e=this._model;G(this._componentsViews,function(i){i.dispose(e,t)}),G(this._chartsViews,function(i){i.dispose(e,t)}),this._zr.dispose(),delete ct[this.id]}},R.mixin(a,V);var it={},nt={},ot=[],at=[],rt=[],st=[],lt={},ut={},ct={},ht={},dt=new Date-0,ft=new Date-0,pt="_echarts_instance_",gt={version:"3.6.2",dependencies:{zrender:"3.5.2"}};gt.init=function(t,e,i){var n=gt.getInstanceByDom(t);if(n)return n;var o=new a(t,e,i);return o.id="ec_"+dt++,ct[o.id]=o,t.setAttribute?t.setAttribute(pt,o.id):t[pt]=o.id,w(o),o},gt.connect=function(t){if(R.isArray(t)){var e=t;t=null,R.each(e,function(e){null!=e.group&&(t=e.group)}),t=t||"g_"+ft++,R.each(e,function(e){e.group=t})}return ht[t]=!0,t},gt.disConnect=function(t){ht[t]=!1},gt.disconnect=gt.disConnect,gt.dispose=function(t){"string"==typeof t?t=ct[t]:t instanceof a||(t=gt.getInstanceByDom(t)),t instanceof a&&!t.isDisposed()&&t.dispose()},gt.getInstanceByDom=function(t){var e;return e=t.getAttribute?t.getAttribute(pt):t[pt],ct[e]},gt.getInstanceById=function(t){return ct[t]},gt.registerTheme=function(t,e){lt[t]=e},gt.registerPreprocessor=function(t){at.push(t)},gt.registerProcessor=function(t,e){"function"==typeof t&&(e=t,t=F),ot.push({prio:t,func:e})},gt.registerPostUpdate=function(t){rt.push(t)},gt.registerAction=function(t,e,i){"function"==typeof e&&(i=e,e="");var n=R.isObject(t)?t.type:[t,t={event:e}][0];t.event=(t.event||n).toLowerCase(),e=t.event,R.assert(J.test(n)&&J.test(e)),it[n]||(it[n]={action:i,actionInfo:t}),nt[e]=n},gt.registerCoordinateSystem=function(t,e){T.register(t,e)},gt.getCoordinateSystemDimensions=function(t){var e=T.get(t);if(e)return e.getDimensionsInfo?e.getDimensionsInfo():e.dimensions.slice()},gt.registerLayout=function(t,e){"function"==typeof t&&(e=t,t=Z),st.push({prio:t,func:e,isLayout:!0})},gt.registerVisual=function(t,e){"function"==typeof t&&(e=t,t=j),st.push({prio:t,func:e})},gt.registerLoading=function(t,e){ut[t]=e},gt.extendComponentModel=function(t){return C.extend(t)},gt.extendComponentView=function(t){return D.extend(t)},gt.extendSeriesModel=function(t){return L.extend(t)},gt.extendChartView=function(t){return P.extend(t)},gt.setCanvasCreator=function(t){R.createCanvas=t},gt.registerVisual(q,i(151)),gt.registerPreprocessor(i(145)),gt.registerLoading("default",i(136)),gt.registerAction({type:"highlight",event:"highlight",update:"highlight"},R.noop),gt.registerAction({type:"downplay",event:"downplay",update:"downplay"},R.noop),gt.zrender=E,gt.List=i(14),gt.Model=i(10),gt.Axis=i(33),gt.graphic=i(3),gt.number=i(4),gt.format=i(7),gt.throttle=z.throttle,gt.matrix=i(19),gt.vector=i(6),gt.color=i(22),gt.util={},G(["map","each","filter","indexOf","inherits","reduce","filter","bind","curry","isArray","isString","isObject","isFunction","extend","defaults","clone","merge"],function(t){gt.util[t]=R[t]}),gt.helper=i(135),gt.PRIORITY={PROCESSOR:{FILTER:F,STATISTIC:W},VISUAL:{LAYOUT:Z,GLOBAL:q,CHART:j,COMPONENT:U,BRUSH:X}},t.exports=gt},function(t,e,i){"use strict";function n(t){return null!=t&&"none"!=t}function o(t){return"string"==typeof t?x.lift(t,-.1):t}function a(t){if(t.__hoverStlDirty){var e=t.style.stroke,i=t.style.fill,a=t.__hoverStl;a.fill=a.fill||(n(i)?o(i):null),a.stroke=a.stroke||(n(e)?o(e):null);var r={};for(var s in a)a.hasOwnProperty(s)&&(r[s]=t.style[s]);t.__normalStl=r,t.__hoverStlDirty=!1}}function r(t){t.__isHover||(a(t),t.useHoverLayer?t.__zr&&t.__zr.addHover(t,t.__hoverStl):(t.setStyle(t.__hoverStl),t.z2+=1),t.__isHover=!0)}function s(t){if(t.__isHover){var e=t.__normalStl;t.useHoverLayer?t.__zr&&t.__zr.removeHover(t):(e&&t.setStyle(e),t.z2-=1),t.__isHover=!1}}function l(t){"group"===t.type?t.traverse(function(t){"group"!==t.type&&r(t)}):r(t)}function u(t){"group"===t.type?t.traverse(function(t){"group"!==t.type&&s(t)}):s(t)}function c(t,e){t.__hoverStl=t.hoverStyle||e||{},t.__hoverStlDirty=!0,t.__isHover&&a(t)}function h(t){this.__hoverSilentOnTouch&&t.zrByTouch||!this.__isEmphasis&&l(this)}function d(t){this.__hoverSilentOnTouch&&t.zrByTouch||!this.__isEmphasis&&u(this)}function f(){this.__isEmphasis=!0,l(this)}function p(){this.__isEmphasis=!1,u(this)}function g(t,e,i,n,o,a){"function"==typeof o&&(a=o,o=null);var r=n&&n.isAnimationEnabled();if(r){var s=t?"Update":"",l=n.getShallow("animationDuration"+s),u=n.getShallow("animationEasing"+s),c=n.getShallow("animationDelay"+s);"function"==typeof c&&(c=c(o,n.getAnimationDelayParams?n.getAnimationDelayParams(e,o):null)),"function"==typeof l&&(l=l(o)),l>0?e.animateTo(i,l,c||0,u,a):(e.stopAnimation(),e.attr(i),a&&a())}else e.stopAnimation(),e.attr(i),a&&a()}var m=i(1),v=i(180),y=i(8),x=i(22),_=i(19),b=i(6),w=i(58),S=i(11),M=Math.round,I=Math.max,T=Math.min,A={};A.Group=i(36),A.Image=i(53),A.Text=i(86),A.Circle=i(171),A.Sector=i(177),A.Ring=i(176),A.Polygon=i(173),A.Polyline=i(174),A.Rect=i(175),A.Line=i(172),A.BezierCurve=i(170),A.Arc=i(169),A.CompoundPath=i(164),A.LinearGradient=i(100),A.RadialGradient=i(165),A.BoundingRect=S,A.extendShape=function(t){return y.extend(t)},A.extendPath=function(t,e){return v.extendFromString(t,e)},A.makePath=function(t,e,i,n){var o=v.createFromString(t,e),a=o.getBoundingRect();if(i){var r=a.width/a.height;if("center"===n){var s,l=i.height*r;l<=i.width?s=i.height:(l=i.width,s=l/r);var u=i.x+i.width/2,c=i.y+i.height/2;i.x=u-l/2,i.y=c-s/2,i.width=l,i.height=s}A.resizePath(o,i)}return o},A.mergePath=v.mergePath,A.resizePath=function(t,e){if(t.applyTransform){var i=t.getBoundingRect(),n=i.calculateTransform(e);t.applyTransform(n)}},A.subPixelOptimizeLine=function(t){var e=A.subPixelOptimize,i=t.shape,n=t.style.lineWidth;return M(2*i.x1)===M(2*i.x2)&&(i.x1=i.x2=e(i.x1,n,!0)),M(2*i.y1)===M(2*i.y2)&&(i.y1=i.y2=e(i.y1,n,!0)),t},A.subPixelOptimizeRect=function(t){var e=A.subPixelOptimize,i=t.shape,n=t.style.lineWidth,o=i.x,a=i.y,r=i.width,s=i.height;return i.x=e(i.x,n,!0),i.y=e(i.y,n,!0),i.width=Math.max(e(o+r,n,!1)-i.x,0===r?0:1),i.height=Math.max(e(a+s,n,!1)-i.y,0===s?0:1),t},A.subPixelOptimize=function(t,e,i){var n=M(2*t);return(n+M(e))%2===0?n/2:(n+(i?1:-1))/2},A.setHoverStyle=function(t,e,i){t.__hoverSilentOnTouch=i&&i.hoverSilentOnTouch,"group"===t.type?t.traverse(function(t){"group"!==t.type&&c(t,e)}):c(t,e),t.on("mouseover",h).on("mouseout",d),t.on("emphasis",f).on("normal",p)},A.setText=function(t,e,i){var n=e.getShallow("position")||"inside",o=e.getShallow("offset"),a=n.indexOf("inside")>=0?"white":i,r=e.getModel("textStyle");m.extend(t,{textDistance:e.getShallow("distance")||5,textFont:r.getFont(),textPosition:n,textOffset:o,textFill:r.getTextColor()||a})},A.getFont=function(t,e){var i=e&&e.getModel("textStyle");return[t.fontStyle||i&&i.getShallow("fontStyle")||"",t.fontWeight||i&&i.getShallow("fontWeight")||"",(t.fontSize||i&&i.getShallow("fontSize")||12)+"px",t.fontFamily||i&&i.getShallow("fontFamily")||"sans-serif"].join(" ")},A.updateProps=function(t,e,i,n,o){g(!0,t,e,i,n,o)},A.initProps=function(t,e,i,n,o){g(!1,t,e,i,n,o)},A.getTransform=function(t,e){for(var i=_.identity([]);t&&t!==e;)_.mul(i,t.getLocalTransform(),i),t=t.parent;return i},A.applyTransform=function(t,e,i){return e&&!m.isArrayLike(e)&&(e=w.getLocalTransform(e)),i&&(e=_.invert([],e)),b.applyTransform([],t,e)},A.transformDirection=function(t,e,i){var n=0===e[4]||0===e[5]||0===e[0]?1:Math.abs(2*e[4]/e[0]),o=0===e[4]||0===e[5]||0===e[2]?1:Math.abs(2*e[4]/e[2]),a=["left"===t?-n:"right"===t?n:0,"top"===t?-o:"bottom"===t?o:0];return a=A.applyTransform(a,e,i),Math.abs(a[0])>Math.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"},A.groupTransition=function(t,e,i,n){function o(t){var e={};return t.traverse(function(t){!t.isGroup&&t.anid&&(e[t.anid]=t)}),e}function a(t){var e={position:b.clone(t.position),rotation:t.rotation};return t.shape&&(e.shape=m.extend({},t.shape)),e}if(t&&e){var r=o(t);e.traverse(function(t){if(!t.isGroup&&t.anid){var e=r[t.anid];if(e){var n=a(t);t.attr(a(e)),A.updateProps(t,n,i,t.dataIndex)}}})}},A.clipPointsByRect=function(t,e){return m.map(t,function(t){var i=t[0];i=I(i,e.x),i=T(i,e.x+e.width);var n=t[1];return n=I(n,e.y),n=T(n,e.y+e.height),[i,n]})},A.clipRectByRect=function(t,e){var i=I(t.x,e.x),n=T(t.x+t.width,e.x+e.width),o=I(t.y,e.y),a=T(t.y+t.height,e.y+e.height);if(n>=i&&a>=o)return{x:i,y:o,width:n-i,height:a-o}},t.exports=A},function(t,e,i){function n(t){return t.replace(/^\s+/,"").replace(/\s+$/,"")}function o(t){return Math.floor(Math.log(t)/Math.LN10)}var a=i(1),r={},s=1e-4;r.linearMap=function(t,e,i,n){var o=e[1]-e[0],a=i[1]-i[0];if(0===o)return 0===a?i[0]:(i[0]+i[1])/2;if(n)if(o>0){if(t<=e[0])return i[0];if(t>=e[1])return i[1]}else{if(t>=e[0])return i[0];if(t<=e[1])return i[1]}else{if(t===e[0])return i[0];if(t===e[1])return i[1]}return(t-e[0])/o*a+i[0]},r.parsePercent=function(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return"string"==typeof t?n(t).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t},r.round=function(t,e,i){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),i?t:+t},r.asc=function(t){return t.sort(function(t,e){return t-e}),t},r.getPrecision=function(t){if(t=+t,isNaN(t))return 0;for(var e=1,i=0;Math.round(t*e)/e!==t;)e*=10,i++;return i},r.getPrecisionSafe=function(t){var e=t.toString(),i=e.indexOf("e");if(i>0){var n=+e.slice(i+1);return n<0?-n:0}var o=e.indexOf(".");return o<0?0:e.length-1-o},r.getPixelPrecision=function(t,e){var i=Math.log,n=Math.LN10,o=Math.floor(i(t[1]-t[0])/n),a=Math.round(i(Math.abs(e[1]-e[0]))/n),r=Math.min(Math.max(-o+a,0),20);return isFinite(r)?r:20},r.getPercentWithPrecision=function(t,e,i){if(!t[e])return 0;var n=a.reduce(t,function(t,e){return t+(isNaN(e)?0:e)},0);if(0===n)return 0;for(var o=Math.pow(10,i),r=a.map(t,function(t){return(isNaN(t)?0:t)/n*o*100}),s=100*o,l=a.map(r,function(t){return Math.floor(t)}),u=a.reduce(l,function(t,e){return t+e},0),c=a.map(r,function(t,e){return t-l[e]});u<s;){for(var h=Number.NEGATIVE_INFINITY,d=null,f=0,p=c.length;f<p;++f)c[f]>h&&(h=c[f],d=f);++l[d],c[d]=0,++u}return l[e]/o},r.MAX_SAFE_INTEGER=9007199254740991,r.remRadian=function(t){var e=2*Math.PI;return(t%e+e)%e},r.isRadianAroundZero=function(t){return t>-s&&t<s};var l=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;r.getTimezoneOffset=function(){return(new Date).getTimezoneOffset()},r.parseDate=function(t){if(t instanceof Date)return t;if("string"==typeof t){var e=l.exec(t);if(!e)return new Date(NaN);var i=r.getTimezoneOffset(),n=e[8]?"Z"===e[8].toUpperCase()?i:60*+e[8].slice(0,3)+i:0;return new Date(+e[1],+(e[2]||1)-1,+e[3]||1,+e[4]||0,+(e[5]||0)-n,+e[6]||0,+e[7]||0)}return null==t?new Date(NaN):new Date(Math.round(t))},r.quantity=function(t){return Math.pow(10,o(t))},r.nice=function(t,e){var i,n=o(t),a=Math.pow(10,n),r=t/a;return i=e?r<1.5?1:r<2.5?2:r<4?3:r<7?5:10:r<1?1:r<2?2:r<3?3:r<5?5:10,t=i*a,n>=-20?+t.toFixed(n<0?-n:0):t},r.reformIntervals=function(t){function e(t,i,n){return t.interval[n]<i.interval[n]||t.interval[n]===i.interval[n]&&(t.close[n]-i.close[n]===(n?-1:1)||!n&&e(t,i,1))}t.sort(function(t,i){return e(t,i,0)?-1:1});for(var i=-(1/0),n=1,o=0;o<t.length;){for(var a=t[o].interval,r=t[o].close,s=0;s<2;s++)a[s]<=i&&(a[s]=i,r[s]=s?1:1-n),i=a[s],n=r[s];a[0]===a[1]&&r[0]*r[1]!==1?t.splice(o,1):o++}return t},r.isNumeric=function(t){return t-parseFloat(t)>=0},t.exports=r},function(t,e,i){function n(t,e){return t&&t.hasOwnProperty(e)}var o=i(7),a=i(4),r=i(10),s=i(1),l=s.each,u=s.isObject,c={};c.normalizeToArray=function(t){return t instanceof Array?t:null==t?[]:[t]},c.defaultEmphasis=function(t,e){if(t){var i=t.emphasis=t.emphasis||{},n=t.normal=t.normal||{};l(e,function(t){var e=s.retrieve(i[t],n[t]);null!=e&&(i[t]=e)})}},c.LABEL_OPTIONS=["position","offset","show","textStyle","distance","formatter"],c.getDataItemValue=function(t){return t&&(null==t.value?t:t.value)},c.isDataItemOption=function(t){return u(t)&&!(t instanceof Array)},c.converDataValue=function(t,e){var i=e&&e.type;return"ordinal"===i?t:("time"===i&&"number"!=typeof t&&null!=t&&"-"!==t&&(t=+a.parseDate(t)),null==t||""===t?NaN:+t)},c.createDataFormatModel=function(t,e){var i=new r;return s.mixin(i,c.dataFormatMixin),i.seriesIndex=e.seriesIndex,i.name=e.name||"",i.mainType=e.mainType,i.subType=e.subType,i.getData=function(){return t},i},c.dataFormatMixin={getDataParams:function(t,e){var i=this.getData(e),n=this.getRawValue(t,e),a=i.getRawIndex(t),r=i.getName(t,!0),s=i.getRawDataItem(t),l=i.getItemVisual(t,"color");return{componentType:this.mainType,componentSubType:this.subType,seriesType:"series"===this.mainType?this.subType:null,seriesIndex:this.seriesIndex,seriesId:this.id,seriesName:this.name,name:r,dataIndex:a,data:s,dataType:e,value:n,color:l,marker:o.getTooltipMarker(l),$vars:["seriesName","name","value"]}},getFormattedLabel:function(t,e,i,n,a){e=e||"normal";var r=this.getData(i),s=r.getItemModel(t),l=this.getDataParams(t,i);null!=n&&l.value instanceof Array&&(l.value=l.value[n]);var u=s.get([a||"label",e,"formatter"]);return"function"==typeof u?(l.status=e,u(l)):"string"==typeof u?o.formatTpl(u,l):void 0},getRawValue:function(t,e){var i=this.getData(e),n=i.getRawDataItem(t);if(null!=n)return!u(n)||n instanceof Array?n:n.value},formatTooltip:s.noop},c.mappingToExists=function(t,e){e=(e||[]).slice();var i=s.map(t||[],function(t,e){return{exist:t}});return l(e,function(t,n){if(u(t)){for(var o=0;o<i.length;o++)if(!i[o].option&&null!=t.id&&i[o].exist.id===t.id+"")return i[o].option=t,void(e[n]=null);for(var o=0;o<i.length;o++){var a=i[o].exist;if(!(i[o].option||null!=a.id&&null!=t.id||null==t.name||c.isIdInner(t)||c.isIdInner(a)||a.name!==t.name+""))return i[o].option=t,void(e[n]=null)}}}),l(e,function(t,e){if(u(t)){for(var n=0;n<i.length;n++){var o=i[n].exist;if(!i[n].option&&!c.isIdInner(o)&&null==t.id){i[n].option=t;break}}n>=i.length&&i.push({option:t})}}),i},c.makeIdAndName=function(t){var e=s.createHashMap();l(t,function(t,i){var n=t.exist;n&&e.set(n.id,t)}),l(t,function(t,i){var n=t.option;s.assert(!n||null==n.id||!e.get(n.id)||e.get(n.id)===t,"id duplicates: "+(n&&n.id)),n&&null!=n.id&&e.set(n.id,t),!t.keyInfo&&(t.keyInfo={})}),l(t,function(t,i){var n=t.exist,o=t.option,a=t.keyInfo;if(u(o)){if(a.name=null!=o.name?o.name+"":n?n.name:"\0-",n)a.id=n.id;else if(null!=o.id)a.id=o.id+"";else{var r=0;do{a.id="\0"+a.name+"\0"+r++}while(e.get(a.id))}e.set(a.id,t)}})},c.isIdInner=function(t){return u(t)&&t.id&&0===(t.id+"").indexOf("\0_ec_\0")},c.compressBatches=function(t,e){function i(t,e,i){for(var n=0,o=t.length;n<o;n++)for(var a=t[n].seriesId,r=c.normalizeToArray(t[n].dataIndex),s=i&&i[a],l=0,u=r.length;l<u;l++){var h=r[l];s&&s[h]?s[h]=null:(e[a]||(e[a]={}))[h]=1}}function n(t,e){var i=[];for(var o in t)if(t.hasOwnProperty(o)&&null!=t[o])if(e)i.push(+o);else{var a=n(t[o],!0);a.length&&i.push({seriesId:o,dataIndex:a})}return i}var o={},a={};return i(t||[],o),i(e||[],a,o),[n(o),n(a)]},c.queryDataIndex=function(t,e){return null!=e.dataIndexInside?e.dataIndexInside:null!=e.dataIndex?s.isArray(e.dataIndex)?s.map(e.dataIndex,function(e){return t.indexOfRawIndex(e)}):t.indexOfRawIndex(e.dataIndex):null!=e.name?s.isArray(e.name)?s.map(e.name,function(e){return t.indexOfName(e)}):t.indexOfName(e.name):void 0},c.makeGetter=function(){var t=0;return function(){var e="\0__ec_prop_getter_"+t++;return function(t){return t[e]||(t[e]={})}}}(),c.parseFinder=function(t,e,i){if(s.isString(e)){var o={};o[e+"Index"]=0,e=o}var a=i&&i.defaultMainType;!a||n(e,a+"Index")||n(e,a+"Id")||n(e,a+"Name")||(e[a+"Index"]=0);var r={};return l(e,function(n,o){var n=e[o];if("dataIndex"===o||"dataIndexInside"===o)return void(r[o]=n);var a=o.match(/^(\w+)(Index|Id|Name)$/)||[],l=a[1],u=(a[2]||"").toLowerCase();if(!(!l||!u||null==n||"index"===u&&"none"===n||i&&i.includeMainTypes&&s.indexOf(i.includeMainTypes,l)<0)){var c={mainType:l};"index"===u&&"all"===n||(c[u]=n);var h=t.queryComponents(c);r[l+"Models"]=h,r[l+"Model"]=h[0]}}),r},c.dataDimToCoordDim=function(t,e){var i=t.dimensions;e=t.getDimension(e);for(var n=0;n<i.length;n++){var o=t.getDimensionInfo(i[n]);if(o.name===e)return o.coordDim}},c.coordDimToDataDim=function(t,e){var i=[];return l(t.dimensions,function(n){var o=t.getDimensionInfo(n);o.coordDim===e&&(i[o.coordDimIndex]=o.name)}),i},c.otherDimToDataDim=function(t,e){var i=[];return l(t.dimensions,function(n){var o=t.getDimensionInfo(n),a=o.otherDims,r=a[e];null!=r&&r!==!1&&(i[r]=o.name)}),i},t.exports=c},function(t,e){var i="undefined"==typeof Float32Array?Array:Float32Array,n={create:function(t,e){var n=new i(2);return null==t&&(t=0),null==e&&(e=0),n[0]=t,n[1]=e,n},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t},clone:function(t){var e=new i(2);return e[0]=t[0],e[1]=t[1],e},set:function(t,e,i){return t[0]=e,t[1]=i,t},add:function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t},scaleAndAdd:function(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t},sub:function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t},len:function(t){return Math.sqrt(this.lenSquare(t))},lenSquare:function(t){return t[0]*t[0]+t[1]*t[1]},mul:function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t},div:function(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t},dot:function(t,e){return t[0]*e[0]+t[1]*e[1]},scale:function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t},normalize:function(t,e){var i=n.len(e);return 0===i?(t[0]=0,t[1]=0):(t[0]=e[0]/i,t[1]=e[1]/i),t},distance:function(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))},distanceSquare:function(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])},negate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t},lerp:function(t,e,i,n){return t[0]=e[0]+n*(i[0]-e[0]),t[1]=e[1]+n*(i[1]-e[1]),t},applyTransform:function(t,e,i){var n=e[0],o=e[1];return t[0]=i[0]*n+i[2]*o+i[4],t[1]=i[1]*n+i[3]*o+i[5],t},min:function(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t},max:function(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t}};n.length=n.len,n.lengthSquare=n.lenSquare,n.dist=n.distance,n.distSquare=n.distanceSquare,t.exports=n},function(t,e,i){var n=i(1),o=i(4),a=i(16),r={};r.addCommas=function(t){return isNaN(t)?"-":(t=(t+"").split("."),t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:""))},r.toCamelCase=function(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()}),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t},r.normalizeCssArray=function(t){var e=t.length;return"number"==typeof t?[t,t,t,t]:2===e?[t[0],t[1],t[0],t[1]]:3===e?[t[0],t[1],t[2],t[1]]:t};var s=r.encodeHTML=function(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")},l=["a","b","c","d","e","f","g"],u=function(t,e){return"{"+t+(null==e?"":e)+"}"};r.formatTpl=function(t,e,i){n.isArray(e)||(e=[e]);var o=e.length;if(!o)return"";for(var a=e[0].$vars||[],r=0;r<a.length;r++){var c=l[r],h=u(c,0);t=t.replace(u(c),i?s(h):h)}for(var d=0;d<o;d++)for(var f=0;f<a.length;f++){var h=e[d][a[f]];t=t.replace(u(l[f],d),i?s(h):h)}return t},r.formatTplSimple=function(t,e,i){return n.each(e,function(e,n){t=t.replace("{"+n+"}",i?s(e):e)}),t},r.getTooltipMarker=function(t,e){return t?'<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:'+r.encodeHTML(t)+";"+(e||"")+'"></span>':""};var c=function(t){return t<10?"0"+t:t};r.formatTime=function(t,e,i){"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var n=o.parseDate(e),a=i?"UTC":"",r=n["get"+a+"FullYear"](),s=n["get"+a+"Month"]()+1,l=n["get"+a+"Date"](),u=n["get"+a+"Hours"](),h=n["get"+a+"Minutes"](),d=n["get"+a+"Seconds"]();return t=t.replace("MM",c(s)).toLowerCase().replace("yyyy",r).replace("yy",r%100).replace("dd",c(l)).replace("d",l).replace("hh",c(u)).replace("h",u).replace("mm",c(h)).replace("m",h).replace("ss",c(d)).replace("s",d)},r.capitalFirst=function(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t},r.truncateText=a.truncateText,t.exports=r},function(t,e,i){function n(t){o.call(this,t),this.path=null}var o=i(38),a=i(1),r=i(27),s=i(161),l=i(72),u=l.prototype.getCanvasPattern,c=Math.abs,h=new r(!0);n.prototype={constructor:n,type:"path",__dirtyPath:!0,strokeContainThreshold:5,brush:function(t,e){var i=this.style,n=this.path||h,o=i.hasStroke(),a=i.hasFill(),r=i.fill,s=i.stroke,l=a&&!!r.colorStops,c=o&&!!s.colorStops,d=a&&!!r.image,f=o&&!!s.image;if(i.bind(t,this,e),this.setTransform(t),this.__dirty){var p;l&&(p=p||this.getBoundingRect(),this._fillGradient=i.getGradient(t,r,p)),c&&(p=p||this.getBoundingRect(),this._strokeGradient=i.getGradient(t,s,p))}l?t.fillStyle=this._fillGradient:d&&(t.fillStyle=u.call(r,t)),c?t.strokeStyle=this._strokeGradient:f&&(t.strokeStyle=u.call(s,t));var g=i.lineDash,m=i.lineDashOffset,v=!!t.setLineDash,y=this.getGlobalScale();n.setScale(y[0],y[1]),this.__dirtyPath||g&&!v&&o?(n.beginPath(t),g&&!v&&(n.setLineDash(g),n.setLineDashOffset(m)),this.buildPath(n,this.shape,!1),this.path&&(this.__dirtyPath=!1)):(t.beginPath(),this.path.rebuildPath(t)),a&&n.fill(t),g&&v&&(t.setLineDash(g),t.lineDashOffset=m),o&&n.stroke(t),g&&v&&t.setLineDash([]),this.restoreTransform(t),null!=i.text&&this.drawRectText(t,this.getBoundingRect())},buildPath:function(t,e,i){},createPathProxy:function(){this.path=new r},getBoundingRect:function(){var t=this._rect,e=this.style,i=!t;if(i){var n=this.path;n||(n=this.path=new r),this.__dirtyPath&&(n.beginPath(),this.buildPath(n,this.shape,!1)),t=n.getBoundingRect()}if(this._rect=t,e.hasStroke()){var o=this._rectWithStroke||(this._rectWithStroke=t.clone());if(this.__dirty||i){o.copy(t);var a=e.lineWidth,s=e.strokeNoScale?this.getLineScale():1;e.hasFill()||(a=Math.max(a,this.strokeContainThreshold||4)),s>1e-10&&(o.width+=a/s,o.height+=a/s,o.x-=a/s/2,o.y-=a/s/2)}return o}return t},contain:function(t,e){var i=this.transformCoordToLocal(t,e),n=this.getBoundingRect(),o=this.style;if(t=i[0],e=i[1],n.contain(t,e)){var a=this.path.data;if(o.hasStroke()){var r=o.lineWidth,l=o.strokeNoScale?this.getLineScale():1;if(l>1e-10&&(o.hasFill()||(r=Math.max(r,this.strokeContainThreshold)),s.containStroke(a,r/l,t,e)))return!0}if(o.hasFill())return s.contain(a,t,e)}return!1},dirty:function(t){null==t&&(t=!0),t&&(this.__dirtyPath=t,this._rect=null),this.__dirty=!0,this.__zr&&this.__zr.refresh(),this.__clipTarget&&this.__clipTarget.dirty()},animateShape:function(t){return this.animate("shape",t)},attrKV:function(t,e){"shape"===t?(this.setShape(e),this.__dirtyPath=!0,this._rect=null):o.prototype.attrKV.call(this,t,e)},setShape:function(t,e){var i=this.shape;if(i){if(a.isObject(t))for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);else i[t]=e;this.dirty(!0)}return this},getLineScale:function(){var t=this.transform;return t&&c(t[0]-1)>1e-10&&c(t[3]-1)>1e-10?Math.sqrt(c(t[0]*t[3]-t[2]*t[1])):1}},n.extend=function(t){var e=function(e){n.call(this,e),t.style&&this.style.extendFrom(t.style,!1);var i=t.shape;if(i){this.shape=this.shape||{};var o=this.shape;for(var a in i)!o.hasOwnProperty(a)&&i.hasOwnProperty(a)&&(o[a]=i[a])}t.init&&t.init.call(this,e)};a.inherits(e,n);for(var i in t)"style"!==i&&"shape"!==i&&(e.prototype[i]=t[i]);return e},a.inherits(n,o),t.exports=n},function(t,e){function i(t){var e={},i={},n=t.match(/Firefox\/([\d.]+)/),o=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),a=t.match(/Edge\/([\d.]+)/),r=/micromessenger/i.test(t);return n&&(i.firefox=!0,i.version=n[1]),o&&(i.ie=!0,i.version=o[1]),a&&(i.edge=!0,i.version=a[1]),r&&(i.weChat=!0),{browser:i,os:e,node:!1,canvasSupported:!!document.createElement("canvas").getContext,touchEventsSupported:"ontouchstart"in window&&!i.ie&&!i.edge,pointerEventsSupported:"onpointerdown"in window&&(i.edge||i.ie&&i.version>=11)}}var n={};n="undefined"==typeof navigator?{browser:{},os:{},node:!0,canvasSupported:!0}:i(navigator.userAgent),t.exports=n},function(t,e,i){function n(t,e,i){this.parentModel=e,this.ecModel=i,this.option=t}function o(t,e,i){for(var n=0;n<e.length&&(!e[n]||(t=t&&"object"==typeof t?t[e[n]]:null,null!=t));n++);return null==t&&i&&(t=i.get(e)),t}function a(t,e){var i=s.get(t,"getParent");return i?i.call(t,e):t.parentModel}var r=i(1),s=i(15),l=i(9);n.prototype={constructor:n,init:null,mergeOption:function(t){r.merge(this.option,t,!0)},get:function(t,e){return null==t?this.option:o(this.option,this.parsePath(t),!e&&a(this,t))},getShallow:function(t,e){var i=this.option,n=null==i?i:i[t],o=!e&&a(this,t);return null==n&&o&&(n=o.getShallow(t)),n},getModel:function(t,e){var i,r=null==t?this.option:o(this.option,t=this.parsePath(t));return e=e||(i=a(this,t))&&i.getModel(t),new n(r,e,this.ecModel)},isEmpty:function(){return null==this.option},restoreData:function(){},clone:function(){var t=this.constructor;return new t(r.clone(this.option))},setReadOnly:function(t){s.setReadOnly(this,t)},parsePath:function(t){return"string"==typeof t&&(t=t.split(".")),t},customizeGetParent:function(t){s.set(this,"getParent",t)},isAnimationEnabled:function(){if(!l.node){if(null!=this.option.animation)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}}},s.enableClassExtend(n);var u=r.mixin;u(n,i(143)),u(n,i(140)),u(n,i(144)),u(n,i(142)),t.exports=n},function(t,e,i){"use strict";function n(t,e,i,n){i<0&&(t+=i,i=-i),n<0&&(e+=n,n=-n),this.x=t,this.y=e,this.width=i,this.height=n}var o=i(6),a=i(19),r=o.applyTransform,s=Math.min,l=Math.max;n.prototype={constructor:n,union:function(t){var e=s(t.x,this.x),i=s(t.y,this.y);this.width=l(t.x+t.width,this.x+this.width)-e,this.height=l(t.y+t.height,this.y+this.height)-i,this.x=e,this.y=i},applyTransform:function(){var t=[],e=[],i=[],n=[];return function(o){if(o){t[0]=i[0]=this.x,t[1]=n[1]=this.y,e[0]=n[0]=this.x+this.width,e[1]=i[1]=this.y+this.height,r(t,t,o),r(e,e,o),r(i,i,o),r(n,n,o),this.x=s(t[0],e[0],i[0],n[0]),this.y=s(t[1],e[1],i[1],n[1]);var a=l(t[0],e[0],i[0],n[0]),u=l(t[1],e[1],i[1],n[1]);this.width=a-this.x,this.height=u-this.y}}}(),calculateTransform:function(t){var e=this,i=t.width/e.width,n=t.height/e.height,o=a.create();return a.translate(o,o,[-e.x,-e.y]),a.scale(o,o,[i,n]),a.translate(o,o,[t.x,t.y]),o},intersect:function(t){if(!t)return!1;t instanceof n||(t=n.create(t));var e=this,i=e.x,o=e.x+e.width,a=e.y,r=e.y+e.height,s=t.x,l=t.x+t.width,u=t.y,c=t.y+t.height;return!(o<s||l<i||r<u||c<a)},contain:function(t,e){var i=this;return t>=i.x&&t<=i.x+i.width&&e>=i.y&&e<=i.y+i.height},clone:function(){return new n(this.x,this.y,this.width,this.height)},copy:function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},n.create=function(t){return new n(t.x,t.y,t.width,t.height)},t.exports=n},function(t,e,i){"use strict";function n(t,e,i,n,o){var a=0,r=0;null==n&&(n=1/0),null==o&&(o=1/0);var s=0;e.eachChild(function(l,u){var c,h,d=l.position,f=l.getBoundingRect(),p=e.childAt(u+1),g=p&&p.getBoundingRect();if("horizontal"===t){var m=f.width+(g?-g.x+f.x:0);c=a+m,c>n||l.newline?(a=0,c=m,r+=s+i,s=f.height):s=Math.max(s,f.height)}else{var v=f.height+(g?-g.y+f.y:0);h=r+v,h>o||l.newline?(a+=s+i,r=0,h=v,s=f.width):s=Math.max(s,f.width)}l.newline||(d[0]=a,d[1]=r,"horizontal"===t?a=c+i:r=h+i)})}var o=i(1),a=i(11),r=i(4),s=i(7),l=r.parsePercent,u=o.each,c={},h=c.LOCATION_PARAMS=["left","right","top","bottom","width","height"],d=c.HV_NAMES=[["width","left","right"],["height","top","bottom"]];c.box=n,c.vbox=o.curry(n,"vertical"),c.hbox=o.curry(n,"horizontal"),c.getAvailableSize=function(t,e,i){var n=e.width,o=e.height,a=l(t.x,n),r=l(t.y,o),u=l(t.x2,n),c=l(t.y2,o);return(isNaN(a)||isNaN(parseFloat(t.x)))&&(a=0),(isNaN(u)||isNaN(parseFloat(t.x2)))&&(u=n),(isNaN(r)||isNaN(parseFloat(t.y)))&&(r=0),(isNaN(c)||isNaN(parseFloat(t.y2)))&&(c=o),i=s.normalizeCssArray(i||0),{width:Math.max(u-a-i[1]-i[3],0),height:Math.max(c-r-i[0]-i[2],0)}},c.getLayoutRect=function(t,e,i){i=s.normalizeCssArray(i||0);var n=e.width,o=e.height,r=l(t.left,n),u=l(t.top,o),c=l(t.right,n),h=l(t.bottom,o),d=l(t.width,n),f=l(t.height,o),p=i[2]+i[0],g=i[1]+i[3],m=t.aspect;switch(isNaN(d)&&(d=n-c-g-r),isNaN(f)&&(f=o-h-p-u),isNaN(d)&&isNaN(f)&&(m>n/o?d=.8*n:f=.8*o),null!=m&&(isNaN(d)&&(d=m*f),isNaN(f)&&(f=d/m)),isNaN(r)&&(r=n-c-d-g),isNaN(u)&&(u=o-h-f-p),t.left||t.right){case"center":r=n/2-d/2-i[3];break;case"right":r=n-d-g}switch(t.top||t.bottom){case"middle":case"center":u=o/2-f/2-i[0];break;case"bottom":u=o-f-p}r=r||0,u=u||0,isNaN(d)&&(d=n-r-(c||0)),isNaN(f)&&(f=o-u-(h||0));var v=new a(r+i[3],u+i[0],d,f);return v.margin=i,v},c.positionElement=function(t,e,i,n,r){var s=!r||!r.hv||r.hv[0],l=!r||!r.hv||r.hv[1],u=r&&r.boundingMode||"all";if(s||l){var h;if("raw"===u)h="group"===t.type?new a(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(h=t.getBoundingRect(),t.needLocalTransform()){var d=t.getLocalTransform();h=h.clone(),h.applyTransform(d)}e=c.getLayoutRect(o.defaults({width:h.width,height:h.height},e),i,n);var f=t.position,p=s?e.x-h.x:0,g=l?e.y-h.y:0;t.attr("position","raw"===u?[p,g]:[f[0]+p,f[1]+g])}},c.sizeCalculable=function(t,e){return null!=t[d[e][0]]||null!=t[d[e][1]]&&null!=t[d[e][2]]},c.mergeLayoutParam=function(t,e,i){function n(i,n){var o={},s=0,c={},h=0,d=2;if(u(i,function(e){c[e]=t[e]}),u(i,function(t){a(e,t)&&(o[t]=c[t]=e[t]),r(o,t)&&s++,r(c,t)&&h++}),l[n])return r(e,i[1])?c[i[2]]=null:r(e,i[2])&&(c[i[1]]=null),c;if(h!==d&&s){if(s>=d)return o;for(var f=0;f<i.length;f++){var p=i[f];if(!a(o,p)&&a(t,p)){o[p]=t[p];break}}return o}return c}function a(t,e){return t.hasOwnProperty(e)}function r(t,e){return null!=t[e]&&"auto"!==t[e]}function s(t,e,i){u(t,function(t){e[t]=i[t]})}!o.isObject(i)&&(i={});var l=i.ignoreSize;!o.isArray(l)&&(l=[l,l]);var c=n(d[0],0),h=n(d[1],1);s(d[0],t,c),s(d[1],t,h)},c.getLayoutParams=function(t){return c.copyLayoutParams({},t)},c.copyLayoutParams=function(t,e){return e&&t&&u(h,function(i){e.hasOwnProperty(i)&&(t[i]=e[i])}),t},t.exports=c},function(t,e,i){function n(t){var e=[];return a.each(c.getClassesByMainType(t),function(t){r.apply(e,t.prototype.dependencies||[])}),a.map(e,function(t){return l.parseClassType(t).main})}var o=i(10),a=i(1),r=Array.prototype.push,s=i(49),l=i(15),u=i(12),c=o.extend({type:"component",id:"",name:"",mainType:"",subType:"",componentIndex:0,defaultOption:null,ecModel:null,dependentModels:[],uid:null,layoutMode:null,$constructor:function(t,e,i,n){o.call(this,t,e,i,n),this.uid=s.getUID("componentModel")},init:function(t,e,i,n){this.mergeDefaultAndTheme(t,i)},mergeDefaultAndTheme:function(t,e){var i=this.layoutMode,n=i?u.getLayoutParams(t):{},o=e.getTheme();a.merge(t,o.get(this.mainType)),a.merge(t,this.getDefaultOption()),i&&u.mergeLayoutParam(t,n,i)},mergeOption:function(t,e){a.merge(this.option,t,!0);var i=this.layoutMode;i&&u.mergeLayoutParam(this.option,t,i)},optionUpdated:function(t,e){},getDefaultOption:function(){if(!l.hasOwn(this,"__defaultOption")){for(var t=[],e=this.constructor;e;){var i=e.prototype.defaultOption;i&&t.push(i),e=e.superClass}for(var n={},o=t.length-1;o>=0;o--)n=a.merge(n,t[o],!0);l.set(this,"__defaultOption",n)}return l.get(this,"__defaultOption")},getReferringComponents:function(t){return this.ecModel.queryComponents({mainType:t,index:this.get(t+"Index",!0),id:this.get(t+"Id",!0)})}});l.enableClassManagement(c,{registerWhenExtend:!0}),s.enableSubTypeDefaulter(c),s.enableTopologicalTravel(c,n),a.mixin(c,i(141)),t.exports=c},function(t,e,i){(function(e){function n(t,e){p.each(v.concat(e.__wrappedMethods||[]),function(i){e.hasOwnProperty(i)&&(t[i]=e[i])}),t.__wrappedMethods=e.__wrappedMethods}function o(t){this._array=t||[]}function a(t){return p.isArray(t)||(t=[t]),t}function r(t,e){var i=t.dimensions,o=new y(p.map(i,t.getDimensionInfo,t),t.hostModel);n(o,t);for(var a=o._storage={},r=t._storage,s=0;s<i.length;s++){var l=i[s],u=r[l];p.indexOf(e,l)>=0?a[l]=new u.constructor(r[l].length):a[l]=r[l]}return o}var s="undefined",l="undefined"==typeof window?e:window,u=typeof l.Float64Array===s?Array:l.Float64Array,c=typeof l.Int32Array===s?Array:l.Int32Array,h={float:u,int:c,ordinal:Array,number:Array,time:Array},d=i(10),f=i(48),p=i(1),g=i(5),m=p.isObject,v=["stackedOn","hasItemOption","_nameList","_idList","_rawData"];o.prototype.pure=!1,o.prototype.count=function(){return this._array.length},o.prototype.getItem=function(t){return this._array[t]};var y=function(t,e){t=t||["x","y"];for(var i={},n=[],o=0;o<t.length;o++){var a,r={};"string"==typeof t[o]?(a=t[o],r={name:a,coordDim:a,coordDimIndex:0,stackable:!1,type:"number"}):(r=t[o],a=r.name,r.type=r.type||"number",r.coordDim||(r.coordDim=a,r.coordDimIndex=0)),r.otherDims=r.otherDims||{},n.push(a),i[a]=r}this.dimensions=n,this._dimensionInfos=i,this.hostModel=e,this.dataType,this.indices=[],this._storage={},this._nameList=[],this._idList=[],this._optionModels=[],this.stackedOn=null,this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._rawData,this._extent},x=y.prototype;x.type="list",x.hasItemOption=!0,x.getDimension=function(t){return isNaN(t)||(t=this.dimensions[t]||t),t},x.getDimensionInfo=function(t){return p.clone(this._dimensionInfos[this.getDimension(t)])},x.initData=function(t,e,i){t=t||[];var n=p.isArray(t);n&&(t=new o(t)),this._rawData=t;var a,r=this._storage={},s=this.indices=[],l=this.dimensions,u=this._dimensionInfos,c=t.count(),d=[],f={};e=e||[];for(var m=0;m<l.length;m++){var v=u[l[m]];0===v.otherDims.itemName&&(a=m);var y=h[v.type];r[l[m]]=new y(c)}var x=this;i||(x.hasItemOption=!1),i=i||function(t,e,i,n){var o=g.getDataItemValue(t);return g.isDataItemOption(t)&&(x.hasItemOption=!0),g.converDataValue(o instanceof Array?o[n]:o,u[e])};for(var m=0;m<c;m++){for(var _=t.getItem(m),b=0;b<l.length;b++){var w=l[b],S=r[w];S[m]=i(_,w,m,b)}s.push(m)}for(var m=0;m<c;m++){var _=t.getItem(m);!e[m]&&_&&(null!=_.name?e[m]=_.name:null!=a&&(e[m]=r[l[a]][m]));var M=e[m]||"",I=_&&_.id;!I&&M&&(f[M]=f[M]||0,I=M,f[M]>0&&(I+="__ec__"+f[M]),f[M]++),I&&(d[m]=I)}this._nameList=e,this._idList=d},x.count=function(){return this.indices.length},x.get=function(t,e,i){var n=this._storage,o=this.indices[e];if(null==o||!n[t])return NaN;var a=n[t][o];if(i){var r=this._dimensionInfos[t];if(r&&r.stackable)for(var s=this.stackedOn;s;){var l=s.get(t,e);(a>=0&&l>0||a<=0&&l<0)&&(a+=l),s=s.stackedOn}}return a},x.getValues=function(t,e,i){var n=[];p.isArray(t)||(i=e,e=t,t=this.dimensions);for(var o=0,a=t.length;o<a;o++)n.push(this.get(t[o],e,i));return n},x.hasValue=function(t){for(var e=this.dimensions,i=this._dimensionInfos,n=0,o=e.length;n<o;n++)if("ordinal"!==i[e[n]].type&&isNaN(this.get(e[n],t)))return!1;return!0},x.getDataExtent=function(t,e,i){t=this.getDimension(t);var n=this._storage[t],o=this.getDimensionInfo(t);e=o&&o.stackable&&e;var a,r=(this._extent||(this._extent={}))[t+!!e];if(r)return r;if(n){for(var s=1/0,l=-(1/0),u=0,c=this.count();u<c;u++)a=this.get(t,u,e),i&&!i(a,t,u)||(a<s&&(s=a),a>l&&(l=a));return this._extent[t+!!e]=[s,l]}return[1/0,-(1/0)]},x.getSum=function(t,e){var i=this._storage[t],n=0;if(i)for(var o=0,a=this.count();o<a;o++){var r=this.get(t,o,e);isNaN(r)||(n+=r)}return n},x.indexOf=function(t,e){var i=this._storage,n=i[t],o=this.indices;if(n)for(var a=0,r=o.length;a<r;a++){var s=o[a];if(n[s]===e)return a}return-1},x.indexOfName=function(t){for(var e=this.indices,i=this._nameList,n=0,o=e.length;n<o;n++){var a=e[n];if(i[a]===t)return n}return-1},x.indexOfRawIndex=function(t){var e=this.indices,i=e[t];if(null!=i&&i===t)return t;for(var n=0,o=e.length-1;n<=o;){var a=(n+o)/2|0;if(e[a]<t)n=a+1;else{if(!(e[a]>t))return a;o=a-1}}return-1},x.indicesOfNearest=function(t,e,i,n){var o=this._storage,a=o[t],r=[];if(!a)return r;null==n&&(n=1/0);for(var s=Number.MAX_VALUE,l=-1,u=0,c=this.count();u<c;u++){var h=e-this.get(t,u,i),d=Math.abs(h);h<=n&&d<=s&&((d<s||h>=0&&l<0)&&(s=d,l=h,r.length=0),r.push(u))}return r},x.getRawIndex=function(t){var e=this.indices[t];return null==e?-1:e},x.getRawDataItem=function(t){return this._rawData.getItem(this.getRawIndex(t))},x.getName=function(t){return this._nameList[this.indices[t]]||""},x.getId=function(t){return this._idList[this.indices[t]]||this.getRawIndex(t)+""},x.each=function(t,e,i,n){"function"==typeof t&&(n=i,i=e,e=t,t=[]),t=p.map(a(t),this.getDimension,this);var o=[],r=t.length,s=this.indices;n=n||this;for(var l=0;l<s.length;l++)switch(r){case 0:e.call(n,l);break;case 1:e.call(n,this.get(t[0],l,i),l);break;case 2:e.call(n,this.get(t[0],l,i),this.get(t[1],l,i),l);break;default:for(var u=0;u<r;u++)o[u]=this.get(t[u],l,i);o[u]=l,e.apply(n,o)}},x.filterSelf=function(t,e,i,n){"function"==typeof t&&(n=i,i=e,e=t,t=[]),t=p.map(a(t),this.getDimension,this);var o=[],r=[],s=t.length,l=this.indices;n=n||this;for(var u=0;u<l.length;u++){var c;if(s)if(1===s)c=e.call(n,this.get(t[0],u,i),u);else{for(var h=0;h<s;h++)r[h]=this.get(t[h],u,i);r[h]=u,c=e.apply(n,r)}else c=e.call(n,u);c&&o.push(l[u])}return this.indices=o,this._extent={},this},x.mapArray=function(t,e,i,n){"function"==typeof t&&(n=i,i=e,e=t,t=[]);var o=[];return this.each(t,function(){o.push(e&&e.apply(this,arguments))},i,n),o},x.map=function(t,e,i,n){t=p.map(a(t),this.getDimension,this);var o=r(this,t),s=o.indices=this.indices,l=o._storage,u=[];return this.each(t,function(){var i=arguments[arguments.length-1],n=e&&e.apply(this,arguments);if(null!=n){"number"==typeof n&&(u[0]=n,n=u);for(var o=0;o<n.length;o++){var a=t[o],r=l[a],c=s[i];r&&(r[c]=n[o])}}},i,n),o},x.downSample=function(t,e,i,n){for(var o=r(this,[t]),a=this._storage,s=o._storage,l=this.indices,u=o.indices=[],c=[],h=[],d=Math.floor(1/e),f=s[t],p=this.count(),g=0;g<a[t].length;g++)s[t][g]=a[t][g];for(var g=0;g<p;g+=d){d>p-g&&(d=p-g,c.length=d);for(var m=0;m<d;m++){var v=l[g+m];c[m]=f[v],h[m]=v}var y=i(c),v=h[n(c,y)||0];f[v]=y,u.push(v)}return o},x.getItemModel=function(t){var e=this.hostModel;return t=this.indices[t],new d(this._rawData.getItem(t),e,e&&e.ecModel)},x.diff=function(t){var e,i=this._idList,n=t&&t._idList,o="e\0\0";return new f(t?t.indices:[],this.indices,function(t){return null!=(e=n[t])?e:o+t},function(t){return null!=(e=i[t])?e:o+t})},x.getVisual=function(t){var e=this._visual;return e&&e[t]},x.setVisual=function(t,e){if(m(t))for(var i in t)t.hasOwnProperty(i)&&this.setVisual(i,t[i]);else this._visual=this._visual||{},this._visual[t]=e},x.setLayout=function(t,e){if(m(t))for(var i in t)t.hasOwnProperty(i)&&this.setLayout(i,t[i]);else this._layout[t]=e},x.getLayout=function(t){return this._layout[t]},x.getItemLayout=function(t){return this._itemLayouts[t]},x.setItemLayout=function(t,e,i){this._itemLayouts[t]=i?p.extend(this._itemLayouts[t]||{},e):e},x.clearItemLayouts=function(){this._itemLayouts.length=0},x.getItemVisual=function(t,e,i){var n=this._itemVisuals[t],o=n&&n[e];return null!=o||i?o:this.getVisual(e)},x.setItemVisual=function(t,e,i){var n=this._itemVisuals[t]||{};if(this._itemVisuals[t]=n,m(e))for(var o in e)e.hasOwnProperty(o)&&(n[o]=e[o]);else n[e]=i},x.clearAllVisual=function(){this._visual={},this._itemVisuals=[]};var _=function(t){t.seriesIndex=this.seriesIndex,t.dataIndex=this.dataIndex,t.dataType=this.dataType};x.setItemGraphicEl=function(t,e){var i=this.hostModel;e&&(e.dataIndex=t,e.dataType=this.dataType,e.seriesIndex=i&&i.seriesIndex,"group"===e.type&&e.traverse(_,e)),this._graphicEls[t]=e},x.getItemGraphicEl=function(t){return this._graphicEls[t]},x.eachItemGraphicEl=function(t,e){p.each(this._graphicEls,function(i,n){i&&t&&t.call(e,i,n)})},x.cloneShallow=function(){var t=p.map(this.dimensions,this.getDimensionInfo,this),e=new y(t,this.hostModel);return e._storage=this._storage,n(e,this),e.indices=this.indices.slice(),this._extent&&(e._extent=p.extend({},this._extent)),e},x.wrapMethod=function(t,e){var i=this[t];"function"==typeof i&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=i.apply(this,arguments);return e.apply(this,[t].concat(p.slice(arguments)))})},x.TRANSFERABLE_METHODS=["cloneShallow","downSample","map"],x.CHANGABLE_METHODS=["filterSelf"],t.exports=y}).call(e,function(){return this}())},function(t,e,i){function n(t){r.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t),'componentType "'+t+'" illegal')}function o(t,e){var i=r.slice(arguments,2);return this.superClass.prototype[e].apply(t,i)}function a(t,e,i){return this.superClass.prototype[e].apply(t,i)}var r=i(1),s={},l=".",u="___EC__COMPONENT__CONTAINER___",c="\0ec_\0";s.set=function(t,e,i){return t[c+e]=i},s.get=function(t,e){return t[c+e]},s.hasOwn=function(t,e){return t.hasOwnProperty(c+e)};var h=s.parseClassType=function(t){var e={main:"",sub:""};return t&&(t=t.split(l),e.main=t[0]||"",e.sub=t[1]||""),e};s.enableClassExtend=function(t,e){t.$constructor=t,t.extend=function(t){var e=this,i=function(){t.$constructor?t.$constructor.apply(this,arguments):e.apply(this,arguments)};return r.extend(i.prototype,t),i.extend=this.extend,i.superCall=o,i.superApply=a,r.inherits(i,this),i.superClass=e,i}},s.enableClassManagement=function(t,e){function i(t){var e=o[t.main];return e&&e[u]||(e=o[t.main]={},e[u]=!0),e}e=e||{};var o={};if(t.registerClass=function(t,e){if(e)if(n(e),e=h(e),e.sub){if(e.sub!==u){var a=i(e);a[e.sub]=t}}else o[e.main]=t;return t},t.getClass=function(t,e,i){var n=o[t];if(n&&n[u]&&(n=e?n[e]:null),i&&!n)throw new Error(e?"Component "+t+"."+(e||"")+" not exists. Load it first.":t+".type should be specified.");return n},t.getClassesByMainType=function(t){t=h(t);var e=[],i=o[t.main];return i&&i[u]?r.each(i,function(t,i){i!==u&&e.push(t)}):e.push(i),e},t.hasClass=function(t){return t=h(t),!!o[t.main]},t.getAllClassMainTypes=function(){var t=[];return r.each(o,function(e,i){t.push(i)}),t},t.hasSubTypes=function(t){t=h(t);var e=o[t.main];return e&&e[u]},t.parseClassType=h,e.registerWhenExtend){var a=t.extend;a&&(t.extend=function(e){var i=a.call(this,e);return t.registerClass(i,e.type)})}return t},s.setReadOnly=function(t,e){},t.exports=s},function(t,e,i){function n(t,e){var i=t+":"+e;if(l[i])return l[i];for(var n=(t+"").split("\n"),o=0,a=0,r=n.length;a<r;a++)o=Math.max(p.measureText(n[a],e).width,o);return u>c&&(u=0,l={}),u++,l[i]=o,o}function o(t,e,i,o){var a=((t||"")+"").split("\n").length,r=n(t,e),s=n("国",e),l=a*s,u=new d(0,0,r,l);switch(u.lineHeight=s,o){case"bottom":case"alphabetic":u.y-=s;break;case"middle":u.y-=s/2}switch(i){case"end":case"right":u.x-=u.width;break;case"center":u.x-=u.width/2}return u}function a(t,e,i,n){var o=e.x,a=e.y,r=e.height,s=e.width,l=i.height,u=i.lineHeight,c=r/2-l/2+u,h="left";switch(t){case"left":o-=n,a+=c,h="right";break;case"right":o+=n+s,a+=c,h="left";break;case"top":o+=s/2,a-=n+l-u,h="center";break;case"bottom":o+=s/2,a+=r+n+u,h="center";break;case"inside":o+=s/2,a+=c,h="center";break;case"insideLeft":o+=n,a+=c,h="left";break;case"insideRight":o+=s-n,a+=c,h="right";break;case"insideTop":o+=s/2,a+=n+u,h="center";break;case"insideBottom":o+=s/2,a+=r-l-n+u,h="center";break;case"insideTopLeft":o+=n,a+=n+u,h="left";break;case"insideTopRight":o+=s-n,a+=n+u,h="right";break;case"insideBottomLeft":o+=n,a+=r-l-n+u;break;case"insideBottomRight":o+=s-n,a+=r-l-n+u,h="right"}return{x:o,y:a,textAlign:h,textBaseline:"alphabetic"}}function r(t,e,i,o,a){if(!e)return"";a=a||{},o=f(o,"...");for(var r=f(a.maxIterations,2),l=f(a.minChar,0),u=n("国",i),c=n("a",i),h=f(a.placeholder,""),d=e=Math.max(0,e-1),p=0;p<l&&d>=c;p++)d-=c;var g=n(o);g>d&&(o="",g=0),d=e-g;for(var m=(t+"").split("\n"),p=0,v=m.length;p<v;p++){var y=m[p],x=n(y,i);if(!(x<=e)){for(var _=0;;_++){if(x<=d||_>=r){y+=o;break}var b=0===_?s(y,d,c,u):x>0?Math.floor(y.length*d/x):0;y=y.substr(0,b),x=n(y,i)}""===y&&(y=h),m[p]=y}}return m.join("\n")}function s(t,e,i,n){for(var o=0,a=0,r=t.length;a<r&&o<e;a++){var s=t.charCodeAt(a);o+=0<=s&&s<=127?i:n}return a}var l={},u=0,c=5e3,h=i(1),d=i(11),f=h.retrieve,p={getWidth:n,getBoundingRect:o,adjustTextPositionOnRect:a,truncateText:r,measureText:function(t,e){var i=h.getContext();return i.font=e||"12px sans-serif",i.measureText(t)}};t.exports=p},function(t,e,i){"use strict";var n=i(1),o=i(7),a=i(15),r=i(5),s=i(13),l=i(62),u=i(9),c=i(12),h=a.set,d=a.get,f=o.encodeHTML,p=o.addCommas,g=s.extend({type:"series.__base__",seriesIndex:0,coordinateSystem:null,defaultOption:null,legendDataProvider:null,visualColorAccessPath:"itemStyle.normal.color",layoutMode:null,init:function(t,e,i,n){this.seriesIndex=this.componentIndex,this.mergeDefaultAndTheme(t,i);var o=this.getInitialData(t,i);h(this,"dataBeforeProcessed",o),this.restoreData()},mergeDefaultAndTheme:function(t,e){var i=this.layoutMode,o=i?c.getLayoutParams(t):{};n.merge(t,e.getTheme().get(this.subType)),n.merge(t,this.getDefaultOption()),r.defaultEmphasis(t.label,r.LABEL_OPTIONS),this.fillDataTextStyle(t.data),i&&c.mergeLayoutParam(t,o,i)},mergeOption:function(t,e){t=n.merge(this.option,t,!0),this.fillDataTextStyle(t.data);var i=this.layoutMode;i&&c.mergeLayoutParam(this.option,t,i);var o=this.getInitialData(t,e);o&&(h(this,"data",o),h(this,"dataBeforeProcessed",o.cloneShallow()))},fillDataTextStyle:function(t){if(t)for(var e=0;e<t.length;e++)t[e]&&t[e].label&&r.defaultEmphasis(t[e].label,r.LABEL_OPTIONS)},getInitialData:function(){},getData:function(t){var e=d(this,"data");return null==t?e:e.getLinkedData(t)},setData:function(t){h(this,"data",t)},getRawData:function(){return d(this,"dataBeforeProcessed")},coordDimToDataDim:function(t){return r.coordDimToDataDim(this.getData(),t)},dataDimToCoordDim:function(t){return r.dataDimToCoordDim(this.getData(),t)},getBaseAxis:function(){var t=this.coordinateSystem;return t&&t.getBaseAxis&&t.getBaseAxis()},formatTooltip:function(t,e,i){function a(i){function a(t,i){var n=s.getDimensionInfo(i);if(n&&n.otherDims.tooltip!==!1){var a=n.type,r=(l?"- "+(n.tooltipName||n.name)+": ":"")+("ordinal"===a?t+"":"time"===a?e?"":o.formatTime("yyyy/MM/dd hh:mm:ss",t):p(t));r&&u.push(f(r))}}var l=n.reduce(i,function(t,e,i){var n=s.getDimensionInfo(i);return t|=n&&n.tooltip!==!1&&null!=n.tooltipName},0),u=[],c=r.otherDimToDataDim(s,"tooltip");return c.length?n.each(c,function(e){a(s.get(e,t),e)}):n.each(i,a),(l?"<br/>":"")+u.join(l?"<br/>":", ")}var s=d(this,"data"),l=this.getRawValue(t),u=n.isArray(l)?a(l):f(p(l)),c=s.getName(t),h=s.getItemVisual(t,"color");n.isObject(h)&&h.colorStops&&(h=(h.colorStops[0]||{}).color),h=h||"transparent";var g=o.getTooltipMarker(h),m=this.name;return"\0-"===m&&(m=""),m=m?f(m)+(e?": ":"<br/>"):"",e?g+m+u:m+g+(c?f(c)+": "+u:u)},isAnimationEnabled:function(){if(u.node)return!1;var t=this.getShallow("animation");return t&&this.getData().count()>this.getShallow("animationThreshold")&&(t=!1),t},restoreData:function(){h(this,"data",d(this,"dataBeforeProcessed").cloneShallow())},getColorFromPalette:function(t,e){var i=this.ecModel,n=l.getColorFromPalette.call(this,t,e);return n||(n=i.getColorFromPalette(t,e)),n},getAxisTooltipData:null,getTooltipPosition:null});n.mixin(g,r.dataFormatMixin),n.mixin(g,l),t.exports=g},function(t,e,i){var n=i(149),o=i(43);i(150),i(148);var a=i(34),r=i(4),s=i(1),l=i(16),u={};u.getScaleExtent=function(t,e){var i,n,o,a=t.type,l=e.getMin(),u=e.getMax(),c=null!=l,h=null!=u,d=t.getExtent();return"ordinal"===a?i=(e.get("data")||[]).length:(n=e.get("boundaryGap"),s.isArray(n)||(n=[n||0,n||0]),"boolean"==typeof n[0]&&(n=[0,0]),n[0]=r.parsePercent(n[0],1),n[1]=r.parsePercent(n[1],1),o=d[1]-d[0]||Math.abs(d[0])),null==l&&(l="ordinal"===a?i?0:NaN:d[0]-n[0]*o),null==u&&(u="ordinal"===a?i?i-1:NaN:d[1]+n[1]*o),"dataMin"===l&&(l=d[0]),"dataMax"===u&&(u=d[1]),(null==l||!isFinite(l))&&(l=NaN),(null==u||!isFinite(u))&&(u=NaN),t.setBlank(s.eqNaN(l)||s.eqNaN(u)),e.getNeedCrossZero()&&(l>0&&u>0&&!c&&(l=0),l<0&&u<0&&!h&&(u=0)),[l,u]},u.niceScaleExtent=function(t,e){var i=u.getScaleExtent(t,e),n=null!=e.getMin(),o=null!=e.getMax(),a=e.get("splitNumber");"log"===t.type&&(t.base=e.get("logBase")),t.setExtent(i[0],i[1]),t.niceExtent({splitNumber:a,fixMin:n,fixMax:o,minInterval:"interval"===t.type?e.get("minInterval"):null});var r=e.get("interval");null!=r&&t.setInterval&&t.setInterval(r)},u.createScaleByModel=function(t,e){if(e=e||t.get("type"))switch(e){case"category":return new n(t.getCategories(),[1/0,-(1/0)]);case"value":return new o;default:return(a.getClass(e)||o).create(t)}},u.ifAxisCrossZero=function(t){var e=t.scale.getExtent(),i=e[0],n=e[1];return!(i>0&&n>0||i<0&&n<0)},u.getAxisLabelInterval=function(t,e,i,n){var o,a=0,r=0,s=1;e.length>40&&(s=Math.floor(e.length/40));for(var u=0;u<t.length;u+=s){var c=t[u],h=l.getBoundingRect(e[u],i,"center","top");h[n?"x":"y"]+=c,h[n?"width":"height"]*=1.3,o?o.intersect(h)?(r++,a=Math.max(a,r)):(o.union(h),r=0):o=h.clone()}return 0===a&&s>1?s:(a+1)*s-1},u.getFormattedLabels=function(t,e){var i=t.scale,n=i.getTicksLabels(),o=i.getTicks();return"string"==typeof e?(e=function(t){return function(e){return t.replace("{value}",null!=e?e:"")}}(e),s.map(n,e)):"function"==typeof e?s.map(o,function(i,n){return e(u.getAxisRawValue(t,i),n)},this):n},u.getAxisRawValue=function(t,e){return"category"===t.type?t.scale.getLabel(e):e},t.exports=u},function(t,e){var i="undefined"==typeof Float32Array?Array:Float32Array,n={create:function(){var t=new i(6);return n.identity(t),t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},mul:function(t,e,i){var n=e[0]*i[0]+e[2]*i[1],o=e[1]*i[0]+e[3]*i[1],a=e[0]*i[2]+e[2]*i[3],r=e[1]*i[2]+e[3]*i[3],s=e[0]*i[4]+e[2]*i[5]+e[4],l=e[1]*i[4]+e[3]*i[5]+e[5];return t[0]=n,t[1]=o,t[2]=a,t[3]=r,t[4]=s,t[5]=l,t},translate:function(t,e,i){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+i[0],t[5]=e[5]+i[1],t},rotate:function(t,e,i){var n=e[0],o=e[2],a=e[4],r=e[1],s=e[3],l=e[5],u=Math.sin(i),c=Math.cos(i);return t[0]=n*c+r*u,t[1]=-n*u+r*c,t[2]=o*c+s*u,t[3]=-o*u+c*s,t[4]=c*a+u*l,t[5]=c*l-u*a,t},scale:function(t,e,i){var n=i[0],o=i[1];return t[0]=e[0]*n,t[1]=e[1]*o,t[2]=e[2]*n,t[3]=e[3]*o,t[4]=e[4]*n,t[5]=e[5]*o,t},invert:function(t,e){var i=e[0],n=e[2],o=e[4],a=e[1],r=e[3],s=e[5],l=i*r-a*n;return l?(l=1/l,t[0]=r*l,t[1]=-a*l,t[2]=-n*l,t[3]=i*l,t[4]=(n*s-r*o)*l,t[5]=(a*o-i*s)*l,t):null}};t.exports=n},function(t,e,i){"use strict";function n(t){return t>-w&&t<w}function o(t){return t>w||t<-w}function a(t,e,i,n,o){var a=1-o;return a*a*(a*t+3*o*e)+o*o*(o*n+3*a*i)}function r(t,e,i,n,o){var a=1-o;return 3*(((e-t)*a+2*(i-e)*o)*a+(n-i)*o*o)}function s(t,e,i,o,a,r){var s=o+3*(e-i)-t,l=3*(i-2*e+t),u=3*(e-t),c=t-a,h=l*l-3*s*u,d=l*u-9*s*c,f=u*u-3*l*c,p=0;if(n(h)&&n(d))if(n(l))r[0]=0;else{var g=-u/l;g>=0&&g<=1&&(r[p++]=g)}else{var m=d*d-4*h*f;if(n(m)){var v=d/h,g=-l/s+v,y=-v/2;g>=0&&g<=1&&(r[p++]=g),y>=0&&y<=1&&(r[p++]=y)}else if(m>0){var x=b(m),w=h*l+1.5*s*(-d+x),S=h*l+1.5*s*(-d-x);w=w<0?-_(-w,I):_(w,I),S=S<0?-_(-S,I):_(S,I);var g=(-l-(w+S))/(3*s);g>=0&&g<=1&&(r[p++]=g)}else{var T=(2*h*l-3*s*d)/(2*b(h*h*h)),A=Math.acos(T)/3,C=b(h),L=Math.cos(A),g=(-l-2*C*L)/(3*s),y=(-l+C*(L+M*Math.sin(A)))/(3*s),D=(-l+C*(L-M*Math.sin(A)))/(3*s);g>=0&&g<=1&&(r[p++]=g),y>=0&&y<=1&&(r[p++]=y),D>=0&&D<=1&&(r[p++]=D)}}return p}function l(t,e,i,a,r){var s=6*i-12*e+6*t,l=9*e+3*a-3*t-9*i,u=3*e-3*t,c=0;if(n(l)){if(o(s)){var h=-u/s;h>=0&&h<=1&&(r[c++]=h)}}else{var d=s*s-4*l*u;if(n(d))r[0]=-s/(2*l);else if(d>0){var f=b(d),h=(-s+f)/(2*l),p=(-s-f)/(2*l);h>=0&&h<=1&&(r[c++]=h),p>=0&&p<=1&&(r[c++]=p)}}return c}function u(t,e,i,n,o,a){var r=(e-t)*o+t,s=(i-e)*o+e,l=(n-i)*o+i,u=(s-r)*o+r,c=(l-s)*o+s,h=(c-u)*o+u;a[0]=t,a[1]=r,a[2]=u,a[3]=h,a[4]=h,a[5]=c,a[6]=l,a[7]=n}function c(t,e,i,n,o,r,s,l,u,c,h){var d,f,p,g,m,v=.005,y=1/0;T[0]=u,T[1]=c;for(var _=0;_<1;_+=.05)A[0]=a(t,i,o,s,_),A[1]=a(e,n,r,l,_),g=x(T,A),g<y&&(d=_,y=g);y=1/0;for(var w=0;w<32&&!(v<S);w++)f=d-v,p=d+v,A[0]=a(t,i,o,s,f),A[1]=a(e,n,r,l,f),g=x(A,T),f>=0&&g<y?(d=f,y=g):(C[0]=a(t,i,o,s,p),C[1]=a(e,n,r,l,p),m=x(C,T),p<=1&&m<y?(d=p,y=m):v*=.5);return h&&(h[0]=a(t,i,o,s,d),h[1]=a(e,n,r,l,d)),b(y)}function h(t,e,i,n){var o=1-n;return o*(o*t+2*n*e)+n*n*i}function d(t,e,i,n){return 2*((1-n)*(e-t)+n*(i-e))}function f(t,e,i,a,r){var s=t-2*e+i,l=2*(e-t),u=t-a,c=0;if(n(s)){if(o(l)){var h=-u/l;h>=0&&h<=1&&(r[c++]=h)}}else{var d=l*l-4*s*u;if(n(d)){var h=-l/(2*s);h>=0&&h<=1&&(r[c++]=h)}else if(d>0){var f=b(d),h=(-l+f)/(2*s),p=(-l-f)/(2*s);h>=0&&h<=1&&(r[c++]=h),p>=0&&p<=1&&(r[c++]=p)}}return c}function p(t,e,i){var n=t+i-2*e;return 0===n?.5:(t-e)/n}function g(t,e,i,n,o){var a=(e-t)*n+t,r=(i-e)*n+e,s=(r-a)*n+a;o[0]=t,o[1]=a,o[2]=s,o[3]=s,o[4]=r,o[5]=i}function m(t,e,i,n,o,a,r,s,l){var u,c=.005,d=1/0;T[0]=r,T[1]=s;for(var f=0;f<1;f+=.05){A[0]=h(t,i,o,f),A[1]=h(e,n,a,f);var p=x(T,A);p<d&&(u=f,d=p)}d=1/0;for(var g=0;g<32&&!(c<S);g++){var m=u-c,v=u+c;A[0]=h(t,i,o,m),A[1]=h(e,n,a,m);var p=x(A,T);if(m>=0&&p<d)u=m,d=p;else{C[0]=h(t,i,o,v),C[1]=h(e,n,a,v);var y=x(C,T);v<=1&&y<d?(u=v,d=y):c*=.5}}return l&&(l[0]=h(t,i,o,u),l[1]=h(e,n,a,u)),b(d)}var v=i(6),y=v.create,x=v.distSquare,_=Math.pow,b=Math.sqrt,w=1e-8,S=1e-4,M=b(3),I=1/3,T=y(),A=y(),C=y();t.exports={cubicAt:a,cubicDerivativeAt:r,cubicRootAt:s,cubicExtrema:l,cubicSubdivide:u,cubicProjectPoint:c,quadraticAt:h,quadraticDerivativeAt:d,quadraticRootAt:f,quadraticExtremum:p,quadraticSubdivide:g,quadraticProjectPoint:m}},function(t,e,i){"use strict";function n(t){return t.getBoundingClientRect?t.getBoundingClientRect():{left:0,top:0}}function o(t,e,i,n){return i=i||{},n||!c.canvasSupported?a(t,e,i):c.browser.firefox&&null!=e.layerX&&e.layerX!==e.offsetX?(i.zrX=e.layerX,i.zrY=e.layerY):null!=e.offsetX?(i.zrX=e.offsetX,i.zrY=e.offsetY):a(t,e,i),i}function a(t,e,i){var o=n(t);i.zrX=e.clientX-o.left,i.zrY=e.clientY-o.top}function r(t,e,i){if(e=e||window.event,null!=e.zrX)return e;var n=e.type,a=n&&n.indexOf("touch")>=0;if(a){var r="touchend"!=n?e.targetTouches[0]:e.changedTouches[0];r&&o(t,r,e,i)}else o(t,e,e,i),e.zrDelta=e.wheelDelta?e.wheelDelta/120:-(e.detail||0)/3;return e}function s(t,e,i){h?t.addEventListener(e,i):t.attachEvent("on"+e,i)}function l(t,e,i){h?t.removeEventListener(e,i):t.detachEvent("on"+e,i)}var u=i(23),c=i(9),h="undefined"!=typeof window&&!!window.addEventListener,d=h?function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}:function(t){t.returnValue=!1,t.cancelBubble=!0};t.exports={clientToLocal:o,normalizeEvent:r,addEventListener:s,removeEventListener:l,stop:d,Dispatcher:u}},function(t,e,i){function n(t){return t=Math.round(t),t<0?0:t>255?255:t}function o(t){return t=Math.round(t),t<0?0:t>360?360:t}function a(t){return t<0?0:t>1?1:t}function r(t){return n(t.length&&"%"===t.charAt(t.length-1)?parseFloat(t)/100*255:parseInt(t,10))}function s(t){return a(t.length&&"%"===t.charAt(t.length-1)?parseFloat(t)/100:parseFloat(t))}function l(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}function u(t,e,i){return t+(e-t)*i}function c(t,e,i,n,o){return t[0]=e,t[1]=i,t[2]=n,t[3]=o,t}function h(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function d(t,e){T&&h(T,e),T=I.put(t,T||e.slice())}function f(t,e){if(t){e=e||[];var i=I.get(t);if(i)return h(e,i);t+="";var n=t.replace(/ /g,"").toLowerCase();if(n in M)return h(e,M[n]),d(t,e),e;if("#"!==n.charAt(0)){var o=n.indexOf("("),a=n.indexOf(")");if(o!==-1&&a+1===n.length){var l=n.substr(0,o),u=n.substr(o+1,a-(o+1)).split(","),f=1;switch(l){case"rgba":if(4!==u.length)return void c(e,0,0,0,1);f=s(u.pop());case"rgb":return 3!==u.length?void c(e,0,0,0,1):(c(e,r(u[0]),r(u[1]),r(u[2]),f),d(t,e),e);case"hsla":return 4!==u.length?void c(e,0,0,0,1):(u[3]=s(u[3]),p(u,e),d(t,e),e);case"hsl":return 3!==u.length?void c(e,0,0,0,1):(p(u,e),d(t,e),e);default:return}}c(e,0,0,0,1)}else{if(4===n.length){var g=parseInt(n.substr(1),16);return g>=0&&g<=4095?(c(e,(3840&g)>>4|(3840&g)>>8,240&g|(240&g)>>4,15&g|(15&g)<<4,1),d(t,e),e):void c(e,0,0,0,1)}if(7===n.length){var g=parseInt(n.substr(1),16);return g>=0&&g<=16777215?(c(e,(16711680&g)>>16,(65280&g)>>8,255&g,1),d(t,e),e):void c(e,0,0,0,1)}}}}function p(t,e){var i=(parseFloat(t[0])%360+360)%360/360,o=s(t[1]),a=s(t[2]),r=a<=.5?a*(o+1):a+o-a*o,u=2*a-r;return e=e||[],c(e,n(255*l(u,r,i+1/3)),n(255*l(u,r,i)),n(255*l(u,r,i-1/3)),1),4===t.length&&(e[3]=t[3]),e}function g(t){if(t){var e,i,n=t[0]/255,o=t[1]/255,a=t[2]/255,r=Math.min(n,o,a),s=Math.max(n,o,a),l=s-r,u=(s+r)/2;if(0===l)e=0,i=0;else{i=u<.5?l/(s+r):l/(2-s-r);var c=((s-n)/6+l/2)/l,h=((s-o)/6+l/2)/l,d=((s-a)/6+l/2)/l;n===s?e=d-h:o===s?e=1/3+c-d:a===s&&(e=2/3+h-c),e<0&&(e+=1),e>1&&(e-=1)}var f=[360*e,i,u];return null!=t[3]&&f.push(t[3]),f}}function m(t,e){var i=f(t);if(i){for(var n=0;n<3;n++)e<0?i[n]=i[n]*(1-e)|0:i[n]=(255-i[n])*e+i[n]|0;return w(i,4===i.length?"rgba":"rgb")}}function v(t,e){var i=f(t);if(i)return((1<<24)+(i[0]<<16)+(i[1]<<8)+ +i[2]).toString(16).slice(1)}function y(t,e,i){if(e&&e.length&&t>=0&&t<=1){i=i||[];var o=t*(e.length-1),r=Math.floor(o),s=Math.ceil(o),l=e[r],c=e[s],h=o-r;return i[0]=n(u(l[0],c[0],h)),i[1]=n(u(l[1],c[1],h)),i[2]=n(u(l[2],c[2],h)),i[3]=a(u(l[3],c[3],h)),i}}function x(t,e,i){if(e&&e.length&&t>=0&&t<=1){var o=t*(e.length-1),r=Math.floor(o),s=Math.ceil(o),l=f(e[r]),c=f(e[s]),h=o-r,d=w([n(u(l[0],c[0],h)),n(u(l[1],c[1],h)),n(u(l[2],c[2],h)),a(u(l[3],c[3],h))],"rgba");return i?{color:d,leftIndex:r,rightIndex:s,value:o}:d}}function _(t,e,i,n){if(t=f(t))return t=g(t),null!=e&&(t[0]=o(e)),null!=i&&(t[1]=s(i)),null!=n&&(t[2]=s(n)),w(p(t),"rgba")}function b(t,e){if(t=f(t),t&&null!=e)return t[3]=a(e),w(t,"rgba")}function w(t,e){if(t&&t.length){var i=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(i+=","+t[3]),e+"("+i+")"}}var S=i(70),M={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]},I=new S(20),T=null;t.exports={parse:f,lift:m,toHex:v,fastMapToColor:y,mapToColor:x,modifyHSL:_,modifyAlpha:b,stringify:w}},function(t,e){var i=Array.prototype.slice,n=function(){this._$handlers={}};n.prototype={constructor:n,one:function(t,e,i){var n=this._$handlers;if(!e||!t)return this;n[t]||(n[t]=[]);for(var o=0;o<n[t].length;o++)if(n[t][o].h===e)return this;return n[t].push({h:e,one:!0,ctx:i||this}),this},on:function(t,e,i){var n=this._$handlers;if(!e||!t)return this;n[t]||(n[t]=[]);for(var o=0;o<n[t].length;o++)if(n[t][o].h===e)return this;return n[t].push({h:e,one:!1,ctx:i||this}),this},isSilent:function(t){var e=this._$handlers;return e[t]&&e[t].length},off:function(t,e){var i=this._$handlers;if(!t)return this._$handlers={},this;if(e){if(i[t]){for(var n=[],o=0,a=i[t].length;o<a;o++)i[t][o].h!=e&&n.push(i[t][o]);i[t]=n}i[t]&&0===i[t].length&&delete i[t]}else delete i[t];return this},trigger:function(t){if(this._$handlers[t]){var e=arguments,n=e.length;n>3&&(e=i.call(e,1));for(var o=this._$handlers[t],a=o.length,r=0;r<a;){switch(n){case 1:o[r].h.call(o[r].ctx);break;case 2:o[r].h.call(o[r].ctx,e[1]);break;case 3:o[r].h.call(o[r].ctx,e[1],e[2]);break;default:o[r].h.apply(o[r].ctx,e)}o[r].one?(o.splice(r,1),a--):r++}}return this},triggerWithContext:function(t){if(this._$handlers[t]){var e=arguments,n=e.length;n>4&&(e=i.call(e,1,e.length-1));for(var o=e[e.length-1],a=this._$handlers[t],r=a.length,s=0;s<r;){switch(n){case 1:a[s].h.call(o);break;case 2:a[s].h.call(o,e[1]);break;case 3:a[s].h.call(o,e[1],e[2]);break;default:a[s].h.apply(o,e)}a[s].one?(a.splice(s,1),r--):s++}}return this}},t.exports=n},function(t,e,i){"use strict";var n=i(3),o=i(11),a=n.extendShape({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var i=e.cx,n=e.cy,o=e.width/2,a=e.height/2;t.moveTo(i,n-a),t.lineTo(i+o,n+a),t.lineTo(i-o,n+a),t.closePath()}}),r=n.extendShape({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var i=e.cx,n=e.cy,o=e.width/2,a=e.height/2;t.moveTo(i,n-a),t.lineTo(i+o,n),t.lineTo(i,n+a),t.lineTo(i-o,n),t.closePath()}}),s=n.extendShape({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var i=e.x,n=e.y,o=e.width/5*3,a=Math.max(o,e.height),r=o/2,s=r*r/(a-r),l=n-a+r+s,u=Math.asin(s/r),c=Math.cos(u)*r,h=Math.sin(u),d=Math.cos(u);t.arc(i,l,r,Math.PI-u,2*Math.PI+u);var f=.6*r,p=.7*r;t.bezierCurveTo(i+c-h*f,l+s+d*f,i,n-p,i,n),t.bezierCurveTo(i,n-p,i-c+h*f,l+s+d*f,i-c,l+s),t.closePath()}}),l=n.extendShape({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var i=e.height,n=e.width,o=e.x,a=e.y,r=n/3*2;t.moveTo(o,a),t.lineTo(o+r,a+i),t.lineTo(o,a+i/4*3),t.lineTo(o-r,a+i),t.lineTo(o,a),t.closePath()}}),u={line:n.Line,rect:n.Rect,roundRect:n.Rect,square:n.Rect,circle:n.Circle,diamond:r,pin:s,arrow:l,triangle:a},c={line:function(t,e,i,n,o){o.x1=t,o.y1=e+n/2,o.x2=t+i,o.y2=e+n/2},rect:function(t,e,i,n,o){o.x=t,o.y=e,o.width=i,o.height=n},roundRect:function(t,e,i,n,o){o.x=t,o.y=e,o.width=i,o.height=n,o.r=Math.min(i,n)/4},square:function(t,e,i,n,o){var a=Math.min(i,n);o.x=t,o.y=e,o.width=a,o.height=a},circle:function(t,e,i,n,o){o.cx=t+i/2,o.cy=e+n/2,o.r=Math.min(i,n)/2},diamond:function(t,e,i,n,o){o.cx=t+i/2,o.cy=e+n/2,o.width=i,o.height=n},pin:function(t,e,i,n,o){o.x=t+i/2,o.y=e+n/2,o.width=i,o.height=n},arrow:function(t,e,i,n,o){o.x=t+i/2,o.y=e+n/2,o.width=i,o.height=n},triangle:function(t,e,i,n,o){o.cx=t+i/2,o.cy=e+n/2,o.width=i,o.height=n}},h={};for(var d in u)u.hasOwnProperty(d)&&(h[d]=new u[d]);var f=n.extendShape({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},beforeBrush:function(){var t=this.style,e=this.shape;"pin"===e.symbolType&&"inside"===t.textPosition&&(t.textPosition=["50%","40%"],t.textAlign="center",t.textVerticalAlign="middle")},buildPath:function(t,e,i){var n=e.symbolType,o=h[n];"none"!==e.symbolType&&(o||(n="rect",o=h[n]),c[n](e.x,e.y,e.width,e.height,o.shape),o.buildPath(t,o.shape,i))}}),p=function(t){if("image"!==this.type){var e=this.style,i=this.shape;i&&"line"===i.symbolType?e.stroke=t:this.__isEmptyBrush?(e.stroke=t,e.fill="#fff"):(e.fill&&(e.fill=t),e.stroke&&(e.stroke=t)),this.dirty(!1)}},g={createSymbol:function(t,e,i,a,r,s){var l=0===t.indexOf("empty");l&&(t=t.substr(5,1).toLowerCase()+t.substr(6));var u;return u=0===t.indexOf("image://")?new n.Image({style:{image:t.slice(8),x:e,y:i,width:a,height:r}}):0===t.indexOf("path://")?n.makePath(t.slice(7),{},new o(e,i,a,r)):new f({shape:{symbolType:t,x:e,y:i,width:a,height:r}}),u.__isEmptyBrush=l,u.setColor=p,u.setColor(s),u}};t.exports=g},function(t,e,i){function n(t,e,i){function n(t,e,i){h[e]?t.otherDims[e]=i:(t.coordDim=e,t.coordDimIndex=i,m.set(e,!0))}function r(t,e,i){if(i||null!=e.get(t)){for(var n=0;null!=e.get(t+n);)n++;t+=n}return e.set(t,!0),t}e=e||[],i=i||{},t=(t||[]).slice();var f=(i.dimsDef||[]).slice(),p=a.createHashMap(i.encodeDef),g=a.createHashMap(),m=a.createHashMap(),v=[],y=i.dimCount;if(null==y){var x=o(e[0]);y=Math.max(a.isArray(x)&&x.length||1,t.length,f.length),s(t,function(t){var e=t.dimsDef;e&&(y=Math.max(y,e.length))})}for(var _=0;_<y;_++){var b=l(f[_])?{name:f[_]}:f[_]||{},w=b.name,S=v[_]={otherDims:{}};null!=w&&null==g.get(w)&&(S.name=S.tooltipName=w,g.set(w,_)),null!=b.type&&(S.type=b.type)}p.each(function(t,e){t=p.set(e,c(t).slice()),s(t,function(i,o){l(i)&&(i=g.get(i)),null!=i&&i<y&&(t[o]=i,n(v[i],e,o))})});var M=0;s(t,function(t,e){var i,t,o,r;l(t)?(i=t,t={}):(i=t.name,t=a.clone(t),o=t.dimsDef,r=t.otherDims,t.name=t.coordDim=t.coordDimIndex=t.dimsDef=t.otherDims=null);var h=c(p.get(i));if(!h.length)for(var d=0;d<(o&&o.length||1);d++){for(;M<v.length&&null!=v[M].coordDim;)M++;M<v.length&&h.push(M++)}s(h,function(e,a){var s=v[e];n(u(s,t),i,a),null==s.name&&o&&(s.name=s.tooltipName=o[a]),r&&u(s.otherDims,r)})});for(var I=i.extraPrefix||"value",T=0;T<y;T++){var S=v[T]=v[T]||{},A=S.coordDim;null==A&&(S.coordDim=r(I,m,i.extraFromZero),S.coordDimIndex=0,S.isExtraCoord=!0),null==S.name&&(S.name=r(S.coordDim,g)),null==S.type&&d(e,T)&&(S.type="ordinal")}return v}function o(t){return a.isArray(t)?t:a.isObject(t)?t.value:t}var a=i(1),r=i(5),s=a.each,l=a.isString,u=a.defaults,c=r.normalizeToArray,h={tooltip:1,label:1,itemName:1},d=n.guessOrdinal=function(t,e){for(var i=0,n=t.length;i<n;i++){var r=o(t[i]);if(!a.isArray(r))return!1;var r=r[e];if(null!=r&&isFinite(r))return!1;if(l(r)&&"-"!==r)return!0}return!1};t.exports=n},function(t,e,i){"use strict";function n(){this._coordinateSystems=[]}var o=i(1),a={};n.prototype={constructor:n,create:function(t,e){var i=[];o.each(a,function(n,o){var a=n.create(t,e);i=i.concat(a||[])}),this._coordinateSystems=i},update:function(t,e){o.each(this._coordinateSystems,function(i){i.update&&i.update(t,e)})},getCoordinateSystems:function(){return this._coordinateSystems.slice()}},n.register=function(t,e){a[t]=e},n.get=function(t){return a[t]},t.exports=n},function(t,e,i){"use strict";var n=i(20),o=i(6),a=i(85),r=i(11),s=i(35).devicePixelRatio,l={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},u=[],c=[],h=[],d=[],f=Math.min,p=Math.max,g=Math.cos,m=Math.sin,v=Math.sqrt,y=Math.abs,x="undefined"!=typeof Float32Array,_=function(t){this._saveData=!t,this._saveData&&(this.data=[]),this._ctx=null};_.prototype={constructor:_,_xi:0,_yi:0,_x0:0,_y0:0,_ux:0,_uy:0,_len:0,_lineDash:null,_dashOffset:0,_dashIdx:0,_dashSum:0,setScale:function(t,e){this._ux=y(1/s/t)||0,this._uy=y(1/s/e)||0},getContext:function(){return this._ctx},beginPath:function(t){return this._ctx=t,t&&t.beginPath(),t&&(this.dpr=t.dpr),this._saveData&&(this._len=0),this._lineDash&&(this._lineDash=null,this._dashOffset=0),this},moveTo:function(t,e){return this.addData(l.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},lineTo:function(t,e){var i=y(t-this._xi)>this._ux||y(e-this._yi)>this._uy||this._len<5;return this.addData(l.L,t,e),this._ctx&&i&&(this._needsDash()?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),i&&(this._xi=t,this._yi=e),this},bezierCurveTo:function(t,e,i,n,o,a){return this.addData(l.C,t,e,i,n,o,a),this._ctx&&(this._needsDash()?this._dashedBezierTo(t,e,i,n,o,a):this._ctx.bezierCurveTo(t,e,i,n,o,a)),this._xi=o,this._yi=a,this},quadraticCurveTo:function(t,e,i,n){return this.addData(l.Q,t,e,i,n),this._ctx&&(this._needsDash()?this._dashedQuadraticTo(t,e,i,n):this._ctx.quadraticCurveTo(t,e,i,n)),this._xi=i,this._yi=n,this},arc:function(t,e,i,n,o,a){return this.addData(l.A,t,e,i,i,n,o-n,0,a?0:1),this._ctx&&this._ctx.arc(t,e,i,n,o,a),this._xi=g(o)*i+t,this._yi=m(o)*i+t,this},arcTo:function(t,e,i,n,o){return this._ctx&&this._ctx.arcTo(t,e,i,n,o),this},rect:function(t,e,i,n){return this._ctx&&this._ctx.rect(t,e,i,n),this.addData(l.R,t,e,i,n),this},closePath:function(){this.addData(l.Z);var t=this._ctx,e=this._x0,i=this._y0;return t&&(this._needsDash()&&this._dashedLineTo(e,i),t.closePath()),this._xi=e,this._yi=i,this},fill:function(t){t&&t.fill(),this.toStatic()},stroke:function(t){t&&t.stroke(),this.toStatic()},setLineDash:function(t){if(t instanceof Array){this._lineDash=t,this._dashIdx=0;for(var e=0,i=0;i<t.length;i++)e+=t[i];this._dashSum=e}return this},setLineDashOffset:function(t){return this._dashOffset=t,this},len:function(){return this._len},setData:function(t){var e=t.length;this.data&&this.data.length==e||!x||(this.data=new Float32Array(e));for(var i=0;i<e;i++)this.data[i]=t[i];this._len=e},appendPath:function(t){t instanceof Array||(t=[t]);for(var e=t.length,i=0,n=this._len,o=0;o<e;o++)i+=t[o].len();x&&this.data instanceof Float32Array&&(this.data=new Float32Array(n+i));for(var o=0;o<e;o++)for(var a=t[o].data,r=0;r<a.length;r++)this.data[n++]=a[r];this._len=n},addData:function(t){if(this._saveData){var e=this.data;this._len+arguments.length>e.length&&(this._expandData(),e=this.data);for(var i=0;i<arguments.length;i++)e[this._len++]=arguments[i];this._prevCmd=t}},_expandData:function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e<this._len;e++)t[e]=this.data[e];this.data=t}},_needsDash:function(){return this._lineDash},_dashedLineTo:function(t,e){var i,n,o=this._dashSum,a=this._dashOffset,r=this._lineDash,s=this._ctx,l=this._xi,u=this._yi,c=t-l,h=e-u,d=v(c*c+h*h),g=l,m=u,y=r.length;for(c/=d,h/=d,a<0&&(a=o+a),a%=o,g-=a*c,m-=a*h;c>0&&g<=t||c<0&&g>=t||0==c&&(h>0&&m<=e||h<0&&m>=e);)n=this._dashIdx,i=r[n],g+=c*i,m+=h*i,this._dashIdx=(n+1)%y,c>0&&g<l||c<0&&g>l||h>0&&m<u||h<0&&m>u||s[n%2?"moveTo":"lineTo"](c>=0?f(g,t):p(g,t),h>=0?f(m,e):p(m,e));c=g-t,h=m-e,this._dashOffset=-v(c*c+h*h)},_dashedBezierTo:function(t,e,i,o,a,r){var s,l,u,c,h,d=this._dashSum,f=this._dashOffset,p=this._lineDash,g=this._ctx,m=this._xi,y=this._yi,x=n.cubicAt,_=0,b=this._dashIdx,w=p.length,S=0;for(f<0&&(f=d+f),f%=d,s=0;s<1;s+=.1)l=x(m,t,i,a,s+.1)-x(m,t,i,a,s),u=x(y,e,o,r,s+.1)-x(y,e,o,r,s),_+=v(l*l+u*u);for(;b<w&&(S+=p[b],!(S>f));b++);for(s=(S-f)/_;s<=1;)c=x(m,t,i,a,s),h=x(y,e,o,r,s),b%2?g.moveTo(c,h):g.lineTo(c,h),s+=p[b]/_,b=(b+1)%w;b%2!==0&&g.lineTo(a,r),l=a-c,u=r-h,this._dashOffset=-v(l*l+u*u)},_dashedQuadraticTo:function(t,e,i,n){var o=i,a=n;i=(i+2*t)/3,n=(n+2*e)/3,t=(this._xi+2*t)/3,e=(this._yi+2*e)/3,this._dashedBezierTo(t,e,i,n,o,a)},toStatic:function(){var t=this.data;t instanceof Array&&(t.length=this._len,x&&(this.data=new Float32Array(t)))},getBoundingRect:function(){u[0]=u[1]=h[0]=h[1]=Number.MAX_VALUE,c[0]=c[1]=d[0]=d[1]=-Number.MAX_VALUE;for(var t=this.data,e=0,i=0,n=0,s=0,f=0;f<t.length;){var p=t[f++];switch(1==f&&(e=t[f],i=t[f+1],n=e,s=i),p){case l.M:n=t[f++],s=t[f++],e=n,i=s,h[0]=n,h[1]=s,d[0]=n,d[1]=s;break;case l.L:a.fromLine(e,i,t[f],t[f+1],h,d),e=t[f++],i=t[f++];break;case l.C:a.fromCubic(e,i,t[f++],t[f++],t[f++],t[f++],t[f],t[f+1],h,d),e=t[f++],i=t[f++];break;case l.Q:a.fromQuadratic(e,i,t[f++],t[f++],t[f],t[f+1],h,d),e=t[f++],i=t[f++];break;case l.A:var v=t[f++],y=t[f++],x=t[f++],_=t[f++],b=t[f++],w=t[f++]+b,S=(t[f++],1-t[f++]);1==f&&(n=g(b)*x+v,s=m(b)*_+y),a.fromArc(v,y,x,_,b,w,S,h,d),e=g(w)*x+v,i=m(w)*_+y;break;case l.R:n=e=t[f++],s=i=t[f++];var M=t[f++],I=t[f++];a.fromLine(n,s,n+M,s+I,h,d);break;case l.Z:e=n,i=s}o.min(u,u,h),o.max(c,c,d)}return 0===f&&(u[0]=u[1]=c[0]=c[1]=0),new r(u[0],u[1],c[0]-u[0],c[1]-u[1])},rebuildPath:function(t){for(var e,i,n,o,a,r,s=this.data,u=this._ux,c=this._uy,h=this._len,d=0;d<h;){var f=s[d++];switch(1==d&&(n=s[d],o=s[d+1],e=n,i=o),f){case l.M:e=n=s[d++],i=o=s[d++],t.moveTo(n,o);break;case l.L:a=s[d++],r=s[d++],(y(a-n)>u||y(r-o)>c||d===h-1)&&(t.lineTo(a,r),n=a,o=r);break;case l.C:t.bezierCurveTo(s[d++],s[d++],s[d++],s[d++],s[d++],s[d++]),n=s[d-2],o=s[d-1];break;case l.Q:t.quadraticCurveTo(s[d++],s[d++],s[d++],s[d++]),n=s[d-2],o=s[d-1];break;case l.A:var p=s[d++],v=s[d++],x=s[d++],_=s[d++],b=s[d++],w=s[d++],S=s[d++],M=s[d++],I=x>_?x:_,T=x>_?1:x/_,A=x>_?_/x:1,C=Math.abs(x-_)>.001,L=b+w;C?(t.translate(p,v),t.rotate(S),t.scale(T,A),t.arc(0,0,I,b,L,1-M),t.scale(1/T,1/A),t.rotate(-S),t.translate(-p,-v)):t.arc(p,v,I,b,L,1-M),1==d&&(e=g(b)*x+p,i=m(b)*_+v),n=g(L)*x+p,o=m(L)*_+v;break;case l.R:e=n=s[d],i=o=s[d+1],t.rect(s[d++],s[d++],s[d++],s[d++]);break;case l.Z:t.closePath(),n=e,o=i}}}},_.CMD=l,t.exports=_},function(t,e,i){"use strict";function n(t){for(var e=0;e<t.length&&null==t[e];)e++;return t[e]}function o(t){var e=n(t);return null!=e&&!h.isArray(p(e))}function a(t,e,i){t=t||[];var n=e.get("coordinateSystem"),a=m[n],r=f.get(n),s={encodeDef:e.get("encode"),dimsDef:e.get("dimensions")},v=a&&a(t,e,i,s),y=v&&v.dimensions;y||(y=r&&(r.getDimensionsInfo?r.getDimensionsInfo():r.dimensions.slice())||["x","y"],y=c(y,t,s));var x=v?v.categoryIndex:-1,_=new u(y,e),b=l(v,t),w={},S=x>=0&&o(t)?function(t,e,i,n){return d.isDataItemOption(t)&&(_.hasItemOption=!0),n===x?i:g(p(t),y[n])}:function(t,e,i,n){var o=p(t),a=g(o&&o[n],y[n]);d.isDataItemOption(t)&&(_.hasItemOption=!0);var r=v&&v.categoryAxesModels;return r&&r[e]&&"string"==typeof a&&(w[e]=w[e]||r[e].getCategories(),a=h.indexOf(w[e],a),a<0&&!isNaN(a)&&(a=+a)),a};return _.hasItemOption=!1,_.initData(t,b,S),_}function r(t){return"category"!==t&&"time"!==t}function s(t){return"category"===t?"ordinal":"time"===t?"time":"float"}function l(t,e){var i,n=[],o=t&&t.dimensions[t.categoryIndex];if(o&&(i=t.categoryAxesModels[o.name]),i){var a=i.getCategories();if(a){var r=e.length;if(h.isArray(e[0])&&e[0].length>1){n=[];for(var s=0;s<r;s++)n[s]=a[e[s][t.categoryIndex||0]]}else n=a.slice(0)}}return n}var u=i(14),c=i(25),h=i(1),d=i(5),f=i(26),p=d.getDataItemValue,g=d.converDataValue,m={cartesian2d:function(t,e,i,n){var o=h.map(["xAxis","yAxis"],function(t){return i.queryComponents({mainType:t,index:e.get(t+"Index"),id:e.get(t+"Id")})[0]}),a=o[0],l=o[1],u=a.get("type"),d=l.get("type"),f=[{name:"x",type:s(u),stackable:r(u)},{name:"y",type:s(d),stackable:r(d)}],p="category"===u,g="category"===d;f=c(f,t,n);var m={};return p&&(m.x=a),g&&(m.y=l),{dimensions:f,categoryIndex:p?0:g?1:-1,categoryAxesModels:m}},singleAxis:function(t,e,i,n){var o=i.queryComponents({mainType:"singleAxis",index:e.get("singleAxisIndex"),id:e.get("singleAxisId")})[0],a=o.get("type"),l="category"===a,u=[{name:"single",type:s(a),stackable:r(a)}];u=c(u,t,n);var h={};return l&&(h.single=o),{dimensions:u,categoryIndex:l?0:-1,categoryAxesModels:h}},polar:function(t,e,i,n){var o=i.queryComponents({mainType:"polar",index:e.get("polarIndex"),id:e.get("polarId")})[0],a=o.findAxisModel("angleAxis"),l=o.findAxisModel("radiusAxis"),u=l.get("type"),h=a.get("type"),d=[{name:"radius",type:s(u),stackable:r(u)},{name:"angle",type:s(h),stackable:r(h)}],f="category"===h,p="category"===u;d=c(d,t,n);var g={};return p&&(g.radius=l),f&&(g.angle=a),{dimensions:d,categoryIndex:f?1:p?0:-1,categoryAxesModels:g}},geo:function(t,e,i,n){return{dimensions:c([{name:"lng"},{name:"lat"}],t,n)}}};t.exports=a},function(t,e){"use strict";var i={};t.exports={register:function(t,e){i[t]=e},get:function(t){return i[t]}}},function(t,e,i){function n(){this.group=new r,this.uid=s.getUID("viewChart")}function o(t,e){if(t&&(t.trigger(e),"group"===t.type))for(var i=0;i<t.childCount();i++)o(t.childAt(i),e)}function a(t,e,i){var n=u.queryDataIndex(t,e);null!=n?c.each(u.normalizeToArray(n),function(e){o(t.getItemGraphicEl(e),i)}):t.eachItemGraphicEl(function(t){o(t,i)})}var r=i(36),s=i(49),l=i(15),u=i(5),c=i(1);n.prototype={type:"chart",init:function(t,e){},render:function(t,e,i,n){},highlight:function(t,e,i,n){a(t.getData(),n,"emphasis")},downplay:function(t,e,i,n){a(t.getData(),n,"normal")},remove:function(t,e){this.group.removeAll()},dispose:function(){}};var h=n.prototype;h.updateView=h.updateLayout=h.updateVisual=function(t,e,i,n){this.render(t,e,i,n)},l.enableClassExtend(n,["dispose"]),l.enableClassManagement(n,{registerWhenExtend:!0}),t.exports=n},function(t,e,i){var n=i(1);t.exports=function(t){for(var e=0;e<t.length;e++)t[e][1]||(t[e][1]=t[e][0]);return function(e,i){for(var o={},a=0;a<t.length;a++){var r=t[a][1];if(!(e&&n.indexOf(e,r)>=0||i&&n.indexOf(i,r)<0)){var s=this.getShallow(r);null!=s&&(o[t[a][0]]=s)}}return o}}},function(t,e,i){"use strict";var n=i(3),o=i(1),a=i(2);i(57),i(117),a.extendComponentView({type:"grid",render:function(t,e){this.group.removeAll(),t.get("show")&&this.group.add(new n.Rect({shape:t.coordinateSystem.getRect(),style:o.defaults({fill:t.get("backgroundColor")},t.getItemStyle()),silent:!0,z2:-1}))}}),a.registerPreprocessor(function(t){t.xAxis&&t.yAxis&&!t.grid&&(t.grid={})})},function(t,e,i){function n(t,e){var i=t[1]-t[0],n=e,o=i/n/2;t[0]+=o,t[1]-=o}var o=i(4),a=o.linearMap,r=i(1),s=i(18),l=[0,1],u=function(t,e,i){this.dim=t,this.scale=e,this._extent=i||[0,0],this.inverse=!1,this.onBand=!1,this._labelInterval};u.prototype={constructor:u,contain:function(t){var e=this._extent,i=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return t>=i&&t<=n},containData:function(t){return this.contain(this.dataToCoord(t))},getExtent:function(){return this._extent.slice()},getPixelPrecision:function(t){return o.getPixelPrecision(t||this.scale.getExtent(),this._extent)},setExtent:function(t,e){var i=this._extent;i[0]=t,i[1]=e},dataToCoord:function(t,e){var i=this._extent,o=this.scale;return t=o.normalize(t),this.onBand&&"ordinal"===o.type&&(i=i.slice(),n(i,o.count())),a(t,l,i,e)},coordToData:function(t,e){var i=this._extent,o=this.scale;this.onBand&&"ordinal"===o.type&&(i=i.slice(),n(i,o.count()));var r=a(t,i,l,e);return this.scale.scale(r)},pointToData:function(t,e){},getTicksCoords:function(t){if(this.onBand&&!t){for(var e=this.getBands(),i=[],n=0;n<e.length;n++)i.push(e[n][0]);return e[n-1]&&i.push(e[n-1][1]),i}return r.map(this.scale.getTicks(),this.dataToCoord,this)},getLabelsCoords:function(){return r.map(this.scale.getTicks(),this.dataToCoord,this)},getBands:function(){for(var t=this.getExtent(),e=[],i=this.scale.count(),n=t[0],o=t[1],a=o-n,r=0;r<i;r++)e.push([a*r/i+n,a*(r+1)/i+n]);return e},getBandWidth:function(){var t=this._extent,e=this.scale.getExtent(),i=e[1]-e[0]+(this.onBand?1:0);0===i&&(i=1);var n=Math.abs(t[1]-t[0]);return Math.abs(n)/i},getLabelInterval:function(){var t=this._labelInterval;if(!t){var e=this.model,i=e.getModel("axisLabel"),n=i.get("interval");"category"!==this.type||"auto"!==n?t="auto"===n?0:n:this.isHorizontal&&(t=s.getAxisLabelInterval(r.map(this.scale.getTicks(),this.dataToCoord,this),e.getFormattedLabels(),i.getModel("textStyle").getFont(),this.isHorizontal())),this._labelInterval=t}return t}},t.exports=u},function(t,e,i){function n(t){this._setting=t||{},this._extent=[1/0,-(1/0)],this._interval=0,this.init&&this.init.apply(this,arguments)}var o=i(15),a=n.prototype;a.parse=function(t){return t},a.getSetting=function(t){return this._setting[t]},a.contain=function(t){var e=this._extent;return t>=e[0]&&t<=e[1]},a.normalize=function(t){var e=this._extent;return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])},a.scale=function(t){var e=this._extent;return t*(e[1]-e[0])+e[0]},a.unionExtent=function(t){var e=this._extent;t[0]<e[0]&&(e[0]=t[0]),t[1]>e[1]&&(e[1]=t[1])},a.unionExtentFromData=function(t,e){this.unionExtent(t.getDataExtent(e,!0))},a.getExtent=function(){return this._extent.slice()},a.setExtent=function(t,e){var i=this._extent;isNaN(t)||(i[0]=t),isNaN(e)||(i[1]=e)},a.getTicksLabels=function(){for(var t=[],e=this.getTicks(),i=0;i<e.length;i++)t.push(this.getLabel(e[i]));return t},a.isBlank=function(){return this._isBlank},a.setBlank=function(t){this._isBlank=t},o.enableClassExtend(n),o.enableClassManagement(n,{registerWhenExtend:!0}),t.exports=n},function(t,e){var i=1;"undefined"!=typeof window&&(i=Math.max(window.devicePixelRatio||1,1));var n={debugMode:0,devicePixelRatio:i};t.exports=n},function(t,e,i){var n=i(1),o=i(66),a=i(11),r=function(t){t=t||{},o.call(this,t);for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);this._children=[],this.__storage=null,this.__dirty=!0};r.prototype={constructor:r,isGroup:!0,type:"group",silent:!1,children:function(){return this._children.slice()},childAt:function(t){return this._children[t]},childOfName:function(t){for(var e=this._children,i=0;i<e.length;i++)if(e[i].name===t)return e[i]},childCount:function(){return this._children.length},add:function(t){return t&&t!==this&&t.parent!==this&&(this._children.push(t),this._doAdd(t)),this},addBefore:function(t,e){if(t&&t!==this&&t.parent!==this&&e&&e.parent===this){var i=this._children,n=i.indexOf(e);n>=0&&(i.splice(n,0,t),this._doAdd(t))}return this},_doAdd:function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__storage,i=this.__zr;e&&e!==t.__storage&&(e.addToStorage(t),t instanceof r&&t.addChildrenToStorage(e)),i&&i.refresh()},remove:function(t){var e=this.__zr,i=this.__storage,o=this._children,a=n.indexOf(o,t);return a<0?this:(o.splice(a,1),t.parent=null,i&&(i.delFromStorage(t),t instanceof r&&t.delChildrenFromStorage(i)),e&&e.refresh(),this)},removeAll:function(){var t,e,i=this._children,n=this.__storage;for(e=0;e<i.length;e++)t=i[e],n&&(n.delFromStorage(t),t instanceof r&&t.delChildrenFromStorage(n)),t.parent=null;return i.length=0,this},eachChild:function(t,e){for(var i=this._children,n=0;n<i.length;n++){var o=i[n];t.call(e,o,n)}return this},traverse:function(t,e){for(var i=0;i<this._children.length;i++){var n=this._children[i];t.call(e,n),"group"===n.type&&n.traverse(t,e)}return this},addChildrenToStorage:function(t){for(var e=0;e<this._children.length;e++){var i=this._children[e];t.addToStorage(i),i instanceof r&&i.addChildrenToStorage(t)}},delChildrenFromStorage:function(t){for(var e=0;e<this._children.length;e++){var i=this._children[e];t.delFromStorage(i),i instanceof r&&i.delChildrenFromStorage(t)}},dirty:function(){return this.__dirty=!0,this.__zr&&this.__zr.refresh(),this},getBoundingRect:function(t){for(var e=null,i=new a(0,0,0,0),n=t||this._children,o=[],r=0;r<n.length;r++){var s=n[r];if(!s.ignore&&!s.invisible){var l=s.getBoundingRect(),u=s.getLocalTransform(o);u?(i.copy(l),i.applyTransform(u),e=e||i.clone(),e.union(i)):(e=e||l.clone(),e.union(l))}}return e||i}},n.inherits(r,o),t.exports=r},function(t,e){var i={},n="\0__throttleOriginMethod",o="\0__throttleRate",a="\0__throttleType";i.throttle=function(t,e,i){function n(){c=(new Date).getTime(),h=null,t.apply(r,s||[])}var o,a,r,s,l,u=0,c=0,h=null;e=e||0;var d=function(){o=(new Date).getTime(),r=this,s=arguments;var t=l||e,d=l||i;l=null,a=o-(d?u:c)-t,clearTimeout(h),d?h=setTimeout(n,t):a>=0?n():h=setTimeout(n,-a),u=o};return d.clear=function(){h&&(clearTimeout(h),h=null)},d.debounceNextCall=function(t){l=t},d},i.createOrUpdate=function(t,e,r,s){var l=t[e];if(l){var u=l[n]||l,c=l[a],h=l[o];if(h!==r||c!==s){if(null==r||!s)return t[e]=u;l=t[e]=i.throttle(u,r,"debounce"===s),l[n]=u,l[a]=s,l[o]=r}return l}},i.clear=function(t,e){var i=t[e];i&&i[n]&&(t[e]=i[n])},t.exports=i},function(t,e,i){function n(t){t=t||{},r.call(this,t);for(var e in t)t.hasOwnProperty(e)&&"style"!==e&&(this[e]=t[e]);this.style=new a(t.style),this._rect=null,this.__clipPaths=[]}var o=i(1),a=i(73),r=i(66),s=i(87);n.prototype={constructor:n,type:"displayable",__dirty:!0,invisible:!1,z:0,z2:0,zlevel:0,draggable:!1,dragging:!1,silent:!1,culling:!1,cursor:"pointer",rectHover:!1,progressive:-1,beforeBrush:function(t){},afterBrush:function(t){},brush:function(t,e){},getBoundingRect:function(){},contain:function(t,e){return this.rectContain(t,e)},traverse:function(t,e){t.call(e,this)},rectContain:function(t,e){var i=this.transformCoordToLocal(t,e),n=this.getBoundingRect();return n.contain(i[0],i[1])},dirty:function(){this.__dirty=!0,this._rect=null,this.__zr&&this.__zr.refresh()},animateStyle:function(t){return this.animate("style",t)},attrKV:function(t,e){"style"!==t?r.prototype.attrKV.call(this,t,e):this.style.set(e)},setStyle:function(t,e){return this.style.set(t,e),this.dirty(!1),this},useStyle:function(t){return this.style=new a(t),this.dirty(!1),this}},o.inherits(n,r),o.mixin(n,s),t.exports=n},function(t,e){var i=function(t){this.colorStops=t||[]};i.prototype={constructor:i,addColorStop:function(t,e){this.colorStops.push({offset:t,color:e})}},t.exports=i},function(t,e,i){function n(t){var e={componentType:t.mainType};return e[t.mainType+"Index"]=t.componentIndex,e}function o(t,e,i,n){var o,a,r=f(i-t.rotation),s=n[0]>n[1],l="start"===e&&!s||"start"!==e&&s;return p(r-x/2)?(a=l?"bottom":"top",o="center"):p(r-1.5*x)?(a=l?"top":"bottom",o="center"):(a="middle",o=r<1.5*x&&r>x/2?l?"left":"right":l?"right":"left"),{rotation:r,textAlign:o,textVerticalAlign:a}}function a(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)}function r(t,e){var i=t.get("axisLabel.showMinLabel"),n=t.get("axisLabel.showMaxLabel"),o=e[0],a=e[1],r=e[e.length-1],l=e[e.length-2];i===!1?o.ignore=!0:null!=t.getMin()&&s(o,a)&&(i?a.ignore=!0:o.ignore=!0),n===!1?r.ignore=!0:null!=t.getMax()&&s(l,r)&&(n?l.ignore=!0:r.ignore=!0)}function s(t,e,i){var n=t&&t.getBoundingRect().clone(),o=e&&e.getBoundingRect().clone();if(n&&o){var a=m.identity([]);return m.rotate(a,a,-t.rotation),n.applyTransform(m.mul([],a,t.getLocalTransform())),o.applyTransform(m.mul([],a,e.getLocalTransform())),n.intersect(o)}}var l=i(1),u=i(7),c=i(3),h=i(10),d=i(4),f=d.remRadian,p=d.isRadianAroundZero,g=i(6),m=i(19),v=g.applyTransform,y=l.retrieve,x=Math.PI,_=function(t,e){this.opt=e,this.axisModel=t,l.defaults(e,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0}),this.group=new c.Group;var i=new c.Group({position:e.position.slice(),rotation:e.rotation});i.updateTransform(),this._transform=i.transform,this._dumbGroup=i};_.prototype={constructor:_,hasBuilder:function(t){return!!b[t]},add:function(t){b[t].call(this)},getGroup:function(){return this.group}};var b={axisLine:function(){var t=this.opt,e=this.axisModel;if(e.get("axisLine.show")){var i=this.axisModel.axis.getExtent(),n=this._transform,o=[i[0],0],a=[i[1],0];n&&(v(o,o,n),v(a,a,n)),this.group.add(new c.Line(c.subPixelOptimizeLine({anid:"line",shape:{x1:o[0],y1:o[1],x2:a[0],y2:a[1]},style:l.extend({lineCap:"round"},e.getModel("axisLine.lineStyle").getLineStyle()),strokeContainThreshold:t.strokeContainThreshold||5,silent:!0,z2:1})))}},axisTick:function(){var t=this.axisModel,e=t.axis;if(t.get("axisTick.show")&&!e.scale.isBlank())for(var i=t.getModel("axisTick"),n=this.opt,o=i.getModel("lineStyle"),a=i.get("length"),r=M(i,n.labelInterval),s=e.getTicksCoords(i.get("alignWithLabel")),u=e.scale.getTicks(),h=[],d=[],f=this._transform,p=0;p<s.length;p++)if(!S(e,p,r)){var g=s[p];h[0]=g,h[1]=0,d[0]=g,d[1]=n.tickDirection*a,f&&(v(h,h,f),v(d,d,f)),this.group.add(new c.Line(c.subPixelOptimizeLine({anid:"tick_"+u[p],shape:{x1:h[0],y1:h[1],x2:d[0],y2:d[1]},style:l.defaults(o.getLineStyle(),{stroke:t.get("axisLine.lineStyle.color")}),z2:2,silent:!0})))}},axisLabel:function(){var t=this.opt,e=this.axisModel,i=e.axis,o=y(t.axisLabelShow,e.get("axisLabel.show"));if(o&&!i.scale.isBlank()){var s=e.getModel("axisLabel"),u=s.getModel("textStyle"),d=s.get("margin"),f=i.scale.getTicks(),p=e.getFormattedLabels(),g=(y(t.labelRotate,s.get("rotate"))||0)*x/180,m=w(t.rotation,g,t.labelDirection),v=e.get("data"),_=[],b=a(e),M=e.get("triggerEvent");l.each(f,function(o,a){if(!S(i,a,t.labelInterval)){var r=u;v&&v[o]&&v[o].textStyle&&(r=new h(v[o].textStyle,u,e.ecModel));var s=r.getTextColor()||e.get("axisLine.lineStyle.color"),l=i.dataToCoord(o),f=[l,t.labelOffset+t.labelDirection*d],g=i.scale.getLabel(o),y=new c.Text({anid:"label_"+o,style:{text:p[a],textAlign:r.get("align",!0)||m.textAlign,textVerticalAlign:r.get("baseline",!0)||m.textVerticalAlign,textFont:r.getFont(),fill:"function"==typeof s?s("category"===i.type?g:"value"===i.type?o+"":o,a):s},position:f,rotation:m.rotation,silent:b,z2:10});M&&(y.eventData=n(e),y.eventData.targetType="axisLabel",y.eventData.value=g),this._dumbGroup.add(y),y.updateTransform(),_.push(y),this.group.add(y),y.decomposeTransform()}},this),r(e,_)}},axisName:function(){var t=this.opt,e=this.axisModel,i=y(t.axisName,e.get("name"));if(i){var r,s=e.get("nameLocation"),h=t.nameDirection,d=e.getModel("nameTextStyle"),f=e.get("nameGap")||0,p=this.axisModel.axis.getExtent(),g=p[0]>p[1]?-1:1,m=["start"===s?p[0]-g*f:"end"===s?p[1]+g*f:(p[0]+p[1])/2,"middle"===s?t.labelOffset+h*f:0],v=e.get("nameRotate");null!=v&&(v=v*x/180);var _;"middle"===s?r=w(t.rotation,null!=v?v:t.rotation,h):(r=o(t,s,v||0,p),_=t.axisNameAvailableWidth,null!=_&&(_=Math.abs(_/Math.sin(r.rotation)),!isFinite(_)&&(_=null)));var b=d.getFont(),S=e.get("nameTruncate",!0)||{},M=S.ellipsis,I=y(t.nameTruncateMaxWidth,S.maxWidth,_),T=null!=M&&null!=I?u.truncateText(i,I,b,M,{minChar:2,placeholder:S.placeholder}):i,A=e.get("tooltip",!0),C=e.mainType,L={componentType:C,name:i,$vars:["name"]};L[C+"Index"]=e.componentIndex;var D=new c.Text({anid:"name",__fullText:i,__truncatedText:T,style:{text:T,textFont:b,fill:d.getTextColor()||e.get("axisLine.lineStyle.color"),textAlign:r.textAlign,textVerticalAlign:r.textVerticalAlign},position:m,rotation:r.rotation,silent:a(e),z2:1,tooltip:A&&A.show?l.extend({content:i,formatter:function(){return i},formatterParams:L},A):null});e.get("triggerEvent")&&(D.eventData=n(e),D.eventData.targetType="axisName",D.eventData.name=i),this._dumbGroup.add(D),D.updateTransform(),this.group.add(D),D.decomposeTransform()}}},w=_.innerTextLayout=function(t,e,i){var n,o,a=f(e-t);return p(a)?(o=i>0?"top":"bottom",n="center"):p(a-x)?(o=i>0?"bottom":"top",n="center"):(o="middle",n=a>0&&a<x?i>0?"right":"left":i>0?"left":"right"),{rotation:a,textAlign:n,textVerticalAlign:o}},S=_.ifIgnoreOnTick=function(t,e,i){var n,o=t.scale;return"ordinal"===o.type&&("function"==typeof i?(n=o.getTicks()[e],!i(n,o.getLabel(n))):e%(i+1))},M=_.getInterval=function(t,e){var i=t.get("interval");return null!=i&&"auto"!=i||(i=e),i};t.exports=_},function(t,e,i){function n(t,e,i,n,s,l){var u=r.getAxisPointerClass(t.axisPointerClass);if(u){var c=a.getAxisPointerModel(e);c?(t._axisPointer||(t._axisPointer=new u)).render(e,c,n,l):o(t,n)}}function o(t,e,i){var n=t._axisPointer;n&&n.dispose(e,i),t._axisPointer=null}var a=i(45),r=i(2).extendComponentView({type:"axis",_axisPointer:null,axisPointerClass:null,render:function(t,e,i,o){this.axisPointerClass&&a.fixValue(t),r.superApply(this,"render",arguments),n(this,t,e,i,o,!0)},updateAxisPointer:function(t,e,i,o,a){n(this,t,e,i,o,!1)},remove:function(t,e){var i=this._axisPointer;i&&i.remove(e),r.superApply(this,"remove",arguments)},dispose:function(t,e){o(this,e),r.superApply(this,"dispose",arguments)}}),s=[];r.registerAxisPointerClass=function(t,e){s[t]=e},r.getAxisPointerClass=function(t){return t&&s[t]},t.exports=r},function(t,e,i){function n(t){return o.isObject(t)&&null!=t.value?t.value:t+""}var o=i(1),a=i(18);t.exports={getFormattedLabels:function(){return a.getFormattedLabels(this.axis,this.get("axisLabel.formatter"))},getCategories:function(){return"category"===this.get("type")&&o.map(this.get("data"),n)},getMin:function(t){var e=this.option,i=t||null==e.rangeStart?e.min:e.rangeStart;return this.axis&&null!=i&&"dataMin"!==i&&!o.eqNaN(i)&&(i=this.axis.scale.parse(i)),i},getMax:function(t){var e=this.option,i=t||null==e.rangeEnd?e.max:e.rangeEnd;return this.axis&&null!=i&&"dataMax"!==i&&!o.eqNaN(i)&&(i=this.axis.scale.parse(i)),i},getNeedCrossZero:function(){var t=this.option;return null==t.rangeStart&&null==t.rangeEnd&&!t.scale},getCoordSysModel:o.noop,setRange:function(t,e){this.option.rangeStart=t,this.option.rangeEnd=e},resetRange:function(){this.option.rangeStart=this.option.rangeEnd=null}}},function(t,e,i){var n=i(4),o=i(7),a=i(34),r=i(64),s=n.round,l=a.extend({type:"interval",_interval:0,_intervalPrecision:2,setExtent:function(t,e){var i=this._extent;isNaN(t)||(i[0]=parseFloat(t)),isNaN(e)||(i[1]=parseFloat(e))},unionExtent:function(t){var e=this._extent;t[0]<e[0]&&(e[0]=t[0]),t[1]>e[1]&&(e[1]=t[1]),l.prototype.setExtent.call(this,e[0],e[1])},getInterval:function(){return this._interval},setInterval:function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=r.getIntervalPrecision(t)},getTicks:function(){return r.intervalScaleGetTicks(this._interval,this._extent,this._niceExtent,this._intervalPrecision)},getTicksLabels:function(){for(var t=[],e=this.getTicks(),i=0;i<e.length;i++)t.push(this.getLabel(e[i]));return t},getLabel:function(t,e){if(null==t)return"";var i=e&&e.precision;return null==i?i=n.getPrecisionSafe(t)||0:"auto"===i&&(i=this._intervalPrecision),t=s(t,i,!0),o.addCommas(t)},niceTicks:function(t,e){t=t||5;var i=this._extent,n=i[1]-i[0];if(isFinite(n)){n<0&&(n=-n,i.reverse());var o=r.intervalScaleNiceTicks(i,t,e);this._intervalPrecision=o.intervalPrecision,this._interval=o.interval,this._niceExtent=o.niceTickExtent}},niceExtent:function(t){var e=this._extent;if(e[0]===e[1])if(0!==e[0]){var i=e[0];t.fixMax?e[0]-=i/2:(e[1]+=i/2,e[0]-=i/2)}else e[1]=1;var n=e[1]-e[0];isFinite(n)||(e[0]=0,e[1]=1),this.niceTicks(t.splitNumber,t.minInterval);var o=this._interval;t.fixMin||(e[0]=s(Math.floor(e[0]/o)*o)),t.fixMax||(e[1]=s(Math.ceil(e[1]/o)*o))}});l.create=function(){return new l},t.exports=l},function(t,e,i){function n(t){this.group=new a.Group,this._symbolCtor=t||r}function o(t,e,i){var n=t.getItemLayout(e);return n&&!isNaN(n[0])&&!isNaN(n[1])&&!(i&&i(e))&&"none"!==t.getItemVisual(e,"symbol")}var a=i(3),r=i(54),s=n.prototype;s.updateData=function(t,e){var i=this.group,n=t.hostModel,r=this._data,s=this._symbolCtor,l={itemStyle:n.getModel("itemStyle.normal").getItemStyle(["color"]),hoverItemStyle:n.getModel("itemStyle.emphasis").getItemStyle(),symbolRotate:n.get("symbolRotate"),symbolOffset:n.get("symbolOffset"),hoverAnimation:n.get("hoverAnimation"),labelModel:n.getModel("label.normal"),hoverLabelModel:n.getModel("label.emphasis"),cursorStyle:n.get("cursor")};t.diff(r).add(function(n){var a=t.getItemLayout(n);if(o(t,n,e)){var r=new s(t,n,l);r.attr("position",a),t.setItemGraphicEl(n,r),i.add(r)}}).update(function(u,c){var h=r.getItemGraphicEl(c),d=t.getItemLayout(u);return o(t,u,e)?(h?(h.updateData(t,u,l),a.updateProps(h,{position:d},n)):(h=new s(t,u),h.attr("position",d)),i.add(h),void t.setItemGraphicEl(u,h)):void i.remove(h)}).remove(function(t){var e=r.getItemGraphicEl(t);e&&e.fadeOut(function(){i.remove(e)})}).execute(),this._data=t},s.updateLayout=function(){var t=this._data;t&&t.eachItemGraphicEl(function(e,i){var n=t.getItemLayout(i);e.attr("position",n)})},s.remove=function(t){var e=this.group,i=this._data;i&&(t?i.eachItemGraphicEl(function(t){t.fadeOut(function(){e.remove(t)})}):e.removeAll())},t.exports=n},function(t,e,i){function n(t,e,i){var n=e.getComponent("tooltip"),a=e.getComponent("axisPointer"),s=a.get("link",!0)||[],u=[];h(i.getCoordinateSystems(),function(i){function c(n,c,h){var d=h.model.getModel("axisPointer",a),f=d.get("show");if(f&&("auto"!==f||n||l(d))){null==c&&(c=d.get("triggerTooltip")),d=n?o(h,v,a,e,n,c):d;var m=d.get("snap"),y=p(h.model),x=c||m||"category"===h.type,_=t.axesInfo[y]={key:y,axis:h,coordSys:i,axisPointerModel:d,triggerTooltip:c,involveSeries:x,snap:m,useHandle:l(d),seriesModels:[]};g[y]=_,t.seriesInvolved|=x;var b=r(s,h);if(null!=b){var w=u[b]||(u[b]={axesInfo:{}});w.axesInfo[y]=_,w.mapper=s[b].mapper,_.linkGroup=w}}}if(i.axisPointerEnabled){var f=p(i.model),g=t.coordSysAxesInfo[f]={};t.coordSysMap[f]=i;var m=i.model,v=m.getModel("tooltip",n);if(h(i.getAxes(),d(c,!1,null)),i.getTooltipAxes&&n&&v.get("show")){var y="axis"===v.get("trigger"),x="cross"===v.get("axisPointer.type"),_=i.getTooltipAxes(v.get("axisPointer.axis"));(y||x)&&h(_.baseAxes,d(c,!x||"cross",y)),x&&h(_.otherAxes,d(c,"cross",!1))}}})}function o(t,e,i,n,o,a){var r=e.getModel("axisPointer"),s={};h(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],function(t){s[t]=u.clone(r.get(t))}),s.snap="category"!==t.type&&!!a,"cross"===r.get("type")&&(s.type="line");var l=s.label||(s.label={});if(null==l.show&&(l.show=!1),"cross"===o&&(l.show=!0,!a)){var d=s.lineStyle=r.get("crossStyle");d&&u.defaults(l.textStyle||(l.textStyle={}),d.textStyle)}return t.model.getModel("axisPointer",new c(s,i,n))}function a(t,e){e.eachSeries(function(e){var i=e.coordinateSystem,n=e.get("tooltip.trigger",!0),o=e.get("tooltip.show",!0);i&&"none"!==n&&n!==!1&&"item"!==n&&o!==!1&&e.get("axisPointer.show",!0)!==!1&&h(t.coordSysAxesInfo[p(i.model)],function(t){var n=t.axis;i.getAxis(n.dim)===n&&(t.seriesModels.push(e),null==t.seriesDataCount&&(t.seriesDataCount=0),t.seriesDataCount+=e.getData().count())})},this)}function r(t,e){for(var i=e.model,n=e.dim,o=0;o<t.length;o++){var a=t[o]||{};if(s(a[n+"AxisId"],i.id)||s(a[n+"AxisIndex"],i.componentIndex)||s(a[n+"AxisName"],i.name))return o}}function s(t,e){return"all"===t||u.isArray(t)&&u.indexOf(t,e)>=0||t===e}function l(t){return!!t.get("handle.show")}var u=i(1),c=i(10),h=u.each,d=u.curry,f={};f.collect=function(t,e){var i={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return n(i,t,e),i.seriesInvolved&&a(i,t),i},f.fixValue=function(t){var e=f.getAxisInfo(t);if(e){var i=e.axisPointerModel,n=e.axis.scale,o=i.option,a=i.get("status"),r=i.get("value");null!=r&&(r=n.parse(r));var s=l(i);null==a&&(o.status=s?"show":"hide");var u=n.getExtent().slice();u[0]>u[1]&&u.reverse(),(null==r||r>u[1])&&(r=u[1]),r<u[0]&&(r=u[0]),o.value=r,s&&(o.status=e.axis.scale.isBlank()?"hide":"show")}},f.getAxisInfo=function(t){var e=(t.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[p(t)]},f.getAxisPointerModel=function(t){var e=f.getAxisInfo(t);return e&&e.axisPointerModel};var p=f.makeKey=function(t){return t.type+"||"+t.id};t.exports=f},function(t,e,i){function n(t){var e={};return h(["start","end","startValue","endValue","throttle"],function(i){t.hasOwnProperty(i)&&(e[i]=t[i])}),e}function o(t,e){h([["start","startValue"],["end","endValue"]],function(i,n){var o=t._rangePropMode;null!=e[i[0]]?o[n]="percent":null!=e[i[1]]&&(o[n]="value")})}var a=i(1),r=i(9),s=i(2),l=i(5),u=i(77),c=i(198),h=a.each,d=u.eachAxisDim,f=s.extendComponentModel({type:"dataZoom",dependencies:["xAxis","yAxis","zAxis","radiusAxis","angleAxis","singleAxis","series"],defaultOption:{zlevel:0,z:4,orient:null,xAxisIndex:null,yAxisIndex:null,filterMode:"filter",throttle:null,start:0,end:100,startValue:null,endValue:null,minSpan:null,maxSpan:null,minValueSpan:null,maxValueSpan:null},init:function(t,e,i){this._dataIntervalByAxis={},this._dataInfo={},this._axisProxies={},this.textStyleModel,this._autoThrottle=!0,this._rangePropMode=["percent","percent"];var o=n(t);this.mergeDefaultAndTheme(t,i),this.doInit(o)},mergeOption:function(t){var e=n(t);a.merge(this.option,t,!0),this.doInit(e)},doInit:function(t){var e=this.option;r.canvasSupported||(e.realtime=!1),this._setDefaultThrottle(t),o(this,t),h([["start","startValue"],["end","endValue"]],function(t,i){"value"===this._rangePropMode[i]&&(e[t[0]]=null)},this),this.textStyleModel=this.getModel("textStyle"),this._resetTarget(),this._giveAxisProxies()},_giveAxisProxies:function(){var t=this._axisProxies;this.eachTargetAxis(function(e,i,n,o){var a=this.dependentModels[e.axis][i],r=a.__dzAxisProxy||(a.__dzAxisProxy=new c(e.name,i,this,o));t[e.name+"_"+i]=r},this)},_resetTarget:function(){var t=this.option,e=this._judgeAutoMode();d(function(e){var i=e.axisIndex;t[i]=l.normalizeToArray(t[i])},this),"axisIndex"===e?this._autoSetAxisIndex():"orient"===e&&this._autoSetOrient()},_judgeAutoMode:function(){var t=this.option,e=!1;d(function(i){null!=t[i.axisIndex]&&(e=!0)},this);var i=t.orient;return null==i&&e?"orient":e?void 0:(null==i&&(t.orient="horizontal"),"axisIndex")},_autoSetAxisIndex:function(){var t=!0,e=this.get("orient",!0),i=this.option,n=this.dependentModels;if(t){var o="vertical"===e?"y":"x";n[o+"Axis"].length?(i[o+"AxisIndex"]=[0],t=!1):h(n.singleAxis,function(n){t&&n.get("orient",!0)===e&&(i.singleAxisIndex=[n.componentIndex],t=!1)})}t&&d(function(e){if(t){var n=[],o=this.dependentModels[e.axis];if(o.length&&!n.length)for(var a=0,r=o.length;a<r;a++)"category"===o[a].get("type")&&n.push(a);i[e.axisIndex]=n,n.length&&(t=!1)}},this),t&&this.ecModel.eachSeries(function(t){this._isSeriesHasAllAxesTypeOf(t,"value")&&d(function(e){var n=i[e.axisIndex],o=t.get(e.axisIndex),r=t.get(e.axisId),s=t.ecModel.queryComponents({mainType:e.axis,index:o,id:r})[0];o=s.componentIndex,a.indexOf(n,o)<0&&n.push(o)})},this)},_autoSetOrient:function(){var t;this.eachTargetAxis(function(e){!t&&(t=e.name)},this),this.option.orient="y"===t?"vertical":"horizontal"},_isSeriesHasAllAxesTypeOf:function(t,e){var i=!0;return d(function(n){var o=t.get(n.axisIndex),a=this.dependentModels[n.axis][o];a&&a.get("type")===e||(i=!1)},this),i},_setDefaultThrottle:function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var e=this.ecModel.option;this.option.throttle=e.animation&&e.animationDurationUpdate>0?100:20}},getFirstTargetAxisModel:function(){var t;return d(function(e){if(null==t){var i=this.get(e.axisIndex);i.length&&(t=this.dependentModels[e.axis][i[0]])}},this),t},eachTargetAxis:function(t,e){var i=this.ecModel;d(function(n){h(this.get(n.axisIndex),function(o){t.call(e,n,o,this,i)},this)},this)},getAxisProxy:function(t,e){return this._axisProxies[t+"_"+e]},getAxisModel:function(t,e){var i=this.getAxisProxy(t,e);return i&&i.getAxisModel()},setRawRange:function(t,e){h(["start","end","startValue","endValue"],function(e){this.option[e]=t[e]},this),!e&&o(this,t)},getPercentRange:function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},getValueRange:function(t,e){if(null!=t||null!=e)return this.getAxisProxy(t,e).getDataValueWindow();var i=this.findRepresentativeAxisProxy();return i?i.getDataValueWindow():void 0},findRepresentativeAxisProxy:function(t){if(t)return t.__dzAxisProxy;var e=this._axisProxies;for(var i in e)if(e.hasOwnProperty(i)&&e[i].hostedBy(this))return e[i];for(var i in e)if(e.hasOwnProperty(i)&&!e[i].hostedBy(this))return e[i]},getRangePropMode:function(){return this._rangePropMode.slice()}});t.exports=f},function(t,e,i){var n=i(65);t.exports=n.extend({type:"dataZoom",render:function(t,e,i,n){this.dataZoomModel=t,this.ecModel=e,this.api=i},getTargetCoordInfo:function(){function t(t,e,i,n){for(var o,a=0;a<i.length;a++)if(i[a].model===t){o=i[a];break}o||i.push(o={model:t,axisModels:[],coordIndex:n}),o.axisModels.push(e)}var e=this.dataZoomModel,i=this.ecModel,n={};return e.eachTargetAxis(function(e,o){var a=i.getComponent(e.axis,o);if(a){var r=a.getCoordSysModel();r&&t(r,a,n[r.mainType]||(n[r.mainType]=[]),r.componentIndex)}},this),n}})},function(t,e){"use strict";function i(t){return t}function n(t,e,n,o){this._old=t,this._new=e,this._oldKeyGetter=n||i,this._newKeyGetter=o||i}function o(t,e,i,n){for(var o=0;o<t.length;o++){var a="_ec_"+n(t[o],o),r=e[a];null==r?(i.push(a),e[a]=o):(r.length||(e[a]=r=[r]),r.push(o))}}n.prototype={constructor:n,add:function(t){return this._add=t,this},update:function(t){return this._update=t,this},remove:function(t){return this._remove=t,this},execute:function(){var t,e=this._old,i=this._new,n=this._oldKeyGetter,a=this._newKeyGetter,r={},s={},l=[],u=[];for(o(e,r,l,n),o(i,s,u,a),t=0;t<e.length;t++){var c=l[t],h=s[c];if(null!=h){var d=h.length;d?(1===d&&(s[c]=null),h=h.unshift()):s[c]=null,this._update&&this._update(h,t)}else this._remove&&this._remove(t)}for(var t=0;t<u.length;t++){var c=u[t];if(s.hasOwnProperty(c)){var h=s[c];if(null==h)continue;if(h.length)for(var f=0,d=h.length;f<d;f++)this._add&&this._add(h[f]);else this._add&&this._add(h)}}}},t.exports=n},function(t,e,i){var n=i(1),o=i(15),a=o.parseClassType,r=0,s={},l="_";s.getUID=function(t){return[t||"",r++,Math.random()].join(l)},s.enableSubTypeDefaulter=function(t){var e={};return t.registerSubTypeDefaulter=function(t,i){t=a(t),e[t.main]=i},t.determineSubType=function(i,n){var o=n.type;if(!o){var r=a(i).main;t.hasSubTypes(i)&&e[r]&&(o=e[r](n))}return o},t},s.enableTopologicalTravel=function(t,e){function i(t){var i={},r=[];return n.each(t,function(s){var l=o(i,s),u=l.originalDeps=e(s),c=a(u,t);l.entryCount=c.length,0===l.entryCount&&r.push(s),n.each(c,function(t){n.indexOf(l.predecessor,t)<0&&l.predecessor.push(t);var e=o(i,t);n.indexOf(e.successor,t)<0&&e.successor.push(s)})}),{graph:i,noEntryList:r}}function o(t,e){return t[e]||(t[e]={predecessor:[],successor:[]}),t[e]}function a(t,e){var i=[];return n.each(t,function(t){n.indexOf(e,t)>=0&&i.push(t)}),i}t.topologicalTravel=function(t,e,o,a){function r(t){u[t].entryCount--,0===u[t].entryCount&&c.push(t)}function s(t){h[t]=!0,r(t)}if(t.length){var l=i(e),u=l.graph,c=l.noEntryList,h={};for(n.each(t,function(t){h[t]=!0});c.length;){var d=c.pop(),f=u[d],p=!!h[d];p&&(o.call(a,d,f.originalDeps.slice()),delete h[d]),n.each(f.successor,p?s:r)}n.each(h,function(){throw new Error("Circle dependency may exists")})}}},t.exports=s},function(t,e){t.exports=function(t,e,i,n,o){n.eachRawSeriesByType(t,function(t){var o=t.getData(),a=t.get("symbol")||e,r=t.get("symbolSize");o.setVisual({legendSymbol:i||a,symbol:a,symbolSize:r}),n.isSeriesFiltered(t)||("function"==typeof r&&o.each(function(e){var i=t.getRawValue(e),n=t.getDataParams(e);o.setItemVisual(e,"symbolSize",r(i,n))}),o.each(function(t){var e=o.getItemModel(t),i=e.getShallow("symbol",!0),n=e.getShallow("symbolSize",!0);null!=i&&o.setItemVisual(t,"symbol",i),null!=n&&o.setItemVisual(t,"symbolSize",n)}))})}},function(t,e){function i(t){for(var e=0;t>=c;)e|=1&t,t>>=1;return t+e}function n(t,e,i,n){var a=e+1;if(a===i)return 1;if(n(t[a++],t[e])<0){for(;a<i&&n(t[a],t[a-1])<0;)a++;o(t,e,a)}else for(;a<i&&n(t[a],t[a-1])>=0;)a++;return a-e}function o(t,e,i){for(i--;e<i;){var n=t[e];t[e++]=t[i],t[i--]=n}}function a(t,e,i,n,o){for(n===e&&n++;n<i;n++){for(var a,r=t[n],s=e,l=n;s<l;)a=s+l>>>1,o(r,t[a])<0?l=a:s=a+1;var u=n-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;u>0;)t[s+u]=t[s+u-1],u--}t[s]=r}}function r(t,e,i,n,o,a){var r=0,s=0,l=1;if(a(t,e[i+o])>0){for(s=n-o;l<s&&a(t,e[i+o+l])>0;)r=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),r+=o,l+=o}else{for(s=o+1;l<s&&a(t,e[i+o-l])<=0;)r=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s);var u=r;r=o-l,l=o-u}for(r++;r<l;){var c=r+(l-r>>>1);a(t,e[i+c])>0?r=c+1:l=c}return l}function s(t,e,i,n,o,a){var r=0,s=0,l=1;if(a(t,e[i+o])<0){for(s=o+1;l<s&&a(t,e[i+o-l])<0;)r=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s);var u=r;r=o-l,l=o-u}else{for(s=n-o;l<s&&a(t,e[i+o+l])>=0;)r=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),r+=o,l+=o}for(r++;r<l;){var c=r+(l-r>>>1);a(t,e[i+c])<0?l=c:r=c+1}return l}function l(t,e){function i(t,e){c[y]=t,f[y]=e,y+=1}function n(){for(;y>1;){var t=y-2;if(t>=1&&f[t-1]<=f[t]+f[t+1]||t>=2&&f[t-2]<=f[t]+f[t-1])f[t-1]<f[t+1]&&t--;else if(f[t]>f[t+1])break;a(t)}}function o(){for(;y>1;){var t=y-2;t>0&&f[t-1]<f[t+1]&&t--,a(t)}}function a(i){var n=c[i],o=f[i],a=c[i+1],h=f[i+1];f[i]=o+h,i===y-3&&(c[i+1]=c[i+2],f[i+1]=f[i+2]),y--;var d=s(t[a],t,n,o,0,e);n+=d,o-=d,0!==o&&(h=r(t[n+o-1],t,a,h,h-1,e),0!==h&&(o<=h?l(n,o,a,h):u(n,o,a,h)))}function l(i,n,o,a){var l=0;for(l=0;l<n;l++)x[l]=t[i+l];var u=0,c=o,d=i;if(t[d++]=t[c++],0!==--a){if(1===n){for(l=0;l<a;l++)t[d+l]=t[c+l];return void(t[d+a]=x[u])}for(var f,g,m,v=p;;){f=0,g=0,m=!1;do{if(e(t[c],x[u])<0){if(t[d++]=t[c++],g++,f=0,0===--a){m=!0;break}}else if(t[d++]=x[u++],f++,g=0,1===--n){m=!0;break}}while((f|g)<v);if(m)break;do{if(f=s(t[c],x,u,n,0,e),0!==f){for(l=0;l<f;l++)t[d+l]=x[u+l];if(d+=f,u+=f,n-=f,n<=1){m=!0;break}}if(t[d++]=t[c++],0===--a){m=!0;break}if(g=r(x[u],t,c,a,0,e),0!==g){for(l=0;l<g;l++)t[d+l]=t[c+l];if(d+=g,c+=g,a-=g,0===a){m=!0;break}}if(t[d++]=x[u++],1===--n){m=!0;break}v--}while(f>=h||g>=h);if(m)break;v<0&&(v=0),v+=2}if(p=v,p<1&&(p=1),1===n){for(l=0;l<a;l++)t[d+l]=t[c+l];t[d+a]=x[u]}else{if(0===n)throw new Error;for(l=0;l<n;l++)t[d+l]=x[u+l]}}else for(l=0;l<n;l++)t[d+l]=x[u+l]}function u(i,n,o,a){var l=0;for(l=0;l<a;l++)x[l]=t[o+l];var u=i+n-1,c=a-1,d=o+a-1,f=0,g=0;if(t[d--]=t[u--],0!==--n){if(1===a){for(d-=n,u-=n,g=d+1,f=u+1,l=n-1;l>=0;l--)t[g+l]=t[f+l];return void(t[d]=x[c])}for(var m=p;;){var v=0,y=0,_=!1;do{if(e(x[c],t[u])<0){if(t[d--]=t[u--],v++,y=0,0===--n){_=!0;break}}else if(t[d--]=x[c--],y++,v=0,1===--a){_=!0;break}}while((v|y)<m);if(_)break;do{if(v=n-s(x[c],t,i,n,n-1,e),0!==v){for(d-=v,u-=v,n-=v,g=d+1,f=u+1,l=v-1;l>=0;l--)t[g+l]=t[f+l];if(0===n){_=!0;break}}if(t[d--]=x[c--],1===--a){_=!0;break}if(y=a-r(t[u],x,0,a,a-1,e),0!==y){for(d-=y,c-=y,a-=y,g=d+1,f=c+1,l=0;l<y;l++)t[g+l]=x[f+l];if(a<=1){_=!0;break}}if(t[d--]=t[u--],0===--n){_=!0;break}m--}while(v>=h||y>=h);if(_)break;m<0&&(m=0),m+=2}if(p=m,p<1&&(p=1),1===a){for(d-=n,u-=n,g=d+1,f=u+1,l=n-1;l>=0;l--)t[g+l]=t[f+l];t[d]=x[c]}else{if(0===a)throw new Error;for(f=d-(a-1),l=0;l<a;l++)t[f+l]=x[l]}}else for(f=d-(a-1),l=0;l<a;l++)t[f+l]=x[l]}var c,f,p=h,g=0,m=d,v=0,y=0;g=t.length,g<2*d&&(m=g>>>1);var x=[];v=g<120?5:g<1542?10:g<119151?19:40,c=[],f=[],this.mergeRuns=n,this.forceMergeRuns=o,this.pushRun=i}function u(t,e,o,r){o||(o=0),r||(r=t.length);var s=r-o;if(!(s<2)){var u=0;if(s<c)return u=n(t,o,r,e),void a(t,o,r,o+u,e);var h=new l(t,e),d=i(s);do{if(u=n(t,o,r,e),u<d){var f=s;f>d&&(f=d),a(t,o,o+f,o+u,e),u=f}h.pushRun(o,u),h.mergeRuns(),s-=u,o+=u}while(0!==s);h.forceMergeRuns()}}var c=32,h=7,d=256;t.exports=u},function(t,e,i){var n=i(35);t.exports=function(){if(0!==n.debugMode)if(1==n.debugMode)for(var t in arguments)throw new Error(arguments[t]);else if(n.debugMode>1)for(var t in arguments)console.log(arguments[t])}},function(t,e,i){function n(t){o.call(this,t)}var o=i(38),a=i(11),r=i(1),s=i(70),l=new s(50);n.prototype={constructor:n,type:"image",brush:function(t,e){var i,n=this.style,o=n.image;if(n.bind(t,this,e),i="string"==typeof o?this._image:o,!i&&o){var a=l.get(o);if(!a)return i=new Image,i.onload=function(){i.onload=null;for(var t=0;t<a.pending.length;t++)a.pending[t].dirty()},a={image:i,pending:[this]},i.src=o,l.put(o,a),void(this._image=i);if(i=a.image,this._image=i,!i.width||!i.height)return void a.pending.push(this)}if(i){var r=n.x||0,s=n.y||0;if(!i.width||!i.height)return;var u=n.width,c=n.height,h=i.width/i.height;if(null==u&&null!=c?u=c*h:null==c&&null!=u?c=u/h:null==u&&null==c&&(u=i.width,c=i.height),this.setTransform(t),n.sWidth&&n.sHeight){var d=n.sx||0,f=n.sy||0;t.drawImage(i,d,f,n.sWidth,n.sHeight,r,s,u,c)}else if(n.sx&&n.sy){var d=n.sx,f=n.sy,p=u-d,g=c-f;t.drawImage(i,d,f,p,g,r,s,u,c)}else t.drawImage(i,r,s,u,c);this.restoreTransform(t),null!=n.text&&this.drawRectText(t,this.getBoundingRect())}},getBoundingRect:function(){var t=this.style;return this._rect||(this._rect=new a(t.x||0,t.y||0,t.width||0,t.height||0)),this._rect}},r.inherits(n,o),t.exports=n},function(t,e,i){function n(t,e){var i=t.getItemVisual(e,"symbolSize");return i instanceof Array?i.slice():[+i,+i]}function o(t){return[t[0]/2,t[1]/2]}function a(t,e,i){u.Group.call(this),this.updateData(t,e,i)}function r(t,e){this.parent.drift(t,e)}var s=i(1),l=i(24),u=i(3),c=i(4),h=i(92),d=a.prototype;d._createSymbol=function(t,e,i,n){this.removeAll();var a=e.hostModel,s=e.getItemVisual(i,"color"),c=l.createSymbol(t,-1,-1,2,2,s);c.attr({z2:100,culling:!0,scale:[0,0]}),c.drift=r,u.initProps(c,{scale:o(n)},a,i),this._symbolType=t,this.add(c)},d.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(t)},d.getSymbolPath=function(){return this.childAt(0)},d.getScale=function(){return this.childAt(0).scale},d.highlight=function(){this.childAt(0).trigger("emphasis")},d.downplay=function(){this.childAt(0).trigger("normal")},d.setZ=function(t,e){var i=this.childAt(0);i.zlevel=t,i.z=e},d.setDraggable=function(t){var e=this.childAt(0);e.draggable=t,e.cursor=t?"move":"pointer"},d.updateData=function(t,e,i){this.silent=!1;var a=t.getItemVisual(e,"symbol")||"circle",r=t.hostModel,s=n(t,e);if(a!==this._symbolType)this._createSymbol(a,t,e,s);else{var l=this.childAt(0);l.silent=!1,u.updateProps(l,{scale:o(s)},r,e)}this._updateCommon(t,e,s,i),this._seriesModel=r};var f=["itemStyle","normal"],p=["itemStyle","emphasis"],g=["label","normal"],m=["label","emphasis"];d._updateCommon=function(t,e,i,n){var a=this.childAt(0),r=t.hostModel,l=t.getItemVisual(e,"color");"image"!==a.type&&a.useStyle({strokeNoScale:!0}),n=n||null;var d=n&&n.itemStyle,v=n&&n.hoverItemStyle,y=n&&n.symbolRotate,x=n&&n.symbolOffset,_=n&&n.labelModel,b=n&&n.hoverLabelModel,w=n&&n.hoverAnimation,S=n&&n.cursorStyle;if(!n||t.hasItemOption){var M=t.getItemModel(e);d=M.getModel(f).getItemStyle(["color"]),v=M.getModel(p).getItemStyle(),y=M.getShallow("symbolRotate"),x=M.getShallow("symbolOffset"),_=M.getModel(g),b=M.getModel(m),w=M.getShallow("hoverAnimation"),S=M.getShallow("cursor")}else v=s.extend({},v);var I=a.style;a.attr("rotation",(y||0)*Math.PI/180||0),x&&a.attr("position",[c.parsePercent(x[0],i[0]),c.parsePercent(x[1],i[1])]),S&&a.attr("cursor",S),a.setColor(l),a.setStyle(d);var T=t.getItemVisual(e,"opacity");null!=T&&(I.opacity=T);var A=h.findLabelValueDim(t);h.setTextToStyle(t,e,A,I,r,_,l),h.setTextToStyle(t,e,A,v,r,b,l),a.off("mouseover").off("mouseout").off("emphasis").off("normal"),a.hoverStyle=v,u.setHoverStyle(a);var C=o(i);if(w&&r.isAnimationEnabled()){var L=function(){var t=C[1]/C[0];this.animateTo({scale:[Math.max(1.1*C[0],C[0]+3),Math.max(1.1*C[1],C[1]+3*t)]},400,"elasticOut")},D=function(){this.animateTo({scale:C},400,"elasticOut")};a.on("mouseover",L).on("mouseout",D).on("emphasis",L).on("normal",D)}},d.fadeOut=function(t){var e=this.childAt(0);this.silent=e.silent=!0,e.style.text="",u.updateProps(e,{scale:[0,0]},this._seriesModel,this.dataIndex,t)},s.inherits(a,u.Group),t.exports=a},function(t,e,i){var n=i(2),o=i(45),a=i(196),r=i(1);i(194),i(195),i(120),n.registerPreprocessor(function(t){if(t){(!t.axisPointer||0===t.axisPointer.length)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!r.isArray(e)&&(t.axisPointer.link=[e])}}),n.registerProcessor(n.PRIORITY.PROCESSOR.STATISTIC,function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=o.collect(t,e)}),n.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},a)},function(t,e){function i(t,e){var i=t[e]-t[1-e];return{span:Math.abs(i),sign:i>0?-1:i<0?1:e?-1:1}}function n(t,e){return Math.min(e[1],Math.max(e[0],t))}t.exports=function(t,e,o,a,r,s){e[0]=n(e[0],o),e[1]=n(e[1],o),t=t||0;var l=o[1]-o[0];null!=r&&(r=n(r,[0,l])),null!=s&&(s=Math.max(s,null!=r?r:0)),"all"===a&&(r=s=Math.abs(e[1]-e[0]),a=0);var u=i(e,a);e[a]+=t;var c=r||0,h=o.slice();u.sign<0?h[0]+=c:h[1]-=c,e[a]=n(e[a],h);var d=i(e,a);null!=r&&(d.sign!==u.sign||d.span<r)&&(e[1-a]=e[a]+u.sign*r);var d=i(e,a);return null!=s&&d.span>s&&(e[1-a]=e[a]+d.sign*s),e}},function(t,e,i){function n(t,e,i){return t.getCoordSysModel()===e}function o(t){var e,i=t.model,n=i.getFormattedLabels(),o=i.getModel("axisLabel.textStyle"),a=1,r=n.length;r>40&&(a=Math.ceil(r/40));for(var s=0;s<r;s+=a)if(!t.isLabelIgnored(s)){var l=o.getTextRect(n[s]);e?e.union(l):e=l}return e}function a(t,e,i){this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this._initCartesian(t,e,i),this.model=t}function r(t,e){var i=t.getExtent(),n=i[0]+i[1];t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return n-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return n-t+e}}function s(t,e){return h.map(y,function(e){var i=t.getReferringComponents(e)[0];return i})}function l(t){return"cartesian2d"===t.get("coordinateSystem")}var u=i(12),c=i(18),h=i(1),d=i(133),f=i(131),p=h.each,g=c.ifAxisCrossZero,m=c.niceScaleExtent;i(134);var v=a.prototype;v.type="grid",v.axisPointerEnabled=!0,v.getRect=function(){return this._rect},v.update=function(t,e){function i(t){var e=n[t];for(var i in e)if(e.hasOwnProperty(i)){var o=e[i];if(o&&("category"===o.type||"time"===o.type||!g(o)))return!0}return!1}var n=this._axesMap;this._updateScale(t,this.model),p(n.x,function(t){m(t.scale,t.model)}),p(n.y,function(t){m(t.scale,t.model)}),p(n.x,function(t){i("y")&&(t.onZero=!1)}),p(n.y,function(t){i("x")&&(t.onZero=!1)}),this.resize(this.model,e)},v.resize=function(t,e,i){function n(){p(s,function(t){var e=t.isHorizontal(),i=e?[0,a.width]:[0,a.height],n=t.inverse?1:0;t.setExtent(i[n],i[1-n]),r(t,e?a.x:a.y)})}var a=u.getLayoutRect(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()});this._rect=a;var s=this._axesList;n(),!i&&t.get("containLabel")&&(p(s,function(t){if(!t.model.get("axisLabel.inside")){var e=o(t);if(e){var i=t.isHorizontal()?"height":"width",n=t.model.get("axisLabel.margin");a[i]-=e[i]+n,"top"===t.position?a.y+=e.height+n:"left"===t.position&&(a.x+=e.width+n)}}}),n())},v.getAxis=function(t,e){var i=this._axesMap[t];if(null!=i){if(null==e)for(var n in i)if(i.hasOwnProperty(n))return i[n];return i[e]}},v.getAxes=function(){return this._axesList.slice()},v.getCartesian=function(t,e){if(null!=t&&null!=e){var i="x"+t+"y"+e;return this._coordsMap[i]}h.isObject(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var n=0,o=this._coordsList;n<o.length;n++)if(o[n].getAxis("x").index===t||o[n].getAxis("y").index===e)return o[n]},v.getCartesians=function(){return this._coordsList.slice()},v.convertToPixel=function(t,e,i){var n=this._findConvertTarget(t,e);return n.cartesian?n.cartesian.dataToPoint(i):n.axis?n.axis.toGlobalCoord(n.axis.dataToCoord(i)):null},v.convertFromPixel=function(t,e,i){var n=this._findConvertTarget(t,e);return n.cartesian?n.cartesian.pointToData(i):n.axis?n.axis.coordToData(n.axis.toLocalCoord(i)):null},v._findConvertTarget=function(t,e){var i,n,o=e.seriesModel,a=e.xAxisModel||o&&o.getReferringComponents("xAxis")[0],r=e.yAxisModel||o&&o.getReferringComponents("yAxis")[0],s=e.gridModel,l=this._coordsList;if(o)i=o.coordinateSystem,h.indexOf(l,i)<0&&(i=null);else if(a&&r)i=this.getCartesian(a.componentIndex,r.componentIndex);else if(a)n=this.getAxis("x",a.componentIndex);else if(r)n=this.getAxis("y",r.componentIndex);else if(s){var u=s.coordinateSystem;u===this&&(i=this._coordsList[0])}return{cartesian:i,axis:n}},v.containPoint=function(t){var e=this._coordsList[0];if(e)return e.containPoint(t)},v._initCartesian=function(t,e,i){function o(i){return function(o,l){if(n(o,t,e)){var u=o.get("position");"x"===i?"top"!==u&&"bottom"!==u&&(u="bottom",a[u]&&(u="top"===u?"bottom":"top")):"left"!==u&&"right"!==u&&(u="left",a[u]&&(u="left"===u?"right":"left")),a[u]=!0;var h=new f(i,c.createScaleByModel(o),[0,0],o.get("type"),u),d="category"===h.type;h.onBand=d&&o.get("boundaryGap"),h.inverse=o.get("inverse"),h.onZero=o.get("axisLine.onZero"),o.axis=h,h.model=o,h.grid=this,h.index=l,this._axesList.push(h),r[i][l]=h,s[i]++}}}var a={left:!1,right:!1,top:!1,bottom:!1},r={x:{},y:{}},s={x:0,y:0};return e.eachComponent("xAxis",o("x"),this),e.eachComponent("yAxis",o("y"),this),s.x&&s.y?(this._axesMap=r,void p(r.x,function(e,i){p(r.y,function(n,o){var a="x"+i+"y"+o,r=new d(a);r.grid=this,r.model=t,this._coordsMap[a]=r,this._coordsList.push(r),r.addAxis(e),r.addAxis(n)},this)},this)):(this._axesMap={},void(this._axesList=[]))},v._updateScale=function(t,e){function i(t,e,i){p(i.coordDimToDataDim(e.dim),function(i){e.scale.unionExtentFromData(t,i)})}h.each(this._axesList,function(t){t.scale.setExtent(1/0,-(1/0))}),t.eachSeries(function(o){if(l(o)){var a=s(o,t),r=a[0],u=a[1];if(!n(r,e,t)||!n(u,e,t))return;var c=this.getCartesian(r.componentIndex,u.componentIndex),h=o.getData(),d=c.getAxis("x"),f=c.getAxis("y");"list"===h.type&&(i(h,d,o),i(h,f,o))}},this)},v.getTooltipAxes=function(t){var e=[],i=[];return p(this.getCartesians(),function(n){var o=null!=t&&"auto"!==t?n.getAxis(t):n.getBaseAxis(),a=n.getOtherAxis(o);h.indexOf(e,o)<0&&e.push(o),h.indexOf(i,a)<0&&i.push(a)}),{baseAxes:e,otherAxes:i}};var y=["xAxis","yAxis"];a.create=function(t,e){var i=[];return t.eachComponent("grid",function(n,o){var r=new a(n,t,e);r.name="grid_"+o,r.resize(n,e,!0),n.coordinateSystem=r,i.push(r)}),t.eachSeries(function(e){if(l(e)){var i=s(e,t),n=i[0],o=i[1],a=n.getCoordSysModel(),r=a.coordinateSystem;e.coordinateSystem=r.getCartesian(n.componentIndex,o.componentIndex)}}),i},a.dimensions=a.prototype.dimensions=d.prototype.dimensions,i(26).register("cartesian2d",a),t.exports=a},function(t,e,i){"use strict";function n(t){return t>s||t<-s}var o=i(19),a=i(6),r=o.identity,s=5e-5,l=function(t){t=t||{},t.position||(this.position=[0,0]),null==t.rotation&&(this.rotation=0),t.scale||(this.scale=[1,1]),this.origin=this.origin||null},u=l.prototype;u.transform=null,u.needLocalTransform=function(){return n(this.rotation)||n(this.position[0])||n(this.position[1])||n(this.scale[0]-1)||n(this.scale[1]-1)},u.updateTransform=function(){var t=this.parent,e=t&&t.transform,i=this.needLocalTransform(),n=this.transform;return i||e?(n=n||o.create(),i?this.getLocalTransform(n):r(n),e&&(i?o.mul(n,t.transform,n):o.copy(n,t.transform)),this.transform=n,this.invTransform=this.invTransform||o.create(),void o.invert(this.invTransform,n)):void(n&&r(n))},u.getLocalTransform=function(t){return l.getLocalTransform(this,t)},u.setTransform=function(t){var e=this.transform,i=t.dpr||1;e?t.setTransform(i*e[0],i*e[1],i*e[2],i*e[3],i*e[4],i*e[5]):t.setTransform(i,0,0,i,0,0)},u.restoreTransform=function(t){var e=t.dpr||1;t.setTransform(e,0,0,e,0,0)};var c=[];u.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(o.mul(c,t.invTransform,e),e=c);var i=e[0]*e[0]+e[1]*e[1],a=e[2]*e[2]+e[3]*e[3],r=this.position,s=this.scale;n(i-1)&&(i=Math.sqrt(i)),n(a-1)&&(a=Math.sqrt(a)),e[0]<0&&(i=-i),e[3]<0&&(a=-a),r[0]=e[4],r[1]=e[5],s[0]=i,s[1]=a,this.rotation=Math.atan2(-e[1]/a,e[0]/i)}},u.getGlobalScale=function(){var t=this.transform;if(!t)return[1,1];var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]),i=Math.sqrt(t[2]*t[2]+t[3]*t[3]);return t[0]<0&&(e=-e),t[3]<0&&(i=-i),[e,i]},u.transformCoordToLocal=function(t,e){var i=[t,e],n=this.invTransform;return n&&a.applyTransform(i,i,n),i},u.transformCoordToGlobal=function(t,e){var i=[t,e],n=this.transform;return n&&a.applyTransform(i,i,n),i},l.getLocalTransform=function(t,e){e=e||[],r(e);var i=t.origin,n=t.scale||[1,1],a=t.rotation||0,s=t.position||[0,0];return i&&(e[4]-=i[0],e[5]-=i[1]),o.scale(e,e,n),a&&o.rotate(e,e,a),i&&(e[4]+=i[0],e[5]+=i[1]),e[4]+=s[0],e[5]+=s[1],e},t.exports=l},function(t,e,i){var n=i(96),o=i(1),a=i(13),r=i(12),s=["value","category","time","log"];t.exports=function(t,e,i,l){o.each(s,function(a){e.extend({type:t+"Axis."+a,mergeDefaultAndTheme:function(e,n){var s=this.layoutMode,l=s?r.getLayoutParams(e):{},u=n.getTheme();o.merge(e,u.get(a+"Axis")),o.merge(e,this.getDefaultOption()),e.type=i(t,e),s&&r.mergeLayoutParam(e,l,s)},defaultOption:o.mergeAll([{},n[a+"Axis"],l],!0)})}),a.registerSubTypeDefaulter(t+"Axis",o.curry(i,t))}},function(t,e,i){"use strict";function n(t,e){return e.type||(e.data?"category":"value")}var o=i(13),a=i(1),r=i(59),s=o.extend({type:"cartesian2dAxis",axis:null,init:function(){s.superApply(this,"init",arguments),this.resetRange()},mergeOption:function(){s.superApply(this,"mergeOption",arguments),this.resetRange()},restoreData:function(){s.superApply(this,"restoreData",arguments),this.resetRange()},getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid",index:this.option.gridIndex,id:this.option.gridId})[0]}});a.merge(s.prototype,i(42));var l={offset:0};r("x",s,n,l),r("y",s,n,l),t.exports=s},function(t,e){t.exports=function(t,e){e.eachSeriesByType(t,function(t){var e=t.getData(),i=t.coordinateSystem;if(i){for(var n=[],o=i.dimensions,a=0;a<o.length;a++)n.push(t.coordDimToDataDim(i.dimensions[a])[0]);1===n.length?e.each(n[0],function(t,n){e.setItemLayout(n,isNaN(t)?[NaN,NaN]:i.dataToPoint(t))}):2===n.length&&e.each(n,function(t,n,o){e.setItemLayout(o,isNaN(t)||isNaN(n)?[NaN,NaN]:i.dataToPoint([t,n]))},!0)}})}},function(t,e,i){var n=i(15),o=n.set,a=n.get;t.exports={clearColorPalette:function(){o(this,"colorIdx",0),o(this,"colorNameMap",{})},getColorFromPalette:function(t,e){e=e||this;var i=a(e,"colorIdx")||0,n=a(e,"colorNameMap")||o(e,"colorNameMap",{});if(n.hasOwnProperty(t))return n[t];var r=this.get("color",!0)||[];if(r.length){var s=r[i];return t&&(n[t]=s),o(e,"colorIdx",(i+1)%r.length),s}}}},function(t,e){t.exports=function(t,e){var i=e.findComponents({mainType:"legend"});i&&i.length&&e.eachSeriesByType(t,function(t){var e=t.getData();e.filterSelf(function(t){for(var n=e.getName(t),o=0;o<i.length;o++)if(!i[o].isSelected(n))return!1;return!0},this)},this)}},function(t,e,i){function n(t,e,i){t[e]=Math.max(Math.min(t[e],i[1]),i[0])}var o=i(4),a=o.round,r={};r.intervalScaleNiceTicks=function(t,e,i){var n={},s=t[1]-t[0],l=n.interval=o.nice(s/e,!0);null!=i&&l<i&&(l=n.interval=i);var u=n.intervalPrecision=r.getIntervalPrecision(l),c=n.niceTickExtent=[a(Math.ceil(t[0]/l)*l,u),a(Math.floor(t[1]/l)*l,u)];return r.fixExtent(c,t),n},r.getIntervalPrecision=function(t){return o.getPrecisionSafe(t)+2},r.fixExtent=function(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),n(t,0,e),n(t,1,e),t[0]>t[1]&&(t[0]=t[1])},r.intervalScaleGetTicks=function(t,e,i,n){var o=[];if(!t)return o;var r=1e4;e[0]<i[0]&&o.push(e[0]);for(var s=i[0];s<=i[1]&&(o.push(s),s=a(s+t,n),s!==o[o.length-1]);)if(o.length>r)return[];return e[1]>(o.length?o[o.length-1]:i[1])&&o.push(e[1]),o},t.exports=r},function(t,e,i){var n=i(36),o=i(49),a=i(15),r=function(){this.group=new n,this.uid=o.getUID("viewComponent")};r.prototype={constructor:r,init:function(t,e){},render:function(t,e,i,n){},dispose:function(){}};var s=r.prototype;s.updateView=s.updateLayout=s.updateVisual=function(t,e,i,n){},a.enableClassExtend(r),a.enableClassManagement(r,{registerWhenExtend:!0}),t.exports=r},function(t,e,i){"use strict";var n=i(71),o=i(23),a=i(58),r=i(178),s=i(1),l=function(t){a.call(this,t),o.call(this,t),r.call(this,t),this.id=t.id||n()};l.prototype={type:"element",name:"",__zr:null,ignore:!1,clipPath:null,drift:function(t,e){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=t,i[5]+=e,this.decomposeTransform(),this.dirty(!1)},beforeUpdate:function(){},afterUpdate:function(){},update:function(){this.updateTransform()},traverse:function(t,e){},attrKV:function(t,e){if("position"===t||"scale"===t||"origin"===t){if(e){var i=this[t];i||(i=this[t]=[]),i[0]=e[0],i[1]=e[1]}}else this[t]=e},hide:function(){this.ignore=!0,this.__zr&&this.__zr.refresh()},show:function(){this.ignore=!1,this.__zr&&this.__zr.refresh()},attr:function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(s.isObject(t))for(var i in t)t.hasOwnProperty(i)&&this.attrKV(i,t[i]);return this.dirty(!1),this},setClipPath:function(t){var e=this.__zr;e&&t.addSelfToZr(e),this.clipPath&&this.clipPath!==t&&this.removeClipPath(),this.clipPath=t,t.__zr=e,t.__clipTarget=this,this.dirty(!1)},removeClipPath:function(){var t=this.clipPath;t&&(t.__zr&&t.removeSelfFromZr(t.__zr),t.__zr=null,t.__clipTarget=null,this.clipPath=null,this.dirty(!1))},addSelfToZr:function(t){this.__zr=t;var e=this.animators;if(e)for(var i=0;i<e.length;i++)t.animation.addAnimator(e[i]);this.clipPath&&this.clipPath.addSelfToZr(t)},removeSelfFromZr:function(t){this.__zr=null;var e=this.animators;if(e)for(var i=0;i<e.length;i++)t.animation.removeAnimator(e[i]);this.clipPath&&this.clipPath.removeSelfFromZr(t)}},s.mixin(l,r),s.mixin(l,a),s.mixin(l,o),t.exports=l},function(t,e,i){function n(t,e){return t[e]}function o(t,e,i){t[e]=i}function a(t,e,i){return(e-t)*i+t}function r(t,e,i){return i>.5?e:t}function s(t,e,i,n,o){var r=t.length;if(1==o)for(var s=0;s<r;s++)n[s]=a(t[s],e[s],i);else for(var l=r&&t[0].length,s=0;s<r;s++)for(var u=0;u<l;u++)n[s][u]=a(t[s][u],e[s][u],i)}function l(t,e,i){var n=t.length,o=e.length;if(n!==o){var a=n>o;if(a)t.length=o;else for(var r=n;r<o;r++)t.push(1===i?e[r]:_.call(e[r]))}for(var s=t[0]&&t[0].length,r=0;r<t.length;r++)if(1===i)isNaN(t[r])&&(t[r]=e[r]);else for(var l=0;l<s;l++)isNaN(t[r][l])&&(t[r][l]=e[r][l])}function u(t,e,i){if(t===e)return!0;var n=t.length;if(n!==e.length)return!1;if(1===i){for(var o=0;o<n;o++)if(t[o]!==e[o])return!1}else for(var a=t[0].length,o=0;o<n;o++)for(var r=0;r<a;r++)if(t[o][r]!==e[o][r])return!1;return!0}function c(t,e,i,n,o,a,r,s,l){var u=t.length;if(1==l)for(var c=0;c<u;c++)s[c]=h(t[c],e[c],i[c],n[c],o,a,r);else for(var d=t[0].length,c=0;c<u;c++)for(var f=0;f<d;f++)s[c][f]=h(t[c][f],e[c][f],i[c][f],n[c][f],o,a,r)}function h(t,e,i,n,o,a,r){var s=.5*(i-t),l=.5*(n-e);return(2*(e-i)+s+l)*r+(-3*(e-i)-2*s-l)*a+s*o+e}function d(t){if(x(t)){var e=t.length;if(x(t[0])){for(var i=[],n=0;n<e;n++)i.push(_.call(t[n]));return i}return _.call(t)}return t}function f(t){return t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.floor(t[2]),"rgba("+t.join(",")+")"}function p(t){var e=t[t.length-1].value;return x(e&&e[0])?2:1}function g(t,e,i,n,o){var d=t._getter,g=t._setter,y="spline"===e,_=n.length;if(_){var b,w=n[0].value,S=x(w),M=!1,I=!1,T=S?p(n):0;n.sort(function(t,e){return t.time-e.time}),b=n[_-1].time;for(var A=[],C=[],L=n[0].value,D=!0,P=0;P<_;P++){A.push(n[P].time/b);var k=n[P].value;if(S&&u(k,L,T)||!S&&k===L||(D=!1),L=k,"string"==typeof k){var O=v.parse(k);O?(k=O,M=!0):I=!0}C.push(k)}if(!D){for(var z=C[_-1],P=0;P<_-1;P++)S?l(C[P],z,T):!isNaN(C[P])||isNaN(z)||I||M||(C[P]=z);S&&l(d(t._target,o),z,T);var E,R,N,V,B,G,H=0,F=0;if(M)var W=[0,0,0,0];var Z=function(t,e){var i;if(e<0)i=0;else if(e<F){for(E=Math.min(H+1,_-1),i=E;i>=0&&!(A[i]<=e);i--);i=Math.min(i,_-2)}else{for(i=H;i<_&&!(A[i]>e);i++);i=Math.min(i-1,_-2)}H=i,F=e;var n=A[i+1]-A[i];if(0!==n)if(R=(e-A[i])/n,y)if(V=C[i],N=C[0===i?i:i-1],B=C[i>_-2?_-1:i+1],G=C[i>_-3?_-1:i+2],S)c(N,V,B,G,R,R*R,R*R*R,d(t,o),T);else{var l;if(M)l=c(N,V,B,G,R,R*R,R*R*R,W,1),l=f(W);else{if(I)return r(V,B,R);l=h(N,V,B,G,R,R*R,R*R*R)}g(t,o,l)}else if(S)s(C[i],C[i+1],R,d(t,o),T);else{var l;if(M)s(C[i],C[i+1],R,W,1),l=f(W);else{if(I)return r(C[i],C[i+1],R);l=a(C[i],C[i+1],R)}g(t,o,l)}},q=new m({target:t._target,life:b,loop:t._loop,delay:t._delay,onframe:Z,ondestroy:i});return e&&"spline"!==e&&(q.easing=e),q}}}var m=i(157),v=i(22),y=i(1),x=y.isArrayLike,_=Array.prototype.slice,b=function(t,e,i,a){this._tracks={},this._target=t,this._loop=e||!1,this._getter=i||n,this._setter=a||o,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};b.prototype={when:function(t,e){var i=this._tracks;for(var n in e)if(e.hasOwnProperty(n)){if(!i[n]){i[n]=[];var o=this._getter(this._target,n);if(null==o)continue;0!==t&&i[n].push({time:0,value:d(o)})}i[n].push({time:t,value:e[n]})}return this},during:function(t){return this._onframeList.push(t),this},pause:function(){for(var t=0;t<this._clipList.length;t++)this._clipList[t].pause();this._paused=!0},resume:function(){for(var t=0;t<this._clipList.length;t++)this._clipList[t].resume();this._paused=!1},isPaused:function(){return!!this._paused},_doneCallback:function(){this._tracks={},this._clipList.length=0;for(var t=this._doneList,e=t.length,i=0;i<e;i++)t[i].call(this)},start:function(t){var e,i=this,n=0,o=function(){n--,n||i._doneCallback()};for(var a in this._tracks)if(this._tracks.hasOwnProperty(a)){var r=g(this,t,o,this._tracks[a],a);r&&(this._clipList.push(r),n++,this.animation&&this.animation.addClip(r),e=r)}if(e){var s=e.onframe;e.onframe=function(t,e){s(t,e);for(var n=0;n<i._onframeList.length;n++)i._onframeList[n](t,e)}}return n||this._doneCallback(),this},stop:function(t){for(var e=this._clipList,i=this.animation,n=0;n<e.length;n++){var o=e[n];t&&o.onframe(this._target,1),i&&i.removeClip(o)}e.length=0},delay:function(t){return this._delay=t,this},done:function(t){return t&&this._doneList.push(t),this},getClips:function(){return this._clipList}},t.exports=b},function(t,e){t.exports="undefined"!=typeof window&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){setTimeout(t,16)}},function(t,e){var i=2*Math.PI;t.exports={normalizeRadian:function(t){return t%=i,t<0&&(t+=i),t}}},function(t,e){var i=function(){this.head=null,this.tail=null,this._len=0},n=i.prototype;n.insert=function(t){var e=new o(t);return this.insertEntry(e),e},n.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},n.remove=function(t){var e=t.prev,i=t.next;e?e.next=i:this.head=i,i?i.prev=e:this.tail=e,t.next=t.prev=null,this._len--},n.len=function(){return this._len},n.clear=function(){this.head=this.tail=null,this._len=0};var o=function(t){this.value=t,this.next,this.prev},a=function(t){this._list=new i,this._map={},this._maxSize=t||10,this._lastRemovedEntry=null},r=a.prototype;r.put=function(t,e){var i=this._list,n=this._map,a=null;if(null==n[t]){var r=i.len(),s=this._lastRemovedEntry;if(r>=this._maxSize&&r>0){var l=i.head;i.remove(l),delete n[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=e:s=new o(e),s.key=t,i.insertEntry(s),n[t]=s}return a},r.get=function(t){var e=this._map[t],i=this._list;if(null!=e)return e!==i.tail&&(i.remove(e),i.insertEntry(e)),e.value},r.clear=function(){this._list.clear(),this._map={}},t.exports=a},function(t,e){var i=2311;t.exports=function(){return i++}},function(t,e){var i=function(t,e){this.image=t,this.repeat=e,this.type="pattern"};i.prototype.getCanvasPattern=function(t){return t.createPattern(this.image,this.repeat||"repeat")},t.exports=i},function(t,e){function i(t,e,i){var n=null==e.x?0:e.x,o=null==e.x2?1:e.x2,a=null==e.y?0:e.y,r=null==e.y2?0:e.y2;e.global||(n=n*i.width+i.x,o=o*i.width+i.x,a=a*i.height+i.y,r=r*i.height+i.y);var s=t.createLinearGradient(n,a,o,r);return s}function n(t,e,i){var n=i.width,o=i.height,a=Math.min(n,o),r=null==e.x?.5:e.x,s=null==e.y?.5:e.y,l=null==e.r?.5:e.r;e.global||(r=r*n+i.x,s=s*o+i.y,l*=a);var u=t.createRadialGradient(r,s,0,r,s,l);return u}var o=[["shadowBlur",0],["shadowOffsetX",0],["shadowOffsetY",0],["shadowColor","#000"],["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]],a=function(t){this.extendFrom(t)};a.prototype={constructor:a,fill:"#000000",stroke:null,opacity:1,lineDash:null,lineDashOffset:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,lineWidth:1,strokeNoScale:!1,text:null,textFill:"#000",textStroke:null,textPosition:"inside",textPositionRect:null,textOffset:null,textBaseline:null,textAlign:null,textVerticalAlign:null,textDistance:5,textShadowBlur:0,textShadowOffsetX:0,textShadowOffsetY:0,textTransform:!1,textRotation:0,blend:null,bind:function(t,e,i){for(var n=this,a=i&&i.style,r=!a,s=0;s<o.length;s++){var l=o[s],u=l[0];(r||n[u]!==a[u])&&(t[u]=n[u]||l[1])}if((r||n.fill!==a.fill)&&(t.fillStyle=n.fill),(r||n.stroke!==a.stroke)&&(t.strokeStyle=n.stroke),(r||n.opacity!==a.opacity)&&(t.globalAlpha=null==n.opacity?1:n.opacity),(r||n.blend!==a.blend)&&(t.globalCompositeOperation=n.blend||"source-over"),this.hasStroke()){var c=n.lineWidth;t.lineWidth=c/(this.strokeNoScale&&e&&e.getLineScale?e.getLineScale():1)}},hasFill:function(){var t=this.fill;return null!=t&&"none"!==t},hasStroke:function(){var t=this.stroke;return null!=t&&"none"!==t&&this.lineWidth>0},extendFrom:function(t,e){if(t){var i=this;for(var n in t)!t.hasOwnProperty(n)||!e&&i.hasOwnProperty(n)||(i[n]=t[n])}},set:function(t,e){"string"==typeof t?this[t]=e:this.extendFrom(t,!0)},clone:function(){var t=new this.constructor;return t.extendFrom(this,!0),t},getGradient:function(t,e,o){for(var a="radial"===e.type?n:i,r=a(t,e,o),s=e.colorStops,l=0;l<s.length;l++)r.addColorStop(s[l].offset,s[l].color);return r}};for(var r=a.prototype,s=0;s<o.length;s++){var l=o[s];l[0]in r||(r[l[0]]=l[1])}a.getGradient=r.getGradient,t.exports=a},function(t,e,i){var n=i(168),o=i(167);t.exports={buildPath:function(t,e,i){var a=e.points,r=e.smooth;if(a&&a.length>=2){if(r&&"spline"!==r){var s=o(a,r,i,e.smoothConstraint);t.moveTo(a[0][0],a[0][1]);for(var l=a.length,u=0;u<(i?l:l-1);u++){var c=s[2*u],h=s[2*u+1],d=a[(u+1)%l];t.bezierCurveTo(c[0],c[1],h[0],h[1],d[0],d[1])}}else{"spline"===r&&(a=n(a,i)),t.moveTo(a[0][0],a[0][1]);for(var u=1,f=a.length;u<f;u++)t.lineTo(a[u][0],a[u][1])}i&&t.closePath()}}}},function(t,e,i){var n=i(1),o={};o.layout=function(t,e,i){function o(t,e){var i=a.getAxis(t);return i.toGlobalCoord(i.dataToCoord(0))}i=i||{};var a=t.coordinateSystem,r=e.axis,s={},l=r.position,u=r.onZero?"onZero":l,c=r.dim,h=a.getRect(),d=[h.x,h.x+h.width,h.y,h.y+h.height],f=e.get("offset")||0,p={x:{top:d[2]-f,bottom:d[3]+f},y:{left:d[0]-f,right:d[1]+f}};p.x.onZero=Math.max(Math.min(o("y"),p.x.bottom),p.x.top),p.y.onZero=Math.max(Math.min(o("x"),p.y.right),p.y.left),s.position=["y"===c?p.y[u]:d[0],"x"===c?p.x[u]:d[3]],s.rotation=Math.PI/2*("x"===c?0:1);var g={top:-1,bottom:1,left:-1,right:1};s.labelDirection=s.tickDirection=s.nameDirection=g[l],s.labelOffset=r.onZero?p[c][l]-p[c].onZero:0,e.get("axisTick.inside")&&(s.tickDirection=-s.tickDirection),n.retrieve(i.labelInside,e.get("axisLabel.inside"))&&(s.labelDirection=-s.labelDirection);var m=e.get("axisLabel.rotate");return s.labelRotate="top"===u?-m:m,s.labelInterval=r.getLabelInterval(),s.z2=1,s},t.exports=o},function(t,e,i){"use strict";function n(t,e,i,n){var o=n.getWidth(),a=n.getHeight();t[0]=Math.min(t[0]+e,o)-e,t[1]=Math.min(t[1]+i,a)-i,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}var o=i(1),a=i(3),r=i(16),s=i(7),l=i(19),u=i(18),c=i(40),h={};h.buildElStyle=function(t){var e,i=t.get("type"),n=t.getModel(i+"Style");return"line"===i?(e=n.getLineStyle(),e.fill=null):"shadow"===i&&(e=n.getAreaStyle(),e.stroke=null),e},h.buildLabelElOption=function(t,e,i,o,a){var l=i.get("value"),u=h.getValueLabel(l,e.axis,e.ecModel,i.get("seriesDataIndices"),{precision:i.get("label.precision"),formatter:i.get("label.formatter")}),c=i.getModel("label"),d=c.getModel("textStyle"),f=s.normalizeCssArray(c.get("padding")||0),p=d.getFont(),g=r.getBoundingRect(u,p,a.textAlign,a.textBaseline),m=a.position,v=g.width+f[1]+f[3],y=g.height+f[0]+f[2],x=a.align;"right"===x&&(m[0]-=v),"center"===x&&(m[0]-=v/2);var _=a.verticalAlign;"bottom"===_&&(m[1]-=y),"middle"===_&&(m[1]-=y/2),n(m,v,y,o);var b=c.get("backgroundColor");b&&"auto"!==b||(b=e.get("axisLine.lineStyle.color")),t.label={shape:{x:0,y:0,width:v,height:y,r:c.get("borderRadius")},position:m.slice(),style:{text:u,textFont:p,textFill:d.getTextColor(),textPosition:"inside",fill:b,stroke:c.get("borderColor")||"transparent",lineWidth:c.get("borderWidth")||0,shadowBlur:c.get("shadowBlur"),shadowColor:c.get("shadowColor"),shadowOffsetX:c.get("shadowOffsetX"),shadowOffsetY:c.get("shadowOffsetY")},z2:10}},h.getValueLabel=function(t,e,i,n,a){var r=e.scale.getLabel(t,{precision:a.precision}),s=a.formatter;if(s){var l={value:u.getAxisRawValue(e,t),seriesData:[]};o.each(n,function(t){var e=i.getSeriesByIndex(t.seriesIndex),n=t.dataIndexInside,o=e&&e.getDataParams(n);o&&l.seriesData.push(o)}),o.isString(s)?r=s.replace("{value}",r):o.isFunction(s)&&(r=s(l))}return r},h.getTransformedPosition=function(t,e,i){var n=l.create();return l.rotate(n,n,i.rotation),l.translate(n,n,i.position),a.applyTransform([t.dataToCoord(e),(i.labelOffset||0)+(i.labelDirection||1)*(i.labelMargin||0)],n)},h.buildCartesianSingleLabelElOption=function(t,e,i,n,o,a){var r=c.innerTextLayout(i.rotation,0,i.labelDirection);i.labelMargin=o.get("label.margin"),h.buildLabelElOption(e,n,o,a,{position:h.getTransformedPosition(n.axis,t,i),align:r.textAlign,verticalAlign:r.textVerticalAlign})},h.makeLineShape=function(t,e,i){return i=i||0,{x1:t[i],y1:t[1-i],x2:e[i],y2:e[1-i]}},h.makeRectShape=function(t,e,i){return i=i||0,{x:t[i],y:t[1-i],width:e[i],height:e[1-i]}},h.makeSectorShape=function(t,e,i,n,o,a){return{cx:t,cy:e,r0:i,r:n,startAngle:o,endAngle:a,clockwise:!0}},t.exports=h},function(t,e,i){var n=i(7),o=i(1),a={},r=["x","y","z","radius","angle","single"],s=["cartesian2d","polar","singleAxis"];a.isCoordSupported=function(t){return o.indexOf(s,t)>=0},a.createNameEach=function(t,e){t=t.slice();var i=o.map(t,n.capitalFirst);e=(e||[]).slice();var a=o.map(e,n.capitalFirst);return function(n,r){o.each(t,function(t,o){for(var s={name:t,capital:i[o]},l=0;l<e.length;l++)s[e[l]]=t+a[l];n.call(r,s)})}},a.eachAxisDim=a.createNameEach(r,["axisIndex","axis","index","id"]),a.createLinkedNodesFinder=function(t,e,i){function n(t,e){return o.indexOf(e.nodes,t)>=0}function a(t,n){var a=!1;return e(function(e){o.each(i(t,e)||[],function(t){n.records[e.name][t]&&(a=!0)})}),a}function r(t,n){n.nodes.push(t),e(function(e){o.each(i(t,e)||[],function(t){n.records[e.name][t]=!0})})}return function(i){function o(t){!n(t,s)&&a(t,s)&&(r(t,s),l=!0)}var s={nodes:[],records:{}};if(e(function(t){s.records[t.name]={}}),!i)return s;r(i,s);var l;do{l=!1,t(o)}while(l);return s}},t.exports=a},function(t,e,i){var n=i(1);t.exports={updateSelectedMap:function(t){this._selectTargetMap=n.reduce(t||[],function(t,e){return t.set(e.name,e),t},n.createHashMap())},select:function(t){var e=this._selectTargetMap,i=e.get(t),n=this.get("selectedMode");"single"===n&&e.each(function(t){t.selected=!1}),i&&(i.selected=!0)},unSelect:function(t){var e=this._selectTargetMap.get(t);e&&(e.selected=!1)},toggleSelected:function(t){var e=this._selectTargetMap.get(t);if(null!=e)return this[e.selected?"unSelect":"select"](t),e.selected},isSelected:function(t){var e=this._selectTargetMap.get(t);return e&&e.selected}}},function(t,e,i){function n(t){o.defaultEmphasis(t.label,o.LABEL_OPTIONS)}var o=i(5),a=i(1),r=i(9),s=i(7),l=s.addCommas,u=s.encodeHTML,c=i(2).extendComponentModel({type:"marker",dependencies:["series","grid","polar","geo"],init:function(t,e,i,n){this.mergeDefaultAndTheme(t,i),this.mergeOption(t,i,n.createdBySelf,!0)},isAnimationEnabled:function(){if(r.node)return!1;var t=this.__hostSeries;return this.getShallow("animation")&&t&&t.isAnimationEnabled()},mergeOption:function(t,e,i,o){var r=this.constructor,s=this.mainType+"Model";i||e.eachSeries(function(t){var i=t.get(this.mainType),l=t[s];return i&&i.data?(l?l.mergeOption(i,e,!0):(o&&n(i),a.each(i.data,function(t){t instanceof Array?(n(t[0]),n(t[1])):n(t)}),l=new r(i,this,e),a.extend(l,{mainType:this.mainType,seriesIndex:t.seriesIndex,name:t.name,createdBySelf:!0}),l.__hostSeries=t),void(t[s]=l)):void(t[s]=null)},this)},formatTooltip:function(t){var e=this.getData(),i=this.getRawValue(t),n=a.isArray(i)?a.map(i,l).join(", "):l(i),o=e.getName(t),r=u(this.name);return(null!=i||o)&&(r+="<br />"),o&&(r+=u(o),null!=i&&(r+=" : ")),null!=i&&(r+=u(n)),r},getData:function(){return this._data},setData:function(t){this._data=t}});a.mixin(c,o.dataFormatMixin),t.exports=c},function(t,e,i){var n=i(1);t.exports=i(2).extendComponentView({type:"marker",init:function(){this.markerGroupMap=n.createHashMap()},render:function(t,e,i){var n=this.markerGroupMap;n.each(function(t){t.__keep=!1});var o=this.type+"Model";e.eachSeries(function(t){var n=t[o];n&&this.renderSeries(t,n,e,i)},this),n.each(function(t){!t.__keep&&this.group.remove(t.group)},this)},renderSeries:function(){}})},function(t,e,i){function n(t){return!(isNaN(parseFloat(t.x))&&isNaN(parseFloat(t.y)))}function o(t){return!isNaN(parseFloat(t.x))&&!isNaN(parseFloat(t.y))}function a(t,e,i){var n=-1;do{n=Math.max(l.getPrecision(t.get(e,i)),n),t=t.stackedOn}while(t);return n}function r(t,e,i,n,o,r){var s=[],l=m(e,n,t),u=e.indicesOfNearest(n,l,!0)[0];s[o]=e.get(i,u,!0),s[r]=e.get(n,u,!0);var c=a(e,n,u);return c>=0&&(s[r]=+s[r].toFixed(c)),s}var s=i(1),l=i(4),u=s.indexOf,c=s.curry,h={min:c(r,"min"),max:c(r,"max"),average:c(r,"average")},d=function(t,e){var i=t.getData(),n=t.coordinateSystem;if(e&&!o(e)&&!s.isArray(e.coord)&&n){var a=n.dimensions,r=f(e,i,n,t);if(e=s.clone(e),e.type&&h[e.type]&&r.baseAxis&&r.valueAxis){var l=u(a,r.baseAxis.dim),c=u(a,r.valueAxis.dim);e.coord=h[e.type](i,r.baseDataDim,r.valueDataDim,l,c),e.value=e.coord[c]}else{for(var d=[null!=e.xAxis?e.xAxis:e.radiusAxis,null!=e.yAxis?e.yAxis:e.angleAxis],p=0;p<2;p++)if(h[d[p]]){var g=t.coordDimToDataDim(a[p])[0];d[p]=m(i,g,d[p])}e.coord=d}}return e},f=function(t,e,i,n){var o={};return null!=t.valueIndex||null!=t.valueDim?(o.valueDataDim=null!=t.valueIndex?e.getDimension(t.valueIndex):t.valueDim,o.valueAxis=i.getAxis(n.dataDimToCoordDim(o.valueDataDim)),o.baseAxis=i.getOtherAxis(o.valueAxis),o.baseDataDim=n.coordDimToDataDim(o.baseAxis.dim)[0]):(o.baseAxis=n.getBaseAxis(),o.valueAxis=i.getOtherAxis(o.baseAxis),o.baseDataDim=n.coordDimToDataDim(o.baseAxis.dim)[0],o.valueDataDim=n.coordDimToDataDim(o.valueAxis.dim)[0]),o},p=function(t,e){return!(t&&t.containData&&e.coord&&!n(e))||t.containData(e.coord)},g=function(t,e,i,n){return n<2?t.coord&&t.coord[n]:t.value},m=function(t,e,i){if("average"===i){var n=0,o=0;return t.each(e,function(t,e){isNaN(t)||(n+=t,o++)},!0),n/o}return t.getDataExtent(e,!0)["max"===i?1:0]};t.exports={dataTransform:d,dataFilter:p,dimValueGetter:g,getAxisInfo:f,numCalculate:m}},function(t,e,i){"use strict";function n(t){return t.get("stack")||d+t.seriesIndex}function o(t){return t.dim+t.index}function a(t,e){var i=[],n=t.axis,o="axis0";if("category"===n.type){for(var a=n.getBandWidth(),r=0;r<t.count;r++)i.push(u.defaults({bandWidth:a,axisKey:o,stackId:d+r},t));for(var l=s(i,e),c=[],r=0;r<t.count;r++){var h=l[o][d+r];h.offsetCenter=h.offset+h.width/2,c.push(h)}return c}}function r(t,e){var i=u.map(t,function(t){var e=t.getData(),i=t.coordinateSystem,a=i.getBaseAxis(),r=a.getExtent(),s="category"===a.type?a.getBandWidth():Math.abs(r[1]-r[0])/e.count(),l=h(t.get("barWidth"),s),u=h(t.get("barMaxWidth"),s),c=t.get("barGap"),d=t.get("barCategoryGap");return{bandWidth:s,barWidth:l,barMaxWidth:u,barGap:c,barCategoryGap:d,axisKey:o(a),stackId:n(t)}});return s(i,e)}function s(t,e){var i={};u.each(t,function(t,e){var n=t.axisKey,o=t.bandWidth,a=i[n]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},r=a.stacks;i[n]=a;var s=t.stackId;r[s]||a.autoWidthCount++,r[s]=r[s]||{width:0,maxWidth:0};var l=t.barWidth;l&&!r[s].width&&(l=Math.min(a.remainedWidth,l),r[s].width=l,a.remainedWidth-=l);var u=t.barMaxWidth;u&&(r[s].maxWidth=u);var c=t.barGap;null!=c&&(a.gap=c);var h=t.barCategoryGap;null!=h&&(a.categoryGap=h)});var n={};return u.each(i,function(t,e){n[e]={};var i=t.stacks,o=t.bandWidth,a=h(t.categoryGap,o),r=h(t.gap,1),s=t.remainedWidth,l=t.autoWidthCount,c=(s-a)/(l+(l-1)*r);c=Math.max(c,0),u.each(i,function(t,e){var i=t.maxWidth;i&&i<c&&(i=Math.min(i,s),t.width&&(i=Math.min(i,t.width)),s-=i,t.width=i,l--)}),c=(s-a)/(l+(l-1)*r),c=Math.max(c,0);var d,f=0;u.each(i,function(t,e){t.width||(t.width=c),d=t,f+=t.width*(1+r)}),d&&(f-=d.width*r);var p=-f/2;u.each(i,function(t,i){n[e][i]=n[e][i]||{offset:p,width:t.width},p+=t.width*(1+r)})}),n}function l(t,e,i){var a=r(u.filter(e.getSeriesByType(t),function(t){return!e.isSeriesFiltered(t)&&t.coordinateSystem&&"cartesian2d"===t.coordinateSystem.type})),s={},l={};e.eachSeriesByType(t,function(t){if("cartesian2d"===t.coordinateSystem.type){var e=t.getData(),i=t.coordinateSystem,r=i.getBaseAxis(),u=n(t),c=a[o(r)][u],h=c.offset,d=c.width,f=i.getOtherAxis(r),p=t.get("barMinHeight")||0,g=r.onZero?f.toGlobalCoord(f.dataToCoord(0)):f.getGlobalExtent()[0],m=i.dataToPoints(e,!0);s[u]=s[u]||[],l[u]=l[u]||[],e.setLayout({offset:h,size:d}),e.each(f.dim,function(t,i){if(!isNaN(t)){s[u][i]||(s[u][i]={p:g,n:g},l[u][i]={p:g,n:g});var n,o,a,r,c=t>=0?"p":"n",v=m[i],y=s[u][i][c],x=l[u][i][c];f.isHorizontal()?(n=y,o=v[1]+h,a=v[0]-x,r=d,l[u][i][c]+=a,Math.abs(a)<p&&(a=(a<0?-1:1)*p),s[u][i][c]+=a):(n=v[0]+h,o=y,a=d,r=v[1]-x,l[u][i][c]+=r,Math.abs(r)<p&&(r=(r<=0?-1:1)*p),s[u][i][c]+=r),e.setItemLayout(i,{x:n,y:o,width:a,height:r})}},!0)}},this)}var u=i(1),c=i(4),h=c.parsePercent,d="__ec_stack_";l.getLayoutOnAxis=a,t.exports=l},function(t,e,i){function n(t){var e=t.pieceList;t.hasSpecialVisual=!1,g.each(e,function(e,i){e.originIndex=i,null!=e.visual&&(t.hasSpecialVisual=!0)})}function o(t){var e=t.categories,i=t.visual,n=t.categoryMap={};if(y(e,function(t,e){n[t]=e}),!g.isArray(i)){var o=[];g.isObject(i)?y(i,function(t,e){var i=n[e];o[null!=i?i:_]=t}):o[_]=i,i=f(t,o)}for(var a=e.length-1;a>=0;a--)null==i[a]&&(delete n[e[a]],e.pop())}function a(t,e){var i=t.visual,n=[];g.isObject(i)?y(i,function(t){n.push(t)}):null!=i&&n.push(i);var o={color:1,symbol:1};e||1!==n.length||o.hasOwnProperty(t.type)||(n[1]=n[0]),f(t,n)}function r(t){return{applyVisual:function(e,i,n){e=this.mapValueToVisual(e),n("color",t(i("color"),e))},_doMap:h([0,1])}}function s(t){var e=this.option.visual;return e[Math.round(v(t,[0,1],[0,e.length-1],!0))]||{}}function l(t){return function(e,i,n){n(t,this.mapValueToVisual(e))}}function u(t){var e=this.option.visual;return e[this.option.loop&&t!==_?t%e.length:t]}function c(){return this.option.visual[0]}function h(t){return{linear:function(e){return v(e,t,this.option.visual,!0)},category:u,piecewise:function(e,i){var n=d.call(this,i);return null==n&&(n=v(e,t,this.option.visual,!0)),n},fixed:c}}function d(t){var e=this.option,i=e.pieceList;if(e.hasSpecialVisual){var n=b.findPieceIndex(t,i),o=i[n];if(o&&o.visual)return o.visual[this.type]}}function f(t,e){return t.visual=e,"color"===t.type&&(t.parsedVisual=g.map(e,function(t){return m.parse(t)})),e}function p(t,e,i){return t?e<=i:e<i}var g=i(1),m=i(22),v=i(4).linearMap,y=g.each,x=g.isObject,_=-1,b=function(t){var e=t.mappingMethod,i=t.type,r=this.option=g.clone(t);this.type=i,this.mappingMethod=e,this._normalizeData=S[e];var s=w[i];this.applyVisual=s.applyVisual,this.getColorMapper=s.getColorMapper,this._doMap=s._doMap[e],"piecewise"===e?(a(r),n(r)):"category"===e?r.categories?o(r):a(r,!0):(g.assert("linear"!==e||r.dataExtent),a(r))};b.prototype={constructor:b,mapValueToVisual:function(t){var e=this._normalizeData(t);return this._doMap(e,t)},getNormalizer:function(){return g.bind(this._normalizeData,this)}};var w=b.visualHandlers={color:{applyVisual:l("color"),getColorMapper:function(){var t=this.option;return g.bind("category"===t.mappingMethod?function(t,e){return!e&&(t=this._normalizeData(t)),u.call(this,t)}:function(e,i,n){var o=!!n;return!i&&(e=this._normalizeData(e)),n=m.fastMapToColor(e,t.parsedVisual,n),o?n:m.stringify(n,"rgba")},this)},_doMap:{linear:function(t){return m.stringify(m.fastMapToColor(t,this.option.parsedVisual),"rgba")},category:u,piecewise:function(t,e){var i=d.call(this,e);return null==i&&(i=m.stringify(m.fastMapToColor(t,this.option.parsedVisual),"rgba")),i},fixed:c}},colorHue:r(function(t,e){return m.modifyHSL(t,e)}),colorSaturation:r(function(t,e){return m.modifyHSL(t,null,e)}),colorLightness:r(function(t,e){return m.modifyHSL(t,null,null,e)}),colorAlpha:r(function(t,e){return m.modifyAlpha(t,e)}),opacity:{applyVisual:l("opacity"),_doMap:h([0,1])},symbol:{applyVisual:function(t,e,i){var n=this.mapValueToVisual(t);if(g.isString(n))i("symbol",n);else if(x(n))for(var o in n)n.hasOwnProperty(o)&&i(o,n[o])},_doMap:{linear:s,category:u,piecewise:function(t,e){var i=d.call(this,e);return null==i&&(i=s.call(this,t)),i},fixed:c}},symbolSize:{applyVisual:l("symbolSize"),_doMap:h([0,1])}},S={linear:function(t){return v(t,this.option.dataExtent,[0,1],!0)},piecewise:function(t){var e=this.option.pieceList,i=b.findPieceIndex(t,e,!0);if(null!=i)return v(i,[0,e.length-1],[0,1],!0)},category:function(t){var e=this.option.categories?this.option.categoryMap[t]:t;return null==e?_:e},fixed:g.noop};b.listVisualTypes=function(){var t=[];return g.each(w,function(e,i){t.push(i)}),t},b.addVisualHandler=function(t,e){w[t]=e},b.isValidType=function(t){return w.hasOwnProperty(t)},b.eachVisual=function(t,e,i){g.isObject(t)?g.each(t,e,i):e.call(i,t)},b.mapVisual=function(t,e,i){var n,o=g.isArray(t)?[]:g.isObject(t)?{}:(n=!0,null);return b.eachVisual(t,function(t,a){var r=e.call(i,t,a);n?o=r:o[a]=r}),o},b.retrieveVisuals=function(t){var e,i={};return t&&y(w,function(n,o){t.hasOwnProperty(o)&&(i[o]=t[o],e=!0)}),e?i:null},b.prepareVisualTypes=function(t){if(x(t)){var e=[];y(t,function(t,i){e.push(i)}),t=e}else{if(!g.isArray(t))return[];t=t.slice()}return t.sort(function(t,e){return"color"===e&&"color"!==t&&0===t.indexOf("color")?1:-1}),t},b.dependsOn=function(t,e){return"color"===e?!(!t||0!==t.indexOf(e)):t===e},b.findPieceIndex=function(t,e,i){function n(e,i){var n=Math.abs(e-t);n<a&&(a=n,o=i)}for(var o,a=1/0,r=0,s=e.length;r<s;r++){var l=e[r].value;if(null!=l){if(l===t||"string"==typeof l&&l===t+"")return r;i&&n(l,r)}}for(var r=0,s=e.length;r<s;r++){var u=e[r],c=u.interval,h=u.close;if(c){if(c[0]===-(1/0)){if(p(h[1],t,c[1]))return r}else if(c[1]===1/0){if(p(h[0],c[0],t))return r}else if(p(h[0],c[0],t)&&p(h[1],t,c[1]))return r;i&&n(c[0],r),i&&n(c[1],r)}}if(i)return t===1/0?e.length-1:t===-(1/0)?0:o},t.exports=b},function(t,e){t.exports=function(t,e){var i={};e.eachRawSeriesByType(t,function(t){var n=t.getRawData(),o={};if(!e.isSeriesFiltered(t)){var a=t.getData();a.each(function(t){var e=a.getRawIndex(t);o[e]=t}),n.each(function(e){var r=o[e],s=null!=r&&a.getItemVisual(r,"color",!0);if(s)n.setItemVisual(e,"color",s);else{var l=n.getItemModel(e),u=l.get("itemStyle.normal.color")||t.getColorFromPalette(n.getName(e),i);n.setItemVisual(e,"color",u),null!=r&&a.setItemVisual(r,"color",u)}})}})}},function(t,e,i){var n=i(6),o=i(20),a={},r=Math.min,s=Math.max,l=Math.sin,u=Math.cos,c=n.create(),h=n.create(),d=n.create(),f=2*Math.PI;a.fromPoints=function(t,e,i){if(0!==t.length){var n,o=t[0],a=o[0],l=o[0],u=o[1],c=o[1];for(n=1;n<t.length;n++)o=t[n],a=r(a,o[0]),l=s(l,o[0]),u=r(u,o[1]),c=s(c,o[1]);e[0]=a,e[1]=u,i[0]=l,i[1]=c}},a.fromLine=function(t,e,i,n,o,a){o[0]=r(t,i),o[1]=r(e,n),a[0]=s(t,i),a[1]=s(e,n)};var p=[],g=[];a.fromCubic=function(t,e,i,n,a,l,u,c,h,d){var f,m=o.cubicExtrema,v=o.cubicAt,y=m(t,i,a,u,p);for(h[0]=1/0,h[1]=1/0,d[0]=-(1/0),d[1]=-(1/0),f=0;f<y;f++){var x=v(t,i,a,u,p[f]);h[0]=r(x,h[0]),d[0]=s(x,d[0])}for(y=m(e,n,l,c,g),f=0;f<y;f++){var _=v(e,n,l,c,g[f]);h[1]=r(_,h[1]),d[1]=s(_,d[1])}h[0]=r(t,h[0]),d[0]=s(t,d[0]),h[0]=r(u,h[0]),d[0]=s(u,d[0]),h[1]=r(e,h[1]),d[1]=s(e,d[1]),h[1]=r(c,h[1]),d[1]=s(c,d[1])},a.fromQuadratic=function(t,e,i,n,a,l,u,c){var h=o.quadraticExtremum,d=o.quadraticAt,f=s(r(h(t,i,a),1),0),p=s(r(h(e,n,l),1),0),g=d(t,i,a,f),m=d(e,n,l,p);u[0]=r(t,a,g),u[1]=r(e,l,m),c[0]=s(t,a,g),c[1]=s(e,l,m)},a.fromArc=function(t,e,i,o,a,r,s,p,g){var m=n.min,v=n.max,y=Math.abs(a-r);if(y%f<1e-4&&y>1e-4)return p[0]=t-i,p[1]=e-o,g[0]=t+i,void(g[1]=e+o);if(c[0]=u(a)*i+t,c[1]=l(a)*o+e,h[0]=u(r)*i+t,h[1]=l(r)*o+e,m(p,c,h),v(g,c,h),a%=f,a<0&&(a+=f),r%=f,r<0&&(r+=f),a>r&&!s?r+=f:a<r&&s&&(a+=f),s){var x=r;r=a,a=x}for(var _=0;_<r;_+=Math.PI/2)_>a&&(d[0]=u(_)*i+t,d[1]=l(_)*o+e,m(p,d,p),v(g,d,g))},t.exports=a},function(t,e,i){var n=i(38),o=i(1),a=i(16),r=function(t){n.call(this,t)};r.prototype={constructor:r,type:"text",brush:function(t,e){var i=this.style,n=i.x||0,o=i.y||0,r=i.text;if(null!=r&&(r+=""),i.bind(t,this,e),r){this.setTransform(t);var s,l=i.textAlign,u=i.textFont||i.font;if(i.textVerticalAlign){var c=a.getBoundingRect(r,u,i.textAlign,"top");switch(s="middle",i.textVerticalAlign){case"middle":o-=c.height/2-c.lineHeight/2;break;case"bottom":o-=c.height-c.lineHeight/2;break;default:o+=c.lineHeight/2}}else s=i.textBaseline;t.font=u||"12px sans-serif",t.textAlign=l||"left",t.textAlign!==l&&(t.textAlign="left"),t.textBaseline=s||"alphabetic",t.textBaseline!==s&&(t.textBaseline="alphabetic");for(var h=a.measureText("国",t.font).width,d=r.split("\n"),f=0;f<d.length;f++)i.hasStroke()&&t.strokeText(d[f],n,o),i.hasFill()&&t.fillText(d[f],n,o),o+=h;this.restoreTransform(t)}},getBoundingRect:function(){var t=this.style;if(!this._rect){var e=t.textVerticalAlign,i=a.getBoundingRect(t.text+"",t.textFont||t.font,t.textAlign,e?"top":t.textBaseline);switch(e){case"middle":i.y-=i.height/2;break;case"bottom":i.y-=i.height}if(i.x+=t.x||0,i.y+=t.y||0,t.hasStroke()){var n=t.lineWidth;i.x-=n/2,i.y-=n/2,i.width+=n,i.height+=n}this._rect=i}return this._rect}},o.inherits(r,n),t.exports=r},function(t,e,i){function n(t,e){return"string"==typeof t?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t}var o=i(16),a=i(11),r=new a,s=function(){};s.prototype={constructor:s,drawRectText:function(t,e,i){var a=this.style,s=a.text;if(null!=s&&(s+=""),s){t.save();var l,u,c=a.textPosition,h=a.textOffset,d=a.textDistance,f=a.textAlign,p=a.textFont||a.font,g=a.textBaseline,m=a.textVerticalAlign;e=a.textPositionRect||e,i=i||o.getBoundingRect(s,p,f,g);var v=this.transform;if(a.textTransform?this.setTransform(t):v&&(r.copy(e),r.applyTransform(v),e=r),c instanceof Array){if(l=e.x+n(c[0],e.width),u=e.y+n(c[1],e.height),f=f||"left",g=g||"top",m){switch(m){case"middle":u-=i.height/2-i.lineHeight/2;break;case"bottom":u-=i.height-i.lineHeight/2;break;default:u+=i.lineHeight/2}g="middle"}}else{var y=o.adjustTextPositionOnRect(c,e,i,d);l=y.x,u=y.y,f=f||y.textAlign,g=g||y.textBaseline}h&&(l+=h[0],u+=h[1]),t.textAlign=f||"left",t.textBaseline=g||"alphabetic";var x=a.textFill,_=a.textStroke;x&&(t.fillStyle=x),_&&(t.strokeStyle=_),t.font=p||"12px sans-serif",t.shadowBlur=a.textShadowBlur,t.shadowColor=a.textShadowColor||"transparent",t.shadowOffsetX=a.textShadowOffsetX,t.shadowOffsetY=a.textShadowOffsetY;var b=s.split("\n");a.textRotation&&(v&&t.translate(v[4],v[5]),t.rotate(a.textRotation),v&&t.translate(-v[4],-v[5]));for(var w=0;w<b.length;w++)_&&t.strokeText(b[w],l,u),x&&t.fillText(b[w],l,u),u+=i.lineHeight;t.restore()}}},t.exports=s},function(t,e,i){function n(t){delete f[t]}var o=i(71),a=i(9),r=i(1),s=i(152),l=i(155),u=i(156),c=i(163),h=!a.canvasSupported,d={canvas:i(154)},f={},p={};p.version="3.5.2",p.init=function(t,e){var i=new g(o(),t,e);return f[i.id]=i,i},p.dispose=function(t){if(t)t.dispose();else{for(var e in f)f.hasOwnProperty(e)&&f[e].dispose();f={}}return p},p.getInstance=function(t){return f[t]},p.registerPainter=function(t,e){d[t]=e};var g=function(t,e,i){i=i||{},this.dom=e,this.id=t;var n=this,o=new l,f=i.renderer;if(h){if(!d.vml)throw new Error("You need to require 'zrender/vml/vml' to support IE8");f="vml"}else f&&d[f]||(f="canvas");var p=new d[f](e,o,i);this.storage=o,this.painter=p;var g=a.node?null:new c(p.getViewportRoot());this.handler=new s(o,p,g,p.root),this.animation=new u({stage:{update:r.bind(this.flush,this)}}),this.animation.start(),this._needsRefresh;var m=o.delFromStorage,v=o.addToStorage;o.delFromStorage=function(t){m.call(o,t),t&&t.removeSelfFromZr(n)},o.addToStorage=function(t){v.call(o,t),t.addSelfToZr(n)}};g.prototype={constructor:g,getId:function(){return this.id},add:function(t){this.storage.addRoot(t),this._needsRefresh=!0},remove:function(t){this.storage.delRoot(t),this._needsRefresh=!0},configLayer:function(t,e){this.painter.configLayer(t,e),this._needsRefresh=!0},refreshImmediately:function(){this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1},refresh:function(){this._needsRefresh=!0},flush:function(){this._needsRefresh&&this.refreshImmediately(),this._needsRefreshHover&&this.refreshHoverImmediately()},addHover:function(t,e){this.painter.addHover&&(this.painter.addHover(t,e),this.refreshHover())},removeHover:function(t){this.painter.removeHover&&(this.painter.removeHover(t),this.refreshHover())},clearHover:function(){this.painter.clearHover&&(this.painter.clearHover(),this.refreshHover())},refreshHover:function(){this._needsRefreshHover=!0},refreshHoverImmediately:function(){this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.refreshHover()},resize:function(t){t=t||{},this.painter.resize(t.width,t.height),this.handler.resize()},clearAnimation:function(){this.animation.clear()},getWidth:function(){return this.painter.getWidth()},getHeight:function(){return this.painter.getHeight()},pathToImage:function(t,e){return this.painter.pathToImage(t,e)},setCursorStyle:function(t){this.handler.setCursorStyle(t)},findHover:function(t,e){return this.handler.findHover(t,e)},on:function(t,e,i){this.handler.on(t,e,i)},off:function(t,e){this.handler.off(t,e)},trigger:function(t,e){this.handler.trigger(t,e)},clear:function(){this.storage.delRoot(),this.painter.clear()},dispose:function(){this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,n(this.id)}},t.exports=p},function(t,e,i){var n=i(2),o=i(1);t.exports=function(t,e){o.each(e,function(e){e.update="updateView",n.registerAction(e,function(i,n){var o={};return n.eachComponent({mainType:"series",subType:t,query:i},function(t){t[e.method]&&t[e.method](i.name);var n=t.getData();n.each(function(e){var i=n.getName(e);o[i]=t.isSelected(i)||!1})}),{name:i.name,selected:o}})})}},function(t,e,i){"use strict";var n=i(17),o=i(28);t.exports=n.extend({type:"series.__base_bar__",getInitialData:function(t,e){return o(t.data,this,e)},getMarkerPosition:function(t){var e=this.coordinateSystem;if(e){var i=e.dataToPoint(t,!0),n=this.getData(),o=n.getLayout("offset"),a=n.getLayout("size"),r=e.getBaseAxis().isHorizontal()?0:1;return i[r]+=o+a/2,i}return[NaN,NaN]},defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,itemStyle:{normal:{},emphasis:{}}}})},function(t,e,i){function n(t,e,i,n,o){a.setText(t,e,i),t.text=n,"outside"===t.textPosition&&(t.textPosition=o)}var o=i(1),a=i(3),r={};r.setLabel=function(t,e,i,a,r,s,l){var u=i.getModel("label.normal"),c=i.getModel("label.emphasis");u.get("show")?n(t,u,a,o.retrieve(r.getFormattedLabel(s,"normal"),r.getRawValue(s)),l):t.text="",c.get("show")?n(e,c,a,o.retrieve(r.getFormattedLabel(s,"emphasis"),r.getRawValue(s)),l):e.text=""},t.exports=r},function(t,e,i){var n=i(3),o=i(1),a=i(5),r={};r.findLabelValueDim=function(t){var e,i=a.otherDimToDataDim(t,"label");if(i.length)e=i[0];else for(var n,o=t.dimensions.slice();o.length&&(e=o.pop(),n=t.getDimensionInfo(e).type,"ordinal"===n||"time"===n););return e},r.setTextToStyle=function(t,e,i,a,r,s,l){null!=i&&s.getShallow("show")?(n.setText(a,s,l),a.text=o.retrieve(r.getFormattedLabel(e,"normal"),t.get(i,e))):a.text=""},t.exports=r},function(t,e,i){function n(t){return isNaN(t[0])||isNaN(t[1])}function o(t,e,i,o,a,r,g,m,v,y,x){for(var _=0,b=i,w=0;w<o;w++){var S=e[b];if(b>=a||b<0)break;if(n(S)){if(x){b+=r;continue}break}if(b===i)t[r>0?"moveTo":"lineTo"](S[0],S[1]),h(f,S);else if(v>0){var M=b+r,I=e[M];if(x)for(;I&&n(e[M]);)M+=r,I=e[M];var T=.5,A=e[_],I=e[M];if(!I||n(I))h(p,S);else{n(I)&&!x&&(I=S),s.sub(d,I,A);var C,L;if("x"===y||"y"===y){var D="x"===y?0:1;C=Math.abs(S[D]-A[D]),L=Math.abs(S[D]-I[D])}else C=s.dist(S,A),L=s.dist(S,I);T=L/(L+C),c(p,S,d,-v*(1-T))}l(f,f,m),u(f,f,g),l(p,p,m),u(p,p,g),t.bezierCurveTo(f[0],f[1],p[0],p[1],S[0],S[1]),c(f,S,d,v*T)}else t.lineTo(S[0],S[1]);_=b,b+=r}return w}function a(t,e){var i=[1/0,1/0],n=[-(1/0),-(1/0)];if(e)for(var o=0;o<t.length;o++){var a=t[o];a[0]<i[0]&&(i[0]=a[0]),a[1]<i[1]&&(i[1]=a[1]),a[0]>n[0]&&(n[0]=a[0]),a[1]>n[1]&&(n[1]=a[1])}return{min:e?i:n,max:e?n:i}}var r=i(8),s=i(6),l=s.min,u=s.max,c=s.scaleAndAdd,h=s.copy,d=[],f=[],p=[];t.exports={Polyline:r.extend({type:"ec-polyline",shape:{points:[],smooth:0,smoothConstraint:!0,smoothMonotone:null,connectNulls:!1},style:{fill:null,stroke:"#000"},buildPath:function(t,e){var i=e.points,r=0,s=i.length,l=a(i,e.smoothConstraint);if(e.connectNulls){for(;s>0&&n(i[s-1]);s--);for(;r<s&&n(i[r]);r++);}for(;r<s;)r+=o(t,i,r,s,s,1,l.min,l.max,e.smooth,e.smoothMonotone,e.connectNulls)+1}}),Polygon:r.extend({type:"ec-polygon",shape:{points:[],stackedOnPoints:[],smooth:0,stackedOnSmooth:0,smoothConstraint:!0,smoothMonotone:null,connectNulls:!1},buildPath:function(t,e){var i=e.points,r=e.stackedOnPoints,s=0,l=i.length,u=e.smoothMonotone,c=a(i,e.smoothConstraint),h=a(r,e.smoothConstraint);if(e.connectNulls){for(;l>0&&n(i[l-1]);l--);for(;s<l&&n(i[s]);s++);}for(;s<l;){var d=o(t,i,s,l,l,1,c.min,c.max,e.smooth,u,e.connectNulls);o(t,r,s+d-1,d,l,-1,h.min,h.max,e.stackedOnSmooth,u,e.connectNulls),s+=d+1,t.closePath()}}})}},function(t,e,i){var n=i(1),o={retrieveTargetInfo:function(t,e){if(t&&("treemapZoomToNode"===t.type||"treemapRootToNode"===t.type)){var i=e.getData().tree.root,n=t.targetNode;if(n&&i.contains(n))return{node:n};var o=t.targetNodeId;if(null!=o&&(n=i.getNodeById(o)))return{node:n}}},getPathToRoot:function(t){for(var e=[];t;)t=t.parentNode,t&&e.push(t);return e.reverse()},aboveViewRoot:function(t,e){var i=o.getPathToRoot(t);return n.indexOf(i,e)>=0},wrapTreePathInfo:function(t,e){for(var i=[];t;){var n=t.dataIndex;i.push({name:t.name,dataIndex:n,value:e.getRawValue(n)}),t=t.parentNode}return i.reverse(),i}};t.exports=o},function(t,e,i){function n(t){this.pointerChecker,this._zr=t,this._opt={};var e=d.bind,i=e(o,this),n=e(a,this),u=e(r,this),c=e(s,this),f=e(l,this);h.call(this),this.setPointerChecker=function(t){this.pointerChecker=t},this.enable=function(e,o){this.disable(),this._opt=d.defaults(d.clone(o)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,preventDefaultMouseMove:!0}),null==e&&(e=!0),e!==!0&&"move"!==e&&"pan"!==e||(t.on("mousedown",i),t.on("mousemove",n),t.on("mouseup",u)),e!==!0&&"scale"!==e&&"zoom"!==e||(t.on("mousewheel",c),t.on("pinch",f))},this.disable=function(){t.off("mousedown",i),t.off("mousemove",n),t.off("mouseup",u),t.off("mousewheel",c),t.off("pinch",f)},this.dispose=this.disable,this.isDragging=function(){return this._dragging},this.isPinching=function(){return this._pinching}}function o(t){if(!t.target||!t.target.draggable){var e=t.offsetX,i=t.offsetY;this.pointerChecker&&this.pointerChecker(t,e,i)&&(this._x=e,this._y=i,this._dragging=!0)}}function a(t){if(c(this,"moveOnMouseMove",t)&&this._dragging&&"pinch"!==t.gestureEvent&&!p.isTaken(this._zr,"globalPan")){var e=t.offsetX,i=t.offsetY,n=this._x,o=this._y,a=e-n,r=i-o;this._x=e,this._y=i,this._opt.preventDefaultMouseMove&&f.stop(t.event),this.trigger("pan",a,r,n,o,e,i)}}function r(t){this._dragging=!1}function s(t){if(c(this,"zoomOnMouseWheel",t)&&0!==t.wheelDelta){var e=t.wheelDelta>0?1.1:1/1.1;u.call(this,t,e,t.offsetX,t.offsetY)}}function l(t){if(!p.isTaken(this._zr,"globalPan")){var e=t.pinchScale>1?1.1:1/1.1;u.call(this,t,e,t.pinchX,t.pinchY)}}function u(t,e,i,n){this.pointerChecker&&this.pointerChecker(t,i,n)&&(f.stop(t.event),this.trigger("zoom",e,i,n))}function c(t,e,i){var n=t._opt[e];return n&&(!d.isString(n)||i.event[n+"Key"])}var h=i(23),d=i(1),f=i(21),p=i(129);d.mixin(n,h),t.exports=n},function(t,e,i){var n=i(1),o={show:!0,zlevel:0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,lineStyle:{color:"#333",width:1,type:"solid"}},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,textStyle:{fontSize:12}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},a=n.merge({boundaryGap:!0,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},o),r=n.merge({boundaryGap:[0,0],splitNumber:5},o),s=n.defaults({scale:!0,min:"dataMin",max:"dataMax"},r),l=n.defaults({scale:!0,logBase:10},r);t.exports={categoryAxis:a,valueAxis:r,timeAxis:s,logAxis:l}},function(t,e){t.exports={containStroke:function(t,e,i,n,o,a,r){if(0===o)return!1;var s=o,l=0,u=t;if(r>e+s&&r>n+s||r<e-s&&r<n-s||a>t+s&&a>i+s||a<t-s&&a<i-s)return!1;if(t===i)return Math.abs(a-t)<=s/2;l=(e-n)/(t-i),u=(t*n-i*e)/(t-i);var c=l*a-r+u,h=c*c/(l*l+1);return h<=s/2*s/2}}},function(t,e,i){var n=i(20);t.exports={containStroke:function(t,e,i,o,a,r,s,l,u){if(0===s)return!1;var c=s;if(u>e+c&&u>o+c&&u>r+c||u<e-c&&u<o-c&&u<r-c||l>t+c&&l>i+c&&l>a+c||l<t-c&&l<i-c&&l<a-c)return!1;var h=n.quadraticProjectPoint(t,e,i,o,a,r,l,u,null);return h<=c/2}}},function(t,e){t.exports=function(t,e,i,n,o,a){if(a>e&&a>n||a<e&&a<n)return 0;if(n===e)return 0;var r=n<e?1:-1,s=(a-e)/(n-e);1!==s&&0!==s||(r=n<e?.5:-.5);var l=s*(i-t)+t;return l>o?r:0}},function(t,e,i){"use strict";var n=i(1),o=i(39),a=function(t,e,i,n,a,r){this.x=null==t?0:t,this.y=null==e?0:e,this.x2=null==i?1:i,this.y2=null==n?0:n,this.type="linear",this.global=r||!1,o.call(this,a)};a.prototype={constructor:a},n.inherits(a,o),t.exports=a},function(t,e,i){"use strict";function n(t){o.each(a,function(e){this[e]=o.bind(t[e],t)},this)}var o=i(1),a=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isDisposed","on","off","getDataURL","getConnectedDataURL","getModel","getOption","getViewOfComponentModel","getViewOfSeriesModel"];t.exports=n},function(t,e,i){var n=i(1);i(57),i(103),i(104);var o=i(82),a=i(2);a.registerLayout(n.curry(o,"bar")),a.registerVisual(function(t){t.eachSeriesByType("bar",function(t){var e=t.getData();e.setVisual("legendSymbol","roundRect")})}),i(32)},function(t,e,i){t.exports=i(90).extend({type:"series.bar",dependencies:["grid","polar"],brushSelector:"rect"})},function(t,e,i){"use strict";function n(t,e,i){i.style.text="",l.updateProps(i,{shape:{width:0}},e,t,function(){i.parent&&i.parent.remove(i)})}function o(t,e,i){i.style.text="",l.updateProps(i,{shape:{r:i.shape.r0}},e,t,function(){i.parent&&i.parent.remove(i)})}function a(t,e,i,n,o,a,r,c){var h=e.getItemVisual(i,"color"),d=e.getItemVisual(i,"opacity"),f=n.getModel("itemStyle.normal"),p=n.getModel("itemStyle.emphasis").getBarItemStyle();c||t.setShape("r",f.get("barBorderRadius")||0),t.useStyle(s.defaults({fill:h,opacity:d},f.getBarItemStyle()));var g=n.getShallow("cursor");g&&t.attr("cursor",g);var m=r?o.height>0?"bottom":"top":o.width>0?"left":"right";c||u.setLabel(t.style,p,n,h,a,i,m),l.setHoverStyle(t,p)}function r(t,e){var i=t.get(c)||0;return Math.min(i,Math.abs(e.width),Math.abs(e.height))}var s=i(1),l=i(3),u=i(91),c=["itemStyle","normal","barBorderWidth"];s.extend(i(10).prototype,i(105));var h=i(2).extendChartView({type:"bar",render:function(t,e,i){var n=t.get("coordinateSystem");return"cartesian2d"!==n&&"polar"!==n||this._render(t,e,i),this.group},dispose:s.noop,_render:function(t,e,i){var r,s=this.group,u=t.getData(),c=this._data,h=t.coordinateSystem,p=h.getBaseAxis();"cartesian2d"===h.type?r=p.isHorizontal():"polar"===h.type&&(r="angle"===p.dim);var g=t.isAnimationEnabled()?t:null;u.diff(c).add(function(e){if(u.hasValue(e)){var i=u.getItemModel(e),n=f[h.type](u,e,i),o=d[h.type](u,e,i,n,r,g);u.setItemGraphicEl(e,o),s.add(o),a(o,u,e,i,n,t,r,"polar"===h.type)}}).update(function(e,i){var n=c.getItemGraphicEl(i);if(!u.hasValue(e))return void s.remove(n);var o=u.getItemModel(e),p=f[h.type](u,e,o);n?l.updateProps(n,{shape:p},g,e):n=d[h.type](u,e,o,p,r,g,!0),u.setItemGraphicEl(e,n),s.add(n),a(n,u,e,o,p,t,r,"polar"===h.type)}).remove(function(t){var e=c.getItemGraphicEl(t);"cartesian2d"===h.type?e&&n(t,g,e):e&&o(t,g,e)}).execute(),this._data=u},remove:function(t,e){var i=this.group,a=this._data;t.get("animation")?a&&a.eachItemGraphicEl(function(e){"sector"===e.type?o(e.dataIndex,t,e):n(e.dataIndex,t,e)}):i.removeAll()}}),d={cartesian2d:function(t,e,i,n,o,a,r){var u=new l.Rect({shape:s.extend({},n)});if(a){var c=u.shape,h=o?"height":"width",d={};c[h]=0,d[h]=n[h],l[r?"updateProps":"initProps"](u,{shape:d},a,e)}return u},polar:function(t,e,i,n,o,a,r){var u=new l.Sector({shape:s.extend({},n)});if(a){var c=u.shape,h=o?"r":"endAngle",d={};c[h]=o?0:n.startAngle,d[h]=n[h],l[r?"updateProps":"initProps"](u,{shape:d},a,e)}return u}},f={cartesian2d:function(t,e,i){var n=t.getItemLayout(e),o=r(i,n),a=n.width>0?1:-1,s=n.height>0?1:-1;return{x:n.x+a*o/2,y:n.y+s*o/2,width:n.width-a*o,height:n.height-s*o}},polar:function(t,e,i){var n=t.getItemLayout(e);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle}}};t.exports=h},function(t,e,i){var n=i(31)([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["stroke","barBorderColor"],["lineWidth","barBorderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]);t.exports={getBarItemStyle:function(t){var e=n.call(this,t);if(this.getBorderLineDash){var i=this.getBorderLineDash();i&&(e.lineDash=i)}return e}}},function(t,e,i){function n(t){return"_"+t+"Type"}function o(t,e,i){var n=e.getItemVisual(i,"color"),o=e.getItemVisual(i,t),a=e.getItemVisual(i,t+"Size");if(o&&"none"!==o){f.isArray(a)||(a=[a,a]);var r=u.createSymbol(o,-a[0]/2,-a[1]/2,a[0],a[1],n);return r.name=t,r}}function a(t){var e=new h({name:"line"});return r(e.shape,t),e}function r(t,e){var i=e[0],n=e[1],o=e[2];t.x1=i[0],t.y1=i[1],t.x2=n[0],t.y2=n[1],t.percent=1,o?(t.cpx1=o[0],t.cpy1=o[1]):(t.cpx1=NaN,t.cpy1=NaN)}function s(){var t=this,e=t.childOfName("fromSymbol"),i=t.childOfName("toSymbol"),n=t.childOfName("label");if(e||i||!n.ignore){for(var o=1,a=this.parent;a;)a.scale&&(o/=a.scale[0]),a=a.parent;var r=t.childOfName("line");if(this.__dirty||r.__dirty){var s=r.shape.percent,l=r.pointAt(0),u=r.pointAt(s),h=c.sub([],u,l);if(c.normalize(h,h),e){e.attr("position",l);var d=r.tangentAt(0);e.attr("rotation",Math.PI/2-Math.atan2(d[1],d[0])),e.attr("scale",[o*s,o*s])}if(i){i.attr("position",u);var d=r.tangentAt(1);i.attr("rotation",-Math.PI/2-Math.atan2(d[1],d[0])),i.attr("scale",[o*s,o*s])}if(!n.ignore){n.attr("position",u);var f,p,g,m=5*o;if("end"===n.__position)f=[h[0]*m+u[0],h[1]*m+u[1]],p=h[0]>.8?"left":h[0]<-.8?"right":"center",g=h[1]>.8?"top":h[1]<-.8?"bottom":"middle";else if("middle"===n.__position){var v=s/2,d=r.tangentAt(v),y=[d[1],-d[0]],x=r.pointAt(v);y[1]>0&&(y[0]=-y[0],y[1]=-y[1]),f=[x[0]+y[0]*m,x[1]+y[1]*m],p="center",g="bottom";var _=-Math.atan2(d[1],d[0]);u[0]<l[0]&&(_=Math.PI+_),n.attr("rotation",_)}else f=[-h[0]*m+l[0],-h[1]*m+l[1]],p=h[0]>.8?"right":h[0]<-.8?"left":"center",g=h[1]>.8?"bottom":h[1]<-.8?"top":"middle";n.attr({style:{textVerticalAlign:n.__verticalAlign||g,textAlign:n.__textAlign||p},position:f,scale:[o,o]})}}}}function l(t,e,i){d.Group.call(this),this._createLine(t,e,i)}var u=i(24),c=i(6),h=i(190),d=i(3),f=i(1),p=i(4),g=["fromSymbol","toSymbol"],m=l.prototype;m.beforeUpdate=s,m._createLine=function(t,e,i){var r=t.hostModel,s=t.getItemLayout(e),l=a(s);l.shape.percent=0,d.initProps(l,{shape:{percent:1}},r,e),this.add(l);var u=new d.Text({name:"label"});this.add(u),f.each(g,function(i){var a=o(i,t,e);this.add(a),this[n(i)]=t.getItemVisual(e,i)},this),this._updateCommonStl(t,e,i)},m.updateData=function(t,e,i){var a=t.hostModel,s=this.childOfName("line"),l=t.getItemLayout(e),u={shape:{}};r(u.shape,l),d.updateProps(s,u,a,e),f.each(g,function(i){var a=t.getItemVisual(e,i),r=n(i);if(this[r]!==a){this.remove(this.childOfName(i));var s=o(i,t,e);this.add(s)}this[r]=a},this),this._updateCommonStl(t,e,i)},m._updateCommonStl=function(t,e,i){var n=t.hostModel,o=this.childOfName("line"),a=i&&i.lineStyle,r=i&&i.hoverLineStyle,s=i&&i.labelModel,l=i&&i.hoverLabelModel;if(!i||t.hasItemOption){var u=t.getItemModel(e);a=u.getModel("lineStyle.normal").getLineStyle(),r=u.getModel("lineStyle.emphasis").getLineStyle(),s=u.getModel("label.normal"),l=u.getModel("label.emphasis")}var c=t.getItemVisual(e,"color"),h=f.retrieve(t.getItemVisual(e,"opacity"),a.opacity,1);o.useStyle(f.defaults({strokeNoScale:!0,fill:"none",stroke:c,opacity:h},a)),o.hoverStyle=r,f.each(g,function(t){var e=this.childOfName(t);e&&(e.setColor(c),e.setStyle({opacity:h}))},this);var m,v,y=s.getShallow("show"),x=l.getShallow("show"),_=this.childOfName("label");if(y||x){var b=n.getRawValue(e);v=null==b?v=t.getName(e):isFinite(b)?p.round(b):b,m=c||"#000"}if(y){var w=s.getModel("textStyle");_.setStyle({text:f.retrieve(n.getFormattedLabel(e,"normal",t.dataType),v),textFont:w.getFont(),fill:w.getTextColor()||m}),_.__textAlign=w.get("align"),_.__verticalAlign=w.get("baseline"),_.__position=s.get("position")}else _.setStyle("text","");if(x){var S=l.getModel("textStyle");_.hoverStyle={text:f.retrieve(n.getFormattedLabel(e,"emphasis",t.dataType),v),textFont:S.getFont(),fill:S.getTextColor()||m}}else _.hoverStyle={text:""};_.ignore=!y&&!x,d.setHoverStyle(this)},m.updateLayout=function(t,e){this.setLinePoints(t.getItemLayout(e))},m.setLinePoints=function(t){var e=this.childOfName("line");r(e.shape,t),e.dirty()},f.inherits(l,d.Group),t.exports=l},function(t,e,i){function n(t){return isNaN(t[0])||isNaN(t[1])}function o(t){return!n(t[0])&&!n(t[1])}function a(t){this._ctor=t||s,this.group=new r.Group}var r=i(3),s=i(106),l=a.prototype;l.updateData=function(t){var e=this._lineData,i=this.group,n=this._ctor,a=t.hostModel,r={lineStyle:a.getModel("lineStyle.normal").getLineStyle(),hoverLineStyle:a.getModel("lineStyle.emphasis").getLineStyle(),labelModel:a.getModel("label.normal"),hoverLabelModel:a.getModel("label.emphasis")};t.diff(e).add(function(e){if(o(t.getItemLayout(e))){var a=new n(t,e,r);t.setItemGraphicEl(e,a),i.add(a)}}).update(function(a,s){var l=e.getItemGraphicEl(s);return o(t.getItemLayout(a))?(l?l.updateData(t,a,r):l=new n(t,a,r),t.setItemGraphicEl(a,l),void i.add(l)):void i.remove(l)}).remove(function(t){i.remove(e.getItemGraphicEl(t))}).execute(),this._lineData=t},l.updateLayout=function(){var t=this._lineData;t.eachItemGraphicEl(function(e,i){e.updateLayout(t,i)},this)},l.remove=function(){this.group.removeAll()},t.exports=a},function(t,e,i){var n=i(1),o=i(2),a=o.PRIORITY;i(109),i(110),o.registerVisual(n.curry(i(50),"line","circle","line")),o.registerLayout(n.curry(i(61),"line")),o.registerProcessor(a.PROCESSOR.STATISTIC,n.curry(i(147),"line")),i(32)},function(t,e,i){"use strict";var n=i(28),o=i(17);t.exports=o.extend({type:"series.line",dependencies:["grid","polar"],getInitialData:function(t,e){return n(t.data,this,e)},defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,clipOverflow:!0,label:{normal:{position:"top"}},lineStyle:{normal:{width:2,type:"solid"}},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:!1,connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0}})},function(t,e,i){"use strict";function n(t,e){if(t.length===e.length){for(var i=0;i<t.length;i++){var n=t[i],o=e[i];if(n[0]!==o[0]||n[1]!==o[1])return}return!0}}function o(t){return"number"==typeof t?t:t?.3:0}function a(t){var e=t.getGlobalExtent();if(t.onBand){var i=t.getBandWidth()/2-1,n=e[1]>e[0]?1:-1;e[0]+=n*i,e[1]-=n*i}return e}function r(t){return t>=0?1:-1}function s(t,e){var i=t.getBaseAxis(),n=t.getOtherAxis(i),o=i.onZero?0:n.scale.getExtent()[0],a=n.dim,s="x"===a||"radius"===a?1:0;return e.mapArray([a],function(n,l){for(var u,c=e.stackedOn;c&&r(c.get(a,l))===r(n);){u=c;break}var h=[];return h[s]=e.get(i.dim,l),h[1-s]=u?u.get(a,l,!0):o,t.dataToPoint(h)},!0)}function l(t,e,i){var n=a(t.getAxis("x")),o=a(t.getAxis("y")),r=t.getBaseAxis().isHorizontal(),s=Math.min(n[0],n[1]),l=Math.min(o[0],o[1]),u=Math.max(n[0],n[1])-s,c=Math.max(o[0],o[1])-l,h=i.get("lineStyle.normal.width")||2,d=i.get("clipOverflow")?h/2:Math.max(u,c);r?(l-=d,c+=2*d):(s-=d,u+=2*d);var f=new v.Rect({shape:{x:s,y:l,width:u,height:c}});return e&&(f.shape[r?"width":"height"]=0,v.initProps(f,{shape:{width:u,height:c}},i)),f}function u(t,e,i){var n=t.getAngleAxis(),o=t.getRadiusAxis(),a=o.getExtent(),r=n.getExtent(),s=Math.PI/180,l=new v.Sector({shape:{cx:t.cx,cy:t.cy,r0:a[0],r:a[1],startAngle:-r[0]*s,endAngle:-r[1]*s,clockwise:n.inverse}});return e&&(l.shape.endAngle=-r[0]*s,v.initProps(l,{shape:{endAngle:-r[1]*s}},i)),l}function c(t,e,i){return"polar"===t.type?u(t,e,i):l(t,e,i)}function h(t,e,i){for(var n=e.getBaseAxis(),o="x"===n.dim||"radius"===n.dim?0:1,a=[],r=0;r<t.length-1;r++){var s=t[r+1],l=t[r];a.push(l);var u=[];switch(i){case"end":u[o]=s[o],u[1-o]=l[1-o],a.push(u);break;case"middle":var c=(l[o]+s[o])/2,h=[];u[o]=h[o]=c,u[1-o]=l[1-o],h[1-o]=s[1-o],a.push(u),a.push(h);break;default:u[o]=l[o],u[1-o]=s[1-o],a.push(u)}}return t[r]&&a.push(t[r]),a}function d(t,e){var i=t.getVisual("visualMeta");if(i&&i.length&&t.count()){for(var n,o=i.length-1;o>=0;o--)if(i[o].dimension<2){n=i[o];break}if(n&&"cartesian2d"===e.type){var a=n.dimension,r=t.dimensions[a],s=e.getAxis(r),l=f.map(n.stops,function(t){return{coord:s.toGlobalCoord(s.dataToCoord(t.value)),color:t.color}}),u=l.length,c=n.outerColors.slice();u&&l[0].coord>l[u-1].coord&&(l.reverse(),c.reverse());var h=10,d=l[0].coord-h,p=l[u-1].coord+h,g=p-d;if(g<.001)return"transparent";f.each(l,function(t){t.offset=(t.coord-d)/g}),l.push({offset:u?l[u-1].offset:.5,color:c[1]||"transparent"}),l.unshift({offset:u?l[0].offset:.5,color:c[0]||"transparent"});var m=new v.LinearGradient(0,0,0,0,l,!0);return m[r]=d,m[r+"2"]=p,m}}}var f=i(1),p=i(44),g=i(54),m=i(111),v=i(3),y=i(5),x=i(93),_=i(30);t.exports=_.extend({type:"line",init:function(){var t=new v.Group,e=new p;this.group.add(e.group),this._symbolDraw=e,this._lineGroup=t},render:function(t,e,i){var a=t.coordinateSystem,r=this.group,l=t.getData(),u=t.getModel("lineStyle.normal"),p=t.getModel("areaStyle.normal"),g=l.mapArray(l.getItemLayout,!0),m="polar"===a.type,v=this._coordSys,y=this._symbolDraw,x=this._polyline,_=this._polygon,b=this._lineGroup,w=t.get("animation"),S=!p.isEmpty(),M=s(a,l),I=t.get("showSymbol"),T=I&&!m&&!t.get("showAllSymbol")&&this._getSymbolIgnoreFunc(l,a),A=this._data;A&&A.eachItemGraphicEl(function(t,e){t.__temp&&(r.remove(t),A.setItemGraphicEl(e,null))}),I||y.remove(),r.add(b);var C=!m&&t.get("step");x&&v.type===a.type&&C===this._step?(S&&!_?_=this._newPolygon(g,M,a,w):_&&!S&&(b.remove(_),_=this._polygon=null),b.setClipPath(c(a,!1,t)),I&&y.updateData(l,T),l.eachItemGraphicEl(function(t){t.stopAnimation(!0)}),n(this._stackedOnPoints,M)&&n(this._points,g)||(w?this._updateAnimation(l,M,a,i,C):(C&&(g=h(g,a,C),M=h(M,a,C)),x.setShape({points:g}),_&&_.setShape({points:g,stackedOnPoints:M})))):(I&&y.updateData(l,T),C&&(g=h(g,a,C),M=h(M,a,C)),x=this._newPolyline(g,a,w),S&&(_=this._newPolygon(g,M,a,w)),b.setClipPath(c(a,!0,t)));var L=d(l,a)||l.getVisual("color");x.useStyle(f.defaults(u.getLineStyle(),{fill:"none",stroke:L,lineJoin:"bevel"}));var D=t.get("smooth");if(D=o(t.get("smooth")),x.setShape({smooth:D,smoothMonotone:t.get("smoothMonotone"),connectNulls:t.get("connectNulls")}),_){var P=l.stackedOn,k=0;if(_.useStyle(f.defaults(p.getAreaStyle(),{fill:L,opacity:.7,lineJoin:"bevel"})),P){var O=P.hostModel;k=o(O.get("smooth"))}_.setShape({smooth:D,stackedOnSmooth:k,smoothMonotone:t.get("smoothMonotone"),connectNulls:t.get("connectNulls")})}this._data=l,this._coordSys=a,this._stackedOnPoints=M,this._points=g,this._step=C},dispose:function(){},highlight:function(t,e,i,n){var o=t.getData(),a=y.queryDataIndex(o,n);if(!(a instanceof Array)&&null!=a&&a>=0){var r=o.getItemGraphicEl(a);if(!r){var s=o.getItemLayout(a);if(!s)return;r=new g(o,a),r.position=s,r.setZ(t.get("zlevel"),t.get("z")),r.ignore=isNaN(s[0])||isNaN(s[1]),r.__temp=!0,o.setItemGraphicEl(a,r),r.stopSymbolAnimation(!0),this.group.add(r)}r.highlight()}else _.prototype.highlight.call(this,t,e,i,n)},downplay:function(t,e,i,n){var o=t.getData(),a=y.queryDataIndex(o,n);if(null!=a&&a>=0){var r=o.getItemGraphicEl(a);r&&(r.__temp?(o.setItemGraphicEl(a,null),this.group.remove(r)):r.downplay())}else _.prototype.downplay.call(this,t,e,i,n)},_newPolyline:function(t){var e=this._polyline;return e&&this._lineGroup.remove(e),e=new x.Polyline({shape:{points:t},silent:!0,z2:10}),this._lineGroup.add(e),this._polyline=e,e},_newPolygon:function(t,e){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new x.Polygon({shape:{points:t,stackedOnPoints:e},silent:!0}),this._lineGroup.add(i),this._polygon=i,i},_getSymbolIgnoreFunc:function(t,e){var i=e.getAxesByScale("ordinal")[0];if(i&&i.isLabelIgnored)return f.bind(i.isLabelIgnored,i)},_updateAnimation:function(t,e,i,n,o){var a=this._polyline,r=this._polygon,s=t.hostModel,l=m(this._data,t,this._stackedOnPoints,e,this._coordSys,i),u=l.current,c=l.stackedOnCurrent,d=l.next,f=l.stackedOnNext;o&&(u=h(l.current,i,o),c=h(l.stackedOnCurrent,i,o),d=h(l.next,i,o),f=h(l.stackedOnNext,i,o)),a.shape.__points=l.current,a.shape.points=u,v.updateProps(a,{shape:{points:d}},s),r&&(r.setShape({points:u,stackedOnPoints:c}),v.updateProps(r,{shape:{points:d,stackedOnPoints:f}},s));for(var p=[],g=l.status,y=0;y<g.length;y++){var x=g[y].cmd;if("="===x){var _=t.getItemGraphicEl(g[y].idx1);_&&p.push({el:_,ptIdx:y})}}a.animators&&a.animators.length&&a.animators[0].during(function(){for(var t=0;t<p.length;t++){var e=p[t].el;e.attr("position",a.shape.__points[p[t].ptIdx])}})},remove:function(t){var e=this.group,i=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),i&&i.eachItemGraphicEl(function(t,n){t.__temp&&(e.remove(t),i.setItemGraphicEl(n,null))}),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._data=null}})},function(t,e){function i(t){return t>=0?1:-1}function n(t,e,n){for(var o,a=t.getBaseAxis(),r=t.getOtherAxis(a),s=a.onZero?0:r.scale.getExtent()[0],l=r.dim,u="x"===l||"radius"===l?1:0,c=e.stackedOn,h=e.get(l,n);c&&i(c.get(l,n))===i(h);){o=c;break}var d=[];return d[u]=e.get(a.dim,n),d[1-u]=o?o.get(l,n,!0):s,t.dataToPoint(d)}function o(t,e){var i=[];return e.diff(t).add(function(t){i.push({cmd:"+",idx:t})}).update(function(t,e){i.push({cmd:"=",idx:e,idx1:t})}).remove(function(t){i.push({cmd:"-",idx:t})}).execute(),i}t.exports=function(t,e,i,a,r,s){for(var l=o(t,e),u=[],c=[],h=[],d=[],f=[],p=[],g=[],m=s.dimensions,v=0;v<l.length;v++){var y=l[v],x=!0;switch(y.cmd){case"=":var _=t.getItemLayout(y.idx),b=e.getItemLayout(y.idx1);(isNaN(_[0])||isNaN(_[1]))&&(_=b.slice()),u.push(_),c.push(b),h.push(i[y.idx]),d.push(a[y.idx1]),g.push(e.getRawIndex(y.idx1));break;case"+":var w=y.idx;u.push(r.dataToPoint([e.get(m[0],w,!0),e.get(m[1],w,!0)])),c.push(e.getItemLayout(w).slice()),h.push(n(r,e,w)),d.push(a[w]),g.push(e.getRawIndex(w));break;case"-":var w=y.idx,S=t.getRawIndex(w);S!==w?(u.push(t.getItemLayout(w)),c.push(s.dataToPoint([t.get(m[0],w,!0),t.get(m[1],w,!0)])),h.push(i[w]),d.push(n(s,t,w)),g.push(S)):x=!1}x&&(f.push(y),p.push(p.length))}p.sort(function(t,e){return g[t]-g[e]});for(var M=[],I=[],T=[],A=[],C=[],v=0;v<p.length;v++){var w=p[v];M[v]=u[w],I[v]=c[w],T[v]=h[w],A[v]=d[w],C[v]=f[w]}return{current:M,next:I,stackedOnCurrent:T,stackedOnNext:A,status:C}}},function(t,e,i){var n=i(1),o=i(2);i(113),i(114),i(89)("pie",[{type:"pieToggleSelect",event:"pieselectchanged",method:"toggleSelected"},{type:"pieSelect",event:"pieselected",method:"select"},{type:"pieUnSelect",event:"pieunselected",method:"unSelect"}]),o.registerVisual(n.curry(i(84),"pie")),o.registerLayout(n.curry(i(116),"pie")),o.registerProcessor(n.curry(i(63),"pie"))},function(t,e,i){"use strict";var n=i(14),o=i(1),a=i(5),r=i(4),s=i(25),l=i(78),u=i(2).extendSeriesModel({type:"series.pie",init:function(t){u.superApply(this,"init",arguments),this.legendDataProvider=function(){return this.getRawData()},this.updateSelectedMap(t.data),this._defaultLabelLine(t)},mergeOption:function(t){u.superCall(this,"mergeOption",t),this.updateSelectedMap(this.option.data)},getInitialData:function(t,e){var i=s(["value"],t.data),o=new n(i,this);return o.initData(t.data),o},getDataParams:function(t){var e=this.getData(),i=u.superCall(this,"getDataParams",t),n=[];return e.each("value",function(t){n.push(t)}),i.percent=r.getPercentWithPrecision(n,t,e.hostModel.get("percentPrecision")),i.$vars.push("percent"),i},_defaultLabelLine:function(t){a.defaultEmphasis(t.labelLine,["show"]);var e=t.labelLine.normal,i=t.labelLine.emphasis;e.show=e.show&&t.label.normal.show,i.show=i.show&&t.label.emphasis.show},defaultOption:{zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,selectedOffset:10,avoidLabelOverlap:!0,percentPrecision:2,stillShowZeroSum:!0,label:{normal:{rotate:!1,show:!0,position:"outer"},emphasis:{}},labelLine:{normal:{show:!0,length:15,length2:15,smooth:!1,lineStyle:{width:1,type:"solid"}}},itemStyle:{normal:{borderWidth:1},emphasis:{}},animationType:"expansion",animationEasing:"cubicOut",data:[]}});o.mixin(u,l),t.exports=u},function(t,e,i){function n(t,e,i,n){var a=e.getData(),r=this.dataIndex,s=a.getName(r),l=e.get("selectedOffset");n.dispatchAction({type:"pieToggleSelect",from:t,name:s,seriesId:e.id}),a.each(function(t){o(a.getItemGraphicEl(t),a.getItemLayout(t),e.isSelected(a.getName(t)),l,i)})}function o(t,e,i,n,o){var a=(e.startAngle+e.endAngle)/2,r=Math.cos(a),s=Math.sin(a),l=i?n:0,u=[r*l,s*l];o?t.animate().when(200,{position:u}).start("bounceOut"):t.attr("position",u)}function a(t,e){function i(){a.ignore=a.hoverIgnore,r.ignore=r.hoverIgnore}function n(){a.ignore=a.normalIgnore,r.ignore=r.normalIgnore}s.Group.call(this);var o=new s.Sector({z2:2}),a=new s.Polyline,r=new s.Text;this.add(o),this.add(a),this.add(r),this.updateData(t,e,!0),this.on("emphasis",i).on("normal",n).on("mouseover",i).on("mouseout",n)}function r(t,e,i,n,o){var a=n.getModel("textStyle"),r="inside"===o||"inner"===o;return{fill:a.getTextColor()||(r?"#fff":t.getItemVisual(e,"color")),opacity:t.getItemVisual(e,"opacity"),textFont:a.getFont(),text:l.retrieve(t.hostModel.getFormattedLabel(e,i),t.getName(e))}}var s=i(3),l=i(1),u=a.prototype;u.updateData=function(t,e,i){function n(){r.stopAnimation(!0),r.animateTo({shape:{r:h.r+10}},300,"elasticOut")}function a(){r.stopAnimation(!0),r.animateTo({shape:{r:h.r}},300,"elasticOut")}var r=this.childAt(0),u=t.hostModel,c=t.getItemModel(e),h=t.getItemLayout(e),d=l.extend({},h);if(d.label=null,i){r.setShape(d);var f=u.getShallow("animationType");"scale"===f?(r.shape.r=h.r0,s.initProps(r,{shape:{r:h.r}},u,e)):(r.shape.endAngle=h.startAngle,s.updateProps(r,{shape:{endAngle:h.endAngle}},u,e))}else s.updateProps(r,{shape:d},u,e);var p=c.getModel("itemStyle"),g=t.getItemVisual(e,"color");r.useStyle(l.defaults({lineJoin:"bevel",fill:g},p.getModel("normal").getItemStyle())),r.hoverStyle=p.getModel("emphasis").getItemStyle();var m=c.getShallow("cursor");m&&r.attr("cursor",m),o(this,t.getItemLayout(e),c.get("selected"),u.get("selectedOffset"),u.get("animation")),r.off("mouseover").off("mouseout").off("emphasis").off("normal"),c.get("hoverAnimation")&&u.isAnimationEnabled()&&r.on("mouseover",n).on("mouseout",a).on("emphasis",n).on("normal",a),this._updateLabel(t,e),s.setHoverStyle(this)},u._updateLabel=function(t,e){var i=this.childAt(1),n=this.childAt(2),o=t.hostModel,a=t.getItemModel(e),l=t.getItemLayout(e),u=l.label,c=t.getItemVisual(e,"color");s.updateProps(i,{shape:{points:u.linePoints||[[u.x,u.y],[u.x,u.y],[u.x,u.y]]}},o,e),s.updateProps(n,{style:{x:u.x,y:u.y}},o,e),n.attr({style:{textVerticalAlign:u.verticalAlign,textAlign:u.textAlign,textFont:u.font},rotation:u.rotation,origin:[u.x,u.y],z2:10});var h=a.getModel("label.normal"),d=a.getModel("label.emphasis"),f=a.getModel("labelLine.normal"),p=a.getModel("labelLine.emphasis"),g=h.get("position")||d.get("position");n.setStyle(r(t,e,"normal",h,g)),n.ignore=n.normalIgnore=!h.get("show"),n.hoverIgnore=!d.get("show"),i.ignore=i.normalIgnore=!f.get("show"),i.hoverIgnore=!p.get("show"),i.setStyle({stroke:c,opacity:t.getItemVisual(e,"opacity")}),i.setStyle(f.getModel("lineStyle").getLineStyle()),n.hoverStyle=r(t,e,"emphasis",d,g),i.hoverStyle=p.getModel("lineStyle").getLineStyle();var m=f.get("smooth");m&&m===!0&&(m=.4),i.setShape({smooth:m})},l.inherits(a,s.Group);var c=i(30).extend({type:"pie",init:function(){var t=new s.Group;this._sectorGroup=t},render:function(t,e,i,o){if(!o||o.from!==this.uid){var r=t.getData(),s=this._data,u=this.group,c=e.get("animation"),h=!s,d=t.get("animationType"),f=l.curry(n,this.uid,t,c,i),p=t.get("selectedMode");if(r.diff(s).add(function(t){var e=new a(r,t);h&&"scale"!==d&&e.eachChild(function(t){t.stopAnimation(!0)}),p&&e.on("click",f),r.setItemGraphicEl(t,e),u.add(e)}).update(function(t,e){var i=s.getItemGraphicEl(e);i.updateData(r,t),i.off("click"),p&&i.on("click",f),u.add(i),r.setItemGraphicEl(t,i)}).remove(function(t){var e=s.getItemGraphicEl(t);u.remove(e)}).execute(),c&&h&&r.count()>0&&"scale"!==d){var g=r.getItemLayout(0),m=Math.max(i.getWidth(),i.getHeight())/2,v=l.bind(u.removeClipPath,u);u.setClipPath(this._createClipPath(g.cx,g.cy,m,g.startAngle,g.clockwise,v,t))}this._data=r}},dispose:function(){},_createClipPath:function(t,e,i,n,o,a,r){var l=new s.Sector({shape:{cx:t,cy:e,r0:0,r:i,startAngle:n,endAngle:n,clockwise:o}});return s.initProps(l,{shape:{endAngle:n+(o?1:-1)*Math.PI*2}},r,a),l},containPoint:function(t,e){var i=e.getData(),n=i.getItemLayout(0);if(n){var o=t[0]-n.cx,a=t[1]-n.cy,r=Math.sqrt(o*o+a*a);return r<=n.r&&r>=n.r0}}});t.exports=c},function(t,e,i){"use strict";function n(t,e,i,n,o,a,r){function s(e,i,n,o){for(var a=e;a<i;a++)if(t[a].y+=n,a>e&&a+1<i&&t[a+1].y>t[a].y+t[a].height)return void l(a,n/2);l(i-1,n/2)}function l(e,i){for(var n=e;n>=0&&(t[n].y-=i,!(n>0&&t[n].y>t[n-1].y+t[n-1].height));n--);}function u(t,e,i,n,o,a){for(var r=a>0?e?Number.MAX_VALUE:0:e?Number.MAX_VALUE:0,s=0,l=t.length;s<l;s++)if("center"!==t[s].position){var u=Math.abs(t[s].y-n),c=t[s].len,h=t[s].len2,d=u<o+c?Math.sqrt((o+c+h)*(o+c+h)-u*u):Math.abs(t[s].x-i);e&&d>=r&&(d=r-10),!e&&d<=r&&(d=r+10),t[s].x=i+d*a,r=d}}t.sort(function(t,e){return t.y-e.y});for(var c,h=0,d=t.length,f=[],p=[],g=0;g<d;g++)c=t[g].y-h,c<0&&s(g,d,-c,o),h=t[g].y+t[g].height;r-h<0&&l(d-1,h-r);for(var g=0;g<d;g++)t[g].y>=i?p.push(t[g]):f.push(t[g]);u(f,!1,e,i,n,o),u(p,!0,e,i,n,o)}function o(t,e,i,o,a,r){for(var s=[],l=[],u=0;u<t.length;u++)t[u].x<e?s.push(t[u]):l.push(t[u]);n(l,e,i,o,1,a,r),n(s,e,i,o,-1,a,r);for(var u=0;u<t.length;u++){var c=t[u].linePoints;if(c){var h=c[1][0]-c[2][0];t[u].x<e?c[2][0]=t[u].x+3:c[2][0]=t[u].x-3,c[1][1]=c[2][1]=t[u].y,c[1][0]=c[2][0]+h}}}var a=i(16);t.exports=function(t,e,i,n){var r,s,l=t.getData(),u=[],c=!1;l.each(function(i){var n,o,h,d,f=l.getItemLayout(i),p=l.getItemModel(i),g=p.getModel("label.normal"),m=g.get("position")||p.get("label.emphasis.position"),v=p.getModel("labelLine.normal"),y=v.get("length"),x=v.get("length2"),_=(f.startAngle+f.endAngle)/2,b=Math.cos(_),w=Math.sin(_);r=f.cx,s=f.cy;var S="inside"===m||"inner"===m;if("center"===m)n=f.cx,o=f.cy,d="center";else{var M=(S?(f.r+f.r0)/2*b:f.r*b)+r,I=(S?(f.r+f.r0)/2*w:f.r*w)+s;if(n=M+3*b,o=I+3*w,!S){var T=M+b*(y+e-f.r),A=I+w*(y+e-f.r),C=T+(b<0?-1:1)*x,L=A;n=C+(b<0?-5:5),o=L,h=[[M,I],[T,A],[C,L]]}d=S?"center":b>0?"left":"right"}var D=g.getModel("textStyle").getFont(),P=g.get("rotate")?b<0?-_+Math.PI:-_:0,k=t.getFormattedLabel(i,"normal")||l.getName(i),O=a.getBoundingRect(k,D,d,"top");c=!!P,f.label={x:n,y:o,position:m,height:O.height,len:y,len2:x,linePoints:h,textAlign:d,verticalAlign:"middle",font:D,rotation:P},S||u.push(f.label)}),!c&&t.get("avoidLabelOverlap")&&o(u,r,s,e,i,n)}},function(t,e,i){var n=i(4),o=n.parsePercent,a=i(115),r=i(1),s=2*Math.PI,l=Math.PI/180;t.exports=function(t,e,i,u){e.eachSeriesByType(t,function(t){var e=t.get("center"),u=t.get("radius");r.isArray(u)||(u=[0,u]),r.isArray(e)||(e=[e,e]);var c=i.getWidth(),h=i.getHeight(),d=Math.min(c,h),f=o(e[0],c),p=o(e[1],h),g=o(u[0],d/2),m=o(u[1],d/2),v=t.getData(),y=-t.get("startAngle")*l,x=t.get("minAngle")*l,_=0;v.each("value",function(t){!isNaN(t)&&_++});var b=v.getSum("value"),w=Math.PI/(b||_)*2,S=t.get("clockwise"),M=t.get("roseType"),I=t.get("stillShowZeroSum"),T=v.getDataExtent("value");T[0]=0;var A=s,C=0,L=y,D=S?1:-1;if(v.each("value",function(t,e){var i;if(isNaN(t))return void v.setItemLayout(e,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:S,cx:f,cy:p,r0:g,r:M?NaN:m});i="area"!==M?0===b&&I?w:t*w:s/_,i<x?(i=x,A-=x):C+=t;var o=L+D*i;v.setItemLayout(e,{angle:i,startAngle:L,endAngle:o,clockwise:S,cx:f,cy:p,r0:g,r:M?n.linearMap(t,T,[g,m]):m}),L=o},!0),A<s&&_)if(A<=.001){var P=s/_;v.each("value",function(t,e){if(!isNaN(t)){var i=v.getItemLayout(e);i.angle=P,i.startAngle=y+D*e*P,i.endAngle=y+D*(e+1)*P}})}else w=A/C,L=y,v.each("value",function(t,e){if(!isNaN(t)){var i=v.getItemLayout(e),n=i.angle===x?x:t*w;i.startAngle=L,i.endAngle=L+D*n,L+=D*n}});a(t,m,c,h)})}},function(t,e,i){"use strict";i(60),i(118)},function(t,e,i){var n=i(1),o=i(3),a=i(40),r=i(41),s=i(75),l=a.ifIgnoreOnTick,u=a.getInterval,c=["axisLine","axisLabel","axisTick","axisName"],h=["splitArea","splitLine"],d=r.extend({type:"cartesianAxis",axisPointerClass:"CartesianAxisPointer",render:function(t,e,i,r){this.group.removeAll();var l=this._axisGroup;if(this._axisGroup=new o.Group,this.group.add(this._axisGroup),t.get("show")){var u=t.getCoordSysModel(),f=s.layout(u,t),p=new a(t,f);n.each(c,p.add,p),this._axisGroup.add(p.getGroup()),n.each(h,function(e){t.get(e+".show")&&this["_"+e](t,u,f.labelInterval)},this),o.groupTransition(l,this._axisGroup,t),d.superCall(this,"render",t,e,i,r)}},_splitLine:function(t,e,i){var a=t.axis;if(!a.scale.isBlank()){var r=t.getModel("splitLine"),s=r.getModel("lineStyle"),c=s.get("color"),h=u(r,i);c=n.isArray(c)?c:[c];for(var d=e.coordinateSystem.getRect(),f=a.isHorizontal(),p=0,g=a.getTicksCoords(),m=a.scale.getTicks(),v=[],y=[],x=s.getLineStyle(),_=0;_<g.length;_++)if(!l(a,_,h)){var b=a.toGlobalCoord(g[_]);f?(v[0]=b,v[1]=d.y,y[0]=b,y[1]=d.y+d.height):(v[0]=d.x,v[1]=b,y[0]=d.x+d.width,y[1]=b);var w=p++%c.length;this._axisGroup.add(new o.Line(o.subPixelOptimizeLine({anid:"line_"+m[_],shape:{x1:v[0],y1:v[1],x2:y[0],y2:y[1]},style:n.defaults({stroke:c[w]},x),silent:!0})))}}},_splitArea:function(t,e,i){var a=t.axis;if(!a.scale.isBlank()){var r=t.getModel("splitArea"),s=r.getModel("areaStyle"),c=s.get("color"),h=e.coordinateSystem.getRect(),d=a.getTicksCoords(),f=a.scale.getTicks(),p=a.toGlobalCoord(d[0]),g=a.toGlobalCoord(d[0]),m=0,v=u(r,i),y=s.getAreaStyle();c=n.isArray(c)?c:[c];for(var x=1;x<d.length;x++)if(!l(a,x,v)){var _,b,w,S,M=a.toGlobalCoord(d[x]);a.isHorizontal()?(_=p,b=h.y,w=M-_,S=h.height):(_=h.x,b=g,w=h.width,S=M-b);var I=m++%c.length;this._axisGroup.add(new o.Rect({anid:"area_"+f[x],shape:{x:_,y:b,width:w,height:S},style:n.defaults({fill:c[I]},y),silent:!0})),p=_+w,g=b+S}}}});d.extend({type:"xAxis"}),d.extend({type:"yAxis"})},function(t,e,i){"use strict";function n(){}function o(t,e,i,n){a(f(i).lastProp,n)||(f(i).lastProp=n,e?d.updateProps(i,n,t):(i.stopAnimation(),i.attr(n)))}function a(t,e){if(c.isObject(t)&&c.isObject(e)){var i=!0;return c.each(e,function(e,n){i&=a(t[n],e)}),!!i}return t===e}function r(t,e){t[e.get("label.show")?"show":"hide"]()}function s(t){return{position:t.position.slice(),rotation:t.rotation||0}}function l(t,e){var i=t.get("icon"),n={x:-1,y:-1,width:2,height:2},o=c.extend({style:{strokeNoScale:!0},rectHover:!0,cursor:"move",draggable:!0},e);return 0===i.indexOf("image://")?(n.image=i.slice(8),o.style=n,new d.Image(o)):d.makePath(i.replace("path://",""),o,n,"center")}function u(t,e,i){var n=e.get("z"),o=e.get("zlevel");t&&t.traverse(function(t){"group"!==t.type&&(null!=n&&(t.z=n),null!=o&&(t.zlevel=o),t.silent=i)})}var c=i(1),h=i(15),d=i(3),f=i(5).makeGetter(),p=i(45),g=i(21),m=i(37),v=c.clone,y=c.bind;n.prototype={_group:null,_lastGraphicKey:null,_handle:null,_dragging:!1,_lastValue:null,_lastStatus:null,_payloadInfo:null,animationThreshold:15,render:function(t,e,i,n){var a=e.get("value"),r=e.get("status");if(this._axisModel=t,this._axisPointerModel=e,this._api=i,n||this._lastValue!==a||this._lastStatus!==r){this._lastValue=a,this._lastStatus=r;var s=this._group,l=this._handle;if(!r||"hide"===r)return s&&s.hide(),void(l&&l.hide());s&&s.show(),l&&l.show();var h={};this.makeElOption(h,a,t,e,i);var f=h.graphicKey;f!==this._lastGraphicKey&&this.clear(i),this._lastGraphicKey=f;var p=this._moveAnimation=this.determineAnimation(t,e);if(s){var g=c.curry(o,e,p);this.updatePointerEl(s,h,g,e),this.updateLabelEl(s,h,g,e)}else s=this._group=new d.Group,this.createPointerEl(s,h,t,e),this.createLabelEl(s,h,t,e),i.getZr().add(s);u(s,e,!0),this._renderHandle(a)}},remove:function(t){this.clear(t)},dispose:function(t){this.clear(t)},determineAnimation:function(t,e){var i=e.get("animation"),n=t.axis,o="category"===n.type,a=e.get("snap");if(!a&&!o)return!1;if("auto"===i||null==i){var r=this.animationThreshold;if(o&&n.getBandWidth()>r)return!0;if(a){var s=p.getAxisInfo(t).seriesDataCount,l=n.getExtent();return Math.abs(l[0]-l[1])/s>r}return!1}return i===!0},makeElOption:function(t,e,i,n,o){},createPointerEl:function(t,e,i,n){var o=e.pointer;if(o){var a=f(t).pointerEl=new d[o.type](v(e.pointer));t.add(a)}},createLabelEl:function(t,e,i,n){if(e.label){var o=f(t).labelEl=new d.Rect(v(e.label));t.add(o),r(o,n)}},updatePointerEl:function(t,e,i){var n=f(t).pointerEl;n&&(n.setStyle(e.pointer.style),i(n,{shape:e.pointer.shape}))},updateLabelEl:function(t,e,i,n){var o=f(t).labelEl;o&&(o.setStyle(e.label.style),i(o,{shape:e.label.shape,position:e.label.position}),r(o,n))},_renderHandle:function(t){if(!this._dragging&&this.updateHandleTransform){var e=this._axisPointerModel,i=this._api.getZr(),n=this._handle,o=e.getModel("handle"),a=e.get("status");if(!o.get("show")||!a||"hide"===a)return n&&i.remove(n),void(this._handle=null);var r;this._handle||(r=!0,n=this._handle=l(o,{onmousemove:function(t){g.stop(t.event)},onmousedown:y(this._onHandleDragMove,this,0,0),drift:y(this._onHandleDragMove,this),ondragend:y(this._onHandleDragEnd,this)}),i.add(n)),u(n,e,!1);var s=["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];n.setStyle(o.getItemStyle(null,s));var h=o.get("size");c.isArray(h)||(h=[h,h]),n.attr("scale",[h[0]/2,h[1]/2]),m.createOrUpdate(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,r)}},_moveHandleToValue:function(t,e){o(this._axisPointerModel,!e&&this._moveAnimation,this._handle,s(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},_onHandleDragMove:function(t,e){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(s(i),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(s(n)),f(i).lastProp=null,this._doDispatchAxisPointer()}},_doDispatchAxisPointer:function(){var t=this._handle;if(t){var e=this._payloadInfo,i=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:i.axis.dim,axisIndex:i.componentIndex}]})}},_onHandleDragEnd:function(t){this._dragging=!1;var e=this._handle;if(e){var i=this._axisPointerModel.get("value");this._moveHandleToValue(i),this._api.dispatchAction({type:"hideTip"})}},getHandleTransform:null,updateHandleTransform:null,clear:function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),i=this._group,n=this._handle;e&&i&&(this._lastGraphicKey=null,i&&e.remove(i),n&&e.remove(n),this._group=null,this._handle=null,this._payloadInfo=null)},doClear:function(){},buildLabel:function(t,e,i){return i=i||0,{x:t[i],y:t[1-i],width:e[i],height:e[1-i]}}},n.prototype.constructor=n,h.enableClassExtend(n),t.exports=n},function(t,e,i){"use strict";function n(t,e){var i={};return i[e.dim+"AxisIndex"]=e.index,t.getCartesian(i)}function o(t){return"x"===t.dim?0:1}var a=i(3),r=i(119),s=i(76),l=i(75),u=i(41),c=r.extend({makeElOption:function(t,e,i,o,a){var r=i.axis,u=r.grid,c=o.get("type"),d=n(u,r).getOtherAxis(r).getGlobalExtent(),f=r.toGlobalCoord(r.dataToCoord(e,!0));if(c&&"none"!==c){var p=s.buildElStyle(o),g=h[c](r,f,d,p);g.style=p,t.graphicKey=g.type,t.pointer=g}var m=l.layout(u.model,i);s.buildCartesianSingleLabelElOption(e,t,m,i,o,a)},getHandleTransform:function(t,e,i){var n=l.layout(e.axis.grid.model,e,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:s.getTransformedPosition(e.axis,t,n),rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(t,e,i,o){var a=i.axis,r=a.grid,s=a.getGlobalExtent(!0),l=n(r,a).getOtherAxis(a).getGlobalExtent(),u="x"===a.dim?0:1,c=t.position;c[u]+=e[u],c[u]=Math.min(s[1],c[u]),c[u]=Math.max(s[0],c[u]);var h=(l[1]+l[0])/2,d=[h,h];d[u]=c[u];var f=[{verticalAlign:"middle"},{align:"center"}];return{position:c,rotation:t.rotation,cursorPoint:d,tooltipOption:f[u]}}}),h={line:function(t,e,i,n){var r=s.makeLineShape([e,i[0]],[e,i[1]],o(t));return a.subPixelOptimizeLine({shape:r,style:n}),{type:"Line",shape:r}},shadow:function(t,e,i,n){var a=t.getBandWidth(),r=i[1]-i[0];return{type:"Rect",shape:s.makeRectShape([e-a/2,i[0]],[a,r],o(t))}}};u.registerAxisPointerClass("CartesianAxisPointer",c),t.exports=c},function(t,e,i){var n=i(1),o=i(5);t.exports=function(t,e){var i,a=[],r=t.seriesIndex;if(null==r||!(i=e.getSeriesByIndex(r)))return{point:[]};var s=i.getData(),l=o.queryDataIndex(s,t);if(null==l||n.isArray(l))return{point:[]};var u=s.getItemGraphicEl(l),c=i.coordinateSystem;if(i.getTooltipPosition)a=i.getTooltipPosition(l)||[];else if(c&&c.dataToPoint)a=c.dataToPoint(s.getValues(n.map(c.dimensions,function(t){return i.coordDimToDataDim(t)[0]}),l,!0))||[];else if(u){var h=u.getBoundingRect().clone();h.applyTransform(u.transform),a=[h.x+h.width/2,h.y+h.height/2]}return{point:a,el:u}}},function(t,e,i){function n(t,e){function i(i,n){t.on(i,function(i){var a=s(e);h(c(t).records,function(t){t&&n(t,i,a.dispatchAction)}),o(a.pendings,e)})}c(t).initialized||(c(t).initialized=!0,i("click",u.curry(r,"click")),i("mousemove",u.curry(r,"mousemove")),i("globalout",a))}function o(t,e){var i,n=t.showTip.length,o=t.hideTip.length;n?i=t.showTip[n-1]:o&&(i=t.hideTip[o-1]),i&&(i.dispatchAction=null,e.dispatchAction(i))}function a(t,e,i){t.handler("leave",null,i)}function r(t,e,i,n){e.handler(t,i,n)}function s(t){var e={showTip:[],hideTip:[]},i=function(n){var o=e[n.type];o?o.push(n):(n.dispatchAction=i,t.dispatchAction(n))};return{dispatchAction:i,pendings:e}}var l=i(9),u=i(1),c=i(5).makeGetter(),h=u.each,d={};d.register=function(t,e,i){if(!l.node){var o=e.getZr();c(o).records||(c(o).records={}),n(o,e);var a=c(o).records[t]||(c(o).records[t]={});a.handler=i}},d.unregister=function(t,e){if(!l.node){var i=e.getZr(),n=(c(i).records||{})[t];n&&(c(i).records[t]=null)}},t.exports=d},function(t,e,i){var n=i(1),o=i(77),a=i(2);a.registerAction("dataZoom",function(t,e){var i=o.createLinkedNodesFinder(n.bind(e.eachComponent,e,"dataZoom"),o.eachAxisDim,function(t,e){return t.get(e.axisIndex)}),a=[];e.eachComponent({mainType:"dataZoom",query:t},function(t,e){a.push.apply(a,i(t).nodes)}),n.each(a,function(e,i){e.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})})})},function(t,e,i){function n(t,e,i){i.getAxisProxy(t.name,e).reset(i)}function o(t,e,i){i.getAxisProxy(t.name,e).filterData(i)}var a=i(2);a.registerProcessor(function(t,e){t.eachComponent("dataZoom",function(t){t.eachTargetAxis(n),t.eachTargetAxis(o)}),t.eachComponent("dataZoom",function(t){var e=t.findRepresentativeAxisProxy(),i=e.getDataPercentWindow(),n=e.getDataValueWindow();t.setRawRange({start:i[0],end:i[1],startValue:n[0],endValue:n[1]},!0)})})},function(t,e,i){function n(t){var e=t[r];return e||(e=t[r]=[{}]),e}var o=i(1),a=o.each,r="\0_ec_hist_store",s={push:function(t,e){var i=n(t);a(e,function(e,n){for(var o=i.length-1;o>=0;o--){var a=i[o];if(a[n])break}if(o<0){var r=t.queryComponents({mainType:"dataZoom",subType:"select",id:n})[0];if(r){var s=r.getPercentRange();i[0][n]={dataZoomId:n,start:s[0],end:s[1]}}}}),i.push(e)},pop:function(t){var e=n(t),i=e[e.length-1];e.length>1&&e.pop();var o={};return a(i,function(t,i){for(var n=e.length-1;n>=0;n--){var t=e[n][i];if(t){o[i]=t;break}}}),o},clear:function(t){t[r]=null},count:function(t){return n(t).length}};t.exports=s},function(t,e,i){i(13).registerSubTypeDefaulter("dataZoom",function(t){return"slider"})},function(t,e,i){function n(t){V.call(this),this._zr=t,this.group=new G.Group,this._brushType,this._brushOption,this._panels,this._track=[],this._dragging,this._covers=[],this._creatingCover,this._creatingPanel,this._enableGlobalPan,this._uid="brushController_"+it++,this._handlers={},Z(nt,function(t,e){this._handlers[e]=B.bind(t,this)},this)}function o(t,e){var i=t._zr;t._enableGlobalPan||H.take(i,J,t._uid),Z(t._handlers,function(t,e){i.on(e,t)}),t._brushType=e.brushType,t._brushOption=B.merge(B.clone(et),e,!0)}function a(t){var e=t._zr;H.release(e,J,t._uid),Z(t._handlers,function(t,i){e.off(i,t)}),t._brushType=t._brushOption=null}function r(t,e){var i=ot[e.brushType].createCover(t,e);return i.__brushOption=e,u(i,e),t.group.add(i),i}function s(t,e){var i=h(e);return i.endCreating&&(i.endCreating(t,e),u(e,e.__brushOption)),e}function l(t,e){var i=e.__brushOption;h(e).updateCoverShape(t,e,i.range,i)}function u(t,e){var i=e.z;null==i&&(i=Y),t.traverse(function(t){t.z=i,t.z2=i})}function c(t,e){h(e).updateCommon(t,e),l(t,e)}function h(t){return ot[t.__brushOption.brushType]}function d(t,e,i){var n=t._panels;if(!n)return!0;var o,a=t._transform;return Z(n,function(t){t.isTargetByCursor(e,i,a)&&(o=t)}),o}function f(t,e){var i=t._panels;if(!i)return!0;var n=e.__brushOption.panelId;return null==n||i[n]}function p(t){var e=t._covers,i=e.length;return Z(e,function(e){t.group.remove(e)},t),e.length=0,!!i}function g(t,e){var i=q(t._covers,function(t){var e=t.__brushOption,i=B.clone(e.range);return{brushType:e.brushType,panelId:e.panelId,range:i}});t.trigger("brush",i,{isEnd:!!e.isEnd,removeOnClick:!!e.removeOnClick})}function m(t){var e=t._track;if(!e.length)return!1;var i=e[e.length-1],n=e[0],o=i[0]-n[0],a=i[1]-n[1],r=X(o*o+a*a,.5);return r>$}function v(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function y(t,e,i,n){var o=new G.Group;return o.add(new G.Rect({name:"main",style:w(i),silent:!0,draggable:!0,cursor:"move",drift:W(t,e,o,"nswe"),ondragend:W(g,e,{isEnd:!0})})),Z(n,function(i){o.add(new G.Rect({name:i,style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:W(t,e,o,i),ondragend:W(g,e,{isEnd:!0})}))}),o}function x(t,e,i,n){var o=n.brushStyle.lineWidth||0,a=U(o,K),r=i[0][0],s=i[1][0],l=r-o/2,u=s-o/2,c=i[0][1],h=i[1][1],d=c-a+o/2,f=h-a+o/2,p=c-r,g=h-s,m=p+o,v=g+o;b(t,e,"main",r,s,p,g),n.transformable&&(b(t,e,"w",l,u,a,v),b(t,e,"e",d,u,a,v),b(t,e,"n",l,u,m,a),b(t,e,"s",l,f,m,a),b(t,e,"nw",l,u,a,a),b(t,e,"ne",d,u,a,a),b(t,e,"sw",l,f,a,a),b(t,e,"se",d,f,a,a))}function _(t,e){var i=e.__brushOption,n=i.transformable,o=e.childAt(0);o.useStyle(w(i)),o.attr({silent:!n,cursor:n?"move":"default"}),Z(["w","e","n","s","se","sw","ne","nw"],function(i){var o=e.childOfName(i),a=I(t,i);o&&o.attr({silent:!n,invisible:!n,cursor:n?tt[a]+"-resize":null})})}function b(t,e,i,n,o,a,r){var s=e.childOfName(i);s&&s.setShape(D(L(t,e,[[n,o],[n+a,o+r]])))}function w(t){return B.defaults({strokeNoScale:!0},t.brushStyle)}function S(t,e,i,n){var o=[j(t,i),j(e,n)],a=[U(t,i),U(e,n)];return[[o[0],a[0]],[o[1],a[1]]]}function M(t){return G.getTransform(t.group)}function I(t,e){if(e.length>1){e=e.split("");var i=[I(t,e[0]),I(t,e[1])];return("e"===i[0]||"w"===i[0])&&i.reverse(),i.join("")}var n={w:"left",e:"right",n:"top",s:"bottom"},o={left:"w",right:"e",top:"n",bottom:"s"},i=G.transformDirection(n[e],M(t));return o[i]}function T(t,e,i,n,o,a,r,s){var l=n.__brushOption,u=t(l.range),h=C(i,a,r);Z(o.split(""),function(t){var e=Q[t];u[e[0]][e[1]]+=h[e[0]]}),l.range=e(S(u[0][0],u[1][0],u[0][1],u[1][1])),c(i,n),g(i,{isEnd:!1})}function A(t,e,i,n,o){var a=e.__brushOption.range,r=C(t,i,n);Z(a,function(t){t[0]+=r[0],t[1]+=r[1]}),c(t,e),g(t,{isEnd:!1})}function C(t,e,i){var n=t.group,o=n.transformCoordToLocal(e,i),a=n.transformCoordToLocal(0,0);return[o[0]-a[0],o[1]-a[1]]}function L(t,e,i){var n=f(t,e);return n&&n!==!0?n.clipPath(i,t._transform):B.clone(i)}function D(t){var e=j(t[0][0],t[1][0]),i=j(t[0][1],t[1][1]),n=U(t[0][0],t[1][0]),o=U(t[0][1],t[1][1]);return{x:e,y:i,width:n-e,height:o-i}}function P(t,e,i){if(t._brushType){var n=t._zr,o=t._covers,a=d(t,e,i);if(!t._dragging)for(var r=0;r<o.length;r++){var s=o[r].__brushOption;if(a&&(a===!0||s.panelId===a.panelId)&&ot[s.brushType].contain(o[r],i[0],i[1]))return}a&&n.setCursorStyle("crosshair")}}function k(t){var e=t.event;e.preventDefault&&e.preventDefault()}function O(t,e,i){return t.childOfName("main").contain(e,i)}function z(t,e,i,n){var o,a=t._creatingCover,u=t._creatingPanel,c=t._brushOption;if(t._track.push(i.slice()),m(t)||a){if(u&&!a){"single"===c.brushMode&&p(t);var h=B.clone(c);h.brushType=E(h.brushType,u),h.panelId=u===!0?null:u.panelId,a=t._creatingCover=r(t,h),t._covers.push(a)}if(a){var f=ot[E(t._brushType,u)],g=a.__brushOption;g.range=f.getCreatingRange(L(t,a,t._track)),n&&(s(t,a),f.updateCommon(t,a)),l(t,a),o={isEnd:n}}}else n&&"single"===c.brushMode&&c.removeOnClick&&d(t,e,i)&&p(t)&&(o={isEnd:n,removeOnClick:!0});return o}function E(t,e){return"auto"===t?e.defaultBrushType:t}function R(t){if(this._dragging){k(t);var e=this.group.transformCoordToLocal(t.offsetX,t.offsetY),i=z(this,t,e,!0);this._dragging=!1,this._track=[],this._creatingCover=null,i&&g(this,i)}}function N(t){return{createCover:function(e,i){return y(W(T,function(e){var i=[e,[0,100]];return t&&i.reverse(),i},function(e){return e[t]}),e,i,[["w","e"],["n","s"]][t])},getCreatingRange:function(e){var i=v(e),n=j(i[0][t],i[1][t]),o=U(i[0][t],i[1][t]);return[n,o]},updateCoverShape:function(e,i,n,o){var a,r=f(e,i);if(r!==!0&&r.getLinearBrushOtherExtent)a=r.getLinearBrushOtherExtent(t,e._transform);else{var s=e._zr;a=[0,[s.getWidth(),s.getHeight()][1-t]]}var l=[n,a];t&&l.reverse(),x(e,i,l,o)},updateCommon:_,contain:O}}var V=i(23),B=i(1),G=i(3),H=i(129),F=i(48),W=B.curry,Z=B.each,q=B.map,j=Math.min,U=Math.max,X=Math.pow,Y=1e4,$=6,K=6,J="globalPan",Q={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},tt={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},et={brushStyle:{lineWidth:2,stroke:"rgba(0,0,0,0.3)",fill:"rgba(0,0,0,0.1)"},transformable:!0,brushMode:"single",removeOnClick:!1},it=0;n.prototype={constructor:n,enableBrush:function(t){return this._brushType&&a(this),t.brushType&&o(this,t),this},setPanels:function(t){if(t&&t.length){var e=this._panels={};B.each(t,function(t){e[t.panelId]=B.clone(t)})}else this._panels=null;return this},mount:function(t){t=t||{},this._enableGlobalPan=t.enableGlobalPan;var e=this.group;return this._zr.add(e),e.attr({position:t.position||[0,0],rotation:t.rotation||0,scale:t.scale||[1,1]}),this._transform=e.getLocalTransform(),this},eachCover:function(t,e){Z(this._covers,t,e)},updateCovers:function(t){function e(t,e){return(null!=t.id?t.id:a+e)+"-"+t.brushType}function i(t,i){return e(t.__brushOption,i)}function n(e,i){var n=t[e];if(null!=i&&l[i]===d)u[e]=l[i];else{var o=u[e]=null!=i?(l[i].__brushOption=n,l[i]):s(h,r(h,n));c(h,o)}}function o(t){l[t]!==d&&h.group.remove(l[t])}t=B.map(t,function(t){return B.merge(B.clone(et),t,!0)});var a="\0-brush-index-",l=this._covers,u=this._covers=[],h=this,d=this._creatingCover;return new F(l,t,i,e).add(n).update(n).remove(o).execute(),this},unmount:function(){return this.enableBrush(!1),p(this),this._zr.remove(this.group),this},dispose:function(){this.unmount(),this.off()}},B.mixin(n,V);var nt={mousedown:function(t){if(this._dragging)R.call(this,t);else if(!t.target||!t.target.draggable){k(t);var e=this.group.transformCoordToLocal(t.offsetX,t.offsetY);this._creatingCover=null;var i=this._creatingPanel=d(this,t,e);i&&(this._dragging=!0,this._track=[e.slice()])}},mousemove:function(t){var e=this.group.transformCoordToLocal(t.offsetX,t.offsetY);if(P(this,t,e),this._dragging){k(t);var i=z(this,t,e,!1);i&&g(this,i)}},mouseup:R},ot={lineX:N(0),lineY:N(1),rect:{createCover:function(t,e){return y(W(T,function(t){return t},function(t){return t}),t,e,["w","e","n","s","se","sw","ne","nw"])},getCreatingRange:function(t){var e=v(t);return S(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(t,e,i,n){x(t,e,i,n)},updateCommon:_,contain:O},polygon:{createCover:function(t,e){var i=new G.Group;return i.add(new G.Polyline({name:"main",style:w(e),silent:!0})),i},getCreatingRange:function(t){return t},endCreating:function(t,e){e.remove(e.childAt(0)),e.add(new G.Polygon({name:"main",draggable:!0,drift:W(A,t,e),ondragend:W(g,t,{isEnd:!0})}))},updateCoverShape:function(t,e,i,n){e.childAt(0).setShape({points:L(t,e,i)})},updateCommon:_,contain:O}};t.exports=n},function(t,e){var i={},n={axisPointer:1,tooltip:1,brush:1};i.onIrrelevantElement=function(t,e,i){var o=e.getComponentByElement(t.topTarget),a=o&&o.coordinateSystem;return o&&o!==i&&!n[o.mainType]&&a&&a.model!==i},t.exports=i},function(t,e,i){function n(t){return t[o]||(t[o]={})}var o="\0_ec_interaction_mutex",a={take:function(t,e,i){var o=n(t);o[e]=i},release:function(t,e,i){var o=n(t),a=o[e];a===i&&(o[e]=null)},isTaken:function(t,e){return!!n(t)[e]}};i(2).registerAction({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},function(){}),t.exports=a},function(t,e,i){function n(t,e,i){o.positionElement(t,e.getBoxLayoutParams(),{width:i.getWidth(),height:i.getHeight()},e.get("padding"))}var o=i(12),a=i(7),r=i(3);t.exports={layout:function(t,e,i){var a=o.getLayoutRect(e.getBoxLayoutParams(),{width:i.getWidth(),height:i.getHeight()},e.get("padding"));o.box(e.get("orient"),t,e.get("itemGap"),a.width,a.height),n(t,e,i)},addBackground:function(t,e){var i=a.normalizeCssArray(e.get("padding")),n=t.getBoundingRect(),o=e.getItemStyle(["color","opacity"]);o.fill=e.get("backgroundColor");var s=new r.Rect({shape:{x:n.x-i[3],y:n.y-i[0],width:n.width+i[1]+i[3],height:n.height+i[0]+i[2]},style:o,silent:!0,z2:-1});r.subPixelOptimizeRect(s),t.add(s)}}},function(t,e,i){var n=i(1),o=i(33),a=function(t,e,i,n,a){o.call(this,t,e,i),this.type=n||"value",this.position=a||"bottom"};a.prototype={constructor:a,index:0,onZero:!1,model:null,isHorizontal:function(){var t=this.position;return"top"===t||"bottom"===t},getGlobalExtent:function(t){var e=this.getExtent();return e[0]=this.toGlobalCoord(e[0]),e[1]=this.toGlobalCoord(e[1]),t&&e[0]>e[1]&&e.reverse(),e},getOtherAxis:function(){this.grid.getOtherAxis()},isLabelIgnored:function(t){if("category"===this.type){var e=this.getLabelInterval();return"function"==typeof e&&!e(t,this.scale.getLabel(t))||t%(e+1)}},pointToData:function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},toLocalCoord:null,toGlobalCoord:null},n.inherits(a,o),t.exports=a},function(t,e,i){"use strict";function n(t){return this._axes[t]}var o=i(1),a=function(t){this._axes={},this._dimList=[],this.name=t||""};a.prototype={constructor:a,type:"cartesian",getAxis:function(t){return this._axes[t]},getAxes:function(){return o.map(this._dimList,n,this)},getAxesByScale:function(t){return t=t.toLowerCase(),o.filter(this.getAxes(),function(e){return e.scale.type===t})},addAxis:function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},dataToCoord:function(t){return this._dataCoordConvert(t,"dataToCoord")},coordToData:function(t){return this._dataCoordConvert(t,"coordToData")},_dataCoordConvert:function(t,e){for(var i=this._dimList,n=t instanceof Array?[]:{},o=0;o<i.length;o++){var a=i[o],r=this._axes[a];n[a]=r[e](t[a])}return n}},t.exports=a},function(t,e,i){"use strict";function n(t){a.call(this,t)}var o=i(1),a=i(132);n.prototype={constructor:n,type:"cartesian2d",dimensions:["x","y"],getBaseAxis:function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},containPoint:function(t){var e=this.getAxis("x"),i=this.getAxis("y");return e.contain(e.toLocalCoord(t[0]))&&i.contain(i.toLocalCoord(t[1]))},containData:function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},dataToPoints:function(t,e){return t.mapArray(["x","y"],function(t,e){return this.dataToPoint([t,e])},e,this)},dataToPoint:function(t,e){var i=this.getAxis("x"),n=this.getAxis("y");return[i.toGlobalCoord(i.dataToCoord(t[0],e)),n.toGlobalCoord(n.dataToCoord(t[1],e))]},pointToData:function(t,e){var i=this.getAxis("x"),n=this.getAxis("y");return[i.coordToData(i.toLocalCoord(t[0]),e),n.coordToData(n.toLocalCoord(t[1]),e)]},getOtherAxis:function(t){return this.getAxis("x"===t.dim?"y":"x")}},o.inherits(n,a),t.exports=n},function(t,e,i){"use strict";i(60);var n=i(13);t.exports=n.extend({type:"grid",dependencies:["xAxis","yAxis"],layoutMode:"box",coordinateSystem:null,defaultOption:{show:!1,zlevel:0,z:0,left:"10%",top:60,right:"10%",bottom:60,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"}})},function(t,e,i){var n=i(28),o=i(24),a=i(18),r=i(42),s=i(10),l=i(1);t.exports={createList:function(t){var e=t.get("data");return n(e,t,t.ecModel)},completeDimensions:i(25),createSymbol:o.createSymbol,createScale:function(t,e){var i=e;e instanceof s||(i=new s(e),l.mixin(i,r));var n=a.createScaleByModel(i);return n.setExtent(t[0],t[1]),a.niceScaleExtent(n,i),n},mixinAxisModelCommonMethods:function(t){l.mixin(t,r)}}},function(t,e,i){var n=i(3),o=i(1),a=Math.PI;t.exports=function(t,e){e=e||{},o.defaults(e,{text:"loading",color:"#c23531",textColor:"#000",maskColor:"rgba(255, 255, 255, 0.8)",zlevel:0});var i=new n.Rect({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4}),r=new n.Arc({shape:{startAngle:-a/2,endAngle:-a/2+.1,r:10},style:{stroke:e.color,lineCap:"round",lineWidth:5},zlevel:e.zlevel,z:10001}),s=new n.Rect({style:{fill:"none",text:e.text,textPosition:"right",textDistance:10,textFill:e.textColor},zlevel:e.zlevel,z:10001});r.animateShape(!0).when(1e3,{endAngle:3*a/2}).start("circularInOut"),r.animateShape(!0).when(1e3,{startAngle:3*a/2}).delay(300).start("circularInOut");var l=new n.Group;return l.add(r),l.add(s),l.add(i),l.resize=function(){var e=t.getWidth()/2,n=t.getHeight()/2;r.setShape({cx:e,cy:n});var o=r.shape.r;s.setShape({x:e-o,y:n-o,width:2*o,height:2*o}),i.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},l.resize(),l}},function(t,e,i){function n(t,e){c.each(e,function(e,i){x.hasClass(i)||("object"==typeof e?t[i]=t[i]?c.merge(t[i],e,!1):c.clone(e):null==t[i]&&(t[i]=e))})}function o(t){t=t,this.option={},this.option[b]=1,this._componentsMap=c.createHashMap({series:[]}),this._seriesIndices=null,n(t,this._theme.option),c.merge(t,_,!1),this.mergeOption(t)}function a(t,e){c.isArray(e)||(e=e?[e]:[]);var i={};return f(e,function(e){i[e]=(t.get(e)||[]).slice()}),i}function r(t,e,i){var n=e.type?e.type:i?i.subType:x.determineSubType(t,e);return n}function s(t){return g(t,function(t){return t.componentIndex})||[]}function l(t,e){return e.hasOwnProperty("subType")?p(t,function(t){return t.subType===e.subType}):t}function u(t){}var c=i(1),h=i(5),d=i(10),f=c.each,p=c.filter,g=c.map,m=c.isArray,v=c.indexOf,y=c.isObject,x=i(13),_=i(139),b="\0_ec_inner",w=d.extend({constructor:w,init:function(t,e,i,n){i=i||{},this.option=null,this._theme=new d(i),this._optionManager=n},setOption:function(t,e){c.assert(!(b in t),"please use chart.getOption()"),this._optionManager.setOption(t,e),this.resetOption(null)},resetOption:function(t){var e=!1,i=this._optionManager;if(!t||"recreate"===t){var n=i.mountOption("recreate"===t);this.option&&"recreate"!==t?(this.restoreData(),this.mergeOption(n)):o.call(this,n),e=!0}if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var a=i.getTimelineOption(this);a&&(this.mergeOption(a),e=!0)}if(!t||"recreate"===t||"media"===t){var r=i.getMediaOption(this,this._api);r.length&&f(r,function(t){this.mergeOption(t,e=!0)},this)}return e},mergeOption:function(t){function e(e,o){var l=h.normalizeToArray(t[e]),u=h.mappingToExists(n.get(e),l);h.makeIdAndName(u),f(u,function(t,i){var n=t.option;y(n)&&(t.keyInfo.mainType=e,t.keyInfo.subType=r(e,n,t.exist))});var d=a(n,o);i[e]=[],n.set(e,[]),f(u,function(t,o){var a=t.exist,r=t.option;if(c.assert(y(r)||a,"Empty component definition"),r){var s=x.getClass(e,t.keyInfo.subType,!0);if(a&&a instanceof s)a.name=t.keyInfo.name,a.mergeOption(r,this),a.optionUpdated(r,!1);else{var l=c.extend({dependentModels:d,componentIndex:o},t.keyInfo);a=new s(r,this,this,l),c.extend(a,l),a.init(r,this,this,l),a.optionUpdated(null,!0)}}else a.mergeOption({},this),a.optionUpdated({},!1);n.get(e)[o]=a,i[e][o]=a.option},this),"series"===e&&(this._seriesIndices=s(n.get("series")))}var i=this.option,n=this._componentsMap,o=[];f(t,function(t,e){null!=t&&(x.hasClass(e)?o.push(e):i[e]=null==i[e]?c.clone(t):c.merge(i[e],t,!0))}),x.topologicalTravel(o,x.getAllClassMainTypes(),e,this),this._seriesIndices=this._seriesIndices||[]},getOption:function(){var t=c.clone(this.option);return f(t,function(e,i){if(x.hasClass(i)){for(var e=h.normalizeToArray(e),n=e.length-1;n>=0;n--)h.isIdInner(e[n])&&e.splice(n,1);t[i]=e}}),delete t[b],t},getTheme:function(){return this._theme},getComponent:function(t,e){var i=this._componentsMap.get(t);if(i)return i[e||0]},queryComponents:function(t){var e=t.mainType;if(!e)return[];var i=t.index,n=t.id,o=t.name,a=this._componentsMap.get(e);if(!a||!a.length)return[];var r;if(null!=i)m(i)||(i=[i]),r=p(g(i,function(t){return a[t]}),function(t){return!!t});else if(null!=n){var s=m(n);r=p(a,function(t){return s&&v(n,t.id)>=0||!s&&t.id===n})}else if(null!=o){var u=m(o);r=p(a,function(t){return u&&v(o,t.name)>=0||!u&&t.name===o})}else r=a.slice();return l(r,t)},findComponents:function(t){function e(t){var e=o+"Index",i=o+"Id",n=o+"Name";return!t||null==t[e]&&null==t[i]&&null==t[n]?null:{mainType:o,index:t[e],id:t[i],name:t[n]}}function i(e){return t.filter?p(e,t.filter):e}var n=t.query,o=t.mainType,a=e(n),r=a?this.queryComponents(a):this._componentsMap.get(o);return i(l(r,t))},eachComponent:function(t,e,i){var n=this._componentsMap;if("function"==typeof t)i=e,e=t,n.each(function(t,n){f(t,function(t,o){e.call(i,n,t,o)})});else if(c.isString(t))f(n.get(t),e,i);else if(y(t)){var o=this.findComponents(t);f(o,e,i)}},getSeriesByName:function(t){var e=this._componentsMap.get("series");return p(e,function(e){return e.name===t})},getSeriesByIndex:function(t){return this._componentsMap.get("series")[t]},getSeriesByType:function(t){var e=this._componentsMap.get("series");return p(e,function(e){return e.subType===t})},getSeries:function(){return this._componentsMap.get("series").slice()},eachSeries:function(t,e){u(this),f(this._seriesIndices,function(i){var n=this._componentsMap.get("series")[i];t.call(e,n,i)},this)},eachRawSeries:function(t,e){f(this._componentsMap.get("series"),t,e)},eachSeriesByType:function(t,e,i){u(this),f(this._seriesIndices,function(n){var o=this._componentsMap.get("series")[n];o.subType===t&&e.call(i,o,n)},this)},eachRawSeriesByType:function(t,e,i){return f(this.getSeriesByType(t),e,i)},isSeriesFiltered:function(t){return u(this),c.indexOf(this._seriesIndices,t.componentIndex)<0},getCurrentSeriesIndices:function(){return(this._seriesIndices||[]).slice()},filterSeries:function(t,e){u(this);var i=p(this._componentsMap.get("series"),t,e);this._seriesIndices=s(i)},restoreData:function(){var t=this._componentsMap;this._seriesIndices=s(t.get("series"));var e=[];t.each(function(t,i){e.push(i)}),x.topologicalTravel(e,x.getAllClassMainTypes(),function(e,i){f(t.get(e),function(t){t.restoreData()})})}});c.mixin(w,i(62)),t.exports=w},function(t,e,i){function n(t){this._api=t,this._timelineOptions=[],this._mediaList=[],this._mediaDefault,this._currentMediaIndices=[],this._optionBackup,this._newBaseOption}function o(t,e,i){var n,o,a=[],r=[],s=t.timeline;if(t.baseOption&&(o=t.baseOption),(s||t.options)&&(o=o||{},a=(t.options||[]).slice()),t.media){o=o||{};var l=t.media;d(l,function(t){t&&t.option&&(t.query?r.push(t):n||(n=t))})}return o||(o=t),o.timeline||(o.timeline=s),d([o].concat(a).concat(u.map(r,function(t){return t.option})),function(t){d(e,function(e){e(t,i)})}),{baseOption:o,timelineOptions:a,mediaDefault:n,mediaList:r}}function a(t,e,i){var n={width:e,height:i,aspectratio:e/i},o=!0;return u.each(t,function(t,e){var i=e.match(m);if(i&&i[1]&&i[2]){var a=i[1],s=i[2].toLowerCase();r(n[s],t,a)||(o=!1)}}),o}function r(t,e,i){return"min"===i?t>=e:"max"===i?t<=e:t===e}function s(t,e){return t.join(",")===e.join(",")}function l(t,e){e=e||{},d(e,function(e,i){if(null!=e){var n=t[i];if(h.hasClass(i)){e=c.normalizeToArray(e),n=c.normalizeToArray(n);var o=c.mappingToExists(n,e);t[i]=p(o,function(t){return t.option&&t.exist?g(t.exist,t.option,!0):t.exist||t.option})}else t[i]=g(n,e,!0)}})}var u=i(1),c=i(5),h=i(13),d=u.each,f=u.clone,p=u.map,g=u.merge,m=/^(min|max)?(.+)$/;n.prototype={constructor:n,setOption:function(t,e){t=f(t,!0);var i=this._optionBackup,n=o.call(this,t,e,!i);this._newBaseOption=n.baseOption,i?(l(i.baseOption,n.baseOption),n.timelineOptions.length&&(i.timelineOptions=n.timelineOptions),n.mediaList.length&&(i.mediaList=n.mediaList),n.mediaDefault&&(i.mediaDefault=n.mediaDefault)):this._optionBackup=n},mountOption:function(t){var e=this._optionBackup;return this._timelineOptions=p(e.timelineOptions,f),this._mediaList=p(e.mediaList,f),this._mediaDefault=f(e.mediaDefault),this._currentMediaIndices=[],f(t?e.baseOption:this._newBaseOption)},getTimelineOption:function(t){var e,i=this._timelineOptions;if(i.length){var n=t.getComponent("timeline");n&&(e=f(i[n.getCurrentIndex()],!0))}return e},getMediaOption:function(t){var e=this._api.getWidth(),i=this._api.getHeight(),n=this._mediaList,o=this._mediaDefault,r=[],l=[];if(!n.length&&!o)return l;for(var u=0,c=n.length;u<c;u++)a(n[u].query,e,i)&&r.push(u);return!r.length&&o&&(r=[-1]),r.length&&!s(r,this._currentMediaIndices)&&(l=p(r,function(t){return f(t===-1?o.option:n[t].option)})),this._currentMediaIndices=r,l}},t.exports=n},function(t,e){var i="";"undefined"!=typeof navigator&&(i=navigator.platform||""),t.exports={color:["#c23531","#2f4554","#61a0a8","#d48265","#91c7ae","#749f83","#ca8622","#bda29a","#6e7074","#546570","#c4ccd3"],textStyle:{fontFamily:i.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,animation:"auto",animationDuration:1e3,animationDurationUpdate:300,animationEasing:"exponentialOut",animationEasingUpdate:"cubicOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1}},function(t,e,i){t.exports={getAreaStyle:i(31)([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]])}},function(t,e){t.exports={getBoxLayoutParams:function(){return{left:this.get("left"),top:this.get("top"),right:this.get("right"),bottom:this.get("bottom"),width:this.get("width"),height:this.get("height")}}}},function(t,e,i){var n=i(31)([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["textPosition"],["textAlign"]]);t.exports={getItemStyle:function(t,e){var i=n.call(this,t,e),o=this.getBorderLineDash();return o&&(i.lineDash=o),i},getBorderLineDash:function(){var t=this.get("borderType");return"solid"===t||null==t?null:"dashed"===t?[5,5]:[1,1]}}},function(t,e,i){var n=i(31)([["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]);t.exports={getLineStyle:function(t){var e=n.call(this,t),i=this.getLineDash(e.lineWidth);return i&&(e.lineDash=i),e},getLineDash:function(t){null==t&&(t=1);var e=this.get("type"),i=Math.max(t,2),n=4*t;return"solid"===e||null==e?null:"dashed"===e?[n,n]:[i,i]}}},function(t,e,i){var n=i(16),o=i(3);t.exports={getTextColor:function(){var t=this.ecModel;return this.getShallow("color")||t&&t.get("textStyle.color")},getFont:function(){return o.getFont({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},getTextRect:function(t){return n.getBoundingRect(t,this.getFont(),this.getShallow("align"),this.getShallow("baseline"))},truncateText:function(t,e,i,o){return n.truncateText(t,e,this.getFont(),i,o)}}},function(t,e,i){function n(t,e){e=e.split(",");for(var i=t,n=0;n<e.length&&(i=i&&i[e[n]],null!=i);n++);return i}function o(t,e,i,n){e=e.split(",");for(var o,a=t,r=0;r<e.length-1;r++)o=e[r],null==a[o]&&(a[o]={}),a=a[o];(n||null==a[e[r]])&&(a[e[r]]=i)}function a(t){h(l,function(e){e[0]in t&&!(e[1]in t)&&(t[e[1]]=t[e[0]])})}var r=i(1),s=i(146),l=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],u=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],c=["bar","boxplot","candlestick","chord","effectScatter","funnel","gauge","lines","graph","heatmap","line","map","parallel","pie","radar","sankey","scatter","treemap"],h=r.each;t.exports=function(t){h(t.series,function(t){if(r.isObject(t)){var e=t.type;if(s(t),"pie"!==e&&"gauge"!==e||null!=t.clockWise&&(t.clockwise=t.clockWise),"gauge"===e){var i=n(t,"pointer.color");null!=i&&o(t,"itemStyle.normal.color",i)}for(var l=0;l<c.length;l++)if(c[l]===t.type){a(t);break}}}),t.dataRange&&(t.visualMap=t.dataRange),h(u,function(e){var i=t[e];i&&(r.isArray(i)||(i=[i]),h(i,function(t){a(t)}))})}},function(t,e,i){function n(t){var e=t&&t.itemStyle;e&&o.each(a,function(i){var n=e.normal,a=e.emphasis;n&&n[i]&&(t[i]=t[i]||{},t[i].normal?o.merge(t[i].normal,n[i]):t[i].normal=n[i],n[i]=null),a&&a[i]&&(t[i]=t[i]||{},t[i].emphasis?o.merge(t[i].emphasis,a[i]):t[i].emphasis=a[i],a[i]=null)})}var o=i(1),a=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];t.exports=function(t){if(t){n(t),n(t.markPoint),n(t.markLine);var e=t.data;if(e){for(var i=0;i<e.length;i++)n(e[i]);var a=t.markPoint;if(a&&a.data)for(var r=a.data,i=0;i<r.length;i++)n(r[i]);var s=t.markLine;if(s&&s.data)for(var l=s.data,i=0;i<l.length;i++)o.isArray(l[i])?(n(l[i][0]),n(l[i][1])):n(l[i])}}}},function(t,e){var i={average:function(t){for(var e=0,i=0,n=0;n<t.length;n++)isNaN(t[n])||(e+=t[n],i++);return 0===i?NaN:e/i},sum:function(t){for(var e=0,i=0;i<t.length;i++)e+=t[i]||0;return e},max:function(t){for(var e=-(1/0),i=0;i<t.length;i++)t[i]>e&&(e=t[i]);return e},min:function(t){for(var e=1/0,i=0;i<t.length;i++)t[i]<e&&(e=t[i]);return e},nearest:function(t){return t[0]}},n=function(t,e){return Math.round(t.length/2)};t.exports=function(t,e,o){e.eachSeriesByType(t,function(t){var e=t.getData(),o=t.get("sampling"),a=t.coordinateSystem;if("cartesian2d"===a.type&&o){var r=a.getBaseAxis(),s=a.getOtherAxis(r),l=r.getExtent(),u=l[1]-l[0],c=Math.round(e.count()/u);if(c>1){var h;"string"==typeof o?h=i[o]:"function"==typeof o&&(h=o),h&&(e=e.downSample(s.dim,1/c,h,n),t.setData(e))}}},this)}},function(t,e,i){function n(t,e){return h(t,c(e))}var o=i(1),a=i(34),r=i(4),s=i(43),l=a.prototype,u=s.prototype,c=r.getPrecisionSafe,h=r.round,d=Math.floor,f=Math.ceil,p=Math.pow,g=Math.log,m=a.extend({type:"log",base:10,$constructor:function(){a.apply(this,arguments),this._originalScale=new s},getTicks:function(){var t=this._originalScale,e=this._extent,i=t.getExtent();return o.map(u.getTicks.call(this),function(o){var a=r.round(p(this.base,o));return a=o===e[0]&&t.__fixMin?n(a,i[0]):a,a=o===e[1]&&t.__fixMax?n(a,i[1]):a},this)},getLabel:u.getLabel,scale:function(t){return t=l.scale.call(this,t),p(this.base,t)},setExtent:function(t,e){var i=this.base;t=g(t)/g(i),e=g(e)/g(i),u.setExtent.call(this,t,e)},getExtent:function(){var t=this.base,e=l.getExtent.call(this);e[0]=p(t,e[0]),e[1]=p(t,e[1]);var i=this._originalScale,o=i.getExtent();return i.__fixMin&&(e[0]=n(e[0],o[0])),i.__fixMax&&(e[1]=n(e[1],o[1])),e},unionExtent:function(t){this._originalScale.unionExtent(t);var e=this.base;t[0]=g(t[0])/g(e),t[1]=g(t[1])/g(e),l.unionExtent.call(this,t)},unionExtentFromData:function(t,e){this.unionExtent(t.getDataExtent(e,!0,function(t){return t>0}))},niceTicks:function(t){t=t||10;var e=this._extent,i=e[1]-e[0];if(!(i===1/0||i<=0)){var n=r.quantity(i),o=t/i*n;for(o<=.5&&(n*=10);!isNaN(n)&&Math.abs(n)<1&&Math.abs(n)>0;)n*=10;var a=[r.round(f(e[0]/n)*n),r.round(d(e[1]/n)*n)];this._interval=n,this._niceExtent=a}},niceExtent:function(t){u.niceExtent.call(this,t);var e=this._originalScale;e.__fixMin=t.fixMin,e.__fixMax=t.fixMax}});o.each(["contain","normalize"],function(t){m.prototype[t]=function(e){return e=g(e)/g(this.base),l[t].call(this,e)}}),m.create=function(){return new m},t.exports=m},function(t,e,i){var n=i(1),o=i(34),a=o.prototype,r=o.extend({type:"ordinal",init:function(t,e){this._data=t,this._extent=e||[0,t.length-1]},parse:function(t){return"string"==typeof t?n.indexOf(this._data,t):Math.round(t)},contain:function(t){return t=this.parse(t),a.contain.call(this,t)&&null!=this._data[t]},normalize:function(t){return a.normalize.call(this,this.parse(t))},scale:function(t){return Math.round(a.scale.call(this,t))},getTicks:function(){for(var t=[],e=this._extent,i=e[0];i<=e[1];)t.push(i),i++;return t},getLabel:function(t){return this._data[t]},count:function(){return this._extent[1]-this._extent[0]+1},unionExtentFromData:function(t,e){this.unionExtent(t.getDataExtent(e,!1))},niceTicks:n.noop,niceExtent:n.noop});r.create=function(){return new r},t.exports=r},function(t,e,i){var n=i(1),o=i(4),a=i(7),r=i(64),s=i(43),l=s.prototype,u=Math.ceil,c=Math.floor,h=1e3,d=60*h,f=60*d,p=24*f,g=function(t,e,i,n){for(;i<n;){var o=i+n>>>1;t[o][2]<e?i=o+1:n=o}return i},m=s.extend({type:"time",getLabel:function(t){var e=this._stepLvl,i=new Date(t);return a.formatTime(e[0],i,this.getSetting("useUTC"))},niceExtent:function(t){var e=this._extent;if(e[0]===e[1]&&(e[0]-=p,e[1]+=p),e[1]===-(1/0)&&e[0]===1/0){var i=new Date;e[1]=new Date(i.getFullYear(),i.getMonth(),i.getDate()),e[0]=e[1]-p}this.niceTicks(t.splitNumber);var n=this._interval;t.fixMin||(e[0]=o.round(c(e[0]/n)*n)),t.fixMax||(e[1]=o.round(u(e[1]/n)*n))},niceTicks:function(t){var e=this.getSetting("useUTC")?0:60*o.getTimezoneOffset()*1e3;t=t||10;var i=this._extent,n=i[1]-i[0],a=n/t,s=v.length,l=g(v,a,0,s),h=v[Math.min(l,s-1)],d=h[2];if("year"===h[0]){var f=n/d,p=o.nice(f/t,!0);d*=p}var m=[Math.round(u((i[0]-e)/d)*d+e),Math.round(c((i[1]-e)/d)*d+e)];r.fixExtent(m,i),this._stepLvl=h,this._interval=d,this._niceExtent=m},parse:function(t){return+o.parseDate(t)}});n.each(["contain","normalize"],function(t){m.prototype[t]=function(e){return l[t].call(this,this.parse(e))}});var v=[["hh:mm:ss",1,h],["hh:mm:ss",5,5*h],["hh:mm:ss",10,10*h],["hh:mm:ss",15,15*h],["hh:mm:ss",30,30*h],["hh:mm\nMM-dd",1,d],["hh:mm\nMM-dd",5,5*d],["hh:mm\nMM-dd",10,10*d],["hh:mm\nMM-dd",15,15*d],["hh:mm\nMM-dd",30,30*d],["hh:mm\nMM-dd",1,f],["hh:mm\nMM-dd",2,2*f],["hh:mm\nMM-dd",6,6*f],["hh:mm\nMM-dd",12,12*f],["MM-dd\nyyyy",1,p],["week",7,7*p],["month",1,31*p],["quarter",3,380*p/4],["half-year",6,380*p/2],["year",1,380*p]];m.create=function(t){return new m({useUTC:t.ecModel.get("useUTC")})},t.exports=m},function(t,e,i){var n=i(39);t.exports=function(t){function e(e){var i=(e.visualColorAccessPath||"itemStyle.normal.color").split("."),o=e.getData(),a=e.get(i)||e.getColorFromPalette(e.get("name"));o.setVisual("color",a),t.isSeriesFiltered(e)||("function"!=typeof a||a instanceof n||o.each(function(t){o.setItemVisual(t,"color",a(e.getDataParams(t)))}),o.each(function(t){var e=o.getItemModel(t),n=e.get(i,!0);null!=n&&o.setItemVisual(t,"color",n)}))}t.eachRawSeries(e)}},function(t,e,i){"use strict";function n(t,e,i){return{type:t,event:i,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:i.zrX,offsetY:i.zrY,gestureEvent:i.gestureEvent,pinchX:i.pinchX,pinchY:i.pinchY,pinchScale:i.pinchScale,wheelDelta:i.zrDelta,zrByTouch:i.zrByTouch}}function o(){}function a(t,e,i){if(t[t.rectHover?"rectContain":"contain"](e,i)){for(var n,o=t;o;){if(o.clipPath&&!o.clipPath.contain(e,i))return!1;o.silent&&(n=!0),o=o.parent}return!n||u}return!1}var r=i(1),s=i(179),l=i(23),u="silent";o.prototype.dispose=function(){};var c=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],h=function(t,e,i,n){l.call(this),this.storage=t,this.painter=e,this.painterRoot=n,i=i||new o,this.proxy=i,i.handler=this,this._hovered={},this._lastTouchMoment,this._lastX,this._lastY,s.call(this),r.each(c,function(t){i.on&&i.on(t,this[t],this)},this)};h.prototype={constructor:h,mousemove:function(t){var e=t.zrX,i=t.zrY,n=this._hovered,o=this._hovered=this.findHover(e,i),a=o.target,r=n.target,s=this.proxy;s.setCursor&&s.setCursor(a?a.cursor:"default"),r&&a!==r&&r.__zr&&this.dispatchToElement(n,"mouseout",t),this.dispatchToElement(o,"mousemove",t),a&&a!==r&&this.dispatchToElement(o,"mouseover",t)},mouseout:function(t){this.dispatchToElement(this._hovered,"mouseout",t);var e,i=t.toElement||t.relatedTarget;do{i=i&&i.parentNode}while(i&&9!=i.nodeType&&!(e=i===this.painterRoot));!e&&this.trigger("globalout",{event:t})},resize:function(t){this._hovered={}},dispatch:function(t,e){var i=this[t];i&&i.call(this,e)},dispose:function(){this.proxy.dispose(),this.storage=this.proxy=this.painter=null},setCursorStyle:function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},dispatchToElement:function(t,e,i){t=t||{};for(var o="on"+e,a=n(e,t,i),r=t.target;r&&(r[o]&&(a.cancelBubble=r[o].call(r,a)),r.trigger(e,a),r=r.parent,!a.cancelBubble););a.cancelBubble||(this.trigger(e,a),this.painter&&this.painter.eachOtherLayer(function(t){"function"==typeof t[o]&&t[o].call(t,a),t.trigger&&t.trigger(e,a)}))},findHover:function(t,e,i){for(var n=this.storage.getDisplayList(),o={},r=n.length-1;r>=0;r--){var s;if(n[r]!==i&&!n[r].ignore&&(s=a(n[r],t,e))&&(!o.topTarget&&(o.topTarget=n[r]),s!==u)){o.target=n[r];break}}return o}},r.each(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){h.prototype[t]=function(e){var i=this.findHover(e.zrX,e.zrY),n=i.target;if("mousedown"===t)this._downel=n,this._upel=n;else if("mosueup"===t)this._upel=n;else if("click"===t&&this._downel!==this._upel)return;this.dispatchToElement(i,t,e)}}),r.mixin(h,l),r.mixin(h,s),t.exports=h},function(t,e,i){function n(){return!1}function o(t,e,i,n){var o=document.createElement(e),a=i.getWidth(),r=i.getHeight(),s=o.style;return s.position="absolute",s.left=0,s.top=0,s.width=a+"px",s.height=r+"px",o.width=a*n,o.height=r*n,o.setAttribute("data-zr-dom-id",t),o}var a=i(1),r=i(35),s=i(73),l=i(72),u=function(t,e,i){var s;i=i||r.devicePixelRatio,"string"==typeof t?s=o(t,"canvas",e,i):a.isObject(t)&&(s=t,t=s.id),this.id=t,this.dom=s;var l=s.style;l&&(s.onselectstart=n,l["-webkit-user-select"]="none",l["user-select"]="none",l["-webkit-touch-callout"]="none",l["-webkit-tap-highlight-color"]="rgba(0,0,0,0)",l.padding=0,l.margin=0,l["border-width"]=0),this.domBack=null,this.ctxBack=null,this.painter=e,this.config=null,this.clearColor=0,this.motionBlur=!1,this.lastFrameAlpha=.7,this.dpr=i};u.prototype={constructor:u,elCount:0,__dirty:!0,initContext:function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},createBackBuffer:function(){var t=this.dpr;this.domBack=o("back-"+this.id,"canvas",this.painter,t),this.ctxBack=this.domBack.getContext("2d"),1!=t&&this.ctxBack.scale(t,t)},resize:function(t,e){var i=this.dpr,n=this.dom,o=n.style,a=this.domBack;o.width=t+"px",o.height=e+"px",n.width=t*i,n.height=e*i,a&&(a.width=t*i,a.height=e*i,1!=i&&this.ctxBack.scale(i,i))},clear:function(t){var e=this.dom,i=this.ctx,n=e.width,o=e.height,a=this.clearColor,r=this.motionBlur&&!t,u=this.lastFrameAlpha,c=this.dpr;if(r&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(e,0,0,n/c,o/c)),i.clearRect(0,0,n,o),a){var h;a.colorStops?(h=a.__canvasGradient||s.getGradient(i,a,{x:0,y:0,width:n,height:o}),a.__canvasGradient=h):a.image&&(h=l.prototype.getCanvasPattern.call(a,i)),i.save(),i.fillStyle=h||a,i.fillRect(0,0,n,o),i.restore()}if(r){var d=this.domBack;i.save(),i.globalAlpha=u,i.drawImage(d,0,0,n,o),i.restore()}}},t.exports=u},function(t,e,i){"use strict";function n(t){return parseInt(t,10)}function o(t){return!!t&&(!!t.__builtin__||"function"==typeof t.resize&&"function"==typeof t.refresh)}function a(t){t.__unusedCount++}function r(t){1==t.__unusedCount&&t.clear()}function s(t,e,i){return x.copy(t.getBoundingRect()),t.transform&&x.applyTransform(t.transform),_.width=e,_.height=i,!x.intersect(_)}function l(t,e){if(t==e)return!1;if(!t||!e||t.length!==e.length)return!0;for(var i=0;i<t.length;i++)if(t[i]!==e[i])return!0}function u(t,e){for(var i=0;i<t.length;i++){var n=t[i];n.setTransform(e),e.beginPath(),n.buildPath(e,n.shape),e.clip(),n.restoreTransform(e)}}function c(t,e){var i=document.createElement("div");return i.style.cssText=["position:relative","overflow:hidden","width:"+t+"px","height:"+e+"px","padding:0","margin:0","border-width:0"].join(";")+";",i}var h=i(35),d=i(1),f=i(52),p=i(11),g=i(51),m=i(153),v=i(68),y=5,x=new p(0,0,0,0),_=new p(0,0,0,0),b=function(t,e,i){var n=!t.nodeName||"CANVAS"===t.nodeName.toUpperCase();this._opts=i=d.extend({},i||{}),this.dpr=i.devicePixelRatio||h.devicePixelRatio,this._singleCanvas=n,this.root=t;var o=t.style;o&&(o["-webkit-tap-highlight-color"]="transparent",o["-webkit-user-select"]=o["user-select"]=o["-webkit-touch-callout"]="none",t.innerHTML=""),this.storage=e;var a=this._zlevelList=[],r=this._layers={};if(this._layerConfig={},n){null!=i.width&&(t.width=i.width),null!=i.height&&(t.height=i.height);var s=t.width,l=t.height;this._width=s,this._height=l;var u=new m(t,this,1);u.initContext(),r[0]=u,a.push(0),this._domRoot=t}else{this._width=this._getSize(0),this._height=this._getSize(1);var f=this._domRoot=c(this._width,this._height);t.appendChild(f)}this._progressiveLayers=[],this._hoverlayer,this._hoverElements=[]};b.prototype={constructor:b,isSingleCanvas:function(){return this._singleCanvas},getViewportRoot:function(){return this._domRoot},refresh:function(t){var e=this.storage.getDisplayList(!0),i=this._zlevelList;this._paintList(e,t);for(var n=0;n<i.length;n++){var o=i[n],a=this._layers[o];!a.__builtin__&&a.refresh&&a.refresh()}return this.refreshHover(),this._progressiveLayers.length&&this._startProgessive(),this},addHover:function(t,e){if(!t.__hoverMir){var i=new t.constructor({style:t.style,shape:t.shape});i.__from=t,t.__hoverMir=i,i.setStyle(e),this._hoverElements.push(i)}},removeHover:function(t){var e=t.__hoverMir,i=this._hoverElements,n=d.indexOf(i,e);n>=0&&i.splice(n,1),t.__hoverMir=null},clearHover:function(t){for(var e=this._hoverElements,i=0;i<e.length;i++){var n=e[i].__from;n&&(n.__hoverMir=null)}e.length=0},refreshHover:function(){var t=this._hoverElements,e=t.length,i=this._hoverlayer;if(i&&i.clear(),e){g(t,this.storage.displayableSortFunc),i||(i=this._hoverlayer=this.getLayer(1e5));var n={};i.ctx.save();for(var o=0;o<e;){var a=t[o],r=a.__from;r&&r.__zr?(o++,r.invisible||(a.transform=r.transform,a.invTransform=r.invTransform,a.__clipPaths=r.__clipPaths,this._doPaintEl(a,i,!0,n))):(t.splice(o,1),r.__hoverMir=null,e--)}i.ctx.restore()}},_startProgessive:function(){function t(){i===e._progressiveToken&&e.storage&&(e._doPaintList(e.storage.getDisplayList()),e._furtherProgressive?(e._progress++,v(t)):e._progressiveToken=-1)}var e=this;if(e._furtherProgressive){var i=e._progressiveToken=+new Date;e._progress++,v(t)}},_clearProgressive:function(){this._progressiveToken=-1,this._progress=0,d.each(this._progressiveLayers,function(t){t.__dirty&&t.clear()})},_paintList:function(t,e){null==e&&(e=!1),this._updateLayerStatus(t),this._clearProgressive(),this.eachBuiltinLayer(a),this._doPaintList(t,e),this.eachBuiltinLayer(r)},_doPaintList:function(t,e){function i(t){var e=a.dpr||1;a.save(),a.globalAlpha=1,a.shadowBlur=0,n.__dirty=!0,a.setTransform(1,0,0,1,0,0),a.drawImage(t.dom,0,0,c*e,h*e),a.restore()}for(var n,o,a,r,s,l,u=0,c=this._width,h=this._height,p=this._progress,g=0,m=t.length;g<m;g++){var v=t[g],x=this._singleCanvas?0:v.zlevel,_=v.__frame;if(_<0&&s&&(i(s),s=null),o!==x&&(a&&a.restore(),r={},o=x,n=this.getLayer(o),n.__builtin__||f("ZLevel "+o+" has been used by unkown layer "+n.id),a=n.ctx,a.save(),n.__unusedCount=0,(n.__dirty||e)&&n.clear()),n.__dirty||e){if(_>=0){if(!s){if(s=this._progressiveLayers[Math.min(u++,y-1)],s.ctx.save(),s.renderScope={},s&&s.__progress>s.__maxProgress){g=s.__nextIdxNotProg-1;continue}l=s.__progress,s.__dirty||(p=l),s.__progress=p+1}_===p&&this._doPaintEl(v,s,!0,s.renderScope)}else this._doPaintEl(v,n,e,r);v.__dirty=!1}}s&&i(s),a&&a.restore(),this._furtherProgressive=!1,d.each(this._progressiveLayers,function(t){t.__maxProgress>=t.__progress&&(this._furtherProgressive=!0)},this)},_doPaintEl:function(t,e,i,n){var o=e.ctx,a=t.transform;if((e.__dirty||i)&&!t.invisible&&0!==t.style.opacity&&(!a||a[0]||a[3])&&(!t.culling||!s(t,this._width,this._height))){var r=t.__clipPaths;(n.prevClipLayer!==e||l(r,n.prevElClipPaths))&&(n.prevElClipPaths&&(n.prevClipLayer.ctx.restore(),n.prevClipLayer=n.prevElClipPaths=null,n.prevEl=null),r&&(o.save(),u(r,o),n.prevClipLayer=e,n.prevElClipPaths=r)),t.beforeBrush&&t.beforeBrush(o),t.brush(o,n.prevEl||null),n.prevEl=t,t.afterBrush&&t.afterBrush(o)}},getLayer:function(t){if(this._singleCanvas)return this._layers[0];var e=this._layers[t];return e||(e=new m("zr_"+t,this,this.dpr),e.__builtin__=!0,this._layerConfig[t]&&d.merge(e,this._layerConfig[t],!0),this.insertLayer(t,e),e.initContext()),e},insertLayer:function(t,e){var i=this._layers,n=this._zlevelList,a=n.length,r=null,s=-1,l=this._domRoot;if(i[t])return void f("ZLevel "+t+" has been used already");if(!o(e))return void f("Layer of zlevel "+t+" is not valid");if(a>0&&t>n[0]){for(s=0;s<a-1&&!(n[s]<t&&n[s+1]>t);s++);r=i[n[s]]}if(n.splice(s+1,0,t),i[t]=e,!e.virtual)if(r){var u=r.dom;u.nextSibling?l.insertBefore(e.dom,u.nextSibling):l.appendChild(e.dom)}else l.firstChild?l.insertBefore(e.dom,l.firstChild):l.appendChild(e.dom)},eachLayer:function(t,e){var i,n,o=this._zlevelList;for(n=0;n<o.length;n++)i=o[n],t.call(e,this._layers[i],i)},eachBuiltinLayer:function(t,e){var i,n,o,a=this._zlevelList;for(o=0;o<a.length;o++)n=a[o],i=this._layers[n],i.__builtin__&&t.call(e,i,n)},eachOtherLayer:function(t,e){var i,n,o,a=this._zlevelList;for(o=0;o<a.length;o++)n=a[o],i=this._layers[n],i.__builtin__||t.call(e,i,n)},getLayers:function(){return this._layers},_updateLayerStatus:function(t){var e=this._layers,i=this._progressiveLayers,n={},o={};this.eachBuiltinLayer(function(t,e){n[e]=t.elCount,t.elCount=0,t.__dirty=!1}),d.each(i,function(t,e){o[e]=t.elCount,t.elCount=0,t.__dirty=!1});for(var a,r,s=0,l=0,u=0,c=t.length;u<c;u++){var h=t[u],f=this._singleCanvas?0:h.zlevel,p=e[f],g=h.progressive;if(p&&(p.elCount++,p.__dirty=p.__dirty||h.__dirty),g>=0){r!==g&&(r=g,l++);var v=h.__frame=l-1;if(!a){var x=Math.min(s,y-1);a=i[x],a||(a=i[x]=new m("progressive",this,this.dpr),a.initContext()),a.__maxProgress=0}a.__dirty=a.__dirty||h.__dirty,a.elCount++,a.__maxProgress=Math.max(a.__maxProgress,v),a.__maxProgress>=a.__progress&&(p.__dirty=!0)}else h.__frame=-1,a&&(a.__nextIdxNotProg=u,s++,a=null)}a&&(s++,a.__nextIdxNotProg=u),this.eachBuiltinLayer(function(t,e){n[e]!==t.elCount&&(t.__dirty=!0)}),i.length=Math.min(s,y),d.each(i,function(t,e){o[e]!==t.elCount&&(h.__dirty=!0),t.__dirty&&(t.__progress=0)})},clear:function(){return this.eachBuiltinLayer(this._clearLayer),this},_clearLayer:function(t){t.clear()},configLayer:function(t,e){if(e){var i=this._layerConfig;i[t]?d.merge(i[t],e,!0):i[t]=e;var n=this._layers[t];n&&d.merge(n,i[t],!0)}},delLayer:function(t){var e=this._layers,i=this._zlevelList,n=e[t];n&&(n.dom.parentNode.removeChild(n.dom),delete e[t],i.splice(d.indexOf(i,t),1))},resize:function(t,e){var i=this._domRoot;i.style.display="none";var n=this._opts;if(null!=t&&(n.width=t),null!=e&&(n.height=e),t=this._getSize(0),e=this._getSize(1),i.style.display="",this._width!=t||e!=this._height){i.style.width=t+"px",i.style.height=e+"px";for(var o in this._layers)this._layers.hasOwnProperty(o)&&this._layers[o].resize(t,e);d.each(this._progressiveLayers,function(i){i.resize(t,e)}),this.refresh(!0)}return this._width=t,this._height=e,this},clearLayer:function(t){var e=this._layers[t];e&&e.clear()},dispose:function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},getRenderedCanvas:function(t){function e(t,e){var n=r._zlevelList;null==t&&(t=-(1/0));for(var o,a=0;a<n.length;a++){var s=n[a],l=r._layers[s];if(!l.__builtin__&&s>t&&s<e){o=l;break}}o&&o.renderToCanvas&&(i.ctx.save(),o.renderToCanvas(i.ctx),i.ctx.restore())}if(t=t||{},this._singleCanvas)return this._layers[0].dom;var i=new m("image",this,t.pixelRatio||this.dpr);i.initContext(),i.clearColor=t.backgroundColor,i.clear();for(var n,o=this.storage.getDisplayList(!0),a={},r=this,s=0;s<o.length;s++){var l=o[s];l.zlevel!==n&&(e(n,l.zlevel),n=l.zlevel),this._doPaintEl(l,i,!0,a)}return e(n,1/0),i.dom},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(t){var e=this._opts,i=["width","height"][t],o=["clientWidth","clientHeight"][t],a=["paddingLeft","paddingTop"][t],r=["paddingRight","paddingBottom"][t];if(null!=e[i]&&"auto"!==e[i])return parseFloat(e[i]);var s=this.root,l=document.defaultView.getComputedStyle(s);return(s[o]||n(l[i])||n(s.style[i]))-(n(l[a])||0)-(n(l[r])||0)|0},pathToImage:function(t,e){e=e||this.dpr;var n=document.createElement("canvas"),o=n.getContext("2d"),a=t.getBoundingRect(),r=t.style,s=r.shadowBlur,l=r.shadowOffsetX,u=r.shadowOffsetY,c=r.hasStroke()?r.lineWidth:0,h=Math.max(c/2,-l+s),d=Math.max(c/2,l+s),f=Math.max(c/2,-u+s),p=Math.max(c/2,u+s),g=a.width+h+d,m=a.height+f+p;n.width=g*e,n.height=m*e,o.scale(e,e),o.clearRect(0,0,g,m),o.dpr=e;var v={position:t.position,rotation:t.rotation,scale:t.scale};t.position=[h-a.x,f-a.y],t.rotation=0,t.scale=[1,1],t.updateTransform(),t&&t.brush(o);var y=i(53),x=new y({style:{x:0,y:0,image:n}});return null!=v.position&&(x.position=t.position=v.position),null!=v.rotation&&(x.rotation=t.rotation=v.rotation),null!=v.scale&&(x.scale=t.scale=v.scale),x}},t.exports=b},function(t,e,i){"use strict";function n(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var o=i(1),a=i(9),r=i(36),s=i(51),l=function(){this._roots=[],this._displayList=[],this._displayListLen=0};l.prototype={constructor:l,traverse:function(t,e){for(var i=0;i<this._roots.length;i++)this._roots[i].traverse(t,e)},getDisplayList:function(t,e){return e=e||!1,t&&this.updateDisplayList(e),this._displayList},updateDisplayList:function(t){this._displayListLen=0;for(var e=this._roots,i=this._displayList,o=0,r=e.length;o<r;o++)this._updateAndAddDisplayable(e[o],null,t);i.length=this._displayListLen,a.canvasSupported&&s(i,n)},_updateAndAddDisplayable:function(t,e,i){if(!t.ignore||i){t.beforeUpdate(),t.__dirty&&t.update(),t.afterUpdate();var n=t.clipPath;if(n){e=e?e.slice():[];for(var o=n,a=t;o;)o.parent=a,o.updateTransform(),e.push(o),a=o,o=o.clipPath}if(t.isGroup){for(var r=t._children,s=0;s<r.length;s++){var l=r[s];t.__dirty&&(l.__dirty=!0),this._updateAndAddDisplayable(l,e,i)}t.__dirty=!1}else t.__clipPaths=e,this._displayList[this._displayListLen++]=t}},addRoot:function(t){t.__storage!==this&&(t instanceof r&&t.addChildrenToStorage(this),this.addToStorage(t),this._roots.push(t))},delRoot:function(t){if(null==t){for(var e=0;e<this._roots.length;e++){var i=this._roots[e];i instanceof r&&i.delChildrenFromStorage(this)}return this._roots=[],this._displayList=[],void(this._displayListLen=0)}if(t instanceof Array)for(var e=0,n=t.length;e<n;e++)this.delRoot(t[e]);else{var a=o.indexOf(this._roots,t);a>=0&&(this.delFromStorage(t),this._roots.splice(a,1),t instanceof r&&t.delChildrenFromStorage(this))}},addToStorage:function(t){return t.__storage=this,t.dirty(!1),this},delFromStorage:function(t){return t&&(t.__storage=null),this},dispose:function(){this._renderList=this._roots=null},displayableSortFunc:n},t.exports=l},function(t,e,i){"use strict";var n=i(1),o=i(21).Dispatcher,a=i(68),r=i(67),s=function(t){t=t||{},this.stage=t.stage||{},this.onframe=t.onframe||function(){},this._clips=[],this._running=!1,this._time,this._pausedTime,this._pauseStart,this._paused=!1,o.call(this)};s.prototype={constructor:s,addClip:function(t){this._clips.push(t)},addAnimator:function(t){t.animation=this;for(var e=t.getClips(),i=0;i<e.length;i++)this.addClip(e[i])},removeClip:function(t){var e=n.indexOf(this._clips,t);e>=0&&this._clips.splice(e,1)},removeAnimator:function(t){for(var e=t.getClips(),i=0;i<e.length;i++)this.removeClip(e[i]);t.animation=null},_update:function(){for(var t=(new Date).getTime()-this._pausedTime,e=t-this._time,i=this._clips,n=i.length,o=[],a=[],r=0;r<n;r++){var s=i[r],l=s.step(t,e);l&&(o.push(l),a.push(s))}for(var r=0;r<n;)i[r]._needsRemove?(i[r]=i[n-1],i.pop(),n--):r++;n=o.length;for(var r=0;r<n;r++)a[r].fire(o[r]);this._time=t,this.onframe(e),this.trigger("frame",e),this.stage.update&&this.stage.update()},_startLoop:function(){function t(){e._running&&(a(t),!e._paused&&e._update())}var e=this;this._running=!0,a(t)},start:function(){this._time=(new Date).getTime(),this._pausedTime=0,this._startLoop()},stop:function(){this._running=!1},pause:function(){this._paused||(this._pauseStart=(new Date).getTime(),this._paused=!0)},resume:function(){this._paused&&(this._pausedTime+=(new Date).getTime()-this._pauseStart,this._paused=!1)},clear:function(){this._clips=[]},animate:function(t,e){e=e||{};var i=new r(t,e.loop,e.getter,e.setter);return this.addAnimator(i),i}},n.mixin(s,o),t.exports=s},function(t,e,i){function n(t){this._target=t.target,this._life=t.life||1e3,this._delay=t.delay||0,this._initialized=!1,this.loop=null!=t.loop&&t.loop,this.gap=t.gap||0,this.easing=t.easing||"Linear",this.onframe=t.onframe,this.ondestroy=t.ondestroy,this.onrestart=t.onrestart,this._pausedTime=0,this._paused=!1}var o=i(158);n.prototype={constructor:n,step:function(t,e){if(this._initialized||(this._startTime=t+this._delay,this._initialized=!0),this._paused)return void(this._pausedTime+=e);var i=(t-this._startTime-this._pausedTime)/this._life;if(!(i<0)){i=Math.min(i,1);var n=this.easing,a="string"==typeof n?o[n]:n,r="function"==typeof a?a(i):i;return this.fire("frame",r),1==i?this.loop?(this.restart(t),"restart"):(this._needsRemove=!0,"destroy"):null}},restart:function(t){var e=(t-this._startTime-this._pausedTime)%this._life;this._startTime=t-e+this.gap,this._pausedTime=0,this._needsRemove=!1},fire:function(t,e){t="on"+t,this[t]&&this[t](this._target,e)},pause:function(){this._paused=!0},resume:function(){this._paused=!1}},t.exports=n},function(t,e){var i={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(2,-10*(t-1))+2)},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,i=.1,n=.4;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=n/4):e=n*Math.asin(1/i)/(2*Math.PI),-(i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)))},elasticOut:function(t){var e,i=.1,n=.4;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=n/4):e=n*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},elasticInOut:function(t){var e,i=.1,n=.4;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=n/4):e=n*Math.asin(1/i)/(2*Math.PI),(t*=2)<1?-.5*(i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)):i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?.5*(t*t*((e+1)*t-e)):.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-i.bounceOut(1-t)},bounceOut:function(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},bounceInOut:function(t){return t<.5?.5*i.bounceIn(2*t):.5*i.bounceOut(2*t-1)+.5}};t.exports=i},function(t,e,i){var n=i(69).normalizeRadian,o=2*Math.PI;t.exports={containStroke:function(t,e,i,a,r,s,l,u,c){if(0===l)return!1;var h=l;u-=t,c-=e;var d=Math.sqrt(u*u+c*c);if(d-h>i||d+h<i)return!1;if(Math.abs(a-r)%o<1e-4)return!0;if(s){var f=a;a=n(r),r=n(f)}else a=n(a),r=n(r);a>r&&(r+=o);var p=Math.atan2(c,u);return p<0&&(p+=o),p>=a&&p<=r||p+o>=a&&p+o<=r}}},function(t,e,i){var n=i(20);t.exports={containStroke:function(t,e,i,o,a,r,s,l,u,c,h){if(0===u)return!1;var d=u;if(h>e+d&&h>o+d&&h>r+d&&h>l+d||h<e-d&&h<o-d&&h<r-d&&h<l-d||c>t+d&&c>i+d&&c>a+d&&c>s+d||c<t-d&&c<i-d&&c<a-d&&c<s-d)return!1;var f=n.cubicProjectPoint(t,e,i,o,a,r,s,l,c,h,null);return f<=d/2}}},function(t,e,i){"use strict";function n(t,e){return Math.abs(t-e)<x}function o(){var t=b[0];b[0]=b[1],b[1]=t}function a(t,e,i,n,a,r,s,l,u,c){if(c>e&&c>n&&c>r&&c>l||c<e&&c<n&&c<r&&c<l)return 0;var h=g.cubicRootAt(e,n,r,l,c,_);if(0===h)return 0;for(var d,f,p=0,m=-1,v=0;v<h;v++){var y=_[v],x=0===y||1===y?.5:1,w=g.cubicAt(t,i,a,s,y);w<u||(m<0&&(m=g.cubicExtrema(e,n,r,l,b),b[1]<b[0]&&m>1&&o(),d=g.cubicAt(e,n,r,l,b[0]),m>1&&(f=g.cubicAt(e,n,r,l,b[1]))),p+=2==m?y<b[0]?d<e?x:-x:y<b[1]?f<d?x:-x:l<f?x:-x:y<b[0]?d<e?x:-x:l<d?x:-x)}return p}function r(t,e,i,n,o,a,r,s){if(s>e&&s>n&&s>a||s<e&&s<n&&s<a)return 0;var l=g.quadraticRootAt(e,n,a,s,_);if(0===l)return 0;var u=g.quadraticExtremum(e,n,a);if(u>=0&&u<=1){for(var c=0,h=g.quadraticAt(e,n,a,u),d=0;d<l;d++){var f=0===_[d]||1===_[d]?.5:1,p=g.quadraticAt(t,i,o,_[d]);p<r||(c+=_[d]<u?h<e?f:-f:a<h?f:-f)}return c}var f=0===_[0]||1===_[0]?.5:1,p=g.quadraticAt(t,i,o,_[0]);return p<r?0:a<e?f:-f}function s(t,e,i,n,o,a,r,s){if(s-=e,s>i||s<-i)return 0;var l=Math.sqrt(i*i-s*s);_[0]=-l,_[1]=l;var u=Math.abs(n-o);if(u<1e-4)return 0;if(u%y<1e-4){n=0,o=y;var c=a?1:-1;return r>=_[0]+t&&r<=_[1]+t?c:0}if(a){var l=n;n=p(o),o=p(l)}else n=p(n),o=p(o);n>o&&(o+=y);for(var h=0,d=0;d<2;d++){var f=_[d];if(f+t>r){var g=Math.atan2(s,f),c=a?1:-1;g<0&&(g=y+g),(g>=n&&g<=o||g+y>=n&&g+y<=o)&&(g>Math.PI/2&&g<1.5*Math.PI&&(c=-c),h+=c)}}return h}function l(t,e,i,o,l){for(var c=0,p=0,g=0,y=0,x=0,_=0;_<t.length;){var b=t[_++];switch(b===u.M&&_>1&&(i||(c+=m(p,g,y,x,o,l))),1==_&&(p=t[_],g=t[_+1],y=p,x=g),b){case u.M:y=t[_++],x=t[_++],p=y,g=x;break;case u.L:if(i){if(v(p,g,t[_],t[_+1],e,o,l))return!0}else c+=m(p,g,t[_],t[_+1],o,l)||0;p=t[_++],g=t[_++];break;case u.C:if(i){if(h.containStroke(p,g,t[_++],t[_++],t[_++],t[_++],t[_],t[_+1],e,o,l))return!0}else c+=a(p,g,t[_++],t[_++],t[_++],t[_++],t[_],t[_+1],o,l)||0;p=t[_++],g=t[_++];break;case u.Q:if(i){if(d.containStroke(p,g,t[_++],t[_++],t[_],t[_+1],e,o,l))return!0}else c+=r(p,g,t[_++],t[_++],t[_],t[_+1],o,l)||0;p=t[_++],g=t[_++];break;case u.A:var w=t[_++],S=t[_++],M=t[_++],I=t[_++],T=t[_++],A=t[_++],C=(t[_++],1-t[_++]),L=Math.cos(T)*M+w,D=Math.sin(T)*I+S;_>1?c+=m(p,g,L,D,o,l):(y=L,x=D);var P=(o-w)*I/M+w;if(i){if(f.containStroke(w,S,I,T,T+A,C,e,P,l))return!0}else c+=s(w,S,I,T,T+A,C,P,l);p=Math.cos(T+A)*M+w,g=Math.sin(T+A)*I+S;break;case u.R:y=p=t[_++],x=g=t[_++];var k=t[_++],O=t[_++],L=y+k,D=x+O;if(i){if(v(y,x,L,x,e,o,l)||v(L,x,L,D,e,o,l)||v(L,D,y,D,e,o,l)||v(y,D,y,x,e,o,l))return!0}else c+=m(L,x,L,D,o,l),c+=m(y,D,y,x,o,l);break;case u.Z:if(i){if(v(p,g,y,x,e,o,l))return!0}else c+=m(p,g,y,x,o,l);p=y,g=x}}return i||n(g,x)||(c+=m(p,g,y,x,o,l)||0),0!==c}var u=i(27).CMD,c=i(97),h=i(160),d=i(98),f=i(159),p=i(69).normalizeRadian,g=i(20),m=i(99),v=c.containStroke,y=2*Math.PI,x=1e-4,_=[-1,-1,-1],b=[-1,-1];t.exports={contain:function(t,e,i){return l(t,0,!1,e,i)},containStroke:function(t,e,i,n){return l(t,e,!0,i,n)}}},function(t,e,i){"use strict";function n(t){var e=t[1][0]-t[0][0],i=t[1][1]-t[0][1];return Math.sqrt(e*e+i*i)}function o(t){return[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]}var a=i(21),r=function(){this._track=[]};r.prototype={constructor:r,recognize:function(t,e,i){return this._doTrack(t,e,i),this._recognize(t)},clear:function(){return this._track.length=0,this},_doTrack:function(t,e,i){var n=t.touches;if(n){for(var o={points:[],touches:[],target:e,event:t},r=0,s=n.length;r<s;r++){var l=n[r],u=a.clientToLocal(i,l,{});o.points.push([u.zrX,u.zrY]),o.touches.push(l)}this._track.push(o)}},_recognize:function(t){for(var e in s)if(s.hasOwnProperty(e)){var i=s[e](this._track,t);if(i)return i}}};var s={pinch:function(t,e){var i=t.length;if(i){var a=(t[i-1]||{}).points,r=(t[i-2]||{}).points||a;if(r&&r.length>1&&a&&a.length>1){var s=n(a)/n(r);!isFinite(s)&&(s=1),e.pinchScale=s;var l=o(a);return e.pinchX=l[0],e.pinchY=l[1],{type:"pinch",target:t[0].target,event:e}}}}};t.exports=r},function(t,e,i){function n(t){return"mousewheel"===t&&d.browser.firefox?"DOMMouseScroll":t}function o(t,e,i){var n=t._gestureMgr;"start"===i&&n.clear();var o=n.recognize(e,t.handler.findHover(e.zrX,e.zrY,null).target,t.dom);if("end"===i&&n.clear(),o){var a=o.type;e.gestureEvent=a,t.handler.dispatchToElement({target:o.target},a,o.event)}}function a(t){t._touching=!0,clearTimeout(t._touchTimer),t._touchTimer=setTimeout(function(){t._touching=!1},700)}function r(t){var e=t.pointerType;return"pen"===e||"touch"===e}function s(t){function e(t,e){return function(){if(!e._touching)return t.apply(e,arguments)}}c.each(x,function(e){t._handlers[e]=c.bind(w[e],t)}),c.each(b,function(e){t._handlers[e]=c.bind(w[e],t)}),c.each(y,function(i){t._handlers[i]=e(w[i],t)})}function l(t){function e(e,i){c.each(e,function(e){p(t,n(e),i._handlers[e])},i)}h.call(this),this.dom=t,this._touching=!1,this._touchTimer,this._gestureMgr=new f,this._handlers={},s(this),d.pointerEventsSupported?e(b,this):(d.touchEventsSupported&&e(x,this),e(y,this))}var u=i(21),c=i(1),h=i(23),d=i(9),f=i(162),p=u.addEventListener,g=u.removeEventListener,m=u.normalizeEvent,v=300,y=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],x=["touchstart","touchend","touchmove"],_={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},b=c.map(y,function(t){var e=t.replace("mouse","pointer");return _[e]?e:t}),w={mousemove:function(t){t=m(this.dom,t),this.trigger("mousemove",t)},mouseout:function(t){t=m(this.dom,t);var e=t.toElement||t.relatedTarget;if(e!=this.dom)for(;e&&9!=e.nodeType;){if(e===this.dom)return;e=e.parentNode}this.trigger("mouseout",t)},touchstart:function(t){t=m(this.dom,t),t.zrByTouch=!0,this._lastTouchMoment=new Date,o(this,t,"start"),w.mousemove.call(this,t),w.mousedown.call(this,t),a(this)},touchmove:function(t){t=m(this.dom,t),t.zrByTouch=!0,o(this,t,"change"),w.mousemove.call(this,t),a(this)},touchend:function(t){t=m(this.dom,t),t.zrByTouch=!0,o(this,t,"end"),w.mouseup.call(this,t),+new Date-this._lastTouchMoment<v&&w.click.call(this,t),a(this)},pointerdown:function(t){w.mousedown.call(this,t)},pointermove:function(t){r(t)||w.mousemove.call(this,t)},pointerup:function(t){w.mouseup.call(this,t)},pointerout:function(t){r(t)||w.mouseout.call(this,t)}};c.each(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){w[t]=function(e){e=m(this.dom,e),this.trigger(t,e)}});var S=l.prototype;S.dispose=function(){for(var t=y.concat(x),e=0;e<t.length;e++){var i=t[e];g(this.dom,n(i),this._handlers[i])}},S.setCursor=function(t){this.dom.style.cursor=t||"default"},c.mixin(l,h),t.exports=l},function(t,e,i){var n=i(8);t.exports=n.extend({type:"compound",shape:{paths:null},_updatePathDirty:function(){for(var t=this.__dirtyPath,e=this.shape.paths,i=0;i<e.length;i++)t=t||e[i].__dirtyPath;this.__dirtyPath=t,this.__dirty=this.__dirty||t},beforeBrush:function(){this._updatePathDirty();for(var t=this.shape.paths||[],e=this.getGlobalScale(),i=0;i<t.length;i++)t[i].path||t[i].createPathProxy(),t[i].path.setScale(e[0],e[1])},buildPath:function(t,e){for(var i=e.paths||[],n=0;n<i.length;n++)i[n].buildPath(t,i[n].shape,!0)},afterBrush:function(){for(var t=this.shape.paths,e=0;e<t.length;e++)t[e].__dirtyPath=!1},getBoundingRect:function(){return this._updatePathDirty(),n.prototype.getBoundingRect.call(this)}})},function(t,e,i){"use strict";var n=i(1),o=i(39),a=function(t,e,i,n,a){this.x=null==t?.5:t,this.y=null==e?.5:e,this.r=null==i?.5:i,this.type="radial",this.global=a||!1,o.call(this,n)};a.prototype={constructor:a},n.inherits(a,o),t.exports=a},function(t,e){t.exports={buildPath:function(t,e){var i,n,o,a,r=e.x,s=e.y,l=e.width,u=e.height,c=e.r;l<0&&(r+=l,l=-l),u<0&&(s+=u,u=-u),"number"==typeof c?i=n=o=a=c:c instanceof Array?1===c.length?i=n=o=a=c[0]:2===c.length?(i=o=c[0],n=a=c[1]):3===c.length?(i=c[0],n=a=c[1],o=c[2]):(i=c[0],n=c[1],o=c[2],a=c[3]):i=n=o=a=0;var h;i+n>l&&(h=i+n,i*=l/h,n*=l/h),o+a>l&&(h=o+a,o*=l/h,a*=l/h),n+o>u&&(h=n+o,n*=u/h,o*=u/h),i+a>u&&(h=i+a,i*=u/h,a*=u/h),t.moveTo(r+i,s),t.lineTo(r+l-n,s),0!==n&&t.quadraticCurveTo(r+l,s,r+l,s+n),t.lineTo(r+l,s+u-o),0!==o&&t.quadraticCurveTo(r+l,s+u,r+l-o,s+u),t.lineTo(r+a,s+u),0!==a&&t.quadraticCurveTo(r,s+u,r,s+u-a),t.lineTo(r,s+i),0!==i&&t.quadraticCurveTo(r,s,r+i,s)}}},function(t,e,i){var n=i(6),o=n.min,a=n.max,r=n.scale,s=n.distance,l=n.add;t.exports=function(t,e,i,u){var c,h,d,f,p=[],g=[],m=[],v=[];if(u){d=[1/0,1/0],f=[-(1/0),-(1/0)];for(var y=0,x=t.length;y<x;y++)o(d,d,t[y]),a(f,f,t[y]);o(d,d,u[0]),a(f,f,u[1])}for(var y=0,x=t.length;y<x;y++){var _=t[y];if(i)c=t[y?y-1:x-1],h=t[(y+1)%x];else{if(0===y||y===x-1){p.push(n.clone(t[y]));continue}c=t[y-1],h=t[y+1]}n.sub(g,h,c),r(g,g,e);var b=s(_,c),w=s(_,h),S=b+w;0!==S&&(b/=S,w/=S),r(m,g,-b),r(v,g,w);var M=l([],_,m),I=l([],_,v);u&&(a(M,M,d),o(M,M,f),a(I,I,d),o(I,I,f)),p.push(M),p.push(I)}return i&&p.push(p.shift()),p}},function(t,e,i){function n(t,e,i,n,o,a,r){var s=.5*(i-t),l=.5*(n-e);return(2*(e-i)+s+l)*r+(-3*(e-i)-2*s-l)*a+s*o+e}var o=i(6);t.exports=function(t,e){for(var i=t.length,a=[],r=0,s=1;s<i;s++)r+=o.distance(t[s-1],t[s]);var l=r/2;l=l<i?i:l;for(var s=0;s<l;s++){var u,c,h,d=s/(l-1)*(e?i:i-1),f=Math.floor(d),p=d-f,g=t[f%i];e?(u=t[(f-1+i)%i],c=t[(f+1)%i],h=t[(f+2)%i]):(u=t[0===f?f:f-1],c=t[f>i-2?i-1:f+1],h=t[f>i-3?i-1:f+2]);var m=p*p,v=p*m;a.push([n(u[0],g[0],c[0],h[0],p,m,v),n(u[1],g[1],c[1],h[1],p,m,v)])}return a}},function(t,e,i){t.exports=i(8).extend({type:"arc",shape:{cx:0,cy:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},style:{stroke:"#000",fill:null},buildPath:function(t,e){var i=e.cx,n=e.cy,o=Math.max(e.r,0),a=e.startAngle,r=e.endAngle,s=e.clockwise,l=Math.cos(a),u=Math.sin(a);t.moveTo(l*o+i,u*o+n),t.arc(i,n,o,a,r,!s)}})},function(t,e,i){"use strict";function n(t,e,i){var n=t.cpx2,o=t.cpy2;return null===n||null===o?[(i?h:u)(t.x1,t.cpx1,t.cpx2,t.x2,e),(i?h:u)(t.y1,t.cpy1,t.cpy2,t.y2,e)]:[(i?c:l)(t.x1,t.cpx1,t.x2,e),(i?c:l)(t.y1,t.cpy1,t.y2,e)]}var o=i(20),a=i(6),r=o.quadraticSubdivide,s=o.cubicSubdivide,l=o.quadraticAt,u=o.cubicAt,c=o.quadraticDerivativeAt,h=o.cubicDerivativeAt,d=[];t.exports=i(8).extend({type:"bezier-curve",shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(t,e){var i=e.x1,n=e.y1,o=e.x2,a=e.y2,l=e.cpx1,u=e.cpy1,c=e.cpx2,h=e.cpy2,f=e.percent;0!==f&&(t.moveTo(i,n),null==c||null==h?(f<1&&(r(i,l,o,f,d),l=d[1],o=d[2],r(n,u,a,f,d),u=d[1],a=d[2]),t.quadraticCurveTo(l,u,o,a)):(f<1&&(s(i,l,c,o,f,d),l=d[1],c=d[2],o=d[3],s(n,u,h,a,f,d),u=d[1],h=d[2],a=d[3]),t.bezierCurveTo(l,u,c,h,o,a)))},pointAt:function(t){return n(this.shape,t,!1)},tangentAt:function(t){var e=n(this.shape,t,!0);return a.normalize(e,e)}})},function(t,e,i){"use strict";t.exports=i(8).extend({type:"circle",shape:{cx:0,cy:0,r:0},buildPath:function(t,e,i){i&&t.moveTo(e.cx+e.r,e.cy),t.arc(e.cx,e.cy,e.r,0,2*Math.PI,!0)}})},function(t,e,i){t.exports=i(8).extend({type:"line",shape:{x1:0,y1:0,x2:0,y2:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(t,e){var i=e.x1,n=e.y1,o=e.x2,a=e.y2,r=e.percent;0!==r&&(t.moveTo(i,n),r<1&&(o=i*(1-r)+o*r,a=n*(1-r)+a*r),t.lineTo(o,a))},pointAt:function(t){var e=this.shape;return[e.x1*(1-t)+e.x2*t,e.y1*(1-t)+e.y2*t]}})},function(t,e,i){var n=i(74);t.exports=i(8).extend({type:"polygon",shape:{points:null,smooth:!1,smoothConstraint:null},buildPath:function(t,e){n.buildPath(t,e,!0)}})},function(t,e,i){var n=i(74);t.exports=i(8).extend({type:"polyline",shape:{points:null,smooth:!1,smoothConstraint:null},style:{stroke:"#000",fill:null},buildPath:function(t,e){n.buildPath(t,e,!1)}})},function(t,e,i){var n=i(166);t.exports=i(8).extend({type:"rect",shape:{r:0,x:0,y:0,width:0,height:0},buildPath:function(t,e){var i=e.x,o=e.y,a=e.width,r=e.height;e.r?n.buildPath(t,e):t.rect(i,o,a,r),t.closePath()}})},function(t,e,i){t.exports=i(8).extend({type:"ring",shape:{cx:0,cy:0,r:0,r0:0},buildPath:function(t,e){var i=e.cx,n=e.cy,o=2*Math.PI;t.moveTo(i+e.r,n),t.arc(i,n,e.r,0,o,!1),t.moveTo(i+e.r0,n),t.arc(i,n,e.r0,0,o,!0)}})},function(t,e,i){var n=i(9),o=i(8),a=[["shadowBlur",0],["shadowColor","#000"],["shadowOffsetX",0],["shadowOffsetY",0]];t.exports=o.extend({type:"sector",shape:{cx:0,cy:0,r0:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},brush:n.browser.ie&&n.browser.version>=11?function(){var t,e=this.__clipPaths,i=this.style;if(e)for(var n=0;n<e.length;n++){var r=e[n]&&e[n].shape;if(r&&r.startAngle===r.endAngle){for(var s=0;s<a.length;s++)a[s][2]=i[a[s][0]],i[a[s][0]]=a[s][1];t=!0;break}}if(o.prototype.brush.apply(this,arguments),t)for(var s=0;s<a.length;s++)i[a[s][0]]=a[s][2]}:o.prototype.brush,buildPath:function(t,e){var i=e.cx,n=e.cy,o=Math.max(e.r0||0,0),a=Math.max(e.r,0),r=e.startAngle,s=e.endAngle,l=e.clockwise,u=Math.cos(r),c=Math.sin(r);t.moveTo(u*o+i,c*o+n),t.lineTo(u*a+i,c*a+n),t.arc(i,n,a,r,s,!l),t.lineTo(Math.cos(s)*o+i,Math.sin(s)*o+n),0!==o&&t.arc(i,n,o,s,r,l),t.closePath()}})},function(t,e,i){"use strict";var n=i(67),o=i(1),a=o.isString,r=o.isFunction,s=o.isObject,l=i(52),u=function(){this.animators=[]};u.prototype={constructor:u,animate:function(t,e){var i,a=!1,r=this,s=this.__zr;if(t){var u=t.split("."),c=r;a="shape"===u[0];for(var h=0,d=u.length;h<d;h++)c&&(c=c[u[h]]);c&&(i=c)}else i=r;if(!i)return void l('Property "'+t+'" is not existed in element '+r.id);var f=r.animators,p=new n(i,e);return p.during(function(t){r.dirty(a)}).done(function(){f.splice(o.indexOf(f,p),1)}),f.push(p),s&&s.animation.addAnimator(p),p},stopAnimation:function(t){for(var e=this.animators,i=e.length,n=0;n<i;n++)e[n].stop(t);return e.length=0,this},animateTo:function(t,e,i,n,o){function s(){u--,u||o&&o()}a(i)?(o=n,n=i,i=0):r(n)?(o=n,n="linear",i=0):r(i)?(o=i,i=0):r(e)?(o=e,e=500):e||(e=500),this.stopAnimation(),this._animateToShallow("",this,t,e,i,n,o);var l=this.animators.slice(),u=l.length;u||o&&o();for(var c=0;c<l.length;c++)l[c].done(s).start(n)},_animateToShallow:function(t,e,i,n,a){var r={},l=0;for(var u in i)if(i.hasOwnProperty(u))if(null!=e[u])s(i[u])&&!o.isArrayLike(i[u])?this._animateToShallow(t?t+"."+u:u,e[u],i[u],n,a):(r[u]=i[u],l++);else if(null!=i[u])if(t){var c={};c[t]={},c[t][u]=i[u],this.attr(c)}else this.attr(u,i[u]);return l>0&&this.animate(t,!1).when(null==n?500:n,r).delay(a||0),this}},t.exports=u},function(t,e){function i(){this.on("mousedown",this._dragStart,this),this.on("mousemove",this._drag,this),this.on("mouseup",this._dragEnd,this),this.on("globalout",this._dragEnd,this)}function n(t,e){return{target:t,topTarget:e&&e.topTarget}}i.prototype={constructor:i,_dragStart:function(t){var e=t.target;e&&e.draggable&&(this._draggingTarget=e,e.dragging=!0,this._x=t.offsetX,this._y=t.offsetY,this.dispatchToElement(n(e,t),"dragstart",t.event))},_drag:function(t){var e=this._draggingTarget;if(e){var i=t.offsetX,o=t.offsetY,a=i-this._x,r=o-this._y;this._x=i,this._y=o,e.drift(a,r,t),this.dispatchToElement(n(e,t),"drag",t.event);var s=this.findHover(i,o,e).target,l=this._dropTarget;this._dropTarget=s,e!==s&&(l&&s!==l&&this.dispatchToElement(n(l,t),"dragleave",t.event),s&&s!==l&&this.dispatchToElement(n(s,t),"dragenter",t.event))}},_dragEnd:function(t){var e=this._draggingTarget;e&&(e.dragging=!1),this.dispatchToElement(n(e,t),"dragend",t.event),this._dropTarget&&this.dispatchToElement(n(this._dropTarget,t),"drop",t.event),this._draggingTarget=null,this._dropTarget=null}},t.exports=i},function(t,e,i){function n(t,e,i,n,o,a,r,s,l,u,p){var v=l*(f/180),y=d(v)*(t-i)/2+h(v)*(e-n)/2,x=-1*h(v)*(t-i)/2+d(v)*(e-n)/2,_=y*y/(r*r)+x*x/(s*s);_>1&&(r*=c(_),s*=c(_));var b=(o===a?-1:1)*c((r*r*(s*s)-r*r*(x*x)-s*s*(y*y))/(r*r*(x*x)+s*s*(y*y)))||0,w=b*r*x/s,S=b*-s*y/r,M=(t+i)/2+d(v)*w-h(v)*S,I=(e+n)/2+h(v)*w+d(v)*S,T=m([1,0],[(y-w)/r,(x-S)/s]),A=[(y-w)/r,(x-S)/s],C=[(-1*y-w)/r,(-1*x-S)/s],L=m(A,C);g(A,C)<=-1&&(L=f),g(A,C)>=1&&(L=0),0===a&&L>0&&(L-=2*f),1===a&&L<0&&(L+=2*f),p.addData(u,M,I,r,s,T,L,v,a)}function o(t){if(!t)return[];var e,i=t.replace(/-/g," -").replace(/  /g," ").replace(/ /g,",").replace(/,,/g,",");for(e=0;e<u.length;e++)i=i.replace(new RegExp(u[e],"g"),"|"+u[e]);var o,a=i.split("|"),r=0,l=0,c=new s,h=s.CMD;for(e=1;e<a.length;e++){var d,f=a[e],p=f.charAt(0),g=0,m=f.slice(1).replace(/e,-/g,"e-").split(",");m.length>0&&""===m[0]&&m.shift();for(var v=0;v<m.length;v++)m[v]=parseFloat(m[v]);for(;g<m.length&&!isNaN(m[g])&&!isNaN(m[0]);){var y,x,_,b,w,S,M,I=r,T=l;switch(p){case"l":r+=m[g++],l+=m[g++],d=h.L,c.addData(d,r,l);break;case"L":r=m[g++],l=m[g++],d=h.L,c.addData(d,r,l);break;case"m":r+=m[g++],l+=m[g++],d=h.M,c.addData(d,r,l),p="l";break;case"M":r=m[g++],l=m[g++],d=h.M,c.addData(d,r,l),p="L";break;case"h":r+=m[g++],d=h.L,c.addData(d,r,l);break;case"H":r=m[g++],d=h.L,c.addData(d,r,l);break;case"v":l+=m[g++],d=h.L,c.addData(d,r,l);break;case"V":l=m[g++],d=h.L,c.addData(d,r,l);break;case"C":d=h.C,c.addData(d,m[g++],m[g++],m[g++],m[g++],m[g++],m[g++]),r=m[g-2],l=m[g-1];break;case"c":d=h.C,c.addData(d,m[g++]+r,m[g++]+l,m[g++]+r,m[g++]+l,m[g++]+r,m[g++]+l),r+=m[g-2],l+=m[g-1];break;case"S":y=r,x=l;var A=c.len(),C=c.data;o===h.C&&(y+=r-C[A-4],x+=l-C[A-3]),d=h.C,I=m[g++],T=m[g++],r=m[g++],l=m[g++],c.addData(d,y,x,I,T,r,l);break;case"s":y=r,x=l;var A=c.len(),C=c.data;o===h.C&&(y+=r-C[A-4],x+=l-C[A-3]),d=h.C,I=r+m[g++],T=l+m[g++],r+=m[g++],l+=m[g++],c.addData(d,y,x,I,T,r,l);break;case"Q":I=m[g++],T=m[g++],r=m[g++],l=m[g++],d=h.Q,c.addData(d,I,T,r,l);break;case"q":I=m[g++]+r,T=m[g++]+l,r+=m[g++],l+=m[g++],d=h.Q,c.addData(d,I,T,r,l);break;case"T":y=r,x=l;var A=c.len(),C=c.data;o===h.Q&&(y+=r-C[A-4],x+=l-C[A-3]),r=m[g++],l=m[g++],d=h.Q,c.addData(d,y,x,r,l);break;case"t":y=r,x=l;var A=c.len(),C=c.data;o===h.Q&&(y+=r-C[A-4],x+=l-C[A-3]),r+=m[g++],l+=m[g++],d=h.Q,c.addData(d,y,x,r,l);break;case"A":_=m[g++],b=m[g++],w=m[g++],S=m[g++],M=m[g++],I=r,T=l,r=m[g++],l=m[g++],d=h.A,n(I,T,r,l,S,M,_,b,w,d,c);break;case"a":_=m[g++],b=m[g++],w=m[g++],S=m[g++],M=m[g++],I=r,T=l,r+=m[g++],l+=m[g++],d=h.A,n(I,T,r,l,S,M,_,b,w,d,c)}}"z"!==p&&"Z"!==p||(d=h.Z,c.addData(d)),o=d}return c.toStatic(),c}function a(t,e){var i=o(t);return e=e||{},e.buildPath=function(t){if(t.setData){t.setData(i.data);var e=t.getContext();e&&t.rebuildPath(e)}else{var e=t;i.rebuildPath(e)}},e.applyTransform=function(t){l(i,t),this.dirty(!0)},e}var r=i(8),s=i(27),l=i(181),u=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"],c=Math.sqrt,h=Math.sin,d=Math.cos,f=Math.PI,p=function(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])},g=function(t,e){return(t[0]*e[0]+t[1]*e[1])/(p(t)*p(e))},m=function(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(g(t,e))};t.exports={createFromString:function(t,e){return new r(a(t,e))},extendFromString:function(t,e){return r.extend(a(t,e))},mergePath:function(t,e){for(var i=[],n=t.length,o=0;o<n;o++){var a=t[o];a.path||a.createPathProxy(),a.__dirtyPath&&a.buildPath(a.path,a.shape,!0),i.push(a.path)}var s=new r(e);return s.createPathProxy(),s.buildPath=function(t){t.appendPath(i);var e=t.getContext();e&&t.rebuildPath(e)},s}}},function(t,e,i){function n(t,e){var i,n,a,c,h,d,f=t.data,p=o.M,g=o.C,m=o.L,v=o.R,y=o.A,x=o.Q;for(a=0,c=0;a<f.length;){switch(i=f[a++],c=a,n=0,i){case p:n=1;break;case m:n=1;break;case g:n=3;break;case x:n=2;break;case y:var _=e[4],b=e[5],w=l(e[0]*e[0]+e[1]*e[1]),S=l(e[2]*e[2]+e[3]*e[3]),M=u(-e[1]/S,e[0]/w);f[a]*=w,f[a++]+=_,f[a]*=S,f[a++]+=b,f[a++]*=w,f[a++]*=S,f[a++]+=M,f[a++]+=M,a+=2,c=a;break;case v:d[0]=f[a++],d[1]=f[a++],r(d,d,e),f[c++]=d[0],f[c++]=d[1],d[0]+=f[a++],d[1]+=f[a++],r(d,d,e),f[c++]=d[0],f[c++]=d[1]}for(h=0;h<n;h++){var d=s[h];d[0]=f[a++],d[1]=f[a++],r(d,d,e),f[c++]=d[0],f[c++]=d[1]}}}var o=i(27).CMD,a=i(6),r=a.applyTransform,s=[[],[],[]],l=Math.sqrt,u=Math.atan2;t.exports=n},function(t,e,i){if(!i(9).canvasSupported){var n,o="urn:schemas-microsoft-com:vml",a=window,r=a.document,s=!1;try{!r.namespaces.zrvml&&r.namespaces.add("zrvml",o),n=function(t){return r.createElement("<zrvml:"+t+' class="zrvml">')}}catch(l){n=function(t){return r.createElement("<"+t+' xmlns="'+o+'" class="zrvml">')}}var u=function(){if(!s){s=!0;var t=r.styleSheets;t.length<31?r.createStyleSheet().addRule(".zrvml","behavior:url(#default#VML)"):t[0].addRule(".zrvml","behavior:url(#default#VML)")}};t.exports={doc:r,initVML:u,createNode:n}}},function(t,e,i){"use strict";var n=i(14),o=i(25),a=i(313),r=i(1),s={_baseAxisDim:null,getInitialData:function(t,e){var i,a,s=e.getComponent("xAxis",this.get("xAxisIndex")),l=e.getComponent("yAxis",this.get("yAxisIndex")),u=s.get("type"),c=l.get("type");"category"===u?(t.layout="horizontal",i=s.getCategories(),a=!0):"category"===c?(t.layout="vertical",i=l.getCategories(),a=!0):t.layout=t.layout||"horizontal";var h=["x","y"],d="horizontal"===t.layout?0:1,f=this._baseAxisDim=h[d],p=h[1-d],g=t.data;a&&r.each(g,function(t,e){r.isArray(t)&&t.unshift(e)});var m=[{name:f,otherDims:{tooltip:!1},dimsDef:["base"]},{name:p,dimsDef:this.defaultValueDimensions.slice()}];m=o(m,g,{encodeDef:this.get("encode"),dimsDef:this.get("dimensions")});var v=new n(m,this);return v.initData(g,i?i.slice():null),v},getBaseAxis:function(){var t=this._baseAxisDim;return this.ecModel.getComponent(t+"Axis",this.get(t+"AxisIndex")).axis}},l={init:function(){var t=this._whiskerBoxDraw=new a(this.getStyleUpdater());this.group.add(t.group)},render:function(t,e,i){this._whiskerBoxDraw.updateData(t.getData())},remove:function(t){this._whiskerBoxDraw.remove()}};t.exports={seriesModelMixin:s,viewMixin:l}},function(t,e,i){function n(t,e,i){var n=this._targetInfoList=[],o={},r=a(e,t);p(_,function(t,e){(!i||!i.include||g(i.include,e)>=0)&&t(r,n,o)})}function o(t){return t[0]>t[1]&&t.reverse(),t}function a(t,e){return d.parseFinder(t,e,{includeMainTypes:y})}function r(t,e,i,n){var a=i.getAxis(["x","y"][t]),r=o(c.map([0,1],function(t){return e?a.coordToData(a.toLocalCoord(n[t])):a.toGlobalCoord(a.dataToCoord(n[t]))})),s=[];return s[t]=r,s[1-t]=[NaN,NaN],{values:r,xyMinMax:s}}function s(t,e,i,n){return[e[0]-n[t]*i[0],e[1]-n[t]*i[1]]}function l(t,e){var i=u(t),n=u(e),o=[i[0]/n[0],i[1]/n[1]];return isNaN(o[0])&&(o[0]=1),isNaN(o[1])&&(o[1]=1),o}function u(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}var c=i(1),h=i(3),d=i(5),f=i(185),p=c.each,g=c.indexOf,m=c.curry,v=["dataToPoint","pointToData"],y=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],x=n.prototype;x.setOutputRanges=function(t,e){this.matchOutputRanges(t,e,function(t,e,i){if((t.coordRanges||(t.coordRanges=[])).push(e),!t.coordRange){t.coordRange=e;var n=S[t.brushType](0,i,e);t.__rangeOffset={offset:M[t.brushType](n.values,t.range,[1,1]),xyMinMax:n.xyMinMax}}})},x.matchOutputRanges=function(t,e,i){p(t,function(t){var n=this.findTargetInfo(t,e);n&&n!==!0&&c.each(n.coordSyses,function(n){var o=S[t.brushType](1,n,t.range);i(t,o.values,n,e)})},this)},x.setInputRanges=function(t,e){p(t,function(t){var i=this.findTargetInfo(t,e);if(t.range=t.range||[],i&&i!==!0){t.panelId=i.panelId;var n=S[t.brushType](0,i.coordSys,t.coordRange),o=t.__rangeOffset;t.range=o?M[t.brushType](n.values,o.offset,l(n.xyMinMax,o.xyMinMax)):n.values}},this)},x.makePanelOpts=function(t,e){return c.map(this._targetInfoList,function(i){var n=i.getPanelRect();return{panelId:i.panelId,defaultBrushType:e&&e(i),clipPath:f.makeRectPanelClipPath(n),isTargetByCursor:f.makeRectIsTargetByCursor(n,t,i.coordSysModel),getLinearBrushOtherExtent:f.makeLinearBrushOtherExtent(n)}})},x.controlSeries=function(t,e,i){var n=this.findTargetInfo(t,i);return n===!0||n&&g(n.coordSyses,e.coordinateSystem)>=0},x.findTargetInfo=function(t,e){for(var i=this._targetInfoList,n=a(e,t),o=0;o<i.length;o++){var r=i[o],s=t.panelId;if(s){if(r.panelId===s)return r}else for(var o=0;o<b.length;o++)if(b[o](n,r))return r}return!0};var _={grid:function(t,e){var i=t.xAxisModels,n=t.yAxisModels,o=t.gridModels,a=c.createHashMap(),r={},s={};(i||n||o)&&(p(i,function(t){var e=t.axis.grid.model;a.set(e.id,e),r[e.id]=!0}),p(n,function(t){var e=t.axis.grid.model;a.set(e.id,e),s[e.id]=!0}),p(o,function(t){a.set(t.id,t),r[t.id]=!0,s[t.id]=!0}),a.each(function(t){var o=t.coordinateSystem,a=[];p(o.getCartesians(),function(t,e){(g(i,t.getAxis("x").model)>=0||g(n,t.getAxis("y").model)>=0)&&a.push(t)}),e.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,coordSys:a[0],coordSyses:a,getPanelRect:w.grid,xAxisDeclared:r[t.id],yAxisDeclared:s[t.id]})}))},geo:function(t,e){p(t.geoModels,function(t){var i=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:i,coordSyses:[i],getPanelRect:w.geo})})}},b=[function(t,e){var i=t.xAxisModel,n=t.yAxisModel,o=t.gridModel;return!o&&i&&(o=i.axis.grid.model),!o&&n&&(o=n.axis.grid.model),o&&o===e.gridModel},function(t,e){var i=t.geoModel;return i&&i===e.geoModel}],w={grid:function(){return this.coordSys.grid.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();return e.applyTransform(h.getTransform(t)),e}},S={lineX:m(r,0),lineY:m(r,1),rect:function(t,e,i){var n=e[v[t]]([i[0][0],i[1][0]]),a=e[v[t]]([i[0][1],i[1][1]]),r=[o([n[0],a[0]]),o([n[1],a[1]])];return{values:r,xyMinMax:r}},polygon:function(t,e,i){var n=[[1/0,-(1/0)],[1/0,-(1/0)]],o=c.map(i,function(i){var o=e[v[t]](i);return n[0][0]=Math.min(n[0][0],o[0]),n[1][0]=Math.min(n[1][0],o[1]),n[0][1]=Math.max(n[0][1],o[0]),n[1][1]=Math.max(n[1][1],o[1]),o});return{values:o,xyMinMax:n}}},M={lineX:m(s,0),lineY:m(s,1),rect:function(t,e,i){return[[t[0][0]-i[0]*e[0][0],t[0][1]-i[0]*e[0][1]],[t[1][0]-i[1]*e[1][0],t[1][1]-i[1]*e[1][1]]]},polygon:function(t,e,i){return c.map(t,function(t,n){return[t[0]-i[0]*e[n][0],t[1]-i[1]*e[n][1]]})}};t.exports=n},function(t,e,i){function n(t){return a.create(t)}var o=i(128),a=i(11),r=i(3),s={};s.makeRectPanelClipPath=function(t){return t=n(t),function(e,i){return r.clipPointsByRect(e,t)}},s.makeLinearBrushOtherExtent=function(t,e){return t=n(t),function(i){var n=null!=e?e:i,o=n?t.width:t.height,a=n?t.x:t.y;return[a,a+(o||0)]}},s.makeRectIsTargetByCursor=function(t,e,i){return t=n(t),function(n,a,r){return t.contain(a[0],a[1])&&!o.onIrrelevantElement(n,e,i)}},t.exports=s},function(t,e,i){function n(t,e){var i=t.get("boundingCoords");if(null!=i){var n=i[0],o=i[1];isNaN(n[0])||isNaN(n[1])||isNaN(o[0])||isNaN(o[1])||this.setBoundingRect(n[0],n[1],o[0]-n[0],o[1]-n[1])}var a,s=this.getBoundingRect(),u=t.get("layoutCenter"),c=t.get("layoutSize"),h=e.getWidth(),d=e.getHeight(),f=t.get("aspectScale")||.75,p=s.width/s.height*f,g=!1;u&&c&&(u=[l.parsePercent(u[0],h),l.parsePercent(u[1],d)],c=l.parsePercent(c,Math.min(h,d)),isNaN(u[0])||isNaN(u[1])||isNaN(c)||(g=!0));var m;if(g){var m={};p>1?(m.width=c,m.height=c/p):(m.height=c,m.width=c*p),m.y=u[1]-m.height/2,m.x=u[0]-m.width/2}else a=t.getBoxLayoutParams(),a.aspect=p,m=r.getLayoutRect(a,{width:h,height:d});this.setViewRect(m.x,m.y,m.width,m.height),this.setCenter(t.get("center")),this.setZoom(t.get("zoom"))}function o(t,e){s.each(e.get("geoCoord"),function(e,i){t.addGeoCoord(i,e)})}var a=i(398),r=i(12),s=i(1),l=i(4),u={},c={dimensions:a.prototype.dimensions,create:function(t,e){var i=[];t.eachComponent("geo",function(t,r){var s=t.get("map"),l=u[s],c=new a(s+r,s,l&&l.geoJson,l&&l.specialAreas,t.get("nameMap"));c.zoomLimit=t.get("scaleLimit"),i.push(c),o(c,t),t.coordinateSystem=c,c.model=t,c.resize=n,c.resize(t,e)}),t.eachSeries(function(t){var e=t.get("coordinateSystem");if("geo"===e){var n=t.get("geoIndex")||0;t.coordinateSystem=i[n]}});var r={};return t.eachSeriesByType("map",function(t){if(!t.getHostGeoModel()){var e=t.getMapType();r[e]=r[e]||[],r[e].push(t)}}),s.each(r,function(t,r){var l=u[r],c=s.map(t,function(t){return t.get("nameMap")}),h=new a(r,r,l&&l.geoJson,l&&l.specialAreas,s.mergeAll(c));h.zoomLimit=s.retrieve.apply(null,s.map(t,function(t){return t.get("scaleLimit")})),i.push(h),h.resize=n,h.resize(t[0],e),s.each(t,function(t){t.coordinateSystem=h,o(h,t)})}),i},registerMap:function(t,e,i){e.geoJson&&!e.features&&(i=e.specialAreas,e=e.geoJson),"string"==typeof e&&(e="undefined"!=typeof JSON&&JSON.parse?JSON.parse(e):new Function("return ("+e+");")()),u[t]={geoJson:e,specialAreas:i}},getMap:function(t){return u[t]},getFilledRegions:function(t,e){var i=(t||[]).slice(),n=c.getMap(e),o=n&&n.geoJson;if(!o)return t;for(var a=s.createHashMap(),r=o.features,l=0;l<i.length;l++)a.set(i[l].name,i[l]);for(var l=0;l<r.length;l++){var u=r[l].properties.name;a.get(u)||i.push({name:u})}return i}},h=i(2);h.registerMap=c.registerMap,h.getMap=c.getMap,h.parseGeoJSON=i(262),h.loadMap=function(){},h.registerCoordinateSystem("geo",c),t.exports=c},function(t,e,i){function n(t){if(t)for(var e in t)if(t.hasOwnProperty(e))return!0}var o=i(1),a=i(83),r=o.each,s={createVisualMappings:function(t,e,i){function n(){var t=function(){};t.prototype.__hidden=t.prototype;var e=new t;return e}var s={};return r(e,function(e){var l=s[e]=n();r(t[e],function(t,n){if(a.isValidType(n)){var r={type:n,visual:t};i&&i(r,e),l[n]=new a(r),"opacity"===n&&(r=o.clone(r),r.type="colorAlpha",l.__hidden.__alphaForOpacity=new a(r))}})}),s},replaceVisualOption:function(t,e,i){var a;o.each(i,function(t){e.hasOwnProperty(t)&&n(e[t])&&(a=!0)}),a&&o.each(i,function(i){e.hasOwnProperty(i)&&n(e[i])?t[i]=o.clone(e[i]):delete t[i]})},applyVisual:function(t,e,i,n,r,s){function l(t){return i.getItemVisual(d,t)}function u(t,e){i.setItemVisual(d,t,e)}function c(t,o){d=null==s?t:o;var a=i.getRawDataItem(d);if(!a||a.visualMap!==!1)for(var c=n.call(r,t),f=e[c],p=h[c],g=0,m=p.length;g<m;g++){var v=p[g];f[v]&&f[v].applyVisual(t,l,u)}}var h={};o.each(t,function(t){var i=a.prepareVisualTypes(e[t]);h[t]=i});var d;null==s?i.each(c,!0):i.each([s],c,!0)}};t.exports=s},function(t,e){function i(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function o(t){if(c===setTimeout)return setTimeout(t,0);if((c===i||!c)&&setTimeout)return c=setTimeout,setTimeout(t,0);try{return c(t,0)}catch(e){try{return c.call(null,t,0)}catch(e){return c.call(this,t,0)}}}function a(t){if(h===clearTimeout)return clearTimeout(t);if((h===n||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(t);try{return h(t)}catch(e){try{return h.call(null,t)}catch(e){return h.call(this,t)}}}function r(){g&&f&&(g=!1,f.length?p=f.concat(p):m=-1,p.length&&s())}function s(){if(!g){var t=o(r);g=!0;for(var e=p.length;e;){for(f=p,p=[];++m<e;)f&&f[m].run();m=-1,e=p.length}f=null,g=!1,a(t)}}function l(t,e){this.fun=t,this.array=e}function u(){}var c,h,d=t.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:i}catch(t){c=i}try{h="function"==typeof clearTimeout?clearTimeout:n}catch(t){h=n}}();var f,p=[],g=!1,m=-1;d.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];p.push(new l(t,e)),1!==p.length||g||o(s)},l.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=u,d.addListener=u,d.once=u,d.off=u,d.removeListener=u,d.removeAllListeners=u,d.emit=u,d.binding=function(t){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(t){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(t,e,i){function n(){this.group=new o.Group,this._symbolEl=new r({})}var o=i(3),a=i(24),r=o.extendShape({shape:{points:null,sizes:null},symbolProxy:null,buildPath:function(t,e){for(var i=e.points,n=e.sizes,o=this.symbolProxy,a=o.shape,r=0;r<i.length;r++){var s=i[r];if(!isNaN(s[0])&&!isNaN(s[1])){var l=n[r];l[0]<4?t.rect(s[0]-l[0]/2,s[1]-l[1]/2,l[0],l[1]):(a.x=s[0]-l[0]/2,a.y=s[1]-l[1]/2,a.width=l[0],a.height=l[1],o.buildPath(t,a,!0))}}},findDataIndex:function(t,e){for(var i=this.shape,n=i.points,o=i.sizes,a=n.length-1;a>=0;a--){var r=n[a],s=o[a],l=r[0]-s[0]/2,u=r[1]-s[1]/2;if(t>=l&&e>=u&&t<=l+s[0]&&e<=u+s[1])return a}return-1}}),s=n.prototype;s.updateData=function(t){this.group.removeAll();var e=this._symbolEl,i=t.hostModel;e.setShape({points:t.mapArray(t.getItemLayout),sizes:t.mapArray(function(e){var i=t.getItemVisual(e,"symbolSize");return i instanceof Array||(i=[i,i]),i})}),e.symbolProxy=a.createSymbol(t.getVisual("symbol"),0,0,0,0),e.setColor=e.symbolProxy.setColor,e.useStyle(i.getModel("itemStyle.normal").getItemStyle(["color"]));var n=t.getVisual("color");n&&e.setColor(n),e.seriesIndex=i.seriesIndex,e.on("mousemove",function(t){e.dataIndex=null;var i=e.findDataIndex(t.offsetX,t.offsetY);i>=0&&(e.dataIndex=i)}),this.group.add(e)},s.updateLayout=function(t){var e=t.getData();this._symbolEl.setShape({points:e.mapArray(e.getItemLayout)})},s.remove=function(){this.group.removeAll()},t.exports=n},function(t,e,i){function n(t){return isNaN(+t.cpx1)||isNaN(+t.cpy1)}var o=i(3),a=i(6),r=o.Line.prototype,s=o.BezierCurve.prototype;t.exports=o.extendShape({type:"ec-line",style:{stroke:"#000",fill:null},shape:{x1:0,y1:0,x2:0,y2:0,percent:1,cpx1:null,cpy1:null},buildPath:function(t,e){(n(e)?r:s).buildPath(t,e)},pointAt:function(t){return n(this.shape)?r.pointAt.call(this,t):s.pointAt.call(this,t)},tangentAt:function(t){var e=this.shape,i=n(e)?[e.x2-e.x1,e.y2-e.y1]:s.tangentAt.call(this,t);return a.normalize(i,i)}})},function(t,e,i){var n=i(1),o=i(2);i(192),i(193),o.registerVisual(n.curry(i(50),"scatter","circle",null)),o.registerLayout(n.curry(i(61),"scatter")),i(32)},function(t,e,i){"use strict";var n=i(28),o=i(17);t.exports=o.extend({type:"series.scatter",dependencies:["grid","polar","geo","singleAxis","calendar"],getInitialData:function(t,e){return n(t.data,this,e)},brushSelector:"point",defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{normal:{opacity:.8}}}})},function(t,e,i){var n=i(44),o=i(189);i(2).extendChartView({type:"scatter",init:function(){this._normalSymbolDraw=new n,this._largeSymbolDraw=new o},render:function(t,e,i){var n=t.getData(),o=this._largeSymbolDraw,a=this._normalSymbolDraw,r=this.group,s=t.get("large")&&n.count()>t.get("largeThreshold")?o:a;this._symbolDraw=s,s.updateData(n),r.add(s.group),r.remove(s===o?a.group:o.group)},updateLayout:function(t){this._symbolDraw.updateLayout(t)},remove:function(t,e){this._symbolDraw&&this._symbolDraw.remove(e,!0)},dispose:function(){}})},function(t,e,i){var n=i(2),o=n.extendComponentModel({type:"axisPointer",coordSysAxesInfo:null,defaultOption:{show:"auto",triggerOn:null,zlevel:0,z:50,type:"line",snap:!1,triggerTooltip:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#aaa",width:1,type:"solid"},shadowStyle:{color:"rgba(150,150,150,0.3)"},label:{show:!0,formatter:null,precision:"auto",margin:3,textStyle:{color:"#fff"},padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,shadowBlur:3,shadowColor:"#aaa"},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}}});t.exports=o},function(t,e,i){var n=i(122),o=i(2).extendComponentView({type:"axisPointer",render:function(t,e,i){var o=e.getComponent("tooltip"),a=t.get("triggerOn")||o&&o.get("triggerOn")||"mousemove|click";n.register("axisPointer",i,function(t,e,i){"none"!==a&&("leave"===t||a.indexOf(t)>=0)&&i({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})})},remove:function(t,e){n.disopse(e.getZr(),"axisPointer"),o.superApply(this._model,"remove",arguments)},dispose:function(t,e){n.unregister("axisPointer",e),o.superApply(this._model,"dispose",arguments)}})},function(t,e,i){function n(t,e,i){var n=t.currTrigger,a=[t.x,t.y],g=t,m=t.dispatchAction||p.bind(i.dispatchAction,i),_=e.getComponent("axisPointer").coordSysAxesInfo;f(a)&&(a=v({seriesIndex:g.seriesIndex,dataIndex:g.dataIndex},e).point);var b=f(a),w=g.axesInfo,S=_.axesInfo,M="leave"===n||f(a),I={},T={},A={list:[],map:{}},C={showPointer:x(r,T),showTooltip:x(s,A)};y(_.coordSysMap,function(t,e){var i=b||t.containPoint(a);y(_.coordSysAxesInfo[e],function(t,e){var n=t.axis,r=h(w,t);if(!M&&i&&(!w||r)){var s=r&&r.value;null!=s||b||(s=n.pointToData(a)),null!=s&&o(t,s,C,!1,I)}})});var L={};return y(S,function(t,e){var i=t.linkGroup;i&&!T[e]&&y(i.axesInfo,function(e,n){var o=T[n];if(e!==t&&o){var a=o.value;i.mapper&&(a=t.axis.scale.parse(i.mapper(a,d(e),d(t)))),L[t.key]=a}})}),y(L,function(t,e){o(S[e],t,C,!0,I)}),l(T,S,I),u(A,a,t,m),c(S,m,i),I}function o(t,e,i,n,o){var r=t.axis;if(!r.scale.isBlank()&&r.containData(e)){if(!t.involveSeries)return void i.showPointer(t,e);var s=a(e,t),l=s.payloadBatch,u=s.snapToValue;l[0]&&null==o.seriesIndex&&p.extend(o,l[0]),!n&&t.snap&&r.containData(u)&&null!=u&&(e=u),i.showPointer(t,e,l,o),i.showTooltip(t,s,u)}}function a(t,e){var i=e.axis,n=i.dim,o=t,a=[],r=Number.MAX_VALUE,s=-1;return y(e.seriesModels,function(e,l){var u,c,h=e.coordDimToDataDim(n);if(e.getAxisTooltipData){var d=e.getAxisTooltipData(h,t,i);c=d.dataIndices,u=d.nestestValue}else{if(c=e.getData().indicesOfNearest(h[0],t,!1,"category"===i.type?.5:null),!c.length)return;u=e.getData().get(h[0],c[0])}if(null!=u&&isFinite(u)){var f=t-u,p=Math.abs(f);p<=r&&((p<r||f>=0&&s<0)&&(r=p,s=f,o=u,a.length=0),y(c,function(t){a.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})}))}}),{payloadBatch:a,snapToValue:o}}function r(t,e,i,n){t[e.key]={value:i,payloadBatch:n}}function s(t,e,i,n){var o=i.payloadBatch,a=e.axis,r=a.model,s=e.axisPointerModel;if(e.triggerTooltip&&o.length){var l=e.coordSys.model,u=m.makeKey(l),c=t.map[u];c||(c=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(c)),c.dataByAxis.push({axisDim:a.dim,axisIndex:r.componentIndex,axisType:r.type,axisId:r.id,value:n,valueLabelOpt:{precision:s.get("label.precision"),formatter:s.get("label.formatter")},seriesDataIndices:o.slice()})}}function l(t,e,i){var n=i.axesInfo=[];y(e,function(e,i){var o=e.axisPointerModel.option,a=t[i];a?(!e.useHandle&&(o.status="show"),o.value=a.value,o.seriesDataIndices=(a.payloadBatch||[]).slice()):!e.useHandle&&(o.status="hide"),"show"===o.status&&n.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:o.value})})}function u(t,e,i,n){if(f(e)||!t.list.length)return void n({type:"hideTip"});var o=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:i.tooltipOption,position:i.position,dataIndexInside:o.dataIndexInside,dataIndex:o.dataIndex,seriesIndex:o.seriesIndex,dataByCoordSys:t.list})}function c(t,e,i){var n=i.getZr(),o="axisPointerLastHighlights",a=_(n)[o]||{},r=_(n)[o]={};y(t,function(t,e){var i=t.axisPointerModel.option;"show"===i.status&&y(i.seriesDataIndices,function(t){var e=t.seriesIndex+" | "+t.dataIndex;r[e]=t})});var s=[],l=[];p.each(a,function(t,e){!r[e]&&l.push(t)}),p.each(r,function(t,e){!a[e]&&s.push(t)}),l.length&&i.dispatchAction({type:"downplay",escapeConnect:!0,batch:l}),s.length&&i.dispatchAction({type:"highlight",escapeConnect:!0,batch:s})}function h(t,e){for(var i=0;i<(t||[]).length;i++){var n=t[i];if(e.axis.dim===n.axisDim&&e.axis.model.componentIndex===n.axisIndex)return n}}function d(t){var e=t.axis.model,i={},n=i.axisDim=t.axis.dim;return i.axisIndex=i[n+"AxisIndex"]=e.componentIndex,i.axisName=i[n+"AxisName"]=e.name,i.axisId=i[n+"AxisId"]=e.id,i}function f(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}var p=i(1),g=i(5),m=i(45),v=i(121),y=p.each,x=p.curry,_=g.makeGetter();t.exports=n},function(t,e,i){i(126),i(46),i(47),i(203),i(204),i(199),i(200),i(124),i(123)},function(t,e,i){function n(t,e,i){var n=[1/0,-(1/0)];return c(i,function(t){var i=t.getData();i&&c(t.coordDimToDataDim(e),function(t){var e=i.getDataExtent(t);e[0]<n[0]&&(n[0]=e[0]),e[1]>n[1]&&(n[1]=e[1])})}),n[1]<n[0]&&(n=[NaN,NaN]),o(t,n),n}function o(t,e){var i=t.getAxisModel(),n=i.getMin(!0),o="category"===i.get("type"),a=o&&(i.get("data")||[]).length;null!=n&&"dataMin"!==n?e[0]=n:o&&(e[0]=a>0?0:NaN);var r=i.getMax(!0);return null!=r&&"dataMax"!==r?e[1]=r:o&&(e[1]=a>0?a-1:NaN),i.get("scale",!0)||(e[0]>0&&(e[0]=0),e[1]<0&&(e[1]=0)),e}function a(t,e){var i=t.getAxisModel(),n=t._percentWindow,o=t._valueWindow;if(n){var a=l.getPixelPrecision(o,[0,500]),r=e||0===n[0]&&100===n[1];i.setRange(r?null:+o[0].toFixed(a),r?null:+o[1].toFixed(a))}}function r(t){var e=t._minMaxSpan={},i=t._dataZoomModel;c(["min","max"],function(n){e[n+"Span"]=i.get(n+"Span");var o=i.get(n+"ValueSpan");null!=o&&(e[n+"ValueSpan"]=o,o=t.getAxisModel().axis.scale.parse(o),null!=o&&(e[n+"Span"]=l.linearMap(o,t._dataExtent,[0,100],!0)))})}var s=i(1),l=i(4),u=i(77),c=s.each,h=l.asc,d=function(t,e,i,n){this._dimName=t,this._axisIndex=e,this._valueWindow,this._percentWindow,this._dataExtent,this._minMaxSpan,this.ecModel=n,this._dataZoomModel=i};d.prototype={constructor:d,hostedBy:function(t){return this._dataZoomModel===t},getDataValueWindow:function(){return this._valueWindow.slice()},getDataPercentWindow:function(){return this._percentWindow.slice()},getTargetSeriesModels:function(){var t=[],e=this.ecModel;return e.eachSeries(function(i){if(u.isCoordSupported(i.get("coordinateSystem"))){var n=this._dimName,o=e.queryComponents({mainType:n+"Axis",index:i.get(n+"AxisIndex"),id:i.get(n+"AxisId")})[0];this._axisIndex===(o&&o.componentIndex)&&t.push(i)}},this),t},getAxisModel:function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},getOtherAxisModel:function(){var t,e,i=this._dimName,n=this.ecModel,o=this.getAxisModel(),a="x"===i||"y"===i;a?(e="gridIndex",t="x"===i?"y":"x"):(e="polarIndex",t="angle"===i?"radius":"angle");var r;return n.eachComponent(t+"Axis",function(t){(t.get(e)||0)===(o.get(e)||0)&&(r=t)}),r},getMinMaxSpan:function(){return s.clone(this._minMaxSpan)},calculateDataWindow:function(t){var e=this._dataExtent,i=this.getAxisModel(),n=i.axis.scale,o=this._dataZoomModel.getRangePropMode(),a=[0,100],r=[t.start,t.end],s=[];return c(["startValue","endValue"],function(e){s.push(null!=t[e]?n.parse(t[e]):null)}),c([0,1],function(t){var i=s[t],u=r[t];"percent"===o[t]?(null==u&&(u=a[t]),i=n.parse(l.linearMap(u,a,e,!0))):u=l.linearMap(i,e,a,!0),s[t]=i,r[t]=u}),{valueWindow:h(s),percentWindow:h(r)}},reset:function(t){if(t===this._dataZoomModel){this._dataExtent=n(this,this._dimName,this.getTargetSeriesModels());var e=this.calculateDataWindow(t.option);this._valueWindow=e.valueWindow,this._percentWindow=e.percentWindow,r(this),a(this)}},restore:function(t){t===this._dataZoomModel&&(this._valueWindow=this._percentWindow=null,a(this,!0))},filterData:function(t){function e(t){return t>=a[0]&&t<=a[1]}if(t===this._dataZoomModel){var i=this._dimName,n=this.getTargetSeriesModels(),o=t.get("filterMode"),a=this._valueWindow;if("none"!==o){var r=this.getOtherAxisModel();t.get("$fromToolbox")&&r&&"category"===r.get("type")&&(o="empty"),c(n,function(t){var n=t.getData(),r=t.coordDimToDataDim(i);"weakFilter"===o?n&&n.filterSelf(function(t){for(var e,i,o,s=0;s<r.length;s++){var l=n.get(r[s],t),u=!isNaN(l),c=l<a[0],h=l>a[1];if(u&&!c&&!h)return!0;u&&(o=!0),c&&(e=!0),h&&(i=!0)}return o&&e&&i}):n&&c(r,function(i){"empty"===o?t.setData(n.map(i,function(t){return e(t)?t:NaN})):n.filterSelf(i,e)})})}}}},t.exports=d},function(t,e,i){t.exports=i(46).extend({type:"dataZoom.inside",defaultOption:{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,preventDefaultMouseMove:!0}})},function(t,e,i){var n=i(47),o=i(1),a=i(56),r=i(205),s=o.bind,l=n.extend({type:"dataZoom.inside",init:function(t,e){this._range},render:function(t,e,i,n){l.superApply(this,"render",arguments),r.shouldRecordRange(n,t.id)&&(this._range=t.getPercentRange()),o.each(this.getTargetCoordInfo(),function(e,n){var a=o.map(e,function(t){return r.generateCoordId(t.model)});o.each(e,function(e){var o=e.model,l=t.option;r.register(i,{coordId:r.generateCoordId(o),allCoordIds:a,containsPoint:function(t,e,i){return o.coordinateSystem.containPoint([e,i])},dataZoomId:t.id,throttleRate:t.get("throttle",!0),panGetRange:s(this._onPan,this,e,n),zoomGetRange:s(this._onZoom,this,e,n),zoomLock:l.zoomLock,disabled:l.disabled,roamControllerOpt:{zoomOnMouseWheel:l.zoomOnMouseWheel,moveOnMouseMove:l.moveOnMouseMove,preventDefaultMouseMove:l.preventDefaultMouseMove}})},this)},this)},dispose:function(){r.unregister(this.api,this.dataZoomModel.id),l.superApply(this,"dispose",arguments),this._range=null},_onPan:function(t,e,i,n,o,r,s,l,c){var h=this._range.slice(),d=t.axisModels[0];if(d){var f=u[e]([r,s],[l,c],d,i,t),p=f.signal*(h[1]-h[0])*f.pixel/f.pixelLength;return a(p,h,[0,100],"all"),this._range=h}},_onZoom:function(t,e,i,n,o,r){var s=this._range.slice(),l=t.axisModels[0];if(l){var c=u[e](null,[o,r],l,i,t),h=(c.signal>0?c.pixelStart+c.pixelLength-c.pixel:c.pixel-c.pixelStart)/c.pixelLength*(s[1]-s[0])+s[0];n=Math.max(1/n,0),s[0]=(s[0]-h)*n+h,s[1]=(s[1]-h)*n+h;var d=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return a(0,s,[0,100],0,d.minSpan,d.maxSpan),this._range=s}}}),u={grid:function(t,e,i,n,o){var a=i.axis,r={},s=o.model.coordinateSystem.getRect();return t=t||[0,0],"x"===a.dim?(r.pixel=e[0]-t[0],r.pixelLength=s.width,r.pixelStart=s.x,r.signal=a.inverse?1:-1):(r.pixel=e[1]-t[1],r.pixelLength=s.height,r.pixelStart=s.y,r.signal=a.inverse?-1:1),r},polar:function(t,e,i,n,o){var a=i.axis,r={},s=o.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),"radiusAxis"===i.mainType?(r.pixel=e[0]-t[0],r.pixelLength=l[1]-l[0],r.pixelStart=l[0],r.signal=a.inverse?1:-1):(r.pixel=e[1]-t[1],r.pixelLength=u[1]-u[0],r.pixelStart=u[0],r.signal=a.inverse?-1:1),r},singleAxis:function(t,e,i,n,o){var a=i.axis,r=o.model.coordinateSystem.getRect(),s={};return t=t||[0,0],"horizontal"===a.orient?(s.pixel=e[0]-t[0],s.pixelLength=r.width,s.pixelStart=r.x,s.signal=a.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=r.height,s.pixelStart=r.y,s.signal=a.inverse?-1:1),s}};t.exports=l},function(t,e,i){var n=i(46);t.exports=n.extend({type:"dataZoom.select"})},function(t,e,i){t.exports=i(47).extend({type:"dataZoom.select"})},function(t,e,i){var n=i(46),o=n.extend({type:"dataZoom.slider",layoutMode:"box",defaultOption:{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#2f4554",width:.5,opacity:.3},areaStyle:{color:"rgba(47,69,84,0.3)",opacity:.3}},borderColor:"#ddd",fillerColor:"rgba(167,183,204,0.4)",handleIcon:"M8.2,13.6V3.9H6.3v9.7H3.1v14.9h3.3v9.7h1.8v-9.7h3.3V13.6H8.2z M9.7,24.4H4.8v-1.4h4.9V24.4z M9.7,19.1H4.8v-1.4h4.9V19.1z",handleSize:"100%",handleStyle:{color:"#a7b7cc"},labelPrecision:null,labelFormatter:null,showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#333"}}});t.exports=o},function(t,e,i){function n(t){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[t]}var o=i(1),a=i(3),r=i(37),s=i(47),l=a.Rect,u=i(4),c=u.linearMap,h=i(12),d=i(56),f=i(21),p=u.asc,g=o.bind,m=o.each,v=7,y=1,x=30,_="horizontal",b="vertical",w=5,S=["line","bar","candlestick","scatter"],M=s.extend({type:"dataZoom.slider",init:function(t,e){this._displayables={},this._orient,this._range,this._handleEnds,this._size,this._handleWidth,this._handleHeight,this._location,this._dragging,this._dataShadowInfo,this.api=e},render:function(t,e,i,n){return M.superApply(this,"render",arguments),r.createOrUpdate(this,"_dispatchZoomAction",this.dataZoomModel.get("throttle"),"fixRate"),this._orient=t.get("orient"),this.dataZoomModel.get("show")===!1?void this.group.removeAll():(n&&"dataZoom"===n.type&&n.from===this.uid||this._buildView(),void this._updateView())},remove:function(){M.superApply(this,"remove",arguments),r.clear(this,"_dispatchZoomAction")},dispose:function(){M.superApply(this,"dispose",arguments),r.clear(this,"_dispatchZoomAction")},_buildView:function(){var t=this.group;t.removeAll(),this._resetLocation(),this._resetInterval();var e=this._displayables.barGroup=new a.Group;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(e),this._positionGroup()},_resetLocation:function(){var t=this.dataZoomModel,e=this.api,i=this._findCoordRect(),n={width:e.getWidth(),height:e.getHeight()},a=this._orient===_?{right:n.width-i.x-i.width,top:n.height-x-v,width:i.width,height:x}:{right:v,top:i.y,width:x,height:i.height},r=h.getLayoutParams(t.option);o.each(["right","top","width","height"],function(t){"ph"===r[t]&&(r[t]=a[t])});var s=h.getLayoutRect(r,n,t.padding);this._location={x:s.x,y:s.y},this._size=[s.width,s.height],this._orient===b&&this._size.reverse()},_positionGroup:function(){var t=this.group,e=this._location,i=this._orient,n=this.dataZoomModel.getFirstTargetAxisModel(),o=n&&n.get("inverse"),a=this._displayables.barGroup,r=(this._dataShadowInfo||{}).otherAxisInverse;a.attr(i!==_||o?i===_&&o?{scale:r?[-1,1]:[-1,-1]}:i!==b||o?{scale:r?[-1,-1]:[-1,1],rotation:Math.PI/2}:{scale:r?[1,-1]:[1,1],rotation:Math.PI/2}:{scale:r?[1,1]:[1,-1]});var s=t.getBoundingRect([a]);t.attr("position",[e.x-s.x,e.y-s.y])},_getViewExtent:function(){return[0,this._size[0]]},_renderBackground:function(){var t=this.dataZoomModel,e=this._size,i=this._displayables.barGroup;i.add(new l({silent:!0,shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:t.get("backgroundColor")},z2:-40})),i.add(new l({shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:"transparent"},z2:0,onclick:o.bind(this._onClickPanelClick,this)}))},_renderDataShadow:function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(t){var e=this._size,i=t.series,n=i.getRawData(),r=i.getShadowDim?i.getShadowDim():t.otherDim;if(null!=r){var s=n.getDataExtent(r),l=.3*(s[1]-s[0]);s=[s[0]-l,s[1]+l];var u,h=[0,e[1]],d=[0,e[0]],f=[[e[0],0],[0,0]],p=[],g=d[1]/(n.count()-1),m=0,v=Math.round(n.count()/e[0]);n.each([r],function(t,e){if(v>0&&e%v)return void(m+=g);var i=null==t||isNaN(t)||""===t,n=i?0:c(t,s,h,!0);i&&!u&&e?(f.push([f[f.length-1][0],0]),p.push([p[p.length-1][0],0])):!i&&u&&(f.push([m,0]),p.push([m,0])),f.push([m,n]),p.push([m,n]),m+=g,u=i});var y=this.dataZoomModel;this._displayables.barGroup.add(new a.Polygon({shape:{points:f},style:o.defaults({fill:y.get("dataBackgroundColor")},y.getModel("dataBackground.areaStyle").getAreaStyle()),silent:!0,z2:-20})),this._displayables.barGroup.add(new a.Polyline({shape:{points:p},style:y.getModel("dataBackground.lineStyle").getLineStyle(),silent:!0,z2:-19}))}}},_prepareDataShadowInfo:function(){var t=this.dataZoomModel,e=t.get("showDataShadow");if(e!==!1){var i,a=this.ecModel;return t.eachTargetAxis(function(r,s){var l=t.getAxisProxy(r.name,s).getTargetSeriesModels();o.each(l,function(t){if(!(i||e!==!0&&o.indexOf(S,t.get("type"))<0)){var l,u=a.getComponent(r.axis,s).axis,c=n(r.name),h=t.coordinateSystem;null!=c&&h.getOtherAxis&&(l=h.getOtherAxis(u).inverse),i={thisAxis:u,series:t,thisDim:r.name,otherDim:c,otherAxisInverse:l}}},this)},this),i}},_renderHandle:function(){var t=this._displayables,e=t.handles=[],i=t.handleLabels=[],n=this._displayables.barGroup,o=this._size,r=this.dataZoomModel;n.add(t.filler=new l({draggable:!0,cursor:"move",drift:g(this._onDragMove,this,"all"),onmousemove:function(t){f.stop(t.event)},ondragstart:g(this._showDataInfo,this,!0),ondragend:g(this._onDragEnd,this),onmouseover:g(this._showDataInfo,this,!0),onmouseout:g(this._showDataInfo,this,!1),style:{fill:r.get("fillerColor"),textPosition:"inside"}})),n.add(new l(a.subPixelOptimizeRect({silent:!0,shape:{x:0,y:0,width:o[0],height:o[1]},style:{stroke:r.get("dataBackgroundColor")||r.get("borderColor"),lineWidth:y,fill:"rgba(0,0,0,0)"}})));var s=r.get("handleIcon");m([0,1],function(t){var o={style:{strokeNoScale:!0},rectHover:!0,cursor:"vertical"===this._orient?"ns-resize":"ew-resize",draggable:!0,drift:g(this._onDragMove,this,t),onmousemove:function(t){f.stop(t.event)},ondragend:g(this._onDragEnd,this),onmouseover:g(this._showDataInfo,this,!0),onmouseout:g(this._showDataInfo,this,!1)},l={x:-1,y:0,width:2,height:2},c=0===s.indexOf("image://")?(l.image=s.slice(8),o.style=l,new a.Image(o)):a.makePath(s.replace("path://",""),o,l,"center"),h=c.getBoundingRect();this._handleHeight=u.parsePercent(r.get("handleSize"),this._size[1]),this._handleWidth=h.width/h.height*this._handleHeight,c.setStyle(r.getModel("handleStyle").getItemStyle());var d=r.get("handleColor");null!=d&&(c.style.fill=d),n.add(e[t]=c);var p=r.textStyleModel;this.group.add(i[t]=new a.Text({silent:!0,invisible:!0,style:{x:0,y:0,text:"",textVerticalAlign:"middle",textAlign:"center",fill:p.getTextColor(),textFont:p.getFont()},z2:10}))},this)},_resetInterval:function(){var t=this._range=this.dataZoomModel.getPercentRange(),e=this._getViewExtent();this._handleEnds=[c(t[0],[0,100],e,!0),c(t[1],[0,100],e,!0)]},_updateInterval:function(t,e){var i=this.dataZoomModel,n=this._handleEnds,o=this._getViewExtent(),a=i.findRepresentativeAxisProxy().getMinMaxSpan(),r=[0,100];d(e,n,o,i.get("zoomLock")?"all":t,null!=a.minSpan?c(a.minSpan,r,o,!0):null,null!=a.maxSpan?c(a.maxSpan,r,o,!0):null),this._range=p([c(n[0],o,r,!0),c(n[1],o,r,!0)])},_updateView:function(t){var e=this._displayables,i=this._handleEnds,n=p(i.slice()),o=this._size;m([0,1],function(t){var n=e.handles[t],a=this._handleHeight;n.attr({scale:[a/2,a/2],position:[i[t],o[1]/2-a/2]})},this),e.filler.setShape({x:n[0],y:0,width:n[1]-n[0],height:o[1]}),this._updateDataInfo(t)},_updateDataInfo:function(t){function e(t){var e=a.getTransform(n.handles[t].parent,this.group),i=a.transformDirection(0===t?"right":"left",e),l=this._handleWidth/2+w,u=a.applyTransform([d[t]+(0===t?-l:l),this._size[1]/2],e);o[t].setStyle({x:u[0],y:u[1],textVerticalAlign:r===_?"middle":i,textAlign:r===_?i:"center",text:s[t]})}var i=this.dataZoomModel,n=this._displayables,o=n.handleLabels,r=this._orient,s=["",""];if(i.get("showDetail")){var l=i.findRepresentativeAxisProxy();if(l){var u=l.getAxisModel().axis,c=this._range,h=t?l.calculateDataWindow({start:c[0],end:c[1]}).valueWindow:l.getDataValueWindow();s=[this._formatLabel(h[0],u),this._formatLabel(h[1],u)]}}var d=p(this._handleEnds.slice());e.call(this,0),e.call(this,1)},_formatLabel:function(t,e){var i=this.dataZoomModel,n=i.get("labelFormatter"),a=i.get("labelPrecision");null!=a&&"auto"!==a||(a=e.getPixelPrecision());var r=null==t||isNaN(t)?"":"category"===e.type||"time"===e.type?e.scale.getLabel(Math.round(t)):t.toFixed(Math.min(a,20));return o.isFunction(n)?n(t,r):o.isString(n)?n.replace("{value}",r):r},_showDataInfo:function(t){t=this._dragging||t;var e=this._displayables.handleLabels;e[0].attr("invisible",!t),e[1].attr("invisible",!t)},_onDragMove:function(t,e,i){this._dragging=!0;var n=this._displayables.barGroup.getLocalTransform(),o=a.applyTransform([e,i],n,!0);this._updateInterval(t,o[0]);var r=this.dataZoomModel.get("realtime");this._updateView(!r),r&&r&&this._dispatchZoomAction()},_onDragEnd:function(){this._dragging=!1,this._showDataInfo(!1),this._dispatchZoomAction()},_onClickPanelClick:function(t){var e=this._size,i=this._displayables.barGroup.transformCoordToLocal(t.offsetX,t.offsetY);if(!(i[0]<0||i[0]>e[0]||i[1]<0||i[1]>e[1])){var n=this._handleEnds,o=(n[0]+n[1])/2;this._updateInterval("all",i[0]-o),this._updateView(),this._dispatchZoomAction()}},_dispatchZoomAction:function(){var t=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,start:t[0],end:t[1]})},_findCoordRect:function(){var t;if(m(this.getTargetCoordInfo(),function(e){if(!t&&e.length){var i=e[0].model.coordinateSystem;t=i.getRect&&i.getRect()}}),!t){var e=this.api.getWidth(),i=this.api.getHeight();t={x:.2*e,y:.2*i,width:.6*e,height:.6*i}}return t}});t.exports=M},function(t,e,i){function n(t){var e=t.getZr();return e[g]||(e[g]={})}function o(t,e){var i=new d(t.getZr());return i.on("pan",p(r,e)),i.on("zoom",p(s,e)),i}function a(t){h.each(t,function(e,i){e.count||(e.controller.dispose(),delete t[i])})}function r(t,e,i,n,o,a,r){l(t,function(s){return s.panGetRange(t.controller,e,i,n,o,a,r)})}function s(t,e,i,n){l(t,function(o){return o.zoomGetRange(t.controller,e,i,n)})}function l(t,e){var i=[];h.each(t.dataZoomInfos,function(t){var n=e(t);!t.disabled&&n&&i.push({dataZoomId:t.dataZoomId,start:n[0],end:n[1]})}),t.dispatchAction(i)}function u(t,e){t.dispatchAction({type:"dataZoom",batch:e})}function c(t){var e,i={},n={true:2,move:1,false:0,undefined:-1};return h.each(t,function(t){var o=!t.disabled&&(!t.zoomLock||"move");n[o]>n[e]&&(e=o),h.extend(i,t.roamControllerOpt)}),{controlType:e,opt:i}}var h=i(1),d=i(95),f=i(37),p=h.curry,g="\0_ec_dataZoom_roams",m={register:function(t,e){var i=n(t),r=e.dataZoomId,s=e.coordId;h.each(i,function(t,i){var n=t.dataZoomInfos;n[r]&&h.indexOf(e.allCoordIds,s)<0&&(delete n[r],t.count--)}),a(i);var l=i[s];l||(l=i[s]={coordId:s,dataZoomInfos:{},count:0},l.controller=o(t,l),l.dispatchAction=h.curry(u,t)),!l.dataZoomInfos[r]&&l.count++,l.dataZoomInfos[r]=e;var d=c(l.dataZoomInfos);l.controller.enable(d.controlType,d.opt),l.controller.setPointerChecker(e.containsPoint),f.createOrUpdate(l,"dispatchAction",e.throttleRate,"fixRate")},unregister:function(t,e){var i=n(t);h.each(i,function(t){t.controller.dispose();var i=t.dataZoomInfos;i[e]&&(delete i[e],t.count--)}),a(i)},shouldRecordRange:function(t,e){if(t&&"dataZoom"===t.type&&t.batch)for(var i=0,n=t.batch.length;i<n;i++)if(t.batch[i].dataZoomId===e)return!1;return!0},generateCoordId:function(t){return t.type+"\0_"+t.id}};t.exports=m},function(t,e,i){i(126),i(46),i(47),i(201),i(202),i(124),i(123)},function(t,e,i){function n(t,e,i,n){var o=i.type,a=f[o.charAt(0).toUpperCase()+o.slice(1)],r=new a(i);e.add(r),n.set(t,r),r.__ecGraphicId=t}function o(t,e){var i=t&&t.parent;i&&("group"===t.type&&t.traverse(function(t){o(t,e)}),e.removeKey(t.__ecGraphicId),i.remove(t))}function a(t){return t=h.extend({},t),h.each(["id","parentId","$action","hv","bounding"].concat(p.LOCATION_PARAMS),function(e){delete t[e]}),t}function r(t,e){var i;return h.each(e,function(e){null!=t[e]&&"auto"!==t[e]&&(i=!0)}),i}function s(t,e){var i=t.exist;if(e.id=t.keyInfo.id,!e.type&&i&&(e.type=i.type),null==e.parentId){var n=e.parentOption;n?e.parentId=n.id:i&&(e.parentId=i.parentId)}e.parentOption=null}function l(t,e,i){var n=h.extend({},i),o=t[e],a=i.$action||"merge";if("merge"===a)if(o){h.merge(o,n,!0),p.mergeLayoutParam(o,n,{ignoreSize:!0}),p.copyLayoutParams(i,o)}else t[e]=n;else"replace"===a?t[e]=n:"remove"===a&&o&&(t[e]=null)}function u(t,e){t&&(t.hv=e.hv=[r(e,["left","right"]),r(e,["top","bottom"])],"group"===t.type&&(null==t.width&&(t.width=e.width=0),null==t.height&&(t.height=e.height=0)))}var c=i(2),h=i(1),d=i(5),f=i(3),p=i(12);c.registerPreprocessor(function(t){var e=t.graphic;h.isArray(e)?e[0]&&e[0].elements?t.graphic=[t.graphic[0]]:t.graphic=[{elements:e}]:e&&!e.elements&&(t.graphic=[{elements:[e]}])});var g=c.extendComponentModel({type:"graphic",defaultOption:{elements:[],parentId:null},_elOptionsToUpdate:null,mergeOption:function(t){var e=this.option.elements;this.option.elements=null,g.superApply(this,"mergeOption",arguments),this.option.elements=e},optionUpdated:function(t,e){var i=this.option,n=(e?i:t).elements,o=i.elements=e?[]:i.elements,a=[];this._flatten(n,a);var r=d.mappingToExists(o,a);d.makeIdAndName(r);var c=this._elOptionsToUpdate=[];h.each(r,function(t,e){var i=t.option;i&&(c.push(i),s(t,i),l(o,e,i),u(o[e],i))},this);for(var f=o.length-1;f>=0;f--)null==o[f]?o.splice(f,1):delete o[f].$action},_flatten:function(t,e,i){h.each(t,function(t){if(t){i&&(t.parentOption=i),e.push(t);var n=t.children;"group"===t.type&&n&&this._flatten(n,e,t),delete t.children}},this)},useElOptionsToUpdate:function(){var t=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,t}});c.extendComponentView({type:"graphic",init:function(t,e){this._elMap=h.createHashMap(),this._lastGraphicModel},render:function(t,e,i){t!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=t,this._updateElements(t,i),this._relocate(t,i)},_updateElements:function(t,e){var i=t.useElOptionsToUpdate();if(i){var r=this._elMap,s=this.group;h.each(i,function(t){var e=t.$action,i=t.id,l=r.get(i),u=t.parentId,c=null!=u?r.get(u):s;t.hv&&t.hv[1]&&"text"===t.type&&(t.style=h.defaults({textBaseline:"middle"},t.style),t.style.textVerticalAlign=null);var d=a(t);e&&"merge"!==e?"replace"===e?(o(l,r),n(i,c,d,r)):"remove"===e&&o(l,r):l?l.attr(d):n(i,c,d,r);var f=r.get(i);f&&(f.__ecGraphicWidth=t.width,f.__ecGraphicHeight=t.height)})}},_relocate:function(t,e){for(var i=t.option.elements,n=this.group,o=this._elMap,a=i.length-1;a>=0;a--){var r=i[a],s=o.get(r.id);if(s){var l=s.parent,u=l===n?{width:e.getWidth(),height:e.getHeight()}:{width:l.__ecGraphicWidth||0,height:l.__ecGraphicHeight||0};p.positionElement(s,r,u,null,{hv:r.hv,boundingMode:r.bounding})}}},_clear:function(){var t=this._elMap;t.each(function(e){o(e,t)}),this._elMap=h.createHashMap()},dispose:function(){this._clear()}})},function(t,e,i){i(32),i(120),i(55)},function(t,e,i){i(210),i(212),i(211);var n=i(2);n.registerProcessor(i(213))},function(t,e,i){"use strict";var n=i(1),o=i(10),a=i(2).extendComponentModel({type:"legend",dependencies:["series"],layoutMode:{type:"box",ignoreSize:!0},init:function(t,e,i){this.mergeDefaultAndTheme(t,i),t.selected=t.selected||{}},mergeOption:function(t){a.superCall(this,"mergeOption",t)},optionUpdated:function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&"single"===this.get("selectedMode")){for(var e=!1,i=0;i<t.length;i++){var n=t[i].get("name");if(this.isSelected(n)){this.select(n),e=!0;break}}!e&&this.select(t[0].get("name"))}},_updateData:function(t){var e=n.map(this.get("data")||[],function(t){return"string"!=typeof t&&"number"!=typeof t||(t={name:t}),new o(t,this,this.ecModel)},this);this._data=e;var i=n.map(t.getSeries(),function(t){return t.name});t.eachSeries(function(t){if(t.legendDataProvider){var e=t.legendDataProvider();i=i.concat(e.mapArray(e.getName))}}),this._availableNames=i},getData:function(){return this._data},select:function(t){var e=this.option.selected,i=this.get("selectedMode");if("single"===i){var o=this._data;n.each(o,function(t){e[t.get("name")]=!1})}e[t]=!0},unSelect:function(t){"single"!==this.get("selectedMode")&&(this.option.selected[t]=!1)},toggleSelected:function(t){var e=this.option.selected;e.hasOwnProperty(t)||(e[t]=!0),this[e[t]?"unSelect":"select"](t)},isSelected:function(t){var e=this.option.selected;return!(e.hasOwnProperty(t)&&!e[t])&&n.indexOf(this._availableNames,t)>=0},defaultOption:{zlevel:0,z:4,show:!0,orient:"horizontal",left:"center",top:"top",align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,inactiveColor:"#ccc",textStyle:{color:"#333"},selectedMode:!0,tooltip:{show:!1}}});t.exports=a},function(t,e,i){function n(t,e){e.dispatchAction({type:"legendToggleSelect",name:t})}function o(t,e,i){var n=i.getZr().storage.getDisplayList()[0];n&&n.useHoverLayer||t.get("legendHoverLink")&&i.dispatchAction({type:"highlight",seriesName:t.name,name:e})}function a(t,e,i){var n=i.getZr().storage.getDisplayList()[0];n&&n.useHoverLayer||t.get("legendHoverLink")&&i.dispatchAction({type:"downplay",seriesName:t.name,name:e})}var r=i(1),s=i(24),l=i(3),u=i(130),c=r.curry;t.exports=i(2).extendComponentView({type:"legend",init:function(){this._symbolTypeStore={}},render:function(t,e,i){var s=this.group;if(s.removeAll(),t.get("show")){var h=t.get("selectedMode"),d=t.get("align");"auto"===d&&(d="right"===t.get("left")&&"vertical"===t.get("orient")?"right":"left");var f=r.createHashMap();r.each(t.getData(),function(r){var u=r.get("name");if(""===u||"\n"===u)return void s.add(new l.Group({newline:!0}));var p=e.getSeriesByName(u)[0];if(!f.get(u))if(p){var g=p.getData(),m=g.getVisual("color");"function"==typeof m&&(m=m(p.getDataParams(0)));var v=g.getVisual("legendSymbol")||"roundRect",y=g.getVisual("symbol"),x=this._createItem(u,r,t,v,y,d,m,h);x.on("click",c(n,u,i)).on("mouseover",c(o,p,null,i)).on("mouseout",c(a,p,null,i)),f.set(u,!0)}else e.eachRawSeries(function(e){if(!f.get(u)&&e.legendDataProvider){var s=e.legendDataProvider(),l=s.indexOfName(u);if(l<0)return;var p=s.getItemVisual(l,"color"),g="roundRect",m=this._createItem(u,r,t,g,null,d,p,h);m.on("click",c(n,u,i)).on("mouseover",c(o,e,u,i)).on("mouseout",c(a,e,u,i)),f.set(u,!0)}},this)},this),u.layout(s,t,i),u.addBackground(s,t)}},_createItem:function(t,e,i,n,o,a,u,c){var h=i.get("itemWidth"),d=i.get("itemHeight"),f=i.get("inactiveColor"),p=i.isSelected(t),g=new l.Group,m=e.getModel("textStyle"),v=e.get("icon"),y=e.getModel("tooltip"),x=y.parentModel;if(n=v||n,g.add(s.createSymbol(n,0,0,h,d,p?u:f)),!v&&o&&(o!==n||"none"==o)){var _=.8*d;"none"===o&&(o="circle"),g.add(s.createSymbol(o,(h-_)/2,(d-_)/2,_,_,p?u:f))}var b="left"===a?h+5:-5,w=a,S=i.get("formatter"),M=t;"string"==typeof S&&S?M=S.replace("{name}",null!=t?t:""):"function"==typeof S&&(M=S(t));var I=new l.Text({style:{text:M,x:b,y:d/2,fill:p?m.getTextColor():f,textFont:m.getFont(),textAlign:w,textVerticalAlign:"middle"}});g.add(I);var T=new l.Rect({shape:g.getBoundingRect(),invisible:!0,tooltip:y.get("show")?r.extend({content:t,formatter:x.get("formatter",!0)||function(){return t},formatterParams:{componentType:"legend",legendIndex:i.componentIndex,name:t,$vars:["name"]}},y.option):null});return g.add(T),g.eachChild(function(t){t.silent=!0}),T.silent=!c,this.group.add(g),l.setHoverStyle(g),g}})},function(t,e,i){function n(t,e,i){var n,o={},r="toggleSelected"===t;return i.eachComponent("legend",function(i){r&&null!=n?i[n?"select":"unSelect"](e.name):(i[t](e.name),n=i.isSelected(e.name));var s=i.getData();a.each(s,function(t){var e=t.get("name");if("\n"!==e&&""!==e){var n=i.isSelected(e);o.hasOwnProperty(e)?o[e]=o[e]&&n:o[e]=n}})}),{name:e.name,selected:o}}var o=i(2),a=i(1);o.registerAction("legendToggleSelect","legendselectchanged",a.curry(n,"toggleSelected")),o.registerAction("legendSelect","legendselected",a.curry(n,"select")),o.registerAction("legendUnSelect","legendunselected",a.curry(n,"unSelect"))},function(t,e){t.exports=function(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.filterSeries(function(t){for(var i=0;i<e.length;i++)if(!e[i].isSelected(t.name))return!1;return!0})}},function(t,e,i){i(217),i(218),i(2).registerPreprocessor(function(t){t.markArea=t.markArea||{}})},function(t,e,i){i(219),i(220),i(2).registerPreprocessor(function(t){t.markLine=t.markLine||{}})},function(t,e,i){i(221),i(222),i(2).registerPreprocessor(function(t){t.markPoint=t.markPoint||{}})},function(t,e,i){t.exports=i(79).extend({type:"markArea",defaultOption:{zlevel:0,z:1,tooltip:{trigger:"item"},animation:!1,label:{normal:{show:!0,position:"top"},emphasis:{show:!0,position:"top"}},itemStyle:{normal:{borderWidth:0}}}})},function(t,e,i){function n(t){return!isNaN(t)&&!isFinite(t)}function o(t,e,i,o){var a=1-t;return n(e[a])&&n(i[a])}function a(t,e){var i=e.coord[0],n=e.coord[1];return!("cartesian2d"!==t.type||!i||!n||!o(1,i,n,t)&&!o(0,i,n,t))||(f.dataFilter(t,{coord:i,x:e.x0,y:e.y0})||f.dataFilter(t,{coord:n,x:e.x1,y:e.y1}))}function r(t,e,i,o,a){var r,s=o.coordinateSystem,l=t.getItemModel(e),u=c.parsePercent(l.get(i[0]),a.getWidth()),h=c.parsePercent(l.get(i[1]),a.getHeight());if(isNaN(u)||isNaN(h)){if(o.getMarkerPosition)r=o.getMarkerPosition(t.getValues(i,e));else{var d=t.get(i[0],e),f=t.get(i[1],e);r=s.dataToPoint([d,f],!0)}if("cartesian2d"===s.type){var p=s.getAxis("x"),g=s.getAxis("y"),d=t.get(i[0],e),f=t.get(i[1],e);n(d)?r[0]=p.toGlobalCoord(p.getExtent()["x0"===i[0]?0:1]):n(f)&&(r[1]=g.toGlobalCoord(g.getExtent()["y0"===i[1]?0:1]))}isNaN(u)||(r[0]=u),isNaN(h)||(r[1]=h)}else r=[u,h];return r}function s(t,e,i){var n,o,r=["x0","y0","x1","y1"];t?(n=l.map(t&&t.dimensions,function(t){var i=e.getData().getDimensionInfo(e.coordDimToDataDim(t)[0])||{};return i.name=t,i}),o=new u(l.map(r,function(t,e){return{name:t,type:n[e%2].type}}),i)):(n=[{name:"value",type:"float"}],o=new u(n,i));var s=l.map(i.get("data"),l.curry(p,e,t,i));t&&(s=l.filter(s,l.curry(a,t)));var c=t?function(t,e,i,n){return t.coord[Math.floor(n/2)][n%2]}:function(t){return t.value};return o.initData(s,null,c),o.hasItemOption=!0,o}var l=i(1),u=i(14),c=i(4),h=i(3),d=i(22),f=i(81),p=function(t,e,i,n){var o=f.dataTransform(t,n[0]),a=f.dataTransform(t,n[1]),r=l.retrieve,s=o.coord,u=a.coord;s[0]=r(s[0],-(1/0)),s[1]=r(s[1],-(1/0)),u[0]=r(u[0],1/0),u[1]=r(u[1],1/0);var c=l.mergeAll([{},o,a]);return c.coord=[o.coord,a.coord],c.x0=o.x,c.y0=o.y,c.x1=a.x,c.y1=a.y,c},g=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]];i(80).extend({type:"markArea",updateLayout:function(t,e,i){e.eachSeries(function(t){var e=t.markAreaModel;if(e){var n=e.getData();n.each(function(e){var o=l.map(g,function(o){return r(n,e,o,t,i)});n.setItemLayout(e,o);var a=n.getItemGraphicEl(e);a.setShape("points",o)})}},this)},renderSeries:function(t,e,i,n){var o=t.coordinateSystem,a=t.name,u=t.getData(),c=this.markerGroupMap,f=c.get(a)||c.set(a,{group:new h.Group});this.group.add(f.group),f.__keep=!0;var p=s(o,t,e);e.setData(p),p.each(function(e){p.setItemLayout(e,l.map(g,function(i){return r(p,e,i,t,n)})),p.setItemVisual(e,{color:u.getVisual("color")})}),p.diff(f.__data).add(function(t){var e=new h.Polygon({shape:{points:p.getItemLayout(t)}});p.setItemGraphicEl(t,e),f.group.add(e)}).update(function(t,i){var n=f.__data.getItemGraphicEl(i);h.updateProps(n,{shape:{points:p.getItemLayout(t)}},e,t),f.group.add(n),p.setItemGraphicEl(t,n)}).remove(function(t){var e=f.__data.getItemGraphicEl(t);f.group.remove(e)}).execute(),p.eachItemGraphicEl(function(t,i){var n=p.getItemModel(i),o=n.getModel("label.normal"),a=n.getModel("label.emphasis"),r=p.getItemVisual(i,"color");t.useStyle(l.defaults(n.getModel("itemStyle.normal").getItemStyle(),{fill:d.modifyAlpha(r,.4),stroke:r})),t.hoverStyle=n.getModel("itemStyle.normal").getItemStyle();var s=p.getName(i)||"",u=r||t.style.fill;o.getShallow("show")?(h.setText(t.style,o,u),t.style.text=l.retrieve(e.getFormattedLabel(i,"normal"),s)):t.style.text="",a.getShallow("show")?(h.setText(t.hoverStyle,a,u),t.hoverStyle.text=l.retrieve(e.getFormattedLabel(i,"emphasis"),s)):t.hoverStyle.text="",h.setHoverStyle(t,{}),t.dataModel=e}),f.__data=p,f.group.silent=e.get("silent")||t.get("silent")}})},function(t,e,i){t.exports=i(79).extend({type:"markLine",defaultOption:{zlevel:0,z:5,symbol:["circle","arrow"],symbolSize:[8,16],precision:2,tooltip:{trigger:"item"},label:{normal:{show:!0,position:"end"},emphasis:{show:!0}},lineStyle:{normal:{type:"dashed"},emphasis:{width:3}},animationEasing:"linear"}})},function(t,e,i){function n(t){return!isNaN(t)&&!isFinite(t)}function o(t,e,i,o){var a=1-t,r=o.dimensions[t];return n(e[a])&&n(i[a])&&e[t]===i[t]&&o.getAxis(r).containData(e[t])}function a(t,e){if("cartesian2d"===t.type){var i=e[0].coord,n=e[1].coord;if(i&&n&&(o(1,i,n,t)||o(0,i,n,t)))return!0}return h.dataFilter(t,e[0])&&h.dataFilter(t,e[1])}function r(t,e,i,o,a){var r,s=o.coordinateSystem,l=t.getItemModel(e),u=c.parsePercent(l.get("x"),a.getWidth()),h=c.parsePercent(l.get("y"),a.getHeight());if(isNaN(u)||isNaN(h)){if(o.getMarkerPosition)r=o.getMarkerPosition(t.getValues(t.dimensions,e));else{var d=s.dimensions,f=t.get(d[0],e),p=t.get(d[1],e);r=s.dataToPoint([f,p])}if("cartesian2d"===s.type){var g=s.getAxis("x"),m=s.getAxis("y"),d=s.dimensions;n(t.get(d[0],e))?r[0]=g.toGlobalCoord(g.getExtent()[i?0:1]):n(t.get(d[1],e))&&(r[1]=m.toGlobalCoord(m.getExtent()[i?0:1]))}isNaN(u)||(r[0]=u),isNaN(h)||(r[1]=h)}else r=[u,h];t.setItemLayout(e,r)}function s(t,e,i){var n;n=t?l.map(t&&t.dimensions,function(t){var i=e.getData().getDimensionInfo(e.coordDimToDataDim(t)[0])||{};return i.name=t,i}):[{name:"value",type:"float"}];var o=new u(n,i),r=new u(n,i),s=new u([],i),c=l.map(i.get("data"),l.curry(f,e,t,i));t&&(c=l.filter(c,l.curry(a,t)));var d=t?h.dimValueGetter:function(t){return t.value};return o.initData(l.map(c,function(t){return t[0]}),null,d),r.initData(l.map(c,function(t){return t[1]}),null,d),s.initData(l.map(c,function(t){return t[2]})),s.hasItemOption=!0,{from:o,to:r,line:s}}var l=i(1),u=i(14),c=i(4),h=i(81),d=i(107),f=function(t,e,i,n){var o=t.getData(),a=n.type;if(!l.isArray(n)&&("min"===a||"max"===a||"average"===a||null!=n.xAxis||null!=n.yAxis)){var r,s,u;if(null!=n.yAxis||null!=n.xAxis)s=null!=n.yAxis?"y":"x",r=e.getAxis(s),u=l.retrieve(n.yAxis,n.xAxis);else{var c=h.getAxisInfo(n,o,e,t);s=c.valueDataDim,r=c.valueAxis,u=h.numCalculate(o,s,a)}var d="x"===s?0:1,f=1-d,p=l.clone(n),g={};p.type=null,p.coord=[],g.coord=[],p.coord[f]=-(1/0),g.coord[f]=1/0;var m=i.get("precision");m>=0&&"number"==typeof u&&(u=+u.toFixed(m)),p.coord[d]=g.coord[d]=u,n=[p,g,{type:a,valueIndex:n.valueIndex,value:u}]}return n=[h.dataTransform(t,n[0]),h.dataTransform(t,n[1]),l.extend({},n[2])],n[2].type=n[2].type||"",l.merge(n[2],n[0]),l.merge(n[2],n[1]),n};i(80).extend({type:"markLine",updateLayout:function(t,e,i){e.eachSeries(function(t){var e=t.markLineModel;if(e){var n=e.getData(),o=e.__from,a=e.__to;o.each(function(e){r(o,e,!0,t,i),r(a,e,!1,t,i)}),n.each(function(t){n.setItemLayout(t,[o.getItemLayout(t),a.getItemLayout(t)])}),this.markerGroupMap.get(t.id).updateLayout()}},this)},renderSeries:function(t,e,i,n){function o(e,i,o){var a=e.getItemModel(i);r(e,i,o,t,n),e.setItemVisual(i,{symbolSize:a.get("symbolSize")||x[o?0:1],symbol:a.get("symbol",!0)||y[o?0:1],color:a.get("itemStyle.normal.color")||c.getVisual("color")})}var a=t.coordinateSystem,u=t.id,c=t.getData(),h=this.markerGroupMap,f=h.get(u)||h.set(u,new d);this.group.add(f.group);var p=s(a,t,e),g=p.from,m=p.to,v=p.line;e.__from=g,e.__to=m,e.setData(v);var y=e.get("symbol"),x=e.get("symbolSize");l.isArray(y)||(y=[y,y]),"number"==typeof x&&(x=[x,x]),p.from.each(function(t){o(g,t,!0),o(m,t,!1)}),v.each(function(t){var e=v.getItemModel(t).get("lineStyle.normal.color");v.setItemVisual(t,{color:e||g.getItemVisual(t,"color")}),v.setItemLayout(t,[g.getItemLayout(t),m.getItemLayout(t)]),v.setItemVisual(t,{fromSymbolSize:g.getItemVisual(t,"symbolSize"),fromSymbol:g.getItemVisual(t,"symbol"),toSymbolSize:m.getItemVisual(t,"symbolSize"),toSymbol:m.getItemVisual(t,"symbol")})}),f.updateData(v),p.line.eachItemGraphicEl(function(t,i){t.traverse(function(t){t.dataModel=e})}),f.__keep=!0,f.group.silent=e.get("silent")||t.get("silent")}})},function(t,e,i){t.exports=i(79).extend({type:"markPoint",defaultOption:{zlevel:0,z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{normal:{show:!0,position:"inside"},emphasis:{show:!0}},itemStyle:{normal:{borderWidth:2}}}})},function(t,e,i){function n(t,e,i){var n=e.coordinateSystem;t.each(function(o){var a,r=t.getItemModel(o),l=s.parsePercent(r.get("x"),i.getWidth()),u=s.parsePercent(r.get("y"),i.getHeight());if(isNaN(l)||isNaN(u)){if(e.getMarkerPosition)a=e.getMarkerPosition(t.getValues(t.dimensions,o));else if(n){var c=t.get(n.dimensions[0],o),h=t.get(n.dimensions[1],o);a=n.dataToPoint([c,h])}}else a=[l,u];isNaN(l)||(a[0]=l),isNaN(u)||(a[1]=u),t.setItemLayout(o,a)})}function o(t,e,i){var n;n=t?r.map(t&&t.dimensions,function(t){var i=e.getData().getDimensionInfo(e.coordDimToDataDim(t)[0])||{};return i.name=t,i}):[{name:"value",type:"float"}];var o=new l(n,i),a=r.map(i.get("data"),r.curry(u.dataTransform,e));return t&&(a=r.filter(a,r.curry(u.dataFilter,t))),o.initData(a,null,t?u.dimValueGetter:function(t){return t.value}),o}var a=i(44),r=i(1),s=i(4),l=i(14),u=i(81);i(80).extend({type:"markPoint",updateLayout:function(t,e,i){e.eachSeries(function(t){var e=t.markPointModel;e&&(n(e.getData(),t,i),this.markerGroupMap.get(t.id).updateLayout(e))},this)},renderSeries:function(t,e,i,r){var s=t.coordinateSystem,l=t.id,u=t.getData(),c=this.markerGroupMap,h=c.get(l)||c.set(l,new a),d=o(s,t,e);e.setData(d),n(e.getData(),t,r),d.each(function(t){var i=d.getItemModel(t),n=i.getShallow("symbolSize");"function"==typeof n&&(n=n(e.getRawValue(t),e.getDataParams(t))),d.setItemVisual(t,{symbolSize:n,color:i.get("itemStyle.normal.color")||u.getVisual("color"),symbol:i.getShallow("symbol")})}),h.updateData(d),this.group.add(h.group),d.eachItemGraphicEl(function(t){t.traverse(function(t){t.dataModel=e})}),h.__keep=!0,h.group.silent=e.get("silent")||t.get("silent")}})},function(t,e,i){"use strict";var n=i(2),o=i(3),a=i(12);n.extendComponentModel({type:"title",layoutMode:{type:"box",ignoreSize:!0},defaultOption:{zlevel:0,z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bolder",color:"#333"},subtextStyle:{color:"#aaa"}}}),n.extendComponentView({type:"title",render:function(t,e,i){if(this.group.removeAll(),t.get("show")){var n=this.group,r=t.getModel("textStyle"),s=t.getModel("subtextStyle"),l=t.get("textAlign"),u=t.get("textBaseline"),c=new o.Text({style:{text:t.get("text"),textFont:r.getFont(),fill:r.getTextColor()},z2:10}),h=c.getBoundingRect(),d=t.get("subtext"),f=new o.Text({style:{text:d,textFont:s.getFont(),fill:s.getTextColor(),y:h.height+t.get("itemGap"),textBaseline:"top"},z2:10}),p=t.get("link"),g=t.get("sublink");c.silent=!p,f.silent=!g,p&&c.on("click",function(){window.open(p,"_"+t.get("target"))}),g&&f.on("click",function(){window.open(g,"_"+t.get("subtarget"))}),n.add(c),d&&n.add(f);var m=n.getBoundingRect(),v=t.getBoxLayoutParams();v.width=m.width,v.height=m.height;var y=a.getLayoutRect(v,{width:i.getWidth(),height:i.getHeight()},t.get("padding"));l||(l=t.get("left")||t.get("right"),"middle"===l&&(l="center"),"right"===l?y.x+=y.width:"center"===l&&(y.x+=y.width/2)),u||(u=t.get("top")||t.get("bottom"),"center"===u&&(u="middle"),"bottom"===u?y.y+=y.height:"middle"===u&&(y.y+=y.height/2),u=u||"top"),n.attr("position",[y.x,y.y]);var x={textAlign:l,textVerticalAlign:u};c.setStyle(x),f.setStyle(x),m=n.getBoundingRect();var _=y.margin,b=t.getItemStyle(["color","opacity"]);b.fill=t.get("backgroundColor");var w=new o.Rect({shape:{x:m.x-_[3],y:m.y-_[0],width:m.width+_[1]+_[3],height:m.height+_[0]+_[2]},style:b,silent:!0});o.subPixelOptimizeRect(w),n.add(w)}}})},function(t,e,i){i(225),i(226),i(231),i(229),i(227),i(228),i(230)},function(t,e,i){var n=i(29),o=i(1),a=i(2).extendComponentModel({type:"toolbox",layoutMode:{type:"box",ignoreSize:!0},mergeDefaultAndTheme:function(t){a.superApply(this,"mergeDefaultAndTheme",arguments),o.each(this.option.feature,function(t,e){var i=n.get(e);i&&o.merge(t,i.defaultOption)})},defaultOption:{show:!0,z:6,zlevel:0,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{normal:{borderColor:"#666",color:"none"},emphasis:{borderColor:"#3E98C5"}}}});t.exports=a},function(t,e,i){(function(e){function n(t){return 0===t.indexOf("my")}var o=i(29),a=i(1),r=i(3),s=i(10),l=i(48),u=i(130),c=i(16);t.exports=i(2).extendComponentView({type:"toolbox",render:function(t,e,i,h){function d(a,r){var l,u=y[a],c=y[r],d=m[u],p=new s(d,t,t.ecModel);if(u&&!c){if(n(u))l={model:p,onclick:p.option.onclick,featureName:u};else{var g=o.get(u);if(!g)return;l=new g(p,e,i)}v[u]=l}else{if(l=v[c],!l)return;l.model=p,l.ecModel=e,l.api=i}return!u&&c?void(l.dispose&&l.dispose(e,i)):!p.get("show")||l.unusable?void(l.remove&&l.remove(e,i)):(f(p,l,u),p.setIconStatus=function(t,e){var i=this.option,n=this.iconPaths;i.iconStatus=i.iconStatus||{},i.iconStatus[t]=e,n[t]&&n[t].trigger(e)},void(l.render&&l.render(p,e,i,h)))}function f(n,o,s){var l=n.getModel("iconStyle"),u=o.getIcons?o.getIcons():n.get("icon"),c=n.get("title")||{};if("string"==typeof u){var h=u,d=c;u={},c={},u[s]=h,c[s]=d}var f=n.iconPaths={};a.each(u,function(s,u){var h=l.getModel("normal").getItemStyle(),d=l.getModel("emphasis").getItemStyle(),m={x:-g/2,y:-g/2,width:g,height:g},v=0===s.indexOf("image://")?(m.image=s.slice(8),new r.Image({style:m})):r.makePath(s.replace("path://",""),{style:h,hoverStyle:d,rectHover:!0},m,"center");r.setHoverStyle(v),t.get("showTitle")&&(v.__title=c[u],v.on("mouseover",function(){var t=l.getModel("emphasis").getItemStyle();v.setStyle({text:c[u],textPosition:t.textPosition||"bottom",textFill:t.fill||t.stroke||"#000",textAlign:t.textAlign||"center"})}).on("mouseout",function(){v.setStyle({textFill:null})})),v.trigger(n.get("iconStatus."+u)||"normal"),p.add(v),v.on("click",a.bind(o.onclick,o,e,i,u)),f[u]=v})}var p=this.group;if(p.removeAll(),t.get("show")){var g=+t.get("itemSize"),m=t.get("feature")||{},v=this._features||(this._features={}),y=[];a.each(m,function(t,e){y.push(e)}),new l(this._featureNames||[],y).add(d).update(d).remove(a.curry(d,null)).execute(),this._featureNames=y,u.layout(p,t,i),u.addBackground(p,t),p.eachChild(function(t){var e=t.__title,n=t.hoverStyle;if(n&&e){var o=c.getBoundingRect(e,n.font),a=t.position[0]+p.position[0],r=t.position[1]+p.position[1]+g,s=!1;r+o.height>i.getHeight()&&(n.textPosition="top",s=!0);var l=s?-5-o.height:g+8;a+o.width/2>i.getWidth()?(n.textPosition=["100%",l],n.textAlign="right"):a-o.width/2<0&&(n.textPosition=[0,l],n.textAlign="left")}})}},updateView:function(t,e,i,n){a.each(this._features,function(t){t.updateView&&t.updateView(t.model,e,i,n)})},updateLayout:function(t,e,i,n){a.each(this._features,function(t){t.updateLayout&&t.updateLayout(t.model,e,i,n)})},remove:function(t,e){a.each(this._features,function(i){i.remove&&i.remove(t,e)}),this.group.removeAll()},dispose:function(t,e){a.each(this._features,function(i){i.dispose&&i.dispose(t,e)})}})}).call(e,i(188))},function(t,e,i){function n(t){var e={},i=[],n=[];return t.eachRawSeries(function(t){var o=t.coordinateSystem;if(!o||"cartesian2d"!==o.type&&"polar"!==o.type)i.push(t);else{var a=o.getBaseAxis();if("category"===a.type){var r=a.dim+"_"+a.index;e[r]||(e[r]={categoryAxis:a,valueAxis:o.getOtherAxis(a),series:[]},n.push({axisDim:a.dim,axisIndex:a.index})),e[r].series.push(t)}else i.push(t)}}),{seriesGroupByCategoryAxis:e,other:i,meta:n}}function o(t){var e=[];return p.each(t,function(t,i){var n=t.categoryAxis,o=t.valueAxis,a=o.dim,r=[" "].concat(p.map(t.series,function(t){return t.name})),s=[n.model.getCategories()];p.each(t.series,function(t){s.push(t.getRawData().mapArray(a,function(t){return t}))});for(var l=[r.join(v)],u=0;u<s[0].length;u++){for(var c=[],h=0;h<s.length;h++)c.push(s[h][u]);l.push(c.join(v))}e.push(l.join("\n"))}),e.join("\n\n"+m+"\n\n")}function a(t){return p.map(t,function(t){var e=t.getRawData(),i=[t.name],n=[];return e.each(e.dimensions,function(){for(var t=arguments.length,o=arguments[t-1],a=e.getName(o),r=0;r<t-1;r++)n[r]=arguments[r];i.push((a?a+v:"")+n.join(v))}),i.join("\n")}).join("\n\n"+m+"\n\n")}function r(t){var e=n(t);return{value:p.filter([o(e.seriesGroupByCategoryAxis),a(e.other)],function(t){return t.replace(/[\n\t\s]/g,"")}).join("\n\n"+m+"\n\n"),meta:e.meta}}function s(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function l(t){var e=t.slice(0,t.indexOf("\n"));if(e.indexOf(v)>=0)return!0}function u(t){for(var e=t.split(/\n+/g),i=s(e.shift()).split(y),n=[],o=p.map(i,function(t){return{name:t,data:[]}}),a=0;a<e.length;a++){var r=s(e[a]).split(y);n.push(r.shift());for(var l=0;l<r.length;l++)o[l]&&(o[l].data[a]=r[l])}return{series:o,categories:n}}function c(t){for(var e=t.split(/\n+/g),i=s(e.shift()),n=[],o=0;o<e.length;o++){var a,r=s(e[o]).split(y),l="",u=!1;isNaN(r[0])?(u=!0,l=r[0],r=r.slice(1),n[o]={name:l,value:[]},a=n[o].value):a=n[o]=[];for(var c=0;c<r.length;c++)a.push(+r[c]);1===a.length&&(u?n[o].value=a[0]:n[o]=a[0])}return{name:i,data:n}}function h(t,e){var i=t.split(new RegExp("\n*"+m+"\n*","g")),n={series:[]};return p.each(i,function(t,i){if(l(t)){var o=u(t),a=e[i],r=a.axisDim+"Axis";a&&(n[r]=n[r]||[],n[r][a.axisIndex]={data:o.categories},n.series=n.series.concat(o.series))}else{var o=c(t);n.series.push(o)}}),n}function d(t){this._dom=null,this.model=t}function f(t,e){return p.map(t,function(t,i){var n=e&&e[i];return p.isObject(n)&&!p.isArray(n)?(p.isObject(t)&&!p.isArray(t)&&(t=t.value),p.defaults({value:t},n)):t})}var p=i(1),g=i(21),m=new Array(60).join("-"),v="\t",y=new RegExp("["+v+"]+","g");d.defaultOption={show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:"数据视图",lang:["数据视图","关闭","刷新"],backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"},d.prototype.onclick=function(t,e){function i(){n.removeChild(a),M._dom=null}var n=e.getDom(),o=this.model;this._dom&&n.removeChild(this._dom);var a=document.createElement("div");a.style.cssText="position:absolute;left:5px;top:5px;bottom:5px;right:5px;",a.style.backgroundColor=o.get("backgroundColor")||"#fff";var s=document.createElement("h4"),l=o.get("lang")||[];s.innerHTML=l[0]||o.get("title"),s.style.cssText="margin: 10px 20px;",s.style.color=o.get("textColor");var u=document.createElement("div"),c=document.createElement("textarea");u.style.cssText="display:block;width:100%;overflow:auto;";var d=o.get("optionToContent"),f=o.get("contentToOption"),m=r(t);if("function"==typeof d){var y=d(e.getOption());"string"==typeof y?u.innerHTML=y:p.isDom(y)&&u.appendChild(y)}else u.appendChild(c),c.readOnly=o.get("readOnly"),c.style.cssText="width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;",c.style.color=o.get("textColor"),c.style.borderColor=o.get("textareaBorderColor"),c.style.backgroundColor=o.get("textareaColor"),c.value=m.value;var x=m.meta,_=document.createElement("div");_.style.cssText="position:absolute;bottom:0;left:0;right:0;";var b="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",w=document.createElement("div"),S=document.createElement("div");b+=";background-color:"+o.get("buttonColor"),b+=";color:"+o.get("buttonTextColor");var M=this;g.addEventListener(w,"click",i),g.addEventListener(S,"click",function(){var t;try{t="function"==typeof f?f(u,e.getOption()):h(c.value,x)}catch(n){throw i(),new Error("Data view format error "+n)}t&&e.dispatchAction({type:"changeDataView",newOption:t}),i()}),w.innerHTML=l[1],S.innerHTML=l[2],S.style.cssText=b,w.style.cssText=b,!o.get("readOnly")&&_.appendChild(S),_.appendChild(w),g.addEventListener(c,"keydown",function(t){if(9===(t.keyCode||t.which)){var e=this.value,i=this.selectionStart,n=this.selectionEnd;this.value=e.substring(0,i)+v+e.substring(n),this.selectionStart=this.selectionEnd=i+1,g.stop(t)}}),a.appendChild(s),a.appendChild(u),a.appendChild(_),u.style.height=n.clientHeight-80+"px",n.appendChild(a),this._dom=a},d.prototype.remove=function(t,e){this._dom&&e.getDom().removeChild(this._dom)},d.prototype.dispose=function(t,e){this.remove(t,e)},i(29).register("dataView",d),i(2).registerAction({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},function(t,e){var i=[];p.each(t.newOption.series,function(t){var n=e.getSeriesByName(t.name)[0];if(n){var o=n.get("data");i.push({name:t.name,data:f(t.data,o)})}else i.push(p.extend({type:"scatter"},t))}),e.mergeOption(p.defaults({series:i},t.newOption))}),t.exports=d},function(t,e,i){"use strict";function n(t,e,i){(this._brushController=new l(i.getZr())).on("brush",s.bind(this._onBrush,this)).mount(),this._isZoomActive}function o(t){var e={};return s.each(["xAxisIndex","yAxisIndex"],function(i){e[i]=t[i],null==e[i]&&(e[i]="all"),(e[i]===!1||"none"===e[i])&&(e[i]=[])}),e}function a(t,e){t.setIconStatus("back",c.count(e)>1?"emphasis":"normal")}function r(t,e,i,n,a){var r=i._isZoomActive;n&&"takeGlobalCursor"===n.type&&(r="dataZoomSelect"===n.key&&n.dataZoomSelectActive),i._isZoomActive=r,t.setIconStatus("zoom",r?"emphasis":"normal");var s=new u(o(t.option),e,{include:["grid"]});i._brushController.setPanels(s.makePanelOpts(a,function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"})).enableBrush(!!r&&{brushType:"auto",brushStyle:{lineWidth:0,fill:"rgba(0,0,0,0.2)"}})}var s=i(1),l=i(127),u=i(184),c=i(125),h=i(56),d=s.each;i(206);var f="\0_ec_\0toolbox-dataZoom_";n.defaultOption={show:!0,icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:{zoom:"区域缩放",back:"区域缩放还原"}};var p=n.prototype;p.render=function(t,e,i,n){this.model=t,this.ecModel=e,this.api=i,r(t,e,this,n,i),a(t,e)},p.onclick=function(t,e,i){g[i].call(this)},p.remove=function(t,e){this._brushController.unmount()},p.dispose=function(t,e){this._brushController.dispose()};var g={zoom:function(){var t=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:t})},back:function(){this._dispatchZoomAction(c.pop(this.ecModel))}};p._onBrush=function(t,e){function i(t,e,i){var o=e.getAxis(t),s=o.model,l=n(t,s,r),u=l.findRepresentativeAxisProxy(s).getMinMaxSpan();null==u.minValueSpan&&null==u.maxValueSpan||(i=h(0,i.slice(),o.scale.getExtent(),0,u.minValueSpan,u.maxValueSpan)),l&&(a[l.id]={dataZoomId:l.id,startValue:i[0],endValue:i[1]})}function n(t,e,i){var n;return i.eachComponent({mainType:"dataZoom",subType:"select"},function(i){var o=i.getAxisModel(t,e.componentIndex);o&&(n=i)}),n}if(e.isEnd&&t.length){var a={},r=this.ecModel;this._brushController.updateCovers([]);var s=new u(o(this.model.option),r,{include:["grid"]});s.matchOutputRanges(t,r,function(t,e,n){if("cartesian2d"===n.type){var o=t.brushType;"rect"===o?(i("x",n,e[0]),i("y",n,e[1])):i({lineX:"x",lineY:"y"}[o],n,e)}}),c.push(r,a),this._dispatchZoomAction(a)}},p._dispatchZoomAction=function(t){var e=[];d(t,function(t,i){e.push(s.clone(t))}),e.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:e})},i(29).register("dataZoom",n),i(2).registerPreprocessor(function(t){function e(t,e){if(e){var o=t+"Index",a=e[o];null==a||"all"==a||s.isArray(a)||(a=a===!1||"none"===a?[]:[a]),i(t,function(e,i){if(null==a||"all"==a||s.indexOf(a,i)!==-1){var r={type:"select",$fromToolbox:!0,id:f+t+i};r[o]=i,n.push(r)}})}}function i(e,i){var n=t[e];s.isArray(n)||(n=n?[n]:[]),d(n,i)}if(t){var n=t.dataZoom||(t.dataZoom=[]);s.isArray(n)||(t.dataZoom=n=[n]);var o=t.toolbox;if(o&&(s.isArray(o)&&(o=o[0]),o&&o.feature)){var a=o.feature.dataZoom;e("xAxis",a),e("yAxis",a)}}}),t.exports=n},function(t,e,i){"use strict";function n(t){this.model=t}var o=i(1);n.defaultOption={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z",tiled:"M2.3,2.2h22.8V25H2.3V2.2z M35,2.2h22.8V25H35V2.2zM2.3,35h22.8v22.8H2.3V35z M35,35h22.8v22.8H35V35z"},title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"},option:{},seriesIndex:{}};var a=n.prototype;a.getIcons=function(){var t=this.model,e=t.get("icon"),i={};return o.each(t.get("type"),function(t){e[t]&&(i[t]=e[t])}),i};var r={line:function(t,e,i,n){if("bar"===t)return o.merge({id:e,type:"line",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},n.get("option.line")||{},!0)},bar:function(t,e,i,n){if("line"===t)return o.merge({id:e,type:"bar",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},n.get("option.bar")||{},!0)},stack:function(t,e,i,n){if("line"===t||"bar"===t)return o.merge({id:e,stack:"__ec_magicType_stack__"},n.get("option.stack")||{},!0)},tiled:function(t,e,i,n){if("line"===t||"bar"===t)return o.merge({id:e,stack:""},n.get("option.tiled")||{},!0)}},s=[["line","bar"],["stack","tiled"]];a.onclick=function(t,e,i){var n=this.model,a=n.get("seriesIndex."+i);if(r[i]){var l={series:[]},u=function(e){var a=e.subType,s=e.id,u=r[i](a,s,e,n);u&&(o.defaults(u,e.option),l.series.push(u));var c=e.coordinateSystem;if(c&&"cartesian2d"===c.type&&("line"===i||"bar"===i)){var h=c.getAxesByScale("ordinal")[0];if(h){var d=h.dim,f=d+"Axis",p=t.queryComponents({mainType:f,index:e.get(name+"Index"),id:e.get(name+"Id")})[0],g=p.componentIndex;l[f]=l[f]||[];for(var m=0;m<=g;m++)l[f][g]=l[f][g]||{};l[f][g].boundaryGap="bar"===i}}};o.each(s,function(t){o.indexOf(t,i)>=0&&o.each(t,function(t){n.setIconStatus(t,"normal")})}),n.setIconStatus(i,"emphasis"),t.eachComponent({mainType:"series",query:null==a?null:{seriesIndex:a}},u),e.dispatchAction({type:"changeMagicType",currentType:i,newOption:l})}};var l=i(2);l.registerAction({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)}),i(29).register("magicType",n),t.exports=n},function(t,e,i){"use strict";function n(t){this.model=t}var o=i(125);n.defaultOption={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:"还原"};var a=n.prototype;a.onclick=function(t,e,i){o.clear(t),e.dispatchAction({type:"restore",from:this.uid})},i(29).register("restore",n),i(2).registerAction({type:"restore",event:"restore",update:"prepareAndUpdate"},function(t,e){e.resetOption("recreate")}),t.exports=n},function(t,e,i){function n(t){this.model=t}var o=i(9);n.defaultOption={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:"保存为图片",type:"png",name:"",excludeComponents:["toolbox"],pixelRatio:1,lang:["右键另存为图片"]},n.prototype.unusable=!o.canvasSupported;var a=n.prototype;a.onclick=function(t,e){var i=this.model,n=i.get("name")||t.get("title.0.text")||"echarts",a=document.createElement("a"),r=i.get("type",!0)||"png";a.download=n+"."+r,a.target="_blank";var s=e.getConnectedDataURL({type:r,backgroundColor:i.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")});if(a.href=s,"function"!=typeof MouseEvent||o.browser.ie||o.browser.edge){var l=i.get("lang"),u='<body style="margin:0;"><img src="'+s+'" style="max-width:100%;" title="'+(l&&l[0]||"")+'" /></body>',c=window.open();c.document.write(u)}else{var h=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1});a.dispatchEvent(h)}},i(29).register("saveAsImage",n),t.exports=n},function(t,e,i){i(55),i(234),i(235),i(2).registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},function(){}),i(2).registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},function(){})},function(t,e,i){function n(t){var e="cubic-bezier(0.23, 1, 0.32, 1)",i="left "+t+"s "+e+",top "+t+"s "+e;return s.map(p,function(t){return t+"transition:"+i}).join(";")}function o(t){var e=[],i=t.get("fontSize"),n=t.getTextColor();return n&&e.push("color:"+n),e.push("font:"+t.getFont()),i&&e.push("line-height:"+Math.round(3*i/2)+"px"),h(["decoration","align"],function(i){var n=t.get(i);n&&e.push("text-"+i+":"+n)}),e.join(";")}function a(t){var e=[],i=t.get("transitionDuration"),a=t.get("backgroundColor"),r=t.getModel("textStyle"),s=t.get("padding");return i&&e.push(n(i)),a&&(f.canvasSupported?e.push("background-Color:"+a):(e.push("background-Color:#"+l.toHex(a)),e.push("filter:alpha(opacity=70)"))),h(["width","color","radius"],function(i){var n="border-"+i,o=d(n),a=t.get(o);null!=a&&e.push(n+":"+a+("color"===i?"":"px"))}),e.push(o(r)),null!=s&&e.push("padding:"+c.normalizeCssArray(s).join("px ")+"px"),e.join(";")+";"}function r(t,e){var i=document.createElement("div"),n=this._zr=e.getZr();this.el=i,this._x=e.getWidth()/2,this._y=e.getHeight()/2,t.appendChild(i),this._container=t,this._show=!1,this._hideTimeout;var o=this;i.onmouseenter=function(){o._enterable&&(clearTimeout(o._hideTimeout),o._show=!0),o._inContent=!0},i.onmousemove=function(e){if(e=e||window.event,!o._enterable){var i=n.handler;u.normalizeEvent(t,e,!0),i.dispatch("mousemove",e)}},i.onmouseleave=function(){o._enterable&&o._show&&o.hideLater(o._hideDelay),o._inContent=!1}}var s=i(1),l=i(22),u=i(21),c=i(7),h=s.each,d=c.toCamelCase,f=i(9),p=["","-webkit-","-moz-","-o-"],g="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;";r.prototype={constructor:r,_enterable:!0,update:function(){var t=this._container,e=t.currentStyle||document.defaultView.getComputedStyle(t),i=t.style;"absolute"!==i.position&&"absolute"!==e.position&&(i.position="relative")},show:function(t){clearTimeout(this._hideTimeout);var e=this.el;e.style.cssText=g+a(t)+";left:"+this._x+"px;top:"+this._y+"px;"+(t.get("extraCssText")||""),e.style.display=e.innerHTML?"block":"none",this._show=!0},setContent:function(t){this.el.innerHTML=null==t?"":t},setEnterable:function(t){this._enterable=t},getSize:function(){var t=this.el;return[t.clientWidth,t.clientHeight]},moveTo:function(t,e){var i,n=this._zr;n&&n.painter&&(i=n.painter.getViewportRoot())&&(t+=i.offsetLeft||0,e+=i.offsetTop||0);var o=this.el.style;o.left=t+"px",o.top=e+"px",this._x=t,this._y=e},hide:function(){this.el.style.display="none",this._show=!1},hideLater:function(t){!this._show||this._inContent&&this._enterable||(t?(this._hideDelay=t,this._show=!1,this._hideTimeout=setTimeout(s.bind(this.hide,this),t)):this.hide())},isShow:function(){return this._show}},t.exports=r},function(t,e,i){i(2).extendComponentModel({type:"tooltip",dependencies:["axisPointer"],defaultOption:{zlevel:0,z:8,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",confine:!1,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"rgba(50,50,50,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#fff",fontSize:14}}})},function(t,e,i){function n(t){for(var e=t.pop();t.length;){var i=t.pop();i&&(i instanceof v&&(i=i.get("tooltip",!0)),"string"==typeof i&&(i={formatter:i}),e=new v(i,e,e.ecModel))}return e}function o(t,e){return t.dispatchAction||c.bind(e.dispatchAction,e)}function a(t,e,i,n,o,a,r){var s=i.clientWidth,l=i.clientHeight;return null!=a&&(t+s+a>n?t-=s+a:t+=a),null!=r&&(e+l+r>o?e-=l+r:e+=r),[t,e]}function r(t,e,i,n,o){var a=i.clientWidth,r=i.clientHeight;return t=Math.min(t+a,n)-a,e=Math.min(e+r,o)-r,t=Math.max(t,0),e=Math.max(e,0),[t,e]}function s(t,e,i){var n=i[0],o=i[1],a=5,r=0,s=0,l=e.width,u=e.height;switch(t){case"inside":r=e.x+l/2-n/2,s=e.y+u/2-o/2;break;case"top":r=e.x+l/2-n/2,s=e.y-o-a;break;case"bottom":r=e.x+l/2-n/2,s=e.y+u+a;break;case"left":r=e.x-n-a,s=e.y+u/2-o/2;break;case"right":r=e.x+l+a,s=e.y+u/2-o/2}return[r,s]}function l(t){return"center"===t||"middle"===t}var u=i(233),c=i(1),h=i(7),d=i(4),f=i(3),p=i(121),g=i(12),m=i(9),v=i(10),y=i(122),x=i(18),_=i(76),b=c.bind,w=c.each,S=d.parsePercent,M=new f.Rect({shape:{x:-1,y:-1,width:2,height:2}});i(2).extendComponentView({type:"tooltip",init:function(t,e){if(!m.node){var i=new u(e.getDom(),e);this._tooltipContent=i}},render:function(t,e,i){if(!m.node){this.group.removeAll(),this._tooltipModel=t,this._ecModel=e,this._api=i,this._lastDataByCoordSys=null,this._alwaysShowContent=t.get("alwaysShowContent");var n=this._tooltipContent;n.update(),n.setEnterable(t.get("enterable")),this._initGlobalListener(),this._keepShow()}},_initGlobalListener:function(){var t=this._tooltipModel,e=t.get("triggerOn");y.register("itemTooltip",this._api,b(function(t,i,n){"none"!==e&&(e.indexOf(t)>=0?this._tryShow(i,n):"leave"===t&&this._hide(n))},this))},_keepShow:function(){var t=this._tooltipModel,e=this._ecModel,i=this._api;if(null!=this._lastX&&null!=this._lastY&&"none"!==t.get("triggerOn")){var n=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){n.manuallyShowTip(t,e,i,{x:n._lastX,y:n._lastY})})}},manuallyShowTip:function(t,e,i,n){if(n.from!==this.uid&&!m.node){var a=o(n,i);this._ticket="";var r=n.dataByCoordSys;if(n.tooltip&&null!=n.x&&null!=n.y){var s=M;s.position=[n.x,n.y],s.update(),s.tooltip=n.tooltip,this._tryShow({offsetX:n.x,offsetY:n.y,target:s},a)}else if(r)this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,event:{},dataByCoordSys:n.dataByCoordSys,tooltipOption:n.tooltipOption},a);else if(null!=n.seriesIndex){if(this._manuallyAxisShowTip(t,e,i,n))return;var l=p(n,e),u=l.point[0],c=l.point[1];null!=u&&null!=c&&this._tryShow({offsetX:u,offsetY:c,position:n.position,target:l.el,event:{}},a)}else null!=n.x&&null!=n.y&&(i.dispatchAction({type:"updateAxisPointer",x:n.x,y:n.y}),this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,target:i.getZr().findHover(n.x,n.y).target,event:{}},a))}},manuallyHideTip:function(t,e,i,n){var a=this._tooltipContent;this._alwaysShowContent||a.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=null,n.from!==this.uid&&this._hide(o(n,i))},_manuallyAxisShowTip:function(t,e,i,o){var a=o.seriesIndex,r=o.dataIndex,s=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=a&&null!=r&&null!=s){var l=e.getSeriesByIndex(a);if(l){var u=l.getData(),t=n([u.getItemModel(r),l,(l.coordinateSystem||{}).model,t]);if("axis"===t.get("trigger"))return i.dispatchAction({type:"updateAxisPointer",seriesIndex:a,dataIndex:r,position:o.position}),!0}}},_tryShow:function(t,e){var i=t.target,n=this._tooltipModel;if(n){this._lastX=t.offsetX,this._lastY=t.offsetY;var o=t.dataByCoordSys;o&&o.length?this._showAxisTooltip(o,t):i&&null!=i.dataIndex?(this._lastDataByCoordSys=null,this._showSeriesItemTooltip(t,i,e)):i&&i.tooltip?(this._lastDataByCoordSys=null,this._showComponentItemTooltip(t,i,e)):(this._lastDataByCoordSys=null,this._hide(e))}},_showOrMove:function(t,e){var i=t.get("showDelay");e=c.bind(e,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(e,i):e()},_showAxisTooltip:function(t,e){var i=this._ecModel,o=this._tooltipModel,a=[e.offsetX,e.offsetY],r=[],s=[],l=n([e.tooltipOption,o]);w(t,function(t){w(t.dataByAxis,function(t){var e=i.getComponent(t.axisDim+"Axis",t.axisIndex),n=t.value,o=[];if(e&&null!=n){var a=_.getValueLabel(n,e.axis,i,t.seriesDataIndices,t.valueLabelOpt);c.each(t.seriesDataIndices,function(r){var l=i.getSeriesByIndex(r.seriesIndex),u=r.dataIndexInside,c=l&&l.getDataParams(u);c.axisDim=t.axisDim,c.axisIndex=t.axisIndex,c.axisType=t.axisType,c.axisId=t.axisId,c.axisValue=x.getAxisRawValue(e.axis,n),c.axisValueLabel=a,c&&(s.push(c),o.push(l.formatTooltip(u,!0)))});var l=a;r.push((l?h.encodeHTML(l)+"<br />":"")+o.join("<br />"))}})},this),r.reverse(),r=r.join("<br /><br />");var u=e.position;this._showOrMove(l,function(){this._updateContentNotChangedOnAxis(t)?this._updatePosition(l,u,a[0],a[1],this._tooltipContent,s):this._showTooltipContent(l,r,s,Math.random(),a[0],a[1],u)})},_showSeriesItemTooltip:function(t,e,i){var o=this._ecModel,a=e.seriesIndex,r=o.getSeriesByIndex(a),s=e.dataModel||r,l=e.dataIndex,u=e.dataType,c=s.getData(),h=n([c.getItemModel(l),s,r&&(r.coordinateSystem||{}).model,this._tooltipModel]),d=h.get("trigger");if(null==d||"item"===d){var f=s.getDataParams(l,u),p=s.formatTooltip(l,!1,u),g="item_"+s.name+"_"+l;this._showOrMove(h,function(){this._showTooltipContent(h,p,f,g,t.offsetX,t.offsetY,t.position,t.target)}),i({type:"showTip",dataIndexInside:l,dataIndex:c.getRawIndex(l),seriesIndex:a,from:this.uid})}},_showComponentItemTooltip:function(t,e,i){var n=e.tooltip;if("string"==typeof n){var o=n;n={content:o,formatter:o}}var a=new v(n,this._tooltipModel,this._ecModel),r=a.get("content"),s=Math.random();this._showOrMove(a,function(){this._showTooltipContent(a,r,a.get("formatterParams")||{},s,t.offsetX,t.offsetY,t.position,e)}),i({type:"showTip",from:this.uid})},_showTooltipContent:function(t,e,i,n,o,a,r,s){if(this._ticket="",t.get("showContent")&&t.get("show")){var l=this._tooltipContent,u=t.get("formatter");r=r||t.get("position");var c=e;if(u&&"string"==typeof u)c=h.formatTpl(u,i,!0);else if("function"==typeof u){var d=b(function(e,n){e===this._ticket&&(l.setContent(n),this._updatePosition(t,r,o,a,l,i,s))},this);this._ticket=n,c=u(i,n,d)}l.setContent(c),l.show(t),this._updatePosition(t,r,o,a,l,i,s)}},_updatePosition:function(t,e,i,n,o,u,h){var d=this._api.getWidth(),f=this._api.getHeight();e=e||t.get("position");var p=o.getSize(),m=t.get("align"),v=t.get("verticalAlign"),y=h&&h.getBoundingRect().clone();if(h&&y.applyTransform(h.transform),"function"==typeof e&&(e=e([i,n],u,o.el,y,{viewSize:[d,f],contentSize:p.slice()})),c.isArray(e))i=S(e[0],d),n=S(e[1],f);else if(c.isObject(e)){e.width=p[0],e.height=p[1];var x=g.getLayoutRect(e,{width:d,height:f});i=x.x,n=x.y,m=null,v=null}else if("string"==typeof e&&h){var _=s(e,y,p);i=_[0],n=_[1]}else{var _=a(i,n,o.el,d,f,m?null:20,v?null:20);i=_[0],n=_[1]}if(m&&(i-=l(m)?p[0]/2:"right"===m?p[0]:0),v&&(n-=l(v)?p[1]/2:"bottom"===v?p[1]:0),t.get("confine")){var _=r(i,n,o.el,d,f);i=_[0],n=_[1]}o.moveTo(i,n)},_updateContentNotChangedOnAxis:function(t){var e=this._lastDataByCoordSys,i=!!e&&e.length===t.length;return i&&w(e,function(e,n){var o=e.dataByAxis||{},a=t[n]||{},r=a.dataByAxis||[];i&=o.length===r.length,i&&w(o,function(t,e){var n=r[e]||{},o=t.seriesDataIndices||[],a=n.seriesDataIndices||[];i&=t.value===n.value&&t.axisType===n.axisType&&t.axisId===n.axisId&&o.length===a.length,i&&w(o,function(t,e){var n=a[e];i&=t.seriesIndex===n.seriesIndex&&t.dataIndex===n.dataIndex})})}),this._lastDataByCoordSys=t,!!i},_hide:function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},dispose:function(t,e){m.node||(this._tooltipContent.hide(),y.unregister("itemTooltip",e))}})},function(t,e,i){function n(t,e,i){if(this.name=t,this.geometries=e,i)i=[i[0],i[1]];else{var n=this.getBoundingRect();i=[n.x+n.width/2,n.y+n.height/2]}this.center=i}var o=i(267),a=i(11),r=i(85),s=i(6);n.prototype={constructor:n,properties:null,getBoundingRect:function(){var t=this._rect;if(t)return t;for(var e=Number.MAX_VALUE,i=[e,e],n=[-e,-e],o=[],l=[],u=this.geometries,c=0;c<u.length;c++)if("polygon"===u[c].type){var h=u[c].exterior;r.fromPoints(h,o,l),s.min(i,i,o),s.max(n,n,l)}return 0===c&&(i[0]=i[1]=n[0]=n[1]=0),this._rect=new a(i[0],i[1],n[0]-i[0],n[1]-i[1])},contain:function(t){var e=this.getBoundingRect(),i=this.geometries;if(!e.contain(t[0],t[1]))return!1;t:for(var n=0,a=i.length;n<a;n++)if("polygon"===i[n].type){var r=i[n].exterior,s=i[n].interiors;if(o.contain(r,t[0],t[1])){for(var l=0;l<(s?s.length:0);l++)if(o.contain(s[l]))continue t;return!0}}return!1},transformTo:function(t,e,i,n){var o=this.getBoundingRect(),r=o.width/o.height;i?n||(n=i/r):i=r*n;for(var l=new a(t,e,i,n),u=o.calculateTransform(l),c=this.geometries,h=0;h<c.length;h++)if("polygon"===c[h].type){for(var d=c[h].exterior,f=c[h].interiors,p=0;p<d.length;p++)s.applyTransform(d[p],d[p],u);for(var g=0;g<(f?f.length:0);g++)for(var p=0;p<f[g].length;p++)s.applyTransform(f[g][p],f[g][p],u)}o=this._rect,o.copy(l),this.center=[o.x+o.width/2,o.y+o.height/2]}},t.exports=n},function(t,e,i){function n(t,e){var i=t.get("center"),n=t.get("radius"),o=e.getWidth(),a=e.getHeight(),r=s.parsePercent;this.cx=r(i[0],o),this.cy=r(i[1],a);var l=this.getRadiusAxis(),u=Math.min(o,a)/2;l.setExtent(0,r(n,u))}function o(t,e){var i=this,n=i.getAngleAxis(),o=i.getRadiusAxis();if(n.scale.setExtent(1/0,-(1/0)),o.scale.setExtent(1/0,-(1/0)),t.eachSeries(function(t){if(t.coordinateSystem===i){var e=t.getData();o.scale.unionExtentFromData(e,"radius"),n.scale.unionExtentFromData(e,"angle")}}),u(n.scale,n.model),u(o.scale,o.model),"category"===n.type&&!n.onBand){var a=n.getExtent(),r=360/n.scale.count();n.inverse?a[1]+=r:a[1]-=r,n.setExtent(a[0],a[1])}}function a(t,e){if(t.type=e.get("type"),t.scale=l.createScaleByModel(e),t.onBand=e.get("boundaryGap")&&"category"===t.type,"angleAxis"===e.mainType){var i=e.get("startAngle");t.inverse=e.get("inverse")^e.get("clockwise"),t.setExtent(i,i+(t.inverse?-360:360))}e.axis=t,t.model=e}var r=i(412),s=i(4),l=(i(1),i(18)),u=l.niceScaleExtent;i(413);var c={dimensions:r.prototype.dimensions,create:function(t,e){var i=[];return t.eachComponent("polar",function(t,s){var l=new r(s);l.resize=n,l.update=o;var u=l.getRadiusAxis(),c=l.getAngleAxis(),h=t.findAxisModel("radiusAxis"),d=t.findAxisModel("angleAxis");a(u,h),a(c,d),l.resize(t,e),i.push(l),t.coordinateSystem=l,l.model=t}),t.eachSeries(function(e){if("polar"===e.get("coordinateSystem")){var i=t.queryComponents({mainType:"polar",index:e.get("polarIndex"),id:e.get("polarId")})[0];e.coordinateSystem=i.coordinateSystem}}),i}};i(26).register("polar",c)},function(t,e,i){function n(t){return parseInt(t,10)}function o(t,e){s.initVML(),this.root=t,this.storage=e;var i=document.createElement("div"),n=document.createElement("div");i.style.cssText="display:inline-block;overflow:hidden;position:relative;width:300px;height:150px;",n.style.cssText="position:absolute;left:0;top:0;",t.appendChild(i),this._vmlRoot=n,this._vmlViewport=i,this.resize();var o=e.delFromStorage,a=e.addToStorage;e.delFromStorage=function(t){o.call(e,t),t&&t.onRemove&&t.onRemove(n)},e.addToStorage=function(t){t.onAdd&&t.onAdd(n),a.call(e,t)},this._firstPaint=!0}function a(t){return function(){r('In IE8.0 VML mode painter not support method "'+t+'"')}}var r=i(52),s=i(182);o.prototype={constructor:o,getViewportRoot:function(){return this._vmlViewport},refresh:function(){var t=this.storage.getDisplayList(!0,!0);this._paintList(t)},_paintList:function(t){for(var e=this._vmlRoot,i=0;i<t.length;i++){var n=t[i];n.invisible||n.ignore?(n.__alreadyNotVisible||n.onRemove(e),n.__alreadyNotVisible=!0):(n.__alreadyNotVisible&&n.onAdd(e),n.__alreadyNotVisible=!1,n.__dirty&&(n.beforeBrush&&n.beforeBrush(),(n.brushVML||n.brush).call(n,e),n.afterBrush&&n.afterBrush())),n.__dirty=!1}this._firstPaint&&(this._vmlViewport.appendChild(e),this._firstPaint=!1)},resize:function(t,e){var t=null==t?this._getWidth():t,e=null==e?this._getHeight():e;if(this._width!=t||this._height!=e){this._width=t,this._height=e;var i=this._vmlViewport.style;i.width=t+"px",i.height=e+"px"}},dispose:function(){this.root.innerHTML="",this._vmlRoot=this._vmlViewport=this.storage=null},getWidth:function(){return this._width},getHeight:function(){return this._height},clear:function(){this._vmlViewport&&this.root.removeChild(this._vmlViewport)},_getWidth:function(){var t=this.root,e=t.currentStyle;return(t.clientWidth||n(e.width))-n(e.paddingLeft)-n(e.paddingRight)|0},_getHeight:function(){var t=this.root,e=t.currentStyle;return(t.clientHeight||n(e.height))-n(e.paddingTop)-n(e.paddingBottom)|0}};for(var l=["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","toDataURL","pathToImage"],u=0;u<l.length;u++){var c=l[u];o.prototype[c]=a(c)}t.exports=o},function(t,e,i){if(!i(9).canvasSupported){var n=i(6),o=i(11),a=i(27).CMD,r=i(22),s=i(16),l=i(87),u=i(38),c=i(53),h=i(86),d=i(8),f=i(27),p=i(39),g=i(182),m=Math.round,v=Math.sqrt,y=Math.abs,x=Math.cos,_=Math.sin,b=Math.max,w=n.applyTransform,S=",",M="progid:DXImageTransform.Microsoft",I=21600,T=I/2,A=1e5,C=1e3,L=function(t){t.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;",t.coordsize=I+","+I,t.coordorigin="0,0"},D=function(t){return String(t).replace(/&/g,"&amp;").replace(/"/g,"&quot;")},P=function(t,e,i){return"rgb("+[t,e,i].join(",")+")"},k=function(t,e){e&&t&&e.parentNode!==t&&t.appendChild(e)},O=function(t,e){e&&t&&e.parentNode===t&&t.removeChild(e)},z=function(t,e,i){return(parseFloat(t)||0)*A+(parseFloat(e)||0)*C+i},E=function(t,e){return"string"==typeof t?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t},R=function(t,e,i){var n=r.parse(e);i=+i,isNaN(i)&&(i=1),n&&(t.color=P(n[0],n[1],n[2]),t.opacity=i*n[3])},N=function(t){var e=r.parse(t);return[P(e[0],e[1],e[2]),e[3]]},V=function(t,e,i){var n=e.fill;if(null!=n)if(n instanceof p){var o,a=0,r=[0,0],s=0,l=1,u=i.getBoundingRect(),c=u.width,h=u.height;if("linear"===n.type){o="gradient";var d=i.transform,f=[n.x*c,n.y*h],g=[n.x2*c,n.y2*h];d&&(w(f,f,d),w(g,g,d));var m=g[0]-f[0],v=g[1]-f[1];a=180*Math.atan2(m,v)/Math.PI,a<0&&(a+=360),a<1e-6&&(a=0)}else{o="gradientradial";var f=[n.x*c,n.y*h],d=i.transform,y=i.scale,x=c,_=h;r=[(f[0]-u.x)/x,(f[1]-u.y)/_],d&&w(f,f,d),x/=y[0]*I,_/=y[1]*I;var S=b(x,_);s=0/S,l=2*n.r/S-s}var M=n.colorStops.slice();M.sort(function(t,e){return t.offset-e.offset});for(var T=M.length,A=[],C=[],L=0;L<T;L++){var D=M[L],P=N(D.color);C.push(D.offset*l+s+" "+P[0]),0!==L&&L!==T-1||A.push(P)}if(T>=2){var k=A[0][0],O=A[1][0],z=A[0][1]*e.opacity,E=A[1][1]*e.opacity;t.type=o,t.method="none",t.focus="100%",t.angle=a,t.color=k,t.color2=O,t.colors=C.join(","),t.opacity=E,t.opacity2=z}"radial"===o&&(t.focusposition=r.join(","))}else R(t,n,e.opacity)},B=function(t,e){null!=e.lineDash&&(t.dashstyle=e.lineDash.join(" ")),null==e.stroke||e.stroke instanceof p||R(t,e.stroke,e.opacity)},G=function(t,e,i,n){var o="fill"==e,a=t.getElementsByTagName(e)[0];null!=i[e]&&"none"!==i[e]&&(o||!o&&i.lineWidth)?(t[o?"filled":"stroked"]="true",i[e]instanceof p&&O(t,a),a||(a=g.createNode(e)),o?V(a,i,n):B(a,i),k(t,a)):(t[o?"filled":"stroked"]="false",O(t,a))},H=[[],[],[]],F=function(t,e){var i,n,o,r,s,l,u=a.M,c=a.C,h=a.L,d=a.A,f=a.Q,p=[];for(r=0;r<t.length;){switch(o=t[r++],n="",i=0,o){case u:n=" m ",i=1,s=t[r++],l=t[r++],H[0][0]=s,H[0][1]=l;break;case h:n=" l ",i=1,s=t[r++],l=t[r++],H[0][0]=s,H[0][1]=l;break;case f:case c:n=" c ",i=3;var g,y,b=t[r++],M=t[r++],A=t[r++],C=t[r++];o===f?(g=A,y=C,A=(A+2*b)/3,C=(C+2*M)/3,b=(s+2*b)/3,M=(l+2*M)/3):(g=t[r++],y=t[r++]),H[0][0]=b,H[0][1]=M,H[1][0]=A,H[1][1]=C,H[2][0]=g,H[2][1]=y,s=g,l=y;break;case d:var L=0,D=0,P=1,k=1,O=0;e&&(L=e[4],D=e[5],P=v(e[0]*e[0]+e[1]*e[1]),k=v(e[2]*e[2]+e[3]*e[3]),O=Math.atan2(-e[1]/k,e[0]/P));var z=t[r++],E=t[r++],R=t[r++],N=t[r++],V=t[r++]+O,B=t[r++]+V+O;r++;var G=t[r++],F=z+x(V)*R,W=E+_(V)*N,b=z+x(B)*R,M=E+_(B)*N,Z=G?" wa ":" at ";Math.abs(F-b)<1e-4&&(Math.abs(B-V)>.01?G&&(F+=270/I):Math.abs(W-E)<1e-4?G&&F<z||!G&&F>z?M-=270/I:M+=270/I:G&&W<E||!G&&W>E?b+=270/I:b-=270/I),p.push(Z,m(((z-R)*P+L)*I-T),S,m(((E-N)*k+D)*I-T),S,m(((z+R)*P+L)*I-T),S,m(((E+N)*k+D)*I-T),S,m((F*P+L)*I-T),S,m((W*k+D)*I-T),S,m((b*P+L)*I-T),S,m((M*k+D)*I-T)),s=b,l=M;break;case a.R:var q=H[0],j=H[1];q[0]=t[r++],q[1]=t[r++],j[0]=q[0]+t[r++],j[1]=q[1]+t[r++],e&&(w(q,q,e),w(j,j,e)),q[0]=m(q[0]*I-T),j[0]=m(j[0]*I-T),q[1]=m(q[1]*I-T),j[1]=m(j[1]*I-T),p.push(" m ",q[0],S,q[1]," l ",j[0],S,q[1]," l ",j[0],S,j[1]," l ",q[0],S,j[1]);break;case a.Z:p.push(" x ")}if(i>0){p.push(n);for(var U=0;U<i;U++){var X=H[U];e&&w(X,X,e),p.push(m(X[0]*I-T),S,m(X[1]*I-T),U<i-1?S:"")}}}return p.join("")};d.prototype.brushVML=function(t){var e=this.style,i=this._vmlEl;i||(i=g.createNode("shape"),L(i),this._vmlEl=i),G(i,"fill",e,this),G(i,"stroke",e,this);var n=this.transform,o=null!=n,a=i.getElementsByTagName("stroke")[0];if(a){var r=e.lineWidth;if(o&&!e.strokeNoScale){var s=n[0]*n[3]-n[1]*n[2];r*=v(y(s))}a.weight=r+"px"}var l=this.path||(this.path=new f);this.__dirtyPath&&(l.beginPath(),this.buildPath(l,this.shape),l.toStatic(),this.__dirtyPath=!1),i.path=F(l.data,this.transform),i.style.zIndex=z(this.zlevel,this.z,this.z2),k(t,i),null!=e.text?this.drawRectText(t,this.getBoundingRect()):this.removeRectText(t)},d.prototype.onRemove=function(t){O(t,this._vmlEl),this.removeRectText(t)},d.prototype.onAdd=function(t){k(t,this._vmlEl),this.appendRectText(t)};var W=function(t){return"object"==typeof t&&t.tagName&&"IMG"===t.tagName.toUpperCase()};c.prototype.brushVML=function(t){var e,i,n=this.style,o=n.image;if(W(o)){var a=o.src;if(a===this._imageSrc)e=this._imageWidth,i=this._imageHeight;else{var r=o.runtimeStyle,s=r.width,l=r.height;r.width="auto",r.height="auto",e=o.width,i=o.height,r.width=s,r.height=l,this._imageSrc=a,this._imageWidth=e,this._imageHeight=i}o=a}else o===this._imageSrc&&(e=this._imageWidth,i=this._imageHeight);if(o){var u=n.x||0,c=n.y||0,h=n.width,d=n.height,f=n.sWidth,p=n.sHeight,y=n.sx||0,x=n.sy||0,_=f&&p,I=this._vmlEl;I||(I=g.doc.createElement("div"),L(I),this._vmlEl=I);var T,A=I.style,C=!1,D=1,P=1;if(this.transform&&(T=this.transform,D=v(T[0]*T[0]+T[1]*T[1]),P=v(T[2]*T[2]+T[3]*T[3]),C=T[1]||T[2]),C){var O=[u,c],E=[u+h,c],R=[u,c+d],N=[u+h,c+d];w(O,O,T),w(E,E,T),w(R,R,T),w(N,N,T);var V=b(O[0],E[0],R[0],N[0]),B=b(O[1],E[1],R[1],N[1]),G=[];G.push("M11=",T[0]/D,S,"M12=",T[2]/P,S,"M21=",T[1]/D,S,"M22=",T[3]/P,S,"Dx=",m(u*D+T[4]),S,"Dy=",m(c*P+T[5])),A.padding="0 "+m(V)+"px "+m(B)+"px 0",A.filter=M+".Matrix("+G.join("")+", SizingMethod=clip)"}else T&&(u=u*D+T[4],c=c*P+T[5]),A.filter="",A.left=m(u)+"px",A.top=m(c)+"px";var H=this._imageEl,F=this._cropEl;H||(H=g.doc.createElement("div"),this._imageEl=H);var Z=H.style;if(_){if(e&&i)Z.width=m(D*e*h/f)+"px",Z.height=m(P*i*d/p)+"px";else{var q=new Image,j=this;q.onload=function(){q.onload=null,e=q.width,i=q.height,Z.width=m(D*e*h/f)+"px",Z.height=m(P*i*d/p)+"px",j._imageWidth=e,j._imageHeight=i,j._imageSrc=o},q.src=o}F||(F=g.doc.createElement("div"),F.style.overflow="hidden",this._cropEl=F);var U=F.style;U.width=m((h+y*h/f)*D),U.height=m((d+x*d/p)*P),U.filter=M+".Matrix(Dx="+-y*h/f*D+",Dy="+-x*d/p*P+")",F.parentNode||I.appendChild(F),H.parentNode!=F&&F.appendChild(H)}else Z.width=m(D*h)+"px",Z.height=m(P*d)+"px",I.appendChild(H),F&&F.parentNode&&(I.removeChild(F),this._cropEl=null);var X="",Y=n.opacity;Y<1&&(X+=".Alpha(opacity="+m(100*Y)+") "),X+=M+".AlphaImageLoader(src="+o+", SizingMethod=scale)",Z.filter=X,I.style.zIndex=z(this.zlevel,this.z,this.z2),k(t,I),null!=n.text&&this.drawRectText(t,this.getBoundingRect())}},c.prototype.onRemove=function(t){O(t,this._vmlEl),this._vmlEl=null,this._cropEl=null,this._imageEl=null,this.removeRectText(t)},c.prototype.onAdd=function(t){k(t,this._vmlEl),this.appendRectText(t)};var Z,q="normal",j={},U=0,X=100,Y=document.createElement("div"),$=function(t){var e=j[t];if(!e){U>X&&(U=0,j={});var i,n=Y.style;try{n.font=t,i=n.fontFamily.split(",")[0]}catch(o){}e={style:n.fontStyle||q,variant:n.fontVariant||q,weight:n.fontWeight||q,size:0|parseFloat(n.fontSize||12),family:i||"Microsoft YaHei"},j[t]=e,U++}return e};s.measureText=function(t,e){var i=g.doc;Z||(Z=i.createElement("div"),Z.style.cssText="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;",g.doc.body.appendChild(Z));try{Z.style.font=e}catch(n){}return Z.innerHTML="",Z.appendChild(i.createTextNode(t)),{width:Z.offsetWidth}};for(var K=new o,J=function(t,e,i,n){var o=this.style,a=o.text;if(null!=a&&(a+=""),a){var r,l,u=o.textAlign,c=$(o.textFont),h=c.style+" "+c.variant+" "+c.weight+" "+c.size+'px "'+c.family+'"',d=o.textBaseline,f=o.textVerticalAlign;i=i||s.getBoundingRect(a,h,u,d);var p=this.transform;if(p&&!n&&(K.copy(e),K.applyTransform(p),e=K),n)r=e.x,l=e.y;else{var v=o.textPosition,y=o.textDistance;if(v instanceof Array)r=e.x+E(v[0],e.width),l=e.y+E(v[1],e.height),u=u||"left",d=d||"top";else{var x=s.adjustTextPositionOnRect(v,e,i,y);r=x.x,l=x.y,u=u||x.textAlign,d=d||x.textBaseline}}if(f){switch(f){case"middle":l-=i.height/2;break;case"bottom":l-=i.height}d="top"}var _=c.size;switch(d){case"hanging":case"top":l+=_/1.75;break;case"middle":break;default:l-=_/2.25}switch(u){case"left":break;case"center":r-=i.width/2;break;case"right":r-=i.width}var b,M,I,T=g.createNode,A=this._textVmlEl;A?(I=A.firstChild,b=I.nextSibling,M=b.nextSibling):(A=T("line"),b=T("path"),M=T("textpath"),I=T("skew"),M.style["v-text-align"]="left",L(A),b.textpathok=!0,M.on=!0,A.from="0 0",A.to="1000 0.05",k(A,I),k(A,b),k(A,M),this._textVmlEl=A);var C=[r,l],P=A.style;p&&n?(w(C,C,p),I.on=!0,I.matrix=p[0].toFixed(3)+S+p[2].toFixed(3)+S+p[1].toFixed(3)+S+p[3].toFixed(3)+",0,0",I.offset=(m(C[0])||0)+","+(m(C[1])||0),I.origin="0 0",P.left="0px",P.top="0px"):(I.on=!1,P.left=m(r)+"px",P.top=m(l)+"px"),M.string=D(a);try{M.style.font=h}catch(O){}G(A,"fill",{fill:n?o.fill:o.textFill,opacity:o.opacity},this),G(A,"stroke",{stroke:n?o.stroke:o.textStroke,opacity:o.opacity,lineDash:o.lineDash},this),A.style.zIndex=z(this.zlevel,this.z,this.z2),k(t,A)}},Q=function(t){O(t,this._textVmlEl),this._textVmlEl=null},tt=function(t){k(t,this._textVmlEl)},et=[l,u,c,d,h],it=0;it<et.length;it++){var nt=et[it].prototype;nt.drawRectText=J,nt.removeRectText=Q,nt.appendRectText=tt}h.prototype.brushVML=function(t){var e=this.style;null!=e.text?this.drawRectText(t,{x:e.x||0,y:e.y||0,width:0,height:0},this.getBoundingRect(),!0):this.removeRectText(t)},h.prototype.onRemove=function(t){this.removeRectText(t)},h.prototype.onAdd=function(t){this.appendRectText(t)}}},function(t,e,i){i(239),i(88).registerPainter("vml",i(238))},function(t,e,i){var n=i(1),o=i(242),a=i(2);a.registerAction({type:"geoRoam",event:"geoRoam",update:"updateLayout"},function(t,e){var i=t.componentType||"series";e.eachComponent({mainType:i,query:t},function(e){var a=e.coordinateSystem;if("geo"===a.type){var r=o.updateCenterAndZoom(a,t,e.get("scaleLimit"));e.setCenter&&e.setCenter(r.center),e.setZoom&&e.setZoom(r.zoom),"series"===i&&n.each(e.seriesGroup,function(t){t.setCenter(r.center),t.setZoom(r.zoom)})}})})},function(t,e){var i={};i.updateCenterAndZoom=function(t,e,i){var n=t.getZoom(),o=t.getCenter(),a=e.zoom,r=t.dataToPoint(o);if(null!=e.dx&&null!=e.dy){r[0]-=e.dx,r[1]-=e.dy;var o=t.pointToData(r);t.setCenter(o)}if(null!=a){if(i){var s=i.min||0,l=i.max||1/0;a=Math.max(Math.min(n*a,l),s)/n}t.scale[0]*=a,t.scale[1]*=a;var u=t.position,c=(e.originX-u[0])*(a-1),h=(e.originY-u[1])*(a-1);u[0]-=c,u[1]-=h,t.updateTransform();var o=t.pointToData(r);t.setCenter(o),t.setZoom(a*n)}return{center:t.getCenter(),zoom:t.getZoom()}},t.exports=i},function(t,e,i){var n=i(6);t.exports=function(t){var e=t.coordinateSystem;if(!e||"view"===e.type){var i=e.getBoundingRect(),o=t.getData(),a=o.graph,r=0,s=o.getSum("value"),l=2*Math.PI/(s||o.count()),u=i.width/2+i.x,c=i.height/2+i.y,h=Math.min(i.width,i.height)/2;a.eachNode(function(t){var e=t.getValue("value");r+=l*(s?e:1)/2,t.setLayout([h*Math.cos(r)+u,h*Math.sin(r)+c]),r+=l*(s?e:1)/2}),o.setLayout({cx:u,cy:c}),a.eachEdge(function(t){var e,i=t.getModel().get("lineStyle.normal.curveness")||0,o=n.clone(t.node1.getLayout()),a=n.clone(t.node2.getLayout()),r=(o[0]+a[0])/2,s=(o[1]+a[1])/2;+i&&(i*=3,e=[u*i+r*(1-i),c*i+s*(1-i)]),t.setLayout([o,a,e])})}}},function(t,e,i){var n=i(6);t.exports=function(t){t.eachEdge(function(t){var e=t.getModel().get("lineStyle.normal.curveness")||0,i=n.clone(t.node1.getLayout()),o=n.clone(t.node2.getLayout()),a=[i,o];+e&&a.push([(i[0]+o[0])/2-(i[1]-o[1])*e,(i[1]+o[1])/2-(o[0]-i[0])*e]),t.setLayout(a)})}},function(t,e,i){var n=i(244);t.exports=function(t){var e=t.coordinateSystem;if(!e||"view"===e.type){var i=t.getGraph();i.eachNode(function(t){var e=t.getModel();t.setLayout([+e.get("x"),+e.get("y")])}),n(i)}}},function(t,e,i){function n(t,e,i){o.Group.call(this),this.add(this.createLine(t,e,i)),this._updateEffectSymbol(t,e)}var o=i(3),a=i(106),r=i(1),s=i(24),l=i(6),u=i(20),c=n.prototype;c.createLine=function(t,e,i){return new a(t,e,i)},c._updateEffectSymbol=function(t,e){var i=t.getItemModel(e),n=i.getModel("effect"),o=n.get("symbolSize"),a=n.get("symbol");r.isArray(o)||(o=[o,o]);var l=n.get("color")||t.getItemVisual(e,"color"),u=this.childAt(1);this._symbolType!==a&&(this.remove(u),u=s.createSymbol(a,-.5,-.5,1,1,l),u.z2=100,u.culling=!0,this.add(u)),u&&(u.setStyle("shadowColor",l),u.setStyle(n.getItemStyle(["color"])),u.attr("scale",o),u.setColor(l),u.attr("scale",o),this._symbolType=a,this._updateEffectAnimation(t,n,e))},c._updateEffectAnimation=function(t,e,i){var n=this.childAt(1);if(n){var o=this,a=t.getItemLayout(i),s=1e3*e.get("period"),l=e.get("loop"),u=e.get("constantSpeed"),c=r.retrieve(e.get("delay"),function(e){return e/t.count()*s/3}),h="function"==typeof c;if(n.ignore=!0,this.updateAnimationPoints(n,a),u>0&&(s=this.getLineLength(n)/u*1e3),s!==this._period||l!==this._loop){n.stopAnimation();var d=c;h&&(d=c(i)),n.__t>0&&(d=-s*n.__t),n.__t=0;var f=n.animate("",l).when(s,{__t:1}).delay(d).during(function(){o.updateSymbolPosition(n)});l||f.done(function(){o.remove(n)}),f.start()}this._period=s,this._loop=l}},c.getLineLength=function(t){return l.dist(t.__p1,t.__cp1)+l.dist(t.__cp1,t.__p2)},c.updateAnimationPoints=function(t,e){t.__p1=e[0],t.__p2=e[1],t.__cp1=e[2]||[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]},c.updateData=function(t,e,i){this.childAt(0).updateData(t,e,i),this._updateEffectSymbol(t,e)},c.updateSymbolPosition=function(t){var e=t.__p1,i=t.__p2,n=t.__cp1,o=t.__t,a=t.position,r=u.quadraticAt,s=u.quadraticDerivativeAt;a[0]=r(e[0],n[0],i[0],o),a[1]=r(e[1],n[1],i[1],o);var l=s(e[0],n[0],i[0],o),c=s(e[1],n[1],i[1],o);t.rotation=-Math.atan2(c,l)-Math.PI/2,t.ignore=!1},c.updateLayout=function(t,e){this.childAt(0).updateLayout(t,e);var i=t.getItemModel(e).getModel("effect");this._updateEffectAnimation(t,i,e)},r.inherits(n,o.Group),t.exports=n},function(t,e,i){function n(t,e,i){o.Group.call(this),this._createPolyline(t,e,i)}var o=i(3),a=i(1),r=n.prototype;r._createPolyline=function(t,e,i){var n=t.getItemLayout(e),a=new o.Polyline({shape:{points:n}});this.add(a),this._updateCommonStl(t,e,i)},r.updateData=function(t,e,i){var n=t.hostModel,a=this.childAt(0),r={shape:{points:t.getItemLayout(e)}};o.updateProps(a,r,n,e),this._updateCommonStl(t,e,i)},r._updateCommonStl=function(t,e,i){var n=this.childAt(0),r=t.getItemModel(e),s=t.getItemVisual(e,"color"),l=i&&i.lineStyle,u=i&&i.hoverLineStyle;i&&!t.hasItemOption||(l=r.getModel("lineStyle.normal").getLineStyle(),u=r.getModel("lineStyle.emphasis").getLineStyle()),n.useStyle(a.defaults({strokeNoScale:!0,fill:"none",stroke:s},l)),n.hoverStyle=u,o.setHoverStyle(this)},r.updateLayout=function(t,e){var i=this.childAt(0);i.setShape("points",t.getItemLayout(e))},a.inherits(n,o.Group),t.exports=n},function(t,e,i){var n=i(14),o=i(424),a=i(264),r=i(25),s=i(26),l=i(1),u=i(28);t.exports=function(t,e,i,c,h){for(var d=new o(c),f=0;f<t.length;f++)d.addNode(l.retrieve(t[f].id,t[f].name,f),f);for(var p=[],g=[],m=0,f=0;f<e.length;f++){var v=e[f],y=v.source,x=v.target;d.addEdge(y,x,m)&&(g.push(v),p.push(l.retrieve(v.id,y+" > "+x)),m++)}var _,b=i.get("coordinateSystem");if("cartesian2d"===b||"polar"===b)_=u(t,i,i.ecModel);else{var w=s.get(b),S=r((w&&"view"!==w.type?w.dimensions||[]:[]).concat(["value"]),t);_=new n(S,i),_.initData(t)}var M=new n(["value"],i);return M.initData(g,p),h&&h(_,M),a({mainData:_,struct:d,structAttr:"graph",datas:{node:_,edge:M},datasAttr:{node:"data",edge:"edgeData"}}),d.update(),d}},function(t,e,i){var n=i(1),o={};o.layout=function(t,e){e=e||{};var i=t.coordinateSystem,o=t.axis,a={},r=o.position,s=o.orient,l=i.getRect(),u=[l.x,l.x+l.width,l.y,l.y+l.height],c={horizontal:{top:u[2],bottom:u[3]},vertical:{left:u[0],right:u[1]}};a.position=["vertical"===s?c.vertical[r]:u[0],"horizontal"===s?c.horizontal[r]:u[3]];var h={horizontal:0,vertical:1};a.rotation=Math.PI/2*h[s];var d={top:-1,bottom:1,right:1,left:-1};a.labelDirection=a.tickDirection=a.nameDirection=d[r],t.get("axisTick.inside")&&(a.tickDirection=-a.tickDirection),n.retrieve(e.labelInside,t.get("axisLabel.inside"))&&(a.labelDirection=-a.labelDirection);var f=e.rotate;return null==f&&(f=t.get("axisLabel.rotate")),a.labelRotation="top"===r?-f:f,a.labelInterval=o.getLabelInterval(),a.z2=1,a},t.exports=o},function(t,e,i){function n(t,e){var i=t.getItemStyle(),n=t.get("areaColor");return null!=n&&(i.fill=n),i}function o(t,e,i,n,o){i.off("click"),i.off("mousedown"),e.get("selectedMode")&&(i.on("mousedown",function(){t._mouseDownFlag=!0}),i.on("click",function(r){if(t._mouseDownFlag){t._mouseDownFlag=!1;for(var s=r.target;!s.__regions;)s=s.parent;if(s){var l={type:("geo"===e.mainType?"geo":"map")+"ToggleSelect",batch:h.map(s.__regions,function(t){return{name:t.name,from:o.uid}})};l[e.mainType+"Id"]=e.id,n.dispatchAction(l),a(e,i)}}}))}function a(t,e){e.eachChild(function(e){h.each(e.__regions,function(i){e.trigger(t.isSelected(i.name)?"emphasis":"normal")})})}function r(t,e){var i=new c.Group;this._controller=new s(t.getZr()),this._controllerHost={target:e?i:null},this.group=i,this._updateGroup=e,this._mouseDownFlag}var s=i(95),l=i(251),u=i(128),c=i(3),h=i(1);r.prototype={constructor:r,draw:function(t,e,i,r,s){var l="geo"===t.mainType,u=t.getData&&t.getData();l&&e.eachComponent({mainType:"series",subType:"map"},function(e){u||e.getHostGeoModel()!==t||(u=e.getData())});var d=t.coordinateSystem,f=this.group,p=d.scale,g={position:d.position,scale:p};!f.childAt(0)||s?f.attr(g):c.updateProps(f,g,t),f.removeAll();var m=["itemStyle","normal"],v=["itemStyle","emphasis"],y=["label","normal"],x=["label","emphasis"],_=h.createHashMap();h.each(d.regions,function(e){var i=_.get(e.name)||_.set(e.name,new c.Group),o=new c.CompoundPath({shape:{paths:[]}});i.add(o);var a,r=t.getRegionModel(e.name)||t,s=r.getModel(m),d=r.getModel(v),g=n(s,p),b=n(d,p),w=r.getModel(y),S=r.getModel(x);if(u){a=u.indexOfName(e.name);var M=u.getItemVisual(a,"color",!0);M&&(g.fill=M)}var I=w.getModel("textStyle"),T=S.getModel("textStyle");h.each(e.geometries,function(t){if("polygon"===t.type){o.shape.paths.push(new c.Polygon({shape:{points:t.exterior}}));for(var e=0;e<(t.interiors?t.interiors.length:0);e++)o.shape.paths.push(new c.Polygon({shape:{points:t.interiors[e]}}))}}),o.setStyle(g),o.style.strokeNoScale=!0,o.culling=!0;var A=w.get("show"),C=S.get("show"),L=u&&isNaN(u.get("value",a)),D=u&&u.getItemLayout(a);if(l||L&&(A||C)||D&&D.showLabel){var P=u?a:e.name,k=t.getFormattedLabel(P,"normal"),O=t.getFormattedLabel(P,"emphasis"),z=new c.Text({style:{text:A?k||e.name:"",fill:I.getTextColor(),textFont:I.getFont(),textAlign:"center",textVerticalAlign:"middle"},hoverStyle:{text:C?O||e.name:"",fill:T.getTextColor(),textFont:T.getFont()},position:e.center.slice(),scale:[1/p[0],1/p[1]],z2:10,silent:!0});i.add(z)}if(u)u.setItemGraphicEl(a,i);else{var r=t.getRegionModel(e.name);o.eventData={componentType:"geo",geoIndex:t.componentIndex,name:e.name,region:r&&r.option||{}}}var E=i.__regions||(i.__regions=[]);E.push(e),c.setHoverStyle(i,b,{hoverSilentOnTouch:!!t.get("selectedMode")}),f.add(i)}),this._updateController(t,e,i),o(this,t,f,i,r),a(t,f)},remove:function(){this.group.removeAll(),this._controller.dispose(),this._controllerHost={}},_updateController:function(t,e,i){function n(){var e={type:"geoRoam",componentType:s};return e[s+"Id"]=t.id,e}var o=t.coordinateSystem,a=this._controller,r=this._controllerHost;r.zoomLimit=t.get("scaleLimit"),r.zoom=o.getZoom(),a.enable(t.get("roam")||!1);var s=t.mainType;a.off("pan").on("pan",function(t,e){this._mouseDownFlag=!1,l.updateViewOnPan(r,t,e),i.dispatchAction(h.extend(n(),{dx:t,dy:e}))},this),a.off("zoom").on("zoom",function(t,e,o){if(this._mouseDownFlag=!1,l.updateViewOnZoom(r,t,e,o),i.dispatchAction(h.extend(n(),{zoom:t,originX:e,originY:o})),this._updateGroup){var a=this.group,s=a.scale;a.traverse(function(t){"text"===t.type&&t.attr("scale",[1/s[0],1/s[1]])})}},this),a.setPointerChecker(function(e,n,a){return o.getViewRectAfterRoam().contain(n,a)&&!u.onIrrelevantElement(e,i,t)})}},t.exports=r},function(t,e){var i={};i.updateViewOnPan=function(t,e,i){var n=t.target,o=n.position;o[0]+=e,o[1]+=i,n.dirty()},i.updateViewOnZoom=function(t,e,i,n){var o=t.target,a=t.zoomLimit,r=o.position,s=o.scale,l=t.zoom=t.zoom||1;if(l*=e,a){var u=a.min||0,c=a.max||1/0;l=Math.max(Math.min(c,l),u)}var h=l/t.zoom;t.zoom=l,r[0]-=(i-r[0])*(h-1),r[1]-=(n-r[1])*(h-1),s[0]*=h,s[1]*=h,o.dirty()},t.exports=i},function(t,e,i){function n(t,e){var i=t._model;return i.get("axisExpandable")&&i.get("axisExpandTriggerOn")===e}i(263),i(408),i(372);var o=i(2),a=i(1),r=i(37),s=5;o.extendComponentView({type:"parallel",render:function(t,e,i){this._model=t,this._api=i,this._handlers||(this._handlers={},a.each(l,function(t,e){i.getZr().on(e,this._handlers[e]=a.bind(t,this))},this)),r.createOrUpdate(this,"_throttledDispatchExpand",t.get("axisExpandRate"),"fixRate")},dispose:function(t,e){a.each(this._handlers,function(t,i){e.getZr().off(i,t)}),this._handlers=null},_throttledDispatchExpand:function(t){this._dispatchExpand(t)},_dispatchExpand:function(t){t&&this._api.dispatchAction(a.extend({type:"parallelAxisExpand"},t))}});var l={mousedown:function(t){n(this,"click")&&(this._mouseDownPoint=[t.offsetX,t.offsetY])},mouseup:function(t){var e=this._mouseDownPoint;if(n(this,"click")&&e){var i=[t.offsetX,t.offsetY],o=Math.pow(e[0]-i[0],2)+Math.pow(e[1]-i[1],2);if(o>s)return;var a=this._model.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]);"none"!==a.behavior&&this._dispatchExpand({axisExpandWindow:a.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(t){if(!this._mouseDownPoint&&n(this,"mousemove")){var e=this._model,i=e.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]),o=i.behavior;"jump"===o&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===o?null:{axisExpandWindow:i.axisExpandWindow,animation:"jump"===o&&null})}}};o.registerPreprocessor(i(409))},function(t,e,i){i(423),i(357),i(419),i(55),i(360);var n=i(2);n.extendComponentView({type:"single"})},function(t,e,i){var n=i(2),o=i(1),a=i(9),r=i(266),s=i(83),l=i(187),u=s.mapVisual,c=i(5),h=s.eachVisual,d=i(4),f=o.isArray,p=o.each,g=d.asc,m=d.linearMap,v=o.noop,y=["#f6efa6","#d88273","#bf444c"],x=n.extendComponentModel({type:"visualMap",dependencies:["series"],stateList:["inRange","outOfRange"],replacableOptionKeys:["inRange","outOfRange","target","controller","color"],dataBound:[-(1/0),1/0],layoutMode:{type:"box",ignoreSize:!0},defaultOption:{show:!0,zlevel:0,z:4,seriesIndex:null,min:0,max:200,dimension:null,inRange:null,outOfRange:null,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,color:null,formatter:null,text:null,textStyle:{color:"#333"}},init:function(t,e,i){this._dataExtent,this.targetVisuals={},this.controllerVisuals={},this.textStyleModel,this.itemSize,this.mergeDefaultAndTheme(t,i)},optionUpdated:function(t,e){var i=this.option;a.canvasSupported||(i.realtime=!1),!e&&l.replaceVisualOption(i,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},resetVisual:function(t){var e=this.stateList;t=o.bind(t,this),this.controllerVisuals=l.createVisualMappings(this.option.controller,e,t),this.targetVisuals=l.createVisualMappings(this.option.target,e,t)},resetTargetSeries:function(){var t=this.option,e=null==t.seriesIndex;t.seriesIndex=e?[]:c.normalizeToArray(t.seriesIndex),e&&this.ecModel.eachSeries(function(e,i){t.seriesIndex.push(i)})},eachTargetSeries:function(t,e){o.each(this.option.seriesIndex,function(i){t.call(e,this.ecModel.getSeriesByIndex(i))},this)},isTargetSeries:function(t){var e=!1;return this.eachTargetSeries(function(i){i===t&&(e=!0)}),e},formatValueText:function(t,e,i){function n(t){return t===u[0]?"min":t===u[1]?"max":(+t).toFixed(l)}var a,r,s=this.option,l=s.precision,u=this.dataBound,c=s.formatter;return i=i||["<",">"],o.isArray(t)&&(t=t.slice(),a=!0),r=e?t:a?[n(t[0]),n(t[1])]:n(t),o.isString(c)?c.replace("{value}",a?r[0]:r).replace("{value2}",a?r[1]:r):o.isFunction(c)?a?c(t[0],t[1]):c(t):a?t[0]===u[0]?i[0]+" "+r[1]:t[1]===u[1]?i[1]+" "+r[0]:r[0]+" - "+r[1]:r},resetExtent:function(){var t=this.option,e=g([t.min,t.max]);this._dataExtent=e},getDataDimension:function(t){var e=this.option.dimension;return null!=e?e:t.dimensions.length-1},getExtent:function(){return this._dataExtent.slice()},completeVisualOption:function(){function t(t){f(n.color)&&!t.inRange&&(t.inRange={color:n.color.slice().reverse()}),t.inRange=t.inRange||{color:y},p(this.stateList,function(e){var i=t[e];if(o.isString(i)){var n=r.get(i,"active",d);n?(t[e]={},t[e][i]=n):delete t[e]}},this)}function e(t,e,i){var n=t[e],o=t[i];n&&!o&&(o=t[i]={},p(n,function(t,e){if(s.isValidType(e)){var i=r.get(e,"inactive",d);null!=i&&(o[e]=i,"color"!==e||o.hasOwnProperty("opacity")||o.hasOwnProperty("colorAlpha")||(o.opacity=[0,0]))}}))}function i(t){var e=(t.inRange||{}).symbol||(t.outOfRange||{}).symbol,i=(t.inRange||{}).symbolSize||(t.outOfRange||{}).symbolSize,n=this.get("inactiveColor");p(this.stateList,function(a){var r=this.itemSize,s=t[a];s||(s=t[a]={color:d?n:[n]}),null==s.symbol&&(s.symbol=e&&o.clone(e)||(d?"roundRect":["roundRect"])),null==s.symbolSize&&(s.symbolSize=i&&o.clone(i)||(d?r[0]:[r[0],r[0]])),s.symbol=u(s.symbol,function(t){return"none"===t||"square"===t?"roundRect":t});var l=s.symbolSize;if(null!=l){var c=-(1/0);h(l,function(t){t>c&&(c=t)}),s.symbolSize=u(l,function(t){return m(t,[0,c],[0,r[0]],!0)})}},this)}var n=this.option,a={inRange:n.inRange,outOfRange:n.outOfRange},l=n.target||(n.target={}),c=n.controller||(n.controller={});o.merge(l,a),o.merge(c,a);var d=this.isCategory();t.call(this,l),t.call(this,c),e.call(this,l,"inRange","outOfRange"),i.call(this,c)},resetItemSize:function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},isCategory:function(){return!!this.option.categories},setSelected:v,getValueState:v,getVisualMeta:v});t.exports=x},function(t,e,i){var n=i(1),o=i(3),a=i(7),r=i(12),s=i(2),l=i(83);t.exports=s.extendComponentView({type:"visualMap",autoPositionValues:{left:1,right:1,top:1,bottom:1},init:function(t,e){this.ecModel=t,this.api=e,this.visualMapModel},render:function(t,e,i,n){return this.visualMapModel=t,t.get("show")===!1?void this.group.removeAll():void this.doRender.apply(this,arguments)},renderBackground:function(t){var e=this.visualMapModel,i=a.normalizeCssArray(e.get("padding")||0),n=t.getBoundingRect();t.add(new o.Rect({z2:-1,silent:!0,shape:{x:n.x-i[3],y:n.y-i[0],width:n.width+i[3]+i[1],height:n.height+i[0]+i[2]},style:{fill:e.get("backgroundColor"),stroke:e.get("borderColor"),lineWidth:e.get("borderWidth")}}))},getControllerVisual:function(t,e,i){function o(t){return u[t]}function a(t,e){u[t]=e}i=i||{};var r=i.forceState,s=this.visualMapModel,u={};if("symbol"===e&&(u.symbol=s.get("itemSymbol")),"color"===e){var c=s.get("contentColor");u.color=c}var h=s.controllerVisuals[r||s.getValueState(t)],d=l.prepareVisualTypes(h);return n.each(d,function(n){var r=h[n];i.convertOpacityToAlpha&&"opacity"===n&&(n="colorAlpha",r=h.__alphaForOpacity),l.dependsOn(n,e)&&r&&r.applyVisual(t,o,a)}),u[e]},positionGroup:function(t){var e=this.visualMapModel,i=this.api;r.positionElement(t,e.getBoxLayoutParams(),{width:i.getWidth(),height:i.getHeight()})},doRender:n.noop})},function(t,e,i){var n=i(1),o=i(12),a={getItemAlign:function(t,e,i){var n=t.option,a=n.align;if(null!=a&&"auto"!==a)return a;for(var r={width:e.getWidth(),height:e.getHeight()},s="horizontal"===n.orient?1:0,l=[["left","right","width"],["top","bottom","height"]],u=l[s],c=[0,null,10],h={},d=0;d<3;d++)h[l[1-s][d]]=c[d],h[u[d]]=2===d?i[0]:n[u[d]];var f=[["x","width",3],["y","height",0]][s],p=o.getLayoutRect(h,r,n.padding);return u[(p.margin[f[2]]||0)+p[f[0]]+.5*p[f[1]]<.5*r[f[1]]?0:1]},convertDataIndex:function(t){return n.each(t||[],function(e){null!=t.dataIndex&&(t.dataIndexInside=t.dataIndex,t.dataIndex=null)}),t}};t.exports=a},function(t,e,i){function n(t,e){return t&&t.hasOwnProperty&&t.hasOwnProperty(e)}var o=i(1),a=o.each;t.exports=function(t){var e=t&&t.visualMap;o.isArray(e)||(e=e?[e]:[]),a(e,function(t){if(t){n(t,"splitList")&&!n(t,"pieces")&&(t.pieces=t.splitList,delete t.splitList);var e=t.pieces;e&&o.isArray(e)&&a(e,function(t){o.isObject(t)&&(n(t,"start")&&!n(t,"min")&&(t.min=t.start),n(t,"end")&&!n(t,"max")&&(t.max=t.end))})}})}},function(t,e,i){i(13).registerSubTypeDefaulter("visualMap",function(t){return t.categories||(t.pieces?t.pieces.length>0:t.splitNumber>0)&&!t.calculable?"piecewise":"continuous"})},function(t,e,i){function n(t,e){t.eachTargetSeries(function(e){var i=e.getData();s.applyVisual(t.stateList,t.targetVisuals,i,t.getValueState,t,t.getDataDimension(i))})}function o(t){t.eachSeries(function(e){var i=e.getData(),n=[];t.eachComponent("visualMap",function(t){if(t.isTargetSeries(e)){var o=t.getVisualMeta(u.bind(a,null,e,t))||{stops:[],outerColors:[]};o.dimension=t.getDataDimension(i),n.push(o)}}),e.getData().setVisual("visualMeta",n)})}function a(t,e,i,n){function o(t){return u[t]}function a(t,e){u[t]=e}for(var r=e.targetVisuals[n],s=l.prepareVisualTypes(r),u={color:t.getData().getVisual("color")},c=0,h=s.length;c<h;c++){var d=s[c],f=r["opacity"===d?"__alphaForOpacity":d];f&&f.applyVisual(i,o,a)}return u.color}var r=i(2),s=i(187),l=i(83),u=i(1);r.registerVisual(r.PRIORITY.VISUAL.COMPONENT,function(t){t.eachComponent("visualMap",function(e){n(e,t)}),o(t)})},function(t,e,i){var n=i(2),o={type:"selectDataRange",event:"dataRangeSelected",update:"update"};n.registerAction(o,function(t,e){e.eachComponent({mainType:"visualMap",query:t},function(e){e.setSelected(t.selected)})})},function(t,e,i){function n(){l.call(this)}function o(t){this.name=t,this.zoomLimit,l.call(this),this._roamTransform=new n,this._viewTransform=new n,this._center,this._zoom}function a(t,e,i,n){var o=i.seriesModel,a=o?o.coordinateSystem:null;return a===this?a[t](n):null}var r=i(6),s=i(19),l=i(58),u=i(1),c=i(11),h=r.applyTransform;u.mixin(n,l),o.prototype={constructor:o,type:"view",dimensions:["x","y"],setBoundingRect:function(t,e,i,n){return this._rect=new c(t,e,i,n),this._rect},getBoundingRect:function(){return this._rect},setViewRect:function(t,e,i,n){this.transformTo(t,e,i,n),this._viewRect=new c(t,e,i,n)},transformTo:function(t,e,i,n){var o=this.getBoundingRect(),a=this._viewTransform;a.transform=o.calculateTransform(new c(t,e,i,n)),a.decomposeTransform(),this._updateTransform()},setCenter:function(t){t&&(this._center=t,this._updateCenterAndZoom())},setZoom:function(t){t=t||1;var e=this.zoomLimit;e&&(null!=e.max&&(t=Math.min(e.max,t)),null!=e.min&&(t=Math.max(e.min,t))),this._zoom=t,this._updateCenterAndZoom()},getDefaultCenter:function(){var t=this.getBoundingRect(),e=t.x+t.width/2,i=t.y+t.height/2;return[e,i]},getCenter:function(){return this._center||this.getDefaultCenter()},getZoom:function(){return this._zoom||1},getRoamTransform:function(){return this._roamTransform},_updateCenterAndZoom:function(){var t=this._viewTransform.getLocalTransform(),e=this._roamTransform,i=this.getDefaultCenter(),n=this.getCenter(),o=this.getZoom();n=r.applyTransform([],n,t),i=r.applyTransform([],i,t),e.origin=n,e.position=[i[0]-n[0],i[1]-n[1]],e.scale=[o,o],this._updateTransform()},_updateTransform:function(){var t=this._roamTransform,e=this._viewTransform;e.parent=t,t.updateTransform(),e.updateTransform(),e.transform&&s.copy(this.transform||(this.transform=[]),e.transform),this.transform?(this.invTransform=this.invTransform||[],s.invert(this.invTransform,this.transform)):this.invTransform=null,this.decomposeTransform()},getViewRect:function(){return this._viewRect},getViewRectAfterRoam:function(){var t=this.getBoundingRect().clone();return t.applyTransform(this.transform),t},dataToPoint:function(t){var e=this.transform;return e?h([],t,e):[t[0],t[1]]},pointToData:function(t){var e=this.invTransform;return e?h([],t,e):[t[0],t[1]]},convertToPixel:u.curry(a,"dataToPoint"),convertFromPixel:u.curry(a,"pointToData"),containPoint:function(t){return this.getViewRectAfterRoam().contain(t[0],t[1])}},u.mixin(o,l),t.exports=o},function(t,e,i){function n(t){if(!t.UTF8Encoding)return t;var e=t.UTF8Scale;null==e&&(e=1024);for(var i=t.features,n=0;n<i.length;n++)for(var a=i[n],r=a.geometry,s=r.coordinates,l=r.encodeOffsets,u=0;u<s.length;u++){var c=s[u];if("Polygon"===r.type)s[u]=o(c,l[u],e);else if("MultiPolygon"===r.type)for(var h=0;h<c.length;h++){var d=c[h];c[h]=o(d,l[u][h],e)}}return t.UTF8Encoding=!1,t}function o(t,e,i){for(var n=[],o=e[0],a=e[1],r=0;r<t.length;r+=2){var s=t.charCodeAt(r)-64,l=t.charCodeAt(r+1)-64;s=s>>1^-(1&s),l=l>>1^-(1&l),s+=o,l+=a,o=s,a=l,n.push([s/i,l/i])}return n}var a=i(1),r=i(236);t.exports=function(t){return n(t),a.map(a.filter(t.features,function(t){return t.geometry&&t.properties&&t.geometry.coordinates.length>0}),function(t){var e=t.properties,i=t.geometry,n=i.coordinates,o=[];"Polygon"===i.type&&o.push({type:"polygon",exterior:n[0],interiors:n.slice(1)}),"MultiPolygon"===i.type&&a.each(n,function(t){t[0]&&o.push({type:"polygon",exterior:t[0],interiors:t.slice(1)})});var s=new r(e.name,o,e.cp);return s.properties=e,s})}},function(t,e,i){function n(t,e){var i=[];return t.eachComponent("parallel",function(n,a){var r=new o(n,t,e);r.name="parallel_"+a,r.resize(n,e),n.coordinateSystem=r,r.model=n,i.push(r)}),t.eachSeries(function(e){if("parallel"===e.get("coordinateSystem")){var i=t.queryComponents({mainType:"parallel",index:e.get("parallelIndex"),id:e.get("parallelId")})[0];e.coordinateSystem=i.coordinateSystem}}),i}var o=i(406);i(26).register("parallel",{create:n})},function(t,e,i){function n(t){var e=t.mainData,i=t.datas;i||(i={main:e},t.datasAttr={main:"data"}),t.datas=t.mainData=null,u(e,i,t),d(i,function(i){d(e.TRANSFERABLE_METHODS,function(e){i.wrapMethod(e,h.curry(o,t))})}),e.wrapMethod("cloneShallow",h.curry(r,t)),d(e.CHANGABLE_METHODS,function(i){e.wrapMethod(i,h.curry(a,t))}),h.assert(i[e.dataType]===e)}function o(t,e){if(l(this)){var i=h.extend({},this[f]);i[this.dataType]=e,u(e,i,t)}else c(e,this.dataType,this[p],t);return e}function a(t,e){return t.struct&&t.struct.update(this),e}function r(t,e){return d(e[f],function(i,n){i!==e&&c(i.cloneShallow(),n,e,t)}),e}function s(t){var e=this[p];return null==t||null==e?e:e[f][t]}function l(t){return t[p]===t}function u(t,e,i){t[f]={},d(e,function(e,n){c(e,n,t,i)})}function c(t,e,i,n){i[f][e]=t,t[p]=i,t.dataType=e,n.struct&&(t[n.structAttr]=n.struct,n.struct[n.datasAttr[e]]=t),t.getLinkedData=s}var h=i(1),d=h.each,f="\0__link_datas",p="\0__link_mainData";t.exports=n},function(t,e,i){function n(){function t(e,n){if(n>=i.length)return e;for(var a=-1,r=e.length,s=i[n++],l={},u={};++a<r;){var c=s(e[a]),h=u[c];h?h.push(e[a]):u[c]=[e[a]]}return o.each(u,function(e,i){l[i]=t(e,n)}),l}function e(t,a){if(a>=i.length)return t;var r=[],s=n[a++];return o.each(t,function(t,i){r.push({key:i,values:e(t,a)})}),s?r.sort(function(t,e){return s(t.key,e.key)}):r}var i=[],n=[];return{key:function(t){return i.push(t),this},sortKeys:function(t){return n[i.length-1]=t,this},entries:function(i){return e(t(i,0),0)}}}var o=i(1);t.exports=n},function(t,e,i){var n=i(1),o={get:function(t,e,i){var o=n.clone((a[t]||{})[e]);return i&&n.isArray(o)?o[o.length-1]:o}},a={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}};t.exports=o},function(t,e,i){function n(t,e){return Math.abs(t-e)<r}function o(t,e,i){var o=0,r=t[0];if(!r)return!1;for(var s=1;s<t.length;s++){var l=t[s];o+=a(r[0],r[1],l[0],l[1],e,i),r=l}var u=t[0];return n(r[0],u[0])&&n(r[1],u[1])||(o+=a(r[0],r[1],u[0],u[1],e,i)),0!==o}var a=i(99),r=1e-8;t.exports={contain:o}},function(t,e,i){var n=i(90).extend({type:"series.pictorialBar",dependencies:["grid"],defaultOption:{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",progressive:0,hoverAnimation:!1},getInitialData:function(t){return t.stack=null,n.superApply(this,"getInitialData",arguments)}});t.exports=n},function(t,e,i){function n(t,e,i,n){var a=t.getItemLayout(e),u=i.get("symbolRepeat"),c=i.get("symbolClip"),h=i.get("symbolPosition")||"start",d=i.get("symbolRotate"),f=(d||0)*Math.PI/180||0,p=i.get("symbolPatternSize")||2,g=i.isAnimationEnabled(),m={dataIndex:e,layout:a,itemModel:i,symbolType:t.getItemVisual(e,"symbol")||"circle",color:t.getItemVisual(e,"color"),symbolClip:c,symbolRepeat:u,symbolRepeatDirection:i.get("symbolRepeatDirection"),symbolPatternSize:p,rotation:f,animationModel:g?i:null,hoverAnimation:g&&i.get("hoverAnimation"),z2:i.getShallow("z",!0)||0};o(i,u,a,n,m),r(t,e,a,u,c,m.boundingLength,m.pxSign,p,n,m),s(i,m.symbolScale,f,n,m);var v=m.symbolSize,y=i.get("symbolOffset");return T.isArray(y)&&(y=[P(y[0],v[0]),P(y[1],v[1])]),l(i,v,a,u,c,y,h,m.valueLineWidth,m.boundingLength,m.repeatCutLength,n,m),m}function o(t,e,i,n,o){var r,s=n.valueDim,l=t.get("symbolBoundingData"),u=n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()),c=u.toGlobalCoord(u.dataToCoord(0)),h=1-+(i[s.wh]<=0);if(T.isArray(l)){var d=[a(u,l[0])-c,a(u,l[1])-c];d[1]<d[0]&&d.reverse(),r=d[h]}else r=null!=l?a(u,l)-c:e?n.coordSysExtent[s.index][h]-c:i[s.wh];o.boundingLength=r,e&&(o.repeatCutLength=i[s.wh]),o.pxSign=r>0?1:r<0?-1:0}function a(t,e){return t.toGlobalCoord(t.dataToCoord(t.scale.parse(e)))}function r(t,e,i,n,o,a,r,s,l,u){var c=l.valueDim,h=l.categoryDim,d=Math.abs(i[h.wh]),f=t.getItemVisual(e,"symbolSize");T.isArray(f)?f=f.slice():(null==f&&(f="100%"),f=[f,f]),f[h.index]=P(f[h.index],d),f[c.index]=P(f[c.index],n?d:Math.abs(a)),u.symbolSize=f;var p=u.symbolScale=[f[0]/s,f[1]/s];p[c.index]*=(l.isHorizontal?-1:1)*r}function s(t,e,i,n,o){var a=t.get(k)||0;a&&(z.attr({scale:e.slice(),rotation:i}),z.updateTransform(),a/=z.getLineScale(),a*=e[n.valueDim.index]),o.valueLineWidth=a}function l(t,e,i,n,o,a,r,s,l,u,c,h){var d=c.categoryDim,f=c.valueDim,p=h.pxSign,g=Math.max(e[f.index]+s,0),m=g;if(n){var v=Math.abs(l),y=T.retrieve(t.get("symbolMargin"),"15%")+"",x=!1;y.lastIndexOf("!")===y.length-1&&(x=!0,y=y.slice(0,y.length-1)),y=P(y,e[f.index]);var _=Math.max(g+2*y,0),b=x?0:2*y,w=L.isNumeric(n),S=w?n:I((v+b)/_),M=v-S*g;y=M/2/(x?S:S-1),_=g+2*y,b=x?0:2*y,w||"fixed"===n||(S=u?I((Math.abs(u)+b)/_):0),m=S*_-b,h.repeatTimes=S,h.symbolMargin=y}var A=p*(m/2),C=h.pathPosition=[];C[d.index]=i[d.wh]/2,C[f.index]="start"===r?A:"end"===r?l-A:l/2,a&&(C[0]+=a[0],C[1]+=a[1]);var D=h.bundlePosition=[];D[d.index]=i[d.xy],D[f.index]=i[f.xy];var k=h.barRectShape=T.extend({},i);k[f.wh]=p*Math.max(Math.abs(i[f.wh]),Math.abs(C[f.index]+A)),k[d.wh]=i[d.wh];var O=h.clipShape={};O[d.xy]=-i[d.xy],O[d.wh]=c.ecSize[d.wh],O[f.xy]=0,O[f.wh]=i[f.wh]}function u(t){var e=t.symbolPatternSize,i=C.createSymbol(t.symbolType,-e/2,-e/2,e,e,t.color);return i.attr({culling:!0}),"image"!==i.type&&i.setStyle({strokeNoScale:!0}),i}function c(t,e,i,n){function o(t){var e=h.slice(),n=i.pxSign,o=t;return("start"===i.symbolRepeatDirection?n>0:n<0)&&(o=f-1-t),e[d.index]=g*(o-f/2+.5)+h[d.index],{position:e,scale:i.symbolScale.slice(),rotation:i.rotation}}function a(){w(t,function(t){t.trigger("emphasis")})}function r(){w(t,function(t){t.trigger("normal")})}var s=t.__pictorialBundle,l=i.symbolSize,c=i.valueLineWidth,h=i.pathPosition,d=e.valueDim,f=i.repeatTimes||0,p=0,g=l[e.valueDim.index]+c+2*i.symbolMargin;for(w(t,function(t){t.__pictorialAnimationIndex=p,t.__pictorialRepeatTimes=f,p<f?S(t,null,o(p),i,n):S(t,null,{scale:[0,0]},i,n,function(){s.remove(t)}),v(t,i),p++});p<f;p++){var m=u(i);m.__pictorialAnimationIndex=p,m.__pictorialRepeatTimes=f,s.add(m);var y=o(p,!0);S(m,{position:y.position,scale:[0,0]},{scale:y.scale,rotation:y.rotation},i,n),m.on("mouseover",a).on("mouseout",r),v(m,i)}}function h(t,e,i,n){function o(){this.trigger("emphasis")}function a(){this.trigger("normal")}var r=t.__pictorialBundle,s=t.__pictorialMainPath;s?S(s,null,{position:i.pathPosition.slice(),scale:i.symbolScale.slice(),rotation:i.rotation},i,n):(s=t.__pictorialMainPath=u(i),r.add(s),S(s,{position:i.pathPosition.slice(),scale:[0,0],rotation:i.rotation},{scale:i.symbolScale.slice()},i,n),s.on("mouseover",o).on("mouseout",a)),v(s,i)}function d(t,e,i){var n=T.extend({},e.barRectShape),o=t.__pictorialBarRect;o?S(o,null,{shape:n},e,i):(o=t.__pictorialBarRect=new A.Rect({z2:2,shape:n,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),t.add(o))}function f(t,e,i,n){if(i.symbolClip){var o=t.__pictorialClipPath,a=T.extend({},i.clipShape),r=e.valueDim,s=i.animationModel,l=i.dataIndex;if(o)A.updateProps(o,{shape:a},s,l);else{a[r.wh]=0,o=new A.Rect({shape:a}),t.__pictorialBundle.setClipPath(o),t.__pictorialClipPath=o;var u={};u[r.wh]=i.clipShape[r.wh],A[n?"updateProps":"initProps"](o,{shape:u},s,l)}}}function p(t,e){var i=t.getItemModel(e);return i.getAnimationDelayParams=g,i.isAnimationEnabled=m,i}function g(t){return{index:t.__pictorialAnimationIndex,count:t.__pictorialRepeatTimes}}function m(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function v(t,e){t.off("emphasis").off("normal");var i=e.symbolScale.slice();e.hoverAnimation&&t.on("emphasis",function(){this.animateTo({scale:[1.1*i[0],1.1*i[1]]},400,"elasticOut")}).on("normal",function(){this.animateTo({scale:i.slice()},400,"elasticOut")})}function y(t,e,i,n){var o=new A.Group,a=new A.Group;return o.add(a),o.__pictorialBundle=a,a.attr("position",i.bundlePosition.slice()),i.symbolRepeat?c(o,e,i):h(o,e,i),d(o,i,n),f(o,e,i,n),o.__pictorialShapeStr=b(t,i),o.__pictorialSymbolMeta=i,o}function x(t,e,i){var n=i.animationModel,o=i.dataIndex,a=t.__pictorialBundle;A.updateProps(a,{position:i.bundlePosition.slice()},n,o),i.symbolRepeat?c(t,e,i,!0):h(t,e,i,!0),d(t,i,!0),f(t,e,i,!0)}function _(t,e,i,n){var o=n.__pictorialBarRect;o&&(o.style.text="");var a=[];w(n,function(t){a.push(t)}),n.__pictorialMainPath&&a.push(n.__pictorialMainPath),n.__pictorialClipPath&&(i=null),T.each(a,function(t){A.updateProps(t,{scale:[0,0]},i,e,function(){n.parent&&n.parent.remove(n)})}),t.setItemGraphicEl(e,null)}function b(t,e){return[t.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function w(t,e,i){T.each(t.__pictorialBundle.children(),function(n){n!==t.__pictorialBarRect&&e.call(i,n)})}function S(t,e,i,n,o,a){e&&t.attr(e),n.symbolClip&&!o?i&&t.attr(i):i&&A[o?"updateProps":"initProps"](t,i,n.animationModel,n.dataIndex,a)}function M(t,e,i){var n=i.color,o=i.dataIndex,a=i.itemModel,r=a.getModel("itemStyle.normal").getItemStyle(["color"]),s=a.getModel("itemStyle.emphasis").getItemStyle(),l=a.getShallow("cursor");w(t,function(t){t.setColor(n),t.setStyle(T.defaults({fill:n,opacity:i.opacity},r)),A.setHoverStyle(t,s),l&&(t.cursor=l),t.z2=i.z2});var u={},c=e.valueDim.posDesc[+(i.boundingLength>0)],h=t.__pictorialBarRect;D.setLabel(h.style,u,a,n,e.seriesModel,o,c),A.setHoverStyle(h,u)}function I(t){var e=Math.round(t);return Math.abs(t-e)<1e-4?e:Math.ceil(t)}var T=i(1),A=i(3),C=i(24),L=i(4),D=i(91),P=L.parsePercent,k=["itemStyle","normal","borderWidth"],O=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],z=new A.Circle,E=i(2).extendChartView({type:"pictorialBar",render:function(t,e,i){var o=this.group,a=t.getData(),r=this._data,s=t.coordinateSystem,l=s.getBaseAxis(),u=!!l.isHorizontal(),c=s.grid.getRect(),h={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:t,coordSys:s,coordSysExtent:[[c.x,c.x+c.width],[c.y,c.y+c.height]],isHorizontal:u,valueDim:O[+u],categoryDim:O[1-u]};return a.diff(r).add(function(t){if(a.hasValue(t)){var e=p(a,t),i=n(a,t,e,h),r=y(a,h,i);a.setItemGraphicEl(t,r),o.add(r),M(r,h,i)}}).update(function(t,e){var i=r.getItemGraphicEl(e);if(!a.hasValue(t))return void o.remove(i);var s=p(a,t),l=n(a,t,s,h),u=b(a,l);i&&u!==i.__pictorialShapeStr&&(o.remove(i),a.setItemGraphicEl(t,null),i=null),i?x(i,h,l):i=y(a,h,l,!0),a.setItemGraphicEl(t,i),i.__pictorialSymbolMeta=l,o.add(i),M(i,h,l)}).remove(function(t){var e=r.getItemGraphicEl(t);e&&_(r,t,e.__pictorialSymbolMeta.animationModel,e)}).execute(),this._data=a,this.group},dispose:T.noop,remove:function(t,e){var i=this.group,n=this._data;t.get("animation")?n&&n.eachItemGraphicEl(function(e){_(n,e.dataIndex,t,e)}):i.removeAll()}});t.exports=E},function(t,e,i){var n=i(2);i(271),i(272),n.registerVisual(i(274)),n.registerLayout(i(273))},function(t,e,i){"use strict";var n=i(1),o=i(17),a=i(183),r=o.extend({type:"series.boxplot",dependencies:["xAxis","yAxis","grid"],defaultValueDimensions:["min","Q1","median","Q3","max"],dimensions:null,defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,layout:null,boxWidth:[7,50],itemStyle:{normal:{color:"#fff",borderWidth:1},emphasis:{borderWidth:2,shadowBlur:5,shadowOffsetX:2,shadowOffsetY:2,shadowColor:"rgba(0,0,0,0.4)"}},animationEasing:"elasticOut",animationDuration:800}});n.mixin(r,a.seriesModelMixin,!0),t.exports=r},function(t,e,i){"use strict";function n(t,e,i){var n=e.getItemModel(i),o=n.getModel(u),a=e.getItemVisual(i,"color"),s=o.getItemStyle(["borderColor"]),l=t.childAt(t.whiskerIndex);l.style.set(s),l.style.stroke=a,l.dirty();var h=t.childAt(t.bodyIndex);h.style.set(s),h.style.stroke=a,h.dirty();var d=n.getModel(c).getItemStyle();r.setHoverStyle(t,d)}var o=i(1),a=i(30),r=i(3),s=i(183),l=a.extend({type:"boxplot",getStyleUpdater:function(){return n},dispose:o.noop});o.mixin(l,s.viewMixin,!0);var u=["itemStyle","normal"],c=["itemStyle","emphasis"];t.exports=l},function(t,e,i){function n(t){var e=[],i=[];return t.eachSeriesByType("boxplot",function(t){var n=t.getBaseAxis(),o=r.indexOf(i,n);o<0&&(o=i.length,i[o]=n,e[o]={axis:n,seriesModels:[]}),e[o].seriesModels.push(t)}),e}function o(t){var e,i,n=t.axis,o=t.seriesModels,a=o.length,s=t.boxWidthList=[],c=t.boxOffsetList=[],h=[];if("category"===n.type)i=n.getBandWidth();else{var d=0;u(o,function(t){d=Math.max(d,t.getData().count())}),e=n.getExtent(),Math.abs(e[1]-e[0])/d}u(o,function(t){var e=t.get("boxWidth");r.isArray(e)||(e=[e,e]),h.push([l(e[0],i)||0,l(e[1],i)||0])});var f=.8*i-2,p=f/a*.3,g=(f-p*(a-1))/a,m=g/2-f/2;u(o,function(t,e){c.push(m),m+=p+g,s.push(Math.min(Math.max(g,h[e][0]),h[e][1]))})}function a(t,e,i){var n,o=t.coordinateSystem,a=t.getData(),s=i/2,l=t.get("layout"),u="horizontal"===l?0:1,c=1-u,h=["x","y"],d=[];r.each(a.dimensions,function(t){var e=a.getDimensionInfo(t),i=e.coordDim;i===h[c]?d.push(t):i===h[u]&&(n=t)}),null==n||d.length<5||a.each([n].concat(d),function(){function t(t){var i=[];i[u]=h,i[c]=t;var n;return isNaN(h)||isNaN(t)?n=[NaN,NaN]:(n=o.dataToPoint(i),n[u]+=e),n}function i(t,e){var i=t.slice(),n=t.slice();i[u]+=s,n[u]-=s,e?y.push(i,n):y.push(n,i)}function n(t){var e=[t.slice(),t.slice()];e[0][u]-=s,e[1][u]+=s,v.push(e)}var r=arguments,h=r[0],f=r[d.length+1],p=t(r[3]),g=t(r[1]),m=t(r[5]),v=[[g,t(r[2])],[m,t(r[4])]];n(g),n(m),n(p);var y=[];i(v[0][1],0),i(v[1][1],1),a.setItemLayout(f,{chartLayout:l,initBaseline:p[c],median:p,bodyEnds:y,whiskerEnds:v})})}var r=i(1),s=i(4),l=s.parsePercent,u=r.each;t.exports=function(t){var e=n(t);u(e,function(t){var e=t.seriesModels;e.length&&(o(t),u(e,function(e,i){a(e,t.boxOffsetList[i],t.boxWidthList[i])}))})}},function(t,e){var i=["itemStyle","normal","borderColor"];t.exports=function(t,e){var n=t.get("color");t.eachRawSeriesByType("boxplot",function(e){var o=n[e.seriesIndex%n.length],a=e.getData();a.setVisual({legendSymbol:"roundRect",color:e.get(i)||o}),t.isSeriesFiltered(e)||a.each(function(t){var e=a.getItemModel(t);a.setItemVisual(t,{color:e.get(i,!0)})})})}},function(t,e,i){var n=i(2);i(276),i(277),n.registerPreprocessor(i(280)),n.registerVisual(i(279)),n.registerLayout(i(278))},function(t,e,i){"use strict";var n=i(1),o=i(17),a=i(183),r=o.extend({type:"series.candlestick",dependencies:["xAxis","yAxis","grid"],defaultValueDimensions:["open","close","lowest","highest"],dimensions:null,defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,layout:null,itemStyle:{normal:{color:"#c23531",color0:"#314656",borderWidth:1,borderColor:"#c23531",borderColor0:"#314656"},emphasis:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,animationUpdate:!1,animationEasing:"linear",animationDuration:300},getShadowDim:function(){return"open"},brushSelector:function(t,e,i){var n=e.getItemLayout(t);return i.rect(n.brushRect)}});n.mixin(r,a.seriesModelMixin,!0),t.exports=r},function(t,e,i){"use strict";function n(t,e,i){var n=e.getItemModel(i),o=n.getModel(u),a=e.getItemVisual(i,"color"),s=e.getItemVisual(i,"borderColor")||a,l=o.getItemStyle(["color","color0","borderColor","borderColor0"]),h=t.childAt(t.whiskerIndex);h.useStyle(l),h.style.stroke=s;var d=t.childAt(t.bodyIndex);d.useStyle(l),d.style.fill=a,d.style.stroke=s;var f=n.getModel(c).getItemStyle();r.setHoverStyle(t,f)}var o=i(1),a=i(30),r=i(3),s=i(183),l=a.extend({type:"candlestick",getStyleUpdater:function(){return n},dispose:o.noop});o.mixin(l,s.viewMixin,!0);var u=["itemStyle","normal"],c=["itemStyle","emphasis"];t.exports=l},function(t,e,i){function n(t,e){var i,n=t.getBaseAxis(),o="category"===n.type?n.getBandWidth():(i=n.getExtent(),Math.abs(i[1]-i[0])/e.count()),s=r(a(t.get("barMaxWidth"),o),o),l=r(a(t.get("barMinWidth"),1),o),u=t.get("barWidth");return null!=u?r(u,o):Math.max(Math.min(o/2,s),l)}var o=i(1),a=i(1).retrieve,r=i(4).parsePercent;t.exports=function(t){t.eachSeriesByType("candlestick",function(t){var e,i=t.coordinateSystem,a=t.getData(),r=n(t,a),s=t.get("layout"),l="horizontal"===s?0:1,u=1-l,c=["x","y"],h=[];o.each(a.dimensions,function(t){var i=a.getDimensionInfo(t),n=i.coordDim;n===c[u]?h.push(t):n===c[l]&&(e=t)}),null==e||h.length<4||a.each([e].concat(h),function(){function t(t){var e=[];return e[l]=c,e[u]=t,isNaN(c)||isNaN(t)?[NaN,NaN]:i.dataToPoint(e)}function e(t,e){var i=t.slice(),n=t.slice();i[l]+=r/2,n[l]-=r/2,e?M.push(i,n):M.push(n,i)}function n(){var e=t(Math.min(f,p,g,m)),i=t(Math.max(f,p,g,m));return e[l]-=r/2,i[l]-=r/2,{x:e[0],y:e[1],width:u?r:i[0]-e[0],height:u?i[1]-e[1]:r}}var o=arguments,c=o[0],d=o[h.length+1],f=o[1],p=o[2],g=o[3],m=o[4],v=Math.min(f,p),y=Math.max(f,p),x=t(v),_=t(y),b=t(g),w=t(m),S=[[w,_],[b,x]],M=[];e(_,0),e(x,1),a.setItemLayout(d,{chartLayout:s,sign:f>p?-1:f<p?1:0,initBaseline:f>p?_[u]:x[u],bodyEnds:M,whiskerEnds:S,brushRect:n()})},!0)})}},function(t,e){var i=["itemStyle","normal","borderColor"],n=["itemStyle","normal","borderColor0"],o=["itemStyle","normal","color"],a=["itemStyle","normal","color0"];t.exports=function(t,e){t.eachRawSeriesByType("candlestick",function(e){var r=e.getData();r.setVisual({legendSymbol:"roundRect"}),t.isSeriesFiltered(e)||r.each(function(t){var e=r.getItemModel(t),s=r.getItemLayout(t).sign;r.setItemVisual(t,{color:e.get(s>0?o:a),borderColor:e.get(s>0?i:n)})})})}},function(t,e,i){var n=i(1);t.exports=function(t){t&&n.isArray(t.series)&&n.each(t.series,function(t){n.isObject(t)&&"k"===t.type&&(t.type="candlestick")})}},function(t,e,i){function n(t){var e,i=t.type;if("path"===i){var n=t.shape;e=d.makePath(n.pathData,null,{x:n.x||0,y:n.y||0,width:n.width||0,height:n.height||0},"center"),e.__customPathData=t.pathData}else if("image"===i)e=new d.Image({}),e.__customImagePath=t.style.image;else if("text"===i)e=new d.Text({}),e.__customText=t.style.text;else{var o=d[i.charAt(0).toUpperCase()+i.slice(1)];e=new o}return e.__customGraphicType=i,e}function o(t,e,i,n,o,r){var s={},l=i.style||{};if(i.shape&&(s.shape=h.clone(i.shape)),i.position&&(s.position=i.position.slice()),i.scale&&(s.scale=i.scale.slice()),i.origin&&(s.origin=i.origin.slice()),i.rotation&&(s.rotation=i.rotation),"image"===t.type&&i.style){var u=s.style={};h.each(["x","y","width","height"],function(e){a(e,u,l,t.style,r)})}if("text"===t.type&&i.style){var u=s.style={};h.each(["x","y"],function(e){a(e,u,l,t.style,r)})}if("group"!==t.type&&(t.useStyle(l),r)){t.style.opacity=0;var c=l.opacity;null==c&&(c=1),d.initProps(t,{style:{opacity:c}},n,e)}r?t.attr(s):d.updateProps(t,s,n,e),t.attr({z2:i.z2||0,silent:i.silent}),i.styleEmphasis!==!1&&d.setHoverStyle(t,i.styleEmphasis)}function a(t,e,i,n,o){null==i[t]||o||(e[t]=i[t],i[t]=n[t])}function r(t,e,i,n){function o(t){null==t&&(t=w),O&&(S=e.getItemModel(t),M=S.getModel(y),I=S.getModel(x),T=f.findLabelValueDim(e),A=e.getItemVisual(t,"color"),O=!1)}function a(t,i){return null==i&&(i=w),e.get(e.getDimension(t||0),i)}function r(i,n){null==n&&(n=w),o(n);var a=S.getModel(m).getItemStyle();null!=A&&(a.fill=A);var r=e.getItemVisual(n,"opacity");return null!=r&&(a.opacity=r),f.setTextToStyle(e,n,T,a,t,M,A),i&&h.extend(a,i),a}function l(i,n){null==n&&(n=w),o(n);var a=S.getModel(v).getItemStyle();return f.setTextToStyle(e,n,T,a,t,I,A),i&&h.extend(a,i),a}function u(t,i){return null==i&&(i=w),e.getItemVisual(i,t)}function c(t){if(L.getBaseAxis){var e=L.getBaseAxis();return g.getLayoutOnAxis(h.defaults({axis:e},t),n)}}function p(){return i.getCurrentSeriesIndices()}function b(t){return d.getFont(t,i)}var w,S,M,I,T,A,C=t.get("renderItem"),L=t.coordinateSystem,D=L.prepareCustoms?L.prepareCustoms():_[L.type](L),P=h.defaults({getWidth:n.getWidth,getHeight:n.getHeight,getZr:n.getZr,getDevicePixelRatio:n.getDevicePixelRatio,value:a,style:r,styleEmphasis:l,visual:u,barLayout:c,currentSeriesIndices:p,font:b},D.api),k={context:{},seriesId:t.id,seriesName:t.name,seriesIndex:t.seriesIndex,coordSys:D.coordSys,dataInsideLength:e.count(),encode:s(t.getData())},O=!0;return function(t){return w=t,O=!0,C&&C(h.defaults({dataIndexInside:t,dataIndex:e.getRawIndex(t)},k),P)||{}}}function s(t){var e={};return h.each(t.dimensions,function(i,n){var o=t.getDimensionInfo(i);if(!o.isExtraCoord){var a=o.coordDim,r=e[a]=e[a]||[];r[o.coordDimIndex]=n}}),e}function l(t,e,i,n,o,a){t=u(t,e,i,n,o,a),t&&a.setItemGraphicEl(e,t)}function u(t,e,i,a,r,s){var l=i.type;if(!t||l===t.__customGraphicType||"path"===l&&i.pathData===t.__customPathData||"image"===l&&i.style.image===t.__customImagePath||"text"===l&&i.style.text===t.__customText||(r.remove(t),t=null),null!=l){var c=!t;return!t&&(t=n(i)),o(t,e,i,a,s,c),"group"===l&&h.each(i.children,function(i,n){u(t.childAt(n),e,i,a,t,s)}),r.add(t),t}}var c=i(2),h=i(1),d=i(3),f=i(92),p=i(28),g=i(82),m=["itemStyle","normal"],v=["itemStyle","emphasis"],y=["label","normal"],x=["label","emphasis"],_={cartesian2d:i(397),geo:i(404),singleAxis:i(422),polar:i(415),calendar:i(396)};c.extendSeriesModel({type:"series.custom",dependencies:["grid","polar","geo","singleAxis","calendar"],defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0},getInitialData:function(t,e){return p(t.data,this,e)}}),c.extendChartView({type:"custom",_data:null,render:function(t,e,i){var n=this._data,o=t.getData(),a=this.group,s=r(t,o,e,i);o.diff(n).add(function(e){o.hasValue(e)&&l(null,e,s(e),t,a,o)}).update(function(e,i){var r=n.getItemGraphicEl(i);o.hasValue(e)?l(r,e,s(e),t,a,o):r&&a.remove(r)}).remove(function(t){var e=n.getItemGraphicEl(t);e&&a.remove(e)}).execute(),this._data=o},dispose:h.noop})},function(t,e,i){var n=i(1),o=i(2);i(283),i(284),o.registerVisual(n.curry(i(50),"effectScatter","circle",null)),o.registerLayout(n.curry(i(61),"effectScatter"))},function(t,e,i){"use strict";var n=i(28),o=i(17);t.exports=o.extend({type:"series.effectScatter",dependencies:["grid","polar"],getInitialData:function(t,e){var i=n(t.data,this,e);return i},brushSelector:"point",defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,showEffectOn:"render",rippleEffect:{period:4,scale:2.5,brushType:"fill"},symbolSize:10}})},function(t,e,i){var n=i(44),o=i(311);i(2).extendChartView({type:"effectScatter",init:function(){this._symbolDraw=new n(o)},render:function(t,e,i){var n=t.getData(),o=this._symbolDraw;o.updateData(n),this.group.add(o.group)},updateLayout:function(){this._symbolDraw.updateLayout()},remove:function(t,e){this._symbolDraw&&this._symbolDraw.remove(e)},dispose:function(){}})},function(t,e,i){var n=i(1),o=i(2);i(286),i(287),o.registerVisual(n.curry(i(84),"funnel")),o.registerLayout(i(288)),o.registerProcessor(n.curry(i(63),"funnel"))},function(t,e,i){"use strict";var n=i(14),o=i(5),a=i(25),r=i(2).extendSeriesModel({type:"series.funnel",init:function(t){r.superApply(this,"init",arguments),this.legendDataProvider=function(){return this.getRawData()},this._defaultLabelLine(t)},getInitialData:function(t,e){var i=a(["value"],t.data),o=new n(i,this);return o.initData(t.data),o},_defaultLabelLine:function(t){o.defaultEmphasis(t.labelLine,["show"]);var e=t.labelLine.normal,i=t.labelLine.emphasis;e.show=e.show&&t.label.normal.show,i.show=i.show&&t.label.emphasis.show},getDataParams:function(t){var e=this.getData(),i=r.superCall(this,"getDataParams",t),n=e.getSum("value");return i.percent=n?+(e.get("value",t)/n*100).toFixed(2):0,i.$vars.push("percent"),i},defaultOption:{zlevel:0,z:2,legendHoverLink:!0,left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,funnelAlign:"center",label:{normal:{show:!0,position:"outer"},emphasis:{show:!0}},labelLine:{normal:{show:!0,length:20,lineStyle:{width:1,type:"solid"}},emphasis:{}},itemStyle:{normal:{borderColor:"#fff",borderWidth:1},emphasis:{}}}});t.exports=r},function(t,e,i){function n(t,e){function i(){r.ignore=r.hoverIgnore,s.ignore=s.hoverIgnore}function n(){r.ignore=r.normalIgnore,s.ignore=s.normalIgnore}a.Group.call(this);var o=new a.Polygon,r=new a.Polyline,s=new a.Text;this.add(o),this.add(r),this.add(s),this.updateData(t,e,!0),this.on("emphasis",i).on("normal",n).on("mouseover",i).on("mouseout",n)}function o(t,e,i,n){var o=n.getModel("textStyle"),a=n.get("position"),s="inside"===a||"inner"===a||"center"===a;return{fill:o.getTextColor()||(s?"#fff":t.getItemVisual(e,"color")),textFont:o.getFont(),text:r.retrieve(t.hostModel.getFormattedLabel(e,i),t.getName(e))}}var a=i(3),r=i(1),s=n.prototype,l=["itemStyle","normal","opacity"];s.updateData=function(t,e,i){var n=this.childAt(0),o=t.hostModel,s=t.getItemModel(e),u=t.getItemLayout(e),c=t.getItemModel(e).get(l);c=null==c?1:c,n.useStyle({}),i?(n.setShape({points:u.points}),n.setStyle({opacity:0}),a.initProps(n,{style:{opacity:c}},o,e)):a.updateProps(n,{style:{opacity:c},shape:{points:u.points}},o,e);var h=s.getModel("itemStyle"),d=t.getItemVisual(e,"color");n.setStyle(r.defaults({lineJoin:"round",fill:d},h.getModel("normal").getItemStyle(["opacity"]))),n.hoverStyle=h.getModel("emphasis").getItemStyle(),this._updateLabel(t,e),a.setHoverStyle(this)},s._updateLabel=function(t,e){var i=this.childAt(1),n=this.childAt(2),r=t.hostModel,s=t.getItemModel(e),l=t.getItemLayout(e),u=l.label,c=t.getItemVisual(e,"color");a.updateProps(i,{shape:{points:u.linePoints||u.linePoints}},r,e),a.updateProps(n,{style:{x:u.x,y:u.y}},r,e),n.attr({style:{textAlign:u.textAlign,textVerticalAlign:u.verticalAlign,textFont:u.font},rotation:u.rotation,origin:[u.x,u.y],z2:10});var h=s.getModel("label.normal"),d=s.getModel("label.emphasis"),f=s.getModel("labelLine.normal"),p=s.getModel("labelLine.emphasis");n.setStyle(o(t,e,"normal",h)),n.ignore=n.normalIgnore=!h.get("show"),n.hoverIgnore=!d.get("show"),i.ignore=i.normalIgnore=!f.get("show"),i.hoverIgnore=!p.get("show"),i.setStyle({stroke:c}),i.setStyle(f.getModel("lineStyle").getLineStyle()),n.hoverStyle=o(t,e,"emphasis",d),i.hoverStyle=p.getModel("lineStyle").getLineStyle()},r.inherits(n,a.Group);var u=i(30).extend({type:"funnel",render:function(t,e,i){var o=t.getData(),a=this._data,r=this.group;o.diff(a).add(function(t){var e=new n(o,t);o.setItemGraphicEl(t,e),r.add(e)}).update(function(t,e){var i=a.getItemGraphicEl(e);i.updateData(o,t),r.add(i),o.setItemGraphicEl(t,i)}).remove(function(t){var e=a.getItemGraphicEl(t);r.remove(e)}).execute(),this._data=o},remove:function(){this.group.removeAll(),this._data=null},dispose:function(){}});t.exports=u},function(t,e,i){function n(t,e){return r.getLayoutRect(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function o(t,e){for(var i=t.mapArray("value",function(t){return t}),n=[],o="ascending"===e,a=0,r=t.count();a<r;a++)n[a]=a;return"function"==typeof e?n.sort(e):"none"!==e&&n.sort(function(t,e){return o?i[t]-i[e]:i[e]-i[t]}),n}function a(t){t.each(function(e){var i,n,o,a,r=t.getItemModel(e),s=r.getModel("label.normal"),l=s.get("position"),u=r.getModel("labelLine.normal"),c=t.getItemLayout(e),h=c.points,d="inner"===l||"inside"===l||"center"===l;if(d)n=(h[0][0]+h[1][0]+h[2][0]+h[3][0])/4,o=(h[0][1]+h[1][1]+h[2][1]+h[3][1])/4,i="center",a=[[n,o],[n,o]];else{var f,p,g,m=u.get("length");"left"===l?(f=(h[3][0]+h[0][0])/2,p=(h[3][1]+h[0][1])/2,g=f-m,n=g-5,i="right"):(f=(h[1][0]+h[2][0])/2,p=(h[1][1]+h[2][1])/2,g=f+m,n=g+5,i="left");var v=p;a=[[f,p],[g,v]],o=v}c.label={linePoints:a,x:n,y:o,verticalAlign:"middle",textAlign:i,inside:d}})}var r=i(12),s=i(4),l=s.parsePercent;t.exports=function(t,e,i){t.eachSeriesByType("funnel",function(t){var i=t.getData(),r=t.get("sort"),u=n(t,e),c=o(i,r),h=[l(t.get("minSize"),u.width),l(t.get("maxSize"),u.width)],d=i.getDataExtent("value"),f=t.get("min"),p=t.get("max");null==f&&(f=Math.min(d[0],0)),null==p&&(p=d[1]);var g=t.get("funnelAlign"),m=t.get("gap"),v=(u.height-m*(i.count()-1))/i.count(),y=u.y,x=function(t,e){var n,o=i.get("value",t)||0,a=s.linearMap(o,[f,p],h,!0);switch(g){case"left":n=u.x;break;case"center":n=u.x+(u.width-a)/2;break;case"right":n=u.x+u.width-a}return[[n,e],[n+a,e]]};"ascending"===r&&(v=-v,m=-m,y+=u.height,c=c.reverse());for(var _=0;_<c.length;_++){var b=c[_],w=c[_+1],S=x(b,y),M=x(w,y+v);y+=v+m,i.setItemLayout(b,{points:S.concat(M.slice().reverse())})}a(i)})}},function(t,e,i){i(290),i(291)},function(t,e,i){var n=i(14),o=i(17),a=i(1),r=o.extend({type:"series.gauge",getInitialData:function(t,e){var i=new n(["value"],this),o=t.data||[];return a.isArray(o)||(o=[o]),i.initData(o),i},defaultOption:{zlevel:0,z:2,center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,lineStyle:{color:[[.2,"#91c7ae"],[.8,"#63869e"],[1,"#c23531"]],width:30}},splitLine:{show:!0,length:30,lineStyle:{color:"#eee",width:2,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:8,lineStyle:{color:"#eee",width:1,type:"solid"}},axisLabel:{show:!0,distance:5,textStyle:{color:"auto"}},pointer:{show:!0,length:"80%",width:8},itemStyle:{normal:{color:"auto"}},title:{show:!0,offsetCenter:[0,"-40%"],textStyle:{color:"#333",fontSize:15}},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:40,offsetCenter:[0,"40%"],textStyle:{color:"auto",fontSize:30}}}});t.exports=r},function(t,e,i){function n(t,e){var i=t.get("center"),n=e.getWidth(),o=e.getHeight(),a=Math.min(n,o),r=l(i[0],e.getWidth()),s=l(i[1],e.getHeight()),u=l(t.get("radius"),a/2);return{cx:r,cy:s,r:u}}function o(t,e){return e&&("string"==typeof e?t=e.replace("{value}",null!=t?t:""):"function"==typeof e&&(t=e(t))),t}var a=i(292),r=i(3),s=i(4),l=s.parsePercent,u=2*Math.PI,c=i(30).extend({type:"gauge",render:function(t,e,i){this.group.removeAll();var o=t.get("axisLine.lineStyle.color"),a=n(t,i);this._renderMain(t,e,i,o,a)},dispose:function(){},_renderMain:function(t,e,i,n,o){for(var a=this.group,s=t.getModel("axisLine"),l=s.getModel("lineStyle"),c=t.get("clockwise"),h=-t.get("startAngle")/180*Math.PI,d=-t.get("endAngle")/180*Math.PI,f=(d-h)%u,p=h,g=l.get("width"),m=0;m<n.length;m++){var v=Math.min(Math.max(n[m][0],0),1),d=h+f*v,y=new r.Sector({shape:{startAngle:p,endAngle:d,cx:o.cx,cy:o.cy,clockwise:c,r0:o.r-g,r:o.r},silent:!0});y.setStyle({fill:n[m][1]}),y.setStyle(l.getLineStyle(["color","borderWidth","borderColor"])),a.add(y),p=d}var x=function(t){if(t<=0)return n[0][1];for(var e=0;e<n.length;e++)if(n[e][0]>=t&&(0===e?0:n[e-1][0])<t)return n[e][1];return n[e-1][1]};if(!c){var _=h;h=d,d=_}this._renderTicks(t,e,i,x,o,h,d,c),this._renderPointer(t,e,i,x,o,h,d,c),this._renderTitle(t,e,i,x,o),this._renderDetail(t,e,i,x,o)},_renderTicks:function(t,e,i,n,a,u,c,h){for(var d=this.group,f=a.cx,p=a.cy,g=a.r,m=+t.get("min"),v=+t.get("max"),y=t.getModel("splitLine"),x=t.getModel("axisTick"),_=t.getModel("axisLabel"),b=t.get("splitNumber"),w=x.get("splitNumber"),S=l(y.get("length"),g),M=l(x.get("length"),g),I=u,T=(c-u)/b,A=T/w,C=y.getModel("lineStyle").getLineStyle(),L=x.getModel("lineStyle").getLineStyle(),D=_.getModel("textStyle"),P=0;P<=b;P++){var k=Math.cos(I),O=Math.sin(I);if(y.get("show")){var z=new r.Line({shape:{x1:k*g+f,y1:O*g+p,x2:k*(g-S)+f,y2:O*(g-S)+p},style:C,silent:!0});"auto"===C.stroke&&z.setStyle({stroke:n(P/b)}),d.add(z)}if(_.get("show")){var E=o(s.round(P/b*(v-m)+m),_.get("formatter")),R=_.get("distance"),N=new r.Text({style:{text:E,x:k*(g-S-R)+f,y:O*(g-S-R)+p,fill:D.getTextColor(),textFont:D.getFont(),textVerticalAlign:O<-.4?"top":O>.4?"bottom":"middle",textAlign:k<-.4?"left":k>.4?"right":"center"},silent:!0});"auto"===N.style.fill&&N.setStyle({fill:n(P/b)}),d.add(N)}if(x.get("show")&&P!==b){for(var V=0;V<=w;V++){var k=Math.cos(I),O=Math.sin(I),B=new r.Line({shape:{x1:k*g+f,y1:O*g+p,x2:k*(g-M)+f,y2:O*(g-M)+p},silent:!0,style:L});"auto"===L.stroke&&B.setStyle({stroke:n((P+V/w)/b)}),d.add(B),I+=A}I-=A}else I+=T}},_renderPointer:function(t,e,i,n,o,u,c,h){var d=this.group,f=this._data;if(!t.get("pointer.show"))return void(f&&f.eachItemGraphicEl(function(t){d.remove(t)}));var p=[+t.get("min"),+t.get("max")],g=[u,c],m=t.getData();m.diff(f).add(function(e){var i=new a({shape:{angle:u}});r.initProps(i,{shape:{angle:s.linearMap(m.get("value",e),p,g,!0)}},t),d.add(i),m.setItemGraphicEl(e,i)}).update(function(e,i){var n=f.getItemGraphicEl(i);r.updateProps(n,{shape:{angle:s.linearMap(m.get("value",e),p,g,!0)}},t),d.add(n),m.setItemGraphicEl(e,n)}).remove(function(t){var e=f.getItemGraphicEl(t);d.remove(e)}).execute(),m.eachItemGraphicEl(function(t,e){var i=m.getItemModel(e),a=i.getModel("pointer");t.setShape({x:o.cx,y:o.cy,width:l(a.get("width"),o.r),r:l(a.get("length"),o.r)}),t.useStyle(i.getModel("itemStyle.normal").getItemStyle()),"auto"===t.style.fill&&t.setStyle("fill",n(s.linearMap(m.get("value",e),p,[0,1],!0))),r.setHoverStyle(t,i.getModel("itemStyle.emphasis").getItemStyle())}),this._data=m},_renderTitle:function(t,e,i,n,o){var a=t.getModel("title");if(a.get("show")){var u=a.getModel("textStyle"),c=a.get("offsetCenter"),h=o.cx+l(c[0],o.r),d=o.cy+l(c[1],o.r),f=new r.Text({style:{x:h,y:d,text:t.getData().getName(0),fill:u.getTextColor(),textFont:u.getFont(),textAlign:"center",textVerticalAlign:"middle"}});if("auto"===f.style.fill){var p=+t.get("min"),g=+t.get("max"),m=t.getData().get("value",0);f.setStyle("fill",n(s.linearMap(m,[p,g],[0,1],!0)))}this.group.add(f)}},_renderDetail:function(t,e,i,n,a){var u=t.getModel("detail"),c=+t.get("min"),h=+t.get("max");if(u.get("show")){var d=u.getModel("textStyle"),f=u.get("offsetCenter"),p=a.cx+l(f[0],a.r),g=a.cy+l(f[1],a.r),m=l(u.get("width"),a.r),v=l(u.get("height"),a.r),y=t.getData().get("value",0),x=new r.Rect({shape:{x:p-m/2,y:g-v/2,width:m,height:v},style:{text:o(y,u.get("formatter")),fill:u.get("backgroundColor"),textFill:d.getTextColor(),textFont:d.getFont()}});"auto"===x.style.textFill&&x.setStyle("textFill",n(s.linearMap(y,[c,h],[0,1],!0))),x.setStyle(u.getItemStyle(["color"])),this.group.add(x)}}});t.exports=c},function(t,e,i){t.exports=i(8).extend({type:"echartsGaugePointer",shape:{angle:0,width:10,r:10,x:0,y:0},buildPath:function(t,e){var i=Math.cos,n=Math.sin,o=e.r,a=e.width,r=e.angle,s=e.x-i(r)*a*(a>=o/3?1:2),l=e.y-n(r)*a*(a>=o/3?1:2);r=e.angle-Math.PI/2,t.moveTo(s,l),t.lineTo(e.x+i(r)*a,e.y+n(r)*a),t.lineTo(e.x+i(e.angle)*o,e.y+n(e.angle)*o),t.lineTo(e.x-i(r)*a,e.y-n(r)*a),t.lineTo(s,l)}})},function(t,e,i){var n=i(2),o=i(1);i(294),i(295),i(304),n.registerProcessor(i(297)),n.registerVisual(o.curry(i(50),"graph","circle",null)),n.registerVisual(i(298)),n.registerVisual(i(301)),n.registerLayout(i(305)),n.registerLayout(i(299)),n.registerLayout(i(303)),n.registerCoordinateSystem("graphView",{create:i(300)})},function(t,e,i){"use strict";var n=i(14),o=i(1),a=i(5),r=i(10),s=i(7),l=i(248),u=i(2).extendSeriesModel({type:"series.graph",init:function(t){u.superApply(this,"init",arguments),this.legendDataProvider=function(){return this._categoriesData},this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},mergeOption:function(t){u.superApply(this,"mergeOption",arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},mergeDefaultAndTheme:function(t){u.superApply(this,"mergeDefaultAndTheme",arguments),a.defaultEmphasis(t.edgeLabel,a.LABEL_OPTIONS)},getInitialData:function(t,e){function i(t,i){function n(t){return t=this.parsePath(t),t&&"label"===t[0]?s:this.parentModel}t.wrapMethod("getItemModel",function(t){var e=a._categoriesModels,i=t.getShallow("category"),n=e[i];return n&&(n.parentModel=t.parentModel,t.parentModel=n),t});var o=a.getModel("edgeLabel"),s=new r({label:o.option},o.parentModel,e);i.wrapMethod("getItemModel",function(t){return t.customizeGetParent(n),t})}var n=t.edges||t.links||[],o=t.data||t.nodes||[],a=this;if(o&&n)return l(o,n,this,!0,i).data},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},getCategoriesData:function(){return this._categoriesData},formatTooltip:function(t,e,i){if("edge"===i){var n=this.getData(),o=this.getDataParams(t,i),a=n.graph.getEdgeByIndex(t),r=n.getName(a.node1.dataIndex),l=n.getName(a.node2.dataIndex),c=[];return null!=r&&c.push(r),null!=l&&c.push(l),c=s.encodeHTML(c.join(" > ")),o.value&&(c+=" : "+s.encodeHTML(o.value)),c}return u.superApply(this,"formatTooltip",arguments)},_updateCategoriesData:function(){var t=o.map(this.option.categories||[],function(t){return null!=t.value?t:o.extend({value:0},t)}),e=new n(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray(function(t){return e.getItemModel(t,!0)})},setZoom:function(t){this.option.zoom=t},setCenter:function(t){this.option.center=t},isAnimationEnabled:function(){return u.superCall(this,"isAnimationEnabled")&&!("force"===this.get("layout")&&this.get("force.layoutAnimation"))},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",legendHoverLink:!0,hoverAnimation:!0,layout:null,focusNodeAdjacency:!1,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{normal:{position:"middle"},emphasis:{}},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{normal:{show:!1,formatter:"{b}"},emphasis:{show:!0}},itemStyle:{normal:{},emphasis:{}},lineStyle:{normal:{color:"#aaa",width:1,curveness:0,opacity:.5},emphasis:{}}}});t.exports=u},function(t,e,i){function n(t,e){return t.getVisual("opacity")||t.getModel().get(e)}var o=i(44),a=i(107),r=i(95),s=i(251),l=i(128),u=i(3),c=i(296),h=i(1),d=["itemStyle","normal","opacity"],f=["lineStyle","normal","opacity"];i(2).extendChartView({type:"graph",init:function(t,e){var i=new o,n=new a,s=this.group;this._controller=new r(e.getZr()),this._controllerHost={target:s},s.add(i.group),s.add(n.group),this._symbolDraw=i,this._lineDraw=n,this._firstRender=!0},render:function(t,e,i){var n=t.coordinateSystem;this._model=t,this._nodeScaleRatio=t.get("nodeScaleRatio");var o=this._symbolDraw,a=this._lineDraw,r=this.group;if("view"===n.type){var s={position:n.position,scale:n.scale};this._firstRender?r.attr(s):u.updateProps(r,s,t)}c(t.getGraph(),this._getNodeGlobalScale(t));var l=t.getData();o.updateData(l);var h=t.getEdgeData();a.updateData(h),this._updateNodeAndLinkScale(),this._updateController(t,e,i),clearTimeout(this._layoutTimeout);var d=t.forceLayout,f=t.get("force.layoutAnimation");d&&this._startForceLayoutIteration(d,f),l.eachItemGraphicEl(function(e,n){var o=l.getItemModel(n);e.off("drag").off("dragend");var a=l.getItemModel(n).get("draggable");a&&e.on("drag",function(){d&&(d.warmUp(),!this._layouting&&this._startForceLayoutIteration(d,f),d.setFixed(n),l.setItemLayout(n,e.position))},this).on("dragend",function(){d&&d.setUnfixed(n)},this),e.setDraggable(a&&d),e.off("mouseover",e.__focusNodeAdjacency),e.off("mouseout",e.__unfocusNodeAdjacency),o.get("focusNodeAdjacency")&&(e.on("mouseover",e.__focusNodeAdjacency=function(){i.dispatchAction({type:"focusNodeAdjacency",seriesId:t.id,dataIndex:e.dataIndex})}),e.on("mouseout",e.__unfocusNodeAdjacency=function(){i.dispatchAction({type:"unfocusNodeAdjacency",seriesId:t.id})}))},this);var p="circular"===t.get("layout")&&t.get("circular.rotateLabel"),g=l.getLayout("cx"),m=l.getLayout("cy");l.eachItemGraphicEl(function(t,e){var i=t.getSymbolPath();if(p){var n=l.getItemLayout(e),o=Math.atan2(n[1]-m,n[0]-g);o<0&&(o=2*Math.PI+o);var a=n[0]<g;a&&(o-=Math.PI);var r=a?"left":"right";i.setStyle({textRotation:o,textPosition:r}),i.hoverStyle&&(i.hoverStyle.textPosition=r)}else i.setStyle({textRotation:0})}),this._firstRender=!1},dispose:function(){this._controller&&this._controller.dispose(),this._controllerHost={}},focusNodeAdjacency:function(t,e,i,o){function a(t,e){var i=n(t,e),o=t.getGraphicEl();null==i&&(i=1),o.traverse(function(t){t.trigger("normal"),"group"!==t.type&&t.setStyle("opacity",.1*i)})}function r(t,e){var i=n(t,e),o=t.getGraphicEl();o.traverse(function(t){t.trigger("emphasis"),"group"!==t.type&&t.setStyle("opacity",i)})}var s=this._model.getData(),l=o.dataIndex,u=s.getItemGraphicEl(l);if(u){var c=s.graph,p=u.dataType;if(null!==l&&"edge"!==p){c.eachNode(function(t){a(t,d)}),c.eachEdge(function(t){a(t,f)});var g=c.getNodeByIndex(l);r(g,d),h.each(g.edges,function(t){t.dataIndex<0||(r(t,f),r(t.node1,d),r(t.node2,d))})}}},unfocusNodeAdjacency:function(t,e,i,o){var a=this._model.getData().graph;a.eachNode(function(t){var e=n(t,d);t.getGraphicEl().traverse(function(t){t.trigger("normal"),"group"!==t.type&&t.setStyle("opacity",e)})}),a.eachEdge(function(t){var e=n(t,f);t.getGraphicEl().traverse(function(t){t.trigger("normal"),"group"!==t.type&&t.setStyle("opacity",e)})})},_startForceLayoutIteration:function(t,e){var i=this;!function n(){t.step(function(t){i.updateLayout(i._model),(i._layouting=!t)&&(e?i._layoutTimeout=setTimeout(n,16):n())})}()},_updateController:function(t,e,i){var n=this._controller,o=this._controllerHost,a=this.group;return n.setPointerChecker(function(e,n,o){var r=a.getBoundingRect();return r.applyTransform(a.transform),r.contain(n,o)&&!l.onIrrelevantElement(e,i,t)}),"view"!==t.coordinateSystem.type?void n.disable():(n.enable(t.get("roam")),o.zoomLimit=t.get("scaleLimit"),o.zoom=t.coordinateSystem.getZoom(),void n.off("pan").off("zoom").on("pan",function(e,n){s.updateViewOnPan(o,e,n),i.dispatchAction({seriesId:t.id,type:"graphRoam",dx:e,dy:n})}).on("zoom",function(e,n,a){s.updateViewOnZoom(o,e,n,a),i.dispatchAction({seriesId:t.id,type:"graphRoam",zoom:e,originX:n,originY:a}),this._updateNodeAndLinkScale(),c(t.getGraph(),this._getNodeGlobalScale(t)),this._lineDraw.updateLayout()},this))},_updateNodeAndLinkScale:function(){var t=this._model,e=t.getData(),i=this._getNodeGlobalScale(t),n=[i,i];e.eachItemGraphicEl(function(t,e){t.attr("scale",n)})},_getNodeGlobalScale:function(t){var e=t.coordinateSystem;if("view"!==e.type)return 1;var i=this._nodeScaleRatio,n=e.scale,o=n&&n[0]||1,a=e.getZoom(),r=(a-1)*i+1;return r/o},updateLayout:function(t){c(t.getGraph(),this._getNodeGlobalScale(t)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},remove:function(t,e){this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()}})},function(t,e,i){function n(t,e,i){for(var n,o=t[0],a=t[1],d=t[2],f=1/0,p=i*i,g=.1,m=.1;m<=.9;m+=.1){r[0]=u(o[0],a[0],d[0],m),r[1]=u(o[1],a[1],d[1],m);var v=h(c(r,e)-p);v<f&&(f=v,n=m)}for(var y=0;y<32;y++){var x=n+g;s[0]=u(o[0],a[0],d[0],n),s[1]=u(o[1],a[1],d[1],n),l[0]=u(o[0],a[0],d[0],x),l[1]=u(o[1],a[1],d[1],x);var v=c(s,e)-p;if(h(v)<.01)break;var _=c(l,e)-p;g/=2,v<0?_>=0?n+=g:n-=g:_>=0?n-=g:n+=g}return n}var o=i(20),a=i(6),r=[],s=[],l=[],u=o.quadraticAt,c=a.distSquare,h=Math.abs;t.exports=function(t,e){function i(t){var e=t.getVisual("symbolSize");return e instanceof Array&&(e=(e[0]+e[1])/2),e}var r=[],s=o.quadraticSubdivide,l=[[],[],[]],u=[[],[]],c=[];e/=2,t.eachEdge(function(t,o){var h=t.getLayout(),d=t.getVisual("fromSymbol"),f=t.getVisual("toSymbol");h.__original||(h.__original=[a.clone(h[0]),a.clone(h[1])],h[2]&&h.__original.push(a.clone(h[2])));var p=h.__original;if(null!=h[2]){if(a.copy(l[0],p[0]),a.copy(l[1],p[2]),a.copy(l[2],p[1]),d&&"none"!=d){var g=i(t.node1),m=n(l,p[0],g*e);s(l[0][0],l[1][0],l[2][0],m,r),l[0][0]=r[3],l[1][0]=r[4],s(l[0][1],l[1][1],l[2][1],m,r),l[0][1]=r[3],l[1][1]=r[4]}if(f&&"none"!=f){var g=i(t.node2),m=n(l,p[1],g*e);s(l[0][0],l[1][0],l[2][0],m,r),l[1][0]=r[1],l[2][0]=r[2],s(l[0][1],l[1][1],l[2][1],m,r),l[1][1]=r[1],l[2][1]=r[2]}a.copy(h[0],l[0]),a.copy(h[1],l[2]),a.copy(h[2],l[1])}else{if(a.copy(u[0],p[0]),a.copy(u[1],p[1]),a.sub(c,u[1],u[0]),a.normalize(c,c),d&&"none"!=d){var g=i(t.node1);a.scaleAndAdd(u[0],u[0],c,g*e)}if(f&&"none"!=f){var g=i(t.node2);a.scaleAndAdd(u[1],u[1],c,-g*e)}a.copy(h[0],u[0]),a.copy(h[1],u[1])}})}},function(t,e){t.exports=function(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.eachSeriesByType("graph",function(t){var i=t.getCategoriesData(),n=t.getGraph(),o=n.data,a=i.mapArray(i.getName);o.filterSelf(function(t){var i=o.getItemModel(t),n=i.getShallow("category");if(null!=n){"number"==typeof n&&(n=a[n]);for(var r=0;r<e.length;r++)if(!e[r].isSelected(n))return!1}return!0})},this)}},function(t,e){t.exports=function(t){var e={};t.eachSeriesByType("graph",function(t){var i=t.getCategoriesData(),n=t.getData(),o={};i.each(function(n){var a=i.getName(n);o["ec-"+a]=n;var r=i.getItemModel(n),s=r.get("itemStyle.normal.color")||t.getColorFromPalette(a,e);i.setItemVisual(n,"color",s)}),i.count()&&n.each(function(t){var e=n.getItemModel(t),a=e.getShallow("category");null!=a&&("string"==typeof a&&(a=o["ec-"+a]),n.getItemVisual(t,"color",!0)||n.setItemVisual(t,"color",i.getItemVisual(a,"color")))})})}},function(t,e,i){var n=i(243);t.exports=function(t){t.eachSeriesByType("graph",function(t){"circular"===t.get("layout")&&n(t)})}},function(t,e,i){function n(t,e,i){var n=t.getBoxLayoutParams();return n.aspect=i,a.getLayoutRect(n,{width:e.getWidth(),height:e.getHeight()})}var o=i(261),a=i(12),r=i(85);t.exports=function(t,e){var i=[];return t.eachSeriesByType("graph",function(t){var a=t.get("coordinateSystem");if(!a||"view"===a){var s=t.getData(),l=s.mapArray(function(t){var e=s.getItemModel(t);return[+e.get("x"),+e.get("y")]}),u=[],c=[];r.fromPoints(l,u,c),c[0]-u[0]===0&&(c[0]+=1,u[0]-=1),c[1]-u[1]===0&&(c[1]+=1,u[1]-=1);var h=(c[0]-u[0])/(c[1]-u[1]),d=n(t,e,h);isNaN(h)&&(u=[d.x,d.y],c=[d.x+d.width,d.y+d.height]);var f=c[0]-u[0],p=c[1]-u[1],g=d.width,m=d.height,v=t.coordinateSystem=new o;v.zoomLimit=t.get("scaleLimit"),v.setBoundingRect(u[0],u[1],f,p),v.setViewRect(d.x,d.y,g,m),v.setCenter(t.get("center")),v.setZoom(t.get("zoom")),i.push(v)}}),i}},function(t,e){function i(t){return t instanceof Array||(t=[t,t]),t}t.exports=function(t){t.eachSeriesByType("graph",function(t){var e=t.getGraph(),n=t.getEdgeData(),o=i(t.get("edgeSymbol")),a=i(t.get("edgeSymbolSize")),r="lineStyle.normal.color".split("."),s="lineStyle.normal.opacity".split(".");n.setVisual("fromSymbol",o&&o[0]),n.setVisual("toSymbol",o&&o[1]),n.setVisual("fromSymbolSize",a&&a[0]),n.setVisual("toSymbolSize",a&&a[1]),n.setVisual("color",t.get(r)),n.setVisual("opacity",t.get(s)),n.each(function(t){var o=n.getItemModel(t),a=e.getEdgeByIndex(t),l=i(o.getShallow("symbol",!0)),u=i(o.getShallow("symbolSize",!0)),c=o.get(r),h=o.get(s);switch(c){case"source":c=a.node1.getVisual("color");break;case"target":c=a.node2.getVisual("color")}l[0]&&a.setVisual("fromSymbol",l[0]),l[1]&&a.setVisual("toSymbol",l[1]),u[0]&&a.setVisual("fromSymbolSize",u[0]),u[1]&&a.setVisual("toSymbolSize",u[1]),a.setVisual("color",c),a.setVisual("opacity",h)})})}},function(t,e,i){var n=i(6),o=n.scaleAndAdd;t.exports=function(t,e,i){for(var a=i.rect,r=a.width,s=a.height,l=[a.x+r/2,a.y+s/2],u=null==i.gravity?.1:i.gravity,c=0;c<t.length;c++){var h=t[c];h.p||(h.p=n.create(r*(Math.random()-.5)+l[0],s*(Math.random()-.5)+l[1])),h.pp=n.clone(h.p),h.edges=null}var d=.6;return{warmUp:function(){d=.5},setFixed:function(e){t[e].fixed=!0},setUnfixed:function(e){t[e].fixed=!1},step:function(i){for(var a=[],r=t.length,s=0;s<e.length;s++){var c=e[s],h=c.n1,f=c.n2;n.sub(a,f.p,h.p);var p=n.len(a)-c.d,g=f.w/(h.w+f.w);n.normalize(a,a),!h.fixed&&o(h.p,h.p,a,g*p*d),!f.fixed&&o(f.p,f.p,a,-(1-g)*p*d)}for(var s=0;s<r;s++){var m=t[s];m.fixed||(n.sub(a,l,m.p),n.scaleAndAdd(m.p,m.p,a,u*d))}for(var s=0;s<r;s++)for(var h=t[s],v=s+1;v<r;v++){var f=t[v];n.sub(a,f.p,h.p);var p=n.len(a);0===p&&(n.set(a,Math.random()-.5,Math.random()-.5),p=1);var y=(h.rep+f.rep)/p/p;!h.fixed&&o(h.pp,h.pp,a,y),!f.fixed&&o(f.pp,f.pp,a,-y)}for(var x=[],s=0;s<r;s++){var m=t[s];m.fixed||(n.sub(x,m.p,m.pp),n.scaleAndAdd(m.p,m.p,x,d),n.copy(m.pp,m.p))}d=.992*d,i&&i(t,e,d<.01)}}}},function(t,e,i){var n=i(302),o=i(4),a=i(245),r=i(243),s=i(6),l=i(1);t.exports=function(t){t.eachSeriesByType("graph",function(t){var e=t.coordinateSystem;if(!e||"view"===e.type)if("force"===t.get("layout")){var i=t.preservedPoints||{},u=t.getGraph(),c=u.data,h=u.edgeData,d=t.getModel("force"),f=d.get("initLayout");t.preservedPoints?c.each(function(t){var e=c.getId(t);c.setItemLayout(t,i[e]||[NaN,NaN])}):f&&"none"!==f?"circular"===f&&r(t):a(t);var p=c.getDataExtent("value"),g=h.getDataExtent("value"),m=d.get("repulsion"),v=d.get("edgeLength");l.isArray(m)||(m=[m,m]),l.isArray(v)||(v=[v,v]),v=[v[1],v[0]];var y=c.mapArray("value",function(t,e){var i=c.getItemLayout(e),n=o.linearMap(t,p,m);return isNaN(n)&&(n=(m[0]+m[1])/2),{w:n,rep:n,fixed:c.getItemModel(e).get("fixed"),p:!i||isNaN(i[0])||isNaN(i[1])?null:i}}),x=h.mapArray("value",function(t,e){var i=u.getEdgeByIndex(e),n=o.linearMap(t,g,v);return isNaN(n)&&(n=(v[0]+v[1])/2),{n1:y[i.node1.dataIndex],n2:y[i.node2.dataIndex],d:n,curveness:i.getModel().get("lineStyle.normal.curveness")||0}}),e=t.coordinateSystem,_=e.getBoundingRect(),b=n(y,x,{rect:_,gravity:d.get("gravity")}),w=b.step;b.step=function(t){for(var e=0,n=y.length;e<n;e++)y[e].fixed&&s.copy(y[e].p,u.getNodeByIndex(e).getLayout());w(function(e,n,o){for(var a=0,r=e.length;a<r;a++)e[a].fixed||u.getNodeByIndex(a).setLayout(e[a].p),i[c.getId(a)]=e[a].p;for(var a=0,r=n.length;a<r;a++){var l=n[a],h=u.getEdgeByIndex(a),d=l.n1.p,f=l.n2.p,p=h.getLayout();p=p?p.slice():[],p[0]=p[0]||[],p[1]=p[1]||[],s.copy(p[0],d),s.copy(p[1],f),+l.curveness&&(p[2]=[(d[0]+f[0])/2-(d[1]-f[1])*l.curveness,(d[1]+f[1])/2-(f[0]-d[0])*l.curveness]),h.setLayout(p)}t&&t(o)})},t.forceLayout=b,t.preservedPoints=i,b.step()}else t.forceLayout=null})}},function(t,e,i){var n=i(2),o=i(242),a={type:"graphRoam",event:"graphRoam",update:"none"};n.registerAction(a,function(t,e){e.eachComponent({mainType:"series",query:t},function(e){var i=e.coordinateSystem,n=o.updateCenterAndZoom(i,t);e.setCenter&&e.setCenter(n.center),e.setZoom&&e.setZoom(n.zoom)})}),n.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series.graph:focusNodeAdjacency"},function(){}),n.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series.graph:unfocusNodeAdjacency"},function(){})},function(t,e,i){var n=i(245),o=i(244);t.exports=function(t,e){t.eachSeriesByType("graph",function(t){var e=t.get("layout"),i=t.coordinateSystem;if(i&&"view"!==i.type){var a=t.getData(),r=i.dimensions;a.each(r,function(){for(var t,e=arguments,n=[],o=0;o<r.length;o++)isNaN(e[o])||(t=!0),n.push(e[o]);var s=e[e.length-1];t?a.setItemLayout(s,i.dataToPoint(n)):a.setItemLayout(s,[NaN,NaN])}),o(a.graph)}else e&&"none"!==e||n(t)})}},function(t,e,i){i(308),i(309)},function(t,e,i){function n(){var t=a.createCanvas();this.canvas=t,this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={}}var o=256,a=i(1);n.prototype={update:function(t,e,i,n,a,r){var s=this._getBrush(),l=this._getGradient(t,a,"inRange"),u=this._getGradient(t,a,"outOfRange"),c=this.pointSize+this.blurSize,h=this.canvas,d=h.getContext("2d"),f=t.length;h.width=e,h.height=i;for(var p=0;p<f;++p){var g=t[p],m=g[0],v=g[1],y=g[2],x=n(y);d.globalAlpha=x,d.drawImage(s,m-c,v-c)}for(var _=d.getImageData(0,0,h.width,h.height),b=_.data,w=0,S=b.length,M=this.minOpacity,I=this.maxOpacity,T=I-M;w<S;){var x=b[w+3]/256,A=4*Math.floor(x*(o-1));if(x>0){var C=r(x)?l:u;x>0&&(x=x*T+M),b[w++]=C[A],b[w++]=C[A+1],b[w++]=C[A+2],b[w++]=C[A+3]*x*256}else w+=4}return d.putImageData(_,0,0),h},_getBrush:function(){var t=this._brushCanvas||(this._brushCanvas=a.createCanvas()),e=this.pointSize+this.blurSize,i=2*e;t.width=i,t.height=i;var n=t.getContext("2d");return n.clearRect(0,0,i,i),n.shadowOffsetX=i,n.shadowBlur=this.blurSize,n.shadowColor="#000",n.beginPath(),n.arc(-e,e,this.pointSize,0,2*Math.PI,!0),n.closePath(),n.fill(),t},_getGradient:function(t,e,i){for(var n=this._gradientPixels,o=n[i]||(n[i]=new Uint8ClampedArray(1024)),a=[0,0,0,0],r=0,s=0;s<256;s++)e[i](s/255,!0,a),o[r++]=a[0],o[r++]=a[1],o[r++]=a[2],o[r++]=a[3];return o}},t.exports=n},function(t,e,i){var n=i(17),o=i(28);t.exports=n.extend({type:"series.heatmap",getInitialData:function(t,e){return o(t.data,this,e)},defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0}})},function(t,e,i){function n(t,e,i){var n=t[1]-t[0];e=l.map(e,function(e){return{interval:[(e.interval[0]-t[0])/n,(e.interval[1]-t[0])/n]}});var o=e.length,a=0;return function(t){for(var n=a;n<o;n++){var r=e[n].interval;if(r[0]<=t&&t<=r[1]){a=n;break}}if(n===o)for(var n=a-1;n>=0;n--){var r=e[n].interval;if(r[0]<=t&&t<=r[1]){a=n;break}}return n>=0&&n<o&&i[n]}}function o(t,e){var i=t[1]-t[0];return e=[(e[0]-t[0])/i,(e[1]-t[0])/i],function(t){return t>=e[0]&&t<=e[1]}}function a(t){var e=t.dimensions;return"lng"===e[0]&&"lat"===e[1]}var r=i(3),s=i(307),l=i(1);t.exports=i(2).extendChartView({type:"heatmap",render:function(t,e,i){var n;e.eachComponent("visualMap",function(e){e.eachTargetSeries(function(i){i===t&&(n=e)})}),this.group.removeAll();var o=t.coordinateSystem;"cartesian2d"===o.type||"calendar"===o.type?this._renderOnCartesianAndCalendar(o,t,i):a(o)&&this._renderOnGeo(o,t,n,i)},dispose:function(){},_renderOnCartesianAndCalendar:function(t,e,i){if("cartesian2d"===t.type)var n=t.getAxis("x"),o=t.getAxis("y"),a=n.getBandWidth(),s=o.getBandWidth();var u=this.group,c=e.getData(),h="itemStyle.normal",d="itemStyle.emphasis",f="label.normal",p="label.emphasis",g=e.getModel(h).getItemStyle(["color"]),m=e.getModel(d).getItemStyle(),v=e.getModel("label.normal"),y=e.getModel("label.emphasis"),x=t.type,_="cartesian2d"===x?[e.coordDimToDataDim("x")[0],e.coordDimToDataDim("y")[0],e.coordDimToDataDim("value")[0]]:[e.coordDimToDataDim("time")[0],e.coordDimToDataDim("value")[0]];c.each(function(i){var n;if("cartesian2d"===x){if(isNaN(c.get(_[2],i)))return;var o=t.dataToPoint([c.get(_[0],i),c.get(_[1],i)]);n=new r.Rect({shape:{x:o[0]-a/2,y:o[1]-s/2,width:a,height:s},style:{fill:c.getItemVisual(i,"color"),opacity:c.getItemVisual(i,"opacity")}})}else{if(isNaN(c.get(_[1],i)))return;n=new r.Rect({z2:1,shape:t.dataToRect([c.get(_[0],i)]).contentShape,style:{fill:c.getItemVisual(i,"color"),opacity:c.getItemVisual(i,"opacity")}})}var b=c.getItemModel(i);c.hasItemOption&&(g=b.getModel(h).getItemStyle(["color"]),m=b.getModel(d).getItemStyle(),v=b.getModel(f),y=b.getModel(p));var w=e.getRawValue(i),S="-";w&&null!=w[2]&&(S=w[2]),v.getShallow("show")&&(r.setText(g,v),g.text=e.getFormattedLabel(i,"normal")||S),y.getShallow("show")&&(r.setText(m,y),m.text=e.getFormattedLabel(i,"emphasis")||S),n.setStyle(g),r.setHoverStyle(n,c.hasItemOption?m:l.extend({},m)),u.add(n),c.setItemGraphicEl(i,n)})},_renderOnGeo:function(t,e,i,a){var l=i.targetVisuals.inRange,u=i.targetVisuals.outOfRange,c=e.getData(),h=this._hmLayer||this._hmLayer||new s;h.blurSize=e.get("blurSize"),h.pointSize=e.get("pointSize"),h.minOpacity=e.get("minOpacity"),h.maxOpacity=e.get("maxOpacity");var d=t.getViewRect().clone(),f=t.getRoamTransform().transform;d.applyTransform(f);var p=Math.max(d.x,0),g=Math.max(d.y,0),m=Math.min(d.width+d.x,a.getWidth()),v=Math.min(d.height+d.y,a.getHeight()),y=m-p,x=v-g,_=c.mapArray(["lng","lat","value"],function(e,i,n){var o=t.dataToPoint([e,i]);return o[0]-=p,o[1]-=g,o.push(n),o}),b=i.getExtent(),w="visualMap.continuous"===i.type?o(b,i.option.range):n(b,i.getPieceList(),i.option.selected);h.update(_,y,x,l.color.getNormalizer(),{inRange:l.color.getColorMapper(),outOfRange:u.color.getColorMapper()},w);var S=new r.Image({style:{width:y,height:x,x:p,y:g,image:h.canvas},silent:!0});this.group.add(S)}})},function(t,e,i){function n(t,e,i){r.call(this,t,e,i),this._lastFrame=0,this._lastFramePercent=0}var o=i(247),a=i(1),r=i(246),s=i(6),l=n.prototype;l.createLine=function(t,e,i){return new o(t,e,i)},l.updateAnimationPoints=function(t,e){this._points=e;for(var i=[0],n=0,o=1;o<e.length;o++){var a=e[o-1],r=e[o];n+=s.dist(a,r),i.push(n)}if(0!==n){for(var o=0;o<i.length;o++)i[o]/=n;this._offsets=i,this._length=n}},l.getLineLength=function(t){return this._length},l.updateSymbolPosition=function(t){var e=t.__t,i=this._points,n=this._offsets,o=i.length;if(n){var a,r=this._lastFrame;if(e<this._lastFramePercent){var l=Math.min(r+1,o-1);for(a=l;a>=0&&!(n[a]<=e);a--);a=Math.min(a,o-2)}else{for(var a=r;a<o&&!(n[a]>e);a++);a=Math.min(a-1,o-2)}s.lerp(t.position,i[a],i[a+1],(e-n[a])/(n[a+1]-n[a]));var u=i[a+1][0]-i[a][0],c=i[a+1][1]-i[a][1];t.rotation=-Math.atan2(c,u)-Math.PI/2,this._lastFrame=a,this._lastFramePercent=e,t.ignore=!1}},a.inherits(n,r),t.exports=n},function(t,e,i){function n(t){return r.isArray(t)||(t=[+t,+t]),t}function o(t,e){t.eachChild(function(t){t.attr({z:e.z,zlevel:e.zlevel,style:{stroke:"stroke"===e.brushType?e.color:null,fill:"fill"===e.brushType?e.color:null}})})}function a(t,e){h.call(this);var i=new c(t,e),n=new h;this.add(i),this.add(n),n.beforeUpdate=function(){this.attr(i.getScale())},this.updateData(t,e)}var r=i(1),s=i(24),l=i(3),u=i(4),c=i(54),h=l.Group,d=3,f=a.prototype;f.stopEffectAnimation=function(){this.childAt(1).removeAll()},f.startEffectAnimation=function(t){for(var e=t.symbolType,i=t.color,n=this.childAt(1),a=0;a<d;a++){var r=s.createSymbol(e,-1,-1,2,2,i);r.attr({style:{strokeNoScale:!0},z2:99,silent:!0,scale:[.5,.5]});var l=-a/d*t.period+t.effectOffset;r.animate("",!0).when(t.period,{scale:[t.rippleScale/2,t.rippleScale/2]}).delay(l).start(),r.animateStyle(!0).when(t.period,{opacity:0}).delay(l).start(),n.add(r)}o(n,t)},f.updateEffectAnimation=function(t){for(var e=this._effectCfg,i=this.childAt(1),n=["symbolType","period","rippleScale"],a=0;a<n;a++){var r=n[a];if(e[r]!==t[r])return this.stopEffectAnimation(),void this.startEffectAnimation(t)}o(i,t)},f.highlight=function(){this.trigger("emphasis")},f.downplay=function(){this.trigger("normal")},f.updateData=function(t,e){var i=t.hostModel;this.childAt(0).updateData(t,e);var o=this.childAt(1),a=t.getItemModel(e),r=t.getItemVisual(e,"symbol"),s=n(t.getItemVisual(e,"symbolSize")),l=t.getItemVisual(e,"color");o.attr("scale",s),o.traverse(function(t){t.attr({fill:l})});var c=a.getShallow("symbolOffset");if(c){var h=o.position;h[0]=u.parsePercent(c[0],s[0]),h[1]=u.parsePercent(c[1],s[1])}o.rotation=(a.getShallow("symbolRotate")||0)*Math.PI/180||0;var d={};if(d.showEffectOn=i.get("showEffectOn"),d.rippleScale=a.get("rippleEffect.scale"),d.brushType=a.get("rippleEffect.brushType"),d.period=1e3*a.get("rippleEffect.period"),d.effectOffset=e/t.count(),d.z=a.getShallow("z")||0,d.zlevel=a.getShallow("zlevel")||0,d.symbolType=r,d.color=l,this.off("mouseover").off("mouseout").off("emphasis").off("normal"),"render"===d.showEffectOn)this._effectCfg?this.updateEffectAnimation(d):this.startEffectAnimation(d),this._effectCfg=d;else{this._effectCfg=null,this.stopEffectAnimation();var f=this.childAt(0),p=function(){f.trigger("emphasis"),"render"!==d.showEffectOn&&this.startEffectAnimation(d)},g=function(){f.trigger("normal"),"render"!==d.showEffectOn&&this.stopEffectAnimation()};this.on("mouseover",p,this).on("mouseout",g,this).on("emphasis",p,this).on("normal",g,this)}this._effectCfg=d},f.fadeOut=function(t){this.off("mouseover").off("mouseout").off("emphasis").off("normal"),t&&t()},r.inherits(a,h),t.exports=a},function(t,e,i){function n(){this.group=new o.Group,this._lineEl=new s}var o=i(3),a=i(98),r=i(97),s=o.extendShape({shape:{polyline:!1,segs:[]},buildPath:function(t,e){for(var i=e.segs,n=e.polyline,o=0;o<i.length;o++){var a=i[o];if(n){t.moveTo(a[0][0],a[0][1]);for(var r=1;r<a.length;r++)t.lineTo(a[r][0],a[r][1])}else t.moveTo(a[0][0],a[0][1]),a.length>2?t.quadraticCurveTo(a[2][0],a[2][1],a[1][0],a[1][1]):t.lineTo(a[1][0],a[1][1])}},findDataIndex:function(t,e){for(var i=this.shape,n=i.segs,o=i.polyline,s=Math.max(this.style.lineWidth,1),l=0;l<n.length;l++){var u=n[l];if(o){for(var c=1;c<u.length;c++)if(r.containStroke(u[c-1][0],u[c-1][1],u[c][0],u[c][1],s,t,e))return l}else if(u.length>2){if(a.containStroke(u[0][0],u[0][1],u[2][0],u[2][1],u[1][0],u[1][1],s,t,e))return l}else if(r.containStroke(u[0][0],u[0][1],u[1][0],u[1][1],s,t,e))return l}return-1}}),l=n.prototype;l.updateData=function(t){this.group.removeAll();var e=this._lineEl,i=t.hostModel;e.setShape({segs:t.mapArray(t.getItemLayout),polyline:i.get("polyline")}),e.useStyle(i.getModel("lineStyle.normal").getLineStyle());var n=t.getVisual("color");n&&e.setStyle("stroke",n),e.setStyle("fill"),e.seriesIndex=i.seriesIndex,e.on("mousemove",function(t){e.dataIndex=null;var i=e.findDataIndex(t.offsetX,t.offsetY);i>0&&(e.dataIndex=i)}),this.group.add(e)},l.updateLayout=function(t){var e=t.getData();this._lineEl.setShape({segs:e.mapArray(e.getItemLayout)})},l.remove=function(){this.group.removeAll()},t.exports=n},function(t,e,i){function n(t,e,i,n){l.Group.call(this),this.bodyIndex,this.whiskerIndex,this.styleUpdater=i,this._createContent(t,e,n),this.updateData(t,e,n),this._seriesModel}function o(t,e,i){return s.map(t,function(t){return t=t.slice(),t[e]=i.initBaseline,t})}function a(t){var e={};return s.each(t,function(t,i){e["ends"+i]=t}),e}function r(t){this.group=new l.Group,this.styleUpdater=t}var s=i(1),l=i(3),u=i(8),c=u.extend({type:"whiskerInBox",shape:{},buildPath:function(t,e){for(var i in e)if(e.hasOwnProperty(i)&&0===i.indexOf("ends")){var n=e[i];t.moveTo(n[0][0],n[0][1]),t.lineTo(n[1][0],n[1][1])}}}),h=n.prototype;h._createContent=function(t,e,i){var n=t.getItemLayout(e),r="horizontal"===n.chartLayout?1:0,u=0;this.add(new l.Polygon({shape:{points:i?o(n.bodyEnds,r,n):n.bodyEnds},style:{strokeNoScale:!0},z2:100})),this.bodyIndex=u++;var h=s.map(n.whiskerEnds,function(t){return i?o(t,r,n):t});this.add(new c({shape:a(h),style:{strokeNoScale:!0},z2:100})),this.whiskerIndex=u++},h.updateData=function(t,e,i){var n=this._seriesModel=t.hostModel,o=t.getItemLayout(e),r=l[i?"initProps":"updateProps"];r(this.childAt(this.bodyIndex),{shape:{points:o.bodyEnds}},n,e),r(this.childAt(this.whiskerIndex),{shape:a(o.whiskerEnds)},n,e),this.styleUpdater.call(null,this,t,e)},s.inherits(n,l.Group);var d=r.prototype;d.updateData=function(t){var e=this.group,i=this._data,o=this.styleUpdater;t.diff(i).add(function(i){if(t.hasValue(i)){var a=new n(t,i,o,!0);t.setItemGraphicEl(i,a),e.add(a)}}).update(function(a,r){var s=i.getItemGraphicEl(r);return t.hasValue(a)?(s?s.updateData(t,a):s=new n(t,a,o),e.add(s),void t.setItemGraphicEl(a,s)):void e.remove(s)}).remove(function(t){var n=i.getItemGraphicEl(t);n&&e.remove(n)}).execute(),this._data=t},d.remove=function(){var t=this.group,e=this._data;this._data=null,e&&e.eachItemGraphicEl(function(e){e&&t.remove(e)})},t.exports=r},function(t,e,i){i(315),i(316);var n=i(2);n.registerLayout(i(317)),n.registerVisual(i(318))},function(t,e,i){"use strict";function n(t){var e=t.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(t.data=r.map(e,function(t){var e=[t[0].coord,t[1].coord],i={coords:e};return t[0].name&&(i.fromName=t[0].name),t[1].name&&(i.toName=t[1].name),r.mergeAll([i,t[0],t[1]])}))}var o=i(17),a=i(14),r=i(1),s=i(7),l=(i(26),o.extend({type:"series.lines",dependencies:["grid","polar"],visualColorAccessPath:"lineStyle.normal.color",init:function(t){n(t),l.superApply(this,"init",arguments)},mergeOption:function(t){n(t),l.superApply(this,"mergeOption",arguments)},getInitialData:function(t,e){var i=new a(["value"],this);return i.hasItemOption=!1,i.initData(t.data,[],function(t,e,n,o){if(t instanceof Array)return NaN;i.hasItemOption=!0;var a=t.value;return null!=a?a instanceof Array?a[o]:a:void 0}),i},formatTooltip:function(t){var e=this.getData(),i=e.getItemModel(t),n=i.get("name");if(n)return n;var o=i.get("fromName"),a=i.get("toName"),r=[];return null!=o&&r.push(o),null!=a&&r.push(a),s.encodeHTML(r.join(" > "))},defaultOption:{coordinateSystem:"geo",zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,label:{normal:{show:!1,position:"end"}},lineStyle:{normal:{opacity:.5}}}}))},function(t,e,i){var n=i(107),o=i(246),a=i(106),r=i(247),s=i(310),l=i(312);i(2).extendChartView({type:"lines",init:function(){},render:function(t,e,i){var u=t.getData(),c=this._lineDraw,h=t.get("effect.show"),d=t.get("polyline"),f=t.get("large")&&u.count()>=t.get("largeThreshold");h===this._hasEffet&&d===this._isPolyline&&f===this._isLarge||(c&&c.remove(),c=this._lineDraw=f?new l:new n(d?h?s:r:h?o:a),this._hasEffet=h,this._isPolyline=d,this._isLarge=f);var p=t.get("zlevel"),g=t.get("effect.trailLength"),m=i.getZr();if(m.painter.getLayer(p).clear(!0),null!=this._lastZlevel&&m.configLayer(this._lastZlevel,{motionBlur:!1}),h&&g){m.configLayer(p,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(g/10+.9,1),0)})}this.group.add(c.group),c.updateData(u),this._lastZlevel=p},updateLayout:function(t,e,i){this._lineDraw.updateLayout(t);var n=i.getZr();n.painter.getLayer(this._lastZlevel).clear(!0)},remove:function(t,e){this._lineDraw&&this._lineDraw.remove(e,!0)},dispose:function(){}})},function(t,e,i){t.exports=function(t){t.eachSeriesByType("lines",function(t){var e=t.coordinateSystem,i=t.getData();i.each(function(n){var o=i.getItemModel(n),a=o.option instanceof Array?o.option:o.get("coords"),r=[];if(t.get("polyline"))for(var s=0;s<a.length;s++)r.push(e.dataToPoint(a[s]));else{r[0]=e.dataToPoint(a[0]),r[1]=e.dataToPoint(a[1]);var l=o.get("lineStyle.normal.curveness");+l&&(r[2]=[(r[0][0]+r[1][0])/2-(r[0][1]-r[1][1])*l,(r[0][1]+r[1][1])/2-(r[1][0]-r[0][0])*l])}i.setItemLayout(n,r)})})}},function(t,e){function i(t){return t instanceof Array||(t=[t,t]),t}t.exports=function(t){t.eachSeriesByType("lines",function(t){var e=t.getData(),n=i(t.get("symbol")),o=i(t.get("symbolSize")),a="lineStyle.normal.opacity".split(".");e.setVisual("fromSymbol",n&&n[0]),e.setVisual("toSymbol",n&&n[1]),e.setVisual("fromSymbolSize",o&&o[0]),e.setVisual("toSymbolSize",o&&o[1]),e.setVisual("opacity",t.get(a)),e.each(function(t){var n=e.getItemModel(t),o=i(n.getShallow("symbol",!0)),r=i(n.getShallow("symbolSize",!0)),s=n.get(a);o[0]&&e.setItemVisual(t,"fromSymbol",o[0]),o[1]&&e.setItemVisual(t,"toSymbol",o[1]),r[0]&&e.setItemVisual(t,"fromSymbolSize",r[0]),r[1]&&e.setItemVisual(t,"toSymbolSize",r[1]),e.setItemVisual(t,"opacity",s)})})}},function(t,e,i){var n=i(2),o=n.PRIORITY;i(320),i(321),i(241),i(186),n.registerLayout(i(324)),n.registerVisual(i(325)),n.registerProcessor(o.PROCESSOR.STATISTIC,i(323)),n.registerPreprocessor(i(322)),i(89)("map",[{type:"mapToggleSelect",event:"mapselectchanged",method:"toggleSelected"},{type:"mapSelect",event:"mapselected",method:"select"},{type:"mapUnSelect",event:"mapunselected",method:"unSelect"}])},function(t,e,i){var n=i(14),o=i(17),a=i(1),r=i(25),s=i(7),l=s.encodeHTML,u=s.addCommas,c=i(78),h=i(186),d=o.extend({type:"series.map",dependencies:["geo"],layoutMode:"box",needsDrawMap:!1,seriesGroup:[],init:function(t){t=this._fillOption(t,this.getMapType()),this.option=t,d.superApply(this,"init",arguments),this.updateSelectedMap(t.data)},getInitialData:function(t){var e=r(["value"],t.data||[]),i=new n(e,this);return i.initData(t.data),i},mergeOption:function(t){t.data&&(t=this._fillOption(t,this.getMapType())),d.superCall(this,"mergeOption",t),this.updateSelectedMap(this.option.data)},getHostGeoModel:function(){var t=this.option.geoIndex;return null!=t?this.dependentModels.geo[t]:null},getMapType:function(){return(this.getHostGeoModel()||this).option.map},_fillOption:function(t,e){return t=a.extend({},t),t.data=h.getFilledRegions(t.data,e),t},getRawValue:function(t){return this.getData().get("value",t)},getRegionModel:function(t){var e=this.getData();return e.getItemModel(e.indexOfName(t))},formatTooltip:function(t){for(var e=this.getData(),i=u(this.getRawValue(t)),n=e.getName(t),o=this.seriesGroup,a=[],r=0;r<o.length;r++){var s=o[r].originalData.indexOfName(n);isNaN(o[r].originalData.get("value",s))||a.push(l(o[r].name))}return a.join(", ")+"<br />"+l(n+" : "+i)},getTooltipPosition:function(t){if(null!=t){var e=this.getData().getName(t),i=this.coordinateSystem,n=i.getRegion(e);return n&&i.dataToPoint(n.center)}},setZoom:function(t){this.option.zoom=t},setCenter:function(t){this.option.center=t},defaultOption:{zlevel:0,z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:.75,showLegendSymbol:!0,dataRangeHoverLink:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{normal:{show:!1,textStyle:{color:"#000"}},emphasis:{show:!0,textStyle:{color:"rgb(100,0,0)"}}},itemStyle:{normal:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{areaColor:"rgba(255,215,0,0.8)"}}}});a.mixin(d,c),t.exports=d},function(t,e,i){var n=i(3),o=i(250);i(2).extendChartView({type:"map",render:function(t,e,i,n){if(!n||"mapToggleSelect"!==n.type||n.from!==this.uid){var a=this.group;if(a.removeAll(),!t.getHostGeoModel()){if(n&&"geoRoam"===n.type&&"series"===n.componentType&&n.seriesId===t.id){var r=this._mapDraw;r&&a.add(r.group)}else if(t.needsDrawMap){var r=this._mapDraw||new o(i,!0);a.add(r.group),r.draw(t,e,i,this,n),this._mapDraw=r}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;t.get("showLegendSymbol")&&e.getComponent("legend")&&this._renderSymbols(t,e,i)}}},remove:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},dispose:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},_renderSymbols:function(t,e,i){var o=t.originalData,a=this.group;o.each("value",function(e,i){if(!isNaN(e)){var r=o.getItemLayout(i);if(r&&r.point){var s=r.point,l=r.offset,u=new n.Circle({style:{fill:t.getData().getVisual("color")},shape:{cx:s[0]+9*l,cy:s[1],r:3},silent:!0,z2:10});if(!l){var c=t.mainSeries.getData(),h=o.getName(i),d=h,f=c.indexOfName(h),p=o.getItemModel(i),g=p.getModel("label.normal"),m=p.getModel("label.emphasis"),v=g.getModel("textStyle"),y=m.getModel("textStyle"),x=c.getItemGraphicEl(f);u.setStyle({textPosition:"bottom"});var _=function(){u.setStyle({text:m.get("show")?d:"",textFill:y.getTextColor(),textFont:y.getFont()})},b=function(){u.setStyle({text:g.get("show")?d:"",textFill:v.getTextColor(),textFont:v.getFont()})};x.on("mouseover",_).on("mouseout",b).on("emphasis",_).on("normal",b),b()}a.add(u)}}})}})},function(t,e,i){var n=i(1);t.exports=function(t){var e=[];n.each(t.series,function(t){"map"===t.type&&e.push(t)}),n.each(e,function(t){t.map=t.map||t.mapType,n.defaults(t,t.mapLocation)})}},function(t,e,i){function n(t,e){var i={},n=["value"];return o.each(t,function(t){t.each(n,function(e,n){var o="ec-"+t.getName(n);i[o]=i[o]||[],isNaN(e)||i[o].push(e)})}),t[0].map(n,function(n,o){for(var a="ec-"+t[0].getName(o),r=0,s=1/0,l=-(1/0),u=i[a].length,c=0;c<u;c++)s=Math.min(s,i[a][c]),l=Math.max(l,i[a][c]),r+=i[a][c];var h;return h="min"===e?s:"max"===e?l:"average"===e?r/u:r,0===u?NaN:h})}var o=i(1);t.exports=function(t){var e={};t.eachSeriesByType("map",function(t){var i=t.getHostGeoModel(),n=i?"o"+i.id:"i"+t.getMapType();(e[n]=e[n]||[]).push(t)}),o.each(e,function(t,e){for(var i=n(o.map(t,function(t){return t.getData()}),t[0].get("mapValueCalculation")),a=0;a<t.length;a++)t[a].originalData=t[a].getData();for(var a=0;a<t.length;a++)t[a].seriesGroup=t,t[a].needsDrawMap=0===a&&!t[a].getHostGeoModel(),t[a].setData(i.cloneShallow()),t[a].mainSeries=t[0]})}},function(t,e,i){var n=i(1);t.exports=function(t){var e={};t.eachSeriesByType("map",function(i){var o=i.getMapType();if(!i.getHostGeoModel()&&!e[o]){var a={};n.each(i.seriesGroup,function(e){var i=e.coordinateSystem,n=e.originalData;e.get("showLegendSymbol")&&t.getComponent("legend")&&n.each("value",function(t,e){var o=n.getName(e),r=i.getRegion(o);if(r&&!isNaN(t)){var s=a[o]||0,l=i.dataToPoint(r.center);a[o]=s+1,n.setItemLayout(e,{point:l,offset:s})}})});var r=i.getData();r.each(function(t){var e=r.getName(t),i=r.getItemLayout(t)||{};i.showLabel=!a[e],r.setItemLayout(t,i)}),e[o]=!0}})}},function(t,e){t.exports=function(t){t.eachSeriesByType("map",function(t){var e=t.get("color"),i=t.getModel("itemStyle.normal"),n=i.get("areaColor"),o=i.get("color")||e[t.seriesIndex%e.length];t.getData().setVisual({areaColor:n,color:o})})}},function(t,e,i){var n=i(2);i(252),i(327),i(328),n.registerVisual(i(329))},function(t,e,i){function n(t,e,i){var n=t.get("data"),a=o(e);n&&n.length&&s.each(i,function(t){if(t){var e=s.indexOf(n,t[a]);t[a]=e>=0?e:NaN}})}function o(t){return+t.replace("dim","")}function a(t,e){var i=0;s.each(t,function(t){var e=o(t);e>i&&(i=e)});var n=e[0];n&&n.length-1>i&&(i=n.length-1);for(var a=[],r=0;r<=i;r++)a.push("dim"+r);return a}var r=i(14),s=i(1),l=i(17),u=i(25);t.exports=l.extend({type:"series.parallel",dependencies:["parallel"],visualColorAccessPath:"lineStyle.normal.color",getInitialData:function(t,e){var i=e.getComponent("parallel",this.get("parallelIndex")),o=i.parallelAxisIndex,l=t.data,c=i.dimensions,h=a(c,l),d=s.map(h,function(t,i){var a=s.indexOf(c,t),r=a>=0&&e.getComponent("parallelAxis",o[a]);return r&&"category"===r.get("type")?(n(r,t,l),{name:t,type:"ordinal"}):a<0&&u.guessOrdinal(l,i)?{name:t,type:"ordinal"}:t}),f=new r(d,this);return f.initData(l),this.option.progressive&&(this.option.animation=!1),f},getRawIndicesByActiveState:function(t){var e=this.coordinateSystem,i=this.getData(),n=[];return e.eachActiveState(i,function(e,o){t===e&&n.push(i.getRawIndex(o))}),n},defaultOption:{zlevel:0,z:2,coordinateSystem:"parallel",parallelIndex:0,label:{normal:{show:!1},emphasis:{show:!1}},inactiveOpacity:.05,activeOpacity:1,lineStyle:{normal:{width:1,opacity:.45,type:"solid"}},progressive:!1,smooth:!1,animationEasing:"linear"}})},function(t,e,i){function n(t,e,i){var n=t.model,o=t.getRect(),a=new l.Rect({shape:{x:o.x,y:o.y,width:o.width,height:o.height}}),r="horizontal"===n.get("layout")?"width":"height";return a.setShape(r,0),l.initProps(a,{shape:{width:o.width,height:o.height}},e,i),a}function o(t,e,i,n){for(var o=[],a=0;a<i.length;a++){var r=i[a],l=t.get(r,e);s(l,n.getAxis(r).type)||o.push(n.dataToPoint(l,r))}return o}function a(t,e,i,n,a){var r=o(t,i,n,a),s=new l.Polyline({shape:{points:r},silent:!0,z2:10});e.add(s),t.setItemGraphicEl(i,s)}function r(t,e){var i=t.hostModel.getModel("lineStyle.normal"),n=i.getLineStyle();t.eachItemGraphicEl(function(o,a){if(t.hasItemOption){var r=t.getItemModel(a),s=r.getModel("lineStyle.normal",i);n=s.getLineStyle(["color","stroke"])}o.useStyle(u.extend(n,{fill:null,stroke:t.getItemVisual(a,"color"),opacity:t.getItemVisual(a,"opacity")})),o.shape.smooth=e})}function s(t,e){return"category"===e?null==t:null==t||isNaN(t)}var l=i(3),u=i(1),c=.3,h=i(30).extend({type:"parallel",init:function(){this._dataGroup=new l.Group,this.group.add(this._dataGroup),this._data},render:function(t,e,i,n){this._renderForNormal(t,n)},dispose:function(){},_renderForNormal:function(t,e){function i(t){a(d,h,t,g,p,null,v)}function s(i,n){var a=f.getItemGraphicEl(n),r=o(d,i,g,p);d.setItemGraphicEl(i,a);var s=e&&e.animation===!1?null:t;l.updateProps(a,{shape:{points:r}},s,i)}function u(t){var e=f.getItemGraphicEl(t);h.remove(e)}var h=this._dataGroup,d=t.getData(),f=this._data,p=t.coordinateSystem,g=p.dimensions,m=t.option,v=m.smooth?c:null;if(d.diff(f).add(i).update(s).remove(u).execute(),r(d,v),!this._data){var y=n(p,t,function(){setTimeout(function(){h.removeClipPath()})});h.setClipPath(y)}this._data=d},remove:function(){this._dataGroup&&this._dataGroup.removeAll(),this._data=null}});t.exports=h},function(t,e){var i=["lineStyle","normal","opacity"];t.exports=function(t){t.eachSeriesByType("parallel",function(e){var n=e.getModel("itemStyle.normal"),o=e.getModel("lineStyle.normal"),a=t.get("color"),r=o.get("color")||n.get("color")||a[e.seriesIndex%a.length],s=e.get("inactiveOpacity"),l=e.get("activeOpacity"),u=e.getModel("lineStyle.normal").getLineStyle(),c=e.coordinateSystem,h=e.getData(),d={normal:u.opacity,active:l,inactive:s};c.eachActiveState(h,function(t,e){var n=h.getItemModel(e),o=d[t];if("normal"===t){var a=n.get(i,!0);null!=a&&(o=a)}h.setItemVisual(e,"opacity",o)}),h.setVisual("color",r)})}},function(t,e,i){var n=i(1);i(57),i(268),i(269);var o=i(82),a=i(2);a.registerLayout(n.curry(o,"pictorialBar")),a.registerVisual(n.curry(i(50),"pictorialBar","roundRect",null)),i(32)},function(t,e,i){var n=i(1),o=i(2);i(374),i(332),i(333),o.registerVisual(n.curry(i(84),"radar")),o.registerVisual(n.curry(i(50),"radar","circle",null)),o.registerLayout(i(335)),o.registerProcessor(n.curry(i(63),"radar")),o.registerPreprocessor(i(334))},function(t,e,i){"use strict";var n=i(17),o=i(14),a=i(25),r=i(1),s=i(7).encodeHTML,l=n.extend({type:"series.radar",dependencies:["radar"],init:function(t){l.superApply(this,"init",arguments),this.legendDataProvider=function(){return this.getRawData()}},getInitialData:function(t,e){var i=t.data||[],n=a([],i,{extraPrefix:"indicator_",extraFromZero:!0}),r=new o(n,this);return r.initData(i),r},formatTooltip:function(t){var e=this.getRawValue(t),i=this.coordinateSystem,n=i.getIndicatorAxes(),o=this.getData().getName(t);return s(""===o?this.name:o)+"<br/>"+r.map(n,function(t,i){return s(t.name+" : "+e[i])}).join("<br />")},defaultOption:{zlevel:0,z:2,coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{normal:{width:2,type:"solid"}},label:{normal:{position:"top"}},symbol:"emptyCircle",symbolSize:4}});t.exports=l},function(t,e,i){function n(t){return a.isArray(t)||(t=[+t,+t]),t}var o=i(3),a=i(1),r=i(24);t.exports=i(2).extendChartView({type:"radar",render:function(t,e,i){function s(t,e){var i=t.getItemVisual(e,"symbol")||"circle",o=t.getItemVisual(e,"color");if("none"!==i){var a=r.createSymbol(i,-.5,-.5,1,1,o);return a.attr({style:{strokeNoScale:!0},z2:100,scale:n(t.getItemVisual(e,"symbolSize"))}),a}}function l(e,i,n,a,r,l){n.removeAll();for(var u=0;u<i.length-1;u++){var c=s(a,r);c&&(c.__dimIdx=u,e[u]?(c.attr("position",e[u]),o[l?"initProps":"updateProps"](c,{position:i[u]},t,r)):c.attr("position",i[u]),n.add(c))}}function u(t){return a.map(t,function(t){return[c.cx,c.cy]})}var c=t.coordinateSystem,h=this.group,d=t.getData(),f=this._data;d.diff(f).add(function(e){var i=d.getItemLayout(e);if(i){var n=new o.Polygon,a=new o.Polyline,r={shape:{points:i}};n.shape.points=u(i),a.shape.points=u(i),o.initProps(n,r,t,e),o.initProps(a,r,t,e);var s=new o.Group,c=new o.Group;s.add(a),s.add(n),s.add(c),l(a.shape.points,i,c,d,e,!0),d.setItemGraphicEl(e,s)}}).update(function(e,i){var n=f.getItemGraphicEl(i),a=n.childAt(0),r=n.childAt(1),s=n.childAt(2),u={shape:{points:d.getItemLayout(e)}};u.shape.points&&(l(a.shape.points,u.shape.points,s,d,e,!1),o.updateProps(a,u,t),o.updateProps(r,u,t),d.setItemGraphicEl(e,n))}).remove(function(t){h.remove(f.getItemGraphicEl(t))}).execute(),d.eachItemGraphicEl(function(e,i){function n(){u.attr("ignore",v)}function r(){u.attr("ignore",m)}var s=d.getItemModel(i),l=e.childAt(0),u=e.childAt(1),c=e.childAt(2),f=d.getItemVisual(i,"color");h.add(e),l.useStyle(a.defaults(s.getModel("lineStyle.normal").getLineStyle(),{fill:"none",stroke:f})),l.hoverStyle=s.getModel("lineStyle.emphasis").getLineStyle();var p=s.getModel("areaStyle.normal"),g=s.getModel("areaStyle.emphasis"),m=p.isEmpty()&&p.parentModel.isEmpty(),v=g.isEmpty()&&g.parentModel.isEmpty();v=v&&m,u.ignore=m,u.useStyle(a.defaults(p.getAreaStyle(),{fill:f,opacity:.7})),u.hoverStyle=g.getAreaStyle();var y=s.getModel("itemStyle.normal").getItemStyle(["color"]),x=s.getModel("itemStyle.emphasis").getItemStyle(),_=s.getModel("label.normal"),b=s.getModel("label.emphasis");c.eachChild(function(e){e.setStyle(y),e.hoverStyle=a.clone(x);var n=d.get(d.dimensions[e.__dimIdx],i);o.setText(e.style,_,f),e.setStyle({text:_.get("show")?a.retrieve(t.getFormattedLabel(i,"normal",null,e.__dimIdx),n):""}),o.setText(e.hoverStyle,b,f),e.hoverStyle.text=b.get("show")?a.retrieve(t.getFormattedLabel(i,"emphasis",null,e.__dimIdx),n):""}),e.off("mouseover").off("mouseout").off("normal").off("emphasis"),e.on("emphasis",n).on("mouseover",n).on("normal",r).on("mouseout",r),o.setHoverStyle(e)}),this._data=d},remove:function(){this.group.removeAll(),this._data=null},dispose:function(){}})},function(t,e,i){var n=i(1);t.exports=function(t){var e=t.polar;if(e){n.isArray(e)||(e=[e]);var i=[];n.each(e,function(e,o){e.indicator?(e.type&&!e.shape&&(e.shape=e.type),t.radar=t.radar||[],n.isArray(t.radar)||(t.radar=[t.radar]),t.radar.push(e)):i.push(e)}),t.polar=i}n.each(t.series,function(t){"radar"===t.type&&t.polarIndex&&(t.radarIndex=t.polarIndex)})}},function(t,e){t.exports=function(t){t.eachSeriesByType("radar",function(t){function e(t,e){n[e]=n[e]||[],n[e][a]=o.dataToPoint(t,a)}var i=t.getData(),n=[],o=t.coordinateSystem;if(o){for(var a=0;a<o.getIndicatorAxes().length;a++){var r=i.dimensions[a];i.each(r,e)}i.each(function(t){n[t][0]&&n[t].push(n[t][0].slice()),i.setItemLayout(t,n[t])})}})}},function(t,e,i){var n=i(2);i(337),i(338),n.registerLayout(i(339)),n.registerVisual(i(340))},function(t,e,i){var n=i(17),o=i(248),a=i(7).encodeHTML,r=n.extend({type:"series.sankey",layoutInfo:null,getInitialData:function(t){var e=t.edges||t.links,i=t.data||t.nodes;if(i&&e){var n=o(i,e,this,!0);return n.data}},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},formatTooltip:function(t,e,i){if("edge"===i){var n=this.getDataParams(t,i),o=n.data,s=o.source+" -- "+o.target;return n.value&&(s+=" : "+n.value),a(s)}return r.superCall(this,"formatTooltip",t,e)},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",layout:null,left:"5%",top:"5%",right:"20%",bottom:"5%",nodeWidth:20,nodeGap:8,layoutIterations:32,label:{normal:{show:!0,position:"right",textStyle:{color:"#000",fontSize:12}},emphasis:{show:!0}},itemStyle:{normal:{borderWidth:1,borderColor:"#333"}},lineStyle:{normal:{color:"#314656",opacity:.2,curveness:.5},emphasis:{opacity:.6}},animationEasing:"linear",animationDuration:1e3}});t.exports=r},function(t,e,i){function n(t,e,i){var n=new o.Rect({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return o.initProps(n,{shape:{width:t.width+20,height:t.height+20}},e,i),n}var o=i(3),a=i(1),r=o.extendShape({shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,cpx2:0,cpy2:0,extent:0},buildPath:function(t,e){var i=e.extent/2;t.moveTo(e.x1,e.y1-i),t.bezierCurveTo(e.cpx1,e.cpy1-i,e.cpx2,e.cpy2-i,e.x2,e.y2-i),t.lineTo(e.x2,e.y2+i),t.bezierCurveTo(e.cpx2,e.cpy2+i,e.cpx1,e.cpy1+i,e.x1,e.y1+i),t.closePath()}});t.exports=i(2).extendChartView({type:"sankey",_model:null,render:function(t,e,i){var s=t.getGraph(),l=this.group,u=t.layoutInfo,c=t.getData(),h=t.getData("edge");this._model=t,l.removeAll(),l.position=[u.x,u.y],s.eachEdge(function(e){var i=new r;i.dataIndex=e.dataIndex,i.seriesIndex=t.seriesIndex,i.dataType="edge";var n=e.getModel("lineStyle.normal"),a=n.get("curveness"),s=e.node1.getLayout(),u=e.node2.getLayout(),c=e.getLayout();i.shape.extent=Math.max(1,c.dy);var d=s.x+s.dx,f=s.y+c.sy+c.dy/2,p=u.x,g=u.y+c.ty+c.dy/2,m=d*(1-a)+p*a,v=f,y=d*a+p*(1-a),x=g;switch(i.setShape({x1:d,y1:f,x2:p,y2:g,cpx1:m,cpy1:v,cpx2:y,cpy2:x}),i.setStyle(n.getItemStyle()),i.style.fill){case"source":i.style.fill=e.node1.getVisual("color");break;case"target":i.style.fill=e.node2.getVisual("color")}o.setHoverStyle(i,e.getModel("lineStyle.emphasis").getItemStyle()),l.add(i),h.setItemGraphicEl(e.dataIndex,i)}),s.eachNode(function(e){var i=e.getLayout(),n=e.getModel(),r=n.getModel("label.normal"),s=r.getModel("textStyle"),u=n.getModel("label.emphasis"),h=u.getModel("textStyle"),d=new o.Rect({shape:{x:i.x,y:i.y,width:e.getLayout().dx,height:e.getLayout().dy},style:{text:r.get("show")?t.getFormattedLabel(e.dataIndex,"normal")||e.id:"",textFont:s.getFont(),textFill:s.getTextColor(),textPosition:r.get("position")}});d.setStyle(a.defaults({fill:e.getVisual("color")},n.getModel("itemStyle.normal").getItemStyle())),o.setHoverStyle(d,a.extend(e.getModel("itemStyle.emphasis"),{text:u.get("show")?t.getFormattedLabel(e.dataIndex,"emphasis")||e.id:"",textFont:h.getFont(),textFill:h.getTextColor(),textPosition:u.get("position")})),l.add(d),c.setItemGraphicEl(e.dataIndex,d),d.dataType="node"}),!this._data&&t.get("animation")&&l.setClipPath(n(l.getBoundingRect(),t,function(){l.removeClipPath()})),this._data=t.getData()},dispose:function(){}})},function(t,e,i){function n(t,e){return M.getLayoutRect(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function o(t,e,i,n,o,a,s){r(t,i,o),u(t,e,a,n,s),m(t)}function a(t){T.each(t,function(t){var e=x(t.outEdges,S),i=x(t.inEdges,S),n=Math.max(e,i);t.setLayout({value:n},!0)})}function r(t,e,i){for(var n=t,o=null,a=0,r=0;n.length;){o=[];for(var u=0,c=n.length;u<c;u++){var h=n[u];h.setLayout({x:a},!0),h.setLayout({dx:e},!0);for(var d=0,f=h.outEdges.length;d<f;d++)o.push(h.outEdges[d].node2)}n=o,++a}s(t,a),r=(i-e)/(a-1),l(t,r)}function s(t,e){T.each(t,function(t){t.outEdges.length||t.setLayout({x:e-1},!0)})}function l(t,e){T.each(t,function(t){var i=t.getLayout().x*e;t.setLayout({x:i},!0)})}function u(t,e,i,n,o){var a=I().key(function(t){return t.getLayout().x}).sortKeys(w).entries(t).map(function(t){return t.values});c(t,a,e,i,n),h(a,n,i);for(var r=1;o>0;o--)r*=.99,d(a,r),h(a,n,i),p(a,r),h(a,n,i)}function c(t,e,i,n,o){var a=[];T.each(e,function(t){var e=t.length,i=0;T.each(t,function(t){i+=t.getLayout().value});var r=(n-(e-1)*o)/i;a.push(r)}),a.sort(function(t,e){return t-e});var r=a[0];T.each(e,function(t){T.each(t,function(t,e){t.setLayout({y:e},!0);var i=t.getLayout().value*r;t.setLayout({dy:i},!0)})}),T.each(i,function(t){var e=+t.getValue()*r;t.setLayout({dy:e},!0)})}function h(t,e,i){T.each(t,function(t){var n,o,a,r=0,s=t.length;for(t.sort(b),a=0;a<s;a++){if(n=t[a],o=r-n.getLayout().y,o>0){var l=n.getLayout().y+o;n.setLayout({y:l},!0)}r=n.getLayout().y+n.getLayout().dy+e}if(o=r-e-i,o>0){var l=n.getLayout().y-o;for(n.setLayout({y:l},!0),r=n.getLayout().y,a=s-2;a>=0;--a)n=t[a],o=n.getLayout().y+n.getLayout().dy+e-r,o>0&&(l=n.getLayout().y-o,n.setLayout({y:l},!0)),r=n.getLayout().y}})}function d(t,e){T.each(t.slice().reverse(),function(t){T.each(t,function(t){if(t.outEdges.length){var i=x(t.outEdges,f)/x(t.outEdges,S),n=t.getLayout().y+(i-_(t))*e;t.setLayout({y:n},!0)}})})}function f(t){return _(t.node2)*t.getValue()}function p(t,e){T.each(t,function(t){T.each(t,function(t){if(t.inEdges.length){var i=x(t.inEdges,g)/x(t.inEdges,S),n=t.getLayout().y+(i-_(t))*e;t.setLayout({y:n},!0)}})})}function g(t){return _(t.node1)*t.getValue()}function m(t){T.each(t,function(t){t.outEdges.sort(v),t.inEdges.sort(y)}),T.each(t,function(t){var e=0,i=0;T.each(t.outEdges,function(t){t.setLayout({sy:e},!0),e+=t.getLayout().dy}),T.each(t.inEdges,function(t){t.setLayout({ty:i},!0),i+=t.getLayout().dy})})}function v(t,e){return t.node2.getLayout().y-e.node2.getLayout().y}function y(t,e){return t.node1.getLayout().y-e.node1.getLayout().y}function x(t,e){for(var i=0,n=t.length,o=-1;++o<n;){var a=+e.call(t,t[o],o);isNaN(a)||(i+=a)}return i}function _(t){return t.getLayout().y+t.getLayout().dy/2}function b(t,e){return t.getLayout().y-e.getLayout().y}function w(t,e){return t<e?-1:t>e?1:t===e?0:NaN}function S(t){return t.getValue()}var M=i(12),I=i(265),T=i(1);t.exports=function(t,e,i){t.eachSeriesByType("sankey",function(t){var i=t.get("nodeWidth"),r=t.get("nodeGap"),s=n(t,e);t.layoutInfo=s;var l=s.width,u=s.height,c=t.getGraph(),h=c.nodes,d=c.edges;a(h);var f=T.filter(h,function(t){return 0===t.getLayout().value}),p=0!==f.length?0:t.get("layoutIterations");o(h,d,i,r,l,u,p)})}},function(t,e,i){var n=i(83),o=i(1);t.exports=function(t,e){t.eachSeriesByType("sankey",function(t){var e=t.getGraph(),i=e.nodes;i.sort(function(t,e){return t.getLayout().value-e.getLayout().value});var a=i[0].getLayout().value,r=i[i.length-1].getLayout().value;o.each(i,function(e){var i=new n({type:"color",mappingMethod:"linear",dataExtent:[a,r],visual:t.get("color")}),o=i.mapValueToVisual(e.getLayout().value);e.setVisual("color",o);var s=e.getModel(),l=s.get("itemStyle.normal.color");null!=l&&e.setVisual("color",l)})})}},function(t,e,i){var n=i(2),o=i(1);i(253),i(342),i(343),n.registerLayout(i(344)),n.registerVisual(i(345)),n.registerProcessor(o.curry(i(63),"themeRiver"))},function(t,e,i){"use strict";var n=i(25),o=i(17),a=i(14),r=i(1),s=i(7),l=s.encodeHTML,u=i(265),c=2,h=o.extend({type:"series.themeRiver",dependencies:["singleAxis"],nameMap:null,init:function(t){h.superApply(this,"init",arguments),this.legendDataProvider=function(){return this.getRawData()}},fixData:function(t){for(var e=t.length,i=u().key(function(t){return t[2]}).entries(t),n=r.map(i,function(t){return{name:t.key,dataList:t.values}}),o=n.length,a=-1,s=-1,l=0;l<o;++l){var c=n[l].dataList.length;c>a&&(a=c,s=l)}for(var h=0;h<o;++h)if(h!==s)for(var d=n[h].name,f=0;f<a;++f){for(var p=n[s].dataList[f][0],g=n[h].dataList.length,m=-1,v=0;v<g;++v){var y=n[h].dataList[v][0];if(y===p){m=v;break}}m===-1&&(t[e]=[],t[e][0]=p,t[e][1]=0,t[e][2]=d,e++)}return t},getInitialData:function(t,e){var i=[],o=e.queryComponents({mainType:"singleAxis",index:this.get("singleAxisIndex"),id:this.get("singleAxisId")})[0],s=o.get("type");i=[{name:"time",type:"category"===s?"ordinal":"time"===s?"time":"float"},{name:"value",type:"float"},{name:"name",type:"ordinal"}];for(var l=r.filter(t.data,function(t){return void 0!==t[2]}),u=this.fixData(l||[]),h=[],d=this.nameMap=r.createHashMap(),f=0,p=0;p<u.length;++p)h.push(u[p][c]),d.get(u[p][c])||(d.set(u[p][c],f),f++);i=n(i,u);var g=new a(i,this);return g.initData(u,h),g},coordDimToDataDim:function(t){return["time"]},getLayerSeries:function(){function t(t,i){return e.get("time",t)-e.get("time",i)}for(var e=this.getData(),i=e.count(),n=[],o=0;o<i;++o)n[o]=o;for(var a=u().key(function(t){return e.get("name",t)}).entries(n),s=r.map(a,function(t){return{name:t.key,indices:t.values}}),l=0;l<s.length;++l)s[l].indices.sort(t);return s},getAxisTooltipData:function(t,e,i){r.isArray(t)||(t=t?[t]:[]);for(var n,o=this.getData(),a=this.getLayerSeries(),s=[],l=a.length,u=0;u<l;++u){for(var c=Number.MAX_VALUE,h=-1,d=a[u].indices.length,f=0;f<d;++f){var p=o.get(t[0],a[u].indices[f]),g=Math.abs(p-e);g<=c&&(n=p,c=g,h=a[u].indices[f])}s.push(h)}return{dataIndices:s,nestestValue:n}},formatTooltip:function(t){var e=this.getData(),i=e.get("name",t),n=e.get("value",t);return(isNaN(n)||null==n)&&(n="-"),l(i+" : "+n)},defaultOption:{zlevel:0,z:2,coordinateSystem:"singleAxis",boundaryGap:["10%","10%"],singleAxisIndex:0,animationEasing:"linear",label:{normal:{margin:4,textAlign:"right",show:!0,position:"left",textStyle:{color:"#000",fontSize:11}},emphasis:{show:!0}}}});t.exports=h},function(t,e,i){(function(e){function n(t,e,i){var n=new a.Rect({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return a.initProps(n,{shape:{width:t.width+20,height:t.height+20}},e,i),n}var o=i(93),a=i(3),r=i(1),s=i(48);t.exports=i(2).extendChartView({type:"themeRiver",init:function(){this._layers=[]},render:function(t,e,i){function l(t){return t.name}function u(e,i,s){var l=this._layers;if("remove"===e)return void d.remove(l[i]);for(var u,p=[],g=[],m=f[i].indices,v=0;v<m.length;v++){var x=c.getItemLayout(m[v]),_=x.x,b=x.y0,w=x.y;p.push([_,b]),g.push([_,b+w]),u=h.getItemVisual(m[v],"color")}var S,M,I=c.getItemLayout(m[0]),T=c.getItemModel(m[v-1]),A=T.getModel("label.normal"),C=A.get("margin");if("add"===e){var L=y[i]=new a.Group;S=new o.Polygon({shape:{points:p,stackedOnPoints:g,smooth:.4,stackedOnSmooth:.4,smoothConstraint:!1},z2:0}),M=new a.Text({style:{x:I.x-C,y:I.y0+I.y/2}}),L.add(S),L.add(M),d.add(L),S.setClipPath(n(S.getBoundingRect(),t,function(){S.removeClipPath()}))}else{var L=l[s];S=L.childAt(0),M=L.childAt(1),d.add(L),y[i]=L,a.updateProps(S,{shape:{points:p,stackedOnPoints:g}},t),a.updateProps(M,{style:{x:I.x-C,y:I.y0+I.y/2}},t)}var D=T.getModel("itemStyle.emphasis"),P=T.getModel("itemStyle.normal"),k=A.getModel("textStyle");M.setStyle({text:A.get("show")?t.getFormattedLabel(m[v-1],"normal")||c.getName(m[v-1]):"",textFont:k.getFont(),textAlign:A.get("textAlign"),textVerticalAlign:"middle"}),S.setStyle(r.extend({fill:u},P.getItemStyle(["color"]))),a.setHoverStyle(S,D.getItemStyle())}var c=t.getData(),h=t.getRawData();if(c.count()){var d=this.group,f=t.getLayerSeries(),p=c.getLayout("layoutInfo"),g=p.rect,m=p.boundaryGap;d.attr("position",[0,g.y+m[0]]);var v=new s(this._layersSeries||[],f,l,l),y={};v.add(r.bind(r.curry(u,"add"),this)).update(r.bind(r.curry(u,"update"),this)).remove(r.bind(r.curry(u,"remove"),this)).execute(),this._layersSeries=f,this._layers=y}},dispose:function(){}})}).call(e,i(188))},function(t,e,i){function n(t,e,i){if(t.count())for(var n,r=e.coordinateSystem,s=e.getLayerSeries(),l=a.map(s,function(e){return a.map(e.indices,function(e){var i=r.dataToPoint(t.get("time",e));return i[1]=t.get("value",e),i})}),u=o(l),c=u.y0,h=i/u.max,d=s.length,f=s[0].indices.length,p=0;p<f;++p){n=c[p]*h,t.setItemLayout(s[0].indices[p],{layerIndex:0,x:l[0][p][0],y0:n,y:l[0][p][1]*h});for(var g=1;g<d;++g)n+=l[g-1][p][1]*h,t.setItemLayout(s[g].indices[p],{layerIndex:g,x:l[g][p][0],y0:n,y:l[g][p][1]*h})}}function o(t){for(var e,i=t.length,n=t[0].length,o=[],a=[],r=0,s={},l=0;l<n;++l){for(var u=0,e=0;u<i;++u)e+=t[u][l][1];e>r&&(r=e),o.push(e)}for(var c=0;c<n;++c)a[c]=(r-o[c])/2;r=0;for(var h=0;h<n;++h){var d=o[h]+a[h];d>r&&(r=d)}return s.y0=a,s.max=r,s}var a=i(1),r=i(4);t.exports=function(t,e){t.eachSeriesByType("themeRiver",function(t){var e=t.getData(),i=t.coordinateSystem,o={},a=i.getRect();o.rect=a;var s=t.get("boundaryGap"),l=i.getAxis();if(o.boundaryGap=s,"horizontal"===l.orient){s[0]=r.parsePercent(s[0],a.height),s[1]=r.parsePercent(s[1],a.height);var u=a.height-s[0]-s[1];n(e,t,u)}else{s[0]=r.parsePercent(s[0],a.width),s[1]=r.parsePercent(s[1],a.width);var c=a.width-s[0]-s[1];n(e,t,c)}e.setLayout("layoutInfo",o)})}},function(t,e){t.exports=function(t){t.eachSeriesByType("themeRiver",function(t){var e=t.getData(),i=t.getRawData(),n=t.get("color");e.each(function(o){var a=e.getName(o),r=n[(t.nameMap.get(a)-1)%n.length];i.setItemVisual(o,"color",r)})})}},function(t,e,i){var n=i(2);i(348),i(349),i(350),n.registerVisual(i(352)),n.registerLayout(i(351))},function(t,e,i){function n(t){this.group=new r.Group,t.add(this.group)}function o(t,e,i,n,o,a){var r=[[o?t:t-d,e],[t+i,e],[t+i,e+n],[o?t:t-d,e+n]];return!a&&r.splice(2,0,[t+i+d,e+n/2]),!o&&r.push([t,e+n/2]),r}function a(t,e,i){t.eventData={componentType:"series",componentSubType:"treemap",seriesIndex:e.componentIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:i&&i.dataIndex,name:i&&i.name},treePathInfo:i&&u.wrapTreePathInfo(i,e)}}var r=i(3),s=i(12),l=i(1),u=i(94),c=8,h=8,d=5;n.prototype={constructor:n,render:function(t,e,i,n){var o=t.getModel("breadcrumb"),a=this.group;if(a.removeAll(),o.get("show")&&i){var r=o.getModel("itemStyle.normal"),l=r.getModel("textStyle"),u={pos:{left:o.get("left"),right:o.get("right"),top:o.get("top"),bottom:o.get("bottom")},box:{width:e.getWidth(),height:e.getHeight()},emptyItemWidth:o.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(i,u,l),this._renderContent(t,u,r,l,n),s.positionElement(a,u.pos,u.box)}},_prepare:function(t,e,i){for(var n=t;n;n=n.parentNode){var o=n.getModel().get("name"),a=i.getTextRect(o),r=Math.max(a.width+2*c,e.emptyItemWidth);e.totalWidth+=r+h,e.renderList.push({node:n,text:o,width:r})}},_renderContent:function(t,e,i,n,u){for(var c=0,d=e.emptyItemWidth,f=t.get("breadcrumb.height"),p=s.getAvailableSize(e.pos,e.box),g=e.totalWidth,m=e.renderList,v=m.length-1;v>=0;v--){var y=m[v],x=y.node,_=y.width,b=y.text;g>p.width&&(g-=_-d,_=d,b="");var w=new r.Polygon({shape:{points:o(c,0,_,f,v===m.length-1,0===v)},style:l.defaults(i.getItemStyle(),{lineJoin:"bevel",text:b,textFill:n.getTextColor(),textFont:n.getFont()}),z:10,onclick:l.curry(u,x)});this.group.add(w),a(w,t,x),c+=_+h}},remove:function(){this.group.removeAll()}},t.exports=n},function(t,e,i){function n(t){var e=0;s.each(t.children,function(t){n(t);var i=t.value;s.isArray(i)&&(i=i[0]),e+=i});var i=t.value;s.isArray(i)&&(i=i[0]),(null==i||isNaN(i))&&(i=e),i<0&&(i=0),s.isArray(t.value)?t.value[0]=i:t.value=i}function o(t,e){var i=e.get("color");if(i){t=t||[];var n;if(s.each(t,function(t){var e=new l(t),i=e.get("color");(e.get("itemStyle.normal.color")||i&&"none"!==i)&&(n=!0)}),!n){var o=t[0]||(t[0]={});o.color=i.slice()}return t}}var a=i(17),r=i(425),s=i(1),l=i(10),u=i(7),c=i(94),h=u.encodeHTML,d=u.addCommas;t.exports=a.extend({type:"series.treemap",layoutMode:"box",dependencies:["grid","polar"],_viewRoot:null,defaultOption:{progressive:0,hoverLayerThreshold:1/0,left:"center",top:"middle",right:null,bottom:null,width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{normal:{color:"rgba(0,0,0,0.7)",borderColor:"rgba(255,255,255,0.7)",borderWidth:1,shadowColor:"rgba(150,150,150,1)",shadowBlur:3,shadowOffsetX:0,shadowOffsetY:0,textStyle:{color:"#fff"}},emphasis:{textStyle:{}}}},label:{normal:{show:!0,position:"inside",textStyle:{color:"#fff",ellipsis:!0}}},upperLabel:{normal:{show:!1,position:[0,"50%"],height:20,textStyle:{color:"#fff",ellipsis:!0,baseline:"middle"}},emphasis:{show:!0,position:[0,"50%"],textStyle:{color:"#fff",ellipsis:!0,baseline:"middle"}}},itemStyle:{normal:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},getInitialData:function(t,e){var i={name:t.name,children:t.data};n(i);var a=t.levels||[];return a=t.levels=o(a,e),r.createTree(i,this,a).data},optionUpdated:function(){this.resetViewRoot()},formatTooltip:function(t){var e=this.getData(),i=this.getRawValue(t),n=d(s.isArray(i)?i[0]:i),o=e.getName(t);return h(o+": "+n)},getDataParams:function(t){var e=a.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return e.treePathInfo=c.wrapTreePathInfo(i,this),e},setLayoutInfo:function(t){this.layoutInfo=this.layoutInfo||{},s.extend(this.layoutInfo,t)},mapIdToIndex:function(t){var e=this._idIndexMap;e||(e=this._idIndexMap=s.createHashMap(),this._idIndexMapCount=0);var i=e.get(t);return null==i&&e.set(t,i=this._idIndexMapCount++),i},getViewRoot:function(){return this._viewRoot},resetViewRoot:function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)}})},function(t,e,i){function n(){return{nodeGroup:[],background:[],content:[]}}function o(t,e,i,n,o,l,u,c,h,d){function f(e,i,n){i.dataIndex=u.dataIndex,i.seriesIndex=t.seriesIndex,i.setShape({x:0,y:0,width:D,height:P});var o=u.getVisual("borderColor",!0),a=B.get("borderColor");g(i,function(){var t={fill:o},e={fill:a};if(n){var r=D-2*k;y(t,e,o,r,N,{x:k,y:0,width:r,height:N})}else t.text=e.text="";i.setStyle(t),s.setHoverStyle(i,e)}),e.add(i)}function p(e,i){i.dataIndex=u.dataIndex,i.seriesIndex=t.seriesIndex;var n=Math.max(D-2*k,0),o=Math.max(P-2*k,0);i.culling=!0,i.setShape({x:k,y:k,width:n,height:o});var a=u.getVisual("color",!0);g(i,function(){var t={fill:a},e=B.getItemStyle();y(t,e,a,n,o),i.setStyle(t),s.setHoverStyle(i,e)}),e.add(i)}function g(t,e){O?!t.invisible&&l.push(t):(e(),t.__tmWillVisible||(t.invisible=!1))}function y(e,i,n,o,a,s){var l=u.getModel(),c=r.retrieve(t.getFormattedLabel(u.dataIndex,"normal",null,null,s?"upperLabel":"label"),l.get("name"));if(!s&&L.isLeafRoot){var h=t.get("drillDownIcon",!0);c=h?h+" "+c:c}x(c,e,l,s?w:_,n,o,a,s),x(c,i,l,s?S:b,n,o,a,s)}function x(t,e,i,n,o,a,l,u){var c=i.getModel(n),h=c.getModel("textStyle");s.setText(e,c,o),e.textAlign=h.get("align"),e.textVerticalAlign=h.get("baseline"),u&&(e.textPositionRect=r.clone(u));var d=h.getTextRect(t);!c.getShallow("show")||d.height>l?e.text="":d.width>a?e.text=h.get("ellipsis")?h.truncateText(t,a,null,{minChar:2}):"":e.text=t}function M(t,n,r,s){var l=null!=E&&i[t][E],u=o[t];return l?(i[t][E]=null,A(u,l,t)):O||(l=new n({z:a(r,s)}),l.__tmDepth=r,l.__tmStorageName=t,C(u,l,t)),e[t][z]=l}function A(t,e,i){var n=t[z]={};n.old="nodeGroup"===i?e.position.slice():r.extend({},e.shape)}function C(t,e,i){var a=t[z]={},r=u.parentNode;if(r&&(!n||"drillDown"===n.direction)){var s=0,l=0,c=o.background[r.getRawIndex()];!n&&c&&c.old&&(s=c.old.width,l=c.old.height),a.old="nodeGroup"===i?[0,l]:{x:s,y:l,width:0,height:0}}a.fadein="nodeGroup"!==i}if(u){var L=u.getLayout();if(L&&L.isInView){var D=L.width,P=L.height,k=L.borderWidth,O=L.invisible,z=u.getRawIndex(),E=c&&c.getRawIndex(),R=u.viewChildren,N=L.upperHeight,V=R&&R.length,B=u.getModel("itemStyle.emphasis"),G=M("nodeGroup",m);if(G){if(h.add(G),G.attr("position",[L.x||0,L.y||0]),G.__tmNodeWidth=D,G.__tmNodeHeight=P,L.isAboveViewRoot)return G;var H=M("background",v,d,I);if(H&&f(G,H,V&&L.upperHeight),!V){var F=M("content",v,d,T);F&&p(G,F)}return G}}}}function a(t,e){var i=t*M+e;return(i-1)/i}var r=i(1),s=i(3),l=i(48),u=i(94),c=i(347),h=i(95),d=i(11),f=i(19),p=i(427),g=r.bind,m=s.Group,v=s.Rect,y=r.each,x=3,_=["label","normal"],b=["label","emphasis"],w=["upperLabel","normal"],S=["upperLabel","emphasis"],M=10,I=1,T=2;t.exports=i(2).extendChartView({type:"treemap",init:function(t,e){this._containerGroup,this._storage=n(),this._oldTree,this._breadcrumb,this._controller,this._state="ready",this._mayClick},render:function(t,e,i,n){var o=e.findComponents({mainType:"series",subType:"treemap",query:n});if(!(r.indexOf(o,t)<0)){this.seriesModel=t,this.api=i,this.ecModel=e;var a=u.retrieveTargetInfo(n,t),s=n&&n.type,l=t.layoutInfo,c=!this._oldTree,h=this._storage,d="treemapRootToNode"===s&&a&&h?{rootNodeGroup:h.nodeGroup[a.node.getRawIndex()],direction:n.direction}:null,f=this._giveContainerGroup(l),p=this._doRender(f,t,d);c||s&&"treemapZoomToNode"!==s&&"treemapRootToNode"!==s?p.renderFinally():this._doAnimation(f,p,t,d),this._resetController(i),this._renderBreadcrumb(t,i,a)}},_giveContainerGroup:function(t){var e=this._containerGroup;return e||(e=this._containerGroup=new m,this._initEvents(e),this.group.add(e)),e.attr("position",[t.x,t.y]),e},_doRender:function(t,e,i){function a(t,e,i,n,o){function s(t){return t.getId()}function u(r,s){var l=null!=r?t[r]:null,u=null!=s?e[s]:null,c=m(l,u,i,o);c&&a(l&&l.viewChildren||[],u&&u.viewChildren||[],c,n,o+1)}n?(e=t,y(t,function(t,e){!t.isRemoved()&&u(e,e)})):new l(e,t,s,s).add(u).update(u).remove(r.curry(u,null)).execute()}function s(t){var e=n();return t&&y(t,function(t,i){var n=e[i];y(t,function(t){t&&(n.push(t),t.__tmWillDelete=1)})}),e}function u(){y(v,function(t){y(t,function(t){t.parent&&t.parent.remove(t)})}),y(g,function(t){t.invisible=!0,t.dirty()})}var c=e.getData().tree,h=this._oldTree,d=n(),f=n(),p=this._storage,g=[],m=r.curry(o,e,f,p,i,d,g);a(c.root?[c.root]:[],h&&h.root?[h.root]:[],t,c===h||!h,0);var v=s(p);return this._oldTree=c,this._storage=f,{lastsForAnimation:d,willDeleteEls:v,renderFinally:u}},_doAnimation:function(t,e,i,n){if(i.get("animation")){var o=i.get("animationDurationUpdate"),a=i.get("animationEasing"),s=p.createWrap();y(e.willDeleteEls,function(t,e){y(t,function(t,i){if(!t.invisible){var r,l=t.parent;if(n&&"drillDown"===n.direction)r=l===n.rootNodeGroup?{shape:{x:0,y:0,width:l.__tmNodeWidth,height:l.__tmNodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var u=0,c=0;l.__tmWillDelete||(u=l.__tmNodeWidth/2,c=l.__tmNodeHeight/2),r="nodeGroup"===e?{position:[u,c],style:{opacity:0}}:{shape:{x:u,y:c,width:0,height:0},style:{opacity:0}}}r&&s.add(t,r,o,a)}})}),y(this._storage,function(t,i){y(t,function(t,n){var l=e.lastsForAnimation[i][n],u={};l&&("nodeGroup"===i?l.old&&(u.position=t.position.slice(),t.attr("position",l.old)):(l.old&&(u.shape=r.extend({},t.shape),t.setShape(l.old)),l.fadein?(t.setStyle("opacity",0),u.style={opacity:1}):1!==t.style.opacity&&(u.style={opacity:1})),s.add(t,u,o,a))})},this),this._state="animating",s.done(g(function(){this._state="ready",e.renderFinally()},this)).start()}},_resetController:function(t){var e=this._controller;e||(e=this._controller=new h(t.getZr()),e.enable(this.seriesModel.get("roam")),e.on("pan",g(this._onPan,this)),e.on("zoom",g(this._onZoom,this)));var i=new d(0,0,t.getWidth(),t.getHeight());e.setPointerChecker(function(t,e,n){return i.contain(e,n)})},_clearController:function(){var t=this._controller;t&&(t.dispose(),t=null)},_onPan:function(t,e){if(this._mayClick=!1,"animating"!==this._state&&(Math.abs(t)>x||Math.abs(e)>x)){var i=this.seriesModel.getData().tree.root;if(!i)return;var n=i.getLayout();if(!n)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+t,y:n.y+e,width:n.width,height:n.height}})}},_onZoom:function(t,e,i){if(this._mayClick=!1,"animating"!==this._state){var n=this.seriesModel.getData().tree.root;if(!n)return;var o=n.getLayout();if(!o)return;var a=new d(o.x,o.y,o.width,o.height),r=this.seriesModel.layoutInfo;e-=r.x,i-=r.y;var s=f.create();f.translate(s,s,[-e,-i]),f.scale(s,s,[t,t]),f.translate(s,s,[e,i]),a.applyTransform(s),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:a.x,y:a.y,width:a.width,height:a.height}})}},_initEvents:function(t){function e(t){var e=this.seriesModel.get("nodeClick",!0);if(e){var i=this.findTarget(t.offsetX,t.offsetY);if(i){var n=i.node;if(n.getLayout().isLeafRoot)this._rootToNode(i);else if("zoomToNode"===e)this._zoomToNode(i);else if("link"===e){var o=n.hostTree.data.getItemModel(n.dataIndex),a=o.get("link",!0),r=o.get("target",!0)||"blank";a&&window.open(a,r)}}}}t.on("mousedown",function(t){"ready"===this._state&&(this._mayClick=!0)},this),t.on("mouseup",function(t){this._mayClick&&(this._mayClick=!1,"ready"===this._state&&e.call(this,t))},this)},_renderBreadcrumb:function(t,e,i){function n(e){"animating"!==this._state&&(u.aboveViewRoot(t.getViewRoot(),e)?this._rootToNode({node:e}):this._zoomToNode({node:e}))}i||(i=null!=t.get("leafDepth",!0)?{node:t.getViewRoot()}:this.findTarget(e.getWidth()/2,e.getHeight()/2),i||(i={node:t.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new c(this.group))).render(t,e,i.node,g(n,this))},remove:function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=n(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},dispose:function(){this._clearController()},_zoomToNode:function(t){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},_rootToNode:function(t){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},findTarget:function(t,e){var i,n=this.seriesModel.getViewRoot();return n.eachNode({attr:"viewChildren",order:"preorder"},function(n){var o=this._storage.background[n.getRawIndex()];if(o){var a=o.transformCoordToLocal(t,e),r=o.shape;if(!(r.x<=a[0]&&a[0]<=r.x+r.width&&r.y<=a[1]&&a[1]<=r.y+r.height))return!1;i={node:n,offsetX:a[0],offsetY:a[1]}}},this),i}})},function(t,e,i){for(var n=i(2),o=i(94),a=function(){},r=["treemapZoomToNode","treemapRender","treemapMove"],s=0;s<r.length;s++)n.registerAction({type:r[s],update:"updateView"},a);n.registerAction({type:"treemapRootToNode",update:"updateView"},function(t,e){function i(e,i){var n=o.retrieveTargetInfo(t,e);if(n){var a=e.getViewRoot();a&&(t.direction=o.aboveViewRoot(a,n.node)?"rollUp":"drillDown"),e.resetViewRoot(n.node)}}e.eachComponent({mainType:"series",subType:"treemap",query:t},i)})},function(t,e,i){function n(t,e,i){var n={mainType:"series",subType:"treemap",query:i};t.eachComponent(n,function(t){var n=e.getWidth(),a=e.getHeight(),r=t.option,s=v.getLayoutRect(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()}),l=r.size||[],u=w(S(s.width,l[0]),n),c=w(S(s.height,l[1]),a),p=i&&i.type,m=y.retrieveTargetInfo(i,t),_="treemapRender"===p||"treemapMove"===p?i.rootRect:null,b=t.getViewRoot(),I=y.getPathToRoot(b);if("treemapMove"!==p){var T="treemapZoomToNode"===p?h(t,m,b,u,c):_?[_.width,_.height]:[u,c],A=r.sort;A&&"asc"!==A&&"desc"!==A&&(A="desc");var C={squareRatio:r.squareRatio,sort:A,leafDepth:r.leafDepth};b.hostTree.clearLayouts();var L={x:0,y:0,width:T[0],height:T[1],area:T[0]*T[1]};b.setLayout(L),o(b,C,!1,0);var L=b.getLayout();M(I,function(t,e){var i=(I[e+1]||b).getValue();t.setLayout(g.extend({dataExtent:[i,i],borderWidth:0,upperHeight:0},L))})}var D=t.getData().tree.root;D.setLayout(d(s,_,m),!0),t.setLayoutInfo(s),f(D,new x(-s.x,-s.y,n,a),I,b,0)})}function o(t,e,i,n){var r,s;if(!t.isRemoved()){var l=t.getLayout();r=l.width,s=l.height;var h=t.getModel(),d=h.get(I),f=h.get(T)/2,g=p(h),m=Math.max(d,g),v=d-f,y=m-f,h=t.getModel();t.setLayout({borderWidth:d,upperHeight:m,upperLabelHeight:g},!0),r=_(r-2*v,0),s=_(s-v-y,0);var x=r*s,w=a(t,h,x,e,i,n);if(w.length){var S={x:v,y:y,width:r,height:s},M=b(r,s),A=1/0,C=[];C.area=0;for(var L=0,D=w.length;L<D;){var P=w[L];C.push(P),C.area+=P.getLayout().area;var k=u(C,M,e.squareRatio);k<=A?(L++,A=k):(C.area-=C.pop().getLayout().area,c(C,M,S,f,!1),M=b(S.width,S.height),C.length=C.area=0,A=1/0)}if(C.length&&c(C,M,S,f,!0),!i){var O=h.get("childrenVisibleMin");null!=O&&x<O&&(i=!0)}for(var L=0,D=w.length;L<D;L++)o(w[L],e,i,n+1)}}}function a(t,e,i,n,o,a){var u=t.children||[],c=n.sort;"asc"!==c&&"desc"!==c&&(c=null);var h=null!=n.leafDepth&&n.leafDepth<=a;if(o&&!h)return t.viewChildren=[];u=g.filter(u,function(t){return!t.isRemoved()}),s(u,c);var d=l(e,u,c);if(0===d.sum)return t.viewChildren=[];if(d.sum=r(e,i,d.sum,c,u),0===d.sum)return t.viewChildren=[];for(var f=0,p=u.length;f<p;f++){var m=u[f].getValue()/d.sum*i;u[f].setLayout({area:m})}return h&&(u.length&&t.setLayout({isLeafRoot:!0},!0),u.length=0),t.viewChildren=u,t.setLayout({dataExtent:d.dataExtent},!0),u}function r(t,e,i,n,o){if(!n)return i;for(var a=t.get("visibleMin"),r=o.length,s=r,l=r-1;l>=0;l--){var u=o["asc"===n?r-l-1:l].getValue();u/i*e<a&&(s=l,i-=u)}return"asc"===n?o.splice(0,r-s):o.splice(s,r-s),i}function s(t,e){return e&&t.sort(function(t,i){var n="asc"===e?t.getValue()-i.getValue():i.getValue()-t.getValue();return 0===n?"asc"===e?t.dataIndex-i.dataIndex:i.dataIndex-t.dataIndex:n}),t}function l(t,e,i){for(var n=0,o=0,a=e.length;o<a;o++)n+=e[o].getValue();var r,s=t.get("visualDimension");if(e&&e.length)if("value"===s&&i)r=[e[e.length-1].getValue(),e[0].getValue()],"asc"===i&&r.reverse();else{var r=[1/0,-(1/0)];M(e,function(t){var e=t.getValue(s);e<r[0]&&(r[0]=e),e>r[1]&&(r[1]=e)})}else r=[NaN,NaN];return{sum:n,dataExtent:r}}function u(t,e,i){for(var n,o=0,a=1/0,r=0,s=t.length;r<s;r++)n=t[r].getLayout().area,n&&(n<a&&(a=n),n>o&&(o=n));var l=t.area*t.area,u=e*e*i;return l?_(u*o/l,l/(u*a)):1/0}function c(t,e,i,n,o){var a=e===i.width?0:1,r=1-a,s=["x","y"],l=["width","height"],u=i[s[a]],c=e?t.area/e:0;(o||c>i[l[r]])&&(c=i[l[r]]);for(var h=0,d=t.length;h<d;h++){var f=t[h],p={},g=c?f.getLayout().area/c:0,m=p[l[r]]=_(c-2*n,0),v=i[s[a]]+i[l[a]]-u,y=h===d-1||v<g?v:g,x=p[l[a]]=_(y-2*n,0);p[s[r]]=i[s[r]]+b(n,m/2),p[s[a]]=u+b(n,x/2),u+=y,f.setLayout(p,!0)}i[s[r]]+=c,i[l[r]]-=c}function h(t,e,i,n,o){var a=(e||{}).node,r=[n,o];if(!a||a===i)return r;for(var s,l=n*o,u=l*t.option.zoomToNodeRatio;s=a.parentNode;){for(var c=0,h=s.children,d=0,f=h.length;d<f;d++)c+=h[d].getValue();var g=a.getValue();if(0===g)return r;u*=c/g;var v=s.getModel(),y=v.get(I),x=Math.max(y,p(v,y));u+=4*y*y+(3*y+x)*Math.pow(u,.5),u>m.MAX_SAFE_INTEGER&&(u=m.MAX_SAFE_INTEGER),a=s}u<l&&(u=l);var _=Math.pow(u/l,.5);return[n*_,o*_]}function d(t,e,i){if(e)return{x:e.x,y:e.y};var n={x:0,y:0};if(!i)return n;var o=i.node,a=o.getLayout();if(!a)return n;for(var r=[a.width/2,a.height/2],s=o;s;){var l=s.getLayout();r[0]+=l.x,r[1]+=l.y,s=s.parentNode}return{x:t.width/2-r[0],y:t.height/2-r[1]}}function f(t,e,i,n,o){var a=t.getLayout(),r=i[o],s=r&&r===t;if(!(r&&!s||o===i.length&&t!==n)){t.setLayout({isInView:!0,invisible:!s&&!e.intersect(a),isAboveViewRoot:s},!0);var l=new x(e.x-a.x,e.y-a.y,e.width,e.height);M(t.viewChildren||[],function(t){f(t,l,i,n,o+1)})}}function p(t){return t.get(A)?t.get(C):0}var g=i(1),m=i(4),v=i(12),y=i(94),x=i(11),y=i(94),_=Math.max,b=Math.min,w=m.parsePercent,S=g.retrieve,M=g.each,I=["itemStyle","normal","borderWidth"],T=["itemStyle","normal","gapWidth"],A=["upperLabel","normal","show"],C=["upperLabel","normal","height"];t.exports=n},function(t,e,i){function n(t,e,i,s,u,h){var d=t.getModel(),p=t.getLayout();if(p&&!p.invisible&&p.isInView){var m,v=t.getModel(g),y=i[t.depth],x=o(v,e,y,s),_=v.get("borderColor"),b=v.get("borderColorSaturation");null!=b&&(m=a(x,t),_=r(b,m)),t.setVisual("borderColor",_);var w=t.viewChildren;if(w&&w.length){var S=l(t,d,p,v,x,w);f.each(w,function(t,e){if(t.depth>=u.length||t===u[t.depth]){var o=c(d,x,t,e,S,h);n(t,o,i,s,u,h)}})}else m=a(x,t),t.setVisual("color",m)}}function o(t,e,i,n){var o=f.extend({},e);return f.each(["color","colorAlpha","colorSaturation"],function(a){var r=t.get(a,!0);null==r&&i&&(r=i[a]),null==r&&(r=e[a]),null==r&&(r=n.get(a)),null!=r&&(o[a]=r)}),o}function a(t){var e=s(t,"color");if(e){var i=s(t,"colorAlpha"),n=s(t,"colorSaturation");return n&&(e=d.modifyHSL(e,null,null,n)),i&&(e=d.modifyAlpha(e,i)),e}}function r(t,e){return null!=e?d.modifyHSL(e,null,null,t):null}function s(t,e){var i=t[e];if(null!=i&&"none"!==i)return i}function l(t,e,i,n,o,a){if(a&&a.length){var r=u(e,"color")||null!=o.color&&"none"!==o.color&&(u(e,"colorAlpha")||u(e,"colorSaturation"));if(r){var s=e.get("visualMin"),l=e.get("visualMax"),c=i.dataExtent.slice();null!=s&&s<c[0]&&(c[0]=s),null!=l&&l>c[1]&&(c[1]=l);var d=e.get("colorMappingBy"),f={type:r.name,dataExtent:c,visual:r.range};"color"!==f.type||"index"!==d&&"id"!==d?f.mappingMethod="linear":(f.mappingMethod="category",f.loop=!0);var p=new h(f);return p.__drColorMappingBy=d,p}}}function u(t,e){var i=t.get(e);return p(i)&&i.length?{name:e,range:i}:null}function c(t,e,i,n,o,a){var r=f.extend({},e);if(o){var s=o.type,l="color"===s&&o.__drColorMappingBy,u="index"===l?n:"id"===l?a.mapIdToIndex(i.getId()):i.getValue(t.get("visualDimension"));r[s]=o.mapValueToVisual(u)}return r}var h=i(83),d=i(22),f=i(1),p=f.isArray,g="itemStyle.normal";t.exports=function(t,e,i){var o={mainType:"series",subType:"treemap",query:i};t.eachComponent(o,function(t){var e=t.getData().tree,i=e.root,o=t.getModel(g);if(!i.isRemoved()){var a=f.map(e.levelModels,function(t){return t?t.get(g):null});n(i,{},a,o,t.getViewRoot().getAncestors(),t)}})}},function(t,e,i){"use strict";i(237),i(354)},function(t,e,i){"use strict";function n(t,e,i,n){var o=t.coordToPoint([e,n]),a=t.coordToPoint([i,n]);return{x1:o[0],y1:o[1],x2:a[0],y2:a[1]}}var o=i(1),a=i(3),r=i(10),s=["axisLine","axisLabel","axisTick","splitLine","splitArea"];i(41).extend({type:"angleAxis",axisPointerClass:"PolarAxisPointer",render:function(t,e){if(this.group.removeAll(),t.get("show")){var i=t.axis,n=i.polar,a=n.getRadiusAxis().getExtent(),r=i.getTicksCoords();"category"!==i.type&&r.pop(),o.each(s,function(e){!t.get(e+".show")||i.scale.isBlank()&&"axisLine"!==e||this["_"+e](t,n,r,a)},this)}},_axisLine:function(t,e,i,n){var o=t.getModel("axisLine.lineStyle"),r=new a.Circle({shape:{cx:e.cx,cy:e.cy,r:n[1]},style:o.getLineStyle(),z2:1,silent:!0});r.style.fill=null,this.group.add(r)},_axisTick:function(t,e,i,r){var s=t.getModel("axisTick"),l=(s.get("inside")?-1:1)*s.get("length"),u=o.map(i,function(t){return new a.Line({shape:n(e,r[1],r[1]+l,t)})});this.group.add(a.mergePath(u,{style:o.defaults(s.getModel("lineStyle").getLineStyle(),{stroke:t.get("axisLine.lineStyle.color")})}))},_axisLabel:function(t,e,i,n){for(var o=t.axis,s=t.get("data"),l=t.getModel("axisLabel"),u=l.getModel("textStyle"),c=t.getFormattedLabels(),h=l.get("margin"),d=o.getLabelsCoords(),f=0;f<i.length;f++){var p=n[1],g=e.coordToPoint([p+h,d[f]]),m=e.cx,v=e.cy,y=Math.abs(g[0]-m)/p<.3?"center":g[0]>m?"left":"right",x=Math.abs(g[1]-v)/p<.3?"middle":g[1]>v?"top":"bottom",_=u;s&&s[f]&&s[f].textStyle&&(_=new r(s[f].textStyle,u)),this.group.add(new a.Text({style:{x:g[0],y:g[1],fill:_.getTextColor()||t.get("axisLine.lineStyle.color"),text:c[f],textAlign:y,textVerticalAlign:x,textFont:_.getFont()},silent:!0}))}},_splitLine:function(t,e,i,r){var s=t.getModel("splitLine"),l=s.getModel("lineStyle"),u=l.get("color"),c=0;u=u instanceof Array?u:[u];for(var h=[],d=0;d<i.length;d++){var f=c++%u.length;h[f]=h[f]||[],h[f].push(new a.Line({shape:n(e,r[0],r[1],i[d])}))}for(var d=0;d<h.length;d++)this.group.add(a.mergePath(h[d],{style:o.defaults({stroke:u[d%u.length]},l.getLineStyle()),silent:!0,z:t.get("z")}))},_splitArea:function(t,e,i,n){var r=t.getModel("splitArea"),s=r.getModel("areaStyle"),l=s.get("color"),u=0;l=l instanceof Array?l:[l];for(var c=[],h=Math.PI/180,d=-i[0]*h,f=Math.min(n[0],n[1]),p=Math.max(n[0],n[1]),g=t.get("clockwise"),m=1;m<i.length;m++){var v=u++%l.length;c[v]=c[v]||[],c[v].push(new a.Sector({shape:{cx:e.cx,cy:e.cy,r0:f,r:p,startAngle:d,endAngle:-i[m]*h,clockwise:g},silent:!0})),d=-i[m]*h}for(var m=0;m<c.length;m++)this.group.add(a.mergePath(c[m],{style:o.defaults({fill:l[m%l.length]},s.getAreaStyle()),silent:!0}))}})},function(t,e,i){function n(t,e,i){return i&&"axisAreaSelect"===i.type&&e.findComponents({mainType:"parallelAxis",query:i})[0]===t}function o(t){var e=t.axis;return r.map(t.activeIntervals,function(t){return{brushType:"lineX",panelId:"pl",range:[e.dataToCoord(t[0],!0),e.dataToCoord(t[1],!0)]}})}function a(t,e){return e.getComponent("parallel",t.get("parallelIndex"))}var r=i(1),s=i(40),l=i(127),u=i(185),c=i(3),h=["axisLine","axisLabel","axisTick","axisName"],d=i(2).extendComponentView({type:"parallelAxis",init:function(t,e){d.superApply(this,"init",arguments),(this._brushController=new l(e.getZr())).on("brush",r.bind(this._onBrush,this))},render:function(t,e,i,o){if(!n(t,e,o)){this.axisModel=t,this.api=i,this.group.removeAll();var l=this._axisGroup;if(this._axisGroup=new c.Group,this.group.add(this._axisGroup),t.get("show")){var u=a(t,e),d=u.coordinateSystem,f=t.getAreaSelectStyle(),p=f.width,g=t.axis.dim,m=d.getAxisLayout(g),v=r.extend({strokeContainThreshold:p},m),y=new s(t,v);r.each(h,y.add,y),this._axisGroup.add(y.getGroup()),this._refreshBrushController(v,f,t,u,p,i);var x=o&&o.animation===!1?null:t;c.groupTransition(l,this._axisGroup,x)}}},updateVisual:function(t,e,i,n){this._brushController&&this._brushController.updateCovers(o(t))},_refreshBrushController:function(t,e,i,n,a,r){var s=i.axis.getExtent(),l=s[1]-s[0],h=Math.min(30,.1*Math.abs(l)),d=c.BoundingRect.create({x:s[0],y:-a/2,width:l,height:a});d.x-=h,d.width+=2*h,this._brushController.mount({enableGlobalPan:!0,rotation:t.rotation,position:t.position}).setPanels([{panelId:"pl",clipPath:u.makeRectPanelClipPath(d),isTargetByCursor:u.makeRectIsTargetByCursor(d,r,n),getLinearBrushOtherExtent:u.makeLinearBrushOtherExtent(d,0)}]).enableBrush({brushType:"lineX",brushStyle:e,removeOnClick:!0}).updateCovers(o(i))},_onBrush:function(t,e){var i=this.axisModel,n=i.axis,o=r.map(t,function(t){return[n.coordToData(t.range[0],!0),n.coordToData(t.range[1],!0)]});(!i.option.realtime===e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:i.id,intervals:o})},dispose:function(){this._brushController.dispose()}});t.exports=d},function(t,e,i){"use strict";function n(t,e,i){return{position:[t.cx,t.cy],rotation:i/180*Math.PI,labelDirection:-1,tickDirection:-1,nameDirection:1,labelRotate:e.getModel("axisLabel").get("rotate"),z2:1}}var o=i(1),a=i(3),r=i(40),s=["axisLine","axisLabel","axisTick","axisName"],l=["splitLine","splitArea"];i(41).extend({type:"radiusAxis",axisPointerClass:"PolarAxisPointer",render:function(t,e){if(this.group.removeAll(),t.get("show")){var i=t.axis,a=i.polar,u=a.getAngleAxis(),c=i.getTicksCoords(),h=u.getExtent()[0],d=i.getExtent(),f=n(a,t,h),p=new r(t,f);o.each(s,p.add,p),this.group.add(p.getGroup()),o.each(l,function(e){t.get(e+".show")&&!i.scale.isBlank()&&this["_"+e](t,a,h,d,c)},this)}},_splitLine:function(t,e,i,n,r){var s=t.getModel("splitLine"),l=s.getModel("lineStyle"),u=l.get("color"),c=0;u=u instanceof Array?u:[u];for(var h=[],d=0;d<r.length;d++){var f=c++%u.length;h[f]=h[f]||[],h[f].push(new a.Circle({shape:{cx:e.cx,cy:e.cy,r:r[d]},silent:!0}))}for(var d=0;d<h.length;d++)this.group.add(a.mergePath(h[d],{style:o.defaults({stroke:u[d%u.length],fill:null},l.getLineStyle()),silent:!0}))},_splitArea:function(t,e,i,n,r){var s=t.getModel("splitArea"),l=s.getModel("areaStyle"),u=l.get("color"),c=0;u=u instanceof Array?u:[u];for(var h=[],d=r[0],f=1;f<r.length;f++){var p=c++%u.length;h[p]=h[p]||[],h[p].push(new a.Sector({shape:{cx:e.cx,cy:e.cy,r0:d,r:r[f],startAngle:0,endAngle:2*Math.PI},silent:!0})),d=r[f]}for(var f=0;f<h.length;f++)this.group.add(a.mergePath(h[f],{style:o.defaults({fill:u[f%u.length]},l.getAreaStyle()),silent:!0}))}})},function(t,e,i){var n=i(40),o=i(1),a=i(3),r=i(249),s=n.getInterval,l=n.ifIgnoreOnTick,u=["axisLine","axisLabel","axisTick","axisName"],c="splitLine",h=i(41).extend({type:"singleAxis",axisPointerClass:"SingleAxisPointer",render:function(t,e,i,a){var s=this.group;s.removeAll();var l=r.layout(t),d=new n(t,l);o.each(u,d.add,d),s.add(d.getGroup()),t.get(c+".show")&&this["_"+c](t,l.labelInterval),h.superCall(this,"render",t,e,i,a)},_splitLine:function(t,e){var i=t.axis;if(!i.scale.isBlank()){var n=t.getModel("splitLine"),o=n.getModel("lineStyle"),r=o.get("width"),u=o.get("color"),c=s(n,e);u=u instanceof Array?u:[u];for(var h=t.coordinateSystem.getRect(),d=i.isHorizontal(),f=[],p=0,g=i.getTicksCoords(),m=[],v=[],y=0;y<g.length;++y)if(!l(i,y,c)){var x=i.toGlobalCoord(g[y]);d?(m[0]=x,m[1]=h.y,v[0]=x,v[1]=h.y+h.height):(m[0]=h.x,m[1]=x,v[0]=h.x+h.width,v[1]=x);var _=p++%u.length;f[_]=f[_]||[],f[_].push(new a.Line(a.subPixelOptimizeLine({shape:{x1:m[0],y1:m[1],x2:v[0],y2:v[1]},style:{lineWidth:r},silent:!0})))}for(var y=0;y<f.length;++y)this.group.add(a.mergePath(f[y],{style:{stroke:u[y%u.length],lineDash:o.getLineDash(r),lineWidth:r},silent:!0}))}}});t.exports=h},function(t,e,i){var n=i(2),o={type:"axisAreaSelect",event:"axisAreaSelected",update:"updateVisual"};n.registerAction(o,function(t,e){e.eachComponent({mainType:"parallelAxis",query:t},function(e){e.axis.model.setActiveIntervals(t.intervals)})}),n.registerAction("parallelAxisExpand",function(t,e){e.eachComponent({mainType:"parallel",query:t},function(e){e.setAxisExpand(t)})})},function(t,e,i){"use strict";function n(t,e,i,n,o){var a=e.axis,s=a.dataToCoord(t),c=n.getAngleAxis().getExtent()[0];c=c/180*Math.PI;var h,d,f,p=n.getRadiusAxis().getExtent();if("radius"===a.dim){var g=l.create();l.rotate(g,g,c),l.translate(g,g,[n.cx,n.cy]),h=r.applyTransform([s,-o],g);var m=e.getModel("axisLabel").get("rotate")||0,v=u.innerTextLayout(c,m*Math.PI/180,-1);d=v.textAlign,f=v.textVerticalAlign}else{var y=p[1];h=n.coordToPoint([y+o,s]);var x=n.cx,_=n.cy;d=Math.abs(h[0]-x)/y<.3?"center":h[0]>x?"left":"right",f=Math.abs(h[1]-_)/y<.3?"middle":h[1]>_?"top":"bottom"}return{position:h,align:d,verticalAlign:f}}var o=i(7),a=i(119),r=i(3),s=i(76),l=i(19),u=i(40),c=i(41),h=a.extend({makeElOption:function(t,e,i,a,r){var l=i.axis;"angle"===l.dim&&(this.animationThreshold=Math.PI/18);var u,c=l.polar,h=c.getOtherAxis(l),f=h.getExtent();u=l["dataTo"+o.capitalFirst(l.dim)](e);var p=a.get("type");if(p&&"none"!==p){var g=s.buildElStyle(a),m=d[p](l,c,u,f,g);m.style=g,t.graphicKey=m.type,t.pointer=m}var v=a.get("label.margin"),y=n(e,i,a,c,v);s.buildLabelElOption(t,i,a,r,y)}}),d={line:function(t,e,i,n,o){return"angle"===t.dim?{type:"Line",shape:s.makeLineShape(e.coordToPoint([n[0],i]),e.coordToPoint([n[1],i]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:i}}},shadow:function(t,e,i,n,o){var a=t.getBandWidth(),r=Math.PI/180;return"angle"===t.dim?{type:"Sector",shape:s.makeSectorShape(e.cx,e.cy,n[0],n[1],(-i-a/2)*r,(-i+a/2)*r)}:{type:"Sector",shape:s.makeSectorShape(e.cx,e.cy,i-a/2,i+a/2,0,2*Math.PI)}}};c.registerAxisPointerClass("PolarAxisPointer",h),t.exports=h},function(t,e,i){"use strict";function n(t){return t.isHorizontal()?0:1}function o(t,e){var i=t.getRect();return[i[c[e]],i[c[e]]+i[h[e]]]}var a=i(3),r=i(119),s=i(76),l=i(249),u=i(41),c=["x","y"],h=["width","height"],d=r.extend({makeElOption:function(t,e,i,a,r){var u=i.axis,c=u.coordinateSystem,h=o(c,1-n(u)),d=c.dataToPoint(e)[0],p=a.get("type");if(p&&"none"!==p){var g=s.buildElStyle(a),m=f[p](u,d,h,g);m.style=g,t.graphicKey=m.type,t.pointer=m}var v=l.layout(i);s.buildCartesianSingleLabelElOption(e,t,v,i,a,r)},getHandleTransform:function(t,e,i){var n=l.layout(e,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:s.getTransformedPosition(e.axis,t,n),rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(t,e,i,a){var r=i.axis,s=r.coordinateSystem,l=n(r),u=o(s,l),c=t.position;c[l]+=e[l],c[l]=Math.min(u[1],c[l]),c[l]=Math.max(u[0],c[l]);var h=o(s,1-l),d=(h[1]+h[0])/2,f=[d,d];return f[l]=c[l],{position:c,rotation:t.rotation,cursorPoint:f,tooltipOption:{verticalAlign:"middle"}}}}),f={line:function(t,e,i,o){var r=s.makeLineShape([e,i[0]],[e,i[1]],n(t));return a.subPixelOptimizeLine({shape:r,style:o}),{type:"Line",shape:r}},shadow:function(t,e,i,o){var a=t.getBandWidth(),r=i[1]-i[0];return{type:"Rect",shape:s.makeRectShape([e-a/2,i[0]],[a,r],n(t))}}};u.registerAxisPointerClass("SingleAxisPointer",d),t.exports=d},function(t,e,i){i(2).registerPreprocessor(i(365)),i(367),i(362),i(363),i(364),i(386)},function(t,e,i){function n(t,e){return a.merge({brushType:t.brushType,brushMode:t.brushMode,transformable:t.transformable,brushStyle:new s(t.brushStyle).getItemStyle(),removeOnClick:t.removeOnClick,z:t.z},e,!0)}var o=i(2),a=i(1),r=i(187),s=i(10),l=["#ddd"],u=o.extendComponentModel({type:"brush",dependencies:["geo","grid","xAxis","yAxis","parallel","series"],defaultOption:{toolbox:null,brushLink:null,seriesIndex:"all",geoIndex:null,xAxisIndex:null,yAxisIndex:null,brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(120,140,180,0.3)",borderColor:"rgba(120,140,180,0.8)"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},areas:[],brushType:null,brushOption:{},coordInfoList:[],optionUpdated:function(t,e){var i=this.option;!e&&r.replaceVisualOption(i,t,["inBrush","outOfBrush"]),i.inBrush=i.inBrush||{},i.outOfBrush=i.outOfBrush||{color:l}},setAreas:function(t){t&&(this.areas=a.map(t,function(t){return n(this.option,t)},this))},setBrushOption:function(t){this.brushOption=n(this.option,t),this.brushType=this.brushOption.brushType}});t.exports=u},function(t,e,i){function n(t,e,i,n){(!n||n.$from!==t.id)&&this._brushController.setPanels(t.brushTargetManager.makePanelOpts(i)).enableBrush(t.brushOption).updateCovers(t.areas.slice())}var o=i(1),a=i(127),r=i(2);t.exports=r.extendComponentView({type:"brush",init:function(t,e){this.ecModel=t,this.api=e,this.model,(this._brushController=new a(e.getZr())).on("brush",o.bind(this._onBrush,this)).mount()},render:function(t){return this.model=t,n.apply(this,arguments)},updateView:n,updateLayout:n,updateVisual:n,dispose:function(){this._brushController.dispose()},_onBrush:function(t,e){var i=this.model.id;this.model.brushTargetManager.setOutputRanges(t,this.ecModel),(!e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:i,areas:o.clone(t),$from:i})}})},function(t,e,i){var n=i(2);n.registerAction({type:"brush",event:"brush",update:"updateView"},function(t,e){e.eachComponent({mainType:"brush",query:t},function(e){e.setAreas(t.areas)})}),n.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},function(){})},function(t,e,i){function n(t){var e={};o.each(t,function(t){e[t]=1}),t.length=0,o.each(e,function(e,i){t.push(i)})}var o=i(1),a=["rect","polygon","keep","clear"];t.exports=function(t,e){var i=t&&t.brush;if(o.isArray(i)||(i=i?[i]:[]),i.length){var r=[];o.each(i,function(t){var e=t.hasOwnProperty("toolbox")?t.toolbox:[];e instanceof Array&&(r=r.concat(e))});var s=t&&t.toolbox;o.isArray(s)&&(s=s[0]),s||(s={feature:{}},t.toolbox=[s]);var l=s.feature||(s.feature={}),u=l.brush||(l.brush={}),c=u.type||(u.type=[]);c.push.apply(c,r),n(c),e&&!c.length&&c.push.apply(c,a)}}},function(t,e,i){function n(t){var e=["x","y"],i=["width","height"];return{point:function(e,i,n){var a=n.range,r=e[t];return o(r,a)},rect:function(n,a,r){var s=r.range,l=[n[e[t]],n[e[t]]+n[i[t]]];return l[1]<l[0]&&l.reverse(),o(l[0],s)||o(l[1],s)||o(s[0],l)||o(s[1],l)}}}function o(t,e){return e[0]<=t&&t<=e[1]}function a(t,e,i,n,o){for(var a=0,s=o[o.length-1];a<o.length;a++){var l=o[a];if(r(t,e,i,n,l[0],l[1],s[0],s[1]))return!0;s=l}}function r(t,e,i,n,o,a,r,u){var c=l(i-t,o-r,n-e,a-u);if(s(c))return!1;var h=l(o-t,o-r,a-e,a-u)/c;if(h<0||h>1)return!1;var d=l(i-t,o-t,n-e,a-e)/c;return!(d<0||d>1)}function s(t){return t<=1e-6&&t>=-1e-6}function l(t,e,i,n){return t*n-e*i}var u=i(267).contain,c=i(11),h={lineX:n(0),lineY:n(1),rect:{point:function(t,e,i){return i.boundingRect.contain(t[0],t[1])},rect:function(t,e,i){return i.boundingRect.intersect(t)}},polygon:{point:function(t,e,i){return i.boundingRect.contain(t[0],t[1])&&u(i.range,t[0],t[1])},rect:function(t,e,i){var n=i.range;if(n.length<=1)return!1;var o=t.x,r=t.y,s=t.width,l=t.height,h=n[0];return!!(u(n,o,r)||u(n,o+s,r)||u(n,o,r+l)||u(n,o+s,r+l)||c.create(t).contain(h[0],h[1])||a(o,r,o+s,r,n)||a(o,r,o,r+l,n)||a(o+s,r,o+s,r+l,n)||a(o,r+l,o+s,r+l,n))||void 0}}};t.exports=h},function(t,e,i){function n(t,e,i,n,a){if(a){var r=t.getZr();if(!r[x]){r[y]||(r[y]=o);var s=g.createOrUpdate(r,y,i,e);s(t,n)}}}function o(t,e){if(!t.isDisposed()){var i=t.getZr();i[x]=!0,t.dispatchAction({type:"brushSelect",batch:e}),i[x]=!1}}function a(t,e,i,n){for(var o=0,a=e.length;o<a;o++){var r=e[o];if(t[r.brushType](n,i,r.selectors,r))return!0}}function r(t){var e=t.brushSelector;if(d.isString(e)){var i=[];return d.each(p,function(t,n){i[n]=function(i,n,o,a){var r=n.getItemLayout(i);return t[e](r,o,a)}}),i}if(d.isFunction(e)){var n={};return d.each(p,function(t,i){n[i]=e}),n}return e}function s(t,e){var i=t.option.seriesIndex;return null!=i&&"all"!==i&&(d.isArray(i)?d.indexOf(i,e)<0:e!==i)}function l(t){var e=t.selectors={};return d.each(p[t.brushType],function(i,n){e[n]=function(n){return i(n,e,t)}}),t}function u(t){return new f(t[0][0],t[1][0],t[0][1]-t[0][0],t[1][1]-t[1][0])}var c=i(2),h=i(187),d=i(1),f=i(11),p=i(366),g=i(37),m=i(184),v=["inBrush","outOfBrush"],y="__ecBrushSelect",x="__ecInBrushSelectEvent",_=c.PRIORITY.VISUAL.BRUSH;c.registerLayout(_,function(t,e,i){t.eachComponent({mainType:"brush"},function(e){i&&"takeGlobalCursor"===i.type&&e.setBrushOption("brush"===i.key?i.brushOption:{brushType:!1});var n=e.brushTargetManager=new m(e.option,t);n.setInputRanges(e.areas,t)})}),c.registerVisual(_,function(t,e,i){var o,u,c=[];t.eachComponent({mainType:"brush"},function(e,i){function n(t){return"all"===x||_[t]}function f(t){return!!t.length}function p(t,e){var i=t.coordinateSystem;M|=i.hasAxisBrushed(),n(e)&&i.eachActiveState(t.getData(),function(t,e){"active"===t&&(w[e]=1)})}function g(i,o,l){var u=r(i);if(u&&!s(e,o)&&(d.each(I,function(n){u[n.brushType]&&e.brushTargetManager.controlSeries(n,i,t)&&l.push(n),M|=f(l)}),n(o)&&f(l))){var c=i.getData();c.each(function(t){a(u,l,c,t)&&(w[t]=1)})}}var m={brushId:e.id,brushIndex:i,brushName:e.name,areas:d.clone(e.areas),selected:[]};c.push(m);var y=e.option,x=y.brushLink,_=[],w=[],S=[],M=0;i||(o=y.throttleType,u=y.throttleDelay);var I=d.map(e.areas,function(t){return l(d.defaults({boundingRect:b[t.brushType](t)},t))}),T=h.createVisualMappings(e.option,v,function(t){t.mappingMethod="fixed"});d.isArray(x)&&d.each(x,function(t){_[t]=1}),t.eachSeries(function(t,e){var i=S[e]=[];"parallel"===t.subType?p(t,e,i):g(t,e,i)}),t.eachSeries(function(t,e){var i={seriesId:t.id,seriesIndex:e,seriesName:t.name,dataIndex:[]};m.selected.push(i);var o=r(t),s=S[e],l=t.getData(),u=n(e)?function(t){return w[t]?(i.dataIndex.push(l.getRawIndex(t)),"inBrush"):"outOfBrush"}:function(t){return a(o,s,l,t)?(i.dataIndex.push(l.getRawIndex(t)),"inBrush"):"outOfBrush"};(n(e)?M:f(s))&&h.applyVisual(v,T,l,u)})}),n(e,o,u,c,i)});var b={lineX:d.noop,lineY:d.noop,rect:function(t){return u(t.range)},polygon:function(t){for(var e,i=t.range,n=0,o=i.length;n<o;n++){e=e||[[1/0,-(1/0)],[1/0,-(1/0)]];var a=i[n];a[0]<e[0][0]&&(e[0][0]=a[0]),a[0]>e[0][1]&&(e[0][1]=a[0]),a[1]<e[1][0]&&(e[1][0]=a[1]),a[1]>e[1][1]&&(e[1][1]=a[1])}return e&&u(e)}}},function(t,e,i){"use strict";i(394),i(395),i(369)},function(t,e,i){"use strict";var n=i(1),o=i(3),a=i(7),r=i(4),s={EN:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],CN:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},l={EN:["S","M","T","W","T","F","S"],CN:["日","一","二","三","四","五","六"]};t.exports=i(2).extendComponentView({type:"calendar",_tlpoints:null,_blpoints:null,_firstDayOfMonth:null,_firstDayPoints:null,render:function(t,e,i){var n=this.group;n.removeAll();var o=t.coordinateSystem,a=o.getRangeInfo(),r=o.getOrient();this._renderDayRect(t,a,n),this._renderLines(t,a,r,n),this._renderYearText(t,a,r,n),this._renderMonthText(t,r,n),this._renderWeekText(t,a,r,n)},_renderDayRect:function(t,e,i){for(var n=t.coordinateSystem,a=t.getModel("itemStyle.normal").getItemStyle(),r=n.getCellWidth(),s=n.getCellHeight(),l=e.start.time;l<=e.end.time;l=n.getNextNDay(l,1).time){var u=n.dataToRect([l],!1).tl,c=new o.Rect({shape:{x:u[0],y:u[1],width:r,height:s},cursor:"default",style:a});i.add(c)}},_renderLines:function(t,e,i,n){function o(e){a._firstDayOfMonth.push(r.getDateInfo(e)),a._firstDayPoints.push(r.dataToRect([e],!1).tl);var o=a._getLinePointsOfOneWeek(t,e,i);a._tlpoints.push(o[0]),a._blpoints.push(o[o.length-1]),l&&a._drawSplitline(o,s,n)}var a=this,r=t.coordinateSystem,s=t.getModel("splitLine.lineStyle").getLineStyle(),l=t.get("splitLine.show"),u=s.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var c=e.start,h=0;c.time<=e.end.time;h++){o(c.formatedDate),0===h&&(c=r.getDateInfo(e.start.y+"-"+e.start.m));var d=c.date;d.setMonth(d.getMonth()+1),c=r.getDateInfo(d)}o(r.getNextNDay(e.end.time,1).formatedDate),l&&this._drawSplitline(a._getEdgesPoints(a._tlpoints,u,i),s,n),l&&this._drawSplitline(a._getEdgesPoints(a._blpoints,u,i),s,n)},_getEdgesPoints:function(t,e,i){var n=[t[0].slice(),t[t.length-1].slice()],o="horizontal"===i?0:1;return n[0][o]=n[0][o]-e/2,n[1][o]=n[1][o]+e/2,n},_drawSplitline:function(t,e,i){var n=new o.Polyline({z2:20,shape:{points:t},style:e});i.add(n)},_getLinePointsOfOneWeek:function(t,e,i){var n=t.coordinateSystem;e=n.getDateInfo(e);for(var o=[],a=0;a<7;a++){var r=n.getNextNDay(e.time,a),s=n.dataToRect([r.time],!1);o[2*r.day]=s.tl,o[2*r.day+1]=s["horizontal"===i?"bl":"tr"]}return o},_formatterLabel:function(t,e){return"string"==typeof t&&t?a.formatTplSimple(t,e):"function"==typeof t?t(e):e.nameMap},_yearTextPositionControl:function(t,e,i,n){t=t.slice();var o=["center","bottom"];"top"===i&&(t[1]-=n),"bottom"===i&&(t[1]+=n,o=["center","top"]),"left"===i&&(t[0]-=n),"right"===i&&(t[0]+=n,o=["center","top"]);var a=0;return"left"!==i&&"right"!==i||(a=Math.PI/2),{rotation:a,origin:t,style:{x:t[0],y:t[1],textAlign:o[0],textVerticalAlign:o[1]}}},_renderYearText:function(t,e,i,a){var r=t.getModel("yearLabel");if(r.get("show")){var s=t.getModel("yearLabel.textStyle"),l=r.get("margin"),u=r.get("position");u||(u="horizontal"!==i?"top":"left");var c=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],h=(c[0][0]+c[1][0])/2,d=(c[0][1]+c[1][1])/2,f="horizontal"===i?0:1,p={top:[h,c[f][1]],bottom:[h,c[1-f][1]],left:[c[1-f][0],d],right:[c[f][0],d]},g=e.start.y;+e.end.y>+e.start.y&&(g=g+"-"+e.end.y);var m=r.get("formatter"),v={start:e.start.y,end:e.end.y,nameMap:g},y=this._formatterLabel(m,v),x=new o.Text(n.merge({z2:30,style:{text:y,font:s.getFont(),fill:s.getTextColor()}},this._yearTextPositionControl(p[u],i,u,l)));a.add(x)}},_monthTextPositionControl:function(t,e,i,n,o){var a="left",r="top",s=t[0],l=t[1];return"horizontal"===i?(l+=o,e&&(a="center"),"start"===n&&(r="bottom")):(s+=o,e&&(r="middle"),"start"===n&&(a="right")),{x:s,y:l,textAlign:a,textVerticalAlign:r}},_renderMonthText:function(t,e,i){var a=t.getModel("monthLabel");if(a.get("show")){var r=t.getModel("monthLabel.textStyle"),l=a.get("nameMap"),u=a.get("margin"),c=a.get("position"),h=a.get("align"),d=[this._tlpoints,this._blpoints];n.isString(l)&&(l=s[l.toUpperCase()]||[]);var f="start"===c?0:1,p="horizontal"===e?0:1;u="start"===c?-u:u;for(var g="center"===h,m=0;m<d[f].length-1;m++){var v=d[f][m].slice(),y=this._firstDayOfMonth[m];if(g){var x=this._firstDayPoints[m];v[p]=(x[p]+d[0][m+1][p])/2}var _=a.get("formatter"),b=l[+y.m-1],w={yyyy:y.y,yy:(y.y+"").slice(2),MM:y.m,M:+y.m,nameMap:b},S=this._formatterLabel(_,w),M=new o.Text({z2:30,style:n.extend({text:S,font:r.getFont(),fill:r.getTextColor()},this._monthTextPositionControl(v,g,e,c,u))});i.add(M)}}},_weekTextPositionControl:function(t,e,i,n,o){var a="center",r="middle",s=t[0],l=t[1],u="start"===i;return"horizontal"===e?(s=s+n+(u?1:-1)*o[0]/2,a=u?"right":"left"):(l=l+n+(u?1:-1)*o[1]/2,r=u?"bottom":"top"),{x:s,y:l,textAlign:a,textVerticalAlign:r}},_renderWeekText:function(t,e,i,a){var s=t.getModel("dayLabel");if(s.get("show")){var u=t.coordinateSystem,c=t.getModel("dayLabel.textStyle"),h=s.get("position"),d=s.get("nameMap"),f=s.get("margin"),p=u.getFirstDayOfWeek();n.isString(d)&&(d=l[d.toUpperCase()]||[]);var g=u.getNextNDay(e.end.time,7-e.lweek).time,m=[u.getCellWidth(),u.getCellHeight()];f=r.parsePercent(f,m["horizontal"===i?0:1]),"start"===h&&(g=u.getNextNDay(e.start.time,-(7+e.fweek)).time,f=-f);for(var v=0;v<7;v++){var y=u.getNextNDay(g,v),x=u.dataToRect([y.time],!1).center,_=v;_=Math.abs((v+p)%7);var b=new o.Text({z2:30,style:n.extend({text:d[_],font:c.getFont(),fill:c.getTextColor()},this._weekTextPositionControl(x,i,h,f,m))});a.add(b)}}}})},function(t,e,i){function n(t,e){e.update="updateView",o.registerAction(e,function(e,i){var n={};return i.eachComponent({mainType:"geo",query:e},function(i){i[t](e.name);var o=i.coordinateSystem;a.each(o.regions,function(t){n[t.name]=i.isSelected(t.name)||!1})}),{selected:n,name:e.name}})}i(399),i(186),i(371),i(241);var o=i(2),a=i(1);n("toggleSelected",{type:"geoToggleSelect",event:"geoselectchanged"}),n("select",{type:"geoSelect",event:"geoselected"}),n("unSelect",{type:"geoUnSelect",event:"geounselected"})},function(t,e,i){"use strict";var n=i(250);t.exports=i(2).extendComponentView({type:"geo",init:function(t,e){var i=new n(e,!0);this._mapDraw=i,this.group.add(i.group)},render:function(t,e,i,n){if(!n||"geoToggleSelect"!==n.type||n.from!==this.uid){var o=this._mapDraw;t.get("show")?o.draw(t,e,i,this,n):this._mapDraw.group.removeAll(),this.group.silent=t.get("silent")}},dispose:function(){this._mapDraw&&this._mapDraw.remove()}})},function(t,e,i){i(263),i(358),i(355)},function(t,e,i){"use strict";var n=i(1);i(237),i(353),i(376),i(55),i(359),i(2).registerLayout(n.curry(i(426),"bar")),i(2).extendComponentView({type:"polar"})},function(t,e,i){i(417),i(418),i(375)},function(t,e,i){var n=i(40),o=i(1),a=i(3),r=["axisLine","axisLabel","axisTick","axisName"];t.exports=i(2).extendComponentView({type:"radar",render:function(t,e,i){var n=this.group;n.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},_buildAxes:function(t){var e=t.coordinateSystem,i=e.getIndicatorAxes(),a=o.map(i,function(t){var i=new n(t.model,{position:[e.cx,e.cy],rotation:t.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return i});o.each(a,function(t){o.each(r,t.add,t),this.group.add(t.getGroup())},this)},_buildSplitLineAndArea:function(t){function e(t,e,i){var n=i%e.length;return t[n]=t[n]||[],n}var i=t.coordinateSystem,n=i.getIndicatorAxes();if(n.length){var r=t.get("shape"),s=t.getModel("splitLine"),l=t.getModel("splitArea"),u=s.getModel("lineStyle"),c=l.getModel("areaStyle"),h=s.get("show"),d=l.get("show"),f=u.get("color"),p=c.get("color");f=o.isArray(f)?f:[f],p=o.isArray(p)?p:[p];var g=[],m=[];if("circle"===r)for(var v=n[0].getTicksCoords(),y=i.cx,x=i.cy,_=0;_<v.length;_++){if(h){var b=e(g,f,_);g[b].push(new a.Circle({shape:{cx:y,cy:x,r:v[_]}}))}if(d&&_<v.length-1){var b=e(m,p,_);m[b].push(new a.Ring({shape:{cx:y,cy:x,r0:v[_],r:v[_+1]}}))}}else for(var w,S=o.map(n,function(t,e){var n=t.getTicksCoords();return w=null==w?n.length-1:Math.min(n.length-1,w),o.map(n,function(t){return i.coordToPoint(t,e)})}),M=[],_=0;_<=w;_++){for(var I=[],T=0;T<n.length;T++)I.push(S[T][_]);if(I[0]&&I.push(I[0].slice()),h){var b=e(g,f,_);g[b].push(new a.Polyline({shape:{points:I}}))}if(d&&M){var b=e(m,p,_-1);m[b].push(new a.Polygon({shape:{points:I.concat(M)}}))}M=I.slice().reverse()}var A=u.getLineStyle(),C=c.getAreaStyle();o.each(m,function(t,e){this.group.add(a.mergePath(t,{style:o.defaults({stroke:"none",fill:p[e%p.length]},C),silent:!0}))},this),o.each(g,function(t,e){this.group.add(a.mergePath(t,{style:o.defaults({fill:"none",stroke:f[e%f.length]},A),silent:!0}))},this)}}})},function(t,e,i){i(237),i(356)},function(t,e,i){var n=i(2);n.registerPreprocessor(i(383)),i(385),i(384),i(378),i(379)},function(t,e,i){var n=i(381),o=i(1),a=i(5),r=n.extend({type:"timeline.slider",defaultOption:{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"emptyCircle",symbolSize:10,lineStyle:{show:!0,width:2,color:"#304654"},label:{position:"auto",normal:{show:!0,interval:"auto",rotate:0,textStyle:{color:"#304654"}},emphasis:{show:!0,textStyle:{color:"#c23531"}}},itemStyle:{normal:{color:"#304654",borderWidth:1},emphasis:{color:"#c23531"}},checkpointStyle:{symbol:"circle",symbolSize:13,color:"#c23531",borderWidth:5,borderColor:"rgba(194,53,49, 0.5)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:22,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"path://M18.6,50.8l22.5-22.5c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3-0.1-0.5-0.3-0.7L18.7,4.4c-0.1-0.1-0.2-0.3-0.2-0.5 c0-0.4,0.3-0.8,0.8-0.8c0.2,0,0.5,0.1,0.6,0.3l23.5,23.5l0,0c0.2,0.2,0.3,0.4,0.3,0.7c0,0.3-0.1,0.5-0.3,0.7l-0.1,0.1L19.7,52 c-0.1,0.1-0.3,0.2-0.5,0.2c-0.4,0-0.8-0.3-0.8-0.8C18.4,51.2,18.5,51,18.6,50.8z",prevIcon:"path://M43,52.8L20.4,30.3c-0.2-0.2-0.3-0.4-0.3-0.7c0-0.3,0.1-0.5,0.3-0.7L42.9,6.4c0.1-0.1,0.2-0.3,0.2-0.5 c0-0.4-0.3-0.8-0.8-0.8c-0.2,0-0.5,0.1-0.6,0.3L18.3,28.8l0,0c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.3,0.1,0.5,0.3,0.7l0.1,0.1L41.9,54 c0.1,0.1,0.3,0.2,0.5,0.2c0.4,0,0.8-0.3,0.8-0.8C43.2,53.2,43.1,53,43,52.8z",normal:{color:"#304654",borderColor:"#304654",borderWidth:1},emphasis:{color:"#c23531",borderColor:"#c23531",borderWidth:2}},data:[]}});o.mixin(r,a.dataFormatMixin),t.exports=r},function(t,e,i){function n(t,e){return u.getLayoutRect(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()},t.get("padding"))}function o(t,e,i,n){var o=l.makePath(t.get(e).replace(/^path:\/\//,""),s.clone(n||{}),new p(i[0],i[1],i[2],i[3]),"center");return o}function a(t,e,i,n,o,a){var r=e.get("color");if(o)o.setColor(r),i.add(o),a&&a.onUpdate(o);else{var l=t.get("symbol");o=d.createSymbol(l,-1,-1,2,2,r),o.setStyle("strokeNoScale",!0),i.add(o),a&&a.onCreate(o)}var u=e.getItemStyle(["color","symbol","symbolSize"]);o.setStyle(u),n=s.merge({rectHover:!0,z2:100},n,!0);var c=t.get("symbolSize");c=c instanceof Array?c.slice():[+c,+c],c[0]/=2,c[1]/=2,n.scale=c;var h=t.get("symbolOffset");if(h){var f=n.position=n.position||[0,0];f[0]+=m.parsePercent(h[0],c[0]),f[1]+=m.parsePercent(h[1],c[1])}var p=t.get("symbolRotate");return n.rotation=(p||0)*Math.PI/180||0,o.attr(n),o.updateTransform(),o}function r(t,e,i,n,o){if(!t.dragging){var a=n.getModel("checkpointStyle"),r=i.dataToCoord(n.getData().get(["value"],e));o||!a.get("animation",!0)?t.attr({position:[r,0]}):(t.stopAnimation(!0),t.animateTo({position:[r,0]},a.get("animationDuration",!0),a.get("animationEasing",!0)))}}var s=i(1),l=i(3),u=i(12),c=i(382),h=i(380),d=i(24),f=i(18),p=i(11),g=i(19),m=i(4),v=i(7),y=v.encodeHTML,x=s.bind,_=s.each,b=Math.PI;t.exports=c.extend({type:"timeline.slider",init:function(t,e){this.api=e,this._axis,this._viewRect,this._timer,this._currentPointer,this._mainGroup,this._labelGroup},render:function(t,e,i,n){if(this.model=t,this.api=i,this.ecModel=e,this.group.removeAll(),t.get("show",!0)){var o=this._layout(t,i),a=this._createGroup("mainGroup"),r=this._createGroup("labelGroup"),s=this._axis=this._createAxis(o,t);t.formatTooltip=function(t){return y(s.scale.getLabel(t))},_(["AxisLine","AxisTick","Control","CurrentPointer"],function(e){this["_render"+e](o,a,s,t)},this),this._renderAxisLabel(o,r,s,t),this._position(o,t)}this._doPlayStop()},remove:function(){this._clearTimer(),this.group.removeAll()},dispose:function(){this._clearTimer()},_layout:function(t,e){var i=t.get("label.normal.position"),o=t.get("orient"),a=n(t,e);null==i||"auto"===i?i="horizontal"===o?a.y+a.height/2<e.getHeight()/2?"-":"+":a.x+a.width/2<e.getWidth()/2?"+":"-":isNaN(i)&&(i={horizontal:{top:"-",bottom:"+"},vertical:{left:"-",right:"+"}}[o][i]);var r={horizontal:"center",vertical:i>=0||"+"===i?"left":"right"},s={horizontal:i>=0||"+"===i?"top":"bottom",vertical:"middle"},l={horizontal:0,vertical:b/2},u="vertical"===o?a.height:a.width,c=t.getModel("controlStyle"),h=c.get("show"),d=h?c.get("itemSize"):0,f=h?c.get("itemGap"):0,p=d+f,g=t.get("label.normal.rotate")||0;g=g*b/180;var m,v,y,x,_=c.get("position",!0),h=c.get("show",!0),w=h&&c.get("showPlayBtn",!0),S=h&&c.get("showPrevBtn",!0),M=h&&c.get("showNextBtn",!0),I=0,T=u;return"left"===_||"bottom"===_?(w&&(m=[0,0],I+=p),S&&(v=[I,0],I+=p),M&&(y=[T-d,0],T-=p)):(w&&(m=[T-d,0],T-=p),S&&(v=[0,0],I+=p),M&&(y=[T-d,0],T-=p)),x=[I,T],t.get("inverse")&&x.reverse(),{viewRect:a,mainLength:u,orient:o,rotation:l[o],labelRotation:g,labelPosOpt:i,labelAlign:t.get("label.normal.textStyle.align")||r[o],labelBaseline:t.get("label.normal.textStyle.baseline")||s[o],playPosition:m,prevBtnPosition:v,nextBtnPosition:y,axisExtent:x,controlSize:d,controlGap:f}},_position:function(t,e){function i(t){var e=t.position;t.origin=[h[0][0]-e[0],h[1][0]-e[1]]}function n(t){return[[t.x,t.x+t.width],[t.y,t.y+t.height]]}function o(t,e,i,n,o){t[n]+=i[n][o]-e[n][o]}var a=this._mainGroup,r=this._labelGroup,s=t.viewRect;if("vertical"===t.orient){var l=g.create(),u=s.x,c=s.y+s.height;g.translate(l,l,[-u,-c]),g.rotate(l,l,-b/2),g.translate(l,l,[u,c]),s=s.clone(),s.applyTransform(l)}var h=n(s),d=n(a.getBoundingRect()),f=n(r.getBoundingRect()),p=a.position,m=r.position;m[0]=p[0]=h[0][0];var v=t.labelPosOpt;if(isNaN(v)){var y="+"===v?0:1;o(p,d,h,1,y),o(m,f,h,1,1-y)}else{var y=v>=0?0:1;o(p,d,h,1,y),m[1]=p[1]+v}a.attr("position",p),r.attr("position",m),a.rotation=r.rotation=t.rotation,i(a),i(r)},_createAxis:function(t,e){var i=e.getData(),n=e.get("axisType"),o=f.createScaleByModel(e,n),a=i.getDataExtent("value");o.setExtent(a[0],a[1]),this._customizeScale(o,i),o.niceTicks();var r=new h("value",o,t.axisExtent,n);return r.model=e,r},_customizeScale:function(t,e){t.getTicks=function(){return e.mapArray(["value"],function(t){return t})},t.getTicksLabels=function(){return s.map(this.getTicks(),t.getLabel,t)}},_createGroup:function(t){var e=this["_"+t]=new l.Group;return this.group.add(e),e},_renderAxisLine:function(t,e,i,n){var o=i.getExtent();n.get("lineStyle.show")&&e.add(new l.Line({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:s.extend({lineCap:"round"},n.getModel("lineStyle").getLineStyle()),silent:!0,z2:1}))},_renderAxisTick:function(t,e,i,n){var o=n.getData(),r=i.scale.getTicks();_(r,function(t,r){var s=i.dataToCoord(t),u=o.getItemModel(r),c=u.getModel("itemStyle.normal"),h=u.getModel("itemStyle.emphasis"),d={position:[s,0],onclick:x(this._changeTimeline,this,r)},f=a(u,c,e,d);l.setHoverStyle(f,h.getItemStyle()),u.get("tooltip")?(f.dataIndex=r,f.dataModel=n):f.dataIndex=f.dataModel=null},this)},_renderAxisLabel:function(t,e,i,n){var o=n.getModel("label.normal");if(o.get("show")){var a=n.getData(),r=i.scale.getTicks(),s=f.getFormattedLabels(i,o.get("formatter")),u=i.getLabelInterval();_(r,function(n,o){if(!i.isLabelIgnored(o,u)){var r=a.getItemModel(o),c=r.getModel("label.normal.textStyle"),h=r.getModel("label.emphasis.textStyle"),d=i.dataToCoord(n),f=new l.Text({style:{text:s[o],textAlign:t.labelAlign,textVerticalAlign:t.labelBaseline,textFont:c.getFont(),fill:c.getTextColor()},position:[d,0],rotation:t.labelRotation-t.rotation,onclick:x(this._changeTimeline,this,o),silent:!1});e.add(f),l.setHoverStyle(f,h.getItemStyle())}},this)}},_renderControl:function(t,e,i,n){function a(t,i,a,d){if(t){var f={position:t,origin:[r/2,0],rotation:d?-s:0,rectHover:!0,style:u,onclick:a},p=o(n,i,h,f);e.add(p),l.setHoverStyle(p,c)}}var r=t.controlSize,s=t.rotation,u=n.getModel("controlStyle.normal").getItemStyle(),c=n.getModel("controlStyle.emphasis").getItemStyle(),h=[0,-r/2,r,r],d=n.getPlayState(),f=n.get("inverse",!0);a(t.nextBtnPosition,"controlStyle.nextIcon",x(this._changeTimeline,this,f?"-":"+")),a(t.prevBtnPosition,"controlStyle.prevIcon",x(this._changeTimeline,this,f?"+":"-")),a(t.playPosition,"controlStyle."+(d?"stopIcon":"playIcon"),x(this._handlePlayClick,this,!d),!0)},_renderCurrentPointer:function(t,e,i,n){var o=n.getData(),s=n.getCurrentIndex(),l=o.getItemModel(s).getModel("checkpointStyle"),u=this,c={onCreate:function(t){t.draggable=!0,t.drift=x(u._handlePointerDrag,u),t.ondragend=x(u._handlePointerDragend,u),r(t,s,i,n,!0)},onUpdate:function(t){r(t,s,i,n)}};this._currentPointer=a(l,l,this._mainGroup,{},this._currentPointer,c)},_handlePlayClick:function(t){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:t,from:this.uid})},_handlePointerDrag:function(t,e,i){this._clearTimer(),this._pointerChangeTimeline([i.offsetX,i.offsetY])},_handlePointerDragend:function(t){this._pointerChangeTimeline([t.offsetX,t.offsetY],!0)},_pointerChangeTimeline:function(t,e){var i=this._toAxisCoord(t)[0],n=this._axis,o=m.asc(n.getExtent().slice());i>o[1]&&(i=o[1]),i<o[0]&&(i=o[0]),this._currentPointer.position[0]=i,this._currentPointer.dirty();var a=this._findNearestTick(i),r=this.model;(e||a!==r.getCurrentIndex()&&r.get("realtime"))&&this._changeTimeline(a)},_doPlayStop:function(){function t(){var t=this.model;this._changeTimeline(t.getCurrentIndex()+(t.get("rewind",!0)?-1:1))}this._clearTimer(),this.model.getPlayState()&&(this._timer=setTimeout(x(t,this),this.model.get("playInterval")))},_toAxisCoord:function(t){var e=this._mainGroup.getLocalTransform();return l.applyTransform(t,e,!0)},_findNearestTick:function(t){var e,i=this.model.getData(),n=1/0,o=this._axis;return i.each(["value"],function(i,a){var r=o.dataToCoord(i),s=Math.abs(r-t);s<n&&(n=s,e=a)}),e},_clearTimer:function(){this._timer&&(clearTimeout(this._timer),this._timer=null)},_changeTimeline:function(t){var e=this.model.getCurrentIndex();"+"===t?t=e+1:"-"===t&&(t=e-1),this.api.dispatchAction({type:"timelineChange",currentIndex:t,from:this.uid})}})},function(t,e,i){var n=i(1),o=i(33),a=i(18),r=function(t,e,i,n){o.call(this,t,e,i),this.type=n||"value",this._autoLabelInterval,this.model=null};r.prototype={constructor:r,getLabelInterval:function(){var t=this.model,e=t.getModel("label.normal"),i=e.get("interval");if(null!=i&&"auto"!=i)return i;var i=this._autoLabelInterval;return i||(i=this._autoLabelInterval=a.getAxisLabelInterval(n.map(this.scale.getTicks(),this.dataToCoord,this),a.getFormattedLabels(this,e.get("formatter")),e.getModel("textStyle").getFont(),"horizontal"===t.get("orient"))),i},isLabelIgnored:function(t){if("category"===this.type){var e=this.getLabelInterval();return"function"==typeof e&&!e(t,this.scale.getLabel(t))||t%(e+1)}}},n.inherits(r,o),t.exports=r},function(t,e,i){var n=i(13),o=i(14),a=i(1),r=i(5),s=n.extend({type:"timeline",layoutMode:"box",defaultOption:{zlevel:0,z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{normal:{},emphasis:{}},label:{normal:{textStyle:{color:"#000"}},emphasis:{}},data:[]},init:function(t,e,i){this._data,this._names,this.mergeDefaultAndTheme(t,i),this._initData()},mergeOption:function(t){s.superApply(this,"mergeOption",arguments),this._initData()},setCurrentIndex:function(t){null==t&&(t=this.option.currentIndex);var e=this._data.count();this.option.loop?t=(t%e+e)%e:(t>=e&&(t=e-1),t<0&&(t=0)),this.option.currentIndex=t},getCurrentIndex:function(){return this.option.currentIndex},isIndexMax:function(){return this.getCurrentIndex()>=this._data.count()-1},setPlayState:function(t){this.option.autoPlay=!!t},getPlayState:function(){return!!this.option.autoPlay},_initData:function(){var t=this.option,e=t.data||[],i=t.axisType,n=this._names=[];if("category"===i){var s=[];a.each(e,function(t,e){var i,o=r.getDataItemValue(t);a.isObject(t)?(i=a.clone(t),i.value=e):i=e,s.push(i),a.isString(o)||null!=o&&!isNaN(o)||(o=""),n.push(o+"")}),e=s}var l={category:"ordinal",time:"time"}[i]||"number",u=this._data=new o([{name:"value",type:l}],this);u.initData(e,n)},getData:function(){return this._data},getCategories:function(){if("category"===this.get("axisType"))return this._names.slice()}});t.exports=s},function(t,e,i){var n=i(65);t.exports=n.extend({type:"timeline"})},function(t,e,i){function n(t){var e=t.type,i={number:"value",time:"time"};if(i[e]&&(t.axisType=i[e],delete t.type),o(t),a(t,"controlPosition")){var n=t.controlStyle||(t.controlStyle={});a(n,"position")||(n.position=t.controlPosition),"none"!==n.position||a(n,"show")||(n.show=!1,delete n.position),delete t.controlPosition}r.each(t.data||[],function(t){r.isObject(t)&&!r.isArray(t)&&(!a(t,"value")&&a(t,"name")&&(t.value=t.name),o(t))})}function o(t){var e=t.itemStyle||(t.itemStyle={}),i=e.emphasis||(e.emphasis={}),n=t.label||t.label||{},o=n.normal||(n.normal={}),s={normal:1,emphasis:1};r.each(n,function(t,e){s[e]||a(o,e)||(o[e]=t)}),i.label&&!a(n,"emphasis")&&(n.emphasis=i.label,delete i.label)}function a(t,e){return t.hasOwnProperty(e)}var r=i(1);t.exports=function(t){var e=t&&t.timeline;r.isArray(e)||(e=e?[e]:[]),r.each(e,function(t){t&&n(t)})}},function(t,e,i){var n=i(2),o=i(1);n.registerAction({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},function(t,e){var i=e.getComponent("timeline");return i&&null!=t.currentIndex&&(i.setCurrentIndex(t.currentIndex),!i.get("loop",!0)&&i.isIndexMax()&&i.setPlayState(!1)),e.resetOption("timeline"),o.defaults({currentIndex:i.option.currentIndex},t)}),n.registerAction({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},function(t,e){var i=e.getComponent("timeline");i&&null!=t.playState&&i.setPlayState(t.playState)})},function(t,e,i){i(13).registerSubTypeDefaulter("timeline",function(){return"slider"})},function(t,e,i){"use strict";function n(t,e,i){this.model=t,this.ecModel=e,this.api=i,this._brushType,this._brushMode}var o=i(29),a=i(1);n.defaultOption={show:!0,type:["rect","polygon","lineX","lineY","keep","clear"],icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}};var r=n.prototype;r.render=r.updateView=r.updateLayout=function(t,e,i){var n,o,r;e.eachComponent({mainType:"brush"},function(t){n=t.brushType,o=t.brushOption.brushMode||"single",r|=t.areas.length}),this._brushType=n,this._brushMode=o,a.each(t.get("type",!0),function(e){t.setIconStatus(e,("keep"===e?"multiple"===o:"clear"===e?r:e===n)?"emphasis":"normal")})},r.getIcons=function(){var t=this.model,e=t.get("icon",!0),i={};return a.each(t.get("type",!0),function(t){e[t]&&(i[t]=e[t])}),i},r.onclick=function(t,e,i){var e=this.api,n=this._brushType,o=this._brushMode;"clear"===i?(e.dispatchAction({type:"axisAreaSelect",intervals:[]}),e.dispatchAction({type:"brush",command:"clear",areas:[]})):e.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===i?n:n!==i&&i,brushMode:"keep"===i?"multiple"===o?"single":"multiple":o}})},o.register("brush",n),t.exports=n},function(t,e,i){i(392),i(393)},function(t,e,i){function n(t,e,i){if(i[0]===i[1])return i.slice();for(var n=200,o=(i[1]-i[0])/n,a=i[0],r=[],s=0;s<=n&&a<i[1];s++)r.push(a),a+=o;return r.push(i[1]),r}var o=i(254),a=i(1),r=i(4),s=[20,140],l=o.extend({type:"visualMap.continuous",defaultOption:{align:"auto",calculable:!1,range:null,realtime:!0,itemHeight:null,itemWidth:null,hoverLink:!0,hoverLinkDataSize:null,hoverLinkOnHandle:!0},optionUpdated:function(t,e){l.superApply(this,"optionUpdated",arguments),this.resetTargetSeries(),this.resetExtent(),this.resetVisual(function(t){t.mappingMethod="linear",t.dataExtent=this.getExtent()}),this._resetRange()},resetItemSize:function(){l.superApply(this,"resetItemSize",arguments);var t=this.itemSize;"horizontal"===this._orient&&t.reverse(),(null==t[0]||isNaN(t[0]))&&(t[0]=s[0]),(null==t[1]||isNaN(t[1]))&&(t[1]=s[1])},_resetRange:function(){var t=this.getExtent(),e=this.option.range;!e||e.auto?(t.auto=1,this.option.range=t):a.isArray(e)&&(e[0]>e[1]&&e.reverse(),e[0]=Math.max(e[0],t[0]),e[1]=Math.min(e[1],t[1]))},completeVisualOption:function(){o.prototype.completeVisualOption.apply(this,arguments),a.each(this.stateList,function(t){var e=this.option.controller[t].symbolSize;e&&e[0]!==e[1]&&(e[0]=0)},this)},setSelected:function(t){this.option.range=t.slice(),this._resetRange()},getSelected:function(){var t=this.getExtent(),e=r.asc((this.get("range")||[]).slice());return e[0]>t[1]&&(e[0]=t[1]),e[1]>t[1]&&(e[1]=t[1]),e[0]<t[0]&&(e[0]=t[0]),e[1]<t[0]&&(e[1]=t[0]),e},getValueState:function(t){var e=this.option.range,i=this.getExtent();return(e[0]<=i[0]||e[0]<=t)&&(e[1]>=i[1]||t<=e[1])?"inRange":"outOfRange"},findTargetDataIndices:function(t){var e=[];return this.eachTargetSeries(function(i){var n=[],o=i.getData();o.each(this.getDataDimension(o),function(e,i){t[0]<=e&&e<=t[1]&&n.push(i)},!0,this),e.push({seriesId:i.id,dataIndex:n})},this),e},getVisualMeta:function(t){function e(e,i){a.push({value:e,color:t(e,i)})}for(var i=n(this,"outOfRange",this.getExtent()),o=n(this,"inRange",this.option.range.slice()),a=[],r=0,s=0,l=o.length,u=i.length;s<u&&(!o.length||i[s]<=o[0]);s++)i[s]<o[r]&&e(i[s],"outOfRange");for(var c=1;r<l;r++,c=0)c&&a.length&&e(o[r],"outOfRange"),e(o[r],"inRange");for(var c=1;s<u;s++)(!o.length||o[o.length-1]<i[s])&&(c&&(a.length&&e(a[a.length-1].value,"outOfRange"),c=0),e(i[s],"outOfRange"));var h=a.length;return{stops:a,outerColors:[h?a[0].color:"transparent",h?a[h-1].color:"transparent"]}}});t.exports=l},function(t,e,i){function n(t,e,i,n){return new u.Polygon({shape:{points:t},draggable:!!i,cursor:e,drift:i,onmousemove:function(t){m.stop(t.event)},ondragend:n})}function o(t,e){return 0===t?[[0,0],[e,0],[e,-e]]:[[0,0],[e,0],[e,e]]}function a(t,e,i,n){return t?[[0,-x(e,_(i,0))],[w,0],[0,x(e,_(n-i,0))]]:[[0,0],[5,-5],[5,5]]}function r(t,e,i){var n=b/2,o=t.get("hoverLinkDataSize");return o&&(n=v(o,e,i,!0)/2),n}function s(t){return!t.get("realtime")&&t.get("hoverLinkOnHandle")}var l=i(255),u=i(3),c=i(1),h=i(4),d=i(56),f=i(100),p=i(256),g=i(5),m=i(21),v=h.linearMap,y=c.each,x=Math.min,_=Math.max,b=12,w=6,S=l.extend({type:"visualMap.continuous",init:function(){S.superApply(this,"init",arguments),this._shapes={},this._dataInterval=[],this._handleEnds=[],this._orient,this._useHandle,this._hoverLinkDataIndices=[],this._dragging,this._hovering},doRender:function(t,e,i,n){n&&"selectDataRange"===n.type&&n.from===this.uid||this._buildView()},_buildView:function(){this.group.removeAll();var t=this.visualMapModel,e=this.group;this._orient=t.get("orient"),this._useHandle=t.get("calculable"),this._resetInterval(),this._renderBar(e);var i=t.get("text");this._renderEndsText(e,i,0),this._renderEndsText(e,i,1),this._updateView(!0),this.renderBackground(e),this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(e)},_renderEndsText:function(t,e,i){if(e){var n=e[1-i];n=null!=n?n+"":"";var o=this.visualMapModel,a=o.get("textGap"),r=o.itemSize,s=this._shapes.barGroup,l=this._applyTransform([r[0]/2,0===i?-a:r[1]+a],s),c=this._applyTransform(0===i?"bottom":"top",s),h=this._orient,d=this.visualMapModel.textStyleModel;this.group.add(new u.Text({style:{x:l[0],y:l[1],textVerticalAlign:"horizontal"===h?"middle":c,textAlign:"horizontal"===h?c:"center",text:n,textFont:d.getFont(),fill:d.getTextColor()}}))}},_renderBar:function(t){var e=this.visualMapModel,i=this._shapes,o=e.itemSize,a=this._orient,r=this._useHandle,s=p.getItemAlign(e,this.api,o),l=i.barGroup=this._createBarGroup(s);l.add(i.outOfRange=n()),l.add(i.inRange=n(null,r?"move":null,c.bind(this._dragHandle,this,"all",!1),c.bind(this._dragHandle,this,"all",!0)));var u=e.textStyleModel.getTextRect("国"),h=_(u.width,u.height);r&&(i.handleThumbs=[],i.handleLabels=[],i.handleLabelPoints=[],this._createHandle(l,0,o,h,a,s),this._createHandle(l,1,o,h,a,s)),this._createIndicator(l,o,h,a),t.add(l)},_createHandle:function(t,e,i,a,r){var s=c.bind(this._dragHandle,this,e,!1),l=c.bind(this._dragHandle,this,e,!0),h=n(o(e,a),"move",s,l);h.position[0]=i[0],t.add(h);var d=this.visualMapModel.textStyleModel,f=new u.Text({draggable:!0,drift:s,onmousemove:function(t){m.stop(t.event)},ondragend:l,style:{x:0,y:0,text:"",textFont:d.getFont(),fill:d.getTextColor()}});this.group.add(f);var p=["horizontal"===r?a/2:1.5*a,"horizontal"===r?0===e?-(1.5*a):1.5*a:0===e?-a/2:a/2],g=this._shapes;g.handleThumbs[e]=h,g.handleLabelPoints[e]=p,g.handleLabels[e]=f},_createIndicator:function(t,e,i,o){var a=n([[0,0]],"move");a.position[0]=e[0],a.attr({invisible:!0,silent:!0}),t.add(a);var r=this.visualMapModel.textStyleModel,s=new u.Text({silent:!0,invisible:!0,style:{x:0,y:0,text:"",textFont:r.getFont(),fill:r.getTextColor()}});this.group.add(s);var l=["horizontal"===o?i/2:w+3,0],c=this._shapes;c.indicator=a,c.indicatorLabel=s,c.indicatorLabelPoint=l},_dragHandle:function(t,e,i,n){if(this._useHandle){if(this._dragging=!e,!e){var o=this._applyTransform([i,n],this._shapes.barGroup,!0);this._updateInterval(t,o[1]),this._updateView()}e===!this.visualMapModel.get("realtime")&&this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:this._dataInterval.slice()}),e?!this._hovering&&this._clearHoverLinkToSeries():s(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[t],!1)}},_resetInterval:function(){var t=this.visualMapModel,e=this._dataInterval=t.getSelected(),i=t.getExtent(),n=[0,t.itemSize[1]];this._handleEnds=[v(e[0],i,n,!0),v(e[1],i,n,!0)]},_updateInterval:function(t,e){e=e||0;var i=this.visualMapModel,n=this._handleEnds,o=[0,i.itemSize[1]];d(e,n,o,t,0);var a=i.getExtent();this._dataInterval=[v(n[0],o,a,!0),v(n[1],o,a,!0)]},_updateView:function(t){var e=this.visualMapModel,i=e.getExtent(),n=this._shapes,o=[0,e.itemSize[1]],a=t?o:this._handleEnds,r=this._createBarVisual(this._dataInterval,i,a,"inRange"),s=this._createBarVisual(i,i,o,"outOfRange");n.inRange.setStyle({fill:r.barColor,opacity:r.opacity}).setShape("points",r.barPoints),n.outOfRange.setStyle({fill:s.barColor,opacity:s.opacity}).setShape("points",s.barPoints),this._updateHandle(a,r)},_createBarVisual:function(t,e,i,n){var o={forceState:n,convertOpacityToAlpha:!0},a=this._makeColorGradient(t,o),r=[this.getControllerVisual(t[0],"symbolSize",o),this.getControllerVisual(t[1],"symbolSize",o)],s=this._createBarPoints(i,r);return{barColor:new f(0,0,0,1,a),barPoints:s,handlesColor:[a[0].color,a[a.length-1].color]}},_makeColorGradient:function(t,e){var i=100,n=[],o=(t[1]-t[0])/i;n.push({color:this.getControllerVisual(t[0],"color",e),offset:0});for(var a=1;a<i;a++){var r=t[0]+o*a;if(r>t[1])break;n.push({color:this.getControllerVisual(r,"color",e),offset:a/i})}return n.push({color:this.getControllerVisual(t[1],"color",e),offset:1}),n},_createBarPoints:function(t,e){var i=this.visualMapModel.itemSize;return[[i[0]-e[0],t[0]],[i[0],t[0]],[i[0],t[1]],[i[0]-e[1],t[1]]]},_createBarGroup:function(t){var e=this._orient,i=this.visualMapModel.get("inverse");return new u.Group("horizontal"!==e||i?"horizontal"===e&&i?{scale:"bottom"===t?[-1,1]:[1,1],rotation:-Math.PI/2}:"vertical"!==e||i?{scale:"left"===t?[1,1]:[-1,1]}:{scale:"left"===t?[1,-1]:[-1,-1]}:{scale:"bottom"===t?[1,1]:[-1,1],rotation:Math.PI/2})},_updateHandle:function(t,e){if(this._useHandle){var i=this._shapes,n=this.visualMapModel,o=i.handleThumbs,a=i.handleLabels;y([0,1],function(r){var s=o[r];s.setStyle("fill",e.handlesColor[r]),s.position[1]=t[r];var l=u.applyTransform(i.handleLabelPoints[r],u.getTransform(s,this.group));a[r].setStyle({x:l[0],y:l[1],text:n.formatValueText(this._dataInterval[r]),textVerticalAlign:"middle",textAlign:this._applyTransform("horizontal"===this._orient?0===r?"bottom":"top":"left",i.barGroup)})},this)}},_showIndicator:function(t,e,i,n){var o=this.visualMapModel,r=o.getExtent(),s=o.itemSize,l=[0,s[1]],c=v(t,r,l,!0),h=this._shapes,d=h.indicator;if(d){d.position[1]=c,d.attr("invisible",!1),d.setShape("points",a(!!i,n,c,s[1]));var f={convertOpacityToAlpha:!0},p=this.getControllerVisual(t,"color",f);d.setStyle("fill",p);var g=u.applyTransform(h.indicatorLabelPoint,u.getTransform(d,this.group)),m=h.indicatorLabel;m.attr("invisible",!1);var y=this._applyTransform("left",h.barGroup),x=this._orient;m.setStyle({text:(i?i:"")+o.formatValueText(e),textVerticalAlign:"horizontal"===x?y:"middle",textAlign:"horizontal"===x?"center":y,x:g[0],y:g[1]})}},_enableHoverLinkToSeries:function(){var t=this;this._shapes.barGroup.on("mousemove",function(e){if(t._hovering=!0,!t._dragging){var i=t.visualMapModel.itemSize,n=t._applyTransform([e.offsetX,e.offsetY],t._shapes.barGroup,!0,!0);n[1]=x(_(0,n[1]),i[1]),t._doHoverLinkToSeries(n[1],0<=n[0]&&n[0]<=i[0])}}).on("mouseout",function(){t._hovering=!1,!t._dragging&&t._clearHoverLinkToSeries()})},_enableHoverLinkFromSeries:function(){var t=this.api.getZr();this.visualMapModel.option.hoverLink?(t.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),t.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},_doHoverLinkToSeries:function(t,e){var i=this.visualMapModel,n=i.itemSize;if(i.option.hoverLink){var o=[0,n[1]],a=i.getExtent();t=x(_(o[0],t),o[1]);var l=r(i,a,o),u=[t-l,t+l],c=v(t,o,a,!0),h=[v(u[0],o,a,!0),v(u[1],o,a,!0)];u[0]<o[0]&&(h[0]=-(1/0)),u[1]>o[1]&&(h[1]=1/0),e&&(h[0]===-(1/0)?this._showIndicator(c,h[1],"< ",l):h[1]===1/0?this._showIndicator(c,h[0],"> ",l):this._showIndicator(c,c,"≈ ",l));var d=this._hoverLinkDataIndices,f=[];(e||s(i))&&(f=this._hoverLinkDataIndices=i.findTargetDataIndices(h));var m=g.compressBatches(d,f);this._dispatchHighDown("downplay",p.convertDataIndex(m[0])),this._dispatchHighDown("highlight",p.convertDataIndex(m[1]))}},_hoverLinkFromSeriesMouseOver:function(t){var e=t.target,i=this.visualMapModel;if(e&&null!=e.dataIndex){var n=this.ecModel.getSeriesByIndex(e.seriesIndex);if(i.isTargetSeries(n)){var o=n.getData(e.dataType),a=o.getDimension(i.getDataDimension(o)),r=o.get(a,e.dataIndex,!0);isNaN(r)||this._showIndicator(r,r)}}},_hideIndicator:function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0)},_clearHoverLinkToSeries:function(){this._hideIndicator();var t=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",p.convertDataIndex(t)),t.length=0},_clearHoverLinkFromSeries:function(){this._hideIndicator();var t=this.api.getZr();t.off("mouseover",this._hoverLinkFromSeriesMouseOver),t.off("mouseout",this._hideIndicator)},_applyTransform:function(t,e,i,n){var o=u.getTransform(e,n?null:this.group);return u[c.isArray(t)?"applyTransform":"transformDirection"](t,o,i)},_dispatchHighDown:function(t,e){e&&e.length&&this.api.dispatchAction({type:t,batch:e})},dispose:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},remove:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()}});t.exports=S},function(t,e,i){function n(t,e){var i=t.inverse;("vertical"===t.orient?!i:i)&&e.reverse()}var o=i(254),a=i(1),r=i(83),s=i(266),l=i(4).reformIntervals,u=o.extend({type:"visualMap.piecewise",defaultOption:{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieceList:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0,showLabel:null},optionUpdated:function(t,e){u.superApply(this,"optionUpdated",arguments),this._pieceList=[],this.resetTargetSeries(),this.resetExtent();var i=this._mode=this._determineMode();c[this._mode].call(this),this._resetSelected(t,e);var n=this.option.categories;this.resetVisual(function(t,e){"categories"===i?(t.mappingMethod="category",t.categories=a.clone(n)):(t.dataExtent=this.getExtent(),t.mappingMethod="piecewise",t.pieceList=a.map(this._pieceList,function(t){var t=a.clone(t);return"inRange"!==e&&(t.visual=null),t}))})},completeVisualOption:function(){function t(t,e,i){return t&&t[e]&&(a.isObject(t[e])?t[e].hasOwnProperty(i):t[e]===i)}var e=this.option,i={},n=r.listVisualTypes(),l=this.isCategory();a.each(e.pieces,function(t){a.each(n,function(e){t.hasOwnProperty(e)&&(i[e]=1)})}),a.each(i,function(i,n){var o=0;a.each(this.stateList,function(i){o|=t(e,i,n)||t(e.target,i,n)},this),!o&&a.each(this.stateList,function(t){(e[t]||(e[t]={}))[n]=s.get(n,"inRange"===t?"active":"inactive",l)})},this),o.prototype.completeVisualOption.apply(this,arguments)},_resetSelected:function(t,e){var i=this.option,n=this._pieceList,o=(e?i:t).selected||{};if(i.selected=o,a.each(n,function(t,e){var i=this.getSelectedMapKey(t);o.hasOwnProperty(i)||(o[i]=!0)},this),"single"===i.selectedMode){var r=!1;a.each(n,function(t,e){var i=this.getSelectedMapKey(t);o[i]&&(r?o[i]=!1:r=!0)},this)}},getSelectedMapKey:function(t){return"categories"===this._mode?t.value+"":t.index+""},getPieceList:function(){return this._pieceList},_determineMode:function(){var t=this.option;return t.pieces&&t.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},setSelected:function(t){this.option.selected=a.clone(t)},getValueState:function(t){var e=r.findPieceIndex(t,this._pieceList);return null!=e&&this.option.selected[this.getSelectedMapKey(this._pieceList[e])]?"inRange":"outOfRange"},findTargetDataIndices:function(t){var e=[];return this.eachTargetSeries(function(i){var n=[],o=i.getData();o.each(this.getDataDimension(o),function(e,i){var o=r.findPieceIndex(e,this._pieceList);o===t&&n.push(i)},!0,this),e.push({seriesId:i.id,dataIndex:n})},this),e},getRepresentValue:function(t){var e;if(this.isCategory())e=t.value;else if(null!=t.value)e=t.value;else{var i=t.interval||[];e=i[0]===-(1/0)&&i[1]===1/0?0:(i[0]+i[1])/2}return e},getVisualMeta:function(t){function e(e,a){var r=o.getRepresentValue({interval:e});a||(a=o.getValueState(r));var s=t(r,a);e[0]===-(1/0)?n[0]=s:e[1]===1/0?n[1]=s:i.push({value:e[0],color:s},{value:e[1],color:s})}if(!this.isCategory()){var i=[],n=[],o=this,r=this._pieceList.slice();if(r.length){var s=r[0].interval[0];s!==-(1/0)&&r.unshift({interval:[-(1/0),s]}),s=r[r.length-1].interval[1],s!==1/0&&r.push({interval:[s,1/0]})}else r.push({interval:[-(1/0),1/0]});var l=-(1/0);return a.each(r,function(t){var i=t.interval;i&&(i[0]>l&&e([l,i[0]],"outOfRange"),e(i.slice()),l=i[1])},this),{stops:i,outerColors:n}}}}),c={splitNumber:function(){var t=this.option,e=this._pieceList,i=t.precision,n=this.getExtent(),o=t.splitNumber;o=Math.max(parseInt(o,10),1),t.splitNumber=o;for(var r=(n[1]-n[0])/o;+r.toFixed(i)!==r&&i<5;)i++;t.precision=i,r=+r.toFixed(i);var s=0;t.minOpen&&e.push({index:s++,interval:[-(1/0),n[0]],close:[0,0]});for(var u=n[0],c=s+o;s<c;u+=r){var h=s===o-1?n[1]:u+r;e.push({index:s++,interval:[u,h],close:[1,1]})}t.maxOpen&&e.push({index:s++,interval:[n[1],1/0],close:[0,0]}),l(e),a.each(e,function(t){t.text=this.formatValueText(t.interval)},this)},categories:function(){var t=this.option;a.each(t.categories,function(t){this._pieceList.push({text:this.formatValueText(t,!0),value:t})},this),n(t,this._pieceList)},pieces:function(){var t=this.option,e=this._pieceList;a.each(t.pieces,function(t,i){a.isObject(t)||(t={value:t});var n={text:"",index:i};if(null!=t.label&&(n.text=t.label),t.hasOwnProperty("value")){var o=n.value=t.value;n.interval=[o,o],n.close=[1,1]}else{for(var s=n.interval=[],l=n.close=[0,0],u=[1,0,1],c=[-(1/0),1/0],h=[],d=0;d<2;d++){for(var f=[["gte","gt","min"],["lte","lt","max"]][d],p=0;p<3&&null==s[d];p++)s[d]=t[f[p]],l[d]=u[p],h[d]=2===p;null==s[d]&&(s[d]=c[d])}h[0]&&s[1]===1/0&&(l[0]=0),h[1]&&s[0]===-(1/0)&&(l[1]=0),s[0]===s[1]&&l[0]&&l[1]&&(n.value=s[0])}n.visual=r.retrieveVisuals(t),e.push(n)},this),n(t,e),l(e),a.each(e,function(t){var e=t.close,i=[["<","≤"][e[1]],[">","≥"][e[0]]];t.text=t.text||this.formatValueText(null!=t.value?t.value:t.interval,!1,i)},this)}};t.exports=u},function(t,e,i){var n=i(255),o=i(1),a=i(3),r=i(24),s=i(12),l=i(256),u=n.extend({type:"visualMap.piecewise",doRender:function(){function t(t){var r=t.piece,s=new a.Group;s.onclick=o.bind(this._onItemClick,this,r),this._enableHoverLink(s,t.indexInModelPieceList);var d=i.getRepresentValue(r);if(this._createItemSymbol(s,d,[0,0,h[0],h[1]]),p){var f=this.visualMapModel.getValueState(d);s.add(new a.Text({style:{x:"right"===c?-n:h[0]+n,y:h[1]/2,text:r.text,textVerticalAlign:"middle",textAlign:c,textFont:l,fill:u,opacity:"outOfRange"===f?.5:1}}))}e.add(s)}var e=this.group;e.removeAll();var i=this.visualMapModel,n=i.get("textGap"),r=i.textStyleModel,l=r.getFont(),u=r.getTextColor(),c=this._getItemAlign(),h=i.itemSize,d=this._getViewData(),f=d.endsText,p=o.retrieve(i.get("showLabel",!0),!f);f&&this._renderEndsText(e,f[0],h,p,c),o.each(d.viewPieceList,t,this),f&&this._renderEndsText(e,f[1],h,p,c),s.box(i.get("orient"),e,i.get("itemGap")),this.renderBackground(e),this.positionGroup(e)},_enableHoverLink:function(t,e){function i(t){var i=this.visualMapModel;i.option.hoverLink&&this.api.dispatchAction({type:t,batch:l.convertDataIndex(i.findTargetDataIndices(e))})}t.on("mouseover",o.bind(i,this,"highlight")).on("mouseout",o.bind(i,this,"downplay"))},_getItemAlign:function(){var t=this.visualMapModel,e=t.option;if("vertical"===e.orient)return l.getItemAlign(t,this.api,t.itemSize);var i=e.align;return i&&"auto"!==i||(i="left"),i},_renderEndsText:function(t,e,i,n,o){if(e){var r=new a.Group,s=this.visualMapModel.textStyleModel;r.add(new a.Text({style:{x:n?"right"===o?i[0]:0:i[0]/2,y:i[1]/2,textVerticalAlign:"middle",textAlign:n?o:"center",text:e,textFont:s.getFont(),fill:s.getTextColor()}})),t.add(r)}},_getViewData:function(){var t=this.visualMapModel,e=o.map(t.getPieceList(),function(t,e){return{piece:t,indexInModelPieceList:e}}),i=t.get("text"),n=t.get("orient"),a=t.get("inverse");return("horizontal"===n?a:!a)?e.reverse():i&&(i=i.slice().reverse()),{viewPieceList:e,endsText:i}},_createItemSymbol:function(t,e,i){t.add(r.createSymbol(this.getControllerVisual(e,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(e,"color")))},_onItemClick:function(t){var e=this.visualMapModel,i=e.option,n=o.clone(i.selected),a=e.getSelectedMapKey(t);"single"===i.selectedMode?(n[a]=!0,o.each(n,function(t,e){n[e]=e===a})):n[a]=!n[a],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:n})}});t.exports=u},function(t,e,i){i(2).registerPreprocessor(i(257)),i(258),i(259),i(388),i(389),i(260)},function(t,e,i){i(2).registerPreprocessor(i(257)),i(258),i(259),i(390),i(391),i(260)},function(t,e,i){"use strict";function n(t,e,i){this._model=t}function o(t,e,i,n){var o=i.calendarModel,a=i.seriesModel,r=o?o.coordinateSystem:a?a.coordinateSystem:null;return r===this?r[t](n):null}var a=i(12),r=i(4),s=i(1),l=864e5;n.prototype={constructor:n,type:"calendar",dimensions:["time","value"],getDimensionsInfo:function(){return[{name:"time",type:"time"}]},getRangeInfo:function(){return this._rangeInfo},getModel:function(){return this._model},getRect:function(){return this._rect},getCellWidth:function(){return this._sw},getCellHeight:function(){return this._sh},getOrient:function(){return this._orient},getFirstDayOfWeek:function(){return this._firstDayOfWeek},getDateInfo:function(t){t=r.parseDate(t);var e=t.getFullYear(),i=t.getMonth()+1;i=i<10?"0"+i:i;var n=t.getDate();n=n<10?"0"+n:n;var o=t.getDay();return o=Math.abs((o+7-this.getFirstDayOfWeek())%7),{y:e,m:i,d:n,day:o,time:t.getTime(),formatedDate:e+"-"+i+"-"+n,date:t}},getNextNDay:function(t,e){if(e=e||0,0===e)return this.getDateInfo(t);var i=this.getDateInfo(t).time;return this.getDateInfo(i+l*e)},update:function(t,e){function i(t,e){return null!=t[e]&&"auto"!==t[e]}this._firstDayOfWeek=this._model.getModel("dayLabel").get("firstDay"),this._orient=this._model.get("orient"),this._lineWidth=this._model.getModel("itemStyle.normal").getItemStyle().lineWidth||0,this._rangeInfo=this._getRangeInfo(this._initRangeOption());var n=this._rangeInfo.weeks||1,o=["width","height"],r=this._model.get("cellSize").slice(),l=this._model.getBoxLayoutParams(),u="horizontal"===this._orient?[n,7]:[7,n];s.each([0,1],function(t){i(r,t)&&(l[o[t]]=r[t]*u[t])});var c={width:e.getWidth(),height:e.getHeight()},h=this._rect=a.getLayoutRect(l,c);s.each([0,1],function(t){i(r,t)||(r[t]=h[o[t]]/u[t])}),this._sw=r[0],this._sh=r[1]},dataToPoint:function(t,e){s.isArray(t)&&(t=t[0]),null==e&&(e=!0);var i=this.getDateInfo(t),n=this._rangeInfo,o=i.formatedDate;if(e&&!(i.time>=n.start.time&&i.time<=n.end.time))return[NaN,NaN];var a=i.day,r=this._getRangeInfo([n.start.time,o]).weeks;return"vertical"===this._orient?[this._rect.x+a*this._sw+this._sw/2,this._rect.y+(r-1)*this._sh+this._sh/2]:[this._rect.x+(r-1)*this._sw+this._sw/2,this._rect.y+a*this._sh+this._sh/2]},pointToData:function(t){var e=this.pointToDate(t);return e&&e.time},dataToRect:function(t,e){var i=this.dataToPoint(t,e);return{contentShape:{x:i[0]-(this._sw-this._lineWidth)/2,y:i[1]-(this._sh-this._lineWidth)/2,width:this._sw-this._lineWidth,height:this._sh-this._lineWidth},center:i,tl:[i[0]-this._sw/2,i[1]-this._sh/2],tr:[i[0]+this._sw/2,i[1]-this._sh/2],br:[i[0]+this._sw/2,i[1]+this._sh/2],bl:[i[0]-this._sw/2,i[1]+this._sh/2]}},pointToDate:function(t){var e=Math.floor((t[0]-this._rect.x)/this._sw)+1,i=Math.floor((t[1]-this._rect.y)/this._sh)+1,n=this._rangeInfo.range;return"vertical"===this._orient?this._getDateByWeeksAndDay(i,e-1,n):this._getDateByWeeksAndDay(e,i-1,n)},convertToPixel:s.curry(o,"dataToPoint"),convertFromPixel:s.curry(o,"pointToData"),_initRangeOption:function(){var t=this._model.get("range"),e=t;if(s.isArray(e)&&1===e.length&&(e=e[0]),/^\d{4}$/.test(e)&&(t=[e+"-01-01",e+"-12-31"]),/^\d{4}[\/|-]\d{1,2}$/.test(e)){var i=this.getDateInfo(e),n=i.date;n.setMonth(n.getMonth()+1);var o=this.getNextNDay(n,-1);t=[i.formatedDate,o.formatedDate]}/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(e)&&(t=[e,e]);var a=this._getRangeInfo(t);return a.start.time>a.end.time&&t.reverse(),t},_getRangeInfo:function(t){var e=this.getDateInfo(t[0]),i=this.getDateInfo(t[1]),n=Math.floor(i.time/l)-Math.floor(e.time/l)+1,o=Math.floor((n+e.day+6)/7);return{range:[e.formatedDate,i.formatedDate],start:e,end:i,allDay:n,weeks:o,fweek:e.day,lweek:i.day}},_getDateByWeeksAndDay:function(t,e,i){var n=this._getRangeInfo(i);if(t>n.weeks||0===t&&e<n.fweek||t===n.weeks&&e>n.lweek)return!1;var o=7*(t-1)-n.fweek+e,a=n.start.time+o*l;return this.getDateInfo(a)}},n.dimensions=n.prototype.dimensions,n.getDimensionsInfo=n.prototype.getDimensionsInfo,n.create=function(t,e){var i=[];return t.eachComponent("calendar",function(o){var a=new n(o,t,e);i.push(a),o.coordinateSystem=a}),t.eachSeries(function(t){"calendar"===t.get("coordinateSystem")&&(t.coordinateSystem=i[t.get("calendarIndex")||0])}),i},i(26).register("calendar",n),t.exports=n},function(t,e,i){"use strict";function n(t,e){var i=t.cellSize;a.isArray(i)?1===i.length&&(i[1]=i[0]):i=t.cellSize=[i,i];var n=a.map([0,1],function(t){return r.sizeCalculable(e,t)&&(i[t]="auto"),null!=i[t]&&"auto"!==i[t]});r.mergeLayoutParam(t,e,{type:"box",ignoreSize:n})}var o=i(13),a=i(1),r=i(12),s=o.extend({type:"calendar",coordinateSystem:null,defaultOption:{zlevel:0,z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{normal:{color:"#fff",borderWidth:1,borderColor:"#ccc"}},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",nameMap:"en",textStyle:{color:"#000"}},monthLabel:{show:!0,position:"start",margin:5,align:"center",nameMap:"en",formatter:null,textStyle:{color:"#000"}},yearLabel:{show:!0,position:null,margin:30,formatter:null,textStyle:{color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}}},init:function(t,e,i,o){var a=r.getLayoutParams(t);s.superApply(this,"init",arguments),n(t,a)},mergeOption:function(t,e){s.superApply(this,"mergeOption",arguments),n(this.option,t)}});t.exports=s},function(t,e,i){function n(t){var e=t.getRect(),i=t.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:t.getCellWidth(),cellHeight:t.getCellHeight(),rangeInfo:{start:i.start,end:i.end,weeks:i.weeks,dayCount:i.allDay}},api:{coord:o.bind(t.dataToPoint,t)}}}var o=i(1);t.exports=n},function(t,e,i){function n(t,e){return e=e||[0,0],a.map(["x","y"],function(i,n){var o=this.getAxis(i),a=e[n],r=t[n]/2;return"category"===o.type?o.getBandWidth():Math.abs(o.dataToCoord(a-r)-o.dataToCoord(a+r))},this)}function o(t){var e=t.grid.getRect();return{coordSys:{type:"cartesian2d",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:a.bind(t.dataToPoint,t),size:a.bind(n,t)}}}var a=i(1);t.exports=o},function(t,e,i){function n(t,e,i,n,o){l.call(this,t),this.map=e,this._nameCoordMap=r.createHashMap(),this.loadGeoJson(i,n,o)}function o(t,e,i,n){var o=i.geoModel,a=i.seriesModel,r=o?o.coordinateSystem:a?a.coordinateSystem||(a.getReferringComponents("geo")[0]||{}).coordinateSystem:null;return r===this?r[t](n):null}var a=i(262),r=i(1),s=i(11),l=i(261),u=[i(402),i(403),i(401),i(400)];n.prototype={constructor:n,type:"geo",dimensions:["lng","lat"],containCoord:function(t){for(var e=this.regions,i=0;i<e.length;i++)if(e[i].contain(t))return!0;return!1},loadGeoJson:function(t,e,i){try{this.regions=t?a(t):[]}catch(n){throw"Invalid geoJson format\n"+n.message}e=e||{},i=i||{};for(var o=this.regions,s=r.createHashMap(),l=0;l<o.length;l++){var c=o[l].name;c=i.hasOwnProperty(c)?i[c]:c,o[l].name=c,s.set(c,o[l]),this.addGeoCoord(c,o[l].center);var h=e[c];h&&o[l].transformTo(h.left,h.top,h.width,h.height)}this._regionsMap=s,this._rect=null,r.each(u,function(t){t(this)},this)},transformTo:function(t,e,i,n){var o=this.getBoundingRect();o=o.clone(),o.y=-o.y-o.height;var a=this._viewTransform;a.transform=o.calculateTransform(new s(t,e,i,n)),a.decomposeTransform();var r=a.scale;r[1]=-r[1],a.updateTransform(),this._updateTransform()},getRegion:function(t){return this._regionsMap.get(t)},getRegionByCoord:function(t){for(var e=this.regions,i=0;i<e.length;i++)if(e[i].contain(t))return e[i]},addGeoCoord:function(t,e){this._nameCoordMap.set(t,e)},getGeoCoord:function(t){return this._nameCoordMap.get(t)},getBoundingRect:function(){if(this._rect)return this._rect;for(var t,e=this.regions,i=0;i<e.length;i++){var n=e[i].getBoundingRect();t=t||n.clone(),t.union(n)}return this._rect=t||new s(0,0,0,0)},dataToPoints:function(t){var e=[];return t.mapArray(["lng","lat"],function(t,i){return e[0]=t,e[1]=i,this.dataToPoint(e)},this)},dataToPoint:function(t){if("string"==typeof t&&(t=this.getGeoCoord(t)),t)return l.prototype.dataToPoint.call(this,t)},convertToPixel:r.curry(o,"dataToPoint"),convertFromPixel:r.curry(o,"pointToData")},r.mixin(n,l),t.exports=n},function(t,e,i){"use strict";var n=i(5),o=i(13),a=i(10),r=i(1),s=i(78),l=i(186),u=o.extend({type:"geo",coordinateSystem:null,layoutMode:"box",init:function(t){o.prototype.init.apply(this,arguments),n.defaultEmphasis(t.label,["position","show","textStyle","distance","formatter"])},optionUpdated:function(){var t=this.option,e=this;t.regions=l.getFilledRegions(t.regions,t.map),this._optionModelMap=r.reduce(t.regions||[],function(t,i){return i.name&&t.set(i.name,new a(i,e)),t},r.createHashMap()),this.updateSelectedMap(t.regions)},defaultOption:{zlevel:0,z:0,show:!0,left:"center",top:"center",aspectScale:.75,silent:!1,map:"",boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{normal:{show:!1,textStyle:{color:"#000"}},emphasis:{show:!0,textStyle:{color:"rgb(100,0,0)"}}},itemStyle:{normal:{borderWidth:.5,borderColor:"#444",color:"#eee"},emphasis:{color:"rgba(255,215,0,0.8)"}},regions:[]},getRegionModel:function(t){return this._optionModelMap.get(t)||new a(null,this,this.ecModel)},getFormattedLabel:function(t,e){var i=this.getRegionModel(t),n=i.get("label."+e+".formatter"),o={name:t};if("function"==typeof n)return o.status=e,n(o);if("string"==typeof n){var a=o.seriesName;return n.replace("{a}",null!=a?a:"")}},setZoom:function(t){this.option.zoom=t},setCenter:function(t){this.option.center=t}});r.mixin(u,s),t.exports=u},function(t,e,i){var n=(i(236),i(1),[[[123.45165252685547,25.73527164402261],[123.49731445312499,25.73527164402261],[123.49731445312499,25.750734064600884],[123.45165252685547,25.750734064600884],[123.45165252685547,25.73527164402261]]]);t.exports=function(t){if("china"===t.map)for(var e=0,i=t.regions.length;e<i;++e)"台湾"===t.regions[e].name&&t.regions[e].geometries.push({type:"polygon",exterior:n[0]})}},function(t,e,i){var n=i(1),o={Russia:[100,60],"United States":[-99,38],"United States of America":[-99,38]};t.exports=function(t){n.each(t.regions,function(t){var e=o[t.name];if(e){var i=t.center;i[0]=e[0],i[1]=e[1]}})}},function(t,e,i){for(var n=i(236),o=i(1),a=[126,25],r=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]],s=0;s<r.length;s++)for(var l=0;l<r[s].length;l++)r[s][l][0]/=10.5,r[s][l][1]/=-14,r[s][l][0]+=a[0],r[s][l][1]+=a[1];t.exports=function(t){"china"===t.map&&t.regions.push(new n("南海诸岛",o.map(r,function(t){return{type:"polygon",exterior:t}}),a))}},function(t,e,i){var n=i(1),o={"南海诸岛":[32,80],"广东":[0,-10],"香港":[10,5],"澳门":[-10,10],"天津":[5,5]};t.exports=function(t){n.each(t.regions,function(t){var e=o[t.name];if(e){var i=t.center;i[0]+=e[0]/10.5,i[1]+=-e[1]/14}})}},function(t,e,i){function n(t,e){return e=e||[0,0],a.map([0,1],function(i){var n=e[i],o=t[i]/2,a=[],r=[];return a[i]=n-o,r[i]=n+o,a[1-i]=r[1-i]=e[1-i],Math.abs(this.dataToPoint(a)[i]-this.dataToPoint(r)[i])},this)}function o(t){var e=t.getBoundingRect();return{coordSys:{type:"geo",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:a.bind(t.dataToPoint,t),size:a.bind(n,t)}}}var a=i(1);t.exports=o},function(t,e,i){function n(t,e){return e.type||(e.data?"category":"value")}var o=i(13),a=i(1),r=i(31),s=i(59),l=i(4),u=o.extend({type:"baseParallelAxis",axis:null,activeIntervals:[],getAreaSelectStyle:function(){return r([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]]).call(this.getModel("areaSelectStyle"))},setActiveIntervals:function(t){var e=this.activeIntervals=a.clone(t);if(e)for(var i=e.length-1;i>=0;i--)l.asc(e[i])},getActiveState:function(t){var e=this.activeIntervals;if(!e.length)return"normal";if(null==t)return"inactive";for(var i=0,n=e.length;i<n;i++)if(e[i][0]<=t&&t<=e[i][1])return"active";return"inactive"}}),c={type:"value",dim:null,areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};a.merge(u.prototype,i(42)),s("parallel",u,n,c),t.exports=u},function(t,e,i){function n(t,e,i){this._axesMap=u.createHashMap(),this._axesLayout={},this.dimensions=t.dimensions,this._rect,this._model=t,this._init(t,e,i)}function o(t,e){return m(v(t,e[0]),e[1])}function a(t,e){var i=e.layoutLength/(e.axisCount-1);return{position:i*t,axisNameAvailableWidth:i,axisLabelShow:!0}}function r(t,e){var i,n,o=e.layoutLength,a=e.axisExpandWidth,r=e.axisCount,s=e.axisCollapseWidth,l=e.winInnerIndices,u=s,c=!1;return t<l[0]?(i=t*s,n=s):t<=l[1]?(i=e.axisExpandWindow0Pos+t*a-e.axisExpandWindow[0],u=a,c=!0):(i=o-(r-1-t)*s,n=s),{position:i,axisNameAvailableWidth:u,axisLabelShow:c,nameTruncateMaxWidth:n}}var s=i(12),l=i(18),u=i(1),c=i(407),h=i(3),d=i(19),f=i(4),p=i(56),g=u.each,m=Math.min,v=Math.max,y=Math.floor,x=Math.ceil,_=f.round,b=Math.PI;n.prototype={type:"parallel",constructor:n,_init:function(t,e,i){var n=t.dimensions,o=t.parallelAxisIndex;g(n,function(t,i){var n=o[i],a=e.getComponent("parallelAxis",n),r=this._axesMap.set(t,new c(t,l.createScaleByModel(a),[0,0],a.get("type"),n)),s="category"===r.type;r.onBand=s&&a.get("boundaryGap"),r.inverse=a.get("inverse"),a.axis=r,r.model=a,r.coordinateSystem=a.coordinateSystem=this},this)},update:function(t,e){this._updateAxesFromSeries(this._model,t)},containPoint:function(t){var e=this._makeLayoutInfo(),i=e.axisBase,n=e.layoutBase,o=e.pixelDimIndex,a=t[1-o],r=t[o];return a>=i&&a<=i+e.axisLength&&r>=n&&r<=n+e.layoutLength},_updateAxesFromSeries:function(t,e){e.eachSeries(function(i){if(t.contains(i,e)){var n=i.getData();g(this.dimensions,function(t){var e=this._axesMap.get(t);e.scale.unionExtentFromData(n,t),l.niceScaleExtent(e.scale,e.model)},this)}},this)},resize:function(t,e){this._rect=s.getLayoutRect(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()}),this._layoutAxes()},getRect:function(){return this._rect},_makeLayoutInfo:function(){var t,e=this._model,i=this._rect,n=["x","y"],a=["width","height"],r=e.get("layout"),s="horizontal"===r?0:1,l=i[a[s]],u=[0,l],c=this.dimensions.length,h=o(e.get("axisExpandWidth"),u),d=o(e.get("axisExpandCount")||0,[0,c]),f=e.get("axisExpandable")&&c>3&&c>d&&d>1&&h>0&&l>0,p=e.get("axisExpandWindow");if(p)t=o(p[1]-p[0],u),p[1]=p[0]+t;else{t=o(h*(d-1),u);var g=e.get("axisExpandCenter")||y(c/2);p=[h*g-t/2],p[1]=p[0]+t}var m=(l-t)/(c-d);m<3&&(m=0);var v=[y(_(p[0]/h,1))+1,x(_(p[1]/h,1))-1],b=m/h*p[0];return{layout:r,pixelDimIndex:s,layoutBase:i[n[s]],layoutLength:l,axisBase:i[n[1-s]],axisLength:i[a[1-s]],axisExpandable:f,axisExpandWidth:h,axisCollapseWidth:m,axisExpandWindow:p,axisCount:c,winInnerIndices:v,axisExpandWindow0Pos:b}},_layoutAxes:function(){var t=this._rect,e=this._axesMap,i=this.dimensions,n=this._makeLayoutInfo(),o=n.layout;e.each(function(t){var e=[0,n.axisLength],i=t.inverse?1:0;t.setExtent(e[i],e[1-i])}),g(i,function(i,s){var l=(n.axisExpandable?r:a)(s,n),u={horizontal:{x:l.position,y:n.axisLength},vertical:{x:0,y:l.position}},c={horizontal:b/2,vertical:0},h=[u[o].x+t.x,u[o].y+t.y],f=c[o],p=d.create();d.rotate(p,p,f),d.translate(p,p,h),this._axesLayout[i]={position:h,rotation:f,transform:p,axisNameAvailableWidth:l.axisNameAvailableWidth,axisLabelShow:l.axisLabelShow,nameTruncateMaxWidth:l.nameTruncateMaxWidth,tickDirection:1,labelDirection:1,labelInterval:e.get(i).getLabelInterval()}},this)},getAxis:function(t){return this._axesMap.get(t)},dataToPoint:function(t,e){return this.axisCoordToPoint(this._axesMap.get(e).dataToCoord(t),e)},eachActiveState:function(t,e,i){for(var n=this.dimensions,o=this._axesMap,a=this.hasAxisBrushed(),r=0,s=t.count();r<s;r++){var l,u=t.getValues(n,r);if(a){l="active";for(var c=0,h=n.length;c<h;c++){var d=n[c],f=o.get(d).model.getActiveState(u[c],c);if("inactive"===f){l="inactive";break}}}else l="normal";e.call(i,l,r)}},hasAxisBrushed:function(){for(var t=this.dimensions,e=this._axesMap,i=!1,n=0,o=t.length;n<o;n++)"normal"!==e.get(t[n]).model.getActiveState()&&(i=!0);return i},axisCoordToPoint:function(t,e){var i=this._axesLayout[e];return h.applyTransform([t,0],i.transform)},getAxisLayout:function(t){return u.clone(this._axesLayout[t])},getSlidedAxisExpandWindow:function(t){var e=this._makeLayoutInfo(),i=e.pixelDimIndex,n=e.axisExpandWindow.slice(),o=n[1]-n[0],a=[0,e.axisExpandWidth*(e.axisCount-1)];if(!this.containPoint(t))return{behavior:"none",axisExpandWindow:n};var r,s=t[i]-e.layoutBase-e.axisExpandWindow0Pos,l="slide",u=e.axisCollapseWidth,c=this._model.get("axisExpandSlideTriggerArea"),h=null!=c[0];if(u)h&&u&&s<o*c[0]?(l="jump",r=s-o*c[2]):h&&u&&s>o*(1-c[0])?(l="jump",r=s-o*(1-c[2])):(r=s-o*c[1])>=0&&(r=s-o*(1-c[1]))<=0&&(r=0),r*=e.axisExpandWidth/u,r?p(r,n,a,"all"):l="none";else{var o=n[1]-n[0],d=a[1]*s/o;n=[v(0,d-o/2)],n[1]=m(a[1],n[0]+o),n[0]=n[1]-o}return{axisExpandWindow:n,behavior:l}}},t.exports=n},function(t,e,i){var n=i(1),o=i(33),a=function(t,e,i,n,a){o.call(this,t,e,i),this.type=n||"value",this.axisIndex=a};a.prototype={constructor:a,model:null},n.inherits(a,o),t.exports=a},function(t,e,i){var n=i(1),o=i(13);i(405),o.extend({type:"parallel",dependencies:["parallelAxis"],coordinateSystem:null,dimensions:null,parallelAxisIndex:null,layoutMode:"box",defaultOption:{zlevel:0,z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},init:function(){o.prototype.init.apply(this,arguments),this.mergeOption({})},mergeOption:function(t){var e=this.option;t&&n.merge(e,t,!0),this._initDimensions()},contains:function(t,e){var i=t.get("parallelIndex");return null!=i&&e.getComponent("parallel",i)===this},setAxisExpand:function(t){n.each(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],function(e){t.hasOwnProperty(e)&&(this.option[e]=t[e])},this)},_initDimensions:function(){var t=this.dimensions=[],e=this.parallelAxisIndex=[],i=n.filter(this.dependentModels.parallelAxis,function(t){return t.get("parallelIndex")===this.componentIndex});n.each(i,function(i){t.push("dim"+i.get("dim")),e.push(i.componentIndex)})}})},function(t,e,i){function n(t){if(!t.parallel){var e=!1;a.each(t.series,function(t){t&&"parallel"===t.type&&(e=!0)}),e&&(t.parallel=[{}])}}function o(t){var e=r.normalizeToArray(t.parallelAxis);a.each(e,function(e){if(a.isObject(e)){var i=e.parallelIndex||0,n=r.normalizeToArray(t.parallel)[i];n&&n.parallelAxisDefault&&a.merge(e,n.parallelAxisDefault,!1)}})}var a=i(1),r=i(5);t.exports=function(t){n(t),o(t)}},function(t,e,i){"use strict";function n(t,e){e=e||[0,360],a.call(this,"angle",t,e),this.type="category"}var o=i(1),a=i(33);n.prototype={constructor:n,pointToData:function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},dataToAngle:a.prototype.dataToCoord,angleToData:a.prototype.coordToData},o.inherits(n,a),t.exports=n},function(t,e,i){"use strict";function n(t,e){return e.type||(e.data?"category":"value")}var o=i(1),a=i(13),r=i(59),s=a.extend({type:"polarAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"polar",index:this.option.polarIndex,id:this.option.polarId})[0]}});o.merge(s.prototype,i(42));var l={angle:{startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:!1}},radius:{splitNumber:5}};r("angle",s,n,l.angle),r("radius",s,n,l.radius)},function(t,e,i){"use strict";var n=i(414),o=i(410),a=function(t){this.name=t||"",this.cx=0,this.cy=0,this._radiusAxis=new n,this._angleAxis=new o,this._radiusAxis.polar=this._angleAxis.polar=this};a.prototype={type:"polar",axisPointerEnabled:!0,constructor:a,dimensions:["radius","angle"],model:null,containPoint:function(t){var e=this.pointToCoord(t);return this._radiusAxis.contain(e[0])&&this._angleAxis.contain(e[1])},containData:function(t){return this._radiusAxis.containData(t[0])&&this._angleAxis.containData(t[1])},getAxis:function(t){return this["_"+t+"Axis"]},getAxes:function(){return[this._radiusAxis,this._angleAxis]},getAxesByScale:function(t){var e=[],i=this._angleAxis,n=this._radiusAxis;return i.scale.type===t&&e.push(i),n.scale.type===t&&e.push(n),e},getAngleAxis:function(){return this._angleAxis},getRadiusAxis:function(){return this._radiusAxis},getOtherAxis:function(t){var e=this._angleAxis;return t===e?this._radiusAxis:e},getBaseAxis:function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},getTooltipAxes:function(t){var e=null!=t&&"auto"!==t?this.getAxis(t):this.getBaseAxis();return{baseAxes:[e],otherAxes:[this.getOtherAxis(e)]}},dataToPoints:function(t){return t.mapArray(this.dimensions,function(t,e){return this.dataToPoint([t,e])},!0,this)},dataToPoint:function(t,e){return this.coordToPoint([this._radiusAxis.dataToRadius(t[0],e),this._angleAxis.dataToAngle(t[1],e)])},pointToData:function(t,e){var i=this.pointToCoord(t);return[this._radiusAxis.radiusToData(i[0],e),this._angleAxis.angleToData(i[1],e)]},pointToCoord:function(t){var e=t[0]-this.cx,i=t[1]-this.cy,n=this.getAngleAxis(),o=n.getExtent(),a=Math.min(o[0],o[1]),r=Math.max(o[0],o[1]);n.inverse?a=r-360:r=a+360;var s=Math.sqrt(e*e+i*i);e/=s,i/=s;for(var l=Math.atan2(-i,e)/Math.PI*180,u=l<a?1:-1;l<a||l>r;)l+=360*u;return[s,l]},coordToPoint:function(t){var e=t[0],i=t[1]/180*Math.PI,n=Math.cos(i)*e+this.cx,o=-Math.sin(i)*e+this.cy;return[n,o]}},t.exports=a},function(t,e,i){"use strict";i(411),i(2).extendComponentModel({type:"polar",dependencies:["polarAxis","angleAxis"],coordinateSystem:null,findAxisModel:function(t){var e,i=this.ecModel;return i.eachComponent(t,function(t){t.getCoordSysModel()===this&&(e=t)},this),e},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"80%"}})},function(t,e,i){"use strict";function n(t,e){a.call(this,"radius",t,e),this.type="category"}var o=i(1),a=i(33);n.prototype={constructor:n,pointToData:function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},dataToRadius:a.prototype.dataToCoord,radiusToData:a.prototype.coordToData},o.inherits(n,a),t.exports=n},function(t,e,i){function n(t,e){return a.map(["Radius","Angle"],function(i,n){var o=this["get"+i+"Axis"](),a=e[n],r=t[n]/2,s="dataTo"+i,l="category"===o.type?o.getBandWidth():Math.abs(o[s](a-r)-o[s](a+r));return"Angle"===i&&(l=l*Math.PI/180),l},this)}function o(t){var e=t.getRadiusAxis(),i=t.getAngleAxis(),o=e.getExtent();return o[0]>o[1]&&o.reverse(),{coordSys:{type:"polar",cx:t.cx,cy:t.cy,r:o[1],r0:o[0]},api:{coord:a.bind(function(n){var o=e.dataToRadius(n[0]),a=i.dataToAngle(n[1]),r=t.coordToPoint([o,a]);return r.push(o,a*Math.PI/180),r}),size:a.bind(n,t)}}}var a=i(1);t.exports=o},function(t,e,i){function n(t,e,i){a.call(this,t,e,i),this.type="value",this.angle=0,this.name="",this.model}var o=i(1),a=i(33);o.inherits(n,a),t.exports=n},function(t,e,i){function n(t,e,i){this._model=t,this.dimensions=[],this._indicatorAxes=o.map(t.getIndicatorModels(),function(t,e){var i="indicator_"+e,n=new a(i,new r);return n.name=t.get("name"),n.model=t,t.axis=n,this.dimensions.push(i),n},this),this.resize(t,i),this.cx,this.cy,this.r,this.startAngle}var o=i(1),a=i(416),r=i(43),s=i(4),l=i(18);n.prototype.getIndicatorAxes=function(){return this._indicatorAxes},n.prototype.dataToPoint=function(t,e){var i=this._indicatorAxes[e];return this.coordToPoint(i.dataToCoord(t),e)},n.prototype.coordToPoint=function(t,e){var i=this._indicatorAxes[e],n=i.angle,o=this.cx+t*Math.cos(n),a=this.cy-t*Math.sin(n);return[o,a]},n.prototype.pointToData=function(t){var e=t[0]-this.cx,i=t[1]-this.cy,n=Math.sqrt(e*e+i*i);e/=n,i/=n;for(var o,a=Math.atan2(-i,e),r=1/0,s=-1,l=0;l<this._indicatorAxes.length;l++){var u=this._indicatorAxes[l],c=Math.abs(a-u.angle);c<r&&(o=u,s=l,r=c)}return[s,+(o&&o.coodToData(n))]},n.prototype.resize=function(t,e){var i=t.get("center"),n=e.getWidth(),a=e.getHeight(),r=Math.min(n,a)/2;this.cx=s.parsePercent(i[0],n),this.cy=s.parsePercent(i[1],a),this.startAngle=t.get("startAngle")*Math.PI/180,this.r=s.parsePercent(t.get("radius"),r),o.each(this._indicatorAxes,function(t,e){t.setExtent(0,this.r);var i=this.startAngle+e*Math.PI*2/this._indicatorAxes.length;i=Math.atan2(Math.sin(i),Math.cos(i)),t.angle=i},this)},n.prototype.update=function(t,e){function i(t){var e=Math.pow(10,Math.floor(Math.log(t)/Math.LN10)),i=t/e;return 2===i?i=5:i*=2,i*e}var n=this._indicatorAxes,a=this._model;o.each(n,function(t){t.scale.setExtent(1/0,-(1/0))}),t.eachSeriesByType("radar",function(e,i){if("radar"===e.get("coordinateSystem")&&t.getComponent("radar",e.get("radarIndex"))===a){var r=e.getData();o.each(n,function(t){t.scale.unionExtentFromData(r,t.dim)})}},this);var r=a.get("splitNumber");o.each(n,function(t,e){var n=l.getScaleExtent(t.scale,t.model);l.niceScaleExtent(t.scale,t.model);var o=t.model,a=t.scale,u=o.getMin(),c=o.getMax(),h=a.getInterval();if(null!=u&&null!=c)a.setExtent(+u,+c),a.setInterval((c-u)/r);else if(null!=u){var d;do{d=u+h*r,a.setExtent(+u,d),a.setInterval(h),h=i(h)}while(d<n[1]&&isFinite(d)&&isFinite(n[1]))}else if(null!=c){var f;do{f=c-h*r,a.setExtent(f,+c),a.setInterval(h),h=i(h)}while(f>n[0]&&isFinite(f)&&isFinite(n[0]))}else{var p=a.getTicks().length-1;p>r&&(h=i(h));var g=Math.round((n[0]+n[1])/2/h)*h,m=Math.round(r/2);a.setExtent(s.round(g-m*h),s.round(g+(r-m)*h)),a.setInterval(h)}})},n.dimensions=[],n.create=function(t,e){var i=[];return t.eachComponent("radar",function(o){var a=new n(o,t,e);i.push(a),o.coordinateSystem=a}),t.eachSeriesByType("radar",function(t){"radar"===t.get("coordinateSystem")&&(t.coordinateSystem=i[t.get("radarIndex")||0])}),i},i(26).register("radar",n),t.exports=n},function(t,e,i){function n(t,e){return s.defaults({show:e},t)}var o=i(96),a=o.valueAxis,r=i(10),s=i(1),l=i(42),u=i(2).extendComponentModel({type:"radar",optionUpdated:function(){var t=this.get("boundaryGap"),e=this.get("splitNumber"),i=this.get("scale"),n=this.get("axisLine"),o=this.get("axisTick"),a=this.get("axisLabel"),u=this.get("name.textStyle"),c=this.get("name.show"),h=this.get("name.formatter"),d=this.get("nameGap"),f=this.get("triggerEvent"),p=s.map(this.get("indicator")||[],function(p){if(null!=p.max&&p.max>0&&!p.min?p.min=0:null!=p.min&&p.min<0&&!p.max&&(p.max=0),p=s.merge(s.clone(p),{boundaryGap:t,splitNumber:e,scale:i,axisLine:n,axisTick:o,axisLabel:a,name:p.text,nameLocation:"end",nameGap:d,nameTextStyle:u,triggerEvent:f},!1),c||(p.name=""),"string"==typeof h){var g=p.name;p.name=h.replace("{value}",null!=g?g:"")}else"function"==typeof h&&(p.name=h(p.name,p));var m=s.extend(new r(p,null,this.ecModel),l);return m.mainType="radar",m.componentIndex=this.componentIndex,m},this);this.getIndicatorModels=function(){return p}},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"75%",startAngle:90,name:{show:!0},boundaryGap:[0,0],splitNumber:5,nameGap:15,scale:!1,shape:"polygon",axisLine:s.merge({lineStyle:{color:"#bbb"}},a.axisLine),axisLabel:n(a.axisLabel,!1),axisTick:n(a.axisTick,!1),splitLine:n(a.splitLine,!0),splitArea:n(a.splitArea,!0),indicator:[]}});t.exports=u},function(t,e,i){function n(t,e){return e.type||(e.data?"category":"value")}var o=i(13),a=i(59),r=i(1),s=o.extend({type:"singleAxis",layoutMode:"box",axis:null,coordinateSystem:null,getCoordSysModel:function(){return this}}),l={left:"5%",top:"5%",right:"5%",bottom:"5%",type:"value",position:"bottom",orient:"horizontal",axisLine:{show:!0,lineStyle:{width:2,type:"solid"}},tooltip:{show:!0},axisTick:{show:!0,length:6,lineStyle:{width:2}},axisLabel:{show:!0,interval:"auto"},splitLine:{show:!0,lineStyle:{type:"dashed",opacity:.2}}};r.merge(s.prototype,i(42)),a("single",s,n,l),t.exports=s},function(t,e,i){function n(t,e,i){this.dimension="single",this.dimensions=["single"],this._axis=null,this._rect,this._init(t,e,i),this.model=t}var o=i(421),a=i(18),r=i(12);n.prototype={type:"singleAxis",axisPointerEnabled:!0,constructor:n,_init:function(t,e,i){var n=this.dimension,r=new o(n,a.createScaleByModel(t),[0,0],t.get("type"),t.get("position")),s="category"===r.type;r.onBand=s&&t.get("boundaryGap"),r.inverse=t.get("inverse"),r.orient=t.get("orient"),t.axis=r,r.model=t,r.coordinateSystem=this,this._axis=r},update:function(t,e){t.eachSeries(function(t){if(t.coordinateSystem===this){var e=t.getData(),i=this.dimension;this._axis.scale.unionExtentFromData(e,t.coordDimToDataDim(i)),a.niceScaleExtent(this._axis.scale,this._axis.model)}},this)},resize:function(t,e){this._rect=r.getLayoutRect({left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")},{width:e.getWidth(),height:e.getHeight()}),this._adjustAxis()},getRect:function(){return this._rect},_adjustAxis:function(){var t=this._rect,e=this._axis,i=e.isHorizontal(),n=i?[0,t.width]:[0,t.height],o=e.reverse?1:0;e.setExtent(n[o],n[1-o]),this._updateAxisTransform(e,i?t.x:t.y)},_updateAxisTransform:function(t,e){var i=t.getExtent(),n=i[0]+i[1],o=t.isHorizontal();t.toGlobalCoord=o?function(t){return t+e}:function(t){return n-t+e},t.toLocalCoord=o?function(t){return t-e}:function(t){return n-t+e}},getAxis:function(){return this._axis},getBaseAxis:function(){return this._axis},getAxes:function(){return[this._axis]},getTooltipAxes:function(){return{baseAxes:[this.getAxis()]}},containPoint:function(t){var e=this.getRect(),i=this.getAxis(),n=i.orient;return"horizontal"===n?i.contain(i.toLocalCoord(t[0]))&&t[1]>=e.y&&t[1]<=e.y+e.height:i.contain(i.toLocalCoord(t[1]))&&t[0]>=e.y&&t[0]<=e.y+e.height},pointToData:function(t){var e=this.getAxis();return[e.coordToData(e.toLocalCoord(t["horizontal"===e.orient?0:1]))]},dataToPoint:function(t){var e=this.getAxis(),i=this.getRect(),n=[],o="horizontal"===e.orient?0:1;return t instanceof Array&&(t=t[0]),n[o]=e.toGlobalCoord(e.dataToCoord(+t)),n[1-o]=0===o?i.y+i.height/2:i.x+i.width/2,n}},t.exports=n},function(t,e,i){var n=i(1),o=i(33),a=function(t,e,i,n,a){o.call(this,t,e,i),this.type=n||"value",this.position=a||"bottom",this.orient=null,this._labelInterval=null};a.prototype={constructor:a,model:null,isHorizontal:function(){var t=this.position;return"top"===t||"bottom"===t},pointToData:function(t,e){return this.coordinateSystem.pointToData(t,e)[0]},toGlobalCoord:null,toLocalCoord:null},n.inherits(a,o),t.exports=a},function(t,e,i){function n(t,e){var i=this.getAxis(),n=e instanceof Array?e[0]:e,o=(t instanceof Array?t[0]:t)/2;return"category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(n-o)-i.dataToCoord(n+o))}function o(t){var e=t.getRect();return{coordSys:{type:"singleAxis",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:a.bind(t.dataToPoint,t),size:a.bind(n,t)}}}var a=i(1);t.exports=o},function(t,e,i){function n(t,e){var i=[];return t.eachComponent("singleAxis",function(n,a){var r=new o(n,t,e);r.name="single_"+a,r.resize(n,e),n.coordinateSystem=r,i.push(r)}),t.eachSeries(function(e){if("singleAxis"===e.get("coordinateSystem")){var i=t.queryComponents({mainType:"singleAxis",index:e.get("singleAxisIndex"),id:e.get("singleAxisId")})[0];e.coordinateSystem=i&&i.coordinateSystem}}),i}var o=i(420);i(26).register("single",{create:n,dimensions:o.prototype.dimensions})},function(t,e,i){"use strict";function n(t){return"_EC_"+t}function o(t,e){this.id=null==t?"":t,this.inEdges=[],this.outEdges=[],this.edges=[],this.hostGraph,this.dataIndex=null==e?-1:e}function a(t,e,i){this.node1=t,this.node2=e,this.dataIndex=null==i?-1:i}var r=i(1),s=function(t){this._directed=t||!1,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this.data,this.edgeData},l=s.prototype;l.type="graph",l.isDirected=function(){return this._directed},l.addNode=function(t,e){t=t||""+e;var i=this._nodesMap;if(!i[n(t)]){var a=new o(t,e);return a.hostGraph=this,this.nodes.push(a),i[n(t)]=a,a}},l.getNodeByIndex=function(t){var e=this.data.getRawIndex(t);return this.nodes[e]},l.getNodeById=function(t){return this._nodesMap[n(t)]},l.addEdge=function(t,e,i){var r=this._nodesMap,s=this._edgesMap;if("number"==typeof t&&(t=this.nodes[t]),"number"==typeof e&&(e=this.nodes[e]),t instanceof o||(t=r[n(t)]),e instanceof o||(e=r[n(e)]),t&&e){var l=t.id+"-"+e.id;if(!s[l]){var u=new a(t,e,i);return u.hostGraph=this,this._directed&&(t.outEdges.push(u),e.inEdges.push(u)),t.edges.push(u),t!==e&&e.edges.push(u),this.edges.push(u),s[l]=u,u}}},l.getEdgeByIndex=function(t){var e=this.edgeData.getRawIndex(t);return this.edges[e]},l.getEdge=function(t,e){t instanceof o&&(t=t.id),e instanceof o&&(e=e.id);var i=this._edgesMap;return this._directed?i[t+"-"+e]:i[t+"-"+e]||i[e+"-"+t]},l.eachNode=function(t,e){for(var i=this.nodes,n=i.length,o=0;o<n;o++)i[o].dataIndex>=0&&t.call(e,i[o],o)},l.eachEdge=function(t,e){for(var i=this.edges,n=i.length,o=0;o<n;o++)i[o].dataIndex>=0&&i[o].node1.dataIndex>=0&&i[o].node2.dataIndex>=0&&t.call(e,i[o],o)},l.breadthFirstTraverse=function(t,e,i,a){if(e instanceof o||(e=this._nodesMap[n(e)]),e){for(var r="out"===i?"outEdges":"in"===i?"inEdges":"edges",s=0;s<this.nodes.length;s++)this.nodes[s].__visited=!1;if(!t.call(a,e,null))for(var l=[e];l.length;)for(var u=l.shift(),c=u[r],s=0;s<c.length;s++){var h=c[s],d=h.node1===u?h.node2:h.node1;if(!d.__visited){if(t.call(a,d,u))return;l.push(d),d.__visited=!0}}}},l.update=function(){for(var t=this.data,e=this.edgeData,i=this.nodes,n=this.edges,o=0,a=i.length;o<a;o++)i[o].dataIndex=-1;for(var o=0,a=t.count();o<a;o++)i[t.getRawIndex(o)].dataIndex=o;e.filterSelf(function(t){var i=n[e.getRawIndex(t)];return i.node1.dataIndex>=0&&i.node2.dataIndex>=0});for(var o=0,a=n.length;o<a;o++)n[o].dataIndex=-1;for(var o=0,a=e.count();o<a;o++)n[e.getRawIndex(o)].dataIndex=o},l.clone=function(){for(var t=new s(this._directed),e=this.nodes,i=this.edges,n=0;n<e.length;n++)t.addNode(e[n].id,e[n].dataIndex);for(var n=0;n<i.length;n++){var o=i[n];t.addEdge(o.node1.id,o.node2.id,o.dataIndex)}return t},o.prototype={constructor:o,degree:function(){return this.edges.length},inDegree:function(){return this.inEdges.length},outDegree:function(){return this.outEdges.length},getModel:function(t){if(!(this.dataIndex<0)){var e=this.hostGraph,i=e.data.getItemModel(this.dataIndex);return i.getModel(t)}}},a.prototype.getModel=function(t){if(!(this.dataIndex<0)){var e=this.hostGraph,i=e.edgeData.getItemModel(this.dataIndex);return i.getModel(t)}};var u=function(t,e){return{getValue:function(i){var n=this[t][e];return n.get(n.getDimension(i||"value"),this.dataIndex)},setVisual:function(i,n){this.dataIndex>=0&&this[t][e].setItemVisual(this.dataIndex,i,n)},getVisual:function(i,n){return this[t][e].getItemVisual(this.dataIndex,i,n)},setLayout:function(i,n){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,i,n)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}};r.mixin(o,u("hostGraph","data")),r.mixin(a,u("hostGraph","edgeData")),s.Node=o,s.Edge=a,t.exports=s},function(t,e,i){function n(t,e){this.root,this.data,this._nodes=[],this.hostModel=t,this.levelModels=a.map(e||[],function(e){return new r(e,t,t.ecModel)})}function o(t,e){var i=e.children;t.parentNode!==e&&(i.push(t),t.parentNode=e)}var a=i(1),r=i(10),s=i(14),l=i(264),u=i(25),c=function(t,e){this.name=t||"",this.depth=0,this.height=0,this.parentNode=null,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.hostTree=e};c.prototype={constructor:c,isRemoved:function(){return this.dataIndex<0},eachNode:function(t,e,i){"function"==typeof t&&(i=e,e=t,t=null),t=t||{},a.isString(t)&&(t={order:t});var n,o=t.order||"preorder",r=this[t.attr||"children"];"preorder"===o&&(n=e.call(i,this));for(var s=0;!n&&s<r.length;s++)r[s].eachNode(t,e,i);"postorder"===o&&e.call(i,this)},updateDepthAndHeight:function(t){var e=0;this.depth=t;for(var i=0;i<this.children.length;i++){var n=this.children[i];n.updateDepthAndHeight(t+1),n.height>e&&(e=n.height)}this.height=e+1},getNodeById:function(t){if(this.getId()===t)return this;for(var e=0,i=this.children,n=i.length;e<n;e++){var o=i[e].getNodeById(t);if(o)return o}},contains:function(t){if(t===this)return!0;for(var e=0,i=this.children,n=i.length;e<n;e++){var o=i[e].contains(t);if(o)return o}},getAncestors:function(t){for(var e=[],i=t?this:this.parentNode;i;)e.push(i),i=i.parentNode;return e.reverse(),e},getValue:function(t){var e=this.hostTree.data;return e.get(e.getDimension(t||"value"),this.dataIndex)},setLayout:function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemLayout(this.dataIndex,t,e)},getLayout:function(){return this.hostTree.data.getItemLayout(this.dataIndex)},getModel:function(t){if(!(this.dataIndex<0)){var e=this.hostTree,i=e.data.getItemModel(this.dataIndex),n=this.getLevelModel();return i.getModel(t,(n||e.hostModel).getModel(t))}},getLevelModel:function(){return(this.hostTree.levelModels||[])[this.depth]},setVisual:function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,t,e)},getVisual:function(t,e){return this.hostTree.data.getItemVisual(this.dataIndex,t,e)},getRawIndex:function(){return this.hostTree.data.getRawIndex(this.dataIndex)},getId:function(){return this.hostTree.data.getId(this.dataIndex)}},n.prototype={constructor:n,type:"tree",eachNode:function(t,e,i){this.root.eachNode(t,e,i)},getNodeByDataIndex:function(t){var e=this.data.getRawIndex(t);return this._nodes[e]},getNodeByName:function(t){return this.root.getNodeByName(t)},update:function(){for(var t=this.data,e=this._nodes,i=0,n=e.length;i<n;i++)e[i].dataIndex=-1;for(var i=0,n=t.count();i<n;i++)e[t.getRawIndex(i)].dataIndex=i},clearLayouts:function(){this.data.clearItemLayouts()}},n.createTree=function(t,e,i){function r(t,e){var i=t.value;f=Math.max(f,a.isArray(i)?i.length:1),d.push(t);var n=new c(t.name,h);e?o(n,e):h.root=n,h._nodes.push(n);var s=t.children;if(s)for(var l=0;l<s.length;l++)r(s[l],n)}var h=new n(e,i),d=[],f=1;r(t),h.root.updateDepthAndHeight(0);var p=u([{name:"value"}],d,{dimCount:f}),g=new s(p,e);return g.initData(d),l({mainData:g,struct:h,structAttr:"tree"}),h.update(),h},t.exports=n},function(t,e,i){"use strict";function n(t){return t.get("stack")||"__ec_stack_"+t.seriesIndex}function o(t){return t.dim}function a(t,e,i){var a=i.getWidth(),u=i.getHeight(),c={},h={},d=r(s.filter(e.getSeriesByType(t),function(t){return!e.isSeriesFiltered(t)&&t.coordinateSystem&&"polar"===t.coordinateSystem.type}));e.eachSeriesByType(t,function(t){if("polar"===t.coordinateSystem.type){var e=t.getData(),i=t.coordinateSystem,r=i.getAngleAxis(),s=i.getBaseAxis(),f=n(t),p=d[o(s)][f],g=p.offset,m=p.width,v=i.getOtherAxis(s),y=t.get("center")||["50%","50%"],x=l(y[0],a),_=l(y[1],u),b=t.get("barMinHeight")||0,w=t.get("barMinAngle")||0,S=v.getExtent()[0],M=v.model.get("max"),I=v.model.get("min"),T=i.dataToPoints(e);c[f]=c[f]||[],h[f]=h[f]||[],e.each(v.dim,function(t,n){if(!isNaN(t)){c[f][n]||(c[f][n]={p:S,n:S},h[f][n]={p:S,n:S});var o,a,s,l,u=t>=0?"p":"n",d=i.pointToCoord(T[n]),p=h[f][n][u];if("radius"===v.dim)o=p,a=d[0],s=(-d[1]+g)*Math.PI/180,l=s+m*Math.PI/180,Math.abs(a)<b&&(a=o+(a<0?-1:1)*b),h[f][n][u]=a;else{o=d[0]+g,a=o+m,null!=M&&(t=Math.min(t,M)),null!=I&&(t=Math.max(t,I));var y=r.dataToAngle(t);Math.abs(y-p)<w&&(y=p-(t<0?-1:1)*w),s=-p*Math.PI/180,l=-y*Math.PI/180;var A=r.getExtent(),C=y;C===A[0]&&t>0?C=A[1]:C===A[1]&&t<0&&(C=A[0]),h[f][n][u]=C}e.setItemLayout(n,{cx:x,cy:_,r0:o,r:a,startAngle:s,endAngle:l})}},!0)}},this)}function r(t,e){var i={};s.each(t,function(t,e){var a=t.getData(),r=t.coordinateSystem,s=r.getBaseAxis(),u=s.getExtent(),c="category"===s.type?s.getBandWidth():Math.abs(u[1]-u[0])/a.count(),h=i[o(s)]||{bandWidth:c,remainedWidth:c,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},d=h.stacks;i[o(s)]=h;var f=n(t);d[f]||h.autoWidthCount++,d[f]=d[f]||{width:0,maxWidth:0};var p=l(t.get("barWidth"),c),g=l(t.get("barMaxWidth"),c),m=t.get("barGap"),v=t.get("barCategoryGap");p&&!d[f].width&&(p=Math.min(h.remainedWidth,p),d[f].width=p,h.remainedWidth-=p),g&&(d[f].maxWidth=g),null!=m&&(h.gap=m),null!=v&&(h.categoryGap=v)});var a={};return s.each(i,function(t,e){a[e]={};var i=t.stacks,n=t.bandWidth,o=l(t.categoryGap,n),r=l(t.gap,1),u=t.remainedWidth,c=t.autoWidthCount,h=(u-o)/(c+(c-1)*r);h=Math.max(h,0),s.each(i,function(t,e){var i=t.maxWidth;i&&i<h&&(i=Math.min(i,u),t.width&&(i=Math.min(i,t.width)),u-=i,t.width=i,c--)}),h=(u-o)/(c+(c-1)*r),h=Math.max(h,0);var d,f=0;s.each(i,function(t,e){t.width||(t.width=h),d=t,f+=t.width*(1+r)}),d&&(f-=d.width*r);var p=-f/2;s.each(i,function(t,i){a[e][i]=a[e][i]||{offset:p,width:t.width},p+=t.width*(1+r)})}),a}var s=i(1),l=i(4).parsePercent;t.exports=a},function(t,e,i){function n(){var t,e=[],i={};return{add:function(t,n,a,r,s){return o.isString(r)&&(s=r,r=0),!i[t.id]&&(i[t.id]=1,e.push({el:t,target:n,time:a,delay:r,easing:s}),!0)},done:function(e){return t=e,this},start:function(){function n(){o--,o||(e.length=0,i={},t&&t())}for(var o=e.length,a=0,r=e.length;a<r;a++){var s=e[a];s.el.animateTo(s.target,s.time,s.delay,s.easing,n)}return this}}}var o=i(1);t.exports={createWrap:n}}])});
back to top