mirror of
https://github.com/SickGear/SickGear.git
synced 2024-11-24 22:05:05 +00:00
e56303798c
Initial SickGear for Python 3.
7 lines
No EOL
2.3 MiB
7 lines
No EOL
2.3 MiB
/**
|
|
* plotly.js v1.34.0
|
|
* Copyright 2012-2018, Plotly, Inc.
|
|
* All rights reserved.
|
|
* Licensed under the MIT license
|
|
*/
|
|
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Plotly=t()}}(function(){return function 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 c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[o]={exports:{}};e[o][0].call(u.exports,function(t){var r=e[o][1][t];return i(r||t)},u,u.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-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .modebar":"position:absolute;top:2px;right:2px;z-index:1001;background:rgba(255,255,255,0.7);","X .modebar--hover":"opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;","X:hover .modebar--hover":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;margin-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group:first-child":"margin-left:0px;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar-btn path":"fill:rgba(0,31,95,0.3);","X .modebar-btn.active path,X .modebar-btn:hover path":"fill:rgba(0,22,72,0.5);","X .modebar-btn.modebar-btn--logo":"padding:3px 1px;","X .modebar-btn.modebar-btn--logo path":"fill:#447adb !important;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":"content:'';position:absolute;background:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;","X [data-title]:after":"content:attr(data-title);background:#69738a;color:white;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:white;","X .select-outline-2":"stroke:black;stroke-dasharray:2px 2px;",Y:"font-family:'Open Sans';position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;","Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,0.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:0.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(var 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":724}],2:[function(t,e,r){"use strict";e.exports={undo:{width:857.1,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",ascent:850,descent:-150},home:{width:928.6,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",ascent:850,descent:-150},"camera-retro":{width:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",ascent:850,descent:-150},zoombox:{width:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",ascent:850,descent:-150},pan:{width:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",ascent:850,descent:-150},zoom_plus:{width:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",ascent:850,descent:-150},zoom_minus:{width:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",ascent:850,descent:-150},autoscale:{width:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",ascent:850,descent:-150},tooltip_basic:{width:1500,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",ascent:850,descent:-150},tooltip_compare:{width:1125,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",ascent:850,descent:-150},plotlylogo:{width:1542,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",ascent:850,descent:-150},"z-axis":{width:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",ascent:850,descent:-150},"3d_rotate":{width:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",ascent:850,descent:-150},camera:{width:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",ascent:850,descent:-150},movie:{width:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",ascent:850,descent:-150},question:{width:857.1,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",ascent:850,descent:-150},disk:{width:857.1,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",ascent:850,descent:-150},lasso:{width:1031,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",ascent:850,descent:-150},selectbox:{width:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",ascent:850,descent:-150},spikeline:{width:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",ascent:850,descent:-150}}},{}],3:[function(t,e,r){"use strict";e.exports=t("../src/transforms/aggregate")},{"../src/transforms/aggregate":1148}],4:[function(t,e,r){"use strict";e.exports=t("../src/traces/bar")},{"../src/traces/bar":868}],5:[function(t,e,r){"use strict";e.exports=t("../src/traces/box")},{"../src/traces/box":881}],6:[function(t,e,r){"use strict";e.exports=t("../src/components/calendars")},{"../src/components/calendars":596}],7:[function(t,e,r){"use strict";e.exports=t("../src/traces/candlestick")},{"../src/traces/candlestick":890}],8:[function(t,e,r){"use strict";e.exports=t("../src/traces/carpet")},{"../src/traces/carpet":911}],9:[function(t,e,r){"use strict";e.exports=t("../src/traces/choropleth")},{"../src/traces/choropleth":926}],10:[function(t,e,r){"use strict";e.exports=t("../src/traces/contour")},{"../src/traces/contour":944}],11:[function(t,e,r){"use strict";e.exports=t("../src/traces/contourcarpet")},{"../src/traces/contourcarpet":955}],12:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":705}],13:[function(t,e,r){"use strict";e.exports=t("../src/transforms/filter")},{"../src/transforms/filter":1149}],14:[function(t,e,r){"use strict";e.exports=t("../src/transforms/groupby")},{"../src/transforms/groupby":1150}],15:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmap")},{"../src/traces/heatmap":968}],16:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmapgl")},{"../src/traces/heatmapgl":978}],17:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram")},{"../src/traces/histogram":989}],18:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2d")},{"../src/traces/histogram2d":995}],19:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2dcontour")},{"../src/traces/histogram2dcontour":999}],20:[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("./violin"),t("./scatter3d"),t("./surface"),t("./mesh3d"),t("./scattergeo"),t("./choropleth"),t("./scattergl"),t("./pointcloud"),t("./heatmapgl"),t("./parcoords"),t("./scattermapbox"),t("./sankey"),t("./table"),t("./carpet"),t("./scattercarpet"),t("./contourcarpet"),t("./ohlc"),t("./candlestick"),t("./scatterpolar"),t("./scatterpolargl")]),n.register([t("./aggregate"),t("./filter"),t("./groupby"),t("./sort")]),n.register([t("./calendars")]),e.exports=n},{"./aggregate":3,"./bar":4,"./box":5,"./calendars":6,"./candlestick":7,"./carpet":8,"./choropleth":9,"./contour":10,"./contourcarpet":11,"./core":12,"./filter":13,"./groupby":14,"./heatmap":15,"./heatmapgl":16,"./histogram":17,"./histogram2d":18,"./histogram2dcontour":19,"./mesh3d":21,"./ohlc":22,"./parcoords":23,"./pie":24,"./pointcloud":25,"./sankey":26,"./scatter3d":27,"./scattercarpet":28,"./scattergeo":29,"./scattergl":30,"./scattermapbox":31,"./scatterpolar":32,"./scatterpolargl":33,"./scatterternary":34,"./sort":35,"./surface":36,"./table":37,"./violin":38}],21:[function(t,e,r){"use strict";e.exports=t("../src/traces/mesh3d")},{"../src/traces/mesh3d":1005}],22:[function(t,e,r){"use strict";e.exports=t("../src/traces/ohlc")},{"../src/traces/ohlc":1010}],23:[function(t,e,r){"use strict";e.exports=t("../src/traces/parcoords")},{"../src/traces/parcoords":1019}],24:[function(t,e,r){"use strict";e.exports=t("../src/traces/pie")},{"../src/traces/pie":1029}],25:[function(t,e,r){"use strict";e.exports=t("../src/traces/pointcloud")},{"../src/traces/pointcloud":1038}],26:[function(t,e,r){"use strict";e.exports=t("../src/traces/sankey")},{"../src/traces/sankey":1044}],27:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatter3d")},{"../src/traces/scatter3d":1078}],28:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattercarpet")},{"../src/traces/scattercarpet":1084}],29:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattergeo")},{"../src/traces/scattergeo":1091}],30:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattergl")},{"../src/traces/scattergl":1097}],31:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattermapbox")},{"../src/traces/scattermapbox":1103}],32:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterpolar")},{"../src/traces/scatterpolar":1110}],33:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterpolargl")},{"../src/traces/scatterpolargl":1114}],34:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterternary")},{"../src/traces/scatterternary":1120}],35:[function(t,e,r){"use strict";e.exports=t("../src/transforms/sort")},{"../src/transforms/sort":1152}],36:[function(t,e,r){"use strict";e.exports=t("../src/traces/surface")},{"../src/traces/surface":1127}],37:[function(t,e,r){"use strict";e.exports=t("../src/traces/table")},{"../src/traces/table":1135}],38:[function(t,e,r){"use strict";e.exports=t("../src/traces/violin")},{"../src/traces/violin":1142}],39:[function(t,e,r){"use strict";e.exports=function(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 c=i({center:e.center||[0,0,0],up:e.up||[0,1,0],eye:e.eye||[0,0,10],mode:e.mode||"orbit",distanceLimits:r}),u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],f=0,h=t.clientWidth,d=t.clientHeight,p={view:c,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:c.modes,tick:function(){var e=n(),r=this.delay;c.idle(e-r),c.flush(e-(100+2*r));var i=e-2*r;c.recalcMatrix(i);for(var a=!0,o=c.computedMatrix,s=0;s<16;++s)a=a&&u[s]===o[s],u[s]=o[s];var l=t.clientWidth===h&&t.clientHeight===d;return h=t.clientWidth,d=t.clientHeight,a?!l:(f=Math.exp(c.computedRadius[0]),!0)},lookAt:function(t,e,r){c.lookAt(c.lastT(),t,e,r)},rotate:function(t,e,r){c.rotate(c.lastT(),t,e,r)},pan:function(t,e,r){c.pan(c.lastT(),t,e,r)},translate:function(t,e,r){c.translate(c.lastT(),t,e,r)}};Object.defineProperties(p,{matrix:{get:function(){return c.computedMatrix},set:function(t){return c.setMatrix(c.lastT(),t),c.computedMatrix},enumerable:!0},mode:{get:function(){return c.getMode()},set:function(t){return c.setMode(t),c.getMode()},enumerable:!0},center:{get:function(){return c.computedCenter},set:function(t){return c.lookAt(c.lastT(),t),c.computedCenter},enumerable:!0},eye:{get:function(){return c.computedEye},set:function(t){return c.lookAt(c.lastT(),null,t),c.computedEye},enumerable:!0},up:{get:function(){return c.computedUp},set:function(t){return c.lookAt(c.lastT(),null,null,t),c.computedUp},enumerable:!0},distance:{get:function(){return f},set:function(t){return c.setDistance(c.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return c.getDistanceLimits(r)},set:function(t){return c.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener("contextmenu",function(t){return t.preventDefault(),!1});var m=0,v=0,g={shift:!1,control:!1,alt:!1,meta:!1};function y(e,r,i,a){var o=1/t.clientHeight,s=o*(r-m),l=o*(i-v),u=p.flipX?1:-1,h=p.flipY?1:-1,d=Math.PI*p.rotateSpeed,y=n();if(1&e)a.shift?c.rotate(y,0,0,-s*d):c.rotate(y,u*d*s,-h*d*l,0);else if(2&e)c.pan(y,-p.translateSpeed*s*f,p.translateSpeed*l*f,0);else if(4&e){var b=p.zoomSpeed*l/window.innerHeight*(y-c.lastT())*50;c.pan(y,0,0,f*(Math.exp(b)-1))}m=r,v=i,g=a}return a(t,y),t.addEventListener("touchstart",function(e){var r=s(e.changedTouches[0],t);y(0,r[0],r[1],g),y(1,r[0],r[1],g),e.preventDefault()},!!l&&{passive:!1}),t.addEventListener("touchmove",function(e){var r=s(e.changedTouches[0],t);y(1,r[0],r[1],g),e.preventDefault()},!!l&&{passive:!1}),t.addEventListener("touchend",function(e){s(e.changedTouches[0],t),y(0,m,v,g),e.preventDefault()},!!l&&{passive:!1}),o(t,function(t,e,r){var i=p.flipX?1:-1,a=p.flipY?1:-1,o=n();if(Math.abs(t)>Math.abs(e))c.rotate(o,0,0,-t*i*Math.PI*p.rotateSpeed/window.innerWidth);else{var s=p.zoomSpeed*a*e/window.innerHeight*(o-c.lastT())/100;c.pan(o,0,0,f*(Math.exp(s)-1))}},!0),p};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset"),l=t("has-passive-events")},{"3d-view":40,"has-passive-events":256,"mouse-change":424,"mouse-event-offset":425,"mouse-wheel":427,"right-now":489}],40:[function(t,e,r){"use strict";e.exports=function(t){var e=(t=t||{}).eye||[0,0,1],r=t.center||[0,0,0],s=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],c=t.mode||"turntable",u=n(),f=i(),h=a();return u.setDistanceLimits(l[0],l[1]),u.lookAt(0,e,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),new o({turntable:u,orbit:f,matrix:h},c)};var n=t("turntable-camera-controller"),i=t("orbit-camera-controller"),a=t("matrix-camera-controller");function o(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map(function(e){return t[e]}),this._mode=e,this._active=t[e],this._active||(this._mode="turntable",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=o.prototype;[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]].forEach(function(t){for(var e=t[0],r=[],n=0;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()+")}";s[e]=Function.apply(null,r.concat(i))}),s.recalcMatrix=function(t){this._active.recalcMatrix(t)},s.getDistance=function(t){return this._active.getDistance(t)},s.getDistanceLimits=function(t){return this._active.getDistanceLimits(t)},s.lastT=function(){return this._active.lastT()},s.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}}},s.getMode=function(){return this._mode}},{"matrix-camera-controller":422,"orbit-camera-controller":445,"turntable-camera-controller":531}],41:[function(t,e,r){var n,i;n=this,i=function(t,e,r,n){"use strict";t.sankey=function(){var t={},i=24,a=8,o=[1,1],s=[],l=[];function c(){function t(t,e){return t.source.y-e.source.y||t.originalIndex-e.originalIndex}function e(t,e){return t.target.y-e.target.y||t.originalIndex-e.originalIndex}s.forEach(function(r){r.sourceLinks.sort(e),r.targetLinks.sort(t)}),s.forEach(function(t){var e=0,r=0;t.sourceLinks.forEach(function(t){t.sy=e,e+=t.dy}),t.targetLinks.forEach(function(t){t.ty=r,r+=t.dy})})}function u(t){return t.y+t.dy/2}function f(t){return t.value}return t.nodeWidth=function(e){return arguments.length?(i=+e,t):i},t.nodePadding=function(e){return arguments.length?(a=+e,t):a},t.nodes=function(e){return arguments.length?(s=e,t):s},t.links=function(e){return arguments.length?(l=e,t):l},t.size=function(e){return arguments.length?(o=e,t):o},t.layout=function(n){return s.forEach(function(t){t.sourceLinks=[],t.targetLinks=[]}),l.forEach(function(t,e){var r=t.source,n=t.target;"number"==typeof r&&(r=t.source=s[t.source]),"number"==typeof n&&(n=t.target=s[t.target]),t.originalIndex=e,r.sourceLinks.push(t),n.targetLinks.push(t)}),s.forEach(function(t){t.value=Math.max(e.sum(t.sourceLinks,f),e.sum(t.targetLinks,f))}),function(){for(var t,e,r=s,n=0;r.length;)t=[],r.forEach(function(e){e.x=n,e.dx=i,e.sourceLinks.forEach(function(e){t.indexOf(e.target)<0&&t.push(e.target)})}),r=t,++n;(function(t){s.forEach(function(e){e.sourceLinks.length||(e.x=t-1)})})(n),e=(o[0]-i)/(n-1),s.forEach(function(t){t.x*=e})}(),function(t){var n,i=r.nest().key(function(t){return t.x}).sortKeys(e.ascending).entries(s).map(function(t){return t.values});n=e.min(i,function(t){return(o[1]-(t.length-1)*a)/e.sum(t,f)}),i.forEach(function(t){t.forEach(function(t,e){t.y=e,t.dy=t.value*n})}),l.forEach(function(t){t.dy=t.value*n}),p();for(var c=1;t>0;--t)d(c*=.99),p(),h(c),p();function h(t){function r(t){return u(t.source)*t.value}i.forEach(function(n){n.forEach(function(n){if(n.targetLinks.length){var i=e.sum(n.targetLinks,r)/e.sum(n.targetLinks,f);n.y+=(i-u(n))*t}})})}function d(t){function r(t){return u(t.target)*t.value}i.slice().reverse().forEach(function(n){n.forEach(function(n){if(n.sourceLinks.length){var i=e.sum(n.sourceLinks,r)/e.sum(n.sourceLinks,f);n.y+=(i-u(n))*t}})})}function p(){i.forEach(function(t){var e,r,n,i=0,s=t.length;for(t.sort(m),n=0;n<s;++n)e=t[n],(r=i-e.y)>0&&(e.y+=r),i=e.y+e.dy+a;if((r=i-a-o[1])>0)for(i=e.y-=r,n=s-2;n>=0;--n)e=t[n],(r=e.y+e.dy+a-i)>0&&(e.y-=r),i=e.y})}function m(t,e){return t.y-e.y}}(n),c(),t},t.relayout=function(){return c(),t},t.link=function(){var t=.5;function e(e){var r=e.source.x+e.source.dx,i=e.target.x,a=n.interpolateNumber(r,i),o=a(t),s=a(1-t),l=e.source.y+e.sy,c=l+e.dy,u=e.target.y+e.ty,f=u+e.dy;return"M"+r+","+l+"C"+o+","+l+" "+s+","+u+" "+i+","+u+"L"+i+","+f+"C"+s+","+f+" "+o+","+c+" "+r+","+c+"Z"}return e.curvature=function(r){return arguments.length?(t=+r,e):t},e},t},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof r&&void 0!==e?i(r,t("d3-array"),t("d3-collection"),t("d3-interpolate")):i(n.d3=n.d3||{},n.d3,n.d3,n.d3)},{"d3-array":120,"d3-collection":121,"d3-interpolate":125}],42:[function(t,e,r){"use strict";var n="undefined"==typeof WeakMap?t("weak-map"):WeakMap,i=t("gl-buffer"),a=t("gl-vao"),o=new n;e.exports=function(t){var e=o.get(t),r=e&&(e._triangleBuffer.handle||e._triangleBuffer.buffer);if(!r||!t.isBuffer(r)){var n=i(t,new Float32Array([-1,-1,-1,4,4,-1]));(e=a(t,[{buffer:n,type:t.FLOAT,size:2}]))._triangleBuffer=n,o.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}},{"gl-buffer":165,"gl-vao":237,"weak-map":553}],43:[function(t,e,r){e.exports=function(t){var e=0,r=0,n=0,i=0;return t.map(function(t){var a=(t=t.slice())[0],o=a.toUpperCase();if(a!=o)switch(t[0]=o,a){case"a":t[6]+=n,t[7]+=i;break;case"v":t[1]+=i;break;case"h":t[1]+=n;break;default:for(var s=1;s<t.length;)t[s++]+=n,t[s++]+=i}switch(o){case"Z":n=e,i=r;break;case"H":n=t[1];break;case"V":i=t[1];break;case"M":n=e=t[1],i=r=t[2];break;default:n=t[t.length-2],i=t[t.length-1]}return t})}},{}],44:[function(t,e,r){var n=t("pad-left");e.exports=function(t,e,r){e="number"==typeof e?e:1,r=r||": ";var i=t.split(/\r?\n/),a=String(i.length+e-1).length;return i.map(function(t,i){var o=i+e,s=String(o).length,l=n(o,a-s);return l+r+t}).join("\n")}},{"pad-left":446}],45:[function(t,e,r){"use strict";e.exports=function(t){var e=t.length;if(0===e)return[];if(1===e)return[0];for(var r=t[0].length,n=[t[0]],a=[0],o=1;o<e;++o)if(n.push(t[o]),i(n,r)){if(a.push(o),a.length===r+1)return a}else n.pop();return a};var n=t("robust-orientation");function i(t,e){for(var r=new Array(e+1),i=0;i<t.length;++i)r[i]=t[i];for(i=0;i<=t.length;++i){for(var a=t.length;a<=e;++a){for(var o=new Array(e),s=0;s<e;++s)o[s]=Math.pow(a+1-i,s);r[a]=o}if(n.apply(void 0,r))return!0}return!1}},{"robust-orientation":495}],46:[function(t,e,r){"use strict";e.exports=function(t,e){return n(e).filter(function(r){for(var n=new Array(r.length),a=0;a<r.length;++a)n[a]=e[r[a]];return i(n)*t<1})};var n=t("delaunay-triangulate"),i=t("circumradius")},{circumradius:93,"delaunay-triangulate":130}],47:[function(t,e,r){e.exports=function(t,e){return i(n(t,e))};var n=t("alpha-complex"),i=t("simplicial-complex-boundary")},{"alpha-complex":46,"simplicial-complex-boundary":503}],48:[function(t,e,r){"use strict";e.exports=function(t,e){if(!t||null==t.length)throw Error("Argument should be an array");e=null==e?1:Math.floor(e);for(var r=Array(2*e),n=0;n<e;n++){for(var i=-1/0,a=1/0,o=n,s=t.length;o<s;o+=e)t[o]>i&&(i=t[o]),t[o]<a&&(a=t[o]);r[n]=a,r[e+n]=i}return r}},{}],49:[function(t,e,r){"use strict";var n=t("array-bounds");e.exports=function(t,e,r){if(!t||null==t.length)throw Error("Argument should be an array");null==e&&(e=1);null==r&&(r=n(t,e));for(var i=0;i<e;i++){var a=r[e+i],o=r[i],s=i,l=t.length;if(a===1/0&&o===-1/0)for(s=i;s<l;s+=e)t[s]=t[s]===a?1:t[s]===o?0:.5;else if(a===1/0)for(s=i;s<l;s+=e)t[s]=t[s]===a?1:0;else if(o===-1/0)for(s=i;s<l;s+=e)t[s]=t[s]===o?0:1;else{var c=a-o;for(s=i;s<l;s+=e)t[s]=0===c?.5:(t[s]-o)/c}}return t}},{"array-bounds":48}],50:[function(t,e,r){e.exports=function(t,e){var r="number"==typeof t,n="number"==typeof e;r&&!n?(e=t,t=0):r||n||(t=0,e=0);var i=(e|=0)-(t|=0);if(i<0)throw new Error("array length must be positive");for(var a=new Array(i),o=0,s=t;o<i;o++,s++)a[o]=s;return a}},{}],51:[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)}var a=t("util/"),o=Object.prototype.hasOwnProperty,s=Array.prototype.slice,l="foo"===function(){}.name;function c(t){return Object.prototype.toString.call(t)}function u(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))))}var f=e.exports=g,h=/\s*function\s+([^\(\s]*)\s*/;function d(t){if(a.isFunction(t)){if(l)return t.name;var e=t.toString().match(h);return e&&e[1]}}function p(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function m(t){if(l||!a.isFunction(t))return a.inspect(t);var e=d(t);return"[Function"+(e?": "+e:"")+"]"}function v(t,e,r,n,i){throw new f.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:i})}function g(t,e){t||v(t,!0,e,"==",f.ok)}function y(t,e,r,o){if(t===e)return!0;if(i(t)&&i(e))return 0===n(t,e);if(a.isDate(t)&&a.isDate(e))return t.getTime()===e.getTime();if(a.isRegExp(t)&&a.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(u(t)&&u(e)&&c(t)===c(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;var l=(o=o||{actual:[],expected:[]}).actual.indexOf(t);return-1!==l&&l===o.expected.indexOf(e)||(o.actual.push(t),o.expected.push(e),function(t,e,r,n){if(null===t||void 0===t||null===e||void 0===e)return!1;if(a.isPrimitive(t)||a.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var i=b(t),o=b(e);if(i&&!o||!i&&o)return!1;if(i)return t=s.call(t),e=s.call(e),y(t,e,r);var l,c,u=w(t),f=w(e);if(u.length!==f.length)return!1;for(u.sort(),f.sort(),c=u.length-1;c>=0;c--)if(u[c]!==f[c])return!1;for(c=u.length-1;c>=0;c--)if(l=u[c],!y(t[l],e[l],r,n))return!1;return!0}(t,e,r,o))}return r?t===e:t==e}function b(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function x(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function _(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&v(i,r,"Missing expected exception"+n);var o="string"==typeof n,s=!t&&a.isError(i),l=!t&&i&&!r;if((s&&o&&x(i,r)||l)&&v(i,r,"Got unwanted exception"+n),t&&i&&r&&!x(i,r)||!t&&i)throw i}f.AssertionError=function(t){var e;this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=p(m((e=this).actual),128)+" "+e.operator+" "+p(m(e.expected),128),this.generatedMessage=!0);var r=t.stackStartFunction||v;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var n=new Error;if(n.stack){var i=n.stack,a=d(r),o=i.indexOf("\n"+a);if(o>=0){var s=i.indexOf("\n",o+1);i=i.substring(s+1)}this.stack=i}}},a.inherits(f.AssertionError,Error),f.fail=v,f.ok=g,f.equal=function(t,e,r){t!=e&&v(t,e,r,"==",f.equal)},f.notEqual=function(t,e,r){t==e&&v(t,e,r,"!=",f.notEqual)},f.deepEqual=function(t,e,r){y(t,e,!1)||v(t,e,r,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(t,e,r){y(t,e,!0)||v(t,e,r,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(t,e,r){y(t,e,!1)&&v(t,e,r,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function t(e,r,n){y(e,r,!0)&&v(e,r,n,"notDeepStrictEqual",t)},f.strictEqual=function(t,e,r){t!==e&&v(t,e,r,"===",f.strictEqual)},f.notStrictEqual=function(t,e,r){t===e&&v(t,e,r,"!==",f.notStrictEqual)},f.throws=function(t,e,r){_(!0,t,e,r)},f.doesNotThrow=function(t,e,r){_(!1,t,e,r)},f.ifError=function(t){if(t)throw t};var w=Object.keys||function(t){var e=[];for(var r in t)o.call(t,r)&&e.push(r);return e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":543}],52:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],53:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=e.length,a=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];a[o]=s}a[r]=new Array(r+1);for(var o=0;o<=r;++o)a[r][o]=1;for(var c=new Array(r+1),o=0;o<r;++o)c[o]=e[o];c[r]=1;var u=n(a,c),f=i(u[r+1]);0===f&&(f=1);for(var h=new Array(r+1),o=0;o<=r;++o)h[o]=i(u[o])/f;return h};var n=t("robust-linear-solve");function i(t){for(var e=0,r=0;r<t.length;++r)e+=t[r];return e}},{"robust-linear-solve":494}],54:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}},{"./lib/rationalize":64}],55:[function(t,e,r){"use strict";e.exports=function(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}},{}],56:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]),t[1].mul(e[0]))}},{"./lib/rationalize":64}],57:[function(t,e,r){"use strict";var n=t("./is-rat"),i=t("./lib/is-bn"),a=t("./lib/num-to-bn"),o=t("./lib/str-to-bn"),s=t("./lib/rationalize"),l=t("./div");e.exports=function t(e,r){if(n(e))return r?l(e,t(r)):[e[0].clone(),e[1].clone()];var c=0;var u,f;if(i(e))u=e.clone();else if("string"==typeof e)u=o(e);else{if(0===e)return[a(0),a(1)];if(e===Math.floor(e))u=a(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),c-=256;u=a(e)}}if(n(r))u.mul(r[1]),f=r[0].clone();else if(i(r))f=r.clone();else if("string"==typeof r)f=o(r);else if(r)if(r===Math.floor(r))f=a(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),c+=256;f=a(r)}else f=a(1);c>0?u=u.ushln(c):c<0&&(f=f.ushln(-c));return s(u,f)}},{"./div":56,"./is-rat":58,"./lib/is-bn":62,"./lib/num-to-bn":63,"./lib/rationalize":64,"./lib/str-to-bn":65}],58:[function(t,e,r){"use strict";var n=t("./lib/is-bn");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{"./lib/is-bn":62}],59:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return t.cmp(new n(0))}},{"bn.js":73}],60:[function(t,e,r){"use strict";var n=t("./bn-sign");e.exports=function(t){var e=t.length,r=t.words,i=0;if(1===e)i=r[0];else if(2===e)i=r[0]+67108864*r[1];else for(var a=0;a<e;a++){var o=r[a];i+=o*Math.pow(67108864,a)}return n(t)*i}},{"./bn-sign":59}],61:[function(t,e,r){"use strict";var n=t("double-bits"),i=t("bit-twiddle").countTrailingZeros;e.exports=function(t){var e=i(n.lo(t));if(e<32)return e;var r=i(n.hi(t));if(r>20)return 52;return r+32}},{"bit-twiddle":71,"double-bits":131}],62:[function(t,e,r){"use strict";t("bn.js");e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":73}],63:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("double-bits");e.exports=function(t){var e=i.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},{"bn.js":73,"double-bits":131}],64:[function(t,e,r){"use strict";var n=t("./num-to-bn"),i=t("./bn-sign");e.exports=function(t,e){var r=i(t),a=i(e);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);if(o.cmpn(1))return[t.div(o),e.div(o)];return[t,e]}},{"./bn-sign":59,"./num-to-bn":63}],65:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return new n(t)}},{"bn.js":73}],66:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{"./lib/rationalize":64}],67:[function(t,e,r){"use strict";var n=t("./lib/bn-sign");e.exports=function(t){return n(t[0])*n(t[1])}},{"./lib/bn-sign":59}],68:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{"./lib/rationalize":64}],69:[function(t,e,r){"use strict";var n=t("./lib/bn-to-num"),i=t("./lib/ctz");e.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var a=e.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,c=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=i(s)+4,f=n(l.ushln(u).divRound(r));return c*(s+f*Math.pow(2,-u))}var h=r.bitLength()-l.bitLength()+53,f=n(l.ushln(h).divRound(r));return h<1023?c*f*Math.pow(2,-h):(f*=Math.pow(2,-1023),c*f*Math.pow(2,1023-h))}},{"./lib/bn-to-num":60,"./lib/ctz":61}],70:[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){return 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(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],71:[function(t,e,r){"use strict";"use restrict";function n(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(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,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<<i&255}}(i),r.reverse=function(t){return i[255&t]<<24|i[t>>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255]},r.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},r.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],72:[function(t,e,r){"use strict";var n=t("clamp");e.exports=function(t,e){e||(e={});var r,o,s,l,c,u,f,h,d,p,m,v=null==e.cutoff?.25:e.cutoff,g=null==e.radius?8:e.radius,y=e.channel||0;if(ArrayBuffer.isView(t)||Array.isArray(t)){if(!e.width||!e.height)throw Error("For raw data width and height should be provided by options");r=e.width,o=e.height,l=t,u=e.stride?e.stride:Math.floor(t.length/r/o)}else window.HTMLCanvasElement&&t instanceof window.HTMLCanvasElement?(f=(h=t).getContext("2d"),r=h.width,o=h.height,d=f.getImageData(0,0,r,o),l=d.data,u=4):window.CanvasRenderingContext2D&&t instanceof window.CanvasRenderingContext2D?(h=t.canvas,f=t,r=h.width,o=h.height,d=f.getImageData(0,0,r,o),l=d.data,u=4):window.ImageData&&t instanceof window.ImageData&&(d=t,r=t.width,o=t.height,l=d.data,u=4);if(s=Math.max(r,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(c=l,l=Array(r*o),p=0,m=c.length;p<m;p++)l[p]=c[p*u+y]/255;else if(1!==u)throw Error("Raw data can have only 1 value per pixel");var b=Array(r*o),x=Array(r*o),_=Array(s),w=Array(s),M=Array(s+1),k=Array(s);for(p=0,m=r*o;p<m;p++){var A=l[p];b[p]=1===A?0:0===A?i:Math.pow(Math.max(0,.5-A),2),x[p]=1===A?i:0===A?0:Math.pow(Math.max(0,A-.5),2)}a(b,r,o,_,w,k,M),a(x,r,o,_,w,k,M);var T=window.Float32Array?new Float32Array(r*o):new Array(r*o);for(p=0,m=r*o;p<m;p++)T[p]=n(1-((b[p]-x[p])/g+v),0,1);return T};var i=1e20;function a(t,e,r,n,i,a,s){for(var l=0;l<e;l++){for(var c=0;c<r;c++)n[c]=t[c*e+l];for(o(n,i,a,s,r),c=0;c<r;c++)t[c*e+l]=i[c]}for(c=0;c<r;c++){for(l=0;l<e;l++)n[l]=t[c*e+l];for(o(n,i,a,s,e),l=0;l<e;l++)t[c*e+l]=Math.sqrt(i[l])}}function o(t,e,r,n,a){r[0]=0,n[0]=-i,n[1]=+i;for(var o=1,s=0;o<a;o++){for(var l=(t[o]+o*o-(t[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);l<=n[s];)s--,l=(t[o]+o*o-(t[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);r[++s]=o,n[s]=l,n[s+1]=+i}for(o=0,s=0;o<a;o++){for(;n[s+1]<o;)s++;e[o]=(o-r[s])*(o-r[s])+t[r[s]]}}},{clamp:94}],73:[function(t,e,r){!function(e,r){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){if(a.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof e?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;try{o=t("buffer").Buffer}catch(t){}function s(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 l(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}a.isBN=function(t){return t instanceof a||null!==t&&"object"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,o,s=0;if("be"===r)for(i=t.length-1,a=0;i>=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i<t.length;i+=3)o=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,a=0;for(r=t.length-6,n=0;r>=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<<a&67108863,this.words[n+1]|=i>>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<<a&67108863,this.words[n+1]|=i>>>26-a&4194303),this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,s=Math.min(a,a-o)+r,c=0,u=r;u<s;u+=n)c=l(t,u,u+n,e),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==o){var f=1;for(c=l(t,u,t.length,e),u=0;u<o;u++)f*=e;this.imuln(f),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}},a.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},a.prototype.clone=function(){var t=new a(null);return this.copy(t),t},a.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var c=1;c<n;c++){for(var u=l>>>26,f=67108863&l,h=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=h;d++){var p=c-d|0;u+=(o=(i=0|t.words[p])*(a=0|e.words[d])+f)/67108864|0,f=67108863&o}r.words[c]=0|f,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}a.prototype.toString=function(t,e){var r;if(t=t||10,e=0|e||1,16===t||"hex"===t){r="";for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],l=(16777215&(s<<i|a)).toString(16);r=0!==(a=s>>>24-i&16777215)||o!==this.length-1?c[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=u[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:c[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,c=new t(a),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[s]=o;for(;s<a;s++)c[s]=0}else{for(s=0;s<a-i;s++)c[s]=0;for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[a-s-1]=o}return c},Math.clz32?a.prototype._countBits=function(t){return 32-Math.clz32(t)}:a.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},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},a.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},a.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},a.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},a.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},a.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;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()},a.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},a.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},a.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a<n.length;a++)e=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&e,i=e>>>26;for(;0!==i&&a<r.length;a++)e=(0|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},a.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var a=0,o=0;o<n.length;o++)a=(e=(0|r.words[o])-(0|n.words[o])+a)>>26,this.words[o]=67108863&e;for(;0!==a&&o<r.length;o++)a=(e=(0|r.words[o])+a)>>26,this.words[o]=67108863&e;if(0===a&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(t){return this.clone().isub(t)};var d=function(t,e,r){var n,i,a,o=t.words,s=e.words,l=r.words,c=0,u=0|o[0],f=8191&u,h=u>>>13,d=0|o[1],p=8191&d,m=d>>>13,v=0|o[2],g=8191&v,y=v>>>13,b=0|o[3],x=8191&b,_=b>>>13,w=0|o[4],M=8191&w,k=w>>>13,A=0|o[5],T=8191&A,E=A>>>13,S=0|o[6],L=8191&S,C=S>>>13,P=0|o[7],z=8191&P,O=P>>>13,D=0|o[8],I=8191&D,R=D>>>13,N=0|o[9],F=8191&N,j=N>>>13,B=0|s[0],U=8191&B,V=B>>>13,q=0|s[1],H=8191&q,G=q>>>13,Y=0|s[2],W=8191&Y,X=Y>>>13,Z=0|s[3],J=8191&Z,K=Z>>>13,Q=0|s[4],$=8191&Q,tt=Q>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ct=st>>>13,ut=0|s[8],ft=8191&ut,ht=ut>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(c+(n=Math.imul(f,U))|0)+((8191&(i=(i=Math.imul(f,V))+Math.imul(h,U)|0))<<13)|0;c=((a=Math.imul(h,V))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,V))+Math.imul(m,U)|0,a=Math.imul(m,V);var gt=(c+(n=n+Math.imul(f,H)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(h,H)|0))<<13)|0;c=((a=a+Math.imul(h,G)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,U),i=(i=Math.imul(g,V))+Math.imul(y,U)|0,a=Math.imul(y,V),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,H)|0,a=a+Math.imul(m,G)|0;var yt=(c+(n=n+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(h,W)|0))<<13)|0;c=((a=a+Math.imul(h,X)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,V))+Math.imul(_,U)|0,a=Math.imul(_,V),n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,G)|0)+Math.imul(y,H)|0,a=a+Math.imul(y,G)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,X)|0;var bt=(c+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(h,J)|0))<<13)|0;c=((a=a+Math.imul(h,K)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,U),i=(i=Math.imul(M,V))+Math.imul(k,U)|0,a=Math.imul(k,V),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(_,H)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(g,W)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(y,W)|0,a=a+Math.imul(y,X)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,J)|0,a=a+Math.imul(m,K)|0;var xt=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,$)|0))<<13)|0;c=((a=a+Math.imul(h,tt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,V))+Math.imul(E,U)|0,a=Math.imul(E,V),n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(k,H)|0,a=a+Math.imul(k,G)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,K)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,K)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((a=a+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(L,U),i=(i=Math.imul(L,V))+Math.imul(C,U)|0,a=Math.imul(C,V),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(E,H)|0,a=a+Math.imul(E,G)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,X)|0,n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,K)|0,n=n+Math.imul(g,$)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,$)|0,a=a+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,a=a+Math.imul(m,nt)|0;var wt=(c+(n=n+Math.imul(f,at)|0)|0)+((8191&(i=(i=i+Math.imul(f,ot)|0)+Math.imul(h,at)|0))<<13)|0;c=((a=a+Math.imul(h,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(z,U),i=(i=Math.imul(z,V))+Math.imul(O,U)|0,a=Math.imul(O,V),n=n+Math.imul(L,H)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(C,H)|0,a=a+Math.imul(C,G)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(E,W)|0,a=a+Math.imul(E,X)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,K)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(_,$)|0,a=a+Math.imul(_,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,a=a+Math.imul(y,nt)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ot)|0)+Math.imul(m,at)|0,a=a+Math.imul(m,ot)|0;var Mt=(c+(n=n+Math.imul(f,lt)|0)|0)+((8191&(i=(i=i+Math.imul(f,ct)|0)+Math.imul(h,lt)|0))<<13)|0;c=((a=a+Math.imul(h,ct)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,V))+Math.imul(R,U)|0,a=Math.imul(R,V),n=n+Math.imul(z,H)|0,i=(i=i+Math.imul(z,G)|0)+Math.imul(O,H)|0,a=a+Math.imul(O,G)|0,n=n+Math.imul(L,W)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(C,W)|0,a=a+Math.imul(C,X)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(E,J)|0,a=a+Math.imul(E,K)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(_,rt)|0,a=a+Math.imul(_,nt)|0,n=n+Math.imul(g,at)|0,i=(i=i+Math.imul(g,ot)|0)+Math.imul(y,at)|0,a=a+Math.imul(y,ot)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,a=a+Math.imul(m,ct)|0;var kt=(c+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;c=((a=a+Math.imul(h,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(F,U),i=(i=Math.imul(F,V))+Math.imul(j,U)|0,a=Math.imul(j,V),n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(R,H)|0,a=a+Math.imul(R,G)|0,n=n+Math.imul(z,W)|0,i=(i=i+Math.imul(z,X)|0)+Math.imul(O,W)|0,a=a+Math.imul(O,X)|0,n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,K)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,K)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(E,$)|0,a=a+Math.imul(E,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(k,rt)|0,a=a+Math.imul(k,nt)|0,n=n+Math.imul(x,at)|0,i=(i=i+Math.imul(x,ot)|0)+Math.imul(_,at)|0,a=a+Math.imul(_,ot)|0,n=n+Math.imul(g,lt)|0,i=(i=i+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,a=a+Math.imul(y,ct)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ft)|0,a=a+Math.imul(m,ht)|0;var At=(c+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((a=a+Math.imul(h,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(F,H),i=(i=Math.imul(F,G))+Math.imul(j,H)|0,a=Math.imul(j,G),n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(R,W)|0,a=a+Math.imul(R,X)|0,n=n+Math.imul(z,J)|0,i=(i=i+Math.imul(z,K)|0)+Math.imul(O,J)|0,a=a+Math.imul(O,K)|0,n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(E,rt)|0,a=a+Math.imul(E,nt)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ot)|0)+Math.imul(k,at)|0,a=a+Math.imul(k,ot)|0,n=n+Math.imul(x,lt)|0,i=(i=i+Math.imul(x,ct)|0)+Math.imul(_,lt)|0,a=a+Math.imul(_,ct)|0,n=n+Math.imul(g,ft)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(y,ft)|0,a=a+Math.imul(y,ht)|0;var Tt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((a=a+Math.imul(m,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(F,W),i=(i=Math.imul(F,X))+Math.imul(j,W)|0,a=Math.imul(j,X),n=n+Math.imul(I,J)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(R,J)|0,a=a+Math.imul(R,K)|0,n=n+Math.imul(z,$)|0,i=(i=i+Math.imul(z,tt)|0)+Math.imul(O,$)|0,a=a+Math.imul(O,tt)|0,n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(C,rt)|0,a=a+Math.imul(C,nt)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ot)|0)+Math.imul(E,at)|0,a=a+Math.imul(E,ot)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(k,lt)|0,a=a+Math.imul(k,ct)|0,n=n+Math.imul(x,ft)|0,i=(i=i+Math.imul(x,ht)|0)+Math.imul(_,ft)|0,a=a+Math.imul(_,ht)|0;var Et=(c+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((a=a+Math.imul(y,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(F,J),i=(i=Math.imul(F,K))+Math.imul(j,J)|0,a=Math.imul(j,K),n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(R,$)|0,a=a+Math.imul(R,tt)|0,n=n+Math.imul(z,rt)|0,i=(i=i+Math.imul(z,nt)|0)+Math.imul(O,rt)|0,a=a+Math.imul(O,nt)|0,n=n+Math.imul(L,at)|0,i=(i=i+Math.imul(L,ot)|0)+Math.imul(C,at)|0,a=a+Math.imul(C,ot)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(E,lt)|0,a=a+Math.imul(E,ct)|0,n=n+Math.imul(M,ft)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(k,ft)|0,a=a+Math.imul(k,ht)|0;var St=(c+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((a=a+Math.imul(_,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(F,$),i=(i=Math.imul(F,tt))+Math.imul(j,$)|0,a=Math.imul(j,tt),n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(R,rt)|0,a=a+Math.imul(R,nt)|0,n=n+Math.imul(z,at)|0,i=(i=i+Math.imul(z,ot)|0)+Math.imul(O,at)|0,a=a+Math.imul(O,ot)|0,n=n+Math.imul(L,lt)|0,i=(i=i+Math.imul(L,ct)|0)+Math.imul(C,lt)|0,a=a+Math.imul(C,ct)|0,n=n+Math.imul(T,ft)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(E,ft)|0,a=a+Math.imul(E,ht)|0;var Lt=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((a=a+Math.imul(k,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(F,rt),i=(i=Math.imul(F,nt))+Math.imul(j,rt)|0,a=Math.imul(j,nt),n=n+Math.imul(I,at)|0,i=(i=i+Math.imul(I,ot)|0)+Math.imul(R,at)|0,a=a+Math.imul(R,ot)|0,n=n+Math.imul(z,lt)|0,i=(i=i+Math.imul(z,ct)|0)+Math.imul(O,lt)|0,a=a+Math.imul(O,ct)|0,n=n+Math.imul(L,ft)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(C,ft)|0,a=a+Math.imul(C,ht)|0;var Ct=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(E,pt)|0))<<13)|0;c=((a=a+Math.imul(E,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(F,at),i=(i=Math.imul(F,ot))+Math.imul(j,at)|0,a=Math.imul(j,ot),n=n+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(R,lt)|0,a=a+Math.imul(R,ct)|0,n=n+Math.imul(z,ft)|0,i=(i=i+Math.imul(z,ht)|0)+Math.imul(O,ft)|0,a=a+Math.imul(O,ht)|0;var Pt=(c+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((a=a+Math.imul(C,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(F,lt),i=(i=Math.imul(F,ct))+Math.imul(j,lt)|0,a=Math.imul(j,ct),n=n+Math.imul(I,ft)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(R,ft)|0,a=a+Math.imul(R,ht)|0;var zt=(c+(n=n+Math.imul(z,pt)|0)|0)+((8191&(i=(i=i+Math.imul(z,mt)|0)+Math.imul(O,pt)|0))<<13)|0;c=((a=a+Math.imul(O,mt)|0)+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863,n=Math.imul(F,ft),i=(i=Math.imul(F,ht))+Math.imul(j,ft)|0,a=Math.imul(j,ht);var Ot=(c+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(R,pt)|0))<<13)|0;c=((a=a+Math.imul(R,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Dt=(c+(n=Math.imul(F,pt))|0)+((8191&(i=(i=Math.imul(F,mt))+Math.imul(j,pt)|0))<<13)|0;return c=((a=Math.imul(j,mt))+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,l[0]=vt,l[1]=gt,l[2]=yt,l[3]=bt,l[4]=xt,l[5]=_t,l[6]=wt,l[7]=Mt,l[8]=kt,l[9]=At,l[10]=Tt,l[11]=Et,l[12]=St,l[13]=Lt,l[14]=Ct,l[15]=Pt,l[16]=zt,l[17]=Ot,l[18]=Dt,0!==c&&(l[19]=c,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=h),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?h(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var o=i;i=0;for(var s=67108863&n,l=Math.min(a,e.length-1),c=Math.max(0,a-t.length+1);c<=l;c++){var u=a-c,f=(0|t.words[u])*(0|e.words[c]),h=67108863&f;s=67108863&(h=h+s|0),i+=(o=(o=o+(f/67108864|0)|0)+(h>>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},m.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},m.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o<a;o++)n[o]=e[t[o]],i[o]=r[t[o]]},m.prototype.transform=function(t,e,r,n,i,a){this.permute(a,t,e,r,n,i);for(var o=1;o<i;o<<=1)for(var s=o<<1,l=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),u=0;u<i;u+=s)for(var f=l,h=c,d=0;d<o;d++){var p=r[u+d],m=n[u+d],v=r[u+d+o],g=n[u+d+o],y=f*v-h*g;g=f*g+h*v,v=y,r[u+d]=p+v,n[u+d]=m+g,r[u+d+o]=p-v,n[u+d+o]=m-g,d!==s&&(y=l*f-c*h,h=l*h+c*f,f=y)}},m.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},m.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},m.prototype.convert13b=function(t,e,r,i){for(var a=0,o=0;o<e;o++)a+=0|t[o],r[2*o]=8191&a,a>>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o<i;++o)r[o]=0;n(0===a),n(0==(-8192&a))},m.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},m.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),a=this.stub(n),o=new Array(n),s=new Array(n),l=new Array(n),c=new Array(n),u=new Array(n),f=new Array(n),h=r.words;h.length=n,this.convert13b(t.words,t.length,o,n),this.convert13b(e.words,e.length,c,n),this.transform(o,a,s,l,n,i),this.transform(c,a,u,f,n,i);for(var d=0;d<n;d++){var p=s[d]*u[d]-l[d]*f[d];l[d]=s[d]*f[d]+l[d]*u[d],s[d]=p}return this.conjugate(s,l,n),this.transform(s,l,h,a,n,i),this.conjugate(h,a,n),this.normalize13b(h,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},a.prototype.mul=function(t){var e=new a(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},a.prototype.mulf=function(t){var e=new a(null);return e.words=new Array(this.length+t.length),p(this,t,e)},a.prototype.imul=function(t){return this.clone().mulTo(t,this)},a.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,a=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},a.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var s=this.words[e]&a,l=(0|this.words[e])-s<<r;this.words[e]=l|o,o=s>>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},a.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},a.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),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=r;if(i-=o,i=Math.max(0,i),l){for(var c=0;c<o;c++)l.words[c]=this.words[c];l.length=o}if(0===o);else if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var u=0;for(c=this.length-1;c>=0&&(0!==u||c>=i);c--){var f=0|this.words[c];this.words[c]=u<<26-a|f>>>a,u=f&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},a.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},a.prototype.maskn=function(t){return this.clone().imaskn(t)},a.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},a.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},a.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},a.prototype.addn=function(t){return this.clone().iaddn(t)},a.prototype.subn=function(t){return this.clone().isubn(t)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(t,e,r){var i,a,o=t.length+r;this._expand(o);var s=0;for(i=0;i<t.length;i++){a=(0|this.words[i+r])+s;var l=(0|t.words[i])*e;s=((a-=67108863&l)>>26)-(l/67108864|0),this.words[i+r]=67108863&a}for(;i<this.length-r;i++)s=(a=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(a=-(0|this.words[i])+s)>>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==e){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var u=n.clone()._ishlnsubmul(i,1,l);0===u.negative&&(n=u,s&&(s.words[l]=1));for(var f=l-1;f>=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,o,s},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),f=e.clone();!e.isZero();){for(var h=0,d=1;0==(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(f)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(l)):(r.isub(e),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(c)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,o=new a(1),s=new a(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;0==(e.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(e.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(i=0===e.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(t),i},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,o=r;0!==a&&o<this.length;o++){var s=0|this.words[o];a=(s+=a)>>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},a.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},a.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=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new w(t)},a.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).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},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},i(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var a=0|t.words[n];t.words[n-10]=(4194303&a)<<4|i>>>22,i=a}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(b,g),i(x,g),i(_,g),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new x;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e,e},w.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},w.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},w.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},w.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var f=this.pow(u,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=o;0!==d.cmp(s);){for(var m=d,v=0;0!==m.cmp(s);v++)m=m.redSqr();n(v<p);var g=this.pow(f,new a(1).iushln(p-v-1));h=h.redMul(g),f=g.redSqr(),d=d.redMul(f),p=v}return h},w.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},w.prototype.pow=function(t,e){if(e.isZero())return new a(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new a(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],o=0,s=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],u=l-1;u>=0;u--){var f=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new M(t)},i(M,w),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:82}],74:[function(t,e,r){"use strict";e.exports=function(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],c=l.length;for(r=0;r<c;++r){var u=o[s++]=new Array(c-1),f=0;for(n=0;n<c;++n)n!==r&&(u[f++]=l[n]);if(1&r){var h=u[1];u[1]=u[0],u[0]=h}}}return o}},{}],75:[function(t,e,r){"use strict";e.exports=function(t,e,r){switch(arguments.length){case 1:return n=[],c(i=t,i,u,!0),n;case 2:return"function"==typeof e?c(t,t,e,!0):function(t,e){return n=[],c(t,e,u,!1),n}(t,e);case 3:return c(t,e,r,!1);default:throw new Error("box-intersect: Invalid arguments")}var i};var n,i=t("typedarray-pool"),a=t("./lib/sweep"),o=t("./lib/intersect");function s(t,e){for(var r=0;r<t;++r)if(!(e[r]<=e[r+t]))return!0;return!1}function l(t,e,r,n){for(var i=0,a=0,o=0,l=t.length;o<l;++o){var c=t[o];if(!s(e,c)){for(var u=0;u<2*e;++u)r[i++]=c[u];n[a++]=o}}return a}function c(t,e,r,n){var s=t.length,c=e.length;if(!(s<=0||c<=0)){var u=t[0].length>>>1;if(!(u<=0)){var f,h=i.mallocDouble(2*u*s),d=i.mallocInt32(s);if((s=l(t,u,h,d))>0){if(1===u&&n)a.init(s),f=a.sweepComplete(u,r,0,s,h,d,0,s,h,d);else{var p=i.mallocDouble(2*u*c),m=i.mallocInt32(c);(c=l(e,u,p,m))>0&&(a.init(s+c),f=1===u?a.sweepBipartite(u,r,0,s,h,d,0,c,p,m):o(u,r,n,s,h,d,c,p,m),i.free(p),i.free(m))}i.free(h),i.free(d)}return f}}}function u(t,e){n.push([t,e])}},{"./lib/intersect":77,"./lib/sweep":81,"typedarray-pool":534}],76:[function(t,e,r){"use strict";var n="d",i="ax",a="vv",o="fp",s="es",l="rs",c="re",u="rb",f="ri",h="rp",d="bs",p="be",m="bb",v="bi",g="bp",y="rv",b="Q",x=[n,i,a,l,c,u,f,d,p,m,v];function _(t){var e="bruteForce"+(t?"Full":"Partial"),r=[],_=x.slice();t||_.splice(3,0,o);var w=["function "+e+"("+_.join()+"){"];function M(e,o){var _=function(t,e,r){var o="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),_=["function ",o,"(",x.join(),"){","var ",s,"=2*",n,";"],w="for(var i="+l+","+h+"="+s+"*"+l+";i<"+c+";++i,"+h+"+="+s+"){var x0="+u+"["+i+"+"+h+"],x1="+u+"["+i+"+"+h+"+"+n+"],xi="+f+"[i];",M="for(var j="+d+","+g+"="+s+"*"+d+";j<"+p+";++j,"+g+"+="+s+"){var y0="+m+"["+i+"+"+g+"],"+(r?"y1="+m+"["+i+"+"+g+"+"+n+"],":"")+"yi="+v+"[j];";return t?_.push(w,b,":",M):_.push(M,b,":",w),r?_.push("if(y1<x0||x1<y0)continue;"):e?_.push("if(y0<=x0||x1<y0)continue;"):_.push("if(y0<x0||x1<y0)continue;"),_.push("for(var k="+i+"+1;k<"+n+";++k){var r0="+u+"[k+"+h+"],r1="+u+"[k+"+n+"+"+h+"],b0="+m+"[k+"+g+"],b1="+m+"[k+"+n+"+"+g+"];if(r1<b0||b1<r0)continue "+b+";}var "+y+"="+a+"("),e?_.push("yi,xi"):_.push("xi,yi"),_.push(");if("+y+"!==void 0)return "+y+";}}}"),{name:o,code:_.join("")}}(e,o,t);r.push(_.code),w.push("return "+_.name+"("+x.join()+");")}w.push("if("+c+"-"+l+">"+p+"-"+d+"){"),t?(M(!0,!1),w.push("}else{"),M(!1,!1)):(w.push("if("+o+"){"),M(!0,!0),w.push("}else{"),M(!0,!1),w.push("}}else{if("+o+"){"),M(!1,!0),w.push("}else{"),M(!1,!1),w.push("}")),w.push("}}return "+e);var k=r.join("")+w.join("");return new Function(k)()}r.partial=_(!1),r.full=_(!0)},{}],77:[function(t,e,r){"use strict";e.exports=function(t,e,r,a,u,E,S,L,C){!function(t,e){var r=8*i.log2(e+1)*(t+1)|0,a=i.nextPow2(x*r);w.length<a&&(n.free(w),w=n.mallocInt32(a));var o=i.nextPow2(_*r);M<o&&(n.free(M),M=n.mallocDouble(o))}(t,a+S);var P,z=0,O=2*t;k(z++,0,0,a,0,S,r?16:0,-1/0,1/0),r||k(z++,0,0,S,0,a,1,-1/0,1/0);for(;z>0;){var D=(z-=1)*x,I=w[D],R=w[D+1],N=w[D+2],F=w[D+3],j=w[D+4],B=w[D+5],U=z*_,V=M[U],q=M[U+1],H=1&B,G=!!(16&B),Y=u,W=E,X=L,Z=C;if(H&&(Y=L,W=C,X=u,Z=E),!(2&B&&(N=v(t,I,R,N,Y,W,q),R>=N)||4&B&&(R=g(t,I,R,N,Y,W,V))>=N)){var J=N-R,K=j-F;if(G){if(t*J*(J+K)<d){if(void 0!==(P=l.scanComplete(t,I,e,R,N,Y,W,F,j,X,Z)))return P;continue}}else{if(t*Math.min(J,K)<f){if(void 0!==(P=o(t,I,e,H,R,N,Y,W,F,j,X,Z)))return P;continue}if(t*J*K<h){if(void 0!==(P=l.scanBipartite(t,I,e,H,R,N,Y,W,F,j,X,Z)))return P;continue}}var Q=p(t,I,R,N,Y,W,V,q);if(R<Q)if(t*(Q-R)<f){if(void 0!==(P=s(t,I+1,e,R,Q,Y,W,F,j,X,Z)))return P}else if(I===t-2){if(void 0!==(P=H?l.sweepBipartite(t,e,F,j,X,Z,R,Q,Y,W):l.sweepBipartite(t,e,R,Q,Y,W,F,j,X,Z)))return P}else k(z++,I+1,R,Q,F,j,H,-1/0,1/0),k(z++,I+1,F,j,R,Q,1^H,-1/0,1/0);if(Q<N){var $=c(t,I,F,j,X,Z),tt=X[O*$+I],et=m(t,I,$,j,X,Z,tt);if(et<j&&k(z++,I,Q,N,et,j,(4|H)+(G?16:0),tt,q),F<$&&k(z++,I,Q,N,F,$,(2|H)+(G?16:0),V,tt),$+1===et){if(void 0!==(P=G?T(t,I,e,Q,N,Y,W,$,X,Z[$]):A(t,I,e,H,Q,N,Y,W,$,X,Z[$])))return P}else if($<et){var rt;if(G){if(rt=y(t,I,Q,N,Y,W,tt),Q<rt){var nt=m(t,I,Q,rt,Y,W,tt);if(I===t-2){if(Q<nt&&void 0!==(P=l.sweepComplete(t,e,Q,nt,Y,W,$,et,X,Z)))return P;if(nt<rt&&void 0!==(P=l.sweepBipartite(t,e,nt,rt,Y,W,$,et,X,Z)))return P}else Q<nt&&k(z++,I+1,Q,nt,$,et,16,-1/0,1/0),nt<rt&&(k(z++,I+1,nt,rt,$,et,0,-1/0,1/0),k(z++,I+1,$,et,nt,rt,1,-1/0,1/0))}}else rt=H?b(t,I,Q,N,Y,W,tt):y(t,I,Q,N,Y,W,tt),Q<rt&&(I===t-2?P=H?l.sweepBipartite(t,e,$,et,X,Z,Q,rt,Y,W):l.sweepBipartite(t,e,Q,rt,Y,W,$,et,X,Z):(k(z++,I+1,Q,rt,$,et,H,-1/0,1/0),k(z++,I+1,$,et,Q,rt,1^H,-1/0,1/0)))}}}}};var n=t("typedarray-pool"),i=t("bit-twiddle"),a=t("./brute"),o=a.partial,s=a.full,l=t("./sweep"),c=t("./median"),u=t("./partition"),f=128,h=1<<22,d=1<<22,p=u("!(lo>=p0)&&!(p1>=hi)",["p0","p1"]),m=u("lo===p0",["p0"]),v=u("lo<p0",["p0"]),g=u("hi<=p0",["p0"]),y=u("lo<=p0&&p0<=hi",["p0"]),b=u("lo<p0&&p0<=hi",["p0"]),x=6,_=2,w=n.mallocInt32(1024),M=n.mallocDouble(1024);function k(t,e,r,n,i,a,o,s,l){var c=x*t;w[c]=e,w[c+1]=r,w[c+2]=n,w[c+3]=i,w[c+4]=a,w[c+5]=o;var u=_*t;M[u]=s,M[u+1]=l}function A(t,e,r,n,i,a,o,s,l,c,u){var f=2*t,h=l*f,d=c[h+e];t:for(var p=i,m=i*f;p<a;++p,m+=f){var v=o[m+e],g=o[m+e+t];if(!(d<v||g<d)&&(!n||d!==v)){for(var y,b=s[p],x=e+1;x<t;++x){v=o[m+x],g=o[m+x+t];var _=c[h+x],w=c[h+x+t];if(g<_||w<v)continue t}if(void 0!==(y=n?r(u,b):r(b,u)))return y}}}function T(t,e,r,n,i,a,o,s,l,c){var u=2*t,f=s*u,h=l[f+e];t:for(var d=n,p=n*u;d<i;++d,p+=u){var m=o[d];if(m!==c){var v=a[p+e],g=a[p+e+t];if(!(h<v||g<h)){for(var y=e+1;y<t;++y){v=a[p+y],g=a[p+y+t];var b=l[f+y],x=l[f+y+t];if(g<b||x<v)continue t}var _=r(m,c);if(void 0!==_)return _}}}}},{"./brute":76,"./median":78,"./partition":79,"./sweep":81,"bit-twiddle":71,"typedarray-pool":534}],78:[function(t,e,r){"use strict";e.exports=function(t,e,r,o,s,l){if(o<=r+1)return r;var c=r,u=o,f=o+r>>>1,h=2*t,d=f,p=s[h*f+e];for(;c<u;){if(u-c<i){a(t,e,c,u,s,l),p=s[h*f+e];break}var m=u-c,v=Math.random()*m+c|0,g=s[h*v+e],y=Math.random()*m+c|0,b=s[h*y+e],x=Math.random()*m+c|0,_=s[h*x+e];g<=b?_>=b?(d=y,p=b):g>=_?(d=v,p=g):(d=x,p=_):b>=_?(d=y,p=b):_>=g?(d=v,p=g):(d=x,p=_);for(var w=h*(u-1),M=h*d,k=0;k<h;++k,++w,++M){var A=s[w];s[w]=s[M],s[M]=A}var T=l[u-1];l[u-1]=l[d],l[d]=T,d=n(t,e,c,u-1,s,l,p);for(var w=h*(u-1),M=h*d,k=0;k<h;++k,++w,++M){var A=s[w];s[w]=s[M],s[M]=A}var T=l[u-1];if(l[u-1]=l[d],l[d]=T,f<d){for(u=d-1;c<u&&s[h*(u-1)+e]===p;)u-=1;u+=1}else{if(!(d<f))break;for(c=d+1;c<u&&s[h*c+e]===p;)c+=1}}return n(t,e,r,f,s,l,s[h*f+e])};var n=t("./partition")("lo<p0",["p0"]),i=8;function a(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 c=i[s],u=l,f=o*(l-1);u>r&&i[f+e]>c;--u,f-=o){for(var h=f,d=f+o,p=0;p<o;++p,++h,++d){var m=i[h];i[h]=i[d],i[d]=m}var v=a[u];a[u]=a[u-1],a[u-1]=v}}},{"./partition":79}],79:[function(t,e,r){"use strict";e.exports=function(t,e){var r="abcdef".split("").concat(e),i=[];t.indexOf("lo")>=0&&i.push("lo=e[k+n]");t.indexOf("hi")>=0&&i.push("hi=e[k+o]");return r.push(n.replace("_",i.join()).replace("$",t)),Function.apply(void 0,r)};var n="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m"},{}],80:[function(t,e,r){"use strict";e.exports=function(t,e){e<=4*n?i(0,e-1,t):function t(e,r,f){var h=(r-e+1)/6|0,d=e+h,p=r-h,m=e+r>>1,v=m-h,g=m+h,y=d,b=v,x=m,_=g,w=p,M=e+1,k=r-1,A=0;c(y,b,f)&&(A=y,y=b,b=A);c(_,w,f)&&(A=_,_=w,w=A);c(y,x,f)&&(A=y,y=x,x=A);c(b,x,f)&&(A=b,b=x,x=A);c(y,_,f)&&(A=y,y=_,_=A);c(x,_,f)&&(A=x,x=_,_=A);c(b,w,f)&&(A=b,b=w,w=A);c(b,x,f)&&(A=b,b=x,x=A);c(_,w,f)&&(A=_,_=w,w=A);var T=f[2*b];var E=f[2*b+1];var S=f[2*_];var L=f[2*_+1];var C=2*y;var P=2*x;var z=2*w;var O=2*d;var D=2*m;var I=2*p;for(var R=0;R<2;++R){var N=f[C+R],F=f[P+R],j=f[z+R];f[O+R]=N,f[D+R]=F,f[I+R]=j}o(v,e,f);o(g,r,f);for(var B=M;B<=k;++B)if(u(B,T,E,f))B!==M&&a(B,M,f),++M;else if(!u(B,S,L,f))for(;;){if(u(k,S,L,f)){u(k,T,E,f)?(s(B,M,k,f),++M,--k):(a(B,k,f),--k);break}if(--k<B)break}l(e,M-1,T,E,f);l(r,k+1,S,L,f);M-2-e<=n?i(e,M-2,f):t(e,M-2,f);r-(k+2)<=n?i(k+2,r,f):t(k+2,r,f);k-M<=n?i(M,k,f):t(M,k,f)}(0,e-1,t)};var n=32;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 c=r[l-2],u=r[l-1];if(c<a)break;if(c===a&&u<o)break;r[l]=c,r[l+1]=u,l-=2}r[l]=a,r[l+1]=o}}function a(t,e,r){e*=2;var n=r[t*=2],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){e*=2,r[t*=2]=r[e],r[t+1]=r[e+1]}function s(t,e,r,n){e*=2,r*=2;var i=n[t*=2],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){e*=2,i[t*=2]=i[e],i[e]=r,i[t+1]=i[e+1],i[e+1]=n}function c(t,e,r){e*=2;var n=r[t*=2],i=r[e];return!(n<i)&&(n!==i||r[t+1]>r[e+1])}function u(t,e,r,n){var i=n[t*=2];return i<e||i===e&&n[t+1]<r}},{}],81:[function(t,e,r){"use strict";e.exports={init:function(t){var e=i.nextPow2(t);s.length<e&&(n.free(s),s=n.mallocInt32(e));l.length<e&&(n.free(l),l=n.mallocInt32(e));c.length<e&&(n.free(c),c=n.mallocInt32(e));u.length<e&&(n.free(u),u=n.mallocInt32(e));f.length<e&&(n.free(f),f=n.mallocInt32(e));h.length<e&&(n.free(h),h=n.mallocInt32(e));var r=8*e;d.length<r&&(n.free(d),d=n.mallocDouble(r))},sweepBipartite:function(t,e,r,n,i,f,h,v,g,y){for(var b=0,x=2*t,_=t-1,w=x-1,M=r;M<n;++M){var k=f[M],A=x*M;d[b++]=i[A+_],d[b++]=-(k+1),d[b++]=i[A+w],d[b++]=k}for(var M=h;M<v;++M){var k=y[M]+o,T=x*M;d[b++]=g[T+_],d[b++]=-k,d[b++]=g[T+w],d[b++]=k}var E=b>>>1;a(d,E);for(var S=0,L=0,M=0;M<E;++M){var C=0|d[2*M+1];if(C>=o)p(c,u,L--,C=C-o|0);else if(C>=0)p(s,l,S--,C);else if(C<=-o){C=-C-o|0;for(var P=0;P<S;++P){var z=e(s[P],C);if(void 0!==z)return z}m(c,u,L++,C)}else{C=-C-1|0;for(var P=0;P<L;++P){var z=e(C,c[P]);if(void 0!==z)return z}m(s,l,S++,C)}}},sweepComplete:function(t,e,r,n,i,o,v,g,y,b){for(var x=0,_=2*t,w=t-1,M=_-1,k=r;k<n;++k){var A=o[k]+1<<1,T=_*k;d[x++]=i[T+w],d[x++]=-A,d[x++]=i[T+M],d[x++]=A}for(var k=v;k<g;++k){var A=b[k]+1<<1,E=_*k;d[x++]=y[E+w],d[x++]=1|-A,d[x++]=y[E+M],d[x++]=1|A}var S=x>>>1;a(d,S);for(var L=0,C=0,P=0,k=0;k<S;++k){var z=0|d[2*k+1],O=1&z;if(k<S-1&&z>>1==d[2*k+3]>>1&&(O=2,k+=1),z<0){for(var D=-(z>>1)-1,I=0;I<P;++I){var R=e(f[I],D);if(void 0!==R)return R}if(0!==O)for(var I=0;I<L;++I){var R=e(s[I],D);if(void 0!==R)return R}if(1!==O)for(var I=0;I<C;++I){var R=e(c[I],D);if(void 0!==R)return R}0===O?m(s,l,L++,D):1===O?m(c,u,C++,D):2===O&&m(f,h,P++,D)}else{var D=(z>>1)-1;0===O?p(s,l,L--,D):1===O?p(c,u,C--,D):2===O&&p(f,h,P--,D)}}},scanBipartite:function(t,e,r,n,i,c,u,f,h,v,g,y){var b=0,x=2*t,_=e,w=e+t,M=1,k=1;n?k=o:M=o;for(var A=i;A<c;++A){var T=A+M,E=x*A;d[b++]=u[E+_],d[b++]=-T,d[b++]=u[E+w],d[b++]=T}for(var A=h;A<v;++A){var T=A+k,S=x*A;d[b++]=g[S+_],d[b++]=-T}var L=b>>>1;a(d,L);for(var C=0,A=0;A<L;++A){var P=0|d[2*A+1];if(P<0){var T=-P,z=!1;if(T>=o?(z=!n,T-=o):(z=!!n,T-=1),z)m(s,l,C++,T);else{var O=y[T],D=x*T,I=g[D+e+1],R=g[D+e+1+t];t:for(var N=0;N<C;++N){var F=s[N],j=x*F;if(!(R<u[j+e+1]||u[j+e+1+t]<I)){for(var B=e+2;B<t;++B)if(g[D+B+t]<u[j+B]||u[j+B+t]<g[D+B])continue t;var U,V=f[F];if(void 0!==(U=n?r(O,V):r(V,O)))return U}}}}else p(s,l,C--,P-M)}},scanComplete:function(t,e,r,n,i,l,c,u,f,h,p){for(var m=0,v=2*t,g=e,y=e+t,b=n;b<i;++b){var x=b+o,_=v*b;d[m++]=l[_+g],d[m++]=-x,d[m++]=l[_+y],d[m++]=x}for(var b=u;b<f;++b){var x=b+1,w=v*b;d[m++]=h[w+g],d[m++]=-x}var M=m>>>1;a(d,M);for(var k=0,b=0;b<M;++b){var A=0|d[2*b+1];if(A<0){var x=-A;if(x>=o)s[k++]=x-o;else{var T=p[x-=1],E=v*x,S=h[E+e+1],L=h[E+e+1+t];t:for(var C=0;C<k;++C){var P=s[C],z=c[P];if(z===T)break;var O=v*P;if(!(L<l[O+e+1]||l[O+e+1+t]<S)){for(var D=e+2;D<t;++D)if(h[E+D+t]<l[O+D]||l[O+D+t]<h[E+D])continue t;var I=r(z,T);if(void 0!==I)return I}}}}else{for(var x=A-o,C=k-1;C>=0;--C)if(s[C]===x){for(var D=C+1;D<k;++D)s[D-1]=s[D];break}--k}}}};var n=t("typedarray-pool"),i=t("bit-twiddle"),a=t("./sort"),o=1<<28,s=n.mallocInt32(1024),l=n.mallocInt32(1024),c=n.mallocInt32(1024),u=n.mallocInt32(1024),f=n.mallocInt32(1024),h=n.mallocInt32(1024),d=n.mallocDouble(8192);function p(t,e,r,n){var i=e[n],a=t[r-1];t[i]=a,e[a]=i}function m(t,e,r,n){t[r]=n,e[n]=r}},{"./sort":80,"bit-twiddle":71,"typedarray-pool":534}],82:[function(t,e,r){},{}],83:[function(t,e,r){"use strict";var n=t("base64-js"),i=t("ieee754");r.Buffer=s,r.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},r.INSPECT_MAX_BYTES=50;var a=2147483647;function o(t){if(t>a)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=s.prototype,e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return u(t)}return l(t,e,r)}function l(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return B(t)?function(t,e,r){if(e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(r||0))throw new RangeError("'length' is out of bounds");var n;n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r);return n.__proto__=s.prototype,n}(t,e,r):"string"==typeof t?function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(t,e),n=o(r),i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e):function(t){if(s.isBuffer(t)){var e=0|h(t.length),r=o(e);return 0===r.length?r:(t.copy(r,0,0,e),r)}if(t){if(U(t)||"length"in t)return"number"!=typeof t.length||V(t.length)?o(0):f(t);if("Buffer"===t.type&&Array.isArray(t.data))return f(t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t)}function c(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){return c(t),o(t<0?0:0|h(t))}function f(t){for(var e=t.length<0?0:0|h(t.length),r=o(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function h(t){if(t>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|t}function d(t,e){if(s.isBuffer(t))return t.length;if(U(t)||B(t))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 N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(n)return N(t).length;e=(""+e).toLowerCase(),n=!0}}function p(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(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),V(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){var a,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var u=-1;for(a=r;a<s;a++)if(c(t,a)===c(e,-1===u?0:a-u)){if(-1===u&&(u=a),a-u+1===l)return u*o}else-1!==u&&(a-=a-u),u=-1}else for(r+l>s&&(r=s-l),a=r;a>=0;a--){for(var f=!0,h=0;h<l;h++)if(c(t,a+h)!==c(e,h)){f=!1;break}if(f)return a}return-1}function g(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(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(V(s))return o;t[r+o]=s}return o}function y(t,e,r,n){return j(N(e,t.length-r),t,r,n)}function b(t,e,r,n){return j(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function x(t,e,r,n){return b(t,e,r,n)}function _(t,e,r,n){return j(F(e),t,r,n)}function w(t,e,r,n){return j(function(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}(e,t.length-r),t,r,n)}function M(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function k(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var a,o,s,l,c=t[i],u=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(u=c);break;case 2:128==(192&(a=t[i+1]))&&(l=(31&c)<<6|63&a)>127&&(u=l);break;case 3:a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&(l=(15&c)<<12|(63&a)<<6|63&o)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(l=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,f=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=f}return function(t){var e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=A));return r}(n)}r.kMaxLength=a,s.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),s.poolSize=8192,s.from=function(t,e,r){return l(t,e,r)},s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,s.alloc=function(t,e,r){return function(t,e,r){return c(t),t<=0?o(t):void 0!==e?"string"==typeof r?o(t).fill(e,r):o(t).fill(e):o(t)}(t,e,r)},s.allocUnsafe=function(t){return u(t)},s.allocUnsafeSlow=function(t){return u(t)},s.isBuffer=function(t){return null!=t&&!0===t._isBuffer},s.compare=function(t,e){if(!s.isBuffer(t)||!s.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},s.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}},s.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=s.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var a=t[r];if(!s.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},s.byteLength=d,s.prototype._isBuffer=!0,s.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)p(this,e,e+1);return this},s.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)p(this,e,e+3),p(this,e+1,e+2);return this},s.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)p(this,e,e+7),p(this,e+1,e+6),p(this,e+2,e+5),p(this,e+3,e+4);return this},s.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?k(this,0,t):function(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))return"";for(t||(t="utf8");;)switch(t){case"hex":return S(this,e,r);case"utf8":case"utf-8":return k(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return E(this,e,r);case"base64":return M(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},s.prototype.compare=function(t,e,r,n,i){if(!s.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,o=r-e,l=Math.min(a,o),c=this.slice(n,i),u=t.slice(e,r),f=0;f<l;++f)if(c[f]!==u[f]){a=c[f],o=u[f];break}return a<o?-1:o<a?1:0},s.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},s.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},s.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},s.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 g(this,t,e,r);case"utf8":case"utf-8":return y(this,t,e,r);case"ascii":return b(this,t,e,r);case"latin1":case"binary":return x(this,t,e,r);case"base64":return _(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function T(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 E(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 S(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+=R(t[a]);return i}function L(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 C(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 P(t,e,r,n,i,a){if(!s.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 z(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 O(t,e,r,n,a){return e=+e,r>>>=0,a||z(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,a){return e=+e,r>>>=0,a||z(t,0,r,8),i.write(t,e,r,n,52,8),r+8}s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return n.__proto__=s.prototype,n},s.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return n},s.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*e)),a},s.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||C(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||P(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[e]=255&t;++a<r&&(i*=256);)this[e+a]=t/i&255;return e+r},s.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||P(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);P(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},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);P(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return O(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return O(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(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)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},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),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&&!s.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;var a;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(a=e;a<r;++a)this[a]=t;else{var o=s.isBuffer(t)?t:new s(t,n),l=o.length;for(a=0;a<r-e;++a)this[a+e]=o[a%l]}return this};var I=/[^+/0-9A-Za-z-_]/g;function R(t){return t<16?"0"+t.toString(16):t.toString(16)}function N(t,e){var r;e=e||1/0;for(var n=t.length,i=null,a=[],o=0;o<n;++o){if((r=t.charCodeAt(o))>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=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function F(t){return n.toByteArray(function(t){if((t=t.trim().replace(I,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function j(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 B(t){return t instanceof ArrayBuffer||null!=t&&null!=t.constructor&&"ArrayBuffer"===t.constructor.name&&"number"==typeof t.byteLength}function U(t){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function V(t){return t!=t}},{"base64-js":84,ieee754:257}],84:[function(t,e,r){"use strict";r.byteLength=function(t){return 3*t.length/4-c(t)},r.toByteArray=function(t){var e,r,n,o,s,l=t.length;o=c(t),s=new a(3*l/4-o),r=o>0?l-4:l;var u=0;for(e=0;e<r;e+=4)n=i[t.charCodeAt(e)]<<18|i[t.charCodeAt(e+1)]<<12|i[t.charCodeAt(e+2)]<<6|i[t.charCodeAt(e+3)],s[u++]=n>>16&255,s[u++]=n>>8&255,s[u++]=255&n;2===o?(n=i[t.charCodeAt(e)]<<2|i[t.charCodeAt(e+1)]>>4,s[u++]=255&n):1===o&&(n=i[t.charCodeAt(e)]<<10|i[t.charCodeAt(e+1)]<<4|i[t.charCodeAt(e+2)]>>2,s[u++]=n>>8&255,s[u++]=255&n);return s},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,a="",o=[],s=0,l=r-i;s<l;s+=16383)o.push(u(t,s,s+16383>l?l:s+16383));1===i?(e=t[r-1],a+=n[e>>2],a+=n[e<<4&63],a+="=="):2===i&&(e=(t[r-2]<<8)+t[r-1],a+=n[e>>10],a+=n[e>>4&63],a+=n[e<<2&63],a+="=");return o.push(a),o.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s<l;++s)n[s]=o[s],i[o.charCodeAt(s)]=s;function c(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 u(t,e,r){for(var i,a,o=[],s=e;s<r;s+=3)i=(t[s]<<16)+(t[s+1]<<8)+t[s+2],o.push(n[(a=i)>>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],85:[function(t,e,r){"use strict";var n=t("./lib/monotone"),i=t("./lib/triangulation"),a=t("./lib/delaunay"),o=t("./lib/filter");function s(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function l(t,e){return t[0]-e[0]||t[1]-e[1]}function c(t,e,r){return e in t?t[e]:r}e.exports=function(t,e,r){Array.isArray(e)?(r=r||{},e=e||[]):(r=e||{},e=[]);var u=!!c(r,"delaunay",!0),f=!!c(r,"interior",!0),h=!!c(r,"exterior",!0),d=!!c(r,"infinity",!1);if(!f&&!h||0===t.length)return[];var p=n(t,e);if(u||f!==h||d){for(var m=i(t.length,function(t){return t.map(s).sort(l)}(e)),v=0;v<p.length;++v){var g=p[v];m.addTriangle(g[0],g[1],g[2])}return u&&a(t,m),h?f?d?o(m,0,d):m.cells():o(m,1,d):o(m,-1)}return p}},{"./lib/delaunay":86,"./lib/filter":87,"./lib/monotone":88,"./lib/triangulation":89}],86:[function(t,e,r){"use strict";var n=t("robust-in-sphere")[4];t("binary-search-bounds");function i(t,e,r,i,a,o){var s=e.opposite(i,a);if(!(s<0)){if(a<i){var l=i;i=a,a=l,l=o,o=s,s=l}e.isConstraint(i,a)||n(t[i],t[a],t[o],t[s])<0&&r.push(i,a)}}e.exports=function(t,e){for(var r=[],a=t.length,o=e.stars,s=0;s<a;++s)for(var l=o[s],c=1;c<l.length;c+=2){var u=l[c];if(!(u<s)&&!e.isConstraint(s,u)){for(var f=l[c-1],h=-1,d=1;d<l.length;d+=2)if(l[d-1]===u){h=l[d];break}h<0||n(t[s],t[u],t[f],t[h])<0&&r.push(s,u)}}for(;r.length>0;){for(var u=r.pop(),s=r.pop(),f=-1,h=-1,l=o[s],p=1;p<l.length;p+=2){var m=l[p-1],v=l[p];m===u?h=v:v===u&&(f=m)}f<0||h<0||(n(t[s],t[u],t[f],t[h])>=0||(e.flip(s,u),i(t,e,r,f,s,h),i(t,e,r,s,h,f),i(t,e,r,h,u,f),i(t,e,r,u,f,h)))}}},{"binary-search-bounds":90,"robust-in-sphere":493}],87:[function(t,e,r){"use strict";var n,i=t("binary-search-bounds");function a(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 o(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}e.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,i=0;i<n;++i){var s=r[i],l=s[0],c=s[1],u=s[2];c<u?c<l&&(s[0]=c,s[1]=u,s[2]=l):u<l&&(s[0]=u,s[1]=l,s[2]=c)}r.sort(o);for(var f=new Array(n),i=0;i<f.length;++i)f[i]=0;var h=[],d=[],p=new Array(3*n),m=new Array(3*n),v=null;e&&(v=[]);for(var g=new a(r,p,m,f,h,d,v),i=0;i<n;++i)for(var s=r[i],y=0;y<3;++y){var l=s[y],c=s[(y+1)%3],b=p[3*i+y]=g.locate(c,l,t.opposite(c,l)),x=m[3*i+y]=t.isConstraint(l,c);b<0&&(x?d.push(i):(h.push(i),f[i]=1),e&&v.push([c,l,-1]))}return g}(t,r);if(0===e)return r?n.cells.concat(n.boundary):n.cells;var i=1,s=n.active,l=n.next,c=n.flags,u=n.cells,f=n.constraint,h=n.neighbor;for(;s.length>0||l.length>0;){for(;s.length>0;){var d=s.pop();if(c[d]!==-i){c[d]=i;u[d];for(var p=0;p<3;++p){var m=h[3*d+p];m>=0&&0===c[m]&&(f[3*d+p]?l.push(m):(s.push(m),c[m]=i))}}}var v=l;l=s,s=v,l.length=0,i=-i}var g=function(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}(u,c,e);if(r)return g.concat(n.boundary);return g},a.prototype.locate=(n=[0,0,0],function(t,e,r){var a=t,s=e,l=r;return e<r?e<t&&(a=e,s=r,l=t):r<t&&(a=r,s=t,l=e),a<0?-1:(n[0]=a,n[1]=s,n[2]=l,i.eq(this.cells,n,o))})},{"binary-search-bounds":90}],88:[function(t,e,r){"use strict";var n=t("binary-search-bounds"),i=t("robust-orientation")[3],a=0,o=1,s=2;function l(t,e,r,n,i){this.a=t,this.b=e,this.idx=r,this.lowerIds=n,this.upperIds=i}function c(t,e,r,n){this.a=t,this.b=e,this.type=r,this.idx=n}function u(t,e){var r=t.a[0]-e.a[0]||t.a[1]-e.a[1]||t.type-e.type;return r||(t.type!==a&&(r=i(t.a,t.b,e.b))?r:t.idx-e.idx)}function f(t,e){return i(t.a,t.b,e)}function h(t,e,r,a,o){for(var s=n.lt(e,a,f),l=n.gt(e,a,f),c=s;c<l;++c){for(var u=e[c],h=u.lowerIds,d=h.length;d>1&&i(r[h[d-2]],r[h[d-1]],a)>0;)t.push([h[d-1],h[d-2],o]),d-=1;h.length=d,h.push(o);var p=u.upperIds;for(d=p.length;d>1&&i(r[p[d-2]],r[p[d-1]],a)<0;)t.push([p[d-2],p[d-1],o]),d-=1;p.length=d,p.push(o)}}function d(t,e){var r;return(r=t.a[0]<e.a[0]?i(t.a,t.b,e.a):i(e.b,e.a,t.a))?r:(r=e.b[0]<t.b[0]?i(t.a,t.b,e.b):i(e.b,e.a,t.b))||t.idx-e.idx}function p(t,e,r){var i=n.le(t,r,d),a=t[i],o=a.upperIds,s=o[o.length-1];a.upperIds=[s],t.splice(i+1,0,new l(r.a,r.b,r.idx,[s],o))}function m(t,e,r){var i=r.a;r.a=r.b,r.b=i;var a=n.eq(t,r,d),o=t[a];t[a-1].upperIds=o.upperIds,t.splice(a,1)}e.exports=function(t,e){for(var r=t.length,n=e.length,i=[],f=0;f<r;++f)i.push(new c(t[f],null,a,f));for(var f=0;f<n;++f){var d=e[f],v=t[d[0]],g=t[d[1]];v[0]<g[0]?i.push(new c(v,g,s,f),new c(g,v,o,f)):v[0]>g[0]&&i.push(new c(g,v,s,f),new c(v,g,o,f))}i.sort(u);for(var y=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),b=[new l([y,1],[y,0],-1,[],[],[],[])],x=[],f=0,_=i.length;f<_;++f){var w=i[f],M=w.type;M===a?h(x,b,t,w.a,w.idx):M===s?p(b,t,w):m(b,t,w)}return x}},{"binary-search-bounds":90,"robust-orientation":495}],89:[function(t,e,r){"use strict";var n=t("binary-search-bounds");function i(t,e){this.stars=t,this.edges=e}e.exports=function(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=[];return new i(r,e)};var a=i.prototype;function o(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)}a.isConstraint=function(){var t=[0,0];function e(t,e){return t[0]-e[0]||t[1]-e[1]}return function(r,i){return t[0]=Math.min(r,i),t[1]=Math.max(r,i),n.eq(this.edges,t,e)>=0}}(),a.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},a.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},a.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;n<i;n+=2)if(r[n]===t)return r[n-1];return-1},a.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)},a.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},a.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":90}],90:[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){return 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(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],91:[function(t,e,r){"use strict";e.exports=function(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}},{}],92:[function(t,e,r){"use strict";var n=t("dup"),i=t("robust-linear-solve");function a(t,e){for(var r=0,n=t.length,i=0;i<n;++i)r+=t[i]*e[i];return r}function o(t){var e=t.length;if(0===e)return[];t[0].length;var r=n([t.length+1,t.length+1],1),o=n([t.length+1],1);r[e][e]=0;for(var s=0;s<e;++s){for(var l=0;l<=s;++l)r[l][s]=r[s][l]=2*a(t[s],t[l]);o[s]=a(t[s],t[s])}var c=i(r,o),u=0,f=c[e+1];for(s=0;s<f.length;++s)u+=f[s];var h=new Array(e);for(s=0;s<e;++s){f=c[s];var d=0;for(l=0;l<f.length;++l)d+=f[l];h[s]=d/u}return h}function s(t){if(0===t.length)return[];for(var e=t[0].length,r=n([e]),i=o(t),a=0;a<t.length;++a)for(var s=0;s<e;++s)r[s]+=t[a][s]*i[a];return r}s.barycenetric=o,e.exports=s},{dup:134,"robust-linear-solve":494}],93:[function(t,e,r){e.exports=function(t){for(var e=n(t),r=0,i=0;i<t.length;++i)for(var a=t[i],o=0;o<e.length;++o)r+=Math.pow(a[o]-e[o],2);return Math.sqrt(r/t.length)};var n=t("circumcenter")},{circumcenter:92}],94:[function(t,e,r){e.exports=function(t,e,r){return e<r?t<e?e:t>r?r:t:t<r?r:t>e?e:t}},{}],95:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n;if(r){n=e;for(var i=new Array(e.length),a=0;a<e.length;++a){var o=e[a];i[a]=[o[0],o[1],r[a]]}e=i}var s=function(t,e,r){var n=p(t,[],d(t));return g(e,n,r),!!n}(t,e,!!r);for(;y(t,e,!!r);)s=!0;if(r&&s){n.length=0,r.length=0;for(var a=0;a<e.length;++a){var o=e[a];n.push([o[0],o[1]]),r.push(o[2])}}return s};var n=t("union-find"),i=t("box-intersect"),a=t("robust-segment-intersect"),o=t("big-rat"),s=t("big-rat/cmp"),l=t("big-rat/to-float"),c=t("rat-vec"),u=t("nextafter"),f=t("./lib/rat-seg-intersect");function h(t){var e=l(t);return[u(e,-1/0),u(e,1/0)]}function d(t){for(var e=new Array(t.length),r=0;r<t.length;++r){var n=t[r];e[r]=[u(n[0],-1/0),u(n[1],-1/0),u(n[0],1/0),u(n[1],1/0)]}return e}function p(t,e,r){for(var a=e.length,o=new n(a),s=[],l=0;l<e.length;++l){var c=e[l],f=h(c[0]),d=h(c[1]);s.push([u(f[0],-1/0),u(d[0],-1/0),u(f[1],1/0),u(d[1],1/0)])}i(s,function(t,e){o.link(t,e)});var p=!0,m=new Array(a);for(l=0;l<a;++l){(g=o.find(l))!==l&&(p=!1,t[g]=[Math.min(t[l][0],t[g][0]),Math.min(t[l][1],t[g][1])])}if(p)return null;var v=0;for(l=0;l<a;++l){var g;(g=o.find(l))===l?(m[l]=v,t[v++]=t[l]):m[l]=-1}t.length=v;for(l=0;l<a;++l)m[l]<0&&(m[l]=m[o.find(l)]);return m}function m(t,e){return t[0]-e[0]||t[1]-e[1]}function v(t,e){var r=t[0]-e[0]||t[1]-e[1];return r||(t[2]<e[2]?-1:t[2]>e[2]?1:0)}function g(t,e,r){if(0!==t.length){if(e)for(var n=0;n<t.length;++n){var i=e[(o=t[n])[0]],a=e[o[1]];o[0]=Math.min(i,a),o[1]=Math.max(i,a)}else for(n=0;n<t.length;++n){var o;i=(o=t[n])[0],a=o[1];o[0]=Math.min(i,a),o[1]=Math.max(i,a)}r?t.sort(v):t.sort(m);var s=1;for(n=1;n<t.length;++n){var l=t[n-1],c=t[n];(c[0]!==l[0]||c[1]!==l[1]||r&&c[2]!==l[2])&&(t[s++]=c)}t.length=s}}function y(t,e,r){var n=function(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]=[u(Math.min(a[0],o[0]),-1/0),u(Math.min(a[1],o[1]),-1/0),u(Math.max(a[0],o[0]),1/0),u(Math.max(a[1],o[1]),1/0)]}return r}(t,e),h=function(t,e,r){var n=[];return i(r,function(r,i){var o=e[r],s=e[i];if(o[0]!==s[0]&&o[0]!==s[1]&&o[1]!==s[0]&&o[1]!==s[1]){var l=t[o[0]],c=t[o[1]],u=t[s[0]],f=t[s[1]];a(l,c,u,f)&&n.push([r,i])}}),n}(t,e,n),m=d(t),v=function(t,e,r,n){var o=[];return i(r,n,function(r,n){var i=e[r];if(i[0]!==n&&i[1]!==n){var s=t[n],l=t[i[0]],c=t[i[1]];a(l,c,s,s)&&o.push([r,n])}}),o}(t,e,n,m),y=p(t,function(t,e,r,n,i){var a,u,h=t.map(function(t){return[o(t[0]),o(t[1])]});for(a=0;a<r.length;++a){var d=r[a];u=d[0];var p=d[1],m=e[u],v=e[p],g=f(c(t[m[0]]),c(t[m[1]]),c(t[v[0]]),c(t[v[1]]));if(g){var y=t.length;t.push([l(g[0]),l(g[1])]),h.push(g),n.push([u,y],[p,y])}}for(n.sort(function(t,e){if(t[0]!==e[0])return t[0]-e[0];var r=h[t[1]],n=h[e[1]];return s(r[0],n[0])||s(r[1],n[1])}),a=n.length-1;a>=0;--a){var b=e[u=(E=n[a])[0]],x=b[0],_=b[1],w=t[x],M=t[_];if((w[0]-M[0]||w[1]-M[1])<0){var k=x;x=_,_=k}b[0]=x;var A,T=b[1]=E[1];for(i&&(A=b[2]);a>0&&n[a-1][0]===u;){var E,S=(E=n[--a])[1];i?e.push([T,S,A]):e.push([T,S]),T=S}i?e.push([T,_,A]):e.push([T,_])}return h}(t,e,h,v,r));return g(e,y,r),!!y||(h.length>0||v.length>0)}},{"./lib/rat-seg-intersect":96,"big-rat":57,"big-rat/cmp":55,"big-rat/to-float":69,"box-intersect":75,nextafter:440,"rat-vec":477,"robust-segment-intersect":498,"union-find":535}],96:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var a=s(e,t),f=s(n,r),h=u(a,f);if(0===o(h))return null;var d=s(t,r),p=u(f,d),m=i(p,h),v=c(a,m);return l(t,v)};var n=t("big-rat/mul"),i=t("big-rat/div"),a=t("big-rat/sub"),o=t("big-rat/sign"),s=t("rat-vec/sub"),l=t("rat-vec/add"),c=t("rat-vec/muls");function u(t,e){return a(n(t[0],e[1]),n(t[1],e[0]))}},{"big-rat/div":56,"big-rat/mul":66,"big-rat/sign":67,"big-rat/sub":68,"rat-vec/add":476,"rat-vec/muls":478,"rat-vec/sub":479}],97:[function(t,e,r){"use strict";var n=t("clamp");function i(t,e){null==e&&(e=!0);var r=t[0],i=t[1],a=t[2],o=t[3];return null==o&&(o=e?1:255),e&&(r*=255,i*=255,a*=255,o*=255),16777216*(r=255&n(r,0,255))+((i=255&n(i,0,255))<<16)+((a=255&n(a,0,255))<<8)+(o=255&n(o,0,255))}e.exports=i,e.exports.to=i,e.exports.from=function(t,e){var r=(t=+t)>>>24,n=(16711680&t)>>>16,i=(65280&t)>>>8,a=255&t;return!1===e?[r,n,i,a]:[r/255,n/255,i/255,a/255]}},{clamp:94}],98:[function(t,e,r){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],99:[function(t,e,r){"use strict";var n=t("color-rgba"),i=t("clamp"),a=t("dtype");e.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var r=a(e),o=new r(4);if(t instanceof r)return Array.isArray(t)?t.slice():(o.set(t),o);var s="uint8"!==e&&"uint8_clamped"!==e;return t instanceof Uint8Array||t instanceof Uint8ClampedArray?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:255,s&&(o[0]/=255,o[1]/=255,o[2]/=255,o[3]/=255),o):(t.length&&"string"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),s?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:1):(o[0]=i(Math.round(255*t[0]),0,255),o[1]=i(Math.round(255*t[1]),0,255),o[2]=i(Math.round(255*t[2]),0,255),o[3]=null==t[3]?255:i(Math.floor(255*t[3]),0,255)),o)}},{clamp:94,"color-rgba":101,dtype:133}],100:[function(t,e,r){(function(r){"use strict";var n=t("color-name"),i=t("is-plain-obj"),a=t("defined");e.exports=function(t){var e,s,l=[],c=1;if("string"==typeof t)if(n[t])l=n[t].slice(),s="rgb";else if("transparent"===t)c=0,s="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var u=t.slice(1),f=u.length,h=f<=4;c=1,h?(l=[parseInt(u[0]+u[0],16),parseInt(u[1]+u[1],16),parseInt(u[2]+u[2],16)],4===f&&(c=parseInt(u[3]+u[3],16)/255)):(l=[parseInt(u[0]+u[1],16),parseInt(u[2]+u[3],16),parseInt(u[4]+u[5],16)],8===f&&(c=parseInt(u[6]+u[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var d=e[1],u=d.replace(/a$/,"");s=u;var f="cmyk"===u?4:"gray"===u?1:3;l=e[2].trim().split(/\s*,\s*/).map(function(t,e){if(/%$/.test(t))return e===f?parseFloat(t)/100:"rgb"===u?255*parseFloat(t)/100:parseFloat(t);if("h"===u[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)}),d===u&&l.push(1),c=void 0===l[f]?1:l[f],l=l.slice(0,f)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(l=t.match(/([0-9]+)/g).map(function(t){return parseFloat(t)}),s=t.match(/([a-z])/gi).join("").toLowerCase());else if("number"==typeof t)s="rgb",l=[t>>>16,(65280&t)>>>8,255&t];else if(i(t)){var p=a(t.r,t.red,t.R,null);null!==p?(s="rgb",l=[p,a(t.g,t.green,t.G),a(t.b,t.blue,t.B)]):(s="hsl",l=[a(t.h,t.hue,t.H),a(t.s,t.saturation,t.S),a(t.l,t.lightness,t.L,t.b,t.brightness)]),c=a(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(c/=100)}else(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(l=[t[0],t[1],t[2]],s="rgb",c=4===t.length?t[3]:1);return{space:s,values:l,alpha:c}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":98,defined:129,"is-plain-obj":266}],101:[function(t,e,r){"use strict";var n=t("color-parse"),i=t("color-space/hsl"),a=t("clamp");e.exports=function(t){var e;if("string"!=typeof t)throw Error("Argument should be a string");var r=n(t);return r.space?((e=Array(3))[0]=a(r.values[0],0,255),e[1]=a(r.values[1],0,255),e[2]=a(r.values[2],0,255),"h"===r.space[0]&&(e=i.rgb(e)),e.push(a(r.alpha,0,1)),e):[]}},{clamp:94,"color-parse":100,"color-space/hsl":102}],102:[function(t,e,r){"use strict";var n=t("./rgb");e.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,r,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[a=255*l,a,a];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var c=0;c<3;c++)(n=o+1/3*-(c-1))<0?n++:n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[c]=255*a;return i}},n.hsl=function(t){var e,r,n=t[0]/255,i=t[1]/255,a=t[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o;return s===o?e=0:n===s?e=(i-a)/l:i===s?e=2+(a-n)/l:a===s&&(e=4+(n-i)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(o+s)/2,[e,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}},{"./rgb":103}],103:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],104:[function(t,e,r){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},{}],105:[function(t,e,r){"use strict";var n=t("./colorScale"),i=t("lerp");function a(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function o(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function s(t){return"rgba("+t.join(",")+")"}e.exports=function(t){var e,r,l,c,u,f,h,d,p,m;t||(t={});d=(t.nshades||72)-1,h=t.format||"hex",(f=t.colormap)||(f="jet");if("string"==typeof f){if(f=f.toLowerCase(),!n[f])throw Error(f+" not a supported colorscale");u=n[f]}else{if(!Array.isArray(f))throw Error("unsupported colormap option",f);u=f.slice()}if(u.length>d)throw new Error(f+" map requires nshades to be at least size "+u.length);p=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1];e=u.map(function(t){return Math.round(t.index*d)}),p[0]=Math.min(Math.max(p[0],0),1),p[1]=Math.min(Math.max(p[1],0),1);var v=u.map(function(t,e){var r=u[e].index,n=u[e].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1?n:(n[3]=p[0]+(p[1]-p[0])*r,n)}),g=[];for(m=0;m<e.length-1;++m){c=e[m+1]-e[m],r=v[m],l=v[m+1];for(var y=0;y<c;y++){var b=y/c;g.push([Math.round(i(r[0],l[0],b)),Math.round(i(r[1],l[1],b)),Math.round(i(r[2],l[2],b)),i(r[3],l[3],b)])}}g.push(u[u.length-1].rgb.concat(p[1])),"hex"===h?g=g.map(o):"rgbaString"===h?g=g.map(s):"float"===h&&(g=g.map(a));return g}},{"./colorScale":104,lerp:273}],106:[function(t,e,r){"use strict";e.exports=function(t,e,r,a){var o=n(e,r,a);if(0===o){var s=i(n(t,e,r)),c=i(n(t,e,a));if(s===c){if(0===s){var u=l(t,e,r),f=l(t,e,a);return u===f?0:u?1:-1}return 0}return 0===c?s>0?-1:l(t,e,a)?-1:1:0===s?c>0?1:l(t,e,r)?1:-1:i(c-s)}var h=n(t,e,r);if(h>0)return o>0&&n(t,e,a)>0?1:-1;if(h<0)return o>0||n(t,e,a)>0?1:-1;var d=n(t,e,a);return d>0?1:l(t,e,r)?1:-1};var n=t("robust-orientation"),i=t("signum"),a=t("two-sum"),o=t("robust-product"),s=t("robust-sum");function l(t,e,r){var n=a(t[0],-e[0]),i=a(t[1],-e[1]),l=a(r[0],-e[0]),c=a(r[1],-e[1]),u=s(o(n,l),o(i,c));return u[u.length-1]>=0}},{"robust-orientation":495,"robust-product":496,"robust-sum":500,signum:502,"two-sum":533}],107:[function(t,e,r){e.exports=function(t,e){var r=t.length,a=t.length-e.length;if(a)return a;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||n(t[0],t[1])-n(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(a=o+t[2]-(s+e[2]))return a;var l=n(t[0],t[1]),c=n(e[0],e[1]);return n(l,t[2])-n(c,e[2])||n(l+t[2],o)-n(c+e[2],s);case 4:var u=t[0],f=t[1],h=t[2],d=t[3],p=e[0],m=e[1],v=e[2],g=e[3];return u+f+h+d-(p+m+v+g)||n(u,f,h,d)-n(p,m,v,g,p)||n(u+f,u+h,u+d,f+h,f+d,h+d)-n(p+m,p+v,p+g,m+v,m+g,v+g)||n(u+f+h,u+f+d,u+h+d,f+h+d)-n(p+m+v,p+m+g,p+v+g,m+v+g);default:for(var y=t.slice().sort(i),b=e.slice().sort(i),x=0;x<r;++x)if(a=y[x]-b[x])return a;return 0}};var n=Math.min;function i(t,e){return t-e}},{}],108:[function(t,e,r){"use strict";var n=t("compare-cell"),i=t("cell-orientation");e.exports=function(t,e){return n(t,e)||i(t)-i(e)}},{"cell-orientation":91,"compare-cell":107}],109:[function(t,e,r){"use strict";var n=t("./lib/ch1d"),i=t("./lib/ch2d"),a=t("./lib/chnd");e.exports=function(t){var e=t.length;if(0===e)return[];if(1===e)return[[0]];var r=t[0].length;if(0===r)return[];if(1===r)return n(t);if(2===r)return i(t);return a(t,r)}},{"./lib/ch1d":110,"./lib/ch2d":111,"./lib/chnd":112}],110:[function(t,e,r){"use strict";e.exports=function(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]]}},{}],111:[function(t,e,r){"use strict";e.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var i=new Array(r),a=e[r-1],o=0;o<r;++o){var s=e[o];i[o]=[a,s],a=s}return i};var n=t("monotone-convex-hull-2d")},{"monotone-convex-hull-2d":423}],112:[function(t,e,r){"use strict";e.exports=function(t,e){try{return n(t,!0)}catch(s){var r=i(t);if(r.length<=e)return[];var a=function(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}(t,r),o=n(a,!0);return function(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}(o,r)}};var n=t("incremental-convex-hull"),i=t("affine-hull")},{"affine-hull":45,"incremental-convex-hull":258}],113:[function(t,e,r){e.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|\xe7)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|\xe9)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|\xe9)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|\xe3)o.?tom(e|\xe9)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},{}],114:[function(t,e,r){var n={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]};function i(t){return(t=Math.round(t))<0?0:t>255?255:t}function a(t){return t<0?0:t>1?1:t}function o(t){return"%"===t[t.length-1]?i(parseFloat(t)/100*255):i(parseInt(t))}function s(t){return"%"===t[t.length-1]?a(parseFloat(t)/100):a(parseFloat(t))}function l(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{r.parseCSSColor=function(t){var e,r=t.replace(/ /g,"").toLowerCase();if(r in n)return n[r].slice();if("#"===r[0])return 4===r.length?(e=parseInt(r.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===r.length&&(e=parseInt(r.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var a=r.indexOf("("),c=r.indexOf(")");if(-1!==a&&c+1===r.length){var u=r.substr(0,a),f=r.substr(a+1,c-(a+1)).split(","),h=1;switch(u){case"rgba":if(4!==f.length)return null;h=s(f.pop());case"rgb":return 3!==f.length?null:[o(f[0]),o(f[1]),o(f[2]),h];case"hsla":if(4!==f.length)return null;h=s(f.pop());case"hsl":if(3!==f.length)return null;var d=(parseFloat(f[0])%360+360)%360/360,p=s(f[1]),m=s(f[2]),v=m<=.5?m*(p+1):m+p-m*p,g=2*m-v;return[i(255*l(g,v,d+1/3)),i(255*l(g,v,d)),i(255*l(g,v,d-1/3)),h];default:return null}}return null}}catch(t){}},{}],115:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,c=(1+2*i)*l,u=i*l,f=s*(3-2*i),h=s*o;if(t.length){a||(a=new Array(t.length));for(var d=t.length-1;d>=0;--d)a[d]=c*t[d]+u*e[d]+f*r[d]+h*n[d];return a}return c*t+u*e+f*r+h*n},e.exports.derivative=function(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,c=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var u=t.length-1;u>=0;--u)a[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return a}return o*t+s*e+l*r[u]+c*n}},{}],116:[function(t,e,r){"use strict";var n=t("./lib/thunk.js");e.exports=function(t){var e=new function(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1};e.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 a=r[i];if("array"===a||"object"==typeof a&&a.blockIndices){if(e.argTypes[i]="array",e.arrayArgs.push(i),e.arrayBlockIndices.push(a.blockIndices?a.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"===a)e.scalarArgs.push(i),e.shimArgs.push("scalar"+i);else if("index"===a){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"===a){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 a||!a.offset)throw new Error("cwise: Unknown argument type "+r[i]);e.argTypes[i]="offset",e.offsetArgs.push({array:a.array,offset:a.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,n(e)}},{"./lib/thunk.js":118}],117:[function(t,e,r){"use strict";var n=t("uniq");function i(t,e,r){var n,i,a=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],c=[],u=0,f=0;for(n=0;n<a;++n)c.push(["i",n,"=0"].join(""));for(i=0;i<o;++i)for(n=0;n<a;++n)f=u,u=t[n],0===n?c.push(["d",i,"s",n,"=t",i,"p",u].join("")):c.push(["d",i,"s",n,"=(t",i,"p",u,"-s",f,"*t",i,"p",f,")"].join(""));for(c.length>0&&l.push("var "+c.join(",")),n=a-1;n>=0;--n)u=t[n],l.push(["for(i",n,"=0;i",n,"<s",u,";++i",n,"){"].join(""));for(l.push(r),n=0;n<a;++n){for(f=u,u=t[n],i=0;i<o;++i)l.push(["p",i,"+=d",i,"s",n].join(""));s&&(n>0&&l.push(["index[",f,"]-=s",f].join("")),l.push(["++index[",u,"]"].join(""))),l.push("}")}return l.join("\n")}function a(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"),c="",u=e.arrayArgs.indexOf(o);switch(e.argTypes[o]){case"offset":var f=e.offsetArgIndex.indexOf(o);u=e.offsetArgs[f].array,c="+q"+f;case"array":c="p"+u+c;var h="l"+o,d="a"+u;if(0===e.arrayBlockIndices[u])1===s.count?"generic"===r[u]?s.lvalue?(i.push(["var ",h,"=",d,".get(",c,")"].join("")),n=n.replace(l,h),a.push([d,".set(",c,",",h,")"].join(""))):n=n.replace(l,[d,".get(",c,")"].join("")):n=n.replace(l,[d,"[",c,"]"].join("")):"generic"===r[u]?(i.push(["var ",h,"=",d,".get(",c,")"].join("")),n=n.replace(l,h),s.lvalue&&a.push([d,".set(",c,",",h,")"].join(""))):(i.push(["var ",h,"=",d,"[",c,"]"].join("")),n=n.replace(l,h),s.lvalue&&a.push([d,"[",c,"]=",h].join("")));else{for(var p=[s.name],m=[c],v=0;v<Math.abs(e.arrayBlockIndices[u]);v++)p.push("\\s*\\[([^\\]]+)\\]"),m.push("$"+(v+1)+"*t"+u+"b"+v);if(l=new RegExp(p.join(""),"g"),c=m.join("+"),"generic"===r[u])throw new Error("cwise: Generic arrays not supported in combination with blocks!");n=n.replace(l,[d,"[",c,"]"].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()}e.exports=function(t,e){for(var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,o=new Array(t.arrayArgs.length),s=new Array(t.arrayArgs.length),l=0;l<t.arrayArgs.length;++l)s[l]=e[2*l],o[l]=e[2*l+1];var c=[],u=[],f=[],h=[],d=[];for(l=0;l<t.arrayArgs.length;++l){t.arrayBlockIndices[l]<0?(f.push(0),h.push(r),c.push(r),u.push(r+t.arrayBlockIndices[l])):(f.push(t.arrayBlockIndices[l]),h.push(t.arrayBlockIndices[l]+r),c.push(0),u.push(t.arrayBlockIndices[l]));for(var p=[],m=0;m<o[l].length;m++)f[l]<=o[l][m]&&o[l][m]<h[l]&&p.push(o[l][m]-f[l]);d.push(p)}var v=["SS"],g=["'use strict'"],y=[];for(m=0;m<r;++m)y.push(["s",m,"=SS[",m,"]"].join(""));for(l=0;l<t.arrayArgs.length;++l){for(v.push("a"+l),v.push("t"+l),v.push("p"+l),m=0;m<r;++m)y.push(["t",l,"p",m,"=t",l,"[",f[l]+m,"]"].join(""));for(m=0;m<Math.abs(t.arrayBlockIndices[l]);++m)y.push(["t",l,"b",m,"=t",l,"[",c[l]+m,"]"].join(""))}for(l=0;l<t.scalarArgs.length;++l)v.push("Y"+l);if(t.shapeArgs.length>0&&y.push("shape=SS.slice(0)"),t.indexArgs.length>0){var b=new Array(r);for(l=0;l<r;++l)b[l]="0";y.push(["index=[",b.join(","),"]"].join(""))}for(l=0;l<t.offsetArgs.length;++l){var x=t.offsetArgs[l],_=[];for(m=0;m<x.offset.length;++m)0!==x.offset[m]&&(1===x.offset[m]?_.push(["t",x.array,"p",m].join("")):_.push([x.offset[m],"*t",x.array,"p",m].join("")));0===_.length?y.push("q"+l+"=0"):y.push(["q",l,"=",_.join("+")].join(""))}var w=n([].concat(t.pre.thisVars).concat(t.body.thisVars).concat(t.post.thisVars));for((y=y.concat(w)).length>0&&g.push("var "+y.join(",")),l=0;l<t.arrayArgs.length;++l)g.push("p"+l+"|=0");t.pre.body.length>3&&g.push(a(t.pre,t,s));var M=a(t.body,t,s),k=function(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}(d);k<r?g.push(function(t,e,r,n){for(var a=e.length,o=r.arrayArgs.length,s=r.blockSize,l=r.indexArgs.length>0,c=[],u=0;u<o;++u)c.push(["var offset",u,"=p",u].join(""));for(u=t;u<a;++u)c.push(["for(var j"+u+"=SS[",e[u],"]|0;j",u,">0;){"].join("")),c.push(["if(j",u,"<",s,"){"].join("")),c.push(["s",e[u],"=j",u].join("")),c.push(["j",u,"=0"].join("")),c.push(["}else{s",e[u],"=",s].join("")),c.push(["j",u,"-=",s,"}"].join("")),l&&c.push(["index[",e[u],"]=j",u].join(""));for(u=0;u<o;++u){for(var f=["offset"+u],h=t;h<a;++h)f.push(["j",h,"*t",u,"p",e[h]].join(""));c.push(["p",u,"=(",f.join("+"),")"].join(""))}for(c.push(i(e,r,n)),u=t;u<a;++u)c.push("}");return c.join("\n")}(k,d[0],t,M)):g.push(i(d[0],t,M)),t.post.body.length>3&&g.push(a(t.post,t,s)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+g.join("\n")+"\n----------");var A=[t.funcName||"unnamed","_cwise_loop_",o[0].join("s"),"m",k,function(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("")}(s)].join("");return new Function(["function ",A,"(",v.join(","),"){",g.join("\n"),"} return ",A].join(""))()}},{uniq:536}],118:[function(t,e,r){"use strict";var n=t("./compile.js");e.exports=function(t){var e=["'use strict'","var CACHED={}"],r=[],i=t.funcName+"_cwise_thunk";e.push(["return function ",i,"(",t.shimArgs.join(","),"){"].join(""));for(var a=[],o=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],l=[],c=[],u=0;u<t.arrayArgs.length;++u){var f=t.arrayArgs[u];r.push(["t",f,"=array",f,".dtype,","r",f,"=array",f,".order"].join("")),a.push("t"+f),a.push("r"+f),o.push("t"+f),o.push("r"+f+".join()"),s.push("array"+f+".data"),s.push("array"+f+".stride"),s.push("array"+f+".offset|0"),u>0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[u]))),c.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[u])+"]"))}for(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 (!("+c.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}")),u=0;u<t.scalarArgs.length;++u)s.push("scalar"+t.scalarArgs[u]);return 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----------"),new Function("compile",e.join("\n"))(n.bind(void 0,t))}},{"./compile.js":117}],119:[function(t,e,r){e.exports=t("cwise-compiler")},{"cwise-compiler":116}],120:[function(t,e,r){var n;n=this,function(t){"use strict";var e=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN},r=function(t){var r;return 1===t.length&&(r=t,t=function(t,n){return e(r(t),n)}),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n<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(null==n&&(n=0),null==i&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)>0?i=a:n=a+1}return n}}};var n=r(e),i=n.right,a=n.left;function o(t,e){return[t,e]}var s=function(t){return null===t?NaN:+t},l=function(t,e){var r,n,i=t.length,a=0,o=-1,l=0,c=0;if(null==e)for(;++o<i;)isNaN(r=s(t[o]))||(c+=(n=r-l)*(r-(l+=n/++a)));else for(;++o<i;)isNaN(r=s(e(t[o],o,t)))||(c+=(n=r-l)*(r-(l+=n/++a)));if(a>1)return c/(a-1)},c=function(t,e){var r=l(t,e);return r?Math.sqrt(r):r},u=function(t,e){var r,n,i,a=t.length,o=-1;if(null==e){for(;++o<a;)if(null!=(r=t[o])&&r>=r)for(n=i=r;++o<a;)null!=(r=t[o])&&(n>r&&(n=r),i<r&&(i=r))}else for(;++o<a;)if(null!=(r=e(t[o],o,t))&&r>=r)for(n=i=r;++o<a;)null!=(r=e(t[o],o,t))&&(n>r&&(n=r),i<r&&(i=r));return[n,i]},f=Array.prototype,h=f.slice,d=f.map,p=function(t){return function(){return t}},m=function(t){return t},v=function(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=0|Math.max(0,Math.ceil((e-t)/r)),a=new Array(i);++n<i;)a[n]=t+n*r;return a},g=Math.sqrt(50),y=Math.sqrt(10),b=Math.sqrt(2);function x(t,e,r){var n=(e-t)/Math.max(0,r),i=Math.floor(Math.log(n)/Math.LN10),a=n/Math.pow(10,i);return i>=0?(a>=g?10:a>=y?5:a>=b?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=g?10:a>=y?5:a>=b?2:1)}function _(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=g?i*=10:a>=y?i*=5:a>=b&&(i*=2),e<t?-i:i}var w=function(t){return Math.ceil(Math.log(t.length)/Math.LN2)+1},M=function(t,e,r){if(null==r&&(r=s),n=t.length){if((e=+e)<=0||n<2)return+r(t[0],0,t);if(e>=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t);return o+(+r(t[a+1],a+1,t)-o)*(i-a)}},k=function(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a<i;)if(null!=(r=t[a])&&r>=r)for(n=r;++a<i;)null!=(r=t[a])&&n>r&&(n=r)}else for(;++a<i;)if(null!=(r=e(t[a],a,t))&&r>=r)for(n=r;++a<i;)null!=(r=e(t[a],a,t))&&n>r&&(n=r);return n},A=function(t){if(!(i=t.length))return[];for(var e=-1,r=k(t,T),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};function T(t){return t.length}t.bisect=i,t.bisectRight=i,t.bisectLeft=a,t.ascending=e,t.bisector=r,t.cross=function(t,e,r){var n,i,a,s,l=t.length,c=e.length,u=new Array(l*c);for(null==r&&(r=o),n=a=0;n<l;++n)for(s=t[n],i=0;i<c;++i,++a)u[a]=r(s,e[i]);return u},t.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},t.deviation=c,t.extent=u,t.histogram=function(){var t=m,e=u,r=w;function n(n){var a,o,s=n.length,l=new Array(s);for(a=0;a<s;++a)l[a]=t(n[a],a,n);var c=e(l),u=c[0],f=c[1],h=r(l,u,f);Array.isArray(h)||(h=_(u,f,h),h=v(Math.ceil(u/h)*h,Math.floor(f/h)*h,h));for(var d=h.length;h[0]<=u;)h.shift(),--d;for(;h[d-1]>f;)h.pop(),--d;var p,m=new Array(d+1);for(a=0;a<=d;++a)(p=m[a]=[]).x0=a>0?h[a-1]:u,p.x1=a<d?h[a]:f;for(a=0;a<s;++a)u<=(o=l[a])&&o<=f&&m[i(h,o,0,d)].push(n[a]);return m}return n.value=function(e){return arguments.length?(t="function"==typeof e?e:p(e),n):t},n.domain=function(t){return arguments.length?(e="function"==typeof t?t:p([t[0],t[1]]),n):e},n.thresholds=function(t){return arguments.length?(r="function"==typeof t?t:Array.isArray(t)?p(h.call(t)):p(t),n):r},n},t.thresholdFreedmanDiaconis=function(t,r,n){return t=d.call(t,s).sort(e),Math.ceil((n-r)/(2*(M(t,.75)-M(t,.25))*Math.pow(t.length,-1/3)))},t.thresholdScott=function(t,e,r){return Math.ceil((r-e)/(3.5*c(t)*Math.pow(t.length,-1/3)))},t.thresholdSturges=w,t.max=function(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a<i;)if(null!=(r=t[a])&&r>=r)for(n=r;++a<i;)null!=(r=t[a])&&r>n&&(n=r)}else for(;++a<i;)if(null!=(r=e(t[a],a,t))&&r>=r)for(n=r;++a<i;)null!=(r=e(t[a],a,t))&&r>n&&(n=r);return n},t.mean=function(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a<n;)isNaN(r=s(t[a]))?--i:o+=r;else for(;++a<n;)isNaN(r=s(e(t[a],a,t)))?--i:o+=r;if(i)return o/i},t.median=function(t,r){var n,i=t.length,a=-1,o=[];if(null==r)for(;++a<i;)isNaN(n=s(t[a]))||o.push(n);else for(;++a<i;)isNaN(n=s(r(t[a],a,t)))||o.push(n);return M(o.sort(e),.5)},t.merge=function(t){for(var e,r,n,i=t.length,a=-1,o=0;++a<i;)o+=t[a].length;for(r=new Array(o);--i>=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r},t.min=k,t.pairs=function(t,e){null==e&&(e=o);for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r<n;)a[r]=e(i,i=t[++r]);return a},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.quantile=M,t.range=v,t.scan=function(t,r){if(n=t.length){var n,i,a=0,o=0,s=t[o];for(null==r&&(r=e);++a<n;)(r(i=t[a],s)<0||0!==r(s,s))&&(s=i,o=a);return 0===r(s,s)?o:void 0}},t.shuffle=function(t,e,r){for(var n,i,a=(null==r?t.length:r)-(e=null==e?0:+e);a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},t.sum=function(t,e){var r,n=t.length,i=-1,a=0;if(null==e)for(;++i<n;)(r=+t[i])&&(a+=r);else for(;++i<n;)(r=+e(t[i],i,t))&&(a+=r);return a},t.ticks=function(t,e,r){var n,i,a,o,s=-1;if(r=+r,(t=+t)==(e=+e)&&r>0)return[t];if((n=e<t)&&(i=t,t=e,e=i),0===(o=x(t,e,r))||!isFinite(o))return[];if(o>0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++s<i;)a[s]=(t+s)*o;else for(t=Math.floor(t*o),e=Math.ceil(e*o),a=new Array(i=Math.ceil(t-e+1));++s<i;)a[s]=(t-s)/o;return n&&a.reverse(),a},t.tickIncrement=x,t.tickStep=_,t.transpose=A,t.variance=l,t.zip=function(){return A(arguments)},Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],121:[function(t,e,r){var n;n=this,function(t){"use strict";function e(){}function r(t,r){var n=new e;if(t instanceof e)t.each(function(t,e){n.set(e,t)});else if(Array.isArray(t)){var i,a=-1,o=t.length;if(null==r)for(;++a<o;)n.set(a,t[a]);else for(;++a<o;)n.set(r(i=t[a],a,t),i)}else if(t)for(var s in t)n.set(s,t[s]);return n}e.prototype=r.prototype={constructor:e,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,e){return this["$"+t]=e,this},remove:function(t){var e="$"+t;return e in this&&delete this[e]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)"$"===e[0]&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)"$"===e[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var e in this)"$"===e[0]&&t(this[e],e.slice(1),this)}};function n(){return{}}function i(t,e,r){t[e]=r}function a(){return r()}function o(t,e,r){t.set(e,r)}function s(){}var l=r.prototype;function c(t,e){var r=new s;if(t instanceof s)t.each(function(t){r.add(t)});else if(t){var n=-1,i=t.length;if(null==e)for(;++n<i;)r.add(t[n]);else for(;++n<i;)r.add(e(t[n],n,t))}return r}s.prototype=c.prototype={constructor:s,has:l.has,add:function(t){return this["$"+(t+="")]=t,this},remove:l.remove,clear:l.clear,values:l.keys,size:l.size,empty:l.empty,each:l.each};t.nest=function(){var t,e,s,l=[],c=[];function u(n,i,a,o){if(i>=l.length)return null!=t&&n.sort(t),null!=e?e(n):n;for(var s,c,f,h=-1,d=n.length,p=l[i++],m=r(),v=a();++h<d;)(f=m.get(s=p(c=n[h])+""))?f.push(c):m.set(s,[c]);return m.each(function(t,e){o(v,e,u(t,i,a,o))}),v}return s={object:function(t){return u(t,0,n,i)},map:function(t){return u(t,0,a,o)},entries:function(t){return function t(r,n){if(++n>l.length)return r;var i,a=c[n-1];return null!=e&&n>=l.length?i=r.entries():(i=[],r.each(function(e,r){i.push({key:r,values:t(e,n)})})),null!=a?i.sort(function(t,e){return a(t.key,e.key)}):i}(u(t,0,a,o),0)},key:function(t){return l.push(t),s},sortKeys:function(t){return c[l.length-1]=t,s},sortValues:function(e){return t=e,s},rollup:function(t){return e=t,s}}},t.set=c,t.map=r,t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],122:[function(t,e,r){var n;n=this,function(t){"use strict";var e=function(t,e,r){t.prototype=e.prototype=r,r.constructor=t};function r(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function n(){}var i="\\s*([+-]?\\d+)\\s*",a="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",o="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",s=/^#([0-9a-f]{3})$/,l=/^#([0-9a-f]{6})$/,c=new RegExp("^rgb\\("+[i,i,i]+"\\)$"),u=new RegExp("^rgb\\("+[o,o,o]+"\\)$"),f=new RegExp("^rgba\\("+[i,i,i,a]+"\\)$"),h=new RegExp("^rgba\\("+[o,o,o,a]+"\\)$"),d=new RegExp("^hsl\\("+[a,o,o]+"\\)$"),p=new RegExp("^hsla\\("+[a,o,o,a]+"\\)$"),m={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function v(t){var e;return t=(t+"").trim().toLowerCase(),(e=s.exec(t))?new _((e=parseInt(e[1],16))>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=l.exec(t))?g(parseInt(e[1],16)):(e=c.exec(t))?new _(e[1],e[2],e[3],1):(e=u.exec(t))?new _(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=f.exec(t))?y(e[1],e[2],e[3],e[4]):(e=h.exec(t))?y(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=d.exec(t))?w(e[1],e[2]/100,e[3]/100,1):(e=p.exec(t))?w(e[1],e[2]/100,e[3]/100,e[4]):m.hasOwnProperty(t)?g(m[t]):"transparent"===t?new _(NaN,NaN,NaN,0):null}function g(t){return new _(t>>16&255,t>>8&255,255&t,1)}function y(t,e,r,n){return n<=0&&(t=e=r=NaN),new _(t,e,r,n)}function b(t){return t instanceof n||(t=v(t)),t?new _((t=t.rgb()).r,t.g,t.b,t.opacity):new _}function x(t,e,r,n){return 1===arguments.length?b(t):new _(t,e,r,null==n?1:n)}function _(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function w(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new k(t,e,r,n)}function M(t,e,r,i){return 1===arguments.length?function(t){if(t instanceof k)return new k(t.h,t.s,t.l,t.opacity);if(t instanceof n||(t=v(t)),!t)return new k;if(t instanceof k)return t;var e=(t=t.rgb()).r/255,r=t.g/255,i=t.b/255,a=Math.min(e,r,i),o=Math.max(e,r,i),s=NaN,l=o-a,c=(o+a)/2;return l?(s=e===o?(r-i)/l+6*(r<i):r===o?(i-e)/l+2:(e-r)/l+4,l/=c<.5?o+a:2-o-a,s*=60):l=c>0&&c<1?0:s,new k(s,l,c,t.opacity)}(t):new k(t,e,r,null==i?1:i)}function k(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function A(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}e(n,v,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),e(_,x,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new _(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new _(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),e(k,M,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new k(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new k(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new _(A(t>=240?t-240:t+120,i,n),A(t,i,n),A(t<120?t+240:t-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var T=Math.PI/180,E=180/Math.PI,S=.95047,L=1,C=1.08883,P=4/29,z=6/29,O=3*z*z,D=z*z*z;function I(t){if(t instanceof N)return new N(t.l,t.a,t.b,t.opacity);if(t instanceof q){var e=t.h*T;return new N(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof _||(t=b(t));var r=U(t.r),n=U(t.g),i=U(t.b),a=F((.4124564*r+.3575761*n+.1804375*i)/S),o=F((.2126729*r+.7151522*n+.072175*i)/L);return new N(116*o-16,500*(a-o),200*(o-F((.0193339*r+.119192*n+.9503041*i)/C)),t.opacity)}function R(t,e,r,n){return 1===arguments.length?I(t):new N(t,e,r,null==n?1:n)}function N(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function F(t){return t>D?Math.pow(t,1/3):t/O+P}function j(t){return t>z?t*t*t:O*(t-P)}function B(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function U(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function V(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof q)return new q(t.h,t.c,t.l,t.opacity);t instanceof N||(t=I(t));var e=Math.atan2(t.b,t.a)*E;return new q(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new q(t,e,r,null==n?1:n)}function q(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}e(N,R,r(n,{brighter:function(t){return new N(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new N(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return t=L*j(t),new _(B(3.2404542*(e=S*j(e))-1.5371385*t-.4985314*(r=C*j(r))),B(-.969266*e+1.8760108*t+.041556*r),B(.0556434*e-.2040259*t+1.0572252*r),this.opacity)}})),e(q,V,r(n,{brighter:function(t){return new q(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new q(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return I(this).rgb()}}));var H=-.14861,G=1.78277,Y=-.29227,W=-.90649,X=1.97294,Z=X*W,J=X*G,K=G*Y-W*H;function Q(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof $)return new $(t.h,t.s,t.l,t.opacity);t instanceof _||(t=b(t));var e=t.r/255,r=t.g/255,n=t.b/255,i=(K*n+Z*e-J*r)/(K+Z-J),a=n-i,o=(X*(r-i)-Y*a)/W,s=Math.sqrt(o*o+a*a)/(X*i*(1-i)),l=s?Math.atan2(o,a)*E-120:NaN;return new $(l<0?l+360:l,s,i,t.opacity)}(t):new $(t,e,r,null==n?1:n)}function $(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}e($,Q,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new $(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new $(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*T,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),i=Math.sin(t);return new _(255*(e+r*(H*n+G*i)),255*(e+r*(Y*n+W*i)),255*(e+r*(X*n)),this.opacity)}})),t.color=v,t.rgb=x,t.hsl=M,t.lab=R,t.hcl=V,t.cubehelix=Q,Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],123:[function(t,e,r){var n;n=this,function(t){"use strict";var e={value:function(){}};function r(){for(var t,e=0,r=arguments.length,i={};e<r;++e){if(!(t=arguments[e]+"")||t in i)throw new Error("illegal type: "+t);i[t]=[]}return new n(i)}function n(t){this._=t}function i(t,e){for(var r,n=0,i=t.length;n<i;++n)if((r=t[n]).name===e)return r.value}function a(t,r,n){for(var i=0,a=t.length;i<a;++i)if(t[i].name===r){t[i]=e,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:r,value:n}),t}n.prototype=r.prototype={constructor:n,on:function(t,e){var r,n,o=this._,s=(n=o,(t+"").trim().split(/^|\s+/).map(function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),l=-1,c=s.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++l<c;)if(r=(t=s[l]).type)o[r]=a(o[r],t.name,e);else if(null==e)for(r in o)o[r]=a(o[r],t.name,null);return this}for(;++l<c;)if((r=(t=s[l]).type)&&(r=i(o[r],t.name)))return r},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new n(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var r,n,i=new Array(r),a=0;a<r;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,r=(n=this._[t]).length;a<r;++a)n[a].value.apply(e,i)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],i=0,a=n.length;i<a;++i)n[i].value.apply(e,r)}},t.dispatch=r,Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],124:[function(t,e,r){var n,i;n=this,i=function(t,e,r,n,i){"use strict";var a=function(t){return function(){return t}},o=function(){return 1e-6*(Math.random()-.5)};function s(t){return t.x+t.vx}function l(t){return t.y+t.vy}function c(t){return t.index}function u(t,e){var r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function f(t){return t.x}function h(t){return t.y}var d=10,p=Math.PI*(3-Math.sqrt(5));t.forceCenter=function(t,e){var r;function n(){var n,i,a=r.length,o=0,s=0;for(n=0;n<a;++n)o+=(i=r[n]).x,s+=i.y;for(o=o/a-t,s=s/a-e,n=0;n<a;++n)(i=r[n]).x-=o,i.y-=s}return null==t&&(t=0),null==e&&(e=0),n.initialize=function(t){r=t},n.x=function(e){return arguments.length?(t=+e,n):t},n.y=function(t){return arguments.length?(e=+t,n):e},n},t.forceCollide=function(t){var r,n,i=1,c=1;function u(){for(var t,a,u,h,d,p,m,v=r.length,g=0;g<c;++g)for(a=e.quadtree(r,s,l).visitAfter(f),t=0;t<v;++t)u=r[t],p=n[u.index],m=p*p,h=u.x+u.vx,d=u.y+u.vy,a.visit(y);function y(t,e,r,n,a){var s=t.data,l=t.r,c=p+l;if(!s)return e>h+c||n<h-c||r>d+c||a<d-c;if(s.index>u.index){var f=h-s.x-s.vx,v=d-s.y-s.vy,g=f*f+v*v;g<c*c&&(0===f&&(g+=(f=o())*f),0===v&&(g+=(v=o())*v),g=(c-(g=Math.sqrt(g)))/g*i,u.vx+=(f*=g)*(c=(l*=l)/(m+l)),u.vy+=(v*=g)*c,s.vx-=f*(c=1-c),s.vy-=v*c)}}}function f(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function h(){if(r){var e,i,a=r.length;for(n=new Array(a),e=0;e<a;++e)i=r[e],n[i.index]=+t(i,e,r)}}return"function"!=typeof t&&(t=a(null==t?1:+t)),u.initialize=function(t){r=t,h()},u.iterations=function(t){return arguments.length?(c=+t,u):c},u.strength=function(t){return arguments.length?(i=+t,u):i},u.radius=function(e){return arguments.length?(t="function"==typeof e?e:a(+e),h(),u):t},u},t.forceLink=function(t){var e,n,i,s,l,f=c,h=function(t){return 1/Math.min(s[t.source.index],s[t.target.index])},d=a(30),p=1;function m(r){for(var i=0,a=t.length;i<p;++i)for(var s,c,u,f,h,d,m,v=0;v<a;++v)c=(s=t[v]).source,f=(u=s.target).x+u.vx-c.x-c.vx||o(),h=u.y+u.vy-c.y-c.vy||o(),f*=d=((d=Math.sqrt(f*f+h*h))-n[v])/d*r*e[v],h*=d,u.vx-=f*(m=l[v]),u.vy-=h*m,c.vx+=f*(m=1-m),c.vy+=h*m}function v(){if(i){var a,o,c=i.length,h=t.length,d=r.map(i,f);for(a=0,s=new Array(c);a<h;++a)(o=t[a]).index=a,"object"!=typeof o.source&&(o.source=u(d,o.source)),"object"!=typeof o.target&&(o.target=u(d,o.target)),s[o.source.index]=(s[o.source.index]||0)+1,s[o.target.index]=(s[o.target.index]||0)+1;for(a=0,l=new Array(h);a<h;++a)o=t[a],l[a]=s[o.source.index]/(s[o.source.index]+s[o.target.index]);e=new Array(h),g(),n=new Array(h),y()}}function g(){if(i)for(var r=0,n=t.length;r<n;++r)e[r]=+h(t[r],r,t)}function y(){if(i)for(var e=0,r=t.length;e<r;++e)n[e]=+d(t[e],e,t)}return null==t&&(t=[]),m.initialize=function(t){i=t,v()},m.links=function(e){return arguments.length?(t=e,v(),m):t},m.id=function(t){return arguments.length?(f=t,m):f},m.iterations=function(t){return arguments.length?(p=+t,m):p},m.strength=function(t){return arguments.length?(h="function"==typeof t?t:a(+t),g(),m):h},m.distance=function(t){return arguments.length?(d="function"==typeof t?t:a(+t),y(),m):d},m},t.forceManyBody=function(){var t,r,n,i,s=a(-30),l=1,c=1/0,u=.81;function d(i){var a,o=t.length,s=e.quadtree(t,f,h).visitAfter(m);for(n=i,a=0;a<o;++a)r=t[a],s.visit(v)}function p(){if(t){var e,r,n=t.length;for(i=new Array(n),e=0;e<n;++e)r=t[e],i[r.index]=+s(r,e,t)}}function m(t){var e,r,n,a,o,s=0,l=0;if(t.length){for(n=a=o=0;o<4;++o)(e=t[o])&&(r=Math.abs(e.value))&&(s+=e.value,l+=r,n+=r*e.x,a+=r*e.y);t.x=n/l,t.y=a/l}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=i[e.data.index]}while(e=e.next)}t.value=s}function v(t,e,a,s){if(!t.value)return!0;var f=t.x-r.x,h=t.y-r.y,d=s-e,p=f*f+h*h;if(d*d/u<p)return p<c&&(0===f&&(p+=(f=o())*f),0===h&&(p+=(h=o())*h),p<l&&(p=Math.sqrt(l*p)),r.vx+=f*t.value*n/p,r.vy+=h*t.value*n/p),!0;if(!(t.length||p>=c)){(t.data!==r||t.next)&&(0===f&&(p+=(f=o())*f),0===h&&(p+=(h=o())*h),p<l&&(p=Math.sqrt(l*p)));do{t.data!==r&&(d=i[t.data.index]*n/p,r.vx+=f*d,r.vy+=h*d)}while(t=t.next)}}return d.initialize=function(e){t=e,p()},d.strength=function(t){return arguments.length?(s="function"==typeof t?t:a(+t),p(),d):s},d.distanceMin=function(t){return arguments.length?(l=t*t,d):Math.sqrt(l)},d.distanceMax=function(t){return arguments.length?(c=t*t,d):Math.sqrt(c)},d.theta=function(t){return arguments.length?(u=t*t,d):Math.sqrt(u)},d},t.forceRadial=function(t,e,r){var n,i,o,s=a(.1);function l(t){for(var a=0,s=n.length;a<s;++a){var l=n[a],c=l.x-e||1e-6,u=l.y-r||1e-6,f=Math.sqrt(c*c+u*u),h=(o[a]-f)*i[a]*t/f;l.vx+=c*h,l.vy+=u*h}}function c(){if(n){var e,r=n.length;for(i=new Array(r),o=new Array(r),e=0;e<r;++e)o[e]=+t(n[e],e,n),i[e]=isNaN(o[e])?0:+s(n[e],e,n)}}return"function"!=typeof t&&(t=a(+t)),null==e&&(e=0),null==r&&(r=0),l.initialize=function(t){n=t,c()},l.strength=function(t){return arguments.length?(s="function"==typeof t?t:a(+t),c(),l):s},l.radius=function(e){return arguments.length?(t="function"==typeof e?e:a(+e),c(),l):t},l.x=function(t){return arguments.length?(e=+t,l):e},l.y=function(t){return arguments.length?(r=+t,l):r},l},t.forceSimulation=function(t){var e,a=1,o=.001,s=1-Math.pow(o,1/300),l=0,c=.6,u=r.map(),f=i.timer(m),h=n.dispatch("tick","end");function m(){v(),h.call("tick",e),a<o&&(f.stop(),h.call("end",e))}function v(){var e,r,n=t.length;for(a+=(l-a)*s,u.each(function(t){t(a)}),e=0;e<n;++e)null==(r=t[e]).fx?r.x+=r.vx*=c:(r.x=r.fx,r.vx=0),null==r.fy?r.y+=r.vy*=c:(r.y=r.fy,r.vy=0)}function g(){for(var e,r=0,n=t.length;r<n;++r){if((e=t[r]).index=r,isNaN(e.x)||isNaN(e.y)){var i=d*Math.sqrt(r),a=r*p;e.x=i*Math.cos(a),e.y=i*Math.sin(a)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function y(e){return e.initialize&&e.initialize(t),e}return null==t&&(t=[]),g(),e={tick:v,restart:function(){return f.restart(m),e},stop:function(){return f.stop(),e},nodes:function(r){return arguments.length?(t=r,g(),u.each(y),e):t},alpha:function(t){return arguments.length?(a=+t,e):a},alphaMin:function(t){return arguments.length?(o=+t,e):o},alphaDecay:function(t){return arguments.length?(s=+t,e):+s},alphaTarget:function(t){return arguments.length?(l=+t,e):l},velocityDecay:function(t){return arguments.length?(c=1-t,e):1-c},force:function(t,r){return arguments.length>1?(null==r?u.remove(t):u.set(t,y(r)),e):u.get(t)},find:function(e,r,n){var i,a,o,s,l,c=0,u=t.length;for(null==n?n=1/0:n*=n,c=0;c<u;++c)(o=(i=e-(s=t[c]).x)*i+(a=r-s.y)*a)<n&&(l=s,n=o);return l},on:function(t,r){return arguments.length>1?(h.on(t,r),e):h.on(t)}}},t.forceX=function(t){var e,r,n,i=a(.1);function o(t){for(var i,a=0,o=e.length;a<o;++a)(i=e[a]).vx+=(n[a]-i.x)*r[a]*t}function s(){if(e){var a,o=e.length;for(r=new Array(o),n=new Array(o),a=0;a<o;++a)r[a]=isNaN(n[a]=+t(e[a],a,e))?0:+i(e[a],a,e)}}return"function"!=typeof t&&(t=a(null==t?0:+t)),o.initialize=function(t){e=t,s()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:a(+t),s(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:a(+e),s(),o):t},o},t.forceY=function(t){var e,r,n,i=a(.1);function o(t){for(var i,a=0,o=e.length;a<o;++a)(i=e[a]).vy+=(n[a]-i.y)*r[a]*t}function s(){if(e){var a,o=e.length;for(r=new Array(o),n=new Array(o),a=0;a<o;++a)r[a]=isNaN(n[a]=+t(e[a],a,e))?0:+i(e[a],a,e)}}return"function"!=typeof t&&(t=a(null==t?0:+t)),o.initialize=function(t){e=t,s()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:a(+t),s(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:a(+e),s(),o):t},o},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof r&&void 0!==e?i(r,t("d3-quadtree"),t("d3-collection"),t("d3-dispatch"),t("d3-timer")):i(n.d3=n.d3||{},n.d3,n.d3,n.d3,n.d3)},{"d3-collection":121,"d3-dispatch":123,"d3-quadtree":126,"d3-timer":127}],125:[function(t,e,r){var n,i;n=this,i=function(t,e){"use strict";function r(t,e,r,n,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*r+(1+3*t+3*a-3*o)*n+o*i)/6}var n=function(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),a=t[i],o=t[i+1],s=i>0?t[i-1]:2*a-o,l=i<e-1?t[i+2]:2*o-a;return r((n-i/e)*e,s,a,o,l)}},i=function(t){var e=t.length;return function(n){var i=Math.floor(((n%=1)<0?++n:n)*e),a=t[(i+e-1)%e],o=t[i%e],s=t[(i+1)%e],l=t[(i+2)%e];return r((n-i/e)*e,a,o,s,l)}},a=function(t){return function(){return t}};function o(t,e){return function(r){return t+r*e}}function s(t,e){var r=e-t;return r?o(t,r>180||r<-180?r-360*Math.round(r/360):r):a(isNaN(t)?e:t)}function l(t){return 1==(t=+t)?c:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):a(isNaN(e)?r:e)}}function c(t,e){var r=e-t;return r?o(t,r):a(isNaN(t)?e:t)}var u=function t(r){var n=l(r);function i(t,r){var i=n((t=e.rgb(t)).r,(r=e.rgb(r)).r),a=n(t.g,r.g),o=n(t.b,r.b),s=c(t.opacity,r.opacity);return function(e){return t.r=i(e),t.g=a(e),t.b=o(e),t.opacity=s(e),t+""}}return i.gamma=t,i}(1);function f(t){return function(r){var n,i,a=r.length,o=new Array(a),s=new Array(a),l=new Array(a);for(n=0;n<a;++n)i=e.rgb(r[n]),o[n]=i.r||0,s[n]=i.g||0,l[n]=i.b||0;return o=t(o),s=t(s),l=t(l),i.opacity=1,function(t){return i.r=o(t),i.g=s(t),i.b=l(t),i+""}}}var h=f(n),d=f(i),p=function(t,e){var r,n=e?e.length:0,i=t?Math.min(n,t.length):0,a=new Array(i),o=new Array(n);for(r=0;r<i;++r)a[r]=A(t[r],e[r]);for(;r<n;++r)o[r]=e[r];return function(t){for(r=0;r<i;++r)o[r]=a[r](t);return o}},m=function(t,e){var r=new Date;return e-=t=+t,function(n){return r.setTime(t+e*n),r}},v=function(t,e){return e-=t=+t,function(r){return t+e*r}},g=function(t,e){var r,n={},i={};for(r in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)r in t?n[r]=A(t[r],e[r]):i[r]=e[r];return function(t){for(r in n)i[r]=n[r](t);return i}},y=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,b=new RegExp(y.source,"g");var x,_,w,M,k=function(t,e){var r,n,i,a=y.lastIndex=b.lastIndex=0,o=-1,s=[],l=[];for(t+="",e+="";(r=y.exec(t))&&(n=b.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:v(r,n)})),a=b.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(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("")})},A=function(t,r){var n,i=typeof r;return null==r||"boolean"===i?a(r):("number"===i?v:"string"===i?(n=e.color(r))?(r=n,u):k:r instanceof e.color?u:r instanceof Date?m:Array.isArray(r)?p:"function"!=typeof r.valueOf&&"function"!=typeof r.toString||isNaN(r)?g:v)(t,r)},T=180/Math.PI,E={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},S=function(t,e,r,n,i,a){var o,s,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*r+e*n)&&(r-=t*l,n-=e*l),(s=Math.sqrt(r*r+n*n))&&(r/=s,n/=s,l/=s),t*n<e*r&&(t=-t,e=-e,l=-l,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*T,skewX:Math.atan(l)*T,scaleX:o,scaleY:s}};function L(t,e,r,n){function i(t){return t.length?t.pop()+" ":""}return function(a,o){var s=[],l=[];return a=t(a),o=t(o),function(t,n,i,a,o,s){if(t!==i||n!==a){var l=o.push("translate(",null,e,null,r);s.push({i:l-4,x:v(t,i)},{i:l-2,x:v(n,a)})}else(i||a)&&o.push("translate("+i+e+a+r)}(a.translateX,a.translateY,o.translateX,o.translateY,s,l),function(t,e,r,a){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:v(t,e)})):e&&r.push(i(r)+"rotate("+e+n)}(a.rotate,o.rotate,s,l),function(t,e,r,a){t!==e?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:v(t,e)}):e&&r.push(i(r)+"skewX("+e+n)}(a.skewX,o.skewX,s,l),function(t,e,r,n,a,o){if(t!==r||e!==n){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:v(t,r)},{i:s-2,x:v(e,n)})}else 1===r&&1===n||a.push(i(a)+"scale("+r+","+n+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(t){for(var e,r=-1,n=l.length;++r<n;)s[(e=l[r]).i]=e.x(t);return s.join("")}}}var C=L(function(t){return"none"===t?E:(x||(x=document.createElement("DIV"),_=document.documentElement,w=document.defaultView),x.style.transform=t,t=w.getComputedStyle(_.appendChild(x),null).getPropertyValue("transform"),_.removeChild(x),t=t.slice(7,-1).split(","),S(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))},"px, ","px)","deg)"),P=L(function(t){return null==t?E:(M||(M=document.createElementNS("http://www.w3.org/2000/svg","g")),M.setAttribute("transform",t),(t=M.transform.baseVal.consolidate())?(t=t.matrix,S(t.a,t.b,t.c,t.d,t.e,t.f)):E)},", ",")",")"),z=Math.SQRT2;function O(t){return((t=Math.exp(t))+1/t)/2}function D(t){return function(r,n){var i=t((r=e.hsl(r)).h,(n=e.hsl(n)).h),a=c(r.s,n.s),o=c(r.l,n.l),s=c(r.opacity,n.opacity);return function(t){return r.h=i(t),r.s=a(t),r.l=o(t),r.opacity=s(t),r+""}}}var I=D(s),R=D(c);function N(t){return function(r,n){var i=t((r=e.hcl(r)).h,(n=e.hcl(n)).h),a=c(r.c,n.c),o=c(r.l,n.l),s=c(r.opacity,n.opacity);return function(t){return r.h=i(t),r.c=a(t),r.l=o(t),r.opacity=s(t),r+""}}}var F=N(s),j=N(c);function B(t){return function r(n){function i(r,i){var a=t((r=e.cubehelix(r)).h,(i=e.cubehelix(i)).h),o=c(r.s,i.s),s=c(r.l,i.l),l=c(r.opacity,i.opacity);return function(t){return r.h=a(t),r.s=o(t),r.l=s(Math.pow(t,n)),r.opacity=l(t),r+""}}return n=+n,i.gamma=r,i}(1)}var U=B(s),V=B(c);t.interpolate=A,t.interpolateArray=p,t.interpolateBasis=n,t.interpolateBasisClosed=i,t.interpolateDate=m,t.interpolateNumber=v,t.interpolateObject=g,t.interpolateRound=function(t,e){return e-=t=+t,function(r){return Math.round(t+e*r)}},t.interpolateString=k,t.interpolateTransformCss=C,t.interpolateTransformSvg=P,t.interpolateZoom=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],c=e[2],u=s-i,f=l-a,h=u*u+f*f;if(h<1e-12)n=Math.log(c/o)/z,r=function(t){return[i+t*u,a+t*f,o*Math.exp(z*t*n)]};else{var d=Math.sqrt(h),p=(c*c-o*o+4*h)/(2*o*2*d),m=(c*c-o*o-4*h)/(2*c*2*d),v=Math.log(Math.sqrt(p*p+1)-p),g=Math.log(Math.sqrt(m*m+1)-m);n=(g-v)/z,r=function(t){var e,r=t*n,s=O(v),l=o/(2*d)*(s*(e=z*r+v,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(v));return[i+l*u,a+l*f,o*s/O(z*r+v)]}}return r.duration=1e3*n,r},t.interpolateRgb=u,t.interpolateRgbBasis=h,t.interpolateRgbBasisClosed=d,t.interpolateHsl=I,t.interpolateHslLong=R,t.interpolateLab=function(t,r){var n=c((t=e.lab(t)).l,(r=e.lab(r)).l),i=c(t.a,r.a),a=c(t.b,r.b),o=c(t.opacity,r.opacity);return function(e){return t.l=n(e),t.a=i(e),t.b=a(e),t.opacity=o(e),t+""}},t.interpolateHcl=F,t.interpolateHclLong=j,t.interpolateCubehelix=U,t.interpolateCubehelixLong=V,t.quantize=function(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t(n/(e-1));return r},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof r&&void 0!==e?i(r,t("d3-color")):i(n.d3=n.d3||{},n.d3)},{"d3-color":122}],126:[function(t,e,r){var n;n=this,function(t){"use strict";function e(t,e,r,n){if(isNaN(e)||isNaN(r))return t;var i,a,o,s,l,c,u,f,h,d=t._root,p={data:n},m=t._x0,v=t._y0,g=t._x1,y=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((c=e>=(a=(m+g)/2))?m=a:g=a,(u=r>=(o=(v+y)/2))?v=o:y=o,i=d,!(d=d[f=u<<1|c]))return i[f]=p,t;if(s=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===s&&r===l)return p.next=d,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(c=e>=(a=(m+g)/2))?m=a:g=a,(u=r>=(o=(v+y)/2))?v=o:y=o}while((f=u<<1|c)==(h=(l>=o)<<1|s>=a));return i[h]=d,i[f]=p,t}var r=function(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i};function n(t){return t[0]}function i(t){return t[1]}function a(t,e,r){var a=new o(null==e?n:e,null==r?i:r,NaN,NaN,NaN,NaN);return null==t?a:a.addAll(t)}function o(t,e,r,n,i,a){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function s(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var l=a.prototype=o.prototype;l.copy=function(){var t,e,r=new o(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=s(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=s(e));return r},l.add=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},l.addAll=function(t){var r,n,i,a,o=t.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,f=-1/0,h=-1/0;for(n=0;n<o;++n)isNaN(i=+this._x.call(null,r=t[n]))||isNaN(a=+this._y.call(null,r))||(s[n]=i,l[n]=a,i<c&&(c=i),i>f&&(f=i),a<u&&(u=a),a>h&&(h=a));for(f<c&&(c=this._x0,f=this._x1),h<u&&(u=this._y0,h=this._y1),this.cover(c,u).cover(f,h),n=0;n<o;++n)e(this,s[n],l[n],t[n]);return this},l.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var r=this._x0,n=this._y0,i=this._x1,a=this._y1;if(isNaN(r))i=(r=Math.floor(t))+1,a=(n=Math.floor(e))+1;else{if(!(r>t||t>i||n>e||e>a))return this;var o,s,l=i-r,c=this._root;switch(s=(e<(n+a)/2)<<1|t<(r+i)/2){case 0:do{(o=new Array(4))[s]=c,c=o}while(a=n+(l*=2),t>(i=r+l)||e>a);break;case 1:do{(o=new Array(4))[s]=c,c=o}while(a=n+(l*=2),(r=i-l)>t||e>a);break;case 2:do{(o=new Array(4))[s]=c,c=o}while(n=a-(l*=2),t>(i=r+l)||n>e);break;case 3:do{(o=new Array(4))[s]=c,c=o}while(n=a-(l*=2),(r=i-l)>t||n>e)}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=i,this._y1=a,this},l.data=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},l.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},l.find=function(t,e,n){var i,a,o,s,l,c,u,f=this._x0,h=this._y0,d=this._x1,p=this._y1,m=[],v=this._root;for(v&&m.push(new r(v,f,h,d,p)),null==n?n=1/0:(f=t-n,h=e-n,d=t+n,p=e+n,n*=n);c=m.pop();)if(!(!(v=c.node)||(a=c.x0)>d||(o=c.y0)>p||(s=c.x1)<f||(l=c.y1)<h))if(v.length){var g=(a+s)/2,y=(o+l)/2;m.push(new r(v[3],g,y,s,l),new r(v[2],a,y,g,l),new r(v[1],g,o,s,y),new r(v[0],a,o,g,y)),(u=(e>=y)<<1|t>=g)&&(c=m[m.length-1],m[m.length-1]=m[m.length-1-u],m[m.length-1-u]=c)}else{var b=t-+this._x.call(null,v.data),x=e-+this._y.call(null,v.data),_=b*b+x*x;if(_<n){var w=Math.sqrt(n=_);f=t-w,h=e-w,d=t+w,p=e+w,i=v.data}}return i},l.remove=function(t){if(isNaN(a=+this._x.call(null,t))||isNaN(o=+this._y.call(null,t)))return this;var e,r,n,i,a,o,s,l,c,u,f,h,d=this._root,p=this._x0,m=this._y0,v=this._x1,g=this._y1;if(!d)return this;if(d.length)for(;;){if((c=a>=(s=(p+v)/2))?p=s:v=s,(u=o>=(l=(m+g)/2))?m=l:g=l,e=d,!(d=d[f=u<<1|c]))return this;if(!d.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(r=e,h=f)}for(;d.data!==t;)if(n=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,n?(i?n.next=i:delete n.next,this):e?(i?e[f]=i:delete e[f],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(r?r[h]=d:this._root=d),this):(this._root=i,this)},l.removeAll=function(t){for(var e=0,r=t.length;e<r;++e)this.remove(t[e]);return this},l.root=function(){return this._root},l.size=function(){var t=0;return this.visit(function(e){if(!e.length)do{++t}while(e=e.next)}),t},l.visit=function(t){var e,n,i,a,o,s,l=[],c=this._root;for(c&&l.push(new r(c,this._x0,this._y0,this._x1,this._y1));e=l.pop();)if(!t(c=e.node,i=e.x0,a=e.y0,o=e.x1,s=e.y1)&&c.length){var u=(i+o)/2,f=(a+s)/2;(n=c[3])&&l.push(new r(n,u,f,o,s)),(n=c[2])&&l.push(new r(n,i,f,u,s)),(n=c[1])&&l.push(new r(n,u,a,o,f)),(n=c[0])&&l.push(new r(n,i,a,u,f))}return this},l.visitAfter=function(t){var e,n=[],i=[];for(this._root&&n.push(new r(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var a=e.node;if(a.length){var o,s=e.x0,l=e.y0,c=e.x1,u=e.y1,f=(s+c)/2,h=(l+u)/2;(o=a[0])&&n.push(new r(o,s,l,f,h)),(o=a[1])&&n.push(new r(o,f,l,c,h)),(o=a[2])&&n.push(new r(o,s,h,f,u)),(o=a[3])&&n.push(new r(o,f,h,c,u))}i.push(e)}for(;e=i.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},l.x=function(t){return arguments.length?(this._x=t,this):this._x},l.y=function(t){return arguments.length?(this._y=t,this):this._y},t.quadtree=a,Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],127:[function(t,e,r){var n;n=this,function(t){"use strict";var e,r,n=0,i=0,a=0,o=1e3,s=0,l=0,c=0,u="object"==typeof performance&&performance.now?performance:Date,f="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function h(){return l||(f(d),l=u.now()+c)}function d(){l=0}function p(){this._call=this._time=this._next=null}function m(t,e,r){var n=new p;return n.restart(t,e,r),n}function v(){h(),++n;for(var t,r=e;r;)(t=l-r._time)>=0&&r._call.call(null,t),r=r._next;--n}function g(){l=(s=u.now())+c,n=i=0;try{v()}finally{n=0,function(){var t,n,i=e,a=1/0;for(;i;)i._call?(a>i._time&&(a=i._time),t=i,i=i._next):(n=i._next,i._next=null,i=t?t._next=n:e=n);r=t,b(a)}(),l=0}}function y(){var t=u.now(),e=t-s;e>o&&(c-=e,s=t)}function b(t){n||(i&&(i=clearTimeout(i)),t-l>24?(t<1/0&&(i=setTimeout(g,t-u.now()-c)),a&&(a=clearInterval(a))):(a||(s=u.now(),a=setInterval(y,o)),n=1,f(g)))}p.prototype=m.prototype={constructor:p,restart:function(t,n,i){if("function"!=typeof t)throw new TypeError("callback is not a function");i=(null==i?h():+i)+(null==n?0:+n),this._next||r===this||(r?r._next=this:e=this,r=this),this._call=t,this._time=i,b()},stop:function(){this._call&&(this._call=null,this._time=1/0,b())}};t.now=h,t.timer=m,t.timerFlush=v,t.timeout=function(t,e,r){var n=new p;return e=null==e?0:+e,n.restart(function(r){n.stop(),t(r+e)},e,r),n},t.interval=function(t,e,r){var n=new p,i=e;return null==e?(n.restart(t,e,r),n):(e=+e,r=null==r?h():+r,n.restart(function a(o){o+=i,n.restart(a,i+=e,r),t(o)},e,r),n)},Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],128:[function(t,e,r){!function(){var t={version:"3.5.17"},r=[].slice,n=function(t){return r.call(t)},i=this.document;function a(t){return t&&(t.ownerDocument||t.document||t).documentElement}function o(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(i)try{n(i.documentElement.childNodes)[0].nodeType}catch(t){n=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),i)try{i.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var s=this.Element.prototype,l=s.setAttribute,c=s.setAttributeNS,u=this.CSSStyleDeclaration.prototype,f=u.setProperty;s.setAttribute=function(t,e){l.call(this,t,e+"")},s.setAttributeNS=function(t,e,r){c.call(this,t,e,r+"")},u.setProperty=function(t,e,r){f.call(this,t,e+"",r)}}function h(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function d(t){return null===t?NaN:+t}function p(t){return!isNaN(t)}function m(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}t.ascending=h,t.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},t.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i<a;)if(null!=(n=t[i])&&n>=n){r=n;break}for(;++i<a;)null!=(n=t[i])&&r>n&&(r=n)}else{for(;++i<a;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=n;break}for(;++i<a;)null!=(n=e.call(t,t[i],i))&&r>n&&(r=n)}return r},t.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i<a;)if(null!=(n=t[i])&&n>=n){r=n;break}for(;++i<a;)null!=(n=t[i])&&n>r&&(r=n)}else{for(;++i<a;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=n;break}for(;++i<a;)null!=(n=e.call(t,t[i],i))&&n>r&&(r=n)}return r},t.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a<o;)if(null!=(n=t[a])&&n>=n){r=i=n;break}for(;++a<o;)null!=(n=t[a])&&(r>n&&(r=n),i<n&&(i=n))}else{for(;++a<o;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=i=n;break}for(;++a<o;)null!=(n=e.call(t,t[a],a))&&(r>n&&(r=n),i<n&&(i=n))}return[r,i]},t.sum=function(t,e){var r,n=0,i=t.length,a=-1;if(1===arguments.length)for(;++a<i;)p(r=+t[a])&&(n+=r);else for(;++a<i;)p(r=+e.call(t,t[a],a))&&(n+=r);return n},t.mean=function(t,e){var r,n=0,i=t.length,a=-1,o=i;if(1===arguments.length)for(;++a<i;)p(r=d(t[a]))?n+=r:--o;else for(;++a<i;)p(r=d(e.call(t,t[a],a)))?n+=r:--o;if(o)return n/o},t.quantile=function(t,e){var r=(t.length-1)*e+1,n=Math.floor(r),i=+t[n-1],a=r-n;return a?i+a*(t[n]-i):i},t.median=function(e,r){var n,i=[],a=e.length,o=-1;if(1===arguments.length)for(;++o<a;)p(n=d(e[o]))&&i.push(n);else for(;++o<a;)p(n=d(r.call(e,e[o],o)))&&i.push(n);if(i.length)return t.quantile(i.sort(h),.5)},t.variance=function(t,e){var r,n,i=t.length,a=0,o=0,s=-1,l=0;if(1===arguments.length)for(;++s<i;)p(r=d(t[s]))&&(o+=(n=r-a)*(r-(a+=n/++l)));else for(;++s<i;)p(r=d(e.call(t,t[s],s)))&&(o+=(n=r-a)*(r-(a+=n/++l)));if(l>1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var v=m(h);function g(t){return t.length}t.bisectLeft=v.left,t.bisect=t.bisectRight=v.right,t.bisector=function(t){return m(1===t.length?function(e,r){return h(t(e),r)}:t)},t.shuffle=function(t,e,r){(a=arguments.length)<3&&(r=t.length,a<2&&(e=0));for(var n,i,a=r-e;a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],i=new Array(r<0?0:r);e<r;)i[e]=[n,n=t[++e]];return i},t.transpose=function(e){if(!(a=e.length))return[];for(var r=-1,n=t.min(e,g),i=new Array(n);++r<n;)for(var a,o=-1,s=i[r]=new Array(a);++o<a;)s[o]=e[o][r];return i},t.zip=function(){return t.transpose(arguments)},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},t.merge=function(t){for(var e,r,n,i=t.length,a=-1,o=0;++a<i;)o+=t[a].length;for(r=new Array(o);--i>=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r};var y=Math.abs;function b(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function x(){this._=Object.create(null)}t.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r==1/0)throw new Error("infinite range");var n,i=[],a=function(t){var e=1;for(;t*e%1;)e*=10;return e}(y(r)),o=-1;if(t*=a,e*=a,(r*=a)<0)for(;(n=t+r*++o)>e;)i.push(n/a);else for(;(n=t+r*++o)<e;)i.push(n/a);return i},t.map=function(t,e){var r=new x;if(t instanceof x)t.forEach(function(t,e){r.set(t,e)});else if(Array.isArray(t)){var n,i=-1,a=t.length;if(1===arguments.length)for(;++i<a;)r.set(i,t[i]);else for(;++i<a;)r.set(e.call(t,n=t[i],i),n)}else for(var o in t)r.set(o,t[o]);return r};var _="__proto__",w="\0";function M(t){return(t+="")===_||t[0]===w?w+t:t}function k(t){return(t+="")[0]===w?t.slice(1):t}function A(t){return M(t)in this._}function T(t){return(t=M(t))in this._&&delete this._[t]}function E(){var t=[];for(var e in this._)t.push(k(e));return t}function S(){var t=0;for(var e in this._)++t;return t}function L(){for(var t in this._)return!1;return!0}function C(){this._=Object.create(null)}function P(t){return t}function z(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function O(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=D.length;r<n;++r){var i=D[r]+e;if(i in t)return i}}b(x,{has:A,get:function(t){return this._[M(t)]},set:function(t,e){return this._[M(t)]=e},remove:T,keys:E,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:k(e),value:this._[e]});return t},size:S,empty:L,forEach:function(t){for(var e in this._)t.call(this,k(e),this._[e])}}),t.nest=function(){var e,r,n={},i=[],a=[];function o(t,a,s){if(s>=i.length)return r?r.call(n,a):e?a.sort(e):a;for(var l,c,u,f,h=-1,d=a.length,p=i[s++],m=new x;++h<d;)(f=m.get(l=p(c=a[h])))?f.push(c):m.set(l,[c]);return t?(c=t(),u=function(e,r){c.set(e,o(t,r,s))}):(c={},u=function(e,r){c[e]=o(t,r,s)}),m.forEach(u),c}return n.map=function(t,e){return o(e,t,0)},n.entries=function(e){return function t(e,r){if(r>=i.length)return e;var n=[],o=a[r++];return e.forEach(function(e,i){n.push({key:e,values:t(i,r)})}),o?n.sort(function(t,e){return o(t.key,e.key)}):n}(o(t.map,e,0),0)},n.key=function(t){return i.push(t),n},n.sortKeys=function(t){return a[i.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new C;if(t)for(var r=0,n=t.length;r<n;++r)e.add(t[r]);return e},b(C,{has:A,add:function(t){return this._[M(t+="")]=!0,t},remove:T,values:E,size:S,empty:L,forEach:function(t){for(var e in this._)t.call(this,k(e))}}),t.behavior={},t.rebind=function(t,e){for(var r,n=1,i=arguments.length;++n<i;)t[r=arguments[n]]=z(t,e,e[r]);return t};var D=["webkit","ms","moz","Moz","o","O"];function I(){}function R(){}function N(t){var e=[],r=new x;function n(){for(var r,n=e,i=-1,a=n.length;++i<a;)(r=n[i].on)&&r.apply(this,arguments);return t}return n.on=function(n,i){var a,o=r.get(n);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,a=e.indexOf(o)).concat(e.slice(a+1)),r.remove(n)),i&&e.push(r.set(n,{on:i})),t)},n}function F(){t.event.preventDefault()}function j(){for(var e,r=t.event;e=r.sourceEvent;)r=e;return r}function B(e){for(var r=new R,n=0,i=arguments.length;++n<i;)r[arguments[n]]=N(r);return r.of=function(n,i){return function(a){try{var o=a.sourceEvent=t.event;a.target=e,t.event=a,r[a.type].apply(n,i)}finally{t.event=o}}},r}t.dispatch=function(){for(var t=new R,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=N(t);return t},R.prototype.on=function(t,e){var r=t.indexOf("."),n="";if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},t.event=null,t.requote=function(t){return t.replace(U,"\\$&")};var U=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,V={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function q(t){return V(t,W),t}var H=function(t,e){return e.querySelector(t)},G=function(t,e){return e.querySelectorAll(t)},Y=function(t,e){var r=t.matches||t[O(t,"matchesSelector")];return(Y=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(H=function(t,e){return Sizzle(t,e)[0]||null},G=Sizzle,Y=Sizzle.matchesSelector),t.selection=function(){return t.select(i.documentElement)};var W=t.selection.prototype=[];function X(t){return"function"==typeof t?t:function(){return H(t,this)}}function Z(t){return"function"==typeof t?t:function(){return G(t,this)}}W.select=function(t){var e,r,n,i,a=[];t=X(t);for(var o=-1,s=this.length;++o<s;){a.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var l=-1,c=n.length;++l<c;)(i=n[l])?(e.push(r=t.call(i,i.__data__,l,o)),r&&"__data__"in i&&(r.__data__=i.__data__)):e.push(null)}return q(a)},W.selectAll=function(t){var e,r,i=[];t=Z(t);for(var a=-1,o=this.length;++a<o;)for(var s=this[a],l=-1,c=s.length;++l<c;)(r=s[l])&&(i.push(e=n(t.call(r,r.__data__,l,a))),e.parentNode=r);return q(i)};var J="http://www.w3.org/1999/xhtml",K={svg:"http://www.w3.org/2000/svg",xhtml:J,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Q(e,r){return e=t.ns.qualify(e),null==r?e.local?function(){this.removeAttributeNS(e.space,e.local)}:function(){this.removeAttribute(e)}:"function"==typeof r?e.local?function(){var t=r.apply(this,arguments);null==t?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,t)}:function(){var t=r.apply(this,arguments);null==t?this.removeAttribute(e):this.setAttribute(e,t)}:e.local?function(){this.setAttributeNS(e.space,e.local,r)}:function(){this.setAttribute(e,r)}}function $(t){return t.trim().replace(/\s+/g," ")}function tt(e){return new RegExp("(?:^|\\s+)"+t.requote(e)+"(?:\\s+|$)","g")}function et(t){return(t+"").trim().split(/^|\s+/)}function rt(t,e){var r=(t=et(t).map(nt)).length;return"function"==typeof e?function(){for(var n=-1,i=e.apply(this,arguments);++n<r;)t[n](this,i)}:function(){for(var n=-1;++n<r;)t[n](this,e)}}function nt(t){var e=tt(t);return function(r,n){if(i=r.classList)return n?i.add(t):i.remove(t);var i=r.getAttribute("class")||"";n?(e.lastIndex=0,e.test(i)||r.setAttribute("class",$(i+" "+t))):r.setAttribute("class",$(i.replace(e," ")))}}function it(t,e,r){return null==e?function(){this.style.removeProperty(t)}:"function"==typeof e?function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}:function(){this.style.setProperty(t,e,r)}}function at(t,e){return null==e?function(){delete this[t]}:"function"==typeof e?function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}:function(){this[t]=e}}function ot(e){return"function"==typeof e?e:(e=t.ns.qualify(e)).local?function(){return this.ownerDocument.createElementNS(e.space,e.local)}:function(){var t=this.ownerDocument,r=this.namespaceURI;return r===J&&t.documentElement.namespaceURI===J?t.createElement(e):t.createElementNS(r,e)}}function st(){var t=this.parentNode;t&&t.removeChild(this)}function lt(t){return{__data__:t}}function ct(t){return function(){return Y(this,t)}}function ut(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 ft(t){return V(t,ht),t}t.ns={prefix:K,qualify:function(t){var e=t.indexOf(":"),r=t;return e>=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),K.hasOwnProperty(r)?{space:K[r],local:t}:t}},W.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(Q(r,e[r]));return this}return this.each(Q(e,r))},W.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=et(t)).length,i=-1;if(e=r.classList){for(;++i<n;)if(!e.contains(t[i]))return!1}else for(e=r.getAttribute("class");++i<n;)if(!tt(t[i]).test(e))return!1;return!0}for(e in t)this.each(rt(e,t[e]));return this}return this.each(rt(t,e))},W.style=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=""),t)this.each(it(r,t[r],e));return this}if(n<2){var i=this.node();return o(i).getComputedStyle(i,null).getPropertyValue(t)}r=""}return this.each(it(t,e,r))},W.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(at(e,t[e]));return this}return this.each(at(t,e))},W.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},W.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},W.append=function(t){return t=ot(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},W.insert=function(t,e){return t=ot(t),e=X(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},W.remove=function(){return this.each(st)},W.data=function(t,e){var r,n,i=-1,a=this.length;if(!arguments.length){for(t=new Array(a=(r=this[0]).length);++i<a;)(n=r[i])&&(t[i]=n.__data__);return t}function o(t,r){var n,i,a,o=t.length,u=r.length,f=Math.min(o,u),h=new Array(u),d=new Array(u),p=new Array(o);if(e){var m,v=new x,g=new Array(o);for(n=-1;++n<o;)(i=t[n])&&(v.has(m=e.call(i,i.__data__,n))?p[n]=i:v.set(m,i),g[n]=m);for(n=-1;++n<u;)(i=v.get(m=e.call(r,a=r[n],n)))?!0!==i&&(h[n]=i,i.__data__=a):d[n]=lt(a),v.set(m,!0);for(n=-1;++n<o;)n in g&&!0!==v.get(g[n])&&(p[n]=t[n])}else{for(n=-1;++n<f;)i=t[n],a=r[n],i?(i.__data__=a,h[n]=i):d[n]=lt(a);for(;n<u;++n)d[n]=lt(r[n]);for(;n<o;++n)p[n]=t[n]}d.update=h,d.parentNode=h.parentNode=p.parentNode=t.parentNode,s.push(d),l.push(h),c.push(p)}var s=ft([]),l=q([]),c=q([]);if("function"==typeof t)for(;++i<a;)o(r=this[i],t.call(r,r.parentNode.__data__,i));else for(;++i<a;)o(r=this[i],t);return l.enter=function(){return s},l.exit=function(){return c},l},W.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},W.filter=function(t){var e,r,n,i=[];"function"!=typeof t&&(t=ct(t));for(var a=0,o=this.length;a<o;a++){i.push(e=[]),e.parentNode=(r=this[a]).parentNode;for(var s=0,l=r.length;s<l;s++)(n=r[s])&&t.call(n,n.__data__,s,a)&&e.push(n)}return q(i)},W.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},W.sort=function(t){t=function(t){arguments.length||(t=h);return function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}.apply(this,arguments);for(var e=-1,r=this.length;++e<r;)this[e].sort(t);return this.order()},W.each=function(t){return ut(this,function(e,r,n){t.call(e,e.__data__,r,n)})},W.call=function(t){var e=n(arguments);return t.apply(e[0]=this,e),this},W.empty=function(){return!this.node()},W.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},W.size=function(){var t=0;return ut(this,function(){++t}),t};var ht=[];function dt(e,r,i){var a="__on"+e,o=e.indexOf("."),s=mt;o>0&&(e=e.slice(0,o));var l=pt.get(e);function c(){var t=this[a];t&&(this.removeEventListener(e,t,t.$),delete this[a])}return l&&(e=l,s=vt),o?r?function(){var t=s(r,n(arguments));c.call(this),this.addEventListener(e,this[a]=t,t.$=i),t._=r}:c:r?I:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var i in this)if(r=i.match(n)){var a=this[i];this.removeEventListener(r[1],a,a.$),delete this[i]}}}t.selection.enter=ft,t.selection.enter.prototype=ht,ht.append=W.append,ht.empty=W.empty,ht.node=W.node,ht.call=W.call,ht.size=W.size,ht.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 c=-1,u=i.length;++c<u;)(a=i[c])?(e.push(n[c]=r=t.call(i.parentNode,a.__data__,c,s)),r.__data__=a.__data__):e.push(null)}return q(o)},ht.insert=function(t,e){var r,n,i;return arguments.length<2&&(r=this,e=function(t,e,a){var o,s=r[a].update,l=s.length;for(a!=i&&(i=a,n=0),e>=n&&(n=e+1);!(o=s[n])&&++n<l;);return o}),W.insert.call(this,t,e)},t.select=function(t){var e;return"string"==typeof t?(e=[H(t,i)]).parentNode=i.documentElement:(e=[t]).parentNode=a(t),q([e])},t.selectAll=function(t){var e;return"string"==typeof t?(e=n(G(t,i))).parentNode=i.documentElement:(e=n(t)).parentNode=null,q([e])},W.on=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=!1),t)this.each(dt(r,t[r],e));return this}if(n<2)return(n=this.node()["__on"+t])&&n._;r=!1}return this.each(dt(t,e,r))};var pt=t.map({mouseenter:"mouseover",mouseleave:"mouseout"});function mt(e,r){return function(n){var i=t.event;t.event=n,r[0]=this.__data__;try{e.apply(this,r)}finally{t.event=i}}}function vt(t,e){var r=mt(t,e);return function(t){var e=t.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||r.call(this,t)}}i&&pt.forEach(function(t){"on"+t in i&&pt.remove(t)});var gt,yt=0;function bt(e){var r=".dragsuppress-"+ ++yt,n="click"+r,i=t.select(o(e)).on("touchmove"+r,F).on("dragstart"+r,F).on("selectstart"+r,F);if(null==gt&&(gt=!("onselectstart"in e)&&O(e.style,"userSelect")),gt){var s=a(e).style,l=s[gt];s[gt]="none"}return function(t){if(i.on(r,null),gt&&(s[gt]=l),t){var e=function(){i.on(n,null)};i.on(n,function(){F(),e()},!0),setTimeout(e,0)}}}t.mouse=function(t){return _t(t,j())};var xt=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function _t(e,r){r.changedTouches&&(r=r.changedTouches[0]);var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();if(xt<0){var a=o(e);if(a.scrollX||a.scrollY){var s=(n=t.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();xt=!(s.f||s.e),n.remove()}}return xt?(i.x=r.pageX,i.y=r.pageY):(i.x=r.clientX,i.y=r.clientY),[(i=i.matrixTransform(e.getScreenCTM().inverse())).x,i.y]}var l=e.getBoundingClientRect();return[r.clientX-l.left-e.clientLeft,r.clientY-l.top-e.clientTop]}function wt(){return t.event.changedTouches[0].identifier}t.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=j().changedTouches),e)for(var n,i=0,a=e.length;i<a;++i)if((n=e[i]).identifier===r)return _t(t,n)},t.behavior.drag=function(){var e=B(a,"drag","dragstart","dragend"),r=null,n=s(I,t.mouse,o,"mousemove","mouseup"),i=s(wt,t.touch,P,"touchmove","touchend");function a(){this.on("mousedown.drag",n).on("touchstart.drag",i)}function s(n,i,a,o,s){return function(){var l,c=t.event.target.correspondingElement||t.event.target,u=this.parentNode,f=e.of(this,arguments),h=0,d=n(),p=".drag"+(null==d?"":"-"+d),m=t.select(a(c)).on(o+p,function(){var t,e,r=i(u,d);if(!r)return;t=r[0]-g[0],e=r[1]-g[1],h|=t|e,g=r,f({type:"drag",x:r[0]+l[0],y:r[1]+l[1],dx:t,dy:e})}).on(s+p,function(){if(!i(u,d))return;m.on(o+p,null).on(s+p,null),v(h),f({type:"dragend"})}),v=bt(c),g=i(u,d);l=r?[(l=r.apply(this,arguments)).x-g[0],l.y-g[1]]:[0,0],f({type:"dragstart"})}}return a.origin=function(t){return arguments.length?(r=t,a):r},t.rebind(a,e,"on")},t.touches=function(t,e){return arguments.length<2&&(e=j().touches),e?n(e).map(function(e){var r=_t(t,e);return r.identifier=e.identifier,r}):[]};var Mt=1e-6,kt=Mt*Mt,At=Math.PI,Tt=2*At,Et=Tt-Mt,St=At/2,Lt=At/180,Ct=180/At;function Pt(t){return t>0?1:t<0?-1:0}function zt(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function Ot(t){return t>1?0:t<-1?At:Math.acos(t)}function Dt(t){return t>1?St:t<-1?-St:Math.asin(t)}function It(t){return((t=Math.exp(t))+1/t)/2}function Rt(t){return(t=Math.sin(t/2))*t}var Nt=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],c=e[2],u=s-i,f=l-a,h=u*u+f*f;if(h<kt)n=Math.log(c/o)/Nt,r=function(t){return[i+t*u,a+t*f,o*Math.exp(Nt*t*n)]};else{var d=Math.sqrt(h),p=(c*c-o*o+4*h)/(2*o*2*d),m=(c*c-o*o-4*h)/(2*c*2*d),v=Math.log(Math.sqrt(p*p+1)-p),g=Math.log(Math.sqrt(m*m+1)-m);n=(g-v)/Nt,r=function(t){var e,r=t*n,s=It(v),l=o/(2*d)*(s*(e=Nt*r+v,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(v));return[i+l*u,a+l*f,o*s/It(Nt*r+v)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,a,s,l,c,u,f,h={x:0,y:0,k:1},d=[960,500],p=Bt,m=250,v=0,g="mousedown.zoom",y="mousemove.zoom",b="mouseup.zoom",x="touchstart.zoom",_=B(w,"zoomstart","zoom","zoomend");function w(t){t.on(g,P).on(jt+".zoom",O).on("dblclick.zoom",D).on(x,z)}function M(t){return[(t[0]-h.x)/h.k,(t[1]-h.y)/h.k]}function k(t){h.k=Math.max(p[0],Math.min(p[1],t))}function A(t,e){e=function(t){return[t[0]*h.k+h.x,t[1]*h.k+h.y]}(e),h.x+=t[0]-e[0],h.y+=t[1]-e[1]}function T(e,n,i,a){e.__chart__={x:h.x,y:h.y,k:h.k},k(Math.pow(2,a)),A(r=n,i),e=t.select(e),m>0&&(e=e.transition().duration(m)),e.call(w.event)}function E(){c&&c.domain(l.range().map(function(t){return(t-h.x)/h.k}).map(l.invert)),f&&f.domain(u.range().map(function(t){return(t-h.y)/h.k}).map(u.invert))}function S(t){v++||t({type:"zoomstart"})}function L(t){E(),t({type:"zoom",scale:h.k,translate:[h.x,h.y]})}function C(t){--v||(t({type:"zoomend"}),r=null)}function P(){var e=this,r=_.of(e,arguments),n=0,i=t.select(o(e)).on(y,function(){n=1,A(t.mouse(e),a),L(r)}).on(b,function(){i.on(y,null).on(b,null),s(n),C(r)}),a=M(t.mouse(e)),s=bt(e);ss.call(e),S(r)}function z(){var e,r=this,n=_.of(r,arguments),i={},a=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,c="touchend"+o,u=[],f=t.select(r),d=bt(r);function p(){var n=t.touches(r);return e=h.k,n.forEach(function(t){t.identifier in i&&(i[t.identifier]=M(t))}),n}function m(){var e=t.event.target;t.select(e).on(l,v).on(c,y),u.push(e);for(var n=t.event.changedTouches,o=0,f=n.length;o<f;++o)i[n[o].identifier]=null;var d=p(),m=Date.now();if(1===d.length){if(m-s<500){var g=d[0];T(r,g,i[g.identifier],Math.floor(Math.log(h.k)/Math.LN2)+1),F()}s=m}else if(d.length>1){g=d[0];var b=d[1],x=g[0]-b[0],_=g[1]-b[1];a=x*x+_*_}}function v(){var o,l,c,u,f=t.touches(r);ss.call(r);for(var h=0,d=f.length;h<d;++h,u=null)if(c=f[h],u=i[c.identifier]){if(l)break;o=c,l=u}if(u){var p=(p=c[0]-o[0])*p+(p=c[1]-o[1])*p,m=a&&Math.sqrt(p/a);o=[(o[0]+c[0])/2,(o[1]+c[1])/2],l=[(l[0]+u[0])/2,(l[1]+u[1])/2],k(m*e)}s=null,A(o,l),L(n)}function y(){if(t.event.touches.length){for(var e=t.event.changedTouches,r=0,a=e.length;r<a;++r)delete i[e[r].identifier];for(var s in i)return void p()}t.selectAll(u).on(o,null),f.on(g,P).on(x,z),d(),C(n)}m(),S(n),f.on(g,null).on(x,m)}function O(){var i=_.of(this,arguments);a?clearTimeout(a):(ss.call(this),e=M(r=n||t.mouse(this)),S(i)),a=setTimeout(function(){a=null,C(i)},50),F(),k(Math.pow(2,.002*Ft())*h.k),A(r,e),L(i)}function D(){var e=t.mouse(this),r=Math.log(h.k)/Math.LN2;T(this,e,M(e),t.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}return jt||(jt="onwheel"in i?(Ft=function(){return-t.event.deltaY*(t.event.deltaMode?120:1)},"wheel"):"onmousewheel"in i?(Ft=function(){return t.event.wheelDelta},"mousewheel"):(Ft=function(){return-t.event.detail},"MozMousePixelScroll")),w.event=function(e){e.each(function(){var e=_.of(this,arguments),n=h;us?t.select(this).transition().each("start.zoom",function(){h=this.__chart__||{x:0,y:0,k:1},S(e)}).tween("zoom:zoom",function(){var i=d[0],a=d[1],o=r?r[0]:i/2,s=r?r[1]:a/2,l=t.interpolateZoom([(o-h.x)/h.k,(s-h.y)/h.k,i/h.k],[(o-n.x)/n.k,(s-n.y)/n.k,i/n.k]);return function(t){var r=l(t),n=i/r[2];this.__chart__=h={x:o-r[0]*n,y:s-r[1]*n,k:n},L(e)}}).each("interrupt.zoom",function(){C(e)}).each("end.zoom",function(){C(e)}):(this.__chart__=h,S(e),L(e),C(e))})},w.translate=function(t){return arguments.length?(h={x:+t[0],y:+t[1],k:h.k},E(),w):[h.x,h.y]},w.scale=function(t){return arguments.length?(h={x:h.x,y:h.y,k:null},k(+t),E(),w):h.k},w.scaleExtent=function(t){return arguments.length?(p=null==t?Bt:[+t[0],+t[1]],w):p},w.center=function(t){return arguments.length?(n=t&&[+t[0],+t[1]],w):n},w.size=function(t){return arguments.length?(d=t&&[+t[0],+t[1]],w):d},w.duration=function(t){return arguments.length?(m=+t,w):m},w.x=function(t){return arguments.length?(c=t,l=t.copy(),h={x:0,y:0,k:1},w):c},w.y=function(t){return arguments.length?(f=t,u=t.copy(),h={x:0,y:0,k:1},w):f},t.rebind(w,_,"on")};var Ft,jt,Bt=[0,1/0];function Ut(){}function Vt(t,e,r){return this instanceof Vt?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof Vt?new Vt(t.h,t.s,t.l):ue(""+t,fe,Vt):new Vt(t,e,r)}t.color=Ut,Ut.prototype.toString=function(){return this.rgb()+""},t.hsl=Vt;var qt=Vt.prototype=new Ut;function Ht(t,e,r){var n,i;function a(t){return Math.round(255*function(t){return t>360?t-=360:t<0&&(t+=360),t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+e):r+e-r*e),new ae(a(t+120),a(t),a(t-120))}function Gt(e,r,n){return this instanceof Gt?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Gt?new Gt(e.h,e.c,e.l):ee(e instanceof Xt?e.l:(e=he((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Gt(e,r,n)}qt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Vt(this.h,this.s,this.l/t)},qt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Vt(this.h,this.s,t*this.l)},qt.rgb=function(){return Ht(this.h,this.s,this.l)},t.hcl=Gt;var Yt=Gt.prototype=new Ut;function Wt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Xt(r,Math.cos(t*=Lt)*e,Math.sin(t)*e)}function Xt(t,e,r){return this instanceof Xt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Xt?new Xt(t.l,t.a,t.b):t instanceof Gt?Wt(t.h,t.c,t.l):he((t=ae(t)).r,t.g,t.b):new Xt(t,e,r)}Yt.brighter=function(t){return new Gt(this.h,this.c,Math.min(100,this.l+Zt*(arguments.length?t:1)))},Yt.darker=function(t){return new Gt(this.h,this.c,Math.max(0,this.l-Zt*(arguments.length?t:1)))},Yt.rgb=function(){return Wt(this.h,this.c,this.l).rgb()},t.lab=Xt;var Zt=18,Jt=.95047,Kt=1,Qt=1.08883,$t=Xt.prototype=new Ut;function te(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return new ae(ie(3.2404542*(i=re(i)*Jt)-1.5371385*(n=re(n)*Kt)-.4985314*(a=re(a)*Qt)),ie(-.969266*i+1.8760108*n+.041556*a),ie(.0556434*i-.2040259*n+1.0572252*a))}function ee(t,e,r){return t>0?new Gt(Math.atan2(r,e)*Ct,Math.sqrt(e*e+r*r),t):new Gt(NaN,NaN,t)}function re(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ne(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ie(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ae(t,e,r){return this instanceof ae?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ae?new ae(t.r,t.g,t.b):ue(""+t,ae,Ht):new ae(t,e,r)}function oe(t){return new ae(t>>16,t>>8&255,255&t)}function se(t){return oe(t)+""}$t.brighter=function(t){return new Xt(Math.min(100,this.l+Zt*(arguments.length?t:1)),this.a,this.b)},$t.darker=function(t){return new Xt(Math.max(0,this.l-Zt*(arguments.length?t:1)),this.a,this.b)},$t.rgb=function(){return te(this.l,this.a,this.b)},t.rgb=ae;var le=ae.prototype=new Ut;function ce(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ue(t,e,r){var n,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(pe(i[0]),pe(i[1]),pe(i[2]))}return(a=me.get(t))?e(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function fe(t,e,r){var n,i,a=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=t==o?(e-r)/s+(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 Vt(n,i,l)}function he(t,e,r){var n=ne((.4124564*(t=de(t))+.3575761*(e=de(e))+.1804375*(r=de(r)))/Jt),i=ne((.2126729*t+.7151522*e+.072175*r)/Kt);return Xt(116*i-16,500*(n-i),200*(i-ne((.0193339*t+.119192*e+.9503041*r)/Qt)))}function de(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function pe(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}le.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,i=30;return e||r||n?(e&&e<i&&(e=i),r&&r<i&&(r=i),n&&n<i&&(n=i),new ae(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new ae(i,i,i)},le.darker=function(t){return new ae((t=Math.pow(.7,arguments.length?t:1))*this.r,t*this.g,t*this.b)},le.hsl=function(){return fe(this.r,this.g,this.b)},le.toString=function(){return"#"+ce(this.r)+ce(this.g)+ce(this.b)};var me=t.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});function ve(t){return"function"==typeof t?t:function(){return t}}function ge(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),ye(e,r,t,n)}}function ye(e,r,i,a){var o={},s=t.dispatch("beforesend","progress","load","error"),l={},c=new XMLHttpRequest,u=null;function f(){var t,e=c.status;if(!e&&function(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}(c)||e>=200&&e<300||304===e){try{t=i.call(o,c)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,c)}return!this.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(e)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=f:c.onreadystatechange=function(){c.readyState>3&&f()},c.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,c)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(u=t,o):u},o.response=function(t){return i=t,o},["get","post"].forEach(function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}}),o.send=function(t,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),c.open(t,e,!0),null==r||"accept"in l||(l.accept=r+",*/*"),c.setRequestHeader)for(var a in l)c.setRequestHeader(a,l[a]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),null!=i&&o.on("error",i).on("load",function(t){i(null,t)}),s.beforesend.call(o,c),c.send(null==n?null:n),o},o.abort=function(){return c.abort(),o},t.rebind(o,s,"on"),null==a?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(a))}me.forEach(function(t,e){me.set(t,oe(e))}),t.functor=ve,t.xhr=ge(P),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function i(t,r,n){arguments.length<3&&(n=r,r=null);var i=ye(t,e,null==r?a:o(r),n);return i.row=function(t){return arguments.length?i.response(null==(r=t)?a:o(t)):r},i}function a(t){return i.parse(t.responseText)}function o(t){return function(e){return i.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return i.parse=function(t,e){var r;return i.parseRows(t,function(t,n){if(r)return r(t,n-1);var i=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");r=e?function(t,r){return e(i(t),r)}:i})},i.parseRows=function(t,e){var r,i,a={},o={},s=[],l=t.length,c=0,u=0;function f(){if(c>=l)return o;if(i)return i=!1,a;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++<l;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}return c=r+2,13===(s=t.charCodeAt(r+1))?(i=!0,10===t.charCodeAt(r+2)&&++c):10===s&&(i=!0),t.slice(e+1,r).replace(/""/g,'"')}for(;c<l;){var s,u=1;if(10===(s=t.charCodeAt(c++)))i=!0;else if(13===s)i=!0,10===t.charCodeAt(c)&&(++c,++u);else if(s!==n)continue;return t.slice(e,c-u)}return t.slice(e)}for(;(r=f())!==o;){for(var h=[];r!==a&&r!==o;)h.push(r),r=f();e&&null==(h=e(h,u++))||s.push(h)}return s},i.format=function(e){if(Array.isArray(e[0]))return i.formatRows(e);var r=new C,n=[];return e.forEach(function(t){for(var e in t)r.has(e)||n.push(r.add(e))}),[n.map(l).join(t)].concat(e.map(function(e){return n.map(function(t){return l(e[t])}).join(t)})).join("\n")},i.formatRows=function(t){return t.map(s).join("\n")},i},t.csv=t.dsv(",","text/csv"),t.tsv=t.dsv("\t","text/tab-separated-values");var be,xe,_e,we,Me=this[O(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};function ke(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var i={c:t,t:r+e,n:null};return xe?xe.n=i:be=i,xe=i,_e||(we=clearTimeout(we),_e=1,Me(Ae)),i}function Ae(){var t=Te(),e=Ee()-t;e>24?(isFinite(e)&&(clearTimeout(we),we=setTimeout(Ae,e)),_e=0):(_e=1,Me(Ae))}function Te(){for(var t=Date.now(),e=be;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Ee(){for(var t,e=be,r=1/0;e;)e.c?(e.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:be=e.n;return xe=t,r}function Se(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}t.timer=function(){ke.apply(this,arguments)},t.timer.flush=function(){Te(),Ee()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var Le=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(function(t,e){var r=Math.pow(10,3*y(8-e));return{scale:e>8?function(t){return t/r}:function(t){return t*r},symbol:t}});t.formatPrefix=function(e,r){var n=0;return(e=+e)&&(e<0&&(e*=-1),r&&(e=t.round(e,Se(e,r))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Le[8+n/3]};var Ce=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Pe=t.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(e,r){return(e=t.round(e,Se(e,r))).toFixed(Math.max(0,Math.min(20,Se(e*(1+1e-15),r))))}});function ze(t){return t+""}var Oe=t.time={},De=Date;function Ie(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Ie.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Re.setUTCDate.apply(this._,arguments)},setDay:function(){Re.setUTCDay.apply(this._,arguments)},setFullYear:function(){Re.setUTCFullYear.apply(this._,arguments)},setHours:function(){Re.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Re.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Re.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Re.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Re.setUTCSeconds.apply(this._,arguments)},setTime:function(){Re.setTime.apply(this._,arguments)}};var Re=Date.prototype;function Ne(t,e,r){function n(e){var r=t(e),n=a(r,1);return e-r<n-e?r:n}function i(r){return e(r=t(new De(r-1)),1),r}function a(t,r){return e(t=new De(+t),r),t}function o(t,n,a){var o=i(t),s=[];if(a>1)for(;o<n;)r(o)%a||s.push(new Date(+o)),e(o,1);else for(;o<n;)s.push(new Date(+o)),e(o,1);return s}t.floor=t,t.round=n,t.ceil=i,t.offset=a,t.range=o;var s=t.utc=Fe(t);return s.floor=s,s.round=Fe(n),s.ceil=Fe(i),s.offset=Fe(a),s.range=function(t,e,r){try{De=Ie;var n=new Ie;return n._=t,o(n,e,r)}finally{De=Date}},t}function Fe(t){return function(e,r){try{De=Ie;var n=new Ie;return n._=e,t(n,r)._}finally{De=Date}}}Oe.year=Ne(function(t){return(t=Oe.day(t)).setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),Oe.years=Oe.year.range,Oe.years.utc=Oe.year.utc.range,Oe.day=Ne(function(t){var e=new De(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),Oe.days=Oe.day.range,Oe.days.utc=Oe.day.utc.range,Oe.dayOfYear=function(t){var e=Oe.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=Oe[t]=Ne(function(t){return(t=Oe.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=Oe.year(t).getDay();return Math.floor((Oe.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});Oe[t+"s"]=r.range,Oe[t+"s"].utc=r.utc.range,Oe[t+"OfYear"]=function(t){var r=Oe.year(t).getDay();return Math.floor((Oe.dayOfYear(t)+(r+e)%7)/7)}}),Oe.week=Oe.sunday,Oe.weeks=Oe.sunday.range,Oe.weeks.utc=Oe.sunday.utc.range,Oe.weekOfYear=Oe.sundayOfYear;var je={"-":"",_:" ",0:"0"},Be=/^\s*\d+/,Ue=/^%/;function Ve(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(e)+i:i)}function qe(e){return new RegExp("^(?:"+e.map(t.requote).join("|")+")","i")}function He(t){for(var e=new x,r=-1,n=t.length;++r<n;)e.set(t[r].toLowerCase(),r);return e}function Ge(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Ye(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r));return n?(t.U=+n[0],r+n[0].length):-1}function We(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r));return n?(t.W=+n[0],r+n[0].length):-1}function Xe(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Ze(t,e,r){Be.lastIndex=0;var n,i=Be.exec(e.slice(r,r+2));return i?(t.y=(n=+i[0])+(n>68?1900:2e3),r+i[0].length):-1}function Je(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Ke(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Qe(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function $e(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function tr(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function er(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function rr(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function nr(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function ir(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=y(e)/60|0,i=y(e)%60;return r+Ve(n,"0",2)+Ve(i,"0",2)}function ar(t,e,r){Ue.lastIndex=0;var n=Ue.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function or(t){for(var e=t.length,r=-1;++r<e;)t[r][0]=this(t[r][0]);return function(e){for(var r=0,n=t[r];!n[1](e);)n=t[++r];return n[0](e)}}t.locale=function(e){return{numberFormat:function(e){var r=e.decimal,n=e.thousands,i=e.grouping,a=e.currency,o=i&&n?function(t,e){for(var r=t.length,a=[],o=0,s=i[0],l=0;r>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(r-=s,r+s)),!((l+=s+1)>e));)s=i[o=(o+1)%i.length];return a.reverse().join(n)}:P;return function(e){var n=Ce.exec(e),i=n[1]||" ",s=n[2]||">",l=n[3]||"-",c=n[4]||"",u=n[5],f=+n[6],h=n[7],d=n[8],p=n[9],m=1,v="",g="",y=!1,b=!0;switch(d&&(d=+d.substring(1)),(u||"0"===i&&"="===s)&&(u=i="0",s="="),p){case"n":h=!0,p="g";break;case"%":m=100,g="%",p="f";break;case"p":m=100,g="%",p="r";break;case"b":case"o":case"x":case"X":"#"===c&&(v="0"+p.toLowerCase());case"c":b=!1;case"d":y=!0,d=0;break;case"s":m=-1,p="r"}"$"===c&&(v=a[0],g=a[1]),"r"!=p||d||(p="g"),null!=d&&("g"==p?d=Math.max(1,Math.min(21,d)):"e"!=p&&"f"!=p||(d=Math.max(0,Math.min(20,d)))),p=Pe.get(p)||ze;var x=u&&h;return function(e){var n=g;if(y&&e%1)return"";var a=e<0||0===e&&1/e<0?(e=-e,"-"):"-"===l?"":l;if(m<0){var c=t.formatPrefix(e,d);e=c.scale(e),n=c.symbol+g}else e*=m;var _,w,M=(e=p(e,d)).lastIndexOf(".");if(M<0){var k=b?e.lastIndexOf("e"):-1;k<0?(_=e,w=""):(_=e.substring(0,k),w=e.substring(k))}else _=e.substring(0,M),w=r+e.substring(M+1);!u&&h&&(_=o(_,1/0));var A=v.length+_.length+w.length+(x?0:a.length),T=A<f?new Array(A=f-A+1).join(i):"";return x&&(_=o(T+_,T.length?f-w.length:1/0)),a+=v,e=_+w,("<"===s?a+e+T:">"===s?T+a+e:"^"===s?T.substring(0,A>>=1)+a+e+T.substring(A):a+(x?e:T+e))+n}}}(e),timeFormat:function(e){var r=e.dateTime,n=e.date,i=e.time,a=e.periods,o=e.days,s=e.shortDays,l=e.months,c=e.shortMonths;function u(t){var e=t.length;function r(r){for(var n,i,a,o=[],s=-1,l=0;++s<e;)37===t.charCodeAt(s)&&(o.push(t.slice(l,s)),null!=(i=je[n=t.charAt(++s)])&&(n=t.charAt(++s)),(a=_[n])&&(n=a(r,null==i?"e"===n?" ":"0":i)),o.push(n),l=s+1);return o.push(t.slice(l,s)),o.join("")}return r.parse=function(e){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(f(r,t,e,0)!=e.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var n=null!=r.Z&&De!==Ie,i=new(n?Ie:De);return"j"in r?i.setFullYear(r.y,0,r.j):"W"in r||"U"in r?("w"in r||(r.w="W"in r?1:0),i.setFullYear(r.y,0,1),i.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(i.getDay()+5)%7:r.w+7*r.U-(i.getDay()+6)%7)):i.setFullYear(r.y,r.m,r.d),i.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),n?i._:i},r.toString=function(){return t},r}function f(t,e,r,n){for(var i,a,o,s=0,l=e.length,c=r.length;s<l;){if(n>=c)return-1;if(37===(i=e.charCodeAt(s++))){if(o=e.charAt(s++),!(a=w[o in je?e.charAt(s++):o])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}u.utc=function(t){var e=u(t);function r(t){try{var r=new(De=Ie);return r._=t,e(r)}finally{De=Date}}return r.parse=function(t){try{De=Ie;var r=e.parse(t);return r&&r._}finally{De=Date}},r.toString=e.toString,r},u.multi=u.utc.multi=or;var h=t.map(),d=qe(o),p=He(o),m=qe(s),v=He(s),g=qe(l),y=He(l),b=qe(c),x=He(c);a.forEach(function(t,e){h.set(t.toLowerCase(),e)});var _={a:function(t){return s[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return l[t.getMonth()]},c:u(r),d:function(t,e){return Ve(t.getDate(),e,2)},e:function(t,e){return Ve(t.getDate(),e,2)},H:function(t,e){return Ve(t.getHours(),e,2)},I:function(t,e){return Ve(t.getHours()%12||12,e,2)},j:function(t,e){return Ve(1+Oe.dayOfYear(t),e,3)},L:function(t,e){return Ve(t.getMilliseconds(),e,3)},m:function(t,e){return Ve(t.getMonth()+1,e,2)},M:function(t,e){return Ve(t.getMinutes(),e,2)},p:function(t){return a[+(t.getHours()>=12)]},S:function(t,e){return Ve(t.getSeconds(),e,2)},U:function(t,e){return Ve(Oe.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Ve(Oe.mondayOfYear(t),e,2)},x:u(n),X:u(i),y:function(t,e){return Ve(t.getFullYear()%100,e,2)},Y:function(t,e){return Ve(t.getFullYear()%1e4,e,4)},Z:ir,"%":function(){return"%"}},w={a:function(t,e,r){m.lastIndex=0;var n=m.exec(e.slice(r));return n?(t.w=v.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){d.lastIndex=0;var n=d.exec(e.slice(r));return n?(t.w=p.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){b.lastIndex=0;var n=b.exec(e.slice(r));return n?(t.m=x.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){g.lastIndex=0;var n=g.exec(e.slice(r));return n?(t.m=y.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,r){return f(t,_.c.toString(),e,r)},d:Qe,e:Qe,H:tr,I:tr,j:$e,L:nr,m:Ke,M:er,p:function(t,e,r){var n=h.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:rr,U:Ye,w:Ge,W:We,x:function(t,e,r){return f(t,_.x.toString(),e,r)},X:function(t,e,r){return f(t,_.X.toString(),e,r)},y:Ze,Y:Xe,Z:Je,"%":ar};return u}(e)}};var sr=t.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function lr(){}t.format=sr.numberFormat,t.geo={},lr.prototype={s:0,t:0,add:function(t){ur(t,this.t,cr),ur(cr.s,this.s,this),this.s?this.t+=cr.t:this.s=cr.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var cr=new lr;function ur(t,e,r){var n=r.s=t+e,i=n-t,a=n-i;r.t=t-a+(e-i)}function fr(t,e){t&&dr.hasOwnProperty(t.type)&&dr[t.type](t,e)}t.geo.stream=function(t,e){t&&hr.hasOwnProperty(t.type)?hr[t.type](t,e):fr(t,e)};var hr={Feature:function(t,e){fr(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n<i;)fr(r[n].geometry,e)}},dr={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){pr(t.coordinates,e,0)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)pr(r[n],e,0)},Polygon:function(t,e){mr(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)mr(r[n],e)},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,i=r.length;++n<i;)fr(r[n],e)}};function pr(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 mr(t,e){var r=-1,n=t.length;for(e.polygonStart();++r<n;)pr(t[r],e,1);e.polygonEnd()}t.geo.area=function(e){return vr=0,t.geo.stream(e,Lr),vr};var vr,gr,yr,br,xr,_r,wr,Mr,kr,Ar,Tr,Er,Sr=new lr,Lr={sphere:function(){vr+=4*At},point:I,lineStart:I,lineEnd:I,polygonStart:function(){Sr.reset(),Lr.lineStart=Cr},polygonEnd:function(){var t=2*Sr;vr+=t<0?4*At+t:t,Lr.lineStart=Lr.lineEnd=Lr.point=I}};function Cr(){var t,e,r,n,i;function a(t,e){e=e*Lt/2+At/4;var a=(t*=Lt)-r,o=a>=0?1:-1,s=o*a,l=Math.cos(e),c=Math.sin(e),u=i*c,f=n*l+u*Math.cos(s),h=u*o*Math.sin(s);Sr.add(Math.atan2(h,f)),r=t,n=l,i=c}Lr.point=function(o,s){Lr.point=a,r=(t=o)*Lt,n=Math.cos(s=(e=s)*Lt/2+At/4),i=Math.sin(s)},Lr.lineEnd=function(){a(t,e)}}function Pr(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function zr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Or(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Dr(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Ir(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Rr(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Nr(t){return[Math.atan2(t[1],t[0]),Dt(t[2])]}function Fr(t,e){return y(t[0]-e[0])<Mt&&y(t[1]-e[1])<Mt}t.geo.bounds=function(){var e,r,n,i,a,o,s,l,c,u,f,h={point:d,lineStart:m,lineEnd:v,polygonStart:function(){h.point=g,h.lineStart=b,h.lineEnd=x,c=0,Lr.polygonStart()},polygonEnd:function(){Lr.polygonEnd(),h.point=d,h.lineStart=m,h.lineEnd=v,Sr<0?(e=-(n=180),r=-(i=90)):c>Mt?i=90:c<-Mt&&(r=-90),f[0]=e,f[1]=n}};function d(t,a){u.push(f=[e=t,n=t]),a<r&&(r=a),a>i&&(i=a)}function p(t,o){var s=Pr([t*Lt,o*Lt]);if(l){var c=Or(l,s),u=Or([c[1],-c[0],0],c);Rr(u),u=Nr(u);var f=t-a,h=f>0?1:-1,p=u[0]*Ct*h,m=y(f)>180;if(m^(h*a<p&&p<h*t))(v=u[1]*Ct)>i&&(i=v);else if(m^(h*a<(p=(p+360)%360-180)&&p<h*t)){var v;(v=-u[1]*Ct)<r&&(r=v)}else o<r&&(r=o),o>i&&(i=o);m?t<a?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t):n>=e?(t<e&&(e=t),t>n&&(n=t)):t>a?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t)}else d(t,o);l=s,a=t}function m(){h.point=p}function v(){f[0]=e,f[1]=n,h.point=d,l=null}function g(t,e){if(l){var r=t-a;c+=y(r)>180?r+(r>0?360:-360):r}else o=t,s=e;Lr.point(t,e),p(t,e)}function b(){Lr.lineStart()}function x(){g(o,s),Lr.lineEnd(),y(c)>Mt&&(e=-(n=180)),f[0]=e,f[1]=n,l=null}function _(t,e){return(e-=t)<0?e+360:e}function w(t,e){return t[0]-e[0]}function M(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}return function(a){if(i=n=-(e=r=1/0),u=[],t.geo.stream(a,h),c=u.length){u.sort(w);for(var o=1,s=[m=u[0]];o<c;++o)M((d=u[o])[0],m)||M(d[1],m)?(_(m[0],d[1])>_(m[0],m[1])&&(m[1]=d[1]),_(d[0],m[1])>_(m[0],m[1])&&(m[0]=d[0])):s.push(m=d);for(var l,c,d,p=-1/0,m=(o=0,s[c=s.length-1]);o<=c;m=d,++o)d=s[o],(l=_(m[1],d[0]))>p&&(p=l,e=d[0],n=m[1])}return u=f=null,e===1/0||r===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,r],[n,i]]}}(),t.geo.centroid=function(e){gr=yr=br=xr=_r=wr=Mr=kr=Ar=Tr=Er=0,t.geo.stream(e,jr);var r=Ar,n=Tr,i=Er,a=r*r+n*n+i*i;return a<kt&&(r=wr,n=Mr,i=kr,yr<Mt&&(r=br,n=xr,i=_r),(a=r*r+n*n+i*i)<kt)?[NaN,NaN]:[Math.atan2(n,r)*Ct,Dt(i/Math.sqrt(a))*Ct]};var jr={sphere:I,point:Br,lineStart:Vr,lineEnd:qr,polygonStart:function(){jr.lineStart=Hr},polygonEnd:function(){jr.lineStart=Vr}};function Br(t,e){t*=Lt;var r=Math.cos(e*=Lt);Ur(r*Math.cos(t),r*Math.sin(t),Math.sin(e))}function Ur(t,e,r){br+=(t-br)/++gr,xr+=(e-xr)/gr,_r+=(r-_r)/gr}function Vr(){var t,e,r;function n(n,i){n*=Lt;var a=Math.cos(i*=Lt),o=a*Math.cos(n),s=a*Math.sin(n),l=Math.sin(i),c=Math.atan2(Math.sqrt((c=e*l-r*s)*c+(c=r*o-t*l)*c+(c=t*s-e*o)*c),t*o+e*s+r*l);yr+=c,wr+=c*(t+(t=o)),Mr+=c*(e+(e=s)),kr+=c*(r+(r=l)),Ur(t,e,r)}jr.point=function(i,a){i*=Lt;var o=Math.cos(a*=Lt);t=o*Math.cos(i),e=o*Math.sin(i),r=Math.sin(a),jr.point=n,Ur(t,e,r)}}function qr(){jr.point=Br}function Hr(){var t,e,r,n,i;function a(t,e){t*=Lt;var a=Math.cos(e*=Lt),o=a*Math.cos(t),s=a*Math.sin(t),l=Math.sin(e),c=n*l-i*s,u=i*o-r*l,f=r*s-n*o,h=Math.sqrt(c*c+u*u+f*f),d=r*o+n*s+i*l,p=h&&-Ot(d)/h,m=Math.atan2(h,d);Ar+=p*c,Tr+=p*u,Er+=p*f,yr+=m,wr+=m*(r+(r=o)),Mr+=m*(n+(n=s)),kr+=m*(i+(i=l)),Ur(r,n,i)}jr.point=function(o,s){t=o,e=s,jr.point=a,o*=Lt;var l=Math.cos(s*=Lt);r=l*Math.cos(o),n=l*Math.sin(o),i=Math.sin(s),Ur(r,n,i)},jr.lineEnd=function(){a(t,e),jr.lineEnd=qr,jr.point=Br}}function Gr(t,e){function r(r,n){return r=t(r,n),e(r[0],r[1])}return t.invert&&e.invert&&(r.invert=function(r,n){return(r=e.invert(r,n))&&t.invert(r[0],r[1])}),r}function Yr(){return!0}function Wr(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(Fr(r,n)){i.lineStart();for(var s=0;s<e;++s)i.point((r=t[s])[0],r[1]);i.lineEnd()}else{var l=new Zr(r,t,null,!0),c=new Zr(r,null,l,!1);l.o=c,a.push(l),o.push(c),c=new Zr(n,null,l=new Zr(n,t,null,!1),!0),l.o=c,a.push(l),o.push(c)}}}),o.sort(e),Xr(a),Xr(o),a.length){for(var s=0,l=r,c=o.length;s<c;++s)o[s].e=l=!l;for(var u,f,h=a[0];;){for(var d=h,p=!0;d.v;)if((d=d.n)===h)return;u=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(p)for(s=0,c=u.length;s<c;++s)i.point((f=u[s])[0],f[1]);else n(d.x,d.n.x,1,i);d=d.n}else{if(p)for(s=(u=d.p.z).length-1;s>=0;--s)i.point((f=u[s])[0],f[1]);else n(d.x,d.p.x,-1,i);d=d.p}u=(d=d.o).z,p=!p}while(!d.v);i.lineEnd()}}}function Xr(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n<e;)i.n=r=t[n],r.p=i,i=r;i.n=r=t[0],r.p=i}}function Zr(t,e,r,n){this.x=t,this.z=e,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function Jr(e,r,n,i){return function(a,o){var s,l=r(o),c=a.invert(i[0],i[1]),u={point:f,lineStart:d,lineEnd:p,polygonStart:function(){u.point=x,u.lineStart=_,u.lineEnd=w,s=[],m=[]},polygonEnd:function(){u.point=f,u.lineStart=d,u.lineEnd=p,s=t.merge(s);var e=function(t,e){var r=t[0],n=t[1],i=[Math.sin(r),-Math.cos(r),0],a=0,o=0;Sr.reset();for(var s=0,l=e.length;s<l;++s){var c=e[s],u=c.length;if(u)for(var f=c[0],h=f[0],d=f[1]/2+At/4,p=Math.sin(d),m=Math.cos(d),v=1;;){v===u&&(v=0);var g=(t=c[v])[0],y=t[1]/2+At/4,b=Math.sin(y),x=Math.cos(y),_=g-h,w=_>=0?1:-1,M=w*_,k=M>At,A=p*b;if(Sr.add(Math.atan2(A*w*Math.sin(M),m*x+A*Math.cos(M))),a+=k?_+w*Tt:_,k^h>=r^g>=r){var T=Or(Pr(f),Pr(t));Rr(T);var E=Or(i,T);Rr(E);var S=(k^_>=0?-1:1)*Dt(E[2]);(n>S||n===S&&(T[0]||T[1]))&&(o+=k^_>=0?1:-1)}if(!v++)break;h=g,p=b,m=x,f=t}}return(a<-Mt||a<Mt&&Sr<-Mt)^1&o}(c,m);s.length?(b||(o.polygonStart(),b=!0),Wr(s,$r,e,n,o)):e&&(b||(o.polygonStart(),b=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),b&&(o.polygonEnd(),b=!1),s=m=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function f(t,r){var n=a(t,r);e(t=n[0],r=n[1])&&o.point(t,r)}function h(t,e){var r=a(t,e);l.point(r[0],r[1])}function d(){u.point=h,l.lineStart()}function p(){u.point=f,l.lineEnd()}var m,v,g=Qr(),y=r(g),b=!1;function x(t,e){v.push([t,e]);var r=a(t,e);y.point(r[0],r[1])}function _(){y.lineStart(),v=[]}function w(){x(v[0][0],v[0][1]),y.lineEnd();var t,e=y.clean(),r=g.buffer(),n=r.length;if(v.pop(),m.push(v),v=null,n)if(1&e){var i,a=-1;if((n=(t=r[0]).length-1)>0){for(b||(o.polygonStart(),b=!0),o.lineStart();++a<n;)o.point((i=t[a])[0],i[1]);o.lineEnd()}}else n>1&&2&e&&r.push(r.pop().concat(r.shift())),s.push(r.filter(Kr))}return u}}function Kr(t){return t.length>1}function Qr(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:I,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function $r(t,e){return((t=t.x)[0]<0?t[1]-St-Mt:St-t[1])-((e=e.x)[0]<0?e[1]-St-Mt:St-e[1])}var tn=Jr(Yr,function(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?At:-At,l=y(a-r);y(l-At)<Mt?(t.point(r,n=(n+o)/2>0?St:-St),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=At&&(y(r-i)<Mt&&(r-=i*Mt),y(a-s)<Mt&&(a-=s*Mt),n=function(t,e,r,n){var i,a,o=Math.sin(t-r);return y(o)>Mt?Math.atan((Math.sin(e)*(a=Math.cos(n))*Math.sin(r)-Math.sin(n)*(i=Math.cos(e))*Math.sin(t))/(i*a*o)):(e+n)/2}(r,n,a,o),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=a,n=o),i=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}},function(t,e,r,n){var i;if(null==t)i=r*St,n.point(-At,i),n.point(0,i),n.point(At,i),n.point(At,0),n.point(At,-i),n.point(0,-i),n.point(-At,-i),n.point(-At,0),n.point(-At,i);else if(y(t[0]-e[0])>Mt){var a=t[0]<e[0]?At:-At;i=r*a/2,n.point(-a,i),n.point(0,i),n.point(a,i)}else n.point(e[0],e[1])},[-At,-At/2]);function en(t,e,r,n){return function(i){var a,o=i.a,s=i.b,l=o.x,c=o.y,u=0,f=1,h=s.x-l,d=s.y-c;if(a=t-l,h||!(a>0)){if(a/=h,h<0){if(a<u)return;a<f&&(f=a)}else if(h>0){if(a>f)return;a>u&&(u=a)}if(a=r-l,h||!(a<0)){if(a/=h,h<0){if(a>f)return;a>u&&(u=a)}else if(h>0){if(a<u)return;a<f&&(f=a)}if(a=e-c,d||!(a>0)){if(a/=d,d<0){if(a<u)return;a<f&&(f=a)}else if(d>0){if(a>f)return;a>u&&(u=a)}if(a=n-c,d||!(a<0)){if(a/=d,d<0){if(a>f)return;a>u&&(u=a)}else if(d>0){if(a<u)return;a<f&&(f=a)}return u>0&&(i.a={x:l+u*h,y:c+u*d}),f<1&&(i.b={x:l+f*h,y:c+f*d}),i}}}}}}var rn=1e9;function nn(e,r,n,i){return function(l){var c,u,f,h,d,p,m,v,g,y,b,x=l,_=Qr(),w=en(e,r,n,i),M={point:T,lineStart:function(){M.point=E,u&&u.push(f=[]);y=!0,g=!1,m=v=NaN},lineEnd:function(){c&&(E(h,d),p&&g&&_.rejoin(),c.push(_.buffer()));M.point=T,g&&l.lineEnd()},polygonStart:function(){l=_,c=[],u=[],b=!0},polygonEnd:function(){l=x,c=t.merge(c);var r=function(t){for(var e=0,r=u.length,n=t[1],i=0;i<r;++i)for(var a,o=1,s=u[i],l=s.length,c=s[0];o<l;++o)a=s[o],c[1]<=n?a[1]>n&&zt(c,a,t)>0&&++e:a[1]<=n&&zt(c,a,t)<0&&--e,c=a;return 0!==e}([e,i]),n=b&&r,a=c.length;(n||a)&&(l.polygonStart(),n&&(l.lineStart(),k(null,null,1,l),l.lineEnd()),a&&Wr(c,o,r,k,l),l.polygonEnd()),c=u=f=null}};function k(t,o,l,c){var u=0,f=0;if(null==t||(u=a(t,l))!==(f=a(o,l))||s(t,o)<0^l>0)do{c.point(0===u||3===u?e:n,u>1?i:r)}while((u=(u+l+4)%4)!==f);else c.point(o[0],o[1])}function A(t,a){return e<=t&&t<=n&&r<=a&&a<=i}function T(t,e){A(t,e)&&l.point(t,e)}function E(t,e){var r=A(t=Math.max(-rn,Math.min(rn,t)),e=Math.max(-rn,Math.min(rn,e)));if(u&&f.push([t,e]),y)h=t,d=e,p=r,y=!1,r&&(l.lineStart(),l.point(t,e));else if(r&&g)l.point(t,e);else{var n={a:{x:m,y:v},b:{x:t,y:e}};w(n)?(g||(l.lineStart(),l.point(n.a.x,n.a.y)),l.point(n.b.x,n.b.y),r||l.lineEnd(),b=!1):r&&(l.lineStart(),l.point(t,e),b=!1)}m=t,v=e,g=r}return M};function a(t,i){return y(t[0]-e)<Mt?i>0?0:3:y(t[0]-n)<Mt?i>0?2:1:y(t[1]-r)<Mt?i>0?1:0:i>0?3:2}function o(t,e){return s(t.x,e.x)}function s(t,e){var r=a(t,1),n=a(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}}function an(t){var e=0,r=At/3,n=En(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*At/180,r=t[1]*At/180):[e/At*180,r/At*180]},i}function on(t,e){var r=Math.sin(t),n=(r+Math.sin(e))/2,i=1+r*(2*n-r),a=Math.sqrt(i)/n;function o(t,e){var r=Math.sqrt(i-2*n*Math.sin(e))/n;return[r*Math.sin(t*=n),a-r*Math.cos(t)]}return o.invert=function(t,e){var r=a-e;return[Math.atan2(t,r)/n,Dt((i-(t*t+r*r)*n*n)/(2*n))]},o}t.geo.clipExtent=function(){var t,e,r,n,i,a,o={stream:function(t){return i&&(i.valid=!1),(i=a(t)).valid=!0,i},extent:function(s){return arguments.length?(a=nn(t=+s[0][0],e=+s[0][1],r=+s[1][0],n=+s[1][1]),i&&(i.valid=!1,i=null),o):[[t,e],[r,n]]}};return o.extent([[0,0],[960,500]])},(t.geo.conicEqualArea=function(){return an(on)}).raw=on,t.geo.albers=function(){return t.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},t.geo.albersUsa=function(){var e,r,n,i,a=t.geo.albers(),o=t.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=t.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,r){e=[t,r]}};function c(t){var a=t[0],o=t[1];return e=null,r(a,o),e||(n(a,o),e)||i(a,o),e}return c.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)},c.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()}}},c.precision=function(t){return arguments.length?(a.precision(t),o.precision(t),s.precision(t),c):a.precision()},c.scale=function(t){return arguments.length?(a.scale(t),o.scale(.35*t),s.scale(t),c.translate(a.translate())):a.scale()},c.translate=function(t){if(!arguments.length)return a.translate();var e=a.scale(),u=+t[0],f=+t[1];return r=a.translate(t).clipExtent([[u-.455*e,f-.238*e],[u+.455*e,f+.238*e]]).stream(l).point,n=o.translate([u-.307*e,f+.201*e]).clipExtent([[u-.425*e+Mt,f+.12*e+Mt],[u-.214*e-Mt,f+.234*e-Mt]]).stream(l).point,i=s.translate([u-.205*e,f+.212*e]).clipExtent([[u-.214*e+Mt,f+.166*e+Mt],[u-.115*e-Mt,f+.234*e-Mt]]).stream(l).point,c},c.scale(1070)};var sn,ln,cn,un,fn,hn,dn={point:I,lineStart:I,lineEnd:I,polygonStart:function(){ln=0,dn.lineStart=pn},polygonEnd:function(){dn.lineStart=dn.lineEnd=dn.point=I,sn+=y(ln/2)}};function pn(){var t,e,r,n;function i(t,e){ln+=n*t-r*e,r=t,n=e}dn.point=function(a,o){dn.point=i,t=r=a,e=n=o},dn.lineEnd=function(){i(t,e)}}var mn={point:function(t,e){t<cn&&(cn=t);t>fn&&(fn=t);e<un&&(un=e);e>hn&&(hn=e)},lineStart:I,lineEnd:I,polygonStart:I,polygonEnd:I};function vn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}var gn,yn={point:bn,lineStart:xn,lineEnd:_n,polygonStart:function(){yn.lineStart=wn},polygonEnd:function(){yn.point=bn,yn.lineStart=xn,yn.lineEnd=_n}};function bn(t,e){br+=t,xr+=e,++_r}function xn(){var t,e;function r(r,n){var i=r-t,a=n-e,o=Math.sqrt(i*i+a*a);wr+=o*(t+r)/2,Mr+=o*(e+n)/2,kr+=o,bn(t=r,e=n)}yn.point=function(n,i){yn.point=r,bn(t=n,e=i)}}function _n(){yn.point=bn}function wn(){var t,e,r,n;function i(t,e){var i=t-r,a=e-n,o=Math.sqrt(i*i+a*a);wr+=o*(r+t)/2,Mr+=o*(n+e)/2,kr+=o,Ar+=(o=n*t-r*e)*(r+t),Tr+=o*(n+e),Er+=3*o,bn(r=t,n=e)}yn.point=function(a,o){yn.point=i,bn(t=r=a,e=n=o)},yn.lineEnd=function(){i(t,e)}}function Mn(t){var e=.5,r=Math.cos(30*Lt),n=16;function i(e){return(n?function(e){var r,i,o,s,l,c,u,f,h,d,p,m,v={point:g,lineStart:y,lineEnd:x,polygonStart:function(){e.polygonStart(),v.lineStart=_},polygonEnd:function(){e.polygonEnd(),v.lineStart=y}};function g(r,n){r=t(r,n),e.point(r[0],r[1])}function y(){f=NaN,v.point=b,e.lineStart()}function b(r,i){var o=Pr([r,i]),s=t(r,i);a(f,h,u,d,p,m,f=s[0],h=s[1],u=r,d=o[0],p=o[1],m=o[2],n,e),e.point(f,h)}function x(){v.point=g,e.lineEnd()}function _(){y(),v.point=w,v.lineEnd=M}function w(t,e){b(r=t,e),i=f,o=h,s=d,l=p,c=m,v.point=b}function M(){a(f,h,u,d,p,m,i,o,r,s,l,c,n,e),v.lineEnd=x,x()}return v}:function(e){return An(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})})(e)}function a(n,i,o,s,l,c,u,f,h,d,p,m,v,g){var b=u-n,x=f-i,_=b*b+x*x;if(_>4*e&&v--){var w=s+d,M=l+p,k=c+m,A=Math.sqrt(w*w+M*M+k*k),T=Math.asin(k/=A),E=y(y(k)-1)<Mt||y(o-h)<Mt?(o+h)/2:Math.atan2(M,w),S=t(E,T),L=S[0],C=S[1],P=L-n,z=C-i,O=x*P-b*z;(O*O/_>e||y((b*P+x*z)/_-.5)>.3||s*d+l*p+c*m<r)&&(a(n,i,o,s,l,c,L,C,E,w/=A,M/=A,k,v,g),g.point(L,C),a(L,C,E,w,M,k,u,f,h,d,p,m,v,g))}}return i.precision=function(t){return arguments.length?(n=(e=t*t)>0&&16,i):Math.sqrt(e)},i}function kn(t){this.stream=t}function An(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function Tn(t){return En(function(){return t})()}function En(e){var r,n,i,a,o,s,l=Mn(function(t,e){return[(t=r(t,e))[0]*c+a,o-t[1]*c]}),c=150,u=480,f=250,h=0,d=0,p=0,m=0,v=0,g=tn,b=P,x=null,_=null;function w(t){return[(t=i(t[0]*Lt,t[1]*Lt))[0]*c+a,o-t[1]*c]}function M(t){return(t=i.invert((t[0]-a)/c,(o-t[1])/c))&&[t[0]*Ct,t[1]*Ct]}function k(){i=Gr(n=Pn(p,m,v),r);var t=r(h,d);return a=u-t[0]*c,o=f+t[1]*c,A()}function A(){return s&&(s.valid=!1,s=null),w}return w.stream=function(t){return s&&(s.valid=!1),(s=Sn(g(n,l(b(t))))).valid=!0,s},w.clipAngle=function(t){return arguments.length?(g=null==t?(x=t,tn):function(t){var e=Math.cos(t),r=e>0,n=y(e)>Mt;return Jr(i,function(t){var e,s,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(f,h){var d,p=[f,h],m=i(f,h),v=r?m?0:o(f,h):m?o(f+(f<0?At:-At),h):0;if(!e&&(c=l=m)&&t.lineStart(),m!==l&&(d=a(e,p),(Fr(e,d)||Fr(p,d))&&(p[0]+=Mt,p[1]+=Mt,m=i(p[0],p[1]))),m!==l)u=0,m?(t.lineStart(),d=a(p,e),t.point(d[0],d[1])):(d=a(e,p),t.point(d[0],d[1]),t.lineEnd()),e=d;else if(n&&e&&r^m){var g;v&s||!(g=a(p,e,!0))||(u=0,r?(t.lineStart(),t.point(g[0][0],g[0][1]),t.point(g[1][0],g[1][1]),t.lineEnd()):(t.point(g[1][0],g[1][1]),t.lineEnd(),t.lineStart(),t.point(g[0][0],g[0][1])))}!m||e&&Fr(e,p)||t.point(p[0],p[1]),e=p,l=m,s=v},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return u|(c&&l)<<1}}},In(t,6*Lt),r?[0,-t]:[-At,t-At]);function i(t,r){return Math.cos(t)*Math.cos(r)>e}function a(t,r,n){var i=[1,0,0],a=Or(Pr(t),Pr(r)),o=zr(a,a),s=a[0],l=o-s*s;if(!l)return!n&&t;var c=e*o/l,u=-e*s/l,f=Or(i,a),h=Ir(i,c);Dr(h,Ir(a,u));var d=f,p=zr(h,d),m=zr(d,d),v=p*p-m*(zr(h,h)-1);if(!(v<0)){var g=Math.sqrt(v),b=Ir(d,(-p-g)/m);if(Dr(b,h),b=Nr(b),!n)return b;var x,_=t[0],w=r[0],M=t[1],k=r[1];w<_&&(x=_,_=w,w=x);var A=w-_,T=y(A-At)<Mt;if(!T&&k<M&&(x=M,M=k,k=x),T||A<Mt?T?M+k>0^b[1]<(y(b[0]-_)<Mt?M:k):M<=b[1]&&b[1]<=k:A>At^(_<=b[0]&&b[0]<=w)){var E=Ir(d,(-p+g)/m);return Dr(E,h),[b,Nr(E)]}}}function o(e,n){var i=r?t:At-t,a=0;return e<-i?a|=1:e>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}}((x=+t)*Lt),A()):x},w.clipExtent=function(t){return arguments.length?(_=t,b=t?nn(t[0][0],t[0][1],t[1][0],t[1][1]):P,A()):_},w.scale=function(t){return arguments.length?(c=+t,k()):c},w.translate=function(t){return arguments.length?(u=+t[0],f=+t[1],k()):[u,f]},w.center=function(t){return arguments.length?(h=t[0]%360*Lt,d=t[1]%360*Lt,k()):[h*Ct,d*Ct]},w.rotate=function(t){return arguments.length?(p=t[0]%360*Lt,m=t[1]%360*Lt,v=t.length>2?t[2]%360*Lt:0,k()):[p*Ct,m*Ct,v*Ct]},t.rebind(w,l,"precision"),function(){return r=e.apply(this,arguments),w.invert=r.invert&&M,k()}}function Sn(t){return An(t,function(e,r){t.point(e*Lt,r*Lt)})}function Ln(t,e){return[t,e]}function Cn(t,e){return[t>At?t-Tt:t<-At?t+Tt:t,e]}function Pn(t,e,r){return t?e||r?Gr(On(t),Dn(e,r)):On(t):e||r?Dn(e,r):Cn}function zn(t){return function(e,r){return[(e+=t)>At?e-Tt:e<-At?e+Tt:e,r]}}function On(t){var e=zn(t);return e.invert=zn(-t),e}function Dn(t,e){var r=Math.cos(t),n=Math.sin(t),i=Math.cos(e),a=Math.sin(e);function o(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,c=Math.sin(e),u=c*r+s*n;return[Math.atan2(l*i-u*a,s*r-c*n),Dt(u*i+l*a)]}return o.invert=function(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,c=Math.sin(e),u=c*i-l*a;return[Math.atan2(l*i+c*a,s*r+u*n),Dt(u*r-s*n)]},o}function In(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=Rn(r,i),a=Rn(r,a),(o>0?i<a:i>a)&&(i+=o*Tt)):(i=t+o*Tt,a=t-.5*l);for(var c,u=i;o>0?u>a:u<a;u-=l)s.point((c=Nr([r,-n*Math.cos(u),-n*Math.sin(u)]))[0],c[1])}}function Rn(t,e){var r=Pr(e);r[0]-=t,Rr(r);var n=Ot(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-Mt)%(2*Math.PI)}function Nn(e,r,n){var i=t.range(e,r-Mt,n).concat(r);return function(t){return i.map(function(e){return[t,e]})}}function Fn(e,r,n){var i=t.range(e,r-Mt,n).concat(r);return function(t){return i.map(function(e){return[e,t]})}}function jn(t){return t.source}function Bn(t){return t.target}t.geo.path=function(){var e,r,n,i,a,o=4.5;function s(e){return e&&("function"==typeof o&&i.pointRadius(+o.apply(this,arguments)),a&&a.valid||(a=n(i)),t.geo.stream(e,a)),i.result()}function l(){return a=null,s}return s.area=function(e){return sn=0,t.geo.stream(e,n(dn)),sn},s.centroid=function(e){return br=xr=_r=wr=Mr=kr=Ar=Tr=Er=0,t.geo.stream(e,n(yn)),Er?[Ar/Er,Tr/Er]:kr?[wr/kr,Mr/kr]:_r?[br/_r,xr/_r]:[NaN,NaN]},s.bounds=function(e){return fn=hn=-(cn=un=1/0),t.geo.stream(e,n(mn)),[[cn,un],[fn,hn]]},s.projection=function(t){return arguments.length?(n=(e=t)?t.stream||(r=t,i=Mn(function(t,e){return r([t*Ct,e*Ct])}),function(t){return Sn(i(t))}):P,l()):e;var r,i},s.context=function(t){return arguments.length?(i=null==(r=t)?new function(){var t=vn(4.5),e=[],r={point:n,lineStart:function(){r.point=i},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(e){return t=vn(e),r},result:function(){if(e.length){var t=e.join("");return e=[],t}}};function n(r,n){e.push("M",r,",",n,t)}function i(t,n){e.push("M",t,",",n),r.point=a}function a(t,r){e.push("L",t,",",r)}function o(){r.point=n}function s(){e.push("Z")}return r}:new function(t){var e=4.5,r={point:n,lineStart:function(){r.point=i},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(t){return e=t,r},result:I};function n(r,n){t.moveTo(r+e,n),t.arc(r,n,e,0,Tt)}function i(e,n){t.moveTo(e,n),r.point=a}function a(e,r){t.lineTo(e,r)}function o(){r.point=n}function s(){t.closePath()}return r}(t),"function"!=typeof o&&i.pointRadius(o),l()):r},s.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(i.pointRadius(+t),+t),s):o},s.projection(t.geo.albersUsa()).context(null)},t.geo.transform=function(t){return{stream:function(e){var r=new kn(e);for(var n in t)r[n]=t[n];return r}}},kn.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},t.geo.projection=Tn,t.geo.projectionMutator=En,(t.geo.equirectangular=function(){return Tn(Ln)}).raw=Ln.invert=Ln,t.geo.rotation=function(t){function e(e){return(e=t(e[0]*Lt,e[1]*Lt))[0]*=Ct,e[1]*=Ct,e}return t=Pn(t[0]%360*Lt,t[1]*Lt,t.length>2?t[2]*Lt:0),e.invert=function(e){return(e=t.invert(e[0]*Lt,e[1]*Lt))[0]*=Ct,e[1]*=Ct,e},e},Cn.invert=Ln,t.geo.circle=function(){var t,e,r=[0,0],n=6;function i(){var t="function"==typeof r?r.apply(this,arguments):r,n=Pn(-t[0]*Lt,-t[1]*Lt,0).invert,i=[];return e(null,null,1,{point:function(t,e){i.push(t=n(t,e)),t[0]*=Ct,t[1]*=Ct}}),{type:"Polygon",coordinates:[i]}}return i.origin=function(t){return arguments.length?(r=t,i):r},i.angle=function(r){return arguments.length?(e=In((t=+r)*Lt,n*Lt),i):t},i.precision=function(r){return arguments.length?(e=In(t*Lt,(n=+r)*Lt),i):n},i.angle(90)},t.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Lt,i=t[1]*Lt,a=e[1]*Lt,o=Math.sin(n),s=Math.cos(n),l=Math.sin(i),c=Math.cos(i),u=Math.sin(a),f=Math.cos(a);return Math.atan2(Math.sqrt((r=f*o)*r+(r=c*u-l*f*s)*r),l*u+c*f*s)},t.geo.graticule=function(){var e,r,n,i,a,o,s,l,c,u,f,h,d=10,p=d,m=90,v=360,g=2.5;function b(){return{type:"MultiLineString",coordinates:x()}}function x(){return t.range(Math.ceil(i/m)*m,n,m).map(f).concat(t.range(Math.ceil(l/v)*v,s,v).map(h)).concat(t.range(Math.ceil(r/d)*d,e,d).filter(function(t){return y(t%m)>Mt}).map(c)).concat(t.range(Math.ceil(o/p)*p,a,p).filter(function(t){return y(t%v)>Mt}).map(u))}return b.lines=function(){return x().map(function(t){return{type:"LineString",coordinates:t}})},b.outline=function(){return{type:"Polygon",coordinates:[f(i).concat(h(s).slice(1),f(n).reverse().slice(1),h(l).reverse().slice(1))]}},b.extent=function(t){return arguments.length?b.majorExtent(t).minorExtent(t):b.minorExtent()},b.majorExtent=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],l=+t[0][1],s=+t[1][1],i>n&&(t=i,i=n,n=t),l>s&&(t=l,l=s,s=t),b.precision(g)):[[i,l],[n,s]]},b.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],o=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),o>a&&(t=o,o=a,a=t),b.precision(g)):[[r,o],[e,a]]},b.step=function(t){return arguments.length?b.majorStep(t).minorStep(t):b.minorStep()},b.majorStep=function(t){return arguments.length?(m=+t[0],v=+t[1],b):[m,v]},b.minorStep=function(t){return arguments.length?(d=+t[0],p=+t[1],b):[d,p]},b.precision=function(t){return arguments.length?(g=+t,c=Nn(o,a,90),u=Fn(r,e,g),f=Nn(l,s,90),h=Fn(i,n,g),b):g},b.majorExtent([[-180,-90+Mt],[180,90-Mt]]).minorExtent([[-180,-80-Mt],[180,80+Mt]])},t.geo.greatArc=function(){var e,r,n=jn,i=Bn;function a(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}return a.distance=function(){return t.geo.distance(e||n.apply(this,arguments),r||i.apply(this,arguments))},a.source=function(t){return arguments.length?(n=t,e="function"==typeof t?null:t,a):n},a.target=function(t){return arguments.length?(i=t,r="function"==typeof t?null:t,a):i},a.precision=function(){return arguments.length?a:0},a},t.geo.interpolate=function(t,e){return r=t[0]*Lt,n=t[1]*Lt,i=e[0]*Lt,a=e[1]*Lt,o=Math.cos(n),s=Math.sin(n),l=Math.cos(a),c=Math.sin(a),u=o*Math.cos(r),f=o*Math.sin(r),h=l*Math.cos(i),d=l*Math.sin(i),p=2*Math.asin(Math.sqrt(Rt(a-n)+o*l*Rt(i-r))),m=1/Math.sin(p),(v=p?function(t){var e=Math.sin(t*=p)*m,r=Math.sin(p-t)*m,n=r*u+e*h,i=r*f+e*d,a=r*s+e*c;return[Math.atan2(i,n)*Ct,Math.atan2(a,Math.sqrt(n*n+i*i))*Ct]}:function(){return[r*Ct,n*Ct]}).distance=p,v;var r,n,i,a,o,s,l,c,u,f,h,d,p,m,v},t.geo.length=function(e){return gn=0,t.geo.stream(e,Un),gn};var Un={sphere:I,point:I,lineStart:function(){var t,e,r;function n(n,i){var a=Math.sin(i*=Lt),o=Math.cos(i),s=y((n*=Lt)-t),l=Math.cos(s);gn+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=r*a-e*o*l)*s),e*a+r*o*l),t=n,e=a,r=o}Un.point=function(i,a){t=i*Lt,e=Math.sin(a*=Lt),r=Math.cos(a),Un.point=n},Un.lineEnd=function(){Un.point=Un.lineEnd=I}},lineEnd:I,polygonStart:I,polygonEnd:I};function Vn(t,e){function r(e,r){var n=Math.cos(e),i=Math.cos(r),a=t(n*i);return[a*i*Math.sin(e),a*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),i=e(n),a=Math.sin(i),o=Math.cos(i);return[Math.atan2(t*a,n*o),Math.asin(n&&r*a/n)]},r}var qn=Vn(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(t.geo.azimuthalEqualArea=function(){return Tn(qn)}).raw=qn;var Hn=Vn(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},P);function Gn(t,e){var r=Math.cos(t),n=function(t){return Math.tan(At/4+t/2)},i=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(n(e)/n(t)),a=r*Math.pow(n(t),i)/i;if(!i)return Xn;function o(t,e){a>0?e<-St+Mt&&(e=-St+Mt):e>St-Mt&&(e=St-Mt);var r=a/Math.pow(n(e),i);return[r*Math.sin(i*t),a-r*Math.cos(i*t)]}return o.invert=function(t,e){var r=a-e,n=Pt(i)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/i,2*Math.atan(Math.pow(a/n,1/i))-St]},o}function Yn(t,e){var r=Math.cos(t),n=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),i=r/n+t;if(y(n)<Mt)return Ln;function a(t,e){var r=i-e;return[r*Math.sin(n*t),i-r*Math.cos(n*t)]}return a.invert=function(t,e){var r=i-e;return[Math.atan2(t,r)/n,i-Pt(n)*Math.sqrt(t*t+r*r)]},a}(t.geo.azimuthalEquidistant=function(){return Tn(Hn)}).raw=Hn,(t.geo.conicConformal=function(){return an(Gn)}).raw=Gn,(t.geo.conicEquidistant=function(){return an(Yn)}).raw=Yn;var Wn=Vn(function(t){return 1/t},Math.atan);function Xn(t,e){return[t,Math.log(Math.tan(At/4+e/2))]}function Zn(t){var e,r=Tn(t),n=r.scale,i=r.translate,a=r.clipExtent;return r.scale=function(){var t=n.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.translate=function(){var t=i.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.clipExtent=function(t){var o=a.apply(r,arguments);if(o===r){if(e=null==t){var s=At*n(),l=i();a([[l[0]-s,l[1]-s],[l[0]+s,l[1]+s]])}}else e&&(o=null);return o},r.clipExtent(null)}(t.geo.gnomonic=function(){return Tn(Wn)}).raw=Wn,Xn.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-St]},(t.geo.mercator=function(){return Zn(Xn)}).raw=Xn;var Jn=Vn(function(){return 1},Math.asin);(t.geo.orthographic=function(){return Tn(Jn)}).raw=Jn;var Kn=Vn(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});function Qn(t,e){return[Math.log(Math.tan(At/4+e/2)),-t]}function $n(t){return t[0]}function ti(t){return t[1]}function ei(t){for(var e=t.length,r=[0,1],n=2,i=2;i<e;i++){for(;n>1&&zt(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function ri(t,e){return t[0]-e[0]||t[1]-e[1]}(t.geo.stereographic=function(){return Tn(Kn)}).raw=Kn,Qn.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-St]},(t.geo.transverseMercator=function(){var t=Zn(Qn),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90])}).raw=Qn,t.geom={},t.geom.hull=function(t){var e=$n,r=ti;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,i=ve(e),a=ve(r),o=t.length,s=[],l=[];for(n=0;n<o;n++)s.push([+i.call(this,t[n],n),+a.call(this,t[n],n),n]);for(s.sort(ri),n=0;n<o;n++)l.push([s[n][0],-s[n][1]]);var c=ei(s),u=ei(l),f=u[0]===c[0],h=u[u.length-1]===c[c.length-1],d=[];for(n=c.length-1;n>=0;--n)d.push(t[s[c[n]][2]]);for(n=+f;n<u.length-h;++n)d.push(t[s[u[n]][2]]);return d}return n.x=function(t){return arguments.length?(e=t,n):e},n.y=function(t){return arguments.length?(r=t,n):r},n},t.geom.polygon=function(t){return V(t,ni),t};var ni=t.geom.polygon.prototype=[];function ii(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function ai(t,e,r,n){var i=t[0],a=r[0],o=e[0]-i,s=n[0]-a,l=t[1],c=r[1],u=e[1]-l,f=n[1]-c,h=(s*(l-c)-f*(i-a))/(f*o-s*u);return[i+h*o,l+h*u]}function oi(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}ni.area=function(){for(var t,e=-1,r=this.length,n=this[r-1],i=0;++e<r;)t=n,n=this[e],i+=t[1]*n[0]-t[0]*n[1];return.5*i},ni.centroid=function(t){var e,r,n=-1,i=this.length,a=0,o=0,s=this[i-1];for(arguments.length||(t=-1/(6*this.area()));++n<i;)e=s,s=this[n],r=e[0]*s[1]-s[0]*e[1],a+=(e[0]+s[0])*r,o+=(e[1]+s[1])*r;return[a*t,o*t]},ni.clip=function(t){for(var e,r,n,i,a,o,s=oi(t),l=-1,c=this.length-oi(this),u=this[c-1];++l<c;){for(e=t.slice(),t.length=0,i=this[l],a=e[(n=e.length-s)-1],r=-1;++r<n;)ii(o=e[r],u,i)?(ii(a,u,i)||t.push(ai(a,o,u,i)),t.push(o)):ii(a,u,i)&&t.push(ai(a,o,u,i)),a=o;s&&t.push(t[0]),u=i}return t};var si,li,ci,ui,fi,hi=[],di=[];function pi(t){var e=hi.pop()||new function(){Ci(this),this.edge=this.site=this.circle=null};return e.site=t,e}function mi(t){Mi(t),ci.remove(t),hi.push(t),Ci(t)}function vi(t){var e=t.circle,r=e.x,n=e.cy,i={x:r,y:n},a=t.P,o=t.N,s=[t];mi(t);for(var l=a;l.circle&&y(r-l.circle.x)<Mt&&y(n-l.circle.cy)<Mt;)a=l.P,s.unshift(l),mi(l),l=a;s.unshift(l),Mi(l);for(var c=o;c.circle&&y(r-c.circle.x)<Mt&&y(n-c.circle.cy)<Mt;)o=c.N,s.push(c),mi(c),c=o;s.push(c),Mi(c);var u,f=s.length;for(u=1;u<f;++u)c=s[u],l=s[u-1],Ei(c.edge,l.site,c.site,i);l=s[0],(c=s[f-1]).edge=Ti(l.site,c.site,null,i),wi(l),wi(c)}function gi(t){for(var e,r,n,i,a=t.x,o=t.y,s=ci._;s;)if((n=yi(s,o)-a)>Mt)s=s.L;else{if(!((i=a-bi(s,o))>Mt)){n>-Mt?(e=s.P,r=s):i>-Mt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=pi(t);if(ci.insert(e,l),e||r){if(e===r)return Mi(e),r=pi(e.site),ci.insert(l,r),l.edge=r.edge=Ti(e.site,l.site),wi(e),void wi(r);if(r){Mi(e),Mi(r);var c=e.site,u=c.x,f=c.y,h=t.x-u,d=t.y-f,p=r.site,m=p.x-u,v=p.y-f,g=2*(h*v-d*m),y=h*h+d*d,b=m*m+v*v,x={x:(v*y-d*b)/g+u,y:(h*b-m*y)/g+f};Ei(r.edge,c,p,x),l.edge=Ti(c,t,null,x),r.edge=Ti(t,p,null,x),wi(e),wi(r)}else l.edge=Ti(e.site,l.site)}}function yi(t,e){var r=t.site,n=r.x,i=r.y,a=i-e;if(!a)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,c=l-e;if(!c)return s;var u=s-n,f=1/a-1/c,h=u/c;return f?(-h+Math.sqrt(h*h-2*f*(u*u/(-2*c)-l+c/2+i-a/2)))/f+n:(n+s)/2}function bi(t,e){var r=t.N;if(r)return yi(r,e);var n=t.site;return n.y===e?n.x:1/0}function xi(t){this.site=t,this.edges=[]}function _i(t,e){return e.angle-t.angle}function wi(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,i=t.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,c=n.y-s,u=a.x-o,f=2*(l*(v=a.y-s)-c*u);if(!(f>=-kt)){var h=l*l+c*c,d=u*u+v*v,p=(v*h-c*d)/f,m=(l*d-u*h)/f,v=m+s,g=di.pop()||new function(){Ci(this),this.x=this.y=this.arc=this.site=this.cy=null};g.arc=t,g.site=i,g.x=p+o,g.y=v+Math.sqrt(p*p+m*m),g.cy=v,t.circle=g;for(var y=null,b=fi._;b;)if(g.y<b.y||g.y===b.y&&g.x<=b.x){if(!b.L){y=b.P;break}b=b.L}else{if(!b.R){y=b;break}b=b.R}fi.insert(y,g),y||(ui=g)}}}}function Mi(t){var e=t.circle;e&&(e.P||(ui=e.N),fi.remove(e),di.push(e),Ci(e),t.circle=null)}function ki(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],c=e[1][1],u=t.l,f=t.r,h=u.x,d=u.y,p=f.x,m=f.y,v=(h+p)/2,g=(d+m)/2;if(m===d){if(v<o||v>=s)return;if(h>p){if(a){if(a.y>=c)return}else a={x:v,y:l};r={x:v,y:c}}else{if(a){if(a.y<l)return}else a={x:v,y:c};r={x:v,y:l}}}else if(i=g-(n=(h-p)/(m-d))*v,n<-1||n>1)if(h>p){if(a){if(a.y>=c)return}else a={x:(l-i)/n,y:l};r={x:(c-i)/n,y:c}}else{if(a){if(a.y<l)return}else a={x:(c-i)/n,y:c};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 Ai(t,e){this.l=t,this.r=e,this.a=this.b=null}function Ti(t,e,r,n){var i=new Ai(t,e);return si.push(i),r&&Ei(i,t,e,r),n&&Ei(i,e,t,n),li[t.i].edges.push(new Si(i,t,e)),li[e.i].edges.push(new Si(i,e,t)),i}function Ei(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 Si(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 Li(){this._=null}function Ci(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Pi(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 zi(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 Oi(t){for(;t.L;)t=t.L;return t}function Di(t,e){var r,n,i,a=t.sort(Ii).pop();for(si=[],li=new Array(t.length),ci=new Li,fi=new Li;;)if(i=ui,a&&(!i||a.y<i.y||a.y===i.y&&a.x<i.x))a.x===r&&a.y===n||(li[a.i]=new xi(a),gi(a),r=a.x,n=a.y),a=t.pop();else{if(!i)break;vi(i.arc)}e&&(function(t){for(var e,r=si,n=en(t[0][0],t[0][1],t[1][0],t[1][1]),i=r.length;i--;)(!ki(e=r[i],t)||!n(e)||y(e.a.x-e.b.x)<Mt&&y(e.a.y-e.b.y)<Mt)&&(e.a=e.b=null,r.splice(i,1))}(e),function(t){for(var e,r,n,i,a,o,s,l,c,u,f=t[0][0],h=t[1][0],d=t[0][1],p=t[1][1],m=li,v=m.length;v--;)if((a=m[v])&&a.prepare())for(l=(s=a.edges).length,o=0;o<l;)n=(u=s[o].end()).x,i=u.y,e=(c=s[++o%l].start()).x,r=c.y,(y(n-e)>Mt||y(i-r)>Mt)&&(s.splice(o,0,new Si((g=a.site,b=u,x=y(n-f)<Mt&&p-i>Mt?{x:f,y:y(e-f)<Mt?r:p}:y(i-p)<Mt&&h-n>Mt?{x:y(r-p)<Mt?e:h,y:p}:y(n-h)<Mt&&i-d>Mt?{x:h,y:y(e-h)<Mt?r:d}:y(i-d)<Mt&&n-f>Mt?{x:y(r-d)<Mt?e:f,y:d}:null,_=void 0,_=new Ai(g,null),_.a=b,_.b=x,si.push(_),_),a.site,null)),++l);var g,b,x,_}(e));var o={cells:li,edges:si};return ci=fi=si=li=null,o}function Ii(t,e){return e.y-t.y||e.x-t.x}xi.prototype.prepare=function(){for(var t,e=this.edges,r=e.length;r--;)(t=e[r].edge).b&&t.a||e.splice(r,1);return e.sort(_i),e.length},Si.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}},Li.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=Oi(this._),e.P=null,e.N=t,t.P=t.L=e,r=t):(e.P=e.N=null,this._=e,r=null);for(e.L=e.R=null,e.U=r,e.C=!0,t=e;r&&r.C;)r===(n=r.U).L?(i=n.R)&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.R&&(Pi(this,r),r=(t=r).U),r.C=!1,n.C=!0,zi(this,n)):(i=n.L)&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.L&&(zi(this,r),r=(t=r).U),r.C=!1,n.C=!0,Pi(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?Oi(o):a:o,i?i.L===t?i.L=r:i.R=r:this._=r,a&&o?(n=r.C,r.C=t.C,r.L=a,a.U=r,r!==o?(i=r.U,r.U=t.U,t=r.R,i.L=t,r.R=o,o.U=r):(r.U=i,i=r,t=r.R)):(n=t.C,t=r),t&&(t.U=i),!n)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((e=i.R).C&&(e.C=!1,i.C=!0,Pi(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,zi(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,Pi(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,zi(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,Pi(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,zi(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}},t.geom.voronoi=function(t){var e=$n,r=ti,n=e,i=r,a=Ri;if(t)return o(t);function o(t){var e=new Array(t.length),r=a[0][0],n=a[0][1],i=a[1][0],o=a[1][1];return Di(s(t),a).cells.forEach(function(a,s){var l=a.edges,c=a.site;(e[s]=l.length?l.map(function(t){var e=t.start();return[e.x,e.y]}):c.x>=r&&c.x<=i&&c.y>=n&&c.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=t[s]}),e}function s(t){return t.map(function(t,e){return{x:Math.round(n(t,e)/Mt)*Mt,y:Math.round(i(t,e)/Mt)*Mt,i:e}})}return o.links=function(t){return Di(s(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},o.triangles=function(t){var e=[];return Di(s(t)).cells.forEach(function(r,n){for(var i,a,o,s,l=r.site,c=r.edges.sort(_i),u=-1,f=c.length,h=c[f-1].edge,d=h.l===l?h.r:h.l;++u<f;)h,i=d,d=(h=c[u].edge).l===l?h.r:h.l,n<i.i&&n<d.i&&(o=i,s=d,((a=l).x-s.x)*(o.y-a.y)-(a.x-o.x)*(s.y-a.y)<0)&&e.push([t[n],t[i.i],t[d.i]])}),e},o.x=function(t){return arguments.length?(n=ve(e=t),o):e},o.y=function(t){return arguments.length?(i=ve(r=t),o):r},o.clipExtent=function(t){return arguments.length?(a=null==t?Ri:t,o):a===Ri?null:a},o.size=function(t){return arguments.length?o.clipExtent(t&&[[0,0],t]):a===Ri?null:a&&a[1]},o};var Ri=[[-1e6,-1e6],[1e6,1e6]];function Ni(t){return t.x}function Fi(t){return t.y}function ji(e,r){e=t.rgb(e),r=t.rgb(r);var n=e.r,i=e.g,a=e.b,o=r.r-n,s=r.g-i,l=r.b-a;return function(t){return"#"+ce(Math.round(n+o*t))+ce(Math.round(i+s*t))+ce(Math.round(a+l*t))}}function Bi(t,e){var r,n={},i={};for(r in t)r in e?n[r]=Gi(t[r],e[r]):i[r]=t[r];for(r in e)r in t||(i[r]=e[r]);return function(t){for(r in n)i[r]=n[r](t);return i}}function Ui(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Vi(t,e){var r,n,i,a=qi.lastIndex=Hi.lastIndex=0,o=-1,s=[],l=[];for(t+="",e+="";(r=qi.exec(t))&&(n=Hi.exec(e));)(i=n.index)>a&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:Ui(r,n)})),a=Hi.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?(e=l[0].x,function(t){return e(t)+""}):function(){return e}:(e=l.length,function(t){for(var r,n=0;n<e;++n)s[(r=l[n]).i]=r.x(t);return s.join("")})}t.geom.delaunay=function(e){return t.geom.voronoi().triangles(e)},t.geom.quadtree=function(t,e,r,n,i){var a,o=$n,s=ti;if(a=arguments.length)return o=Ni,s=Fi,3===a&&(i=r,n=e,r=e=0),l(t);function l(t){var l,c,u,f,h,d,p,m,v,g=ve(o),b=ve(s);if(null!=e)d=e,p=r,m=n,v=i;else if(m=v=-(d=p=1/0),c=[],u=[],h=t.length,a)for(f=0;f<h;++f)(l=t[f]).x<d&&(d=l.x),l.y<p&&(p=l.y),l.x>m&&(m=l.x),l.y>v&&(v=l.y),c.push(l.x),u.push(l.y);else for(f=0;f<h;++f){var x=+g(l=t[f],f),_=+b(l,f);x<d&&(d=x),_<p&&(p=_),x>m&&(m=x),_>v&&(v=_),c.push(x),u.push(_)}var w=m-d,M=v-p;function k(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(y(l-r)+y(c-n)<.01)A(t,e,r,n,i,a,o,s);else{var u=t.point;t.x=t.y=t.point=null,A(t,u,l,c,i,a,o,s),A(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else A(t,e,r,n,i,a,o,s)}function A(t,e,r,n,i,a,o,s){var l=.5*(i+o),c=.5*(a+s),u=r>=l,f=n>=c,h=f<<1|u;t.leaf=!1,t=t.nodes[h]||(t.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){k(T,t,+g(t,++f),+b(t,f),d,p,m,v)}}),u?i=l:o=l,f?a=c:s=c,k(t,e,r,n,i,a,o,s)}w>M?v=p+w:m=d+M;var T={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){k(T,t,+g(t,++f),+b(t,f),d,p,m,v)}};if(T.visit=function(t){!function t(e,r,n,i,a,o){if(!e(r,n,i,a,o)){var s=.5*(n+a),l=.5*(i+o),c=r.nodes;c[0]&&t(e,c[0],n,i,s,l),c[1]&&t(e,c[1],s,i,a,l),c[2]&&t(e,c[2],n,l,s,o),c[3]&&t(e,c[3],s,l,a,o)}}(t,T,d,p,m,v)},T.find=function(t){return function(t,e,r,n,i,a,o){var s,l=1/0;return function t(c,u,f,h,d){if(!(u>a||f>o||h<n||d<i)){if(p=c.point){var p,m=e-c.x,v=r-c.y,g=m*m+v*v;if(g<l){var y=Math.sqrt(l=g);n=e-y,i=r-y,a=e+y,o=r+y,s=p}}for(var b=c.nodes,x=.5*(u+h),_=.5*(f+d),w=(r>=_)<<1|e>=x,M=w+4;w<M;++w)if(c=b[3&w])switch(3&w){case 0:t(c,u,f,x,_);break;case 1:t(c,x,f,h,_);break;case 2:t(c,u,_,x,d);break;case 3:t(c,x,_,h,d)}}}(t,n,i,a,o),s}(T,t[0],t[1],d,p,m,v)},f=-1,null==e){for(;++f<h;)k(T,t[f],c[f],u[f],d,p,m,v);--f}else t.forEach(T.add);return c=u=t=l=null,T}return l.x=function(t){return arguments.length?(o=t,l):o},l.y=function(t){return arguments.length?(s=t,l):s},l.extent=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=+t[0][0],r=+t[0][1],n=+t[1][0],i=+t[1][1]),l):null==e?null:[[e,r],[n,i]]},l.size=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=r=0,n=+t[0],i=+t[1]),l):null==e?null:[n-e,i-r]},l},t.interpolateRgb=ji,t.interpolateObject=Bi,t.interpolateNumber=Ui,t.interpolateString=Vi;var qi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Hi=new RegExp(qi.source,"g");function Gi(e,r){for(var n,i=t.interpolators.length;--i>=0&&!(n=t.interpolators[i](e,r)););return n}function Yi(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r<s;++r)n.push(Gi(t[r],e[r]));for(;r<a;++r)i[r]=t[r];for(;r<o;++r)i[r]=e[r];return function(t){for(r=0;r<s;++r)i[r]=n[r](t);return i}}t.interpolate=Gi,t.interpolators=[function(t,e){var r=typeof e;return("string"===r?me.has(e.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(e)?ji:Vi:e instanceof Ut?ji:Array.isArray(e)?Yi:"object"===r&&isNaN(e)?Bi:Ui)(t,e)}],t.interpolateArray=Yi;var Wi=function(){return P},Xi=t.map({linear:Wi,poly:function(t){return function(e){return Math.pow(e,t)}},quad:function(){return Qi},cubic:function(){return $i},sin:function(){return ea},exp:function(){return ra},circle:function(){return na},elastic:function(t,e){var r;arguments.length<2&&(e=.45);arguments.length?r=e/Tt*Math.asin(1/t):(t=1,r=e/4);return function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*Tt/e)}},back:function(t){t||(t=1.70158);return function(e){return e*e*((t+1)*e-t)}},bounce:function(){return ia}}),Zi=t.map({in:P,out:Ji,"in-out":Ki,"out-in":function(t){return Ki(Ji(t))}});function Ji(t){return function(e){return 1-t(1-e)}}function Ki(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Qi(t){return t*t}function $i(t){return t*t*t}function ta(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function ea(t){return 1-Math.cos(t*St)}function ra(t){return Math.pow(2,10*(t-1))}function na(t){return 1-Math.sqrt(1-t*t)}function ia(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function aa(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function oa(t){var e,r,n,i=[t.a,t.b],a=[t.c,t.d],o=la(i),s=sa(i,a),l=la(((e=a)[0]+=(n=-s)*(r=i)[0],e[1]+=n*r[1],e))||0;i[0]*a[1]<a[0]*i[1]&&(i[0]*=-1,i[1]*=-1,o*=-1,s*=-1),this.rotate=(o?Math.atan2(i[1],i[0]):Math.atan2(-a[0],a[1]))*Ct,this.translate=[t.e,t.f],this.scale=[o,l],this.skew=l?Math.atan2(s,l)*Ct:0}function sa(t,e){return t[0]*e[0]+t[1]*e[1]}function la(t){var e=Math.sqrt(sa(t,t));return e&&(t[0]/=e,t[1]/=e),e}t.ease=function(t){var e,n=t.indexOf("-"),i=n>=0?t.slice(0,n):t,a=n>=0?t.slice(n+1):"in";return i=Xi.get(i)||Wi,a=Zi.get(a)||P,e=a(i.apply(null,r.call(arguments,1))),function(t){return t<=0?0:t>=1?1:e(t)}},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,i=e.c,a=e.l,o=r.h-n,s=r.c-i,l=r.l-a;isNaN(s)&&(s=0,i=isNaN(i)?r.c:i);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Wt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,i=e.s,a=e.l,o=r.h-n,s=r.s-i,l=r.l-a;isNaN(s)&&(s=0,i=isNaN(i)?r.s:i);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Ht(n+o*t,i+s*t,a+l*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,i=e.a,a=e.b,o=r.l-n,s=r.a-i,l=r.b-a;return function(t){return te(n+o*t,i+s*t,a+l*t)+""}},t.interpolateRound=aa,t.transform=function(e){var r=i.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new oa(e?e.matrix:ca)})(e)},oa.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var ca={a:1,b:0,c:0,d:1,e:0,f:0};function ua(t){return t.length?t.pop()+",":""}function fa(e,r){var n=[],i=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push("translate(",null,",",null,")");n.push({i:i-4,x:Ui(t[0],e[0])},{i:i-2,x:Ui(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,i),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(ua(r)+"rotate(",null,")")-2,x:Ui(t,e)})):e&&r.push(ua(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,i),function(t,e,r,n){t!==e?n.push({i:r.push(ua(r)+"skewX(",null,")")-2,x:Ui(t,e)}):e&&r.push(ua(r)+"skewX("+e+")")}(e.skew,r.skew,n,i),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(ua(r)+"scale(",null,",",null,")");n.push({i:i-4,x:Ui(t[0],e[0])},{i:i-2,x:Ui(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(ua(r)+"scale("+e+")")}(e.scale,r.scale,n,i),e=r=null,function(t){for(var e,r=-1,a=i.length;++r<a;)n[(e=i[r]).i]=e.x(t);return n.join("")}}function ha(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function da(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function pa(t){for(var e=t.source,r=t.target,n=function(t,e){if(t===e)return t;var r=ma(t),n=ma(e),i=r.pop(),a=n.pop(),o=null;for(;i===a;)o=i,i=r.pop(),a=n.pop();return o}(e,r),i=[e];e!==n;)e=e.parent,i.push(e);for(var a=i.length;r!==n;)i.splice(a,0,r),r=r.parent;return i}function ma(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function va(t){t.fixed|=2}function ga(t){t.fixed&=-7}function ya(t){t.fixed|=4,t.px=t.x,t.py=t.y}function ba(t){t.fixed&=-5}t.interpolateTransform=fa,t.layout={},t.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r<n;)e.push(pa(t[r]));return e}},t.layout.chord=function(){var e,r,n,i,a,o,s,l={},c=0;function u(){var l,u,h,d,p,m={},v=[],g=t.range(i),y=[];for(e=[],r=[],l=0,d=-1;++d<i;){for(u=0,p=-1;++p<i;)u+=n[d][p];v.push(u),y.push(t.range(i)),l+=u}for(a&&g.sort(function(t,e){return a(v[t],v[e])}),o&&y.forEach(function(t,e){t.sort(function(t,r){return o(n[e][t],n[e][r])})}),l=(Tt-c*i)/l,u=0,d=-1;++d<i;){for(h=u,p=-1;++p<i;){var b=g[d],x=y[b][p],_=n[b][x],w=u,M=u+=_*l;m[b+"-"+x]={index:b,subindex:x,startAngle:w,endAngle:M,value:_}}r[b]={index:b,startAngle:h,endAngle:u,value:v[b]},u+=c}for(d=-1;++d<i;)for(p=d-1;++p<i;){var k=m[d+"-"+p],A=m[p+"-"+d];(k.value||A.value)&&e.push(k.value<A.value?{source:A,target:k}:{source:k,target:A})}s&&f()}function f(){e.sort(function(t,e){return s((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}return l.matrix=function(t){return arguments.length?(i=(n=t)&&n.length,e=r=null,l):n},l.padding=function(t){return arguments.length?(c=t,e=r=null,l):c},l.sortGroups=function(t){return arguments.length?(a=t,e=r=null,l):a},l.sortSubgroups=function(t){return arguments.length?(o=t,e=null,l):o},l.sortChords=function(t){return arguments.length?(s=t,e&&f(),l):s},l.chords=function(){return e||u(),e},l.groups=function(){return r||u(),r},l},t.layout.force=function(){var e,r,n,i,a,o,s={},l=t.dispatch("start","tick","end"),c=[1,1],u=.9,f=xa,h=_a,d=-30,p=wa,m=.1,v=.64,g=[],y=[];function b(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<p){var c=e.charge/l;t.px-=a*c,t.py-=o*c}return!0}if(e.point&&l&&l<p){c=e.pointCharge/l;t.px-=a*c,t.py-=o*c}}return!e.charge}}function x(e){e.px=t.event.x,e.py=t.event.y,s.resume()}return s.tick=function(){if((n*=.99)<.005)return e=null,l.end({type:"end",alpha:n=0}),!0;var r,s,f,h,p,v,x,_,w,M=g.length,k=y.length;for(s=0;s<k;++s)h=(f=y[s]).source,(v=(_=(p=f.target).x-h.x)*_+(w=p.y-h.y)*w)&&(_*=v=n*a[s]*((v=Math.sqrt(v))-i[s])/v,w*=v,p.x-=_*(x=h.weight+p.weight?h.weight/(h.weight+p.weight):.5),p.y-=w*x,h.x+=_*(x=1-x),h.y+=w*x);if((x=n*m)&&(_=c[0]/2,w=c[1]/2,s=-1,x))for(;++s<M;)(f=g[s]).x+=(_-f.x)*x,f.y+=(w-f.y)*x;if(d)for(!function t(e,r,n){var i=0,a=0;e.charge=0;if(!e.leaf)for(var o,s=e.nodes,l=s.length,c=-1;++c<l;)null!=(o=s[c])&&(t(o,r,n),e.charge+=o.charge,i+=o.charge*o.cx,a+=o.charge*o.cy);if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var u=r*n[e.point.index];e.charge+=e.pointCharge=u,i+=u*e.point.x,a+=u*e.point.y}e.cx=i/e.charge;e.cy=a/e.charge}(r=t.geom.quadtree(g),n,o),s=-1;++s<M;)(f=g[s]).fixed||r.visit(b(f));for(s=-1;++s<M;)(f=g[s]).fixed?(f.x=f.px,f.y=f.py):(f.x-=(f.px-(f.px=f.x))*u,f.y-=(f.py-(f.py=f.y))*u);l.tick({type:"tick",alpha:n})},s.nodes=function(t){return arguments.length?(g=t,s):g},s.links=function(t){return arguments.length?(y=t,s):y},s.size=function(t){return arguments.length?(c=t,s):c},s.linkDistance=function(t){return arguments.length?(f="function"==typeof t?t:+t,s):f},s.distance=s.linkDistance,s.linkStrength=function(t){return arguments.length?(h="function"==typeof t?t:+t,s):h},s.friction=function(t){return arguments.length?(u=+t,s):u},s.charge=function(t){return arguments.length?(d="function"==typeof t?t:+t,s):d},s.chargeDistance=function(t){return arguments.length?(p=t*t,s):Math.sqrt(p)},s.gravity=function(t){return arguments.length?(m=+t,s):m},s.theta=function(t){return arguments.length?(v=t*t,s):Math.sqrt(v)},s.alpha=function(t){return arguments.length?(t=+t,n?t>0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=ke(s.tick)),s):n},s.start=function(){var t,e,r,n=g.length,l=y.length,u=c[0],p=c[1];for(t=0;t<n;++t)(r=g[t]).index=t,r.weight=0;for(t=0;t<l;++t)"number"==typeof(r=y[t]).source&&(r.source=g[r.source]),"number"==typeof r.target&&(r.target=g[r.target]),++r.source.weight,++r.target.weight;for(t=0;t<n;++t)r=g[t],isNaN(r.x)&&(r.x=m("x",u)),isNaN(r.y)&&(r.y=m("y",p)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],"function"==typeof f)for(t=0;t<l;++t)i[t]=+f.call(this,y[t],t);else for(t=0;t<l;++t)i[t]=f;if(a=[],"function"==typeof h)for(t=0;t<l;++t)a[t]=+h.call(this,y[t],t);else for(t=0;t<l;++t)a[t]=h;if(o=[],"function"==typeof d)for(t=0;t<n;++t)o[t]=+d.call(this,g[t],t);else for(t=0;t<n;++t)o[t]=d;function m(r,i){if(!e){for(e=new Array(n),c=0;c<n;++c)e[c]=[];for(c=0;c<l;++c){var a=y[c];e[a.source.index].push(a.target),e[a.target.index].push(a.source)}}for(var o,s=e[t],c=-1,u=s.length;++c<u;)if(!isNaN(o=s[c][r]))return o;return Math.random()*i}return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){if(r||(r=t.behavior.drag().origin(P).on("dragstart.force",va).on("drag.force",x).on("dragend.force",ga)),!arguments.length)return r;this.on("mouseover.force",ya).on("mouseout.force",ba).call(r)},t.rebind(s,l,"on")};var xa=20,_a=1,wa=1/0;function Ma(e,r){return t.rebind(e,r,"sort","children","value"),e.nodes=e,e.links=La,e}function ka(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 Aa(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(a=t.children)&&(i=a.length))for(var i,a,o=-1;++o<i;)r.push(a[o]);for(;null!=(t=n.pop());)e(t)}function Ta(t){return t.children}function Ea(t){return t.value}function Sa(t,e){return e.value-t.value}function La(e){return t.merge(e.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}t.layout.hierarchy=function(){var t=Sa,e=Ta,r=Ea;function n(i){var a,o=[i],s=[];for(i.depth=0;null!=(a=o.pop());)if(s.push(a),(c=e.call(n,a,a.depth))&&(l=c.length)){for(var l,c,u;--l>=0;)o.push(u=c[l]),u.parent=a,u.depth=a.depth+1;r&&(a.value=0),a.children=c}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return Aa(i,function(e){var n,i;t&&(n=e.children)&&n.sort(t),r&&(i=e.parent)&&(i.value+=e.value)}),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(ka(t,function(t){t.children&&(t.value=0)}),Aa(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,n){var i=e.call(this,t,n);return function t(e,r,n,i){var a=e.children;if(e.x=r,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(o=a.length)){var o,s,l,c=-1;for(n=e.value?n/e.value:0;++c<o;)t(s=a[c],r,l=s.value*n,i),r+=l}}(i[0],0,r[0],r[1]/function t(e){var r=e.children,n=0;if(r&&(i=r.length))for(var i,a=-1;++a<i;)n=Math.max(n,t(r[a]));return 1+n}(i[0])),i}return n.size=function(t){return arguments.length?(r=t,n):r},Ma(n,e)},t.layout.pie=function(){var e=Number,r=Ca,n=0,i=Tt,a=0;function o(s){var l,c=s.length,u=s.map(function(t,r){return+e.call(o,t,r)}),f=+("function"==typeof n?n.apply(this,arguments):n),h=("function"==typeof i?i.apply(this,arguments):i)-f,d=Math.min(Math.abs(h)/c,+("function"==typeof a?a.apply(this,arguments):a)),p=d*(h<0?-1:1),m=t.sum(u),v=m?(h-c*p)/m:0,g=t.range(c),y=[];return null!=r&&g.sort(r===Ca?function(t,e){return u[e]-u[t]}:function(t,e){return r(s[t],s[e])}),g.forEach(function(t){y[t]={data:s[t],value:l=u[t],startAngle:f,endAngle:f+=l*v+p,padAngle:d}}),y}return o.value=function(t){return arguments.length?(e=t,o):e},o.sort=function(t){return arguments.length?(r=t,o):r},o.startAngle=function(t){return arguments.length?(n=t,o):n},o.endAngle=function(t){return arguments.length?(i=t,o):i},o.padAngle=function(t){return arguments.length?(a=t,o):a},o};var Ca={};function Pa(t){return t.x}function za(t){return t.y}function Oa(t,e,r){t.y0=e,t.y=r}t.layout.stack=function(){var e=P,r=Ra,n=Na,i=Oa,a=Pa,o=za;function s(l,c){if(!(d=l.length))return l;var u=l.map(function(t,r){return e.call(s,t,r)}),f=u.map(function(t){return t.map(function(t,e){return[a.call(s,t,e),o.call(s,t,e)]})}),h=r.call(s,f,c);u=t.permute(u,h),f=t.permute(f,h);var d,p,m,v,g=n.call(s,f,c),y=u[0].length;for(m=0;m<y;++m)for(i.call(s,u[0][m],v=g[m],f[0][m][1]),p=1;p<d;++p)i.call(s,u[p][m],v+=f[p-1][m][1],f[p][m][1]);return l}return s.values=function(t){return arguments.length?(e=t,s):e},s.order=function(t){return arguments.length?(r="function"==typeof t?t:Da.get(t)||Ra,s):r},s.offset=function(t){return arguments.length?(n="function"==typeof t?t:Ia.get(t)||Na,s):n},s.x=function(t){return arguments.length?(a=t,s):a},s.y=function(t){return arguments.length?(o=t,s):o},s.out=function(t){return arguments.length?(i=t,s):i},s};var Da=t.map({"inside-out":function(e){var r,n,i=e.length,a=e.map(Fa),o=e.map(ja),s=t.range(i).sort(function(t,e){return a[t]-a[e]}),l=0,c=0,u=[],f=[];for(r=0;r<i;++r)n=s[r],l<c?(l+=o[n],u.push(n)):(c+=o[n],f.push(n));return f.reverse().concat(u)},reverse:function(e){return t.range(e.length).reverse()},default:Ra}),Ia=t.map({silhouette:function(t){var e,r,n,i=t.length,a=t[0].length,o=[],s=0,l=[];for(r=0;r<a;++r){for(e=0,n=0;e<i;e++)n+=t[e][r][1];n>s&&(s=n),o.push(n)}for(r=0;r<a;++r)l[r]=(s-o[r])/2;return l},wiggle:function(t){var e,r,n,i,a,o,s,l,c,u=t.length,f=t[0],h=f.length,d=[];for(d[0]=l=c=0,r=1;r<h;++r){for(e=0,i=0;e<u;++e)i+=t[e][r][1];for(e=0,a=0,s=f[r][0]-f[r-1][0];e<u;++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<c&&(c=l)}for(r=0;r<h;++r)d[r]-=c;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:Na});function Ra(e){return t.range(e.length)}function Na(t){for(var e=-1,r=t[0].length,n=[];++e<r;)n[e]=0;return n}function Fa(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 ja(t){return t.reduce(Ba,0)}function Ba(t,e){return t+e[1]}function Ua(t,e){return Va(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Va(t,e){for(var r=-1,n=+t[0],i=(t[1]-n)/e,a=[];++r<=e;)a[r]=i*r+n;return a}function qa(e){return[t.min(e),t.max(e)]}function Ha(t,e){return t.value-e.value}function Ga(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Ya(t,e){t._pack_next=e,e._pack_prev=t}function Wa(t,e){var r=e.x-t.x,n=e.y-t.y,i=t.r+e.r;return.999*i*i>r*r+n*n}function Xa(t){if((e=t.children)&&(l=e.length)){var e,r,n,i,a,o,s,l,c=1/0,u=-1/0,f=1/0,h=-1/0;if(e.forEach(Za),(r=e[0]).x=-r.r,r.y=0,b(r),l>1&&((n=e[1]).x=n.r,n.y=0,b(n),l>2))for(Ka(r,n,i=e[2]),b(i),Ga(r,i),r._pack_prev=i,Ga(i,n),n=r._pack_next,a=3;a<l;a++){Ka(r,n,i=e[a]);var d=0,p=1,m=1;for(o=n._pack_next;o!==n;o=o._pack_next,p++)if(Wa(o,i)){d=1;break}if(1==d)for(s=r._pack_prev;s!==o._pack_prev&&!Wa(s,i);s=s._pack_prev,m++);d?(p<m||p==m&&n.r<r.r?Ya(r,n=o):Ya(r=s,n),a--):(Ga(r,i),n=i,b(i))}var v=(c+u)/2,g=(f+h)/2,y=0;for(a=0;a<l;a++)(i=e[a]).x-=v,i.y-=g,y=Math.max(y,i.r+Math.sqrt(i.x*i.x+i.y*i.y));t.r=y,e.forEach(Ja)}function b(t){c=Math.min(t.x-t.r,c),u=Math.max(t.x+t.r,u),f=Math.min(t.y-t.r,f),h=Math.max(t.y+t.r,h)}}function Za(t){t._pack_next=t._pack_prev=t}function Ja(t){delete t._pack_next,delete t._pack_prev}function Ka(t,e,r){var n=t.r+r.r,i=e.x-t.x,a=e.y-t.y;if(n&&(i||a)){var o=e.r+r.r,s=i*i+a*a,l=.5+((n*=n)-(o*=o))/(2*s),c=Math.sqrt(Math.max(0,2*o*(n+s)-(n-=s)*n-o*o))/(2*s);r.x=t.x+l*i+c*a,r.y=t.y+l*a-c*i}else r.x=t.x+n,r.y=t.y}function Qa(t,e){return t.parent==e.parent?1:2}function $a(t){var e=t.children;return e.length?e[0]:t.t}function to(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function eo(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}function ro(t,e,r){return t.a.parent===e.parent?t.a:r}function no(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function io(t,e){var r=t.x+e[3],n=t.y+e[0],i=t.dx-e[1]-e[3],a=t.dy-e[0]-e[2];return i<0&&(r+=i/2,i=0),a<0&&(n+=a/2,a=0),{x:r,y:n,dx:i,dy:a}}function ao(t){var e=t[0],r=t[t.length-1];return e<r?[e,r]:[r,e]}function oo(t){return t.rangeExtent?t.rangeExtent():ao(t.range())}function so(t,e,r,n){var i=r(t[0],t[1]),a=n(e[0],e[1]);return function(t){return a(i(t))}}function lo(t,e){var r,n=0,i=t.length-1,a=t[n],o=t[i];return o<a&&(r=n,n=i,i=r,r=a,a=o,o=r),t[n]=e.floor(a),t[i]=e.ceil(o),t}function co(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:uo}t.layout.histogram=function(){var e=!0,r=Number,n=qa,i=Ua;function a(a,o){for(var s,l,c=[],u=a.map(r,this),f=n.call(this,u,o),h=i.call(this,f,u,o),d=(o=-1,u.length),p=h.length-1,m=e?1:1/d;++o<p;)(s=c[o]=[]).dx=h[o+1]-(s.x=h[o]),s.y=0;if(p>0)for(o=-1;++o<d;)(l=u[o])>=f[0]&&l<=f[1]&&((s=c[t.bisect(h,l,1,p)-1]).y+=m,s.push(a[o]));return c}return a.value=function(t){return arguments.length?(r=t,a):r},a.range=function(t){return arguments.length?(n=ve(t),a):n},a.bins=function(t){return arguments.length?(i="number"==typeof t?function(e){return Va(e,t)}:ve(t),a):i},a.frequency=function(t){return arguments.length?(e=!!t,a):e},a},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(Ha),n=0,i=[1,1];function a(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],c=i[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,Aa(s,function(t){t.r=+u(t.value)}),Aa(s,Xa),n){var f=n*(e?1:Math.max(2*s.r/l,2*s.r/c))/2;Aa(s,function(t){t.r+=f}),Aa(s,Xa),Aa(s,function(t){t.r-=f})}return function t(e,r,n,i){var a=e.children;e.x=r+=i*e.x;e.y=n+=i*e.y;e.r*=i;if(a)for(var o=-1,s=a.length;++o<s;)t(a[o],r,n,i)}(s,l/2,c/2,e?1:1/Math.max(2*s.r/l,2*s.r/c)),o}return a.size=function(t){return arguments.length?(i=t,a):i},a.radius=function(t){return arguments.length?(e=null==t||"function"==typeof t?t:+t,a):e},a.padding=function(t){return arguments.length?(n=+t,a):n},Ma(a,r)},t.layout.tree=function(){var e=t.layout.hierarchy().sort(null).value(null),r=Qa,n=[1,1],i=null;function a(t,a){var c=e.call(this,t,a),u=c[0],f=function(t){var e,r={A:null,children:[t]},n=[r];for(;null!=(e=n.pop());)for(var i,a=e.children,o=0,s=a.length;o<s;++o)n.push((a[o]=i={_:a[o],parent:e,children:(i=a[o].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=i);return r.children[0]}(u);if(Aa(f,o),f.parent.m=-f.z,ka(f,s),i)ka(u,l);else{var h=u,d=u,p=u;ka(u,function(t){t.x<h.x&&(h=t),t.x>d.x&&(d=t),t.depth>p.depth&&(p=t)});var m=r(h,d)/2-h.x,v=n[0]/(d.x+r(d,h)/2+m),g=n[1]/(p.depth||1);ka(u,function(t){t.x=(t.x+m)*v,t.y=t.depth*g})}return c}function o(t){var e=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,r=0,n=0,i=t.children,a=i.length;for(;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var a=(e[0].z+e[e.length-1].z)/2;i?(t.z=i.z+r(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+r(t._,i._));t.parent.A=function(t,e,n){if(e){for(var i,a=t,o=t,s=e,l=a.parent.children[0],c=a.m,u=o.m,f=s.m,h=l.m;s=to(s),a=$a(a),s&&a;)l=$a(l),(o=to(o)).a=t,(i=s.z+f-a.z-c+r(s._,a._))>0&&(eo(ro(s,t,n),t,i),c+=i,u+=i),f+=s.m,c+=a.m,h+=l.m,u+=o.m;s&&!to(o)&&(o.t=s,o.m+=f-u),a&&!$a(l)&&(l.t=a,l.m+=c-h,n=t)}return n}(t,i,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t)?l:null,a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null==(n=t)?null:l,a):i?n:null},Ma(a,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=Qa,n=[1,1],i=!1;function a(a,o){var s,l=e.call(this,a,o),c=l[0],u=0;Aa(c,function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}(n),e.y=function(e){return 1+t.max(e,function(t){return t.y})}(n)):(e.x=s?u+=r(e,s):0,e.y=0,s=e)});var f=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(c),h=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(c),d=f.x-r(f,h)/2,p=h.x+r(h,f)/2;return Aa(c,i?function(t){t.x=(t.x-c.x)*n[0],t.y=(c.y-t.y)*n[1]}:function(t){t.x=(t.x-d)/(p-d)*n[0],t.y=(1-(c.y?t.y/c.y:1))*n[1]}),l}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t),a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null!=(n=t),a):i?n:null},Ma(a,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,i=[1,1],a=null,o=no,s=!1,l="squarify",c=.5*(1+Math.sqrt(5));function u(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 f(t){var e=t.children;if(e&&e.length){var r,n,i,a=o(t),s=[],c=e.slice(),h=1/0,m="slice"===l?a.dx:"dice"===l?a.dy:"slice-dice"===l?1&t.depth?a.dy:a.dx:Math.min(a.dx,a.dy);for(u(c,a.dx*a.dy/t.value),s.area=0;(i=c.length)>0;)s.push(r=c[i-1]),s.area+=r.area,"squarify"!==l||(n=d(s,m))<=h?(c.pop(),h=n):(s.area-=s.pop().area,p(s,m,a,!1),m=Math.min(a.dx,a.dy),s.length=s.area=0,h=1/0);s.length&&(p(s,m,a,!0),s.length=s.area=0),e.forEach(f)}}function h(t){var e=t.children;if(e&&e.length){var r,n=o(t),i=e.slice(),a=[];for(u(i,n.dx*n.dy/t.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(p(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);e.forEach(h)}}function d(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++o<s;)(r=t[o].area)&&(r<a&&(a=r),r>i&&(i=r));return e*=e,(n*=n)?Math.max(e*i*c/n,n/(e*a*c)):1/0}function p(t,e,r,i){var a,o=-1,s=t.length,l=r.x,c=r.y,u=e?n(t.area/e):0;if(e==r.dx){for((i||u>r.dy)&&(u=r.dy);++o<s;)(a=t[o]).x=l,a.y=c,a.dy=u,l+=a.dx=Math.min(r.x+r.dx-l,u?n(a.area/u):0);a.z=!0,a.dx+=r.x+r.dx-l,r.y+=u,r.dy-=u}else{for((i||u>r.dx)&&(u=r.dx);++o<s;)(a=t[o]).x=l,a.y=c,a.dx=u,c+=a.dy=Math.min(r.y+r.dy-c,u?n(a.area/u):0);a.z=!1,a.dy+=r.y+r.dy-c,r.x+=u,r.dx-=u}}function m(t){var n=e||r(t),a=n[0];return a.x=a.y=0,a.value?(a.dx=i[0],a.dy=i[1]):a.dx=a.dy=0,e&&r.revalue(a),u([a],a.dx*a.dy/a.value),(e?h:f)(a),s&&(e=n),n}return m.size=function(t){return arguments.length?(i=t,m):i},m.padding=function(t){if(!arguments.length)return a;function e(e){return io(e,t)}var r;return o=null==(a=t)?no:"function"==(r=typeof t)?function(e){var r=t.call(m,e,e.depth);return null==r?no(e):io(e,"number"==typeof r?[r,r,r,r]:r)}:"number"===r?(t=[t,t,t,t],e):e,m},m.round=function(t){return arguments.length?(n=t?Math.round:Number,m):n!=Number},m.sticky=function(t){return arguments.length?(s=t,e=null,m):s},m.ratio=function(t){return arguments.length?(c=t,m):c},m.mode=function(t){return arguments.length?(l=t+"",m):l},Ma(m,r)},t.random={normal:function(t,e){var r=arguments.length;return r<2&&(e=1),r<1&&(t=0),function(){var r,n,i;do{i=(r=2*Math.random()-1)*r+(n=2*Math.random()-1)*n}while(!i||i>1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r<t;r++)e+=Math.random();return e}}},t.scale={};var uo={floor:P,ceil:P};function fo(e,r,n,i){var a=[],o=[],s=0,l=Math.min(e.length,r.length)-1;for(e[l]<e[0]&&(e=e.slice().reverse(),r=r.slice().reverse());++s<=l;)a.push(n(e[s-1],e[s])),o.push(i(r[s-1],r[s]));return function(r){var n=t.bisect(e,r,1,l)-1;return o[n](a[n](r))}}function ho(e,r){return t.rebind(e,r,"range","rangeRound","interpolate","clamp")}function po(t,e){return lo(t,co(mo(t,e)[2])),lo(t,co(mo(t,e)[2])),t}function mo(t,e){null==e&&(e=10);var r=ao(t),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),a=e/n*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function vo(e,r){return t.range.apply(t,mo(e,r))}function go(e,r,n){var i=mo(e,r);if(n){var a=Ce.exec(n);if(a.shift(),"s"===a[8]){var o=t.formatPrefix(Math.max(y(i[0]),y(i[1])));return a[7]||(a[7]="."+bo(o.scale(i[2]))),a[8]="f",n=t.format(a.join("")),function(t){return n(o.scale(t))+o.symbol}}a[7]||(a[7]="."+function(t,e){var r=bo(e[2]);return t in yo?Math.abs(r-bo(Math.max(y(e[0]),y(e[1]))))+ +("e"!==t):r-2*("%"===t)}(a[8],i)),n=a.join("")}else n=",."+bo(i[2])+"f";return t.format(n)}t.scale.linear=function(){return function t(e,r,n,i){var a,o;function s(){var t=Math.min(e.length,r.length)>2?fo:so,s=i?da:ha;return a=t(e,r,s,n),o=t(r,e,s,Gi),l}function l(t){return a(t)}l.invert=function(t){return o(t)};l.domain=function(t){return arguments.length?(e=t.map(Number),s()):e};l.range=function(t){return arguments.length?(r=t,s()):r};l.rangeRound=function(t){return l.range(t).interpolate(aa)};l.clamp=function(t){return arguments.length?(i=t,s()):i};l.interpolate=function(t){return arguments.length?(n=t,s()):n};l.ticks=function(t){return vo(e,t)};l.tickFormat=function(t,r){return go(e,t,r)};l.nice=function(t){return po(e,t),s()};l.copy=function(){return t(e,r,n,i)};return s()}([0,1],[0,1],Gi,!1)};var yo={s:1,g:1,p:1,r:1,e:1};function bo(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}t.scale.log=function(){return function e(r,n,i,a){function o(t){return(i?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(n)}function s(t){return i?Math.pow(n,t):-Math.pow(n,-t)}function l(t){return r(o(t))}l.invert=function(t){return s(r.invert(t))};l.domain=function(t){return arguments.length?(i=t[0]>=0,r.domain((a=t.map(Number)).map(o)),l):a};l.base=function(t){return arguments.length?(n=+t,r.domain(a.map(o)),l):n};l.nice=function(){var t=lo(a.map(o),i?Math:_o);return r.domain(t),a=t.map(s),l};l.ticks=function(){var t=ao(a),e=[],r=t[0],l=t[1],c=Math.floor(o(r)),u=Math.ceil(o(l)),f=n%1?2:n;if(isFinite(u-c)){if(i){for(;c<u;c++)for(var h=1;h<f;h++)e.push(s(c)*h);e.push(s(c))}else for(e.push(s(c));c++<u;)for(var h=f-1;h>0;h--)e.push(s(c)*h);for(c=0;e[c]<r;c++);for(u=e.length;e[u-1]>l;u--);e=e.slice(c,u)}return e};l.tickFormat=function(e,r){if(!arguments.length)return xo;arguments.length<2?r=xo:"function"!=typeof r&&(r=t.format(r));var i=Math.max(1,n*e/l.ticks().length);return function(t){var e=t/s(Math.round(o(t)));return e*n<n-.5&&(e*=n),e<=i?r(t):""}};l.copy=function(){return e(r.copy(),n,i,a)};return ho(l,r)}(t.scale.linear().domain([0,1]),10,!0,[1,10])};var xo=t.format(".0e"),_o={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function wo(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}t.scale.pow=function(){return function t(e,r,n){var i=wo(r),a=wo(1/r);function o(t){return e(i(t))}o.invert=function(t){return a(e.invert(t))};o.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(i)),o):n};o.ticks=function(t){return vo(n,t)};o.tickFormat=function(t,e){return go(n,t,e)};o.nice=function(t){return o.domain(po(n,t))};o.exponent=function(t){return arguments.length?(i=wo(r=t),a=wo(1/r),e.domain(n.map(i)),o):r};o.copy=function(){return t(e.copy(),r,n)};return ho(o,e)}(t.scale.linear(),1,[0,1])},t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return function e(r,n){var i,a,o;function s(t){return a[((i.get(t)||("range"===n.t?i.set(t,r.push(t)):NaN))-1)%a.length]}function l(e,n){return t.range(r.length).map(function(t){return e+n*t})}s.domain=function(t){if(!arguments.length)return r;r=[],i=new x;for(var e,a=-1,o=t.length;++a<o;)i.has(e=t[a])||i.set(e,r.push(e));return s[n.t].apply(s,n.a)};s.range=function(t){return arguments.length?(a=t,o=0,n={t:"range",a:arguments},s):a};s.rangePoints=function(t,e){arguments.length<2&&(e=0);var i=t[0],c=t[1],u=r.length<2?(i=(i+c)/2,0):(c-i)/(r.length-1+e);return a=l(i+u*e/2,u),o=0,n={t:"rangePoints",a:arguments},s};s.rangeRoundPoints=function(t,e){arguments.length<2&&(e=0);var i=t[0],c=t[1],u=r.length<2?(i=c=Math.round((i+c)/2),0):(c-i)/(r.length-1+e)|0;return a=l(i+Math.round(u*e/2+(c-i-(r.length-1+e)*u)/2),u),o=0,n={t:"rangeRoundPoints",a:arguments},s};s.rangeBands=function(t,e,i){arguments.length<2&&(e=0),arguments.length<3&&(i=e);var c=t[1]<t[0],u=t[c-0],f=t[1-c],h=(f-u)/(r.length-e+2*i);return a=l(u+h*i,h),c&&a.reverse(),o=h*(1-e),n={t:"rangeBands",a:arguments},s};s.rangeRoundBands=function(t,e,i){arguments.length<2&&(e=0),arguments.length<3&&(i=e);var c=t[1]<t[0],u=t[c-0],f=t[1-c],h=Math.floor((f-u)/(r.length-e+2*i));return a=l(u+Math.round((f-u-(r.length-e)*h)/2),h),c&&a.reverse(),o=Math.round(h*(1-e)),n={t:"rangeRoundBands",a:arguments},s};s.rangeBand=function(){return o};s.rangeExtent=function(){return ao(n.a[0])};s.copy=function(){return e(r,n)};return s.domain(r)}([],{t:"range",a:[[]]})},t.scale.category10=function(){return t.scale.ordinal().range(Mo)},t.scale.category20=function(){return t.scale.ordinal().range(ko)},t.scale.category20b=function(){return t.scale.ordinal().range(Ao)},t.scale.category20c=function(){return t.scale.ordinal().range(To)};var Mo=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(se),ko=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(se),Ao=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(se),To=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(se);function Eo(){return 0}t.scale.quantile=function(){return function e(r,n){var i;function a(){var e=0,a=n.length;for(i=[];++e<a;)i[e-1]=t.quantile(r,e/a);return o}function o(e){if(!isNaN(e=+e))return n[t.bisect(i,e)]}o.domain=function(t){return arguments.length?(r=t.map(d).filter(p).sort(h),a()):r};o.range=function(t){return arguments.length?(n=t,a()):n};o.quantiles=function(){return i};o.invertExtent=function(t){return(t=n.indexOf(t))<0?[NaN,NaN]:[t>0?i[t-1]:r[0],t<i.length?i[t]:r[r.length-1]]};o.copy=function(){return e(r,n)};return a()}([],[])},t.scale.quantize=function(){return function t(e,r,n){var i,a;function o(t){return n[Math.max(0,Math.min(a,Math.floor(i*(t-e))))]}function s(){return i=n.length/(r-e),a=n.length-1,o}o.domain=function(t){return arguments.length?(e=+t[0],r=+t[t.length-1],s()):[e,r]};o.range=function(t){return arguments.length?(n=t,s()):n};o.invertExtent=function(t){return[t=(t=n.indexOf(t))<0?NaN:t/i+e,t+1/i]};o.copy=function(){return t(e,r,n)};return s()}(0,1,[0,1])},t.scale.threshold=function(){return function e(r,n){function i(e){if(e<=e)return n[t.bisect(r,e)]}i.domain=function(t){return arguments.length?(r=t,i):r};i.range=function(t){return arguments.length?(n=t,i):n};i.invertExtent=function(t){return t=n.indexOf(t),[r[t-1],r[t]]};i.copy=function(){return e(r,n)};return i}([.5],[0,1])},t.scale.identity=function(){return function t(e){function r(t){return+t}r.invert=r;r.domain=r.range=function(t){return arguments.length?(e=t.map(r),r):e};r.ticks=function(t){return vo(e,t)};r.tickFormat=function(t,r){return go(e,t,r)};r.copy=function(){return t(e)};return r}([0,1])},t.svg={},t.svg.arc=function(){var t=Lo,e=Co,r=Eo,n=So,i=Po,a=zo,o=Oo;function s(){var s=Math.max(0,+t.apply(this,arguments)),c=Math.max(0,+e.apply(this,arguments)),u=i.apply(this,arguments)-St,f=a.apply(this,arguments)-St,h=Math.abs(f-u),d=u>f?0:1;if(c<s&&(p=c,c=s,s=p),h>=Et)return l(c,d)+(s?l(s,1-d):"")+"Z";var p,m,v,g,y,b,x,_,w,M,k,A,T=0,E=0,S=[];if((g=(+o.apply(this,arguments)||0)/2)&&(v=n===So?Math.sqrt(s*s+c*c):+n.apply(this,arguments),d||(E*=-1),c&&(E=Dt(v/c*Math.sin(g))),s&&(T=Dt(v/s*Math.sin(g)))),c){y=c*Math.cos(u+E),b=c*Math.sin(u+E),x=c*Math.cos(f-E),_=c*Math.sin(f-E);var L=Math.abs(f-u-2*E)<=At?0:1;if(E&&Do(y,b,x,_)===d^L){var C=(u+f)/2;y=c*Math.cos(C),b=c*Math.sin(C),x=_=null}}else y=b=0;if(s){w=s*Math.cos(f-T),M=s*Math.sin(f-T),k=s*Math.cos(u+T),A=s*Math.sin(u+T);var P=Math.abs(u-f+2*T)<=At?0:1;if(T&&Do(w,M,k,A)===1-d^P){var z=(u+f)/2;w=s*Math.cos(z),M=s*Math.sin(z),k=A=null}}else w=M=0;if(h>Mt&&(p=Math.min(Math.abs(c-s)/2,+r.apply(this,arguments)))>.001){m=s<c^d?0:1;var O=p,D=p;if(h<At){var I=null==k?[w,M]:null==x?[y,b]:ai([y,b],[k,A],[x,_],[w,M]),R=y-I[0],N=b-I[1],F=x-I[0],j=_-I[1],B=1/Math.sin(Math.acos((R*F+N*j)/(Math.sqrt(R*R+N*N)*Math.sqrt(F*F+j*j)))/2),U=Math.sqrt(I[0]*I[0]+I[1]*I[1]);D=Math.min(p,(s-U)/(B-1)),O=Math.min(p,(c-U)/(B+1))}if(null!=x){var V=Io(null==k?[w,M]:[k,A],[y,b],c,O,d),q=Io([x,_],[w,M],c,O,d);p===O?S.push("M",V[0],"A",O,",",O," 0 0,",m," ",V[1],"A",c,",",c," 0 ",1-d^Do(V[1][0],V[1][1],q[1][0],q[1][1]),",",d," ",q[1],"A",O,",",O," 0 0,",m," ",q[0]):S.push("M",V[0],"A",O,",",O," 0 1,",m," ",q[0])}else S.push("M",y,",",b);if(null!=k){var H=Io([y,b],[k,A],s,-D,d),G=Io([w,M],null==x?[y,b]:[x,_],s,-D,d);p===D?S.push("L",G[0],"A",D,",",D," 0 0,",m," ",G[1],"A",s,",",s," 0 ",d^Do(G[1][0],G[1][1],H[1][0],H[1][1]),",",1-d," ",H[1],"A",D,",",D," 0 0,",m," ",H[0]):S.push("L",G[0],"A",D,",",D," 0 0,",m," ",H[0])}else S.push("L",w,",",M)}else S.push("M",y,",",b),null!=x&&S.push("A",c,",",c," 0 ",L,",",d," ",x,",",_),S.push("L",w,",",M),null!=k&&S.push("A",s,",",s," 0 ",P,",",1-d," ",k,",",A);return S.push("Z"),S.join("")}function l(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}return s.innerRadius=function(e){return arguments.length?(t=ve(e),s):t},s.outerRadius=function(t){return arguments.length?(e=ve(t),s):e},s.cornerRadius=function(t){return arguments.length?(r=ve(t),s):r},s.padRadius=function(t){return arguments.length?(n=t==So?So:ve(t),s):n},s.startAngle=function(t){return arguments.length?(i=ve(t),s):i},s.endAngle=function(t){return arguments.length?(a=ve(t),s):a},s.padAngle=function(t){return arguments.length?(o=ve(t),s):o},s.centroid=function(){var r=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-St;return[Math.cos(n)*r,Math.sin(n)*r]},s};var So="auto";function Lo(t){return t.innerRadius}function Co(t){return t.outerRadius}function Po(t){return t.startAngle}function zo(t){return t.endAngle}function Oo(t){return t&&t.padAngle}function Do(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function Io(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,c=-s*a,u=t[0]+l,f=t[1]+c,h=e[0]+l,d=e[1]+c,p=(u+h)/2,m=(f+d)/2,v=h-u,g=d-f,y=v*v+g*g,b=r-n,x=u*d-h*f,_=(g<0?-1:1)*Math.sqrt(Math.max(0,b*b*y-x*x)),w=(x*g-v*_)/y,M=(-x*v-g*_)/y,k=(x*g+v*_)/y,A=(-x*v+g*_)/y,T=w-p,E=M-m,S=k-p,L=A-m;return T*T+E*E>S*S+L*L&&(w=k,M=A),[[w-l,M-c],[w*r/b,M*r/b]]}function Ro(t){var e=$n,r=ti,n=Yr,i=Fo,a=i.key,o=.7;function s(a){var s,l=[],c=[],u=-1,f=a.length,h=ve(e),d=ve(r);function p(){l.push("M",i(t(c),o))}for(;++u<f;)n.call(this,s=a[u],u)?c.push([+h.call(this,s,u),+d.call(this,s,u)]):c.length&&(p(),c=[]);return c.length&&p(),l.length?l.join(""):null}return s.x=function(t){return arguments.length?(e=t,s):e},s.y=function(t){return arguments.length?(r=t,s):r},s.defined=function(t){return arguments.length?(n=t,s):n},s.interpolate=function(t){return arguments.length?(a="function"==typeof t?i=t:(i=No.get(t)||Fo).key,s):a},s.tension=function(t){return arguments.length?(o=t,s):o},s}t.svg.line=function(){return Ro(P)};var No=t.map({linear:Fo,"linear-closed":jo,step:function(t){var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];for(;++e<r;)i.push("H",(n[0]+(n=t[e])[0])/2,"V",n[1]);r>1&&i.push("H",n[0]);return i.join("")},"step-before":Bo,"step-after":Uo,basis:Ho,"basis-open":function(t){if(t.length<4)return Fo(t);var e,r=[],n=-1,i=t.length,a=[0],o=[0];for(;++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);r.push(Go(Xo,a)+","+Go(Xo,o)),--n;for(;++n<i;)e=t[n],a.shift(),a.push(e[0]),o.shift(),o.push(e[1]),Zo(r,a,o);return r.join("")},"basis-closed":function(t){var e,r,n=-1,i=t.length,a=i+4,o=[],s=[];for(;++n<4;)r=t[n%i],o.push(r[0]),s.push(r[1]);e=[Go(Xo,o),",",Go(Xo,s)],--n;for(;++n<a;)r=t[n%i],o.shift(),o.push(r[0]),s.shift(),s.push(r[1]),Zo(e,o,s);return e.join("")},bundle:function(t,e){var r=t.length-1;if(r)for(var n,i,a=t[0][0],o=t[0][1],s=t[r][0]-a,l=t[r][1]-o,c=-1;++c<=r;)n=t[c],i=c/r,n[0]=e*n[0]+(1-e)*(a+i*s),n[1]=e*n[1]+(1-e)*(o+i*l);return Ho(t)},cardinal:function(t,e){return t.length<3?Fo(t):t[0]+Vo(t,qo(t,e))},"cardinal-open":function(t,e){return t.length<4?Fo(t):t[1]+Vo(t.slice(1,-1),qo(t,e))},"cardinal-closed":function(t,e){return t.length<3?jo(t):t[0]+Vo((t.push(t[0]),t),qo([t[t.length-2]].concat(t,[t[1]]),e))},monotone:function(t){return t.length<3?Fo(t):t[0]+Vo(t,function(t){var e,r,n,i,a=[],o=function(t){var e=0,r=t.length-1,n=[],i=t[0],a=t[1],o=n[0]=Jo(i,a);for(;++e<r;)n[e]=(o+(o=Jo(i=a,a=t[e+1])))/2;return n[e]=o,n}(t),s=-1,l=t.length-1;for(;++s<l;)e=Jo(t[s],t[s+1]),y(e)<Mt?o[s]=o[s+1]=0:(r=o[s]/e,n=o[s+1]/e,(i=r*r+n*n)>9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n));s=-1;for(;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}(t))}});function Fo(t){return t.length>1?t.join("L"):t+"Z"}function jo(t){return t.join("L")+"Z"}function Bo(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 Uo(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 Vo(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return Fo(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 c=2;c<e.length;c++,l++)a=t[l],s=e[c],n+="S"+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1]}if(r){var u=t[l];n+="Q"+(a[0]+2*s[0]/3)+","+(a[1]+2*s[1]/3)+","+u[0]+","+u[1]}return n}function qo(t,e){for(var r,n=[],i=(1-e)/2,a=t[0],o=t[1],s=1,l=t.length;++s<l;)r=a,a=o,o=t[s],n.push([i*(o[0]-r[0]),i*(o[1]-r[1])]);return n}function Ho(t){if(t.length<3)return Fo(t);var e=1,r=t.length,n=t[0],i=n[0],a=n[1],o=[i,i,i,(n=t[1])[0]],s=[a,a,a,n[1]],l=[i,",",a,"L",Go(Xo,o),",",Go(Xo,s)];for(t.push(t[r-1]);++e<=r;)n=t[e],o.shift(),o.push(n[0]),s.shift(),s.push(n[1]),Zo(l,o,s);return t.pop(),l.push("L",n),l.join("")}function Go(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}No.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Yo=[0,2/3,1/3,0],Wo=[0,1/3,2/3,0],Xo=[0,1/6,2/3,1/6];function Zo(t,e,r){t.push("C",Go(Yo,e),",",Go(Yo,r),",",Go(Wo,e),",",Go(Wo,r),",",Go(Xo,e),",",Go(Xo,r))}function Jo(t,e){return(e[1]-t[1])/(e[0]-t[0])}function Ko(t){for(var e,r,n,i=-1,a=t.length;++i<a;)r=(e=t[i])[0],n=e[1]-St,e[0]=r*Math.cos(n),e[1]=r*Math.sin(n);return t}function Qo(t){var e=$n,r=$n,n=0,i=ti,a=Yr,o=Fo,s=o.key,l=o,c="L",u=.7;function f(s){var f,h,d,p=[],m=[],v=[],g=-1,y=s.length,b=ve(e),x=ve(n),_=e===r?function(){return h}:ve(r),w=n===i?function(){return d}:ve(i);function M(){p.push("M",o(t(v),u),c,l(t(m.reverse()),u),"Z")}for(;++g<y;)a.call(this,f=s[g],g)?(m.push([h=+b.call(this,f,g),d=+x.call(this,f,g)]),v.push([+_.call(this,f,g),+w.call(this,f,g)])):m.length&&(M(),m=[],v=[]);return m.length&&M(),p.length?p.join(""):null}return f.x=function(t){return arguments.length?(e=r=t,f):r},f.x0=function(t){return arguments.length?(e=t,f):e},f.x1=function(t){return arguments.length?(r=t,f):r},f.y=function(t){return arguments.length?(n=i=t,f):i},f.y0=function(t){return arguments.length?(n=t,f):n},f.y1=function(t){return arguments.length?(i=t,f):i},f.defined=function(t){return arguments.length?(a=t,f):a},f.interpolate=function(t){return arguments.length?(s="function"==typeof t?o=t:(o=No.get(t)||Fo).key,l=o.reverse||o,c=o.closed?"M":"L",f):s},f.tension=function(t){return arguments.length?(u=t,f):u},f}function $o(t){return t.radius}function ts(t){return[t.x,t.y]}function es(){return 64}function rs(){return"circle"}function ns(t){var e=Math.sqrt(t/At);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}t.svg.line.radial=function(){var t=Ro(Ko);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},Bo.reverse=Uo,Uo.reverse=Bo,t.svg.area=function(){return Qo(P)},t.svg.area.radial=function(){var t=Qo(Ko);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},t.svg.chord=function(){var t=jn,e=Bn,r=$o,n=Po,i=zo;function a(r,n){var i,a,c=o(this,t,r,n),u=o(this,e,r,n);return"M"+c.p0+s(c.r,c.p1,c.a1-c.a0)+(a=u,(i=c).a0==a.a0&&i.a1==a.a1?l(c.r,c.p1,c.r,c.p0):l(c.r,c.p1,u.r,u.p0)+s(u.r,u.p1,u.a1-u.a0)+l(u.r,u.p1,c.r,c.p0))+"Z"}function o(t,e,a,o){var s=e.call(t,a,o),l=r.call(t,s,o),c=n.call(t,s,o)-St,u=i.call(t,s,o)-St;return{r:l,a0:c,a1:u,p0:[l*Math.cos(c),l*Math.sin(c)],p1:[l*Math.cos(u),l*Math.sin(u)]}}function s(t,e,r){return"A"+t+","+t+" 0 "+ +(r>At)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return a.radius=function(t){return arguments.length?(r=ve(t),a):r},a.source=function(e){return arguments.length?(t=ve(e),a):t},a.target=function(t){return arguments.length?(e=ve(t),a):e},a.startAngle=function(t){return arguments.length?(n=ve(t),a):n},a.endAngle=function(t){return arguments.length?(i=ve(t),a):i},a},t.svg.diagonal=function(){var t=jn,e=Bn,r=ts;function n(n,i){var a=t.call(this,n,i),o=e.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=ve(e),n):t},n.target=function(t){return arguments.length?(e=ve(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=ts,n=e.projection;return e.projection=function(t){return arguments.length?n(function(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-St;return[r*Math.cos(n),r*Math.sin(n)]}}(r=t)):r},e},t.svg.symbol=function(){var t=rs,e=es;function r(r,n){return(is.get(t.call(this,r,n))||ns)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=ve(e),r):t},r.size=function(t){return arguments.length?(e=ve(t),r):e},r};var is=t.map({circle:ns,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*os)),r=e*os;return"M0,"+-e+"L"+r+",0 0,"+e+" "+-r+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/as),r=e*as/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/as),r=e*as/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=is.keys();var as=Math.sqrt(3),os=Math.tan(30*Lt);W.transition=function(t){for(var e,r,n=us||++ds,i=vs(t),a=[],o=fs||{time:Date.now(),ease:ta,delay:0,duration:250},s=-1,l=this.length;++s<l;){a.push(e=[]);for(var c=this[s],u=-1,f=c.length;++u<f;)(r=c[u])&&gs(r,u,i,n,o),e.push(r)}return cs(a,i,n)},W.interrupt=function(t){return this.each(null==t?ss:ls(vs(t)))};var ss=ls(vs());function ls(t){return function(){var e,r,n;(e=this[t])&&(n=e[r=e.active])&&(n.timer.c=null,n.timer.t=NaN,--e.count?delete e[r]:delete this[t],e.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function cs(t,e,r){return V(t,hs),t.namespace=e,t.id=r,t}var us,fs,hs=[],ds=0;function ps(t,e,r,n){var i=t.id,a=t.namespace;return ut(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 ms(t){return null==t&&(t=""),function(){this.textContent=t}}function vs(t){return null==t?"__transition__":"__transition_"+t+"__"}function gs(t,e,r,n,i){var a,o,s,l,c,u=t[r]||(t[r]={active:0,count:0}),f=u[n];function h(r){var i=u.active,h=u[i];for(var p in h&&(h.timer.c=null,h.timer.t=NaN,--u.count,delete u[i],h.event&&h.event.interrupt.call(t,t.__data__,h.index)),u)if(+p<n){var m=u[p];m.timer.c=null,m.timer.t=NaN,--u.count,delete u[p]}o.c=d,ke(function(){return o.c&&d(r||1)&&(o.c=null,o.t=NaN),1},0,a),u.active=n,f.event&&f.event.start.call(t,t.__data__,e),c=[],f.tween.forEach(function(r,n){(n=n.call(t,t.__data__,e))&&c.push(n)}),l=f.ease,s=f.duration}function d(i){for(var a=i/s,o=l(a),h=c.length;h>0;)c[--h].call(t,o);if(a>=1)return f.event&&f.event.end.call(t,t.__data__,e),--u.count?delete u[n]:delete t[r],1}f||(a=i.time,o=ke(function(t){var e=f.delay;if(o.t=e+a,e<=t)return h(t-e);o.c=h},0,a),f=u[n]={tween:new x,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++u.count)}hs.call=W.call,hs.empty=W.empty,hs.node=W.node,hs.size=W.size,t.transition=function(e,r){return e&&e.transition?us?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=hs,hs.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=X(t);for(var s=-1,l=this.length;++s<l;){o.push(e=[]);for(var c=this[s],u=-1,f=c.length;++u<f;)(n=c[u])&&(r=t.call(n,n.__data__,u,s))?("__data__"in n&&(r.__data__=n.__data__),gs(r,u,a,i,n[a][i]),e.push(r)):e.push(null)}return cs(o,a,i)},hs.selectAll=function(t){var e,r,n,i,a,o=this.id,s=this.namespace,l=[];t=Z(t);for(var c=-1,u=this.length;++c<u;)for(var f=this[c],h=-1,d=f.length;++h<d;)if(n=f[h]){a=n[s][o],r=t.call(n,n.__data__,h,c),l.push(e=[]);for(var p=-1,m=r.length;++p<m;)(i=r[p])&&gs(i,p,s,o,a),e.push(i)}return cs(l,s,o)},hs.filter=function(t){var e,r,n=[];"function"!=typeof t&&(t=ct(t));for(var i=0,a=this.length;i<a;i++){n.push(e=[]);for(var o,s=0,l=(o=this[i]).length;s<l;s++)(r=o[s])&&t.call(r,r.__data__,s,i)&&e.push(r)}return cs(n,this.namespace,this.id)},hs.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):ut(this,null==e?function(e){e[n][r].tween.remove(t)}:function(i){i[n][r].tween.set(t,e)})},hs.attr=function(e,r){if(arguments.length<2){for(r in e)this.attr(r,e[r]);return this}var n="transform"==e?fa:Gi,i=t.ns.qualify(e);function a(){this.removeAttribute(i)}function o(){this.removeAttributeNS(i.space,i.local)}return ps(this,"attr."+e,r,i.local?function(t){return null==t?o:(t+="",function(){var e,r=this.getAttributeNS(i.space,i.local);return r!==t&&(e=n(r,t),function(t){this.setAttributeNS(i.space,i.local,e(t))})})}:function(t){return null==t?a:(t+="",function(){var e,r=this.getAttribute(i);return r!==t&&(e=n(r,t),function(t){this.setAttribute(i,e(t))})})})},hs.attrTween=function(e,r){var n=t.ns.qualify(e);return this.tween("attr."+e,n.local?function(t,e){var i=r.call(this,t,e,this.getAttributeNS(n.space,n.local));return i&&function(t){this.setAttributeNS(n.space,n.local,i(t))}}:function(t,e){var i=r.call(this,t,e,this.getAttribute(n));return i&&function(t){this.setAttribute(n,i(t))}})},hs.style=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=""),t)this.style(r,t[r],e);return this}r=""}function i(){this.style.removeProperty(t)}return ps(this,"style."+t,e,function(e){return null==e?i:(e+="",function(){var n,i=o(this).getComputedStyle(this,null).getPropertyValue(t);return i!==e&&(n=Gi(i,e),function(e){this.style.setProperty(t,n(e),r)})})})},hs.styleTween=function(t,e,r){return arguments.length<3&&(r=""),this.tween("style."+t,function(n,i){var a=e.call(this,n,i,o(this).getComputedStyle(this,null).getPropertyValue(t));return a&&function(e){this.style.setProperty(t,a(e),r)}})},hs.text=function(t){return ps(this,"text",t,ms)},hs.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},hs.ease=function(e){var r=this.id,n=this.namespace;return arguments.length<1?this.node()[n][r].ease:("function"!=typeof e&&(e=t.ease.apply(t,arguments)),ut(this,function(t){t[n][r].ease=e}))},hs.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:ut(this,"function"==typeof t?function(n,i,a){n[r][e].delay=+t.call(n,n.__data__,i,a)}:(t=+t,function(n){n[r][e].delay=t}))},hs.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:ut(this,"function"==typeof t?function(n,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}))},hs.each=function(e,r){var n=this.id,i=this.namespace;if(arguments.length<2){var a=fs,o=us;try{us=n,ut(this,function(t,r,a){fs=t[i][n],e.call(t,t.__data__,r,a)})}finally{fs=a,us=o}}else ut(this,function(a){var o=a[i][n];(o.event||(o.event=t.dispatch("start","end","interrupt"))).on(e,r)});return this},hs.transition=function(){for(var t,e,r,n=this.id,i=++ds,a=this.namespace,o=[],s=0,l=this.length;s<l;s++){o.push(t=[]);for(var c,u=0,f=(c=this[s]).length;u<f;u++)(e=c[u])&&gs(e,u,a,i,{time:(r=e[a][n]).time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration}),t.push(e)}return cs(o,a,i)},t.svg.axis=function(){var e,r=t.scale.linear(),i=ys,a=6,o=6,s=3,l=[10],c=null;function u(n){n.each(function(){var n,u=t.select(this),f=this.__chart__||r,h=this.__chart__=r.copy(),d=null==c?h.ticks?h.ticks.apply(h,l):h.domain():c,p=null==e?h.tickFormat?h.tickFormat.apply(h,l):P:e,m=u.selectAll(".tick").data(d,h),v=m.enter().insert("g",".domain").attr("class","tick").style("opacity",Mt),g=t.transition(m.exit()).style("opacity",Mt).remove(),y=t.transition(m.order()).style("opacity",1),b=Math.max(a,0)+s,x=oo(h),_=u.selectAll(".domain").data([0]),w=(_.enter().append("path").attr("class","domain"),t.transition(_));v.append("line"),v.append("text");var M,k,A,T,E=v.select("line"),S=y.select("line"),L=m.select("text").text(p),C=v.select("text"),z=y.select("text"),O="top"===i||"left"===i?-1:1;if("bottom"===i||"top"===i?(n=xs,M="x",A="y",k="x2",T="y2",L.attr("dy",O<0?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+x[0]+","+O*o+"V0H"+x[1]+"V"+O*o)):(n=_s,M="y",A="x",k="y2",T="x2",L.attr("dy",".32em").style("text-anchor",O<0?"end":"start"),w.attr("d","M"+O*o+","+x[0]+"H0V"+x[1]+"H"+O*o)),E.attr(T,O*a),C.attr(A,O*b),S.attr(k,0).attr(T,O*a),z.attr(M,0).attr(A,O*b),h.rangeBand){var D=h,I=D.rangeBand()/2;f=h=function(t){return D(t)+I}}else f.rangeBand?f=h:g.call(n,h,f);v.call(n,f,h),y.call(n,h,h)})}return u.scale=function(t){return arguments.length?(r=t,u):r},u.orient=function(t){return arguments.length?(i=t in bs?t+"":ys,u):i},u.ticks=function(){return arguments.length?(l=n(arguments),u):l},u.tickValues=function(t){return arguments.length?(c=t,u):c},u.tickFormat=function(t){return arguments.length?(e=t,u):e},u.tickSize=function(t){var e=arguments.length;return e?(a=+t,o=+arguments[e-1],u):a},u.innerTickSize=function(t){return arguments.length?(a=+t,u):a},u.outerTickSize=function(t){return arguments.length?(o=+t,u):o},u.tickPadding=function(t){return arguments.length?(s=+t,u):s},u.tickSubdivide=function(){return arguments.length&&u},u};var ys="bottom",bs={top:1,right:1,bottom:1,left:1};function xs(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"})}function _s(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"})}t.svg.brush=function(){var e,r,n=B(h,"brushstart","brush","brushend"),i=null,a=null,s=[0,0],l=[0,0],c=!0,u=!0,f=Ms[0];function h(e){e.each(function(){var e=t.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",v).on("touchstart.brush",v),r=e.selectAll(".background").data([0]);r.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),e.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var n=e.selectAll(".resize").data(f,P);n.exit().remove(),n.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return ws[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),n.style("display",h.empty()?"none":null);var o,s=t.transition(e),l=t.transition(r);i&&(o=oo(i),l.attr("x",o[0]).attr("width",o[1]-o[0]),p(s)),a&&(o=oo(a),l.attr("y",o[0]).attr("height",o[1]-o[0]),m(s)),d(s)})}function d(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+s[+/e$/.test(t)]+","+l[+/^s/.test(t)]+")"})}function p(t){t.select(".extent").attr("x",s[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1]-s[0])}function m(t){t.select(".extent").attr("y",l[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function v(){var f,v,g=this,y=t.select(t.event.target),b=n.of(g,arguments),x=t.select(g),_=y.datum(),w=!/^(n|s)$/.test(_)&&i,M=!/^(e|w)$/.test(_)&&a,k=y.classed("extent"),A=bt(g),T=t.mouse(g),E=t.select(o(g)).on("keydown.brush",function(){32==t.event.keyCode&&(k||(f=null,T[0]-=s[1],T[1]-=l[1],k=2),F())}).on("keyup.brush",function(){32==t.event.keyCode&&2==k&&(T[0]+=s[1],T[1]+=l[1],k=0,F())});if(t.event.changedTouches?E.on("touchmove.brush",C).on("touchend.brush",z):E.on("mousemove.brush",C).on("mouseup.brush",z),x.interrupt().selectAll("*").interrupt(),k)T[0]=s[0]-T[0],T[1]=l[0]-T[1];else if(_){var S=+/w$/.test(_),L=+/^n/.test(_);v=[s[1-S]-T[0],l[1-L]-T[1]],T[0]=s[S],T[1]=l[L]}else t.event.altKey&&(f=T.slice());function C(){var e=t.mouse(g),r=!1;v&&(e[0]+=v[0],e[1]+=v[1]),k||(t.event.altKey?(f||(f=[(s[0]+s[1])/2,(l[0]+l[1])/2]),T[0]=s[+(e[0]<f[0])],T[1]=l[+(e[1]<f[1])]):f=null),w&&P(e,i,0)&&(p(x),r=!0),M&&P(e,a,1)&&(m(x),r=!0),r&&(d(x),b({type:"brush",mode:k?"move":"resize"}))}function P(t,n,i){var a,o,h=oo(n),d=h[0],p=h[1],m=T[i],v=i?l:s,g=v[1]-v[0];if(k&&(d-=m,p-=g+m),a=(i?u:c)?Math.max(d,Math.min(p,t[i])):t[i],k?o=(a+=m)+g:(f&&(m=Math.max(d,Math.min(p,2*f[i]-a))),m<a?(o=a,a=m):o=m),v[0]!=a||v[1]!=o)return i?r=null:e=null,v[0]=a,v[1]=o,!0}function z(){C(),x.style("pointer-events","all").selectAll(".resize").style("display",h.empty()?"none":null),t.select("body").style("cursor",null),E.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),A(),b({type:"brushend"})}x.style("pointer-events","none").selectAll(".resize").style("display",null),t.select("body").style("cursor",y.style("cursor")),b({type:"brushstart"}),C()}return h.event=function(i){i.each(function(){var i=n.of(this,arguments),a={x:s,y:l,i:e,j:r},o=this.__chart__||a;this.__chart__=a,us?t.select(this).transition().each("start.brush",function(){e=o.i,r=o.j,s=o.x,l=o.y,i({type:"brushstart"})}).tween("brush:brush",function(){var t=Yi(s,a.x),n=Yi(l,a.y);return e=r=null,function(e){s=a.x=t(e),l=a.y=n(e),i({type:"brush",mode:"resize"})}}).each("end.brush",function(){e=a.i,r=a.j,i({type:"brush",mode:"resize"}),i({type:"brushend"})}):(i({type:"brushstart"}),i({type:"brush",mode:"resize"}),i({type:"brushend"}))})},h.x=function(t){return arguments.length?(f=Ms[!(i=t)<<1|!a],h):i},h.y=function(t){return arguments.length?(f=Ms[!i<<1|!(a=t)],h):a},h.clamp=function(t){return arguments.length?(i&&a?(c=!!t[0],u=!!t[1]):i?c=!!t:a&&(u=!!t),h):i&&a?[c,u]:i?c:a?u:null},h.extent=function(t){var n,o,c,u,f;return arguments.length?(i&&(n=t[0],o=t[1],a&&(n=n[0],o=o[0]),e=[n,o],i.invert&&(n=i(n),o=i(o)),o<n&&(f=n,n=o,o=f),n==s[0]&&o==s[1]||(s=[n,o])),a&&(c=t[0],u=t[1],i&&(c=c[1],u=u[1]),r=[c,u],a.invert&&(c=a(c),u=a(u)),u<c&&(f=c,c=u,u=f),c==l[0]&&u==l[1]||(l=[c,u])),h):(i&&(e?(n=e[0],o=e[1]):(n=s[0],o=s[1],i.invert&&(n=i.invert(n),o=i.invert(o)),o<n&&(f=n,n=o,o=f))),a&&(r?(c=r[0],u=r[1]):(c=l[0],u=l[1],a.invert&&(c=a.invert(c),u=a.invert(u)),u<c&&(f=c,c=u,u=f))),i&&a?[[n,c],[o,u]]:i?[n,o]:a&&[c,u])},h.clear=function(){return h.empty()||(s=[0,0],l=[0,0],e=r=null),h},h.empty=function(){return!!i&&s[0]==s[1]||!!a&&l[0]==l[1]},t.rebind(h,n,"on")};var ws={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Ms=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],ks=Oe.format=sr.timeFormat,As=ks.utc,Ts=As("%Y-%m-%dT%H:%M:%S.%LZ");function Es(t){return t.toISOString()}function Ss(e,r,n){function i(t){return e(t)}function a(e,n){var i=(e[1]-e[0])/n,a=t.bisect(Cs,i);return a==Cs.length?[r.year,mo(e.map(function(t){return t/31536e6}),n)[2]]:a?r[i/Cs[a-1]<Cs[a]/i?a-1:a]:[Os,mo(e,n)[2]]}return i.invert=function(t){return Ls(e.invert(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain().map(Ls)},i.nice=function(t,e){var r=i.domain(),n=ao(r),o=null==t?a(n,10):"number"==typeof t&&a(n,t);function s(r){return!isNaN(r)&&!t.range(r,Ls(+r+1),e).length}return o&&(t=o[0],e=o[1]),i.domain(lo(r,e>1?{floor:function(e){for(;s(e=t.floor(e));)e=Ls(e-1);return e},ceil:function(e){for(;s(e=t.ceil(e));)e=Ls(+e+1);return e}}:t))},i.ticks=function(t,e){var r=ao(i.domain()),n=null==t?a(r,10):"number"==typeof t?a(r,t):!t.range&&[{range:t},e];return n&&(t=n[0],e=n[1]),t.range(r[0],Ls(+r[1]+1),e<1?1:e)},i.tickFormat=function(){return n},i.copy=function(){return Ss(e.copy(),r,n)},ho(i,e)}function Ls(t){return new Date(t)}ks.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Es:Ts,Es.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Es.toString=Ts.toString,Oe.second=Ne(function(t){return new De(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),Oe.seconds=Oe.second.range,Oe.seconds.utc=Oe.second.utc.range,Oe.minute=Ne(function(t){return new De(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),Oe.minutes=Oe.minute.range,Oe.minutes.utc=Oe.minute.utc.range,Oe.hour=Ne(function(t){var e=t.getTimezoneOffset()/60;return new De(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),Oe.hours=Oe.hour.range,Oe.hours.utc=Oe.hour.utc.range,Oe.month=Ne(function(t){return(t=Oe.day(t)).setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),Oe.months=Oe.month.range,Oe.months.utc=Oe.month.utc.range;var Cs=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Ps=[[Oe.second,1],[Oe.second,5],[Oe.second,15],[Oe.second,30],[Oe.minute,1],[Oe.minute,5],[Oe.minute,15],[Oe.minute,30],[Oe.hour,1],[Oe.hour,3],[Oe.hour,6],[Oe.hour,12],[Oe.day,1],[Oe.day,2],[Oe.week,1],[Oe.month,1],[Oe.month,3],[Oe.year,1]],zs=ks.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Yr]]),Os={range:function(e,r,n){return t.range(Math.ceil(e/n)*n,+r,n).map(Ls)},floor:P,ceil:P};Ps.year=Oe.year,Oe.scale=function(){return Ss(t.scale.linear(),Ps,zs)};var Ds=Ps.map(function(t){return[t[0].utc,t[1]]}),Is=As.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Yr]]);function Rs(t){return JSON.parse(t.responseText)}function Ns(t){var e=i.createRange();return e.selectNode(i.body),e.createContextualFragment(t.responseText)}Ds.year=Oe.year.utc,Oe.scale.utc=function(){return Ss(t.scale.linear(),Ds,Is)},t.text=ge(function(t){return t.responseText}),t.json=function(t,e){return ye(t,"application/json",Rs,e)},t.html=function(t,e){return ye(t,"text/html",Ns,e)},t.xml=ge(function(t){return t.responseXML}),"object"==typeof e&&e.exports?e.exports=t:this.d3=t}()},{}],129:[function(t,e,r){e.exports=function(){for(var t=0;t<arguments.length;t++)if(void 0!==arguments[t])return arguments[t]}},{}],130:[function(t,e,r){"use strict";var n=t("incremental-convex-hull"),i=t("uniq");function a(t,e){this.point=t,this.index=e}function o(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}e.exports=function(t,e){var r=t.length;if(0===r)return[];var s=t[0].length;if(s<1)return[];if(1===s)return function(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]]}r&&i.push([-1,i[0][1]],[i[t-1][1],-1]);return i}(r,t,e);for(var l=new Array(r),c=1,u=0;u<r;++u){for(var f=t[u],h=new Array(s+1),d=0,p=0;p<s;++p){var m=f[p];h[p]=m,d+=m*m}h[s]=d,l[u]=new a(h,u),c=Math.max(d,c)}i(l,o),r=l.length;for(var v=new Array(r+s+1),g=new Array(r+s+1),y=(s+1)*(s+1)*c,b=new Array(s+1),u=0;u<=s;++u)b[u]=0;b[s]=y,v[0]=b.slice(),g[0]=-1;for(var u=0;u<=s;++u){var h=b.slice();h[u]=1,v[u+1]=h,g[u+1]=-1}for(var u=0;u<r;++u){var x=l[u];v[u+s+1]=x.point,g[u+s+1]=x.index}var _=n(v,!1);_=e?_.filter(function(t){for(var e=0,r=0;r<=s;++r){var n=g[t[r]];if(n<0&&++e>=2)return!1;t[r]=n}return!0}):_.filter(function(t){for(var e=0;e<=s;++e){var r=g[t[e]];if(r<0)return!1;t[e]=r}return!0});if(1&s)for(var u=0;u<_.length;++u){var x=_[u],h=x[0];x[0]=x[1],x[1]=h}return _}},{"incremental-convex-hull":258,uniq:536}],131:[function(t,e,r){(function(t){var r=!1;if("undefined"!=typeof Float64Array){var n=new Float64Array(1),i=new Uint32Array(n.buffer);if(n[0]=1,r=!0,1072693248===i[1]){e.exports=function(t){return n[0]=t,[i[0],i[1]]},e.exports.pack=function(t,e){return i[0]=t,i[1]=e,n[0]},e.exports.lo=function(t){return n[0]=t,i[0]},e.exports.hi=function(t){return n[0]=t,i[1]}}else if(1072693248===i[0]){e.exports=function(t){return n[0]=t,[i[1],i[0]]},e.exports.pack=function(t,e){return i[1]=t,i[0]=e,n[0]},e.exports.lo=function(t){return n[0]=t,i[1]},e.exports.hi=function(t){return n[0]=t,i[0]}}else r=!1}if(!r){var a=new t(8);e.exports=function(t){return a.writeDoubleLE(t,0,!0),[a.readUInt32LE(0,!0),a.readUInt32LE(4,!0)]},e.exports.pack=function(t,e){return a.writeUInt32LE(t,0,!0),a.writeUInt32LE(e,4,!0),a.readDoubleLE(0,!0)},e.exports.lo=function(t){return a.writeDoubleLE(t,0,!0),a.readUInt32LE(0,!0)},e.exports.hi=function(t){return a.writeDoubleLE(t,0,!0),a.readUInt32LE(4,!0)}}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<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){return!(2146435072&e.exports.hi(t))}}).call(this,t("buffer").Buffer)},{buffer:83}],132:[function(t,e,r){var n=t("abs-svg-path"),i=t("normalize-svg-path"),a={M:"moveTo",C:"bezierCurveTo"};e.exports=function(t,e){t.beginPath(),i(n(e)).forEach(function(e){var r=e[0],n=e.slice(1);t[a[r]].apply(t,n)}),t.closePath()}},{"abs-svg-path":43,"normalize-svg-path":441}],133:[function(t,e,r){e.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}},{}],134:[function(t,e,r){"use strict";e.exports=function(t,e){switch(void 0===e&&(e=0),typeof t){case"number":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n<t;++n)r[n]=e;return r}(0|t,e);break;case"object":if("number"==typeof t.length)return function t(e,r,n){var i=0|e[n];if(i<=0)return[];var a,o=new Array(i);if(n===e.length-1)for(a=0;a<i;++a)o[a]=r;else for(a=0;a<i;++a)o[a]=t(e,r,n+1);return o}(t,e,0)}return[]}},{}],135:[function(t,e,r){"use strict";function n(t,e,r){r=r||2;var n,s,l,c,u,d,m,v=e&&e.length,g=v?e[0]*r:t.length,y=i(t,0,g,r,!0),b=[];if(!y)return b;if(v&&(y=function(t,e,r,n){var o,s,l,c,u,d=[];for(o=0,s=e.length;o<s;o++)l=e[o]*n,c=o<s-1?e[o+1]*n:t.length,(u=i(t,l,c,n,!1))===u.next&&(u.steiner=!0),d.push(p(u));for(d.sort(f),o=0;o<d.length;o++)h(d[o],r),r=a(r,r.next);return r}(t,e,y,r)),t.length>80*r){n=l=t[0],s=c=t[1];for(var x=r;x<g;x+=r)u=t[x],d=t[x+1],u<n&&(n=u),d<s&&(s=d),u>l&&(l=u),d>c&&(c=d);m=0!==(m=Math.max(l-n,c-s))?1/m:0}return o(y,b,r,n,s,m),b}function i(t,e,r,n,i){var a,o;if(i===A(t,e,r,n)>0)for(a=e;a<r;a+=n)o=w(a,t[a],t[a+1],o);else for(a=r-n;a>=e;a-=n)o=w(a,t[a],t[a+1],o);return o&&y(o,o.next)&&(M(o),o=o.next),o}function a(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!y(n,n.next)&&0!==g(n.prev,n,n.next))n=n.next;else{if(M(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,i,f,h){if(t){!h&&f&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=d(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e<c&&(s++,n=n.nextZ);e++);for(l=c;s>0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(t,n,i,f);for(var p,m,v=t;t.prev!==t.next;)if(p=t.prev,m=t.next,f?l(t,n,i,f):s(t))e.push(p.i/r),e.push(t.i/r),e.push(m.i/r),M(t),t=m.next,v=m.next;else if((t=m)===v){h?1===h?o(t=c(t,e,r),e,r,n,i,f,2):2===h&&u(t,e,r,n,i,f):o(a(t),e,r,n,i,f,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(g(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(m(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&g(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(g(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,c=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=d(s,l,e,r,n),h=d(c,u,e,r,n),p=t.prevZ,v=t.nextZ;p&&p.z>=f&&v&&v.z<=h;){if(p!==t.prev&&p!==t.next&&m(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&g(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,v!==t.prev&&v!==t.next&&m(i.x,i.y,a.x,a.y,o.x,o.y,v.x,v.y)&&g(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;p&&p.z>=f;){if(p!==t.prev&&p!==t.next&&m(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&g(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;v&&v.z<=h;){if(v!==t.prev&&v!==t.next&&m(i.x,i.y,a.x,a.y,o.x,o.y,v.x,v.y)&&g(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function c(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!y(i,a)&&b(i,n,n.next,a)&&x(i,a)&&x(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),M(n),M(n.next),n=t=a),n=n.next}while(n!==t);return n}function u(t,e,r,n,i,s){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&v(l,c)){var u=_(l,c);return l=a(l,l.next),u=a(u,u.next),o(l,e,r,n,i,s),void o(u,e,r,n,i,s)}c=c.next}l=l.next}while(l!==t)}function f(t,e){return t.x-e.x}function h(t,e){if(e=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!r)return null;if(i===o)return r.prev;var l,c=r,u=r.x,f=r.y,h=1/0;n=r.next;for(;n!==c;)i>=n.x&&n.x>=u&&i!==n.x&&m(a<f?i:o,a,u,f,a<f?o:i,a,n.x,n.y)&&((l=Math.abs(a-n.y)/(i-n.x))<h||l===h&&n.x>r.x)&&x(n,t)&&(r=n,h=l),n=n.next;return r}(t,e)){var r=_(e,t);a(r,r.next)}}function d(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,r=t;do{e.x<r.x&&(r=e),e=e.next}while(e!==t);return r}function m(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 v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&b(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&x(t,e)&&x(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)}function g(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function b(t,e,r,n){return!!(y(t,e)&&y(r,n)||y(t,n)&&y(r,e))||g(t,e,r)>0!=g(t,e,n)>0&&g(r,n,t)>0!=g(r,n,e)>0}function x(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function _(t,e){var r=new k(t.i,t.x,t.y),n=new k(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function w(t,e,r,n){var i=new k(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 M(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 k(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 A(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,e.exports.default=n,n.deviation=function(t,e,r,n){var i=e&&e.length,a=i?e[0]*r:t.length,o=Math.abs(A(t,0,a,r));if(i)for(var s=0,l=e.length;s<l;s++){var c=e[s]*r,u=s<l-1?e[s+1]*r:t.length;o-=Math.abs(A(t,c,u,r))}var f=0;for(s=0;s<n.length;s+=3){var h=n[s]*r,d=n[s+1]*r,p=n[s+2]*r;f+=Math.abs((t[h]-t[p])*(t[d+1]-t[h+1])-(t[h]-t[d])*(t[p+1]-t[h+1]))}return 0===o&&0===f?0:Math.abs((f-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}},{}],136:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.length;if("number"!=typeof e){e=0;for(var i=0;i<r;++i){var a=t[i];e=Math.max(e,a[0],a[1])}e=1+(0|e)}e|=0;for(var o=new Array(e),i=0;i<e;++i)o[i]=[];for(var i=0;i<r;++i){var a=t[i];o[a[0]].push(a[1]),o[a[1]].push(a[0])}for(var s=0;s<e;++s)n(o[s],function(t,e){return t-e});return o};var n=t("uniq")},{uniq:536}],137:[function(t,e,r){(function(n,i){!function(t,n){"object"==typeof r&&void 0!==e?e.exports=n():t.ES6Promise=n()}(this,function(){"use strict";function e(t){return"function"==typeof t}var r=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},a=0,o=void 0,s=void 0,l=function(t,e){m[a]=t,m[a+1]=e,2===(a+=2)&&(s?s(v):_())};var c="undefined"!=typeof window?window:void 0,u=c||{},f=u.MutationObserver||u.WebKitMutationObserver,h="undefined"==typeof self&&void 0!==n&&"[object process]"==={}.toString.call(n),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var t=setTimeout;return function(){return t(v,1)}}var m=new Array(1e3);function v(){for(var t=0;t<a;t+=2){(0,m[t])(m[t+1]),m[t]=void 0,m[t+1]=void 0}a=0}var g,y,b,x,_=void 0;function w(t,e){var r=arguments,n=this,i=new this.constructor(A);void 0===i[k]&&V(i);var a,o=n._state;return o?(a=r[o-1],l(function(){return B(o,i,a,n._result)})):R(n,i,t,e),i}function M(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(A);return z(e,t),e}h?_=function(){return n.nextTick(v)}:f?(y=0,b=new f(v),x=document.createTextNode(""),b.observe(x,{characterData:!0}),_=function(){x.data=y=++y%2}):d?((g=new MessageChannel).port1.onmessage=v,_=function(){return g.port2.postMessage(0)}):_=void 0===c&&"function"==typeof t?function(){try{var e=t("vertx");return o=e.runOnLoop||e.runOnContext,function(){o(v)}}catch(t){return p()}}():p();var k=Math.random().toString(36).substring(16);function A(){}var T=void 0,E=1,S=2,L=new F;function C(t){try{return t.then}catch(t){return L.error=t,L}}function P(t,r,n){r.constructor===t.constructor&&n===w&&r.constructor.resolve===M?function(t,e){e._state===E?D(t,e._result):e._state===S?I(t,e._result):R(e,void 0,function(e){return z(t,e)},function(e){return I(t,e)})}(t,r):n===L?I(t,L.error):void 0===n?D(t,r):e(n)?function(t,e,r){l(function(t){var n=!1,i=function(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}(r,e,function(r){n||(n=!0,e!==r?z(t,r):D(t,r))},function(e){n||(n=!0,I(t,e))},t._label);!n&&i&&(n=!0,I(t,i))},t)}(t,r,n):D(t,r)}function z(t,e){var r;t===e?I(t,new TypeError("You cannot resolve a promise with itself")):"function"==typeof(r=e)||"object"==typeof r&&null!==r?P(t,e,C(e)):D(t,e)}function O(t){t._onerror&&t._onerror(t._result),N(t)}function D(t,e){t._state===T&&(t._result=e,t._state=E,0!==t._subscribers.length&&l(N,t))}function I(t,e){t._state===T&&(t._state=S,t._result=e,l(O,t))}function R(t,e,r,n){var i=t._subscribers,a=i.length;t._onerror=null,i[a]=e,i[a+E]=r,i[a+S]=n,0===a&&t._state&&l(N,t)}function N(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?B(r,n,i,a):i(a);t._subscribers.length=0}}function F(){this.error=null}var j=new F;function B(t,r,n,i){var a=e(n),o=void 0,s=void 0,l=void 0,c=void 0;if(a){if((o=function(t,e){try{return t(e)}catch(t){return j.error=t,j}}(n,i))===j?(c=!0,s=o.error,o=null):l=!0,r===o)return void I(r,new TypeError("A promises callback cannot return that same promise."))}else o=i,l=!0;r._state!==T||(a&&l?z(r,o):c?I(r,s):t===E?D(r,o):t===S&&I(r,o))}var U=0;function V(t){t[k]=U++,t._state=void 0,t._result=void 0,t._subscribers=[]}function q(t,e){this._instanceConstructor=t,this.promise=new t(A),this.promise[k]||V(this.promise),r(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?D(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&D(this.promise,this._result))):I(this.promise,new Error("Array Methods must be provided an Array"))}function H(t){this[k]=U++,this._result=this._state=void 0,this._subscribers=[],A!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof H?function(t,e){try{e(function(e){z(t,e)},function(e){I(t,e)})}catch(e){I(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}function G(){var t=void 0;if(void 0!==i)t=i;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=H}return q.prototype._enumerate=function(){for(var t=this.length,e=this._input,r=0;this._state===T&&r<t;r++)this._eachEntry(e[r],r)},q.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===M){var i=C(t);if(i===w&&t._state!==T)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(r===H){var a=new r(A);P(a,t,i),this._willSettleAt(a,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},q.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===T&&(this._remaining--,t===S?I(n,r):this._result[e]=r),0===this._remaining&&D(n,this._result)},q.prototype._willSettleAt=function(t,e){var r=this;R(t,void 0,function(t){return r._settledAt(E,e,t)},function(t){return r._settledAt(S,e,t)})},H.all=function(t){return new q(this,t).promise},H.race=function(t){var e=this;return r(t)?new e(function(r,n){for(var i=t.length,a=0;a<i;a++)e.resolve(t[a]).then(r,n)}):new e(function(t,e){return e(new TypeError("You must pass an array to race."))})},H.resolve=M,H.reject=function(t){var e=new this(A);return I(e,t),e},H._setScheduler=function(t){s=t},H._setAsap=function(t){l=t},H._asap=l,H.prototype={constructor:H,then:w,catch:function(t){return this.then(null,t)}},G(),H.polyfill=G,H.Promise=H,H})}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:469}],138:[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"object"==typeof t&&null!==t}function o(t){return void 0===t}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,r,n,s,l,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var u=new Error('Uncaught, unspecified "error" event. ('+e+")");throw u.context=e,u}if(o(r=this._events[t]))return!1;if(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:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(a(r))for(s=Array.prototype.slice.call(arguments,1),n=(c=r.slice()).length,l=0;l<n;l++)c[l].apply(this,s);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]?a(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,a(this._events[t])&&!this._events[t].warned&&(r=o(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&r>0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){if(!i(e))throw TypeError("listener must be a function");var r=!1;function n(){this.removeListener(t,n),r||(r=!0,e.apply(this,arguments))}return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var r,n,o,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(o=(r=this._events[t]).length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(a(r)){for(s=o;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(i(r=this._events[t]))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?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)}},{}],139:[function(t,e,r){"use strict";e.exports=function(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]]]}},{}],140:[function(t,e,r){"use strict";e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&function(t){for(var e,r=t.length,n=0;n<r;n++)if(((e=t.charCodeAt(n))<9||e>13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}(r))return!1}else if("number"!==e)return!1;return t-t<1}},{}],141:[function(t,e,r){"use strict";e.exports=function(t){return new Function("f","var p = (f && f.properties || {}); return "+i(t))};var n=["Unknown","Point","LineString","Polygon"];function i(t){if(!t)return"true";var e=t[0];return t.length<=1?"any"===e?"false":"true":"("+("=="===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?u(s(t.slice(1),"||")):"in"===e?l(t[1],t.slice(2)):"!in"===e?u(l(t[1],t.slice(2))):"has"===e?c(t[1]):"!has"===e?u(c([t[1]])):"true")+")"}function a(t){return"$type"===t?"f.type":"$id"===t?"f.id":"p["+JSON.stringify(t)+"]"}function o(t,e,r,i){var o=a(t),s="$type"===t?n.indexOf(e):JSON.stringify(e);return(i?"typeof "+o+"=== typeof "+s+"&&":"")+o+r+s}function s(t,e){return t.map(i).join(e)}function l(t,e){"$type"===t&&(e=e.map(function(t){return n.indexOf(t)}));var r=JSON.stringify(e.sort(f)),i=a(t);return e.length<=200?r+".indexOf("+i+") !== -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; }("+i+", "+r+",0,"+(e.length-1)+")"}function c(t){return JSON.stringify(t)+" in p"}function u(t){return"!("+t+")"}function f(t,e){return t<e?-1:t>e?1:0}},{}],142:[function(t,e,r){"use strict";e.exports=function(t,e,r){switch(arguments.length){case 0:return new o([0],[0],0);case 1:if("number"==typeof t){var n=l(t);return new o(n,n,0)}return new o(t,l(t.length),0);case 2:if("number"==typeof e){var n=l(t.length);return new o(t,n,+e)}r=0;case 3:if(t.length!==e.length)throw new Error("state and velocity lengths must match");return new o(t,e,r)}};var n=t("cubic-hermite"),i=t("binary-search-bounds");function a(t,e,r){return Math.min(e,Math.max(t,r))}function o(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()]}var s=o.prototype;function l(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=0;return e}s.flush=function(t){var e=i.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))},s.curve=function(t){var e=this._time,r=e.length,o=i.le(e,t),s=this._scratch[0],l=this._state,c=this._velocity,u=this.dimension,f=this.bounds;if(o<0)for(var h=u-1,d=0;d<u;++d,--h)s[d]=l[h];else if(o>=r-1){h=l.length-1;var p=t-e[r-1];for(d=0;d<u;++d,--h)s[d]=l[h]+p*c[h]}else{h=u*(o+1)-1;var m=e[o],v=e[o+1]-m||1,g=this._scratch[1],y=this._scratch[2],b=this._scratch[3],x=this._scratch[4],_=!0;for(d=0;d<u;++d,--h)g[d]=l[h],b[d]=c[h]*v,y[d]=l[h+u],x[d]=c[h+u]*v,_=_&&g[d]===y[d]&&b[d]===x[d]&&0===b[d];if(_)for(d=0;d<u;++d)s[d]=g[d];else n(g,b,y,x,(t-m)/v,s)}var w=f[0],M=f[1];for(d=0;d<u;++d)s[d]=a(w[d],M[d],s[d]);return s},s.dcurve=function(t){var e=this._time,r=e.length,a=i.le(e,t),o=this._scratch[0],s=this._state,l=this._velocity,c=this.dimension;if(a>=r-1)for(var u=s.length-1,f=(e[r-1],0);f<c;++f,--u)o[f]=l[u];else{u=c*(a+1)-1;var h=e[a],d=e[a+1]-h||1,p=this._scratch[1],m=this._scratch[2],v=this._scratch[3],g=this._scratch[4],y=!0;for(f=0;f<c;++f,--u)p[f]=s[u],v[f]=l[u]*d,m[f]=s[u+c],g[f]=l[u+c]*d,y=y&&p[f]===m[f]&&v[f]===g[f]&&0===v[f];if(y)for(f=0;f<c;++f)o[f]=0;else{n.derivative(p,v,m,g,(t-h)/d,o);for(f=0;f<c;++f)o[f]/=d}}return o},s.lastT=function(){var t=this._time;return t[t.length-1]},s.stable=function(){for(var t=this._velocity,e=t.length,r=this.dimension-1;r>=0;--r)if(t[--e])return!1;return!0},s.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t<e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1];this._time.push(e,t);for(var u=0;u<2;++u)for(var f=0;f<r;++f)n.push(n[o++]),i.push(0);this._time.push(t);for(f=r;f>0;--f)n.push(a(l[f-1],c[f-1],arguments[f])),i.push(0)}},s.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t<e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=t-e,l=this.bounds,c=l[0],u=l[1],f=s>1e-6?1/s:0;this._time.push(t);for(var h=r;h>0;--h){var d=a(c[h-1],u[h-1],arguments[h]);n.push(d),i.push((d-n[o++])*f)}}},s.set=function(t){var e=this.dimension;if(!(t<this.lastT()||arguments.length!==e+1)){var r=this._state,n=this._velocity,i=this.bounds,o=i[0],s=i[1];this._time.push(t);for(var l=e;l>0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=t-e,f=u>1e-6?1/u:0;this._time.push(t);for(var h=r;h>0;--h){var d=arguments[h];n.push(a(l[h-1],c[h-1],n[o++]+d)),i.push(d*f)}}},s.idle=function(t){var e=this.lastT();if(!(t<e)){var r=this.dimension,n=this._state,i=this._velocity,o=n.length-r,s=this.bounds,l=s[0],c=s[1],u=t-e;this._time.push(t);for(var f=r-1;f>=0;--f)n.push(a(l[f],c[f],n[o]+u*i[o])),i.push(0),o+=1}}},{"binary-search-bounds":70,"cubic-hermite":115}],143:[function(t,e,r){var n=t("dtype");e.exports=function(t,e,r){if(!t)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(t)&&Array.isArray(t[0])){var i=t[0].length,a=t.length*i;e&&"string"!=typeof e||(e=new(n(e||"float32"))(a+r));var o=e.length-r;if(a!==o)throw new Error("source length "+a+" ("+i+"x"+t.length+") does not match destination length "+o);for(var s=0,l=r;s<t.length;s++)for(var c=0;c<i;c++)e[l++]=t[s][c]}else if(e&&"string"!=typeof e)e.set(t,r);else{var u=n(e||"float32");0===r?e=new u(t):(e=new u(t.length+r)).set(t,r)}return e}},{dtype:133}],144:[function(t,e,r){"use strict";e.exports=function(t){return new c(t||p,null)};var n=0,i=1;function a(t,e,r,n,i,a){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=a}function o(t){return new a(t._color,t.key,t.value,t.left,t.right,t._count)}function s(t,e){return new a(t,e.key,e.value,e.left,e.right,e._count)}function l(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function c(t,e){this._compare=t,this.root=e}var u=c.prototype;function f(t,e){this.tree=t,this._stack=e}Object.defineProperty(u,"keys",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(u,"values",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(u,"length",{get:function(){return this.root?this.root._count:0}}),u.insert=function(t,e){for(var r=this._compare,o=this.root,u=[],f=[];o;){var h=r(t,o.key);u.push(o),f.push(h),o=h<=0?o.left:o.right}u.push(new a(n,t,e,null,null,1));for(var d=u.length-2;d>=0;--d){o=u[d];f[d]<=0?u[d]=new a(o._color,o.key,o.value,u[d+1],o.right,o._count+1):u[d]=new a(o._color,o.key,o.value,o.left,u[d+1],o._count+1)}for(d=u.length-1;d>1;--d){var p=u[d-1];o=u[d];if(p._color===i||o._color===i)break;var m=u[d-2];if(m.left===p)if(p.left===o){if(!(v=m.right)||v._color!==n){if(m._color=n,m.left=p.right,p._color=i,p.right=m,u[d-2]=p,u[d-1]=o,l(m),l(p),d>=3)(g=u[d-3]).left===m?g.left=p:g.right=p;break}p._color=i,m.right=s(i,v),m._color=n,d-=1}else{if(!(v=m.right)||v._color!==n){if(p.right=o.left,m._color=n,m.left=o.right,o._color=i,o.left=p,o.right=m,u[d-2]=o,u[d-1]=p,l(m),l(p),l(o),d>=3)(g=u[d-3]).left===m?g.left=o:g.right=o;break}p._color=i,m.right=s(i,v),m._color=n,d-=1}else if(p.right===o){if(!(v=m.left)||v._color!==n){if(m._color=n,m.right=p.left,p._color=i,p.left=m,u[d-2]=p,u[d-1]=o,l(m),l(p),d>=3)(g=u[d-3]).right===m?g.right=p:g.left=p;break}p._color=i,m.left=s(i,v),m._color=n,d-=1}else{var v;if(!(v=m.left)||v._color!==n){var g;if(p.left=o.right,m._color=n,m.right=o.left,o._color=i,o.right=p,o.left=m,u[d-2]=o,u[d-1]=p,l(m),l(p),l(o),d>=3)(g=u[d-3]).right===m?g.right=o:g.left=o;break}p._color=i,m.left=s(i,v),m._color=n,d-=1}}return u[0]._color=i,new c(r,u[0])},u.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return function t(e,r){var n;if(r.left&&(n=t(e,r.left)))return n;return(n=e(r.key,r.value))||(r.right?t(e,r.right):void 0)}(t,this.root);case 2:return function t(e,r,n,i){if(r(e,i.key)<=0){var a;if(i.left&&(a=t(e,r,n,i.left)))return a;if(a=n(i.key,i.value))return a}if(i.right)return t(e,r,n,i.right)}(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return function t(e,r,n,i,a){var o,s=n(e,a.key),l=n(r,a.key);if(s<=0){if(a.left&&(o=t(e,r,n,i,a.left)))return o;if(l>0&&(o=i(a.key,a.value)))return o}if(l>0&&a.right)return t(e,r,n,i,a.right)}(e,r,this._compare,t,this.root)}},Object.defineProperty(u,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new f(this,t)}}),Object.defineProperty(u,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new f(this,t)}}),u.at=function(t){if(t<0)return new f(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t<e.left._count){e=e.left;continue}t-=e.left._count}if(!t)return new f(this,r);if(t-=1,!e.right)break;if(t>=e.right._count)break;e=e.right}return new f(this,[])},u.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new f(this,n)},u.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new f(this,n)},u.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new f(this,n)},u.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new f(this,n)},u.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new f(this,n);r=i<=0?r.left:r.right}return new f(this,[])},u.remove=function(t){var e=this.find(t);return e?e.remove():this},u.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var h=f.prototype;function d(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 p(t,e){return t<e?-1:t>e?1:0}Object.defineProperty(h,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(h,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),h.clone=function(){return new f(this.tree,this._stack.slice())},h.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new a(r._color,r.key,r.value,r.left,r.right,r._count);for(var u=t.length-2;u>=0;--u){(r=t[u]).left===t[u+1]?e[u]=new a(r._color,r.key,r.value,e[u+1],r.right,r._count):e[u]=new a(r._color,r.key,r.value,r.left,e[u+1],r._count)}if((r=e[e.length-1]).left&&r.right){var f=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var h=e[f-1];e.push(new a(r._color,h.key,h.value,r.left,r.right,r._count)),e[f-1].key=r.key,e[f-1].value=r.value;for(u=e.length-2;u>=f;--u)r=e[u],e[u]=new a(r._color,r.key,r.value,r.left,e[u+1],r._count);e[f-1].left=e[f]}if((r=e[e.length-1])._color===n){var p=e[e.length-2];p.left===r?p.left=null:p.right===r&&(p.right=null),e.pop();for(u=0;u<e.length;++u)e[u]._count--;return new c(this.tree._compare,e[0])}if(r.left||r.right){r.left?d(r,r.left):r.right&&d(r,r.right),r._color=i;for(u=0;u<e.length-1;++u)e[u]._count--;return new c(this.tree._compare,e[0])}if(1===e.length)return new c(this.tree._compare,null);for(u=0;u<e.length;++u)e[u]._count--;var m=e[e.length-2];return function(t){for(var e,r,a,c,u=t.length-1;u>=0;--u){if(e=t[u],0===u)return void(e._color=i);if((r=t[u-1]).left===e){if((a=r.right).right&&a.right._color===n)return c=(a=r.right=o(a)).right=o(a.right),r.right=a.left,a.left=r,a.right=c,a._color=r._color,e._color=i,r._color=i,c._color=i,l(r),l(a),u>1&&((f=t[u-2]).left===r?f.left=a:f.right=a),void(t[u-1]=a);if(a.left&&a.left._color===n)return c=(a=r.right=o(a)).left=o(a.left),r.right=c.left,a.left=c.right,c.left=r,c.right=a,c._color=r._color,r._color=i,a._color=i,e._color=i,l(r),l(a),l(c),u>1&&((f=t[u-2]).left===r?f.left=c:f.right=c),void(t[u-1]=c);if(a._color===i){if(r._color===n)return r._color=i,void(r.right=s(n,a));r.right=s(n,a);continue}a=o(a),r.right=a.left,a.left=r,a._color=r._color,r._color=n,l(r),l(a),u>1&&((f=t[u-2]).left===r?f.left=a:f.right=a),t[u-1]=a,t[u]=r,u+1<t.length?t[u+1]=e:t.push(e),u+=2}else{if((a=r.left).left&&a.left._color===n)return c=(a=r.left=o(a)).left=o(a.left),r.left=a.right,a.right=r,a.left=c,a._color=r._color,e._color=i,r._color=i,c._color=i,l(r),l(a),u>1&&((f=t[u-2]).right===r?f.right=a:f.left=a),void(t[u-1]=a);if(a.right&&a.right._color===n)return c=(a=r.left=o(a)).right=o(a.right),r.left=c.right,a.right=c.left,c.right=r,c.left=a,c._color=r._color,r._color=i,a._color=i,e._color=i,l(r),l(a),l(c),u>1&&((f=t[u-2]).right===r?f.right=c:f.left=c),void(t[u-1]=c);if(a._color===i){if(r._color===n)return r._color=i,void(r.left=s(n,a));r.left=s(n,a);continue}var f;a=o(a),r.left=a.right,a.right=r,a._color=r._color,r._color=n,l(r),l(a),u>1&&((f=t[u-2]).right===r?f.right=a:f.left=a),t[u-1]=a,t[u]=r,u+1<t.length?t[u+1]=e:t.push(e),u+=2}}}(e),m.left===r?m.left=null:m.right=null,new c(this.tree._compare,e[0])},Object.defineProperty(h,"key",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(h,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(h,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),h.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),h.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var r=new Array(e.length),n=e[e.length-1];r[r.length-1]=new a(n._color,n.key,t,n.left,n.right,n._count);for(var i=e.length-2;i>=0;--i)(n=e[i]).left===e[i+1]?r[i]=new a(n._color,n.key,n.value,r[i+1],n.right,n._count):r[i]=new a(n._color,n.key,n.value,n.left,r[i+1],n._count);return new c(this.tree._compare,r[0])},h.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},{}],145:[function(t,e,r){var n=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],i=607/128,a=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];function o(t){if(t<0)return Number("0/0");for(var e=a[0],r=a.length-1;r>0;--r)e+=a[r]/(t+r);var n=t+i+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}e.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(o(e));e-=1;for(var r=n[0],i=1;i<9;i++)r+=n[i]/(e+i);var a=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(a,e+.5)*Math.exp(-a)*r},e.exports.log=o},{}],146:[function(t,e,r){var n=t("wgs84");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,i,a=0;a<t.length-1;a++)r=t[a],e+=o((i=t[a+1])[0]-r[0])*(2+Math.sin(o(r[1]))+Math.sin(o(i[1])));e=e*n.RADIUS*n.RADIUS/2}return e}function o(t){return t*Math.PI/180}e.exports.geometry=function(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},e.exports.ring=a},{wgs84:559}],147:[function(t,e,r){var n=t("geojson-area");function i(t,e){return function(r){return t(r,e)}}function a(t,e){e=!!e,t[0]=o(t[0],!e);for(var r=1;r<t.length;r++)t[r]=o(t[r],e);return t}function o(t,e){return function(t){return n.ring(t)>=0}(t)===e?t:t.reverse()}e.exports=function t(e,r){switch(e&&e.type||null){case"FeatureCollection":return e.features=e.features.map(i(t,r)),e;case"Feature":return e.geometry=t(e.geometry,r),e;case"Polygon":case"MultiPolygon":return function(t,e){"Polygon"===t.type?t.coordinates=a(t.coordinates,e):"MultiPolygon"===t.type&&(t.coordinates=t.coordinates.map(i(a,e)));return t}(e,r);default:return e}}},{"geojson-area":146}],148:[function(t,e,r){"use strict";e.exports=function(t,e,r,o,s,l,c,u){if(o/=e,c>=(r/=e)&&u<=o)return t;if(c>o||u<r)return null;for(var f=[],h=0;h<t.length;h++){var d,p,m=t[h],v=m.geometry,g=m.type;if(d=m.min[s],p=m.max[s],d>=r&&p<=o)f.push(m);else if(!(d>o||p<r)){var y=1===g?i(v,r,o,s):a(v,r,o,s,l,3===g);y.length&&f.push(n(m.tags,g,y,m.id))}}return f.length?f:null};var n=t("./feature");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 c,u,f,h=0,d=0,p=null,m=t[l],v=m.area,g=m.dist,y=m.outer,b=m.length,x=[];for(u=0;u<b-1;u++)c=p||m[u],p=m[u+1],h=d||c[n],d=p[n],h<e?d>r?(x.push(i(c,p,e),i(c,p,r)),a||(x=o(s,x,v,g,y))):d>=e&&x.push(i(c,p,e)):h>r?d<e?(x.push(i(c,p,r),i(c,p,e)),a||(x=o(s,x,v,g,y))):d<=r&&x.push(i(c,p,r)):(x.push(c),d<e?(x.push(i(c,p,e)),a||(x=o(s,x,v,g,y))):d>r&&(x.push(i(c,p,r)),a||(x=o(s,x,v,g,y))));(h=(c=m[b-1])[n])>=e&&h<=r&&x.push(c),f=x[x.length-1],a&&f&&(x[0][0]!==f[0]||x[0][1]!==f[1])&&x.push(x[0]),o(s,x,v,g,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)),[]}},{"./feature":150}],149:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)a(r,t.features[n],e);else"Feature"===t.type?a(r,t,e):a(r,{geometry:t},e);return r};var n=t("./simplify"),i=t("./feature");function a(t,e,r){if(null!==e.geometry){var n,l,c,u,f=e.geometry,h=f.type,d=f.coordinates,p=e.properties,m=e.id;if("Point"===h)t.push(i(p,1,[s(d)],m));else if("MultiPoint"===h)t.push(i(p,1,o(d),m));else if("LineString"===h)t.push(i(p,2,[o(d,r)],m));else if("MultiLineString"===h||"Polygon"===h){for(c=[],n=0;n<d.length;n++)u=o(d[n],r),"Polygon"===h&&(u.outer=0===n),c.push(u);t.push(i(p,"Polygon"===h?3:2,c,m))}else if("MultiPolygon"===h){for(c=[],n=0;n<d.length;n++)for(l=0;l<d[n].length;l++)(u=o(d[n][l],r)).outer=0===l,c.push(u);t.push(i(p,3,c,m))}else{if("GeometryCollection"!==h)throw new Error("Input data is not a valid GeoJSON object.");for(n=0;n<f.geometries.length;n++)a(t,{geometry:f.geometries[n],properties:p},r)}}}function o(t,e){for(var r=[],i=0;i<t.length;i++)r.push(s(t[i]));return e&&(n(r,e),function(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}(r)),r}function s(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[r,n=n<0?0:n>1?1:n,0]}},{"./feature":150,"./simplify":152}],150:[function(t,e,r){"use strict";function n(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=function(t,e,r,i){var a={id:i||null,type:e,geometry:r,tags:t||null,min:[1/0,1/0],max:[-1/0,-1/0]};return function(t){var e=t.geometry,r=t.min,i=t.max;if(1===t.type)n(r,i,e);else for(var a=0;a<e.length;a++)n(r,i,e[a])}(a),a}},{}],151:[function(t,e,r){"use strict";e.exports=function(t,e){return new l(t,e)};var n=t("./convert"),i=t("./transform"),a=t("./clip"),o=t("./wrap"),s=t("./tile");function l(t,e){var r=(e=this.options=function(t,e){for(var r in e)t[r]=e[r];return t}(Object.create(this.options),e)).debug;r&&console.time("preprocess data");var i=1<<e.maxZoom,a=n(t,e.tolerance/(i*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),(a=o(a,e.buffer/e.extent,u)).length&&this.splitTile(a,0,0,0),r&&(a.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 c(t,e,r){return 32*((1<<t)*r+e)+t}function u(t,e,r){return[r,(r-t[0])*(e[1]-t[1])/(e[0]-t[0])+t[1],1]}function f(t,e,r){return[(r-t[1])*(e[0]-t[0])/(e[1]-t[1])+t[0],r,1]}function h(t,e,r){var n=t.source;if(1!==n.length)return!1;var a=n[0];if(3!==a.type||a.geometry.length>1)return!1;var o=a.geometry[0].length;if(5!==o)return!1;for(var s=0;s<o;s++){var l=i.point(a.geometry[0][s],e,t.z2,t.x,t.y);if(l[0]!==-r&&l[0]!==e+r||l[1]!==-r&&l[1]!==e+r)return!1}return!0}l.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,solidChildren:!1,tolerance:3,extent:4096,buffer:64,debug:0},l.prototype.splitTile=function(t,e,r,n,i,o,l){for(var d=[t,e,r,n],p=this.options,m=p.debug,v=null;d.length;){n=d.pop(),r=d.pop(),e=d.pop(),t=d.pop();var g=1<<e,y=c(e,r,n),b=this.tiles[y],x=e===p.maxZoom?0:p.tolerance/(g*p.extent);if(!b&&(m>1&&console.time("creation"),b=this.tiles[y]=s(t,g,r,n,x,e===p.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,b.numFeatures,b.numPoints,b.numSimplified),console.timeEnd("creation"));var _="z"+e;this.stats[_]=(this.stats[_]||0)+1,this.total++}if(b.source=t,i){if(e===p.maxZoom||e===i)continue;var w=1<<i-e;if(r!==Math.floor(o/w)||n!==Math.floor(l/w))continue}else if(e===p.indexMaxZoom||b.numPoints<=p.indexMaxPoints)continue;if(p.solidChildren||!h(b,p.extent,p.buffer)){b.source=null,m>1&&console.time("clipping");var M,k,A,T,E,S,L=.5*p.buffer/p.extent,C=.5-L,P=.5+L,z=1+L;M=k=A=T=null,E=a(t,g,r-L,r+P,0,u,b.min[0],b.max[0]),S=a(t,g,r+C,r+z,0,u,b.min[0],b.max[0]),E&&(M=a(E,g,n-L,n+P,1,f,b.min[1],b.max[1]),k=a(E,g,n+C,n+z,1,f,b.min[1],b.max[1])),S&&(A=a(S,g,n-L,n+P,1,f,b.min[1],b.max[1]),T=a(S,g,n+C,n+z,1,f,b.min[1],b.max[1])),m>1&&console.timeEnd("clipping"),t.length&&(d.push(M||[],e+1,2*r,2*n),d.push(k||[],e+1,2*r,2*n+1),d.push(A||[],e+1,2*r+1,2*n),d.push(T||[],e+1,2*r+1,2*n+1))}else i&&(v=e)}return v},l.prototype.getTile=function(t,e,r){var n=this.options,a=n.extent,o=n.debug,s=1<<t,l=c(t,e=(e%s+s)%s,r);if(this.tiles[l])return i.tile(this.tiles[l],a);o>1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var u,f=t,d=e,p=r;!u&&f>0;)f--,d=Math.floor(d/2),p=Math.floor(p/2),u=this.tiles[c(f,d,p)];if(!u||!u.source)return null;if(o>1&&console.log("found parent tile z%d-%d-%d",f,d,p),h(u,a,n.buffer))return i.tile(u,a);o>1&&console.time("drilling down");var m=this.splitTile(u.source,f,d,p,t,e,r);if(o>1&&console.timeEnd("drilling down"),null!==m){var v=1<<t-m;l=c(m,Math.floor(e/v),Math.floor(r/v))}return this.tiles[l]?i.tile(this.tiles[l],a):null}},{"./clip":148,"./convert":149,"./tile":153,"./transform":154,"./wrap":155}],152:[function(t,e,r){"use strict";function n(t,e,r){var n=e[0],i=e[1],a=r[0],o=r[1],s=t[0],l=t[1],c=a-n,u=o-i;if(0!==c||0!==u){var f=((s-n)*c+(l-i)*u)/(c*c+u*u);f>1?(n=a,i=o):f>0&&(n+=c*f,i+=u*f)}return(c=s-n)*c+(u=l-i)*u}e.exports=function(t,e){var r,i,a,o,s=e*e,l=0,c=t.length-1,u=[];t[l][2]=1,t[c][2]=1;for(;c;){for(i=0,r=l+1;r<c;r++)(a=n(t[r],t[l],t[c]))>i&&(o=r,i=a);i>s?(t[o][2]=i,u.push(l),u.push(o),l=o):(c=u.pop(),l=u.pop())}}},{}],153:[function(t,e,r){"use strict";function n(t,e,r,n){var a,o,s,l,c=e.geometry,u=e.type,f=[],h=r*r;if(1===u)for(a=0;a<c.length;a++)f.push(c[a]),t.numPoints++,t.numSimplified++;else for(a=0;a<c.length;a++)if(s=c[a],n||!(2===u&&s.dist<r||3===u&&s.area<h)){var d=[];for(o=0;o<s.length;o++)l=s[o],(n||l[2]>h)&&(d.push(l),t.numSimplified++),t.numPoints++;3===u&&i(d,s.outer),f.push(d)}else t.numPoints+=s.length;if(f.length){var p={geometry:f,type:u,tags:e.tags||null};null!==e.id&&(p.id=e.id),t.features.push(p)}}function i(t,e){(function(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})(t)<0===e&&t.reverse()}e.exports=function(t,e,r,i,a,o){for(var s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:i,z2:e,transformed:!1,min:[2,1],max:[-1,0]},l=0;l<t.length;l++){s.numFeatures++,n(s,t[l],a,o);var c=t[l].min,u=t[l].max;c[0]<s.min[0]&&(s.min[0]=c[0]),c[1]<s.min[1]&&(s.min[1]=c[1]),u[0]>s.max[0]&&(s.max[0]=u[0]),u[1]>s.max[1]&&(s.max[1]=u[1])}return s}},{}],154:[function(t,e,r){"use strict";function n(t,e,r,n,i){return[Math.round(e*(t[0]*r-n)),Math.round(e*(t[1]*r-i))]}r.tile=function(t,e){if(t.transformed)return t;var r,i,a,o=t.z2,s=t.x,l=t.y;for(r=0;r<t.features.length;r++){var c=t.features[r],u=c.geometry,f=c.type;if(1===f)for(i=0;i<u.length;i++)u[i]=n(u[i],e,o,s,l);else for(i=0;i<u.length;i++){var h=u[i];for(a=0;a<h.length;a++)h[a]=n(h[a],e,o,s,l)}}return t.transformed=!0,t},r.point=n},{}],155:[function(t,e,r){"use strict";var n=t("./clip"),i=t("./feature");function a(t,e){for(var r=[],n=0;n<t.length;n++){var a,s=t[n],l=s.type;if(1===l)a=o(s.geometry,e);else{a=[];for(var c=0;c<s.geometry.length;c++)a.push(o(s.geometry[c],e))}r.push(i(s.tags,l,a,s.id))}return r}function o(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}e.exports=function(t,e,r){var i=t,o=n(t,1,-1-e,e,0,r,-1,2),s=n(t,1,1-e,2+e,0,r,-1,2);(o||s)&&(i=n(t,1,-e,1+e,0,r,-1,2)||[],o&&(i=a(o,1).concat(i)),s&&(i=i.concat(a(s,-1))));return i}},{"./clip":148,"./feature":150}],156:[function(t,e,r){e.exports=function(t,e){if("string"!=typeof t)throw new TypeError("must specify type string");if(e=e||{},"undefined"==typeof document&&!e.canvas)return null;var r=e.canvas||document.createElement("canvas");"number"==typeof e.width&&(r.width=e.width);"number"==typeof e.height&&(r.height=e.height);var n,i=e;try{var a=[t];0===t.indexOf("webgl")&&a.push("experimental-"+t);for(var o=0;o<a.length;o++)if(n=r.getContext(a[o],i))return n}catch(t){n=null}return n||null}},{}],157:[function(t,e,r){"use strict";e.exports=function(t,e){var r=new u(t);return r.update(e),r};var n=t("./lib/text.js"),i=t("./lib/lines.js"),a=t("./lib/background.js"),o=t("./lib/cube.js"),s=t("./lib/ticks.js"),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);function c(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function u(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=a(t)}var f=u.prototype;function h(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}f.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,a=e.bind(this,!1,Number),o=e.bind(this,!1,Boolean),l=e.bind(this,!1,String),c=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]}),u=!1,f=!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]&&(f=!0),this.bounds[d][p]=h[d][p];if("ticks"in t){r=t.ticks,u=!0,this.autoTicks=!1;for(d=0;d<3;++d)this.tickSpacing[d]=0}else a("tickSpacing")&&(this.autoTicks=!0,f=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),f=!0,u=!0,this._firstInit=!1),f&&this.autoTicks&&(r=s.create(this.bounds,this.tickSpacing),u=!0),u){for(d=0;d<3;++d)r[d].sort(function(t,e){return t.x-e.x});s.equal(r,this.ticks)?u=!1:this.ticks=r}o("tickEnable"),l("tickFont")&&(u=!0),a("tickSize"),a("tickAngle"),a("tickPad"),c("tickColor");var m=l("labels");l("labelFont")&&(m=!0),o("labelEnable"),a("labelSize"),a("labelPad"),c("labelColor"),o("lineEnable"),o("lineMirror"),a("lineWidth"),c("lineColor"),o("lineTickEnable"),o("lineTickMirror"),a("lineTickLength"),a("lineTickWidth"),c("lineTickColor"),o("gridEnable"),a("gridWidth"),c("gridColor"),o("zeroEnable"),c("zeroLineColor"),a("zeroLineWidth"),o("backgroundEnable"),c("backgroundColor"),this._text?this._text&&(m||u)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=n(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&u&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=i(this.gl,this.bounds,this.ticks))};var d=[new h,new h,new h];function p(t,e,r,n,i){for(var a=t.primalOffset,o=t.primalMinor,s=t.mirrorOffset,l=t.mirrorMinor,c=n[e],u=0;u<3;++u)if(e!==u){var f=a,h=s,d=o,p=l;c&1<<u&&(f=s,h=a,d=l,p=o),f[u]=r[0][u],h[u]=r[1][u],i[u]>0?(d[u]=-1,p[u]=0):(d[u]=0,p[u]=1)}}var m=[0,0,0],v={model:l,view:l,projection:l};f.isOpaque=function(){return!0},f.isTransparent=function(){return!1},f.drawTransparent=function(t){};var g=[0,0,0],y=[0,0,0],b=[0,0,0];f.draw=function(t){t=t||v;for(var e=this.gl,r=t.model||l,n=t.view||l,i=t.projection||l,a=this.bounds,s=o(r,n,i,a),u=s.cubeEdges,f=s.axis,h=n[12],x=n[13],_=n[14],w=n[15],M=this.pixelRatio*(i[3]*h+i[7]*x+i[11]*_+i[15]*w)/e.drawingBufferHeight,k=0;k<3;++k)this.lastCubeProps.cubeEdges[k]=u[k],this.lastCubeProps.axis[k]=f[k];var A=d;for(k=0;k<3;++k)p(d[k],k,this.bounds,u,f);e=this.gl;var T=m;for(k=0;k<3;++k)this.backgroundEnable[k]?T[k]=f[k]:T[k]=0;this._background.draw(r,n,i,a,T,this.backgroundColor),this._lines.bind(r,n,i,this);for(k=0;k<3;++k){var E=[0,0,0];f[k]>0?E[k]=a[1][k]:E[k]=a[0][k];for(var S=0;S<2;++S){var L=(k+1+S)%3,C=(k+1+(1^S))%3;this.gridEnable[L]&&this._lines.drawGrid(L,C,this.bounds,E,this.gridColor[L],this.gridWidth[L]*this.pixelRatio)}for(S=0;S<2;++S){L=(k+1+S)%3,C=(k+1+(1^S))%3;this.zeroEnable[C]&&a[0][C]<=0&&a[1][C]>=0&&this._lines.drawZero(L,C,this.bounds,E,this.zeroLineColor[C],this.zeroLineWidth[C]*this.pixelRatio)}}for(k=0;k<3;++k){this.lineEnable[k]&&this._lines.drawAxisLine(k,this.bounds,A[k].primalOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio),this.lineMirror[k]&&this._lines.drawAxisLine(k,this.bounds,A[k].mirrorOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio);var P=c(g,A[k].primalMinor),z=c(y,A[k].mirrorMinor),O=this.lineTickLength;for(S=0;S<3;++S){var D=M/r[5*S];P[S]*=O[S]*D,z[S]*=O[S]*D}this.lineTickEnable[k]&&this._lines.drawAxisTicks(k,A[k].primalOffset,P,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio),this.lineTickMirror[k]&&this._lines.drawAxisTicks(k,A[k].mirrorOffset,z,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio)}this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio);for(k=0;k<3;++k){var I=A[k].primalMinor,R=c(b,A[k].primalOffset);for(S=0;S<3;++S)this.lineTickEnable[k]&&(R[S]+=M*I[S]*Math.max(this.lineTickLength[S],0)/r[5*S]);if(this.tickEnable[k]){for(S=0;S<3;++S)R[S]+=M*I[S]*this.tickPad[S]/r[5*S];this._text.drawTicks(k,this.tickSize[k],this.tickAngle[k],R,this.tickColor[k])}if(this.labelEnable[k]){for(S=0;S<3;++S)R[S]+=M*I[S]*this.labelPad[S]/r[5*S];R[k]+=.5*(a[0][k]+a[1][k]),this._text.drawLabel(k,this.labelSize[k],this.labelAngle[k],R,this.labelColor[k])}}this._text.unbind()},f.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{"./lib/background.js":158,"./lib/cube.js":159,"./lib/lines.js":160,"./lib/text.js":162,"./lib/ticks.js":163}],158:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(l+2)%3,f=[0,0,0],h=[0,0,0],d=-1;d<=1;d+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),f[l]=d,h[l]=d;for(var p=-1;p<=1;p+=2){f[c]=p;for(var m=-1;m<=1;m+=2)f[u]=m,e.push(f[0],f[1],f[2],h[0],h[1],h[2]),s+=1}var v=c;c=u,u=v}var g=n(t,new Float32Array(e)),y=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),b=i(t,[{buffer:g,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:g,type:t.FLOAT,size:3,offset:12,stride:24}],y),x=a(t);return x.attributes.position.location=0,x.attributes.normal.location=1,new o(t,g,b,x)};var n=t("gl-buffer"),i=t("gl-vao"),a=t("./shaders").bg;function o(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(t,e,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":161,"gl-buffer":165,"gl-vao":237}],159:[function(t,e,r){"use strict";e.exports=function(t,e,r,a){i(s,e,t),i(s,r,s);for(var d=0,y=0;y<2;++y){u[2]=a[y][2];for(var b=0;b<2;++b){u[1]=a[b][1];for(var x=0;x<2;++x)u[0]=a[x][0],h(l[d],u,s),d+=1}}for(var _=-1,y=0;y<8;++y){for(var w=l[y][3],M=0;M<3;++M)c[y][M]=l[y][M]/w;w<0&&(_<0?_=y:c[y][2]<c[_][2]&&(_=y))}if(_<0){_=0;for(var k=0;k<3;++k){for(var A=(k+2)%3,T=(k+1)%3,E=-1,S=-1,L=0;L<2;++L){var C=L<<k,P=C+(L<<A)+(1-L<<T),z=C+(1-L<<A)+(L<<T);o(c[C],c[P],c[z],f)<0||(L?E=1:S=1)}if(E<0||S<0)S>E&&(_|=1<<k);else{for(var L=0;L<2;++L){var C=L<<k,P=C+(L<<A)+(1-L<<T),z=C+(1-L<<A)+(L<<T),O=p([l[C],l[P],l[z],l[C+(1<<A)+(1<<T)]]);L?E=O:S=O}S>E&&(_|=1<<k)}}}for(var D=7^_,I=-1,y=0;y<8;++y)y!==_&&y!==D&&(I<0?I=y:c[I][1]>c[y][1]&&(I=y));for(var R=-1,y=0;y<3;++y){var N=I^1<<y;if(N!==_&&N!==D){R<0&&(R=N);var T=c[N];T[0]<c[R][0]&&(R=N)}}for(var F=-1,y=0;y<3;++y){var N=I^1<<y;if(N!==_&&N!==D&&N!==R){F<0&&(F=N);var T=c[N];T[0]>c[F][0]&&(F=N)}}var j=m;j[0]=j[1]=j[2]=0,j[n.log2(R^I)]=I&R,j[n.log2(I^F)]=I&F;var B=7^F;B===_||B===D?(B=7^R,j[n.log2(F^B)]=B&F):j[n.log2(R^B)]=B&R;for(var U=v,V=_,k=0;k<3;++k)U[k]=V&1<<k?-1:1;return g};var n=t("bit-twiddle"),i=t("gl-mat4/multiply"),a=(t("gl-mat4/invert"),t("split-polygon")),o=t("robust-orientation"),s=new Array(16),l=(new Array(16),new Array(8)),c=new Array(8),u=new Array(3),f=[0,0,0];function h(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(){for(var t=0;t<8;++t)l[t]=[1,1,1,1],c[t]=[1,1,1]}();var d=[[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]];function p(t){for(var e=0;e<d.length;++e)if((t=a.positive(t,d[e])).length<3)return 0;var r=t[0],n=r[0]/r[3],i=r[1]/r[3],o=0;for(e=1;e+1<t.length;++e){var s=t[e],l=t[e+1],c=s[0]/s[3]-n,u=s[1]/s[3]-i,f=l[0]/l[3]-n,h=l[1]/l[3]-i;o+=Math.abs(c*h-u*f)}return o}var m=[1,1,1],v=[0,0,0],g={cubeEdges:m,axis:v}},{"bit-twiddle":71,"gl-mat4/invert":186,"gl-mat4/multiply":188,"robust-orientation":495,"split-polygon":515}],160:[function(t,e,r){"use strict";e.exports=function(t,e,r){var o=[],s=[0,0,0],l=[0,0,0],c=[0,0,0],u=[0,0,0];o.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 h=o.length/3|0,p=0;p<r[f].length;++p){var m=+r[f][p].x;o.push(m,0,1,m,1,1,m,0,-1,m,0,-1,m,1,1,m,1,-1)}var v=o.length/3|0;s[f]=h,l[f]=v-h;for(var h=o.length/3|0,g=0;g<r[f].length;++g){var m=+r[f][g].x;o.push(m,0,1,m,1,1,m,0,-1,m,0,-1,m,1,1,m,1,-1)}var v=o.length/3|0;c[f]=h,u[f]=v-h}var y=n(t,new Float32Array(o)),b=i(t,[{buffer:y,type:t.FLOAT,size:3,stride:0,offset:0}]),x=a(t);return x.attributes.position.location=0,new d(t,y,b,x,l,s,u,c)};var n=t("gl-buffer"),i=t("gl-vao"),a=t("./shaders").line,o=[0,0,0],s=[0,0,0],l=[0,0,0],c=[0,0,0],u=[1,1];function f(t){return t[0]=t[1]=t[2]=0,t}function h(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function d(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}var p=d.prototype;p.bind=function(t,e,r){this.shader.bind(),this.shader.uniforms.model=t,this.shader.uniforms.view=e,this.shader.uniforms.projection=r,u[0]=this.gl.drawingBufferWidth,u[1]=this.gl.drawingBufferHeight,this.shader.uniforms.screenShape=u,this.vao.bind()},p.unbind=function(){this.vao.unbind()},p.drawAxisLine=function(t,e,r,n,i){var a=f(s);this.shader.uniforms.majorAxis=s,a[t]=e[1][t]-e[0][t],this.shader.uniforms.minorAxis=a;var o,u=h(c,r);u[t]+=e[0][t],this.shader.uniforms.offset=u,this.shader.uniforms.lineWidth=i,this.shader.uniforms.color=n,(o=f(l))[(t+2)%3]=1,this.shader.uniforms.screenAxis=o,this.vao.draw(this.gl.TRIANGLES,6),(o=f(l))[(t+1)%3]=1,this.shader.uniforms.screenAxis=o,this.vao.draw(this.gl.TRIANGLES,6)},p.drawAxisTicks=function(t,e,r,n,i){if(this.tickCount[t]){var a=f(o);a[t]=1,this.shader.uniforms.majorAxis=a,this.shader.uniforms.offset=e,this.shader.uniforms.minorAxis=r,this.shader.uniforms.color=n,this.shader.uniforms.lineWidth=i;var s=f(l);s[t]=1,this.shader.uniforms.screenAxis=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[t],this.tickOffset[t])}},p.drawGrid=function(t,e,r,n,i,a){if(this.gridCount[t]){var u=f(s);u[e]=r[1][e]-r[0][e],this.shader.uniforms.minorAxis=u;var d=h(c,n);d[e]+=r[0][e],this.shader.uniforms.offset=d;var p=f(o);p[t]=1,this.shader.uniforms.majorAxis=p;var m=f(l);m[t]=1,this.shader.uniforms.screenAxis=m,this.shader.uniforms.lineWidth=a,this.shader.uniforms.color=i,this.vao.draw(this.gl.TRIANGLES,this.gridCount[t],this.gridOffset[t])}},p.drawZero=function(t,e,r,n,i,a){var o=f(s);this.shader.uniforms.majorAxis=o,o[t]=r[1][t]-r[0][t],this.shader.uniforms.minorAxis=o;var u=h(c,n);u[t]+=r[0][t],this.shader.uniforms.offset=u;var d=f(l);d[e]=1,this.shader.uniforms.screenAxis=d,this.shader.uniforms.lineWidth=a,this.shader.uniforms.color=i,this.vao.draw(this.gl.TRIANGLES,6)},p.dispose=function(){this.vao.dispose(),this.vertBuffer.dispose(),this.shader.dispose()}},{"./shaders":161,"gl-buffer":165,"gl-vao":237}],161:[function(t,e,r){"use strict";var n=t("glslify"),i=t("gl-shader"),a=n(["#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"]),o=n(["precision mediump float;\n#define GLSLIFY 1\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);r.line=function(t){return i(t,a,o,null,[{name:"position",type:"vec3"}])};var s=n(["#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}"]),l=n(["precision mediump float;\n#define GLSLIFY 1\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);r.text=function(t){return i(t,s,l,null,[{name:"position",type:"vec3"}])};var c=n(["#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=n(["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 i(t,c,u,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":220,glslify:253}],162:[function(t,e,r){(function(r){"use strict";e.exports=function(t,e,r,a,s,l){var u=n(t),f=i(t,[{buffer:u,size:3}]),h=o(t);h.attributes.position.location=0;var d=new c(t,h,u,f);return d.update(e,r,a,s,l),d};var n=t("gl-buffer"),i=t("gl-vao"),a=t("vectorize-text"),o=t("./shaders").text,s=window||r.global||{},l=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};function c(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}var u=c.prototype,f=[0,0];u.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=t,i.view=e,i.projection=r,i.pixelScale=n,f[0]=this.gl.drawingBufferWidth,f[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=f},u.unbind=function(){this.vao.unbind()},u.update=function(t,e,r,n,i){this.gl;var o=[];function s(t,e,r,n){var i=l[r];i||(i=l[r]={});var s=i[e];s||(s=i[e]=function(t,e){try{return a(t,e)}catch(t){return console.warn("error vectorizing text:",t),{cells:[],positions:[]}}}(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle"}));for(var c=(n||12)/12,u=s.positions,f=s.cells,h=0,d=f.length;h<d;++h)for(var p=f[h],m=2;m>=0;--m){var v=u[p[m]];o.push(c*v[0],-c*v[1],t)}}for(var c=[0,0,0],u=[0,0,0],f=[0,0,0],h=[0,0,0],d=0;d<3;++d){f[d]=o.length/3|0,s(.5*(t[0][d]+t[1][d]),e[d],r),h[d]=(o.length/3|0)-f[d],c[d]=o.length/3|0;for(var p=0;p<n[d].length;++p)n[d][p].text&&s(n[d][p].x,n[d][p].text,n[d][p].font||i,n[d][p].fontSize||12);u[d]=(o.length/3|0)-c[d]}this.buffer.update(o),this.tickOffset=c,this.tickCount=u,this.labelOffset=f,this.labelCount=h};var h=[0,0,0];u.drawTicks=function(t,e,r,n,i){if(this.tickCount[t]){var a=h;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 d=[0,0,0];u.drawLabel=function(t,e,r,n,i){this.labelCount[t]&&(this.shader.uniforms.axis=d,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]))},u.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()}}).call(this,t("_process"))},{"./shaders":161,_process:469,"gl-buffer":165,"gl-vao":237,"vectorize-text":548}],163:[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,c=o%a;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(o<0&&(u="-"+u),i){for(var f=""+c;f.length<i;)f="0"+f;return u+"."+f}return u}r.create=function(t,e){for(var r=[],i=0;i<3;++i){for(var a=[],o=(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},r.equal=function(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;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}},{}],164:[function(t,e,r){"use strict";e.exports=function(t,e,r,l,f){var h=e.model||c,d=e.view||c,g=e.projection||c,y=t.bounds,b=(f=f||a(h,d,g,y)).axis;f.edges;o(u,d,h),o(u,g,u);for(var x=m,_=0;_<3;++_)x[_].lo=1/0,x[_].hi=-1/0,x[_].pixelsPerDataUnit=1/0;var w=n(s(u,u));s(u,u);for(var M=0;M<3;++M){var k=(M+1)%3,A=(M+2)%3,T=v;t:for(var _=0;_<2;++_){var E=[];if(b[M]<0!=!!_){T[M]=y[_][M];for(var S=0;S<2;++S){T[k]=y[S^_][k];for(var L=0;L<2;++L)T[A]=y[L^S^_][A],E.push(T.slice())}for(var S=0;S<w.length;++S){if(0===E.length)continue t;E=i.positive(E,w[S])}for(var S=0;S<E.length;++S)for(var A=E[S],C=p(v,u,A,r,l),L=0;L<3;++L)x[L].lo=Math.min(x[L].lo,A[L]),x[L].hi=Math.max(x[L].hi,A[L]),L!==M&&(x[L].pixelsPerDataUnit=Math.min(x[L].pixelsPerDataUnit,Math.abs(C[L])))}}}return x};var n=t("extract-frustum-planes"),i=t("split-polygon"),a=t("./lib/cube.js"),o=t("gl-mat4/multiply"),s=t("gl-mat4/transpose"),l=t("gl-vec4/transformMat4"),c=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),u=new Float32Array(16);function f(t,e,r){this.lo=t,this.hi=e,this.pixelsPerDataUnit=r}var h=[0,0,0,1],d=[0,0,0,1];function p(t,e,r,n,i){for(var a=0;a<3;++a){for(var o=h,s=d,c=0;c<3;++c)s[c]=o[c]=r[c];s[3]=o[3]=1,s[a]+=1,l(s,s,e),s[3]<0&&(t[a]=1/0),o[a]-=1,l(o,o,e),o[3]<0&&(t[a]=1/0);var u=(o[0]/o[3]-s[0]/s[3])*n,f=(o[1]/o[3]-s[1]/s[3])*i;t[a]=.25*Math.sqrt(u*u+f*f)}return t}var m=[new f(1/0,-1/0,1/0),new f(1/0,-1/0,1/0),new f(1/0,-1/0,1/0)],v=[0,0,0]},{"./lib/cube.js":159,"extract-frustum-planes":139,"gl-mat4/multiply":188,"gl-mat4/transpose":196,"gl-vec4/transformMat4":243,"split-polygon":515}],165:[function(t,e,r){"use strict";var n=t("typedarray-pool"),i=t("ndarray-ops"),a=t("ndarray"),o=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"];function s(t,e,r,n,i){this.gl=t,this.type=e,this.handle=r,this.length=n,this.usage=i}var l=s.prototype;function c(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 u(t,e){for(var r=n.malloc(t.length,e),i=t.length,a=0;a<i;++a)r[a]=t[a];return r}l.bind=function(){this.gl.bindBuffer(this.type,this.handle)},l.unbind=function(){this.gl.bindBuffer(this.type,null)},l.dispose=function(){this.gl.deleteBuffer(this.handle)},l.update=function(t,e){if("number"!=typeof e&&(e=-1),this.bind(),"object"==typeof t&&void 0!==t.shape){var r=t.dtype;if(o.indexOf(r)<0&&(r="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER)r=gl.getExtension("OES_element_index_uint")&&"uint16"!==r?"uint32":"uint16";if(r===t.dtype&&function(t,e){for(var r=1,n=e.length-1;n>=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=c(this.gl,this.type,this.length,this.usage,t.data,e):this.length=c(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=a(s,t.shape);i.assign(l,t),this.length=c(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?u(t,"uint16"):u(t,"float32"),this.length=c(this.gl,this.type,this.length,this.usage,e<0?f:f.subarray(0,t.length),e),n.free(f)}else if("object"==typeof t&&"number"==typeof t.length)this.length=c(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(t|=0)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var i=new s(t,r,t.createBuffer(),0,n);return i.update(e),i}},{ndarray:439,"ndarray-ops":433,"typedarray-pool":534}],166:[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"}},{}],167:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":166}],168:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e),o=i(e,[{buffer:r,type:e.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:e.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:e.FLOAT,size:3,offset:28,stride:40}]),l=a(e);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var c=new s(e,r,o,l);return c.update(t),c};var n=t("gl-buffer"),i=t("gl-vao"),a=t("./shaders/index"),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1}var l=s.prototype;function c(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}l.isOpaque=function(){return this.opacity>=1},l.isTransparent=function(){return this.opacity<1},l.drawTransparent=l.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||o,i=r.projection=t.projection||o;r.model=t.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],c=n[15],u=this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*c)/e.drawingBufferHeight;this.vao.bind();for(var f=0;f<3;++f)e.lineWidth(this.lineWidth[f]),r.capSize=this.capSize[f]*u,this.lineCount[f]&&e.drawArrays(e.LINES,this.lineOffset[f],this.lineCount[f]);this.vao.unbind()};var u=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=[0,0,0];a[(n+e)%3]=i,r.push(a)}t[e]=r}return t}();function f(t,e,r,n){for(var i=u[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}l.update=function(t){"lineWidth"in(t=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 i=[],a=r.length,o=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var s=0;s<3;++s){this.lineOffset[s]=o;t:for(var l=0;l<a;++l){for(var u=r[l],h=0;h<3;++h)if(isNaN(u[h])||!isFinite(u[h]))continue t;var d=n[l],p=e[s];if(Array.isArray(p[0])&&(p=e[l]),3===p.length&&(p=[p[0],p[1],p[2],1]),!isNaN(d[0][s])&&!isNaN(d[1][s])){var m;if(d[0][s]<0)(m=u.slice())[s]+=d[0][s],i.push(u[0],u[1],u[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),c(this.bounds,m),o+=2+f(i,m,p,s);if(d[1][s]>0)(m=u.slice())[s]+=d[1][s],i.push(u[0],u[1],u[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),c(this.bounds,m),o+=2+f(i,m,p,s)}}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":170,"gl-buffer":165,"gl-vao":237}],169:[function(t,e,r){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n<t.length-1;n++)r.push(t[n],e[n]||"");return r.push(t[n]),r.join("")}},{}],170:[function(t,e,r){"use strict";var n=t("glslify"),i=t("gl-shader"),a=n(["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}"]),o=n(["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 i(t,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},{"gl-shader":220,glslify:169}],171:[function(t,e,r){"use strict";var n=t("gl-texture2d");e.exports=function(t,e,r,n){i||(i=t.FRAMEBUFFER_UNSUPPORTED,a=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var c=t.getExtension("WEBGL_draw_buffers");!l&&c&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;a<n;++a)i[a]=t.COLOR_ATTACHMENT0+a;for(var a=n;a<r;++a)i[a]=t.NONE;l[n]=i}}(t,c);Array.isArray(e)&&(n=r,r=0|e[1],e=0|e[0]);if("number"!=typeof e)throw new Error("gl-fbo: Missing shape parameter");var u=t.getParameter(t.MAX_RENDERBUFFER_SIZE);if(e<0||e>u||r<0||r>u)throw new Error("gl-fbo: Parameters are too large for FBO");var f=1;if("color"in(n=n||{})){if((f=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(f>1){if(!c)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(f>t.getParameter(c.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+f+" draw buffers")}}var h=t.UNSIGNED_BYTE,d=t.getExtension("OES_texture_float");if(n.float&&f>0){if(!d)throw new Error("gl-fbo: Context does not support floating point textures");h=t.FLOAT}else n.preferFloat&&f>0&&d&&(h=t.FLOAT);var m=!0;"depth"in n&&(m=!!n.depth);var v=!1;"stencil"in n&&(v=!!n.stencil);return new p(t,e,r,h,f,m,v,c)};var i,a,o,s,l=null;function c(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function u(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function f(t){switch(t){case i:throw new Error("gl-fbo: Framebuffer unsupported");case a:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function h(t,e,r,i,a,o){if(!i)return null;var s=n(t,e,r,a,i);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function d(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 p(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 p=0;p<i;++p)this.color[p]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=n,this._useDepth=a,this._useStencil=o;var m=this,v=[0|e,0|r];Object.defineProperties(v,{0:{get:function(){return m._shape[0]},set:function(t){return m.width=t}},1:{get:function(){return m._shape[1]},set:function(t){return m.height=t}}}),this._shapeVector=v,function(t){var e=c(t.gl),r=t.gl,n=t.handle=r.createFramebuffer(),i=t._shape[0],a=t._shape[1],o=t.color.length,s=t._ext,p=t._useStencil,m=t._useDepth,v=t._colorType;r.bindFramebuffer(r.FRAMEBUFFER,n);for(var g=0;g<o;++g)t.color[g]=h(r,i,a,v,r.RGBA,r.COLOR_ATTACHMENT0+g);0===o?(t._color_rb=d(r,i,a,r.RGBA4,r.COLOR_ATTACHMENT0),s&&s.drawBuffersWEBGL(l[0])):o>1&&s.drawBuffersWEBGL(l[o]);var y=r.getExtension("WEBGL_depth_texture");y?p?t.depth=h(r,i,a,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m&&(t.depth=h(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):m&&p?t._depth_rb=d(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m?t._depth_rb=d(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):p&&(t._depth_rb=d(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var b=r.checkFramebufferStatus(r.FRAMEBUFFER);if(b!==r.FRAMEBUFFER_COMPLETE){for(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),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),u(r,e),f(b)}u(r,e)}(this)}var m=p.prototype;function v(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 n=t.gl,i=n.getParameter(n.MAX_RENDERBUFFER_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var a=c(n),o=0;o<t.color.length;++o)t.color[o].shape=t._shape;t._color_rb&&(n.bindRenderbuffer(n.RENDERBUFFER,t._color_rb),n.renderbufferStorage(n.RENDERBUFFER,n.RGBA4,t._shape[0],t._shape[1])),t.depth&&(t.depth.shape=t._shape),t._depth_rb&&(n.bindRenderbuffer(n.RENDERBUFFER,t._depth_rb),t._useDepth&&t._useStencil?n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,t._shape[0],t._shape[1]):t._useDepth?n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,t._shape[0],t._shape[1]):t._useStencil&&n.renderbufferStorage(n.RENDERBUFFER,n.STENCIL_INDEX,t._shape[0],t._shape[1])),n.bindFramebuffer(n.FRAMEBUFFER,t.handle);var s=n.checkFramebufferStatus(n.FRAMEBUFFER);s!==n.FRAMEBUFFER_COMPLETE&&(t.dispose(),u(n,a),f(s)),u(n,a)}}Object.defineProperties(m,{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 v(this,e,r),[e,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return v(this,t|=0,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t|=0,v(this,this._shape[0],t),t},enumerable:!1}}),m.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])}},m.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":233}],172:[function(t,e,r){var n=t("sprintf-js").sprintf,i=t("gl-constants/lookup"),a=t("glsl-shader-name"),o=t("add-line-numbers");e.exports=function(t,e,r){"use strict";var s=a(e)||"of unknown name (see npm glsl-shader-name)",l="unknown type";void 0!==r&&(l=r===i.FRAGMENT_SHADER?"fragment":"vertex");for(var c=n("Error compiling %s shader %s:\n",l,s),u=n("%s%s",c,t),f=t.split("\n"),h={},d=0;d<f.length;d++){var p=f[d];if(""!==p&&"\0"!==p){var m=parseInt(p.split(":")[2]);if(isNaN(m))throw new Error(n("Could not parse error: %s",p));h[m]=p}}for(var v=o(e).split("\n"),d=0;d<v.length;d++)if(h[d+3]||h[d+2]||h[d+1]){var g=v[d];if(c+=g+"\n",h[d+1]){var y=h[d+1];y=y.substr(y.split(":",3).join(":").length+1).trim(),c+=n("^^^ %s\n\n",y)}}return{long:c.trim(),short:u.trim()}}},{"add-line-numbers":44,"gl-constants/lookup":167,"glsl-shader-name":245,"sprintf-js":516}],173:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.gl,n=o(r,l.vertex,l.fragment),i=o(r,l.pickVertex,l.pickFragment),a=s(r),u=s(r),f=s(r),h=s(r),d=new c(t,n,i,a,u,f,h);return d.update(e),t.addObject(d),d};var n=t("binary-search-bounds"),i=t("iota-array"),a=t("typedarray-pool"),o=t("gl-shader"),s=t("gl-buffer"),l=t("./lib/shaders");function c(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}var u,f=c.prototype,h=[0,0,1,0,0,1,1,0,1,1,0,1];f.draw=(u=[1,0,0,0,1,0,0,0,1],function(){var t=this.plot,e=this.shader,r=this.bounds,n=this.numVertices;if(!(n<=0)){var i=t.gl,a=t.dataBox,o=r[2]-r[0],s=r[3]-r[1],l=a[2]-a[0],c=a[3]-a[1];u[0]=2*o/l,u[4]=2*s/c,u[6]=2*(r[0]-a[0])/l-1,u[7]=2*(r[1]-a[1])/c-1,e.bind();var f=e.uniforms;f.viewTransform=u,f.shape=this.shape;var h=e.attributes;this.positionBuffer.bind(),h.position.pointer(),this.weightBuffer.bind(),h.weight.pointer(i.UNSIGNED_BYTE,!1),this.colorBuffer.bind(),h.color.pointer(i.UNSIGNED_BYTE,!0),i.drawArrays(i.TRIANGLES,0,n)}}),f.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,c=a[2]-a[0],u=a[3]-a[1],f=l[2]-l[0],h=l[3]-l[1];t[0]=2*c/f,t[4]=2*u/h,t[6]=2*(a[0]-l[0])/f-1,t[7]=2*(a[1]-l[1])/h-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]}}}(),f.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]]}},f.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||i(e[0]),o=t.y||i(e[1]),s=t.z||new Float32Array(e[0]*e[1]);this.xData=r,this.yData=o;var l=t.colorLevels||[0],c=t.colorValues||[0,0,0,1],u=l.length,f=this.bounds,d=f[0]=r[0],p=f[1]=o[0],m=1/((f[2]=r[r.length-1])-d),v=1/((f[3]=o[o.length-1])-p),g=e[0],y=e[1];this.shape=[g,y];var b=(g-1)*(y-1)*(h.length>>>1);this.numVertices=b;for(var x=a.mallocUint8(4*b),_=a.mallocFloat32(2*b),w=a.mallocUint8(2*b),M=a.mallocUint32(b),k=0,A=0;A<y-1;++A)for(var T=v*(o[A]-p),E=v*(o[A+1]-p),S=0;S<g-1;++S)for(var L=m*(r[S]-d),C=m*(r[S+1]-d),P=0;P<h.length;P+=2){var z,O,D,I,R=h[P],N=h[P+1],F=s[(A+N)*g+(S+R)],j=n.le(l,F);if(j<0)z=c[0],O=c[1],D=c[2],I=c[3];else if(j===u-1)z=c[4*u-4],O=c[4*u-3],D=c[4*u-2],I=c[4*u-1];else{var B=(F-l[j])/(l[j+1]-l[j]),U=1-B,V=4*j,q=4*(j+1);z=U*c[V]+B*c[q],O=U*c[V+1]+B*c[q+1],D=U*c[V+2]+B*c[q+2],I=U*c[V+3]+B*c[q+3]}x[4*k]=255*z,x[4*k+1]=255*O,x[4*k+2]=255*D,x[4*k+3]=255*I,_[2*k]=.5*L+.5*C,_[2*k+1]=.5*T+.5*E,w[2*k]=R,w[2*k+1]=N,M[k]=A*g+S,k+=1}this.positionBuffer.update(_),this.weightBuffer.update(w),this.colorBuffer.update(x),this.idBuffer.update(M),a.free(_),a.free(x),a.free(w),a.free(M)},f.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":174,"binary-search-bounds":175,"gl-buffer":165,"gl-shader":220,"iota-array":261,"typedarray-pool":534}],174:[function(t,e,r){"use strict";var n=t("glslify");e.exports={fragment:n(["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:n(["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:n(["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:n(["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"])}},{glslify:253}],175:[function(t,e,r){arguments[4][90][0].apply(r,arguments)},{dup:90}],176:[function(t,e,r){var n=t("glslify"),i=t("gl-shader"),a=n(["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"]),o=n(["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"]),s=n(["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_1540259130(highp float v) {\n highp float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n highp float e = floor(log2(av));\n highp float m = av * pow(2.0, -e) - 1.0;\n \n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n \n //Unpack exponent\n highp float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0; \n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\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_1540259130(pixelArcLength).xyz);\n}"]),l=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];r.createShader=function(t){return i(t,a,o,null,l)},r.createPickShader=function(t){return i(t,a,s,null,l)}},{"gl-shader":220,glslify:253}],177:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=u(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var o=f(e);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(e),c=i(e,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),h=l(new Array(1024),[256,1,4]),d=0;d<1024;++d)h.data[d]=255;var p=a(e,h);p.wrap=e.REPEAT;var m=new v(e,r,o,s,c,p);return m.update(t),m};var n=t("gl-buffer"),i=t("gl-vao"),a=t("gl-texture2d"),o=t("glsl-read-float"),s=t("binary-search-bounds"),l=t("ndarray"),c=t("./lib/shaders"),u=c.createShader,f=c.createPickShader,h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function d(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 p(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 m(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function v(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}var g=v.prototype;g.isTransparent=function(){return this.opacity<1},g.isOpaque=function(){return this.opacity>=1},g.pickSlots=1,g.setPickBase=function(t){this.pickId=t},g.drawTransparent=g.draw=function(t){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||h,view:t.view||h,projection:t.projection||h,clipBounds:p(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()},g.drawPick=function(t){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||h,view:t.view||h,projection:t.projection||h,pickId:this.pickId,clipBounds:p(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()},g.update=function(t){var e,r;this.dirty=!0;var n=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),"opacity"in t&&(this.opacity=+t.opacity);var i=t.position||t.positions;if(i){var a=t.color||t.colors||[0,0,0,1],o=t.lineWidth||1,c=[],u=[],f=[],h=0,p=0,m=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],v=!1;t:for(e=1;e<i.length;++e){var g,y,b,x=i[e-1],_=i[e];for(u.push(h),f.push(x.slice()),r=0;r<3;++r){if(isNaN(x[r])||isNaN(_[r])||!isFinite(x[r])||!isFinite(_[r])){if(!n&&c.length>0){for(var w=0;w<24;++w)c.push(c[c.length-12]);p+=2,v=!0}continue t}m[0][r]=Math.min(m[0][r],x[r],_[r]),m[1][r]=Math.max(m[1][r],x[r],_[r])}Array.isArray(a[0])?(g=a[e-1],y=a[e]):g=y=a,3===g.length&&(g=[g[0],g[1],g[2],1]),3===y.length&&(y=[y[0],y[1],y[2],1]),b=Array.isArray(o)?o[e-1]:o;var M=h;if(h+=d(x,_),v){for(r=0;r<2;++r)c.push(x[0],x[1],x[2],_[0],_[1],_[2],M,b,g[0],g[1],g[2],g[3]);p+=2,v=!1}c.push(x[0],x[1],x[2],_[0],_[1],_[2],M,b,g[0],g[1],g[2],g[3],x[0],x[1],x[2],_[0],_[1],_[2],M,-b,g[0],g[1],g[2],g[3],_[0],_[1],_[2],x[0],x[1],x[2],h,-b,y[0],y[1],y[2],y[3],_[0],_[1],_[2],x[0],x[1],x[2],h,b,y[0],y[1],y[2],y[3]),p+=4}if(this.buffer.update(c),u.push(h),f.push(i[i.length-1].slice()),this.bounds=m,this.vertexCount=p,this.points=f,this.arcLength=u,"dashes"in t){var k=t.dashes.slice();for(k.unshift(0),e=1;e<k.length;++e)k[e]=k[e-1]+k[e];var A=l(new Array(1024),[256,1,4]);for(e=0;e<256;++e){for(r=0;r<4;++r)A.set(e,0,r,0);1&s.le(k,k[k.length-1]*e/255)?A.set(e,0,0,0):A.set(e,0,0,255)}this.texture.setPixels(A)}}},g.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()},g.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=o(t.value[0],t.value[1],t.value[2],0),r=s.le(this.arcLength,e);if(r<0)return null;if(r===this.arcLength.length-1)return new m(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)],a=(e-this.arcLength[r])/(this.arcLength[r+1]-this.arcLength[r]),l=1-a,c=[0,0,0],u=0;u<3;++u)c[u]=l*n[u]+a*i[u];var f=Math.min(a<.5?r:r+1,this.points.length-1);return new m(e,c,f,this.points[f])}},{"./lib/shaders":176,"binary-search-bounds":70,"gl-buffer":165,"gl-texture2d":233,"gl-vao":237,"glsl-read-float":244,ndarray:439}],178:[function(t,e,r){e.exports=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}},{}],179:[function(t,e,r){e.exports=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],c=e[7],u=e[8],f=u*o-s*c,h=-u*a+s*l,d=c*a-o*l,p=r*f+n*h+i*d;return p?(p=1/p,t[0]=f*p,t[1]=(-u*n+i*c)*p,t[2]=(s*n-i*o)*p,t[3]=h*p,t[4]=(u*r-i*l)*p,t[5]=(-s*r+i*a)*p,t[6]=d*p,t[7]=(-c*r+n*l)*p,t[8]=(o*r-n*a)*p,t):null}},{}],180:[function(t,e,r){e.exports=function(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}},{}],181:[function(t,e,r){e.exports=function(){var t=new Float32Array(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],182:[function(t,e,r){e.exports=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],c=t[8],u=t[9],f=t[10],h=t[11],d=t[12],p=t[13],m=t[14],v=t[15];return(e*o-r*a)*(f*v-h*m)-(e*s-n*a)*(u*v-h*p)+(e*l-i*a)*(u*m-f*p)+(r*s-n*o)*(c*v-h*d)-(r*l-i*o)*(c*m-f*d)+(n*l-i*s)*(c*p-u*d)}},{}],183:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,c=r*o,u=n*o,f=n*s,h=i*o,d=i*s,p=i*l,m=a*o,v=a*s,g=a*l;return t[0]=1-f-p,t[1]=u+g,t[2]=h-v,t[3]=0,t[4]=u-g,t[5]=1-c-p,t[6]=d+m,t[7]=0,t[8]=h+v,t[9]=d-m,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],184:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=n+n,l=i+i,c=a+a,u=n*s,f=n*l,h=n*c,d=i*l,p=i*c,m=a*c,v=o*s,g=o*l,y=o*c;return t[0]=1-(d+m),t[1]=f+y,t[2]=h-g,t[3]=0,t[4]=f-y,t[5]=1-(u+m),t[6]=p+v,t[7]=0,t[8]=h+g,t[9]=p-v,t[10]=1-(u+d),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}},{}],185:[function(t,e,r){e.exports=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}},{}],186:[function(t,e,r){e.exports=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],c=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],m=e[13],v=e[14],g=e[15],y=r*s-n*o,b=r*l-i*o,x=r*c-a*o,_=n*l-i*s,w=n*c-a*s,M=i*c-a*l,k=u*m-f*p,A=u*v-h*p,T=u*g-d*p,E=f*v-h*m,S=f*g-d*m,L=h*g-d*v,C=y*L-b*S+x*E+_*T-w*A+M*k;if(!C)return null;return C=1/C,t[0]=(s*L-l*S+c*E)*C,t[1]=(i*S-n*L-a*E)*C,t[2]=(m*M-v*w+g*_)*C,t[3]=(h*w-f*M-d*_)*C,t[4]=(l*T-o*L-c*A)*C,t[5]=(r*L-i*T+a*A)*C,t[6]=(v*x-p*M-g*b)*C,t[7]=(u*M-h*x+d*b)*C,t[8]=(o*S-s*T+c*k)*C,t[9]=(n*T-r*S-a*k)*C,t[10]=(p*w-m*x+g*y)*C,t[11]=(f*x-u*w-d*y)*C,t[12]=(s*A-o*E-l*k)*C,t[13]=(r*E-n*A+i*k)*C,t[14]=(m*b-p*_-v*y)*C,t[15]=(u*_-f*b+h*y)*C,t}},{}],187:[function(t,e,r){var n=t("./identity");e.exports=function(t,e,r,i){var a,o,s,l,c,u,f,h,d,p,m=e[0],v=e[1],g=e[2],y=i[0],b=i[1],x=i[2],_=r[0],w=r[1],M=r[2];if(Math.abs(m-_)<1e-6&&Math.abs(v-w)<1e-6&&Math.abs(g-M)<1e-6)return n(t);f=m-_,h=v-w,d=g-M,p=1/Math.sqrt(f*f+h*h+d*d),a=b*(d*=p)-x*(h*=p),o=x*(f*=p)-y*d,s=y*h-b*f,(p=Math.sqrt(a*a+o*o+s*s))?(a*=p=1/p,o*=p,s*=p):(a=0,o=0,s=0);l=h*s-d*o,c=d*a-f*s,u=f*o-h*a,(p=Math.sqrt(l*l+c*c+u*u))?(l*=p=1/p,c*=p,u*=p):(l=0,c=0,u=0);return t[0]=a,t[1]=l,t[2]=f,t[3]=0,t[4]=o,t[5]=c,t[6]=h,t[7]=0,t[8]=s,t[9]=u,t[10]=d,t[11]=0,t[12]=-(a*m+o*v+s*g),t[13]=-(l*m+c*v+u*g),t[14]=-(f*m+h*v+d*g),t[15]=1,t}},{"./identity":185}],188:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],m=e[12],v=e[13],g=e[14],y=e[15],b=r[0],x=r[1],_=r[2],w=r[3];return t[0]=b*n+x*s+_*f+w*m,t[1]=b*i+x*l+_*h+w*v,t[2]=b*a+x*c+_*d+w*g,t[3]=b*o+x*u+_*p+w*y,b=r[4],x=r[5],_=r[6],w=r[7],t[4]=b*n+x*s+_*f+w*m,t[5]=b*i+x*l+_*h+w*v,t[6]=b*a+x*c+_*d+w*g,t[7]=b*o+x*u+_*p+w*y,b=r[8],x=r[9],_=r[10],w=r[11],t[8]=b*n+x*s+_*f+w*m,t[9]=b*i+x*l+_*h+w*v,t[10]=b*a+x*c+_*d+w*g,t[11]=b*o+x*u+_*p+w*y,b=r[12],x=r[13],_=r[14],w=r[15],t[12]=b*n+x*s+_*f+w*m,t[13]=b*i+x*l+_*h+w*v,t[14]=b*a+x*c+_*d+w*g,t[15]=b*o+x*u+_*p+w*y,t}},{}],189:[function(t,e,r){e.exports=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}},{}],190:[function(t,e,r){e.exports=function(t,e,r,n){var i,a,o,s,l,c,u,f,h,d,p,m,v,g,y,b,x,_,w,M,k,A,T,E,S=n[0],L=n[1],C=n[2],P=Math.sqrt(S*S+L*L+C*C);if(Math.abs(P)<1e-6)return null;S*=P=1/P,L*=P,C*=P,i=Math.sin(r),a=Math.cos(r),o=1-a,s=e[0],l=e[1],c=e[2],u=e[3],f=e[4],h=e[5],d=e[6],p=e[7],m=e[8],v=e[9],g=e[10],y=e[11],b=S*S*o+a,x=L*S*o+C*i,_=C*S*o-L*i,w=S*L*o-C*i,M=L*L*o+a,k=C*L*o+S*i,A=S*C*o+L*i,T=L*C*o-S*i,E=C*C*o+a,t[0]=s*b+f*x+m*_,t[1]=l*b+h*x+v*_,t[2]=c*b+d*x+g*_,t[3]=u*b+p*x+y*_,t[4]=s*w+f*M+m*k,t[5]=l*w+h*M+v*k,t[6]=c*w+d*M+g*k,t[7]=u*w+p*M+y*k,t[8]=s*A+f*T+m*E,t[9]=l*A+h*T+v*E,t[10]=c*A+d*T+g*E,t[11]=u*A+p*T+y*E,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t}},{}],191:[function(t,e,r){e.exports=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],c=e[8],u=e[9],f=e[10],h=e[11];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]);return t[4]=a*i+c*n,t[5]=o*i+u*n,t[6]=s*i+f*n,t[7]=l*i+h*n,t[8]=c*i-a*n,t[9]=u*i-o*n,t[10]=f*i-s*n,t[11]=h*i-l*n,t}},{}],192:[function(t,e,r){e.exports=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],c=e[8],u=e[9],f=e[10],h=e[11];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]);return t[0]=a*i-c*n,t[1]=o*i-u*n,t[2]=s*i-f*n,t[3]=l*i-h*n,t[8]=a*n+c*i,t[9]=o*n+u*i,t[10]=s*n+f*i,t[11]=l*n+h*i,t}},{}],193:[function(t,e,r){e.exports=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],c=e[4],u=e[5],f=e[6],h=e[7];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]);return t[0]=a*i+c*n,t[1]=o*i+u*n,t[2]=s*i+f*n,t[3]=l*i+h*n,t[4]=c*i-a*n,t[5]=u*i-o*n,t[6]=f*i-s*n,t[7]=h*i-l*n,t}},{}],194:[function(t,e,r){e.exports=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}},{}],195:[function(t,e,r){e.exports=function(t,e,r){var n,i,a,o,s,l,c,u,f,h,d,p,m=r[0],v=r[1],g=r[2];e===t?(t[12]=e[0]*m+e[4]*v+e[8]*g+e[12],t[13]=e[1]*m+e[5]*v+e[9]*g+e[13],t[14]=e[2]*m+e[6]*v+e[10]*g+e[14],t[15]=e[3]*m+e[7]*v+e[11]*g+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=e[8],h=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]=c,t[7]=u,t[8]=f,t[9]=h,t[10]=d,t[11]=p,t[12]=n*m+s*v+f*g+e[12],t[13]=i*m+l*v+h*g+e[13],t[14]=a*m+c*v+d*g+e[14],t[15]=o*m+u*v+p*g+e[15]);return t}},{}],196:[function(t,e,r){e.exports=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}},{}],197:[function(t,e,r){"use strict";e.exports=function(t,e){switch(e.length){case 0:break;case 1:t[0]=1/e[0];break;case 4:n(t,e);break;case 9:i(t,e);break;case 16:a(t,e);break;default:throw new Error("currently supports matrices up to 4x4")}return t};var n=t("gl-mat2/invert"),i=t("gl-mat3/invert"),a=t("gl-mat4/invert")},{"gl-mat2/invert":178,"gl-mat3/invert":179,"gl-mat4/invert":186}],198:[function(t,e,r){!function(t,n){if("object"==typeof r&&"object"==typeof e)e.exports=n();else{var i=n();for(var a in i)("object"==typeof r?r:t)[a]=i[a]}}(this,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=4)}([function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setMatrixArrayType=function(t){e.ARRAY_TYPE=t},e.toRadian=function(t){return t*i},e.equals=function(t,e){return Math.abs(t-e)<=n*Math.max(1,Math.abs(t),Math.abs(e))};var n=e.EPSILON=1e-6;e.ARRAY_TYPE="undefined"!=typeof Float32Array?Float32Array:Array,e.RANDOM=Math.random;var i=Math.PI/180},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.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},e.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},e.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},e.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},e.fromValues=function(t,e,r,i,a,o,s,l,c){var u=new n.ARRAY_TYPE(9);return u[0]=t,u[1]=e,u[2]=r,u[3]=i,u[4]=a,u[5]=o,u[6]=s,u[7]=l,u[8]=c,u},e.set=function(t,e,r,n,i,a,o,s,l,c){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]=c,t},e.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},e.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},e.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],c=e[7],u=e[8],f=u*o-s*c,h=-u*a+s*l,d=c*a-o*l,p=r*f+n*h+i*d;if(!p)return null;return p=1/p,t[0]=f*p,t[1]=(-u*n+i*c)*p,t[2]=(s*n-i*o)*p,t[3]=h*p,t[4]=(u*r-i*l)*p,t[5]=(-s*r+i*a)*p,t[6]=d*p,t[7]=(-c*r+n*l)*p,t[8]=(o*r-n*a)*p,t},e.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],c=e[7],u=e[8];return t[0]=o*u-s*c,t[1]=i*c-n*u,t[2]=n*s-i*o,t[3]=s*l-a*u,t[4]=r*u-i*l,t[5]=i*a-r*s,t[6]=a*c-o*l,t[7]=n*l-r*c,t[8]=r*o-n*a,t},e.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],c=t[8];return e*(c*a-o*l)+r*(-c*i+o*s)+n*(l*i-a*s)},e.multiply=i,e.translate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=e[8],h=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]=h*n+d*o+c,t[7]=h*i+d*s+u,t[8]=h*a+d*l+f,t},e.rotate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=e[8],h=Math.sin(r),d=Math.cos(r);return t[0]=d*n+h*o,t[1]=d*i+h*s,t[2]=d*a+h*l,t[3]=d*o-h*n,t[4]=d*s-h*i,t[5]=d*l-h*a,t[6]=c,t[7]=u,t[8]=f,t},e.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},e.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},e.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},e.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},e.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},e.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,c=r*o,u=n*o,f=n*s,h=i*o,d=i*s,p=i*l,m=a*o,v=a*s,g=a*l;return t[0]=1-f-p,t[3]=u-g,t[6]=h+v,t[1]=u+g,t[4]=1-c-p,t[7]=d-m,t[2]=h-v,t[5]=d+m,t[8]=1-c-f,t},e.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],c=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],m=e[13],v=e[14],g=e[15],y=r*s-n*o,b=r*l-i*o,x=r*c-a*o,_=n*l-i*s,w=n*c-a*s,M=i*c-a*l,k=u*m-f*p,A=u*v-h*p,T=u*g-d*p,E=f*v-h*m,S=f*g-d*m,L=h*g-d*v,C=y*L-b*S+x*E+_*T-w*A+M*k;if(!C)return null;return C=1/C,t[0]=(s*L-l*S+c*E)*C,t[1]=(l*T-o*L-c*A)*C,t[2]=(o*S-s*T+c*k)*C,t[3]=(i*S-n*L-a*E)*C,t[4]=(r*L-i*T+a*A)*C,t[5]=(n*T-r*S-a*k)*C,t[6]=(m*M-v*w+g*_)*C,t[7]=(v*x-p*M-g*b)*C,t[8]=(p*w-m*x+g*y)*C,t},e.projection=function(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},e.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},e.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))},e.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},e.subtract=a,e.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},e.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},e.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]},e.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],f=t[8],h=e[0],d=e[1],p=e[2],m=e[3],v=e[4],g=e[5],y=e[6],b=e[7],x=e[8];return Math.abs(r-h)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(h))&&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-v)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(l-g)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(c-y)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(y))&&Math.abs(u-b)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(b))&&Math.abs(f-x)<=n.EPSILON*Math.max(1,Math.abs(f),Math.abs(x))};var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(0));function i(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=e[8],h=r[0],d=r[1],p=r[2],m=r[3],v=r[4],g=r[5],y=r[6],b=r[7],x=r[8];return t[0]=h*n+d*o+p*c,t[1]=h*i+d*s+p*u,t[2]=h*a+d*l+p*f,t[3]=m*n+v*o+g*c,t[4]=m*i+v*s+g*u,t[5]=m*a+v*l+g*f,t[6]=y*n+b*o+x*c,t[7]=y*i+b*s+x*u,t[8]=y*a+b*l+x*f,t}function a(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}e.mul=i,e.sub=a},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.len=e.sqrDist=e.dist=e.div=e.mul=e.sub=void 0,e.create=i,e.clone=function(t){var e=new n.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},e.length=a,e.fromValues=o,e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},e.set=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t},e.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},e.subtract=s,e.multiply=l,e.divide=c,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t},e.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},e.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},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t},e.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t},e.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},e.distance=u,e.squaredDistance=f,e.squaredLength=h,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t},e.normalize=d,e.dot=p,e.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},e.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},e.hermite=function(t,e,r,n,i,a){var o=a*a,s=o*(2*a-3)+1,l=o*(a-2)+a,c=o*(a-1),u=o*(3-2*a);return t[0]=e[0]*s+r[0]*l+n[0]*c+i[0]*u,t[1]=e[1]*s+r[1]*l+n[1]*c+i[1]*u,t[2]=e[2]*s+r[2]*l+n[2]*c+i[2]*u,t},e.bezier=function(t,e,r,n,i,a){var o=1-a,s=o*o,l=a*a,c=s*o,u=3*a*s,f=3*l*o,h=l*a;return t[0]=e[0]*c+r[0]*u+n[0]*f+i[0]*h,t[1]=e[1]*c+r[1]*u+n[1]*f+i[1]*h,t[2]=e[2]*c+r[2]*u+n[2]*f+i[2]*h,t},e.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},e.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},e.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},e.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=u*c+d*-o+f*-l-h*-s,t[1]=f*c+d*-s+h*-o-u*-l,t[2]=h*c+d*-l+u*-s-f*-o,t},e.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},e.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},e.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},e.angle=function(t,e){var r=o(t[0],t[1],t[2]),n=o(e[0],e[1],e[2]);d(r,r),d(n,n);var i=p(r,n);return i>1?0:i<-1?Math.PI:Math.acos(i)},e.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},e.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))};var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(0));function i(){var t=new n.ARRAY_TYPE(3);return t[0]=0,t[1]=0,t[2]=0,t}function a(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}function o(t,e,r){var i=new n.ARRAY_TYPE(3);return i[0]=t,i[1]=e,i[2]=r,i}function s(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function l(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function c(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function u(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)}function f(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}function h(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function d(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}function p(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}var m;e.sub=s,e.mul=l,e.div=c,e.dist=u,e.sqrDist=f,e.len=a,e.sqrLen=h,e.forEach=(m=i(),function(t,e,r,n,i,a){var o=void 0,s=void 0;for(e||(e=3),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,o=r;o<s;o+=e)m[0]=t[o],m[1]=t[o+1],m[2]=t[o+2],i(m,m,a),t[o]=m[0],t[o+1]=m[1],t[o+2]=m[2];return t})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.len=e.sqrDist=e.dist=e.div=e.mul=e.sub=void 0,e.create=i,e.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},e.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},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},e.set=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t},e.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},e.subtract=a,e.multiply=o,e.divide=s,e.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},e.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},e.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},e.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},e.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},e.scale=l,e.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},e.distance=c,e.squaredDistance=u,e.length=f,e.squaredLength=h,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},e.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},e.normalize=d,e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},e.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},e.random=function(t,e){return e=e||1,t[0]=n.RANDOM(),t[1]=n.RANDOM(),t[2]=n.RANDOM(),t[3]=n.RANDOM(),d(t,t),l(t,t,e),t},e.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},e.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=u*c+d*-o+f*-l-h*-s,t[1]=f*c+d*-s+h*-o-u*-l,t[2]=h*c+d*-l+u*-s-f*-o,t[3]=e[3],t},e.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=e[0],l=e[1],c=e[2],u=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-c)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(o-u)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))};var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(0));function i(){var t=new n.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function a(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}function o(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}function s(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}function l(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}function c(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)}function u(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}function f(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)}function h(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function d(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}var p;e.sub=a,e.mul=o,e.div=s,e.dist=c,e.sqrDist=u,e.len=f,e.sqrLen=h,e.forEach=(p=i(),function(t,e,r,n,i,a){var o=void 0,s=void 0;for(e||(e=4),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,o=r;o<s;o+=e)p[0]=t[o],p[1]=t[o+1],p[2]=t[o+2],p[3]=t[o+3],i(p,p,a),t[o]=p[0],t[o+1]=p[1],t[o+2]=p[2],t[o+3]=p[3];return t})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.vec4=e.vec3=e.vec2=e.quat=e.mat4=e.mat3=e.mat2d=e.mat2=e.glMatrix=void 0;var n=h(r(0)),i=h(r(5)),a=h(r(6)),o=h(r(1)),s=h(r(7)),l=h(r(8)),c=h(r(9)),u=h(r(2)),f=h(r(3));function h(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}e.glMatrix=n,e.mat2=i,e.mat2d=a,e.mat3=o,e.mat4=s,e.quat=l,e.vec2=c,e.vec3=u,e.vec4=f},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},e.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},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},e.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},e.set=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t},e.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},e.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*a-i*n;if(!o)return null;return o=1/o,t[0]=a*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t},e.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},e.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},e.multiply=i,e.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},e.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},e.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},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t},e.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},e.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))},e.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]},e.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},e.subtract=a,e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=e[0],l=e[1],c=e[2],u=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-c)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(o-u)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))},e.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},e.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};var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(0));function i(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1],c=r[2],u=r[3];return t[0]=n*s+a*l,t[1]=i*s+o*l,t[2]=n*c+a*u,t[3]=i*c+o*u,t}function a(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}e.mul=i,e.sub=a},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.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},e.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},e.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},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},e.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},e.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},e.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;if(!l)return null;return 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},e.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},e.multiply=i,e.rotate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=Math.sin(r),u=Math.cos(r);return t[0]=n*u+a*c,t[1]=i*u+o*c,t[2]=n*-c+a*u,t[3]=i*-c+o*u,t[4]=s,t[5]=l,t},e.scale=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=r[0],u=r[1];return t[0]=n*c,t[1]=i*c,t[2]=a*u,t[3]=o*u,t[4]=s,t[5]=l,t},e.translate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=r[0],u=r[1];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=n*c+a*u+s,t[5]=i*c+o*u+l,t},e.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},e.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},e.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},e.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},e.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)},e.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},e.subtract=a,e.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},e.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},e.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]},e.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=e[0],u=e[1],f=e[2],h=e[3],d=e[4],p=e[5];return Math.abs(r-c)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(i-u)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-f)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(f))&&Math.abs(o-h)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(h))&&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))};var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(0));function i(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=r[0],u=r[1],f=r[2],h=r[3],d=r[4],p=r[5];return t[0]=n*c+a*u,t[1]=i*c+o*u,t[2]=n*f+a*h,t[3]=i*f+o*h,t[4]=n*d+a*p+s,t[5]=i*d+o*p+l,t}function a(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}e.mul=i,e.sub=a},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.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},e.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},e.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},e.fromValues=function(t,e,r,i,a,o,s,l,c,u,f,h,d,p,m,v){var g=new n.ARRAY_TYPE(16);return g[0]=t,g[1]=e,g[2]=r,g[3]=i,g[4]=a,g[5]=o,g[6]=s,g[7]=l,g[8]=c,g[9]=u,g[10]=f,g[11]=h,g[12]=d,g[13]=p,g[14]=m,g[15]=v,g},e.set=function(t,e,r,n,i,a,o,s,l,c,u,f,h,d,p,m,v){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]=c,t[9]=u,t[10]=f,t[11]=h,t[12]=d,t[13]=p,t[14]=m,t[15]=v,t},e.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},e.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},e.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],c=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],m=e[13],v=e[14],g=e[15],y=r*s-n*o,b=r*l-i*o,x=r*c-a*o,_=n*l-i*s,w=n*c-a*s,M=i*c-a*l,k=u*m-f*p,A=u*v-h*p,T=u*g-d*p,E=f*v-h*m,S=f*g-d*m,L=h*g-d*v,C=y*L-b*S+x*E+_*T-w*A+M*k;if(!C)return null;return C=1/C,t[0]=(s*L-l*S+c*E)*C,t[1]=(i*S-n*L-a*E)*C,t[2]=(m*M-v*w+g*_)*C,t[3]=(h*w-f*M-d*_)*C,t[4]=(l*T-o*L-c*A)*C,t[5]=(r*L-i*T+a*A)*C,t[6]=(v*x-p*M-g*b)*C,t[7]=(u*M-h*x+d*b)*C,t[8]=(o*S-s*T+c*k)*C,t[9]=(n*T-r*S-a*k)*C,t[10]=(p*w-m*x+g*y)*C,t[11]=(f*x-u*w-d*y)*C,t[12]=(s*A-o*E-l*k)*C,t[13]=(r*E-n*A+i*k)*C,t[14]=(m*b-p*_-v*y)*C,t[15]=(u*_-f*b+h*y)*C,t},e.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],c=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],m=e[13],v=e[14],g=e[15];return t[0]=s*(h*g-d*v)-f*(l*g-c*v)+m*(l*d-c*h),t[1]=-(n*(h*g-d*v)-f*(i*g-a*v)+m*(i*d-a*h)),t[2]=n*(l*g-c*v)-s*(i*g-a*v)+m*(i*c-a*l),t[3]=-(n*(l*d-c*h)-s*(i*d-a*h)+f*(i*c-a*l)),t[4]=-(o*(h*g-d*v)-u*(l*g-c*v)+p*(l*d-c*h)),t[5]=r*(h*g-d*v)-u*(i*g-a*v)+p*(i*d-a*h),t[6]=-(r*(l*g-c*v)-o*(i*g-a*v)+p*(i*c-a*l)),t[7]=r*(l*d-c*h)-o*(i*d-a*h)+u*(i*c-a*l),t[8]=o*(f*g-d*m)-u*(s*g-c*m)+p*(s*d-c*f),t[9]=-(r*(f*g-d*m)-u*(n*g-a*m)+p*(n*d-a*f)),t[10]=r*(s*g-c*m)-o*(n*g-a*m)+p*(n*c-a*s),t[11]=-(r*(s*d-c*f)-o*(n*d-a*f)+u*(n*c-a*s)),t[12]=-(o*(f*v-h*m)-u*(s*v-l*m)+p*(s*h-l*f)),t[13]=r*(f*v-h*m)-u*(n*v-i*m)+p*(n*h-i*f),t[14]=-(r*(s*v-l*m)-o*(n*v-i*m)+p*(n*l-i*s)),t[15]=r*(s*h-l*f)-o*(n*h-i*f)+u*(n*l-i*s),t},e.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],c=t[8],u=t[9],f=t[10],h=t[11],d=t[12],p=t[13],m=t[14],v=t[15];return(e*o-r*a)*(f*v-h*m)-(e*s-n*a)*(u*v-h*p)+(e*l-i*a)*(u*m-f*p)+(r*s-n*o)*(c*v-h*d)-(r*l-i*o)*(c*m-f*d)+(n*l-i*s)*(c*p-u*d)},e.multiply=i,e.translate=function(t,e,r){var n=r[0],i=r[1],a=r[2],o=void 0,s=void 0,l=void 0,c=void 0,u=void 0,f=void 0,h=void 0,d=void 0,p=void 0,m=void 0,v=void 0,g=void 0;e===t?(t[12]=e[0]*n+e[4]*i+e[8]*a+e[12],t[13]=e[1]*n+e[5]*i+e[9]*a+e[13],t[14]=e[2]*n+e[6]*i+e[10]*a+e[14],t[15]=e[3]*n+e[7]*i+e[11]*a+e[15]):(o=e[0],s=e[1],l=e[2],c=e[3],u=e[4],f=e[5],h=e[6],d=e[7],p=e[8],m=e[9],v=e[10],g=e[11],t[0]=o,t[1]=s,t[2]=l,t[3]=c,t[4]=u,t[5]=f,t[6]=h,t[7]=d,t[8]=p,t[9]=m,t[10]=v,t[11]=g,t[12]=o*n+u*i+p*a+e[12],t[13]=s*n+f*i+m*a+e[13],t[14]=l*n+h*i+v*a+e[14],t[15]=c*n+d*i+g*a+e[15]);return t},e.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},e.rotate=function(t,e,r,i){var a=i[0],o=i[1],s=i[2],l=Math.sqrt(a*a+o*o+s*s),c=void 0,u=void 0,f=void 0,h=void 0,d=void 0,p=void 0,m=void 0,v=void 0,g=void 0,y=void 0,b=void 0,x=void 0,_=void 0,w=void 0,M=void 0,k=void 0,A=void 0,T=void 0,E=void 0,S=void 0,L=void 0,C=void 0,P=void 0,z=void 0;if(Math.abs(l)<n.EPSILON)return null;a*=l=1/l,o*=l,s*=l,c=Math.sin(r),u=Math.cos(r),f=1-u,h=e[0],d=e[1],p=e[2],m=e[3],v=e[4],g=e[5],y=e[6],b=e[7],x=e[8],_=e[9],w=e[10],M=e[11],k=a*a*f+u,A=o*a*f+s*c,T=s*a*f-o*c,E=a*o*f-s*c,S=o*o*f+u,L=s*o*f+a*c,C=a*s*f+o*c,P=o*s*f-a*c,z=s*s*f+u,t[0]=h*k+v*A+x*T,t[1]=d*k+g*A+_*T,t[2]=p*k+y*A+w*T,t[3]=m*k+b*A+M*T,t[4]=h*E+v*S+x*L,t[5]=d*E+g*S+_*L,t[6]=p*E+y*S+w*L,t[7]=m*E+b*S+M*L,t[8]=h*C+v*P+x*z,t[9]=d*C+g*P+_*z,t[10]=p*C+y*P+w*z,t[11]=m*C+b*P+M*z,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t},e.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],c=e[8],u=e[9],f=e[10],h=e[11];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]);return t[4]=a*i+c*n,t[5]=o*i+u*n,t[6]=s*i+f*n,t[7]=l*i+h*n,t[8]=c*i-a*n,t[9]=u*i-o*n,t[10]=f*i-s*n,t[11]=h*i-l*n,t},e.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],c=e[8],u=e[9],f=e[10],h=e[11];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]);return t[0]=a*i-c*n,t[1]=o*i-u*n,t[2]=s*i-f*n,t[3]=l*i-h*n,t[8]=a*n+c*i,t[9]=o*n+u*i,t[10]=s*n+f*i,t[11]=l*n+h*i,t},e.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],c=e[4],u=e[5],f=e[6],h=e[7];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]);return t[0]=a*i+c*n,t[1]=o*i+u*n,t[2]=s*i+f*n,t[3]=l*i+h*n,t[4]=c*i-a*n,t[5]=u*i-o*n,t[6]=f*i-s*n,t[7]=h*i-l*n,t},e.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},e.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},e.fromRotation=function(t,e,r){var i=r[0],a=r[1],o=r[2],s=Math.sqrt(i*i+a*a+o*o),l=void 0,c=void 0,u=void 0;if(Math.abs(s)<n.EPSILON)return null;return i*=s=1/s,a*=s,o*=s,l=Math.sin(e),c=Math.cos(e),u=1-c,t[0]=i*i*u+c,t[1]=a*i*u+o*l,t[2]=o*i*u-a*l,t[3]=0,t[4]=i*a*u-o*l,t[5]=a*a*u+c,t[6]=o*a*u+i*l,t[7]=0,t[8]=i*o*u+a*l,t[9]=a*o*u-i*l,t[10]=o*o*u+c,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.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},e.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},e.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},e.fromRotationTranslation=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=n+n,l=i+i,c=a+a,u=n*s,f=n*l,h=n*c,d=i*l,p=i*c,m=a*c,v=o*s,g=o*l,y=o*c;return t[0]=1-(d+m),t[1]=f+y,t[2]=h-g,t[3]=0,t[4]=f-y,t[5]=1-(u+m),t[6]=p+v,t[7]=0,t[8]=h+g,t[9]=p-v,t[10]=1-(u+d),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},e.getTranslation=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},e.getScaling=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[4],o=e[5],s=e[6],l=e[8],c=e[9],u=e[10];return t[0]=Math.sqrt(r*r+n*n+i*i),t[1]=Math.sqrt(a*a+o*o+s*s),t[2]=Math.sqrt(l*l+c*c+u*u),t},e.getRotation=function(t,e){var r=e[0]+e[5]+e[10],n=0;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);return t},e.fromRotationTranslationScale=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3],l=i+i,c=a+a,u=o+o,f=i*l,h=i*c,d=i*u,p=a*c,m=a*u,v=o*u,g=s*l,y=s*c,b=s*u,x=n[0],_=n[1],w=n[2];return t[0]=(1-(p+v))*x,t[1]=(h+b)*x,t[2]=(d-y)*x,t[3]=0,t[4]=(h-b)*_,t[5]=(1-(f+v))*_,t[6]=(m+g)*_,t[7]=0,t[8]=(d+y)*w,t[9]=(m-g)*w,t[10]=(1-(f+p))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},e.fromRotationTranslationScaleOrigin=function(t,e,r,n,i){var a=e[0],o=e[1],s=e[2],l=e[3],c=a+a,u=o+o,f=s+s,h=a*c,d=a*u,p=a*f,m=o*u,v=o*f,g=s*f,y=l*c,b=l*u,x=l*f,_=n[0],w=n[1],M=n[2],k=i[0],A=i[1],T=i[2];return t[0]=(1-(m+g))*_,t[1]=(d+x)*_,t[2]=(p-b)*_,t[3]=0,t[4]=(d-x)*w,t[5]=(1-(h+g))*w,t[6]=(v+y)*w,t[7]=0,t[8]=(p+b)*M,t[9]=(v-y)*M,t[10]=(1-(h+m))*M,t[11]=0,t[12]=r[0]+k-(t[0]*k+t[4]*A+t[8]*T),t[13]=r[1]+A-(t[1]*k+t[5]*A+t[9]*T),t[14]=r[2]+T-(t[2]*k+t[6]*A+t[10]*T),t[15]=1,t},e.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,c=r*o,u=n*o,f=n*s,h=i*o,d=i*s,p=i*l,m=a*o,v=a*s,g=a*l;return t[0]=1-f-p,t[1]=u+g,t[2]=h-v,t[3]=0,t[4]=u-g,t[5]=1-c-p,t[6]=d+m,t[7]=0,t[8]=h+v,t[9]=d-m,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.frustum=function(t,e,r,n,i,a,o){var s=1/(r-e),l=1/(i-n),c=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)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*c,t[15]=0,t},e.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},e.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),c=2/(i+a);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(o-s)*l*.5,t[9]=(i-a)*c*.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},e.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),c=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*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,t[15]=1,t},e.lookAt=function(t,e,r,i){var a=void 0,o=void 0,s=void 0,l=void 0,c=void 0,u=void 0,f=void 0,h=void 0,d=void 0,p=void 0,m=e[0],v=e[1],g=e[2],y=i[0],b=i[1],x=i[2],_=r[0],w=r[1],M=r[2];if(Math.abs(m-_)<n.EPSILON&&Math.abs(v-w)<n.EPSILON&&Math.abs(g-M)<n.EPSILON)return mat4.identity(t);f=m-_,h=v-w,d=g-M,p=1/Math.sqrt(f*f+h*h+d*d),a=b*(d*=p)-x*(h*=p),o=x*(f*=p)-y*d,s=y*h-b*f,(p=Math.sqrt(a*a+o*o+s*s))?(a*=p=1/p,o*=p,s*=p):(a=0,o=0,s=0);l=h*s-d*o,c=d*a-f*s,u=f*o-h*a,(p=Math.sqrt(l*l+c*c+u*u))?(l*=p=1/p,c*=p,u*=p):(l=0,c=0,u=0);return t[0]=a,t[1]=l,t[2]=f,t[3]=0,t[4]=o,t[5]=c,t[6]=h,t[7]=0,t[8]=s,t[9]=u,t[10]=d,t[11]=0,t[12]=-(a*m+o*v+s*g),t[13]=-(l*m+c*v+u*g),t[14]=-(f*m+h*v+d*g),t[15]=1,t},e.targetTo=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=n[0],l=n[1],c=n[2],u=i-r[0],f=a-r[1],h=o-r[2],d=u*u+f*f+h*h;d>0&&(d=1/Math.sqrt(d),u*=d,f*=d,h*=d);var p=l*h-c*f,m=c*u-s*h,v=s*f-l*u;return t[0]=p,t[1]=m,t[2]=v,t[3]=0,t[4]=f*v-h*m,t[5]=h*p-u*v,t[6]=u*m-f*p,t[7]=0,t[8]=u,t[9]=f,t[10]=h,t[11]=0,t[12]=i,t[13]=a,t[14]=o,t[15]=1,t},e.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]+")"},e.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))},e.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},e.subtract=a,e.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},e.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},e.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]},e.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],f=t[8],h=t[9],d=t[10],p=t[11],m=t[12],v=t[13],g=t[14],y=t[15],b=e[0],x=e[1],_=e[2],w=e[3],M=e[4],k=e[5],A=e[6],T=e[7],E=e[8],S=e[9],L=e[10],C=e[11],P=e[12],z=e[13],O=e[14],D=e[15];return Math.abs(r-b)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(x))&&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-k)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(k))&&Math.abs(c-A)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(u-T)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(f-E)<=n.EPSILON*Math.max(1,Math.abs(f),Math.abs(E))&&Math.abs(h-S)<=n.EPSILON*Math.max(1,Math.abs(h),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-P)<=n.EPSILON*Math.max(1,Math.abs(m),Math.abs(P))&&Math.abs(v-z)<=n.EPSILON*Math.max(1,Math.abs(v),Math.abs(z))&&Math.abs(g-O)<=n.EPSILON*Math.max(1,Math.abs(g),Math.abs(O))&&Math.abs(y-D)<=n.EPSILON*Math.max(1,Math.abs(y),Math.abs(D))};var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(0));function i(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],m=e[12],v=e[13],g=e[14],y=e[15],b=r[0],x=r[1],_=r[2],w=r[3];return t[0]=b*n+x*s+_*f+w*m,t[1]=b*i+x*l+_*h+w*v,t[2]=b*a+x*c+_*d+w*g,t[3]=b*o+x*u+_*p+w*y,b=r[4],x=r[5],_=r[6],w=r[7],t[4]=b*n+x*s+_*f+w*m,t[5]=b*i+x*l+_*h+w*v,t[6]=b*a+x*c+_*d+w*g,t[7]=b*o+x*u+_*p+w*y,b=r[8],x=r[9],_=r[10],w=r[11],t[8]=b*n+x*s+_*f+w*m,t[9]=b*i+x*l+_*h+w*v,t[10]=b*a+x*c+_*d+w*g,t[11]=b*o+x*u+_*p+w*y,b=r[12],x=r[13],_=r[14],w=r[15],t[12]=b*n+x*s+_*f+w*m,t[13]=b*i+x*l+_*h+w*v,t[14]=b*a+x*c+_*d+w*g,t[15]=b*o+x*u+_*p+w*y,t}function a(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}e.mul=i,e.sub=a},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setAxes=e.sqlerp=e.rotationTo=e.equals=e.exactEquals=e.normalize=e.sqrLen=e.squaredLength=e.len=e.length=e.lerp=e.dot=e.scale=e.mul=e.add=e.set=e.copy=e.fromValues=e.clone=void 0,e.create=l,e.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},e.setAxisAngle=c,e.getAxisAngle=function(t,e){var r=2*Math.acos(e[3]),n=Math.sin(r/2);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);return r},e.multiply=u,e.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},e.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},e.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},e.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},e.slerp=f,e.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},e.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},e.fromMat3=h,e.fromEuler=function(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var a=Math.sin(e),o=Math.cos(e),s=Math.sin(r),l=Math.cos(r),c=Math.sin(n),u=Math.cos(n);return t[0]=a*l*u-o*s*c,t[1]=o*s*u+a*l*c,t[2]=o*l*c-a*s*u,t[3]=o*l*u+a*s*c,t},e.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"};var n=s(r(0)),i=s(r(1)),a=s(r(2)),o=s(r(3));function s(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function l(){var t=new n.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function c(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}function u(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1],c=r[2],u=r[3];return t[0]=n*u+o*s+i*c-a*l,t[1]=i*u+o*l+a*s-n*c,t[2]=a*u+o*c+n*l-i*s,t[3]=o*u-n*s-i*l-a*c,t}function f(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3],l=r[0],c=r[1],u=r[2],f=r[3],h=void 0,d=void 0,p=void 0,m=void 0,v=void 0;return(d=i*l+a*c+o*u+s*f)<0&&(d=-d,l=-l,c=-c,u=-u,f=-f),1-d>1e-6?(h=Math.acos(d),p=Math.sin(h),m=Math.sin((1-n)*h)/p,v=Math.sin(n*h)/p):(m=1-n,v=n),t[0]=m*i+v*l,t[1]=m*a+v*c,t[2]=m*o+v*u,t[3]=m*s+v*f,t}function h(t,e){var r=e[0]+e[4]+e[8],n=void 0;if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;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;n=Math.sqrt(e[3*i+i]-e[3*a+a]-e[3*o+o]+1),t[i]=.5*n,n=.5/n,t[3]=(e[3*a+o]-e[3*o+a])*n,t[a]=(e[3*a+i]+e[3*i+a])*n,t[o]=(e[3*o+i]+e[3*i+o])*n}return t}e.clone=o.clone,e.fromValues=o.fromValues,e.copy=o.copy,e.set=o.set,e.add=o.add,e.mul=u,e.scale=o.scale,e.dot=o.dot,e.lerp=o.lerp;var d,p,m,v,g,y,b=e.length=o.length,x=(e.len=b,e.squaredLength=o.squaredLength),_=(e.sqrLen=x,e.normalize=o.normalize);e.exactEquals=o.exactEquals,e.equals=o.equals,e.rotationTo=(d=a.create(),p=a.fromValues(1,0,0),m=a.fromValues(0,1,0),function(t,e,r){var n=a.dot(e,r);return n<-.999999?(a.cross(d,p,e),a.len(d)<1e-6&&a.cross(d,m,e),a.normalize(d,d),c(t,d,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(a.cross(d,e,r),t[0]=d[0],t[1]=d[1],t[2]=d[2],t[3]=1+n,_(t,t))}),e.sqlerp=(v=l(),g=l(),function(t,e,r,n,i,a){return f(v,e,i,a),f(g,r,n,a),f(t,v,g,2*a*(1-a)),t}),e.setAxes=(y=i.create(),function(t,e,r,n){return y[0]=r[0],y[3]=r[1],y[6]=r[2],y[1]=n[0],y[4]=n[1],y[7]=n[2],y[2]=-e[0],y[5]=-e[1],y[8]=-e[2],_(t,h(t,y))})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.sqrDist=e.dist=e.div=e.mul=e.sub=e.len=void 0,e.create=i,e.clone=function(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},e.fromValues=function(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},e.set=function(t,e,r){return t[0]=e,t[1]=r,t},e.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t},e.subtract=a,e.multiply=o,e.divide=s,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},e.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t},e.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},e.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t},e.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t},e.distance=l,e.squaredDistance=c,e.length=u,e.squaredLength=f,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},e.normalize=function(t,e){var r=e[0],n=e[1],i=r*r+n*n;i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i);return t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},e.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},e.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},e.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},e.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},e.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},e.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},e.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},e.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},e.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))};var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(0));function i(){var t=new n.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t}function a(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function o(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function s(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function l(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(r*r+n*n)}function c(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function u(t){var e=t[0],r=t[1];return Math.sqrt(e*e+r*r)}function f(t){var e=t[0],r=t[1];return e*e+r*r}var h;e.len=u,e.sub=a,e.mul=o,e.div=s,e.dist=l,e.sqrDist=c,e.sqrLen=f,e.forEach=(h=i(),function(t,e,r,n,i,a){var o=void 0,s=void 0;for(e||(e=2),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,o=r;o<s;o+=e)h[0]=t[o],h[1]=t[o+1],i(h,h,a),t[o]=h[0],t[o+1]=h[1];return t})}])})},{}],199:[function(t,e,r){"use strict";var n=t("barycentric"),i=t("polytope-closest-point/lib/closest_point_2d.js");function a(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 o(t,e,r,n,i){for(var o=a(n,a(r,a(e,[t[0],t[1],t[2],1]))),s=0;s<3;++s)o[s]/=o[3];return[.5*i[0]*(1+o[0]),.5*i[1]*(1-o[1])]}e.exports=function(t,e,r,a,s,l){if(1===t.length)return[0,t[0].slice()];for(var c=new Array(t.length),u=0;u<t.length;++u)c[u]=o(t[u],r,a,s,l);for(var f=0,h=1/0,u=0;u<c.length;++u){for(var d=0,p=0;p<2;++p)d+=Math.pow(c[u][p]-e[p],2);d<h&&(h=d,f=u)}for(var m=function(t,e){if(2===t.length){for(var r=0,a=0,o=0;o<2;++o)r+=Math.pow(e[o]-t[0][o],2),a+=Math.pow(e[o]-t[1][o],2);return r=Math.sqrt(r),a=Math.sqrt(a),r+a<1e-6?[1,0]:[a/(r+a),r/(a+r)]}if(3===t.length){var s=[0,0];return i(t[0],t[1],t[2],e,s),n(t,s)}return[]}(c,e),v=0,u=0;u<3;++u){if(m[u]<-.001||m[u]>1.0001)return null;v+=m[u]}if(Math.abs(v-1)>.001)return null;return[f,function(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}(t,m),m]}},{barycentric:53,"polytope-closest-point/lib/closest_point_2d.js":468}],200:[function(t,e,r){var n=t("glslify"),i=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}"]),a=n(["precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\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(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}"]),o=n(["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}"]),s=n(["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}"]),l=n(["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}"]),c=n(["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=n(["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}"]),f=n(["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=n(["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}"]),d=n(["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}"]),p=n(["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:i,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:l,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:u,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:h,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:d,fragment:p,attributes:[{name:"position",type:"vec3"}]}},{glslify:253}],201:[function(t,e,r){"use strict";var n=t("gl-shader"),i=t("gl-buffer"),a=t("gl-vao"),o=t("gl-texture2d"),s=t("normals"),l=t("gl-mat4/multiply"),c=t("gl-mat4/invert"),u=t("ndarray"),f=t("colormap"),h=t("simplicial-complex-contour"),d=t("typedarray-pool"),p=t("./lib/shaders"),m=t("./lib/closest-point"),v=p.meshShader,g=p.wireShader,y=p.pointShader,b=p.pickShader,x=p.pointPickShader,_=p.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function M(t,e,r,n,i,a,o,s,l,c,u,f,h,d,p,m,v,g,y,b,x,_,M,k,A,T,E){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=u,this.triangleNormals=h,this.triangleUVs=f,this.triangleIds=c,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=v,this.edgeUVs=g,this.edgeIds=m,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=b,this.pointColors=_,this.pointUVs=M,this.pointSizes=k,this.pointIds=x,this.pointVAO=A,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=T,this.contourVAO=E,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var k=M.prototype;function A(t){var e=n(t,y.vertex,y.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}function T(t){var e=n(t,b.vertex,b.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e}function E(t){var e=n(t,x.vertex,x.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function S(t){var e=n(t,_.vertex,_.fragment);return e.attributes.position.location=0,e}k.isOpaque=function(){return this.opacity>=1},k.isTransparent=function(){return this.opacity<1},k.pickSlots=1,k.setPickBase=function(t){this.pickId=t},k.highlight=function(t){if(t&&this.contourEnable){for(var e=h(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=d.mallocFloat32(6*a),s=0,l=0;l<a;++l)for(var c=r[l],u=0;u<2;++u){var f=c[0];2===c.length&&(f=c[u]);for(var p=n[f][0],m=n[f][1],v=i[f],g=1-v,y=this.positions[p],b=this.positions[m],x=0;x<3;++x)o[s++]=v*y[x]+g*b[x]}this.contourCount=s/3|0,this.contourPositions.update(o.subarray(0,s)),d.free(o)}else this.contourCount=0},k.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=o(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(function(t){for(var e=f({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 u(r,[256,256,4],[4,0,1])}(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions;if(n&&r){var i=[],a=[],l=[],c=[],h=[],d=[],p=[],m=[],v=[],g=[],y=[],b=[],x=[],_=[];this.cells=r,this.positions=n;var w=t.vertexNormals,M=t.cellNormals,k=void 0===t.vertexNormalsEpsilon?1e-6:t.vertexNormalsEpsilon,A=void 0===t.faceNormalsEpsilon?1e-6:t.faceNormalsEpsilon;t.useFacetNormals&&!M&&(M=s.faceNormals(r,n,A)),M||w||(w=s.vertexNormals(r,n,k));var T=t.vertexColors,E=t.cellColors,S=t.meshColor||[1,1,1,1],L=t.vertexUVs,C=t.vertexIntensity,P=t.cellUVs,z=t.cellIntensity,O=1/0,D=-1/0;if(!L&&!P)if(C)if(t.vertexIntensityBounds)O=+t.vertexIntensityBounds[0],D=+t.vertexIntensityBounds[1];else for(var I=0;I<C.length;++I){var R=C[I];O=Math.min(O,R),D=Math.max(D,R)}else if(z)for(I=0;I<z.length;++I){R=z[I];O=Math.min(O,R),D=Math.max(D,R)}else for(I=0;I<n.length;++I){R=n[I][2];O=Math.min(O,R),D=Math.max(D,R)}this.intensity=C||(z?function(t,e,r){for(var n=new Array(e),i=0;i<e;++i)n[i]=0;var a=t.length;for(i=0;i<a;++i)for(var o=t[i],s=0;s<o.length;++s)n[o[s]]=r[i];return n}(r,n.length,z):function(t){for(var e=t.length,r=new Array(e),n=0;n<e;++n)r[n]=t[n][2];return r}(n));var N=t.pointSizes,F=t.pointSize||1;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(I=0;I<n.length;++I)for(var j=n[I],B=0;B<3;++B)!isNaN(j[B])&&isFinite(j[B])&&(this.bounds[0][B]=Math.min(this.bounds[0][B],j[B]),this.bounds[1][B]=Math.max(this.bounds[1][B],j[B]));var U=0,V=0,q=0;t:for(I=0;I<r.length;++I){var H=r[I];switch(H.length){case 1:for(j=n[Y=H[0]],B=0;B<3;++B)if(isNaN(j[B])||!isFinite(j[B]))continue t;g.push(j[0],j[1],j[2]),3===(W=T?T[Y]:E?E[I]:S).length?y.push(W[0],W[1],W[2],1):y.push(W[0],W[1],W[2],W[3]),X=L?L[Y]:C?[(C[Y]-O)/(D-O),0]:P?P[I]:z?[(z[I]-O)/(D-O),0]:[(j[2]-O)/(D-O),0],b.push(X[0],X[1]),N?x.push(N[Y]):x.push(F),_.push(I),q+=1;break;case 2:for(B=0;B<2;++B){j=n[Y=H[B]];for(var G=0;G<3;++G)if(isNaN(j[G])||!isFinite(j[G]))continue t}for(B=0;B<2;++B){j=n[Y=H[B]];d.push(j[0],j[1],j[2]),3===(W=T?T[Y]:E?E[I]:S).length?p.push(W[0],W[1],W[2],1):p.push(W[0],W[1],W[2],W[3]),X=L?L[Y]:C?[(C[Y]-O)/(D-O),0]:P?P[I]:z?[(z[I]-O)/(D-O),0]:[(j[2]-O)/(D-O),0],m.push(X[0],X[1]),v.push(I)}V+=1;break;case 3:for(B=0;B<3;++B)for(j=n[Y=H[B]],G=0;G<3;++G)if(isNaN(j[G])||!isFinite(j[G]))continue t;for(B=0;B<3;++B){var Y,W,X,Z;j=n[Y=H[B]];i.push(j[0],j[1],j[2]),3===(W=T?T[Y]:E?E[I]:S).length?a.push(W[0],W[1],W[2],1):a.push(W[0],W[1],W[2],W[3]),X=L?L[Y]:C?[(C[Y]-O)/(D-O),0]:P?P[I]:z?[(z[I]-O)/(D-O),0]:[(j[2]-O)/(D-O),0],c.push(X[0],X[1]),Z=w?w[Y]:M[I],l.push(Z[0],Z[1],Z[2]),h.push(I)}U+=1}}this.pointCount=q,this.edgeCount=V,this.triangleCount=U,this.pointPositions.update(g),this.pointColors.update(y),this.pointUVs.update(b),this.pointSizes.update(x),this.pointIds.update(new Uint32Array(_)),this.edgePositions.update(d),this.edgeColors.update(p),this.edgeUVs.update(m),this.edgeIds.update(new Uint32Array(v)),this.trianglePositions.update(i),this.triangleColors.update(a),this.triangleUVs.update(c),this.triangleNormals.update(l),this.triangleIds.update(new Uint32Array(h))}},k.drawTransparent=k.draw=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,i=t.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);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 u=new Array(16);l(u,s.view,s.model),l(u,s.projection,u),c(u,u);for(o=0;o<3;++o)s.eyePosition[o]=u[12+o]/u[15];var f,h=u[15];for(o=0;o<3;++o)h+=this.lightPosition[o]*u[4*o+3];for(o=0;o<3;++o){for(var d=u[12+o],p=0;p<3;++p)d+=u[4*p+o]*this.lightPosition[p];s.lightPosition[o]=d/h}this.triangleCount>0&&((f=this.triShader).bind(),f.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind());this.edgeCount>0&&this.lineWidth>0&&((f=this.lineShader).bind(),f.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind());this.pointCount>0&&((f=this.pointShader).bind(),f.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind());this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((f=this.contourShader).bind(),f.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},k.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,i=t.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};((s=this.pickShader).bind(),s.uniforms=l,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)&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},k.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=m(i,[t.coord[0],this._resolution[1]-t.coord[1]],this._model,this._view,this._projection,this._resolution);if(!o)return null;var s=o[2],l=0;for(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]]]}},k.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=function(t,e){1===arguments.length&&(t=(e=t).gl);var r=function(t){var e=n(t,v.vertex,v.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.normal.location=4,e}(t),s=function(t){var e=n(t,g.vertex,g.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e}(t),l=A(t),c=T(t),f=E(t),h=S(t),d=o(t,u(new Uint8Array([255,255,255,255]),[1,1,4]));d.generateMipmap(),d.minFilter=t.LINEAR_MIPMAP_LINEAR,d.magFilter=t.LINEAR;var p=i(t),m=i(t),y=i(t),b=i(t),x=i(t),_=a(t,[{buffer:p,type:t.FLOAT,size:3},{buffer:x,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:m,type:t.FLOAT,size:4},{buffer:y,type:t.FLOAT,size:2},{buffer:b,type:t.FLOAT,size:3}]),w=i(t),k=i(t),L=i(t),C=i(t),P=a(t,[{buffer:w,type:t.FLOAT,size:3},{buffer:C,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:k,type:t.FLOAT,size:4},{buffer:L,type:t.FLOAT,size:2}]),z=i(t),O=i(t),D=i(t),I=i(t),R=i(t),N=a(t,[{buffer:z,type:t.FLOAT,size:3},{buffer:R,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:O,type:t.FLOAT,size:4},{buffer:D,type:t.FLOAT,size:2},{buffer:I,type:t.FLOAT,size:1}]),F=i(t),j=new M(t,d,r,s,l,c,f,h,p,x,m,y,b,_,w,C,k,L,P,z,R,O,D,I,N,F,a(t,[{buffer:F,type:t.FLOAT,size:3}]));return j.update(e),j}},{"./lib/closest-point":199,"./lib/shaders":200,colormap:105,"gl-buffer":165,"gl-mat4/invert":186,"gl-mat4/multiply":188,"gl-shader":220,"gl-texture2d":233,"gl-vao":237,ndarray:439,normals:442,"simplicial-complex-contour":504,"typedarray-pool":534}],202:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e,[0,0,0,1,1,0,1,1]),s=i(e,a.boxVert,a.lineFrag);return new o(t,r,s)};var n=t("gl-buffer"),i=t("gl-shader"),a=t("./shaders");function o(t,e,r){this.plot=t,this.vbo=e,this.shader=r}var s,l,c=o.prototype;c.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},c.drawBox=(s=[0,0],l=[0,0],function(t,e,r,n,i){var a=this.plot,o=this.shader,c=a.gl;s[0]=t,s[1]=e,l[0]=r,l[1]=n,o.uniforms.lo=s,o.uniforms.hi=l,o.uniforms.color=i,c.drawArrays(c.TRIANGLE_STRIP,0,4)}),c.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":205,"gl-buffer":165,"gl-shader":220}],203:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e),a=i(e,o.gridVert,o.gridFrag),l=i(e,o.tickVert,o.gridFrag);return new s(t,r,a,l)};var n=t("gl-buffer"),i=t("gl-shader"),a=t("binary-search-bounds"),o=t("./shaders");function s(t,e,r,n){this.plot=t,this.vbo=e,this.shader=r,this.tickShader=n,this.ticks=[[],[]]}function l(t,e){return t-e}var c,u,f,h,d,p=s.prototype;p.draw=(c=[0,0],u=[0,0],f=[0,0],function(){for(var t=this.plot,e=this.vbo,r=this.shader,n=this.ticks,i=t.gl,a=t._tickBounds,o=t.dataBox,s=t.viewBox,l=t.gridLineWidth,h=t.gridLineColor,d=t.gridLineEnable,p=t.pixelRatio,m=0;m<2;++m){var v=a[m],g=a[m+2]-v,y=.5*(o[m+2]+o[m]),b=o[m+2]-o[m];u[m]=2*g/b,c[m]=2*(v-y)/b}r.bind(),e.bind(),r.attributes.dataCoord.pointer(),r.uniforms.dataShift=c,r.uniforms.dataScale=u;var x=0;for(m=0;m<2;++m){f[0]=f[1]=0,f[m]=1,r.uniforms.dataAxis=f,r.uniforms.lineWidth=l[m]/(s[m+2]-s[m])*p,r.uniforms.color=h[m];var _=6*n[m].length;d[m]&&_&&i.drawArrays(i.TRIANGLES,x,_),x+=_}}),p.drawTickMarks=function(){var t=[0,0],e=[0,0],r=[1,0],n=[0,1],i=[0,0],o=[0,0];return function(){for(var s=this.plot,c=this.vbo,u=this.tickShader,f=this.ticks,h=s.gl,d=s._tickBounds,p=s.dataBox,m=s.viewBox,v=s.pixelRatio,g=s.screenBox,y=g[2]-g[0],b=g[3]-g[1],x=m[2]-m[0],_=m[3]-m[1],w=0;w<2;++w){var M=d[w],k=d[w+2]-M,A=.5*(p[w+2]+p[w]),T=p[w+2]-p[w];e[w]=2*k/T,t[w]=2*(M-A)/T}e[0]*=x/y,t[0]*=x/y,e[1]*=_/b,t[1]*=_/b,u.bind(),c.bind(),u.attributes.dataCoord.pointer();var E=u.uniforms;E.dataShift=t,E.dataScale=e;var S=s.tickMarkLength,L=s.tickMarkWidth,C=s.tickMarkColor,P=6*f[0].length,z=Math.min(a.ge(f[0],(p[0]-d[0])/(d[2]-d[0]),l),f[0].length),O=Math.min(a.gt(f[0],(p[2]-d[0])/(d[2]-d[0]),l),f[0].length),D=0+6*z,I=6*Math.max(0,O-z),R=Math.min(a.ge(f[1],(p[1]-d[1])/(d[3]-d[1]),l),f[1].length),N=Math.min(a.gt(f[1],(p[3]-d[1])/(d[3]-d[1]),l),f[1].length),F=P+6*R,j=6*Math.max(0,N-R);i[0]=2*(m[0]-S[1])/y-1,i[1]=(m[3]+m[1])/b-1,o[0]=S[1]*v/y,o[1]=L[1]*v/b,j&&(E.color=C[1],E.tickScale=o,E.dataAxis=n,E.screenOffset=i,h.drawArrays(h.TRIANGLES,F,j)),i[0]=(m[2]+m[0])/y-1,i[1]=2*(m[1]-S[0])/b-1,o[0]=L[0]*v/y,o[1]=S[0]*v/b,I&&(E.color=C[0],E.tickScale=o,E.dataAxis=r,E.screenOffset=i,h.drawArrays(h.TRIANGLES,D,I)),i[0]=2*(m[2]+S[3])/y-1,i[1]=(m[3]+m[1])/b-1,o[0]=S[3]*v/y,o[1]=L[3]*v/b,j&&(E.color=C[3],E.tickScale=o,E.dataAxis=n,E.screenOffset=i,h.drawArrays(h.TRIANGLES,F,j)),i[0]=(m[2]+m[0])/y-1,i[1]=2*(m[3]+S[2])/b-1,o[0]=L[2]*v/y,o[1]=S[2]*v/b,I&&(E.color=C[2],E.tickScale=o,E.dataAxis=r,E.screenOffset=i,h.drawArrays(h.TRIANGLES,D,I))}}(),p.update=(h=[1,1,-1,-1,1,-1],d=[1,-1,1,1,-1,-1],function(t){for(var e=t.ticks,r=t.bounds,n=new Float32Array(18*(e[0].length+e[1].length)),i=(this.plot.zeroLineEnable,0),a=[[],[]],o=0;o<2;++o)for(var s=a[o],l=e[o],c=r[o],u=r[o+2],f=0;f<l.length;++f){var p=(l[f].x-c)/(u-c);s.push(p);for(var m=0;m<6;++m)n[i++]=p,n[i++]=h[m],n[i++]=d[m]}this.ticks=a,this.vbo.update(n)}),p.dispose=function(){this.vbo.dispose(),this.shader.dispose(),this.tickShader.dispose()}},{"./shaders":205,"binary-search-bounds":207,"gl-buffer":165,"gl-shader":220}],204:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e,[-1,-1,-1,1,1,-1,1,1]),s=i(e,a.lineVert,a.lineFrag);return new o(t,r,s)};var n=t("gl-buffer"),i=t("gl-shader"),a=t("./shaders");function o(t,e,r){this.plot=t,this.vbo=e,this.shader=r}var s,l,c=o.prototype;c.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},c.drawLine=(s=[0,0],l=[0,0],function(t,e,r,n,i,a){var o=this.plot,c=this.shader,u=o.gl;s[0]=t,s[1]=e,l[0]=r,l[1]=n,c.uniforms.start=s,c.uniforms.end=l,c.uniforms.width=i*o.pixelRatio,c.uniforms.color=a,u.drawArrays(u.TRIANGLE_STRIP,0,4)}),c.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":205,"gl-buffer":165,"gl-shader":220}],205:[function(t,e,r){"use strict";var n=t("glslify"),i=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:n(["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:i,textVert:n(["#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:i,gridVert:n(["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:i,boxVert:n(["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:n(["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"])}},{glslify:253}],206:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e),a=i(e,s.textVert,s.textFrag);return new l(t,r,a)};var n=t("gl-buffer"),i=t("gl-shader"),a=t("text-cache"),o=t("binary-search-bounds"),s=t("./shaders");function l(t,e,r){this.plot=t,this.vbo=e,this.shader=r,this.tickOffset=[[],[]],this.tickX=[[],[]],this.labelOffset=[0,0],this.labelCount=[0,0]}var c,u,f,h,d,p,m=l.prototype;m.drawTicks=(c=[0,0],u=[0,0],f=[0,0],function(t){var e=this.plot,r=this.shader,n=this.tickX[t],i=this.tickOffset[t],a=e.gl,s=e.viewBox,l=e.dataBox,h=e.screenBox,d=e.pixelRatio,p=e.tickEnable,m=e.tickPad,v=e.tickColor,g=e.tickAngle,y=e.labelEnable,b=e.labelPad,x=e.labelColor,_=e.labelAngle,w=this.labelOffset[t],M=this.labelCount[t],k=o.lt(n,l[t]),A=o.le(n,l[t+2]);c[0]=c[1]=0,c[t]=1,u[t]=(s[2+t]+s[t])/(h[2+t]-h[t])-1;var T=2/h[2+(1^t)]-h[1^t];u[1^t]=T*s[1^t]-1,p[t]&&(u[1^t]-=T*d*m[t],k<A&&i[A]>i[k]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=v[t],r.uniforms.angle=g[t],a.drawArrays(a.TRIANGLES,i[k],i[A]-i[k]))),y[t]&&M&&(u[1^t]-=T*d*b[t],r.uniforms.dataAxis=f,r.uniforms.screenOffset=u,r.uniforms.color=x[t],r.uniforms.angle=_[t],a.drawArrays(a.TRIANGLES,w,M)),u[1^t]=T*s[2+(1^t)]-1,p[t+2]&&(u[1^t]+=T*d*m[t+2],k<A&&i[A]>i[k]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=v[t+2],r.uniforms.angle=g[t+2],a.drawArrays(a.TRIANGLES,i[k],i[A]-i[k]))),y[t+2]&&M&&(u[1^t]+=T*d*b[t+2],r.uniforms.dataAxis=f,r.uniforms.screenOffset=u,r.uniforms.color=x[t+2],r.uniforms.angle=_[t+2],a.drawArrays(a.TRIANGLES,w,M))}),m.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,c=r.pixelRatio;if(this.titleCount){for(var u=0;u<2;++u)e[u]=2*(o[u]*c-a[u])/(a[2+u]-a[u])-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)}}}(),m.bind=(h=[0,0],d=[0,0],p=[0,0],function(){var t=this.plot,e=this.shader,r=t._tickBounds,n=t.dataBox,i=t.screenBox,a=t.viewBox;e.bind();for(var o=0;o<2;++o){var s=r[o],l=r[o+2]-s,c=.5*(n[o+2]+n[o]),u=n[o+2]-n[o],f=a[o],m=a[o+2]-f,v=i[o],g=i[o+2]-v;d[o]=2*l/u*m/g,h[o]=2*(s-c)/u*m/g}p[1]=2*t.pixelRatio/(i[3]-i[1]),p[0]=p[1]*(i[3]-i[1])/(i[2]-i[0]),e.uniforms.dataScale=d,e.uniforms.dataShift=h,e.uniforms.textScale=p,this.vbo.bind(),e.attributes.textCoordinate.pointer()}),m.update=function(t){var e,r,n,i,o,s=[],l=t.ticks,c=t.bounds;for(o=0;o<2;++o){var u=[Math.floor(s.length/3)],f=[-1/0],h=l[o];for(e=0;e<h.length;++e){var d=h[e],p=d.x,m=d.text,v=d.font||"sans-serif";i=d.fontSize||12;for(var g=1/(c[o+2]-c[o]),y=c[o],b=m.split("\n"),x=0;x<b.length;x++)for(n=a(v,b[x]).data,r=0;r<n.length;r+=2)s.push(n[r]*i,-n[r+1]*i-x*i*1.2,(p-y)*g);u.push(Math.floor(s.length/3)),f.push(p)}this.tickOffset[o]=u,this.tickX[o]=f}for(o=0;o<2;++o){for(this.labelOffset[o]=Math.floor(s.length/3),n=a(t.labelFont[o],t.labels[o],{textAlign:"center"}).data,i=t.labelSize[o],e=0;e<n.length;e+=2)s.push(n[e]*i,-n[e+1]*i,0);this.labelCount[o]=Math.floor(s.length/3)-this.labelOffset[o]}for(this.titleOffset=Math.floor(s.length/3),n=a(t.titleFont,t.title).data,i=t.titleSize,e=0;e<n.length;e+=2)s.push(n[e]*i,-n[e+1]*i,0);this.titleCount=Math.floor(s.length/3)-this.titleOffset,this.vbo.update(s)},m.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":205,"binary-search-bounds":207,"gl-buffer":165,"gl-shader":220,"text-cache":525}],207:[function(t,e,r){arguments[4][90][0].apply(r,arguments)},{dup:90}],208:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e,[e.drawingBufferWidth,e.drawingBufferHeight]),c=new l(e,r);return c.grid=i(c),c.text=a(c),c.line=o(c),c.box=s(c),c.update(t),c};var n=t("gl-select-static"),i=t("./lib/grid"),a=t("./lib/text"),o=t("./lib/line"),s=t("./lib/box");function l(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}var c=l.prototype;function u(t){for(var e=t.slice(),r=0;r<e.length;++r)e[r]=e[r].slice();return e}function f(t,e){return t.x-e.x}c.setDirty=function(){this.dirty=this.pickDirty=!0},c.setOverlayDirty=function(){this.dirty=!0},c.nextDepthValue=function(){return this._depthCounter++/65536},c.draw=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){if(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),this.borderColor){t.scissor(e[0],e[1],e[2]-e[0],e[3]-e[1]);var c=this.borderColor;t.clearColor(c[0]*c[3],c[1]*c[3],c[2]*c[3],c[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 u=this.backgroundColor;t.clearColor(u[0]*u[3],u[1]*u[3],u[2]*u[3],u[3]),t.clear(t.COLOR_BUFFER_BIT),a.draw();var f=this.zeroLineEnable,h=this.zeroLineColor,d=this.zeroLineWidth;if(f[0]||f[1]){o.bind();for(var p=0;p<2;++p)if(f[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],h[p]):o.drawLine(e[0],m,e[2],m,d[p],h[p])}}for(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 v=this.borderLineEnable,g=this.borderLineWidth,y=this.borderLineColor;for(v[1]&&o.drawLine(r[0],r[1]-.5*g[1]*i,r[0],r[3]+.5*g[3]*i,g[1],y[1]),v[0]&&o.drawLine(r[0]-.5*g[0]*i,r[1],r[2]+.5*g[2]*i,r[1],g[0],y[0]),v[3]&&o.drawLine(r[2],r[1]-.5*g[1]*i,r[2],r[3]+.5*g[3]*i,g[3],y[3]),v[2]&&o.drawLine(r[0]-.5*g[0]*i,r[3],r[2]+.5*g[2]*i,r[3],g[2],y[2]),s.bind(),p=0;p<2;++p)s.drawTicks(p);this.titleEnable&&s.drawTitle();var b=this.overlays;for(p=0;p<b.length;++p)b[p].draw();t.disable(t.SCISSOR_TEST),t.disable(t.BLEND),t.depthMask(!0)}},c.drawPick=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()}},c.pick=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),c=this.objects,u=0;u<c.length;++u){var f=c[u].pick(a,o,l);if(f)return f}return null}},c.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()},c.setDataBox=function(t){var e=this.dataBox;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3])&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],this.setDirty())},c.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()},c.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,i=(n[2]-n[0])/(n[3]-n[1]);this.setDataBox(t.dataBox||[-10,-10/i,10,10/i]),this.borderColor=!1!==t.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=u(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=u(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=u(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=u(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=u(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=u(t.borderLineColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);var a=t.ticks||[[],[]],o=this._tickBounds;o[0]=o[1]=1/0,o[2]=o[3]=-1/0;for(var s=0;s<2;++s){var l=a[s].slice(0);0!==l.length&&(l.sort(f),o[s]=Math.min(o[s],l[0].x),o[s+2]=Math.max(o[s+2],l[l.length-1].x))}this.grid.update({bounds:o,ticks:a}),this.text.update({bounds:o,ticks:a,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()},c.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(t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},c.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},c.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}},c.addOverlay=function(t){this.overlays.indexOf(t)<0&&(this.overlays.push(t),this.setOverlayDirty())},c.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":202,"./lib/grid":203,"./lib/line":204,"./lib/text":206,"gl-select-static":219}],209:[function(t,e,r){var n=t("glslify"),i=t("gl-shader"),a=n(["precision mediump float;\n#define GLSLIFY 1\nattribute vec2 position;\nvarying vec2 uv;\nvoid main() {\n uv = position;\n gl_Position = vec4(position, 0, 1);\n}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}"]);e.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec2"}])}},{"gl-shader":220,glslify:253}],210:[function(t,e,r){"use strict";e.exports=function(t){var e=!1,r=((t=t||{}).pixelRatio||parseFloat(window.devicePixelRatio),t.canvas);if(!r)if(r=document.createElement("canvas"),t.container){var v=t.container;v.appendChild(r)}else document.body.appendChild(r);var g=t.gl;g||(g=function(t,e){var r=null;try{(r=t.getContext("webgl",e))||(r=t.getContext("experimental-webgl",e))}catch(t){return null}return r}(r,t.glOptions||{premultipliedAlpha:!0,antialias:!0}));if(!g)throw new Error("webgl not supported");var y=t.bounds||[[-10,-10,-10],[10,10,10]],b=new function(){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},x=l(g,[g.drawingBufferWidth,g.drawingBufferHeight],{preferFloat:!d}),_=h(g),w=t.camera||{eye:[2,0,0],center:[0,0,0],up:[0,1,0],zoomMin:.1,zoomMax:100,mode:"turntable"},M=t.axes||{},k=i(g,M);k.enable=!M.disable;var A=t.spikes||{},T=o(g,A),E=[],S=[],L=[],C=[],P=!0,z=!0,O=new Array(16),D=new Array(16),I={view:null,projection:O,model:D},z=!0,R=[g.drawingBufferWidth,g.drawingBufferHeight],N={gl:g,contextLost:!1,pixelRatio:t.pixelRatio||parseFloat(window.devicePixelRatio),canvas:r,selection:b,camera:n(r,w),axes:k,axesPixels:null,spikes:T,bounds:y,objects:E,shape:R,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:m(t.autoResize),autoBounds:m(t.autoBounds),autoScale:!!t.autoScale,autoCenter:m(t.autoCenter),clipToBounds:m(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:I,oncontextloss:null,mouseListener:null},F=[g.drawingBufferWidth/N.pixelRatio|0,g.drawingBufferHeight/N.pixelRatio|0];function j(){if(!e&&N.autoResize){var t=r.parentNode,n=1,i=1;t&&t!==document.body?(n=t.clientWidth,i=t.clientHeight):(n=window.innerWidth,i=window.innerHeight);var a=0|Math.ceil(n*N.pixelRatio),o=0|Math.ceil(i*N.pixelRatio);if(a!==r.width||o!==r.height){r.width=a,r.height=o;var s=r.style;s.position=s.position||"absolute",s.left="0px",s.top="0px",s.width=n+"px",s.height=i+"px",P=!0}}}N.autoResize&&j();function B(){for(var t=E.length,e=C.length,r=0;r<e;++r)L[r]=0;t:for(var r=0;r<t;++r){var n=E[r],i=n.pickSlots;if(i){for(var a=0;a<e;++a)if(L[a]+i<255){S[r]=a,n.setPickBase(L[a]+1),L[a]+=i;continue t}var o=s(g,R);S[r]=e,C.push(o),L.push(i),n.setPickBase(1),e+=1}else S[r]=-1}for(;e>0&&0===L[e-1];)L.pop(),C.pop().dispose()}window.addEventListener("resize",j),N.update=function(t){e||(t=t||{},P=!0,z=!0)},N.add=function(t){e||(t.axes=k,E.push(t),S.push(-1),P=!0,z=!0,B())},N.remove=function(t){if(!e){var r=E.indexOf(t);r<0||(E.splice(r,1),S.pop(),P=!0,z=!0,B())}},N.dispose=function(){if(!e&&(e=!0,window.removeEventListener("resize",j),r.removeEventListener("webglcontextlost",q),N.mouseListener.enabled=!1,!N.contextLost)){k.dispose(),T.dispose();for(var t=0;t<E.length;++t)E[t].dispose();x.dispose();for(var t=0;t<C.length;++t)C[t].dispose();_.dispose(),g=null,k=null,T=null,E=[]}};var U=!1,V=0;function q(){if(N.contextLost)return!0;g.isContextLost()&&(N.contextLost=!0,N.mouseListener.enabled=!1,N.selection.object=null,N.oncontextloss&&N.oncontextloss())}N.mouseListener=u(r,function(t,r,n){if(!e){var i=C.length,a=E.length,o=b.object;b.distance=1/0,b.mouse[0]=r,b.mouse[1]=n,b.object=null,b.screen=null,b.dataCoordinate=b.dataPosition=null;var s=!1;if(t&&V)U=!0;else{U&&(z=!0),U=!1;for(var l=0;l<i;++l){var c=C[l].query(r,F[1]-n-1,N.pickRadius);if(c){if(c.distance>b.distance)continue;for(var u=0;u<a;++u){var f=E[u];if(S[u]===l){var h=f.pick(c);h&&(b.buttons=t,b.screen=c.coord,b.distance=c.distance,b.object=f,b.index=h.distance,b.dataPosition=h.position,b.dataCoordinate=h.dataCoordinate,b.data=h,s=!0)}}}}}o&&o!==b.object&&(o.highlight&&o.highlight(null),P=!0),b.object&&(b.object.highlight&&b.object.highlight(b.data),P=!0),(s=s||b.object!==o)&&N.onselect&&N.onselect(b),1&t&&!(1&V)&&N.onclick&&N.onclick(b),V=t}}),r.addEventListener("webglcontextlost",q);var H=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],G=[H[0].slice(),H[1].slice()];function Y(){if(!q()){j();var t=N.camera.tick();I.view=N.camera.matrix,P=P||t,z=z||t,k.pixelRatio=N.pixelRatio,T.pixelRatio=N.pixelRatio;var e=E.length,r=H[0],n=H[1];r[0]=r[1]=r[2]=1/0,n[0]=n[1]=n[2]=-1/0;for(var i=0;i<e;++i){var o=E[i];o.pixelRatio=N.pixelRatio,o.axes=N.axes,P=P||!!o.dirty,z=z||!!o.dirty;var s=o.bounds;if(s)for(var l=s[0],u=s[1],h=0;h<3;++h)r[h]=Math.min(r[h],l[h]),n[h]=Math.max(n[h],u[h])}var d=N.bounds;if(N.autoBounds)for(var h=0;h<3;++h){if(n[h]<r[h])r[h]=-1,n[h]=1;else{r[h]===n[h]&&(r[h]-=1,n[h]+=1);var m=.05*(n[h]-r[h]);r[h]=r[h]-m,n[h]=n[h]+m}d[0][h]=r[h],d[1][h]=n[h]}for(var v=!1,h=0;h<3;++h)v=v||G[0][h]!==d[0][h]||G[1][h]!==d[1][h],G[0][h]=d[0][h],G[1][h]=d[1][h];if(z=z||v,P=P||v){if(v){for(var y=[0,0,0],i=0;i<3;++i)y[i]=p((d[1][i]-d[0][i])/10);k.autoTicks?k.update({bounds:d,tickSpacing:y}):k.update({bounds:d})}var w=g.drawingBufferWidth,M=g.drawingBufferHeight;R[0]=w,R[1]=M,F[0]=0|Math.max(w/N.pixelRatio,1),F[1]=0|Math.max(M/N.pixelRatio,1),f(O,N.fovy,w/M,N.zNear,N.zFar);for(var i=0;i<16;++i)D[i]=0;D[15]=1;for(var A=0,i=0;i<3;++i)A=Math.max(A,d[1][i]-d[0][i]);for(var i=0;i<3;++i)N.autoScale?D[5*i]=N.aspect[i]/(d[1][i]-d[0][i]):D[5*i]=1/A,N.autoCenter&&(D[12+i]=.5*-D[5*i]*(d[0][i]+d[1][i]));for(var i=0;i<e;++i){var o=E[i];o.axesBounds=d,N.clipToBounds&&(o.clipBounds=d)}b.object&&(N.snapToData?T.position=b.dataCoordinate:T.position=b.dataPosition,T.bounds=d),z&&(z=!1,function(){if(q())return;g.colorMask(!0,!0,!0,!0),g.depthMask(!0),g.disable(g.BLEND),g.enable(g.DEPTH_TEST);for(var t=E.length,e=C.length,r=0;r<e;++r){var n=C[r];n.shape=F,n.begin();for(var i=0;i<t;++i)if(S[i]===r){var a=E[i];a.drawPick&&(a.pixelRatio=1,a.drawPick(I))}n.end()}}()),N.axesPixels=a(N.axes,I,w,M),N.onrender&&N.onrender(),g.bindFramebuffer(g.FRAMEBUFFER,null),g.viewport(0,0,w,M);var L=N.clearColor;g.clearColor(L[0],L[1],L[2],L[3]),g.clear(g.COLOR_BUFFER_BIT|g.DEPTH_BUFFER_BIT),g.depthMask(!0),g.colorMask(!0,!0,!0,!0),g.enable(g.DEPTH_TEST),g.depthFunc(g.LEQUAL),g.disable(g.BLEND),g.disable(g.CULL_FACE);var B=!1;k.enable&&(B=B||k.isTransparent(),k.draw(I)),T.axes=k,b.object&&T.draw(I),g.disable(g.CULL_FACE);for(var i=0;i<e;++i){var o=E[i];o.axes=k,o.pixelRatio=N.pixelRatio,o.isOpaque&&o.isOpaque()&&o.draw(I),o.isTransparent&&o.isTransparent()&&(B=!0)}if(B){x.shape=R,x.bind(),g.clear(g.DEPTH_BUFFER_BIT),g.colorMask(!1,!1,!1,!1),g.depthMask(!0),g.depthFunc(g.LESS),k.enable&&k.isTransparent()&&k.drawTransparent(I);for(var i=0;i<e;++i){var o=E[i];o.isOpaque&&o.isOpaque()&&o.draw(I)}g.enable(g.BLEND),g.blendEquation(g.FUNC_ADD),g.blendFunc(g.ONE,g.ONE_MINUS_SRC_ALPHA),g.colorMask(!0,!0,!0,!0),g.depthMask(!1),g.clearColor(0,0,0,0),g.clear(g.COLOR_BUFFER_BIT),k.isTransparent()&&k.drawTransparent(I);for(var i=0;i<e;++i){var o=E[i];o.isTransparent&&o.isTransparent()&&o.drawTransparent(I)}g.bindFramebuffer(g.FRAMEBUFFER,null),g.blendFunc(g.ONE,g.ONE_MINUS_SRC_ALPHA),g.disable(g.DEPTH_TEST),_.bind(),x.color[0].bind(0),_.uniforms.accumBuffer=0,c(g),g.disable(g.BLEND)}P=!1;for(var i=0;i<e;++i)E[i].dirty=!1}}}return function t(){e||N.contextLost||(requestAnimationFrame(t),Y())}(),N.redraw=function(){e||(P=!0,Y())},N};var n=t("3d-view-controls"),i=t("gl-axes3d"),a=t("gl-axes3d/properties"),o=t("gl-spikes3d"),s=t("gl-select-static"),l=t("gl-fbo"),c=t("a-big-triangle"),u=t("mouse-change"),f=t("gl-mat4/perspective"),h=t("./lib/shader"),d=t("is-mobile")();function p(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){r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function m(t){return"boolean"!=typeof t||t}},{"./lib/shader":209,"3d-view-controls":39,"a-big-triangle":42,"gl-axes3d":157,"gl-axes3d/properties":164,"gl-fbo":171,"gl-mat4/perspective":189,"gl-select-static":219,"gl-spikes3d":229,"is-mobile":265,"mouse-change":424}],211:[function(t,e,r){var n=t("glslify");r.pointVertex=n(["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=n(["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=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 pickId;\n\nuniform mat3 matrix;\nuniform float pointSize;\nuniform vec4 pickOffset;\n\nvarying vec4 fragId;\n\nvoid main() {\n vec3 hgPosition = matrix * vec3(position, 1);\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\n gl_PointSize = pointSize;\n\n vec4 id = pickId + pickOffset;\n id.y += floor(id.x / 256.0);\n id.x -= floor(id.x / 256.0) * 256.0;\n\n id.z += floor(id.y / 256.0);\n id.y -= floor(id.y / 256.0) * 256.0;\n\n id.w += floor(id.z / 256.0);\n id.z -= floor(id.z / 256.0) * 256.0;\n\n fragId = id;\n}\n"]),r.pickFragment=n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragId;\n\nvoid main() {\n float radius = length(2.0 * gl_PointCoord.xy - 1.0);\n if(radius > 1.0) {\n discard;\n }\n gl_FragColor = fragId / 255.0;\n}\n"])},{glslify:253}],212:[function(t,e,r){"use strict";var n=t("gl-shader"),i=t("gl-buffer"),a=t("typedarray-pool"),o=t("./lib/shader");function s(t,e,r,n,i){this.plot=t,this.offsetBuffer=e,this.pickBuffer=r,this.shader=n,this.pickShader=i,this.sizeMin=.5,this.sizeMinCap=2,this.sizeMax=20,this.areaRatio=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.blend=!1,this.pickOffset=0,this.points=null}e.exports=function(t,e){var r=t.gl,a=i(r),l=i(r),c=n(r,o.pointVertex,o.pointFragment),u=n(r,o.pickVertex,o.pickFragment),f=new s(t,a,l,c,u);return f.update(e),t.addObject(f),f};var l,c,u=s.prototype;u.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},u.update=function(t){var e;function r(e,r){return e in t?t[e]:r}t=t||{},this.sizeMin=r("sizeMin",.5),this.sizeMax=r("sizeMax",20),this.color=r("color",[1,0,0,1]).slice(),this.areaRatio=r("areaRatio",1),this.borderColor=r("borderColor",[0,0,0,1]).slice(),this.blend=r("blend",!1);var n=t.positions.length>>>1,i=t.positions instanceof Float32Array,o=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=i?s:a.mallocFloat32(s.length),c=o?t.idToIndex:a.mallocInt32(n);if(i||l.set(s),!o)for(l.set(s),e=0;e<n;e++)c[e]=e;this.points=s,this.offsetBuffer.update(l),this.pickBuffer.update(c),i||a.free(l),o||a.free(c),this.pointCount=n,this.pickOffset=0},u.unifiedDraw=(l=[1,0,0,0,1,0,0,0,1],c=[0,0,0,0],function(t){var e=void 0!==t,r=e?this.pickShader:this.shader,n=this.plot.gl,i=this.plot.dataBox;if(0===this.pointCount)return t;var a=i[2]-i[0],o=i[3]-i[1],s=function(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}(this.points,i),u=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(s,.33333)));l[0]=2/a,l[4]=2/o,l[6]=-2*i[0]/a-1,l[7]=-2*i[1]/o-1,this.offsetBuffer.bind(),r.bind(),r.attributes.position.pointer(),r.uniforms.matrix=l,r.uniforms.color=this.color,r.uniforms.borderColor=this.borderColor,r.uniforms.pointCloud=u<5,r.uniforms.pointSize=u,r.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),e&&(c[0]=255&t,c[1]=t>>8&255,c[2]=t>>16&255,c[3]=t>>24&255,this.pickBuffer.bind(),r.attributes.pickId.pointer(n.UNSIGNED_BYTE),r.uniforms.pickOffset=c,this.pickOffset=t);var f=n.getParameter(n.BLEND),h=n.getParameter(n.DITHER);return f&&!this.blend&&n.disable(n.BLEND),h&&n.disable(n.DITHER),n.drawArrays(n.POINTS,0,this.pointCount),f&&!this.blend&&n.enable(n.BLEND),h&&n.enable(n.DITHER),t+this.pointCount}),u.draw=u.unifiedDraw,u.drawPick=u.unifiedDraw,u.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":211,"gl-buffer":165,"gl-shader":220,"typedarray-pool":534}],213:[function(t,e,r){e.exports=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],f=e[2],h=e[3],d=r[0],p=r[1],m=r[2],v=r[3];(a=c*d+u*p+f*m+h*v)<0&&(a=-a,d=-d,p=-p,m=-m,v=-v);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);return t[0]=s*c+l*d,t[1]=s*u+l*p,t[2]=s*f+l*m,t[3]=s*h+l*v,t}},{}],214:[function(t,e,r){"use strict";var n=t("vectorize-text");e.exports=function(t,e){var r=i[e];r||(r=i[e]={});if(t in r)return r[t];for(var a=n(t,{textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),o=n(t,{triangles:!0,textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),s=[[1/0,1/0],[-1/0,-1/0]],l=0;l<a.positions.length;++l)for(var c=a.positions[l],u=0;u<2;++u)s[0][u]=Math.min(s[0][u],c[u]),s[1][u]=Math.max(s[1][u],c[u]);return r[t]=[o,a,s]};var i={}},{"vectorize-text":548}],215:[function(t,e,r){var n=t("gl-shader"),i=t("glslify"),a=i(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(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=i(["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=i(["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=i(["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"]),c=i(["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}"]),u=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],f={vertex:a,fragment:l,attributes:u},h={vertex:o,fragment:l,attributes:u},d={vertex:s,fragment:l,attributes:u},p={vertex:a,fragment:c,attributes:u},m={vertex:o,fragment:c,attributes:u},v={vertex:s,fragment:c,attributes:u};function g(t,e){var r=n(t,e),i=r.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,r}r.createPerspective=function(t){return g(t,f)},r.createOrtho=function(t){return g(t,h)},r.createProject=function(t){return g(t,d)},r.createPickPerspective=function(t){return g(t,p)},r.createPickOrtho=function(t){return g(t,m)},r.createPickProject=function(t){return g(t,v)}},{"gl-shader":220,glslify:253}],216:[function(t,e,r){"use strict";var n=t("gl-buffer"),i=t("gl-vao"),a=t("typedarray-pool"),o=t("gl-mat4/multiply"),s=t("./lib/shaders"),l=t("./lib/glyphs"),c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function u(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 f(t,e,r,n){return u(n,n),u(n,n),u(n,n)}function h(t,e,r,n,i,a,o,s,l,c,u,f){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.pickId=0,this.pickPerspectiveShader=c,this.pickOrthoShader=u,this.pickProjectShader=f,this.points=[],this._selectResult=new function(t,e){this.index=t,this.dataCoordinate=this.position=e}(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}e.exports=function(t){var e=t.gl,r=s.createPerspective(e),a=s.createOrtho(e),o=s.createProject(e),l=s.createPickPerspective(e),c=s.createPickOrtho(e),u=s.createPickProject(e),f=n(e),d=n(e),p=n(e),m=n(e),v=i(e,[{buffer:f,size:3,type:e.FLOAT},{buffer:d,size:4,type:e.FLOAT},{buffer:p,size:2,type:e.FLOAT},{buffer:m,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),g=new h(e,r,a,o,f,d,p,m,v,l,c,u);return g.update(t),g};var d=h.prototype;d.pickSlots=1,d.setPickBase=function(t){this.pickId=t},d.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},d.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 p=[0,0],m=[0,0,0],v=[0,0,0],g=[0,0,0,1],y=[0,0,0,1],b=c.slice(),x=[0,0,0],_=[[0,0,0],[0,0,0]];function w(t){return t[0]=t[1]=t[2]=0,t}function M(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function k(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function A(t,e,r,n,i){var a,s=e.axesProject,l=e.gl,u=t.uniforms,h=r.model||c,d=r.view||c,A=r.projection||c,T=e.axesBounds,E=function(t){for(var e=_,r=0;r<2;++r)for(var n=0;n<3;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}(e.clipBounds);a=e.axes&&e.axes.lastCubeProps?e.axes.lastCubeProps.axis:[1,1,1],p[0]=2/l.drawingBufferWidth,p[1]=2/l.drawingBufferHeight,t.bind(),u.view=d,u.projection=A,u.screenSize=p,u.highlightId=e.highlightId,u.highlightScale=e.highlightScale,u.clipBounds=E,u.pickGroup=e.pickId/255,u.pixelRatio=e.pixelRatio;for(var S=0;S<3;++S)if(s[S]&&e.projectOpacity[S]<1===n){u.scale=e.projectScale[S],u.opacity=e.projectOpacity[S];for(var L=b,C=0;C<16;++C)L[C]=0;for(C=0;C<4;++C)L[5*C]=1;L[5*S]=0,a[S]<0?L[12+S]=T[0][S]:L[12+S]=T[1][S],o(L,h,L),u.model=L;var P=(S+1)%3,z=(S+2)%3,O=w(m),D=w(v);O[P]=1,D[z]=1;var I=f(0,0,0,M(g,O)),R=f(0,0,0,M(y,D));if(Math.abs(I[1])>Math.abs(R[1])){var N=I;I=R,R=N,N=O,O=D,D=N;var F=P;P=z,z=F}I[0]<0&&(O[P]=-1),R[1]>0&&(D[z]=-1);var j=0,B=0;for(C=0;C<4;++C)j+=Math.pow(h[4*P+C],2),B+=Math.pow(h[4*z+C],2);O[P]/=Math.sqrt(j),D[z]/=Math.sqrt(B),u.axes[0]=O,u.axes[1]=D,u.fragClipBounds[0]=k(x,E[0],S,-1e8),u.fragClipBounds[1]=k(x,E[1],S,1e8),e.vao.draw(l.TRIANGLES,e.vertexCount),e.lineWidth>0&&(l.lineWidth(e.lineWidth),e.vao.draw(l.LINES,e.lineVertexCount,e.vertexCount))}}var T=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function E(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||c,s.view=n.view||c,s.projection=n.projection||c,p[0]=2/o.drawingBufferWidth,p[1]=2/o.drawingBufferHeight,s.screenSize=p,s.highlightId=r.highlightId,s.highlightScale=r.highlightScale,s.fragClipBounds=T,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))}A(e,r,n,i),r.vao.unbind()}d.draw=function(t){E(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!1,!1)},d.drawTransparent=function(t){E(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!0,!1)},d.drawPick=function(t){E(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,!1,!0)},d.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},d.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]},d.update=function(t){if("perspective"in(t=t||{})&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if("projectOpacity"in t)if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{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",o=t.alignment||[0,0],s=[1/0,1/0,1/0],c=[-1/0,-1/0,-1/0],u=t.glyph,f=t.color,h=t.size,d=t.angle,p=t.lineColor,m=0,v=0,g=0,y=n.length;t:for(var b=0;b<y;++b){for(var x=n[b],_=0;_<3;++_)if(isNaN(x[_])||!isFinite(x[_]))continue t;var w=(N=Array.isArray(u)?l(u[b],i):l(u||"\u25cf",i))[0],M=N[1],k=N[2];v+=3*w.cells.length,g+=2*M.edges.length}var A=v+g,T=a.mallocFloat(3*A),E=a.mallocFloat(4*A),S=a.mallocFloat(2*A),L=a.mallocUint32(A),C=[0,o[1]],P=0,z=v,O=[0,0,0,1],D=[0,0,0,1],I=Array.isArray(f)&&Array.isArray(f[0]),R=Array.isArray(p)&&Array.isArray(p[0]);t:for(b=0;b<y;++b){var N;for(x=n[b],_=0;_<3;++_){if(isNaN(x[_])||!isFinite(x[_])){m+=1;continue t}c[_]=Math.max(c[_],x[_]),s[_]=Math.min(s[_],x[_])}var F;w=(N=Array.isArray(u)?l(u[b],i):l(u||"\u25cf",i))[0],M=N[1],k=N[2];if(Array.isArray(f)){if(3===(F=I?f[b]:f).length){for(_=0;_<3;++_)O[_]=F[_];O[3]=1}else if(4===F.length)for(_=0;_<4;++_)O[_]=F[_]}else O[0]=O[1]=O[2]=0,O[3]=1;if(Array.isArray(p)){if(3===(F=R?p[b]:p).length){for(_=0;_<3;++_)D[_]=F[_];D[_]=1}else if(4===F.length)for(_=0;_<4;++_)D[_]=F[_]}else D[0]=D[1]=D[2]=0,D[3]=1;var j=.5;Array.isArray(h)?j=+h[b]:h?j=+h:this.useOrtho&&(j=12);var B=0;Array.isArray(d)?B=+d[b]:d&&(B=+d);var U=Math.cos(B),V=Math.sin(B);for(x=n[b],_=0;_<3;++_)c[_]=Math.max(c[_],x[_]),s[_]=Math.min(s[_],x[_]);o[0]<0?C[0]=o[0]*(1+k[1][0]):o[0]>0&&(C[0]=-o[0]*(1+k[0][0]));var q=w.cells,H=w.positions;for(_=0;_<q.length;++_)for(var G=q[_],Y=0;Y<3;++Y){for(var W=0;W<3;++W)T[3*P+W]=x[W];for(W=0;W<4;++W)E[4*P+W]=O[W];L[P]=m;var X=H[G[Y]];S[2*P]=j*(U*X[0]-V*X[1]+C[0]),S[2*P+1]=j*(V*X[0]+U*X[1]+C[1]),P+=1}for(q=M.edges,H=M.positions,_=0;_<q.length;++_)for(G=q[_],Y=0;Y<2;++Y){for(W=0;W<3;++W)T[3*z+W]=x[W];for(W=0;W<4;++W)E[4*z+W]=D[W];L[z]=m;X=H[G[Y]];S[2*z]=j*(U*X[0]-V*X[1]+C[0]),S[2*z+1]=j*(V*X[0]+U*X[1]+C[1]),z+=1}m+=1}this.vertexCount=v,this.lineVertexCount=g,this.pointBuffer.update(T),this.colorBuffer.update(E),this.glyphBuffer.update(S),this.idBuffer.update(new Uint32Array(L)),a.free(T),a.free(E),a.free(S),a.free(L),this.bounds=[s,c],this.points=n,this.pointCount=n.length}},d.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":214,"./lib/shaders":215,"gl-buffer":165,"gl-mat4/multiply":188,"gl-vao":237,"typedarray-pool":534}],217:[function(t,e,r){"use strict";var n=t("glslify");r.boxVertex=n(["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=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color;\n\nvoid main() {\n gl_FragColor = color;\n}\n"])},{glslify:253}],218:[function(t,e,r){"use strict";var n=t("gl-shader"),i=t("gl-buffer"),a=t("./lib/shaders");function o(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}e.exports=function(t,e){var r=t.gl,s=i(r,[0,0,0,1,1,0,1,1]),l=n(r,a.boxVertex,a.boxFragment),c=new o(t,s,l);return c.update(e),t.addOverlay(c),c};var s=o.prototype;s.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,c=t.viewBox,u=t.pixelRatio,f=(e[0]-l[0])*(c[2]-c[0])/(l[2]-l[0])+c[0],h=(e[1]-l[1])*(c[3]-c[1])/(l[3]-l[1])+c[1],d=(e[2]-l[0])*(c[2]-c[0])/(l[2]-l[0])+c[0],p=(e[3]-l[1])*(c[3]-c[1])/(l[3]-l[1])+c[1];if(f=Math.max(f,c[0]),h=Math.max(h,c[1]),d=Math.min(d,c[2]),p=Math.min(p,c[3]),!(d<f||p<h)){o.bind();var m=s[2]-s[0],v=s[3]-s[1];if(this.outerFill&&(o.drawBox(0,0,m,h,i),o.drawBox(0,h,f,p,i),o.drawBox(0,p,m,v,i),o.drawBox(d,h,m,p,i)),this.innerFill&&o.drawBox(f,h,d,p,n),r>0){var g=r*u;o.drawBox(f-g,h-g,d+g,h+g,a),o.drawBox(f-g,p-g,d+g,p+g,a),o.drawBox(f-g,h-g,f+g,p+g,a),o.drawBox(d-g,h-g,d+g,p+g,a)}}}},s.update=function(t){t=t||{},this.innerFill=!!t.innerFill,this.outerFill=!!t.outerFill,this.innerColor=(t.innerColor||[0,0,0,.5]).slice(),this.outerColor=(t.outerColor||[0,0,0,.5]).slice(),this.borderColor=(t.borderColor||[0,0,0,1]).slice(),this.borderWidth=t.borderWidth||0,this.selectBox=(t.selectBox||this.selectBox).slice()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":217,"gl-buffer":165,"gl-shader":220}],219:[function(t,e,r){"use strict";e.exports=function(t,e){var r=n(t,e),a=i.mallocUint8(e[0]*e[1]*4);return new l(t,r,a)};var n=t("gl-fbo"),i=t("typedarray-pool"),a=t("ndarray"),o=t("bit-twiddle").nextPow2,s=t("cwise/lib/wrapper")({args:["array",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},"scalar","scalar","index"],pre:{body:"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},body:{body:"{if(_inline_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});function l(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)}}var c=l.prototype;Object.defineProperty(c,"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){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*e*4)),a=0;a<r*e*4;++a)n[a]=255}return t}}}),c.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))},c.end=function(){var t=this.gl;t&&(t.bindFramebuffer(t.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},c.query=function(t,e,r){if(!this.gl)return null;var n=this.fbo.shape.slice();t|=0,e|=0,"number"!=typeof r&&(r=1);var i=0|Math.min(Math.max(t-r,0),n[0]),o=0|Math.min(Math.max(t+r,0),n[0]),l=0|Math.min(Math.max(e-r,0),n[1]),c=0|Math.min(Math.max(e+r,0),n[1]);if(o<=i||c<=l)return null;var u=[o-i,c-l],f=a(this.buffer,[u[0],u[1],4],[4,4*n[0],1],4*(i+n[0]*l)),h=s(f.hi(u[0],u[1],1),r,r),d=h[0],p=h[1];return d<0||Math.pow(this.radius,2)<h[2]?null:new function(t,e,r,n,i){this.coord=[t,e],this.id=r,this.value=n,this.distance=i}(d+i|0,p+l|0,f.get(d,p,0),[f.get(d,p,1),f.get(d,p,2),f.get(d,p,3)],Math.sqrt(h[2]))},c.dispose=function(){this.gl&&(this.fbo.dispose(),i.free(this.buffer),this.gl=null,this._readTimeout&&clearTimeout(this._readTimeout))}},{"bit-twiddle":71,"cwise/lib/wrapper":119,"gl-fbo":171,ndarray:439,"typedarray-pool":534}],220:[function(t,e,r){"use strict";var n=t("./lib/create-uniforms"),i=t("./lib/create-attributes"),a=t("./lib/reflect"),o=t("./lib/shader-cache"),s=t("./lib/runtime-reflect"),l=t("./lib/GLError");function c(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}var u=c.prototype;function f(t,e){return t.name<e.name?-1:1}u.bind=function(){var t;this.program||this._relink();var 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)},u.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},u.update=function(t,e,r,c){if(!e||1===arguments.length){var u=t;t=u.vertex,e=u.fragment,r=u.uniforms,c=u.attributes}var h=this,d=h.gl,p=h._vref;h._vref=o.shader(d,d.VERTEX_SHADER,t),p&&p.dispose(),h.vertShader=h._vref.shader;var m=this._fref;if(h._fref=o.shader(d,d.FRAGMENT_SHADER,e),m&&m.dispose(),h.fragShader=h._fref.shader,!r||!c){var v=d.createProgram();if(d.attachShader(v,h.fragShader),d.attachShader(v,h.vertShader),d.linkProgram(v),!d.getProgramParameter(v,d.LINK_STATUS)){var g=d.getProgramInfoLog(v);throw new l(g,"Error linking program:"+g)}r=r||s.uniforms(d,v),c=c||s.attributes(d,v),d.deleteProgram(v)}(c=c.slice()).sort(f);var y,b=[],x=[],_=[];for(y=0;y<c.length;++y){var w=c[y];if(w.type.indexOf("mat")>=0){for(var M=0|w.type.charAt(w.type.length-1),k=new Array(M),A=0;A<M;++A)k[A]=_.length,x.push(w.name+"["+A+"]"),"number"==typeof w.location?_.push(w.location+A):Array.isArray(w.location)&&w.location.length===M&&"number"==typeof w.location[A]?_.push(0|w.location[A]):_.push(-1);b.push({name:w.name,type:w.type,locations:k})}else b.push({name:w.name,type:w.type,locations:[_.length]}),x.push(w.name),"number"==typeof w.location?_.push(0|w.location):_.push(-1)}var T=0;for(y=0;y<_.length;++y)if(_[y]<0){for(;_.indexOf(T)>=0;)T+=1;_[y]=T}var E=new Array(r.length);function S(){h.program=o.program(d,h._vref,h._fref,x,_);for(var t=0;t<r.length;++t)E[t]=d.getUniformLocation(h.program,r[t].name)}S(),h._relink=S,h.types={uniforms:a(r),attributes:a(c)},h.attributes=i(d,h,b,_),Object.defineProperty(h,"uniforms",n(d,h,r,E))},e.exports=function(t,e,r,n,i){var a=new c(t);return a.update(e,r,n,i),a}},{"./lib/GLError":221,"./lib/create-attributes":222,"./lib/create-uniforms":223,"./lib/reflect":224,"./lib/runtime-reflect":225,"./lib/shader-cache":226}],221:[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},{}],222:[function(t,e,r){"use strict";e.exports=function(t,e,r,i){for(var a={},l=0,c=r.length;l<c;++l){var u=r[l],f=u.name,h=u.type,d=u.locations;switch(h){case"bool":case"int":case"float":o(t,e,d[0],i,1,a,f);break;default:if(h.indexOf("vec")>=0){var p=h.charCodeAt(h.length-1)-48;if(p<2||p>4)throw new n("","Invalid data type for attribute "+f+": "+h);o(t,e,d[0],i,p,a,f)}else{if(!(h.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+f+": "+h);var p=h.charCodeAt(h.length-1)-48;if(p<2||p>4)throw new n("","Invalid data type for attribute "+f+": "+h);s(t,e,d,i,p,a,f)}}}return a};var n=t("./GLError");function i(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;function o(t,e,r,n,a,o,s){for(var l=["gl","v"],c=[],u=0;u<a;++u)l.push("x"+u),c.push("x"+u);l.push("if(x0.length===void 0){return gl.vertexAttrib"+a+"f(v,"+c.join()+")}else{return gl.vertexAttrib"+a+"fv(v,x0)}");var f=Function.apply(null,l),h=new i(t,e,r,n,a,f);Object.defineProperty(o,s,{set:function(e){return t.disableVertexAttribArray(n[r]),f(t,n[r],e),e},get:function(){return h},enumerable:!0})}function s(t,e,r,n,i,a,s){for(var l=new Array(i),c=new Array(i),u=0;u<i;++u)o(t,e,r[u],n,i,l,u),c[u]=l[u];Object.defineProperty(l,"location",{set:function(t){if(Array.isArray(t))for(var e=0;e<i;++e)c[e].location=t[e];else for(e=0;e<i;++e)c[e].location=t+e;return t},get:function(){for(var t=new Array(i),e=0;e<i;++e)t[e]=n[r[e]];return t},enumerable:!0}),l.pointer=function(e,a,o,s){e=e||t.FLOAT,a=!!a,o=o||i*i,s=s||0;for(var l=0;l<i;++l){var c=n[r[l]];t.vertexAttribPointer(c,i,e,a,o,s+l*i),t.enableVertexAttribArray(c)}};var f=new Array(i),h=t["vertexAttrib"+i+"fv"];Object.defineProperty(a,s,{set:function(e){for(var a=0;a<i;++a){var o=n[r[a]];if(t.disableVertexAttribArray(o),Array.isArray(e[0]))h.call(t,o,e[a]);else{for(var s=0;s<i;++s)f[s]=e[i*a+s];h.call(t,o,f)}}return e},get:function(){return l},enumerable:!0})}a.pointer=function(t,e,r,n){var i=this._gl,a=this._locations[this._index];i.vertexAttribPointer(a,this._dimension,t||i.FLOAT,!!e,r||0,n||0),i.enableVertexAttribArray(a)},a.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(a,"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":221}],223:[function(t,e,r){"use strict";var n=t("./reflect"),i=t("./GLError");function a(t){return new Function("y","return function(){return y}")(t)}function o(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=e;return r}e.exports=function(t,e,r,s){function l(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 a=r.charCodeAt(r.length-1)-48;if(a<2||a>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+a+"fv(locations["+e+"],false,obj"+t+")"}throw new i("","Unknown uniform data type for "+name+": "+r)}var a=r.charCodeAt(r.length-1)-48;if(a<2||a>4)throw new i("","Invalid data type");switch(r.charAt(0)){case"b":case"i":return"gl.uniform"+a+"iv(locations["+e+"],obj"+t+")";case"v":return"gl.uniform"+a+"fv(locations["+e+"],obj"+t+")";default:throw new i("","Unrecognized data type for vector "+name+": "+r)}}}function c(e){for(var n=["return function updateProperty(obj){"],i=function t(e,r){if("object"!=typeof r)return[[e,r]];var n=[];for(var i in r){var a=r[i],o=e;parseInt(i)+""===i?o+="["+i+"]":o+="."+i,"object"==typeof a?n.push.apply(n,t(o,a)):n.push([o,a])}return n}("",e),a=0;a<i.length;++a){var o=i[a],c=o[0],u=o[1];s[u]&&n.push(l(c,u,r[u].type))}n.push("return obj}");var f=new Function("gl","locations",n.join("\n"));return f(t,s)}function u(n,l,u){if("object"==typeof u){var h=f(u);Object.defineProperty(n,l,{get:a(h),set:c(u),enumerable:!0,configurable:!1})}else s[u]?Object.defineProperty(n,l,{get:(d=u,new Function("gl","wrapper","locations","return function(){return gl.getUniform(wrapper.program,locations["+d+"])}")(t,e,s)),set:c(u),enumerable:!0,configurable:!1}):n[l]=function(t){switch(t){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":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 i("","Invalid data type");return"b"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r=t.charCodeAt(t.length-1)-48;if(r<2||r>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+t);return o(r*r,0)}throw new i("","Unknown uniform data type for "+name+": "+t)}}(r[u].type);var d}function f(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r<t.length;++r)u(e,r,t[r])}else for(var n in e={},t)u(e,n,t[n]);return e}var h=n(r,!0);return{get:a(f(h)),set:c(h),enumerable:!0,configurable:!0}}},{"./GLError":221,"./reflect":224}],224:[function(t,e,r){"use strict";e.exports=function(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 c=1;c<l.length;++c){var u=parseInt(l[c]);c<l.length-1||s<a.length-1?(u in o||(c<l.length-1?o[u]=[]:o[u]={}),o=o[u]):o[u]=e?n:t[n].type}}else s<a.length-1?(l[0]in o||(o[l[0]]={}),o=o[l[0]]):o[l[0]]=e?n:t[n].type}return r}},{}],225:[function(t,e,r){"use strict";r.uniforms=function(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),n=[],i=0;i<r;++i){var o=t.getActiveUniform(e,i);if(o){var s=a(t,o.type);if(o.size>1)for(var l=0;l<o.size;++l)n.push({name:o.name.replace("[0]","["+l+"]"),type:s});else n.push({name:o.name,type:s})}}return n},r.attributes=function(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),n=[],i=0;i<r;++i){var o=t.getActiveAttrib(e,i);o&&n.push({name:o.name,type:a(t,o.type)})}return n};var n={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"},i=null;function a(t,e){if(!i){var r=Object.keys(n);i={};for(var a=0;a<r.length;++a){var o=r[a];i[t[o]]=n[o]}}return i[e]}},{}],226:[function(t,e,r){"use strict";r.shader=function(t,e,r){return u(t).getShaderReference(e,r)},r.program=function(t,e,r,n,i){return u(t).getProgram(e,r,n,i)};var n=t("./GLError"),i=t("gl-format-compiler-error"),a=new("undefined"==typeof WeakMap?t("weakmap-shim"):WeakMap),o=0;function s(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 l(t){this.gl=t,this.shaders=[{},{}],this.programs={}}s.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 c=l.prototype;function u(t){var e=a.get(t);return e||(e=new l(t),a.set(t,e)),e}c.getShaderReference=function(t,e){var r=this.gl,a=this.shaders[t===r.FRAGMENT_SHADER|0],l=a[e];if(l&&r.isShader(l.shader))l.count+=1;else{var c=function(t,e,r){var a=t.createShader(e);if(t.shaderSource(a,r),t.compileShader(a),!t.getShaderParameter(a,t.COMPILE_STATUS)){var o=t.getShaderInfoLog(a);try{var s=i(o,r,e)}catch(t){throw console.warn("Failed to format compiler error: "+t),new n(o,"Error compiling shader:\n"+o)}throw new n(o,s.short,s.long)}return a}(r,t,e);l=a[e]=new s(o++,e,t,c,[],1,this)}return l},c.getProgram=function(t,e,r,i){var a=[t.id,e.id,r.join(":"),i.join(":")].join("@"),o=this.programs[a];return o&&this.gl.isProgram(o)||(this.programs[a]=o=function(t,e,r,i,a){var o=t.createProgram();t.attachShader(o,e),t.attachShader(o,r);for(var s=0;s<i.length;++s)t.bindAttribLocation(o,a[s],i[s]);if(t.linkProgram(o),!t.getProgramParameter(o,t.LINK_STATUS)){var l=t.getProgramInfoLog(o);throw new n(l,"Error linking program: "+l)}return o}(this.gl,t.shader,e.shader,r,i),t.programs.push(a),e.programs.push(a)),o}},{"./GLError":221,"gl-format-compiler-error":172,"weakmap-shim":556}],227:[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]}e.exports=function(t,e){var r=new n(t);return r.update(e),t.addOverlay(r),r};var i=n.prototype;i.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()},i.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]),c=s[1]+(n[1]-o[1])/(o[3]-o[1])*(s[3]-s[1]);t[0]&&a.drawLine(l,c,s[0],c,e[0],r[0]),t[1]&&a.drawLine(l,c,l,s[1],e[1],r[1]),t[2]&&a.drawLine(l,c,s[2],c,e[2],r[2]),t[3]&&a.drawLine(l,c,l,s[3],e[3],r[3])}},i.dispose=function(){this.plot.removeOverlay(this)}},{}],228:[function(t,e,r){"use strict";var n=t("glslify"),i=t("gl-shader"),a=n(["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"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}"]);e.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},{"gl-shader":220,glslify:253}],229:[function(t,e,r){"use strict";var n=t("gl-buffer"),i=t("gl-vao"),a=t("./shaders/index");e.exports=function(t,e){var r=[];function o(t,e,n,i,a,o){var s=[t,e,n,0,0,0,1];s[i+3]=1,s[i]=a,r.push.apply(r,s),s[6]=-1,r.push.apply(r,s),s[i]=o,r.push.apply(r,s),r.push.apply(r,s),s[6]=1,r.push.apply(r,s),s[i]=a,r.push.apply(r,s)}o(0,0,0,0,0,1),o(0,0,0,1,0,1),o(0,0,0,2,0,1),o(1,0,0,1,-1,1),o(1,0,0,2,-1,1),o(0,1,0,0,-1,1),o(0,1,0,2,-1,1),o(0,0,1,0,-1,1),o(0,0,1,1,-1,1);var l=n(t,r),c=i(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}]),u=a(t);u.attributes.position.location=0,u.attributes.color.location=1,u.attributes.weight.location=2;var f=new s(t,l,c,u);return f.update(e),f};var o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(t,e,r,n){this.gl=t,this.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}var l=s.prototype,c=[0,0,0],u=[0,0,0],f=[0,0];l.isTransparent=function(){return!1},l.drawTransparent=function(t){},l.draw=function(t){var e=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var i,a=t.model||o,s=t.view||o,l=t.projection||o;this.axes&&(i=this.axes.lastCubeProps.axis);for(var h=c,d=u,p=0;p<3;++p)i&&i[p]<0?(h[p]=this.bounds[0][p],d[p]=this.bounds[1][p]):(h[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=s,n.uniforms.projection=l,n.uniforms.coordinates=[this.position,h,d],n.uniforms.colors=this.colors,n.uniforms.screenShape=f;for(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()},l.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))},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders/index":228,"gl-buffer":165,"gl-vao":237}],230:[function(t,e,r){var n=t("gl-shader"),i=t("glslify"),a=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"]),o=i(["precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat beckmannSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\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 = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color \u2014 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"]),s=i(["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"]),l=i(["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,a,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createPickShader=function(t){var e=n(t,a,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createContourShader=function(t){var e=n(t,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":220,glslify:231}],231:[function(t,e,r){arguments[4][169][0].apply(r,arguments)},{dup:169}],232:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=y(e),n=x(e),s=b(e),l=_(e),c=i(e),u=a(e,[{buffer:c,size:4,stride:w,offset:0},{buffer:c,size:3,stride:w,offset:16},{buffer:c,size:3,stride:w,offset:28}]),f=i(e),h=a(e,[{buffer:f,size:4,stride:20,offset:0},{buffer:f,size:1,stride:20,offset:16}]),d=i(e),p=a(e,[{buffer:d,size:2,type:e.FLOAT}]),m=o(e,1,T,e.RGBA,e.UNSIGNED_BYTE);m.minFilter=e.LINEAR,m.magFilter=e.LINEAR;var v=new E(e,[0,0],[[0,0,0],[0,0,0]],r,n,c,u,m,s,l,f,h,d,p),g={levels:[[],[],[]]};for(var M in t)g[M]=t[M];return g.colormap=g.colormap||"jet",v.update(g),v};var n=t("bit-twiddle"),i=t("gl-buffer"),a=t("gl-vao"),o=t("gl-texture2d"),s=t("typedarray-pool"),l=t("colormap"),c=t("ndarray-ops"),u=t("ndarray-pack"),f=t("ndarray"),h=t("surface-nets"),d=t("gl-mat4/multiply"),p=t("gl-mat4/invert"),m=t("binary-search-bounds"),v=t("ndarray-gradient"),g=t("./lib/shaders"),y=g.createShader,b=g.createContourShader,x=g.createPickShader,_=g.createPickContourShader,w=40,M=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],k=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],A=[[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=A[t],r=(t+2)%3;e[(t+1)%3+0]=1,e[r+3]=1,e[t+6]=1}}();var T=256;function E(t,e,r,n,i,a,o,l,c,u,h,d,p,m){this.gl=t,this.shape=e,this.bounds=r,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=c,this._contourPickShader=u,this._contourBuffer=h,this._contourVAO=d,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new function(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=p,this._dynamicVAO=m,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var S=E.prototype;S.isTransparent=function(){return this.opacity<1},S.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},S.pickSlots=1,S.setPickBase=function(t){this.pickId=t};var L=[0,0,0],C={showSurface:!1,showContour:!1,projections:[M.slice(),M.slice(),M.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function P(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||L,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=C.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],d(l,t.model,l);var c=C.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=t.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return C.showSurface=o,C.showContour=s,C}var z={model:M,view:M,projection:M,inverseModel:M.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},O=M.slice(),D=[1,0,0,0,1,0,0,0,1];function I(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=z;n.model=t.model||M,n.view=t.view||M,n.projection=t.projection||M,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=p(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=D,n.vertexColor=this.vertexColor;var s=O;for(d(s,n.view,n.model),d(s,n.projection,s),p(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var c=s[12+i];for(o=0;o<3;++o)c+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=c/l}var u=P(n,this);if(u.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=u.projections[i],this._shader.uniforms.clipBounds=u.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(u.showContour&&!e){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var h=this._contourVAO;for(h.bind(),i=0;i<3;++i)for(f.uniforms.permutation=A[i],r.lineWidth(this.contourWidth[i]),o=0;o<this.contourLevels[i].length;++o)this._contourCounts[i][o]&&(o===this.highlightLevel[i]?(f.uniforms.contourColor=this.highlightColor[i],f.uniforms.contourTint=this.highlightTint[i]):0!==o&&o-1!==this.highlightLevel[i]||(f.uniforms.contourColor=this.contourColor[i],f.uniforms.contourTint=this.contourTint[i]),f.uniforms.height=this.contourLevels[i][o],h.draw(r.LINES,this._contourCounts[i][o],this._contourOffsets[i][o]));for(i=0;i<3;++i)for(f.uniforms.model=u.projections[i],f.uniforms.clipBounds=u.clipBounds[i],o=0;o<3;++o)if(this.contourProject[i][o]){f.uniforms.permutation=A[o],r.lineWidth(this.contourWidth[o]);for(var m=0;m<this.contourLevels[o].length;++m)m===this.highlightLevel[o]?(f.uniforms.contourColor=this.highlightColor[o],f.uniforms.contourTint=this.highlightTint[o]):0!==m&&m-1!==this.highlightLevel[o]||(f.uniforms.contourColor=this.contourColor[o],f.uniforms.contourTint=this.contourTint[o]),f.uniforms.height=this.contourLevels[o][m],h.draw(r.LINES,this._contourCounts[o][m],this._contourOffsets[o][m])}for(h.unbind(),(h=this._dynamicVAO).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=A[i],r.lineWidth(this.dynamicWidth[i]),f.uniforms.contourColor=this.dynamicColor[i],f.uniforms.contourTint=this.dynamicTint[i],f.uniforms.height=this.dynamicLevel[i],h.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]),o=0;o<3;++o)this.contourProject[o][i]&&(f.uniforms.model=u.projections[o],f.uniforms.clipBounds=u.clipBounds[o],h.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]));h.unbind()}}S.draw=function(t){return I.call(this,t,!1)},S.drawTransparent=function(t){return I.call(this,t,!0)};var R={model:M,view:M,projection:M,inverseModel:M,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]};function N(t,e){var r=e.shape.slice(),n=t.shape.slice();c.assign(t.lo(1,1).hi(r[0],r[1]),e),c.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),c.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),c.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),c.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 F(t,e){return Array.isArray(t)?[e(t[0]),e(t[1]),e(t[2])]:[e(t),e(t),e(t)]}function j(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 B(t){if(Array.isArray(t)){if(Array.isArray(t))return[j(t[0]),j(t[1]),j(t[2])];var e=j(t);return[e.slice(),e.slice(),e.slice()]}}S.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=R;r.model=t.model||M,r.view=t.view||M,r.projection=t.projection||M,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.permutation=D;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 o=P(r,this);if(o.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=o.projections[n],this._pickShader.uniforms.clipBounds=o.clipBounds[n],this._vao.draw(e.TRIANGLES,this._vertexCount));this._vao.unbind()}if(o.showContour){var s=this._contourPickShader;s.bind(),s.uniforms=r;var l=this._contourVAO;for(l.bind(),a=0;a<3;++a)for(e.lineWidth(this.contourWidth[a]),s.uniforms.permutation=A[a],n=0;n<this.contourLevels[a].length;++n)this._contourCounts[a][n]&&(s.uniforms.height=this.contourLevels[a][n],l.draw(e.LINES,this._contourCounts[a][n],this._contourOffsets[a][n]));for(n=0;n<3;++n)for(s.uniforms.model=o.projections[n],s.uniforms.clipBounds=o.clipBounds[n],a=0;a<3;++a)if(this.contourProject[n][a]){s.uniforms.permutation=A[a],e.lineWidth(this.contourWidth[a]);for(var c=0;c<this.contourLevels[a].length;++c)this._contourCounts[a][c]&&(s.uniforms.height=this.contourLevels[a][c],l.draw(e.LINES,this._contourCounts[a][c],this._contourOffsets[a][c]))}l.unbind()}},S.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 c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var f=u?a:1-a,h=0;h<2;++h)for(var d=i+u,p=s+h,v=f*(h?l:1-l),g=0;g<3;++g)c[g]+=this._field[g].get(d,p)*v;for(var y=this._pickResult.level,b=0;b<3;++b)if(y[b]=m.le(this.contourLevels[b],c[b]),y[b]<0)this.contourLevels[b].length>0&&(y[b]=0);else if(y[b]<this.contourLevels[b].length-1){var x=this.contourLevels[b][y[b]],_=this.contourLevels[b][y[b]+1];Math.abs(x-c[b])>Math.abs(_-c[b])&&(y[b]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],g=0;g<3;++g)r.dataCoordinate[g]=this._field[g].get(r.index[0],r.index[1]);return r},S.update=function(t){t=t||{},this.dirty=!0,"contourWidth"in t&&(this.contourWidth=F(t.contourWidth,Number)),"showContour"in t&&(this.showContour=F(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=F(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=B(t.contourColor)),"contourProject"in t&&(this.contourProject=F(t.contourProject,function(t){return F(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=B(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=F(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=F(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0);var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var i=(e.shape[0]+2)*(e.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=f(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),N(this._field[2],e),this.shape=e.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var d=t.coords;if(!Array.isArray(d)||3!==d.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var p=d[o];for(x=0;x<2;++x)if(p.shape[x]!==a[x])throw new Error("gl-surface: coords have incorrect shape");N(this._field[o],p)}}else if(t.ticks){var m=t.ticks;if(!Array.isArray(m)||2!==m.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var g=m[o];if((Array.isArray(g)||g.length)&&(g=f(g)),g.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var y=f(g.data,a);y.stride[o]=g.stride[0],y.stride[1^o]=0,N(this._field[o],y)}}else{for(o=0;o<2;++o){var b=[0,0];b[o]=1,this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2],b,0)}this._field[0].set(0,0,0);for(var x=0;x<a[0];++x)this._field[0].set(x+1,0,x);for(this._field[0].set(a[0]+1,0,a[0]-1),this._field[1].set(0,0,0),x=0;x<a[1];++x)this._field[1].set(0,x+1,x);this._field[1].set(0,a[1]+1,a[1]-1)}var _=this._field,w=f(s.mallocFloat(3*_[2].size*2),[3,a[0]+2,a[1]+2,2]);for(o=0;o<3;++o)v(w.pick(o),_[o],"mirror");var M=f(s.mallocFloat(3*_[2].size),[a[0]+2,a[1]+2,3]);for(o=0;o<a[0]+2;++o)for(x=0;x<a[1]+2;++x){var A=w.get(0,o,x,0),E=w.get(0,o,x,1),S=w.get(1,o,x,0),L=w.get(1,o,x,1),C=w.get(2,o,x,0),P=w.get(2,o,x,1),z=S*P-L*C,O=C*E-P*A,D=A*L-E*S,I=Math.sqrt(z*z+O*O+D*D);I<1e-8?(I=Math.max(Math.abs(z),Math.abs(O),Math.abs(D)))<1e-8?(D=1,O=z=0,I=1):I=1/I:I=1/Math.sqrt(I),M.set(o,x,0,z*I),M.set(o,x,1,O*I),M.set(o,x,2,D*I)}s.free(w.data);var R=[1/0,1/0,1/0],j=[-1/0,-1/0,-1/0],U=1/0,V=-1/0,q=(a[0]-1)*(a[1]-1)*6,H=s.mallocFloat(n.nextPow2(10*q)),G=0,Y=0;for(o=0;o<a[0]-1;++o)t:for(x=0;x<a[1]-1;++x){for(var W=0;W<2;++W)for(var X=0;X<2;++X)for(var Z=0;Z<3;++Z){var J=this._field[Z].get(1+o+W,1+x+X);if(isNaN(J)||!isFinite(J))continue t}for(Z=0;Z<6;++Z){var K=o+k[Z][0],Q=x+k[Z][1],$=this._field[0].get(K+1,Q+1),tt=this._field[1].get(K+1,Q+1),et=J=this._field[2].get(K+1,Q+1);z=M.get(K+1,Q+1,0),O=M.get(K+1,Q+1,1),D=M.get(K+1,Q+1,2),t.intensity&&(et=t.intensity.get(K,Q)),H[G++]=K,H[G++]=Q,H[G++]=$,H[G++]=tt,H[G++]=J,H[G++]=0,H[G++]=et,H[G++]=z,H[G++]=O,H[G++]=D,R[0]=Math.min(R[0],$),R[1]=Math.min(R[1],tt),R[2]=Math.min(R[2],J),U=Math.min(U,et),j[0]=Math.max(j[0],$),j[1]=Math.max(j[1],tt),j[2]=Math.max(j[2],J),V=Math.max(V,et),Y+=1}}for(t.intensityBounds&&(U=+t.intensityBounds[0],V=+t.intensityBounds[1]),o=6;o<G;o+=10)H[o]=(H[o]-U)/(V-U);this._vertexCount=Y,this._coordinateBuffer.update(H.subarray(0,G)),s.freeFloat(H),s.free(M.data),this.bounds=[R,j],this.intensity=t.intensity||this._field[2],this.intensityBounds[0]===U&&this.intensityBounds[1]===V||(r=!0),this.intensityBounds=[U,V]}if("levels"in t){var rt=t.levels;for(rt=Array.isArray(rt[0])?rt.slice():[[],[],rt],o=0;o<3;++o)rt[o]=rt[o].slice(),rt.sort(function(t,e){return t-e});t:for(o=0;o<3;++o){if(rt[o].length!==this.contourLevels[o].length){r=!0;break}for(x=0;x<rt[o].length;++x)if(rt[o][x]!==this.contourLevels[o][x]){r=!0;break t}}this.contourLevels=rt}if(r){_=this._field,a=this.shape;for(var nt=[],it=0;it<3;++it){rt=this.contourLevels[it];var at=[],ot=[],st=[0,0,0];for(o=0;o<rt.length;++o){var lt=h(this._field[it],rt[o]);at.push(nt.length/5|0),Y=0;t:for(x=0;x<lt.cells.length;++x){var ct=lt.cells[x];for(Z=0;Z<2;++Z){var ut=lt.positions[ct[Z]],ft=ut[0],ht=0|Math.floor(ft),dt=ft-ht,pt=ut[1],mt=0|Math.floor(pt),vt=pt-mt,gt=!1;e:for(var yt=0;yt<3;++yt){st[yt]=0;var bt=(it+yt+1)%3;for(W=0;W<2;++W){var xt=W?dt:1-dt;for(K=0|Math.min(Math.max(ht+W,0),a[0]),X=0;X<2;++X){var _t=X?vt:1-vt;if(Q=0|Math.min(Math.max(mt+X,0),a[1]),J=yt<2?this._field[bt].get(K,Q):(this.intensity.get(K,Q)-this.intensityBounds[0])/(this.intensityBounds[1]-this.intensityBounds[0]),!isFinite(J)||isNaN(J)){gt=!0;break e}var wt=xt*_t;st[yt]+=wt*J}}}if(gt){if(Z>0){for(var Mt=0;Mt<5;++Mt)nt.pop();Y-=1}continue t}nt.push(st[0],st[1],ut[0],ut[1],st[2]),Y+=1}}ot.push(Y)}this._contourOffsets[it]=at,this._contourCounts[it]=ot}var kt=s.mallocFloat(nt.length);for(o=0;o<nt.length;++o)kt[o]=nt[o];this._contourBuffer.update(kt),s.freeFloat(kt)}t.colormap&&this._colorMap.setPixels(function(t){var e=u([l({colormap:t,nshades:T,format:"rgba"}).map(function(t){return[t[0],t[1],t[2],255*t[3]]})]);return c.divseq(e,255),e}(t.colormap))},S.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)s.freeFloat(this._field[t].data)},S.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=s.mallocFloat(12*i[0]*i[1]),o=0;o<3;++o)if(this.enableDynamic[o]){this.dynamicLevel[o]=r[o];var l=(o+1)%3,c=(o+2)%3,u=this._field[o],f=this._field[l],d=this._field[c],p=(this.intensity,h(u,r[o])),m=p.cells,v=p.positions;for(this._dynamicOffsets[o]=n,e=0;e<m.length;++e)for(var g=m[e],y=0;y<2;++y){var b=v[g[y]],x=+b[0],_=0|x,w=0|Math.min(_+1,i[0]),M=x-_,k=1-M,A=+b[1],T=0|A,E=0|Math.min(T+1,i[1]),S=A-T,L=1-S,C=k*L,P=k*S,z=M*L,O=M*S,D=C*f.get(_,T)+P*f.get(_,E)+z*f.get(w,T)+O*f.get(w,E),I=C*d.get(_,T)+P*d.get(_,E)+z*d.get(w,T)+O*d.get(w,E);if(isNaN(D)||isNaN(I)){y&&(n-=1);break}a[2*n+0]=D,a[2*n+1]=I,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)),s.freeFloat(a)}}},{"./lib/shaders":230,"binary-search-bounds":70,"bit-twiddle":71,colormap:105,"gl-buffer":165,"gl-mat4/invert":186,"gl-mat4/multiply":188,"gl-texture2d":233,"gl-vao":237,ndarray:439,"ndarray-gradient":430,"ndarray-ops":433,"ndarray-pack":434,"surface-nets":520,"typedarray-pool":534}],233:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("ndarray-ops"),a=t("typedarray-pool");e.exports=function(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");o||function(t){o=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],s=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],l=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}(t);if("number"==typeof arguments[1])return v(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return v(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1],r=c(e)?e:e.raw;if(r)return function(t,e,r,n,i,a){var o=m(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,a,e),new h(t,o,r,n,i,a)}(t,r,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return function(t,e){var r=e.dtype,o=e.shape.slice(),s=t.getParameter(t.MAX_TEXTURE_SIZE);if(o[0]<0||o[0]>s||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=p(o,e.stride.slice()),c=0;"float32"===r?c=t.FLOAT:"float64"===r?(c=t.FLOAT,l=!1,r="float32"):"uint8"===r?c=t.UNSIGNED_BYTE:(c=t.UNSIGNED_BYTE,l=!1,r="uint8");var f,d,v=0;if(2===o.length)v=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])v=t.ALPHA;else if(2===o[2])v=t.LUMINANCE_ALPHA;else if(3===o[2])v=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");v=t.RGBA}}c!==t.FLOAT||t.getExtension("OES_texture_float")||(c=t.UNSIGNED_BYTE,l=!1);var g=e.size;if(l)f=0===e.offset&&e.data.length===g?e.data:e.data.subarray(e.offset,e.offset+g);else{var y=[o[2],o[2]*o[0],1];d=a.malloc(g,r);var b=n(d,o,y,0);"float32"!==r&&"float64"!==r||c!==t.UNSIGNED_BYTE?i.assign(b,e):u(b,e),f=d.subarray(0,g)}var x=m(t);t.texImage2D(t.TEXTURE_2D,0,v,o[0],o[1],0,v,c,f),l||a.free(d);return new h(t,x,o[0],o[1],v,c)}(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function c(t){return"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement||"undefined"!=typeof ImageData&&t instanceof ImageData}var u=function(t,e){i.muls(t,e,255)};function f(t,e,r){var n=t.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function h(t,e,r,n,i,a){this.gl=t,this.handle=e,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}var d=h.prototype;function p(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 m(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 v(t,e,r,n,i){var a=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=m(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new h(t,o,e,r,n,i)}Object.defineProperties(d,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(l.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return f(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return f(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,f(this,this._shape[0],t),t}}}),d.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},d.dispose=function(){this.gl.deleteTexture(this.handle)},d.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)},d.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=c(t)?t:t.raw;if(l){this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l)}else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,o,s,l,c,f){var h=f.dtype,d=f.shape.slice();if(d.length<2||d.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var m=0,v=0,g=p(d,f.stride.slice());"float32"===h?m=t.FLOAT:"float64"===h?(m=t.FLOAT,g=!1,h="float32"):"uint8"===h?m=t.UNSIGNED_BYTE:(m=t.UNSIGNED_BYTE,g=!1,h="uint8");if(2===d.length)v=t.LUMINANCE,d=[d[0],d[1],1],f=n(f.data,d,[f.stride[0],f.stride[1],1],f.offset);else{if(3!==d.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===d[2])v=t.ALPHA;else if(2===d[2])v=t.LUMINANCE_ALPHA;else if(3===d[2])v=t.RGB;else{if(4!==d[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");v=t.RGBA}d[2]}v!==t.LUMINANCE&&v!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(v=s);if(v!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=f.size,b=c.indexOf(o)<0;b&&c.push(o);if(m===l&&g)0===f.offset&&f.data.length===y?b?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,f.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,f.data):b?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,f.data.subarray(f.offset,f.offset+y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,f.data.subarray(f.offset,f.offset+y));else{var x;x=l===t.FLOAT?a.mallocFloat32(y):a.mallocUint8(y);var _=n(x,d,[d[2],d[2]*d[0],1]);m===t.FLOAT&&l===t.UNSIGNED_BYTE?u(_,f):i.assign(_,f),b?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,x.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,x.subarray(0,y)),l===t.FLOAT?a.freeFloat32(x):a.freeUint8(x)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},{ndarray:439,"ndarray-ops":433,"typedarray-pool":534}],234:[function(t,e,r){"use strict";e.exports=function(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i<r.length;++i){var a=r[i];if(a.buffer){var o=a.buffer,s=a.size||4,l=a.type||t.FLOAT,c=!!a.normalized,u=a.stride||0,f=a.offset||0;o.bind(),t.enableVertexAttribArray(i),t.vertexAttribPointer(i,s,l,c,u,f)}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 for(t.bindBuffer(t.ARRAY_BUFFER,null),i=0;i<n;++i)t.disableVertexAttribArray(i)}},{}],235:[function(t,e,r){"use strict";var n=t("./do-bind.js");function i(t){this.gl=t,this._elements=null,this._attributes=null,this._elementsType=t.UNSIGNED_SHORT}i.prototype.bind=function(){n(this.gl,this._elements,this._attributes)},i.prototype.update=function(t,e,r){this._elements=e,this._attributes=t,this._elementsType=r||this.gl.UNSIGNED_SHORT},i.prototype.dispose=function(){},i.prototype.unbind=function(){},i.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=function(t){return new i(t)}},{"./do-bind.js":234}],236:[function(t,e,r){"use strict";var n=t("./do-bind.js");function i(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 a(t,e,r){this.gl=t,this._ext=e,this.handle=r,this._attribs=[],this._useElements=!1,this._elementsType=t.UNSIGNED_SHORT}i.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)}},a.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var t=0;t<this._attribs.length;++t)this._attribs[t].bind(this.gl)},a.prototype.unbind=function(){this._ext.bindVertexArrayOES(null)},a.prototype.dispose=function(){this._ext.deleteVertexArrayOES(this.handle)},a.prototype.update=function(t,e,r){if(this.bind(),n(this.gl,e,t),this.unbind(),this._attribs.length=0,t)for(var a=0;a<t.length;++a){var o=t[a];"number"==typeof o?this._attribs.push(new i(a,1,o)):Array.isArray(o)&&this._attribs.push(new i(a,o.length,o[0],o[1],o[2],o[3]))}this._useElements=!!e,this._elementsType=r||this.gl.UNSIGNED_SHORT},a.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=function(t,e){return new a(t,e,e.createVertexArrayOES())}},{"./do-bind.js":234}],237:[function(t,e,r){"use strict";var n=t("./lib/vao-native.js"),i=t("./lib/vao-emulated.js");e.exports=function(t,e,r,a){var o,s=t.createVertexArray?new function(t){this.bindVertexArrayOES=t.bindVertexArray.bind(t),this.createVertexArrayOES=t.createVertexArray.bind(t),this.deleteVertexArrayOES=t.deleteVertexArray.bind(t)}(t):t.getExtension("OES_vertex_array_object");return(o=s?n(t,s):i(t)).update(e,r,a),o}},{"./lib/vao-emulated.js":235,"./lib/vao-native.js":236}],238:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}},{}],239:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},{}],240:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}},{}],241:[function(t,e,r){e.exports=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}},{}],242:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a);return t}},{}],243:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}},{}],244:[function(t,e,r){e.exports=function(t,e,r,a){return n[0]=a,n[1]=r,n[2]=e,n[3]=t,i[0]};var n=new Uint8Array(4),i=new Float32Array(n.buffer)},{}],245:[function(t,e,r){var n=t("glsl-tokenizer"),i=t("atob-lite");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r<e.length;r++){var a=e[r];if("preprocessor"===a.type){var o=a.data.match(/\#define\s+SHADER_NAME(_B64)?\s+(.+)$/);if(o&&o[2]){var s=o[1],l=o[2];return(s?i(l):l).trim()}}}}},{"atob-lite":52,"glsl-tokenizer":252}],246:[function(t,e,r){e.exports=function(t){var e,r,M,k=0,A=0,T=l,E=[],S=[],L=1,C=0,P=0,z=!1,O=!1,D="",I=a,R=n;"300 es"===(t=t||{}).version&&(I=s,R=o);return function(t){return S=[],null!==t?function(t){var r;k=0,M=(D+=t).length;for(;e=D[k],k<M;){switch(r=k,T){case u:k=U();break;case f:case h:k=B();break;case d:k=V();break;case p:k=G();break;case _:k=H();break;case m:k=Y();break;case c:k=W();break;case b:k=j();break;case l:k=F()}if(r!==k)switch(D[r]){case"\n":C=0,++L;break;default:++C}}return A+=k,D=D.slice(k),S}(t.replace?t.replace(/\r\n/g,"\n"):t):function(t){E.length&&N(E.join(""));return T=x,N("(eof)"),S}()};function N(t){t.length&&S.push({type:w[T],data:t,position:P,line:L,column:C})}function F(){return E=E.length?[]:E,"/"===r&&"*"===e?(P=A+k-1,T=u,r=e,k+1):"/"===r&&"/"===e?(P=A+k-1,T=f,r=e,k+1):"#"===e?(T=h,P=A+k,k):/\s/.test(e)?(T=b,P=A+k,k):(z=/\d/.test(e),O=/[^\w_]/.test(e),P=A+k,T=z?p:O?d:c,k)}function j(){return/[^\s]/g.test(e)?(N(E.join("")),T=l,k):(E.push(e),r=e,k+1)}function B(){return"\r"!==e&&"\n"!==e||"\\"===r?(E.push(e),r=e,k+1):(N(E.join("")),T=l,k)}function U(){return"/"===e&&"*"===r?(E.push(e),N(E.join("")),T=l,k+1):(E.push(e),r=e,k+1)}function V(){if("."===r&&/\d/.test(e))return T=m,k;if("/"===r&&"*"===e)return T=u,k;if("/"===r&&"/"===e)return T=f,k;if("."===e&&E.length){for(;q(E););return T=m,k}if(";"===e||")"===e||"("===e){if(E.length)for(;q(E););return N(e),T=l,k+1}var t=2===E.length&&"="!==e;if(/[\w_\d\s]/.test(e)||t){for(;q(E););return T=l,k}return E.push(e),r=e,k+1}function q(t){for(var e,r,n=0;;){if(e=i.indexOf(t.slice(0,t.length+n).join("")),r=i[e],-1===e){if(n--+t.length>0)continue;r=t.slice(0,1).join("")}return N(r),P+=r.length,(E=E.slice(r.length)).length}}function H(){return/[^a-fA-F0-9]/.test(e)?(N(E.join("")),T=l,k):(E.push(e),r=e,k+1)}function G(){return"."===e?(E.push(e),T=m,r=e,k+1):/[eE]/.test(e)?(E.push(e),T=m,r=e,k+1):"x"===e&&1===E.length&&"0"===E[0]?(T=_,E.push(e),r=e,k+1):/[^\d]/.test(e)?(N(E.join("")),T=l,k):(E.push(e),r=e,k+1)}function Y(){return"f"===e&&(E.push(e),r=e,k+=1),/[eE]/.test(e)?(E.push(e),r=e,k+1):"-"===e&&/[eE]/.test(r)?(E.push(e),r=e,k+1):/[^\d]/.test(e)?(N(E.join("")),T=l,k):(E.push(e),r=e,k+1)}function W(){if(/[^\d\w_]/.test(e)){var t=E.join("");return T=R.indexOf(t)>-1?y:I.indexOf(t)>-1?g:v,N(E.join("")),T=l,k}return E.push(e),r=e,k+1}};var n=t("./lib/literals"),i=t("./lib/operators"),a=t("./lib/builtins"),o=t("./lib/literals-300es"),s=t("./lib/builtins-300es"),l=999,c=9999,u=0,f=1,h=2,d=3,p=4,m=5,v=6,g=7,y=8,b=9,x=10,_=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":248,"./lib/builtins-300es":247,"./lib/literals":250,"./lib/literals-300es":249,"./lib/operators":251}],247:[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":248}],248:[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"]},{}],249:[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":250}],250:[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"]},{}],251:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],252:[function(t,e,r){var n=t("./index");e.exports=function(t,e){var r=n(e),i=[];return i=(i=i.concat(r(t))).concat(r(null))}},{"./index":246}],253:[function(t,e,r){arguments[4][169][0].apply(r,arguments)},{dup:169}],254:[function(t,e,r){"use strict";e.exports=i;var n=3;function i(t,e,r){var i=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[n+o],l=a[n+o+1];i.push(s===l?null:a.subarray(s,l))}var c=a[n+i.length],u=a[n+i.length+1];this.keys=a.subarray(c,u),this.bboxes=a.subarray(u),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var f=0;f<this.d*this.d;f++)i.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var h=r/e*t;this.min=-h,this.max=t+h}i.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)},i.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},i.prototype._insertCell=function(t,e,r,n,i,a){this.cells[i].push(a)},i.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=[];return this._forEachCell(t,e,r,n,this._queryCell,o,{}),o},i.prototype._queryCell=function(t,e,r,n,i,a,o){var s=this.cells[i];if(null!==s)for(var l=this.keys,c=this.bboxes,u=0;u<s.length;u++){var f=s[u];if(void 0===o[f]){var h=4*f;t<=c[h+2]&&e<=c[h+3]&&r>=c[h+0]&&n>=c[h+1]?(o[f]=!0,a.push(l[f])):o[f]=!1}}},i.prototype._forEachCell=function(t,e,r,n,i,a,o){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),c=this._convertToCellCoord(r),u=this._convertToCellCoord(n),f=s;f<=c;f++)for(var h=l;h<=u;h++){var d=this.d*h+f;if(i.call(this,t,e,r,n,d,a,o))return}},i.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},i.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=n+this.cells.length+1+1,r=0,i=0;i<this.cells.length;i++)r+=this.cells[i].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[n+s]=o,a.set(l,o),o+=l.length}return a[n+t.length]=o,a.set(this.keys,o),o+=this.keys.length,a[n+t.length+1]=o,a.set(this.bboxes,o),o+=this.bboxes.length,a.buffer}},{}],255:[function(t,e,r){(function(r){"use strict";var n,i=t("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:i,e.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":262}],256:[function(t,e,r){"use strict";var n=t("is-browser");e.exports=n&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}()},{"is-browser":262}],257:[function(t,e,r){r.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,c=l>>1,u=-7,f=r?i-1:0,h=r?-1:1,d=t[e+f];for(f+=h,a=d&(1<<-u)-1,d>>=-u,u+=s;u>0;a=256*a+t[e+f],f+=h,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+f],f+=h,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<<c)-1,f=u>>1,h=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=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=u?(s=0,o=u):o+f>=1?(s=(e*l-1)*Math.pow(2,i),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;t[r+d]=255&o,d+=p,o/=256,c-=8);t[r+d-p]|=128*m}},{}],258:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.length;if(0===r)throw new Error("Must have at least d+1 points");var i=t[0].length;if(r<=i)throw new Error("Must input at least d+1 points");var o=t.slice(0,i+1),s=n.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var l=new Array(i+1),u=0;u<=i;++u)l[u]=u;s<0&&(l[0]=1,l[1]=0);for(var f=new a(l,new Array(i+1),!1),h=f.adjacent,d=new Array(i+2),u=0;u<=i;++u){for(var p=l.slice(),m=0;m<=i;++m)m===u&&(p[m]=-1);var v=p[0];p[0]=p[1],p[1]=v;var g=new a(p,new Array(i+1),!0);h[u]=g,d[u]=g}d[i+1]=f;for(var u=0;u<=i;++u)for(var p=h[u].vertices,y=h[u].adjacent,m=0;m<=i;++m){var b=p[m];if(b<0)y[m]=f;else for(var x=0;x<=i;++x)h[x].vertices.indexOf(b)<0&&(y[m]=h[x])}for(var _=new c(i,o,d),w=!!e,u=i+1;u<r;++u)_.insert(t[u],w);return _.boundary()};var n=t("robust-orientation"),i=t("simplicial-complex").compareCells;function a(t,e,r){this.vertices=t,this.adjacent=e,this.boundary=r,this.lastVisited=-1}function o(t,e,r){this.vertices=t,this.cell=e,this.index=r}function s(t,e){return i(t.vertices,e.vertices)}a.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 l=[];function c(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 i=0;i<=t;++i)this.tuple[i]=this.vertices[i];var a=l[t];a||(a=l[t]=function(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 i=new Function("test",e.join("")),a=n[t+1];return a||(a=n),i(a)}(t)),this.orient=a}var u=c.prototype;u.handleBoundaryDegeneracy=function(t,e){var r=this.dimension,n=this.vertices.length-1,i=this.tuple,a=this.vertices,o=[t];for(t.lastVisited=-n;o.length>0;){(t=o.pop()).vertices;for(var s=t.adjacent,l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,f=0;f<=r;++f){var h=u[f];i[f]=h<0?e:a[h]}var d=this.orient();if(d>0)return c;c.lastVisited=-n,0===d&&o.push(c)}}}return null},u.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,c=s.adjacent,u=0;u<=n;++u)a[u]=i[l[u]];s.lastVisited=r;for(u=0;u<=n;++u){var f=c[u];if(!(f.lastVisited>=r)){var h=a[u];a[u]=t;var d=this.orient();if(a[u]=h,d<0){s=f;continue t}f.boundary?f.lastVisited=-r:f.lastVisited=r}}return}return s},u.addPeaks=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,f=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,c.push(e);for(var h=[];f.length>0;){var d=(e=f.pop()).vertices,p=e.adjacent,m=d.indexOf(r);if(!(m<0))for(var v=0;v<=n;++v)if(v!==m){var g=p[v];if(g.boundary&&!(g.lastVisited>=r)){var y=g.vertices;if(g.lastVisited!==-r){for(var b=0,x=0;x<=n;++x)y[x]<0?(b=x,l[x]=t):l[x]=i[y[x]];if(this.orient()>0){y[b]=r,g.boundary=!1,c.push(g),f.push(g),g.lastVisited=r;continue}g.lastVisited=-r}var _=g.adjacent,w=d.slice(),M=p.slice(),k=new a(w,M,!0);u.push(k);var A=_.indexOf(e);if(!(A<0)){_[A]=k,M[m]=g,w[v]=-1,M[v]=e,p[v]=k,k.flip();for(x=0;x<=n;++x){var T=w[x];if(!(T<0||T===r)){for(var E=new Array(n-1),S=0,L=0;L<=n;++L){var C=w[L];C<0||L===x||(E[S++]=C)}h.push(new o(E,k,x))}}}}}}h.sort(s);for(v=0;v+1<h.length;v+=2){var P=h[v],z=h[v+1],O=P.index,D=z.index;O<0||D<0||(P.cell.adjacent[P.index]=z.cell,z.cell.adjacent[z.index]=P.cell)}},u.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];a[o]=s<0?t:r[s]}var l=this.orient(a);l<0||(0!==l||(n=this.handleBoundaryDegeneracy(n,t)))&&this.addPeaks(t,n)}},u.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,c=0,u=0;u<=t;++u)s[u]>=0?o[l++]=s[u]:c=1&u;if(c===(1&t)){var f=o[0];o[0]=o[1],o[1]=f}e.push(o)}}return e}},{"robust-orientation":495,"simplicial-complex":506}],259:[function(t,e,r){"use strict";var n=t("binary-search-bounds"),i=0,a=1;function o(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}e.exports=function(t){if(!t||0===t.length)return new b(null);return new b(y(t))};var s=o.prototype;function l(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function c(t,e){var r=y(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function u(t,e){var r=t.intervals([]);r.push(e),c(t,r)}function f(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?i:(r.splice(n,1),c(t,r),a)}function h(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 d(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 p(t,e){for(var r=0;r<t.length;++r){var n=e(t[r]);if(n)return n}}function m(t,e){return t-e}function v(t,e){var r=t[0]-e[0];return r||t[1]-e[1]}function g(t,e){var r=t[1]-e[1];return r||t[0]-e[0]}function y(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(m);var n=e[e.length>>1],i=[],a=[],s=[];for(r=0;r<t.length;++r){var l=t[r];l[1]<n?i.push(l):n<l[0]?a.push(l):s.push(l)}var c=s,u=s.slice();return c.sort(v),u.sort(g),new o(n,y(i),y(a),c,u)}function b(t){this.root=t}s.intervals=function(t){return t.push.apply(t,this.leftPoints),this.left&&this.left.intervals(t),this.right&&this.right.intervals(t),t},s.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)?u(this,t):this.left.insert(t):this.left=y([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?u(this,t):this.right.insert(t):this.right=y([t]);else{var r=n.ge(this.leftPoints,t,v),i=n.ge(this.rightPoints,t,g);this.leftPoints.splice(r,0,t),this.rightPoints.splice(i,0,t)}},s.remove=function(t){var e=this.count-this.leftPoints;if(t[1]<this.mid){return this.left?4*(this.right?this.right.count:0)>3*(e-1)?f(this,t):2===(c=this.left.remove(t))?(this.left=null,this.count-=1,a):(c===a&&(this.count-=1),c):i}else{if(!(t[0]>this.mid)){if(1===this.count)return this.leftPoints[0]===t?2:i;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,o=this.left;o.right;)r=o,o=o.right;if(r===this)o.right=this.right;else{var s=this.left;c=this.right;r.count-=o.count,r.right=o.left,o.left=s,o.right=c}l(this,o),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?l(this,this.left):l(this,this.right);return a}for(s=n.ge(this.leftPoints,t,v);s<this.leftPoints.length&&this.leftPoints[s][0]===t[0];++s)if(this.leftPoints[s]===t){this.count-=1,this.leftPoints.splice(s,1);for(c=n.ge(this.rightPoints,t,g);c<this.rightPoints.length&&this.rightPoints[c][1]===t[1];++c)if(this.rightPoints[c]===t)return this.rightPoints.splice(c,1),a}return i}return this.right?4*(this.left?this.left.count:0)>3*(e-1)?f(this,t):2===(c=this.right.remove(t))?(this.right=null,this.count-=1,a):(c===a&&(this.count-=1),c):i;var c}},s.queryPoint=function(t,e){if(t<this.mid){if(this.left)if(r=this.left.queryPoint(t,e))return r;return h(this.leftPoints,t,e)}if(t>this.mid){var r;if(this.right)if(r=this.right.queryPoint(t,e))return r;return d(this.rightPoints,t,e)}return p(this.leftPoints,e)},s.queryInterval=function(t,e,r){var n;if(t<this.mid&&this.left&&(n=this.left.queryInterval(t,e,r)))return n;if(e>this.mid&&this.right&&(n=this.right.queryInterval(t,e,r)))return n;return e<this.mid?h(this.leftPoints,e,r):t>this.mid?d(this.rightPoints,t,r):p(this.leftPoints,r)};var x=b.prototype;x.insert=function(t){this.root?this.root.insert(t):this.root=new o(t[0],null,null,[t],[t])},x.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),e!==i}return!1},x.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},x.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(x,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(x,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":70}],260:[function(t,e,r){"use strict";e.exports=function(t,e){e=e||new Array(t.length);for(var r=0;r<t.length;++r)e[t[r]]=r;return e}},{}],261:[function(t,e,r){"use strict";e.exports=function(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=r;return e}},{}],262:[function(t,e,r){e.exports=!0},{}],263:[function(t,e,r){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}e.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},{}],264:[function(t,e,r){"use strict";e.exports="undefined"!=typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))},{}],265:[function(t,e,r){e.exports=function(t){t||"undefined"==typeof navigator||(t=navigator.userAgent);t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]);return"string"==typeof t&&(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))}},{}],266:[function(t,e,r){"use strict";var n=Object.prototype.toString;e.exports=function(t){var e;return"[object Object]"===n.call(t)&&(null===(e=Object.getPrototypeOf(t))||e===Object.getPrototypeOf({}))}},{}],267:[function(t,e,r){"use strict";e.exports=function(t){return"string"==typeof t&&(t=t.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(t)&&/[\dz]$/i.test(t)&&t.length>4))}},{}],268:[function(t,e,r){"use strict";var n=t("./sort"),i=t("./range"),a=t("./within");function o(t,e,r,i,a){e=e||s,r=r||l,a=a||Array,this.nodeSize=i||64,this.points=t,this.ids=new a(t.length),this.coords=new a(2*t.length);for(var o=0;o<t.length;o++)this.ids[o]=o,this.coords[2*o]=e(t[o]),this.coords[2*o+1]=r(t[o]);n(this.ids,this.coords,this.nodeSize,0,this.ids.length-1,0)}function s(t){return t[0]}function l(t){return t[1]}e.exports=function(t,e,r,n,i){return new o(t,e,r,n,i)},o.prototype={range:function(t,e,r,n){return i(this.ids,this.coords,t,e,r,n,this.nodeSize)},within:function(t,e,r){return a(this.ids,this.coords,t,e,r,this.nodeSize)}}},{"./range":269,"./sort":270,"./within":271}],269:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a,o){var s,l,c=[0,t.length-1,0],u=[];for(;c.length;){var f=c.pop(),h=c.pop(),d=c.pop();if(h-d<=o)for(var p=d;p<=h;p++)s=e[2*p],l=e[2*p+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(t[p]);else{var m=Math.floor((d+h)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(t[m]);var v=(f+1)%2;(0===f?r<=s:n<=l)&&(c.push(d),c.push(m-1),c.push(v)),(0===f?i>=s:a>=l)&&(c.push(m+1),c.push(h),c.push(v))}}return u}},{}],270:[function(t,e,r){"use strict";function n(t,e,r,n){i(t,r,n),i(e,2*r,2*n),i(e,2*r+1,2*n+1)}function i(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=function t(e,r,i,a,o,s){if(o-a<=i)return;var l=Math.floor((a+o)/2);!function t(e,r,i,a,o,s){for(;o>a;){if(o-a>600){var l=o-a+1,c=i-a+1,u=Math.log(l),f=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1),d=Math.max(a,Math.floor(i-c*f/l+h)),p=Math.min(o,Math.floor(i+(l-c)*f/l+h));t(e,r,i,d,p,s)}var m=r[2*i+s],v=a,g=o;for(n(e,r,a,i),r[2*o+s]>m&&n(e,r,a,o);v<g;){for(n(e,r,v,g),v++,g--;r[2*v+s]<m;)v++;for(;r[2*g+s]>m;)g--}r[2*a+s]===m?n(e,r,a,g):n(e,r,++g,o),g<=i&&(a=g+1),i<=g&&(o=g-1)}}(e,r,l,a,o,s%2);t(e,r,i,a,l-1,s+1);t(e,r,i,l+1,o,s+1)}},{}],271:[function(t,e,r){"use strict";function n(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}e.exports=function(t,e,r,i,a,o){var s=[0,t.length-1,0],l=[],c=a*a;for(;s.length;){var u=s.pop(),f=s.pop(),h=s.pop();if(f-h<=o)for(var d=h;d<=f;d++)n(e[2*d],e[2*d+1],r,i)<=c&&l.push(t[d]);else{var p=Math.floor((h+f)/2),m=e[2*p],v=e[2*p+1];n(m,v,r,i)<=c&&l.push(t[p]);var g=(u+1)%2;(0===u?r-a<=m:i-a<=v)&&(s.push(h),s.push(p-1),s.push(g)),(0===u?r+a>=m:i+a>=v)&&(s.push(p+1),s.push(f),s.push(g))}}return l}},{}],272:[function(t,e,r){"use strict";function n(t,e){if(!(this instanceof n))return new n(t,e);this.nodeSize=e||64,this.coords=t.slice();var r=Math.floor(t.length/2);this.ids=Array(r);for(var i=0;i<r;i++)this.ids[i]=i;!function t(e,r,n,i,o,s){if(o-i<=n)return;var l=Math.floor((i+o)/2);!function t(e,r,n,i,o,s){for(;o>i;){if(o-i>600){var l=o-i+1,c=n-i+1,u=Math.log(l),f=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1),d=Math.max(i,Math.floor(n-c*f/l+h)),p=Math.min(o,Math.floor(n+(l-c)*f/l+h));t(e,r,n,d,p,s)}var m=r[2*n+s],v=i,g=o;for(a(e,r,i,n),r[2*o+s]>m&&a(e,r,i,o);v<g;){for(a(e,r,v,g),v++,g--;r[2*v+s]<m;)v++;for(;r[2*g+s]>m;)g--}r[2*i+s]===m?a(e,r,i,g):a(e,r,++g,o),g<=n&&(i=g+1),n<=g&&(o=g-1)}}(e,r,l,i,o,s%2);t(e,r,n,i,l-1,s+1);t(e,r,n,l+1,o,s+1)}(this.ids,this.coords,this.nodeSize,0,this.ids.length-1,0)}function i(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}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,n.prototype.range=function(t,e,r,n){for(var i,a,o=this.ids,s=this.coords,l=this.nodeSize,c=[0,o.length-1,0],u=[];c.length;){var f=c.pop(),h=c.pop(),d=c.pop();if(h-d<=l)for(var p=d;p<=h;p++)i=s[2*p],a=s[2*p+1],i>=t&&i<=r&&a>=e&&a<=n&&u.push(o[p]);else{var m=Math.floor((d+h)/2);i=s[2*m],a=s[2*m+1],i>=t&&i<=r&&a>=e&&a<=n&&u.push(o[m]);var v=(f+1)%2;(0===f?t<=i:e<=a)&&(c.push(d),c.push(m-1),c.push(v)),(0===f?r>=i:n>=a)&&(c.push(m+1),c.push(h),c.push(v))}}return u},n.prototype.within=function(t,e,r){for(var n=this.ids,a=this.coords,o=this.nodeSize,s=[0,n.length-1,0],l=[],c=r*r;s.length;){var u=s.pop(),f=s.pop(),h=s.pop();if(f-h<=o)for(var d=h;d<=f;d++)i(a[2*d],a[2*d+1],t,e)<=c&&l.push(n[d]);else{var p=Math.floor((h+f)/2),m=a[2*p],v=a[2*p+1];i(m,v,t,e)<=c&&l.push(n[p]);var g=(u+1)%2;(0===u?t-r<=m:e-r<=v)&&(s.push(h),s.push(p-1),s.push(g)),(0===u?t+r>=m:e+r>=v)&&(s.push(p+1),s.push(f),s.push(g))}}return l}},{}],273:[function(t,e,r){e.exports=function(t,e,r){return t*(1-r)+e*r}},{}],274:[function(t,e,r){"use strict";function n(t,e){var r;if(c(t)){var l,u=t.stops&&"object"==typeof t.stops[0][0],f=u||void 0!==t.property,h=u||!f,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=[],v=0;v<t.stops.length;v++){var g=t.stops[v];void 0===p[g[0].zoom]&&(p[g[0].zoom]={zoom:g[0].zoom,type:t.type,property:t.property,stops:[]}),p[g[0].zoom].stops.push([g[0].value,g[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)}).isFeatureConstant=!1,r.isZoomConstant=!1}else h?((r=function(e){return l(t,e)}).isFeatureConstant=!0,r.isZoomConstant=!1):((r=function(e,r){return l(t,r[t.property])}).isFeatureConstant=!1,r.isZoomConstant=!0)}else(r=function(){return t}).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;!(n>=t.stops.length||e<=t.stops[n][0]);)n++;return 0===n?t.stops[n][1]:n===t.stops.length?t.stops[n-1][1]:function t(e,r,n,i,a,o){return"function"==typeof a?function(){var s=a.apply(void 0,arguments),l=o.apply(void 0,arguments);return t(e,r,n,i,s,l)}:a.length?function(t,e,r,n,i,a){for(var o=[],s=0;s<i.length;s++)o[s]=l(t,e,r,n,i[s],a[s]);return o}(e,r,n,i,a,o):l(e,r,n,i,a,o)}(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){var o,s=n-r,l=t-r;return i*(1-(o=1===e?l/s:(Math.pow(e,l)-1)/(Math.pow(e,s)-1)))+a*o}function c(t){return"object"==typeof t&&(t.stops||"identity"===t.type)}e.exports.isFunctionDefinition=c,e.exports.interpolated=function(t){return n(t,"exponential")},e.exports["piecewise-constant"]=function(t){return n(t,"interval")}},{}],275:[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:449}],276:[function(t,e,r){"use strict";var n=t("util").format;e.exports=function(t,e){this.message=(t?t+": ":"")+n.apply(n,Array.prototype.slice.call(arguments,2)),null!==e&&void 0!==e&&e.__line__&&(this.line=e.__line__)}},{util:543}],277:[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}},{}],278:[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}},{}],279:[function(t,e,r){"use strict";e.exports=function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}},{}],280:[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,c=e.valueSpec,u=e.key,f=e.styleSpec,h=e.style;if("string"===i(l)&&"@"===l[0]){if(f.$version>7)return[new n(u,l,"constants have been deprecated as of v8")];if(!(l in h.constants))return[new n(u,l,'constant "%s" not found',l)];e=a({},e,{value:h.constants[l]})}return c.function&&"object"===i(l)?r(e):c.type&&s[c.type]?s[c.type](e):o(a({},e,{valueSpec:c.type?f[c.type]:c}))}},{"../error/validation_error":276,"../util/extend":277,"../util/get_type":278,"./validate_array":281,"./validate_boolean":282,"./validate_color":283,"./validate_constants":284,"./validate_enum":285,"./validate_filter":286,"./validate_function":287,"./validate_layer":289,"./validate_number":291,"./validate_object":292,"./validate_source":294,"./validate_string":295}],281:[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,c=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 u={type:r.value};s.$version<7&&(u.function=r.function),"object"===n(r.value)&&(u=r.value);for(var f=[],h=0;h<e.length;h++)f=f.concat(c({array:e,arrayIndex:h,value:e[h],valueSpec:u,style:o,styleSpec:s,key:l+"["+h+"]"}));return f}},{"../error/validation_error":276,"../util/get_type":278,"./validate":280}],282:[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":276,"../util/get_type":278}],283:[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":276,"../util/get_type":278,csscolorparser:114}],284:[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;if(t.styleSpec.$version>7)return r?[new n(e,r,"constants have been deprecated as of v8")]:[];var a=i(r);if("object"!==a)return[new n(e,r,"object expected, %s found",a)];var o=[];for(var s in r)"@"!==s[0]&&o.push(new n(e+"."+s,r[s],'constants must start with "@"'));return o}},{"../error/validation_error":276,"../util/get_type":278}],285:[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-1===a.values.indexOf(i(r))&&o.push(new n(e,r,"expected one of [%s], %s found",a.values.join(", "),r)),o}},{"../error/validation_error":276,"../util/unbundle_jsonlint":279}],286:[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,c=e.styleSpec,u=[];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(u=u.concat(i({key:l+"[0]",value:s[0],valueSpec:c.filter_operator,style:e.style,styleSpec:e.styleSpec})),o(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"==s[1]&&u.push(new n(l,s,'"$type" cannot be use with operator "%s"',s[0]));case"==":case"!=":3!=s.length&&u.push(new n(l,s,'filter array for operator "%s" must have 3 elements',s[0]));case"in":case"!in":s.length>=2&&("string"!==(r=a(s[1]))?u.push(new n(l+"[1]",s[1],"string expected, %s found",r)):"@"===s[1][0]&&u.push(new n(l+"[1]",s[1],"filter key cannot be a constant")));for(var f=2;f<s.length;f++)r=a(s[f]),"$type"==s[1]?u=u.concat(i({key:l+"["+f+"]",value:s[f],valueSpec:c.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"===r&&"@"===s[f][0]?u.push(new n(l+"["+f+"]",s[f],"filter value cannot be a constant")):"string"!==r&&"number"!==r&&"boolean"!==r&&u.push(new n(l+"["+f+"]",s[f],"string, number, or boolean expected, %s found",r));break;case"any":case"all":case"none":for(f=1;f<s.length;f++)u=u.concat(t({key:l+"["+f+"]",value:s[f],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":r=a(s[1]),2!==s.length?u.push(new n(l,s,'filter array for "%s" operator must have 2 elements',s[0])):"string"!==r?u.push(new n(l+"[1]",s[1],"string expected, %s found",r)):"@"===s[1][0]&&u.push(new n(l+"[1]",s[1],"filter key cannot be a constant"))}return u}},{"../error/validation_error":276,"../util/get_type":278,"../util/unbundle_jsonlint":279,"./validate_enum":285}],287:[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){var e,r=t.valueSpec,c=void 0!==t.value.property||"object"===e,u=void 0===t.value.property||"object"===e,f=o({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){var e=[],r=t.value;e=e.concat(s({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===i(r)&&0===r.length&&e.push(new n(t.key,r,"array must have at least one stop"));return e}}});return t.styleSpec.$version>=8&&(c&&!t.valueSpec["property-function"]?f.push(new n(t.key,t.value,"property functions not supported")):u&&!t.valueSpec["zoom-function"]&&f.push(new n(t.key,t.value,"zoom functions not supported"))),f;function h(t){var s=[],c=t.value,f=t.key;if("array"!==i(c))return[new n(f,c,"array expected, %s found",i(c))];if(2!==c.length)return[new n(f,c,"array length %d expected, length %d found",2,c.length)];var h=i(c[0]);if(e||(e=h),h!==e)return[new n(f,c,"%s stop key type must match previous stop key type %s",h,e)];if("object"===h){if(void 0===c[0].zoom)return[new n(f,c,"object stop key must have zoom")];if(void 0===c[0].value)return[new n(f,c,"object stop key must have value")];s=s.concat(o({key:f+"[0]",value:c[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:l,value:d}}))}else s=s.concat((u?l:d)({key:f+"[0]",value:c[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec}));return s=s.concat(a({key:f+"[1]",value:c[1],valueSpec:r,style:t.style,styleSpec:t.styleSpec})),"number"===i(c[0])&&("piecewise-constant"===r.function&&c[0]%1!=0&&s.push(new n(f+"[0]",c[0],"zoom level for piecewise-constant functions must be an integer")),0!==t.arrayIndex&&c[0]<t.array[t.arrayIndex-1][0]&&s.push(new n(f+"[0]",c[0],"array stops must appear in ascending order"))),s}function d(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}}},{"../error/validation_error":276,"../util/get_type":278,"./validate":280,"./validate_array":281,"./validate_number":291,"./validate_object":292}],288:[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:(-1===e.indexOf("{fontstack}")&&a.push(new n(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&a.push(new n(r,e,'"glyphs" url must include a "{range}" token')),a)}},{"../error/validation_error":276,"./validate_string":295}],289:[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"),c=t("../util/extend");e.exports=function(t){var e=[],r=t.value,u=t.key,f=t.style,h=t.styleSpec;r.type||r.ref||e.push(new n(u,r,'either "type" or "ref" is required'));var d,p=i(r.type),m=i(r.ref);if(r.id)for(var v=0;v<t.arrayIndex;v++){var g=f.layers[v];i(g.id)===i(r.id)&&e.push(new n(u,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(u,r[t],'"%s" is prohibited for ref layers',t))}),f.layers.forEach(function(t){t.id==m&&(d=t)}),d?d.ref?e.push(new n(u,r.ref,"ref cannot reference another ref layer")):p=i(d.type):e.push(new n(u,r.ref,'ref layer "%s" not found',m));else if("background"!==p)if(r.source){var y=f.sources&&f.sources[r.source];y?"vector"==y.type&&"raster"==p?e.push(new n(u,r.source,'layer "%s" requires a raster source',r.id)):"raster"==y.type&&"raster"!=p?e.push(new n(u,r.source,'layer "%s" requires a vector source',r.id)):"vector"!=y.type||r["source-layer"]||e.push(new n(u,r,'layer "%s" must specify a "source-layer"',r.id)):e.push(new n(u,r.source,'source "%s" not found',r.source))}else e.push(new n(u,r,'missing required property "source"'));return e=e.concat(a({key:u,value:r,valueSpec:h.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(c({layerType:p},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(c({layerType:p},t))}}})}}}))}},{"../error/validation_error":276,"../util/extend":277,"../util/unbundle_jsonlint":279,"./validate_filter":286,"./validate_layout_property":290,"./validate_object":292,"./validate_paint_property":293}],290:[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 c=[];return"symbol"===t.layerType&&("icon-image"===s&&r&&!r.sprite?c.push(new i(e,o,'use of "icon-image" requires a style "sprite" property')):"text-field"===s&&r&&!r.glyphs&&c.push(new i(e,o,'use of "text-field" requires a style "glyphs" property'))),c.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":276,"./validate":280}],291:[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":276,"../util/get_type":278}],292:[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,c=t.styleSpec,u=[],f=i(r);if("object"!==f)return[new n(e,r,"object expected, %s found",f)];for(var h in r){var d=h.split(".")[0],p=o&&(o[d]||o["*"]),m=s[d]||s["*"];p||m?u=u.concat((m||a)({key:(e?e+".":e)+h,value:r[h],valueSpec:p,style:l,styleSpec:c,object:r,objectKey:h})):""!==e&&1!==e.split(".").length&&u.push(new n(e,r[h],'unknown property "%s"',h))}for(d in o)o[d].required&&void 0===o[d].default&&void 0===r[d]&&u.push(new n(e,r,'missing required property "%s"',d));return u}},{"../error/validation_error":276,"../util/get_type":278,"./validate":280}],293:[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],c=s.match(/^(.*)-transition$/);return c&&l[c[1]]&&l[c[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":276,"./validate":280}],294:[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')];switch(i(e.type)){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 u in e)["type","url","tileSize"].indexOf(u)<0&&c.push(new n(r+"."+u,e[u],'a source with a "url" property may not include a "%s" property',u));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":276,"../util/unbundle_jsonlint":279,"./validate_enum":285,"./validate_object":292}],295:[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":276,"../util/get_type":278}],296:[function(t,e,r){"use strict";var n=t("./validate/validate_constants"),i=t("./validate/validate"),a=t("../reference/latest.min"),o=t("./validate/validate_glyphs_url");function s(t,e){e=e||a;var r=[];return r=r.concat(i({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:o}})),e.$version>7&&t.constants&&(r=r.concat(n({key:"constants",value:t.constants,style:t,styleSpec:e}))),l(r)}function l(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function c(t){return function(){return l(t.apply(this,arguments))}}s.source=c(t("./validate/validate_source")),s.layer=c(t("./validate/validate_layer")),s.filter=c(t("./validate/validate_filter")),s.paintProperty=c(t("./validate/validate_paint_property")),s.layoutProperty=c(t("./validate/validate_layout_property")),e.exports=s},{"../reference/latest.min":297,"./validate/validate":280,"./validate/validate_constants":284,"./validate/validate_filter":286,"./validate/validate_glyphs_url":288,"./validate/validate_layer":289,"./validate/validate_layout_property":290,"./validate/validate_paint_property":293,"./validate/validate_source":294}],297:[function(t,e,r){e.exports=t("./v8.min.json")},{"./v8.min.json":298}],298:[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"}}}},{}],299:[function(t,e,r){"use strict";function n(t){return!!("undefined"!=typeof window&&"undefined"!=typeof document&&Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray&&Function.prototype&&Function.prototype.bind&&Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions&&"JSON"in window&&"parse"in JSON&&"stringify"in JSON&&"Worker"in window&&"Uint8ClampedArray"in window&&function(t){void 0===i[t]&&(i[t]=function(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)}(t));return i[t]}(t&&t.failIfMajorPerformanceCaveat))}void 0!==e&&e.exports?e.exports=n:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=n);var i={};n.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],300:[function(t,e,r){"use strict";var n=t("../util/util");function i(t){var e=t.layoutVertexArrayType;this.layoutVertexArray=new e;var r=t.elementArrayType;r&&(this.elementArray=new r);var i=t.elementArrayType2;i&&(this.elementArray2=new i),this.paintVertexArrays=n.mapObject(t.paintVertexArrayTypes,function(t){return new t})}e.exports=i,i.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,i.prototype.hasCapacityFor=function(t){return this.layoutVertexArray.length+t<=i.MAX_VERTEX_ARRAY_LENGTH},i.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},i.prototype.trim=function(){for(var t in this.layoutVertexArray.trim(),this.elementArray&&this.elementArray.trim(),this.elementArray2&&this.elementArray2.trim(),this.paintVertexArrays)this.paintVertexArrays[t].trim()},i.prototype.serialize=function(){return{layoutVertexArray:this.layoutVertexArray.serialize(),elementArray:this.elementArray&&this.elementArray.serialize(),elementArray2:this.elementArray2&&this.elementArray2.serialize(),paintVertexArrays:n.mapObject(this.paintVertexArrays,function(t){return t.serialize()})}},i.prototype.getTransferables=function(t){for(var e in t.push(this.layoutVertexArray.arrayBuffer),this.elementArray&&t.push(this.elementArray.arrayBuffer),this.elementArray2&&t.push(this.elementArray2.arrayBuffer),this.paintVertexArrays)t.push(this.paintVertexArrays[e].arrayBuffer)}},{"../util/util":414}],301:[function(t,e,r){"use strict";var n=t("feature-filter"),i=t("./array_group"),a=t("./buffer_group"),o=t("../util/util"),s=t("../util/struct_array"),l=t("assert");function c(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=function(t){var e={};for(var r in t.programInterfaces){for(var n=e[r]={},i=0;i<t.childLayers.length;i++){var a=t.childLayers[i];n[a.id]={attributes:[],uniforms:[],defines:[],vertexPragmas:{define:{},initialize:{}},fragmentPragmas:{define:{},initialize:{}}}}var s=t.programInterfaces[r];if(s.paintAttributes)for(var c="{precision}",u="{type}",d=0;d<s.paintAttributes.length;d++){var p=s.paintAttributes[d];p.multiplier=p.multiplier||1;for(var m=0;m<t.childLayers.length;m++){var v=t.childLayers[m],g=n[v.id],y=p.name;l("a_"===p.name.slice(0,2));var b,x=p.name.slice(2);if(g.fragmentPragmas.initialize[x]="",v.isPaintValueFeatureConstant(p.paintProperty))g.uniforms.push(p),g.fragmentPragmas.define[x]=g.vertexPragmas.define[x]=["uniform",c,u,y].join(" ")+";",g.fragmentPragmas.initialize[x]=g.vertexPragmas.initialize[x]=[c,u,x,"=",y].join(" ")+";\n";else if(v.isPaintValueZoomConstant(p.paintProperty)){g.attributes.push(o.extend({},p,{name:y})),b=["varying",c,u,x].join(" ")+";\n";var _=[g.fragmentPragmas.define[x],"attribute",c,u,y].join(" ")+";\n";g.fragmentPragmas.define[x]=b,g.vertexPragmas.define[x]=b+_,g.vertexPragmas.initialize[x]=[x,"=",y,"/",p.multiplier.toFixed(1)].join(" ")+";\n"}else{for(var w="u_"+y.slice(2)+"_t",M=v.getPaintValueStopZoomLevels(p.paintProperty),k=0;k<M.length&&M[k]<t.zoom;)k++;for(var A=Math.max(0,Math.min(M.length-4,k-2)),T=[],E=0;E<4;E++)T.push(M[Math.min(A+E,M.length-1)]);b=["varying",c,u,x].join(" ")+";\n",g.vertexPragmas.define[x]=b+["uniform","lowp","float",w].join(" ")+";\n",g.fragmentPragmas.define[x]=b,g.uniforms.push(o.extend({},p,{name:w,getValue:h(p,A),components:1}));var S=p.components;if(1===S)g.attributes.push(o.extend({},p,{getValue:f(p,T),isFunction:!0,components:4*S})),g.vertexPragmas.define[x]+=["attribute",c,"vec4",y].join(" ")+";\n",g.vertexPragmas.initialize[x]=[x,"=","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),g.attributes.push(o.extend({},p,{getValue:f(p,[T[C]]),isFunction:!0,name:y+C})),g.vertexPragmas.define[x]+=["attribute",c,u,y+C].join(" ")+";\n";g.vertexPragmas.initialize[x]=[x," = ","evaluate_zoom_function_4("+L.join(", ")+", "+w+")","/",p.multiplier.toFixed(1)].join(" ")+";\n"}}}}}return e}(this),t.arrays){var e=this.programInterfaces;this.bufferGroups=o.mapObject(t.arrays,function(r,n){var i=e[n],o=t.paintVertexArrayTypes[n];return r.map(function(t){return new a(t,{layoutVertexArrayType:i.layoutVertexArrayType.serialize(),elementArrayType:i.elementArrayType&&i.elementArrayType.serialize(),elementArrayType2:i.elementArrayType2&&i.elementArrayType2.serialize(),paintVertexArrayTypes:o})})})}}e.exports=c,c.create=function(e){return new({fill:t("./bucket/fill_bucket"),line:t("./bucket/line_bucket"),circle:t("./bucket/circle_bucket"),symbol:t("./bucket/symbol_bucket")}[e.layer.type])(e)},c.EXTENT=8192,c.prototype.populateArrays=function(){this.createArrays(),this.recalculateStyleLayers();for(var t=0;t<this.features.length;t++)this.addFeature(this.features[t]);this.trimArrays()},c.prototype.prepareArrayGroup=function(t,e){var r=this.arrayGroups[t],n=r.length&&r[r.length-1];return n&&n.hasCapacityFor(e)||((n=new i({layoutVertexArrayType:this.programInterfaces[t].layoutVertexArrayType,elementArrayType:this.programInterfaces[t].elementArrayType,elementArrayType2:this.programInterfaces[t].elementArrayType2,paintVertexArrayTypes:this.paintVertexArrayTypes[t]})).index=r.length,r.push(n)),n},c.prototype.createArrays=function(){for(var t in this.arrayGroups={},this.paintVertexArrayTypes={},this.programInterfaces){this.arrayGroups[t]=[];var e=this.paintVertexArrayTypes[t]={},r=this.paintAttributes[t];for(var n in r)e[n]=new c.VertexArrayType(r[n].attributes)}},c.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)},c.prototype.trimArrays=function(){for(var t in this.arrayGroups)for(var e=this.arrayGroups[t],r=0;r<e.length;r++)e[r].trim()},c.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},c.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)},c.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))}},c.prototype.serialize=function(){return{layerId:this.layer.id,zoom:this.zoom,arrays:o.mapObject(this.arrayGroups,function(t){return t.map(function(t){return t.serialize()})}),paintVertexArrayTypes:o.mapObject(this.paintVertexArrayTypes,function(t){return o.mapObject(t,function(t){return t.serialize()})}),childLayerIds:this.childLayers.map(function(t){return t.id})}},c.prototype.createFilter=function(){this.filter||(this.filter=n(this.layer.filter))};var u={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0};function f(t,e){return function(r,n,i){if(1===e.length)return t.getValue(r,o.extend({},n,{zoom:e[0]}),i);for(var a=[],s=0;s<e.length;s++){var l=e[s];a.push(t.getValue(r,o.extend({},n,{zoom:l}),i)[0])}return a}}function h(t,e){return function(r,n){var i=r.getPaintInterpolationT(t.paintProperty,n.zoom);return[Math.max(0,Math.min(4,i-e))]}}c.prototype.recalculateStyleLayers=function(){for(var t=0;t<this.childLayers.length;t++)this.childLayers[t].recalculate(this.zoom,u)},c.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 c=s[l],u=c.layoutVertexArray.length,f=c.paintVertexArrays[o.id];f.resize(u);for(var h=this.paintAttributes[t][o.id].attributes,d=0;d<h.length;d++)for(var p=h[d],m=p.getValue(o,e,r),v=p.multiplier||1,g=p.components||1,y=l===n.index?i:0;y<u;y++)for(var b=f.get(y),x=0;x<g;x++){b[g>1?p.name+x:p.name]=m[x]*v}}},c.VertexArrayType=function(t){return new s({members:t,alignment:4})},c.ElementArrayType=function(t){return new s({members:[{type:"Uint16",name:"vertices",components:t||3}]})}},{"../util/struct_array":412,"../util/util":414,"./array_group":300,"./bucket/circle_bucket":302,"./bucket/fill_bucket":303,"./bucket/line_bucket":304,"./bucket/symbol_bucket":305,"./buffer_group":307,assert:51,"feature-filter":141}],302:[function(t,e,r){"use strict";var n=t("../bucket"),i=t("../../util/util"),a=t("../load_geometry"),o=n.EXTENT;function s(){n.apply(this,arguments)}e.exports=s,s.prototype=i.inherit(n,{}),s.prototype.addCircleVertex=function(t,e,r,n,i){return t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)},s.prototype.programInterfaces={circle:{layoutVertexArrayType:new n.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new n.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"}]}},s.prototype.addFeature=function(t){for(var e={zoom:this.zoom},r=a(t),n=this.prepareArrayGroup("circle",0),i=n.layoutVertexArray.length,s=0;s<r.length;s++)for(var l=0;l<r[s].length;l++){var c=r[s][l].x,u=r[s][l].y;if(!(c<0||c>=o||u<0||u>=o)){var f=this.prepareArrayGroup("circle",4),h=f.layoutVertexArray,d=this.addCircleVertex(h,c,u,-1,-1);this.addCircleVertex(h,c,u,1,-1),this.addCircleVertex(h,c,u,1,1),this.addCircleVertex(h,c,u,-1,1),f.elementArray.emplaceBack(d,d+1,d+2),f.elementArray.emplaceBack(d,d+3,d+2)}}this.populatePaintArrays("circle",e,t.properties,n,i)}},{"../../util/util":414,"../bucket":301,"../load_geometry":309}],303:[function(t,e,r){"use strict";var n=t("../bucket"),i=t("../../util/util"),a=t("../load_geometry"),o=t("earcut"),s=t("../../util/classify_rings");function l(){n.apply(this,arguments)}e.exports=l,l.prototype=i.inherit(n,{}),l.prototype.programInterfaces={fill:{layoutVertexArrayType:new n.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new n.ElementArrayType(1),elementArrayType2:new n.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"}]}},l.prototype.addFeature=function(t){for(var e=a(t),r=s(e,500),n=this.prepareArrayGroup("fill",0),i=n.layoutVertexArray.length,o=0;o<r.length;o++)this.addPolygon(r[o]);this.populatePaintArrays("fill",{zoom:this.zoom},t.properties,n,i)},l.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=[],s=n.layoutVertexArray.length,l=0;l<t.length;l++){var c=t[l];l>0&&a.push(i.length/2);for(var u=0;u<c.length;u++){var f=c[u],h=n.layoutVertexArray.emplaceBack(f.x,f.y);u>=1&&n.elementArray2.emplaceBack(h-1,h),i.push(f.x),i.push(f.y)}}for(var d=o(i,a),p=0;p<d.length;p++)n.elementArray.emplaceBack(d[p]+s)}},{"../../util/classify_rings":402,"../../util/util":414,"../bucket":301,"../load_geometry":309,earcut:135}],304:[function(t,e,r){"use strict";var n=t("../bucket"),i=t("../../util/util"),a=t("../load_geometry"),o=n.EXTENT,s=Math.cos(Math.PI/180*37.5),l=Math.pow(2,14)/.5;function c(){n.apply(this,arguments)}e.exports=c,c.prototype=i.inherit(n,{}),c.prototype.addLineVertex=function(t,e,r,n,i,a,o){return t.emplaceBack(e.x<<1|n,e.y<<1|i,Math.round(63*r.x)+128,Math.round(63*r.y)+128,1+(0===a?0:a<0?-1:1)|(.5*o&63)<<2,.5*o>>6)},c.prototype.programInterfaces={line:{layoutVertexArrayType:new n.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}]),elementArrayType:new n.ElementArrayType}},c.prototype.addFeature=function(t){for(var e=a(t,15),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"])},c.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 l=o/(512*this.overscaling)*15,c=t[0],u=t[a-1],f=c.equals(u);if(this.prepareArrayGroup("line",10*a),2!==a||!f){this.distance=0;var h,d,p,m,v,g,y,b=r,x=f?"butt":r,_=!0;this.e1=this.e2=this.e3=-1,f&&(h=t[a-2],v=c.sub(h)._unit()._perp());for(var w=0;w<a;w++)if(!(p=f&&w===a-1?t[1]:t[w+1])||!t[w].equals(p)){v&&(m=v),h&&(d=h),h=t[w],v=p?p.sub(h)._unit()._perp():m;var M=(m=m||v).add(v)._unit(),k=M.x*v.x+M.y*v.y,A=1/k,T=k<s&&d&&p;if(T&&w>0){var E=h.dist(d);if(E>2*l){var S=h.sub(h.sub(d)._mult(l/E)._round());this.distance+=S.dist(d),this.addCurrentVertex(S,this.distance,m.mult(1),0,0,!1),d=S}}var L=d&&p,C=L?e:p?b:x;if(L&&"round"===C&&(A<i?C="miter":A<=2&&(C="fakeround")),"miter"===C&&A>n&&(C="bevel"),"bevel"===C&&(A>2&&(C="flipbevel"),A<n&&(C="miter")),d&&(this.distance+=h.dist(d)),"miter"===C)M._mult(A),this.addCurrentVertex(h,this.distance,M,0,0,!1);else if("flipbevel"===C){if(A>100)M=v.clone();else{var P=m.x*v.y-m.y*v.x>0?-1:1,z=A*m.add(v).mag()/m.sub(v).mag();M._perp()._mult(z*P)}this.addCurrentVertex(h,this.distance,M,0,0,!1),this.addCurrentVertex(h,this.distance,M.mult(-1),0,0,!1)}else if("bevel"===C||"fakeround"===C){var O=m.x*v.y-m.y*v.x>0,D=-Math.sqrt(A*A-1);if(O?(y=0,g=D):(g=0,y=D),_||this.addCurrentVertex(h,this.distance,m,g,y,!1),"fakeround"===C){for(var I,R=Math.floor(8*(.5-(k-.5))),N=0;N<R;N++)I=v.mult((N+1)/(R+1))._add(m)._unit(),this.addPieSliceVertex(h,this.distance,I,O);this.addPieSliceVertex(h,this.distance,M,O);for(var F=R-1;F>=0;F--)I=m.mult((F+1)/(R+1))._add(v)._unit(),this.addPieSliceVertex(h,this.distance,I,O)}p&&this.addCurrentVertex(h,this.distance,v,-g,-y,!1)}else"butt"===C?(_||this.addCurrentVertex(h,this.distance,m,0,0,!1),p&&this.addCurrentVertex(h,this.distance,v,0,0,!1)):"square"===C?(_||(this.addCurrentVertex(h,this.distance,m,1,1,!1),this.e1=this.e2=-1),p&&this.addCurrentVertex(h,this.distance,v,-1,-1,!1)):"round"===C&&(_||(this.addCurrentVertex(h,this.distance,m,0,0,!1),this.addCurrentVertex(h,this.distance,m,1,1,!0),this.e1=this.e2=-1),p&&(this.addCurrentVertex(h,this.distance,v,-1,-1,!0),this.addCurrentVertex(h,this.distance,v,0,0,!1)));if(T&&w<a-1){var j=h.dist(p);if(j>2*l){var B=h.add(p.sub(h)._mult(l/j)._round());this.distance+=B.dist(h),this.addCurrentVertex(B,this.distance,v.mult(1),0,0,!1),h=B}}_=!1}}}},c.prototype.addCurrentVertex=function(t,e,r,n,i,a){var o,s=a?1:0,c=this.arrayGroups.line[this.arrayGroups.line.length-1],u=c.layoutVertexArray,f=c.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&&f.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&&f.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,e>l/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,i,a))},c.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":414,"../bucket":301,"../load_geometry":309}],305:[function(t,e,r){"use strict";var n=t("point-geometry"),i=t("../bucket"),a=t("../../symbol/anchor"),o=t("../../symbol/get_anchors"),s=t("../../util/token"),l=t("../../symbol/quads"),c=t("../../symbol/shaping"),u=t("../../symbol/resolve_text"),f=t("../../symbol/mergelines"),h=t("../../symbol/clip_line"),d=t("../../util/util"),p=t("../load_geometry"),m=t("../../symbol/collision_feature"),v=c.shapeText,g=c.shapeIcon,y=l.getGlyphQuads,b=l.getIconQuads,x=i.EXTENT;function _(t){i.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}e.exports=_,_.MAX_QUADS=65535,_.prototype=d.inherit(i,{}),_.prototype.serialize=function(){var t=i.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 w=new i.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"}]),M=new i.ElementArrayType;function k(t,e,r,n,i,a,o,s,l,c,u){return t.emplaceBack(e,r,Math.round(64*n),Math.round(64*i),a/4,o/4,10*(c||0),u,10*(s||0),10*Math.min(l||25,25))}_.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)},_.prototype.programInterfaces={glyph:{layoutVertexArrayType:w,elementArrayType:M},icon:{layoutVertexArrayType:w,elementArrayType:M},collisionBox:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"},{name:"a_data",components:2,type:"Uint8"}])}},_.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=x/i,this.compareText={},this.iconsNeedLinear=!1,this.symbolInstancesStartIndex=this.symbolInstancesArray.length;var a=this.layer.layout,o=this.features,l=this.textFeatures,c=.5,u=.5;switch(a["text-anchor"]){case"right":case"top-right":case"bottom-right":c=1;break;case"left":case"top-left":case"bottom-left":c=0}switch(a["text-anchor"]){case"bottom":case"bottom-right":case"bottom-left":u=1;break;case"top":case"top-right":case"top-left":u=0}for(var h,m,y="right"===a["text-justify"]?1:"left"===a["text-justify"]?0:.5,b=24*a["text-line-height"],_="line"!==a["symbol-placement"]?24*a["text-max-width"]:0,w=24*a["text-letter-spacing"],M=[24*a["text-offset"][0],24*a["text-offset"][1]],k=this.fontstack=a["text-font"].join(","),A=[],T=0;T<o.length;T++)A.push(p(o[T]));if("line"===a["symbol-placement"]){var E=f(o,l,A);A=E.geometries,o=E.features,l=E.textFeatures}for(var S=0;S<o.length;S++)if(A[S]){if(h=l[S]?v(l[S],e[k],_,b,c,u,y,w,M):null,a["icon-image"]){var L=r[s(o[S].properties,a["icon-image"])];m=g(L,a),L&&(void 0===this.sdfIcons?this.sdfIcons=L.sdf:this.sdfIcons!==L.sdf&&d.warnOnce("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),1!==L.pixelRatio?this.iconsNeedLinear=!0:0===a["icon-rotate"]&&this.layer.isLayoutValueFeatureConstant("icon-rotate")||(this.iconsNeedLinear=!0))}else m=null;(h||m)&&this.addFeature(A[S],h,m,o[S])}this.symbolInstancesEndIndex=this.symbolInstancesArray.length,this.placeFeatures(t,this.showCollisionBoxes),this.trimArrays()},_.prototype.addFeature=function(t,e,r,n){var i=this.layer.layout,s=this.adjustedTextSize/24,l=void 0!==this.adjustedTextMaxSize?this.adjustedTextMaxSize:this.adjustedTextSize,c=this.tilePixelRatio*s,u=this.tilePixelRatio*l/24,f=this.tilePixelRatio*this.adjustedIconSize,d=this.tilePixelRatio*i["symbol-spacing"],p=i["symbol-avoid-edges"],m=i["text-padding"]*this.tilePixelRatio,v=i["icon-padding"]*this.tilePixelRatio,g=i["text-max-angle"]/180*Math.PI,y="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"],w="line"===i["symbol-placement"],M=d/2;w&&(t=h(t,0,0,x,x));for(var k=0;k<t.length;k++)for(var A,T=t[k],E=0,S=(A=w?o(T,d,g,e,r,24,u,this.overscaling,x):[new a(T[0].x,T[0].y,0)]).length;E<S;E++){var L=A[E];if(!(e&&w&&this.anchorIsTooClose(e.text,M,L))){var C=!(L.x<0||L.x>x||L.y<0||L.y>x);if(!p||C){var P=C||_;this.addSymbolInstance(L,T,e,r,this.layer,P,this.symbolInstancesArray.length,this.collisionBoxArray,n.index,this.sourceLayerIndex,this.index,c,m,y,f,v,b,{zoom:this.zoom},n.properties)}}}},_.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},_.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"];if(r["text-allow-overlap"]||r["icon-allow-overlap"]||r["text-ignore-placement"]||r["icon-ignore-placement"]){var o=this.symbolInstancesArray.toArray(this.symbolInstancesStartIndex,this.symbolInstancesEndIndex),s=t.angle,l=Math.sin(s),c=Math.cos(s);this.sortedSymbolInstances=o.sort(function(t,e){return(l*t.anchorPointX+c*t.anchorPointY|0)-(l*e.anchorPointX+c*e.anchorPointY|0)||e.index-t.index})}for(var u=this.symbolInstancesStartIndex;u<this.symbolInstancesEndIndex;u++){var f=this.sortedSymbolInstances?this.sortedSymbolInstances[u-this.symbolInstancesStartIndex]:this.symbolInstancesArray.get(u),h={boxStartIndex:f.textBoxStartIndex,boxEndIndex:f.textBoxEndIndex},d={boxStartIndex:f.iconBoxStartIndex,boxEndIndex:f.iconBoxEndIndex},p=!(f.textBoxStartIndex===f.textBoxEndIndex),m=!(f.iconBoxStartIndex===f.iconBoxEndIndex),v=r["text-optional"]||!p,g=r["icon-optional"]||!m,y=p?t.placeCollisionFeature(h,r["text-allow-overlap"],r["symbol-avoid-edges"]):t.minScale,b=m?t.placeCollisionFeature(d,r["icon-allow-overlap"],r["symbol-avoid-edges"]):t.minScale;v||g?!g&&y?y=Math.max(b,y):!v&&b&&(b=Math.max(b,y)):b=y=Math.max(b,y),p&&(t.insertCollisionFeature(h,y,r["text-ignore-placement"]),y<=n&&this.addSymbols("glyph",f.glyphQuadStartIndex,f.glyphQuadEndIndex,y,r["text-keep-upright"],i,t.angle)),m&&(t.insertCollisionFeature(d,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)},_.prototype.addSymbols=function(t,e,r,n,i,a,o){for(var s=this.prepareArrayGroup(t,4*(r-e)),l=s.elementArray,c=s.layoutVertexArray,u=this.zoom,f=Math.max(Math.log(n)/Math.LN2+u,0),h=e;h<r;h++){var d=this.symbolQuadsArray.get(h).SymbolQuad,p=(d.anchorAngle+o+Math.PI)%(2*Math.PI);if(!(i&&a&&(p<=Math.PI/2||p>3*Math.PI/2))){var m=d.tl,v=d.tr,g=d.bl,y=d.br,b=d.tex,x=d.anchorPoint,_=Math.max(u+Math.log(d.minScale)/Math.LN2,f),w=Math.min(u+Math.log(d.maxScale)/Math.LN2,25);if(!(w<=_)){_===f&&(_=0);var M=Math.round(d.glyphAngle/(2*Math.PI)*256),A=k(c,x.x,x.y,m.x,m.y,b.x,b.y,_,w,f,M);k(c,x.x,x.y,v.x,v.y,b.x+b.w,b.y,_,w,f,M),k(c,x.x,x.y,g.x,g.y,b.x,b.y+b.h,_,w,f,M),k(c,x.x,x.y,y.x,y.y,b.x+b.w,b.y+b.h,_,w,f,M),l.emplaceBack(A,A+1,A+2),l.emplaceBack(A+1,A+2,A+3)}}}},_.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=s(this.features[r].properties,e);n&&(t[n]=!0)}},_.prototype.updateFont=function(t){this.recalculateStyleLayers();var e=this.layer.layout["text-font"],r=t[e]=t[e]||{};this.textFeatures=u(this.features,this.layer.layout,r)},_.prototype.addToDebugBuffers=function(t){for(var e=this.prepareArrayGroup("collisionBox",0).layoutVertexArray,r=-t.angle,i=t.yStretch,a=this.symbolInstancesStartIndex;a<this.symbolInstancesEndIndex;a++){var o=this.symbolInstancesArray.get(a);o.textCollisionFeature={boxStartIndex:o.textBoxStartIndex,boxEndIndex:o.textBoxEndIndex},o.iconCollisionFeature={boxStartIndex:o.iconBoxStartIndex,boxEndIndex:o.iconBoxEndIndex};for(var s=0;s<2;s++){var l=o[0===s?"textCollisionFeature":"iconCollisionFeature"];if(l)for(var c=l.boxStartIndex;c<l.boxEndIndex;c++){var u=this.collisionBoxArray.get(c),f=u.anchorPoint,h=new n(u.x1,u.y1*i)._rotate(r),d=new n(u.x2,u.y1*i)._rotate(r),p=new n(u.x1,u.y2*i)._rotate(r),m=new n(u.x2,u.y2*i)._rotate(r),v=Math.max(0,Math.min(25,this.zoom+Math.log(u.maxScale)/Math.LN2)),g=Math.max(0,Math.min(25,this.zoom+Math.log(u.placementScale)/Math.LN2));this.addCollisionBoxVertex(e,f,h,v,g),this.addCollisionBoxVertex(e,f,d,v,g),this.addCollisionBoxVertex(e,f,d,v,g),this.addCollisionBoxVertex(e,f,m,v,g),this.addCollisionBoxVertex(e,f,m,v,g),this.addCollisionBoxVertex(e,f,p,v,g),this.addCollisionBoxVertex(e,f,p,v,g),this.addCollisionBoxVertex(e,f,h,v,g)}}}},_.prototype.addSymbolInstance=function(t,e,r,n,i,a,o,s,l,c,u,f,h,p,v,g,x,w,M){var k,A,T,E,S,L,C,P;if(r&&(C=a?y(t,r,f,e,i,p):[],S=new m(s,e,t,l,c,u,r,f,h,p,!1)),k=this.symbolQuadsArray.length,C&&C.length)for(var z=0;z<C.length;z++)this.addSymbolQuad(C[z]);A=this.symbolQuadsArray.length;var O=S?S.boxStartIndex:this.collisionBoxArray.length,D=S?S.boxEndIndex:this.collisionBoxArray.length;n&&(P=a?b(t,n,v,e,i,x,r,w,M):[],L=new m(s,e,t,l,c,u,n,v,g,x,!0)),T=this.symbolQuadsArray.length,P&&1===P.length&&this.addSymbolQuad(P[0]),E=this.symbolQuadsArray.length;var I=L?L.boxStartIndex:this.collisionBoxArray.length,R=L?L.boxEndIndex:this.collisionBoxArray.length;return E>_.MAX_QUADS&&d.warnOnce("Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),A>_.MAX_QUADS&&d.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),this.symbolInstancesArray.emplaceBack(O,D,I,R,k,A,T,E,t.x,t.y,o)},_.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":363,"../../symbol/clip_line":365,"../../symbol/collision_feature":367,"../../symbol/get_anchors":369,"../../symbol/mergelines":372,"../../symbol/quads":373,"../../symbol/resolve_text":374,"../../symbol/shaping":375,"../../util/token":413,"../../util/util":414,"../bucket":301,"../load_geometry":309,"point-geometry":458}],306:[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"}},{}],307:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("./buffer"),a=t("../render/vertex_array_object");function o(t,e){this.layoutVertexBuffer=new i(t.layoutVertexArray,e.layoutVertexArrayType,i.BufferType.VERTEX),t.elementArray&&(this.elementBuffer=new i(t.elementArray,e.elementArrayType,i.BufferType.ELEMENT));var r,o=this.vaos={};t.elementArray2&&(this.elementBuffer2=new i(t.elementArray2,e.elementArrayType2,i.BufferType.ELEMENT),r=this.secondVaos={}),this.paintVertexBuffers=n.mapObject(t.paintVertexArrays,function(n,s){return o[s]=new a,t.elementArray2&&(r[s]=new a),new i(n,e.paintVertexArrayTypes[s],i.BufferType.VERTEX)})}e.exports=o,o.prototype.destroy=function(t){for(var e in this.layoutVertexBuffer.destroy(t),this.elementBuffer&&this.elementBuffer.destroy(t),this.elementBuffer2&&this.elementBuffer2.destroy(t),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":329,"../util/util":414,"./buffer":306}],308:[function(t,e,r){"use strict";var n=t("point-geometry"),i=t("./load_geometry"),a=t("./bucket").EXTENT,o=t("feature-filter"),s=t("../util/struct_array"),l=t("grid-index"),c=t("../util/dictionary_coder"),u=t("vector-tile"),f=t("pbf"),h=t("../util/vectortile_to_geojson"),d=t("../util/util").arraysIntersect,p=t("../util/intersection_tests"),m=p.multiPolygonIntersectsBufferedMultiPoint,v=p.multiPolygonIntersectsMultiPolygon,g=p.multiPolygonIntersectsBufferedMultiLine,y=new s({members:[{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]});function b(t,e,r){if(t.grid){var n=t,i=e;t=n.coord,e=n.overscaling,this.grid=new l(n.grid),this.featureIndexArray=new y(n.featureIndexArray),this.rawTileData=i,this.bucketLayerIDs=n.bucketLayerIDs}else this.grid=new l(a,16,0),this.featureIndexArray=new y;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 x(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function _(t,e){return e-t}function w(t){return t["line-gap-width"]>0?t["line-gap-width"]+2*t["line-width"]:t["line-width"]}function M(t,e,r,i,a){if(!e[0]&&!e[1])return t;e=n.convert(e),"viewport"===r&&e._rotate(-i);for(var o=[],s=0;s<t.length;s++){for(var l=t[s],c=[],u=0;u<l.length;u++)c.push(l[u].sub(e._mult(a)));o.push(c)}return o}function k(t,e){for(var r=[],i=new n(0,0),a=0;a<t.length;a++){for(var o=t[a],s=[],l=0;l<o.length;l++){var c=o[l-1],u=o[l],f=o[l+1],h=0===l?i:u.sub(c)._unit()._perp(),d=l===o.length-1?i:f.sub(u)._unit()._perp(),p=h._add(d)._unit(),m=p.x*d.x+p.y*d.y;p._mult(1/m),s.push(p._mult(e)._add(u))}r.push(s)}return r}e.exports=b,b.prototype.insert=function(t,e,r,n){var a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(e,r,n);for(var o=i(t),s=0;s<o.length;s++){for(var l=o[s],c=[1/0,1/0,-1/0,-1/0],u=0;u<l.length;u++){var f=l[u];c[0]=Math.min(c[0],f.x),c[1]=Math.min(c[1],f.y),c[2]=Math.max(c[2],f.x),c[3]=Math.max(c[3],f.y)}this.grid.insert(a,c[0],c[1],c[2],c[3])}},b.prototype.setCollisionTile=function(t){this.collisionTile=t},b.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]}},b.prototype.query=function(t,e){this.vtLayers||(this.vtLayers=new u.VectorTile(new f(new Uint8Array(this.rawTileData))).layers,this.sourceLayerCoder=new c(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]));var r={},i=t.params||{},s=a/t.tileSize/t.scale,l=o(i.filter),h=0;for(var d in e){var p=e[d],m=p.paint,v=0;"line"===p.type?v=w(m)/2+Math.abs(m["line-offset"])+x(m["line-translate"]):"fill"===p.type?v=x(m["fill-translate"]):"circle"===p.type&&(v=m["circle-radius"]+x(m["circle-translate"])),h=Math.max(h,v*s)}for(var g=t.queryGeometry.map(function(t){return t.map(function(t){return new n(t.x,t.y)})}),y=1/0,b=1/0,M=-1/0,k=-1/0,A=0;A<g.length;A++)for(var T=g[A],E=0;E<T.length;E++){var S=T[E];y=Math.min(y,S.x),b=Math.min(b,S.y),M=Math.max(M,S.x),k=Math.max(k,S.y)}var L=this.grid.query(y-h,b-h,M+h,k+h);L.sort(_),this.filterMatching(r,L,this.featureIndexArray,g,l,i.layers,e,t.bearing,s);var C=this.collisionTile.queryRenderedSymbols(y,b,M,k,t.scale);return C.sort(),this.filterMatching(r,C,this.collisionTile.collisionBoxArray,g,l,i.layers,e,t.bearing,s),r},b.prototype.filterMatching=function(t,e,r,n,a,o,s,l,c){for(var u,f=0;f<e.length;f++){var p=e[f];if(p!==u){u=p;var y=r.get(p),b=this.bucketLayerIDs[y.bucketIndex];if(!o||d(o,b)){var x=this.sourceLayerCoder.decode(y.sourceLayerIndex),_=this.vtLayers[x].feature(y.featureIndex);if(a(_))for(var A=null,T=0;T<b.length;T++){var E=b[T];if(!(o&&o.indexOf(E)<0)){var S=s[E];if(S){var L;if("symbol"!==S.type){A||(A=i(_));var C=S.paint;if("line"===S.type){L=M(n,C["line-translate"],C["line-translate-anchor"],l,c);var P=w(C)/2*c;if(C["line-offset"]&&(A=k(A,C["line-offset"]*c)),!g(L,A,P))continue}else if("fill"===S.type){if(L=M(n,C["fill-translate"],C["fill-translate-anchor"],l,c),!v(L,A))continue}else if("circle"===S.type){L=M(n,C["circle-translate"],C["circle-translate-anchor"],l,c);var z=C["circle-radius"]*c;if(!m(L,A,z))continue}}var O=new h(_,this.z,this.x,this.y);O.layer=S.serialize({includeRefProperties:!0});var D=t[E];void 0===D&&(D=t[E]=[]),D.push(O)}}}}}}}},{"../util/dictionary_coder":404,"../util/intersection_tests":409,"../util/struct_array":412,"../util/util":414,"../util/vectortile_to_geojson":415,"./bucket":301,"./load_geometry":309,"feature-filter":141,"grid-index":254,pbf:451,"point-geometry":458,"vector-tile":544}],309:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("./bucket").EXTENT,a=t("assert");function o(t){return{min:-1*Math.pow(2,t-1),max:Math.pow(2,t-1)-1}}var s={15:o(15),16:o(16)};e.exports=function(t,e){var r=s[e||16];a(r);for(var o=i/t.extent,l=t.loadGeometry(),c=0;c<l.length;c++)for(var u=l[c],f=0;f<u.length;f++){var h=u[f];h.x=Math.round(h.x*o),h.y=Math.round(h.y*o),(h.x<r.min||h.x>r.max||h.y<r.min||h.y>r.max)&&n.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return l}},{"../util/util":414,"./bucket":301,assert:51}],310:[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}}},{}],311:[function(t,e,r){"use strict";e.exports=i;var n=t("../util/util").wrap;function i(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")}i.prototype.wrap=function(){return new i(n(this.lng,-180,180),this.lat)},i.prototype.toArray=function(){return[this.lng,this.lat]},i.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},i.convert=function(t){return t instanceof i?t:Array.isArray(t)?new i(t[0],t[1]):t}},{"../util/util":414}],312:[function(t,e,r){"use strict";e.exports=i;var n=t("./lng_lat");function i(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]))}i.prototype={extend:function(t){var e,r,a=this._sw,o=this._ne;if(t instanceof n)e=t,r=t;else{if(!(t instanceof i))return t?this.extend(n.convert(t)||i.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 n(e.lng,e.lat),this._ne=new n(r.lng,r.lat)),this},getCenter:function(){return new n((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 n(this.getWest(),this.getNorth())},getSouthEast:function(){return new n(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()+")"}},i.convert=function(t){return!t||t instanceof i?t:new i(t)}},{"./lng_lat":311}],313:[function(t,e,r){"use strict";var n=t("./lng_lat"),i=t("point-geometry"),a=t("./coordinate"),o=t("../util/util").wrap,s=t("../util/interpolate"),l=t("../source/tile_coord"),c=t("../data/bucket").EXTENT,u=t("gl-matrix"),f=u.vec4,h=u.mat4,d=u.mat2;function p(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 n(0,0),this.zoom=0,this.angle=0,this._altitude=1.5,this._pitch=0,this._unmodified=!0}e.exports=p,p.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 i(this.width,this.height)},get bearing(){return-this.angle/Math.PI*180},set bearing(t){var e=-o(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=d.create(),d.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,a=n.locationCoordinate(n.center)._zoomTo(e),o=new i(a.column-.5,a.row-.5);return l.cover(e,[n.pointCoordinate(new i(0,0))._zoomTo(e),n.pointCoordinate(new i(n.width,0))._zoomTo(e),n.pointCoordinate(new i(n.width,n.height))._zoomTo(e),n.pointCoordinate(new i(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 i(this.lngX(t.lng,e),this.latY(t.lat,e))},unproject:function(t,e){return new n(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 i(this.x,this.y)},lngX:function(t,e){return(180+t)*(e||this.worldSize)/360},latY:function(t,e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))*(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=n.convert(t);return new a(this.lngX(r.lng)*e,this.latY(r.lat)*e,this.tileZoom)},coordinateLocation:function(t){var e=this.zoomScale(t.zoom);return new n(this.xLng(t.column,e),this.yLat(t.row,e))},pointCoordinate:function(t){var e=[t.x,t.y,0,1],r=[t.x,t.y,1,1];f.transformMat4(e,e,this.pixelMatrixInverse),f.transformMat4(r,r,this.pixelMatrixInverse);var n=e[3],i=r[3],o=e[0]/n,l=r[0]/i,c=e[1]/n,u=r[1]/i,h=e[2]/n,d=r[2]/i,p=h===d?0:(0-h)/(d-h),m=this.worldSize/this.zoomScale(this.tileZoom);return new a(s(o,l,p)/m,s(c,u,p)/m,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 i(r[0]/r[3],r[1]/r[3])},calculatePosMatrix:function(t,e){void 0===e&&(e=1/0),t instanceof l&&(t=t.toCoordinate(e));var r=Math.min(t.zoom,e),n=this.worldSize/Math.pow(2,r),i=new Float64Array(16);return h.identity(i),h.translate(i,i,[t.column*n,t.row*n,0]),h.scale(i,i,[n/c,n/c,1]),h.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,a,o,s,l,c=this.size,u=this._unmodified;this.latRange&&(t=this.latY(this.latRange[1]),a=(e=this.latY(this.latRange[0]))-t<c.y?c.y/(e-t):0),this.lngRange&&(r=this.lngX(this.lngRange[0]),o=(n=this.lngX(this.lngRange[1]))-r<c.x?c.x/(n-r):0);var f=Math.max(o||0,a||0);if(f)return this.center=this.unproject(new i(o?(n+r)/2:this.x,a?(e+t)/2:this.y)),this.zoom+=this.scaleZoom(f),this._unmodified=u,void(this._constraining=!1);if(this.latRange){var h=this.y,d=c.y/2;h-d<t&&(l=t+d),h+d>e&&(l=e-d)}if(this.lngRange){var p=this.x,m=c.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 i(void 0!==s?s:this.x,void 0!==l?l:this.y))),this._unmodified=u,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(h.perspective(n,2*Math.atan(this.height/2/this.altitude),this.width/this.height,.1,r),h.translate(n,n,[0,0,-this.altitude]),h.scale(n,n,[1,-1,1/this.height]),h.rotateX(n,n,this._pitch),h.rotateZ(n,n,this.angle),h.translate(n,n,[-this.x,-this.y,0]),this.projMatrix=n,n=h.create(),h.scale(n,n,[this.width/2,-this.height/2,1]),h.translate(n,n,[1,-1,0]),this.pixelMatrix=h.multiply(new Float64Array(16),n,this.projMatrix),!(n=h.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=n}}}},{"../data/bucket":301,"../source/tile_coord":341,"../util/interpolate":408,"../util/util":414,"./coordinate":310,"./lng_lat":311,"gl-matrix":198,"point-geometry":458}],314:[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,c,u,f,h,d=[];for(a=0,o=t.length;a<o;a++)if(c=n[t[a]]){for(h=null,s=0,l=c[1].length;s<l;s+=2)-1===c[1][s]&&-1===c[1][s+1]?h=null:(u=e+c[1][s]*i,f=r-c[1][s+1]*i,h&&d.push(h.x,h.y,u,f),h={x:u,y:f});e+=c[0]*i}return d}},{}],315:[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":416,"./geo/lng_lat":311,"./geo/lng_lat_bounds":312,"./style/style":350,"./ui/control/attribution":381,"./ui/control/control":382,"./ui/control/geolocate":383,"./ui/control/navigation":384,"./ui/map":393,"./ui/marker":394,"./ui/popup":395,"./util/ajax":397,"./util/browser":398,"./util/config":403,"./util/evented":406,"./util/util":414,"point-geometry":458}],316:[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:51}],317:[function(t,e,r){"use strict";var n=t("../source/pixels_to_tile_units"),i=t("./create_uniform_pragmas"),a=512;e.exports=function(t,e,r){var o,s=t.gl,l=t.transform,c=r.paint["background-color"],u=r.paint["background-pattern"],f=r.paint["background-opacity"],h=u?t.spriteAtlas.getPosition(u.from,!0):null,d=u?t.spriteAtlas.getPosition(u.to,!0):null;if(t.setDepthSublayer(0),h&&d){if(t.isOpaquePass)return;o=t.useProgram("pattern"),s.uniform1i(o.u_image,0),s.uniform2fv(o.u_pattern_tl_a,h.tl),s.uniform2fv(o.u_pattern_br_a,h.br),s.uniform2fv(o.u_pattern_tl_b,d.tl),s.uniform2fv(o.u_pattern_br_b,d.br),s.uniform1f(o.u_opacity,f),s.uniform1f(o.u_mix,u.t),s.uniform2fv(o.u_pattern_size_a,h.size),s.uniform2fv(o.u_pattern_size_b,d.size),s.uniform1f(o.u_scale_a,u.fromScale),s.uniform1f(o.u_scale_b,u.toScale),s.activeTexture(s.TEXTURE0),t.spriteAtlas.bind(s,!0),t.tileExtentPatternVAO.bind(s,o,t.tileExtentBuffer)}else{if(t.isOpaquePass!==(1===c[3]))return;var p=i([{name:"u_color",components:4},{name:"u_opacity",components:1}]);o=t.useProgram("fill",[],p,p),s.uniform4fv(o.u_color,c),s.uniform1f(o.u_opacity,f),t.tileExtentVAO.bind(s,o,t.tileExtentBuffer)}s.disable(s.STENCIL_TEST);for(var m=l.coveringTiles({tileSize:a}),v=0;v<m.length;v++){var g=m[v];if(h&&d){var y={coord:g,tileSize:a};s.uniform1f(o.u_tile_units_to_pixels,1/n(y,1,t.transform.tileZoom));var b=y.tileSize*Math.pow(2,t.transform.tileZoom-y.coord.z),x=b*(y.coord.x+g.w*Math.pow(2,y.coord.z)),_=b*y.coord.y;s.uniform2f(o.u_pixel_coord_upper,x>>16,_>>16),s.uniform2f(o.u_pixel_coord_lower,65535&x,65535&_)}s.uniformMatrix4fv(o.u_matrix,!1,t.transform.calculatePosMatrix(g)),s.drawArrays(s.TRIANGLE_STRIP,0,t.tileExtentBuffer.length)}s.stencilMask(0),s.stencilFunc(s.EQUAL,128,128)}},{"../source/pixels_to_tile_units":335,"./create_uniform_pragmas":316}],318:[function(t,e,r){"use strict";var n=t("../util/browser");e.exports=function(t,e,r,i){if(t.isOpaquePass)return;var a=t.gl;t.setDepthSublayer(0),t.depthMask(!1),a.disable(a.STENCIL_TEST);for(var o=0;o<i.length;o++){var s=i[o],l=e.getTile(s),c=l.getBucket(r);if(c){var u=c.bufferGroups.circle;if(u){var f=c.paintAttributes.circle[r.id],h=t.useProgram("circle",f.defines,f.vertexPragmas,f.fragmentPragmas);"map"===r.paint["circle-pitch-scale"]?(a.uniform1i(h.u_scale_with_map,!0),a.uniform2f(h.u_extrude_scale,t.transform.pixelsToGLUnits[0]*t.transform.altitude,t.transform.pixelsToGLUnits[1]*t.transform.altitude)):(a.uniform1i(h.u_scale_with_map,!1),a.uniform2fv(h.u_extrude_scale,t.transform.pixelsToGLUnits)),a.uniform1f(h.u_devicepixelratio,n.devicePixelRatio),a.uniformMatrix4fv(h.u_matrix,!1,t.translatePosMatrix(s.posMatrix,l,r.paint["circle-translate"],r.paint["circle-translate-anchor"])),c.setUniforms(a,"circle",h,r,{zoom:t.transform.zoom});for(var d=0;d<u.length;d++){var p=u[d];p.vaos[r.id].bind(a,h,p.layoutVertexBuffer,p.elementBuffer,p.paintVertexBuffers[r.id]),a.drawElements(a.TRIANGLES,3*p.elementBuffer.length,a.UNSIGNED_SHORT,0)}}}}}},{"../util/browser":398}],319:[function(t,e,r){"use strict";e.exports=function(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),c=l.getBucket(r);if(c){var u=c.bufferGroups.collisionBox;if(u&&u.length){var f=u[0];0!==f.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)),f.vaos[r.id].bind(i,a,f.layoutVertexBuffer),i.drawArrays(i.LINES,0,f.layoutVertexBuffer.length))}}}}},{}],320:[function(t,e,r){"use strict";var n=t("../lib/debugtext"),i=t("../util/browser"),a=t("gl-matrix").mat4,o=t("../data/bucket").EXTENT,s=t("../data/buffer"),l=t("./vertex_array_object");function c(t,e,r){var c=t.gl;c.disable(c.STENCIL_TEST),t.lineWidth(1*i.devicePixelRatio);var u=r.posMatrix,f=t.useProgram("debug");c.uniformMatrix4fv(f.u_matrix,!1,u),c.uniform4f(f.u_color,1,0,0,1),t.debugVAO.bind(c,f,t.debugBuffer),c.drawArrays(c.LINE_STRIP,0,t.debugBuffer.length);for(var h=n(r.toString(),50,200,5),d=new t.PosArray,p=0;p<h.length;p+=2)d.emplaceBack(h[p],h[p+1]);var m=new s(d.serialize(),t.PosArray.serialize(),s.BufferType.VERTEX);(new l).bind(c,f,m),c.uniform4f(f.u_color,1,1,1,1);for(var v=e.getTile(r).tileSize,g=o/(Math.pow(2,t.transform.zoom-r.z)*v),y=[[-1,-1],[-1,1],[1,-1],[1,1]],b=0;b<y.length;b++){var x=y[b];c.uniformMatrix4fv(f.u_matrix,!1,a.translate([],u,[g*x[0],g*x[1],0])),c.drawArrays(c.LINES,0,m.length)}c.uniform4f(f.u_color,0,0,0,1),c.uniformMatrix4fv(f.u_matrix,!1,u),c.drawArrays(c.LINES,0,m.length)}e.exports=function(t,e,r){if(t.isOpaquePass)return;if(!t.options.debug)return;for(var n=0;n<r.length;n++)c(t,e,r[n])}},{"../data/bucket":301,"../data/buffer":306,"../lib/debugtext":314,"../util/browser":398,"./vertex_array_object":329,"gl-matrix":198}],321:[function(t,e,r){"use strict";var n=t("../source/pixels_to_tile_units");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,c=t.gl,u=r.paint["fill-pattern"];if(u)l=t.useProgram("pattern"),o(u,r.paint["fill-opacity"],i,n,t,l),c.activeTexture(c.TEXTURE0),t.spriteAtlas.bind(c,!0);else{var f=a.paintAttributes.fill[r.id];l=t.useProgram("fill",f.defines,f.vertexPragmas,f.fragmentPragmas),a.setUniforms(c,"fill",l,r,{zoom:t.transform.zoom})}c.uniformMatrix4fv(l.u_matrix,!1,t.translatePosMatrix(n.posMatrix,i,r.paint["fill-translate"],r.paint["fill-translate-anchor"])),t.enableTileClippingMask(n);for(var h=0;h<s.length;h++){var d=s[h];d.vaos[r.id].bind(c,l,d.layoutVertexBuffer,d.elementBuffer,d.paintVertexBuffers[r.id]),c.drawElements(c.TRIANGLES,d.elementBuffer.length,c.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,c=a.bufferGroups.fill,u=r.paint["fill-pattern"],f=r.paint["fill-opacity"],h=r.getPaintProperty("fill-outline-color");if(u&&!h)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,f),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"])),u&&o(u,f,i,n,t,s),t.enableTileClippingMask(n);for(var p=0;p<c.length;p++){var m=c[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,i,a,o){var s=a.gl,l=a.spriteAtlas.getPosition(t.from,!0),c=a.spriteAtlas.getPosition(t.to,!0);if(l&&c){s.uniform1i(o.u_image,0),s.uniform2fv(o.u_pattern_tl_a,l.tl),s.uniform2fv(o.u_pattern_br_a,l.br),s.uniform2fv(o.u_pattern_tl_b,c.tl),s.uniform2fv(o.u_pattern_br_b,c.br),s.uniform1f(o.u_opacity,e),s.uniform1f(o.u_mix,t.t),s.uniform1f(o.u_tile_units_to_pixels,1/n(r,1,a.transform.tileZoom)),s.uniform2fv(o.u_pattern_size_a,l.size),s.uniform2fv(o.u_pattern_size_b,c.size),s.uniform1f(o.u_scale_a,t.fromScale),s.uniform1f(o.u_scale_b,t.toScale);var u=r.tileSize*Math.pow(2,a.transform.tileZoom-r.coord.z),f=u*(r.coord.x+i.w*Math.pow(2,r.coord.z)),h=u*r.coord.y;s.uniform2f(o.u_pixel_coord_upper,f>>16,h>>16),s.uniform2f(o.u_pixel_coord_lower,65535&f,65535&h),s.activeTexture(s.TEXTURE0),a.spriteAtlas.bind(s,!0)}}e.exports=function(t,e,r,n){var o,s=t.gl;s.enable(s.STENCIL_TEST),o=!r.paint["fill-pattern"]&&(r.isPaintValueFeatureConstant("fill-color")&&r.isPaintValueFeatureConstant("fill-opacity")&&1===r.paint["fill-color"][3]&&1===r.paint["fill-opacity"]);if(t.isOpaquePass===o){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 c=r.getPaintProperty("fill-outline-color");(c||!r.paint["fill-pattern"])&&c?t.setDepthSublayer(2):t.setDepthSublayer(0);for(var u=0;u<n.length;u++)a(t,e,r,n[u])}}},{"../source/pixels_to_tile_units":335}],322:[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,c=r.paint["line-blur"]+l,u=r.paint["line-color"],f=t.transform,h=i.create();i.scale(h,h,[1,Math.cos(f._pitch)]),i.rotate(h,h,t.transform.angle);var d,p,m,v,g,y=Math.sqrt(f.height*f.height/4*(1+f.altitude*f.altitude)),b=(y+f.height/2*Math.tan(f._pitch))/y-1,x=r.paint["line-dasharray"],_=r.paint["line-pattern"];if(x)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,c),s.uniform4fv(d.u_color,u),s.uniform1f(d.u_opacity,r.paint["line-opacity"]),p=t.lineAtlas.getDash(x.from,"round"===r.layout["line-cap"]),m=t.lineAtlas.getDash(x.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,x.t),s.uniform1f(d.u_extra,b),s.uniform1f(d.u_offset,-r.paint["line-offset"]),s.uniformMatrix2fv(d.u_antialiasingmatrix,!1,h);else if(_){if(v=t.spriteAtlas.getPosition(_.from,!0),g=t.spriteAtlas.getPosition(_.to,!0),!v||!g)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,c),s.uniform2fv(d.u_pattern_tl_a,v.tl),s.uniform2fv(d.u_pattern_br_a,v.br),s.uniform2fv(d.u_pattern_tl_b,g.tl),s.uniform2fv(d.u_pattern_br_b,g.br),s.uniform1f(d.u_fade,_.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,h)}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,c),s.uniform1f(d.u_extra,b),s.uniform1f(d.u_offset,-r.paint["line-offset"]),s.uniformMatrix2fv(d.u_antialiasingmatrix,!1,h),s.uniform4fv(d.u_color,u),s.uniform1f(d.u_opacity,r.paint["line-opacity"]);for(var w=0;w<o.length;w++){var M=o[w],k=e.getTile(M),A=k.getBucket(r);if(A){var T=A.bufferGroups.line;if(T){t.enableTileClippingMask(M);var E=t.translatePosMatrix(M.posMatrix,k,r.paint["line-translate"],r.paint["line-translate-anchor"]);s.uniformMatrix4fv(d.u_matrix,!1,E);var S=1/a(k,1,t.transform.zoom);if(x){var L=p.width*x.fromScale,C=m.width*x.toScale,P=[1/a(k,L,t.transform.tileZoom),-p.height/2],z=[1/a(k,C,t.transform.tileZoom),-m.height/2],O=t.lineAtlas.width/(256*Math.min(L,C)*n.devicePixelRatio)/2;s.uniform1f(d.u_ratio,S),s.uniform2fv(d.u_patternscale_a,P),s.uniform2fv(d.u_patternscale_b,z),s.uniform1f(d.u_sdfgamma,O)}else _?(s.uniform1f(d.u_ratio,S),s.uniform2fv(d.u_pattern_size_a,[a(k,v.size[0]*_.fromScale,t.transform.tileZoom),g.size[1]]),s.uniform2fv(d.u_pattern_size_b,[a(k,g.size[0]*_.toScale,t.transform.tileZoom),g.size[1]])):s.uniform1f(d.u_ratio,S);for(var D=0;D<T.length;D++){var I=T[D];I.vaos[r.id].bind(s,d,I.layoutVertexBuffer,I.elementBuffer),s.drawElements(s.TRIANGLES,3*I.elementBuffer.length,s.UNSIGNED_SHORT,0)}}}}}}}},{"../source/pixels_to_tile_units":335,"../util/browser":398,"gl-matrix":198}],323:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/struct_array");function a(t,e,r,n){if(!t.isOpaquePass){var i=t.gl;i.enable(i.DEPTH_TEST),t.depthMask(!0),i.depthFunc(i.LESS);for(var a=n.length&&n[0].z,s=0;s<n.length;s++){var l=n[s];t.setDepthSublayer(l.z-a),o(t,e,r,l)}i.depthFunc(i.LEQUAL)}}function o(t,e,r,i){var a=t.gl;a.disable(a.STENCIL_TEST);var o,s,l=e.getTile(i),c=t.transform.calculatePosMatrix(i,e.maxzoom),u=t.useProgram("raster");a.uniformMatrix4fv(u.u_matrix,!1,c),a.uniform1f(u.u_brightness_low,r.paint["raster-brightness-min"]),a.uniform1f(u.u_brightness_high,r.paint["raster-brightness-max"]),a.uniform1f(u.u_saturation_factor,(o=r.paint["raster-saturation"])>0?1-1/(1.001-o):-o),a.uniform1f(u.u_contrast_factor,(s=r.paint["raster-contrast"])>0?1/(1-s):1+s),a.uniform3fv(u.u_spin_weights,function(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}(r.paint["raster-hue-rotate"]));var f,h,d=l.source&&l.source.findLoadedParent(i,0,{}),p=function(t,e,r,i){var a=[1,0],o=r.paint["raster-fade-duration"];if(t.source&&o>0){var s=(new Date).getTime(),l=(s-t.timeAdded)/o,c=e?(s-e.timeAdded)/o:-1,u=i.coveringZoomLevel(t.source),f=!!e&&Math.abs(e.coord.z-u)>Math.abs(t.coord.z-u);!e||f?(a[0]=n.clamp(l,0,1),a[1]=1-a[0]):(a[0]=n.clamp(1-c,0,1),a[1]=1-a[0])}var h=r.paint["raster-opacity"];return a[0]*=h,a[1]*=h,a}(l,d,r,t.transform);a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,l.texture),a.activeTexture(a.TEXTURE1),d?(a.bindTexture(a.TEXTURE_2D,d.texture),f=Math.pow(2,d.coord.z-l.coord.z),h=[l.coord.x*f%1,l.coord.y*f%1]):(a.bindTexture(a.TEXTURE_2D,l.texture),p[1]=0),a.uniform2fv(u.u_tl_parent,h||[0,0]),a.uniform1f(u.u_scale_parent,f||1),a.uniform1f(u.u_buffer_scale,1),a.uniform1f(u.u_opacity0,p[0]),a.uniform1f(u.u_opacity1,p[1]),a.uniform1i(u.u_image0,0),a.uniform1i(u.u_image1,1);var m=l.boundsBuffer||t.rasterBoundsBuffer;(l.boundsVAO||t.rasterBoundsVAO).bind(a,u,m),a.drawArrays(a.TRIANGLE_STRIP,0,m.length)}e.exports=a,a.RasterBoundsArray=new i({members:[{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]})},{"../util/struct_array":412,"../util/util":414}],324:[function(t,e,r){"use strict";var n=t("../util/browser"),i=t("./draw_collision_debug"),a=t("../source/pixels_to_tile_units");function o(t,e,r,n,i,a,o,l,c,u,f,h,d,p,m){for(var v=0;v<n.length;v++){var g=e.getTile(n[v]),y=g.getBucket(r);if(y){var b=y.bufferGroups,x=i?b.glyph:b.icon;x.length&&(t.enableTileClippingMask(n[v]),s(t,r,n[v].posMatrix,g,y,x,i,i||y.sdfIcons,!i&&y.iconsNeedLinear,i?y.adjustedTextSize:y.adjustedIconSize,y.fontstack,a,o,l,c,u,f,h,d,p,m))}}}function s(t,e,r,i,o,s,l,c,u,f,h,d,p,m,v,g,y,b,x,_,w){var M,k,A,T=t.gl,E=t.transform,S="map"===m,L="map"===v,C=l?24:1,P=g/C;if(L?(k=a(i,1,t.transform.zoom)*P,A=1/Math.cos(E._pitch),M=[k,k]):(k=t.transform.altitude*P,A=1,M=[E.pixelsToGLUnits[0]*k,E.pixelsToGLUnits[1]*k]),l||t.style.sprite.loaded()){var z=t.useProgram(c?"sdf":"icon");if(T.uniformMatrix4fv(z.u_matrix,!1,t.translatePosMatrix(r,i,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),l){var O=h&&t.glyphSource.getGlyphAtlas(h);if(!O)return;O.updateTexture(T),T.uniform2f(z.u_texsize,O.width/4,O.height/4)}else{var D=t.options.rotating||t.options.zooming,I=1!==P||n.devicePixelRatio!==t.spriteAtlas.pixelRatio||u,R=L||t.transform.pitch;t.spriteAtlas.bind(T,c||D||I||R),T.uniform2f(z.u_texsize,t.spriteAtlas.width/4,t.spriteAtlas.height/4)}var N,F=Math.log(g/f)/Math.LN2||0;if(T.uniform1f(z.u_zoom,10*(t.transform.zoom-F)),T.activeTexture(T.TEXTURE1),t.frameHistory.bind(T),T.uniform1i(z.u_fadetexture,1),c){var j=.105*C/g/n.devicePixelRatio;if(y){T.uniform1f(z.u_gamma,(1.19*x/P/8+j)*A),T.uniform4fv(z.u_color,b),T.uniform1f(z.u_opacity,_),T.uniform1f(z.u_buffer,(6-y/P)/8);for(var B=0;B<s.length;B++)(N=s[B]).vaos[e.id].bind(T,z,N.layoutVertexBuffer,N.elementBuffer),T.drawElements(T.TRIANGLES,3*N.elementBuffer.length,T.UNSIGNED_SHORT,0)}T.uniform1f(z.u_gamma,j*A),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 U=0;U<s.length;U++)(N=s[U]).vaos[e.id].bind(T,z,N.layoutVertexBuffer,N.elementBuffer),T.drawElements(T.TRIANGLES,3*N.elementBuffer.length,T.UNSIGNED_SHORT,0)}else{T.uniform1f(z.u_opacity,_);for(var V=0;V<s.length;V++)(N=s[V]).vaos[e.id].bind(T,z,N.layoutVertexBuffer,N.elementBuffer),T.drawElements(T.TRIANGLES,3*N.elementBuffer.length,T.UNSIGNED_SHORT,0)}}}e.exports=function(t,e,r,n){if(t.isOpaquePass)return;var a=!(r.layout["text-allow-overlap"]||r.layout["icon-allow-overlap"]||r.layout["text-ignore-placement"]||r.layout["icon-ignore-placement"]),s=t.gl;a?s.disable(s.STENCIL_TEST):s.enable(s.STENCIL_TEST);t.setDepthSublayer(0),t.depthMask(!1),s.disable(s.DEPTH_TEST),o(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"]),o(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"]),s.enable(s.DEPTH_TEST),e.map.showCollisionBoxes&&i(t,e,r,n)}},{"../source/pixels_to_tile_units":335,"../util/browser":398,"./draw_collision_debug":319}],325:[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,r=Date.now();if(this.firstFrame&&(r=0,this.firstFrame=!1),(t=Math.floor(10*t))<this.previousZoom)for(e=t+1;e<=this.previousZoom;e++)this.changeTimes[e]=r,this.changeOpacities[e]=this.opacities[e];else for(e=t;e>this.previousZoom;e--)this.changeTimes[e]=r,this.changeOpacities[e]=this.opacities[e];for(e=0;e<256;e++){var n=(r-this.changeTimes[e])/this.fadeDuration*255;this.opacities[e]=e<=t?this.changeOpacities[e]+n:this.changeOpacities[e]-n}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))}},{}],326:[function(t,e,r){"use strict";var n=t("../util/util");function i(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={}}e.exports=i,i.prototype.setSprite=function(t){this.sprite=t},i.prototype.getDash=function(t,e){var r=t.join(",")+e;return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},i.prototype.addDash=function(t,e){var r=e?7:0,i=2*r+1;if(this.nextRow+i>this.height)return n.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o<t.length;o++)a+=t[o];for(var s=this.width/a,l=s/2,c=t.length%2==1,u=-r;u<=r;u++)for(var f=this.nextRow+r+u,h=this.width*f,d=c?-t[t.length-1]:0,p=t[0],m=1,v=0;v<this.width;v++){for(;p<v/s;)d=p,p+=t[m],c&&m===t.length-1&&(p+=t[0]),m++;var g,y=Math.abs(v-d*s),b=Math.abs(v-p*s),x=Math.min(y,b),_=m%2==1;if(e){var w=r?u/r*(l+1):0;if(_){var M=l-Math.abs(w);g=Math.sqrt(x*x+M*M)}else g=l-Math.sqrt(x*x+w*w)}else g=(_?1:-1)*x;this.data[3+4*(h+v)]=Math.max(0,Math.min(255,g+128))}var k={y:(this.nextRow+r+.5)/this.height,height:2*r/this.height,width:a};return this.nextRow+=i,this.dirty=!0,k},i.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":414}],327:[function(t,e,r){"use strict";var n=t("../util/browser"),i=t("gl-matrix").mat4,a=t("./frame_history"),o=t("../source/source_cache"),s=t("../data/bucket").EXTENT,l=t("../source/pixels_to_tile_units"),c=t("../util/util"),u=t("../util/struct_array"),f=t("../data/buffer"),h=t("./vertex_array_object"),d=t("./draw_raster").RasterBoundsArray,p=t("./create_uniform_pragmas");function m(t,e){this.gl=t,this.transform=e,this.reusableTextures={},this.preFbos={},this.frameHistory=new a,this.setup(),this.numSublayers=o.maxUnderzooming+o.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.lineWidthRange=t.getParameter(t.ALIASED_LINE_WIDTH_RANGE)}e.exports=m,c.extend(m.prototype,t("./painter/use_program")),m.prototype.resize=function(t,e){var r=this.gl;this.width=t*n.devicePixelRatio,this.height=e*n.devicePixelRatio,r.viewport(0,0,this.width,this.height)},m.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 u({members:[{name:"a_pos",type:"Int16",components:2}]}),r=new e;r.emplaceBack(0,0),r.emplaceBack(s,0),r.emplaceBack(0,s),r.emplaceBack(s,s),this.tileExtentBuffer=new f(r.serialize(),e.serialize(),f.BufferType.VERTEX),this.tileExtentVAO=new h,this.tileExtentPatternVAO=new h;var n=new e;n.emplaceBack(0,0),n.emplaceBack(s,0),n.emplaceBack(s,s),n.emplaceBack(0,s),n.emplaceBack(0,0),this.debugBuffer=new f(n.serialize(),e.serialize(),f.BufferType.VERTEX),this.debugVAO=new h;var i=new d;i.emplaceBack(0,0,0,0),i.emplaceBack(s,0,32767,0),i.emplaceBack(0,s,0,32767),i.emplaceBack(s,s,32767,32767),this.rasterBoundsBuffer=new f(i.serialize(),d.serialize(),f.BufferType.VERTEX),this.rasterBoundsVAO=new h},m.prototype.clearColor=function(){var t=this.gl;t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT)},m.prototype.clearStencil=function(){var t=this.gl;t.clearStencil(0),t.stencilMask(255),t.clear(t.STENCIL_BUFFER_BIT)},m.prototype.clearDepth=function(){var t=this.gl;t.clearDepth(1),this.depthMask(!0),t.clear(t.DEPTH_BUFFER_BIT)},m.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=p([{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)},m.prototype.enableTileClippingMask=function(t){var e=this.gl;e.stencilFunc(e.EQUAL,this._tileClippingMaskIDs[t.id],248)},m.prototype.prepareBuffers=function(){},m.prototype.bindDefaultFramebuffer=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,null)};var v={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")};m.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})},m.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&&v.debug(this,o,s)}},m.prototype.depthMask=function(t){t!==this._depthMask&&(this._depthMask=t,this.gl.depthMask(t))},m.prototype.renderLayer=function(t,e,r,n){r.isHidden(this.transform.zoom)||("background"===r.type||n.length)&&(this.id=r.id,v[r.type](t,e,r,n))},m.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)},m.prototype.translatePosMatrix=function(t,e,r,n){if(!r[0]&&!r[1])return t;if("viewport"===n){var a=Math.sin(-this.transform.angle),o=Math.cos(-this.transform.angle);r=[r[0]*o-r[1]*a,r[0]*a+r[1]*o]}var s=[l(e,r[0],this.transform.zoom),l(e,r[1],this.transform.zoom),0],c=new Float32Array(16);return i.translate(c,t,s),c},m.prototype.saveTexture=function(t){var e=this.reusableTextures[t.size];e?e.push(t):this.reusableTextures[t.size]=[t]},m.prototype.getTexture=function(t){var e=this.reusableTextures[t];return e&&e.length>0?e.pop():null},m.prototype.lineWidth=function(t){this.gl.lineWidth(c.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},m.prototype.showOverdrawInspector=function(t){if(t||this._showOverdrawInspector){this._showOverdrawInspector=t;var e=this.gl;if(t){e.blendFunc(e.CONSTANT_COLOR,e.ONE);e.blendColor(1/8,1/8,1/8,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":301,"../data/buffer":306,"../source/pixels_to_tile_units":335,"../source/source_cache":339,"../util/browser":398,"../util/struct_array":412,"../util/util":414,"./create_uniform_pragmas":316,"./draw_background":317,"./draw_circle":318,"./draw_debug":320,"./draw_fill":321,"./draw_line":322,"./draw_raster":323,"./draw_symbol":324,"./frame_history":325,"./painter/use_program":328,"./vertex_array_object":329,"gl-matrix":198}],328:[function(t,e,r){"use strict";var n=t("assert"),i=t("../../util/util"),a=t("mapbox-gl-shaders"),o=a.util;function s(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)})}e.exports._createProgram=function(t,e,r,l){for(var c=this.gl,u=c.createProgram(),f=a[t],h="#define MAPBOX_GL_JS;\n",d=0;d<e.length;d++)h+="#define "+e[d]+";\n";var p=c.createShader(c.FRAGMENT_SHADER);c.shaderSource(p,s(h+f.fragmentSource,l)),c.compileShader(p),n(c.getShaderParameter(p,c.COMPILE_STATUS),c.getShaderInfoLog(p)),c.attachShader(u,p);var m=c.createShader(c.VERTEX_SHADER);c.shaderSource(m,s(h+o+f.vertexSource,r)),c.compileShader(m),n(c.getShaderParameter(m,c.COMPILE_STATUS),c.getShaderInfoLog(m)),c.attachShader(u,m),c.linkProgram(u),n(c.getProgramParameter(u,c.LINK_STATUS),c.getProgramInfoLog(u));for(var v={},g=c.getProgramParameter(u,c.ACTIVE_ATTRIBUTES),y=0;y<g;y++){var b=c.getActiveAttrib(u,y);v[b.name]=c.getAttribLocation(u,b.name)}for(var x={},_=c.getProgramParameter(u,c.ACTIVE_UNIFORMS),w=0;w<_;w++){var M=c.getActiveUniform(u,w);x[M.name]=c.getUniformLocation(u,M.name)}return i.extend({program:u,definition:f,attributes:v,numAttributes:g},v,x)},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);return this.currentProgram!==a&&(i.useProgram(a.program),this.currentProgram=a),a}},{"../../util/util":414,assert:51,"mapbox-gl-shaders":275}],329:[function(t,e,r){"use strict";var n=t("assert");function i(){this.boundProgram=null,this.boundVertexBuffer=null,this.boundVertexBuffer2=null,this.boundElementBuffer=null,this.vao=null}e.exports=i,i.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)},i.prototype.freshBind=function(t,e,r,i,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=i;else{o=t.currentNumAttributes||0;for(var l=s;l<o;l++)n(0!==l),t.disableVertexAttribArray(l)}for(var c=o;c<s;c++)t.enableVertexAttribArray(c);r.bind(t),r.setVertexAttribPointers(t,e),a&&(a.bind(t),a.setVertexAttribPointers(t,e)),i&&i.bind(t),t.currentNumAttributes=s},i.prototype.unbind=function(t){var e=t.extVertexArrayObject;e&&e.bindVertexArrayOES(null)},i.prototype.destroy=function(t){var e=t.extVertexArrayObject;e&&this.vao&&(e.deleteVertexArrayOES(this.vao),this.vao=null)}},{assert:51}],330:[function(t,e,r){"use strict";var n=t("../util/evented"),i=t("../util/util"),a=t("resolve-url"),o=t("../data/bucket").EXTENT;function s(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=o/this.tileSize;this.workerOptions=i.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:o,maxZoom:this.maxzoom},superclusterOptions:{maxZoom:Math.min(e.clusterMaxZoom,this.maxzoom-1)||this.maxzoom-1,extent:o,radius:(e.clusterRadius||50)*n,log:!1}},e.workerOptions),this._updateWorkerData(function(t){t?this.fire("error",{error:t}):this.fire("load")}.bind(this))}e.exports=s,s.prototype=i.inherit(n,{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){if(t)return this.fire("error",{error:t});this.fire("change")}.bind(this)),this},_updateWorkerData:function(t){var e=i.extend({},this.workerOptions),r=this._data;"string"==typeof r?e.url="undefined"!=typeof window?a(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":301,"../util/evented":406,"../util/util":414,"resolve-url":488}],331:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/ajax"),a=t("geojson-rewind"),o=t("./geojson_wrapper"),s=t("vt-pbf"),l=t("supercluster"),c=t("geojson-vt"),u=t("./vector_tile_worker_source");function f(t,e,r){r&&(this.loadGeoJSON=r),u.call(this,t,e)}e.exports=f,f.prototype=n.inherit(u,{_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 o(i.features);a.name="_geojsonTileLayer";var l=s({layers:{_geojsonTileLayer:a}});0===l.byteOffset&&l.byteLength===l.buffer.byteLength||(l=new Uint8Array(l)),e(null,{tile:a,rawTileData:l.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.")):(a(n,!0),void this._indexData(n,t,function(r,n){if(r)return e(r);this._geoJSONIndexes[t.source]=n,e(null)}.bind(this)))}.bind(this);this.loadGeoJSON(t,r)},loadGeoJSON:function(t,e){if(t.url)i.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,l(e.superclusterOptions).load(t.features)):r(null,c(t,e.geojsonVtOptions))}catch(t){return r(t)}}})},{"../util/ajax":397,"../util/util":414,"./geojson_wrapper":332,"./vector_tile_worker_source":343,"geojson-rewind":147,"geojson-vt":151,supercluster:518,"vt-pbf":550}],332:[function(t,e,r){"use strict";var n=t("point-geometry"),i=t("vector-tile").VectorTileFeature,a=t("../data/bucket").EXTENT;function o(t){this.features=t,this.length=t.length,this.extent=a}function s(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=a}e.exports=o,o.prototype.feature=function(t){return new s(this.features[t])},s.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var r=t[e],i=[],a=0;a<r.length;a++)i.push(new n(r[a][0],r[a][1]));this.geometry.push(i)}return this.geometry},s.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]},s.prototype.toGeoJSON=i.prototype.toGeoJSON},{"../data/bucket":301,"point-geometry":458,"vector-tile":544}],333:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("./tile_coord"),a=t("../geo/lng_lat"),o=t("point-geometry"),s=t("../util/evented"),l=t("../util/ajax"),c=t("../data/bucket").EXTENT,u=t("../render/draw_raster").RasterBoundsArray,f=t("../data/buffer"),h=t("../render/vertex_array_object");function d(t,e,r){this.id=t,this.dispatcher=r,this.url=e.url,this.coordinates=e.coordinates,l.getImage(e.url,function(t,r){if(t)return this.fire("error",{error:t});this.image=r,this.image.addEventListener("load",function(){this.map._rerender()}.bind(this)),this._loaded=!0,this.fire("load"),this.map&&this.setCoordinates(e.coordinates)}.bind(this))}e.exports=d,d.prototype=n.inherit(s,{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(a.convert(t)).zoomTo(0)}),s=this.centerCoord=n.getCoordinatesCenter(r);return s.column=Math.round(s.column),s.row=Math.round(s.row),this.minzoom=this.maxzoom=s.zoom,this._coord=new i(s.zoom,s.column,s.row),this._tileCoords=r.map(function(t){var e=t.zoomTo(s.zoom);return new o(Math.round((e.column-s.column)*c),Math.round((e.row-s.row)*c))}),this.fire("change"),this},_setTile:function(t){this._prepared=!1,this.tile=t;var e=new u;e.emplaceBack(this._tileCoords[0].x,this._tileCoords[0].y,0,0),e.emplaceBack(this._tileCoords[1].x,this._tileCoords[1].y,32767,0),e.emplaceBack(this._tileCoords[3].x,this._tileCoords[3].y,0,32767),e.emplaceBack(this._tileCoords[2].x,this._tileCoords[2].y,32767,32767),this.tile.buckets={},this.tile.boundsBuffer=new f(e.serialize(),u.serialize(),f.BufferType.VERTEX),this.tile.boundsVAO=new h,this.tile.state="loaded"},prepare:function(){if(this._loaded&&this.image&&this.image.complete&&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.image)):(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.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":301,"../data/buffer":306,"../geo/lng_lat":311,"../render/draw_raster":323,"../render/vertex_array_object":329,"../util/ajax":397,"../util/evented":406,"../util/util":414,"./tile_coord":341,"point-geometry":458}],334:[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":397,"../util/browser":398,"../util/mapbox":411,"../util/util":414}],335:[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":301}],336:[function(t,e,r){"use strict";var n=t("./tile_coord");function i(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}r.rendered=function(t,e,r,n,a,o){var s=t.tilesIn(r);s.sort(i);for(var l=[],c=0;c<s.length;c++){var u=s[c];u.tile.featureIndex&&l.push(u.tile.featureIndex.query({queryGeometry:u.queryGeometry,scale:u.scale,tileSize:u.tile.tileSize,bearing:o,params:n},e))}return function(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}(l)},r.source=function(t,e){for(var r=t.getRenderableIds().map(function(e){return t.getTileByID(e)}),i=[],a={},o=0;o<r.length;o++){var s=r[o],l=new n(Math.min(s.sourceMaxZoom,s.coord.z),s.coord.x,s.coord.y,0).id;a[l]||(a[l]=!0,s.querySourceFeatures(i,e))}return i}},{"./tile_coord":341}],337:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/ajax"),a=t("../util/evented"),o=t("./load_tilejson"),s=t("../util/mapbox").normalizeTileURL;function l(t,e,r){this.id=t,this.dispatcher=r,n.extend(this,n.pick(e,["url","scheme","tileSize"])),o(e,function(t,e){if(t)return this.fire("error",t);n.extend(this,e),this.fire("load")}.bind(this))}e.exports=l,l.prototype=n.inherit(a,{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){var r=s(t.coord.url(this.tiles,null,this.scheme),this.url,this.tileSize);t.request=i.getImage(r,function(r,n){if(delete t.request,t.aborted)return;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)}.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":397,"../util/evented":406,"../util/mapbox":411,"../util/util":414,"./load_tilejson":334}],338:[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)).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":330,"../source/image_source":333,"../source/raster_tile_source":337,"../source/vector_tile_source":342,"../source/video_source":344,"../util/util":414}],339:[function(t,e,r){"use strict";var n=t("./source"),i=t("./tile"),a=t("../util/evented"),o=t("./tile_coord"),s=t("../util/lru_cache"),l=t("../geo/coordinate"),c=t("../util/util"),u=t("../data/bucket").EXTENT;function f(t,e,r){this.id=t,this.dispatcher=r;var i=this._source=n.create(t,e,r).on("load",function(){this.map&&this._source.onAdd&&this._source.onAdd(this.map),this._sourceLoaded=!0,this.tileSize=i.tileSize,this.minzoom=i.minzoom,this.maxzoom=i.maxzoom,this.roundZoom=i.roundZoom,this.reparseOverscaled=i.reparseOverscaled,this.isTileClipped=i.isTileClipped,this.attribution=i.attribution,this.vectorLayerIds=i.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 s(0,this.unloadTile.bind(this)),this._isIdRenderable=this._isIdRenderable.bind(this)}function h(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)))*u,y:(n.row-t.y)*u}}function d(t,e){return t%32-e%32}e.exports=f,f.maxOverzooming=10,f.maxUnderzooming=3,f.prototype=c.inherit(a,{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(d)},getRenderableIds:function(){return this.getIds().filter(this._isIdRenderable)},_isIdRenderable:function(t){return this._tiles[t].isRenderable()&&!this._coveredTiles[t]},reload:function(){for(var t in this._cache.reset(),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){if(e)return 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}),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.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)*(Math.ceil(t.height/t.tileSize)+1);this._cache.setMaxSize(Math.floor(5*e))},update:function(t,e){if(this._sourceLoaded){var r,n,i;this.updateCacheSize(t);var a=(this.roundZoom?Math.round:Math.floor)(this.getZoom(t)),s=Math.max(a-f.maxOverzooming,this.minzoom),l=Math.max(a+f.maxUnderzooming,this.minzoom),u={},h=(new Date).getTime();this._coveredTiles={};var d=this.used?t.coveringTiles(this._source):[];for(r=0;r<d.length;r++)n=d[r],i=this.addTile(n),u[n.id]=!0,i.isRenderable()||this.findLoadedChildren(n,l,u)||this.findLoadedParent(n,s,u);for(var p,m={},v=Object.keys(u),g=0;g<v.length;g++){var y=v[g];n=o.fromID(y),(i=this._tiles[y])&&i.timeAdded>h-(e||0)&&(this.findLoadedChildren(n,l,u)&&(u[y]=!0),this.findLoadedParent(n,s,m))}for(p in m)u[p]||(this._coveredTiles[p]=!0);for(p in m)u[p]=!0;var b=c.keysDifference(this._tiles,u);for(r=0;r<b.length;r++)this.removeTile(+b[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=this._cache.get(r.id))&&this._redoPlacement&&this._redoPlacement(e),!e){var n=t.z,a=n>this.maxzoom?Math.pow(2,n-this.maxzoom):1;e=new i(r,this.tileSize*a,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,i=1/0,a=-1/0,s=-1/0,c=t[0].zoom,f=0;f<t.length;f++){var d=t[f];n=Math.min(n,d.column),i=Math.min(i,d.row),a=Math.max(a,d.column),s=Math.max(s,d.row)}for(var p=0;p<r.length;p++){var m=this._tiles[r[p]],v=o.fromID(r[p]),g=[h(v,m.sourceMaxZoom,new l(n,i,c)),h(v,m.sourceMaxZoom,new l(a,s,c))];if(g[0].x<u&&g[0].y<u&&g[1].x>=0&&g[1].y>=0){for(var y=[],b=0;b<t.length;b++)y.push(h(v,m.sourceMaxZoom,t[b]));var x=e[m.coord.id];void 0===x&&(x=e[m.coord.id]={tile:m,coord:v,queryGeometry:[],scale:Math.pow(2,this.transform.zoom-m.coord.z)}),x.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++){this.getTileByID(t[e]).redoPlacement(this)}},getVisibleCoordinates:function(){return this.getRenderableIds().map(o.fromID)}})},{"../data/bucket":301,"../geo/coordinate":310,"../util/evented":406,"../util/lru_cache":410,"../util/util":414,"./source":338,"./tile":340,"./tile_coord":341}],340:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../data/bucket"),a=t("../data/feature_index"),o=t("vector-tile"),s=t("pbf"),l=t("../util/vectortile_to_geojson"),c=t("feature-filter"),u=t("../symbol/collision_tile"),f=t("../symbol/collision_box"),h=t("../symbol/symbol_instances"),d=t("../symbol/symbol_quads");function p(t,e,r){this.coord=t,this.uid=n.uniqueId(),this.uses=0,this.tileSize=e,this.sourceMaxZoom=r,this.buckets={},this.state="loading"}function m(t,e){if(e){for(var r={},a=0;a<t.length;a++){var o=e.getLayer(t[a].layerId);if(o){var s=i.create(n.extend({layer:o,childLayers:t[a].childLayerIds.map(e.getLayer.bind(e)).filter(function(t){return t})},t[a]));r[s.id]=s}}return r}}e.exports=p,p.prototype={loadVectorData:function(t,e){this.state="loaded",t&&(this.collisionBoxArray=new f(t.collisionBoxArray),this.collisionTile=new u(t.collisionTile,this.collisionBoxArray),this.symbolInstancesArray=new h(t.symbolInstancesArray),this.symbolQuadsArray=new d(t.symbolQuadsArray),this.featureIndex=new a(t.featureIndex,t.rawTileData,this.collisionTile),this.rawTileData=t.rawTileData,this.buckets=m(t.buckets,e))},reloadSymbolData:function(t,e,r){if("unloaded"!==this.state){for(var i in this.collisionTile=new u(t.collisionTile,this.collisionBoxArray),this.featureIndex.setCollisionTile(this.collisionTile),this.buckets){var a=this.buckets[i];"symbol"===a.type&&(a.destroy(e.gl),delete this.buckets[i])}n.extend(this.buckets,m(t.buckets,r))}},unloadVectorData:function(t){for(var e in this.buckets){this.buckets[e].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){"loaded"===this.state&&"reloading"!==this.state?(this.state="reloading",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},function(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)}.bind(this),this.workerID)):this.redoWhenDone=!0},getBucket:function(t){return this.buckets&&this.buckets[t.ref||t.id]},querySourceFeatures:function(t,e){if(this.rawTileData){this.vtLayers||(this.vtLayers=new o.VectorTile(new s(new Uint8Array(this.rawTileData))).layers);var r=this.vtLayers._geojsonTileLayer||this.vtLayers[e.sourceLayer];if(r)for(var n=c(e.filter),i={z:this.coord.z,x:this.coord.x,y:this.coord.y},a=0;a<r.length;a++){var u=r.feature(a);if(n(u)){var f=new l(u,this.coord.z,this.coord.x,this.coord.y);f.tile=i,t.push(f)}}}},isRenderable:function(){return"loaded"===this.state||"reloading"===this.state}}},{"../data/bucket":301,"../data/feature_index":308,"../symbol/collision_box":366,"../symbol/collision_tile":368,"../symbol/symbol_instances":377,"../symbol/symbol_quads":378,"../util/util":414,"../util/vectortile_to_geojson":415,"feature-filter":141,pbf:451,"vector-tile":544}],341:[function(t,e,r){"use strict";var n=t("assert"),i=t("whoots-js"),a=t("../geo/coordinate");function o(t,e,r,i){n(!isNaN(t)&&t>=0&&t%1==0),n(!isNaN(e)&&e>=0&&e%1==0),n(!isNaN(r)&&r>=0&&r%1==0),isNaN(i)&&(i=0),this.z=+t,this.x=+e,this.y=+r,this.w=+i,(i*=2)<0&&(i=-1*i-1);var a=1<<this.z;this.id=32*(a*a*i+a*this.y+this.x)+this.z,this.posMatrix=null}function s(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 l(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,c=e.dx/e.dy,u=t.dx>0,f=e.dx<0,h=a;h<o;h++){var d=l*Math.max(0,Math.min(t.dy,h+u-t.y0))+t.x0,p=c*Math.max(0,Math.min(e.dy,h+f-e.y0))+e.x0;i(Math.floor(p),Math.ceil(d),h)}}function c(t,e,r,n,i,a){var o,c=s(t,e),u=s(e,r),f=s(r,t);c.dy>u.dy&&(o=c,c=u,u=o),c.dy>f.dy&&(o=c,c=f,f=o),u.dy>f.dy&&(o=u,u=f,f=o),c.dy&&l(f,c,n,i,a),u.dy&&l(f,u,n,i,a)}e.exports=o,o.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y},o.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 a(i,n,e)},o.fromID=function(t){var e=t%32,r=1<<e,n=(t-e)/32,i=n%r,a=(n-i)/r%r,s=Math.floor(n/(r*r));return s%2!=0&&(s=-1*s-1),new o(e,i,a,s/=2)},o.prototype.url=function(t,e,r){var n=i.getTileBBox(this.x,this.y,this.z),a=function(t,e,r){for(var n,i="",a=t;a>0;a--)i+=(e&(n=1<<a-1)?1:0)+(r&n?2:0);return 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)},o.prototype.parent=function(t){return 0===this.z?null:this.z>t?new o(this.z-1,this.x,this.y,this.w):new o(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},o.prototype.wrapped=function(){return new o(this.z,this.x,this.y,0)},o.prototype.children=function(t){if(this.z>=t)return[new o(this.z+1,this.x,this.y,this.w)];var e=this.z+1,r=2*this.x,n=2*this.y;return[new o(e,r,n,this.w),new o(e,r+1,n,this.w),new o(e,r,n+1,this.w),new o(e,r+1,n+1,this.w)]},o.cover=function(t,e,r){var n=1<<t,i={};function a(t,e,a){var s,l;if(a>=0&&a<=n)for(s=t;s<e;s++)l=new o(r,(s%n+n)%n,a,Math.floor(s/n)),i[l.id]=l}return c(e[0],e[1],e[2],0,n,a),c(e[2],e[3],e[0],0,n,a),Object.keys(i).map(function(t){return i[t]})}},{"../geo/coordinate":310,assert:51,"whoots-js":560}],342:[function(t,e,r){"use strict";var n=t("../util/evented"),i=t("../util/util"),a=t("./load_tilejson"),o=t("../util/mapbox").normalizeTileURL;function s(t,e,r){if(this.id=t,this.dispatcher=r,i.extend(this,i.pick(e,["url","scheme","tileSize"])),this._options=i.extend({type:"vector"},e),512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");a(e,function(t,e){t?this.fire("error",t):(i.extend(this,e),this.fire("load"))}.bind(this))}e.exports=s,s.prototype=i.inherit(n,{minzoom:0,maxzoom:22,scheme:"xyz",tileSize:512,reparseOverscaled:!0,isTileClipped:!0,onAdd:function(t){this.map=t},serialize:function(){return i.extend({},this._options)},loadTile:function(t,e){var r=t.coord.z>this.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,n={url:o(t.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),uid:t.uid,coord:t.coord,zoom:t.coord.z,tileSize:this.tileSize*r,source:this.id,overscaling:r,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};function i(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)}}t.workerID?"loading"===t.state?t.reloadCallback=e:(n.rawTileData=t.rawTileData,this.dispatcher.send("reload tile",n,i.bind(this),t.workerID)):t.workerID=this.dispatcher.send("load tile",n,i.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":406,"../util/mapbox":411,"../util/util":414,"./load_tilejson":334}],343:[function(t,e,r){"use strict";var n=t("../util/ajax"),i=t("vector-tile"),a=t("pbf"),o=t("./worker_tile");function s(t,e,r){this.actor=t,this.styleLayers=e,r&&(this.loadVectorData=r),this.loading={},this.loaded={}}e.exports=s,s.prototype={loadTile:function(t,e){var r=t.source,n=t.uid;this.loading[r]||(this.loading[r]={});var i=this.loading[r][n]=new o(t);i.abort=this.loadVectorData(t,function(t,a){if(delete this.loading[r][n],t)return e(t);if(!a)return e(null,null);i.data=a.tile,i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,a.rawTileData,e),this.loaded[r]=this.loaded[r]||{},this.loaded[r][n]=i}.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){var r=n.getArrayBuffer(t.url,function(t,r){if(t)return e(t);var n=new i.VectorTile(new a(new Uint8Array(r)));e(t,{tile:n,rawTileData:r})}.bind(this));return function(){r.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].redoPlacement(t.angle,t.pitch,t.showCollisionBoxes);a.result&&e(null,a.result,a.transferables)}else n&&n[i]&&(n[i].angle=t.angle)}}},{"../util/ajax":397,"./worker_tile":346,pbf:451,"vector-tile":544}],344:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("./tile_coord"),a=t("../geo/lng_lat"),o=t("point-geometry"),s=t("../util/evented"),l=t("../util/ajax"),c=t("../data/bucket").EXTENT,u=t("../render/draw_raster").RasterBoundsArray,f=t("../data/buffer"),h=t("../render/vertex_array_object");function d(t,e){this.id=t,this.urls=e.urls,this.coordinates=e.coordinates,l.getVideo(e.urls,function(t,r){if(t)return this.fire("error",{error:t});var n;this.video=r,this.video.loop=!0,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))}e.exports=d,d.prototype=n.inherit(s,{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(a.convert(t)).zoomTo(0)}),s=this.centerCoord=n.getCoordinatesCenter(r);return s.column=Math.round(s.column),s.row=Math.round(s.row),this.minzoom=this.maxzoom=s.zoom,this._coord=new i(s.zoom,s.column,s.row),this._tileCoords=r.map(function(t){var e=t.zoomTo(s.zoom);return new o(Math.round((e.column-s.column)*c),Math.round((e.row-s.row)*c))}),this.fire("change"),this},_setTile:function(t){this._prepared=!1,this.tile=t;var e=new u;e.emplaceBack(this._tileCoords[0].x,this._tileCoords[0].y,0,0),e.emplaceBack(this._tileCoords[1].x,this._tileCoords[1].y,32767,0),e.emplaceBack(this._tileCoords[3].x,this._tileCoords[3].y,0,32767),e.emplaceBack(this._tileCoords[2].x,this._tileCoords[2].y,32767,32767),this.tile.buckets={},this.tile.boundsBuffer=new f(e.serialize(),u.serialize(),f.BufferType.VERTEX),this.tile.boundsVAO=new h,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":301,"../data/buffer":306,"../geo/lng_lat":311,"../render/draw_raster":323,"../render/vertex_array_object":329,"../util/ajax":397,"../util/evented":406,"../util/util":414,"./tile_coord":341,"point-geometry":458}],345:[function(t,e,r){"use strict";var n=t("../util/actor"),i=t("../style/style_layer"),a=t("../util/util"),o=t("./vector_tile_worker_source"),s=t("./geojson_worker_source");function l(t){this.self=t,this.actor=new n(t,this);var e={getLayers:function(){return this.layers}.bind(this),getLayerFamilies:function(){return this.layerFamilies}.bind(this)};this.workerSources={vector:new o(this.actor,e),geojson:new s(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 c(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}e.exports=function(t){return new l(t)},a.extend(l.prototype,{"set layers":function(t){this.layers={};for(var e=this,r=[],n=0;n<t.length;n++){var a=t[n];"fill"!==a.type&&"line"!==a.type&&"circle"!==a.type&&"symbol"!==a.type||(a.ref?r.push(n):s(a))}for(var o=0;o<r.length;o++)s(t[r[o]]);function s(t){var r=i.create(t,t.ref&&e.layers[t.ref]);r.updatePaintTransitions({},{transition:!1}),e.layers[r.id]=r}this.layerFamilies=c(this.layers)},"update layers":function(t){var e,r,n=this;for(e in t)(r=t[e]).ref&&a(r);for(e in t)(r=t[e]).ref||a(r);function a(t){var e=n.layers[t.ref];n.layers[t.id]?n.layers[t.id].set(t,e):n.layers[t.id]=i.create(t,e),n.layers[t.id].updatePaintTransitions({},{transition:!1})}this.layerFamilies=c(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":353,"../util/actor":396,"../util/util":414,"./geojson_worker_source":331,"./vector_tile_worker_source":343}],346:[function(t,e,r){"use strict";var n=t("../data/feature_index"),i=t("../symbol/collision_tile"),a=t("../data/bucket"),o=t("../symbol/collision_box"),s=t("../util/dictionary_coder"),l=t("../util/util"),c=t("../symbol/symbol_instances"),u=t("../symbol/symbol_quads");function f(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 h(t){return!t.isEmpty()}function d(t){return t.serialize()}function p(t){var e=[];for(var r in t)t[r].getTransferables(e);return e}function m(t){return t.id}e.exports=f,f.prototype.parse=function(t,e,r,f,v){this.status="parsing",this.data=t,this.collisionBoxArray=new o,this.symbolInstancesArray=new c,this.symbolQuadsArray=new u;var g,y,b,x,_=new i(this.angle,this.pitch,this.collisionBoxArray),w=new n(this.coord,this.overscaling,_,t.layers),M=new s(t.layers?Object.keys(t.layers).sort():["_geojsonTileLayer"]),k=this,A={},T={},E=0;for(var S in e)(y=e[S][0]).source===this.source&&(y.ref||y.minzoom&&this.zoom<y.minzoom||y.maxzoom&&this.zoom>=y.maxzoom||y.layout&&"none"===y.layout.visibility||t.layers&&!t.layers[y.sourceLayer]||((x=a.create({layer:y,index:E++,childLayers:e[S],zoom:this.zoom,overscaling:this.overscaling,showCollisionBoxes:this.showCollisionBoxes,collisionBoxArray:this.collisionBoxArray,symbolQuadsArray:this.symbolQuadsArray,symbolInstancesArray:this.symbolInstancesArray,sourceLayerIndex:M.encode(y.sourceLayer||"_geojsonTileLayer")})).createFilter(),A[y.id]=x,t.layers&&(T[b=y.sourceLayer]=T[b]||{},T[b][y.id]=x)));if(t.layers)for(b in T)1===y.version&&l.warnOnce('Vector tile source "'+this.source+'" layer "'+b+'" does not use vector tile spec v2 and therefore may have some rendering errors.'),(y=t.layers[b])&&L(y,T[b]);else L(t,A);function L(t,e){for(var r=0;r<t.length;r++){var n=t.feature(r);for(var i in n.index=r,e)e[i].filter(n)&&e[i].features.push(n)}}var C=[],P=this.symbolBuckets=[],z=[];for(var O in w.bucketLayerIDs={},A)0!==(x=A[O]).features.length&&(w.bucketLayerIDs[x.index]=x.childLayers.map(m),C.push(x),"symbol"===x.type?P.push(x):z.push(x));var D={},I={},R=0;if(P.length>0){for(g=P.length-1;g>=0;g--)P[g].updateIcons(D),P[g].updateFont(I);for(var N in I)I[N]=Object.keys(I[N]).map(Number);D=Object.keys(D),r.send("get glyphs",{uid:this.uid,stacks:I},function(t,e){I=e,F(t)}),D.length?r.send("get icons",{icons:D},function(t,e){D=e,F(t)}):F()}for(g=z.length-1;g>=0;g--)j(this,z[g]);if(0===P.length)return B();function F(t){if(t)return v(t);if(2===++R){for(var e=P.length-1;e>=0;e--)j(k,P[e]);B()}}function j(t,e){if(e.populateArrays(_,I,D),"symbol"!==e.type)for(var r=0;r<e.features.length;r++){var n=e.features[r];w.insert(n,n.index,e.sourceLayerIndex,e.index)}e.features=null}function B(){k.status="done",k.redoPlacementAfterDone&&(k.redoPlacement(k.angle,k.pitch,null),k.redoPlacementAfterDone=!1);var t=w.serialize(),e=_.serialize(),r=k.collisionBoxArray.serialize(),n=k.symbolInstancesArray.serialize(),i=k.symbolQuadsArray.serialize(),a=[f].concat(t.transferables).concat(e.transferables),o=C.filter(h);v(null,{buckets:o.map(d),featureIndex:t.data,collisionTile:e.data,collisionBoxArray:r,symbolInstancesArray:n,symbolQuadsArray:i,rawTileData:f},p(o).concat(a))}},f.prototype.redoPlacement=function(t,e,r){if("done"!==this.status)return this.redoPlacementAfterDone=!0,this.angle=t,{};for(var n=new i(t,e,this.collisionBoxArray),a=this.symbolBuckets,o=a.length-1;o>=0;o--)a[o].placeFeatures(n,r);var s=n.serialize(),l=a.filter(h);return{result:{buckets:l.map(d),collisionTile:s.data},transferables:p(l).concat(s.transferables)}}},{"../data/bucket":301,"../data/feature_index":308,"../symbol/collision_box":366,"../symbol/collision_tile":368,"../symbol/symbol_instances":377,"../symbol/symbol_quads":378,"../util/dictionary_coder":404,"../util/util":414}],347:[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})}},{}],348:[function(t,e,r){"use strict";var n=t("../util/evented"),i=t("../util/ajax"),a=t("../util/browser"),o=t("../util/mapbox").normalizeSpriteURL;function s(t){this.base=t,this.retina=a.devicePixelRatio>1;var e=this.retina?"@2x":"";i.getJSON(o(t,e,".json"),function(t,e){t?this.fire("error",{error:t}):(this.data=e,this.img&&this.fire("load"))}.bind(this)),i.getImage(o(t,e,".png"),function(t,e){if(t)this.fire("error",{error:t});else{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 l(){}e.exports=s,s.prototype=Object.create(n),s.prototype.toJSON=function(){return this.base},s.prototype.loaded=function(){return!(!this.data||!this.img)},s.prototype.resize=function(){if(a.devicePixelRatio>1!==this.retina){var t=new s(this.base);t.on("load",function(){this.img=t.img,this.data=t.data,this.retina=t.retina}.bind(this))}},l.prototype={x:0,y:0,width:0,height:0,pixelRatio:1,sdf:!1},s.prototype.getSpritePosition=function(t){if(!this.loaded())return new l;var e=this.data&&this.data[t];return e&&this.img?e:new l}},{"../util/ajax":397,"../util/browser":398,"../util/evented":406,"../util/mapbox":411}],349:[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":414,"./style_function":352,csscolorparser:114}],350:[function(t,e,r){"use strict";var n=t("../util/evented"),i=t("./style_layer"),a=t("./image_sprite"),o=t("../symbol/glyph_source"),s=t("../symbol/sprite_atlas"),l=t("../render/line_atlas"),c=t("../util/util"),u=t("../util/ajax"),f=t("../util/mapbox").normalizeStyleURL,h=t("../util/browser"),d=t("../util/dispatcher"),p=t("./animation_loop"),m=t("./validate_style"),v=t("../source/source"),g=t("../source/query_features"),y=t("../source/source_cache"),b=t("./style_spec"),x=t("./style_function");function _(t,e,r){this.animationLoop=e||new p,this.dispatcher=new d(r||1,this),this.spriteAtlas=new s(1024,1024),this.lineAtlas=new l(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)this.fire("error",{error:t});else if(!m.emitErrors(this,m(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 a(e.sprite),this.sprite.on("load",this.fire.bind(this,"change"))),this.glyphSource=new o(e.glyphs),this._resolve(),this.fire("load")}}.bind(this);"string"==typeof t?u.getJSON(f(t),n):h.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)}})}e.exports=_,_.prototype=c.inherit(n,{_loaded:!1,_validateLayer:function(t){var e=this.sources[t.source];t.sourceLayer&&e&&e.vectorLayerIds&&-1===e.vectorLayerIds.indexOf(t.sourceLayer)&&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]).ref||(t=i.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]).ref){var a=this.getLayer(e.ref);t=i.create(e,a),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=[]).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;for(var r in this._updateZoomHistory(t),this.rasterFadeDuration=300,this._layers){var n=this._layers[r];n.recalculate(t,this.zoomHistory),!n.isHidden(t)&&n.source&&(this.sources[n.source].used=!0)}Math.floor(this.z)!==Math.floor(t)&&this.animationLoop.set(300),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)+".");return["vector","raster","geojson","video","image"].indexOf(e.type)>=0&&this._handleErrors(m.source,"sources."+t,e)?this:(e=new y(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 i)){if(this._handleErrors(m.layer,"layers."+t.id,t,!1,{arrayIndex:-1}))return this;var r=t.ref&&this.getLayer(t.ref);t=i.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(m.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);return i.setPaintProperty(e,r,n),!(r&&x.isFunctionDefinition(r)&&"$zoom"!==r.property&&void 0!==r.property)&&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(m.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 c=this.sources[l],u=g.rendered(c,this._layers,t,e,r,n);s.push(u)}return this._flattenRenderedFeatures(s)},querySourceFeatures:function(t,e){e&&e.filter&&this._handleErrors(m.filter,"querySourceFeatures.filter",e.filter,!0);var r=this.sources[t];return r?g.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?m.throwErrors:m.emitErrors,o=t.call(m,c.extend({key:e,style:this.serialize(),value:r,styleSpec:b},i));return a.call(m,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){var r=t.stacks,n=Object.keys(r).length,i={};for(var a in r)this.glyphSource.getSimpleGlyphs(a,r[a],t.uid,o);function o(t,r,a){t&&console.error(t),i[a]=r,0===--n&&e(null,i)}}})},{"../render/line_atlas":326,"../source/query_features":336,"../source/source":338,"../source/source_cache":339,"../symbol/glyph_source":371,"../symbol/sprite_atlas":376,"../util/ajax":397,"../util/browser":398,"../util/dispatcher":405,"../util/evented":406,"../util/mapbox":411,"../util/util":414,"./animation_loop":347,"./image_sprite":348,"./style_function":352,"./style_layer":353,"./style_spec":360,"./validate_style":362}],351:[function(t,e,r){"use strict";var n=t("./style_function"),i=t("./parse_color"),a=t("../util/util");e.exports=function(t,e){this.value=a.clone(e),this.isFunction=n.isFunctionDefinition(e),this.json=JSON.stringify(this.value);var r="color"===t.type&&this.value?i(this.value):e;this.calculate=n[t.function||"piecewise-constant"](r),this.isFeatureConstant=this.calculate.isFeatureConstant,this.isZoomConstant=this.calculate.isZoomConstant,"piecewise-constant"===t.function&&t.transition&&(this.calculate=(o=this.calculate,function(t,e){var r,n,i,a=t.zoom,s=t.zoomHistory,l=t.duration,c=a%1,u=Math.min((Date.now()-s.lastIntegerZoomTime)/l,1),f=1;return a>s.lastIntegerZoom?(r=c+(1-c)*u,f*=2,n=o({zoom:a-1},e),i=o({zoom:a},e)):(r=1-(1-u)*c,i=o({zoom:a},e),n=o({zoom:a+1},e),f/=2),void 0===n||void 0===i?void 0:{from:n,fromScale:f,to:i,toScale:1,t:r}}));var o;if(!this.isFeatureConstant&&!this.isZoomConstant){this.stopZoomLevels=[];for(var s=[],l=this.value.stops,c=0;c<this.value.stops.length;c++){var u=l[c][0].zoom;this.stopZoomLevels.indexOf(u)<0&&(this.stopZoomLevels.push(u),s.push([u,s.length]))}this.calculateInterpolationT=n.interpolated({stops:s,base:e.base})}}},{"../util/util":414,"./parse_color":349,"./style_function":352}],352:[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":274}],353:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("./style_transition"),a=t("./style_declaration"),o=t("./style_spec"),s=t("./validate_style"),l=t("./parse_color"),c=t("../util/evented");e.exports=u;function u(t,e){this.set(t,e)}function f(t){return t.value}u.create=function(e,r){return new({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")}[(r||e).type])(e,r)},u.prototype=n.inherit(c,{set:function(t,e){var r,n;for(var i in 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=o["paint_"+this.type],this._layoutSpecifications=o["layout_"+this.type],this._paintTransitions={},this._paintTransitionOptions={},this._paintDeclarations={},this._layoutDeclarations={},this._layoutFunctions={},t){var a=i.match(/^paint(?:\.(.*))?$/);if(a){var s=a[1]||"";for(r in t[i])this.setPaintProperty(r,t[i][r],s)}}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(s.layoutProperty,r,t,e))return;this._layoutDeclarations[t]=new a(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 i="layers."+this.id+(r?'["paint.'+r+'"].':".paint.")+t;if(n.endsWith(t,"-transition"))if(this._paintTransitionOptions[r||""]||(this._paintTransitionOptions[r||""]={}),null===e||void 0===e)delete this._paintTransitionOptions[r||""][t];else{if(this._handleErrors(s.paintProperty,i,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(s.paintProperty,i,t,e))return;this._paintDeclarations[r||""][t]=new a(this._paintSpecifications[t],e)}},getPaintProperty:function(t,e){return e=e||"",n.endsWith(t,"-transition")?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?l(n.default):n.default},getPaintValueStopZoomLevels:function(t){var e=this._paintTransitions[t];return e?e.declaration.stopZoomLevels:[]},getPaintInterpolationT:function(t,e){return this._paintTransitions[t].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,i){for(var a,o=n.extend({},this._paintDeclarations[""]),s=0;s<t.length;s++)n.extend(o,this._paintDeclarations[t[s]]);for(a in o)this._applyPaintDeclaration(a,o[a],e,r,i);for(a in this._paintTransitions)a in o||this._applyPaintDeclaration(a,null,e,r,i)},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){e[""===r?"paint":"paint."+r]=n.mapObject(this._paintDeclarations[r],f)}return(!this.ref||t&&t.includeRefProperties)&&n.extend(e,{type:this.type,source:this.source,"source-layer":this.sourceLayer,filter:this.filter,layout:n.mapObject(this._layoutDeclarations,f)}),n.filterObject(e,function(t,e){return void 0!==t&&!("layout"===e&&!Object.keys(t).length)})},_applyPaintDeclaration:function(t,e,r,o,s){var l=r.transition?this._paintTransitions[t]:void 0,c=this._paintSpecifications[t];if(null!==e&&void 0!==e||(e=new a(c,c.default)),!l||l.declaration.json!==e.json){var u=n.extend({duration:300,delay:0},o,this.getPaintProperty(t+"-transition")),f=this._paintTransitions[t]=new i(c,e,l,u);f.instant()||(f.loopID=s.set(f.endTime-Date.now())),l&&s.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 s.emitErrors(this,t.call(s,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:o,style:{glyphs:!0,sprite:!0}}))}})},{"../util/evented":406,"../util/util":414,"./parse_color":349,"./style_declaration":351,"./style_layer/background_style_layer":354,"./style_layer/circle_style_layer":355,"./style_layer/fill_style_layer":356,"./style_layer/line_style_layer":357,"./style_layer/raster_style_layer":358,"./style_layer/symbol_style_layer":359,"./style_spec":360,"./style_transition":361,"./validate_style":362}],354:[function(t,e,r){"use strict";var n=t("../../util/util"),i=t("../style_layer");function a(){i.apply(this,arguments)}e.exports=a,a.prototype=n.inherit(i,{})},{"../../util/util":414,"../style_layer":353}],355:[function(t,e,r){"use strict";var n=t("../../util/util"),i=t("../style_layer");function a(){i.apply(this,arguments)}e.exports=a,a.prototype=n.inherit(i,{})},{"../../util/util":414,"../style_layer":353}],356:[function(t,e,r){"use strict";var n=t("../../util/util"),i=t("../style_layer");function a(){i.apply(this,arguments)}a.prototype=n.inherit(i,{getPaintValue:function(t,e,r){return"fill-outline-color"===t&&void 0===this.getPaintProperty("fill-outline-color")?i.prototype.getPaintValue.call(this,"fill-color",e,r):i.prototype.getPaintValue.call(this,t,e,r)},getPaintValueStopZoomLevels:function(t){return"fill-outline-color"===t&&void 0===this.getPaintProperty("fill-outline-color")?i.prototype.getPaintValueStopZoomLevels.call(this,"fill-color"):i.prototype.getPaintValueStopZoomLevels.call(this,arguments)},getPaintInterpolationT:function(t,e){return"fill-outline-color"===t&&void 0===this.getPaintProperty("fill-outline-color")?i.prototype.getPaintInterpolationT.call(this,"fill-color",e):i.prototype.getPaintInterpolationT.call(this,t,e)},isPaintValueFeatureConstant:function(t){return"fill-outline-color"===t&&void 0===this.getPaintProperty("fill-outline-color")?i.prototype.isPaintValueFeatureConstant.call(this,"fill-color"):i.prototype.isPaintValueFeatureConstant.call(this,t)},isPaintValueZoomConstant:function(t){return"fill-outline-color"===t&&void 0===this.getPaintProperty("fill-outline-color")?i.prototype.isPaintValueZoomConstant.call(this,"fill-color"):i.prototype.isPaintValueZoomConstant.call(this,t)}}),e.exports=a},{"../../util/util":414,"../style_layer":353}],357:[function(t,e,r){"use strict";var n=t("../../util/util"),i=t("../style_layer");function a(){i.apply(this,arguments)}e.exports=a,a.prototype=n.inherit(i,{getPaintValue:function(t,e,r){var n=i.prototype.getPaintValue.apply(this,arguments);if(n&&"line-dasharray"===t){var a=Math.floor(e.zoom);this._flooredZoom!==a&&(this._flooredZoom=a,this._flooredLineWidth=this.getPaintValue("line-width",e,r)),n.fromScale*=this._flooredLineWidth,n.toScale*=this._flooredLineWidth}return n}})},{"../../util/util":414,"../style_layer":353}],358:[function(t,e,r){"use strict";var n=t("../../util/util"),i=t("../style_layer");function a(){i.apply(this,arguments)}e.exports=a,a.prototype=n.inherit(i,{})},{"../../util/util":414,"../style_layer":353}],359:[function(t,e,r){"use strict";var n=t("../../util/util"),i=t("../style_layer");function a(){i.apply(this,arguments)}e.exports=a,a.prototype=n.inherit(i,{isHidden:function(){if(i.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")?i.prototype.getLayoutValue.apply(this,arguments):this.getLayoutValue("text-rotation-alignment"):"map"}})},{"../../util/util":414,"../style_layer":353}],360:[function(t,e,r){"use strict";e.exports=t("mapbox-gl-style-spec/reference/latest.min")},{"mapbox-gl-style-spec/reference/latest.min":297}],361:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/interpolate");function a(t,e,r,a){this.declaration=e,this.startTime=this.endTime=(new Date).getTime(),"piecewise-constant"===t.function&&t.transition?this.interp=o:this.interp=i[t.type],this.oldTransition=r,this.duration=a.duration||0,this.delay=a.delay||0,this.instant()||(this.endTime=this.startTime+this.duration+this.delay,this.ease=n.easeCubicInOut),r&&r.endTime<=this.startTime&&delete r.oldTransition}function o(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}}e.exports=a,a.prototype.instant=function(){return!this.oldTransition||!this.interp||0===this.duration&&0===this.delay},a.prototype.calculate=function(t,e){var r=this.declaration.calculate(n.extend({},t,{duration:this.duration}),e);if(this.instant())return r;var i=t.time||Date.now();if(i<this.endTime){var a=this.oldTransition.calculate(n.extend({},t,{time:this.startTime}),e),o=this.ease((i-this.startTime-this.delay)/this.duration);r=this.interp(a,r,o)}return r}},{"../util/interpolate":408,"../util/util":414}],362:[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":296}],363:[function(t,e,r){"use strict";var n=t("point-geometry");function i(t,e,r,n){this.x=t,this.y=e,this.angle=r,void 0!==n&&(this.segment=n)}e.exports=i,i.prototype=Object.create(n.prototype),i.prototype.clone=function(){return new i(this.x,this.y,this.angle,this.segment)}},{"point-geometry":458}],364:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){if(void 0===e.segment)return!0;var a=e,o=e.segment+1,s=0;for(;s>-r/2;){if(--o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;var l=[],c=0;for(;s<r/2;){var u=t[o-1],f=t[o],h=t[o+1];if(!h)return!1;var d=u.angleTo(f)-f.angleTo(h);for(d=Math.abs((d+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:d}),c+=d;s-l[0].distance>n;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=f.dist(h)}return!0}},{}],365:[function(t,e,r){"use strict";var n=t("point-geometry");e.exports=function(t,e,r,i,a){for(var o=[],s=0;s<t.length;s++)for(var l,c=t[s],u=0;u<c.length-1;u++){var f=c[u],h=c[u+1];f.x<e&&h.x<e||(f.x<e?f=new n(e,f.y+(h.y-f.y)*((e-f.x)/(h.x-f.x)))._round():h.x<e&&(h=new n(e,f.y+(h.y-f.y)*((e-f.x)/(h.x-f.x)))._round()),f.y<r&&h.y<r||(f.y<r?f=new n(f.x+(h.x-f.x)*((r-f.y)/(h.y-f.y)),r)._round():h.y<r&&(h=new n(f.x+(h.x-f.x)*((r-f.y)/(h.y-f.y)),r)._round()),f.x>=i&&h.x>=i||(f.x>=i?f=new n(i,f.y+(h.y-f.y)*((i-f.x)/(h.x-f.x)))._round():h.x>=i&&(h=new n(i,f.y+(h.y-f.y)*((i-f.x)/(h.x-f.x)))._round()),f.y>=a&&h.y>=a||(f.y>=a?f=new n(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round():h.y>=a&&(h=new n(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round()),l&&f.equals(l[l.length-1])||(l=[f],o.push(l)),l.push(h)))))}return o}},{"point-geometry":458}],366:[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":412,"../util/util":414,"point-geometry":458}],367:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c,u){var f=o.top*s-l,h=o.bottom*s+l,d=o.left*s-l,p=o.right*s+l;if(this.boxStartIndex=t.length,c){var m=h-f,v=p-d;if(m>0)if(m=Math.max(10*s,m),u){var g=e[r.segment+1].sub(e[r.segment])._unit()._mult(v),y=[r.sub(g),r.add(g)];this._addLineCollisionBoxes(t,y,r,0,v,m,n,i,a)}else this._addLineCollisionBoxes(t,e,r,r.segment,v,m,n,i,a)}else t.emplaceBack(r.x,r.y,d,f,p,h,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 c=a/2,u=Math.floor(i/c),f=-a/2,h=this.boxes,d=r,p=n+1,m=f;do{if(--p<0)return h;m-=e[p].dist(d),d=e[p]}while(m>-i/2);for(var v=e[p].dist(e[p+1]),g=0;g<u;g++){for(var y=-i/2+g*c;m+v<y;){if(m+=v,++p+1>=e.length)return h;v=e[p].dist(e[p+1])}var b=y-m,x=e[p],_=e[p+1].sub(x)._unit()._mult(b)._add(x)._round(),w=i/2/Math.max(Math.abs(y-f)-c/2,0);t.emplaceBack(_.x,_.y,-a/2,-a/2,a/2,a/2,w,o,s,l,0,0,0,0,0)}return h}},{}],368:[function(t,e,r){"use strict";var n=t("point-geometry"),i=t("../data/bucket").EXTENT,a=t("grid-index");function o(t,e,r){if("object"==typeof t){var n=t;r=e,t=n.angle,e=n.pitch,this.grid=new a(n.grid),this.ignoredGrid=new a(n.ignoredGrid)}else this.grid=new a(i,12,6),this.ignoredGrid=new a(i,12,0);this.angle=t,this.pitch=e;var o=Math.sin(t),s=Math.cos(t);if(this.rotationMatrix=[s,-o,o,s],this.reverseRotationMatrix=[s,o,-o,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();r.emplaceBack(0,0,0,-32767,0,32767,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(i,0,0,-32767,0,32767,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,0,-32767,0,32767,0,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,i,-32767,0,32767,0,32767,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)]}e.exports=o,o.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]}},o.prototype.minScale=.25,o.prototype.maxScale=2,o.prototype.placeCollisionFeature=function(t,e,r){for(var i=this.collisionBoxArray,a=this.minScale,o=this.rotationMatrix,s=this.yStretch,l=t.boxStartIndex;l<t.boxEndIndex;l++){var c=i.get(l),u=c.anchorPoint._matMult(o),f=u.x,h=u.y,d=f+c.x1,p=h+c.y1*s,m=f+c.x2,v=h+c.y2*s;if(c.bbox0=d,c.bbox1=p,c.bbox2=m,c.bbox3=v,!e)for(var g=this.grid.query(d,p,m,v),y=0;y<g.length;y++){var b=i.get(g[y]),x=b.anchorPoint._matMult(o);if((a=this.getPlacementScale(a,u,c,x,b))>=this.maxScale)return a}if(r){var _;if(this.angle){var w=this.reverseRotationMatrix,M=new n(c.x1,c.y1).matMult(w),k=new n(c.x2,c.y1).matMult(w),A=new n(c.x1,c.y2).matMult(w),T=new n(c.x2,c.y2).matMult(w);(_=this.tempCollisionBox).anchorPointX=c.anchorPoint.x,_.anchorPointY=c.anchorPoint.y,_.x1=Math.min(M.x,k.x,A.x,T.x),_.y1=Math.min(M.y,k.x,A.x,T.x),_.x2=Math.max(M.x,k.x,A.x,T.x),_.y2=Math.max(M.y,k.x,A.x,T.x),_.maxScale=c.maxScale}else _=c;for(var E=0;E<this.edges.length;E++){var S=this.edges[E];if((a=this.getPlacementScale(a,c.anchorPoint,_,S.anchorPoint,S))>=this.maxScale)return a}}}return a},o.prototype.queryRenderedSymbols=function(t,e,r,i,a){var o={},s=[],l=this.collisionBoxArray,c=this.rotationMatrix,u=new n(t,e)._matMult(c),f=this.tempCollisionBox;f.anchorX=u.x,f.anchorY=u.y,f.x1=0,f.y1=0,f.x2=r-t,f.y2=i-e,f.maxScale=a,a=f.maxScale;for(var h=[u.x+f.x1/a,u.y+f.y1/a*this.yStretch,u.x+f.x2/a,u.y+f.y2/a*this.yStretch],d=this.grid.query(h[0],h[1],h[2],h[3]),p=this.ignoredGrid.query(h[0],h[1],h[2],h[3]),m=0;m<p.length;m++)d.push(p[m]);for(var v=0;v<d.length;v++){var g=l.get(d[v]),y=g.sourceLayerIndex,b=g.featureIndex;if(void 0===o[y]&&(o[y]={}),!o[y][b]){var x=g.anchorPoint.matMult(c);this.getPlacementScale(this.minScale,u,f,x,g)>=a&&(o[y][b]=!0,s.push(d[v]))}}return s},o.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,c=(i.y1-r.y2)*this.yStretch/o,u=(i.y2-r.y1)*this.yStretch/o;(isNaN(s)||isNaN(l))&&(s=l=1),(isNaN(c)||isNaN(u))&&(c=u=1);var f=Math.min(Math.max(s,l),Math.max(c,u)),h=i.maxScale,d=r.maxScale;return f>h&&(f=h),f>d&&(f=d),f>t&&f>=i.placementScale&&(t=f),t},o.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":301,"grid-index":254,"point-geometry":458}],369:[function(t,e,r){"use strict";var n=t("../util/interpolate"),i=t("../symbol/anchor"),a=t("./check_max_angle");e.exports=function(t,e,r,o,s,l,c,u,f){var h=o?.6*l*c:0,d=Math.max(o?o.right-o.left:0,s?s.right-s.left:0),p=0===t[0].x||t[0].x===f||0===t[0].y||t[0].y===f;e-d*c<e/4&&(e=d*c+e/4);return function t(e,r,o,s,l,c,u,f,h){var d=c/2;var p=0;for(var m=0;m<e.length-1;m++)p+=e[m].dist(e[m+1]);var v=0,g=r-o;var y=[];for(var b=0;b<e.length-1;b++){for(var x=e[b],_=e[b+1],w=x.dist(_),M=_.angleTo(x);g+o<v+w;){var k=((g+=o)-v)/w,A=n(x.x,_.x,k),T=n(x.y,_.y,k);if(A>=0&&A<h&&T>=0&&T<h&&g-d>=0&&g+d<=p){var E=new i(A,T,M,b)._round();s&&!a(e,E,c,s,l)||y.push(E)}}v+=w}f||y.length||u||(y=t(e,v/2,o,s,l,c,u,!0,h));return y}(t,p?e/2*u%e:(d/2+2*l)*c*u%e,e,h,r,d*c,p,!1,f)}},{"../symbol/anchor":363,"../util/interpolate":408,"./check_max_angle":364}],370:[function(t,e,r){"use strict";var n=t("shelf-pack"),i=t("../util/util"),a=128;function o(){this.width=a,this.height=a,this.bin=new n(this.width,this.height),this.index={},this.ids={},this.data=new Uint8Array(this.width*this.height)}e.exports=o,o.prototype.getGlyphs=function(){var t,e,r,n={};for(var i in this.ids)e=(t=i.split("#"))[0],r=t[1],n[e]||(n[e]=[]),n[e].push(r);return n},o.prototype.getRects=function(){var t,e,r,n={};for(var i in this.ids)e=(t=i.split("#"))[0],r=t[1],n[e]||(n[e]={}),n[e][r]=this.index[i];return n},o.prototype.addGlyph=function(t,e,r,n){if(!r)return null;var a=e+"#"+r.id;if(this.index[a])return this.ids[a].indexOf(t)<0&&this.ids[a].push(t),this.index[a];if(!r.bitmap)return null;var o=r.width+2*n,s=r.height+2*n,l=o+2,c=s+2;l+=4-l%4,c+=4-c%4;var u=this.bin.packOne(l,c);if(u||(this.resize(),u=this.bin.packOne(l,c)),!u)return i.warnOnce("glyph bitmap overflow"),null;this.index[a]=u,this.ids[a]=[t];for(var f=this.data,h=r.bitmap,d=0;d<s;d++)for(var p=this.width*(u.y+d+1)+u.x+1,m=o*d,v=0;v<o;v++)f[p+v]=h[m+v];return this.dirty=!0,u},o.prototype.resize=function(){var t=this.width,e=this.height;if(!(t>=2048||e>=2048)){this.texture&&(this.gl&&this.gl.deleteTexture(this.texture),this.texture=null),this.width*=4,this.height*=4,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);new Uint8Array(r,e*n*4,t).set(i)}this.data=new Uint8Array(r)}},o.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))},o.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":414,"shelf-pack":501}],371:[function(t,e,r){"use strict";var n=t("../util/mapbox").normalizeGlyphsURL,i=t("../util/ajax").getArrayBuffer,a=t("../util/glyphs"),o=t("../symbol/glyph_atlas"),s=t("pbf");function l(t){this.url=t&&n(t),this.atlases={},this.stacks={},this.loading={}}function c(t,e,r){this.advance=t.advance,this.left=t.left-r-1,this.top=t.top+r+1,this.rect=e}e.exports=l,l.prototype.getSimpleGlyphs=function(t,e,r,n){void 0===this.stacks[t]&&(this.stacks[t]={}),void 0===this.atlases[t]&&(this.atlases[t]=new o);for(var i,a={},s=this.stacks[t],l=this.atlases[t],u={},f=0,h=0;h<e.length;h++){var d=e[h];if(s[i=Math.floor(d/256)]){var p=s[i].glyphs[d],m=l.addGlyph(r,t,p,3);p&&(a[d]=new c(p,m,3))}else void 0===u[i]&&(u[i]=[],f++),u[i].push(d)}f||n(void 0,a,t);var v=function(e,i,o){if(!e)for(var s=this.stacks[t][i]=o.stacks[0],h=0;h<u[i].length;h++){var d=u[i][h],p=s.glyphs[d],m=l.addGlyph(r,t,p,3);p&&(a[d]=new c(p,m,3))}--f||n(void 0,a,t)}.bind(this);for(var g in u)this.loadRange(t,g,v)},l.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 o=function(t,e,r,n){return n=n||"abc",r.replace("{s}",n[t.length%n.length]).replace("{fontstack}",t).replace("{range}",e)}(t,256*e+"-"+(256*e+255),this.url);i(o,function(t,r){for(var i=!t&&new a(new s(new Uint8Array(r))),o=0;o<n[e].length;o++)n[e][o](t,e,i);delete n[e]})}},l.prototype.getGlyphAtlas=function(t){return this.atlases[t]}},{"../symbol/glyph_atlas":370,"../util/ajax":397,"../util/glyphs":407,"../util/mapbox":411,pbf:451}],372:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n,i={},a={},o=[],s=[],l=[],c=0;function u(n){o.push(t[n]),s.push(r[n]),l.push(e[n]),c++}function f(t,e,r){var n=a[t];return delete a[t],a[e]=n,s[n][0].pop(),s[n][0]=s[n][0].concat(r[0]),n}function h(t,e,r){var n=i[e];return delete i[e],i[t]=n,s[n][0].shift(),s[n][0]=r[0].concat(s[n][0]),n}function d(t,e,r){var n=r?e[0][e[0].length-1]:e[0][0];return t+":"+n.x+":"+n.y}for(n=0;n<t.length;n++){var p=r[n],m=e[n];if(m){var v=d(m,p),g=d(m,p,!0);if(v in a&&g in i&&a[v]!==i[g]){var y=h(v,g,p),b=f(v,g,s[y]);delete i[v],delete a[g],a[d(m,s[b],!0)]=b,s[y]=null}else v in a?f(v,g,p):g in i?h(v,g,p):(u(n),i[v]=c-1,a[g]=c-1)}else u(n)}return{features:o,textFeatures:l,geometries:s}}},{}],373:[function(t,e,r){"use strict";var n=t("point-geometry");e.exports={getIconQuads:function(t,e,r,o,s,l,c,u,f){var h,d,p,m,v=e.image.rect,g=s.layout,y=e.left-1,b=y+v.w/e.image.pixelRatio,x=e.top-1,_=x+v.h/e.image.pixelRatio;if("none"!==g["icon-text-fit"]&&c){var w=b-y,M=_-x,k=g["text-size"]/24,A=c.left*k,T=c.right*k,E=c.top*k,S=c.bottom*k,L=T-A,C=S-E,P=g["icon-text-fit-padding"][0],z=g["icon-text-fit-padding"][1],O=g["icon-text-fit-padding"][2],D=g["icon-text-fit-padding"][3],I="width"===g["icon-text-fit"]?.5*(C-M):0,R="height"===g["icon-text-fit"]?.5*(L-w):0,N="width"===g["icon-text-fit"]||"both"===g["icon-text-fit"]?L:w,F="height"===g["icon-text-fit"]||"both"===g["icon-text-fit"]?C:M;h=new n(A+R-D,E+I-P),d=new n(A+R+z+N,E+I-P),p=new n(A+R+z+N,E+I+O+F),m=new n(A+R-D,E+I+O+F)}else h=new n(y,x),d=new n(b,x),p=new n(b,_),m=new n(y,_);var j=s.getLayoutValue("icon-rotate",u,f)*Math.PI/180;if(l){var B=o[t.segment];if(t.y===B.y&&t.x===B.x&&t.segment+1<o.length){var U=o[t.segment+1];j+=Math.atan2(t.y-U.y,t.x-U.x)+Math.PI}else j+=Math.atan2(t.y-B.y,t.x-B.x)}if(j){var V=Math.sin(j),q=Math.cos(j),H=[q,-V,V,q];h=h.matMult(H),d=d.matMult(H),m=m.matMult(H),p=p.matMult(H)}return[new a(new n(t.x,t.y),h,d,m,p,e.image.rect,0,0,i,1/0)]},getGlyphQuads:function(t,e,r,s,l,c){for(var u=l.layout["text-rotate"]*Math.PI/180,f=l.layout["text-keep-upright"],h=e.positionedGlyphs,d=[],p=0;p<h.length;p++){var m=h[p],v=m.glyph,g=v.rect;if(g){var y,b=(m.x+v.advance/2)*r,x=i;c?(x=o(y=[],t,b,s,t.segment,!0),f&&(x=Math.min(x,o(y,t,b,s,t.segment,!1)))):y=[{anchorPoint:new n(t.x,t.y),offset:0,angle:0,maxScale:1/0,minScale:i}];for(var _=m.x+v.left,w=m.y-v.top,M=_+g.w,k=w+g.h,A=new n(_,w),T=new n(M,w),E=new n(_,k),S=new n(M,k),L=0;L<y.length;L++){var C=y[L],P=A,z=T,O=E,D=S;if(u){var I=Math.sin(u),R=Math.cos(u),N=[R,-I,I,R];P=P.matMult(N),z=z.matMult(N),O=O.matMult(N),D=D.matMult(N)}var F=Math.max(C.minScale,x),j=(t.angle+C.offset+2*Math.PI)%(2*Math.PI),B=(C.angle+C.offset+2*Math.PI)%(2*Math.PI);d.push(new a(C.anchorPoint,P,z,O,D,g,j,B,F,C.maxScale))}}}return d},SymbolQuad:a};var i=.5;function a(t,e,r,n,i,a,o,s,l,c){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=c}function o(t,e,r,a,o,s){var l=!s;r<0&&(s=!s),s&&o++;var c=new n(e.x,e.y),u=a[o],f=1/0;r=Math.abs(r);for(var h=i;;){var d=c.dist(u),p=r/d,m=Math.atan2(u.y-c.y,u.x-c.x);if(s||(m+=Math.PI),t.push({anchorPoint:c,offset:l?Math.PI:0,minScale:p,maxScale:f,angle:(m+2*Math.PI)%(2*Math.PI)}),p<=h)break;for(c=u;c.equals(u);)if(!(u=a[o+=s?1:-1]))return p;var v=u.sub(c)._unit();c=c.sub(v._mult(d)),f=p}return h}},{"point-geometry":458}],374:[function(t,e,r){"use strict";var n=t("../util/token");e.exports=function(t,e,r){for(var i=[],a=0,o=t.length;a<o;a++){var s=n(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 c=0;c<s.length;c++)r[s.charCodeAt(c)]=!0;i[a]=s}else i[a]=null}return i}},{"../util/token":413}],375:[function(t,e,r){"use strict";function n(t,e,r,n){this.codePoint=t,this.x=e,this.y=r,this.glyph=n}e.exports={shapeText:function(t,e,r,s,l,c,u,f,h){for(var d=[],p=new function(t,e,r,n,i,a){this.positionedGlyphs=t,this.text=e,this.top=r,this.bottom=n,this.left=i,this.right=a}(d,t,h[1],h[1],h[0],h[0]),m=0,v=0;v<t.length;v++){var g=t.charCodeAt(v),y=e[g];y&&(d.push(new n(g,m,-17,y)),m+=y.advance+f)}return!!d.length&&(function(t,e,r,n,s,l,c,u){var f=null,h=0,d=0,p=0,m=0,v=t.positionedGlyphs;if(n)for(var g=0;g<v.length;g++){var y=v[g];if(y.x-=h,y.y+=r*p,y.x>n&&null!==f){var b=v[f+1].x;m=Math.max(b,m);for(var x=f+1;x<=g;x++)v[x].y+=r,v[x].x-=b;if(c){var _=f;i[v[f].codePoint]&&_--,o(v,e,d,_,c)}d=f+1,f=null,h+=b,p++}a[y.codePoint]&&(f=g)}var w=v[v.length-1],M=w.x+e[w.codePoint].advance;m=Math.max(m,M);var k=(p+1)*r;o(v,e,d,v.length-1,c),function(t,e,r,n,i,a,o,s){for(var l=(e-r)*i+s[0],c=(-n*(o+1)+.5)*a+s[1],u=0;u<t.length;u++)t[u].x+=l,t[u].y+=c}(v,c,s,l,m,r,p,u),t.top+=-l*k,t.bottom=t.top+k,t.left+=-s*m,t.right=t.left+m}(p,e,s,r,l,c,u,h),p)},shapeIcon:function(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 function(t,e,r,n,i){this.image=t,this.top=e,this.bottom=r,this.left=n,this.right=i}(t,o,s,i,a)}};var i={32:!0,8203:!0},a={32:!0,38:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0};function o(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}},{}],376:[function(t,e,r){"use strict";var n=t("shelf-pack"),i=t("../util/browser"),a=t("../util/util");function o(t,e){this.width=t,this.height=e,this.bin=new n(t,e),this.images={},this.data=!1,this.texture=0,this.filter=0,this.pixelRatio=1,this.dirty=!0}e.exports=o,o.prototype.allocateImage=function(t,e){var r=(t/=this.pixelRatio)+2+(4-(t+2)%4),n=(e/=this.pixelRatio)+2+(4-(e+2)%4),i=this.bin.packOne(r,n);return i||(a.warnOnce("SpriteAtlas out of space."),null)},o.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 function(t,e,r,n,i){this.rect=t,this.width=e,this.height=r,this.sdf=n,this.pixelRatio=i}(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},o.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;return{size:[r.width,r.height],tl:[(n.x+1)/this.width,(n.y+1)/this.height],br:[(n.x+1+i)/this.width,(n.y+1+a)/this.height]}},o.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}},o.prototype.copy=function(t,e,r){if(this.sprite.img.data){var n=new Uint32Array(this.sprite.img.data.buffer);this.allocate();var i=this.data;!function(t,e,r,n,i,a,o,s,l,c,u){var f,h,d=n*e+r,p=s*a+o;if(u)for(p-=a,h=-1;h<=c;d=((++h+c)%c+n)*e+r,p+=a)for(f=-1;f<=l;f++)i[p+f]=t[d+(f+l)%l];else for(h=0;h<c;h++,d+=e,p+=a)for(f=0;f<l;f++)i[p+f]=t[d+f]}(n,this.sprite.img.width,e.x,e.y,i,this.width*this.pixelRatio,(t.x+1)*this.pixelRatio,(t.y+1)*this.pixelRatio,e.width,e.height,r),this.dirty=!0}},o.prototype.setSprite=function(t){t&&(this.pixelRatio=i.devicePixelRatio>1?2:1,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio)),this.sprite=t},o.prototype.addIcons=function(t,e){for(var r=0;r<t.length;r++)this.getImage(t[r]);e(null,this.images)},o.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":398,"../util/util":414,"shelf-pack":501}],377:[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":412,"../util/util":414,"point-geometry":458}],378:[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":412,"../util/util":414,"./quads":373,"point-geometry":458}],379:[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){var r=t.getCanvasContainer(),o=null,s=null,l=null;for(var c in a)t[c]=new a[c](t,e),e.interactive&&e[c]&&t[c].enable();function u(){l=null}function f(e,i){var a=n.mousePos(r,i);return t.fire(e,{lngLat:t.unproject(a),point:a,originalEvent:i})}function h(e,a){var o=n.touchPos(r,a),s=o.reduce(function(t,e,r,n){return t.add(e.div(n.length))},new i(0,0));return t.fire(e,{lngLat:t.unproject(s),point:s,lngLats:o.map(function(e){return t.unproject(e)},this),points:o,originalEvent:a})}r.addEventListener("mouseout",function(t){f("mouseout",t)},!1),r.addEventListener("mousedown",function(e){t.stop(),s=n.mousePos(r,e),f("mousedown",e)},!1),r.addEventListener("mouseup",function(e){var r=t.dragRotate&&t.dragRotate.isActive();o&&!r&&f("contextmenu",o);o=null,f("mouseup",e)},!1),r.addEventListener("mousemove",function(e){if(t.dragPan&&t.dragPan.isActive())return;if(t.dragRotate&&t.dragRotate.isActive())return;var n=e.toElement||e.target;for(;n&&n!==r;)n=n.parentNode;if(n!==r)return;f("mousemove",e)},!1),r.addEventListener("touchstart",function(e){if(t.stop(),h("touchstart",e),!e.touches||e.touches.length>1)return;l?(clearTimeout(l),l=null,f("dblclick",e)):l=setTimeout(u,300)},!1),r.addEventListener("touchend",function(t){h("touchend",t)},!1),r.addEventListener("touchmove",function(t){h("touchmove",t)},!1),r.addEventListener("touchcancel",function(t){h("touchcancel",t)},!1),r.addEventListener("click",function(t){n.mousePos(r,t).equals(s)&&f("click",t)},!1),r.addEventListener("dblclick",function(t){f("dblclick",t),t.preventDefault()},!1),r.addEventListener("contextmenu",function(t){o=t,t.preventDefault()},!1)}},{"../util/dom":400,"./handler/box_zoom":385,"./handler/dblclick_zoom":386,"./handler/drag_pan":387,"./handler/drag_rotate":388,"./handler/keyboard":389,"./handler/scroll_zoom":390,"./handler/touch_zoom_rotate":391,"point-geometry":458}],380:[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"),c=e.exports=function(){};n.extend(c.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()),c=a.project(t.getSouthEast()),u=c.sub(o),f=(a.width-2*e.padding-2*Math.abs(i.x))/u.x,h=(a.height-2*e.padding-2*Math.abs(i.y))/u.y;return e.center=a.unproject(o.add(c).div(2)),e.zoom=Math.min(a.scaleZoom(a.scale*Math.min(f,h)),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,c=l.convert(t.offset),u=this.getZoom(),f=this.getBearing(),h=this.getPitch(),d="zoom"in t?+t.zoom:u,p="bearing"in t?this._normalizeBearing(t.bearing,f):f,m="pitch"in t?+t.pitch:h;"center"in t?(r=o.convert(t.center),a=s.centerPoint.add(c)):"around"in t?(r=o.convert(t.around),a=s.locationPoint(r)):(a=s.centerPoint.add(c),r=s.pointLocation(a));var v=s.locationPoint(r);return!1===t.animate&&(t.duration=0),this.zooming=d!==u,this.rotating=f!==p,this.pitching=m!==h,t.noMoveStart||this.fire("movestart",e),this.zooming&&this.fire("zoomstart",e),clearTimeout(this._onEaseEnd),this._ease(function(t){this.zooming&&(s.zoom=i(u,d,t)),this.rotating&&(s.bearing=i(f,p,t)),this.pitching&&(s.pitch=i(h,m,t)),s.setLocationAtPoint(r,v.add(a.sub(v)._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){this.stop(),t=n.extend({offset:[0,0],speed:1.2,curve:1.42,easing:n.ease},t);var r=this.transform,a=l.convert(t.offset),s=this.getZoom(),c=this.getBearing(),u=this.getPitch(),f="center"in t?o.convert(t.center):this.getCenter(),h="zoom"in t?+t.zoom:s,d="bearing"in t?this._normalizeBearing(t.bearing,c):c,p="pitch"in t?+t.pitch:u;Math.abs(r.center.lng)+Math.abs(f.lng)>180&&(r.center.lng>0&&f.lng<0?f.lng+=360:r.center.lng<0&&f.lng>0&&(f.lng-=360));var m=r.zoomScale(h-s),v=r.point,g="center"in t?r.project(f).sub(a.div(m)):v,y=r.worldSize,b=t.curve,x=Math.max(r.width,r.height),_=x/m,w=g.sub(v).mag();if("minZoom"in t){var M=n.clamp(Math.min(t.minZoom,s,h),r.minZoom,r.maxZoom),k=x/r.zoomScale(M-s);b=Math.sqrt(k/w*2)}var A=b*b;function T(t){var e=(_*_-x*x+(t?-1:1)*A*A*w*w)/(2*(t?_:x)*A*w);return Math.log(Math.sqrt(e*e+1)-e)}function E(t){return(Math.exp(t)-Math.exp(-t))/2}function S(t){return(Math.exp(t)+Math.exp(-t))/2}var L=T(0),C=function(t){return S(L)/S(L+b*t)},P=function(t){return x*((S(L)*(E(e=L+b*t)/S(e))-E(L))/A)/w;var e},z=(T(1)-L)/b;if(Math.abs(w)<1e-6){if(Math.abs(x-_)<1e-6)return this.easeTo(t);var O=_<x?-1:1;z=Math.abs(Math.log(_/x))/b,P=function(){return 0},C=function(t){return Math.exp(O*b*t)}}if("duration"in t)t.duration=+t.duration;else{var D="screenSpeed"in t?+t.screenSpeed/b:+t.speed;t.duration=1e3*z/D}return this.zooming=!0,c!==d&&(this.rotating=!0),u!==p&&(this.pitching=!0),this.fire("movestart",e),this.fire("zoomstart",e),this._ease(function(t){var n=t*z,a=P(n);r.zoom=s+r.scaleZoom(1/C(n)),r.center=r.unproject(v.add(g.sub(v).mult(a)),y),this.rotating&&(r.bearing=i(c,d,t)),this.pitching&&(r.pitch=i(u,p,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()},!1===r.animate?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,c=Math.sqrt(.0729-l*l);i=n.bezier(l,c,.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":311,"../geo/lng_lat_bounds":312,"../util/browser":398,"../util/interpolate":408,"../util/util":414,"point-geometry":458}],381:[function(t,e,r){"use strict";var n=t("./control"),i=t("../../util/dom"),a=t("../../util/util");function o(t){a.setOptions(this,t)}e.exports=o,o.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})).join(" | ")},o.prototype=a.inherit(n,{options:{position:"bottom-right"},onAdd:function(t){var e=this._container=i.create("div","mapboxgl-ctrl-attrib",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)),e},_update:function(){this._map.style&&(this._container.innerHTML=o.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":400,"../../util/util":414,"./control":382}],382:[function(t,e,r){"use strict";var n=t("../../util/util"),i=t("../../util/evented");function a(){}e.exports=a,a.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",-1!==r.indexOf("bottom")?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}},n.extend(a.prototype,i)},{"../../util/evented":406,"../../util/util":414}],383:[function(t,e,r){"use strict";var n=t("./control"),i=t("../../util/browser"),a=t("../../util/dom"),o=t("../../util/util");e.exports=l;var s={enableHighAccuracy:!1,timeout:6e3};function l(t){o.setOptions(this,t)}l.prototype=o.inherit(n,{options:{position:"top-right"},onAdd:function(t){var e=this._container=a.create("div","mapboxgl-ctrl-group",t.getContainer());return i.supportsGeolocation?(this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._geolocateButton=a.create("button","mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)),e):e},_onContextMenu:function(t){t.preventDefault()},_onClickGeolocate:function(){navigator.geolocation.getCurrentPosition(this._success.bind(this),this._error.bind(this),s),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":398,"../../util/dom":400,"../../util/util":414,"./control":382}],384:[function(t,e,r){"use strict";var n=t("./control"),i=t("../../util/dom"),a=t("../../util/util");function o(t){a.setOptions(this,t)}function s(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})}e.exports=o,o.prototype=a.inherit(n,{options:{position:"top-right"},onAdd:function(t){var e="mapboxgl-ctrl",r=this._container=i.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=i.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&&(i.disableDrag(),document.addEventListener("mousemove",this._onCompassMove),document.addEventListener("mouseup",this._onCompassUp),this._el.dispatchEvent(s(t)),t.stopPropagation())},_onCompassMove:function(t){0===t.button&&(this._el.dispatchEvent(s(t)),t.stopPropagation())},_onCompassUp:function(t){0===t.button&&(document.removeEventListener("mousemove",this._onCompassMove),document.removeEventListener("mouseup",this._onCompassUp),i.enableDrag(),this._el.dispatchEvent(s(t)),t.stopPropagation())},_createButton:function(t,e){var r=i.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":400,"../../util/util":414,"./control":382}],385:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../geo/lng_lat_bounds"),a=t("../../util/util");function o(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),a.bindHandlers(this)}e.exports=o,o.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),n.disableDrag(),this._startPos=n.mousePos(this._el,t),this._active=!0)},_onMouseMove:function(t){var e=this._startPos,r=n.mousePos(this._el,t);this._box||(this._box=n.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var i=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);n.setTransform(this._box,"translate("+i+"px,"+o+"px)"),this._box.style.width=a-i+"px",this._box.style.height=s-o+"px"},_onMouseUp:function(t){if(0===t.button){var e=this._startPos,r=n.mousePos(this._el,t),a=new i(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(a,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:a})}},_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),n.enableDrag()},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})}}},{"../../geo/lng_lat_bounds":312,"../../util/dom":400,"../../util/util":414}],386:[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)}}},{}],387:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util");e.exports=o;var a=i.bezier(0,0,.3,1);function o(t){this._map=t,this._el=t.getCanvasContainer(),i.bindHandlers(this)}o.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=n.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=n.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)e();else{var n=r[r.length-1],i=r[0],o=n[1].sub(i[1]),s=(n[0]-i[0])/1e3;if(0===s||n[1].equals(i[1]))e();else{var l=o.mult(.3/s),c=l.mag();c>1400&&(c=1400,l._unit()._mult(c));var u=c/750,f=l.mult(-u/2);this._map.panBy(f,{duration:1e3*u,easing:a,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;return"mousemove"===t.type?!1&t.buttons:0!==t.button},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":400,"../../util/util":414}],388:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("point-geometry"),a=t("../../util/util");e.exports=s;var o=a.bezier(0,0,.25,1);function s(t,e){this._map=t,this._el=t.getCanvasContainer(),this._bearingSnap=e.bearingSnap,a.bindHandlers(this)}s.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=n.mousePos(this._el,t),this._center=this._map.transform.centerPoint;var e=this._startPos.sub(this._center);e.mag()<200&&(this._center=this._startPos.add(new i(-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,i=n.mousePos(this._el,t),a=this._center,o=r.sub(a).angleWith(i.sub(a))/Math.PI*180,s=e.getBearing()-o,l=this._inertia,c=l[l.length-1];this._drainInertiaBuffer(),l.push([Date.now(),e._normalizeBearing(s,c[1])]),e.transform.bearing=s,this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=i}},_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)i();else{var a=n[0],s=n[n.length-1],l=n[n.length-2],c=e._normalizeBearing(r,l[1]),u=s[1]-a[1],f=u<0?-1:1,h=(s[0]-a[0])/1e3;if(0!==u&&0!==h){var d=Math.abs(u*(.25/h));d>180&&(d=180);var p=d/180;c+=f*d*(p/2),Math.abs(e._normalizeBearing(c,0))<this._bearingSnap&&(c=e._normalizeBearing(0,c)),e.rotateTo(c,{duration:1e3*p,easing:o,noMoveStart:!0},{originalEvent:t})}else i()}}},_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();t.length>0&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":400,"../../util/util":414,"point-geometry":458}],389:[function(t,e,r){"use strict";e.exports=n;function n(t){this._map=t,this._el=t.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)}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()-2},r):(t.preventDefault(),e.panBy([-80,0],r));break;case 39:t.shiftKey?e.easeTo({bearing:e.getBearing()+2},r):(t.preventDefault(),e.panBy([80,0],r));break;case 38:t.shiftKey?e.easeTo({pitch:e.getPitch()+5},r):(t.preventDefault(),e.panBy([0,-80],r));break;case 40:t.shiftKey?e.easeTo({pitch:Math.max(e.getPitch()-5,0)},r):(t.preventDefault(),e.panBy([0,80],r))}}}}},{}],390:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/browser"),a=t("../../util/util");e.exports=c;var o="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",s=-1!==o.indexOf("firefox"),l=-1!==o.indexOf("safari")&&-1===o.indexOf("chrom");function c(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}c.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,s&&t.deltaMode===window.WheelEvent.DOM_DELTA_PIXEL&&(e/=i.devicePixelRatio),t.deltaMode===window.WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"===t.type&&(e=-t.wheelDeltaY,l&&(e/=3));var r=i.now(),a=r-(this._time||0);this._pos=n.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":a>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(a*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":398,"../../util/dom":400,"../../util/util":414}],391:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util");e.exports=o;var a=i.bezier(0,0,.15,1);function o(t){this._map=t,this._el=t.getCanvasContainer(),i.bindHandlers(this)}o.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=n.mousePos(this._el,t.touches[0]),r=n.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=n.mousePos(this._el,t.touches[0]),r=n.mousePos(this._el,t.touches[1]),i=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 c={duration:0,around:l.unproject(i)};"rotate"===this._gestureIntent&&(c.bearing=this._startBearing+s),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(c.zoom=l.transform.scaleZoom(this._startScale*o)),l.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),o,i]),l.easeTo(c,{originalEvent:t})}else{var u=Math.abs(1-o)>.15;Math.abs(s)>4?this._gestureIntent="rotate":u&&(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)r.snapToNorth({},{originalEvent:t});else{var n=e[e.length-1],i=e[0],o=r.transform.scaleZoom(this._startScale*n[1]),s=r.transform.scaleZoom(this._startScale*i[1]),l=o-s,c=(n[0]-i[0])/1e3,u=n[2];if(0!==c&&o!==s){var f=.15*l/c;Math.abs(f)>2.5&&(f=f>0?2.5:-2.5);var h=1e3*Math.abs(f/(12*.15)),d=o+f*h/2e3;d<0&&(d=0),r.easeTo({zoom:d,duration:h,easing:a,around:r.unproject(u)},{originalEvent:t})}else r.snapToNorth({},{originalEvent:t})}},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>2&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":400,"../../util/util":414}],392:[function(t,e,r){"use strict";e.exports=i;var n=t("../util/util");function i(){n.bindAll(["_onHashChange","_updateHash"],this)}i.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":414}],393:[function(t,e,r){"use strict";var n=t("../util/canvas"),i=t("../util/util"),a=t("../util/browser"),o=t("../util/browser").window,s=t("../util/evented"),l=t("../util/dom"),c=t("../style/style"),u=t("../style/animation_loop"),f=t("../render/painter"),h=t("../geo/transform"),d=t("./hash"),p=t("./bind_handlers"),m=t("./camera"),v=t("../geo/lng_lat"),g=t("../geo/lng_lat_bounds"),y=t("point-geometry"),b=t("./control/attribution"),x={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:20,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(a.hardwareConcurrency-1,1)},_=e.exports=function(t){if((t=i.extend({},x,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 u,this.transform=new h(t.minZoom,t.maxZoom),t.maxBounds&&this.setMaxBounds(t.maxBounds),i.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)),void 0!==o&&(o.addEventListener("online",this._onWindowOnline,!1),o.addEventListener("resize",this._onWindowResize,!1)),p(this,t),this._hash=t.hash&&(new d).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)};function w(t){t.parentNode&&t.parentNode.removeChild(t)}i.extend(_.prototype,s),i.extend(_.prototype,m.prototype),i.extend(_.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 g(this.transform.pointLocation(new y(0,0)),this.transform.pointLocation(this.transform.size));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new y(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new y(0,this.transform.size.y)))),t},setMaxBounds:function(t){if(t){var e=g.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?0:t)>=0&&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 0 and the current maxZoom, inclusive")},setMaxZoom:function(t){if((t=null===t||void 0===t?20:t)>=this.transform.minZoom&&t<=20)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 20, inclusive")},project:function(t){return this.transform.locationPoint(v.convert(t))},unproject:function(t){return this.transform.pointLocation(y.convert(t))},queryRenderedFeatures:function(){var t,e,r={};return 2===arguments.length?(t=arguments[0],r=arguments[1]):1===arguments.length&&((e=arguments[0])instanceof y||Array.isArray(e))?t=arguments[0]:1===arguments.length&&(r=arguments[0]),this.style.queryRenderedFeatures(this._makeQueryGeometry(t),r,this.transform.zoom,this.transform.angle)},_makeQueryGeometry:function(t){var e;if(void 0===t&&(t=[y.convert([0,0]),y.convert([this.transform.width,this.transform.height])]),t instanceof y||"number"==typeof t[0]){e=[y.convert(t)]}else{var r=[y.convert(t[0]),y.convert(t[1])];e=[r[0],new y(r[1].x,r[0].y),r[1],new y(r[0].x,r[1].y),r[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?(this.style=t instanceof c?t: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=l.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=new n(this,e);var r=this._controlContainer=l.create("div","mapboxgl-control-container",t),i=this._controlCorners={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){i[t]=l.create("div","mapboxgl-ctrl-"+t,r)})},_setupPainter:function(){var t=this._canvas.getWebGLContext({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer});t?this.painter=new f(t,this.transform):this.fire("error",{error:new Error("Failed to initialize WebGL")})},_contextLost:function(t){t.preventDefault(),this._frameId&&a.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(),a.cancelFrame(this._frameId),this.setStyle(null),void 0!==o&&o.removeEventListener("resize",this._onWindowResize,!1);var t=this.painter.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),w(this._canvasContainer),w(this._controlContainer),this._container.classList.remove("mapboxgl-map")},_rerender:function(){this.style&&!this._frameId&&(this._frameId=a.frame(this._render))},_forwardStyleEvent:function(t){this.fire("style."+t.type,i.extend({style:t.target},t))},_forwardSourceEvent:function(t){this.fire(t.type,i.extend({style:t.target},t))},_forwardLayerEvent:function(t){this.fire(t.type,i.extend({style:t.target},t))},_forwardTileEvent:function(t){this.fire(t.type,i.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()}}),i.extendAll(_.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":311,"../geo/lng_lat_bounds":312,"../geo/transform":313,"../render/painter":327,"../style/animation_loop":347,"../style/style":350,"../util/browser":398,"../util/canvas":399,"../util/dom":400,"../util/evented":406,"../util/util":414,"./bind_handlers":379,"./camera":380,"./control/attribution":381,"./hash":392,"point-geometry":458}],394:[function(t,e,r){"use strict";e.exports=o;var n=t("../util/dom"),i=t("../geo/lng_lat"),a=t("point-geometry");function o(t,e){t||(t=n.create("div")),t.classList.add("mapboxgl-marker"),this._el=t,this._offset=a.convert(e&&e.offset||[0,0]),this._update=this._update.bind(this)}o.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=i.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);n.setTransform(this._el,"translate("+t.x+"px,"+t.y+"px)")}}}},{"../geo/lng_lat":311,"../util/dom":400,"point-geometry":458}],395:[function(t,e,r){"use strict";e.exports=s;var n=t("../util/util"),i=t("../util/evented"),a=t("../util/dom"),o=t("../geo/lng_lat");function s(t){n.setOptions(this,t),n.bindAll(["_update","_onClickClose"],this)}s.prototype=n.inherit(i,{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=o.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;e=n.firstChild;)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=a.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=a.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClickClose))},_update:function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=a.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=a.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%)"},o=this._container.classList;for(var s in i)o.remove("mapboxgl-popup-anchor-"+s);o.add("mapboxgl-popup-anchor-"+e),a.setTransform(this._container,i[e]+" translate("+t.x+"px,"+t.y+"px)")}},_onClickClose:function(){this.remove()}})},{"../geo/lng_lat":311,"../util/dom":400,"../util/evented":406,"../util/util":414}],396:[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){var e,r=t.data,n=r.id;if("<response>"===r.type)e=this.callbacks[r.id],delete this.callbacks[r.id],e&&e(r.error||null,r.data);else if(void 0!==r.id&&this.parent[r.type])this.parent[r.type](r.data,a.bind(this));else if(void 0!==r.id&&this.parent.workerSources){var i=r.type.split(".");this.parent.workerSources[i[0]][i[1]](r.data,a.bind(this))}else this.parent[r.type](r.data);function a(t,e,r){this.postMessage({type:"<response>",id:String(n),error:t?String(t):null,data:e},r)}},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)}},{}],397:[function(t,e,r){"use strict";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,n,i=document.createElement("video");i.onloadstart=function(){e(null,i)};for(var a=0;a<t.length;a++){var o=document.createElement("source");r=t[a],n=void 0,(n=document.createElement("a")).href=r,(n.protocol!==document.location.protocol||n.host!==document.location.host)&&(i.crossOrigin="Anonymous"),o.src=t[a],i.appendChild(o)}return i.getData=function(){return i},i}},{}],398:[function(t,e,r){"use strict";r.window=window,e.exports.now=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){if(!n)return t.call(i,1),null;var a=!1,o=e.exports.now();return r.frame(function s(l){a||((l=e.exports.now())>=o+n?t.call(i,1):(t.call(i,(l-o)/n),r.frame(s)))}),function(){a=!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":299}],399:[function(t,e,r){"use strict";var n=t("../util"),i=t("mapbox-gl-supported");function a(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))}e.exports=a,a.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"},a.prototype.getWebGLContext=function(t){return t=n.extend({},t,i.webGLContextAttributes),this.canvas.getContext("webgl",t)||this.canvas.getContext("experimental-webgl",t)},a.prototype.getElement=function(){return this.canvas}},{"../util":414,"mapbox-gl-supported":299}],400:[function(t,e,r){"use strict";var n=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 i=document.documentElement.style;function a(t){for(var e=0;e<t.length;e++)if(t[e]in i)return t[e]}var o,s=a(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);r.disableDrag=function(){s&&(o=i[s],i[s]="none")},r.enableDrag=function(){s&&(i[s]=o)};var l=a(["transform","WebkitTransform"]);function c(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",c,!0)}r.setTransform=function(t,e){t.style[l]=e},r.suppressClick=function(){window.addEventListener("click",c,!0),window.setTimeout(function(){window.removeEventListener("click",c,!0)},0)},r.mousePos=function(t,e){var r=t.getBoundingClientRect();return e=e.touches?e.touches[0]:e,new n(e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop)},r.touchPos=function(t,e){for(var r=t.getBoundingClientRect(),i=[],a=0;a<e.touches.length;a++)i.push(new n(e.touches[a].clientX-r.left-t.clientLeft,e.touches[a].clientY-r.top-t.clientTop));return i}},{"point-geometry":458}],401:[function(t,e,r){"use strict";var n=t("webworkify");e.exports=function(){return new n(t("../../source/worker"))}},{"../../source/worker":345,webworkify:558}],402:[function(t,e,r){"use strict";var n=t("quickselect");function i(t,e){return e.area-t.area}function a(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i<a;o=i++)e=t[i],n+=((r=t[o]).x-e.x)*(e.y+r.y);return n}e.exports=function(t,e){var r=t.length;if(r<=1)return[t];for(var o,s,l=[],c=0;c<r;c++){var u=a(t[c]);0!==u&&(t[c].area=Math.abs(u),void 0===s&&(s=u<0),s===u<0?(o&&l.push(o),o=[t[c]]):o.push(t[c]))}if(o&&l.push(o),e>1)for(var f=0;f<l.length;f++)l[f].length<=e||(n(l[f],e,1,l[f].length-1,i),l[f]=l[f].slice(0,e));return l}},{quickselect:475}],403:[function(t,e,r){"use strict";e.exports={API_URL:"https://api.mapbox.com",REQUIRE_ACCESS_TOKEN:!0}},{}],404:[function(t,e,r){"use strict";var n=t("assert");function i(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}}e.exports=i,i.prototype.encode=function(t){return n(t in this._stringToNumber),this._stringToNumber[t]},i.prototype.decode=function(t){return n(t<this._numberToString.length),this._numberToString[t]}},{assert:51}],405:[function(t,e,r){"use strict";var n=t("./util"),i=t("./actor"),a=t("./web_worker");function o(t,e){this.actors=[],this.currentActor=0;for(var r=0;r<t;r++){var n=new a,o=new i(n,e);o.name="Worker "+r,this.actors.push(o)}}e.exports=o,o.prototype={broadcast:function(t,e,r){r=r||function(){},n.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":396,"./util":414,"./web_worker":401}],406:[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":414}],407:[function(t,e,r){"use strict";function n(t,e,r){if(1===t){var n=r.readMessage(i,{glyphs:{}});e.push(n)}}function i(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(a,{});e.glyphs[n.id]=n}}function a(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=function(t,e){this.stacks=t.readFields(n,[],e)}},{}],408:[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)})}},{}],409:[function(t,e,r){"use strict";function n(t,e,r){if(t.length>1){if(i(t,e))return!0;for(var n=0;n<e.length;n++)if(s(e[n],t,r))return!0}for(var a=0;a<t.length;a++)if(s(t[a],e,r))return!0;return!1}function i(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++){if(o(n,i,e[a],e[a+1]))return!0}return!1}function a(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function o(t,e,r,n){return a(t,r,n)!==a(e,r,n)&&a(t,e,r)!==a(t,e,n)}function s(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++){if(l(t,e[i-1],e[i])<n)return!0}return!1}function l(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 c(t,e){for(var r,n,i,a=!1,o=0;o<t.length;o++)for(var s=0,l=(r=t[o]).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 u(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:function(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],l=0;l<o.length;l++){var c=o[l];if(u(i,c))return!0;if(s(c,i,r))return!0}return!1},multiPolygonIntersectsMultiPolygon:function(t,e){if(1===t.length&&1===t[0].length)return c(e,t[0][0]);for(var r=0;r<e.length;r++)for(var n=e[r],a=0;a<n.length;a++)if(c(t,n[a]))return!0;for(var o=0;o<t.length;o++){for(var s=t[o],l=0;l<s.length;l++)if(c(e,s[l]))return!0;for(var u=0;u<e.length;u++)if(i(s,e[u]))return!0}return!1},multiPolygonIntersectsBufferedMultiLine:function(t,e,r){for(var i=0;i<e.length;i++)for(var a=e[i],o=0;o<t.length;o++){var s=t[o];if(s.length>=3)for(var l=0;l<a.length;l++)if(u(s,a[l]))return!0;if(n(s,a,r))return!0}return!1}}},{}],410:[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}},{}],411:[function(t,e,r){"use strict";var n=t("./config"),i=t("./browser"),a=t("url"),o=t("./util");function s(t,e,r){if(!(r=r||n.ACCESS_TOKEN)&&n.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:\/\//,n.API_URL+e),t+=-1!==t.indexOf("?")?"&access_token=":"?access_token=",n.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 l(t){return t?"?"+t:""}e.exports.normalizeStyleURL=function(t,e){var r=a.parse(t);return"mapbox:"!==r.protocol?t:s("mapbox:/"+r.pathname+l(r.query),"/styles/v1/",e)},e.exports.normalizeSourceURL=function(t,e){return"mapbox:"!==a.parse(t).protocol?t:s(t+".json","/v4/",e)+"&secure"},e.exports.normalizeGlyphsURL=function(t,e){var r=a.parse(t);return"mapbox:"!==r.protocol?t:s("mapbox://"+r.pathname.split("/")[1]+"/{fontstack}/{range}.pbf"+l(r.query),"/fonts/v1/",e)},e.exports.normalizeSpriteURL=function(t,e,r,n){var i=a.parse(t);return"mapbox:"!==i.protocol?(i.pathname+=e+r,a.format(i)):s("mapbox:/"+i.pathname+"/sprite"+e+r+l(i.query),"/styles/v1/",n)},e.exports.normalizeTileURL=function(t,e,r){var s=a.parse(t,!0);if(!e)return t;if("mapbox:"!==a.parse(e).protocol)return t;var l,c=i.supportsWebp?".webp":"$1",u=i.devicePixelRatio>=2||512===r?"@2x":"";return a.format({protocol:s.protocol,hostname:s.hostname,pathname:s.pathname.replace(/(\.(?:png|jpg)\d*)/,u+c),query:(l=s.query,l.access_token&&"tk."===l.access_token.slice(0,3)?o.extend({},l,{access_token:n.ACCESS_TOKEN}):l)})}},{"./browser":398,"./config":403,"./util":414,url:539}],412:[function(t,e,r){"use strict";var n=t("assert");e.exports=function(t){var e=JSON.stringify(t);if(a[e])return a[e];void 0===t.alignment&&(t.alignment=1);function r(){d.apply(this,arguments)}r.prototype=Object.create(d.prototype);var u=0,m=0,v=["Uint8"];function g(){p.apply(this,arguments),this.members=r.prototype.members}return r.prototype.members=t.members.map(function(e){e={name:e.name,type:e.type,components:e.components||1},n(e.name.length),n(e.type in i),v.indexOf(e.type)<0&&v.push(e.type);var a=l(e.type);m=Math.max(m,a),e.offset=u=s(u,Math.max(t.alignment,a));for(var o=0;o<e.components;o++)Object.defineProperty(r.prototype,e.name+(1===e.components?"":o),{get:f(e,o),set:h(e,o)});return u+=a*e.components,e}),r.prototype.alignment=t.alignment,r.prototype.size=s(u,Math.max(m,t.alignment)),g.serialize=o,g.prototype=Object.create(p.prototype),g.prototype.StructType=r,g.prototype.bytesPerElement=r.prototype.size,g.prototype.emplaceBack=function(t,e){for(var r=[],n=[],i="var i = this.length;\nthis.resize(this.length + 1);\n",a=0;a<t.length;a++){var o=t[a],s=l(o.type);r.indexOf(s)<0&&(r.push(s),i+="var o"+s.toFixed(0)+" = i * "+(e/s).toFixed(0)+";\n");for(var u=0;u<o.components;u++){var f="v"+n.length,h="o"+s.toFixed(0)+" + "+(o.offset/s+u).toFixed(0);i+="this."+c(o.type)+"["+h+"] = "+f+";\n",n.push(f)}}return i+="return i;",new Function(n,i)}(r.prototype.members,r.prototype.size),g.prototype._usedTypes=v,a[e]=g,g};var i={Int8:Int8Array,Uint8:Uint8Array,Uint8Clamped:Uint8ClampedArray,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array,Float64:Float64Array},a={};function o(){return{members:this.prototype.StructType.prototype.members,alignment:this.prototype.StructType.prototype.alignment,bytesPerElement:this.prototype.bytesPerElement}}function s(t,e){return Math.ceil(t/e)*e}function l(t){return i[t].BYTES_PER_ELEMENT}function c(t){return t.toLowerCase()}function u(t,e){var r="this._pos"+l(t.type).toFixed(0)+" + "+(t.offset/l(t.type)+e).toFixed(0);return"this._structArray."+c(t.type)+"["+r+"]"}function f(t,e){return new Function([],"return "+u(t,e)+";")}function h(t,e){return new Function(["x"],u(t,e)+" = x;")}function d(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 p(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))}p.prototype.DEFAULT_CAPACITY=128,p.prototype.RESIZE_MULTIPLIER=5,p.prototype.serialize=function(){return this.trim(),{length:this.length,arrayBuffer:this.arrayBuffer}},p.prototype.get=function(t){return new this.StructType(this,t)},p.prototype.trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},p.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)}},p.prototype._refreshViews=function(){for(var t=0;t<this._usedTypes.length;t++){var e=this._usedTypes[t];this[c(e)]=new i[e](this.arrayBuffer)}},p.prototype.toArray=function(t,e){for(var r=[],n=t;n<e;n++){var i=this.get(n);r.push(i)}return r}},{assert:51}],413:[function(t,e,r){"use strict";e.exports=function(t,e){return e.replace(/{([^{}]+)}/g,function(e,r){return r in t?t[r]:""})}},{}],414:[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){for(var r in t.hasOwnProperty("options")||(t.options=t.options?Object.create(t.options):{}),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,c=Math.max(s,l);return new i((e+n)/2,(r+a)/2,0).zoomTo(Math.floor(-Math.log(c)/Math.LN2))},r.endsWith=function(t,e){return-1!==t.indexOf(e,t.length-e.length)},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;if(Object.keys(e).length!==Object.keys(r).length)return!1;for(var i in e)if(!t(e[i],r[i]))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":310,unitbezier:537}],415:[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}}},{}],416:[function(t,e,r){e.exports={_args:[["mapbox-gl@0.22.1","/home/etienne/Documents/plotly/plotly.js"]],_from:"mapbox-gl@0.22.1",_id:"mapbox-gl@0.22.1",_inBundle:!1,_integrity:"sha1-kqllVH1MLyTCLLxIfu2khpTLYno=",_location:"/mapbox-gl",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"mapbox-gl@0.22.1",name:"mapbox-gl",escapedName:"mapbox-gl",rawSpec:"0.22.1",saveSpec:null,fetchSpec:"0.22.1"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz",_spec:"0.22.1",_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"},engines:{node:">=4.0.0"},homepage:"https://github.com/mapbox/mapbox-gl-js#readme",license:"BSD-3-Clause",main:"js/mapbox-gl.js",name:"mapbox-gl",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"}},{}],417:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1<<t+1,r=new Array(e),n=0;n<e;++n)r[n]=a(t,n);return r};var n=t("convex-hull");function i(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 a(t,e){if(0===e||e===(1<<t+1)-1)return[];for(var r=[],a=[],o=0;o<=t;++o)if(e&1<<o){r.push(i(t,o-1,o-1)),a.push(null);for(var s=0;s<=t;++s)~e&1<<s&&(r.push(i(t,o-1,s-1)),a.push([o,s]))}var l=n(r),c=[];t:for(o=0;o<l.length;++o){var u=l[o],f=[];for(s=0;s<u.length;++s){if(!a[u[s]])continue t;f.push(a[u[s]].slice())}c.push(f)}return c}},{"convex-hull":109}],418:[function(t,e,r){var n=t("./normalize"),i=t("gl-mat4/create"),a=t("gl-mat4/clone"),o=t("gl-mat4/determinant"),s=t("gl-mat4/invert"),l=t("gl-mat4/transpose"),c={length:t("gl-vec3/length"),normalize:t("gl-vec3/normalize"),dot:t("gl-vec3/dot"),cross:t("gl-vec3/cross")},u=i(),f=i(),h=[0,0,0,0],d=[[0,0,0],[0,0,0],[0,0,0]],p=[0,0,0];function m(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}e.exports=function(t,e,r,i,v,g){if(e||(e=[0,0,0]),r||(r=[0,0,0]),i||(i=[0,0,0]),v||(v=[0,0,0,1]),g||(g=[0,0,0,1]),!n(u,t))return!1;if(a(f,u),f[3]=0,f[7]=0,f[11]=0,f[15]=1,Math.abs(o(f)<1e-8))return!1;var y,b,x,_,w,M,k,A=u[3],T=u[7],E=u[11],S=u[12],L=u[13],C=u[14],P=u[15];if(0!==A||0!==T||0!==E){if(h[0]=A,h[1]=T,h[2]=E,h[3]=P,!s(f,f))return!1;l(f,f),y=v,x=f,_=(b=h)[0],w=b[1],M=b[2],k=b[3],y[0]=x[0]*_+x[4]*w+x[8]*M+x[12]*k,y[1]=x[1]*_+x[5]*w+x[9]*M+x[13]*k,y[2]=x[2]*_+x[6]*w+x[10]*M+x[14]*k,y[3]=x[3]*_+x[7]*w+x[11]*M+x[15]*k}else v[0]=v[1]=v[2]=0,v[3]=1;if(e[0]=S,e[1]=L,e[2]=C,function(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]}(d,u),r[0]=c.length(d[0]),c.normalize(d[0],d[0]),i[0]=c.dot(d[0],d[1]),m(d[1],d[1],d[0],1,-i[0]),r[1]=c.length(d[1]),c.normalize(d[1],d[1]),i[0]/=r[1],i[1]=c.dot(d[0],d[2]),m(d[2],d[2],d[0],1,-i[1]),i[2]=c.dot(d[1],d[2]),m(d[2],d[2],d[1],1,-i[2]),r[2]=c.length(d[2]),c.normalize(d[2],d[2]),i[1]/=r[2],i[2]/=r[2],c.cross(p,d[1],d[2]),c.dot(d[0],p)<0)for(var z=0;z<3;z++)r[z]*=-1,d[z][0]*=-1,d[z][1]*=-1,d[z][2]*=-1;return g[0]=.5*Math.sqrt(Math.max(1+d[0][0]-d[1][1]-d[2][2],0)),g[1]=.5*Math.sqrt(Math.max(1-d[0][0]+d[1][1]-d[2][2],0)),g[2]=.5*Math.sqrt(Math.max(1-d[0][0]-d[1][1]+d[2][2],0)),g[3]=.5*Math.sqrt(Math.max(1+d[0][0]+d[1][1]+d[2][2],0)),d[2][1]>d[1][2]&&(g[0]=-g[0]),d[0][2]>d[2][0]&&(g[1]=-g[1]),d[1][0]>d[0][1]&&(g[2]=-g[2]),!0}},{"./normalize":419,"gl-mat4/clone":180,"gl-mat4/create":181,"gl-mat4/determinant":182,"gl-mat4/invert":186,"gl-mat4/transpose":196,"gl-vec3/cross":238,"gl-vec3/dot":239,"gl-vec3/length":240,"gl-vec3/normalize":242}],419:[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}},{}],420:[function(t,e,r){var n=t("gl-vec3/lerp"),i=t("mat4-recompose"),a=t("mat4-decompose"),o=t("gl-mat4/determinant"),s=t("quat-slerp"),l=f(),c=f(),u=f();function f(){return{translate:h(),scale:h(1),skew:h(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function h(t){return[t||0,t||0,t||0]}e.exports=function(t,e,r,f){if(0===o(e)||0===o(r))return!1;var h=a(e,l.translate,l.scale,l.skew,l.perspective,l.quaternion),d=a(r,c.translate,c.scale,c.skew,c.perspective,c.quaternion);return!(!h||!d||(n(u.translate,l.translate,c.translate,f),n(u.skew,l.skew,c.skew,f),n(u.scale,l.scale,c.scale,f),n(u.perspective,l.perspective,c.perspective,f),s(u.quaternion,l.quaternion,c.quaternion,f),i(t,u.translate,u.scale,u.skew,u.perspective,u.quaternion),0))}},{"gl-mat4/determinant":182,"gl-vec3/lerp":241,"mat4-decompose":418,"mat4-recompose":421,"quat-slerp":471}],421:[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":181,"gl-mat4/fromRotationTranslation":184,"gl-mat4/identity":185,"gl-mat4/multiply":188,"gl-mat4/scale":194,"gl-mat4/translate":195}],422:[function(t,e,r){"use strict";var n=t("binary-search-bounds"),i=t("mat4-interpolate"),a=t("gl-mat4/invert"),o=t("gl-mat4/rotateX"),s=t("gl-mat4/rotateY"),l=t("gl-mat4/rotateZ"),c=t("gl-mat4/lookAt"),u=t("gl-mat4/translate"),f=(t("gl-mat4/scale"),t("gl-vec3/normalize")),h=[0,0,0];function d(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}e.exports=function(t){return new d((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var p=d.prototype;p.recalcMatrix=function(t){var e=this._time,r=n.le(e,t),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,c=0;c<16;++c)o[c]=s[l++];else{var u=e[r+1]-e[r],h=(l=16*r,this.prevMatrix),d=!0;for(c=0;c<16;++c)h[c]=s[l++];var p=this.nextMatrix;for(c=0;c<16;++c)p[c]=s[l++],d=d&&h[c]===p[c];if(u<1e-6||d)for(c=0;c<16;++c)o[c]=h[c];else i(o,h,p,(t-e[r])/u)}var m=this.computedUp;m[0]=o[1],m[1]=o[5],m[2]=o[9],f(m,m);var v=this.computedInverse;a(v,o);var g=this.computedEye,y=v[15];g[0]=v[12]/y,g[1]=v[13]/y,g[2]=v[14]/y;var b=this.computedCenter,x=Math.exp(this.computedRadius[0]);for(c=0;c<3;++c)b[c]=g[c]-o[2+4*c]*x}},p.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)}},p.flush=function(t){var e=n.gt(this._time,t)-2;e<0||(this._time.splice(0,e),this._components.splice(0,16*e))},p.lastT=function(){return this._time[this._time.length-1]},p.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||h,n=n||this.computedUp,this.setMatrix(t,c(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},p.rotate=function(t,e,r,n){this.recalcMatrix(t);var i=this.computedInverse;e&&s(i,i,e),r&&o(i,i,r),n&&l(i,i,n),this.setMatrix(t,a(this.computedMatrix,i))};var m=[0,0,0];p.pan=function(t,e,r,n){m[0]=-(e||0),m[1]=-(r||0),m[2]=-(n||0),this.recalcMatrix(t);var i=this.computedInverse;u(i,i,m),this.setMatrix(t,a(i,i))},p.translate=function(t,e,r,n){m[0]=e||0,m[1]=r||0,m[2]=n||0,this.recalcMatrix(t);var i=this.computedMatrix;u(i,i,m),this.setMatrix(t,i)},p.setMatrix=function(t,e){if(!(t<this.lastT())){this._time.push(t);for(var r=0;r<16;++r)this._components.push(e[r])}},p.setDistance=function(t,e){this.computedRadius[0]=e},p.setDistanceLimits=function(t,e){var r=this._limits;r[0]=t,r[1]=e},p.getDistanceLimits=function(t){var e=this._limits;return t?(t[0]=e[0],t[1]=e[1],t):e}},{"binary-search-bounds":70,"gl-mat4/invert":186,"gl-mat4/lookAt":187,"gl-mat4/rotateX":191,"gl-mat4/rotateY":192,"gl-mat4/rotateZ":193,"gl-mat4/scale":194,"gl-mat4/translate":195,"gl-vec3/normalize":242,"mat4-interpolate":420}],423:[function(t,e,r){"use strict";e.exports=function(t){var e=t.length;if(e<3){for(var r=new Array(e),i=0;i<e;++i)r[i]=i;return 2===e&&t[0][0]===t[1][0]&&t[0][1]===t[1][1]?[0]:r}for(var a=new Array(e),i=0;i<e;++i)a[i]=i;a.sort(function(e,r){var n=t[e][0]-t[r][0];return n||t[e][1]-t[r][1]});for(var o=[a[0],a[1]],s=[a[0],a[1]],i=2;i<e;++i){for(var l=a[i],c=t[l],u=o.length;u>1&&n(t[o[u-2]],t[o[u-1]],c)<=0;)u-=1,o.pop();for(o.push(l),u=s.length;u>1&&n(t[s[u-2]],t[s[u-1]],c)>=0;)u-=1,s.pop();s.push(l)}for(var r=new Array(s.length+o.length-2),f=0,i=0,h=o.length;i<h;++i)r[f++]=o[i];for(var d=s.length-2;d>0;--d)r[f++]=s[d];return r};var n=t("robust-orientation")[3]},{"robust-orientation":495}],424:[function(t,e,r){"use strict";e.exports=function(t,e){e||(e=t,t=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==o.alt,o.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==o.shift,o.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==o.control,o.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==o.meta,o.meta=!!t.metaKey),e}function c(t,s){var c=n.x(s),u=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||c!==i||u!==a||l(s))&&(r=0|t,i=c||0,a=u||0,e&&e(r,i,a,o))}function u(t){c(0,t)}function f(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,e&&e(0,0,0,o))}function h(t){l(t)&&e&&e(r,i,a,o)}function d(t){0===n.buttons(t)?c(0,t):c(r,t)}function p(t){c(r|n.buttons(t),t)}function m(t){c(r&~n.buttons(t),t)}function v(){s||(s=!0,t.addEventListener("mousemove",d),t.addEventListener("mousedown",p),t.addEventListener("mouseup",m),t.addEventListener("mouseleave",u),t.addEventListener("mouseenter",u),t.addEventListener("mouseout",u),t.addEventListener("mouseover",u),t.addEventListener("blur",f),t.addEventListener("keyup",h),t.addEventListener("keydown",h),t.addEventListener("keypress",h),t!==window&&(window.addEventListener("blur",f),window.addEventListener("keyup",h),window.addEventListener("keydown",h),window.addEventListener("keypress",h)))}v();var g={element:t};return Object.defineProperties(g,{enabled:{get:function(){return s},set:function(e){e?v():s&&(s=!1,t.removeEventListener("mousemove",d),t.removeEventListener("mousedown",p),t.removeEventListener("mouseup",m),t.removeEventListener("mouseleave",u),t.removeEventListener("mouseenter",u),t.removeEventListener("mouseout",u),t.removeEventListener("mouseover",u),t.removeEventListener("blur",f),t.removeEventListener("keyup",h),t.removeEventListener("keydown",h),t.removeEventListener("keypress",h),t!==window&&(window.removeEventListener("blur",f),window.removeEventListener("keyup",h),window.removeEventListener("keydown",h),window.removeEventListener("keypress",h)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),g};var n=t("mouse-event")},{"mouse-event":426}],425:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var i=t.clientX||0,a=t.clientY||0,o=(s=e,s===window||s===document||s===document.body?n:s.getBoundingClientRect());var s;return r[0]=i-o.left,r[1]=a-o.top,r}},{}],426:[function(t,e,r){"use strict";function n(t){return t.target||t.srcElement||window}r.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){if(2===(e=t.which))return 4;if(3===e)return 2;if(e>0)return 1<<e-1}else if("button"in t){var e;if(1===(e=t.button))return 4;if(2===e)return 2;if(e>=0)return 1<<e}}return 0},r.element=n,r.x=function(t){if("object"==typeof t){if("offsetX"in t)return t.offsetX;var e=n(t).getBoundingClientRect();return t.clientX-e.left}return 0},r.y=function(t){if("object"==typeof t){if("offsetY"in t)return t.offsetY;var e=n(t).getBoundingClientRect();return t.clientY-e.top}return 0}},{}],427:[function(t,e,r){"use strict";var n=t("to-px");e.exports=function(t,e,r){"function"==typeof t&&(r=!!e,e=t,t=window);var i=n("ex",t),a=function(t){r&&t.preventDefault();var n=t.deltaX||0,a=t.deltaY||0,o=t.deltaZ||0,s=t.deltaMode,l=1;switch(s){case 1:l=i;break;case 2:l=window.innerHeight}if(a*=l,o*=l,(n*=l)||a||o)return e(n,a,o,t)};return t.addEventListener("wheel",a),a}},{"to-px":528}],428:[function(t,e,r){"use strict";var n=t("typedarray-pool");function i(t){return"a"+t}function a(t){return"d"+t}function o(t,e){return"c"+t+"_"+e}function s(t){return"s"+t}function l(t,e){return"t"+t+"_"+e}function c(t){return"o"+t}function u(t){return"x"+t}function f(t){return"p"+t}function h(t,e){return"d"+t+"_"+e}function d(t){return"i"+t}function p(t,e){return"u"+t+"_"+e}function m(t){return"b"+t}function v(t){return"y"+t}function g(t){return"e"+t}function y(t){return"v"+t}e.exports=function(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 T=t.arrayArguments||1;T<1&&e("Must have at least one array argument");var E=t.scalarArguments||0;E<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 S=t.getters||[],L=new Array(T),C=0;C<T;++C)S.indexOf(C)>=0?L[C]=!0:L[C]=!1;return function(t,e,r,T,E,S){var L=S.length,C=E.length;if(C<2)throw new Error("ndarray-extract-contour: Dimension must be at least 2");for(var P="extractContour"+E.join("_"),z=[],O=[],D=[],I=0;I<L;++I)D.push(i(I));for(var I=0;I<T;++I)D.push(u(I));for(var I=0;I<C;++I)O.push(s(I)+"="+i(0)+".shape["+I+"]|0");for(var I=0;I<L;++I){O.push(a(I)+"="+i(I)+".data",c(I)+"="+i(I)+".offset|0");for(var R=0;R<C;++R)O.push(l(I,R)+"="+i(I)+".stride["+R+"]|0")}for(var I=0;I<L;++I){O.push(f(I)+"="+c(I)),O.push(o(I,0));for(var R=1;R<1<<C;++R){for(var N=[],F=0;F<C;++F)R&1<<F&&N.push("-"+l(I,F));O.push(h(I,R)+"=("+N.join("")+")|0"),O.push(o(I,R)+"=0")}}for(var I=0;I<L;++I)for(var R=0;R<C;++R){var j=[l(I,E[R])];R>0&&j.push(l(I,E[R-1])+"*"+s(E[R-1])),O.push(p(I,E[R])+"=("+j.join("-")+")|0")}for(var I=0;I<C;++I)O.push(d(I)+"=0");O.push(_+"=0");for(var B=["2"],I=C-2;I>=0;--I)B.push(s(E[I]));O.push(w+"=("+B.join("*")+")|0",x+"=mallocUint32("+w+")",b+"=mallocUint32("+w+")",M+"=0"),O.push(m(0)+"=0");for(var R=1;R<1<<C;++R){for(var U=[],V=[],F=0;F<C;++F)R&1<<F&&(0===V.length?U.push("1"):U.unshift(V.join("*"))),V.push(s(E[F]));var q="";U[0].indexOf(s(E[C-2]))<0&&(q="-");var H=A(C,R,E);O.push(g(H)+"=(-"+U.join("-")+")|0",v(H)+"=("+q+U.join("-")+")|0",m(H)+"=0")}function G(t,e){z.push("for(",d(E[t]),"=",e,";",d(E[t]),"<",s(E[t]),";","++",d(E[t]),"){")}function Y(t){for(var e=0;e<L;++e)z.push(f(e),"+=",p(e,E[t]),";");z.push("}")}function W(){for(var t=1;t<1<<C;++t)z.push(k,"=",g(t),";",g(t),"=",v(t),";",v(t),"=",k,";")}O.push(y(0)+"=0",k+"=0"),function t(e,r){if(e<0)return void function(t){for(var e=0;e<L;++e)S[e]?z.push(o(e,0),"=",a(e),".get(",f(e),");"):z.push(o(e,0),"=",a(e),"[",f(e),"];");for(var r=[],e=0;e<L;++e)r.push(o(e,0));for(var e=0;e<T;++e)r.push(u(e));z.push(m(0),"=",x,"[",M,"]=phase(",r.join(),");");for(var n=1;n<1<<C;++n)z.push(m(n),"=",x,"[",M,"+",g(n),"];");for(var i=[],n=1;n<1<<C;++n)i.push("("+m(0)+"!=="+m(n)+")");z.push("if(",i.join("||"),"){");for(var s=[],e=0;e<C;++e)s.push(d(e));for(var e=0;e<L;++e){s.push(o(e,0));for(var n=1;n<1<<C;++n)S[e]?z.push(o(e,n),"=",a(e),".get(",f(e),"+",h(e,n),");"):z.push(o(e,n),"=",a(e),"[",f(e),"+",h(e,n),"];"),s.push(o(e,n))}for(var e=0;e<1<<C;++e)s.push(m(e));for(var e=0;e<T;++e)s.push(u(e));z.push("vertex(",s.join(),");",y(0),"=",b,"[",M,"]=",_,"++;");for(var l=(1<<C)-1,c=m(l),n=0;n<C;++n)if(0==(t&~(1<<n))){for(var p=l^1<<n,v=m(p),w=[],k=p;k>0;k=k-1&p)w.push(b+"["+M+"+"+g(k)+"]");w.push(y(0));for(var k=0;k<L;++k)1&n?w.push(o(k,l),o(k,p)):w.push(o(k,p),o(k,l));1&n?w.push(c,v):w.push(v,c);for(var k=0;k<T;++k)w.push(u(k));z.push("if(",c,"!==",v,"){","face(",w.join(),")}")}z.push("}",M,"+=1;")}(r);!function(t){for(var e=t-1;e>=0;--e)G(e,0);for(var r=[],e=0;e<L;++e)S[e]?r.push(a(e)+".get("+f(e)+")"):r.push(a(e)+"["+f(e)+"]");for(var e=0;e<T;++e)r.push(u(e));z.push(x,"[",M,"++]=phase(",r.join(),");");for(var e=0;e<t;++e)Y(e);for(var n=0;n<L;++n)z.push(f(n),"+=",p(n,E[t]),";")}(e);z.push("if(",s(E[e]),">0){",d(E[e]),"=1;");t(e-1,r|1<<E[e]);for(var n=0;n<L;++n)z.push(f(n),"+=",p(n,E[e]),";");e===C-1&&(z.push(M,"=0;"),W());G(e,2);t(e-1,r);e===C-1&&(z.push("if(",d(E[C-1]),"&1){",M,"=0;}"),W());Y(e);z.push("}")}(C-1,0),z.push("freeUint32(",b,");freeUint32(",x,");");var X=["'use strict';","function ",P,"(",D.join(),"){","var ",O.join(),";",z.join(""),"}","return ",P].join("");return new Function("vertex","face","phase","mallocUint32","freeUint32",X)(t,e,r,n.mallocUint32,n.freeUint32)}(t.vertex,t.cell,t.phase,E,r,L)};var b="V",x="P",_="N",w="Q",M="X",k="T";function A(t,e,r){for(var n=0,i=0;i<t;++i)e&1<<i&&(n|=1<<r[i]);return n}},{"typedarray-pool":534}],429:[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":119}],430:[function(t,e,r){"use strict";e.exports=function(t,e,r){if(Array.isArray(r)){if(r.length!==e.dimension)throw new Error("ndarray-gradient: invalid boundary conditions")}else r=n(e.dimension,"string"==typeof r?r:"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 i=0;i<e.dimension;++i)if(t.shape[i]!==e.shape[i])throw new Error("ndarray-gradient: shape mismatch");if(0===e.size)return t;if(e.dimension<=0)return t.set(0),t;return function(t){var e=t.join();if(g=o[e])return g;var r=t.length,n=["function gradient(dst,src){var s=src.shape.slice();"];function i(e){for(var i=r-e.length,a=[],o=[],s=[],l=0;l<r;++l)e.indexOf(l+1)>=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),a.push("1"),o.push("s["+l+"]-2"));var c=".lo("+a.join()+").hi("+o.join()+")";if(0===a.length&&(c=""),i>0){n.push("if(1");for(var l=0;l<r;++l)e.indexOf(l+1)>=0||e.indexOf(-(l+1))>=0||n.push("&&s[",l,"]>2");n.push("){grad",i,"(src.pick(",s.join(),")",c);for(var l=0;l<r;++l)e.indexOf(l+1)>=0||e.indexOf(-(l+1))>=0||n.push(",dst.pick(",s.join(),",",l,")",c);n.push(");")}for(var l=0;l<e.length;++l){var u=Math.abs(e[l])-1,f="dst.pick("+s.join()+","+u+")"+c;switch(t[u]){case"clamp":var h=s.slice(),d=s.slice();e[l]<0?h[u]="s["+u+"]-2":d[u]="1",0===i?n.push("if(s[",u,"]>1){dst.set(",s.join(),",",u,",0.5*(src.get(",h.join(),")-src.get(",d.join(),")))}else{dst.set(",s.join(),",",u,",0)};"):n.push("if(s[",u,"]>1){diff(",f,",src.pick(",h.join(),")",c,",src.pick(",d.join(),")",c,");}else{zero(",f,");};");break;case"mirror":0===i?n.push("dst.set(",s.join(),",",u,",0);"):n.push("zero(",f,");");break;case"wrap":var p=s.slice(),m=s.slice();e[l]<0?(p[u]="s["+u+"]-2",m[u]="0"):(p[u]="s["+u+"]-1",m[u]="1"),0===i?n.push("if(s[",u,"]>2){dst.set(",s.join(),",",u,",0.5*(src.get(",p.join(),")-src.get(",m.join(),")))}else{dst.set(",s.join(),",",u,",0)};"):n.push("if(s[",u,"]>2){diff(",f,",src.pick(",p.join(),")",c,",src.pick(",m.join(),")",c,");}else{zero(",f,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}i>0&&n.push("};")}for(var s=0;s<1<<r;++s){for(var f=[],h=0;h<r;++h)s&1<<h&&f.push(h+1);for(var d=0;d<1<<f.length;++d){for(var p=f.slice(),h=0;h<f.length;++h)d&1<<h&&(p[h]=-p[h]);i(p)}}n.push("return dst;};return gradient");for(var m=["diff","zero"],v=[l,c],s=1;s<=r;++s)m.push("grad"+s),v.push(u(s));m.push(n.join(""));var g=Function.apply(void 0,m).apply(void 0,v);return a[e]=g,g}(r)(t,e)};var n=t("dup"),i=t("cwise-compiler"),a={},o={},s={body:"",args:[],thisVars:[],localVars:[]},l=i({args:["array","array","array"],pre:s,post:s,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"}),c=i({args:["array"],pre:s,post:s,body:{args:[{name:"out",lvalue:!0,rvalue:!1,count:1}],body:"out=0",thisVars:[],localVars:[]},funcName:"zero"});function u(t){if(t in a)return a[t];for(var e=[],r=0;r<t;++r)e.push("out",r,"s=0.5*(inp",r,"l-inp",r,"r);");var o=["array"],l=["junk"];for(r=0;r<t;++r){o.push("array"),l.push("out"+r+"s");var c=n(t);c[r]=-1,o.push({array:0,offset:c.slice()}),c[r]=1,o.push({array:0,offset:c.slice()}),l.push("inp"+r+"l","inp"+r+"r")}return a[t]=i({args:o,pre:s,post:s,body:{body:e.join(""),args:l.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})}},{"cwise-compiler":116,dup:134}],431:[function(t,e,r){"use strict";var n=t("ndarray-warp"),i=t("gl-matrix-invert");e.exports=function(t,e,r){var a=e.dimension,o=i([],r);return n(t,e,function(t,e){for(var r=0;r<a;++r){t[r]=o[(a+1)*a+r];for(var n=0;n<a;++n)t[r]+=o[(a+1)*n+r]*e[n]}var i=o[(a+1)*(a+1)-1];for(n=0;n<a;++n)i+=o[(a+1)*n+a]*e[n];var s=1/i;for(r=0;r<a;++r)t[r]*=s;return t}),t}},{"gl-matrix-invert":197,"ndarray-warp":438}],432:[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];return(1-n)*(i?+t.get(r):0)+n*(a?+t.get(r+1):0)}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,c=0<=s&&s<t.shape[1],u=0<=s+1&&s+1<t.shape[1],f=a&&c?t.get(n,s):0,h=a&&u?t.get(n,s+1):0;return(1-l)*((1-i)*f+i*(o&&c?t.get(n+1,s):0))+l*((1-i)*h+i*(o&&u?t.get(n+1,s+1):0))}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),c=r-l,u=0<=l&&l<t.shape[1],f=0<=l+1&&l+1<t.shape[1],h=Math.floor(n),d=n-h,p=0<=h&&h<t.shape[2],m=0<=h+1&&h+1<t.shape[2],v=o&&u&&p?t.get(i,l,h):0,g=o&&f&&p?t.get(i,l+1,h):0,y=s&&u&&p?t.get(i+1,l,h):0,b=s&&f&&p?t.get(i+1,l+1,h):0,x=o&&u&&m?t.get(i,l,h+1):0,_=o&&f&&m?t.get(i,l+1,h+1):0;return(1-d)*((1-c)*((1-a)*v+a*y)+c*((1-a)*g+a*b))+d*((1-c)*((1-a)*x+a*(s&&u&&m?t.get(i+1,l,h+1):0))+c*((1-a)*_+a*(s&&f&&m?t.get(i+1,l+1,h+1):0)))}e.exports=function(t,e,r,o){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,o);default:return function(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,c,u,f=0;t:for(e=0;e<1<<n;++e){for(c=1,u=t.offset,l=0;l<n;++l)if(e&1<<l){if(!s[l])continue t;c*=a[l],u+=t.stride[l]*(i[l]+1)}else{if(!o[l])continue t;c*=1-a[l],u+=t.stride[l]*i[l]}f+=c*t.data[u]}return f}.apply(void 0,arguments)}},e.exports.d1=n,e.exports.d2=i,e.exports.d3=a},{}],433:[function(t,e,r){"use strict";var n=t("cwise-compiler"),i={body:"",args:[],thisVars:[],localVars:[]};function a(t){if(!t)return i;for(var e=0;e<t.args.length;++e){var r=t.args[e];t.args[e]=0===e?{name:r,lvalue:!0,rvalue:!!t.rvalue,count:t.count||1}:{name:r,lvalue:!1,rvalue:!0,count:1}}return t.thisVars||(t.thisVars=[]),t.localVars||(t.localVars=[]),t}function o(t){for(var e=[],r=0;r<t.args.length;++r)e.push("a"+r);return new Function("P",["return function ",t.funcName,"_ndarrayops(",e.join(","),") {P(",e.join(","),");return a0}"].join(""))(function(t){return n({args:t.args,pre:a(t.pre),body:a(t.body),post:a(t.proc),funcName:t.funcName})}(t))}var s={add:"+",sub:"-",mul:"*",div:"/",mod:"%",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"};!function(){for(var t in s){var e=s[t];r[t]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var l={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in l){var e=l[t];r[t]=o({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=o({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in c){var e=c[t];r[t]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var u=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;t<u.length;++t){var e=u[t];r[e]=o({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"]=o({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]=o({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"]=o({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"]=o({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"]=o({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 h=["atan2","pow"];!function(){for(var t=0;t<h.length;++t){var e=h[t];r[e+"op"]=o({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"]=o({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"]=o({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"]=o({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=n({args:["array"],pre:i,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=n({args:["array"],pre:i,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=n({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=n({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=n({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=n({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=n({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=n({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=n({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=n({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_<this_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=n({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=n({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=o({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=o({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=o({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=n({args:["array","array"],pre:i,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":116}],434:[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":435,ndarray:439}],435:[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":116}],436:[function(t,e,r){"use strict";var n=t("typedarray-pool"),i=32;function a(t){switch(t){case"uint8":return[n.mallocUint8,n.freeUint8];case"uint16":return[n.mallocUint16,n.freeUint16];case"uint32":return[n.mallocUint32,n.freeUint32];case"int8":return[n.mallocInt8,n.freeInt8];case"int16":return[n.mallocInt16,n.freeInt16];case"int32":return[n.mallocInt32,n.freeInt32];case"float32":return[n.mallocFloat,n.freeFloat];case"float64":return[n.mallocDouble,n.freeDouble];default:return null}}function o(t){for(var e=[],r=0;r<t;++r)e.push("s"+r);for(r=0;r<t;++r)e.push("n"+r);for(r=1;r<t;++r)e.push("d"+r);for(r=1;r<t;++r)e.push("e"+r);for(r=1;r<t;++r)e.push("f"+r);return e}e.exports=function(t,e){var r=["'use strict'"],n=["ndarraySortWrapper",t.join("d"),e].join("");r.push(["function ",n,"(",["array"].join(","),"){"].join(""));for(var s=["data=array.data,offset=array.offset|0,shape=array.shape,stride=array.stride"],l=0;l<t.length;++l)s.push(["s",l,"=stride[",l,"]|0,n",l,"=shape[",l,"]|0"].join(""));var c=new Array(t.length),u=[];for(l=0;l<t.length;++l)0!==(d=t[l])&&(0===u.length?c[d]="1":c[d]=u.join("*"),u.push("n"+d));var f=-1,h=-1;for(l=0;l<t.length;++l){var d,p=t[l];0!==p&&(f>0?s.push(["d",p,"=s",p,"-d",f,"*n",f].join("")):s.push(["d",p,"=s",p].join("")),f=p),0!=(d=t.length-1-l)&&(h>0?s.push(["e",d,"=s",d,"-e",h,"*n",h,",f",d,"=",c[d],"-f",h,"*n",h].join("")):s.push(["e",d,"=s",d,",f",d,"=",c[d]].join("")),h=d)}r.push("var "+s.join(","));var m=["0","n0-1","data","offset"].concat(o(t.length));r.push(["if(n0<=",i,"){","insertionSort(",m.join(","),")}else{","quickSort(",m.join(","),")}"].join("")),r.push("}return "+n);var v=new Function("insertionSort","quickSort",r.join("\n")),g=function(t,e){var r=["'use strict'"],n=["ndarrayInsertionSort",t.join("d"),e].join(""),i=["left","right","data","offset"].concat(o(t.length)),s=a(e),l=["i,j,cptr,ptr=left*s0+offset"];if(t.length>1){for(var c=[],u=1;u<t.length;++u)l.push("i"+u),c.push("n"+u);s?l.push("scratch=malloc("+c.join("*")+")"):l.push("scratch=new Array("+c.join("*")+")"),l.push("dptr","sptr","a","b")}else l.push("scratch");function f(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function h(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}if(r.push(["function ",n,"(",i.join(","),"){var ",l.join(",")].join(""),"for(i=left+1;i<=right;++i){","j=i;ptr+=s0","cptr=ptr"),t.length>1){for(r.push("dptr=0;sptr=ptr"),u=t.length-1;u>=0;--u)0!==(d=t[u])&&r.push(["for(i",d,"=0;i",d,"<n",d,";++i",d,"){"].join(""));for(r.push("scratch[dptr++]=",f("sptr")),u=0;u<t.length;++u)0!==(d=t[u])&&r.push("sptr+=d"+d,"}");for(r.push("__g:while(j--\x3eleft){","dptr=0","sptr=cptr-s0"),u=1;u<t.length;++u)1===u&&r.push("__l:"),r.push(["for(i",u,"=0;i",u,"<n",u,";++i",u,"){"].join(""));for(r.push(["a=",f("sptr"),"\nb=scratch[dptr]\nif(a<b){break __g}\nif(a>b){break __l}"].join("")),u=t.length-1;u>=1;--u)r.push("sptr+=e"+u,"dptr+=f"+u,"}");for(r.push("dptr=cptr;sptr=cptr-s0"),u=t.length-1;u>=0;--u)0!==(d=t[u])&&r.push(["for(i",d,"=0;i",d,"<n",d,";++i",d,"){"].join(""));for(r.push(h("dptr",f("sptr"))),u=0;u<t.length;++u)0!==(d=t[u])&&r.push(["dptr+=d",d,";sptr+=d",d].join(""),"}");for(r.push("cptr-=s0\n}"),r.push("dptr=cptr;sptr=0"),u=t.length-1;u>=0;--u)0!==(d=t[u])&&r.push(["for(i",d,"=0;i",d,"<n",d,";++i",d,"){"].join(""));for(r.push(h("dptr","scratch[sptr++]")),u=0;u<t.length;++u){var d;0!==(d=t[u])&&r.push("dptr+=d"+d,"}")}}else r.push("scratch="+f("ptr"),"while((j--\x3eleft)&&("+f("cptr-s0")+">scratch)){",h("cptr",f("cptr-s0")),"cptr-=s0","}",h("cptr","scratch"));return r.push("}"),t.length>1&&s&&r.push("free(scratch)"),r.push("} return "+n),s?new Function("malloc","free",r.join("\n"))(s[0],s[1]):new Function(r.join("\n"))()}(t,e);return v(g,function(t,e,r){var n=["'use strict'"],s=["ndarrayQuickSort",t.join("d"),e].join(""),l=["left","right","data","offset"].concat(o(t.length)),c=a(e),u=0;n.push(["function ",s,"(",l.join(","),"){"].join(""));var f=["sixth=((right-left+1)/6)|0","index1=left+sixth","index5=right-sixth","index3=(left+right)>>1","index2=index3-sixth","index4=index3+sixth","el1=index1","el2=index2","el3=index3","el4=index4","el5=index5","less=left+1","great=right-1","pivots_are_equal=true","tmp","tmp0","x","y","z","k","ptr0","ptr1","ptr2","comp_pivot1=0","comp_pivot2=0","comp=0"];if(t.length>1){for(var h=[],d=1;d<t.length;++d)h.push("n"+d),f.push("i"+d);for(d=0;d<8;++d)f.push("b_ptr"+d);f.push("ptr3","ptr4","ptr5","ptr6","ptr7","pivot_ptr","ptr_shift","elementSize="+h.join("*")),c?f.push("pivot1=malloc(elementSize)","pivot2=malloc(elementSize)"):f.push("pivot1=new Array(elementSize),pivot2=new Array(elementSize)")}else f.push("pivot1","pivot2");function p(t){return["(offset+",t,"*s0)"].join("")}function m(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function v(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}function g(e,r,i){if(1===e.length)n.push("ptr0="+p(e[0]));else for(var a=0;a<e.length;++a)n.push(["b_ptr",a,"=s0*",e[a]].join(""));for(r&&n.push("pivot_ptr=0"),n.push("ptr_shift=offset"),a=t.length-1;a>=0;--a)0!==(o=t[a])&&n.push(["for(i",o,"=0;i",o,"<n",o,";++i",o,"){"].join(""));if(e.length>1)for(a=0;a<e.length;++a)n.push(["ptr",a,"=b_ptr",a,"+ptr_shift"].join(""));for(n.push(i),r&&n.push("++pivot_ptr"),a=0;a<t.length;++a){var o;0!==(o=t[a])&&(e.length>1?n.push("ptr_shift+=d"+o):n.push("ptr0+=d"+o),n.push("}"))}}function y(e,r,i,a){if(1===r.length)n.push("ptr0="+p(r[0]));else{for(var o=0;o<r.length;++o)n.push(["b_ptr",o,"=s0*",r[o]].join(""));n.push("ptr_shift=offset")}for(i&&n.push("pivot_ptr=0"),e&&n.push(e+":"),o=1;o<t.length;++o)n.push(["for(i",o,"=0;i",o,"<n",o,";++i",o,"){"].join(""));if(r.length>1)for(o=0;o<r.length;++o)n.push(["ptr",o,"=b_ptr",o,"+ptr_shift"].join(""));for(n.push(a),o=t.length-1;o>=1;--o)i&&n.push("pivot_ptr+=f"+o),r.length>1?n.push("ptr_shift+=e"+o):n.push("ptr0+=e"+o),n.push("}")}function b(){t.length>1&&c&&n.push("free(pivot1)","free(pivot2)")}function x(e,r){var i="el"+e,a="el"+r;if(t.length>1){var o="__l"+ ++u;y(o,[i,a],!1,["comp=",m("ptr0"),"-",m("ptr1"),"\n","if(comp>0){tmp0=",i,";",i,"=",a,";",a,"=tmp0;break ",o,"}\n","if(comp<0){break ",o,"}"].join(""))}else n.push(["if(",m(p(i)),">",m(p(a)),"){tmp0=",i,";",i,"=",a,";",a,"=tmp0}"].join(""))}function _(e,r){t.length>1?g([e,r],!1,v("ptr0",m("ptr1"))):n.push(v(p(e),m(p(r))))}function w(e,r,i){if(t.length>1){var a="__l"+ ++u;y(a,[r],!0,[e,"=",m("ptr0"),"-pivot",i,"[pivot_ptr]\n","if(",e,"!==0){break ",a,"}"].join(""))}else n.push([e,"=",m(p(r)),"-pivot",i].join(""))}function M(e,r){t.length>1?g([e,r],!1,["tmp=",m("ptr0"),"\n",v("ptr0",m("ptr1")),"\n",v("ptr1","tmp")].join("")):n.push(["ptr0=",p(e),"\n","ptr1=",p(r),"\n","tmp=",m("ptr0"),"\n",v("ptr0",m("ptr1")),"\n",v("ptr1","tmp")].join(""))}function k(e,r,i){t.length>1?(g([e,r,i],!1,["tmp=",m("ptr0"),"\n",v("ptr0",m("ptr1")),"\n",v("ptr1",m("ptr2")),"\n",v("ptr2","tmp")].join("")),n.push("++"+r,"--"+i)):n.push(["ptr0=",p(e),"\n","ptr1=",p(r),"\n","ptr2=",p(i),"\n","++",r,"\n","--",i,"\n","tmp=",m("ptr0"),"\n",v("ptr0",m("ptr1")),"\n",v("ptr1",m("ptr2")),"\n",v("ptr2","tmp")].join(""))}function A(t,e){M(t,e),n.push("--"+e)}function T(e,r,i){t.length>1?g([e,r],!0,[v("ptr0",m("ptr1")),"\n",v("ptr1",["pivot",i,"[pivot_ptr]"].join(""))].join("")):n.push(v(p(e),m(p(r))),v(p(r),"pivot"+i))}function E(e,r){n.push(["if((",r,"-",e,")<=",i,"){\n","insertionSort(",e,",",r,",data,offset,",o(t.length).join(","),")\n","}else{\n",s,"(",e,",",r,",data,offset,",o(t.length).join(","),")\n","}"].join(""))}function S(e,r,i){t.length>1?(n.push(["__l",++u,":while(true){"].join("")),g([e],!0,["if(",m("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",u,"}"].join("")),n.push(i,"}")):n.push(["while(",m(p(e)),"===pivot",r,"){",i,"}"].join(""))}return n.push("var "+f.join(",")),x(1,2),x(4,5),x(1,3),x(2,3),x(1,4),x(3,4),x(2,5),x(2,3),x(4,5),t.length>1?g(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",m("ptr1"),"\n","pivot2[pivot_ptr]=",m("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",m("ptr0"),"\n","y=",m("ptr2"),"\n","z=",m("ptr4"),"\n",v("ptr5","x"),"\n",v("ptr6","y"),"\n",v("ptr7","z")].join("")):n.push(["pivot1=",m(p("el2")),"\n","pivot2=",m(p("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",m(p("el1")),"\n","y=",m(p("el3")),"\n","z=",m(p("el5")),"\n",v(p("index1"),"x"),"\n",v(p("index3"),"y"),"\n",v(p("index5"),"z")].join("")),_("index2","left"),_("index4","right"),n.push("if(pivots_are_equal){"),n.push("for(k=less;k<=great;++k){"),w("comp","k",1),n.push("if(comp===0){continue}"),n.push("if(comp<0){"),n.push("if(k!==less){"),M("k","less"),n.push("}"),n.push("++less"),n.push("}else{"),n.push("while(true){"),w("comp","great",1),n.push("if(comp>0){"),n.push("great--"),n.push("}else if(comp<0){"),k("k","less","great"),n.push("break"),n.push("}else{"),A("k","great"),n.push("break"),n.push("}"),n.push("}"),n.push("}"),n.push("}"),n.push("}else{"),n.push("for(k=less;k<=great;++k){"),w("comp_pivot1","k",1),n.push("if(comp_pivot1<0){"),n.push("if(k!==less){"),M("k","less"),n.push("}"),n.push("++less"),n.push("}else{"),w("comp_pivot2","k",2),n.push("if(comp_pivot2>0){"),n.push("while(true){"),w("comp","great",2),n.push("if(comp>0){"),n.push("if(--great<k){break}"),n.push("continue"),n.push("}else{"),w("comp","great",1),n.push("if(comp<0){"),k("k","less","great"),n.push("}else{"),A("k","great"),n.push("}"),n.push("break"),n.push("}"),n.push("}"),n.push("}"),n.push("}"),n.push("}"),n.push("}"),T("left","(less-1)",1),T("right","(great+1)",2),E("left","(less-2)"),E("(great+2)","right"),n.push("if(pivots_are_equal){"),b(),n.push("return"),n.push("}"),n.push("if(less<index1&&great>index5){"),S("less",1,"++less"),S("great",2,"--great"),n.push("for(k=less;k<=great;++k){"),w("comp_pivot1","k",1),n.push("if(comp_pivot1===0){"),n.push("if(k!==less){"),M("k","less"),n.push("}"),n.push("++less"),n.push("}else{"),w("comp_pivot2","k",2),n.push("if(comp_pivot2===0){"),n.push("while(true){"),w("comp","great",2),n.push("if(comp===0){"),n.push("if(--great<k){break}"),n.push("continue"),n.push("}else{"),w("comp","great",1),n.push("if(comp<0){"),k("k","less","great"),n.push("}else{"),A("k","great"),n.push("}"),n.push("break"),n.push("}"),n.push("}"),n.push("}"),n.push("}"),n.push("}"),n.push("}"),b(),E("less","great"),n.push("}return "+s),t.length>1&&c?new Function("insertionSort","malloc","free",n.join("\n"))(r,c[0],c[1]):new Function("insertionSort",n.join("\n"))(r)}(t,e,g))}},{"typedarray-pool":534}],437:[function(t,e,r){"use strict";var n=t("./lib/compile_sort.js"),i={};e.exports=function(t){var e=t.order,r=t.dtype,a=[e,r].join(":"),o=i[a];return o||(i[a]=o=n(e,r)),o(t),t}},{"./lib/compile_sort.js":436}],438:[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":119,"ndarray-linear-interpolate":432}],439:[function(t,e,r){var n=t("iota-array"),i=t("is-buffer"),a="undefined"!=typeof Float64Array;function o(t,e){return t[0]-e[0]}function s(){var t,e=this.stride,r=new Array(e.length);for(t=0;t<r.length;++t)r[t]=[Math.abs(e[t]),t];r.sort(o);var n=new Array(r.length);for(t=0;t<n.length;++t)n[t]=r[t][1];return n}function l(t,e){var r=["View",e,"d",t].join("");e<0&&(r="View_Nil"+t);var i="generic"===t;if(-1===e){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);}";return new Function(a)()}if(0===e){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 "+(i?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+r+"_set(v){return "+(i?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+r+"(a,b,c,d){return new "+r+"(a,d)}";return new Function("TrivialArray",a)(c[t][0])}a=["'use strict'"];var o=n(e),l=o.map(function(t){return"i"+t}),u="this.offset+"+o.map(function(t){return"this.stride["+t+"]*i"+t}).join("+"),f=o.map(function(t){return"b"+t}).join(","),h=o.map(function(t){return"c"+t}).join(",");a.push("function "+r+"(a,"+f+","+h+",d){this.data=a","this.shape=["+f+"]","this.stride=["+h+"]","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 "+o.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("+l.join(",")+",v){"),i?a.push("return this.data.set("+u+",v)}"):a.push("return this.data["+u+"]=v}"),a.push("proto.get=function "+r+"_get("+l.join(",")+"){"),i?a.push("return this.data.get("+u+")}"):a.push("return this.data["+u+"]}"),a.push("proto.index=function "+r+"_index(",l.join(),"){return "+u+"}"),a.push("proto.hi=function "+r+"_hi("+l.join(",")+"){return new "+r+"(this.data,"+o.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+o.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var d=o.map(function(t){return"a"+t+"=this.shape["+t+"]"}),p=o.map(function(t){return"c"+t+"=this.stride["+t+"]"});a.push("proto.lo=function "+r+"_lo("+l.join(",")+"){var b=this.offset,d=0,"+d.join(",")+","+p.join(","));for(var m=0;m<e;++m)a.push("if(typeof i"+m+"==='number'&&i"+m+">=0){d=i"+m+"|0;b+=c"+m+"*d;a"+m+"-=d}");a.push("return new "+r+"(this.data,"+o.map(function(t){return"a"+t}).join(",")+","+o.map(function(t){return"c"+t}).join(",")+",b)}"),a.push("proto.step=function "+r+"_step("+l.join(",")+"){var "+o.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+o.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(m=0;m<e;++m)a.push("if(typeof i"+m+"==='number'){d=i"+m+"|0;if(d<0){c+=b"+m+"*(a"+m+"-1);a"+m+"=ceil(-a"+m+"/d)}else{a"+m+"=ceil(a"+m+"/d)}b"+m+"*=d}");a.push("return new "+r+"(this.data,"+o.map(function(t){return"a"+t}).join(",")+","+o.map(function(t){return"b"+t}).join(",")+",c)}");var v=new Array(e),g=new Array(e);for(m=0;m<e;++m)v[m]="a[i"+m+"]",g[m]="b[i"+m+"]";a.push("proto.transpose=function "+r+"_transpose("+l+"){"+l.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(",")+","+g.join(",")+",this.offset)}"),a.push("proto.pick=function "+r+"_pick("+l+"){var a=[],b=[],c=this.offset");for(m=0;m<e;++m)a.push("if(typeof i"+m+"==='number'&&i"+m+">=0){c=(c+this.stride["+m+"]*i"+m+")|0}else{a.push(this.shape["+m+"]);b.push(this.stride["+m+"])}");return 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,"+o.map(function(t){return"shape["+t+"]"}).join(",")+","+o.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",a.join("\n"))(c[t],s)}var c={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=function(t,e,r,n){if(void 0===t)return(0,c.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var o=e.length;if(void 0===r){r=new Array(o);for(var s=o-1,u=1;s>=0;--s)r[s]=u,u*=e[s]}if(void 0===n)for(n=0,s=0;s<o;++s)r[s]<0&&(n-=(e[s]-1)*r[s]);for(var f=function(t){if(i(t))return"buffer";if(a)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"}(t),h=c[f];h.length<=o+1;)h.push(l(f,h.length-1));return(0,h[o+1])(t,e,r,n)}},{"iota-array":261,"is-buffer":263}],440:[function(t,e,r){"use strict";var n=t("double-bits"),i=Math.pow(2,-1074),a=-1>>>0;e.exports=function(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return e<0?-i:i;var r=n.hi(t),o=n.lo(t);e>t==t>0?o===a?(r+=1,o=0):o+=1:0===o?(o=a,r-=1):o-=1;return n.pack(o,r)}},{"double-bits":131}],441:[function(t,e,r){var n=Math.PI,i=c(120);function a(t,e,r,n){return["C",t,e,r,n,r,n]}function o(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}function s(t,e,r,a,o,c,u,f,h,d){if(d)M=d[0],k=d[1],_=d[2],w=d[3];else{var p=l(t,e,-o);t=p.x,e=p.y;var m=(t-(f=(p=l(f,h,-o)).x))/2,v=(e-(h=p.y))/2,g=m*m/(r*r)+v*v/(a*a);g>1&&(r*=g=Math.sqrt(g),a*=g);var y=r*r,b=a*a,x=(c==u?-1:1)*Math.sqrt(Math.abs((y*b-y*v*v-b*m*m)/(y*v*v+b*m*m)));x==1/0&&(x=1);var _=x*r*v/a+(t+f)/2,w=x*-a*m/r+(e+h)/2,M=Math.asin(((e-w)/a).toFixed(9)),k=Math.asin(((h-w)/a).toFixed(9));M=t<_?n-M:M,k=f<_?n-k:k,M<0&&(M=2*n+M),k<0&&(k=2*n+k),u&&M>k&&(M-=2*n),!u&&k>M&&(k-=2*n)}if(Math.abs(k-M)>i){var A=k,T=f,E=h;k=M+i*(u&&k>M?1:-1);var S=s(f=_+r*Math.cos(k),h=w+a*Math.sin(k),r,a,o,0,u,T,E,[k,A,_,w])}var L=Math.tan((k-M)/4),C=4/3*r*L,P=4/3*a*L,z=[2*t-(t+C*Math.sin(M)),2*e-(e-P*Math.cos(M)),f+C*Math.sin(k),h-P*Math.cos(k),f,h];if(d)return z;S&&(z=z.concat(S));for(var O=0;O<z.length;){var D=l(z[O],z[O+1],o);z[O++]=D.x,z[O++]=D.y}return z}function l(t,e,r){return{x:t*Math.cos(r)-e*Math.sin(r),y:t*Math.sin(r)+e*Math.cos(r)}}function c(t){return t*(n/180)}e.exports=function(t){for(var e,r=[],n=0,i=0,l=0,u=0,f=null,h=null,d=0,p=0,m=0,v=t.length;m<v;m++){var g=t[m],y=g[0];switch(y){case"M":l=g[1],u=g[2];break;case"A":(g=s(d,p,g[1],g[2],c(g[3]),g[4],g[5],g[6],g[7])).unshift("C"),g.length>7&&(r.push(g.splice(0,7)),g.unshift("C"));break;case"S":var b=d,x=p;"C"!=e&&"S"!=e||(b+=b-n,x+=x-i),g=["C",b,x,g[1],g[2],g[3],g[4]];break;case"T":"Q"==e||"T"==e?(f=2*d-f,h=2*p-h):(f=d,h=p),g=o(d,p,f,h,g[1],g[2]);break;case"Q":f=g[1],h=g[2],g=o(d,p,g[1],g[2],g[3],g[4]);break;case"L":g=a(d,p,g[1],g[2]);break;case"H":g=a(d,p,g[1],p);break;case"V":g=a(d,p,d,g[1]);break;case"Z":g=a(d,p,l,u)}e=y,d=g[g.length-2],p=g[g.length-1],g.length>4?(n=g[g.length-4],i=g[g.length-3]):(n=d,i=p),r.push(g)}return r}},{}],442:[function(t,e,r){r.vertexNormals=function(t,e,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;o<n;++o)i[o]=[0,0,0];for(o=0;o<t.length;++o)for(var s=t[o],l=0,c=s[s.length-1],u=s[0],f=0;f<s.length;++f){l=c,c=u,u=s[(f+1)%s.length];for(var h=e[l],d=e[c],p=e[u],m=new Array(3),v=0,g=new Array(3),y=0,b=0;b<3;++b)m[b]=h[b]-d[b],v+=m[b]*m[b],g[b]=p[b]-d[b],y+=g[b]*g[b];if(v*y>a){var x=i[c],_=1/Math.sqrt(v*y);for(b=0;b<3;++b){var w=(b+1)%3,M=(b+2)%3;x[b]+=_*(g[w]*m[M]-g[M]*m[w])}}}for(o=0;o<n;++o){x=i[o];var k=0;for(b=0;b<3;++b)k+=x[b]*x[b];if(k>a)for(_=1/Math.sqrt(k),b=0;b<3;++b)x[b]*=_;else for(b=0;b<3;++b)x[b]=0}return i},r.faceNormals=function(t,e,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;o<n;++o){for(var s=t[o],l=new Array(3),c=0;c<3;++c)l[c]=e[s[c]];var u=new Array(3),f=new Array(3);for(c=0;c<3;++c)u[c]=l[1][c]-l[0][c],f[c]=l[2][c]-l[0][c];var h=new Array(3),d=0;for(c=0;c<3;++c){var p=(c+1)%3,m=(c+2)%3;h[c]=u[p]*f[m]-u[m]*f[p],d+=h[c]*h[c]}d=d>a?1/Math.sqrt(d):0;for(c=0;c<3;++c)h[c]*=d;i[o]=h}return i}},{}],443:[function(t,e,r){"use strict";var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,o,s=function(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),l=1;l<arguments.length;l++){for(var c in r=Object(arguments[l]))i.call(r,c)&&(s[c]=r[c]);if(n){o=n(r);for(var u=0;u<o.length;u++)a.call(r,o[u])&&(s[o[u]]=r[o[u]])}}return s}},{}],444:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a,o,s,l,c){var u=e+a+c;if(f>0){var f=Math.sqrt(u+1);t[0]=.5*(o-l)/f,t[1]=.5*(s-n)/f,t[2]=.5*(r-a)/f,t[3]=.5*f}else{var h=Math.max(e,a,c),f=Math.sqrt(2*h-u+1);e>=h?(t[0]=.5*f,t[1]=.5*(i+r)/f,t[2]=.5*(s+n)/f,t[3]=.5*(o-l)/f):a>=h?(t[0]=.5*(r+i)/f,t[1]=.5*f,t[2]=.5*(l+o)/f,t[3]=.5*(s-n)/f):(t[0]=.5*(n+s)/f,t[1]=.5*(o+l)/f,t[2]=.5*f,t[3]=.5*(r-i)/f)}return t}},{}],445:[function(t,e,r){"use strict";e.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),u(r=[].slice.call(r,0,4),r);var i=new f(r,e,Math.log(n));i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up);return i};var n=t("filtered-vector"),i=t("gl-mat4/lookAt"),a=t("gl-mat4/fromQuat"),o=t("gl-mat4/invert"),s=t("./lib/quatFromFrame");function l(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function c(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function u(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=c(r,n,i,a);o>1e-6?(t[0]=r/o,t[1]=n/o,t[2]=i/o,t[3]=a/o):(t[0]=t[1]=t[2]=0,t[3]=1)}function f(t,e,r){this.radius=n([r]),this.center=n(e),this.rotation=n(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var h=f.prototype;h.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},h.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;u(e,e);var r=this.computedMatrix;a(r,e);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var c=0,f=0;f<3;++f)c+=r[l+4*f]*i[f];r[12+l]=-c}},h.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r},h.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},h.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},h.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=i[1],o=i[5],s=i[9],c=l(a,o,s);a/=c,o/=c,s/=c;var u=i[0],f=i[4],h=i[8],d=u*a+f*o+h*s,p=l(u-=a*d,f-=o*d,h-=s*d);u/=p,f/=p,h/=p;var m=i[2],v=i[6],g=i[10],y=m*a+v*o+g*s,b=m*u+v*f+g*h,x=l(m-=y*a+b*u,v-=y*o+b*f,g-=y*s+b*h);m/=x,v/=x,g/=x;var _=u*e+a*r,w=f*e+o*r,M=h*e+s*r;this.center.move(t,_,w,M);var k=Math.exp(this.computedRadius[0]);k=Math.max(1e-4,k+n),this.radius.set(t,Math.log(k))},h.rotate=function(t,e,r,n){this.recalcMatrix(t),e=e||0,r=r||0;var i=this.computedMatrix,a=i[0],o=i[4],s=i[8],u=i[1],f=i[5],h=i[9],d=i[2],p=i[6],m=i[10],v=e*a+r*u,g=e*o+r*f,y=e*s+r*h,b=-(p*y-m*g),x=-(m*v-d*y),_=-(d*g-p*v),w=Math.sqrt(Math.max(0,1-Math.pow(b,2)-Math.pow(x,2)-Math.pow(_,2))),M=c(b,x,_,w);M>1e-6?(b/=M,x/=M,_/=M,w/=M):(b=x=_=0,w=1);var k=this.computedRotation,A=k[0],T=k[1],E=k[2],S=k[3],L=A*w+S*b+T*_-E*x,C=T*w+S*x+E*b-A*_,P=E*w+S*_+A*x-T*b,z=S*w-A*b-T*x-E*_;if(n){b=d,x=p,_=m;var O=Math.sin(n)/l(b,x,_);b*=O,x*=O,_*=O,z=z*(w=Math.cos(e))-(L=L*w+z*b+C*_-P*x)*b-(C=C*w+z*x+P*b-L*_)*x-(P=P*w+z*_+L*x-C*b)*_}var D=c(L,C,P,z);D>1e-6?(L/=D,C/=D,P/=D,z/=D):(L=C=P=0,z=1),this.rotation.set(t,L,C,P,z)},h.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var a=this.computedMatrix;i(a,e,r,n);var o=this.computedRotation;s(o,a[0],a[1],a[2],a[4],a[5],a[6],a[8],a[9],a[10]),u(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var l=0,c=0;c<3;++c)l+=Math.pow(r[c]-e[c],2);this.radius.set(t,.5*Math.log(Math.max(l,1e-6))),this.center.set(t,r[0],r[1],r[2])},h.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},h.setMatrix=function(t,e){var r=this.computedRotation;s(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),u(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,e);var i=n[15];if(Math.abs(i)>1e-6){var a=n[12]/i,l=n[13]/i,c=n[14]/i;this.recalcMatrix(t);var f=Math.exp(this.computedRadius[0]);this.center.set(t,a-n[2]*f,l-n[6]*f,c-n[10]*f),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},h.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},h.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},h.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},h.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},h.fromJSON=function(t){var e=this.lastT(),r=t.center;r&&this.center.set(e,r[0],r[1],r[2]);var n=t.rotation;n&&this.rotation.set(e,n[0],n[1],n[2],n[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},{"./lib/quatFromFrame":444,"filtered-vector":142,"gl-mat4/fromQuat":183,"gl-mat4/invert":186,"gl-mat4/lookAt":187}],446:[function(t,e,r){"use strict";var n=t("repeat-string");e.exports=function(t,e,r){return n(r=void 0!==r?r+"":" ",e)+t}},{"repeat-string":487}],447:[function(t,e,r){e.exports=function(t){var e=[];return t.replace(i,function(t,r,i){var o=r.toLowerCase();for(i=function(t){var e=t.match(a);return e?e.map(Number):[]}(i),"m"==o&&i.length>2&&(e.push([r].concat(i.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(i.length==n[o])return i.unshift(r),e.push(i);if(i.length<n[o])throw new Error("malformed path data");e.push([r].concat(i.splice(0,n[o])))}}),e};var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},i=/([astvzqmhlc])([^astvzqmhlc]*)/gi;var a=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi},{}],448:[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}},{}],449:[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}var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(t){return n.exec(t).slice(1)};function a(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}r.resolve=function(){for(var r="",n=!1,i=arguments.length-1;i>=-1&&!n;i--){var o=i>=0?arguments[i]:t.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(r=o+"/"+r,n="/"===o.charAt(0))}return r=e(a(r.split("/"),function(t){return!!t}),!n).join("/"),(n?"/":"")+r||"."},r.normalize=function(t){var n=r.isAbsolute(t),i="/"===o(t,-1);return(t=e(a(t.split("/"),function(t){return!!t}),!n).join("/"))||n||(t="."),t&&i&&(t+="/"),(n?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(a(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}var c=[];for(l=s;l<i.length;l++)c.push("..");return(c=c.concat(a.slice(s))).join("/")},r.sep="/",r.delimiter=":",r.dirname=function(t){var e=i(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=i(t)[2];return e&&r.substr(-1*e.length)===e&&(r=r.substr(0,r.length-e.length)),r},r.extname=function(t){return i(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:469}],450:[function(t,e,r){"use strict";e.exports=s;var n,i,a,o=t("ieee754");function s(t){var e;t&&t.length&&(t=(e=t).length);var r=new Uint8Array(t||0);return e&&r.set(e),r.readUInt32LE=n.readUInt32LE,r.writeUInt32LE=n.writeUInt32LE,r.readInt32LE=n.readInt32LE,r.writeInt32LE=n.writeInt32LE,r.readFloatLE=n.readFloatLE,r.writeFloatLE=n.writeFloatLE,r.readDoubleLE=n.readDoubleLE,r.writeDoubleLE=n.writeDoubleLE,r.toString=n.toString,r.write=n.write,r.slice=n.slice,r.copy=n.copy,r._isBuffer=!0,r}function l(t){for(var e,r,n=t.length,i=[],a=0;a<n;a++){if((e=t.charCodeAt(a))>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}(n={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 o.read(this,t,!0,23,4)},readDoubleLE:function(t){return o.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return o.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return o.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===i?a:l(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]}}).writeInt32LE=n.writeUInt32LE,s.byteLength=function(t){return i=t,(a=l(t)).length},s.isBuffer=function(t){return!(!t||!t._isBuffer)}},{ieee754:257}],451:[function(t,e,r){(function(r){"use strict";e.exports=i;var n=r.Buffer||t("./buffer");function i(t){this.buf=n.isBuffer(t)?t:new n(t||0),this.pos=0,this.length=this.buf.length}i.Varint=0,i.Fixed64=1,i.Bytes=2,i.Fixed32=5;var a=Math.pow(2,63);function o(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function s(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function l(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 u(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 h(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function d(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function p(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}i.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)+4294967296*this.buf.readUInt32LE(this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+4294967296*this.buf.readInt32LE(this.pos+4);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 t=127&(e=r[this.pos++]),e<128?t:(t|=(127&(e=r[this.pos++]))<<7,e<128?t:(t|=(127&(e=r[this.pos++]))<<14,e<128?t:(t|=(127&(e=r[this.pos++]))<<21,e<128?t:function(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")}(t,this))))},readVarint64:function(){var t=this.pos,e=this.readVarint();if(e<a)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===i.Varint)for(;this.buf[this.pos++]>127;);else if(e===i.Bytes)this.pos=this.readVarint()+this.pos;else if(e===i.Fixed32)this.pos+=4;else{if(e!==i.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 n(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(-1&t,this.pos),this.buf.writeUInt32LE(Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),this.buf.writeInt32LE(-1&t,this.pos),this.buf.writeInt32LE(Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t)>268435455?function(t,e){e.realloc(10);var r=e.pos+10;for(;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}}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t);var e=n.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&&function(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]}(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,i.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,o,e)},writePackedSVarint:function(t,e){this.writeMessage(t,s,e)},writePackedBoolean:function(t,e){this.writeMessage(t,u,e)},writePackedFloat:function(t,e){this.writeMessage(t,l,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,h,e)},writePackedFixed64:function(t,e){this.writeMessage(t,d,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,p,e)},writeBytesField:function(t,e){this.writeTag(t,i.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,i.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,i.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,i.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":450}],452:[function(t,e,r){"use strict";e.exports=function(t){var e=t.length;if(e<n){for(var r=1,a=0;a<e;++a)for(var o=0;o<a;++o)if(t[a]<t[o])r=-r;else if(t[a]===t[o])return 0;return r}for(var s=i.mallocUint8(e),a=0;a<e;++a)s[a]=0;for(var r=1,a=0;a<e;++a)if(!s[a]){var l=1;s[a]=1;for(var o=t[a];o!==a;o=t[o]){if(s[o])return i.freeUint8(s),0;l+=1,s[o]=1}1&l||(r=-r)}return i.freeUint8(s),r};var n=32,i=t("typedarray-pool")},{"typedarray-pool":534}],453:[function(t,e,r){"use strict";var n=t("typedarray-pool"),i=t("invert-permutation");r.rank=function(t){var e=t.length;switch(e){case 0:case 1:return 0;case 2:return t[1]}var r,a,o,s=n.mallocUint32(e),l=n.mallocUint32(e),c=0;for(i(t,l),o=0;o<e;++o)s[o]=t[o];for(o=e-1;o>0;--o)a=l[o],r=s[o],s[o]=s[a],s[a]=r,l[o]=l[r],l[r]=a,c=(c+r)*o;return n.freeUint32(l),n.freeUint32(s),c},r.unrank=function(t,e,r){switch(t){case 0:return r||[];case 1:return r?(r[0]=0,r):[0];case 2:return r?(e?(r[0]=0,r[1]=1):(r[0]=1,r[1]=0),r):e?[0,1]:[1,0]}var n,i,a,o=1;for((r=r||new Array(t))[0]=0,a=1;a<t;++a)r[a]=a,o=o*a|0;for(a=t-1;a>0;--a)e=e-(n=e/o|0)*o|0,o=o/a|0,i=0|r[a],r[a]=0|r[n],r[n]=0|i;return r}},{"invert-permutation":260,"typedarray-pool":534}],454:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n,a,o={};if("string"==typeof e&&(e=i(e)),Array.isArray(e)){var s={};for(a=0;a<e.length;a++)s[e[a]]=!0;e=s}for(n in e)e[n]=i(e[n]);var l={};for(n in e){var c=e[n];if(Array.isArray(c))for(a=0;a<c.length;a++){var u=c[a];if(r&&(l[u]=!0),u in t){if(o[n]=t[u],r)for(var f=a;f<c.length;f++)l[c[f]]=!0;break}}else n in t&&(e[n]&&(o[n]=t[n]),r&&(l[n]=!0))}if(r)for(n in t)l[n]||(o[n]=t[n]);return o};var n={};function i(t){return n[t]?n[t]:("string"==typeof t&&(t=n[t]=t.split(/\s*,\s*|\s+/)),t)}},{}],455:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=0|e.length,i=t.length,a=[new Array(r),new Array(r)],o=0;o<r;++o)a[0][o]=[],a[1][o]=[];for(var o=0;o<i;++o){var s=t[o];a[0][s[0]].push(s),a[1][s[1]].push(s)}for(var l=[],o=0;o<r;++o)a[0][o].length+a[1][o].length===0&&l.push([o]);function c(t,e){var r=a[e][t[e]];r.splice(r.indexOf(t),1)}function u(t,r,i){for(var o,s,l,u=0;u<2;++u)if(a[u][r].length>0){o=a[u][r][0],l=u;break}s=o[1^l];for(var f=0;f<2;++f)for(var h=a[f][r],d=0;d<h.length;++d){var p=h[d],m=p[1^f],v=n(e[t],e[r],e[s],e[m]);v>0&&(o=p,s=m,l=f)}return i?s:(o&&c(o,l),s)}function f(t,r){var i=a[r][t][0],o=[t];c(i,r);for(var s=i[1^r];;){for(;s!==t;)o.push(s),s=u(o[o.length-2],s,!1);if(a[0][t].length+a[1][t].length===0)break;var l=o[o.length-1],f=t,h=o[1],d=u(l,f,!0);if(n(e[l],e[f],e[h],e[d])<0)break;o.push(t),s=u(l,f)}return o}function h(t,e){return e[1]===e[e.length-1]}for(var o=0;o<r;++o)for(var d=0;d<2;++d){for(var p=[];a[d][o].length>0;){a[0][o].length;var m=f(o,d);h(p,m)?p.push.apply(p,m):(p.length>0&&l.push(p),p=m)}p.length>0&&l.push(p)}return l};var n=t("compare-angle")},{"compare-angle":106}],456:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=n(t,e.length),i=new Array(e.length),a=new Array(e.length),o=[],s=0;s<e.length;++s){var l=r[s].length;a[s]=l,i[s]=!0,l<=1&&o.push(s)}for(;o.length>0;){var c=o.pop();i[c]=!1;for(var u=r[c],s=0;s<u.length;++s){var f=u[s];0==--a[f]&&o.push(f)}}for(var h=new Array(e.length),d=[],s=0;s<e.length;++s)if(i[s]){var c=d.length;h[s]=c,d.push(e[s])}else h[s]=-1;for(var p=[],s=0;s<t.length;++s){var m=t[s];i[m[0]]&&i[m[1]]&&p.push([h[m[0]],h[m[1]]])}return[p,d]};var n=t("edges-to-adjacency-list")},{"edges-to-adjacency-list":136}],457:[function(t,e,r){"use strict";e.exports=function(t,e){var r=c(t,e);t=r[0];for(var f=(e=r[1]).length,h=(t.length,n(t,e.length)),d=0;d<f;++d)if(h[d].length%2==1)throw new Error("planar-graph-to-polyline: graph must be manifold");var p=i(t,e);for(var m=(p=p.filter(function(t){for(var r=t.length,n=[0],i=0;i<r;++i){var a=e[t[i]],l=e[t[(i+1)%r]],c=o(-a[0],a[1]),u=o(-a[0],l[1]),f=o(l[0],a[1]),h=o(l[0],l[1]);n=s(n,s(s(c,u),s(f,h)))}return n[n.length-1]>0})).length,v=new Array(m),g=new Array(m),d=0;d<m;++d){v[d]=d;var y=new Array(m),b=p[d].map(function(t){return e[t]}),x=a([b]),_=0;t:for(var w=0;w<m;++w)if(y[w]=0,d!==w){for(var M=p[w],k=M.length,A=0;A<k;++A){var T=x(e[M[A]]);if(0!==T){T<0&&(y[w]=1,_+=1);continue t}}y[w]=1,_+=1}g[d]=[_,d,y]}g.sort(function(t,e){return e[0]-t[0]});for(var d=0;d<m;++d)for(var y=g[d],E=y[1],S=y[2],w=0;w<m;++w)S[w]&&(v[w]=E);for(var L=function(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=[];return e}(m),d=0;d<m;++d)L[d].push(v[d]),L[v[d]].push(d);for(var C={},P=u(f,!1),d=0;d<m;++d)for(var M=p[d],k=M.length,w=0;w<k;++w){var z=M[w],O=M[(w+1)%k],D=Math.min(z,O)+":"+Math.max(z,O);if(D in C){var I=C[D];L[I].push(d),L[d].push(I),P[z]=P[O]=!0}else C[D]=d}function R(t){for(var e=t.length,r=0;r<e;++r)if(!P[t[r]])return!1;return!0}for(var N=[],F=u(m,-1),d=0;d<m;++d)v[d]!==d||R(p[d])?F[d]=-1:(N.push(d),F[d]=0);var r=[];for(;N.length>0;){var j=N.pop(),B=L[j];l(B,function(t,e){return t-e});var U,V=B.length,q=F[j];if(0===q){var M=p[j];U=[M]}for(var d=0;d<V;++d){var H=B[d];if(!(F[H]>=0)&&(F[H]=1^q,N.push(H),0===q)){var M=p[H];R(M)||(M.reverse(),U.push(M))}}0===q&&r.push(U)}return r};var n=t("edges-to-adjacency-list"),i=t("planar-dual"),a=t("point-in-big-polygon"),o=t("two-product"),s=t("robust-sum"),l=t("uniq"),c=t("./lib/trim-leaves");function u(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=e;return r}},{"./lib/trim-leaves":456,"edges-to-adjacency-list":136,"planar-dual":455,"point-in-big-polygon":459,"robust-sum":500,"two-product":532,uniq:536}],458:[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}},{}],459:[function(t,e,r){e.exports=function(t){for(var e=t.length,r=[],a=[],s=0;s<e;++s)for(var u=t[s],f=u.length,h=f-1,d=0;d<f;h=d++){var p=u[h],m=u[d];p[0]===m[0]?a.push([p,m]):r.push([p,m])}if(0===r.length)return 0===a.length?c:(v=l(a),function(t){return v(t[0],t[1])?0:1});var v;var g=i(r),y=function(t,e){return function(r){var i=o.le(e,r[0]);if(i<0)return 1;var a=t[i];if(!a){if(!(i>0&&e[i]===r[0]))return 1;a=t[i-1]}for(var s=1;a;){var l=a.key,c=n(r,l[0],l[1]);if(l[0][0]<l[1][0])if(c<0)a=a.left;else{if(!(c>0))return 0;s=-1,a=a.right}else if(c>0)a=a.left;else{if(!(c<0))return 0;s=1,a=a.right}}return s}}(g.slabs,g.coordinates);return 0===a.length?y:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(l(a),y)};var n=t("robust-orientation")[3],i=t("slab-decomposition"),a=t("interval-tree-1d"),o=t("binary-search-bounds");function s(){return!0}function l(t){for(var e={},r=0;r<t.length;++r){var n=t[r],i=n[0][0],o=n[0][1],l=n[1][1],c=[Math.min(o,l),Math.max(o,l)];i in e?e[i].push(c):e[i]=[c]}var u={},f=Object.keys(e);for(r=0;r<f.length;++r){var h=e[f[r]];u[f[r]]=a(h)}return function(t){return function(e,r){var n=t[e];return!!n&&!!n.queryPoint(r,s)}}(u)}function c(t){return 1}},{"binary-search-bounds":70,"interval-tree-1d":259,"robust-orientation":495,"slab-decomposition":512}],460:[function(t,e,r){var n,i=t("./lib/build-log"),a=t("./lib/epsilon"),o=t("./lib/intersecter"),s=t("./lib/segment-chainer"),l=t("./lib/segment-selector"),c=t("./lib/geojson"),u=!1,f=a();function h(t,e,r){var i=n.segments(t),a=n.segments(e),o=r(n.combine(i,a));return n.polygon(o)}n={buildLog:function(t){return!0===t?u=i():!1===t&&(u=!1),!1!==u&&u.list},epsilon:function(t){return f.epsilon(t)},segments:function(t){var e=o(!0,f,u);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:o(!1,f,u).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:l.union(t.combined,u),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:l.intersect(t.combined,u),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:l.difference(t.combined,u),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:l.differenceRev(t.combined,u),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:l.xor(t.combined,u),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:s(t.segments,f,u),inverted:t.inverted}},polygonFromGeoJSON:function(t){return c.toPolygon(n,t)},polygonToGeoJSON:function(t){return c.fromPolygon(n,f,t)},union:function(t,e){return h(t,e,n.selectUnion)},intersect:function(t,e){return h(t,e,n.selectIntersect)},difference:function(t,e){return h(t,e,n.selectDifference)},differenceRev:function(t,e){return h(t,e,n.selectDifferenceRev)},xor:function(t,e){return h(t,e,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),e.exports=n},{"./lib/build-log":461,"./lib/epsilon":462,"./lib/geojson":463,"./lib/intersecter":464,"./lib/segment-chainer":466,"./lib/segment-selector":467}],461:[function(t,e,r){e.exports=function(){var t,e=0,r=!1;function n(e,r){return t.list.push({type:e,data:r?JSON.parse(JSON.stringify(r)):void 0}),t}return t={list:[],segmentId:function(){return e++},checkIntersection:function(t,e){return n("check",{seg1:t,seg2:e})},segmentChop:function(t,e){return n("div_seg",{seg:t,pt:e}),n("chop",{seg:t,pt:e})},statusRemove:function(t){return n("pop_seg",{seg:t})},segmentUpdate:function(t){return n("seg_update",{seg:t})},segmentNew:function(t,e){return n("new_seg",{seg:t,primary:e})},segmentRemove:function(t){return n("rem_seg",{seg:t})},tempStatus:function(t,e,r){return n("temp_status",{seg:t,above:e,below:r})},rewind:function(t){return n("rewind",{seg:t})},status:function(t,e,r){return n("status",{seg:t,above:e,below:r})},vert:function(e){return e===r?t:(r=e,n("vert",{x:e}))},log:function(t){return"string"!=typeof t&&(t=JSON.stringify(t,!1," ")),n("log",{txt:t})},reset:function(){return n("reset")},selected:function(t){return n("selected",{segs:t})},chainStart:function(t){return n("chain_start",{seg:t})},chainRemoveHead:function(t,e){return n("chain_rem_head",{index:t,pt:e})},chainRemoveTail:function(t,e){return n("chain_rem_tail",{index:t,pt:e})},chainNew:function(t,e){return n("chain_new",{pt1:t,pt2:e})},chainMatch:function(t){return n("chain_match",{index:t})},chainClose:function(t){return n("chain_close",{index:t})},chainAddHead:function(t,e){return n("chain_add_head",{index:t,pt:e})},chainAddTail:function(t,e){return n("chain_add_tail",{index:t,pt:e})},chainConnect:function(t,e){return n("chain_con",{index1:t,index2:e})},chainReverse:function(t){return n("chain_rev",{index:t})},chainJoin:function(t,e){return n("chain_join",{index1:t,index2:e})},done:function(){return n("done")}}}},{}],462:[function(t,e,r){e.exports=function(t){"number"!=typeof t&&(t=1e-10);var e={epsilon:function(e){return"number"==typeof e&&(t=e),t},pointAboveOrOnLine:function(e,r,n){var i=r[0],a=r[1],o=n[0],s=n[1],l=e[0];return(o-i)*(e[1]-a)-(s-a)*(l-i)>=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l<t||l-(a*a+s*s)>-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])<t},pointsSameY:function(e,r){return Math.abs(e[1]-r[1])<t},pointsSame:function(t,r){return e.pointsSameX(t,r)&&e.pointsSameY(t,r)},pointsCompare:function(t,r){return e.pointsSameX(t,r)?e.pointsSameY(t,r)?0:t[1]<r[1]?-1:1:t[0]<r[0]?-1:1},pointsCollinear:function(e,r,n){var i=e[0]-r[0],a=e[1]-r[1],o=r[0]-n[0],s=r[1]-n[1];return Math.abs(i*s-o*a)<t},linesIntersect:function(e,r,n,i){var a=r[0]-e[0],o=r[1]-e[1],s=i[0]-n[0],l=i[1]-n[1],c=a*l-o*s;if(Math.abs(c)<t)return!1;var u=e[0]-n[0],f=e[1]-n[1],h=(s*f-l*u)/c,d=(a*f-o*u)/c,p={alongA:0,alongB:0,pt:[e[0]+h*a,e[1]+h*o]};return p.alongA=h<=-t?-2:h<t?-1:h-1<=-t?0:h-1<t?1:2,p.alongB=d<=-t?-2:d<t?-1:d-1<=-t?0:d-1<t?1:2,p},pointInsideRegion:function(e,r){for(var n=e[0],i=e[1],a=r[r.length-1][0],o=r[r.length-1][1],s=!1,l=0;l<r.length;l++){var c=r[l][0],u=r[l][1];u-i>t!=o-i>t&&(a-c)*(i-u)/(o-u)+c-n>t&&(s=!s),a=c,o=u}return s}};return e}},{}],463:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),i=1;i<e.length;i++)n=t.selectDifference(t.combine(n,r(e[i])));return n}if("Polygon"===e.type)return t.polygon(r(e.coordinates));if("MultiPolygon"===e.type){for(var n=t.segments({inverted:!1,regions:[]}),i=0;i<e.coordinates.length;i++)n=t.selectUnion(t.combine(n,r(e.coordinates[i])));return t.polygon(n)}throw new Error("PolyBool: Cannot convert GeoJSON object to PolyBool polygon")},fromPolygon:function(t,e,r){function n(t,r){return e.pointInsideRegion([.5*(t[0][0]+t[1][0]),.5*(t[0][1]+t[1][1])],r)}function i(t){return{region:t,children:[]}}r=t.polygon(t.segments(r));var a=i(null);function o(t,e){for(var r=0;r<t.children.length;r++){if(n(e,(s=t.children[r]).region))return void o(s,e)}var a=i(e);for(r=0;r<t.children.length;r++){var s;n((s=t.children[r]).region,e)&&(a.children.push(s),t.children.splice(r,1),r--)}t.children.push(a)}for(var s=0;s<r.regions.length;s++){var l=r.regions[s];l.length<3||o(a,l)}function c(t,e){for(var r=0,n=t[t.length-1][0],i=t[t.length-1][1],a=[],o=0;o<t.length;o++){var s=t[o][0],l=t[o][1];a.push([s,l]),r+=l*n-s*i,n=s,i=l}return r<0!==e&&a.reverse(),a.push([a[0][0],a[0][1]]),a}var u=[];function f(t){var e=[c(t.region,!1)];u.push(e);for(var r=0;r<t.children.length;r++)e.push(h(t.children[r]))}function h(t){for(var e=0;e<t.children.length;e++)f(t.children[e]);return c(t.region,!0)}for(s=0;s<a.children.length;s++)f(a.children[s]);return u.length<=0?{type:"Polygon",coordinates:[]}:1==u.length?{type:"Polygon",coordinates:u[0]}:{type:"MultiPolygon",coordinates:u}}};e.exports=n},{}],464:[function(t,e,r){var n=t("./linked-list");e.exports=function(t,e,r){function i(t,e,n){return{id:r?r.segmentId():-1,start:t,end:e,myFill:{above:n.myFill.above,below:n.myFill.below},otherFill:null}}var a=n.create();function o(t,r){a.insertBefore(t,function(n){return function(t,r,n,i,a,o){var s=e.pointsCompare(r,a);return 0!==s?s:e.pointsSame(n,o)?0:t!==i?t?1:-1:e.pointAboveOrOnLine(n,i?a:o,i?o:a)?1:-1}(t.isStart,t.pt,r,n.isStart,n.pt,n.other.pt)<0})}function s(t,e){var r=function(t,e){var r=n.node({isStart:!0,pt:t.start,seg:t,primary:e,other:null,status:null});return o(r,t.end),r}(t,e);return function(t,e,r){var i=n.node({isStart:!1,pt:e.end,seg:e,primary:r,other:t,status:null});t.other=i,o(i,t.pt)}(r,t,e),r}function l(t,e){var n=i(e,t.seg.end,t.seg);return function(t,e){r&&r.segmentChop(t.seg,e),t.other.remove(),t.seg.end=e,t.other.pt=e,o(t.other,t.pt)}(t,e),s(n,t.primary)}function c(i,o){var s=n.create();function c(t){return s.findTransition(function(r){var n,i,a,o,s,l;return n=t,i=r.ev,a=n.seg.start,o=n.seg.end,s=i.seg.start,l=i.seg.end,(e.pointsCollinear(a,s,l)?e.pointsCollinear(o,s,l)?1:e.pointAboveOrOnLine(o,s,l)?1:-1:e.pointAboveOrOnLine(a,s,l)?1:-1)>0})}function u(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,c=a.start,u=a.end;r&&r.checkIntersection(i,a);var f=e.linesIntersect(o,s,c,u);if(!1===f){if(!e.pointsCollinear(o,s,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(s,c))return!1;var h=e.pointsSame(o,c),d=e.pointsSame(s,u);if(h&&d)return n;var p=!h&&e.pointBetween(o,c,u),m=!d&&e.pointBetween(s,c,u);if(h)return m?l(n,s):l(t,u),n;p&&(d||(m?l(n,s):l(t,u)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(t,c):0===f.alongB?l(t,f.pt):1===f.alongB&&l(t,u)),0===f.alongB&&(-1===f.alongA?l(n,o):0===f.alongA?l(n,f.pt):1===f.alongA&&l(n,s));return!1}for(var f=[];!a.isEmpty();){var h=a.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var d=c(h),p=d.before?d.before.ev:null,m=d.after?d.after.ev:null;function v(){if(p){var t=u(h,p);if(t)return t}return!!m&&u(h,m)}r&&r.tempStatus(h.seg,!!p&&p.seg,!!m&&m.seg);var g,y,b=v();if(b)t?(y=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(b.seg.myFill.above=!b.seg.myFill.above):b.seg.otherFill=h.seg.myFill,r&&r.segmentUpdate(b.seg),h.other.remove(),h.remove();if(a.getHead()!==h){r&&r.rewind(h.seg);continue}t?(y=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=m?m.seg.myFill.above:i,h.seg.myFill.above=y?!h.seg.myFill.below:h.seg.myFill.below):null===h.seg.otherFill&&(g=m?h.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:h.primary?o:i,h.seg.otherFill={above:g,below:g}),r&&r.status(h.seg,!!p&&p.seg,!!m&&m.seg),h.other.status=d.insert(n.node({ev:h}))}else{var x=h.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&u(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!h.primary){var _=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=_}f.push(h.seg)}a.getHead().remove()}return r&&r.done(),f}return t?{addRegion:function(t){for(var n,i,a,o=t[t.length-1],l=0;l<t.length;l++){n=o,o=t[l];var c=e.pointsCompare(n,o);0!==c&&s((i=c<0?n:o,a=c<0?o:n,{id:r?r.segmentId():-1,start:i,end:a,myFill:{above:null,below:null},otherFill:null}),!0)}},calculate:function(t){return c(t,!1)}}:{calculate:function(t,e,r,n){return t.forEach(function(t){s(i(t.start,t.end,t),!0)}),r.forEach(function(t){s(i(t.start,t.end,t),!1)}),c(e,n)}}}},{"./linked-list":465}],465:[function(t,e,r){e.exports={create:function(){var t={root:{root:!0,next:null},exists:function(e){return null!==e&&e!==t.root},isEmpty:function(){return null===t.root.next},getHead:function(){return t.root.next},insertBefore:function(e,r){for(var n=t.root,i=t.root.next;null!==i;){if(r(i))return e.prev=i.prev,e.next=i,i.prev.next=e,void(i.prev=e);n=i,i=i.next}n.next=e,e.prev=n,e.next=null},findTransition:function(e){for(var r=t.root,n=t.root.next;null!==n&&!e(n);)r=n,n=n.next;return{before:r===t.root?null:r,after:n,insert:function(t){return t.prev=r,t.next=n,r.next=t,null!==n&&(n.prev=t),t}}}};return t},node:function(t){return t.prev=null,t.next=null,t.remove=function(){t.prev.next=t.next,t.next&&(t.next.prev=t.prev),t.prev=null,t.next=null},t}}},{}],466:[function(t,e,r){e.exports=function(t,e,r){var n=[],i=[];return t.forEach(function(t){var a=t.start,o=t.end;if(e.pointsSame(a,o))console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");else{r&&r.chainStart(t);for(var s={index:0,matches_head:!1,matches_pt1:!1},l={index:0,matches_head:!1,matches_pt1:!1},c=s,u=0;u<n.length;u++){var f=(v=n[u])[0],h=(v[1],v[v.length-1]);if(v[v.length-2],e.pointsSame(f,a)){if(k(u,!0,!0))break}else if(e.pointsSame(f,o)){if(k(u,!0,!1))break}else if(e.pointsSame(h,a)){if(k(u,!1,!0))break}else if(e.pointsSame(h,o)&&k(u,!1,!1))break}if(c===s)return n.push([a,o]),void(r&&r.chainNew(a,o));if(c===l){r&&r.chainMatch(s.index);var d=s.index,p=s.matches_pt1?o:a,m=s.matches_head,v=n[d],g=m?v[0]:v[v.length-1],y=m?v[1]:v[v.length-2],b=m?v[v.length-1]:v[0],x=m?v[v.length-2]:v[1];return e.pointsCollinear(y,g,p)&&(m?(r&&r.chainRemoveHead(s.index,p),v.shift()):(r&&r.chainRemoveTail(s.index,p),v.pop()),g=y),e.pointsSame(b,p)?(n.splice(d,1),e.pointsCollinear(x,b,g)&&(m?(r&&r.chainRemoveTail(s.index,g),v.pop()):(r&&r.chainRemoveHead(s.index,g),v.shift())),r&&r.chainClose(s.index),void i.push(v)):void(m?(r&&r.chainAddHead(s.index,p),v.unshift(p)):(r&&r.chainAddTail(s.index,p),v.push(p)))}var _=s.index,w=l.index;r&&r.chainConnect(_,w);var M=n[_].length<n[w].length;s.matches_head?l.matches_head?M?(A(_),T(_,w)):(A(w),T(w,_)):T(w,_):l.matches_head?T(_,w):M?(A(_),T(w,_)):(A(w),T(_,w))}function k(t,e,r){return c.index=t,c.matches_head=e,c.matches_pt1=r,c===s?(c=l,!1):(c=null,!0)}function A(t){r&&r.chainReverse(t),n[t].reverse()}function T(t,i){var a=n[t],o=n[i],s=a[a.length-1],l=a[a.length-2],c=o[0],u=o[1];e.pointsCollinear(l,s,c)&&(r&&r.chainRemoveTail(t,s),a.pop(),s=l),e.pointsCollinear(s,c,u)&&(r&&r.chainRemoveHead(i,c),o.shift()),r&&r.chainJoin(t,i),n[t]=a.concat(o),n.splice(i,1)}}),i}},{}],467:[function(t,e,r){function n(t,e,r){var n=[];return t.forEach(function(t){var i=(t.myFill.above?8:0)+(t.myFill.below?4:0)+(t.otherFill&&t.otherFill.above?2:0)+(t.otherFill&&t.otherFill.below?1:0);0!==e[i]&&n.push({id:r?r.segmentId():-1,start:t.start,end:t.end,myFill:{above:1===e[i],below:2===e[i]},otherFill:null})}),r&&r.selected(n),n}var i={union:function(t,e){return n(t,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],e)},intersect:function(t,e){return n(t,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],e)},difference:function(t,e){return n(t,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],e)},differenceRev:function(t,e){return n(t,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],e)},xor:function(t,e){return n(t,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],e)}};e.exports=i},{}],468:[function(t,e,r){"use strict";var n=new Float64Array(4),i=new Float64Array(4),a=new Float64Array(4);e.exports=function(t,e,r,o,s){n.length<o.length&&(n=new Float64Array(o.length),i=new Float64Array(o.length),a=new Float64Array(o.length));for(var l=0;l<o.length;++l)n[l]=t[l]-o[l],i[l]=e[l]-t[l],a[l]=r[l]-t[l];var c=0,u=0,f=0,h=0,d=0,p=0;for(l=0;l<o.length;++l){var m=i[l],v=a[l],g=n[l];c+=m*m,u+=m*v,f+=v*v,h+=g*m,d+=g*v,p+=g*g}var y,b,x,_,w,M=Math.abs(c*f-u*u),k=u*d-f*h,A=u*h-c*d;if(k+A<=M)if(k<0)A<0&&h<0?(A=0,-h>=c?(k=1,y=c+2*h+p):y=h*(k=-h/c)+p):(k=0,d>=0?(A=0,y=p):-d>=f?(A=1,y=f+2*d+p):y=d*(A=-d/f)+p);else if(A<0)A=0,h>=0?(k=0,y=p):-h>=c?(k=1,y=c+2*h+p):y=h*(k=-h/c)+p;else{var T=1/M;y=(k*=T)*(c*k+u*(A*=T)+2*h)+A*(u*k+f*A+2*d)+p}else k<0?(x=f+d)>(b=u+h)?(_=x-b)>=(w=c-2*u+f)?(k=1,A=0,y=c+2*h+p):y=(k=_/w)*(c*k+u*(A=1-k)+2*h)+A*(u*k+f*A+2*d)+p:(k=0,x<=0?(A=1,y=f+2*d+p):d>=0?(A=0,y=p):y=d*(A=-d/f)+p):A<0?(x=c+h)>(b=u+d)?(_=x-b)>=(w=c-2*u+f)?(A=1,k=0,y=f+2*d+p):y=(k=1-(A=_/w))*(c*k+u*A+2*h)+A*(u*k+f*A+2*d)+p:(A=0,x<=0?(k=1,y=c+2*h+p):h>=0?(k=0,y=p):y=h*(k=-h/c)+p):(_=f+d-u-h)<=0?(k=0,A=1,y=f+2*d+p):_>=(w=c-2*u+f)?(k=1,A=0,y=c+2*h+p):y=(k=_/w)*(c*k+u*(A=1-k)+2*h)+A*(u*k+f*A+2*d)+p;var E=1-k-A;for(l=0;l<o.length;++l)s[l]=E*t[l]+k*e[l]+A*r[l];return y<0?0:y}},{}],469:[function(t,e,r){var n,i,a=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function l(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var c,u=[],f=!1,h=-1;function d(){f&&c&&(f=!1,c.length?u=c.concat(u):h=-1,u.length&&p())}function p(){if(!f){var t=l(d);f=!0;for(var e=u.length;e;){for(c=u,u=[];++h<e;)c&&c[h].run();h=-1,e=u.length}c=null,f=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function m(t,e){this.fun=t,this.array=e}function v(){}a.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new m(t,e)),1!==u.length||f||l(p)},m.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=v,a.addListener=v,a.once=v,a.off=v,a.removeListener=v,a.removeAllListeners=v,a.emit=v,a.prependListener=v,a.prependOnceListener=v,a.listeners=function(t){return[]},a.binding=function(t){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(t){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],470:[function(t,e,r){(function(t){!function(n){var i="object"==typeof r&&r&&!r.nodeType&&r,a="object"==typeof e&&e&&!e.nodeType&&e,o="object"==typeof t&&t;o.global!==o&&o.window!==o&&o.self!==o||(n=o);var s,l,c=2147483647,u=36,f=1,h=26,d=38,p=700,m=72,v=128,g="-",y=/^xn--/,b=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,_={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=u-f,M=Math.floor,k=String.fromCharCode;function A(t){throw new RangeError(_[t])}function T(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function E(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+T((t=t.replace(x,".")).split("."),e).join(".")}function S(t){for(var e,r,n=[],i=0,a=t.length;i<a;)(e=t.charCodeAt(i++))>=55296&&e<=56319&&i<a?56320==(64512&(r=t.charCodeAt(i++)))?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--):n.push(e);return n}function L(t){return T(t,function(t){var e="";return t>65535&&(e+=k((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=k(t)}).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function P(t,e,r){var n=0;for(t=r?M(t/p):t>>1,t+=M(t/e);t>w*h>>1;n+=u)t=M(t/w);return M(n+(w+1)*t/(t+d))}function z(t){var e,r,n,i,a,o,s,l,d,p,y,b=[],x=t.length,_=0,w=v,k=m;for((r=t.lastIndexOf(g))<0&&(r=0),n=0;n<r;++n)t.charCodeAt(n)>=128&&A("not-basic"),b.push(t.charCodeAt(n));for(i=r>0?r+1:0;i<x;){for(a=_,o=1,s=u;i>=x&&A("invalid-input"),((l=(y=t.charCodeAt(i++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:u)>=u||l>M((c-_)/o))&&A("overflow"),_+=l*o,!(l<(d=s<=k?f:s>=k+h?h:s-k));s+=u)o>M(c/(p=u-d))&&A("overflow"),o*=p;k=P(_-a,e=b.length+1,0==a),M(_/e)>c-w&&A("overflow"),w+=M(_/e),_%=e,b.splice(_++,0,w)}return L(b)}function O(t){var e,r,n,i,a,o,s,l,d,p,y,b,x,_,w,T=[];for(b=(t=S(t)).length,e=v,r=0,a=m,o=0;o<b;++o)(y=t[o])<128&&T.push(k(y));for(n=i=T.length,i&&T.push(g);n<b;){for(s=c,o=0;o<b;++o)(y=t[o])>=e&&y<s&&(s=y);for(s-e>M((c-r)/(x=n+1))&&A("overflow"),r+=(s-e)*x,e=s,o=0;o<b;++o)if((y=t[o])<e&&++r>c&&A("overflow"),y==e){for(l=r,d=u;!(l<(p=d<=a?f:d>=a+h?h:d-a));d+=u)w=l-p,_=u-p,T.push(k(C(p+w%_,0))),l=M(w/_);T.push(k(C(l,0))),a=P(r,x,n==i),r=0,++n}++r,++e}return T.join("")}if(s={version:"1.4.1",ucs2:{decode:S,encode:L},decode:z,encode:O,toASCII:function(t){return E(t,function(t){return b.test(t)?"xn--"+O(t):t})},toUnicode:function(t){return E(t,function(t){return y.test(t)?z(t.slice(4).toLowerCase()):t})}},i&&a)if(e.exports==i)a.exports=s;else for(l in s)s.hasOwnProperty(l)&&(i[l]=s[l]);else n.punycode=s}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],471:[function(t,e,r){e.exports=t("gl-quat/slerp")},{"gl-quat/slerp":213}],472:[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 c=t.length;l>0&&c>l&&(c=l);for(var u=0;u<c;++u){var f,h,d,p,m=t[u].replace(s,"%20"),v=m.indexOf(r);v>=0?(f=m.substr(0,v),h=m.substr(v+1)):(f=m,h=""),d=decodeURIComponent(f),p=decodeURIComponent(h),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)}},{}],473:[function(t,e,r){"use strict";var n=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?a(o(t),function(o){var s=encodeURIComponent(n(o))+r;return i(t[o])?a(t[o],function(t){return s+encodeURIComponent(n(t))}).join(e):s+encodeURIComponent(n(t[o]))}).join(e):s?encodeURIComponent(n(s))+r+encodeURIComponent(n(t)):""};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function a(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 o=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}},{}],474:[function(t,e,r){"use strict";r.decode=r.parse=t("./decode"),r.encode=r.stringify=t("./encode")},{"./decode":472,"./encode":473}],475:[function(t,e,r){"use strict";function n(t,e,r,n,o){!function t(e,r,n,a,o){for(;a>n;){if(a-n>600){var s=a-n+1,l=r-n+1,c=Math.log(s),u=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1),h=Math.max(n,Math.floor(r-l*u/s+f)),d=Math.min(a,Math.floor(r+(s-l)*u/s+f));t(e,r,h,d,o)}var p=e[r],m=n,v=a;for(i(e,n,r),o(e[a],p)>0&&i(e,n,a);m<v;){for(i(e,m,v),m++,v--;o(e[m],p)<0;)m++;for(;o(e[v],p)>0;)v--}0===o(e[n],p)?i(e,n,v):i(e,++v,a),v<=r&&(n=v+1),r<=v&&(a=v-1)}}(t,e,r||0,n||t.length-1,o||a)}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,e.exports.default=n},{}],476:[function(t,e,r){"use strict";var n=t("big-rat/add");e.exports=function(t,e){for(var r=t.length,i=new Array(r),a=0;a<r;++a)i[a]=n(t[a],e[a]);return i}},{"big-rat/add":54}],477:[function(t,e,r){"use strict";e.exports=function(t){for(var e=new Array(t.length),r=0;r<t.length;++r)e[r]=n(t[r]);return e};var n=t("big-rat")},{"big-rat":57}],478:[function(t,e,r){"use strict";var n=t("big-rat"),i=t("big-rat/mul");e.exports=function(t,e){for(var r=n(e),a=t.length,o=new Array(a),s=0;s<a;++s)o[s]=i(t[s],r);return o}},{"big-rat":57,"big-rat/mul":66}],479:[function(t,e,r){"use strict";var n=t("big-rat/sub");e.exports=function(t,e){for(var r=t.length,i=new Array(r),a=0;a<r;++a)i[a]=n(t[a],e[a]);return i}},{"big-rat/sub":68}],480:[function(t,e,r){"use strict";var n=t("compare-cell"),i=t("compare-oriented-cell"),a=t("cell-orientation");e.exports=function(t){t.sort(i);for(var e=t.length,r=0,o=0;o<e;++o){var s=t[o],l=a(s);if(0!==l){if(r>0){var c=t[r-1];if(0===n(s,c)&&a(c)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},{"cell-orientation":91,"compare-cell":107,"compare-oriented-cell":108}],481:[function(t,e,r){"use strict";var n=t("array-bounds"),i=t("color-normalize"),a=t("update-diff"),o=t("pick-by-alias"),s=t("object-assign"),l=t("flatten-vertex-data"),c=t("to-float32"),u=c.float32,f=c.fract32;e.exports=function(t,e){"function"==typeof t?(e||(e={}),e.regl=t):e=t;e.length&&(e.positions=e);if(!(t=e.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");var r,c,d,p,m,v,g=t._gl,y={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},b=[];return p=t.buffer({usage:"dynamic",type:"uint8",data:null}),c=t.buffer({usage:"dynamic",type:"float",data:null}),d=t.buffer({usage:"dynamic",type:"float",data:null}),m=t.buffer({usage:"dynamic",type:"float",data:null}),v=t.buffer({usage:"static",type:"float",data:h}),M(e),r=t({vert:"\n\t\tprecision highp float;\n\n\t\tattribute vec2 position, positionFract;\n\t\tattribute vec4 error;\n\t\tattribute vec4 color;\n\n\t\tattribute vec2 direction, lineOffset, capOffset;\n\n\t\tuniform vec4 viewport;\n\t\tuniform float lineWidth, capSize;\n\t\tuniform vec2 scale, scaleFract, translate, translateFract;\n\n\t\tvarying vec4 fragColor;\n\n\t\tvoid main() {\n\t\t\tfragColor = color / 255.;\n\n\t\t\tvec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset;\n\n\t\t\tvec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw;\n\n\t\t\tvec2 position = position + dxy;\n\n\t\t\tvec2 pos = (position + translate) * scale\n\t\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t\t+ (position + translate) * scaleFract\n\t\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n\t\t\tpos += pixelOffset / viewport.zw;\n\n\t\t\tgl_Position = vec4(pos * 2. - 1., 0, 1);\n\t\t}\n\t\t",frag:"\n\t\tprecision mediump float;\n\n\t\tvarying vec4 fragColor;\n\n\t\tuniform float opacity;\n\n\t\tvoid main() {\n\t\t\tgl_FragColor = fragColor;\n\t\t\tgl_FragColor.a *= opacity;\n\t\t}\n\t\t",uniforms:{range:t.prop("range"),lineWidth:t.prop("lineWidth"),capSize:t.prop("capSize"),opacity:t.prop("opacity"),scale:t.prop("scale"),translate:t.prop("translate"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{color:{buffer:p,offset:function(t,e){return 4*e.offset},divisor:1},position:{buffer:c,offset:function(t,e){return 8*e.offset},divisor:1},positionFract:{buffer:d,offset:function(t,e){return 8*e.offset},divisor:1},error:{buffer:m,offset:function(t,e){return 16*e.offset},divisor:1},direction:{buffer:v,stride:24,offset:0},lineOffset:{buffer:v,stride:24,offset:8},capOffset:{buffer:v,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport"),stencil:!1,instances:t.prop("count"),count:h.length}),s(x,{update:M,draw:_,destroy:k,regl:t,gl:g,canvas:g.canvas,groups:b}),x;function x(t){t?M(t):null===t&&k(),_()}function _(e){if("number"==typeof e)return w(e);e&&!Array.isArray(e)&&(e=[e]),t._refresh(),b.forEach(function(t,r){t&&(e&&(e[r]?t.draw=!0:t.draw=!1),t.draw?w(r):t.draw=!0)})}function w(t){"number"==typeof t&&(t=b[t]),null!=t&&t&&t.count&&t.color&&t.opacity&&t.positions&&t.positions.length>1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],r(t),t.after&&t.after(t))}function M(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0,r=0;if(b=t.map(function(t,c){var u=b[c];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=o(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),u||(b[c]=u={id:c,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=s({},y,t)),a(u,t,[{lineWidth:function(t){return.5*+t},capSize:function(t){return.5*+t},opacity:parseFloat,errors:function(t){return t=l(t),r+=t.length,t},positions:function(t,r){return t=l(t,"float64"),r.count=Math.floor(t.length/2),r.bounds=n(t,2),r.offset=e,e+=r.count,t}},{color:function(t,e){var r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){var n=t;t=Array(r);for(var a=0;a<r;a++)t[a]=n}if(t.length<r)throw Error("Not enough colors");for(var o=new Uint8Array(4*r),s=0;s<r;s++){var l=i(t[s],"uint8");o.set(l,4*s)}return o},range:function(t,e,r){var n=e.bounds;return t||(t=n),e.scale=[1/(t[2]-t[0]),1/(t[3]-t[1])],e.translate=[-t[0],-t[1]],e.scaleFract=f(e.scale),e.translateFract=f(e.translate),t},viewport:function(t){var e;return Array.isArray(t)?e={x:t[0],y:t[1],width:t[2]-t[0],height:t[3]-t[1]}:t?(e={x:t.x||t.left||0,y:t.y||t.top||0},t.right?e.width=t.right-e.x:e.width=t.w||t.width||0,t.bottom?e.height=t.bottom-e.y:e.height=t.h||t.height||0):e={x:0,y:0,width:g.drawingBufferWidth,height:g.drawingBufferHeight},e}}]),u):u}),e||r){var h=b.reduce(function(t,e,r){return t+(e?e.count:0)},0),v=new Float64Array(2*h),x=new Uint8Array(4*h),_=new Float32Array(4*h);b.forEach(function(t,e){if(t){var r=t.positions,n=t.count,i=t.offset,a=t.color,o=t.errors;n&&(x.set(a,4*i),_.set(o,4*i),v.set(r,2*i))}}),c(u(v)),d(f(v)),p(x),m(_)}}}function k(){c.destroy(),d.destroy(),p.destroy(),m.destroy(),v.destroy()}};var h=[[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]]},{"array-bounds":48,"color-normalize":99,"flatten-vertex-data":143,"object-assign":443,"pick-by-alias":454,"to-float32":527,"update-diff":538}],482:[function(t,e,r){"use strict";var n=t("color-normalize"),i=t("array-bounds"),a=t("object-assign"),o=t("glslify"),s=t("pick-by-alias"),l=t("update-diff"),c=t("flatten-vertex-data"),u=t("earcut"),f=t("array-normalize");e.exports=function(t,e){"function"==typeof t?(e||(e={}),e.regl=t):e=t;e.length&&(e.positions=e);if(!(t=e.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");var r,d,p,m,v,g,y,b,x=t._gl,_={positions:[],dashes:null,join:null,miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:null,fill:null},w=[],M=2,k=3e6,A=1e4;m=t.buffer({usage:"dynamic",type:"uint8",data:null}),v=t.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),g=t.buffer({usage:"dynamic",type:"float",data:null}),y=t.buffer({usage:"dynamic",type:"float",data:null}),b=t.texture({channels:1,data:new Uint8Array(524288),width:256,height:2048,mag:"linear",min:"linear"}),C(e);var T={primitive:"triangle strip",instances:t.prop("count"),count:4,offset:0,uniforms:{miterMode:function(t,e){return"round"===e.join?2:1},miterLimit:t.prop("miterLimit"),scale:t.prop("scale"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),thickness:t.prop("thickness"),dashPattern:b,dashLength:t.prop("dashLength"),dashShape:[256,2048],opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),scaleRatio:t.prop("scaleRatio"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:function(t,e){return!e.overlay}},scissor:{enable:!0,box:t.prop("viewport")},stencil:!1,viewport:t.prop("viewport")};function E(t){t?C(t):null===t&&P(),S()}function S(t){if("number"==typeof t)return L(t);t&&!Array.isArray(t)&&(t=[t]),w.forEach(function(t,e){L(e)})}function L(e){"number"==typeof e&&(e=w[e]),e&&e.count&&e.opacity&&e.positions&&e.positions.length>2&&(t._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&p(e),e.thickness&&e.color&&(e.scaleRatio=[e.scale[0]*e.viewport.width,e.scale[1]*e.viewport.height],e.scaleRatio[0]>k||e.scaleRatio[1]>k?d(e):"rect"===e.join||!e.join&&(e.thickness<=2||e.positions.length>=A)?d(e):r(e),e.after&&e.after(e)))}function C(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0;if(E.lines=w=t.map(function(t,r){var o=w[r];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=s(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color stroke colors stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",after:"after callback done pass"}),o||(w[r]=o={id:r,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,offset:0,dashLength:0,hole:!0},t=a({},_,t)),l(o,t,[{thickness:parseFloat,opacity:parseFloat,miterLimit:parseFloat,overlay:Boolean,join:function(t){return t},after:function(t){return t},hole:function(t){return t||[]},positions:function(t,r,n){t=c(t,"float64");var a=Math.floor(t.length/2),o=i(t,2);return r.range||n.range||(n.range=o),r.count=a,r.bounds=o,e+=a,t},fill:function(t){return t?n(t,"uint8"):null},dashes:function(t,e,r){var n,i=e.dashLength;if(!t||t.length<2)i=1,n=new Uint8Array([255,255,255,255,255,255,255,255]);else{i=0;for(var a=0;a<t.length;++a)i+=t[a];n=new Uint8Array(i*M);for(var o=0,s=255,l=0;l<2;l++)for(var c=0;c<t.length;++c){for(var u=0,f=t[c]*M*.5;u<f;++u)n[o++]=s;s^=255}}return b.subimage({data:n,width:n.length,height:1},0,e.id),e.dashLength=i,n}},{close:function(t,e,r){return null!=t?t:e.positions.length>=4&&e.positions[0]===e.positions[e.positions.length-2]&&e.positions[1]===e.positions[e.positions.length-1]},positions:function(t,e,r){if(e.fill&&t.length){for(var n=[],i={},a=0,o=0,s=0,l=e.count;o<l;o++){var c=e.positions[2*o],f=e.positions[2*o+1];Number.isNaN(c)||Number.isNaN(f)?(c=e.positions[2*a],f=e.positions[2*a+1],i[o]=a):a=o,n[s++]=c,n[s++]=f}for(var h=u(n,e.hole),d=0,p=h.length;d<p;d++)null!=i[h[d]]&&(h[d]=i[h[d]]);e.triangles=h}return e.positions},color:function(t,e,r){var i=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){var a=t;t=Array(i);for(var o=0;o<i;o++)t[o]=a}if(t.length<i)throw Error("Not enough colors");for(var s=new Uint8Array(4*i+4),l=0;l<i;l++){var c=n(t[l],"uint8");s.set(c,4*l)}return s},range:function(t,e,r){if(!e.count)return null;var n=e.bounds;t||(t=n);var i=n[2]-n[0],a=n[3]-n[1],o=t[2]-t[0],s=t[3]-t[1];return e.scale=[i/o,a/s],e.translate=[-t[0]/o+n[0]/o||0,-t[1]/s+n[1]/s||0],e.scaleFract=h(e.scale),e.translateFract=h(e.translate),t},viewport:function(t){var e;return Array.isArray(t)?e={x:t[0],y:t[1],width:t[2]-t[0],height:t[3]-t[1]}:t?(e={x:t.x||t.left||0,y:t.y||t.top||0},t.right?e.width=t.right-e.x:e.width=t.w||t.width||0,t.bottom?e.height=t.bottom-e.y:e.height=t.h||t.height||0):e={x:0,y:0,width:x.drawingBufferWidth,height:x.drawingBufferHeight},e}}]),o):o}),e){var r=2*e+6*w.length,o=new Float64Array(r),d=0,p=new Uint8Array(2*r);w.forEach(function(t,e){if(t){var r=t.positions,n=t.count,i=t.color;if(t.offset=d,n){var a=new Float64Array(r.length);a.set(r),f(a,2,t.bounds),t.close?r[0]===r[2*n-2]&&r[1]===r[2*n-1]?(o[2*d+0]=a[2*n-4],o[2*d+1]=a[2*n-3]):(o[2*d+0]=a[2*n-2],o[2*d+1]=a[2*n-1]):(o[2*d+0]=a[0],o[2*d+1]=a[1]),p[4*d+0]=i[0],p[4*d+1]=i[1],p[4*d+2]=i[2],p[4*d+3]=i[3],o.set(a,2*d+2),p.set(i,4*d+4),t.close?r[0]===r[2*n-2]&&r[1]===r[2*n-1]?(o[2*d+2*n+2]=a[2],o[2*d+2*n+3]=a[3],d+=n+2,t.count-=1):(o[2*d+2*n+2]=a[0],o[2*d+2*n+3]=a[1],o[2*d+2*n+4]=a[2],o[2*d+2*n+5]=a[3],d+=n+3):(o[2*d+2*n+2]=a[2*n-2],o[2*d+2*n+3]=a[2*n-1],o[2*d+2*n+4]=a[2*n-2],o[2*d+2*n+5]=a[2*n-1],d+=n+3)}}}),m(p),g(function(t){if(t instanceof Float32Array)return t;var e=new Float32Array(t);return e.set(t),e}(o)),y(h(o))}return E}}function P(){w.length=0,m.destroy(),v.destroy(),g.destroy(),b.destroy()}return r=t(a({cull:{enable:!0,face:"back"},vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 aCoord, bCoord, nextCoord, prevCoord;\nattribute vec4 aColor, bColor;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, translate, scaleRatio;\nuniform float thickness, pixelRatio, id;\nuniform vec4 viewport;\nuniform float miterLimit, dashLength, miterMode;\n\nvarying vec4 fragColor;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 tangent;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nconst float MAX_LINES = 256.;\nconst float REVERSE_THRESHOLD = -.875;\nconst float MIN_DIST = 1.;\n\n//TODO: possible optimizations: avoid overcalculating all for vertices and calc just one instead\n//TODO: precalculate dot products, normalize things beforehead etc.\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nbool isNaN( float val ){\n return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true;\n}\n\nvoid main() {\n\tvec2 aCoord = aCoord, bCoord = bCoord, prevCoord = prevCoord, nextCoord = nextCoord;\n\tvec2 normalWidth = thickness / scaleRatio;\n\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineBot = 1. - lineTop;\n\tfloat depth = (MAX_LINES - 1. - id) / MAX_LINES;\n\n\tfragColor = (lineStart * aColor + lineEnd * bColor) / 255.;\n\n\tif (isNaN(aCoord.x) || isNaN(aCoord.y) || isNaN(bCoord.x) || isNaN(bCoord.y)) return;\n\n\tif (aCoord == prevCoord) prevCoord = aCoord + normalize(bCoord - aCoord);\n\tif (bCoord == nextCoord) nextCoord = bCoord - normalize(bCoord - aCoord);\n\n\tvec2 prevDiff = aCoord - prevCoord;\n\tvec2 currDiff = bCoord - aCoord;\n\tvec2 nextDiff = nextCoord - bCoord;\n\n\tvec2 prevDirection = normalize(prevDiff);\n\tvec2 currDirection = normalize(currDiff);\n\tvec2 nextDirection = normalize(nextDiff);\n\n\tvec2 prevTangent = normalize(prevDiff * scaleRatio);\n\tvec2 currTangent = normalize(currDiff * scaleRatio);\n\tvec2 nextTangent = normalize(nextDiff * scaleRatio);\n\n\tvec2 prevNormal = vec2(-prevTangent.y, prevTangent.x);\n\tvec2 currNormal = vec2(-currTangent.y, currTangent.x);\n\tvec2 nextNormal = vec2(-nextTangent.y, nextTangent.x);\n\n\tvec2 startJoinDirection = normalize(prevTangent - currTangent);\n\tvec2 endJoinDirection = normalize(currTangent - nextTangent);\n\n\t//collapsed/unidirectional segment cases\n\tif (prevDirection == currDirection) {\n\t\tstartJoinDirection = currNormal;\n\t}\n\tif (nextDirection == currDirection) {\n\t\tendJoinDirection = currNormal;\n\t}\n\tif (aCoord == bCoord) {\n\t\tendJoinDirection = startJoinDirection;\n\t\tcurrNormal = prevNormal;\n\t\tcurrTangent = prevTangent;\n\t}\n\n\ttangent = currTangent;\n\n\t//calculate join shifts relative to normals\n\tfloat startJoinShift = dot(currNormal, startJoinDirection);\n\tfloat endJoinShift = dot(currNormal, endJoinDirection);\n\n\tfloat startMiterRatio = abs(1. / startJoinShift);\n\tfloat endMiterRatio = abs(1. / endJoinShift);\n\n\tvec2 startJoin = startJoinDirection * startMiterRatio;\n\tvec2 endJoin = endJoinDirection * endMiterRatio;\n\n\tvec2 startTopJoin, startBotJoin, endTopJoin, endBotJoin;\n\tstartTopJoin = sign(startJoinShift) * startJoin * .5;\n\tstartBotJoin = -startTopJoin;\n\n\tendTopJoin = sign(endJoinShift) * endJoin * .5;\n\tendBotJoin = -endTopJoin;\n\n\tvec2 aTopCoord = aCoord + normalWidth * startTopJoin;\n\tvec2 bTopCoord = bCoord + normalWidth * endTopJoin;\n\tvec2 aBotCoord = aCoord + normalWidth * startBotJoin;\n\tvec2 bBotCoord = bCoord + normalWidth * endBotJoin;\n\n\t//miter anti-clipping\n\tfloat baClipping = distToLine(bCoord, aCoord, aBotCoord) / dot(normalize(normalWidth * endBotJoin), normalize(normalWidth.yx * vec2(-startBotJoin.y, startBotJoin.x)));\n\tfloat abClipping = distToLine(aCoord, bCoord, bTopCoord) / dot(normalize(normalWidth * startBotJoin), normalize(normalWidth.yx * vec2(-endBotJoin.y, endBotJoin.x)));\n\n\t//prevent close to reverse direction switch\n\tbool prevReverse = dot(currTangent, prevTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, prevNormal)) * min(length(prevDiff), length(currDiff)) < length(normalWidth * currNormal);\n\tbool nextReverse = dot(currTangent, nextTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, nextNormal)) * min(length(nextDiff), length(currDiff)) < length(normalWidth * currNormal);\n\n\tif (prevReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * startJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / startMiterRatio, 1.);\n\t\taBotCoord = aCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\taTopCoord = aCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!nextReverse && baClipping > 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * scale + translate;\n\tvec2 aBotPosition = (aBotCoord) * scale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * scale + translate;\n\tvec2 bBotPosition = (bBotCoord) * scale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D dashPattern;\nuniform vec2 dashShape;\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashPattern, vec2(t * dashLength * 2. / dashShape.x, (id + .5) / dashShape.y)).r;\n\n\tgl_FragColor = fragColor * dash;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:v,divisor:0,stride:8,offset:0},lineTop:{buffer:v,divisor:0,stride:8,offset:4},aColor:{buffer:m,stride:4,offset:function(t,e){return 4*e.offset},divisor:1},bColor:{buffer:m,stride:4,offset:function(t,e){return 4*e.offset+4},divisor:1},prevCoord:{buffer:g,stride:8,offset:function(t,e){return 8*e.offset},divisor:1},aCoord:{buffer:g,stride:8,offset:function(t,e){return 8+8*e.offset},divisor:1},bCoord:{buffer:g,stride:8,offset:function(t,e){return 16+8*e.offset},divisor:1},nextCoord:{buffer:g,stride:8,offset:function(t,e){return 24+8*e.offset},divisor:1}}},T)),d=t(a({vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 aCoord, bCoord, aCoordFract, bCoordFract;\nattribute vec4 color;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, scaleFract, translate, translateFract, scaleRatio;\nuniform float thickness, pixelRatio, id;\nuniform vec4 viewport;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nconst float MAX_LINES = 256.;\n\nvec2 project(vec2 position, vec2 positionFract, vec2 scale, vec2 scaleFract, vec2 translate, vec2 translateFract) {\n\t// the order is important\n\treturn position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n}\n\nvoid main() {\n\t// vec2 scaleRatio = scale * viewport.zw;\n\tvec2 normalWidth = thickness / scaleRatio;\n\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineOffset = lineTop * 2. - 1.;\n\tfloat depth = (MAX_LINES - 1. - id) / (MAX_LINES);\n\n\tvec2 diff = (bCoord + bCoordFract - aCoord - aCoordFract);\n\ttangent = normalize(diff * scaleRatio);\n\tvec2 normal = vec2(-tangent.y, tangent.x);\n\n\tvec2 position = project(aCoord, aCoordFract, scale, scaleFract, translate, translateFract) * lineStart\n\t\t+ project(bCoord, bCoordFract, scale, scaleFract, translate, translateFract) * lineEnd\n\n\t\t+ thickness * normal * .5 * lineOffset / viewport.zw;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D dashPattern;\nuniform vec2 dashShape;\nuniform float dashLength, pixelRatio, thickness, opacity, id;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvoid main() {\n\tfloat alpha = 1.;\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashPattern, vec2(t * dashLength * 2. / dashShape.x, (id + .5) / dashShape.y)).r;\n\n\tgl_FragColor = fragColor * dash;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:v,divisor:0,stride:8,offset:0},lineTop:{buffer:v,divisor:0,stride:8,offset:4},aCoord:{buffer:g,stride:8,offset:function(t,e){return 8+8*e.offset},divisor:1},bCoord:{buffer:g,stride:8,offset:function(t,e){return 16+8*e.offset},divisor:1},aCoordFract:{buffer:y,stride:8,offset:function(t,e){return 8+8*e.offset},divisor:1},bCoordFract:{buffer:y,stride:8,offset:function(t,e){return 16+8*e.offset},divisor:1},color:{buffer:m,stride:4,offset:function(t,e){return 4*e.offset},divisor:1}}},T)),p=t({primitive:"triangle",elements:function(t,e){return e.triangles},offset:0,vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract, scaleRatio;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= opacity;\n}\n"]),uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{position:{buffer:g,stride:8,offset:function(t,e){return 8+8*e.offset}},positionFract:{buffer:y,stride:8,offset:function(t,e){return 8+8*e.offset}}},blend:T.blend,depth:{enable:!1},scissor:T.scissor,stencil:T.stencil,viewport:T.viewport}),a(E,{update:C,draw:S,destroy:P,regl:t,gl:x,canvas:x.canvas,lines:w}),E};function h(t){var e=new Float32Array(t.length);e.set(t);for(var r=0,n=e.length;r<n;r++)e[r]=t[r]-e[r];return e}},{"array-bounds":48,"array-normalize":49,"color-normalize":99,earcut:135,"flatten-vertex-data":143,glslify:253,"object-assign":443,"pick-by-alias":454,"update-diff":538}],483:[function(t,e,r){"use strict";var n=t("color-normalize"),i=t("array-bounds"),a=t("color-id"),o=t("snap-points-2d"),s=t("object-assign"),l=t("glslify"),c=t("binary-search-bounds"),u=t("pick-by-alias"),f=t("update-diff"),h=t("flatten-vertex-data"),d=t("is-iexplorer"),p=t("to-float32"),m=p.float32,v=p.fract32,g=t("array-range");e.exports=function(t,e){"function"==typeof t?(e||(e={}),e.regl=t):(e=t,t=null);e&&e.length&&(e.positions=e);var r,p,y,b,x,_,w,M=(t=e.regl)._gl,k=[],A={},T={color:"black",borderColor:"transparent",borderSize:1,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,offset:0,count:0,bounds:null,positions:[],snap:1e4},E=[],S=[null],L=[null],C=4096,P=100;w=t.texture({data:new Uint8Array(4*C),width:C,height:1,type:"uint8",format:"rgba",wrapS:"clamp",wrapT:"clamp",mag:"nearest",min:"nearest"}),y=t.buffer({usage:"dynamic",type:"float",data:null}),_=t.buffer({usage:"dynamic",type:"uint16",data:null}),b=t.buffer({usage:"dynamic",type:"float",data:null}),x=t.buffer({usage:"dynamic",type:"float",data:null}),e.clone?(E=e.clone.groups.map(function(e){return(e=s({},e)).markerIds&&(e.markerIds=e.markerIds.map(function(e){var r=e.slice();return r.lod=e.lod,r.snap=e.snap,r.data=e.data,r.id=e.id,r.x=e.x,r.w=e.w,r.elements=t.elements({primitive:"points",type:"uint32",data:e.data}),r})),e}),e.clone.markers.forEach(function(t){U(t)}),q(e.clone.palette),B({point:!0,color:!0,size:!0})):j(e);var z={uniforms:{pixelRatio:t.context("pixelRatio"),palette:w,scale:t.prop("scale"),scaleFract:t.prop("scaleFract"),translate:t.prop("translate"),translateFract:t.prop("translateFract"),opacity:t.prop("opacity"),marker:t.prop("marker")},attributes:{position:b,positionFract:x,size:function(t,e){return e.size.length?{buffer:y,stride:2,offset:0}:{constant:[Math.round(255*e.size/P)]}},borderSize:function(t,e){return e.borderSize.length?{buffer:y,stride:2,offset:1}:{constant:[Math.round(255*e.borderSize/P)]}},colorId:function(t,e){return e.color.length?{buffer:_,stride:4,offset:0}:{constant:[e.color]}},borderColorId:function(t,e){return e.borderColor.length?{buffer:_,stride:4,offset:2}:{constant:[e.borderColor]}}},blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport"),stencil:{enable:!1},depth:{enable:!1},elements:t.prop("elements"),count:t.prop("count"),offset:t.prop("offset"),primitive:"points"};if(d)p=t(s({},z,{frag:l(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color, borderColor;\nuniform float opacity;\nvarying float fragBorderRadius, fragWidth, fragBorderSize, fragSize;\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\n float centerFraction = fragBorderSize == 0. ? 2. : fragSize / (fragSize + fragBorderSize + 1.25);\n\n vec4 baseColor = mix(borderColor, color, smoothStep(radius, centerFraction));\n float alpha = 1.0 - pow(1.0 - baseColor.a, 1.);\n gl_FragColor = vec4(baseColor.rgb * alpha, alpha);\n}\n"]),vert:l(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\nattribute float size, borderSize;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform sampler2D palette;\n\nconst float paletteSize = 4096., maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth, fragBorderSize, fragSize;\n\nvoid main() {\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n fragBorderSize = borderSize;\n fragSize = size;\n\n gl_PointSize = (size + borderSize) * pixelRatio;\n\n vec2 pos = (position + translate) * scale\n\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t+ (position + translate) * scaleFract\n\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0, 1);\n\n fragBorderRadius = borderSize == 0. ? 2. : 1. - 2. * borderSize / (size + borderSize);\n fragWidth = 1. / gl_PointSize;\n}\n"]),uniforms:{color:function(t,e){var r=e.color.length?e.color[0]:e.color;return k.slice(4*r,4*r+4).map(function(t){return t/255})},borderColor:function(t,e){var r=e.borderColor.length?e.borderColor[0]:e.borderColor;return k.slice(4*r,4*r+4).map(function(t){return t/255})},pixelRatio:t.context("pixelRatio"),palette:w,scale:t.prop("scale"),scaleFract:t.prop("scaleFract"),translate:t.prop("translate"),translateFract:t.prop("translateFract"),opacity:t.prop("opacity"),marker:t.prop("marker")},attributes:{position:b,positionFract:x,size:z.attributes.size,borderSize:z.attributes.borderSize}}));else{var O=s({},z);O.frag=l(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragWidth, fragBorderColorLevel, fragColorLevel;\n\nuniform sampler2D marker;\nuniform float pixelRatio, opacity;\n\nfloat smoothStep(float x, float y) {\n return 1.0 / (1.0 + exp(50.0*(x - y)));\n}\n\nvoid main() {\n float dist = texture2D(marker, gl_PointCoord).r, delta = fragWidth;\n\n //max-distance alpha\n if (dist < 0.003) discard;\n\n //null-border case\n if (fragBorderColorLevel == fragColorLevel || fragBorderColor.a == 0.) {\n float colorAmt = smoothstep(.5 - delta, .5 + delta, dist);\n gl_FragColor = vec4(fragColor.rgb, colorAmt * fragColor.a);\n return;\n }\n\n float borderColorAmt = smoothstep(fragBorderColorLevel - delta, fragBorderColorLevel + delta, dist);\n float colorAmt = smoothstep(fragColorLevel - delta, fragColorLevel + delta, dist);\n\n vec4 color = fragBorderColor;\n color.a *= borderColorAmt;\n color = mix(color, fragColor, colorAmt);\n color.a *= opacity;\n\n gl_FragColor = color;\n}\n"]),O.vert=l(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\nattribute float size, borderSize;\nattribute float colorId, borderColorId;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform sampler2D palette;\n\nconst float paletteSize = 4096., maxSize = 100.;\nconst float borderLevel = .5;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragPointSize, fragBorderRadius,\n\t\tfragWidth, fragBorderColorLevel, fragColorLevel;\n\nvoid main() {\n vec4 color = texture2D(palette, vec2((colorId + .5) / paletteSize, 0));\n vec4 borderColor = texture2D(palette, vec2((borderColorId + .5) / paletteSize, 0));\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = 2. * size * pixelRatio;\n fragPointSize = size * pixelRatio;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0, 1);\n\n fragColor = color;\n fragBorderColor = borderColor;\n fragWidth = 1. / gl_PointSize;\n\n fragBorderColorLevel = clamp(borderLevel - borderLevel * borderSize / size, 0., 1.);\n fragColorLevel = clamp(borderLevel + (1. - borderLevel) * borderSize / size, 0., 1.);\n}\n"]),r=t(O);var D=s({},z);D.frag=l(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor, fragBorderColor;\n\nuniform float opacity;\nvarying float fragBorderRadius, fragWidth;\n\nvoid main() {\n\tfloat radius, alpha = 1.0, delta = fragWidth;\n\n\tradius = length(2.0 * gl_PointCoord.xy - 1.0);\n\n\tif(radius > 1.0 + delta) {\n\t\tdiscard;\n\t\treturn;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),D.vert=l(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\nattribute float size, borderSize;\nattribute float colorId, borderColorId;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform sampler2D palette;\n\nconst float paletteSize = 4096., maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nvoid main() {\n vec4 color = texture2D(palette, vec2((colorId + .5) / paletteSize, 0));\n vec4 borderColor = texture2D(palette, vec2((borderColorId + .5) / paletteSize, 0));\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pixelRatio;\n\n vec2 pos = (position + translate) * scale\n\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t+ (position + translate) * scaleFract\n\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0, 1);\n\n fragBorderRadius = borderSize == 0. ? 2. : 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),p=t(D)}function I(t){t?j(t):null===t&&H(),R()}function R(t){if("number"==typeof t)return N(t);Array.isArray(t)?t.forEach(function(t,e){if(null!=t)return t.length?N(t,e):N(t)}):E.forEach(function(t,e){t&&N(e)})}function N(e,n){var i;if("number"==typeof e&&(e=E[e]),Array.isArray(e)&&(i=e,e=E[n]),e&&e.count&&e.opacity){var a;if(i){a=Array(e.count);for(var o=0;o<i.length;o++)a[i[o]]=!0}if(e.markerIds[0]){t._refresh();var s=F(e.markerIds[0],e,a);p(s)}for(var l=[],c=1;c<e.markerIds.length;c++){var u=e.markerIds[c];u&&u.length&&[].push.apply(l,F(u,e,a))}l.length&&(t._refresh(),r(l))}}function F(t,e,r){var n=e.range,i=e.offset;if(!t.snap){var a=r?x(t.data,r):t.elements;return[s({},e,{elements:a,offset:0,count:r?a.length:t.length,marker:S[t.id]})]}for(var o=[],l=t.lod,u=t.x,f=t.id,h=(n[2]-n[0])/e.viewport.width,d=l.length;d--;){var p=l[d];if(!(p.pixelSize&&p.pixelSize<h&&d>1)){var m=p.offset,v=p.count+m,g=c.ge(u,n[0],m,v-1),y=c.lt(u,n[2],g,v-1)+1;if(!(y<=g))if(r){var b=x(t.data.subarray(g,y),r);o.push(s({},e,{elements:b,marker:S[f],offset:0,count:b.length}))}else o.push(s({},e,{elements:t.elements,marker:S[f],offset:g,count:y-g}))}}function x(t,e){for(var r=[],n=0,a=t.length;n<a;n++){var o=t[n],s=o-i;e[s]&&r.push(o)}return r}return o}function j(e){if(e){null!=e.length?"number"==typeof e[0]&&(e=[{positions:e}]):Array.isArray(e)||(e=[e]);var r=0,n=0,a=0;I.groups=E=e.map(function(e,l){var c=E[l];return e?("function"==typeof e?e={after:e}:"number"==typeof e[0]&&(e={positions:e}),e=u(e,{positions:"positions data points",snap:"snap cluster",size:"sizes size radius",borderSize:"borderSizes borderSize stroke-width strokeWidth outline",color:"colors color fill fill-color fillColor",borderColor:"borderColors borderColor stroke stroke-color strokeColor",palette:"palette swatch",marker:"markers marker shape",range:"range dataBox",viewport:"viewport viewBox",opacity:"opacity alpha"}),c||(E[l]=c={id:l,scale:null,translate:null,scaleFract:null,translateFract:null,markerIds:[]},e=s({},T,e)),!e.positions||"marker"in e||(e.marker=c.marker,delete c.marker),!e.marker||"positions"in e||(e.positions=c.positions,delete c.positions),f(c,e,[{snap:!0,size:function(t){return n+=t.length?1:0,t},borderSize:function(t){return n+=t.length?1:0,t},opacity:parseFloat,color:function(t){return t=V(t),a++,t},borderColor:function(t){return t=V(t),a++,t},positions:function(t,e,n){t=h(t,"float64");var a=e.count=Math.floor(t.length/2),o=e.bounds=a?i(t,2):null;return n.range||e.range||(delete e.range,n.range=o),e.offset=r,r+=a,n.marker||e.marker||(delete e.marker,n.marker=null),t}},{marker:function(t,e,r){if(e.markerIds.length=0,t&&"number"!=typeof t[0])for(var n=0,i=t.length;n<i;n++){var a=U(t[n]);e.markerIds[a]||(e.markerIds[a]=[]),e.markerIds[a].push(n)}else{var o=U(t),s=g(e.count);e.markerIds[o]=s}return t}},{positions:function(e,r){for(var n=r.markerIds,i=r.snap,a=r.bounds,s=r.offset,l=0;l<n.length;l++){var c=n[l];if(c&&c.length){var u=c.length,f=void 0;if(c.id=l,i&&(!0===i||u>i)){c.snap=!0;var h=c.x=Array(u),d=c.w=Array(u),p=void 0;if(n.length>1){p=Array(2*u);for(var m=0;m<u;m++){var v=c[m];p[2*m]=e[2*v],p[2*m+1]=e[2*v+1]}}else(p=new Float64Array(e.length)).set(e);var g=new Uint32Array(u);c.lod=o(p,g,d,a),f=new Uint32Array(u);for(var y=0;y<u;y++){var b=g[y],x=c[b];f[y]=x+s,h[y]=e[2*x]}}else{f=new Uint32Array(u);for(var _=0;_<u;_++)f[_]=c[_]+s}c.data=f,c.elements=t.elements({primitive:"points",type:"uint32",data:f})}}},range:function(t,e,r){var n=e.bounds;if(n)return t||(t=n),e.scale=[1/(t[2]-t[0]),1/(t[3]-t[1])],e.translate=[-t[0],-t[1]],e.scaleFract=v(e.scale),e.translateFract=v(e.translate),t},viewport:function(t){var e;return Array.isArray(t)?e={x:t[0],y:t[1],width:t[2]-t[0],height:t[3]-t[1]}:t?(e={x:t.x||t.left||0,y:t.y||t.top||0},t.right?e.width=t.right-e.x:e.width=t.w||t.width||0,t.bottom?e.height=t.bottom-e.y:e.height=t.h||t.height||0):e={x:0,y:0,width:M.drawingBufferWidth,height:M.drawingBufferHeight},e}}]),c):c}),B({point:r,size:n,color:a})}}function B(t){var e=t.point,r=t.size,n=t.color,i=E.reduce(function(t,e,r){return t+(e?e.count:0)},0);if(e){var a=new Float32Array(2*i),o=new Float32Array(2*i);E.forEach(function(t,e){if(t){var r=t.positions,n=t.count,i=t.offset;n&&(a.set(m(r),2*i),o.set(v(r),2*i))}}),b(a),x(o)}if(r){var s=new Uint8Array(2*i);E.forEach(function(t,e){if(t){var r=t.count,n=t.offset,i=t.size,a=t.borderSize;if(r&&(i.length||a.length)){for(var o=new Uint8Array(2*r),l=0;l<r;l++)o[2*l]=Math.round(255*(null==i[l]?i:i[l])/P),o[2*l+1]=Math.round(255*(null==a[l]?a:a[l])/P);s.set(o,2*n)}}}),y(s)}if(n){var l=new Uint16Array(2*i);E.forEach(function(t,e){if(t){var r=t.count,n=t.offset,i=t.color,a=t.borderColor;if(r&&(i.length||a.length)){for(var o=new Uint16Array(2*r),s=0;s<r;s++)o[2*s]=null==i[s]?i:i[s],o[2*s+1]=null==a[s]?a:a[s];l.set(o,2*n)}}}),_(l)}}function U(e){var r,n=null==e?0:L.indexOf(e);if(n>=0)return n;if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)r=e;else{r=new Uint8Array(e.length);for(var i=0,a=e.length;i<a;i++)r[i]=255*e[i]}var o=Math.floor(Math.sqrt(r.length));return n=S.length,L.push(e),S.push(t.texture({channels:1,data:r,radius:o,mag:"linear",min:"linear"})),n}function V(t){Array.isArray(t)||(t=[t]);for(var e=k.length,r=[],i=0;i<t.length;i++){var o=t[i];if("number"!=typeof o){o=n(o,"uint8");var s=a(o,!1);if(null==A[s]){var l=k.length;A[s]=Math.floor(l/4),k[l]=o[0],k[l+1]=o[1],k[l+2]=o[2],k[l+3]=o[3]}r[i]=Math.min(A[s],C-1)}else r[i]=o}return e<4*C&&q(k),1===r.length?r[0]:r}function q(t){t.length>4*C&&(t=t.slice(0,4*C)),w.subimage({width:Math.min(.25*t.length,C),height:1,data:t},0,0)}function H(){E.length=0,y.destroy(),b.destroy(),x.destroy(),_.destroy(),w.destroy()}return s(I,{update:j,draw:R,destroy:H,regl:t,gl:M,canvas:M.canvas,groups:E,markers:L,palette:k}),I}},{"array-bounds":48,"array-range":50,"binary-search-bounds":484,"color-id":97,"color-normalize":99,"flatten-vertex-data":143,glslify:485,"is-iexplorer":264,"object-assign":443,"pick-by-alias":454,"snap-points-2d":514,"to-float32":527,"update-diff":538}],484:[function(t,e,r){arguments[4][90][0].apply(r,arguments)},{dup:90}],485:[function(t,e,r){arguments[4][169][0].apply(r,arguments)},{dup:169}],486:[function(t,e,r){var n,i;n=this,i=function(){function t(t,e){this.id=U++,this.type=t,this.data=e}function e(t){return"["+function t(e){if(0===e.length)return[];var r=e.charAt(0),n=e.charAt(e.length-1);if(1<e.length&&r===n&&('"'===r||"'"===r))return['"'+e.substr(1,e.length-2).replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'];if(r=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(e))return t(e.substr(0,r.index)).concat(t(r[1])).concat(t(e.substr(r.index+r[0].length)));if(1===(r=e.split(".")).length)return['"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'];for(e=[],n=0;n<r.length;++n)e=e.concat(t(r[n]));return e}(t).join("][")+"]"}function r(t){return"string"==typeof t?t.split():t}function n(t){return"string"==typeof t?document.querySelector(t):t}function i(t){var e,i,a,o,s=t||{};t={};var l=[],c=[],u="undefined"==typeof window?1:window.devicePixelRatio,f=!1,h=function(t){},d=function(){};if("string"==typeof s?e=document.querySelector(s):"object"==typeof s&&("string"==typeof s.nodeName&&"function"==typeof s.appendChild&&"function"==typeof s.getBoundingClientRect?e=s:"function"==typeof s.drawArrays||"function"==typeof s.drawElements?a=(o=s).canvas:("gl"in s?o=s.gl:"canvas"in s?a=n(s.canvas):"container"in s&&(i=n(s.container)),"attributes"in s&&(t=s.attributes),"extensions"in s&&(l=r(s.extensions)),"optionalExtensions"in s&&(c=r(s.optionalExtensions)),"onDone"in s&&(h=s.onDone),"profile"in s&&(f=!!s.profile),"pixelRatio"in s&&(u=+s.pixelRatio))),e&&("canvas"===e.nodeName.toLowerCase()?a=e:i=e),!o){if(!a){if(!(e=function(t,e,r){function n(){var e=window.innerWidth,n=window.innerHeight;t!==document.body&&(e=(n=t.getBoundingClientRect()).right-n.left,n=n.bottom-n.top),i.width=r*e,i.height=r*n,B(i.style,{width:e+"px",height:n+"px"})}var i=document.createElement("canvas");return B(i.style,{border:0,margin:0,padding:0,top:0,left:0}),t.appendChild(i),t===document.body&&(i.style.position="absolute",B(t.style,{margin:0,padding:0})),window.addEventListener("resize",n,!1),n(),{canvas:i,onDestroy:function(){window.removeEventListener("resize",n),t.removeChild(i)}}}(i||document.body,0,u)))return null;a=e.canvas,d=e.onDestroy}o=function(t,e){function r(r){try{return t.getContext(r,e)}catch(t){return null}}return r("webgl")||r("experimental-webgl")||r("webgl-experimental")}(a,t)}return o?{gl:o,canvas:a,container:i,extensions:l,optionalExtensions:c,pixelRatio:u,profile:f,onDone:h,onDestroy:d}:(d(),h("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function a(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||G(t.data))}function o(t,e){for(var r=Array(t),n=0;n<t;++n)r[n]=e(n);return r}function s(t){var e,r;return e=(65535<t)<<4,e|=r=(255<(t>>>=e))<<3,(e|=r=(15<(t>>>=r))<<2)|(r=(3<(t>>>=r))<<1)|t>>>r>>1}function l(t){t:{for(var e=16;268435456>=e;e*=16)if(t<=e){t=e;break t}t=0}return 0<(e=W[s(t)>>2]).length?e.pop():new ArrayBuffer(t)}function c(t){W[s(t.byteLength)>>2].push(t)}function u(t,e,r,n,i,a){for(var o=0;o<e;++o)for(var s=t[o],l=0;l<r;++l)for(var c=s[l],u=0;u<n;++u)i[a++]=c[u]}function f(t){return 0|J[Object.prototype.toString.call(t)]}function h(t,e){for(var r=0;r<e.length;++r)t[r]=e[r]}function d(t,e,r,n,i,a,o){for(var s=0,l=0;l<r;++l)for(var c=0;c<n;++c)t[s++]=e[i*l+a*c+o]}function p(t,e,r){function n(e){this.id=l++,this.buffer=t.createBuffer(),this.type=e,this.usage=35044,this.byteLength=0,this.dimension=1,this.dtype=5121,this.persistentData=null,r.profile&&(this.stats={size:0})}function i(e,r,n){e.byteLength=r.byteLength,t.bufferData(e.type,r,n)}function o(t,e,r,n,o,s){if(t.usage=r,Array.isArray(e)){if(t.dtype=n||5126,0<e.length)if(Array.isArray(e[0])){o=tt(e);for(var l=n=1;l<o.length;++l)n*=o[l];t.dimension=n,i(t,e=$(e,o,t.dtype),r),s?t.persistentData=e:X.freeType(e)}else"number"==typeof e[0]?(t.dimension=o,h(o=X.allocType(t.dtype,e.length),e),i(t,o,r),s?t.persistentData=o:X.freeType(o)):G(e[0])&&(t.dimension=e[0].length,t.dtype=n||f(e[0])||5126,i(t,e=$(e,[e.length,e[0].length],t.dtype),r),s?t.persistentData=e:X.freeType(e))}else if(G(e))t.dtype=n||f(e),t.dimension=o,i(t,e,r),s&&(t.persistentData=new Uint8Array(new Uint8Array(e.buffer)));else if(a(e)){o=e.shape;var c=e.stride,u=(l=e.offset,0),p=0,m=0,v=0;1===o.length?(u=o[0],p=1,m=c[0],v=0):2===o.length&&(u=o[0],p=o[1],m=c[0],v=c[1]),t.dtype=n||f(e.data)||5126,t.dimension=p,d(o=X.allocType(t.dtype,u*p),e.data,u,p,m,v,l),i(t,o,r),s?t.persistentData=o:X.freeType(o)}}function s(r){e.bufferCount--,t.deleteBuffer(r.buffer),r.buffer=null,delete c[r.id]}var l=0,c={};n.prototype.bind=function(){t.bindBuffer(this.type,this.buffer)},n.prototype.destroy=function(){s(this)};var u=[];return r.profile&&(e.getTotalBufferSize=function(){var t=0;return Object.keys(c).forEach(function(e){t+=c[e].stats.size}),t}),{create:function(i,l,u,p){function m(e){var n=35044,i=null,s=0,l=0,c=1;return Array.isArray(e)||G(e)||a(e)?i=e:"number"==typeof e?s=0|e:e&&("data"in e&&(i=e.data),"usage"in e&&(n=Q[e.usage]),"type"in e&&(l=K[e.type]),"dimension"in e&&(c=0|e.dimension),"length"in e&&(s=0|e.length)),v.bind(),i?o(v,i,n,l,c,p):(t.bufferData(v.type,s,n),v.dtype=l||5121,v.usage=n,v.dimension=c,v.byteLength=s),r.profile&&(v.stats.size=v.byteLength*et[v.dtype]),m}e.bufferCount++;var v=new n(l);return c[v.id]=v,u||m(i),m._reglType="buffer",m._buffer=v,m.subdata=function(e,r){var n,i=0|(r||0);if(v.bind(),G(e))t.bufferSubData(v.type,i,e);else if(Array.isArray(e)){if(0<e.length)if("number"==typeof e[0]){var o=X.allocType(v.dtype,e.length);h(o,e),t.bufferSubData(v.type,i,o),X.freeType(o)}else(Array.isArray(e[0])||G(e[0]))&&(n=tt(e),o=$(e,n,v.dtype),t.bufferSubData(v.type,i,o),X.freeType(o))}else if(a(e)){n=e.shape;var s=e.stride,l=o=0,c=0,u=0;1===n.length?(o=n[0],l=1,c=s[0],u=0):2===n.length&&(o=n[0],l=n[1],c=s[0],u=s[1]),n=Array.isArray(e.data)?v.dtype:f(e.data),d(n=X.allocType(n,o*l),e.data,o,l,c,u,e.offset),t.bufferSubData(v.type,i,n),X.freeType(n)}return m},r.profile&&(m.stats=v.stats),m.destroy=function(){s(v)},m},createStream:function(t,e){var r=u.pop();return r||(r=new n(t)),r.bind(),o(r,e,35040,0,1,!1),r},destroyStream:function(t){u.push(t)},clear:function(){Y(c).forEach(s),u.forEach(s)},getBuffer:function(t){return t&&t._buffer instanceof n?t._buffer:null},restore:function(){Y(c).forEach(function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)})},_initBuffer:o}}function m(t,e,r,n){function i(t){this.id=c++,l[this.id]=this,this.buffer=t,this.primType=4,this.type=this.vertCount=0}function o(n,i,o,s,l,c,u){if(n.buffer.bind(),i){var f=u;u||G(i)&&(!a(i)||G(i.data))||(f=e.oes_element_index_uint?5125:5123),r._initBuffer(n.buffer,i,o,f,3)}else t.bufferData(34963,c,o),n.buffer.dtype=f||5121,n.buffer.usage=o,n.buffer.dimension=3,n.buffer.byteLength=c;if(f=u,!u){switch(n.buffer.dtype){case 5121:case 5120:f=5121;break;case 5123:case 5122:f=5123;break;case 5125:case 5124:f=5125}n.buffer.dtype=f}n.type=f,0>(i=l)&&(i=n.buffer.byteLength,5123===f?i>>=1:5125===f&&(i>>=2)),n.vertCount=i,i=s,0>s&&(i=4,1===(s=n.buffer.dimension)&&(i=0),2===s&&(i=1),3===s&&(i=4)),n.primType=i}function s(t){n.elementsCount--,delete l[t.id],t.buffer.destroy(),t.buffer=null}var l={},c=0,u={uint8:5121,uint16:5123};e.oes_element_index_uint&&(u.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var f=[];return{create:function(t,e){function l(t){if(t)if("number"==typeof t)c(t),f.primType=4,f.vertCount=0|t,f.type=5121;else{var e=null,r=35044,n=-1,i=-1,s=0,h=0;Array.isArray(t)||G(t)||a(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=Q[t.usage]),"primitive"in t&&(n=rt[t.primitive]),"count"in t&&(i=0|t.count),"type"in t&&(h=u[t.type]),"length"in t?s=0|t.length:(s=i,5123===h||5122===h?s*=2:5125!==h&&5124!==h||(s*=4))),o(f,e,r,n,i,s,h)}else c(),f.primType=4,f.vertCount=0,f.type=5121;return l}var c=r.create(null,34963,!0),f=new i(c._buffer);return n.elementsCount++,l(t),l._reglType="elements",l._elements=f,l.subdata=function(t,e){return c.subdata(t,e),l},l.destroy=function(){s(f)},l},createStream:function(t){var e=f.pop();return e||(e=new i(r.create(null,34963,!0,!1)._buffer)),o(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){f.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){Y(l).forEach(s)}}}function v(t){for(var e=X.allocType(5123,t.length),r=0;r<t.length;++r)if(isNaN(t[r]))e[r]=65535;else if(1/0===t[r])e[r]=31744;else if(-1/0===t[r])e[r]=64512;else{nt[0]=t[r];var n=(a=it[0])>>>31<<15,i=(a<<1>>>24)-127,a=a>>13&1023;e[r]=-24>i?n:-14>i?n+(a+1024>>-14-i):15<i?n+31744:n+(i+15<<10)+a}return e}function g(t){return Array.isArray(t)||G(t)}function y(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function b(t){return!(!Array.isArray(t)||0===t.length||!g(t[0]))}function x(t){return Object.prototype.toString.call(t)}function _(t){if(!t)return!1;var e=x(t);return 0<=lt.indexOf(e)||(y(t)||b(t)||a(t))}function w(t,e){36193===t.type?(t.data=v(e),X.freeType(e)):t.data=e}function M(t,e,r,n,i,a){if(t=void 0!==ut[t]?ut[t]:st[t]*ct[e],a&&(t*=6),i){for(n=0;1<=r;)n+=t*r*r,r/=2;return n}return t*r*n}function k(t,e,r,n,i,o,s){function l(){this.format=this.internalformat=6408,this.type=5121,this.flipY=this.premultiplyAlpha=this.compressed=!1,this.unpackAlignment=1,this.colorSpace=37444,this.channels=this.height=this.width=0}function c(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function u(t,e){if("object"==typeof e&&e){"premultiplyAlpha"in e&&(t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(t.flipY=e.flipY),"alignment"in e&&(t.unpackAlignment=e.alignment),"colorSpace"in e&&(t.colorSpace=V[e.colorSpace]),"type"in e&&(t.type=q[e.type]);var r=t.width,n=t.height,i=t.channels,a=!1;"shape"in e?(r=e.shape[0],n=e.shape[1],3===e.shape.length&&(i=e.shape[2],a=!0)):("radius"in e&&(r=n=e.radius),"width"in e&&(r=e.width),"height"in e&&(n=e.height),"channels"in e&&(i=e.channels,a=!0)),t.width=0|r,t.height=0|n,t.channels=0|i,r=!1,"format"in e&&(r=e.format,n=t.internalformat=H[r],t.format=it[n],r in q&&!("type"in e)&&(t.type=q[r]),r in W&&(t.compressed=!0),r=!0),!a&&r?t.channels=st[t.format]:a&&!r&&t.channels!==ot[t.format]&&(t.format=t.internalformat=ot[t.channels])}}function f(e){t.pixelStorei(37440,e.flipY),t.pixelStorei(37441,e.premultiplyAlpha),t.pixelStorei(37443,e.colorSpace),t.pixelStorei(3317,e.unpackAlignment)}function h(){l.call(this),this.yOffset=this.xOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function d(t,e){var r=null;if(_(e)?r=e:e&&(u(t,e),"x"in e&&(t.xOffset=0|e.x),"y"in e&&(t.yOffset=0|e.y),_(e.data)&&(r=e.data)),e.copy){var n=i.viewportWidth,o=i.viewportHeight;t.width=t.width||n-t.xOffset,t.height=t.height||o-t.yOffset,t.needsCopy=!0}else if(r){if(G(r))t.channels=t.channels||4,t.data=r,"type"in e||5121!==t.type||(t.type=0|J[Object.prototype.toString.call(r)]);else if(y(r)){switch(t.channels=t.channels||4,o=(n=r).length,t.type){case 5121:case 5123:case 5125:case 5126:(o=X.allocType(t.type,o)).set(n),t.data=o;break;case 36193:t.data=v(n)}t.alignment=1,t.needsFree=!0}else if(a(r)){n=r.data,Array.isArray(n)||5121!==t.type||(t.type=0|J[Object.prototype.toString.call(n)]);o=r.shape;var s,l,c,f,h=r.stride;3===o.length?(c=o[2],f=h[2]):f=c=1,s=o[0],l=o[1],o=h[0],h=h[1],t.alignment=1,t.width=s,t.height=l,t.channels=c,t.format=t.internalformat=ot[c],t.needsFree=!0,s=f,r=r.offset,c=t.width,f=t.height,l=t.channels;for(var d=X.allocType(36193===t.type?5126:t.type,c*f*l),p=0,m=0;m<f;++m)for(var M=0;M<c;++M)for(var k=0;k<l;++k)d[p++]=n[o*M+h*m+s*k+r];w(t,d)}else if("[object HTMLCanvasElement]"===x(r)||"[object CanvasRenderingContext2D]"===x(r))"[object HTMLCanvasElement]"===x(r)?t.element=r:t.element=r.canvas,t.width=t.element.width,t.height=t.element.height,t.channels=4;else if("[object HTMLImageElement]"===x(r))t.element=r,t.width=r.naturalWidth,t.height=r.naturalHeight,t.channels=4;else if("[object HTMLVideoElement]"===x(r))t.element=r,t.width=r.videoWidth,t.height=r.videoHeight,t.channels=4;else if(b(r)){for(n=t.width||r[0].length,o=t.height||r.length,h=t.channels,h=g(r[0][0])?h||r[0][0].length:h||1,s=Z.shape(r),c=1,f=0;f<s.length;++f)c*=s[f];c=X.allocType(36193===t.type?5126:t.type,c),Z.flatten(r,s,"",c),w(t,c),t.alignment=1,t.width=n,t.height=o,t.channels=h,t.format=t.internalformat=ot[h],t.needsFree=!0}}else t.width=t.width||1,t.height=t.height||1,t.channels=t.channels||4}function p(e,r,i,a,o){var s=e.element,l=e.data,c=e.internalformat,u=e.format,h=e.type,d=e.width,p=e.height;f(e),s?t.texSubImage2D(r,o,i,a,u,h,s):e.compressed?t.compressedTexSubImage2D(r,o,i,a,c,d,p,l):e.needsCopy?(n(),t.copyTexSubImage2D(r,o,i,a,e.xOffset,e.yOffset,d,p)):t.texSubImage2D(r,o,i,a,d,p,u,h,l)}function m(){return lt.pop()||new h}function k(t){t.needsFree&&X.freeType(t.data),h.call(t),lt.push(t)}function A(t,e,r){var n=t.images[0]=m();t.mipmask=1,n.width=t.width=e,n.height=t.height=r,n.channels=t.channels=4}function T(t,e){var r=null;if(_(e))c(r=t.images[0]=m(),t),d(r,e),t.mipmask=1;else if(u(t,e),Array.isArray(e.mipmap))for(var n=e.mipmap,i=0;i<n.length;++i)c(r=t.images[i]=m(),t),r.width>>=i,r.height>>=i,d(r,n[i]),t.mipmask|=1<<i;else c(r=t.images[0]=m(),t),d(r,e),t.mipmask=1;c(t,t.images[0])}function E(e,r){for(var i=e.images,a=0;a<i.length&&i[a];++a){var o=i[a],s=r,l=a,c=o.element,u=o.data,h=o.internalformat,d=o.format,p=o.type,m=o.width,v=o.height;f(o),c?t.texImage2D(s,l,d,d,p,c):o.compressed?t.compressedTexImage2D(s,l,h,m,v,0,u):o.needsCopy?(n(),t.copyTexImage2D(s,l,d,o.xOffset,o.yOffset,m,v,0)):t.texImage2D(s,l,d,m,v,0,d,p,u)}}function S(){var t=ct.pop()||new function(){l.call(this),this.genMipmaps=!1,this.mipmapHint=4352,this.mipmask=0,this.images=Array(16)};l.call(t);for(var e=t.mipmask=0;16>e;++e)t.images[e]=null;return t}function L(t){for(var e=t.images,r=0;r<e.length;++r)e[r]&&k(e[r]),e[r]=null;ct.push(t)}function C(){this.magFilter=this.minFilter=9728,this.wrapT=this.wrapS=33071,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=4352}function P(t,e){"min"in e&&(t.minFilter=U[e.min],0<=at.indexOf(t.minFilter)&&(t.genMipmaps=!0)),"mag"in e&&(t.magFilter=j[e.mag]);var r=t.wrapS,n=t.wrapT;if("wrap"in e){var i=e.wrap;"string"==typeof i?r=n=F[i]:Array.isArray(i)&&(r=F[i[0]],n=F[i[1]])}else"wrapS"in e&&(r=F[e.wrapS]),"wrapT"in e&&(n=F[e.wrapT]);if(t.wrapS=r,t.wrapT=n,"anisotropic"in e&&(t.anisotropic=e.anisotropic),"mipmap"in e){switch(r=!1,typeof e.mipmap){case"string":t.mipmapHint=N[e.mipmap],r=t.genMipmaps=!0;break;case"boolean":r=t.genMipmaps=e.mipmap;break;case"object":t.genMipmaps=!1,r=!0}!r||"min"in e||(t.minFilter=9984)}}function z(r,n){t.texParameteri(n,10241,r.minFilter),t.texParameteri(n,10240,r.magFilter),t.texParameteri(n,10242,r.wrapS),t.texParameteri(n,10243,r.wrapT),e.ext_texture_filter_anisotropic&&t.texParameteri(n,34046,r.anisotropic),r.genMipmaps&&(t.hint(33170,r.mipmapHint),t.generateMipmap(n))}function O(e){l.call(this),this.mipmask=0,this.internalformat=6408,this.id=ut++,this.refCount=1,this.target=e,this.texture=t.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new C,s.profile&&(this.stats={size:0})}function D(e){t.activeTexture(33984),t.bindTexture(e.target,e.texture)}function I(){var e=dt[0];e?t.bindTexture(e.target,e.texture):t.bindTexture(3553,null)}function R(e){var r=e.texture,n=e.unit,i=e.target;0<=n&&(t.activeTexture(33984+n),t.bindTexture(i,null),dt[n]=null),t.deleteTexture(r),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete ft[e.id],o.textureCount--}var N={"don't care":4352,"dont care":4352,nice:4354,fast:4353},F={repeat:10497,clamp:33071,mirror:33648},j={nearest:9728,linear:9729},U=B({mipmap:9987,"nearest mipmap nearest":9984,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":9987},j),V={none:0,browser:37444},q={uint8:5121,rgba4:32819,rgb565:33635,"rgb5 a1":32820},H={alpha:6406,luminance:6409,"luminance alpha":6410,rgb:6407,rgba:6408,rgba4:32854,"rgb5 a1":32855,rgb565:36194},W={};e.ext_srgb&&(H.srgb=35904,H.srgba=35906),e.oes_texture_float&&(q.float32=q.float=5126),e.oes_texture_half_float&&(q.float16=q["half float"]=36193),e.webgl_depth_texture&&(B(H,{depth:6402,"depth stencil":34041}),B(q,{uint16:5123,uint32:5125,"depth stencil":34042})),e.webgl_compressed_texture_s3tc&&B(W,{"rgb s3tc dxt1":33776,"rgba s3tc dxt1":33777,"rgba s3tc dxt3":33778,"rgba s3tc dxt5":33779}),e.webgl_compressed_texture_atc&&B(W,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),e.webgl_compressed_texture_pvrtc&&B(W,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),e.webgl_compressed_texture_etc1&&(W["rgb etc1"]=36196);var K=Array.prototype.slice.call(t.getParameter(34467));Object.keys(W).forEach(function(t){var e=W[t];0<=K.indexOf(e)&&(H[t]=e)});var Q=Object.keys(H);r.textureFormats=Q;var $=[];Object.keys(H).forEach(function(t){$[H[t]]=t});var tt=[];Object.keys(q).forEach(function(t){tt[q[t]]=t});var et=[];Object.keys(j).forEach(function(t){et[j[t]]=t});var rt=[];Object.keys(U).forEach(function(t){rt[U[t]]=t});var nt=[];Object.keys(F).forEach(function(t){nt[F[t]]=t});var it=Q.reduce(function(t,e){var r=H[e];return 6409===r||6406===r||6409===r||6410===r||6402===r||34041===r?t[r]=r:32855===r||0<=e.indexOf("rgba")?t[r]=6408:t[r]=6407,t},{}),lt=[],ct=[],ut=0,ft={},ht=r.maxTextureUnits,dt=Array(ht).map(function(){return null});return B(O.prototype,{bind:function(){this.bindCount+=1;var e=this.unit;if(0>e){for(var r=0;r<ht;++r){var n=dt[r];if(n){if(0<n.bindCount)continue;n.unit=-1}dt[r]=this,e=r;break}s.profile&&o.maxTextureUnits<e+1&&(o.maxTextureUnits=e+1),this.unit=e,t.activeTexture(33984+e),t.bindTexture(this.target,this.texture)}return e},unbind:function(){--this.bindCount},decRef:function(){0>=--this.refCount&&R(this)}}),s.profile&&(o.getTotalTextureSize=function(){var t=0;return Object.keys(ft).forEach(function(e){t+=ft[e].stats.size}),t}),{create2D:function(e,r){function n(t,e){var r=i.texInfo;C.call(r);var a=S();return"number"==typeof t?A(a,0|t,"number"==typeof e?0|e:0|t):t?(P(r,t),T(a,t)):A(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),i.mipmask=a.mipmask,c(i,a),i.internalformat=a.internalformat,n.width=a.width,n.height=a.height,D(i),E(a,3553),z(r,3553),I(),L(a),s.profile&&(i.stats.size=M(i.internalformat,i.type,a.width,a.height,r.genMipmaps,!1)),n.format=$[i.internalformat],n.type=tt[i.type],n.mag=et[r.magFilter],n.min=rt[r.minFilter],n.wrapS=nt[r.wrapS],n.wrapT=nt[r.wrapT],n}var i=new O(3553);return ft[i.id]=i,o.textureCount++,n(e,r),n.subimage=function(t,e,r,a){e|=0,r|=0,a|=0;var o=m();return c(o,i),o.width=0,o.height=0,d(o,t),o.width=o.width||(i.width>>a)-e,o.height=o.height||(i.height>>a)-r,D(i),p(o,3553,e,r,a),I(),k(o),n},n.resize=function(e,r){var a=0|e,o=0|r||a;if(a===i.width&&o===i.height)return n;n.width=i.width=a,n.height=i.height=o,D(i);for(var l=0;i.mipmask>>l;++l)t.texImage2D(3553,l,i.format,a>>l,o>>l,0,i.format,i.type,null);return I(),s.profile&&(i.stats.size=M(i.internalformat,i.type,a,o,!1,!1)),n},n._reglType="texture2d",n._texture=i,s.profile&&(n.stats=i.stats),n.destroy=function(){i.decRef()},n},createCube:function(e,r,n,i,a,l){function f(t,e,r,n,i,a){var o,l=h.texInfo;for(C.call(l),o=0;6>o;++o)v[o]=S();if("number"!=typeof t&&t){if("object"==typeof t)if(e)T(v[0],t),T(v[1],e),T(v[2],r),T(v[3],n),T(v[4],i),T(v[5],a);else if(P(l,t),u(h,t),"faces"in t)for(t=t.faces,o=0;6>o;++o)c(v[o],h),T(v[o],t[o]);else for(o=0;6>o;++o)T(v[o],t)}else for(t=0|t||1,o=0;6>o;++o)A(v[o],t,t);for(c(h,v[0]),h.mipmask=l.genMipmaps?(v[0].width<<1)-1:v[0].mipmask,h.internalformat=v[0].internalformat,f.width=v[0].width,f.height=v[0].height,D(h),o=0;6>o;++o)E(v[o],34069+o);for(z(l,34067),I(),s.profile&&(h.stats.size=M(h.internalformat,h.type,f.width,f.height,l.genMipmaps,!0)),f.format=$[h.internalformat],f.type=tt[h.type],f.mag=et[l.magFilter],f.min=rt[l.minFilter],f.wrapS=nt[l.wrapS],f.wrapT=nt[l.wrapT],o=0;6>o;++o)L(v[o]);return f}var h=new O(34067);ft[h.id]=h,o.cubeCount++;var v=Array(6);return f(e,r,n,i,a,l),f.subimage=function(t,e,r,n,i){r|=0,n|=0,i|=0;var a=m();return c(a,h),a.width=0,a.height=0,d(a,e),a.width=a.width||(h.width>>i)-r,a.height=a.height||(h.height>>i)-n,D(h),p(a,34069+t,r,n,i),I(),k(a),f},f.resize=function(e){if((e|=0)!==h.width){f.width=h.width=e,f.height=h.height=e,D(h);for(var r=0;6>r;++r)for(var n=0;h.mipmask>>n;++n)t.texImage2D(34069+r,n,h.format,e>>n,e>>n,0,h.format,h.type,null);return I(),s.profile&&(h.stats.size=M(h.internalformat,h.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=h,s.profile&&(f.stats=h.stats),f.destroy=function(){h.decRef()},f},clear:function(){for(var e=0;e<ht;++e)t.activeTexture(33984+e),t.bindTexture(3553,null),dt[e]=null;Y(ft).forEach(R),o.cubeCount=0,o.textureCount=0},getTexture:function(t){return null},restore:function(){Y(ft).forEach(function(e){e.texture=t.createTexture(),t.bindTexture(e.target,e.texture);for(var r=0;32>r;++r)if(0!=(e.mipmask&1<<r))if(3553===e.target)t.texImage2D(3553,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;6>n;++n)t.texImage2D(34069+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);z(e.texInfo,e.target)})}}}function A(t,e,r,n,i,a){function o(t,e,r){this.target=t,this.texture=e,this.renderbuffer=r;var n=t=0;e?(t=e.width,n=e.height):r&&(t=r.width,n=r.height),this.width=t,this.height=n}function s(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function l(t,e,r){t&&(t.texture?t.texture._texture.refCount+=1:t.renderbuffer._renderbuffer.refCount+=1)}function c(e,r){r&&(r.texture?t.framebufferTexture2D(36160,e,r.target,r.texture._texture.texture,0):t.framebufferRenderbuffer(36160,e,36161,r.renderbuffer._renderbuffer.renderbuffer))}function u(t){var e=3553,r=null,n=null,i=t;return"object"==typeof t&&(i=t.data,"target"in t&&(e=0|t.target)),"texture2d"===(t=i._reglType)?r=i:"textureCube"===t?r=i:"renderbuffer"===t&&(n=i,e=36161),new o(e,r,n)}function f(t,e,r,a,s){return r?((t=n.create2D({width:t,height:e,format:a,type:s}))._texture.refCount=0,new o(3553,t,null)):((t=i.create({width:t,height:e,format:a}))._renderbuffer.refCount=0,new o(36161,null,t))}function h(t){return t&&(t.texture||t.renderbuffer)}function d(t,e,r){t&&(t.texture?t.texture.resize(e,r):t.renderbuffer&&t.renderbuffer.resize(e,r))}function p(){this.id=M++,k[this.id]=this,this.framebuffer=t.createFramebuffer(),this.height=this.width=0,this.colorAttachments=[],this.depthStencilAttachment=this.stencilAttachment=this.depthAttachment=null}function m(t){t.colorAttachments.forEach(s),s(t.depthAttachment),s(t.stencilAttachment),s(t.depthStencilAttachment)}function v(e){t.deleteFramebuffer(e.framebuffer),e.framebuffer=null,a.framebufferCount--,delete k[e.id]}function g(e){var n;t.bindFramebuffer(36160,e.framebuffer);var i=e.colorAttachments;for(n=0;n<i.length;++n)c(36064+n,i[n]);for(n=i.length;n<r.maxColorAttachments;++n)t.framebufferTexture2D(36160,36064+n,3553,null,0);t.framebufferTexture2D(36160,33306,3553,null,0),t.framebufferTexture2D(36160,36096,3553,null,0),t.framebufferTexture2D(36160,36128,3553,null,0),c(36096,e.depthAttachment),c(36128,e.stencilAttachment),c(33306,e.depthStencilAttachment),t.checkFramebufferStatus(36160),t.bindFramebuffer(36160,b.next),b.cur=b.next,t.getError()}function y(t,e){function r(t,e){var i,a=0,o=0,s=!0,c=!0;i=null;var d=!0,p="rgba",v="uint8",y=1,b=null,w=null,M=null,k=!1;"number"==typeof t?(a=0|t,o=0|e||a):t?("shape"in t?(a=(o=t.shape)[0],o=o[1]):("radius"in t&&(a=o=t.radius),"width"in t&&(a=t.width),"height"in t&&(o=t.height)),("color"in t||"colors"in t)&&(i=t.color||t.colors,Array.isArray(i)),i||("colorCount"in t&&(y=0|t.colorCount),"colorTexture"in t&&(d=!!t.colorTexture,p="rgba4"),"colorType"in t&&(v=t.colorType,!d)&&("half float"===v||"float16"===v?p="rgba16f":"float"!==v&&"float32"!==v||(p="rgba32f")),"colorFormat"in t&&(p=t.colorFormat,0<=x.indexOf(p)?d=!0:0<=_.indexOf(p)&&(d=!1))),("depthTexture"in t||"depthStencilTexture"in t)&&(k=!(!t.depthTexture&&!t.depthStencilTexture)),"depth"in t&&("boolean"==typeof t.depth?s=t.depth:(b=t.depth,c=!1)),"stencil"in t&&("boolean"==typeof t.stencil?c=t.stencil:(w=t.stencil,s=!1)),"depthStencil"in t&&("boolean"==typeof t.depthStencil?s=c=t.depthStencil:(M=t.depthStencil,c=s=!1))):a=o=1;var A=null,T=null,E=null,S=null;if(Array.isArray(i))A=i.map(u);else if(i)A=[u(i)];else for(A=Array(y),i=0;i<y;++i)A[i]=f(a,o,d,p,v);for(a=a||A[0].width,o=o||A[0].height,b?T=u(b):s&&!c&&(T=f(a,o,k,"depth","uint32")),w?E=u(w):c&&!s&&(E=f(a,o,!1,"stencil","uint8")),M?S=u(M):!b&&!w&&c&&s&&(S=f(a,o,k,"depth stencil","depth stencil")),s=null,i=0;i<A.length;++i)l(A[i]),A[i]&&A[i].texture&&(c=dt[A[i].texture._texture.format]*pt[A[i].texture._texture.type],null===s&&(s=c));return l(T),l(E),l(S),m(n),n.width=a,n.height=o,n.colorAttachments=A,n.depthAttachment=T,n.stencilAttachment=E,n.depthStencilAttachment=S,r.color=A.map(h),r.depth=h(T),r.stencil=h(E),r.depthStencil=h(S),r.width=n.width,r.height=n.height,g(n),r}var n=new p;return a.framebufferCount++,r(t,e),B(r,{resize:function(t,e){var i=0|t,a=0|e||i;if(i===n.width&&a===n.height)return r;for(var o=n.colorAttachments,s=0;s<o.length;++s)d(o[s],i,a);return d(n.depthAttachment,i,a),d(n.stencilAttachment,i,a),d(n.depthStencilAttachment,i,a),n.width=r.width=i,n.height=r.height=a,g(n),r},_reglType:"framebuffer",_framebuffer:n,destroy:function(){v(n),m(n)},use:function(t){b.setFBO({framebuffer:r},t)}})}var b={cur:null,next:null,dirty:!1,setFBO:null},x=["rgba"],_=["rgba4","rgb565","rgb5 a1"];e.ext_srgb&&_.push("srgba"),e.ext_color_buffer_half_float&&_.push("rgba16f","rgb16f"),e.webgl_color_buffer_float&&_.push("rgba32f");var w=["uint8"];e.oes_texture_half_float&&w.push("half float","float16"),e.oes_texture_float&&w.push("float","float32");var M=0,k={};return B(b,{getFramebuffer:function(t){return"function"==typeof t&&"framebuffer"===t._reglType&&(t=t._framebuffer)instanceof p?t:null},create:y,createCube:function(t){function e(t){var i,a={color:null},o=0,s=null;i="rgba";var l="uint8",c=1;if("number"==typeof t?o=0|t:t?("shape"in t?o=t.shape[0]:("radius"in t&&(o=0|t.radius),"width"in t?o=0|t.width:"height"in t&&(o=0|t.height)),("color"in t||"colors"in t)&&(s=t.color||t.colors,Array.isArray(s)),s||("colorCount"in t&&(c=0|t.colorCount),"colorType"in t&&(l=t.colorType),"colorFormat"in t&&(i=t.colorFormat)),"depth"in t&&(a.depth=t.depth),"stencil"in t&&(a.stencil=t.stencil),"depthStencil"in t&&(a.depthStencil=t.depthStencil)):o=1,s)if(Array.isArray(s))for(t=[],i=0;i<s.length;++i)t[i]=s[i];else t=[s];else for(t=Array(c),s={radius:o,format:i,type:l},i=0;i<c;++i)t[i]=n.createCube(s);for(a.color=Array(t.length),i=0;i<t.length;++i)c=t[i],o=o||c.width,a.color[i]={target:34069,data:t[i]};for(i=0;6>i;++i){for(c=0;c<t.length;++c)a.color[c].target=34069+i;0<i&&(a.depth=r[0].depth,a.stencil=r[0].stencil,a.depthStencil=r[0].depthStencil),r[i]?r[i](a):r[i]=y(a)}return B(e,{width:o,height:o,color:t})}var r=Array(6);return e(t),B(e,{faces:r,resize:function(t){var n=0|t;if(n===e.width)return e;var i=e.color;for(t=0;t<i.length;++t)i[t].resize(n);for(t=0;6>t;++t)r[t].resize(n);return e.width=e.height=n,e},_reglType:"framebufferCube",destroy:function(){r.forEach(function(t){t.destroy()})}})},clear:function(){Y(k).forEach(v)},restore:function(){Y(k).forEach(function(e){e.framebuffer=t.createFramebuffer(),g(e)})}})}function T(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function E(t,e,r,n){function i(t,e,r,n){this.name=t,this.id=e,this.location=r,this.info=n}function a(t,e){for(var r=0;r<t.length;++r)if(t[r].id===e.id)return void(t[r].location=e.location);t.push(e)}function o(r,n,i){if(!(o=(i=35632===r?c:u)[n])){var a=e.str(n),o=t.createShader(r);t.shaderSource(o,a),t.compileShader(o),i[n]=o}return o}function s(t,e){this.id=d++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],n.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function l(r,s){var l,c;l=o(35632,r.fragId),c=o(35633,r.vertId);var u=r.program=t.createProgram();t.attachShader(u,l),t.attachShader(u,c),t.linkProgram(u);var f=t.getProgramParameter(u,35718);n.profile&&(r.stats.uniformsCount=f);var h=r.uniforms;for(l=0;l<f;++l)if(c=t.getActiveUniform(u,l))if(1<c.size)for(var d=0;d<c.size;++d){var p=c.name.replace("[0]","["+d+"]");a(h,new i(p,e.id(p),t.getUniformLocation(u,p),c))}else a(h,new i(c.name,e.id(c.name),t.getUniformLocation(u,c.name),c));for(f=t.getProgramParameter(u,35721),n.profile&&(r.stats.attributesCount=f),h=r.attributes,l=0;l<f;++l)(c=t.getActiveAttrib(u,l))&&a(h,new i(c.name,e.id(c.name),t.getAttribLocation(u,c.name),c))}var c={},u={},f={},h=[],d=0;return n.profile&&(r.getMaxUniformsCount=function(){var t=0;return h.forEach(function(e){e.stats.uniformsCount>t&&(t=e.stats.uniformsCount)}),t},r.getMaxAttributesCount=function(){var t=0;return h.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var e=t.deleteShader.bind(t);Y(c).forEach(e),c={},Y(u).forEach(e),u={},h.forEach(function(e){t.deleteProgram(e.program)}),h.length=0,f={},r.shaderCount=0},program:function(t,e,n){var i=f[e];i||(i=f[e]={});var a=i[t];return a||(a=new s(e,t),r.shaderCount++,l(a),i[t]=a,h.push(a)),a},restore:function(){c={},u={};for(var t=0;t<h.length;++t)l(h[t])},shader:o,frag:-1,vert:-1}}function S(t,e,r,n,i,a){function o(i){var a;a=null===e.next?5121:e.next.colorAttachments[0].texture._texture.type;var o=0,s=0,l=n.framebufferWidth,c=n.framebufferHeight,u=null;return G(i)?u=i:i&&(o=0|i.x,s=0|i.y,l=0|(i.width||n.framebufferWidth-o),c=0|(i.height||n.framebufferHeight-s),u=i.data||null),r(),i=l*c*4,u||(5121===a?u=new Uint8Array(i):5126===a&&(u=u||new Float32Array(i))),t.pixelStorei(3333,4),t.readPixels(o,s,l,c,6408,a,u),u}return function(t){return t&&"framebuffer"in t?function(t){var r;return e.setFBO({framebuffer:t.framebuffer},function(){r=o(t)}),r}(t):o(t)}}function L(t){return Array.prototype.slice.call(t)}function C(t){return L(t).join("")}function P(){function t(){var t=[],e=[];return B(function(){t.push.apply(t,L(arguments))},{def:function(){var n="v"+r++;return e.push(n),0<arguments.length&&(t.push(n,"="),t.push.apply(t,L(arguments)),t.push(";")),n},toString:function(){return C([0<e.length?"var "+e+";":"",C(t)])}})}function e(){function e(t,e){n(t,e,"=",r.def(t,e),";")}var r=t(),n=t(),i=r.toString,a=n.toString;return B(function(){r.apply(r,L(arguments))},{def:r.def,entry:r,exit:n,save:e,set:function(t,n,i){e(t,n),r(t,n,"=",i,";")},toString:function(){return i()+a()}})}var r=0,n=[],i=[],a=t(),o={};return{global:a,link:function(t){for(var e=0;e<i.length;++e)if(i[e]===t)return n[e];return e="g"+r++,n.push(e),i.push(t),e},block:t,proc:function(t,r){function n(){var t="a"+i.length;return i.push(t),t}var i=[];r=r||0;for(var a=0;a<r;++a)n();var s=(a=e()).toString;return o[t]=B(a,{arg:n,toString:function(){return C(["function(",i.join(),"){",s(),"}"])}})},scope:e,cond:function(){var t=C(arguments),r=e(),n=e(),i=r.toString,a=n.toString;return B(r,{then:function(){return r.apply(r,L(arguments)),this},else:function(){return n.apply(n,L(arguments)),this},toString:function(){var e=a();return e&&(e="else{"+e+"}"),C(["if(",t,"){",i(),"}",e])}})},compile:function(){var t=['"use strict";',a,"return {"];Object.keys(o).forEach(function(e){t.push('"',e,'":',o[e].toString(),",")}),t.push("}");var e=C(t).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");return Function.apply(null,n.concat(e)).apply(null,i)}}}function z(t){return Array.isArray(t)||G(t)||a(t)}function O(t){return t.sort(function(t,e){return"viewport"===t?-1:"viewport"===e?1:t<e?-1:1})}function D(t,e,r,n){this.thisDep=t,this.contextDep=e,this.propDep=r,this.append=n}function I(t){return t&&!(t.thisDep||t.contextDep||t.propDep)}function R(t){return new D(!1,!1,!1,t)}function N(t,e){var r=t.type;return 0===r?new D(!0,1<=(r=t.data.length),2<=r,e):4===r?new D((r=t.data).thisDep,r.contextDep,r.propDep,e):new D(3===r,2===r,1===r,e)}function F(t,e,r,n,i,a,s,l,c,u,f,h,d,p,m){function v(t){return t.replace(".","_")}function y(t,e,r){var n=v(t);nt.push(t),et[n]=tt[n]=!!r,it[n]=e}function b(t,e,r){var n=v(t);nt.push(t),Array.isArray(r)?(tt[n]=r.slice(),et[n]=r.slice()):tt[n]=et[n]=r,at[n]=e}function x(){var t=P(),r=t.link,n=t.global;t.id=lt++,t.batchId="0";var i=r(ot),a=t.shared={props:"a0"};Object.keys(ot).forEach(function(t){a[t]=n.def(i,".",t)});var o=t.next={},s=t.current={};Object.keys(at).forEach(function(t){Array.isArray(tt[t])&&(o[t]=n.def(a.next,".",t),s[t]=n.def(a.current,".",t))});var l=t.constants={};Object.keys(st).forEach(function(t){l[t]=n.def(JSON.stringify(st[t]))}),t.invoke=function(e,n){switch(n.type){case 0:var i=["this",a.context,a.props,t.batchId];return e.def(r(n.data),".call(",i.slice(0,Math.max(n.data.length+1,4)),")");case 1:return e.def(a.props,n.data);case 2:return e.def(a.context,n.data);case 3:return e.def("this",n.data);case 4:return n.data.append(t,e),n.data.ref}},t.attribCache={};var c={};return t.scopeAttrib=function(t){if((t=e.id(t))in c)return c[t];var n=u.scope[t];return n||(n=u.scope[t]=new Z),c[t]=r(n)},t}function _(t,e){var r=t.static,n=t.dynamic;if("framebuffer"in r){var i=r.framebuffer;return i?(i=l.getFramebuffer(i),R(function(t,e){var r=t.link(i),n=t.shared;return e.set(n.framebuffer,".next",r),n=n.context,e.set(n,".framebufferWidth",r+".width"),e.set(n,".framebufferHeight",r+".height"),r})):R(function(t,e){var r=t.shared;return e.set(r.framebuffer,".next","null"),r=r.context,e.set(r,".framebufferWidth",r+".drawingBufferWidth"),e.set(r,".framebufferHeight",r+".drawingBufferHeight"),"null"})}if("framebuffer"in n){var a=n.framebuffer;return N(a,function(t,e){var r=t.invoke(e,a),n=t.shared,i=n.framebuffer;r=e.def(i,".getFramebuffer(",r,")");return e.set(i,".next",r),n=n.context,e.set(n,".framebufferWidth",r+"?"+r+".width:"+n+".drawingBufferWidth"),e.set(n,".framebufferHeight",r+"?"+r+".height:"+n+".drawingBufferHeight"),r})}return null}function w(t){function r(t){if(t in n){var r=e.id(n[t]);return(t=R(function(){return r})).id=r,t}if(t in i){var a=i[t];return N(a,function(t,e){var r=t.invoke(e,a);return e.def(t.shared.strings,".id(",r,")")})}return null}var n=t.static,i=t.dynamic,a=r("frag"),o=r("vert"),s=null;return I(a)&&I(o)?(s=f.program(o.id,a.id),t=R(function(t,e){return t.link(s)})):t=new D(a&&a.thisDep||o&&o.thisDep,a&&a.contextDep||o&&o.contextDep,a&&a.propDep||o&&o.propDep,function(t,e){var r,n,i=t.shared.shader;return r=a?a.append(t,e):e.def(i,".","frag"),n=o?o.append(t,e):e.def(i,".","vert"),e.def(i+".program("+n+","+r+")")}),{frag:a,vert:o,progVar:t,program:s}}function M(t,e){function r(t,e){if(t in n){var r=0|n[t];return R(function(t,n){return e&&(t.OFFSET=r),r})}if(t in i){var a=i[t];return N(a,function(t,r){var n=t.invoke(r,a);return e&&(t.OFFSET=n),n})}return e&&o?R(function(t,e){return t.OFFSET="0",0}):null}var n=t.static,i=t.dynamic,o=function(){if("elements"in n){var t=n.elements;z(t)?t=a.getElements(a.create(t,!0)):t&&(t=a.getElements(t));var e=R(function(e,r){if(t){var n=e.link(t);return e.ELEMENTS=n}return e.ELEMENTS=null});return e.value=t,e}if("elements"in i){var r=i.elements;return N(r,function(t,e){var n=(i=t.shared).isBufferArgs,i=i.elements,a=t.invoke(e,r),o=e.def("null");n=e.def(n,"(",a,")"),a=t.cond(n).then(o,"=",i,".createStream(",a,");").else(o,"=",i,".getElements(",a,");");return e.entry(a),e.exit(t.cond(n).then(i,".destroyStream(",o,");")),t.ELEMENTS=o})}return null}(),s=r("offset",!0);return{elements:o,primitive:function(){if("primitive"in n){var t=n.primitive;return R(function(e,r){return rt[t]})}if("primitive"in i){var e=i.primitive;return N(e,function(t,r){var n=t.constants.primTypes,i=t.invoke(r,e);return r.def(n,"[",i,"]")})}return o?I(o)?o.value?R(function(t,e){return e.def(t.ELEMENTS,".primType")}):R(function(){return 4}):new D(o.thisDep,o.contextDep,o.propDep,function(t,e){var r=t.ELEMENTS;return e.def(r,"?",r,".primType:",4)}):null}(),count:function(){if("count"in n){var t=0|n.count;return R(function(){return t})}if("count"in i){var e=i.count;return N(e,function(t,r){return t.invoke(r,e)})}return o?I(o)?o?s?new D(s.thisDep,s.contextDep,s.propDep,function(t,e){return e.def(t.ELEMENTS,".vertCount-",t.OFFSET)}):R(function(t,e){return e.def(t.ELEMENTS,".vertCount")}):R(function(){return-1}):new D(o.thisDep||s.thisDep,o.contextDep||s.contextDep,o.propDep||s.propDep,function(t,e){var r=t.ELEMENTS;return t.OFFSET?e.def(r,"?",r,".vertCount-",t.OFFSET,":-1"):e.def(r,"?",r,".vertCount:-1")}):null}(),instances:r("instances",!1),offset:s}}function k(t,r){var n=t.static,a=t.dynamic,o={};return Object.keys(n).forEach(function(t){var r=n[t],a=e.id(t),s=new Z;if(z(r))s.state=1,s.buffer=i.getBuffer(i.create(r,34962,!1,!0)),s.type=0;else if(c=i.getBuffer(r))s.state=1,s.buffer=c,s.type=0;else if(r.constant){var l=r.constant;s.buffer="null",s.state=2,"number"==typeof l?s.x=l:mt.forEach(function(t,e){e<l.length&&(s[t]=l[e])})}else{var c=z(r.buffer)?i.getBuffer(i.create(r.buffer,34962,!1,!0)):i.getBuffer(r.buffer),u=0|r.offset,f=0|r.stride,h=0|r.size,d=!!r.normalized,p=0;"type"in r&&(p=K[r.type]),r=0|r.divisor,s.buffer=c,s.state=1,s.size=h,s.normalized=d,s.type=p||c.dtype,s.offset=u,s.stride=f,s.divisor=r}o[t]=R(function(t,e){var r=t.attribCache;if(a in r)return r[a];var n={isStream:!1};return Object.keys(s).forEach(function(t){n[t]=s[t]}),s.buffer&&(n.buffer=t.link(s.buffer),n.type=n.type||n.buffer+".dtype"),r[a]=n})}),Object.keys(a).forEach(function(t){var e=a[t];o[t]=N(e,function(t,r){function n(t){r(l[t],"=",i,".",t,"|0;")}var i=t.invoke(r,e),a=t.shared,o=a.isBufferArgs,s=a.buffer,l={isStream:r.def(!1)},c=new Z;c.state=1,Object.keys(c).forEach(function(t){l[t]=r.def(""+c[t])});var u=l.buffer,f=l.type;return r("if(",o,"(",i,")){",l.isStream,"=true;",u,"=",s,".createStream(",34962,",",i,");",f,"=",u,".dtype;","}else{",u,"=",s,".getBuffer(",i,");","if(",u,"){",f,"=",u,".dtype;",'}else if("constant" in ',i,"){",l.state,"=",2,";","if(typeof "+i+'.constant === "number"){',l[mt[0]],"=",i,".constant;",mt.slice(1).map(function(t){return l[t]}).join("="),"=0;","}else{",mt.map(function(t,e){return l[t]+"="+i+".constant.length>="+e+"?"+i+".constant["+e+"]:0;"}).join(""),"}}else{","if(",o,"(",i,".buffer)){",u,"=",s,".createStream(",34962,",",i,".buffer);","}else{",u,"=",s,".getBuffer(",i,".buffer);","}",f,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",u,".dtype;",l.normalized,"=!!",i,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",s,".destroyStream(",u,");","}"),l})}),o}function A(t,e,r,n,i){var a=_(t),s=function(t,e,r){function n(t){if(t in i){var r=i[t];t=!0;var n,o,s=0|r.x,l=0|r.y;return"width"in r?n=0|r.width:t=!1,"height"in r?o=0|r.height:t=!1,new D(!t&&e&&e.thisDep,!t&&e&&e.contextDep,!t&&e&&e.propDep,function(t,e){var i=t.shared.context,a=n;"width"in r||(a=e.def(i,".","framebufferWidth","-",s));var c=o;return"height"in r||(c=e.def(i,".","framebufferHeight","-",l)),[s,l,a,c]})}if(t in a){var c=a[t];return t=N(c,function(t,e){var r=t.invoke(e,c),n=t.shared.context,i=e.def(r,".x|0"),a=e.def(r,".y|0");return[i,a,e.def('"width" in ',r,"?",r,".width|0:","(",n,".","framebufferWidth","-",i,")"),r=e.def('"height" in ',r,"?",r,".height|0:","(",n,".","framebufferHeight","-",a,")")]}),e&&(t.thisDep=t.thisDep||e.thisDep,t.contextDep=t.contextDep||e.contextDep,t.propDep=t.propDep||e.propDep),t}return e?new D(e.thisDep,e.contextDep,e.propDep,function(t,e){var r=t.shared.context;return[0,0,e.def(r,".","framebufferWidth"),e.def(r,".","framebufferHeight")]}):null}var i=t.static,a=t.dynamic;if(t=n("viewport")){var o=t;t=new D(t.thisDep,t.contextDep,t.propDep,function(t,e){var r=o.append(t,e),n=t.shared.context;return e.set(n,".viewportWidth",r[2]),e.set(n,".viewportHeight",r[3]),r})}return{viewport:t,scissor_box:n("scissor.box")}}(t,a),l=M(t),c=function(t,e){var r=t.static,n=t.dynamic,i={};return nt.forEach(function(t){function e(e,o){if(t in r){var s=e(r[t]);i[a]=R(function(){return s})}else if(t in n){var l=n[t];i[a]=N(l,function(t,e){return o(t,e,t.invoke(e,l))})}}var a=v(t);switch(t){case"cull.enable":case"blend.enable":case"dither":case"stencil.enable":case"depth.enable":case"scissor.enable":case"polygonOffset.enable":case"sample.alpha":case"sample.enable":case"depth.mask":return e(function(t){return t},function(t,e,r){return r});case"depth.func":return e(function(t){return yt[t]},function(t,e,r){return e.def(t.constants.compareFuncs,"[",r,"]")});case"depth.range":return e(function(t){return t},function(t,e,r){return[e.def("+",r,"[0]"),e=e.def("+",r,"[1]")]});case"blend.func":return e(function(t){return[gt["srcRGB"in t?t.srcRGB:t.src],gt["dstRGB"in t?t.dstRGB:t.dst],gt["srcAlpha"in t?t.srcAlpha:t.src],gt["dstAlpha"in t?t.dstAlpha:t.dst]]},function(t,e,r){function n(t,n){return e.def('"',t,n,'" in ',r,"?",r,".",t,n,":",r,".",t)}t=t.constants.blendFuncs;var i=n("src","RGB"),a=n("dst","RGB"),o=(i=e.def(t,"[",i,"]"),e.def(t,"[",n("src","Alpha"),"]"));return[i,a=e.def(t,"[",a,"]"),o,t=e.def(t,"[",n("dst","Alpha"),"]")]});case"blend.equation":return e(function(t){return"string"==typeof t?[J[t],J[t]]:"object"==typeof t?[J[t.rgb],J[t.alpha]]:void 0},function(t,e,r){var n=t.constants.blendEquations,i=e.def(),a=e.def();return(t=t.cond("typeof ",r,'==="string"')).then(i,"=",a,"=",n,"[",r,"];"),t.else(i,"=",n,"[",r,".rgb];",a,"=",n,"[",r,".alpha];"),e(t),[i,a]});case"blend.color":return e(function(t){return o(4,function(e){return+t[e]})},function(t,e,r){return o(4,function(t){return e.def("+",r,"[",t,"]")})});case"stencil.mask":return e(function(t){return 0|t},function(t,e,r){return e.def(r,"|0")});case"stencil.func":return e(function(t){return[yt[t.cmp||"keep"],t.ref||0,"mask"in t?t.mask:-1]},function(t,e,r){return[t=e.def('"cmp" in ',r,"?",t.constants.compareFuncs,"[",r,".cmp]",":",7680),e.def(r,".ref|0"),e=e.def('"mask" in ',r,"?",r,".mask|0:-1")]});case"stencil.opFront":case"stencil.opBack":return e(function(e){return["stencil.opBack"===t?1029:1028,bt[e.fail||"keep"],bt[e.zfail||"keep"],bt[e.zpass||"keep"]]},function(e,r,n){function i(t){return r.def('"',t,'" in ',n,"?",a,"[",n,".",t,"]:",7680)}var a=e.constants.stencilOps;return["stencil.opBack"===t?1029:1028,i("fail"),i("zfail"),i("zpass")]});case"polygonOffset.offset":return e(function(t){return[0|t.factor,0|t.units]},function(t,e,r){return[e.def(r,".factor|0"),e=e.def(r,".units|0")]});case"cull.face":return e(function(t){var e=0;return"front"===t?e=1028:"back"===t&&(e=1029),e},function(t,e,r){return e.def(r,'==="front"?',1028,":",1029)});case"lineWidth":return e(function(t){return t},function(t,e,r){return r});case"frontFace":return e(function(t){return xt[t]},function(t,e,r){return e.def(r+'==="cw"?2304:2305')});case"colorMask":return e(function(t){return t.map(function(t){return!!t})},function(t,e,r){return o(4,function(t){return"!!"+r+"["+t+"]"})});case"sample.coverage":return e(function(t){return["value"in t?t.value:1,!!t.invert]},function(t,e,r){return[e.def('"value" in ',r,"?+",r,".value:1"),e=e.def("!!",r,".invert")]})}}),i}(t),u=w(t),f=s.viewport;return f&&(c.viewport=f),(s=s[f=v("scissor.box")])&&(c[f]=s),(a={framebuffer:a,draw:l,shader:u,state:c,dirty:s=0<Object.keys(c).length}).profile=function(t){var e,r=t.static;if(t=t.dynamic,"profile"in r){var n=!!r.profile;(e=R(function(t,e){return n})).enable=n}else if("profile"in t){var i=t.profile;e=N(i,function(t,e){return t.invoke(e,i)})}return e}(t),a.uniforms=function(t,e){var r=t.static,n=t.dynamic,i={};return Object.keys(r).forEach(function(t){var e,n=r[t];if("number"==typeof n||"boolean"==typeof n)e=R(function(){return n});else if("function"==typeof n){var a=n._reglType;"texture2d"===a||"textureCube"===a?e=R(function(t){return t.link(n)}):"framebuffer"!==a&&"framebufferCube"!==a||(e=R(function(t){return t.link(n.color[0])}))}else g(n)&&(e=R(function(t){return t.global.def("[",o(n.length,function(t){return n[t]}),"]")}));e.value=n,i[t]=e}),Object.keys(n).forEach(function(t){var e=n[t];i[t]=N(e,function(t,r){return t.invoke(r,e)})}),i}(r),a.attributes=k(e),a.context=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach(function(t){var r=e[t];n[t]=R(function(t,e){return"number"==typeof r||"boolean"==typeof r?""+r:t.link(r)})}),Object.keys(r).forEach(function(t){var e=r[t];n[t]=N(e,function(t,r){return t.invoke(r,e)})}),n}(n),a}function T(t,e,r){var n=t.shared.context,i=t.scope();Object.keys(r).forEach(function(a){e.save(n,"."+a),i(n,".",a,"=",r[a].append(t,e),";")}),e(i)}function E(t,e,r,n){var i,a=(s=t.shared).gl,o=s.framebuffer;$&&(i=e.def(s.extensions,".webgl_draw_buffers"));var s=(l=t.constants).drawBuffer,l=l.backBuffer;t=r?r.append(t,e):e.def(o,".next"),n||e("if(",t,"!==",o,".cur){"),e("if(",t,"){",a,".bindFramebuffer(",36160,",",t,".framebuffer);"),$&&e(i,".drawBuffersWEBGL(",s,"[",t,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",36160,",null);"),$&&e(i,".drawBuffersWEBGL(",l,");"),e("}",o,".cur=",t,";"),n||e("}")}function S(t,e,r){var n=t.shared,i=n.gl,a=t.current,s=t.next,l=n.current,c=n.next,u=t.cond(l,".dirty");nt.forEach(function(e){var n,f;if(!((e=v(e))in r.state))if(e in s){n=s[e],f=a[e];var h=o(tt[e].length,function(t){return u.def(n,"[",t,"]")});u(t.cond(h.map(function(t,e){return t+"!=="+f+"["+e+"]"}).join("||")).then(i,".",at[e],"(",h,");",h.map(function(t,e){return f+"["+e+"]="+t}).join(";"),";"))}else n=u.def(c,".",e),h=t.cond(n,"!==",l,".",e),u(h),e in it?h(t.cond(n).then(i,".enable(",it[e],");").else(i,".disable(",it[e],");"),l,".",e,"=",n,";"):h(i,".",at[e],"(",n,");",l,".",e,"=",n,";")}),0===Object.keys(r.state).length&&u(l,".dirty=false;"),e(u)}function L(t,e,r,n){var i=t.shared,a=t.current,o=i.current,s=i.gl;O(Object.keys(r)).forEach(function(i){var l=r[i];if(!n||n(l)){var c=l.append(t,e);if(it[i]){var u=it[i];I(l)?e(s,c?".enable(":".disable(",u,");"):e(t.cond(c).then(s,".enable(",u,");").else(s,".disable(",u,");")),e(o,".",i,"=",c,";")}else if(g(c)){var f=a[i];e(s,".",at[i],"(",c,");",c.map(function(t,e){return f+"["+e+"]="+t}).join(";"),";")}else e(s,".",at[i],"(",c,");",o,".",i,"=",c,";")}})}function C(t,e){Q&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function F(t,e,r,n,i){function a(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function o(t){t(c=e.def(),"=",a(),";"),"string"==typeof i?t(h,".count+=",i,";"):t(h,".count++;"),p&&(n?t(u=e.def(),"=",m,".getNumPendingQueries();"):t(m,".beginQuery(",h,");"))}function s(t){t(h,".cpuTime+=",a(),"-",c,";"),p&&(n?t(m,".pushScopeStats(",u,",",m,".getNumPendingQueries(),",h,");"):t(m,".endQuery();"))}function l(t){var r=e.def(d,".profile");e(d,".profile=",t,";"),e.exit(d,".profile=",r,";")}var c,u,f=t.shared,h=t.stats,d=f.current,m=f.timer;if(r=r.profile){if(I(r))return void(r.enable?(o(e),s(e.exit),l("true")):l("false"));l(r=r.append(t,e))}else r=e.def(d,".profile");o(f=t.block()),e("if(",r,"){",f,"}"),s(t=t.block()),e.exit("if(",r,"){",t,"}")}function j(t,e,r,n,i){function a(r,n,i){function a(){e("if(!",u,".buffer){",l,".enableVertexAttribArray(",c,");}");var r,a=i.type;r=i.size?e.def(i.size,"||",n):n,e("if(",u,".type!==",a,"||",u,".size!==",r,"||",d.map(function(t){return u+"."+t+"!=="+i[t]}).join("||"),"){",l,".bindBuffer(",34962,",",f,".buffer);",l,".vertexAttribPointer(",[c,r,a,i.normalized,i.stride,i.offset],");",u,".type=",a,";",u,".size=",r,";",d.map(function(t){return u+"."+t+"="+i[t]+";"}).join(""),"}"),Q&&(a=i.divisor,e("if(",u,".divisor!==",a,"){",t.instancing,".vertexAttribDivisorANGLE(",[c,a],");",u,".divisor=",a,";}"))}function s(){e("if(",u,".buffer){",l,".disableVertexAttribArray(",c,");","}if(",mt.map(function(t,e){return u+"."+t+"!=="+h[e]}).join("||"),"){",l,".vertexAttrib4f(",c,",",h,");",mt.map(function(t,e){return u+"."+t+"="+h[e]+";"}).join(""),"}")}var l=o.gl,c=e.def(r,".location"),u=e.def(o.attributes,"[",c,"]");r=i.state;var f=i.buffer,h=[i.x,i.y,i.z,i.w],d=["buffer","normalized","offset","stride"];1===r?a():2===r?s():(e("if(",r,"===",1,"){"),a(),e("}else{"),s(),e("}"))}var o=t.shared;n.forEach(function(n){var o,s=n.name,l=r.attributes[s];if(l){if(!i(l))return;o=l.append(t,e)}else{if(!i(_t))return;var c=t.scopeAttrib(s);o={},Object.keys(new Z).forEach(function(t){o[t]=e.def(c,".",t)})}a(t.link(n),function(t){switch(t){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(n.info.type),o)})}function B(t,r,n,i,a){for(var s,l=t.shared,c=l.gl,u=0;u<i.length;++u){var f,h=(m=i[u]).name,d=m.info.type,p=n.uniforms[h],m=t.link(m)+".location";if(p){if(!a(p))continue;if(I(p)){if(h=p.value,35678===d||35680===d)r(c,".uniform1i(",m,",",(d=t.link(h._texture||h.color[0]._texture))+".bind());"),r.exit(d,".unbind();");else if(35674===d||35675===d||35676===d)h=t.global.def("new Float32Array(["+Array.prototype.slice.call(h)+"])"),p=2,35675===d?p=3:35676===d&&(p=4),r(c,".uniformMatrix",p,"fv(",m,",false,",h,");");else{switch(d){case 5126:s="1f";break;case 35664:s="2f";break;case 35665:s="3f";break;case 35666:s="4f";break;case 35670:case 5124:s="1i";break;case 35671:case 35667:s="2i";break;case 35672:case 35668:s="3i";break;case 35673:s="4i";break;case 35669:s="4i"}r(c,".uniform",s,"(",m,",",g(h)?Array.prototype.slice.call(h):h,");")}continue}f=p.append(t,r)}else{if(!a(_t))continue;f=r.def(l.uniforms,"[",e.id(h),"]")}switch(35678===d?r("if(",f,"&&",f,'._reglType==="framebuffer"){',f,"=",f,".color[0];","}"):35680===d&&r("if(",f,"&&",f,'._reglType==="framebufferCube"){',f,"=",f,".color[0];","}"),h=1,d){case 35678:case 35680:r(c,".uniform1i(",m,",",d=r.def(f,"._texture"),".bind());"),r.exit(d,".unbind();");continue;case 5124:case 35670:s="1i";break;case 35667:case 35671:s="2i",h=2;break;case 35668:case 35672:s="3i",h=3;break;case 35669:case 35673:s="4i",h=4;break;case 5126:s="1f";break;case 35664:s="2f",h=2;break;case 35665:s="3f",h=3;break;case 35666:s="4f",h=4;break;case 35674:s="Matrix2fv";break;case 35675:s="Matrix3fv";break;case 35676:s="Matrix4fv"}if(r(c,".uniform",s,"(",m,","),"M"===s.charAt(0)){m=Math.pow(d-35674+2,2);var v=t.global.def("new Float32Array(",m,")");r("false,(Array.isArray(",f,")||",f," instanceof Float32Array)?",f,":(",o(m,function(t){return v+"["+t+"]="+f+"["+t+"]"}),",",v,")")}else r(1<h?o(h,function(t){return f+"["+t+"]"}):f);r(");")}}function U(t,e,r,n){function i(i){var a=h[i];return a?a.contextDep&&n.contextDynamic||a.propDep?a.append(t,r):a.append(t,e):e.def(f,".",i)}function a(){function t(){r(l,".drawElementsInstancedANGLE(",[p,v,g,m+"<<(("+g+"-5121)>>1)",s],");")}function e(){r(l,".drawArraysInstancedANGLE(",[p,m,v,s],");")}d?y?t():(r("if(",d,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(u+".drawElements("+[p,v,g,m+"<<(("+g+"-5121)>>1)"]+");")}function e(){r(u+".drawArrays("+[p,m,v]+");")}d?y?t():(r("if(",d,"){"),t(),r("}else{"),e(),r("}")):e()}var s,l,c=t.shared,u=c.gl,f=c.draw,h=n.draw,d=function(){var i=h.elements,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a)):i=a.def(f,".","elements"),i&&a("if("+i+")"+u+".bindBuffer(34963,"+i+".buffer.buffer);"),i}(),p=i("primitive"),m=i("offset"),v=function(){var i=h.count,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a)):i=a.def(f,".","count"),i}();if("number"==typeof v){if(0===v)return}else r("if(",v,"){"),r.exit("}");Q&&(s=i("instances"),l=t.instancing);var g=d+".type",y=h.elements&&I(h.elements);Q&&("number"!=typeof s||0<=s)?"string"==typeof s?(r("if(",s,">0){"),a(),r("}else if(",s,"<0){"),o(),r("}")):a():o()}function q(t,e,r,n,i){return i=(e=x()).proc("body",i),Q&&(e.instancing=i.def(e.shared.extensions,".angle_instanced_arrays")),t(e,i,r,n),e.compile().body}function H(t,e,r,n){C(t,e),j(t,e,r,n.attributes,function(){return!0}),B(t,e,r,n.uniforms,function(){return!0}),U(t,e,e,r)}function G(t,e,r,n){function i(){return!0}t.batchId="a1",C(t,e),j(t,e,r,n.attributes,i),B(t,e,r,n.uniforms,i),U(t,e,e,r)}function Y(t,e,r,n){function i(t){return t.contextDep&&o||t.propDep}function a(t){return!i(t)}C(t,e);var o=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var c=t.scope(),u=t.scope();e(c.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",u,"}",c.exit),r.needsContext&&T(t,u,r.context),r.needsFramebuffer&&E(t,u,r.framebuffer),L(t,u,r.state,i),r.profile&&i(r.profile)&&F(t,u,r,!1,!0),n?(j(t,c,r,n.attributes,a),j(t,u,r,n.attributes,i),B(t,c,r,n.uniforms,a),B(t,u,r,n.uniforms,i),U(t,c,u,r)):(e=t.global.def("{}"),n=r.shader.progVar.append(t,u),l=u.def(n,".id"),c=u.def(e,"[",l,"]"),u(t.shared.gl,".useProgram(",n,".program);","if(!",c,"){",c,"=",e,"[",l,"]=",t.link(function(e){return q(G,t,r,e,2)}),"(",n,");}",c,".call(this,a0[",s,"],",s,");"))}function W(t,r){function n(e){var n=r.shader[e];n&&i.set(a.shader,"."+e,n.append(t,i))}var i=t.proc("scope",3);t.batchId="a2";var a=t.shared,o=a.current;T(t,i,r.context),r.framebuffer&&r.framebuffer.append(t,i),O(Object.keys(r.state)).forEach(function(e){var n=r.state[e].append(t,i);g(n)?n.forEach(function(r,n){i.set(t.next[e],"["+n+"]",r)}):i.set(a.next,"."+e,n)}),F(t,i,r,!0,!0),["elements","offset","count","instances","primitive"].forEach(function(e){var n=r.draw[e];n&&i.set(a.draw,"."+e,""+n.append(t,i))}),Object.keys(r.uniforms).forEach(function(n){i.set(a.uniforms,"["+e.id(n)+"]",r.uniforms[n].append(t,i))}),Object.keys(r.attributes).forEach(function(e){var n=r.attributes[e].append(t,i),a=t.scopeAttrib(e);Object.keys(new Z).forEach(function(t){i.set(a,"."+t,n[t])})}),n("vert"),n("frag"),0<Object.keys(r.state).length&&(i(o,".dirty=true;"),i.exit(o,".dirty=true;")),i("a1(",t.shared.context,",a0,",t.batchId,");")}function X(t,e,r){var n=e.static[r];if(n&&function(t){if("object"==typeof t&&!g(t)){for(var e=Object.keys(t),r=0;r<e.length;++r)if(V.isDynamic(t[e[r]]))return!0;return!1}}(n)){var i=t.global,a=Object.keys(n),o=!1,s=!1,l=!1,c=t.global.def("{}");a.forEach(function(e){var r=n[e];if(V.isDynamic(r))"function"==typeof r&&(r=n[e]=V.unbox(r)),e=N(r,null),o=o||e.thisDep,l=l||e.propDep,s=s||e.contextDep;else{switch(i(c,".",e,"="),typeof r){case"number":i(r);break;case"string":i('"',r,'"');break;case"object":Array.isArray(r)&&i("[",r.join(),"]");break;default:i(t.link(r))}i(";")}}),e.dynamic[r]=new V.DynamicVariable(4,{thisDep:o,contextDep:s,propDep:l,ref:c,append:function(t,e){a.forEach(function(r){var i=n[r];V.isDynamic(i)&&(i=t.invoke(e,i),e(c,".",r,"=",i,";"))})}}),delete e.static[r]}}var Z=u.Record,J={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(J.min=32775,J.max=32776);var Q=r.angle_instanced_arrays,$=r.webgl_draw_buffers,tt={dirty:!0,profile:m.profile},et={},nt=[],it={},at={};y("dither",3024),y("blend.enable",3042),b("blend.color","blendColor",[0,0,0,0]),b("blend.equation","blendEquationSeparate",[32774,32774]),b("blend.func","blendFuncSeparate",[1,0,1,0]),y("depth.enable",2929,!0),b("depth.func","depthFunc",513),b("depth.range","depthRange",[0,1]),b("depth.mask","depthMask",!0),b("colorMask","colorMask",[!0,!0,!0,!0]),y("cull.enable",2884),b("cull.face","cullFace",1029),b("frontFace","frontFace",2305),b("lineWidth","lineWidth",1),y("polygonOffset.enable",32823),b("polygonOffset.offset","polygonOffset",[0,0]),y("sample.alpha",32926),y("sample.enable",32928),b("sample.coverage","sampleCoverage",[1,!1]),y("stencil.enable",2960),b("stencil.mask","stencilMask",-1),b("stencil.func","stencilFunc",[519,0,-1]),b("stencil.opFront","stencilOpSeparate",[1028,7680,7680,7680]),b("stencil.opBack","stencilOpSeparate",[1029,7680,7680,7680]),y("scissor.enable",3089),b("scissor.box","scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),b("viewport","viewport",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var ot={gl:t,context:d,strings:e,next:et,current:tt,draw:h,elements:a,buffer:i,shader:f,attributes:u.state,uniforms:c,framebuffer:l,extensions:r,timer:p,isBufferArgs:z},st={primTypes:rt,compareFuncs:yt,blendFuncs:gt,blendEquations:J,stencilOps:bt,glTypes:K,orientationType:xt};$&&(st.backBuffer=[1029],st.drawBuffer=o(n.maxDrawbuffers,function(t){return 0===t?[0]:o(t,function(t){return 36064+t})}));var lt=0;return{next:et,current:tt,procs:function(){var e=x(),r=e.proc("poll"),i=e.proc("refresh"),a=e.block();r(a),i(a);var s=e.shared,l=s.gl,c=s.next,u=s.current;a(u,".dirty=false;"),E(e,r),E(e,i,null,!0);var f,h=t.getExtension("angle_instanced_arrays");h&&(f=e.link(h));for(var d=0;d<n.maxAttributes;++d){var p=i.def(s.attributes,"[",d,"]"),m=e.cond(p,".buffer");m.then(l,".enableVertexAttribArray(",d,");",l,".bindBuffer(",34962,",",p,".buffer.buffer);",l,".vertexAttribPointer(",d,",",p,".size,",p,".type,",p,".normalized,",p,".stride,",p,".offset);").else(l,".disableVertexAttribArray(",d,");",l,".vertexAttrib4f(",d,",",p,".x,",p,".y,",p,".z,",p,".w);",p,".buffer=null;"),i(m),h&&i(f,".vertexAttribDivisorANGLE(",d,",",p,".divisor);")}return Object.keys(it).forEach(function(t){var n=it[t],o=a.def(c,".",t),s=e.block();s("if(",o,"){",l,".enable(",n,")}else{",l,".disable(",n,")}",u,".",t,"=",o,";"),i(s),r("if(",o,"!==",u,".",t,"){",s,"}")}),Object.keys(at).forEach(function(t){var n,s,f=at[t],h=tt[t],d=e.block();d(l,".",f,"("),g(h)?(f=h.length,n=e.global.def(c,".",t),s=e.global.def(u,".",t),d(o(f,function(t){return n+"["+t+"]"}),");",o(f,function(t){return s+"["+t+"]="+n+"["+t+"];"}).join("")),r("if(",o(f,function(t){return n+"["+t+"]!=="+s+"["+t+"]"}).join("||"),"){",d,"}")):(n=a.def(c,".",t),s=a.def(u,".",t),d(n,");",u,".",t,"=",n,";"),r("if(",n,"!==",s,"){",d,"}")),i(d)}),e.compile()}(),compile:function(t,e,r,n,i){var a=x();return a.stats=a.link(i),Object.keys(e.static).forEach(function(t){X(a,e,t)}),vt.forEach(function(e){X(a,t,e)}),r=A(t,e,r,n),function(t,e){var r=t.proc("draw",1);C(t,r),T(t,r,e.context),E(t,r,e.framebuffer),S(t,r,e),L(t,r,e.state),F(t,r,e,!1,!0);var n=e.shader.progVar.append(t,r);if(r(t.shared.gl,".useProgram(",n,".program);"),e.shader.program)H(t,r,e,e.shader.program);else{var i=t.global.def("{}"),a=r.def(n,".id"),o=r.def(i,"[",a,"]");r(t.cond(o).then(o,".call(this,a0);").else(o,"=",i,"[",a,"]=",t.link(function(r){return q(H,t,e,r,1)}),"(",n,");",o,".call(this,a0);"))}0<Object.keys(e.state).length&&r(t.shared.current,".dirty=true;")}(a,r),W(a,r),function(t,e){function r(t){return t.contextDep&&i||t.propDep}var n=t.proc("batch",2);t.batchId="0",C(t,n);var i=!1,a=!0;Object.keys(e.context).forEach(function(t){i=i||e.context[t].propDep}),i||(T(t,n,e.context),a=!1);var o=!1;if((s=e.framebuffer)?(s.propDep?i=o=!0:s.contextDep&&i&&(o=!0),o||E(t,n,s)):E(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(i=!0),S(t,n,e),L(t,n,e.state,function(t){return!r(t)}),e.profile&&r(e.profile)||F(t,n,e,!1,"a1"),e.contextDep=i,e.needsContext=a,e.needsFramebuffer=o,(a=e.shader.progVar).contextDep&&i||a.propDep)Y(t,n,e,null);else if(a=a.append(t,n),n(t.shared.gl,".useProgram(",a,".program);"),e.shader.program)Y(t,n,e,e.shader.program);else{var s=t.global.def("{}"),l=(o=n.def(a,".id"),n.def(s,"[",o,"]"));n(t.cond(l).then(l,".call(this,a0,a1);").else(l,"=",s,"[",o,"]=",t.link(function(r){return q(Y,t,e,r,2)}),"(",a,");",l,".call(this,a0,a1);"))}0<Object.keys(e.state).length&&n(t.shared.current,".dirty=true;")}(a,r),a.compile()}}}function j(t,e){for(var r=0;r<t.length;++r)if(t[r]===e)return r;return-1}var B=function(t,e){for(var r=Object.keys(e),n=0;n<r.length;++n)t[r[n]]=e[r[n]];return t},U=0,V={DynamicVariable:t,define:function(r,n){return new t(r,e(n+""))},isDynamic:function(e){return"function"==typeof e&&!e._reglType||e instanceof t},unbox:function(e,r){return"function"==typeof e?new t(0,e):e},accessor:e},q={next:"function"==typeof requestAnimationFrame?function(t){return requestAnimationFrame(t)}:function(t){return setTimeout(t,16)},cancel:"function"==typeof cancelAnimationFrame?function(t){return cancelAnimationFrame(t)}:clearTimeout},H="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date},G=function(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Uint8ClampedArray},Y=function(t){return Object.keys(t).map(function(e){return t[e]})},W=o(8,function(){return[]}),X={alloc:l,free:c,allocType:function(t,e){var r=null;switch(t){case 5120:r=new Int8Array(l(e),0,e);break;case 5121:r=new Uint8Array(l(e),0,e);break;case 5122:r=new Int16Array(l(2*e),0,e);break;case 5123:r=new Uint16Array(l(2*e),0,e);break;case 5124:r=new Int32Array(l(4*e),0,e);break;case 5125:r=new Uint32Array(l(4*e),0,e);break;case 5126:r=new Float32Array(l(4*e),0,e);break;default:return null}return r.length!==e?r.subarray(0,e):r},freeType:function(t){c(t.buffer)}},Z={shape:function(t){for(var e=[];t.length;t=t[0])e.push(t.length);return e},flatten:function(t,e,r,n){var i=1;if(e.length)for(var a=0;a<e.length;++a)i*=e[a];else i=0;switch(r=n||X.allocType(r,i),e.length){case 0:break;case 1:for(n=e[0],e=0;e<n;++e)r[e]=t[e];break;case 2:for(n=e[0],e=e[1],a=i=0;a<n;++a)for(var o=t[a],s=0;s<e;++s)r[i++]=o[s];break;case 3:u(t,e[0],e[1],e[2],r,0);break;default:!function t(e,r,n,i,a){for(var o=1,s=n+1;s<r.length;++s)o*=r[s];var l=r[n];if(4==r.length-n){var c=r[n+1],f=r[n+2];for(r=r[n+3],s=0;s<l;++s)u(e[s],c,f,r,i,a),a+=o}else for(s=0;s<l;++s)t(e[s],r,n+1,i,a),a+=o}(t,e,0,r,0)}return r}},J={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},K={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},Q={dynamic:35048,stream:35040,static:35044},$=Z.flatten,tt=Z.shape,et=[];et[5120]=1,et[5122]=2,et[5124]=4,et[5121]=1,et[5123]=2,et[5125]=4,et[5126]=4;var rt={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},nt=new Float32Array(1),it=new Uint32Array(nt.buffer),at=[9984,9986,9985,9987],ot=[0,6409,6410,6407,6408],st={};st[6409]=st[6406]=st[6402]=1,st[34041]=st[6410]=2,st[6407]=st[35904]=3,st[6408]=st[35906]=4;var lt=Object.keys(J).concat(["[object HTMLCanvasElement]","[object CanvasRenderingContext2D]","[object HTMLImageElement]","[object HTMLVideoElement]"]),ct=[];ct[5121]=1,ct[5126]=4,ct[36193]=2,ct[5123]=2,ct[5125]=4;var ut=[];ut[32854]=2,ut[32855]=2,ut[36194]=2,ut[34041]=4,ut[33776]=.5,ut[33777]=.5,ut[33778]=1,ut[33779]=1,ut[35986]=.5,ut[35987]=1,ut[34798]=1,ut[35840]=.5,ut[35841]=.25,ut[35842]=.5,ut[35843]=.25,ut[36196]=.5;var ft=[];ft[32854]=2,ft[32855]=2,ft[36194]=2,ft[33189]=2,ft[36168]=1,ft[34041]=4,ft[35907]=4,ft[34836]=16,ft[34842]=8,ft[34843]=6;var ht=function(t,e,r,n,i){function a(t){this.id=c++,this.refCount=1,this.renderbuffer=t,this.format=32854,this.height=this.width=0,i.profile&&(this.stats={size:0})}function o(e){var r=e.renderbuffer;t.bindRenderbuffer(36161,null),t.deleteRenderbuffer(r),e.renderbuffer=null,e.refCount=0,delete u[e.id],n.renderbufferCount--}var s={rgba4:32854,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};e.ext_srgb&&(s.srgba=35907),e.ext_color_buffer_half_float&&(s.rgba16f=34842,s.rgb16f=34843),e.webgl_color_buffer_float&&(s.rgba32f=34836);var l=[];Object.keys(s).forEach(function(t){l[s[t]]=t});var c=0,u={};return a.prototype.decRef=function(){0>=--this.refCount&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(u).forEach(function(e){t+=u[e].stats.size}),t}),{create:function(e,r){function o(e,r){var n=0,a=0,u=32854;if("object"==typeof e&&e?("shape"in e?(n=0|(a=e.shape)[0],a=0|a[1]):("radius"in e&&(n=a=0|e.radius),"width"in e&&(n=0|e.width),"height"in e&&(a=0|e.height)),"format"in e&&(u=s[e.format])):"number"==typeof e?(n=0|e,a="number"==typeof r?0|r:n):e||(n=a=1),n!==c.width||a!==c.height||u!==c.format)return o.width=c.width=n,o.height=c.height=a,c.format=u,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,u,n,a),i.profile&&(c.stats.size=ft[c.format]*c.width*c.height),o.format=l[c.format],o}var c=new a(t.createRenderbuffer());return u[c.id]=c,n.renderbufferCount++,o(e,r),o.resize=function(e,r){var n=0|e,a=0|r||n;return n===c.width&&a===c.height?o:(o.width=c.width=n,o.height=c.height=a,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,c.format,n,a),i.profile&&(c.stats.size=ft[c.format]*c.width*c.height),o)},o._reglType="renderbuffer",o._renderbuffer=c,i.profile&&(o.stats=c.stats),o.destroy=function(){c.decRef()},o},clear:function(){Y(u).forEach(o)},restore:function(){Y(u).forEach(function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)}),t.bindRenderbuffer(36161,null)}}},dt=[];dt[6408]=4;var pt=[];pt[5121]=1,pt[5126]=4,pt[36193]=2;var mt=["x","y","z","w"],vt="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),gt={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},yt={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},bt={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},xt={cw:2304,ccw:2305},_t=new D(!1,!1,!1,function(){});return function(t){function e(){if(0===X.length)w&&w.update(),Q=null;else{Q=q.next(e),f();for(var t=X.length-1;0<=t;--t){var r=X[t];r&&r(P,null,0)}v.flush(),w&&w.update()}}function r(){!Q&&0<X.length&&(Q=q.next(e))}function n(){Q&&(q.cancel(e),Q=null)}function a(t){t.preventDefault(),n(),Z.forEach(function(t){t()})}function o(t){v.getError(),y.restore(),I.restore(),O.restore(),R.restore(),N.restore(),U.restore(),w&&w.restore(),G.procs.refresh(),r(),J.forEach(function(t){t()})}function s(t){function e(t){var e={},r={};return Object.keys(t).forEach(function(n){var i=t[n];V.isDynamic(i)?r[n]=V.unbox(i,n):e[n]=i}),{dynamic:r,static:e}}var r=e(t.context||{}),n=e(t.uniforms||{}),i=e(t.attributes||{}),a=e(function(t){function e(t){if(t in r){var e=r[t];delete r[t],Object.keys(e).forEach(function(n){r[t+"."+n]=e[n]})}}var r=B({},t);return delete r.uniforms,delete r.attributes,delete r.context,"stencil"in r&&r.stencil.op&&(r.stencil.opBack=r.stencil.opFront=r.stencil.op,delete r.stencil.op),e("blend"),e("depth"),e("cull"),e("stencil"),e("polygonOffset"),e("scissor"),e("sample"),r}(t));t={gpuTime:0,cpuTime:0,count:0};var o=(r=G.compile(a,i,n,r,t)).draw,s=r.batch,l=r.scope,c=[];return B(function(t,e){var r;if("function"==typeof t)return l.call(this,null,t,0);if("function"==typeof e)if("number"==typeof t)for(r=0;r<t;++r)l.call(this,null,e,r);else{if(!Array.isArray(t))return l.call(this,t,e,0);for(r=0;r<t.length;++r)l.call(this,t[r],e,r)}else if("number"==typeof t){if(0<t)return s.call(this,function(t){for(;c.length<t;)c.push(null);return c}(0|t),0|t)}else{if(!Array.isArray(t))return o.call(this,t);if(t.length)return s.call(this,t,t.length)}},{stats:t})}function l(t,e){var r=0;G.procs.poll();var n=e.color;n&&(v.clearColor(+n[0]||0,+n[1]||0,+n[2]||0,+n[3]||0),r|=16384),"depth"in e&&(v.clearDepth(+e.depth),r|=256),"stencil"in e&&(v.clearStencil(0|e.stencil),r|=1024),v.clear(r)}function c(t){return X.push(t),r(),{cancel:function(){var e=j(X,t);X[e]=function t(){var e=j(X,t);X[e]=X[X.length-1],--X.length,0>=X.length&&n()}}}}function u(){var t=Y.viewport,e=Y.scissor_box;t[0]=t[1]=e[0]=e[1]=0,P.viewportWidth=P.framebufferWidth=P.drawingBufferWidth=t[2]=e[2]=v.drawingBufferWidth,P.viewportHeight=P.framebufferHeight=P.drawingBufferHeight=t[3]=e[3]=v.drawingBufferHeight}function f(){P.tick+=1,P.time=d(),u(),G.procs.poll()}function h(){u(),G.procs.refresh(),w&&w.update()}function d(){return(H()-M)/1e3}if(!(t=i(t)))return null;var v=t.gl,g=v.getContextAttributes();v.isContextLost();var y=function(t,e){function r(e){var r;e=e.toLowerCase();try{r=n[e]=t.getExtension(e)}catch(t){}return!!r}for(var n={},i=0;i<e.extensions.length;++i){var a=e.extensions[i];if(!r(a))return e.onDestroy(),e.onDone('"'+a+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return e.optionalExtensions.forEach(r),{extensions:n,restore:function(){Object.keys(n).forEach(function(t){if(!r(t))throw Error("(regl): error restoring extension "+t)})}}}(v,t);if(!y)return null;var b=function(){var t={"":0},e=[""];return{id:function(r){var n=t[r];return n||(n=t[r]=e.length,e.push(r),n)},str:function(t){return e[t]}}}(),x={bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},_=y.extensions,w=function(t,e){function r(t,e,r){var n=o.pop()||new function(){this.endQueryIndex=this.startQueryIndex=-1,this.sum=0,this.stats=null};n.startQueryIndex=t,n.endQueryIndex=e,n.sum=0,n.stats=r,s.push(n)}var n=e.ext_disjoint_timer_query;if(!n)return null;var i=[],a=[],o=[],s=[],l=[],c=[];return{beginQuery:function(t){var e=i.pop()||n.createQueryEXT();n.beginQueryEXT(35007,e),a.push(e),r(a.length-1,a.length,t)},endQuery:function(){n.endQueryEXT(35007)},pushScopeStats:r,update:function(){var t,e;if(0!==(t=a.length)){c.length=Math.max(c.length,t+1),l.length=Math.max(l.length,t+1),l[0]=0;var r=c[0]=0;for(e=t=0;e<a.length;++e){var u=a[e];n.getQueryObjectEXT(u,34919)?(r+=n.getQueryObjectEXT(u,34918),i.push(u)):a[t++]=u,l[e+1]=r,c[e+1]=t}for(a.length=t,e=t=0;e<s.length;++e){var f=(r=s[e]).startQueryIndex;u=r.endQueryIndex,r.sum+=l[u]-l[f],f=c[f],(u=c[u])===f?(r.stats.gpuTime+=r.sum/1e6,o.push(r)):(r.startQueryIndex=f,r.endQueryIndex=u,s[t++]=r)}s.length=t}},getNumPendingQueries:function(){return a.length},clear:function(){i.push.apply(i,a);for(var t=0;t<i.length;t++)n.deleteQueryEXT(i[t]);a.length=0,i.length=0},restore:function(){a.length=0,i.length=0}}}(0,_),M=H(),L=v.drawingBufferWidth,C=v.drawingBufferHeight,P={tick:0,time:0,viewportWidth:L,viewportHeight:C,framebufferWidth:L,framebufferHeight:C,drawingBufferWidth:L,drawingBufferHeight:C,pixelRatio:t.pixelRatio},z=function(t,e){var r=1;e.ext_texture_filter_anisotropic&&(r=t.getParameter(34047));var n=1,i=1;return e.webgl_draw_buffers&&(n=t.getParameter(34852),i=t.getParameter(36063)),{colorBits:[t.getParameter(3410),t.getParameter(3411),t.getParameter(3412),t.getParameter(3413)],depthBits:t.getParameter(3414),stencilBits:t.getParameter(3415),subpixelBits:t.getParameter(3408),extensions:Object.keys(e).filter(function(t){return!!e[t]}),maxAnisotropic:r,maxDrawbuffers:n,maxColorAttachments:i,pointSizeDims:t.getParameter(33901),lineWidthDims:t.getParameter(33902),maxViewportDims:t.getParameter(3386),maxCombinedTextureUnits:t.getParameter(35661),maxCubeMapSize:t.getParameter(34076),maxRenderbufferSize:t.getParameter(34024),maxTextureUnits:t.getParameter(34930),maxTextureSize:t.getParameter(3379),maxAttributes:t.getParameter(34921),maxVertexUniforms:t.getParameter(36347),maxVertexTextureUnits:t.getParameter(35660),maxVaryingVectors:t.getParameter(36348),maxFragmentUniforms:t.getParameter(36349),glsl:t.getParameter(35724),renderer:t.getParameter(7937),vendor:t.getParameter(7936),version:t.getParameter(7938)}}(v,_),O=p(v,x,t),D=m(v,_,O,x),I=(L=function(t,e,r,n,i){for(t=r.maxAttributes,e=Array(t),r=0;r<t;++r)e[r]=new T;return{Record:T,scope:{},state:e}}(v,_,z),E(v,b,x,t)),R=k(v,_,z,function(){G.procs.poll()},P,x,t),N=ht(v,_,0,x,t),U=A(v,_,z,R,N,x),G=F(v,b,_,z,O,D,0,U,{},L,I,{elements:null,primitive:4,count:-1,offset:0,instances:-1},P,w,t),Y=(b=S(v,U,G.procs.poll,P),G.next),W=v.canvas,X=[],Z=[],J=[],K=[t.onDestroy],Q=null;W&&(W.addEventListener("webglcontextlost",a,!1),W.addEventListener("webglcontextrestored",o,!1));var $=U.setFBO=s({framebuffer:V.define.call(null,1,"framebuffer")});return h(),g=B(s,{clear:function(t){if("framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var e=0;6>e;++e)$(B({framebuffer:t.framebuffer.faces[e]},t),l);else $(t,l);else l(0,t)},prop:V.define.bind(null,1),context:V.define.bind(null,2),this:V.define.bind(null,3),draw:s({}),buffer:function(t){return O.create(t,34962,!1,!1)},elements:function(t){return D.create(t,!1)},texture:R.create2D,cube:R.createCube,renderbuffer:N.create,framebuffer:U.create,framebufferCube:U.createCube,attributes:g,frame:c,on:function(t,e){var r;switch(t){case"frame":return c(e);case"lost":r=Z;break;case"restore":r=J;break;case"destroy":r=K}return r.push(e),{cancel:function(){for(var t=0;t<r.length;++t)if(r[t]===e){r[t]=r[r.length-1],r.pop();break}}}},limits:z,hasExtension:function(t){return 0<=z.extensions.indexOf(t.toLowerCase())},read:b,destroy:function(){X.length=0,n(),W&&(W.removeEventListener("webglcontextlost",a),W.removeEventListener("webglcontextrestored",o)),I.clear(),U.clear(),N.clear(),R.clear(),D.clear(),O.clear(),w&&w.clear(),K.forEach(function(t){t()})},_gl:v,_refresh:h,poll:function(){f(),w&&w.update()},now:d,stats:x}),t.onDone(null,g),g}},"object"==typeof r&&void 0!==e?e.exports=i():n.createREGL=i()},{}],487:[function(t,e,r){"use strict";var n,i="";e.exports=function(t,e){if("string"!=typeof t)throw new TypeError("expected a string");if(1===e)return t;if(2===e)return t+t;var r=t.length*e;if(n!==t||void 0===n)n=t,i="";else if(i.length>=r)return i.substr(0,r);for(;r>i.length&&e>1;)1&e&&(i+=t),e>>=1,t+=t;return i=(i+=t).substr(0,r)}},{}],488:[function(t,e,r){var n,i;n=this,i=function(){return function(){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}},"object"==typeof r?e.exports=i():n.resolveUrl=i()},{}],489:[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:{})},{}],490:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.length,r=t[t.length-1],n=e,i=e-2;i>=0;--i){var a=r,o=t[i],s=(r=a+o)-a,l=o-s;l&&(t[--n]=r,r=l)}for(var c=0,i=n;i<e;++i){var a=t[i],o=r,s=(r=a+o)-a,l=o-s;l&&(t[c++]=l)}return t[c++]=r,t.length=c,t}},{}],491:[function(t,e,r){"use strict";var n=t("two-product"),i=t("robust-sum"),a=t("robust-scale"),o=t("robust-compress"),s=6;function l(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 c(t){if(2===t.length)return["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("");for(var e=[],r=0;r<t.length;++r)e.push(["scale(",c(l(t,r)),",",(n=r,1&n?"-":""),t[0][r],")"].join(""));return function t(e){if(1===e.length)return e[0];if(2===e.length)return["sum(",e[0],",",e[1],")"].join("");var r=e.length>>1;return["sum(",t(e.slice(0,r)),",",t(e.slice(r)),")"].join("")}(e);var n}function u(t){return new Function("sum","scale","prod","compress",["function robustDeterminant",t,"(m){return compress(",c(function(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}(t)),")};return robustDeterminant",t].join(""))(i,a,n,o)}var f=[function(){return[0]},function(t){return[t[0][0]]}];!function(){for(;f.length<s;)f.push(u(f.length));for(var t=[],r=["function robustDeterminant(m){switch(m.length){"],n=0;n<s;++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);for(e.exports=i.apply(void 0,f.concat([f,u])),n=0;n<f.length;++n)e.exports[n]=f[n]}()},{"robust-compress":490,"robust-scale":497,"robust-sum":500,"two-product":532}],492:[function(t,e,r){"use strict";var n=t("two-product"),i=t("robust-sum");e.exports=function(t,e){for(var r=n(t[0],e[0]),a=1;a<t.length;++a)r=i(r,n(t[a],e[a]));return r}},{"robust-sum":500,"two-product":532}],493:[function(t,e,r){"use strict";var n=t("two-product"),i=t("robust-sum"),a=t("robust-subtract"),o=t("robust-scale"),s=6;function l(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 c(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(",c(t.slice(0,e)),",",c(t.slice(e)),")"].join("")}function u(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 u(e,t)}function f(t){if(2===t.length)return[["diff(",u(t[0][0],t[1][1]),",",u(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r<t.length;++r)e.push(["scale(",c(f(l(t,r))),",",(n=r,!0&n?"-":""),t[0][r],")"].join(""));return e;var n}function h(t,e){for(var r=[],n=0;n<e-2;++n)r.push(["prod(m",t,"[",n,"],m",t,"[",n,"])"].join(""));return c(r)}function d(t){for(var e=[],r=[],s=function(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}(t),u=0;u<t;++u)s[0][u]="1",s[t-1][u]="w"+u;for(u=0;u<t;++u)0==(1&u)?e.push.apply(e,f(l(s,u))):r.push.apply(r,f(l(s,u)));var d=c(e),p=c(r),m="exactInSphere"+t,v=[];for(u=0;u<t;++u)v.push("m"+u);var g=["function ",m,"(",v.join(),"){"];for(u=0;u<t;++u){g.push("var w",u,"=",h(u,t),";");for(var y=0;y<t;++y)y!==u&&g.push("var w",u,"m",y,"=scale(w",u,",m",y,"[0]);")}return g.push("var p=",d,",n=",p,",d=diff(p,n);return d[d.length-1];}return ",m),new Function("sum","diff","prod","scale",g.join(""))(i,a,n,o)}var p=[function(){return 0},function(){return 0},function(){return 0}];!function(){for(;p.length<=s;)p.push(d(p.length));for(var t=[],r=["slow"],n=0;n<=s;++n)t.push("a"+n),r.push("o"+n);var i=["function testInSphere(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=s;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return testInSphere"),r.push(i.join(""));var a=Function.apply(void 0,r);for(e.exports=a.apply(void 0,[function(t){var e=p[t.length];return e||(e=p[t.length]=d(t.length)),e.apply(void 0,t)}].concat(p)),n=0;n<=s;++n)e.exports[n]=p[n]}()},{"robust-scale":497,"robust-subtract":499,"robust-sum":500,"two-product":532}],494:[function(t,e,r){"use strict";var n=t("robust-determinant"),i=6;function a(t){for(var e="robustLinearSolve"+t+"d",r=["function ",e,"(A,b){return ["],i=0;i<t;++i){r.push("det([");for(var a=0;a<t;++a){a>0&&r.push(","),r.push("[");for(var o=0;o<t;++o)o>0&&r.push(","),o===i?r.push("+b[",a,"]"):r.push("+A[",a,"][",o,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var s=new Function("det",r.join(""));return s(t<6?n[t]:n)}var o=[function(){return[0]},function(t,e){return[[e[0]],[t[0][0]]]}];!function(){for(;o.length<i;)o.push(a(o.length));for(var t=[],r=["function dispatchLinearSolve(A,b){switch(A.length){"],n=0;n<i;++n)t.push("s"+n),r.push("case ",n,":return s",n,"(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 s=Function.apply(void 0,t);for(e.exports=s.apply(void 0,o.concat([o,a])),n=0;n<i;++n)e.exports[n]=o[n]}()},{"robust-determinant":491}],495:[function(t,e,r){"use strict";var n=t("two-product"),i=t("robust-sum"),a=t("robust-scale"),o=t("robust-subtract"),s=5;function l(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 c(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(",c(t.slice(0,e)),",",c(t.slice(e)),")"].join("")}function u(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(",c(u(l(t,r))),",",(n=r,1&n?"-":""),t[0][r],")"].join(""));return e;var n}function f(t){for(var e=[],r=[],s=function(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}(t),f=[],h=0;h<t;++h)0==(1&h)?e.push.apply(e,u(l(s,h))):r.push.apply(r,u(l(s,h))),f.push("m"+h);var d=c(e),p=c(r),m="orientation"+t+"Exact",v=["function ",m,"(",f.join(),"){var p=",d,",n=",p,",d=sub(p,n);return d[d.length-1];};return ",m].join("");return new Function("sum","prod","scale","sub",v)(i,n,a,o)}var h=f(3),d=f(4),p=[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=3.3306690738754716e-16*n;return o>=s||o<=-s?o:h(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],c=r[1]-n[1],u=t[2]-n[2],f=e[2]-n[2],h=r[2]-n[2],p=a*c,m=o*l,v=o*s,g=i*c,y=i*l,b=a*s,x=u*(p-m)+f*(v-g)+h*(y-b),_=7.771561172376103e-16*((Math.abs(p)+Math.abs(m))*Math.abs(u)+(Math.abs(v)+Math.abs(g))*Math.abs(f)+(Math.abs(y)+Math.abs(b))*Math.abs(h));return x>_||-x>_?x:d(t,e,r,n)}];!function(){for(;p.length<=s;)p.push(f(p.length));for(var t=[],r=["slow"],n=0;n<=s;++n)t.push("a"+n),r.push("o"+n);var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=s;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return getOrientation"),r.push(i.join(""));var a=Function.apply(void 0,r);for(e.exports=a.apply(void 0,[function(t){var e=p[t.length];return e||(e=p[t.length]=f(t.length)),e.apply(void 0,t)}].concat(p)),n=0;n<=s;++n)e.exports[n]=p[n]}()},{"robust-scale":497,"robust-subtract":499,"robust-sum":500,"two-product":532}],496:[function(t,e,r){"use strict";var n=t("robust-sum"),i=t("robust-scale");e.exports=function(t,e){if(1===t.length)return i(e,t[0]);if(1===e.length)return i(t,e[0]);if(0===t.length||0===e.length)return[0];var r=[0];if(t.length<e.length)for(var a=0;a<t.length;++a)r=n(r,i(e,t[a]));else for(var a=0;a<e.length;++a)r=n(r,i(t,e[a]));return r}},{"robust-scale":497,"robust-sum":500}],497:[function(t,e,r){"use strict";var n=t("two-product"),i=t("two-sum");e.exports=function(t,e){var r=t.length;if(1===r){var a=n(t[0],e);return a[0]?a:[a[1]]}var o=new Array(2*r),s=[.1,.1],l=[.1,.1],c=0;n(t[0],e,s),s[0]&&(o[c++]=s[0]);for(var u=1;u<r;++u){n(t[u],e,l);var f=s[1];i(f,l[0],s),s[0]&&(o[c++]=s[0]);var h=l[1],d=s[1],p=h+d,m=p-h,v=d-m;s[1]=p,v&&(o[c++]=v)}s[1]&&(o[c++]=s[1]);0===c&&(o[c++]=0);return o.length=c,o}},{"two-product":532,"two-sum":533}],498:[function(t,e,r){"use strict";e.exports=function(t,e,r,i){var a=n(t,r,i),o=n(e,r,i);if(a>0&&o>0||a<0&&o<0)return!1;var s=n(r,t,e),l=n(i,t,e);if(s>0&&l>0||s<0&&l<0)return!1;if(0===a&&0===o&&0===s&&0===l)return function(t,e,r,n){for(var i=0;i<2;++i){var a=t[i],o=e[i],s=Math.min(a,o),l=Math.max(a,o),c=r[i],u=n[i],f=Math.min(c,u),h=Math.max(c,u);if(h<s||l<f)return!1}return!0}(t,e,r,i);return!0};var n=t("robust-orientation")[3]},{"robust-orientation":495}],499:[function(t,e,r){"use strict";e.exports=function(t,e){var r=0|t.length,n=0|e.length;if(1===r&&1===n)return function(t,e){var r=t+e,n=r-t,i=t-(r-n)+(e-n);if(i)return[i,r];return[r]}(t[0],-e[0]);var i,a,o=new Array(r+n),s=0,l=0,c=0,u=Math.abs,f=t[l],h=u(f),d=-e[c],p=u(d);h<p?(a=f,(l+=1)<r&&(f=t[l],h=u(f))):(a=d,(c+=1)<n&&(d=-e[c],p=u(d)));l<r&&h<p||c>=n?(i=f,(l+=1)<r&&(f=t[l],h=u(f))):(i=d,(c+=1)<n&&(d=-e[c],p=u(d)));var m,v,g=i+a,y=g-i,b=a-y,x=b,_=g;for(;l<r&&c<n;)h<p?(i=f,(l+=1)<r&&(f=t[l],h=u(f))):(i=d,(c+=1)<n&&(d=-e[c],p=u(d))),(b=(a=x)-(y=(g=i+a)-i))&&(o[s++]=b),x=_-((m=_+g)-(v=m-_))+(g-v),_=m;for(;l<r;)(b=(a=x)-(y=(g=(i=f)+a)-i))&&(o[s++]=b),x=_-((m=_+g)-(v=m-_))+(g-v),_=m,(l+=1)<r&&(f=t[l]);for(;c<n;)(b=(a=x)-(y=(g=(i=d)+a)-i))&&(o[s++]=b),x=_-((m=_+g)-(v=m-_))+(g-v),_=m,(c+=1)<n&&(d=-e[c]);x&&(o[s++]=x);_&&(o[s++]=_);s||(o[s++]=0);return o.length=s,o}},{}],500:[function(t,e,r){"use strict";e.exports=function(t,e){var r=0|t.length,n=0|e.length;if(1===r&&1===n)return function(t,e){var r=t+e,n=r-t,i=t-(r-n)+(e-n);if(i)return[i,r];return[r]}(t[0],e[0]);var i,a,o=new Array(r+n),s=0,l=0,c=0,u=Math.abs,f=t[l],h=u(f),d=e[c],p=u(d);h<p?(a=f,(l+=1)<r&&(f=t[l],h=u(f))):(a=d,(c+=1)<n&&(d=e[c],p=u(d)));l<r&&h<p||c>=n?(i=f,(l+=1)<r&&(f=t[l],h=u(f))):(i=d,(c+=1)<n&&(d=e[c],p=u(d)));var m,v,g=i+a,y=g-i,b=a-y,x=b,_=g;for(;l<r&&c<n;)h<p?(i=f,(l+=1)<r&&(f=t[l],h=u(f))):(i=d,(c+=1)<n&&(d=e[c],p=u(d))),(b=(a=x)-(y=(g=i+a)-i))&&(o[s++]=b),x=_-((m=_+g)-(v=m-_))+(g-v),_=m;for(;l<r;)(b=(a=x)-(y=(g=(i=f)+a)-i))&&(o[s++]=b),x=_-((m=_+g)-(v=m-_))+(g-v),_=m,(l+=1)<r&&(f=t[l]);for(;c<n;)(b=(a=x)-(y=(g=(i=d)+a)-i))&&(o[s++]=b),x=_-((m=_+g)-(v=m-_))+(g-v),_=m,(c+=1)<n&&(d=e[c]);x&&(o[s++]=x);_&&(o[s++]=_);s||(o[s++]=0);return o.length=s,o}},{}],501:[function(t,e,r){var n,i;n=this,i=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]=1+(0|this.stats[t])}}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)))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,c=0;c<this.shelves.length;c++){var u=this.shelves[c];l+=u.h,s=Math.max(u.w-u.free,s)}this.resize(s,l)}return a},t.prototype.packOne=function(t,r){for(var n,i,a,o,s,l,c=0,u={shelf:-1,waste:1/0},f=0;f<this.shelves.length;f++){if(c+=(n=this.shelves[f]).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)<u.waste&&(u.waste=i,u.shelf=f)}return-1!==u.shelf?(n=this.shelves[u.shelf],this.count(r),n.alloc(t,r)):r<=this.h-c&&t<=this.w?(n=new e(c,this.w,r),this.shelves.push(n),this.count(r),n.alloc(t,r)):this.autoResize?(a=o=this.h,((s=l=this.w)<=a||t>s)&&(l=2*Math.max(t,s)),(a<s||r>a)&&(o=2*Math.max(r,a)),this.resize(l,o),this.packOne(t,r)):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},"object"==typeof r&&void 0!==e?e.exports=i():n.ShelfPack=i()},{}],502:[function(t,e,r){"use strict";e.exports=function(t){return t<0?-1:t>0?1:0}},{}],503:[function(t,e,r){"use strict";e.exports=function(t){return i(n(t))};var n=t("boundary-cells"),i=t("reduce-simplicial-complex")},{"boundary-cells":74,"reduce-simplicial-complex":480}],504:[function(t,e,r){"use strict";e.exports=function(t,e,r,s){r=r||0,void 0===s&&(s=function(t){for(var e=t.length,r=0,n=0;n<e;++n)r=0|Math.max(r,t[n].length);return r-1}(t));if(0===t.length||s<1)return{cells:[],vertexIds:[],vertexWeights:[]};var l=function(t,e){for(var r=t.length,n=i.mallocUint8(r),a=0;a<r;++a)n[a]=t[a]<e|0;return n}(e,+r),c=function(t,e){for(var r=t.length,o=e*(e+1)/2*r|0,s=i.mallocUint32(2*o),l=0,c=0;c<r;++c)for(var u=t[c],e=u.length,f=0;f<e;++f)for(var h=0;h<f;++h){var d=u[h],p=u[f];s[l++]=0|Math.min(d,p),s[l++]=0|Math.max(d,p)}a(n(s,[l/2|0,2]));for(var m=2,c=2;c<l;c+=2)s[c-2]===s[c]&&s[c-1]===s[c+1]||(s[m++]=s[c],s[m++]=s[c+1]);return n(s,[m/2|0,2])}(t,s),u=function(t,e,r,a){for(var o=t.data,s=t.shape[0],l=i.mallocDouble(s),c=0,u=0;u<s;++u){var f=o[2*u],h=o[2*u+1];if(r[f]!==r[h]){var d=e[f],p=e[h];o[2*c]=f,o[2*c+1]=h,l[c++]=(p-a)/(p-d)}}return t.shape[0]=c,n(l,[c])}(c,e,l,+r),f=function(t,e){var r=i.mallocInt32(2*e),n=t.shape[0],a=t.data;r[0]=0;for(var o=0,s=0;s<n;++s){var l=a[2*s];if(l!==o){for(r[2*o+1]=s;++o<l;)r[2*o]=s,r[2*o+1]=s;r[2*o]=s}}r[2*o+1]=n;for(;++o<e;)r[2*o]=r[2*o+1]=n;return r}(c,0|e.length),h=o(s)(t,c.data,f,l),d=function(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}(c),p=[].slice.call(u.data,0,u.shape[0]);return i.free(l),i.free(c.data),i.free(u.data),i.free(f),{cells:h,vertexIds:d,vertexWeights:p}};var n=t("ndarray"),i=t("typedarray-pool"),a=t("ndarray-sort"),o=t("./lib/codegen")},{"./lib/codegen":505,ndarray:439,"ndarray-sort":437,"typedarray-pool":534}],505:[function(t,e,r){"use strict";e.exports=function(t){var e=a[t];e||(e=a[t]=function(t){var e=0,r=new Array(t+1);r[0]=[[]];for(var a=1;a<=t;++a)for(var o=r[a]=i(a),s=0;s<o.length;++s)e=Math.max(e,o[a].length);var l=["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;"];function c(t){if(!(t.length<=0)){l.push("R.push(");for(var e=0;e<t.length;++e){var r=t[e];e>0&&l.push(","),l.push("[");for(var n=0;n<r.length;++n){var i=r[n];n>0&&l.push(","),l.push("B(C,E,c[",i[0],"],c[",i[1],"])")}l.push("]")}l.push(");")}}for(var a=t+1;a>1;--a){a<t+1&&l.push("else "),l.push("if(l===",a,"){");for(var u=[],s=0;s<a;++s)u.push("(S[c["+s+"]]<<"+s+")");l.push("var M=",u.join("+"),";if(M===0||M===",(1<<a)-1,"){continue}switch(M){");for(var o=r[a-1],s=0;s<o.length;++s)l.push("case ",s,":"),c(o[s]),l.push("break;");l.push("}}")}return l.push("}return R;};return getContour",t,"d"),new Function("pool",l.join(""))(n)}(t));return e};var n=t("typedarray-pool"),i=t("marching-simplex-table"),a={}},{"marching-simplex-table":417,"typedarray-pool":534}],506:[function(t,e,r){"use strict";"use restrict";var n=t("bit-twiddle"),i=t("union-find");function a(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:return(s=t[0]+t[1]-e[0]-e[1])||i(t[0],t[1])-i(e[0],e[1]);case 3:var a=t[0]+t[1],o=e[0]+e[1];if(s=a+t[2]-(o+e[2]))return s;var s,l=i(t[0],t[1]),c=i(e[0],e[1]);return(s=i(l,t[2])-i(c,e[2]))||i(l+t[2],a)-i(c+e[2],o);default:var u=t.slice(0);u.sort();var f=e.slice(0);f.sort();for(var h=0;h<r;++h)if(n=u[h]-f[h])return n;return 0}}function o(t,e){return a(t[0],e[0])}function s(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(o);for(i=0;i<r;++i)t[i]=n[i][0],e[i]=n[i][1];return t}return t.sort(a),t}function l(t){if(0===t.length)return[];for(var e=1,r=t.length,n=1;n<r;++n){var i=t[n];if(a(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 o=r+n>>1,s=a(t[o],e);s<=0?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i}function u(t,e){for(var r=new Array(t.length),i=0,o=r.length;i<o;++i)r[i]=[];for(var s=[],l=(i=0,e.length);i<l;++i)for(var u=e[i],f=u.length,h=1,d=1<<f;h<d;++h){s.length=n.popCount(h);for(var p=0,m=0;m<f;++m)h&1<<m&&(s[p++]=u[m]);var v=c(t,s);if(!(v<0))for(;r[v++].push(i),!(v>=t.length||0!==a(t[v],s)););}return r}function f(t,e){if(e<0)return[];for(var r=[],i=(1<<e+1)-1,a=0;a<t.length;++a)for(var o=t[a],l=i;l<1<<o.length;l=n.nextCombination(l)){for(var c=new Array(e+1),u=0,f=0;f<o.length;++f)l&1<<f&&(c[u++]=o[f]);r.push(c)}return s(r)}r.dimension=function(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},r.countVertices=function(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},r.cloneCells=function(t){for(var e=new Array(t.length),r=0,n=t.length;r<n;++r)e[r]=t[r].slice(0);return e},r.compareCells=a,r.normalize=s,r.unique=l,r.findCell=c,r.incidence=u,r.dual=function(t,e){if(!e)return u(l(f(t,0)),t);for(var r=new Array(e),n=0;n<e;++n)r[n]=[];n=0;for(var 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},r.explode=function(t){for(var e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0|i.length,o=1,l=1<<a;o<l;++o){for(var c=[],u=0;u<a;++u)o>>>u&1&&c.push(i[u]);e.push(c)}return s(e)},r.skeleton=f,r.boundary=function(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 l=new Array(i.length-1),c=0,u=0;c<o;++c)c!==a&&(l[u++]=i[c]);e.push(l)}return s(e)},r.connectedComponents=function(t,e){return e?function(t,e){for(var r=new i(e),n=0;n<t.length;++n)for(var a=t[n],o=0;o<a.length;++o)for(var s=o+1;s<a.length;++s)r.link(a[o],a[s]);var l=[],c=r.ranks;for(n=0;n<c.length;++n)c[n]=-1;for(n=0;n<t.length;++n){var u=r.find(t[n][0]);c[u]<0?(c[u]=l.length,l.push([t[n].slice(0)])):l[c[u]].push(t[n].slice(0))}return l}(t,e):function(t){for(var e=l(s(f(t,0))),r=new i(e.length),n=0;n<t.length;++n)for(var a=t[n],o=0;o<a.length;++o)for(var u=c(e,[a[o]]),h=o+1;h<a.length;++h)r.link(u,c(e,[a[h]]));var d=[],p=r.ranks;for(n=0;n<p.length;++n)p[n]=-1;for(n=0;n<t.length;++n){var m=r.find(c(e,[t[n][0]]));p[m]<0?(p[m]=d.length,d.push([t[n].slice(0)])):d[p[m]].push(t[n].slice(0))}return d}(t)}},{"bit-twiddle":71,"union-find":535}],507:[function(t,e,r){arguments[4][71][0].apply(r,arguments)},{dup:71}],508:[function(t,e,r){arguments[4][506][0].apply(r,arguments)},{"bit-twiddle":507,dup:506,"union-find":509}],509:[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])}}},{}],510:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var a=e.length,o=t.length,s=new Array(a),l=new Array(a),c=new Array(a),u=new Array(a),f=0;f<a;++f)s[f]=l[f]=-1,c[f]=1/0,u[f]=!1;for(var f=0;f<o;++f){var h=t[f];if(2!==h.length)throw new Error("Input must be a graph");var d=h[1],p=h[0];-1!==l[p]?l[p]=-2:l[p]=d,-1!==s[d]?s[d]=-2:s[d]=p}function m(t){if(u[t])return 1/0;var r,i,a,o,c,f=s[t],h=l[t];return f<0||h<0?1/0:(r=e[t],i=e[f],a=e[h],o=Math.abs(n(r,i,a)),c=Math.sqrt(Math.pow(i[0]-a[0],2)+Math.pow(i[1]-a[1],2)),o/c)}function v(t,e){var r=k[t],n=k[e];k[t]=n,k[e]=r,A[r]=e,A[n]=t}function g(t){return c[k[t]]}function y(t){return 1&t?t-1>>1:(t>>1)-1}function b(t){for(var e=g(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n<E){var o=g(n);o<r&&(a=n,r=o)}if(i<E){var s=g(i);s<r&&(a=i)}if(a===t)return t;v(t,a),t=a}}function x(t){for(var e=g(t);t>0;){var r=y(t);if(r>=0){var n=g(r);if(e<n){v(t,r),t=r;continue}}return t}}function _(){if(E>0){var t=k[0];return v(0,E-1),E-=1,b(0),t}return-1}function w(t,e){var r=k[t];return c[r]===e?t:(c[r]=-1/0,x(t),_(),c[r]=e,x((E+=1)-1))}function M(t){if(!u[t]){u[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),A[e]>=0&&w(A[e],m(e)),A[r]>=0&&w(A[r],m(r))}}for(var k=[],A=new Array(a),f=0;f<a;++f){var T=c[f]=m(f);T<1/0?(A[f]=k.length,k.push(f)):A[f]=-1}for(var E=k.length,f=E>>1;f>=0;--f)b(f);for(;;){var S=_();if(S<0||c[S]>r)break;M(S)}for(var L=[],f=0;f<a;++f)u[f]||(A[f]=L.length,L.push(e[f].slice()));L.length;function C(t,e){if(t[e]<0)return e;var r=e,n=e;do{var i=t[n];if(!u[n]||i<0||i===n)break;if(i=t[n=i],!u[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}var P=[];return t.forEach(function(t){var e=C(s,t[0]),r=C(l,t[1]);if(e>=0&&r>=0&&e!==r){var n=A[e],i=A[r];n!==i&&P.push([n,i])}}),i.unique(i.normalize(P)),{positions:L,edges:P}};var n=t("robust-orientation"),i=t("simplicial-complex")},{"robust-orientation":495,"simplicial-complex":508}],511:[function(t,e,r){"use strict";e.exports=function(t,e){var r,a,o,s;if(e[0][0]<e[1][0])r=e[0],a=e[1];else{if(!(e[0][0]>e[1][0]))return i(e,t);r=e[1],a=e[0]}if(t[0][0]<t[1][0])o=t[0],s=t[1];else{if(!(t[0][0]>t[1][0]))return-i(t,e);o=t[1],s=t[0]}var l=n(r,a,s),c=n(r,a,o);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=n(s,o,a),c=n(s,o,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return a[0]-s[0]};var n=t("robust-orientation");function i(t,e){var r,i,a,o;if(e[0][0]<e[1][0])r=e[0],i=e[1];else{if(!(e[0][0]>e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),c=Math.min(e[0][1],e[1][1]),u=Math.max(e[0][1],e[1][1]);return l<c?l-c:s>u?s-u:l-u}r=e[1],i=e[0]}t[0][1]<t[1][1]?(a=t[0],o=t[1]):(a=t[1],o=t[0]);var f=n(i,r,a);return f||((f=n(i,r,o))||o-i)}},{"robust-orientation":495}],512:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.length,r=2*e,n=new Array(r),a=0;a<e;++a){var l=t[a],c=l[0][0]<l[1][0];n[2*a]=new f(l[0][0],l,c,a),n[2*a+1]=new f(l[1][0],l,!c,a)}n.sort(function(t,e){var r=t.x-e.x;return r||((r=t.create-e.create)||Math.min(t.segment[0][1],t.segment[1][1])-Math.min(e.segment[0][1],e.segment[1][1]))});for(var h=i(o),d=[],p=[],m=[],a=0;a<r;){for(var v=n[a].x,g=[];a<r;){var y=n[a];if(y.x!==v)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]?(g.push(new u(y.segment[0][1],y.index,!0,!0)),g.push(new u(y.segment[1][1],y.index,!1,!1))):(g.push(new u(y.segment[1][1],y.index,!0,!1)),g.push(new u(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(v),m.push(g)}return new s(d,p,m)};var n=t("binary-search-bounds"),i=t("functional-red-black-tree"),a=t("robust-orientation"),o=t("./lib/order-segments");function s(t,e,r){this.slabs=t,this.coordinates=e,this.horizontal=r}function l(t,e){return t.y-e}function c(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=a(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{if(l=c(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=c(t.right,e))return l;t=t.left}}return r}function u(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function f(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=c(this.slabs[e],t),i=-1;if(r&&(i=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var u=c(this.slabs[e-1],t);u&&(s?o(u.key,s)>0&&(s=u.key,i=u.value):(i=u.value,s=u.key))}var f=this.horizontal[e];if(f.length>0){var h=n.ge(f,t[1],l);if(h<f.length){var d=f[h];if(t[1]===d.y){if(d.closed)return d.index;for(;h<f.length-1&&f[h+1].y===t[1];)if((d=f[h+=1]).closed)return d.index;if(d.y===t[1]&&!d.start){if((h+=1)>=f.length)return i;d=f[h]}}if(d.start)if(s){var p=a(s[0],s[1],[t[0],d.y]);s[0][0]>s[1][0]&&(p=-p),p>0&&(i=d.index)}else i=d.index;else d.y!==t[1]&&(i=d.index)}}}return i}},{"./lib/order-segments":511,"binary-search-bounds":70,"functional-red-black-tree":144,"robust-orientation":495}],513:[function(t,e,r){"use strict";e.exports=function(t,e,r,f,h){h<=4*n?i(0,h-1,t,e,r,f):function t(e,r,f,h,d,p){var m=(r-e+1)/6|0,v=e+m,g=r-m,y=e+r>>1,b=y-m,x=y+m,_=v,w=b,M=y,k=x,A=g,T=e+1,E=r-1,S=0;c(_,w,f,h,d)&&(S=_,_=w,w=S);c(k,A,f,h,d)&&(S=k,k=A,A=S);c(_,M,f,h,d)&&(S=_,_=M,M=S);c(w,M,f,h,d)&&(S=w,w=M,M=S);c(_,k,f,h,d)&&(S=_,_=k,k=S);c(M,k,f,h,d)&&(S=M,M=k,k=S);c(w,A,f,h,d)&&(S=w,w=A,A=S);c(w,M,f,h,d)&&(S=w,w=M,M=S);c(k,A,f,h,d)&&(S=k,k=A,A=S);var L=f[w];var C=h[2*w];var P=h[2*w+1];var z=d[w];var O=p[w];var D=f[k];var I=h[2*k];var R=h[2*k+1];var N=d[k];var F=p[k];var j=_;var B=M;var U=A;var V=v;var q=y;var H=g;var G=f[j];var Y=f[B];var W=f[U];f[V]=G;f[q]=Y;f[H]=W;for(var X=0;X<2;++X){var Z=h[2*j+X],J=h[2*B+X],K=h[2*U+X];h[2*V+X]=Z,h[2*q+X]=J,h[2*H+X]=K}var Q=d[j];var $=d[B];var tt=d[U];d[V]=Q;d[q]=$;d[H]=tt;var et=p[j];var rt=p[B];var nt=p[U];p[V]=et;p[q]=rt;p[H]=nt;o(b,e,f,h,d,p);o(x,r,f,h,d,p);for(var it=T;it<=E;++it)if(u(it,L,C,P,z,f,h,d))it!==T&&a(it,T,f,h,d,p),++T;else if(!u(it,D,I,R,N,f,h,d))for(;;){if(u(E,D,I,R,N,f,h,d)){u(E,L,C,P,z,f,h,d)?(s(it,T,E,f,h,d,p),++T,--E):(a(it,E,f,h,d,p),--E);break}if(--E<it)break}l(e,T-1,L,C,P,z,O,f,h,d,p);l(r,E+1,D,I,R,N,F,f,h,d,p);T-2-e<=n?i(e,T-2,f,h,d,p):t(e,T-2,f,h,d,p);r-(E+2)<=n?i(E+2,r,f,h,d,p):t(E+2,r,f,h,d,p);E-T<=n?i(T,E,f,h,d,p):t(T,E,f,h,d,p)}(0,h-1,t,e,r,f)};var n=32;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],c=n[2*o+1],u=i[o],f=a[o],h=o;h>t;){var d=r[h-1],p=n[2*(h-1)];if((d-s||l-p)>=0)break;r[h]=d,n[2*h]=p,n[2*h+1]=n[2*h-1],i[h]=i[h-1],a[h]=a[h-1],h-=1}r[h]=s,n[2*h]=l,n[2*h+1]=c,i[h]=u,a[h]=f}}function a(t,e,r,n,i,a){var o=r[t],s=n[2*t],l=n[2*t+1],c=i[t],u=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]=c,a[e]=u}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],c=i[2*t+1],u=a[t],f=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]=c,a[r]=u,o[r]=f}function l(t,e,r,n,i,a,o,s,l,c,u){s[t]=s[e],l[2*t]=l[2*e],l[2*t+1]=l[2*e+1],c[t]=c[e],u[t]=u[e],s[e]=r,l[2*e]=n,l[2*e+1]=i,c[e]=a,u[e]=o}function c(t,e,r,n,i){return(r[t]-r[e]||n[2*e]-n[2*t]||i[t]-i[e])<0}function u(t,e,r,n,i,a,o,s){return(e-a[t]||o[2*t]-r||i-s[t])<0}},{}],514:[function(t,e,r){"use strict";var n=t("./lib/sort"),i=t("array-bounds");function a(t,e,r,n,i,a,o,s){for(var l=r,c=r;c<n;++c){var u=t[2*c],f=t[2*c+1],h=e[c];i<=u&&u<=o&&a<=f&&f<=s&&(c===l?l+=1:(t[2*c]=t[2*l],t[2*c+1]=t[2*l+1],e[c]=e[l],t[2*l]=u,t[2*l+1]=f,e[l]=h,l+=1))}return l}function o(t,e,r){this.pixelSize=t,this.offset=e,this.count=r}e.exports=function(t,e,r,s){var l=t.length>>>1;if(l<1)return[];e||(e=Array(l));r||(r=Array(l));s||(s=[]);for(var c=0;c<l;++c)e[c]=c;if(!s.length||s.length<4||s[0]>=s[2]||s[1]>=s[3]){var u=i(t,2);u[0]===u[2]&&(u[2]+=1),u[1]===u[3]&&(u[3]+=1),s[0]=u[0],s[1]=u[1],s[2]=u[2],s[3]=u[3]}var f=s[0],h=s[1],d=s[2],p=s[3],m=1/(d-f),v=1/(p-h),g=Math.max(d-f,p-h),y=new Int32Array(l),b=0;(function n(i,o,s,l,c,u){var f=.5*s;var h=l+1;var d=c-l;r[b]=d;y[b++]=u;for(var p=0;p<2;++p)for(var m=0;m<2;++m){var v=i+p*f,g=o+m*f,x=a(t,e,h,c,v,g,v+f,g+f);if(x!==h){if(x-h>=Math.max(.9*d,32)){var _=c+l>>>1;n(v,g,f,h,_,u+1),h=_}n(v,g,f,h,x,u+1),h=x}}})(f,h,g,0,l,0),n(y,t,e,r,l);for(var x=[],_=0,w=l,b=l-1;b>=0;--b){t[2*b]=(t[2*b]-f)*m,t[2*b+1]=(t[2*b+1]-h)*v;var M=y[b];M!==_&&(x.push(new o(g*Math.pow(.5,M),b+1,w-(b+1))),w=b+1,_=M)}return x.push(new o(g*Math.pow(.5,M+1),0,w)),x}},{"./lib/sort":513,"array-bounds":48}],515:[function(t,e,r){"use strict";var n=t("robust-dot-product"),i=t("robust-sum");function a(t,e){var r=i(n(t,e),[e[e.length-1]]);return r[r.length-1]}function o(t,e,r,n){var i=-e/(n-e);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=t.length,s=new Array(o),l=0;l<o;++l)s[l]=i*t[l]+a*r[l];return s}e.exports=function(t,e){for(var r=[],n=[],i=a(t[t.length-1],e),s=t[t.length-1],l=t[0],c=0;c<t.length;++c,s=l){var u=a(l=t[c],e);if(i<0&&u>0||i>0&&u<0){var f=o(s,u,l,i);r.push(f),n.push(f.slice())}u<0?n.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=u}return{positive:r,negative:n}},e.exports.positive=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l<t.length;++l,i=s){var c=a(s=t[l],e);(n<0&&c>0||n>0&&c<0)&&r.push(o(i,c,s,n)),c>=0&&r.push(s.slice()),n=c}return r},e.exports.negative=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l<t.length;++l,i=s){var c=a(s=t[l],e);(n<0&&c>0||n>0&&c<0)&&r.push(o(i,c,s,n)),c<=0&&r.push(s.slice()),n=c}return r}},{"robust-dot-product":492,"robust-sum":500}],516:[function(t,e,r){!function(){"use strict";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};function e(r){return function(r,n){var i,a,o,s,l,c,u,f,h,d=1,p=r.length,m="";for(a=0;a<p;a++)if("string"==typeof r[a])m+=r[a];else if(Array.isArray(r[a])){if((s=r[a])[2])for(i=n[d],o=0;o<s[2].length;o++){if(!i.hasOwnProperty(s[2][o]))throw new Error(e('[sprintf] property "%s" does not exist',s[2][o]));i=i[s[2][o]]}else i=s[1]?n[s[1]]:n[d++];if(t.not_type.test(s[8])&&t.not_primitive.test(s[8])&&i instanceof Function&&(i=i()),t.numeric_arg.test(s[8])&&"number"!=typeof i&&isNaN(i))throw new TypeError(e("[sprintf] expecting number but found %T",i));switch(t.number.test(s[8])&&(f=i>=0),s[8]){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,s[6]?parseInt(s[6]):0);break;case"e":i=s[7]?parseFloat(i).toExponential(s[7]):parseFloat(i).toExponential();break;case"f":i=s[7]?parseFloat(i).toFixed(s[7]):parseFloat(i);break;case"g":i=s[7]?String(Number(i.toPrecision(s[7]))):parseFloat(i);break;case"o":i=(parseInt(i,10)>>>0).toString(8);break;case"s":i=String(i),i=s[7]?i.substring(0,s[7]):i;break;case"t":i=String(!!i),i=s[7]?i.substring(0,s[7]):i;break;case"T":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=s[7]?i.substring(0,s[7]):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=s[7]?i.substring(0,s[7]):i;break;case"x":i=(parseInt(i,10)>>>0).toString(16);break;case"X":i=(parseInt(i,10)>>>0).toString(16).toUpperCase()}t.json.test(s[8])?m+=i:(!t.number.test(s[8])||f&&!s[3]?h="":(h=f?"+":"-",i=i.toString().replace(t.sign,"")),c=s[4]?"0"===s[4]?"0":s[4].charAt(1):" ",u=s[6]-(h+i).length,l=s[6]&&u>0?c.repeat(u):"",m+=s[5]?h+i+l:"0"===c?h+l+i:l+h+i)}return m}(function(e){if(i[e])return i[e];var r,n=e,a=[],o=0;for(;n;){if(null!==(r=t.text.exec(n)))a.push(r[0]);else if(null!==(r=t.modulo.exec(n)))a.push("%");else{if(null===(r=t.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){o|=1;var s=[],l=r[2],c=[];if(null===(c=t.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(c[1]);""!==(l=l.substring(c[0].length));)if(null!==(c=t.key_access.exec(l)))s.push(c[1]);else{if(null===(c=t.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(c[1])}r[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");a.push(r)}n=n.substring(r[0].length)}return i[e]=a}(r),arguments)}function n(t,r){return e.apply(null,[t].concat(r||[]))}var i=Object.create(null);void 0!==r&&(r.sprintf=e,r.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=n)}()},{}],517:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.length,r=new Array(e),n=new Array(e),i=new Array(e),a=new Array(e),o=new Array(e),s=new Array(e),l=0;l<e;++l)r[l]=-1,n[l]=0,i[l]=!1,a[l]=0,o[l]=-1,s[l]=[];var c,u=0,f=[],h=[];function d(e){var l=[e],c=[e];for(r[e]=n[e]=u,i[e]=!0,u+=1;c.length>0;){e=c[c.length-1];var d=t[e];if(a[e]<d.length){for(var p=a[e];p<d.length;++p){var m=d[p];if(r[m]<0){r[m]=n[m]=u,i[m]=!0,u+=1,l.push(m),c.push(m);break}i[m]&&(n[e]=0|Math.min(n[e],n[m])),o[m]>=0&&s[e].push(o[m])}a[e]=p}else{if(n[e]===r[e]){for(var v=[],g=[],y=0,p=l.length-1;p>=0;--p){var b=l[p];if(i[b]=!1,v.push(b),g.push(s[b]),y+=s[b].length,o[b]=f.length,b===e){l.length=p;break}}f.push(v);for(var x=new Array(y),p=0;p<g.length;p++)for(var _=0;_<g[p].length;_++)x[--y]=g[p][_];h.push(x)}c.pop()}}}for(var l=0;l<e;++l)r[l]<0&&d(l);for(var l=0;l<h.length;l++){var p=h[l];if(0!==p.length){p.sort(function(t,e){return t-e}),c=[p[0]];for(var m=1;m<p.length;m++)p[m]!==p[m-1]&&c.push(p[m]);h[l]=c}}return{components:f,adjacencyList:h}}},{}],518:[function(t,e,r){"use strict";var n=t("kdbush");function i(t){this.options=f(Object.create(this.options),t),this.trees=new Array(this.options.maxZoom+1)}function a(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:n,properties:i,parentId:-1,numPoints:r}}function o(t,e){var r=t.geometry.coordinates;return{x:c(r[0]),y:u(r[1]),zoom:1/0,id:e,parentId:-1}}function s(t){return{type:"Feature",properties:l(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}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 f(f({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function c(t){return t/360+.5}function u(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 f(t,e){for(var r in e)t[r]=e[r];return t}function h(t){return t.x}function d(t){return t.y}e.exports=function(t){return new i(t)},i.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,initial:function(){return{}},map:function(t){return t}},load:function(t){var e=this.options.log;e&&console.time("total time");var r="prepare "+t.length+" points";e&&console.time(r),this.points=t;var i=t.map(o);e&&console.timeEnd(r);for(var a=this.options.maxZoom;a>=this.options.minZoom;a--){var s=+Date.now();this.trees[a+1]=n(i,h,d,this.options.nodeSize,Float32Array),i=this._cluster(i,a),e&&console.log("z%d: %d clusters in %dms",a,i.length,+Date.now()-s)}return this.trees[this.options.minZoom]=n(i,h,d,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(c(t[0]),u(t[3]),c(t[2]),u(t[1])),i=[],a=0;a<n.length;a++){var o=r.points[n[a]];i.push(o.numPoints?s(o):this.points[o.id])}return i},getChildren:function(t,e){for(var r=this.trees[e+1].points[t],n=this.options.radius/(this.options.extent*Math.pow(2,e)),i=this.trees[e+1].within(r.x,r.y,n),a=[],o=0;o<i.length;o++){var l=this.trees[e+1].points[i[o]];l.parentId===t&&a.push(l.numPoints?s(l):this.points[l.id])}return a},getLeaves:function(t,e,r,n){r=r||10,n=n||0;var i=[];return this._appendLeaves(i,t,e,r,n,0),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/a,s=(r-o)/i,l=(r+1+o)/i,c={features:[]};return this._addTileFeatures(n.range((e-o)/i,s,(e+1+o)/i,l),n.points,e,r,i,c),0===e&&this._addTileFeatures(n.range(1-o/i,s,1,l),n.points,i,r,i,c),e===i-1&&this._addTileFeatures(n.range(0,s,o/i,l),n.points,-1,r,i,c),c.features.length?c:null},getClusterExpansionZoom:function(t,e){for(;e<this.options.maxZoom;){var r=this.getChildren(t,e);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e},_appendLeaves:function(t,e,r,n,i,a){for(var o=this.getChildren(e,r),s=0;s<o.length;s++){var l=o[s].properties;if(l.cluster?a+l.point_count<=i?a+=l.point_count:a=this._appendLeaves(t,l.cluster_id,r+1,n,i,a):a<i?a++:t.push(o[s]),t.length===n)break}return a},_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.numPoints?l(s):this.points[s.id].properties})}},_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;var s=this.trees[e+1],l=s.within(o.x,o.y,n),c=o.numPoints||1,u=o.x*c,f=o.y*c,h=null;this.options.reduce&&(h=this.options.initial(),this._accumulate(h,o));for(var d=0;d<l.length;d++){var p=s.points[l[d]];if(e<p.zoom){var m=p.numPoints||1;p.zoom=e,u+=p.x*m,f+=p.y*m,c+=m,p.parentId=i,this.options.reduce&&this._accumulate(h,p)}}1===c?r.push(o):(o.parentId=i,r.push(a(u/c,f/c,c,i,h)))}}return r},_accumulate:function(t,e){var r=e.numPoints?e.properties:this.options.map(this.points[e.id].properties);this.options.reduce(t,r)}}},{kdbush:268}],519:[function(t,e,r){"use strict";e.exports=function(t){return t.split("").map(function(t){return t in n?n[t]:""}).join("")};var n={" ":" ",0:"\u2070",1:"\xb9",2:"\xb2",3:"\xb3",4:"\u2074",5:"\u2075",6:"\u2076",7:"\u2077",8:"\u2078",9:"\u2079","+":"\u207a","-":"\u207b",a:"\u1d43",b:"\u1d47",c:"\u1d9c",d:"\u1d48",e:"\u1d49",f:"\u1da0",g:"\u1d4d",h:"\u02b0",i:"\u2071",j:"\u02b2",k:"\u1d4f",l:"\u02e1",m:"\u1d50",n:"\u207f",o:"\u1d52",p:"\u1d56",r:"\u02b3",s:"\u02e2",t:"\u1d57",u:"\u1d58",v:"\u1d5b",w:"\u02b7",x:"\u02e3",y:"\u02b8",z:"\u1dbb"}},{}],520:[function(t,e,r){"use strict";e.exports=function(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return function(t,e){for(var r=a(t,e),n=r.length,i=new Array(n),o=new Array(n),s=0;s<n;++s)i[s]=[r[s]],o[s]=[s];return{positions:i,cells:o}}(t,e);var r=t.order.join()+"-"+t.dtype,s=o[r],e=+e||0;s||(s=o[r]=function(t,e){var r=t.length,a=["'use strict';"],o="surfaceNets"+t.join("_")+"d"+e;a.push("var contour=genContour({","order:[",t.join(),"],","scalarArguments: 3,","phase:function phaseFunc(p,a,b,c) { return (p > c)|0 },"),"generic"===e&&a.push("getters:[0],");for(var s=[],l=[],c=0;c<r;++c)s.push("d"+c),l.push("d"+c);for(var c=0;c<1<<r;++c)s.push("v"+c),l.push("v"+c);for(var c=0;c<1<<r;++c)s.push("p"+c),l.push("p"+c);s.push("a","b","c"),l.push("a","c"),a.push("vertex:function vertexFunc(",s.join(),"){");for(var u=[],c=0;c<1<<r;++c)u.push("(p"+c+"<<"+c+")");a.push("var m=(",u.join("+"),")|0;if(m===0||m===",(1<<(1<<r))-1,"){return}");var f=[],h=[];1<<(1<<r)<=128?(a.push("switch(m){"),h=a):a.push("switch(m>>>7){");for(var c=0;c<1<<(1<<r);++c){if(1<<(1<<r)>128&&c%128==0){f.length>0&&h.push("}}");var d="vExtra"+f.length;a.push("case ",c>>>7,":",d,"(m&0x7f,",l.join(),");break;"),h=["function ",d,"(m,",l.join(),"){switch(m){"],f.push(h)}h.push("case ",127&c,":");for(var p=new Array(r),m=new Array(r),v=new Array(r),g=new Array(r),y=0,b=0;b<r;++b)p[b]=[],m[b]=[],v[b]=0,g[b]=0;for(var b=0;b<1<<r;++b)for(var x=0;x<r;++x){var _=b^1<<x;if(!(_>b)&&!(c&1<<_)!=!(c&1<<b)){var w=1;c&1<<_?m[x].push("v"+_+"-v"+b):(m[x].push("v"+b+"-v"+_),w=-w),w<0?(p[x].push("-v"+b+"-v"+_),v[x]+=2):(p[x].push("v"+b+"+v"+_),v[x]-=2),y+=1;for(var M=0;M<r;++M)M!==x&&(_&1<<M?g[M]+=1:g[M]-=1)}}for(var k=[],x=0;x<r;++x)if(0===p[x].length)k.push("d"+x+"-0.5");else{var A="";v[x]<0?A=v[x]+"*c":v[x]>0&&(A="+"+v[x]+"*c");var T=p[x].length/y*.5,E=.5+g[x]/y*.5;k.push("d"+x+"-"+E+"-"+T+"*("+p[x].join("+")+A+")/("+m[x].join("+")+")")}h.push("a.push([",k.join(),"]);","break;")}a.push("}},"),f.length>0&&h.push("}}");for(var S=[],c=0;c<1<<r-1;++c)S.push("v"+c);S.push("c0","c1","p0","p1","a","b","c"),a.push("cell:function cellFunc(",S.join(),"){");var L=i(r-1);a.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 ",o,"(array,level){var verts=[],cells=[];contour(array,verts,cells,level);return {positions:verts,cells:cells};} return ",o,";");for(var c=0;c<f.length;++c)a.push(f[c].join(""));return new Function("genContour",a.join(""))(n)}(t.order,t.dtype));return s(t,e)};var n=t("ndarray-extract-contour"),i=t("triangulate-hypercube"),a=t("zero-crossings");var o={}},{"ndarray-extract-contour":428,"triangulate-hypercube":530,"zero-crossings":578}],521:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){i=!0,a=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw a}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=2*Math.PI,a=function(t,e,r,n,i,a,o){var s=t.x,l=t.y;return{x:n*(s*=e)-i*(l*=r)+a,y:i*s+n*l+o}},o=function(t,e){var r=4/3*Math.tan(e/4),n=Math.cos(t),i=Math.sin(t),a=Math.cos(t+e),o=Math.sin(t+e);return[{x:n-i*r,y:i+n*r},{x:a+o*r,y:o-a*r},{x:a,y:o}]},s=function(t,e,r,n){var i=t*n-e*r<0?-1:1,a=(t*r+e*n)/(Math.sqrt(t*t+e*e)*Math.sqrt(t*t+e*e));return a>1&&(a=1),a<-1&&(a=-1),i*Math.acos(a)};r.default=function(t){var e=t.px,r=t.py,l=t.cx,c=t.cy,u=t.rx,f=t.ry,h=t.xAxisRotation,d=void 0===h?0:h,p=t.largeArcFlag,m=void 0===p?0:p,v=t.sweepFlag,g=void 0===v?0:v,y=[];if(0===u||0===f)return[];var b=Math.sin(d*i/360),x=Math.cos(d*i/360),_=x*(e-l)/2+b*(r-c)/2,w=-b*(e-l)/2+x*(r-c)/2;if(0===_&&0===w)return[];u=Math.abs(u),f=Math.abs(f);var M=Math.pow(_,2)/Math.pow(u,2)+Math.pow(w,2)/Math.pow(f,2);M>1&&(u*=Math.sqrt(M),f*=Math.sqrt(M));var k=function(t,e,r,n,a,o,l,c,u,f,h,d){var p=Math.pow(a,2),m=Math.pow(o,2),v=Math.pow(h,2),g=Math.pow(d,2),y=p*m-p*g-m*v;y<0&&(y=0),y/=p*g+m*v;var b=(y=Math.sqrt(y)*(l===c?-1:1))*a/o*d,x=y*-o/a*h,_=f*b-u*x+(t+r)/2,w=u*b+f*x+(e+n)/2,M=(h-b)/a,k=(d-x)/o,A=(-h-b)/a,T=(-d-x)/o,E=s(1,0,M,k),S=s(M,k,A,T);return 0===c&&S>0&&(S-=i),1===c&&S<0&&(S+=i),[_,w,E,S]}(e,r,l,c,u,f,m,g,b,x,_,w),A=n(k,4),T=A[0],E=A[1],S=A[2],L=A[3],C=Math.max(Math.ceil(Math.abs(L)/(i/4)),1);L/=C;for(var P=0;P<C;P++)y.push(o(S,L)),S+=L;return y.map(function(t){var e=a(t[0],u,f,x,b,T,E),r=e.x,n=e.y,i=a(t[1],u,f,x,b,T,E),o=i.x,s=i.y,l=a(t[2],u,f,x,b,T,E);return{x1:r,y1:n,x2:o,y2:s,x:l.x,y:l.y}})},e.exports=r.default},{}],522:[function(t,e,r){"use strict";var n=t("parse-svg-path"),i=t("abs-svg-path"),a=t("normalize-svg-path"),o=t("is-svg-path"),s=t("assert");e.exports=function(t){Array.isArray(t)&&1===t.length&&"string"==typeof t[0]&&(t=t[0]);"string"==typeof t&&(s(o(t),"String is not an SVG path."),t=n(t));if(s(Array.isArray(t),"Argument should be a string or an array of path segments."),t=i(t),!(t=a(t)).length)return[0,0,0,0];for(var e=[1/0,1/0,-1/0,-1/0],r=0,l=t.length;r<l;r++)for(var c=t[r].slice(1),u=0;u<c.length;u+=2)c[u+0]<e[0]&&(e[0]=c[u+0]),c[u+1]<e[1]&&(e[1]=c[u+1]),c[u+0]>e[2]&&(e[2]=c[u+0]),c[u+1]>e[3]&&(e[3]=c[u+1]);return e}},{"abs-svg-path":43,assert:51,"is-svg-path":267,"normalize-svg-path":523,"parse-svg-path":447}],523:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=[],o=0,s=0,l=0,c=0,u=null,f=null,h=0,d=0,p=0,m=t.length;p<m;p++){var v=t[p],g=v[0];switch(g){case"M":l=v[1],c=v[2];break;case"A":var y=n({px:h,py:d,cx:v[6],cy:v[7],rx:v[1],ry:v[2],xAxisRotation:v[3],largeArcFlag:v[4],sweepFlag:v[5]});if(!y.length)continue;for(var b,x=0;x<y.length;x++)b=y[x],v=["C",b.x1,b.y1,b.x2,b.y2,b.x,b.y],x<y.length-1&&r.push(v);break;case"S":var _=h,w=d;"C"!=e&&"S"!=e||(_+=_-o,w+=w-s),v=["C",_,w,v[1],v[2],v[3],v[4]];break;case"T":"Q"==e||"T"==e?(u=2*h-u,f=2*d-f):(u=h,f=d),v=a(h,d,u,f,v[1],v[2]);break;case"Q":u=v[1],f=v[2],v=a(h,d,v[1],v[2],v[3],v[4]);break;case"L":v=i(h,d,v[1],v[2]);break;case"H":v=i(h,d,v[1],d);break;case"V":v=i(h,d,h,v[1]);break;case"Z":v=i(h,d,l,c)}e=g,h=v[v.length-2],d=v[v.length-1],v.length>4?(o=v[v.length-4],s=v[v.length-3]):(o=h,s=d),r.push(v)}return r};var n=t("svg-arc-to-cubic-bezier");function i(t,e,r,n){return["C",t,e,r,n,r,n]}function a(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}},{"svg-arc-to-cubic-bezier":521}],524:[function(t,e,r){(function(r){"use strict";var n=t("svg-path-bounds"),i=t("parse-svg-path"),a=t("draw-svg-path"),o=t("is-svg-path"),s=t("bitmap-sdf"),l=document.createElement("canvas"),c=l.getContext("2d");e.exports=function(t,e){if(!o(t))throw Error("Argument should be valid svg path string");e||(e={});var u,f;e.shape?(u=e.shape[0],f=e.shape[1]):(u=l.width=e.w||e.width||200,f=l.height=e.h||e.height||200);var h=Math.min(u,f),d=e.stroke||0,p=e.viewbox||e.viewBox||n(t),m=[u/(p[2]-p[0]),f/(p[3]-p[1])],v=Math.min(m[0]||0,m[1]||0)/2;c.fillStyle="black",c.fillRect(0,0,u,f),c.fillStyle="white",d&&("number"!=typeof d&&(d=1),c.strokeStyle=d>0?"white":"black",c.lineWidth=Math.abs(d));if(c.translate(.5*u,.5*f),c.scale(v,v),r.Path2D){var g=new Path2D(t);c.fill(g),d&&c.stroke(g)}else{var y=i(t);a(c,y),c.fill(),d&&c.stroke()}return c.setTransform(1,0,0,1,0,0),s(c,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*h})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bitmap-sdf":72,"draw-svg-path":132,"is-svg-path":267,"parse-svg-path":447,"svg-path-bounds":522}],525:[function(t,e,r){(function(r){"use strict";e.exports=function t(e,r,i){var i=i||{};var o=a[e];o||(o=a[e]={" ":{data:new Float32Array(0),shape:.2}});var s=o[r];if(!s)if(r.length<=1||!/\d/.test(r))s=o[r]=function(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),i=0,a=0,o=0;o<e.length;++o)for(var s=e[o],l=0;l<3;++l){var c=r[s[l]];n[i++]=c[0],n[i++]=c[1]+1.4,a=Math.max(c[0],a)}return{data:n,shape:a}}(n(r,{triangles:!0,font:e,textAlign:i.textAlign||"left",textBaseline:"alphabetic"}));else{for(var l=r.split(/(\d|\s)/),c=new Array(l.length),u=0,f=0,h=0;h<l.length;++h)c[h]=t(e,l[h]),u+=c[h].data.length,f+=c[h].shape,h>0&&(f+=.02);for(var d=new Float32Array(u),p=0,m=-.5*f,h=0;h<c.length;++h){for(var v=c[h].data,g=0;g<v.length;g+=2)d[p++]=v[g]+m,d[p++]=v[g+1];m+=c[h].shape+.02}s=o[r]={data:d,shape:f}}return s};var n=t("vectorize-text"),i=window||r.global||{},a=i.__TEXT_CACHE||{};i.__TEXT_CACHE={}}).call(this,t("_process"))},{_process:469,"vectorize-text":548}],526:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,i=0,a=t.round,o=t.min,s=t.max,l=t.random;function c(e,l){if(e=e||"",l=l||{},e instanceof c)return e;if(!(this instanceof c))return new c(e,l);var u=function(e){var i={r:0,g:0,b:0},a=1,l=null,c=null,u=null,f=!1,h=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,i=!1;if(E[t])t=E[t],i=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=B.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=B.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=B.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=B.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=B.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=B.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=B.hex8.exec(t))return{r:z(e[1]),g:z(e[2]),b:z(e[3]),a:R(e[4]),format:i?"name":"hex8"};if(e=B.hex6.exec(t))return{r:z(e[1]),g:z(e[2]),b:z(e[3]),format:i?"name":"hex"};if(e=B.hex4.exec(t))return{r:z(e[1]+""+e[1]),g:z(e[2]+""+e[2]),b:z(e[3]+""+e[3]),a:R(e[4]+""+e[4]),format:i?"name":"hex8"};if(e=B.hex3.exec(t))return{r:z(e[1]+""+e[1]),g:z(e[2]+""+e[2]),b:z(e[3]+""+e[3]),format:i?"name":"hex"};return!1}(e));"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(d=e.r,p=e.g,m=e.b,i={r:255*C(d,255),g:255*C(p,255),b:255*C(m,255)},f=!0,h="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(l=D(e.s),c=D(e.v),i=function(e,r,n){e=6*C(e,360),r=C(r,100),n=C(n,100);var i=t.floor(e),a=e-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),c=i%6;return{r:255*[n,s,o,o,l,n][c],g:255*[l,n,n,s,o,o][c],b:255*[o,o,l,n,n,s][c]}}(e.h,l,c),f=!0,h="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(l=D(e.s),u=D(e.l),i=function(t,e,r){var n,i,a;function o(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=C(t,360),e=C(e,100),r=C(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,l,u),f=!0,h="hsl"),e.hasOwnProperty("a")&&(a=e.a));var d,p,m;return a=L(a),{ok:f,format:e.format||h,r:o(255,s(i.r,0)),g:o(255,s(i.g,0)),b:o(255,s(i.b,0)),a:a}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=a(100*this._a)/100,this._format=l.format||u.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=u.ok,this._tc_id=i++}function u(t,e,r){t=C(t,255),e=C(e,255),r=C(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),c=(a+l)/2;if(a==l)n=i=0;else{var u=a-l;switch(i=c>.5?u/(2-a-l):u/(a+l),a){case t:n=(e-r)/u+(e<r?6:0);break;case e:n=(r-t)/u+2;break;case r:n=(t-e)/u+4}n/=6}return{h:n,s:i,l:c}}function f(t,e,r){t=C(t,255),e=C(e,255),r=C(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),c=a,u=a-l;if(i=0===a?0:u/a,a==l)n=0;else{switch(a){case t:n=(e-r)/u+(e<r?6:0);break;case e:n=(r-t)/u+2;break;case r:n=(t-e)/u+4}n/=6}return{h:n,s:i,v:c}}function h(t,e,r,n){var i=[O(a(t).toString(16)),O(a(e).toString(16)),O(a(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 d(t,e,r,n){return[O(I(n)),O(a(t).toString(16)),O(a(e).toString(16)),O(a(r).toString(16))].join("")}function p(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.s-=e/100,r.s=P(r.s),c(r)}function m(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.s+=e/100,r.s=P(r.s),c(r)}function v(t){return c(t).desaturate(100)}function g(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.l+=e/100,r.l=P(r.l),c(r)}function y(t,e){e=0===e?0:e||10;var r=c(t).toRgb();return r.r=s(0,o(255,r.r-a(-e/100*255))),r.g=s(0,o(255,r.g-a(-e/100*255))),r.b=s(0,o(255,r.b-a(-e/100*255))),c(r)}function b(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.l-=e/100,r.l=P(r.l),c(r)}function x(t,e){var r=c(t).toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,c(r)}function _(t){var e=c(t).toHsl();return e.h=(e.h+180)%360,c(e)}function w(t){var e=c(t).toHsl(),r=e.h;return[c(t),c({h:(r+120)%360,s:e.s,l:e.l}),c({h:(r+240)%360,s:e.s,l:e.l})]}function M(t){var e=c(t).toHsl(),r=e.h;return[c(t),c({h:(r+90)%360,s:e.s,l:e.l}),c({h:(r+180)%360,s:e.s,l:e.l}),c({h:(r+270)%360,s:e.s,l:e.l})]}function k(t){var e=c(t).toHsl(),r=e.h;return[c(t),c({h:(r+72)%360,s:e.s,l:e.l}),c({h:(r+216)%360,s:e.s,l:e.l})]}function A(t,e,r){e=e||6,r=r||30;var n=c(t).toHsl(),i=360/r,a=[c(t)];for(n.h=(n.h-(i*e>>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(c(n));return a}function T(t,e){e=e||6;for(var r=c(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(c({h:n,s:i,v:a})),a=(a+s)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,i=this.toRgb();return e=i.r/255,r=i.g/255,n=i.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=L(t),this._roundA=a(100*this._a)/100,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=u(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=u(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[O(a(t).toString(16)),O(a(e).toString(16)),O(a(r).toString(16)),O(I(n))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*C(this._r,255))+"%",g:a(100*C(this._g,255))+"%",b:a(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%)":"rgba("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+d(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=c(t);r="#"+d(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(g,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(v,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(_,arguments)},monochromatic:function(){return this._applyCombination(T,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(M,arguments)}},c.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:D(t[n]));t=r}return c(t,e)},c.equals=function(t,e){return!(!t||!e)&&c(t).toRgbString()==c(e).toRgbString()},c.random=function(){return c.fromRatio({r:l(),g:l(),b:l()})},c.mix=function(t,e,r){r=0===r?0:r||50;var n=c(t).toRgb(),i=c(e).toRgb(),a=r/100;return c({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},c.readability=function(e,r){var n=c(e),i=c(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},c.isReadable=function(t,e,r){var n,i,a=c.readability(t,e);switch(i=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},c.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var u=0;u<e.length;u++)(n=c.readability(t,e[u]))>l&&(l=n,s=c(e[u]));return c.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],r))};var E=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=c.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(E);function L(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function C(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function P(t){return o(1,s(0,t))}function z(t){return parseInt(t,16)}function O(t){return 1==t.length?"0"+t:""+t}function D(t){return t<=1&&(t=100*t+"%"),t}function I(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return z(t)/255}var N,F,j,B=(F="[\\s|\\(]+("+(N="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",j="[\\s|\\(]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",{CSS_UNIT:new RegExp(N),rgb:new RegExp("rgb"+F),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+F),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+F),hsva:new RegExp("hsva"+j),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function U(t){return!!B.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=c:window.tinycolor=c}(Math)},{}],527:[function(t,e,r){"use strict";function n(t){if(t instanceof Float32Array)return t;if("number"==typeof t)return new Float32Array([t])[0];var e=new Float32Array(t);return e.set(t),e}e.exports=n,e.exports.float32=e.exports.float=n,e.exports.fract32=e.exports.fract=function(t){if("number"==typeof t)return n(t-n(t));for(var e=n(t),r=0,i=e.length;r<i;r++)e[r]=t[r]-e[r];return e}},{}],528:[function(t,e,r){"use strict";var n=t("parse-unit");e.exports=o;var i=96;function a(t,e){var r=n(getComputedStyle(t).getPropertyValue(e));return r[0]*o(r[1],t)}function o(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 function(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var n=a(r,"font-size")/128;return e.removeChild(r),n}(t,e);case"em":return a(e,"font-size");case"rem":return a(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 i;case"cm":return i/2.54;case"mm":return i/25.4;case"pt":return i/72;case"pc":return i/6}return 1}},{"parse-unit":448}],529:[function(t,e,r){var n;n=this,function(t){"use strict";var e=function(t){return t},r=function(t){if(null==(r=t.transform))return e;var r,n,i,a=r.scale[0],o=r.scale[1],s=r.translate[0],l=r.translate[1];return function(t,e){return e||(n=i=0),t[0]=(n+=t[0])*a+s,t[1]=(i+=t[1])*o+l,t}},n=function(t){var e=t.bbox;function n(t){l[0]=t[0],l[1]=t[1],s(l),l[0]<c&&(c=l[0]),l[0]>f&&(f=l[0]),l[1]<u&&(u=l[1]),l[1]>h&&(h=l[1])}function i(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(i);break;case"Point":n(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(n)}}if(!e){var a,o,s=r(t),l=new Array(2),c=1/0,u=c,f=-c,h=-c;for(o in t.arcs.forEach(function(t){for(var e=-1,r=t.length;++e<r;)a=t[e],l[0]=a[0],l[1]=a[1],s(l,e),l[0]<c&&(c=l[0]),l[0]>f&&(f=l[0]),l[1]<u&&(u=l[1]),l[1]>h&&(h=l[1])}),t.objects)i(t.objects[o]);e=t.bbox=[c,u,f,h]}return e},i=function(t,e){for(var r,n=t.length,i=n-e;i<--n;)r=t[i],t[i++]=t[n],t[n]=r};function a(t,e){var r=e.id,n=e.bbox,i=null==e.properties?{}:e.properties,a=o(t,e);return null==r&&null==n?{type:"Feature",properties:i,geometry:a}:null==n?{type:"Feature",id:r,properties:i,geometry:a}:{type:"Feature",id:r,bbox:n,properties:i,geometry:a}}function o(t,e){var n=r(t),a=t.arcs;function o(t,e){e.length&&e.pop();for(var r=a[t<0?~t:t],o=0,s=r.length;o<s;++o)e.push(n(r[o].slice(),o));t<0&&i(e,s)}function s(t){return n(t.slice())}function l(t){for(var e=[],r=0,n=t.length;r<n;++r)o(t[r],e);return e.length<2&&e.push(e[0].slice()),e}function c(t){for(var e=l(t);e.length<4;)e.push(e[0].slice());return e}function u(t){return t.map(c)}return function t(e){var r,n=e.type;switch(n){case"GeometryCollection":return{type:n,geometries:e.geometries.map(t)};case"Point":r=s(e.coordinates);break;case"MultiPoint":r=e.coordinates.map(s);break;case"LineString":r=l(e.arcs);break;case"MultiLineString":r=e.arcs.map(l);break;case"Polygon":r=u(e.arcs);break;case"MultiPolygon":r=e.arcs.map(u);break;default:return null}return{type:n,coordinates:r}}(e)}var s=function(t,e){var r={},n={},i={},a=[],o=-1;function s(t,e){for(var n in t){var i=t[n];delete e[i.start],delete i.start,delete i.end,i.forEach(function(t){r[t<0?~t:t]=1}),a.push(i)}}return e.forEach(function(r,n){var i,a=t.arcs[r<0?~r:r];a.length<3&&!a[1][0]&&!a[1][1]&&(i=e[++o],e[o]=r,e[n]=i)}),e.forEach(function(e){var r,a,o=function(e){var r,n=t.arcs[e<0?~e:e],i=n[0];t.transform?(r=[0,0],n.forEach(function(t){r[0]+=t[0],r[1]+=t[1]})):r=n[n.length-1];return e<0?[r,i]:[i,r]}(e),s=o[0],l=o[1];if(r=i[s])if(delete i[r.end],r.push(e),r.end=l,a=n[l]){delete n[a.start];var c=a===r?r:r.concat(a);n[c.start=r.start]=i[c.end=a.end]=c}else n[r.start]=i[r.end]=r;else if(r=n[l])if(delete n[r.start],r.unshift(e),r.start=s,a=i[s]){delete i[a.end];var u=a===r?r:a.concat(r);n[u.start=a.start]=i[u.end=r.end]=u}else n[r.start]=i[r.end]=r;else n[(r=[e]).start=s]=i[r.end=l]=r}),s(i,n),s(n,i),e.forEach(function(t){r[t<0?~t:t]||a.push([t])}),a};function l(t,e,r){var n,i,a;if(arguments.length>1)n=function(t,e,r){var n,i=[],a=[];function o(t){var e=t<0?~t:t;(a[e]||(a[e]=[])).push({i:t,g:n})}function s(t){t.forEach(o)}function l(t){t.forEach(s)}return function t(e){switch(n=e,e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"LineString":s(e.arcs);break;case"MultiLineString":case"Polygon":l(e.arcs);break;case"MultiPolygon":e.arcs.forEach(l)}}(e),a.forEach(null==r?function(t){i.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&i.push(t[0].i)}),i}(0,e,r);else for(i=0,n=new Array(a=t.arcs.length);i<a;++i)n[i]=i;return{type:"MultiLineString",arcs:s(t,n)}}function c(t,e){var r={},n=[],i=[];function a(t){t.forEach(function(e){e.forEach(function(e){(r[e=e<0?~e:e]||(r[e]=[])).push(t)})}),n.push(t)}function l(e){return function(t){for(var e,r=-1,n=t.length,i=t[n-1],a=0;++r<n;)e=i,i=t[r],a+=e[0]*i[1]-e[1]*i[0];return Math.abs(a)}(o(t,{type:"Polygon",arcs:[e]}).coordinates[0])}return e.forEach(function t(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"Polygon":a(e.arcs);break;case"MultiPolygon":e.arcs.forEach(a)}}),n.forEach(function(t){if(!t._){var e=[],n=[t];for(t._=1,i.push(e);t=n.pop();)e.push(t),t.forEach(function(t){t.forEach(function(t){r[t<0?~t:t].forEach(function(t){t._||(t._=1,n.push(t))})})})}}),n.forEach(function(t){delete t._}),{type:"MultiPolygon",arcs:i.map(function(e){var n,i=[];if(e.forEach(function(t){t.forEach(function(t){t.forEach(function(t){r[t<0?~t:t].length<2&&i.push(t)})})}),(n=(i=s(t,i)).length)>1)for(var a,o,c=1,u=l(i[0]);c<n;++c)(a=l(i[c]))>u&&(o=i[0],i[0]=i[c],i[c]=o,u=a);return i})}}var u=function(t,e){for(var r=0,n=t.length;r<n;){var i=r+n>>>1;t[i]<e?r=i+1:n=i}return r};t.bbox=n,t.feature=function(t,e){return"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map(function(e){return a(t,e)})}:a(t,e)},t.mesh=function(t){return o(t,l.apply(this,arguments))},t.meshArcs=l,t.merge=function(t){return o(t,c.apply(this,arguments))},t.mergeArcs=c,t.neighbors=function(t){var e={},r=t.map(function(){return[]});function n(t,r){t.forEach(function(t){t<0&&(t=~t);var n=e[t];n?n.push(r):e[t]=[r]})}function i(t,e){t.forEach(function(t){n(t,e)})}var a={LineString:n,MultiLineString:i,Polygon:i,MultiPolygon:function(t,e){t.forEach(function(t){i(t,e)})}};for(var o in t.forEach(function t(e,r){"GeometryCollection"===e.type?e.geometries.forEach(function(e){t(e,r)}):e.type in a&&a[e.type](e.arcs,r)}),e)for(var s=e[o],l=s.length,c=0;c<l;++c)for(var f=c+1;f<l;++f){var h,d=s[c],p=s[f];(h=r[d])[o=u(h,p)]!==p&&h.splice(o,0,p),(h=r[p])[o=u(h,d)]!==d&&h.splice(o,0,d)}return r},t.quantize=function(t,e){if(!((e=Math.floor(e))>=2))throw new Error("n must be \u22652");if(t.transform)throw new Error("already quantized");var r,i=n(t),a=i[0],o=(i[2]-a)/(e-1)||1,s=i[1],l=(i[3]-s)/(e-1)||1;function c(t){t[0]=Math.round((t[0]-a)/o),t[1]=Math.round((t[1]-s)/l)}function u(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(u);break;case"Point":c(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(c)}}for(r in t.arcs.forEach(function(t){for(var e,r,n,i=1,c=1,u=t.length,f=t[0],h=f[0]=Math.round((f[0]-a)/o),d=f[1]=Math.round((f[1]-s)/l);i<u;++i)f=t[i],r=Math.round((f[0]-a)/o),n=Math.round((f[1]-s)/l),r===h&&n===d||((e=t[c++])[0]=r-h,h=r,e[1]=n-d,d=n);c<2&&((e=t[c++])[0]=0,e[1]=0),t.length=c}),t.objects)u(t.objects[r]);return t.transform={scale:[o,l],translate:[a,s]},t},t.transform=r,t.untransform=function(t){if(null==(r=t.transform))return e;var r,n,i,a=r.scale[0],o=r.scale[1],s=r.translate[0],l=r.translate[1];return function(t,e){e||(n=i=0);var r=Math.round((t[0]-s)/a),c=Math.round((t[1]-l)/o);return t[0]=r-n,n=r,t[1]=c-i,i=c,t}},Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof r&&void 0!==e?r:n.topojson=n.topojson||{})},{}],530:[function(t,e,r){"use strict";e.exports=function(t){if(t<0)return[];if(0===t)return[[0]];for(var e=0|Math.round(a(t+1)),r=[],o=0;o<e;++o){for(var s=n.unrank(t,o),l=[0],c=0,u=0;u<s.length;++u)c+=1<<s[u],l.push(c);i(s)<1&&(l[0]=c,l[t]=0),r.push(l)}return r};var n=t("permutation-rank"),i=t("permutation-parity"),a=t("gamma")},{gamma:145,"permutation-parity":452,"permutation-rank":453}],531:[function(t,e,r){"use strict";e.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.up||[0,1,0],n=t.right||f(r),i=t.radius||1,a=t.theta||0,u=t.phi||0;if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),s(r,r),n=[].slice.call(n,0,3),s(n,n),"eye"in t){var d=t.eye,p=[d[0]-e[0],d[1]-e[1],d[2]-e[2]];o(n,p,r),c(n[0],n[1],n[2])<1e-6?n=f(r):s(n,n),i=c(p[0],p[1],p[2]);var m=l(r,p)/i,v=l(n,p)/i;u=Math.acos(m),a=Math.acos(v)}return i=Math.log(i),new h(t.zoomMin,t.zoomMax,e,r,n,i,a,u)};var n=t("filtered-vector"),i=t("gl-mat4/invert"),a=t("gl-mat4/rotate"),o=t("gl-vec3/cross"),s=t("gl-vec3/normalize"),l=t("gl-vec3/dot");function c(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function u(t){return Math.min(1,Math.max(-1,t))}function f(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,l=0;l<3;++l)a+=t[l]*t[l],o+=i[l]*t[l];for(l=0;l<3;++l)i[l]-=o/a*t[l];return s(i,i),i}function h(t,e,r,i,a,o,s,l){this.center=n(r),this.up=n(i),this.right=n(a),this.radius=n([o]),this.angle=n([s,l]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}var d=h.prototype;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[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])]},d.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,n=0,i=0,a=0;a<3;++a)i+=e[a]*r[a],n+=e[a]*e[a];var l=Math.sqrt(n),u=0;for(a=0;a<3;++a)r[a]-=e[a]*i/n,u+=r[a]*r[a],e[a]/=l;var f=Math.sqrt(u);for(a=0;a<3;++a)r[a]/=f;var h=this.computedToward;o(h,e,r),s(h,h);var d=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],m=this.computedAngle[1],v=Math.cos(p),g=Math.sin(p),y=Math.cos(m),b=Math.sin(m),x=this.computedCenter,_=v*y,w=g*y,M=b,k=-v*b,A=-g*b,T=y,E=this.computedEye,S=this.computedMatrix;for(a=0;a<3;++a){var L=_*r[a]+w*h[a]+M*e[a];S[4*a+1]=k*r[a]+A*h[a]+T*e[a],S[4*a+2]=L,S[4*a+3]=0}var C=S[1],P=S[5],z=S[9],O=S[2],D=S[6],I=S[10],R=P*I-z*D,N=z*O-C*I,F=C*D-P*O,j=c(R,N,F);R/=j,N/=j,F/=j,S[0]=R,S[4]=N,S[8]=F;for(a=0;a<3;++a)E[a]=x[a]+S[2+4*a]*d;for(a=0;a<3;++a){u=0;for(var B=0;B<3;++B)u+=S[a+4*B]*E[B];S[12+a]=-u}S[15]=1},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};var p=[0,0,0];d.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;p[0]=i[2],p[1]=i[6],p[2]=i[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,c=0;c<3;++c)i[4*c]=o[c],i[4*c+1]=s[c],i[4*c+2]=l[c];a(i,i,n,p);for(c=0;c<3;++c)o[c]=i[4*c],s[c]=i[4*c+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,s[0],s[1],s[2])}},d.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),i[1]),o=i[5],s=i[9],l=c(a,o,s);a/=l,o/=l,s/=l;var u=i[0],f=i[4],h=i[8],d=u*a+f*o+h*s,p=c(u-=a*d,f-=o*d,h-=s*d),m=(u/=p)*e+a*r,v=(f/=p)*e+o*r,g=(h/=p)*e+s*r;this.center.move(t,m,v,g);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+n),this.radius.set(t,Math.log(y))},d.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},d.setMatrix=function(t,e,r,n){var a=1;"number"==typeof r&&(a=0|r),(a<0||a>3)&&(a=1);var o=(a+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var s=e[a],l=e[a+4],f=e[a+8];if(n){var h=Math.abs(s),d=Math.abs(l),p=Math.abs(f),m=Math.max(h,d,p);h===m?(s=s<0?-1:1,l=f=0):p===m?(f=f<0?-1:1,s=l=0):(l=l<0?-1:1,s=f=0)}else{var v=c(s,l,f);s/=v,l/=v,f/=v}var g,y,b=e[o],x=e[o+4],_=e[o+8],w=b*s+x*l+_*f,M=c(b-=s*w,x-=l*w,_-=f*w),k=l*(_/=M)-f*(x/=M),A=f*(b/=M)-s*_,T=s*x-l*b,E=c(k,A,T);if(k/=E,A/=E,T/=E,this.center.jump(t,H,G,Y),this.radius.idle(t),this.up.jump(t,s,l,f),this.right.jump(t,b,x,_),2===a){var S=e[1],L=e[5],C=e[9],P=S*b+L*x+C*_,z=S*k+L*A+C*T;g=R<0?-Math.PI/2:Math.PI/2,y=Math.atan2(z,P)}else{var O=e[2],D=e[6],I=e[10],R=O*s+D*l+I*f,N=O*b+D*x+I*_,F=O*k+D*A+I*T;g=Math.asin(u(R)),y=Math.atan2(F,N)}this.angle.jump(t,y,g),this.recalcMatrix(t);var j=e[2],B=e[6],U=e[10],V=this.computedMatrix;i(V,e);var q=V[15],H=V[12]/q,G=V[13]/q,Y=V[14]/q,W=Math.exp(this.computedRadius[0]);this.center.jump(t,H-j*W,G-B*W,Y-U*W)},d.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},d.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},d.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},d.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},d.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],a=n[1],o=n[2],s=c(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var l=e[0]-r[0],f=e[1]-r[1],h=e[2]-r[2],d=c(l,f,h);if(!(d<1e-6)){l/=d,f/=d,h/=d;var p=this.computedRight,m=p[0],v=p[1],g=p[2],y=i*m+a*v+o*g,b=c(m-=y*i,v-=y*a,g-=y*o);if(!(b<.01&&(b=c(m=a*h-o*f,v=o*l-i*h,g=i*f-a*l))<1e-6)){m/=b,v/=b,g/=b,this.up.set(t,i,a,o),this.right.set(t,m,v,g),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(d));var x=a*g-o*v,_=o*m-i*g,w=i*v-a*m,M=c(x,_,w),k=i*l+a*f+o*h,A=m*l+v*f+g*h,T=(x/=M)*l+(_/=M)*f+(w/=M)*h,E=Math.asin(u(k)),S=Math.atan2(T,A),L=this.angle._state,C=L[L.length-1],P=L[L.length-2];C%=2*Math.PI;var z=Math.abs(C+2*Math.PI-S),O=Math.abs(C-S),D=Math.abs(C-2*Math.PI-S);z<O&&(C+=2*Math.PI),D<O&&(C-=2*Math.PI),this.angle.jump(this.angle.lastT(),C,P),this.angle.set(t,S,E)}}}}},{"filtered-vector":142,"gl-mat4/invert":186,"gl-mat4/rotate":190,"gl-vec3/cross":238,"gl-vec3/dot":239,"gl-vec3/normalize":242}],532:[function(t,e,r){"use strict";e.exports=function(t,e,r){var i=t*e,a=n*t,o=a-(a-t),s=t-o,l=n*e,c=l-(l-e),u=e-c,f=s*u-(i-o*c-s*c-o*u);if(r)return r[0]=f,r[1]=i,r;return[f,i]};var n=+(Math.pow(2,27)+1)},{}],533:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=t+e,i=n-t,a=e-i,o=t-(n-i);if(r)return r[0]=o+a,r[1]=n,r;return[o+a,n]}},{}],534:[function(t,e,r){(function(e,n){"use strict";var i=t("bit-twiddle"),a=t("dup");e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:a([32,0]),UINT16:a([32,0]),UINT32:a([32,0]),INT8:a([32,0]),INT16:a([32,0]),INT32:a([32,0]),FLOAT:a([32,0]),DOUBLE:a([32,0]),DATA:a([32,0]),UINT8C:a([32,0]),BUFFER:a([32,0])});var o="undefined"!=typeof Uint8ClampedArray,s=e.__TYPEDARRAY_POOL;s.UINT8C||(s.UINT8C=a([32,0])),s.BUFFER||(s.BUFFER=a([32,0]));var l=s.DATA,c=s.BUFFER;function u(t){if(t){var e=t.length||t.byteLength,r=i.log2(e);l[r].push(t)}}function f(t){t=i.nextPow2(t);var e=i.log2(t),r=l[e];return r.length>0?r.pop():new ArrayBuffer(t)}function h(t){return new Uint8Array(f(t),0,t)}function d(t){return new Uint16Array(f(2*t),0,t)}function p(t){return new Uint32Array(f(4*t),0,t)}function m(t){return new Int8Array(f(t),0,t)}function v(t){return new Int16Array(f(2*t),0,t)}function g(t){return new Int32Array(f(4*t),0,t)}function y(t){return new Float32Array(f(4*t),0,t)}function b(t){return new Float64Array(f(8*t),0,t)}function x(t){return o?new Uint8ClampedArray(f(t),0,t):h(t)}function _(t){return new DataView(f(t),0,t)}function w(t){t=i.nextPow2(t);var e=i.log2(t),r=c[e];return r.length>0?r.pop():new n(t)}r.free=function(t){if(n.isBuffer(t))c[i.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|i.log2(e);l[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=function(t){u(t.buffer)},r.freeArrayBuffer=u,r.freeBuffer=function(t){c[i.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return f(t);switch(e){case"uint8":return h(t);case"uint16":return d(t);case"uint32":return p(t);case"int8":return m(t);case"int16":return v(t);case"int32":return g(t);case"float":case"float32":return y(t);case"double":case"float64":return b(t);case"uint8_clamped":return x(t);case"buffer":return w(t);case"data":case"dataview":return _(t);default:return null}return null},r.mallocArrayBuffer=f,r.mallocUint8=h,r.mallocUint16=d,r.mallocUint32=p,r.mallocInt8=m,r.mallocInt16=v,r.mallocInt32=g,r.mallocFloat32=r.mallocFloat=y,r.mallocFloat64=r.mallocDouble=b,r.mallocUint8Clamped=x,r.mallocDataView=_,r.mallocBuffer=w,r.clearCache=function(){for(var t=0;t<32;++t)s.UINT8[t].length=0,s.UINT16[t].length=0,s.UINT32[t].length=0,s.INT8[t].length=0,s.INT16[t].length=0,s.INT32[t].length=0,s.FLOAT[t].length=0,s.DOUBLE[t].length=0,s.UINT8C[t].length=0,l[t].length=0,c[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":71,buffer:83,dup:134}],535:[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])}}},{}],536:[function(t,e,r){"use strict";e.exports=function(t,e,r){return 0===t.length?t:e?(r||t.sort(e),function(t,e){for(var r=1,n=t.length,i=t[0],a=t[0],o=1;o<n;++o)if(a=i,e(i=t[o],a)){if(o===r){r++;continue}t[r++]=i}return t.length=r,t}(t,e)):(r||t.sort(),function(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])!==i){if(a===e){e++;continue}t[e++]=n}return t.length=e,t}(t))}},{}],537:[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){var r,n,i,a,o;for(void 0===e&&(e=1e-6),i=t,o=0;o<8;o++){if(a=this.sampleCurveX(i)-t,Math.abs(a)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=a/s}if(n=1,(i=t)<(r=0))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))}},{}],538:[function(t,e,r){"use strict";e.exports=function(t,e,r){Array.isArray(r)||(r=[].slice.call(arguments,2));for(var n=0,i=r.length;n<i;n++){var a=r[n];for(var o in a)if((void 0===e[o]||Array.isArray(e[o])||t[o]!==e[o])&&o in e){var s;if(!0===a[o])s=e[o];else{if(!1===a[o])continue;if("function"==typeof a[o]&&void 0===(s=a[o](e[o],t,e)))continue}t[o]=s}}return t}},{}],539:[function(t,e,r){"use strict";var n=t("punycode"),i=t("./util");function a(){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}r.parse=b,r.resolve=function(t,e){return b(t,!1,!0).resolve(e)},r.resolveObject=function(t,e){return t?b(t,!1,!0).resolveObject(e):e},r.format=function(t){i.isString(t)&&(t=b(t));return t instanceof a?t.format():a.prototype.format.call(t)},r.Url=a;var o=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,l=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(c),f=["%","/","?",";","#"].concat(u),h=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=t("querystring");function b(t,e,r){if(t&&i.isObject(t)&&t instanceof a)return t;var n=new a;return n.parse(t,e,r),n}a.prototype.parse=function(t,e,r){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var a=t.indexOf("?"),s=-1!==a&&a<t.indexOf("#")?"?":"#",c=t.split(s);c[0]=c[0].replace(/\\/g,"/");var b=t=c.join(s);if(b=b.trim(),!r&&1===t.split("#").length){var x=l.exec(b);if(x)return this.path=b,this.href=b,this.pathname=x[1],x[2]?(this.search=x[2],this.query=e?y.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var _=o.exec(b);if(_){var w=(_=_[0]).toLowerCase();this.protocol=w,b=b.substr(_.length)}if(r||_||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var M="//"===b.substr(0,2);!M||_&&v[_]||(b=b.substr(2),this.slashes=!0)}if(!v[_]&&(M||_&&!g[_])){for(var k,A,T=-1,E=0;E<h.length;E++){-1!==(S=b.indexOf(h[E]))&&(-1===T||S<T)&&(T=S)}-1!==(A=-1===T?b.lastIndexOf("@"):b.lastIndexOf("@",T))&&(k=b.slice(0,A),b=b.slice(A+1),this.auth=decodeURIComponent(k)),T=-1;for(E=0;E<f.length;E++){var S;-1!==(S=b.indexOf(f[E]))&&(-1===T||S<T)&&(T=S)}-1===T&&(T=b.length),this.host=b.slice(0,T),b=b.slice(T),this.parseHost(),this.hostname=this.hostname||"";var L="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!L)for(var C=this.hostname.split(/\./),P=(E=0,C.length);E<P;E++){var z=C[E];if(z&&!z.match(d)){for(var O="",D=0,I=z.length;D<I;D++)z.charCodeAt(D)>127?O+="x":O+=z[D];if(!O.match(d)){var R=C.slice(0,E),N=C.slice(E+1),F=z.match(p);F&&(R.push(F[1]),N.unshift(F[2])),N.length&&(b="/"+N.join(".")+b),this.hostname=R.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),L||(this.hostname=n.toASCII(this.hostname));var j=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+j,this.href+=this.host,L&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[w])for(E=0,P=u.length;E<P;E++){var U=u[E];if(-1!==b.indexOf(U)){var V=encodeURIComponent(U);V===U&&(V=escape(U)),b=b.split(U).join(V)}}var q=b.indexOf("#");-1!==q&&(this.hash=b.substr(q),b=b.slice(0,q));var H=b.indexOf("?");if(-1!==H?(this.search=b.substr(H),this.query=b.substr(H+1),e&&(this.query=y.parse(this.query)),b=b.slice(0,H)):e&&(this.search="",this.query={}),b&&(this.pathname=b),g[w]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){j=this.pathname||"";var G=this.search||"";this.path=j+G}return this.href=this.format(),this},a.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",a=!1,o="";this.host?a=t+this.host:this.hostname&&(a=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(a+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(o=y.stringify(this.query));var s=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||g[e])&&!1!==a?(a="//"+(a||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):a||(a=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),e+a+(r=r.replace(/[?#]/g,function(t){return encodeURIComponent(t)}))+(s=s.replace("#","%23"))+n},a.prototype.resolve=function(t){return this.resolveObject(b(t,!1,!0)).format()},a.prototype.resolveObject=function(t){if(i.isString(t)){var e=new a;e.parse(t,!1,!0),t=e}for(var r=new a,n=Object.keys(this),o=0;o<n.length;o++){var s=n[o];r[s]=this[s]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var l=Object.keys(t),c=0;c<l.length;c++){var u=l[c];"protocol"!==u&&(r[u]=t[u])}return g[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!g[t.protocol]){for(var f=Object.keys(t),h=0;h<f.length;h++){var d=f[h];r[d]=t[d]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||v[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||"",y=r.search||"";r.path=m+y}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var b=r.pathname&&"/"===r.pathname.charAt(0),x=t.host||t.pathname&&"/"===t.pathname.charAt(0),_=x||b||r.host&&t.pathname,w=_,M=r.pathname&&r.pathname.split("/")||[],k=(p=t.pathname&&t.pathname.split("/")||[],r.protocol&&!g[r.protocol]);if(k&&(r.hostname="",r.port=null,r.host&&(""===M[0]?M[0]=r.host:M.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),_=_&&(""===p[0]||""===M[0])),x)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,M=p;else if(p.length)M||(M=[]),M.pop(),M=M.concat(p),r.search=t.search,r.query=t.query;else if(!i.isNullOrUndefined(t.search)){if(k)r.hostname=r.host=M.shift(),(L=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=L.shift(),r.host=r.hostname=L.shift());return r.search=t.search,r.query=t.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!M.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var A=M.slice(-1)[0],T=(r.host||t.host||M.length>1)&&("."===A||".."===A)||""===A,E=0,S=M.length;S>=0;S--)"."===(A=M[S])?M.splice(S,1):".."===A?(M.splice(S,1),E++):E&&(M.splice(S,1),E--);if(!_&&!w)for(;E--;E)M.unshift("..");!_||""===M[0]||M[0]&&"/"===M[0].charAt(0)||M.unshift(""),T&&"/"!==M.join("/").substr(-1)&&M.push("");var L,C=""===M[0]||M[0]&&"/"===M[0].charAt(0);k&&(r.hostname=r.host=C?"":M.length?M.shift():"",(L=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=L.shift(),r.host=r.hostname=L.shift()));return(_=_||r.host&&M.length)&&!C&&M.unshift(""),M.length?r.pathname=M.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.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},a.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":540,punycode:470,querystring:474}],540:[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}}},{}],541:[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}},{}],542:[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}},{}],543:[function(t,e,r){(function(e,n){var i=/%[sdj%]/g;r.format=function(t){if(!g(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(s(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,a=n.length,o=String(t).replace(i,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}}),l=n[r];r<a;l=n[++r])m(l)||!x(l)?o+=" "+l:o+=" "+s(l);return o},r.deprecate=function(t,i){if(y(n.process))return function(){return r.deprecate(t,i).apply(this,arguments)};if(!0===e.noDeprecation)return t;var a=!1;return function(){if(!a){if(e.throwDeprecation)throw new Error(i);e.traceDeprecation?console.trace(i):console.error(i),a=!0}return t.apply(this,arguments)}};var a,o={};function s(t,e){var n={seen:[],stylize:c};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(e)?n.showHidden=e:e&&r._extend(n,e),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),u(n,t,n.depth)}function l(t,e){var r=s.styles[e];return r?"\x1b["+s.colors[r][0]+"m"+t+"\x1b["+s.colors[r][1]+"m":t}function c(t,e){return t}function u(t,e,n){if(t.customInspect&&e&&M(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return g(i)||(i=u(t,i,n)),i}var a=function(t,e){if(y(e))return t.stylize("undefined","undefined");if(g(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(v(e))return t.stylize(""+e,"number");if(p(e))return t.stylize(""+e,"boolean");if(m(e))return t.stylize("null","null")}(t,e);if(a)return a;var o=Object.keys(e),s=function(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),w(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return f(e);if(0===o.length){if(M(e)){var l=e.name?": "+e.name:"";return t.stylize("[Function"+l+"]","special")}if(b(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(_(e))return t.stylize(Date.prototype.toString.call(e),"date");if(w(e))return f(e)}var c,x="",k=!1,A=["{","}"];(d(e)&&(k=!0,A=["[","]"]),M(e))&&(x=" [Function"+(e.name?": "+e.name:"")+"]");return b(e)&&(x=" "+RegExp.prototype.toString.call(e)),_(e)&&(x=" "+Date.prototype.toUTCString.call(e)),w(e)&&(x=" "+f(e)),0!==o.length||k&&0!=e.length?n<0?b(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),c=k?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o<s;++o)E(e,String(o))?a.push(h(t,e,r,n,String(o),!0)):a.push("");return i.forEach(function(i){i.match(/^\d+$/)||a.push(h(t,e,r,n,i,!0))}),a}(t,e,n,s,o):o.map(function(r){return h(t,e,n,s,r,k)}),t.seen.pop(),function(t,e,r){if(t.reduce(function(t,e){return 0,e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(c,x,A)):A[0]+x+A[1]}function f(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),E(n,i)||(o="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(s=m(r)?u(t,l.value,null):u(t,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n")):s=t.stylize("[Circular]","special")),y(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+s}function d(t){return Array.isArray(t)}function p(t){return"boolean"==typeof t}function m(t){return null===t}function v(t){return"number"==typeof t}function g(t){return"string"==typeof t}function y(t){return void 0===t}function b(t){return x(t)&&"[object RegExp]"===k(t)}function x(t){return"object"==typeof t&&null!==t}function _(t){return x(t)&&"[object Date]"===k(t)}function w(t){return x(t)&&("[object Error]"===k(t)||t instanceof Error)}function M(t){return"function"==typeof t}function k(t){return Object.prototype.toString.call(t)}function A(t){return t<10?"0"+t.toString(10):t.toString(10)}r.debuglog=function(t){if(y(a)&&(a=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!o[t])if(new RegExp("\\b"+t+"\\b","i").test(a)){var n=e.pid;o[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else o[t]=function(){};return o[t]},r.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=d,r.isBoolean=p,r.isNull=m,r.isNullOrUndefined=function(t){return null==t},r.isNumber=v,r.isString=g,r.isSymbol=function(t){return"symbol"==typeof t},r.isUndefined=y,r.isRegExp=b,r.isObject=x,r.isDate=_,r.isError=w,r.isFunction=M,r.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},r.isBuffer=t("./support/isBuffer");var T=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function E(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.log=function(){var t,e;console.log("%s - %s",(t=new Date,e=[A(t.getHours()),A(t.getMinutes()),A(t.getSeconds())].join(":"),[t.getDate(),T[t.getMonth()],e].join(" ")),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!x(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":542,_process:469,inherits:541}],544:[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":545,"./lib/vectortilefeature.js":546,"./lib/vectortilelayer.js":547}],545:[function(t,e,r){"use strict";var n=t("./vectortilelayer");function i(t,e,r){if(3===t){var i=new n(r,r.readVarint()+r.pos);i.length&&(e[i.name]=i)}}e.exports=function(t,e){this.layers=t.readFields(i,{},e)}},{"./vectortilelayer":547}],546:[function(t,e,r){"use strict";var n=t("point-geometry");function i(t,e,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,t.readFields(a,this,e)}function a(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){var r=t.readVarint()+t.pos;for(;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function o(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i<a;o=i++)e=t[i],n+=((r=t[o]).x-e.x)*(e.y+r.y);return n}e.exports=i,i.types=["Unknown","Point","LineString","Polygon"],i.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,i=1,a=0,o=0,s=0,l=[];t.pos<r;){if(!a){var c=t.readVarint();i=7&c,a=c>>3}if(a--,1===i||2===i)o+=t.readSVarint(),s+=t.readSVarint(),1===i&&(e&&l.push(e),e=[]),e.push(new n(o,s));else{if(7!==i)throw new Error("unknown command "+i);e&&e.push(e[0].clone())}}return e&&l.push(e),l},i.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,c=-1/0;t.pos<e;){if(!n){var u=t.readVarint();r=7&u,n=u>>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>c&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},i.prototype.toGeoJSON=function(t,e,r){var n,a,s=this.extent*Math.pow(2,r),l=this.extent*t,c=this.extent*e,u=this.loadGeometry(),f=i.types[this.type];function h(t){for(var e=0;e<t.length;e++){var r=t[e],n=180-360*(r.y+c)/s;t[e]=[360*(r.x+l)/s-180,360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90]}}switch(this.type){case 1:var d=[];for(n=0;n<u.length;n++)d[n]=u[n][0];h(u=d);break;case 2:for(n=0;n<u.length;n++)h(u[n]);break;case 3:for(u=function(t){var e=t.length;if(e<=1)return[t];for(var r,n,i=[],a=0;a<e;a++){var s=o(t[a]);0!==s&&(void 0===n&&(n=s<0),n===s<0?(r&&i.push(r),r=[t[a]]):r.push(t[a]))}r&&i.push(r);return i}(u),n=0;n<u.length;n++)for(a=0;a<u[n].length;a++)h(u[n][a])}1===u.length?u=u[0]:f="Multi"+f;var p={type:"Feature",geometry:{type:f,coordinates:u},properties:this.properties};return"id"in this&&(p.id=this.id),p}},{"point-geometry":458}],547:[function(t,e,r){"use strict";var n=t("./vectortilefeature.js");function i(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(a,this,e),this.length=this._features.length}function a(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(function(t){var e=null,r=t.readVarint()+t.pos;for(;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}(r))}e.exports=i,i.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 n(this._pbf,e,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":546}],548:[function(t,e,r){"use strict";e.exports=function(t,e){"object"==typeof e&&null!==e||(e={});return n(t,e.canvas||i,e.context||a,e)};var n=t("./lib/vtext"),i=null,a=null;"undefined"!=typeof document&&((i=document.createElement("canvas")).width=8192,i.height=1024,a=i.getContext("2d"))},{"./lib/vtext":549}],549:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var a=n.size||64,o=n.font||"normal";return r.font=a+"px "+o,r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",f(function(t,e,r,n){var a=0|Math.ceil(e.measureText(r).width+2*n);if(a>8192)throw new Error("vectorize-text: String too long (sorry, this will get fixed later)");var o=3*n;t.height<o&&(t.height=o),e.fillStyle="#000",e.fillRect(0,0,t.width,t.height),e.fillStyle="#fff",e.fillText(r,n,2*n);var s=e.getImageData(0,0,a,o);return i(s.data,[o,a,4]).pick(-1,-1,0).transpose(1,0)}(e,r,t,a),n,a)},e.exports.processPixels=f;var n=t("surface-nets"),i=t("ndarray"),a=t("simplify-planar-graph"),o=t("clean-pslg"),s=t("cdt2d"),l=t("planar-graph-to-polyline");function c(t,e){var r=n(t,128);return e?a(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function u(t,e,r,n){var i=c(t,n),a=function(t,e,r){for(var n=e.textAlign||"start",i=e.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l<s;++l)for(var c=t[l],u=0;u<2;++u)a[u]=0|Math.min(a[u],c[u]),o[u]=0|Math.max(o[u],c[u]);var f=0;switch(n){case"center":f=-.5*(a[0]+o[0]);break;case"right":case"end":f=-o[0];break;case"left":case"start":f=-a[0];break;default:throw new Error("vectorize-text: Unrecognized textAlign: '"+n+"'")}var h=0;switch(i){case"hanging":case"top":h=-a[1];break;case"middle":h=-.5*(a[1]+o[1]);break;case"alphabetic":case"ideographic":h=-3*r;break;case"bottom":h=-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]+f),d*(t[1]+h)]})}(i.positions,e,r),u=i.edges,f="ccw"===e.orientation;if(o(a,u),e.polygons||e.polygon||e.polyline){for(var h=l(u,a),d=new Array(h.length),p=0;p<h.length;++p){for(var m=h[p],v=new Array(m.length),g=0;g<m.length;++g){for(var y=m[g],b=new Array(y.length),x=0;x<y.length;++x)b[x]=a[y[x]].slice();f&&b.reverse(),v[g]=b}d[p]=v}return d}return e.triangles||e.triangulate||e.triangle?{cells:s(a,u,{delaunay:!1,exterior:!1,interior:!0}),positions:a}:{edges:u,positions:a}}function f(t,e,r){try{return u(t,e,r,!0)}catch(t){}try{return u(t,e,r,!1)}catch(t){}return e.polygons||e.polyline||e.polygon?[]:e.triangles||e.triangulate||e.triangle?{cells:[],positions:[]}:{edges:[],positions:[]}}},{cdt2d:85,"clean-pslg":95,ndarray:439,"planar-graph-to-polyline":457,"simplify-planar-graph":510,"surface-nets":520}],550:[function(t,e,r){var n=t("pbf"),i=t("./vector-tile-pb"),a=t("./lib/geojson_wrapper");function o(t){var e=[];for(var r in t.layers)e.push(s(t.layers[r]));var a=new n;return i.tile.write({layers:e},a),a.finish()}function s(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=u(a.loadGeometry());var o=[];for(var s in a.properties){var l=r[s];void 0===l&&(e.keys.push(s),l=e.keys.length-1,r[s]=l);var c=f(a.properties[s]),h=n[c.key];void 0===h&&(e.values.push(c),h=e.values.length-1,n[c.key]=h),o.push(l),o.push(h)}a.tags=o,e.features.push(a)}return e}function l(t,e){return(e<<3)+(7&t)}function c(t){return t<<1^t>>31}function u(t){for(var e=[],r=0,n=0,i=t.length,a=0;a<i;a++){var o=t[a];e.push(l(1,1));for(var s=0;s<o.length;s++){1===s&&e.push(l(2,o.length-1));var u=o[s].x-r,f=o[s].y-n;e.push(c(u),c(f)),r+=u,n+=f}}return e}function f(t){var e,r=typeof t;return(e="string"===r?{string_value:t}:"boolean"===r?{bool_value:t}:"number"===r?t%1!=0?{double_value:t}:t<0?{sint_value:t}:{uint_value:t}:{string_value:t=JSON.stringify(t)}).key=r+":"+t,e}e.exports=o,e.exports.fromVectorTileJs=o,e.exports.fromGeojsonVt=function(t){var e={};for(var r in t)e[r]=new a(t[r].features),e[r].name=r;return o({layers:e})},e.exports.GeoJSONWrapper=a},{"./lib/geojson_wrapper":551,"./vector-tile-pb":552,pbf:451}],551:[function(t,e,r){"use strict";var n=t("point-geometry"),i=t("vector-tile").VectorTileFeature;function a(t){this.features=t,this.length=t.length}function o(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}e.exports=a,a.prototype.feature=function(t){return new o(this.features[t])},o.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var r=t[e],i=[],a=0;a<r.length;a++)i.push(new n(r[a][0],r[a][1]));this.geometry.push(i)}return this.geometry},o.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]},o.prototype.toGeoJSON=i.prototype.toGeoJSON},{"point-geometry":458,"vector-tile":544}],552:[function(t,e,r){"use strict";var n=r.tile={read:function(t,e){return t.readFields(i,{layers:[]},e)},write:function(t,e){var r;if(void 0!==t.layers)for(r=0;r<t.layers.length;r++)e.writeMessage(3,d,t.layers[r])}};function i(t,e,r){3===t&&e.layers.push(f(r,r.readVarint()+r.pos))}function a(t,e){return t.readFields(o,{},e)}function o(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 s(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 l(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 u(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(h,{features:[],keys:[],values:[]},e)}function h(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():2===t?e.features.push(l(r,r.readVarint()+r.pos)):3===t?e.keys.push(r.readString()):4===t?e.values.push(a(r,r.readVarint()+r.pos)):5===t&&(e.extent=r.readVarint())}function d(t,e){var r;if(void 0!==t.version&&e.writeVarintField(15,t.version),void 0!==t.name&&e.writeStringField(1,t.name),void 0!==t.features)for(r=0;r<t.features.length;r++)e.writeMessage(2,u,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,s,t.values[r]);void 0!==t.extent&&e.writeVarintField(5,t.extent)}n.GeomType={Unknown:0,Point:1,LineString:2,Polygon:3},n.value={read:a,write:s},n.feature={read:l,write:u},n.layer={read:f,write:d}},{}],553:[function(t,e,r){!function(){"use strict";if("undefined"==typeof ses||!ses.ok||ses.ok()){"undefined"!=typeof ses&&(ses.weakMapPermitHostObjects=v);var t=!1;if("function"==typeof WeakMap){var r=WeakMap;if("undefined"!=typeof navigator&&/Firefox/.test(navigator.userAgent));else{var n=new r,i=Object.freeze({});if(n.set(i,1),1===n.get(i))return void(e.exports=WeakMap);t=!0}}Object.prototype.hasOwnProperty;var a=Object.getOwnPropertyNames,o=Object.defineProperty,s=Object.isExtensible,l="weakmap:",c=l+"ident:"+Math.random()+"___";if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues&&"function"==typeof ArrayBuffer&&"function"==typeof Uint8Array){var u=new ArrayBuffer(25),f=new Uint8Array(u);crypto.getRandomValues(f),c=l+"rand:"+Array.prototype.map.call(f,function(t){return(t%36).toString(36)}).join("")+"___"}if(o(Object,"getOwnPropertyNames",{value:function(t){return a(t).filter(g)}}),"getPropertyNames"in Object){var h=Object.getPropertyNames;o(Object,"getPropertyNames",{value:function(t){return h(t).filter(g)}})}!function(){var t=Object.freeze;o(Object,"freeze",{value:function(e){return y(e),t(e)}});var e=Object.seal;o(Object,"seal",{value:function(t){return y(t),e(t)}});var r=Object.preventExtensions;o(Object,"preventExtensions",{value:function(t){return y(t),r(t)}})}();var d=!1,p=0,m=function(){this instanceof m||x();var t=[],e=[],r=p++;return Object.create(m.prototype,{get___:{value:b(function(n,i){var a,o=y(n);return o?r in o?o[r]:i:(a=t.indexOf(n))>=0?e[a]:i})},has___:{value:b(function(e){var n=y(e);return n?r in n:t.indexOf(e)>=0})},set___:{value:b(function(n,i){var a,o=y(n);return o?o[r]=i:(a=t.indexOf(n))>=0?e[a]=i:(a=t.length,e[a]=i,t[a]=n),this})},delete___:{value:b(function(n){var i,a,o=y(n);return o?r in o&&delete o[r]:!((i=t.indexOf(n))<0||(a=t.length-1,t[i]=void 0,e[i]=e[a],t[i]=t[a],t.length=a,e.length=a,0))})}})};m.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof r?function(){function n(){this instanceof m||x();var e,n=new r,i=void 0,a=!1;return e=t?function(t,e){return n.set(t,e),n.has(t)||(i||(i=new m),i.set(t,e)),this}:function(t,e){if(a)try{n.set(t,e)}catch(r){i||(i=new m),i.set___(t,e)}else n.set(t,e);return this},Object.create(m.prototype,{get___:{value:b(function(t,e){return i?n.has(t)?n.get(t):i.get___(t,e):n.get(t,e)})},has___:{value:b(function(t){return n.has(t)||!!i&&i.has___(t)})},set___:{value:b(e)},delete___:{value:b(function(t){var e=!!n.delete(t);return i&&i.delete___(t)||e})},permitHostObjects___:{value:b(function(t){if(t!==v)throw new Error("bogus call to permitHostObjects___");a=!0})}})}t&&"undefined"!=typeof Proxy&&(Proxy=void 0),n.prototype=m.prototype,e.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=m)}function v(t){t.permitHostObjects___&&t.permitHostObjects___(v)}function g(t){return!(t.substr(0,l.length)==l&&"___"===t.substr(t.length-3))}function y(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[c];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,c,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function b(t){return t.prototype=null,Object.freeze(t)}function x(){d||"undefined"==typeof console||(d=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},{}],554:[function(t,e,r){var n=t("./hidden-store.js");e.exports=function(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:n(e,t)}}},{"./hidden-store.js":555}],555:[function(t,e,r){e.exports=function(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}},{}],556:[function(t,e,r){var n=t("./create-store.js");e.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},{"./create-store.js":554}],557:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":156}],558:[function(t,e,r){var n=arguments[3],i=arguments[4],a=arguments[5],o=JSON.stringify;e.exports=function(t,e){for(var r,s=Object.keys(a),l=0,c=s.length;l<c;l++){var u=s[l],f=a[u].exports;if(f===t||f&&f.default===t){r=u;break}}if(!r){r=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var h={};for(l=0,c=s.length;l<c;l++){h[u=s[l]]=u}i[r]=["function(require,module,exports){"+t+"(self); }",h]}var d=Math.floor(Math.pow(16,8)*Math.random()).toString(16),p={};p[r]=r,i[d]=["function(require,module,exports){var f = require("+o(r)+");(f.default ? f.default : f)(self);}",p];var m={};!function t(e){m[e]=!0;for(var r in i[e][1]){var n=i[e][1][r];m[n]||t(n)}}(d);var v="("+n+")({"+Object.keys(m).map(function(t){return o(t)+":["+i[t][0]+","+o(i[t][1])+"]"}).join(",")+"},{},["+o(d)+"])",g=window.URL||window.webkitURL||window.mozURL||window.msURL,y=new Blob([v],{type:"text/javascript"});if(e&&e.bare)return y;var b=g.createObjectURL(y),x=new Worker(b);return x.objectURL=b,x}},{}],559:[function(t,e,r){e.exports.RADIUS=6378137,e.exports.FLATTENING=1/298.257223563,e.exports.POLAR_RADIUS=6356752.3142},{}],560:[function(t,e,r){var n;n=this,function(t){function e(t,e,n){var i=r(256*t,256*(e=Math.pow(2,n)-e-1),n),a=r(256*(t+1),256*(e+1),n);return i[0]+","+i[1]+","+a[0]+","+a[1]}function r(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}t.getURL=function(t,r,n,i,a,o){return o=o||{},t+"?"+["bbox="+e(n,i,a),"format="+(o.format||"image/png"),"service="+(o.service||"WMS"),"version="+(o.version||"1.1.1"),"request="+(o.request||"GetMap"),"srs="+(o.srs||"EPSG:3857"),"width="+(o.width||256),"height="+(o.height||256),"layers="+r].join("&")},t.getTileBBox=e,t.getMercCoords=r,Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof r&&void 0!==e?r:n.WhooTS=n.WhooTS||{})},{}],561:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(t,e){if("string"==typeof t){var r=t.match(l);return r?r[0]:""}var n=this._validateYear(t),i=t.month(),a=""+this.toChineseMonth(n,i);return e&&a.length<2&&(a="0"+a),this.isIntercalaryMonth(n,i)&&(a+="i"),a},monthNames:function(t){if("string"==typeof t){var e=t.match(c);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="\u95f0"+i),i},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(u);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="\u95f0"+i),i},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))"\u95f0"===e[0]&&(r=!0,e=e.substring(1)),"\u6708"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(e);else{var i=e[e.length-1];r="i"===i||"I"===i}return this.toMonthIndex(t,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(t,e){if(t.year&&(t=t.year()),"number"!=typeof t||t<1888||t>2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var i=this.intercalaryMonth(t);if(r&&e!==i||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!r&&e<=i?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e<r?e+1:e:e+1},intercalaryMonth:function(t){return t=this._validateYear(t),f[t-f[0]]>>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var i,o=this._validateYear(t,n.local.invalidyear),s=h[o-h[0]],l=s>>9&4095,c=s>>5&15,u=31&s;(i=a.newDate(l,c,u)).add(4-(i.dayOfWeek()||7),"d");var f=this.toJD(t,e,r)-i.toJD();return 1+Math.floor(f/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(t,e){t.year&&(e=t.month(),t=t.year()),t=this._validateYear(t);var r=f[t-f[0]];if(e>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(i.year()),e=i.month(),r=i.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,i){var a,o,s;if("object"==typeof t)o=t,a=e||{};else{var l="number"==typeof t&&t>=1888&&t<=2111;if(!l)throw new Error("Lunar year outside range 1888-2111");var c="number"==typeof e&&e>=1&&e<=12;if(!c)throw new Error("Lunar month outside range 1 - 12");var u,d="number"==typeof r&&r>=1&&r<=30;if(!d)throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(u=!1,a=n):(u=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:u}}s=o.day-1;var p,m=f[o.year-f[0]],v=m>>13;p=v?o.month>v?o.month:o.isIntercalary?o.month:o.month-1:o.month-1;for(var g=0;g<p;g++){var y=m&1<<12-g?30:29;s+=y}var b=h[o.year-h[0]],x=new Date(b>>9&4095,(b>>5&15)-1,(31&b)+s);return a.year=x.getFullYear(),a.month=1+x.getMonth(),a.day=x.getDate(),a}(t,s,r,o);return a.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=a.fromJD(t),r=function(t,e,r,n){var i,a;if("object"==typeof t)i=t,a=e||{};else{var o="number"==typeof t&&t>=1888&&t<=2111;if(!o)throw new Error("Solar year outside range 1888-2111");var s="number"==typeof e&&e>=1&&e<=12;if(!s)throw new Error("Solar month outside range 1 - 12");var l="number"==typeof r&&r>=1&&r<=31;if(!l)throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a=n||{}}var c=h[i.year-h[0]],u=i.year<<9|i.month<<5|i.day;a.year=u>=c?i.year:i.year-1,c=h[a.year-h[0]];var d,p=new Date(c>>9&4095,(c>>5&15)-1,31&c),m=new Date(i.year,i.month-1,i.day);d=Math.round((m-p)/864e5);var v,g=f[a.year-f[0]];for(v=0;v<13;v++){var y=g&1<<12-v?30:29;if(d<y)break;d-=y}var b=g>>13;!b||v<b?(a.isIntercalary=!1,a.month=1+v):v===b?(a.isIntercalary=!0,a.month=v):(a.isIntercalary=!1,a.month=v);return a.day=1+d,a}(e.year(),e.month(),e.day()),n=this.toMonthIndex(r.year,r.month,r.isIntercalary);return this.newDate(r.year,n,r.day)},fromString:function(t){var e=t.match(s),r=this._validateYear(+e[1]),n=+e[2],i=!!e[3],a=this.toMonthIndex(r,n,i),o=+e[4];return this.newDate(r,a,o)},add:function(t,e,r){var n=t.year(),i=t.month(),a=this.isIntercalaryMonth(n,i),s=this.toChineseMonth(n,i),l=Object.getPrototypeOf(o.prototype).add.call(this,t,e,r);if("y"===r){var c=l.year(),u=l.month(),f=this.isIntercalaryMonth(c,s),h=a&&f?this.toMonthIndex(c,s,!0):this.toMonthIndex(c,s,!1);h!==u&&l.month(h)}return l}});var s=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,l=/^\d?\d[iI]?/m,c=/^\u95f0?\u5341?[\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]?\u6708/m,u=/^\u95f0?\u5341?[\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]?/m;n.calendars.chinese=o;var f=[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],h=[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":575,"object-assign":443}],562:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"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,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return(t=i.year())<0&&t++,i.day()+30*(i.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),n.calendars.coptic=a},{"../main":575,"object-assign":443}],563:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"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,n.local.invalidYear),!1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),13},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.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,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(t,e,r){return(this._validate(t,e,r,n.local.invalidDate).day()+1)%8},weekDay:function(t,e,r){var n=this.dayOfWeek(t,e,r);return n>=2&&n<=6},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((i.year()-1)/100)+1]||""}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year()+(i.year()<0?1:0),e=i.month(),(r=i.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=a},{"../main":575,"object-assign":443}],564:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return(t=i.year())<0&&t++,i.day()+30*(i.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),n.calendars.ethiopian=a},{"../main":575,"object-assign":443}],565:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===t?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),12===e&&this.leapYear(t)?30:8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t<=0?t+1:t,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+r+1;if(e<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(s=1;s<e;s++)o+=this.daysInMonth(t,s)}else for(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 o(3*(n+1),7)<3&&n++,n},_delay2:function(t){var e=this._delay1(t-1),r=this._delay1(t);return this._delay1(t+1)-r==356?2:r-e==382?1:0},fromJD:function(t){t=Math.floor(t)+.5;for(var e=Math.floor(98496*(t-this.jdEpoch)/35975351)-1;t>=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=t<this.toJD(e,1,1)?7:1;t>this.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=a},{"../main":575,"object-assign":443}],566:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),r=i.day(),t=t<=0?t+1:t,r+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.islamic=a},{"../main":575,"object-assign":443}],567:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%4==0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),r=i.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),n.calendars.julian=a},{"../main":575,"object-assign":443}],568:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r<t.length;r++){var n=parseInt(t[r],10);if(Math.abs(n)>19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s((t-=this.jdEpoch)+20,20),s(t+4,13)]},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return i.day()+20*i.month()+360*i.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),n.calendars.mayan=a},{"../main":575,"object-assign":443}],569:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar;var o=n.instance("gregorian");i(a.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(e.year()+(e.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidMonth);(t=i.year())<0&&t++;for(var a=i.day(),s=1;s<i.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)}}),n.calendars.nanakshahi=a},{"../main":575,"object-assign":443}],570:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){if(t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=n.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var c=t-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==e&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===e?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),i=e.dayOfYear(),a=r+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r<t+2;r++)void 0===this.NEPALI_CALENDAR_DATA[r]&&(this.NEPALI_CALENDAR_DATA[r]=e)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2000:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),n.calendars.nepali=a},{"../main":575,"object-assign":443}],571:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Persian",jdEpoch:1948320.5,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Day","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Day","Bah","Esf"],dayNames:["Yekshambe","Doshambe","Seshambe","Ch\xe6harshambe","Panjshambe","Jom'e","Shambe"],dayNamesShort:["Yek","Do","Se","Ch\xe6","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.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,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t-(t>=0?474:473),s=474+o(a,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(a/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),i=2820;if(1029982!==n){var a=Math.floor(n/366),s=o(n,366);i=Math.floor((2134*a+2816*s+2815)/1028522)+a+1}var l=i+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=t-this.toJD(l,u,1)+1;return this.newDate(l,u,f)}}),n.calendars.persian=a,n.calendars.jalali=a},{"../main":575,"object-assign":443}],572:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":575,"object-assign":443}],573:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),n.calendars.thai=o},{"../main":575,"object-assign":443}],574:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(e.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(t,e){for(var r=this._validate(t,e,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,i=0,a=0;a<o.length;a++){if(o[a]>r)return o[i]-o[i-1];i++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate),a=12*(i.year()-1)+i.month()-15292;return i.day()+o[a-1]-1+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,c=e-o[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,e,r){var i=n.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(t=null!=t.year?t.year:t)>=1276&&t<=1500),i},_validate:function(t,e,r,i){var a=n.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),n.calendars.ummalqura=a;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":575,"object-assign":443}],575:[function(t,e,r){var n=t("object-assign");function i(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function a(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(i.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,i){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,i):n)||this.instance()).newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,function(e){return t[e]})}},substituteChineseDigits:function(t,e){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":t[a]+e[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),n(a.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(c.local.invalidDate||c.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(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new a(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+o(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,c.local.invalidMonth||c.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,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.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,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),i=t.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);i=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(!function(t){for(;o<t.minMonth;)a--,o+=t.monthsInYear(a);for(var e=t.monthsInYear(a);o>e-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;e=this._add(t,r*i[0]+a*i[1],i[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.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,c.local.invalidDate||c.regionalOptions[""].invalidDate);return c.instance().fromJD(this.toJD(n)).toJSDate()},fromJSDate:function(t){return this.fromJD(c.instance().fromJSDate(t).toJD())},_validate:function(t,e,r,n){if(t.year){if(0===this._validateLevel&&this.name!==t.calendar().name)throw(c.local.differentCalendars||c.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}}}),l.prototype=new s,n(l.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,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==0&&(t%100!=0||t%400==0)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,c.local.invalidMonth||c.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,c.local.invalidDate||c.regionalOptions[""].invalidDate);t=n.year(),e=n.month(),r=n.day(),t<0&&t++,e<3&&(e+=12,t--);var i=Math.floor(t/100),a=2-i+Math.floor(i/4);return Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r+a-1524.5},fromJD:function(t){var e=Math.floor(t+.5),r=Math.floor((e-1867216.25)/36524.25),n=(r=e+1+r-Math.floor(r/4))+1524,i=Math.floor((n-122.1)/365.25),a=Math.floor(365.25*i),o=Math.floor((n-a)/30.6001),s=n-a-Math.floor(30.6001*o),l=o-(o>13.5?13:1),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.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 c=e.exports=new i;c.cdate=a,c.baseCalendar=s,c.calendars.gregorian=l},{"object-assign":443}],576:[function(t,e,r){var n=t("object-assign"),i=t("./main");n(i.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),i.local=i.regionalOptions[""],n(i.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(i.baseCalendar.prototype,{UNIX_EPOCH:i.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:i.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,e,r){if("string"!=typeof t&&(r=e,e=t,t=""),!e)return"";if(e.calendar()!==this)throw i.local.invalidFormat||i.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n,a,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,h=r.monthNames||this.local.monthNames,d=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n<t.length&&t.charAt(w+n)===e;)n++;return w+=n-1,Math.floor(n/(r||1))>1}),p=function(t,e,r,n){var i=""+e;if(d(t,n))for(;i.length<r;)i="0"+i;return i},m=this,v=function(t){return"function"==typeof u?u.call(m,t,d("m")):b(p("m",t.month(),2))},g=function(t,e){return e?"function"==typeof h?h.call(m,t):h[t.month()-m.minMonth]:"function"==typeof f?f.call(m,t):f[t.month()-m.minMonth]},y=this.local.digits,b=function(t){return r.localNumbers&&y?y(t):t},x="",_=!1,w=0;w<t.length;w++)if(_)"'"!==t.charAt(w)||d("'")?x+=t.charAt(w):_=!1;else switch(t.charAt(w)){case"d":x+=b(p("d",e.day(),2));break;case"D":x+=(n="D",a=e.dayOfWeek(),o=l,s=c,d(n)?s[a]:o[a]);break;case"o":x+=p("o",e.dayOfYear(),3);break;case"w":x+=p("w",e.weekOfYear(),2);break;case"m":x+=v(e);break;case"M":x+=g(e,d("M"));break;case"y":x+=d("y",2)?e.year():(e.year()%100<10?"0":"")+e.year()%100;break;case"Y":d("Y",2),x+=e.formatYear();break;case"J":x+=e.toJD();break;case"@":x+=(e.toJD()-this.UNIX_EPOCH)*this.SECS_PER_DAY;break;case"!":x+=(e.toJD()-this.TICKS_EPOCH)*this.TICKS_PER_DAY;break;case"'":d("'")?x+="'":_=!0;break;default:x+=t.charAt(w)}return x},parseDate:function(t,e,r){if(null==e)throw i.local.invalidArguments||i.regionalOptions[""].invalidArguments;if(""===(e="object"==typeof e?e.toString():e+""))return null;t=t||this.local.dateFormat;var n=(r=r||{}).shortYearCutoff||this.shortYearCutoff;n="string"!=typeof n?n:this.today().year()%100+parseInt(n,10);for(var a=r.dayNamesShort||this.local.dayNamesShort,o=r.dayNames||this.local.dayNames,s=r.parseMonth||this.local.parseMonth,l=r.monthNumbers||this.local.monthNumbers,c=r.monthNamesShort||this.local.monthNamesShort,u=r.monthNames||this.local.monthNames,f=-1,h=-1,d=-1,p=-1,m=-1,v=!1,g=!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},b=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(A).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,A);return A+=s[0].length,parseInt(s[0],10)},x=this,_=function(){if("function"==typeof l){y("m");var t=l.call(x,e.substring(A));return A+=t.length,t}return b("m")},w=function(t,r,n,a){for(var o=y(t,a)?n:r,s=0;s<o.length;s++)if(e.substr(A,o[s].length).toLowerCase()===o[s].toLowerCase())return A+=o[s].length,s+x.minMonth;throw(i.local.unknownNameAt||i.regionalOptions[""].unknownNameAt).replace(/\{0\}/,A)},M=function(){if("function"==typeof u){var t=y("M")?u.call(x,e.substring(A)):c.call(x,e.substring(A));return A+=t.length,t}return w("M",c,u)},k=function(){if(e.charAt(A)!==t.charAt(T))throw(i.local.unexpectedLiteralAt||i.regionalOptions[""].unexpectedLiteralAt).replace(/\{0\}/,A);A++},A=0,T=0;T<t.length;T++)if(g)"'"!==t.charAt(T)||y("'")?k():g=!1;else switch(t.charAt(T)){case"d":p=b("d");break;case"D":w("D",a,o);break;case"o":m=b("o");break;case"w":b("w");break;case"m":d=_();break;case"M":d=M();break;case"y":var E=T;v=!y("y",2),T=E,h=b("y",2);break;case"Y":h=b("Y",2);break;case"J":f=b("J")+.5,"."===e.charAt(A)&&(A++,b("J"));break;case"@":f=b("@")/this.SECS_PER_DAY+this.UNIX_EPOCH;break;case"!":f=b("!")/this.TICKS_PER_DAY+this.TICKS_EPOCH;break;case"*":A=e.length;break;case"'":y("'")?k():g=!0;break;default:k()}if(A<e.length)throw i.local.unexpectedText||i.regionalOptions[""].unexpectedText;if(-1===h?h=this.today().year():h<100&&v&&(h+=-1===n?1900:this.today().year()-this.today().year()%100-(h<=n?0:100)),"string"==typeof d&&(d=s.call(this,h,d)),m>-1){d=1,p=m;for(var S=this.daysInMonth(h,d);p>S;S=this.daysInMonth(h,d))d++,p-=S}return f>-1?this.fromJD(f):this.newDate(h,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;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})},{"./main":575,"object-assign":443}],577:[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":116}],578:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":577}],579:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./common_defaults"),o=t("./attributes");e.exports=function(t,e,r,s,l){function c(r,i){return n.coerce(t,e,o,r,i)}s=s||{};var u=c("visible",!(l=l||{}).itemIsNotPlainObject),f=c("clicktoshow");if(!u&&!f)return e;a(t,e,r,c);for(var h=e.showarrow,d=["x","y"],p=[-10,-30],m={_fullLayout:r},v=0;v<2;v++){var g=d[v],y=i.coerceRef(t,e,m,g,"","paper");if(i.coercePosition(e,m,c,y,g,.5),h){var b="a"+g,x=i.coerceRef(t,e,m,b,"pixel");"pixel"!==x&&x!==y&&(x=e[b]="pixel");var _="pixel"===x?p[v]:.4;i.coercePosition(e,m,c,x,b,_)}c(g+"anchor"),c(g+"shift")}if(n.noneOrAll(t,e,["x","y"]),h&&n.noneOrAll(t,e,["ax","ay"]),f){var w=c("xclick"),M=c("yclick");e._xclick=void 0===w?e.x:i.cleanPosition(w,m,e.xref),e._yclick=void 0===M?e.y:i.cleanPosition(M,m,e.yref)}return e}},{"../../lib":724,"../../plots/cartesian/axes":770,"./attributes":581,"./common_defaults":584}],580:[function(t,e,r){"use strict";e.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],581:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:"annotation",visible:{valType:"boolean",dflt:!0,editType:"calcIfAutorange+arraydraw"},text:{valType:"string",editType:"calcIfAutorange+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calcIfAutorange+arraydraw"},font:i({editType:"calcIfAutorange+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calcIfAutorange+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calcIfAutorange+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calcIfAutorange+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calcIfAutorange+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calcIfAutorange+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calcIfAutorange+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calcIfAutorange+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calcIfAutorange+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calcIfAutorange+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calcIfAutorange+arraydraw"},ax:{valType:"any",editType:"calcIfAutorange+arraydraw"},ay:{valType:"any",editType:"calcIfAutorange+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calcIfAutorange+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calcIfAutorange+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calcIfAutorange+arraydraw"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calcIfAutorange+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calcIfAutorange+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calcIfAutorange+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}}},{"../../plots/cartesian/constants":775,"../../plots/font_attributes":797,"./arrow_paths":580}],582:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach(function(e){var r,n,a,o,s=i.getFromId(t,e.xref),l=i.getFromId(t,e.yref),c=3*e.arrowsize*e.arrowwidth||0,u=3*e.startarrowsize*e.arrowwidth||0;s&&s.autorange&&(r=c+e.xshift,n=c-e.xshift,a=u+e.xshift,o=u-e.xshift,e.axref===e.xref?(i.expand(s,[s.r2c(e.x)],{ppadplus:r,ppadminus:n}),i.expand(s,[s.r2c(e.ax)],{ppadplus:Math.max(e._xpadplus,a),ppadminus:Math.max(e._xpadminus,o)})):(a=e.ax?a+e.ax:a,o=e.ax?o-e.ax:o,i.expand(s,[s.r2c(e.x)],{ppadplus:Math.max(e._xpadplus,r,a),ppadminus:Math.max(e._xpadminus,n,o)}))),l&&l.autorange&&(r=c-e.yshift,n=c+e.yshift,a=u-e.yshift,o=u+e.yshift,e.ayref===e.yref?(i.expand(l,[l.r2c(e.y)],{ppadplus:r,ppadminus:n}),i.expand(l,[l.r2c(e.ay)],{ppadplus:Math.max(e._ypadplus,a),ppadminus:Math.max(e._ypadminus,o)})):(a=e.ay?a+e.ay:a,o=e.ay?o-e.ay:o,i.expand(l,[l.r2c(e.y)],{ppadplus:Math.max(e._ypadplus,r,a),ppadminus:Math.max(e._ypadminus,n,o)})))})}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.annotations);if(r.length&&t._fullData.length){var s={};for(var l in r.forEach(function(t){s[t.xref]=1,s[t.yref]=1}),s){var c=i.getFromId(t,l);if(c&&c.autorange)return n.syncOrAsync([a,o],t)}}}},{"../../lib":724,"../../plots/cartesian/axes":770,"./draw":587}],583:[function(t,e,r){"use strict";var n=t("../../plotly");function i(t,e){var r,n,i,o,s,l,c,u=t._fullLayout.annotations,f=[],h=[],d=[],p=(e||[]).length;for(r=0;r<u.length;r++)if(o=(i=u[r]).clicktoshow){for(n=0;n<p;n++)if(l=(s=e[n]).xaxis,c=s.yaxis,l._id===i.xref&&c._id===i.yref&&l.d2r(s.x)===a(i._xclick,l)&&c.d2r(s.y)===a(i._yclick,c)){(i.visible?"onout"===o?h:d:f).push(r);break}n===p&&i.visible&&"onout"===o&&h.push(r)}return{on:f,off:h,explicitOff:d}}function a(t,e){return"log"===e.type?e.l2r(t):e.d2r(t)}e.exports={hasClickToShow:function(t,e){var r=i(t,e);return r.on.length>0||r.explicitOff.length>0},onClick:function(t,e){var r,a=i(t,e),o=a.on,s=a.off.concat(a.explicitOff),l={};if(!o.length&&!s.length)return;for(r=0;r<o.length;r++)l["annotations["+o[r]+"].visible"]=!0;for(r=0;r<s.length;r++)l["annotations["+s[r]+"].visible"]=!1;return n.update(t,{},l)}}},{"../../plotly":765}],584:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../color");e.exports=function(t,e,r,a){a("opacity");var o=a("bgcolor"),s=a("bordercolor"),l=i.opacity(s);a("borderpad");var c=a("borderwidth"),u=a("showarrow");if(a("text",u?" ":r._dfltTitle.annotation),a("textangle"),n.coerceFont(a,"font",r.font),a("width"),a("align"),a("height")&&a("valign"),u){var f,h,d=a("arrowside");-1!==d.indexOf("end")&&(f=a("arrowhead"),h=a("arrowsize")),-1!==d.indexOf("start")&&(a("startarrowhead",f),a("startarrowsize",h)),a("arrowcolor",l?e.bordercolor:i.defaultLine),a("arrowwidth",2*(l&&c||1)),a("standoff"),a("startstandoff")}var p=a("hovertext"),m=r.hoverlabel||{};if(p){var v=a("hoverlabel.bgcolor",m.bgcolor||(i.opacity(o)?i.rgb(o):i.defaultLine)),g=a("hoverlabel.bordercolor",m.bordercolor||i.contrast(v));n.coerceFont(a,"hoverlabel.font",{family:m.font.family,size:m.font.size,color:m.font.color||g})}a("captureevents",!!p)}},{"../../lib":724,"../color":598}],585:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib/to_log_range");e.exports=function(t,e,r,a){e=e||{};var o="log"===r&&"linear"===e.type,s="linear"===r&&"log"===e.type;if(o||s)for(var l,c,u=t._fullLayout.annotations,f=e._id.charAt(0),h=0;h<u.length;h++)l=u[h],c="annotations["+h+"].",l[f+"ref"]===e._id&&d(f),l["a"+f+"ref"]===e._id&&d("a"+f);function d(t){var r=l[t],s=null;s=o?i(r,e.range):Math.pow(10,r),n(s)||(s=null),a(c+t,s)}}},{"../../lib/to_log_range":749,"fast-isnumeric":140}],586:[function(t,e,r){"use strict";var n=t("../../plots/array_container_defaults"),i=t("./annotation_defaults");e.exports=function(t,e){n(t,e,{name:"annotations",handleItemDefaults:i})}},{"../../plots/array_container_defaults":767,"./annotation_defaults":579}],587:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plotly"),a=t("../../plots/plots"),o=t("../../lib"),s=t("../../plots/cartesian/axes"),l=t("../color"),c=t("../drawing"),u=t("../fx"),f=t("../../lib/svg_text_utils"),h=t("../../lib/setcursor"),d=t("../dragelement"),p=t("./draw_arrow_head");function m(t,e){var r=t._fullLayout.annotations[e]||{};v(t,r,e,!1,s.getFromId(t,r.xref),s.getFromId(t,r.yref))}function v(t,e,r,a,s,m){var v,g,y=t._fullLayout,b=t._fullLayout._size,x=t._context.edits;a?(v="annotation-"+a,g=a+".annotations["+r+"]"):(v="annotation",g="annotations["+r+"]"),y._infolayer.selectAll("."+v+'[data-index="'+r+'"]').remove();var _="clip"+y._uid+"_ann"+r;if(e._input&&!1!==e.visible){var w={x:{},y:{}},M=+e.textangle||0,k=y._infolayer.append("g").classed(v,!0).attr("data-index",String(r)).style("opacity",e.opacity),A=k.append("g").classed("annotation-text-g",!0),T=x[e.showarrow?"annotationTail":"annotationPosition"],E=e.captureevents||x.annotationText||T,S=A.append("g").style("pointer-events",E?"all":null).call(h,"default").on("click",function(){t._dragging=!1;var i={index:r,annotation:e._input,fullAnnotation:e,event:n.event};a&&(i.subplotId=a),t.emit("plotly_clickannotation",i)});e.hovertext&&S.on("mouseover",function(){var r=e.hoverlabel,n=r.font,i=this.getBoundingClientRect(),a=t.getBoundingClientRect();u.loneHover({x0:i.left-a.left,x1:i.right-a.left,y:(i.top+i.bottom)/2-a.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color},{container:y._hoverlayer.node(),outerContainer:y._paper.node(),gd:t})}).on("mouseout",function(){u.loneUnhover(y._hoverlayer.node())});var L=e.borderwidth,C=e.borderpad,P=L+C,z=S.append("rect").attr("class","bg").style("stroke-width",L+"px").call(l.stroke,e.bordercolor).call(l.fill,e.bgcolor),O=e.width||e.height,D=y._topclips.selectAll("#"+_).data(O?[0]:[]);D.enter().append("clipPath").classed("annclip",!0).attr("id",_).append("rect"),D.exit().remove();var I=e.font,R=S.append("text").classed("annotation-text",!0).text(e.text);x.annotationText?R.call(f.makeEditable,{delegate:S,gd:t}).call(N).on("edit",function(r){e.text=r,this.call(N);var n={};n[g+".text"]=e.text,s&&s.autorange&&(n[s._name+".autorange"]=!0),m&&m.autorange&&(n[m._name+".autorange"]=!0),i.relayout(t,n)}):R.call(N)}else n.selectAll("#"+_).remove();function N(r){return r.call(c.font,I).attr({"text-anchor":{left:"start",right:"end"}[e.align]||"middle"}),f.convertToTspans(r,t,F),r}function F(){var r=R.selectAll("a");1===r.size()&&r.text()===R.text()&&S.insert("a",":first-child").attr({"xlink:xlink:href":r.attr("xlink:href"),"xlink:xlink:show":r.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(z.node());var n=S.select(".annotation-text-math-group"),u=!n.empty(),v=c.bBox((u?n:R).node()),E=v.width,C=v.height,I=e.width||E,N=e.height||C,F=Math.round(I+2*P),j=Math.round(N+2*P);function B(t,e){return"auto"===e&&(e=t<1/3?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}e._w=I,e._h=N;for(var U=!1,V=["x","y"],q=0;q<V.length;q++){var H,G,Y,W,X,Z=V[q],J=e[Z+"ref"]||Z,K=e["a"+Z+"ref"],Q={x:s,y:m}[Z],$=(M+("x"===Z?0:-90))*Math.PI/180,tt=F*Math.cos($),et=j*Math.sin($),rt=Math.abs(tt)+Math.abs(et),nt=e[Z+"anchor"],it=e[Z+"shift"]*("x"===Z?1:-1),at=w[Z];if(Q){var ot=Q.r2fraction(e[Z]);if((t._dragging||!Q.autorange)&&(ot<0||ot>1)&&(K===J?((ot=Q.r2fraction(e["a"+Z]))<0||ot>1)&&(U=!0):U=!0,U))continue;H=Q._offset+Q.r2p(e[Z]),W=.5}else"x"===Z?(Y=e[Z],H=b.l+b.w*Y):(Y=1-e[Z],H=b.t+b.h*Y),W=e.showarrow?.5:Y;if(e.showarrow){at.head=H;var st=e["a"+Z];X=tt*B(.5,e.xanchor)-et*B(.5,e.yanchor),K===J?(at.tail=Q._offset+Q.r2p(st),G=X):(at.tail=H+st,G=X+st),at.text=at.tail+X;var lt=y["x"===Z?"width":"height"];if("paper"===J&&(at.head=o.constrain(at.head,1,lt-1)),"pixel"===K){var ct=-Math.max(at.tail-3,at.text),ut=Math.min(at.tail+3,at.text)-lt;ct>0?(at.tail+=ct,at.text+=ct):ut>0&&(at.tail-=ut,at.text-=ut)}at.tail+=it,at.head+=it}else G=X=rt*B(W,nt),at.text=H+X;at.text+=it,X+=it,G+=it,e["_"+Z+"padplus"]=rt/2+G,e["_"+Z+"padminus"]=rt/2-G,e["_"+Z+"size"]=rt,e["_"+Z+"shift"]=X}if(U)S.remove();else{var ft=0,ht=0;if("left"!==e.align&&(ft=(I-E)*("center"===e.align?.5:1)),"top"!==e.valign&&(ht=(N-C)*("middle"===e.valign?.5:1)),u)n.select("svg").attr({x:P+ft-1,y:P+ht}).call(c.setClipUrl,O?_:null);else{var dt=P+ht-v.top,pt=P+ft-v.left;R.call(f.positionText,pt,dt).call(c.setClipUrl,O?_:null)}D.select("rect").call(c.setRect,P,P,I,N),z.call(c.setRect,L/2,L/2,F-L,j-L),S.call(c.setTranslate,Math.round(w.x.text-F/2),Math.round(w.y.text-j/2)),A.attr({transform:"rotate("+M+","+w.x.text+","+w.y.text+")"});var mt,vt,gt=function(r,n){k.selectAll(".annotation-arrow-g").remove();var u=w.x.head,f=w.y.head,h=w.x.tail+r,v=w.y.tail+n,y=w.x.text+r,_=w.y.text+n,T=o.rotationXYMatrix(M,y,_),E=o.apply2DTransform(T),L=o.apply2DTransform2(T),C=+z.attr("width"),P=+z.attr("height"),O=y-.5*C,D=O+C,I=_-.5*P,R=I+P,N=[[O,I,O,R],[O,R,D,R],[D,R,D,I],[D,I,O,I]].map(L);if(!N.reduce(function(t,e){return t^!!o.segmentsIntersect(u,f,u+1e6,f+1e6,e[0],e[1],e[2],e[3])},!1)){N.forEach(function(t){var e=o.segmentsIntersect(h,v,u,f,t[0],t[1],t[2],t[3]);e&&(h=e.x,v=e.y)});var F=e.arrowwidth,j=e.arrowcolor,B=e.arrowside,U=k.append("g").style({opacity:l.opacity(j)}).classed("annotation-arrow-g",!0),V=U.append("path").attr("d","M"+h+","+v+"L"+u+","+f).style("stroke-width",F+"px").call(l.stroke,l.rgb(j));if(p(V,B,e),x.annotationPosition&&V.node().parentNode&&!a){var q=u,H=f;if(e.standoff){var G=Math.sqrt(Math.pow(u-h,2)+Math.pow(f-v,2));q+=e.standoff*(h-u)/G,H+=e.standoff*(v-f)/G}var Y,W,X,Z=U.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-q)+","+(v-H),transform:"translate("+q+","+H+")"}).style("stroke-width",F+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");d.init({element:Z.node(),gd:t,prepFn:function(){var t=c.getTranslate(S);W=t.x,X=t.y,Y={},s&&s.autorange&&(Y[s._name+".autorange"]=!0),m&&m.autorange&&(Y[m._name+".autorange"]=!0)},moveFn:function(t,r){var n=E(W,X),i=n[0]+t,a=n[1]+r;S.call(c.setTranslate,i,a),Y[g+".x"]=s?s.p2r(s.r2p(e.x)+t):e.x+t/b.w,Y[g+".y"]=m?m.p2r(m.r2p(e.y)+r):e.y-r/b.h,e.axref===e.xref&&(Y[g+".ax"]=s.p2r(s.r2p(e.ax)+t)),e.ayref===e.yref&&(Y[g+".ay"]=m.p2r(m.r2p(e.ay)+r)),U.attr("transform","translate("+t+","+r+")"),A.attr({transform:"rotate("+M+","+i+","+a+")"})},doneFn:function(){i.relayout(t,Y);var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&>(0,0),T)d.init({element:S.node(),gd:t,prepFn:function(){vt=A.attr("transform"),mt={}},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?mt[g+".ax"]=s.p2r(s.r2p(e.ax)+t):mt[g+".ax"]=e.ax+t,e.ayref===e.yref?mt[g+".ay"]=m.p2r(m.r2p(e.ay)+r):mt[g+".ay"]=e.ay+r,gt(t,r);else{if(a)return;if(s)mt[g+".x"]=e.x+t/s._m;else{var i=e._xsize/b.w,o=e.x+(e._xshift-e.xshift)/b.w-i/2;mt[g+".x"]=d.align(o+t/b.w,i,0,1,e.xanchor)}if(m)mt[g+".y"]=e.y+r/m._m;else{var l=e._ysize/b.h,c=e.y-(e._yshift+e.yshift)/b.h-l/2;mt[g+".y"]=d.align(c-r/b.h,l,0,1,e.yanchor)}s&&m||(n=d.getCursor(s?.5:mt[g+".x"],m?.5:mt[g+".y"],e.xanchor,e.yanchor))}A.attr({transform:"translate("+t+","+r+")"+vt}),h(S,n)},doneFn:function(){h(S),i.relayout(t,mt);var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r<e.annotations.length;r++)e.annotations[r].visible&&m(t,r);return a.previousPromises(t)},drawOne:m,drawRaw:v}},{"../../lib":724,"../../lib/setcursor":743,"../../lib/svg_text_utils":747,"../../plotly":765,"../../plots/cartesian/axes":770,"../../plots/plots":833,"../color":598,"../dragelement":620,"../drawing":623,"../fx":640,"./draw_arrow_head":588,d3:128}],588:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color"),a=t("./arrow_paths");e.exports=function(t,e,r){var o,s,l,c,u=t.node(),f=a[r.arrowhead||0],h=a[r.startarrowhead||0],d=(r.arrowwidth||1)*(r.arrowsize||1),p=(r.arrowwidth||1)*(r.startarrowsize||1),m=e.indexOf("start")>=0,v=e.indexOf("end")>=0,g=f.backoff*d+r.standoff,y=h.backoff*p+r.startstandoff;if("line"===u.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},s={x:+t.attr("x2"),y:+t.attr("y2")};var b=o.x-s.x,x=o.y-s.y;if(c=(l=Math.atan2(x,b))+Math.PI,g&&y&&g+y>Math.sqrt(b*b+x*x))return void P();if(g){if(g*g>b*b+x*x)return void P();var _=g*Math.cos(l),w=g*Math.sin(l);s.x+=_,s.y+=w,t.attr({x2:s.x,y2:s.y})}if(y){if(y*y>b*b+x*x)return void P();var M=y*Math.cos(l),k=y*Math.sin(l);o.x-=M,o.y-=k,t.attr({x1:o.x,y1:o.y})}}else if("path"===u.nodeName){var A=u.getTotalLength(),T="";if(A<g+y)return void P();var E=u.getPointAtLength(0),S=u.getPointAtLength(.1);l=Math.atan2(E.y-S.y,E.x-S.x),o=u.getPointAtLength(Math.min(y,A)),T="0px,"+y+"px,";var L=u.getPointAtLength(A),C=u.getPointAtLength(A-.1);c=Math.atan2(L.y-C.y,L.x-C.x),s=u.getPointAtLength(Math.max(0,A-g)),T+=A-(T?y+g:g)+"px,"+A+"px",t.style("stroke-dasharray",T)}function P(){t.style("stroke-dasharray","0px,100px")}function z(e,a,o,s){e.path&&(e.noRotate&&(o=0),n.select(u.parentNode).append("path").attr({class:t.attr("class"),d:e.path,transform:"translate("+a.x+","+a.y+")"+(o?"rotate("+180*o/Math.PI+")":"")+"scale("+s+")"}).style({fill:i.rgb(r.arrowcolor),"stroke-width":0}))}m&&z(h,o,l,p),v&&z(f,s,c,d)}},{"../color":598,"./arrow_paths":580,d3:128}],589:[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"),includeBasePlot:t("../../plots/cartesian/include_components")("annotations"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne,drawRaw:n.drawRaw,hasClickToShow:i.hasClickToShow,onClick:i.onClick,convertCoords:t("./convert_coords")}},{"../../plots/cartesian/include_components":780,"./attributes":581,"./calc_autorange":582,"./click":583,"./convert_coords":585,"./defaults":586,"./draw":587}],590:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),i=t("../../plot_api/edit_types").overrideAll;e.exports=i({_isLinkedToArray:"annotation",visible:n.visible,x:{valType:"any"},y:{valType:"any"},z:{valType:"any"},ax:{valType:"number"},ay:{valType:"number"},xanchor:n.xanchor,xshift:n.xshift,yanchor:n.yanchor,yshift:n.yshift,text:n.text,textangle:n.textangle,font:n.font,width:n.width,height:n.height,opacity:n.opacity,align:n.align,valign:n.valign,bgcolor:n.bgcolor,bordercolor:n.bordercolor,borderpad:n.borderpad,borderwidth:n.borderwidth,showarrow:n.showarrow,arrowcolor:n.arrowcolor,arrowhead:n.arrowhead,startarrowhead:n.startarrowhead,arrowside:n.arrowside,arrowsize:n.arrowsize,startarrowsize:n.startarrowsize,arrowwidth:n.arrowwidth,standoff:n.standoff,startstandoff:n.startstandoff,hovertext:n.hovertext,hoverlabel:n.hoverlabel,captureevents:n.captureevents},"calc","from-root")},{"../../plot_api/edit_types":754,"../annotations/attributes":581}],591:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes");function a(t,e){var r=e.fullSceneLayout.domain,a=e.fullLayout._size,o={pdata:null,type:"linear",autorange:!1,range:[-1/0,1/0]};t._xa={},n.extendFlat(t._xa,o),i.setConvert(t._xa),t._xa._offset=a.l+r.x[0]*a.w,t._xa.l2p=function(){return.5*(1+t._pdata[0]/t._pdata[3])*a.w*(r.x[1]-r.x[0])},t._ya={},n.extendFlat(t._ya,o),i.setConvert(t._ya),t._ya._offset=a.t+(1-r.y[1])*a.h,t._ya.l2p=function(){return.5*(1-t._pdata[1]/t._pdata[3])*a.h*(r.y[1]-r.y[0])}}e.exports=function(t){for(var e=t.fullSceneLayout.annotations,r=0;r<e.length;r++)a(e[r],t);t.fullLayout._infolayer.selectAll(".annotation-"+t.id).remove()}},{"../../lib":724,"../../plots/cartesian/axes":770}],592:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("../../plots/array_container_defaults"),o=t("../annotations/common_defaults"),s=t("./attributes");function l(t,e,r,a,l){function c(r,i){return n.coerce(t,e,s,r,i)}function u(t){var n=t+"axis",a={_fullLayout:{}};return a._fullLayout[n]=r[n],i.coercePosition(e,a,c,t,t,.5)}return c("visible",!l.itemIsNotPlainObject)?(o(t,e,a.fullLayout,c),u("x"),u("y"),u("z"),n.noneOrAll(t,e,["x","y","z"]),e.xref="x",e.yref="y",e.zref="z",c("xanchor"),c("yanchor"),c("xshift"),c("yshift"),e.showarrow&&(e.axref="pixel",e.ayref="pixel",c("ax",-10),c("ay",-30),n.noneOrAll(t,e,["ax","ay"])),e):e}e.exports=function(t,e,r){a(t,e,{name:"annotations",handleItemDefaults:l,fullLayout:r.fullLayout})}},{"../../lib":724,"../../plots/array_container_defaults":767,"../../plots/cartesian/axes":770,"../annotations/common_defaults":584,"./attributes":590}],593:[function(t,e,r){"use strict";var n=t("../annotations/draw").drawRaw,i=t("../../plots/gl3d/project"),a=["x","y","z"];e.exports=function(t){for(var e=t.fullSceneLayout,r=t.dataScale,o=e.annotations,s=0;s<o.length;s++){for(var l=o[s],c=!1,u=0;u<3;u++){var f=a[u],h=l[f],d=e[f+"axis"].r2fraction(h);if(d<0||d>1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":822,"../annotations/draw":587}],594:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var a=r.attrRegex,o=Object.keys(t),s=0;s<o.length;s++){var l=o[s];a.test(l)&&(t[l].annotations||[]).length&&(i.pushUnique(e._basePlotModules,r),i.pushUnique(e._subplots.gl3d,l))}},convert:t("./convert"),draw:t("./draw")}},{"../../lib":724,"../../registry":854,"./attributes":590,"./convert":591,"./defaults":592,"./draw":593}],595:[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":561,"world-calendars/dist/calendars/coptic":562,"world-calendars/dist/calendars/discworld":563,"world-calendars/dist/calendars/ethiopian":564,"world-calendars/dist/calendars/hebrew":565,"world-calendars/dist/calendars/islamic":566,"world-calendars/dist/calendars/julian":567,"world-calendars/dist/calendars/mayan":568,"world-calendars/dist/calendars/nanakshahi":569,"world-calendars/dist/calendars/nepali":570,"world-calendars/dist/calendars/persian":571,"world-calendars/dist/calendars/taiwan":572,"world-calendars/dist/calendars/thai":573,"world-calendars/dist/calendars/ummalqura":574,"world-calendars/dist/main":575,"world-calendars/dist/plus":576}],596:[function(t,e,r){"use strict";var n=t("./calendars"),i=t("../../lib"),a=t("../../constants/numerical"),o=a.EPOCHJD,s=a.ONEDAY,l={valType:"enumerated",values:Object.keys(n.calendars),editType:"calc",dflt:"gregorian"},c=function(t,e,r,n){var a={};return a[r]=l,i.coerce(t,e,a,r,n)},u="##",f={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:u,w:u,c:{0:"D M d %X yyyy","-":"D M d %X yyyy"},x:{0:"mm/dd/yyyy","-":"mm/dd/yyyy"}};var h={};function d(t){var e=h[t];return e||(e=h[t]=n.instance(t))}function p(t){return i.extendFlat({},l,{description:t})}function m(t){return"Sets the calendar system to use with `"+t+"` date data."}var v={xcalendar:p(m("x"))},g=i.extendFlat({},v,{ycalendar:p(m("y"))}),y=i.extendFlat({},g,{zcalendar:p(m("z"))}),b=p(["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:g,bar:g,box:g,heatmap:g,contour:g,histogram:g,histogram2d:g,histogram2dcontour:g,scatter3d:y,surface:y,mesh3d:y,scattergl:g,ohlc:v,candlestick:v},layout:{calendar:p(["Sets the default calendar system to use for interpreting and","displaying dates throughout the plot."].join(" "))},subplots:{xaxis:{calendar:b},yaxis:{calendar:b},scene:{xaxis:{calendar:b},yaxis:{calendar:b},zaxis:{calendar:b}},polar:{radialaxis:{calendar:b}}},transforms:{filter:{valuecalendar:p(["Sets the calendar system to use for `value`, if it is a date."].join(" ")),targetcalendar:p(["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:l,handleDefaults:c,handleTraceDefaults:function(t,e,r,n){for(var i=0;i<r.length;i++)c(t,e,r[i]+"calendar",n.calendar)},CANONICAL_SUNDAY:{chinese:"2000-01-02",coptic:"2000-01-03",discworld:"2000-01-03",ethiopian:"2000-01-05",hebrew:"5000-01-01",islamic:"1000-01-02",julian:"2000-01-03",mayan:"5000-01-01",nanakshahi:"1000-01-05",nepali:"2000-01-05",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-04",thai:"2000-01-04",ummalqura:"1400-01-06"},CANONICAL_TICK:{chinese:"2000-01-01",coptic:"2000-01-01",discworld:"2000-01-01",ethiopian:"2000-01-01",hebrew:"5000-01-01",islamic:"1000-01-01",julian:"2000-01-01",mayan:"5000-01-01",nanakshahi:"1000-01-01",nepali:"2000-01-01",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-01",thai:"2000-01-01",ummalqura:"1400-01-01"},DFLTRANGE:{chinese:["2000-01-01","2001-01-01"],coptic:["1700-01-01","1701-01-01"],discworld:["1800-01-01","1801-01-01"],ethiopian:["2000-01-01","2001-01-01"],hebrew:["5700-01-01","5701-01-01"],islamic:["1400-01-01","1401-01-01"],julian:["2000-01-01","2001-01-01"],mayan:["5200-01-01","5201-01-01"],nanakshahi:["0500-01-01","0501-01-01"],nepali:["2000-01-01","2001-01-01"],persian:["1400-01-01","1401-01-01"],jalali:["1400-01-01","1401-01-01"],taiwan:["0100-01-01","0101-01-01"],thai:["2500-01-01","2501-01-01"],ummalqura:["1400-01-01","1401-01-01"]},getCal:d,worldCalFmt:function(t,e,r){for(var n,i,a,l,c,h=Math.floor((e+.05)/s)+o,p=d(r).fromJD(h),m=0;-1!==(m=t.indexOf("%",m));)"0"===(n=t.charAt(m+1))||"-"===n||"_"===n?(a=3,i=t.charAt(m+2),"_"===n&&(n="-")):(i=n,n="0",a=2),(l=f[i])?(c=l===u?u:p.formatDate(l[n]),t=t.substr(0,m)+c+t.substr(m+a),m+=c.length):m+=a;return t}}},{"../../constants/numerical":702,"../../lib":724,"./calendars":595}],597:[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},{}],598:[function(t,e,r){"use strict";var n=t("tinycolor2"),i=t("fast-isnumeric"),a=e.exports={},o=t("./attributes");a.defaults=o.defaults;var s=a.defaultLine=o.defaultLine;a.lightLine=o.lightLine;var l=a.background=o.background;function c(t){if(i(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*/),a="a"===e.charAt(3)&&4===n.length;if(!a&&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 a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}a.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},a.rgb=function(t){return a.tinyRGB(n(t))},a.opacity=function(t){return t?n(t).getAlpha():0},a.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},a.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||l).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},a.contrast=function(t,e,r){var i=n(t);return 1!==i.getAlpha()&&(i=n(a.combine(t,l))),(i.isDark()?e?i.lighten(e):l:r?i.darken(r):s).toString()},a.stroke=function(t,e){var r=n(e);t.style({stroke:a.tinyRGB(r),"stroke-opacity":r.getAlpha()})},a.fill=function(t,e){var r=n(e);t.style({fill:a.tinyRGB(r),"fill-opacity":r.getAlpha()})},a.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,o=Object.keys(t);for(e=0;e<o.length;e++)if(i=t[n=o[e]],"color"===n.substr(n.length-5))if(Array.isArray(i))for(r=0;r<i.length;r++)i[r]=c(i[r]);else t[n]=c(i);else if("colorscale"===n.substr(n.length-10)&&Array.isArray(i))for(r=0;r<i.length;r++)Array.isArray(i[r])&&(i[r][1]=c(i[r][1]));else if(Array.isArray(i)){var s=i[0];if(!Array.isArray(s)&&s&&"object"==typeof s)for(r=0;r<i.length;r++)a.clean(i[r])}else i&&"object"==typeof i&&a.clean(i)}}},{"./attributes":597,"fast-isnumeric":140,tinycolor2:526}],599:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/layout_attributes"),i=t("../../plots/font_attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll;e.exports=o({thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",dflt:1.02,min:-2,max:3},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number",dflt:.5,min:-2,max:3},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle"},ypad:{valType:"number",min:0,dflt:10},outlinecolor:n.linecolor,outlinewidth:n.linewidth,bordercolor:n.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:n.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:a({},n.ticks,{dflt:""}),ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,tickfont:i({}),tickangle:n.tickangle,tickformat:n.tickformat,tickformatstops:n.tickformatstops,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,separatethousands:n.separatethousands,exponentformat:n.exponentformat,showexponent:n.showexponent,title:{valType:"string"},titlefont:i({}),titleside:{valType:"enumerated",values:["right","top","bottom"],dflt:"top"}},"colorbars","from-root")},{"../../lib/extend":713,"../../plot_api/edit_types":754,"../../plots/cartesian/layout_attributes":782,"../../plots/font_attributes":797}],600:[function(t,e,r){"use strict";e.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}},{}],601:[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){var l=e.colorbar={},c=t.colorbar||{};function u(t,e){return n.coerce(c,l,s,t,e)}u("thickness","fraction"===u("thicknessmode")?30/(r.width-r.margin.l-r.margin.r):30),u("len","fraction"===u("lenmode")?1:r.height-r.margin.t-r.margin.b),u("x"),u("xanchor"),u("xpad"),u("y"),u("yanchor"),u("ypad"),n.noneOrAll(c,l,["x","y"]),u("outlinecolor"),u("outlinewidth"),u("bordercolor"),u("borderwidth"),u("bgcolor"),i(c,l,u,"linear");var f={outerTicks:!1,font:r.font};o(c,l,u,"linear",f),a(c,l,u,"linear",f),u("title",r._dfltTitle.colorbar),n.coerceFont(u,"titlefont",r.font),u("titleside")}},{"../../lib":724,"../../plots/cartesian/tick_label_defaults":790,"../../plots/cartesian/tick_mark_defaults":791,"../../plots/cartesian/tick_value_defaults":792,"./attributes":599}],602:[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"),c=t("../dragelement"),u=t("../../lib"),f=t("../../lib/extend").extendFlat,h=t("../../lib/setcursor"),d=t("../drawing"),p=t("../color"),m=t("../titles"),v=t("../../lib/svg_text_utils"),g=t("../../constants/alignment").LINE_SPACING,y=t("../../plots/cartesian/axis_defaults"),b=t("../../plots/cartesian/position_defaults"),x=t("../../plots/cartesian/layout_attributes"),_=t("./attributes"),w=t("./constants").cn;e.exports=function(t,e){var r={};function M(){var _=t._fullLayout,A=_._size;if("function"==typeof r.fillcolor||"function"==typeof r.line.color){var T,E,S=n.extent(("function"==typeof r.fillcolor?r.fillcolor:r.line.color).domain()),L=[],C=[],P="function"==typeof r.line.color?r.line.color:function(){return r.line.color},z="function"==typeof r.fillcolor?r.fillcolor:function(){return r.fillcolor},O=r.levels.end+r.levels.size/100,D=r.levels.size,I=1.001*S[0]-.001*S[1],R=1.001*S[1]-.001*S[0];for(E=0;E<1e5&&(T=r.levels.start+E*D,!(D>0?T>=O:T<=O));E++)T>I&&T<R&&L.push(T);if("function"==typeof r.fillcolor)if(r.filllevels)for(O=r.filllevels.end+r.filllevels.size/100,D=r.filllevels.size,E=0;E<1e5&&(T=r.filllevels.start+E*D,!(D>0?T>=O:T<=O));E++)T>S[0]&&T<S[1]&&C.push(T);else(C=L.map(function(t){return t-r.levels.size/2})).push(C[C.length-1]+r.levels.size);else r.fillcolor&&"string"==typeof r.fillcolor&&(C=[0]);r.levels.size<0&&(L.reverse(),C.reverse());var N,F=_.height-_.margin.t-_.margin.b,j=_.width-_.margin.l-_.margin.r,B=Math.round(r.thickness*("fraction"===r.thicknessmode?j:1)),U=B/A.w,V=Math.round(r.len*("fraction"===r.lenmode?F:1)),q=V/A.h,H=r.xpad/A.w,G=(r.borderwidth+r.outlinewidth)/2,Y=r.ypad/A.h,W=Math.round(r.x*A.w+r.xpad),X=r.x-U*({middle:.5,right:1}[r.xanchor]||0),Z=r.y+q*(({top:-.5,bottom:.5}[r.yanchor]||0)-.5),J=Math.round(A.h*(1-Z)),K=J-V,Q={type:"linear",range:S,tickmode:r.tickmode,nticks:r.nticks,tick0:r.tick0,dtick:r.dtick,tickvals:r.tickvals,ticktext:r.ticktext,ticks:r.ticks,ticklen:r.ticklen,tickwidth:r.tickwidth,tickcolor:r.tickcolor,showticklabels:r.showticklabels,tickfont:r.tickfont,tickangle:r.tickangle,tickformat:r.tickformat,exponentformat:r.exponentformat,separatethousands:r.separatethousands,showexponent:r.showexponent,showtickprefix:r.showtickprefix,tickprefix:r.tickprefix,showticksuffix:r.showticksuffix,ticksuffix:r.ticksuffix,title:r.title,titlefont:r.titlefont,showline:!0,anchor:"free",position:1},$={type:"linear",_id:"y"+e},tt={letter:"y",font:_.font,noHover:!0,calendar:_.calendar};if(y(Q,$,mt,tt,_),b(Q,$,mt,tt),$.position=r.x+H+U,M.axis=$,-1!==["top","bottom"].indexOf(r.titleside)&&($.titleside=r.titleside,$.titlex=r.x+H,$.titley=Z+("top"===r.titleside?q-Y:Y)),r.line.color&&"auto"===r.tickmode){$.tickmode="linear",$.tick0=r.levels.start;var et=r.levels.size,rt=u.constrain((J-K)/50,4,15)+1,nt=(S[1]-S[0])/((r.nticks||rt)*et);if(nt>1){var it=Math.pow(10,Math.floor(Math.log(nt)/Math.LN10));et*=it*u.roundUp(nt/it,[2,5,10]),(Math.abs(r.levels.start)/r.levels.size+1e-6)%1<2e-6&&($.tick0=0)}$.dtick=et}$.domain=[Z+Y,Z+q-Y],$.setScale();var at=_._infolayer.selectAll("g."+e).data([0]);at.enter().append("g").classed(e,!0).classed(w.colorbar,!0).each(function(){var t=n.select(this);t.append("rect").classed(w.cbbg,!0),t.append("g").classed(w.cbfills,!0),t.append("g").classed(w.cblines,!0),t.append("g").classed(w.cbaxis,!0).classed(w.crisp,!0),t.append("g").classed(w.cbtitleunshift,!0).append("g").classed(w.cbtitle,!0),t.append("rect").classed(w.cboutline,!0),t.select(".cbtitle").datum(0)}),at.attr("transform","translate("+Math.round(A.l)+","+Math.round(A.t)+")");var ot=at.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(A.l)+",-"+Math.round(A.t)+")");$._axislayer=at.select(".cbaxis");var st=0;if(-1!==["top","bottom"].indexOf(r.titleside)){var lt,ct=A.l+(r.x+H)*A.w,ut=$.titlefont.size;lt="top"===r.titleside?(1-(Z+q-Y))*A.h+A.t+3+.75*ut:(1-(Z+Y))*A.h+A.t-3-.25*ut,vt($._id+"title",{attributes:{x:ct,y:lt,"text-anchor":"start"}})}var ft,ht,dt,pt=u.syncOrAsync([o.previousPromises,function(){if(-1!==["top","bottom"].indexOf(r.titleside)){var e=at.select(".cbtitle"),a=e.select("text"),o=[-r.outlinewidth/2,r.outlinewidth/2],s=e.select(".h"+$._id+"title-math-group").node(),c=15.6;if(a.node()&&(c=parseInt(a.node().style.fontSize,10)*g),s?(st=d.bBox(s).height)>c&&(o[1]-=(st-c)/2):a.node()&&!a.classed(w.jsPlaceholder)&&(st=d.bBox(a.node()).height),st){if(st+=5,"top"===r.titleside)$.domain[1]-=st/A.h,o[1]*=-1;else{$.domain[0]+=st/A.h;var f=v.lineCount(a);o[1]+=(1-f)*c}e.attr("transform","translate("+o+")"),$.setScale()}}at.selectAll(".cbfills,.cblines").attr("transform","translate(0,"+Math.round(A.h*(1-$.domain[1]))+")"),$._axislayer.attr("transform","translate(0,"+Math.round(-A.t)+")");var h=at.select(".cbfills").selectAll("rect.cbfill").data(C);h.enter().append("rect").classed(w.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:W,width:Math.max(B,2),y:n.min(r),height:Math.max(n.max(r)-n.min(r),2),fill:o})});var p=at.select(".cblines").selectAll("path.cbline").data(r.line.color&&r.line.width?L:[]);return p.enter().append("path").classed(w.cbline,!0),p.exit().remove(),p.each(function(t){n.select(this).attr("d","M"+W+","+(Math.round($.c2p(t))+r.line.width/2%1)+"h"+B).call(d.lineGroupStyle,r.line.width,P(t),r.line.dash)}),$._axislayer.selectAll("g."+$._id+"tick,path").remove(),$._pos=W+B+(r.outlinewidth||0)/2-("outside"===r.ticks?1:0),$.side="right",u.syncOrAsync([function(){return l.doTicks(t,$,!0)},function(){if(-1===["top","bottom"].indexOf(r.titleside)){var e=$.titlefont.size,i=$._offset+$._length/2,a=A.l+($.position||0)*A.w+("right"===$.side?10+e*($.showticklabels?1:.5):-10-e*($.showticklabels?.5:0));vt("h"+$._id+"title",{avoid:{selection:n.select(t).selectAll("g."+$._id+"tick"),side:r.titleside,offsetLeft:A.l,offsetTop:0,maxShift:_.width},attributes:{x:a,y:i,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])},o.previousPromises,function(){var n=B+r.outlinewidth/2+d.bBox($._axislayer.node()).width;if((N=ot.select("text")).node()&&!N.classed(w.jsPlaceholder)){var i,a=ot.select(".h"+$._id+"title-math-group").node();i=a&&-1!==["top","bottom"].indexOf(r.titleside)?d.bBox(a).width:d.bBox(ot.node()).right-W-A.l,n=Math.max(n,i)}var s=2*r.xpad+n+r.borderwidth+r.outlinewidth/2,l=J-K;at.select(".cbbg").attr({x:W-r.xpad-(r.borderwidth+r.outlinewidth)/2,y:K-G,width:Math.max(s,2),height:Math.max(l+2*G,2)}).call(p.fill,r.bgcolor).call(p.stroke,r.bordercolor).style({"stroke-width":r.borderwidth}),at.selectAll(".cboutline").attr({x:W,y:K+r.ypad+("top"===r.titleside?st:0),width:Math.max(B,2),height:Math.max(l-2*r.ypad-st,2)}).call(p.stroke,r.outlinecolor).style({fill:"None","stroke-width":r.outlinewidth});var c=({center:.5,right:1}[r.xanchor]||0)*s;at.attr("transform","translate("+(A.l-c)+","+A.t+")"),o.autoMargin(t,e,{x:r.x,y:r.y,l:s*({right:1,center:.5}[r.xanchor]||0),r:s*({left:1,center:.5}[r.xanchor]||0),t:l*({bottom:1,middle:.5}[r.yanchor]||0),b:l*({top:1,middle:.5}[r.yanchor]||0)})}],t);if(pt&&pt.then&&(t._promises||[]).push(pt),t._context.edits.colorbarPosition)c.init({element:at.node(),gd:t,prepFn:function(){ft=at.attr("transform"),h(at)},moveFn:function(t,e){at.attr("transform",ft+" translate("+t+","+e+")"),ht=c.align(X+t/A.w,U,0,1,r.xanchor),dt=c.align(Z-e/A.h,q,0,1,r.yanchor);var n=c.getCursor(ht,dt,r.xanchor,r.yanchor);h(at,n)},doneFn:function(){h(at),void 0!==ht&&void 0!==dt&&a.restyle(t,{"colorbar.x":ht,"colorbar.y":dt},k().index)}});return pt}function mt(t,e){return u.coerce(Q,$,x,t,e)}function vt(e,r){var n,i=k();n=s.traceIs(i,"markerColorscale")?"marker.colorbar.title":"colorbar.title";var a={propContainer:$,propName:n,traceIndex:i.index,placeholder:_._dfltTitle.colorbar,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,f(a,r||{}))}_._infolayer.selectAll("g."+e).remove()}function k(){var r,n,i=e.substr(2);for(r=0;r<t._fullData.length;r++)if((n=t._fullData[r]).uid===i)return n}return Object.keys(_).forEach(function(t){r[t]=null}),r.fillcolor=null,r.line={color:null,width:null,dash:null},r.levels={start:null,end:null,size:null},r.filllevels=null,Object.keys(r).forEach(function(t){M[t]=function(e){return arguments.length?(r[t]=u.isPlainObject(r[t])?u.extendFlat(r[t],e):e,M):r[t]}}),M.options=function(t){return Object.keys(t).forEach(function(e){"function"==typeof M[e]&&M[e](t[e])}),M},M._opts=r,M}},{"../../constants/alignment":696,"../../lib":724,"../../lib/extend":713,"../../lib/setcursor":743,"../../lib/svg_text_utils":747,"../../plotly":765,"../../plots/cartesian/axes":770,"../../plots/cartesian/axis_defaults":772,"../../plots/cartesian/layout_attributes":782,"../../plots/cartesian/position_defaults":786,"../../plots/plots":833,"../../registry":854,"../color":598,"../dragelement":620,"../drawing":623,"../titles":689,"./attributes":599,"./constants":600,d3:128,tinycolor2:526}],603:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":724}],604:[function(t,e,r){"use strict";e.exports={zauto:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{zmin:void 0,zmax:void 0}},zmin:{valType:"number",dflt:null,editType:"plot",impliedEdits:{zauto:!1}},zmax:{valType:"number",dflt:null,editType:"plot",impliedEdits:{zauto:!1}},colorscale:{valType:"colorscale",editType:"calc",impliedEdits:{autocolorscale:!1}},autocolorscale:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{colorscale:void 0}},reversescale:{valType:"boolean",dflt:!1,editType:"calc"},showscale:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],605:[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 c=o+"auto",u=o+"min",f=o+"max",h=s[c],d=s[u],p=s[f],m=s.colorscale;!1===h&&void 0!==d||(d=n.aggNums(Math.min,null,e)),!1===h&&void 0!==p||(p=n.aggNums(Math.max,null,e)),d===p&&(d-=.5,p+=.5),s[u]=d,s[f]=p,l[u]=d,l[f]=p,l[c]=!1!==h||void 0===d&&void 0===p,s.autocolorscale&&(m=d*p<0?i.RdBu:d>=0?i.Reds:i.Blues,l.colorscale=m,s.reversescale&&(m=a(m)),s.colorscale=m)}},{"../../lib":724,"./flip_scale":610,"./scales":617}],606:[function(t,e,r){"use strict";var n=t("./attributes"),i=t("../../lib/extend").extendFlat;t("./scales.js");e.exports=function(t,e,r){return{color:{valType:"color",arrayOk:!0,editType:e||"style"},colorscale:i({},n.colorscale,{}),cauto:i({},n.zauto,{impliedEdits:{cmin:void 0,cmax:void 0}}),cmax:i({},n.zmax,{editType:e||n.zmax.editType,impliedEdits:{cauto:!1}}),cmin:i({},n.zmin,{editType:e||n.zmin.editType,impliedEdits:{cauto:!1}}),autocolorscale:i({},n.autocolorscale,{dflt:!1===r?r:n.autocolorscale.dflt}),reversescale:i({},n.reversescale,{})}}},{"../../lib/extend":713,"./attributes":604,"./scales.js":617}],607:[function(t,e,r){"use strict";var n=t("./scales");e.exports=n.RdBu},{"./scales":617}],608:[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,c,u){var f,h=u.prefix,d=u.cLetter,p=h.slice(0,h.length-1),m=h?i.nestedProperty(t,p).get()||{}:t,v=h?i.nestedProperty(e,p).get()||{}:e,g=m[d+"min"],y=m[d+"max"],b=m.colorscale;c(h+d+"auto",!(n(g)&&n(y)&&g<y)),c(h+d+"min"),c(h+d+"max"),void 0!==b&&(f=!s(b)),c(h+"autocolorscale",f);var x,_=c(h+"colorscale");(c(h+"reversescale")&&(v.colorscale=l(_)),"marker.line."!==h)&&(h&&(x=a(m)),c(h+"showscale",x)&&o(m,v,r))}},{"../../lib":724,"../colorbar/defaults":601,"../colorbar/has_colorbar":603,"./flip_scale":610,"./is_valid_scale":614,"fast-isnumeric":140}],609:[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}}},{}],610:[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}},{}],611:[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){if(e||(e=i),!t)return e;function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return"string"==typeof t&&(r(),"string"==typeof t&&r()),a(t)?t:e}},{"./default_scale":607,"./is_valid_scale_array":615,"./scales":617}],612:[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||!0===r.showscale||n(r.cmin)&&n(r.cmax)||a(r.colorscale)||i.isPlainObject(r.colorbar))}},{"../../lib":724,"./is_valid_scale":614,"fast-isnumeric":140}],613:[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":604,"./calc":605,"./default_scale":607,"./defaults":608,"./extract_scale":609,"./flip_scale":610,"./get_scale":611,"./has_colorscale":612,"./is_valid_scale":614,"./make_color_scale_func":616,"./scales":617}],614:[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":615,"./scales":617}],615:[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:526}],616:[function(t,e,r){"use strict";var n=t("d3"),i=t("tinycolor2"),a=t("fast-isnumeric"),o=t("../color");function s(t){var e={r:t[0],g:t[1],b:t[2],a:t[3]};return i(e).toRgbString()}e.exports=function(t,e){e=e||{};for(var r=t.domain,l=t.range,c=l.length,u=new Array(c),f=0;f<c;f++){var h=i(l[f]).toRgb();u[f]=[h.r,h.g,h.b,h.a]}var d,p=n.scale.linear().domain(r).range(u).clamp(!0),m=e.noNumericCheck,v=e.returnArray;return(d=m&&v?p:m?function(t){return s(p(t))}:v?function(t){return a(t)?p(t):i(t).isValid()?t:o.defaultLine}:function(t){return a(t)?s(p(t)):i(t).isValid()?t:o.defaultLine}).domain=p.domain,d.range=function(){return l},d}},{"../color":598,d3:128,"fast-isnumeric":140,tinycolor2:526}],617:[function(t,e,r){"use strict";e.exports={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]}},{}],618:[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}},{}],619:[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":724}],620:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),i=t("has-hover"),a=t("has-passive-events"),o=t("../../plotly"),s=t("../../lib"),l=t("../../plots/cartesian/constants"),c=t("../../constants/interactions"),u=e.exports={};u.align=t("./align"),u.getCursor=t("./cursor");var f=t("./unhover");function h(){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 d(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}u.unhover=f.wrapped,u.unhoverRaw=f.raw,u.init=function(t){var e,r,n,f,p,m,v,g,y=t.gd,b=1,x=c.DBLCLICKDELAY,_=t.element;y._mouseDownTime||(y._mouseDownTime=0),_.style.pointerEvents="all",_.onmousedown=M,a?(_._ontouchstart&&_.removeEventListener("touchstart",_._ontouchstart),_._ontouchstart=M,_.addEventListener("touchstart",M,{passive:!1})):_.ontouchstart=M;var w=t.clampFn||function(t,e,r){return Math.abs(t)<r&&(t=0),Math.abs(e)<r&&(e=0),[t,e]};function M(a){a.preventDefault(),y._dragged=!1,y._dragging=!0;var o=d(a);e=o[0],r=o[1],v=a.target,m=a,g=a.buttons&&2===a.buttons||a.ctrlKey,(n=(new Date).getTime())-y._mouseDownTime<x?b+=1:(b=1,y._mouseDownTime=n),t.prepFn&&t.prepFn(a,e,r),i&&!g?(p=h()).style.cursor=window.getComputedStyle(_).cursor:i||(p=document,f=window.getComputedStyle(document.documentElement).cursor,document.documentElement.style.cursor=window.getComputedStyle(_).cursor),document.addEventListener("mousemove",k),document.addEventListener("mouseup",A),document.addEventListener("touchmove",k),document.addEventListener("touchend",A)}function k(n){n.preventDefault();var i=d(n),a=t.minDrag||l.MINDRAG,o=w(i[0]-e,i[1]-r,a),s=o[0],c=o[1];(s||c)&&(y._dragged=!0,u.unhover(y)),y._dragged&&t.moveFn&&!g&&t.moveFn(s,c)}function A(e){if(document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",A),document.removeEventListener("touchmove",k),document.removeEventListener("touchend",A),e.preventDefault(),i?s.removeElement(p):f&&(p.documentElement.style.cursor=f,f=null),y._dragging){if(y._dragging=!1,(new Date).getTime()-y._mouseDownTime>x&&(b=Math.max(b-1,1)),y._dragged)t.doneFn&&t.doneFn(e);else if(t.clickFn&&t.clickFn(b,m),!g){var r;try{r=new MouseEvent("click",e)}catch(t){var n=d(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}v.dispatchEvent(r)}!function(t){t._dragging=!1,t._replotPending&&o.plot(t)}(y),y._dragged=!1}else y._dragged=!1}},u.coverSlip=h},{"../../constants/interactions":701,"../../lib":724,"../../plotly":765,"../../plots/cartesian/constants":775,"./align":618,"./cursor":619,"./unhover":621,"has-hover":255,"has-passive-events":256,"mouse-event-offset":425}],621:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/get_graph_div"),o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=a(t))._fullLayout&&i.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},{"../../lib/events":712,"../../lib/get_graph_div":719,"../../lib/throttle":748,"../fx/constants":635}],622:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],623:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../../registry"),s=t("../color"),l=t("../colorscale"),c=t("../../lib"),u=t("../../lib/svg_text_utils"),f=t("../../constants/xmlns_namespaces"),h=t("../../constants/alignment").LINE_SPACING,d=t("../../constants/interactions").DESELECTDIM,p=t("../../traces/scatter/subtypes"),m=t("../../traces/scatter/make_bubble_size_func"),v=e.exports={};v.font=function(t,e,r,n){c.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(s.fill,n)},v.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},v.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},v.setRect=function(t,e,r,n,i){t.call(v.setPosition,e,r).call(v.setSize,n,i)},v.translatePoint=function(t,e,r,n){var a=r.c2p(t.x),o=n.c2p(t.y);return!!(i(a)&&i(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",a).attr("y",o):e.attr("transform","translate("+a+","+o+")"),!0)},v.translatePoints=function(t,e,r){t.each(function(t){var i=n.select(this);v.translatePoint(t,i,e,r)})},v.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},v.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each(function(e){var a=e[0].trace,o=a.xcalendar,s=a.ycalendar;t.selectAll(".point,.textpoint").each(function(t){v.hideOutsideRangePoint(t,n.select(this),r,i,o,s)})})}},v.crispRound=function(t,e,r){return e&&i(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},v.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,l=i||a.dash||"";s.stroke(e,n||a.color),v.dashLine(e,l,o)},v.lineGroupStyle=function(t,e,r,i){t.style("fill","none").each(function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,l=i||a.dash||"";n.select(this).call(s.stroke,r||a.color).call(v.dashLine,l,o)})},v.dashLine=function(t,e,r){r=+r||0,e=v.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},v.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},v.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(s.fill,e)},v.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=n.select(this);try{r.call(s.fill,e[0].trace.fillcolor)}catch(e){c.error(e,t),r.remove()}})};var g=t("./symbol_defs");v.symbolNames=[],v.symbolFuncs=[],v.symbolNeedLines={},v.symbolNoDot={},v.symbolNoFill={},v.symbolList=[],Object.keys(g).forEach(function(t){var e=g[t];v.symbolList=v.symbolList.concat([e.n,t,e.n+100,t+"-open"]),v.symbolNames[e.n]=t,v.symbolFuncs[e.n]=e.f,e.needLine&&(v.symbolNeedLines[e.n]=!0),e.noDot?v.symbolNoDot[e.n]=!0:v.symbolList=v.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"]),e.noFill&&(v.symbolNoFill[e.n]=!0)});var y=v.symbolNames.length,b="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";function x(t,e){var r=t%100;return v.symbolFuncs[r](e)+(t>=200?b:"")}v.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=v.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=y||t>=400?0:Math.floor(Math.max(t,0))};var _={x1:1,x2:0,y1:0,y2:0},w={x1:0,x2:0,y1:1,y2:0};v.gradient=function(t,e,r,i,o,l){var u=e._fullLayout._defs.select(".gradients").selectAll("#"+r).data([i+o+l],c.identity);u.exit().remove(),u.enter().append("radial"===i?"radialGradient":"linearGradient").each(function(){var t=n.select(this);"horizontal"===i?t.attr(_):"vertical"===i&&t.attr(w),t.attr("id",r);var e=a(o),c=a(l);t.append("stop").attr({offset:"0%","stop-color":s.tinyRGB(c),"stop-opacity":c.getAlpha()}),t.append("stop").attr({offset:"100%","stop-color":s.tinyRGB(e),"stop-opacity":e.getAlpha()})}),t.style({fill:"url(#"+r+")","fill-opacity":null})},v.initGradients=function(t){var e=t._fullLayout._defs.selectAll(".gradients").data([0]);e.enter().append("g").classed("gradients",!0),e.selectAll("linearGradient,radialGradient").remove()},v.singlePointStyle=function(t,e,r,n,i,a){var l=r.marker;!function(t,e,r,n,i,a,l,c){if(o.traceIs(r,"symbols")){var u=m(r);e.attr("d",function(t){var e;e="various"===t.ms||"various"===a.size?3:p.isBubble(r)?u(t.ms):(a.size||6)/2,t.mrc=e;var n=v.symbolNumber(t.mx||a.symbol)||0;return t.om=n%200>=100,x(n,e)})}e.style("opacity",function(t){return(t.mo+1||a.opacity+1)-1});var f,h,d,g=!1;if(t.so?(d=l.outlierwidth,h=l.outliercolor,f=a.outliercolor):(d=(t.mlw+1||l.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,h="mlc"in t?t.mlcc=i(t.mlc):Array.isArray(l.color)?s.defaultLine:l.color,Array.isArray(a.color)&&(f=s.defaultLine,g=!0),f="mc"in t?t.mcc=n(t.mc):a.color||"rgba(0,0,0,0)"),t.om)e.call(s.stroke,f).style({"stroke-width":(d||1)+"px",fill:"none"});else{e.style("stroke-width",d+"px");var y=a.gradient,b=t.mgt;if(b?g=!0:b=y&&y.type,b&&"none"!==b){var _=t.mgc;_?g=!0:_=y.color;var w="g"+c._fullLayout._uid+"-"+r.uid;g&&(w+="-"+t.i),e.call(v.gradient,c,w,b,f,_)}else e.call(s.fill,f);d&&e.call(s.stroke,h)}}(t,e,r,n,i,l,l.line,a)},v.pointStyle=function(t,e,r){if(t.size()){var i=e.marker,a=v.tryColorscale(i,""),o=v.tryColorscale(i,"line");t.each(function(t){v.singlePointStyle(t,n.select(this),e,a,o,r)})}},v.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=e.selected||{},i=e.unselected||{},a=e.marker||{},l=r.marker||{},c=i.marker||{},u=a.opacity,f=l.opacity,h=c.opacity,p=void 0!==f,m=void 0!==h;t.each(function(t){var e,r=n.select(this),i=t.mo,a=void 0!==i;(a||p||m)&&(t.selected?p&&(e=f):e=m?h:d*(a?i:u)),void 0!==e&&r.style("opacity",e)});var g=l.color,y=c.color;(g||y)&&t.each(function(t){var e,r=n.select(this);t.selected?g&&(e=g):y&&(e=y),e&&s.fill(r,e)});var b=l.size,_=c.size,w=void 0!==b,M=void 0!==_;o.traceIs(e,"symbols")&&(w||M)&&t.each(function(t){var e,r=n.select(this),i=t.mrc,o=t.mx||a.symbol||0;e=t.selected?w?b/2:i:M?_/2:i,r.attr("d",x(v.symbolNumber(o),e)),t.mrc2=e})}},v.tryColorscale=function(t,e){var r=e?c.nestedProperty(t,e).get():t,n=r.colorscale,i=r.color;return n&&Array.isArray(i)?l.makeColorScaleFunc(l.extractScale(n,r.cmin,r.cmax)):c.identity};var M={start:1,end:-1,middle:0,bottom:1,top:-1};function k(t,e,r,i){var a=n.select(t.node().parentNode),o=-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle",s=-1!==e.indexOf("left")?"end":-1!==e.indexOf("right")?"start":"middle",l=i?i/.8+1:0,c=(u.lineCount(t)-1)*h+1,f=M[s]*l,d=.75*r+M[o]*l+(M[o]-1)*c*r/2;t.attr("text-anchor",s),a.attr("transform","translate("+f+","+d+")")}function A(t,e){var r=t.ts||e.textfont.size;return i(r)&&r>0?r:0}v.textPointStyle=function(t,e,r){t.each(function(t){var i=n.select(this),a=c.extractOption(t,e,"tx","text");if(a){var o=t.tp||e.textposition,s=A(t,e);i.call(v.font,t.tf||e.textfont.family,s,t.tc||e.textfont.color).text(a).call(u.convertToTspans,r).call(k,o,s,t.mrc)}else i.remove()})},v.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=e.selected||{},i=e.unselected||{};t.each(function(t){var a,o=n.select(this),l=t.tc||e.textfont.color,c=t.tp||e.textposition,u=A(t,e),f=(r.textfont||{}).color,h=(i.textfont||{}).color;t.selected?f&&(a=f):h?a=h:f||(a=s.addOpacity(l,d)),a&&s.fill(o,a),k(o,c,u,t.mrc2||t.mrc)})}};var T=.5;function E(t,e,r,i){var a=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],c=Math.pow(a*a+o*o,T/2),u=Math.pow(s*s+l*l,T/2),f=(u*u*a-c*c*s)*i,h=(u*u*o-c*c*l)*i,d=3*u*(c+u),p=3*c*(c+u);return[[n.round(e[0]+(d&&f/d),2),n.round(e[1]+(d&&h/d),2)],[n.round(e[0]-(p&&f/p),2),n.round(e[1]-(p&&h/p),2)]]}v.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r<t.length-1;r++)i.push(E(t[r-1],t[r],t[r+1],e));for(n+="Q"+i[0][0]+" "+t[1],r=2;r<t.length-1;r++)n+="C"+i[r-2][1]+" "+i[r-1][0]+" "+t[r];return n+="Q"+i[t.length-3][1]+" "+t[t.length-1]},v.smoothclosed=function(t,e){if(t.length<3)return"M"+t.join("L")+"Z";var r,n="M"+t[0],i=t.length-1,a=[E(t[i],t[0],t[1],e)];for(r=1;r<i;r++)a.push(E(t[r-1],t[r],t[r+1],e));for(a.push(E(t[i-1],t[i],t[0],e)),r=1;r<=i;r++)n+="C"+a[r-1][1]+" "+a[r][0]+" "+t[r];return n+="C"+a[i][1]+" "+a[0][0]+" "+t[0]+"Z"};var S={hv:function(t,e){return"H"+n.round(e[0],2)+"V"+n.round(e[1],2)},vh:function(t,e){return"V"+n.round(e[1],2)+"H"+n.round(e[0],2)},hvh:function(t,e){return"H"+n.round((t[0]+e[0])/2,2)+"V"+n.round(e[1],2)+"H"+n.round(e[0],2)},vhv:function(t,e){return"V"+n.round((t[1]+e[1])/2,2)+"H"+n.round(e[0],2)+"V"+n.round(e[1],2)}},L=function(t,e){return"L"+n.round(e[0],2)+","+n.round(e[1],2)};v.steps=function(t){var e=S[t]||L;return function(t){for(var r="M"+n.round(t[0][0],2)+","+n.round(t[0][1],2),i=1;i<t.length;i++)r+=e(t[i-1],t[i]);return r}},v.makeTester=function(){var t=n.select("body").selectAll("#js-plotly-tester").data([0]);t.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 e=t.selectAll(".js-reference-point").data([0]);e.enter().append("path").classed("js-reference-point",!0).attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"}),v.tester=t,v.testref=e},v.savedBBoxes={};var C=0;function P(t){var e=t.getAttribute("data-unformatted");if(null!==e)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}v.bBox=function(t,e,r){var i,a,o;if(r||(r=P(t)),r){if(i=v.savedBBoxes[r])return c.extendFlat({},i)}else if(1===t.childNodes.length){var s=t.childNodes[0];if(r=P(s)){var l=+s.getAttribute("x")||0,f=+s.getAttribute("y")||0,h=s.getAttribute("transform");if(!h){var d=v.bBox(s,!1,r);return l&&(d.left+=l,d.right+=l),f&&(d.top+=f,d.bottom+=f),d}if(r+="~"+l+"~"+f+"~"+h,i=v.savedBBoxes[r])return c.extendFlat({},i)}}e?a=t:(o=v.tester.node(),a=t.cloneNode(!0),o.appendChild(a)),n.select(a).attr("transform",null).call(u.positionText,0,0);var p=a.getBoundingClientRect(),m=v.testref.node().getBoundingClientRect();e||o.removeChild(a);var g={height:p.height,width:p.width,left:p.left-m.left,top:p.top-m.top,right:p.right-m.left,bottom:p.bottom-m.top};return C>=1e4&&(v.savedBBoxes={},C=0),r&&(v.savedBBoxes[r]=g),C++,c.extendFlat({},g)},v.setClipUrl=function(t,e){if(e){var r="#"+e,i=n.select("base");i.size()&&i.attr("href")&&(r=window.location.href.split("#")[0]+r),t.attr("clip-path","url("+r+")")}else t.attr("clip-path",null)},v.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+e[0]||0,y:+e[1]||0}},v.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=" translate("+e+", "+r+")").trim(),t[i]("transform",a),a},v.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+e[0]||1,y:+e[1]||1}},v.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+=" scale("+e+", "+r+")").trim(),t[i]("transform",a),a},v.setPointGroupScale=function(t,e,r){var n,i,a;return e=e||1,r=r||1,i=1===e&&1===r?"":" scale("+e+","+r+")",a=/\s*sc.*/,t.each(function(){n=(this.getAttribute("transform")||"").replace(a,""),n=(n+=i).trim(),this.setAttribute("transform",n)}),i};var z=/translate\([^)]*\)\s*$/;v.setTextPointsScale=function(t,e,r){t.each(function(){var t,i=n.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(z);t=1===e&&1===r?[]:["translate("+o+","+s+")","scale("+e+","+r+")","translate("+-o+","+-s+")"],l&&t.push(l),i.attr("transform",t.join(" "))}})}},{"../../constants/alignment":696,"../../constants/interactions":701,"../../constants/xmlns_namespaces":704,"../../lib":724,"../../lib/svg_text_utils":747,"../../registry":854,"../../traces/scatter/make_bubble_size_func":1065,"../../traces/scatter/subtypes":1070,"../color":598,"../colorscale":613,"./symbol_defs":624,d3:128,"fast-isnumeric":140,tinycolor2:526}],624:[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);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),a=n.round(-.309*t,2);return"M"+e+","+a+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+a+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),a=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),c=n.round(.118*e,2),u=n.round(.809*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+c+"L"+o+","+u+"L0,"+n.round(.382*e,2)+"L-"+o+","+u+"L-"+a+","+c+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+i+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+i+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0,noFill:!0}}},{d3:128}],625:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],626:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../registry"),a=t("../../plots/cartesian/axes"),o=t("./compute_error");function s(t,e,r,i){var s=e["error_"+i]||{},l=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=o(s),u=0;u<t.length;u++){var f=t[u],h=f[i];if(n(r.c2l(h))){var d=c(h,u);if(n(d[0])&&n(d[1])){var p=f[i+"s"]=h-d[0],m=f[i+"h"]=h+d[1];l.push(p,m)}}}a.expand(r,l,{padded:!0})}}e.exports=function(t){for(var e=t.calcdata,r=0;r<e.length;r++){var n=e[r],o=n[0].trace;if(i.traceIs(o,"errorBarsOK")){var l=a.getFromId(t,o.xaxis),c=a.getFromId(t,o.yaxis);s(n,o,l,"x"),s(n,o,c,"y")}}}},{"../../plots/cartesian/axes":770,"../../registry":854,"./compute_error":627,"fast-isnumeric":140}],627:[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)]}}},{}],628:[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){var l="error_"+s.axis,c=e[l]={},u=t[l]||{};function f(t,e){return a.coerce(u,c,o,t,e)}if(!1!==f("visible",void 0!==u.array||void 0!==u.value||"sqrt"===u.type)){var h=f("type","array"in u?"data":"percent"),d=!0;if("sqrt"!==h&&(d=f("symmetric",!(("data"===h?"arrayminus":"valueminus")in u))),"data"===h){if(f("array")||(c.array=[]),f("traceref"),!d)f("arrayminus")||(c.arrayminus=[]),f("tracerefminus")}else"percent"!==h&&"constant"!==h||(f("value"),d||f("valueminus"));var p="copy_"+s.inherit+"style";if(s.inherit)(e["error_"+s.inherit]||{}).visible&&f(p,!(u.color||n(u.thickness)||n(u.width)));s.inherit&&c[p]||(f("color",r),f("thickness"),f("width",i.traceIs(e,"gl3d")?0:4))}}},{"../../lib":724,"../../registry":854,"./attributes":625,"fast-isnumeric":140}],629:[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":625,"./calc":626,"./defaults":628,"./plot":630,"./style":631}],630:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../drawing"),o=t("../../traces/scatter/subtypes");e.exports=function(t,e,r){var s=e.xaxis,l=e.yaxis,c=r&&r.duration>0;t.each(function(t){var u,f=t[0].trace,h=f.error_x||{},d=f.error_y||{};f.ids&&(u=function(t){return t.id});var p=o.hasMarkers(f)&&f.marker.maxdisplayed>0;d.visible||h.visible||(t=[]);var m=n.select(this).selectAll("g.errorbar").data(t,u);if(m.exit().remove(),t.length){h.visible||m.selectAll("path.xerror").remove(),d.visible||m.selectAll("path.yerror").remove(),m.style("opacity",1);var v=m.enter().append("g").classed("errorbar",!0);c&&v.style("opacity",0).transition().duration(r.duration).style("opacity",1),a.setClipUrl(m,e.layerClipId),m.each(function(t){var e=n.select(this),a=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0)));void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,s,l);if(!p||t.vis){var o;if(d.visible&&i(a.x)&&i(a.yh)&&i(a.ys)){var u=d.width;o="M"+(a.x-u)+","+a.yh+"h"+2*u+"m-"+u+",0V"+a.ys,a.noYS||(o+="m-"+u+",0h"+2*u);var f=e.select("path.yerror");!f.size()?f=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(f=f.transition().duration(r.duration).ease(r.easing)),f.attr("d",o)}if(h.visible&&i(a.y)&&i(a.xh)&&i(a.xs)){var m=(h.copy_ystyle?d:h).width;o="M"+a.xh+","+(a.y-m)+"v"+2*m+"m0,-"+m+"H"+a.xs,a.noXS||(o+="m0,-"+m+"v"+2*m);var v=e.select("path.xerror");!v.size()?v=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(v=v.transition().duration(r.duration).ease(r.easing)),v.attr("d",o)}}})}})}},{"../../traces/scatter/subtypes":1070,"../drawing":623,d3:128,"fast-isnumeric":140}],631:[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":598,d3:128}],632:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0,editType:"none"},bordercolor:{valType:"color",arrayOk:!0,editType:"none"},font:n({arrayOk:!0,editType:"none"}),namelength:{valType:"integer",min:-1,arrayOk:!0,editType:"none"},editType:"calc"}}},{"../../plots/font_attributes":797}],633:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");function a(t,e,r,i){i=i||n.identity,Array.isArray(t)&&(e[0][r]=i(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s<e.length;s++){var l=e[s],c=l[0].trace;if(!i.traceIs(c,"pie")){var u=i.traceIs(c,"2dMap")?a:n.fillArray;u(c.hoverinfo,l,"hi",o(c)),c.hoverlabel&&(u(c.hoverlabel.bgcolor,l,"hbg"),u(c.hoverlabel.bordercolor,l,"hbc"),u(c.hoverlabel.font.size,l,"hts"),u(c.hoverlabel.font.color,l,"htc"),u(c.hoverlabel.font.family,l,"htf"),u(c.hoverlabel.namelength,l,"hnl"))}}}},{"../../lib":724,"../../registry":854}],634:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./hover").hover;e.exports=function(t,e,r){var a=n.getComponentMethod("annotations","onClick")(t,t._hoverdata);function o(){t.emit("plotly_click",{points:t._hoverdata,event:e})}void 0!==r&&i(t,e,r,!0),t._hoverdata&&e&&e.target&&(a&&a.then?a.then(o):o(),e.stopImmediatePropagation&&e.stopImmediatePropagation())}},{"../../registry":854,"./hover":638}],635:[function(t,e,r){"use strict";e.exports={MAXDIST:20,YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}},{}],636:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("./hoverlabel_defaults");e.exports=function(t,e,r,o){a(t,e,function(r,a){return n.coerce(t,e,i,r,a)},o.hoverlabel)}},{"../../lib":724,"./attributes":632,"./hoverlabel_defaults":639}],637:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./constants");r.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},r.flat=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=e;return r},r.p2c=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=t[n].p2c(e);return r},r.getDistanceFunction=function(t,e,n,i){return"closest"===t?i||r.quadrature(e,n):"x"===t?e:n},r.getClosest=function(t,e,r){if(!1!==r.index)r.index>=0&&r.index<t.length?r.distance=0:r.index=!1;else for(var n=0;n<t.length;n++){var i=e(t[n]);i<=r.distance&&(r.index=n,r.distance=i)}return r},r.inbox=function(t,e){return t*e<0||0===t?i.MAXDIST*(.6-.3/Math.max(3,Math.abs(t-e))):1/0},r.quadrature=function(t,e){return function(r){var n=t(r),i=e(r);return Math.sqrt(n*n+i*i)}},r.makeEventData=function(t,e,n){var i="index"in t?t.index:t.pointNumber,a={data:e._input,fullData:e,curveNumber:e.index,pointNumber:i};if(e._indexToPoints){var o=e._indexToPoints[i];1===o.length?a.pointIndex=o[0]:a.pointIndices=o}else a.pointIndex=i;return e._module.eventData?a=e._module.eventData(a,t,e,n,i):("xVal"in t?a.x=t.xVal:"x"in t&&(a.x=t.x),"yVal"in t?a.y=t.yVal:"y"in t&&(a.y=t.y),t.xa&&(a.xaxis=t.xa),t.ya&&(a.yaxis=t.ya),void 0!==t.zLabelVal&&(a.z=t.zLabelVal)),r.appendArrayPointValue(a,e,i),a},r.appendArrayPointValue=function(t,e,r){var i=e._arrayAttrs;if(i)for(var a=0;a<i.length;a++){var l=i[a],c=o(l);if(void 0===t[c]){var u=s(n.nestedProperty(e,l).get(),r);void 0!==u&&(t[c]=u)}}},r.appendArrayMultiPointValues=function(t,e,r){var i=e._arrayAttrs;if(i)for(var a=0;a<i.length;a++){var l=i[a],c=o(l);if(void 0===t[c]){for(var u=n.nestedProperty(e,l).get(),f=new Array(r.length),h=0;h<r.length;h++)f[h]=s(u,r[h]);t[c]=f}}};var a={ids:"id",locations:"location",labels:"label",values:"value","marker.colors":"color"};function o(t){return a[t]||t}function s(t,e){return Array.isArray(e)?Array.isArray(t)&&Array.isArray(t[e[0]])?t[e[0]][e[1]]:void 0:t[e]}},{"../../lib":724,"./constants":635}],638:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../../lib"),s=t("../../lib/events"),l=t("../../lib/svg_text_utils"),c=t("../../lib/override_cursor"),u=t("../drawing"),f=t("../color"),h=t("../dragelement"),d=t("../../plots/cartesian/axes"),p=t("../../registry"),m=t("./helpers"),v=t("./constants"),g=v.YANGLE,y=Math.PI*g/180,b=1/Math.sin(y),x=Math.cos(y),_=Math.sin(y),w=v.HOVERARROWSIZE,M=v.HOVERTEXTPAD;function k(t,e,r){var i,a,o=e.hovermode,s=e.rotateLabels,c=e.bgColor,h=e.container,d=e.outerContainer,p=e.commonLabelOpts||{},m=e.fontFamily||v.HOVERFONT,y=e.fontSize||v.HOVERFONTSIZE,b=t[0],x=b.xa,_=b.ya,k="y"===o?"yLabel":"xLabel",A=b[k],T=(String(A)||"").split(" ")[0],E=d.node().getBoundingClientRect(),S=E.top,L=E.width,C=E.height,P=b.distance<=e.hoverdistance&&("x"===o||"y"===o);for(i=0;i<t.length;i++){a=t[i].hoverinfo||t[i].trace.hoverinfo;var z=Array.isArray(a)?a:a.split("+");if(-1===z.indexOf("all")&&-1===z.indexOf(o)){P=!1;break}}var O=h.selectAll("g.axistext").data(P?[0]:[]);O.enter().append("g").classed("axistext",!0),O.exit().remove(),O.each(function(){var e=n.select(this),i=e.selectAll("path").data([0]),a=e.selectAll("text").data([0]);i.enter().append("path").style({"stroke-width":"1px"}),i.style({fill:p.bgcolor||f.defaultLine,stroke:p.bordercolor||f.background}),a.enter().append("text").attr("data-notex",1),a.text(A).call(u.font,p.font.family||m,p.font.size||y,p.font.color||f.background).call(l.positionText,0,0).call(l.convertToTspans,r),e.attr("transform","");var s=a.node().getBoundingClientRect();if("x"===o){a.attr("text-anchor","middle").call(l.positionText,0,"top"===x.side?S-s.bottom-w-M:S-s.top+w+M);var c="top"===x.side?"-":"";i.attr("d","M0,0L"+w+","+c+w+"H"+(M+s.width/2)+"v"+c+(2*M+s.height)+"H-"+(M+s.width/2)+"V"+c+w+"H-"+w+"Z"),e.attr("transform","translate("+(x._offset+(b.x0+b.x1)/2)+","+(_._offset+("top"===x.side?0:_._length))+")")}else{a.attr("text-anchor","right"===_.side?"start":"end").call(l.positionText,("right"===_.side?1:-1)*(M+w),S-s.top-s.height/2);var h="right"===_.side?"":"-";i.attr("d","M0,0L"+h+w+","+w+"V"+(M+s.height/2)+"h"+h+(2*M+s.width)+"V-"+(M+s.height/2)+"H"+h+w+"V-"+w+"Z"),e.attr("transform","translate("+(x._offset+("right"===_.side?x._length:0))+","+(_._offset+(b.y0+b.y1)/2)+")")}t=t.filter(function(t){return void 0!==t.zLabelVal||(t[k]||"").split(" ")[0]===T})});var D=h.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 D.enter().append("g").classed("hovertext",!0).each(function(){var t=n.select(this);t.append("rect").call(f.fill,f.addOpacity(c,.8)),t.append("text").classed("name",!0),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(u.font,m,y)}),D.exit().remove(),D.each(function(t){var e=n.select(this).attr("transform",""),i="",a="",h=f.opacity(t.color)?t.color:f.defaultLine,d=f.combine(h,c),p=t.borderColor||f.contrast(d);if(void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name){i=l.plainText(t.name||"");var v=Math.round(t.nameLength);v>-1&&i.length>v&&(i=v>3?i.substr(0,v-3)+"...":i.substr(0,v))}void 0!==t.extraText&&(a+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(a+="x: "+t.xLabel+"<br>"),void 0!==t.yLabel&&(a+="y: "+t.yLabel+"<br>"),a+=(a?"z: ":"")+t.zLabel):P&&t[o+"Label"]===A?a=t[("x"===o?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(a=t.yLabel):a=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(a+=(a?"<br>":"")+t.text),""===a&&(""===i&&e.remove(),a=i);var b=e.select("text.nums").call(u.font,t.fontFamily||m,t.fontSize||y,t.fontColor||p).text(a).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r),x=e.select("text.name"),_=0;i&&i!==a?(x.call(u.font,t.fontFamily||m,t.fontSize||y,d).text(i).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r),_=x.node().getBoundingClientRect().width+2*M):(x.remove(),e.select("rect").remove()),e.select("path").style({fill:d,stroke:p});var k,T,E=b.node().getBoundingClientRect(),z=t.xa._offset+(t.x0+t.x1)/2,O=t.ya._offset+(t.y0+t.y1)/2,D=Math.abs(t.x1-t.x0),I=Math.abs(t.y1-t.y0),R=E.width+w+M+_;t.ty0=S-E.top,t.bx=E.width+2*M,t.by=E.height+2*M,t.anchor="start",t.txwidth=E.width,t.tx2width=_,t.offset=0,s?(t.pos=z,k=O+I/2+R<=C,T=O-I/2-R>=0,"top"!==t.idealAlign&&k||!T?k?(O+=I/2,t.anchor="start"):t.anchor="middle":(O-=I/2,t.anchor="end")):(t.pos=O,k=z+D/2+R<=L,T=z-D/2-R>=0,"left"!==t.idealAlign&&k||!T?k?(z+=D/2,t.anchor="start"):t.anchor="middle":(z-=D/2,t.anchor="end")),b.attr("text-anchor",t.anchor),_&&x.attr("text-anchor",t.anchor),e.attr("transform","translate("+z+","+O+")"+(s?"rotate("+g+")":""))}),D}function A(t,e){t.each(function(t){var r=n.select(this);if(t.del)r.remove();else{var i="end"===t.anchor?-1:1,a=r.select("text.nums"),o={start:1,end:-1,middle:0}[t.anchor],s=o*(w+M),c=s+o*(t.txwidth+M),f=0,h=t.offset;"middle"===t.anchor&&(s-=t.tx2width/2,c-=t.tx2width/2),e&&(h*=-_,f=t.offset*x),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"+(i*w+f)+","+(w+h)+"v"+(t.by/2-w)+"h"+i*t.bx+"v-"+t.by+"H"+(i*w+f)+"V"+(h-w)+"Z"),a.call(l.positionText,s+f,h+t.ty0-t.by/2+M),t.tx2width&&(r.select("text.name").call(l.positionText,c+o*M+f,h+t.ty0-t.by/2+M),r.select("rect").call(u.setRect,c+(o-1)*t.tx2width/2+f,h-t.by/2-1,t.tx2width,t.by+2))}})}function T(t,e){var r=t.index,n=t.trace||{},i=t.cd[0],a=t.cd[r]||{},s=Array.isArray(r)?function(t,e){return o.castOption(i,r,t)||o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(a,n,t,e)};function l(e,r,n){var i=s(r,n);i&&(t[e]=i)}if(l("hoverinfo","hi","hoverinfo"),l("color","hbg","hoverlabel.bgcolor"),l("borderColor","hbc","hoverlabel.bordercolor"),l("fontFamily","htf","hoverlabel.font.family"),l("fontSize","hts","hoverlabel.font.size"),l("fontColor","htc","hoverlabel.font.color"),l("nameLength","hnl","hoverlabel.namelength"),t.posref="y"===e?(t.x0+t.x1)/2:(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:d.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:d.hoverLabelText(t.ya,t.yLabelVal),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var c=d.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+c+" / -"+d.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+c,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var u=d.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+u+" / -"+d.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+u,"y"===e&&(t.distance+=1)}var f=t.hoverinfo||t.trace.hoverinfo;return"all"!==f&&(-1===(f=Array.isArray(f)?f:f.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===f.indexOf("y")&&(t.yLabel=void 0),-1===f.indexOf("z")&&(t.zLabel=void 0),-1===f.indexOf("text")&&(t.text=void 0),-1===f.indexOf("name")&&(t.name=void 0)),t}function E(t,e){var r,n,i=e.container,o=e.fullLayout,s=e.event,l=!!t.hLinePoint,c=!!t.vLinePoint;if(i.selectAll(".spikeline").remove(),c||l){var h=f.combine(o.plot_bgcolor,o.paper_bgcolor);if(l){var d,p,m=t.hLinePoint;r=m&&m.xa,"cursor"===(n=m&&m.ya).spikesnap?(d=s.pointerX,p=s.pointerY):(d=r._offset+(m.x0+m.x1)/2,p=n._offset+(m.y0+m.y1)/2);var v,g,y=a.readability(m.color,h)<1.5?f.contrast(h):m.color,b=n.spikemode,x=n.spikethickness,_=n.spikecolor||y,w=n._boundingBox,M=(w.left+w.right)/2<d?w.right:w.left;-1===b.indexOf("toaxis")&&-1===b.indexOf("across")||(-1!==b.indexOf("toaxis")&&(v=M,g=d),-1!==b.indexOf("across")&&(v=n._counterSpan[0],g=n._counterSpan[1]),i.insert("line",":first-child").attr({x1:v,x2:g,y1:p,y2:p,"stroke-width":x,stroke:_,"stroke-dasharray":u.dashStyle(n.spikedash,x)}).classed("spikeline",!0).classed("crisp",!0),i.insert("line",":first-child").attr({x1:v,x2:g,y1:p,y2:p,"stroke-width":x+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)),-1!==b.indexOf("marker")&&i.insert("circle",":first-child").attr({cx:M+("right"!==n.side?x:-x),cy:p,r:x,fill:_}).classed("spikeline",!0)}if(c){var k,A,T=t.vLinePoint;r=T&&T.xa,n=T&&T.ya,"cursor"===r.spikesnap?(k=s.pointerX,A=s.pointerY):(k=r._offset+(T.x0+T.x1)/2,A=n._offset+(T.y0+T.y1)/2);var E,S,L=a.readability(T.color,h)<1.5?f.contrast(h):T.color,C=r.spikemode,P=r.spikethickness,z=r.spikecolor||L,O=r._boundingBox,D=(O.top+O.bottom)/2<A?O.bottom:O.top;-1===C.indexOf("toaxis")&&-1===C.indexOf("across")||(-1!==C.indexOf("toaxis")&&(E=D,S=A),-1!==C.indexOf("across")&&(E=r._counterSpan[0],S=r._counterSpan[1]),i.insert("line",":first-child").attr({x1:k,x2:k,y1:E,y2:S,"stroke-width":P,stroke:z,"stroke-dasharray":u.dashStyle(r.spikedash,P)}).classed("spikeline",!0).classed("crisp",!0),i.insert("line",":first-child").attr({x1:k,x2:k,y1:E,y2:S,"stroke-width":P+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)),-1!==C.indexOf("marker")&&i.insert("circle",":first-child").attr({cx:k,cy:D-("top"!==r.side?P:-P),r:P,fill:z}).classed("spikeline",!0)}}}function S(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}r.hover=function(t,e,r,a){t=o.getGraphDiv(t),o.throttle(t._fullLayout._uid+v.HOVERID,v.HOVERMINTIME,function(){!function(t,e,r,a){r||(r="xy");var l=Array.isArray(r)?r:[r],u=t._fullLayout,v=u._plots||[],g=v[r];if(g){var y=g.overlays.map(function(t){return t.id});l=l.concat(y)}for(var x=l.length,_=new Array(x),w=new Array(x),M=!1,L=0;L<x;L++){var C=l[L],P=v[C];if(P)M=!0,_[L]=d.getFromId(t,P.xaxis._id),w[L]=d.getFromId(t,P.yaxis._id);else{var z=u[C]._subplot;_[L]=z.xaxis,w[L]=z.yaxis}}var O=e.hovermode||u.hovermode;O&&!M&&(O="closest");if(-1===["x","y","closest"].indexOf(O)||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return h.unhoverRaw(t,e);var D,I,R,N,F,j,B,U,V,q,H,G,Y,W=-1===u.hoverdistance?1/0:u.hoverdistance,X=-1===u.spikedistance?1/0:u.spikedistance,Z=[],J=[],K={hLinePoint:null,vLinePoint:null};if(Array.isArray(e))for(O="array",R=0;R<e.length;R++)"skip"!==(F=t.calcdata[e[R].curveNumber||0])[0].trace.hoverinfo&&J.push(F);else{for(N=0;N<t.calcdata.length;N++)F=t.calcdata[N],"skip"!==(j=F[0].trace).hoverinfo&&-1!==l.indexOf(m.getSubplot(j))&&J.push(F);var Q,$,tt=!e.target;if(tt)Q="xpx"in e?e.xpx:_[0]._length/2,e.pointerX=Q+_[0]._offset,$="ypx"in e?e.ypx:w[0]._length/2,e.pointerY=$+w[0]._offset;else{if(!1===s.triggerHandler(t,"plotly_beforehover",e))return;var et=e.target.getBoundingClientRect();if(Q=e.clientX-et.left,$=e.clientY-et.top,Q<0||Q>et.width||$<0||$>et.height)return h.unhoverRaw(t,e);e.pointerX=e.offsetX,e.pointerY=e.offsetY}if(D="xval"in e?m.flat(l,e.xval):m.p2c(_,Q),I="yval"in e?m.flat(l,e.yval):m.p2c(w,$),!i(D[0])||!i(I[0]))return o.warn("Fx.hover failed",e,t),h.unhoverRaw(t,e)}var rt=1/0;for(N=0;N<J.length;N++)if((F=J[N])&&F[0]&&F[0].trace&&!0===F[0].trace.visible&&(j=F[0].trace,-1===["carpet","contourcarpet"].indexOf(j._module.name))){if(B=m.getSubplot(j),U=l.indexOf(B),V=O,G={cd:F,trace:j,xa:_[U],ya:w[U],index:!1,distance:Math.min(rt,W),color:f.defaultLine,name:j.name,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},u[B]&&(G.subplot=u[B]._subplot),Y=Z.length,"array"===V){var nt=e[N];"pointNumber"in nt?(G.index=nt.pointNumber,V="closest"):(V="","xval"in nt&&(q=nt.xval,V="x"),"yval"in nt&&(H=nt.yval,V=V?"closest":"y"))}else q=D[U],H=I[U];if(0!==W)if(j._module&&j._module.hoverPoints){var it=j._module.hoverPoints(G,q,H,V,u._hoverlayer);if(it)for(var at,ot=0;ot<it.length;ot++)at=it[ot],i(at.x0)&&i(at.y0)&&Z.push(T(at,O))}else o.log("Unrecognized trace type in hover:",j);if("closest"===O&&Z.length>Y&&(Z.splice(0,Y),rt=Z[0].distance),u._has("cartesian")&&0!==X&&0===Z.length){G.distance=X,G.index=!1;var st=j._module.hoverPoints(G,q,H,"closest",u._hoverlayer);if(st){var lt,ct=st.filter(function(t){return t.xa.showspikes});if(ct.length){var ut=ct[0];i(ut.x0)&&i(ut.y0)&&(lt=pt(ut),(!K.vLinePoint||K.vLinePoint.distance>lt.distance)&&(K.vLinePoint=lt))}var ft=st.filter(function(t){return t.ya.showspikes});if(ft.length){var ht=ft[0];i(ht.x0)&&i(ht.y0)&&(lt=pt(ht),(!K.hLinePoint||K.hLinePoint.distance>lt.distance)&&(K.hLinePoint=lt))}}}}function dt(t,e){if(!t.length)return null;var r=t.map(function(t,e){var r=t.xa,n=t.ya,i=r.c2p(q),a=n.c2p(H),o=function(t){var e=t.kink,r=(t.x1+t.x0)/2-i,n=(t.y1+t.y0)/2-a;return Math.max(Math.sqrt(r*r+n*n)-e,1-3/e)}(t);return{distance:o,index:e}});return r=r.filter(function(t){return t.distance<=e}).sort(function(t,e){return t.distance-e.distance}),r.length?t[r[0].index]:null}function pt(t){return t?{xa:t.xa,ya:t.ya,x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1,distance:t.distance,curveNumber:t.trace.index,color:t.color,pointNumber:t.index}:null}var mt={fullLayout:u,container:u._hoverlayer,outerContainer:u._paperdiv,event:e},vt=t._spikepoints,gt={vLinePoint:K.vLinePoint,hLinePoint:K.hLinePoint};if(t._spikepoints=gt,u._has("cartesian")&&0!==X&&0!==Z.length){var yt=Z.filter(function(t){return t.ya.showspikes}),bt=dt(yt,X);K.hLinePoint=pt(bt);var xt=Z.filter(function(t){return t.xa.showspikes}),_t=dt(xt,X);K.vLinePoint=pt(_t)}if(0===Z.length){var wt=h.unhoverRaw(t,e);return!u._has("cartesian")||null===K.hLinePoint&&null===K.vLinePoint||S(vt)&&E(K,mt),wt}u._has("cartesian")&&S(vt)&&E(K,mt);Z.sort(function(t,e){return t.distance-e.distance});var Mt=t._hoverdata,kt=[];for(R=0;R<Z.length;R++){var At=Z[R];kt.push(m.makeEventData(At,At.trace,At.cd))}t._hoverdata=kt;var Tt="y"===O&&J.length>1,Et=f.combine(u.plot_bgcolor||f.background,u.paper_bgcolor),St={hovermode:O,rotateLabels:Tt,bgColor:Et,container:u._hoverlayer,outerContainer:u._paperdiv,commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance},Lt=k(Z,St,t);if(function(t,e,r){var n,i,a,o,s,l,c,u=0,f=t.map(function(t,n){var i=t[e];return[{i:n,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===i._id.charAt(0)?b:1)/2,pmin:0,pmax:"x"===i._id.charAt(0)?r.width:r.height}]}).sort(function(t,e){return t[0].posref-e[0].posref});function h(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 c=0;for(o=0;o<t.length;o++)(l=t[o]).pos+l.dp+l.size>e.pmax&&c++;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,c--);for(o=0;o<t.length&&!(c<=0);o++)if((l=t[o]).pos<e.pmin+1)for(l.del=!0,c--,a=2*l.size,s=t.length-1;s>=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,c--)}}}for(;!n&&u<=t.length;){for(u++,n=!0,o=0;o<f.length-1;){var d=f[o],p=f[o+1],m=d[d.length-1],v=p[0];if((i=m.pos+m.dp+m.size-v.pos-v.dp+v.size)>.01&&m.pmin===v.pmin&&m.pmax===v.pmax){for(s=p.length-1;s>=0;s--)p[s].dp+=i;for(d.push.apply(d,p),f.splice(o+1,1),c=0,s=d.length-1;s>=0;s--)c+=d[s].dp;for(a=c/d.length,s=d.length-1;s>=0;s--)d[s].dp-=a;n=!1}else o++}f.forEach(h)}for(o=f.length-1;o>=0;o--){var g=f[o];for(s=g.length-1;s>=0;s--){var y=g[s],x=t[y.i];x.offset=y.dp,x.del=y.del}}}(Z,Tt?"xa":"ya",u),A(Lt,Tt),e.target&&e.target.tagName){var Ct=p.getComponentMethod("annotations","hasClickToShow")(t,kt);c(n.select(e.target),Ct?"pointer":"")}if(!e.target||a||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber))return!0}return!1}(t,0,Mt))return;Mt&&t.emit("plotly_unhover",{event:e,points:Mt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:_,yaxes:w,xvals:D,yvals:I})}(t,e,r,a)})},r.loneHover=function(t,e){var r={color:t.color||f.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},i=n.select(e.container),a=e.outerContainer?n.select(e.outerContainer):i,o={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||f.background,container:i,outerContainer:a,hoverdistance:v.MAXDIST},s=k([r],o,e.gd);return A(s,o.rotateLabels),s.node()}},{"../../lib":724,"../../lib/events":712,"../../lib/override_cursor":735,"../../lib/svg_text_utils":747,"../../plots/cartesian/axes":770,"../../registry":854,"../color":598,"../dragelement":620,"../drawing":623,"./constants":635,"./helpers":637,d3:128,"fast-isnumeric":140,tinycolor2:526}],639:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,i){r("hoverlabel.bgcolor",(i=i||{}).bgcolor),r("hoverlabel.bordercolor",i.bordercolor),r("hoverlabel.namelength",i.namelength),n.coerceFont(r,"hoverlabel.font",i.font)}},{"../../lib":724}],640:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return i.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return i.castOption(t,r,"hoverinfo",function(r){return i.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)})},hover:t("./hover").hover,unhover:a.unhover,loneHover:t("./hover").loneHover,loneUnhover:function(t){var e=i.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":724,"../dragelement":620,"./attributes":632,"./calc":633,"./click":634,"./constants":635,"./defaults":636,"./helpers":637,"./hover":638,"./layout_attributes":641,"./layout_defaults":642,"./layout_global_defaults":643,d3:128}],641:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../plots/font_attributes")({editType:"none"});i.family.dflt=n.HOVERFONT,i.size.dflt=n.HOVERFONTSIZE,e.exports={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1],editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:20,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"}}},{"../../plots/font_attributes":797,"./constants":635}],642:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}var o;a("dragmode"),e._has("cartesian")?(e._isHoriz=function(t){for(var e=!0,r=0;r<t.length;r++){var n=t[r];if("h"!==n.orientation){e=!1;break}}return e}(r),o=e._isHoriz?"y":"x"):o="closest",a("hovermode",o)&&(a("hoverdistance"),a("spikedistance"));var s=e._has("mapbox"),l=e._has("geo"),c=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l)&&1===c||s&&l&&2===c)&&(e.dragmode="pan")}},{"../../lib":724,"./layout_attributes":641}],643:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./hoverlabel_defaults"),a=t("./layout_attributes");e.exports=function(t,e){i(t,e,function(r,i){return n.coerce(t,e,a,r,i)})}},{"../../lib":724,"./hoverlabel_defaults":639,"./layout_attributes":641}],644:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:"image",visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",n.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",n.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"}},{"../../plots/cartesian/constants":775}],645:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib/to_log_range");e.exports=function(t,e,r,a){e=e||{};var o="log"===r&&"linear"===e.type,s="linear"===r&&"log"===e.type;if(o||s)for(var l,c,u=t._fullLayout.images,f=e._id.charAt(0),h=0;h<u.length;h++)if(c="images["+h+"].",(l=u[h])[f+"ref"]===e._id){var d=l[f],p=l["size"+f],m=null,v=null;if(o){m=i(d,e.range);var g=p/Math.pow(10,m)/2;v=2*Math.log(g+Math.sqrt(1+g*g))/Math.LN10}else v=(m=Math.pow(10,d))*(Math.pow(10,p/2)-Math.pow(10,-p/2));n(m)?n(v)||(v=null):(m=null,v=null),a(c+f,m),a(c+"size"+f,v)}}},{"../../lib/to_log_range":749,"fast-isnumeric":140}],646:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("../../plots/array_container_defaults"),o=t("./attributes");function s(t,e,r){function a(r,i){return n.coerce(t,e,o,r,i)}if(!a("visible",!!a("source")))return e;a("layer"),a("xanchor"),a("yanchor"),a("sizex"),a("sizey"),a("sizing"),a("opacity");for(var s={_fullLayout:r},l=["x","y"],c=0;c<2;c++){var u=l[c],f=i.coerceRef(t,e,s,u,"paper");i.coercePosition(e,s,a,f,u,0)}return e}e.exports=function(t,e){a(t,e,{name:"images",handleItemDefaults:s})}},{"../../lib":724,"../../plots/array_container_defaults":767,"../../plots/cartesian/axes":770,"./attributes":644}],647:[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){var e,r,s=t._fullLayout,l=[],c={},u=[];for(r=0;r<s.images.length;r++){var f=s.images[r];if(f.visible)if("below"===f.layer&&"paper"!==f.xref&&"paper"!==f.yref){e=f.xref+f.yref;var h=s._plots[e];if(!h){u.push(f);continue}h.mainplot&&(e=h.mainplot.id),c[e]||(c[e]=[]),c[e].push(f)}else"above"===f.layer?l.push(f):u.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}}};function p(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){var n=new Image;function i(){r.remove(),t()}this.img=n,n.setAttribute("crossOrigin","anonymous"),n.onerror=i,n.onload=function(){var e=document.createElement("canvas");e.width=this.width,e.height=this.height,e.getContext("2d").drawImage(this,0,0);var n=e.toDataURL("image/png");r.attr("xlink:href",n),t()},r.on("error",i),n.src=e.source}.bind(this));t._promises.push(i)}}function m(e){var r=n.select(this),o=a.getFromId(t,e.xref),l=a.getFromId(t,e.yref),c=s._size,u=o?Math.abs(o.l2p(e.sizex)-o.l2p(0)):e.sizex*c.w,f=l?Math.abs(l.l2p(e.sizey)-l.l2p(0)):e.sizey*c.h,h=u*d.x[e.xanchor].offset,p=f*d.y[e.yanchor].offset,m=d.x[e.xanchor].sizing+d.y[e.yanchor].sizing,v=(o?o.r2p(e.x)+o._offset:e.x*c.w+c.l)+h,g=(l?l.r2p(e.y)+l._offset:c.h-e.y*c.h+c.t)+p;switch(e.sizing){case"fill":m+=" slice";break;case"stretch":m="none"}r.attr({x:v,y:g,width:u,height:f,preserveAspectRatio:m,opacity:e.opacity});var y=(o?o._id:"")+(l?l._id:"");r.call(i.setClipUrl,y?"clip"+s._uid+y:null)}var v=s._imageLowerLayer.selectAll("image").data(u),g=s._imageUpperLayer.selectAll("image").data(l);v.enter().append("image"),g.enter().append("image"),v.exit().remove(),g.exit().remove(),v.each(function(t){p.bind(this)(t),m.bind(this)(t)}),g.each(function(t){p.bind(this)(t),m.bind(this)(t)});var y=Object.keys(s._plots);for(r=0;r<y.length;r++){e=y[r];var b=s._plots[e];if(b.imagelayer){var x=b.imagelayer.selectAll("image").data(c[e]||[]);x.enter().append("image"),x.exit().remove(),x.each(function(t){p.bind(this)(t),m.bind(this)(t)})}}}},{"../../constants/xmlns_namespaces":704,"../../plots/cartesian/axes":770,"../drawing":623,d3:128}],648:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"images",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("images"),draw:t("./draw"),convertCoords:t("./convert_coords")}},{"../../plots/cartesian/include_components":780,"./attributes":644,"./convert_coords":645,"./defaults":646,"./draw":647}],649:[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}},{}],650:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:i.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},x:{valType:"number",min:-2,max:3,dflt:1.02,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,dflt:1,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":797,"../color/attributes":597}],651:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],652:[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){for(var l,c,u,f,h=t.legend||{},d={},p=0,m="normal",v=0;v<r.length;v++){var g=r[v];s.legendGetsTrace(g)&&(p++,n.traceIs(g,"pie")&&p++),(n.traceIs(g,"bar")&&"stack"===e.barmode||-1!==["tonextx","tonexty"].indexOf(g.fill))&&(m=s.isGrouped({traceorder:m})?"grouped+reversed":"reversed"),void 0!==g.legendgroup&&""!==g.legendgroup&&(m=s.isReversed({traceorder:m})?"reversed+grouped":"grouped")}function y(t,e){return i.coerce(h,d,a,t,e)}if(!1!==i.coerce(t,e,o,"showlegend",p>1)){if(e.legend=d,y("bgcolor",e.paper_bgcolor),y("bordercolor"),y("borderwidth"),i.coerceFont(y,"font",e.font),y("orientation"),"h"===d.orientation){var b=t.xaxis;b&&b.rangeslider&&b.rangeslider.visible?(l=0,u="left",c=1.1,f="bottom"):(l=0,u="left",c=-.1,f="top")}y("traceorder",m),s.isGrouped(e.legend)&&y("tracegroupgap"),y("x",l),y("xanchor",u),y("y",c),y("yanchor",f),i.noneOrAll(h,d,["x","y"])}}},{"../../lib":724,"../../plots/layout_attributes":824,"../../registry":854,"./attributes":650,"./helpers":656}],653:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plotly"),a=t("../../lib"),o=t("../../plots/plots"),s=t("../../registry"),l=t("../dragelement"),c=t("../drawing"),u=t("../color"),f=t("../../lib/svg_text_utils"),h=t("./handle_click"),d=t("./constants"),p=t("../../constants/interactions"),m=t("../../constants/alignment"),v=m.LINE_SPACING,g=m.FROM_TL,y=m.FROM_BR,b=t("./get_legend_data"),x=t("./style"),_=t("./helpers"),w=t("./anchor_utils"),M=p.DBLCLICKDELAY;function k(t,e){var r=t.data()[0][0],n=e._fullLayout,o=r.trace,l=s.traceIs(o,"pie"),u=o.index,h=l?r.label:o.name,d=t.selectAll("text.legendtext").data([0]);function p(r){f.convertToTspans(r,e,function(){!function(t,e){var r=t.data()[0][0];if(!r.trace.showlegend)return void t.remove();var n,i,a=t.select("g[class*=math-group]"),o=a.node(),s=e._fullLayout.legend.font.size*v;if(o){var l=c.bBox(o);n=l.height,i=l.width,c.setTranslate(a,0,n/4)}else{var u=t.select(".legendtext"),h=f.lineCount(u),d=u.node();n=s*h,i=d?c.bBox(d).width:0;var p=s*(.3+(1-h)/2);f.positionText(u,40,p)}n=Math.max(n,16)+3,r.height=n,r.width=i}(t,e)})}d.enter().append("text").classed("legendtext",!0),d.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,n.legend.font).text(h),e._context.edits.legendText&&!l?d.call(f.makeEditable,{gd:e}).call(p).on("edit",function(t){this.text(t).call(p);var n,o=t;this.text()||(t=" ");var l=r.trace._fullInput||{},c={};if(-1!==["ohlc","candlestick"].indexOf(l.type))c[(n=r.trace.transforms)[n.length-1].direction+".name"]=t;else if(s.hasTransform(l,"groupby")){var f=s.getTransformIndices(l,"groupby"),h=f[f.length-1],d=a.keyedContainer(l,"transforms["+h+"].styles","target","value.name");""===o?d.remove(r.trace._group):d.set(r.trace._group,t),c=d.constructUpdate()}else c.name=t;return i.restyle(e,c,u)}):d.call(p)}function A(t,e){var r,n=1,i=t.selectAll("rect").data([0]);i.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(u.fill,"rgba(0,0,0,0)"),i.on("mousedown",function(){(r=(new Date).getTime())-e._legendMouseDownTime<M?n+=1:(n=1,e._legendMouseDownTime=r)}),i.on("mouseup",function(){if(!e._dragged&&!e._editing){var r=e._fullLayout.legend;(new Date).getTime()-e._legendMouseDownTime>M&&(n=Math.max(n-1,1)),1===n?r._clickTimeout=setTimeout(function(){h(t,e,n)},M):2===n&&(r._clickTimeout&&clearTimeout(r._clickTimeout),e._legendMouseDownTime=0,h(t,e,n))}})}function T(t,e,r){var i=t._fullLayout,a=i.legend,o=a.borderwidth,s=_.isGrouped(a),l=0;if(a._width=0,a._height=0,_.isVertical(a))s&&e.each(function(t,e){c.setTranslate(this,0,e*a.tracegroupgap)}),r.each(function(t){var e=t[0],r=e.height,n=e.width;c.setTranslate(this,o,5+o+a._height+r/2),a._height+=r,a._width=Math.max(a._width,n)}),a._width+=45+2*o,a._height+=10+2*o,s&&(a._height+=(a._lgroupsLength-1)*a.tracegroupgap),l=40;else if(s){for(var u=[a._width],f=e.data(),h=0,d=f.length;h<d;h++){var p=f[h].map(function(t){return t[0].width}),m=40+Math.max.apply(null,p);a._width+=a.tracegroupgap+m,u.push(a._width)}e.each(function(t,e){c.setTranslate(this,u[e],0)}),e.each(function(){var t=0;n.select(this).selectAll("g.traces").each(function(e){var r=e[0].height;c.setTranslate(this,0,5+o+t+r/2),t+=r}),a._height=Math.max(a._height,t)}),a._height+=10+2*o,a._width+=2*o}else{var v,g=0,y=0,b=0,x=0,w=0,M=a.tracegroupgap||5;r.each(function(t){b=Math.max(40+t[0].width,b),w+=40+t[0].width+M}),v=i.width-(i.margin.r+i.margin.l)>o+w-M,r.each(function(t){var e=t[0],r=v?40+t[0].width:b;o+x+M+r>i.width-(i.margin.r+i.margin.l)&&(x=0,g+=y,a._height=a._height+y,y=0),c.setTranslate(this,o+x,5+o+e.height/2+g),a._width+=M+r,a._height=Math.max(a._height,e.height),x+=M+r,y=Math.max(e.height,y)}),a._width+=2*o,a._height+=10+2*o}a._width=Math.ceil(a._width),a._height=Math.ceil(a._height),r.each(function(e){var r=e[0];n.select(this).select(".legendtoggle").call(c.setRect,0,-r.height/2,(t._context.edits.legendText?0:a._width)+l,r.height)})}function E(t){var e=t._fullLayout.legend,r="left";w.isRightAnchor(e)?r="right":w.isCenterAnchor(e)&&(r="center");var n="top";w.isBottomAnchor(e)?n="bottom":w.isMiddleAnchor(e)&&(n="middle"),o.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*g[r],r:e._width*y[r],b:e._height*y[n],t:e._height*g[n]})}e.exports=function(t){var e=t._fullLayout,r="legend"+e._uid;if(e._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var f=e.legend,p=e.showlegend&&b(t.calcdata,f),m=e.hiddenlabels||[];if(!e.showlegend||!p.length)return e._infolayer.selectAll(".legend").remove(),e._topdefs.select("#"+r).remove(),void o.autoMargin(t,"legend");var v=e._infolayer.selectAll("g.legend").data([0]);v.enter().append("g").attr({class:"legend","pointer-events":"all"});var _=e._topdefs.selectAll("#"+r).data([0]);_.enter().append("clipPath").attr("id",r).append("rect");var S=v.selectAll("rect.bg").data([0]);S.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),S.call(u.stroke,f.bordercolor),S.call(u.fill,f.bgcolor),S.style("stroke-width",f.borderwidth+"px");var L=v.selectAll("g.scrollbox").data([0]);L.enter().append("g").attr("class","scrollbox");var C=v.selectAll("rect.scrollbar").data([0]);C.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(u.fill,"#808BA4");var P=L.selectAll("g.groups").data(p);P.enter().append("g").attr("class","groups"),P.exit().remove();var z=P.selectAll("g.traces").data(a.identity);z.enter().append("g").attr("class","traces"),z.exit().remove(),z.call(x,t).style("opacity",function(t){var e=t[0].trace;return s.traceIs(e,"pie")?-1!==m.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){n.select(this).call(k,t).call(A,t)});var O=0!==v.enter().size();O&&(T(t,P,z),E(t));var D=e.width,I=e.height;T(t,P,z),f._height>I?function(t){var e=t._fullLayout.legend,r="left";w.isRightAnchor(e)?r="right":w.isCenterAnchor(e)&&(r="center");o.autoMargin(t,"legend",{x:e.x,y:.5,l:e._width*g[r],r:e._width*y[r],b:0,t:0})}(t):E(t);var R=e._size,N=R.l+R.w*f.x,F=R.t+R.h*(1-f.y);w.isRightAnchor(f)?N-=f._width:w.isCenterAnchor(f)&&(N-=f._width/2),w.isBottomAnchor(f)?F-=f._height:w.isMiddleAnchor(f)&&(F-=f._height/2);var j=f._width,B=R.w;j>B?(N=R.l,j=B):(N+j>D&&(N=D-j),N<0&&(N=0),j=Math.min(D-N,f._width));var U=f._height,V=R.h;U>V?(F=R.t,U=V):(F+U>I&&(F=I-U),F<0&&(F=0),U=Math.min(I-F,f._height)),c.setTranslate(v,N,F);var q,H,G,Y,W,X,Z=U-d.scrollBarHeight-2*d.scrollBarMargin,J=f._height-U;if(f._height<=U||t._context.staticPlot)S.attr({width:j-f.borderwidth,height:U-f.borderwidth,x:f.borderwidth/2,y:f.borderwidth/2}),c.setTranslate(L,0,0),_.select("rect").attr({width:j-2*f.borderwidth,height:U-2*f.borderwidth,x:f.borderwidth,y:f.borderwidth}),L.call(c.setClipUrl,r);else{q=d.scrollBarMargin,H=L.attr("data-scroll")||0,S.attr({width:j-2*f.borderwidth+d.scrollBarWidth+d.scrollBarMargin,height:U-f.borderwidth,x:f.borderwidth/2,y:f.borderwidth/2}),_.select("rect").attr({width:j-2*f.borderwidth+d.scrollBarWidth+d.scrollBarMargin,height:U-2*f.borderwidth,x:f.borderwidth,y:f.borderwidth-H}),L.call(c.setClipUrl,r),O&&Q(q,H),v.on("wheel",null),v.on("wheel",function(){H=a.constrain(L.attr("data-scroll")-n.event.deltaY/Z*J,-J,0),Q(q=d.scrollBarMargin-H/J*Z,H),0!==H&&H!==-J&&n.event.preventDefault()}),C.on(".drag",null),L.on(".drag",null);var K=n.behavior.drag().on("drag",function(){q=a.constrain(n.event.y-d.scrollBarHeight/2,d.scrollBarMargin,d.scrollBarMargin+Z),H=-(q-d.scrollBarMargin)/Z*J,Q(q,H)});C.call(K),L.call(K)}if(t._context.edits.legendPosition)v.classed("cursor-move",!0),l.init({element:v.node(),gd:t,prepFn:function(){var t=c.getTranslate(v);W=t.x,X=t.y},moveFn:function(t,e){var r=W+t,n=X+e;c.setTranslate(v,r,n),G=l.align(r,0,R.l,R.l+R.w,f.xanchor),Y=l.align(n,0,R.t+R.h,R.t,f.yanchor)},doneFn:function(){void 0!==G&&void 0!==Y&&i.relayout(t,{"legend.x":G,"legend.y":Y})},clickFn:function(r,n){var i=e._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom});i.size()>0&&(1===r?v._clickTimeout=setTimeout(function(){h(i,t,r)},M):2===r&&(v._clickTimeout&&clearTimeout(v._clickTimeout),h(i,t,r)))}})}function Q(t,e){L.attr("data-scroll",e).call(c.setTranslate,0,e),C.call(c.setRect,j,t,d.scrollBarWidth,d.scrollBarHeight),_.select("rect").attr({y:f.borderwidth-e})}}},{"../../constants/alignment":696,"../../constants/interactions":701,"../../lib":724,"../../lib/svg_text_utils":747,"../../plotly":765,"../../plots/plots":833,"../../registry":854,"../color":598,"../dragelement":620,"../drawing":623,"./anchor_utils":649,"./constants":651,"./get_legend_data":654,"./handle_click":655,"./helpers":656,"./style":658,d3:128}],654:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){var r,a,o={},s=[],l=!1,c={},u=0;function f(t,r){if(""!==t&&i.isGrouped(e))-1===s.indexOf(t)?(s.push(t),l=!0,o[t]=[[r]]):o[t].push([r]);else{var n="~~i"+u;s.push(n),o[n]=[[r]],u++}}for(r=0;r<t.length;r++){var h=t[r],d=h[0],p=d.trace,m=p.legendgroup;if(i.legendGetsTrace(p)&&p.showlegend)if(n.traceIs(p,"pie"))for(c[m]||(c[m]={}),a=0;a<h.length;a++){var v=h[a].label;c[m][v]||(f(m,{label:v,color:h[a].color,i:h[a].i,trace:p}),c[m][v]=!0)}else f(m,d)}if(!s.length)return[];var g,y,b=s.length;if(l&&i.isGrouped(e))for(y=new Array(b),r=0;r<b;r++)g=o[s[r]],y[r]=i.isReversed(e)?g.reverse():g;else{for(y=[new Array(b)],r=0;r<b;r++)g=o[s[r]][0],y[0][i.isReversed(e)?b-r-1:r]=g;b=1}return e._lgroupsLength=b,y}},{"../../registry":854,"./helpers":656}],655:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("../../lib"),a=t("../../registry"),o=!0;e.exports=function(t,e,r){if(!e._dragged&&!e._editing){var s,l,c,u,f,h=e._fullLayout.hiddenlabels?e._fullLayout.hiddenlabels.slice():[],d=t.data()[0][0],p=e._fullData,m=d.trace,v=m.legendgroup,g={},y=[],b=[],x=[];if(1===r&&o&&e.data&&e._context.showTips?(i.notifier(i._(e,"Double-click on legend to isolate one trace"),"long"),o=!1):o=!1,a.traceIs(m,"pie")){var _=d.label,w=h.indexOf(_);1===r?-1===w?h.push(_):h.splice(w,1):2===r&&(h=[],e.calcdata[0].forEach(function(t){_!==t.label&&h.push(t.label)}),e._fullLayout.hiddenlabels&&e._fullLayout.hiddenlabels.length===h.length&&-1===w&&(h=[])),n.relayout(e,"hiddenlabels",h)}else{var M,k=v&&v.length,A=[];if(k)for(s=0;s<p.length;s++)(M=p[s]).visible&&M.legendgroup===v&&A.push(s);if(1===r){var T;switch(m.visible){case!0:T="legendonly";break;case!1:T=!1;break;case"legendonly":T=!0}if(k)for(s=0;s<p.length;s++)!1!==p[s].visible&&p[s].legendgroup===v&&O(p[s],T);else O(m,T)}else if(2===r){var E,S,L=!0;for(s=0;s<p.length;s++)if(!(p[s]===m)&&!(E=k&&p[s].legendgroup===v)&&!0===p[s].visible&&!a.traceIs(p[s],"notLegendIsolatable")){L=!1;break}for(s=0;s<p.length;s++)if(!1!==p[s].visible&&!a.traceIs(p[s],"notLegendIsolatable"))switch(m.visible){case"legendonly":O(p[s],!0);break;case!0:S=!!L||"legendonly",E=p[s]===m||k&&p[s].legendgroup===v,O(p[s],!!E||S)}}for(s=0;s<b.length;s++)if(c=b[s]){var C=c.constructUpdate(),P=Object.keys(C);for(l=0;l<P.length;l++)u=P[l],(g[u]=g[u]||[])[x[s]]=C[u]}for(f=Object.keys(g),s=0;s<f.length;s++)for(u=f[s],l=0;l<y.length;l++)g[u].hasOwnProperty(l)||(g[u][l]=void 0);n.restyle(e,g,y)}}function z(t,e,r){var n=y.indexOf(t),i=g[e];return i||(i=g[e]=[]),-1===y.indexOf(t)&&(y.push(t),n=y.length-1),i[n]=r,n}function O(t,e){var r=t._fullInput;if(a.hasTransform(r,"groupby")){var n=b[r.index];if(!n){var o=a.getTransformIndices(r,"groupby"),s=o[o.length-1];n=i.keyedContainer(r,"transforms["+s+"].styles","target","value.visible"),b[r.index]=n}var l=n.get(t._group);void 0===l&&(l=!0),!1!==l&&n.set(t._group,e),x[r.index]=z(r.index,"visible",!1!==r.visible)}else{var c=!1!==r.visible&&e;z(r.index,"visible",c)}}}},{"../../lib":724,"../../plotly":765,"../../registry":854}],656:[function(t,e,r){"use strict";r.legendGetsTrace=function(t){return t.visible&&void 0!==t.showlegend},r.isGrouped=function(t){return-1!==(t.traceorder||"").indexOf("grouped")},r.isVertical=function(t){return"h"!==t.orientation},r.isReversed=function(t){return-1!==(t.traceorder||"").indexOf("reversed")}},{}],657:[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":650,"./defaults":652,"./draw":653,"./style":658}],658:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../lib"),o=t("../drawing"),s=t("../color"),l=t("../../traces/scatter/subtypes"),c=t("../../traces/pie/style_one");e.exports=function(t,e){t.each(function(t){var e=n.select(this).selectAll("g.layers").data([0]);e.enter().append("g").classed("layers",!0),e.style("opacity",t[0].trace.opacity),e.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),e.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var r=e.selectAll("g.legendsymbols").data([t]);r.enter().append("g").classed("legendsymbols",!0),r.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(function(t){var e=t[0].trace,r=e.marker||{},a=r.line||{},o=n.select(this).select("g.legendpoints").selectAll("path.legendbar").data(i.traceIs(e,"bar")?[t]:[]);o.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),o.exit().remove(),o.each(function(t){var e=n.select(this),i=t[0],o=(i.mlw+1||a.width+1)-1;e.style("stroke-width",o+"px").call(s.fill,i.mc||r.color),o&&e.call(s.stroke,i.mlc||a.color)})}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(i.traceIs(e,"box-violin")&&e.visible?[t]:[]);r.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.each(function(){var t=e.line.width,r=n.select(this);r.style("stroke-width",t+"px").call(s.fill,e.fillcolor),t&&r.call(s.stroke,e.line.color)})}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendpie").data(i.traceIs(e,"pie")&&e.visible?[t]:[]);r.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.size()&&r.call(c,t[0],e)}).each(function(t){var e=t[0].trace,r=e.visible&&e.fill&&"none"!==e.fill,i=l.hasLines(e),a=e.contours;a&&"constraint"===a.type&&(i=a.showlines,r="="!==a._operation);var s=n.select(this).select(".legendfill").selectAll("path").data(r?[t]:[]);s.enter().append("path").classed("js-fill",!0),s.exit().remove(),s.attr("d","M5,0h30v6h-30z").call(o.fillGroupStyle);var c=n.select(this).select(".legendlines").selectAll("path").data(i?[t]:[]);c.enter().append("path").classed("js-line",!0).attr("d","M5,0h30"),c.exit().remove(),c.call(o.lineGroupStyle)}).each(function(t){var r,i,s=t[0],c=s.trace,u=l.hasMarkers(c),f=l.hasText(c),h=l.hasLines(c);function d(t,e,r){var n=a.nestedProperty(c,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 p(t){return t[0]}if(u||f||h){var m={},v={};u&&(m.mc=d("marker.color",p),m.mo=d("marker.opacity",a.mean,[.2,1]),m.ms=d("marker.size",a.mean,[2,16]),m.mlc=d("marker.line.color",p),m.mlw=d("marker.line.width",a.mean,[0,5]),v.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),h&&(v.line={width:d("line.width",p,[0,10])}),f&&(m.tx="Aa",m.tp=d("textposition",p),m.ts=10,m.tc=d("textfont.color",p),m.tf=d("textfont.family",p)),r=[a.minExtend(s,m)],i=a.minExtend(c,v)}var g=n.select(this).select("g.legendpoints"),y=g.selectAll("path.scatterpts").data(u?r:[]);y.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),y.exit().remove(),y.call(o.pointStyle,i,e),u&&(r[0].mrc=3);var b=g.selectAll("g.pointtext").data(f?r:[]);b.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),b.exit().remove(),b.selectAll("text").call(o.textPointStyle,i,e)})}},{"../../lib":724,"../../registry":854,"../../traces/pie/style_one":1034,"../../traces/scatter/subtypes":1070,"../color":598,"../drawing":623,d3:128}],659:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("../../plots/plots"),a=t("../../plots/cartesian/axis_ids"),o=t("../../lib"),s=t("../../snapshot/download"),l=t("../../../build/ploticon"),c=o._,u=e.exports={};function f(t,e){var r,i,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,c=t._fullLayout,u={},f=a.list(t,null,!0),h="on";if("zoom"===s){var d,p="in"===l?.5:2,m=(1+p)/2,v=(1-p)/2;for(i=0;i<f.length;i++)if(!(r=f[i]).fixedrange)if(d=r._name,"auto"===l)u[d+".autorange"]=!0;else if("reset"===l){if(void 0===r._rangeInitial)u[d+".autorange"]=!0;else{var g=r._rangeInitial.slice();u[d+".range[0]"]=g[0],u[d+".range[1]"]=g[1]}void 0!==r._showSpikeInitial&&(u[d+".showspikes"]=r._showSpikeInitial,"on"!==h||r._showSpikeInitial||(h="off"))}else{var y=[r.r2l(r.range[0]),r.r2l(r.range[1])],b=[m*y[0]+v*y[1],m*y[1]+v*y[0]];u[d+".range[0]"]=r.l2r(b[0]),u[d+".range[1]"]=r.l2r(b[1])}c._cartesianSpikesEnabled=h}else{if("hovermode"!==s||"x"!==l&&"y"!==l){if("hovermode"===s&&"closest"===l){for(i=0;i<f.length;i++)r=f[i],"on"!==h||r.showspikes||(h="off");c._cartesianSpikesEnabled=h}}else l=c._isHoriz?"y":"x",o.setAttribute("data-val",l);u[s]=l}n.relayout(t,u)}function h(t,e){for(var r=e.currentTarget,i=r.getAttribute("data-attr"),a=r.getAttribute("data-val")||!0,o=t._fullLayout._subplots.gl3d,s={},l=i.split("."),c=0;c<o.length;c++)s[o[c]+"."+l[1]]=a;var u="pan"===a?a:"zoom";s.dragmode=u,n.relayout(t,s)}function d(t,e){for(var r=e.currentTarget.getAttribute("data-attr"),i=t._fullLayout,a=i._subplots.gl3d,s={},l=0;l<a.length;l++){var c=a[l],u=c+".camera",f=i[c]._scene;"resetDefault"===r?s[u]=null:"resetLastSave"===r&&(s[u]=o.extendDeep({},f.cameraInitial))}n.relayout(t,s)}function p(t,e){var r=e.currentTarget,i=r._previousVal||!1,a=t.layout,s=t._fullLayout,l=s._subplots.gl3d,c=["xaxis","yaxis","zaxis"],u=["showspikes","spikesides","spikethickness","spikecolor"],f={},h={},d={};if(i)d=o.extendDeep(a,i),r._previousVal=null;else{d={"allaxes.showspikes":!1};for(var p=0;p<l.length;p++){var m=l[p],v=s[m],g=f[m]={};g.hovermode=v.hovermode,d[m+".hovermode"]=!1;for(var y=0;y<3;y++){var b=c[y];h=g[b]={};for(var x=0;x<u.length;x++){var _=u[x];h[_]=v[b][_]}}}r._previousVal=o.extendDeep({},f)}n.relayout(t,d)}function m(t,e){for(var r=e.currentTarget,i=r.getAttribute("data-attr"),a=r.getAttribute("data-val")||!0,o=t._fullLayout,s=o._subplots.geo,l=0;l<s.length;l++){var c=s[l],u=o[c];if("zoom"===i){var f=u.projection.scale,h="in"===a?2*f:.5*f;n.relayout(t,c+".projection.scale",h)}else"reset"===i&&g(t,"geo")}}function v(t){var e,r=t._fullLayout;e=r._has("cartesian")?r._isHoriz?"y":"x":"closest";var i=!t._fullLayout.hovermode&&e;n.relayout(t,"hovermode",i)}function g(t,e){for(var r=t._fullLayout,i=r._subplots[e],a={},o=0;o<i.length;o++)for(var s=i[o],l=r[s]._subplot.viewInitial,c=Object.keys(l),u=0;u<c.length;u++){var f=c[u];a[s+"."+f]=l[f]}n.relayout(t,a)}u.toImage={name:"toImage",title:function(t){return c(t,"Download plot as a png")},icon:l.camera,click:function(t){var e="png";o.notifier(c(t,"Taking snapshot - this may take a few seconds"),"long"),o.isIE()&&(o.notifier(c(t,"IE only supports svg. Changing format to svg."),"long"),e="svg"),s(t,{format:e}).then(function(e){o.notifier(c(t,"Snapshot succeeded")+" - "+e,"long")}).catch(function(){o.notifier(c(t,"Sorry, there was a problem downloading your snapshot!"),"long")})}},u.sendDataToCloud={name:"sendDataToCloud",title:function(t){return c(t,"Edit in Chart Studio")},icon:l.disk,click:function(t){i.sendDataToCloud(t)}},u.zoom2d={name:"zoom2d",title:function(t){return c(t,"Zoom")},attr:"dragmode",val:"zoom",icon:l.zoombox,click:f},u.pan2d={name:"pan2d",title:function(t){return c(t,"Pan")},attr:"dragmode",val:"pan",icon:l.pan,click:f},u.select2d={name:"select2d",title:function(t){return c(t,"Box Select")},attr:"dragmode",val:"select",icon:l.selectbox,click:f},u.lasso2d={name:"lasso2d",title:function(t){return c(t,"Lasso Select")},attr:"dragmode",val:"lasso",icon:l.lasso,click:f},u.zoomIn2d={name:"zoomIn2d",title:function(t){return c(t,"Zoom in")},attr:"zoom",val:"in",icon:l.zoom_plus,click:f},u.zoomOut2d={name:"zoomOut2d",title:function(t){return c(t,"Zoom out")},attr:"zoom",val:"out",icon:l.zoom_minus,click:f},u.autoScale2d={name:"autoScale2d",title:function(t){return c(t,"Autoscale")},attr:"zoom",val:"auto",icon:l.autoscale,click:f},u.resetScale2d={name:"resetScale2d",title:function(t){return c(t,"Reset axes")},attr:"zoom",val:"reset",icon:l.home,click:f},u.hoverClosestCartesian={name:"hoverClosestCartesian",title:function(t){return c(t,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:l.tooltip_basic,gravity:"ne",click:f},u.hoverCompareCartesian={name:"hoverCompareCartesian",title:function(t){return c(t,"Compare data on hover")},attr:"hovermode",val:function(t){return t._fullLayout._isHoriz?"y":"x"},icon:l.tooltip_compare,gravity:"ne",click:f},u.zoom3d={name:"zoom3d",title:function(t){return c(t,"Zoom")},attr:"scene.dragmode",val:"zoom",icon:l.zoombox,click:h},u.pan3d={name:"pan3d",title:function(t){return c(t,"Pan")},attr:"scene.dragmode",val:"pan",icon:l.pan,click:h},u.orbitRotation={name:"orbitRotation",title:function(t){return c(t,"Orbital rotation")},attr:"scene.dragmode",val:"orbit",icon:l["3d_rotate"],click:h},u.tableRotation={name:"tableRotation",title:function(t){return c(t,"Turntable rotation")},attr:"scene.dragmode",val:"turntable",icon:l["z-axis"],click:h},u.resetCameraDefault3d={name:"resetCameraDefault3d",title:function(t){return c(t,"Reset camera to default")},attr:"resetDefault",icon:l.home,click:d},u.resetCameraLastSave3d={name:"resetCameraLastSave3d",title:function(t){return c(t,"Reset camera to last save")},attr:"resetLastSave",icon:l.movie,click:d},u.hoverClosest3d={name:"hoverClosest3d",title:function(t){return c(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:l.tooltip_basic,gravity:"ne",click:p},u.zoomInGeo={name:"zoomInGeo",title:function(t){return c(t,"Zoom in")},attr:"zoom",val:"in",icon:l.zoom_plus,click:m},u.zoomOutGeo={name:"zoomOutGeo",title:function(t){return c(t,"Zoom out")},attr:"zoom",val:"out",icon:l.zoom_minus,click:m},u.resetGeo={name:"resetGeo",title:function(t){return c(t,"Reset")},attr:"reset",val:null,icon:l.autoscale,click:m},u.hoverClosestGeo={name:"hoverClosestGeo",title:function(t){return c(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:l.tooltip_basic,gravity:"ne",click:v},u.hoverClosestGl2d={name:"hoverClosestGl2d",title:function(t){return c(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:l.tooltip_basic,gravity:"ne",click:v},u.hoverClosestPie={name:"hoverClosestPie",title:function(t){return c(t,"Toggle show closest data on hover")},attr:"hovermode",val:"closest",icon:l.tooltip_basic,gravity:"ne",click:v},u.toggleHover={name:"toggleHover",title:function(t){return c(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:l.tooltip_basic,gravity:"ne",click:function(t,e){v(t),p(t,e)}},u.resetViews={name:"resetViews",title:function(t){return c(t,"Reset views")},icon:l.home,click:function(t,e){var r=e.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),f(t,e),r.setAttribute("data-attr","resetLastSave"),d(t,e),g(t,"geo"),g(t,"mapbox")}},u.toggleSpikelines={name:"toggleSpikelines",title:function(t){return c(t,"Toggle Spike Lines")},icon:l.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(t){var e=t._fullLayout;e._cartesianSpikesEnabled="on"===e._cartesianSpikesEnabled?"off":"on";var r=function(t){for(var e,r,n=t._fullLayout,i=a.list(t,null,!0),o={},s=0;s<i.length;s++)e=i[s],r=e._name,o[r+".showspikes"]="on"===n._cartesianSpikesEnabled||e._showSpikeInitial;return o}(t);n.relayout(t,r)}},u.resetViewMapbox={name:"resetViewMapbox",title:function(t){return c(t,"Reset view")},attr:"reset",icon:l.home,click:function(t){g(t,"mapbox")}}},{"../../../build/ploticon":2,"../../lib":724,"../../plotly":765,"../../plots/cartesian/axis_ids":773,"../../plots/plots":833,"../../snapshot/download":856}],660:[function(t,e,r){"use strict";r.manage=t("./manage")},{"./manage":661}],661:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axis_ids"),i=t("../../traces/scatter/subtypes"),a=t("../../registry"),o=t("./modebar"),s=t("./buttons");e.exports=function(t){var e=t._fullLayout,r=t._context,l=e._modeBar;if(r.displayModeBar){if(!Array.isArray(r.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(r.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var c,u=r.modeBarButtons;c=Array.isArray(u)&&u.length?function(t){for(var e=0;e<t.length;e++)for(var r=t[e],n=0;n<r.length;n++){var i=r[n];if("string"==typeof i){if(void 0===s[i])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));t[e][n]=s[i]}}return t}(u):function(t,e,r){var o=t._fullLayout,l=t._fullData,c=o._has("cartesian"),u=o._has("gl3d"),f=o._has("geo"),h=o._has("pie"),d=o._has("gl2d"),p=o._has("ternary"),m=o._has("mapbox"),v=o._has("polar"),g=function(t){for(var e=n.list({_fullLayout:t},null,!0),r=0;r<e.length;r++)if(!e[r].fixedrange)return!1;return!0}(o),y=[];function b(t){if(t.length){for(var r=[],n=0;n<t.length;n++){var i=t[n];-1===e.indexOf(i)&&r.push(s[i])}y.push(r)}}b(["toImage","sendDataToCloud"]);var x=[],_=[],w=[],M=[];(c||d||h||p)+f+u+m+v>1?(_=["toggleHover"],w=["resetViews"]):f?(x=["zoomInGeo","zoomOutGeo"],_=["hoverClosestGeo"],w=["resetGeo"]):u?(_=["hoverClosest3d"],w=["resetCameraDefault3d","resetCameraLastSave3d"]):m?(_=["toggleHover"],w=["resetViewMapbox"]):_=d?["hoverClosestGl2d"]:h?["hoverClosestPie"]:["toggleHover"];c&&(_=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);!c&&!d||g||(x=["zoomIn2d","zoomOut2d","autoScale2d"],"resetViews"!==w[0]&&(w=["resetScale2d"]));u?M=["zoom3d","pan3d","orbitRotation","tableRotation"]:(c||d)&&!g||p?M=["zoom2d","pan2d"]:m||f?M=["pan2d"]:v&&(M=["zoom2d"]);(function(t){for(var e=!1,r=0;r<t.length&&!e;r++){var n=t[r];n._module&&n._module.selectPoints&&(a.traceIs(n,"scatter-like")?(i.hasMarkers(n)||i.hasText(n))&&(e=!0):a.traceIs(n,"box-violin")&&"all"!==n.boxpoints&&"all"!==n.points||(e=!0))}return e})(l)&&M.push("select2d","lasso2d");return b(M),b(x.concat(w)),b(_),function(t,e){if(e.length)if(Array.isArray(e[0]))for(var r=0;r<e.length;r++)t.push(e[r]);else t.push(e);return t}(y,r)}(t,r.modeBarButtonsToRemove,r.modeBarButtonsToAdd),l?l.update(t,c):e._modeBar=o(t,c)}else l&&(l.destroy(),delete e._modeBar)}},{"../../plots/cartesian/axis_ids":773,"../../registry":854,"../../traces/scatter/subtypes":1070,"./buttons":659,"./modebar":662}],662:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../../build/ploticon");function o(t){this.container=t.container,this.element=document.createElement("div"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}var s=o.prototype;s.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()},s.updateButtons=function(t){var e=this;this.buttons=t,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(t){var r=e.createGroup();t.forEach(function(t){var n=t.name;if(!n)throw new Error("must provide button 'name' in button config");if(-1!==e.buttonsNames.indexOf(n))throw new Error("button name '"+n+"' is taken");e.buttonsNames.push(n);var i=e.createButton(t);e.buttonElements.push(i),r.appendChild(i)}),e.element.appendChild(r)})},s.createGroup=function(){var t=document.createElement("div");return t.className="modebar-group",t},s.createButton=function(t){var e=this,r=document.createElement("a");r.setAttribute("rel","tooltip"),r.className="modebar-btn";var i=t.title;void 0===i?i=t.name:"function"==typeof i&&(i=i(this.graphInfo)),(i||0===i)&&r.setAttribute("data-title",i),void 0!==t.attr&&r.setAttribute("data-attr",t.attr);var o=t.val;if(void 0!==o&&("function"==typeof o&&(o=o(this.graphInfo)),r.setAttribute("data-val",o)),"function"!=typeof t.click)throw new Error("must provide button 'click' function in button config");return r.addEventListener("click",function(r){t.click(e.graphInfo,r),e.updateActiveButton(r.currentTarget)}),r.setAttribute("data-toggle",t.toggle||!1),t.toggle&&n.select(r).classed("active",!0),r.appendChild(this.createIcon(t.icon||a.question,t.name)),r.setAttribute("data-gravity",t.gravity||"n"),r},s.createIcon=function(t,e){var r=t.ascent-t.descent,n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg"),a=document.createElementNS(n,"path");i.setAttribute("height","1em"),i.setAttribute("width",t.width/r+"em"),i.setAttribute("viewBox",[0,0,t.width,r].join(" "));var o="toggleSpikelines"===e?"matrix(1.5 0 0 -1.5 0 "+t.ascent+")":"matrix(1 0 0 -1 0 "+t.ascent+")";return a.setAttribute("d",t.path),a.setAttribute("transform",o),i.appendChild(a),i},s.updateActiveButton=function(t){var e=this.graphInfo._fullLayout,r=void 0!==t?t.getAttribute("data-attr"):null;this.buttonElements.forEach(function(t){var a=t.getAttribute("data-val")||!0,o=t.getAttribute("data-attr"),s="true"===t.getAttribute("data-toggle"),l=n.select(t);if(s)o===r&&l.classed("active",!l.classed("active"));else{var c=null===o?o:i.nestedProperty(e,o).get();l.classed("active",c===a)}})},s.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},s.getLogo=function(){var t=this.createGroup(),e=document.createElement("a");return e.href="https://plot.ly/",e.target="_blank",e.setAttribute("data-title",i._(this.graphInfo,"Produced with Plotly")),e.className="modebar-btn plotlyjsicon modebar-btn--logo",e.appendChild(this.createIcon(a.plotlylogo)),t.appendChild(e),t},s.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},s.destroy=function(){i.removeElement(this.container.querySelector(".modebar"))},e.exports=function(t,e){var r=t._fullLayout,i=new o({graphInfo:t,container:r._paperdiv.node(),buttons:e});return r._privateplot&&n.select(i.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),i}},{"../../../build/ploticon":2,"../../lib":724,d3:128}],663:[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",editType:"plot"},buttons:o,x:{valType:"number",min:-2,max:3,editType:"plot"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"plot"},y:{valType:"number",min:-2,max:3,editType:"plot"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom",editType:"plot"},font:n({editType:"plot"}),bgcolor:{valType:"color",dflt:i.lightLine,editType:"plot"},activecolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:i.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"}},{"../../lib/extend":713,"../../plots/font_attributes":797,"../color/attributes":597,"./button_attributes":664}],664:[function(t,e,r){"use strict";e.exports={step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month",editType:"plot"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward",editType:"plot"},count:{valType:"number",min:0,dflt:1,editType:"plot"},label:{valType:"string",editType:"plot"},editType:"plot"}},{}],665:[function(t,e,r){"use strict";e.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}},{}],666:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../color"),a=t("./attributes"),o=t("./button_attributes"),s=t("./constants");e.exports=function(t,e,r,l,c){var u=t.rangeselector||{},f=e.rangeselector={};function h(t,e){return n.coerce(u,f,a,t,e)}if(h("visible",function(t,e,r){var i,a,s=t.buttons||[],l=e.buttons=[];function c(t,e){return n.coerce(i,a,o,t,e)}for(var u=0;u<s.length;u++)if(i=s[u],a={},n.isPlainObject(i)){var f=c("step");"all"!==f&&(!r||"gregorian"===r||"month"!==f&&"year"!==f?c("stepmode"):a.stepmode="backward",c("count")),c("label"),a._index=u,l.push(a)}return l}(u,f,c).length>0)){var d=function(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),i=0,a=0;a<n.length;a++){var o=e[n[a]].domain;o&&(i=Math.max(o[1],i))}return[t.domain[0],i+s.yPad]}(e,r,l);h("x",d[0]),h("y",d[1]),n.noneOrAll(t,e,["x","y"]),h("xanchor"),h("yanchor"),n.coerceFont(h,"font",r.font);var p=h("bgcolor");h("activecolor",i.contrast(p,s.lightAmount,s.darkAmount)),h("bordercolor"),h("borderwidth")}}},{"../../lib":724,"../color":598,"./attributes":663,"./button_attributes":664,"./constants":665}],667:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plotly"),a=t("../../plots/plots"),o=t("../color"),s=t("../drawing"),l=t("../../lib/svg_text_utils"),c=t("../../plots/cartesian/axis_ids"),u=t("../legend/anchor_utils"),f=t("../../constants/alignment"),h=f.LINE_SPACING,d=f.FROM_TL,p=f.FROM_BR,m=t("./constants"),v=t("./get_update_object");function g(t){return t._id}function y(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:m.rx,ry:m.ry}),n.call(o.stroke,e.bordercolor).call(o.fill,function(t,e){return e._isActive||e._isHovered?t.activecolor:t.bgcolor}(e,r)).style("stroke-width",e.borderwidth+"px")}function b(t,e,r,n){var i,a=t.selectAll("text").data([0]);a.enter().append("text").classed("selector-text",!0).classed("user-select-none",!0),a.attr("text-anchor","middle"),a.call(s.font,e.font).text((i=r,i.label?i.label:"all"===i.step?"all":i.count+i.step.charAt(0))).call(function(t){l.convertToTspans(t,n)})}e.exports=function(t){var e=t._fullLayout._infolayer.selectAll(".rangeselector").data(function(t){for(var e=c.list(t,"x",!0),r=[],n=0;n<e.length;n++){var i=e[n];i.rangeselector&&i.rangeselector.visible&&r.push(i)}return r}(t),g);e.enter().append("g").classed("rangeselector",!0),e.exit().remove(),e.style({cursor:"pointer","pointer-events":"all"}),e.each(function(e){var r=n.select(this),o=e,c=o.rangeselector,f=r.selectAll("g.button").data(c.buttons);f.enter().append("g").classed("button",!0),f.exit().remove(),f.each(function(e){var r=n.select(this),a=v(o,e);e._isActive=function(t,e,r){if("all"===e.step)return!0===t.autorange;var n=Object.keys(r);return t.range[0]===r[n[0]]&&t.range[1]===r[n[1]]}(o,e,a),r.call(y,c,e),r.call(b,c,e,t),r.on("click",function(){t._dragged||i.relayout(t,a)}),r.on("mouseover",function(){e._isHovered=!0,r.call(y,c,e)}),r.on("mouseout",function(){e._isHovered=!1,r.call(y,c,e)})}),function(t,e,r,i,o){var c=0,f=0,v=r.borderwidth;e.each(function(){var t=n.select(this),e=t.select(".selector-text"),i=r.font.size*h,a=Math.max(i*l.lineCount(e),16)+3;f=Math.max(f,a)}),e.each(function(){var t=n.select(this),e=t.select(".selector-rect"),i=t.select(".selector-text"),a=i.node()&&s.bBox(i.node()).width,o=r.font.size*h,u=l.lineCount(i),d=Math.max(a+10,m.minButtonWidth);t.attr("transform","translate("+(v+c)+","+v+")"),e.attr({x:0,y:0,width:d,height:f}),l.positionText(i,d/2,f/2-(u-1)*o/2+3),c+=d+5});var g=t._fullLayout._size,y=g.l+g.w*r.x,b=g.t+g.h*(1-r.y),x="left";u.isRightAnchor(r)&&(y-=c,x="right");u.isCenterAnchor(r)&&(y-=c/2,x="center");var _="top";u.isBottomAnchor(r)&&(b-=f,_="bottom");u.isMiddleAnchor(r)&&(b-=f/2,_="middle");c=Math.ceil(c),f=Math.ceil(f),y=Math.round(y),b=Math.round(b),a.autoMargin(t,i+"-range-selector",{x:r.x,y:r.y,l:c*d[x],r:c*p[x],b:f*p[_],t:f*d[_]}),o.attr("transform","translate("+y+","+b+")")}(t,f,c,o._name,r)})}},{"../../constants/alignment":696,"../../lib/svg_text_utils":747,"../../plotly":765,"../../plots/cartesian/axis_ids":773,"../../plots/plots":833,"../color":598,"../drawing":623,"../legend/anchor_utils":649,"./constants":665,"./get_update_object":668,d3:128}],668:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t,e){var r=t._name,i={};if("all"===e.step)i[r+".autorange"]=!0;else{var a=function(t,e){var r,i=t.range,a=new Date(t.r2l(i[1])),o=e.step,s=e.count;switch(e.stepmode){case"backward":r=t.l2r(+n.time[o].utc.offset(a,-s));break;case"todate":var l=n.time[o].utc.offset(a,-s);r=t.l2r(+n.time[o].utc.ceil(l))}var c=i[1];return[r,c]}(t,e);i[r+".range[0]"]=a[0],i[r+".range[1]"]=a[1]}return i}},{d3:128}],669:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":663,"./defaults":666,"./draw":667}],670:[function(t,e,r){"use strict";var n=t("../color/attributes");e.exports={bgcolor:{valType:"color",dflt:n.background,editType:"calc"},bordercolor:{valType:"color",dflt:n.defaultLine,editType:"calc"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"calc"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"calc"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}},{"../color/attributes":597}],671:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("./constants");e.exports=function(t){for(var e=n.list(t,"x",!0),r=0;r<e.length;r++){var a=e[r],o=a[i.name];o&&o.visible&&o.autorange&&a._min.length&&a._max.length&&(o._input.autorange=!0,o._input.range=o.range=n.getAutoRange(a))}}},{"../../plots/cartesian/axes":770,"./constants":672}],672:[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,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}},{}],673:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){if(t[r].rangeslider){n.isPlainObject(t[r].rangeslider)||(t[r].rangeslider={});var a=t[r].rangeslider,o=e[r],s=o.rangeslider={};l("visible")&&(l("bgcolor",e.plot_bgcolor),l("bordercolor"),l("borderwidth"),l("thickness"),l("autorange",!o.isValidRange(a.range)),l("range"),s._input=a)}function l(t,e){return n.coerce(a,s,i,t,e)}}},{"../../lib":724,"./attributes":670}],674:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plotly"),a=t("../../plots/plots"),o=t("../../lib"),s=t("../drawing"),l=t("../color"),c=t("../../plots/cartesian"),u=t("../../plots/cartesian/axes"),f=t("../dragelement"),h=t("../../lib/setcursor"),d=t("./constants");function p(t,e,r,n){var i=t.selectAll("rect."+d.bgClassName).data([0]);i.enter().append("rect").classed(d.bgClassName,!0).attr({x:0,y:0,"shape-rendering":"crispEdges"});var a=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,o=-n._offsetShift,l=s.crispRound(e,n.borderwidth);i.attr({width:n._width+a,height:n._height+a,transform:"translate("+o+","+o+")",fill:n.bgcolor,stroke:n.bordercolor,"stroke-width":l})}function m(t,e,r,n){var i=e._fullLayout._topdefs.selectAll("#"+n._clipId).data([0]);i.enter().append("clipPath").attr("id",n._clipId).append("rect").attr({x:0,y:0}),i.select("rect").attr({width:n._width,height:n._height})}function v(t,e,r,i){var l,f=u.getSubplots(e,r),h=e.calcdata,p=t.selectAll("g."+d.rangePlotClassName).data(f,o.identity);p.enter().append("g").attr("class",function(t){return d.rangePlotClassName+" "+t}).call(s.setClipUrl,i._clipId),p.order(),p.exit().remove(),p.each(function(t,o){var s=n.select(this),f=0===o,d=u.getFromId(e,t,"y"),p=d._name,m={data:[],layout:{xaxis:{type:r.type,domain:[0,1],range:i.range.slice(),calendar:r.calendar},width:i._width,height:i._height,margin:{t:0,b:0,l:0,r:0}},_context:e._context};m.layout[p]={type:d.type,domain:[0,1],range:d.range.slice(),calendar:d.calendar},a.supplyDefaults(m);var v={id:t,plotgroup:s,xaxis:m._fullLayout.xaxis,yaxis:m._fullLayout[p]};f?l=v:(v.mainplot="xy",v.mainplotinfo=l),c.rangePlot(e,v,function(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n],a=i[0].trace;a.xaxis+a.yaxis===e&&r.push(i)}return r}(h,t))})}function g(t,e,r,n){var i=t.selectAll("rect."+d.maskMinClassName).data([0]);i.enter().append("rect").classed(d.maskMinClassName,!0).attr({x:0,y:0}).attr("shape-rendering","crispEdges"),i.attr("height",n._height).call(l.fill,d.maskColor);var a=t.selectAll("rect."+d.maskMaxClassName).data([0]);a.enter().append("rect").classed(d.maskMaxClassName,!0).attr("y",0).attr("shape-rendering","crispEdges"),a.attr("height",n._height).call(l.fill,d.maskColor)}function y(t,e,r,n){if(!e._context.staticPlot){var i=t.selectAll("rect."+d.slideBoxClassName).data([0]);i.enter().append("rect").classed(d.slideBoxClassName,!0).attr("y",0).attr("cursor",d.slideBoxCursor).attr("shape-rendering","crispEdges"),i.attr({height:n._height,fill:d.slideBoxFill})}}function b(t,e,r,n){var i=t.selectAll("g."+d.grabberMinClassName).data([0]);i.enter().append("g").classed(d.grabberMinClassName,!0);var a=t.selectAll("g."+d.grabberMaxClassName).data([0]);a.enter().append("g").classed(d.grabberMaxClassName,!0);var o={x:0,width:d.handleWidth,rx:d.handleRadius,fill:l.background,stroke:l.defaultLine,"stroke-width":d.handleStrokeWidth,"shape-rendering":"crispEdges"},s={y:Math.round(n._height/4),height:Math.round(n._height/2)},c=i.selectAll("rect."+d.handleMinClassName).data([0]);c.enter().append("rect").classed(d.handleMinClassName,!0).attr(o),c.attr(s);var u=a.selectAll("rect."+d.handleMaxClassName).data([0]);if(u.enter().append("rect").classed(d.handleMaxClassName,!0).attr(o),u.attr(s),!e._context.staticPlot){var f={width:d.grabAreaWidth,x:0,y:0,fill:d.grabAreaFill,cursor:d.grabAreaCursor},h=i.selectAll("rect."+d.grabAreaMinClassName).data([0]);h.enter().append("rect").classed(d.grabAreaMinClassName,!0).attr(f),h.attr("height",n._height);var p=a.selectAll("rect."+d.grabAreaMaxClassName).data([0]);p.enter().append("rect").classed(d.grabAreaMaxClassName,!0).attr(f),p.attr("height",n._height)}}e.exports=function(t){var e=t._fullLayout,r=function(t){var e=u.list({_fullLayout:t},"x",!0),r=d.name,n=[];if(t._has("gl2d"))return n;for(var i=0;i<e.length;i++){var a=e[i];a[r]&&a[r].visible&&n.push(a)}return n}(e);var s=e._infolayer.selectAll("g."+d.containerClassName).data(r,function(t){return t._name});s.enter().append("g").classed(d.containerClassName,!0).attr("pointer-events","all"),s.exit().each(function(t){var r=n.select(this),i=t[d.name];r.remove(),e._topdefs.select("#"+i._clipId).remove()}),s.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var i=r[n];-1!==i.indexOf(d.name)&&a.autoMargin(t,i)}}(t),0!==r.length&&s.each(function(r){var s=n.select(this),l=r[d.name],c=e[u.id2name(r.anchor)];if(l.range){var x=l.range,_=r.range;x[0]=r.l2r(Math.min(r.r2l(x[0]),r.r2l(_[0]))),x[1]=r.l2r(Math.max(r.r2l(x[1]),r.r2l(_[1]))),l._input.range=x.slice()}r.cleanRange("rangeslider.range");var w=e.margin,M=e._size,k=r.domain,A=c.domain,T=(r._boundingBox||{}).height||0;l._id=d.name+r._id,l._clipId=l._id+"-"+e._uid,l._width=M.w*(k[1]-k[0]),l._height=(e.height-w.b-w.t)*l.thickness,l._offsetShift=Math.floor(l.borderwidth/2);var E=Math.round(w.l+M.w*k[0]),S=Math.round(w.t+M.h*(1-A[0])+T+l._offsetShift+d.extraPad);s.attr("transform","translate("+E+","+S+")");var L=r.r2l(l.range[0]),C=r.r2l(l.range[1]),P=C-L;l.p2d=function(t){return t/l._width*P+L},l.d2p=function(t){return(t-L)/P*l._width},l._rl=[L,C],s.call(p,t,r,l).call(m,t,r,l).call(v,t,r,l).call(g,t,r,l).call(y,t,r,l).call(b,t,r,l),function(t,e,r,a){var s=t.select("rect."+d.slideBoxClassName).node(),l=t.select("rect."+d.grabAreaMinClassName).node(),c=t.select("rect."+d.grabAreaMaxClassName).node();t.on("mousedown",function(){var u=n.event,d=u.target,p=u.clientX,m=p-t.node().getBoundingClientRect().left,v=a.d2p(r._rl[0]),g=a.d2p(r._rl[1]),y=f.coverSlip();function b(t){var u,f,b,x=+t.clientX-p;switch(d){case s:b="ew-resize",u=v+x,f=g+x;break;case l:b="col-resize",u=v+x,f=g;break;case c:b="col-resize",u=v,f=g+x;break;default:b="ew-resize",u=m,f=m+x}if(f<u){var _=f;f=u,u=_}a._pixelMin=u,a._pixelMax=f,h(n.select(y),b),function(t,e,r,n){function a(t){return r.l2r(o.constrain(t,n._rl[0],n._rl[1]))}var s=a(n.p2d(n._pixelMin)),l=a(n.p2d(n._pixelMax));window.requestAnimationFrame(function(){i.relayout(e,r._name+".range",[s,l])})}(0,e,r,a)}y.addEventListener("mousemove",b),y.addEventListener("mouseup",function t(){y.removeEventListener("mousemove",b);y.removeEventListener("mouseup",t);o.removeElement(y)})})}(s,t,r,l),function(t,e,r,n){var i=d.handleWidth/2;function a(t){return o.constrain(t,0,n._width)}function s(t){return o.constrain(t,-i,n._width+i)}var l=a(n.d2p(r._rl[0])),c=a(n.d2p(r._rl[1]));t.select("rect."+d.slideBoxClassName).attr("x",l).attr("width",c-l),t.select("rect."+d.maskMinClassName).attr("width",l),t.select("rect."+d.maskMaxClassName).attr("x",c).attr("width",n._width-c);var u=Math.round(s(l-i))-.5,f=Math.round(s(c-i))+.5;t.select("g."+d.grabberMinClassName).attr("transform","translate("+u+",0.5)"),t.select("g."+d.grabberMaxClassName).attr("transform","translate("+f+",0.5)")}(s,0,r,l),a.autoMargin(t,l._id,{x:k[0],y:A[0],l:0,r:0,t:0,b:l._height+w.b+T,pad:d.extraPad+2*l._offsetShift})})}},{"../../lib":724,"../../lib/setcursor":743,"../../plotly":765,"../../plots/cartesian":781,"../../plots/cartesian/axes":770,"../../plots/plots":833,"../color":598,"../dragelement":620,"../drawing":623,"./constants":672,d3:128}],675:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:t("./draw")}},{"./attributes":670,"./calc_autorange":671,"./defaults":673,"./draw":674}],676:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),i=t("../../traces/scatter/attributes").line,a=t("../drawing/attributes").dash,o=t("../../lib/extend").extendFlat;e.exports={_isLinkedToArray:"shape",visible:{valType:"boolean",dflt:!0,editType:"calcIfAutorange+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calcIfAutorange+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),x0:{valType:"any",editType:"calcIfAutorange+arraydraw"},x1:{valType:"any",editType:"calcIfAutorange+arraydraw"},yref:o({},n.yref,{}),y0:{valType:"any",editType:"calcIfAutorange+arraydraw"},y1:{valType:"any",editType:"calcIfAutorange+arraydraw"},path:{valType:"string",editType:"calcIfAutorange+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},i.color,{editType:"arraydraw"}),width:o({},i.width,{editType:"calcIfAutorange+arraydraw"}),dash:o({},a,{editType:"arraydraw"}),editType:"calcIfAutorange+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},editType:"arraydraw"}},{"../../lib/extend":713,"../../traces/scatter/attributes":1048,"../annotations/attributes":581,"../drawing/attributes":622}],677:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./constants"),o=t("./helpers");function s(t,e,r,n,i){var s="category"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,c,u,f,h=1/0,d=-1/0,p=n.match(a.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;l<p.length;l++)void 0!==(c=i[p[l].charAt(0)].drawn)&&(!(u=p[l].substr(1).match(a.paramRE))||u.length<c||((f=s(u[c]))<h&&(h=f),f>d&&(d=f)));return d>=h?[h,d]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;o<r.length;o++){var l,c,u=r[o],f=u.line.width/2;"paper"!==u.xref&&(c=s(l=i.getFromId(t,u.xref),u.x0,u.x1,u.path,a.paramIsX))&&i.expand(l,c,{ppad:f}),"paper"!==u.yref&&(c=s(l=i.getFromId(t,u.yref),u.y0,u.y1,u.path,a.paramIsY))&&i.expand(l,c,{ppad:f})}}},{"../../lib":724,"../../plots/cartesian/axes":770,"./constants":678,"./helpers":681}],678:[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}}},{}],679:[function(t,e,r){"use strict";var n=t("../../plots/array_container_defaults"),i=t("./shape_defaults");e.exports=function(t,e){n(t,e,{name:"shapes",handleItemDefaults:i})}},{"../../plots/array_container_defaults":767,"./shape_defaults":683}],680:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../color"),s=t("../drawing"),l=t("../dragelement"),c=t("../../lib/setcursor"),u=t("./constants"),f=t("./helpers");function h(t,e){t._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+e+'"]').remove();var r=(t.layout.shapes||[])[e],i=t._fullLayout.shapes[e];if(r&&!1!==i.visible)if("below"!==i.layer)h(t._fullLayout._shapeUpperLayer);else if("paper"===i.xref||"paper"===i.yref)h(t._fullLayout._shapeLowerLayer);else{var u=t._fullLayout._plots[i.xref+i.yref];if(u)h((u.mainplotinfo||u).shapelayer);else h(t._fullLayout._shapeLowerLayer)}function h(r){var u={"data-index":e,"fill-rule":"evenodd",d:d(t,i)},h=i.line.width?i.line.color:"rgba(0,0,0,0)",m=r.append("path").attr(u).style("opacity",i.opacity).call(o.stroke,h).call(o.fill,i.fillcolor).call(s.dashLine,i.line.dash,i.line.width),v=(i.xref+i.yref).replace(/paper/g,"");m.call(s.setClipUrl,v?"clip"+t._fullLayout._uid+v:null),t._context.edits.shapePosition&&function(t,e,r,i){var o,s,u,h,m,v,g,y,b,x,_,w,M,k,A,T,E,S,L,C,P,z,O,D,I,R,N,F,j,B,U=10,V=10,q={element:e.node(),gd:t,prepFn:function(e){D=a.getFromId(t,r.xref),I=a.getFromId(t,r.yref),R=f.getDataToPixel(t,D),N=f.getDataToPixel(t,I,!0),F=f.getPixelToData(t,D),j=f.getPixelToData(t,I,!0);var n="shapes["+i+"]";"path"===r.type?(z=r.path,O=n+".path"):(s=R(r.x0),u=N(r.y0),h=R(r.x1),m=N(r.y1),v=n+".x0",g=n+".y0",y=n+".x1",b=n+".y1");s<h?(w=s,T=n+".x0",C="x0",M=h,E=n+".x1",P="x1"):(w=h,T=n+".x1",C="x1",M=s,E=n+".x0",P="x0");u<m?(x=u,k=n+".y0",S="y0",_=m,A=n+".y1",L="y1"):(x=m,k=n+".y1",S="y1",_=u,A=n+".y0",L="y0");o={},G(e),q.moveFn="move"===B?Y:W},doneFn:function(){c(e),n.relayout(t,o)}},H=q.element.getBoundingClientRect();function G(t){var r=H.right-H.left,n=H.bottom-H.top,i=t.clientX-H.left,a=t.clientY-H.top,o=r>U&&n>V&&!t.shiftKey?l.getCursor(i/r,1-a/n):"move";c(e,o),B=o.split("-")[0]}function Y(n,i){if("path"===r.type){var a=function(t){return F(R(t)+n)};D&&"date"===D.type&&(a=f.encodeDate(a));var l=function(t){return j(N(t)+i)};I&&"date"===I.type&&(l=f.encodeDate(l)),r.path=p(z,a,l),o[O]=r.path}else o[v]=r.x0=F(s+n),o[g]=r.y0=j(u+i),o[y]=r.x1=F(h+n),o[b]=r.y1=j(m+i);e.attr("d",d(t,r))}function W(n,i){if("path"===r.type){var a=function(t){return F(R(t)+n)};D&&"date"===D.type&&(a=f.encodeDate(a));var s=function(t){return j(N(t)+i)};I&&"date"===I.type&&(s=f.encodeDate(s)),r.path=p(z,a,s),o[O]=r.path}else{var l=~B.indexOf("n")?x+i:x,c=~B.indexOf("s")?_+i:_,u=~B.indexOf("w")?w+n:w,h=~B.indexOf("e")?M+n:M;c-l>V&&(o[k]=r[S]=j(l),o[A]=r[L]=j(c)),h-u>U&&(o[T]=r[C]=F(u),o[E]=r[P]=F(h))}e.attr("d",d(t,r))}l.init(q),e.node().onmousemove=G}(t,m,i,e)}}function d(t,e){var r,n,o,s,l=e.type,c=a.getFromId(t,e.xref),h=a.getFromId(t,e.yref),d=t._fullLayout._size;if(c?(r=f.shapePositionToRange(c),n=function(t){return c._offset+c.r2p(r(t,!0))}):n=function(t){return d.l+d.w*t},h?(o=f.shapePositionToRange(h),s=function(t){return h._offset+h.r2p(o(t,!0))}):s=function(t){return d.t+d.h*(1-t)},"path"===l)return c&&"date"===c.type&&(n=f.decodeDate(n)),h&&"date"===h.type&&(s=f.decodeDate(s)),function(t,e,r){return t.replace(u.segmentRE,function(t){var n=0,a=t.charAt(0),o=u.paramIsX[a],s=u.paramIsY[a],l=u.numParams[a],c=t.substr(1).replace(u.paramRE,function(t){return o[n]?t=e(t):s[n]&&(t=r(t)),++n>l&&(t="X"),t});return n>l&&(c=c.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),a+c})}(e.path,n,s);var p=n(e.x0),m=n(e.x1),v=s(e.y0),g=s(e.y1);if("line"===l)return"M"+p+","+v+"L"+m+","+g;if("rect"===l)return"M"+p+","+v+"H"+m+"V"+g+"H"+p+"Z";var y=(p+m)/2,b=(v+g)/2,x=Math.abs(y-p),_=Math.abs(b-v),w="A"+x+","+_,M=y+x+","+b;return"M"+M+w+" 0 1,1 "+(y+","+(b-_))+w+" 0 0,1 "+M+"Z"}function p(t,e,r){return t.replace(u.segmentRE,function(t){var n=0,i=t.charAt(0),a=u.paramIsX[i],o=u.paramIsY[i],s=u.numParams[i];return i+t.substr(1).replace(u.paramRE,function(t){return n>=s?t:(a[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}e.exports={draw:function(t){var e=t._fullLayout;e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._shapeSubplotLayers.selectAll("path").remove();for(var r=0;r<e.shapes.length;r++)e.shapes[r].visible&&h(t,r)},drawOne:h}},{"../../lib":724,"../../lib/setcursor":743,"../../plotly":765,"../../plots/cartesian/axes":770,"../color":598,"../dragelement":620,"../drawing":623,"./constants":678,"./helpers":681}],681:[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}},{}],682:[function(t,e,r){"use strict";var n=t("./draw");e.exports={moduleType:"component",name:"shapes",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("shapes"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"../../plots/cartesian/include_components":780,"./attributes":676,"./calc_autorange":677,"./defaults":679,"./draw":680}],683:[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 c(r,i){return n.coerce(t,e,a,r,i)}if(s=s||{},!c("visible",!(l=l||{}).itemIsNotPlainObject))return e;c("layer"),c("opacity"),c("fillcolor"),c("line.color"),c("line.width"),c("line.dash");for(var u=c("type",t.path?"path":"rect"),f=["x","y"],h=0;h<2;h++){var d=f[h],p={_fullLayout:r},m=i.coerceRef(t,e,p,d,"","paper");if("path"!==u){var v,g,y;"paper"!==m?(v=i.getFromId(p,m),y=o.rangeToShapePosition(v),g=o.shapePositionToRange(v)):g=y=n.identity;var b=d+"0",x=d+"1",_=t[b],w=t[x];t[b]=g(t[b],!0),t[x]=g(t[x],!0),i.coercePosition(e,p,c,m,b,.25),i.coercePosition(e,p,c,m,x,.75),e[b]=y(e[b]),e[x]=y(e[x]),t[b]=_,t[x]=w}}return"path"===u?c("path"):n.noneOrAll(t,e,["x0","x1","y0","y1"]),e}},{"../../lib":724,"../../plots/cartesian/axes":770,"./attributes":676,"./helpers":681}],684:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/pad_attributes"),a=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/animation_attributes"),l=t("./constants");e.exports=o({_isLinkedToArray:"slider",visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:{_isLinkedToArray:"step",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:a({},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:n({})},font: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}},"arraydraw","from-root")},{"../../lib/extend":713,"../../plot_api/edit_types":754,"../../plots/animation_attributes":766,"../../plots/font_attributes":797,"../../plots/pad_attributes":832,"./constants":685}],685:[function(t,e,r){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],686:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.steps;function l(t,e,r){function i(r,i){return n.coerce(t,e,a,r,i)}i("visible",function(t,e){var r,i,a=t.steps||[],o=e.steps=[];function l(t,e){return n.coerce(r,i,s,t,e)}for(var c=0;c<a.length;c++)r=a[c],i={},l("method"),n.isPlainObject(r)&&("skip"===i.method||Array.isArray(r.args))&&(l("args"),l("label","step-"+c),l("value",i.label),l("execute"),o.push(i));return o}(t,e).length>0)&&(i("active"),i("x"),i("y"),n.noneOrAll(t,e,["x","y"]),i("xanchor"),i("yanchor"),i("len"),i("lenmode"),i("pad.t"),i("pad.r"),i("pad.b"),i("pad.l"),n.coerceFont(i,"font",r.font),i("currentvalue.visible")&&(i("currentvalue.xanchor"),i("currentvalue.prefix"),i("currentvalue.suffix"),i("currentvalue.offset"),n.coerceFont(i,"currentvalue.font",e.font)),i("transition.duration"),i("transition.easing"),i("bgcolor"),i("activebgcolor"),i("bordercolor"),i("borderwidth"),i("ticklen"),i("tickwidth"),i("tickcolor"),i("minorticklen"))}e.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":724,"../../plots/array_container_defaults":767,"./attributes":684,"./constants":685}],687:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib/svg_text_utils"),l=t("../legend/anchor_utils"),c=t("./constants"),u=t("../../constants/alignment"),f=u.LINE_SPACING,h=u.FROM_TL,d=u.FROM_BR;function p(t){return t._index}function m(t,e){var r=o.tester.selectAll("g."+c.labelGroupClass).data(e.steps);r.enter().append("g").classed(c.labelGroupClass,!0);var a=0,u=0;r.each(function(t){var r=y(n.select(this),{step:t},e).node();if(r){var i=o.bBox(r);u=Math.max(u,i.height),a=Math.max(a,i.width)}}),r.remove();var f=e._dims={};f.inputAreaWidth=Math.max(c.railWidth,c.gripHeight);var p=t._fullLayout._size;f.lx=p.l+p.w*e.x,f.ly=p.t+p.h*(1-e.y),"fraction"===e.lenmode?f.outerLength=Math.round(p.w*e.len):f.outerLength=e.len,f.inputAreaStart=0,f.inputAreaLength=Math.round(f.outerLength-e.pad.l-e.pad.r);var m=(f.inputAreaLength-2*c.stepInset)/(e.steps.length-1),g=a+c.labelPadding;if(f.labelStride=Math.max(1,Math.ceil(g/m)),f.labelHeight=u,f.currentValueMaxWidth=0,f.currentValueHeight=0,f.currentValueTotalHeight=0,f.currentValueMaxLines=1,e.currentvalue.visible){var b=o.tester.append("g");r.each(function(t){var r=v(b,e,t.label),n=r.node()&&o.bBox(r.node())||{width:0,height:0},i=s.lineCount(r);f.currentValueMaxWidth=Math.max(f.currentValueMaxWidth,Math.ceil(n.width)),f.currentValueHeight=Math.max(f.currentValueHeight,Math.ceil(n.height)),f.currentValueMaxLines=Math.max(f.currentValueMaxLines,i)}),f.currentValueTotalHeight=f.currentValueHeight+e.currentvalue.offset,b.remove()}f.height=f.currentValueTotalHeight+c.tickOffset+e.ticklen+c.labelOffset+f.labelHeight+e.pad.t+e.pad.b;var x="left";l.isRightAnchor(e)&&(f.lx-=f.outerLength,x="right"),l.isCenterAnchor(e)&&(f.lx-=f.outerLength/2,x="center");var _="top";l.isBottomAnchor(e)&&(f.ly-=f.height,_="bottom"),l.isMiddleAnchor(e)&&(f.ly-=f.height/2,_="middle"),f.outerLength=Math.ceil(f.outerLength),f.height=Math.ceil(f.height),f.lx=Math.round(f.lx),f.ly=Math.round(f.ly),i.autoMargin(t,c.autoMarginIdRoot+e._index,{x:e.x,y:e.y,l:f.outerLength*h[x],r:f.outerLength*d[x],b:f.height*d[_],t:f.height*h[_]})}function v(t,e,r){if(e.currentvalue.visible){var n,i,a=t.selectAll("text").data([0]),l=e._dims;switch(e.currentvalue.xanchor){case"right":n=l.inputAreaLength-c.currentValueInset-l.currentValueMaxWidth,i="left";break;case"center":n=.5*l.inputAreaLength,i="middle";break;default:n=c.currentValueInset,i="left"}a.enter().append("text").classed(c.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":i,"data-notex":1});var u=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)u+=r;else u+=e.steps[e.active].label;e.currentvalue.suffix&&(u+=e.currentvalue.suffix),a.call(o.font,e.currentvalue.font).text(u).call(s.convertToTspans,e._gd);var h=s.lineCount(a),d=(l.currentValueMaxLines+1-h)*e.currentvalue.font.size*f;return s.positionText(a,n,d),a}}function g(t,e,r){var n=t.selectAll("rect."+c.gripRectClass).data([0]);n.enter().append("rect").classed(c.gripRectClass,!0).call(w,e,t,r).style("pointer-events","all"),n.attr({width:c.gripWidth,height:c.gripHeight,rx:c.gripRadius,ry:c.gripRadius}).call(a.stroke,r.bordercolor).call(a.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function y(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(c.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),n.call(o.font,r.font).text(e.step.label).call(s.convertToTspans,r._gd),n}function b(t,e){var r=t.selectAll("g."+c.labelsClass).data([0]),i=e._dims;r.enter().append("g").classed(c.labelsClass,!0);var a=r.selectAll("g."+c.labelGroupClass).data(i.labelSteps);a.enter().append("g").classed(c.labelGroupClass,!0),a.exit().remove(),a.each(function(t){var r=n.select(this);r.call(y,t,e),o.setTranslate(r,A(e,t.fraction),c.tickOffset+e.ticklen+e.font.size*f+c.labelOffset+i.currentValueTotalHeight)})}function x(t,e,r,n,i){var a=Math.round(n*(r.steps.length-1));a!==r.active&&_(t,e,r,a,!0,i)}function _(t,e,r,n,a,o){var s=r.active;r._input.active=r.active=n;var l=r.steps[r.active];e.call(k,r,r.active/(r.steps.length-1),o),e.call(v,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:s}),l&&l.method&&a&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=a,e._nextMethod.doTransition=o):(e._nextMethod={step:l,doCallback:a,doTransition:o},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&i.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function w(t,e,r){var i=r.node(),o=n.select(e);function s(){return r.data()[0]}t.on("mousedown",function(){var t=s();e.emit("plotly_sliderstart",{slider:t});var l=r.select("."+c.gripRectClass);n.event.stopPropagation(),n.event.preventDefault(),l.call(a.fill,t.activebgcolor);var u=T(t,n.mouse(i)[0]);x(e,r,t,u,!0),t._dragging=!0,o.on("mousemove",function(){var t=s(),a=T(t,n.mouse(i)[0]);x(e,r,t,a,!1)}),o.on("mouseup",function(){var t=s();t._dragging=!1,l.call(a.fill,t.bgcolor),o.on("mouseup",null),o.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function M(t,e){var r=t.selectAll("rect."+c.tickRectClass).data(e.steps),i=e._dims;r.enter().append("rect").classed(c.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var s=r%i.labelStride==0,l=n.select(this);l.attr({height:s?e.ticklen:e.minorticklen}).call(a.fill,e.tickcolor),o.setTranslate(l,A(e,r/(e.steps.length-1))-.5*e.tickwidth,(s?c.tickOffset:c.minorTickOffset)+i.currentValueTotalHeight)})}function k(t,e,r,n){var i=t.select("rect."+c.gripRectClass),a=A(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*c.gripWidth)+","+e._dims.currentValueTotalHeight+")")}}function A(t,e){var r=t._dims;return r.inputAreaStart+c.stepInset+(r.inputAreaLength-2*c.stepInset)*Math.min(1,Math.max(0,e))}function T(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-c.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*c.stepInset-2*r.inputAreaStart)))}function E(t,e,r){var n=t.selectAll("rect."+c.railTouchRectClass).data([0]),i=r._dims;n.enter().append("rect").classed(c.railTouchRectClass,!0).call(w,e,t,r).style("pointer-events","all"),n.attr({width:i.inputAreaLength,height:Math.max(i.inputAreaWidth,c.tickOffset+r.ticklen+i.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(n,0,i.currentValueTotalHeight)}function S(t,e){var r=t.selectAll("rect."+c.railRectClass).data([0]),n=e._dims;r.enter().append("rect").classed(c.railRectClass,!0);var i=n.inputAreaLength-2*c.railInset;r.attr({width:i,height:c.railWidth,rx:c.railRadius,ry:c.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(r,c.railInset,.5*(n.inputAreaWidth-c.railWidth)+n.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[c.name],n=[],i=0;i<r.length;i++){var a=r[i];a.visible&&a.steps.length&&(a._gd=e,n.push(a))}return n}(e,t),a=e._infolayer.selectAll("g."+c.containerClassName).data(r.length>0?[0]:[]);if(a.enter().append("g").classed(c.containerClassName,!0).style("cursor","ew-resize"),a.exit().remove(),a.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var a=r[n];-1!==a.indexOf(c.autoMarginIdRoot)&&i.autoMargin(t,a)}}(t),0!==r.length){var s=a.selectAll("g."+c.groupClassName).data(r,p);s.enter().append("g").classed(c.groupClassName,!0),s.exit().each(function(e){n.select(this).remove(),e._commandObserver.remove(),delete e._commandObserver,i.autoMargin(t,c.autoMarginIdRoot+e._index)});for(var l=0;l<r.length;l++){var u=r[l];m(t,u)}s.each(function(e){if(!(e.steps.length<2)){var r=n.select(this);!function(t){var e=t._dims;e.labelSteps=[];for(var r=t.steps.length,n=0;n<r;n+=e.labelStride)e.labelSteps.push({fraction:n/(r-1),step:t.steps[n]})}(e),i.manageCommandObserver(t,e,e.steps,function(e){var n=r.data()[0];n.active!==e.index&&(n._dragging||_(t,r,n,e.index,!1,!0))}),function(t,e,r){r.active>=r.steps.length&&(r.active=0);e.call(v,r).call(S,r).call(b,r).call(M,r).call(E,t,r).call(g,t,r);var n=r._dims;o.setTranslate(e,n.lx+r.pad.l,n.ly+r.pad.t),e.call(k,r,r.active/(r.steps.length-1),!1),e.call(v,r)}(t,n.select(this),e)}})}}},{"../../constants/alignment":696,"../../lib/svg_text_utils":747,"../../plots/plots":833,"../color":598,"../drawing":623,"../legend/anchor_utils":649,"./constants":685,d3:128}],688:[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":684,"./constants":685,"./defaults":686,"./draw":687}],689:[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"),c=t("../color"),u=t("../../lib/svg_text_utils"),f=t("../../constants/interactions"),h=/ [XY][0-9]* /;(e.exports={}).draw=function(t,e,r){var d,p=r.propContainer,m=r.propName,v=r.placeholder,g=r.traceIndex,y=r.avoid||{},b=r.attributes,x=r.transform,_=r.containerGroup,w=t._fullLayout,M=p.titlefont||{},k=M.family,A=M.size,T=M.color,E=1,S=!1,L=(p.title||"").trim();"title"===m?d="titleText":-1!==m.indexOf("axis")?d="axisTitleText":m.indexOf(!0)&&(d="colorbarTitleText");var C=t._context.edits[d];""===L?E=0:L.replace(h," % ")===v.replace(h," % ")&&(E=.2,S=!0,C||(L=""));var P=L||C;_||(_=w._infolayer.selectAll(".g-"+e).data([0])).enter().append("g").classed("g-"+e,!0);var z=_.selectAll("text").data(P?[0]:[]);if(z.enter().append("text"),z.text(L).attr("class",e),z.exit().remove(),!P)return _;function O(t){s.syncOrAsync([D,I],t)}function D(e){var r;return x?(r="",x.rotate&&(r+="rotate("+[x.rotate,b.x,b.y]+")"),x.offset&&(r+="translate(0, "+x.offset+")")):r=null,e.attr("transform",r),e.style({"font-family":k,"font-size":n.round(A,2)+"px",fill:c.rgb(T),opacity:E*c.opacity(T),"font-weight":o.fontWeight}).attr(b).call(u.convertToTspans,t),o.previousPromises(t)}function I(t){var e=n.select(t.node().parentNode);if(y&&y.selection&&y.side&&L){e.attr("transform",null);var r=0,a={left:"right",right:"left",top:"bottom",bottom:"top"}[y.side],o=-1!==["left","top"].indexOf(y.side)?-1:1,c=i(y.pad)?y.pad:2,u=l.bBox(e.node()),f={left:0,top:0,right:w.width,bottom:w.height},h=y.maxShift||(f[y.side]-u[y.side])*("left"===y.side||"top"===y.side?-1:1);if(h<0)r=h;else{var d=y.offsetLeft||0,p=y.offsetTop||0;u.left-=d,u.right-=d,u.top-=p,u.bottom-=p,y.selection.each(function(){var t=l.bBox(this);s.bBoxIntersect(u,t,c)&&(r=Math.max(r,o*(t[y.side]-u[a])+c))}),r=Math.min(h,r)}if(r>0||h<0){var m={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[y.side];e.attr("transform","translate("+m+")")}}}return z.call(O),C&&(L?z.on(".opacity",null):(E=0,S=!0,z.text(v).on("mouseover.opacity",function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})),z.call(u.makeEditable,{gd:t}).on("edit",function(e){void 0!==g?a.restyle(t,m,e,g):a.relayout(t,m,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(O)}).on("input",function(t){this.text(t||" ").call(u.positionText,b.x,b.y)})),z.classed("js-placeholder",S),_}},{"../../constants/interactions":701,"../../lib":724,"../../lib/svg_text_utils":747,"../../plotly":765,"../../plots/plots":833,"../color":598,"../drawing":623,d3:128,"fast-isnumeric":140}],690:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes");e.exports=o({_isLinkedToArray:"updatemenu",_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:{_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}},x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:a({},s,{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":713,"../../plot_api/edit_types":754,"../../plots/font_attributes":797,"../../plots/pad_attributes":832,"../color/attributes":597}],691:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],692:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.buttons;function l(t,e,r){function i(r,i){return n.coerce(t,e,a,r,i)}i("visible",function(t,e){var r,i,a=t.buttons||[],o=e.buttons=[];function l(t,e){return n.coerce(r,i,s,t,e)}for(var c=0;c<a.length;c++)r=a[c],i={},l("method"),n.isPlainObject(r)&&("skip"===i.method||Array.isArray(r.args))&&(l("args"),l("label"),l("execute"),i._index=c,o.push(i));return o}(t,e).length>0)&&(i("active"),i("direction"),i("type"),i("showactive"),i("x"),i("y"),n.noneOrAll(t,e,["x","y"]),i("xanchor"),i("yanchor"),i("pad.t"),i("pad.r"),i("pad.b"),i("pad.l"),n.coerceFont(i,"font",r.font),i("bgcolor",r.paper_bgcolor),i("bordercolor"),i("borderwidth"))}e.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":724,"../../plots/array_container_defaults":767,"./attributes":690,"./constants":691}],693:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib/svg_text_utils"),l=t("../legend/anchor_utils"),c=t("../../constants/alignment").LINE_SPACING,u=t("./constants"),f=t("./scrollbox");function h(t){return t._index}function d(t,e){return+t.attr(u.menuIndexAttrName)===e._index}function p(t,e,r,n,i,a,o,s){e._input.active=e.active=o,"buttons"===e.type?v(t,n,null,null,e):"dropdown"===e.type&&(i.attr(u.menuIndexAttrName,"-1"),m(t,n,i,a,e),s||v(t,n,i,a,e))}function m(t,e,r,n,i){var a=e.selectAll("g."+u.headerClassName).data([0]),s=i._dims;a.enter().append("g").classed(u.headerClassName,!0).style("pointer-events","all");var l=i.active,c=i.buttons[l]||u.blankHeaderOpts,f={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},h={width:s.headerWidth,height:s.headerHeight};a.call(g,i,c,t).call(k,i,f,h);var p=e.selectAll("text."+u.headerArrowClassName).data([0]);p.enter().append("text").classed(u.headerArrowClassName,!0).classed("user-select-none",!0).attr("text-anchor","end").call(o.font,i.font).text(u.arrowSymbol[i.direction]),p.attr({x:s.headerWidth-u.arrowOffsetX+i.pad.l,y:s.headerHeight/2+u.textOffsetY+i.pad.t}),a.on("click",function(){r.call(A),r.attr(u.menuIndexAttrName,d(r,i)?-1:String(i._index)),v(t,e,r,n,i)}),a.on("mouseover",function(){a.call(_)}),a.on("mouseout",function(){a.call(w,i)}),o.setTranslate(e,s.lx,s.ly)}function v(t,e,r,a,o){r||(r=e).attr("pointer-events","all");var s=function(t){return-1==+t.attr(u.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,l="dropdown"===o.type?u.dropdownButtonClassName:u.buttonClassName,c=r.selectAll("g."+l).data(s),f=c.enter().append("g").classed(l,!0),h=c.exit();"dropdown"===o.type?(f.attr("opacity","0").transition().attr("opacity","1"),h.transition().attr("opacity","0").remove()):h.remove();var d=0,m=0,v=o._dims,y=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(y?m=v.headerHeight+u.gapButtonHeader:d=v.headerWidth+u.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(m=-u.gapButtonHeader+u.gapButton-v.openHeight),"dropdown"===o.type&&"left"===o.direction&&(d=-u.gapButtonHeader+u.gapButton-v.openWidth);var b={x:v.lx+d+o.pad.l,y:v.ly+m+o.pad.t,yPad:u.gapButton,xPad:u.gapButton,index:0},M={l:b.x+o.borderwidth,t:b.y+o.borderwidth};c.each(function(s,l){var u=n.select(this);u.call(g,o,s,t).call(k,o,b),u.on("click",function(){n.event.defaultPrevented||(p(t,o,0,e,r,a,l),s.execute&&i.executeAPICommand(t,s.method,s.args),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))}),u.on("mouseover",function(){u.call(_)}),u.on("mouseout",function(){u.call(w,o),c.call(x,o)})}),c.call(x,o),y?(M.w=Math.max(v.openWidth,v.headerWidth),M.h=b.y-M.t):(M.w=b.x-M.l,M.h=Math.max(v.openHeight,v.headerHeight)),M.direction=o.direction,a&&(c.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,f="up"===c||"down"===c,h=i._dims,d=i.active;if(f)for(s=0,l=0;l<d;l++)s+=h.heights[l]+u.gapButton;else for(o=0,l=0;l<d;l++)o+=h.widths[l]+u.gapButton;n.enable(a,o,s),n.hbar&&n.hbar.attr("opacity","0").transition().attr("opacity","1");n.vbar&&n.vbar.attr("opacity","0").transition().attr("opacity","1")}(0,0,0,a,o,M):function(t){var e=!!t.hbar,r=!!t.vbar;e&&t.hbar.transition().attr("opacity","0").each("end",function(){e=!1,r||t.disable()});r&&t.vbar.transition().attr("opacity","0").each("end",function(){r=!1,e||t.disable()})}(a))}function g(t,e,r,n){t.call(y,e).call(b,e,r,n)}function y(t,e){var r=t.selectAll("rect").data([0]);r.enter().append("rect").classed(u.itemRectClassName,!0).attr({rx:u.rx,ry:u.ry,"shape-rendering":"crispEdges"}),r.call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px")}function b(t,e,r,n){var i=t.selectAll("text").data([0]);i.enter().append("text").classed(u.itemTextClassName,!0).classed("user-select-none",!0).attr({"text-anchor":"start","data-notex":1}),i.call(o.font,e.font).text(r.label).call(s.convertToTspans,n)}function x(t,e){var r=e.active;t.each(function(t,i){var o=n.select(this);i===r&&e.showactive&&o.select("rect."+u.itemRectClassName).call(a.fill,u.activeColor)})}function _(t){t.select("rect."+u.itemRectClassName).call(a.fill,u.hoverColor)}function w(t,e){t.select("rect."+u.itemRectClassName).call(a.fill,e.bgcolor)}function M(t,e){var r=e._dims={width1:0,height1:0,heights:[],widths:[],totalWidth:0,totalHeight:0,openWidth:0,openHeight:0,lx:0,ly:0},a=o.tester.selectAll("g."+u.dropdownButtonClassName).data(e.buttons);a.enter().append("g").classed(u.dropdownButtonClassName,!0);var f=-1!==["up","down"].indexOf(e.direction);a.each(function(i,a){var l=n.select(this);l.call(g,e,i,t);var h=l.select("."+u.itemTextClassName),d=h.node()&&o.bBox(h.node()).width,p=Math.max(d+u.textPadX,u.minWidth),m=e.font.size*c,v=s.lineCount(h),y=Math.max(m*v,u.minHeight)+u.textOffsetY;y=Math.ceil(y),p=Math.ceil(p),r.widths[a]=p,r.heights[a]=y,r.height1=Math.max(r.height1,y),r.width1=Math.max(r.width1,p),f?(r.totalWidth=Math.max(r.totalWidth,p),r.openWidth=r.totalWidth,r.totalHeight+=y+u.gapButton,r.openHeight+=y+u.gapButton):(r.totalWidth+=p+u.gapButton,r.openWidth+=p+u.gapButton,r.totalHeight=Math.max(r.totalHeight,y),r.openHeight=r.totalHeight)}),f?r.totalHeight-=u.gapButton:r.totalWidth-=u.gapButton,r.headerWidth=r.width1+u.arrowPadX,r.headerHeight=r.height1,"dropdown"===e.type&&(f?(r.width1+=u.arrowPadX,r.totalHeight=r.height1):r.totalWidth=r.width1,r.totalWidth+=u.arrowPadX),a.remove();var h=r.totalWidth+e.pad.l+e.pad.r,d=r.totalHeight+e.pad.t+e.pad.b,p=t._fullLayout._size;r.lx=p.l+p.w*e.x,r.ly=p.t+p.h*(1-e.y);var m="left";l.isRightAnchor(e)&&(r.lx-=h,m="right"),l.isCenterAnchor(e)&&(r.lx-=h/2,m="center");var v="top";l.isBottomAnchor(e)&&(r.ly-=d,v="bottom"),l.isMiddleAnchor(e)&&(r.ly-=d/2,v="middle"),r.totalWidth=Math.ceil(r.totalWidth),r.totalHeight=Math.ceil(r.totalHeight),r.lx=Math.round(r.lx),r.ly=Math.round(r.ly),i.autoMargin(t,u.autoMarginIdRoot+e._index,{x:e.x,y:e.y,l:h*({right:1,center:.5}[m]||0),r:h*({left:1,center:.5}[m]||0),b:d*({top:1,middle:.5}[v]||0),t:d*({bottom:1,middle:.5}[v]||0)})}function k(t,e,r,n){n=n||{};var i=t.select("."+u.itemRectClassName),a=t.select("."+u.itemTextClassName),l=e.borderwidth,f=r.index,h=e._dims;o.setTranslate(t,l+r.x,l+r.y);var d=-1!==["up","down"].indexOf(e.direction),p=n.height||(d?h.heights[f]:h.height1);i.attr({x:0,y:0,width:n.width||(d?h.width1:h.widths[f]),height:p});var m=e.font.size*c,v=(s.lineCount(a)-1)*m/2;s.positionText(a,u.textOffsetX,p/2-v+u.textOffsetY),d?r.y+=h.heights[f]+r.yPad:r.x+=h.widths[f]+r.xPad,r.index++}function A(t){t.selectAll("g."+u.dropdownButtonClassName).remove()}e.exports=function(t){var e=t._fullLayout,r=function(t){for(var e=t[u.name],r=[],n=0;n<e.length;n++){var i=e[n];i.visible&&r.push(i)}return r}(e),a=e._menulayer.selectAll("g."+u.containerClassName).data(r.length>0?[0]:[]);if(a.enter().append("g").classed(u.containerClassName,!0).style("cursor","pointer"),a.exit().remove(),a.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var a=r[n];-1!==a.indexOf(u.autoMarginIdRoot)&&i.autoMargin(t,a)}}(t),0!==r.length){var o=a.selectAll("g."+u.headerGroupClassName).data(r,h);o.enter().append("g").classed(u.headerGroupClassName,!0);var s=a.selectAll("g."+u.dropdownButtonGroupClassName).data([0]);s.enter().append("g").classed(u.dropdownButtonGroupClassName,!0).style("pointer-events","all");for(var l=0;l<r.length;l++){var c=r[l];M(t,c)}var g="updatemenus"+e._uid,y=new f(t,s,g);o.enter().size()&&(s.node().parentNode.appendChild(s.node()),s.call(A).attr(u.menuIndexAttrName,"-1")),o.exit().each(function(e){n.select(this).remove(),s.call(A).attr(u.menuIndexAttrName,"-1"),i.autoMargin(t,u.autoMarginIdRoot+e._index)}),o.each(function(e){var r=n.select(this),a="dropdown"===e.type?s:null;i.manageCommandObserver(t,e,e.buttons,function(n){p(t,e,e.buttons[n.index],r,a,y,n.index,!0)}),"dropdown"===e.type?(m(t,r,s,y,e),d(s,e)&&v(t,r,s,y,e)):v(t,r,null,null,e)})}}},{"../../constants/alignment":696,"../../lib/svg_text_utils":747,"../../plots/plots":833,"../color":598,"../drawing":623,"../legend/anchor_utils":649,"./constants":691,"./scrollbox":695,d3:128}],694:[function(t,e,r){arguments[4][688][0].apply(r,arguments)},{"./attributes":690,"./constants":691,"./defaults":692,"./draw":693,dup:688}],695:[function(t,e,r){"use strict";e.exports=s;var n=t("d3"),i=t("../color"),a=t("../drawing"),o=t("../../lib");function s(t,e,r){this.gd=t,this.container=e,this.id=r,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}s.barWidth=2,s.barLength=20,s.barRadius=2,s.barPad=1,s.barColor="#808BA4",s.prototype.enable=function(t,e,r){var o=this.gd._fullLayout,l=o.width,c=o.height;this.position=t;var u,f,h,d,p=this.position.l,m=this.position.w,v=this.position.t,g=this.position.h,y=this.position.direction,b="down"===y,x="left"===y,_="up"===y,w=m,M=g;b||x||"right"===y||_||(this.position.direction="down",b=!0),b||_?(f=(u=p)+w,b?(h=v,M=(d=Math.min(h+M,c))-h):M=(d=v+M)-(h=Math.max(d-M,0))):(d=(h=v)+M,x?w=(f=p+w)-(u=Math.max(f-w,0)):(u=p,w=(f=Math.min(u+w,l))-u)),this._box={l:u,t:h,w:w,h:M};var k=m>w,A=s.barLength+2*s.barPad,T=s.barWidth+2*s.barPad,E=p,S=v+g;S+T>c&&(S=c-T);var L=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);L.exit().on(".drag",null).remove(),L.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),k?(this.hbar=L.attr({rx:s.barRadius,ry:s.barRadius,x:E,y:S,width:A,height:T}),this._hbarXMin=E+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=g>M,P=s.barWidth+2*s.barPad,z=s.barLength+2*s.barPad,O=p+m,D=v;O+P>l&&(O=l-P);var I=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),C?(this.vbar=I.attr({rx:s.barRadius,ry:s.barRadius,x:O,y:D,width:P,height:z}),this._vbarYMin=D+z/2,this._vbarTranslateMax=M-z):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,N=u-.5,F=C?f+P+.5:f+.5,j=h-.5,B=k?d+T+.5:d+.5,U=o._topdefs.selectAll("#"+R).data(k||C?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",R).append("rect"),k||C?(this._clipRect=U.select("rect").attr({x:Math.floor(N),y:Math.floor(j),width:Math.ceil(F)-Math.floor(N),height:Math.ceil(B)-Math.floor(j)}),this.container.call(a.setClipUrl,R),this.bg.attr({x:p,y:v,width:m,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),k||C){var V=n.behavior.drag().on("dragstart",function(){n.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=n.behavior.drag().on("dragstart",function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),C&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,s=a+this._vbarTranslateMax;e=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(a.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(a.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":724,"../color":598,"../drawing":623,d3:128}],696:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],697:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],698:[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]}},{}],699:[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]}},{}],700:[function(t,e,r){"use strict";e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},{}],701:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],702:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,MINUS_SIGN:"\u2212"}},{}],703:[function(t,e,r){"use strict";e.exports={entityToUnicode:{mu:"\u03bc","#956":"\u03bc",amp:"&","#28":"&",lt:"<","#60":"<",gt:">","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],704:[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}},{}],705:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.34.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.react=n.react,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.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/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.register([t("./locale-en"),t("./locale-en-us")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":589,"./components/annotations3d":594,"./components/fx":640,"./components/images":648,"./components/legend":657,"./components/rangeselector":669,"./components/rangeslider":675,"./components/shapes":682,"./components/sliders":688,"./components/updatemenus":694,"./fonts/mathjax_config":706,"./lib/queue":738,"./locale-en":752,"./locale-en-us":751,"./plot_api/plot_schema":759,"./plot_api/register":760,"./plot_api/set_plot_config":761,"./plot_api/to_image":763,"./plot_api/validate":764,"./plotly":765,"./snapshot":859,"./snapshot/download":856,"./traces/scatter":1060,d3:128,"es6-promise":137}],706:[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},{}],707:[function(t,e,r){"use strict";var n=Math.PI;r.deg2rad=function(t){return t/180*n},r.rad2deg=function(t){return t/n*180},r.wrap360=function(t){var e=t%360;return e<0?e+360:e},r.wrap180=function(t){return Math.abs(t)>180&&(t-=360*Math.round(t/360)),t}},{}],708:[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":702,"fast-isnumeric":140}],709:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../plots/attributes"),o=t("../components/colorscale/get_scale"),s=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),l=t("./regex").counter,c=t("../constants/interactions").DESELECTDIM,u=t("./angles").wrap180;r.valObjectMeta={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),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;n<r.length;n++){var i=String(r[n]);if("/"===i.charAt(0)&&"/"===i.charAt(i.length-1)){if(new RegExp(i.substr(1,i.length-2)).test(t))return!0}else if(t===r[n])return!0}return!1}},boolean:{coerceFunction:function(t,e,r){!0===t||!1===t?e.set(t):e.set(r)}},number:{coerceFunction:function(t,e,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;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every(function(t){return i(t).isValid()})?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(u(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r){"string"==typeof t&&l(r).test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!l(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var i=t.split("+"),a=0;a<i.length;){var o=i[a];-1===n.flags.indexOf(o)||i.indexOf(o)<a?i.splice(a,1):a++}i.length?e.set(i.join("+")):e.set(r)}else e.set(t);else e.set(r)}},any:{coerceFunction:function(t,e,r){void 0===t?e.set(r):e.set(t)}},info_array:{coerceFunction:function(t,e,n,i){if(Array.isArray(t)){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)}else e.set(n)},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++){if(!r.validate(t[i],e.items[i]))return!1}return!0}}},r.coerce=function(t,e,n,i,a){var o=s(n,i).get(),l=s(t,i),c=s(e,i),u=l.get();return void 0===a&&(a=o.dflt),o.arrayOk&&Array.isArray(u)?(c.set(u),u):(r.valObjectMeta[o.valType].coerceFunction(u,c,a,o),c.get())},r.coerce2=function(t,e,n,i,a){var o=s(t,i),l=r.coerce(t,e,n,i,a),c=o.get();return void 0!==c&&null!==c&&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.coerceHoverinfo=function(t,e,n){var i,o=e._module.attributes,s=o.hoverinfo?{hoverinfo:o.hoverinfo}:a,l=s.hoverinfo;if(1===n._dataLength){var c="all"===l.dflt?l.flags.slice():l.dflt.split("+");c.splice(c.indexOf("name"),1),i=c.join("+")}return r.coerce(t,e,s,"hoverinfo",i)},r.coerceSelectionMarkerOpacity=function(t,e){if(t.marker){var r,n,i=t.marker.opacity;if(void 0!==i)Array.isArray(i)||t.selected||t.unselected||(r=i,n=c*i),e("selected.marker.opacity",r),e("unselected.marker.opacity",n)}},r.validate=function(t,e){var n=r.valObjectMeta[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":611,"../components/colorscale/scales":617,"../constants/interactions":701,"../plots/attributes":768,"./angles":707,"./nested_property":732,"./regex":739,"fast-isnumeric":140,tinycolor2:526}],710:[function(t,e,r){"use strict";var n,i,a=t("d3"),o=t("fast-isnumeric"),s=t("./loggers"),l=t("./mod"),c=t("../constants/numerical"),u=c.BADNUM,f=c.ONEDAY,h=c.ONEHOUR,d=c.ONEMIN,p=c.ONESEC,m=c.EPOCHJD,v=t("../registry"),g=a.time.format.utc,y=/^\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,b=/^\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,x=(new Date).getFullYear()-70;function _(t){return t&&v.componentsRegistry.calendars&&"string"==typeof t&&"gregorian"!==t}function w(t,e){return String(t+Math.pow(10,e)).substr(1)}r.dateTick0=function(t,e){return _(t)?e?v.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:v.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return _(t)?v.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime},r.dateTime2ms=function(t,e){if(r.isJSDate(t))return(t=Number(t)-t.getTimezoneOffset()*d)>=n&&t<=i?t:u;if("string"!=typeof t&&"number"!=typeof t)return u;t=String(t);var a=_(e),o=t.charAt(0);!a||"G"!==o&&"g"!==o||(t=t.substr(1),e="");var s=a&&"chinese"===e.substr(0,7),l=t.match(s?b:y);if(!l)return u;var c=l[1],g=l[3]||"1",w=Number(l[5]||1),M=Number(l[7]||0),k=Number(l[9]||0),A=Number(l[11]||0);if(a){if(2===c.length)return u;var T;c=Number(c);try{var E=v.getComponentMethod("calendars","getCal")(e);if(s){var S="i"===g.charAt(g.length-1);g=parseInt(g,10),T=E.newDate(c,E.toMonthIndex(c,g,S),w)}else T=E.newDate(c,Number(g),w)}catch(t){return u}return T?(T.toJD()-m)*f+M*h+k*d+A*p:u}c=2===c.length?(Number(c)+2e3-x)%100+x:Number(c),g-=1;var L=new Date(Date.UTC(2e3,g,w,M,k));return L.setUTCFullYear(c),L.getUTCMonth()!==g?u:L.getUTCDate()!==w?u:L.getTime()+A*p},n=r.MIN_MS=r.dateTime2ms("-9999"),i=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==u};var M=90*f,k=3*h,A=5*d;function T(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+w(e,2)+":"+w(r,2),(n||i)&&(t+=":"+w(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+w(i,a)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=i))return u;e||(e=0);var a,o,s,c,y,b,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(_(r)){var E=Math.floor(w/f)+m,S=Math.floor(l(t,f));try{a=v.getComponentMethod("calendars","getCal")(r).fromJD(E).formatDate("yyyy-mm-dd")}catch(t){a=g("G%Y-%m-%d")(new Date(w))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e<M?Math.floor(S/h):0,s=e<M?Math.floor(S%h/d):0,c=e<k?Math.floor(S%d/p):0,y=e<A?S%p*10+x:0}else b=new Date(w),a=g("%Y-%m-%d")(b),o=e<M?b.getUTCHours():0,s=e<M?b.getUTCMinutes():0,c=e<k?b.getUTCSeconds():0,y=e<A?10*b.getUTCMilliseconds()+x:0;return T(a,o,s,c,y)},r.ms2DateTimeLocal=function(t){if(!(t>=n+f&&t<=i-f))return u;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return T(a.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(r.isJSDate(t)||"number"==typeof t){if(_(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var E=/%\d?f/g;function S(t,e,r,n){t=t.replace(E,function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"});var i=new Date(Math.floor(e+.05));if(_(n))try{t=v.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var L=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,i,a){if(i=_(i)&&i,!e)if("y"===r)e=a.year;else if("m"===r)e=a.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,f),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/d),60),2);if("M"!==e){o(e)||(e=0);var i=(100+Math.min(l(t/p,60),L[e])).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(t,r)+"\n"+S(a.dayMonthYear,t,n,i);e=a.dayMonth+"\n"+a.year}return S(e,t,n,i)};var C=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,f);if(t=Math.round(t-n),r)try{var i=Math.round(t/f)+m,a=v.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return e%12?a.add(o,e,"m"):a.add(o,e/12,"y"),(o.toJD()-m)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var c=new Date(t+C);return c.setUTCMonth(c.getUTCMonth()+e)+n-C},r.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,c=_(e)&&v.getComponentMethod("calendars","getCal")(e),u=0;u<t.length;u++)if(n=t[u],o(n)){if(!(n%f))if(c)try{1===(r=c.fromJD(n/f+m)).day()?1===r.month()?i++:a++:s++}catch(t){}else 1===(r=new Date(n)).getUTCDate()?0===r.getUTCMonth()?i++:a++:s++}else l++;s+=a+=i;var h=t.length-l;return{exactYears:i/h,exactMonths:a/h,exactDays:s/h}}},{"../constants/numerical":702,"../registry":854,"./loggers":729,"./mod":731,d3:128,"fast-isnumeric":140}],711:[function(t,e,r){"use strict";e.exports=function(t,e){return Array.isArray(t)||(t=[]),t.length=e,t}},{}],712:[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:138}],713:[function(t,e,r){"use strict";var n=t("./is_plain_object.js"),i=Array.isArray;function a(t,e,r,o){var s,l,c,u,f,h,d=t[0],p=t.length;if(2===p&&i(d)&&i(t[1])&&0===d.length){if(function(t,e){var r,n;for(r=0;r<t.length;r++){if(null!==(n=t[r])&&"object"==typeof n)return!1;void 0!==n&&(e[r]=n)}return!0}(t[1],d))return d;d.splice(0,d.length)}for(var m=1;m<p;m++)for(l in s=t[m])c=d[l],u=s[l],o&&i(u)?d[l]=u:e&&u&&(n(u)||(f=i(u)))?(f?(f=!1,h=c&&i(c)?c:[]):h=c&&n(c)?c:{},d[l]=a([h,u],e,r,o)):(void 0!==u||r)&&(d[l]=u);return d}r.extendFlat=function(){return a(arguments,!1,!1,!1)},r.extendDeep=function(){return a(arguments,!0,!1,!1)},r.extendDeepAll=function(){return a(arguments,!0,!0,!1)},r.extendDeepNoArrays=function(){return a(arguments,!0,!1,!0)}},{"./is_plain_object.js":726}],714:[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}},{}],715:[function(t,e,r){"use strict";function n(t){return!0===t.visible}function i(t){return!0===t[0].trace.visible}e.exports=function(t){for(var e,r=(e=t,Array.isArray(e)&&Array.isArray(e[0])&&e[0][0]&&e[0][0].trace?i:n),a=[],o=0;o<t.length;o++){var s=t[o];r(s)&&a.push(s)}return a}},{}],716:[function(t,e,r){"use strict";var n=t("country-regex"),i=t("../lib"),a=Object.keys(n),o={"ISO-3":i.identity,"USA-states":i.identity,"country names":function(t){for(var e=0;e<a.length;e++){var r=a[e],o=new RegExp(n[r]);if(o.test(t.trim().toLowerCase()))return r}return i.log("Unrecognized country name: "+t+"."),!1}};r.locationToFeature=function(t,e,r){if(!e||"string"!=typeof e)return!1;var n=function(t,e){return(0,o[t])(e)}(t,e);if(n){for(var a=0;a<r.length;a++){var s=r[a];if(s.id===n)return s}i.log(["Location with id",n,"does not have a matching topojson feature at this resolution."].join(" "))}return!1}},{"../lib":724,"country-regex":113}],717:[function(t,e,r){"use strict";var n=t("../constants/numerical").BADNUM;r.calcTraceToLineCoords=function(t){for(var e=t[0].trace.connectgaps,r=[],i=[],a=0;a<t.length;a++){var o=t[a].lonlat;o[0]!==n?i.push(o):!e&&i.length>0&&(r.push(i),i=[])}return i.length>0&&r.push(i),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r<t.length;r++)e[r]=[t[r]];return{type:"MultiPolygon",coordinates:e}},r.makeBlank=function(){return{type:"Point",coordinates:[]}}},{"../constants/numerical":702}],718:[function(t,e,r){"use strict";var n,i,a,o=t("./mod");function s(t,e,r,n,i,a,o,s){var l=r-t,c=i-t,u=o-i,f=n-e,h=a-e,d=s-a,p=l*d-u*f;if(0===p)return null;var m=(c*d-u*h)/p,v=(c*f-l*h)/p;return v<0||v>1||m<0||m>1?null:{x:t+l*m,y:e+f*m}}function l(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,i,a,o,c){if(s(t,e,r,n,i,a,o,c))return 0;var u=r-t,f=n-e,h=o-i,d=c-a,p=u*u+f*f,m=h*h+d*d,v=Math.min(l(u,f,p,i-t,a-e),l(u,f,p,o-t,c-e),l(h,d,m,t-i,e-a),l(h,d,m,r-i,n-a));return Math.sqrt(v)},r.getTextLocation=function(t,e,r,s){if(t===i&&s===a||(n={},i=t,a=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),c=t.getPointAtLength(o(r+s/2,e)),u=Math.atan((c.y-l.y)/(c.x-l.x)),f=t.getPointAtLength(o(r,e)),h={x:(4*f.x+l.x+c.x)/6,y:(4*f.y+l.y+c.y)/6,theta:u};return n[r]=h,h},r.clearLocationCache=function(){i=null},r.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,c=0,u=t.getTotalLength(),f=u;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(i=r);var c=r.x<a?a-r.x:r.x>o?r.x-o:0,f=r.y<s?s-r.y:r.y>l?r.y-l:0;return Math.sqrt(c*c+f*f)}for(var d=h(c);d;){if((c+=d+r)>f)return;d=h(c)}for(d=h(f);d;){if(c>(f-=d+r))return;d=h(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,d=s;f<c;){if(i=(h+d)/2,o=(a=t.getPointAtLength(i))[r]-e,Math.abs(o)<l)return a;u*o>0?d=i:h=i,f++}return a}},{"./mod":731}],719:[function(t,e,r){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}},{}],720:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("color-normalize"),a=t("../components/colorscale"),o=t("../components/color/attributes").defaultLine,s=i(o),l=1;function c(t,e){var r=t;return r[3]*=e,r}function u(t){if(n(t))return s;var e=i(t);return e.length?e:s}function f(t){return n(t)?t:l}e.exports=function(t,e,r){var n,o,h,d,p,m=t.color,v=Array.isArray(m),g=Array.isArray(e),y=[];if(n=void 0!==t.colorscale?a.makeColorScaleFunc(a.extractScale(t.colorscale,t.cmin,t.cmax)):u,o=v?function(t,e){return void 0===t[e]?s:i(n(t[e]))}:u,h=g?function(t,e){return void 0===t[e]?l:f(t[e])}:f,v||g)for(var b=0;b<r;b++)d=o(m,b),p=h(e,b),y[b]=c(d,p);else y=c(i(m),e);return y}},{"../components/color/attributes":597,"../components/colorscale":613,"color-normalize":99,"fast-isnumeric":140}],721:[function(t,e,r){"use strict";var n=t("./identity");function i(t){return[t]}e.exports={keyFun:function(t){return t.key},repeat:i,descend:n,wrap:i,unwrap:function(t){return t[0]}}},{"./identity":723}],722:[function(t,e,r){"use strict";var n=t("superscript-text"),i=t("../constants/string_mappings");e.exports=function(t){return""+function(t){for(var e=i.entityToUnicode,r=0;(r=t.indexOf("&",r))>=0;){var n=t.indexOf(";",r);if(n<r)r+=1;else{var a=e[t.slice(r+1,n)];t=a?t.slice(0,r)+a+t.slice(n+1):t.slice(0,r)+t.slice(n+1)}}return t}(function(t){return t.replace(/\<.*\>/g,"")}(function(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)+n(t.slice(e+5,r))+t.slice(r+6)}return t}(t.replace(/\<br\>/g,"\n"))))}},{"../constants/string_mappings":703,"superscript-text":519}],723:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],724:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../constants/numerical"),o=a.FP_SAFE,s=a.BADNUM,l=e.exports={};l.nestedProperty=t("./nested_property"),l.keyedContainer=t("./keyed_container"),l.relativeAttr=t("./relative_attr"),l.isPlainObject=t("./is_plain_object"),l.isArray=t("./is_array"),l.mod=t("./mod"),l.toLogRange=t("./to_log_range"),l.relinkPrivateKeys=t("./relink_private"),l.ensureArray=t("./ensure_array");var c=t("./coerce");l.valObjectMeta=c.valObjectMeta,l.coerce=c.coerce,l.coerce2=c.coerce2,l.coerceFont=c.coerceFont,l.coerceHoverinfo=c.coerceHoverinfo,l.coerceSelectionMarkerOpacity=c.coerceSelectionMarkerOpacity,l.validate=c.validate;var u=t("./dates");l.dateTime2ms=u.dateTime2ms,l.isDateTime=u.isDateTime,l.ms2DateTime=u.ms2DateTime,l.ms2DateTimeLocal=u.ms2DateTimeLocal,l.cleanDate=u.cleanDate,l.isJSDate=u.isJSDate,l.formatDate=u.formatDate,l.incrementMonth=u.incrementMonth,l.dateTick0=u.dateTick0,l.dfltRange=u.dfltRange,l.findExactDates=u.findExactDates,l.MIN_MS=u.MIN_MS,l.MAX_MS=u.MAX_MS;var f=t("./search");l.findBin=f.findBin,l.sorterAsc=f.sorterAsc,l.sorterDes=f.sorterDes,l.distinctVals=f.distinctVals,l.roundUp=f.roundUp;var h=t("./stats");l.aggNums=h.aggNums,l.len=h.len,l.mean=h.mean,l.variance=h.variance,l.stdev=h.stdev,l.interp=h.interp;var d=t("./matrix");l.init2dArray=d.init2dArray,l.transposeRagged=d.transposeRagged,l.dot=d.dot,l.translationMatrix=d.translationMatrix,l.rotationMatrix=d.rotationMatrix,l.rotationXYMatrix=d.rotationXYMatrix,l.apply2DTransform=d.apply2DTransform,l.apply2DTransform2=d.apply2DTransform2;var p=t("./angles");l.deg2rad=p.deg2rad,l.rad2deg=p.rad2deg,l.wrap360=p.wrap360,l.wrap180=p.wrap180;var m=t("./geometry2d");l.segmentsIntersect=m.segmentsIntersect,l.segmentDistance=m.segmentDistance,l.getTextLocation=m.getTextLocation,l.clearLocationCache=m.clearLocationCache,l.getVisibleSegment=m.getVisibleSegment,l.findPointOnPath=m.findPointOnPath;var v=t("./extend");l.extendFlat=v.extendFlat,l.extendDeep=v.extendDeep,l.extendDeepAll=v.extendDeepAll,l.extendDeepNoArrays=v.extendDeepNoArrays;var g=t("./loggers");l.log=g.log,l.warn=g.warn,l.error=g.error;var y=t("./regex");l.counterRegex=y.counter;var b=t("./throttle");l.throttle=b.throttle,l.throttleDone=b.done,l.clearThrottle=b.clear,l.getGraphDiv=t("./get_graph_div"),l._=t("./localize"),l.notifier=t("./notifier"),l.filterUnique=t("./filter_unique"),l.filterVisible=t("./filter_visible"),l.pushUnique=t("./push_unique"),l.cleanNumber=t("./clean_number"),l.ensureNumber=function(t){return i(t)?(t=Number(t))<-o||t>o?s:i(t)?Number(t):s:s},l.noop=t("./noop"),l.identity=t("./identity"),l.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var i=0;i<e.length;i++){var a=e[i],o=l.nestedProperty(t,a.replace("?",r)),s=l.nestedProperty(t,a.replace("?",n)),c=o.get();o.set(s.get()),s.set(c)}},l.raiseToTop=function(t){t.parentNode.appendChild(t)},l.cancelTransition=function(t){return t.transition().duration(0)},l.constrain=function(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},l.simpleMap=function(t,e,r,n){for(var i=t.length,a=new Array(i),o=0;o<i;o++)a[o]=e(t[o],r,n);return a},l.randstr=function t(e,r,n){if(n||(n=16),void 0===r&&(r=24),r<=0)return"0";var i,a,o=Math.log(Math.pow(2,r))/Math.log(n),s="";for(i=2;o===1/0;i*=2)o=Math.log(Math.pow(2,r/i))/Math.log(n)*i;var l=o-Math.floor(o);for(i=0;i<Math.floor(o);i++)s=Math.floor(Math.random()*n).toString(n)+s;l&&(a=Math.pow(n,l),s=Math.floor(Math.random()*a).toString(n)+s);var c=parseInt(s,n);return e&&e.indexOf(s)>-1||c!==1/0&&c>=Math.pow(2,r)?t(e,r,n):s},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},l.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,c=new Array(l),u=new Array(o);for(r=0;r<l;r++)c[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;r<o;r++){for(a=0,n=0;n<l;n++)(i=r+n+1-e)<-o?i-=s*Math.round(i/s):i>=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*c[n];u[r]=a}return u},l.syncOrAsync=function(t,e,r){var n;function i(){return l.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,i,a=!1,o=!0;for(n=0;n<r.length;n++)void 0!==(i=t[r[n]])&&null!==i?a=!0:o=!1;if(a&&!o)for(n=0;n<r.length;n++)t[r[n]]=e[r[n]]}},l.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]},l.fillArray=function(t,e,r,n){if(n=n||l.identity,Array.isArray(t))for(var i=0;i<e.length;i++)e[i][r]=n(t[i])},l.castOption=function(t,e,r,n){n=n||l.identity;var i=l.nestedProperty(t,r).get();return Array.isArray(i)?Array.isArray(e)&&Array.isArray(i[e[0]])?n(i[e[0]][e[1]]):n(i[e]):i},l.extractOption=function(t,e,r,n){if(r in t)return t[r];var i=l.nestedProperty(e,n).get();return Array.isArray(i)?void 0:i},l.tagSelected=function(t,e,r){var n,a,o=e.selectedpoints,s=e._indexToPoints;if(s)for(var l in n={},s)for(var c=s[l],u=0;u<c.length;u++)n[c[u]]=l;function f(e){return void 0!==e&&e<t.length}for(var h=0;h<o.length;h++){var d=o[h];if(i(a=d)&&a>=0&&a%1==0){var p=n?n[d]:d,m=r?r[p]:p;f(m)&&(t[m].selected=1)}}},l.getTargetArray=function(t,e){var r=e.target;if("string"==typeof r&&r){var n=l.nestedProperty(t,r).get();return!!Array.isArray(n)&&n}return!!Array.isArray(r)&&r},l.minExtend=function(t,e){var r={};"object"!=typeof e&&(e={});var n,i,a,o=Object.keys(t);for(n=0;n<o.length;n++)a=t[i=o[n]],"_"!==i.charAt(0)&&"function"!=typeof a&&("module"===i?r[i]=a:Array.isArray(a)?r[i]=a.slice(0,3):r[i]=a&&"object"==typeof a?l.minExtend(t[i],e[i]):a);for(o=Object.keys(e),n=0;n<o.length;n++)"object"==typeof(a=e[i=o[n]])&&i in r&&"object"==typeof r[i]||(r[i]=a);return r},l.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)},l.containsAny=function(t,e){for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r]))return!0;return!1},l.isPlotDiv=function(t){var e=n.select(t);return e.node()instanceof HTMLElement&&e.size()&&e.classed("js-plotly-plot")},l.removeElement=function(t){var e=t&&t.parentNode;e&&e.removeChild(t)},l.addStyleRule=function(t,e){if(!l.styleSheet){var r=document.createElement("style");r.appendChild(document.createTextNode("")),document.head.appendChild(r),l.styleSheet=r.sheet}var n=l.styleSheet;n.insertRule?n.insertRule(t+"{"+e+"}",0):n.addRule?n.addRule(t,e,0):l.warn("addStyleRule failed")},l.isIE=function(){return void 0!==window.navigator.msSaveBlob},l.isD3Selection=function(t){return t&&"function"==typeof t.classed},l.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 x=/^([^\[\.]+)\.(.+)?/,_=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;l.expandObjectPaths=function(t){var e,r,n,i,a,o,s;if("object"==typeof t&&!Array.isArray(t))for(r in t)t.hasOwnProperty(r)&&((e=r.match(x))?(i=t[r],n=e[1],delete t[r],t[n]=l.extendDeepNoArrays(t[n]||{},l.objectFromPath(r,l.expandObjectPaths(i))[n])):(e=r.match(_))?(i=t[r],n=e[1],a=parseInt(e[2]),delete t[r],t[n]=t[n]||[],"."===e[3]?(s=e[4],o=t[n][a]=t[n][a]||{},l.extendDeepNoArrays(o,l.objectFromPath(s,l.expandObjectPaths(i)))):t[n][a]=l.expandObjectPaths(i)):t[r]=l.expandObjectPaths(t[r]));return t},l.numSeparate=function(t,e,r){if(r||(r=!1),"string"!=typeof e||0===e.length)throw new Error("Separator string required for formatting!");"number"==typeof t&&(t=String(t));var n=/(\d+)(\d{3})/,i=e.charAt(0),a=e.charAt(1),o=t.split("."),s=o[0],l=o.length>1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l};var w=/%{([^\s%{}]*)}/g,M=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(w,function(t,n){return M.test(n)?e[n]||"":(r[n]=r[n]||l.nestedProperty(e,n).get,r[n]()||"")})};l.subplotSort=function(t,e){for(var r=Math.min(t.length,e.length)+1,n=0,i=0,a=0;a<r;a++){var o=t.charCodeAt(a)||0,s=e.charCodeAt(a)||0,l=o>=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n}},{"../constants/numerical":702,"./angles":707,"./clean_number":708,"./coerce":709,"./dates":710,"./ensure_array":711,"./extend":713,"./filter_unique":714,"./filter_visible":715,"./geometry2d":718,"./get_graph_div":719,"./identity":723,"./is_array":725,"./is_plain_object":726,"./keyed_container":727,"./localize":728,"./loggers":729,"./matrix":730,"./mod":731,"./nested_property":732,"./noop":733,"./notifier":734,"./push_unique":737,"./regex":739,"./relative_attr":740,"./relink_private":741,"./search":742,"./stats":745,"./throttle":748,"./to_log_range":749,d3:128,"fast-isnumeric":140}],725:[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)}},{}],726:[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}},{}],727:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){var o,s;r=r||"name",a=a||"value";var l={};s=e&&e.length?n(t,e).get():t,e=e||"",s=s||[];var c={};for(o=0;o<s.length;o++)c[s[o][r]]=o;var u=i.test(a),f={set:function(t,e){var i=null===e?4:0,o=c[t];void 0===o?(i|=3,o=s.length,c[t]=o):e!==(u?s[o][a]:n(s[o],a).get())&&(i|=2);var h=s[o]=s[o]||{};return h[r]=t,u?h[a]=e:n(h,a).set(e),null!==e&&(i&=-5),l[o]=l[o]|i,f},get:function(t){var e=c[t];return void 0===e?void 0:u?s[e][a]:n(s[e],a).get()},rename:function(t,e){var n=c[t];return void 0===n?f:(l[n]=1|l[n],c[e]=n,delete c[t],s[n][r]=e,f)},remove:function(t){var e=c[t];if(void 0===e)return f;var i=s[e];if(Object.keys(i).length>2)return l[e]=2|l[e],f.set(t,null);if(u){for(o=e;o<s.length;o++)l[o]=3|l[o];for(o=e;o<s.length;o++)c[s[o][r]]--;s.splice(e,1),delete c[t]}else n(i,a).set(null),l[e]=6|l[e];return f},constructUpdate:function(){for(var t,i,o={},c=Object.keys(l),f=0;f<c.length;f++)i=c[f],t=e+"["+i+"]",s[i]?(1&l[i]&&(o[t+"."+r]=s[i][r]),2&l[i]&&(o[t+"."+a]=u?4&l[i]?null:s[i][a]:4&l[i]?null:n(s[i],a).get())):o[t]=null;return o}};return f}},{"./nested_property":732}],728:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t,e){for(var r=t._context.locale,i=0;i<2;i++){for(var a=t._context.locales,o=0;o<2;o++){var s=(a[r]||{}).dictionary;if(s){var l=s[e];if(l)return l}a=n.localeRegistry}var c=r.split("-")[0];if(c===r)break;r=c}return e}},{"../registry":854}],729:[function(t,e,r){"use strict";var n=t("../plot_api/plot_config"),i=e.exports={};function a(t,e){if(t.apply)t.apply(t,e);else for(var r=0;r<e.length;r++)t(e[r])}i.log=function(){if(n.logging>1){for(var t=["LOG:"],e=0;e<arguments.length;e++)t.push(arguments[e]);a(console.trace||console.log,t)}},i.warn=function(){if(n.logging>0){for(var t=["WARN:"],e=0;e<arguments.length;e++)t.push(arguments[e]);a(console.trace||console.log,t)}},i.error=function(){if(n.logging>0){for(var t=["ERROR:"],e=0;e<arguments.length;e++)t.push(arguments[e]);a(console.error,t)}}},{"../plot_api/plot_config":758}],730:[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)))}}},{}],731:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t%e;return r<0?r+e:r}},{}],732:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./is_array"),a=t("./is_plain_object"),o=t("../plot_api/container_array_match");e.exports=function(t,e){if(n(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,a,o,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(a=r[2].substr(1,r[2].length-2).split("]["),o=0;o<a.length;o++)s++,l.splice(s,0,Number(a[o]))}s++}return"object"!=typeof t?function(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}(t,e,l):{set:u(t,l,e),get:function t(e,r){return function(){var n,a,o,s,l,c=e;for(s=0;s<r.length-1;s++){if(-1===(n=r[s])){for(a=!0,o=[],l=0;l<c.length;l++)o[l]=t(c[l],r.slice(s+1))(),o[l]!==o[0]&&(a=!1);return a?o[0]:o}if("number"==typeof n&&!i(c))return;if("object"!=typeof(c=c[n])||null===c)return}if("object"==typeof c&&null!==c&&null!==(o=c[r[s]]))return o}}(t,l),astr:e,parts:l,obj:t}};var s=/(^|\.)((domain|range)(\.[xy])?|args|parallels)$/,l=/(^|\.)args\[/;function c(t,e){if(void 0!==(r=t)&&null!==r&&("object"!=typeof r||(i(r)?r.length:Object.keys(r).length))||a(t)&&"]"===e.charAt(e.length-1)||e.match(l)&&void 0!==t)return!1;var r;if(!i(t))return!0;if(e.match(s))return!0;var n=o(e);return n&&""===n.index}function u(t,e,r){return function(n){var a,o,s=t,l="",u=[[t,l]],p=c(n,r);for(o=0;o<e.length-1;o++){if("number"==typeof(a=e[o])&&!i(s))throw"array index but container is not an array";if(-1===a){if(p=!h(s,e.slice(o+1),n,r))break;return}if(!d(s,a,e[o+1],p))break;if("object"!=typeof(s=s[a])||null===s)throw"container is not an object";l=f(l,a),u.push([s,l])}p?(o===e.length-1&&delete s[e[o]],function(t){var e,r,n,a,o,s;for(e=t.length-1;e>=0;e--){if(n=t[e][0],a=t[e][1],s=!1,i(n))for(r=n.length-1;r>=0;r--)c(n[r],f(a,r))?s?n[r]=void 0:n.pop():s=!0;else if("object"==typeof n&&null!==n)for(o=Object.keys(n),s=!1,r=o.length-1;r>=0;r--)c(n[o[r]],f(a,o[r]))?delete n[o[r]]:s=!0;if(s)return}}(u)):s[e[o]]=n}}function f(t,e){var r=e;return n(e)?r="["+e+"]":t&&(r="."+e),t+r}function h(t,e,r,n){var a,o=i(r),s=!0,l=r,f=n.replace("-1",0),h=!o&&c(r,f),p=e[0];for(a=0;a<t.length;a++)f=n.replace("-1",a),o&&(h=c(l=r[a%r.length],f)),h&&(s=!1),d(t,a,p,h)&&u(t[a],e,n.replace("-1",a))(l);return s}function d(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]="number"==typeof r?[]:{}}return!0}},{"../plot_api/container_array_match":753,"./is_array":725,"./is_plain_object":726,"fast-isnumeric":140}],733:[function(t,e,r){"use strict";e.exports=function(){}},{}],734:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=[];e.exports=function(t,e){if(-1===a.indexOf(t)){a.push(t);var r=1e3;i(e)?r=e:"long"===e&&(r=3e3);var o=n.select("body").selectAll(".plotly-notifier").data([0]);o.enter().append("div").classed("plotly-notifier",!0),o.selectAll(".notifier-note").data(a).enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(t){var e=n.select(this);e.append("button").classed("notifier-close",!0).html("×").on("click",function(){e.transition().call(s)});for(var i=e.append("p"),a=t.split(/<br\s*\/?>/g),o=0;o<a.length;o++)o&&i.append("br"),i.append("span").text(a[o]);e.transition().duration(700).style("opacity",1).transition().delay(r).call(s)})}function s(t){t.duration(700).style("opacity",0).each("end",function(t){var e=a.indexOf(t);-1!==e&&a.splice(e,1),n.select(this).remove()})}}},{d3:128,"fast-isnumeric":140}],735:[function(t,e,r){"use strict";var n=t("./setcursor"),i="data-savedcursor";e.exports=function(t,e){var r=t.attr(i);if(e){if(!r){for(var a=(t.attr("class")||"").split(" "),o=0;o<a.length;o++){var s=a[o];0===s.indexOf("cursor-")&&t.attr(i,s.substr(7)).classed(s,!1)}t.attr(i)||t.attr(i,"!!")}n(t,e)}else r&&(t.attr(i,null),"!!"===r?n(t):n(t,r))}},{"./setcursor":743}],736:[function(t,e,r){"use strict";var n=t("./matrix").dot,i=t("../constants/numerical").BADNUM,a=e.exports={};a.tester=function(t){if(Array.isArray(t[0][0]))return a.multitester(t);var e,r=t.slice(),n=r[0][0],o=n,s=r[0][1],l=s;for(r.push(r[0]),e=1;e<r.length;e++)n=Math.min(n,r[e][0]),o=Math.max(o,r[e][0]),s=Math.min(s,r[e][1]),l=Math.max(l,r[e][1]);var c,u=!1;5===r.length&&(r[0][0]===r[1][0]?r[2][0]===r[3][0]&&r[0][1]===r[3][1]&&r[1][1]===r[2][1]&&(u=!0,c=function(t){return t[0]===r[0][0]}):r[0][1]===r[1][1]&&r[2][1]===r[3][1]&&r[0][0]===r[3][0]&&r[1][0]===r[2][0]&&(u=!0,c=function(t){return t[1]===r[0][1]}));var f=!0,h=r[0];for(e=1;e<r.length;e++)if(h[0]!==r[e][0]||h[1]!==r[e][1]){f=!1;break}return{xmin:n,xmax:o,ymin:s,ymax:l,pts:r,contains:u?function(t,e){var r=t[0],a=t[1];return!(r===i||r<n||r>o||a===i||a<s||a>l||e&&c(t))}:function(t,e){var a=t[0],c=t[1];if(a===i||a<n||a>o||c===i||c<s||c>l)return!1;var u,f,h,d,p,m=r.length,v=r[0][0],g=r[0][1],y=0;for(u=1;u<m;u++)if(f=v,h=g,v=r[u][0],g=r[u][1],!(a<(d=Math.min(f,v))||a>Math.max(f,v)||c>Math.max(h,g)))if(c<Math.min(h,g))a!==d&&y++;else{if(c===(p=v===f?c:h+(a-f)*(g-h)/(v-f)))return 1!==u||!e;c<=p&&a!==d&&y++}return y%2==1},isRect:u,degenerate:f}},a.multitester=function(t){for(var e=[],r=t[0][0][0],n=r,i=t[0][0][1],o=i,s=0;s<t.length;s++){var l=a.tester(t[s]);l.subtract=t[s].subtract,e.push(l),r=Math.min(r,l.xmin),n=Math.max(n,l.xmax),i=Math.min(i,l.ymin),o=Math.max(o,l.ymax)}return{xmin:r,xmax:n,ymin:i,ymax:o,pts:[],contains:function(t,r){for(var n=!1,i=0;i<e.length;i++)e[i].contains(t,r)&&(n=!1===e[i].subtract);return n},isRect:!1,degenerate:!1}};var o=a.isSegmentBent=function(t,e,r,i){var a,o,s,l=t[e],c=[t[r][0]-l[0],t[r][1]-l[1]],u=n(c,c),f=Math.sqrt(u),h=[-c[1]/f,c[0]/f];for(a=e+1;a<r;a++)if(o=[t[a][0]-l[0],t[a][1]-l[1]],(s=n(o,c))<0||s>u||Math.abs(n(o,h))>i)return!0;return!1};a.filter=function(t,e){var r=[t[0]],n=0,i=0;function a(a){t.push(a);var s=r.length,l=n;r.splice(i+1);for(var c=l+1;c<t.length;c++)(c===t.length-1||o(t,l,c+1,e))&&(r.push(t[c]),r.length<s-2&&(n=c,i=r.length-1),l=c)}t.length>1&&a(t.pop());return{addPt:a,raw:t,filtered:r}}},{"../constants/numerical":702,"./matrix":730}],737:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var r,n=e.toString();for(r=0;r<t.length;r++)if(t[r]instanceof RegExp&&t[r].toString()===n)return t;t.push(e)}else!e&&0!==e||-1!==t.indexOf(e)||t.push(e);return t}},{}],738:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plot_api/plot_config");var a={add:function(t,e,r,n,a){var o,s;t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},s=t.undoQueue.index,t.autoplay?t.undoQueue.inSequence||(t.autoplay=!1):(!t.undoQueue.sequence||t.undoQueue.beginSequence?(o={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},t.undoQueue.queue.splice(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(a)),t.undoQueue.queue.length>i.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.undo.calls.length;r++)a.plotDo(t,e.undo.calls[r],e.undo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1}},redo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.redo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index>=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.redo.calls.length;r++)a.plotDo(t,e.redo.calls[r],e.redo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1,t.undoQueue.index++}}};a.plotDo=function(t,e,r){t.autoplay=!0,r=function(t,e){for(var r,i=[],a=0;a<e.length;a++)r=e[a],i[a]=r===t?r:"object"==typeof r?Array.isArray(r)?n.extendDeep([],r):n.extendDeepAll({},r):r;return i}(t,r),e.apply(null,r)},e.exports=a},{"../lib":724,"../plot_api/plot_config":758}],739:[function(t,e,r){"use strict";r.counter=function(t,e,r){return new RegExp("^"+t+"([2-9]|[1-9][0-9]+)?"+(e||"")+(r?"":"$"))}},{}],740:[function(t,e,r){"use strict";var n=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,i=/^[^\.\[\]]+$/;e.exports=function(t,e){for(;e;){var r=t.match(n);if(r)t=r[1];else{if(!t.match(i))throw new Error("bad relativeAttr call:"+[t,e]);t=""}if("^"!==e.charAt(0))break;e=e.slice(1)}return t&&"["!==e.charAt(0)?t+"."+e:t+e}},{}],741:[function(t,e,r){"use strict";var n=t("./is_array"),i=t("./is_plain_object");e.exports=function t(e,r){for(var a=Object.keys(r||{}),o=0;o<a.length;o++){var s=a[o],l=r[s],c=e[s];if("_"===s.charAt(0)||"function"==typeof l){if(s in e)continue;e[s]=l}else if(n(l)&&n(c)&&i(l[0]))for(var u=0;u<l.length;u++)i(l[u])&&i(c[u])&&t(c[u],l[u]);else i(l)&&i(c)&&(t(c,l),Object.keys(c).length||delete e[s])}}},{"./is_array":725,"./is_plain_object":726}],742:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./loggers");function a(t,e){return t<e}function o(t,e){return t<=e}function s(t,e){return t>e}function l(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var c,u,f=0,h=e.length,d=0,p=h>1?(e[h-1]-e[0])/(h-1):1;for(u=p>=0?r?a:o:r?l:s,t+=1e-9*p*(r?-1:1)*(p>=0?1:-1);f<h&&d++<100;)u(e[c=Math.floor((f+h)/2)],t)?f=c+1:h=c;return d>90&&i.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,i=e[n]-e[0]||1,a=i/(n||1)/1e4,o=[e[0]],s=0;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,c=r?Math.ceil:Math.floor;i<a&&o++<100;)e[n=c((i+a)/2)]<=t?i=n+s:a=n-l;return e[i]}},{"./loggers":729,"fast-isnumeric":140}],743:[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)}},{}],744:[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":598}],745:[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)<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":140}],746:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":99}],747:[function(t,e,r){"use strict";var n=t("d3"),i=t("../lib"),a=t("../constants/xmlns_namespaces"),o=t("../constants/string_mappings"),s=t("../constants/alignment").LINE_SPACING;function l(t,e){return t.node().getBoundingClientRect()[e]}var c=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,o){var g=t.text(),L=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&g.match(c),C=n.select(t.node().parentNode);if(!C.empty()){var P=t.attr("class")?t.attr("class").split(" ")[0]:"text";return P+="-math",C.selectAll("svg."+P).remove(),C.selectAll("g."+P+"-group").remove(),t.style("display",null).attr({"data-unformatted":g,"data-math":"N"}),L?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),a={fontSize:r};!function(t,e,r){var a="math-output-"+i.randstr([],64),o=n.select("body").append("div").attr({id:a}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text((s=t,s.replace(u,"\\lt ").replace(f,"\\gt ")));var s;MathJax.Hub.Queue(["Typeset",MathJax.Hub,o.node()],function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(o.select(".MathJax_SVG").empty()||!o.select("svg").node())i.log("There was an error in the tex syntax.",t),r();else{var a=o.select("svg").node().getBoundingClientRect();r(o.select(".MathJax_SVG"),e,a)}o.remove()})}(L[2],a,function(n,i,a){C.selectAll("svg."+P).remove(),C.selectAll("g."+P+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return z(),void e();var c=C.append("g").classed(P+"-group",!0).attr({"pointer-events":"none","data-unformatted":g,"data-math":"Y"});c.node().appendChild(s.node()),i&&i.node()&&s.node().insertBefore(i.node().cloneNode(!0),s.node().firstChild),s.attr({class:P,height:a.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=t.node().style.fill||"black";s.select("g").attr({fill:u,stroke:u});var f=l(s,"width"),h=l(s,"height"),d=+t.attr("x")-f*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],p=-(r||l(t,"height"))/4;"y"===P[0]?(c.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-f/2,p-h/2]+")"}),s.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===P[0]?s.attr({x:t.attr("x"),y:p-h/2}):"a"===P[0]?s.attr({x:0,y:p}):s.attr({x:d,y:+t.attr("y")+p-h/2}),o&&o.call(t,c),e(c)})})):z(),t}function z(){C.empty()||(P=t.attr("class")+"-math",C.select("svg."+P).remove()),t.text("").style("white-space","pre"),function(t,e){e=(r=e,function(t,e){if(!t)return"";for(var r=0;r<e.length;r++){var n=e[r];t=t.replace(n.regExp,n.sub)}return t}(r,y)).replace(b," ");var r;var o,l=!1,c=[],u=-1;function f(){u++;var e=document.createElementNS(a.svg,"tspan");n.select(e).attr({class:"line",dy:u*s+"em"}),t.appendChild(e),o=e;var r=c;if(c=[{node:e}],r.length>1)for(var i=1;i<r.length;i++)g(r[i])}function g(t){var e,r=t.type,i={};if("a"===r){e="a";var s=t.target,l=t.href,u=t.popup;l&&(i={"xlink:xlink:show":"_blank"===s||"_"!==s.charAt(0)?"new":"replace",target:s,"xlink:xlink:href":l},u&&(i.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+u+'");return false;'))}else e="tspan";t.style&&(i.style=t.style);var f=document.createElementNS(a.svg,e);if("sup"===r||"sub"===r){L(o,m),o.appendChild(f);var h=document.createElementNS(a.svg,"tspan");L(h,m),n.select(h).attr("dy",p[r]),i.dy=d[r],o.appendChild(f),o.appendChild(h)}else o.appendChild(f);n.select(f).attr(i),o=t.node=f,c.push(t)}function L(t,e){t.appendChild(document.createTextNode(e))}function C(t){if(1!==c.length){var r=c.pop();t!==r.type&&i.log("Start tag <"+r.type+"> doesnt match end tag <"+t+">. Pretending it did match.",e),o=c[c.length-1].node}else i.log("Ignoring unexpected end tag </"+t+">.",e)}w.test(e)?f():(o=t,c=[{node:t}]);for(var P=e.split(x),z=0;z<P.length;z++){var O=P[z],D=O.match(_),I=D&&D[2].toLowerCase(),R=h[I];if("br"===I)f();else if(void 0===R)L(o,O);else if(D[1])C(I);else{var N=D[4],F={type:I},j=E(N,M);if(j?(j=j.replace(S,"$1 fill:"),R&&(j+=";"+R)):R&&(j=R),j&&(F.style=j),"a"===I){l=!0;var B=E(N,k);if(B){var U=document.createElement("a");U.href=B,-1!==v.indexOf(U.protocol)&&(F.href=encodeURI(B),F.target=E(N,A)||"_blank",F.popup=E(N,T))}}g(F)}}return l}(t.node(),g)&&t.style("pointer-events","all"),r.positionText(t),o&&o.call(t)}};var u=/(<|<|<)/g,f=/(>|>|>)/g;var h={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},d={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},m="\u200b",v=["http:","https:","mailto:","",void 0,":"],g=new RegExp("</?("+Object.keys(h).join("|")+")( [^>]*)?/?>","g"),y=Object.keys(o.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:o.entityToUnicode[t]}}),b=/(\r\n?|\n)/g,x=/(<[^<>]*>)/,_=/<(\/?)([^ >]*)(\s+(.*))?>/i,w=/<br(\s+.*)?>/i,M=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,k=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,A=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function E(t,e){if(!t)return null;var r=t.match(e);return r&&(r[3]||r[4])}var S=/(^|;)\s*color:/;function L(t,e,r){var n,i,a,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),c=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()-c.top+"px",left:a()-c.left+"px","z-index":1e3}),this}}r.plainText=function(t){return(t||"").replace(g," ")},r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){var t=n.select(this);function i(e,r){return void 0===r?null===(r=t.attr(e))&&(t.attr(e,0),r=0):t.attr(e,r),r}var a=i("x",e),o=i("y",r);"text"===this.nodeName&&t.selectAll("tspan.line").attr({x:a,y:o})})},r.makeEditable=function(t,e){var r=e.gd,i=e.delegate,a=n.dispatch("edit","input","cancel"),o=i||t;if(t.style({"pointer-events":i?"none":"all"}),1!==t.size())throw new Error("boo");function s(){var i,s,c,u;i=n.select(r).select(".svg-container"),s=i.append("div"),c=t.node().style,u=parseFloat(c.fontSize||12),s.classed("plugin-editable editable",!0).style({position:"absolute","font-family":c.fontFamily||"Arial","font-size":u,color:e.fill||c.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-u/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(e.text||t.attr("data-unformatted")).call(L(t,i,e)).on("blur",function(){r._editing=!1,t.text(this.textContent).style({opacity:1});var e,i=n.select(this).attr("class");(e=i?"."+i.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(e).style({opacity:0});var o=this.textContent;n.select(this).transition().duration(0).remove(),n.select(document).on("mouseup",null),a.edit.call(t,o)}).on("focus",function(){var t=this;r._editing=!0,n.select(document).on("mouseup",function(){if(n.event.target===t)return!1;document.activeElement===s.node()&&s.node().blur()})}).on("keyup",function(){27===n.event.which?(r._editing=!1,t.style({opacity:1}),n.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),a.cancel.call(t,this.textContent)):(a.input.call(t,this.textContent),n.select(this).call(L(t,i,e)))}).on("keydown",function(){13===n.event.which&&this.blur()}).call(l),t.style({opacity:0});var f,h=o.attr("class");(f=h?"."+h.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(f).style({opacity:0})}function l(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}return e.immediate?s():o.on("click",s),n.rebind(t,a,"on")}},{"../constants/alignment":696,"../constants/string_mappings":703,"../constants/xmlns_namespaces":704,"../lib":724,d3:128}],748:[function(t,e,r){"use strict";var n={};function i(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}r.throttle=function(t,e,r){var a=n[t],o=Date.now();if(!a){for(var s in n)n[s].ts<o-6e4&&delete n[s];a=n[t]={ts:0,timer:null}}function l(){r(),a.ts=Date.now(),a.onDone&&(a.onDone(),a.onDone=null)}i(a),o>a.ts+e?l():a.timer=setTimeout(function(){l(),a.timer=null},e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise(function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}}):Promise.resolve()},r.clear=function(t){if(t)i(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],749:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":140}],750:[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":799,"topojson-client":529}],751:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],752:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],753:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s<a.length;s++)if((r=t.match(a[s]))&&0===r.index){e=r[0];break}if(e||(e=i[i.indexOf(o)]),!e)return!1;var l=t.substr(e.length);return l?!!(r=l.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/))&&{array:e,index:Number(r[1]),property:r[3]||""}:{array:e,index:"",property:""}}},{"../registry":854}],754:[function(t,e,r){"use strict";var n=t("../lib"),i=n.extendFlat,a=n.isPlainObject,o={valType:"flaglist",extras:["none"],flags:["calc","calcIfAutorange","clearAxisTypes","plot","style","colorbars"]},s={valType:"flaglist",extras:["none"],flags:["calc","calcIfAutorange","plot","legend","ticks","layoutstyle","modebar","camera","arraydraw"]},l=o.flags.slice().concat(["clearCalc","fullReplot"]),c=s.flags.slice().concat("layoutReplot");function u(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=!1;return e}function f(t,e,r){var n=i({},t);for(var o in n){var s=n[o];a(s)&&(n[o]=h(s,e,r,o))}return"from-root"===r&&(n.editType=e),n}function h(t,e,r,n){if(t.valType){var a=i({},t);if(a.editType=e,Array.isArray(t.items)){a.items=new Array(t.items.length);for(var o=0;o<t.items.length;o++)a.items[o]=h(t.items[o],e,"from-root")}return a}return f(t,e,"_"===n.charAt(0)?"nested":"from-root")}e.exports={traces:o,layout:s,traceFlags:function(){return u(l)},layoutFlags:function(){return u(c)},update:function(t,e){var r=e.editType;if(r&&"none"!==r)for(var n=r.split("+"),i=0;i<n.length;i++)t[n[i]]=!0},overrideAll:f}},{"../lib":724}],755:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("gl-mat4/fromQuat"),a=t("../registry"),o=t("../lib"),s=t("../plots/plots"),l=t("../plots/cartesian/axis_ids"),c=l.cleanId,u=l.getFromTrace,f=t("../components/color");function h(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=c(r,n))}function d(t){var e="middle",r="center";return-1!==t.indexOf("top")?e="top":-1!==t.indexOf("bottom")&&(e="bottom"),-1!==t.indexOf("left")?r="left":-1!==t.indexOf("right")&&(r="right"),e+" "+r}function p(t,e){return e in t&&"object"==typeof t[e]&&0===Object.keys(t[e]).length}r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,r;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var n=(s.subplotsRegistry.cartesian||{}).attrRegex,a=(s.subplotsRegistry.gl3d||{}).attrRegex,l=Object.keys(t);for(e=0;e<l.length;e++){var u=l[e];if(n&&n.test(u)){var d=t[u];d.anchor&&"free"!==d.anchor&&(d.anchor=c(d.anchor)),d.overlaying&&(d.overlaying=c(d.overlaying)),d.type||(d.isdate?d.type="date":d.islog?d.type="log":!1===d.isdate&&!1===d.islog&&(d.type="linear")),"withzero"!==d.autorange&&"tozero"!==d.autorange||(d.autorange=!0,d.rangemode="tozero"),delete d.islog,delete d.isdate,delete d.categories,p(d,"domain")&&delete d.domain,void 0!==d.autotick&&(void 0===d.tickmode&&(d.tickmode=d.autotick?"auto":"linear"),delete d.autotick)}else if(a&&a.test(u)){var m=t[u],v=m.cameraposition;if(Array.isArray(v)&&4===v[0].length){var g=v[0],y=v[1],b=v[2],x=i([],g),_=[];for(r=0;r<3;++r)_[r]=y[r]+b*x[2+4*r];m.camera={eye:{x:_[0],y:_[1],z:_[2]},center:{x:y[0],y:y[1],z:y[2]},up:{x:x[1],y:x[5],z:x[9]}},delete m.cameraposition}}}var w=Array.isArray(t.annotations)?t.annotations.length:0;for(e=0;e<w;e++){var M=t.annotations[e];o.isPlainObject(M)&&(M.ref&&("paper"===M.ref?(M.xref="paper",M.yref="paper"):"data"===M.ref&&(M.xref="x",M.yref="y"),delete M.ref),h(M,"xref"),h(M,"yref"))}var k=Array.isArray(t.shapes)?t.shapes.length:0;for(e=0;e<k;e++){var A=t.shapes[e];o.isPlainObject(A)&&(h(A,"xref"),h(A,"yref"))}var T=t.legend;return T&&(T.x>3?(T.x=1.02,T.xanchor="left"):T.x<-2&&(T.x=-.02,T.xanchor="right"),T.y>3?(T.y=1.02,T.yanchor="bottom"):T.y<-2&&(T.y=-.02,T.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),f.clean(t),t},r.cleanData=function(t,e){for(var n=[],i=t.concat(Array.isArray(e)?e:[]).filter(function(t){return"uid"in t}).map(function(t){return t.uid}),l=0;l<t.length;l++){var u,h=t[l];if(!("uid"in h)||-1!==n.indexOf(h.uid)){var m;for(u=0;u<100&&(m=o.randstr(i),-1!==n.indexOf(m));u++);h.uid=o.randstr(i),i.push(h.uid)}if(n.push(h.uid),"histogramy"===h.type&&"xbins"in h&&!("ybins"in h)&&(h.ybins=h.xbins,delete h.xbins),h.error_y&&"opacity"in h.error_y){var v=f.defaults,g=h.error_y.color||(a.traceIs(h,"bar")?f.defaultLine:v[l%v.length]);h.error_y.color=f.addOpacity(f.rgb(g),f.opacity(g)*h.error_y.opacity),delete h.error_y.opacity}if("bardir"in h&&("h"!==h.bardir||!a.traceIs(h,"bar")&&"histogram"!==h.type.substr(0,9)||(h.orientation="h",r.swapXYData(h)),delete h.bardir),"histogramy"===h.type&&r.swapXYData(h),"histogramx"!==h.type&&"histogramy"!==h.type||(h.type="histogram"),"scl"in h&&(h.colorscale=h.scl,delete h.scl),"reversescl"in h&&(h.reversescale=h.reversescl,delete h.reversescl),h.xaxis&&(h.xaxis=c(h.xaxis,"x")),h.yaxis&&(h.yaxis=c(h.yaxis,"y")),a.traceIs(h,"gl3d")&&h.scene&&(h.scene=s.subplotsRegistry.gl3d.cleanId(h.scene)),!a.traceIs(h,"pie")&&!a.traceIs(h,"bar"))if(Array.isArray(h.textposition))for(u=0;u<h.textposition.length;u++)h.textposition[u]=d(h.textposition[u]);else h.textposition&&(h.textposition=d(h.textposition));if(a.traceIs(h,"2dMap")&&("YIGnBu"===h.colorscale&&(h.colorscale="YlGnBu"),"YIOrRd"===h.colorscale&&(h.colorscale="YlOrRd")),a.traceIs(h,"markerColorscale")&&h.marker){var y=h.marker;"YIGnBu"===y.colorscale&&(y.colorscale="YlGnBu"),"YIOrRd"===y.colorscale&&(y.colorscale="YlOrRd")}if("surface"===h.type&&o.isPlainObject(h.contours)){var b=["x","y","z"];for(u=0;u<b.length;u++){var x=h.contours[b[u]];o.isPlainObject(x)&&(x.highlightColor&&(x.highlightcolor=x.highlightColor,delete x.highlightColor),x.highlightWidth&&(x.highlightwidth=x.highlightWidth,delete x.highlightWidth))}}if(Array.isArray(h.transforms)){var _=h.transforms;for(u=0;u<_.length;u++){var w=_[u];if(o.isPlainObject(w))switch(w.type){case"filter":w.filtersrc&&(w.target=w.filtersrc,delete w.filtersrc),w.calendar&&(w.valuecalendar||(w.valuecalendar=w.calendar),delete w.calendar);break;case"groupby":if(w.styles=w.styles||w.style,w.styles&&!Array.isArray(w.styles)){var M=w.styles,k=Object.keys(M);w.styles=[];for(var A=0;A<k.length;A++)w.styles.push({target:k[A],value:M[k[A]]})}}}}p(h,"line")&&delete h.line,"marker"in h&&(p(h.marker,"line")&&delete h.marker.line,p(h,"marker")&&delete h.marker),f.clean(h)}},r.swapXYData=function(t){var e;if(o.swapAttrs(t,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(t.z)&&Array.isArray(t.z[0])&&(t.transpose?delete t.transpose:t.transpose=!0),t.error_x&&t.error_y){var r=t.error_y,n="copy_ystyle"in r?r.copy_ystyle:!(r.color||r.thickness||r.width);o.swapAttrs(t,["error_?.copy_ystyle"]),n&&o.swapAttrs(t,["error_?.color","error_?.thickness","error_?.width"])}if("string"==typeof t.hoverinfo){var 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 n(e)?[e]:Array.isArray(e)&&e.length?e:t.data.map(function(t,e){return e})},r.manageArrayContainers=function(t,e,r){var i=t.obj,a=t.parts,s=a.length,l=a[s-1],c=n(l);if(c&&null===e){var u=a.slice(0,s-1).join(".");o.nestedProperty(i,u).get().splice(l,1)}else c&&void 0===t.get()?(void 0===t.get()&&(r[t.astr]=null),t.set(e)):t.set(e)};var m=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;function v(t){var e=t.search(m);if(e>0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=v(e);r;){if(r in t)return!0;r=v(r)}return!1};var g=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n<e.length;n++)for(var i=t._fullData[n],a=0;a<3;a++){var s=u(t,i,g[a]);if(s&&"log"!==s.type){var l=s._name,c=s._id.substr(1);if("scene"===c.substr(0,5)){if(void 0!==r[c])continue;l=c+"."+l}var f=l+".type";void 0===r[l]&&void 0===r[f]&&o.nestedProperty(t.layout,f).set(null)}}}},{"../components/color":598,"../lib":724,"../plots/cartesian/axis_ids":773,"../plots/plots":833,"../registry":854,"fast-isnumeric":140,"gl-mat4/fromQuat":183}],756:[function(t,e,r){"use strict";var n=t("../lib/nested_property"),i=t("../lib/is_plain_object"),a=t("../lib/noop"),o=t("../lib/loggers"),s=t("../lib/search").sorterAsc,l=t("../registry");r.containerArrayMatch=t("./container_array_match");var c=r.isAddVal=function(t){return"add"===t||i(t)},u=r.isRemoveVal=function(t){return null===t||"remove"===t};r.applyContainerArrayChanges=function(t,e,r,i){var f=e.astr,h=l.getComponentMethod(f,"supplyLayoutDefaults"),d=l.getComponentMethod(f,"draw"),p=l.getComponentMethod(f,"drawOne"),m=i.replot||i.recalc||h===a||d===a,v=t.layout,g=t._fullLayout;if(r[""]){Object.keys(r).length>1&&o.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(u(y))e.set(null);else{if(!Array.isArray(y))return o.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!m&&(h(v,g),d(t),!0)}var b,x,_,w,M,k,A,T=Object.keys(r).map(Number).sort(s),E=e.get(),S=E||[],L=n(g,f).get(),C=[],P=-1,z=S.length;for(b=0;b<T.length;b++)if(w=r[_=T[b]],M=Object.keys(w),k=w[""],A=c(k),_<0||_>S.length-(A?0:1))o.warn("index out of range",f,_);else if(void 0!==k)M.length>1&&o.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(k)?C.push(_):A?("add"===k&&(k={}),S.splice(_,0,k),L&&L.splice(_,0,{})):o.warn("Unrecognized full object edit value",f,_,k),-1===P&&(P=_);else for(x=0;x<M.length;x++)n(S[_],M[x]).set(w[M[x]]);for(b=C.length-1;b>=0;b--)S.splice(C[b],1),L&&L.splice(C[b],1);if(S.length?E||e.set(S):e.set(null),m)return!1;if(h(v,g),p!==a){var O;if(-1===P)O=T;else{for(z=Math.max(S.length,z),O=[],b=0;b<T.length&&!((_=T[b])>=P);b++)O.push(_);for(b=P;b<z;b++)O.push(b)}for(b=0;b<O.length;b++)p(t,O[b])}else d(t);return!0}},{"../lib/is_plain_object":726,"../lib/loggers":729,"../lib/nested_property":732,"../lib/noop":733,"../lib/search":742,"../registry":854,"./container_array_match":753}],757:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("has-hover"),o=t("../plotly"),s=t("../lib"),l=t("../lib/events"),c=t("../lib/queue"),u=t("../registry"),f=t("./plot_schema"),h=t("../plots/plots"),d=t("../plots/polar/legacy"),p=t("../plots/cartesian/graph_interact"),m=t("../components/drawing"),v=t("../components/color"),g=t("../components/errorbars"),y=t("../constants/xmlns_namespaces"),b=t("../lib/svg_text_utils"),x=t("./manage_arrays"),_=t("./helpers"),w=t("./subroutines"),M=t("./edit_types"),k=t("../plots/cartesian/constants"),A=t("../plots/cartesian/constraints"),T=A.enforce,E=A.clean,S=t("../plots/cartesian/axis_ids"),L=0;function C(t,e){try{t._fullLayout._paper.style("background",e)}catch(t){s.error(t)}}function P(t,e){C(t,v.combine(e,"white"))}function z(t,e){t._context||(t._context=s.extendDeep({},o.defaultConfig));var r,n,i,l=t._context;if(e){for(n=Object.keys(e),r=0;r<n.length;r++)"editable"!==(i=n[r])&&"edits"!==i&&i in l&&("setBackground"===i&&"opaque"===e[i]?l[i]=P:l[i]=e[i]);e.plot3dPixelRatio&&!l.plotGlPixelRatio&&(l.plotGlPixelRatio=l.plot3dPixelRatio);var c=e.editable;if(void 0!==c)for(l.editable=c,n=Object.keys(l.edits),r=0;r<n.length;r++)l.edits[n[r]]=c;if(e.edits)for(n=Object.keys(e.edits),r=0;r<n.length;r++)(i=n[r])in l.edits&&(l.edits[i]=e.edits[i])}l.staticPlot&&(l.editable=!1,l.edits={},l.autosizable=!1,l.scrollZoom=!1,l.doubleClick=!1,l.showTips=!1,l.showLink=!1,l.displayModeBar=!1),"hover"!==l.displayModeBar||a||(l.displayModeBar=!0),"transparent"!==l.setBackground&&"function"==typeof l.setBackground||(l.setBackground=C)}function O(t,e){var r,n,i=e+1,a=[];for(r=0;r<t.length;r++)(n=t[r])<0?a.push(i+n):a.push(n);return a}function D(t,e,r){var n,i;for(n=0;n<e.length;n++){if((i=e[n])!==parseInt(i,10))throw new Error("all values in "+r+" must be integers");if(i>=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function I(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),D(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&D(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function R(t,e,r,n,a,o){!function(t,e,r,n){var i=s.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!s.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var a in D(t,r,"indices"),e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l,c,u,f=function(t,e,r,n){var a,o,l,c,u,f=s.isPlainObject(n),h=[];for(var d in Array.isArray(r)||(r=[r]),r=O(r,t.data.length-1),e)for(var p=0;p<r.length;p++){if(a=t.data[r[p]],o=(l=s.nestedProperty(a,d)).get(),c=e[d][p],!Array.isArray(c))throw new Error("attribute: "+d+" index: "+p+" must be an array");if(!Array.isArray(o))throw new Error("cannot extend missing or non-array attribute: "+d);u=f?n[d][p]:n,i(u)||(u=-1),h.push({prop:l,target:o,insert:c,maxp:Math.floor(u)})}return h}(t,e,r,n),h=[],d={},p={},m=0;m<f.length;m++)c=f[m].prop,u=f[m].maxp,l=a(f[m].target,f[m].insert),u>=0&&u<l.length&&(h=o(l,u)),u=f[m].target.length,c.set(l),Array.isArray(d[c.astr])||(d[c.astr]=[]),Array.isArray(p[c.astr])||(p[c.astr]=[]),d[c.astr].push(h),p[c.astr].push(u);return{update:d,maxPoints:p}}function N(t){return void 0===t?null:t}function F(t,e,r){var n,i,a=t._fullLayout,l=t._fullData,c=t.data,d=M.traceFlags(),p={},m={};function v(){return r.map(function(){})}function g(t){var e=o.Axes.id2name(t);-1===i.indexOf(e)&&i.push(e)}function y(t){return"LAYOUT"+t+".autorange"}function b(t){return"LAYOUT"+t+".range"}function x(n,i,a){var o;Array.isArray(n)?n.forEach(function(t){x(t,i,a)}):n in e||_.hasParent(e,n)||(o="LAYOUT"===n.substr(0,6)?s.nestedProperty(t.layout,n.replace("LAYOUT","")):s.nestedProperty(c[r[a]],n),n in m||(m[n]=v()),void 0===m[n][a]&&(m[n][a]=N(o.get())),void 0!==i&&o.set(i))}for(var w in e){if(_.hasParent(e,w))throw new Error("cannot set "+w+"and a parent attribute simultaneously");var k,A,T,E,S,L,C=e[w];if(p[w]=C,"LAYOUT"!==w.substr(0,6)){for(m[w]=v(),n=0;n<r.length;n++)if(k=c[r[n]],A=l[r[n]],E=(T=s.nestedProperty(k,w)).get(),void 0!==(S=Array.isArray(C)?C[n%C.length]:C)){if((L=f.getTraceValObject(A,T.parts))&&L.impliedEdits&&null!==S)for(var P in L.impliedEdits)x(s.relativeAttr(w,P),L.impliedEdits[P],n);else if("colorbar.thicknessmode"===w&&T.get()!==S&&-1!==["fraction","pixels"].indexOf(S)&&A.colorbar){var z=-1!==["top","bottom"].indexOf(A.colorbar.orient)?a.height-a.margin.t-a.margin.b:a.width-a.margin.l-a.margin.r;x("colorbar.thickness",A.colorbar.thickness*("fraction"===S?1/z:z),n)}else if("colorbar.lenmode"===w&&T.get()!==S&&-1!==["fraction","pixels"].indexOf(S)&&A.colorbar){var O=-1!==["top","bottom"].indexOf(A.colorbar.orient)?a.width-a.margin.l-a.margin.r:a.height-a.margin.t-a.margin.b;x("colorbar.len",A.colorbar.len*("fraction"===S?1/O:O),n)}else"colorbar.tick0"!==w&&"colorbar.dtick"!==w||x("colorbar.tickmode","linear",n);if("type"===w&&"pie"===S!=("pie"===E)){var D="x",I="y";"bar"!==S&&"bar"!==E||"h"!==k.orientation||(D="y",I="x"),s.swapAttrs(k,["?","?src"],"labels",D),s.swapAttrs(k,["d?","?0"],"label",D),s.swapAttrs(k,["?","?src"],"values",I),"pie"===E?(s.nestedProperty(k,"marker.color").set(s.nestedProperty(k,"marker.colors").get()),a._pielayer.selectAll("g.trace").remove()):u.traceIs(k,"cartesian")&&s.nestedProperty(k,"marker.colors").set(s.nestedProperty(k,"marker.color").get())}m[w][n]=N(E);if(-1!==["swapxy","swapxyaxes","orientation","orientationaxes"].indexOf(w)){if("orientation"===w){T.set(S);var R=k.x&&!k.y?"h":"v";if((T.get()||R)===A.orientation)continue}else"orientationaxes"===w&&(k.orientation={v:"h",h:"v"}[A.orientation]);_.swapXYData(k),d.calc=d.clearAxisTypes=!0}else-1!==h.dataArrayContainers.indexOf(T.parts[0])?(_.manageArrayContainers(T,S,m),d.calc=!0):(L?L.arrayOk&&(Array.isArray(S)||Array.isArray(E))?d.calc=!0:M.update(d,L):d.calc=!0,T.set(S))}if(-1!==["swapxyaxes","orientationaxes"].indexOf(w)&&o.Axes.swap(t,r),"orientationaxes"===w){var F=s.nestedProperty(t.layout,"hovermode");"x"===F.get()?F.set("y"):"y"===F.get()&&F.set("x")}if(-1!==["orientation","type"].indexOf(w)){for(i=[],n=0;n<r.length;n++){var j=c[r[n]];u.traceIs(j,"cartesian")&&(g(j.xaxis||"x"),g(j.yaxis||"y"),"type"===w&&x(["autobinx","autobiny"],!0,n))}x(i.map(y),!0,0),x(i.map(b),[0,1],0)}}else T=s.nestedProperty(t.layout,w.replace("LAYOUT","")),m[w]=[N(T.get())],T.set(Array.isArray(C)?C[0]:C),d.calc=!0}var B=!1,U=o.Axes.list(t);for(n=0;n<U.length;n++)if(U[n].autorange){B=!0;break}return(d.calc||d.calcIfAutorange&&B)&&(d.clearCalc=!0),(d.calc||d.plot||d.calcIfAutorange)&&(d.fullReplot=!0),{flags:d,undoit:m,redoit:p,traces:r,eventData:s.extendDeepNoArrays([],[p,r])}}function j(t,e){var r,n,i,a=t.layout,l=t._fullLayout,c=Object.keys(e),d=o.Axes.list(t),p={};for(n=0;n<c.length;n++)if(0===c[n].indexOf("allaxes")){for(i=0;i<d.length;i++){var m=d[i]._id.substr(1),v=-1!==m.indexOf("scene")?m+".":"",g=c[n].replace("allaxes",v+d[i]._name);e[g]||(e[g]=e[c[n]])}delete e[c[n]]}var y=M.layoutFlags(),b={},w={};function A(t,r){if(Array.isArray(t))t.forEach(function(t){A(t,r)});else if(!(t in e||_.hasParent(e,t))){var n=s.nestedProperty(a,t);t in w||(w[t]=N(n.get())),void 0!==r&&n.set(r)}}var T,E={};function L(t){var e=S.name2id(t.split(".")[0]);return E[e]=1,e}for(var C in e){if(_.hasParent(e,C))throw new Error("cannot set "+C+"and a parent attribute simultaneously");var P=s.nestedProperty(a,C),z=e[C],O=P.parts.length,D="string"==typeof P.parts[O-1]?O-1:O-2,I=P.parts[D],R=P.parts[D-1]+"."+I,F=P.parts.slice(0,D).join("."),j=s.nestedProperty(t.layout,F).get(),U=s.nestedProperty(l,F).get(),V=P.get();if(void 0!==z){b[C]=z,w[C]="reverse"===I?z:N(V);var q=f.getLayoutValObject(l,P.parts);if(q&&q.impliedEdits&&null!==z)for(var H in q.impliedEdits)A(s.relativeAttr(C,H),q.impliedEdits[H]);if(-1!==["width","height"].indexOf(C)&&null===z)l[C]=t._initialAutoSize[C];else if(R.match(/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/))L(R),s.nestedProperty(l,F+"._inputRange").set(null);else if(R.match(/^[xyz]axis[0-9]*\.autorange$/)){L(R),s.nestedProperty(l,F+"._inputRange").set(null);var G=s.nestedProperty(l,F).get();G._inputDomain&&(G._input.domain=G._inputDomain.slice())}else R.match(/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/)&&s.nestedProperty(l,F+"._inputDomain").set(null);if("type"===I){var Y=j,W="linear"===U.type&&"log"===z,X="log"===U.type&&"linear"===z;if(W||X){if(Y&&Y.range)if(U.autorange)W&&(Y.range=Y.range[1]>Y.range[0]?[1,2]:[2,1]);else{var Z=Y.range[0],J=Y.range[1];W?(Z<=0&&J<=0&&A(F+".autorange",!0),Z<=0?Z=J/1e6:J<=0&&(J=Z/1e6),A(F+".range[0]",Math.log(Z)/Math.LN10),A(F+".range[1]",Math.log(J)/Math.LN10)):(A(F+".range[0]",Math.pow(10,Z)),A(F+".range[1]",Math.pow(10,J)))}else A(F+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[P.parts[0]]&&"radialaxis"===P.parts[1]&&delete l[P.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,U,z,A),u.getComponentMethod("images","convertCoords")(t,U,z,A)}else A(F+".autorange",!0),A(F+".range",null);s.nestedProperty(l,F+"._inputRange").set(null)}else if(I.match(k.AX_NAME_PATTERN)){var K=s.nestedProperty(l,C).get(),Q=(z||{}).type;Q&&"-"!==Q||(Q="linear"),u.getComponentMethod("annotations","convertCoords")(t,K,Q,A),u.getComponentMethod("images","convertCoords")(t,K,Q,A)}var $=x.containerArrayMatch(C);if($){r=$.array,n=$.index;var tt=$.property,et=(s.nestedProperty(a,r)||[])[n]||{},rt=et,nt=q||{editType:"calc"},it=-1!==nt.editType.indexOf("calcIfAutorange");""===n?(it?y.calc=!0:M.update(y,nt),it=!1):""===tt&&(rt=z,x.isAddVal(z)?w[C]=null:x.isRemoveVal(z)?(w[C]=et,rt=et):s.warn("unrecognized full object value",e)),it&&(B(t,rt,"x")||B(t,rt,"y"))?y.calc=!0:M.update(y,nt),p[r]||(p[r]={});var at=p[r][n];at||(at=p[r][n]={}),at[tt]=z,delete e[C]}else"reverse"===I?(j.range?j.range.reverse():(A(F+".autorange",!0),j.range=[1,0]),U.autorange?y.calc=!0:y.plot=!0):((!l._has("gl2d")&&!l._has("regl")||"dragmode"!==C||"lasso"!==z&&"select"!==z||"lasso"===V||"select"===V)&&q?M.update(y,q):y.calc=!0,P.set(z))}}for(r in p){x.applyContainerArrayChanges(t,s.nestedProperty(a,r),p[r],y)||(y.plot=!0)}var ot=l._axisConstraintGroups||[];for(T in E)for(n=0;n<ot.length;n++){var st=ot[n];if(st[T])for(var lt in y.calc=!0,st)E[lt]||(S.getFromId(t,lt)._constraintShrinkable=!0)}var ct=l.width,ut=l.height;return t.layout.autosize&&h.plotAutoSize(t,t.layout,l),(e.height||e.width||l.width!==ct||l.height!==ut)&&(y.calc=!0),(y.plot||y.calc)&&(y.layoutReplot=!0),{flags:y,undoit:w,redoit:b,eventData:s.extendDeep({},b)}}function B(t,e,r){if(!s.isPlainObject(e))return!1;var n=e[r+"ref"]||r,i=o.Axes.getFromId(t,n);return i||n.charAt(0)!==r||(i=o.Axes.getFromId(t,r)),(i||{}).autorange}function U(t,e,r,n){var i,a,o=n.getValObject,l=n.flags,c=n.immutable,u=n.inArray,f=n.arrayIndex,h=n.gd,d=n.autoranged;function p(){var t=i.editType;-1!==t.indexOf("calcIfAutorange")&&(d||void 0===d&&(B(h,e,"x")||B(h,e,"y")))?l.calc=!0:u&&-1!==t.indexOf("arraydraw")?s.pushUnique(l.arrays[u],f):M.update(l,i)}function m(t){return"data_array"===t.valType||t.arrayOk}var v=e._fullInput,g=t._fullInput;for(a in v&&v!==e&&(e=v),g&&g!==t&&(t=g),t){if(l.calc)return;var y=t[a],b=e[a];if("_"!==a.charAt(0)&&"function"!=typeof y&&y!==b){if("tick0"===a||"dtick"===a){var x=e.tickmode;if("auto"===x||"array"===x||!x)continue}if(("range"!==a||!e.autorange)&&("zmin"!==a&&"zmax"!==a||"contourcarpet"!==e.type)){var _=r.concat(a);if(i=o(_)){var w,k=i.valType,A=m(i),T=Array.isArray(y),E=Array.isArray(b);if(T&&E){var S="_input_"+a,L=t[S],C=e[S];if(Array.isArray(L)&&L===C)continue}if(void 0===b)A&&T?l.calc=!0:p();else if(i._isLinkedToArray){var P=[],z=!1;u||(l.arrays[a]=P);var O=Math.min(y.length,b.length),D=Math.max(y.length,b.length);if(O!==D){if("arraydraw"!==i.editType){p();continue}z=!0}for(w=0;w<O;w++)U(y[w],b[w],_.concat(w),s.extendFlat({inArray:a,arrayIndex:w},n));if(z)for(w=O;w<D;w++)P.push(w)}else!k&&s.isPlainObject(y)?U(y,b,_,n):A?T&&E?c&&(l.calc=!0):T!==E?l.calc=!0:p():T&&E&&y.length===b.length&&String(y)===String(b)||p()}}}}for(a in e)if(!(a in t)){if(m(i=o(r.concat(a)))&&Array.isArray(e[a]))return void(l.calc=!0);p()}}function V(t){var e=n.select(t),r=t._fullLayout;if(r._container=e.selectAll(".plot-container").data([0]),r._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),r._paperdiv=r._container.selectAll(".svg-container").data([0]),r._paperdiv.enter().append("div").classed("svg-container",!0).style("position","relative"),r._glcontainer=r._paperdiv.selectAll(".gl-container").data([{}]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._glcanvas=null,r._paperdiv.selectAll(".main-svg").remove(),r._paper=r._paperdiv.insert("svg",":first-child").classed("main-svg",!0),r._toppaper=r._paperdiv.append("svg").classed("main-svg",!0),!r._uid){var i=[];n.selectAll("defs").each(function(){this.id&&i.push(this.id.split("-")[1])}),r._uid=s.randstr(i)}r._paperdiv.selectAll(".main-svg").attr(y.svgAttrs),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._clips=r._defs.append("g").classed("clips",!0),r._topdefs=r._toppaper.append("defs").attr("id","topdefs-"+r._uid),r._topclips=r._topdefs.append("g").classed("clips",!0),r._bgLayer=r._paper.append("g").classed("bglayer",!0),r._draggers=r._paper.append("g").classed("draglayer",!0);var a=r._paper.append("g").classed("layer-below",!0);r._imageLowerLayer=a.append("g").classed("imagelayer",!0),r._shapeLowerLayer=a.append("g").classed("shapelayer",!0),r._cartesianlayer=r._paper.append("g").classed("cartesianlayer",!0),r._polarlayer=r._paper.append("g").classed("polarlayer",!0),r._ternarylayer=r._paper.append("g").classed("ternarylayer",!0),r._geolayer=r._paper.append("g").classed("geolayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0);var o=r._toppaper.append("g").classed("layer-above",!0);r._imageUpperLayer=o.append("g").classed("imagelayer",!0),r._shapeUpperLayer=o.append("g").classed("shapelayer",!0),r._infolayer=r._toppaper.append("g").classed("infolayer",!0),r._menulayer=r._toppaper.append("g").classed("menulayer",!0),r._zoomlayer=r._toppaper.append("g").classed("zoomlayer",!0),r._hoverlayer=r._toppaper.append("g").classed("hoverlayer",!0),t.emit("plotly_framework")}o.plot=function(t,e,r,i){var a;if(t=s.getGraphDiv(t),l.init(t),s.isPlainObject(e)){var c=e;e=c.data,r=c.layout,i=c.config,a=c.frames}if(!1===l.triggerHandler(t,"plotly_beforeplot",[e,r,i]))return Promise.reject();e||r||s.isPlotDiv(t)||s.warn("Calling Plotly.plot as if redrawing but this container doesn't yet have a plot.",t),z(t,i),r||(r={}),n.select(t).classed("js-plotly-plot",!0),m.makeTester(),Array.isArray(t._promises)||(t._promises=[]);var f=0===(t.data||[]).length&&Array.isArray(e);if(Array.isArray(e)&&(_.cleanData(e,t.data),f?t.data=e:t.data.push.apply(t.data,e),t.empty=!1),t.layout&&!f||(t.layout=_.cleanLayout(r)),t._dragging&&!t._transitioning)return t._replotPending=!0,Promise.reject();t._replotPending=!1,h.supplyDefaults(t);var v=t._fullLayout;if(!v._has("polar")&&e&&e[0]&&e[0].r)return s.log("Legacy polar charts are deprecated!"),function(t,e,r){var i=n.select(t).selectAll(".plot-container").data([0]);i.enter().insert("div",":first-child").classed("plot-container plotly",!0);var a=i.selectAll(".svg-container").data([0]);a.enter().append("div").classed("svg-container",!0).style("position","relative"),a.html(""),e&&(t.data=e);r&&(t.layout=r);d.manager.fillLayout(t),a.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=d.manager.framework(t),t.framework({data:t.data,layout:t.layout},a.node()),t.framework.setUndoPoint();var o=t.framework.svg(),l=1,c=t._fullLayout.title;""!==c&&c||(l=0);var u=function(){this.call(b.convertToTspans,t)},f=o.select(".title-group text").call(u);if(t._context.edits.titleText){var p=s._(t,"Click to enter Plot title");c&&c!==p||(l=.2,f.attr({"data-unformatted":p}).text(p).style({opacity: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=function(){this.call(b.makeEditable,{gd:t}).on("edit",function(e){t.framework({layout:{title:e}}),this.text(e).call(u),this.call(m)}).on("cancel",function(){var t=this.attr("data-unformatted");this.text(t).call(u)})};f.call(m)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),h.addLinks(t),Promise.resolve()}(t,e,r);v._replotting=!0,f&&V(t),t.framework!==V&&(t.framework=V,V(t)),m.initGradients(t),f&&o.Axes.saveShowSpikeInitial(t);var y=!t.calcdata||t.calcdata.length!==(t._fullData||[]).length;y&&h.doCalcdata(t);for(var x=0;x<t.calcdata.length;x++)t.calcdata[x][0].trace=t._fullData[x];var M=JSON.stringify(v._size);function k(){var e,r,n,i=t.calcdata;for(u.getComponentMethod("legend","draw")(t),u.getComponentMethod("rangeselector","draw")(t),u.getComponentMethod("sliders","draw")(t),u.getComponentMethod("updatemenus","draw")(t),e=0;e<i.length;e++)!0===(n=(r=i[e])[0].trace).visible&&n._module.colorbar?n._module.colorbar(t,r):h.autoMargin(t,"cb"+n.uid);return h.doAutoMargin(t),h.previousPromises(t)}function A(){if(!t._transitioning){for(var e=o.Axes.list(t,"",!0),r=0;r<e.length;r++){var n=e[r];E(t,n),o.Axes.doAutoRange(n)}T(t),f&&o.Axes.saveRangeInitial(t)}}var S=[h.previousPromises,function(){if(a)return o.addFrames(t,a)},function(){for(var e=v._basePlotModules,r=0;r<e.length;r++)e[r].drawFramework&&e[r].drawFramework(t);return!v._glcanvas&&v._has("gl")&&(v._glcanvas=v._glcontainer.selectAll(".gl-canvas").data([{key:"contextLayer",context:!0,pick:!1},{key:"focusLayer",context:!1,pick:!1},{key:"pickLayer",context:!1,pick:!0}],function(t){return t.key}),v._glcanvas.enter().append("canvas").attr("class",function(t){return"gl-canvas gl-canvas-"+t.key.replace("Layer","")}).style({position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"visible","pointer-events":"none"})),v._glcanvas&&v._glcanvas.attr("width",v.width).attr("height",v.height),s.syncOrAsync([w.layoutStyles],t)},k,function(){if(JSON.stringify(v._size)!==M)return s.syncOrAsync([k,w.layoutStyles],t)},function(){if(y){var e,r,n,i=v._subplots.cartesian,a=v._modules,o=[];for(n=0;n<a.length;n++)s.pushUnique(o,a[n].setPositions);if(o.length)for(r=0;r<i.length;r++)for(e=v._plots[i[r]],n=0;n<o.length;n++)o[n](t,e);return g.calc(t),s.syncOrAsync([u.getComponentMethod("shapes","calcAutorange"),u.getComponentMethod("annotations","calcAutorange"),A,u.getComponentMethod("rangeslider","calcAutorange")],t)}T(t)},w.layoutStyles,function(){return o.Axes.doTicks(t,"redraw")},function(){var e,r=t.calcdata,n=v._infolayer.selectAll("g.rangeslider-container");for(e=0;e<r.length;e++){var i=r[e][0].trace,a=!0===i.visible,o=i.uid;if(!a||!u.traceIs(i,"2dMap")){var s=".hm"+o+",.contour"+o+",#clip"+o;v._paper.selectAll(s).remove(),n.selectAll(s).remove()}a&&i._module.colorbar||v._infolayer.selectAll(".cb"+o).remove()}var l=v._basePlotModules;for(e=0;e<l.length;e++)l[e].plot(t);var c=v._paper.selectAll(".layer-subplot");return v._shapeSubplotLayers=c.selectAll(".shapelayer"),h.style(t),u.getComponentMethod("shapes","draw")(t),u.getComponentMethod("annotations","draw")(t),h.addLinks(t),v._replotting=!1,h.previousPromises(t)},function(){u.getComponentMethod("shapes","draw")(t),u.getComponentMethod("images","draw")(t),u.getComponentMethod("annotations","draw")(t),u.getComponentMethod("legend","draw")(t),u.getComponentMethod("rangeslider","draw")(t),u.getComponentMethod("rangeselector","draw")(t),u.getComponentMethod("sliders","draw")(t),u.getComponentMethod("updatemenus","draw")(t)},p,h.rehover,h.previousPromises],L=s.syncOrAsync(S,t);return L&&L.then||(L=Promise.resolve()),L.then(function(){return t.emit("plotly_afterplot"),t})},o.redraw=function(t){if(t=s.getGraphDiv(t),!s.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);return _.cleanData(t.data,t.data),_.cleanLayout(t.layout),t.calcdata=void 0,o.plot(t).then(function(){return t.emit("plotly_redraw"),t})},o.newPlot=function(t,e,r,n){return t=s.getGraphDiv(t),h.cleanPlot([],{},t._fullData||{},t._fullLayout||{}),h.purge(t),o.plot(t,e,r,n)},o.extendTraces=function t(e,r,n,i){var a=R(e=s.getGraphDiv(e),r,n,i,function(t,e){return t.concat(e)},function(t,e){return t.splice(0,t.length-e)}),l=o.redraw(e),u=[e,a.update,n,a.maxPoints];return c.add(e,o.prependTraces,u,t,arguments),l},o.prependTraces=function t(e,r,n,i){var a=R(e=s.getGraphDiv(e),r,n,i,function(t,e){return e.concat(t)},function(t,e){return t.splice(e,t.length)}),l=o.redraw(e),u=[e,a.update,n,a.maxPoints];return c.add(e,o.extendTraces,u,t,arguments),l},o.addTraces=function t(e,r,n){e=s.getGraphDiv(e);var i,a,l=[],u=o.deleteTraces,f=t,h=[e,l],d=[e,r];for(function(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n<e.length;n++)if("object"!=typeof(i=e[n])||Array.isArray(i)||null===i)throw new Error("all values in traces array must be non-array objects");if(void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&r.length!==e.length)throw new Error("if indices is specified, traces.length must equal indices.length")}(e,r,n),Array.isArray(r)||(r=[r]),r=r.map(function(t){return s.extendFlat({},t)}),_.cleanData(r,e.data),i=0;i<r.length;i++)e.data.push(r[i]);for(i=0;i<r.length;i++)l.push(-r.length+i);if(void 0===n)return a=o.redraw(e),c.add(e,u,h,f,d),a;Array.isArray(n)||(n=[n]);try{I(e,l,n)}catch(t){throw e.data.splice(e.data.length-r.length,r.length),t}return c.startSequence(e),c.add(e,u,h,f,d),a=o.moveTraces(e,l,n),c.stopSequence(e),a},o.deleteTraces=function t(e,r){e=s.getGraphDiv(e);var n,i,a=[],l=o.addTraces,u=t,f=[e,a,r],h=[e,r];if(void 0===r)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(r)||(r=[r]),D(e,r,"indices"),(r=O(r,e.data.length-1)).sort(s.sorterDes),n=0;n<r.length;n+=1)i=e.data.splice(r[n],1)[0],a.push(i);var d=o.redraw(e);return c.add(e,l,f,u,h),d},o.moveTraces=function t(e,r,n){var i,a=[],l=[],u=t,f=t,h=[e=s.getGraphDiv(e),n,r],d=[e,r,n];if(I(e,r,n),r=Array.isArray(r)?r:[r],void 0===n)for(n=[],i=0;i<r.length;i++)n.push(-r.length+i);for(n=Array.isArray(n)?n:[n],r=O(r,e.data.length-1),n=O(n,e.data.length-1),i=0;i<e.data.length;i++)-1===r.indexOf(i)&&a.push(e.data[i]);for(i=0;i<r.length;i++)l.push({newIndex:n[i],trace:e.data[r[i]]});for(l.sort(function(t,e){return t.newIndex-e.newIndex}),i=0;i<l.length;i+=1)a.splice(l[i].newIndex,0,l[i].trace);e.data=a;var p=o.redraw(e);return c.add(e,u,h,f,d),p},o.restyle=function t(e,r,n,i){e=s.getGraphDiv(e),_.clearPromiseQueue(e);var a={};if("string"==typeof r)a[r]=n;else{if(!s.isPlainObject(r))return s.warn("Restyle fail.",r,n,i),Promise.reject();a=s.extendFlat({},r),void 0===i&&(i=n)}Object.keys(a).length&&(e.changed=!0);var l=_.coerceTraceIndices(e,i),u=F(e,a,l),f=u.flags;f.clearCalc&&(e.calcdata=void 0),f.clearAxisTypes&&_.clearAxisTypes(e,l,{});var d=[];f.fullReplot?d.push(o.plot):(d.push(h.previousPromises),h.supplyDefaults(e),f.style&&d.push(w.doTraceStyle),f.colorbars&&d.push(w.doColorBars)),d.push(h.rehover),c.add(e,t,[e,u.undoit,u.traces],t,[e,u.redoit,u.traces]);var p=s.syncOrAsync(d,e);return p&&p.then||(p=Promise.resolve()),p.then(function(){return e.emit("plotly_restyle",u.eventData),e})},o.relayout=function t(e,r,n){if(e=s.getGraphDiv(e),_.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);var i={};if("string"==typeof r)i[r]=n;else{if(!s.isPlainObject(r))return s.warn("Relayout fail.",r,n),Promise.reject();i=s.extendFlat({},r)}Object.keys(i).length&&(e.changed=!0);var a=j(e,i),o=a.flags;o.calc&&(e.calcdata=void 0);var l=[h.previousPromises];o.layoutReplot?l.push(w.layoutReplot):Object.keys(i).length&&(h.supplyDefaults(e),o.legend&&l.push(w.doLegend),o.layoutstyle&&l.push(w.layoutStyles),o.ticks&&l.push(w.doTicksRelayout),o.modebar&&l.push(w.doModeBar),o.camera&&l.push(w.doCamera)),l.push(h.rehover),c.add(e,t,[e,a.undoit],t,[e,a.redoit]);var u=s.syncOrAsync(l,e);return u&&u.then||(u=Promise.resolve(e)),u.then(function(){return e.emit("plotly_relayout",a.eventData),e})},o.update=function t(e,r,n,i){if(e=s.getGraphDiv(e),_.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);s.isPlainObject(r)||(r={}),s.isPlainObject(n)||(n={}),Object.keys(r).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var a=_.coerceTraceIndices(e,i),l=F(e,s.extendFlat({},r),a),u=l.flags,f=j(e,s.extendFlat({},n)),d=f.flags;(u.clearCalc||d.calc)&&(e.calcdata=void 0),u.clearAxisTypes&&_.clearAxisTypes(e,a,n);var p=[];if(u.fullReplot&&d.layoutReplot){var m=e.data,v=e.layout;e.data=void 0,e.layout=void 0,p.push(function(){return o.plot(e,m,v)})}else u.fullReplot?p.push(o.plot):d.layoutReplot?p.push(w.layoutReplot):(p.push(h.previousPromises),h.supplyDefaults(e),u.style&&p.push(w.doTraceStyle),u.colorbars&&p.push(w.doColorBars),d.legend&&p.push(w.doLegend),d.layoutstyle&&p.push(w.layoutStyles),d.ticks&&p.push(w.doTicksRelayout),d.modebar&&p.push(w.doModeBar),d.camera&&p.push(w.doCamera));p.push(h.rehover),c.add(e,t,[e,l.undoit,f.undoit,l.traces],t,[e,l.redoit,f.redoit,l.traces]);var g=s.syncOrAsync(p,e);return g&&g.then||(g=Promise.resolve(e)),g.then(function(){return e.emit("plotly_update",{data:l.eventData,layout:f.eventData}),e})},o.react=function(t,e,r,n){var i,a;var l=(t=s.getGraphDiv(t))._fullData,c=t._fullLayout;if(s.isPlotDiv(t)&&l&&c){if(s.isPlainObject(e)){var d=e;e=d.data,r=d.layout,n=d.config,i=d.frames}var p=!1;if(n){var m=s.extendDeep({},t._context);t._context=void 0,z(t,n),p=function t(e,r){var n;for(n in e){var i=e[n],a=r[n];if(i!==a)if(s.isPlainObject(i)&&s.isPlainObject(a)){if(t(i,a))return!0}else{if(!Array.isArray(i)||!Array.isArray(a))return!0;if(i.length!==a.length)return!0;for(var o=0;o<i.length;o++)if(i[o]!==a[o]){if(!s.isPlainObject(i[o])||!s.isPlainObject(a[o]))return!0;if(t(i[o],a[o]))return!0}}}}(m,t._context)}t.data=e||[],_.cleanData(t.data,[]),t.layout=r||{},_.cleanLayout(t.layout),h.supplyDefaults(t);var v=t._fullData,g=t._fullLayout,y=void 0===g.datarevision,b=function(t,e,r,n){if(e.length!==r.length)return{fullReplot:!0,clearCalc:!0};var i,a,s=M.traceFlags();s.arrays={};var l={getValObject:function(t){return f.getTraceValObject(a,t)},flags:s,immutable:n,gd:t};for(i=0;i<e.length;i++)a=r[i],l.autoranged=!!a.xaxis&&(o.Axes.getFromId(t,a.xaxis).autorange||o.Axes.getFromId(t,a.yaxis).autorange),U(e[i],a,[],l);(s.calc||s.plot||s.calcIfAutorange)&&(s.fullReplot=!0);return s}(t,l,v,y),x=function(t,e,r,n){var i=M.layoutFlags();i.arrays={},U(e,r,[],{getValObject:function(t){return f.getLayoutValObject(r,t)},flags:i,immutable:n,gd:t}),(i.plot||i.calc)&&(i.layoutReplot=!0);return i}(t,c,g,y);(b.calc||x.calc)&&(t.calcdata=void 0);var k=[];if(i&&(t._transitionData={},h.createTransitionData(t),k.push(function(){return o.addFrames(t,i)})),b.fullReplot||x.layoutReplot||p)t._fullLayout._skipDefaults=!0,k.push(o.plot);else{for(var A in x.arrays){var T=x.arrays[A];if(T.length){var E=u.getComponentMethod(A,"drawOne");if(E!==s.noop)for(var S=0;S<T.length;S++)E(t,T[S]);else{var L=u.getComponentMethod(A,"draw");if(L===s.noop)throw new Error("cannot draw components: "+A);L(t)}}}k.push(h.previousPromises),b.style&&k.push(w.doTraceStyle),b.colorbars&&k.push(w.doColorBars),x.legend&&k.push(w.doLegend),x.layoutstyle&&k.push(w.layoutStyles),x.ticks&&k.push(w.doTicksRelayout),x.modebar&&k.push(w.doModeBar),x.camera&&k.push(w.doCamera)}k.push(h.rehover),(a=s.syncOrAsync(k,t))&&a.then||(a=Promise.resolve(t))}else a=o.newPlot(t,e,r,n);return a.then(function(){return t.emit("plotly_react",{data:e,layout:r}),t})},o.animate=function(t,e,r){if(t=s.getGraphDiv(t),!s.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plot.ly/javascript/animations/");var n=t._transitionData;n._frameQueue||(n._frameQueue=[]);var i=(r=h.supplyAnimationDefaults(r)).transition,a=r.frame;function o(t){return Array.isArray(i)?t>=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}function c(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise(function(a,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,h.transition(t,e.frame.data,e.frame.layout,_.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function d(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&f()};e()}var p,m,v=0;function g(t){return Array.isArray(i)?v>=i.length?t.transitionOpts=i[v]:t.transitionOpts=i[0]:t.transitionOpts=i,v++,t}var y=[],b=void 0===e||null===e,x=Array.isArray(e);if(!b&&!x&&s.isPlainObject(e))y.push({type:"object",data:g(s.extendFlat({},e))});else if(b||-1!==["string","number"].indexOf(typeof e))for(p=0;p<n._frames.length;p++)(m=n._frames[p])&&(b||String(m.group)===String(e))&&y.push({type:"byname",name:String(m.name),data:g({name:m.name})});else if(x)for(p=0;p<e.length;p++){var w=e[p];-1!==["number","string"].indexOf(typeof w)?(w=String(w),y.push({type:"byname",name:w,data:g({name:w})})):s.isPlainObject(w)&&y.push({type:"object",data:g(s.extendFlat({},w))})}for(p=0;p<y.length;p++)if("byname"===(m=y[p]).type&&!n._frameHash[m.data.name])return s.warn('animate failure: frame not found: "'+m.data.name+'"'),void u();-1!==["next","immediate"].indexOf(r.mode)&&function(){if(0!==n._frameQueue.length){for(;n._frameQueue.length;){var e=n._frameQueue.pop();e.onInterrupt&&e.onInterrupt()}t.emit("plotly_animationinterrupted",[])}}(),"reverse"===r.direction&&y.reverse();var M=t._fullLayout._currentFrame;if(M&&r.fromcurrent){var k=-1;for(p=0;p<y.length;p++)if("byname"===(m=y[p]).type&&m.name===M){k=p;break}if(k>0&&k<y.length-1){var A=[];for(p=0;p<y.length;p++)m=y[p],("byname"!==y[p].type||p>k)&&A.push(m);y=A}}y.length>0?function(e){if(0!==e.length){for(var i=0;i<e.length;i++){var s;s="byname"===e[i].type?h.computeFrame(t,e[i].name):e[i].data;var f=l(i),p=o(i);p.duration=Math.min(p.duration,f.duration);var m={frame:s,name:e[i].name,frameOpts:f,transitionOpts:p};i===e.length-1&&(m.onComplete=c(a,2),m.onInterrupt=u),n._frameQueue.push(m)}"immediate"===r.mode&&(n._lastFrameAt=-1/0),n._animationRaf||d()}}(y):(t.emit("plotly_animated"),a())})},o.addFrames=function(t,e,r){if(t=s.getGraphDiv(t),null===e||void 0===e)return Promise.resolve();if(!s.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plot.ly/javascript/animations/");var n,i,a,o,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 f=l.length+2*e.length,d=[],p={};for(n=e.length-1;n>=0;n--)if(s.isPlainObject(e[n])){var m=e[n].name,v=(u[m]||p[m]||{}).name,g=e[n].name,y=u[v]||p[v];v&&g&&"number"==typeof g&&y&&L<5&&(L++,s.warn('addFrames: overwriting frame "'+(u[v]||p[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===L&&s.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),p[m]={name:m},d.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}d.sort(function(t,e){return t.index>e.index?-1:t.index<e.index?1:0});var b=[],x=[],_=l.length;for(n=d.length-1;n>=0;n--){if("number"==typeof(i=d[n].frame).name&&s.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;u[i.name="frame "+t._transitionData._counter++];);if(u[i.name]){for(a=0;a<l.length&&(l[a]||{}).name!==i.name;a++);b.push({type:"replace",index:a,value:i}),x.unshift({type:"replace",index:a,value:l[a]})}else o=Math.max(0,Math.min(d[n].index,_)),b.push({type:"insert",index:o,value:i}),x.unshift({type:"delete",index:o}),_++}var w=h.modifyFrames,M=h.modifyFrames,k=[t,x],A=[t,b];return c&&c.add(t,w,k,M,A),h.modifyFrames(t,b)},o.deleteFrames=function(t,e){if(t=s.getGraphDiv(t),!s.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);var r,n,i=t._transitionData._frames,a=[],o=[];if(!e)for(e=[],r=0;r<i.length;r++)e.push(r);for((e=e.slice(0)).sort(),r=e.length-1;r>=0;r--)n=e[r],a.push({type:"delete",index:n}),o.unshift({type:"insert",index:n,value:i[n]});var l=h.modifyFrames,u=h.modifyFrames,f=[t,o],d=[t,a];return c&&c.add(t,l,f,u,d),h.modifyFrames(t,a)},o.purge=function(t){var e=(t=s.getGraphDiv(t))._fullLayout||{},r=t._fullData||[];return h.cleanPlot([],{},r,e),h.purge(t),l.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":598,"../components/drawing":623,"../components/errorbars":629,"../constants/xmlns_namespaces":704,"../lib":724,"../lib/events":712,"../lib/queue":738,"../lib/svg_text_utils":747,"../plotly":765,"../plots/cartesian/axis_ids":773,"../plots/cartesian/constants":775,"../plots/cartesian/constraints":777,"../plots/cartesian/graph_interact":779,"../plots/plots":833,"../plots/polar/legacy":841,"../registry":854,"./edit_types":754,"./helpers":755,"./manage_arrays":756,"./plot_schema":759,"./subroutines":762,d3:128,"fast-isnumeric":140,"has-hover":255}],758:[function(t,e,r){"use strict";e.exports={staticPlot:!1,editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:"transparent",topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:1,globalTransforms:[],locale:"en-US",locales:{}}},{}],759:[function(t,e,r){"use strict";var n=t("../registry"),i=t("../lib"),a=t("../plots/attributes"),o=t("../plots/layout_attributes"),s=t("../plots/frame_attributes"),l=t("../plots/animation_attributes"),c=t("../plots/polar/legacy/area_attributes"),u=t("../plots/polar/legacy/axis_attributes"),f=t("./edit_types"),h=i.extendFlat,d=i.extendDeepAll,p="_isSubplotObj",m="_isLinkedToArray",v=[p,m,"_arrayAttrRegexps","_deprecated"];function g(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(y(e[r]))r++;else if(r<e.length)return!1;for(;r<e.length;r++){var n=t[e[r]];if(!i.isPlainObject(n))break;if(t=n,r===e.length-1)break;if(t._isLinkedToArray){if(!y(e[++r]))return!1}else if("info_array"===t.valType){var a=e[++r];if(!y(a)||a>=t.items.length)return!1;t=t.items[a]}}return t}function y(t){return t===Math.round(t)&&t>=0}function b(t){return function(t){r.crawl(t,function(t,e,n){r.isValObject(t)?"data_array"===t.valType?(t.role="data",n[e+"src"]={valType:"string",editType:"none"}):!0===t.arrayOk&&(n[e+"src"]={valType:"string",editType:"none"}):i.isPlainObject(t)&&(t.role="object")})}(t),function(t){r.crawl(t,function(t,e,r){if(!t)return;var n=t[m];if(!n)return;delete t[m],r[e]={items:{}},r[e].items[n]=t,r[e].role="object"})}(t),t}function x(t,e,r){var n=i.nestedProperty(t,r),a=d({},e.layoutAttributes);a[p]=!0,n.set(a)}function _(t,e,r){var n=i.nestedProperty(t,r);n.set(d(n.get()||{},e))}r.IS_SUBPLOT_OBJ=p,r.IS_LINKED_TO_ARRAY=m,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=v,r.get=function(){var t={};n.allTypes.concat("area").forEach(function(e){t[e]=function(t){var e,r;"area"===t?(e={attributes:c},r={}):(e=n.modules[t]._module,r=e.basePlotModule);var i={type:null};d(i,a),d(i,e.attributes),r.attributes&&d(i,r.attributes);i.type=t;var o={meta:e.meta||{},attributes:b(i)};if(e.layoutAttributes){var s={};d(s,e.layoutAttributes),o.layoutAttributes=b(s)}return o}(e)});var e,r={};return Object.keys(n.transformsRegistry).forEach(function(t){r[t]=function(t){var e=n.transformsRegistry[t],r=d({},e.attributes);return Object.keys(n.componentsRegistry).forEach(function(e){var i=n.componentsRegistry[e];i.schema&&i.schema.transforms&&i.schema.transforms[t]&&Object.keys(i.schema.transforms[t]).forEach(function(e){_(r,i.schema.transforms[t][e],e)})}),{attributes:b(r)}}(t)}),{defs:{valObjects:i.valObjectMeta,metaKeys:v.concat(["description","role","editType","impliedEdits"]),editType:{traces:f.traces,layout:f.layout},impliedEdits:{}},traces:t,layout:function(){var t,e,r={};for(t in d(r,o),n.subplotsRegistry)if((e=n.subplotsRegistry[t]).layoutAttributes)if("cartesian"===e.name)x(r,e,"xaxis"),x(r,e,"yaxis");else{var i="subplot"===e.attr?e.name:e.attr;x(r,e,i)}for(t in r=function(t){return h(t,{radialaxis:u.radialaxis,angularaxis:u.angularaxis}),h(t,u.layout),t}(r),n.componentsRegistry){var a=(e=n.componentsRegistry[t]).schema;if(a&&(a.subplots||a.layout)){var s=a.subplots;if(s&&s.xaxis&&!s.yaxis)for(var l in s.xaxis)delete r.yaxis[l]}else e.layoutAttributes&&_(r,e.layoutAttributes,e.name)}return{layoutAttributes:b(r)}}(),transforms:r,frames:(e={frames:i.extendDeepAll({},s)},b(e),e.frames),animation:b(l)}},r.crawl=function(t,e,n,a){var o=n||0;a=a||"",Object.keys(t).forEach(function(n){var s=t[n];if(-1===v.indexOf(n)){var l=(a?a+".":"")+n;e(s,n,t,o,l),r.isValObject(s)||i.isPlainObject(s)&&"impliedEdits"!==n&&r.crawl(s,e,o+1,l)}})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){var e=[],n=[];function o(r,a,o,s){if(n=n.slice(0,s).concat([a]),r&&("data_array"===r.valType||!0===r.arrayOk)&&!("colorbar"===n[s-1]&&("ticktext"===a||"tickvals"===a))){var l=function(t){return t.join(".")}(n),c=i.nestedProperty(t,l).get();Array.isArray(c)&&e.push(l)}}if(r.crawl(a,o),t._module&&t._module.attributes&&r.crawl(t._module.attributes,o),t.transforms)for(var s=t.transforms,l=0;l<s.length;l++){var c=s[l]._module;c&&(n=["transforms["+l+"]"],r.crawl(c.attributes,o,1))}return t._fullInput&&t._fullInput._module&&t._fullInput._module.attributes&&(r.crawl(t._fullInput._module.attributes,o),e=i.filterUnique(e)),e},r.getTraceValObject=function(t,e){var r,i,o=e[0],s=1;if("transforms"===o){if(!Array.isArray(t.transforms))return!1;var l=e[1];if(!y(l)||l>=t.transforms.length)return!1;i=(r=(n.transformsRegistry[t.transforms[l].type]||{}).attributes)&&r[e[2]],s=3}else if("area"===t.type)i=c[o];else{var u=t._module;if(u||(u=(n.modules[t.type||a.type.dflt]||{})._module),!u)return!1;if(!(i=(r=u.attributes)&&r[o])){var f=u.basePlotModule;f&&f.attributes&&(i=f.attributes[o])}i||(i=a[o])}return g(i,e,s)},r.getLayoutValObject=function(t,e){return g(function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var c;for(r=0;r<l.length;r++){if((a=l[r]).attrRegex&&a.attrRegex.test(e)){if(a.layoutAttrOverrides)return a.layoutAttrOverrides;!c&&a.layoutAttributes&&(c=a.layoutAttributes)}var f=a.baseLayoutAttrOverrides;if(f&&e in f)return f[e]}if(c)return c}var h=t._modules;if(h)for(r=0;r<h.length;r++)if((s=h[r].layoutAttributes)&&e in s)return s[e];for(i in n.componentsRegistry)if(!(a=n.componentsRegistry[i]).schema&&e===a.name)return a.layoutAttributes;if(e in o)return o[e];if("radialaxis"===e||"angularaxis"===e)return u[e];return u.layout[e]||!1}(t,e[0]),e,1)}},{"../lib":724,"../plots/animation_attributes":766,"../plots/attributes":768,"../plots/frame_attributes":798,"../plots/layout_attributes":824,"../plots/polar/legacy/area_attributes":839,"../plots/polar/legacy/axis_attributes":840,"../registry":854,"./edit_types":754}],760:[function(t,e,r){"use strict";var n=t("../registry"),i=t("../lib");function a(t){n.register(t,t.name,t.categories,t.meta),n.subplotsRegistry[t.basePlotModule.name]||n.registerSubplot(t.basePlotModule)}function o(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,a="function"==typeof t.calcTransform;if(!r&&!a)throw new Error(e+" is missing a *transform* or *calcTransform* method.");r&&a&&i.log([e+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),i.isPlainObject(t.attributes)||i.log(e+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&i.log(e+" registered without a *supplyDefaults* method."),n.registerTransform(t)}function s(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");n.registerComponent(t)}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":a(r);break;case"transform":o(r);break;case"component":s(r);break;case"locale":n.registerLocale(r);break;default:throw new Error("Invalid module was attempted to be registered!")}}}},{"../lib":724,"../registry":854}],761:[function(t,e,r){"use strict";var n=t("../plotly"),i=t("../lib");e.exports=function(t){return i.extendFlat(n.defaultConfig,t)}},{"../lib":724,"../plotly":765}],762:[function(t,e,r){"use strict";var n=t("d3"),i=t("../plotly"),a=t("../registry"),o=t("../plots/plots"),s=t("../lib"),l=t("../components/color"),c=t("../components/drawing"),u=t("../components/titles"),f=t("../components/modebar"),h=t("../plots/cartesian/graph_interact"),d=t("../plots/cartesian/constants"),p=t("../constants/alignment");function m(t,e){return(t.ticks||t.showline)&&(e===t._mainSubplot||"all"===t.mirror||"allticks"===t.mirror)}function v(t,e,r){if(!r.showline||!r._lw)return!1;if("all"===r.mirror||"allticks"===r.mirror)return!0;var n=r._anchorAxis;if(!n)return!1;var i=p.FROM_BL[e];return r.side===e?n.domain[i]===t.domain[i]:r.mirror&&n.domain[1-i]===t.domain[1-i]}function g(t,e,r,n){if(v(t,e,r))return r._lw;for(var i=0;i<n.length;i++){var a=n[i];if(a._mainAxis===r._mainAxis&&v(t,e,a))return a._lw}return 0}r.layoutStyles=function(t){return s.syncOrAsync([o.doAutoMargin,r.lsInner],t)},r.lsInner=function(t){var e,a=t._fullLayout,o=a._size,s=o.p,u=i.Axes.list(t),h=a._has("cartesian");function v(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-s-n:e._offset+e._length+s+n:o.t+o.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+s+n:e._offset-s-n:o.l+o.w*(t.position||0)+n%1}for(e=0;e<u.length;e++){var y=u[e];y.setScale();var b=y._anchorAxis;y._linepositions={},y._lw=c.crispRound(t,y.linewidth,1),y._mainLinePosition=v(y,b,y.side),y._mainMirrorPosition=y.mirror&&b?v(y,b,p.OPPOSITE_SIDE[y.side]):null}a._paperdiv.style({width:a.width+"px",height:a.height+"px"}).selectAll(".main-svg").call(c.setSize,a.width,a.height),t._context.setBackground(t,a.paper_bgcolor);var x=a._paper.selectAll("g.subplot"),_=[],w=[];x.each(function(t){var e=a._plots[t];if(e.mainplot)return e.bg&&e.bg.remove(),void(e.bg=void 0);var r=e.xaxis.domain,n=e.yaxis.domain,i=[];!function(t,e,r){for(var n=0;n<r.length;n++){var i=r[n][0],a=r[n][1];if(!(i[0]>=t[1]||i[1]<=t[0])&&a[0]<e[1]&&a[1]>e[0])return!0}return!1}(r,n,w)?(_.push(t),w.push([r,n])):i=[0];var o=e.plotgroup.selectAll(".bg").data(i);o.enter().append("rect").classed("bg",!0),o.exit().remove(),o.each(function(){e.bg=o;var t=e.plotgroup.node();t.insertBefore(this,t.childNodes[0])})});var M=a._bgLayer.selectAll(".bg").data(_);return M.enter().append("rect").classed("bg",!0),M.exit().remove(),M.each(function(t){a._plots[t].bg=n.select(this)}),x.each(function(t){var r=a._plots[t],n=r.xaxis,i=r.yaxis;r.bg&&h&&r.bg.call(c.setRect,n._offset-s,i._offset-s,n._length+2*s,i._length+2*s).call(l.fill,a.plot_bgcolor).style("stroke-width",0),r.clipId="clip"+a._uid+t+"plot";var o,f,p=a._clips.selectAll("#"+r.clipId).data([0]);for(p.enter().append("clipPath").attr({class:"plotclip",id:r.clipId}).append("rect"),p.selectAll("rect").attr({width:n._length,height:i._length}),c.setTranslate(r.plot,n._offset,i._offset),r._hasClipOnAxisFalse?(o=null,f=r.clipId):(o=r.clipId,f=null),c.setClipUrl(r.plot,o),e=0;e<d.traceLayerClasses.length;e++){var y=d.traceLayerClasses[e];"scatterlayer"!==y&&r.plot.selectAll("g."+y).call(c.setClipUrl,f)}if(r.layerClipId=f,h){var b,x,_,w,M,k,A,T,E,S,L,C,P;if(m(n,t)){M=g(n,"left",i,u),b=n._offset-(M?s+M:0),k=g(n,"right",i,u),x=n._offset+n._length+(k?s+k:0),_=v(n,i,"bottom"),w=v(n,i,"top"),(P=!n._anchorAxis||t!==n._mainSubplot)&&n.ticks&&"allticks"===n.mirror&&(n._linepositions[t]=[_,w]);var z=R(n,D,function(t){return"M"+n._offset+","+t+"h"+n._length});P&&n.showline&&("all"===n.mirror||"allticks"===n.mirror)&&(z+=D(_)+D(w)),r.xlines.attr("d",z||"M0,0").style("stroke-width",n._lw+"px").call(l.stroke,n.showline?n.linecolor:"rgba(0,0,0,0)")}if(m(i,t)){L=g(i,"bottom",n,u),A=i._offset+i._length+(L?s:0),C=g(i,"top",n,u),T=i._offset-(C?s:0),E=v(i,n,"left"),S=v(i,n,"right"),(P=!i._anchorAxis||t!==n._mainSubplot)&&i.ticks&&"allticks"===i.mirror&&(i._linepositions[t]=[E,S]);var O=R(i,I,function(t){return"M"+t+","+i._offset+"v"+i._length});P&&i.showline&&("all"===i.mirror||"allticks"===i.mirror)&&(O+=I(E)+I(S)),r.ylines.attr("d",O||"M0,0").style("stroke-width",i._lw+"px").call(l.stroke,i.showline?i.linecolor:"rgba(0,0,0,0)")}}function D(t){return"M"+b+","+t+"H"+x}function I(t){return"M"+t+","+T+"V"+A}function R(e,r,n){if(!e.showline||t!==e._mainSubplot)return"";if(!e._anchorAxis)return n(e._mainLinePosition);var i=r(e._mainLinePosition);return e.mirror&&(i+=r(e._mainMirrorPosition)),i}}),i.Axes.makeClipPaths(t),r.drawMainTitle(t),f.manage(t),t._promises.length&&Promise.all(t._promises)},r.drawMainTitle=function(t){var e=t._fullLayout;u.draw(t,"gtitle",{propContainer:e,propName:"title",placeholder:e._dfltTitle.plot,attributes:{x:e.width/2,y:e._size.t/2,"text-anchor":"middle"}})},r.doTraceStyle=function(t){for(var e=0;e<t.calcdata.length;e++){var r=t.calcdata[e],n=(((r[0]||{}).trace||{})._module||{}).arraysToCalcdata;n&&n(r,r[0].trace)}return o.style(t),a.getComponentMethod("legend","draw")(t),o.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,i=r.t.cb;a.traceIs(n,"contour")&&i.line({width:!1!==n.contours.showlines?n.line.width:0,dash:n.line.dash,color:"line"===n.contours.coloring?i._opts.line.color:n.line.color}),a.traceIs(n,"markerColorscale")?i.options(n.marker.colorbar)():i.options(n.colorbar)()}}return o.previousPromises(t)},r.layoutReplot=function(t){var e=t.layout;return t.layout=void 0,i.plot(t,"",e)},r.doLegend=function(t){return a.getComponentMethod("legend","draw")(t),o.previousPromises(t)},r.doTicksRelayout=function(t){return i.Axes.doTicks(t,"redraw"),r.drawMainTitle(t),o.previousPromises(t)},r.doModeBar=function(t){var e=t._fullLayout;f.manage(t),h(t);for(var r=0;r<e._basePlotModules.length;r++){var n=e._basePlotModules[r].updateFx;n&&n(e)}return o.previousPromises(t)},r.doCamera=function(t){for(var e=t._fullLayout,r=e._subplots.gl3d,n=0;n<r.length;n++){var i=e[r[n]];i._scene.setCamera(i.camera)}}},{"../components/color":598,"../components/drawing":623,"../components/modebar":660,"../components/titles":689,"../constants/alignment":696,"../lib":724,"../plotly":765,"../plots/cartesian/constants":775,"../plots/cartesian/graph_interact":779,"../plots/plots":833,"../registry":854,d3:128}],763:[function(t,e,r){"use strict";var n=t("../plotly"),i=t("../lib"),a=t("../snapshot/helpers"),o=t("../snapshot/tosvg"),s=t("../snapshot/svgtoimg"),l={format:{valType:"enumerated",values:["png","jpeg","webp","svg"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}},c=/^data:image\/\w+;base64,/;e.exports=function(t,e){var r,u,f;function h(t){return!(t in e)||i.validate(e[t],l[t])}if(e=e||{},i.isPlainObject(t)?(r=t.data||[],u=t.layout||{},f=t.config||{}):(t=i.getGraphDiv(t),r=i.extendDeep([],t.data),u=i.extendDeep({},t.layout),f=t._context),!h("width")||!h("height"))throw new Error("Height and width should be pixel values.");if(!h("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var d={};function p(t,r){return i.coerce(e,d,l,t,r)}var m=p("format"),v=p("width"),g=p("height"),y=p("scale"),b=p("setBackground"),x=p("imageDataOnly"),_=document.createElement("div");_.style.position="absolute",_.style.left="-5000px",document.body.appendChild(_);var w=i.extendFlat({},u);v&&(w.width=v),g&&(w.height=g);var M=i.extendFlat({},f,{staticPlot:!0,setBackground:b}),k=a.getRedrawFunc(_);function A(){return new Promise(function(t){setTimeout(t,a.getDelay(_._fullLayout))})}function T(){return new Promise(function(t,e){var r=o(_,m,y),a=_._fullLayout.width,l=_._fullLayout.height;if(n.purge(_),document.body.removeChild(_),"svg"===m)return t(x?r:"data:image/svg+xml,"+encodeURIComponent(r));var c=document.createElement("canvas");c.id=i.randstr(),s({format:m,width:a,height:l,scale:y,canvas:c,svg:r,promise:!0}).then(t).catch(e)})}return new Promise(function(t,e){n.plot(_,r,w,M).then(k).then(A).then(T).then(function(e){t(function(t){return x?t.replace(c,""):t}(e))}).catch(function(t){e(t)})})}},{"../lib":724,"../plotly":765,"../snapshot/helpers":858,"../snapshot/svgtoimg":860,"../snapshot/tosvg":862}],764:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plots/plots"),a=t("./plot_schema"),o=t("./plot_config"),s=n.isPlainObject,l=Array.isArray;function c(t,e,r,i,a,o){o=o||[];for(var u=Object.keys(t),f=0;f<u.length;f++){var m=u[f];if("transforms"!==m){var v=o.slice();v.push(m);var g=t[m],y=e[m],b=p(r,m),x="info_array"===(b||{}).valType,_="colorscale"===(b||{}).valType;if(d(r,m))if(s(g)&&s(y))c(g,y,b,i,a,v);else if(b.items&&!x&&l(g)){var w,M,k=b.items,A=k[Object.keys(k)[0]],T=[];for(w=0;w<y.length;w++){var E=y[w]._index||w;(M=v.slice()).push(E),s(g[E])&&s(y[w])&&(T.push(E),c(g[E],y[w],A,i,a,M))}for(w=0;w<g.length;w++)(M=v.slice()).push(w),s(g[w])?-1===T.indexOf(w)&&i.push(h("unused",a,M)):i.push(h("object",a,M,g[w]))}else!s(g)&&s(y)?i.push(h("object",a,v,g)):l(g)||!l(y)||x||_?m in e?n.validate(g,b)?"enumerated"===b.valType&&(b.coerceNumber&&g!==+y||g!==y)&&i.push(h("dynamic",a,v,g,y)):i.push(h("value",a,v,g)):i.push(h("unused",a,v,g)):i.push(h("array",a,v,g));else i.push(h("schema",a,v))}}return i}e.exports=function(t,e){var r,u,f=a.get(),d=[],p={_context:n.extendFlat({},o)};l(t)?(p.data=n.extendDeep([],t),r=t):(p.data=[],r=[],d.push(h("array","data"))),s(e)?(p.layout=n.extendDeep({},e),u=e):(p.layout={},u={},arguments.length>1&&d.push(h("object","layout"))),i.supplyDefaults(p);for(var m=p._fullData,v=r.length,g=0;g<v;g++){var y=r[g],b=["data",g];if(s(y)){var x=m[g],_=x.type,w=f.traces[_].attributes;w.type={valType:"enumerated",values:[_]},!1===x.visible&&!1!==y.visible&&d.push(h("invisible",b)),c(y,x,w,d,b);var M=y.transforms,k=x.transforms;if(M){l(M)||d.push(h("array",b,["transforms"])),b.push("transforms");for(var A=0;A<M.length;A++){var T=["transforms",A],E=M[A].type;if(s(M[A])){var S=f.transforms[E]?f.transforms[E].attributes:{};S.type={valType:"enumerated",values:Object.keys(f.transforms)},c(M[A],k[A],S,d,b,T)}else d.push(h("object",b,T))}}}else d.push(h("object",b))}return c(u,p._fullLayout,function(t,e){for(var r=0;r<e.length;r++){var i=e[r].type,a=t.traces[i].layoutAttributes;a&&n.extendFlat(t.layout.layoutAttributes,a)}return t.layout.layoutAttributes}(f,m),d,"layout"),0===d.length?void 0:d};var u={object:function(t,e){return("layout"===t&&""===e?"The layout argument":"data"===t[0]&&""===e?"Trace "+t[1]+" in the data argument":f(t)+"key "+e)+" must be linked to an object container"},array:function(t,e){return("data"===t?"The data argument":f(t)+"key "+e)+" must be linked to an array container"},schema:function(t,e){return f(t)+"key "+e+" is not part of the schema"},unused:function(t,e,r){var n=s(r)?"container":"key";return f(t)+n+" "+e+" did not get coerced"},dynamic:function(t,e,r,n){return[f(t)+"key",e,"(set to '"+r+"')","got reset to","'"+n+"'","during defaults."].join(" ")},invisible:function(t){return"Trace "+t[1]+" got defaulted to be not visible"},value:function(t,e,r){return[f(t)+"key "+e,"is set to an invalid value ("+r+")"].join(" ")}};function f(t){return l(t)?"In data trace "+t[1]+", ":"In "+t+", "}function h(t,e,r,i,a){var o,s;r=r||"",l(e)?(o=e[0],s=e[1]):(o=e,s=null);var c=function(t){if(!l(t))return String(t);for(var e="",r=0;r<t.length;r++){var n=t[r];"number"==typeof n?e=e.substr(0,e.length-1)+"["+n+"]":e+=n,r<t.length-1&&(e+=".")}return e}(r),f=u[t](e,c,i,a);return n.log(f),{code:t,container:o,trace:s,path:r,astr:c,msg:f}}function d(t,e){var r=v(e),n=r.keyMinusId,i=r.id;return!!(n in t&&t[n]._isSubplotObj&&i)||e in t}function p(t,e){return t[v(e).keyMinusId]}var m=n.counterRegex("([a-z]+)");function v(t){var e=t.match(m);return{keyMinusId:e&&e[1],id:e&&e[2]}}},{"../lib":724,"../plots/plots":833,"./plot_config":758,"./plot_schema":759}],765:[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.ModeBar=t("./components/modebar"),t("./plot_api/plot_api")},{"./components/modebar":660,"./plot_api/plot_api":757,"./plot_api/plot_config":758,"./plots/cartesian/axes":770,"./plots/plots":833}],766:[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"]}}}},{}],767:[function(t,e,r){"use strict";var n=t("../lib");e.exports=function(t,e,r){var i,a=r.name,o=e[a],s=n.isArray(t[a])?t[a]:[],l=e[a]=[];for(i=0;i<s.length;i++){var c=s[i],u={},f={};n.isPlainObject(c)||(f.itemIsNotPlainObject=!0,c={}),r.handleItemDefaults(c,u,e,r,f),u._input=c,u._index=i,l.push(u)}if(n.isArray(o)){var h=Math.min(o.length,l.length);for(i=0;i<h;i++)n.relinkPrivateKeys(l[i],o[i])}}},{"../lib":724}],768:[function(t,e,r){"use strict";var n=t("../components/fx/attributes");e.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes"},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},legendgroup:{valType:"string",dflt:"",editType:"style"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style"},name:{valType:"string",editType:"style"},uid:{valType:"string",dflt:"",editType:"calc"},ids:{valType:"data_array",editType:"calc"},customdata:{valType:"data_array",editType:"calc"},selectedpoints:{valType:"any",editType:"calc"},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none"},hoverlabel:n.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc"},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc"},editType:"calc"}}},{"../components/fx/attributes":632}],769:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],770:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../registry"),o=t("../../lib"),s=t("../../lib/svg_text_utils"),l=t("../../components/titles"),c=t("../../components/color"),u=t("../../components/drawing"),f=t("../../constants/numerical"),h=f.FP_SAFE,d=f.ONEAVGYEAR,p=f.ONEAVGMONTH,m=f.ONEDAY,v=f.ONEHOUR,g=f.ONEMIN,y=f.ONESEC,b=f.MINUS_SIGN,x=f.BADNUM,_=t("../../constants/alignment").MID_SHIFT,w=e.exports={};w.setConvert=t("./set_convert");var M=t("./axis_autotype"),k=t("./axis_ids");w.id2name=k.id2name,w.cleanId=k.cleanId,w.list=k.list,w.listIds=k.listIds,w.getFromId=k.getFromId,w.getFromTrace=k.getFromTrace,w.coerceRef=function(t,e,r,n,i,a){var s=n.charAt(n.length-1),l=r._fullLayout._subplots[s+"axis"],c=n+"ref",u={};return i||(i=l[0]||a),a||(a=i),u[c]={valType:"enumerated",values:l.concat(a?[a]:[]),dflt:i},o.coerce(t,e,u,c)},w.coercePosition=function(t,e,r,n,i,a){var s,l;if("paper"===n||"pixel"===n)s=o.ensureNumber,l=r(i,a);else{var c=w.getFromId(e,n);l=r(i,a=c.fraction2r(a)),s=c.cleanPos}t[i]=s(l)},w.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?o.ensureNumber:w.getFromId(e,r).cleanPos)(t)};var A=w.getDataConversions=function(t,e,r,n){var i,a="x"===r||"y"===r||"z"===r?r:n;if(Array.isArray(a)){if(i={type:M(n),_categories:[]},w.setConvert(i),"category"===i.type)for(var o=0;o<n.length;o++)i.d2c(n[o])}else i=w.getFromTrace(t,e,a);return i?{d2c:i.d2c,c2d:i.c2d}:"ids"===a?{d2c:E,c2d:E}:{d2c:T,c2d:T}};function T(t){return+t}function E(t){return String(t)}w.getDataToCoordFunc=function(t,e,r,n){return A(t,e,r,n).d2c},w.counterLetter=function(t){var e=t.charAt(0);return"x"===e?"y":"y"===e?"x":void 0},w.minDtick=function(t,e,r,n){-1===["log","category"].indexOf(t.type)&&n?void 0===t._minDtick?(t._minDtick=e,t._forceTick0=r):t._minDtick&&((t._minDtick/e+1e-6)%1<2e-6&&((r-t._forceTick0)/e%1+1.000001)%1<2e-6?(t._minDtick=e,t._forceTick0=r):((e/t._minDtick+1e-6)%1>2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},w.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,s,l,c,u,f,h,d=0,p=!1;if(t.range){var m=o.simpleMap(t.range,t.r2l);p=m[1]<m[0]}for("reversed"===t.autorange&&(p=!0,t.autorange=!0),e=0;e<t._min.length;e++)for(s=t._min[e],a=0;a<t._max.length;a++)h=(l=t._max[a]).val-s.val,f=t._length-s.pad-l.pad,h>0&&f>0&&h/f>d&&(c=s,u=l,d=h/f);if(n===i){var v=n-1,g=n+1;r="tozero"===t.rangemode?n<0?[v,0]:[0,g]:"nonnegative"===t.rangemode?[Math.max(0,v),Math.max(0,g)]:[v,g]}else d&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(c.val>=0&&(c={val:0,pad:0}),u.val<=0&&(u={val:0,pad:0})):"nonnegative"===t.rangemode&&(c.val-d*c.pad<0&&(c={val:0,pad:0}),u.val<0&&(u={val:1,pad:0})),d=(u.val-c.val)/(t._length-c.pad-u.pad)),r=[c.val-d*c.pad,u.val+d*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])))),p&&r.reverse(),o.simpleMap(r,t.l2r||Number)},w.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=w.getAutoRange(t),t._r=t.range.slice(),t._rl=o.simpleMap(t._r,t.r2l);var r=t._input;r.range=t.range.slice(),r.autorange=t.autorange}},w.saveRangeInitial=function(t,e){for(var r=w.list(t,"",!0),n=!1,i=0;i<r.length;i++){var a=r[i],o=void 0===a._rangeInitial,s=o||!(a.range[0]===a._rangeInitial[0]&&a.range[1]===a._rangeInitial[1]);(o&&!1===a.autorange||e&&s)&&(a._rangeInitial=a.range.slice(),n=!0)}return n},w.saveShowSpikeInitial=function(t,e){for(var r=w.list(t,"",!0),n=!1,i="on",a=0;a<r.length;a++){var o=r[a],s=void 0===o._showSpikeInitial,l=s||!(o.showspikes===o._showspikes);(s||e&&l)&&(o._showSpikeInitial=o.showspikes,n=!0),"on"!==i||o.showspikes||(i="off")}return t._fullLayout._cartesianSpikesEnabled=i,n},w.expand=function(t,e,r){if((t.autorange||!!o.nestedProperty(t,"rangeslider.autorange").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var n,a,s,l,c,u,f,d,p,m,v,g=e.length,y=r.padded?.05*t._length:0,b=r.tozero&&("linear"===t.type||"-"===t.type);y&&"domain"===t.constrain&&t._inputDomain&&(y*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0]));var x=k((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),_=k((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),w=k(r.vpadplus||r.vpad),M=k(r.vpadminus||r.vpad);for(n=0;n<6;n++)A(n);for(n=g-1;n>5;n--)A(n)}function k(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 A(r){if(l=e[r],i(l)){if(f=x(r)+y,d=_(r)+y,m=l-M(r),v=l+w(r),"log"===t.type&&m<v/10&&(m=v/10),c=t.c2l(m),u=t.c2l(v),b&&(c=Math.min(0,c),u=Math.max(0,u)),n(c)){for(p=!0,a=0;a<t._min.length&&p;a++)(s=t._min[a]).val<=c&&s.pad>=d?p=!1:s.val>=c&&s.pad<=d&&(t._min.splice(a,1),a--);p&&t._min.push({val:c,pad:b&&0===c?0:d})}if(n(u)){for(p=!0,a=0;a<t._max.length&&p;a++)(s=t._max[a]).val>=u&&s.pad>=f?p=!1:s.val<=u&&s.pad<=f&&(t._max.splice(a,1),a--);p&&t._max.push({val:u,pad:b&&0===u?0:f})}}function n(t){return i(t)&&Math.abs(t)<h}}},w.autoBin=function(t,e,r,n,a){var s,l,c=o.aggNums(Math.min,null,t),u=o.aggNums(Math.max,null,t);if(a||(a=e.calendar),"category"===e.type)return{start:c-.5,end:u+.5,size:1,_count:u-c+1};if(r)s=(u-c)/r;else{var f=o.distinctVals(t),h=Math.pow(10,Math.floor(Math.log(f.minDiff)/Math.LN10)),d=h*o.roundUp(f.minDiff/h,[.9,1.9,4.9,9.9],!0);s=Math.max(d,2*o.stdev(t)/Math.pow(t.length,n?.25:.4)),i(s)||(s=1)}l="log"===e.type?{type:"linear",range:[c,u]}:{type:e.type,range:o.simpleMap([c,u],e.c2r,0,a),calendar:a},w.setConvert(l),w.autoTicks(l,s);var p,v,g=w.tickIncrement(w.tickFirst(l),l.dtick,"reverse",a);if("number"==typeof l.dtick)p=(g=function(t,e,r,n,a){var o=0,s=0,l=0,c=0;function u(e){return(1+100*(e-t)/r.dtick)%100<2}for(var f=0;f<e.length;f++)e[f]%1==0?l++:i(e[f])||c++,u(e[f])&&o++,u(e[f]+r.dtick/2)&&s++;var h=e.length-c;if(l===h&&"date"!==r.type)r.dtick<1?t=n-.5*r.dtick:(t-=.5)+r.dtick<n&&(t+=r.dtick);else if(s<.1*h&&(o>.3*h||u(n)||u(a))){var d=r.dtick/2;t+=t+d<n?d:-d}return t}(g,t,l,c,u))+(v=1+Math.floor((u-g)/l.dtick))*l.dtick;else for("M"===l.dtick.charAt(0)&&(g=function(t,e,r,n,i){var a=o.findExactDates(e,i);if(a.exactDays>.8){var s=Number(r.substr(1));a.exactYears>.8&&s%12==0?t=w.tickIncrement(t,"M6","reverse")+1.5*m:a.exactMonths>.8?t=w.tickIncrement(t,"M1","reverse")+15.5*m:t-=m/2;var l=w.tickIncrement(t,r);if(l<=n)return l}return t}(g,t,l.dtick,c,a)),p=g,v=0;p<=u;)p=w.tickIncrement(p,l.dtick,!1,a),v++;return{start:e.c2r(g,0,a),end:e.c2r(p,0,a),size:l.dtick,_count:v}},w.calcTicks=function(t){var e=o.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=o.constrain(t._length/r,4,9)+1),"radialaxis"===t._name&&(n*=2)),"array"===t.tickmode&&(n*=100),w.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),R(t),"array"===t.tickmode)return function(t){var e,r,n=t.tickvals,i=t.ticktext,a=new Array(n.length),s=o.simpleMap(t.range,t.r2l),l=1.0001*s[0]-1e-4*s[1],c=1.0001*s[1]-1e-4*s[0],u=Math.min(l,c),f=Math.max(l,c),h=0;Array.isArray(i)||(i=[]);var d="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(r=0;r<n.length;r++)(e=d(n[r]))>u&&e<f&&(void 0===i[r]?a[h]=w.tickText(t,e):a[h]=N(t,e,String(i[r])),h++);h<n.length&&a.splice(h,n.length-h);return a}(t);t._tmin=w.tickFirst(t);var i=e[1]<e[0],a=[],s=1.0001*e[1]-1e-4*e[0];"category"===t.type&&(s=i?Math.max(-.5,s):Math.min(t._categories.length-.5,s));for(var l=null,c=Math.max(1e3,t._length||0),u=t._tmin;(i?u>=s:u<=s)&&!(a.length>c||u===l);u=w.tickIncrement(u,t.dtick,i,t.calendar))l=u,a.push(u);"angular"===t._id&&360===Math.abs(e[1]-e[0])&&a.pop(),t._tmax=a[a.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var f=new Array(a.length),h=0;h<a.length;h++)f[h]=w.tickText(t,a[h]);return t._inCalcTicks=!1,f};var S=[2,5,10],L=[1,2,3,6,12],C=[1,2,5,10,15,30],P=[1,2,3,7,14],z=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],O=[-.301,0,.301,.699,1],D=[15,30,45,90,180];function I(t,e,r){return e*o.roundUp(t/e,r)}function R(t){var e=t.dtick;if(t._tickexponent=0,i(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,""),a=n.length;if("M"===String(e).charAt(0))a>10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=m&&a<=10||e>=15*m)t._tickround="d";else if(e>=g&&a<=16||e>=v)t._tickround="M";else if(e>=y&&a<=19||e>=g)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20}}else if(i(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(c)>3&&(j(t.exponentformat)&&!B(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function N(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}w.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=o.dateTick0(t.calendar);var a=2*e;a>d?(e/=d,r=n(10),t.dtick="M"+12*I(e,r,S)):a>p?(e/=p,t.dtick="M"+I(e,1,L)):a>m?(t.dtick=I(e,m,P),t.tick0=o.dateTick0(t.calendar,!0)):a>v?t.dtick=I(e,v,L):a>g?t.dtick=I(e,g,C):a>y?t.dtick=I(e,y,C):(r=n(10),t.dtick=I(e,r,S))}else if("log"===t.type){t.tick0=0;var s=o.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(s[1]-s[0])<1){var l=1.5*Math.abs((s[1]-s[0])/e);e=Math.abs(Math.pow(10,s[1])-Math.pow(10,s[0]))/l,r=n(10),t.dtick="L"+I(e,r,S)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):"angular"===t._id?(t.tick0=0,r=1,t.dtick=I(e,r,D)):(t.tick0=0,r=n(10),t.dtick=I(e,r,S));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var c=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(c)}},w.tickIncrement=function(t,e,r,a){var s=r?-1:1;if(i(e))return t+s*e;var l=e.charAt(0),c=s*Number(e.substr(1));if("M"===l)return o.incrementMonth(t,c,a);if("L"===l)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===l){var u="D2"===e?O:z,f=t+.01*s,h=o.roundUp(o.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},w.tickFirst=function(t){var e=t.r2l||Number,r=o.simpleMap(t.range,e),a=r[1]<r[0],s=a?Math.floor:Math.ceil,l=1.0001*r[0]-1e-4*r[1],c=t.dtick,u=e(t.tick0);if(i(c)){var f=s((l-u)/c)*c+u;return"category"===t.type&&(f=o.constrain(f,0,t._categories.length-1)),f}var h=c.charAt(0),d=Number(c.substr(1));if("M"===h){for(var p,m,v,g=0,y=u;g<10;){if(((p=w.tickIncrement(y,c,a,t.calendar))-l)*(y-l)<=0)return a?Math.min(y,p):Math.max(y,p);m=(l-(y+p)/2)/(p-y),v=h+(Math.abs(Math.round(m))||1)*d,y=w.tickIncrement(y,v,m<0?!a:a,t.calendar),g++}return o.error("tickFirst did not converge",t),y}if("L"===h)return Math.log(s((Math.pow(10,l)-u)/d)*d+u)/Math.LN10;if("D"===h){var b="D2"===c?O:z,x=o.roundUp(o.mod(l,1),b,a);return Math.floor(l)+Math.log(n.round(Math.pow(10,x),1))/Math.LN10}throw"unrecognized dtick "+String(c)},w.tickText=function(t,e,r){var n,a,s=N(t,e),l="array"===t.tickmode,c=r||l,u="category"===t.type?t.d2l_noadd:t.d2l;if(l&&Array.isArray(t.ticktext)){var f=o.simpleMap(t.range,t.r2l),h=Math.abs(f[1]-f[0])/1e4;for(a=0;a<t.ticktext.length&&!(Math.abs(e-u(t.tickvals[a]))<h);a++);if(a<t.ticktext.length)return s.text=String(t.ticktext[a]),s}function d(n){var i;return void 0===n||(r?"none"===n:(i={first:t._tmin,last:t._tmax}[n],"all"!==n&&e!==i))}return n=r?"never":"none"!==t.exponentformat&&d(t.showexponent)?"hide":"","date"===t.type?function(t,e,r,n){var a=t._tickround,s=r&&t.hoverformat||w.getTickFormat(t);n&&(a=i(a)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[a]);var l,c=o.formatDate(e.x,s,a,t._dateFormat,t.calendar,t._extraFormat),u=c.indexOf("\n");-1!==u&&(l=c.substr(u+1),c=c.substr(0,u));n&&("00:00:00"===c||"00:00"===c?(c=l,l=""):8===c.length&&(c=c.replace(/:00$/,"")));l&&(r?"d"===a?c+=", "+l:c=l+(c?", "+c:""):t._inCalcTicks&&l===t._prevDateHead||(c+="<br>"+l,t._prevDateHead=l));e.text=c}(t,s,r,c):"log"===t.type?function(t,e,r,n,a){var s=t.dtick,l=e.x,c=t.tickformat;"never"===a&&(a="");!n||"string"==typeof s&&"L"===s.charAt(0)||(s="L3");if(c||"string"==typeof s&&"L"===s.charAt(0))e.text=U(Math.pow(10,l),t,a,n);else if(i(s)||"D"===s.charAt(0)&&o.mod(l+.01,1)<.1){var u=Math.round(l);-1!==["e","E","power"].indexOf(t.exponentformat)||j(t.exponentformat)&&B(u)?(e.text=0===u?1:1===u?"10":u>1?"10<sup>"+u+"</sup>":"10<sup>"+b+-u+"</sup>",e.fontSize*=1.25):(e.text=U(Math.pow(10,l),t,"","fakehover"),"D1"===s&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==s.charAt(0))throw"unrecognized dtick "+String(s);e.text=String(Math.round(Math.pow(10,o.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var f=String(e.text).charAt(0);"0"!==f&&"1"!==f||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,s,0,c,n):"category"===t.type?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,s):"angular"===t._id?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=U(e.x,t,i,n);else{var a=e.x/180;if(0===a)e.text="0";else{var s=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){var r=1;for(;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(s[1]>=100)e.text=U(o.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===s[1]?1===s[0]?e.text="\u03c0":e.text=s[0]+"\u03c0":e.text=["<sup>",s[0],"</sup>","\u2044","<sub>",s[1],"</sub>","\u03c0"].join(""),l&&(e.text=b+e.text)}}}}(t,s,r,c,n):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide");e.text=U(e.x,t,i,n)}(t,s,0,c,n),t.tickprefix&&!d(t.showtickprefix)&&(s.text=t.tickprefix+s.text),t.ticksuffix&&!d(t.showticksuffix)&&(s.text+=t.ticksuffix),s},w.hoverLabelText=function(t,e,r){if(r!==x&&r!==e)return w.hoverLabelText(t,e)+" - "+w.hoverLabelText(t,r);var n="log"===t.type&&e<=0,i=w.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":b+i:i};var F=["f","p","n","\u03bc","m","","k","M","G","T"];function j(t){return"SI"===t||"B"===t}function B(t){return t>14||t<-15}function U(t,e,r,n){var a=t<0,s=e._tickround,l=r||e.exponentformat||"B",c=e._tickexponent,u=w.getTickFormat(e),f=e.separatethousands;if(n){var h={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};R(h),s=(Number(h._tickround)||0)+4,c=h._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,b);var d,p=Math.pow(10,-s)/2;if("none"===l&&(c=0),(t=Math.abs(t))<p)t="0",a=!1;else{if(t+=p,c&&(t*=Math.pow(10,-c),s+=c),0===s)t=String(Math.floor(t));else if(s<0){t=(t=String(Math.round(t))).substr(0,t.length+s);for(var m=s;m<0;m++)t+="0"}else{var v=(t=String(t)).indexOf(".")+1;v&&(t=t.substr(0,v+s).replace(/\.?0+$/,""))}t=o.numSeparate(t,e._separators,f)}c&&"hide"!==l&&(j(l)&&B(c)&&(l="power"),d=c<0?b+-c:"power"!==l?"+"+c:String(c),"e"===l?t+="e"+d:"E"===l?t+="E"+d:"power"===l?t+="\xd710<sup>"+d+"</sup>":"B"===l&&9===c?t+="B":j(l)&&(t+=F[c/3+5]));return a?b+t:t}function V(t,e){for(var r=0;r<e.length;r++)-1===t.indexOf(e[r])&&t.push(e[r])}function q(t,e,r){var n,i,a=[],s=[],l=t.layout;for(n=0;n<e.length;n++)a.push(w.getFromId(t,e[n]));for(n=0;n<r.length;n++)s.push(w.getFromId(t,r[n]));var c=Object.keys(a[0]),u=["anchor","domain","overlaying","position","side","tickangle"],f=["linear","log"];for(n=0;n<c.length;n++){var h=c[n],d=a[0][h],p=s[0][h],m=!0,v=!1,g=!1;if("_"!==h.charAt(0)&&"function"!=typeof d&&-1===u.indexOf(h)){for(i=1;i<a.length&&m;i++){var y=a[i][h];"type"===h&&-1!==f.indexOf(d)&&-1!==f.indexOf(y)&&d!==y?v=!0:y!==d&&(m=!1)}for(i=1;i<s.length&&m;i++){var b=s[i][h];"type"===h&&-1!==f.indexOf(p)&&-1!==f.indexOf(b)&&p!==b?g=!0:s[i][h]!==p&&(m=!1)}m&&(v&&(l[a[0]._name].type="linear"),g&&(l[s[0]._name].type="linear"),H(l,h,a,s,t._fullLayout._dfltTitle))}}for(n=0;n<t._fullLayout.annotations.length;n++){var x=t._fullLayout.annotations[n];-1!==e.indexOf(x.xref)&&-1!==r.indexOf(x.yref)&&o.swapAttrs(l.annotations[n],["?"])}}function H(t,e,r,n,i){var a,s=o.nestedProperty,l=s(t[r[0]._name],e).get(),c=s(t[n[0]._name],e).get();for("title"===e&&(l===i.x&&(l=i.y),c===i.y&&(c=i.x)),a=0;a<r.length;a++)s(t,r[a]._name+"."+e).set(c);for(a=0;a<n.length;a++)s(t,n[a]._name+"."+e).set(l)}w.getTickFormat=function(t){var e,r,n,i,a,o,s;function l(t){return"string"!=typeof t?t:Number(t.replace("M",""))*p}function c(t,e){var r=["L","D"];if(typeof t==typeof e){if("number"==typeof t)return t-e;var n=r.indexOf(t.charAt(0)),i=r.indexOf(e.charAt(0));return n===i?Number(t.replace(/(L|D)/g,""))-Number(e.replace(/(L|D)/g,"")):n-i}return"number"==typeof t?1:-1}function u(t,e){var r=null===e[0],n=null===e[1],i=c(t,e[0])>=0,a=c(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e<t.tickformatstops.length;e++)if(n=t.dtick,i=t.tickformatstops[e].dtickrange,a=void 0,void 0,void 0,a=l||function(t){return t},o=i[0],s=i[1],(!o&&"number"!=typeof o||a(o)<=a(n))&&(!s&&"number"!=typeof s||a(s)>=a(n))){r=t.tickformatstops[e];break}break;case"log":for(e=0;e<t.tickformatstops.length;e++)if(u(t.dtick,t.tickformatstops[e].dtickrange)){r=t.tickformatstops[e];break}}return r?r.value:t.tickformat},w.getSubplots=function(t,e){var r=t._fullLayout._subplots,n=r.cartesian.concat(r.gl2d||[]),i=e?w.findSubplotsWithAxis(n,e):n;return i.sort(function(t,e){var r=t.substr(1).split("y"),n=e.substr(1).split("y");return r[0]===n[0]?+r[1]-+n[1]:+r[0]-+n[0]}),i},w.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},w.makeClipPaths=function(t){var e,r,i=t._fullLayout,a={_offset:0,_length:i.width,_id:""},o={_offset:0,_length:i.height,_id:""},s=w.list(t,"x",!0),l=w.list(t,"y",!0),c=[];for(e=0;e<s.length;e++)for(c.push({x:s[e],y:o}),r=0;r<l.length;r++)0===e&&c.push({x:a,y:l[r]}),c.push({x:s[e],y:l[r]});var u=i._clips.selectAll(".axesclip").data(c,function(t){return t.x._id+t.y._id});u.enter().append("clipPath").classed("axesclip",!0).attr("id",function(t){return"clip"+i._uid+t.x._id+t.y._id}).append("rect"),u.exit().remove(),u.each(function(t){n.select(this).select("rect").attr({x:t.x._offset||0,y:t.y._offset||0,width:t.x._length||1,height:t.y._length||1})})},w.doTicks=function(t,e,r){var f,h=t._fullLayout,d=!1;if("object"==typeof e)e=(f=e)._id,d=!0;else if(f=w.getFromId(t,e),"redraw"===e&&h._paper.selectAll("g.subplot").each(function(t){var e=h._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(),h._infolayer.select(".g-"+r._id+"title").remove(),h._infolayer.select(".g-"+n._id+"title").remove()}),!e||"redraw"===e)return o.syncOrAsync(w.list(t,"",!0).map(function(r){return function(){if(r._id){var n=w.doTicks(t,r._id);return"redraw"===e&&(r._r=r.range.slice(),r._rl=o.simpleMap(r._r,r.r2l)),n}}}));f.setScale();var p,m,v,g,y,b=e.charAt(0),x=w.counterLetter(e),M=w.calcTicks(f),A=function(t){return[t.text,t.x,f.mirror,t.font,t.fontSize,t.fontColor].join("_")},T=e+"tick",E=e+"grid",S=e+"zl",L=(f.linewidth||1)/2,C="outside"===f.ticks?f.ticklen:0,P=0,z=u.crispRound(t,f.gridwidth,1),O=u.crispRound(t,f.zerolinewidth,z),D=u.crispRound(t,f.tickwidth,1);if(f._counterangle&&"outside"===f.ticks){var I=f._counterangle*Math.PI/180;C=f.ticklen*Math.cos(I)+1,P=f.ticklen*Math.sin(I)}if(f.showticklabels&&("outside"===f.ticks||f.showline)&&(C+=.2*f.tickfont.size),"x"===b)p=["bottom","top"],m=f._transfn||function(t){return"translate("+(f._offset+f.l2p(t.x))+",0)"},v=function(t,e){if(f._counterangle){var r=f._counterangle*Math.PI/180;return"M0,"+t+"l"+Math.sin(r)*e+","+Math.cos(r)*e}return"M0,"+t+"v"+e};else if("y"===b)p=["left","right"],m=f._transfn||function(t){return"translate(0,"+(f._offset+f.l2p(t.x))+")"},v=function(t,e){if(f._counterangle){var r=f._counterangle*Math.PI/180;return"M"+t+",0l"+Math.cos(r)*e+","+-Math.sin(r)*e}return"M"+t+",0h"+e};else{if("angular"!==e)return void o.warn("Unrecognized doTicks axis:",e);p=["left","right"],m=f._transfn,v=function(t,e){return"M"+t+",0h"+e}}var R=f.side||p[0],N=[-1,1,R===p[1]?1:-1];if("inside"!==f.ticks==("x"===b)&&(N=N.map(function(t){return-t})),f.visible){f._tickFilter&&(M=M.filter(f._tickFilter));var F=M.filter(G);if("angular"===f._id&&(F=M),d){if(Y(f._axislayer,v(f._pos+L*N[2],N[2]*f.ticklen)),f._counteraxis)J({gridlayer:f._gridlayer,zerolinelayer:f._zerolinelayer},f._counteraxis);return W(f._axislayer,f._pos)}if(h._has("cartesian")){var j={};(g=w.getSubplots(t,f)).map(function(t){var e=h._plots[t],r=e[x+"axis"],n=r._mainAxis._id;j[n]||(j[n]=1,J(e,r,t))});var B=f._mainSubplot,U=h._plots[B],V=[];if(f.ticks){var q=N[2],H=v(f._mainLinePosition+L*q,q*f.ticklen);f._anchorAxis&&f.mirror&&!0!==f.mirror&&(H+=v(f._mainMirrorPosition-L*q,-q*f.ticklen)),Y(U[b+"axislayer"],H),V=Object.keys(f._linepositions)}return V.map(function(t){var e=h._plots[t][b+"axislayer"],r=f._linepositions[t]||[];function n(t){var e=N[t];return v(r[t]+L*e,e*f.ticklen)}Y(e,n(0)+n(1))}),W(U[b+"axislayer"],f._mainLinePosition)}}function G(t){var e=f.l2p(t.x);return e>1&&e<f._length-1}function Y(t,e){var r=t.selectAll("path."+T).data("inside"===f.ticks?F:M,A);e&&f.ticks?(r.enter().append("path").classed(T,1).classed("ticks",1).classed("crisp",1).call(c.stroke,f.tickcolor).style("stroke-width",D+"px").attr("d",e),r.attr("transform",m),r.exit().remove()):r.remove()}function W(r,a){var l,c,d,p,v,x=r.selectAll("g."+T).data(M,A);if(!i(a))return x.remove(),void X();if(!f.showticklabels)return x.remove(),X(),void z();"x"===b?(l=function(t){return t.dx+P*v},p=a+(C+L)*(v="bottom"===R?1:-1),c=function(t){return t.dy+p+t.fontSize*("bottom"===R?1:-.2)},d=function(t){return i(t)&&0!==t&&180!==t?t*v<0?"end":"start":"middle"}):"y"===b?(v="right"===R?1:-1,c=function(t){return t.dy+t.fontSize*_-P*v},l=function(t){return t.dx+a+(C+L+(90===Math.abs(f.tickangle)?t.fontSize/2:0))*v},d=function(t){return i(t)&&90===Math.abs(t)?"middle":"right"===R?"start":"end"}):"angular"===e&&(f._labelShift=P,f._labelStandoff=C,f._pad=L,l=f._labelx,c=f._labely,d=f._labelanchor);var w=0,k=0,E=[];function S(t,e){t.each(function(t){var r=d(e,t),a=n.select(this),o=a.select(".text-math-group"),s=m(t)+(i(e)&&0!=+e?" rotate("+e+","+l(t)+","+(c(t)-t.fontSize/2)+")":"");if(o.empty())a.select("text").attr({transform:s,"text-anchor":r});else{var f=u.bBox(o.node()).width*{end:-.5,start:.5}[r];o.attr("transform",s+(f?"translate("+f+",0)":""))}})}function z(){if(f.showticklabels){var e=t.getBoundingClientRect(),n=r.node().getBoundingClientRect();f._boundingBox={width:n.width,height:n.height,left:n.left-e.left,right:n.right-e.left,top:n.top-e.top,bottom:n.bottom-e.top}}else{var i,a=h._size;"x"===b?(i="free"===f.anchor?a.t+a.h*(1-f.position):a.t+a.h*(1-f._anchorAxis.domain[{bottom:0,top:1}[f.side]]),f._boundingBox={top:i,bottom:i,left:f._offset,right:f._offset+f._length,width:f._length,height:0}):(i="free"===f.anchor?a.l+a.w*f.position:a.l+a.w*f._anchorAxis.domain[{left:0,right:1}[f.side]],f._boundingBox={left:i,right:i,bottom:f._offset+f._length,top:f._offset,height:f._length,width:0})}if(g){var o=f._counterSpan=[1/0,-1/0];for(y=0;y<g.length;y++){var s=h._plots[g[y]]["x"===b?"yaxis":"xaxis"];l(o,[s._offset,s._offset+s._length])}"free"===f.anchor&&l(o,"x"===b?[f._boundingBox.bottom,f._boundingBox.top]:[f._boundingBox.right,f._boundingBox.left])}function l(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.max(t[1],e[1])}}x.enter().append("g").classed(T,1).append("text").attr("text-anchor","middle").each(function(e){var r=n.select(this),i=t._promises.length;r.call(s.positionText,l(e),c(e)).call(u.font,e.font,e.fontSize,e.fontColor).text(e.text).call(s.convertToTspans,t),(i=t._promises[i])?E.push(t._promises.pop().then(function(){S(r,f.tickangle)})):S(r,f.tickangle)}),x.exit().remove(),x.each(function(t){w=Math.max(w,t.fontSize)}),"angular"===e&&x.each(function(t){n.select(this).select("text").call(s.positionText,l(t),c(t))}),S(x,f._lastangle||f.tickangle);var O=o.syncOrAsync([function(){return E.length&&Promise.all(E)},function(){if(S(x,f.tickangle),"x"===b&&!i(f.tickangle)&&("log"!==f.type||"D"!==String(f.dtick).charAt(0))){var t=[];for(x.each(function(e){var r=n.select(this),i=r.select(".text-math-group"),a=f.l2p(e.x);i.empty()&&(i=r.select("text"));var o=u.bBox(i.node());t.push({top:0,bottom:10,height:10,left:a-o.width/2,right:a+o.width/2+2,width:o.width+2})}),y=0;y<t.length-1;y++)if(o.bBoxIntersect(t[y],t[y+1])){k=30;break}k&&(Math.abs((M[M.length-1].x-M[0].x)*f._m)/(M.length-1)<2.5*w&&(k=90),S(x,k)),f._lastangle=k}return X(),e+" done"},z]);return O&&O.then&&t._promises.push(O),O}function X(){if(!r){var i,a,o,s,c=k.getFromId(t,e),f=n.select(t).selectAll("g."+e+"tick"),d={selection:f,side:c.side},p=e.charAt(0),m=t._fullLayout._size,v=c.titlefont.size;if(f.size()){var g=u.getTranslate(f.node().parentNode);d.offsetLeft=g.x,d.offsetTop=g.y}var y=10+1.5*v+(c.linewidth?c.linewidth-1:0);"x"===p?(a="free"===c.anchor?{_offset:m.t+(1-(c.position||0))*m.h,_length:0}:k.getFromId(t,c.anchor),o=c._offset+c._length/2,s="top"===c.side?-y-v*(c.showticklabels?1:0):a._length+y+v*(c.showticklabels?1.5:.5),s+=a._offset,c.rangeslider&&c.rangeslider.visible&&c._boundingBox&&(s+=(h.height-h.margin.b-h.margin.t)*c.rangeslider.thickness+c._boundingBox.height),d.side||(d.side="bottom")):(a="free"===c.anchor?{_offset:m.l+(c.position||0)*m.w,_length:0}:k.getFromId(t,c.anchor),s=c._offset+c._length/2,o="right"===c.side?a._length+y+v*(c.showticklabels?1:.5):-y-v*(c.showticklabels?.5:0),o+=a._offset,i={rotate:"-90",offset:0},d.side||(d.side="left")),l.draw(t,e+"title",{propContainer:c,propName:c._name+".title",placeholder:h._dfltTitle[p],avoid:d,transform:i,attributes:{x:o,y:s,"text-anchor":"middle"}})}}function Z(t,e){return!0===t.visible&&t.xaxis+t.yaxis===e&&(!(!a.traceIs(t,"bar")||t.orientation!=={x:"h",y:"v"}[b])||t.fill&&t.fill.charAt(t.fill.length-1)===b)}function J(r,i,a){var s=r.gridlayer.selectAll("."+e),l=r.zerolinelayer,u=r["hidegrid"+b]?[]:F,h=f._gridpath||("x"===b?"M0,"+i._offset+"v":"M"+i._offset+",0h")+i._length,d=s.selectAll("path."+E).data(!1===f.showgrid?[]:u,A);if(d.enter().append("path").classed(E,1).classed("crisp",1).attr("d",h).each(function(t){f.zeroline&&("linear"===f.type||"-"===f.type)&&Math.abs(t.x)<f.dtick/100&&n.select(this).remove()}),d.attr("transform",m).call(c.stroke,f.gridcolor||"#ddd").style("stroke-width",z+"px"),"function"==typeof h&&d.attr("d",h),d.exit().remove(),l){for(var p=!1,v=0;v<t._fullData.length;v++)if(Z(t._fullData[v],a)){p=!0;break}var g=o.simpleMap(f.range,f.r2l),y=g[0]*g[1]<=0&&f.zeroline&&("linear"===f.type||"-"===f.type)&&u.length&&(p||G({x:0})||!f.showline),x=l.selectAll("path."+S).data(y?[{x:0,id:e}]:[]);x.enter().append("path").classed(S,1).classed("zl",1).classed("crisp",1).attr("d",h).each(function(){l.selectAll("path").sort(function(t,e){return k.idSort(t.id,e.id)})}),x.attr("transform",m).call(c.stroke,f.zerolinecolor||c.defaultLine).style("stroke-width",O+"px"),x.exit().remove()}}},w.swap=function(t,e){for(var r=function(t,e){var r,n,i=[];for(r=0;r<e.length;r++){var a=[],o=t._fullData[e[r]].xaxis,s=t._fullData[e[r]].yaxis;if(o&&s){for(n=0;n<i.length;n++)-1===i[n].x.indexOf(o)&&-1===i[n].y.indexOf(s)||a.push(n);if(a.length){var l,c=i[a[0]];if(a.length>1)for(n=1;n<a.length;n++)l=i[a[n]],V(c.x,l.x),V(c.y,l.y);V(c.x,[o]),V(c.y,[s])}else i.push({x:[o],y:[s]})}}return i}(t,e),n=0;n<r.length;n++)q(t,r[n].x,r[n].y)}},{"../../components/color":598,"../../components/drawing":623,"../../components/titles":689,"../../constants/alignment":696,"../../constants/numerical":702,"../../lib":724,"../../lib/svg_text_utils":747,"../../registry":854,"./axis_autotype":771,"./axis_ids":773,"./set_convert":789,d3:128,"fast-isnumeric":140}],771:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM;e.exports=function(t,e){return function(t,e){for(var r,a=0,o=0,s=Math.max(1,(t.length-1)/1e3),l=0;l<t.length;l+=s)r=t[Math.round(l)],i.isDateTime(r,e)&&(a+=1),n(r)&&(o+=1);return a>2*o}(t,e)?"date":function(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,o=0,s=0;s<t.length;s+=r)e=t[Math.round(s)],i.cleanNumber(e)!==a?n++:"string"==typeof e&&""!==e&&"None"!==e&&o++;return o>2*n}(t)?"category":function(t){if(!t)return!1;for(var e=0;e<t.length;e++)if(n(t[e]))return!0;return!1}(t)?"linear":"-"}},{"../../constants/numerical":702,"../../lib":724,"fast-isnumeric":140}],772:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("./layout_attributes"),o=t("./tick_value_defaults"),s=t("./tick_mark_defaults"),l=t("./tick_label_defaults"),c=t("./category_order_defaults"),u=t("./line_grid_defaults"),f=t("./set_convert"),h=t("./ordered_categories");e.exports=function(t,e,r,d,p){var m=d.letter,v=d.font||{},g=r("visible",!d.cheateronly),y=e.type;"date"===y&&n.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",d.calendar);if(f(e,p),r("autorange",!e.isValidRange(t.range))&&r("rangemode"),r("range"),e.cleanRange(),c(t,e,r),e._initialCategories="category"===y?h(m,e.categoryorder,e.categoryarray,d.data):[],"category"===y||d.noHover||r("hoverformat"),!g)return e;var b=r("color"),x=b===t.color?b:v.color;return r("title",p._dfltTitle[m]),i.coerceFont(r,"titlefont",{family:v.family,size:Math.round(1.2*v.size),color:x}),o(t,e,r,y),l(t,e,r,y,d),s(t,e,r,d),u(t,e,r,{dfltColor:b,bgColor:d.bgColor,showGrid:d.showGrid,attributes:a}),(e.showline||e.ticks)&&r("mirror"),e}},{"../../lib":724,"../../registry":854,"./category_order_defaults":774,"./layout_attributes":782,"./line_grid_defaults":784,"./ordered_categories":785,"./set_convert":789,"./tick_label_defaults":790,"./tick_mark_defaults":791,"./tick_value_defaults":792}],773:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./constants");r.id2name=function(t){if("string"==typeof t&&t.match(i.AX_ID_PATTERN)){var e=t.substr(1);return"1"===e&&(e=""),t.charAt(0)+"axis"+e}},r.name2id=function(t){if(t.match(i.AX_NAME_PATTERN)){var e=t.substr(5);return"1"===e&&(e=""),t.charAt(0)+e}},r.cleanId=function(t,e){if(t.match(i.AX_ID_PATTERN)&&(!e||t.charAt(0)===e)){var r=t.substr(1).replace(/^0+/,"");return"1"===r&&(r=""),t.charAt(0)+r}},r.list=function(t,e,n){var i=t._fullLayout;if(!i)return[];var a,o=r.listIds(t,e),s=new Array(o.length);for(a=0;a<o.length;a++){var l=o[a];s[a]=i[l.charAt(0)+"axis"+l.substr(1)]}if(!n){var c=i._subplots.gl3d||[];for(a=0;a<c.length;a++){var u=i[c[a]];e?s.push(u[e+"axis"]):s.push(u.xaxis,u.yaxis,u.zaxis)}}return s},r.listIds=function(t,e){var r=t._fullLayout;if(!r)return[];var n=r._subplots;return e?n[e+"axis"]:n.xaxis.concat(n.yaxis)},r.getFromId=function(t,e,n){var 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,i){var a=t._fullLayout,o=null;if(n.traceIs(e,"gl3d")){var s=e.scene;"scene"===s.substr(0,5)&&(o=a[s][i+"axis"])}else o=r.getFromId(t,e[i+"axis"]||i);return o},r.idSort=function(t,e){var r=t.charAt(0),n=e.charAt(0);return r!==n?r>n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)}},{"../../registry":854,"./constants":775}],774:[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")}}},{}],775:[function(t,e,r){"use strict";var n=t("../../lib").counterRegex;e.exports={idRegex:{x:n("x"),y:n("y")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","maplayer","barlayer","carpetlayer","violinlayer","boxlayer","scatterlayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib":724}],776:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./axis_ids").id2name;e.exports=function(t,e,r,a,o){var s=o._axisConstraintGroups,l=e._id,c=l.charAt(0);if(!e.fixedrange&&(r("constrain"),n.coerce(t,e,{constraintoward:{valType:"enumerated",values:"x"===c?["left","center","right"]:["bottom","middle","top"],dflt:"x"===c?"center":"middle"}},"constraintoward"),t.scaleanchor)){var u=function(t,e,r,n){var a,o,s,l,c=n[i(e)].type,u=[];for(o=0;o<r.length;o++)(s=r[o])!==e&&((l=n[i(s)]).type!==c||l.fixedrange||u.push(s));for(a=0;a<t.length;a++)if(t[a][e]){var f=t[a],h=[];for(o=0;o<u.length;o++)s=u[o],f[s]||h.push(s);return{linkableAxes:h,thisGroup:f}}return{linkableAxes:u,thisGroup:null}}(s,l,a,o),f=n.coerce(t,e,{scaleanchor:{valType:"enumerated",values:u.linkableAxes}},"scaleanchor");if(f){var h=r("scaleratio");h||(h=e.scaleratio=1),function(t,e,r,n,i){var a,o,s,l,c;null===e?((e={})[r]=1,c=t.length,t.push(e)):c=t.indexOf(e);var u=Object.keys(e);for(a=0;a<t.length;a++)if(s=t[a],a!==c&&s[n]){var f=s[n];for(o=0;o<u.length;o++)l=u[o],s[l]=f*i*e[l];return void t.splice(c,1)}if(1!==i)for(o=0;o<u.length;o++)e[u[o]]*=i;e[n]=1}(s,u.thisGroup,l,f,h)}else-1!==a.indexOf(t.scaleanchor)&&n.warn("ignored "+e._name+'.scaleanchor: "'+t.scaleanchor+'" to avoid either an infinite loop and possibly inconsistent scaleratios, or because the targetaxis has fixed range.')}}},{"../../lib":724,"./axis_ids":773}],777:[function(t,e,r){"use strict";var n=t("./axis_ids").id2name,i=t("./scale_zoom"),a=t("../../constants/numerical").ALMOST_EQUAL,o=t("../../constants/alignment").FROM_BL;function s(t,e){var r=t._inputDomain,n=o[t.constraintoward],i=r[0]+(r[1]-r[0])*n;t.domain=t._input.domain=[i+(r[0]-i)/e,i+(r[1]-i)/e]}r.enforce=function(t){var e,r,o,l,c,u,f,h=t._fullLayout,d=h._axisConstraintGroups||[];for(e=0;e<d.length;e++){var p=d[e],m=Object.keys(p),v=1/0,g=0,y=1/0,b={},x={},_=!1;for(r=0;r<m.length;r++)x[o=m[r]]=l=h[n(o)],l._inputDomain?l.domain=l._inputDomain.slice():l._inputDomain=l.domain.slice(),l._inputRange||(l._inputRange=l.range.slice()),l.setScale(),b[o]=c=Math.abs(l._m)/p[o],v=Math.min(v,c),"domain"!==l.constrain&&l._constraintShrinkable||(y=Math.min(y,c)),delete l._constraintShrinkable,g=Math.max(g,c),"domain"===l.constrain&&(_=!0);if(!(v>a*g)||_)for(r=0;r<m.length;r++)if(c=b[o=m[r]],u=(l=x[o]).constrain,c!==y||"domain"===u)if(f=c/y,"range"===u)i(l,f);else{var w=l._inputDomain,M=(l.domain[1]-l.domain[0])/(w[1]-w[0]),k=(l.r2l(l.range[1])-l.r2l(l.range[0]))/(l.r2l(l._inputRange[1])-l.r2l(l._inputRange[0]));if((f/=M)*k<1){l.domain=l._input.domain=w.slice(),i(l,f);continue}if(k<1&&(l.range=l._input.range=l._inputRange.slice(),f*=k),l.autorange&&l._min.length&&l._max.length){var A=l.r2l(l.range[0]),T=l.r2l(l.range[1]),E=(A+T)/2,S=E,L=E,C=Math.abs(T-E),P=E-C*f*1.0001,z=E+C*f*1.0001;s(l,f),l.setScale();var O,D,I=Math.abs(l._m);for(D=0;D<l._min.length;D++)(O=l._min[D].val-l._min[D].pad/I)>P&&O<S&&(S=O);for(D=0;D<l._max.length;D++)(O=l._max[D].val+l._max[D].pad/I)<z&&O>L&&(L=O);f/=(L-S)/(2*C),S=l.l2r(S),L=l.l2r(L),l.range=l._input.range=A<T?[S,L]:[L,S]}s(l,f)}}},r.clean=function(t,e){if(e._inputDomain){for(var r=!1,n=e._id,i=t._fullLayout._axisConstraintGroups,a=0;a<i.length;a++)if(i[a][n]){r=!0;break}r&&"domain"===e.constrain||(e._input.domain=e.domain=e._inputDomain,delete e._inputDomain)}}},{"../../constants/alignment":696,"../../constants/numerical":702,"./axis_ids":773,"./scale_zoom":787}],778:[function(t,e,r){"use strict";var n=t("d3"),i=t("tinycolor2"),a=t("has-passive-events"),o=t("../../plotly"),s=t("../../registry"),l=t("../../lib"),c=t("../../lib/svg_text_utils"),u=t("../../components/color"),f=t("../../components/drawing"),h=t("../../components/fx"),d=t("../../lib/setcursor"),p=t("../../components/dragelement"),m=t("../../constants/alignment").FROM_TL,v=t("../plots"),g=t("./axes").doTicks,y=t("./axis_ids").getFromId,b=t("./select"),x=t("./scale_zoom"),_=t("./constants"),w=_.MINDRAG,M=_.MINZOOM,k=!0;function A(t,e,r,n){var i=t.draglayer.selectAll("."+r).data([0]);return i.enter().append(e).classed("drag",!0).classed(r,!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",t.id),i.call(d,n),i.node()}function T(t,e,r,i,a,o,s){var l=A(t,"rect",e,r);return n.select(l).call(f.setRect,i,a,o,s),l}function E(t,e){for(var r=0;r<t.length;r++)if(!t[r].fixedrange)return e;return""}function S(t,e,r,n,i){var a,o,s,l;for(a=0;a<t.length;a++)(o=t[a]).fixedrange||(s=o._rl[0],l=o._rl[1]-s,o.range=[o.l2r(s+l*e),o.l2r(s+l*r)],n[o._name+".range[0]"]=o.range[0],n[o._name+".range[1]"]=o.range[1]);if(i&&i.length){var c=(e+(1-r))/2;S(i,c,1-c,n)}}function L(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 C(t){return 1-(t>=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function P(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",i+"Z")}function z(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function O(t){t.selectAll(".select-outline").remove()}function D(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),I(t,e,i,a)}function I(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function R(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function N(t){k&&t.data&&t._context.showTips&&(l.notifier(l._(t,"Double-click to zoom back out"),"long"),k=!1)}function F(t){return"lasso"===t||"select"===t}function j(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,M)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function B(t,e){if(a){var r=void 0!==t.onwheel?"wheel":"mousewheel";t._onwheel&&t.removeEventListener(r,t._onwheel),t._onwheel=e,t.addEventListener(r,e,{passive:!1})}else void 0!==t.onwheel?t.onwheel=e:void 0!==t.onmousewheel&&(t.onmousewheel=e)}e.exports={makeDragBox:function(t,e,r,a,u,d,k,A){var I,U,V,q,H,G,Y,W,X,Z,J,K,Q,$=t._fullLayout,tt=t._fullLayout._zoomlayer,et=k+A==="nsew",rt=1===(k+A).length;function nt(){U=[e.xaxis],V=[e.yaxis];var r=U[0],n=V[0];G=r._length,Y=n._length;var i,a,o=$._axisConstraintGroups,s=[r._id],c=[n._id];I=[e].concat(k&&A?e.overlays:[]);for(var u=1;u<I.length;u++){var f=I[u].xaxis,h=I[u].yaxis;-1===U.indexOf(f)&&(U.push(f),s.push(f._id)),-1===V.indexOf(h)&&(V.push(h),c.push(h._id))}W=E(U,A),X=E(V,k),i=X+W,a=$.dragmode,Z=i?"nsew"===i?"pan"===a?"move":"crosshair":i.toLowerCase()+"-resize":"pointer",q=r._offset,H=n._offset;var d=function(t,e,r){var n,i,a,o,s,c,u=!1,f={},h={};for(n=0;n<t.length;n++){for(o=t[n],i=0;i<e.length;i++)if(o[e[i]]){for(s in o)-1===("x"===s.charAt(0)?e:r).indexOf(s)&&(f[s]=1);for(a=0;a<r.length;a++)o[r[a]]&&(u=!0)}for(i=0;i<r.length;i++)if(o[r[i]])for(c in o)-1===("x"===c.charAt(0)?e:r).indexOf(c)&&(h[c]=1)}return u&&(l.extendFlat(f,h),h={}),{x:f,y:h,xy:u}}(o,s,c);for(var p in J=d.xy,K=[],d.x)K.push(y(t,p));for(var m in Q=[],d.y)Q.push(y(t,m))}nt();var it=T(e,k+A+"drag",Z,r,a,u,d),at=!X&&!W;if(at&&!et)return it.onmousedown=null,it.style.pointerEvents="none",it;var ot,st,lt,ct,ut,ft,ht,dt,pt,mt={element:it,gd:t,plotinfo:e,prepFn:function(e,r,n){var a=t._fullLayout.dragmode;at||(et?e.shiftKey?"pan"===a?a="zoom":F(a)||(a="pan"):e.ctrlKey&&(a="pan"):a="pan"),mt.minDrag="lasso"===a?1:void 0,F(a)?(mt.xaxes=U,mt.yaxes=V,b(e,r,n,mt,a)):at?O(tt):"zoom"===a?(mt.moveFn=gt,mt.doneFn=yt,mt.minDrag=1,function(e,r,n){var a=it.getBoundingClientRect();ot=r-a.left,st=n-a.top,lt={l:ot,r:ot,w:0,t:st,b:st,h:0},ct=t._hmpixcount?t._hmlumcount/t._hmpixcount:i(t._fullLayout.plot_bgcolor).getLuminance(),ft=!1,ht="xy",dt=P(tt,ct,q,H,ut="M0,0H"+G+"V"+Y+"H0V0"),pt=z(tt,q,H),O(tt)}(0,r,n)):"pan"===a&&(mt.moveFn=Mt,mt.doneFn=At,O(tt))},clickFn:function(r,i){if(R(t),2!==r||rt||function(){if(!t._transitioningWithDuration){var e,r,n,i=t._context.doubleClick,a=(W?U:[]).concat(X?V:[]),s={};if("reset+autosize"===i)for(i="autosize",r=0;r<a.length;r++)if((e=a[r])._rangeInitial&&(e.range[0]!==e._rangeInitial[0]||e.range[1]!==e._rangeInitial[1])||!e._rangeInitial&&!e.autorange){i="reset";break}if("autosize"===i)for(r=0;r<a.length;r++)(e=a[r]).fixedrange||(s[e._name+".autorange"]=!0);else if("reset"===i)for((W||J)&&(a=a.concat(K)),X&&!J&&(a=a.concat(Q)),J&&(W?X||(a=a.concat(V)):a=a.concat(U)),r=0;r<a.length;r++)(e=a[r])._rangeInitial?(n=e._rangeInitial,s[e._name+".range[0]"]=n[0],s[e._name+".range[1]"]=n[1]):s[e._name+".autorange"]=!0;t.emit("plotly_doubleclick",null),o.relayout(t,s)}}(),et)h.click(t,i,e.id);else if(1===r&&rt){var a=k?V[0]:U[0],s="s"===k||"w"===A?0:1,l=a._name+".range["+s+"]",u=function(t,e){var r,i=t.range[e],a=Math.abs(i-t.range[1-e]);return"date"===t.type?i:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,i))):(r=Math.floor(Math.log(Math.abs(i))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,n.format("."+String(r)+"g")(i))}(a,s),f="left",d="middle";if(a.fixedrange)return;k?(d="n"===k?"top":"bottom","right"===a.side&&(f="right")):"e"===A&&(f="right"),t._context.showAxisRangeEntryBoxes&&n.select(it).call(c.makeEditable,{gd:t,immediate:!0,background:$.paper_bgcolor,text:String(u),fill:a.tickfont?a.tickfont.color:"#444",horizontalAlign:f,verticalAlign:d}).on("edit",function(e){var r=a.d2r(e);void 0!==r&&o.relayout(t,l,r)})}}};p.init(mt);var vt={};function gt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(G,e+ot)),i=Math.max(0,Math.min(Y,r+st)),a=Math.abs(n-ot),o=Math.abs(i-st);function s(){ht="",lt.r=lt.l,lt.t=lt.b,pt.attr("d","M0,0Z")}lt.l=Math.min(ot,n),lt.r=Math.max(ot,n),lt.t=Math.min(st,i),lt.b=Math.max(st,i),J?a>M||o>M?(ht="xy",a/G>o/Y?(o=a*Y/G,st>i?lt.t=st-o:lt.b=st+o):(a=o*G/Y,ot>n?lt.l=ot-a:lt.r=ot+a),pt.attr("d",j(lt))):s():!X||o<Math.min(Math.max(.6*a,w),M)?a<w?s():(lt.t=0,lt.b=Y,ht="x",pt.attr("d",function(t,e){return"M"+(t.l-.5)+","+(e-M-.5)+"h-3v"+(2*M+1)+"h3ZM"+(t.r+.5)+","+(e-M-.5)+"h3v"+(2*M+1)+"h-3Z"}(lt,st))):!W||a<Math.min(.6*o,M)?(lt.l=0,lt.r=G,ht="y",pt.attr("d",function(t,e){return"M"+(e-M-.5)+","+(t.t-.5)+"v-3h"+(2*M+1)+"v3ZM"+(e-M-.5)+","+(t.b+.5)+"v3h"+(2*M+1)+"v-3Z"}(lt,ot))):(ht="xy",pt.attr("d",j(lt))),lt.w=lt.r-lt.l,lt.h=lt.b-lt.t,D(dt,pt,lt,ut,ft,ct),ft=!0}function yt(){if(Math.min(lt.h,lt.w)<2*w)return R(t);"xy"!==ht&&"x"!==ht||S(U,lt.l/G,lt.r/G,vt,K),"xy"!==ht&&"y"!==ht||S(V,(Y-lt.b)/Y,(Y-lt.t)/Y,vt,Q),R(t),At(),N(t)}var bt=[0,0,G,Y],xt=null,_t=_.REDRAWDELAY,wt=e.mainplot?$._plots[e.mainplot]:e;function Mt(e,r){if(!t._transitioningWithDuration){if(nt(),"ew"===W||"ns"===X)return W&&L(U,e),X&&L(V,r),Tt([W?-e:0,X?-r:0,G,Y]),void kt(X,W);if(J&&W&&X){var n="w"===W==("n"===X)?1:-1,i=(e/G+n*r/Y)/2;e=i*G,r=n*i*Y}"w"===W?e=l(U,0,e):"e"===W?e=l(U,1,-e):W||(e=0),"n"===X?r=l(V,1,r):"s"===X?r=l(V,0,-r):X||(r=0);var a="w"===W?e:0,o="n"===X?r:0;if(J){var s;if(!W&&1===X.length){for(s=0;s<U.length;s++)U[s].range=U[s]._r.slice(),x(U[s],1-r/Y);a=(e=r*G/Y)/2}if(!X&&1===W.length){for(s=0;s<V.length;s++)V[s].range=V[s]._r.slice(),x(V[s],1-e/G);o=(r=e*Y/G)/2}}Tt([a,o,G-e,Y-r]),kt(X,W)}function l(t,e,r){for(var n,i,a=1-e,o=0;o<t.length;o++){var s=t[o];if(!s.fixedrange){n=s,i=s._rl[a]+(s._rl[e]-s._rl[a])/C(r/s._length);var l=s.l2r(i);!1!==l&&void 0!==l&&(s.range[e]=l)}}return n._length*(n._rl[e]-i)/(n._rl[e]-n._rl[a])}}function kt(e,r){var n,i=[];function a(t){for(n=0;n<t.length;n++)t[n].fixedrange||i.push(t[n]._id)}for((r||J)&&(a(U),a(K)),(e||J)&&(a(V),a(Q)),vt={},n=0;n<i.length;n++){var o=i[n];g(t,o,!0);var l=y(t,o);vt[l._name+".range[0]"]=l.range[0],vt[l._name+".range[1]"]=l.range[1]}function c(a,o,s){for(n=0;n<a.length;n++){var l=a[n];if((r&&-1!==i.indexOf(l.xref)||e&&-1!==i.indexOf(l.yref))&&(o(t,n),s))return}}c($.annotations||[],s.getComponentMethod("annotations","drawOne")),c($.shapes||[],s.getComponentMethod("shapes","drawOne")),c($.images||[],s.getComponentMethod("images","draw"),!0)}function At(){Tt([0,0,G,Y]),l.syncOrAsync([v.previousPromises,function(){o.relayout(t,vt)}],t)}function Tt(t){var e,r,n,i,a,o=$._plots,s=Object.keys(o),c=t[2]/U[0]._length,u=t[3]/V[0]._length,h=A||J,d=k||J;function p(t){return t.fixedrange?0:h&&-1!==K.indexOf(t)?c:d&&-1!==(J?K:Q).indexOf(t)?u:0}function v(t,e){return e?(t.range=t._r.slice(),x(t,e),g(t,e)):0}function g(t,e){return t._length*(1-e)*m[t.constraintoward||"middle"]}for($._glcanvas&&$._glcanvas.size()&&$._glcanvas.each(function(t){t.regl&&t.regl.clear({color:!0})}),e=0;e<s.length;e++){var y=o[s[e]],b=y.xaxis,_=y.yaxis,w=h&&!b.fixedrange&&-1!==U.indexOf(b),M=d&&!_.fixedrange&&-1!==V.indexOf(_);if(y._scene&&y._scene.update){var T=l.simpleMap(b.range,b.r2l),E=l.simpleMap(_.range,_.r2l);y._scene.update({range:[T[0],E[0],T[1],E[1]]})}if(w?(r=c,i=A?t[0]:g(b,r)):i=v(b,r=p(b)),M?(n=u,a=k?t[1]:g(_,n)):a=v(_,n=p(_)),r||n){r||(r=1),n||(n=1);var S=b._offset-i/r,L=_._offset-a/n;$._defs.select("#"+y.clipId+"> rect").call(f.setTranslate,i,a).call(f.setScale,r,n);var C=y.plot.selectAll(".scatterlayer .trace, .boxlayer .trace, .violinlayer .trace");y.plot.call(f.setTranslate,S,L).call(f.setScale,1/r,1/n),C.selectAll(".point").call(f.setPointGroupScale,r,n),C.selectAll(".textpoint").call(f.setTextPointsScale,r,n),C.call(f.hideOutsideRangePoints,y)}}}return k.length*A.length!=1&&B(it,function(e){if(t._context.scrollZoom||$._enablescrollzoom){if(t._transitioningWithDuration)return e.preventDefault(),void e.stopPropagation();var r=t.querySelector(".plotly");if(nt(),!(r.scrollHeight-r.clientHeight>10||r.scrollWidth-r.clientWidth>10)){clearTimeout(xt);var n=-e.deltaY;if(isFinite(n)||(n=e.wheelDelta/10),isFinite(n)){var i,a=Math.exp(-Math.min(Math.max(n,-20),20)/200),o=wt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),s=(e.clientX-o.left)/o.width,c=(o.bottom-e.clientY)/o.height;if(A||J){for(A||(s=.5),i=0;i<U.length;i++)u(U[i],s,a);bt[2]*=a,bt[0]+=bt[2]*s*(1/a-1)}if(k||J){for(k||(c=.5),i=0;i<V.length;i++)u(V[i],c,a);bt[3]*=a,bt[1]+=bt[3]*(1-c)*(1/a-1)}Tt(bt),kt(k,A),xt=setTimeout(function(){bt=[0,0,G,Y],At()},_t),e.preventDefault()}else l.log("Did not find wheel motion attributes: ",e)}}function u(t,e,r){if(!t.fixedrange){var n=l.simpleMap(t.range,t.r2l),i=n[0]+(n[1]-n[0])*e;t.range=n.map(function(e){return t.l2r(i+(e-i)*r)})}}}),it},makeDragger:A,makeRectDragger:T,makeZoombox:P,makeCorners:z,updateZoombox:D,xyCorners:j,transitionZoombox:I,removeZoombox:R,clearSelect:O,showDoubleClickNotifier:N,attachWheelEventHandler:B}},{"../../components/color":598,"../../components/dragelement":620,"../../components/drawing":623,"../../components/fx":640,"../../constants/alignment":696,"../../lib":724,"../../lib/setcursor":743,"../../lib/svg_text_utils":747,"../../plotly":765,"../../registry":854,"../plots":833,"./axes":770,"./axis_ids":773,"./constants":775,"./scale_zoom":787,"./select":788,d3:128,"has-passive-events":256,tinycolor2:526}],779:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/fx"),a=t("../../components/dragelement"),o=t("./constants"),s=t("./dragbox").makeDragBox;e.exports=function(t){var e=t._fullLayout;if(t._context.staticPlot)n.select(t).selectAll(".drag").remove();else if(e._has("cartesian")||e._has("gl2d")){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}).forEach(function(r){var n=e._plots[r],l=n.xaxis,c=n.yaxis,u=o.DRAGGERSIZE;if(!n.mainplot){var f=s(t,n,l._offset,c._offset,l._length,c._length,"ns","ew");f.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===r&&i.hover(t,e,r)},i.hover(t,e,r),t._fullLayout._lasthover=f,t._fullLayout._hoversubplot=r},f.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,a.unhover(t,e))},t._context.showAxisDragHandles&&(s(t,n,l._offset-u,c._offset-u,u,u,"n","w"),s(t,n,l._offset+l._length,c._offset-u,u,u,"n","e"),s(t,n,l._offset-u,c._offset+c._length,u,u,"s","w"),s(t,n,l._offset+l._length,c._offset+c._length,u,u,"s","e"))}if(t._context.showAxisDragHandles){if(r===l._mainSubplot){var h=l._mainLinePosition;"top"===l.side&&(h-=u),s(t,n,l._offset+.1*l._length,h,.8*l._length,u,"","ew"),s(t,n,l._offset,h,.1*l._length,u,"","w"),s(t,n,l._offset+.9*l._length,h,.1*l._length,u,"","e")}if(r===c._mainSubplot){var d=c._mainLinePosition;"right"!==c.side&&(d-=u),s(t,n,d,c._offset+.1*c._length,u,.8*c._length,"ns",""),s(t,n,d,c._offset+.9*c._length,u,.1*c._length,"s",""),s(t,n,d,c._offset,u,.1*c._length,"n","")}}});var r=e._hoverlayer.node();r.onmousemove=function(r){r.target=e._lasthover,i.hover(t,r,e._hoversubplot)},r.onclick=function(r){r.target=e._lasthover,i.click(t,r)},r.onmousedown=function(t){e._lasthover.onmousedown(t)}}}},{"../../components/dragelement":620,"../../components/fx":640,"./constants":775,"./dragbox":778,d3:128}],780:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports=function(t){return function(e,r){var a=e[t];if(Array.isArray(a))for(var o=n.subplotsRegistry.cartesian,s=o.idRegex,l=r._subplots,c=l.xaxis,u=l.yaxis,f=l.cartesian,h=r._has("cartesian")||r._has("gl2d"),d=0;d<a.length;d++){var p=a[d];if(i.isPlainObject(p)){var m=p.xref,v=p.yref,g=s.x.test(m),y=s.y.test(v);if(g||y){h||i.pushUnique(r._basePlotModules,o);var b=!1;g&&-1===c.indexOf(m)&&(c.push(m),b=!0),y&&-1===u.indexOf(v)&&(u.push(v),b=!0),b&&g&&y&&f.push(m+v)}}}}}},{"../../lib":724,"../../registry":854}],781:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../plots"),o=t("../get_data").getModuleCalcData,s=t("./axis_ids"),l=t("./constants"),c=t("../../constants/xmlns_namespaces");function u(t,e,r,n,i){var a=t._fullLayout._modules;e.plot&&e.plot.selectAll("g:not(.scatterlayer)").selectAll("g.trace").remove();for(var s=0;s<a.length;s++){var l=a[s];if("cartesian"===l.basePlotModule.name){var c=o(r,l);l.plot&&l.plot(t,e,c,n,i)}}}function f(t){var e=t.plotgroup,r=t.id,n=l.layerValue2layerClass[t.xaxis.layer],i=l.layerValue2layerClass[t.yaxis.layer];if(t.mainplot){var a=t.mainplotinfo,o=a.plotgroup,c=r+"-x",u=r+"-y";t.gridlayer=a.gridlayer,t.zerolinelayer=a.zerolinelayer,d(a.overlinesBelow,"path",c),d(a.overlinesBelow,"path",u),d(a.overaxesBelow,"g",c),d(a.overaxesBelow,"g",u),t.plot=d(a.overplot,"g",r),d(a.overlinesAbove,"path",c),d(a.overlinesAbove,"path",u),d(a.overaxesAbove,"g",c),d(a.overaxesAbove,"g",u),t.xlines=o.select(".overlines-"+n).select("."+c),t.ylines=o.select(".overlines-"+i).select("."+u),t.xaxislayer=o.select(".overaxes-"+n).select("."+c),t.yaxislayer=o.select(".overaxes-"+i).select("."+u)}else{var f=d(e,"g","layer-subplot");t.shapelayer=d(f,"g","shapelayer"),t.imagelayer=d(f,"g","imagelayer"),t.gridlayer=d(e,"g","gridlayer"),t.zerolinelayer=d(e,"g","zerolinelayer"),d(e,"path","xlines-below"),d(e,"path","ylines-below"),t.overlinesBelow=d(e,"g","overlines-below"),d(e,"g","xaxislayer-below"),d(e,"g","yaxislayer-below"),t.overaxesBelow=d(e,"g","overaxes-below"),t.plot=d(e,"g","plot"),t.overplot=d(e,"g","overplot"),d(e,"path","xlines-above"),d(e,"path","ylines-above"),t.overlinesAbove=d(e,"g","overlines-above"),d(e,"g","xaxislayer-above"),d(e,"g","yaxislayer-above"),t.overaxesAbove=d(e,"g","overaxes-above"),t.xlines=e.select(".xlines-"+n),t.ylines=e.select(".ylines-"+i),t.xaxislayer=e.select(".xaxislayer-"+n),t.yaxislayer=e.select(".yaxislayer-"+i)}d(t.gridlayer,"g",t.xaxis._id,t.xaxis._id),d(t.gridlayer,"g",t.yaxis._id,t.yaxis._id),t.gridlayer.selectAll("g").sort(s.idSort);for(var h=0;h<l.traceLayerClasses.length;h++)d(t.plot,"g",l.traceLayerClasses[h]);t.xlines.style("fill","none").classed("crisp",!0),t.ylines.style("fill","none").classed("crisp",!0)}function h(t,e){if(t){var r={};t.each(function(t){var i=n.select(this),a="clip"+e._uid+t+"plot";i.remove(),e._draggers.selectAll("g."+t).remove(),e._defs.select("#"+a).remove(),r[t]=!0});for(var i=e._plots,a=Object.keys(i),o=0;o<a.length;o++)for(var s=i[a[o]].overlays||[],l=0;l<s.length;l++){var c=s[l];r[c.id]&&c.plot.selectAll(".trace").remove()}}}function d(t,e,r,n){var i=t.selectAll("."+r).data([n||0]);return i.enter().append(e).classed(r,!0),i}r.name="cartesian",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=l.idRegex,r.attrRegex=l.attrRegex,r.attributes=t("./attributes"),r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.transitionAxes=t("./transition_axes"),r.finalizeSubplots=function(t,e){var r,n,a,o=e._subplots,c=o.xaxis,u=o.yaxis,f=o.cartesian,h=f.concat(o.gl2d||[]),d={},p={};for(r=0;r<h.length;r++){var m=h[r].split("y");d[m[0]]=1,p["y"+m[1]]=1}for(r=0;r<c.length;r++)d[n=c[r]]||(a=(t[s.id2name(n)]||{}).anchor,l.idRegex.y.test(a)||(a="y"),f.push(n+a),h.push(n+a),p[a]||(p[a]=1,i.pushUnique(u,a)));for(r=0;r<u.length;r++)p[a=u[r]]||(n=(t[s.id2name(a)]||{}).anchor,l.idRegex.x.test(n)||(n="x"),f.push(n+a),h.push(n+a),d[n]||(d[n]=1,i.pushUnique(c,n)));if(!h.length){var v=Object.keys(t);for(n="",a="",r=0;r<v.length;r++){var g=v[r];if(l.attrRegex.test(g))"x"===g.charAt(0)?(!n||+g.substr(5)<+n.substr(5))&&(n=g):(!a||+g.substr(5)<+a.substr(5))&&(a=g)}n=n?s.name2id(n):"x",a=a?s.name2id(a):"y",c.push(n),u.push(a),f.push(n+a)}},r.plot=function(t,e,r,n){var i,a=t._fullLayout,o=a._subplots.cartesian,s=t.calcdata;if(!Array.isArray(e))for(e=[],i=0;i<s.length;i++)e.push(i);for(a._glcanvas&&a._glcanvas.size()&&a._glcanvas.each(function(t){t.regl&&t.regl.clear({color:!0})}),i=0;i<o.length;i++){for(var l,c=o[i],f=a._plots[c],h=[],d=0;d<s.length;d++){var p=s[d],m=p[0].trace;m.xaxis+m.yaxis===c&&((-1!==e.indexOf(m.index)||m.carpet)&&(l&&l[0].trace.xaxis+l[0].trace.yaxis===c&&-1!==["tonextx","tonexty","tonext"].indexOf(m.fill)&&-1===h.indexOf(l)&&h.push(l),h.push(p)),l=p)}u(t,f,h,r,n)}},r.clean=function(t,e,r,n){var i,a,o,s,l,c,u,f,d=n._modules||[],p=e._modules||[];for(l=0;l<d.length;l++){"scatter"===d[l].name&&(i=!0);break}for(l=0;l<p.length;l++)if("scatter"===p[l].name){a=!0;break}for(l=0;l<d.length;l++){"scattergl"===d[l].name&&(o=!0);break}for(l=0;l<p.length;l++)if("scattergl"===p[l].name){s=!0;break}if(i&&!a){for(c=n._plots,u=Object.keys(c||{}),l=0;l<u.length;l++)(f=c[u[l]]).plot&&f.plot.select("g.scatterlayer").selectAll("g.trace").remove();n._infolayer.selectAll("g.rangeslider-container").select("g.scatterlayer").selectAll("g.trace").remove()}if(o&&!s)for(c=n._plots,u=Object.keys(c||{}),l=0;l<u.length;l++)(f=c[u[l]])._scene&&f._scene.destroy();var m=n._subplots||{},v=e._subplots||{xaxis:[],yaxis:[]};if(m.xaxis&&m.yaxis){var g=m.xaxis.concat(m.yaxis),y=v.xaxis.concat(v.yaxis);for(l=0;l<g.length;l++)-1===y.indexOf(g[l])&&n._infolayer.selectAll(".g-"+g[l]+"title").remove()}var b=n._has&&n._has("cartesian"),x=e._has&&e._has("cartesian");b&&!x&&(h(n._cartesianlayer.selectAll(".subplot"),n),n._defs.selectAll(".axesclip").remove())},r.drawFramework=function(t){var e=t._fullLayout,r=function(t){for(var e=t._fullLayout,r=Object.keys(e._plots),n=[],i=[],a=0;a<r.length;a++){var o=r[a],s=e._plots[o],l=s.xaxis,c=s.yaxis,u=l._mainAxis,f=c._mainAxis,h=u._id+f._id;h!==o&&-1!==r.indexOf(h)?(s.mainplot=h,s.mainplotinfo=e._plots[h],i.push(o)):n.push(o)}return n=n.concat(i)}(t),a=e._cartesianlayer.selectAll(".subplot").data(r,i.identity);a.enter().append("g").attr("class",function(t){return"subplot "+t}),a.order(),a.exit().call(h,e),a.each(function(t){var r=e._plots[t];(r.plotgroup=n.select(this),r.overlays=[],f(r),r.mainplot)&&e._plots[r.mainplot].overlays.push(r);r.draglayer=d(e._draggers,"g",t)})},r.rangePlot=function(t,e,r){f(e),u(t,e,r),a.style(t)},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container");r.filter(function(t,e){return e===r.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus").each(function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:c.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.width,height:this.height})})}},{"../../constants/xmlns_namespaces":704,"../../lib":724,"../get_data":807,"../plots":833,"./attributes":769,"./axis_ids":773,"./constants":775,"./layout_attributes":782,"./layout_defaults":783,"./transition_axes":793,d3:128}],782:[function(t,e,r){"use strict";var n=t("../font_attributes"),i=t("../../components/color/attributes"),a=t("../../components/drawing/attributes").dash,o=t("../../lib/extend").extendFlat,s=t("./constants");e.exports={visible:{valType:"boolean",editType:"plot"},color:{valType:"color",dflt:i.defaultLine,editType:"ticks"},title:{valType:"string",editType:"ticks"},titlefont:n({editType:"ticks"}),type:{valType:"enumerated",values:["-","linear","log","date","category"],dflt:"-",editType:"calc"},autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot",impliedEdits:{autorange:!1}},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},scaleanchor:{valType:"enumerated",values:[s.idRegex.x.toString(),s.idRegex.y.toString()],editType:"calc"},scaleratio:{valType:"number",min:0,dflt:1,editType:"calc"},constrain:{valType:"enumerated",values:["range","domain"],dflt:"range",editType:"calc"},constraintoward:{valType:"enumerated",values:["left","center","right","top","middle","bottom"],editType:"calc"},tickmode:{valType:"enumerated",values:["auto","linear","array"],editType:"ticks",impliedEdits:{tick0:void 0,dtick:void 0}},nticks:{valType:"integer",min:0,dflt:0,editType:"ticks"},tick0:{valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},dtick:{valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},tickvals:{valType:"data_array",editType:"ticks"},ticktext:{valType:"data_array",editType:"ticks"},ticks:{valType:"enumerated",values:["outside","inside",""],editType:"ticks"},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1,editType:"ticks+layoutstyle"},ticklen:{valType:"number",min:0,dflt:5,editType:"ticks"},tickwidth:{valType:"number",min:0,dflt:1,editType:"ticks"},tickcolor:{valType:"color",dflt:i.defaultLine,editType:"ticks"},showticklabels:{valType:"boolean",dflt:!0,editType:"ticks"},showspikes:{valType:"boolean",dflt:!1,editType:"modebar"},spikecolor:{valType:"color",dflt:null,editType:"none"},spikethickness:{valType:"number",dflt:3,editType:"none"},spikedash:o({},a,{dflt:"dash",editType:"none"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis",editType:"none"},spikesnap:{valType:"enumerated",values:["data","cursor"],dflt:"data",editType:"none"},tickfont:n({editType:"ticks"}),tickangle:{valType:"angle",dflt:"auto",editType:"ticks"},tickprefix:{valType:"string",dflt:"",editType:"ticks"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},ticksuffix:{valType:"string",dflt:"",editType:"ticks"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"ticks"},separatethousands:{valType:"boolean",dflt:!1,editType:"ticks"},tickformat:{valType:"string",dflt:"",editType:"ticks"},tickformatstops:{_isLinkedToArray:"tickformatstop",dtickrange:{valType:"info_array",items:[{valType:"any",editType:"ticks"},{valType:"any",editType:"ticks"}],editType:"ticks"},value:{valType:"string",dflt:"",editType:"ticks"},editType:"ticks"},hoverformat:{valType:"string",dflt:"",editType:"none"},showline:{valType:"boolean",dflt:!1,editType:"layoutstyle"},linecolor:{valType:"color",dflt:i.defaultLine,editType:"layoutstyle"},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle"},showgrid:{valType:"boolean",editType:"ticks"},gridcolor:{valType:"color",dflt:i.lightLine,editType:"ticks"},gridwidth:{valType:"number",min:0,dflt:1,editType:"ticks"},zeroline:{valType:"boolean",editType:"ticks"},zerolinecolor:{valType:"color",dflt:i.defaultLine,editType:"ticks"},zerolinewidth:{valType:"number",dflt:1,editType:"ticks"},anchor:{valType:"enumerated",values:["free",s.idRegex.x.toString(),s.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",s.idRegex.x.toString(),s.idRegex.y.toString()],editType:"calc"},layer:{valType:"enumerated",values:["above traces","below traces"],dflt:"above traces",editType:"plot"},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},position:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},editType:"calc",_deprecated:{autotick:{valType:"boolean",editType:"ticks"}}}},{"../../components/color/attributes":597,"../../components/drawing/attributes":622,"../../lib/extend":713,"../font_attributes":797,"./constants":775}],783:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/color"),o=t("../layout_attributes"),s=t("./layout_attributes"),l=t("./type_defaults"),c=t("./axis_defaults"),u=t("./constraint_defaults"),f=t("./position_defaults"),h=t("./axis_ids");e.exports=function(t,e,r){var d,p={},m={},v={},g={};for(d=0;d<r.length;d++){var y=r[d];if(n.traceIs(y,"cartesian")||n.traceIs(y,"gl2d")){var b=h.id2name(y.xaxis),x=h.id2name(y.yaxis);if(n.traceIs(y,"carpet")&&("carpet"!==y.type||y._cheater)||b&&(m[b]=1),"carpet"===y.type&&y._cheater&&b&&(p[b]=1),n.traceIs(y,"2dMap")&&(v[b]=!0,v[x]=!0),n.traceIs(y,"oriented"))g["h"===y.orientation?x:b]=!0}}var _=e._subplots,w=_.xaxis,M=_.yaxis,k=i.simpleMap(w,h.id2name),A=i.simpleMap(M,h.id2name),T=k.concat(A),E=a.background;w.length&&M.length&&(E=i.coerce(t,e,o,"plot_bgcolor"));var S,L,C,P,z=a.combine(E,e.paper_bgcolor);function O(t,e){return i.coerce(C,P,s,t,e)}function D(t,e){return i.coerce2(C,P,s,t,e)}function I(t){return"x"===t?M:w}var R={x:I("x"),y:I("y")};function N(e,r){for(var n="x"===e?k:A,i=[],a=0;a<n.length;a++){var o=n[a];o===r||(t[o]||{}).overlaying||i.push(h.name2id(o))}return i}for(d=0;d<T.length;d++){S=T[d],i.isPlainObject(t[S])||(t[S]={}),C=t[S],P=e[S]={},l(C,P,O,r,S);var F=N(L=S.charAt(0),S),j={letter:L,font:e.font,outerTicks:v[S],showGrid:!g[S],data:r,bgColor:z,calendar:e.calendar,cheateronly:"x"===L&&p[S]&&!m[S]};c(C,P,O,j,e);var B=D("spikecolor"),U=D("spikethickness"),V=D("spikedash"),q=D("spikemode"),H=D("spikesnap");O("showspikes",!!(B||U||V||q||H))||(delete P.spikecolor,delete P.spikethickness,delete P.spikedash,delete P.spikemode,delete P.spikesnap);var G={letter:L,counterAxes:R[L],overlayableAxes:F};f(C,P,O,G),P._input=C}var Y=n.getComponentMethod("rangeslider","handleDefaults"),W=n.getComponentMethod("rangeselector","handleDefaults");for(d=0;d<k.length;d++)S=k[d],C=t[S],P=e[S],Y(t,e,S),"date"===P.type&&W(C,P,e,A,P.calendar),O("fixedrange");for(d=0;d<A.length;d++){S=A[d],C=t[S],P=e[S];var X=e[h.id2name(P.anchor)];O("fixedrange",X&&X.rangeslider&&X.rangeslider.visible)}e._axisConstraintGroups=[];var Z=R.x.concat(R.y);for(d=0;d<T.length;d++)L=(S=T[d]).charAt(0),C=t[S],P=e[S],u(C,P,O,Z,e)}},{"../../components/color":598,"../../lib":724,"../../registry":854,"../layout_attributes":824,"./axis_defaults":772,"./axis_ids":773,"./constraint_defaults":776,"./layout_attributes":782,"./position_defaults":786,"./type_defaults":794}],784:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,i=t("../../components/color/attributes").lightFraction,a=t("../../lib");e.exports=function(t,e,r,o){var s=(o=o||{}).dfltColor;function l(r,n){return a.coerce2(t,e,o.attributes,r,n)}var c=l("linecolor",s),u=l("linewidth");r("showline",o.showLine||!!c||!!u)||(delete e.linecolor,delete e.linewidth);var f=l("gridcolor",n(s,o.bgColor,o.blend||i).toRgbString()),h=l("gridwidth");if(r("showgrid",o.showGrid||!!f||!!h)||(delete e.gridcolor,delete e.gridwidth),!o.noZeroLine){var d=l("zerolinecolor",s),p=l("zerolinewidth");r("zeroline",o.showGrid||!!d||!!p)||(delete e.zerolinecolor,delete e.zerolinewidth)}}},{"../../components/color/attributes":597,"../../lib":724,tinycolor2:526}],785:[function(t,e,r){"use strict";var n=t("d3");function i(t,e,r){var i,a,o,s,l,c=[],u=r.map(function(e){return e[t]}),f=n.bisector(e).left;for(i=0;i<u.length;i++)for(o=u[i],a=0;a<o.length;a++)null!==(s=o[a])&&void 0!==s&&((l=f(c,s))<c.length&&c[l]===s||c.splice(l,0,s));return c}e.exports=function(t,e,r,a){switch(e){case"array":return Array.isArray(r)?r.slice():[];case"category ascending":return i(t,n.ascending,a);case"category descending":return i(t,n.descending,a);case"trace":default:return[]}}},{d3:128}],786:[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;"free"===i.coerce(t,e,{anchor:{valType:"enumerated",values:["free"].concat(o),dflt:n(t.position)?"free":o[0]||"free"}},"anchor")&&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 u=r("domain");u[0]>u[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return r("layer"),e}},{"../../lib":724,"fast-isnumeric":140}],787:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)]}},{"../../constants/alignment":696}],788:[function(t,e,r){"use strict";var n=t("polybooljs"),i=t("../../lib/polygon"),a=t("../../lib/throttle"),o=t("../../components/color"),s=t("../../components/fx/helpers").makeEventData,l=t("../../components/fx"),c=t("./axes"),u=t("./constants"),f=i.filter,h=i.tester,d=i.multitester,p=u.MINSELECT;function m(t){return t._id}function v(t,e,r){var n,i,a;if(r){var o=r.points||[];for(n=0;n<e.length;n++)(a=e[n].cd[0].trace).selectedpoints=[],a._input.selectedpoints=[];for(n=0;n<o.length;n++){var s=o[n],l=s.data,c=s.fullData;s.pointIndices?([].push.apply(l.selectedpoints,s.pointIndices),[].push.apply(c.selectedpoints,s.pointIndices)):(l.selectedpoints.push(s.pointIndex),c.selectedpoints.push(s.pointIndex))}}else for(n=0;n<e.length;n++)delete(a=e[n].cd[0].trace).selectedpoints,delete a._input.selectedpoints,e[n].cd[0].t&&e[n].cd[0].t.scene&&e[n].cd[0].t.scene.clearSelect();for(n=0;n<e.length;n++)(i=e[n]).style&&i.style(t,i.cd)}function g(t,e){if(Array.isArray(t))for(var r=e.cd,n=e.cd[0].trace,i=0;i<t.length;i++)t[i]=s(t[i],n,r);return t}e.exports=function(t,e,r,i,s){var y,b,x,_,w=i.gd,M=w._fullLayout,k=M._zoomlayer,A=i.element.getBoundingClientRect(),T=i.plotinfo,E=T.xaxis._offset,S=T.yaxis._offset,L=e-A.left,C=r-A.top,P=L,z=C,O="M"+L+","+C,D=i.xaxes[0]._length,I=i.yaxes[0]._length,R=i.xaxes.map(m),N=i.yaxes.map(m),F=i.xaxes.concat(i.yaxes),j=t.altKey;(t.shiftKey||t.altKey)&&T.selection&&T.selection.polygons&&!i.polygons?(i.polygons=T.selection.polygons,i.mergedPolygons=T.selection.mergedPolygons):(!t.shiftKey&&!t.altKey||(t.shiftKey||t.altKey)&&!T.selection)&&(T.selection={},T.selection.polygons=i.polygons=[],T.selection.mergedPolygons=i.mergedPolygons=[]),"lasso"===s&&(y=f([[L,C]],u.BENDPX));var B=k.selectAll("path.select-outline-"+T.id).data([1,2]);B.enter().append("path").attr("class",function(t){return"select-outline select-outline-"+t+" select-outline-"+T.id}).attr("transform","translate("+E+", "+S+")").attr("d",O+"Z");var U,V,q,H,G,Y,W=k.append("path").attr("class","zoombox-corners").style({fill:o.background,stroke:o.defaultLine,"stroke-width":1}).attr("transform","translate("+E+", "+S+")").attr("d","M0,0Z"),X=[],Z=M._uid+u.SELECTID,J=[];for(U=0;U<w.calcdata.length;U++)if(!0===(q=(V=w.calcdata[U])[0].trace).visible&&q._module&&q._module.selectPoints)if(i.subplot)q.subplot!==i.subplot&&q.geo!==i.subplot||X.push({selectPoints:q._module.selectPoints,style:q._module.style,cd:V,xaxis:i.xaxes[0],yaxis:i.yaxes[0]});else{if(-1===R.indexOf(q.xaxis))continue;if(-1===N.indexOf(q.yaxis))continue;X.push({selectPoints:q._module.selectPoints,style:q._module.style,cd:V,xaxis:c.getFromId(w,q.xaxis),yaxis:c.getFromId(w,q.yaxis)})}function K(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return t.p2d(r[e])}}function Q(t,e){return t-e}Y=T.fillRangeItems?T.fillRangeItems:"select"===s?function(t,e){var r=t.range={};for(U=0;U<F.length;U++){var n=F[U],i=n._id.charAt(0);r[n._id]=[n.p2d(e[i+"min"]),n.p2d(e[i+"max"])].sort(Q)}}:function(t,e,r){var n=t.lassoPoints={};for(U=0;U<F.length;U++){var i=F[U];n[i._id]=r.filtered.map(K(i))}},i.moveFn=function(t,e){P=Math.max(0,Math.min(D,t+L)),z=Math.max(0,Math.min(I,e+C));var r=Math.abs(P-L),o=Math.abs(z-C);"select"===s?o<Math.min(.6*r,p)?((_=[[L,0],[L,I],[P,I],[P,0]]).xmin=Math.min(L,P),_.xmax=Math.max(L,P),_.ymin=Math.min(0,I),_.ymax=Math.max(0,I),W.attr("d","M"+_.xmin+","+(C-p)+"h-4v"+2*p+"h4ZM"+(_.xmax-1)+","+(C-p)+"h4v"+2*p+"h-4Z")):r<Math.min(.6*o,p)?((_=[[0,C],[0,z],[D,z],[D,C]]).xmin=Math.min(0,D),_.xmax=Math.max(0,D),_.ymin=Math.min(C,z),_.ymax=Math.max(C,z),W.attr("d","M"+(L-p)+","+_.ymin+"v-4h"+2*p+"v4ZM"+(L-p)+","+(_.ymax-1)+"v4h"+2*p+"v-4Z")):((_=[[L,C],[L,z],[P,z],[P,C]]).xmin=Math.min(L,P),_.xmax=Math.max(L,P),_.ymin=Math.min(C,z),_.ymax=Math.max(C,z),W.attr("d","M0,0Z")):"lasso"===s&&(y.addPt([P,z]),_=y.filtered),i.polygons&&i.polygons.length?(x=function(t,e,r){if(r)return n.difference({regions:t,inverted:!1},{regions:[e],inverted:!1}).regions;return n.union({regions:t,inverted:!1},{regions:[e],inverted:!1}).regions}(i.mergedPolygons,_,j),_.subtract=j,b=d(i.polygons.concat([_]))):(x=[_],b=h(_));var l=[];for(U=0;U<x.length;U++){var c=x[U];l.push(c.join("L")+"L"+c[0])}B.attr("d","M"+l.join("M")+"Z"),a.throttle(Z,u.SELECTDELAY,function(){J=[];var t,e,r=[];for(U=0;U<X.length;U++)if(e=(H=X[U]).selectPoints(H,b),r.push(e),t=g(e,H),J.length)for(var n=0;n<t.length;n++)J.push(t[n]);else J=t;v(w,X,G={points:J}),Y(G,_,y),i.gd.emit("plotly_selecting",G)})},i.clickFn=function(t,e){W.remove(),a.done(Z).then(function(){if(a.clear(Z),2===t){for(B.remove(),U=0;U<X.length;U++)(H=X[U]).selectPoints(H,!1);v(w,X),w.emit("plotly_deselect",null)}else w.emit("plotly_selected",void 0);l.click(w,e)})},i.doneFn=function(){W.remove(),a.done(Z).then(function(){a.clear(Z),i.gd.emit("plotly_selected",G),_&&i.polygons&&(_.subtract=j,i.polygons.push(_),i.mergedPolygons.length=0,[].push.apply(i.mergedPolygons,x))})}}},{"../../components/color":598,"../../components/fx":640,"../../components/fx/helpers":637,"../../lib/polygon":736,"../../lib/throttle":748,"./axes":770,"./constants":775,polybooljs:460}],789:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=a.cleanNumber,s=a.ms2DateTime,l=a.dateTime2ms,c=a.ensureNumber,u=t("../../constants/numerical"),f=u.FP_SAFE,h=u.BADNUM,d=t("./constants"),p=t("./axis_ids");function m(t){return Math.pow(10,t)}e.exports=function(t,e){e=e||{};var r=(t._id||"x").charAt(0),u=10;function v(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-3*u*Math.abs(n-i))}return h}function g(e,r,n){var a=l(e,n||t.calendar);if(a===h){if(!i(e))return h;a=l(new Date(+e))}return a}function y(e,r,n){return s(e,r,n||t.calendar)}function b(e){return t._categories[Math.round(e)]}function x(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(i(e))return+e}function _(e){return i(e)?n.round(t._b+t._m*e,2):h}function w(e){return(e-t._b)/t._m}t.c2l="log"===t.type?v:c,t.l2c="log"===t.type?m:c,t.l2p=_,t.p2l=w,t.c2p="log"===t.type?function(t,e){return _(v(t,e))}:_,t.p2c="log"===t.type?function(t){return m(w(t))}:w,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=o,t.c2d=t.c2r=t.l2d=t.l2r=c,t.d2p=t.r2p=function(e){return t.l2p(o(e))},t.p2d=t.p2r=w,t.cleanPos=c):"log"===t.type?(t.d2r=t.d2l=function(t,e){return v(o(t),e)},t.r2d=t.r2c=function(t){return m(o(t))},t.d2c=t.r2l=o,t.c2d=t.l2r=c,t.c2r=v,t.l2d=m,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return m(w(t))},t.r2p=function(e){return t.l2p(o(e))},t.p2r=w,t.cleanPos=c):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=g,t.c2d=t.c2r=t.l2d=t.l2r=y,t.d2p=t.r2p=function(e,r,n){return t.l2p(g(e,0,n))},t.p2d=t.p2r=function(t,e,r){return y(w(t),e,r)},t.cleanPos=function(e){return a.cleanDate(e,h,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=function(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return h},t.r2d=t.c2d=t.l2d=b,t.d2r=t.d2l_noadd=x,t.r2c=function(e){var r=x(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=c,t.r2l=x,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return b(w(t))},t.r2p=t.d2p,t.p2r=w,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:c(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e,n){n||(n={}),e||(e="range");var o,s,l=a.nestedProperty(t,e).get();if(s=(s="date"===t.type?a.dfltRange(t.calendar):"y"===r?d.DFLTRANGEY:n.dfltRange||d.DFLTRANGEX).slice(),l&&2===l.length)for("date"===t.type&&(l[0]=a.cleanDate(l[0],h,t.calendar),l[1]=a.cleanDate(l[1],h,t.calendar)),o=0;o<2;o++)if("date"===t.type){if(!a.isDateTime(l[o],t.calendar)){t[e]=s;break}if(t.r2l(l[0])===t.r2l(l[1])){var c=a.constrain(t.r2l(l[0]),a.MIN_MS+1e3,a.MAX_MS-1e3);l[0]=t.l2r(c-1e3),l[1]=t.l2r(c+1e3);break}}else{if(!i(l[o])){if(!i(l[1-o])){t[e]=s;break}l[o]=l[1-o]*(o?10:.1)}if(l[o]<-f?l[o]=-f:l[o]>f&&(l[o]=f),l[0]===l[1]){var u=Math.max(1,Math.abs(1e-6*l[0]));l[0]-=u,l[1]+=u}}else a.nestedProperty(t,e).set(s)},t.setScale=function(n){var i=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var a=p.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var o=n&&t._r?"_r":"range",s=t.calendar;t.cleanRange(o);var l=t.r2l(t[o][0],s),c=t.r2l(t[o][1],s);if("y"===r?(t._offset=i.t+(1-t.domain[1])*i.h,t._length=i.h*(t.domain[1]-t.domain[0]),t._m=t._length/(l-c),t._b=-t._m*c):(t._offset=i.l+t.domain[0]*i.w,t._length=i.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-l),t._b=-t._m*l),!isFinite(t._m)||!isFinite(t._b))throw e._replotting=!1,new Error("Something went wrong with axis scaling")},t.makeCalcdata=function(e,r){var n,i,a,o,s="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],o=e._length||n.length,i=new Array(o),a=0;a<o;a++)i[a]=t.d2c(n[a],0,s);else{var l=r+"0"in e?t.d2c(e[r+"0"],0,s):0,c=e["d"+r]?Number(e["d"+r]):1;for(n=e[{x:"y",y:"x"}[r]],o=e._length||n.length,i=new Array(o),a=0;a<o;a++)i[a]=l+a*c}return i},t.isValidRange=function(e){return Array.isArray(e)&&2===e.length&&i(t.r2l(e[0]))&&i(t.r2l(e[1]))},t.isPtWithinRange=function(e,n){var i=t.c2l(e[r],null,n);return i>=t.r2l(t.range[0])&&i<=t.r2l(t.range[1])},t._min=[],t._max=[];var M=e._d3locale;"date"===t.type&&(t._dateFormat=M?M.timeFormat.utc:n.time.format.utc,t._extraFormat=e._extraFormat),t._separators=e.separators,t._numFormat=M?M.numberFormat:n.format,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":702,"../../lib":724,"./axis_ids":773,"./constants":775,d3:128,"fast-isnumeric":140}],790:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r,a,o){var s=function(t){var e=["showexponent","showtickprefix","showticksuffix"].filter(function(e){return void 0!==t[e]});if(e.every(function(r){return t[r]===t[e[0]]})||1===e.length)return t[e[0]]}(t);if(r("tickprefix")&&r("showtickprefix",s),r("ticksuffix",o.tickSuffixDflt)&&r("showticksuffix",s),r("showticklabels")){var l=o.font||{},c=e.color===t.color?e.color:l.color;if(n.coerceFont(r,"tickfont",{family:l.family,size:l.size,color:c}),r("tickangle"),"category"!==a){var u=r("tickformat");!function(t,e){var r,a,o=t.tickformatstops,s=e.tickformatstops=[];if(!Array.isArray(o))return;function l(t,e){return n.coerce(r,a,i.tickformatstops,t,e)}for(var c=0;c<o.length;c++)r=o[c],a={},l("dtickrange"),l("value"),s.push(a)}(t,e),u||"date"===a||(r("showexponent",s),r("exponentformat"),r("separatethousands"))}}}},{"../../lib":724,"./layout_attributes":782}],791:[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);r("ticks",a.outerTicks||o||s||l?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":724,"./layout_attributes":782}],792:[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 c="date"===o?a:1,u=r("dtick",c);if(n(u))e.dtick=u>0?Number(u):c;else if("string"!=typeof u)e.dtick=c;else{var f=u.charAt(0),h=u.substr(1);((h=n(h)?Number(h):0)<=0||!("date"===o&&"M"===f&&h===Math.round(h)||"log"===o&&"L"===f||"log"===o&&"D"===f&&(1===h||2===h)))&&(e.dtick=c)}var d="date"===o?i.dateTick0(e.calendar):0,p=r("tick0",d);"date"===o?e.tick0=i.cleanDate(p,d):n(p)&&"D1"!==u&&"D2"!==u?e.tick0=Number(p):e.tick0=d}else{void 0===r("tickvals")?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":702,"../../lib":724,"fast-isnumeric":140}],793:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plotly"),a=t("../../registry"),o=t("../../components/drawing"),s=t("./axes"),l=t("./constants").attrRegex;e.exports=function(t,e,r,c){var u=t._fullLayout,f=[];var h,d,p,m,v=function(t){var e,r,n,i,a={};for(e in t)if((r=e.split("."))[0].match(l)){var o=e.charAt(0),s=r[0];if(n=u[s],i={},Array.isArray(t[e])?i.to=t[e].slice(0):Array.isArray(t[e].range)&&(i.to=t[e].range.slice(0)),!i.to)continue;i.axisName=s,i.length=n._length,f.push(o),a[o]=i}return a}(e),g=Object.keys(v),y=function(t,e,r){var n,i,a,o=t._plots,s=[];for(n in o){var l=o[n];if(-1===s.indexOf(l)){var c=l.xaxis._id,u=l.yaxis._id,f=l.xaxis.range,h=l.yaxis.range;l.xaxis._r=l.xaxis.range.slice(),l.yaxis._r=l.yaxis.range.slice(),i=r[c]?r[c].to:f,a=r[u]?r[u].to:h,f[0]===i[0]&&f[1]===i[1]&&h[0]===a[0]&&h[1]===a[1]||-1===e.indexOf(c)&&-1===e.indexOf(u)||s.push(l)}}return s}(u,g,v);if(!y.length)return function(){function e(e,r,n){for(var i=0;i<e.length;i++)if(r(t,i),n)return}e(u.annotations||[],a.getComponentMethod("annotations","drawOne")),e(u.shapes||[],a.getComponentMethod("shapes","drawOne")),e(u.images||[],a.getComponentMethod("images","draw"),!0)}(),!1;function b(t){var e=t.xaxis,r=t.yaxis;u._defs.select("#"+t.clipId+"> rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function x(e,r){var n,i,l,c=v[e.xaxis._id],f=v[e.yaxis._id],h=[];if(c){i=(n=t._fullLayout[c.axisName])._r,l=c.to,h[0]=(i[0]*(1-r)+r*l[0]-i[0])/(i[1]-i[0])*e.xaxis._length;var d=i[1]-i[0],p=l[1]-l[0];n.range[0]=i[0]*(1-r)+r*l[0],n.range[1]=i[1]*(1-r)+r*l[1],h[2]=e.xaxis._length*(1-r+r*p/d)}else h[0]=0,h[2]=e.xaxis._length;if(f){i=(n=t._fullLayout[f.axisName])._r,l=f.to,h[1]=(i[1]*(1-r)+r*l[1]-i[1])/(i[0]-i[1])*e.yaxis._length;var m=i[1]-i[0],g=l[1]-l[0];n.range[0]=i[0]*(1-r)+r*l[0],n.range[1]=i[1]*(1-r)+r*l[1],h[3]=e.yaxis._length*(1-r+r*g/m)}else h[1]=0,h[3]=e.yaxis._length;!function(e,r){var n,i=[];for(i=[e._id,r._id],n=0;n<i.length;n++)s.doTicks(t,i[n],!0);function o(e,r,a){for(n=0;n<e.length;n++){var o=e[n];if(-1===i.indexOf(o.xref)&&-1===i.indexOf(o.yref)||r(t,n),a)return}}o(u.annotations||[],a.getComponentMethod("annotations","drawOne")),o(u.shapes||[],a.getComponentMethod("shapes","drawOne")),o(u.images||[],a.getComponentMethod("images","draw"),!0)}(e.xaxis,e.yaxis);var y=e.xaxis,b=e.yaxis,x=!!c,_=!!f,w=x?y._length/h[2]:1,M=_?b._length/h[3]:1,k=x?h[0]:0,A=_?h[1]:0,T=x?h[0]/h[2]*y._length:0,E=_?h[1]/h[3]*b._length:0,S=y._offset-T,L=b._offset-E;u._defs.select("#"+e.clipId+"> rect").call(o.setTranslate,k,A).call(o.setScale,1/w,1/M),e.plot.call(o.setTranslate,S,L).call(o.setScale,w,M).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/w,1/M),e.plot.selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1/w,1/M)}c&&(h=c());var _=n.ease(r.easing);return t._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(m),m=null,function(){for(var e={},r=0;r<g.length;r++){var n=t._fullLayout[g[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<y.length;t++)b(y[t])})}()}),d=Date.now(),m=window.requestAnimationFrame(function e(){p=Date.now();for(var n=Math.min(1,(p-d)/r.duration),a=_(n),o=0;o<y.length;o++)x(y[o],a);p-d>r.duration?(function(){for(var e={},r=0;r<g.length;r++){var n=t._fullLayout[v[g[r]].axisName],a=v[g[r]].to;e[n._name+".range[0]"]=a[0],e[n._name+".range[1]"]=a[1],n.range=a.slice()}h&&h(),i.relayout(t,e).then(function(){for(var t=0;t<y.length;t++)b(y[t])})}(),m=window.cancelAnimationFrame(e)):m=window.requestAnimationFrame(e)}),Promise.resolve()}},{"../../components/drawing":623,"../../plotly":765,"../../registry":854,"./axes":770,"./constants":775,d3:128}],794:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./axis_autotype"),a=t("./axis_ids").name2id;function o(t){return{v:"x",h:"y"}[t.orientation||"v"]}function s(t,e){var r=o(t),i=n.traceIs(t,"box-violin"),a=n.traceIs(t._fullInput||{},"candlestick");return i&&!a&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,l,c){c&&(e._name=c,e._id=a(c)),"-"===r("type")&&(!function(t,e){if("-"!==t.type)return;var r=t._id,a=r.charAt(0);-1!==r.indexOf("scene")&&(r=a);var l=function(t,e,r){for(var n=0;n<t.length;n++){var i=t[n];if((i[r+"axis"]||r)===e){if(s(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,r,a);if(!l)return;if("histogram"===l.type&&a==={v:"y",h:"x"}[l.orientation||"v"])return void(t.type="linear");var c=a+"calendar",u=l[c];if(s(l,a)){for(var f,h=o(l),d=[],p=0;p<e.length;p++)f=e[p],n.traceIs(f,"box-violin")&&(f[a+"axis"]||a)===r&&(void 0!==f[h]?d.push(f[h][0]):void 0!==f.name?d.push(f.name):d.push("text"),f[c]!==u&&(u=void 0));t.type=i(d,u)}else t.type=i(l[a]||[l[a+"0"]],u)}(e,l),"-"===e.type?e.type="linear":t.type=e.type)}},{"../../registry":854,"./axis_autotype":771,"./axis_ids":773}],795:[function(t,e,r){"use strict";var n=t("../plotly"),i=t("../lib");function a(t,e,r){var n,a,o,s=!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 a=i.nestedProperty(n,e.prop).get(),(o=r[e.type]=r[e.type]||{}).hasOwnProperty(e.prop)&&o[e.prop]!==a&&(s=!0),o[e.prop]=a,{changed:s,value:a}}function o(t,e){var r=[],n=e[0],a={};if("string"==typeof n)a[n]=e[1];else{if(!i.isPlainObject(n))return r;a=n}return l(a,function(t,e,n){r.push({type:"layout",prop:t,value:n})},"",0),r}function s(t,e){var r,n,a,o,s=[];if(n=e[0],a=e[1],r=e[2],o={},"string"==typeof n)o[n]=a;else{if(!i.isPlainObject(n))return s;o=n,void 0===r&&(r=a)}return void 0===r&&(r=null),l(o,function(e,n,i){var a;if(Array.isArray(i)){var o=Math.min(i.length,t.data.length);r&&(o=Math.min(o,r.length)),a=[];for(var l=0;l<o;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 c=i;i=[];for(var u=0;u<a.length;u++)i[u]=c}i.length=Math.min(a.length,i.length)}s.push({type:"data",prop:e,traces:a,value:i})},"",0),s}function l(t,e,r,n){Object.keys(t).forEach(function(a){var o=t[a];if("_"!==a[0]){var s=r+(n>0?".":"")+a;i.isPlainObject(o)?l(o,e,s,n+1):e(s,a,o)}})}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(c)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(c){a(t,c,s.cache),s.check=function(){if(l){var e=a(t,c,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f<u.length;f++)t._internalOn(u[f],s.check);s.remove=function(){for(var e=0;e<u.length;e++)t._removeInternalListener(u[e],s.check)}}else i.log("Unable to automatically bind plot updates to API command"),s.lookupTable={},s.remove=function(){};return s.disable=function(){l=!1},s.enable=function(){l=!0},e&&(e._commandObserver=s),s},r.hasSimpleAPICommandBindings=function(t,e,n){var i,a,o=e.length;for(i=0;i<o;i++){var s,l=e[i],c=l.method,u=l.args;if(Array.isArray(u)||(u=[]),!c)return!1;var f=r.computeAPICommandBindings(t,c,u);if(1!==f.length)return!1;if(a){if((s=f[0]).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 h=0;h<a.traces.length;h++)if(a.traces[h]!==s.traces[h])return!1}else if(s.prop!==a.prop)return!1}else a=f[0],Array.isArray(a.traces)&&a.traces.sort();var d=(s=f[0]).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){if("skip"===e)return Promise.resolve();var a=n[e],o=[t];Array.isArray(r)||(r=[]);for(var s=0;s<r.length;s++)o.push(r[s]);return a.apply(null,o).catch(function(t){return i.warn("API call to Plotly."+e+" rejected.",t),Promise.reject(t)})},r.computeAPICommandBindings=function(t,e,r){var n;switch(Array.isArray(r)||(r=[]),e){case"restyle":n=s(t,r);break;case"relayout":n=o(t,r);break;case"update":n=s(t,[r[0],r[2]]).concat(o(t,[r[1]]));break;case"animate":n=function(t,e){return Array.isArray(e[0])&&1===e[0].length&&-1!==["string","number"].indexOf(typeof e[0][0])?[{type:"layout",prop:"_currentFrame",value:e[0][0].toString()}]:[]}(0,r);break;default:n=[]}return n}},{"../lib":724,"../plotly":765}],796:[function(t,e,r){"use strict";var n=t("../lib/extend").extendFlat;e.exports=function(t,e){t=t||{},e=e||{};var r={valType:"info_array",editType:t.editType,items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]};t.name&&t.name,t.trace,e.description&&e.description;return{x:n({},r,{}),y:n({},r,{}),editType:t.editType}}},{"../lib/extend":713}],797:[function(t,e,r){"use strict";e.exports=function(t){var e=t.editType,r=t.colorEditType;void 0===r&&(r=e);var n={family:{valType:"string",noBlank:!0,strict:!0,editType:e},size:{valType:"number",min:1,editType:e},color:{valType:"color",editType:r},editType:e};return t.arrayOk&&(n.family.arrayOk=!0,n.size.arrayOk=!0,n.color.arrayOk=!0),n}},{}],798:[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"}}},{}],799:[function(t,e,r){"use strict";r.projNames={equirectangular:"equirectangular",mercator:"mercator",orthographic:"orthographic","natural earth":"naturalEarth",kavrayskiy7:"kavrayskiy7",miller:"miller",robinson:"robinson",eckert4:"eckert4","azimuthal equal area":"azimuthalEqualArea","azimuthal equidistant":"azimuthalEquidistant","conic equal area":"conicEqualArea","conic conformal":"conicConformal","conic equidistant":"conicEquidistant",gnomonic:"gnomonic",stereographic:"stereographic",mollweide:"mollweide",hammer:"hammer","transverse mercator":"transverseMercator","albers usa":"albersUsa","winkel tripel":"winkel3",aitoff:"aitoff",sinusoidal:"sinusoidal"},r.axesNames=["lonaxis","lataxis"],r.lonaxisSpan={orthographic:180,"azimuthal equal area":360,"azimuthal equidistant":360,"conic conformal":180,gnomonic:160,stereographic:180,"transverse mercator":180,"*":360},r.lataxisSpan={"conic conformal":150,stereographic:179.5,"*":180},r.scopeDefaults={world:{lonaxisRange:[-180,180],lataxisRange:[-90,90],projType:"equirectangular",projRotate:[0,0,0]},usa:{lonaxisRange:[-180,-50],lataxisRange:[15,80],projType:"albers usa"},europe:{lonaxisRange:[-30,60],lataxisRange:[30,85],projType:"conic conformal",projRotate:[15,0,0],projParallels:[0,60]},asia:{lonaxisRange:[22,160],lataxisRange:[-15,55],projType:"mercator",projRotate:[0,0,0]},africa:{lonaxisRange:[-30,60],lataxisRange:[-40,40],projType:"mercator",projRotate:[0,0,0]},"north america":{lonaxisRange:[-180,-45],lataxisRange:[5,85],projType:"conic conformal",projRotate:[-100,0,0],projParallels:[29.5,45.5]},"south america":{lonaxisRange:[-100,-30],lataxisRange:[-60,15],projType:"mercator",projRotate:[0,0,0]}},r.clipPad=.001,r.precision=.1,r.landColor="#F0DC82",r.waterColor="#3399FF",r.locationmodeToLayer={"ISO-3":"countries","USA-states":"subunits","country names":"countries"},r.sphereSVG={type:"Sphere"},r.fillLayers={ocean:1,land:1,lakes:1},r.lineLayers={subunits:1,countries:1,coastlines:1,rivers:1,frame:1},r.layers=["bg","ocean","land","lakes","subunits","countries","coastlines","rivers","lataxis","lonaxis","frame","backplot","frontplot"],r.layersForChoropleth=["bg","ocean","land","subunits","countries","coastlines","lataxis","lonaxis","frame","backplot","rivers","lakes","frontplot"],r.layerNameToAdjective={ocean:"ocean",land:"land",lakes:"lake",subunits:"subunit",countries:"country",coastlines:"coastline",rivers:"river",frame:"frame"}},{}],800:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plotly"),a=t("../../lib"),o=t("../../components/color"),s=t("../../components/drawing"),l=t("../../components/fx"),c=t("../plots"),u=t("../cartesian/axes"),f=t("../../components/dragelement"),h=t("../cartesian/select"),d=t("./zoom"),p=t("./constants"),m=t("../../lib/topojson_utils"),v=t("topojson-client").feature;function g(t){this.id=t.id,this.graphDiv=t.graphDiv,this.container=t.container,this.topojsonURL=t.topojsonURL,this.isStatic=t.staticPlot,this.topojsonName=null,this.topojson=null,this.projection=null,this.viewInitial=null,this.fitScale=null,this.bounds=null,this.midPt=null,this.hasChoropleth=!1,this.traceHash={},this.layers={},this.basePaths={},this.dataPaths={},this.dataPoints={},this.clipDef=null,this.clipRect=null,this.bgRect=null,this.makeFramework()}t("./projections")(n);var y=g.prototype;e.exports=function(t){return new g(t)},y.plot=function(t,e,r){var n=this,i=e[this.id],a=m.getTopojsonName(i);null===n.topojson||a!==n.topojsonName?(n.topojsonName=a,void 0===PlotlyGeoAssets.topojson[n.topojsonName]?r.push(n.fetchTopojson().then(function(r){PlotlyGeoAssets.topojson[n.topojsonName]=r,n.topojson=r,n.update(t,e)})):(n.topojson=PlotlyGeoAssets.topojson[n.topojsonName],n.update(t,e))):n.update(t,e)},y.fetchTopojson=function(){var t=m.getTopojsonPath(this.topojsonURL,this.topojsonName);return new Promise(function(e,r){n.json(t,function(n,i){if(n)return 404===n.status?r(new Error(["plotly.js could not find topojson file at",t,".","Make sure the *topojsonURL* plot config option","is set properly."].join(" "))):r(new Error(["unexpected error while fetching topojson file at",t].join(" ")));e(i)})})},y.update=function(t,e){var r=e[this.id];if(!this.updateProjection(e,r)){this.hasChoropleth=!1;for(var n=0;n<t.length;n++)if("choropleth"===t[n][0].trace.type){this.hasChoropleth=!0;break}this.viewInitial||this.saveViewInitial(r),this.updateBaseLayers(e,r),this.updateDims(e,r),this.updateFx(e,r),c.generalUpdatePerTraceModule(this.graphDiv,this,t,r);var i=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=i.selectAll(".point"),this.dataPoints.text=i.selectAll("text"),this.dataPaths.line=i.selectAll(".js-line");var a=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=a.selectAll("path"),this.render()}},y.updateProjection=function(t,e){var r=t._size,o=e.domain,s=e.projection,l=s.rotation||{},c=e.center||{},u=this.projection=function(t){for(var e=t.projection.type,r=n.geo[p.projNames[e]](),i=t._isClipped?p.lonaxisSpan[e]/2:null,a=["center","rotate","parallels","clipExtent"],o=function(t){return t?r:[]},s=0;s<a.length;s++){var l=a[s];"function"!=typeof r[l]&&(r[l]=o)}r.isLonLatOverEdges=function(t){if(null===r(t))return!0;if(i){var e=r.rotate();return n.geo.distance(t,[-e[0],-e[1]])>i*Math.PI/180}return!1},r.getPath=function(){return n.geo.path().projection(r)},r.getBounds=function(t){return r.getPath().bounds(t)},r.fitExtent=function(t,e){var n=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),a&&r.clipExtent(null);var o=r.getBounds(e),s=Math.min(n/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),l=+t[0][0]+(n-s*(o[1][0]+o[0][0]))/2,c=+t[0][1]+(i-s*(o[1][1]+o[0][1]))/2;return a&&r.clipExtent(a),r.scale(150*s).translate([l,c])},r.precision(p.precision),i&&r.clipAngle(i-p.clipPad);return r}(e);u.center([c.lon-l.lon,c.lat-l.lat]).rotate([-l.lon,-l.lat,l.roll]).parallels(s.parallels);var f=[[r.l+r.w*o.x[0],r.t+r.h*(1-o.y[1])],[r.l+r.w*o.x[1],r.t+r.h*(1-o.y[0])]],h=e.lonaxis,d=e.lataxis,m=function(t,e){var r=p.clipPad,n=t[0]+r,i=t[1]-r,a=e[0]+r,o=e[1]-r;n>0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}(h.range,d.range);u.fitExtent(f,m);var v=this.bounds=u.getBounds(m),g=this.fitScale=u.scale(),y=u.translate();if(!isFinite(v[0][0])||!isFinite(v[0][1])||!isFinite(v[1][0])||!isFinite(v[1][1])||isNaN(y[0])||isNaN(y[0])){for(var b=this.graphDiv,x=["projection.rotation","center","lonaxis.range","lataxis.range"],_="Invalid geo settings, relayout'ing to default view.",w={},M=0;M<x.length;M++)w[this.id+"."+x[M]]=null;return this.viewInitial=null,a.warn(_),b._promises.push(i.relayout(b,w)),_}var k=this.midPt=[(v[0][0]+v[1][0])/2,(v[0][1]+v[1][1])/2];if(u.scale(s.scale*g).translate([y[0]+(k[0]-y[0]),y[1]+(k[1]-y[1])]).clipExtent(v),e._isAlbersUsa){var A=u([c.lon,c.lat]),T=u.translate();u.translate([T[0]-(A[0]-T[0]),T[1]-(A[1]-T[1])])}},y.updateBaseLayers=function(t,e){var r=this,i=r.topojson,a=r.layers,l=r.basePaths;function c(t){return"lonaxis"===t||"lataxis"===t}function u(t){return Boolean(p.lineLayers[t])}function f(t){return Boolean(p.fillLayers[t])}var h=(this.hasChoropleth?p.layersForChoropleth:p.layers).filter(function(t){return u(t)||f(t)?e["show"+t]:!c(t)||e[t].showgrid}),d=r.framework.selectAll(".layer").data(h,String);d.exit().each(function(t){delete a[t],delete l[t],n.select(this).remove()}),d.enter().append("g").attr("class",function(t){return"layer "+t}).each(function(t){var e=a[t]=n.select(this);"bg"===t?r.bgRect=e.append("rect").style("pointer-events","all"):c(t)?l[t]=e.append("path").style("fill","none"):"backplot"===t?e.append("g").classed("choroplethlayer",!0):"frontplot"===t?e.append("g").classed("scatterlayer",!0):u(t)?l[t]=e.append("path").style("fill","none").style("stroke-miterlimit",2):f(t)&&(l[t]=e.append("path").style("stroke","none"))}),d.order(),d.each(function(t){var r=l[t],a=p.layerNameToAdjective[t];"frame"===t?r.datum(p.sphereSVG):u(t)||f(t)?r.datum(v(i,i.objects[t])):c(t)&&r.datum(function(t,e){var r=e[t].dtick,i=p.scopeDefaults[e.scope],a=i.lonaxisRange,o=i.lataxisRange,s="lonaxis"===t?[r]:[0,r];return n.geo.graticule().extent([[a[0],o[0]],[a[1],o[1]]]).step(s)}(t,e)).call(o.stroke,e[t].gridcolor).call(s.dashLine,"",e[t].gridwidth),u(t)?r.call(o.stroke,e[a+"color"]).call(s.dashLine,"",e[a+"width"]):f(t)&&r.call(o.fill,e[a+"color"])})},y.updateDims=function(t,e){var r=this.bounds,n=(e.framewidth||0)/2,i=r[0][0]-n,a=r[0][1]-n,l=r[1][0]-i+n,c=r[1][1]-a+n;s.setRect(this.clipRect,i,a,l,c),this.bgRect.call(s.setRect,i,a,l,c).call(o.fill,e.bgcolor),this.xaxis._offset=i,this.xaxis._length=l,this.yaxis._offset=a,this.yaxis._length=c},y.updateFx=function(t,e){var r=this,a=r.graphDiv,o=r.bgRect,s=t.dragmode;if(!r.isStatic){if("pan"===s)o.node().onmousedown=null,o.call(d(r,e)),o.on("dblclick.zoom",function(){var t=r.viewInitial,e={};for(var n in t)e[r.id+"."+n]=t[n];i.relayout(a,e),a.emit("plotly_doubleclick",null)});else if("select"===s||"lasso"===s){var c;o.on(".zoom",null),"select"===s?c=function(t,e){(t.range={})[r.id]=[p([e.xmin,e.ymin]),p([e.xmax,e.ymax])]}:"lasso"===s&&(c=function(t,e,n){(t.lassoPoints={})[r.id]=n.filtered.map(p)});var u={element:r.bgRect.node(),gd:a,plotinfo:{xaxis:r.xaxis,yaxis:r.yaxis,fillRangeItems:c},xaxes:[r.xaxis],yaxes:[r.yaxis],subplot:r.id,clickFn:function(e){2===e&&t._zoomlayer.selectAll(".select-outline").remove()},prepFn:function(t,e,r){h(t,e,r,u,s)}};f.init(u)}o.on("mousemove",function(){var t=r.projection.invert(n.mouse(this));if(!t||isNaN(t[0])||isNaN(t[1]))return f.unhover(a,n.event);r.xaxis.p2c=function(){return t[0]},r.yaxis.p2c=function(){return t[1]},l.hover(a,n.event,r.id)}),o.on("mouseout",function(){f.unhover(a,n.event)}),o.on("click",function(){l.click(a,n.event)})}function p(t){return r.projection.invert([t[0]+r.xaxis._offset,t[1]+r.yaxis._offset])}},y.makeFramework=function(){var t=this,e=t.graphDiv._fullLayout,r="clip"+e._uid+t.id;t.clipDef=e._clips.append("clipPath").attr("id",r),t.clipRect=t.clipDef.append("rect"),t.framework=n.select(t.container).append("g").attr("class","geo "+t.id).call(s.setClipUrl,r),t.project=function(e){var r=t.projection(e);return r?[r[0]-t.xaxis._offset,r[1]-t.yaxis._offset]:[null,null]},t.xaxis={_id:"x",c2p:function(e){return t.project(e)[0]}},t.yaxis={_id:"y",c2p:function(e){return t.project(e)[1]}},t.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},u.setConvert(t.mockAxis,e)},y.saveViewInitial=function(t){var e=t.center||{},r=t.projection,n=r.rotation||{};t._isScoped?this.viewInitial={"center.lon":e.lon,"center.lat":e.lat,"projection.scale":r.scale}:t._isClipped?this.viewInitial={"projection.scale":r.scale,"projection.rotation.lon":n.lon,"projection.rotation.lat":n.lat}:this.viewInitial={"center.lon":e.lon,"center.lat":e.lat,"projection.scale":r.scale,"projection.rotation.lon":n.lon}},y.render=function(){var t,e=this.projection,r=e.getPath();function n(t){var r=e(t.lonlat);return r?"translate("+r[0]+","+r[1]+")":null}function i(t){return e.isLonLatOverEdges(t.lonlat)?"none":null}for(t in this.basePaths)this.basePaths[t].attr("d",r);for(t in this.dataPaths)this.dataPaths[t].attr("d",function(t){return r(t.geojson)});for(t in this.dataPoints)this.dataPoints[t].attr("display",i).attr("transform",n)}},{"../../components/color":598,"../../components/dragelement":620,"../../components/drawing":623,"../../components/fx":640,"../../lib":724,"../../lib/topojson_utils":750,"../../plotly":765,"../cartesian/axes":770,"../cartesian/select":788,"../plots":833,"./constants":799,"./projections":805,"./zoom":806,d3:128,"topojson-client":529}],801:[function(t,e,r){"use strict";var n=t("./geo"),i=t("../../plots/get_data").getSubplotCalcData,a=t("../../lib").counterRegex,o="geo";r.name=o,r.attr=o,r.idRoot=o,r.idRegex=r.attrRegex=a(o),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=e._subplots.geo;void 0===window.PlotlyGeoAssets&&(window.PlotlyGeoAssets={topojson:{}});for(var s=0;s<a.length;s++){var l=a[s],c=i(r,o,l),u=e[l]._subplot;u||(u=n({id:l,graphDiv:t,container:e._geolayer.node(),topojsonURL:t._context.topojsonURL,staticPlot:t._context.staticPlot}),e[l]._subplot=u),u.plot(c,e,t._promises)}},r.clean=function(t,e,r,n){for(var i=n._subplots.geo||[],a=0;a<i.length;a++){var o=i[a],s=n[o]._subplot;!e[o]&&s&&(s.framework.remove(),s.clipDef.remove())}},r.updateFx=function(t){for(var e=t._subplots.geo,r=0;r<e.length;r++){var n=t[e[r]];n._subplot.updateFx(t,n)}}},{"../../lib":724,"../../plots/get_data":807,"./geo":800,"./layout/attributes":802,"./layout/defaults":803,"./layout/layout_attributes":804}],802:[function(t,e,r){"use strict";e.exports={geo:{valType:"subplotid",dflt:"geo",editType:"calc"}}},{}],803:[function(t,e,r){"use strict";var n=t("../../subplot_defaults"),i=t("../constants"),a=t("./layout_attributes"),o=i.axesNames;function s(t,e,r){var n=r("resolution"),a=r("scope"),s=i.scopeDefaults[a],l=r("projection.type",s.projType),c=e._isAlbersUsa="albers usa"===l;c&&(a=e.scope="usa");var u=e._isScoped="world"!==a,f=e._isConic=-1!==l.indexOf("conic");e._isClipped=!!i.lonaxisSpan[l];for(var h=0;h<o.length;h++){var d,p=o[h],m=[30,10][h];if(u)d=s[p+"Range"];else{var v=i[p+"Span"],g=(v[l]||v["*"])/2,y=r("projection.rotation."+p.substr(0,3),s.projRotate[h]);d=[y-g,y+g]}r(p+".tick0",r(p+".range",d)[0]),r(p+".dtick",m),r(p+".showgrid")&&(r(p+".gridcolor"),r(p+".gridwidth"))}var b=e.lonaxis.range,x=e.lataxis.range,_=b[0],w=b[1];_>0&&w<0&&(w+=360);var M,k,A,T=(_+w)/2;if(!c){var E=u?s.projRotate:[T,0,0];M=r("projection.rotation.lon",E[0]),r("projection.rotation.lat",E[1]),r("projection.rotation.roll",E[2]),r("showcoastlines",!u)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean")&&r("oceancolor")}(c?(k=-96.6,A=38.7):(k=u?T:M,A=(x[0]+x[1])/2),r("center.lon",k),r("center.lat",A),f)&&r("projection.parallels",s.projParallels||[0,60]);r("projection.scale"),r("showland")&&r("landcolor"),r("showlakes")&&r("lakecolor"),r("showrivers")&&(r("rivercolor"),r("riverwidth")),r("showcountries",u&&"usa"!==a)&&(r("countrycolor"),r("countrywidth")),("usa"===a||"north america"===a&&50===n)&&(r("showsubunits",!0),r("subunitcolor"),r("subunitwidth")),u||r("showframe",!0)&&(r("framecolor"),r("framewidth")),r("bgcolor")}e.exports=function(t,e,r){n(t,e,r,{type:"geo",attributes:a,handleDefaults:s,partition:"y"})}},{"../../subplot_defaults":846,"../constants":799,"./layout_attributes":804}],804:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("../../domain_attributes"),a=t("../constants"),o=t("../../../plot_api/edit_types").overrideAll,s={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}};e.exports=o({domain:i({name:"geo"},{}),resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:Object.keys(a.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:Object.keys(a.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:n.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:a.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:a.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:a.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:a.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:s,lataxis:s},"plot","from-root")},{"../../../components/color/attributes":597,"../../../plot_api/edit_types":754,"../../domain_attributes":796,"../constants":799}],805:[function(t,e,r){"use strict";e.exports=function(t){function e(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:r(t.geometry,e)}}function r(e,n){if(!e)return null;if("GeometryCollection"===e.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return r(t,n)})};if(!c.hasOwnProperty(e.type))return null;var i=c[e.type];return t.geo.stream(e,n(i)),i.result()}t.geo.project=function(t,e){var i=e.stream;if(!i)throw new Error("not yet supported");return(t&&n.hasOwnProperty(t.type)?n[t.type]:r)(t,i)};var n={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,r)})}}},i=[],a=[],o={point:function(t,e){i.push([t,e])},result:function(){var t=i.length?i.length<2?{type:"Point",coordinates:i[0]}:{type:"MultiPoint",coordinates:i}:null;return i=[],t}},s={lineStart:u,point:function(t,e){i.push([t,e])},lineEnd:function(){i.length&&(a.push(i),i=[])},result:function(){var t=a.length?a.length<2?{type:"LineString",coordinates:a[0]}:{type:"MultiLineString",coordinates:a}:null;return a=[],t}},l={polygonStart:u,lineStart:u,point:function(t,e){i.push([t,e])},lineEnd:function(){var t=i.length;if(t){do{i.push(i[0].slice())}while(++t<4);a.push(i),i=[]}},polygonEnd:u,result:function(){if(!a.length)return null;var t=[],e=[];return a.forEach(function(r){!function(t){if((e=t.length)<4)return!1;for(var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++r<e;)n+=t[r-1][1]*t[r][0]-t[r-1][0]*t[r][1];return n<=0}(r)?e.push(r):t.push([r])}),e.forEach(function(e){var r=e[0];t.some(function(t){if(function(t,e){for(var r=e[0],n=e[1],i=!1,a=0,o=t.length,s=o-1;a<o;s=a++){var l=t[a],c=l[0],u=l[1],f=t[s],h=f[0],d=f[1];u>n^d>n&&r<(h-c)*(n-u)/(d-u)+c&&(i=!i)}return i}(t[0],r))return t.push(e),!0})||t.push([e])}),a=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},c={Point:o,MultiPoint:o,LineString:s,MultiLineString:s,Polygon:l,MultiPolygon:l,Sphere:l};function u(){}var f=1e-6,h=f*f,d=Math.PI,p=d/2,m=(Math.sqrt(d),d/180),v=180/d;function g(t){return t>1?p:t<-1?-p:Math.asin(t)}function y(t){return t>1?0:t<-1?d:Math.acos(t)}var b=t.geo.projection,x=t.geo.projectionMutator;function _(t,e){var r=(2+p)*Math.sin(e);e/=2;for(var n=0,i=1/0;n<10&&Math.abs(i)>f;n++){var a=Math.cos(e);e-=i=(e+Math.sin(e)*(a+2)-r)/(2*a*(1+a))}return[2/Math.sqrt(d*(4+d))*t*(1+Math.cos(e)),2*Math.sqrt(d/(4+d))*Math.sin(e)]}t.geo.interrupt=function(e){var r,n=[[[[-d,0],[0,p],[d,0]]],[[[-d,0],[0,-p],[d,0]]]];function i(t,r){for(var i=r<0?-1:1,a=n[+(r<0)],o=0,s=a.length-1;o<s&&t>a[o][2][0];++o);var l=e(t-a[o][1][0],r);return l[0]+=e(a[o][1][0],i*r>i*a[o][0][1]?a[o][0][1]:r)[0],l}e.invert&&(i.invert=function(t,a){for(var o=r[+(a<0)],s=n[+(a<0)],c=0,u=o.length;c<u;++c){var f=o[c];if(f[0][0]<=t&&t<f[1][0]&&f[0][1]<=a&&a<f[1][1]){var h=e.invert(t-e(s[c][1][0],0)[0],a);return h[0]+=s[c][1][0],l(i(h[0],h[1]),[t,a])?h:null}}});var a=t.geo.projection(i),o=a.stream;function s(t,e){for(var r,n,i,a=-1,o=t.length,s=t[0],l=[];++a<o;){n=((r=t[a])[0]-s[0])/e,i=(r[1]-s[1])/e;for(var c=0;c<e;++c)l.push([s[0]+c*n,s[1]+c*i]);s=r}return l.push(r),l}function l(t,e){return Math.abs(t[0]-e[0])<f&&Math.abs(t[1]-e[1])<f}return a.stream=function(e){var r=a.rotate(),i=o(e),l=(a.rotate([0,0]),o(e));return a.rotate(r),i.sphere=function(){t.geo.stream(function(){for(var e=1e-6,r=[],i=0,a=n[0].length;i<a;++i){var o=n[0][i],l=180*o[0][0]/d,c=180*o[0][1]/d,u=180*o[1][1]/d,f=180*o[2][0]/d,h=180*o[2][1]/d;r.push(s([[l+e,c+e],[l+e,u-e],[f-e,u-e],[f-e,h+e]],30))}for(var i=n[1].length-1;i>=0;--i){var o=n[1][i],l=180*o[0][0]/d,c=180*o[0][1]/d,u=180*o[1][1]/d,f=180*o[2][0]/d,h=180*o[2][1]/d;r.push(s([[f-e,h-e],[f-e,u+e],[l+e,u+e],[l+e,c-e]],30))}return{type:"Polygon",coordinates:[t.merge(r)]}}(),l)},i},a.lobes=function(t){return arguments.length?(n=t.map(function(t){return t.map(function(t){return[[t[0][0]*d/180,t[0][1]*d/180],[t[1][0]*d/180,t[1][1]*d/180],[t[2][0]*d/180,t[2][1]*d/180]]})}),r=n.map(function(t){return t.map(function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]})}),a):n.map(function(t){return t.map(function(t){return[[180*t[0][0]/d,180*t[0][1]/d],[180*t[1][0]/d,180*t[1][1]/d],[180*t[2][0]/d,180*t[2][1]/d]]})})},a},_.invert=function(t,e){var r=.5*e*Math.sqrt((4+d)/d),n=g(r),i=Math.cos(n);return[t/(2/Math.sqrt(d*(4+d))*(1+i)),g((n+r*(i+2))/(2+p))]},(t.geo.eckert4=function(){return b(_)}).raw=_;var w=t.geo.azimuthalEqualArea.raw;function M(t,e){if(arguments.length<2&&(e=t),1===e)return w;if(e===1/0)return k;function r(r,n){var i=w(r/e,n);return i[0]*=t,i}return r.invert=function(r,n){var i=w.invert(r/t,n);return i[0]*=e,i},r}function k(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function A(t,e){return[3*t/(2*d)*Math.sqrt(d*d/3-e*e),e]}function T(t,e){return[t,1.25*Math.log(Math.tan(d/4+.4*e))]}function E(t){return function(e){var r,n=t*Math.sin(e),i=30;do{e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e))}while(Math.abs(r)>f&&--i>0);return e/2}}k.invert=function(t,e){var r=2*g(e/2);return[t*Math.cos(r/2)/Math.cos(r),r]},(t.geo.hammer=function(){var t=2,e=x(M),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}).raw=M,A.invert=function(t,e){return[2/3*d*t/Math.sqrt(d*d/3-e*e),e]},(t.geo.kavrayskiy7=function(){return b(A)}).raw=A,T.invert=function(t,e){return[t,2.5*Math.atan(Math.exp(.8*e))-.625*d]},(t.geo.miller=function(){return b(T)}).raw=T,E(d);var S=function(t,e,r){var n=E(r);function i(r,i){return[t*r*Math.cos(i=n(i)),e*Math.sin(i)]}return i.invert=function(n,i){var a=g(i/e);return[n/(t*Math.cos(a)),g((2*a+Math.sin(2*a))/r)]},i}(Math.SQRT2/p,Math.SQRT2,d);function L(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),e*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}(t.geo.mollweide=function(){return b(S)}).raw=S,L.invert=function(t,e){var r,n=e,i=25;do{var a=n*n,o=a*a;n-=r=(n*(1.007226+a*(.015085+o*(.028874*a-.044475-.005916*o)))-e)/(1.007226+a*(.045255+o*(.259866*a-.311325-.005916*11*o)))}while(Math.abs(r)>f&&--i>0);return[t/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},(t.geo.naturalEarth=function(){return b(L)}).raw=L;var C=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];function P(t,e){var r,n=Math.min(18,36*Math.abs(e)/d),i=Math.floor(n),a=n-i,o=(r=C[i])[0],s=r[1],l=(r=C[++i])[0],c=r[1],u=(r=C[Math.min(19,++i)])[0],f=r[1];return[t*(l+a*(u-o)/2+a*a*(u-2*l+o)/2),(e>0?p:-p)*(c+a*(f-s)/2+a*a*(f-2*c+s)/2)]}function z(t,e){return[t*Math.cos(e),e]}function O(t,e){var r,n=Math.cos(e),i=(r=y(n*Math.cos(t/=2)))?r/Math.sin(r):1;return[2*n*Math.sin(t)*i,Math.sin(e)*i]}function D(t,e){var r=O(t,e);return[(r[0]+t/p)/2,(r[1]+e)/2]}C.forEach(function(t){t[1]*=1.0144}),P.invert=function(t,e){var r=e/p,n=90*r,i=Math.min(18,Math.abs(n/5)),a=Math.max(0,Math.floor(i));do{var o=C[a][1],s=C[a+1][1],l=C[Math.min(19,a+2)][1],c=l-o,u=l-2*s+o,f=2*(Math.abs(r)-s)/c,d=u/c,g=f*(1-d*f*(1-2*d*f));if(g>=0||1===a){n=(e>=0?5:-5)*(g+i);var y,b=50;do{g=(i=Math.min(18,Math.abs(n)/5))-(a=Math.floor(i)),o=C[a][1],s=C[a+1][1],l=C[Math.min(19,a+2)][1],n-=(y=(e>=0?p:-p)*(s+g*(l-o)/2+g*g*(l-2*s+o)/2)-e)*v}while(Math.abs(y)>h&&--b>0);break}}while(--a>=0);var x=C[a][0],_=C[a+1][0],w=C[Math.min(19,a+2)][0];return[t/(_+g*(w-x)/2+g*g*(w-2*_+x)/2),n*m]},(t.geo.robinson=function(){return b(P)}).raw=P,z.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return b(z)}).raw=z,O.invert=function(t,e){if(!(t*t+4*e*e>d*d+f)){var r=t,n=e,i=25;do{var a,o=Math.sin(r),s=Math.sin(r/2),l=Math.cos(r/2),c=Math.sin(n),u=Math.cos(n),h=Math.sin(2*n),p=c*c,m=u*u,v=s*s,g=1-m*l*l,b=g?y(u*l)*Math.sqrt(a=1/g):a=0,x=2*b*u*s-t,_=b*c-e,w=a*(m*v+b*u*l*p),M=a*(.5*o*h-2*b*c*s),k=.25*a*(h*s-b*c*m*o),A=a*(p*l+b*v*u),T=M*k-A*w;if(!T)break;var E=(_*M-x*A)/T,S=(x*k-_*w)/T;r-=E,n-=S}while((Math.abs(E)>f||Math.abs(S)>f)&&--i>0);return[r,n]}},(t.geo.aitoff=function(){return b(O)}).raw=O,D.invert=function(t,e){var r=t,n=e,i=25;do{var a,o=Math.cos(n),s=Math.sin(n),l=Math.sin(2*n),c=s*s,u=o*o,h=Math.sin(r),d=Math.cos(r/2),m=Math.sin(r/2),v=m*m,g=1-u*d*d,b=g?y(o*d)*Math.sqrt(a=1/g):a=0,x=.5*(2*b*o*m+r/p)-t,_=.5*(b*s+n)-e,w=.5*a*(u*v+b*o*d*c)+.5/p,M=a*(h*l/4-b*s*m),k=.125*a*(l*m-b*s*u*h),A=.5*a*(c*d+b*v*o)+.5,T=M*k-A*w,E=(_*M-x*A)/T,S=(x*k-_*w)/T;r-=E,n-=S}while((Math.abs(E)>f||Math.abs(S)>f)&&--i>0);return[r,n]},(t.geo.winkel3=function(){return b(D)}).raw=D}},{}],806:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=Math.PI/180,o=180/Math.PI,s={cursor:"pointer"},l={cursor:"auto"};function c(t,e){return n.behavior.zoom().translate(e.translate()).scale(e.scale())}function u(t,e,r){var n=t.id,a=t.graphDiv,o=a.layout[n],s=a._fullLayout[n],l={};function c(t,e){var r=i.nestedProperty(s,t);r.get()!==e&&(r.set(e),i.nestedProperty(o,t).set(e),l[n+"."+t]=e)}r(c),c("projection.scale",e.scale()/t.fitScale),a.emit("plotly_relayout",l)}function f(t,e){var r=c(0,e);function i(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return r.on("zoomstart",function(){n.select(this).style(s)}).on("zoom",function(){e.scale(n.event.scale).translate(n.event.translate),t.render()}).on("zoomend",function(){n.select(this).style(l),u(t,e,i)}),r}function h(t,e){var r,i,a,o,f,h,d,p,m=c(0,e),v=2;function g(t){return e.invert(t)}function y(r){var n=e.rotate(),i=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}return m.on("zoomstart",function(){n.select(this).style(s),r=n.mouse(this),i=e.rotate(),a=e.translate(),o=i,f=g(r)}).on("zoom",function(){if(h=n.mouse(this),l=e(g(s=r)),Math.abs(l[0]-s[0])>v||Math.abs(l[1]-s[1])>v)return m.scale(e.scale()),void m.translate(e.translate());var s,l;e.scale(n.event.scale),e.translate([a[0],n.event.translate[1]]),f?g(h)&&(p=g(h),d=[o[0]+(p[0]-f[0]),i[1],i[2]],e.rotate(d),o=d):f=g(r=h),t.render()}).on("zoomend",function(){n.select(this).style(l),u(t,e,y)}),m}function d(t,e){var r,i={r:e.rotate(),k:e.scale()},f=c(0,e),h=function(t){var e=0,r=arguments.length,i=[];for(;++e<r;)i.push(arguments[e]);var a=n.dispatch.apply(null,i);return a.of=function(e,r){return function(i){var o;try{o=i.sourceEvent=n.event,i.target=t,n.event=i,a[i.type].apply(e,r)}finally{n.event=o}}},a}(f,"zoomstart","zoom","zoomend"),d=0,v=f.on;function b(t){var r=e.rotate();t("projection.rotation.lon",-r[0]),t("projection.rotation.lat",-r[1])}return f.on("zoomstart",function(){n.select(this).style(s);var t,l,c,u,b,x,_,w,M,k,A,T=n.mouse(this),E=e.rotate(),S=E,L=e.translate(),C=(l=.5*(t=E)[0]*a,c=.5*t[1]*a,u=.5*t[2]*a,b=Math.sin(l),x=Math.cos(l),_=Math.sin(c),w=Math.cos(c),M=Math.sin(u),k=Math.cos(u),[x*w*k+b*_*M,b*w*k-x*_*M,x*_*k+b*w*M,x*w*M-b*_*k]);r=p(e,T),v.call(f,"zoom",function(){var t,a,s,l,c,u,f,d,v,b,x=n.mouse(this);if(e.scale(i.k=n.event.scale),r){if(p(e,x)){e.rotate(E).translate(L);var _=p(e,x),w=function(t,e){if(!t||!e)return;var r=function(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}(t,e),n=Math.sqrt(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]}(r,_),M=function(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*o,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*o,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*o]}((a=w,s=(t=C)[0],l=t[1],c=t[2],u=t[3],f=a[0],d=a[1],v=a[2],b=a[3],[s*f-l*d-c*v-u*b,s*d+l*f+c*b-u*v,s*v-l*b+c*f+u*d,s*b+l*v-c*d+u*f])),k=i.r=function(t,e,r){var n=g(e,2,t[0]);n=g(n=g(n,1,t[1]),0,t[2]-r[2]);var i,a,s=e[0],l=e[1],c=e[2],u=n[0],f=n[1],h=n[2],d=Math.atan2(l,s)*o,p=Math.sqrt(s*s+l*l);Math.abs(f)>p?(a=(f>0?90:-90)-d,i=0):(a=Math.asin(f/p)*o-d,i=Math.sqrt(p*p-f*f));var v=180-a-2*d,y=(Math.atan2(h,u)-Math.atan2(c,i))*o,b=(Math.atan2(h,u)-Math.atan2(c,-i))*o,x=m(r[0],r[1],a,y),_=m(r[0],r[1],v,b);return x<=_?[a,y,r[2]]:[v,b,r[2]]}(M,r,S);isFinite(k[0])&&isFinite(k[1])&&isFinite(k[2])||(k=S),e.rotate(k),S=k}}else r=p(e,T=x);h.of(this,arguments)({type:"zoom"})}),A=h.of(this,arguments),d++||A({type:"zoomstart"})}).on("zoomend",function(){var r;n.select(this).style(l),v.call(f,"zoom",null),r=h.of(this,arguments),--d||r({type:"zoomend"}),u(t,e,b)}).on("zoom.redraw",function(){t.render()}),n.rebind(f,h,"on")}function p(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&function(t){var e=t[0]*a,r=t[1]*a,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}(r)}function m(t,e,r,n){var i=v(r-t),a=v(n-e);return Math.sqrt(i*i+a*a)}function v(t){return(t%360+540)%360-180}function g(t,e,r){var n=r*a,i=t.slice(),o=0===e?1:0,s=2===e?1:2,l=Math.cos(n),c=Math.sin(n);return i[o]=t[o]*l-t[s]*c,i[s]=t[s]*l+t[o]*c,i}function y(t,e){for(var r=0,n=0,i=t.length;n<i;++n)r+=t[n]*e[n];return r}e.exports=function(t,e){var r=t.projection;return(e._isScoped?f:e._isClipped?d:h)(t,r)}},{"../../lib":724,d3:128}],807:[function(t,e,r){"use strict";var n=t("../registry"),i=t("./cartesian/constants").SUBPLOT_PATTERN;r.getSubplotCalcData=function(t,e,r){var i=n.subplotsRegistry[e];if(!i)return[];for(var a=i.attr,o=[],s=0;s<t.length;s++){var l=t[s];l[0].trace[a]===r&&o.push(l)}return o},r.getModuleCalcData=function(t,e){var r=[],i="string"==typeof e?n.getModule(e):e;if(!i)return r;for(var a=0;a<t.length;a++){var o=t[a],s=o[0].trace;s._module===i&&!0===s.visible&&r.push(o)}return r},r.getSubplotData=function(t,e,r){if(!n.subplotsRegistry[e])return[];var a,o,s,l=n.subplotsRegistry[e].attr,c=[];if("gl2d"===e){var u=r.match(i);o="x"+u[1],s="y"+u[2]}for(var f=0;f<t.length;f++)a=t[f],"gl2d"===e&&n.traceIs(a,"gl2d")?a[l[0]]===o&&a[l[1]]===s&&c.push(a):a[l]===r&&c.push(a);return c}},{"../registry":854,"./cartesian/constants":775}],808:[function(t,e,r){"use strict";var n=t("mouse-change"),i=t("mouse-wheel"),a=t("mouse-event-offset"),o=t("../cartesian/constants"),s=t("has-passive-events");e.exports=function(t){var e=t.mouseContainer,r=t.glplot,l=new function(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.boxInited=!1,this.boxStart=[0,0],this.boxEnd=[0,0],this.dragStart=[0,0]}(e,r);function c(){t.xaxis.autorange=!1,t.yaxis.autorange=!1}function u(e,n,i){var a,s,u=t.calcDataBox(),f=r.viewBox,h=l.lastPos[0],d=l.lastPos[1],p=o.MINDRAG*r.pixelRatio,m=o.MINZOOM*r.pixelRatio;function v(e,r,n){var i=Math.min(r,n),a=Math.max(r,n);i!==a?(u[e]=i,u[e+2]=a,l.dataBox=u,t.setRanges(u)):(t.selectBox.selectBox=[0,0,1,1],t.glplot.setDirty())}switch(n*=r.pixelRatio,i*=r.pixelRatio,i=f[3]-f[1]-i,t.fullLayout.dragmode){case"zoom":if(e){var g=n/(f[2]-f[0])*(u[2]-u[0])+u[0],y=i/(f[3]-f[1])*(u[3]-u[1])+u[1];l.boxInited||(l.boxStart[0]=g,l.boxStart[1]=y,l.dragStart[0]=n,l.dragStart[1]=i),l.boxEnd[0]=g,l.boxEnd[1]=y,l.boxInited=!0,l.boxEnabled||l.boxStart[0]===l.boxEnd[0]&&l.boxStart[1]===l.boxEnd[1]||(l.boxEnabled=!0);var b=Math.abs(l.dragStart[0]-n)<m,x=Math.abs(l.dragStart[1]-i)<m;if(!function(){for(var e=t.graphDiv._fullLayout._axisConstraintGroups,r=t.xaxis._id,n=t.yaxis._id,i=0;i<e.length;i++)if(-1!==e[i][r]){if(-1!==e[i][n])return!0;break}return!1}()||b&&x)b&&(l.boxEnd[0]=l.boxStart[0]),x&&(l.boxEnd[1]=l.boxStart[1]);else{a=l.boxEnd[0]-l.boxStart[0],s=l.boxEnd[1]-l.boxStart[1];var _=(u[3]-u[1])/(u[2]-u[0]);Math.abs(a*_)>Math.abs(s)?(l.boxEnd[1]=l.boxStart[1]+Math.abs(a)*_*(s>=0?1:-1),l.boxEnd[1]<u[1]?(l.boxEnd[1]=u[1],l.boxEnd[0]=l.boxStart[0]+(u[1]-l.boxStart[1])/Math.abs(_)):l.boxEnd[1]>u[3]&&(l.boxEnd[1]=u[3],l.boxEnd[0]=l.boxStart[0]+(u[3]-l.boxStart[1])/Math.abs(_))):(l.boxEnd[0]=l.boxStart[0]+Math.abs(s)/_*(a>=0?1:-1),l.boxEnd[0]<u[0]?(l.boxEnd[0]=u[0],l.boxEnd[1]=l.boxStart[1]+(u[0]-l.boxStart[0])*Math.abs(_)):l.boxEnd[0]>u[2]&&(l.boxEnd[0]=u[2],l.boxEnd[1]=l.boxStart[1]+(u[2]-l.boxStart[0])*Math.abs(_)))}}else l.boxEnabled?(a=l.boxStart[0]!==l.boxEnd[0],s=l.boxStart[1]!==l.boxEnd[1],a||s?(a&&(v(0,l.boxStart[0],l.boxEnd[0]),t.xaxis.autorange=!1),s&&(v(1,l.boxStart[1],l.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),l.boxEnabled=!1,l.boxInited=!1):l.boxInited&&(l.boxInited=!1);break;case"pan":l.boxEnabled=!1,l.boxInited=!1,e?(l.panning||(l.dragStart[0]=n,l.dragStart[1]=i),Math.abs(l.dragStart[0]-n)<p&&(n=l.dragStart[0]),Math.abs(l.dragStart[1]-i)<p&&(i=l.dragStart[1]),a=(h-n)*(u[2]-u[0])/(r.viewBox[2]-r.viewBox[0]),s=(d-i)*(u[3]-u[1])/(r.viewBox[3]-r.viewBox[1]),u[0]+=a,u[2]+=a,u[1]+=s,u[3]+=s,t.setRanges(u),l.panning=!0,l.lastInputTime=Date.now(),c(),t.cameraChanged(),t.handleAnnotations()):l.panning&&(l.panning=!1,t.relayoutCallback())}l.lastPos[0]=n,l.lastPos[1]=i}return l.mouseListener=n(e,u),e.addEventListener("touchstart",function(t){var r=a(t.changedTouches[0],e);u(0,r[0],r[1]),u(1,r[0],r[1]),t.preventDefault()},!!s&&{passive:!1}),e.addEventListener("touchmove",function(t){t.preventDefault();var r=a(t.changedTouches[0],e);u(1,r[0],r[1]),t.preventDefault()},!!s&&{passive:!1}),e.addEventListener("touchend",function(t){u(0,l.lastPos[0],l.lastPos[1]),t.preventDefault()},!!s&&{passive:!1}),l.wheelListener=i(e,function(e,n){if(!t.scrollZoom)return!1;var i=t.calcDataBox(),a=r.viewBox,o=l.lastPos[0],s=l.lastPos[1],u=Math.exp(5*n/(a[3]-a[1])),f=o/(a[2]-a[0])*(i[2]-i[0])+i[0],h=s/(a[3]-a[1])*(i[3]-i[1])+i[1];return i[0]=(i[0]-f)*u+f,i[2]=(i[2]-f)*u+f,i[1]=(i[1]-h)*u+h,i[3]=(i[3]-h)*u+h,t.setRanges(i),l.lastInputTime=Date.now(),c(),t.cameraChanged(),t.handleAnnotations(),t.relayoutCallback(),!0},!0),l}},{"../cartesian/constants":775,"has-passive-events":256,"mouse-change":424,"mouse-event-offset":425,"mouse-wheel":427}],809:[function(t,e,r){"use strict";var n=t("../cartesian/axes"),i=t("../../lib/html2unicode"),a=t("../../lib/str2rgbarray");function o(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=!1,this.backgroundColor=[0,0,0,0],this.static=this.scene.staticPlot}var s=o.prototype,l=["xaxis","yaxis"];s.merge=function(t){var e,r,n,o,s,c,u,f,h,d,p;for(this.titleEnable=!1,this.backgroundColor=a(t.plot_bgcolor),d=0;d<2;++d){var m=(e=l[d]).charAt(0);for(n=(r=t[this.scene[e]._name]).title===this.scene.fullLayout._dfltTitle[m]?"":r.title,p=0;p<=2;p+=2)this.labelEnable[d+p]=!1,this.labels[d+p]=i(n),this.labelColor[d+p]=a(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]=a((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]=a(r.tickcolor),this.borderLineEnable[d+p]=!1,this.borderLineColor[d+p]=a(r.linecolor),this.borderLineWidth[d+p]=r.linewidth||0;u=this.hasSharedAxis(r),s=this.hasAxisInDfltPos(e,r)&&!u,c=this.hasAxisInAltrPos(e,r)&&!u,o=r.mirror||!1,f=u?-1!==String(o).indexOf("all"):!!o,h=u?"allticks"===o:-1!==String(o).indexOf("ticks"),s?this.labelEnable[d]=!0:c&&(this.labelEnable[d+2]=!0),s?this.tickEnable[d]=r.showticklabels:c&&(this.tickEnable[d+2]=r.showticklabels),(s||f)&&(this.borderLineEnable[d]=r.showline),(c||f)&&(this.borderLineEnable[d+2]=r.showline),(s||h)&&(this.tickMarkLength[d]=this.getTickMarkLength(r)),(c||h)&&(this.tickMarkLength[d+2]=this.getTickMarkLength(r)),this.gridLineEnable[d]=r.showgrid,this.gridLineColor[d]=a(r.gridcolor),this.gridLineWidth[d]=r.gridwidth,this.zeroLineEnable[d]=r.zeroline,this.zeroLineColor[d]=a(r.zerolinecolor),this.zeroLineWidth[d]=r.zerolinewidth}},s.hasSharedAxis=function(t){var e=this.scene,r=e.fullLayout._subplots.gl2d;return 0!==n.findSubplotsWithAxis(r,t).indexOf(e.id)},s.hasAxisInDfltPos=function(t,e){var r=e.side;return"xaxis"===t?"bottom"===r:"yaxis"===t?"left"===r:void 0},s.hasAxisInAltrPos=function(t,e){var r=e.side;return"xaxis"===t?"top"===r:"yaxis"===t?"right"===r:void 0},s.getLabelPad=function(t,e){var r=e.titlefont.size,n=e.showticklabels;return"xaxis"===t?"top"===e.side?r*(1.5+(n?1:0))-10:r*(1.5+(n?.5:0))-10:"yaxis"===t?"right"===e.side?10+r*(1.5+(n?1:.5)):10+r*(1.5+(n?.5:0)):void 0},s.getTickPad=function(t){return"outside"===t.ticks?10+t.ticklen:15},s.getTickMarkLength=function(t){if(!t.ticks)return 0;var e=t.ticklen;return"inside"===t.ticks?-e:e},e.exports=function(t){return new o(t)}},{"../../lib/html2unicode":722,"../../lib/str2rgbarray":746,"../cartesian/axes":770}],810:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("./scene2d"),a=t("../layout_attributes"),o=t("../../constants/xmlns_namespaces"),s=t("../cartesian/constants"),l=t("../cartesian"),c=t("../../components/fx/layout_attributes"),u=t("../get_data").getSubplotData;r.name="gl2d",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=s.idRegex,r.attrRegex=s.attrRegex,r.attributes=t("../cartesian/attributes"),r.supplyLayoutDefaults=function(t,e,r){e._has("cartesian")||l.supplyLayoutDefaults(t,e,r)},r.layoutAttrOverrides=n(l.layoutAttributes,"plot","from-root"),r.baseLayoutAttrOverrides=n({plot_bgcolor:a.plot_bgcolor,hoverlabel:c.hoverlabel},"plot","nested"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,n=e._subplots.gl2d,a=0;a<n.length;a++){var o=n[a],s=e._plots[o],l=u(r,"gl2d",o),c=s._scene2d;void 0===c&&(c=new i({id:o,graphDiv:t,container:t.querySelector(".gl-container"),staticPlot:t._context.staticPlot,plotGlPixelRatio:t._context.plotGlPixelRatio},e),s._scene2d=c),c.plot(l,t.calcdata,e,t.layout)}},r.clean=function(t,e,r,n){for(var i=n._subplots.gl2d||[],a=0;a<i.length;a++){var o=i[a],s=n._plots[o];if(s._scene2d)0===u(t,"gl2d",o).length&&(s._scene2d.destroy(),delete n._plots[o])}l.clean.apply(this,arguments)},r.drawFramework=function(t){t._context.staticPlot||l.drawFramework(t)},r.toSVG=function(t){for(var e=t._fullLayout,r=e._subplots.gl2d,n=0;n<r.length;n++){var i=e._plots[r[n]]._scene2d,a=i.toImage("png");e._glimages.append("svg:image").attr({xmlns:o.svg,"xlink:href":a,x:0,y:0,width:"100%",height:"100%",preserveAspectRatio:"none"}),i.destroy()}},r.updateFx=function(t){for(var e=t._subplots.gl2d,r=0;r<e.length;r++){t._plots[e[r]]._scene2d.updateFx(t.dragmode)}}},{"../../components/fx/layout_attributes":641,"../../constants/xmlns_namespaces":704,"../../plot_api/edit_types":754,"../cartesian":781,"../cartesian/attributes":769,"../cartesian/constants":775,"../get_data":807,"../layout_attributes":824,"./scene2d":811}],811:[function(t,e,r){"use strict";var n,i,a=t("../../registry"),o=t("../../plots/cartesian/axes"),s=t("../../components/fx"),l=t("gl-plot2d"),c=t("gl-spikes2d"),u=t("gl-select-box"),f=t("webgl-context"),h=t("./convert"),d=t("./camera"),p=t("../../lib/html2unicode"),m=t("../../lib/show_no_webgl_msg"),v=t("../cartesian/constraints"),g=v.enforce,y=v.clean,b=["xaxis","yaxis"],x=t("../cartesian/constants").SUBPLOT_PATTERN;function _(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.scrollZoom=this.graphDiv._context.scrollZoom,this.fullData=null,this.updateRefs(e),this.makeFramework(),this.glplotOptions=h(this),this.glplotOptions.merge(e),this.glplot=l(this.glplotOptions),this.camera=d(this),this.traces={},this.spikes=c(this.glplot),this.selectBox=u(this.glplot,{innerFill:!1,outerFill:!0}),this.lastButtonState=0,this.pickResult=null,this.isMouseOver=!0,this.bounds=[1/0,1/0,-1/0,-1/0],this.stopped=!1,this.redraw=this.draw.bind(this),this.redraw()}e.exports=_;var w=_.prototype;w.makeFramework=function(){if(this.staticPlot){if(!(i||(n=document.createElement("canvas"),i=f({canvas:n,preserveDrawingBuffer:!1,premultipliedAlpha:!0,antialias:!0}))))throw new Error("Error creating static canvas/context for image server");this.canvas=n,this.gl=i}else{var t=this.container.querySelector(".gl-canvas-focus"),e=f({canvas:t,preserveDrawingBuffer:!0,premultipliedAlpha:!0});e||m(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 a=this.svgContainer=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";var o=this.mouseContainer=document.createElement("div");o.style.position="absolute",o.style["pointer-events"]="auto",this.pickCanvas=this.container.querySelector(".gl-canvas-pick");var s=this.container;s.appendChild(a),s.appendChild(o);var l=this;o.addEventListener("mouseout",function(){l.isMouseOver=!1,l.unhover()}),o.addEventListener("mouseover",function(){l.isMouseOver=!0})},w.toImage=function(t){t||(t="png"),this.stopped=!0,this.staticPlot&&this.container.appendChild(n),this.updateSize(this.canvas);var e=this.glplot.gl,r=e.drawingBufferWidth,i=e.drawingBufferHeight;e.clearColor(1,1,1,0),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),this.glplot.setDirty(),this.glplot.draw(),e.bindFramebuffer(e.FRAMEBUFFER,null);var a=new Uint8Array(r*i*4);e.readPixels(0,0,r,i,e.RGBA,e.UNSIGNED_BYTE,a);for(var o=0,s=i-1;o<s;++o,--s)for(var l=0;l<r;++l)for(var c=0;c<4;++c){var u=a[4*(r*o+l)+c];a[4*(r*o+l)+c]=a[4*(r*s+l)+c],a[4*(r*s+l)+c]=u}var f=document.createElement("canvas");f.width=r,f.height=i;var h,d=f.getContext("2d"),p=d.createImageData(r,i);switch(p.data.set(a),d.putImageData(p,0,0),t){case"jpeg":h=f.toDataURL("image/jpeg");break;case"webp":h=f.toDataURL("image/webp");break;default:h=f.toDataURL("image/png")}return this.staticPlot&&this.container.removeChild(n),h},w.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),this.redraw&&this.redraw(),t},w.computeTickMarks=function(){this.xaxis.setScale(),this.yaxis.setScale();for(var t=[o.calcTicks(this.xaxis),o.calcTicks(this.yaxis)],e=0;e<2;++e)for(var r=0;r<t[e].length;++r)t[e][r].text=p(t[e][r].text+"");return t},w.updateRefs=function(t){this.fullLayout=t;var e=this.id.match(x),r="xaxis"+e[1],n="yaxis"+e[2];this.xaxis=this.fullLayout[r],this.yaxis=this.fullLayout[n]},w.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)},w.cameraChanged=function(){var t=this.camera;this.glplot.setDataBox(this.calcDataBox());var e=this.computeTickMarks();(function(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})(e,this.glplotOptions.ticks)&&(this.glplotOptions.ticks=e,this.glplotOptions.dataBox=t.dataBox,this.glplot.update(this.glplotOptions),this.handleAnnotations())},w.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&&a.getComponentMethod("annotations","drawOne")(t,r)}},w.destroy=function(){if(this.glplot){var t=this.traces;t&&Object.keys(t).map(function(e){t[e].dispose(),delete t[e]}),this.glplot.dispose(),this.container.removeChild(this.svgContainer),this.container.removeChild(this.mouseContainer),this.fullData=null,this.glplot=null,this.stopped=!0,this.camera.mouseListener.enabled=!1,this.mouseContainer.removeEventListener("wheel",this.camera.wheelListener),this.camera=null}},w.plot=function(t,e,r){var n=this.glplot;this.updateRefs(r),this.updateTraces(t,e),this.updateFx(r.dragmode);var i=r.width,a=r.height;this.updateSize(this.canvas);var s=this.glplotOptions;s.merge(r),s.screenBox=[0,0,i,a];var l={_fullLayout:{_axisConstraintGroups:this.graphDiv._fullLayout._axisConstraintGroups,xaxis:this.xaxis,yaxis:this.yaxis}};y(l,this.xaxis),y(l,this.yaxis);var c=r._size,u=this.xaxis.domain,f=this.yaxis.domain;s.viewBox=[c.l+u[0]*c.w,c.b+f[0]*c.h,i-c.r-(1-u[1])*c.w,a-c.t-(1-f[1])*c.h],this.mouseContainer.style.width=c.w*(u[1]-u[0])+"px",this.mouseContainer.style.height=c.h*(f[1]-f[0])+"px",this.mouseContainer.height=c.h*(f[1]-f[0]),this.mouseContainer.style.left=c.l+u[0]*c.w+"px",this.mouseContainer.style.top=c.t+(1-f[1])*c.h+"px";var h=this.bounds;h[0]=h[1]=1/0,h[2]=h[3]=-1/0;var d,p,m=Object.keys(this.traces);for(p=0;p<m.length;++p)for(var v=this.traces[m[p]],x=0;x<2;++x)h[x]=Math.min(h[x],v.bounds[x]),h[x+2]=Math.max(h[x+2],v.bounds[x+2]);for(p=0;p<2;++p)h[p]>h[p+2]&&(h[p]=-1,h[p+2]=1),(d=this[b[p]])._length=s.viewBox[p+2]-s.viewBox[p],o.doAutoRange(d),d.setScale();g(l),s.ticks=this.computeTickMarks(),s.dataBox=this.calcDataBox(),s.merge(r),n.update(s),this.glplot.draw()},w.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])]},w.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])]},w.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]).uid===o&&i.type===s.type)continue t;s.dispose(),delete this.traces[o]}for(r=0;r<t.length;r++){i=t[r];var l=e[r],c=this.traces[i.uid];c?c.update(i,l):(c=i._module.plot(this,i,l),this.traces[i.uid]=c)}this.glplot.objects.sort(function(t,e){return t._trace.index-e._trace.index})},w.updateFx=function(t){"lasso"===t||"select"===t?(this.pickCanvas.style["pointer-events"]="none",this.mouseContainer.style["pointer-events"]="none"):(this.pickCanvas.style["pointer-events"]="auto",this.mouseContainer.style["pointer-events"]="auto"),this.mouseContainer.style.cursor="pan"===t?"move":"zoom"===t?"crosshair":null},w.emitPointAction=function(t,e){for(var r,n=t.trace.uid,i=t.pointIndex,a=0;a<this.fullData.length;a++)this.fullData[a].uid===n&&(r=this.fullData[a]);var o={x:t.traceCoord[0],y:t.traceCoord[1],curveNumber:r.index,pointNumber:i,data:r._input,fullData:this.fullData,xaxis:this.xaxis,yaxis:this.yaxis};s.appendArrayPointValue(o,r,i),this.graphDiv.emit(e,{points:[o]})},w.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,o=r.x*t.pixelRatio,l=this.canvas.height-t.pixelRatio*r.y;if(e.boxEnabled&&"zoom"===i.dragmode){this.selectBox.enabled=!0;for(var c=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])],u=0;u<2;u++)e.boxStart[u]===e.boxEnd[u]&&(c[u]=t.dataBox[u],c[u+2]=t.dataBox[u+2]);t.setDirty()}else if(!e.panning&&this.isMouseOver){this.selectBox.enabled=!1;var f=i._size,h=this.xaxis.domain,d=this.yaxis.domain,p=(a=t.pick(o/t.pixelRatio+f.l+h[0]*f.w,l/t.pixelRatio-(f.t+(1-d[1])*f.h)))&&a.object._trace.handlePick(a);if(p&&n&&this.emitPointAction(p,"plotly_click"),a&&"skip"!==a.object._trace.hoverinfo&&i.hovermode&&p&&(!this.lastPickResult||this.lastPickResult.traceUid!==p.trace.uid||this.lastPickResult.dataCoord[0]!==p.dataCoord[0]||this.lastPickResult.dataCoord[1]!==p.dataCoord[1])){var m=p;this.lastPickResult={traceUid:p.trace?p.trace.uid:null,dataCoord:p.dataCoord.slice()},this.spikes.update({center:a.dataCoord}),m.screenCoord=[((t.viewBox[2]-t.viewBox[0])*(a.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])*(a.dataCoord[1]-t.dataBox[1])/(t.dataBox[3]-t.dataBox[1])-t.viewBox[1])/t.pixelRatio],this.emitPointAction(p,"plotly_hover");var v=this.fullData[m.trace.index]||{},g=m.pointIndex,y=s.castHoverinfo(v,i,g);if(y&&"all"!==y){var b=y.split("+");-1===b.indexOf("x")&&(m.traceCoord[0]=void 0),-1===b.indexOf("y")&&(m.traceCoord[1]=void 0),-1===b.indexOf("z")&&(m.traceCoord[2]=void 0),-1===b.indexOf("text")&&(m.textLabel=void 0),-1===b.indexOf("name")&&(m.name=void 0)}s.loneHover({x:m.screenCoord[0],y:m.screenCoord[1],xLabel:this.hoverFormatter("xaxis",m.traceCoord[0]),yLabel:this.hoverFormatter("yaxis",m.traceCoord[1]),zLabel:m.traceCoord[2],text:m.textLabel,name:m.name,color:s.castHoverOption(v,g,"bgcolor")||m.color,borderColor:s.castHoverOption(v,g,"bordercolor"),fontFamily:s.castHoverOption(v,g,"font.family"),fontSize:s.castHoverOption(v,g,"font.size"),fontColor:s.castHoverOption(v,g,"font.color")},{container:this.svgContainer,gd:this.graphDiv})}}a||this.unhover(),t.draw()}},w.unhover=function(){this.lastPickResult&&(this.spikes.update({}),this.lastPickResult=null,this.graphDiv.emit("plotly_unhover"),s.loneUnhover(this.svgContainer))},w.hoverFormatter=function(t,e){if(void 0!==e){var r=this[t];return o.tickText(r,r.c2l(e),"hover").text}}},{"../../components/fx":640,"../../lib/html2unicode":722,"../../lib/show_no_webgl_msg":744,"../../plots/cartesian/axes":770,"../../registry":854,"../cartesian/constants":775,"../cartesian/constraints":777,"./camera":808,"./convert":809,"gl-plot2d":208,"gl-select-box":218,"gl-spikes2d":227,"webgl-context":557}],812:[function(t,e,r){"use strict";e.exports=function(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 c=i({center:e.center||[0,0,0],up:e.up||[0,1,0],eye:e.eye||[0,0,10],mode:e.mode||"orbit",distanceLimits:r}),u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],f=0,h=t.clientWidth,d=t.clientHeight,p={keyBindingMode:"rotate",view:c,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:c.modes,tick:function(){var e=n(),r=this.delay,i=e-2*r;c.idle(e-r),c.recalcMatrix(i),c.flush(e-(100+2*r));for(var a=!0,o=c.computedMatrix,s=0;s<16;++s)a=a&&u[s]===o[s],u[s]=o[s];var l=t.clientWidth===h&&t.clientHeight===d;return h=t.clientWidth,d=t.clientHeight,a?!l:(f=Math.exp(c.computedRadius[0]),!0)},lookAt:function(t,e,r){c.lookAt(c.lastT(),t,e,r)},rotate:function(t,e,r){c.rotate(c.lastT(),t,e,r)},pan:function(t,e,r){c.pan(c.lastT(),t,e,r)},translate:function(t,e,r){c.translate(c.lastT(),t,e,r)}};Object.defineProperties(p,{matrix:{get:function(){return c.computedMatrix},set:function(t){return c.setMatrix(c.lastT(),t),c.computedMatrix},enumerable:!0},mode:{get:function(){return c.getMode()},set:function(t){var e=c.computedUp.slice(),r=c.computedEye.slice(),i=c.computedCenter.slice();if(c.setMode(t),"turntable"===t){var a=n();c._active.lookAt(a,r,i,e),c._active.lookAt(a+500,r,i,[0,0,1]),c._active.flush(a)}return c.getMode()},enumerable:!0},center:{get:function(){return c.computedCenter},set:function(t){return c.lookAt(c.lastT(),null,t),c.computedCenter},enumerable:!0},eye:{get:function(){return c.computedEye},set:function(t){return c.lookAt(c.lastT(),t),c.computedEye},enumerable:!0},up:{get:function(){return c.computedUp},set:function(t){return c.lookAt(c.lastT(),null,null,t),c.computedUp},enumerable:!0},distance:{get:function(){return f},set:function(t){return c.setDistance(c.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return c.getDistanceLimits(r)},set:function(t){return c.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener("contextmenu",function(t){return t.preventDefault(),!1});var m=0,v=0,g={shift:!1,control:!1,alt:!1,meta:!1};function y(e,r,i,a){var o=p.keyBindingMode;if(!1!==o){var s="rotate"===o,l="pan"===o,u="zoom"===o,h=!!a.control,d=!!a.alt,y=!!a.shift,b=!!(1&e),x=!!(2&e),_=!!(4&e),w=1/t.clientHeight,M=w*(r-m),k=w*(i-v),A=p.flipX?1:-1,T=p.flipY?1:-1,E=n(),S=Math.PI*p.rotateSpeed;if((s&&b&&!h&&!d&&!y||b&&!h&&!d&&y)&&c.rotate(E,A*S*M,-T*S*k,0),(l&&b&&!h&&!d&&!y||x||b&&h&&!d&&!y)&&c.pan(E,-p.translateSpeed*M*f,p.translateSpeed*k*f,0),u&&b&&!h&&!d&&!y||_||b&&!h&&d&&!y){var L=-p.zoomSpeed*k/window.innerHeight*(E-c.lastT())*100;c.pan(E,0,0,f*(Math.exp(L)-1))}return m=r,v=i,g=a,!0}}return p.mouseListener=a(t,y),t.addEventListener("touchstart",function(e){var r=s(e.changedTouches[0],t);y(0,r[0],r[1],g),y(1,r[0],r[1],g),e.preventDefault()},!!l&&{passive:!1}),t.addEventListener("touchmove",function(e){var r=s(e.changedTouches[0],t);y(1,r[0],r[1],g),e.preventDefault()},!!l&&{passive:!1}),t.addEventListener("touchend",function(t){y(0,m,v,g),t.preventDefault()},!!l&&{passive:!1}),p.wheelListener=o(t,function(t,e){if(!1!==p.keyBindingMode){var r=p.flipX?1:-1,i=p.flipY?1:-1,a=n();if(Math.abs(t)>Math.abs(e))c.rotate(a,0,0,-t*r*Math.PI*p.rotateSpeed/window.innerWidth);else{var o=-p.zoomSpeed*i*e/window.innerHeight*(a-c.lastT())/20;c.pan(a,0,0,f*(Math.exp(o)-1))}}},!0),p};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset"),l=t("has-passive-events")},{"3d-view":40,"has-passive-events":256,"mouse-change":424,"mouse-event-offset":425,"mouse-wheel":427,"right-now":489}],813:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../components/fx/layout_attributes"),a=t("./scene"),o=t("../get_data").getSubplotData,s=t("../../lib"),l=t("../../constants/xmlns_namespaces");r.name="gl3d",r.attr="scene",r.idRoot="scene",r.idRegex=r.attrRegex=s.counterRegex("scene"),r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.baseLayoutAttrOverrides=n({hoverlabel:i.hoverlabel},"plot","nested"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,n=e._subplots.gl3d,i=0;i<n.length;i++){var l=n[i],c=o(r,"gl3d",l),u=e[l],f=u._scene;f||(f=new a({id:l,graphDiv:t,container:t.querySelector(".gl-container"),staticPlot:t._context.staticPlot,plotGlPixelRatio:t._context.plotGlPixelRatio},e),u._scene=f),f.cameraInitial||(f.cameraInitial=s.extendDeep({},u.camera)),f.plot(c,e,t.layout)}},r.clean=function(t,e,r,n){for(var i=n._subplots.gl3d||[],a=0;a<i.length;a++){var o=i[a];!e[o]&&n[o]._scene&&(n[o]._scene.destroy(),n._infolayer&&n._infolayer.selectAll(".annotation-"+o).remove())}},r.toSVG=function(t){for(var e=t._fullLayout,r=e._subplots.gl3d,n=e._size,i=0;i<r.length;i++){var a=e[r[i]],o=a.domain,s=a._scene,c=s.toImage("png");e._glimages.append("svg:image").attr({xmlns:l.svg,"xlink:href":c,x:n.l+n.w*o.x[0],y:n.t+n.h*(1-o.y[1]),width:n.w*(o.x[1]-o.x[0]),height:n.h*(o.y[1]-o.y[0]),preserveAspectRatio:"none"}),s.destroy()}},r.cleanId=function(t){if(t.match(/^scene[0-9]*$/)){var e=t.substr(5);return"1"===e&&(e=""),"scene"+e}},r.updateFx=function(t){for(var e=t._subplots.gl3d,r=0;r<e.length;r++){t[e[r]]._scene.updateFx(t.dragmode,t.hovermode)}}},{"../../components/fx/layout_attributes":641,"../../constants/xmlns_namespaces":704,"../../lib":724,"../../plot_api/edit_types":754,"../get_data":807,"./layout/attributes":814,"./layout/defaults":818,"./layout/layout_attributes":819,"./scene":823}],814:[function(t,e,r){"use strict";e.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}},{}],815:[function(t,e,r){"use strict";var n=t("../../../components/color"),i=t("../../cartesian/layout_attributes"),a=t("../../../lib/extend").extendFlat,o=t("../../../plot_api/edit_types").overrideAll;e.exports=o({visible:i.visible,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,tickformatstops:i.tickformatstops,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},"plot","from-root")},{"../../../components/color":598,"../../../lib/extend":713,"../../../plot_api/edit_types":754,"../../cartesian/layout_attributes":782}],816:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,i=t("../../../lib"),a=t("./axis_attributes"),o=t("../../cartesian/type_defaults"),s=t("../../cartesian/axis_defaults"),l=["xaxis","yaxis","zaxis"];e.exports=function(t,e,r){var c,u;function f(t,e){return i.coerce(c,u,a,t,e)}for(var h=0;h<l.length;h++){var d=l[h];c=t[d]||{},u=e[d]={_id:d[0]+r.scene,_name:d},o(c,u,f,r.data),s(c,u,f,{font:r.font,letter:d[0],data:r.data,showGrid:!0,bgColor:r.bgColor,calendar:r.calendar},r.fullLayout),f("gridcolor",n(u.color,r.bgColor,13600/187).toRgbString()),f("title",d[0]),u.setScale=i.noop,f("showspikes")&&(f("spikesides"),f("spikethickness"),f("spikecolor",u.color)),f("showaxeslabels"),f("showbackground")&&f("backgroundcolor")}}},{"../../../lib":724,"../../cartesian/axis_defaults":772,"../../cartesian/type_defaults":794,"./axis_attributes":815,tinycolor2:526}],817:[function(t,e,r){"use strict";var n=t("../../../lib/html2unicode"),i=t("../../../lib/str2rgbarray"),a=["xaxis","yaxis","zaxis"];function o(){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=this.tickPad.slice(),this._defaultLabelPad=this.labelPad.slice(),this._defaultLineTickLength=this.lineTickLength.slice()}o.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[a[e]];r.visible?(this.labels[e]=n(r.title),"titlefont"in r&&(r.titlefont.color&&(this.labelColor[e]=i(r.titlefont.color)),r.titlefont.family&&(this.labelFont[e]=r.titlefont.family),r.titlefont.size&&(this.labelSize[e]=r.titlefont.size)),"showline"in r&&(this.lineEnable[e]=r.showline),"linecolor"in r&&(this.lineColor[e]=i(r.linecolor)),"linewidth"in r&&(this.lineWidth[e]=r.linewidth),"showgrid"in r&&(this.gridEnable[e]=r.showgrid),"gridcolor"in r&&(this.gridColor[e]=i(r.gridcolor)),"gridwidth"in r&&(this.gridWidth[e]=r.gridwidth),"log"===r.type?this.zeroEnable[e]=!1:"zeroline"in r&&(this.zeroEnable[e]=r.zeroline),"zerolinecolor"in r&&(this.zeroLineColor[e]=i(r.zerolinecolor)),"zerolinewidth"in r&&(this.zeroLineWidth[e]=r.zerolinewidth),"ticks"in r&&r.ticks?this.lineTickEnable[e]=!0:this.lineTickEnable[e]=!1,"ticklen"in r&&(this.lineTickLength[e]=this._defaultLineTickLength[e]=r.ticklen),"tickcolor"in r&&(this.lineTickColor[e]=i(r.tickcolor)),"tickwidth"in r&&(this.lineTickWidth[e]=r.tickwidth),"tickangle"in r&&(this.tickAngle[e]="auto"===r.tickangle?0:Math.PI*-r.tickangle/180),"showticklabels"in r&&(this.tickEnable[e]=r.showticklabels),"tickfont"in r&&(r.tickfont.color&&(this.tickColor[e]=i(r.tickfont.color)),r.tickfont.family&&(this.tickFont[e]=r.tickfont.family),r.tickfont.size&&(this.tickSize[e]=r.tickfont.size)),"mirror"in r?-1!==["ticks","all","allticks"].indexOf(r.mirror)?(this.lineTickMirror[e]=!0,this.lineMirror[e]=!0):!0===r.mirror?(this.lineTickMirror[e]=!1,this.lineMirror[e]=!0):(this.lineTickMirror[e]=!1,this.lineMirror[e]=!1):this.lineMirror[e]=!1,"showbackground"in r&&!1!==r.showbackground?(this.backgroundEnable[e]=!0,this.backgroundColor[e]=i(r.backgroundcolor)):this.backgroundEnable[e]=!1):(this.tickEnable[e]=!1,this.labelEnable[e]=!1,this.lineEnable[e]=!1,this.lineTickEnable[e]=!1,this.gridEnable[e]=!1,this.zeroEnable[e]=!1,this.backgroundEnable[e]=!1)}},e.exports=function(t){var e=new o;return e.merge(t),e}},{"../../../lib/html2unicode":722,"../../../lib/str2rgbarray":746}],818:[function(t,e,r){"use strict";var n=t("../../../lib"),i=t("../../../components/color"),a=t("../../../registry"),o=t("../../subplot_defaults"),s=t("./axis_defaults"),l=t("./layout_attributes");function c(t,e,r,n){for(var o=r("bgcolor"),l=i.combine(o,n.paper_bgcolor),c=["up","center","eye"],u=0;u<c.length;u++)r("camera."+c[u]+".x"),r("camera."+c[u]+".y"),r("camera."+c[u]+".z");var f=!!r("aspectratio.x")&&!!r("aspectratio.y")&&!!r("aspectratio.z"),h=r("aspectmode",f?"manual":"auto");f||(t.aspectratio=e.aspectratio={x:1,y:1,z:1},"manual"===h&&(e.aspectmode="auto"),t.aspectmode=e.aspectmode),s(t,e,{font:n.font,scene:n.id,data:n.fullData,bgColor:l,calendar:n.calendar,fullLayout:n.fullLayout}),a.getComponentMethod("annotations3d","handleDefaults")(t,e,n),r("dragmode",n.getDfltFromLayout("dragmode")),r("hovermode",n.getDfltFromLayout("hovermode"))}e.exports=function(t,e,r){var i=e._basePlotModules.length>1;o(t,e,r,{type:"gl3d",attributes:l,handleDefaults:c,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!i)return n.validate(t[e],l[e])?t[e]:void 0},paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":598,"../../../lib":724,"../../../registry":854,"../../subplot_defaults":846,"./axis_defaults":816,"./layout_attributes":819}],819:[function(t,e,r){"use strict";var n=t("./axis_attributes"),i=t("../../domain_attributes"),a=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;function s(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(s(0,0,1),{}),center:a(s(0,0,0),{}),eye:a(s(1.25,1.25,1.25),{}),editType:"camera"},domain:i({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],dflt:"turntable",editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":724,"../../../lib/extend":713,"../../domain_attributes":796,"./axis_attributes":815}],820:[function(t,e,r){"use strict";var n=t("../../../lib/str2rgbarray"),i=["xaxis","yaxis","zaxis"];function a(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}a.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[i[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=n(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new a;return e.merge(t),e}},{"../../../lib/str2rgbarray":746}],821:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,l=t.fullSceneLayout,c=[[],[],[]],u=0;u<3;++u){var f=l[o[u]];if(f._length=(r[u].hi-r[u].lo)*r[u].pixelsPerDataUnit/t.dataScale[u],Math.abs(f._length)===1/0)c[u]=[];else{f._input_range=f.range.slice(),f.range[0]=r[u].lo/t.dataScale[u],f.range[1]=r[u].hi/t.dataScale[u],f._m=1/(t.dataScale[u]*r[u].pixelsPerDataUnit),f.range[0]===f.range[1]&&(f.range[0]-=1,f.range[1]+=1);var h=f.tickmode;if("auto"===f.tickmode){f.tickmode="linear";var d=f.nticks||i.constrain(f._length/40,4,9);n.autoTicks(f,Math.abs(f.range[1]-f.range[0])/d)}for(var p=n.calcTicks(f),m=0;m<p.length;++m)p[m].x=p[m].x*t.dataScale[u],p[m].text=a(p[m].text);c[u]=p,f.tickmode=h}}e.ticks=c;for(var u=0;u<3;++u){s[u]=.5*(t.glplot.bounds[0][u]+t.glplot.bounds[1][u]);for(var m=0;m<2;++m)e.bounds[m][u]=t.glplot.bounds[m][u]}t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;a<n.length;++a)i[a]=n[a].x;e[r]=i}return e}(c)};var n=t("../../cartesian/axes"),i=t("../../../lib"),a=t("../../../lib/html2unicode"),o=["xaxis","yaxis","zaxis"],s=[0,0,0]},{"../../../lib":724,"../../../lib/html2unicode":722,"../../cartesian/axes":770}],822:[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}e.exports=function(t,e){return n(t.projection,n(t.view,n(t.model,[e[0],e[1],e[2],1])))}},{}],823:[function(t,e,r){"use strict";var n,i,a=t("gl-plot3d"),o=t("webgl-context"),s=t("has-passive-events"),l=t("../../registry"),c=t("../../lib"),u=t("../../plots/cartesian/axes"),f=t("../../components/fx"),h=t("../../lib/str2rgbarray"),d=t("../../lib/show_no_webgl_msg"),p=t("./camera"),m=t("./project"),v=t("./layout/convert"),g=t("./layout/spikes"),y=t("./layout/tick_marks");function b(t,e,r,l){var h={canvas:r,gl:l,container:t.container,axes:t.axesOptions,spikes:t.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1};if(t.staticMode){if(!(i||(n=document.createElement("canvas"),i=o({canvas:n,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}))))throw new Error("error creating static canvas/context for image server");h.pixelRatio=t.pixelRatio,h.gl=i,h.canvas=n}try{t.glplot=a(h)}catch(e){d(t)}var v=function(t){if(!1!==t.fullSceneLayout.dragmode){var e={};e[t.id+".camera"]=A(t.camera),t.saveCamera(t.graphDiv.layout),t.graphDiv.emit("plotly_relayout",e)}};if(t.glplot.canvas.addEventListener("mouseup",v.bind(null,t)),t.glplot.canvas.addEventListener("wheel",v.bind(null,t),!!s&&{passive:!1}),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",function(t){c.warn("Lost WebGL context."),t.preventDefault()}),!t.camera){var g=t.fullSceneLayout.camera;t.camera=p(t.container,{center:[g.center.x,g.center.y,g.center.z],eye:[g.eye.x,g.eye.y,g.eye.z],up:[g.up.x,g.up.y,g.up.z],zoomMin:.1,zoomMax:100,mode:"orbit"})}return t.glplot.camera=t.camera,t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(t){var e,r=t.svgContainer,n=t.container.getBoundingClientRect(),i=n.width,a=n.height;r.setAttributeNS(null,"viewBox","0 0 "+i+" "+a),r.setAttributeNS(null,"width",i),r.setAttributeNS(null,"height",a),y(t),t.glplot.axes.update(t.axesOptions);for(var o,s=Object.keys(t.traces),l=null,c=t.glplot.selection,h=0;h<s.length;++h)"skip"!==(e=t.traces[s[h]]).data.hoverinfo&&e.handlePick(c)&&(l=e),e.setContourLevels&&e.setContourLevels();function d(e,r){var n=t.fullSceneLayout[e];return u.tickText(n,n.d2l(r),"hover").text}if(null!==l){var p=m(t.glplot.cameraParams,c.dataCoordinate);e=l.data;var v=c.index,g=f.castHoverinfo(e,t.fullLayout,v),b=d("xaxis",c.traceCoordinate[0]),x=d("yaxis",c.traceCoordinate[1]),_=d("zaxis",c.traceCoordinate[2]);if("all"!==g){var w=g.split("+");-1===w.indexOf("x")&&(b=void 0),-1===w.indexOf("y")&&(x=void 0),-1===w.indexOf("z")&&(_=void 0),-1===w.indexOf("text")&&(c.textLabel=void 0),-1===w.indexOf("name")&&(l.name=void 0)}t.fullSceneLayout.hovermode&&f.loneHover({x:(.5+.5*p[0]/p[3])*i,y:(.5-.5*p[1]/p[3])*a,xLabel:b,yLabel:x,zLabel:_,text:c.textLabel,name:l.name,color:f.castHoverOption(e,v,"bgcolor")||l.color,borderColor:f.castHoverOption(e,v,"bordercolor"),fontFamily:f.castHoverOption(e,v,"font.family"),fontSize:f.castHoverOption(e,v,"font.size"),fontColor:f.castHoverOption(e,v,"font.color")},{container:r,gd:t.graphDiv});var M={x:c.traceCoordinate[0],y:c.traceCoordinate[1],z:c.traceCoordinate[2],data:e._input,fullData:e,curveNumber:e.index,pointNumber:v};f.appendArrayPointValue(M,e,v);var k={points:[M]};c.buttons&&c.distance<5?t.graphDiv.emit("plotly_click",k):t.graphDiv.emit("plotly_hover",k),o=k}else f.loneUnhover(r),t.graphDiv.emit("plotly_unhover",o);t.drawAnnotations(t)}.bind(null,t),t.traces={},!0}function x(t,e){var r=document.createElement("div"),n=t.container;this.graphDiv=t.graphDiv;var i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.style.position="absolute",i.style.top=i.style.left="0px",i.style.width=i.style.height="100%",i.style["z-index"]=20,i.style["pointer-events"]="none",r.appendChild(i),this.svgContainer=i,r.id=t.id,r.style.position="absolute",r.style.top=r.style.left="0px",r.style.width=r.style.height="100%",n.appendChild(r),this.fullLayout=e,this.id=t.id||"scene",this.fullSceneLayout=e[this.id],this.plotArgs=[[],{},{}],this.axesOptions=v(e[this.id]),this.spikeOptions=g(e[this.id]),this.container=r,this.staticMode=!!t.staticPlot,this.pixelRatio=t.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=l.getComponentMethod("annotations3d","convert"),this.drawAnnotations=l.getComponentMethod("annotations3d","draw"),b(this)}var _=x.prototype;_.recoverContext=function(){var t=this,e=this.glplot.gl,r=this.glplot.canvas;this.glplot.dispose(),requestAnimationFrame(function n(){e.isContextLost()?requestAnimationFrame(n):b(t,t.fullLayout,r,e)?t.plot.apply(t,t.plotArgs):c.error("Catastrophic and unrecoverable WebGL error. Context lost.")})};var w=["xaxis","yaxis","zaxis"];function M(t,e,r,n,i,a){var o;if(!Array.isArray(e))return i[0][n]=Math.min(i[0][n],0),void(i[1][n]=Math.max(i[1][n],r-1));for(var s=0;s<(r||e.length);++s)if(Array.isArray(e[s]))for(var l=0;l<e[s].length;++l)o=t.d2l(e[s][l],0,a),!isNaN(o)&&isFinite(o)&&(i[0][n]=Math.min(i[0][n],o),i[1][n]=Math.max(i[1][n],o));else o=t.d2l(e[s],0,a),!isNaN(o)&&isFinite(o)&&(i[0][n]=Math.min(i[0][n],o),i[1][n]=Math.max(i[1][n],o))}function k(t,e,r){var n=t.fullSceneLayout;M(n.xaxis,e.x,e._xlength,0,r,e.xcalendar),M(n.yaxis,e.y,e._ylength,1,r,e.ycalendar),M(n.zaxis,e.z,e._zlength,2,r,e.zcalendar)}function A(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]}}}_.plot=function(t,e,r){if(this.plotArgs=[t,e,r],!this.glplot.contextLost){var n,i,a,o,s,l,c=e[this.id],u=r[this.id];c.bgcolor?this.glplot.clearColor=h(c.bgcolor):this.glplot.clearColor=[0,0,0,0],this.glplot.snapToData=!0,this.fullLayout=e,this.fullSceneLayout=c,this.glplotLayout=c,this.axesOptions.merge(c),this.spikeOptions.merge(c),this.setCamera(c.camera),this.updateFx(c.dragmode,c.hovermode),this.glplot.update({}),this.setConvert(s),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)!0===(n=t[a]).visible&&k(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,this.convertAnnotations(this),a=0;a<t.length;++a)!0===(n=t[a]).visible&&((i=this.traces[n.uid])?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]&&!0===t[o].visible)continue t;(i=this.traces[p[a]]).dispose(),delete this.traces[p[a]]}this.glplot.objects.sort(function(t,e){return t._trace.data.index-e._trace.data.index});var m=[[0,0,0],[0,0,0]],v=[],g={};for(a=0;a<3;++a){if((l=(s=c[w[a]]).type)in g?(g[l].acc*=d[a],g[l].count+=1):g[l]={acc:d[a],count:1},s.autorange){m[0][a]=1/0,m[1][a]=-1/0;var y=this.glplot.objects,b=this.fullSceneLayout.annotations||[],x=s._name.charAt(0);for(o=0;o<y.length;o++){var _=y[o].bounds;m[0][a]=Math.min(m[0][a],_[0][a]/d[a]),m[1][a]=Math.max(m[1][a],_[1][a]/d[a])}for(o=0;o<b.length;o++){var M=b[o];if(M.visible){var A=s.r2l(M[x]);m[0][a]=Math.min(m[0][a],A),m[1][a]=Math.max(m[1][a],A)}}if("rangemode"in s&&"tozero"===s.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 T=m[1][a]-m[0][a];m[0][a]-=T/32,m[1][a]+=T/32}}else{var E=s.range;m[0][a]=s.r2l(E[0]),m[1][a]=s.r2l(E[1])}m[0][a]===m[1][a]&&(m[0][a]-=1,m[1][a]+=1),v[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 S=[1,1,1];for(a=0;a<3;++a){var L=g[l=(s=c[w[a]]).type];S[a]=Math.pow(L.acc,1/L.count)/d[a]}var C;if("auto"===c.aspectmode)C=Math.max.apply(null,S)/Math.min.apply(null,S)<=4?S:[1,1,1];else if("cube"===c.aspectmode)C=[1,1,1];else if("data"===c.aspectmode)C=S;else{if("manual"!==c.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var P=c.aspectratio;C=[P.x,P.y,P.z]}c.aspectratio.x=u.aspectratio.x=C[0],c.aspectratio.y=u.aspectratio.y=C[1],c.aspectratio.z=u.aspectratio.z=C[2],this.glplot.aspect=C;var z=c.domain||null,O=e._size||null;if(z&&O){var D=this.container.style;D.position="absolute",D.left=O.l+z.x[0]*O.w+"px",D.top=O.t+(1-z.y[1])*O.h+"px",D.width=O.w*(z.x[1]-z.x[0])+"px",D.height=O.h*(z.y[1]-z.y[0])+"px"}this.glplot.redraw()}},_.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=this.glplot.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},_.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),A(this.glplot.camera)},_.setCamera=function(t){var e;this.glplot.camera.lookAt.apply(this,[[(e=t).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]])},_.saveCamera=function(t){var e=this.getCamera(),r=c.nestedProperty(t,this.id+".camera"),n=r.get(),i=!1;function a(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return e[i[r]]&&t[i[r]][a[n]]===e[i[r]][a[n]]}if(void 0===n)i=!0;else for(var o=0;o<3;o++)for(var s=0;s<3;s++)if(!a(e,n,o,s)){i=!0;break}return i&&r.set(e),i},_.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},_.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(n),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,i=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var a=new Uint8Array(r*i*4);e.readPixels(0,0,r,i,e.RGBA,e.UNSIGNED_BYTE,a);for(var o=0,s=i-1;o<s;++o,--s)for(var l=0;l<r;++l)for(var c=0;c<4;++c){var u=a[4*(r*o+l)+c];a[4*(r*o+l)+c]=a[4*(r*s+l)+c],a[4*(r*s+l)+c]=u}var f=document.createElement("canvas");f.width=r,f.height=i;var h,d=f.getContext("2d"),p=d.createImageData(r,i);switch(p.data.set(a),d.putImageData(p,0,0),t){case"jpeg":h=f.toDataURL("image/jpeg");break;case"webp":h=f.toDataURL("image/webp");break;default:h=f.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(n),h},_.setConvert=function(){for(var t=0;t<3;t++){var e=this.fullSceneLayout[w[t]];u.setConvert(e,this.fullLayout),e.setScale=c.noop}},e.exports=x},{"../../components/fx":640,"../../lib":724,"../../lib/show_no_webgl_msg":744,"../../lib/str2rgbarray":746,"../../plots/cartesian/axes":770,"../../registry":854,"./camera":812,"./layout/convert":817,"./layout/spikes":820,"./layout/tick_marks":821,"./project":822,"gl-plot3d":210,"has-passive-events":256,"webgl-context":557}],824:[function(t,e,r){"use strict";var n=t("./font_attributes"),i=t("../components/color/attributes"),a=n({editType:"calc"});a.family.dflt='"Open Sans", verdana, arial, sans-serif',a.size.dflt=12,a.color.dflt=i.defaultLine,e.exports={font:a,title:{valType:"string",editType:"layoutstyle"},titlefont:n({editType:"layoutstyle"}),autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"none"},height:{valType:"number",min:10,dflt:450,editType:"none"},margin:{l:{valType:"number",min:0,dflt:80,editType:"calc"},r:{valType:"number",min:0,dflt:80,editType:"calc"},t:{valType:"number",min:0,dflt:100,editType:"calc"},b:{valType:"number",min:0,dflt:80,editType:"calc"},pad:{valType:"number",min:0,dflt:0,editType:"calc"},autoexpand:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},paper_bgcolor:{valType:"color",dflt:i.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:i.background,editType:"layoutstyle"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:i.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"}}},{"../components/color/attributes":597,"./font_attributes":797}],825:[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."}},{}],826:[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,c=["",""],u=[0,0];switch(i){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(a){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}},{"../../lib":724}],827:[function(t,e,r){"use strict";var n=t("mapbox-gl"),i=t("../../lib"),a=t("../../plots/get_data").getSubplotCalcData,o=t("../../constants/xmlns_namespaces"),s=t("./mapbox"),l=t("./constants");r.name="mapbox",r.attr="subplot",r.idRoot="mapbox",r.idRegex=r.attrRegex=i.counterRegex("mapbox"),r.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,o=e._subplots.mapbox,c=function(t,e){var r=t._fullLayout;if(""===t._context.mapboxAccessToken)return"";for(var n=0;n<e.length;n++){var i=r[e[n]];if(i.accesstoken)return i.accesstoken}throw new Error(l.noAccessTokenErrorMsg)}(t,o);n.accessToken=c;for(var u=0;u<o.length;u++){var f=o[u],h=a(r,"mapbox",f),d=e[f],p=d._subplot;p||(p=s({gd:t,container:e._glcontainer.node(),id:f,fullLayout:e,staticPlot:t._context.staticPlot}),e[f]._subplot=p),p.viewInitial||(p.viewInitial={center:i.extendFlat({},d.center),zoom:d.zoom,bearing:d.bearing,pitch:d.pitch}),p.plot(h,e,t._promises)}},r.clean=function(t,e,r,n){for(var i=n._subplots.mapbox||[],a=0;a<i.length;a++){var o=i[a];!e[o]&&n[o]._subplot&&n[o]._subplot.destroy()}},r.toSVG=function(t){for(var e=t._fullLayout,r=e._subplots.mapbox,n=e._size,i=0;i<r.length;i++){var a=e[r[i]],s=a.domain,l=a._subplot,c=l.toImage("png");e._glimages.append("svg:image").attr({xmlns:o.svg,"xlink:href":c,x:n.l+n.w*s.x[0],y:n.t+n.h*(1-s.y[1]),width:n.w*(s.x[1]-s.x[0]),height:n.h*(s.y[1]-s.y[0]),preserveAspectRatio:"none"}),l.destroy()}},r.updateFx=function(t){for(var e=t._subplots.mapbox,r=0;r<e.length;r++){t[e[r]]._subplot.updateFx(t)}}},{"../../constants/xmlns_namespaces":704,"../../lib":724,"../../plots/get_data":807,"./constants":825,"./layout_attributes":829,"./layout_defaults":830,"./mapbox":831,"mapbox-gl":315}],828:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./convert_text_opts");function a(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}var o=a.prototype;function s(t){var e=t.source;return n.isPlainObject(e)||"string"==typeof e&&e.length>0}o.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=s(t)},o.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},o.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==t.below},o.updateSource=function(t){var e=this.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,s(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,i={type:r};"geojson"===r?e="data":"vector"===r&&(e="string"==typeof n?"url":"tiles");return i[e]=n,i}(t);e.addSource(this.idSource,r)}},o.updateLayer=function(t){var e=this.map;if(e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),this.layerType=t.type,s(t)){e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type},t.below);this.mapbox.setOptions(this.idLayer,"setLayoutProperty",{visibility:"visible"})}},o.updateStyle=function(t){var e=function(t){var e={},r={};switch(t.type){case"circle":n.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":n.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity});break;case"fill":n.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var a=t.symbol,o=i(a.textposition,a.iconsize);n.extendFlat(e,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset}),n.extendFlat(r,{"icon-color":t.color,"text-color":a.textfont.color,"text-opacity":t.opacity})}return{layout:e,paint:r}}(t);s(t)&&(this.mapbox.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.mapbox.setOptions(this.idLayer,"setPaintProperty",e.paint))},o.dispose=function(){var t=this.map;t.removeLayer(this.idLayer),t.removeSource(this.idSource)},e.exports=function(t,e,r){var n=new a(t,e);return n.update(r),n}},{"../../lib":724,"./convert_text_opts":826}],829:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color").defaultLine,a=t("../domain_attributes"),o=t("../font_attributes"),s=t("../../traces/scatter/attributes").textposition,l=t("../../plot_api/edit_types").overrideAll,c=o({});c.family.dflt="Open Sans Regular, Arial Unicode MS Regular",e.exports=l({_arrayAttrRegexps:[n.counterRegex("mapbox",".layers",!0)],domain:a({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],dflt:"basic"},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},layers:{_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:c,textposition:n.extendFlat({},s,{arrayOk:!1})}}},"plot","from-root")},{"../../components/color":598,"../../lib":724,"../../plot_api/edit_types":754,"../../traces/scatter/attributes":1048,"../domain_attributes":796,"../font_attributes":797}],830:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../subplot_defaults"),a=t("./layout_attributes");function o(t,e,r,i){r("accesstoken",i.accessToken),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch"),function(t,e){var r,i,o=t.layers||[],s=e.layers=[];function l(t,e){return n.coerce(r,i,a.layers,t,e)}for(var c=0;c<o.length;c++)if(r=o[c],i={},n.isPlainObject(r)){var u=l("sourcetype");l("source"),"vector"===u&&l("sourcelayer");var f=l("type");l("below"),l("color"),l("opacity"),"circle"===f&&l("circle.radius"),"line"===f&&l("line.width"),"fill"===f&&l("fill.outlinecolor"),"symbol"===f&&(l("symbol.icon"),l("symbol.iconsize"),l("symbol.text"),n.coerceFont(l,"symbol.textfont"),l("symbol.textposition")),i._index=c,s.push(i)}}(t,e),e._input=t}e.exports=function(t,e,r){i(t,e,r,{type:"mapbox",attributes:a,handleDefaults:o,partition:"y",accessToken:e._mapboxAccessToken})}},{"../../lib":724,"../subplot_defaults":846,"./layout_attributes":829}],831:[function(t,e,r){"use strict";var n=t("mapbox-gl"),i=t("../../components/fx"),a=t("../../lib"),o=t("../../components/dragelement"),s=t("../cartesian/select"),l=t("./constants"),c=t("./layout_attributes"),u=t("./layers");function f(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=[]}var h=f.prototype;function d(t){var e=c.style.values,r=c.style.dflt,n={};return a.isPlainObject(t)?(n.id=t.id,n.style=t):"string"==typeof t?(n.id=t,n.style=-1!==e.indexOf(t)?p(t):t):(n.id=r,n.style=p(r)),n}function p(t){return l.styleUrlPrefix+t+"-"+l.styleUrlSuffix}function m(t){return[t.lon,t.lat]}e.exports=function(t){return new f(t)},h.plot=function(t,e,r){var n,i=this,a=i.opts=e[this.id];i.map&&a.accesstoken!==i.accessToken&&(i.map.remove(),i.map=null,i.styleObj=null,i.traceHash=[],i.layerList={}),n=i.map?new Promise(function(r,n){i.updateMap(t,e,r,n)}):new Promise(function(r,n){i.createMap(t,e,r,n)}),r.push(n)},h.createMap=function(t,e,r,o){var s=this,c=s.gd,u=s.opts,f=s.styleObj=d(u.style);s.accessToken=u.accesstoken;var h=s.map=new n.Map({container:s.div,style:f.style,center:m(u.center),zoom:u.zoom,bearing:u.bearing,pitch:u.pitch,interactive:!s.isStatic,preserveDrawingBuffer:s.isStatic,doubleClickZoom:!1,boxZoom:!1}),p=l.controlContainerClassName,v=s.div.getElementsByClassName(p)[0];function g(){i.loneUnhover(e._toppaper)}s.div.removeChild(v),h._canvas.canvas.style.left="0px",h._canvas.canvas.style.top="0px",s.rejectOnError(o),h.once("load",function(){s.updateData(t),s.updateLayout(e),s.resolveOnRender(r)}),s.isStatic||(h.on("moveend",function(t){if(s.map){var e=s.getView();if(u._input.center=u.center=e.center,u._input.zoom=u.zoom=e.zoom,u._input.bearing=u.bearing=e.bearing,u._input.pitch=u.pitch=e.pitch,t.originalEvent){var r={};r[s.id]=a.extendFlat({},e),c.emit("plotly_relayout",r)}}}),h.on("mousemove",function(t){var e=s.div.getBoundingClientRect();t.clientX=t.point.x+e.left,t.clientY=t.point.y+e.top,t.target.getBoundingClientRect=function(){return e},s.xaxis.p2c=function(){return t.lngLat.lng},s.yaxis.p2c=function(){return t.lngLat.lat},i.hover(c,t,s.id)}),h.on("click",function(t){i.click(c,t.originalEvent)}),h.on("dragstart",g),h.on("zoomstart",g),h.on("dblclick",function(){var t=s.viewInitial;h.setCenter(m(t.center)),h.setZoom(t.zoom),h.setBearing(t.bearing),h.setPitch(t.pitch);var e=s.getView();u._input.center=u.center=e.center,u._input.zoom=u.zoom=e.zoom,u._input.bearing=u.bearing=e.bearing,u._input.pitch=u.pitch=e.pitch,c.emit("plotly_doubleclick",null)}))},h.updateMap=function(t,e,r,n){var i=this,a=i.map;i.rejectOnError(n);var o=d(i.opts.style);i.styleObj.id!==o.id?(i.styleObj=o,a.setStyle(o.style),a.style.once("load",function(){i.traceHash={},i.updateData(t),i.updateLayout(e),i.resolveOnRender(r)})):(i.updateData(t),i.updateLayout(e),i.resolveOnRender(r))},h.updateData=function(t){var e,r,n,i,a=this.traceHash;for(n=0;n<t.length;n++){var o=t[n];(e=a[(r=o[0].trace).uid])?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(l===(r=t[i][0].trace).uid)continue t;(e=a[l]).dispose(),delete a[l]}},h.updateLayout=function(t){var e=this.map,r=this.opts;e.setCenter(m(r.center)),e.setZoom(r.zoom),e.setBearing(r.bearing),e.setPitch(r.pitch),this.updateLayers(),this.updateFramework(t),this.updateFx(t),this.map.resize()},h.resolveOnRender=function(t){var e=this.map;e.on("render",function r(){e.loaded()&&(e.off("render",r),t())})},h.rejectOnError=function(t){var e=this.map;function r(){t(new Error(l.mapOnErrorMsg))}e.once("error",r),e.once("style.error",r),e.once("source.error",r),e.once("tile.error",r),e.once("layer.error",r)},h.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)},h.updateFx=function(t){var e=this,r=e.map,n=e.gd;if(!e.isStatic){var i,a=t.dragmode;if(i="select"===a?function(t,r){(t.range={})[e.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]}:function(t,r,n){(t.lassoPoints={})[e.id]=n.filtered.map(c)},"select"===a||"lasso"===a){r.dragPan.disable();var l={element:e.div,gd:n,plotinfo:{xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:i},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id,prepFn:function(t,e,r){s(t,e,r,l,a)}};o.init(l)}else r.dragPan.enable(),e.div.onmousedown=null}function c(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},h.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])},h.updateLayers=function(){var t,e=this.opts.layers,r=this.layerList;if(e.length!==r.length){for(t=0;t<r.length;t++)r[t].dispose();for(r=this.layerList=[],t=0;t<e.length;t++)r.push(u(this,t,e[t]))}else for(t=0;t<e.length;t++)r[t].update(e[t])},h.destroy=function(){this.map&&(this.map.remove(),this.map=null,this.container.removeChild(this.div))},h.toImage=function(){return this.map.getCanvas().toDataURL()},h.initSource=function(t){return this.map.addSource(t,{type:"geojson",data:{type:"Feature",geometry:{type:"Point",coordinates:[]}}})},h.setSourceData=function(t,e){this.map.getSource(t).setData(e)},h.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])}},h.project=function(t){return this.map.project(new n.LngLat(t[0],t[1]))},h.getView=function(){var t=this.map,e=t.getCenter();return{center:{lon:e.lng,lat:e.lat},zoom:t.getZoom(),bearing:t.getBearing(),pitch:t.getPitch()}}},{"../../components/dragelement":620,"../../components/fx":640,"../../lib":724,"../cartesian/select":788,"./constants":825,"./layers":828,"./layout_attributes":829,"mapbox-gl":315}],832:[function(t,e,r){"use strict";e.exports={t:{valType:"number",dflt:0,editType:"arraydraw"},r:{valType:"number",dflt:0,editType:"arraydraw"},b:{valType:"number",dflt:0,editType:"arraydraw"},l:{valType:"number",dflt:0,editType:"arraydraw"},editType:"arraydraw"}},{}],833:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../plotly"),o=t("../plot_api/plot_schema"),s=t("../registry"),l=t("../plots/cartesian/axis_ids"),c=t("../lib"),u=c._,f=t("../components/color"),h=t("../constants/numerical").BADNUM,d=e.exports={},p=t("./animation_attributes"),m=t("./frame_attributes"),v=c.relinkPrivateKeys;c.extendFlat(d,s),d.attributes=t("./attributes"),d.attributes.type.values=d.allTypes,d.fontAttrs=t("./font_attributes"),d.layoutAttributes=t("./layout_attributes"),d.fontWeight="normal";var g=d.transformsRegistry,y=t("../components/errorbars"),b=t("./command");d.executeAPICommand=b.executeAPICommand,d.computeAPICommandBindings=b.computeAPICommandBindings,d.manageCommandObserver=b.manageCommandObserver,d.hasSimpleAPICommandBindings=b.hasSimpleAPICommandBindings,d.redrawText=function(t){if(!((t=c.getGraphDiv(t)).data&&t.data[0]&&t.data[0].r))return new Promise(function(e){setTimeout(function(){s.getComponentMethod("annotations","draw")(t),s.getComponentMethod("legend","draw")(t),(t.calcdata||[]).forEach(function(t){t[0]&&t[0].t&&t[0].t.cb&&t[0].t.cb()}),e(d.previousPromises(t))},300)})},d.resize=function(t){return t=c.getGraphDiv(t),new Promise(function(e,r){t&&!function(t){var e=window.getComputedStyle(t).display;return!e||"none"===e}(t)||r(new Error("Resize must be passed a displayed plot div element.")),t._redrawTimer&&clearTimeout(t._redrawTimer),t._redrawTimer=setTimeout(function(){if(t.layout.width&&t.layout.height)e(t);else{delete t.layout.width,delete t.layout.height;var r=t.changed;t.autoplay=!0,a.relayout(t,{autosize:!0}).then(function(){t.changed=r,e(t)})}},100)})},d.previousPromises=function(t){if((t._promises||[]).length)return Promise.all(t._promises).then(function(){t._promises=[]})},d.addLinks=function(t){if(t._context.showLink||t._context.showSources){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:f.defaultLine,"pointer-events":"all"}).each(function(){var t=n.select(this);t.append("tspan").classed("js-link-to-tool",!0),t.append("tspan").classed("js-link-spacer",!0),t.append("tspan").classed("js-sourcelinks",!0)});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"),l=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)r.on("click",function(){d.sendDataToCloud(t)});else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(t,o),s.text(o.text()&&l.text()?" - ":"")}},d.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=d.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1};var x,_=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];function M(t,e){var r,n,i=t.trace,a=i._arrayAttrs,o={};for(r=0;r<a.length;r++)o[n=a[r]]=c.nestedProperty(i,n).get().slice();for(t.trace=e,r=0;r<a.length;r++)n=a[r],c.nestedProperty(t.trace,n).set(o[n])}function k(t,e){var r=t._context.locale,n=!1,i={};function a(t){for(var r=!0,a=0;a<e.length;a++){var o=e[a];i[o]||(t[o]?i[o]=t[o]:r=!1)}r&&(n=!0)}for(var o=0;o<2;o++){for(var l=t._context.locales,c=0;c<2;c++){var u=(l[r]||{}).format;if(u&&(a(u),n))break;l=s.localeRegistry}var f=r.split("-")[0];if(n||f===r)break;r=f}return n||a(s.localeRegistry.en.format),i}function A(t,e,r,n){for(var i=t.transforms,a=[t],o=0;o<i.length;o++){var s=i[o],l=g[s.type];l&&l.transform&&(a=l.transform(a,{transform:s,fullTrace:t,fullData:e,layout:r,fullLayout:n,transformIndex:o}))}return a}function T(t){for(var e=0;e<t.length;e++){t[e]._categories=t[e]._initialCategories.slice(),t[e]._categoriesMap={};for(var r=0;r<t[e]._categories.length;r++)t[e]._categoriesMap[t[e]._categories[r]]=r}}d.supplyDefaults=function(t){var e=t._fullLayout||{};if(e._skipDefaults)delete e._skipDefaults;else{var r,i=t._fullLayout={},a=t.layout||{},o=t._fullData||[],f=t._fullData=[],h=t.data||[],p=t._context||{};t._transitionData||d.createTransitionData(t),i._dfltTitle={plot:u(t,"Click to enter Plot title"),x:u(t,"Click to enter X axis title"),y:u(t,"Click to enter Y axis title"),colorbar:u(t,"Click to enter Colorscale title"),annotation:u(t,"new text")},i._traceWord=u(t,"trace");var m=k(t,_);if(i._mapboxAccessToken=p.mapboxAccessToken,e._initialAutoSizeIsDone){var g=e.width,y=e.height;d.supplyLayoutGlobalDefaults(a,i,m),a.width||(i.width=g),a.height||(i.height=y)}else{d.supplyLayoutGlobalDefaults(a,i,m);var b=!a.width||!a.height,A=i.autosize,T=p.autosizable;b&&(A||T)?d.plotAutoSize(t,a,i):b&&d.sanitizeMargins(t),!A&&b&&(a.width=i.width,a.height=i.height)}i._d3locale=function(t,e){return t.decimal=e.charAt(0),t.thousands=e.charAt(1),n.locale(t)}(m,i.separators),i._extraFormat=k(t,w),i._initialAutoSizeIsDone=!0,i._dataLength=h.length,i._modules=[],i._basePlotModules=[],i._subplots=function(){var t,e,r={};if(!x){x=[];var n=s.subplotsRegistry;for(var i in n){var a=n[i],o=a.attr;if(o&&(x.push(i),Array.isArray(o)))for(e=0;e<o.length;e++)c.pushUnique(x,o[e])}}for(t=0;t<x.length;t++)r[x[t]]=[];return r}(),i._globalTransforms=(t._context||{}).globalTransforms,d.supplyDataDefaults(h,f,a,i),i._has=d._hasPlotType.bind(i);var E=i._modules;for(r=0;r<E.length;r++){var S=E[r];S.cleanData&&S.cleanData(f)}if(o.length===h.length)for(r=0;r<f.length;r++)v(f[r],o[r]);d.supplyLayoutModuleDefaults(a,i,f,t._transitionData),i._hasCartesian=i._has("cartesian"),i._hasGeo=i._has("geo"),i._hasGL3D=i._has("gl3d"),i._hasGL2D=i._has("gl2d"),i._hasTernary=i._has("ternary"),i._hasPie=i._has("pie"),d.cleanPlot(f,i,o,e),d.linkSubplots(f,i,o,e),v(i,e),d.doAutoMargin(t);var L=l.list(t);for(r=0;r<L.length;r++){L[r].setScale()}if((t.calcdata||[]).length===f.length)for(r=0;r<f.length;r++){var C=f[r],P=t.calcdata[r][0];P&&P.trace&&(P.trace._hasCalcTransform?M(P,C):P.trace=C)}}},d.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=[])},d._hasPlotType=function(t){var e,r=this._basePlotModules||[];for(e=0;e<r.length;e++){if(r[e].name===t)return!0}var n=this._modules||[];for(e=0;e<n.length;e++){var i=n[e];if(i.categories&&i.categories.indexOf(t)>=0)return!0}return!1},d.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,c=!!n._infolayer,u=n._has&&n._has("gl"),f=e._has&&e._has("gl");u&&!f&&void 0!==n._glcontainer&&(n._glcontainer.selectAll(".gl-canvas").remove(),n._glcanvas=null);t:for(i=0;i<r.length;i++){var h=r[i].uid;for(a=0;a<t.length;a++){if(h===t[a].uid)continue t}var d=".hm"+h+",.contour"+h+",.carpet"+h+",#clip"+h+",.trace"+h;l&&n._paper.selectAll(d).remove(),c&&(n._infolayer.selectAll(".cb"+h).remove(),n._infolayer.selectAll("g.rangeslider-container").selectAll(d).remove())}n._zoomlayer&&n._zoomlayer.selectAll(".select-outline").remove()},d.linkSubplots=function(t,e,r,n){var i,a,o,s,u=n._plots||{},f=e._plots={},h=e._subplots,d={_fullData:t,_fullLayout:e},p=h.cartesian.concat(h.gl2d||[]);for(var m in h)h[m].sort(c.subplotSort);for(i=0;i<p.length;i++){var v,g=u[o=p[i]],y=l.getFromId(d,o,"x"),b=l.getFromId(d,o,"y");for(g?((v=f[o]=g).xaxis.layer!==y.layer&&(v.xlines.attr("d",null),v.xaxislayer.selectAll("*").remove()),v.yaxis.layer!==b.layer&&(v.ylines.attr("d",null),v.yaxislayer.selectAll("*").remove())):(v=f[o]={}).id=o,v.xaxis=y,v.yaxis=b,v._hasClipOnAxisFalse=!1,a=0;a<t.length;a++){var x=t[a];if(x.xaxis===v.xaxis._id&&x.yaxis===v.yaxis._id&&!1===x.cliponaxis){v._hasClipOnAxisFalse=!0;break}}}var _=l.list(d,null,!0);for(i=0;i<_.length;i++){var w=null;(s=_[i]).overlaying&&(w=l.getFromId(d,s.overlaying))&&w.overlaying&&(s.overlaying=!1,w=null),s._mainAxis=w||s,w&&(s.domain=w.domain.slice()),s._anchorAxis="free"===s.anchor?null:l.getFromId(d,s.anchor)}for(i=0;i<_.length;i++){var M="x"===(s=_[i])._id.charAt(0),k=s._mainAxis._anchorAxis,A="",T="",E="";if(k&&(E=k._mainAxis._id,A=M?s._id+E:E+s._id),!A||-1===p.indexOf(A))for(A="",a=0;a<p.length;a++){var S=(o=p[a]).indexOf("y"),L=M?o.substr(0,S):o.substr(S),C=M?o.substr(S):o.substr(0,S);if(L===s._id){T||(T=o);var P=l.getFromId(d,C);if(E&&P.overlaying===E){A=o;break}}}s._mainSubplot=A||T}},d.clearExpandedTraceDefaultColors=function(t){var e,r,n;for(r=[],(e=t._module._colorAttrs)||(t._module._colorAttrs=e=[],o.crawl(t._module.attributes,function(t,n,i,a){r[a]=n,r.length=a+1,"color"===t.valType&&void 0===t.dflt&&e.push(r.join("."))})),n=0;n<e.length;n++){c.nestedProperty(t,"_input."+e[n]).get()||c.nestedProperty(t,e[n]).set(null)}},d.supplyDataDefaults=function(t,e,r,n){var i,a,o,l=n._modules,u=n._basePlotModules,f=0,h=0;function p(t){e.push(t);var r=t._module;r&&(!0===t.visible&&c.pushUnique(l,r),c.pushUnique(u,t._module.basePlotModule),f++,!1!==t._input.visible&&h++)}n._transformModules=[];var m={},g=[];for(i=0;i<t.length;i++){if(o=t[i],(a=d.supplyTraceDefaults(o,h,n,i)).index=i,a._input=o,a._expandedIndex=f,a.transforms&&a.transforms.length)for(var y=A(a,e,r,n),b=0;b<y.length;b++){var x=y[b],_=d.supplyTraceDefaults(x,f,n,i);v(_,x),x.uid=_.uid=a.uid+b,_.index=i,_._input=o,_._fullInput=a,_._expandedIndex=f,_._expandedInput=x,p(_)}else a._fullInput=a,a._expandedInput=a,p(a);s.traceIs(a,"carpetAxis")&&(m[a.carpet]=a),s.traceIs(a,"carpetDependent")&&g.push(i)}for(i=0;i<g.length;i++)if((a=e[g[i]]).visible){var w=m[a.carpet];a._carpet=w,w&&w.visible?(a.xaxis=w.xaxis,a.yaxis=w.yaxis):a.visible=!1}},d.supplyAnimationDefaults=function(t){var e;t=t||{};var r={};function n(e,n){return c.coerce(t||{},r,p,e,n)}if(n("mode"),n("direction"),n("fromcurrent"),Array.isArray(t.frame))for(r.frame=[],e=0;e<t.frame.length;e++)r.frame[e]=d.supplyAnimationFrameDefaults(t.frame[e]||{});else r.frame=d.supplyAnimationFrameDefaults(t.frame||{});if(Array.isArray(t.transition))for(r.transition=[],e=0;e<t.transition.length;e++)r.transition[e]=d.supplyAnimationTransitionDefaults(t.transition[e]||{});else r.transition=d.supplyAnimationTransitionDefaults(t.transition||{});return r},d.supplyAnimationFrameDefaults=function(t){var e={};function r(r,n){return c.coerce(t||{},e,p.frame,r,n)}return r("duration"),r("redraw"),e},d.supplyAnimationTransitionDefaults=function(t){var e={};function r(r,n){return c.coerce(t||{},e,p.transition,r,n)}return r("duration"),r("easing"),e},d.supplyFrameDefaults=function(t){var e={};function r(r,n){return c.coerce(t,e,m,r,n)}return r("group"),r("name"),r("traces"),r("baseframe"),r("data"),r("layout"),e},d.supplyTraceDefaults=function(t,e,r,n){var i,a=r.colorway||f.defaults,o={},l=a[e%a.length];function u(e,r){return c.coerce(t,o,d.attributes,e,r)}var h=u("visible");u("type"),u("uid"),u("name",r._traceWord+" "+n);var p=d.getModule(o);if(o._module=p,p){var m=p.basePlotModule,v=m.attr;if(v){var g=r._subplots,y=m.attributes,b="";if("gl2d"!==m.name||h){if(Array.isArray(v))for(i=0;i<v.length;i++){var x=v[i],_=c.coerce(t,o,y,x);g[x]&&c.pushUnique(g[x],_),b+=_}else b=c.coerce(t,o,y,v);g[m.name]&&c.pushUnique(g[m.name],b)}}}return h&&(u("customdata"),u("ids"),d.traceIs(o,"showLegend")&&(u("showlegend"),u("legendgroup")),s.getComponentMethod("fx","supplyDefaults")(t,o,l,r),p&&(p.supplyDefaults(t,o,l,r),c.coerceHoverinfo(t,o,r)),d.traceIs(o,"noOpacity")||u("opacity"),d.traceIs(o,"notLegendIsolatable")&&(o.visible=!!o.visible),p&&p.selectPoints&&u("selectedpoints"),d.supplyTransformDefaults(t,o,r)),o},d.supplyTransformDefaults=function(t,e,r){var n=r._globalTransforms||[],i=r._transformModules||[];if(Array.isArray(t.transforms)||0!==n.length)for(var a=t.transforms||[],o=n.concat(a),s=e.transforms=[],l=0;l<o.length;l++){var u,f=o[l],h=f.type,d=g[h],p=!(f._module&&f._module===d),m=d&&"function"==typeof d.transform;d||c.warn("Unrecognized transform type "+h+"."),d&&d.supplyDefaults&&(p||m)?((u=d.supplyDefaults(f,e,r,t)).type=h,u._module=d,c.pushUnique(i,d)):u=c.extendFlat({},f),s.push(u)}},d.supplyLayoutGlobalDefaults=function(t,e,r){function n(r,n){return c.coerce(t,e,d.layoutAttributes,r,n)}var i=c.coerceFont(n,"font");n("title",e._dfltTitle.plot),c.coerceFont(n,"titlefont",{family:i.family,size:Math.round(1.4*i.size),color:i.color}),n("autosize",!(t.width&&t.height)),n("width"),n("height"),n("margin.l"),n("margin.r"),n("margin.t"),n("margin.b"),n("margin.pad"),n("margin.autoexpand"),t.width&&t.height&&d.sanitizeMargins(e),n("paper_bgcolor"),n("separators",r.decimal+r.thousands),n("hidesources"),n("colorway"),n("datarevision"),s.getComponentMethod("calendars","handleDefaults")(t,e,"calendar"),s.getComponentMethod("fx","supplyLayoutGlobalDefaults")(t,e,n)},d.plotAutoSize=function(t,e,r){var n,a,o=t._context||{},s=o.frameMargins,l=c.isPlotDiv(t);if(l&&t.emit("plotly_autosize"),o.fillFrame)n=window.innerWidth,a=window.innerHeight,document.body.style.overflow="hidden";else if(i(s)&&s>0){var u=function(t){var e,r={left:0,right:0,bottom:0,top:0};if(t)for(e in t)t.hasOwnProperty(e)&&(r.left+=t[e].left||0,r.right+=t[e].right||0,r.bottom+=t[e].bottom||0,r.top+=t[e].top||0);return r}(t._boundingBoxMargins),f=u.left+u.right,h=u.bottom+u.top,p=1-2*s,m=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(p*(m.width-f)),a=Math.round(p*(m.height-h))}else{var v=l?window.getComputedStyle(t):{};n=parseFloat(v.width)||r.width,a=parseFloat(v.height)||r.height}var g=d.layoutAttributes.width.min,y=d.layoutAttributes.height.min;n<g&&(n=g),a<y&&(a=y);var b=!e.width&&Math.abs(r.width-n)>1,x=!e.height&&Math.abs(r.height-a)>1;(x||b)&&(b&&(r.width=n),x&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),d.sanitizeMargins(r)},d.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,l=s.componentsRegistry,c=e._basePlotModules,u=s.subplotsRegistry.cartesian;for(i in l)(o=l[i]).includeBasePlot&&o.includeBasePlot(t,e);for(c.length||c.push(u),e._has("cartesian")&&u.finalizeSubplots(t,e),a=0;a<c.length;a++)(o=c[a]).supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r);var f=e._modules;for(a=0;a<f.length;a++)(o=f[a]).supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r);var h=e._transformModules;for(a=0;a<h.length;a++)(o=h[a]).supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r,n);for(i in l)(o=l[i]).supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r)},d.purge=function(t){var e=t._fullLayout||{};void 0!==e._glcontainer&&(e._glcontainer.selectAll(".gl-canvas").remove(),e._glcontainer.remove(),e._glcanvas=null),void 0!==e._geocontainer&&e._geocontainer.remove(),e._modeBar&&e._modeBar.destroy(),t._transitionData&&(t._transitionData._interruptCallbacks&&(t._transitionData._interruptCallbacks.length=0),t._transitionData._animationRaf&&window.cancelAnimationFrame(t._transitionData._animationRaf)),c.clearThrottle(),delete t.data,delete t.layout,delete t._fullData,delete t._fullLayout,delete t.calcdata,delete t.framework,delete t.empty,delete t.fid,delete t.undoqueue,delete t.undonum,delete t.autoplay,delete t.changed,delete t._promises,delete t._redrawTimer,delete t.firstscatter,delete t._hmlumcount,delete t._hmpixcount,delete t._transitionData,delete t._transitioning,delete t._initialAutoSize,delete t._transitioningWithDuration,delete t._dragging,delete t._dragged,delete t._hoverdata,delete t._snapshotInProgress,delete t._editing,delete t._replotPending,delete t._mouseDownTime,delete t._legendMouseDownTime,t.removeAllListeners&&t.removeAllListeners()},d.style=function(t){var e,r=t._fullLayout._modules,n=[];for(e=0;e<r.length;e++){var i=r[e];i.style&&c.pushUnique(n,i.style)}for(e=0;e<n.length;e++)n[e](t)},d.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))}},d.autoMargin=function(t,e,r){var n=t._fullLayout;if(n._pushmargin||(n._pushmargin={}),!1!==n.margin.autoexpand){if(r){var i=void 0===r.pad?12:r.pad;r.l+r.r>.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+i},r:{val:r.x,size:r.r+i},b:{val:r.y,size:r.b+i},t:{val:r.y,size:r.t+i}}}else delete n._pushmargin[e];n._replotting||d.doAutoMargin(t)}},d.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),o=Math.max(e.margin.l||0,0),s=Math.max(e.margin.r||0,0),l=Math.max(e.margin.t||0,0),c=Math.max(e.margin.b||0,0),u=e._pushmargin;if(!1!==e.margin.autoexpand)for(var f in u.base={l:{val:0,size:o},r:{val:1,size:s},t:{val:1,size:l},b:{val:0,size:c}},u){var h=u[f].l||{},d=u[f].b||{},p=h.val,m=h.size,v=d.val,g=d.size;for(var y in u){if(i(m)&&u[y].r){var b=u[y].r.val,x=u[y].r.size;if(b>p){var _=(m*b+(x-e.width)*p)/(b-p),w=(x*(1-p)+(m-e.width)*(1-b))/(b-p);_>=0&&w>=0&&_+w>o+s&&(o=_,s=w)}}if(i(g)&&u[y].t){var M=u[y].t.val,k=u[y].t.size;if(M>v){var A=(g*M+(k-e.height)*v)/(M-v),T=(k*(1-v)+(g-e.height)*(1-M))/(M-v);A>=0&&T>=0&&A+T>c+l&&(c=A,l=T)}}}}if(r.l=Math.round(o),r.r=Math.round(s),r.t=Math.round(l),r.b=Math.round(c),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return a.plot(t)},d.graphJson=function(t,e,r,n,i){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&d.supplyDefaults(t);var a=i?t._fullData:t.data,o=i?t._fullLayout:t.layout,s=(t._transitionData||{})._frames;function l(t){if("function"==typeof t)return null;if(c.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!c.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;i[e]=l(t[e])}return i}return Array.isArray(t)?t.map(l):c.isJSDate(t)?c.ms2DateTimeLocal(+t):t}var u={data:(a||[]).map(function(t){var r=l(t);return e&&delete r.fit,r})};return e||(u.layout=l(o)),t.framework&&t.framework.isPolar&&(u=t.framework.getConfig()),s&&(u.frames=l(s)),"object"===n?u:JSON.stringify(u)},d.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r<e.length;r++)switch((n=e[r]).type){case"replace":i=n.value;var s=(a[n.index]||{}).name,l=i.name;a[n.index]=o[l]=i,l!==s&&(delete o[s],o[l]=i);break;case"insert":o[(i=n.value).name]=i,a.splice(n.index,0,i);break;case"delete":delete o[(i=a[n.index]).name],a.splice(n.index,1)}return Promise.resolve()},d.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],c=[s.name];s.baseframe&&(s=o[s.baseframe.toString()])&&-1===c.indexOf(s.name);)l.push(s),c.push(s.name);for(var u={};s=l.pop();)if(s.layout&&(u.layout=d.extendLayout(u.layout,s.layout)),s.data){if(u.data||(u.data=[]),!(n=s.traces))for(n=[],r=0;r<s.data.length;r++)n[r]=r;for(u.traces||(u.traces=[]),r=0;r<s.data.length;r++)void 0!==(i=n[r])&&null!==i&&(-1===(a=u.traces.indexOf(i))&&(a=u.data.length,u.traces[a]=i),u.data[a]=d.extendTrace(u.data[a],s.data[r]))}return u},d.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)}},d.extendObjectWithContainers=function(t,e,r){var n,i,a,o,s,l,u,f=c.extendDeepNoArrays({},e||{}),h=c.expandObjectPaths(f),p={};if(r&&r.length)for(a=0;a<r.length;a++)void 0===(i=(n=c.nestedProperty(h,r[a])).get())?c.nestedProperty(p,r[a]).set(null):(n.set(null),c.nestedProperty(p,r[a]).set(i));if(t=c.extendDeepNoArrays(t||{},h),r&&r.length)for(a=0;a<r.length;a++)if(l=c.nestedProperty(p,r[a]).get()){for(u=(s=c.nestedProperty(t,r[a])).get(),Array.isArray(u)||(u=[],s.set(u)),o=0;o<l.length;o++){var m=l[o];u[o]=null===m?null:d.extendObjectWithContainers(u[o],m)}s.set(u)}return t},d.dataArrayContainers=["transforms","dimensions"],d.layoutArrayContainers=s.layoutArrayContainers,d.extendTrace=function(t,e){return d.extendObjectWithContainers(t,e,d.dataArrayContainers)},d.extendLayout=function(t,e){return d.extendObjectWithContainers(t,e,d.layoutArrayContainers)},d.transition=function(t,e,r,n,i,o){var s,l,u=Array.isArray(e)?e.length:0,f=n.slice(0,u),h=[];var p=!1;for(s=0;s<f.length;s++){l=f[s];t._fullData[l]._module}var m=[d.previousPromises,function(){if(t._transitionData)return t._transitioning=!1,function(t){var e=Promise.resolve();if(!t)return e;for(;t.length;)e=e.then(t.shift());return e}(t._transitionData._interruptCallbacks)},function(){var n;for(n=0;n<f.length;n++){var i=f[n],a=t._fullData[i]._module;a&&(a.animatable&&h.push(i),t.data[f[n]]=d.extendTrace(t.data[f[n]],e[n]))}var o=c.expandObjectPaths(c.extendDeepNoArrays({},r)),s=/^[xy]axis[0-9]*$/;for(var l in o)s.test(l)&&delete o[l].range;return d.extendLayout(t.layout,o),delete t.calcdata,d.supplyDefaults(t),d.doCalcdata(t),y.calc(t),Promise.resolve()},d.rehover,function(){return t.emit("plotly_transitioning",[]),new Promise(function(e){t._transitioning=!0,o.duration>0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){p=!0}),i.redraw&&t._transitionData._interruptCallbacks.push(function(){return a.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var n,s,l=0,u=0;function f(){return l++,function(){var r;p||++u!==l||(r=e,t._transitionData&&(function(t){if(t)for(;t.length;)t.shift()}(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(i.redraw)return a.redraw(t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])}).then(r)))}}var d=t._fullLayout._basePlotModules,m=!1;if(r)for(s=0;s<d.length;s++)if(d[s].transitionAxes){var v=c.expandObjectPaths(r);m=d[s].transitionAxes(t,v,o,f)||m}for(m?(n=c.extendFlat({},o)).duration=0:n=o,s=0;s<d.length;s++)d[s].plot(t,h,n,f);setTimeout(f())})}],v=c.syncOrAsync(m,t);return v&&v.then||(v=Promise.resolve()),v.then(function(){return t})},d.doCalcdata=function(t,e){var r,n,i,a,c=l.list(t),u=t._fullData,f=t._fullLayout,d=new Array(u.length),p=(t.calcdata||[]).slice(0);for(t.calcdata=d,t.firstscatter=!0,f._numBoxes=0,f._numViolins=0,f._violinScaleGroupStats={},t._hmpixcount=0,t._hmlumcount=0,f._piecolormap={},f._piecolorway=null,f._piedefaultcolorcount=0,i=0;i<u.length;i++)Array.isArray(e)&&-1===e.indexOf(i)&&(d[i]=p[i]);for(i=0;i<u.length;i++)(r=u[i])._arrayAttrs=o.findArrayAttributes(r);var m=f._subplots.polar||[];for(i=0;i<m.length;i++)c.push(f[m[i]].radialaxis,f[m[i]].angularaxis);T(c);var v=!1;for(i=0;i<u.length;i++)if(!0===(r=u[i]).visible&&r.transforms)for((n=r._module)&&n.calc&&n.calc(t,r),a=0;a<r.transforms.length;a++){var y=r.transforms[a];(n=g[y.type])&&n.calcTransform&&(r._hasCalcTransform=!0,v=!0,n.calcTransform(t,r,y))}if(v){for(i=0;i<c.length;i++)c[i]._min=[],c[i]._max=[],c[i]._categories=[],c[i]._categoriesMap={};T(c)}for(i=0;i<u.length;i++){var b=[];if(!0===(r=u[i]).visible){n=r._module;var x=r.transforms||[];for(a=x.length-1;a>=0;a--)if(x[a].enabled){r._indexToPoints=x[a]._indexToPoints;break}n&&n.calc&&(b=n.calc(t,r))}Array.isArray(b)&&b[0]||(b=[{x:h,y:h}]),b[0].t||(b[0].t={}),b[0].trace=r,d[i]=b}s.getComponentMethod("fx","calc")(t)},d.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},d.generalUpdatePerTraceModule=function(t,e,r,n){var i,a=e.traceHash,o={};for(i=0;i<r.length;i++){var s=r[i],l=s[0].trace;l.visible&&(o[l.type]=o[l.type]||[],o[l.type].push(s))}for(var u in a)if(!o[u]){var f=a[u][0];f[0].trace.visible=!1,o[u]=[f]}for(var h in o){var d=o[h];d[0][0].trace._module.plot(t,e,c.filterVisible(d),n)}e.traceHash=o}},{"../components/color":598,"../components/errorbars":629,"../constants/numerical":702,"../lib":724,"../plot_api/plot_schema":759,"../plotly":765,"../plots/cartesian/axis_ids":773,"../registry":854,"./animation_attributes":766,"./attributes":768,"./command":795,"./font_attributes":797,"./frame_attributes":798,"./layout_attributes":824,d3:128,"fast-isnumeric":140}],834:[function(t,e,r){"use strict";e.exports={attr:"subplot",name:"polar",axisNames:["angularaxis","radialaxis"],axisName2dataArray:{angularaxis:"theta",radialaxis:"r"},layerNames:["draglayer","plotbg","backplot","angular-grid","radial-grid","frontplot","angular-axis","radial-axis","angular-line","radial-line"],radialDragBoxSize:50,angularDragBoxSize:30,cornerLen:25,cornerHalfWidth:2,MINDRAG:8,MINZOOM:20,OFFEDGE:20}},{}],835:[function(t,e,r){"use strict";var n=t("../../lib");r.setConvertAngular=function(t){var e,r,i={clockwise:-1,counterclockwise:1}[t.direction],a=n.deg2rad(t.rotation);function o(){return t.period?Math.max(t.period,t._categories.length):t._categories.length}function s(t){return(t-a)/i}"linear"===t.type?(e=function(t,e){return"degrees"===e?n.deg2rad(t):t},r=function(t,e){return"degrees"===e?n.rad2deg(t):t}):"category"===t.type&&(e=function(t){var e=o();return 2*t*Math.PI/e},r=function(t){return t*o()/Math.PI/2}),t.unTransformRad=s,t._c2rad=e,t.c2rad=function(t,r){return function(t){return i*t+a}(e(t,r))},t.rad2c=function(t,e){return r(s(t),e)},t.c2deg=function(e,r){return n.rad2deg(t.c2rad(e,r))},t.deg2c=function(e,r){return t.rad2c(n.deg2rad(e),r)}}},{"../../lib":724}],836:[function(t,e,r){"use strict";var n=t("../get_data").getSubplotCalcData,i=t("../../lib").counterRegex,a=t("./polar"),o=t("./constants"),s=o.attr,l=o.name,c=i(l),u={};u[s]={valType:"subplotid",dflt:l,editType:"calc"},e.exports={attr:s,name:l,idRoot:l,idRegex:c,attrRegex:c,attributes:u,layoutAttributes:t("./layout_attributes"),supplyLayoutDefaults:t("./layout_defaults"),plot:function(t){for(var e=t._fullLayout,r=t.calcdata,i=e._subplots[l],o=0;o<i.length;o++){var s=i[o],c=n(r,l,s),u=e[s]._subplot;u||(u=a(t,s),e[s]._subplot=u),u.plot(c,e,t._promises)}},clean:function(t,e,r,n){for(var i=n._subplots[l]||[],a=0;a<i.length;a++){var o=i[a],s=n[o]._subplot;if(!e[o]&&s)for(var c in s.framework.remove(),s.layers["radial-axis-title"].remove(),s.clipPaths)s.clipPaths[c].remove()}},toSVG:t("../cartesian").toSVG}},{"../../lib":724,"../cartesian":781,"../get_data":807,"./constants":834,"./layout_attributes":837,"./layout_defaults":838,"./polar":845}],837:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),i=t("../cartesian/layout_attributes"),a=t("../domain_attributes"),o=t("../../lib").extendFlat,s=t("../../plot_api/edit_types").overrideAll,l=s({color:i.color,showline:o({},i.showline,{dflt:!0}),linecolor:i.linecolor,linewidth:i.linewidth,showgrid:o({},i.showgrid,{dflt:!0}),gridcolor:i.gridcolor,gridwidth:i.gridwidth},"plot","from-root"),c=s({tickmode:i.tickmode,nticks:i.nticks,tick0:i.tick0,dtick:i.dtick,tickvals:i.tickvals,ticktext:i.ticktext,ticks:i.ticks,ticklen:i.ticklen,tickwidth:i.tickwidth,tickcolor:i.tickcolor,showticklabels:i.showticklabels,showtickprefix:i.showtickprefix,tickprefix:i.tickprefix,showticksuffix:i.showticksuffix,ticksuffix:i.ticksuffix,showexponent:i.showexponent,exponentformat:i.exponentformat,separatethousands:i.separatethousands,tickfont:i.tickfont,tickangle:i.tickangle,tickformat:i.tickformat,tickformatstops:i.tickformatstops,layer:i.layer},"plot","from-root"),u={visible:o({},i.visible,{dflt:!0}),type:i.type,autorange:i.autorange,rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},range:i.range,categoryorder:i.categoryorder,categoryarray:i.categoryarray,angle:{valType:"angle",editType:"plot"},side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:o({},i.title,{editType:"plot",dflt:""}),titlefont:s(i.titlefont,"plot","from-root"),hoverformat:i.hoverformat,editType:"calc"};o(u,l,c);var f={visible:o({},i.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc"},categoryorder:i.categoryorder,categoryarray:i.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:i.hoverformat,editType:"calc"};o(f,l,c),e.exports={domain:a({name:"polar",editType:"plot"}),sector:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],dflt:[0,360],editType:"plot"},bgcolor:{valType:"color",editType:"plot",dflt:n.background},radialaxis:u,angularaxis:f,editType:"calc"}},{"../../components/color/attributes":597,"../../lib":724,"../../plot_api/edit_types":754,"../cartesian/layout_attributes":782,"../domain_attributes":796}],838:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color"),a=t("../subplot_defaults"),o=t("../get_data").getSubplotData,s=t("../cartesian/tick_value_defaults"),l=t("../cartesian/tick_mark_defaults"),c=t("../cartesian/tick_label_defaults"),u=t("../cartesian/category_order_defaults"),f=t("../cartesian/line_grid_defaults"),h=t("../cartesian/axis_autotype"),d=t("../cartesian/ordered_categories"),p=t("../cartesian/set_convert"),m=t("./helpers").setConvertAngular,v=t("./layout_attributes"),g=t("./constants"),y=g.axisNames;function b(t,e,r,a){var h=r("bgcolor");a.bgColor=i.combine(h,a.paper_bgcolor);var b,_=r("sector"),w=o(a.fullData,g.name,a.id),M=a.layoutOut;function k(t,e){return r(b+"."+t,e)}for(var A=0;A<y.length;A++){b=y[A],n.isPlainObject(t[b])||(t[b]={});var T=t[b],E=e[b]={};E._id=E._name=b;var S=g.axisName2dataArray[b],L=x(T,E,k,w,S);u(T,E,k),E._initialCategories="category"===L?d(S,E.categoryorder,E.categoryarray,w):[];var C,P,z=k("visible");switch(p(E,M),z&&(P=(C=k("color"))===T.color?C:a.font.color),E._m=1,b){case"radialaxis":var O=k("autorange",!E.isValidRange(T.range));T.autorange=O,O&&k("rangemode"),"reversed"===O&&(E._m=-1),k("range"),E.cleanRange("range",{dfltRange:[0,1]}),z&&(k("side"),k("angle",_[0]),k("title"),n.coerceFont(k,"titlefont",{family:a.font.family,size:Math.round(1.2*a.font.size),color:P}));break;case"angularaxis":if("date"===L){n.log("Polar plots do not support date angular axes yet.");for(var D=0;D<w.length;D++)w[D].visible=!1;L=T.type=E.type="linear"}k("linear"===L?"thetaunit":"period"),k("rotation",{counterclockwise:0,clockwise:90}[k("direction")]),m(E)}if(z)s(T,E,k,E.type),c(T,E,k,E.type,{tickSuffixDflt:"degrees"===E.thetaunit?"\xb0":void 0}),l(T,E,k,{outerTicks:!0}),k("showticklabels")&&(n.coerceFont(k,"tickfont",{family:a.font.family,size:a.font.size,color:P}),k("tickangle"),k("tickformat")),f(T,E,k,{dfltColor:C,bgColor:a.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:v[b]}),k("layer");"category"!==L&&k("hoverformat"),E._input=T}}function x(t,e,r,n,i){if("-"===r("type")){for(var a,o=0;o<n.length;o++)if(n[o].visible){a=n[o];break}a&&(e.type=h(a[i],"gregorian")),"-"===e.type?e.type="linear":t.type=e.type}return e.type}e.exports=function(t,e,r){a(t,e,r,{type:g.name,attributes:v,handleDefaults:b,font:e.font,paper_bgcolor:e.paper_bgcolor,fullData:r,layoutOut:e})}},{"../../components/color":598,"../../lib":724,"../cartesian/axis_autotype":771,"../cartesian/category_order_defaults":774,"../cartesian/line_grid_defaults":784,"../cartesian/ordered_categories":785,"../cartesian/set_convert":789,"../cartesian/tick_label_defaults":790,"../cartesian/tick_mark_defaults":791,"../cartesian/tick_value_defaults":792,"../get_data":807,"../subplot_defaults":846,"./constants":834,"./helpers":835,"./layout_attributes":837}],839:[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,editType:"calc"}}},{"../../../traces/scatter/attributes":1048}],840:[function(t,e,r){"use strict";var n=t("../../cartesian/layout_attributes"),i=t("../../../lib/extend").extendFlat,a=t("../../../plot_api/edit_types").overrideAll,o=i({},n.domain,{});function s(t,e){return i({},e,{showline:{valType:"boolean"},showticklabels:{valType:"boolean"},tickorientation:{valType:"enumerated",values:["horizontal","vertical"]},ticklen:{valType:"number",min:0},tickcolor:{valType:"color"},ticksuffix:{valType:"string"},endpadding:{valType:"number"},visible:{valType:"boolean"}})}e.exports=a({radialaxis:s(0,{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:o,orientation:{valType:"number"}}),angularaxis:s(0,{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:o}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}},"plot","nested")},{"../../../lib/extend":713,"../../../plot_api/edit_types":754,"../../cartesian/layout_attributes":782}],841:[function(t,e,r){"use strict";(e.exports=t("./micropolar")).manager=t("./micropolar_manager")},{"./micropolar":842,"./micropolar_manager":843}],842:[function(t,e,r){var n=t("d3"),i=t("../../../lib").extendDeepAll,a=t("../../../constants/alignment").MID_SHIFT,o=e.exports={version:"0.2.2"};o.Axis=function(){var t,e,r,s,l={data:[],layout:{}},c={},u={},f=n.dispatch("hover"),h={};return h.render=function(c){return function(c){e=c||e;var f=l.data,h=l.layout;("string"==typeof e||e.nodeName)&&(e=n.select(e)),e.datum(f).each(function(e,l){var c=e.slice();u={data:o.util.cloneJson(c),layout:o.util.cloneJson(h)};var f=0;c.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()),u.data[e].color=t.color,u.data[e].strokeColor=t.strokeColor,u.data[e].strokeDash=t.strokeDash,u.data[e].strokeSize=t.strokeSize});var d=c.filter(function(t,e){var r=t.visible;return void 0===r||!0===r}),p=!1,m=d.map(function(t,e){return p=p||void 0!==t.groupId,t});if(p){var v=[],g=n.nest().key(function(t,e){return void 0!==t.groupId?t.groupId:"unstacked"}).entries(m).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(g)}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 y=Math.min(h.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2;y=Math.max(10,y);var b,x=[h.margin.left+y,h.margin.top+y];b=p?[0,n.max(o.util.sumArrays(o.util.arrayLast(d).r[0],o.util.arrayLast(v)))]:n.extent(o.util.flattenArray(d.map(function(t,e){return t.r}))),h.radialAxis.domain!=o.DATAEXTENT&&(b[0]=0),r=n.scale.linear().domain(h.radialAxis.domain!=o.DATAEXTENT&&h.radialAxis.domain?h.radialAxis.domain:b).range([0,y]),u.layout.radialAxis.domain=r.domain();var _,w=o.util.flattenArray(d.map(function(t,e){return t.t})),M="string"==typeof w[0];M&&(w=o.util.deduplicate(w),_=w.slice(),w=n.range(w.length),d=d.map(function(t,e){var r=t;return t.t=[w],p&&(r.yStack=t.yStack),r}));var k=d.filter(function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry}).length===d.length,A=null===h.needsEndSpacing?M||!k:h.needsEndSpacing,T=h.angularAxis.domain&&h.angularAxis.domain!=o.DATAEXTENT&&!M&&h.angularAxis.domain[0]>=0?h.angularAxis.domain:n.extent(w),E=Math.abs(w[1]-w[0]);k&&!M&&(E=0);var S=T.slice();A&&M&&(S[1]+=E);var L=h.angularAxis.ticksCount||4;L>8&&(L=L/(L/8)+L%8),h.angularAxis.ticksStep&&(L=(S[1]-S[0])/L);var C=h.angularAxis.ticksStep||(S[1]-S[0])/(L*(h.minorTicks+1));_&&(C=Math.max(Math.round(C),1)),S[2]||(S[2]=C);var P=n.range.apply(this,S);if(P=P.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=n.scale.linear().domain(S.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=s.domain(),u.layout.angularAxis.endPadding=A?E:0,void 0===(t=n.select(this).select("svg.chart-root"))||t.empty()){var z=(new DOMParser).parseFromString("<svg xmlns='http://www.w3.org/2000/svg' class='chart-root'>' + '<g class='outer-group'>' + '<g class='chart-group'>' + '<circle class='background-circle'></circle>' + '<g class='geometry-group'></g>' + '<g class='radial axis-group'>' + '<circle class='outside-circle'></circle>' + '</g>' + '<g class='angular axis-group'></g>' + '<g class='guides-group'><line></line><circle r='0'></circle></g>' + '</g>' + '<g class='legend-group'></g>' + '<g class='tooltips-group'></g>' + '<g class='title-group'><text></text></g>' + '</g>' + '</svg>","application/xml"),O=this.appendChild(this.ownerDocument.importNode(z.documentElement,!0));t=n.select(O)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var D,I=t.select(".chart-group"),R={fill:"none",stroke:h.tickColor},N={"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){D=t.select(".legend-group").attr({transform:"translate("+[y,h.margin.top]+")"}).style({display:"block"});var F=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=void 0===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:i({},o.Legend.defaultConfig().legendConfig,{container:D,elements:F,reverseOrder:h.legend.reverseOrder})})();var j=D.node().getBBox();y=Math.min(h.width-j.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2,y=Math.max(10,y),x=[h.margin.left+y,h.margin.top+y],r.range([0,y]),u.layout.radialAxis.domain=r.domain(),D.attr("transform","translate("+[x[0]+y,x[1]-y]+")")}else D=t.select(".legend-group").style({display:"none"});t.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),I.attr("transform","translate("+x+")").style({cursor:"crosshair"});var B=[(h.width-(h.margin.left+h.margin.right+2*y+(j?j.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*y))/2];if(B[0]=Math.max(0,B[0]),B[1]=Math.max(0,B[1]),t.select(".outer-group").attr("transform","translate("+B+")"),h.title){var U=t.select("g.title-group text").style(N).text(h.title),V=U.node().getBBox();U.attr({x:x[0]-V.width/2,y:x[1]-y-20})}var q=t.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var H=q.selectAll("circle.grid-circle").data(r.ticks(5));H.enter().append("circle").attr({class:"grid-circle"}).style(R),H.attr("r",r),H.exit().remove()}q.select("circle.outside-circle").attr({r:y}).style(R);var G=t.select("circle.background-circle").attr({r:y}).style({fill:h.backgroundColor,stroke:h.stroke});function Y(t,e){return s(t)%360+h.orientation}if(h.radialAxis.visible){var W=n.svg.axis().scale(r).ticks(5).tickSize(5);q.call(W).attr({transform:"rotate("+h.radialAxis.orientation+")"}),q.selectAll(".domain").style(R),q.selectAll("g>text").text(function(t,e){return this.textContent+h.radialAxis.ticksSuffix}).style(N).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,N["font-size"]]+")":"translate("+[0,N["font-size"]]+")"}}),q.selectAll("g>line").style({stroke:"black"})}var X=t.select(".angular.axis-group").selectAll("g.angular-tick").data(P),Z=X.enter().append("g").classed("angular-tick",!0);X.attr({transform:function(t,e){return"rotate("+Y(t)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),X.exit().remove(),Z.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(R),Z.selectAll(".minor").style({stroke:h.minorTickColor}),X.select("line.grid-line").attr({x1:h.tickLength?y-h.tickLength:0,x2:y}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),Z.append("text").classed("axis-text",!0).style(N);var J=X.select("text.axis-text").attr({x:y+h.labelOffset,dy:a+"em",transform:function(t,e){var r=Y(t),n=y+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?"":_?_[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix}).style(N);h.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)});var K=n.max(I.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));D.attr({transform:"translate("+[y+K,h.margin.top]+")"});var Q=t.select("g.geometry-group").selectAll("g").size()>0,$=t.select("g.geometry-group").selectAll("g.geometry").data(d);if($.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),$.exit().remove(),d[0]||Q){var tt=[];d.forEach(function(t,e){var n={};n.radialScale=r,n.angularScale=s,n.container=$.filter(function(t,r){return r==e}),n.geometry=t.geometry,n.orientation=h.orientation,n.direction=h.direction,n.index=e,tt.push({data:t,geometryConfig:n})});var et=[];n.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(tt).forEach(function(t,e){"unstacked"===t.key?et=et.concat(t.values.map(function(t,e){return[t]})):et.push(t.values)}),et.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 i(o[r].defaultConfig(),t)});o[r]().config(n)()})}var rt,nt,it=t.select(".guides-group"),at=t.select(".tooltips-group"),ot=o.tooltipPanel().config({container:at,fontSize:8})(),st=o.tooltipPanel().config({container:at,fontSize:8})(),lt=o.tooltipPanel().config({container:at,hasTick:!0})();if(!M){var ct=it.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});I.on("mousemove.angular-guide",function(t,e){var r=o.util.getMousePos(G).angle;ct.attr({x2:-y,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;rt=s.invert(n);var i=o.util.convertToCartesian(y+12,r+180);ot.text(o.util.round(rt)).move([i[0]+x[0],i[1]+x[1]])}).on("mouseout.angular-guide",function(t,e){it.select("line").style({opacity:0})})}var ut=it.select("circle").style({stroke:"grey",fill:"none"});I.on("mousemove.radial-guide",function(t,e){var n=o.util.getMousePos(G).radius;ut.attr({r:n}).style({opacity:.5}),nt=r.invert(o.util.getMousePos(G).radius);var i=o.util.convertToCartesian(n,h.radialAxis.orientation);st.text(o.util.round(nt)).move([i[0]+x[0],i[1]+x[1]])}).on("mouseout.radial-guide",function(t,e){ut.style({opacity:0}),lt.hide(),ot.hide(),st.hide()}),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(e,r){var i=n.select(this),a=this.style.fill,s="black",l=this.style.opacity||1;if(i.attr({"data-opacity":l}),a&&"none"!==a){i.attr({"data-fill":a}),s=n.hsl(a).darker().toString(),i.style({fill:s,opacity:1});var c={t:o.util.round(e[0]),r:o.util.round(e[1])};M&&(c.t=_[e[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),h=t.node().getBoundingClientRect(),d=[f.left+f.width/2-B[0]-h.left,f.top+f.height/2-B[1]-h.top];lt.config({color:s}).text(u),lt.move(d)}else a=this.style.stroke||"black",i.attr({"data-stroke":a}),s=n.hsl(a).darker().toString(),i.style({stroke:s,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&<.show()}).on("mouseout.tooltip",function(t,e){lt.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")})})})}(c),this},h.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]={}),i(l.data[e],o.Axis.defaultConfig().data[0]),i(l.data[e],t)}),i(l.layout,o.Axis.defaultConfig().layout),i(l.layout,e.layout),this},h.getLiveConfig=function(){return u},h.getinputConfig=function(){return c},h.radialScale=function(t){return r},h.angularScale=function(t){return s},h.svg=function(){return t},n.rebind(h,f,"on"),h},o.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180;return[e,t(n)]})},o.util.dataFromEquation=function(t,e,r){var 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(void 0===t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},o.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=o.util.ensureArray(t[e],r)}),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],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])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(void 0!==t)return t[e]},t);void 0!==a&&(e.reduce(function(t,r,n){if(void 0!==t)return n===e.length-1&&delete t[r],t[r]},t),r.reduce(function(t,e,n){return void 0===t[e]&&(t[e]={}),n===r.length-1&&(t[e]=a),t[e]},t))},o.PolyChart=function(){var t=[o.PolyChart.defaultConfig()],e=n.dispatch("hover"),r={solid:"none",dash:[5,2],dot:[2,5]};function a(){var e=t[0].geometryConfig,i=e.container;"string"==typeof i&&(i=n.select(i)),i.datum(t).each(function(t,i){var a=!!t[0].data.yStack,o=t.map(function(t,e){return a?n.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):n.zip(t.data.t[0],t.data.r[0])}),s=e.angularScale,l=e.radialScale.domain()[0],c={bar:function(r,i,a){var o=t[a].data,l=e.radialScale(r[1])-e.radialScale(0),c=e.radialScale(r[2]||0),u=o.barWidth;n.select(this).attr({class:"mark bar",d:"M"+[[l+c,-u/2],[l+c,u/2],[c,u/2],[c,-u/2]].join("L")+"Z",transform:function(t,r){return"rotate("+(e.orientation+s(t[0]))+")"}})}};c.dot=function(r,i,a){var o=r[2]?[r[0],r[1]+r[2]]:r,s=n.svg.symbol().size(t[a].data.dotSize).type(t[a].data.dotType)(r,i);n.select(this).attr({class:"mark dot",d:s,transform:function(t,r){var n,i,a,s=(n=function(t,r){var n=e.radialScale(t[1]),i=(e.angularScale(t[0])+e.orientation)*Math.PI/180;return{r:n,t:i}}(o),i=n.r*Math.cos(n.t),a=n.r*Math.sin(n.t),{x:i,y:a});return"translate("+[s.x,s.y]+")"}})};var u=n.svg.line.radial().interpolate(t[0].data.lineInterpolation).radius(function(t){return e.radialScale(t[1])}).angle(function(t){return e.angularScale(t[0])*Math.PI/180});c.line=function(r,i,a){var s=r[2]?o[a].map(function(t,e){return[t[0],t[1]+t[2]]}):o[a];if(n.select(this).each(c.dot).style({opacity:function(e,r){return+t[a].data.dotVisible},fill:p.stroke(r,i,a)}).attr({class:"mark dot"}),!(i>0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:u(s),transform:function(t,r){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return p.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return p.stroke(r,i,a)},"stroke-width":function(t,e){return p["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return p["stroke-dasharray"](r,i,a)},opacity:function(t,e){return p.opacity(r,i,a)},display:function(t,e){return p.display(r,i,a)}})}};var f=e.angularScale.range(),h=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,d=n.svg.arc().startAngle(function(t){return-h/2}).endAngle(function(t){return h/2}).innerRadius(function(t){return e.radialScale(l+(t[2]||0))}).outerRadius(function(t){return e.radialScale(l+(t[2]||0))+e.radialScale(t[1])});c.arc=function(t,r,i){n.select(this).attr({class:"mark arc",d:d,transform:function(t,r){return"rotate("+(e.orientation+s(t[0])+90)+")"}})};var p={fill:function(e,r,n){return t[n].data.color},stroke:function(e,r,n){return t[n].data.strokeColor},"stroke-width":function(e,r,n){return t[n].data.strokeSize+"px"},"stroke-dasharray":function(e,n,i){return r[t[i].data.strokeDash]},opacity:function(e,r,n){return t[n].data.opacity},display:function(e,r,n){return void 0===t[n].data.visible||t[n].data.visible?"block":"none"}},m=n.select(this).selectAll("g.layer").data(o);m.enter().append("g").attr({class:"layer"});var v=m.selectAll("path.mark").data(function(t,e){return t});v.enter().append("path").attr({class:"mark"}),v.style(p).each(c[e.geometryType]),v.exit().remove(),m.exit().remove()})}return a.config=function(e){return arguments.length?(e.forEach(function(e,r){t[r]||(t[r]={}),i(t[r],o.PolyChart.defaultConfig()),i(t[r],e)}),this):t},a.getColorScale=function(){},n.rebind(a,e,"on"),a},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var t=o.Legend.defaultConfig(),e=n.dispatch("hover");function r(){var e=t.legendConfig,a=t.data.map(function(t,r){return[].concat(t).map(function(t,n){var a=i({},e.elements[r]);return a.name=t,a.color=[].concat(e.elements[r].color)[n],a})}),o=n.merge(a);o=o.filter(function(t,r){return e.elements[r]&&(e.elements[r].visibleInLegend||void 0===e.elements[r].visibleInLegend)}),e.reverseOrder&&(o=o.reverse());var s=e.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map(function(t,e){return t.color}),c=e.fontSize,u=null==e.isContinuous?"number"==typeof o[0]:e.isContinuous,f=u?e.height:c*o.length,h=s.classed("legend-group",!0).selectAll("svg").data([0]),d=h.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});d.append("g").classed("legend-axis",!0),d.append("g").classed("legend-marks",!0);var p=n.range(o.length),m=n.scale[u?"linear":"ordinal"]().domain(p).range(l),v=n.scale[u?"linear":"ordinal"]().domain(p)[u?"range":"rangePoints"]([0,f]);if(u){var g=h.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);g.enter().append("stop"),g.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),h.append("rect").classed("legend-mark",!0).attr({height:e.height,width:e.colorBandWidth,fill:"url(#grad1)"})}else{var y=h.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(t,e){return"translate("+[c/2,v(e)+c/2]+")"},d:function(t,e){var r,i,a,o=t.symbol;return a=3*(i=c),"line"===(r=o)?"M"+[[-i/2,-i/12],[i/2,-i/12],[i/2,i/12],[-i/2,i/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(a)():n.svg.symbol().type("square").size(a)()},fill:function(t,e){return m(e)}}),y.exit().remove()}var b=n.svg.axis().scale(v).orient("right"),x=h.select("g.legend-axis").attr({transform:"translate("+[u?e.colorBandWidth:c,c/2]+")"}).call(b);return x.selectAll(".domain").style({fill:"none",stroke:"none"}),x.selectAll("line").style({fill:"none",stroke:u?e.textColor:"none"}),x.selectAll("text").style({fill:e.textColor,"font-size":e.fontSize}).text(function(t,e){return o[e].name}),r}return r.config=function(e){return arguments.length?(i(t,e),this):t},n.rebind(r,e,"on"),r},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,c=function(){var n=(t=a.container.selectAll("g."+s).data([0])).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:a.padding+l,dy:.3*+a.fontSize}),c};return c.text=function(i){var o=n.hsl(a.color).l,s=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",f=i||"";e.style({fill:u,"font-size":a.fontSize+"px"}).text(f);var h=a.padding,d=e.node().getBBox(),p={fill:a.color,stroke:s,"stroke-width":"2px"},m=d.width+2*h+l,v=d.height+2*h;return r.attr({d:"M"+[[l,-v/2],[l,-v/4],[a.hasTick?0:l,0],[l,v/4],[l,v/2],[m,v/2],[m,-v/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[l,-v/2+2*h]+")"}),t.style({display:"block"}),c},c.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(t)return t.style({display:"none"}),c},c.show=function(){if(t)return t.style({display:"block"}),c},c.config=function(t){return i(a,t),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={convert:function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=i({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var a=o.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=a.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)})}if(t.layout){var s=i({},t.layout);if([[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"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e?(void 0!==s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&void 0!==s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&void 0!==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&&void 0!==s.margin.t){var l=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(s.margin).forEach(function(t,e){u[c[l.indexOf(t.key)]]=t.value}),s.margin=u}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}};return t}},{"../../../constants/alignment":696,"../../../lib":724,d3:128}],843:[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,c=e.exports={};c.framework=function(t){var e,r,i,a,u,f=new s;function h(r,s){return s&&(u=s),n.select(n.select(u).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),e=e?l(e,r):r,i||(i=o.Axis()),a=o.adapter.plotly().convert(e),i.config(a).render(u),t.data=e.data,t.layout=e.layout,c.fillLayout(t),e}return h.isPolar=!0,h.svg=function(){return i.svg()},h.getConfig=function(){return e},h.getLiveConfig=function(){return o.adapter.plotly().convert(i.getLiveConfig(),!0)},h.getLiveScales=function(){return{t:i.angularScale(),r:i.radialScale()}},h.setUndoPoint=function(){var t,n,i=this,a=o.util.cloneJson(e);t=a,n=r,f.add({undo:function(){n&&i(n)},redo:function(){i(t)}}),r=o.util.cloneJson(a)},h.undo=function(){f.undo()},h.redo=function(){f.redo()},h},c.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":598,"../../../lib":724,"./micropolar":842,"./undo_manager":844,d3:128}],844:[function(t,e,r){"use strict";e.exports=function(){var t,e=[],r=-1,n=!1;function i(t,e){return t?(n=!0,t[e](),n=!1,this):this}return{add:function(t){return n?this:(e.splice(r+1,e.length-r),e.push(t),r=e.length-1,this)},setCallback:function(e){t=e},undo:function(){var n=e[r];return n?(i(n,"undo"),r-=1,t&&t(n.undo),this):this},redo:function(){var n=e[r+1];return n?(i(n,"redo"),r+=1,t&&t(n.redo),this):this},clear:function(){e=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r<e.length-1},getCommands:function(){return e},getPreviousCommand:function(){return e[r-1]},getIndex:function(){return r}}}},{}],845:[function(t,e,r){"use strict";var n=t("d3"),i=t("tinycolor2"),a=t("../../plotly"),o=t("../../registry"),s=t("../../lib"),l=t("../../components/color"),c=t("../../components/drawing"),u=t("../plots"),f=t("../cartesian/axes"),h=t("../../components/dragelement"),d=t("../cartesian/dragbox"),p=t("../../components/fx"),m=t("../../components/titles"),v=t("../cartesian/select"),g=t("../../lib/setcursor"),y=t("../../constants/alignment").MID_SHIFT,b=s._,x=s.deg2rad,_=s.rad2deg,w=s.wrap360,M=s.wrap180,k=t("./helpers").setConvertAngular,A=t("./constants");function T(t,e){this.id=e,this.gd=t,this._hasClipOnAxisFalse=null,this.traceHash={},this.layers={},this.clipPaths={},this.clipIds={},this.viewInitial={};var r=t._fullLayout,n="clip"+r._uid+e;this.clipIds.circle=n+"-circle",this.clipPaths.circle=r._clips.append("clipPath").attr("id",this.clipIds.circle),this.clipPaths.circle.append("path"),this.framework=r._polarlayer.append("g").attr("class",e),this.radialTickLayout=null,this.angularTickLayout=null}var E=T.prototype;function S(t,e,r){f.setConvert(t,r),t._min=e._min,t._max=e._max,t.setScale()}function L(t){var e=t.ticks+String(t.ticklen)+String(t.showticklabels);return"side"in t&&(e+=t.side),e}function C(t,e){if(z(e))return c.symbolFuncs[0](t);var r=t*Math.cos(x(e[0])),n=-t*Math.sin(x(e[0])),i=t*Math.cos(x(e[1])),a=-t*Math.sin(x(e[1]));return"M"+[r,n]+"A"+[t,t]+" "+(Math.abs(e[1]-e[0])<=180?[0,0,0]:[0,1,0])+" "+[i,a]}function P(t,e){return C(t,e)+(z(e)?"":"L0,0Z")}function z(t){return 360===Math.abs(t[1]-t[0])}function O(t,e,r){return e?(t.attr("display",null),t.attr(r)):t&&t.attr("display","none"),t}function D(t,e){return"translate("+t+","+e+")"}function I(t){return"rotate("+t+")"}function R(t){return Math.abs(t)<1e-10?0:t>0?1:-1}function N(t){return R(Math.cos(t))}function F(t){return R(Math.sin(t))}e.exports=function(t,e){return new T(t,e)},E.plot=function(t,e){var r=e[this.id];this._hasClipOnAxisFalse=!1;for(var n=0;n<t.length;n++){if(!1===t[n][0].trace.cliponaxis){this._hasClipOnAxisFalse=!0;break}}this.updateLayers(e,r),this.updateLayout(e,r),u.generalUpdatePerTraceModule(this.gd,this,t,r),this.updateFx(e,r)},E.updateLayers=function(t,e){var r=this.layers,i=e.radialaxis,a=e.angularaxis,o=A.layerNames,s=o.indexOf("frontplot"),l=o.slice(0,s),c="below traces"===a.layer,u="below traces"===i.layer;c&&l.push("angular-axis"),u&&l.push("radial-axis"),c&&l.push("angular-line"),u&&l.push("radial-line"),l.push("frontplot"),c||l.push("angular-axis"),u||l.push("radial-axis"),c||l.push("angular-line"),u||l.push("radial-line");var f=this.framework.selectAll(".polarsublayer").data(l,String);f.enter().append("g").attr("class",function(t){return"polarsublayer "+t}).each(function(t){var e=r[t]=n.select(this);switch(t){case"frontplot":e.append("g").classed("scatterlayer",!0);break;case"backplot":e.append("g").classed("maplayer",!0);break;case"plotbg":r.bgcircle=e.append("path");break;case"radial-grid":e.style("fill","none"),e.append("g").classed("x",1);break;case"angular-grid":e.style("fill","none"),e.append("g").classed("angular",1);break;case"radial-line":e.append("line").style("fill","none");break;case"angular-line":e.append("path").style("fill","none")}}),f.order()},E.updateLayout=function(t,e){var r=this,n=r.layers,i=t._size,a=e.domain.x,o=e.domain.y;r.xOffset=i.l+i.w*a[0],r.yOffset=i.t+i.h*(1-o[1]);var s,u,h,d,p,m=r.xLength=i.w*(a[1]-a[0]),v=r.yLength=i.h*(o[1]-o[0]),g=r.sector=e.sector,y=r.sectorBBox=function(t){var e,r,n,i,a=t[0],o=t[1]-a,s=w(a),l=s+o,c=Math.cos(x(s)),u=Math.sin(x(s)),f=Math.cos(x(l)),h=Math.sin(x(l));i=s<=90&&l>=90||s>90&&l>=450?1:u<=0&&h<=0?0:Math.max(u,h);e=s<=180&&l>=180||s>180&&l>=540?-1:c>=0&&f>=0?0:Math.min(c,f);r=s<=270&&l>=270||s>270&&l>=630?-1:u>=0&&h>=0?0:Math.min(u,h);n=l>=360?1:c<=0&&f<=0?0:Math.max(c,f);return[e,r,n,i]}(g),b=y[2]-y[0],_=y[3]-y[1],M=v/m,k=Math.abs(_/b);M>k?(s=m,p=(v-(u=m*k))/i.h/2,h=[a[0],a[1]],d=[o[0]+p,o[1]-p]):(u=v,p=(m-(s=v/k))/i.w/2,h=[a[0]+p,a[1]-p],d=[o[0],o[1]]),r.xLength2=s,r.yLength2=u,r.xDomain2=h,r.yDomain2=d;var A=r.xOffset2=i.l+i.w*h[0],T=r.yOffset2=i.t+i.h*(1-d[1]),E=r.radius=s/b,S=r.cx=A-E*y[0],L=r.cy=T+E*y[3],C=r.cxx=S-A,z=r.cyy=L-T;r.updateRadialAxis(t,e),r.updateRadialAxisTitle(t,e),r.updateAngularAxis(t,e);var O=r.radialAxis.range,I=O[1]-O[0],R=r.xaxis={type:"linear",_id:"x",range:[y[0]*I,y[2]*I],domain:h};f.setConvert(R,t),R.setScale();var N=r.yaxis={type:"linear",_id:"y",range:[y[1]*I,y[3]*I],domain:d};f.setConvert(N,t),N.setScale(),R.isPtWithinRange=function(t){return r.isPtWithinSector(t)},N.isPtWithinRange=function(){return!0},n.frontplot.attr("transform",D(A,T)).call(c.setClipUrl,r._hasClipOnAxisFalse?null:r.clipIds.circle),n.bgcircle.attr({d:P(E,g),transform:D(S,L)}).call(l.fill,e.bgcolor),r.clipPaths.circle.select("path").attr("d",P(E,g)).attr("transform",D(C,z)),r.framework.selectAll(".crisp").classed("crisp",0)},E.updateRadialAxis=function(t,e){var r=this.gd,n=this.layers,i=this.radius,a=this.cx,o=this.cy,c=t._size,u=e.radialaxis,h=e.sector,d=w(h[0]);this.fillViewInitialKey("radialaxis.angle",u.angle);var p=this.radialAxis=s.extendFlat({},u,{_axislayer:n["radial-axis"],_gridlayer:n["radial-grid"],_id:"x",_pos:0,side:{counterclockwise:"top",clockwise:"bottom"}[u.side],domain:[0,i/c.w],anchor:"free",position:0,_counteraxis:!0});S(p,u,t),f.doAutoRange(p),u.range=p.range.slice(),u._input.range=p.range.slice(),this.fillViewInitialKey("radialaxis.range",p.range.slice()),"auto"===p.tickangle&&d>90&&d<=270&&(p.tickangle=180),p._transfn=function(t){return"translate("+p.l2p(t.x)+",0)"},p._gridpath=function(t){return C(p.r2p(t.x),h)};var m=L(u);this.radialTickLayout!==m&&(n["radial-axis"].selectAll(".xtick").remove(),this.radialTickLayout=m),f.doTicks(r,p,!0),O(n["radial-axis"],u.showticklabels||u.ticks,{transform:D(a,o)+I(-u.angle)}),O(n["radial-grid"],u.showgrid,{transform:D(a,o)}).selectAll("path").attr("transform",null),O(n["radial-line"].select("line"),u.showline,{x1:0,y1:0,x2:i,y2:0,transform:D(a,o)+I(-u.angle)}).attr("stroke-width",u.linewidth).call(l.stroke,u.linecolor)},E.updateRadialAxisTitle=function(t,e,r){var n=this.gd,i=this.radius,a=this.cx,o=this.cy,s=e.radialaxis,l=this.id+"title",u=void 0!==r?r:s.angle,f=x(u),h=Math.cos(f),d=Math.sin(f),p=0;if(s.title){var v=c.bBox(this.layers["radial-axis"].node()).height,g=s.titlefont.size;p="counterclockwise"===s.side?-v-.4*g:v+.8*g}this.layers["radial-axis-title"]=m.draw(n,l,{propContainer:s,propName:this.id+".radialaxis.title",placeholder:b(n,"Click to enter radial axis title"),attributes:{x:a+i/2*h+p*d,y:o-i/2*d+p*h,"text-anchor":"middle"},transform:{rotate:-u}})},E.updateAngularAxis=function(t,e){var r=this,i=r.gd,a=r.layers,o=r.radius,c=r.cx,u=r.cy,h=e.angularaxis,d=e.sector,p=d.map(x);r.fillViewInitialKey("angularaxis.rotation",h.rotation);var m=r.angularAxis=s.extendFlat({},h,{_axislayer:a["angular-axis"],_gridlayer:a["angular-grid"],_id:"angular",_pos:0,side:"right",domain:[0,Math.PI],anchor:"free",position:0,_counteraxis:!0});function v(t){return m.c2rad(t.x,"degrees")}function g(t){return[o*Math.cos(t),o*Math.sin(t)]}"linear"===m.type?(m.autorange=!1,z(d)?m.range=d.slice():m.range=p.map(m.unTransformRad).map(_),"radians"===m.thetaunit&&(m.tick0=_(m.tick0),m.dtick=_(m.dtick))):"category"===m.type&&(m._tickFilter=function(t){return r.isPtWithinSector({r:r.radialAxis.range[1],rad:m.c2rad(t.x)})}),S(m,h,t),f.doAutoRange(m),m._transfn=function(t){var e=v(t),r=g(e),i=D(c+r[0],u-r[1]),a=n.select(this);return a&&a.node()&&a.classed("ticks")&&(i+=I(-_(e))),i},m._gridpath=function(t){var e=g(v(t));return"M0,0L"+-e[0]+","+e[1]};var b="outside"!==h.ticks?.7:.5;m._labelx=function(t){var e=v(t),r=m._labelStandoff,n=m._pad;return(0===F(e)?0:Math.cos(e)*(r+n+b*t.fontSize))+N(e)*(t.dx+r+n)},m._labely=function(t){var e=v(t),r=m._labelStandoff,n=m._labelShift,i=m._pad;return t.dy+t.fontSize*y-n+-Math.sin(e)*(r+i+b*t.fontSize)},m._labelanchor=function(t,e){var r=v(e);return 0===F(r)?N(r)>0?"start":"end":"middle"};var w=L(h);r.angularTickLayout!==w&&(a["angular-axis"].selectAll(".angulartick").remove(),r.angularTickLayout=w),f.doTicks(i,m,!0),O(a["angular-line"].select("path"),h.showline,{d:P(o,d),transform:D(c,u)}).attr("stroke-width",h.linewidth).call(l.stroke,h.linecolor)},E.updateFx=function(t,e){this.gd._context.staticPlot||(this.updateAngularDrag(t,e),this.updateRadialDrag(t,e),this.updateMainDrag(t,e))},E.updateMainDrag=function(t,e){var r=this,o=r.gd,s=r.layers,l=t._zoomlayer,c=A.MINZOOM,u=A.OFFEDGE,f=r.radius,m=r.cx,g=r.cy,y=r.cxx,b=r.cyy,x=e.sector,_=d.makeDragger(s,"path","maindrag","crosshair");n.select(_).attr("d",P(f,x)).attr("transform",D(m,g));var w,M,k,T,E,S,L,C,z,O={element:_,gd:o,subplot:r.id,plotinfo:{xaxis:r.xaxis,yaxis:r.yaxis},xaxes:[r.xaxis],yaxes:[r.yaxis]};function I(t,e){var r=t-y,n=e-b;return Math.sqrt(r*r+n*n)}function R(t,e){return Math.atan2(b-e,t-y)}function N(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function F(t,e){var r=A.cornerLen,n=A.cornerHalfWidth;if(0===t)return P(2*n,x);var i=r/t/2,a=e-i,o=e+i,s=Math.max(0,Math.min(t,f)),l=s-n,c=s+n;return"M"+N(l,a)+"A"+[l,l]+" 0,0,0 "+N(l,o)+"L"+N(c,o)+"A"+[c,c]+" 0,0,1 "+N(c,a)+"Z"}function j(t,e){var r,n,i=w+t,a=M+e,o=I(w,M),s=Math.min(I(i,a),f),l=R(w,M),h=R(i,a);o<u?o=0:f-o<u?o=f:s<u?s=0:f-s<u&&(s=f),Math.abs(s-o)>c?(o<s?(k=o,T=s):(k=s,T=o,h=[l,l=h][0]),r=E+P(T,x)+P(k,x),n=F(k,l)+F(T,h)):(k=null,T=null,r=E,n="M0,0Z"),C.attr("d",r),z.attr("d",n),d.transitionZoombox(C,z,S,L),S=!0}function B(){if(d.removeZoombox(o),null!==k&&null!==T){d.showDoubleClickNotifier(o);var t=r.radialAxis.range,e=t[1]-t[0],n={};n[r.id+".radialaxis.range"]=[t[0]+k*e/f,t[0]+T*e/f],a.relayout(o,n)}}O.prepFn=function(t,e,n){var a=o._fullLayout.dragmode,s=_.getBoundingClientRect();switch(w=e-s.left,M=n-s.top,a){case"zoom":O.moveFn=j,O.doneFn=B,function(){k=null,T=null,E=P(f,x),S=!1;var t=o._fullLayout[r.id];L=i(t.bgcolor).getLuminance(),(C=d.makeZoombox(l,L,m,g,E)).attr("fill-rule","evenodd"),z=d.makeCorners(l,m,g),d.clearSelect(l)}();break;case"select":case"lasso":v(t,e,n,O,a)}},O.clickFn=function(t,e){if(d.removeZoombox(o),2===t){var n={};for(var i in r.viewInitial)n[r.id+"."+i]=r.viewInitial[i];o.emit("plotly_doubleclick",null),a.relayout(o,n)}p.click(o,e,r.id)},_.onmousemove=function(t){p.hover(o,t,r.id),o._fullLayout._lasthover=_,o._fullLayout._hoversubplot=r.id},_.onmouseout=function(t){o._dragging||h.unhover(o,t)},h.init(O)},E.updateRadialDrag=function(t,e){var r=this,i=r.gd,l=r.layers,c=r.radius,u=r.cx,p=r.cy,m=r.radialAxis,v=e.radialaxis,g=x(v.angle),y=m.range.slice(),b=y[1]-y[0],w=A.radialDragBoxSize,M=w/2;if(v.visible){var k,T,E,S=d.makeRectDragger(l,"radialdrag","crosshair",-M,-M,w,w),L={element:S,gd:i},C=u+(c+M)*Math.cos(g),P=p-(c+M)*Math.sin(g);n.select(S).attr("transform",D(C,P)),L.prepFn=function(){k=null,T=null,E=null,L.moveFn=z,L.doneFn=O,d.clearSelect(t._zoomlayer)},L.clampFn=function(t,e){return Math.sqrt(t*t+e*e)<A.MINDRAG&&(t=0,e=0),[t,e]},h.init(L)}function z(t,e){if(k)k(t,e);else{var r=[t,-e],n=[Math.cos(g),Math.sin(g)],i=Math.abs(s.dot(r,n)/Math.sqrt(s.dot(r,r)));isNaN(i)||(k=i<.5?R:N)}}function O(){null!==T?a.relayout(i,r.id+".radialaxis.angle",T):null!==E&&a.relayout(i,r.id+".radialaxis.range[1]",E)}function R(t,e){var n=C+t,i=P+e;T=_(Math.atan2(p-i,n-u));var a=D(u,p)+I(-T);l["radial-axis"].attr("transform",a),l["radial-line"].select("line").attr("transform",a);var o=r.gd._fullLayout,s=o[r.id];r.updateRadialAxisTitle(o,s,T)}function N(t,e){var n=s.dot([t,-e],[Math.cos(g),Math.sin(g)]),a=y[1]-b*n/c*.75;if(b>0==a>y[0]){E=m.range[1]=a,f.doTicks(i,r.radialAxis,!0),l["radial-grid"].attr("transform",D(u,p)).selectAll("path").attr("transform",null);var h=E-y[0],d=r.sectorBBox;for(var v in r.xaxis.range=[d[0]*h,d[2]*h],r.yaxis.range=[d[1]*h,d[3]*h],r.xaxis.setScale(),r.yaxis.setScale(),r.traceHash){var x=r.traceHash[v],_=s.filterVisible(x),w=x[0][0].trace._module,M=i._fullLayout[r.id];if(w.plot(i,r,_,M),!o.traceIs(v,"gl"))for(var k=0;k<_.length;k++)w.style(i,_[k])}}}},E.updateAngularDrag=function(t,e){var r=this,i=r.gd,l=r.layers,u=r.radius,p=r.cx,m=r.cy,v=r.cxx,y=r.cyy,b=e.sector,w=A.angularDragBoxSize,T=d.makeDragger(l,"path","angulardrag","move"),E={element:T,gd:i};function S(t,e){return Math.atan2(y+w-e,t-v-w)}n.select(T).attr("d",function(t,e,r){var n,i,a,o=Math.abs(r[1]-r[0])<=180?0:1;function s(t,e){return[t*Math.cos(e),-t*Math.sin(e)]}function l(t,e,r){return"A"+[t,t]+" "+[0,o,r]+" "+s(t,e)}return z(r)?(n=0,a=2*Math.PI,i=Math.PI,"M"+s(t,n)+l(t,i,0)+l(t,a,0)+"ZM"+s(e,n)+l(e,i,1)+l(e,a,1)+"Z"):(n=x(r[0]),a=x(r[1]),"M"+s(t,n)+"L"+s(e,n)+l(e,a,0)+"L"+s(t,a)+l(t,n,1)+"Z")}(u,u+w,b)).attr("transform",D(p,m)).call(g,"move");var L,C,P,O,R,N,F=l.frontplot.select(".scatterlayer").selectAll(".trace"),j=F.selectAll(".point"),B=F.selectAll(".textpoint");function U(t,e){var a=S(L+t,C+e),u=_(a-N);O=P+u,l.frontplot.attr("transform",D(r.xOffset2,r.yOffset2)+I([-u,v,y])),r.clipPaths.circle.select("path").attr("transform",D(v,y)+I(u)),j.each(function(){var t=n.select(this),e=c.getTranslate(t);t.attr("transform",D(e.x,e.y)+I([u]))}),B.each(function(){var t=n.select(this),e=t.select("text"),r=c.getTranslate(t);t.attr("transform",I([u,e.attr("x"),e.attr("y")])+D(r.x,r.y))});var h=r.angularAxis;for(var d in h.rotation=M(O),"linear"!==h.type||z(b)||(h.range=R.map(x).map(h.unTransformRad).map(_)),k(h),f.doTicks(i,h,!0),r._hasClipOnAxisFalse&&!z(b)&&(r.sector=[R[0]-u,R[1]-u],F.call(c.hideOutsideRangePoints,r)),r.traceHash)if(o.traceIs(d,"gl")){var p=r.traceHash[d],m=s.filterVisible(p),g=p[0][0].trace._module,w=i._fullLayout[r.id];g.plot(i,r,m,w)}}function V(){B.select("text").attr("transform",null);var t={};t[r.id+".angularaxis.rotation"]=O,a.relayout(i,t)}E.prepFn=function(e,n,i){var a=t[r.id];R=a.sector.slice(),P=a.angularaxis.rotation;var o=T.getBoundingClientRect();L=n-o.left,C=i-o.top,N=S(L,C),E.moveFn=U,E.doneFn=V,d.clearSelect(t._zoomlayer)},h.init(E)},E.isPtWithinSector=function(t){var e=this.sector,r=this.radialAxis,n=r.range,i=r.c2r(t.r),a=w(e[0]),o=w(e[1]);a>o&&(o+=360);var s,l,c=w(_(t.rad)),u=c+360;return n[1]>=n[0]?(s=n[0],l=n[1]):(s=n[1],l=n[0]),i>=s&&i<=l&&(z(e)||c>=a&&c<=o||u>=a&&u<=o)},E.fillViewInitialKey=function(t,e){t in this.viewInitial||(this.viewInitial[t]=e)}},{"../../components/color":598,"../../components/dragelement":620,"../../components/drawing":623,"../../components/fx":640,"../../components/titles":689,"../../constants/alignment":696,"../../lib":724,"../../lib/setcursor":743,"../../plotly":765,"../../registry":854,"../cartesian/axes":770,"../cartesian/dragbox":778,"../cartesian/select":788,"../plots":833,"./constants":834,"./helpers":835,d3:128,tinycolor2:526}],846:[function(t,e,r){"use strict";var n=t("../lib");e.exports=function(t,e,r,i){var a,o,s=i.type,l=i.attributes,c=i.handleDefaults,u=i.partition||"x",f=e._subplots[s],h=f.length;function d(t,e){return n.coerce(a,o,l,t,e)}for(var p=0;p<h;p++){var m=f[p];a=t[m]?t[m]:t[m]={},e[m]=o={},d("domain."+u,[p/h,(p+1)/h]),d("domain."+{x:"y",y:"x"}[u]),i.id=m,c(a,o,d,i)}}},{"../lib":724}],847:[function(t,e,r){"use strict";var n=t("./ternary"),i=t("../../plots/get_data").getSubplotCalcData,a=t("../../lib").counterRegex;r.name="ternary",r.attr="subplot",r.idRoot="ternary",r.idRegex=r.attrRegex=a("ternary"),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=e._subplots.ternary,o=0;o<a.length;o++){var s=a[o],l=i(r,"ternary",s),c=e[s]._subplot;c||(c=new n({id:s,graphDiv:t,container:e._ternarylayer.node()},e),e[s]._subplot=c),c.plot(l,e,t._promises)}},r.clean=function(t,e,r,n){for(var i=n._subplots.ternary||[],a=0;a<i.length;a++){var o=i[a],s=n[o]._subplot;!e[o]&&s&&(s.plotContainer.remove(),s.clipDef.remove(),s.clipDefRelative.remove(),s.layers["a-title"].remove(),s.layers["b-title"].remove(),s.layers["c-title"].remove())}}},{"../../lib":724,"../../plots/get_data":807,"./layout/attributes":848,"./layout/defaults":851,"./layout/layout_attributes":852,"./ternary":853}],848:[function(t,e,r){"use strict";e.exports={subplot:{valType:"subplotid",dflt:"ternary",editType:"calc"}}},{}],849:[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,tickformatstops:n.tickformatstops,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,layer:n.layer,min:{valType:"number",dflt:0,min:0}}},{"../../../lib/extend":713,"../../cartesian/layout_attributes":782}],850:[function(t,e,r){"use strict";var n=t("../../../lib"),i=t("./axis_attributes"),a=t("../../cartesian/tick_label_defaults"),o=t("../../cartesian/tick_mark_defaults"),s=t("../../cartesian/tick_value_defaults"),l=t("../../cartesian/line_grid_defaults");e.exports=function(t,e,r){function c(r,a){return n.coerce(t,e,i,r,a)}e.type="linear";var u=c("color"),f=u===t.color?u:r.font.color,h=e._name.charAt(0).toUpperCase(),d="Component "+h,p=c("title",d);e._hovertitle=p===d?p:h,n.coerceFont(c,"titlefont",{family:r.font.family,size:Math.round(1.2*r.font.size),color:f}),c("min"),s(t,e,c,"linear"),a(t,e,c,"linear",{}),o(t,e,c,{outerTicks:!0}),c("showticklabels")&&(n.coerceFont(c,"tickfont",{family:r.font.family,size:r.font.size,color:f}),c("tickangle"),c("tickformat")),l(t,e,c,{dfltColor:u,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:i}),c("hoverformat"),c("layer")}},{"../../../lib":724,"../../cartesian/line_grid_defaults":784,"../../cartesian/tick_label_defaults":790,"../../cartesian/tick_mark_defaults":791,"../../cartesian/tick_value_defaults":792,"./axis_attributes":849}],851:[function(t,e,r){"use strict";var n=t("../../../components/color"),i=t("../../subplot_defaults"),a=t("./layout_attributes"),o=t("./axis_defaults"),s=["aaxis","baxis","caxis"];function l(t,e,r,i){var a,l,c,u=r("bgcolor"),f=r("sum");i.bgColor=n.combine(u,i.paper_bgcolor);for(var h=0;h<s.length;h++)l=t[a=s[h]]||{},c=e[a]={_name:a,type:"linear"},o(l,c,i);var d=e.aaxis,p=e.baxis,m=e.caxis;d.min+p.min+m.min>=f&&(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)}e.exports=function(t,e,r){i(t,e,r,{type:"ternary",attributes:a,handleDefaults:l,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../../components/color":598,"../../subplot_defaults":846,"./axis_defaults":850,"./layout_attributes":852}],852:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("../../domain_attributes"),a=t("./axis_attributes"),o=t("../../../plot_api/edit_types").overrideAll;e.exports=o({domain:i({name:"ternary"}),bgcolor:{valType:"color",dflt:n.background},sum:{valType:"number",dflt:1,min:0},aaxis:a,baxis:a,caxis:a},"plot","from-root")},{"../../../components/color/attributes":597,"../../../plot_api/edit_types":754,"../../domain_attributes":796,"./axis_attributes":849}],853:[function(t,e,r){"use strict";var n=t("d3"),i=t("tinycolor2"),a=t("../../plotly"),o=t("../../lib"),s=o._,l=t("../../components/color"),c=t("../../components/drawing"),u=t("../cartesian/set_convert"),f=t("../../lib/extend").extendFlat,h=t("../plots"),d=t("../cartesian/axes"),p=t("../../components/dragelement"),m=t("../../components/fx"),v=t("../../components/titles"),g=t("../cartesian/select"),y=t("../cartesian/constants");function b(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e)}e.exports=b;var x=b.prototype;x.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},x.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var i=0;i<t.length;i++){if(!1===t[i][0].trace.cliponaxis){this._hasClipOnAxisFalse=!0;break}}this.updateLayers(r),this.adjustLayout(r,n),h.generalUpdatePerTraceModule(this.graphDiv,this,t,r),this.layers.plotbg.select("path").call(l.fill,r.bgcolor)},x.makeFramework=function(t){var e=t[this.id],r=this.clipId="clip"+this.layoutId+this.id;this.clipDef=t._clips.selectAll("#"+r).data([0]),this.clipDef.enter().append("clipPath").attr("id",r).append("path").attr("d","M0,0Z");var n=this.clipIdRelative="clip-relative"+this.layoutId+this.id;this.clipDefRelative=t._clips.selectAll("#"+n).data([0]),this.clipDefRelative.enter().append("clipPath").attr("id",n).append("path").attr("d","M0,0Z"),this.plotContainer=this.container.selectAll("g."+this.id).data([0]),this.plotContainer.enter().append("g").classed(this.id,!0),this.updateLayers(e),c.setClipUrl(this.layers.backplot,r),c.setClipUrl(this.layers.grids,r)},x.updateLayers=function(t){var e=this.layers,r=["draglayer","plotbg","backplot","grids"];"below traces"===t.aaxis.layer&&r.push("aaxis","aline"),"below traces"===t.baxis.layer&&r.push("baxis","bline"),"below traces"===t.caxis.layer&&r.push("caxis","cline"),r.push("frontplot"),"above traces"===t.aaxis.layer&&r.push("aaxis","aline"),"above traces"===t.baxis.layer&&r.push("baxis","bline"),"above traces"===t.caxis.layer&&r.push("caxis","cline");var i=this.plotContainer.selectAll("g.toplevel").data(r,String),a=["agrid","bgrid","cgrid"];i.enter().append("g").attr("class",function(t){return"toplevel "+t}).each(function(t){var r=n.select(this);e[t]=r,"frontplot"===t?r.append("g").classed("scatterlayer",!0):"backplot"===t?r.append("g").classed("maplayer",!0):"plotbg"===t?r.append("path").attr("d","M0,0Z"):"aline"===t||"bline"===t||"cline"===t?r.append("path"):"grids"===t&&a.forEach(function(t){e[t]=r.append("g").classed("grid "+t,!0);var n="bgrid"===t?"x":"y";e[t].append("g").classed(n,!0)})}),i.order()};var _=Math.sqrt(4/3);x.adjustLayout=function(t,e){var r,n,i,a,o,s,h=this,d=t.domain,p=(d.x[0]+d.x[1])/2,m=(d.y[0]+d.y[1])/2,v=d.x[1]-d.x[0],g=d.y[1]-d.y[0],y=v*e.w,b=g*e.h,x=t.sum,w=t.aaxis.min,M=t.baxis.min,k=t.caxis.min;y>_*b?i=(a=b)*_:a=(i=y)/_,o=v*i/y,s=g*a/b,r=e.l+e.w*p-i/2,n=e.t+e.h*(1-m)-a/2,h.x0=r,h.y0=n,h.w=i,h.h=a,h.sum=x,h.xaxis={type:"linear",range:[w+2*k-x,x-w-2*M],domain:[p-o/2,p+o/2],_id:"x"},u(h.xaxis,h.graphDiv._fullLayout),h.xaxis.setScale(),h.xaxis.isPtWithinRange=function(t){return t.a>=h.aaxis.range[0]&&t.a<=h.aaxis.range[1]&&t.b>=h.baxis.range[1]&&t.b<=h.baxis.range[0]&&t.c>=h.caxis.range[1]&&t.c<=h.caxis.range[0]},h.yaxis={type:"linear",range:[w,x-M-k],domain:[m-s/2,m+s/2],_id:"y"},u(h.yaxis,h.graphDiv._fullLayout),h.yaxis.setScale(),h.yaxis.isPtWithinRange=function(){return!0};var A=h.yaxis.domain[0],T=h.aaxis=f({},t.aaxis,{visible:!0,range:[w,x-M-k],side:"left",_counterangle:30,tickangle:(+t.aaxis.tickangle||0)-30,domain:[A,A+s*_],_axislayer:h.layers.aaxis,_gridlayer:h.layers.agrid,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l"+a+",-"+i/2});u(T,h.graphDiv._fullLayout),T.setScale();var E=h.baxis=f({},t.baxis,{visible:!0,range:[x-w-k,M],side:"bottom",_counterangle:30,domain:h.xaxis.domain,_axislayer:h.layers.baxis,_gridlayer:h.layers.bgrid,_counteraxis:h.aaxis,_pos:0,_id:"x",_length:i,_gridpath:"M0,0l-"+i/2+",-"+a});u(E,h.graphDiv._fullLayout),E.setScale(),T._counteraxis=E;var S=h.caxis=f({},t.caxis,{visible:!0,range:[x-w-M,k],side:"right",_counterangle:30,tickangle:(+t.caxis.tickangle||0)+30,domain:[A,A+s*_],_axislayer:h.layers.caxis,_gridlayer:h.layers.cgrid,_counteraxis:h.baxis,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l-"+a+","+i/2});u(S,h.graphDiv._fullLayout),S.setScale();var L="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";h.clipDef.select("path").attr("d",L),h.layers.plotbg.select("path").attr("d",L);var C="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";h.clipDefRelative.select("path").attr("d",C);var P="translate("+r+","+n+")";h.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",P),h.clipDefRelative.select("path").attr("transform",null);var z="translate("+(r-E._offset)+","+(n+a)+")";h.layers.baxis.attr("transform",z),h.layers.bgrid.attr("transform",z);var O="translate("+(r+i/2)+","+n+")rotate(30)translate(0,"+-T._offset+")";h.layers.aaxis.attr("transform",O),h.layers.agrid.attr("transform",O);var D="translate("+(r+i/2)+","+n+")rotate(-30)translate(0,"+-S._offset+")";h.layers.caxis.attr("transform",D),h.layers.cgrid.attr("transform",D),h.drawAxes(!0),h.plotContainer.selectAll(".crisp").classed("crisp",!1),h.layers.aline.select("path").attr("d",T.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(l.stroke,T.linecolor||"#000").style("stroke-width",(T.linewidth||0)+"px"),h.layers.bline.select("path").attr("d",E.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(l.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),h.layers.cline.select("path").attr("d",S.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(l.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),h.graphDiv._context.staticPlot||h.initInteractions(),c.setClipUrl(h.layers.frontplot,h._hasClipOnAxisFalse?null:h.clipId)},x.drawAxes=function(t){var e=this.graphDiv,r=this.id.substr(7)+"title",n=this.aaxis,i=this.baxis,a=this.caxis;if(d.doTicks(e,n,!0),d.doTicks(e,i,!0),d.doTicks(e,a,!0),t){var o=Math.max(n.showticklabels?n.tickfont.size/2:0,(a.showticklabels?.75*a.tickfont.size:0)+("outside"===a.ticks?.87*a.ticklen:0));this.layers["a-title"]=v.draw(e,"a"+r,{propContainer:n,propName:this.id+".aaxis.title",placeholder:s(e,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-n.titlefont.size/3-o,"text-anchor":"middle"}});var l=(i.showticklabels?i.tickfont.size:0)+("outside"===i.ticks?i.ticklen:0)+3;this.layers["b-title"]=v.draw(e,"b"+r,{propContainer:i,propName:this.id+".baxis.title",placeholder:s(e,"Click to enter Component B title"),attributes:{x:this.x0-l,y:this.y0+this.h+.83*i.titlefont.size+l,"text-anchor":"middle"}}),this.layers["c-title"]=v.draw(e,"c"+r,{propContainer:a,propName:this.id+".caxis.title",placeholder:s(e,"Click to enter Component C title"),attributes:{x:this.x0+this.w+l,y:this.y0+this.h+.83*a.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",k="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",A="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;function S(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}x.initInteractions=function(){var t,e,r,n,u,f,h,d,v,b,x=this,w=x.layers.plotbg.select("path").node(),L=x.graphDiv,C=L._fullLayout._zoomlayer,P={element:w,gd:L,plotinfo:{xaxis:x.xaxis,yaxis:x.yaxis},subplot:x.id,prepFn:function(a,o,s){P.xaxes=[x.xaxis],P.yaxes=[x.yaxis];var c=L._fullLayout.dragmode;a.shiftKey&&(c="pan"===c?"zoom":"pan"),P.minDrag="lasso"===c?1:void 0,"zoom"===c?(P.moveFn=I,P.doneFn=R,function(a,o,s){var c=w.getBoundingClientRect();t=o-c.left,e=s-c.top,r={a:x.aaxis.range[0],b:x.baxis.range[1],c:x.caxis.range[1]},u=r,n=x.aaxis.range[1]-r.a,f=i(x.graphDiv._fullLayout[x.id].bgcolor).getLuminance(),h="M0,"+x.h+"L"+x.w/2+", 0L"+x.w+","+x.h+"Z",d=!1,v=C.append("path").attr("class","zoombox").attr("transform","translate("+x.x0+", "+x.y0+")").style({fill:f>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",h),b=C.append("path").attr("class","zoombox-corners").attr("transform","translate("+x.x0+", "+x.y0+")").style({fill:l.background,stroke:l.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),j()}(0,o,s)):"pan"===c?(P.moveFn=N,P.doneFn=F,r={a:x.aaxis.range[0],b:x.baxis.range[1],c:x.caxis.range[1]},u=r,j()):"select"!==c&&"lasso"!==c||g(a,o,s,P,c)},clickFn:function(t,e){if(S(L),2===t){var r={};r[x.id+".aaxis.min"]=0,r[x.id+".baxis.min"]=0,r[x.id+".caxis.min"]=0,L.emit("plotly_doubleclick",null),a.relayout(L,r)}m.click(L,e,x.id)}};function z(t,e){return 1-e/x.h}function O(t,e){return 1-(t+(x.h-e)/Math.sqrt(3))/x.w}function D(t,e){return(t-(x.h-e)/Math.sqrt(3))/x.w}function I(i,a){var o=t+i,s=e+a,l=Math.max(0,Math.min(1,z(0,e),z(0,s))),c=Math.max(0,Math.min(1,O(t,e),O(o,s))),p=Math.max(0,Math.min(1,D(t,e),D(o,s))),m=(l/2+p)*x.w,g=(1-l/2-c)*x.w,w=(m+g)/2,E=g-m,S=(1-l)*x.h,L=S-E/_;E<y.MINZOOM?(u=r,v.attr("d",h),b.attr("d","M0,0Z")):(u={a:r.a+l*n,b:r.b+c*n,c:r.c+p*n},v.attr("d",h+"M"+m+","+S+"H"+g+"L"+w+","+L+"L"+m+","+S+"Z"),b.attr("d","M"+t+","+e+T+"M"+m+","+S+M+"M"+g+","+S+k+"M"+w+","+L+A)),d||(v.transition().style("fill",f>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),b.transition().style("opacity",1).duration(200),d=!0)}function R(){if(S(L),u!==r){var t={};t[x.id+".aaxis.min"]=u.a,t[x.id+".baxis.min"]=u.b,t[x.id+".caxis.min"]=u.c,a.relayout(L,t),E&&L.data&&L._context.showTips&&(o.notifier(s(L,"Double-click to zoom back out"),"long"),E=!1)}}function N(t,e){var n=t/x.xaxis._m,i=e/x.yaxis._m,a=[(u={a:r.a-i,b:r.b+(n+i)/2,c:r.c-(n-i)/2}).a,u.b,u.c].sort(),o=a.indexOf(u.a),s=a.indexOf(u.b),l=a.indexOf(u.c);a[0]<0&&(a[1]+a[0]/2<0?(a[2]+=a[0]+a[1],a[0]=a[1]=0):(a[2]+=a[0]/2,a[1]+=a[0]/2,a[0]=0),u={a:a[o],b:a[s],c:a[l]},e=(r.a-u.a)*x.yaxis._m,t=(r.c-u.c-r.b+u.b)*x.xaxis._m);var f="translate("+(x.x0+t)+","+(x.y0+e)+")";x.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",f);var h="translate("+-t+","+-e+")";x.clipDefRelative.select("path").attr("transform",h),x.aaxis.range=[u.a,x.sum-u.b-u.c],x.baxis.range=[x.sum-u.a-u.c,u.b],x.caxis.range=[x.sum-u.a-u.b,u.c],x.drawAxes(!1),x.plotContainer.selectAll(".crisp").classed("crisp",!1),x._hasClipOnAxisFalse&&x.plotContainer.select(".scatterlayer").selectAll(".trace").call(c.hideOutsideRangePoints,x)}function F(){var t={};t[x.id+".aaxis.min"]=u.a,t[x.id+".baxis.min"]=u.b,t[x.id+".caxis.min"]=u.c,a.relayout(L,t)}function j(){C.selectAll(".select-outline").remove()}w.onmousemove=function(t){m.hover(L,t,x.id),L._fullLayout._lasthover=w,L._fullLayout._hoversubplot=x.id},w.onmouseout=function(t){L._dragging||p.unhover(L,t)},p.init(P)}},{"../../components/color":598,"../../components/dragelement":620,"../../components/drawing":623,"../../components/fx":640,"../../components/titles":689,"../../lib":724,"../../lib/extend":713,"../../plotly":765,"../cartesian/axes":770,"../cartesian/constants":775,"../cartesian/select":788,"../cartesian/set_convert":789,"../plots":833,d3:128,tinycolor2:526}],854:[function(t,e,r){"use strict";var n=t("./lib/loggers"),i=t("./lib/noop"),a=t("./lib/push_unique"),o=t("./lib/extend"),s=o.extendFlat,l=o.extendDeepAll,c=t("./plots/attributes"),u=t("./plots/layout_attributes");function f(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n<e.length;n++)a(r.layoutArrayRegexes,e[n])}}function h(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.traces){var i=n.traces[e];i&&l(r.modules[e]._module.attributes,i)}}function d(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.transforms){var i=n.transforms[e];i&&l(r.transformsRegistry[e].attributes,i)}}function p(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.subplots){var i=r.subplotsRegistry[e],a=i.layoutAttributes,o="subplot"===i.attr?i.name:i.attr;Array.isArray(o)&&(o=o[0]);var s=n.subplots[o];a&&s&&l(a,s)}}function m(t){return"object"==typeof t&&(t=t.type),t}r.modules={},r.allCategories={},r.allTypes=[],r.subplotsRegistry={},r.transformsRegistry={},r.componentsRegistry={},r.layoutArrayContainers=[],r.layoutArrayRegexes=[],r.traceLayoutAttributes={},r.localeRegistry={},r.register=function(t,e,i,a){if(r.modules[e])n.log("Type "+e+" already registered");else{for(var o={},l=0;l<i.length;l++)o[i[l]]=!0,r.allCategories[i[l]]=!0;for(var c in r.modules[e]={_module:t,categories:o},a&&Object.keys(a).length&&(r.modules[e].meta=a),r.allTypes.push(e),r.componentsRegistry)h(c,e);t.layoutAttributes&&s(r.traceLayoutAttributes,t.layoutAttributes)}},r.registerSubplot=function(t){var e=t.name;if(r.subplotsRegistry[e])n.log("Plot type "+e+" already registered.");else for(var i in f(t),r.subplotsRegistry[e]=t,r.componentsRegistry)p(i,t.name)},r.registerComponent=function(t){var e=t.name;for(var n in r.componentsRegistry[e]=t,t.layoutAttributes&&(t.layoutAttributes._isLinkedToArray&&a(r.layoutArrayContainers,e),f(t)),r.modules)h(e,n);for(var i in r.subplotsRegistry)p(e,i);for(var o in r.transformsRegistry)d(e,o);t.schema&&t.schema.layout&&l(u,t.schema.layout)},r.registerTransform=function(t){for(var e in r.transformsRegistry[t.name]=t,r.componentsRegistry)d(e,t.name)},r.getModule=function(t){var e=r.modules[m(t)];return!!e&&e._module},r.traceIs=function(t,e){if("various"===(t=m(t)))return!1;var i=r.modules[t];return i||(t&&"area"!==t&&n.log("Unrecognized trace type "+t+"."),i=r.modules[c.type.dflt]),!!i.categories[e]},r.getTransformIndices=function(t,e){for(var r=[],n=t.transforms||[],i=0;i<n.length;i++)n[i].type===e&&r.push(i);return r},r.hasTransform=function(t,e){for(var r=t.transforms||[],n=0;n<r.length;n++)if(r[n].type===e)return!0;return!1},r.getComponentMethod=function(t,e){var n=r.componentsRegistry[t];return n&&n[e]||i},r.registerLocale=function(t){var e=t.name,n=e.split("-")[0],i=t.dictionary,a=t.format,o=i&&Object.keys(i).length,s=a&&Object.keys(a).length,l=r.localeRegistry,c=l[e];if(c||(l[e]=c={}),n!==e){var u=l[n];u||(l[n]=u={}),o&&u.dictionary===c.dictionary&&(u.dictionary=i),s&&u.format===c.format&&(u.format=a)}o&&(c.dictionary=i),s&&(c.format=a)}},{"./lib/extend":713,"./lib/loggers":729,"./lib/noop":733,"./lib/push_unique":737,"./plots/attributes":768,"./plots/layout_attributes":824}],855:[function(t,e,r){"use strict";var n=t("../lib"),i=n.extendFlat,a=n.extendDeep;function o(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:"",showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:"",hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}e.exports=function(t,e){var r;t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var n,s=t.data,l=t.layout,c=a([],s),u=a({},l,o(e.tileClass)),f=t._context||{};if(e.width&&(u.width=e.width),e.height&&(u.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){u.annotations=[];var h=Object.keys(u);for(r=0;r<h.length;r++)n=h[r],["xaxis","yaxis","zaxis"].indexOf(n.slice(0,5))>-1&&(u[h[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++)u.annotations.push(e.annotations[r]);var p=Object.keys(u).filter(function(t){return t.match(/^scene\d*$/)});if(p.length){var m={};for("thumbnail"===e.tileClass&&(m={title:"",showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),r=0;r<p.length;r++){var v=u[p[r]];v.xaxis||(v.xaxis={}),v.yaxis||(v.yaxis={}),v.zaxis||(v.zaxis={}),i(v.xaxis,m),i(v.yaxis,m),i(v.zaxis,m),v._scene=null}}var g=document.createElement("div");e.tileClass&&(g.className=e.tileClass);var y={gd:g,td:g,layout:u,data:c,config:{staticPlot:void 0===e.staticPlot||e.staticPlot,plotGlPixelRatio:void 0===e.plotGlPixelRatio?2:e.plotGlPixelRatio,displaylogo:e.displaylogo||!1,showLink:e.showLink||!1,showTips:e.showTips||!1,mapboxAccessToken:f.mapboxAccessToken}};return"transparent"!==e.setBackground&&(y.config.setBackground=e.setBackground||"opaque"),y.gd.defaultLayout=o(e.tileClass),y}},{"../lib":724}],856:[function(t,e,r){"use strict";var n=t("../plot_api/to_image"),i=t("../lib"),a=t("./filesaver");e.exports=function(t,e){return(e=e||{}).format=e.format||"png",new Promise(function(r,o){t._snapshotInProgress&&o(new Error("Snapshotting already in progress.")),i.isIE()&&"svg"!==e.format&&o(new Error("Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.")),t._snapshotInProgress=!0;var s=n(t,e),l=e.filename||t.fn||"newplot";l+="."+e.format,s.then(function(e){return t._snapshotInProgress=!1,a(e,l)}).then(function(t){r(t)}).catch(function(e){t._snapshotInProgress=!1,o(e)})})}},{"../lib":724,"../plot_api/to_image":763,"./filesaver":857}],857:[function(t,e,r){"use strict";e.exports=function(t,e){var r=document.createElement("a"),n="download"in r,i=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent);return new Promise(function(a,o){if("undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent)&&o(new Error("IE < 10 unsupported")),i&&(document.location.href="data:application/octet-stream"+t.slice(t.search(/[,;]/)),a(e)),e||(e="download"),n&&(r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r),a(e)),"undefined"!=typeof navigator&&navigator.msSaveBlob){var s=t.split(/^data:image\/svg\+xml,/)[1],l=decodeURIComponent(s);navigator.msSaveBlob(new Blob([l]),e),a(e)}o(new Error("download error"))})}},{}],858:[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){var e=t._fullLayout||{};if(!(!(e._has&&e._has("polar"))&&t.data&&t.data[0]&&t.data[0].r))return function(){(t.calcdata||[]).forEach(function(t){t[0]&&t[0].t&&t[0].t.cb&&t[0].t.cb()})}}},{}],859:[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":855,"./download":856,"./helpers":858,"./svgtoimg":860,"./toimage":861,"./tosvg":862}],860:[function(t,e,r){"use strict";var n=t("../lib"),i=t("events").EventEmitter;e.exports=function(t){var e=t.emitter||new i,r=new Promise(function(i,a){var o=window.Image,s=t.svg,l=t.format||"png";if(n.isIE()&&"svg"!==l){var c=new Error("Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.");return a(c),t.promise?r:e.emit("error",c)}var u=t.canvas,f=t.scale||1,h=f*(t.width||300),d=f*(t.height||150),p=u.getContext("2d"),m=new o,v="data:image/svg+xml,"+encodeURIComponent(s);u.width=h,u.height=d,m.onload=function(){var r;switch("svg"!==l&&p.drawImage(m,0,0,h,d),l){case"jpeg":r=u.toDataURL("image/jpeg");break;case"png":r=u.toDataURL("image/png");break;case"webp":r=u.toDataURL("image/webp");break;case"svg":r=v;break;default:var n="Image format is not jpeg, png, svg or webp.";if(a(new Error(n)),!t.promise)return e.emit("error",n)}i(r),t.promise||e.emit("success",r)},m.onerror=function(r){if(a(r),!t.promise)return e.emit("error",r)},m.src=v});return t.promise?r:e}},{"../lib":724,events:138}],861:[function(t,e,r){"use strict";var n=t("events").EventEmitter,i=t("../plotly"),a=t("../lib"),o=t("./helpers"),s=t("./cloneplot"),l=t("./tosvg"),c=t("./svgtoimg");e.exports=function(t,e){var r=new n,u=s(t,{format:"png"}),f=u.gd;f.style.position="absolute",f.style.left="-5000px",document.body.appendChild(f);var h=o.getRedrawFunc(f);return i.plot(f,u.data,u.layout,u.config).then(h).then(function(){var t=o.getDelay(f._fullLayout);setTimeout(function(){var t=l(f),n=document.createElement("canvas");n.id=a.randstr(),(r=c({format:e.format,width:f._fullLayout.width,height:f._fullLayout.height,canvas:n,emitter:r,svg:t})).clean=function(){f&&document.body.removeChild(f)}},t)}).catch(function(t){r.emit("error",t)}),r}},{"../lib":724,"../plotly":765,"./cloneplot":855,"./helpers":858,"./svgtoimg":860,"./tosvg":862,events:138}],862:[function(t,e,r){"use strict";var n=t("d3"),i=t("../lib"),a=t("../components/drawing"),o=t("../components/color"),s=t("../constants/xmlns_namespaces"),l=/"/g,c=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");e.exports=function(t,e,r){var u,f=t._fullLayout,h=f._paper,d=f._toppaper,p=f.width,m=f.height;h.insert("rect",":first-child").call(a.setRect,0,0,p,m).call(o.fill,f.paper_bgcolor);var v=f._basePlotModules||[];for(u=0;u<v.length;u++){var g=v[u];g.toSVG&&g.toSVG(t)}if(d){var y=d.node().childNodes,b=Array.prototype.slice.call(y);for(u=0;u<b.length;u++){var x=b[u];x.childNodes.length&&h.node().appendChild(x)}}f._draggers&&f._draggers.remove(),h.node().style.background="",h.selectAll("text").attr({"data-unformatted":null,"data-math":null}).each(function(){var t=n.select(this);if("hidden"!==this.style.visibility&&"none"!==this.style.display){t.style({visibility:null,display:null});var e=this.style.fontFamily;e&&-1!==e.indexOf('"')&&t.style("font-family",e.replace(l,"TOBESTRIPPED"))}else t.remove()}),h.selectAll(".point,.scatterpts").each(function(){var t=n.select(this),e=this.style.fill;e&&-1!==e.indexOf("url(")&&t.style("fill",e.replace(l,"TOBESTRIPPED"))}),"pdf"!==e&&"eps"!==e||h.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),h.node().setAttributeNS(s.xmlns,"xmlns",s.svg),h.node().setAttributeNS(s.xmlns,"xmlns:xlink",s.xlink),"svg"===e&&r&&(h.attr("width",r*p),h.attr("height",r*m),h.attr("viewBox","0 0 "+p+" "+m));var _=(new window.XMLSerializer).serializeToString(h.node());return _=function(t){var e=n.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(t){return"<"===t?"<":"&rt;"===t?">":-1!==t.indexOf("<")||-1!==t.indexOf(">")?"":e.html(t).text()});return e.remove(),r}(_),_=(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),i.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":598,"../components/drawing":623,"../constants/xmlns_namespaces":704,"../lib":724,d3:128}],863:[function(t,e,r){"use strict";var n=t("../../lib").mergeArray;e.exports=function(t,e){for(var r=0;r<t.length;r++)t[r].i=r;n(e.text,t,"tx"),n(e.hovertext,t,"htx");var i=e.marker;if(i){n(i.opacity,t,"mo"),n(i.color,t,"mc");var a=i.line;a&&(n(a.color,t,"mlc"),n(a.width,t,"mlw"))}}},{"../../lib":724}],864:[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,c=s({editType:"calc",arrayOk:!0}),u=n.marker,f=l({line:l({width:l({},u.line.width,{dflt:0}),editType:"calc"},i("marker.line")),editType:"calc"},i("marker"),{showscale:u.showscale,colorbar:o,opacity:{valType:"number",arrayOk:!0,dflt:1,min:0,max:1,editType:"style"}});e.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:n.text,hovertext:n.hovertext,textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"none",arrayOk:!0,editType:"calc"},textfont:l({},c,{}),insidetextfont:l({},c,{}),outsidetextfont:l({},c,{}),constraintext:{valType:"enumerated",values:["inside","outside","both","none"],dflt:"both",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},base:{valType:"any",dflt:null,arrayOk:!0,editType:"calc"},offset:{valType:"number",dflt:null,arrayOk:!0,editType:"calc"},width:{valType:"number",dflt:null,min:0,arrayOk:!0,editType:"calc"},marker:f,selected:{marker:{opacity:n.selected.marker.opacity,color:n.selected.marker.color,editType:"style"},textfont:n.selected.textfont,editType:"style"},unselected:{marker:{opacity:n.unselected.marker.opacity,color:n.unselected.marker.color,editType:"style"},textfont:n.unselected.textfont,editType:"style"},r:n.r,t:n.t,error_y:a,error_x:a,_deprecated:{bardir:{valType:"enumerated",editType:"calc",values:["v","h"]}}}},{"../../components/colorbar/attributes":599,"../../components/colorscale/color_attributes":606,"../../components/errorbars/attributes":625,"../../lib/extend":713,"../../plots/font_attributes":797,"../scatter/attributes":1048}],865:[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"),l=t("../scatter/calc_selection");e.exports=function(t,e){var r,c,u,f,h,d=i.getFromId(t,e.xaxis||"x"),p=i.getFromId(t,e.yaxis||"y");"h"===(e.orientation||(e.x&&!e.y?"h":"v"))?(r=d,u=d.makeCalcdata(e,"x"),c=p.makeCalcdata(e,"y"),h=e.xcalendar):(r=p,u=p.makeCalcdata(e,"y"),c=d.makeCalcdata(e,"x"),h=e.ycalendar);var m=Math.min(c.length,u.length),v=new Array(m);for(f=0;f<m;f++)v[f]={p:c[f],s:u[f]},e.ids&&(v[f].id=String(e.ids[f]));var g,y=e.base;if(Array.isArray(y)){for(f=0;f<Math.min(y.length,v.length);f++)g=r.d2c(y[f],0,h),n(g)?(v[f].b=+g,v[f].hasB=1):v[f].b=0;for(;f<v.length;f++)v[f].b=0}else{g=r.d2c(y,0,h);var b=n(g);for(g=b?g:0,f=0;f<v.length;f++)v[f].b=g,b&&(v[f].hasB=1)}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(v,e),l(v,e),v}},{"../../components/colorscale/calc":605,"../../components/colorscale/has_colorscale":612,"../../plots/cartesian/axes":770,"../scatter/calc_selection":1050,"./arrays_to_calcdata":863,"fast-isnumeric":140}],866:[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,c){function u(r,i){return n.coerce(t,e,l,r,i)}var f=n.coerceFont;if(a(t,e,c,u)){u("orientation",e.x&&!e.y?"h":"v"),u("base"),u("offset"),u("width"),u("text"),u("hovertext");var h=u("textposition"),d=Array.isArray(h)||"auto"===h,p=d||"inside"===h,m=d||"outside"===h;if(p||m){var v=f(u,"textfont",c.font);p&&f(u,"insidetextfont",v),m&&f(u,"outsidetextfont",v),u("constraintext"),u("selected.textfont.color"),u("unselected.textfont.color")}o(t,e,u,r,c),s(t,e,i.defaultLine,{axis:"y"}),s(t,e,i.defaultLine,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(e,u)}else e.visible=!1}},{"../../components/color":598,"../../components/errorbars/defaults":628,"../../lib":724,"../bar/style_defaults":876,"../scatter/xy_defaults":1072,"./attributes":864}],867:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../components/errorbars"),a=t("../../components/color"),o=t("../scatter/fill_hover_text");e.exports=function(t,e,r,s){var l,c,u,f,h,d,p=t.cd,m=p[0].trace,v=p[0].t,g="closest"===s;function y(t){return t[u]-t.w/2}function b(t){return t[u]+t.w/2}var x=g?y:function(t){return Math.min(y(t),t.p-v.bardelta/2)},_=g?b:function(t){return Math.max(b(t),t.p+v.bardelta/2)};function w(t){return n.inbox(x(t)-l,_(t)-l)}function M(t){return n.inbox(t.b-c,t[f]-c)+(t[f]-c)/(t[f]-t.b)}"h"===m.orientation?(l=r,c=e,u="y",f="x",h=M,d=w):(l=e,c=r,u="x",f="y",d=M,h=w);var k=t[u+"a"],A=t[f+"a"],T=n.getDistanceFunction(s,h,d);if(n.getClosest(p,T,t),!1!==t.index){g||(x=function(t){return Math.min(y(t),t.p-v.bargroupwidth/2)},_=function(t){return Math.max(b(t),t.p+v.bargroupwidth/2)});var E=p[t.index],S=E.mcc||m.marker.color,L=E.mlcc||m.marker.line.color,C=E.mlw||m.marker.line.width;a.opacity(S)?t.color=S:a.opacity(L)&&C&&(t.color=L);var P=m.base?E.b+E.s:E.s;return t[f+"0"]=t[f+"1"]=A.c2p(E[f],!0),t[f+"LabelVal"]=P,t[u+"0"]=k.c2p(x(E),!0),t[u+"1"]=k.c2p(_(E),!0),t[u+"LabelVal"]=E.p,o(E,m,t),i.hoverInfo(E,m,t),[t]}}},{"../../components/color":598,"../../components/errorbars":629,"../../components/fx":640,"../scatter/fill_hover_text":1056}],868:[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.selectPoints=t("./select"),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":781,"../scatter/colorbar":1052,"./arrays_to_calcdata":863,"./attributes":864,"./calc":865,"./defaults":866,"./hover":867,"./layout_attributes":869,"./layout_defaults":870,"./plot":871,"./select":872,"./set_positions":873,"./style":875}],869:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],870:[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,c=!1,u=!1,f={},h=0;h<r.length;h++){var d=r[h];if(n.traceIs(d,"bar")){if(l=!0,"overlay"!==t.barmode&&"stack"!==t.barmode){var p=d.xaxis+d.yaxis;f[p]&&(u=!0),f[p]=!0}if(d.visible&&"histogram"===d.type)"category"!==i.getFromId({_fullLayout:e},d["v"===d.orientation?"xaxis":"yaxis"]).type&&(c=!0)}}l&&("overlay"!==s("barmode")&&s("barnorm"),s("bargap",c&&!u?0:.2),s("bargroupgap"))}},{"../../lib":724,"../../plots/cartesian/axes":770,"../../registry":854,"./layout_attributes":869}],871:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../../lib"),s=t("../../lib/svg_text_utils"),l=t("../../components/color"),c=t("../../components/drawing"),u=t("../../components/errorbars"),f=t("./attributes"),h=f.text,d=f.textposition,p=f.textfont,m=f.insidetextfont,v=f.outsidetextfont,g=3;function y(t,e,r,n,i,a){var o;return i<1?o="scale("+i+") ":(i=1,o=""),"translate("+(r-i*t)+" "+(n-i*e)+")"+o+(a?"rotate("+a+" "+t+" "+e+") ":"")}function b(t,e,r,n){var o=x((e=e||{}).family,r),s=x(e.size,r),l=x(e.color,r);return{family:_(t.family,o,n.family),size:function(t,e,r){if(i(e)){e=+e;var n=t.min,a=t.max,o=void 0!==n&&e<n||void 0!==a&&e>a;if(!o)return e}return void 0!==r?r:t.dflt}(t.size,s,n.size),color:function(t,e,r){return a(e).isValid()?e:void 0!==r?r:t.dflt}(t.color,l,n.color)}}function x(t,e){var r;return Array.isArray(t)?e<t.length&&(r=t[e]):r=t,r}function _(t,e,r){if("string"==typeof e){if(e||!t.noBlank)return e}else if("number"==typeof e&&!t.strict)return String(e);return void 0!==r?r:t.dflt}e.exports=function(t,e,r){var a=e.xaxis,f=e.yaxis,w=t._fullLayout,M=e.plot.select(".barlayer").selectAll("g.trace.bars").data(r);M.enter().append("g").attr("class","trace bars"),M.each(function(t){t[0].node3=n.select(this)}),M.append("g").attr("class","points").each(function(e){var r=n.select(this),u=e[0].t,M=e[0].trace,k=u.poffset,A=Array.isArray(k);r.selectAll("g.point").data(o.identity).enter().append("g").classed("point",!0).each(function(r,o){var u,T,E,S,L=r.p+(A?k[o]:k),C=L+r.w,P=r.b,z=P+r.s;if("h"===M.orientation?(E=f.c2p(L,!0),S=f.c2p(C,!0),u=a.c2p(P,!0),T=a.c2p(z,!0),r.ct=[T,(E+S)/2]):(u=a.c2p(L,!0),T=a.c2p(C,!0),E=f.c2p(P,!0),S=f.c2p(z,!0),r.ct=[(u+T)/2,S]),i(u)&&i(T)&&i(E)&&i(S)&&u!==T&&E!==S){var O=(r.mlw+1||M.marker.line.width+1||(r.trace?r.trace.marker.line.width:0)+1)-1,D=n.round(O/2%1,2);if(!t._context.staticPlot){var I=l.opacity(r.mc||M.marker.color)<1||O>.01?N:function(t,e){return Math.abs(t-e)>=2?N(t):t>e?Math.ceil(t):Math.floor(t)};T=I(T,u=I(u,T)),S=I(S,E=I(E,S))}var R=n.select(this);R.append("path").style("vector-effect","non-scaling-stroke").attr("d","M"+u+","+E+"V"+S+"H"+T+"V"+E+"Z"),function(t,e,r,n,i,a,o,l){var u;function f(e,r,n){var i=e.append("text").text(r).attr({class:"bartext bartext-"+u,transform:"","text-anchor":"middle","data-notex":1}).call(c.font,n).call(s.convertToTspans,t);return i}var w=r[0].trace,M=w.orientation,k=function(t,e){var r=x(t.text,e);return _(h,r)}(w,n);if(!k)return;if("none"===(u=function(t,e){var r=x(t.textposition,e);return function(t,e,r){return t.coerceNumber&&(e=+e),-1!==t.values.indexOf(e)?e:void 0!==r?r:t.dflt}(d,r)}(w,n)))return;var A,T,E,S,L,C,P=function(t,e,r){return b(p,t.textfont,e,r)}(w,n,t._fullLayout.font),z=function(t,e,r){return b(m,t.insidetextfont,e,r)}(w,n,P),O=function(t,e,r){return b(v,t.outsidetextfont,e,r)}(w,n,P),D=t._fullLayout.barmode,I="stack"===D||"relative"===D,R=r[n],N=!I||R._outmost,F=Math.abs(a-i)-2*g,j=Math.abs(l-o)-2*g;"outside"===u&&(N||(u="inside"));if("auto"===u)if(N){u="inside",A=f(e,k,z),T=c.bBox(A.node()),E=T.width,S=T.height;var B=E>0&&S>0,U=E<=F&&S<=j,V=E<=j&&S<=F,q="h"===M?F>=E*(j/S):j>=S*(F/E);B&&(U||V||q)?u="inside":(u="outside",A.remove(),A=null)}else u="inside";if(!A&&(A=f(e,k,"outside"===u?O:z),T=c.bBox(A.node()),E=T.width,S=T.height,E<=0||S<=0))return void A.remove();"outside"===u?(C="both"===w.constraintext||"outside"===w.constraintext,L=function(t,e,r,n,i,a,o){var s,l="h"===a?Math.abs(n-r):Math.abs(e-t);l>2*g&&(s=g);var c=1;o&&(c="h"===a?Math.min(1,l/i.height):Math.min(1,l/i.width));var u,f,h,d,p=(i.left+i.right)/2,m=(i.top+i.bottom)/2;u=c*i.width,f=c*i.height,"h"===a?e<t?(h=e-s-u/2,d=(r+n)/2):(h=e+s+u/2,d=(r+n)/2):n>r?(h=(t+e)/2,d=n+s+f/2):(h=(t+e)/2,d=n-s-f/2);return y(p,m,h,d,c,!1)}(i,a,o,l,T,M,C)):(C="both"===w.constraintext||"inside"===w.constraintext,L=function(t,e,r,n,i,a,o){var s,l,c,u,f,h,d,p=i.width,m=i.height,v=(i.left+i.right)/2,b=(i.top+i.bottom)/2,x=Math.abs(e-t),_=Math.abs(n-r);x>2*g&&_>2*g?(x-=2*(f=g),_-=2*f):f=0;p<=x&&m<=_?(h=!1,d=1):p<=_&&m<=x?(h=!0,d=1):p<m==x<_?(h=!1,d=o?Math.min(x/p,_/m):1):(h=!0,d=o?Math.min(_/p,x/m):1);h&&(h=90);h?(s=d*m,l=d*p):(s=d*p,l=d*m);"h"===a?e<t?(c=e+f+s/2,u=(r+n)/2):(c=e-f-s/2,u=(r+n)/2):n>r?(c=(t+e)/2,u=n-f-l/2):(c=(t+e)/2,u=n+f+l/2);return y(v,b,c,u,d,h)}(i,a,o,l,T,M,C));A.attr("transform",L)}(t,R,e,o,u,T,E,S)}else n.select(this).remove();function N(t){return 0===w.bargap&&0===w.bargroupgap?n.round(Math.round(t)-D,2):t}})}),M.call(u.plot,e)}},{"../../components/color":598,"../../components/drawing":623,"../../components/errorbars":629,"../../lib":724,"../../lib/svg_text_utils":747,"./attributes":864,d3:128,"fast-isnumeric":140,tinycolor2:526}],872:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n=t.cd,i=t.xaxis,a=t.yaxis,o=[];if(!1===e)for(r=0;r<n.length;r++)n[r].selected=0;else for(r=0;r<n.length;r++){var s=n[r];e.contains(s.ct)?(o.push({pointNumber:r,x:i.c2d(s.x),y:a.c2d(s.y)}),s.selected=1):s.selected=0}return o}},{}],873:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../../registry"),o=t("../../plots/cartesian/axes"),s=t("./sieve.js");function l(t,e,r,a){if(a.length){var l,b,x,_,w=t._fullLayout.barmode,M="group"===w;if("overlay"===w)c(t,e,r,a);else if(M){for(l=[],b=[],x=0;x<a.length;x++)void 0===(_=a[x])[0].trace.offset?b.push(_):l.push(_);b.length&&function(t,e,r,n){var i=t._fullLayout.barnorm,a=new s(n,!1,!i);(function(t,e,r){var n,i,a,o,s=t._fullLayout,l=s.bargap,c=s.bargroupgap,u=r.positions,p=r.distinctPositions,m=r.minDiff,v=r.traces,g=u.length!==p.length,y=v.length,b=m*(1-l),x=g?b/y:b,_=x*(1-c);for(n=0;n<y;n++){i=v[n],a=i[0];var w=g?((2*n+1-y)*x-_)/2:-_/2;(o=a.t).barwidth=_,o.poffset=w,o.bargroupwidth=b,o.bardelta=m}r.binWidth=v[0][0].t.barwidth/100,f(r),h(t,e,r),d(t,e,r,g)})(t,e,a),i?(v(t,r,a),g(t,r,a)):m(t,r,a)}(t,e,r,b),l.length&&c(t,e,r,l)}else{for(l=[],b=[],x=0;x<a.length;x++)void 0===(_=a[x])[0].trace.base?b.push(_):l.push(_);b.length&&function(t,e,r,a){var l=t._fullLayout.barmode,c="stack"===l,f="relative"===l,h=t._fullLayout.barnorm,d=new s(a,f,!(h||c||f));u(t,e,d),function(t,e,r){var a,s,l,c,u=t._fullLayout.barnorm,f=y(e),h=r.traces,d=[null,null];for(a=0;a<h.length;a++)for(s=h[a],l=0;l<s.length;l++)if((c=s[l]).s!==i){var m=r.put(c.p,c.b+c.s),v=m+c.b+c.s;c.b=m,c[f]=v,u||(n(e.c2l(v))&&p(d,v),c.hasB&&n(e.c2l(m))&&p(d,m))}u||o.expand(e,d,{tozero:!0,padded:!0})}(t,r,d);for(var m=0;m<a.length;m++)for(var v=a[m],b=0;b<v.length;b++){var x=v[b];if(x.s!==i){var _=x.b+x.s===d.get(x.p,x.s);_&&(x._outmost=!0)}}h&&g(t,r,d)}(t,e,r,b),l.length&&c(t,e,r,l)}}}function c(t,e,r,n){for(var i=t._fullLayout.barnorm,a=!i,o=0;o<n.length;o++){var l=n[o],c=new s([l],!1,a);u(t,e,c),i?(v(t,r,c),g(t,r,c)):m(t,r,c)}}function u(t,e,r){var n,i,a=t._fullLayout,o=a.bargap,s=a.bargroupgap,l=r.minDiff,c=r.traces,u=l*(1-o),p=u*(1-s),m=-p/2;for(n=0;n<c.length;n++)(i=c[n][0].t).barwidth=p,i.poffset=m,i.bargroupwidth=u,i.bardelta=l;r.binWidth=c[0][0].t.barwidth/100,f(r),h(t,e,r),d(t,e,r)}function f(t){var e,r,i,a,o,s,l=t.traces;for(e=0;e<l.length;e++){a=(i=(r=l[e])[0]).trace,s=i.t;var c,u=a.offset,f=s.poffset;if(Array.isArray(u)){for(c=u.slice(0,r.length),o=0;o<c.length;o++)n(c[o])||(c[o]=f);for(o=c.length;o<r.length;o++)c.push(f);s.poffset=c}else void 0!==u&&(s.poffset=u);var h=a.width,d=s.barwidth;if(Array.isArray(h)){var p=h.slice(0,r.length);for(o=0;o<p.length;o++)n(p[o])||(p[o]=d);for(o=p.length;o<r.length;o++)p.push(d);if(s.barwidth=p,void 0===u){for(c=[],o=0;o<r.length;o++)c.push(f+(d-p[o])/2);s.poffset=c}}else void 0!==h&&(s.barwidth=h,void 0===u&&(s.poffset=f+(d-h)/2))}}function h(t,e,r){for(var n=r.traces,i=y(e),a=0;a<n.length;a++)for(var o=n[a],s=o[0].t,l=s.poffset,c=Array.isArray(l),u=s.barwidth,f=Array.isArray(u),h=0;h<o.length;h++){var d=o[h],p=d.w=f?u[h]:u;d[i]=d.p+(c?l[h]:l)+p/2}}function d(t,e,r,n){var i=r.traces,a=r.distinctPositions,s=a[0],l=r.minDiff,c=l/2;o.minDtick(e,l,s,n);for(var u=Math.min.apply(Math,a)-c,f=Math.max.apply(Math,a)+c,h=0;h<i.length;h++){var d=i[h],p=d[0],m=p.trace;if(void 0!==m.width||void 0!==m.offset)for(var v=p.t,g=v.poffset,y=v.barwidth,b=Array.isArray(g),x=Array.isArray(y),_=0;_<d.length;_++){var w=d[_],M=b?g[_]:g,k=x?y[_]:y,A=w.p+M,T=A+k;u=Math.min(u,A),f=Math.max(f,T)}}o.expand(e,[u,f],{padded:!1})}function p(t,e){n(t[0])?t[0]=Math.min(t[0],e):t[0]=e,n(t[1])?t[1]=Math.max(t[1],e):t[1]=e}function m(t,e,r){for(var i=r.traces,a=y(e),s=[null,null],l=0;l<i.length;l++)for(var c=i[l],u=0;u<c.length;u++){var f=c[u],h=f.b,d=h+f.s;f[a]=d,n(e.c2l(d))&&p(s,d),f.hasB&&n(e.c2l(h))&&p(s,h)}o.expand(e,s,{tozero:!0,padded:!0})}function v(t,e,r){for(var n=r.traces,a=0;a<n.length;a++)for(var o=n[a],s=0;s<o.length;s++){var l=o[s];l.s!==i&&r.put(l.p,l.b+l.s)}}function g(t,e,r){var a=r.traces,s=y(e),l="fraction"===t._fullLayout.barnorm?1:100,c=l/1e9,u=e.l2c(e.c2l(0)),f="stack"===t._fullLayout.barmode?l:u,h=[u,f],d=!1;function m(t){n(e.c2l(t))&&(t<u-c||t>f+c||!n(u))&&(d=!0,p(h,t))}for(var v=0;v<a.length;v++)for(var g=a[v],b=0;b<g.length;b++){var x=g[b];if(x.s!==i){var _=Math.abs(l/r.get(x.p,x.s));x.b*=_,x.s*=_;var w=x.b,M=w+x.s;x[s]=M,m(M),x.hasB&&m(w)}}o.expand(e,h,{tozero:!0,padded:d})}function y(t){return t._id.charAt(0)}e.exports=function(t,e){var r,n=e.xaxis,i=e.yaxis,o=t._fullData,s=t.calcdata,c=[],u=[];for(r=0;r<o.length;r++){var f=o[r];!0===f.visible&&a.traceIs(f,"bar")&&f.xaxis===n._id&&f.yaxis===i._id&&("h"===f.orientation?c.push(s[r]):u.push(s[r]))}l(t,n,i,u),l(t,i,n,c)}},{"../../constants/numerical":702,"../../plots/cartesian/axes":770,"../../registry":854,"./sieve.js":874,"fast-isnumeric":140}],874:[function(t,e,r){"use strict";e.exports=a;var n=t("../../lib"),i=t("../../constants/numerical").BADNUM;function a(t,e,r){this.traces=t,this.separateNegativeValues=e,this.dontMergeOverlappingData=r;for(var a=1/0,o=[],s=0;s<t.length;s++){for(var l=t[s],c=0;c<l.length;c++){var u=l[c];u.p!==i&&o.push(u.p)}l[0]&&l[0].width1&&(a=Math.min(l[0].width1,a))}this.positions=o;var f=n.distinctVals(o);this.distinctPositions=f.vals,1===f.vals.length&&a!==1/0?this.minDiff=a:this.minDiff=Math.min(f.minDiff,a),this.binWidth=this.minDiff,this.bins={}}a.prototype.put=function(t,e){var r=this.getLabel(t,e),n=this.bins[r]||0;return this.bins[r]=n+e,n},a.prototype.get=function(t,e){var r=this.getLabel(t,e);return this.bins[r]||0},a.prototype.getLabel=function(t,e){return(e<0&&this.separateNegativeValues?"v":"^")+(this.dontMergeOverlappingData?t:Math.round(t/this.binWidth))}},{"../../constants/numerical":702,"../../lib":724}],875:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/drawing"),a=t("../../components/errorbars");e.exports=function(t,e){var r=e?e[0].node3:n.select(t).selectAll("g.trace.bars"),o=r.size(),s=t._fullLayout;r.style("opacity",function(t){return t[0].trace.opacity}).each(function(t){("stack"===s.barmode&&o>1||0===s.bargap&&0===s.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),r.selectAll("g.points").each(function(e){var r=n.select(this),a=r.selectAll("path"),o=r.selectAll("text"),s=e[0].trace;i.pointStyle(a,s,t),i.selectedPointStyle(a,s),o.each(function(t){var e,r=n.select(this);function a(r){var n=e[r];return Array.isArray(n)?n[t.i]:n}r.classed("bartext-inside")?e=s.insidetextfont:r.classed("bartext-outside")&&(e=s.outsidetextfont),e||(e=s.textfont),i.font(r,a("family"),a("size"),a("color"))}),i.selectedTextStyle(o,s)}),a.style(r)}},{"../../components/drawing":623,"../../components/errorbars":629,d3:128}],876:[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"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":598,"../../components/colorscale/defaults":608,"../../components/colorscale/has_colorscale":612}],877:[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",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},name:{valType:"string",editType:"calc+clearAxisTypes"},text:a({},n.text,{}),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calcIfAutorange"},notched:{valType:"boolean",editType:"calcIfAutorange"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calcIfAutorange"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers",editType:"calcIfAutorange"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1,editType:"calcIfAutorange"},jitter:{valType:"number",min:0,max:1,editType:"calcIfAutorange"},pointpos:{valType:"number",min:-2,max:2,editType:"calcIfAutorange"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:a({},o.symbol,{arrayOk:!1,editType:"plot"}),opacity:a({},o.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:a({},o.size,{arrayOk:!1,editType:"calcIfAutorange"}),color:a({},o.color,{arrayOk:!1,editType:"style"}),line:{color:a({},s.color,{arrayOk:!1,dflt:i.defaultLine,editType:"style"}),width:a({},s.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":597,"../../lib/extend":713,"../scatter/attributes":1048}],878:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=i._,o=t("../../plots/cartesian/axes");function s(t,e,r){var n={text:"tx"};for(var i in n)Array.isArray(e[i])&&(t[n[i]]=e[i][r])}function l(t,e){return t.v-e.v}function c(t){return t.v}e.exports=function(t,e){var r,u,f,h,d,p=t._fullLayout,m=o.getFromId(t,e.xaxis||"x"),v=o.getFromId(t,e.yaxis||"y"),g=[],y="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(u=m,f="x",h=v,d="y"):(u=v,f="y",h=m,d="x");var b=u.makeCalcdata(e,f),x=function(t,e,r,a,o){if(e in t)return r.makeCalcdata(t,e);var s;s=e+"0"in t?t[e+"0"]:"name"in t&&("category"===r.type||n(t.name)&&-1!==["linear","log"].indexOf(r.type)||i.isDateTime(t.name)&&"date"===r.type)?t.name:o;var l=r.d2c(s,0,t[e+"calendar"]);return a.map(function(){return l})}(e,d,h,b,p[y]),_=i.distinctVals(x),w=_.vals,M=_.minDiff/2,k=function(t,e){for(var r=t.length,n=new Array(r+1),i=0;i<r;i++)n[i]=t[i]-e;return n[r]=t[r-1]+e,n}(w,M),A=b.length,T=w.length,E=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=[];return e}(T);for(r=0;r<A;r++){var S=b[r];if(n(S)){var L=i.findBin(x[r],k);if(L>=0&&L<T){var C={v:S,i:r};s(C,e,r),E[L].push(C)}}}for(r=0;r<T;r++)if(E[r].length>0){var P=E[r].sort(l),z=P.map(c),O=z.length,D={pos:w[r],pts:P};D.min=z[0],D.max=z[O-1],D.mean=i.mean(z,O),D.sd=i.stdev(z,O,D.mean),D.q1=i.interp(z,.25),D.med=i.interp(z,.5),D.q3=i.interp(z,.75),D.lf=Math.min(D.q1,z[Math.min(i.findBin(2.5*D.q1-1.5*D.q3,z,!0)+1,O-1)]),D.uf=Math.max(D.q3,z[Math.max(i.findBin(2.5*D.q3-1.5*D.q1,z),0)]),D.lo=4*D.q1-3*D.q3,D.uo=4*D.q3-3*D.q1;var I=1.57*(D.q3-D.q1)/Math.sqrt(O);D.ln=D.med-I,D.un=D.med+I,g.push(D)}return function(t,e){if(Array.isArray(e.selectedpoints))for(var r=0;r<t.length;r++){for(var n=t[r].pts||[],a={},o=0;o<n.length;o++)a[n[o].i]=o;i.tagSelected(n,e,a)}}(g,e),o.expand(u,b,{padded:!0}),g.length>0?(g[0].t={num:p[y],dPos:M,posLetter:d,valLetter:f,labels:{med:a(t,"median:"),min:a(t,"min:"),q1:a(t,"q1:"),q3:a(t,"q3:"),max:a(t,"max:"),mean:"sd"===e.boxmean?a(t,"mean \xb1 \u03c3:"):a(t,"mean:"),lf:a(t,"lower fence:"),uf:a(t,"upper fence:")}},e._fullInput&&"candlestick"===e._fullInput.type&&delete g[0].t.labels,p[y]++,g):[{t:{empty:!0}}]}},{"../../lib":724,"../../plots/cartesian/axes":770,"fast-isnumeric":140}],879:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../components/color"),o=t("./attributes");function s(t,e,r,n){var a,o=r("y"),s=r("x");if(o&&o.length)a="v",s||r("x0");else{if(!s||!s.length)return void(e.visible=!1);a="h",r("y0")}i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],n),r("orientation",a)}function l(t,e,r,i){var a=i.prefix,s=n.coerce2(t,e,o,"marker.outliercolor"),l=r("marker.line.outliercolor"),c=r(a+"points",s||l?"suspectedoutliers":void 0);c?(r("jitter","all"===c?.3:0),r("pointpos","all"===c?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.color",e.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===c&&(r("marker.line.outliercolor",e.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text")):delete e.marker,r("hoveron"),n.coerceSelectionMarkerOpacity(e,r)}e.exports={supplyDefaults:function(t,e,r,i){function c(r,i){return n.coerce(t,e,o,r,i)}s(t,e,c,i),!1!==e.visible&&(c("line.color",(t.marker||{}).color||r),c("line.width"),c("fillcolor",a.addOpacity(e.line.color,.5)),c("whiskerwidth"),c("boxmean"),c("notched",void 0!==t.notchwidth)&&c("notchwidth"),l(t,e,c,{prefix:"box"}))},handleSampleDefaults:s,handlePointsDefaults:l}},{"../../components/color":598,"../../lib":724,"../../registry":854,"./attributes":877}],880:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib"),a=t("../../components/fx"),o=t("../../components/color"),s=t("../scatter/fill_hover_text");function l(t,e,r,s){var l,c,u,f,h,d,p,m,v,g,y=t.cd,b=t.xa,x=t.ya,_=y[0].trace,w=y[0].t,M="violin"===_.type,k=[],A="closest"!==s||M?w.bdPos:2.5*w.bdPos,T=function(t){return t.pos+w.bPos-d};M&&"both"!==_.side?("positive"===_.side&&(v=function(t){var e=T(t);return a.inbox(e,e+A)}),"negative"===_.side&&(v=function(t){var e=T(t);return a.inbox(e-A,e)})):v=function(t){var e=T(t);return a.inbox(e-A,e+A)},g=M?function(t){return a.inbox(t.span[0]-h,t.span[1]-h)}:function(t){return a.inbox(t.min-h,t.max-h)},"h"===_.orientation?(h=e,d=r,p=g,m=v,l="y",u=x,c="x",f=b):(h=r,d=e,p=v,m=g,l="x",u=b,c="y",f=x);var E=a.getDistanceFunction(s,p,m);if(a.getClosest(y,E,t),!1===t.index)return[];var S=y[t.index],L=_.line.color,C=(_.marker||{}).color;o.opacity(L)&&_.line.width?t.color=L:o.opacity(C)&&_.boxpoints?t.color=C:t.color=_.fillcolor,t[l+"0"]=u.c2p(S.pos+w.bPos-w.bdPos,!0),t[l+"1"]=u.c2p(S.pos+w.bPos+w.bdPos,!0),n.tickText(u,u.c2l(S.pos),"hover").text,t[l+"LabelVal"]=S.pos;var P={},z=["med","min","q1","q3","max"];(_.boxmean||(_.meanline||{}).visible)&&z.push("mean"),(_.boxpoints||_.points)&&z.push("lf","uf");for(var O=0;O<z.length;O++){var D=z[O];if(D in S&&!(S[D]in P)){P[S[D]]=!0;var I=S[D],R=f.c2p(I,!0),N=i.extendFlat({},t);N[c+"0"]=N[c+"1"]=R,N[c+"LabelVal"]=I,N[c+"Label"]=(w.labels?w.labels[D]+" ":"")+n.hoverLabelText(f,I),"mean"===D&&"sd"in S&&"sd"===_.boxmean&&(N[c+"err"]=S.sd),t.name="",k.push(N)}}return k}function c(t,e,r){for(var n,o,l,c=t.cd,u=t.xa,f=t.ya,h=c[0].trace,d=u.c2p(e),p=f.c2p(r),m=a.quadrature(function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(u.c2p(t.x)-d)-e,1-3/e)},function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(f.c2p(t.y)-p)-e,1-3/e)}),v=!1,g=0;g<c.length;g++){o=c[g];for(var y=0;y<(o.pts||[]).length;y++){var b=m(l=o.pts[y]);b<=t.distance&&(t.distance=b,v=[g,y])}}if(!v)return!1;l=(o=c[v[0]]).pts[v[1]];var x=u.c2p(l.x,!0),_=f.c2p(l.y,!0),w=l.mrc||1;return n=i.extendFlat({},t,{index:l.i,color:(h.marker||{}).color,name:h.name,x0:x-w,x1:x+w,xLabelVal:l.x,y0:_-w,y1:_+w,yLabelVal:l.y}),s(l,h,n),n}e.exports={hoverPoints:function(t,e,r,n){var i,a=t.cd[0].trace.hoveron,o=[];return-1!==a.indexOf("boxes")&&(o=o.concat(l(t,e,r,n))),-1!==a.indexOf("points")&&(i=c(t,e,r)),"closest"===n?i?[i]:o:i?(o.push(i),o):o},hoverOnBoxes:l,hoverOnPoints:c}},{"../../components/color":598,"../../components/fx":640,"../../lib":724,"../../plots/cartesian/axes":770,"../scatter/fill_hover_text":1056}],881:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("./layout_attributes"),n.supplyDefaults=t("./defaults").supplyDefaults,n.supplyLayoutDefaults=t("./layout_defaults").supplyLayoutDefaults,n.calc=t("./calc"),n.setPositions=t("./set_positions").setPositions,n.plot=t("./plot").plot,n.style=t("./style"),n.hoverPoints=t("./hover").hoverPoints,n.selectPoints=t("./select"),n.moduleType="trace",n.name="box",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","symbols","oriented","box-violin","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":781,"./attributes":877,"./calc":878,"./defaults":879,"./hover":880,"./layout_attributes":882,"./layout_defaults":883,"./plot":884,"./select":885,"./set_positions":886,"./style":887}],882:[function(t,e,r){"use strict";e.exports={boxmode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},boxgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"},boxgroupgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"}}},{}],883:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");function a(t,e,r,n,i){for(var a,o=0;o<r.length;o++)if(r[o].type===i){a=!0;break}a&&(n(i+"mode"),n(i+"gap"),n(i+"groupgap"))}e.exports={supplyLayoutDefaults:function(t,e,r){a(0,0,r,function(r,a){return n.coerce(t,e,i,r,a)},"box")},_supply:a}},{"../../lib":724,"./layout_attributes":882}],884:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../components/drawing"),o=2e9;function s(){var t=o;return o=(69069*o+1)%4294967296,Math.abs(o-t)<429496729?s():o/4294967296}var l=5,c=.01;function u(t,e,r,a){var o,s,l=e.pos,c=e.val,u=a.bPos,f=a.wdPos||0,h=a.bPosPxOffset||0,d=r.whiskerwidth||0,p=r.notched||!1,m=p?1-2*r.notchwidth:1;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos),t.selectAll("path.box").data(i.identity).enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","box").each(function(t){var e=t.pos,a=l.c2p(e+u,!0)+h,v=l.c2p(e+u-o,!0)+h,g=l.c2p(e+u+s,!0)+h,y=l.c2p(e+u-f,!0)+h,b=l.c2p(e+u+f,!0)+h,x=l.c2p(e+u-o*m,!0)+h,_=l.c2p(e+u+s*m,!0)+h,w=c.c2p(t.q1,!0),M=c.c2p(t.q3,!0),k=i.constrain(c.c2p(t.med,!0),Math.min(w,M)+1,Math.max(w,M)-1),A=c.c2p(!1===r.boxpoints?t.min:t.lf,!0),T=c.c2p(!1===r.boxpoints?t.max:t.uf,!0),E=c.c2p(t.ln,!0),S=c.c2p(t.un,!0);"h"===r.orientation?n.select(this).attr("d","M"+k+","+x+"V"+_+"M"+w+","+v+"V"+g+(p?"H"+E+"L"+k+","+_+"L"+S+","+g:"")+"H"+M+"V"+v+(p?"H"+S+"L"+k+","+x+"L"+E+","+v:"")+"ZM"+w+","+a+"H"+A+"M"+M+","+a+"H"+T+(0===d?"":"M"+A+","+y+"V"+b+"M"+T+","+y+"V"+b)):n.select(this).attr("d","M"+x+","+k+"H"+_+"M"+v+","+w+"H"+g+(p?"V"+E+"L"+_+","+k+"L"+g+","+S:"")+"V"+M+"H"+v+(p?"V"+S+"L"+x+","+k+"L"+v+","+E:"")+"ZM"+a+","+w+"V"+A+"M"+a+","+M+"V"+T+(0===d?"":"M"+y+","+A+"H"+b+"M"+y+","+T+"H"+b))})}function f(t,e,r,n){var u=e.x,f=e.y,h=n.bdPos,d=n.bPos,p=r.boxpoints||r.points;o=2e9,t.selectAll("g.points").data(function(t){return t.forEach(function(t){t.t=n,t.trace=r}),t}).enter().append("g").attr("class","points").selectAll("path").data(function(t){var e,n,a="all"===p?t.pts:t.pts.filter(function(e){return e.v<t.lf||e.v>t.uf}),o=Math.max((t.max-t.min)/10,t.q3-t.q1),u=1e-9*o,f=o*c,m=[],v=0;if(r.jitter){if(0===o)for(v=1,m=new Array(a.length),e=0;e<a.length;e++)m[e]=1;else for(e=0;e<a.length;e++){var g=Math.max(0,e-l),y=a[g].v,b=Math.min(a.length-1,e+l),x=a[b].v;"all"!==p&&(a[e].v<t.lf?x=Math.min(x,t.lf):y=Math.max(y,t.uf));var _=Math.sqrt(f*(b-g)/(x-y+u))||0;_=i.constrain(Math.abs(_),0,1),m.push(_),v=Math.max(_,v)}n=2*r.jitter/v}for(e=0;e<a.length;e++){var w=a[e],M=w.v,k=r.jitter?n*m[e]*(s()-.5):0,A=t.pos+d+h*(r.pointpos+k);"h"===r.orientation?(w.y=A,w.x=M):(w.x=A,w.y=M),"suspectedoutliers"===p&&M<t.uo&&M>t.lo&&(w.so=!0)}return a}).enter().append("path").classed("point",!0).call(a.translatePoints,u,f)}function h(t,e,r,a){var o,s,l=e.pos,c=e.val,u=a.bPos,f=a.bPosPxOffset||0;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos),t.selectAll("path.mean").data(i.identity).enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}).each(function(t){var e=l.c2p(t.pos+u,!0)+f,i=l.c2p(t.pos+u-o,!0)+f,a=l.c2p(t.pos+u+s,!0)+f,h=c.c2p(t.mean,!0),d=c.c2p(t.mean-t.sd,!0),p=c.c2p(t.mean+t.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+h+","+i+"V"+a+("sd"===r.boxmean?"m0,0L"+d+","+e+"L"+h+","+i+"L"+p+","+e+"Z":"")):n.select(this).attr("d","M"+i+","+h+"H"+a+("sd"===r.boxmean?"m0,0L"+e+","+d+"L"+i+","+h+"L"+e+","+p+"Z":""))})}e.exports={plot:function(t,e,r){var i=t._fullLayout,a=e.xaxis,o=e.yaxis;e.plot.select(".boxlayer").selectAll("g.trace.boxes").data(r).enter().append("g").attr("class","trace boxes").each(function(t){var e,r,s=t[0],l=s.t,c=s.trace,d=s.node3=n.select(this),p=i._numBoxes,m="group"===i.boxmode&&p>1,v=l.dPos*(1-i.boxgap)*(1-i.boxgroupgap)/(m?p:1),g=m?2*l.dPos*((l.num+.5)/p-.5)*(1-i.boxgap):0,y=v*c.whiskerwidth;!0!==c.visible||l.empty?n.select(this).remove():("h"===c.orientation?(e=o,r=a):(e=a,r=o),l.bPos=g,l.bdPos=v,l.wdPos=y,u(d,{pos:e,val:r},c,l),c.boxpoints&&f(d,{x:a,y:o},c,l),c.boxmean&&h(d,{pos:e,val:r},c,l))})},plotBoxAndWhiskers:u,plotPoints:f,plotBoxMean:h}},{"../../components/drawing":623,"../../lib":724,d3:128}],885:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,i=t.cd,a=t.xaxis,o=t.yaxis,s=[];if(!1===e)for(r=0;r<i.length;r++)for(n=0;n<(i[r].pts||[]).length;n++)i[r].pts[n].selected=0;else for(r=0;r<i.length;r++)for(n=0;n<(i[r].pts||[]).length;n++){var l=i[r].pts[n],c=a.c2p(l.x),u=o.c2p(l.y);e.contains([c,u])?(s.push({pointNumber:l.i,x:a.c2d(l.x),y:o.c2d(l.y)}),l.selected=1):l.selected=0}return s}},{}],886:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib"),a=["v","h"];function o(t,e,r,a,o){var s,l,c,u=e.calcdata,f=e._fullLayout,h=[],d="violin"===t?"_numViolins":"_numBoxes";for(s=0;s<r.length;s++)for(c=u[r[s]],l=0;l<c.length;l++)h.push(c[l].pos);if(h.length){var p=i.distinctVals(h),m=p.minDiff/2;for(h.length===p.vals.length&&(f[d]=1),n.minDtick(a,p.minDiff,p.vals[0],!0),s=0;s<r.length;s++)(c=u[r[s]])[0].t.dPos=m;var v=(1-f[t+"gap"])*(1-f[t+"groupgap"])*m/f[d];n.expand(a,p.vals,{vpadminus:m+o[0]*v,vpadplus:m+o[1]*v})}}e.exports={setPositions:function(t,e){for(var r=t.calcdata,n=e.xaxis,i=e.yaxis,s=0;s<a.length;s++){for(var l=a[s],c="h"===l?i:n,u=[],f=0,h=0,d=0;d<r.length;d++){var p=r[d],m=p[0].t,v=p[0].trace;!0!==v.visible||"box"!==v.type||m.empty||v.orientation!==l||v.xaxis!==n._id||v.yaxis!==i._id||(u.push(d),!1!==v.boxpoints&&(f=Math.max(f,v.jitter-v.pointpos-1),h=Math.max(h,v.jitter+v.pointpos-1)))}o("box",t,u,c,[f,h])}},setPositionOffset:o}},{"../../lib":724,"../../plots/cartesian/axes":770}],887:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/color"),a=t("../../components/drawing");e.exports=function(t,e){var r=e?e[0].node3:n.select(t).selectAll("g.trace.boxes");r.style("opacity",function(t){return t[0].trace.opacity}),r.each(function(e){var r=n.select(this),o=e[0].trace,s=o.line.width;r.selectAll("path.box").style("stroke-width",s+"px").call(i.stroke,o.line.color).call(i.fill,o.fillcolor),r.selectAll("path.mean").style({"stroke-width":s,"stroke-dasharray":2*s+"px,"+s+"px"}).call(i.stroke,o.line.color);var l=r.selectAll("path.point");a.pointStyle(l,o,t),a.selectedPointStyle(l,o)})}},{"../../components/color":598,"../../components/drawing":623,d3:128}],888:[function(t,e,r){"use strict";var n=t("../../lib").extendFlat,i=t("../ohlc/attributes"),a=t("../box/attributes");function o(t){return{name:i.increasing.name,showlegend:i.increasing.showlegend,line:{color:n({},a.line.color,{dflt:t}),width:a.line.width,editType:"style"},fillcolor:a.fillcolor,editType:"style"}}e.exports={x:i.x,open:i.open,high:i.high,low:i.low,close:i.close,line:{width:n({},a.line.width,{}),editType:"style"},increasing:o(i.increasing.line.color.dflt),decreasing:o(i.decreasing.line.color.dflt),text:i.text,whiskerwidth:n({},a.whiskerwidth,{dflt:0})}},{"../../lib":724,"../box/attributes":877,"../ohlc/attributes":1006}],889:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../ohlc/ohlc_defaults"),a=t("../ohlc/direction_defaults"),o=t("../ohlc/helpers"),s=t("./attributes");function l(t,e,r,n){a(t,e,r,n),r(n+".line.color"),r(n+".line.width",e.line.width),r(n+".fillcolor")}e.exports=function(t,e,r,a){function c(r,i){return n.coerce(t,e,s,r,i)}o.pushDummyTransformOpts(t,e),0!==i(t,e,c,a)?(c("line.width"),l(t,e,c,"increasing"),l(t,e,c,"decreasing"),c("text"),c("whiskerwidth")):e.visible=!1}},{"../../lib":724,"../ohlc/direction_defaults":1008,"../ohlc/helpers":1009,"../ohlc/ohlc_defaults":1011,"./attributes":888}],890:[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","candlestick"],meta:{},attributes:t("./attributes"),supplyDefaults:t("./defaults")},n(t("../box")),n(t("./transform"))},{"../../plot_api/register":760,"../../plots/cartesian":781,"../box":881,"./attributes":888,"./defaults":889,"./transform":891}],891:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../ohlc/helpers");function o(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}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=[],n=0;n<t.length;n++){var i=t[n];"candlestick"===i.type?r.push(o(i,e,"increasing"),o(i,e,"decreasing")):r.push(i)}return a.addRangeSlider(r,e.layout),r},r.calcTransform=function(t,e,r){for(var i,o,s,l,c=r.direction,u=a.getFilterFn(c),f=e.open,h=e.high,d=e.low,p=e.close,m=f.length,v=[],g=[],y=e._fullInput.x?function(t){var r=e.x[t];v.push(r,r,r,r,r,r)}:function(t){v.push(t,t,t,t,t,t)},b=0;b<m;b++)u(f[b],p[b])&&n(h[b])&&n(d[b])&&(y(b),i=f[b],o=h[b],s=d[b],l=p[b],g.push(s,i,l,l,l,o));e.x=v,e.y=g}},{"../../lib":724,"../ohlc/helpers":1009,"fast-isnumeric":140}],892:[function(t,e,r){"use strict";var n=t("./axis_defaults");e.exports=function(t,e,r,i,a){i("a")||(i("da"),i("a0")),i("b")||(i("db"),i("b0")),function(t,e,r,i){["aaxis","baxis"].forEach(function(a){var o=a.charAt(0),s=t[a]||{},l={},c={tickfont:"x",id:o+"axis",letter:o,font:e.font,name:a,data:t[o],calendar:e.calendar,dfltColor:i,bgColor:r.paper_bgcolor,fullLayout:r};n(s,l,c),l._categories=l._categories||[],e[a]=l,t[a]||"-"===s.type||(t[a]={type:s.type})})}(t,e,r,a)}},{"./axis_defaults":897}],893:[function(t,e,r){"use strict";e.exports=function(t){return function t(e,r){if(!Array.isArray(e)||r>=10)return null;var n=1/0;var i=-1/0;var a=e.length;for(var o=0;o<a;o++){var s=e[o];if(Array.isArray(s)){var l=t(s,r+1);l&&(n=Math.min(l[0],n),i=Math.max(l[1],i))}else n=Math.min(s,n),i=Math.max(s,i)}return[n,i]}(t,0)}},{}],894:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("./axis_attributes"),a=t("../../components/color/attributes"),o=n({editType:"calc"});o.family.dflt='"Open Sans", verdana, arial, sans-serif',o.size.dflt=12,o.color.dflt=a.defaultLine,e.exports={carpet:{valType:"string",editType:"calc"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},a:{valType:"data_array",editType:"calc"},a0:{valType:"number",dflt:0,editType:"calc"},da:{valType:"number",dflt:1,editType:"calc"},b:{valType:"data_array",editType:"calc"},b0:{valType:"number",dflt:0,editType:"calc"},db:{valType:"number",dflt:1,editType:"calc"},cheaterslope:{valType:"number",dflt:1,editType:"calc"},aaxis:i,baxis:i,font:o,color:{valType:"color",dflt:a.defaultLine,editType:"plot"}}},{"../../components/color/attributes":597,"../../plots/font_attributes":797,"./axis_attributes":896}],895:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i,a,o,s,l,c,u,f,h,d,p,m,v,g=Array.isArray(r)?"a":"b",y=("a"===g?t.aaxis:t.baxis).smoothing,b="a"===g?t.a2i:t.b2j,x="a"===g?r:n,_="a"===g?n:r,w="a"===g?e.a.length:e.b.length,M="a"===g?e.b.length:e.a.length,k=Math.floor("a"===g?t.b2j(_):t.a2i(_)),A="a"===g?function(e){return t.evalxy([],e,k)}:function(e){return t.evalxy([],k,e)};y&&(o=Math.max(0,Math.min(M-2,k)),s=k-o,a="a"===g?function(e,r){return t.dxydi([],e,o,r,s)}:function(e,r){return t.dxydj([],o,e,s,r)});var T=b(x[0]),E=b(x[1]),S=T<E?1:-1,L=1e-8*(E-T),C=S>0?Math.floor:Math.ceil,P=S>0?Math.ceil:Math.floor,z=S>0?Math.min:Math.max,O=S>0?Math.max:Math.min,D=C(T+L),I=P(E-L),R=[[u=A(T)]];for(i=D;i*S<I*S;i+=S)l=[],p=O(T,i),v=(m=z(E,i+S))-p,c=Math.max(0,Math.min(w-2,Math.floor(.5*(p+m)))),f=A(m),y&&(h=a(c,p-c),d=a(c,m-c),l.push([u[0]+h[0]/3*v,u[1]+h[1]/3*v]),l.push([f[0]-d[0]/3*v,f[1]-d[1]/3*v])),l.push(f),R.push(l),u=f;return R}},{}],896:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../components/color/attributes"),a=t("../../plots/cartesian/layout_attributes"),o=t("../../plot_api/edit_types").overrideAll;e.exports={color:{valType:"color",editType:"calc"},smoothing:{valType:"number",dflt:1,min:0,max:1.3,editType:"calc"},title:{valType:"string",editType:"calc"},titlefont:n({editType:"calc"}),titleoffset:{valType:"number",dflt:10,editType:"calc"},type:{valType:"enumerated",values:["-","linear","date","category"],dflt:"-",editType:"calc"},autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0,editType:"calc"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"calc"},range:{valType:"info_array",editType:"calc",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}]},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},cheatertype:{valType:"enumerated",values:["index","value"],dflt:"value",editType:"calc"},tickmode:{valType:"enumerated",values:["linear","array"],dflt:"array",editType:"calc"},nticks:{valType:"integer",min:0,dflt:0,editType:"calc"},tickvals:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},showticklabels:{valType:"enumerated",values:["start","end","both","none"],dflt:"start",editType:"calc"},tickfont:n({editType:"calc"}),tickangle:{valType:"angle",dflt:"auto",editType:"calc"},tickprefix:{valType:"string",dflt:"",editType:"calc"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},ticksuffix:{valType:"string",dflt:"",editType:"calc"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"calc"},separatethousands:{valType:"boolean",dflt:!1,editType:"calc"},tickformat:{valType:"string",dflt:"",editType:"calc"},tickformatstops:o(a.tickformatstops,"calc","from-root"),categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},labelpadding:{valType:"integer",dflt:10,editType:"calc"},labelprefix:{valType:"string",editType:"calc"},labelsuffix:{valType:"string",dflt:"",editType:"calc"},showline:{valType:"boolean",dflt:!1,editType:"calc"},linecolor:{valType:"color",dflt:i.defaultLine,editType:"calc"},linewidth:{valType:"number",min:0,dflt:1,editType:"calc"},gridcolor:{valType:"color",editType:"calc"},gridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},showgrid:{valType:"boolean",dflt:!0,editType:"calc"},minorgridcount:{valType:"integer",min:0,dflt:0,editType:"calc"},minorgridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},minorgridcolor:{valType:"color",dflt:i.lightLine,editType:"calc"},startline:{valType:"boolean",editType:"calc"},startlinecolor:{valType:"color",editType:"calc"},startlinewidth:{valType:"number",dflt:1,editType:"calc"},endline:{valType:"boolean",editType:"calc"},endlinewidth:{valType:"number",dflt:1,editType:"calc"},endlinecolor:{valType:"color",editType:"calc"},tick0:{valType:"number",min:0,dflt:0,editType:"calc"},dtick:{valType:"number",min:0,dflt:1,editType:"calc"},arraytick0:{valType:"integer",min:0,dflt:0,editType:"calc"},arraydtick:{valType:"integer",min:1,dflt:1,editType:"calc"},editType:"calc"}},{"../../components/color/attributes":597,"../../plot_api/edit_types":754,"../../plots/cartesian/layout_attributes":782,"../../plots/font_attributes":797}],897:[function(t,e,r){"use strict";var n=t("./attributes"),i=t("../../components/color").addOpacity,a=t("../../registry"),o=t("../../lib"),s=t("../../plots/cartesian/tick_value_defaults"),l=t("../../plots/cartesian/tick_label_defaults"),c=t("../../plots/cartesian/category_order_defaults"),u=t("../../plots/cartesian/set_convert"),f=t("../../plots/cartesian/ordered_categories"),h=t("../../plots/cartesian/axis_autotype");e.exports=function(t,e,r){var d=r.letter,p=r.font||{},m=n[d+"axis"];function v(r,n){return o.coerce(t,e,m,r,n)}function g(r,n){return o.coerce2(t,e,m,r,n)}r.name&&(e._name=r.name,e._id=r.name);var y=v("type");("-"===y&&(r.data&&function(t,e){if("-"!==t.type)return;var r=t._id.charAt(0),n=t[r+"calendar"];t.type=h(e,n)}(e,r.data),"-"===e.type?e.type="linear":y=t.type=e.type),v("smoothing"),v("cheatertype"),v("showticklabels"),v("labelprefix",d+" = "),v("labelsuffix"),v("showtickprefix"),v("showticksuffix"),v("separatethousands"),v("tickformat"),v("exponentformat"),v("showexponent"),v("categoryorder"),v("tickmode"),v("tickvals"),v("ticktext"),v("tick0"),v("dtick"),"array"===e.tickmode&&(v("arraytick0"),v("arraydtick")),v("labelpadding"),e._hovertitle=d,"date"===y)&&a.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",r.calendar);u(e,r.fullLayout);var b=v("color",r.dfltColor),x=b===t.color?b:p.color;v("title"),o.coerceFont(v,"titlefont",{family:p.family,size:Math.round(1.2*p.size),color:x}),v("titleoffset"),v("tickangle"),v("autorange",!e.isValidRange(t.range))&&v("rangemode"),v("range"),e.cleanRange(),v("fixedrange"),s(t,e,v,y),l(t,e,v,y,r),c(t,e,v);var _=g("gridcolor",i(b,.3)),w=g("gridwidth"),M=v("showgrid");M||(delete e.gridcolor,delete e.gridwidth);var k=g("startlinecolor",b),A=g("startlinewidth",w);v("startline",e.showgrid||!!k||!!A)||(delete e.startlinecolor,delete e.startlinewidth);var T=g("endlinecolor",b),E=g("endlinewidth",w);return v("endline",e.showgrid||!!T||!!E)||(delete e.endlinecolor,delete e.endlinewidth),M?(v("minorgridcount"),v("minorgridwidth",w),v("minorgridcolor",i(_,.06)),e.minorgridcount||(delete e.minorgridwidth,delete e.minorgridcolor)):(delete e.gridcolor,delete e.gridWidth),e._initialCategories="category"===y?f(d,e.categoryorder,e.categoryarray,r.data):[],"none"===e.showticklabels&&(delete e.tickfont,delete e.tickangle,delete e.showexponent,delete e.exponentformat,delete e.tickformat,delete e.showticksuffix,delete e.showtickprefix),e.showticksuffix||delete e.ticksuffix,e.showtickprefix||delete e.tickprefix,v("tickmode"),(!e.title||e.title&&0===e.title.length)&&(delete e.titlefont,delete e.titleoffset),e}},{"../../components/color":598,"../../lib":724,"../../plots/cartesian/axis_autotype":771,"../../plots/cartesian/category_order_defaults":774,"../../plots/cartesian/ordered_categories":785,"../../plots/cartesian/set_convert":789,"../../plots/cartesian/tick_label_defaults":790,"../../plots/cartesian/tick_value_defaults":792,"../../registry":854,"./attributes":894}],898:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("./cheater_basis"),a=t("./array_minmax"),o=t("./map_2d_array"),s=t("./calc_gridlines"),l=t("./calc_labels"),c=t("./calc_clippath"),u=t("../heatmap/clean_2d_array"),f=t("./smooth_fill_2d_array");e.exports=function(t,e){var r,h=n.getFromId(t,e.xaxis||"x"),d=n.getFromId(t,e.yaxis||"y"),p=e.aaxis,m=e.baxis,v=e._a=e.a,g=e._b=e.b,y={},b=e.y;if(e._cheater){var x="index"===p.cheatertype?v.length:v,_="index"===m.cheatertype?g.length:g;r=i(x,_,e.cheaterslope)}else r=e.x;e._x=r=u(r),e._y=b=u(b),f(r,v,g),f(b,v,g),e.setScale(),y.xp=e.xp=o(e.xp,r,h.c2p),y.yp=e.yp=o(e.yp,b,d.c2p);var w=a(r),M=a(b),k=.5*(w[1]-w[0]),A=.5*(w[1]+w[0]),T=.5*(M[1]-M[0]),E=.5*(M[1]+M[0]);return w=[A-1.3*k,A+1.3*k],M=[E-1.3*T,E+1.3*T],n.expand(h,w,{padded:!0}),n.expand(d,M,{padded:!0}),s(e,y,"a","b"),s(e,y,"b","a"),l(e,p),l(e,m),y.clipsegments=c(e.xctrl,e.yctrl,p,m),y.x=r,y.y=b,y.a=v,y.b=g,[y]}},{"../../plots/cartesian/axes":770,"../heatmap/clean_2d_array":961,"./array_minmax":893,"./calc_clippath":899,"./calc_gridlines":900,"./calc_labels":901,"./cheater_basis":903,"./map_2d_array":915,"./smooth_fill_2d_array":919}],899:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i,a,o,s=[],l=!!r.smoothing,c=!!n.smoothing,u=t[0].length-1,f=t.length-1;for(i=0,a=[],o=[];i<=u;i++)a[i]=t[0][i],o[i]=e[0][i];for(s.push({x:a,y:o,bicubic:l}),i=0,a=[],o=[];i<=f;i++)a[i]=t[i][u],o[i]=e[i][u];for(s.push({x:a,y:o,bicubic:c}),i=u,a=[],o=[];i>=0;i--)a[u-i]=t[f][i],o[u-i]=e[f][i];for(s.push({x:a,y:o,bicubic:l}),i=f,a=[],o=[];i>=0;i--)a[f-i]=t[i][0],o[f-i]=e[i][0];return s.push({x:a,y:o,bicubic:c}),s}},{}],900:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e,r,a){var o,s,l,c,u,f,h,d,p,m,v,g,y,b,x=t[r],_=t[r+"axis"],w=_._gridlines=[],M=_._minorgridlines=[],k=_._boundarylines=[],A=t[a],T=t[a+"axis"];"array"===_.tickmode&&(_.tickvals=x.slice());var E=t.xctrl,S=t.yctrl,L=E[0].length,C=E.length,P=t.a.length,z=t.b.length;n.calcTicks(_),"array"===_.tickmode&&delete _.tickvals;var O=_.smoothing?3:1;function D(e){var n,i,o,s,l,c,u,f,h,p,m,v,g=[],y=[],b={};if("b"===r)for(i=t.b2j(e),o=Math.floor(Math.max(0,Math.min(z-2,i))),s=i-o,b.length=z,b.crossLength=P,b.xy=function(e){return t.evalxy([],e,i)},b.dxy=function(e,r){return t.dxydi([],e,o,r,s)},n=0;n<P;n++)c=Math.min(P-2,n),u=n-c,f=t.evalxy([],n,i),T.smoothing&&n>0&&(h=t.dxydi([],n-1,o,0,s),g.push(l[0]+h[0]/3),y.push(l[1]+h[1]/3),p=t.dxydi([],n-1,o,1,s),g.push(f[0]-p[0]/3),y.push(f[1]-p[1]/3)),g.push(f[0]),y.push(f[1]),l=f;else for(n=t.a2i(e),c=Math.floor(Math.max(0,Math.min(P-2,n))),u=n-c,b.length=P,b.crossLength=z,b.xy=function(e){return t.evalxy([],n,e)},b.dxy=function(e,r){return t.dxydj([],c,e,u,r)},i=0;i<z;i++)o=Math.min(z-2,i),s=i-o,f=t.evalxy([],n,i),T.smoothing&&i>0&&(m=t.dxydj([],c,i-1,u,0),g.push(l[0]+m[0]/3),y.push(l[1]+m[1]/3),v=t.dxydj([],c,i-1,u,1),g.push(f[0]-v[0]/3),y.push(f[1]-v[1]/3)),g.push(f[0]),y.push(f[1]),l=f;return b.axisLetter=r,b.axis=_,b.crossAxis=T,b.value=e,b.constvar=a,b.index=d,b.x=g,b.y=y,b.smoothing=T.smoothing,b}function I(e){var n,i,o,s,l,c=[],u=[],f={};if(f.length=x.length,f.crossLength=A.length,"b"===r)for(o=Math.max(0,Math.min(z-2,e)),l=Math.min(1,Math.max(0,e-o)),f.xy=function(r){return t.evalxy([],r,e)},f.dxy=function(e,r){return t.dxydi([],e,o,r,l)},n=0;n<L;n++)c[n]=E[e*O][n],u[n]=S[e*O][n];else for(i=Math.max(0,Math.min(P-2,e)),s=Math.min(1,Math.max(0,e-i)),f.xy=function(r){return t.evalxy([],e,r)},f.dxy=function(e,r){return t.dxydj([],i,e,s,r)},n=0;n<C;n++)c[n]=E[n][e*O],u[n]=S[n][e*O];return f.axisLetter=r,f.axis=_,f.crossAxis=T,f.value=x[e],f.constvar=a,f.index=e,f.x=c,f.y=u,f.smoothing=T.smoothing,f}if("array"===_.tickmode){for(c=5e-15,f=(u=[Math.floor((x.length-1-_.arraytick0)/_.arraydtick*(1+c)),Math.ceil(-_.arraytick0/_.arraydtick/(1+c))].sort(function(t,e){return t-e}))[0]-1,h=u[1]+1,d=f;d<h;d++)(s=_.arraytick0+_.arraydtick*d)<0||s>x.length-1||w.push(i(I(s),{color:_.gridcolor,width:_.gridwidth}));for(d=f;d<h;d++)if(l=_.arraytick0+_.arraydtick*d,v=Math.min(l+_.arraydtick,x.length-1),!(l<0||l>x.length-1||v<0||v>x.length-1))for(g=x[l],y=x[v],o=0;o<_.minorgridcount;o++)(b=v-l)<=0||(m=g+(y-g)*(o+1)/(_.minorgridcount+1)*(_.arraydtick/b))<x[0]||m>x[x.length-1]||M.push(i(D(m),{color:_.minorgridcolor,width:_.minorgridwidth}));_.startline&&k.push(i(I(0),{color:_.startlinecolor,width:_.startlinewidth})),_.endline&&k.push(i(I(x.length-1),{color:_.endlinecolor,width:_.endlinewidth}))}else{for(c=5e-15,f=(u=[Math.floor((x[x.length-1]-_.tick0)/_.dtick*(1+c)),Math.ceil((x[0]-_.tick0)/_.dtick/(1+c))].sort(function(t,e){return t-e}))[0],h=u[1],d=f;d<=h;d++)p=_.tick0+_.dtick*d,w.push(i(D(p),{color:_.gridcolor,width:_.gridwidth}));for(d=f-1;d<h+1;d++)for(p=_.tick0+_.dtick*d,o=0;o<_.minorgridcount;o++)(m=p+_.dtick*(o+1)/(_.minorgridcount+1))<x[0]||m>x[x.length-1]||M.push(i(D(m),{color:_.minorgridcolor,width:_.minorgridwidth}));_.startline&&k.push(i(D(x[0]),{color:_.startlinecolor,width:_.startlinewidth})),_.endline&&k.push(i(D(x[x.length-1]),{color:_.endlinecolor,width:_.endlinewidth}))}}},{"../../lib/extend":713,"../../plots/cartesian/axes":770}],901:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r,a,o,s=e._labels=[],l=e._gridlines;for(r=0;r<l.length;r++)o=l[r],-1!==["start","both"].indexOf(e.showticklabels)&&(a=n.tickText(e,o.value),i(a,{prefix:void 0,suffix:void 0,endAnchor:!0,xy:o.xy(0),dxy:o.dxy(0,0),axis:o.axis,length:o.crossAxis.length,font:o.axis.tickfont,isFirst:0===r,isLast:r===l.length-1}),s.push(a)),-1!==["end","both"].indexOf(e.showticklabels)&&(a=n.tickText(e,o.value),i(a,{endAnchor:!1,xy:o.xy(o.crossLength-1),dxy:o.dxy(o.crossLength-2,1),axis:o.axis,length:o.crossAxis.length,font:o.axis.tickfont,isFirst:0===r,isLast:r===l.length-1}),s.push(a))}},{"../../lib/extend":713,"../../plots/cartesian/axes":770}],902:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(i*i+a*a,.25),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,f=(c*c*a-l*l*s)*n,h=c*(l+c)*3,d=l*(l+c)*3;return[[e[0]+(h&&u/h),e[1]+(h&&f/h)],[e[0]-(d&&u/d),e[1]-(d&&f/d)]]}},{}],903:[function(t,e,r){"use strict";var n=t("../../lib").isArray;e.exports=function(t,e,r){var i,a,o,s,l,c,u=[],f=n(t)?t.length:t,h=n(e)?e.length:e,d=n(t)?t:null,p=n(e)?e:null;d&&(o=(d.length-1)/(d[d.length-1]-d[0])/(f-1)),p&&(s=(p.length-1)/(p[p.length-1]-p[0])/(h-1));var m=1/0,v=-1/0;for(a=0;a<h;a++)for(u[a]=[],l=p?(p[a]-p[0])*s:a/(h-1),i=0;i<f;i++)c=(d?(d[i]-d[0])*o:i/(f-1))-l*r,m=Math.min(c,m),v=Math.max(c,v),u[a][i]=c;var g=1/(v-m),y=-m*g;for(a=0;a<h;a++)for(i=0;i<f;i++)u[a][i]=g*u[a][i]+y;return u}},{"../../lib":724}],904:[function(t,e,r){"use strict";var n=t("./catmull_rom"),i=t("../../lib").ensureArray;function a(t,e,r){var n=-.5*r[0]+1.5*e[0],i=-.5*r[1]+1.5*e[1];return[(2*n+t[0])/3,(2*i+t[1])/3]}e.exports=function(t,e,r,o,s,l){var c,u,f,h,d,p,m,v,g,y,b=r[0].length,x=r.length,_=s?3*b-2:b,w=l?3*x-2:x;for(t=i(t,w),e=i(e,w),f=0;f<w;f++)t[f]=i(t[f],_),e[f]=i(e[f],_);for(u=0,h=0;u<x;u++,h+=l?3:1)for(d=t[h],p=e[h],m=r[u],v=o[u],c=0,f=0;c<b;c++,f+=s?3:1)d[f]=m[c],p[f]=v[c];if(s)for(u=0,h=0;u<x;u++,h+=l?3:1){for(c=1,f=3;c<b-1;c++,f+=3)g=n([r[u][c-1],o[u][c-1]],[r[u][c],o[u][c]],[r[u][c+1],o[u][c+1]],s),t[h][f-1]=g[0][0],e[h][f-1]=g[0][1],t[h][f+1]=g[1][0],e[h][f+1]=g[1][1];y=a([t[h][0],e[h][0]],[t[h][2],e[h][2]],[t[h][3],e[h][3]]),t[h][1]=y[0],e[h][1]=y[1],y=a([t[h][_-1],e[h][_-1]],[t[h][_-3],e[h][_-3]],[t[h][_-4],e[h][_-4]]),t[h][_-2]=y[0],e[h][_-2]=y[1]}if(l)for(f=0;f<_;f++){for(h=3;h<w-3;h+=3)g=n([t[h-3][f],e[h-3][f]],[t[h][f],e[h][f]],[t[h+3][f],e[h+3][f]],l),t[h-1][f]=g[0][0],e[h-1][f]=g[0][1],t[h+1][f]=g[1][0],e[h+1][f]=g[1][1];y=a([t[0][f],e[0][f]],[t[2][f],e[2][f]],[t[3][f],e[3][f]]),t[1][f]=y[0],e[1][f]=y[1],y=a([t[w-1][f],e[w-1][f]],[t[w-3][f],e[w-3][f]],[t[w-4][f],e[w-4][f]]),t[w-2][f]=y[0],e[w-2][f]=y[1]}if(s&&l)for(h=1;h<w;h+=(h+1)%3==0?2:1){for(f=3;f<_-3;f+=3)g=n([t[h][f-3],e[h][f-3]],[t[h][f],e[h][f]],[t[h][f+3],e[h][f+3]],s),t[h][f-1]=.5*(t[h][f-1]+g[0][0]),e[h][f-1]=.5*(e[h][f-1]+g[0][1]),t[h][f+1]=.5*(t[h][f+1]+g[1][0]),e[h][f+1]=.5*(e[h][f+1]+g[1][1]);y=a([t[h][0],e[h][0]],[t[h][2],e[h][2]],[t[h][3],e[h][3]]),t[h][1]=.5*(t[h][1]+y[0]),e[h][1]=.5*(e[h][1]+y[1]),y=a([t[h][_-1],e[h][_-1]],[t[h][_-3],e[h][_-3]],[t[h][_-4],e[h][_-4]]),t[h][_-2]=.5*(t[h][_-2]+y[0]),e[h][_-2]=.5*(e[h][_-2]+y[1])}return[t,e]}},{"../../lib":724,"./catmull_rom":902}],905:[function(t,e,r){"use strict";e.exports={RELATIVE_CULL_TOLERANCE:1e-6}},{}],906:[function(t,e,r){"use strict";e.exports=function(t,e,r){return e&&r?function(e,r,n,i,a){var o,s,l,c,u,f;e||(e=[]),r*=3,n*=3;var h=i*i,d=1-i,p=d*d,m=d*i*2,v=-3*p,g=3*(p-m),y=3*(m-h),b=3*h,x=a*a,_=x*a,w=1-a,M=w*w,k=M*w;for(f=0;f<t.length;f++)o=v*(u=t[f])[n][r]+g*u[n][r+1]+y*u[n][r+2]+b*u[n][r+3],s=v*u[n+1][r]+g*u[n+1][r+1]+y*u[n+1][r+2]+b*u[n+1][r+3],l=v*u[n+2][r]+g*u[n+2][r+1]+y*u[n+2][r+2]+b*u[n+2][r+3],c=v*u[n+3][r]+g*u[n+3][r+1]+y*u[n+3][r+2]+b*u[n+3][r+3],e[f]=k*o+3*(M*a*s+w*x*l)+_*c;return e}:e?function(e,r,n,i,a){var o,s,l,c;e||(e=[]),r*=3;var u=i*i,f=1-i,h=f*f,d=f*i*2,p=-3*h,m=3*(h-d),v=3*(d-u),g=3*u,y=1-a;for(l=0;l<t.length;l++)o=p*(c=t[l])[n][r]+m*c[n][r+1]+v*c[n][r+2]+g*c[n][r+3],s=p*c[n+1][r]+m*c[n+1][r+1]+v*c[n+1][r+2]+g*c[n+1][r+3],e[l]=y*o+a*s;return e}:r?function(e,r,n,i,a){var o,s,l,c,u,f;e||(e=[]),n*=3;var h=a*a,d=h*a,p=1-a,m=p*p,v=m*p;for(u=0;u<t.length;u++)o=(f=t[u])[n][r+1]-f[n][r],s=f[n+1][r+1]-f[n+1][r],l=f[n+2][r+1]-f[n+2][r],c=f[n+3][r+1]-f[n+3][r],e[u]=v*o+3*(m*a*s+p*h*l)+d*c;return e}:function(e,r,n,i,a){var o,s,l,c;e||(e=[]);var u=1-a;for(l=0;l<t.length;l++)o=(c=t[l])[n][r+1]-c[n][r],s=c[n+1][r+1]-c[n+1][r],e[l]=u*o+a*s;return e}}},{}],907:[function(t,e,r){"use strict";e.exports=function(t,e,r){return e&&r?function(e,r,n,i,a){var o,s,l,c,u,f;e||(e=[]),r*=3,n*=3;var h=i*i,d=h*i,p=1-i,m=p*p,v=m*p,g=a*a,y=1-a,b=y*y,x=y*a*2,_=-3*b,w=3*(b-x),M=3*(x-g),k=3*g;for(f=0;f<t.length;f++)o=_*(u=t[f])[n][r]+w*u[n+1][r]+M*u[n+2][r]+k*u[n+3][r],s=_*u[n][r+1]+w*u[n+1][r+1]+M*u[n+2][r+1]+k*u[n+3][r+1],l=_*u[n][r+2]+w*u[n+1][r+2]+M*u[n+2][r+2]+k*u[n+3][r+2],c=_*u[n][r+3]+w*u[n+1][r+3]+M*u[n+2][r+3]+k*u[n+3][r+3],e[f]=v*o+3*(m*i*s+p*h*l)+d*c;return e}:e?function(e,r,n,i,a){var o,s,l,c,u,f;e||(e=[]),r*=3;var h=a*a,d=h*a,p=1-a,m=p*p,v=m*p;for(u=0;u<t.length;u++)o=(f=t[u])[n+1][r]-f[n][r],s=f[n+1][r+1]-f[n][r+1],l=f[n+1][r+2]-f[n][r+2],c=f[n+1][r+3]-f[n][r+3],e[u]=v*o+3*(m*a*s+p*h*l)+d*c;return e}:r?function(e,r,n,i,a){var o,s,l,c;e||(e=[]),n*=3;var u=1-i,f=a*a,h=1-a,d=h*h,p=h*a*2,m=-3*d,v=3*(d-p),g=3*(p-f),y=3*f;for(l=0;l<t.length;l++)o=m*(c=t[l])[n][r]+v*c[n+1][r]+g*c[n+2][r]+y*c[n+3][r],s=m*c[n][r+1]+v*c[n+1][r+1]+g*c[n+2][r+1]+y*c[n+3][r+1],e[l]=u*o+i*s;return e}:function(e,r,n,i,a){var o,s,l,c;e||(e=[]);var u=1-i;for(l=0;l<t.length;l++)o=(c=t[l])[n+1][r]-c[n][r],s=c[n+1][r+1]-c[n][r+1],e[l]=u*o+i*s;return e}}},{}],908:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){var a=e-2,o=r-2;return n&&i?function(e,r,n){var i,s,l,c,u,f;e||(e=[]);var h=Math.max(0,Math.min(Math.floor(r),a)),d=Math.max(0,Math.min(Math.floor(n),o)),p=Math.max(0,Math.min(1,r-h)),m=Math.max(0,Math.min(1,n-d));h*=3,d*=3;var v=p*p,g=v*p,y=1-p,b=y*y,x=b*y,_=m*m,w=_*m,M=1-m,k=M*M,A=k*M;for(f=0;f<t.length;f++)i=x*(u=t[f])[d][h]+3*(b*p*u[d][h+1]+y*v*u[d][h+2])+g*u[d][h+3],s=x*u[d+1][h]+3*(b*p*u[d+1][h+1]+y*v*u[d+1][h+2])+g*u[d+1][h+3],l=x*u[d+2][h]+3*(b*p*u[d+2][h+1]+y*v*u[d+2][h+2])+g*u[d+2][h+3],c=x*u[d+3][h]+3*(b*p*u[d+3][h+1]+y*v*u[d+3][h+2])+g*u[d+3][h+3],e[f]=A*i+3*(k*m*s+M*_*l)+w*c;return e}:n?function(e,r,n){e||(e=[]);var i,s,l,c,u,f,h=Math.max(0,Math.min(Math.floor(r),a)),d=Math.max(0,Math.min(Math.floor(n),o)),p=Math.max(0,Math.min(1,r-h)),m=Math.max(0,Math.min(1,n-d));h*=3;var v=p*p,g=v*p,y=1-p,b=y*y,x=b*y,_=1-m;for(u=0;u<t.length;u++)i=_*(f=t[u])[d][h]+m*f[d+1][h],s=_*f[d][h+1]+m*f[d+1][h+1],l=_*f[d][h+2]+m*f[d+1][h+1],c=_*f[d][h+3]+m*f[d+1][h+1],e[u]=x*i+3*(b*p*s+y*v*l)+g*c;return e}:i?function(e,r,n){e||(e=[]);var i,s,l,c,u,f,h=Math.max(0,Math.min(Math.floor(r),a)),d=Math.max(0,Math.min(Math.floor(n),o)),p=Math.max(0,Math.min(1,r-h)),m=Math.max(0,Math.min(1,n-d));d*=3;var v=m*m,g=v*m,y=1-m,b=y*y,x=b*y,_=1-p;for(u=0;u<t.length;u++)i=_*(f=t[u])[d][h]+p*f[d][h+1],s=_*f[d+1][h]+p*f[d+1][h+1],l=_*f[d+2][h]+p*f[d+2][h+1],c=_*f[d+3][h]+p*f[d+3][h+1],e[u]=x*i+3*(b*m*s+y*v*l)+g*c;return e}:function(e,r,n){e||(e=[]);var i,s,l,c,u=Math.max(0,Math.min(Math.floor(r),a)),f=Math.max(0,Math.min(Math.floor(n),o)),h=Math.max(0,Math.min(1,r-u)),d=Math.max(0,Math.min(1,n-f)),p=1-d,m=1-h;for(l=0;l<t.length;l++)i=m*(c=t[l])[f][u]+h*c[f][u+1],s=m*c[f+1][u]+h*c[f+1][u+1],e[l]=p*i+d*s;return e}}},{}],909:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./xy_defaults"),a=t("./ab_defaults"),o=t("./set_convert"),s=t("./attributes"),l=t("../../components/color/attributes");e.exports=function(t,e,r,c){function u(r,i){return n.coerce(t,e,s,r,i)}e._clipPathId="clip"+e.uid+"carpet";var f=u("color",l.defaultLine);if(n.coerceFont(u,"font"),u("carpet"),a(t,e,c,u,f),e.a&&e.b){e.a.length<3&&(e.aaxis.smoothing=0),e.b.length<3&&(e.baxis.smoothing=0);var h=i(t,e,u);o(e),e._cheater&&u("cheaterslope"),h||(e.visible=!1)}else e.visible=!1}},{"../../components/color/attributes":597,"../../lib":724,"./ab_defaults":892,"./attributes":894,"./set_convert":918,"./xy_defaults":920}],910:[function(t,e,r){"use strict";e.exports=function(t){return Array.isArray(t[0])}},{}],911:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.plot=t("./plot"),n.calc=t("./calc"),n.animatable=!0,n.moduleType="trace",n.name="carpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","carpet","carpetAxis","notLegendIsolatable"],n.meta={},e.exports=n},{"../../plots/cartesian":781,"./attributes":894,"./calc":898,"./defaults":909,"./plot":917}],912:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r,n=t._fullData.length,i=0;i<n;i++){var a=t._fullData[i];if(a.index!==e.index&&("carpet"===a.type&&(r||(r=a),a.carpet===e.carpet)))return a}return r}},{}],913:[function(t,e,r){"use strict";e.exports=function(t,e,r){if(0===t.length)return"";var n,i=[],a=r?3:1;for(n=0;n<t.length;n+=a)i.push(t[n]+","+e[n]),r&&n<t.length-a&&(i.push("C"),i.push([t[n+1]+","+e[n+1],t[n+2]+","+e[n+2]+" "].join(" ")));return i.join(r?"":"L")}},{}],914:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n;for(Array.isArray(t)?t.length>e.length&&(t=t.slice(0,e.length)):t=[],n=0;n<e.length;n++)t[n]=r(e[n]);return t}},{}],915:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n,i;for(Array.isArray(t)?t.length>e.length&&(t=t.slice(0,e.length)):t=[],n=0;n<e.length;n++)for(Array.isArray(t[n])?t[n].length>e.length&&(t[n]=t[n].slice(0,e.length)):t[n]=[],i=0;i<e[0].length;i++)t[n][i]=r(e[n][i]);return t}},{}],916:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a){var o=i[0]*t.dpdx(e),s=i[1]*t.dpdy(r),l=1,c=1;if(a){var u=Math.sqrt(i[0]*i[0]+i[1]*i[1]),f=Math.sqrt(a[0]*a[0]+a[1]*a[1]),h=(i[0]*a[0]+i[1]*a[1])/u/f;c=Math.max(0,h)}var d=180*Math.atan2(s,o)/Math.PI;return d<-90?(d+=180,l=-l):d>90&&(d-=180,l=-l),{angle:d,flip:l,p:t.c2p(n,e,r),offsetMultplier:c}}},{}],917:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/drawing"),a=t("./map_1d_array"),o=t("./makepath"),s=t("./orient_text"),l=t("../../lib/svg_text_utils"),c=t("../../lib"),u=t("../../constants/alignment");function f(t,e,r){var n=t.selectAll(e+"."+r).data([0]);return n.enter().append(e).classed(r,!0),n}function h(t,e,r){var n=r[0],i=r[0].trace,l=e.xaxis,u=e.yaxis,h=i.aaxis,m=i.baxis,v=t._fullLayout,y=e.plot.selectAll(".carpetlayer"),b=v._clips,x=f(y,"g","carpet"+i.uid).classed("trace",!0),_=f(x,"g","minorlayer"),w=f(x,"g","majorlayer"),M=f(x,"g","boundarylayer"),k=f(x,"g","labellayer");x.style("opacity",i.opacity),d(l,u,w,h,"a",h._gridlines),d(l,u,w,m,"b",m._gridlines),d(l,u,_,h,"a",h._minorgridlines),d(l,u,_,m,"b",m._minorgridlines),d(l,u,M,h,"a-boundary",h._boundarylines),d(l,u,M,m,"b-boundary",m._boundarylines),function(t,e,r,n,i,a,o,l){var u,f,h,d;u=.5*(r.a[0]+r.a[r.a.length-1]),f=r.b[0],h=r.ab2xy(u,f,!0),d=r.dxyda_rough(u,f),void 0===o.angle&&c.extendFlat(o,s(r,i,a,h,r.dxydb_rough(u,f)));g(t,e,r,n,h,d,r.aaxis,i,a,o,"a-title"),u=r.a[0],f=.5*(r.b[0]+r.b[r.b.length-1]),h=r.ab2xy(u,f,!0),d=r.dxydb_rough(u,f),void 0===l.angle&&c.extendFlat(l,s(r,i,a,h,r.dxyda_rough(u,f)));g(t,e,r,n,h,d,r.baxis,i,a,l,"b-title")}(t,k,i,n,l,u,p(t,l,u,i,n,k,h._labels,"a-label"),p(t,l,u,i,n,k,m._labels,"b-label")),function(t,e,r,n,i){var s,l,c,u,h=r.select("#"+t._clipPathId);h.size()||(h=r.append("clipPath").classed("carpetclip",!0));var d=f(h,"path","carpetboundary"),p=e.clipsegments,m=[];for(u=0;u<p.length;u++)s=p[u],l=a([],s.x,n.c2p),c=a([],s.y,i.c2p),m.push(o(l,c,s.bicubic));var v="M"+m.join("L")+"Z";h.attr("id",t._clipPathId),d.attr("d",v)}(i,n,b,l,u)}function d(t,e,r,i,s,l){var c="const-"+s+"-lines",u=r.selectAll("."+c).data(l);u.enter().append("path").classed(c,!0).style("vector-effect","non-scaling-stroke"),u.each(function(r){var i=r,s=i.x,l=i.y,c=a([],s,t.c2p),u=a([],l,e.c2p),f="M"+o(c,u,i.smoothing);n.select(this).attr("d",f).style("stroke-width",i.width).style("stroke",i.color).style("fill","none")}),u.exit().remove()}function p(t,e,r,a,o,c,u,f){var h=c.selectAll("text."+f).data(u);h.enter().append("text").classed(f,!0);var d=0,p={};return h.each(function(o,c){var u;if("auto"===o.axis.tickangle)u=s(a,e,r,o.xy,o.dxy);else{var f=(o.axis.tickangle+180)*Math.PI/180;u=s(a,e,r,o.xy,[Math.cos(f),Math.sin(f)])}c||(p={angle:u.angle,flip:u.flip});var h=(o.endAnchor?-1:1)*u.flip,m=n.select(this).attr({"text-anchor":h>0?"start":"end","data-notex":1}).call(i.font,o.font).text(o.text).call(l.convertToTspans,t),v=i.bBox(this);m.attr("transform","translate("+u.p[0]+","+u.p[1]+") rotate("+u.angle+")translate("+o.axis.labelpadding*h+","+.3*v.height+")"),d=Math.max(d,v.width+o.axis.labelpadding)}),h.exit().remove(),p.maxExtent=d,p}e.exports=function(t,e,r){for(var n=0;n<r.length;n++)h(t,e,r[n])};var m=u.LINE_SPACING,v=(1-u.MID_SHIFT)/m+1;function g(t,e,r,a,o,c,u,f,h,d,p){var g=[];u.title&&g.push(u.title);var y=e.selectAll("text."+p).data(g),b=d.maxExtent;y.enter().append("text").classed(p,!0),y.each(function(){var e=s(r,f,h,o,c);-1===["start","both"].indexOf(u.showticklabels)&&(b=0);var a=u.titlefont.size;b+=a+u.titleoffset;var p=(d.angle+(d.flip<0?180:0)-e.angle+450)%360,g=p>90&&p<270,y=n.select(this);y.text(u.title||"").call(l.convertToTspans,t),g&&(b=(-l.lineCount(y)+v)*m*a-b),y.attr("transform","translate("+e.p[0]+","+e.p[1]+") rotate("+e.angle+") translate(0,"+b+")").classed("user-select-none",!0).attr("text-anchor","middle").call(i.font,u.titlefont)}),y.exit().remove()}},{"../../components/drawing":623,"../../constants/alignment":696,"../../lib":724,"../../lib/svg_text_utils":747,"./makepath":913,"./map_1d_array":914,"./orient_text":916,d3:128}],918:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../lib/search").findBin,a=t("./compute_control_points"),o=t("./create_spline_evaluator"),s=t("./create_i_derivative_evaluator"),l=t("./create_j_derivative_evaluator");e.exports=function(t){var e=t.a,r=t.b,c=t.a.length,u=t.b.length,f=t.aaxis,h=t.baxis,d=e[0],p=e[c-1],m=r[0],v=r[u-1],g=e[e.length-1]-e[0],y=r[r.length-1]-r[0],b=g*n.RELATIVE_CULL_TOLERANCE,x=y*n.RELATIVE_CULL_TOLERANCE;d-=b,p+=b,m-=x,v+=x,t.isVisible=function(t,e){return t>d&&t<p&&e>m&&e<v},t.isOccluded=function(t,e){return t<d||t>p||e<m||e>v},f.c2p=function(t){return t},h.c2p=function(t){return t},t.setScale=function(){var e=t._x,r=t._y,n=a(t.xctrl,t.yctrl,e,r,f.smoothing,h.smoothing);t.xctrl=n[0],t.yctrl=n[1],t.evalxy=o([t.xctrl,t.yctrl],c,u,f.smoothing,h.smoothing),t.dxydi=s([t.xctrl,t.yctrl],f.smoothing,h.smoothing),t.dxydj=l([t.xctrl,t.yctrl],f.smoothing,h.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),c-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),c-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(i(t,e),c-2)),n=e[r],a=e[r+1];return Math.max(0,Math.min(c-1,r+(t-n)/(a-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(i(t,r),u-2)),n=r[e],a=r[e+1];return Math.max(0,Math.min(u-1,e+(t-n)/(a-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,i,a){if(!a&&(n<e[0]||n>e[c-1]|i<r[0]||i>r[u-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(i),l=t.evalxy([],o,s);if(a){var f,h,d,p,m=0,v=0,g=[];n<e[0]?(f=0,h=0,m=(n-e[0])/(e[1]-e[0])):n>e[c-1]?(f=c-2,h=1,m=(n-e[c-1])/(e[c-1]-e[c-2])):h=o-(f=Math.max(0,Math.min(c-2,Math.floor(o)))),i<r[0]?(d=0,p=0,v=(i-r[0])/(r[1]-r[0])):i>r[u-1]?(d=u-2,p=1,v=(i-r[u-1])/(r[u-1]-r[u-2])):p=s-(d=Math.max(0,Math.min(u-2,Math.floor(s)))),m&&(t.dxydi(g,f,d,h,p),l[0]+=g[0]*m,l[1]+=g[1]*m),v&&(t.dxydj(g,f,d,h,p),l[0]+=g[0]*v,l[1]+=g[1]*v)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=g*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{"../../lib/search":742,"./compute_control_points":904,"./constants":905,"./create_i_derivative_evaluator":906,"./create_j_derivative_evaluator":907,"./create_spline_evaluator":908}],919:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var i,a,o,s=[],l=[],c=t[0].length,u=t.length;function f(e,r){var n,i=0,a=0;return e>0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e<c-1&&void 0!==(n=t[r][e+1])&&(a++,i+=n),r>0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r<u-1&&void 0!==(n=t[r+1][e])&&(a++,i+=n),i/Math.max(1,a)}var h,d,p,m,v,g,y,b,x,_,w,M=0;for(i=0;i<c;i++)for(a=0;a<u;a++)void 0===t[a][i]&&(s.push(i),l.push(a),t[a][i]=f(i,a)),M=Math.max(M,Math.abs(t[a][i]));if(!s.length)return t;var k=0,A=0,T=s.length;do{for(k=0,o=0;o<T;o++){i=s[o],a=l[o];var E,S,L,C,P,z,O=0,D=0;0===i?(L=e[P=Math.min(c-1,2)],C=e[1],E=t[a][P],D+=(S=t[a][1])+(S-E)*(e[0]-C)/(C-L),O++):i===c-1&&(L=e[P=Math.max(0,c-3)],C=e[c-2],E=t[a][P],D+=(S=t[a][c-2])+(S-E)*(e[c-1]-C)/(C-L),O++),(0===i||i===c-1)&&a>0&&a<u-1&&(h=r[a+1]-r[a],D+=((d=r[a]-r[a-1])*t[a+1][i]+h*t[a-1][i])/(d+h),O++),0===a?(L=r[z=Math.min(u-1,2)],C=r[1],E=t[z][i],D+=(S=t[1][i])+(S-E)*(r[0]-C)/(C-L),O++):a===u-1&&(L=r[z=Math.max(0,u-3)],C=r[u-2],E=t[z][i],D+=(S=t[u-2][i])+(S-E)*(r[u-1]-C)/(C-L),O++),(0===a||a===u-1)&&i>0&&i<c-1&&(h=e[i+1]-e[i],D+=((d=e[i]-e[i-1])*t[a][i+1]+h*t[a][i-1])/(d+h),O++),O?D/=O:(p=e[i+1]-e[i],m=e[i]-e[i-1],b=(v=r[a+1]-r[a])*(g=r[a]-r[a-1])*(v+g),D=((y=p*m*(p+m))*(g*t[a+1][i]+v*t[a-1][i])+b*(m*t[a][i+1]+p*t[a][i-1]))/(b*(m+p)+y*(g+v))),k+=(_=(x=D-t[a][i])/M)*_,w=O?0:.85,t[a][i]+=x*(1+w)}k=Math.sqrt(k)}while(A++<100&&k>1e-5);return n.log("Smoother converged to",k,"after",A,"iterations"),t}},{"../../lib":724}],920:[function(t,e,r){"use strict";var n=t("./has_columns"),i=t("../heatmap/convert_column_xyz");e.exports=function(t,e,r){var a=[],o=r("x");o&&!n(o)&&a.push("x"),e._cheater=!o;var s=r("y");if(s&&!n(s)&&a.push("y"),o||s)return a.length&&i(e,e.aaxis,e.baxis,"a","b",a),!0}},{"../heatmap/convert_column_xyz":963,"./has_columns":910}],921:[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"),l=s.extendFlat,c=s.extendDeepAll,u=n.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:n.locationmode,z:{valType:"data_array",editType:"calc"},text:l({},n.text,{}),marker:{line:{color:u.color,width:l({},u.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:n.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:n.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]})},c({},i,{zmax:{editType:"calc"},zmin:{editType:"calc"}}),{colorbar:a})},{"../../components/colorbar/attributes":599,"../../components/colorscale/attributes":604,"../../lib/extend":713,"../../plots/attributes":768,"../scattergeo/attributes":1086}],922:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");e.exports=function(t,e){for(var r=e.locations.length,l=new Array(r),c=0;c<r;c++){var u=l[c]={},f=e.locations[c],h=e.z[c];u.loc="string"==typeof f?f:null,u.z=n(h)?h:i}return o(l,e),a(e,e.z,"","z"),s(l,e),l}},{"../../components/colorscale/calc":605,"../../constants/numerical":702,"../scatter/arrays_to_calcdata":1047,"../scatter/calc_selection":1050,"fast-isnumeric":140}],923:[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,c=s("locations");if(c&&(l=c.length),c&&l){var u=s("z");Array.isArray(u)?(u.length>l&&(e.z=u.slice(0,l)),s("locationmode"),s("text"),s("marker.line.color"),s("marker.line.width"),s("marker.opacity"),i(t,e,o,s,{prefix:"",cLetter:"z"}),n.coerceSelectionMarkerOpacity(e,s)):e.visible=!1}else e.visible=!1}},{"../../components/colorscale/defaults":608,"../../lib":724,"./attributes":921}],924:[function(t,e,r){"use strict";e.exports=function(t,e){return t.location=e.location,t.z=e.z,t}},{}],925:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("./attributes"),a=t("../scatter/fill_hover_text");e.exports=function(t,e,r){var o,s,l,c,u=t.cd,f=u[0].trace,h=t.subplot;for(s=0;s<u.length;s++)if(c=!1,(o=u[s])._polygons){for(l=0;l<o._polygons.length;l++)o._polygons[l].contains([e,r])&&(c=!c),o._polygons[l].contains([e+360,r])&&(c=!c);if(c)break}if(c&&o)return t.x0=t.x1=t.xa.c2p(o.ct),t.y0=t.y1=t.ya.c2p(o.ct),t.index=o.index,t.location=o.loc,t.z=o.z,function(t,e,r,o){var s=r.hi||e.hoverinfo,l="all"===s?i.hoverinfo.flags:s.split("+"),c=-1!==l.indexOf("name"),u=-1!==l.indexOf("location"),f=-1!==l.indexOf("z"),h=-1!==l.indexOf("text"),d=[];!c&&u?t.nameOverride=r.loc:(c&&(t.nameOverride=e.name),u&&d.push(r.loc));f&&d.push((p=r.z,n.tickText(o,o.c2l(p),"hover").text));var p;h&&a(r,e,d);t.extraText=d.join("<br>")}(t,f,o,h.mockAxis),[t]}},{"../../plots/cartesian/axes":770,"../scatter/fill_hover_text":1056,"./attributes":921}],926:[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"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="choropleth",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","noOpacity"],n.meta={},e.exports=n},{"../../plots/geo":801,"../heatmap/colorbar":962,"./attributes":921,"./calc":922,"./defaults":923,"./event_data":924,"./hover":925,"./plot":927,"./select":928,"./style":929}],927:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../lib/polygon"),o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../lib/geo_location_utils").locationToFeature,l=t("./style");function c(t,e){for(var r=t[0].trace,n=t.length,i=o(r,e),a=0;a<n;a++){var l=t[a],c=s(r.locationmode,l.loc,i);c?(l.geojson=c,l.ct=c.properties.ct,l.index=a,l._polygons=u(c)):l.geojson=null}}function u(t){var e,r,n,i,o=t.geometry,s=o.coordinates,l=t.id,c=[];function u(t){for(var e=0;e<t.length-1;e++)if(t[e][0]>0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===l||"FJI"===l?function(t){var e;if(null===u(t))e=t;else for(e=new Array(t.length),i=0;i<t.length;i++)e[i]=[t[i][0]<0?t[i][0]+360:t[i][0],t[i][1]];c.push(a.tester(e))}:"ATA"===l?function(t){var e=u(t);if(null===e)return c.push(a.tester(t));var r=new Array(t.length+1),n=0;for(i=0;i<t.length;i++)i>e?r[n++]=[t[i][0]+360,t[i][1]]:i===e?(r[n++]=t[i],r[n++]=[t[i][0],-90]):r[n++]=t[i];var o=a.tester(r);o.pts.pop(),c.push(o)}:function(t){c.push(a.tester(t))},o.type){case"MultiPolygon":for(r=0;r<s.length;r++)for(n=0;n<s[r].length;n++)e(s[r][n]);break;case"Polygon":for(r=0;r<s.length;r++)e(s[r])}return c}e.exports=function(t,e,r){for(var a=0;a<r.length;a++)c(r[a],e.topojson);var o=e.layers.backplot.select(".choroplethlayer").selectAll("g.trace.choropleth").data(r,function(t){return t[0].trace.uid});o.enter().append("g").attr("class","trace choropleth"),o.exit().remove(),o.each(function(e){var r=(e[0].node3=n.select(this)).selectAll("path.choroplethlocation").data(i.identity);r.enter().append("path").classed("choroplethlocation",!0),r.exit().remove(),l(t,e)})}},{"../../lib":724,"../../lib/geo_location_utils":716,"../../lib/polygon":736,"../../lib/topojson_utils":750,"./style":929,d3:128}],928:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[];if(!1===e)for(r=0;r<s.length;r++)s[r].selected=0;else for(r=0;r<s.length;r++)(i=(n=s[r]).ct)&&(a=l.c2p(i),o=c.c2p(i),e.contains([a,o])?(u.push({pointNumber:r,lon:i[0],lat:i[1]}),n.selected=1):n.selected=0);return u}},{}],929:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/color"),a=t("../../components/drawing"),o=t("../../components/colorscale");e.exports=function(t,e){e&&function(t,e){var r=e[0].trace,s=e[0].node3.selectAll(".choroplethlocation"),l=r.marker||{},c=l.line||{},u=o.makeColorScaleFunc(o.extractScale(r.colorscale,r.zmin,r.zmax));s.each(function(t){n.select(this).attr("fill",u(t.z)).call(i.stroke,t.mlc||c.color).call(a.dashLine,"",t.mlw||c.width||0).style("opacity",l.opacity)}),a.selectedPointStyle(s,r)}(0,e)}},{"../../components/color":598,"../../components/colorscale":613,"../../components/drawing":623,d3:128}],930:[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("../../components/drawing/attributes").dash,l=t("../../plots/font_attributes"),c=t("../../lib/extend").extendFlat,u=t("../../constants/filter_ops"),f=u.COMPARISON_OPS2,h=u.INTERVAL_OPS,d=i.line;e.exports=c({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,zhoverformat:n.zhoverformat,connectgaps:n.connectgaps,fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:l({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot"},operation:{valType:"enumerated",values:[].concat(f).concat(h),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:c({},d.color,{editType:"style+colorbars"}),width:c({},d.width,{editType:"style+colorbars"}),dash:s,smoothing:c({},d.smoothing,{}),editType:"plot"}},a,{autocolorscale:c({},a.autocolorscale,{dflt:!1}),zmin:c({},a.zmin,{editType:"calc"}),zmax:c({},a.zmax,{editType:"calc"})},{colorbar:o})},{"../../components/colorbar/attributes":599,"../../components/colorscale/attributes":604,"../../components/drawing/attributes":622,"../../constants/filter_ops":697,"../../lib/extend":713,"../../plots/font_attributes":797,"../heatmap/attributes":959,"../scatter/attributes":1048}],931:[function(t,e,r){"use strict";var n=t("../heatmap/calc"),i=t("./set_contours");e.exports=function(t,e){var r=n(t,e);return i(e),r}},{"../heatmap/calc":960,"./set_contours":949}],932:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i,a,o,s=t[0],l=s.x.length,c=s.y.length,u=s.z,f=n.contours,h=-1/0,d=1/0;for(i=0;i<c;i++)d=Math.min(d,u[i][0]),d=Math.min(d,u[i][l-1]),h=Math.max(h,u[i][0]),h=Math.max(h,u[i][l-1]);for(i=1;i<l-1;i++)d=Math.min(d,u[0][i]),d=Math.min(d,u[c-1][i]),h=Math.max(h,u[0][i]),h=Math.max(h,u[c-1][i]);switch(s.prefixBoundary=!1,e){case">":f.value>h&&(s.prefixBoundary=!0);break;case"<":f.value<d&&(s.prefixBoundary=!0);break;case"[]":a=Math.min.apply(null,f.value),((o=Math.max.apply(null,f.value))<d||a>h)&&(s.prefixBoundary=!0);break;case"][":a=Math.min.apply(null,f.value),o=Math.max.apply(null,f.value),a<d&&o>h&&(s.prefixBoundary=!0)}}},{}],933:[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){var l=i(t,s);e[0].t.cb=l;var c=r.contours,u=r.line,f=c.size||1,h=c.coloring,d=a(r,{isColorbar:!0});"heatmap"===h&&l.filllevels({start:r.zmin,end:r.zmax,size:(r.zmax-r.zmin)/254}),l.fillcolor("fill"===h||"heatmap"===h?d:"").line({color:"lines"===h?d:u.color,width:!1!==c.showlines?u.width:0,dash:u.dash}).levels({start:c.start,end:o(c),size:f}).options(r.colorbar)()}else n.autoMargin(t,s)}},{"../../components/colorbar/draw":602,"../../plots/plots":833,"./end_plus":941,"./make_color_map":946}],934:[function(t,e,r){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],935:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./label_defaults"),a=t("../../components/color"),o=a.addOpacity,s=a.opacity,l=t("../../constants/filter_ops"),c=l.CONSTRAINT_REDUCTION,u=l.COMPARISON_OPS2;e.exports=function(t,e,r,a,l,f){var h,d,p,m=e.contours,v=r("contours.operation");(m._operation=c[v],function(t,e){var r;-1===u.indexOf(e.operation)?(t("contours.value",[0,1]),Array.isArray(e.value)?e.value.length>2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:n(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),n(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0))}(r,m),"="===v?h=m.showlines=!0:(h=r("contours.showlines"),p=r("fillcolor",o((t.line||{}).color||l,.5))),h)&&(d=r("line.color",p&&s(p)?o(e.fillcolor,1):l),r("line.width",2),r("line.dash"));r("line.smoothing"),i(r,a,d,f)}},{"../../components/color":598,"../../constants/filter_ops":697,"./label_defaults":945,"fast-isnumeric":140}],936:[function(t,e,r){"use strict";var n=t("../../constants/filter_ops"),i=t("fast-isnumeric");function a(t,e){var r,a=Array.isArray(e);function o(t){return i(t)?+t:null}return-1!==n.COMPARISON_OPS2.indexOf(t)?r=o(a?e[0]:e):-1!==n.INTERVAL_OPS.indexOf(t)?r=a?[o(e[0]),o(e[1])]:[o(e),o(e)]:-1!==n.SET_OPS.indexOf(t)&&(r=a?e.map(o):[o(e)]),r}function o(t){return function(e){e=a(t,e);var r=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return{start:r,end:n,size:n-r}}}function s(t){return function(e){return{start:e=a(t,e),end:1/0,size:1/0}}}e.exports={"[]":o("[]"),"][":o("]["),">":s(">"),"<":s("<"),"=":s("=")}},{"../../constants/filter_ops":697,"fast-isnumeric":140}],937:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=n("contours.start"),a=n("contours.end"),o=!1===i||!1===a,s=r("contours.size");!(o?e.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}},{}],938:[function(t,e,r){"use strict";var n=t("../../lib");function i(t){return n.extendFlat({},t,{edgepaths:n.extendDeep([],t.edgepaths),paths:n.extendDeep([],t.paths)})}e.exports=function(t,e){var r,a,o,s=function(t){return t.reverse()},l=function(t){return t};switch(e){case"=":case"<":return t;case">":for(1!==t.length&&n.warn("Contour data invalid for the specified inequality operation."),a=t[0],r=0;r<a.edgepaths.length;r++)a.edgepaths[r]=s(a.edgepaths[r]);for(r=0;r<a.paths.length;r++)a.paths[r]=s(a.paths[r]);return t;case"][":var c=s;s=l,l=c;case"[]":for(2!==t.length&&n.warn("Contour data invalid for the specified inequality range operation."),a=i(t[0]),o=i(t[1]),r=0;r<a.edgepaths.length;r++)a.edgepaths[r]=s(a.edgepaths[r]);for(r=0;r<a.paths.length;r++)a.paths[r]=s(a.paths[r]);for(;o.edgepaths.length;)a.edgepaths.push(l(o.edgepaths.shift()));for(;o.paths.length;)a.paths.push(l(o.paths.shift()));return[a]}}},{"../../lib":724}],939:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/has_columns"),a=t("../heatmap/xyz_defaults"),o=t("./constraint_defaults"),s=t("./contours_defaults"),l=t("./style_defaults"),c=t("./attributes");e.exports=function(t,e,r,u){function f(r,i){return n.coerce(t,e,c,r,i)}if(a(t,e,f,u)){f("text");var h="constraint"===f("contours.type");f("connectgaps",i(e)),h||delete e.showlegend,h?o(t,e,f,u,r):(s(t,e,f,function(r){return n.coerce2(t,e,c,r)}),l(t,e,f,u))}else e.visible=!1}},{"../../lib":724,"../heatmap/has_columns":966,"../heatmap/xyz_defaults":975,"./attributes":930,"./constraint_defaults":935,"./contours_defaults":937,"./style_defaults":951}],940:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./constraint_mapping"),a=t("./end_plus");e.exports=function(t,e,r){for(var o="constraint"===t.type?i[t._operation](t.value):t,s=o.size,l=[],c=a(o),u=r.trace.carpetTrace,f=u?{xaxis:u.aaxis,yaxis:u.baxis,x:r.a,y:r.b}:{xaxis:e.xaxis,yaxis:e.yaxis,x:r.x,y:r.y},h=o.start;h<c;h+=s)if(l.push(n.extendFlat({level:h,crossings:{},starts:[],edgepaths:[],paths:[],z:r.z,smoothing:r.trace.line.smoothing},f)),l.length>1e3){n.warn("Too many contours, clipping at 1000",t);break}return l}},{"../../lib":724,"./constraint_mapping":936,"./end_plus":941}],941:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],942:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./constants");function a(t,e,r,n){return Math.abs(t[0]-e[0])<r&&Math.abs(t[1]-e[1])<n}function o(t,e,r,o,l){var c,u=e.join(","),f=u,h=t.crossings[f],d=function(t,e,r){var n=0,a=0;t>20&&e?208===t||1114===t?n=0===r[0]?1:-1:a=0===r[1]?1:-1:-1!==i.BOTTOMSTART.indexOf(t)?a=1:-1!==i.LEFTSTART.indexOf(t)?n=1:-1!==i.TOPSTART.indexOf(t)?a=-1:n=-1;return[n,a]}(h,r,e),p=[s(t,e,[-d[0],-d[1]])],m=d.join(","),v=t.z.length,g=t.z[0].length;for(c=0;c<1e4;c++){if(h>20?(h=i.CHOOSESADDLE[h][(d[0]||d[1])<0?0:1],t.crossings[f]=i.SADDLEREMAINDER[h]):delete t.crossings[f],!(d=i.NEWDELTA[h])){n.log("Found bad marching index:",h,e,t.level);break}p.push(s(t,e,d)),e[0]+=d[0],e[1]+=d[1],a(p[p.length-1],p[p.length-2],o,l)&&p.pop(),f=e.join(",");var y=d[0]&&(e[0]<0||e[0]>g-2)||d[1]&&(e[1]<0||e[1]>v-2);if(f===u&&d.join(",")===m||r&&y)break;h=t.crossings[f]}1e4===c&&n.log("Infinite loop in contour?");var b,x,_,w,M,k,A,T,E,S,L,C,P,z,O,D=a(p[0],p[p.length-1],o,l),I=0,R=.2*t.smoothing,N=[],F=0;for(c=1;c<p.length;c++)C=p[c],P=p[c-1],void 0,void 0,z=C[2]-P[2],O=C[3]-P[3],I+=A=Math.sqrt(z*z+O*O),N.push(A);var j=I/N.length*R;function B(t){return p[t%p.length]}for(c=p.length-2;c>=F;c--)if((b=N[c])<j){for(_=0,x=c-1;x>=F&&b+N[x]<j;x--)b+=N[x];if(D&&c===p.length-2)for(_=0;_<x&&b+N[_]<j;_++)b+=N[_];M=c-x+_+1,k=Math.floor((c+x+_+2)/2),w=D||c!==p.length-2?D||-1!==x?M%2?B(k):[(B(k)[0]+B(k+1)[0])/2,(B(k)[1]+B(k+1)[1])/2]:p[0]:p[p.length-1],p.splice(x+1,c-x+1,w),c=x+1,_&&(F=_),D&&(c===p.length-2?p[_]=p[p.length-1]:0===c&&(p[p.length-1]=p[0]))}for(p.splice(0,F),c=0;c<p.length;c++)p[c].length=2;if(!(p.length<2))if(D)p.pop(),t.paths.push(p);else{r||n.log("Unclosed interior contour?",t.level,u,p.join("L"));var U=!1;for(T=0;T<t.edgepaths.length;T++)if(S=t.edgepaths[T],!U&&a(S[0],p[p.length-1],o,l)){p.pop(),U=!0;var V=!1;for(E=0;E<t.edgepaths.length;E++)if(a((L=t.edgepaths[E])[L.length-1],p[0],o,l)){V=!0,p.shift(),t.edgepaths.splice(T,1),E===T?t.paths.push(p.concat(L)):(E>T&&E--,t.edgepaths[E]=L.concat(p,S));break}V||(t.edgepaths[T]=p.concat(S))}for(T=0;T<t.edgepaths.length&&!U;T++)a((S=t.edgepaths[T])[S.length-1],p[0],o,l)&&(p.shift(),t.edgepaths[T]=S.concat(p),U=!0);U||t.edgepaths.push(p)}}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),n+l,i]}var c=(t.level-a)/(t.z[i+1][n]-a);return[o.c2p(t.x[n],!0),s.c2p((1-c)*t.y[i]+c*t.y[i+1],!0),n,i+c]}e.exports=function(t,e,r){var i,a,s,l;for(e=e||.01,r=r||.01,a=0;a<t.length;a++){for(s=t[a],l=0;l<s.starts.length;l++)o(s,s.starts[l],"edge",e,r);for(i=0;Object.keys(s.crossings).length&&i<1e4;)i++,o(s,Object.keys(s.crossings)[0].split(",").map(Number),void 0,e,r);1e4===i&&n.log("Infinite loop in contour?")}}},{"../../lib":724,"./constants":934}],943:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../heatmap/hover");e.exports=function(t,e,r,a,o){var s=i(t,e,r,a,o,!0);return s&&s.forEach(function(t){var e=t.trace;"constraint"===e.contours.type&&(e.fillcolor&&n.opacity(e.fillcolor)?t.color=n.addOpacity(e.fillcolor,1):e.contours.showlines&&n.opacity(e.line.color)&&(t.color=n.addOpacity(e.line.color,1)))}),s}},{"../../components/color":598,"../heatmap/hover":967}],944:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot").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","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":781,"./attributes":930,"./calc":931,"./colorbar":933,"./defaults":939,"./hover":943,"./plot":948,"./style":950}],945:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,i){if(i||(i={}),t("contours.showlabels")){var a=e.font;n.coerceFont(t,"contours.labelfont",{family:a.family,size:a.size,color:r}),t("contours.labelformat")}!1!==i.hasHover&&t("zhoverformat")}},{"../../lib":724}],946:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/colorscale"),a=t("./end_plus");e.exports=function(t){var e=t.contours,r=e.start,o=a(e),s=e.size||1,l=Math.floor((o-r)/s)+1,c="lines"===e.coloring?0:1;isFinite(s)||(s=1,l=1);var u,f,h=t.colorscale,d=h.length,p=new Array(d),m=new Array(d);if("heatmap"===e.coloring){for(t.zauto&&!1===t.autocontour&&(t.zmin=r-s/2,t.zmax=t.zmin+l*s),f=0;f<d;f++)u=h[f],p[f]=u[0]*(t.zmax-t.zmin)+t.zmin,m[f]=u[1];var v=n.extent([t.zmin,t.zmax,e.start,e.start+s*(l-1)]),g=v[t.zmin<t.zmax?0:1],y=v[t.zmin<t.zmax?1:0];g!==t.zmin&&(p.splice(0,0,g),m.splice(0,0,Range[0])),y!==t.zmax&&(p.push(y),m.push(m[m.length-1]))}else for(f=0;f<d;f++)u=h[f],p[f]=(u[0]*(l+c-1)-c/2)*s+r,m[f]=u[1];return i.makeColorScaleFunc({domain:p,range:m},{noNumericCheck:!0})}},{"../../components/colorscale":613,"./end_plus":941,d3:128}],947:[function(t,e,r){"use strict";var n=t("./constants");function i(t,e){var r=(e[0][0]>t?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);return 5===r||10===r?t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}e.exports=function(t){var e,r,a,o,s,l,c,u,f,h=t[0].z,d=h.length,p=h[0].length,m=2===d||2===p;for(r=0;r<d-1;r++)for(o=[],0===r&&(o=o.concat(n.BOTTOMSTART)),r===d-2&&(o=o.concat(n.TOPSTART)),e=0;e<p-1;e++)for(a=o.slice(),0===e&&(a=a.concat(n.LEFTSTART)),e===p-2&&(a=a.concat(n.RIGHTSTART)),s=e+","+r,l=[[h[r][e],h[r][e+1]],[h[r+1][e],h[r+1][e+1]]],f=0;f<t.length;f++)(c=i((u=t[f]).level,l))&&(u.crossings[s]=c,-1!==a.indexOf(c)&&(u.starts.push([e,r]),m&&-1!==a.indexOf(c,a.indexOf(c)+1)&&u.starts.push([e,r])))}},{"./constants":934}],948:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../../lib/svg_text_utils"),s=t("../../plots/cartesian/axes"),l=t("../../plots/cartesian/set_convert"),c=t("../heatmap/plot"),u=t("./make_crossings"),f=t("./find_all_paths"),h=t("./empty_pathinfo"),d=t("./convert_to_constraints"),p=t("./close_boundaries"),m=t("./constants"),v=m.LABELOPTIMIZER;function g(t,e,o){var s=o[0].trace,l=o[0].x,v=o[0].y,g=s.contours,b=s.uid,x=e.xaxis,_=e.yaxis,w=t._fullLayout,M="contour"+b,k=h(g,e,o[0]);if(!0!==s.visible)return w._paper.selectAll("."+M+",.hm"+b).remove(),void w._infolayer.selectAll(".cb"+b).remove();"heatmap"===g.coloring?(s.zauto&&!1===s.autocontour&&(s._input.zmin=s.zmin=g.start-g.size/2,s._input.zmax=s.zmax=s.zmin+k.length*g.size),c(t,e,[o])):(w._paper.selectAll(".hm"+b).remove(),w._infolayer.selectAll("g.rangeslider-container").selectAll(".hm"+b).remove()),u(k),f(k);var A=x.c2p(l[0],!0),T=x.c2p(l[l.length-1],!0),E=_.c2p(v[0],!0),S=_.c2p(v[v.length-1],!0),L=[[A,S],[T,S],[T,E],[A,E]],C=k;"constraint"===g.type&&(C=d(k,g._operation),p(C,g._operation,L,s));var P=r.makeContourGroup(e,o,M);!function(t,e,r){var n=t.selectAll("g.contourbg").data([0]);n.enter().append("g").classed("contourbg",!0);var i=n.selectAll("path").data("fill"===r.coloring?[0]:[]);i.enter().append("path"),i.exit().remove(),i.attr("d","M"+e.join("L")+"Z").style("stroke","none")}(P,L,g),function(t,e,r,i){var a=t.selectAll("g.contourfill").data([0]);a.enter().append("g").classed("contourfill",!0);var o=a.selectAll("path").data("fill"===i.coloring||"constraint"===i.type&&"="!==i._operation?e:[]);o.enter().append("path"),o.exit().remove(),o.each(function(t){var e=y(t,r);e?n.select(this).attr("d",e).style("stroke","none"):n.select(this).remove()})}(P,C,L,g),function(t,e,o,s,l,c){var u=t.selectAll("g.contourlines").data([0]);u.enter().append("g").classed("contourlines",!0);var f=!1!==l.showlines,h=l.showlabels,d=f&&h,p=r.createLines(u,f||h,e),v=r.createLineClip(u,d,o._fullLayout._clips,s.trace.uid),g=t.selectAll("g.contourlabels").data(h?[0]:[]);if(g.exit().remove(),g.enter().append("g").classed("contourlabels",!0),h){var y=[c],b=[];i.clearLocationCache();var x=r.labelFormatter(l,s.t.cb,o._fullLayout),_=a.tester.append("text").attr("data-notex",1).call(a.font,l.labelfont),w=e[0].xaxis._length,M=e[0].yaxis._length,k={left:Math.max(c[0][0],0),right:Math.min(c[2][0],w),top:Math.max(c[0][1],0),bottom:Math.min(c[2][1],M)};k.middle=(k.top+k.bottom)/2,k.center=(k.left+k.right)/2;var A=Math.sqrt(w*w+M*M),T=m.LABELDISTANCE*A/Math.max(1,e.length/m.LABELINCREASE);p.each(function(t){var e=r.calcTextOpts(t.level,x,_,o);n.select(this).selectAll("path").each(function(){var t=i.getVisibleSegment(this,k,e.height/2);if(t&&!(t.len<(e.width+e.height)*m.LABELMIN))for(var n=Math.min(Math.ceil(t.len/T),m.LABELMAX),a=0;a<n;a++){var o=r.findBestTextLocation(this,t,e,b,k);if(!o)break;r.addLabelData(o,e,b,y)}})}),_.remove(),r.drawLabels(g,b,o,v,d?y:null)}h&&!f&&p.remove()}(P,k,t,o[0],g,L),function(t,e,r,n,i){var o="clip"+n.trace.uid,s=r.selectAll("#"+o).data(n.trace.connectgaps?[]:[0]);if(s.enter().append("clipPath").classed("contourclip",!0).attr("id",o),s.exit().remove(),!1===n.trace.connectgaps){var l={level:.9,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:e.xaxis,yaxis:e.yaxis,x:n.x,y:n.y,z:function(t){var e,r,n=t.trace._emptypoints,i=[],a=t.z.length,o=t.z[0].length,s=[];for(e=0;e<o;e++)s.push(1);for(e=0;e<a;e++)i.push(s.slice());for(e=0;e<n.length;e++)r=n[e],i[r[0]][r[1]]=0;return t.zmask=i,i}(n),smoothing:0};u([l]),f([l]);var c=y(l,i),h=s.selectAll("path").data([0]);h.enter().append("path"),h.attr("d",c)}else o=null;t.call(a.setClipUrl,o),e.plot.selectAll(".hm"+n.trace.uid).call(a.setClipUrl,o)}(P,e,w._clips,o[0],L)}function y(t,e){var r,n,o,s,l,c,u,f=function(t,e){var r=t.prefixBoundary;if(void 0===r){var n=Math.min(t.z[0][0],t.z[0][1]);r=!t.edgepaths.length&&n>t.level}return r?"M"+e.join("L")+"Z":""}(t,e),h=0,d=t.edgepaths.map(function(t,e){return e}),p=!0;function m(t){return Math.abs(t[1]-e[2][1])<.01}function v(t){return Math.abs(t[0]-e[0][0])<.01}function g(t){return Math.abs(t[0]-e[2][0])<.01}for(;d.length;){for(c=a.smoothopen(t.edgepaths[h],t.smoothing),f+=p?c:c.replace(/^M/,"L"),d.splice(d.indexOf(h),1),r=t.edgepaths[h][t.edgepaths[h].length-1],s=-1,o=0;o<4;o++){if(!r){i.log("Missing end?",h,t);break}for(u=r,Math.abs(u[1]-e[0][1])<.01&&!g(r)?n=e[1]:v(r)?n=e[0]:m(r)?n=e[3]:g(r)&&(n=e[2]),l=0;l<t.edgepaths.length;l++){var y=t.edgepaths[l][0];Math.abs(r[0]-n[0])<.01?Math.abs(r[0]-y[0])<.01&&(y[1]-r[1])*(n[1]-y[1])>=0&&(n=y,s=l):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-y[1])<.01&&(y[0]-r[0])*(n[0]-y[0])>=0&&(n=y,s=l):i.log("endpt to newendpt is not vert. or horz.",r,n,y)}if(r=n,s>=0)break;f+="L"+n}if(s===t.edgepaths.length){i.log("unclosed perimeter path");break}h=s,(p=-1===d.indexOf(h))&&(h=d[0],f+="Z")}for(h=0;h<t.paths.length;h++)f+=a.smoothclosed(t.paths[h],t.smoothing);return f}function b(t,e,r,n){var a=e.width/2,o=e.height/2,s=t.x,l=t.y,c=t.theta,u=Math.cos(c)*a,f=Math.sin(c)*a,h=(s>n.center?n.right-s:s-n.left)/(u+Math.abs(Math.sin(c)*o)),d=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(f)+Math.cos(c)*o);if(h<1||d<1)return 1/0;var p=v.EDGECOST*(1/(h-1)+1/(d-1));p+=v.ANGLECOST*c*c;for(var m=s-u,g=l-f,y=s+u,b=l+f,x=0;x<r.length;x++){var _=r[x],w=Math.cos(_.theta)*_.width/2,M=Math.sin(_.theta)*_.width/2,k=2*i.segmentDistance(m,g,y,b,_.x-w,_.y-M,_.x+w,_.y+M)/(e.height+_.height),A=_.level===e.level,T=A?v.SAMELEVELDISTANCE:1;if(k<=T)return 1/0;p+=v.NEIGHBORCOST*(A?v.SAMELEVELFACTOR:1)/(k-T)}return p}r.plot=function(t,e,r){for(var n=0;n<r.length;n++)g(t,e,r[n])},r.makeContourGroup=function(t,e,r){var n=t.plot.select(".maplayer").selectAll("g.contour."+r).data(e);return n.enter().append("g").classed("contour",!0).classed(r,!0),n.exit().remove(),n},r.createLines=function(t,e,r){var n=r[0].smoothing,i=t.selectAll("g.contourlevel").data(e?r:[]);if(i.exit().remove(),i.enter().append("g").classed("contourlevel",!0),e){var o=i.selectAll("path.openline").data(function(t){return t.pedgepaths||t.edgepaths});o.exit().remove(),o.enter().append("path").classed("openline",!0),o.attr("d",function(t){return a.smoothopen(t,n)}).style("stroke-miterlimit",1).style("vector-effect","non-scaling-stroke");var s=i.selectAll("path.closedline").data(function(t){return t.ppaths||t.paths});s.exit().remove(),s.enter().append("path").classed("closedline",!0),s.attr("d",function(t){return a.smoothclosed(t,n)}).style("stroke-miterlimit",1).style("vector-effect","non-scaling-stroke")}return i},r.createLineClip=function(t,e,r,n){var i=e?"clipline"+n:null,o=r.selectAll("#"+i).data(e?[0]:[]);return o.exit().remove(),o.enter().append("clipPath").classed("contourlineclip",!0).attr("id",i),a.setClipUrl(t,i),o},r.labelFormatter=function(t,e,r){if(t.labelformat)return r._d3locale.numberFormat(t.labelformat);var n;if(e)n=e.axis;else{if(n={type:"linear",_id:"ycontour",showexponent:"all"},"constraint"===t.type){var i=t.value;Array.isArray(i)?n.range=[i[0],i[i.length-1]]:n.range=[i,i],n.range[0]===n.range[1]&&(n.range[1]+=n.range[0]||1),n.nticks=1e3}else n.range=[t.start,t.end],n.nticks=(t.end-t.start)/t.size;l(n,r),s.calcTicks(n),n._tmin=null,n._tmax=null}return function(t){return s.tickText(n,t).text}},r.calcTextOpts=function(t,e,r,n){var i=e(t);r.text(i).call(o.convertToTspans,n);var s=a.bBox(r.node(),!0);return{text:i,width:s.width,height:s.height,level:t,dy:(s.top+s.bottom)/2}},r.findBestTextLocation=function(t,e,r,n,a){var o,s,l,c,u,f=r.width;e.isClosed?(s=e.len/v.INITIALSEARCHPOINTS,o=e.min+s/2,l=e.max):(s=(e.len-f)/(v.INITIALSEARCHPOINTS+1),o=e.min+s+f/2,l=e.max-(s+f)/2);for(var h=1/0,d=0;d<v.ITERATIONS;d++){for(var p=o;p<l;p+=s){var m=i.getTextLocation(t,e.total,p,f),g=b(m,r,n,a);g<h&&(h=g,u=m,c=p)}if(h>2*v.MAXCOST)break;d&&(s/=2),l=(o=c-s/2)+1.5*s}if(h<=v.MAXCOST)return u},r.addLabelData=function(t,e,r,n){var i=e.width/2,a=e.height/2,o=t.x,s=t.y,l=t.theta,c=Math.sin(l),u=Math.cos(l),f=i*u,h=a*c,d=i*c,p=-a*u,m=[[o-f-h,s-d-p],[o+f-h,s+d-p],[o+f+h,s+d+p],[o-f+h,s-d+p]];r.push({text:e.text,x:o,y:s,dy:e.dy,theta:l,level:e.level,width:e.width,height:e.height}),n.push(m)},r.drawLabels=function(t,e,r,i,a){var s=t.selectAll("text").data(e,function(t){return t.text+","+t.x+","+t.y+","+t.theta});if(s.exit().remove(),s.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(t){var e=t.x+Math.sin(t.theta)*t.dy,i=t.y-Math.cos(t.theta)*t.dy;n.select(this).text(t.text).attr({x:e,y:i,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+i+")"}).call(o.convertToTspans,r)}),a){for(var l="",c=0;c<a.length;c++)l+="M"+a[c].join("L")+"Z";var u=i.selectAll("path").data([0]);u.enter().append("path"),u.attr("d",l)}}},{"../../components/drawing":623,"../../lib":724,"../../lib/svg_text_utils":747,"../../plots/cartesian/axes":770,"../../plots/cartesian/set_convert":789,"../heatmap/plot":972,"./close_boundaries":932,"./constants":934,"./convert_to_constraints":938,"./empty_pathinfo":940,"./find_all_paths":942,"./make_crossings":947,d3:128}],949:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib").extendFlat;function a(t,e,r){var i={type:"linear",range:[t,e]};return n.autoTicks(i,(e-t)/(r||15)),i}e.exports=function(t){var e=t.contours;if(t.autocontour){var r=a(t.zmin,t.zmax,t.ncontours);e.size=r.dtick,e.start=n.tickFirst(r),r.range.reverse(),e.end=n.tickFirst(r),e.start===t.zmin&&(e.start+=e.size),e.end===t.zmax&&(e.end-=e.size),e.start>e.end&&(e.start=e.end=(e.start+e.end)/2),t._input.contours||(t._input.contours={}),i(t._input.contours,{start:e.start,end:e.end,size:e.size}),t._input.autocontour=!0}else if("constraint"!==e.type){var o,s=e.start,l=e.end,c=t._input.contours;if(s>l&&(e.start=c.start=l,l=e.end=c.end=s,s=e.start),!(e.size>0))o=s===l?1:a(s,l,t.ncontours).dtick,c.size=e.size=o}}},{"../../lib":724,"../../plots/cartesian/axes":770}],950:[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,c=a.start,u="constraint"===a.type,f=!u&&"lines"===a.coloring,h=!u&&"fill"===a.coloring,d=f||h?o(r):null;e.selectAll("g.contourlevel").each(function(t){n.select(this).selectAll("path").call(i.lineGroupStyle,s.width,f?d(t.level):s.color,s.dash)});var p=a.labelfont;if(e.selectAll("g.contourlabels text").each(function(t){i.font(n.select(this),{family:p.family,size:p.size,color:p.color||(f?d(t.level):s.color)})}),u)e.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(h){var m;e.selectAll("g.contourfill path").style("fill",function(t){return void 0===m&&(m=t.level),d(t.level+.5*l)}),void 0===m&&(m=c),e.selectAll("g.contourbg path").style("fill",d(m-.5*l))}}),a(t)}},{"../../components/drawing":623,"../heatmap/style":973,"./make_color_map":946,d3:128}],951:[function(t,e,r){"use strict";var n=t("../../components/colorscale/defaults"),i=t("./label_defaults");e.exports=function(t,e,r,a,o){var s,l=r("contours.coloring"),c="";"fill"===l&&(s=r("contours.showlines")),!1!==s&&("lines"!==l&&(c=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==l&&n(t,e,a,r,{prefix:"",cLetter:"z"}),r("line.smoothing"),i(r,a,c,o)}},{"../../components/colorscale/defaults":608,"./label_defaults":945}],952:[function(t,e,r){"use strict";var n=t("../heatmap/attributes"),i=t("../contour/attributes"),a=i.contours,o=t("../scatter/attributes"),s=t("../../components/colorscale/attributes"),l=t("../../components/colorbar/attributes"),c=t("../../lib/extend").extendFlat,u=o.line;e.exports=c({},{carpet:{valType:"string",editType:"calc"},z:n.z,a:n.x,a0:n.x0,da:n.dx,b:n.y,b0:n.y0,db:n.dy,text:n.text,transpose:n.transpose,atype:n.xtype,btype:n.ytype,fillcolor:i.fillcolor,autocontour:i.autocontour,ncontours:i.ncontours,contours:{type:a.type,start:a.start,end:a.end,size:a.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:a.showlines,showlabels:a.showlabels,labelfont:a.labelfont,labelformat:a.labelformat,operation:a.operation,value:a.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:c({},u.color,{}),width:u.width,dash:u.dash,smoothing:c({},u.smoothing,{}),editType:"plot"}},s,{autocolorscale:c({},s.autocolorscale,{dflt:!1})},{colorbar:l})},{"../../components/colorbar/attributes":599,"../../components/colorscale/attributes":604,"../../lib/extend":713,"../contour/attributes":930,"../heatmap/attributes":959,"../scatter/attributes":1048}],953:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),i=t("../heatmap/has_columns"),a=t("../heatmap/convert_column_xyz"),o=t("../heatmap/clean_2d_array"),s=t("../heatmap/max_row_length"),l=t("../heatmap/interp2d"),c=t("../heatmap/find_empties"),u=t("../heatmap/make_bound_array"),f=t("./defaults"),h=t("../carpet/lookup_carpetid"),d=t("../contour/set_contours");e.exports=function(t,e){var r=e.carpetTrace=h(t,e);if(r&&r.visible&&"legendonly"!==r.visible){if(!e.a||!e.b){var p=t.data[r.index],m=t.data[e.index];m.a||(m.a=p.a),m.b||(m.b=p.b),f(m,e,e._defaultColor,t._fullLayout)}var v=function(t,e){var r,f,h,d,p,m,v,g=e.carpetTrace,y=g.aaxis,b=g.baxis;y._minDtick=0,b._minDtick=0,i(e)&&a(e,y,b,"a","b",["z"]);r=e.a?y.makeCalcdata(e,"a"):[],d=e.b?b.makeCalcdata(e,"b"):[],f=e.a0||0,h=e.da||1,p=e.b0||0,m=e.db||1,v=o(e.z,e.transpose),e._emptypoints=c(v),e._interpz=l(v,e._emptypoints,e._interpz);var x=s(v),_="scaled"===e.xtype?"":r,w=u(e,_,f,h,x,y),M="scaled"===e.ytype?"":d,k=u(e,M,p,m,v.length,b),A={a:w,b:k,z:v};"levels"===e.contours.type&&n(e,v,"","z");return[A]}(0,e);return d(e),v}}},{"../../components/colorscale/calc":605,"../carpet/lookup_carpetid":912,"../contour/set_contours":949,"../heatmap/clean_2d_array":961,"../heatmap/convert_column_xyz":963,"../heatmap/find_empties":965,"../heatmap/has_columns":966,"../heatmap/interp2d":969,"../heatmap/make_bound_array":970,"../heatmap/max_row_length":971,"./defaults":954}],954:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/xyz_defaults"),a=t("./attributes"),o=t("../contour/constraint_defaults"),s=t("../contour/contours_defaults"),l=t("../contour/style_defaults");e.exports=function(t,e,r,c){function u(r,i){return n.coerce(t,e,a,r,i)}if(u("carpet"),t.a&&t.b){if(!i(t,e,u,c,"a","b"))return void(e.visible=!1);u("text");var f="constraint"===u("contours.type");f||delete e.showlegend,f?o(t,e,u,c,r,{hasHover:!1}):(s(t,e,u,function(r){return n.coerce2(t,e,a,r)}),l(t,e,u,c,{hasHover:!1}))}else e._defaultColor=r}},{"../../lib":724,"../contour/constraint_defaults":935,"../contour/contours_defaults":937,"../contour/style_defaults":951,"../heatmap/xyz_defaults":975,"./attributes":952}],955:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../contour/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../contour/style"),n.moduleType="trace",n.name="contourcarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","carpet","contour","symbols","showLegend","hasLines","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":781,"../contour/colorbar":933,"../contour/style":950,"./attributes":952,"./calc":953,"./defaults":954,"./plot":958}],956:[function(t,e,r){"use strict";var n=t("../../components/drawing"),i=t("../carpet/axis_aligned_line"),a=t("../../lib");e.exports=function(t,e,r,o,s,l,c,u){var f,h,d,p,m,v,g,y="",b=e.edgepaths.map(function(t,e){return e}),x=!0,_=1e-4*Math.abs(r[0][0]-r[2][0]),w=1e-4*Math.abs(r[0][1]-r[2][1]);function M(t){return Math.abs(t[1]-r[0][1])<w}function k(t){return Math.abs(t[1]-r[2][1])<w}function A(t){return Math.abs(t[0]-r[0][0])<_}function T(t){return Math.abs(t[0]-r[2][0])<_}function E(t,e){var r,n,a,o,f="";for(M(t)&&!T(t)||k(t)&&!A(t)?(o=s.aaxis,a=i(s,l,[t[0],e[0]],.5*(t[1]+e[1]))):(o=s.baxis,a=i(s,l,.5*(t[0]+e[0]),[t[1],e[1]])),r=1;r<a.length;r++)for(f+=o.smoothing?"C":"L",n=0;n<a[r].length;n++){var h=a[r][n];f+=[c.c2p(h[0]),u.c2p(h[1])]+" "}return f}for(f=0,h=null;b.length;){var S=e.edgepaths[f][0];for(h&&(y+=E(h,S)),g=n.smoothopen(e.edgepaths[f].map(o),e.smoothing),y+=x?g:g.replace(/^M/,"L"),b.splice(b.indexOf(f),1),h=e.edgepaths[f][e.edgepaths[f].length-1],m=-1,p=0;p<4;p++){if(!h){a.log("Missing end?",f,e);break}for(M(h)&&!T(h)?d=r[1]:A(h)?d=r[0]:k(h)?d=r[3]:T(h)&&(d=r[2]),v=0;v<e.edgepaths.length;v++){var L=e.edgepaths[v][0];Math.abs(h[0]-d[0])<_?Math.abs(h[0]-L[0])<_&&(L[1]-h[1])*(d[1]-L[1])>=0&&(d=L,m=v):Math.abs(h[1]-d[1])<w?Math.abs(h[1]-L[1])<w&&(L[0]-h[0])*(d[0]-L[0])>=0&&(d=L,m=v):a.log("endpt to newendpt is not vert. or horz.",h,d,L)}if(m>=0)break;y+=E(h,d),h=d}if(m===e.edgepaths.length){a.log("unclosed perimeter path");break}f=m,(x=-1===b.indexOf(f))&&(f=b[0],y+=E(h,d)+"Z",h=null)}for(f=0;f<e.paths.length;f++)y+=n.smoothclosed(e.paths[f].map(o),e.smoothing);return y}},{"../../components/drawing":623,"../../lib":724,"../carpet/axis_aligned_line":895}],957:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,i,a,o,s,l,c,u;for(r=0;r<t.length;r++){for(o=(a=t[r]).pedgepaths=[],s=a.ppaths=[],n=0;n<a.edgepaths.length;n++){for(u=a.edgepaths[n],l=[],i=0;i<u.length;i++)l[i]=e(u[i]);o.push(l)}for(n=0;n<a.paths.length;n++){for(u=a.paths[n],c=[],i=0;i<u.length;i++)c[i]=e(u[i]);s.push(c)}}}},{}],958:[function(t,e,r){"use strict";var n=t("d3"),i=t("../carpet/map_1d_array"),a=t("../carpet/makepath"),o=t("../../components/drawing"),s=t("../../lib"),l=t("../contour/make_crossings"),c=t("../contour/find_all_paths"),u=t("../contour/plot"),f=t("../contour/constants"),h=t("../contour/convert_to_constraints"),d=t("./join_all_paths"),p=t("../contour/empty_pathinfo"),m=t("./map_pathinfo"),v=t("../carpet/lookup_carpetid"),g=t("../contour/close_boundaries");function y(t,e,r){var y=r[0].trace,w=y.carpetTrace=v(t,y),M=t.calcdata[w.index][0];if(w.visible&&"legendonly"!==w.visible){var k=r[0].a,A=r[0].b,T=y.contours,E=y.uid,S=e.xaxis,L=e.yaxis,C=t._fullLayout,P="contour"+E,z=p(T,e,r[0]),O="constraint"===T.type,D=T._operation,I=O?"="===D?"lines":"fill":T.coloring;if(!0===y.visible){var R=[[k[0],A[A.length-1]],[k[k.length-1],A[A.length-1]],[k[k.length-1],A[0]],[k[0],A[0]]];l(z);var N=1e-8*(k[k.length-1]-k[0]),F=1e-8*(A[A.length-1]-A[0]);c(z,N,F);var j=z;"constraint"===T.type&&(j=h(z,D),g(j,D,R,y)),m(z,W);var B,U,V,q,H=u.makeContourGroup(e,r,P),G=[];for(q=M.clipsegments.length-1;q>=0;q--)B=M.clipsegments[q],U=i([],B.x,S.c2p),V=i([],B.y,L.c2p),U.reverse(),V.reverse(),G.push(a(U,V,B.bicubic));var Y="M"+G.join("L")+"Z";!function(t,e,r,n,o,s){var l,c,u,f,h=t.selectAll("g.contourbg").data([0]);h.enter().append("g").classed("contourbg",!0);var d=h.selectAll("path").data("fill"!==s||o?[]:[0]);d.enter().append("path"),d.exit().remove();var p=[];for(f=0;f<e.length;f++)l=e[f],c=i([],l.x,r.c2p),u=i([],l.y,n.c2p),p.push(a(c,u,l.bicubic));d.attr("d","M"+p.join("L")+"Z").style("stroke","none")}(H,M.clipsegments,S,L,O,I),function(t,e,r,i,a,o,s,l,c,u,f){var h=e.selectAll("g.contourfill").data([0]);h.enter().append("g").classed("contourfill",!0);var p=h.selectAll("path").data("fill"===u?a:[]);p.enter().append("path"),p.exit().remove(),p.each(function(e){var a=d(t,e,o,s,l,c,r,i);e.prefixBoundary&&(a=f+a),a?n.select(this).attr("d",a).style("stroke","none"):n.select(this).remove()})}(y,H,S,L,j,R,W,w,M,I,Y),function(t,e,r,i,a,l,c){var h=t.selectAll("g.contourlines").data([0]);h.enter().append("g").classed("contourlines",!0);var d=!1!==a.showlines,p=a.showlabels,m=d&&p,v=u.createLines(h,d||p,e),g=u.createLineClip(h,m,r._fullLayout._defs,i.trace.uid),y=t.selectAll("g.contourlabels").data(p?[0]:[]);if(y.exit().remove(),y.enter().append("g").classed("contourlabels",!0),p){var w=l.xaxis,M=l.yaxis,k=w._length,A=M._length,T=[[[0,0],[k,0],[k,A],[0,A]]],E=[];s.clearLocationCache();var S=u.labelFormatter(a,i.t.cb,r._fullLayout),L=o.tester.append("text").attr("data-notex",1).call(o.font,a.labelfont),C={left:0,right:k,center:k/2,top:0,bottom:A,middle:A/2},P=Math.sqrt(k*k+A*A),z=f.LABELDISTANCE*P/Math.max(1,e.length/f.LABELINCREASE);v.each(function(t){var e=u.calcTextOpts(t.level,S,L,r);n.select(this).selectAll("path").each(function(r){var n=s.getVisibleSegment(this,C,e.height/2);if(n&&(function(t,e,r,n,i,a){for(var o,s=0;s<r.pedgepaths.length;s++)e===r.pedgepaths[s]&&(o=r.edgepaths[s]);if(!o)return;var l=i.a[0],c=i.a[i.a.length-1],u=i.b[0],f=i.b[i.b.length-1];function h(t,e){var r,n=0;return(Math.abs(t[0]-l)<.1||Math.abs(t[0]-c)<.1)&&(r=x(i.dxydb_rough(t[0],t[1],.1)),n=Math.max(n,a*_(e,r)/2)),(Math.abs(t[1]-u)<.1||Math.abs(t[1]-f)<.1)&&(r=x(i.dxyda_rough(t[0],t[1],.1)),n=Math.max(n,a*_(e,r)/2)),n}var d=b(t,0,1),p=b(t,n.total,n.total-1),m=h(o[0],d),v=n.total-h(o[o.length-1],p);n.min<m&&(n.min=m);n.max>v&&(n.max=v);n.len=n.max-n.min}(this,r,t,n,c,e.height),!(n.len<(e.width+e.height)*f.LABELMIN)))for(var i=Math.min(Math.ceil(n.len/z),f.LABELMAX),a=0;a<i;a++){var o=u.findBestTextLocation(this,n,e,E,C);if(!o)break;u.addLabelData(o,e,E,T)}})}),L.remove(),u.drawLabels(y,E,r,g,m?T:null)}p&&!d&&v.remove()}(H,z,t,r[0],T,e,w),o.setClipUrl(H,w._clipPathId)}else C._infolayer.selectAll(".cb"+E).remove()}function W(t){var e=w.ab2xy(t[0],t[1],!0);return[S.c2p(e[0]),L.c2p(e[1])]}}function b(t,e,r){var n=t.getPointAtLength(e),i=t.getPointAtLength(r),a=i.x-n.x,o=i.y-n.y,s=Math.sqrt(a*a+o*o);return[a/s,o/s]}function x(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}function _(t,e){var r=Math.abs(t[0]*e[0]+t[1]*e[1]);return Math.sqrt(1-r*r)/r}e.exports=function(t,e,r){for(var n=0;n<r.length;n++)y(t,e,r[n])}},{"../../components/drawing":623,"../../lib":724,"../carpet/lookup_carpetid":912,"../carpet/makepath":913,"../carpet/map_1d_array":914,"../contour/close_boundaries":932,"../contour/constants":934,"../contour/convert_to_constraints":938,"../contour/empty_pathinfo":940,"../contour/find_all_paths":942,"../contour/make_crossings":947,"../contour/plot":948,"./join_all_paths":956,"./map_pathinfo":957,d3:128}],959:[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",editType:"calc"},x:o({},n.x,{impliedEdits:{xtype:"array"}}),x0:o({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:o({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:o({},n.y,{impliedEdits:{ytype:"array"}}),y0:o({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:o({},n.dy,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},zhoverformat:{valType:"string",dflt:"",editType:"none"}},i,{autocolorscale:o({},i.autocolorscale,{dflt:!1})},{colorbar:a})},{"../../components/colorbar/attributes":599,"../../components/colorscale/attributes":604,"../../lib/extend":713,"../scatter/attributes":1048}],960:[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"),c=t("./convert_column_xyz"),u=t("./max_row_length"),f=t("./clean_2d_array"),h=t("./interp2d"),d=t("./find_empties"),p=t("./make_bound_array");e.exports=function(t,e){var r,m,v,g,y,b,x,_,w,M=a.getFromId(t,e.xaxis||"x"),k=a.getFromId(t,e.yaxis||"y"),A=n.traceIs(e,"contour"),T=n.traceIs(e,"histogram"),E=n.traceIs(e,"gl2d"),S=A?"best":e.zsmooth;function L(t){S=e._input.zsmooth=e.zsmooth=!1,i.warn('cannot use zsmooth: "fast": '+t)}if(M._minDtick=0,k._minDtick=0,T?(r=(w=o(t,e)).x,m=w.x0,v=w.dx,g=w.y,y=w.y0,b=w.dy,x=w.z):(l(e)?(c(e,M,k,"x","y",["z"]),r=e.x,g=e.y):(r=e.x?M.makeCalcdata(e,"x"):[],g=e.y?k.makeCalcdata(e,"y"):[]),m=e.x0||0,v=e.dx||1,y=e.y0||0,b=e.dy||1,x=f(e.z,e.transpose),(A||e.connectgaps)&&(e._emptypoints=d(x),e._interpz=h(x,e._emptypoints,e._interpz))),"fast"===S)if("log"===M.type||"log"===k.type)L("log axis found");else if(!T){if(r.length){var C=(r[r.length-1]-r[0])/(r.length-1),P=Math.abs(C/100);for(_=0;_<r.length-1;_++)if(Math.abs(r[_+1]-r[_]-C)>P){L("x scale is not linear");break}}if(g.length&&"fast"===S){var z=(g[g.length-1]-g[0])/(g.length-1),O=Math.abs(z/100);for(_=0;_<g.length-1;_++)if(Math.abs(g[_+1]-g[_]-z)>O){L("y scale is not linear");break}}}var D=u(x),I="scaled"===e.xtype?"":r,R=p(e,I,m,v,D,M),N="scaled"===e.ytype?"":g,F=p(e,N,y,b,x.length,k);E||(a.expand(M,R),a.expand(k,F));var j={x:R,y:F,z:x,text:e.text};if(I&&I.length===R.length-1&&(j.xCenter=I),N&&N.length===F.length-1&&(j.yCenter=N),T&&(j.xRanges=w.xRanges,j.yRanges=w.yRanges,j.pts=w.pts),A&&"constraint"===e.contours.type||s(e,x,"","z"),A&&e.contours&&"heatmap"===e.contours.coloring){var B={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};j.xfill=p(B,I,m,v,D,M),j.yfill=p(B,N,y,b,x.length,k)}return[j]}},{"../../components/colorscale/calc":605,"../../lib":724,"../../plots/cartesian/axes":770,"../../registry":854,"../histogram2d/calc":992,"./clean_2d_array":961,"./convert_column_xyz":963,"./find_empties":965,"./has_columns":966,"./interp2d":969,"./make_bound_array":970,"./max_row_length":971}],961:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){var r,i,a,o,s,l;function c(t){if(n(t))return+t}if(e){for(r=0,s=0;s<t.length;s++)r=Math.max(r,t[s].length);if(0===r)return!1;a=function(t){return t.length},o=function(t,e,r){return t[r][e]}}else r=t.length,a=function(t,e){return t[e].length},o=function(t,e,r){return t[e][r]};var u=new Array(r);for(s=0;s<r;s++)for(i=a(t,s),u[s]=new Array(i),l=0;l<i;l++)u[s][l]=c(o(t,s,l));return u}},{"fast-isnumeric":140}],962:[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,c=r.zmin,u=r.zmax;if(n(c)||(c=i.aggNums(Math.min,null,r.z)),n(u)||(u=i.aggNums(Math.max,null,r.z)),t._fullLayout._infolayer.selectAll("."+l).remove(),r.showscale){var f=e[0].t.cb=s(t,l),h=o.makeColorScaleFunc(o.extractScale(r.colorscale,c,u),{noNumericCheck:!0});f.fillcolor(h).filllevels({start:c,end:u,size:(u-c)/254}).options(r.colorbar)()}else a.autoMargin(t,l)}},{"../../components/colorbar/draw":602,"../../components/colorscale":613,"../../lib":724,"../../plots/plots":833,"fast-isnumeric":140}],963:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r,a,o,s){a=a||"x",o=o||"y",s=s||["z"];var l,c,u,f=t[a].slice(),h=t[o].slice(),d=t.text,p=Math.min(f.length,h.length),m=void 0!==d&&!Array.isArray(d[0]),v=t[a+"calendar"],g=t[o+"calendar"];for(l=0;l<s.length;l++)(u=t[s[l]])&&(p=Math.min(p,u.length));for(p<f.length&&(f=f.slice(0,p)),p<h.length&&(h=h.slice(0,p)),l=0;l<p;l++)f[l]=e.d2c(f[l],0,v),h[l]=r.d2c(h[l],0,g);var y,b,x,_=n.distinctVals(f),w=_.vals,M=n.distinctVals(h),k=M.vals,A=[];for(l=0;l<s.length;l++)A[l]=n.init2dArray(k.length,w.length);for(m&&(x=n.init2dArray(k.length,w.length)),l=0;l<p;l++)if(f[l]!==i&&h[l]!==i){for(y=n.findBin(f[l]+_.minDiff/2,w),b=n.findBin(h[l]+M.minDiff/2,k),c=0;c<s.length;c++)u=t[s[c]],A[c][b][y]=u[l];m&&(x[b][y]=d[l])}for(t["_input_"+a]=t[a],t["_input_"+o]=t[o],t[a]=w,t[o]=k,c=0;c<s.length;c++)t["_input_"+s[c]]=t[s[c]],t[s[c]]=A[c];m&&(t.text=x)}},{"../../constants/numerical":702,"../../lib":724}],964:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./has_columns"),a=t("./xyz_defaults"),o=t("./style_defaults"),s=t("../../components/colorscale/defaults"),l=t("./attributes");e.exports=function(t,e,r,c){function u(r,i){return n.coerce(t,e,l,r,i)}a(t,e,u,c)?(u("text"),o(t,e,u,c),u("connectgaps",i(e)&&!1!==e.zsmooth),s(t,e,c,u,{prefix:"",cLetter:"z"})):e.visible=!1}},{"../../components/colorscale/defaults":608,"../../lib":724,"./attributes":959,"./has_columns":966,"./style_defaults":974,"./xyz_defaults":975}],965:[function(t,e,r){"use strict";var n=t("./max_row_length");e.exports=function(t){var e,r,i,a,o,s,l,c,u=[],f={},h=[],d=t[0],p=[],m=[0,0,0],v=n(t);for(r=0;r<t.length;r++)for(e=p,p=d,d=t[r+1]||[],i=0;i<v;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))?(0===r&&s++,0===i&&s++,r===t.length-1&&s++,i===p.length-1&&s++,s<4&&(f[[r,i]]=[r,i,s]),u.push([r,i,s])):h.push([r,i]));for(;h.length;){for(l={},c=!1,o=h.length-1;o>=0;o--)(s=((f[[(r=(a=h[o])[0])-1,i=a[1]]]||m)[2]+(f[[r+1,i]]||m)[2]+(f[[r,i-1]]||m)[2]+(f[[r,i+1]]||m)[2])/20)&&(l[a]=[r,i,s],h.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)f[a]=l[a],u.push(l[a])}return u.sort(function(t,e){return e[2]-t[2]})}},{"./max_row_length":971}],966:[function(t,e,r){"use strict";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],967:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=n.constants.MAXDIST;e.exports=function(t,e,r,s,l,c){if(!(t.distance<o)){var u,f,h,d,p=t.cd[0],m=p.trace,v=t.xa,g=t.ya,y=p.x,b=p.y,x=p.z,_=p.xCenter,w=p.yCenter,M=p.zmask,k=[m.zmin,m.zmax],A=m.zhoverformat,T=y,E=b;if(!1!==t.index){try{h=Math.round(t.index[1]),d=Math.round(t.index[0])}catch(e){return void i.error("Error hovering on heatmap, pointNumber must be [row,col], found:",t.index)}if(h<0||h>=x[0].length||d<0||d>x.length)return}else{if(n.inbox(e-y[0],e-y[y.length-1])>o||n.inbox(r-b[0],r-b[b.length-1])>o)return;if(c){var S;for(T=[2*y[0]-y[1]],S=1;S<y.length;S++)T.push((y[S]+y[S-1])/2);for(T.push([2*y[y.length-1]-y[y.length-2]]),E=[2*b[0]-b[1]],S=1;S<b.length;S++)E.push((b[S]+b[S-1])/2);E.push([2*b[b.length-1]-b[b.length-2]])}h=Math.max(0,Math.min(T.length-2,i.findBin(e,T))),d=Math.max(0,Math.min(E.length-2,i.findBin(r,E)))}var L=v.c2p(y[h]),C=v.c2p(y[h+1]),P=g.c2p(b[d]),z=g.c2p(b[d+1]);c?(C=L,u=y[h],z=P,f=b[d]):(u=_?_[h]:(y[h]+y[h+1])/2,f=w?w[d]:(b[d]+b[d+1])/2,m.zsmooth&&(L=C=v.c2p(u),P=z=g.c2p(f)));var O,D,I=x[d][h];M&&!M[d][h]&&(I=void 0),Array.isArray(p.text)&&Array.isArray(p.text[d])&&(O=p.text[d][h]);var R={type:"linear",range:k,hoverformat:A,_separators:v._separators,_numFormat:v._numFormat};return D=a.tickText(R,I,"hover").text,[i.extendFlat(t,{index:[d,h],distance:o+10,x0:L,x1:C,y0:P,y1:z,xLabelVal:u,yLabelVal:f,zLabelVal:I,zLabel:D,text:O})]}}},{"../../components/fx":640,"../../lib":724,"../../plots/cartesian/axes":770}],968:[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":781,"./attributes":959,"./calc":960,"./colorbar":962,"./defaults":964,"./hover":967,"./plot":972,"./style":973}],969:[function(t,e,r){"use strict";var n=t("../../lib"),i=[[-1,0],[1,0],[0,-1],[0,1]];function a(t){return.5-.25*Math.min(1,.5*t)}function o(t,e,r){var n,a,o,s,l,c,u,f,h,d,p,m,v,g=0;for(s=0;s<e.length;s++){for(a=(n=e[s])[0],o=n[1],p=t[a][o],d=0,h=0,l=0;l<4;l++)(u=t[a+(c=i[l])[0]])&&void 0!==(f=u[o+c[1]])&&(0===d?m=v=f:(m=Math.min(m,f),v=Math.max(v,f)),h++,d+=f);if(0===h)throw"iterateInterp2d order is wrong: no defined neighbors";t[a][o]=d/h,void 0===p?h<4&&(g=1):(t[a][o]=(1+r)*t[a][o]-r*p,v>m&&(g=Math.max(g,Math.abs(t[a][o]-p)/(v-m))))}return g}e.exports=function(t,e,r){var i,s,l=1;if(Array.isArray(r))for(i=0;i<e.length;i++)t[(s=e[i])[0]][s[1]]=r[s[0]][s[1]];else o(t,e);for(i=0;i<e.length&&!(e[i][2]<4);i++);for(e=e.slice(i),i=0;i<100&&l>.01;i++)l=o(t,e,a(l));return l>.01&&n.log("interp2d didn't converge quickly",l),t}},{"../../lib":724}],970:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,i,a,o){var s,l,c,u=[],f=n.traceIs(t,"contour"),h=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(Array.isArray(e)&&e.length>1&&!h&&"category"!==o.type){var p=e.length;if(!(p<=a))return f?e.slice(0,a):e.slice(0,a+1);if(f||d)u=e.slice(0,a);else if(1===a)u=[e[0]-.5,e[0]+.5];else{for(u=[1.5*e[0]-.5*e[1]],c=1;c<p;c++)u.push(.5*(e[c-1]+e[c]));u.push(1.5*e[p-1]-.5*e[p-2])}if(p<a){var m=u[u.length-1],v=m-u[u.length-2];for(c=p;c<a;c++)m+=v,u.push(m)}}else{l=i||1;var g=t[o._id.charAt(0)+"calendar"];for(s=h||"category"===o.type?o.r2c(r,0,g)||0:Array.isArray(e)&&1===e.length?e[0]:void 0===r?0:o.d2c(r,0,g),c=f||d?0:-.5;c<a;c++)u.push(s+l*c)}return u}},{"../../registry":854}],971:[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}},{}],972:[function(t,e,r){"use strict";var n=t("tinycolor2"),i=t("../../registry"),a=t("../../lib"),o=t("../../components/colorscale"),s=t("../../constants/xmlns_namespaces"),l=t("./max_row_length");function c(t,e,r){var c=r[0],d=c.trace,p=d.uid,m=e.xaxis,v=e.yaxis,g=t._fullLayout,y="hm"+p;if(g._paper.selectAll(".contour"+p).remove(),g._infolayer.selectAll("g.rangeslider-container").selectAll(".contour"+p).remove(),!0!==d.visible)return g._paper.selectAll("."+y).remove(),void g._infolayer.selectAll(".cb"+p).remove();var b,x,_,w,M,k,A=c.z,T=c.x,E=c.y,S=c.xCenter,L=c.yCenter,C=i.traceIs(d,"contour"),P=C?"best":d.zsmooth,z=A.length,O=l(A),D=!1,I=!1;for(k=0;void 0===b&&k<T.length-1;)b=m.c2p(T[k]),k++;for(k=T.length-1;void 0===x&&k>0;)x=m.c2p(T[k]),k--;for(x<b&&(_=x,x=b,b=_,D=!0),k=0;void 0===w&&k<E.length-1;)w=v.c2p(E[k]),k++;for(k=E.length-1;void 0===M&&k>0;)M=v.c2p(E[k]),k--;if(M<w&&(_=w,w=M,M=_,I=!0),C&&(S=T,L=E,T=c.xfill,E=c.yfill),"fast"!==P){var R="best"===P?0:.5;b=Math.max(-R*m._length,b),x=Math.min((1+R)*m._length,x),w=Math.max(-R*v._length,w),M=Math.min((1+R)*v._length,M)}var N=Math.round(x-b),F=Math.round(M-w),j=N<=0||F<=0,B=e.plot.select(".imagelayer").selectAll("g.hm."+y).data(j?[]:[0]);if(B.enter().append("g").classed("hm",!0).classed(y,!0),B.exit().remove(),!j){var U,V;"fast"===P?(U=O,V=z):(U=N,V=F);var q=document.createElement("canvas");q.width=U,q.height=V;var H,G,Y=q.getContext("2d"),W=o.makeColorScaleFunc(o.extractScale(d.colorscale,d.zmin,d.zmax),{noNumericCheck:!0,returnArray:!0});"fast"===P?(H=D?function(t){return O-1-t}:a.identity,G=I?function(t){return z-1-t}:a.identity):(H=function(t){return a.constrain(Math.round(m.c2p(T[t])-b),0,N)},G=function(t){return a.constrain(Math.round(v.c2p(E[t])-w),0,F)});var X,Z,J,K,Q,$=G(0),tt=[$,$],et=D?0:1,rt=I?0:1,nt=0,it=0,at=0,ot=0;if(P){var st,lt=0;try{st=new Uint8Array(N*F*4)}catch(t){st=new Array(N*F*4)}if("best"===P){var ct,ut,ft,ht=S||T,dt=L||E,pt=new Array(ht.length),mt=new Array(dt.length),vt=new Array(N),gt=S?f:u,yt=L?f:u;for(k=0;k<ht.length;k++)pt[k]=Math.round(m.c2p(ht[k])-b);for(k=0;k<dt.length;k++)mt[k]=Math.round(v.c2p(dt[k])-w);for(k=0;k<N;k++)vt[k]=gt(k,pt);for(Z=0;Z<F;Z++)for(ut=A[(ct=yt(Z,mt)).bin0],ft=A[ct.bin1],k=0;k<N;k++,lt+=4)h(st,lt,Q=Lt(ut,ft,vt[k],ct))}else for(Z=0;Z<z;Z++)for(K=A[Z],tt=G(Z),k=0;k<N;k++)Q=St(K[k],1),h(st,lt=4*(tt*N+H(k)),Q);var bt=Y.createImageData(N,F);try{bt.data.set(st)}catch(t){var xt=bt.data,_t=xt.length;for(Z=0;Z<_t;Z++)xt[Z]=st[Z]}Y.putImageData(bt,0,0)}else{var wt=d.xgap,Mt=d.ygap,kt=Math.floor(wt/2),At=Math.floor(Mt/2);for(Z=0;Z<z;Z++)if(K=A[Z],tt.reverse(),tt[rt]=G(Z+1),tt[0]!==tt[1]&&void 0!==tt[0]&&void 0!==tt[1])for(X=[J=H(0),J],k=0;k<O;k++)X.reverse(),X[et]=H(k+1),X[0]!==X[1]&&void 0!==X[0]&&void 0!==X[1]&&(Q=St(K[k],(X[1]-X[0])*(tt[1]-tt[0])),Y.fillStyle="rgba("+Q.join(",")+")",Y.fillRect(X[0]+kt,tt[0]+At,X[1]-X[0]-wt,tt[1]-tt[0]-Mt))}it=Math.round(it/nt),at=Math.round(at/nt),ot=Math.round(ot/nt);var Tt=n("rgb("+it+","+at+","+ot+")");t._hmpixcount=(t._hmpixcount||0)+nt,t._hmlumcount=(t._hmlumcount||0)+nt*Tt.getLuminance();var Et=B.selectAll("image").data(r);Et.enter().append("svg:image").attr({xmlns:s.svg,preserveAspectRatio:"none"}),Et.attr({height:F,width:N,x:b,y:w,"xlink:href":q.toDataURL("image/png")}),Et.exit().remove()}function St(t,e){if(void 0!==t){var r=W(t);return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),nt+=e,it+=r[0]*e,at+=r[1]*e,ot+=r[2]*e,r}return[0,0,0,0]}function Lt(t,e,r,n){var i=t[r.bin0];if(void 0===i)return St(void 0,1);var a,o=t[r.bin1],s=e[r.bin0],l=e[r.bin1],c=o-i||0,u=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,St(i+r.frac*c+n.frac*(u+r.frac*a))}}function u(t,e){var r=e.length-2,n=a.constrain(a.findBin(t,e),0,r),i=e[n],o=e[n+1],s=a.constrain(n+(t-i)/(o-i)-.5,0,r),l=Math.round(s),c=Math.abs(s-l);return s&&s!==r&&c?{bin0:l,frac:c,bin1:Math.round(l+c/(s-l))}:{bin0:l,bin1:l,frac:0}}function f(t,e){var r=e.length-1,n=a.constrain(a.findBin(t,e),0,r),i=e[n],o=(t-i)/(e[n+1]-i)||0;return o<=0?{bin0:n,bin1:n,frac:0}:o<.5?{bin0:n,bin1:n+1,frac:o}:{bin0:n+1,bin1:n,frac:1-o}}function h(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])}e.exports=function(t,e,r){for(var n=0;n<r.length;n++)c(t,e,r[n])}},{"../../components/colorscale":613,"../../constants/xmlns_namespaces":704,"../../lib":724,"../../registry":854,"./max_row_length":971,tinycolor2:526}],973:[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:128}],974:[function(t,e,r){"use strict";e.exports=function(t,e,r){!1===r("zsmooth")&&(r("xgap"),r("ygap")),r("zhoverformat")}},{}],975:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../registry"),a=t("./has_columns");function o(t,e){var r=e(t);return"scaled"===(r?e(t+"type","array"):"scaled")&&(e(t+"0"),e("d"+t)),r}e.exports=function(t,e,r,s,l,c){var u,f,h=r("z");if(l=l||"x",c=c||"y",void 0===h||!h.length)return 0;if(a(t)){if(u=r(l),f=r(c),!u||!f)return 0}else{if(u=o(l,r),f=o(c,r),!function(t){for(var e,r=!0,i=!1,a=!1,o=0;o<t.length;o++){if(e=t[o],!Array.isArray(e)){r=!1;break}e.length>0&&(i=!0);for(var s=0;s<e.length;s++)if(n(e[s])){a=!0;break}}return r&&i&&a}(h))return 0;r("transpose")}return i.getComponentMethod("calendars","handleTraceDefaults")(t,e,[l,c],s),e.z.length}},{"../../registry":854,"./has_columns":966,"fast-isnumeric":140}],976:[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=t("../../plot_api/edit_types").overrideAll,l=["z","x","x0","dx","y","y0","dy","text","transpose","xtype","ytype"],c={},u=0;u<l.length;u++){var f=l[u];c[f]=n[f]}o(c,i,{autocolorscale:o({},i.autocolorscale,{dflt:!1})},{colorbar:a}),e.exports=s(c,"calc","nested")},{"../../components/colorbar/attributes":599,"../../components/colorscale/attributes":604,"../../lib/extend":713,"../../plot_api/edit_types":754,"../heatmap/attributes":959}],977:[function(t,e,r){"use strict";var n=t("gl-heatmap2d"),i=t("../../plots/cartesian/axes"),a=t("../../lib/str2rgbarray");function o(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=n(t.glplot,this.options),this.heatmap._trace=this}var s=o.prototype;s.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:[a,i],hoverinfo:this.hoverinfo}},s.update=function(t,e){var r=e[0];this.index=t.index,this.name=t.name,this.hoverinfo=t.hoverinfo;var n=r.z;this.options.z=[].concat.apply([],n);var o=n[0].length,s=n.length;this.options.shape=[o,s],this.options.x=r.x,this.options.y=r.y;var l=function(t){for(var e=t.colorscale,r=t.zmin,n=t.zmax,i=e.length,o=new Array(i),s=new Array(4*i),l=0;l<i;l++){var c=e[l],u=a(c[1]);o[l]=r+c[0]*(n-r);for(var f=0;f<4;f++)s[4*l+f]=u[f]}return{colorLevels:o,colorValues:s}}(t);this.options.colorLevels=l.colorLevels,this.options.colorValues=l.colorValues,this.textLabels=[].concat.apply([],t.text),this.heatmap.update(this.options),i.expand(this.scene.xaxis,r.x),i.expand(this.scene.yaxis,r.y)},s.dispose=function(){this.heatmap.dispose()},e.exports=function(t,e,r){var n=new o(t,e.uid);return n.update(e,r),n}},{"../../lib/str2rgbarray":746,"../../plots/cartesian/axes":770,"gl-heatmap2d":173}],978:[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=["gl","gl2d","2dMap"],n.meta={},e.exports=n},{"../../plots/gl2d":810,"../heatmap/calc":960,"../heatmap/colorbar":962,"../heatmap/defaults":964,"./attributes":976,"./convert":977}],979:[function(t,e,r){"use strict";var n=t("../bar/attributes");function i(t){var e={};e["autobin"+t]=!1;var r={};return r["^autobin"+t]=!1,{start:{valType:"any",dflt:null,editType:"calc",impliedEdits:r},end:{valType:"any",dflt:null,editType:"calc",impliedEdits:r},size:{valType:"any",dflt:null,editType:"calc",impliedEdits:r},editType:"calc",impliedEdits:e}}e.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},text:n.text,orientation:n.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count",editType:"calc"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:"",editType:"calc"},cumulative:{enabled:{valType:"boolean",dflt:!1,editType:"calc"},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing",editType:"calc"},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include",editType:"calc"},editType:"calc"},autobinx:{valType:"boolean",dflt:null,editType:"calc",impliedEdits:{"xbins.start":void 0,"xbins.end":void 0,"xbins.size":void 0}},nbinsx:{valType:"integer",min:0,dflt:0,editType:"calc"},xbins:i("x"),autobiny:{valType:"boolean",dflt:null,editType:"calc",impliedEdits:{"ybins.start":void 0,"ybins.end":void 0,"ybins.size":void 0}},nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc"},ybins:i("y"),marker:n.marker,selected:n.selected,unselected:n.unselected,error_y:n.error_y,error_x:n.error_x,_deprecated:{bardir:n._deprecated.bardir}}},{"../bar/attributes":864}],980:[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}},{}],981:[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"),!1!==r("autobin"+t)&&r("nbins"+t)}),e}},{}],982:[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":140}],983:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),i=n.ONEAVGYEAR,a=n.ONEAVGMONTH,o=n.ONEDAY,s=n.ONEHOUR,l=n.ONEMIN,c=n.ONESEC,u=t("../../plots/cartesian/axes").tickIncrement;function f(t,e,r,n){if(t*e<=0)return 1/0;for(var i=Math.abs(e-t),a="date"===r.type,o=h(i,a),s=0;s<10;s++){var l=h(80*o,a);if(o===l)break;if(!d(l,t,e,a,r,n))break;o=l}return o}function h(t,e){return e&&t>c?t>o?t>1.1*i?i:t>1.1*a?a:o:t>s?s:t>l?l:c:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function d(t,e,r,n,a,s){if(n&&t>o){var l=p(e,a,s),c=p(r,a,s),u=t===i?0:1;return l[u]!==c[u]}return Math.floor(r/t)-Math.floor(e/t)>.1}function p(t,e,r){var n=e.c2d(t,i,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(t,e,r,n,a){var s,l,c=-1.1*e,h=-.1*e,d=t-h,p=r[0],m=r[1],v=Math.min(f(p+h,p+d,n,a),f(m+h,m+d,n,a)),g=Math.min(f(p+c,p+h,n,a),f(m+c,m+h,n,a));if(v>g&&g<Math.abs(m-p)/4e3?(s=v,l=!1):(s=Math.min(v,g),l=!0),"date"===n.type&&s>o){var y=s===i?1:6,b=s===i?"M12":"M1";return function(e,r){var o=n.c2d(e,i,a),s=o.indexOf("-",y);s>0&&(o=o.substr(0,s));var c=n.d2c(o,0,a);if(c<e){var f=u(c,b,!1,a);(c+f)/2<e+t&&(c=f)}return r&&l?u(c,b,!0,a):c}}return function(e,r){var n=s*Math.round(e/s);return n+s/10<e&&n+.9*s<e+t&&(n+=s),r&&l&&(n-=s),n}}},{"../../constants/numerical":702,"../../plots/cartesian/axes":770}],984:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../bar/arrays_to_calcdata"),s=t("./bin_functions"),l=t("./norm_functions"),c=t("./average"),u=t("./clean_bins"),f=t("../../constants/numerical").ONEAVGMONTH,h=t("./bin_label_vals");function d(t,e,r,i,o){var s,l,c,u,f,h=i+"bins",d="overlay"===t._fullLayout.barmode;if(e._autoBinFinished)delete e._autoBinFinished;else{var g=d?[e]:m(t,e),y=[],b=1/0,x=1/0,_=-1/0,w="autobin"+i;for(s=0;s<g.length;s++){f=(l=g[s])._pos0=r.makeCalcdata(l,i);var M=l[h];if(l[w]||!M||null===M.start||null===M.end){c=l[i+"calendar"];var k=l.cumulative;if(M=a.autoBin(f,r,l["nbins"+i],!1,c),d&&1===M._count&&"category"!==r.type){if(o)return[M,f,!0];M=p(t,e,r,i,h)}k.enabled&&"include"!==k.currentbin&&("decreasing"===k.direction?x=Math.min(x,r.r2c(M.start,0,c)-M.size):_=Math.max(_,r.r2c(M.end,0,c)+M.size)),y.push(l)}else u||(u={size:M.size,start:r.r2c(M.start,0,c),end:r.r2c(M.end,0,c)});b=v(b,M.size),x=Math.min(x,r.r2c(M.start,0,c)),_=Math.max(_,r.r2c(M.end,0,c)),s&&(l._autoBinFinished=1)}if(u&&n(u.size)&&n(b)){b=b>u.size/1.9?u.size:u.size/Math.ceil(u.size/b);var A=u.start+(u.size-b)/2;x=A-b*Math.ceil((A-x)/b)}for(s=0;s<y.length;s++)c=(l=y[s])[i+"calendar"],l._input[h]=l[h]={start:r.c2r(x,0,c),end:r.c2r(_,0,c),size:b},l._input[w]=l[w]}return f=e._pos0,delete e._pos0,[e[h],f]}function p(t,e,r,n,a){var o,s,l=m(t,e),c=!1,u=1/0,f=[e];for(o=0;o<l.length;o++)if((s=l[o])===e)c=!0;else if(c){var h=d(t,s,r,n,!0),p=h[0],v=h[2];s._autoBinFinished=1,s._pos0=h[1],v?f.push(s):u=Math.min(u,p.size)}else u=Math.min(u,s[a].size);var g=new Array(f.length);for(o=0;o<f.length;o++)for(var y=f[o]._pos0,b=0;b<y.length;b++)if(void 0!==y[b]){g[o]=y[b];break}for(isFinite(u)||(u=i.distinctVals(g).minDiff),o=0;o<f.length;o++){var x=(s=f[o])[n+"calendar"];s._input[a]=s[a]={start:r.c2r(g[o]-u/2,0,x),end:r.c2r(g[o]+u/2,0,x),size:u}}return e[a]}function m(t,e){for(var r=e.xaxis,n=e.yaxis,i=e.orientation,a=[],o=t._fullData,s=0;s<o.length;s++){var l=o[s];"histogram"===l.type&&l.orientation===i&&l.xaxis===r&&l.yaxis===n&&a.push(l)}return a}function v(t,e){if(t===1/0)return e;var r=g(t);return g(e)<r?e:t}function g(t){return n(t)?t:"string"==typeof t&&"M"===t.charAt(0)?f*+t.substr(1):1/0}e.exports=function(t,e){if(!0===e.visible){var r,f=[],p=[],m=a.getFromId(t,"h"===e.orientation?e.yaxis||"y":e.xaxis||"x"),v="h"===e.orientation?"y":"x",g={x:"y",y:"x"}[v],y=e[v+"calendar"],b=e.cumulative;u(e,m,v);var x,_,w,M=d(t,e,m,v),k=M[0],A=M[1],T="string"==typeof k.size,E=[],S=T?E:k,L=[],C=[],P=[],z=0,O=e.histnorm,D=e.histfunc,I=-1!==O.indexOf("density");b.enabled&&I&&(O=O.replace(/ ?density$/,""),I=!1);var R,N="max"===D||"min"===D?null:0,F=s.count,j=l[O],B=!1,U=function(t){return m.r2c(t,0,y)};for(Array.isArray(e[g])&&"count"!==D&&(R=e[g],B="avg"===D,F=s[D]),r=U(k.start),_=U(k.end)+(r-a.tickIncrement(r,k.size,!1,y))/1e6;r<_&&f.length<1e6&&(x=a.tickIncrement(r,k.size,!1,y),f.push((r+x)/2),p.push(N),P.push([]),E.push(r),I&&L.push(1/(x-r)),B&&C.push(0),!(x<=r));)r=x;E.push(r),T||"date"!==m.type||(S={start:U(S.start),end:U(S.end),size:S.size});var V,q=p.length,H=!0,G=1/0,Y=1/0,W={};for(r=0;r<A.length;r++){var X=A[r];(w=i.findBin(X,S))>=0&&w<q&&(z+=F(w,r,p,R,C),H&&P[w].length&&X!==A[P[w][0]]&&(H=!1),P[w].push(r),W[r]=w,G=Math.min(G,X-E[w]),Y=Math.min(Y,E[w+1]-X))}H||(V=h(G,Y,E,m,y)),B&&(z=c(p,C)),j&&j(p,z,L),b.enabled&&function(t,e,r){var n,i,a;function o(e){a=t[e],t[e]/=2}function s(e){i=t[e],t[e]=a+i/2,a+=i}if("half"===r)if("increasing"===e)for(o(0),n=1;n<t.length;n++)s(n);else for(o(t.length-1),n=t.length-2;n>=0;n--)s(n);else if("increasing"===e){for(n=1;n<t.length;n++)t[n]+=t[n-1];"exclude"===r&&(t.unshift(0),t.pop())}else{for(n=t.length-2;n>=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(p,b.direction,b.currentbin);var Z=Math.min(f.length,p.length),J=[],K=0,Q=Z-1;for(r=0;r<Z;r++)if(p[r]){K=r;break}for(r=Z-1;r>=K;r--)if(p[r]){Q=r;break}for(r=K;r<=Q;r++)if(n(f[r])&&n(p[r])){var $={p:f[r],s:p[r],b:0};b.enabled||($.pts=P[r],H?$.p0=$.p1=P[r].length?A[P[r][0]]:f[r]:($.p0=V(E[r]),$.p1=V(E[r+1],!0))),J.push($)}return 1===J.length&&(J[0].width1=a.tickIncrement(J[0].p,k.size,!1,y)-J[0].p),o(J,e),Array.isArray(e.selectedpoints)&&i.tagSelected(J,e,W),J}}},{"../../constants/numerical":702,"../../lib":724,"../../plots/cartesian/axes":770,"../bar/arrays_to_calcdata":863,"./average":980,"./bin_functions":982,"./bin_label_vals":983,"./clean_bins":985,"./norm_functions":990,"fast-isnumeric":140}],985:[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",c=t[l];c||(c=t[l]={});var u="date"===a?function(t){return t||0===t?i(t,s,c.calendar):null}:function(t){return n(t)?Number(t):null};c.start=u(c.start),c.end=u(c.end);var f="date"===a?o:1,h=c.size;if(n(h))c.size=h>0?Number(h):f;else if("string"!=typeof h)c.size=f;else{var d=h.charAt(0),p=h.substr(1);((p=n(p)?Number(p):0)<=0||"date"!==a||"M"!==d||p!==Math.round(p))&&(c.size=f)}var m="autobin"+r;"boolean"!=typeof t[m]&&(t[m]=t._fullInput[m]=t._input[m]=!((c.start||0===c.start)&&(c.end||0===c.end))),t[m]||(delete t["nbins"+r],delete t._fullInput["nbins"+r])}},{"../../constants/numerical":702,"../../lib":724,"fast-isnumeric":140}],986:[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"),c=t("./attributes");e.exports=function(t,e,r,u){function f(r,n){return i.coerce(t,e,c,r,n)}var h=f("x"),d=f("y");f("cumulative.enabled")&&(f("cumulative.direction"),f("cumulative.currentbin")),f("text");var p=f("orientation",d&&!h?"h":"v"),m=e["v"===p?"x":"y"];m&&m.length?(n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],u),e["h"===p?"x":"y"]&&f("histfunc"),o(t,e,f,"h"===p?["y"]:["x"]),s(t,e,f,r,u),l(t,e,a.defaultLine,{axis:"y"}),l(t,e,a.defaultLine,{axis:"x",inherit:"y"}),i.coerceSelectionMarkerOpacity(e,f)):e.visible=!1}},{"../../components/color":598,"../../components/errorbars/defaults":628,"../../lib":724,"../../registry":854,"../bar/style_defaults":876,"./attributes":979,"./bin_defaults":981}],987:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){if(t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),!(r.cumulative||{}).enabled){var a,o=Array.isArray(i)?n[0].pts[i[0]][i[1]]:n[i].pts;if(t.pointNumbers=o,t.binNumber=t.pointNumber,delete t.pointNumber,delete t.pointIndex,r._indexToPoints){a=[];for(var s=0;s<o.length;s++)a=a.concat(r._indexToPoints[o[s]])}else a=o;t.pointIndices=a}return t}},{}],988:[function(t,e,r){"use strict";var n=t("../bar/hover"),i=t("../../plots/cartesian/axes").hoverLabelText;e.exports=function(t,e,r,a){var o=n(t,e,r,a);if(o){var s=(t=o[0]).cd[t.index],l=t.cd[0].trace;if(!l.cumulative.enabled){var c="h"===l.orientation?"y":"x";t[c+"Label"]=i(t[c+"a"],s.p0,s.p1)}return o}}},{"../../plots/cartesian/axes":770,"../bar/hover":867}],989:[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("./hover"),n.selectPoints=t("../bar/select"),n.eventData=t("./event_data"),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":781,"../bar/layout_attributes":869,"../bar/layout_defaults":870,"../bar/plot":871,"../bar/select":872,"../bar/set_positions":873,"../bar/style":875,"../scatter/colorbar":1052,"./attributes":979,"./calc":984,"./defaults":986,"./event_data":987,"./hover":988}],990:[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}}},{}],991:[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",editType:"calc"},marker:{color:{valType:"data_array",editType:"calc"},editType:"calc"},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,zhoverformat:i.zhoverformat},a,{autocolorscale:s({},a.autocolorscale,{dflt:!1})},{colorbar:o})},{"../../components/colorbar/attributes":599,"../../components/colorscale/attributes":604,"../../lib/extend":713,"../heatmap/attributes":959,"../histogram/attributes":979}],992:[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"),c=t("../histogram/bin_label_vals");function u(t,e,r,n,a,o,s){var c=e+"bins",u="autobin"+e,f=t[c];l(t,n,e),!t[u]&&f&&null!==f.start&&null!==f.end||(f=i.autoBin(r,n,t["nbins"+e],"2d",s),"histogram2dcontour"===t.type&&(f.start=o(i.tickIncrement(a(f.start),f.size,!0,s)),f.end=o(i.tickIncrement(a(f.end),f.size,!1,s))),t._input[c]=t[c]=f,t._input[u]=t[u])}function f(t,e,r,n){var i,a=new Array(t);if(n)for(i=0;i<t;i++)a[i]=1/(e[i+1]-e[i]);else{var o=1/r;for(i=0;i<t;i++)a[i]=o}return a}function h(t,e){return{start:t(e.start),end:t(e.end),size:e.size}}function d(t,e,r,n,i,a){var o,s=t.length-1,l=new Array(s);if(e)for(o=0;o<s;o++)l[o]=[e[o],e[o]];else{var u=c(r,n,t,i,a);for(o=0;o<s;o++)l[o]=[u(t[o]),u(t[o+1],!0)]}return l}e.exports=function(t,e){var r,l,c,p,m=i.getFromId(t,e.xaxis||"x"),v=e.x?m.makeCalcdata(e,"x"):[],g=i.getFromId(t,e.yaxis||"y"),y=e.y?g.makeCalcdata(e,"y"):[],b=e.xcalendar,x=e.ycalendar,_=function(t){return m.r2c(t,0,b)},w=function(t){return g.r2c(t,0,x)},M=function(t){return m.c2r(t,0,b)},k=function(t){return g.c2r(t,0,x)},A=Math.min(v.length,y.length);v.length>A&&v.splice(A,v.length-A),y.length>A&&y.splice(A,y.length-A),u(e,"x",v,m,_,M,b),u(e,"y",y,g,w,k,x);var T=[],E=[],S=[],L="string"==typeof e.xbins.size,C="string"==typeof e.ybins.size,P=[],z=[],O=L?P:e.xbins,D=C?z:e.ybins,I=0,R=[],N=[],F=e.histnorm,j=e.histfunc,B=-1!==F.indexOf("density"),U="max"===j||"min"===j?null:0,V=a.count,q=o[F],H=!1,G=[],Y=[],W="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";W&&"count"!==j&&(H="avg"===j,V=a[j]);var X=e.xbins,Z=_(X.start),J=_(X.end)+(Z-i.tickIncrement(Z,X.size,!1,b))/1e6;for(r=Z;r<J;r=i.tickIncrement(r,X.size,!1,b))E.push(U),P.push(r),H&&S.push(0);P.push(r);var K=E.length,Q=_(e.xbins.start),$=(r-Q)/K,tt=M(Q+$/2);for(Z=w((X=e.ybins).start),J=w(X.end)+(Z-i.tickIncrement(Z,X.size,!1,x))/1e6,r=Z;r<J;r=i.tickIncrement(r,X.size,!1,x)){T.push(E.slice()),z.push(r);var et=new Array(K);for(l=0;l<K;l++)et[l]=[];N.push(et),H&&R.push(S.slice())}z.push(r);var rt=T.length,nt=w(e.ybins.start),it=(r-nt)/rt,at=k(nt+it/2);B&&(G=f(E.length,O,$,L),Y=f(T.length,D,it,C)),L||"date"!==m.type||(O=h(_,O)),C||"date"!==g.type||(D=h(w,D));var ot=!0,st=!0,lt=new Array(K),ct=new Array(rt),ut=1/0,ft=1/0,ht=1/0,dt=1/0;for(r=0;r<A;r++){var pt=v[r],mt=y[r];c=n.findBin(pt,O),p=n.findBin(mt,D),c>=0&&c<K&&p>=0&&p<rt&&(I+=V(c,r,T[p],W,R[p]),N[p][c].push(r),ot&&(void 0===lt[c]?lt[c]=pt:lt[c]!==pt&&(ot=!1)),st&&(void 0===ct[c]?ct[c]=mt:ct[c]!==mt&&(st=!1)),ut=Math.min(ut,pt-P[c]),ft=Math.min(ft,P[c+1]-pt),ht=Math.min(ht,mt-z[p]),dt=Math.min(dt,z[p+1]-mt))}if(H)for(p=0;p<rt;p++)I+=s(T[p],R[p]);if(q)for(p=0;p<rt;p++)q(T[p],I,G,Y[p]);return{x:v,xRanges:d(P,ot&<,ut,ft,m,b),x0:tt,dx:$,y:y,yRanges:d(z,st&&ct,ht,dt,g,x),y0:at,dy:it,z:T,pts:N}}},{"../../lib":724,"../../plots/cartesian/axes":770,"../histogram/average":980,"../histogram/bin_functions":982,"../histogram/bin_label_vals":983,"../histogram/clean_bins":985,"../histogram/norm_functions":990}],993:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./sample_defaults"),a=t("../heatmap/style_defaults"),o=t("../../components/colorscale/defaults"),s=t("./attributes");e.exports=function(t,e,r,l){function c(r,i){return n.coerce(t,e,s,r,i)}i(t,e,c,l),!1!==e.visible&&(a(t,e,c,l),o(t,e,l,c,{prefix:"",cLetter:"z"}))}},{"../../components/colorscale/defaults":608,"../../lib":724,"../heatmap/style_defaults":974,"./attributes":991,"./sample_defaults":996}],994:[function(t,e,r){"use strict";var n=t("../heatmap/hover"),i=t("../../plots/cartesian/axes").hoverLabelText;e.exports=function(t,e,r,a,o,s){var l=n(t,e,r,a,o,s);if(l){var c=(t=l[0]).index,u=c[0],f=c[1],h=t.cd[0],d=h.xRanges[f],p=h.yRanges[u];return t.xLabel=i(t.xa,d[0],d[1]),t.yLabel=i(t.ya,p[0],p[1]),l}}},{"../../plots/cartesian/axes":770,"../heatmap/hover":967}],995:[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("./hover"),n.eventData=t("../histogram/event_data"),n.moduleType="trace",n.name="histogram2d",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","2dMap","histogram"],n.meta={},e.exports=n},{"../../plots/cartesian":781,"../heatmap/calc":960,"../heatmap/colorbar":962,"../heatmap/plot":972,"../heatmap/style":973,"../histogram/event_data":987,"./attributes":991,"./defaults":993,"./hover":994}],996:[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){n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],a),(r("z")||r("marker.color"))&&r("histfunc");i(t,e,r,["x","y"])}else e.visible=!1}},{"../../registry":854,"../histogram/bin_defaults":981}],997:[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,zhoverformat:n.zhoverformat},a,{zmin:s({},a.zmin,{editType:"calc"}),zmax:s({},a.zmax,{editType:"calc"})},{colorbar:o})},{"../../components/colorbar/attributes":599,"../../components/colorscale/attributes":604,"../../lib/extend":713,"../contour/attributes":930,"../histogram2d/attributes":991}],998:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../histogram2d/sample_defaults"),a=t("../contour/contours_defaults"),o=t("../contour/style_defaults"),s=t("./attributes");e.exports=function(t,e,r,l){function c(r,i){return n.coerce(t,e,s,r,i)}i(t,e,c,l),!1!==e.visible&&(a(t,e,c,function(r){return n.coerce2(t,e,s,r)}),o(t,e,c,l))}},{"../../lib":724,"../contour/contours_defaults":937,"../contour/style_defaults":951,"../histogram2d/sample_defaults":996,"./attributes":997}],999:[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").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":781,"../contour/calc":931,"../contour/colorbar":933,"../contour/hover":943,"../contour/plot":948,"../contour/style":950,"./attributes":997,"./defaults":998}],1000:[function(t,e,r){"use strict";var n=t("../../components/colorscale/color_attributes"),i=t("../../components/colorscale/attributes"),a=t("../../components/colorbar/attributes"),o=t("../surface/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat;e.exports=l(n("","calc",!1),{x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},opacity:o.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:l({},o.contours.x.show,{}),color:o.contours.x.color,width:o.contours.x.width,editType:"calc"},showscale:i.showscale,colorbar:a,lightposition:{x:l({},o.lightposition.x,{dflt:1e5}),y:l({},o.lightposition.y,{dflt:1e5}),z:l({},o.lightposition.z,{dflt:0}),editType:"calc"},lighting:l({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},o.lighting),hoverinfo:l({},s.hoverinfo,{editType:"calc"})})},{"../../components/colorbar/attributes":599,"../../components/colorscale/attributes":604,"../../components/colorscale/color_attributes":606,"../../lib/extend":713,"../../plots/attributes":768,"../surface/attributes":1122}],1001:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.intensity&&n(e,e.intensity,"","c")}},{"../../components/colorscale/calc":605}],1002:[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,c=r.cmin,u=r.cmax,f=r.intensity||[];if(n(c)||(c=i.aggNums(Math.min,null,f)),n(u)||(u=i.aggNums(Math.max,null,f)),t._fullLayout._infolayer.selectAll("."+l).remove(),r.showscale){var h=e[0].t.cb=s(t,l),d=o.makeColorScaleFunc(o.extractScale(r.colorscale,c,u),{noNumericCheck:!0});h.fillcolor(d).filllevels({start:c,end:u,size:(u-c)/254}).options(r.colorbar)()}else a.autoMargin(t,l)}},{"../../components/colorbar/draw":602,"../../components/colorscale":613,"../../lib":724,"../../plots/plots":833,"fast-isnumeric":140}],1003:[function(t,e,r){"use strict";var n=t("gl-mesh3d"),i=t("tinycolor2"),a=t("delaunay-triangulate"),o=t("alpha-shape"),s=t("convex-hull"),l=t("../../lib/str2rgbarray");function c(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var u=c.prototype;function f(t){return t.map(l)}function h(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}u.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.text;return Array.isArray(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},u.update=function(t){var e=this.scene,r=e.fullSceneLayout;function n(t,e,r,n){return e.map(function(e){return t.d2l(e,0,n)*r})}this.data=t;var c,u=h(n(r.xaxis,t.x,e.dataScale[0],t.xcalendar),n(r.yaxis,t.y,e.dataScale[1],t.ycalendar),n(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k)c=h(t.i,t.j,t.k);else if(0===t.alphahull)c=s(u);else if(t.alphahull>0)c=o(t.alphahull,u);else{var d=["x","y","z"].indexOf(t.delaunayaxis);c=a(u.map(function(t){return[t[(d+1)%3],t[(d+2)%3]]}))}var p={positions:u,cells:c,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:l(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color="#fff",p.vertexIntensity=t.intensity,p.vertexIntensityBounds=[t.cmin,t.cmax],p.colormap=t.colorscale.map(function(t){var e=t[0],r=i(t[1]).toRgb();return{index:e,rgb:[r.r,r.g,r.b,1]}})):t.vertexcolor?(this.color=t.vertexcolor[0],p.vertexColors=f(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],p.cellColors=f(t.facecolor)):(this.color=t.color,p.meshColor=l(t.color)),this.mesh.update(p)},u.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var r=t.glplot.gl,i=n({gl:r}),a=new c(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}},{"../../lib/str2rgbarray":746,"alpha-shape":47,"convex-hull":109,"delaunay-triangulate":130,"gl-mesh3d":201,tinycolor2:526}],1004:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/colorscale/defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,n){return i.coerce(t,e,o,r,n)}function c(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 u=c(["x","y","z"]),f=c(["i","j","k"]);u?(f&&f.forEach(function(t){for(var e=0;e<t.length;++e)t[e]|=0}),n.getComponentMethod("calendars","handleTraceDefaults")(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"),a(t,e,s,l,{prefix:"",cLetter:"c"})):(e.showscale=!1,"facecolor"in t?l("facecolor"):"vertexcolor"in t?l("vertexcolor"):l("color",r)),l("text")):e.visible=!1}},{"../../components/colorscale/defaults":608,"../../lib":724,"../../registry":854,"./attributes":1e3}],1005:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.colorbar=t("./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":813,"./attributes":1e3,"./calc":1001,"./colorbar":1002,"./convert":1003,"./defaults":1004}],1006:[function(t,e,r){"use strict";var n=t("../../lib").extendFlat,i=t("../scatter/attributes"),a=t("../../components/drawing/attributes").dash,o=i.line;function s(t){return{name:{valType:"string",editType:"style"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},line:{color:n({},o.color,{dflt:t}),width:o.width,dash:a,editType:"style"},editType:"style"}}e.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},open:{valType:"data_array",dflt:[],editType:"calc"},high:{valType:"data_array",dflt:[],editType:"calc"},low:{valType:"data_array",dflt:[],editType:"calc"},close:{valType:"data_array",dflt:[],editType:"calc"},line:{width:n({},o.width,{}),dash:n({},a,{}),editType:"style"},increasing:s("#3D9970"),decreasing:s("#FF4136"),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calcIfAutorange"}}},{"../../components/drawing/attributes":622,"../../lib":724,"../scatter/attributes":1048}],1007:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./ohlc_defaults"),a=t("./direction_defaults"),o=t("./attributes"),s=t("./helpers");function l(t,e,r,n){a(t,e,r,n),r(n+".line.color"),r(n+".line.width",e.line.width),r(n+".line.dash",e.line.dash)}e.exports=function(t,e,r,a){function c(r,i){return n.coerce(t,e,o,r,i)}s.pushDummyTransformOpts(t,e),0!==i(t,e,c,a)?(c("line.width"),c("line.dash"),l(t,e,c,"increasing"),l(t,e,c,"decreasing"),c("text"),c("tickwidth")):e.visible=!1}},{"../../lib":724,"./attributes":1006,"./direction_defaults":1008,"./helpers":1009,"./ohlc_defaults":1011}],1008:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){r(n+".showlegend"),!1===t.showlegend&&(e[n].showlegend=!1),r(n+".name",e.name+" - "+n)}},{}],1009:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=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 n=i.extendFlat([],t.transforms);return n[e.transformIndex]={type:t.type,direction:r,open:t.open,high:t.high,low:t.low,close:t.close},n},r.getFilterFn=function(t){return new function(t){var e=!0,r=null;function i(t,n){return t===n?n>r?e=!0:n<r&&(e=!1):e=t<n,r=n,e}return"increasing"===t?function(t,e){return n(t)&&n(e)&&i(+t,+e)}:function(t,e){return n(t)&&n(e)&&!i(+t,+e)}}(t)},r.addRangeSlider=function(t,e){for(var r=!1,n=0;n<t.length;n++)if(!0===t[n].visible){r=!0;break}r&&(e.xaxis||(e.xaxis={}),e.xaxis.rangeslider||(e.xaxis.rangeslider={}))}},{"../../lib":724,"fast-isnumeric":140}],1010:[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":760,"../../plots/cartesian":781,"../scatter":1060,"./attributes":1006,"./defaults":1007,"./transform":1012}],1011:[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"),c=r("low"),u=r("close");return n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x"],i),a=Math.min(s.length,l.length,c.length,u.length),o&&(a=Math.min(a,o.length))<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<c.length&&(e.low=c.slice(0,a)),a<u.length&&(e.close=u.slice(0,a)),a}},{"../../registry":854}],1012:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=i._,o=t("./helpers"),s=t("../../plots/cartesian/axes"),l=t("../../plots/cartesian/axis_ids");function c(t,e,r){var n={type:"scatter",mode:"lines",connectgaps:!1,visible:t.visible,opacity:t.opacity,xaxis:t.xaxis,yaxis:t.yaxis,hoverinfo:function(t){var e=t.hoverinfo;if("all"===e)return"x+text+name";var r=e.split("+"),n=r.indexOf("y"),i=r.indexOf("text");-1!==n&&(r.splice(n,1),-1===i&&r.push("text"));return r.join("+")}(t),transforms:o.makeTransform(t,e,r)},a=t[r];return a&&i.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}r.moduleType="transform",r.name="ohlc",r.attributes={},r.supplyDefaults=function(t,e,r,n){return o.clearEphemeralTransformOpts(n),o.copyOHLC(t,e),t},r.transform=function(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n];"ohlc"===i.type?r.push(c(i,e,"increasing"),c(i,e,"decreasing")):r.push(i)}return o.addRangeSlider(r,e.layout),r},r.calcTransform=function(t,e,r){var c,u=r.direction,f=o.getFilterFn(u),h=l.getFromTrace(t,e,"x"),d=l.getFromTrace(t,e,"y"),p=function(t,e,r){var n=r._fullInput,a=n.tickwidth,o=n._minDiff;if(!o){var s,l=t._fullData,c=[];for(o=1/0,s=0;s<l.length;s++){var u=l[s]._fullInput;if("ohlc"===u.type&&!0===u.visible&&u.xaxis===e._id&&(c.push(u),u.x&&u.x.length>1)){var f=i.simpleMap(u.x,e.d2c,0,r.xcalendar),h=i.distinctVals(f).minDiff;o=Math.min(o,h)}}for(o===1/0&&(o=1),s=0;s<c.length;s++)c[s]._minDiff=o}return o*a}(t,h,e),m=e.open,v=e.high,g=e.low,y=e.close,b=e.text,x=a(t,"open:")+" ",_=a(t,"high:")+" ",w=a(t,"low:")+" ",M=a(t,"close:")+" ",k=m.length,A=[],T=[],E=[];c=e._fullInput.x?function(t){var r=e.x[t],n=e.xcalendar,i=h.d2c(r,0,n);A.push(h.c2d(i-p,0,n),r,r,r,r,h.c2d(i+p,0,n),null)}:function(t){A.push(t-p,t,t,t,t,t+p,null)};for(var S,L,C,P,z=function(t,e){return s.tickText(t,t.c2l(e),"hover").text},O=e._fullInput.hoverinfo,D=O.split("+"),I="all"===O,R=I||-1!==D.indexOf("y"),N=I||-1!==D.indexOf("text"),F=Array.isArray(b)?function(t){return b[t]||""}:function(){return b},j=function(t,e,r,n,i){var a=[];R&&(a.push(x+z(d,e)),a.push(_+z(d,r)),a.push(w+z(d,n)),a.push(M+z(d,i))),N&&a.push(F(t));var o=a.join("<br>");E.push(o,o,o,o,o,o,null)},B=0;B<k;B++)f(m[B],y[B])&&n(v[B])&&n(g[B])&&(c(B),S=m[B],L=v[B],C=g[B],P=y[B],T.push(S,S,L,C,P,P,null),j(B,m[B],v[B],g[B],y[B]));e.x=A,e.y=T,e.text=E,e._length=A.length}},{"../../lib":724,"../../plots/cartesian/axes":770,"../../plots/cartesian/axis_ids":773,"./helpers":1009,"fast-isnumeric":140}],1013:[function(t,e,r){"use strict";var n=t("../../components/colorscale/color_attributes"),i=t("../../components/colorbar/attributes"),a=t("../../components/colorscale/scales"),o=t("../../plots/cartesian/layout_attributes"),s=t("../../plots/font_attributes"),l=t("../../plots/domain_attributes"),c=t("../../lib/extend"),u=c.extendDeepAll,f=c.extendFlat;e.exports={domain:l({name:"parcoords",trace:!0,editType:"calc"}),labelfont:s({editType:"calc"}),tickfont:s({editType:"calc"}),rangefont:s({editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},tickvals:f({},o.tickvals,{editType:"calc"}),ticktext:f({},o.ticktext,{editType:"calc"}),tickformat:{valType:"string",dflt:"3s",editType:"calc"},visible:{valType:"boolean",dflt:!0,editType:"calc"},range:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},constraintrange:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},editType:"calc"},line:f(u(n("line","calc"),{colorscale:{dflt:a.Viridis},autocolorscale:{dflt:!1}}),{showscale:{valType:"boolean",dflt:!1,editType:"calc"},colorbar:i,editType:"calc"})}},{"../../components/colorbar/attributes":599,"../../components/colorscale/color_attributes":606,"../../components/colorscale/scales":617,"../../lib/extend":713,"../../plots/cartesian/layout_attributes":782,"../../plots/domain_attributes":796,"../../plots/font_attributes":797}],1014:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../constants/xmlns_namespaces");r.name="parcoords",r.plot=function(t){var e=i(t.calcdata,"parcoords");e.length&&a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("parcoords"),a=e._has&&e._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container");r.filter(function(t,e){return e===r.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus").each(function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:o.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.width,height:this.height})}),window.setTimeout(function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}},{"../../constants/xmlns_namespaces":704,"../../plots/get_data":807,"./plot":1022,d3:128}],1015:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("../../lib"),o=t("../../lib/gup").wrap;e.exports=function(t,e){var r=!!e.line.colorscale&&a.isArray(e.line.color),s=r?e.line.color:Array.apply(0,Array(e.dimensions.reduce(function(t,e){return Math.max(t,e.values.length)},0))).map(function(){return.5}),l=r?e.line.colorscale:[[0,e.line.color],[1,e.line.color]];return n(e,"line")&&i(e,e.line.color,"line","c"),o({lineColor:s,cscale:l})}},{"../../components/colorscale/calc":605,"../../components/colorscale/has_colorscale":612,"../../lib":724,"../../lib/gup":721}],1016:[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.line,c="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+c).remove(),void 0!==l&&l.showscale){var u=l.color,f=l.cmin,h=l.cmax;n(f)||(f=i.aggNums(Math.min,null,u)),n(h)||(h=i.aggNums(Math.max,null,u));var d=e[0].t.cb=s(t,c),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,f,h),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:f,end:h,size:(h-f)/254}).options(l.colorbar)()}else a.autoMargin(t,c)}},{"../../components/colorbar/draw":602,"../../components/colorscale":613,"../../lib":724,"../../plots/plots":833,"fast-isnumeric":140}],1017:[function(t,e,r){"use strict";e.exports={maxDimensionCount:60,overdrag:45,verticalPadding:2,tickDistance:50,canvasPixelRatio:1,blockLineCount:5e3,scatter:!1,layers:["contextLineLayer","focusLineLayer","pickLineLayer"],axisTitleOffset:28,axisExtentOffset:10,bar:{width:4,capturewidth:10,fillcolor:"magenta",fillopacity:1,strokecolor:"white",strokeopacity:1,strokewidth:1,handleheight:16,handleopacity:1,handleoverlap:0},cn:{axisExtentText:"axis-extent-text",parcoordsLineLayers:"parcoords-line-layers",parcoordsLineLayer:"parcoords-lines",parcoords:"parcoords",parcoordsControlView:"parcoords-control-view",yAxis:"y-axis",axisOverlays:"axis-overlays",axis:"axis",axisHeading:"axis-heading",axisTitle:"axis-title",axisExtent:"axis-extent",axisExtentTop:"axis-extent-top",axisExtentTopText:"axis-extent-top-text",axisExtentBottom:"axis-extent-bottom",axisExtentBottomText:"axis-extent-bottom-text",axisBrush:"axis-brush"},id:{filterBarPattern:"filter-bar-pattern"}}},{}],1018:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/defaults"),s=t("./constants").maxDimensionCount;e.exports=function(t,e,r,l){function c(r,a){return n.coerce(t,e,i,r,a)}var u=function(t,e){var r,a,o,l=t.dimensions||[],c=e.dimensions=[],u=1/0;function f(t,e){return n.coerce(r,a,i.dimensions,t,e)}for(l.length>s&&(n.log("parcoords traces support up to "+s+" dimensions at the moment"),l.splice(s)),o=0;o<l.length;o++)r=l[o],a={},n.isPlainObject(r)&&(f("visible",f("values").length>0)&&(f("label"),f("tickvals"),f("ticktext"),f("tickformat"),f("range"),f("constraintrange"),u=Math.min(u,a.values.length)),a._index=o,c.push(a));if(isFinite(u))for(o=0;o<c.length;o++)(a=c[o]).visible&&a.values.length>u&&(a.values=a.values.slice(0,u));return c}(t,e);!function(t,e,r,i,s){s("line.color",r),a(t,"line")&&n.isArray(t.line.color)?(s("line.colorscale"),o(t,e,i,s,{prefix:"line.",cLetter:"c"})):s("line.color",r)}(t,e,r,l,c),c("domain.x"),c("domain.y"),Array.isArray(u)&&u.length||(e.visible=!1);var f={family:l.font.family,size:Math.round(l.font.size*(10/12)),color:l.font.color};n.coerceFont(c,"labelfont",f),n.coerceFont(c,"tickfont",f),n.coerceFont(c,"rangefont",f)}},{"../../components/colorscale/defaults":608,"../../components/colorscale/has_colorscale":612,"../../lib":724,"./attributes":1013,"./constants":1017}],1019:[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.moduleType="trace",n.name="parcoords",n.basePlotModule=t("./base_plot"),n.categories=["gl","regl","noOpacity"],n.meta={},e.exports=n},{"./attributes":1013,"./base_plot":1014,"./calc":1015,"./colorbar":1016,"./defaults":1018,"./plot":1022}],1020:[function(t,e,r){"use strict";var n=t("glslify"),i=t("./constants"),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\n\nuniform vec2 colorClamp;\n\nuniform float scatter;\n\nvarying vec4 fragColor;\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit, unit);\n}\n\nvoid main() {\n\n float x = 0.5 * sign(pf[3]) + 0.5;\n float prominence = abs(pf[3]);\n float depth = 1.0 - prominence;\n\n mat4 pA = mat4(p0, p1, p2, p3);\n mat4 pB = mat4(p4, p5, p6, p7);\n mat4 pC = mat4(p8, p9, pa, pb);\n mat4 pD = mat4(pc, pd, pe, abs(pf));\n\n float show = float(mshow(pA, loA, hiA) &&\n mshow(pB, loB, hiB) &&\n mshow(pC, loC, hiC) &&\n mshow(pD, loD, hiD));\n\n vec2 yy = show * vec2(val(pA, dim2A) + val(pB, dim2B) + val(pC, dim2C) + val(pD, dim2D),\n val(pA, dim1A) + val(pB, dim1B) + val(pC, dim1C) + val(pD, dim1D));\n\n vec2 dimensionToggle = vec2(x, 1.0 - x);\n\n vec2 scatterToggle = vec2(scatter, 1.0 - scatter);\n\n float y = dot(yy, dimensionToggle);\n mat2 xy = mat2(viewBoxSize * yy + dimensionToggle, viewBoxSize * vec2(x, y));\n\n vec2 viewBoxXY = viewBoxPosition + xy * scatterToggle;\n\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n gl_Position = vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n\n // visible coloring\n float clampedColorIndex = clamp((prominence - colorClamp[0]) / (colorClamp[1] - colorClamp[0]), 0.0, 1.0);\n fragColor = texture2D(palette, vec2((clampedColorIndex * 255.0 + 0.5) / 256.0, 0.5));\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\n\nuniform vec2 colorClamp;\n\nuniform float scatter;\n\nvarying vec4 fragColor;\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit, unit);\n}\n\nvoid main() {\n\n float x = 0.5 * sign(pf[3]) + 0.5;\n float prominence = abs(pf[3]);\n float depth = 1.0 - prominence;\n\n mat4 pA = mat4(p0, p1, p2, p3);\n mat4 pB = mat4(p4, p5, p6, p7);\n mat4 pC = mat4(p8, p9, pa, pb);\n mat4 pD = mat4(pc, pd, pe, abs(pf));\n\n float show = float(mshow(pA, loA, hiA) &&\n mshow(pB, loB, hiB) &&\n mshow(pC, loC, hiC) &&\n mshow(pD, loD, hiD));\n\n vec2 yy = show * vec2(val(pA, dim2A) + val(pB, dim2B) + val(pC, dim2C) + val(pD, dim2D),\n val(pA, dim1A) + val(pB, dim1B) + val(pC, dim1C) + val(pD, dim1D));\n\n vec2 dimensionToggle = vec2(x, 1.0 - x);\n\n vec2 scatterToggle = vec2(scatter, 1.0 - scatter);\n\n float y = dot(yy, dimensionToggle);\n mat2 xy = mat2(viewBoxSize * yy + dimensionToggle, viewBoxSize * vec2(x, y));\n\n vec2 viewBoxXY = viewBoxPosition + xy * scatterToggle;\n\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n gl_Position = vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n\n // pick coloring\n fragColor = vec4(pf.rgb, 1.0);\n}\n"]),s=n(["precision lowp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n"]),l=1e-6,c=64,u=2,f=4,h=[119,119,119],d=new Uint8Array(4),p=new Uint8Array(4);function m(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function v(t,e,r,n,i,a){var o=a.key;r.drawCompleted||(!function(t){t.read({x:0,y:0,width:1,height:1,data:d})}(t),r.drawCompleted=!0),function s(l){var c;c=Math.min(n,i-l*n),a.offset=u*l*n,a.count=u*c,0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],m(t,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),r.clearOnly||(e(a),l*n+c<i&&(r.currentRafs[o]=window.requestAnimationFrame(function(){s(l+1)})),r.drawCompleted=!1)}(0)}function g(t,e){return(t>>>8*e)%256/255}function y(t,e){var r={};return[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15].map(function(r){return function(t,e,r){var n,i,a,o=[];for(i=0;i<t;i++)for(a=0;a<u;a++)for(n=0;n<f;n++)o.push(e[i*c+r*f+n]),r*f+n===c-1&&a%2==0&&(o[o.length-1]*=-1);return o}(t,e,r)}).forEach(function(t,e){r["p"+e.toString(16)]=t}),r}function b(t,e,r){return t+e<=r}e.exports=function(t,e,r){var n=e.model,u=e.viewModel,f=n.domain,d=n.lines,x=n.canvasWidth,_=n.canvasHeight,w=u.dimensions,M=u.panels,k=n.unitToColor,A=e.context,T=e.pick,E={currentRafs:{},drawCompleted:!0,clearOnly:!1},S=w.slice(),L=S.length,C=S[0]?S[0].values.length:0,P=A,z=T?d.color.map(function(t,e){return e/d.color.length}):d.color,O=Math.max(1/255,Math.pow(1/z.length,1/3)),D=d.canvasOverdrag,I=M.length,R=function(t,e,r,n){for(var i,a=[],o=0;o<t;o++)for(var s=0;s<c;s++)a.push(s<e?r[s].paddedUnitValues[o]:s===c-1?(i=n[o],Math.max(l,Math.min(1-l,i))):s>=c-4?g(o,c-2-s):.5);return a}(C,L,S,z),N=y(C,R),F=e.regl,j=F.texture({shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest",data:function(t,e,r){for(var n=[],i=0;i<256;i++){var a=t(i/255);n.push((e?h:a).concat(r))}return n}(k,A,Math.round(255*(A?O:1)))}),B=F({profile:!1,blend:{enable:P,func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:1,dstAlpha:1},equation:{rgb:"add",alpha:"add"},color:[0,0,0,0]},depth:{enable:!P,mask:!0,func:"less",range:[0,1]},cull:{enable:!0,face:"back"},scissor:{enable:!0,box:{x:F.prop("scissorX"),y:F.prop("scissorY"),width:F.prop("scissorWidth"),height:F.prop("scissorHeight")}},viewport:{x:F.prop("viewportX"),y:F.prop("viewportY"),width:F.prop("viewportWidth"),height:F.prop("viewportHeight")},dither:!1,vert:T?o:a,frag:s,primitive:"lines",lineWidth:1,attributes:N,uniforms:{resolution:F.prop("resolution"),viewBoxPosition:F.prop("viewBoxPosition"),viewBoxSize:F.prop("viewBoxSize"),dim1A:F.prop("dim1A"),dim2A:F.prop("dim2A"),dim1B:F.prop("dim1B"),dim2B:F.prop("dim2B"),dim1C:F.prop("dim1C"),dim2C:F.prop("dim2C"),dim1D:F.prop("dim1D"),dim2D:F.prop("dim2D"),loA:F.prop("loA"),hiA:F.prop("hiA"),loB:F.prop("loB"),hiB:F.prop("hiB"),loC:F.prop("loC"),hiC:F.prop("hiC"),loD:F.prop("loD"),hiD:F.prop("hiD"),palette:j,colorClamp:F.prop("colorClamp"),scatter:F.prop("scatter")},offset:F.prop("offset"),count:F.prop("count")}),U=[0,1];var V=[];function q(t,e,r,a,o,s,l,c,u,h,d){var p,m,v,g,y=[t,e],w=i.verticalPadding/s,M=[0,1].map(function(){return[0,1,2,3].map(function(){return new Float32Array(16)})}),k=[0,1].map(function(){return[0,1,2,3].map(function(){return new Float32Array(16)})});for(p=0;p<2;p++)for(g=y[p],m=0;m<4;m++)for(v=0;v<16;v++){var T=v+16*m;M[p][m][v]=v+16*m===g?1:0,k[p][m][v]=(!A&&b(v,16*m,I)?S[0===T?0:1+(T-1)%(S.length-1)].filter[p]:p)+(2*p-1)*w}return{key:l,resolution:[x,_],viewBoxPosition:[r+D,a],viewBoxSize:[o,s],i:t,ii:e,dim1A:M[0][0],dim1B:M[0][1],dim1C:M[0][2],dim1D:M[0][3],dim2A:M[1][0],dim2B:M[1][1],dim2C:M[1][2],dim2D:M[1][3],loA:k[0][0],loB:k[0][1],loC:k[0][2],loD:k[0][3],hiA:k[1][0],hiB:k[1][1],hiC:k[1][2],hiD:k[1][3],colorClamp:U,scatter:c||0,scissorX:(u===h?0:r+D)+(n.pad.l-D)+n.layoutWidth*f.x[0],scissorWidth:(u===d?x-r+D:o+.5)+(u===h?r+D:0),scissorY:a+n.pad.b+n.layoutHeight*f.y[0],scissorHeight:s,viewportX:n.pad.l-D+n.layoutWidth*f.x[0],viewportY:n.pad.b+n.layoutHeight*f.y[0],viewportWidth:x,viewportHeight:_}}return{setColorDomain:function(t){U[0]=t[0],U[1]=t[1]},render:function(t,e,n){var i,a,o,s=1/0,l=-1/0;for(i=0;i<I;i++)t[i].dim2.canvasX>l&&(l=t[i].dim2.canvasX,o=i),t[i].dim1.canvasX<s&&(s=t[i].dim1.canvasX,a=i);for(0===I&&m(F,0,0,x,_),i=0;i<I;i++){var c=t[i],u=c.dim1,f=u.crossfilterDimensionIndex,h=c.canvasX,p=c.canvasY,g=c.dim2.crossfilterDimensionIndex,y=c.panelSizeX,b=c.panelSizeY,w=h+y;if(e||!V[f]||V[f][0]!==h||V[f][1]!==w){V[f]=[h,w];var M=q(f,g,h,p,y,b,u.crossfilterDimensionIndex,r||u.scatter?1:0,i,a,o);E.clearOnly=n,v(F,B,E,e?d.blockLineCount:C,C,M)}}},readPixel:function(t,e){return F.read({x:t,y:e,width:1,height:1,data:p}),p},readPixels:function(t,e,r,n){var i=new Uint8Array(4*r*n);return F.read({x:t,y:e,width:r,height:n,data:i}),i},destroy:function(){t.style["pointer-events"]="none",j.destroy()}}}},{"./constants":1017,glslify:253}],1021:[function(t,e,r){"use strict";var n=t("./lines"),i=t("./constants"),a=t("../../lib"),o=t("d3"),s=t("../../components/drawing"),l=t("../../lib/gup").keyFun,c=t("../../lib/gup").repeat,u=t("../../lib/gup").unwrap;function f(t){return!("visible"in t)||t.visible}function h(t){var e=t.range?t.range[0]:o.min(t.values),r=t.range?t.range[1]:o.max(t.values);return!isNaN(e)&&isFinite(e)||(e=0),!isNaN(r)&&isFinite(r)||(r=0),e===r&&(void 0===e?(e=0,r=1):0===e?(e-=1,r+=1):(e*=.9,r*=1.1)),[e,r]}function d(t,e){var r,n,i,a,o;for(r=0,i=1/0,a=(n=t.range())[0];r<n.length;r++){if((o=Math.abs(n[r]-e))>i)return a;i=o,a=n[r]}return n[n.length-1]}function p(t){return o.scale.linear().domain(h(t))}function m(t,e,r){var n=u(e),s=n.trace,l=n.lineColor,c=n.cscale,h=s.line,d=s.domain,m=s.dimensions,v=t.width,g=s.labelfont,y=s.tickfont,b=s.rangefont,x=a.extendDeep({},h,{color:l.map(p({values:l,range:[h.cmin,h.cmax]})),blockLineCount:i.blockLineCount,canvasOverdrag:i.overdrag*i.canvasPixelRatio}),_=Math.floor(v*(d.x[1]-d.x[0])),w=Math.floor(t.height*(d.y[1]-d.y[0])),M=t.margin||{l:80,r:80,t:100,b:80},k=_,A=w;return{key:r,colCount:m.filter(f).length,dimensions:m,tickDistance:i.tickDistance,unitToColor:function(t){var e=t.map(function(t){return t[0]}),r=t.map(function(t){return t[1]}).map(function(t){return o.rgb(t)}),n="rgb".split("").map(function(t){return o.scale.linear().clamp(!0).domain(e).range(r.map((n=t,function(t){return t[n]})));var n});return function(t){return n.map(function(e){return e(t)})}}(c),lines:x,labelFont:g,tickFont:y,rangeFont:b,layoutWidth:v,layoutHeight:t.height,domain:d,translateX:d.x[0]*v,translateY:t.height-d.y[1]*t.height,pad:M,canvasWidth:k*i.canvasPixelRatio+2*x.canvasOverdrag,canvasHeight:A*i.canvasPixelRatio,width:k,height:A,canvasPixelRatio:i.canvasPixelRatio}}function v(t){var e=t.width,r=t.height,n=t.dimensions,a=t.canvasPixelRatio,s=function(r){return e*r/Math.max(1,t.colCount-1)},l=i.verticalPadding/(r*a),c=1-2*l,u=function(t){return l+c*t},d={key:t.key,xScale:s,model:t},m={};return d.dimensions=n.filter(f).map(function(e,n){var l=p(e),c=m[e.label];return m[e.label]=(c||0)+1,{key:e.label+(c?"__"+c:""),label:e.label,tickFormat:e.tickformat,tickvals:e.tickvals,ticktext:e.ticktext,ordinal:!!e.tickvals,scatter:i.scatter||e.scatter,xIndex:n,crossfilterDimensionIndex:n,visibleIndex:e._index,height:r,values:e.values,paddedUnitValues:e.values.map(l).map(u),xScale:s,x:s(n),canvasX:s(n)*a,unitScale:function(t,e){return o.scale.linear().range([t-e,e])}(r,i.verticalPadding),domainScale:function(t,e,r){var n=h(r),i=r.ticktext;return r.tickvals?o.scale.ordinal().domain(r.tickvals.map(function(t,e){return function(r,n){if(e){var i=e[n];return null===i||void 0===i?t(r):i}return t(r)}}(o.format(r.tickformat),i))).range(r.tickvals.map(function(t){return(t-n[0])/(n[1]-n[0])}).map(function(r){return t-e+r*(e-(t-e))})):o.scale.linear().domain(n).range([t-e,e])}(r,i.verticalPadding,e),ordinalScale:function(t){var e=h(t);return t.tickvals&&o.scale.ordinal().domain(t.tickvals).range(t.tickvals.map(function(t){return(t-e[0])/(e[1]-e[0])}))}(e),domainToUnitScale:l,filter:e.constraintrange?e.constraintrange.map(l):[0,1],parent:d,model:t}}),d}function g(t){t.classed(i.cn.axisExtentText,!0).attr("text-anchor","middle").style("cursor","default").style("user-select","none")}e.exports=function(t,e,r,f,h,p){var y=!1,b=!0;var x=f.filter(function(t){return u(t).trace.visible}).map(m.bind(0,h)).map(v);r.each(function(t,e){return a.extendFlat(t,x[e])});var _=r.selectAll(".gl-canvas").each(function(t){t.viewModel=x[0],t.model=t.viewModel?t.viewModel.model:null}),w={renderers:[],dimensions:[]},M=null;_.filter(function(t){return t.pick}).style("pointer-events","auto").on("mousemove",function(t){if(b&&t.lineLayer&&p&&p.hover){var e=o.event,r=this.width,n=this.height,i=o.mouse(this),a=i[0],s=i[1];if(a<0||s<0||a>=r||s>=n)return;var l=t.lineLayer.readPixel(a,n-1-s),c=0!==l[3],u=c?l[2]+256*(l[1]+256*l[0]):null,f={x:a,y:s,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:u};u!==M&&(c?p.hover(f):p.unhover&&p.unhover(f),M=u)}}),_.style("opacity",function(t){return t.pick?.01:1}),e.style("background","rgba(255, 255, 255, 0)");var k=e.selectAll("."+i.cn.parcoords).data(x,l);k.exit().remove(),k.enter().append("g").classed(i.cn.parcoords,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","none").call(function(t){var e=t.selectAll("defs").data(c,l);e.enter().append("defs");var r=e.selectAll("#"+i.id.filterBarPattern).data(c,l);r.enter().append("pattern").attr("id",i.id.filterBarPattern).attr("patternUnits","userSpaceOnUse"),r.attr("x",-i.bar.width).attr("width",i.bar.capturewidth).attr("height",function(t){return t.model.height});var n=r.selectAll("rect").data(c,l);n.enter().append("rect").attr("shape-rendering","crispEdges"),n.attr("height",function(t){return t.model.height}).attr("width",i.bar.width).attr("x",i.bar.width/2).attr("fill",i.bar.fillcolor).attr("fill-opacity",i.bar.fillopacity).attr("stroke",i.bar.strokecolor).attr("stroke-opacity",i.bar.strokeopacity).attr("stroke-width",i.bar.strokewidth)}),k.attr("width",function(t){return t.model.width+t.model.pad.l+t.model.pad.r}).attr("height",function(t){return t.model.height+t.model.pad.t+t.model.pad.b}).attr("transform",function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"});var A=k.selectAll("."+i.cn.parcoordsControlView).data(c,l);A.enter().append("g").classed(i.cn.parcoordsControlView,!0).style("box-sizing","content-box"),A.attr("transform",function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"});var T=A.selectAll("."+i.cn.yAxis).data(function(t){return t.dimensions},l);function E(t){return t.dimensions.some(function(t){return 0!==t.filter[0]||1!==t.filter[1]})}function S(t,e){return(i.scatter?function(t,e){for(var r=e.panels||(e.panels=[]),n=t.each(function(t){return t})[e.key].map(function(t){return t.__data__}),i=n.length-1,a=i,o=0;o<i;o++)for(var s=0;s<i;s++){var l=r[s+o*i]||(r[s+o*i]={}),c=n[s],u=n[s+1];l.dim1=n[o+1],l.dim2=u,l.canvasX=c.canvasX,l.panelSizeX=u.canvasX-c.canvasX,l.panelSizeY=e.model.canvasHeight/a,l.y=o*l.panelSizeY,l.canvasY=e.model.canvasHeight-l.y-l.panelSizeY}}:function(t,e){for(var r=e.panels||(e.panels=[]),n=t.each(function(t){return t})[e.key].map(function(t){return t.__data__}),i=n.length-1,a=0;a<1;a++)for(var o=0;o<i;o++){var s=r[o+a*i]||(r[o+a*i]={}),l=n[o],c=n[o+1];s.dim1=l,s.dim2=c,s.canvasX=l.canvasX,s.panelSizeX=c.canvasX-l.canvasX,s.panelSizeY=e.model.canvasHeight/1,s.y=a*s.panelSizeY,s.canvasY=e.model.canvasHeight-s.y-s.panelSizeY}})(t,e)}T.enter().append("g").classed(i.cn.yAxis,!0).each(function(t){w.dimensions.push(t)}),A.each(function(t){S(T,t)}),_.filter(function(t){return!!t.viewModel}).each(function(t){t.lineLayer=n(this,t,i.scatter),t.viewModel[t.key]=t.lineLayer,w.renderers.push(function(){t.lineLayer.render(t.viewModel.panels,!0)}),t.lineLayer.render(t.viewModel.panels,!t.context)}),T.attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),T.call(o.behavior.drag().origin(function(t){return t}).on("drag",function(t){var e=t.parent;b=!1,y||(t.x=Math.max(-i.overdrag,Math.min(t.model.width+i.overdrag,o.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,T.sort(function(t,e){return t.x-e.x}).each(function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio}),S(T,e),T.filter(function(e){return 0!==Math.abs(t.xIndex-e.xIndex)}).attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),o.select(this).attr("transform","translate("+t.x+", 0)"),T.each(function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)}),e.contextLayer&&e.contextLayer.render(e.panels,!1,!E(e)),e.focusLayer.render&&e.focusLayer.render(e.panels))}).on("dragend",function(t){var e=t.parent;y?"ending"===y&&(y=!1):(t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,S(T,e),o.select(this).attr("transform",function(t){return"translate("+t.x+", 0)"}),e.contextLayer&&e.contextLayer.render(e.panels,!1,!E(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),b=!0,p&&p.axesMoved&&p.axesMoved(e.key,e.dimensions.map(function(t){return t.crossfilterDimensionIndex})))})),T.exit().remove();var L=T.selectAll("."+i.cn.axisOverlays).data(c,l);L.enter().append("g").classed(i.cn.axisOverlays,!0),L.selectAll("."+i.cn.axis).remove();var C=L.selectAll("."+i.cn.axis).data(c,l);C.enter().append("g").classed(i.cn.axis,!0),C.each(function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,n=r.domain();o.select(this).call(o.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?n:null).tickFormat(t.ordinal?function(t){return t}:null).scale(r)),s.font(C.selectAll("text"),t.model.tickFont)}),C.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),C.selectAll("text").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default").style("user-select","none");var P=L.selectAll("."+i.cn.axisHeading).data(c,l);P.enter().append("g").classed(i.cn.axisHeading,!0);var z=P.selectAll("."+i.cn.axisTitle).data(c,l);z.enter().append("text").classed(i.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("user-select","none").style("pointer-events","auto"),z.attr("transform","translate(0,"+-i.axisTitleOffset+")").text(function(t){return t.label}).each(function(t){s.font(z,t.model.labelFont)});var O=L.selectAll("."+i.cn.axisExtent).data(c,l);O.enter().append("g").classed(i.cn.axisExtent,!0);var D=O.selectAll("."+i.cn.axisExtentTop).data(c,l);D.enter().append("g").classed(i.cn.axisExtentTop,!0),D.attr("transform","translate(0,"+-i.axisExtentOffset+")");var I=D.selectAll("."+i.cn.axisExtentTopText).data(c,l);function R(t){return t.ordinal?function(){return""}:o.format(t.tickFormat)}I.enter().append("text").classed(i.cn.axisExtentTopText,!0).call(g),I.text(function(t){return R(t)(t.domainScale.domain().slice(-1)[0])}).each(function(t){s.font(I,t.model.rangeFont)});var N=O.selectAll("."+i.cn.axisExtentBottom).data(c,l);N.enter().append("g").classed(i.cn.axisExtentBottom,!0),N.attr("transform",function(t){return"translate(0,"+(t.model.height+i.axisExtentOffset)+")"});var F=N.selectAll("."+i.cn.axisExtentBottomText).data(c,l);F.enter().append("text").classed(i.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(g),F.text(function(t){return R(t)(t.domainScale.domain()[0])}).each(function(t){s.font(F,t.model.rangeFont)});var j=L.selectAll("."+i.cn.axisBrush).data(c,l),B=j.enter().append("g").classed(i.cn.axisBrush,!0);j.each(function(t){t.brush||(t.brush=o.svg.brush().y(t.unitScale).on("brushstart",q).on("brush",H).on("brushend",G),0===t.filter[0]&&1===t.filter[1]||t.brush.extent(t.filter),o.select(this).call(t.brush))}),B.selectAll("rect").attr("x",-i.bar.capturewidth/2).attr("width",i.bar.capturewidth),B.selectAll("rect.extent").attr("fill","url(#"+i.id.filterBarPattern+")").style("cursor","ns-resize").filter(function(t){return 0===t.filter[0]&&1===t.filter[1]}).attr("y",-100),B.selectAll(".resize rect").attr("height",i.bar.handleheight).attr("opacity",0).style("visibility","visible"),B.selectAll(".resize.n rect").style("cursor","n-resize").attr("y",i.bar.handleoverlap-i.bar.handleheight),B.selectAll(".resize.s rect").style("cursor","s-resize").attr("y",i.bar.handleoverlap);var U=!1,V=!1;function q(){U=!0,y=!0}function H(t){b=!1;var e=t.parent,r=t.brush.extent(),n=e.dimensions,i=n[t.xIndex].filter,a=U&&r[0]===r[1];a&&(t.brush.clear(),o.select(this).select("rect.extent").attr("y",-100));var s=a?[0,1]:r.slice();if(s[0]!==i[0]||s[1]!==i[1]){n[t.xIndex].filter=s,e.focusLayer&&e.focusLayer.render(e.panels,!0);var l=E(e);!V&&l?(e.contextLayer&&e.contextLayer.render(e.panels,!0),V=!0):V&&!l&&(e.contextLayer&&e.contextLayer.render(e.panels,!0,!0),V=!1)}U=!1}function G(t){var e=t.parent,r=t.brush.extent(),n=r[0]===r[1],i=e.dimensions[t.xIndex].filter;if(!n&&t.ordinal&&(i[0]=d(t.ordinalScale,i[0]),i[1]=d(t.ordinalScale,i[1]),i[0]===i[1]&&(i[0]=Math.max(0,i[0]-.05),i[1]=Math.min(1,i[1]+.05)),o.select(this).transition().duration(150).call(t.brush.extent(i)),e.focusLayer.render(e.panels,!0)),e.pickLayer&&e.pickLayer.render(e.panels,!0),b=!0,y="ending",p&&p.filterChanged){var a=t.domainToUnitScale.invert,s=i.map(a);p.filterChanged(e.key,t.visibleIndex,s)}}return w}},{"../../components/drawing":623,"../../lib":724,"../../lib/gup":721,"./constants":1017,"./lines":1020,d3:128}],1022:[function(t,e,r){(function(r){"use strict";var n=t("./parcoords"),i=t("regl");e.exports=function(t,e){var a=t._fullLayout,o=a._toppaper,s=a._paperdiv,l=a._glcontainer;a._glcanvas.each(function(e){e.regl||(e.regl=i({canvas:this,attributes:{antialias:!e.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio}))});var c={},u={},f=a._size;e.forEach(function(e,r){c[r]=t.data[r].dimensions,u[r]=t.data[r].dimensions.slice()});n(s,o,l,e,{width:f.w,height:f.h,margin:{t:f.t,r:f.r,b:f.b,l:f.l}},{filterChanged:function(e,r,n){var i=u[e][r],a=i.constraintrange;a&&2===a.length||(a=i.constraintrange=[]),a[0]=n[0],a[1]=n[1],t.emit("plotly_restyle")},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){function n(t){return!("visible"in t)||t.visible}function i(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}var a=function(t){return function(e,n){return i(r,t,e)-i(r,t,n)}}(u[e].filter(n));c[e].sort(a),u[e].filter(function(t){return!n(t)}).sort(function(t){return u[e].indexOf(t)}).forEach(function(t){c[e].splice(c[e].indexOf(t),1),c[e].splice(u[e].indexOf(t),0,t)}),t.emit("plotly_restyle")}})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./parcoords":1021,regl:486}],1023:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),i=t("../../plots/font_attributes"),a=t("../../plots/attributes"),o=t("../../plots/domain_attributes"),s=t("../../lib/extend").extendFlat,l=i({editType:"calc",colorEditType:"style"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:n.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:s({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},textfont:s({},l,{}),insidetextfont:s({},l,{}),outsidetextfont:s({},l,{}),domain:o({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}},{"../../components/color/attributes":597,"../../lib/extend":713,"../../plots/attributes":768,"../../plots/domain_attributes":796,"../../plots/font_attributes":797}],1024:[function(t,e,r){"use strict";var n=t("../../registry");r.name="pie",r.plot=function(t){var e=n.getModule("pie"),r=function(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n],a=i[0].trace;a._module===e&&!0===a.visible&&r.push(i)}return r}(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":854}],1025:[function(t,e,r){"use strict";var n,i=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../../components/color"),s=t("./helpers");function l(t,e){if(!n){var r=o.defaults;n=c(r)}var i=e||n;return i[t%i.length]}function c(t){var e,r=t.slice();for(e=0;e<t.length;e++)r.push(a(t[e]).lighten(20).toHexString());for(e=0;e<t.length;e++)r.push(a(t[e]).darken(20).toHexString());return r}e.exports=function(t,e){var r,n,u,f,h,d=e.values,p=Array.isArray(d)&&d.length,m=e.labels,v=e.marker.colors||[],g=[],y=t._fullLayout,b=y.colorway,x=y._piecolormap,_={},w=0,M=y.hiddenlabels||[];if(y._piecolorway||b===o.defaults||(y._piecolorway=c(b)),e.dlabel)for(m=new Array(d.length),r=0;r<d.length;r++)m[r]=String(e.label0+r*e.dlabel);function k(t,e){return!!t&&(!!(t=a(t)).isValid()&&(t=o.addOpacity(t,t.getAlpha()),x[e]||(x[e]=t),t))}var A=(p?d:m).length;for(r=0;r<A;r++){if(p){if(n=d[r],!i(n))continue;if((n=+n)<0)continue}else n=1;void 0!==(u=m[r])&&""!==u||(u=r);var T=_[u=String(u)];void 0===T?(_[u]=g.length,(f=-1!==M.indexOf(u))||(w+=n),g.push({v:n,label:u,color:k(v[r]),i:r,pts:[r],hidden:f})):((h=g[T]).v+=n,h.pts.push(r),h.hidden||(w+=n),!1===h.color&&v[r]&&(h.color=k(v[r],u)))}for(e.sort&&g.sort(function(t,e){return e.v-t.v}),r=0;r<g.length;r++)!1===(h=g[r]).color&&(x[h.label]?h.color=x[h.label]:(x[h.label]=h.color=l(y._piedefaultcolorcount,y._piecolorway),y._piedefaultcolorcount++));if(g[0]&&(g[0].vTotal=w),e.textinfo&&"none"!==e.textinfo){var E,S=-1!==e.textinfo.indexOf("label"),L=-1!==e.textinfo.indexOf("text"),C=-1!==e.textinfo.indexOf("value"),P=-1!==e.textinfo.indexOf("percent"),z=y.separators;for(r=0;r<g.length;r++){if(h=g[r],E=S?[h.label]:[],L){var O=s.getFirstFilled(e.text,h.pts);O&&E.push(O)}C&&E.push(s.formatPieValue(h.v,z)),P&&E.push(s.formatPiePercent(h.v/w,z)),h.text=E.join("<br>")}}return g}},{"../../components/color":598,"./helpers":1028,"fast-isnumeric":140,tinycolor2:526}],1026:[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"),c=o("labels");if(!Array.isArray(c)){if(!Array.isArray(l)||!l.length)return void(e.visible=!1);o("label0"),o("dlabel")}o("marker.line.width")&&o("marker.line.color"),o("marker.colors"),o("scalegroup");var u=o("text"),f=o("textinfo",Array.isArray(u)?"text+percent":"percent");if(o("hovertext"),f&&"none"!==f){var h=o("textposition"),d=Array.isArray(h)||"auto"===h,p=d||"inside"===h,m=d||"outside"===h;if(p||m){var v=s(o,"textfont",a.font);p&&s(o,"insidetextfont",v),m&&s(o,"outsidetextfont",v)}}o("domain.x"),o("domain.y"),o("hole"),o("sort"),o("direction"),o("rotation"),o("pull")}},{"../../lib":724,"./attributes":1023}],1027:[function(t,e,r){"use strict";var n=t("../../components/fx/helpers").appendArrayMultiPointValues;e.exports=function(t,e){var r={curveNumber:e.index,pointNumbers:t.pts,data:e._input,fullData:e,label:t.label,color:t.color,value:t.v,v:t.v};return 1===t.pts.length&&(r.pointNumber=r.i=t.pts[0]),n(r,e,t.pts),r}},{"../../components/fx/helpers":637}],1028:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r<e.length;r++){var n=t[e[r]];if(n||0===n)return n}},r.castOption=function(t,e){return Array.isArray(t)?r.getFirstFilled(t,e):t||void 0}},{"../../lib":724}],1029:[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":1023,"./base_plot":1024,"./calc":1025,"./defaults":1026,"./layout_attributes":1030,"./layout_defaults":1031,"./plot":1032,"./style":1033,"./style_one":1034}],1030:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array",editType:"calc"}}},{}],1031:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){var r,a;r="hiddenlabels",n.coerce(t,e,i,r,a)}},{"../../lib":724,"./layout_attributes":1030}],1032:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/fx"),a=t("../../components/color"),o=t("../../components/drawing"),s=t("../../lib/svg_text_utils"),l=t("./helpers"),c=t("./event_data");function u(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 f(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}}e.exports=function(t,e){var r=t._fullLayout;!function(t,e){var r,n,i,a,o,s,l,c,u,f=[];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.pull,Array.isArray(l))for(l=0,a=0;a<s.pull.length;a++)s.pull[a]>l&&(l=s.pull[a]);o.r=Math.min(r,n)/(2+2*l),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&&-1===f.indexOf(s.scalegroup)&&f.push(s.scalegroup)}for(a=0;a<f.length;a++){for(u=1/0,c=f[a],i=0;i<t.length;i++)(o=t[i][0]).trace.scalegroup===c&&(u=Math.min(u,o.r*o.r/o.vTotal));for(i=0;i<t.length;i++)(o=t[i][0]).trace.scalegroup===c&&(o.r=Math.sqrt(u*o.vTotal))}}(e,r._size);var h=r._pielayer.selectAll("g.trace").data(e);h.enter().append("g").attr({"stroke-linejoin":"round",class:"trace"}),h.exit().remove(),h.order(),h.each(function(e){var h=n.select(this),d=e[0],p=d.trace;!function(t){var e,r,n,i=t[0],a=i.trace,o=a.rotation*Math.PI/180,s=2*Math.PI/i.vTotal,l="px0",c="px1";if("counterclockwise"===a.direction){for(e=0;e<t.length&&t[e].hidden;e++);if(e===t.length)return;o+=s*t[e].v,s*=-1,l="px1",c="px0"}function u(t){return[i.r*Math.sin(t),-i.r*Math.cos(t)]}for(n=u(o),e=0;e<t.length;e++)(r=t[e]).hidden||(r[l]=n,o+=s*r.v/2,r.pxmid=u(o),r.midangle=o,o+=s*r.v/2,n=u(o),r[c]=n,r.largeArc=r.v>i.vTotal/2?1:0)}(e),h.each(function(){var h=n.select(this).selectAll("g.slice").data(e);h.enter().append("g").classed("slice",!0),h.exit().remove();var m=[[[],[]],[[],[]]],v=!1;h.each(function(e){if(e.hidden)n.select(this).selectAll("path,g").remove();else{e.pointNumber=e.i,e.curveNumber=p.index,m[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var a=d.cx,h=d.cy,g=n.select(this),y=g.selectAll("path.surface").data([e]),b=!1,x=!1;if(y.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),g.select("path.textline").remove(),g.on("mouseover",function(){var o=t._fullLayout,s=t._fullData[p.index];if(!t._dragging&&!1!==o.hovermode){var f=s.hoverinfo;if(Array.isArray(f)&&(f=i.castHoverinfo({hoverinfo:[l.castOption(f,e.pts)],_module:p._module},o,0)),"all"===f&&(f="label+text+value+percent+name"),"none"!==f&&"skip"!==f&&f){var m=u(e,d),v=a+e.pxmid[0]*(1-m),g=h+e.pxmid[1]*(1-m),y=r.separators,_=[];if(-1!==f.indexOf("label")&&_.push(e.label),-1!==f.indexOf("text")){var w=l.castOption(s.hovertext||s.text,e.pts);w&&_.push(w)}-1!==f.indexOf("value")&&_.push(l.formatPieValue(e.v,y)),-1!==f.indexOf("percent")&&_.push(l.formatPiePercent(e.v/d.vTotal,y));var M=p.hoverlabel,k=M.font;i.loneHover({x0:v-m*d.r,x1:v+m*d.r,y:g,text:_.join("<br>"),name:-1!==f.indexOf("name")?s.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:l.castOption(M.bgcolor,e.pts)||e.color,borderColor:l.castOption(M.bordercolor,e.pts),fontFamily:l.castOption(k.family,e.pts),fontSize:l.castOption(k.size,e.pts),fontColor:l.castOption(k.color,e.pts)},{container:o._hoverlayer.node(),outerContainer:o._paper.node(),gd:t}),b=!0}t.emit("plotly_hover",{points:[c(e,s)],event:n.event}),x=!0}}).on("mouseout",function(r){var a=t._fullLayout,o=t._fullData[p.index];x&&(r.originalEvent=n.event,t.emit("plotly_unhover",{points:[c(e,o)],event:n.event}),x=!1),b&&(i.loneUnhover(a._hoverlayer.node()),b=!1)}).on("click",function(){var r=t._fullLayout,a=t._fullData[p.index];t._dragging||!1===r.hovermode||(t._hoverdata=[c(e,a)],i.click(t,n.event))}),p.pull){var _=+l.castOption(p.pull,e.pts)||0;_>0&&(a+=_*e.pxmid[0],h+=_*e.pxmid[1])}e.cxFinal=a,e.cyFinal=h;var w=p.hole;if(e.v===d.vTotal){var M="M"+(a+e.px0[0])+","+(h+e.px0[1])+S(e.px0,e.pxmid,!0,1)+S(e.pxmid,e.px0,!0,1)+"Z";w?y.attr("d","M"+(a+w*e.px0[0])+","+(h+w*e.px0[1])+S(e.px0,e.pxmid,!1,w)+S(e.pxmid,e.px0,!1,w)+"Z"+M):y.attr("d",M)}else{var k=S(e.px0,e.px1,!0,1);if(w){var A=1-w;y.attr("d","M"+(a+w*e.px1[0])+","+(h+w*e.px1[1])+S(e.px1,e.px0,!1,w)+"l"+A*e.px0[0]+","+A*e.px0[1]+k+"Z")}else y.attr("d","M"+a+","+h+"l"+e.px0[0]+","+e.px0[1]+k+"Z")}var T=l.castOption(p.textposition,e.pts),E=g.selectAll("g.slicetext").data(e.text&&"none"!==T?[0]:[]);E.enter().append("g").classed("slicetext",!0),E.exit().remove(),E.each(function(){var r=n.select(this).selectAll("text").data([0]);r.enter().append("text").attr("data-notex",1),r.exit().remove(),r.text(e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(o.font,"outside"===T?p.outsidetextfont:p.insidetextfont).call(s.convertToTspans,t);var i,l=o.bBox(r.node());"outside"===T?i=f(l,e):(i=function(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),i=t.width/t.height,a=Math.PI*Math.min(e.v/r.vTotal,.5),o=1-r.trace.hole,s=u(e,r),l={scale:s*r.r*2/n,rCenter:1-s,rotate:0};if(l.scale>=1)return l;var c=i+1/(2*Math.tan(a)),f=r.r*Math.min(1/(Math.sqrt(c*c+.5)+c),o/(Math.sqrt(i*i+o/2)+i)),h={scale:2*f/t.height,rCenter:Math.cos(f/r.r)-f*i/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},d=1/i,p=d+1/(2*Math.tan(a)),m=r.r*Math.min(1/(Math.sqrt(p*p+.5)+p),o/(Math.sqrt(d*d+o/2)+d)),v={scale:2*m/t.width,rCenter:Math.cos(m/r.r)-m/i/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},g=v.scale>h.scale?v:h;return l.scale<1&&g.scale>l.scale?g:l}(l,e,d),"auto"===T&&i.scale<1&&(r.call(o.font,p.outsidetextfont),p.outsidetextfont.family===p.insidetextfont.family&&p.outsidetextfont.size===p.insidetextfont.size||(l=o.bBox(r.node())),i=f(l,e)));var c=a+e.pxmid[0]*i.rCenter+(i.x||0),m=h+e.pxmid[1]*i.rCenter+(i.y||0);i.outside&&(e.yLabelMin=m-l.height/2,e.yLabelMid=m,e.yLabelMax=m+l.height/2,e.labelExtraX=0,e.labelExtraY=0,v=!0),r.attr("transform","translate("+c+","+m+")"+(i.scale<1?"scale("+i.scale+")":"")+(i.rotate?"rotate("+i.rotate+")":"")+"translate("+-(l.left+l.right)/2+","+-(l.top+l.bottom)/2+")")})}function S(t,r,n,i){return"a"+i*d.r+","+i*d.r+" 0 "+e.largeArc+(n?" 1 ":" 0 ")+i*(r[0]-t[0])+","+i*(r[1]-t[1])}}),v&&function(t,e){var r,n,i,a,o,s,c,u,f,h,d,p,m;function v(t,e){return t.pxmid[1]-e.pxmid[1]}function g(t,e){return e.pxmid[1]-t.pxmid[1]}function y(t,r){r||(r={});var i,u,f,d,p,m,v=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),g=n?t.yLabelMin:t.yLabelMax,y=n?t.yLabelMax:t.yLabelMin,b=t.cyFinal+o(t.px0[1],t.px1[1]),x=v-g;if(x*c>0&&(t.labelExtraY=x),Array.isArray(e.pull))for(u=0;u<h.length;u++)(f=h[u])===t||(l.castOption(e.pull,t.pts)||0)>=(l.castOption(e.pull,f.pts)||0)||((t.pxmid[1]-f.pxmid[1])*c>0?(d=f.cyFinal+o(f.px0[1],f.px1[1]),(x=d-g-t.labelExtraY)*c>0&&(t.labelExtraY+=x)):(y+t.labelExtraY-b)*c>0&&(i=3*s*Math.abs(u-h.indexOf(t)),p=f.cxFinal+a(f.px0[0],f.px1[0]),(m=p+i-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*s>0&&(t.labelExtraX+=m)))}for(n=0;n<2;n++)for(i=n?v:g,o=n?Math.max:Math.min,c=n?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,s=r?1:-1,(u=t[n][r]).sort(i),f=t[1-n][r],h=f.concat(u),p=[],d=0;d<u.length;d++)void 0!==u[d].yLabelMid&&p.push(u[d]);for(m=!1,d=0;n&&d<f.length;d++)if(void 0!==f[d].yLabelMid){m=f[d];break}for(d=0;d<p.length;d++){var b=d&&p[d-1];m&&!d&&(b=m),y(p[d],b)}}}(m,p),h.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=n.select(this),r=e.select("g.slicetext text");r.attr("transform","translate("+t.labelExtraX+","+t.labelExtraY+")"+r.attr("transform"));var i=t.cxFinal+t.pxmid[0],o="M"+i+","+(t.cyFinal+t.pxmid[1]),s=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var l=t.labelExtraX*t.pxmid[1]/t.pxmid[0],c=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);Math.abs(l)>Math.abs(c)?o+="l"+c*t.pxmid[0]/t.pxmid[1]+","+c+"H"+(i+t.labelExtraX+s):o+="l"+t.labelExtraX+","+l+"v"+(c-l)+"h"+s}else o+="V"+(t.yLabelMid+t.labelExtraY)+"h"+s;e.append("path").classed("textline",!0).call(a.stroke,p.outsidetextfont.color).attr({"stroke-width":Math.min(2,p.outsidetextfont.size/8),d:o,fill:"none"})}})})}),setTimeout(function(){h.selectAll("tspan").each(function(){var t=n.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":598,"../../components/drawing":623,"../../components/fx":640,"../../lib/svg_text_utils":747,"./event_data":1027,"./helpers":1028,d3:128}],1033:[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].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each(function(t){n.select(this).call(i,t,e)})})}},{"./style_one":1034,d3:128}],1034:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("./helpers").castOption;e.exports=function(t,e,r){var a=r.marker.line,o=i(a.color,e.pts)||n.defaultLine,s=i(a.width,e.pts)||0;t.style({"stroke-width":s}).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":598,"./helpers":1028}],1035:[function(t,e,r){"use strict";var n=t("../scatter/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"}}},{"../scatter/attributes":1048}],1036:[function(t,e,r){"use strict";var n=t("gl-pointcloud2d"),i=t("../../lib/str2rgbarray"),a=t("../scatter/get_trace_color"),o=["xaxis","yaxis"];function s(t,e){this.scene=t,this.uid=e,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=n(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var l=s.prototype;l.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},l.update=function(t){this.index=t.index,this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(t),this.color=a(t,{})},l.updateFast=function(t){var e,r,n,a,o,s,l=this.xData=this.pickXData=t.x,c=this.yData=this.pickYData=t.y,u=this.pickXYData=t.xy,f=t.xbounds&&t.ybounds,h=t.indices,d=this.bounds;if(u){if(n=u,e=u.length>>>1,f)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++)a=n[2*s],o=n[2*s+1],a<d[0]&&(d[0]=a),a>d[2]&&(d[2]=a),o<d[1]&&(d[1]=o),o>d[3]&&(d[3]=o);if(h)r=h;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++)a=l[s],o=c[s],r[s]=s,n[2*s]=a,n[2*s+1]=o,a<d[0]&&(d[0]=a),a>d[2]&&(d[2]=a),o<d[1]&&(d[1]=o),o>d[3]&&(d[3]=o);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var p=i(t.marker.color),m=i(t.marker.border.color),v=t.opacity*t.marker.opacity;p[3]*=v,this.pointcloudOptions.color=p;var g=t.marker.blend;if(null===g){g=l.length<100||c.length<100}this.pointcloudOptions.blend=g,m[3]*=v,this.pointcloudOptions.borderColor=m;var y=t.marker.sizemin,b=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=y,this.pointcloudOptions.sizeMax=b,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions),this.expandAxesFast(d,b/2)},l.expandAxesFast=function(t,e){for(var r,n,i,a=e||.5,s=0;s<2;s++)(n=(r=this.scene[o[s]])._min)||(n=[]),n.push({val:t[s],pad:a}),(i=r._max)||(i=[]),i.push({val:t[s+2],pad:a})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new s(t,e.uid);return r.update(e),r}},{"../../lib/str2rgbarray":746,"../scatter/get_trace_color":1058,"gl-pointcloud2d":212}],1037:[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":724,"./attributes":1035}],1038:[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=["gl","gl2d","showLegend"],n.meta={},e.exports=n},{"../../plots/gl2d":810,"../scatter3d/calc":1074,"./attributes":1035,"./convert":1036,"./defaults":1037}],1039:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/attributes"),a=t("../../components/color/attributes"),o=t("../../components/fx/attributes"),s=t("../../plots/domain_attributes"),l=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll;e.exports=c({hoverinfo:l({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hoverlabel:o.hoverlabel,domain:s({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s"},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),node:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20}},link:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]}}},"calc","nested")},{"../../components/color/attributes":597,"../../components/fx/attributes":632,"../../lib/extend":713,"../../plot_api/edit_types":754,"../../plots/attributes":768,"../../plots/domain_attributes":796,"../../plots/font_attributes":797}],1040:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../components/fx/layout_attributes");r.name="sankey",r.baseLayoutAttrOverrides=n({hoverlabel:o.hoverlabel},"plot","nested"),r.plot=function(t){var e=i(t.calcdata,"sankey");a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("sankey"),a=e._has&&e._has("sankey");i&&!a&&n._paperdiv.selectAll(".sankey").remove()}},{"../../components/fx/layout_attributes":641,"../../plot_api/edit_types":754,"../../plots/get_data":807,"./plot":1045}],1041:[function(t,e,r){"use strict";var n=t("strongly-connected-components"),i=t("../../lib"),a=t("../../lib/gup").wrap;e.exports=function(t,e){return function(t,e,r){for(var i=t.map(function(){return[]}),a=0;a<Math.min(e.length,r.length);a++){if(e[a]===r[a])return!0;i[e[a]].push(r[a])}return n(i).components.some(function(t){return t.length>1})}(e.node.label,e.link.source,e.link.target)&&(i.error("Circularity is present in the Sankey data. Removing all nodes and links."),e.link.label=[],e.link.source=[],e.link.target=[],e.link.value=[],e.link.color=[],e.node.label=[],e.node.color=[]),a({link:e.link,node:e.node})}},{"../../lib":724,"../../lib/gup":721,"strongly-connected-components":517}],1042:[function(t,e,r){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"cubic-in-out",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeCapture:"node-capture",nodeCentered:"node-entered",nodeLabelGuide:"node-label-guide",nodeLabel:"node-label",nodeLabelTextPath:"node-label-text-path"}}},{}],1043:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color"),o=t("tinycolor2");e.exports=function(t,e,r,s){function l(r,a){return n.coerce(t,e,i,r,a)}l("node.label"),l("node.pad"),l("node.thickness"),l("node.line.color"),l("node.line.width");var c=s.colorway;l("node.color",e.node.label.map(function(t,e){return a.addOpacity(function(t){return c[t%c.length]}(e),.8)})),l("link.label"),l("link.source"),l("link.target"),l("link.value"),l("link.line.color"),l("link.line.width"),l("link.color",e.link.value.map(function(){return o(s.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)"})),l("domain.x"),l("domain.y"),l("orientation"),l("valueformat"),l("valuesuffix"),l("arrangement"),n.coerceFont(l,"textfont",n.extendFlat({},s.font));e.node.label.some(function(t,r){return-1===e.link.source.indexOf(r)&&-1===e.link.target.indexOf(r)})&&n.warn("Some of the nodes are neither sources nor targets, they will not be displayed.")}},{"../../components/color":598,"../../lib":724,"./attributes":1039,tinycolor2:526}],1044:[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.moduleType="trace",n.name="sankey",n.basePlotModule=t("./base_plot"),n.categories=["noOpacity"],n.meta={},e.exports=n},{"./attributes":1039,"./base_plot":1040,"./calc":1041,"./defaults":1043,"./plot":1045}],1045:[function(t,e,r){"use strict";var n=t("d3"),i=t("./render"),a=t("../../components/fx"),o=t("../../components/color"),s=t("../../lib"),l=t("./constants").cn,c=s._;function u(t){return""!==t}function f(t,e){return t.filter(function(t){return t.key===e.traceId})}function h(t,e){n.select(t).select("path").style("fill-opacity",e),n.select(t).select("rect").style("fill-opacity",e)}function d(t){n.select(t).select("text.name").style("fill","black")}function p(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function m(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function v(t,e,r){e&&r&&f(r,e).selectAll("."+l.sankeyLink).filter(p(e)).call(y.bind(0,e,r,!1))}function g(t,e,r){e&&r&&f(r,e).selectAll("."+l.sankeyLink).filter(p(e)).call(b.bind(0,e,r,!1))}function y(t,e,r,n){var i=n.datum().link.label;n.style("fill-opacity",.4),i&&f(e,t).selectAll("."+l.sankeyLink).filter(function(t){return t.link.label===i}).style("fill-opacity",.4),r&&f(e,t).selectAll("."+l.sankeyNode).filter(m(t)).call(v)}function b(t,e,r,n){var i=n.datum().link.label;n.style("fill-opacity",function(t){return t.tinyColorAlpha}),i&&f(e,t).selectAll("."+l.sankeyLink).filter(function(t){return t.link.label===i}).style("fill-opacity",function(t){return t.tinyColorAlpha}),r&&f(e,t).selectAll(l.sankeyNode).filter(m(t)).call(g)}function x(t,e){var r=t.hoverlabel||{},n=s.nestedProperty(r,e).get();return!Array.isArray(n)&&n}e.exports=function(t,e){var r=t._fullLayout,s=r._paper,f=r._size,p=c(t,"source:")+" ",m=c(t,"target:")+" ",_=c(t,"incoming flow count:")+" ",w=c(t,"outgoing flow count:")+" ";i(s,e,{width:f.w,height:f.h,margin:{t:f.t,r:f.r,b:f.b,l:f.l}},{linkEvents:{hover:function(e,r,i){n.select(e).call(y.bind(0,r,i,!0)),t.emit("plotly_hover",{event:n.event,points:[r.link]})},follow:function(e,i){var s=i.link.trace,l=t._fullLayout._paperdiv.node().getBoundingClientRect(),c=e.getBoundingClientRect(),f=c.left+c.width/2,v=c.top+c.height/2,g=a.loneHover({x:f-l.left,y:v-l.top,name:n.format(i.valueFormat)(i.link.value)+i.valueSuffix,text:[i.link.label||"",p+i.link.source.label,m+i.link.target.label].filter(u).join("<br>"),color:x(s,"bgcolor")||o.addOpacity(i.tinyColorHue,1),borderColor:x(s,"bordercolor"),fontFamily:x(s,"font.family"),fontSize:x(s,"font.size"),fontColor:x(s,"font.color"),idealAlign:n.event.x<f?"right":"left"},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});h(g,.65),d(g)},unhover:function(e,i,o){n.select(e).call(b.bind(0,i,o,!0)),t.emit("plotly_unhover",{event:n.event,points:[i.link]}),a.loneUnhover(r._hoverlayer.node())},select:function(e,r){var i=r.link;i.originalEvent=n.event,t._hoverdata=[i],a.click(t,{target:!0})}},nodeEvents:{hover:function(e,r,i){n.select(e).call(v,r,i),t.emit("plotly_hover",{event:n.event,points:[r.node]})},follow:function(e,i){var o=i.node.trace,s=n.select(e).select("."+l.nodeRect),c=t._fullLayout._paperdiv.node().getBoundingClientRect(),f=s.node().getBoundingClientRect(),p=f.left-2-c.left,m=f.right+2-c.left,v=f.top+f.height/4-c.top,g=a.loneHover({x0:p,x1:m,y:v,name:n.format(i.valueFormat)(i.node.value)+i.valueSuffix,text:[i.node.label,_+i.node.targetLinks.length,w+i.node.sourceLinks.length].filter(u).join("<br>"),color:x(o,"bgcolor")||i.tinyColorHue,borderColor:x(o,"bordercolor"),fontFamily:x(o,"font.family"),fontSize:x(o,"font.size"),fontColor:x(o,"font.color"),idealAlign:"left"},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});h(g,.85),d(g)},unhover:function(e,i,o){n.select(e).call(g,i,o),t.emit("plotly_unhover",{event:n.event,points:[i.node]}),a.loneUnhover(r._hoverlayer.node())},select:function(e,r,i){var o=r.node;o.originalEvent=n.event,t._hoverdata=[o],n.select(e).call(g,r,i),a.click(t,{target:!0})}}})}},{"../../components/color":598,"../../components/fx":640,"../../lib":724,"./constants":1042,"./render":1046,d3:128}],1046:[function(t,e,r){"use strict";var n=t("./constants"),i=t("d3"),a=t("tinycolor2"),o=t("../../components/color"),s=t("../../components/drawing"),l=t("@plotly/d3-sankey").sankey,c=t("d3-force"),u=t("../../lib"),f=t("../../lib/gup").keyFun,h=t("../../lib/gup").repeat,d=t("../../lib/gup").unwrap;function p(t){t.lastDraggedX=t.x,t.lastDraggedY=t.y}function m(t){return function(e){return e.node.originalX===t.node.originalX}}function v(t){for(var e=0;e<t.length;e++)t[e].y=t[e].y+t[e].dy/2}function g(t){t.attr("transform",function(t){return"translate("+t.node.x.toFixed(3)+", "+(t.node.y-t.node.dy/2).toFixed(3)+")"})}function y(t){var e=t.sankey.nodes();!function(t){for(var e=0;e<t.length;e++)t[e].y=t[e].y-t[e].dy/2}(e);var r=t.sankey.link()(t.link);return v(e),r}function b(t){t.call(g)}function x(t,e){t.call(b),e.attr("d",y)}function _(t){t.attr("width",function(t){return t.visibleWidth}).attr("height",function(t){return t.visibleHeight})}function w(t){return t.link.dy>1||t.linkLineWidth>0}function M(t){return"translate("+t.translateX+","+t.translateY+")"+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function k(t){return"translate("+(t.horizontal?0:t.labelY)+" "+(t.horizontal?t.labelY:0)+")"}function A(t){return i.svg.line()([[t.horizontal?t.left?-t.sizeAcross:t.visibleWidth+n.nodeTextOffsetHorizontal:n.nodeTextOffsetHorizontal,0],[t.horizontal?t.left?-n.nodeTextOffsetHorizontal:t.sizeAcross:t.visibleHeight-n.nodeTextOffsetHorizontal,0]])}function T(t){return t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)"}function E(t){return t.horizontal?"scale(1 1)":"scale(-1 1)"}function S(t){return t.darkBackground&&!t.horizontal?"rgb(255,255,255)":"rgb(0,0,0)"}function L(t){return t.horizontal&&t.left?"100%":"0%"}function C(t,e,r){t.on(".basic",null).on("mouseover.basic",function(t){t.interactionState.dragInProgress||(r.hover(this,t,e),t.interactionState.hovered=[this,t])}).on("mousemove.basic",function(t){t.interactionState.dragInProgress||(r.follow(this,t),t.interactionState.hovered=[this,t])}).on("mouseout.basic",function(t){t.interactionState.dragInProgress||(r.unhover(this,t,e),t.interactionState.hovered=!1)}).on("click.basic",function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||r.select(this,t,e)})}function P(t,e,r){var a=i.behavior.drag().origin(function(t){return t.node}).on("dragstart",function(i){if("fixed"!==i.arrangement&&(u.raiseToTop(this),i.interactionState.dragInProgress=i.node,p(i.node),i.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,i.interactionState.hovered),i.interactionState.hovered=!1),"snap"===i.arrangement)){var a=i.traceId+"|"+Math.floor(i.node.originalX);i.forceLayouts[a]?i.forceLayouts[a].alpha(1):function(t,e,r){var i=r.sankey.nodes().filter(function(t){return t.originalX===r.node.originalX});r.forceLayouts[e]=c.forceSimulation(i).alphaDecay(0).force("collide",c.forceCollide().radius(function(t){return t.dy/2+r.nodePad/2}).strength(1).iterations(n.forceIterations)).force("constrain",function(t,e,r,i){return function(){for(var t=0,a=0;a<r.length;a++){var o=r[a];o===i.interactionState.dragInProgress?(o.x=o.lastDraggedX,o.y=o.lastDraggedY):(o.vx=(o.originalX-o.x)/n.forceTicksPerFrame,o.y=Math.min(i.size-o.dy/2,Math.max(o.dy/2,o.y))),t=Math.max(t,Math.abs(o.vx),Math.abs(o.vy))}!i.interactionState.dragInProgress&&t<.1&&i.forceLayouts[e].alpha()>0&&i.forceLayouts[e].alpha(0)}}(0,e,i,r)).stop()}(0,a,i),function(t,e,r,i){window.requestAnimationFrame(function a(){for(var o=0;o<n.forceTicksPerFrame;o++)r.forceLayouts[i].tick();r.sankey.relayout(),x(t.filter(m(r)),e),r.forceLayouts[i].alpha()>0&&window.requestAnimationFrame(a)})}(t,e,i,a)}}).on("drag",function(r){if("fixed"!==r.arrangement){var n=i.event.x,a=i.event.y;"snap"===r.arrangement?(r.node.x=n,r.node.y=a):("freeform"===r.arrangement&&(r.node.x=n),r.node.y=Math.max(r.node.dy/2,Math.min(r.size-r.node.dy/2,a))),p(r.node),"snap"!==r.arrangement&&(r.sankey.relayout(),x(t.filter(m(r)),e))}}).on("dragend",function(t){t.interactionState.dragInProgress=!1});t.on(".drag",null).call(a)}e.exports=function(t,e,r,i){var c=t.selectAll("."+n.cn.sankey).data(e.filter(function(t){return d(t).trace.visible}).map(function(t,e,r){for(var i,a=d(e).trace,o=a.domain,s=a.node,c=a.link,f=a.arrangement,h="h"===a.orientation,p=a.node.pad,m=a.node.thickness,g=a.node.line.color,y=a.node.line.width,b=a.link.line.color,x=a.link.line.width,_=a.valueformat,w=a.valuesuffix,M=a.textfont,k=t.width*(o.x[1]-o.x[0]),A=t.height*(o.y[1]-o.y[0]),T=s.label.map(function(t,e){return{pointNumber:e,label:t,color:u.isArray(s.color)?s.color[e]:s.color}}),E=c.value.map(function(t,e){return{pointNumber:e,label:c.label[e],color:u.isArray(c.color)?c.color[e]:c.color,source:c.source[e],target:c.target[e],value:t}}),S=l().size(h?[k,A]:[A,k]).nodeWidth(m).nodePadding(p).nodes(T).links(E).layout(n.sankeyIterations),L=S.nodes(),C=0;C<L.length;C++)(i=L[C]).width=k,i.height=A;return v(T),{key:r,trace:a,guid:Math.floor(1e12*(1+Math.random())),horizontal:h,width:k,height:A,nodePad:p,nodeLineColor:g,nodeLineWidth:y,linkLineColor:b,linkLineWidth:x,valueFormat:_,valueSuffix:w,textFont:M,translateX:o.x[0]*k+t.margin.l,translateY:t.height-o.y[1]*t.height+t.margin.t,dragParallel:h?A:k,dragPerpendicular:h?k:A,nodes:T,links:E,arrangement:f,sankey:S,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}.bind(null,r)),f);c.exit().remove(),c.enter().append("g").classed(n.cn.sankey,!0).style("box-sizing","content-box").style("position","absolute").style("left",0).style("shape-rendering","geometricPrecision").style("pointer-events","auto").style("box-sizing","content-box").attr("transform",M),c.transition().ease(n.ease).duration(n.duration).attr("transform",M);var p=c.selectAll("."+n.cn.sankeyLinks).data(h,f);p.enter().append("g").classed(n.cn.sankeyLinks,!0).style("fill","none");var m=p.selectAll("."+n.cn.sankeyLink).data(function(t){return t.sankey.links().filter(function(t){return t.value}).map(function(t,e,r){var n=a(r.color),i=r.source.label+"|"+r.target.label,s=t[i];t[i]=(s||0)+1;var l=i+"__"+t[i];return r.trace=e.trace,r.curveNumber=e.trace.index,{key:l,traceId:e.key,link:r,tinyColorHue:o.tinyRGB(n),tinyColorAlpha:n.getAlpha(),linkLineColor:e.linkLineColor,linkLineWidth:e.linkLineWidth,valueFormat:e.valueFormat,valueSuffix:e.valueSuffix,sankey:e.sankey,interactionState:e.interactionState}}.bind(null,{},t))},f);m.enter().append("path").classed(n.cn.sankeyLink,!0).attr("d",y).call(C,c,i.linkEvents),m.style("stroke",function(t){return w(t)?o.tinyRGB(a(t.linkLineColor)):t.tinyColorHue}).style("stroke-opacity",function(t){return w(t)?o.opacity(t.linkLineColor):t.tinyColorAlpha}).style("stroke-width",function(t){return w(t)?t.linkLineWidth:1}).style("fill",function(t){return t.tinyColorHue}).style("fill-opacity",function(t){return t.tinyColorAlpha}),m.transition().ease(n.ease).duration(n.duration).attr("d",y),m.exit().transition().ease(n.ease).duration(n.duration).style("opacity",0).remove();var b=c.selectAll("."+n.cn.sankeyNodeSet).data(h,f);b.enter().append("g").classed(n.cn.sankeyNodeSet,!0),b.style("cursor",function(t){switch(t.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}});var x=b.selectAll("."+n.cn.sankeyNode).data(function(t){var e=t.sankey.nodes();return function(t){var e,r=[];for(e=0;e<t.length;e++)t[e].originalX=t[e].x,t[e].originalY=t[e].y,-1===r.indexOf(t[e].x)&&r.push(t[e].x);for(r.sort(function(t,e){return t-e}),e=0;e<t.length;e++)t[e].originalLayerIndex=r.indexOf(t[e].originalX),t[e].originalLayer=t[e].originalLayerIndex/(r.length-1)}(e),e.filter(function(t){return t.value}).map(function(t,e,r){var i=a(r.color),s=n.nodePadAcross,l=e.nodePad/2,c=r.dx,u=Math.max(.5,r.dy),f=r.label,h=t[f];t[f]=(h||0)+1;var d=f+"__"+t[f];return r.trace=e.trace,r.curveNumber=e.trace.index,{key:d,traceId:e.key,node:r,nodePad:e.nodePad,nodeLineColor:e.nodeLineColor,nodeLineWidth:e.nodeLineWidth,textFont:e.textFont,size:e.horizontal?e.height:e.width,visibleWidth:Math.ceil(c),visibleHeight:u,zoneX:-s,zoneY:-l,zoneWidth:c+2*s,zoneHeight:u+2*l,labelY:e.horizontal?r.dy/2+1:r.dx/2+1,left:1===r.originalLayer,sizeAcross:e.width,forceLayouts:e.forceLayouts,horizontal:e.horizontal,darkBackground:i.getBrightness()<=128,tinyColorHue:o.tinyRGB(i),tinyColorAlpha:i.getAlpha(),valueFormat:e.valueFormat,valueSuffix:e.valueSuffix,sankey:e.sankey,arrangement:e.arrangement,uniqueNodeLabelPathId:[e.guid,e.key,d].join(" "),interactionState:e.interactionState}}.bind(null,{},t))},f);x.enter().append("g").classed(n.cn.sankeyNode,!0).call(g).call(C,c,i.nodeEvents),x.call(P,m,i),x.transition().ease(n.ease).duration(n.duration).call(g),x.exit().transition().ease(n.ease).duration(n.duration).style("opacity",0).remove();var z=x.selectAll("."+n.cn.nodeRect).data(h);z.enter().append("rect").classed(n.cn.nodeRect,!0).call(_),z.style("stroke-width",function(t){return t.nodeLineWidth}).style("stroke",function(t){return o.tinyRGB(a(t.nodeLineColor))}).style("stroke-opacity",function(t){return o.opacity(t.nodeLineColor)}).style("fill",function(t){return t.tinyColorHue}).style("fill-opacity",function(t){return t.tinyColorAlpha}),z.transition().ease(n.ease).duration(n.duration).call(_);var O=x.selectAll("."+n.cn.nodeCapture).data(h);O.enter().append("rect").classed(n.cn.nodeCapture,!0).style("fill-opacity",0),O.attr("x",function(t){return t.zoneX}).attr("y",function(t){return t.zoneY}).attr("width",function(t){return t.zoneWidth}).attr("height",function(t){return t.zoneHeight});var D=x.selectAll("."+n.cn.nodeCentered).data(h);D.enter().append("g").classed(n.cn.nodeCentered,!0).attr("transform",k),D.transition().ease(n.ease).duration(n.duration).attr("transform",k);var I=D.selectAll("."+n.cn.nodeLabelGuide).data(h);I.enter().append("path").classed(n.cn.nodeLabelGuide,!0).attr("id",function(t){return t.uniqueNodeLabelPathId}).attr("d",A).attr("transform",T),I.transition().ease(n.ease).duration(n.duration).attr("d",A).attr("transform",T);var R=D.selectAll("."+n.cn.nodeLabel).data(h);R.enter().append("text").classed(n.cn.nodeLabel,!0).attr("transform",E).style("user-select","none").style("cursor","default").style("fill","black"),R.style("text-shadow",function(t){return t.horizontal?"-1px 1px 1px #fff, 1px 1px 1px #fff, 1px -1px 1px #fff, -1px -1px 1px #fff":"none"}).each(function(t){s.font(R,t.textFont)}),R.transition().ease(n.ease).duration(n.duration).attr("transform",E);var N=R.selectAll("."+n.cn.nodeLabelTextPath).data(h);N.enter().append("textPath").classed(n.cn.nodeLabelTextPath,!0).attr("alignment-baseline","middle").attr("xlink:href",function(t){return"#"+t.uniqueNodeLabelPathId}).attr("startOffset",L).style("fill",S),N.text(function(t){return t.horizontal||t.node.dy>5?t.node.label:""}).attr("text-anchor",function(t){return t.horizontal&&t.left?"end":"start"}),N.transition().ease(n.ease).duration(n.duration).attr("startOffset",L).style("fill",S)}},{"../../components/color":598,"../../components/drawing":623,"../../lib":724,"../../lib/gup":721,"./constants":1042,"@plotly/d3-sankey":41,d3:128,"d3-force":124,tinycolor2:526}],1047:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r<t.length;r++)t[r].i=r;n.mergeArray(e.text,t,"tx"),n.mergeArray(e.hovertext,t,"htx"),n.mergeArray(e.customdata,t,"data"),n.mergeArray(e.textposition,t,"tp"),e.textfont&&(n.mergeArray(e.textfont.size,t,"ts"),n.mergeArray(e.textfont.color,t,"tc"),n.mergeArray(e.textfont.family,t,"tf"));var i=e.marker;if(i){n.mergeArray(i.size,t,"ms"),n.mergeArray(i.opacity,t,"mo"),n.mergeArray(i.symbol,t,"mx"),n.mergeArray(i.color,t,"mc");var a=i.line;i.line&&(n.mergeArray(a.color,t,"mlc"),n.mergeArray(a.width,t,"mlw"));var o=i.gradient;o&&"none"!==o.type&&(n.mergeArray(o.type,t,"mgt"),n.mergeArray(o.color,t,"mgc"))}}},{"../../lib":724}],1048:[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("../../plots/font_attributes"),s=t("../../components/drawing/attributes").dash,l=t("../../components/drawing"),c=(t("./constants"),t("../../lib/extend").extendFlat);e.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dx:{valType:"number",dflt:1,editType:"calc"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dy:{valType:"number",dflt:1,editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:c({},s,{editType:"style"}),simplify:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot"},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],dflt:"none",editType:"calc"},fillcolor:{valType:"color",editType:"style"},marker:c({symbol:{valType:"enumerated",values:l.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style"},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calcIfAutorange"},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot"},sizeref:{valType:"number",dflt:1,editType:"calc"},sizemin:{valType:"number",min:0,dflt:0,editType:"calc"},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc"},showscale:{valType:"boolean",dflt:!1,editType:"calc"},colorbar:a,line:c({width:{valType:"number",min:0,arrayOk:!0,editType:"style"},editType:"calc"},n("marker.line")),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc"},color:{valType:"color",arrayOk:!0,editType:"calc"},editType:"calc"},editType:"calc"},n("marker")),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:o({editType:"calc",colorEditType:"style",arrayOk:!0}),r:{valType:"data_array",editType:"calc"},t:{valType:"data_array",editType:"calc"},error_y:i,error_x:i}},{"../../components/colorbar/attributes":599,"../../components/colorscale/color_attributes":606,"../../components/drawing":623,"../../components/drawing/attributes":622,"../../components/errorbars/attributes":625,"../../lib/extend":713,"../../plots/font_attributes":797,"./constants":1054}],1049:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("../../constants/numerical").BADNUM,o=t("./subtypes"),s=t("./colorscale_calc"),l=t("./arrays_to_calcdata"),c=t("./calc_selection");function u(t,e){if(o.hasMarkers(t)){var r,n=t.marker,a=1.6*(t.marker.sizeref||1);if(r="area"===t.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/a),3)}:function(t){return Math.max((t||0)/a,3)},Array.isArray(n.size)){var s={type:"linear"};i.setConvert(s);for(var l=s.makeCalcdata(t.marker,"size"),c=new Array(e),u=0;u<e;u++)c[u]=r(l[u]);return c}return r(n.size)}}e.exports={calc:function(t,e){var r=i.getFromId(t,e.xaxis||"x"),f=i.getFromId(t,e.yaxis||"y"),h=r.makeCalcdata(e,"x"),d=f.makeCalcdata(e,"y"),p=e._length;r._minDtick=0,f._minDtick=0;var m={padded:!0},v={padded:!0},g=u(e,p);g&&(m.ppad=v.ppad=g),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||h[0]===h[p-1]&&d[0]===d[p-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(o.hasMarkers(e)||o.hasText(e))||(m.padded=!1,m.ppad=0):m.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||h[0]===h[p-1]&&d[0]===d[p-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(v.padded=!1):v.tozero=!0,i.expand(r,h,m),i.expand(f,d,v);for(var y=new Array(p),b=0;b<p;b++)y[b]=n(h[b])&&n(d[b])?{x:h[b],y:d[b]}:{x:a,y:a},e.ids&&(y[b].id=String(e.ids[b]));return l(y,e),s(e),c(y,e),t.firstscatter=!1,y},calcMarkerSize:u}},{"../../constants/numerical":702,"../../plots/cartesian/axes":770,"./arrays_to_calcdata":1047,"./calc_selection":1050,"./colorscale_calc":1053,"./subtypes":1070,"fast-isnumeric":140}],1050:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){Array.isArray(e.selectedpoints)&&n.tagSelected(t,e)}},{"../../lib":724}],1051:[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}}}}}},{}],1052:[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,c="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+c).remove(),void 0!==l&&l.showscale){var u=l.color,f=l.cmin,h=l.cmax;n(f)||(f=i.aggNums(Math.min,null,u)),n(h)||(h=i.aggNums(Math.max,null,u));var d=e[0].t.cb=s(t,c),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,f,h),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:f,end:h,size:(h-f)/254}).options(l.colorbar)()}else a.autoMargin(t,c)}},{"../../components/colorbar/draw":602,"../../components/colorscale":613,"../../lib":724,"../../plots/plots":833,"fast-isnumeric":140}],1053:[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":605,"../../components/colorscale/has_colorscale":612,"./subtypes":1070}],1054:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],1055:[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"),c=t("./line_defaults"),u=t("./line_shape_defaults"),f=t("./text_defaults"),h=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 v=s(t,e,p,m),g=v<a.PTS_LINESONLY?"lines+markers":"lines";if(v){m("text"),m("hovertext"),m("mode",g),o.hasLines(e)&&(c(t,e,r,p,m),u(t,e,m),m("connectgaps"),m("line.simplify")),o.hasMarkers(e)&&l(t,e,r,p,m,{gradient:!0}),o.hasText(e)&&f(t,e,p,m);var y=[];(o.hasMarkers(e)||o.hasText(e))&&(m("cliponaxis"),m("marker.maxdisplayed"),y.push("points")),m("fill"),"none"!==e.fill&&(h(t,e,r,m),o.hasLines(e)||u(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"}),n.coerceSelectionMarkerOpacity(e,m)}else e.visible=!1}},{"../../components/errorbars/defaults":628,"../../lib":724,"./attributes":1048,"./constants":1054,"./fillcolor_defaults":1057,"./line_defaults":1061,"./line_shape_defaults":1063,"./marker_defaults":1066,"./subtypes":1070,"./text_defaults":1071,"./xy_defaults":1072}],1056:[function(t,e,r){"use strict";var n=t("../../lib");function i(t){return t||0===t}e.exports=function(t,e,r){var a=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},o=n.extractOption(t,e,"htx","hovertext");if(i(o))return a(o);var s=n.extractOption(t,e,"tx","text");return i(s)?a(s):void 0}},{"../../lib":724}],1057:[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":598}],1058:[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)&&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:"")?n.opacity(a)<.3?n.addOpacity(a,.3):a:(r=(t.line||{}).color)&&n.opacity(r)&&i.hasLines(t)&&t.line.width?r:t.fillcolor}},{"../../components/color":598,"./subtypes":1070}],1059:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/fx"),a=t("../../components/errorbars"),o=t("./get_trace_color"),s=t("../../components/color"),l=t("./fill_hover_text"),c=i.constants.MAXDIST;e.exports=function(t,e,r,u){var f=t.cd,h=f[0].trace,d=t.xa,p=t.ya,m=d.c2p(e),v=p.c2p(r),g=[m,v],y=h.hoveron||"",b=-1!==h.mode.indexOf("markers")?3:.5;if(-1!==y.indexOf("points")){var x=i.getDistanceFunction(u,function(t){var e=Math.max(3,t.mrc||0),r=1-1/e,n=Math.abs(d.c2p(t.x)-m);return n<e?r*n/e:n-e+r},function(t){var e=Math.max(3,t.mrc||0),r=1-1/e,n=Math.abs(p.c2p(t.y)-v);return n<e?r*n/e:n-e+r},function(t){var e=Math.max(b,t.mrc||0),r=d.c2p(t.x)-m,n=p.c2p(t.y)-v;return Math.max(Math.sqrt(r*r+n*n)-e,1-b/e)});if(i.getClosest(f,x,t),!1!==t.index){var _=f[t.index],w=d.c2p(_.x,!0),M=p.c2p(_.y,!0),k=_.mrc||1;return n.extendFlat(t,{color:o(h,_),x0:w-k,x1:w+k,xLabelVal:_.x,y0:M-k,y1:M+k,yLabelVal:_.y,kink:Math.max(b,_.mrc||0)}),l(_,h,t),a.hoverInfo(_,h,t),[t]}}if(-1!==y.indexOf("fills")&&h._polygons){var A,T,E,S,L,C,P,z,O,D=h._polygons,I=[],R=!1,N=1/0,F=-1/0,j=1/0,B=-1/0;for(A=0;A<D.length;A++)(E=D[A]).contains(g)&&(R=!R,I.push(E),j=Math.min(j,E.ymin),B=Math.max(B,E.ymax));if(R){var U=((j=Math.max(j,0))+(B=Math.min(B,p._length)))/2;for(A=0;A<I.length;A++)for(S=I[A].pts,T=1;T<S.length;T++)(z=S[T-1][1])>U!=(O=S[T][1])>=U&&(C=S[T-1][0],P=S[T][0],O-z&&(L=C+(P-C)*(U-z)/(O-z),N=Math.min(N,L),F=Math.max(F,L)));N=Math.max(N,0),F=Math.min(F,d._length);var V=s.defaultLine;return s.opacity(h.fillcolor)?V=h.fillcolor:s.opacity((h.line||{}).color)&&(V=h.line.color),n.extendFlat(t,{distance:c+10,x0:N,x1:F,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":598,"../../components/errorbars":629,"../../components/fx":640,"../../lib":724,"./fill_hover_text":1056,"./get_trace_color":1058}],1060:[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").calc,n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style").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","scatter-like"],n.meta={},e.exports=n},{"../../plots/cartesian":781,"./arrays_to_calcdata":1047,"./attributes":1048,"./calc":1049,"./clean_data":1051,"./colorbar":1052,"./defaults":1055,"./hover":1059,"./plot":1067,"./select":1068,"./style":1069,"./subtypes":1070}],1061:[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,s){var l=(t.marker||{}).color;(o("line.color",r),n(t,"line"))?i(t,e,a,o,{prefix:"line.",cLetter:"c"}):o("line.color",!Array.isArray(l)&&l||r);o("line.width"),(s||{}).noDash||o("line.dash")}},{"../../components/colorscale/defaults":608,"../../components/colorscale/has_colorscale":612}],1062:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM,i=t("../../lib"),a=i.segmentsIntersect,o=i.constrain,s=t("./constants");e.exports=function(t,e){var r,l,c,u,f,h,d,p,m,v,g,y,b,x,_,w,M=e.xaxis,k=e.yaxis,A=e.simplify,T=e.connectGaps,E=e.baseTolerance,S=e.shape,L="linear"===S,C=[],P=s.minTolerance,z=new Array(t.length),O=0;function D(e){var r=t[e],i=M.c2p(r.x),a=k.c2p(r.y);return i===n||a===n?r.intoCenter||!1:[i,a]}function I(t){var e=t[0]/M._length,r=t[1]/k._length;return(1+s.toleranceGrowth*Math.max(0,-e,e-1,-r,r-1))*E}function R(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}A||(E=P=-1);var N,F,j,B,U,V,q,H=s.maxScreensAway,G=-M._length*H,Y=M._length*(1+H),W=-k._length*H,X=k._length*(1+H),Z=[[G,W,Y,W],[Y,W,Y,X],[Y,X,G,X],[G,X,G,W]];function J(t){if(t[0]<G||t[0]>Y||t[1]<W||t[1]>X)return[o(t[0],G,Y),o(t[1],W,X)]}function K(t,e){return t[0]===e[0]&&(t[0]===G||t[0]===Y)||(t[1]===e[1]&&(t[1]===W||t[1]===X)||void 0)}function Q(t,e,r){return function(n,a){var o=J(n),s=J(a),l=[];if(o&&s&&K(o,s))return l;o&&l.push(o),s&&l.push(s);var c=2*i.constrain((n[t]+a[t])/2,e,r)-((o||n)[t]+(s||a)[t]);c&&((o&&s?c>0==o[t]>s[t]?o:s:o||s)[t]+=c);return l}}function $(t){var e=t[0],r=t[1],n=e===z[O-1][0],i=r===z[O-1][1];if(!n||!i)if(O>1){var a=e===z[O-2][0],o=r===z[O-2][1];n&&(e===G||e===Y)&&a?o?O--:z[O-1]=t:i&&(r===W||r===X)&&o?a?O--:z[O-1]=t:z[O++]=t}else z[O++]=t}function tt(t){z[O-1][0]!==t[0]&&z[O-1][1]!==t[1]&&$([j,B]),$(t),U=null,j=B=0}function et(t){if(N=t[0]<G?G:t[0]>Y?Y:0,F=t[1]<W?W:t[1]>X?X:0,N||F){if(O)if(U){var e=q(U,t);e.length>1&&(tt(e[0]),z[O++]=e[1])}else V=q(z[O-1],t)[0],z[O++]=V;else z[O++]=[N||t[0],F||t[1]];var r=z[O-1];N&&F&&(r[0]!==N||r[1]!==F)?(U&&(j!==N&&B!==F?$(j&&B?(n=U,a=(i=t)[0]-n[0],o=(i[1]-n[1])/a,(n[1]*i[0]-i[1]*n[0])/a>0?[o>0?G:Y,X]:[o>0?Y:G,W]):[j||N,B||F]):j&&B&&$([j,B])),$([N,F])):j-N&&B-F&&$([N||j,F||B]),U=t,j=N,B=F}else U&&tt(q(U,t)[0]),z[O++]=t;var n,i,a,o}for("linear"===S||"spline"===S?q=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var o=Z[i],s=a(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);s&&(!n||Math.abs(s.x-r[0][0])>1||Math.abs(s.y-r[0][1])>1)&&(s=[s.x,s.y],n&&R(s,t)<R(r[0],t)?r.unshift(s):r.push(s),n++)}return r}:"hv"===S||"vh"===S?q=function(t,e){var r=[],n=J(t),i=J(e);return n&&i&&K(n,i)?r:(n&&r.push(n),i&&r.push(i),r)}:"hvh"===S?q=Q(0,G,Y):"vhv"===S&&(q=Q(1,W,X)),r=0;r<t.length;r++)if(l=D(r)){for(O=0,U=null,et(l),r++;r<t.length;r++){if(!(u=D(r))){if(T)continue;break}if(L){if(!((v=R(u,l))<I(u)*P)){for(p=[(u[0]-l[0])/v,(u[1]-l[1])/v],f=l,g=v,y=x=_=0,d=!1,c=u,r++;r<t.length;r++){if(!(h=D(r))){if(T)continue;break}if(w=(m=[h[0]-l[0],h[1]-l[1]])[0]*p[1]-m[1]*p[0],x=Math.min(x,w),(_=Math.max(_,w))-x>I(h))break;c=h,(b=m[0]*p[0]+m[1]*p[1])>g?(g=b,u=h,d=!1):b<y&&(y=b,f=h,d=!0)}if(d?(et(u),c!==f&&et(f)):(f!==l&&et(f),c!==u&&et(u)),et(c),r>=t.length||!h)break;et(h),l=h}}else et(u)}U&&$([j||U[0],B||U[1]]),C.push(z.slice(0,O))}return C}},{"../../constants/numerical":702,"../../lib":724,"./constants":1054}],1063:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],1064:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n,i,a=null;for(i=0;i<r.length;++i)!0===(n=r[i][0].trace).visible?(n._nexttrace=null,-1!==["tonextx","tonexty","tonext"].indexOf(n.fill)&&(n._prevtrace=a,a&&(a._nexttrace=n)),a=n):n._prevtrace=n._nexttrace=null}},{}],1065:[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":140}],1066:[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,c){var u=o.isBubble(t),f=(t.line||{}).color;(c=c||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:u?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":598,"../../components/colorscale/defaults":608,"../../components/colorscale/has_colorscale":612,"./subtypes":1070}],1067:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../../components/errorbars"),s=t("./subtypes"),l=t("./line_points"),c=t("./link_traces"),u=t("../../lib/polygon").tester;function f(t,e,r,c,f,h,d){var p,m;!function(t,e,r,a,o){var l=r.xaxis,c=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),f=n.extent(i.simpleMap(c.range,c.r2c)),h=a[0].trace;if(!s.hasMarkers(h))return;var d=h.marker.maxdisplayed;if(0===d)return;var p=a.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]}),m=Math.ceil(p.length/d),v=0;o.forEach(function(t,r){var n=t[0].trace;s.hasMarkers(n)&&n.marker.maxdisplayed>0&&r<e&&v++});var g=Math.round(v*m/3+Math.floor(v/3)*m/7.1);a.forEach(function(t){delete t.vis}),p.forEach(function(t,e){0===Math.round((e+g)%m)&&(t.vis=!0)})}(0,e,r,c,f);var v=!!d&&d.duration>0;function g(t){return v?t.transition():t}var y=r.xaxis,b=r.yaxis,x=c[0].trace,_=x.line,w=n.select(h);if(w.call(o.plot,r,d),!0===x.visible){var M,k;g(w).style("opacity",x.opacity);var A=x.fill.charAt(x.fill.length-1);"x"!==A&&"y"!==A&&(A=""),c[0].node3=w;var T="",E=[],S=x._prevtrace;S&&(T=S._prevRevpath||"",k=S._nextFill,E=S._polygons);var L,C,P,z,O,D,I,R,N,F="",j="",B=[],U=i.noop;if(M=x._ownFill,s.hasLines(x)||"none"!==x.fill){for(k&&k.datum(c),-1!==["hv","vh","hvh","vhv"].indexOf(_.shape)?(P=a.steps(_.shape),z=a.steps(_.shape.split("").reverse().join(""))):P=z="spline"===_.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?a.smoothclosed(t.slice(1),_.smoothing):a.smoothopen(t,_.smoothing)}:function(t){return"M"+t.join("L")},O=function(t){return z(t.reverse())},B=l(c,{xaxis:y,yaxis:b,connectGaps:x.connectgaps,baseTolerance:Math.max(_.width||1,3)/4,shape:_.shape,simplify:_.simplify}),N=x._polygons=new Array(B.length),m=0;m<B.length;m++)x._polygons[m]=u(B[m]);B.length&&(D=B[0][0],R=(I=B[B.length-1])[I.length-1]),U=function(t){return function(e){if(L=P(e),C=O(e),F?A?(F+="L"+L.substr(1),j=C+"L"+j.substr(1)):(F+="Z"+L,j=C+"Z"+j):(F=L,j=C),s.hasLines(x)&&e.length>1){var r=n.select(this);if(r.datum(c),t)g(r.style("opacity",0).attr("d",L).call(a.lineGroupStyle)).style("opacity",1);else{var i=g(r);i.attr("d",L),a.singleLineStyle(c,i)}}}}}var V=w.selectAll(".js-line").data(B);g(V.exit()).style("opacity",0).remove(),V.each(U(!1)),V.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(a.lineGroupStyle).each(U(!0)),a.setClipUrl(V,r.layerClipId),B.length?(M?D&&R&&(A?("y"===A?D[1]=R[1]=b.c2p(0,!0):"x"===A&&(D[0]=R[0]=y.c2p(0,!0)),g(M).attr("d","M"+R+"L"+D+"L"+F.substr(1)).call(a.singleFillStyle)):g(M).attr("d",F+"Z").call(a.singleFillStyle)):k&&("tonext"===x.fill.substr(0,6)&&F&&T?("tonext"===x.fill?g(k).attr("d",F+"Z"+T+"Z").call(a.singleFillStyle):g(k).attr("d",F+"L"+T.substr(1)+"Z").call(a.singleFillStyle),x._polygons=x._polygons.concat(E)):(H(k),x._polygons=null)),x._prevRevpath=j,x._prevPolygons=N):(M?H(M):k&&H(k),x._polygons=x._prevRevpath=x._prevPolygons=null);var q=w.selectAll(".points");p=q.data([c]),q.each(Z),p.enter().append("g").classed("points",!0).each(Z),p.exit().remove(),p.each(function(t){var e=!1===t[0].trace.cliponaxis;a.setClipUrl(n.select(this),e?null:r.layerClipId)})}function H(t){g(t).attr("d","M0,0Z")}function G(t){return t.filter(function(t){return t.vis})}function Y(t){return t.id}function W(t){if(t.ids)return Y}function X(){return!1}function Z(e){var o,l=e[0].trace,c=n.select(this),u=s.hasMarkers(l),f=s.hasText(l),h=W(l),d=X,p=X;u&&(d=l.marker.maxdisplayed||l._needsCull?G:i.identity),f&&(p=l.marker.maxdisplayed||l._needsCull?G:i.identity);var m=(o=c.selectAll("path.point").data(d,h)).enter().append("path").classed("point",!0);v&&m.call(a.pointStyle,l,t).call(a.translatePoints,y,b).style("opacity",0).transition().style("opacity",1);var x=u&&a.tryColorscale(l.marker,""),_=u&&a.tryColorscale(l.marker,"line");o.order(),o.each(function(e){var i=n.select(this),o=g(i);a.translatePoint(e,o,y,b)?(a.singlePointStyle(e,o,l,x,_,t),r.layerClipId&&a.hideOutsideRangePoint(e,o,y,b,l.xcalendar,l.ycalendar),l.customdata&&i.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):o.remove()}),v?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=c.selectAll("g").data(p,h)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each(function(t){var e=n.select(this),i=g(e.select("text"));a.translatePoint(t,i,y,b)?r.layerClipId&&a.hideOutsideRangePoint(t,e,y,b,l.xcalendar,l.ycalendar):e.remove()}),o.selectAll("text").call(a.textPointStyle,l,t).each(function(t){var e=y.c2p(t.x),r=b.c2p(t.y);n.select(this).selectAll("tspan.line").each(function(){g(n.select(this)).attr({x:e,y:r})})}),o.exit().remove()}}e.exports=function(t,e,r,i,o){var s,l,u,h,d=e.plot.select("g.scatterlayer"),p=!i,m=!!i&&i.duration>0;for((u=d.selectAll("g.trace").data(r,function(t){return t[0].trace.uid})).enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),c(t,e,r),function(t,e,r){var i;e.selectAll("g.trace").each(function(t){var e=n.select(this);if((i=t[0].trace)._nexttrace){if(i._nextFill=e.select(".js-fill.js-tonext"),!i._nextFill.size()){var o=":first-child";e.select(".js-fill.js-tozero").size()&&(o+=" + *"),i._nextFill=e.insert("path",o).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),i._nextFill=null;i.fill&&("tozero"===i.fill.substr(0,6)||"toself"===i.fill||"to"===i.fill.substr(0,2)&&!i._prevtrace)?(i._ownFill=e.select(".js-fill.js-tozero"),i._ownFill.size()||(i._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),i._ownFill=null),e.selectAll(".js-fill").call(a.setClipUrl,r.layerClipId)})}(0,d,e),s=0,l={};s<r.length;s++)l[r[s][0].trace.uid]=s;(d.selectAll("g.trace").sort(function(t,e){return l[t[0].trace.uid]>l[e[0].trace.uid]?1:-1}),m)?(o&&(h=o()),n.transition().duration(i.duration).ease(i.easing).each("end",function(){h&&h()}).each("interrupt",function(){h&&h()}).each(function(){d.selectAll("g.trace").each(function(n,a){f(t,a,e,n,r,this,i)})})):d.selectAll("g.trace").each(function(n,a){f(t,a,e,n,r,this,i)});p&&u.exit().remove(),d.selectAll("path:not([d])").remove()}},{"../../components/drawing":623,"../../components/errorbars":629,"../../lib":724,"../../lib/polygon":736,"./line_points":1062,"./link_traces":1064,"./subtypes":1070,d3:128}],1068:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r<s.length;r++)s[r].selected=0;else for(r=0;r<s.length;r++)i=s[r],a=l.c2p(i.x),o=c.c2p(i.y),e.contains([a,o])?(u.push({pointNumber:r,x:l.c2d(i.x),y:c.c2d(i.y)}),i.selected=1):i.selected=0;return u}},{"./subtypes":1070}],1069:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/drawing"),a=t("../../components/errorbars");function o(t,e,r){var n=t.selectAll("path.point"),a=t.selectAll("text");i.pointStyle(n,e,r),i.textPointStyle(a,e,r),i.selectedPointStyle(n,e),i.selectedTextStyle(a,e)}e.exports={style:function(t,e){var r=e?e[0].node3:n.select(t).selectAll("g.trace.scatter");r.style("opacity",function(t){return t[0].trace.opacity}),r.selectAll("g.points").each(function(e){o(n.select(this),e.trace||e[0].trace,t)}),r.selectAll("g.trace path.js-line").call(i.lineGroupStyle),r.selectAll("g.trace path.js-fill").call(i.fillGroupStyle),r.call(a.style)},stylePoints:o}},{"../../components/drawing":623,"../../components/errorbars":629,d3:128}],1070:[function(t,e,r){"use strict";var n=t("../../lib");e.exports={hasLines:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("lines")},hasMarkers:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("markers")},hasText:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("text")},isBubble:function(t){return n.isPlainObject(t.marker)&&Array.isArray(t.marker.size)}}},{"../../lib":724}],1071:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,i,a){a=a||{},i("textposition"),n.coerceFont(i,"textfont",r.font),a.noSelect||(i("selected.textfont.color"),i("unselected.textfont.color"))}},{"../../lib":724}],1072:[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");if(n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],r),o)s?a=Math.min(o.length,s.length):(a=o.length,i("y0"),i("dy"));else{if(!s)return 0;a=e.y.length,i("x0"),i("dx")}return e._length=a,a}},{"../../registry":854}],1073:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/colorscale/color_attributes"),a=t("../../components/errorbars/attributes"),o=t("../../plots/attributes"),s=t("../../constants/gl3d_dashes"),l=t("../../constants/gl3d_markers"),c=t("../../lib/extend").extendFlat,u=t("../../plot_api/edit_types").overrideAll,f=n.line,h=n.marker,d=h.line;var p=e.exports=u({x:n.x,y:n.y,z:{valType:"data_array"},text:c({},n.text,{}),hovertext:c({},n.hovertext,{}),mode:c({},n.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}},y:{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}},z:{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}},connectgaps:n.connectgaps,line:c({width:f.width,dash:{valType:"enumerated",values:Object.keys(s),dflt:"solid"},showscale:{valType:"boolean",dflt:!1}},i("line")),marker:c({symbol:{valType:"enumerated",values:Object.keys(l),dflt:"circle",arrayOk:!0},size:c({},h.size,{dflt:8}),sizeref:h.sizeref,sizemin:h.sizemin,sizemode:h.sizemode,opacity:c({},h.opacity,{arrayOk:!1}),showscale:h.showscale,colorbar:h.colorbar,line:c({width:c({},d.width,{arrayOk:!1})},i("marker.line"))},i("marker")),textposition:c({},n.textposition,{dflt:"top center"}),textfont:n.textfont,error_x:a,error_y:a,error_z:a,hoverinfo:c({},o.hoverinfo)},"calc","nested");p.x.editType=p.y.editType=p.z.editType="calc+clearAxisTypes"},{"../../components/colorscale/color_attributes":606,"../../components/errorbars/attributes":625,"../../constants/gl3d_dashes":699,"../../constants/gl3d_markers":700,"../../lib/extend":713,"../../plot_api/edit_types":754,"../../plots/attributes":768,"../scatter/attributes":1048}],1074:[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":1047,"../scatter/colorscale_calc":1053}],1075:[function(t,e,r){"use strict";var n=t("../../components/errorbars/compute_error");function i(t,e,r){if(!e||!e.visible)return null;for(var i=n(e),a=new Array(t.length),o=0;o<t.length;o++){var s=i(+t[o],o);a[o]=[-s[0]*r,s[1]*r]}return a}e.exports=function(t,e){var r=[i(t.x,t.error_x,e[0]),i(t.y,t.error_y,e[1]),i(t.z,t.error_z,e[2])],n=function(t){for(var e=0;e<t.length;e++)if(t[e])return t[e].length;return 0}(r);if(0===n)return null;for(var a=new Array(n),o=0;o<n;o++){for(var s=[[0,0,0],[0,0,0]],l=0;l<3;l++)if(r[l])for(var c=0;c<2;c++)s[c][l]=r[l][o][c];a[o]=s}return a}},{"../../components/errorbars/compute_error":627}],1076:[function(t,e,r){"use strict";var n=t("gl-line3d"),i=t("gl-scatter3d"),a=t("gl-error3d"),o=t("gl-mesh3d"),s=t("delaunay-triangulate"),l=t("../../lib"),c=t("../../lib/str2rgbarray"),u=t("../../lib/gl_format_color"),f=t("../scatter/make_bubble_size_func"),h=t("../../constants/gl3d_dashes"),d=t("../../constants/gl3d_markers"),p=t("./calc_errors");function m(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}var v=m.prototype;function g(t,e){return e(4*t)}function y(t){return d[t]}function b(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,l.identity);return a}function x(t,e){var r,n,i,a,o,s,h,d,m=[],v=t.fullSceneLayout,x=t.dataScale,_=v.xaxis,w=v.yaxis,M=v.zaxis,k=e.marker,A=e.line,T=e.x||[],E=e.y||[],S=e.z||[],L=T.length,C=e.xcalendar,P=e.ycalendar,z=e.zcalendar;for(n=0;n<L;n++)i=_.d2l(T[n],0,C)*x[0],a=w.d2l(E[n],0,P)*x[1],o=M.d2l(S[n],0,z)*x[2],m[n]=[i,a,o];if(Array.isArray(e.text))s=e.text;else if(void 0!==e.text)for(s=new Array(L),n=0;n<L;n++)s[n]=e.text;if(r={position:m,mode:e.mode,text:s},"line"in e&&(r.lineColor=u(A,1,L),r.lineWidth=A.width,r.lineDashes=A.dash),"marker"in e){var O=f(e);r.scatterColor=u(k,1,L),r.scatterSize=b(k.size,L,g,20,O),r.scatterMarker=b(k.symbol,L,y,"\u25cf"),r.scatterLineWidth=k.line.width,r.scatterLineColor=u(k.line,1,L),r.scatterAngle=0}"textposition"in e&&(r.textOffset=(h=e.textposition,d=[0,0],Array.isArray(h)?[0,-1]:(h.indexOf("bottom")>=0&&(d[1]+=1),h.indexOf("top")>=0&&(d[1]-=1),h.indexOf("left")>=0&&(d[0]-=1),h.indexOf("right")>=0&&(d[0]+=1),d)),r.textColor=u(e.textfont,1,L),r.textSize=b(e.textfont.size,L,l.identity,12),r.textFont=e.textfont.family,r.textAngle=0);var D=["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 I=e.projection[D[n]];(r.project[n]=I.show)&&(r.projectOpacity[n]=I.opacity,r.projectScale[n]=I.scale)}r.errorBounds=p(e,x);var R=function(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&&!1!==a.copy_zstyle&&(a=t[2]),a&&(e[i]=a.width/2,r[i]=c(a.color),n=a.thickness)}return{capSize:e,color:r,lineWidth:n}}([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=c(e.surfacecolor),r}function _(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}v.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=this.textLabels:t.textLabel="";var e=t.index=t.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},v.update=function(t){var e,r,l,c,u=this.scene.glplot.gl,f=h.solid;this.data=t;var d=x(this.scene,t);"mode"in d&&(this.mode=d.mode),"lineDashes"in d&&d.lineDashes in h&&(f=h[d.lineDashes]),this.color=_(d.scatterColor)||_(d.lineColor),this.dataPoints=d.position,e={gl:u,position:d.position,color:d.lineColor,lineWidth:d.lineWidth||1,dashes:f[0],dashScale:f[1],opacity:t.opacity,connectGaps:t.connectgaps},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(e):(this.linePlot=n(e),this.linePlot._trace=this,this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var p=t.opacity;if(t.marker&&t.marker.opacity&&(p*=t.marker.opacity),r={gl:u,position:d.position,color:d.scatterColor,size:d.scatterSize,glyph:d.scatterMarker,opacity:p,orthographic:!0,lineWidth:d.scatterLineWidth,lineColor:d.scatterLineColor,project:d.project,projectScale:d.projectScale,projectOpacity:d.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(r):(this.scatterPlot=i(r),this.scatterPlot._trace=this,this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),c={gl:u,position:d.position,glyph:d.text,color:d.textColor,size:d.textSize,angle:d.textAngle,alignment:d.textOffset,font:d.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:t.opacity},this.textLabels=t.hovertext||t.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(c):(this.textMarkers=i(c),this.textMarkers._trace=this,this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),l={gl:u,position:d.position,color:d.errorColor,error:d.errorBounds,lineWidth:d.errorLineWidth,capSize:d.errorCapSize,opacity:t.opacity},this.errorBars?d.errorBounds?this.errorBars.update(l):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):d.errorBounds&&(this.errorBars=a(l),this.errorBars._trace=this,this.scene.glplot.add(this.errorBars)),d.delaunayAxis>=0){var m=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],l=[];for(n=0;n<t.length;++n){var c=t[n];!isNaN(c[i])&&isFinite(c[i])&&!isNaN(c[a])&&isFinite(c[a])&&(o.push([c[i],c[a]]),l.push(n))}var u=s(o);for(n=0;n<u.length;++n)for(var f=u[n],h=0;h<f.length;++h)f[h]=l[f[h]];return{positions:t,cells:u,meshColor:e}}(d.position,d.delaunayColor,d.delaunayAxis);m.opacity=t.opacity,this.delaunayMesh?this.delaunayMesh.update(m):(m.gl=u,this.delaunayMesh=o(m),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},v.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=function(t,e){var r=new m(t,e.uid);return r.update(e),r}},{"../../constants/gl3d_dashes":699,"../../constants/gl3d_markers":700,"../../lib":724,"../../lib/gl_format_color":720,"../../lib/str2rgbarray":746,"../scatter/make_bubble_size_func":1065,"./calc_errors":1075,"delaunay-triangulate":130,"gl-error3d":168,"gl-line3d":177,"gl-mesh3d":201,"gl-scatter3d":216}],1077:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/text_defaults"),c=t("../../components/errorbars/defaults"),u=t("./attributes");e.exports=function(t,e,r,f){function h(r,n){return i.coerce(t,e,u,r,n)}if(function(t,e,r,i){var a=0,o=r("x"),s=r("y"),l=r("z");n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],i),o&&s&&l&&(a=Math.min(o.length,s.length,l.length),e._xlength=e._ylength=e._zlength=a);return a}(t,e,h,f)){h("text"),h("hovertext"),h("mode"),a.hasLines(e)&&(h("connectgaps"),s(t,e,r,f,h)),a.hasMarkers(e)&&o(t,e,r,f,h,{noSelect:!0}),a.hasText(e)&&l(t,e,f,h,{noSelect:!0});var d=(e.line||{}).color,p=(e.marker||{}).color;h("surfaceaxis")>=0&&h("surfacecolor",d||p);for(var m=["x","y","z"],v=0;v<3;++v){var g="projection."+m[v];h(g+".show")&&(h(g+".opacity"),h(g+".scale"))}c(t,e,r,{axis:"z"}),c(t,e,r,{axis:"y",inherit:"z"}),c(t,e,r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../components/errorbars/defaults":628,"../../lib":724,"../../registry":854,"../scatter/line_defaults":1061,"../scatter/marker_defaults":1066,"../scatter/subtypes":1070,"../scatter/text_defaults":1071,"./attributes":1073}],1078:[function(t,e,r){"use strict";var n={};n.plot=t("./convert"),n.attributes=t("./attributes"),n.markerSymbols=t("../../constants/gl3d_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/gl3d_markers":700,"../../plots/gl3d":813,"../scatter/colorbar":1052,"./attributes":1073,"./calc":1074,"./convert":1076,"./defaults":1077}],1079:[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,c=n.line,u=l.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:s({},n.mode,{dflt:"markers"}),text:s({},n.text,{}),line:{color:c.color,width:c.width,dash:c.dash,shape:s({},c.shape,{values:["linear","spline"]}),smoothing:c.smoothing,editType:"calc"},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:u.width,editType:"calc"},a("marker".line)),gradient:l.gradient,editType:"calc"},a("marker"),{showscale:l.showscale,colorbar:o}),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:s({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron}},{"../../components/colorbar/attributes":599,"../../components/colorscale/color_attributes":606,"../../lib/extend":713,"../../plots/attributes":768,"../scatter/attributes":1048}],1080:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../scatter/colorscale_calc"),a=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e.carpetTrace=l(t,e);if(r&&r.visible&&"legendonly"!==r.visible){var c;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var u,f,h=e.a.length,d=new Array(h),p=!1;for(c=0;c<h;c++)if(u=e.a[c],f=e.b[c],n(u)&&n(f)){var m=r.ab2xy(+u,+f,!0),v=r.isVisible(+u,+f);v||(p=!0),d[c]={x:m[0],y:m[1],a:u,b:f,vis:v}}else d[c]={x:!1,y:!1};return e._needsCull=p,d[0].carpet=r,d[0].trace=e,s(e,h),i(e),a(d,e),o(d,e),d}}},{"../carpet/lookup_carpetid":912,"../scatter/arrays_to_calcdata":1047,"../scatter/calc":1049,"../scatter/calc_selection":1050,"../scatter/colorscale_calc":1053,"fast-isnumeric":140}],1081:[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"),c=t("../scatter/text_defaults"),u=t("../scatter/fillcolor_defaults"),f=t("./attributes");e.exports=function(t,e,r,h){function d(r,i){return n.coerce(t,e,f,r,i)}d("carpet"),e.xaxis="x",e.yaxis="y";var p,m=d("a"),v=d("b");if(p=Math.min(m.length,v.length)){m&&p<m.length&&(e.a=m.slice(0,p)),v&&p<v.length&&(e.b=v.slice(0,p)),d("text"),d("mode",p<i.PTS_LINESONLY?"lines+markers":"lines"),a.hasLines(e)&&(s(t,e,r,h,d),l(t,e,d),d("connectgaps")),a.hasMarkers(e)&&o(t,e,r,h,d,{gradient:!0}),a.hasText(e)&&c(t,e,h,d);var g=[];(a.hasMarkers(e)||a.hasText(e))&&(d("marker.maxdisplayed"),g.push("points")),d("fill"),"none"!==e.fill&&(u(t,e,r,d),a.hasLines(e)||l(t,e,d)),"tonext"!==e.fill&&"toself"!==e.fill||g.push("fills"),d("hoveron",g.join("+")||"points"),n.coerceSelectionMarkerOpacity(e,d)}else e.visible=!1}},{"../../lib":724,"../scatter/constants":1054,"../scatter/fillcolor_defaults":1057,"../scatter/line_defaults":1061,"../scatter/line_shape_defaults":1063,"../scatter/marker_defaults":1066,"../scatter/subtypes":1070,"../scatter/text_defaults":1071,"./attributes":1079}],1082:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){var a=n[i];return t.a=a.a,t.b=a.b,t}},{}],1083:[function(t,e,r){"use strict";var n=t("../scatter/hover");e.exports=function(t,e,r,i){var a=n(t,e,r,i);if(a&&!1!==a[0].index){var o=a[0];if(void 0===o.index){var s=1-o.y0/t.ya._length,l=t.xa._length,c=l*s/2,u=l-c;return o.x0=Math.max(Math.min(o.x0,u),c),o.x1=Math.max(Math.min(o.x1,u),c),a}var f=o.cd[o.index];o.a=f.a,o.b=f.b,o.xLabelVal=void 0,o.yLabelVal=void 0;var h=o.trace,d=h._carpet,p=(f.hi||h.hoverinfo).split("+"),m=[];-1!==p.indexOf("all")&&(p=["a","b"]),-1!==p.indexOf("a")&&w(d.aaxis,f.a),-1!==p.indexOf("b")&&w(d.baxis,f.b);var v=d.ab2ij([f.a,f.b]),g=Math.floor(v[0]),y=v[0]-g,b=Math.floor(v[1]),x=v[1]-b,_=d.evalxy([],g,b,y,x);return m.push("y: "+_[1].toFixed(3)),o.extraText=m.join("<br>"),a}function w(t,e){var r;r=t.labelprefix&&t.labelprefix.length>0?t.labelprefix.replace(/ = $/,""):t._hovertitle,m.push(r+": "+e.toFixed(3)+t.labelsuffix)}}},{"../scatter/hover":1059}],1084:[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("../scatter/style").style,n.hoverPoints=t("./hover"),n.selectPoints=t("../scatter/select"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="scattercarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["carpet","symbols","markerColorscale","showLegend","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":781,"../scatter/colorbar":1052,"../scatter/select":1068,"../scatter/style":1069,"./attributes":1079,"./calc":1080,"./defaults":1081,"./event_data":1082,"./hover":1083,"./plot":1085}],1085:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../plots/cartesian/axes"),a=t("../../components/drawing");e.exports=function(t,e,r){var o,s,l,c=r[0][0].carpet,u={xaxis:i.getFromId(t,c.xaxis||"x"),yaxis:i.getFromId(t,c.yaxis||"y"),plot:e.plot};for(n(t,u,r),o=0;o<r.length;o++)s=r[o][0].trace,l=u.plot.selectAll("g.trace"+s.uid+" .js-line"),a.setClipUrl(l,c._clipPathId)}},{"../../components/drawing":623,"../../plots/cartesian/axes":770,"../scatter/plot":1067}],1086:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/drawing/attributes").dash,s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll,c=n.marker,u=n.line,f=c.line;e.exports=l({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:s({},n.mode,{dflt:"markers"}),text:s({},n.text,{}),hovertext:s({},n.hovertext,{}),textfont:n.textfont,textposition:n.textposition,line:{color:u.color,width:u.width,dash:o},connectgaps:n.connectgaps,marker:s({symbol:c.symbol,opacity:c.opacity,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,showscale:c.showscale,colorbar:c.colorbar,line:s({width:f.width},a("marker.line")),gradient:c.gradient},a("marker")),fill:{valType:"enumerated",values:["none","toself"],dflt:"none"},fillcolor:n.fillcolor,selected:n.selected,unselected:n.unselected,hoverinfo:s({},i.hoverinfo,{flags:["lon","lat","location","text","name"]})},"calc","nested")},{"../../components/colorscale/color_attributes":606,"../../components/drawing/attributes":622,"../../lib/extend":713,"../../plot_api/edit_types":754,"../../plots/attributes":768,"../scatter/attributes":1048}],1087:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../scatter/colorscale_calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection"),l=t("../../lib")._;e.exports=function(t,e){for(var r=Array.isArray(e.locations),c=r?e.locations.length:e._length,u=new Array(c),f=0;f<c;f++){var h=u[f]={};if(r){var d=e.locations[f];h.loc="string"==typeof d?d:null}else{var p=e.lon[f],m=e.lat[f];n(p)&&n(m)?h.lonlat=[+p,+m]:h.lonlat=[i,i]}}return o(u,e),a(e),s(u,e),c&&(u[0].t={labels:{lat:l(t,"lat:")+" ",lon:l(t,"lon:")+" "}}),u}},{"../../constants/numerical":702,"../../lib":724,"../scatter/arrays_to_calcdata":1047,"../scatter/calc_selection":1050,"../scatter/colorscale_calc":1053,"fast-isnumeric":140}],1088:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/subtypes"),a=t("../scatter/marker_defaults"),o=t("../scatter/line_defaults"),s=t("../scatter/text_defaults"),l=t("../scatter/fillcolor_defaults"),c=t("./attributes");e.exports=function(t,e,r,u){function f(r,i){return n.coerce(t,e,c,r,i)}!function(t,e,r){var n,i,a=0,o=r("locations");if(o)return r("locationmode"),a=o.length;return n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length),e._length=a,a}(0,e,f)?e.visible=!1:(f("text"),f("hovertext"),f("mode"),i.hasLines(e)&&(o(t,e,r,u,f),f("connectgaps")),i.hasMarkers(e)&&a(t,e,r,u,f,{gradient:!0}),i.hasText(e)&&s(t,e,u,f),f("fill"),"none"!==e.fill&&l(t,e,r,f))}},{"../../lib":724,"../scatter/fillcolor_defaults":1057,"../scatter/line_defaults":1061,"../scatter/marker_defaults":1066,"../scatter/subtypes":1070,"../scatter/text_defaults":1071,"./attributes":1086}],1089:[function(t,e,r){"use strict";e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.location=e.loc?e.loc:null,t}},{}],1090:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../plots/cartesian/axes"),a=t("../../constants/numerical").BADNUM,o=t("../scatter/get_trace_color"),s=t("../scatter/fill_hover_text"),l=t("./attributes");e.exports=function(t,e,r){var c=t.cd,u=c[0].trace,f=t.xa,h=t.ya,d=t.subplot,p=d.projection.isLonLatOverEdges,m=d.project;if(n.getClosest(c,function(t){var n=t.lonlat;if(n[0]===a)return 1/0;if(p(n))return 1/0;var i=m(n),o=m([e,r]),s=Math.abs(i[0]-o[0]),l=Math.abs(i[1]-o[1]),c=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(s*s+l*l)-c,1-3/c)},t),!1!==t.index){var v=c[t.index],g=v.lonlat,y=[f.c2p(g),h.c2p(g)],b=v.mrc||1;return t.x0=y[0]-b,t.x1=y[0]+b,t.y0=y[1]-b,t.y1=y[1]+b,t.loc=v.loc,t.lon=g[0],t.lat=g[1],t.color=o(u,v),t.extraText=function(t,e,r,n){var a=e.hi||t.hoverinfo,o="all"===a?l.hoverinfo.flags:a.split("+"),c=-1!==o.indexOf("location")&&Array.isArray(t.locations),u=-1!==o.indexOf("lon"),f=-1!==o.indexOf("lat"),h=-1!==o.indexOf("text"),d=[];function p(t){return i.tickText(r,r.c2l(t),"hover").text+"\xb0"}c?d.push(e.loc):u&&f?d.push("("+p(e.lonlat[0])+", "+p(e.lonlat[1])+")"):u?d.push(n.lon+p(e.lonlat[0])):f&&d.push(n.lat+p(e.lonlat[1]));h&&s(e,t,d);return d.join("<br>")}(u,v,d.mockAxis,c[0].t.labels),[t]}}},{"../../components/fx":640,"../../constants/numerical":702,"../../plots/cartesian/axes":770,"../scatter/fill_hover_text":1056,"../scatter/get_trace_color":1058,"./attributes":1086}],1091:[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.eventData=t("./event_data"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scattergeo",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","symbols","markerColorscale","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/geo":801,"../scatter/colorbar":1052,"./attributes":1086,"./calc":1087,"./defaults":1088,"./event_data":1089,"./hover":1090,"./plot":1092,"./select":1093,"./style":1094}],1092:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM,o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../lib/geo_location_utils").locationToFeature,l=t("../../lib/geojson_utils"),c=t("../scatter/subtypes"),u=t("./style");function f(t,e){var r=t[0].trace;if(Array.isArray(r.locations))for(var n=o(r,e),i=r.locationmode,l=0;l<t.length;l++){var c=t[l],u=s(i,c.loc,n);c.lonlat=u?u.properties.ct:[a,a]}}e.exports=function(t,e,r){for(var o=0;o<r.length;o++)f(r[o],e.topojson);function s(t,e){t.lonlat[0]===a&&n.select(e).remove()}var h=e.layers.frontplot.select(".scatterlayer").selectAll("g.trace.scattergeo").data(r,function(t){return t[0].trace.uid});h.enter().append("g").attr("class","trace scattergeo"),h.exit().remove(),h.selectAll("*").remove(),h.each(function(e){var r=e[0].node3=n.select(this),a=e[0].trace;if(c.hasLines(a)||"none"!==a.fill){var o=l.calcTraceToLineCoords(e),f="none"!==a.fill?l.makePolygon(o):l.makeLine(o);r.selectAll("path.js-line").data([{geojson:f,trace:a}]).enter().append("path").classed("js-line",!0).style("stroke-miterlimit",2)}c.hasMarkers(a)&&r.selectAll("path.point").data(i.identity).enter().append("path").classed("point",!0).each(function(t){s(t,this)}),c.hasText(a)&&r.selectAll("g").data(i.identity).enter().append("g").append("text").each(function(t){s(t,this)}),u(t,e)})}},{"../../constants/numerical":702,"../../lib":724,"../../lib/geo_location_utils":716,"../../lib/geojson_utils":717,"../../lib/topojson_utils":750,"../scatter/subtypes":1070,"./style":1094,d3:128}],1093:[function(t,e,r){"use strict";var n=t("../scatter/subtypes");e.exports=function(t,e){var r,i,a,o,s,l=t.cd,c=t.xaxis,u=t.yaxis,f=[],h=l[0].trace;if(!n.hasMarkers(h)&&!n.hasText(h))return[];if(!1===e)for(s=0;s<l.length;s++)l[s].selected=0;else for(s=0;s<l.length;s++)i=(r=l[s]).lonlat,a=c.c2p(i),o=u.c2p(i),e.contains([a,o])?(f.push({pointNumber:s,lon:i[0],lat:i[1]}),r.selected=1):r.selected=0;return f}},{"../scatter/subtypes":1070}],1094:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/drawing"),a=t("../../components/color"),o=t("../scatter/style").stylePoints;e.exports=function(t,e){e&&function(t,e){var r=e[0].trace,s=e[0].node3;s.style("opacity",e[0].trace.opacity),o(s,r,t),s.selectAll("path.js-line").style("fill","none").each(function(t){var e=n.select(this),r=t.trace,o=r.line||{};e.call(a.stroke,o.color).call(i.dashLine,o.dash||"",o.width||0),"none"!==r.fill&&e.call(a.fill,r.fillcolor)})}(t,e)}},{"../../components/color":598,"../../components/drawing":623,"../scatter/style":1069,d3:128}],1095:[function(t,e,r){"use strict";var n=t("../../plots/attributes"),i=t("../scatter/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../constants/gl2d_dashes"),s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll,c=i.line,u=i.marker,f=u.line,h=e.exports=l({x:i.x,x0:i.x0,dx:i.dx,y:i.y,y0:i.y0,dy:i.dy,text:s({},i.text,{}),mode:{valType:"flaglist",flags:["lines","markers"],extras:["none"]},line:{color:c.color,width:c.width,dash:{valType:"enumerated",values:Object.keys(o),dflt:"solid"}},marker:s({},a("marker"),{symbol:u.symbol,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,opacity:u.opacity,showscale:u.showscale,colorbar:u.colorbar,line:s({},a("marker.line"),{width:f.width})}),connectgaps:i.connectgaps,fill:i.fill,fillcolor:i.fillcolor,hoveron:i.hoveron,selected:{marker:i.selected.marker},unselected:{marker:i.unselected.marker},opacity:s({},n.opacity,{editType:"calc"}),error_y:i.error_y,error_x:i.error_x},"calc","nested");h.x.editType=h.y.editType=h.x0.editType=h.y0.editType="calc+clearAxisTypes"},{"../../components/colorscale/color_attributes":606,"../../constants/gl2d_dashes":698,"../../lib/extend":713,"../../plot_api/edit_types":754,"../../plots/attributes":768,"../scatter/attributes":1048}],1096:[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"),c=t("../scatter/fillcolor_defaults"),u=t("../../components/errorbars/defaults"),f=t("./attributes");e.exports=function(t,e,r,h){function d(r,i){return n.coerce(t,e,f,r,i)}var p=!!t.marker&&/-open/.test(t.marker.symbol),m=a.isBubble(t),v=o(t,e,h,d);if(v){d("text"),d("mode",v<i.PTS_LINESONLY?"lines+markers":"lines"),a.hasLines(e)&&(d("connectgaps"),l(t,e,r,h,d));var g=[];a.hasMarkers(e)&&(s(t,e,r,h,d),d("marker.line.width",p||m?1:0),g.push("points")),d("fill"),"none"!==e.fill&&c(t,e,r,d),"tonext"!==e.fill&&"toself"!==e.fill||g.push("fills"),d("hoveron",g.join("+")||"points"),u(t,e,r,{axis:"y"}),u(t,e,r,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(e,d)}else e.visible=!1}},{"../../components/errorbars/defaults":628,"../../lib":724,"../scatter/constants":1054,"../scatter/fillcolor_defaults":1057,"../scatter/line_defaults":1061,"../scatter/marker_defaults":1066,"../scatter/subtypes":1070,"../scatter/xy_defaults":1072,"./attributes":1095}],1097:[function(t,e,r){(function(r){"use strict";var n=t("../../lib"),i=t("../scatter/get_trace_color"),a=t("../../components/errorbars"),o=t("object-assign"),s=t("../../plots/cartesian/axes"),l=t("kdgrass"),c=t("../../components/fx"),u=t("../scatter/subtypes"),f=t("../scatter/colorscale_calc"),h=t("../../components/drawing"),d=t("../scatter/make_bubble_size_func"),p=t("../../constants/gl2d_dashes"),m=t("../../lib/gl_format_color"),v=t("../scatter/link_traces"),g=t("regl-scatter2d"),y=t("regl-line2d"),b=t("regl-error2d"),x=t("color-normalize"),_=t("svg-path-sdf"),w=t("regl"),M=t("array-range"),k=t("../scatter/fill_hover_text"),A=t("fast-isnumeric"),T=c.constants.MAXDIST,E=200,S=20,L=S/20,C={},P=h.symbolFuncs[0](.05*S),z=1e5,O=/-dot/;function D(t,e,r,n){var i,l,c,f,h,v,g,y,b,_,w,M,k,A,T,E=t._fullLayout,S=n.length/2,L=r.marker,C=0,P=0,O=s.getFromId(t,r.xaxis),D=s.getFromId(t,r.yaxis);!0!==r.visible?(l=!1,c=!1,f=!1,v=!1,g=!1):(l=u.hasLines(r)&&n.length>1,c=r.error_x&&!0===r.error_x.visible,f=r.error_y&&!0===r.error_y.visible,h=c||f,v=u.hasMarkers(r),g=!!r.fill&&"none"!==r.fill);var I=h?a.calcFromTrace(r,E):null;if(c){(_={}).positions=n;var N=new Float64Array(4*S);if("log"===O.type)for(i=0;i<S;++i)N[C++]=n[2*i]-O.d2l(I[i].xs)||0,N[C++]=O.d2l(I[i].xh)-n[2*i]||0,N[C++]=0,N[C++]=0;else for(i=0;i<S;++i)N[C++]=n[2*i]-I[i].xs||0,N[C++]=I[i].xh-n[2*i]||0,N[C++]=0,N[C++]=0;r.error_x.copy_ystyle&&(r.error_x=r.error_y),_.errors=N,_.capSize=2*r.error_x.width,_.lineWidth=r.error_x.thickness,_.color=r.error_x.color}if(f){(w={}).positions=n;var F=new Float64Array(4*S);if("log"===D.type)for(i=0;i<S;++i)F[P++]=0,F[P++]=0,F[P++]=n[2*i+1]-D.d2l(I[i].ys)||0,F[P++]=D.d2l(I[i].yh)-n[2*i+1]||0;else for(i=0;i<S;++i)F[P++]=0,F[P++]=0,F[P++]=n[2*i+1]-I[i].ys||0,F[P++]=I[i].yh-n[2*i+1]||0;w.errors=F,w.capSize=2*r.error_y.width,w.lineWidth=r.error_y.thickness,w.color=r.error_y.color}if(l){(y={}).thickness=r.line.width,y.color=r.line.color,y.opacity=r.opacity,y.overlay=!0;var j=(p[r.line.dash]||[1]).slice();for(i=0;i<j.length;++i)j[i]*=y.thickness;if(y.dashes=j,"hv"===r.line.shape){for(T=[],i=0;i<Math.floor(n.length/2)-1;i++)isNaN(n[2*i])||isNaN(n[2*i+1])?(T.push(NaN),T.push(NaN),T.push(NaN),T.push(NaN)):(T.push(n[2*i]),T.push(n[2*i+1]),T.push(n[2*i+2]),T.push(n[2*i+1]));T.push(n[n.length-2]),T.push(n[n.length-1])}else if("vh"===r.line.shape){for(T=[],i=0;i<Math.floor(n.length/2)-1;i++)isNaN(n[2*i])||isNaN(n[2*i+1])?(T.push(NaN),T.push(NaN),T.push(NaN),T.push(NaN)):(T.push(n[2*i]),T.push(n[2*i+1]),T.push(n[2*i]),T.push(n[2*i+3]));T.push(n[n.length-2]),T.push(n[n.length-1])}else T=n;var B=!1;for(i=0;i<T.length;i++)if(isNaN(T[i])){B=!0;break}if(y.join=B||T.length>z?"rect":v?"rect":"round",B&&r.connectgaps){var U=T[0],V=T[1];for(i=0;i<T.length;i+=2)isNaN(T[i])||isNaN(T[i+1])?(T[i]=U,T[i+1]=V):(U=T[i],V=T[i+1])}y.positions=T}function q(t,e){var r={};return t?(t.marker&&t.marker.symbol?r=H(o({},e,t.marker)):(r={},t.marker.size&&(r.sizes=t.marker.size),t.marker.color&&(r.colors=t.marker.color),void 0!==t.marker.opacity&&(r.opacity=t.marker.opacity)),r):r}function H(t){var e,n,i,a={},o=Array.isArray(t.symbol);if(o||(n=/-open/.test(t.symbol)),o||Array.isArray(t.color)||Array.isArray(t.line.color)||Array.isArray(t.line)||Array.isArray(t.opacity)){a.colors=new Array(S),a.borderColors=new Array(S);var s=m(t,t.opacity,S),l=m(t.line,t.opacity,S);if(!Array.isArray(l[0])){var c=l;for(l=Array(S),e=0;e<S;e++)l[e]=c}if(!Array.isArray(s[0])){var u=s;for(s=Array(S),e=0;e<S;e++)s[e]=u}for(a.colors=s,a.borderColors=l,e=0;e<S;e++)o&&(i=t.symbol[e],n=/-open/.test(i)),n&&(l[e]=s[e].slice(),s[e]=s[e].slice(),s[e][3]=0);a.opacity=r.opacity}else n?(a.color=x(t.color,"uint8"),a.color[3]=0,a.borderColor=x(t.color,"uint8")):(a.color=x(t.color,"uint8"),a.borderColor=x(t.line.color,"uint8")),a.opacity=r.opacity*t.opacity;if(Array.isArray(t.symbol))for(a.markers=new Array(S),e=0;e<S;++e)a.markers[e]=R(t.symbol[e]);else a.marker=R(t.symbol);var f,h,p=t&&(Array.isArray(t.size)||Array.isArray(t.line.width)),v=d(r);if(p){h=a.sizes=new Array(S);var g=a.borderSizes=new Array(S);if(Array.isArray(t.size))for(e=0;e<S;++e)h[e]=v(t.size[e]);else for(f=v(t.size),e=0;e<S;++e)h[e]=f;if(Array.isArray(t.line.width))for(e=0;e<S;++e)g[e]=v(t.line.width[e]);else for(f=v(t.line.width),e=0;e<S;++e)g[e]=f}else f=a.size=v(t&&t.size||10),a.borderSizes=v(t.line.width);return a}return g&&((M={}).fill=r.fillcolor,M.thickness=0,M.closed=!0),v&&(b=H(L),k=q(r.selected,L),A=q(r.unselected,L),b.positions=n),{line:y,marker:b,errorX:_,errorY:w,fill:M,selected:k,unselected:A}}function I(t,e){var r=e._scene,n=t._fullLayout;return e._scene||((r=e._scene={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],selectedOptions:[],unselectedOptions:[],errorXOptions:[],errorYOptions:[],selectBatch:null,unselectBatch:null,fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,select2d:null}).update=function(t){for(var e=Array(r.count),n=0;n<r.count;n++)e[n]=t;r.fill2d&&r.fill2d.update(e),r.scatter2d&&r.scatter2d.update(e),r.line2d&&r.line2d.update(e),r.error2d&&r.error2d.update(e.concat(e)),r.select2d&&r.select2d.update(e),r.draw()},r.draw=function(){var t;for(t=0;t<r.count;t++)r.fill2d&&r.fill2d.draw(t);for(t=0;t<r.count;t++)r.line2d&&r.line2d.draw(t),r.error2d&&(r.error2d.draw(t),r.error2d.draw(t+r.count)),r.scatter2d&&(r.selectBatch&&r.selectBatch[t]||r.scatter2d.draw(t));r.select2d&&r.selectBatch&&(r.select2d.draw(r.selectBatch),r.scatter2d.draw(r.unselectBatch)),r.dirty=!1},r.clear=function(){var t,i,a=n._size,o=n.width,s=n.height,l=e.xaxis,c=e.yaxis;t=l&&l.domain&&c&&c.domain?[a.l+l.domain[0]*a.w,a.b+c.domain[0]*a.h,o-a.r-(1-l.domain[1])*a.w,s-a.t-(1-c.domain[1])*a.h]:[a.l,a.b,o-a.r,s-a.t],r.select2d&&((i=r.select2d.regl._gl).enable(i.SCISSOR_TEST),i.scissor(t[0],t[1],t[2]-t[0],t[3]-t[1]),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT)),r.scatter2d&&((i=r.scatter2d.regl._gl).enable(i.SCISSOR_TEST),i.scissor(t[0],t[1],t[2]-t[0],t[3]-t[1]),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT))},r.clearSelect=function(){r.selectBatch&&(r.selectBatch=null,r.unselectBatch=null,r.scatter2d.update(r.markerOptions),r.clear(),r.draw())},r.destroy=function(){r.fill2d&&r.fill2d.destroy(),r.scatter2d&&r.scatter2d.destroy(),r.error2d&&r.error2d.destroy(),r.line2d&&r.line2d.destroy(),r.select2d&&r.select2d.destroy(),r.lineOptions=null,r.fillOptions=null,r.markerOptions=null,r.selectedOptions=null,r.unselectedOptions=null,r.errorXOptions=null,r.errorYOptions=null,r.selectBatch=null,r.unselectBatch=null,delete e._scene}),r.dirty||(r.dirty=!0,r.count=0,r.lineOptions=[],r.fillOptions=[],r.markerOptions=[],r.selectedOptions=[],r.unselectedOptions=[],r.errorXOptions=[],r.errorYOptions=[]),r}function R(t){if("circle"===t)return null;var e,r,n=h.symbolNumber(t),i=h.symbolFuncs[n%100],a=!!h.symbolNoDot[n%100],o=!!h.symbolNoFill[n%100],s=O.test(t);return C[t]?C[t]:(e=s&&!a?i(1.1*S)+P:i(S),r=_(e,{w:E,h:E,viewBox:[-S,-S,S,S],stroke:o?L:-L}),C[t]=r,r||null)}e.exports={moduleType:"trace",name:"scattergl",basePlotModule:t("../../plots/cartesian"),categories:["gl","regl","cartesian","symbols","errorBarsOK","markerColorscale","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults"),cleanData:t("../scatter/clean_data"),colorbar:t("../scatter/colorbar"),calc:function(t,e){var r,n,i,a,o=t._fullLayout,c={},u=s.getFromId(t,e.xaxis),h=s.getFromId(t,e.yaxis),d=o._plots[e.xaxis+e.yaxis],p="linear"===u.type?e.x:u.makeCalcdata(e,"x"),m="linear"===h.type?e.y:h.makeCalcdata(e,"y"),v=e._length;if(!p)for(p=Array(v),n=0;n<v;n++)p[n]=n;if(!m)for(m=Array(v),n=0;n<v;n++)m[n]=n;var g="log"===u.type||p.length>v?p.slice(0,v):p,y="log"===h.type||m.length>v?m.slice(0,v):m,b="log"===u.type?u.d2l:parseFloat,x="log"===h.type?h.d2l:parseFloat;for(r=new Array(2*v),n=0;n<v;n++)p[n]=b(p[n]),m[n]=x(m[n]),i=A(p[n])?+p[n]:NaN,a=A(m[n])?+m[n]:NaN,r[2*n]=i,r[2*n+1]=a;if("log"!==u.type&&"log"!==h.type)c.tree=l(r,512);else{var _=c.ids=Array(v);for(n=0;n<v;n++)_[n]=n}f(e);var w=D(t,0,e,r);if(w.markers)if(Array.isArray(w.markers.sizes)){var M=w.markers.sizes;s.expand(u,g,{padded:!0,ppad:M}),s.expand(h,y,{padded:!0,ppad:M})}else{var k=[1/0,-1/0],T=[1/0,-1/0],E=w.markers.size;for(n=0;n<v;n++)i=p[n],a=m[n],k[0]>i&&(k[0]=i),k[1]<i&&(k[1]=i),T[0]>a&&(T[0]=a),T[1]<a&&(T[1]=a);v<z?(s.expand(u,g,{padded:!0,ppad:E}),s.expand(h,y,{padded:!0,ppad:E})):(u._min&&u._min.push({val:k[0],pad:E}),u._max&&u._max.push({val:k[1],pad:E}),h._min&&h._min.push({val:T[0],pad:E}),h._max&&h._max.push({val:T[1],pad:E}))}else s.expand(u,g,{padded:!0}),s.expand(h,y,{padded:!0});var S=I(t,d);return w.fill&&!S.fill2d&&(S.fill2d=!0),w.marker&&!S.scatter2d&&(S.scatter2d=!0),w.line&&!S.line2d&&(S.line2d=!0),!w.errorX&&!w.errorY||S.error2d||(S.error2d=!0),S.lineOptions.push(w.line),S.errorXOptions.push(w.errorX),S.errorYOptions.push(w.errorY),S.fillOptions.push(w.fill),S.markerOptions.push(w.marker),S.selectedOptions.push(w.selected),S.unselectedOptions.push(w.unselected),S.count++,c.scene=S,c.index=S.count-1,c.x=p,c.y=m,c.rawx=g,c.rawy=y,c.positions=r,c.count=v,[{x:!1,y:!1,t:c,trace:e}]},plot:function(t,e,n){if(n.length){var i=t._fullLayout,a=n[0][0].t.scene,o=i.dragmode;if(a){var l=i._size,c=i.width,u=i.height;i._glcanvas.each(function(e){e.regl||e.pick||(e.regl=w({canvas:this,attributes:{antialias:!e.pick,preserveDrawingBuffer:!0},extensions:["ANGLE_instanced_arrays","OES_element_index_uint"],pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio}))});var f=i._glcanvas.data()[0].regl;if(v(t,e,n),a.dirty){if(!0===a.error2d&&(a.error2d=b(f)),!0===a.line2d&&(a.line2d=y(f)),!0===a.scatter2d&&(a.scatter2d=g(f)),!0===a.fill2d&&(a.fill2d=y(f)),a.line2d&&a.line2d.update(a.lineOptions),a.error2d){var h=(a.errorXOptions||[]).concat(a.errorYOptions||[]);a.error2d.update(h)}a.scatter2d&&a.scatter2d.update(a.markerOptions),a.fill2d&&(a.fillOptions.forEach(function(t,e){var r=n[e];if(t&&r&&r[0]&&r[0].trace){var i,o,s=r[0],l=s.trace,c=s.t,u=a.lineOptions[e],f=[],h=u&&u.positions||c.positions;if("tozeroy"===l.fill)(f=(f=[h[0],0]).concat(h)).push(h[h.length-2]),f.push(0);else if("tozerox"===l.fill)(f=(f=[0,h[1]]).concat(h)).push(0),f.push(h[h.length-1]);else if("toself"===l.fill||"tonext"===l.fill){for(f=[],i=0,o=0;o<h.length;o+=2)(isNaN(h[o])||isNaN(h[o+1]))&&((f=f.concat(h.slice(i,o))).push(h[i],h[i+1]),i=o+2);f=f.concat(h.slice(i)),i&&f.push(h[i],h[i+1])}else{var d=l._nexttrace;if(d){var p=a.lineOptions[e+1];if(p){var m=p.positions;if("tonexty"===l.fill){for(f=h.slice(),e=Math.floor(m.length/2);e--;){var v=m[2*e],g=m[2*e+1];isNaN(v)||isNaN(g)||(f.push(v),f.push(g))}t.fill=d.fillcolor}}}}if(l._prevtrace&&"tonext"===l._prevtrace.fill){var y=a.lineOptions[e-1].positions,b=f.length/2,x=[i=b];for(o=0;o<y.length;o+=2)(isNaN(y[o])||isNaN(y[o+1]))&&(x.push(o/2+b+1),i=o+2);f=f.concat(y),t.hole=x}t.opacity=l.opacity,t.positions=f}}),a.fill2d.update(a.fillOptions))}var d="lasso"===o||"select"===o,p=n.map(function(r){if(r&&r[0]&&r[0].trace){var n,i=r[0],o=i.trace,f=i.t,h=f.index,p=f.rawx,m=f.rawy,v=e.xaxis||s.getFromId(t,o.xaxis||"x"),g=e.yaxis||s.getFromId(t,o.yaxis||"y"),y=[(v._rl||v.range)[0],(g._rl||g.range)[0],(v._rl||v.range)[1],(g._rl||g.range)[1]],b=[l.l+v.domain[0]*l.w,l.b+g.domain[0]*l.h,c-l.r-(1-v.domain[1])*l.w,u-l.t-(1-g.domain[1])*l.h];if(o.selectedpoints||d){if(d||(d=!0),a.selectBatch||(a.selectBatch=[]),a.unselectBatch||(a.unselectBatch=[]),o.selectedpoints){a.selectBatch[h]=o.selectedpoints;var x=o.selectedpoints,_={};for(n=0;n<x.length;n++)_[x[n]]=!0;var w=[];for(n=0;n<f.count;n++)_[n]||w.push(n);a.unselectBatch[h]=w}var M=Array(f.count),k=Array(f.count);for(n=0;n<f.count;n++)M[n]=v.c2p(p[n]),k[n]=g.c2p(m[n]);f.xpx=M,f.ypx=k}else f.xpx=f.ypx=null;return o.visible?{viewport:b,range:y}:null}});d&&(a.select2d||(a.select2d=g(i._glcanvas.data()[1].regl,{clone:a.scatter2d})),a.scatter2d.update(a.unselectedOptions.map(function(t,e){return a.selectBatch[e]?t:null})),a.select2d.update(a.markerOptions),a.select2d.update(a.selectedOptions)),a.fill2d&&a.fill2d.update(p),a.line2d&&a.line2d.update(p),a.error2d&&a.error2d.update(p.concat(p)),a.scatter2d&&a.scatter2d.update(p),a.select2d&&a.select2d.update(p),a.draw()}}},hoverPoints:function(t,e,r,o){var s,l=t.cd,c=l[0].t,u=l[0].trace,f=t.xa,h=t.ya,d=c.rawx,p=c.rawy,m=f.c2p(e),v=h.c2p(r);if(c.tree){var g=f.p2c(m-T),y=f.p2c(m+T),b=h.p2c(v-T),x=h.p2c(v+T);s="x"===o?c.tree.range(Math.min(g,y),Math.min(h._rl[0],h._rl[1]),Math.max(g,y),Math.max(h._rl[0],h._rl[1])):c.tree.range(Math.min(g,y),Math.min(b,x),Math.max(g,y),Math.max(b,x))}else{if(!c.ids)return[t];s=c.ids}var _,w,M,A,E,S,L,C=T;if("x"===o)for(A=0;A<s.length;A++)w=d[s[A]],(E=Math.abs(f.c2p(w)-m))<C&&(C=E,_=s[A]);else for(A=0;A<s.length;A++)w=d[s[A]],M=p[s[A]],E=f.c2p(w)-m,S=h.c2p(M)-v,(L=Math.sqrt(E*E+S*S))<C&&(C=L,_=s[A]);if(t.index=_,void 0===_)return[t];var P={pointNumber:_,x:d[_],y:p[_]};P.tx=Array.isArray(u.text)?u.text[_]:u.text,P.htx=Array.isArray(u.hovertext)?u.hovertext[_]:u.hovertext,P.data=Array.isArray(u.customdata)?u.customdata[_]:u.customdata,P.tp=Array.isArray(u.textposition)?u.textposition[_]:u.textposition;var z=u.textfont;z&&(P.ts=Array.isArray(z.size)?z.size[_]:z.size,P.tc=Array.isArray(z.color)?z.color[_]:z.color,P.tf=Array.isArray(z.family)?z.family[_]:z.family);var O=u.marker;O&&(P.ms=Array.isArray(O.size)?O.size[_]:O.size,P.mo=Array.isArray(O.opacity)?O.opacity[_]:O.opacity,P.mx=Array.isArray(O.symbol)?O.symbol[_]:O.symbol,P.mc=Array.isArray(O.color)?O.color[_]:O.color);var D=O&&O.line;D&&(P.mlc=Array.isArray(D.color)?D.color[_]:D.color,P.mlw=Array.isArray(D.width)?D.width[_]:D.width);var I=O&&O.gradient;I&&"none"!==I.type&&(P.mgt=Array.isArray(I.type)?I.type[_]:I.type,P.mgc=Array.isArray(I.color)?I.color[_]:I.color);var R=f.c2p(P.x,!0),N=h.c2p(P.y,!0),F=P.mrc||1,j=u.hoverlabel;j&&(P.hbg=Array.isArray(j.bgcolor)?j.bgcolor[_]:j.bgcolor,P.hbc=Array.isArray(j.bordercolor)?j.bordercolor[_]:j.bordercolor,P.hts=Array.isArray(j.font.size)?j.font.size[_]:j.font.size,P.htc=Array.isArray(j.font.color)?j.font.color[_]:j.font.color,P.htf=Array.isArray(j.font.family)?j.font.family[_]:j.font.family,P.hnl=Array.isArray(j.namelength)?j.namelength[_]:j.namelength);var B=u.hoverinfo;B&&(P.hi=Array.isArray(B)?B[_]:B);var U={};return U[t.index]=P,n.extendFlat(t,{color:i(u,P),x0:R-F,x1:R+F,xLabelVal:P.x,y0:N-F,y1:N+F,yLabelVal:P.y,cd:U}),P.htx?t.text=P.htx:P.tx?t.text=P.tx:u.text&&(t.text=u.text),k(P,u,t),a.hoverInfo(P,u,t),[t]},style:function(t,e){if(e){var r=e[0].t.scene;r.clear(),r.draw()}},selectPoints:function(t,e){var r=t.cd,n=[],i=r[0].trace,a=r[0].t,o=a.x,s=a.y,l=a.rawx,c=a.rawy,f=a.scene;if(!f)return n;var h=!u.hasMarkers(i)&&!u.hasText(i);if(!0!==i.visible||h)return n;var d,p=null,m=null;if(!1===e||e.degenerate)m=M(a.count);else for(p=[],m=[],d=0;d<a.count;d++)e.contains([a.xpx[d],a.ypx[d]])?(p.push(d),n.push({pointNumber:d,x:l?l[d]:o[d],y:c?c[d]:s[d]})):m.push(d);if(f.selectBatch||(f.selectBatch=[],f.unselectBatch=[]),!f.selectBatch[a.index]){for(d=0;d<f.count;d++)f.selectBatch[d]=[],f.unselectBatch[d]=[];f.scatter2d.update(f.unselectedOptions)}return f.selectBatch[a.index]=p,f.unselectBatch[a.index]=m,n},sceneOptions:D,sceneUpdate:I,meta:{}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../components/drawing":623,"../../components/errorbars":629,"../../components/fx":640,"../../constants/gl2d_dashes":698,"../../lib":724,"../../lib/gl_format_color":720,"../../plots/cartesian":781,"../../plots/cartesian/axes":770,"../scatter/clean_data":1051,"../scatter/colorbar":1052,"../scatter/colorscale_calc":1053,"../scatter/fill_hover_text":1056,"../scatter/get_trace_color":1058,"../scatter/link_traces":1064,"../scatter/make_bubble_size_func":1065,"../scatter/subtypes":1070,"./attributes":1095,"./defaults":1096,"array-range":50,"color-normalize":99,"fast-isnumeric":140,kdgrass:272,"object-assign":443,regl:486,"regl-error2d":481,"regl-line2d":482,"regl-scatter2d":483,"svg-path-sdf":524}],1098:[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,c=t("../../plot_api/edit_types").overrideAll,u=n.line,f=n.marker;e.exports=c({lon:n.lon,lat:n.lat,mode:l({},i.mode,{dflt:"markers"}),text:l({},i.text,{}),hovertext:l({},i.hovertext,{}),line:{color:u.color,width:u.width},connectgaps:i.connectgaps,marker:{symbol:{valType:"string",dflt:"circle",arrayOk:!0},opacity:f.opacity,size:f.size,sizeref:f.sizeref,sizemin:f.sizemin,sizemode:f.sizemode,color:f.color,colorscale:f.colorscale,cauto:f.cauto,cmax:f.cmax,cmin:f.cmin,autocolorscale:f.autocolorscale,reversescale:f.reversescale,showscale:f.showscale,colorbar:s},fill:n.fill,fillcolor:i.fillcolor,textfont:a.layers.symbol.textfont,textposition:a.layers.symbol.textposition,selected:{marker:{opacity:i.selected.marker.opacity}},unselected:{marker:{opacity:i.unselected.marker.opacity}},hoverinfo:l({},o.hoverinfo,{flags:["lon","lat","text","name"]})},"calc","nested")},{"../../components/colorbar/attributes":599,"../../lib/extend":713,"../../plot_api/edit_types":754,"../../plots/attributes":768,"../../plots/mapbox/layout_attributes":829,"../scatter/attributes":1048,"../scattergeo/attributes":1086}],1099:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM,o=t("../../lib/geojson_utils"),s=t("../../components/colorscale"),l=t("../scatter/make_bubble_size_func"),c=t("../scatter/subtypes"),u=t("../../plots/mapbox/convert_text_opts"),f=t("../../constants/interactions").DESELECTDIM,h="circle-color",d="circle-radius",p="circle-opacity";function m(){return{geojson:o.makeBlank(),layout:{visibility:"none"},paint:{}}}function v(t){return Array.isArray(t)?function(t){return t}:t?function(){return t}:g}function g(){return""}function y(t,e){return t[0]-e[0]}function b(t){return t[0]===a}e.exports=function(t){var e,r=t[0].trace,a=!0===r.visible,x="none"!==r.fill,_=c.hasLines(r),w=c.hasMarkers(r),M=c.hasText(r),k=w&&"circle"===r.marker.symbol,A=w&&"circle"!==r.marker.symbol,T=m(),E=m(),S=m(),L=m(),C={fill:T,line:E,circle:S,symbol:L};if(!a)return C;if((x||_)&&(e=o.calcTraceToLineCoords(t)),x&&(T.geojson=o.makePolygon(e),T.layout.visibility="visible",i.extendFlat(T.paint,{"fill-color":r.fillcolor})),_&&(E.geojson=o.makeLine(e),E.layout.visibility="visible",i.extendFlat(E.paint,{"line-width":r.line.width,"line-color":r.line.color,"line-opacity":r.opacity})),k){var P={};P[h]={},P[d]={},P[p]={},S.geojson=function(t,e){var r,a,o,u,m=t[0].trace,v=m.marker;s.hasColorscale(m,"marker")?r=s.makeColorScaleFunc(s.extractScale(v.colorscale,v.cmin,v.cmax)):Array.isArray(v.color)&&(r=i.identity);c.isBubble(m)&&(a=l(m));o=m.selectedpoints?function(t,e){return m.opacity*e*(t.selected?1:f)}:function(t,e){return m.opacity*e};Array.isArray(v.opacity)?u=function(t){var e=n(t.mo)?+i.constrain(t.mo,0,1):0;return o(t,e)}:m.selectedpoints&&(u=function(t){return o(t,v.opacity)});function g(t,r,n,i){void 0===e[r][n]&&(e[r][n]=i),t[r]=e[r][n]}for(var y=[],x=0;x<t.length;x++){var _=t[x],w=_.lonlat;if(!b(w)){var M={};if(r){var k=_.mcc=r(_.mc);g(M,h,k,x)}a&&g(M,d,a(_.ms),x),u&&g(M,p,u(_),x),y.push({type:"Feature",geometry:{type:"Point",coordinates:w},properties:M})}}return{type:"FeatureCollection",features:y}}(t,P),S.layout.visibility="visible",i.extendFlat(S.paint,{"circle-opacity":function(t,e){var r,n=t.marker;if(Array.isArray(n.opacity)||t.selectedpoints){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.sort(y)}}else r=t.opacity*n.opacity;return r}(r,P),"circle-color":function(t,e){var r,n=t.marker;if(Array.isArray(n.color)){for(var i=Object.keys(e[h]),a=[],o=0;o<i.length;o++){var s=i[o];a.push([e[h][s],s])}r={property:h,stops:a}}else r=n.color;return r}(r,P),"circle-radius":function(t,e){var r,n=t.marker;if(Array.isArray(n.size)){for(var i=Object.keys(e[d]),a=[],o=0;o<i.length;o++){var s=i[o];a.push([e[d][s],+s])}r={property:d,stops:a.sort(y)}}else r=n.size/2;return r}(r,P)})}if((A||M)&&(L.geojson=function(t){for(var e=t[0].trace,r=(e.marker||{}).symbol,n=e.text,i="circle"!==r?v(r):g,a=c.hasText(e)?v(n):g,o=[],s=0;s<t.length;s++){var l=t[s];b(l.lonlat)||o.push({type:"Feature",geometry:{type:"Point",coordinates:l.lonlat},properties:{symbol:i(l.mx),text:a(l.tx)}})}return{type:"FeatureCollection",features:o}}(t),i.extendFlat(L.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),A&&(i.extendFlat(L.layout,{"icon-size":r.marker.size/10}),i.extendFlat(L.paint,{"icon-opacity":r.opacity*r.marker.opacity,"icon-color":r.marker.color})),M)){var z=(r.marker||{}).size,O=u(r.textposition,z);i.extendFlat(L.layout,{"text-size":r.textfont.size,"text-anchor":O.anchor,"text-offset":O.offset}),i.extendFlat(L.paint,{"text-color":r.textfont.color,"text-opacity":r.opacity})}return C}},{"../../components/colorscale":613,"../../constants/interactions":701,"../../constants/numerical":702,"../../lib":724,"../../lib/geojson_utils":717,"../../plots/mapbox/convert_text_opts":826,"../scatter/make_bubble_size_func":1065,"../scatter/subtypes":1070,"fast-isnumeric":140}],1100:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/subtypes"),a=t("../scatter/marker_defaults"),o=t("../scatter/line_defaults"),s=t("../scatter/text_defaults"),l=t("../scatter/fillcolor_defaults"),c=t("./attributes");e.exports=function(t,e,r,u){function f(r,i){return n.coerce(t,e,c,r,i)}if(function(t,e,r){var n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length);return e._length=a,a}(0,e,f)){if(f("text"),f("hovertext"),f("mode"),i.hasLines(e)&&(o(t,e,r,u,f,{noDash:!0}),f("connectgaps")),i.hasMarkers(e)){a(t,e,r,u,f,{noLine:!0,noSelect:!0});var h=e.marker;h.line={width:0},"circle"!==h.symbol&&(Array.isArray(h.size)&&(h.size=h.size[0]),Array.isArray(h.color)&&(h.color=h.color[0]))}i.hasText(e)&&s(t,e,u,f,{noSelect:!0}),f("fill"),"none"!==e.fill&&l(t,e,r,f),n.coerceSelectionMarkerOpacity(e,f)}else e.visible=!1}},{"../../lib":724,"../scatter/fillcolor_defaults":1057,"../scatter/line_defaults":1061,"../scatter/marker_defaults":1066,"../scatter/subtypes":1070,"../scatter/text_defaults":1071,"./attributes":1098}],1101:[function(t,e,r){"use strict";e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t}},{}],1102:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../scatter/get_trace_color"),a=t("../scatter/fill_hover_text"),o=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){var s=t.cd,l=s[0].trace,c=t.xa,u=t.ya,f=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),h=e-f;if(n.getClosest(s,function(t){var e=t.lonlat;if(e[0]===o)return 1/0;var n=Math.abs(c.c2p(e)-c.c2p([h,e[1]])),i=Math.abs(u.c2p(e)-u.c2p([e[0],r])),a=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(n*n+i*i)-a,1-3/a)},t),!1!==t.index){var d=s[t.index],p=d.lonlat,m=[p[0]+f,p[1]],v=c.c2p(m),g=u.c2p(m),y=d.mrc||1;return t.x0=v-y,t.x1=v+y,t.y0=g-y,t.y1=g+y,t.color=i(l,d),t.extraText=function(t,e,r){var n=(e.hi||t.hoverinfo).split("+"),i=-1!==n.indexOf("all"),o=-1!==n.indexOf("lon"),s=-1!==n.indexOf("lat"),l=e.lonlat,c=[];function u(t){return t+"\xb0"}i||o&&s?c.push("("+u(l[0])+", "+u(l[1])+")"):o?c.push(r.lon+u(l[0])):s&&c.push(r.lat+u(l[1]));(i||-1!==n.indexOf("text"))&&a(e,t,c);return c.join("<br>")}(l,d,s[0].t.labels),[t]}}},{"../../components/fx":640,"../../constants/numerical":702,"../scatter/fill_hover_text":1056,"../scatter/get_trace_color":1058}],1103:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("../scattergeo/calc"),n.plot=t("./plot"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.style=function(t,e){e&&e[0].trace._glTrace.update(e)},n.moduleType="trace",n.name="scattermapbox",n.basePlotModule=t("../../plots/mapbox"),n.categories=["mapbox","gl","symbols","markerColorscale","showLegend","scatterlike"],n.meta={},e.exports=n},{"../../plots/mapbox":827,"../scatter/colorbar":1052,"../scattergeo/calc":1087,"./attributes":1098,"./defaults":1100,"./event_data":1101,"./hover":1102,"./plot":1104,"./select":1105}],1104:[function(t,e,r){"use strict";var n=t("./convert");function i(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"})}var a=i.prototype;function o(t){return"visible"===t.layout.visibility}a.update=function(t){var e=this.mapbox,r=n(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),o(r.fill)&&(e.setSourceData(this.idSourceFill,r.fill.geojson),e.setOptions(this.idLayerFill,"setPaintProperty",r.fill.paint)),o(r.line)&&(e.setSourceData(this.idSourceLine,r.line.geojson),e.setOptions(this.idLayerLine,"setPaintProperty",r.line.paint)),o(r.circle)&&(e.setSourceData(this.idSourceCircle,r.circle.geojson),e.setOptions(this.idLayerCircle,"setPaintProperty",r.circle.paint)),o(r.symbol)&&(e.setSourceData(this.idSourceSymbol,r.symbol.geojson),e.setOptions(this.idLayerSymbol,"setPaintProperty",r.symbol.paint)),t[0].trace._glTrace=this},a.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=new i(t,e[0].trace.uid);return r.update(e),r}},{"./convert":1099}],1105:[function(t,e,r){"use strict";var n=t("../scatter/subtypes");e.exports=function(t,e){var r,i,a,o,s,l=t.cd,c=t.xaxis,u=t.yaxis,f=[],h=l[0].trace;if(!n.hasMarkers(h))return[];if(!1===e)for(s=0;s<l.length;s++)l[s].selected=0;else for(s=0;s<l.length;s++)i=(r=l[s]).lonlat,a=c.c2p(i),o=u.c2p(i),e.contains([a,o])?(f.push({pointNumber:s,lon:i[0],lat:i[1]}),r.selected=1):r.selected=0;return f}},{"../scatter/subtypes":1070}],1106:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat,i=t("../scatter/attributes"),a=t("../../plots/attributes"),o=i.line;e.exports={mode:i.mode,r:{valType:"data_array",editType:"calc+clearAxisTypes"},theta:{valType:"data_array",editType:"calc+clearAxisTypes"},thetaunit:{valType:"enumerated",values:["radians","degrees","gradians"],dflt:"degrees",editType:"calc+clearAxisTypes"},text:i.text,hovertext:i.hovertext,line:{color:o.color,width:o.width,dash:o.dash,shape:n({},o.shape,{values:["linear","spline"]}),smoothing:o.smoothing,editType:"calc"},connectgaps:i.connectgaps,marker:i.marker,cliponaxis:n({},i.cliponaxis,{dflt:!1}),textposition:i.textposition,textfont:i.textfont,fill:n({},i.fill,{values:["none","toself","tonext"]}),fillcolor:i.fillcolor,hoverinfo:n({},a.hoverinfo,{flags:["r","theta","text","name"]}),hoveron:i.hoveron,selected:i.selected,unselected:i.unselected}},{"../../lib/extend":713,"../../plots/attributes":768,"../scatter/attributes":1048}],1107:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../../plots/cartesian/axes"),o=t("../scatter/colorscale_calc"),s=t("../scatter/arrays_to_calcdata"),l=t("../scatter/calc_selection"),c=t("../scatter/calc").calcMarkerSize;e.exports=function(t,e){var r,u=t._fullLayout,f=e.subplot,h=u[f].radialaxis,d=u[f].angularaxis,p=h.makeCalcdata(e,"r"),m=d.makeCalcdata(e,"theta"),v=e._length,g=new Array(v);for(var y=0;y<v;y++){var b=p[y],x=m[y],_=g[y]={};n(b)&&n(x)?(_.r=b,_.theta=x,_.rad=(r=x,d.c2rad(r,e.thetaunit))):_.r=i}var w=c(e,v);return a.expand(h,p,{ppad:w}),"linear"!==d.type&&(d.autorange=!0,a.expand(d,m),delete d.autorange),o(e),s(g,e),l(g,e),g}},{"../../constants/numerical":702,"../../plots/cartesian/axes":770,"../scatter/arrays_to_calcdata":1047,"../scatter/calc":1049,"../scatter/calc_selection":1050,"../scatter/colorscale_calc":1053,"fast-isnumeric":140}],1108:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/subtypes"),a=t("../scatter/marker_defaults"),o=t("../scatter/line_defaults"),s=t("../scatter/line_shape_defaults"),l=t("../scatter/text_defaults"),c=t("../scatter/fillcolor_defaults"),u=t("../scatter/constants").PTS_LINESONLY,f=t("./attributes");e.exports=function(t,e,r,h){function d(r,i){return n.coerce(t,e,f,r,i)}var p=d("r"),m=d("theta"),v=p&&m?Math.min(p.length,m.length):0;if(v){e._length=v,d("thetaunit"),d("mode",v<u?"lines+markers":"lines"),d("text"),d("hovertext"),i.hasLines(e)&&(o(t,e,r,h,d),s(t,e,d),d("connectgaps")),i.hasMarkers(e)&&a(t,e,r,h,d,{gradient:!0}),i.hasText(e)&&l(t,e,h,d);var g=[];(i.hasMarkers(e)||i.hasText(e))&&(d("cliponaxis"),d("marker.maxdisplayed"),g.push("points")),d("fill"),"none"!==e.fill&&(c(t,e,r,d),i.hasLines(e)||s(t,e,d)),"tonext"!==e.fill&&"toself"!==e.fill||g.push("fills"),d("hoveron",g.join("+")||"points"),n.coerceSelectionMarkerOpacity(e,d)}else e.visible=!1}},{"../../lib":724,"../scatter/constants":1054,"../scatter/fillcolor_defaults":1057,"../scatter/line_defaults":1061,"../scatter/line_shape_defaults":1063,"../scatter/marker_defaults":1066,"../scatter/subtypes":1070,"../scatter/text_defaults":1071,"./attributes":1106}],1109:[function(t,e,r){"use strict";var n=t("../scatter/hover"),i=t("../../plots/cartesian/axes"),a=t("../../lib");function o(t,e,r){var n=r.radialAxis,o=r.angularAxis,s=(t.hi||e.hoverinfo).split("+"),l=[];n._hovertitle="r",o._hovertitle="\u03b8";var c,u=o._c2rad(t.theta,e.thetaunit);function f(t,e){l.push(t._hovertitle+": "+i.tickText(t,e,"hover").text)}return c="linear"===o.type&&e.thetaunit!==o.thetaunit?"degrees"===o.thetaunit?a.rad2deg(u):u:t.theta,-1!==s.indexOf("all")&&(s=["r","theta"]),-1!==s.indexOf("r")&&f(n,n.c2r(t.r)),-1!==s.indexOf("theta")&&f(o,c),l.join("<br>")}e.exports={hoverPoints:function(t,e,r,i){var a=n(t,e,r,i);if(a&&!1!==a[0].index){var s=a[0];if(void 0===s.index)return a;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtWithinSector(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,s.extraText=o(c,u,l),a}},makeHoverPointText:o}},{"../../lib":724,"../../plots/cartesian/axes":770,"../scatter/hover":1059}],1110:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:t("../../plots/polar"),categories:["polar","symbols","markerColorscale","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,hoverPoints:t("./hover").hoverPoints,selectPoints:t("../scatter/select"),meta:{}}},{"../../plots/polar":836,"../scatter/select":1068,"../scatter/style":1069,"./attributes":1106,"./calc":1107,"./defaults":1108,"./hover":1109,"./plot":1111}],1111:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){var a,o,s,l={xaxis:e.xaxis,yaxis:e.yaxis,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.circle:null},c=e.radialAxis,u=c.range;for(s=u[0]>u[1]?function(t){return t<=0}:function(t){return t>=0},a=0;a<r.length;a++)for(o=0;o<r[a].length;o++){var f=r[a][o],h=f.r;if(h!==i){var d=c.c2r(h)-u[0];if(s(d)){var p=f.rad;f.x=d*Math.cos(p),f.y=d*Math.sin(p);continue}f.intoCenter=[e.cxx,e.cyy]}f.x=i,f.y=i}n(t,l,r)}},{"../../constants/numerical":702,"../scatter/plot":1067}],1112:[function(t,e,r){"use strict";var n=t("../scatterpolar/attributes"),i=t("../scattergl/attributes");e.exports={mode:n.mode,r:n.r,theta:n.theta,thetaunit:n.thetaunit,text:n.text,line:i.line,connectgaps:i.connectgaps,marker:i.marker,fill:i.fill,fillcolor:i.fillcolor,hoverinfo:n.hoverinfo,hoveron:n.hoveron,selected:n.selected,unselected:n.unselected}},{"../scattergl/attributes":1095,"../scatterpolar/attributes":1106}],1113:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/subtypes"),a=t("../scatter/marker_defaults"),o=t("../scatter/line_defaults"),s=t("../scatter/fillcolor_defaults"),l=t("../scatter/constants").PTS_LINESONLY,c=t("./attributes");e.exports=function(t,e,r,u){function f(r,i){return n.coerce(t,e,c,r,i)}var h=f("r"),d=f("theta"),p=h&&d?Math.min(h.length,d.length):0;if(p){e._length=p,f("thetaunit"),f("mode",p<l?"lines+markers":"lines"),f("text"),i.hasLines(e)&&(o(t,e,r,u,f),f("connectgaps"));var m=[];i.hasMarkers(e)&&(a(t,e,r,u,f),m.push("points")),f("fill"),"none"!==e.fill&&s(t,e,r,f),"tonext"!==e.fill&&"toself"!==e.fill||m.push("fills"),f("hoveron",m.join("+")||"points"),n.coerceSelectionMarkerOpacity(e,f)}else e.visible=!1}},{"../../lib":724,"../scatter/constants":1054,"../scatter/fillcolor_defaults":1057,"../scatter/line_defaults":1061,"../scatter/marker_defaults":1066,"../scatter/subtypes":1070,"./attributes":1112}],1114:[function(t,e,r){"use strict";var n=t("kdgrass"),i=t("fast-isnumeric"),a=t("../scattergl"),o=t("../scatter/colorscale_calc"),s=t("../../plots/cartesian/axes"),l=t("../scatterpolar/hover").makeHoverPointText,c=t("../scatter/subtypes");e.exports={moduleType:"trace",name:"scatterpolargl",basePlotModule:t("../../plots/polar"),categories:["gl","regl","polar","symbols","markerColorscale","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:function(t,e){var r=t._fullLayout,n=e.subplot,i=r[n].radialaxis,a=r[n].angularaxis,l=i.makeCalcdata(e,"r"),c=a.makeCalcdata(e,"theta"),u={};return e._length<l.length&&(l=l.slice(0,e._length)),e._length<c.length&&(c=c.slice(0,e._length)),o(e),u.r=l,u.theta=c,s.expand(i,l,{tozero:!0}),"linear"!==a.type&&(a.autorange=!0,s.expand(a,c),delete a.autorange),[{x:!1,y:!1,t:u,trace:e}]},plot:function(t,e,r){var o=e.radialAxis,s=e.angularAxis,l=o.range,u=a.sceneUpdate(t,e);return u.clear(),r.forEach(function(f,h){if(f&&f[0]&&f[0].trace){var d,p,m,v,g,y=f[0],b=y.trace,x=y.t,_=x.r,w=x.theta,M=_.slice(),k=w.slice();for(d=0;d<_.length;d++)p=_[d],v=w[d],g=s.c2rad(v,b.thetaunit),e.isPtWithinSector({r:p,rad:g})||(M[d]=NaN,k[d]=NaN);var A,T=_.length,E=new Array(2*T),S=Array(T),L=Array(T);for(d=0;d<T;d++)p=M[d],v=k[d],i(p)&&i(v)&&p>=0?(m=o.c2r(p)-l[0],A=v,g=s.c2rad(A,b.thetaunit),S[d]=E[2*d]=m*Math.cos(g),L[d]=E[2*d+1]=m*Math.sin(g)):S[d]=L[d]=E[2*d]=E[2*d+1]=NaN;var C=a.sceneOptions(t,e,b,E);C.fill&&!u.fill2d&&(u.fill2d=!0),C.marker&&!u.scatter2d&&(u.scatter2d=!0),C.line&&!u.line2d&&(u.line2d=!0),!C.errorX&&!C.errorY||u.error2d||(u.error2d=!0),c.hasMarkers(b)&&(C.selected.positions=C.unselected.positions=C.marker.positions),u.lineOptions.push(C.line),u.errorXOptions.push(C.errorX),u.errorYOptions.push(C.errorY),u.fillOptions.push(C.fill),u.markerOptions.push(C.marker),u.selectedOptions.push(C.selected),u.unselectedOptions.push(C.unselected),u.count=r.length,x.scene=u,x.index=h,x.x=S,x.y=L,x.rawx=S,x.rawy=L,x.r=_,x.theta=w,x.positions=E,x.count=T,x.tree=n(E,512)}}),a.plot(t,e,r)},hoverPoints:function(t,e,r,n){var i=t.cd[0].t,o=i.r,s=i.theta,c=a.hoverPoints(t,e,r,n);if(c&&!1!==c[0].index){var u=c[0];if(void 0===u.index)return c;var f=t.subplot,h=f.angularAxis,d=u.cd[u.index],p=u.trace;if(d.r=o[u.index],d.theta=s[u.index],d.rad=h.c2rad(d.theta,p.thetaunit),f.isPtWithinSector(d))return u.xLabelVal=void 0,u.yLabelVal=void 0,u.extraText=l(d,p,f),c}},style:a.style,selectPoints:a.selectPoints,meta:{}}},{"../../plots/cartesian/axes":770,"../../plots/polar":836,"../scatter/colorscale_calc":1053,"../scatter/subtypes":1070,"../scattergl":1097,"../scatterpolar/hover":1109,"./attributes":1112,"./defaults":1113,"fast-isnumeric":140,kdgrass:272}],1115:[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("../../components/drawing/attributes").dash,l=t("../../lib/extend").extendFlat,c=n.marker,u=n.line,f=c.line;e.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:s,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,cliponaxis:n.cliponaxis,fill:l({},n.fill,{values:["none","toself","tonext"]}),fillcolor:n.fillcolor,marker:l({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:l({width:f.width,editType:"calc"},a("marker.line")),gradient:c.gradient,editType:"calc"},a("marker"),{showscale:c.showscale,colorbar:o}),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},i.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:n.hoveron}},{"../../components/colorbar/attributes":599,"../../components/colorscale/color_attributes":606,"../../components/drawing/attributes":622,"../../lib/extend":713,"../../plots/attributes":768,"../scatter/attributes":1048}],1116:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../scatter/colorscale_calc"),a=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=["a","b","c"],c={a:["b","c"],b:["a","c"],c:["a","b"]};e.exports=function(t,e){var r,u,f,h,d,p,m=t._fullLayout[e.subplot].sum,v=e.sum||m,g={a:e.a,b:e.b,c:e.c};for(r=0;r<l.length;r++)if(!g[f=l[r]]){for(d=g[c[f][0]],p=g[c[f][1]],h=new Array(d.length),u=0;u<d.length;u++)h[u]=v-d[u]-p[u];g[f]=h}var y,b,x,_,w,M,k=e._length,A=new Array(k);for(r=0;r<k;r++)y=g.a[r],b=g.b[r],x=g.c[r],n(y)&&n(b)&&n(x)?(1!==(_=m/((y=+y)+(b=+b)+(x=+x)))&&(y*=_,b*=_,x*=_),M=y,w=x-b,A[r]={x:w,y:M,a:y,b:b,c:x}):A[r]={x:!1,y:!1};return s(e,k),i(e),a(A,e),o(A,e),A}},{"../scatter/arrays_to_calcdata":1047,"../scatter/calc":1049,"../scatter/calc_selection":1050,"../scatter/colorscale_calc":1053,"fast-isnumeric":140}],1117:[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"),c=t("../scatter/text_defaults"),u=t("../scatter/fillcolor_defaults"),f=t("./attributes");e.exports=function(t,e,r,h){function d(r,i){return n.coerce(t,e,f,r,i)}var p,m=d("a"),v=d("b"),g=d("c");if(m?(p=m.length,v?(p=Math.min(p,v.length),g&&(p=Math.min(p,g.length))):p=g?Math.min(p,g.length):0):v&&g&&(p=Math.min(v.length,g.length)),p){e._length=p,d("sum"),d("text"),d("hovertext"),d("mode",p<i.PTS_LINESONLY?"lines+markers":"lines"),a.hasLines(e)&&(s(t,e,r,h,d),l(t,e,d),d("connectgaps")),a.hasMarkers(e)&&o(t,e,r,h,d,{gradient:!0}),a.hasText(e)&&c(t,e,h,d);var y=[];(a.hasMarkers(e)||a.hasText(e))&&(d("cliponaxis"),d("marker.maxdisplayed"),y.push("points")),d("fill"),"none"!==e.fill&&(u(t,e,r,d),a.hasLines(e)||l(t,e,d)),"tonext"!==e.fill&&"toself"!==e.fill||y.push("fills"),d("hoveron",y.join("+")||"points"),n.coerceSelectionMarkerOpacity(e,d)}else e.visible=!1}},{"../../lib":724,"../scatter/constants":1054,"../scatter/fillcolor_defaults":1057,"../scatter/line_defaults":1061,"../scatter/line_shape_defaults":1063,"../scatter/marker_defaults":1066,"../scatter/subtypes":1070,"../scatter/text_defaults":1071,"./attributes":1115}],1118:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){if(e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),n[i]){var a=n[i];t.a=a.a,t.b=a.b,t.c=a.c}else t.a=e.a,t.b=e.b,t.c=e.c;return t}},{}],1119:[function(t,e,r){"use strict";var n=t("../scatter/hover"),i=t("../../plots/cartesian/axes");e.exports=function(t,e,r,a){var o=n(t,e,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index){var l=1-s.y0/t.ya._length,c=t.xa._length,u=c*l/2,f=c-u;return s.x0=Math.max(Math.min(s.x0,f),u),s.x1=Math.max(Math.min(s.x1,f),u),o}var h=s.cd[s.index];s.a=h.a,s.b=h.b,s.c=h.c,s.xLabelVal=void 0,s.yLabelVal=void 0;var d=s.trace,p=s.subplot,m=(h.hi||d.hoverinfo).split("+"),v=[];return-1!==m.indexOf("all")&&(m=["a","b","c"]),-1!==m.indexOf("a")&&g(p.aaxis,h.a),-1!==m.indexOf("b")&&g(p.baxis,h.b),-1!==m.indexOf("c")&&g(p.caxis,h.c),s.extraText=v.join("<br>"),o}function g(t,e){v.push(t._hovertitle+": "+i.tickText(t,e,"hover").text)}}},{"../../plots/cartesian/axes":770,"../scatter/hover":1059}],1120:[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("../scatter/style").style,n.hoverPoints=t("./hover"),n.selectPoints=t("../scatter/select"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="scatterternary",n.basePlotModule=t("../../plots/ternary"),n.categories=["ternary","symbols","markerColorscale","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/ternary":847,"../scatter/colorbar":1052,"../scatter/select":1068,"../scatter/style":1069,"./attributes":1115,"./calc":1116,"./defaults":1117,"./event_data":1118,"./hover":1119,"./plot":1121}],1121:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e,r){var i=e.plotContainer;i.select(".scatterlayer").selectAll("*").remove();var a={xaxis:e.xaxis,yaxis:e.yaxis,plot:i,layerClipId:e._hasClipOnAxisFalse?e.clipIdRelative:null};n(t,a,r)}},{"../scatter/plot":1067}],1122:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll;function c(t){return{show:{valType:"boolean",dflt:!1},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:n.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:n.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var u=e.exports=l({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},surfacecolor:{valType:"data_array"},cauto:i.zauto,cmin:i.zmin,cmax:i.zmax,colorscale:i.colorscale,autocolorscale:s({},i.autocolorscale,{dflt:!1}),reversescale:i.reversescale,showscale:i.showscale,colorbar:a,contours:{x:c(),y:c(),z:c()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},_deprecated:{zauto:s({},i.zauto,{}),zmin:s({},i.zmin,{}),zmax:s({},i.zmax,{})},hoverinfo:s({},o.hoverinfo)},"calc","nested");u.x.editType=u.y.editType=u.z.editType="calc+clearAxisTypes"},{"../../components/color":598,"../../components/colorbar/attributes":599,"../../components/colorscale/attributes":604,"../../lib/extend":713,"../../plot_api/edit_types":754,"../../plots/attributes":768}],1123:[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":605}],1124:[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,c=r.cmin,u=r.cmax,f=r.surfacecolor||r.z;if(n(c)||(c=i.aggNums(Math.min,null,f)),n(u)||(u=i.aggNums(Math.max,null,f)),t._fullLayout._infolayer.selectAll("."+l).remove(),r.showscale){var h=e[0].t.cb=s(t,l),d=o.makeColorScaleFunc(o.extractScale(r.colorscale,c,u),{noNumericCheck:!0});h.fillcolor(d).filllevels({start:c,end:u,size:(u-c)/254}).options(r.colorbar)()}else a.autoMargin(t,l)}},{"../../components/colorbar/draw":602,"../../components/colorscale":613,"../../lib":724,"../../plots/plots":833,"fast-isnumeric":140}],1125:[function(t,e,r){"use strict";var n=t("gl-surface3d"),i=t("ndarray"),a=t("ndarray-homography"),o=t("ndarray-fill"),s=t("ndarray-ops"),l=t("tinycolor2"),c=t("../../lib/str2rgbarray"),u=128;function f(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.dataScale=1}var h=f.prototype;function d(t){var e=t.shape,r=[e[0]+2,e[1]+2],n=i(new Float32Array(r[0]*r[1]),r);return s.assign(n.lo(1,1).hi(e[0],e[1]),t),s.assign(n.lo(1).hi(e[0],1),t.hi(e[0],1)),s.assign(n.lo(1,r[1]-1).hi(e[0],1),t.lo(0,e[1]-1).hi(e[0],1)),s.assign(n.lo(0,1).hi(1,e[1]),t.hi(1)),s.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}h.handlePick=function(t){if(t.object===this.surface){var e=t.index=[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)?Array.isArray(this.data.x[0])?r[0]=this.data.x[e[1]][e[0]]:r[0]=this.data.x[e[0]]:r[0]=e[0],Array.isArray(this.data.y)?Array.isArray(this.data.y[0])?r[1]=this.data.y[e[1]][e[0]]:r[1]=this.data.y[e[1]]:r[1]=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 Array.isArray(i)&&i[e[1]]&&void 0!==i[e[1]][e[0]]?t.textLabel=i[e[1]][e[0]]:t.textLabel=i||"",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}},h.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})},h.update=function(t){var e,r=this.scene,n=r.fullSceneLayout,s=this.surface,f=t.opacity,h=function(t,e){return void 0===e&&(e=1),t.map(function(t){var r=t[0],n=l(t[1]).toRgb();return{index:r,rgb:[n.r,n.g,n.b,e]}})}(t.colorscale,f),p=t.z,m=t.x,v=t.y,g=n.xaxis,y=n.yaxis,b=n.zaxis,x=r.dataScale,_=p[0].length,w=t._ylength,M=[i(new Float32Array(_*w),[_,w]),i(new Float32Array(_*w),[_,w]),i(new Float32Array(_*w),[_,w])],k=M[0],A=M[1],T=r.contourLevels;this.data=t;var E=t.xcalendar,S=t.ycalendar,L=t.zcalendar;o(M[2],function(t,e){return b.d2l(p[e][t],0,L)*x[2]}),Array.isArray(m)?Array.isArray(m[0])?o(k,function(t,e){return g.d2l(m[e][t],0,E)*x[0]}):o(k,function(t){return g.d2l(m[t],0,E)*x[0]}):o(k,function(t){return g.d2l(t,0,E)*x[0]}),Array.isArray(m)?Array.isArray(v[0])?o(A,function(t,e){return y.d2l(v[e][t],0,S)*x[1]}):o(A,function(t,e){return y.d2l(v[e],0,S)*x[1]}):o(A,function(t,e){return y.d2l(e,0,E)*x[1]});var C={colormap:h,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:t.opacity};if(C.intensityBounds=[t.cmin,t.cmax],t.surfacecolor){var P=i(new Float32Array(_*w),[_,w]);o(P,function(e,r){return t.surfacecolor[r][e]}),M.push(P)}else C.intensityBounds[0]*=x[2],C.intensityBounds[1]*=x[2];this.dataScale=function(t){var e=Math.max(t[0].shape[0],t[0].shape[1]);if(e<u){for(var r=u/e,n=[0|Math.floor(t[0].shape[0]*r+1),0|Math.floor(t[0].shape[1]*r+1)],o=n[0]*n[1],s=0;s<t.length;++s){var l=d(t[s]),c=i(new Float32Array(o),n);a(c,l,[r,0,0,0,r,0,0,0,1]),t[s]=c}return r}return 1}(M),t.surfacecolor&&(C.intensity=M.pop());var z=[!0,!0,!0],O=["x","y","z"];for(e=0;e<3;++e){var D=t.contours[O[e]];z[e]=D.highlight,C.showContour[e]=D.show||D.highlight,C.showContour[e]&&(C.contourProject[e]=[D.project.x,D.project.y,D.project.z],D.show?(this.showContour[e]=!0,C.levels[e]=T[e],s.highlightColor[e]=C.contourColor[e]=c(D.color),D.usecolormap?s.highlightTint[e]=C.contourTint[e]=0:s.highlightTint[e]=C.contourTint[e]=1,C.contourWidth[e]=D.width):this.showContour[e]=!1,D.highlight&&(C.dynamicColor[e]=c(D.highlightcolor),C.dynamicWidth[e]=D.highlightwidth))}(function(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]})(h)&&(C.vertexColor=!0),C.coords=M,s.update(C),s.visible=t.visible,s.enableDynamic=z,s.snapToData=!0,"lighting"in t&&(s.ambientLight=t.lighting.ambient,s.diffuseLight=t.lighting.diffuse,s.specularLight=t.lighting.specular,s.roughness=t.lighting.roughness,s.fresnel=t.lighting.fresnel),"lightposition"in t&&(s.lightPosition=[t.lightposition.x,t.lightposition.y,t.lightposition.z]),f&&f<1&&(s.supportsTransparency=!0)},h.dispose=function(){this.scene.glplot.remove(this.surface),this.surface.dispose()},e.exports=function(t,e){var r=t.glplot.gl,i=n({gl:r}),a=new f(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}},{"../../lib/str2rgbarray":746,"gl-surface3d":232,ndarray:439,"ndarray-fill":429,"ndarray-homography":431,"ndarray-ops":433,tinycolor2:526}],1126:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/colorscale/defaults"),o=t("./attributes");function s(t,e,r){e in t&&!(r in t)&&(t[r]=t[e])}e.exports=function(t,e,r,l){var c,u;function f(r,n){return i.coerce(t,e,o,r,n)}var h=f("z");if(h){var d=f("x");f("y"),e._xlength=Array.isArray(d)&&Array.isArray(d[0])?h.length:h[0].length,e._ylength=h.length,n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],l),f("text"),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lightposition.x","lightposition.y","lightposition.z","hidesurface","opacity"].forEach(function(t){f(t)});var p=f("surfacecolor");f("colorscale");var m=["x","y","z"];for(c=0;c<3;++c){var v="contours."+m[c],g=f(v+".show"),y=f(v+".highlight");if(g||y)for(u=0;u<3;++u)f(v+".project."+m[u]);g&&(f(v+".color"),f(v+".width"),f(v+".usecolormap")),y&&(f(v+".highlightcolor"),f(v+".highlightwidth"))}p||(s(t,"zmin","cmin"),s(t,"zmax","cmax"),s(t,"zauto","cauto")),a(t,e,l,f,{prefix:"",cLetter:"c"})}else e.visible=!1}},{"../../components/colorscale/defaults":608,"../../lib":724,"../../registry":854,"./attributes":1122}],1127:[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","2dMap","noOpacity"],n.meta={},e.exports=n},{"../../plots/gl3d":813,"./attributes":1122,"./calc":1123,"./colorbar":1124,"./convert":1125,"./defaults":1126}],1128:[function(t,e,r){"use strict";var n=t("../../components/annotations/attributes"),i=t("../../lib/extend").extendFlat,a=t("../../plot_api/edit_types").overrideAll,o=t("../../plots/font_attributes"),s=t("../../plots/domain_attributes");e.exports=a({domain:s({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[]},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:i({},n.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:i({},o({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[]},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:i({},n.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:i({},o({arrayOk:!0}))}},"calc","from-root")},{"../../components/annotations/attributes":581,"../../lib/extend":713,"../../plot_api/edit_types":754,"../../plots/domain_attributes":796,"../../plots/font_attributes":797}],1129:[function(t,e,r){"use strict";var n=t("../../plots/get_data").getModuleCalcData,i=t("./plot");r.name="table",r.plot=function(t){var e=n(t.calcdata,"table");e.length&&i(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("table"),a=e._has&&e._has("table");i&&!a&&n._paperdiv.selectAll(".table").remove()}},{"../../plots/get_data":807,"./plot":1136}],1130:[function(t,e,r){"use strict";var n=t("../../lib/gup").wrap;e.exports=function(t,e){return n(e)}},{"../../lib/gup":721}],1131:[function(t,e,r){"use strict";e.exports={cellPad:8,columnExtentOffset:10,columnTitleOffset:28,emptyHeaderHeight:16,latexCheck:/^\$.*\$$/,goldenRatio:1.618,lineBreaker:"<br>",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},{}],1132:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../lib/extend").extendFlat,a=t("fast-isnumeric");function o(t){return t.calcdata.columns.reduce(function(e,r){return r.xIndex<t.xIndex?e+r.columnWidth:e},0)}function s(t,e){return Object.keys(t).map(function(r){return i({},t[r],{auxiliaryBlocks:e})})}function l(t,e){for(var r,n={},i=0,a=0,o={firstRowIndex:null,lastRowIndex:null,rows:[]},s=0,l=0,c=0;c<t.length;c++)r=t[c],o.rows.push({rowIndex:c,rowHeight:r}),((a+=r)>=e||c===t.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=c+1,a=0);return n}e.exports=function(t,e){var r=e.cells.values,c=function(t){return t.slice(e.header.values.length,t.length)},u=e.header.values.map(function(t){return Array.isArray(t)?t:[t]}).concat(c(r).map(function(){return[""]})),f=e.domain,h=Math.floor(t._fullLayout._size.w*(f.x[1]-f.x[0])),d=Math.floor(t._fullLayout._size.h*(f.y[1]-f.y[0])),p=e.header.values.length?u[0].map(function(){return e.header.height}):[n.emptyHeaderHeight],m=r.length?r[0].map(function(){return e.cells.height}):[],v=p.reduce(function(t,e){return t+e},0),g=l(m,d-v+n.uplift),y=s(l(p,v),[]),b=s(g,y),x={},_=e._fullInput.columnorder.concat(c(r.map(function(t,e){return e}))),w=u.map(function(t,r){var n=Array.isArray(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return a(n)?Number(n):1}),M=w.reduce(function(t,e){return t+e},0);w=w.map(function(t){return t/M*h});var k={key:e.index,translateX:f.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-f.y[1]),size:t._fullLayout._size,width:h,height:d,columnOrder:_,groupHeight:d,rowBlocks:b,headerRowBlocks:y,scrollY:0,cells:e.cells,headerCells:i({},e.header,{values:u}),gdColumns:u.map(function(t){return t[0]}),gdColumnsOriginalOrder:u.map(function(t){return t[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:u.map(function(t,e){var r=x[t];return x[t]=(r||0)+1,{key:t+"__"+x[t],label:t,specIndex:e,xIndex:_[e],xScale:o,x:void 0,calcdata:void 0,columnWidth:w[e]}})};return k.columns.forEach(function(t){t.calcdata=k,t.x=o(t)}),k}},{"../../lib/extend":713,"./constants":1131,"fast-isnumeric":140}],1133:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat;r.splitToPanels=function(t){var e=[0,0],r=n({},t,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:n({},t.calcdata,{cells:t.calcdata.headerCells})});return[n({},t,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n({},t,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),r]},r.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0,n=e?r+e.rows.length:0;return[r,n]}(t);return(t.values||[]).slice(e[0],e[1]).map(function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}})}},{"../../lib/extend":713}],1134:[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)}o("domain.x"),o("domain.y"),o("columnwidth"),o("header.values"),o("header.format"),o("header.align"),o("header.prefix"),o("header.suffix"),o("header.height"),o("header.line.width"),o("header.line.color"),o("header.fill.color"),n.coerceFont(o,"header.font",n.extendFlat({},a.font)),function(t,e){for(var r=t.columnorder||[],n=t.header.values.length,i=r.slice(0,n),a=i.slice().sort(function(t,e){return t-e}),o=i.map(function(t){return a.indexOf(t)}),s=o.length;s<n;s++)o.push(s);e("columnorder",o)}(e,o),o("cells.values"),o("cells.format"),o("cells.align"),o("cells.prefix"),o("cells.suffix"),o("cells.height"),o("cells.line.width"),o("cells.line.color"),o("cells.fill.color"),n.coerceFont(o,"cells.font",n.extendFlat({},a.font))}},{"../../lib":724,"./attributes":1128}],1135:[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.moduleType="trace",n.name="table",n.basePlotModule=t("./base_plot"),n.categories=["noOpacity"],n.meta={},e.exports=n},{"./attributes":1128,"./base_plot":1129,"./calc":1130,"./defaults":1134,"./plot":1136}],1136:[function(t,e,r){"use strict";var n=t("./constants"),i=t("d3"),a=t("../../lib/gup"),o=t("../../components/drawing"),s=t("../../lib/svg_text_utils"),l=t("../../lib").raiseToTop,c=t("../../lib").cancelTransition,u=t("./data_preparation_helper"),f=t("./data_split_helpers"),h=t("../../components/color");function d(t,e){return"clip"+t._fullLayout._uid+"_scrollAreaBottomClip_"+e.key}function p(t,e){return"clip"+t._fullLayout._uid+"_columnBoundaryClippath_"+e.calcdata.key+"_"+e.specIndex}function m(t){return[].concat.apply([],t.map(function(t){return t})).map(function(t){return t.__data__})}function v(t,e,r){var o=t.selectAll("."+n.cn.scrollbarKit).data(a.repeat,a.keyFun);o.enter().append("g").classed(n.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),o.each(function(t){var e=t.scrollbarState;e.totalHeight=function(t){var e=t.rowBlocks;return z(e,e.length-1)+(e.length?O(e[e.length-1],1/0):1)}(t),e.scrollableAreaHeight=t.groupHeight-k(t),e.currentlyVisibleHeight=Math.min(e.totalHeight,e.scrollableAreaHeight),e.ratio=e.currentlyVisibleHeight/e.totalHeight,e.barLength=Math.max(e.ratio*e.currentlyVisibleHeight,n.goldenRatio*n.scrollbarWidth),e.barWiggleRoom=e.currentlyVisibleHeight-e.barLength,e.wiggleRoom=Math.max(0,e.totalHeight-e.scrollableAreaHeight),e.topY=0===e.barWiggleRoom?0:t.scrollY/e.wiggleRoom*e.barWiggleRoom,e.bottomY=e.topY+e.barLength,e.dragMultiplier=e.wiggleRoom/e.barWiggleRoom}).attr("transform",function(t){return"translate("+(t.width+n.scrollbarWidth/2+n.scrollbarOffset)+" "+k(t)+")"});var s=o.selectAll("."+n.cn.scrollbar).data(a.repeat,a.keyFun);s.enter().append("g").classed(n.cn.scrollbar,!0);var l=s.selectAll("."+n.cn.scrollbarSlider).data(a.repeat,a.keyFun);l.enter().append("g").classed(n.cn.scrollbarSlider,!0),l.attr("transform",function(t){return"translate(0 "+(t.scrollbarState.topY||0)+")"});var c=l.selectAll("."+n.cn.scrollbarGlyph).data(a.repeat,a.keyFun);c.enter().append("line").classed(n.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",n.scrollbarWidth).attr("stroke-linecap","round").attr("y1",n.scrollbarWidth/2),c.attr("y2",function(t){return t.scrollbarState.barLength-n.scrollbarWidth/2}).attr("stroke-opacity",function(t){return t.columnDragInProgress||!t.scrollbarState.barWiggleRoom||r?0:.4}),c.transition().delay(0).duration(0),c.transition().delay(n.scrollbarHideDelay).duration(n.scrollbarHideDuration).attr("stroke-opacity",0);var u=s.selectAll("."+n.cn.scrollbarCaptureZone).data(a.repeat,a.keyFun);u.enter().append("line").classed(n.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",n.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(r){var n=i.event.y,a=this.getBoundingClientRect(),o=r.scrollbarState,s=n-a.top,l=i.scale.linear().domain([0,o.scrollableAreaHeight]).range([0,o.totalHeight]).clamp(!0);o.topY<=s&&s<=o.bottomY||T(e,t,null,l(s-o.barLength/2))(r)}).call(i.behavior.drag().origin(function(t){return i.event.stopPropagation(),t.scrollbarState.scrollbarScrollInProgress=!0,t}).on("drag",T(e,t)).on("dragend",function(){})),u.attr("y2",function(t){return t.scrollbarState.scrollableAreaHeight})}function g(t,e,r,s){var l=function(t){var e=t.selectAll("."+n.cn.columnCell).data(f.splitToCells,function(t){return t.keyWithinBlock});return e.enter().append("g").classed(n.cn.columnCell,!0),e.exit().remove(),e}(function(t){var e=t.selectAll("."+n.cn.columnCells).data(a.repeat,a.keyFun);return e.enter().append("g").classed(n.cn.columnCells,!0),e.exit().remove(),e}(r));!function(t){t.each(function(t,e){var r=t.calcdata.cells.font,n=t.column.specIndex,i={size:x(r.size,n,e),color:x(r.color,n,e),family:x(r.family,n,e)};t.rowNumber=t.key,t.align=x(t.calcdata.cells.align,n,e),t.cellBorderWidth=x(t.calcdata.cells.line.width,n,e),t.font=i})}(l),function(t){t.attr("width",function(t){return t.column.columnWidth}).attr("stroke-width",function(t){return t.cellBorderWidth}).each(function(t){var e=i.select(this);h.stroke(e,x(t.calcdata.cells.line.color,t.column.specIndex,t.rowNumber)),h.fill(e,x(t.calcdata.cells.fill.color,t.column.specIndex,t.rowNumber))})}(function(t){var e=t.selectAll("."+n.cn.cellRect).data(a.repeat,function(t){return t.keyWithinBlock});return e.enter().append("rect").classed(n.cn.cellRect,!0),e}(l));var c=function(t){var e=t.selectAll("."+n.cn.cellText).data(a.repeat,function(t){return t.keyWithinBlock});return e.enter().append("text").classed(n.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){i.event.stopPropagation()}),e}(function(t){var e=t.selectAll("."+n.cn.cellTextHolder).data(a.repeat,function(t){return t.keyWithinBlock});return e.enter().append("g").classed(n.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),e}(l));!function(t){t.each(function(t){o.font(i.select(this),t.font)})}(c),y(c,e,s,t),P(l)}function y(t,e,r,a){t.text(function(t){var e=t.column.specIndex,r=t.rowNumber,a=t.value,o="string"==typeof a,s=o&&a.match(/<br>/i),l=!o||s;t.mayHaveMarkup=o&&a.match(/[<&>]/);var c,u="string"==typeof(c=a)&&c.match(n.latexCheck);t.latex=u;var f,h,d=u?"":x(t.calcdata.cells.prefix,e,r)||"",p=u?"":x(t.calcdata.cells.suffix,e,r)||"",m=u?null:x(t.calcdata.cells.format,e,r)||null,v=d+(m?i.format(m)(t.value):t.value)+p;if(t.wrappingNeeded=!t.wrapped&&!l&&!u&&(f=b(v)),t.cellHeightMayIncrease=s||u||t.mayHaveMarkup||(void 0===f?b(v):f),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex,t.wrappingNeeded){var g=(" "===n.wrapSplitCharacter?v.replace(/<a href=/gi,"<a_href="):v).split(n.wrapSplitCharacter),y=" "===n.wrapSplitCharacter?g.map(function(t){return t.replace(/<a_href=/gi,"<a href=")}):g;t.fragments=y.map(function(t){return{text:t,width:null}}),t.fragments.push({fragment:n.wrapSpacer,width:null}),h=y.join(n.lineBreaker)+n.lineBreaker+n.wrapSpacer}else delete t.fragments,h=v;return h}).attr("dy",function(t){return t.needsConvertToTspans?0:"0.75em"}).each(function(t){var o=i.select(this),l=t.wrappingNeeded?S:L;t.needsConvertToTspans?s.convertToTspans(o,a,l(r,this,e,a,t)):i.select(this.parentNode).attr("transform",function(t){return"translate("+C(t)+" "+n.cellPad+")"}).attr("text-anchor",function(t){return{left:"start",center:"middle",right:"end"}[t.align]})})}function b(t){return-1!==t.indexOf(n.wrapSplitCharacter)}function x(t,e,r){if(Array.isArray(t)){var n=t[Math.min(e,t.length-1)];return Array.isArray(n)?n[Math.min(r,n.length-1)]:n}return t}function _(t,e,r){t.transition().ease(n.releaseTransitionEase).duration(n.releaseTransitionDuration).attr("transform","translate("+e.x+" "+r+")")}function w(t){return"cells"===t.type}function M(t){return"header"===t.type}function k(t){return(t.rowBlocks.length?t.rowBlocks[0].auxiliaryBlocks:[]).reduce(function(t,e){return t+O(e,1/0)},0)}function A(t,e,r){var n=m(e)[0];if(void 0!==n){var i=n.rowBlocks,a=n.calcdata,o=z(i,i.length),s=n.calcdata.groupHeight-k(n),l=a.scrollY=Math.max(0,Math.min(o-s,a.scrollY)),c=function(t,e,r){for(var n=[],i=0,a=0;a<t.length;a++){for(var o=t[a],s=o.rows,l=0,c=0;c<s.length;c++)l+=s[c].rowHeight;o.allRowsHeight=l,e<i+l&&e+r>i&&n.push(a),i+=l}return n}(i,l,s);1===c.length&&(c[0]===i.length-1?c.unshift(c[0]-1):c.push(c[0]+1)),c[0]%2&&c.reverse(),e.each(function(t,e){t.page=c[e],t.scrollY=l}),e.attr("transform",function(t){return"translate(0 "+(z(t.rowBlocks,t.page)-t.scrollY)+")"}),t&&(E(t,r,e,c,n.prevPages,n,0),E(t,r,e,c,n.prevPages,n,1),v(r,t))}}function T(t,e,r,a){return function(o){var s=o.calcdata?o.calcdata:o,l=e.filter(function(t){return s.key===t.key}),c=r||s.scrollbarState.dragMultiplier;s.scrollY=void 0===a?s.scrollY+c*i.event.dy:a;var u=l.selectAll("."+n.cn.yColumn).selectAll("."+n.cn.columnBlock).filter(w);A(t,u,l)}}function E(t,e,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout(function(){var a=r.filter(function(t,e){return e===o&&n[e]!==i[e]});g(t,e,a,r),i[o]=n[o]}))}function S(t,e,r){return function(){var a=i.select(e.parentNode);a.each(function(t){var e=t.fragments;a.selectAll("tspan.line").each(function(t,r){e[r].width=this.getComputedTextLength()});var r,i,o=e[e.length-1].width,s=e.slice(0,-1),l=[],c=0,u=t.column.columnWidth-2*n.cellPad;for(t.value="";s.length;)c+(i=(r=s.shift()).width+o)>u&&(t.value+=l.join(n.wrapSpacer)+n.lineBreaker,l=[],c=0),l.push(r.text),c+=i;c&&(t.value+=l.join(n.wrapSpacer)),t.wrapped=!0}),a.selectAll("tspan.line").remove(),y(a.select("."+n.cn.cellText),r,t),i.select(e.parentNode.parentNode).call(P)}}function L(t,e,r,a,o){return function(){if(!o.settledY){var s=i.select(e.parentNode),l=I(o),c=o.key-l.firstRowIndex,u=l.rows[c].rowHeight,f=o.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*n.cellPad:u,h=Math.max(f,u);h-l.rows[c].rowHeight&&(l.rows[c].rowHeight=h,t.selectAll("."+n.cn.columnCell).call(P),A(null,t.filter(w),0),v(r,a,!0)),s.attr("transform",function(){var t=this.parentNode.getBoundingClientRect(),e=i.select(this.parentNode).select("."+n.cn.cellRect).node().getBoundingClientRect(),r=this.transform.baseVal.consolidate(),a=e.top-t.top+(r?r.matrix.f:n.cellPad);return"translate("+C(o,i.select(this.parentNode).select("."+n.cn.cellTextHolder).node().getBoundingClientRect().width)+" "+a+")"}),o.settledY=!0}}}function C(t,e){switch(t.align){case"left":return n.cellPad;case"right":return t.column.columnWidth-(e||0)-n.cellPad;case"center":return(t.column.columnWidth-(e||0))/2;default:return n.cellPad}}function P(t){t.attr("transform",function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce(function(t,e){return t+O(e,1/0)},0);return"translate(0 "+(O(I(t),t.key)+e)+")"}).selectAll("."+n.cn.cellRect).attr("height",function(t){return(e=I(t),r=t.key,e.rows[r-e.firstRowIndex]).rowHeight;var e,r})}function z(t,e){for(var r=0,n=e-1;n>=0;n--)r+=D(t[n]);return r}function O(t,e){for(var r=0,n=0;n<t.rows.length&&t.rows[n].rowIndex<e;n++)r+=t.rows[n].rowHeight;return r}function D(t){var e=t.allRowsHeight;if(void 0!==e)return e;for(var r=0,n=0;n<t.rows.length;n++)r+=t.rows[n].rowHeight;return t.allRowsHeight=r,r}function I(t){return t.rowBlocks[t.page]}e.exports=function(t,e){var r=t._fullLayout._paper.selectAll("."+n.cn.table).data(e.map(function(e){var r=a.unwrap(e).trace;return u(t,r)}),a.keyFun);r.exit().remove(),r.enter().append("g").classed(n.cn.table,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","all"),r.attr("width",function(t){return t.width+t.size.l+t.size.r}).attr("height",function(t){return t.height+t.size.t+t.size.b}).attr("transform",function(t){return"translate("+t.translateX+","+t.translateY+")"});var s=r.selectAll("."+n.cn.tableControlView).data(a.repeat,a.keyFun);s.enter().append("g").classed(n.cn.tableControlView,!0).style("box-sizing","content-box").on("mousemove",function(e){s.filter(function(t){return e===t}).call(v,t)}).on("mousewheel",function(e){e.scrollbarState.wheeling||(e.scrollbarState.wheeling=!0,i.event.stopPropagation(),i.event.preventDefault(),T(t,s,null,e.scrollY+i.event.deltaY)(e),e.scrollbarState.wheeling=!1)}).call(v,t,!0),s.attr("transform",function(t){return"translate("+t.size.l+" "+t.size.t+")"});var h=s.selectAll("."+n.cn.scrollBackground).data(a.repeat,a.keyFun);h.enter().append("rect").classed(n.cn.scrollBackground,!0).attr("fill","none"),h.attr("width",function(t){return t.width}).attr("height",function(t){return t.height}),s.each(function(e){o.setClipUrl(i.select(this),d(t,e))});var y=s.selectAll("."+n.cn.yColumn).data(function(t){return t.columns},a.keyFun);y.enter().append("g").classed(n.cn.yColumn,!0),y.exit().remove(),y.attr("transform",function(t){return"translate("+t.x+" 0)"}).call(i.behavior.drag().origin(function(e){return _(i.select(this),e,-n.uplift),l(this),e.calcdata.columnDragInProgress=!0,v(s.filter(function(t){return e.calcdata.key===t.key}),t),e}).on("drag",function(t){var e=i.select(this),r=function(e){return(t===e?i.event.x:e.x)+e.columnWidth/2};t.x=Math.max(-n.overdrag,Math.min(t.calcdata.width+n.overdrag-t.columnWidth,i.event.x)),m(y).filter(function(e){return e.calcdata.key===t.calcdata.key}).sort(function(t,e){return r(t)-r(e)}).forEach(function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e)}),y.filter(function(e){return t!==e}).transition().ease(n.transitionEase).duration(n.transitionDuration).attr("transform",function(t){return"translate("+t.x+" 0)"}),e.call(c).attr("transform","translate("+t.x+" -"+n.uplift+" )")}).on("dragend",function(e){var r=i.select(this),n=e.calcdata;e.x=e.xScale(e),e.calcdata.columnDragInProgress=!1,_(r,e,0),function(t,e,r){var n=e.gdColumnsOriginalOrder;e.gdColumns.sort(function(t,e){return r[n.indexOf(t)]-r[n.indexOf(e)]}),e.columnorder=r,t.emit("plotly_restyle")}(t,n,n.columns.map(function(t){return t.xIndex}))})),y.each(function(e){o.setClipUrl(i.select(this),p(t,e))});var b=y.selectAll("."+n.cn.columnBlock).data(f.splitToPanels,a.keyFun);b.enter().append("g").classed(n.cn.columnBlock,!0).attr("id",function(t){return t.key}),b.style("cursor",function(t){return t.dragHandle?"ew-resize":t.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"});var x=b.filter(M),k=b.filter(w);k.call(i.behavior.drag().origin(function(t){return i.event.stopPropagation(),t}).on("drag",T(t,s,-1)).on("dragend",function(){})),g(t,s,x,b),g(t,s,k,b);var E=s.selectAll("."+n.cn.scrollAreaClip).data(a.repeat,a.keyFun);E.enter().append("clipPath").classed(n.cn.scrollAreaClip,!0).attr("id",function(e){return d(t,e)});var S=E.selectAll("."+n.cn.scrollAreaClipRect).data(a.repeat,a.keyFun);S.enter().append("rect").classed(n.cn.scrollAreaClipRect,!0).attr("x",-n.overdrag).attr("y",-n.uplift).attr("fill","none"),S.attr("width",function(t){return t.width+2*n.overdrag}).attr("height",function(t){return t.height+n.uplift}),y.selectAll("."+n.cn.columnBoundary).data(a.repeat,a.keyFun).enter().append("g").classed(n.cn.columnBoundary,!0);var L=y.selectAll("."+n.cn.columnBoundaryClippath).data(a.repeat,a.keyFun);L.enter().append("clipPath").classed(n.cn.columnBoundaryClippath,!0),L.attr("id",function(e){return p(t,e)});var C=L.selectAll("."+n.cn.columnBoundaryRect).data(a.repeat,a.keyFun);C.enter().append("rect").classed(n.cn.columnBoundaryRect,!0).attr("fill","none"),C.attr("width",function(t){return t.columnWidth}).attr("height",function(t){return t.calcdata.height+n.uplift}),A(null,k,s)}},{"../../components/color":598,"../../components/drawing":623,"../../lib":724,"../../lib/gup":721,"../../lib/svg_text_utils":747,"./constants":1131,"./data_preparation_helper":1132,"./data_split_helpers":1133,d3:128}],1137:[function(t,e,r){"use strict";var n=t("../box/attributes"),i=t("../../lib/extend").extendFlat;e.exports={y:n.y,x:n.x,x0:n.x0,y0:n.y0,name:n.name,orientation:i({},n.orientation,{}),bandwidth:{valType:"number",min:0,editType:"calc"},scalegroup:{valType:"string",dflt:"",editType:"calc"},scalemode:{valType:"enumerated",values:["width","count"],dflt:"width",editType:"calc"},spanmode:{valType:"enumerated",values:["soft","hard","manual"],dflt:"soft",editType:"calc"},span:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,points:i({},n.boxpoints,{}),jitter:i({},n.jitter,{}),pointpos:i({},n.pointpos,{}),marker:n.marker,text:n.text,box:{visible:{valType:"boolean",dflt:!1,editType:"plot"},width:{valType:"number",min:0,max:1,dflt:.25,editType:"plot"},fillcolor:{valType:"color",editType:"style"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"plot"},meanline:{visible:{valType:"boolean",dflt:!1,editType:"plot"},color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"plot"},side:{valType:"enumerated",values:["both","positive","negative"],dflt:"both",editType:"plot"},selected:n.selected,unselected:n.unselected,hoveron:{valType:"flaglist",flags:["violins","points","kde"],dflt:"violins+points+kde",extras:["all"],editType:"style"}}},{"../../lib/extend":713,"../box/attributes":877}],1138:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("../box/calc"),o=t("./helpers"),s=t("../../constants/numerical").BADNUM;function l(t,e,r){return 1.059*Math.min(e,r/1.349)*Math.pow(t.length,-.2)}function c(t,e,r,n){var a,o=t.spanmode,l=t.span||[],c=[e.min,e.max],u=[e.min-2*n,e.max+2*n];function f(n){var i=l[n],a=r.d2c(i,0,t[e.valLetter+"calendar"]);return a===s?u[n]:a}var h={type:"linear",range:a="soft"===o?u:"hard"===o?c:[f(0),f(1)]};return i.setConvert(h),h.cleanRange(),a}e.exports=function(t,e){var r=a(t,e);if(r[0].t.empty)return r;var s=t._fullLayout,u=i.getFromId(t,e["h"===e.orientation?"xaxis":"yaxis"]),f=s._violinScaleGroupStats,h=e.scalegroup,d=f[h];d||(d=f[h]={maxWidth:0,maxCount:0});for(var p=0;p<r.length;p++){var m=r[p],v=m.pts.map(o.extractVal),g=v.length,y=l(v,n.stdev(v,g-1,m.mean),m.q3-m.q1),b=m.bandwidth=e.bandwidth||y,x=m.span=c(e,m,u,b),_=x[1]-x[0],w=Math.ceil(_/(Math.min(y,b)/3)),M=_/w;if(!isFinite(M)||!isFinite(w))return n.error("Something went wrong with computing the violin span"),r[0].t.empty=!0,r;var k=o.makeKDE(m,e,v);m.density=new Array(w);for(var A=0,T=x[0];T<x[1]+M/2;A++,T+=M){var E=k(T);d.maxWidth=Math.max(d.maxWidth,E),m.density[A]={v:E,t:T}}i.expand(u,x,{padded:!0}),d.maxCount=Math.max(d.maxCount,v.length)}return r[0].t.labels.kde=n._(t,"kde:"),r}},{"../../constants/numerical":702,"../../lib":724,"../../plots/cartesian/axes":770,"../box/calc":878,"./helpers":1140}],1139:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color"),a=t("../box/defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,i){return n.coerce(t,e,o,r,i)}function c(r,i){return n.coerce2(t,e,o,r,i)}if(a.handleSampleDefaults(t,e,l,s),!1!==e.visible){l("bandwidth"),l("scalegroup",e.name),l("scalemode"),l("side");var u,f=l("span");Array.isArray(f)&&(u="manual"),l("spanmode",u);var h=l("line.color",(t.marker||{}).color||r),d=l("line.width"),p=l("fillcolor",i.addOpacity(e.line.color,.5));a.handlePointsDefaults(t,e,l,{prefix:""});var m=c("box.width"),v=c("box.fillcolor",p),g=c("box.line.color",h),y=c("box.line.width",d);l("box.visible",Boolean(m||v||g||y))||delete e.box;var b=c("meanline.color",h),x=c("meanline.width",d);l("meanline.visible",Boolean(b||x))||delete e.meanline}}},{"../../components/color":598,"../../lib":724,"../box/defaults":879,"./attributes":1137}],1140:[function(t,e,r){"use strict";var n=t("../../lib"),i=function(t){return 1/Math.sqrt(2*Math.PI)*Math.exp(-.5*t*t)};r.makeKDE=function(t,e,r){var n=r.length,a=i,o=t.bandwidth,s=1/(n*o);return function(t){for(var e=0,i=0;i<n;i++)e+=a((t-r[i])/o);return s*e}},r.getPositionOnKdePath=function(t,e,r){var i,a;"h"===e.orientation?(i="y",a="x"):(i="x",a="y");var o=n.findPointOnPath(t.path,r,a,{pathLength:t.pathLength}),s=t.posCenterPx,l=o[i];return[l,"both"===e.side?2*s-l:s]},r.getKdeValue=function(t,e,n){var i=t.pts.map(r.extractVal);return r.makeKDE(t,e,i)(n)/t.posDensityScale},r.extractVal=function(t){return t.v}},{"../../lib":724}],1141:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("../box/hover"),o=t("./helpers");e.exports=function(t,e,r,s,l){var c,u,f=t.cd,h=f[0].trace,d=h.hoveron,p=-1!==d.indexOf("violins"),m=-1!==d.indexOf("kde"),v=[];if(p||m){var g=a.hoverOnBoxes(t,e,r,s);if(p&&(v=v.concat(g)),m&&g.length>0){var y,b,x,_,w,M=t.xa,k=t.ya;"h"===h.orientation?(w=e,y="y",x=k,b="x",_=M):(w=r,y="x",x=M,b="y",_=k);var A=f[t.index];if(w>=A.span[0]&&w<=A.span[1]){var T=n.extendFlat({},t),E=_.c2p(w,!0),S=o.getKdeValue(A,h,w),L=o.getPositionOnKdePath(A,h,E),C=x._offset,P=x._length;T[y+"0"]=L[0],T[y+"1"]=L[1],T[b+"0"]=T[b+"1"]=E,T[b+"Label"]=b+": "+i.hoverLabelText(_,w)+", "+f[0].t.labels.kde+" "+S.toFixed(3),v.push(T),(u={stroke:t.color})[y+"1"]=n.constrain(C+L[0],C,C+P),u[y+"2"]=n.constrain(C+L[1],C,C+P),u[b+"1"]=u[b+"2"]=_._offset+E}}}-1!==d.indexOf("points")&&(c=a.hoverOnPoints(t,e,r));var z=l.selectAll(".violinline-"+h.uid).data(u?[0]:[]);return z.enter().append("line").classed("violinline-"+h.uid,!0).attr("stroke-width",1.5),z.exit().remove(),z.attr(u),"closest"===s?c?[c]:v:c?(v.push(c),v):v}},{"../../lib":724,"../../plots/cartesian/axes":770,"../box/hover":880,"./helpers":1140}],1142:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),setPositions:t("./set_positions"),plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover"),selectPoints:t("../box/select"),moduleType:"trace",name:"violin",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","symbols","oriented","box-violin","showLegend"],meta:{}}},{"../../plots/cartesian":781,"../box/select":885,"./attributes":1137,"./calc":1138,"./defaults":1139,"./hover":1141,"./layout_attributes":1143,"./layout_defaults":1144,"./plot":1145,"./set_positions":1146,"./style":1147}],1143:[function(t,e,r){"use strict";var n=t("../box/layout_attributes"),i=t("../../lib").extendFlat;e.exports={violinmode:i({},n.boxmode,{}),violingap:i({},n.boxgap,{}),violingroupgap:i({},n.boxgroupgap,{})}},{"../../lib":724,"../box/layout_attributes":882}],1144:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("../box/layout_defaults");e.exports=function(t,e,r){a._supply(t,e,r,function(r,a){return n.coerce(t,e,i,r,a)},"violin")}},{"../../lib":724,"../box/layout_defaults":883,"./layout_attributes":1143}],1145:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../box/plot"),s=t("../scatter/line_points"),l=t("./helpers");e.exports=function(t,e,r){var c=t._fullLayout,u=e.xaxis,f=e.yaxis;function h(t){var e=s(t,{xaxis:u,yaxis:f,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0});return a.smoothopen(e[0],1)}e.plot.select(".violinlayer").selectAll("g.trace.violins").data(r).enter().append("g").attr("class","trace violins").each(function(t){var r=t[0],a=r.t,s=r.trace,d=r.node3=n.select(this),p=c._numViolins,m="group"===c.violinmode&&p>1,v=a.bdPos=a.dPos*(1-c.violingap)*(1-c.violingroupgap)/(m?p:1),g=a.bPos=m?2*a.dPos*((a.num+.5)/p-.5)*(1-c.violingap):0;if(!0!==s.visible||a.empty)n.select(this).remove();else{var y=e[a.valLetter+"axis"],b=e[a.posLetter+"axis"],x="both"===s.side,_=x||"positive"===s.side,w=x||"negative"===s.side,M=s.box&&s.box.visible,k=s.meanline&&s.meanline.visible,A=c._violinScaleGroupStats[s.scalegroup];if(d.selectAll("path.violin").data(i.identity).enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin").each(function(t){var e,r,i,o,l,c,u,f,d=n.select(this),p=t.density,m=p.length,M=t.pos+g,k=b.c2p(M);switch(s.scalemode){case"width":e=A.maxWidth/v;break;case"count":e=A.maxWidth/v*(A.maxCount/t.pts.length)}if(_){for(u=new Array(m),l=0;l<m;l++)(f=u[l]={})[a.posLetter]=M+p[l].v/e,f[a.valLetter]=p[l].t;r=h(u)}if(w){for(u=new Array(m),c=0,l=m-1;c<m;c++,l--)(f=u[c]={})[a.posLetter]=M-p[l].v/e,f[a.valLetter]=p[l].t;i=h(u)}if(x)o=r+"L"+i.substr(1)+"Z";else{var T=[k,y.c2p(p[0].t)],E=[k,y.c2p(p[m-1].t)];"h"===s.orientation&&(T.reverse(),E.reverse()),o=_?"M"+T+"L"+r.substr(1)+"L"+E:"M"+E+"L"+i.substr(1)+"L"+T}d.attr("d",o),t.posCenterPx=k,t.posDensityScale=e*v,t.path=d.node(),t.pathLength=t.path.getTotalLength()/(x?2:1)}),M){var T,E,S=s.box.width,L=s.box.line.width;x?(T=v*S,E=0):_?(T=[0,v*S/2],E=-L):(T=[v*S/2,0],E=L),s.whiskerwidth=0,o.plotBoxAndWhiskers(d,{pos:b,val:y},s,{bPos:g,bdPos:T,bPosPxOffset:E}),k&&o.plotBoxMean(d,{pos:b,val:y},s,{bPos:g,bdPos:T,bPosPxOffset:E})}else k&&d.selectAll("path.mean").data(i.identity).enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}).each(function(t){var e=y.c2p(t.mean,!0),r=l.getPositionOnKdePath(t,s,e);n.select(this).attr("d","h"===s.orientation?"M"+e+","+r[0]+"V"+r[1]:"M"+r[0]+","+e+"H"+r[1])});s.points&&o.plotPoints(d,{x:u,y:f},s,a)}})}},{"../../components/drawing":623,"../../lib":724,"../box/plot":884,"../scatter/line_points":1062,"./helpers":1140,d3:128}],1146:[function(t,e,r){"use strict";var n=t("../box/set_positions").setPositionOffset,i=["v","h"];e.exports=function(t,e){for(var r=t.calcdata,a=e.xaxis,o=e.yaxis,s=0;s<i.length;s++){for(var l=i[s],c="h"===l?o:a,u=[],f=0,h=0,d=0;d<r.length;d++){var p=r[d],m=p[0].t,v=p[0].trace;!0!==v.visible||"violin"!==v.type||m.empty||v.orientation!==l||v.xaxis!==a._id||v.yaxis!==o._id||(u.push(d),!1!==v.points&&(f=Math.max(f,v.jitter-v.pointpos-1),h=Math.max(h,v.jitter+v.pointpos-1)))}n("violin",t,u,c,[f,h])}}},{"../box/set_positions":886}],1147:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/color"),a=t("../scatter/style").stylePoints;e.exports=function(t,e){var r=e?e[0].node3:n.select(t).selectAll("g.trace.violins");r.style("opacity",function(t){return t[0].trace.opacity}),r.each(function(e){var r=e[0].trace,o=n.select(this),s=r.box||{},l=s.line||{},c=r.meanline||{},u=c.width;o.selectAll("path.violin").style("stroke-width",r.line.width+"px").call(i.stroke,r.line.color).call(i.fill,r.fillcolor),o.selectAll("path.box").style("stroke-width",l.width+"px").call(i.stroke,l.color).call(i.fill,s.fillcolor),o.selectAll("path.mean").style({"stroke-width":u+"px","stroke-dasharray":2*u+"px,"+u+"px"}).call(i.stroke,c.color),a(o,r,t)})}},{"../../components/color":598,"../scatter/style":1069,d3:128}],1148:[function(t,e,r){"use strict";var n=t("../plots/cartesian/axes"),i=t("../lib"),a=t("../plot_api/plot_schema"),o=t("./helpers").pointsAccessorFunction,s=t("../constants/numerical").BADNUM;r.moduleType="transform",r.name="aggregate";var l=r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},aggregations:{_isLinkedToArray:"aggregation",target:{valType:"string",editType:"calc"},func:{valType:"enumerated",values:["count","sum","avg","median","mode","rms","stddev","min","max","first","last"],dflt:"first",editType:"calc"},funcmode:{valType:"enumerated",values:["sample","population"],dflt:"sample",editType:"calc"},enabled:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},editType:"calc"},c=l.aggregations;function u(t,e,r,a){if(a.enabled){for(var o=a.target,l=i.nestedProperty(e,o),c=l.get(),u=function(t,e){var r=t.func,n=e.d2c,i=e.c2d;switch(r){case"count":return f;case"first":return h;case"last":return d;case"sum":return function(t,e){for(var r=0,a=0;a<e.length;a++){var o=n(t[e[a]]);o!==s&&(r+=o)}return i(r)};case"avg":return function(t,e){for(var r=0,a=0,o=0;o<e.length;o++){var l=n(t[e[o]]);l!==s&&(r+=l,a++)}return a?i(r/a):s};case"min":return function(t,e){for(var r=1/0,a=0;a<e.length;a++){var o=n(t[e[a]]);o!==s&&(r=Math.min(r,o))}return r===1/0?s:i(r)};case"max":return function(t,e){for(var r=-1/0,a=0;a<e.length;a++){var o=n(t[e[a]]);o!==s&&(r=Math.max(r,o))}return r===-1/0?s:i(r)};case"median":return function(t,e){for(var r=[],a=0;a<e.length;a++){var o=n(t[e[a]]);o!==s&&r.push(o)}if(!r.length)return s;r.sort();var l=(r.length-1)/2;return i((r[Math.floor(l)]+r[Math.ceil(l)])/2)};case"mode":return function(t,e){for(var r={},a=0,o=s,l=0;l<e.length;l++){var c=n(t[e[l]]);if(c!==s){var u=r[c]=(r[c]||0)+1;u>a&&(a=u,o=c)}}return a?i(o):s};case"rms":return function(t,e){for(var r=0,a=0,o=0;o<e.length;o++){var l=n(t[e[o]]);l!==s&&(r+=l*l,a++)}return a?i(Math.sqrt(r/a)):s};case"stddev":return function(e,r){var i,a=0,o=0,l=1,c=s;for(i=0;i<r.length&&c===s;i++)c=n(e[r[i]]);if(c===s)return s;for(;i<r.length;i++){var u=n(e[r[i]]);if(u!==s){var f=u-c;a+=f,o+=f*f,l++}}var h="sample"===t.funcmode?l-1:l;return h?Math.sqrt((o-a*a/l)/h):0}}}(a,n.getDataConversions(t,e,o,c)),p=new Array(r.length),m=0;m<r.length;m++)p[m]=u(c,r[m]);l.set(p)}}function f(t,e){return e.length}function h(t,e){return t[e[0]]}function d(t,e){return t[e[e.length-1]]}r.supplyDefaults=function(t,e){var r,n={};function o(e,r){return i.coerce(t,n,l,e,r)}if(!o("enabled"))return n;var s=a.findArrayAttributes(e),u={};for(r=0;r<s.length;r++)u[s[r]]=1;var f=o("groups");if(!Array.isArray(f)){if(!u[f])return void(n.enabled=!1);u[f]=0}var h,d=t.aggregations||[],p=n.aggregations=new Array(d.length);function m(t,e){return i.coerce(d[r],h,c,t,e)}for(r=0;r<d.length;r++){h={_index:r};var v=m("target"),g=m("func");m("enabled")&&v&&(u[v]||"count"===g&&void 0===u[v])?("stddev"===g&&m("funcmode"),u[v]=0,p[r]=h):p[r]={enabled:!1,_index:r}}for(r=0;r<s.length;r++)u[s[r]]&&p.push({target:s[r],func:c.func.dflt,enabled:!0,_index:-1});return n},r.calcTransform=function(t,e,r){if(r.enabled){var n=r.groups,a=i.getTargetArray(e,{target:n});if(a){var s,l,c,f,h={},d={},p=[],m=o(e.transforms,r);for(s=0;s<a.length;s++)void 0===(c=h[l=a[s]])?(h[l]=p.length,f=[s],p.push(f),d[h[l]]=m(s)):(p[c].push(s),d[h[l]]=(d[h[l]]||[]).concat(m(s)));r._indexToPoints=d;var v=r.aggregations;for(s=0;s<v.length;s++)u(t,e,p,v[s]);"string"==typeof n&&u(t,e,p,{target:n,func:"first",enabled:!0})}}}},{"../constants/numerical":702,"../lib":724,"../plot_api/plot_schema":759,"../plots/cartesian/axes":770,"./helpers":1151}],1149:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../registry"),a=t("../plots/cartesian/axes"),o=t("./helpers").pointsAccessorFunction,s=t("../constants/filter_ops"),l=s.COMPARISON_OPS,c=s.INTERVAL_OPS,u=s.SET_OPS;r.moduleType="transform",r.name="filter",r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},target:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},operation:{valType:"enumerated",values:[].concat(l).concat(c).concat(u),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},preservegaps:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc"},r.supplyDefaults=function(t){var e={};function a(i,a){return n.coerce(t,e,r.attributes,i,a)}if(a("enabled")){a("preservegaps"),a("operation"),a("value"),a("target");var o=i.getComponentMethod("calendars","handleDefaults");o(t,e,"valuecalendar",null),o(t,e,"targetcalendar",null)}return e},r.calcTransform=function(t,e,r){if(r.enabled){var i=n.getTargetArray(e,r);if(i){var s=r.target,f=i.length,h=r.targetcalendar,d=e._arrayAttrs;if("string"==typeof s){var p=n.nestedProperty(e,s+"calendar").get();p&&(h=p)}var m,v,g=function(t,e,r){var n=t.operation,i=t.value,a=Array.isArray(i);function o(t){return-1!==t.indexOf(n)}var s,f=function(r){return e(r,0,t.valuecalendar)},h=function(t){return e(t,0,r)};o(l)?s=f(a?i[0]:i):o(c)?s=a?[f(i[0]),f(i[1])]:[f(i),f(i)]:o(u)&&(s=a?i.map(f):[f(i)]);switch(n){case"=":return function(t){return h(t)===s};case"!=":return function(t){return h(t)!==s};case"<":return function(t){return h(t)<s};case"<=":return function(t){return h(t)<=s};case">":return function(t){return h(t)>s};case">=":return function(t){return h(t)>=s};case"[]":return function(t){var e=h(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=h(t);return e>s[0]&&e<s[1]};case"[)":return function(t){var e=h(t);return e>=s[0]&&e<s[1]};case"(]":return function(t){var e=h(t);return e>s[0]&&e<=s[1]};case"][":return function(t){var e=h(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=h(t);return e<s[0]||e>s[1]};case"](":return function(t){var e=h(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=h(t);return e<s[0]||e>=s[1]};case"{}":return function(t){return-1!==s.indexOf(h(t))};case"}{":return function(t){return-1===s.indexOf(h(t))}}}(r,a.getDataToCoordFunc(t,e,s,i),h),y={},b={},x=0;r.preservegaps?(m=function(t){y[t.astr]=n.extendDeep([],t.get()),t.set(new Array(f))},v=function(t,e){var r=y[t.astr][e];t.get()[e]=r}):(m=function(t){y[t.astr]=n.extendDeep([],t.get()),t.set([])},v=function(t,e){var r=y[t.astr][e];t.get().push(r)}),M(m);for(var _=o(e.transforms,r),w=0;w<f;w++){g(i[w])&&(M(v,w),b[x++]=_(w))}r._indexToPoints=b,e._length=x}}function M(t,r){for(var i=0;i<d.length;i++){t(n.nestedProperty(e,d[i]),r)}}}},{"../constants/filter_ops":697,"../lib":724,"../plots/cartesian/axes":770,"../registry":854,"./helpers":1151}],1150:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plot_api/plot_schema"),a=t("../plots/plots"),o=t("./helpers").pointsAccessorFunction;function s(t,e){var r,s,l,c,u,f,h,d,p,m,v=e.transform,g=t.transforms[e.transformIndex].groups,y=o(t.transforms,v);if(!Array.isArray(g)||0===g.length)return[t];var b=n.filterUnique(g),x=new Array(b.length),_=g.length,w=i.findArrayAttributes(t),M=v.styles||[],k={};for(r=0;r<M.length;r++)k[M[r].target]=M[r].value;v.styles&&(m=n.keyedContainer(v,"styles","target","value.name"));var A={},T={};for(r=0;r<b.length;r++){A[f=b[r]]=r,T[f]=0,(h=x[r]=n.extendDeepNoArrays({},t))._group=f,h.transforms[e.transformIndex]._indexToPoints={};var E=null;for(m&&(E=m.get(f)),h.name=E||n.templateString(v.nameformat,{trace:t.name,group:f}),d=h.transforms,h.transforms=[],s=0;s<d.length;s++)h.transforms[s]=n.extendDeepNoArrays({},d[s]);for(s=0;s<w.length;s++)n.nestedProperty(h,w[s]).set([])}for(l=0;l<w.length;l++){for(c=w[l],s=0,p=[];s<b.length;s++)p[s]=n.nestedProperty(x[s],c).get();for(u=n.nestedProperty(t,c).get(),s=0;s<_;s++)p[A[g[s]]].push(u[s])}for(s=0;s<_;s++){(h=x[A[g[s]]]).transforms[e.transformIndex]._indexToPoints[T[g[s]]]=y(s),T[g[s]]++}for(r=0;r<b.length;r++)f=b[r],h=x[r],a.clearExpandedTraceDefaultColors(h),h=n.extendDeepNoArrays(h,k[f]||{});return x}r.moduleType="transform",r.name="groupby",r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"data_array",dflt:[],editType:"calc"},nameformat:{valType:"string",editType:"calc"},styles:{_isLinkedToArray:"style",target:{valType:"string",editType:"calc"},value:{valType:"any",dflt:{},editType:"calc"},editType:"calc"},editType:"calc"},r.supplyDefaults=function(t,e,i){var a,o={};function s(e,i){return n.coerce(t,o,r.attributes,e,i)}if(!s("enabled"))return o;s("groups"),s("nameformat",i._dataLength>1?"%{group} (%{trace})":"%{group}");var l=t.styles,c=o.styles=[];if(l)for(a=0;a<l.length;a++)c[a]={},n.coerce(l[a],c[a],r.attributes.styles,"target"),n.coerce(l[a],c[a],r.attributes.styles,"value");return o},r.transform=function(t,e){var r,n,i,a=[];for(n=0;n<t.length;n++)for(r=s(t[n],e),i=0;i<r.length;i++)a.push(r[i]);return a}},{"../lib":724,"../plot_api/plot_schema":759,"../plots/plots":833,"./helpers":1151}],1151:[function(t,e,r){"use strict";r.pointsAccessorFunction=function(t,e){for(var r,n,i=0;i<t.length&&(r=t[i])!==e;i++)r._indexToPoints&&!1!==r.enabled&&(n=r._indexToPoints);return n?function(t){return n[t]}:function(t){return[t]}}},{}],1152:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plots/cartesian/axes"),a=t("./helpers").pointsAccessorFunction;r.moduleType="transform",r.name="sort",r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},target:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},order:{valType:"enumerated",values:["ascending","descending"],dflt:"ascending",editType:"calc"},editType:"calc"},r.supplyDefaults=function(t){var e={};function i(i,a){return n.coerce(t,e,r.attributes,i,a)}return i("enabled")&&(i("target"),i("order")),e},r.calcTransform=function(t,e,r){if(r.enabled){var o=n.getTargetArray(e,r);if(o){var s,l,c=r.target,u=o.length,f=e._arrayAttrs,h=function(t,e,r){for(var n=e.length,i=new Array(n),a=e.slice().sort(function(t,e){switch(t.order){case"ascending":return function(t,r){return e(t)-e(r)};case"descending":return function(t,r){return e(r)-e(t)}}}(t,r)),o=0;o<n;o++)for(var s=e[o],l=0;l<n;l++){var c=a[l];if(s===c){i[l]=o,a[l]=null;break}}return i}(r,o,i.getDataToCoordFunc(t,e,c,o)),d=a(e.transforms,r),p={};for(s=0;s<f.length;s++){var m=n.nestedProperty(e,f[s]),v=m.get(),g=new Array(u);for(l=0;l<u;l++)g[l]=v[h[l]];m.set(g)}for(l=0;l<u;l++)p[l]=d(h[l]);r._indexToPoints=p}}}},{"../lib":724,"../plots/cartesian/axes":770,"./helpers":1151}]},{},[20])(20)}); |