{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Pygsti report\n",
    "(Created on August 03, 2017)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "import pickle\n",
    "\n",
    "with open('results.pkl', 'rb') as infile:\n",
    "    results = pickle.load(infile)\n",
    "\n",
    "estimates = results.estimates\n",
    "default   = estimates['default']\n",
    "gatesets  = default.gatesets\n",
    "\n",
    "ds        = results.dataset\n",
    "gs        = gatesets['go0']\n",
    "gs_final  = gatesets['final iteration estimate']\n",
    "gs_target = gatesets['target']\n",
    "#Ls        = [results.gatestring_structs['final'].Ls]\n",
    "Ls        = results.gatestring_structs['final'].Ls\n",
    "\n",
    "cri = None\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script src='offline/jupyterlibload.js'></script>\n",
       "<script src=\"offline/pygsti_plotly_ex.js\"></script><script type='text/javascript'> window.plotman = new PlotManager(); </script><link rel=\"stylesheet\" href=\"offline/pygsti_dataviz.css\"><link rel=\"stylesheet\" href=\"offline/smoothness-jquery-ui.css\"><style>\n",
       ".tooltipbuttons .ui-button { padding: 0; border: 0; background: transparent; }\n",
       ".tooltipbuttons .ui-icon { background-image: url(\"offline/images/ui-icons_222222_256x240.png\"); margin-top: 0; }\n",
       "</style><script>var pth;if(typeof IPython !== 'undefined') {  var nb = IPython.notebook;  var relpath = nb.notebook_path.substr(0, nb.notebook_path.lastIndexOf('/') + 1 );  jqueryui_pth = '../files' + nb.base_url + relpath + 'offline/jquery-ui.min';  katex_pth = '../files' + nb.base_url + relpath + 'offline/katex.min';  auto_pth = '../files' + nb.base_url + relpath + 'offline/auto-render.min';  console.log('IPYTHON DETECTED - using path ' + jqueryui_pth);}else {  jqueryui_pth = 'offline/jquery-ui.min';  katex_pth = 'offline/katex.min';  auto_pth = 'offline/auto-render.min';  console.log('NO IPYTHON DETECTED - using path ' + jqueryui_pth);}requirejs.config({    paths: { 'jquery-UI': [jqueryui_pth], 'katex': [katex_pth], 'autorender': [auto_pth] },});require(['jquery', 'jquery-UI'],function($,ui) {  window.jQueryUI=ui; console.log('jquery & jquery-UI loaded'); });require(['katex', 'autorender'],function(katex,auto) {  window.katex=katex; console.log('Katex loaded'); });</script><link rel=\"stylesheet\" href=\"offline/katex.css\">\n",
       "<script>require(['jquery','katex','autorender'],function($,katex,renderMathInElement) {\n",
       "  var mathjaxTimer = setInterval( function() {\n",
       "    if(document.readyState === 'complete' || document.readyState === 'loaded') {\n",
       "        clearInterval(mathjaxTimer);\n",
       "        if(typeof MathJax === 'undefined') {\n",
       "          console.log('MATHJAX not found - attempting to typeset with Katex');\n",
       "          renderMathInElement(document.body, { delimiters: [\n",
       "             {left: '$$', right: '$$', display: true},\n",
       "             {left: '$', right: '$', display: false},\n",
       "             ] } );\n",
       "        }\n",
       "        else { //Mathjax is alive - wait for plotly\n",
       "            var waitForPlotly = setInterval( function() {\n",
       "              if( typeof(window.Plotly) !== 'undefined' ){\n",
       "                MathJax.Hub.Config({ SVG: { font: 'STIX-Web' }, displayAlign: 'center' });\n",
       "                MathJax.Hub.Queue(['setRenderer', MathJax.Hub, 'SVG']);\n",
       "                clearInterval(waitForPlotly);\n",
       "              }\n",
       "            }, 500 );\n",
       "        }\n",
       "    } //end readyState check \n",
       "  }, 500); //end setInterval \n",
       "});\n",
       "</script>\n",
       "<script type='text/javascript'>if(!window.Plotly){define('plotly', function(require, exports, module) {!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 u=new Error(\"Cannot find module '\"+o+\"'\");throw u.code=\"MODULE_NOT_FOUND\",u}var c=r[o]={exports:{}};e[o][0].call(c.exports,function(t){var r=e[o][1][t];return i(r||t)},c,c.exports,t,e,r,n)}return r[o].exports}for(var a=\"function\"==typeof require&&require,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(t,e,r){\"use strict\";var n=t(\"../src/lib\"),i={\"X,X div\":\"font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;\",\"X input,X button\":\"font-family:'Open Sans', verdana, arial, sans-serif;\",\"X input:focus,X button:focus\":\"outline:none;\",\"X a\":\"text-decoration:none;\",\"X a:hover\":\"text-decoration:none;\",\"X .crisp\":\"shape-rendering:crispEdges;\",\"X .user-select-none\":\"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;\",\"X svg\":\"overflow:hidden;\",\"X svg a\":\"fill:#447adb;\",\"X svg a:hover\":\"fill:#3c6dc5;\",\"X .main-svg\":\"position:absolute;top:0;left:0;pointer-events:none;\",\"X .main-svg .draglayer\":\"pointer-events:all;\",\"X .cursor-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;\",\"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\":685}],2:[function(t,e,r){\"use strict\";e.exports={undo:{width:857.1,path:\"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z\",ascent:850,descent:-150},home:{width:928.6,path:\"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z\",ascent:850,descent:-150},\"camera-retro\":{width:1e3,path:\"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z\",ascent:850,descent:-150},zoombox:{width:1e3,path:\"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z\",ascent:850,descent:-150},pan:{width:1e3,path:\"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z\",ascent:850,descent:-150},zoom_plus:{width:1e3,path:\"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z\",ascent:850,descent:-150},zoom_minus:{width:1e3,path:\"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z\",ascent:850,descent:-150},autoscale:{width:1e3,path:\"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z\",ascent:850,descent:-150},tooltip_basic:{width:1500,path:\"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z\",ascent:850,descent:-150},tooltip_compare:{width:1125,path:\"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z\",ascent:850,descent:-150},plotlylogo:{width:1542,path:\"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z\",ascent:850,descent:-150},\"z-axis\":{width:1e3,path:\"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z\",ascent:850,descent:-150},\"3d_rotate\":{width:1e3,path:\"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z\",ascent:850,descent:-150},camera:{width:1e3,path:\"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z\",ascent:850,descent:-150},movie:{width:1e3,path:\"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z\",ascent:850,descent:-150},question:{width:857.1,path:\"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z\",ascent:850,descent:-150},disk:{width:857.1,path:\"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z\",ascent:850,descent:-150},lasso:{width:1031,path:\"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z\",ascent:850,descent:-150},selectbox:{width:1e3,path:\"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z\",ascent:850,descent:-150},spikeline:{width:1e3,path:\"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z\",ascent:850,descent:-150}}},{}],3:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/bar\")},{\"../src/traces/bar\":816}],4:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/box\")},{\"../src/traces/box\":828}],5:[function(t,e,r){\"use strict\";e.exports=t(\"../src/components/calendars\")},{\"../src/components/calendars\":576}],6:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/candlestick\")},{\"../src/traces/candlestick\":836}],7:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/carpet\")},{\"../src/traces/carpet\":857}],8:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/choropleth\")},{\"../src/traces/choropleth\":872}],9:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/contour\")},{\"../src/traces/contour\":883}],10:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/contourcarpet\")},{\"../src/traces/contourcarpet\":898}],11:[function(t,e,r){\"use strict\";e.exports=t(\"../src/core\")},{\"../src/core\":669}],12:[function(t,e,r){\"use strict\";e.exports=t(\"../src/transforms/filter\")},{\"../src/transforms/filter\":1045}],13:[function(t,e,r){\"use strict\";e.exports=t(\"../src/transforms/groupby\")},{\"../src/transforms/groupby\":1046}],14:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/heatmap\")},{\"../src/traces/heatmap\":912}],15:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/heatmapgl\")},{\"../src/traces/heatmapgl\":921}],16:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/histogram\")},{\"../src/traces/histogram\":929}],17:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/histogram2d\")},{\"../src/traces/histogram2d\":934}],18:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/histogram2dcontour\")},{\"../src/traces/histogram2dcontour\":938}],19:[function(t,e,r){\"use strict\";var n=t(\"./core\");n.register([t(\"./bar\"),t(\"./box\"),t(\"./heatmap\"),t(\"./histogram\"),t(\"./histogram2d\"),t(\"./histogram2dcontour\"),t(\"./pie\"),t(\"./contour\"),t(\"./scatterternary\"),t(\"./scatter3d\"),t(\"./surface\"),t(\"./mesh3d\"),t(\"./scattergeo\"),t(\"./choropleth\"),t(\"./scattergl\"),t(\"./pointcloud\"),t(\"./heatmapgl\"),t(\"./parcoords\"),t(\"./scattermapbox\"),t(\"./carpet\"),t(\"./scattercarpet\"),t(\"./contourcarpet\"),t(\"./ohlc\"),t(\"./candlestick\")]),n.register([t(\"./filter\"),t(\"./groupby\")]),n.register([t(\"./calendars\")]),e.exports=n},{\"./bar\":3,\"./box\":4,\"./calendars\":5,\"./candlestick\":6,\"./carpet\":7,\"./choropleth\":8,\"./contour\":9,\"./contourcarpet\":10,\"./core\":11,\"./filter\":12,\"./groupby\":13,\"./heatmap\":14,\"./heatmapgl\":15,\"./histogram\":16,\"./histogram2d\":17,\"./histogram2dcontour\":18,\"./mesh3d\":20,\"./ohlc\":21,\"./parcoords\":22,\"./pie\":23,\"./pointcloud\":24,\"./scatter3d\":25,\"./scattercarpet\":26,\"./scattergeo\":27,\"./scattergl\":28,\"./scattermapbox\":29,\"./scatterternary\":30,\"./surface\":31}],20:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/mesh3d\")},{\"../src/traces/mesh3d\":942}],21:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/ohlc\")},{\"../src/traces/ohlc\":947}],22:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/parcoords\")},{\"../src/traces/parcoords\":956}],23:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/pie\")},{\"../src/traces/pie\":965}],24:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/pointcloud\")},{\"../src/traces/pointcloud\":974}],25:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scatter3d\")},{\"../src/traces/scatter3d\":1004}],26:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scattercarpet\")},{\"../src/traces/scattercarpet\":1009}],27:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scattergeo\")},{\"../src/traces/scattergeo\":1018}],28:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scattergl\")},{\"../src/traces/scattergl\":1023}],29:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scattermapbox\")},{\"../src/traces/scattermapbox\":1029}],30:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scatterternary\")},{\"../src/traces/scatterternary\":1035}],31:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/surface\")},{\"../src/traces/surface\":1044}],32:[function(t,e,r){\"use strict\";function n(t,e){function r(e,r,n,a){var o=1/t.clientHeight,s=o*(r-m),l=o*(n-g),c=p.flipX?1:-1,f=p.flipY?1:-1,d=Math.PI*p.rotateSpeed,y=i();if(1&e)a.shift?u.rotate(y,0,0,-s*d):u.rotate(y,c*d*s,-f*d*l,0);else if(2&e)u.pan(y,-p.translateSpeed*s*h,p.translateSpeed*l*h,0);else if(4&e){var b=p.zoomSpeed*l/window.innerHeight*(y-u.lastT())*50;u.pan(y,0,0,h*(Math.exp(b)-1))}m=r,g=n,v=a}t=t||document.body;var n=[.01,1/0];\"distanceLimits\"in(e=e||{})&&(n[0]=e.distanceLimits[0],n[1]=e.distanceLimits[1]),\"zoomMin\"in e&&(n[0]=e.zoomMin),\"zoomMax\"in e&&(n[1]=e.zoomMax);var u=a({center:e.center||[0,0,0],up:e.up||[0,1,0],eye:e.eye||[0,0,10],mode:e.mode||\"orbit\",distanceLimits:n}),c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h=0,f=t.clientWidth,d=t.clientHeight,p={view:u,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:u.modes,tick:function(){var e=i(),r=this.delay;u.idle(e-r),u.flush(e-(100+2*r));var n=e-2*r;u.recalcMatrix(n);for(var a=!0,o=u.computedMatrix,s=0;s<16;++s)a=a&&c[s]===o[s],c[s]=o[s];var l=t.clientWidth===f&&t.clientHeight===d;return f=t.clientWidth,d=t.clientHeight,a?!l:(h=Math.exp(u.computedRadius[0]),!0)},lookAt:function(t,e,r){u.lookAt(u.lastT(),t,e,r)},rotate:function(t,e,r){u.rotate(u.lastT(),t,e,r)},pan:function(t,e,r){u.pan(u.lastT(),t,e,r)},translate:function(t,e,r){u.translate(u.lastT(),t,e,r)}};Object.defineProperties(p,{matrix:{get:function(){return u.computedMatrix},set:function(t){return u.setMatrix(u.lastT(),t),u.computedMatrix},enumerable:!0},mode:{get:function(){return u.getMode()},set:function(t){return u.setMode(t),u.getMode()},enumerable:!0},center:{get:function(){return u.computedCenter},set:function(t){return u.lookAt(u.lastT(),t),u.computedCenter},enumerable:!0},eye:{get:function(){return u.computedEye},set:function(t){return u.lookAt(u.lastT(),null,t),u.computedEye},enumerable:!0},up:{get:function(){return u.computedUp},set:function(t){return u.lookAt(u.lastT(),null,null,t),u.computedUp},enumerable:!0},distance:{get:function(){return h},set:function(t){return u.setDistance(u.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return u.getDistanceLimits(n)},set:function(t){return u.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener(\"contextmenu\",function(t){return t.preventDefault(),!1});var m=0,g=0,v={shift:!1,control:!1,alt:!1,meta:!1};return o(t,r),t.addEventListener(\"touchstart\",function(e){var n=l(e.changedTouches[0],t);r(0,n[0],n[1],v),r(1,n[0],n[1],v)}),t.addEventListener(\"touchmove\",function(e){var n=l(e.changedTouches[0],t);r(1,n[0],n[1],v)}),t.addEventListener(\"touchend\",function(e){l(e.changedTouches[0],t);r(0,m,g,v)}),s(t,function(t,e,r){var n=p.flipX?1:-1,a=p.flipY?1:-1,o=i();if(Math.abs(t)>Math.abs(e))u.rotate(o,0,0,-t*n*Math.PI*p.rotateSpeed/window.innerWidth);else{var s=p.zoomSpeed*a*e/window.innerHeight*(o-u.lastT())/100;u.pan(o,0,0,h*(Math.exp(s)-1))}},!0),p}e.exports=n;var i=t(\"right-now\"),a=t(\"3d-view\"),o=t(\"mouse-change\"),s=t(\"mouse-wheel\"),l=t(\"mouse-event-offset\")},{\"3d-view\":33,\"mouse-change\":434,\"mouse-event-offset\":435,\"mouse-wheel\":437,\"right-now\":483}],33:[function(t,e,r){\"use strict\";function n(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map(function(e){return t[e]}),this._mode=e,this._active=t[e],this._active||(this._mode=\"turntable\",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}function i(t){var e=(t=t||{}).eye||[0,0,1],r=t.center||[0,0,0],i=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],u=t.mode||\"turntable\",c=a(),h=o(),f=s();return c.setDistanceLimits(l[0],l[1]),c.lookAt(0,e,r,i),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,i),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,i),new n({turntable:c,orbit:h,matrix:f},u)}e.exports=i;var a=t(\"turntable-camera-controller\"),o=t(\"orbit-camera-controller\"),s=t(\"matrix-camera-controller\"),l=n.prototype;[[\"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()+\")}\";l[e]=Function.apply(null,r.concat(i))}),l.recalcMatrix=function(t){this._active.recalcMatrix(t)},l.getDistance=function(t){return this._active.getDistance(t)},l.getDistanceLimits=function(t){return this._active.getDistanceLimits(t)},l.lastT=function(){return this._active.lastT()},l.setMode=function(t){if(t!==this._mode){var e=this._controllerNames.indexOf(t);if(!(e<0)){var r=this._active,n=this._controllerList[e],i=Math.max(r.lastT(),n.lastT());r.recalcMatrix(i),n.setMatrix(i,r.computedMatrix),this._active=n,this._mode=t,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}}},l.getMode=function(){return this._mode}},{\"matrix-camera-controller\":432,\"orbit-camera-controller\":454,\"turntable-camera-controller\":518}],34:[function(t,e,r){\"use strict\";function n(t){var e=s.get(t),r=e&&(e._triangleBuffer.handle||e._triangleBuffer.buffer);if(!r||!t.isBuffer(r)){var n=a(t,new Float32Array([-1,-1,-1,4,4,-1]));(e=o(t,[{buffer:n,type:t.FLOAT,size:2}]))._triangleBuffer=n,s.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}var i=\"undefined\"==typeof WeakMap?t(\"weak-map\"):WeakMap,a=t(\"gl-buffer\"),o=t(\"gl-vao\"),s=new i;e.exports=n},{\"gl-buffer\":141,\"gl-vao\":255,\"weak-map\":539}],35:[function(t,e,r){function n(t,e,r){e=\"number\"==typeof e?e:1,r=r||\": \";var n=t.split(/\\r?\\n/),a=String(n.length+e-1).length;return n.map(function(t,n){var o=n+e,s=String(o).length;return i(o,a-s)+r+t}).join(\"\\n\")}var i=t(\"pad-left\");e.exports=n},{\"pad-left\":455}],36:[function(t,e,r){\"use strict\";function n(t,e){for(var r=new Array(e+1),n=0;n<t.length;++n)r[n]=t[n];for(n=0;n<=t.length;++n){for(var i=t.length;i<=e;++i){for(var o=new Array(e),s=0;s<e;++s)o[s]=Math.pow(i+1-n,s);r[i]=o}if(a.apply(void 0,r))return!0}return!1}function i(t){var e=t.length;if(0===e)return[];if(1===e)return[0];for(var r=t[0].length,i=[t[0]],a=[0],o=1;o<e;++o)if(i.push(t[o]),n(i,r)){if(a.push(o),a.length===r+1)return a}else i.pop();return a}e.exports=i;var a=t(\"robust-orientation\")},{\"robust-orientation\":489}],37:[function(t,e,r){\"use strict\";function n(t,e){return i(e).filter(function(r){for(var n=new Array(r.length),i=0;i<r.length;++i)n[i]=e[r[i]];return a(n)*t<1})}e.exports=n;var i=t(\"delaunay-triangulate\"),a=t(\"circumradius\")},{circumradius:80,\"delaunay-triangulate\":108}],38:[function(t,e,r){function n(t,e){return a(i(t,e))}e.exports=n;var i=t(\"alpha-complex\"),a=t(\"simplicial-complex-boundary\")},{\"alpha-complex\":37,\"simplicial-complex-boundary\":497}],39:[function(t,e,r){\"use strict\";e.exports=function(){function t(t){return!Array.isArray(t)&&null!==t&&\"object\"==typeof t}function e(t,e,r){for(var n=(e-t)/Math.max(r-1,1),i=[],a=0;a<r;a++)i.push(t+a*n);return i}function r(){for(var t=[].slice.call(arguments),e=t.map(function(t){return t.length}),r=Math.min.apply(null,e),n=[],i=0;i<r;i++){n[i]=[];for(var a=0;a<t.length;++a)n[i][a]=t[a][i]}return n}function n(t,e,r){for(var n=Math.min.apply(null,[t.length,e.length,r.length]),i=[],a=0;a<n;a++)i.push([t[a],e[a],r[a]]);return i}function i(t){function e(t){for(var n=0;n<t.length;n++)Array.isArray(t[n])?e(t[n],r):r+=t[n]}var r=0;return e(t,r),r}function a(t){for(var e=[],r=0;r<t.length;++r){e[r]=[];for(var n=0;n<t[r].length;++n)e[r][n]=t[r][n]}return e}function o(t){for(var e=[],r=0;r<t.length;++r)e[r]=t[r];return e}function s(t,e){if(t.length!==e.length)return!1;for(var r=t.length;r--;)if(t[r]!==e[r])return!1;return!0}function l(t,e){var r,n;if(\"string\"!=typeof t)return t;if(r=[],\"#\"===t[0]?(3===(t=t.substr(1)).length&&(t+=t),n=parseInt(t,16),r[0]=n>>16&255,r[1]=n>>8&255,r[2]=255&n):h.test(t)&&(n=t.match(f),r[0]=parseInt(n[1]),r[1]=parseInt(n[2]),r[2]=parseInt(n[3])),!e)for(var i=0;i<3;++i)r[i]=r[i]/255;return r}function u(t,e){var r,n;if(\"string\"!=typeof t)return t;if(r=[],\"#\"===t[0]?(3===(t=t.substr(1)).length&&(t+=t),n=parseInt(t,16),r[0]=n>>16&255,r[1]=n>>8&255,r[2]=255&n):h.test(t)&&(n=t.match(f),r[0]=parseInt(n[1]),r[1]=parseInt(n[2]),r[2]=parseInt(n[3]),n[4]?r[3]=parseFloat(n[4]):r[3]=1),!e)for(var i=0;i<3;++i)r[i]=r[i]/255;return r}var c={},h=/^rgba?\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*(,.*)?\\)$/,f=/^rgba?\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,?\\s*(.*)?\\)$/;return c.isPlainObject=t,c.linspace=e,c.zip3=n,c.sum=i,c.zip=r,c.isEqual=s,c.copy2D=a,c.copy1D=o,c.str2RgbArray=l,c.str2RgbaArray=u,c}()},{}],40:[function(t,e,r){(function(r){\"use strict\";function n(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i<a;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}function i(t){return r.Buffer&&\"function\"==typeof r.Buffer.isBuffer?r.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}function a(t){return Object.prototype.toString.call(t)}function o(t){return!i(t)&&(\"function\"==typeof r.ArrayBuffer&&(\"function\"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}function s(t){if(x.isFunction(t)){if(M)return t.name;var e=t.toString().match(A);return e&&e[1]}}function l(t,e){return\"string\"==typeof t?t.length<e?t:t.slice(0,e):t}function u(t){if(M||!x.isFunction(t))return x.inspect(t);var e=s(t);return\"[Function\"+(e?\": \"+e:\"\")+\"]\"}function c(t){return l(u(t.actual),128)+\" \"+t.operator+\" \"+l(u(t.expected),128)}function h(t,e,r,n,i){throw new k.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:i})}function f(t,e){t||h(t,!0,e,\"==\",k.ok)}function d(t,e,r,s){if(t===e)return!0;if(i(t)&&i(e))return 0===n(t,e);if(x.isDate(t)&&x.isDate(e))return t.getTime()===e.getTime();if(x.isRegExp(t)&&x.isRegExp(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&\"object\"==typeof t||null!==e&&\"object\"==typeof e){if(o(t)&&o(e)&&a(t)===a(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===n(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(i(t)!==i(e))return!1;var l=(s=s||{actual:[],expected:[]}).actual.indexOf(t);return-1!==l&&l===s.expected.indexOf(e)||(s.actual.push(t),s.expected.push(e),m(t,e,r,s))}return r?t===e:t==e}function p(t){return\"[object Arguments]\"==Object.prototype.toString.call(t)}function m(t,e,r,n){if(null===t||void 0===t||null===e||void 0===e)return!1;if(x.isPrimitive(t)||x.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var i=p(t),a=p(e);if(i&&!a||!i&&a)return!1;if(i)return t=w.call(t),e=w.call(e),d(t,e,r);var o,s,l=T(t),u=T(e);if(l.length!==u.length)return!1;for(l.sort(),u.sort(),s=l.length-1;s>=0;s--)if(l[s]!==u[s])return!1;for(s=l.length-1;s>=0;s--)if(o=l[s],!d(t[o],e[o],r,n))return!1;return!0}function g(t,e,r){d(t,e,!0)&&h(t,e,r,\"notDeepStrictEqual\",g)}function v(t,e){if(!t||!e)return!1;if(\"[object RegExp]\"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function y(t){var e;try{t()}catch(t){e=t}return e}function b(t,e,r,n){var i;if(\"function\"!=typeof e)throw new TypeError('\"block\" argument must be a function');\"string\"==typeof r&&(n=r,r=null),i=y(e),n=(r&&r.name?\" (\"+r.name+\").\":\".\")+(n?\" \"+n:\".\"),t&&!i&&h(i,r,\"Missing expected exception\"+n);var a=\"string\"==typeof n,o=!t&&x.isError(i),s=!t&&i&&!r;if((o&&a&&v(i,r)||s)&&h(i,r,\"Got unwanted exception\"+n),t&&i&&r&&!v(i,r)||!t&&i)throw i}var x=t(\"util/\"),_=Object.prototype.hasOwnProperty,w=Array.prototype.slice,M=function(){return\"foo\"===function(){}.name}(),k=e.exports=f,A=/\\s*function\\s+([^\\(\\s]*)\\s*/;k.AssertionError=function(t){this.name=\"AssertionError\",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=c(this),this.generatedMessage=!0);var e=t.stackStartFunction||h;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=s(e),a=n.indexOf(\"\\n\"+i);if(a>=0){var o=n.indexOf(\"\\n\",a+1);n=n.substring(o+1)}this.stack=n}}},x.inherits(k.AssertionError,Error),k.fail=h,k.ok=f,k.equal=function(t,e,r){t!=e&&h(t,e,r,\"==\",k.equal)},k.notEqual=function(t,e,r){t==e&&h(t,e,r,\"!=\",k.notEqual)},k.deepEqual=function(t,e,r){d(t,e,!1)||h(t,e,r,\"deepEqual\",k.deepEqual)},k.deepStrictEqual=function(t,e,r){d(t,e,!0)||h(t,e,r,\"deepStrictEqual\",k.deepStrictEqual)},k.notDeepEqual=function(t,e,r){d(t,e,!1)&&h(t,e,r,\"notDeepEqual\",k.notDeepEqual)},k.notDeepStrictEqual=g,k.strictEqual=function(t,e,r){t!==e&&h(t,e,r,\"===\",k.strictEqual)},k.notStrictEqual=function(t,e,r){t===e&&h(t,e,r,\"!==\",k.notStrictEqual)},k.throws=function(t,e,r){b(!0,t,e,r)},k.doesNotThrow=function(t,e,r){b(!1,t,e,r)},k.ifError=function(t){if(t)throw t};var T=Object.keys||function(t){var e=[];for(var r in t)_.call(t,r)&&e.push(r);return e}}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{\"util/\":529}],41:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],42:[function(t,e,r){\"use strict\";function n(t){for(var e=0,r=0;r<t.length;++r)e+=t[r];return e}function i(t,e){for(var r=e.length,i=new Array(r+1),o=0;o<r;++o){for(var s=new Array(r+1),l=0;l<=r;++l)s[l]=t[l][o];i[o]=s}i[r]=new Array(r+1);for(o=0;o<=r;++o)i[r][o]=1;for(var u=new Array(r+1),o=0;o<r;++o)u[o]=e[o];u[r]=1;var c=a(i,u),h=n(c[r+1]);0===h&&(h=1);for(var f=new Array(r+1),o=0;o<=r;++o)f[o]=n(c[o])/h;return f}e.exports=i;var a=t(\"robust-linear-solve\")},{\"robust-linear-solve\":488}],43:[function(t,e,r){\"use strict\";function n(t,e){return i(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}var i=t(\"./lib/rationalize\");e.exports=n},{\"./lib/rationalize\":53}],44:[function(t,e,r){\"use strict\";function n(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}e.exports=n},{}],45:[function(t,e,r){\"use strict\";function n(t,e){return i(t[0].mul(e[1]),t[1].mul(e[0]))}var i=t(\"./lib/rationalize\");e.exports=n},{\"./lib/rationalize\":53}],46:[function(t,e,r){\"use strict\";function n(t,e){if(i(t))return e?u(t,n(e)):[t[0].clone(),t[1].clone()];var r,c,h=0;if(a(t))r=t.clone();else if(\"string\"==typeof t)r=s(t);else{if(0===t)return[o(0),o(1)];if(t===Math.floor(t))r=o(t);else{for(;t!==Math.floor(t);)t*=Math.pow(2,256),h-=256;r=o(t)}}if(i(e))r.mul(e[1]),c=e[0].clone();else if(a(e))c=e.clone();else if(\"string\"==typeof e)c=s(e);else if(e)if(e===Math.floor(e))c=o(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),h+=256;c=o(e)}else c=o(1);return h>0?r=r.ushln(h):h<0&&(c=c.ushln(-h)),l(r,c)}var i=t(\"./is-rat\"),a=t(\"./lib/is-bn\"),o=t(\"./lib/num-to-bn\"),s=t(\"./lib/str-to-bn\"),l=t(\"./lib/rationalize\"),u=t(\"./div\");e.exports=n},{\"./div\":45,\"./is-rat\":47,\"./lib/is-bn\":51,\"./lib/num-to-bn\":52,\"./lib/rationalize\":53,\"./lib/str-to-bn\":54}],47:[function(t,e,r){\"use strict\";function n(t){return Array.isArray(t)&&2===t.length&&i(t[0])&&i(t[1])}var i=t(\"./lib/is-bn\");e.exports=n},{\"./lib/is-bn\":51}],48:[function(t,e,r){\"use strict\";function n(t){return t.cmp(new i(0))}var i=t(\"bn.js\");e.exports=n},{\"bn.js\":61}],49:[function(t,e,r){\"use strict\";function n(t){var e=t.length,r=t.words,n=0;if(1===e)n=r[0];else if(2===e)n=r[0]+67108864*r[1];else for(var a=0;a<e;a++)n+=r[a]*Math.pow(67108864,a);return i(t)*n}var i=t(\"./bn-sign\");e.exports=n},{\"./bn-sign\":48}],50:[function(t,e,r){\"use strict\";function n(t){var e=a(i.lo(t));if(e<32)return e;var r=a(i.hi(t));return r>20?52:r+32}var i=t(\"double-bits\"),a=t(\"bit-twiddle\").countTrailingZeros;e.exports=n},{\"bit-twiddle\":60,\"double-bits\":109}],51:[function(t,e,r){\"use strict\";function n(t){return t&&\"object\"==typeof t&&Boolean(t.words)}t(\"bn.js\");e.exports=n},{\"bn.js\":61}],52:[function(t,e,r){\"use strict\";function n(t){var e=a.exponent(t);return e<52?new i(t):new i(t*Math.pow(2,52-e)).ushln(e-52)}var i=t(\"bn.js\"),a=t(\"double-bits\");e.exports=n},{\"bn.js\":61,\"double-bits\":109}],53:[function(t,e,r){\"use strict\";function n(t,e){var r=a(t),n=a(e);if(0===r)return[i(0),i(1)];if(0===n)return[i(0),i(0)];n<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);return o.cmpn(1)?[t.div(o),e.div(o)]:[t,e]}var i=t(\"./num-to-bn\"),a=t(\"./bn-sign\");e.exports=n},{\"./bn-sign\":48,\"./num-to-bn\":52}],54:[function(t,e,r){\"use strict\";function n(t){return new i(t)}var i=t(\"bn.js\");e.exports=n},{\"bn.js\":61}],55:[function(t,e,r){\"use strict\";function n(t,e){return i(t[0].mul(e[0]),t[1].mul(e[1]))}var i=t(\"./lib/rationalize\");e.exports=n},{\"./lib/rationalize\":53}],56:[function(t,e,r){\"use strict\";function n(t){return i(t[0])*i(t[1])}var i=t(\"./lib/bn-sign\");e.exports=n},{\"./lib/bn-sign\":48}],57:[function(t,e,r){\"use strict\";function n(t,e){return i(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}var i=t(\"./lib/rationalize\");e.exports=n},{\"./lib/rationalize\":53}],58:[function(t,e,r){\"use strict\";function n(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var n=e.abs().divmod(r.abs()),o=n.div,s=i(o),l=n.mod,u=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return u*s;if(s){var c=a(s)+4;return u*(s+(f=i(l.ushln(c).divRound(r)))*Math.pow(2,-c))}var h=r.bitLength()-l.bitLength()+53,f=i(l.ushln(h).divRound(r));return h<1023?u*f*Math.pow(2,-h):(f*=Math.pow(2,-1023),u*f*Math.pow(2,1023-h))}var i=t(\"./lib/bn-to-num\"),a=t(\"./lib/ctz\");e.exports=n},{\"./lib/bn-to-num\":49,\"./lib/ctz\":50}],59:[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)}},{}],60:[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,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,(e|=r)|t>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return t-=t>>>1&1431655765,16843009*((t=(858993459&t)+(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&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},r.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),(t=65535&(t|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),t|r<<2},r.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),(t=1023&(t|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],61:[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\"))}function o(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 s(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o<a;o++){var s=t.charCodeAt(o)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}function l(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}function u(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var u=1;u<n;u++){for(var c=l>>>26,h=67108863&l,f=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=f;d++){var p=u-d|0;c+=(o=(i=0|t.words[p])*(a=0|e.words[d])+h)/67108864|0,h=67108863&o}r.words[u]=0|h,l=0|c}return 0!==l?r.words[u]=0|l:r.length--,r.strip()}function c(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),u=Math.max(0,a-t.length+1);u<=l;u++){var c=a-u,h=(0|t.words[c])*(0|e.words[u]),f=67108863&h;s=67108863&(f=f+s|0),i+=(o=(o=o+(h/67108864|0)|0)+(f>>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}function h(t,e,r){return(new f).mulp(t,e,r)}function f(t,e){this.x=t,this.y=e}function d(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 p(){d.call(this,\"k256\",\"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\")}function m(){d.call(this,\"p224\",\"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\")}function g(){d.call(this,\"p192\",\"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\")}function v(){d.call(this,\"25519\",\"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\")}function y(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 b(t){y.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)}\"object\"==typeof e?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;var x;try{x=t(\"buffer\").Buffer}catch(t){}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=o(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=o(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,l=Math.min(a,a-o)+r,u=0,c=r;c<l;c+=n)u=s(t,c,c+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==o){var h=1;for(u=s(t,c,t.length,e),c=0;c<o;c++)h*=e;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},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 _=[\"\",\"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\"],w=[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],M=[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];a.prototype.toString=function(t,e){t=t||10,e=0|e||1;var r;if(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?_[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 u=w[t],c=M[t];r=\"\";var h=this.clone();for(h.negative=0;!h.isZero();){var f=h.modn(c).toString(t);r=(h=h.idivn(c)).isZero()?f+r:_[u-f.length]+f+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!==x),this.toArrayLike(x,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,\"byte array longer than desired length\"),n(a>0,\"Requested array length <= 0\"),this.strip();var o,s,l=\"le\"===e,u=new t(a),c=this.clone();if(l){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[s]=o;for(;s<a;s++)u[s]=0}else{for(s=0;s<a-i;s++)u[s]=0;for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[a-s-1]=o}return u},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;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();var r,n;this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a<n.length;a++)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=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=t):(n=t,i=this);for(var a=0,o=0;o<i.length;o++)a=(e=(0|n.words[o])-(0|i.words[o])+a)>>26,this.words[o]=67108863&e;for(;0!==a&&o<n.length;o++)a=(e=(0|n.words[o])+a)>>26,this.words[o]=67108863&e;if(0===a&&o<n.length&&n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this.length=Math.max(this.length,o),n!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(t){return this.clone().isub(t)};var k=function(t,e,r){var n,i,a,o=t.words,s=e.words,l=r.words,u=0,c=0|o[0],h=8191&c,f=c>>>13,d=0|o[1],p=8191&d,m=d>>>13,g=0|o[2],v=8191&g,y=g>>>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,S=A>>>13,E=0|o[6],L=8191&E,C=E>>>13,z=0|o[7],D=8191&z,I=z>>>13,P=0|o[8],O=8191&P,j=P>>>13,R=0|o[9],F=8191&R,N=R>>>13,B=0|s[0],U=8191&B,V=B>>>13,H=0|s[1],q=8191&H,G=H>>>13,Y=0|s[2],W=8191&Y,X=Y>>>13,Z=0|s[3],J=8191&Z,Q=Z>>>13,K=0|s[4],$=8191&K,tt=K>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ut=st>>>13,ct=0|s[8],ht=8191&ct,ft=ct>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(u+(n=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,V))+Math.imul(f,U)|0))<<13)|0;u=((a=Math.imul(f,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,V))+Math.imul(m,U)|0,a=Math.imul(m,V);var vt=(u+(n=n+Math.imul(h,q)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(f,q)|0))<<13)|0;u=((a=a+Math.imul(f,G)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,U),i=(i=Math.imul(v,V))+Math.imul(y,U)|0,a=Math.imul(y,V),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,q)|0,a=a+Math.imul(m,G)|0;var yt=(u+(n=n+Math.imul(h,W)|0)|0)+((8191&(i=(i=i+Math.imul(h,X)|0)+Math.imul(f,W)|0))<<13)|0;u=((a=a+Math.imul(f,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(v,q)|0,i=(i=i+Math.imul(v,G)|0)+Math.imul(y,q)|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=(u+(n=n+Math.imul(h,J)|0)|0)+((8191&(i=(i=i+Math.imul(h,Q)|0)+Math.imul(f,J)|0))<<13)|0;u=((a=a+Math.imul(f,Q)|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,q)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(_,q)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,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,Q)|0)+Math.imul(m,J)|0,a=a+Math.imul(m,Q)|0;var xt=(u+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,$)|0))<<13)|0;u=((a=a+Math.imul(f,tt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,V))+Math.imul(S,U)|0,a=Math.imul(S,V),n=n+Math.imul(M,q)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(k,q)|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(v,J)|0,i=(i=i+Math.imul(v,Q)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,Q)|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=(u+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(f,rt)|0))<<13)|0;u=((a=a+Math.imul(f,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,q)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(S,q)|0,a=a+Math.imul(S,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,Q)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,Q)|0,n=n+Math.imul(v,$)|0,i=(i=i+Math.imul(v,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=(u+(n=n+Math.imul(h,at)|0)|0)+((8191&(i=(i=i+Math.imul(h,ot)|0)+Math.imul(f,at)|0))<<13)|0;u=((a=a+Math.imul(f,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(D,U),i=(i=Math.imul(D,V))+Math.imul(I,U)|0,a=Math.imul(I,V),n=n+Math.imul(L,q)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(C,q)|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(S,W)|0,a=a+Math.imul(S,X)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,Q)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,Q)|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(v,rt)|0,i=(i=i+Math.imul(v,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=(u+(n=n+Math.imul(h,lt)|0)|0)+((8191&(i=(i=i+Math.imul(h,ut)|0)+Math.imul(f,lt)|0))<<13)|0;u=((a=a+Math.imul(f,ut)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,V))+Math.imul(j,U)|0,a=Math.imul(j,V),n=n+Math.imul(D,q)|0,i=(i=i+Math.imul(D,G)|0)+Math.imul(I,q)|0,a=a+Math.imul(I,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,Q)|0)+Math.imul(S,J)|0,a=a+Math.imul(S,Q)|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(v,at)|0,i=(i=i+Math.imul(v,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,ut)|0)+Math.imul(m,lt)|0,a=a+Math.imul(m,ut)|0;var kt=(u+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;u=((a=a+Math.imul(f,ft)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(F,U),i=(i=Math.imul(F,V))+Math.imul(N,U)|0,a=Math.imul(N,V),n=n+Math.imul(O,q)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(j,q)|0,a=a+Math.imul(j,G)|0,n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(I,W)|0,a=a+Math.imul(I,X)|0,n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,Q)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,Q)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,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(v,lt)|0,i=(i=i+Math.imul(v,ut)|0)+Math.imul(y,lt)|0,a=a+Math.imul(y,ut)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ht)|0,a=a+Math.imul(m,ft)|0;var At=(u+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,mt)|0)+Math.imul(f,pt)|0))<<13)|0;u=((a=a+Math.imul(f,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(F,q),i=(i=Math.imul(F,G))+Math.imul(N,q)|0,a=Math.imul(N,G),n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(j,W)|0,a=a+Math.imul(j,X)|0,n=n+Math.imul(D,J)|0,i=(i=i+Math.imul(D,Q)|0)+Math.imul(I,J)|0,a=a+Math.imul(I,Q)|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(S,rt)|0,a=a+Math.imul(S,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,ut)|0)+Math.imul(_,lt)|0,a=a+Math.imul(_,ut)|0,n=n+Math.imul(v,ht)|0,i=(i=i+Math.imul(v,ft)|0)+Math.imul(y,ht)|0,a=a+Math.imul(y,ft)|0;var Tt=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((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(N,W)|0,a=Math.imul(N,X),n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,Q)|0)+Math.imul(j,J)|0,a=a+Math.imul(j,Q)|0,n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(I,$)|0,a=a+Math.imul(I,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(S,at)|0,a=a+Math.imul(S,ot)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ut)|0)+Math.imul(k,lt)|0,a=a+Math.imul(k,ut)|0,n=n+Math.imul(x,ht)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(_,ht)|0,a=a+Math.imul(_,ft)|0;var St=(u+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((a=a+Math.imul(y,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(F,J),i=(i=Math.imul(F,Q))+Math.imul(N,J)|0,a=Math.imul(N,Q),n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(j,$)|0,a=a+Math.imul(j,tt)|0,n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(I,rt)|0,a=a+Math.imul(I,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,ut)|0)+Math.imul(S,lt)|0,a=a+Math.imul(S,ut)|0,n=n+Math.imul(M,ht)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(k,ht)|0,a=a+Math.imul(k,ft)|0;var Et=(u+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((a=a+Math.imul(_,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(F,$),i=(i=Math.imul(F,tt))+Math.imul(N,$)|0,a=Math.imul(N,tt),n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(j,rt)|0,a=a+Math.imul(j,nt)|0,n=n+Math.imul(D,at)|0,i=(i=i+Math.imul(D,ot)|0)+Math.imul(I,at)|0,a=a+Math.imul(I,ot)|0,n=n+Math.imul(L,lt)|0,i=(i=i+Math.imul(L,ut)|0)+Math.imul(C,lt)|0,a=a+Math.imul(C,ut)|0,n=n+Math.imul(T,ht)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(S,ht)|0,a=a+Math.imul(S,ft)|0;var Lt=(u+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(k,pt)|0))<<13)|0;u=((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(N,rt)|0,a=Math.imul(N,nt),n=n+Math.imul(O,at)|0,i=(i=i+Math.imul(O,ot)|0)+Math.imul(j,at)|0,a=a+Math.imul(j,ot)|0,n=n+Math.imul(D,lt)|0,i=(i=i+Math.imul(D,ut)|0)+Math.imul(I,lt)|0,a=a+Math.imul(I,ut)|0,n=n+Math.imul(L,ht)|0,i=(i=i+Math.imul(L,ft)|0)+Math.imul(C,ht)|0,a=a+Math.imul(C,ft)|0;var Ct=(u+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(S,pt)|0))<<13)|0;u=((a=a+Math.imul(S,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(F,at),i=(i=Math.imul(F,ot))+Math.imul(N,at)|0,a=Math.imul(N,ot),n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ut)|0)+Math.imul(j,lt)|0,a=a+Math.imul(j,ut)|0,n=n+Math.imul(D,ht)|0,i=(i=i+Math.imul(D,ft)|0)+Math.imul(I,ht)|0,a=a+Math.imul(I,ft)|0;var zt=(u+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(C,pt)|0))<<13)|0;u=((a=a+Math.imul(C,mt)|0)+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863,n=Math.imul(F,lt),i=(i=Math.imul(F,ut))+Math.imul(N,lt)|0,a=Math.imul(N,ut),n=n+Math.imul(O,ht)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(j,ht)|0,a=a+Math.imul(j,ft)|0;var Dt=(u+(n=n+Math.imul(D,pt)|0)|0)+((8191&(i=(i=i+Math.imul(D,mt)|0)+Math.imul(I,pt)|0))<<13)|0;u=((a=a+Math.imul(I,mt)|0)+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,n=Math.imul(F,ht),i=(i=Math.imul(F,ft))+Math.imul(N,ht)|0,a=Math.imul(N,ft);var It=(u+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((a=a+Math.imul(j,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863;var Pt=(u+(n=Math.imul(F,pt))|0)+((8191&(i=(i=Math.imul(F,mt))+Math.imul(N,pt)|0))<<13)|0;return u=((a=Math.imul(N,mt))+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,l[0]=gt,l[1]=vt,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]=St,l[12]=Et,l[13]=Lt,l[14]=Ct,l[15]=zt,l[16]=Dt,l[17]=It,l[18]=Pt,0!==u&&(l[19]=u,r.length++),r};Math.imul||(k=u),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?k(this,t,e):r<63?u(this,t,e):r<1024?c(this,t,e):h(this,t,e)},f.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},f.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},f.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]]},f.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),u=Math.sin(2*Math.PI/s),c=0;c<i;c+=s)for(var h=l,f=u,d=0;d<o;d++){var p=r[c+d],m=n[c+d],g=r[c+d+o],v=n[c+d+o],y=h*g-f*v;v=h*v+f*g,g=y,r[c+d]=p+g,n[c+d]=m+v,r[c+d+o]=p-g,n[c+d+o]=m-v,d!==s&&(y=l*h-u*f,f=l*f+u*h,h=y)}},f.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},f.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}},f.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},f.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))},f.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},f.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),u=new Array(n),c=new Array(n),h=new Array(n),f=r.words;f.length=n,this.convert13b(t.words,t.length,o,n),this.convert13b(e.words,e.length,u,n),this.transform(o,a,s,l,n,i),this.transform(u,a,c,h,n,i);for(var d=0;d<n;d++){var p=s[d]*c[d]-l[d]*h[d];l[d]=s[d]*h[d]+l[d]*c[d],s[d]=p}return this.conjugate(s,l,n),this.transform(s,l,f,a,n,i),this.conjugate(f,a,n),this.normalize13b(f,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),h(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=l(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){n(\"number\"==typeof t&&t>=0);var i;i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<<a,l=r;if(i-=o,i=Math.max(0,i),l){for(var u=0;u<o;u++)l.words[u]=this.words[u];l.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var c=0;for(u=this.length-1;u>=0&&(0!==c||u>=i);u--){var h=0|this.words[u];this.words[u]=c<<26-a|h>>>a,c=h&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},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=t.length+r;this._expand(a);var o,s=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+s;var l=(0|t.words[i])*e;s=((o-=67108863&l)>>26)-(l/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;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 u=0;u<s.length;u++)s.words[u]=0}var c=n.clone()._ishlnsubmul(i,1,l);0===c.negative&&(n=c,s&&(s.words[l]=1));for(var h=l-1;h>=0;h--){var f=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(f=Math.min(f/o|0,67108863),n._ishlnsubmul(i,f,h);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=f)}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){if(n(!t.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var i,o,s;return 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)},a.prototype.div=function(t){return this.divmod(t,\"div\",!1).div},a.prototype.mod=function(t){return this.divmod(t,\"mod\",!1).mod},a.prototype.umod=function(t){return this.divmod(t,\"mod\",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(h)),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(c),l.isub(h)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(l)):(r.isub(e),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(u)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,u=1;0==(e.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(e.iushrn(l);l-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var c=0,h=1;0==(r.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(r.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(o)):(r.isub(e),o.isub(i))}var f;return(f=0===e.cmpn(1)?i:o).cmpn(0)<0&&f.iadd(t),f},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=t<0;if(0!==this.negative&&!e)return-1;if(0===this.negative&&e)return 1;this.strip();var r;if(this.length>1)r=1;else{e&&(t=-t),n(t<=67108863,\"Number is too big\");var i=0|this.words[0];r=i===t?0:i<t?-1:1}return 0!==this.negative?0|-r:r},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 y(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 A={k256:null,p224:null,p192:null,p25519:null};d.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},d.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},d.prototype.split=function(t,e){t.iushrn(this.n,0,e)},d.prototype.imulK=function(t){return t.imul(this.k)},i(p,d),p.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},p.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(m,d),i(g,d),i(v,d),v.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(A[t])return A[t];var e;if(\"k256\"===t)e=new p;else if(\"p224\"===t)e=new m;else if(\"p192\"===t)e=new g;else{if(\"p25519\"!==t)throw new Error(\"Unknown prime \"+t);e=new v}return A[t]=e,e},y.prototype._verify1=function(t){n(0===t.negative,\"red works only with positives\"),n(t.red,\"red works only with red numbers\")},y.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\")},y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},y.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)},y.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},y.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)},y.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},y.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},y.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},y.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},y.prototype.isqr=function(t){return this.imul(t,t.clone())},y.prototype.sqr=function(t){return this.mul(t,t)},y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,u).cmp(l);)c.redIAdd(l);for(var h=this.pow(c,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=o;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g<p);var v=this.pow(h,new a(1).iushln(p-g-1));f=f.redMul(v),h=v.redSqr(),d=d.redMul(h),p=g}return f},y.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},y.prototype.pow=function(t,e){if(e.isZero())return new a(1);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 u=e.words[n],c=l-1;c>=0;c--){var h=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==o?(o<<=1,o|=h,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},y.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},y.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new b(t)},i(b,y),b.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},b.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},b.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)},b.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)},b.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{}],62:[function(t,e,r){\"use strict\";function n(t){var e,r,n,i=t.length,a=0;for(e=0;e<i;++e)a+=t[e].length;var o=new Array(a),s=0;for(e=0;e<i;++e){var l=t[e],u=l.length;for(r=0;r<u;++r){var c=o[s++]=new Array(u-1),h=0;for(n=0;n<u;++n)n!==r&&(c[h++]=l[n]);if(1&r){var f=c[1];c[1]=c[0],c[0]=f}}}return o}e.exports=n},{}],63:[function(t,e,r){\"use strict\";function n(t,e){for(var r=0;r<t;++r)if(!(e[r]<=e[r+t]))return!0;return!1}function i(t,e,r,i){for(var a=0,o=0,s=0,l=t.length;s<l;++s){var u=t[s];if(!n(e,u)){for(var c=0;c<2*e;++c)r[a++]=u[c];i[o++]=s}}return o}function a(t,e,r,n){var a=t.length,o=e.length;if(!(a<=0||o<=0)){var s=t[0].length>>>1;if(!(s<=0)){var l,u=h.mallocDouble(2*s*a),c=h.mallocInt32(a);if((a=i(t,s,u,c))>0){if(1===s&&n)f.init(a),l=f.sweepComplete(s,r,0,a,u,c,0,a,u,c);else{var p=h.mallocDouble(2*s*o),m=h.mallocInt32(o);(o=i(e,s,p,m))>0&&(f.init(a+o),l=1===s?f.sweepBipartite(s,r,0,a,u,c,0,o,p,m):d(s,r,n,a,u,c,o,p,m),h.free(p),h.free(m))}h.free(u),h.free(c)}return l}}}function o(t,e){c.push([t,e])}function s(t){return c=[],a(t,t,o,!0),c}function l(t,e){return c=[],a(t,e,o,!1),c}function u(t,e,r){switch(arguments.length){case 1:return s(t);case 2:return\"function\"==typeof e?a(t,t,e,!0):l(t,e);case 3:return a(t,e,r,!1);default:throw new Error(\"box-intersect: Invalid arguments\")}}e.exports=u;var c,h=t(\"typedarray-pool\"),f=t(\"./lib/sweep\"),d=t(\"./lib/intersect\")},{\"./lib/intersect\":65,\"./lib/sweep\":69,\"typedarray-pool\":521}],64:[function(t,e,r){\"use strict\";function n(t,e,r){var n=\"bruteForce\"+(t?\"Red\":\"Blue\")+(e?\"Flip\":\"\")+(r?\"Full\":\"\"),i=[\"function \",n,\"(\",w.join(),\"){\",\"var \",u,\"=2*\",a,\";\"],l=\"for(var i=\"+c+\",\"+p+\"=\"+u+\"*\"+c+\";i<\"+h+\";++i,\"+p+\"+=\"+u+\"){var x0=\"+f+\"[\"+o+\"+\"+p+\"],x1=\"+f+\"[\"+o+\"+\"+p+\"+\"+a+\"],xi=\"+d+\"[i];\",M=\"for(var j=\"+m+\",\"+b+\"=\"+u+\"*\"+m+\";j<\"+g+\";++j,\"+b+\"+=\"+u+\"){var y0=\"+v+\"[\"+o+\"+\"+b+\"],\"+(r?\"y1=\"+v+\"[\"+o+\"+\"+b+\"+\"+a+\"],\":\"\")+\"yi=\"+y+\"[j];\";return t?i.push(l,_,\":\",M):i.push(M,_,\":\",l),r?i.push(\"if(y1<x0||x1<y0)continue;\"):e?i.push(\"if(y0<=x0||x1<y0)continue;\"):i.push(\"if(y0<x0||x1<y0)continue;\"),i.push(\"for(var k=\"+o+\"+1;k<\"+a+\";++k){var r0=\"+f+\"[k+\"+p+\"],r1=\"+f+\"[k+\"+a+\"+\"+p+\"],b0=\"+v+\"[k+\"+b+\"],b1=\"+v+\"[k+\"+a+\"+\"+b+\"];if(r1<b0||b1<r0)continue \"+_+\";}var \"+x+\"=\"+s+\"(\"),e?i.push(\"yi,xi\"):i.push(\"xi,yi\"),i.push(\");if(\"+x+\"!==void 0)return \"+x+\";}}}\"),{name:n,code:i.join(\"\")}}function i(t){function e(e,r){var a=n(e,r,t);i.push(a.code),o.push(\"return \"+a.name+\"(\"+w.join()+\");\")}var r=\"bruteForce\"+(t?\"Full\":\"Partial\"),i=[],a=w.slice();t||a.splice(3,0,l);var o=[\"function \"+r+\"(\"+a.join()+\"){\"];o.push(\"if(\"+h+\"-\"+c+\">\"+g+\"-\"+m+\"){\"),t?(e(!0,!1),o.push(\"}else{\"),e(!1,!1)):(o.push(\"if(\"+l+\"){\"),e(!0,!0),o.push(\"}else{\"),e(!0,!1),o.push(\"}}else{if(\"+l+\"){\"),e(!1,!0),o.push(\"}else{\"),e(!1,!1),o.push(\"}\")),o.push(\"}}return \"+r);var s=i.join(\"\")+o.join(\"\");return new Function(s)()}var a=\"d\",o=\"ax\",s=\"vv\",l=\"fp\",u=\"es\",c=\"rs\",h=\"re\",f=\"rb\",d=\"ri\",p=\"rp\",m=\"bs\",g=\"be\",v=\"bb\",y=\"bi\",b=\"bp\",x=\"rv\",_=\"Q\",w=[a,o,s,c,h,f,d,m,g,v,y];r.partial=i(!1),r.full=i(!0)},{}],65:[function(t,e,r){\"use strict\";function n(t,e){var r=8*u.log2(e+1)*(t+1)|0,n=u.nextPow2(A*r);S.length<n&&(l.free(S),S=l.mallocInt32(n));var i=u.nextPow2(T*r);E<i&&(l.free(E),E=l.mallocDouble(i))}function i(t,e,r,n,i,a,o,s,l){var u=A*t;S[u]=e,S[u+1]=r,S[u+2]=n,S[u+3]=i,S[u+4]=a,S[u+5]=o;var c=T*t;E[c]=s,E[c+1]=l}function a(t,e,r,n,i,a,o,s,l,u,c){var h=2*t,f=l*h,d=u[f+e];t:for(var p=i,m=i*h;p<a;++p,m+=h){var g=o[m+e],v=o[m+e+t];if(!(d<g||v<d)&&(!n||d!==g)){for(var y=s[p],b=e+1;b<t;++b){var g=o[m+b],v=o[m+b+t],x=u[f+b],_=u[f+b+t];if(v<x||_<g)continue t}var w;if(void 0!==(w=n?r(c,y):r(y,c)))return w}}}function o(t,e,r,n,i,a,o,s,l,u){var c=2*t,h=s*c,f=l[h+e];t:for(var d=n,p=n*c;d<i;++d,p+=c){var m=o[d];if(m!==u){var g=a[p+e],v=a[p+e+t];if(!(f<g||v<f)){for(var y=e+1;y<t;++y){var g=a[p+y],v=a[p+y+t],b=l[h+y],x=l[h+y+t];if(v<b||x<g)continue t}var _=r(m,u);if(void 0!==_)return _}}}}function s(t,e,r,s,l,u,c,m,L){n(t,s+c);var C,z=0,D=2*t;for(i(z++,0,0,s,0,c,r?16:0,-1/0,1/0),r||i(z++,0,0,c,0,s,1,-1/0,1/0);z>0;){var I=(z-=1)*A,P=S[I],O=S[I+1],j=S[I+2],R=S[I+3],F=S[I+4],N=S[I+5],B=z*T,U=E[B],V=E[B+1],H=1&N,q=!!(16&N),G=l,Y=u,W=m,X=L;if(H&&(G=m,Y=L,W=l,X=u),!(2&N&&(j=_(t,P,O,j,G,Y,V),O>=j)||4&N&&(O=w(t,P,O,j,G,Y,U))>=j)){var Z=j-O,J=F-R;if(q){if(t*Z*(Z+J)<y){if(void 0!==(C=d.scanComplete(t,P,e,O,j,G,Y,R,F,W,X)))return C;continue}}else{if(t*Math.min(Z,J)<g){if(void 0!==(C=h(t,P,e,H,O,j,G,Y,R,F,W,X)))return C;continue}if(t*Z*J<v){if(void 0!==(C=d.scanBipartite(t,P,e,H,O,j,G,Y,R,F,W,X)))return C;continue}}var Q=b(t,P,O,j,G,Y,U,V);if(O<Q)if(t*(Q-O)<g){if(void 0!==(C=f(t,P+1,e,O,Q,G,Y,R,F,W,X)))return C}else if(P===t-2){if(void 0!==(C=H?d.sweepBipartite(t,e,R,F,W,X,O,Q,G,Y):d.sweepBipartite(t,e,O,Q,G,Y,R,F,W,X)))return C}else i(z++,P+1,O,Q,R,F,H,-1/0,1/0),i(z++,P+1,R,F,O,Q,1^H,-1/0,1/0);if(Q<j){var K=p(t,P,R,F,W,X),$=W[D*K+P],tt=x(t,P,K,F,W,X,$);if(tt<F&&i(z++,P,Q,j,tt,F,(4|H)+(q?16:0),$,V),R<K&&i(z++,P,Q,j,R,K,(2|H)+(q?16:0),U,$),K+1===tt){if(void 0!==(C=q?o(t,P,e,Q,j,G,Y,K,W,X[K]):a(t,P,e,H,Q,j,G,Y,K,W,X[K])))return C}else if(K<tt){var et;if(q){if(et=M(t,P,Q,j,G,Y,$),Q<et){var rt=x(t,P,Q,et,G,Y,$);if(P===t-2){if(Q<rt&&void 0!==(C=d.sweepComplete(t,e,Q,rt,G,Y,K,tt,W,X)))return C;if(rt<et&&void 0!==(C=d.sweepBipartite(t,e,rt,et,G,Y,K,tt,W,X)))return C}else Q<rt&&i(z++,P+1,Q,rt,K,tt,16,-1/0,1/0),rt<et&&(i(z++,P+1,rt,et,K,tt,0,-1/0,1/0),i(z++,P+1,K,tt,rt,et,1,-1/0,1/0))}}else Q<(et=H?k(t,P,Q,j,G,Y,$):M(t,P,Q,j,G,Y,$))&&(P===t-2?C=H?d.sweepBipartite(t,e,K,tt,W,X,Q,et,G,Y):d.sweepBipartite(t,e,Q,et,G,Y,K,tt,W,X):(i(z++,P+1,Q,et,K,tt,H,-1/0,1/0),i(z++,P+1,K,tt,Q,et,1^H,-1/0,1/0)))}}}}}e.exports=s;var l=t(\"typedarray-pool\"),u=t(\"bit-twiddle\"),c=t(\"./brute\"),h=c.partial,f=c.full,d=t(\"./sweep\"),p=t(\"./median\"),m=t(\"./partition\"),g=128,v=1<<22,y=1<<22,b=m(\"!(lo>=p0)&&!(p1>=hi)\",[\"p0\",\"p1\"]),x=m(\"lo===p0\",[\"p0\"]),_=m(\"lo<p0\",[\"p0\"]),w=m(\"hi<=p0\",[\"p0\"]),M=m(\"lo<=p0&&p0<=hi\",[\"p0\"]),k=m(\"lo<p0&&p0<=hi\",[\"p0\"]),A=6,T=2,S=l.mallocInt32(1024),E=l.mallocDouble(1024)},{\"./brute\":64,\"./median\":66,\"./partition\":67,\"./sweep\":69,\"bit-twiddle\":60,\"typedarray-pool\":521}],66:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a){for(var o=2*t,s=o*(r+1)+e,l=r+1;l<n;++l,s+=o)for(var u=i[s],c=l,h=o*(l-1);c>r&&i[h+e]>u;--c,h-=o){for(var f=h,d=h+o,p=0;p<o;++p,++f,++d){var m=i[f];i[f]=i[d],i[d]=m}var g=a[c];a[c]=a[c-1],a[c-1]=g}}function i(t,e,r,i,s,l){if(i<=r+1)return r;for(var u=r,c=i,h=i+r>>>1,f=2*t,d=h,p=s[f*h+e];u<c;){if(c-u<o){n(t,e,u,c,s,l),p=s[f*h+e];break}var m=c-u,g=Math.random()*m+u|0,v=s[f*g+e],y=Math.random()*m+u|0,b=s[f*y+e],x=Math.random()*m+u|0,_=s[f*x+e];v<=b?_>=b?(d=y,p=b):v>=_?(d=g,p=v):(d=x,p=_):b>=_?(d=y,p=b):_>=v?(d=g,p=v):(d=x,p=_);for(var w=f*(c-1),M=f*d,k=0;k<f;++k,++w,++M){A=s[w];s[w]=s[M],s[M]=A}T=l[c-1];l[c-1]=l[d],l[d]=T;for(var w=f*(c-1),M=f*(d=a(t,e,u,c-1,s,l,p)),k=0;k<f;++k,++w,++M){var A=s[w];s[w]=s[M],s[M]=A}var T=l[c-1];if(l[c-1]=l[d],l[d]=T,h<d){for(c=d-1;u<c&&s[f*(c-1)+e]===p;)c-=1;c+=1}else{if(!(d<h))break;for(u=d+1;u<c&&s[f*u+e]===p;)u+=1}}return a(t,e,r,h,s,l,s[f*h+e])}e.exports=i;var a=t(\"./partition\")(\"lo<p0\",[\"p0\"]),o=8},{\"./partition\":67}],67:[function(t,e,r){\"use strict\";function n(t,e){var r=\"abcdef\".split(\"\").concat(e),n=[];return t.indexOf(\"lo\")>=0&&n.push(\"lo=e[k+n]\"),t.indexOf(\"hi\")>=0&&n.push(\"hi=e[k+o]\"),r.push(i.replace(\"_\",n.join()).replace(\"$\",t)),Function.apply(void 0,r)}e.exports=n;var i=\"for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m\"},{}],68:[function(t,e,r){\"use strict\";function n(t,e){e<=4*f?i(0,e-1,t):h(0,e-1,t)}function i(t,e,r){for(var n=2*(t+1),i=t+1;i<=e;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-- >t;){var u=r[l-2],c=r[l-1];if(u<a)break;if(u===a&&c<o)break;r[l]=u,r[l+1]=c,l-=2}r[l]=a,r[l+1]=o}}function a(t,e,r){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 u(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 c(t,e,r,n){var i=n[t*=2];return i<e||i===e&&n[t+1]<r}function h(t,e,r){var n=(e-t+1)/6|0,d=t+n,p=e-n,m=t+e>>1,g=m-n,v=m+n,y=d,b=g,x=m,_=v,w=p,M=t+1,k=e-1,A=0;u(y,b,r)&&(A=y,y=b,b=A),u(_,w,r)&&(A=_,_=w,w=A),u(y,x,r)&&(A=y,y=x,x=A),u(b,x,r)&&(A=b,b=x,x=A),u(y,_,r)&&(A=y,y=_,_=A),u(x,_,r)&&(A=x,x=_,_=A),u(b,w,r)&&(A=b,b=w,w=A),u(b,x,r)&&(A=b,b=x,x=A),u(_,w,r)&&(A=_,_=w,w=A);for(var T=r[2*b],S=r[2*b+1],E=r[2*_],L=r[2*_+1],C=2*y,z=2*x,D=2*w,I=2*d,P=2*m,O=2*p,j=0;j<2;++j){var R=r[C+j],F=r[z+j],N=r[D+j];r[I+j]=R,r[P+j]=F,r[O+j]=N}o(g,t,r),o(v,e,r);for(var B=M;B<=k;++B)if(c(B,T,S,r))B!==M&&a(B,M,r),++M;else if(!c(B,E,L,r))for(;;){if(c(k,E,L,r)){c(k,T,S,r)?(s(B,M,k,r),++M,--k):(a(B,k,r),--k);break}if(--k<B)break}l(t,M-1,T,S,r),l(e,k+1,E,L,r),M-2-t<=f?i(t,M-2,r):h(t,M-2,r),e-(k+2)<=f?i(k+2,e,r):h(k+2,e,r),k-M<=f?i(M,k,r):h(M,k,r)}e.exports=n;var f=32},{}],69:[function(t,e,r){\"use strict\";function n(t){var e=h.nextPow2(t);p.length<e&&(c.free(p),p=c.mallocInt32(e)),m.length<e&&(c.free(m),m=c.mallocInt32(e)),g.length<e&&(c.free(g),g=c.mallocInt32(e)),v.length<e&&(c.free(v),v=c.mallocInt32(e)),y.length<e&&(c.free(y),y=c.mallocInt32(e)),b.length<e&&(c.free(b),b=c.mallocInt32(e));var r=8*e;x.length<r&&(c.free(x),x=c.mallocDouble(r))}function i(t,e,r,n){var i=e[n],a=t[r-1];t[i]=a,e[a]=i}function a(t,e,r,n){t[r]=n,e[n]=r}function o(t,e,r,n,o,s,l,u,c,h){for(var y=0,b=2*t,_=t-1,w=b-1,M=r;M<n;++M){var k=s[M],A=b*M;x[y++]=o[A+_],x[y++]=-(k+1),x[y++]=o[A+w],x[y++]=k}for(M=l;M<u;++M){var k=h[M]+d,T=b*M;x[y++]=c[T+_],x[y++]=-k,x[y++]=c[T+w],x[y++]=k}var S=y>>>1;f(x,S);for(var E=0,L=0,M=0;M<S;++M){var C=0|x[2*M+1];if(C>=d)i(g,v,L--,C=C-d|0);else if(C>=0)i(p,m,E--,C);else if(C<=-d){C=-C-d|0;for(z=0;z<E;++z)if(void 0!==(D=e(p[z],C)))return D;a(g,v,L++,C)}else{C=-C-1|0;for(var z=0;z<L;++z){var D=e(C,g[z]);if(void 0!==D)return D}a(p,m,E++,C)}}}function s(t,e,r,n,o,s,l,u,c,h){for(var d=0,_=2*t,w=t-1,M=_-1,k=r;k<n;++k){var A=s[k]+1<<1,T=_*k;x[d++]=o[T+w],x[d++]=-A,x[d++]=o[T+M],x[d++]=A}for(k=l;k<u;++k){var A=h[k]+1<<1,S=_*k;x[d++]=c[S+w],x[d++]=1|-A,x[d++]=c[S+M],x[d++]=1|A}var E=d>>>1;f(x,E);for(var L=0,C=0,z=0,k=0;k<E;++k){var D=0|x[2*k+1],I=1&D;if(k<E-1&&D>>1==x[2*k+3]>>1&&(I=2,k+=1),D<0){for(var P=-(D>>1)-1,O=0;O<z;++O)if(void 0!==(j=e(y[O],P)))return j;if(0!==I)for(O=0;O<L;++O)if(void 0!==(j=e(p[O],P)))return j;if(1!==I)for(O=0;O<C;++O){var j=e(g[O],P);if(void 0!==j)return j}0===I?a(p,m,L++,P):1===I?a(g,v,C++,P):2===I&&a(y,b,z++,P)}else{P=(D>>1)-1;0===I?i(p,m,L--,P):1===I?i(g,v,C--,P):2===I&&i(y,b,z--,P)}}}function l(t,e,r,n,o,s,l,u,c,h,g,v){var y=0,b=2*t,_=e,w=e+t,M=1,k=1;n?k=d:M=d;for(C=o;C<s;++C){var A=C+M,T=b*C;x[y++]=l[T+_],x[y++]=-A,x[y++]=l[T+w],x[y++]=A}for(C=c;C<h;++C){var A=C+k,S=b*C;x[y++]=g[S+_],x[y++]=-A}var E=y>>>1;f(x,E);for(var L=0,C=0;C<E;++C){var z=0|x[2*C+1];if(z<0){var D=!1;if((A=-z)>=d?(D=!n,A-=d):(D=!!n,A-=1),D)a(p,m,L++,A);else{var I=v[A],P=b*A,O=g[P+e+1],j=g[P+e+1+t];t:for(var R=0;R<L;++R){var F=p[R],N=b*F;if(!(j<l[N+e+1]||l[N+e+1+t]<O)){for(var B=e+2;B<t;++B)if(g[P+B+t]<l[N+B]||l[N+B+t]<g[P+B])continue t;var U,V=u[F];if(void 0!==(U=n?r(I,V):r(V,I)))return U}}}}else i(p,m,L--,z-M)}}function u(t,e,r,n,i,a,o,s,l,u,c){for(var h=0,m=2*t,g=e,v=e+t,y=n;y<i;++y){var b=y+d,_=m*y;x[h++]=a[_+g],x[h++]=-b,x[h++]=a[_+v],x[h++]=b}for(y=s;y<l;++y){var b=y+1,w=m*y;x[h++]=u[w+g],x[h++]=-b}var M=h>>>1;f(x,M);for(var k=0,y=0;y<M;++y){var A=0|x[2*y+1];if(A<0)if((b=-A)>=d)p[k++]=b-d;else{var T=c[b-=1],S=m*b,E=u[S+e+1],L=u[S+e+1+t];t:for(P=0;P<k;++P){var C=p[P],z=o[C];if(z===T)break;var D=m*C;if(!(L<a[D+e+1]||a[D+e+1+t]<E)){for(O=e+2;O<t;++O)if(u[S+O+t]<a[D+O]||a[D+O+t]<u[S+O])continue t;var I=r(z,T);if(void 0!==I)return I}}}else{for(var b=A-d,P=k-1;P>=0;--P)if(p[P]===b){for(var O=P+1;O<k;++O)p[O-1]=p[O];break}--k}}}e.exports={init:n,sweepBipartite:o,sweepComplete:s,scanBipartite:l,scanComplete:u};var c=t(\"typedarray-pool\"),h=t(\"bit-twiddle\"),f=t(\"./sort\"),d=1<<28,p=c.mallocInt32(1024),m=c.mallocInt32(1024),g=c.mallocInt32(1024),v=c.mallocInt32(1024),y=c.mallocInt32(1024),b=c.mallocInt32(1024),x=c.mallocDouble(8192)},{\"./sort\":68,\"bit-twiddle\":60,\"typedarray-pool\":521}],70:[function(t,e,r){\"use strict\";function n(t){if(t>Z)throw new RangeError(\"Invalid typed array length\");var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(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 l(t)}return a(t,e,r)}function a(t,e,r){if(\"number\"==typeof t)throw new TypeError('\"value\" argument must not be a number');return t instanceof ArrayBuffer?h(t,e,r):\"string\"==typeof t?u(t,e):f(t)}function o(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 s(t,e,r){return o(t),t<=0?n(t):void 0!==e?\"string\"==typeof r?n(t).fill(e,r):n(t).fill(e):n(t)}function l(t){return o(t),n(t<0?0:0|d(t))}function u(t,e){if(\"string\"==typeof e&&\"\"!==e||(e=\"utf8\"),!i.isEncoding(e))throw new TypeError('\"encoding\" must be a valid string encoding');var r=0|m(t,e),a=n(r),o=a.write(t,e);return o!==r&&(a=a.slice(0,o)),a}function c(t){for(var e=t.length<0?0:0|d(t.length),r=n(e),i=0;i<e;i+=1)r[i]=255&t[i];return r}function h(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;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),n.__proto__=i.prototype,n}function f(t){if(i.isBuffer(t)){var e=0|d(t.length),r=n(e);return 0===r.length?r:(t.copy(r,0,0,e),r)}if(t){if(G(t)||\"length\"in t)return\"number\"!=typeof t.length||Y(t.length)?n(0):c(t);if(\"Buffer\"===t.type&&Array.isArray(t.data))return c(t.data)}throw new TypeError(\"First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.\")}function d(t){if(t>=Z)throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+Z.toString(16)+\" bytes\");return 0|t}function p(t){return+t!=t&&(t=0),i.alloc(+t)}function m(t,e){if(i.isBuffer(t))return t.length;if(G(t)||t instanceof ArrayBuffer)return t.byteLength;\"string\"!=typeof t&&(t=\"\"+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case\"ascii\":case\"latin1\":case\"binary\":return r;case\"utf8\":case\"utf-8\":case void 0:return B(t).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*r;case\"hex\":return r>>>1;case\"base64\":return H(t).length;default:if(n)return B(t).length;e=(\"\"+e).toLowerCase(),n=!0}}function g(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return\"\";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return\"\";if(r>>>=0,e>>>=0,r<=e)return\"\";for(t||(t=\"utf8\");;)switch(t){case\"hex\":return z(this,e,r);case\"utf8\":case\"utf-8\":return S(this,e,r);case\"ascii\":return L(this,e,r);case\"latin1\":case\"binary\":return C(this,e,r);case\"base64\":return T(this,e,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return D(this,e,r);default:if(n)throw new TypeError(\"Unknown encoding: \"+t);t=(t+\"\").toLowerCase(),n=!0}}function v(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,a){if(0===t.length)return-1;if(\"string\"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Y(r)&&(r=a?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(a)return-1;r=t.length-1}else if(r<0){if(!a)return-1;r=0}if(\"string\"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,a);if(\"number\"==typeof e)return e&=255,\"function\"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,a);throw new TypeError(\"val must be string, number or Buffer\")}function b(t,e,r,n,i){function a(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var o=1,s=t.length,l=e.length;if(void 0!==n&&(\"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}var u;if(i){var c=-1;for(u=r;u<s;u++)if(a(t,u)===a(e,-1===c?0:u-c)){if(-1===c&&(c=u),u-c+1===l)return c*o}else-1!==c&&(u-=u-c),c=-1}else for(r+l>s&&(r=s-l),u=r;u>=0;u--){for(var h=!0,f=0;f<l;f++)if(a(t,u+f)!==a(e,f)){h=!1;break}if(h)return u}return-1}function x(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(Y(s))return o;t[r+o]=s}return o}function _(t,e,r,n){return q(B(e,t.length-r),t,r,n)}function w(t,e,r,n){return q(U(e),t,r,n)}function M(t,e,r,n){return w(t,e,r,n)}function k(t,e,r,n){return q(H(e),t,r,n)}function A(t,e,r,n){return q(V(e,t.length-r),t,r,n)}function T(t,e,r){return 0===e&&r===t.length?W.fromByteArray(t):W.fromByteArray(t.slice(e,r))}function S(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var a=t[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=r){var l,u,c,h;switch(s){case 1:a<128&&(o=a);break;case 2:128==(192&(l=t[i+1]))&&(h=(31&a)<<6|63&l)>127&&(o=h);break;case 3:l=t[i+1],u=t[i+2],128==(192&l)&&128==(192&u)&&(h=(15&a)<<12|(63&l)<<6|63&u)>2047&&(h<55296||h>57343)&&(o=h);break;case 4:l=t[i+1],u=t[i+2],c=t[i+3],128==(192&l)&&128==(192&u)&&128==(192&c)&&(h=(15&a)<<18|(63&l)<<12|(63&u)<<6|63&c)>65535&&h<1114112&&(o=h)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return E(n)}function E(t){var e=t.length;if(e<=J)return String.fromCharCode.apply(String,t);for(var r=\"\",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=J));return r}function L(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 C(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 z(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+=N(t[a]);return i}function D(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 I(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,a,o){if(!i.isBuffer(t))throw new TypeError('\"buffer\" argument must be a Buffer instance');if(e>a||e<o)throw new RangeError('\"value\" argument is out of bounds');if(r+n>t.length)throw new RangeError(\"Index out of range\")}function O(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 j(t,e,r,n,i){return e=+e,r>>>=0,i||O(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),X.write(t,e,r,n,23,4),r+4}function R(t,e,r,n,i){return e=+e,r>>>=0,i||O(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),X.write(t,e,r,n,52,8),r+8}function F(t){if((t=t.trim().replace(Q,\"\")).length<2)return\"\";for(;t.length%4!=0;)t+=\"=\";return t}function N(t){return t<16?\"0\"+t.toString(16):t.toString(16)}function B(t,e){e=e||1/0;for(var r,n=t.length,i=null,a=[],o=0;o<n;++o){if((r=t.charCodeAt(o))>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 U(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function V(t,e){for(var r,n,i,a=[],o=0;o<t.length&&!((e-=2)<0);++o)n=(r=t.charCodeAt(o))>>8,i=r%256,a.push(i),a.push(n);return a}function H(t){return W.toByteArray(F(t))}function q(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 G(t){return\"function\"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function Y(t){return t!==t}var W=t(\"base64-js\"),X=t(\"ieee754\");r.Buffer=i,r.SlowBuffer=p,r.INSPECT_MAX_BYTES=50;var Z=2147483647;r.kMaxLength=Z,i.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}}(),i.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&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(t,e,r){return a(t,e,r)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(t,e,r){return s(t,e,r)},i.allocUnsafe=function(t){return l(t)},i.allocUnsafeSlow=function(t){return l(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError(\"Arguments must be Buffers\");if(t===e)return 0;for(var r=t.length,n=e.length,a=0,o=Math.min(r,n);a<o;++a)if(t[a]!==e[a]){r=t[a],n=e[a];break}return r<n?-1:n<r?1:0},i.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}},i.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('\"list\" argument must be an Array of Buffers');if(0===t.length)return i.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=i.allocUnsafe(e),a=0;for(r=0;r<t.length;++r){var o=t[r];if(!i.isBuffer(o))throw new TypeError('\"list\" argument must be an Array of Buffers');o.copy(n,a),a+=o.length}return n},i.byteLength=m,i.prototype._isBuffer=!0,i.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)v(this,e,e+1);return this},i.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)v(this,e,e+3),v(this,e+1,e+2);return this},i.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)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this},i.prototype.toString=function(){var t=this.length;return 0===t?\"\":0===arguments.length?S(this,0,t):g.apply(this,arguments)},i.prototype.equals=function(t){if(!i.isBuffer(t))throw new TypeError(\"Argument must be a Buffer\");return this===t||0===i.compare(this,t)},i.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+\">\"},i.prototype.compare=function(t,e,r,n,a){if(!i.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===a&&(a=this.length),e<0||r>t.length||n<0||a>this.length)throw new RangeError(\"out of range index\");if(n>=a&&e>=r)return 0;if(n>=a)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,a>>>=0,this===t)return 0;for(var o=a-n,s=r-e,l=Math.min(o,s),u=this.slice(n,a),c=t.slice(e,r),h=0;h<l;++h)if(u[h]!==c[h]){o=u[h],s=c[h];break}return o<s?-1:s<o?1:0},i.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},i.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},i.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},i.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 x(this,t,e,r);case\"utf8\":case\"utf-8\":return _(this,t,e,r);case\"ascii\":return w(this,t,e,r);case\"latin1\":case\"binary\":return M(this,t,e,r);case\"base64\":return k(this,t,e,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return A(this,t,e,r);default:if(a)throw new TypeError(\"Unknown encoding: \"+n);n=(\"\"+n).toLowerCase(),a=!0}},i.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};var J=4096;i.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__=i.prototype,n},i.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||I(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.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},i.prototype.readUInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},i.prototype.readInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||I(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){t>>>=0,e||I(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||I(t,4,this.length),X.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||I(t,4,this.length),X.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||I(t,8,this.length),X.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||I(t,8,this.length),X.read(this,t,!1,52,8)},i.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},i.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},i.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},i.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},i.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},i.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},i.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},i.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},i.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},i.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},i.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},i.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},i.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},i.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},i.prototype.writeFloatLE=function(t,e,r){return j(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return j(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return R(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return R(this,t,e,!1,r)},i.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},i.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 a=t.charCodeAt(0);a<256&&(t=a)}if(void 0!==n&&\"string\"!=typeof n)throw new TypeError(\"encoding must be a string\");if(\"string\"==typeof n&&!i.isEncoding(n))throw new TypeError(\"Unknown encoding: \"+n)}else\"number\"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError(\"Out of range index\");if(r<=e)return this;e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if(\"number\"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var s=i.isBuffer(t)?t:new i(t,n),l=s.length;for(o=0;o<r-e;++o)this[o+e]=s[o%l]}return this};var Q=/[^+/0-9A-Za-z-_]/g},{\"base64-js\":71,ieee754:272}],71:[function(t,e,r){\"use strict\";function n(t){var e=t.length;if(e%4>0)throw new Error(\"Invalid string. Length must be a multiple of 4\");return\"=\"===t[e-2]?2:\"=\"===t[e-1]?1:0}function i(t){return 3*t.length/4-n(t)}function a(t){var e,r,i,a,o,s,l=t.length;o=n(t),s=new h(3*l/4-o),i=o>0?l-4:l;var u=0;for(e=0,r=0;e<i;e+=4,r+=3)a=c[t.charCodeAt(e)]<<18|c[t.charCodeAt(e+1)]<<12|c[t.charCodeAt(e+2)]<<6|c[t.charCodeAt(e+3)],s[u++]=a>>16&255,s[u++]=a>>8&255,s[u++]=255&a;return 2===o?(a=c[t.charCodeAt(e)]<<2|c[t.charCodeAt(e+1)]>>4,s[u++]=255&a):1===o&&(a=c[t.charCodeAt(e)]<<10|c[t.charCodeAt(e+1)]<<4|c[t.charCodeAt(e+2)]>>2,s[u++]=a>>8&255,s[u++]=255&a),s}function o(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function s(t,e,r){for(var n,i=[],a=e;a<r;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],i.push(o(n));return i.join(\"\")}function l(t){for(var e,r=t.length,n=r%3,i=\"\",a=[],o=0,l=r-n;o<l;o+=16383)a.push(s(t,o,o+16383>l?l:o+16383));return 1===n?(e=t[r-1],i+=u[e>>2],i+=u[e<<4&63],i+=\"==\"):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=u[e>>10],i+=u[e>>4&63],i+=u[e<<2&63],i+=\"=\"),a.push(i),a.join(\"\")}r.byteLength=i,r.toByteArray=a,r.fromByteArray=l;for(var u=[],c=[],h=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,f=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",d=0,p=f.length;d<p;++d)u[d]=f[d],c[f.charCodeAt(d)]=d;c[\"-\".charCodeAt(0)]=62,c[\"_\".charCodeAt(0)]=63},{}],72:[function(t,e,r){\"use strict\";function n(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function i(t,e){return t[0]-e[0]||t[1]-e[1]}function a(t){return t.map(n).sort(i)}function o(t,e,r){return e in t?t[e]:r}function s(t,e,r){Array.isArray(e)?(r=r||{},e=e||[]):(r=e||{},e=[]);var n=!!o(r,\"delaunay\",!0),i=!!o(r,\"interior\",!0),s=!!o(r,\"exterior\",!0),f=!!o(r,\"infinity\",!1);if(!i&&!s||0===t.length)return[];var d=l(t,e);if(n||i!==s||f){for(var p=u(t.length,a(e)),m=0;m<d.length;++m){var g=d[m];p.addTriangle(g[0],g[1],g[2])}return n&&c(t,p),s?i?f?h(p,0,f):p.cells():h(p,1,f):h(p,-1)}return d}var l=t(\"./lib/monotone\"),u=t(\"./lib/triangulation\"),c=t(\"./lib/delaunay\"),h=t(\"./lib/filter\");e.exports=s},{\"./lib/delaunay\":73,\"./lib/filter\":74,\"./lib/monotone\":75,\"./lib/triangulation\":76}],73:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,o){var s=e.opposite(n,i);if(!(s<0)){if(i<n){var l=n;n=i,i=l,l=o,o=s,s=l}e.isConstraint(n,i)||a(t[n],t[i],t[o],t[s])<0&&r.push(n,i)}}function i(t,e){for(var r=[],i=t.length,o=e.stars,s=0;s<i;++s)for(var l=o[s],u=1;u<l.length;u+=2)if(!((d=l[u])<s||e.isConstraint(s,d))){for(var c=l[u-1],h=-1,f=1;f<l.length;f+=2)if(l[f-1]===d){h=l[f];break}h<0||a(t[s],t[d],t[c],t[h])<0&&r.push(s,d)}for(;r.length>0;){for(var d=r.pop(),c=-1,h=-1,l=o[s=r.pop()],p=1;p<l.length;p+=2){var m=l[p-1],g=l[p];m===d?h=g:g===d&&(c=m)}c<0||h<0||(a(t[s],t[d],t[c],t[h])>=0||(e.flip(s,d),n(t,e,r,c,s,h),n(t,e,r,s,h,c),n(t,e,r,h,d,c),n(t,e,r,d,c,h)))}}var a=t(\"robust-in-sphere\")[4];t(\"binary-search-bounds\");e.exports=i},{\"binary-search-bounds\":77,\"robust-in-sphere\":487}],74:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function i(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}function a(t,e){for(var r=t.cells(),a=r.length,o=0;o<a;++o){var s=(v=r[o])[0],l=v[1],u=v[2];l<u?l<s&&(v[0]=l,v[1]=u,v[2]=s):u<s&&(v[0]=u,v[1]=s,v[2]=l)}r.sort(i);for(var c=new Array(a),o=0;o<c.length;++o)c[o]=0;var h=[],f=[],d=new Array(3*a),p=new Array(3*a),m=null;e&&(m=[]);for(var g=new n(r,d,p,c,h,f,m),o=0;o<a;++o)for(var v=r[o],y=0;y<3;++y){var s=v[y],l=v[(y+1)%3],b=d[3*o+y]=g.locate(l,s,t.opposite(l,s)),x=p[3*o+y]=t.isConstraint(s,l);b<0&&(x?f.push(o):(h.push(o),c[o]=1),e&&m.push([l,s,-1]))}return g}function o(t,e,r){for(var n=0,i=0;i<t.length;++i)e[i]===r&&(t[n++]=t[i]);return t.length=n,t}function s(t,e,r){var n=a(t,r);if(0===e)return r?n.cells.concat(n.boundary):n.cells;for(var i=1,s=n.active,l=n.next,u=n.flags,c=n.cells,h=n.constraint,f=n.neighbor;s.length>0||l.length>0;){for(;s.length>0;){var d=s.pop();if(u[d]!==-i){u[d]=i;c[d];for(var p=0;p<3;++p){var m=f[3*d+p];m>=0&&0===u[m]&&(h[3*d+p]?l.push(m):(s.push(m),u[m]=i))}}}var g=l;l=s,s=g,l.length=0,i=-i}var v=o(c,u,e);return r?v.concat(n.boundary):v}var l=t(\"binary-search-bounds\");e.exports=s,n.prototype.locate=function(){var t=[0,0,0];return function(e,r,n){var a=e,o=r,s=n;return r<n?r<e&&(a=r,o=n,s=e):n<e&&(a=n,o=e,s=r),a<0?-1:(t[0]=a,t[1]=o,t[2]=s,l.eq(this.cells,t,i))}}()},{\"binary-search-bounds\":77}],75:[function(t,e,r){\"use strict\";function n(t,e,r,n,i){this.a=t,this.b=e,this.idx=r,this.lowerIds=n,this.upperIds=i}function i(t,e,r,n){this.a=t,this.b=e,this.type=r,this.idx=n}function a(t,e){var r=t.a[0]-e.a[0]||t.a[1]-e.a[1]||t.type-e.type;return r||(t.type!==p&&(r=d(t.a,t.b,e.b))?r:t.idx-e.idx)}function o(t,e){return d(t.a,t.b,e)}function s(t,e,r,n,i){for(var a=f.lt(e,n,o),s=f.gt(e,n,o),l=a;l<s;++l){for(var u=e[l],c=u.lowerIds,h=c.length;h>1&&d(r[c[h-2]],r[c[h-1]],n)>0;)t.push([c[h-1],c[h-2],i]),h-=1;c.length=h,c.push(i);for(var p=u.upperIds,h=p.length;h>1&&d(r[p[h-2]],r[p[h-1]],n)<0;)t.push([p[h-2],p[h-1],i]),h-=1;p.length=h,p.push(i)}}function l(t,e){var r;return(r=t.a[0]<e.a[0]?d(t.a,t.b,e.a):d(e.b,e.a,t.a))?r:(r=e.b[0]<t.b[0]?d(t.a,t.b,e.b):d(e.b,e.a,t.b))||t.idx-e.idx}function u(t,e,r){var i=f.le(t,r,l),a=t[i],o=a.upperIds,s=o[o.length-1];a.upperIds=[s],t.splice(i+1,0,new n(r.a,r.b,r.idx,[s],o))}function c(t,e,r){var n=r.a;r.a=r.b,r.b=n;var i=f.eq(t,r,l),a=t[i];t[i-1].upperIds=a.upperIds,t.splice(i,1)}function h(t,e){for(var r=t.length,o=e.length,l=[],h=0;h<r;++h)l.push(new i(t[h],null,p,h));for(h=0;h<o;++h){var f=e[h],d=t[f[0]],v=t[f[1]];d[0]<v[0]?l.push(new i(d,v,g,h),new i(v,d,m,h)):d[0]>v[0]&&l.push(new i(v,d,g,h),new i(d,v,m,h))}l.sort(a);for(var y=l[0].a[0]-(1+Math.abs(l[0].a[0]))*Math.pow(2,-52),b=[new n([y,1],[y,0],-1,[],[],[],[])],x=[],h=0,_=l.length;h<_;++h){var w=l[h],M=w.type;M===p?s(x,b,t,w.a,w.idx):M===g?u(b,t,w):c(b,t,w)}return x}var f=t(\"binary-search-bounds\"),d=t(\"robust-orientation\")[3],p=0,m=1,g=2;e.exports=h},{\"binary-search-bounds\":77,\"robust-orientation\":489}],76:[function(t,e,r){\"use strict\";function n(t,e){this.stars=t,this.edges=e}function i(t,e,r){for(var n=1,i=t.length;n<i;n+=2)if(t[n-1]===e&&t[n]===r)return t[n-1]=t[i-2],t[n]=t[i-1],void(t.length=i-2)}function a(t,e){for(var r=new Array(t),i=0;i<t;++i)r[i]=[];return new n(r,e)}var o=t(\"binary-search-bounds\");e.exports=a;var s=n.prototype;s.isConstraint=function(){function t(t,e){return t[0]-e[0]||t[1]-e[1]}var e=[0,0];return function(r,n){return e[0]=Math.min(r,n),e[1]=Math.max(r,n),o.eq(this.edges,e,t)>=0}}(),s.removeTriangle=function(t,e,r){var n=this.stars;i(n[t],e,r),i(n[e],r,t),i(n[r],t,e)},s.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},s.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;n<i;n+=2)if(r[n]===t)return r[n-1];return-1},s.flip=function(t,e){var r=this.opposite(t,e),n=this.opposite(e,t);this.removeTriangle(t,e,r),this.removeTriangle(e,t,n),this.addTriangle(t,n,r),this.addTriangle(e,r,n)},s.edges=function(){for(var t=this.stars,e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,o=i.length;a<o;a+=2)e.push([i[a],i[a+1]]);return e},s.cells=function(){for(var t=this.stars,e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,o=i.length;a<o;a+=2){var s=i[a],l=i[a+1];r<Math.min(s,l)&&e.push([r,s,l])}return e}},{\"binary-search-bounds\":77}],77:[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)}},{}],78:[function(t,e,r){\"use strict\";function n(t){for(var e=1,r=1;r<t.length;++r)for(var n=0;n<r;++n)if(t[r]<t[n])e=-e;else if(t[n]===t[r])return 0;return e}e.exports=n},{}],79:[function(t,e,r){\"use strict\";function n(t,e){for(var r=0,n=t.length,i=0;i<n;++i)r+=t[i]*e[i];return r}function i(t){var e=t.length;if(0===e)return[];t[0].length;var r=o([t.length+1,t.length+1],1),i=o([t.length+1],1);r[e][e]=0;for(c=0;c<e;++c){for(d=0;d<=c;++d)r[d][c]=r[c][d]=2*n(t[c],t[d]);i[c]=n(t[c],t[c])}for(var a=s(r,i),l=0,u=a[e+1],c=0;c<u.length;++c)l+=u[c];for(var h=new Array(e),c=0;c<e;++c){for(var u=a[c],f=0,d=0;d<u.length;++d)f+=u[d];h[c]=f/l}return h}function a(t){if(0===t.length)return[];for(var e=t[0].length,r=o([e]),n=i(t),a=0;a<t.length;++a)for(var s=0;s<e;++s)r[s]+=t[a][s]*n[a];return r}var o=t(\"dup\"),s=t(\"robust-linear-solve\");a.barycenetric=i,e.exports=a},{dup:110,\"robust-linear-solve\":488}],80:[function(t,e,r){function n(t){for(var e=i(t),r=0,n=0;n<t.length;++n)for(var a=t[n],o=0;o<e.length;++o)r+=Math.pow(a[o]-e[o],2);return Math.sqrt(r/t.length)}e.exports=n;var i=t(\"circumcenter\")},{circumcenter:79}],81:[function(t,e,r){function n(t,e,r){return e<r?t<e?e:t>r?r:t:t<r?r:t>e?e:t}e.exports=n},{}],82:[function(t,e,r){\"use strict\";function n(t){var e=_(t);return[M(e,-1/0),M(e,1/0)]}function i(t,e){for(var r=new Array(e.length),n=0;n<e.length;++n){var i=e[n],a=t[i[0]],o=t[i[1]];r[n]=[M(Math.min(a[0],o[0]),-1/0),M(Math.min(a[1],o[1]),-1/0),M(Math.max(a[0],o[0]),1/0),M(Math.max(a[1],o[1]),1/0)]}return r}function a(t){for(var e=new Array(t.length),r=0;r<t.length;++r){var n=t[r];e[r]=[M(n[0],-1/0),M(n[1],-1/0),M(n[0],1/0),M(n[1],1/0)]}return e}function o(t,e,r){var n=[];return v(r,function(r,i){var a=e[r],o=e[i];if(a[0]!==o[0]&&a[0]!==o[1]&&a[1]!==o[0]&&a[1]!==o[1]){var s=t[a[0]],l=t[a[1]],u=t[o[0]],c=t[o[1]];y(s,l,u,c)&&n.push([r,i])}}),n}function s(t,e,r,n){var i=[];return v(r,n,function(r,n){var a=e[r];if(a[0]!==n&&a[1]!==n){var o=t[n],s=t[a[0]],l=t[a[1]];y(s,l,o,o)&&i.push([r,n])}}),i}function l(t,e,r,n,i){var a,o,s=t.map(function(t){return[b(t[0]),b(t[1])]});for(a=0;a<r.length;++a){var l=r[a];o=l[0];var u=l[1],c=e[o],h=e[u],f=k(w(t[c[0]]),w(t[c[1]]),w(t[h[0]]),w(t[h[1]]));if(f){var d=t.length;t.push([_(f[0]),_(f[1])]),s.push(f),n.push([o,d],[u,d])}}for(n.sort(function(t,e){if(t[0]!==e[0])return t[0]-e[0];var r=s[t[1]],n=s[e[1]];return x(r[0],n[0])||x(r[1],n[1])}),a=n.length-1;a>=0;--a){var p=n[a],m=e[o=p[0]],g=m[0],v=m[1],y=t[g],M=t[v];if((y[0]-M[0]||y[1]-M[1])<0){var A=g;g=v,v=A}m[0]=g;var T,S=m[1]=p[1];for(i&&(T=m[2]);a>0&&n[a-1][0]===o;){var E=(p=n[--a])[1];i?e.push([S,E,T]):e.push([S,E]),S=E}i?e.push([S,v,T]):e.push([S,v])}return s}function u(t,e,r){for(var i=e.length,a=new g(i),o=[],s=0;s<e.length;++s){var l=e[s],u=n(l[0]),c=n(l[1]);o.push([M(u[0],-1/0),M(c[0],-1/0),M(u[1],1/0),M(c[1],1/0)])}v(o,function(t,e){a.link(t,e)});for(var h=!0,f=new Array(i),s=0;s<i;++s)(p=a.find(s))!==s&&(h=!1,t[p]=[Math.min(t[s][0],t[p][0]),Math.min(t[s][1],t[p][1])]);if(h)return null;for(var d=0,s=0;s<i;++s){var p=a.find(s);p===s?(f[s]=d,t[d++]=t[s]):f[s]=-1}t.length=d;for(s=0;s<i;++s)f[s]<0&&(f[s]=f[a.find(s)]);return f}function c(t,e){return t[0]-e[0]||t[1]-e[1]}function h(t,e){var r=t[0]-e[0]||t[1]-e[1];return r||(t[2]<e[2]?-1:t[2]>e[2]?1:0)}function f(t,e,r){if(0!==t.length){if(e)for(s=0;s<t.length;++s){var n=e[(a=t[s])[0]],i=e[a[1]];a[0]=Math.min(n,i),a[1]=Math.max(n,i)}else for(s=0;s<t.length;++s){var a=t[s],n=a[0],i=a[1];a[0]=Math.min(n,i),a[1]=Math.max(n,i)}r?t.sort(h):t.sort(c);for(var o=1,s=1;s<t.length;++s){var l=t[s-1],u=t[s];(u[0]!==l[0]||u[1]!==l[1]||r&&u[2]!==l[2])&&(t[o++]=u)}t.length=o}}function d(t,e,r){var n=u(t,[],a(t));return f(e,n,r),!!n}function p(t,e,r){var n=i(t,e),c=o(t,e,n),h=a(t),d=s(t,e,n,h),p=u(t,l(t,e,c,d,r),h);return f(e,p,r),!!p||(c.length>0||d.length>0)}function m(t,e,r){var n;if(r){n=e;for(var i=new Array(e.length),a=0;a<e.length;++a){s=e[a];i[a]=[s[0],s[1],r[a]]}e=i}for(var o=d(t,e,!!r);p(t,e,!!r);)o=!0;if(r&&o){n.length=0,r.length=0;for(a=0;a<e.length;++a){var s=e[a];n.push([s[0],s[1]]),r.push(s[2])}}return o}e.exports=m;var g=t(\"union-find\"),v=t(\"box-intersect\"),y=t(\"robust-segment-intersect\"),b=t(\"big-rat\"),x=t(\"big-rat/cmp\"),_=t(\"big-rat/to-float\"),w=t(\"rat-vec\"),M=t(\"nextafter\"),k=t(\"./lib/rat-seg-intersect\")},{\"./lib/rat-seg-intersect\":83,\"big-rat\":46,\"big-rat/cmp\":44,\"big-rat/to-float\":58,\"box-intersect\":63,nextafter:450,\"rat-vec\":476,\"robust-segment-intersect\":492,\"union-find\":522}],83:[function(t,e,r){\"use strict\";function n(t,e){return s(a(t[0],e[1]),a(t[1],e[0]))}function i(t,e,r,i){var a=u(e,t),s=u(i,r),f=n(a,s);if(0===l(f))return null;var d=n(s,u(t,r)),p=o(d,f),m=h(a,p);return c(t,m)}e.exports=i;var a=t(\"big-rat/mul\"),o=t(\"big-rat/div\"),s=t(\"big-rat/sub\"),l=t(\"big-rat/sign\"),u=t(\"rat-vec/sub\"),c=t(\"rat-vec/add\"),h=t(\"rat-vec/muls\")},{\"big-rat/div\":45,\"big-rat/mul\":55,\"big-rat/sign\":56,\"big-rat/sub\":57,\"rat-vec/add\":475,\"rat-vec/muls\":477,\"rat-vec/sub\":478}],84:[function(t,e,r){(function(t){var r=function(){\"use strict\";function e(r,n,i,a){function s(r,i){if(null===r)return null;if(0==i)return r;var h,f;if(\"object\"!=typeof r)return r;if(e.__isArray(r))h=[];else if(e.__isRegExp(r))h=new RegExp(r.source,o(r)),r.lastIndex&&(h.lastIndex=r.lastIndex);else if(e.__isDate(r))h=new Date(r.getTime());else{if(c&&t.isBuffer(r))return h=new t(r.length),r.copy(h),h;void 0===a?(f=Object.getPrototypeOf(r),h=Object.create(f)):(h=Object.create(a),f=a)}if(n){var d=l.indexOf(r);if(-1!=d)return u[d];l.push(r),u.push(h)}for(var p in r){var m;f&&(m=Object.getOwnPropertyDescriptor(f,p)),m&&null==m.set||(h[p]=s(r[p],i-1))}return h}\"object\"==typeof n&&(i=n.depth,a=n.prototype,n.filter,n=n.circular);var l=[],u=[],c=void 0!==t;return void 0===n&&(n=!0),void 0===i&&(i=1/0),s(r,i)}function r(t){return Object.prototype.toString.call(t)}function n(t){return\"object\"==typeof t&&\"[object Date]\"===r(t)}function i(t){return\"object\"==typeof t&&\"[object Array]\"===r(t)}function a(t){return\"object\"==typeof t&&\"[object RegExp]\"===r(t)}function o(t){var e=\"\";return t.global&&(e+=\"g\"),t.ignoreCase&&(e+=\"i\"),t.multiline&&(e+=\"m\"),e}return e.clonePrototype=function(t){if(null===t)return null;var e=function(){};return e.prototype=t,new e},e.__objToStr=r,e.__isDate=n,e.__isArray=i,e.__isRegExp=a,e.__getRegExpFlags=o,e}();\"object\"==typeof e&&e.exports&&(e.exports=r)}).call(this,t(\"buffer\").Buffer)},{buffer:70}],85:[function(t,e,r){\"use strict\";function n(t,e){null==e&&(e=!0);var r=t[0],n=t[1],a=t[2],o=t[3];return null==o&&(o=e?1:255),e&&(r*=255,n*=255,a*=255,o*=255),16777216*(r=255&i(r,0,255))+((n=255&i(n,0,255))<<16)+((a=255&i(a,0,255))<<8)+(o=255&i(o,0,255))}var i=t(\"clamp\");e.exports=n},{clamp:81}],86:[function(t,e,r){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]}},{}],87:[function(t,e,r){\"use strict\";function n(t){var e,r,n=[],s=1;if(\"string\"==typeof t)if(i[t])n=i[t].slice(),r=\"rgb\";else if(\"transparent\"===t)s=0,r=\"rgb\",n=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var l=t.slice(1);s=1,(c=l.length)<=4?(n=[parseInt(l[0]+l[0],16),parseInt(l[1]+l[1],16),parseInt(l[2]+l[2],16)],4===c&&(s=parseInt(l[3]+l[3],16)/255)):(n=[parseInt(l[0]+l[1],16),parseInt(l[2]+l[3],16),parseInt(l[4]+l[5],16)],8===c&&(s=parseInt(l[6]+l[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),r=\"rgb\"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\\s*\\(([^\\)]*)\\)/.exec(t)){var u=e[1];r=l=u.replace(/a$/,\"\");var c=\"cmyk\"===l?4:\"gray\"===l?1:3;n=e[2].trim().split(/\\s*,\\s*/).map(function(t,e){if(/%$/.test(t))return e===c?parseFloat(t)/100:\"rgb\"===l?255*parseFloat(t)/100:parseFloat(t);if(\"h\"===l[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)}),u===l&&n.push(1),s=void 0===n[c]?1:n[c],n=n.slice(0,c)}else t.length>10&&/[0-9](?:\\s|\\/)/.test(t)&&(n=t.match(/([0-9]+)/g).map(function(t){return parseFloat(t)}),r=t.match(/([a-z])/gi).join(\"\").toLowerCase());else\"number\"==typeof t?(r=\"rgb\",n=[t>>>16,(65280&t)>>>8,255&t]):a(t)?(null!=t.r?(n=[t.r,t.g,t.b],r=\"rgb\"):null!=t.red?(n=[t.red,t.green,t.blue],r=\"rgb\"):null!=t.h?(n=[t.h,t.s,t.l],r=\"hsl\"):null!=t.hue&&(n=[t.hue,t.saturation,t.lightness],r=\"hsl\"),null!=t.a?s=t.a:null!=t.alpha?s=t.alpha:null!=t.opacity&&(s=t.opacity/100)):(Array.isArray(t)||ArrayBuffer.isView(t))&&(n=[t[0],t[1],t[2]],r=\"rgb\",s=4===t.length?t[3]:1);return{space:r,values:n,alpha:s}}e.exports=n;var i=t(\"color-name\"),a=t(\"is-plain-obj\"),o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}},{\"color-name\":86,\"is-plain-obj\":279}],88:[function(t,e,r){\"use strict\";var n=t(\"color-parse\"),i=t(\"color-space/hsl\"),a=t(\"clamp\");e.exports=function(t,e){null==e&&(e=!0);var r=n(t);if(!r.space)return[];if(Array.isArray(t))return t;var o,s=r.values,l=s.length;for(o=0;o<l;o++)s[o]=a(s[o],0,255);if(\"h\"===r.space[0]&&(s=i.rgb(s)),e)for(o=0;o<l;o++)s[o]/=255;return s.push(a(r.alpha,0,1)),s}},{clamp:81,\"color-parse\":87,\"color-space/hsl\":89}],89:[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,a];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var u=0;u<3;u++)(n=o+1/3*-(u-1))<0?n++:n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[u]=255*a;return i}},n.hsl=function(t){var e,r,n,i=t[0]/255,a=t[1]/255,o=t[2]/255,s=Math.min(i,a,o),l=Math.max(i,a,o),u=l-s;return l===s?e=0:i===l?e=(a-o)/u:a===l?e=2+(o-i)/u:o===l&&(e=4+(i-a)/u),(e=Math.min(60*e,360))<0&&(e+=360),n=(s+l)/2,r=l===s?0:n<=.5?u/(l+s):u/(2-l-s),[e,100*r,100*n]}},{\"./rgb\":90}],90:[function(t,e,r){\"use strict\";e.exports={name:\"rgb\",min:[0,0,0],max:[255,255,255],channel:[\"red\",\"green\",\"blue\"],alias:[\"RGB\"]}},{}],91:[function(t,e,r){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:0,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],\"rainbow-soft\":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],\"freesurface-blue\":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],\"freesurface-red\":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],\"velocity-blue\":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],\"velocity-green\":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},{}],92:[function(t,e,r){\"use strict\";function n(t){var e,r,n,u,c,h,f,d,p,m,g,v,y,b=[],x=[],_=[],w=[];if(o.isPlainObject(t)||(t={}),p=t.nshades||72,d=t.format||\"hex\",(f=t.colormap)||(f=\"jet\"),\"string\"==typeof f){if(f=f.toLowerCase(),!l[f])throw Error(f+\" not a supported colorscale\");h=s(l[f])}else{if(!Array.isArray(f))throw Error(\"unsupported colormap option\",f);h=s(f)}if(h.length>p)throw new Error(f+\" map requires nshades to be at least size \"+h.length);for(g=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:s(t.alpha):\"number\"==typeof t.alpha?[t.alpha,t.alpha]:[1,1],e=h.map(function(t){return Math.round(t.index*p)}),g[0]<0&&(g[0]=0),g[1]<0&&(g[0]=0),g[0]>1&&(g[0]=1),g[1]>1&&(g[0]=1),y=0;y<e.length;++y)v=h[y].index,4===(r=h[y].rgb).length&&r[3]>=0&&r[3]<=1||(r[3]=g[0]+(g[1]-g[0])*v);for(y=0;y<e.length-1;++y)c=e[y+1]-e[y],n=h[y].rgb,u=h[y+1].rgb,b=b.concat(o.linspace(n[0],u[0],c)),x=x.concat(o.linspace(n[1],u[1],c)),_=_.concat(o.linspace(n[2],u[2],c)),w=w.concat(o.linspace(n[3],u[3],c));return b=b.map(Math.round),x=x.map(Math.round),_=_.map(Math.round),m=o.zip(b,x,_,w),\"hex\"===d&&(m=m.map(i)),\"rgbaString\"===d&&(m=m.map(a)),m}function i(t){for(var e,r=\"#\",n=0;n<3;++n)r+=(\"00\"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function a(t){return\"rgba(\"+t.join(\",\")+\")\"}var o=t(\"arraytools\"),s=t(\"clone\"),l=t(\"./colorScales\");e.exports=n},{\"./colorScales\":91,arraytools:39,clone:84}],93:[function(t,e,r){\"use strict\";function n(t,e,r){var n=s(t[0],-e[0]),i=s(t[1],-e[1]),a=s(r[0],-e[0]),o=s(r[1],-e[1]),c=u(l(n,a),l(i,o));return c[c.length-1]>=0}function i(t,e,r,i){var s=a(e,r,i);if(0===s){var l=o(a(t,e,r)),u=o(a(t,e,i));if(l===u){if(0===l){var c=n(t,e,r);return c===n(t,e,i)?0:c?1:-1}return 0}return 0===u?l>0?-1:n(t,e,i)?-1:1:0===l?u>0?1:n(t,e,r)?1:-1:o(u-l)}var h=a(t,e,r);return h>0?s>0&&a(t,e,i)>0?1:-1:h<0?s>0||a(t,e,i)>0?1:-1:a(t,e,i)>0?1:n(t,e,r)?1:-1}e.exports=i;var a=t(\"robust-orientation\"),o=t(\"signum\"),s=t(\"two-sum\"),l=t(\"robust-product\"),u=t(\"robust-sum\")},{\"robust-orientation\":489,\"robust-product\":490,\"robust-sum\":494,signum:496,\"two-sum\":520}],94:[function(t,e,r){function n(t,e){return t-e}function i(t,e){var r=t.length,i=t.length-e.length;if(i)return i;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||a(t[0],t[1])-a(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(i=o+t[2]-(s+e[2]))return i;var l=a(t[0],t[1]),u=a(e[0],e[1]);return a(l,t[2])-a(u,e[2])||a(l+t[2],o)-a(u+e[2],s);case 4:var c=t[0],h=t[1],f=t[2],d=t[3],p=e[0],m=e[1],g=e[2],v=e[3];return c+h+f+d-(p+m+g+v)||a(c,h,f,d)-a(p,m,g,v,p)||a(c+h,c+f,c+d,h+f,h+d,f+d)-a(p+m,p+g,p+v,m+g,m+v,g+v)||a(c+h+f,c+h+d,c+f+d,h+f+d)-a(p+m+g,p+m+v,p+g+v,m+g+v);default:for(var y=t.slice().sort(n),b=e.slice().sort(n),x=0;x<r;++x)if(i=y[x]-b[x])return i;return 0}}e.exports=i;var a=Math.min},{}],95:[function(t,e,r){\"use strict\";function n(t,e){return i(t,e)||a(t)-a(e)}var i=t(\"compare-cell\"),a=t(\"cell-orientation\");e.exports=n},{\"cell-orientation\":78,\"compare-cell\":94}],96:[function(t,e,r){\"use strict\";function n(t){var e=t.length;if(0===e)return[];if(1===e)return[[0]];var r=t[0].length;return 0===r?[]:1===r?i(t):2===r?a(t):o(t,r)}var i=t(\"./lib/ch1d\"),a=t(\"./lib/ch2d\"),o=t(\"./lib/chnd\");e.exports=n},{\"./lib/ch1d\":97,\"./lib/ch2d\":98,\"./lib/chnd\":99}],97:[function(t,e,r){\"use strict\";function n(t){for(var e=0,r=0,n=1;n<t.length;++n)t[n][0]<t[e][0]&&(e=n),t[n][0]>t[r][0]&&(r=n);return e<r?[[e],[r]]:e>r?[[r],[e]]:[[e]]}e.exports=n},{}],98:[function(t,e,r){\"use strict\";function n(t){var e=i(t),r=e.length;if(r<=2)return[];for(var n=new Array(r),a=e[r-1],o=0;o<r;++o){var s=e[o];n[o]=[a,s],a=s}return n}e.exports=n;var i=t(\"monotone-convex-hull-2d\")},{\"monotone-convex-hull-2d\":433}],99:[function(t,e,r){\"use strict\";function n(t,e){for(var r=t.length,n=new Array(r),i=0;i<e.length;++i)n[i]=t[e[i]];for(var a=e.length,i=0;i<r;++i)e.indexOf(i)<0&&(n[a++]=t[i]);return n}function i(t,e){for(var r=t.length,n=e.length,i=0;i<r;++i)for(var a=t[i],o=0;o<a.length;++o){var s=a[o];if(s<n)a[o]=e[s];else{s-=n;for(var l=0;l<n;++l)s>=e[l]&&(s+=1);a[o]=s}}return t}function a(t,e){try{return o(t,!0)}catch(l){var r=s(t);if(r.length<=e)return[];var a=n(t,r);return i(o(a,!0),r)}}e.exports=a;var o=t(\"incremental-convex-hull\"),s=t(\"affine-hull\")},{\"affine-hull\":36,\"incremental-convex-hull\":273}],100:[function(t,e,r){e.exports={AFG:\"afghan\",ALA:\"\\\\b\\\\wland\",ALB:\"albania\",DZA:\"algeria\",ASM:\"^(?=.*americ).*samoa\",AND:\"andorra\",AGO:\"angola\",AIA:\"anguill?a\",ATA:\"antarctica\",ATG:\"antigua\",ARG:\"argentin\",ARM:\"armenia\",ABW:\"^(?!.*bonaire).*\\\\baruba\",AUS:\"australia\",AUT:\"^(?!.*hungary).*austria|\\\\baustri.*\\\\bemp\",AZE:\"azerbaijan\",BHS:\"bahamas\",BHR:\"bahrain\",BGD:\"bangladesh|^(?=.*east).*paki?stan\",BRB:\"barbados\",BLR:\"belarus|byelo\",BEL:\"^(?!.*luxem).*belgium\",BLZ:\"belize|^(?=.*british).*honduras\",BEN:\"benin|dahome\",BMU:\"bermuda\",BTN:\"bhutan\",BOL:\"bolivia\",BES:\"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\\\bbes.?islands\",BIH:\"herzegovina|bosnia\",BWA:\"botswana|bechuana\",BVT:\"bouvet\",BRA:\"brazil\",IOT:\"british.?indian.?ocean\",BRN:\"brunei\",BGR:\"bulgaria\",BFA:\"burkina|\\\\bfaso|upper.?volta\",BDI:\"burundi\",CPV:\"verde\",KHM:\"cambodia|kampuchea|khmer\",CMR:\"cameroon\",CAN:\"canada\",CYM:\"cayman\",CAF:\"\\\\bcentral.african.republic\",TCD:\"\\\\bchad\",CHL:\"\\\\bchile\",CHN:\"^(?!.*\\\\bmac)(?!.*\\\\bhong)(?!.*\\\\btai)(?!.*\\\\brep).*china|^(?=.*peo)(?=.*rep).*china\",CXR:\"christmas\",CCK:\"\\\\bcocos|keeling\",COL:\"colombia\",COM:\"comoro\",COG:\"^(?!.*\\\\bdem)(?!.*\\\\bd[\\\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\\\bcongo\",COK:\"\\\\bcook\",CRI:\"costa.?rica\",CIV:\"ivoire|ivory\",HRV:\"croatia\",CUB:\"\\\\bcuba\",CUW:\"^(?!.*bonaire).*\\\\bcura(c|ç)ao\",CYP:\"cyprus\",CSK:\"czechoslovakia\",CZE:\"^(?=.*rep).*czech|czechia|bohemia\",COD:\"\\\\bdem.*congo|congo.*\\\\bdem|congo.*\\\\bd[\\\\.]?r|\\\\bd[\\\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc\",DNK:\"denmark\",DJI:\"djibouti\",DMA:\"dominica(?!n)\",DOM:\"dominican.rep\",ECU:\"ecuador\",EGY:\"egypt\",SLV:\"el.?salvador\",GNQ:\"guine.*eq|eq.*guine|^(?=.*span).*guinea\",ERI:\"eritrea\",EST:\"estonia\",ETH:\"ethiopia|abyssinia\",FLK:\"falkland|malvinas\",FRO:\"faroe|faeroe\",FJI:\"fiji\",FIN:\"finland\",FRA:\"^(?!.*\\\\bdep)(?!.*martinique).*france|french.?republic|\\\\bgaul\",GUF:\"^(?=.*french).*guiana\",PYF:\"french.?polynesia|tahiti\",ATF:\"french.?southern\",GAB:\"gabon\",GMB:\"gambia\",GEO:\"^(?!.*south).*georgia\",DDR:\"german.?democratic.?republic|democratic.?republic.*germany|east.germany\",DEU:\"^(?!.*east).*germany|^(?=.*\\\\bfed.*\\\\brep).*german\",GHA:\"ghana|gold.?coast\",GIB:\"gibraltar\",GRC:\"greece|hellenic|hellas\",GRL:\"greenland\",GRD:\"grenada\",GLP:\"guadeloupe\",GUM:\"\\\\bguam\",GTM:\"guatemala\",GGY:\"guernsey\",GIN:\"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea\",GNB:\"bissau|^(?=.*portu).*guinea\",GUY:\"guyana|british.?guiana\",HTI:\"haiti\",HMD:\"heard.*mcdonald\",VAT:\"holy.?see|vatican|papal.?st\",HND:\"^(?!.*brit).*honduras\",HKG:\"hong.?kong\",HUN:\"^(?!.*austr).*hungary\",ISL:\"iceland\",IND:\"india(?!.*ocea)\",IDN:\"indonesia\",IRN:\"\\\\biran|persia\",IRQ:\"\\\\biraq|mesopotamia\",IRL:\"(^ireland)|(^republic.*ireland)\",IMN:\"^(?=.*isle).*\\\\bman\",ISR:\"israel\",ITA:\"italy\",JAM:\"jamaica\",JPN:\"japan\",JEY:\"jersey\",JOR:\"jordan\",KAZ:\"kazak\",KEN:\"kenya|british.?east.?africa|east.?africa.?prot\",KIR:\"kiribati\",PRK:\"^(?=.*democrat|people|north|d.*p.*.r).*\\\\bkorea|dprk|korea.*(d.*p.*r)\",KWT:\"kuwait\",KGZ:\"kyrgyz|kirghiz\",LAO:\"\\\\blaos?\\\\b\",LVA:\"latvia\",LBN:\"lebanon\",LSO:\"lesotho|basuto\",LBR:\"liberia\",LBY:\"libya\",LIE:\"liechtenstein\",LTU:\"lithuania\",LUX:\"^(?!.*belg).*luxem\",MAC:\"maca(o|u)\",MDG:\"madagascar|malagasy\",MWI:\"malawi|nyasa\",MYS:\"malaysia\",MDV:\"maldive\",MLI:\"\\\\bmali\\\\b\",MLT:\"\\\\bmalta\",MHL:\"marshall\",MTQ:\"martinique\",MRT:\"mauritania\",MUS:\"mauritius\",MYT:\"\\\\bmayotte\",MEX:\"\\\\bmexic\",FSM:\"fed.*micronesia|micronesia.*fed\",MCO:\"monaco\",MNG:\"mongolia\",MNE:\"^(?!.*serbia).*montenegro\",MSR:\"montserrat\",MAR:\"morocco|\\\\bmaroc\",MOZ:\"mozambique\",MMR:\"myanmar|burma\",NAM:\"namibia\",NRU:\"nauru\",NPL:\"nepal\",NLD:\"^(?!.*\\\\bant)(?!.*\\\\bcarib).*netherlands\",ANT:\"^(?=.*\\\\bant).*(nether|dutch)\",NCL:\"new.?caledonia\",NZL:\"new.?zealand\",NIC:\"nicaragua\",NER:\"\\\\bniger(?!ia)\",NGA:\"nigeria\",NIU:\"niue\",NFK:\"norfolk\",MNP:\"mariana\",NOR:\"norway\",OMN:\"\\\\boman|trucial\",PAK:\"^(?!.*east).*paki?stan\",PLW:\"palau\",PSE:\"palestin|\\\\bgaza|west.?bank\",PAN:\"panama\",PNG:\"papua|new.?guinea\",PRY:\"paraguay\",PER:\"peru\",PHL:\"philippines\",PCN:\"pitcairn\",POL:\"poland\",PRT:\"portugal\",PRI:\"puerto.?rico\",QAT:\"qatar\",KOR:\"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\\\bkorea(?!.*d.*p.*r)\",MDA:\"moldov|b(a|e)ssarabia\",REU:\"r(e|é)union\",ROU:\"r(o|u|ou)mania\",RUS:\"\\\\brussia|soviet.?union|u\\\\.?s\\\\.?s\\\\.?r|socialist.?republics\",RWA:\"rwanda\",BLM:\"barth(e|é)lemy\",SHN:\"helena\",KNA:\"kitts|\\\\bnevis\",LCA:\"\\\\blucia\",MAF:\"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)\",SPM:\"miquelon\",VCT:\"vincent\",WSM:\"^(?!.*amer).*samoa\",SMR:\"san.?marino\",STP:\"\\\\bs(a|ã)o.?tom(e|é)\",SAU:\"\\\\bsa\\\\w*.?arabia\",SEN:\"senegal\",SRB:\"^(?!.*monte).*serbia\",SYC:\"seychell\",SLE:\"sierra\",SGP:\"singapore\",SXM:\"^(?!.*martin)(?!.*saba).*maarten\",SVK:\"^(?!.*cze).*slovak\",SVN:\"slovenia\",SLB:\"solomon\",SOM:\"somali\",ZAF:\"south.africa|s\\\\\\\\..?africa\",SGS:\"south.?georgia|sandwich\",SSD:\"\\\\bs\\\\w*.?sudan\",ESP:\"spain\",LKA:\"sri.?lanka|ceylon\",SDN:\"^(?!.*\\\\bs(?!u)).*sudan\",SUR:\"surinam|dutch.?guiana\",SJM:\"svalbard\",SWZ:\"swaziland\",SWE:\"sweden\",CHE:\"switz|swiss\",SYR:\"syria\",TWN:\"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china\",TJK:\"tajik\",THA:\"thailand|\\\\bsiam\",MKD:\"macedonia|fyrom\",TLS:\"^(?=.*leste).*timor|^(?=.*east).*timor\",TGO:\"togo\",TKL:\"tokelau\",TON:\"tonga\",TTO:\"trinidad|tobago\",TUN:\"tunisia\",TUR:\"turkey\",TKM:\"turkmen\",TCA:\"turks\",TUV:\"tuvalu\",UGA:\"uganda\",UKR:\"ukrain\",ARE:\"emirates|^u\\\\.?a\\\\.?e\\\\.?$|united.?arab.?em\",GBR:\"united.?kingdom|britain|^u\\\\.?k\\\\.?$\",TZA:\"tanzania\",USA:\"united.?states\\\\b(?!.*islands)|\\\\bu\\\\.?s\\\\.?a\\\\.?\\\\b|^\\\\s*u\\\\.?s\\\\.?\\\\b(?!.*islands)\",UMI:\"minor.?outlying.?is\",URY:\"uruguay\",UZB:\"uzbek\",VUT:\"vanuatu|new.?hebrides\",VEN:\"venezuela\",VNM:\"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam\",VGB:\"^(?=.*\\\\bu\\\\.?\\\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin\",VIR:\"^(?=.*\\\\bu\\\\.?\\\\s?s).*virgin|^(?=.*states).*virgin\",WLF:\"futuna|wallis\",ESH:\"western.sahara\",YEM:\"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\\\bp\\\\.?d\\\\.?r).*yemen\",YMD:\"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\\\bp\\\\.?d\\\\.?r).*yemen\",YUG:\"yugoslavia\",ZMB:\"zambia|northern.?rhodesia\",EAZ:\"zanzibar\",ZWE:\"zimbabwe|^(?!.*northern).*rhodesia\"}},{}],101:[function(t,e,r){function n(t){return t=Math.round(t),t<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return n(\"%\"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return i(\"%\"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function l(t){var e=t.replace(/ /g,\"\").toLowerCase();if(e in u)return u[e].slice();if(\"#\"===e[0]){if(4===e.length)return(r=parseInt(e.substr(1),16))>=0&&r<=4095?[(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1]:null;if(7===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=16777215?[(16711680&r)>>16,(65280&r)>>8,255&r,1]:null}return null}var i=e.indexOf(\"(\"),l=e.indexOf(\")\");if(-1!==i&&l+1===e.length){var c=e.substr(0,i),h=e.substr(i+1,l-(i+1)).split(\",\"),f=1;switch(c){case\"rgba\":if(4!==h.length)return null;f=o(h.pop());case\"rgb\":return 3!==h.length?null:[a(h[0]),a(h[1]),a(h[2]),f];case\"hsla\":if(4!==h.length)return null;f=o(h.pop());case\"hsl\":if(3!==h.length)return null;var d=(parseFloat(h[0])%360+360)%360/360,p=o(h[1]),m=o(h[2]),g=m<=.5?m*(p+1):m+p-m*p,v=2*m-g;return[n(255*s(v,g,d+1/3)),n(255*s(v,g,d)),n(255*s(v,g,d-1/3)),f];default:return null}}return null}var u={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};try{r.parseCSSColor=l}catch(t){}},{}],102:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,u=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var c=t.length-1;c>=0;--c)a[c]=o*t[c]+s*e[c]+l*r[c]+u*n[c];return a}return o*t+s*e+l*r[c]+u*n}function i(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,u=(1+2*i)*l,c=i*l,h=s*(3-2*i),f=s*o;if(t.length){a||(a=new Array(t.length));for(var d=t.length-1;d>=0;--d)a[d]=u*t[d]+c*e[d]+h*r[d]+f*n[d];return a}return u*t+c*e+h*r+f*n}e.exports=i,e.exports.derivative=n},{}],103:[function(t,e,r){\"use strict\";function n(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName=\"\",this.pre=null,this.body=null,this.post=null,this.debug=!1}function i(t){var e=new n;e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var i=0;i<r.length;++i){var o=r[i];if(\"array\"===o||\"object\"==typeof o&&o.blockIndices){if(e.argTypes[i]=\"array\",e.arrayArgs.push(i),e.arrayBlockIndices.push(o.blockIndices?o.blockIndices:0),e.shimArgs.push(\"array\"+i),i<e.pre.args.length&&e.pre.args[i].count>0)throw new Error(\"cwise: pre() block may not reference array args\");if(i<e.post.args.length&&e.post.args[i].count>0)throw new Error(\"cwise: post() block may not reference array args\")}else if(\"scalar\"===o)e.scalarArgs.push(i),e.shimArgs.push(\"scalar\"+i);else if(\"index\"===o){if(e.indexArgs.push(i),i<e.pre.args.length&&e.pre.args[i].count>0)throw new Error(\"cwise: pre() block may not reference array index\");if(i<e.body.args.length&&e.body.args[i].lvalue)throw new Error(\"cwise: body() block may not write to array index\");if(i<e.post.args.length&&e.post.args[i].count>0)throw new Error(\"cwise: post() block may not reference array index\")}else if(\"shape\"===o){if(e.shapeArgs.push(i),i<e.pre.args.length&&e.pre.args[i].lvalue)throw new Error(\"cwise: pre() block may not write to array shape\");if(i<e.body.args.length&&e.body.args[i].lvalue)throw new Error(\"cwise: body() block may not write to array shape\");if(i<e.post.args.length&&e.post.args[i].lvalue)throw new Error(\"cwise: post() block may not write to array shape\")}else{if(\"object\"!=typeof o||!o.offset)throw new Error(\"cwise: Unknown argument type \"+r[i]);e.argTypes[i]=\"offset\",e.offsetArgs.push({array:o.array,offset:o.offset}),e.offsetArgIndex.push(i)}}if(e.arrayArgs.length<=0)throw new Error(\"cwise: No array arguments specified\");if(e.pre.args.length>r.length)throw new Error(\"cwise: Too many arguments in pre() block\");if(e.body.args.length>r.length)throw new Error(\"cwise: Too many arguments in body() block\");if(e.post.args.length>r.length)throw new Error(\"cwise: Too many arguments in post() block\");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||\"cwise\",e.blockSize=t.blockSize||64,a(e)}var a=t(\"./lib/thunk.js\");e.exports=i},{\"./lib/thunk.js\":105}],104:[function(t,e,r){\"use strict\";function n(t,e,r){var n,i,a=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],u=[],c=0,h=0;for(n=0;n<a;++n)u.push([\"i\",n,\"=0\"].join(\"\"));for(i=0;i<o;++i)for(n=0;n<a;++n)h=c,c=t[n],0===n?u.push([\"d\",i,\"s\",n,\"=t\",i,\"p\",c].join(\"\")):u.push([\"d\",i,\"s\",n,\"=(t\",i,\"p\",c,\"-s\",h,\"*t\",i,\"p\",h,\")\"].join(\"\"));for(l.push(\"var \"+u.join(\",\")),n=a-1;n>=0;--n)c=t[n],l.push([\"for(i\",n,\"=0;i\",n,\"<s\",c,\";++i\",n,\"){\"].join(\"\"));for(l.push(r),n=0;n<a;++n){for(h=c,c=t[n],i=0;i<o;++i)l.push([\"p\",i,\"+=d\",i,\"s\",n].join(\"\"));s&&(n>0&&l.push([\"index[\",h,\"]-=s\",h].join(\"\")),l.push([\"++index[\",c,\"]\"].join(\"\"))),l.push(\"}\")}return l.join(\"\\n\")}function i(t,e,r,i){for(var a=e.length,o=r.arrayArgs.length,s=r.blockSize,l=r.indexArgs.length>0,u=[],c=0;c<o;++c)u.push([\"var offset\",c,\"=p\",c].join(\"\"));for(c=t;c<a;++c)u.push([\"for(var j\"+c+\"=SS[\",e[c],\"]|0;j\",c,\">0;){\"].join(\"\")),u.push([\"if(j\",c,\"<\",s,\"){\"].join(\"\")),u.push([\"s\",e[c],\"=j\",c].join(\"\")),u.push([\"j\",c,\"=0\"].join(\"\")),u.push([\"}else{s\",e[c],\"=\",s].join(\"\")),u.push([\"j\",c,\"-=\",s,\"}\"].join(\"\")),l&&u.push([\"index[\",e[c],\"]=j\",c].join(\"\"));for(c=0;c<o;++c){for(var h=[\"offset\"+c],f=t;f<a;++f)h.push([\"j\",f,\"*t\",c,\"p\",e[f]].join(\"\"));u.push([\"p\",c,\"=(\",h.join(\"+\"),\")\"].join(\"\"))}u.push(n(e,r,i));for(c=t;c<a;++c)u.push(\"}\");return u.join(\"\\n\")}function a(t){for(var e=0,r=t[0].length;e<r;){for(var n=1;n<t.length;++n)if(t[n][e]!==t[0][e])return e;++e}return e}function o(t,e,r){for(var n=t.body,i=[],a=[],o=0;o<t.args.length;++o){var s=t.args[o];if(!(s.count<=0)){var l=new RegExp(s.name,\"g\"),u=\"\",c=e.arrayArgs.indexOf(o);switch(e.argTypes[o]){case\"offset\":var h=e.offsetArgIndex.indexOf(o);c=e.offsetArgs[h].array,u=\"+q\"+h;case\"array\":u=\"p\"+c+u;var f=\"l\"+o,d=\"a\"+c;if(0===e.arrayBlockIndices[c])1===s.count?\"generic\"===r[c]?s.lvalue?(i.push([\"var \",f,\"=\",d,\".get(\",u,\")\"].join(\"\")),n=n.replace(l,f),a.push([d,\".set(\",u,\",\",f,\")\"].join(\"\"))):n=n.replace(l,[d,\".get(\",u,\")\"].join(\"\")):n=n.replace(l,[d,\"[\",u,\"]\"].join(\"\")):\"generic\"===r[c]?(i.push([\"var \",f,\"=\",d,\".get(\",u,\")\"].join(\"\")),n=n.replace(l,f),s.lvalue&&a.push([d,\".set(\",u,\",\",f,\")\"].join(\"\"))):(i.push([\"var \",f,\"=\",d,\"[\",u,\"]\"].join(\"\")),n=n.replace(l,f),s.lvalue&&a.push([d,\"[\",u,\"]=\",f].join(\"\")));else{for(var p=[s.name],m=[u],g=0;g<Math.abs(e.arrayBlockIndices[c]);g++)p.push(\"\\\\s*\\\\[([^\\\\]]+)\\\\]\"),m.push(\"$\"+(g+1)+\"*t\"+c+\"b\"+g);if(l=new RegExp(p.join(\"\"),\"g\"),u=m.join(\"+\"),\"generic\"===r[c])throw new Error(\"cwise: Generic arrays not supported in combination with blocks!\");n=n.replace(l,[d,\"[\",u,\"]\"].join(\"\"))}break;case\"scalar\":n=n.replace(l,\"Y\"+e.scalarArgs.indexOf(o));break;case\"index\":n=n.replace(l,\"index\");break;case\"shape\":n=n.replace(l,\"shape\")}}}return[i.join(\"\\n\"),n,a.join(\"\\n\")].join(\"\\n\").trim()}function s(t){for(var e=new Array(t.length),r=!0,n=0;n<t.length;++n){var i=t[n],a=i.match(/\\d+/);a=a?a[0]:\"\",0===i.charAt(0)?e[n]=\"u\"+i.charAt(1)+a:e[n]=i.charAt(0)+a,n>0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join(\"\")}function l(t,e){for(var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,l=new Array(t.arrayArgs.length),c=new Array(t.arrayArgs.length),h=0;h<t.arrayArgs.length;++h)c[h]=e[2*h],l[h]=e[2*h+1];for(var f=[],d=[],p=[],m=[],g=[],h=0;h<t.arrayArgs.length;++h){t.arrayBlockIndices[h]<0?(p.push(0),m.push(r),f.push(r),d.push(r+t.arrayBlockIndices[h])):(p.push(t.arrayBlockIndices[h]),m.push(t.arrayBlockIndices[h]+r),f.push(0),d.push(t.arrayBlockIndices[h]));for(var v=[],y=0;y<l[h].length;y++)p[h]<=l[h][y]&&l[h][y]<m[h]&&v.push(l[h][y]-p[h]);g.push(v)}for(var b=[\"SS\"],x=[\"'use strict'\"],_=[],y=0;y<r;++y)_.push([\"s\",y,\"=SS[\",y,\"]\"].join(\"\"));for(h=0;h<t.arrayArgs.length;++h){b.push(\"a\"+h),b.push(\"t\"+h),b.push(\"p\"+h);for(y=0;y<r;++y)_.push([\"t\",h,\"p\",y,\"=t\",h,\"[\",p[h]+y,\"]\"].join(\"\"));for(y=0;y<Math.abs(t.arrayBlockIndices[h]);++y)_.push([\"t\",h,\"b\",y,\"=t\",h,\"[\",f[h]+y,\"]\"].join(\"\"))}for(h=0;h<t.scalarArgs.length;++h)b.push(\"Y\"+h);if(t.shapeArgs.length>0&&_.push(\"shape=SS.slice(0)\"),t.indexArgs.length>0){for(var w=new Array(r),h=0;h<r;++h)w[h]=\"0\";_.push([\"index=[\",w.join(\",\"),\"]\"].join(\"\"))}for(h=0;h<t.offsetArgs.length;++h){for(var M=t.offsetArgs[h],k=[],y=0;y<M.offset.length;++y)0!==M.offset[y]&&(1===M.offset[y]?k.push([\"t\",M.array,\"p\",y].join(\"\")):k.push([M.offset[y],\"*t\",M.array,\"p\",y].join(\"\")));0===k.length?_.push(\"q\"+h+\"=0\"):_.push([\"q\",h,\"=\",k.join(\"+\")].join(\"\"))}var A=u([].concat(t.pre.thisVars).concat(t.body.thisVars).concat(t.post.thisVars));_=_.concat(A),x.push(\"var \"+_.join(\",\"));for(h=0;h<t.arrayArgs.length;++h)x.push(\"p\"+h+\"|=0\");t.pre.body.length>3&&x.push(o(t.pre,t,c));var T=o(t.body,t,c),S=a(g);S<r?x.push(i(S,g[0],t,T)):x.push(n(g[0],t,T)),t.post.body.length>3&&x.push(o(t.post,t,c)),t.debug&&console.log(\"-----Generated cwise routine for \",e,\":\\n\"+x.join(\"\\n\")+\"\\n----------\");var E=[t.funcName||\"unnamed\",\"_cwise_loop_\",l[0].join(\"s\"),\"m\",S,s(c)].join(\"\");return new Function([\"function \",E,\"(\",b.join(\",\"),\"){\",x.join(\"\\n\"),\"} return \",E].join(\"\"))()}var u=t(\"uniq\");e.exports=l},{uniq:523}],105:[function(t,e,r){\"use strict\";function n(t){var e=[\"'use strict'\",\"var CACHED={}\"],r=[],n=t.funcName+\"_cwise_thunk\";e.push([\"return function \",n,\"(\",t.shimArgs.join(\",\"),\"){\"].join(\"\"));for(var a=[],o=[],s=[[\"array\",t.arrayArgs[0],\".shape.slice(\",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?\",\"+t.arrayBlockIndices[0]+\")\":\")\"].join(\"\")],l=[],u=[],c=0;c<t.arrayArgs.length;++c){var h=t.arrayArgs[c];r.push([\"t\",h,\"=array\",h,\".dtype,\",\"r\",h,\"=array\",h,\".order\"].join(\"\")),a.push(\"t\"+h),a.push(\"r\"+h),o.push(\"t\"+h),o.push(\"r\"+h+\".join()\"),s.push(\"array\"+h+\".data\"),s.push(\"array\"+h+\".stride\"),s.push(\"array\"+h+\".offset|0\"),c>0&&(l.push(\"array\"+t.arrayArgs[0]+\".shape.length===array\"+h+\".shape.length+\"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[c]))),u.push(\"array\"+t.arrayArgs[0]+\".shape[shapeIndex+\"+Math.max(0,t.arrayBlockIndices[0])+\"]===array\"+h+\".shape[shapeIndex+\"+Math.max(0,t.arrayBlockIndices[c])+\"]\"))}t.arrayArgs.length>1&&(e.push(\"if (!(\"+l.join(\" && \")+\")) throw new Error('cwise: Arrays do not all have the same dimensionality!')\"),e.push(\"for(var shapeIndex=array\"+t.arrayArgs[0]+\".shape.length-\"+Math.abs(t.arrayBlockIndices[0])+\"; shapeIndex--\\x3e0;) {\"),e.push(\"if (!(\"+u.join(\" && \")+\")) throw new Error('cwise: Arrays do not all have the same shape!')\"),e.push(\"}\"));for(c=0;c<t.scalarArgs.length;++c)s.push(\"scalar\"+t.scalarArgs[c]);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\"))(i.bind(void 0,t))}var i=t(\"./compile.js\");e.exports=n},{\"./compile.js\":104}],106:[function(t,e,r){e.exports=t(\"cwise-compiler\")},{\"cwise-compiler\":103}],107:[function(t,e,r){!function(){function t(t){return t&&(t.ownerDocument||t.document||t).documentElement}function r(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function n(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function i(t){return null===t?NaN:+t}function a(t){return!isNaN(t)}function o(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}function s(t){return t.length}function l(t){for(var e=1;t*e%1;)e*=10;return e}function u(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function c(){this._=Object.create(null)}function h(t){return(t+=\"\")===bo||t[0]===xo?xo+t:t}function f(t){return(t+=\"\")[0]===xo?t.slice(1):t}function d(t){return h(t)in this._}function p(t){return(t=h(t))in this._&&delete this._[t]}function m(){var t=[];for(var e in this._)t.push(f(e));return t}function g(){var t=0;for(var e in this._)++t;return t}function v(){for(var t in this._)return!1;return!0}function y(){this._=Object.create(null)}function b(t){return t}function x(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function _(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=_o.length;r<n;++r){var i=_o[r]+e;if(i in t)return i}}function w(){}function M(){}function k(t){function e(){for(var e,n=r,i=-1,a=n.length;++i<a;)(e=n[i].on)&&e.apply(this,arguments);return t}var r=[],n=new c;return e.on=function(e,i){var a,o=n.get(e);return arguments.length<2?o&&o.on:(o&&(o.on=null,r=r.slice(0,a=r.indexOf(o)).concat(r.slice(a+1)),n.remove(e)),i&&r.push(n.set(e,{on:i})),t)},e}function A(){so.event.preventDefault()}function T(){for(var t,e=so.event;t=e.sourceEvent;)e=t;return e}function S(t){for(var e=new M,r=0,n=arguments.length;++r<n;)e[arguments[r]]=k(e);return e.of=function(r,n){return function(i){try{var a=i.sourceEvent=so.event;i.target=t,so.event=i,e[i.type].apply(r,n)}finally{so.event=a}}},e}function E(t){return Mo(t,So),t}function L(t){return\"function\"==typeof t?t:function(){return ko(t,this)}}function C(t){return\"function\"==typeof t?t:function(){return Ao(t,this)}}function z(t,e){function r(){this.removeAttribute(t)}function n(){this.removeAttributeNS(t.space,t.local)}function i(){this.setAttribute(t,e)}function a(){this.setAttributeNS(t.space,t.local,e)}function o(){var r=e.apply(this,arguments);null==r?this.removeAttribute(t):this.setAttribute(t,r)}function s(){var r=e.apply(this,arguments);null==r?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}return t=so.ns.qualify(t),null==e?t.local?n:r:\"function\"==typeof e?t.local?s:o:t.local?a:i}function D(t){return t.trim().replace(/\\s+/g,\" \")}function I(t){return new RegExp(\"(?:^|\\\\s+)\"+so.requote(t)+\"(?:\\\\s+|$)\",\"g\")}function P(t){return(t+\"\").trim().split(/^|\\s+/)}function O(t,e){function r(){for(var r=-1;++r<i;)t[r](this,e)}function n(){for(var r=-1,n=e.apply(this,arguments);++r<i;)t[r](this,n)}var i=(t=P(t).map(j)).length;return\"function\"==typeof e?n:r}function j(t){var e=I(t);return function(r,n){if(i=r.classList)return n?i.add(t):i.remove(t);var i=r.getAttribute(\"class\")||\"\";n?(e.lastIndex=0,e.test(i)||r.setAttribute(\"class\",D(i+\" \"+t))):r.setAttribute(\"class\",D(i.replace(e,\" \")))}}function R(t,e,r){function n(){this.style.removeProperty(t)}function i(){this.style.setProperty(t,e,r)}function a(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}return null==e?n:\"function\"==typeof e?a:i}function F(t,e){function r(){delete this[t]}function n(){this[t]=e}function i(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}return null==e?r:\"function\"==typeof e?i:n}function N(t){function e(){var e=this.ownerDocument,r=this.namespaceURI;return r===Eo&&e.documentElement.namespaceURI===Eo?e.createElement(t):e.createElementNS(r,t)}function r(){return this.ownerDocument.createElementNS(t.space,t.local)}return\"function\"==typeof t?t:(t=so.ns.qualify(t)).local?r:e}function B(){var t=this.parentNode;t&&t.removeChild(this)}function U(t){return{__data__:t}}function V(t){return function(){return To(this,t)}}function H(t){return arguments.length||(t=n),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}function q(t,e){for(var r=0,n=t.length;r<n;r++)for(var i,a=t[r],o=0,s=a.length;o<s;o++)(i=a[o])&&e(i,o,r);return t}function G(t){return Mo(t,Co),t}function Y(t){var e,r;return function(n,i,a){var o,s=t[a].update,l=s.length;for(a!=r&&(r=a,e=0),i>=e&&(e=i+1);!(o=s[e])&&++e<l;);return o}}function W(t,e,r){function n(){var e=this[o];e&&(this.removeEventListener(t,e,e.$),delete this[o])}function i(){var i=l(e,uo(arguments));n.call(this),this.addEventListener(t,this[o]=i,i.$=r),i._=e}function a(){var e,r=new RegExp(\"^__on([^.]+)\"+so.requote(t)+\"$\");for(var n in this)if(e=n.match(r)){var i=this[n];this.removeEventListener(e[1],i,i.$),delete this[n]}}var o=\"__on\"+t,s=t.indexOf(\".\"),l=X;s>0&&(t=t.slice(0,s));var u=zo.get(t);return u&&(t=u,l=Z),s?e?i:n:e?w:a}function X(t,e){return function(r){var n=so.event;so.event=r,e[0]=this.__data__;try{t.apply(this,e)}finally{so.event=n}}}function Z(t,e){var r=X(t,e);return function(t){var e=this,n=t.relatedTarget;n&&(n===e||8&n.compareDocumentPosition(e))||r.call(e,t)}}function J(e){var n=\".dragsuppress-\"+ ++Io,i=\"click\"+n,a=so.select(r(e)).on(\"touchmove\"+n,A).on(\"dragstart\"+n,A).on(\"selectstart\"+n,A);if(null==Do&&(Do=!(\"onselectstart\"in e)&&_(e.style,\"userSelect\")),Do){var o=t(e).style,s=o[Do];o[Do]=\"none\"}return function(t){if(a.on(n,null),Do&&(o[Do]=s),t){var e=function(){a.on(i,null)};a.on(i,function(){A(),e()},!0),setTimeout(e,0)}}}function Q(t,e){e.changedTouches&&(e=e.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();if(Po<0){var a=r(t);if(a.scrollX||a.scrollY){var o=(n=so.select(\"body\").append(\"svg\").style({position:\"absolute\",top:0,left:0,margin:0,padding:0,border:\"none\"},\"important\"))[0][0].getScreenCTM();Po=!(o.f||o.e),n.remove()}}return Po?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}function K(){return so.event.changedTouches[0].identifier}function $(t){return t>0?1:t<0?-1:0}function tt(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function et(t){return t>1?0:t<-1?Ro:Math.acos(t)}function rt(t){return t>1?Bo:t<-1?-Bo:Math.asin(t)}function nt(t){return((t=Math.exp(t))-1/t)/2}function it(t){return((t=Math.exp(t))+1/t)/2}function at(t){return((t=Math.exp(2*t))-1)/(t+1)}function ot(t){return(t=Math.sin(t/2))*t}function st(){}function lt(t,e,r){return this instanceof lt?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof lt?new lt(t.h,t.s,t.l):wt(\"\"+t,Mt,lt):new lt(t,e,r)}function ut(t,e,r){function n(t){return t>360?t-=360:t<0&&(t+=360),t<60?a+(o-a)*t/60:t<180?o:t<240?a+(o-a)*(240-t)/60:a}function i(t){return Math.round(255*n(t))}var a,o;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,r=r<0?0:r>1?1:r,o=r<=.5?r*(1+e):r+e-r*e,a=2*r-o,new yt(i(t+120),i(t),i(t-120))}function ct(t,e,r){return this instanceof ct?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof ct?new ct(t.h,t.c,t.l):t instanceof ft?pt(t.l,t.a,t.b):pt((t=kt((t=so.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new ct(t,e,r)}function ht(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new ft(r,Math.cos(t*=Uo)*e,Math.sin(t)*e)}function ft(t,e,r){return this instanceof ft?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof ft?new ft(t.l,t.a,t.b):t instanceof ct?ht(t.h,t.c,t.l):kt((t=yt(t)).r,t.g,t.b):new ft(t,e,r)}function dt(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return i=mt(i)*Jo,n=mt(n)*Qo,a=mt(a)*Ko,new yt(vt(3.2404542*i-1.5371385*n-.4985314*a),vt(-.969266*i+1.8760108*n+.041556*a),vt(.0556434*i-.2040259*n+1.0572252*a))}function pt(t,e,r){return t>0?new ct(Math.atan2(r,e)*Vo,Math.sqrt(e*e+r*r),t):new ct(NaN,NaN,t)}function mt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function gt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function vt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function yt(t,e,r){return this instanceof yt?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof yt?new yt(t.r,t.g,t.b):wt(\"\"+t,yt,ut):new yt(t,e,r)}function bt(t){return new yt(t>>16,t>>8&255,255&t)}function xt(t){return bt(t)+\"\"}function _t(t){return t<16?\"0\"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function wt(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(Tt(i[0]),Tt(i[1]),Tt(i[2]))}return(a=es.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 Mt(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 lt(n,i,l)}function kt(t,e,r){var n=gt((.4124564*(t=At(t))+.3575761*(e=At(e))+.1804375*(r=At(r)))/Jo),i=gt((.2126729*t+.7151522*e+.072175*r)/Qo);return ft(116*i-16,500*(n-i),200*(i-gt((.0193339*t+.119192*e+.9503041*r)/Ko)))}function At(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Tt(t){var e=parseFloat(t);return\"%\"===t.charAt(t.length-1)?Math.round(2.55*e):e}function St(t){return\"function\"==typeof t?t:function(){return t}}function Et(t){return function(e,r,n){return 2===arguments.length&&\"function\"==typeof r&&(n=r,r=null),Lt(e,r,t,n)}}function Lt(t,e,r,n){function i(){var t,e=l.status;if(!e&&zt(l)||e>=200&&e<300||304===e){try{t=r.call(a,l)}catch(t){return void o.error.call(a,t)}o.load.call(a,t)}else o.error.call(a,l)}var a={},o=so.dispatch(\"beforesend\",\"progress\",\"load\",\"error\"),s={},l=new XMLHttpRequest,u=null;return!this.XDomainRequest||\"withCredentials\"in l||!/^(http(s)?:)?\\/\\//.test(t)||(l=new XDomainRequest),\"onload\"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(t){var e=so.event;so.event=t;try{o.progress.call(a,l)}finally{so.event=e}},a.header=function(t,e){return t=(t+\"\").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+\"\",a)},a.mimeType=function(t){return arguments.length?(e=null==t?null:t+\"\",a):e},a.responseType=function(t){return arguments.length?(u=t,a):u},a.response=function(t){return r=t,a},[\"get\",\"post\"].forEach(function(t){a[t]=function(){return a.send.apply(a,[t].concat(uo(arguments)))}}),a.send=function(r,n,i){if(2===arguments.length&&\"function\"==typeof n&&(i=n,n=null),l.open(r,t,!0),null==e||\"accept\"in s||(s.accept=e+\",*/*\"),l.setRequestHeader)for(var c in s)l.setRequestHeader(c,s[c]);return null!=e&&l.overrideMimeType&&l.overrideMimeType(e),null!=u&&(l.responseType=u),null!=i&&a.on(\"error\",i).on(\"load\",function(t){i(null,t)}),o.beforesend.call(a,l),l.send(null==n?null:n),a},a.abort=function(){return l.abort(),a},so.rebind(a,o,\"on\"),null==n?a:a.get(Ct(n))}function Ct(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}function zt(t){var e=t.responseType;return e&&\"text\"!==e?t.response:t.responseText}function Dt(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var i={c:t,t:r+e,n:null};return ns?ns.n=i:rs=i,ns=i,is||(as=clearTimeout(as),is=1,os(It)),i}function It(){var t=Pt(),e=Ot()-t;e>24?(isFinite(e)&&(clearTimeout(as),as=setTimeout(It,e)),is=0):(is=1,os(It))}function Pt(){for(var t=Date.now(),e=rs;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Ot(){for(var t,e=rs,r=1/0;e;)e.c?(e.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:rs=e.n;return ns=t,r}function jt(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function Rt(t,e){var r=Math.pow(10,3*yo(8-e));return{scale:e>8?function(t){return t/r}:function(t){return t*r},symbol:t}}function Ft(t){var e=t.decimal,r=t.thousands,n=t.grouping,i=t.currency,a=n&&r?function(t,e){for(var i=t.length,a=[],o=0,s=n[0],l=0;i>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(i-=s,i+s)),!((l+=s+1)>e));)s=n[o=(o+1)%n.length];return a.reverse().join(r)}:b;return function(t){var r=ls.exec(t),n=r[1]||\" \",o=r[2]||\">\",s=r[3]||\"-\",l=r[4]||\"\",u=r[5],c=+r[6],h=r[7],f=r[8],d=r[9],p=1,m=\"\",g=\"\",v=!1,y=!0;switch(f&&(f=+f.substring(1)),(u||\"0\"===n&&\"=\"===o)&&(u=n=\"0\",o=\"=\"),d){case\"n\":h=!0,d=\"g\";break;case\"%\":p=100,g=\"%\",d=\"f\";break;case\"p\":p=100,g=\"%\",d=\"r\";break;case\"b\":case\"o\":case\"x\":case\"X\":\"#\"===l&&(m=\"0\"+d.toLowerCase());case\"c\":y=!1;case\"d\":v=!0,f=0;break;case\"s\":p=-1,d=\"r\"}\"$\"===l&&(m=i[0],g=i[1]),\"r\"!=d||f||(d=\"g\"),null!=f&&(\"g\"==d?f=Math.max(1,Math.min(21,f)):\"e\"!=d&&\"f\"!=d||(f=Math.max(0,Math.min(20,f)))),d=us.get(d)||Nt;var b=u&&h;return function(t){var r=g;if(v&&t%1)return\"\";var i=t<0||0===t&&1/t<0?(t=-t,\"-\"):\"-\"===s?\"\":s;if(p<0){var l=so.formatPrefix(t,f);t=l.scale(t),r=l.symbol+g}else t*=p;var x,_,w=(t=d(t,f)).lastIndexOf(\".\");if(w<0){var M=y?t.lastIndexOf(\"e\"):-1;M<0?(x=t,_=\"\"):(x=t.substring(0,M),_=t.substring(M))}else x=t.substring(0,w),_=e+t.substring(w+1);!u&&h&&(x=a(x,1/0));var k=m.length+x.length+_.length+(b?0:i.length),A=k<c?new Array(k=c-k+1).join(n):\"\";return b&&(x=a(A+x,A.length?c-_.length:1/0)),i+=m,t=x+_,(\"<\"===o?i+t+A:\">\"===o?A+i+t:\"^\"===o?A.substring(0,k>>=1)+i+t+A.substring(k):i+(b?t:A+t))+r}}}function Nt(t){return t+\"\"}function Bt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Ut(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 hs(r-1)),1),r}function a(t,r){return e(t=new hs(+t),r),t}function o(t,n,a){var o=i(t),s=[];if(a>1)for(;o<n;)r(o)%a||s.push(new Date(+o)),e(o,1);else for(;o<n;)s.push(new Date(+o)),e(o,1);return s}function s(t,e,r){try{hs=Bt;var n=new Bt;return n._=t,o(n,e,r)}finally{hs=Date}}t.floor=t,t.round=n,t.ceil=i,t.offset=a,t.range=o;var l=t.utc=Vt(t);return l.floor=l,l.round=Vt(n),l.ceil=Vt(i),l.offset=Vt(a),l.range=s,t}function Vt(t){return function(e,r){try{hs=Bt;var n=new Bt;return n._=e,t(n,r)._}finally{hs=Date}}}function Ht(t){function e(t){function e(e){for(var r,i,a,o=[],s=-1,l=0;++s<n;)37===t.charCodeAt(s)&&(o.push(t.slice(l,s)),null!=(i=ds[r=t.charAt(++s)])&&(r=t.charAt(++s)),(a=E[r])&&(r=a(e,null==i?\"e\"===r?\" \":\"0\":i)),o.push(r),l=s+1);return o.push(t.slice(l,s)),o.join(\"\")}var n=t.length;return e.parse=function(e){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(r(n,t,e,0)!=e.length)return null;\"p\"in n&&(n.H=n.H%12+12*n.p);var i=null!=n.Z&&hs!==Bt,a=new(i?Bt:hs);return\"j\"in n?a.setFullYear(n.y,0,n.j):\"W\"in n||\"U\"in n?(\"w\"in n||(n.w=\"W\"in n?1:0),a.setFullYear(n.y,0,1),a.setFullYear(n.y,0,\"W\"in n?(n.w+6)%7+7*n.W-(a.getDay()+5)%7:n.w+7*n.U-(a.getDay()+6)%7)):a.setFullYear(n.y,n.m,n.d),a.setHours(n.H+(n.Z/100|0),n.M+n.Z%100,n.S,n.L),i?a._:a},e.toString=function(){return t},e}function r(t,e,r,n){for(var i,a,o,s=0,l=e.length,u=r.length;s<l;){if(n>=u)return-1;if(37===(i=e.charCodeAt(s++))){if(o=e.charAt(s++),!(a=L[o in ds?e.charAt(s++):o])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}function n(t,e,r){w.lastIndex=0;var n=w.exec(e.slice(r));return n?(t.w=M.get(n[0].toLowerCase()),r+n[0].length):-1}function i(t,e,r){x.lastIndex=0;var n=x.exec(e.slice(r));return n?(t.w=_.get(n[0].toLowerCase()),r+n[0].length):-1}function a(t,e,r){T.lastIndex=0;var n=T.exec(e.slice(r));return n?(t.m=S.get(n[0].toLowerCase()),r+n[0].length):-1}function o(t,e,r){k.lastIndex=0;var n=k.exec(e.slice(r));return n?(t.m=A.get(n[0].toLowerCase()),r+n[0].length):-1}function s(t,e,n){return r(t,E.c.toString(),e,n)}function l(t,e,n){return r(t,E.x.toString(),e,n)}function u(t,e,n){return r(t,E.X.toString(),e,n)}function c(t,e,r){var n=b.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)}var h=t.dateTime,f=t.date,d=t.time,p=t.periods,m=t.days,g=t.shortDays,v=t.months,y=t.shortMonths;e.utc=function(t){function r(t){try{var e=new(hs=Bt);return e._=t,n(e)}finally{hs=Date}}var n=e(t);return r.parse=function(t){try{hs=Bt;var e=n.parse(t);return e&&e._}finally{hs=Date}},r.toString=n.toString,r},e.multi=e.utc.multi=ue;var b=so.map(),x=Gt(m),_=Yt(m),w=Gt(g),M=Yt(g),k=Gt(v),A=Yt(v),T=Gt(y),S=Yt(y);p.forEach(function(t,e){b.set(t.toLowerCase(),e)});var E={a:function(t){return g[t.getDay()]},A:function(t){return m[t.getDay()]},b:function(t){return y[t.getMonth()]},B:function(t){return v[t.getMonth()]},c:e(h),d:function(t,e){return qt(t.getDate(),e,2)},e:function(t,e){return qt(t.getDate(),e,2)},H:function(t,e){return qt(t.getHours(),e,2)},I:function(t,e){return qt(t.getHours()%12||12,e,2)},j:function(t,e){return qt(1+cs.dayOfYear(t),e,3)},L:function(t,e){return qt(t.getMilliseconds(),e,3)},m:function(t,e){return qt(t.getMonth()+1,e,2)},M:function(t,e){return qt(t.getMinutes(),e,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,e){return qt(t.getSeconds(),e,2)},U:function(t,e){return qt(cs.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return qt(cs.mondayOfYear(t),e,2)},x:e(f),X:e(d),y:function(t,e){return qt(t.getFullYear()%100,e,2)},Y:function(t,e){return qt(t.getFullYear()%1e4,e,4)},Z:se,\"%\":function(){return\"%\"}},L={a:n,A:i,b:a,B:o,c:s,d:ee,e:ee,H:ne,I:ne,j:re,L:oe,m:te,M:ie,p:c,S:ae,U:Xt,w:Wt,W:Zt,x:l,X:u,y:Qt,Y:Jt,Z:Kt,\"%\":le};return e}function qt(t,e,r){var n=t<0?\"-\":\"\",i=(n?-t:t)+\"\",a=i.length;return n+(a<r?new Array(r-a+1).join(e)+i:i)}function Gt(t){return new RegExp(\"^(?:\"+t.map(so.requote).join(\"|\")+\")\",\"i\")}function Yt(t){for(var e=new c,r=-1,n=t.length;++r<n;)e.set(t[r].toLowerCase(),r);return e}function Wt(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Xt(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r));return n?(t.U=+n[0],r+n[0].length):-1}function Zt(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r));return n?(t.W=+n[0],r+n[0].length):-1}function Jt(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Qt(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+2));return n?(t.y=$t(+n[0]),r+n[0].length):-1}function Kt(t,e,r){return/^[+-]\\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function $t(t){return t+(t>68?1900:2e3)}function te(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function ee(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function re(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function ne(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function ie(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function ae(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function oe(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function se(t){var e=t.getTimezoneOffset(),r=e>0?\"-\":\"+\",n=yo(e)/60|0,i=yo(e)%60;return r+qt(n,\"0\",2)+qt(i,\"0\",2)}function le(t,e,r){ms.lastIndex=0;var n=ms.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function ue(t){for(var e=t.length,r=-1;++r<e;)t[r][0]=this(t[r][0]);return function(e){for(var r=0,n=t[r];!n[1](e);)n=t[++r];return n[0](e)}}function ce(){}function he(t,e,r){var n=r.s=t+e,i=n-t,a=n-i;r.t=t-a+(e-i)}function fe(t,e){t&&bs.hasOwnProperty(t.type)&&bs[t.type](t,e)}function de(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 pe(t,e){var r=-1,n=t.length;for(e.polygonStart();++r<n;)de(t[r],e,1);e.polygonEnd()}function me(){function t(t,e){e=e*Uo/2+Ro/4;var r=(t*=Uo)-n,o=r>=0?1:-1,s=o*r,l=Math.cos(e),u=Math.sin(e),c=a*u,h=i*l+c*Math.cos(s),f=c*o*Math.sin(s);_s.add(Math.atan2(f,h)),n=t,i=l,a=u}var e,r,n,i,a;ws.point=function(o,s){ws.point=t,n=(e=o)*Uo,i=Math.cos(s=(r=s)*Uo/2+Ro/4),a=Math.sin(s)},ws.lineEnd=function(){t(e,r)}}function ge(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 ve(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ye(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function be(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function xe(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function _e(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 we(t){return[Math.atan2(t[1],t[0]),rt(t[2])]}function Me(t,e){return yo(t[0]-e[0])<Oo&&yo(t[1]-e[1])<Oo}function ke(t,e){t*=Uo;var r=Math.cos(e*=Uo);Ae(r*Math.cos(t),r*Math.sin(t),Math.sin(e))}function Ae(t,e,r){As+=(t-As)/++Ms,Ts+=(e-Ts)/Ms,Ss+=(r-Ss)/Ms}function Te(){function t(t,i){t*=Uo;var a=Math.cos(i*=Uo),o=a*Math.cos(t),s=a*Math.sin(t),l=Math.sin(i),u=Math.atan2(Math.sqrt((u=r*l-n*s)*u+(u=n*o-e*l)*u+(u=e*s-r*o)*u),e*o+r*s+n*l);ks+=u,Es+=u*(e+(e=o)),Ls+=u*(r+(r=s)),Cs+=u*(n+(n=l)),Ae(e,r,n)}var e,r,n;Ps.point=function(i,a){i*=Uo;var o=Math.cos(a*=Uo);e=o*Math.cos(i),r=o*Math.sin(i),n=Math.sin(a),Ps.point=t,Ae(e,r,n)}}function Se(){Ps.point=ke}function Ee(){function t(t,e){t*=Uo;var r=Math.cos(e*=Uo),o=r*Math.cos(t),s=r*Math.sin(t),l=Math.sin(e),u=i*l-a*s,c=a*o-n*l,h=n*s-i*o,f=Math.sqrt(u*u+c*c+h*h),d=n*o+i*s+a*l,p=f&&-et(d)/f,m=Math.atan2(f,d);zs+=p*u,Ds+=p*c,Is+=p*h,ks+=m,Es+=m*(n+(n=o)),Ls+=m*(i+(i=s)),Cs+=m*(a+(a=l)),Ae(n,i,a)}var e,r,n,i,a;Ps.point=function(o,s){e=o,r=s,Ps.point=t,o*=Uo;var l=Math.cos(s*=Uo);n=l*Math.cos(o),i=l*Math.sin(o),a=Math.sin(s),Ae(n,i,a)},Ps.lineEnd=function(){t(e,r),Ps.lineEnd=Se,Ps.point=ke}}function Le(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 Ce(){return!0}function ze(t,e,r,n,i){var a=[],o=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,r=t[0],n=t[e];if(Me(r,n)){i.lineStart();for(var s=0;s<e;++s)i.point((r=t[s])[0],r[1]);return void i.lineEnd()}var l=new Ie(r,t,null,!0),u=new Ie(r,null,l,!1);l.o=u,a.push(l),o.push(u),u=new Ie(n,null,l=new Ie(n,t,null,!1),!0),l.o=u,a.push(l),o.push(u)}}),o.sort(e),De(a),De(o),a.length){for(var s=0,l=r,u=o.length;s<u;++s)o[s].e=l=!l;for(var c,h,f=a[0];;){for(var d=f,p=!0;d.v;)if((d=d.n)===f)return;c=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(p)for(var s=0,u=c.length;s<u;++s)i.point((h=c[s])[0],h[1]);else n(d.x,d.n.x,1,i);d=d.n}else{if(p)for(s=(c=d.p.z).length-1;s>=0;--s)i.point((h=c[s])[0],h[1]);else n(d.x,d.p.x,-1,i);d=d.p}c=(d=d.o).z,p=!p}while(!d.v);i.lineEnd()}}}function De(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n<e;)i.n=r=t[n],r.p=i,i=r;i.n=r=t[0],r.p=i}}function Ie(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 Pe(t,e,r,n){return function(i,a){function o(e,r){var n=i(e,r);t(e=n[0],r=n[1])&&a.point(e,r)}function s(t,e){var r=i(t,e);g.point(r[0],r[1])}function l(){y.point=s,g.lineStart()}function u(){y.point=o,g.lineEnd()}function c(t,e){m.push([t,e]);var r=i(t,e);x.point(r[0],r[1])}function h(){x.lineStart(),m=[]}function f(){c(m[0][0],m[0][1]),x.lineEnd();var t,e=x.clean(),r=b.buffer(),n=r.length;if(m.pop(),p.push(m),m=null,n)if(1&e){var i,o=-1;if((n=(t=r[0]).length-1)>0){for(_||(a.polygonStart(),_=!0),a.lineStart();++o<n;)a.point((i=t[o])[0],i[1]);a.lineEnd()}}else n>1&&2&e&&r.push(r.pop().concat(r.shift())),d.push(r.filter(Oe))}var d,p,m,g=e(a),v=i.invert(n[0],n[1]),y={point:o,lineStart:l,lineEnd:u,polygonStart:function(){y.point=c,y.lineStart=h,y.lineEnd=f,d=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=l,y.lineEnd=u,d=so.merge(d);var t=Ue(v,p);d.length?(_||(a.polygonStart(),_=!0),ze(d,Re,t,r,a)):t&&(_||(a.polygonStart(),_=!0),a.lineStart(),r(null,null,1,a),a.lineEnd()),_&&(a.polygonEnd(),_=!1),d=p=null},sphere:function(){a.polygonStart(),a.lineStart(),r(null,null,1,a),a.lineEnd(),a.polygonEnd()}},b=je(),x=e(b),_=!1;return y}}function Oe(t){return t.length>1}function je(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:w,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Re(t,e){return((t=t.x)[0]<0?t[1]-Bo-Oo:Bo-t[1])-((e=e.x)[0]<0?e[1]-Bo-Oo:Bo-e[1])}function Fe(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?Ro:-Ro,l=yo(a-r);yo(l-Ro)<Oo?(t.point(r,n=(n+o)/2>0?Bo:-Bo),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=Ro&&(yo(r-i)<Oo&&(r-=i*Oo),yo(a-s)<Oo&&(a-=s*Oo),n=Ne(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 Ne(t,e,r,n){var i,a,o=Math.sin(t-r);return yo(o)>Oo?Math.atan((Math.sin(e)*(a=Math.cos(n))*Math.sin(r)-Math.sin(n)*(i=Math.cos(e))*Math.sin(t))/(i*a*o)):(e+n)/2}function Be(t,e,r,n){var i;if(null==t)i=r*Bo,n.point(-Ro,i),n.point(0,i),n.point(Ro,i),n.point(Ro,0),n.point(Ro,-i),n.point(0,-i),n.point(-Ro,-i),n.point(-Ro,0),n.point(-Ro,i);else if(yo(t[0]-e[0])>Oo){var a=t[0]<e[0]?Ro:-Ro;i=r*a/2,n.point(-a,i),n.point(0,i),n.point(a,i)}else n.point(e[0],e[1])}function Ue(t,e){var r=t[0],n=t[1],i=[Math.sin(r),-Math.cos(r),0],a=0,o=0;_s.reset();for(var s=0,l=e.length;s<l;++s){var u=e[s],c=u.length;if(c)for(var h=u[0],f=h[0],d=h[1]/2+Ro/4,p=Math.sin(d),m=Math.cos(d),g=1;;){g===c&&(g=0);var v=(t=u[g])[0],y=t[1]/2+Ro/4,b=Math.sin(y),x=Math.cos(y),_=v-f,w=_>=0?1:-1,M=w*_,k=M>Ro,A=p*b;if(_s.add(Math.atan2(A*w*Math.sin(M),m*x+A*Math.cos(M))),a+=k?_+w*Fo:_,k^f>=r^v>=r){var T=ye(ge(h),ge(t));_e(T);var S=ye(i,T);_e(S);var E=(k^_>=0?-1:1)*rt(S[2]);(n>E||n===E&&(T[0]||T[1]))&&(o+=k^_>=0?1:-1)}if(!g++)break;f=v,p=b,m=x,h=t}}return(a<-Oo||a<Oo&&_s<-Oo)^1&o}function Ve(t){function e(t,e){return Math.cos(t)*Math.cos(e)>a}function r(t){var r,a,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(h,f){var d,p=[h,f],m=e(h,f),g=o?m?0:i(h,f):m?i(h+(h<0?Ro:-Ro),f):0;if(!r&&(u=l=m)&&t.lineStart(),m!==l&&(d=n(r,p),(Me(r,d)||Me(p,d))&&(p[0]+=Oo,p[1]+=Oo,m=e(p[0],p[1]))),m!==l)c=0,m?(t.lineStart(),d=n(p,r),t.point(d[0],d[1])):(d=n(r,p),t.point(d[0],d[1]),t.lineEnd()),r=d;else if(s&&r&&o^m){var v;g&a||!(v=n(p,r,!0))||(c=0,o?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!m||r&&Me(r,p)||t.point(p[0],p[1]),r=p,l=m,a=g},lineEnd:function(){l&&t.lineEnd(),r=null},clean:function(){return c|(u&&l)<<1}}}function n(t,e,r){var n=[1,0,0],i=ye(ge(t),ge(e)),o=ve(i,i),s=i[0],l=o-s*s;if(!l)return!r&&t;var u=a*o/l,c=-a*s/l,h=ye(n,i),f=xe(n,u);be(f,xe(i,c));var d=h,p=ve(f,d),m=ve(d,d),g=p*p-m*(ve(f,f)-1);if(!(g<0)){var v=Math.sqrt(g),y=xe(d,(-p-v)/m);if(be(y,f),y=we(y),!r)return y;var b,x=t[0],_=e[0],w=t[1],M=e[1];_<x&&(b=x,x=_,_=b);var k=_-x,A=yo(k-Ro)<Oo,T=A||k<Oo;if(!A&&M<w&&(b=w,w=M,M=b),T?A?w+M>0^y[1]<(yo(y[0]-x)<Oo?w:M):w<=y[1]&&y[1]<=M:k>Ro^(x<=y[0]&&y[0]<=_)){var S=xe(d,(-p+v)/m);return be(S,f),[y,we(S)]}}}function i(e,r){var n=o?t:Ro-t,i=0;return e<-n?i|=1:e>n&&(i|=2),r<-n?i|=4:r>n&&(i|=8),i}var a=Math.cos(t),o=a>0,s=yo(a)>Oo;return Pe(e,r,mr(t,6*Uo),o?[0,-t]:[-Ro,t-Ro])}function He(t,e,r,n){return function(i){var a,o=i.a,s=i.b,l=o.x,u=o.y,c=0,h=1,f=s.x-l,d=s.y-u;if(a=t-l,f||!(a>0)){if(a/=f,f<0){if(a<c)return;a<h&&(h=a)}else if(f>0){if(a>h)return;a>c&&(c=a)}if(a=r-l,f||!(a<0)){if(a/=f,f<0){if(a>h)return;a>c&&(c=a)}else if(f>0){if(a<c)return;a<h&&(h=a)}if(a=e-u,d||!(a>0)){if(a/=d,d<0){if(a<c)return;a<h&&(h=a)}else if(d>0){if(a>h)return;a>c&&(c=a)}if(a=n-u,d||!(a<0)){if(a/=d,d<0){if(a>h)return;a>c&&(c=a)}else if(d>0){if(a<c)return;a<h&&(h=a)}return c>0&&(i.a={x:l+c*f,y:u+c*d}),h<1&&(i.b={x:l+h*f,y:u+h*d}),i}}}}}}function qe(t,e,r,n){function i(n,i){return yo(n[0]-t)<Oo?i>0?0:3:yo(n[0]-r)<Oo?i>0?2:1:yo(n[1]-e)<Oo?i>0?1:0:i>0?3:2}function a(t,e){return o(t.x,e.x)}function o(t,e){var r=i(t,1),n=i(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(s){function l(t){for(var e=0,r=g.length,n=t[1],i=0;i<r;++i)for(var a,o=1,s=g[i],l=s.length,u=s[0];o<l;++o)a=s[o],u[1]<=n?a[1]>n&&tt(u,a,t)>0&&++e:a[1]<=n&&tt(u,a,t)<0&&--e,u=a;return 0!==e}function u(a,s,l,u){var c=0,h=0;if(null==a||(c=i(a,l))!==(h=i(s,l))||o(a,s)<0^l>0)do{u.point(0===c||3===c?t:r,c>1?n:e)}while((c=(c+l+4)%4)!==h);else u.point(s[0],s[1])}function c(i,a){return t<=i&&i<=r&&e<=a&&a<=n}function h(t,e){c(t,e)&&s.point(t,e)}function f(){L.point=p,g&&g.push(v=[]),k=!0,M=!1,_=w=NaN}function d(){m&&(p(y,b),x&&M&&S.rejoin(),m.push(S.buffer())),L.point=h,M&&s.lineEnd()}function p(t,e){var r=c(t=Math.max(-js,Math.min(js,t)),e=Math.max(-js,Math.min(js,e)));if(g&&v.push([t,e]),k)y=t,b=e,x=r,k=!1,r&&(s.lineStart(),s.point(t,e));else if(r&&M)s.point(t,e);else{var n={a:{x:_,y:w},b:{x:t,y:e}};E(n)?(M||(s.lineStart(),s.point(n.a.x,n.a.y)),s.point(n.b.x,n.b.y),r||s.lineEnd(),A=!1):r&&(s.lineStart(),s.point(t,e),A=!1)}_=t,w=e,M=r}var m,g,v,y,b,x,_,w,M,k,A,T=s,S=je(),E=He(t,e,r,n),L={point:h,lineStart:f,lineEnd:d,polygonStart:function(){s=S,m=[],g=[],A=!0},polygonEnd:function(){s=T,m=so.merge(m);var e=l([t,n]),r=A&&e,i=m.length;(r||i)&&(s.polygonStart(),r&&(s.lineStart(),u(null,null,1,s),s.lineEnd()),i&&ze(m,a,e,u,s),s.polygonEnd()),m=g=v=null}};return L}}function Ge(t){var e=0,r=Ro/3,n=sr(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*Ro/180,r=t[1]*Ro/180):[e/Ro*180,r/Ro*180]},i}function Ye(t,e){function r(t,e){var r=Math.sqrt(a-2*i*Math.sin(e))/i;return[r*Math.sin(t*=i),o-r*Math.cos(t)]}var n=Math.sin(t),i=(n+Math.sin(e))/2,a=1+n*(2*i-n),o=Math.sqrt(a)/i;return r.invert=function(t,e){var r=o-e;return[Math.atan2(t,r)/i,rt((a-(t*t+r*r)*i*i)/(2*i))]},r}function We(){function t(t,e){Fs+=i*t-n*e,n=t,i=e}var e,r,n,i;Hs.point=function(a,o){Hs.point=t,e=n=a,r=i=o},Hs.lineEnd=function(){t(e,r)}}function Xe(t,e){t<Ns&&(Ns=t),t>Us&&(Us=t),e<Bs&&(Bs=e),e>Vs&&(Vs=e)}function Ze(){function t(t,e){o.push(\"M\",t,\",\",e,a)}function e(t,e){o.push(\"M\",t,\",\",e),s.point=r}function r(t,e){o.push(\"L\",t,\",\",e)}function n(){s.point=t}function i(){o.push(\"Z\")}var a=Je(4.5),o=[],s={point:t,lineStart:function(){s.point=e},lineEnd:n,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=n,s.point=t},pointRadius:function(t){return a=Je(t),s},result:function(){if(o.length){var t=o.join(\"\");return o=[],t}}};return s}function Je(t){return\"m0,\"+t+\"a\"+t+\",\"+t+\" 0 1,1 0,\"+-2*t+\"a\"+t+\",\"+t+\" 0 1,1 0,\"+2*t+\"z\"}function Qe(t,e){As+=t,Ts+=e,++Ss}function Ke(){function t(t,n){var i=t-e,a=n-r,o=Math.sqrt(i*i+a*a);Es+=o*(e+t)/2,Ls+=o*(r+n)/2,Cs+=o,Qe(e=t,r=n)}var e,r;Gs.point=function(n,i){Gs.point=t,Qe(e=n,r=i)}}function $e(){Gs.point=Qe}function tr(){function t(t,e){var r=t-n,a=e-i,o=Math.sqrt(r*r+a*a);Es+=o*(n+t)/2,Ls+=o*(i+e)/2,Cs+=o,zs+=(o=i*t-n*e)*(n+t),Ds+=o*(i+e),Is+=3*o,Qe(n=t,i=e)}var e,r,n,i;Gs.point=function(a,o){Gs.point=t,Qe(e=n=a,r=i=o)},Gs.lineEnd=function(){t(e,r)}}function er(t){function e(e,r){t.moveTo(e+o,r),t.arc(e,r,o,0,Fo)}function r(e,r){t.moveTo(e,r),s.point=n}function n(e,r){t.lineTo(e,r)}function i(){s.point=e}function a(){t.closePath()}var o=4.5,s={point:e,lineStart:function(){s.point=r},lineEnd:i,polygonStart:function(){s.lineEnd=a},polygonEnd:function(){s.lineEnd=i,s.point=e},pointRadius:function(t){return o=t,s},result:w};return s}function rr(t){function e(t){return(s?n:r)(t)}function r(e){return ar(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})}function n(e){function r(r,n){r=t(r,n),e.point(r[0],r[1])}function n(){b=NaN,k.point=a,e.lineStart()}function a(r,n){var a=ge([r,n]),o=t(r,n);i(b,x,y,_,w,M,b=o[0],x=o[1],y=r,_=a[0],w=a[1],M=a[2],s,e),e.point(b,x)}function o(){k.point=r,e.lineEnd()}function l(){n(),k.point=u,k.lineEnd=c}function u(t,e){a(h=t,f=e),d=b,p=x,m=_,g=w,v=M,k.point=a}function c(){i(b,x,y,_,w,M,d,p,h,m,g,v,s,e),k.lineEnd=o,o()}var h,f,d,p,m,g,v,y,b,x,_,w,M,k={point:r,lineStart:n,lineEnd:o,polygonStart:function(){e.polygonStart(),k.lineStart=l},polygonEnd:function(){e.polygonEnd(),k.lineStart=n}};return k}function i(e,r,n,s,l,u,c,h,f,d,p,m,g,v){var y=c-e,b=h-r,x=y*y+b*b;if(x>4*a&&g--){var _=s+d,w=l+p,M=u+m,k=Math.sqrt(_*_+w*w+M*M),A=Math.asin(M/=k),T=yo(yo(M)-1)<Oo||yo(n-f)<Oo?(n+f)/2:Math.atan2(w,_),S=t(T,A),E=S[0],L=S[1],C=E-e,z=L-r,D=b*C-y*z;(D*D/x>a||yo((y*C+b*z)/x-.5)>.3||s*d+l*p+u*m<o)&&(i(e,r,n,s,l,u,E,L,T,_/=k,w/=k,M,g,v),v.point(E,L),i(E,L,T,_,w,M,c,h,f,d,p,m,g,v))}}var a=.5,o=Math.cos(30*Uo),s=16;return e.precision=function(t){return arguments.length?(s=(a=t*t)>0&&16,e):Math.sqrt(a)},e}function nr(t){var e=rr(function(e,r){return t([e*Vo,r*Vo])});return function(t){return lr(e(t))}}function ir(t){this.stream=t}function ar(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 or(t){return sr(function(){return t})()}function sr(t){function e(t){return t=s(t[0]*Uo,t[1]*Uo),[t[0]*f+l,u-t[1]*f]}function r(t){return(t=s.invert((t[0]-l)/f,(u-t[1])/f))&&[t[0]*Vo,t[1]*Vo]}function n(){s=Le(o=hr(v,y,x),a);var t=a(m,g);return l=d-t[0]*f,u=p+t[1]*f,i()}function i(){return c&&(c.valid=!1,c=null),e}var a,o,s,l,u,c,h=rr(function(t,e){return t=a(t,e),[t[0]*f+l,u-t[1]*f]}),f=150,d=480,p=250,m=0,g=0,v=0,y=0,x=0,_=Os,w=b,M=null,k=null;return e.stream=function(t){return c&&(c.valid=!1),c=lr(_(o,h(w(t)))),c.valid=!0,c},e.clipAngle=function(t){return arguments.length?(_=null==t?(M=t,Os):Ve((M=+t)*Uo),i()):M},e.clipExtent=function(t){return arguments.length?(k=t,w=t?qe(t[0][0],t[0][1],t[1][0],t[1][1]):b,i()):k},e.scale=function(t){return arguments.length?(f=+t,n()):f},e.translate=function(t){return arguments.length?(d=+t[0],p=+t[1],n()):[d,p]},e.center=function(t){return arguments.length?(m=t[0]%360*Uo,g=t[1]%360*Uo,n()):[m*Vo,g*Vo]},e.rotate=function(t){return arguments.length?(v=t[0]%360*Uo,y=t[1]%360*Uo,x=t.length>2?t[2]%360*Uo:0,n()):[v*Vo,y*Vo,x*Vo]},so.rebind(e,h,\"precision\"),function(){return a=t.apply(this,arguments),e.invert=a.invert&&r,n()}}function lr(t){return ar(t,function(e,r){t.point(e*Uo,r*Uo)})}function ur(t,e){return[t,e]}function cr(t,e){return[t>Ro?t-Fo:t<-Ro?t+Fo:t,e]}function hr(t,e,r){return t?e||r?Le(dr(t),pr(e,r)):dr(t):e||r?pr(e,r):cr}function fr(t){return function(e,r){return e+=t,[e>Ro?e-Fo:e<-Ro?e+Fo:e,r]}}function dr(t){var e=fr(t);return e.invert=fr(-t),e}function pr(t,e){function r(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,u=Math.sin(e),c=u*n+s*i;return[Math.atan2(l*a-c*o,s*n-u*i),rt(c*a+l*o)]}var n=Math.cos(t),i=Math.sin(t),a=Math.cos(e),o=Math.sin(e);return r.invert=function(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,u=Math.sin(e),c=u*a-l*o;return[Math.atan2(l*a+u*o,s*n+c*i),rt(c*n-s*i)]},r}function mr(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=gr(r,i),a=gr(r,a),(o>0?i<a:i>a)&&(i+=o*Fo)):(i=t+o*Fo,a=t-.5*l);for(var u,c=i;o>0?c>a:c<a;c-=l)s.point((u=we([r,-n*Math.cos(c),-n*Math.sin(c)]))[0],u[1])}}function gr(t,e){var r=ge(e);r[0]-=t,_e(r);var n=et(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-Oo)%(2*Math.PI)}function vr(t,e,r){var n=so.range(t,e-Oo,r).concat(e);return function(t){return n.map(function(e){return[t,e]})}}function yr(t,e,r){var n=so.range(t,e-Oo,r).concat(e);return function(t){return n.map(function(e){return[e,t]})}}function br(t){return t.source}function xr(t){return t.target}function _r(t,e,r,n){var i=Math.cos(e),a=Math.sin(e),o=Math.cos(n),s=Math.sin(n),l=i*Math.cos(t),u=i*Math.sin(t),c=o*Math.cos(r),h=o*Math.sin(r),f=2*Math.asin(Math.sqrt(ot(n-e)+i*o*ot(r-t))),d=1/Math.sin(f),p=f?function(t){var e=Math.sin(t*=f)*d,r=Math.sin(f-t)*d,n=r*l+e*c,i=r*u+e*h,o=r*a+e*s;return[Math.atan2(i,n)*Vo,Math.atan2(o,Math.sqrt(n*n+i*i))*Vo]}:function(){return[t*Vo,e*Vo]};return p.distance=f,p}function wr(){function t(t,i){var a=Math.sin(i*=Uo),o=Math.cos(i),s=yo((t*=Uo)-e),l=Math.cos(s);Ys+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=n*a-r*o*l)*s),r*a+n*o*l),e=t,r=a,n=o}var e,r,n;Ws.point=function(i,a){e=i*Uo,r=Math.sin(a*=Uo),n=Math.cos(a),Ws.point=t},Ws.lineEnd=function(){Ws.point=Ws.lineEnd=w}}function Mr(t,e){function r(e,r){var n=Math.cos(e),i=Math.cos(r),a=t(n*i);return[a*i*Math.sin(e),a*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),i=e(n),a=Math.sin(i),o=Math.cos(i);return[Math.atan2(t*a,n*o),Math.asin(n&&r*a/n)]},r}function kr(t,e){function r(t,e){o>0?e<-Bo+Oo&&(e=-Bo+Oo):e>Bo-Oo&&(e=Bo-Oo);var r=o/Math.pow(i(e),a);return[r*Math.sin(a*t),o-r*Math.cos(a*t)]}var n=Math.cos(t),i=function(t){return Math.tan(Ro/4+t/2)},a=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(i(e)/i(t)),o=n*Math.pow(i(t),a)/a;return a?(r.invert=function(t,e){var r=o-e,n=$(a)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/a,2*Math.atan(Math.pow(o/n,1/a))-Bo]},r):Tr}function Ar(t,e){function r(t,e){var r=a-e;return[r*Math.sin(i*t),a-r*Math.cos(i*t)]}var n=Math.cos(t),i=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),a=n/i+t;return yo(i)<Oo?ur:(r.invert=function(t,e){var r=a-e;return[Math.atan2(t,r)/i,a-$(i)*Math.sqrt(t*t+r*r)]},r)}function Tr(t,e){return[t,Math.log(Math.tan(Ro/4+e/2))]}function Sr(t){var e,r=or(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=Ro*n(),l=i();a([[l[0]-s,l[1]-s],[l[0]+s,l[1]+s]])}}else e&&(o=null);return o},r.clipExtent(null)}function Er(t,e){return[Math.log(Math.tan(Ro/4+e/2)),-t]}function Lr(t){return t[0]}function Cr(t){return t[1]}function zr(t){for(var e=t.length,r=[0,1],n=2,i=2;i<e;i++){for(;n>1&&tt(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function Dr(t,e){return t[0]-e[0]||t[1]-e[1]}function Ir(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function Pr(t,e,r,n){var i=t[0],a=r[0],o=e[0]-i,s=n[0]-a,l=t[1],u=r[1],c=e[1]-l,h=n[1]-u,f=(s*(l-u)-h*(i-a))/(h*o-s*c);return[i+f*o,l+f*c]}function Or(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}function jr(){nn(this),this.edge=this.site=this.circle=null}function Rr(t){var e=al.pop()||new jr;return e.site=t,e}function Fr(t){Xr(t),rl.remove(t),al.push(t),nn(t)}function Nr(t){var e=t.circle,r=e.x,n=e.cy,i={x:r,y:n},a=t.P,o=t.N,s=[t];Fr(t);for(var l=a;l.circle&&yo(r-l.circle.x)<Oo&&yo(n-l.circle.cy)<Oo;)a=l.P,s.unshift(l),Fr(l),l=a;s.unshift(l),Xr(l);for(var u=o;u.circle&&yo(r-u.circle.x)<Oo&&yo(n-u.circle.cy)<Oo;)o=u.N,s.push(u),Fr(u),u=o;s.push(u),Xr(u);var c,h=s.length;for(c=1;c<h;++c)u=s[c],l=s[c-1],tn(u.edge,l.site,u.site,i);l=s[0],(u=s[h-1]).edge=Kr(l.site,u.site,null,i),Wr(l),Wr(u)}function Br(t){for(var e,r,n,i,a=t.x,o=t.y,s=rl._;s;)if((n=Ur(s,o)-a)>Oo)s=s.L;else{if(!((i=a-Vr(s,o))>Oo)){n>-Oo?(e=s.P,r=s):i>-Oo?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=Rr(t);if(rl.insert(e,l),e||r){if(e===r)return Xr(e),r=Rr(e.site),rl.insert(l,r),l.edge=r.edge=Kr(e.site,l.site),Wr(e),void Wr(r);if(r){Xr(e),Xr(r);var u=e.site,c=u.x,h=u.y,f=t.x-c,d=t.y-h,p=r.site,m=p.x-c,g=p.y-h,v=2*(f*g-d*m),y=f*f+d*d,b=m*m+g*g,x={x:(g*y-d*b)/v+c,y:(f*b-m*y)/v+h};tn(r.edge,u,p,x),l.edge=Kr(u,t,null,x),r.edge=Kr(t,p,null,x),Wr(e),Wr(r)}else l.edge=Kr(e.site,l.site)}}function Ur(t,e){var r=t.site,n=r.x,i=r.y,a=i-e;if(!a)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,u=l-e;if(!u)return s;var c=s-n,h=1/a-1/u,f=c/u;return h?(-f+Math.sqrt(f*f-2*h*(c*c/(-2*u)-l+u/2+i-a/2)))/h+n:(n+s)/2}function Vr(t,e){var r=t.N;if(r)return Ur(r,e);var n=t.site;return n.y===e?n.x:1/0}function Hr(t){this.site=t,this.edges=[]}function qr(t){for(var e,r,n,i,a,o,s,l,u,c,h=t[0][0],f=t[1][0],d=t[0][1],p=t[1][1],m=el,g=m.length;g--;)if((a=m[g])&&a.prepare())for(l=(s=a.edges).length,o=0;o<l;)n=(c=s[o].end()).x,i=c.y,e=(u=s[++o%l].start()).x,r=u.y,(yo(n-e)>Oo||yo(i-r)>Oo)&&(s.splice(o,0,new en($r(a.site,c,yo(n-h)<Oo&&p-i>Oo?{x:h,y:yo(e-h)<Oo?r:p}:yo(i-p)<Oo&&f-n>Oo?{x:yo(r-p)<Oo?e:f,y:p}:yo(n-f)<Oo&&i-d>Oo?{x:f,y:yo(e-f)<Oo?r:d}:yo(i-d)<Oo&&n-h>Oo?{x:yo(r-d)<Oo?e:h,y:d}:null),a.site,null)),++l)}function Gr(t,e){return e.angle-t.angle}function Yr(){nn(this),this.x=this.y=this.arc=this.site=this.cy=null}function Wr(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,i=t.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,u=n.y-s,c=a.x-o,h=2*(l*(g=a.y-s)-u*c);if(!(h>=-jo)){var f=l*l+u*u,d=c*c+g*g,p=(g*f-u*d)/h,m=(l*d-c*f)/h,g=m+s,v=ol.pop()||new Yr;v.arc=t,v.site=i,v.x=p+o,v.y=g+Math.sqrt(p*p+m*m),v.cy=g,t.circle=v;for(var y=null,b=il._;b;)if(v.y<b.y||v.y===b.y&&v.x<=b.x){if(!b.L){y=b.P;break}b=b.L}else{if(!b.R){y=b;break}b=b.R}il.insert(y,v),y||(nl=v)}}}}function Xr(t){var e=t.circle;e&&(e.P||(nl=e.N),il.remove(e),ol.push(e),nn(e),t.circle=null)}function Zr(t){for(var e,r=tl,n=He(t[0][0],t[0][1],t[1][0],t[1][1]),i=r.length;i--;)(!Jr(e=r[i],t)||!n(e)||yo(e.a.x-e.b.x)<Oo&&yo(e.a.y-e.b.y)<Oo)&&(e.a=e.b=null,r.splice(i,1))}function Jr(t,e){var r=t.b;if(r)return!0;var n,i,a=t.a,o=e[0][0],s=e[1][0],l=e[0][1],u=e[1][1],c=t.l,h=t.r,f=c.x,d=c.y,p=h.x,m=h.y,g=(f+p)/2,v=(d+m)/2;if(m===d){if(g<o||g>=s)return;if(f>p){if(a){if(a.y>=u)return}else a={x:g,y:l};r={x:g,y:u}}else{if(a){if(a.y<l)return}else a={x:g,y:u};r={x:g,y:l}}}else if(n=(f-p)/(m-d),i=v-n*g,n<-1||n>1)if(f>p){if(a){if(a.y>=u)return}else a={x:(l-i)/n,y:l};r={x:(u-i)/n,y:u}}else{if(a){if(a.y<l)return}else a={x:(u-i)/n,y:u};r={x:(l-i)/n,y:l}}else if(d<m){if(a){if(a.x>=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.x<o)return}else a={x:s,y:n*s+i};r={x:o,y:n*o+i}}return t.a=a,t.b=r,!0}function Qr(t,e){this.l=t,this.r=e,this.a=this.b=null}function Kr(t,e,r,n){var i=new Qr(t,e);return tl.push(i),r&&tn(i,t,e,r),n&&tn(i,e,t,n),el[t.i].edges.push(new en(i,t,e)),el[e.i].edges.push(new en(i,e,t)),i}function $r(t,e,r){var n=new Qr(t,null);return n.a=e,n.b=r,tl.push(n),n}function tn(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 en(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 rn(){this._=null}function nn(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function an(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 on(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 sn(t){for(;t.L;)t=t.L;return t}function ln(t,e){var r,n,i,a=t.sort(un).pop();for(tl=[],el=new Array(t.length),rl=new rn,il=new rn;;)if(i=nl,a&&(!i||a.y<i.y||a.y===i.y&&a.x<i.x))a.x===r&&a.y===n||(el[a.i]=new Hr(a),Br(a),r=a.x,n=a.y),a=t.pop();else{if(!i)break;Nr(i.arc)}e&&(Zr(e),qr(e));var o={cells:el,edges:tl};return rl=il=tl=el=null,o}function un(t,e){return e.y-t.y||e.x-t.x}function cn(t,e,r){return(t.x-r.x)*(e.y-t.y)-(t.x-e.x)*(r.y-t.y)}function hn(t){return t.x}function fn(t){return t.y}function dn(t,e,r,n,i,a){if(!t(e,r,n,i,a)){var o=.5*(r+i),s=.5*(n+a),l=e.nodes;l[0]&&dn(t,l[0],r,n,o,s),l[1]&&dn(t,l[1],o,n,i,s),l[2]&&dn(t,l[2],r,s,o,a),l[3]&&dn(t,l[3],o,s,i,a)}}function pn(t,e,r,n,i,a,o){var s,l=1/0;return function t(u,c,h,f,d){if(!(c>a||h>o||f<n||d<i)){if(p=u.point){var p,m=e-u.x,g=r-u.y,v=m*m+g*g;if(v<l){var y=Math.sqrt(l=v);n=e-y,i=r-y,a=e+y,o=r+y,s=p}}for(var b=u.nodes,x=.5*(c+f),_=.5*(h+d),w=(r>=_)<<1|e>=x,M=w+4;w<M;++w)if(u=b[3&w])switch(3&w){case 0:t(u,c,h,x,_);break;case 1:t(u,x,h,f,_);break;case 2:t(u,c,_,x,d);break;case 3:t(u,x,_,f,d)}}}(t,n,i,a,o),s}function mn(t,e){t=so.rgb(t),e=so.rgb(e);var r=t.r,n=t.g,i=t.b,a=e.r-r,o=e.g-n,s=e.b-i;return function(t){return\"#\"+_t(Math.round(r+a*t))+_t(Math.round(n+o*t))+_t(Math.round(i+s*t))}}function gn(t,e){var r,n={},i={};for(r in t)r in e?n[r]=bn(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 vn(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function yn(t,e){var r,n,i,a=ll.lastIndex=ul.lastIndex=0,o=-1,s=[],l=[];for(t+=\"\",e+=\"\";(r=ll.exec(t))&&(n=ul.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:vn(r,n)})),a=ul.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?(e=l[0].x,function(t){return e(t)+\"\"}):function(){return e}:(e=l.length,function(t){for(var r,n=0;n<e;++n)s[(r=l[n]).i]=r.x(t);return s.join(\"\")})}function bn(t,e){for(var r,n=so.interpolators.length;--n>=0&&!(r=so.interpolators[n](t,e)););return r}function xn(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(bn(t[r],e[r]));for(;r<a;++r)i[r]=t[r];for(;r<o;++r)i[r]=e[r];return function(t){for(r=0;r<s;++r)i[r]=n[r](t);return i}}function _n(t){return function(e){return e<=0?0:e>=1?1:t(e)}}function wn(t){return function(e){return 1-t(1-e)}}function Mn(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function kn(t){return t*t}function An(t){return t*t*t}function Tn(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 Sn(t){return function(e){return Math.pow(e,t)}}function En(t){return 1-Math.cos(t*Bo)}function Ln(t){return Math.pow(2,10*(t-1))}function Cn(t){return 1-Math.sqrt(1-t*t)}function zn(t,e){var r;return arguments.length<2&&(e=.45),arguments.length?r=e/Fo*Math.asin(1/t):(t=1,r=e/4),function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*Fo/e)}}function Dn(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function In(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 Pn(t,e){t=so.hcl(t),e=so.hcl(e);var r=t.h,n=t.c,i=t.l,a=e.h-r,o=e.c-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.c:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return ht(r+a*t,n+o*t,i+s*t)+\"\"}}function On(t,e){t=so.hsl(t),e=so.hsl(e);var r=t.h,n=t.s,i=t.l,a=e.h-r,o=e.s-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.s:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return ut(r+a*t,n+o*t,i+s*t)+\"\"}}function jn(t,e){t=so.lab(t),e=so.lab(e);var r=t.l,n=t.a,i=t.b,a=e.l-r,o=e.a-n,s=e.b-i;return function(t){return dt(r+a*t,n+o*t,i+s*t)+\"\"}}function Rn(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function Fn(t){var e=[t.a,t.b],r=[t.c,t.d],n=Bn(e),i=Nn(e,r),a=Bn(Un(r,e,-i))||0;e[0]*r[1]<r[0]*e[1]&&(e[0]*=-1,e[1]*=-1,n*=-1,i*=-1),this.rotate=(n?Math.atan2(e[1],e[0]):Math.atan2(-r[0],r[1]))*Vo,this.translate=[t.e,t.f],this.scale=[n,a],this.skew=a?Math.atan2(i,a)*Vo:0}function Nn(t,e){return t[0]*e[0]+t[1]*e[1]}function Bn(t){var e=Math.sqrt(Nn(t,t));return e&&(t[0]/=e,t[1]/=e),e}function Un(t,e,r){return t[0]+=r*e[0],t[1]+=r*e[1],t}function Vn(t){return t.length?t.pop()+\",\":\"\"}function Hn(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:vn(t[0],e[0])},{i:i-2,x:vn(t[1],e[1])})}else(e[0]||e[1])&&r.push(\"translate(\"+e+\")\")}function qn(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(Vn(r)+\"rotate(\",null,\")\")-2,x:vn(t,e)})):e&&r.push(Vn(r)+\"rotate(\"+e+\")\")}function Gn(t,e,r,n){t!==e?n.push({i:r.push(Vn(r)+\"skewX(\",null,\")\")-2,x:vn(t,e)}):e&&r.push(Vn(r)+\"skewX(\"+e+\")\")}function Yn(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(Vn(r)+\"scale(\",null,\",\",null,\")\");n.push({i:i-4,x:vn(t[0],e[0])},{i:i-2,x:vn(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(Vn(r)+\"scale(\"+e+\")\")}function Wn(t,e){var r=[],n=[];return t=so.transform(t),e=so.transform(e),Hn(t.translate,e.translate,r,n),qn(t.rotate,e.rotate,r,n),Gn(t.skew,e.skew,r,n),Yn(t.scale,e.scale,r,n),t=e=null,function(t){for(var e,i=-1,a=n.length;++i<a;)r[(e=n[i]).i]=e.x(t);return r.join(\"\")}}function Xn(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function Zn(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function Jn(t){for(var e=t.source,r=t.target,n=Kn(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 Qn(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function Kn(t,e){if(t===e)return t;for(var r=Qn(t),n=Qn(e),i=r.pop(),a=n.pop(),o=null;i===a;)o=i,i=r.pop(),a=n.pop();return o}function $n(t){t.fixed|=2}function ti(t){t.fixed&=-7}function ei(t){t.fixed|=4,t.px=t.x,t.py=t.y}function ri(t){t.fixed&=-5}function ni(t,e,r){var n=0,i=0;if(t.charge=0,!t.leaf)for(var a,o=t.nodes,s=o.length,l=-1;++l<s;)null!=(a=o[l])&&(ni(a,e,r),t.charge+=a.charge,n+=a.charge*a.cx,i+=a.charge*a.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var u=e*r[t.point.index];t.charge+=t.pointCharge=u,n+=u*t.point.x,i+=u*t.point.y}t.cx=n/t.charge,t.cy=i/t.charge}function ii(t,e){return so.rebind(t,e,\"sort\",\"children\",\"value\"),t.nodes=t,t.links=ci,t}function ai(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 oi(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 si(t){return t.children}function li(t){return t.value}function ui(t,e){return e.value-t.value}function ci(t){return so.merge(t.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}function hi(t){return t.x}function fi(t){return t.y}function di(t,e,r){t.y0=e,t.y=r}function pi(t){return so.range(t.length)}function mi(t){for(var e=-1,r=t[0].length,n=[];++e<r;)n[e]=0;return n}function gi(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 vi(t){return t.reduce(yi,0)}function yi(t,e){return t+e[1]}function bi(t,e){return xi(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function xi(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 _i(t){return[so.min(t),so.max(t)]}function wi(t,e){return t.value-e.value}function Mi(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function ki(t,e){t._pack_next=e,e._pack_prev=t}function Ai(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 Ti(t){function e(t){c=Math.min(t.x-t.r,c),h=Math.max(t.x+t.r,h),f=Math.min(t.y-t.r,f),d=Math.max(t.y+t.r,d)}if((r=t.children)&&(u=r.length)){var r,n,i,a,o,s,l,u,c=1/0,h=-1/0,f=1/0,d=-1/0;if(r.forEach(Si),n=r[0],n.x=-n.r,n.y=0,e(n),u>1&&(i=r[1],i.x=i.r,i.y=0,e(i),u>2))for(Ci(n,i,a=r[2]),e(a),Mi(n,a),n._pack_prev=a,Mi(a,i),i=n._pack_next,o=3;o<u;o++){Ci(n,i,a=r[o]);var p=0,m=1,g=1;for(s=i._pack_next;s!==i;s=s._pack_next,m++)if(Ai(s,a)){p=1;break}if(1==p)for(l=n._pack_prev;l!==s._pack_prev&&!Ai(l,a);l=l._pack_prev,g++);p?(m<g||m==g&&i.r<n.r?ki(n,i=s):ki(n=l,i),o--):(Mi(n,a),i=a,e(a))}var v=(c+h)/2,y=(f+d)/2,b=0;for(o=0;o<u;o++)(a=r[o]).x-=v,a.y-=y,b=Math.max(b,a.r+Math.sqrt(a.x*a.x+a.y*a.y));t.r=b,r.forEach(Ei)}}function Si(t){t._pack_next=t._pack_prev=t}function Ei(t){delete t._pack_next,delete t._pack_prev}function Li(t,e,r,n){var i=t.children;if(t.x=e+=n*t.x,t.y=r+=n*t.y,t.r*=n,i)for(var a=-1,o=i.length;++a<o;)Li(i[a],e,r,n)}function Ci(t,e,r){var n=t.r+r.r,i=e.x-t.x,a=e.y-t.y;if(n&&(i||a)){var o=e.r+r.r,s=i*i+a*a,l=.5+((n*=n)-(o*=o))/(2*s),u=Math.sqrt(Math.max(0,2*o*(n+s)-(n-=s)*n-o*o))/(2*s);r.x=t.x+l*i+u*a,r.y=t.y+l*a-u*i}else r.x=t.x+n,r.y=t.y}function zi(t,e){return t.parent==e.parent?1:2}function Di(t){var e=t.children;return e.length?e[0]:t.t}function Ii(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function Pi(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 Oi(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}function ji(t,e,r){return t.a.parent===e.parent?t.a:r}function Ri(t){return 1+so.max(t,function(t){return t.y})}function Fi(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Ni(t){var e=t.children;return e&&e.length?Ni(e[0]):t}function Bi(t){var e,r=t.children;return r&&(e=r.length)?Bi(r[e-1]):t}function Ui(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Vi(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 Hi(t){var e=t[0],r=t[t.length-1];return e<r?[e,r]:[r,e]}function qi(t){return t.rangeExtent?t.rangeExtent():Hi(t.range())}function Gi(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 Yi(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 Wi(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:xl}function Xi(t,e,r,n){var i=[],a=[],o=0,s=Math.min(t.length,e.length)-1;for(t[s]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<=s;)i.push(r(t[o-1],t[o])),a.push(n(e[o-1],e[o]));return function(e){var r=so.bisect(t,e,1,s)-1;return a[r](i[r](e))}}function Zi(t,e,r,n){function i(){var i=Math.min(t.length,e.length)>2?Xi:Gi,l=n?Zn:Xn;return o=i(t,e,l,r),s=i(e,t,l,bn),a}function a(t){return o(t)}var o,s;return a.invert=function(t){return s(t)},a.domain=function(e){return arguments.length?(t=e.map(Number),i()):t},a.range=function(t){return arguments.length?(e=t,i()):e},a.rangeRound=function(t){return a.range(t).interpolate(Rn)},a.clamp=function(t){return arguments.length?(n=t,i()):n},a.interpolate=function(t){return arguments.length?(r=t,i()):r},a.ticks=function(e){return $i(t,e)},a.tickFormat=function(e,r){return ta(t,e,r)},a.nice=function(e){return Qi(t,e),i()},a.copy=function(){return Zi(t,e,r,n)},i()}function Ji(t,e){return so.rebind(t,e,\"range\",\"rangeRound\",\"interpolate\",\"clamp\")}function Qi(t,e){return Yi(t,Wi(Ki(t,e)[2])),Yi(t,Wi(Ki(t,e)[2])),t}function Ki(t,e){null==e&&(e=10);var r=Hi(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 $i(t,e){return so.range.apply(so,Ki(t,e))}function ta(t,e,r){var n=Ki(t,e);if(r){var i=ls.exec(r);if(i.shift(),\"s\"===i[8]){var a=so.formatPrefix(Math.max(yo(n[0]),yo(n[1])));return i[7]||(i[7]=\".\"+ea(a.scale(n[2]))),i[8]=\"f\",r=so.format(i.join(\"\")),function(t){return r(a.scale(t))+a.symbol}}i[7]||(i[7]=\".\"+ra(i[8],n)),r=i.join(\"\")}else r=\",.\"+ea(n[2])+\"f\";return so.format(r)}function ea(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function ra(t,e){var r=ea(e[2]);return t in _l?Math.abs(r-ea(Math.max(yo(e[0]),yo(e[1]))))+ +(\"e\"!==t):r-2*(\"%\"===t)}function na(t,e,r,n){function i(t){return(r?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function a(t){return r?Math.pow(e,t):-Math.pow(e,-t)}function o(e){return t(i(e))}return o.invert=function(e){return a(t.invert(e))},o.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((n=e.map(Number)).map(i)),o):n},o.base=function(r){return arguments.length?(e=+r,t.domain(n.map(i)),o):e},o.nice=function(){var e=Yi(n.map(i),r?Math:Ml);return t.domain(e),n=e.map(a),o},o.ticks=function(){var t=Hi(n),o=[],s=t[0],l=t[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),h=e%1?2:e;if(isFinite(c-u)){if(r){for(;u<c;u++)for(f=1;f<h;f++)o.push(a(u)*f);o.push(a(u))}else for(o.push(a(u));u++<c;)for(var f=h-1;f>0;f--)o.push(a(u)*f);for(u=0;o[u]<s;u++);for(c=o.length;o[c-1]>l;c--);o=o.slice(u,c)}return o},o.tickFormat=function(t,r){if(!arguments.length)return wl;arguments.length<2?r=wl:\"function\"!=typeof r&&(r=so.format(r));var n=Math.max(1,e*t/o.ticks().length);return function(t){var o=t/a(Math.round(i(t)));return o*e<e-.5&&(o*=e),o<=n?r(t):\"\"}},o.copy=function(){return na(t.copy(),e,r,n)},Ji(o,t)}function ia(t,e,r){function n(e){return t(i(e))}var i=aa(e),a=aa(1/e);return n.invert=function(e){return a(t.invert(e))},n.domain=function(e){return arguments.length?(t.domain((r=e.map(Number)).map(i)),n):r},n.ticks=function(t){return $i(r,t)},n.tickFormat=function(t,e){return ta(r,t,e)},n.nice=function(t){return n.domain(Qi(r,t))},n.exponent=function(o){return arguments.length?(i=aa(e=o),a=aa(1/e),t.domain(r.map(i)),n):e},n.copy=function(){return ia(t.copy(),e,r)},Ji(n,t)}function aa(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function oa(t,e){function r(r){return a[((i.get(r)||(\"range\"===e.t?i.set(r,t.push(r)):NaN))-1)%a.length]}function n(e,r){return so.range(t.length).map(function(t){return e+r*t})}var i,a,o;return r.domain=function(n){if(!arguments.length)return t;t=[],i=new c;for(var a,o=-1,s=n.length;++o<s;)i.has(a=n[o])||i.set(a,t.push(a));return r[e.t].apply(r,e.a)},r.range=function(t){return arguments.length?(a=t,o=0,e={t:\"range\",a:arguments},r):a},r.rangePoints=function(i,s){arguments.length<2&&(s=0);var l=i[0],u=i[1],c=t.length<2?(l=(l+u)/2,0):(u-l)/(t.length-1+s);return a=n(l+c*s/2,c),o=0,e={t:\"rangePoints\",a:arguments},r},r.rangeRoundPoints=function(i,s){arguments.length<2&&(s=0);var l=i[0],u=i[1],c=t.length<2?(l=u=Math.round((l+u)/2),0):(u-l)/(t.length-1+s)|0;return a=n(l+Math.round(c*s/2+(u-l-(t.length-1+s)*c)/2),c),o=0,e={t:\"rangeRoundPoints\",a:arguments},r},r.rangeBands=function(i,s,l){arguments.length<2&&(s=0),arguments.length<3&&(l=s);var u=i[1]<i[0],c=i[u-0],h=(i[1-u]-c)/(t.length-s+2*l);return a=n(c+h*l,h),u&&a.reverse(),o=h*(1-s),e={t:\"rangeBands\",a:arguments},r},r.rangeRoundBands=function(i,s,l){arguments.length<2&&(s=0),arguments.length<3&&(l=s);var u=i[1]<i[0],c=i[u-0],h=i[1-u],f=Math.floor((h-c)/(t.length-s+2*l));return a=n(c+Math.round((h-c-(t.length-s)*f)/2),f),u&&a.reverse(),o=Math.round(f*(1-s)),e={t:\"rangeRoundBands\",a:arguments},r},r.rangeBand=function(){return o},r.rangeExtent=function(){return Hi(e.a[0])},r.copy=function(){return oa(t,e)},r.domain(t)}function sa(t,e){function r(){var r=0,n=e.length;for(s=[];++r<n;)s[r-1]=so.quantile(t,r/n);return o}function o(t){if(!isNaN(t=+t))return e[so.bisect(s,t)]}var s;return o.domain=function(e){return arguments.length?(t=e.map(i).filter(a).sort(n),r()):t},o.range=function(t){return arguments.length?(e=t,r()):e},o.quantiles=function(){return s},o.invertExtent=function(r){return r=e.indexOf(r),r<0?[NaN,NaN]:[r>0?s[r-1]:t[0],r<s.length?s[r]:t[t.length-1]]},o.copy=function(){return sa(t,e)},r()}function la(t,e,r){function n(e){return r[Math.max(0,Math.min(o,Math.floor(a*(e-t))))]}function i(){return a=r.length/(e-t),o=r.length-1,n}var a,o;return n.domain=function(r){return arguments.length?(t=+r[0],e=+r[r.length-1],i()):[t,e]},n.range=function(t){return arguments.length?(r=t,i()):r},n.invertExtent=function(e){return e=r.indexOf(e),e=e<0?NaN:e/a+t,[e,e+1/a]},n.copy=function(){return la(t,e,r)},i()}function ua(t,e){function r(r){if(r<=r)return e[so.bisect(t,r)]}return r.domain=function(e){return arguments.length?(t=e,r):t},r.range=function(t){return arguments.length?(e=t,r):e},r.invertExtent=function(r){return r=e.indexOf(r),[t[r-1],t[r]]},r.copy=function(){return ua(t,e)},r}function ca(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(r){return arguments.length?(t=r.map(e),e):t},e.ticks=function(e){return $i(t,e)},e.tickFormat=function(e,r){return ta(t,e,r)},e.copy=function(){return ca(t)},e}function ha(){return 0}function fa(t){return t.innerRadius}function da(t){return t.outerRadius}function pa(t){return t.startAngle}function ma(t){return t.endAngle}function ga(t){return t&&t.padAngle}function va(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function ya(t,e,r,n,i){var a=t[0]-e[0],o=t[1]-e[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,u=-s*a,c=t[0]+l,h=t[1]+u,f=e[0]+l,d=e[1]+u,p=(c+f)/2,m=(h+d)/2,g=f-c,v=d-h,y=g*g+v*v,b=r-n,x=c*d-f*h,_=(v<0?-1:1)*Math.sqrt(Math.max(0,b*b*y-x*x)),w=(x*v-g*_)/y,M=(-x*g-v*_)/y,k=(x*v+g*_)/y,A=(-x*g+v*_)/y,T=w-p,S=M-m,E=k-p,L=A-m;return T*T+S*S>E*E+L*L&&(w=k,M=A),[[w-l,M-u],[w*r/b,M*r/b]]}function ba(t){function e(e){function o(){u.push(\"M\",a(t(c),s))}for(var l,u=[],c=[],h=-1,f=e.length,d=St(r),p=St(n);++h<f;)i.call(this,l=e[h],h)?c.push([+d.call(this,l,h),+p.call(this,l,h)]):c.length&&(o(),c=[]);return c.length&&o(),u.length?u.join(\"\"):null}var r=Lr,n=Cr,i=Ce,a=xa,o=a.key,s=.7;return e.x=function(t){return arguments.length?(r=t,e):r},e.y=function(t){return arguments.length?(n=t,e):n},e.defined=function(t){return arguments.length?(i=t,e):i},e.interpolate=function(t){return arguments.length?(o=\"function\"==typeof t?a=t:(a=Ll.get(t)||xa).key,e):o},e.tension=function(t){return arguments.length?(s=t,e):s},e}function xa(t){return t.length>1?t.join(\"L\"):t+\"Z\"}function _a(t){return t.join(\"L\")+\"Z\"}function wa(t){for(var e=0,r=t.length,n=t[0],i=[n[0],\",\",n[1]];++e<r;)i.push(\"H\",(n[0]+(n=t[e])[0])/2,\"V\",n[1]);return r>1&&i.push(\"H\",n[0]),i.join(\"\")}function Ma(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 ka(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 Aa(t,e){return t.length<4?xa(t):t[1]+Ea(t.slice(1,-1),La(t,e))}function Ta(t,e){return t.length<3?_a(t):t[0]+Ea((t.push(t[0]),t),La([t[t.length-2]].concat(t,[t[1]]),e))}function Sa(t,e){return t.length<3?xa(t):t[0]+Ea(t,La(t,e))}function Ea(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return xa(t);var r=t.length!=e.length,n=\"\",i=t[0],a=t[1],o=e[0],s=o,l=1;if(r&&(n+=\"Q\"+(a[0]-2*o[0]/3)+\",\"+(a[1]-2*o[1]/3)+\",\"+a[0]+\",\"+a[1],i=t[1],l=2),e.length>1){s=e[1],a=t[l],l++,n+=\"C\"+(i[0]+o[0])+\",\"+(i[1]+o[1])+\",\"+(a[0]-s[0])+\",\"+(a[1]-s[1])+\",\"+a[0]+\",\"+a[1];for(var u=2;u<e.length;u++,l++)a=t[l],s=e[u],n+=\"S\"+(a[0]-s[0])+\",\"+(a[1]-s[1])+\",\"+a[0]+\",\"+a[1]}if(r){var c=t[l];n+=\"Q\"+(a[0]+2*s[0]/3)+\",\"+(a[1]+2*s[1]/3)+\",\"+c[0]+\",\"+c[1]}return n}function La(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 Ca(t){if(t.length<3)return xa(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\",Pa(Dl,o),\",\",Pa(Dl,s)];for(t.push(t[r-1]);++e<=r;)n=t[e],o.shift(),o.push(n[0]),s.shift(),s.push(n[1]),Oa(l,o,s);return t.pop(),l.push(\"L\",n),l.join(\"\")}function za(t){if(t.length<4)return xa(t);for(var e,r=[],n=-1,i=t.length,a=[0],o=[0];++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);for(r.push(Pa(Dl,a)+\",\"+Pa(Dl,o)),--n;++n<i;)e=t[n],a.shift(),a.push(e[0]),o.shift(),o.push(e[1]),Oa(r,a,o);return r.join(\"\")}function Da(t){for(var e,r,n=-1,i=t.length,a=i+4,o=[],s=[];++n<4;)r=t[n%i],o.push(r[0]),s.push(r[1]);for(e=[Pa(Dl,o),\",\",Pa(Dl,s)],--n;++n<a;)r=t[n%i],o.shift(),o.push(r[0]),s.shift(),s.push(r[1]),Oa(e,o,s);return e.join(\"\")}function Ia(t,e){var r=t.length-1;if(r)for(var n,i,a=t[0][0],o=t[0][1],s=t[r][0]-a,l=t[r][1]-o,u=-1;++u<=r;)i=u/r,(n=t[u])[0]=e*n[0]+(1-e)*(a+i*s),n[1]=e*n[1]+(1-e)*(o+i*l);return Ca(t)}function Pa(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Oa(t,e,r){t.push(\"C\",Pa(Cl,e),\",\",Pa(Cl,r),\",\",Pa(zl,e),\",\",Pa(zl,r),\",\",Pa(Dl,e),\",\",Pa(Dl,r))}function ja(t,e){return(e[1]-t[1])/(e[0]-t[0])}function Ra(t){for(var e=0,r=t.length-1,n=[],i=t[0],a=t[1],o=n[0]=ja(i,a);++e<r;)n[e]=(o+(o=ja(i=a,a=t[e+1])))/2;return n[e]=o,n}function Fa(t){for(var e,r,n,i,a=[],o=Ra(t),s=-1,l=t.length-1;++s<l;)e=ja(t[s],t[s+1]),yo(e)<Oo?o[s]=o[s+1]=0:(i=(r=o[s]/e)*r+(n=o[s+1]/e)*n)>9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n);for(s=-1;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}function Na(t){return t.length<3?xa(t):t[0]+Ea(t,Fa(t))}function Ba(t){for(var e,r,n,i=-1,a=t.length;++i<a;)r=(e=t[i])[0],n=e[1]-Bo,e[0]=r*Math.cos(n),e[1]=r*Math.sin(n);return t}function Ua(t){function e(e){function l(){m.push(\"M\",s(t(v),h),c,u(t(g.reverse()),h),\"Z\")}for(var f,d,p,m=[],g=[],v=[],y=-1,b=e.length,x=St(r),_=St(i),w=r===n?function(){return d}:St(n),M=i===a?function(){return p}:St(a);++y<b;)o.call(this,f=e[y],y)?(g.push([d=+x.call(this,f,y),p=+_.call(this,f,y)]),v.push([+w.call(this,f,y),+M.call(this,f,y)])):g.length&&(l(),g=[],v=[]);return g.length&&l(),m.length?m.join(\"\"):null}var r=Lr,n=Lr,i=0,a=Cr,o=Ce,s=xa,l=s.key,u=s,c=\"L\",h=.7;return e.x=function(t){return arguments.length?(r=n=t,e):n},e.x0=function(t){return arguments.length?(r=t,e):r},e.x1=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(i=a=t,e):a},e.y0=function(t){return arguments.length?(i=t,e):i},e.y1=function(t){return arguments.length?(a=t,e):a},e.defined=function(t){return arguments.length?(o=t,e):o},e.interpolate=function(t){return arguments.length?(l=\"function\"==typeof t?s=t:(s=Ll.get(t)||xa).key,u=s.reverse||s,c=s.closed?\"M\":\"L\",e):l},e.tension=function(t){return arguments.length?(h=t,e):h},e}function Va(t){return t.radius}function Ha(t){return[t.x,t.y]}function qa(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Bo;return[r*Math.cos(n),r*Math.sin(n)]}}function Ga(){return 64}function Ya(){return\"circle\"}function Wa(t){var e=Math.sqrt(t/Ro);return\"M0,\"+e+\"A\"+e+\",\"+e+\" 0 1,1 0,\"+-e+\"A\"+e+\",\"+e+\" 0 1,1 0,\"+e+\"Z\"}function Xa(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 Za(t,e,r){return Mo(t,Nl),t.namespace=e,t.id=r,t}function Ja(t,e,r,n){var i=t.id,a=t.namespace;return q(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 Qa(t){return null==t&&(t=\"\"),function(){this.textContent=t}}function Ka(t){return null==t?\"__transition__\":\"__transition_\"+t+\"__\"}function $a(t,e,r,n,i){function a(t){var e=m.delay;if(u.t=e+l,e<=t)return o(t-e);u.c=o}function o(r){var i=p.active,a=p[i];a&&(a.timer.c=null,a.timer.t=NaN,--p.count,delete p[i],a.event&&a.event.interrupt.call(t,t.__data__,a.index));for(var o in p)if(+o<n){var c=p[o];c.timer.c=null,c.timer.t=NaN,--p.count,delete p[o]}u.c=s,Dt(function(){return u.c&&s(r||1)&&(u.c=null,u.t=NaN),1},0,l),p.active=n,m.event&&m.event.start.call(t,t.__data__,e),d=[],m.tween.forEach(function(r,n){(n=n.call(t,t.__data__,e))&&d.push(n)}),f=m.ease,h=m.duration}function s(i){for(var a=i/h,o=f(a),s=d.length;s>0;)d[--s].call(t,o);if(a>=1)return m.event&&m.event.end.call(t,t.__data__,e),--p.count?delete p[n]:delete t[r],1}var l,u,h,f,d,p=t[r]||(t[r]={active:0,count:0}),m=p[n];m||(l=i.time,u=Dt(a,0,l),m=p[n]={tween:new c,time:l,timer:u,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++p.count)}function to(t,e,r){t.attr(\"transform\",function(t){var n=e(t);return\"translate(\"+(isFinite(n)?n:r(t))+\",0)\"})}function eo(t,e,r){t.attr(\"transform\",function(t){var n=e(t);return\"translate(0,\"+(isFinite(n)?n:r(t))+\")\"})}function ro(t){return t.toISOString()}function no(t,e,r){function n(e){return t(e)}function i(t,r){var n=(t[1]-t[0])/r,i=so.bisect(Xl,n);return i==Xl.length?[e.year,Ki(t.map(function(t){return t/31536e6}),r)[2]]:i?e[n/Xl[i-1]<Xl[i]/n?i-1:i]:[Ql,Ki(t,r)[2]]}return n.invert=function(e){return io(t.invert(e))},n.domain=function(e){return arguments.length?(t.domain(e),n):t.domain().map(io)},n.nice=function(t,e){function r(r){return!isNaN(r)&&!t.range(r,io(+r+1),e).length}var a=n.domain(),o=Hi(a),s=null==t?i(o,10):\"number\"==typeof t&&i(o,t);return s&&(t=s[0],e=s[1]),n.domain(Yi(a,e>1?{floor:function(e){for(;r(e=t.floor(e));)e=io(e-1);return e},ceil:function(e){for(;r(e=t.ceil(e));)e=io(+e+1);return e}}:t))},n.ticks=function(t,e){var r=Hi(n.domain()),a=null==t?i(r,10):\"number\"==typeof t?i(r,t):!t.range&&[{range:t},e];return a&&(t=a[0],e=a[1]),t.range(r[0],io(+r[1]+1),e<1?1:e)},n.tickFormat=function(){return r},n.copy=function(){return no(t.copy(),e,r)},Ji(n,t)}function io(t){return new Date(t)}function ao(t){return JSON.parse(t.responseText)}function oo(t){var e=co.createRange();return e.selectNode(co.body),e.createContextualFragment(t.responseText)}var so={version:\"3.5.17\"},lo=[].slice,uo=function(t){return lo.call(t)},co=this.document;if(co)try{uo(co.documentElement.childNodes)[0].nodeType}catch(t){uo=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}),co)try{co.createElement(\"DIV\").style.setProperty(\"opacity\",0,\"\")}catch(t){var ho=this.Element.prototype,fo=ho.setAttribute,po=ho.setAttributeNS,mo=this.CSSStyleDeclaration.prototype,go=mo.setProperty;ho.setAttribute=function(t,e){fo.call(this,t,e+\"\")},ho.setAttributeNS=function(t,e,r){po.call(this,t,e,r+\"\")},mo.setProperty=function(t,e,r){go.call(this,t,e+\"\",r)}}so.ascending=n,so.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},so.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},so.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},so.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]},so.sum=function(t,e){var r,n=0,i=t.length,o=-1;if(1===arguments.length)for(;++o<i;)a(r=+t[o])&&(n+=r);else for(;++o<i;)a(r=+e.call(t,t[o],o))&&(n+=r);return n},so.mean=function(t,e){var r,n=0,o=t.length,s=-1,l=o;if(1===arguments.length)for(;++s<o;)a(r=i(t[s]))?n+=r:--l;else for(;++s<o;)a(r=i(e.call(t,t[s],s)))?n+=r:--l;if(l)return n/l},so.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},so.median=function(t,e){var r,o=[],s=t.length,l=-1;if(1===arguments.length)for(;++l<s;)a(r=i(t[l]))&&o.push(r);else for(;++l<s;)a(r=i(e.call(t,t[l],l)))&&o.push(r);if(o.length)return so.quantile(o.sort(n),.5)},so.variance=function(t,e){var r,n,o=t.length,s=0,l=0,u=-1,c=0;if(1===arguments.length)for(;++u<o;)a(r=i(t[u]))&&(l+=(n=r-s)*(r-(s+=n/++c)));else for(;++u<o;)a(r=i(e.call(t,t[u],u)))&&(l+=(n=r-s)*(r-(s+=n/++c)));if(c>1)return l/(c-1)},so.deviation=function(){var t=so.variance.apply(this,arguments);return t?Math.sqrt(t):t};var vo=o(n);so.bisectLeft=vo.left,so.bisect=so.bisectRight=vo.right,so.bisector=function(t){return o(1===t.length?function(e,r){return n(t(e),r)}:t)},so.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},so.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},so.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},so.transpose=function(t){if(!(i=t.length))return[];for(var e=-1,r=so.min(t,s),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},so.zip=function(){return so.transpose(arguments)},so.keys=function(t){var e=[];for(var r in t)e.push(r);return e},so.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},so.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},so.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 yo=Math.abs;so.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=l(yo(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},so.map=function(t,e){var r=new c;if(t instanceof c)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 bo=\"__proto__\",xo=\"\\0\";u(c,{has:d,get:function(t){return this._[h(t)]},set:function(t,e){return this._[h(t)]=e},remove:p,keys:m,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:f(e),value:this._[e]});return t},size:g,empty:v,forEach:function(t){for(var e in this._)t.call(this,f(e),this._[e])}}),so.nest=function(){function t(e,o,s){if(s>=a.length)return n?n.call(i,o):r?o.sort(r):o;for(var l,u,h,f,d=-1,p=o.length,m=a[s++],g=new c;++d<p;)(f=g.get(l=m(u=o[d])))?f.push(u):g.set(l,[u]);return e?(u=e(),h=function(r,n){u.set(r,t(e,n,s))}):(u={},h=function(r,n){u[r]=t(e,n,s)}),g.forEach(h),u}function e(t,r){if(r>=a.length)return t;var n=[],i=o[r++];return t.forEach(function(t,i){n.push({key:t,values:e(i,r)})}),i?n.sort(function(t,e){return i(t.key,e.key)}):n}var r,n,i={},a=[],o=[];return i.map=function(e,r){return t(r,e,0)},i.entries=function(r){return e(t(so.map,r,0),0)},i.key=function(t){return a.push(t),i},i.sortKeys=function(t){return o[a.length-1]=t,i},i.sortValues=function(t){return r=t,i},i.rollup=function(t){return n=t,i},i},so.set=function(t){var e=new y;if(t)for(var r=0,n=t.length;r<n;++r)e.add(t[r]);return e},u(y,{has:d,add:function(t){return this._[h(t+=\"\")]=!0,t},remove:p,values:m,size:g,empty:v,forEach:function(t){for(var e in this._)t.call(this,f(e))}}),so.behavior={},so.rebind=function(t,e){for(var r,n=1,i=arguments.length;++n<i;)t[r=arguments[n]]=x(t,e,e[r]);return t};var _o=[\"webkit\",\"ms\",\"moz\",\"Moz\",\"o\",\"O\"];so.dispatch=function(){for(var t=new M,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=k(t);return t},M.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}},so.event=null,so.requote=function(t){return t.replace(wo,\"\\\\$&\")};var wo=/[\\\\\\^\\$\\*\\+\\?\\|\\[\\]\\(\\)\\.\\{\\}]/g,Mo={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]},ko=function(t,e){return e.querySelector(t)},Ao=function(t,e){return e.querySelectorAll(t)},To=function(t,e){var r=t.matches||t[_(t,\"matchesSelector\")];return(To=function(t,e){return r.call(t,e)})(t,e)};\"function\"==typeof Sizzle&&(ko=function(t,e){return Sizzle(t,e)[0]||null},Ao=Sizzle,To=Sizzle.matchesSelector),so.selection=function(){return so.select(co.documentElement)};var So=so.selection.prototype=[];So.select=function(t){var e,r,n,i,a=[];t=L(t);for(var o=-1,s=this.length;++o<s;){a.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var l=-1,u=n.length;++l<u;)(i=n[l])?(e.push(r=t.call(i,i.__data__,l,o)),r&&\"__data__\"in i&&(r.__data__=i.__data__)):e.push(null)}return E(a)},So.selectAll=function(t){var e,r,n=[];t=C(t);for(var i=-1,a=this.length;++i<a;)for(var o=this[i],s=-1,l=o.length;++s<l;)(r=o[s])&&(n.push(e=uo(t.call(r,r.__data__,s,i))),e.parentNode=r);return E(n)};var Eo=\"http://www.w3.org/1999/xhtml\",Lo={svg:\"http://www.w3.org/2000/svg\",xhtml:Eo,xlink:\"http://www.w3.org/1999/xlink\",xml:\"http://www.w3.org/XML/1998/namespace\",xmlns:\"http://www.w3.org/2000/xmlns/\"};so.ns={prefix:Lo,qualify:function(t){var e=t.indexOf(\":\"),r=t;return e>=0&&\"xmlns\"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),Lo.hasOwnProperty(r)?{space:Lo[r],local:t}:t}},So.attr=function(t,e){if(arguments.length<2){if(\"string\"==typeof t){var r=this.node();return t=so.ns.qualify(t),t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(z(e,t[e]));return this}return this.each(z(t,e))},So.classed=function(t,e){if(arguments.length<2){if(\"string\"==typeof t){var r=this.node(),n=(t=P(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(!I(t[i]).test(e))return!1;return!0}for(e in t)this.each(O(e,t[e]));return this}return this.each(O(t,e))},So.style=function(t,e,n){var i=arguments.length;if(i<3){if(\"string\"!=typeof t){i<2&&(e=\"\");for(n in t)this.each(R(n,t[n],e));return this}if(i<2){var a=this.node();return r(a).getComputedStyle(a,null).getPropertyValue(t)}n=\"\"}return this.each(R(t,e,n))},So.property=function(t,e){if(arguments.length<2){if(\"string\"==typeof t)return this.node()[t];for(e in t)this.each(F(e,t[e]));return this}return this.each(F(t,e))},So.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},So.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},So.append=function(t){return t=N(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},So.insert=function(t,e){return t=N(t),e=L(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},So.remove=function(){return this.each(B)},So.data=function(t,e){function r(t,r){var n,i,a,o=t.length,h=r.length,f=Math.min(o,h),d=new Array(h),p=new Array(h),m=new Array(o);if(e){var g,v=new c,y=new Array(o);for(n=-1;++n<o;)(i=t[n])&&(v.has(g=e.call(i,i.__data__,n))?m[n]=i:v.set(g,i),y[n]=g);for(n=-1;++n<h;)(i=v.get(g=e.call(r,a=r[n],n)))?!0!==i&&(d[n]=i,i.__data__=a):p[n]=U(a),v.set(g,!0);for(n=-1;++n<o;)n in y&&!0!==v.get(y[n])&&(m[n]=t[n])}else{for(n=-1;++n<f;)i=t[n],a=r[n],i?(i.__data__=a,d[n]=i):p[n]=U(a);for(;n<h;++n)p[n]=U(r[n]);for(;n<o;++n)m[n]=t[n]}p.update=d,p.parentNode=d.parentNode=m.parentNode=t.parentNode,s.push(p),l.push(d),u.push(m)}var n,i,a=-1,o=this.length;if(!arguments.length){for(t=new Array(o=(n=this[0]).length);++a<o;)(i=n[a])&&(t[a]=i.__data__);return t}var s=G([]),l=E([]),u=E([]);if(\"function\"==typeof t)for(;++a<o;)r(n=this[a],t.call(n,n.parentNode.__data__,a));else for(;++a<o;)r(n=this[a],t);return l.enter=function(){return s},l.exit=function(){return u},l},So.datum=function(t){return arguments.length?this.property(\"__data__\",t):this.property(\"__data__\")},So.filter=function(t){var e,r,n,i=[];\"function\"!=typeof t&&(t=V(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 E(i)},So.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},So.sort=function(t){t=H.apply(this,arguments);for(var e=-1,r=this.length;++e<r;)this[e].sort(t);return this.order()},So.each=function(t){return q(this,function(e,r,n){t.call(e,e.__data__,r,n)})},So.call=function(t){var e=uo(arguments);return t.apply(e[0]=this,e),this},So.empty=function(){return!this.node()},So.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},So.size=function(){var t=0;return q(this,function(){++t}),t};var Co=[];so.selection.enter=G,so.selection.enter.prototype=Co,Co.append=So.append,Co.empty=So.empty,Co.node=So.node,Co.call=So.call,Co.size=So.size,Co.select=function(t){for(var e,r,n,i,a,o=[],s=-1,l=this.length;++s<l;){n=(i=this[s]).update,o.push(e=[]),e.parentNode=i.parentNode;for(var u=-1,c=i.length;++u<c;)(a=i[u])?(e.push(n[u]=r=t.call(i.parentNode,a.__data__,u,s)),r.__data__=a.__data__):e.push(null)}return E(o)},Co.insert=function(t,e){return arguments.length<2&&(e=Y(this)),So.insert.call(this,t,e)},so.select=function(e){var r;return\"string\"==typeof e?(r=[ko(e,co)]).parentNode=co.documentElement:(r=[e]).parentNode=t(e),E([r])},so.selectAll=function(t){var e;return\"string\"==typeof t?(e=uo(Ao(t,co))).parentNode=co.documentElement:(e=uo(t)).parentNode=null,E([e])},So.on=function(t,e,r){var n=arguments.length;if(n<3){if(\"string\"!=typeof t){n<2&&(e=!1);for(r in t)this.each(W(r,t[r],e));return this}if(n<2)return(n=this.node()[\"__on\"+t])&&n._;r=!1}return this.each(W(t,e,r))};var zo=so.map({mouseenter:\"mouseover\",mouseleave:\"mouseout\"});co&&zo.forEach(function(t){\"on\"+t in co&&zo.remove(t)});var Do,Io=0;so.mouse=function(t){return Q(t,T())};var Po=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;so.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=T().changedTouches),e)for(var n,i=0,a=e.length;i<a;++i)if((n=e[i]).identifier===r)return Q(t,n)},so.behavior.drag=function(){function t(){this.on(\"mousedown.drag\",a).on(\"touchstart.drag\",o)}function e(t,e,r,a,o){return function(){function s(){var t,r,n=e(f,m);n&&(t=n[0]-b[0],r=n[1]-b[1],p|=t|r,b=n,d({type:\"drag\",x:n[0]+u[0],y:n[1]+u[1],dx:t,dy:r}))}function l(){e(f,m)&&(v.on(a+g,null).on(o+g,null),y(p),d({type:\"dragend\"}))}var u,c=this,h=so.event.target.correspondingElement||so.event.target,f=c.parentNode,d=n.of(c,arguments),p=0,m=t(),g=\".drag\"+(null==m?\"\":\"-\"+m),v=so.select(r(h)).on(a+g,s).on(o+g,l),y=J(h),b=e(f,m);i?(u=i.apply(c,arguments),u=[u.x-b[0],u.y-b[1]]):u=[0,0],d({type:\"dragstart\"})}}var n=S(t,\"drag\",\"dragstart\",\"dragend\"),i=null,a=e(w,so.mouse,r,\"mousemove\",\"mouseup\"),o=e(K,so.touch,b,\"touchmove\",\"touchend\");return t.origin=function(e){return arguments.length?(i=e,t):i},so.rebind(t,n,\"on\")},so.touches=function(t,e){return arguments.length<2&&(e=T().touches),e?uo(e).map(function(e){var r=Q(t,e);return r.identifier=e.identifier,r}):[]};var Oo=1e-6,jo=Oo*Oo,Ro=Math.PI,Fo=2*Ro,No=Fo-Oo,Bo=Ro/2,Uo=Ro/180,Vo=180/Ro,Ho=Math.SQRT2;so.interpolateZoom=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],u=e[2],c=s-i,h=l-a,f=c*c+h*h;if(f<jo)n=Math.log(u/o)/Ho,r=function(t){return[i+t*c,a+t*h,o*Math.exp(Ho*t*n)]};else{var d=Math.sqrt(f),p=(u*u-o*o+4*f)/(2*o*2*d),m=(u*u-o*o-4*f)/(2*u*2*d),g=Math.log(Math.sqrt(p*p+1)-p),v=Math.log(Math.sqrt(m*m+1)-m);n=(v-g)/Ho,r=function(t){var e=t*n,r=it(g),s=o/(2*d)*(r*at(Ho*e+g)-nt(g));return[i+s*c,a+s*h,o*r/it(Ho*e+g)]}}return r.duration=1e3*n,r},so.behavior.zoom=function(){function t(t){t.on(z,h).on(Go+\".zoom\",d).on(\"dblclick.zoom\",p).on(P,f)}function e(t){return[(t[0]-k.x)/k.k,(t[1]-k.y)/k.k]}function n(t){return[t[0]*k.k+k.x,t[1]*k.k+k.y]}function i(t){k.k=Math.max(E[0],Math.min(E[1],t))}function a(t,e){e=n(e),k.x+=t[0]-e[0],k.y+=t[1]-e[1]}function o(e,r,n,o){e.__chart__={x:k.x,y:k.y,k:k.k},i(Math.pow(2,o)),a(g=r,n),e=so.select(e),L>0&&(e=e.transition().duration(L)),e.call(t.event)}function s(){_&&_.domain(x.range().map(function(t){return(t-k.x)/k.k}).map(x.invert)),M&&M.domain(w.range().map(function(t){return(t-k.y)/k.k}).map(w.invert))}function l(t){C++||t({type:\"zoomstart\"})}function u(t){s(),t({type:\"zoom\",scale:k.k,translate:[k.x,k.y]})}function c(t){--C||(t({type:\"zoomend\"}),g=null)}function h(){function t(){s=1,a(so.mouse(i),f),u(o)}function n(){h.on(D,null).on(I,null),d(s),c(o)}var i=this,o=O.of(i,arguments),s=0,h=so.select(r(i)).on(D,t).on(I,n),f=e(so.mouse(i)),d=J(i);Fl.call(i),l(o)}function f(){function t(){var t=so.touches(p);return d=k.k,t.forEach(function(t){t.identifier in g&&(g[t.identifier]=e(t))}),t}function r(){var e=so.event.target;so.select(e).on(x,n).on(_,s),w.push(e);for(var r=so.event.changedTouches,i=0,a=r.length;i<a;++i)g[r[i].identifier]=null;var l=t(),u=Date.now();if(1===l.length){if(u-b<500){c=l[0];o(p,c,g[c.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),A()}b=u}else if(l.length>1){var c=l[0],h=l[1],f=c[0]-h[0],d=c[1]-h[1];v=f*f+d*d}}function n(){var t,e,r,n,o=so.touches(p);Fl.call(p);for(var s=0,l=o.length;s<l;++s,n=null)if(r=o[s],n=g[r.identifier]){if(e)break;t=r,e=n}if(n){var c=(c=r[0]-t[0])*c+(c=r[1]-t[1])*c,h=v&&Math.sqrt(c/v);t=[(t[0]+r[0])/2,(t[1]+r[1])/2],e=[(e[0]+n[0])/2,(e[1]+n[1])/2],i(h*d)}b=null,a(t,e),u(m)}function s(){if(so.event.touches.length){for(var e=so.event.changedTouches,r=0,n=e.length;r<n;++r)delete g[e[r].identifier];for(var i in g)return void t()}so.selectAll(w).on(y,null),M.on(z,h).on(P,f),T(),c(m)}var d,p=this,m=O.of(p,arguments),g={},v=0,y=\".zoom-\"+so.event.changedTouches[0].identifier,x=\"touchmove\"+y,_=\"touchend\"+y,w=[],M=so.select(p),T=J(p);r(),l(m),M.on(z,null).on(P,r)}function d(){var t=O.of(this,arguments);y?clearTimeout(y):(Fl.call(this),m=e(g=v||so.mouse(this)),l(t)),y=setTimeout(function(){y=null,c(t)},50),A(),i(Math.pow(2,.002*qo())*k.k),a(g,m),u(t)}function p(){var t=so.mouse(this),r=Math.log(k.k)/Math.LN2;o(this,t,e(t),so.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}var m,g,v,y,b,x,_,w,M,k={x:0,y:0,k:1},T=[960,500],E=Yo,L=250,C=0,z=\"mousedown.zoom\",D=\"mousemove.zoom\",I=\"mouseup.zoom\",P=\"touchstart.zoom\",O=S(t,\"zoomstart\",\"zoom\",\"zoomend\");return Go||(Go=\"onwheel\"in co?(qo=function(){return-so.event.deltaY*(so.event.deltaMode?120:1)},\"wheel\"):\"onmousewheel\"in co?(qo=function(){return so.event.wheelDelta},\"mousewheel\"):(qo=function(){return-so.event.detail},\"MozMousePixelScroll\")),t.event=function(t){t.each(function(){var t=O.of(this,arguments),e=k;jl?so.select(this).transition().each(\"start.zoom\",function(){k=this.__chart__||{x:0,y:0,k:1},l(t)}).tween(\"zoom:zoom\",function(){var r=T[0],n=T[1],i=g?g[0]:r/2,a=g?g[1]:n/2,o=so.interpolateZoom([(i-k.x)/k.k,(a-k.y)/k.k,r/k.k],[(i-e.x)/e.k,(a-e.y)/e.k,r/e.k]);return function(e){var n=o(e),s=r/n[2];this.__chart__=k={x:i-n[0]*s,y:a-n[1]*s,k:s},u(t)}}).each(\"interrupt.zoom\",function(){c(t)}).each(\"end.zoom\",function(){c(t)}):(this.__chart__=k,l(t),u(t),c(t))})},t.translate=function(e){return arguments.length?(k={x:+e[0],y:+e[1],k:k.k},s(),t):[k.x,k.y]},t.scale=function(e){return arguments.length?(k={x:k.x,y:k.y,k:null},i(+e),s(),t):k.k},t.scaleExtent=function(e){return arguments.length?(E=null==e?Yo:[+e[0],+e[1]],t):E},t.center=function(e){return arguments.length?(v=e&&[+e[0],+e[1]],t):v},t.size=function(e){return arguments.length?(T=e&&[+e[0],+e[1]],t):T},t.duration=function(e){return arguments.length?(L=+e,t):L},t.x=function(e){return arguments.length?(_=e,x=e.copy(),k={x:0,y:0,k:1},t):_},t.y=function(e){return arguments.length?(M=e,w=e.copy(),k={x:0,y:0,k:1},t):M},so.rebind(t,O,\"on\")};var qo,Go,Yo=[0,1/0];so.color=st,st.prototype.toString=function(){return this.rgb()+\"\"},so.hsl=lt;var Wo=lt.prototype=new st;Wo.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new lt(this.h,this.s,this.l/t)},Wo.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new lt(this.h,this.s,t*this.l)},Wo.rgb=function(){return ut(this.h,this.s,this.l)},so.hcl=ct;var Xo=ct.prototype=new st;Xo.brighter=function(t){return new ct(this.h,this.c,Math.min(100,this.l+Zo*(arguments.length?t:1)))},Xo.darker=function(t){return new ct(this.h,this.c,Math.max(0,this.l-Zo*(arguments.length?t:1)))},Xo.rgb=function(){return ht(this.h,this.c,this.l).rgb()},so.lab=ft;var Zo=18,Jo=.95047,Qo=1,Ko=1.08883,$o=ft.prototype=new st;$o.brighter=function(t){return new ft(Math.min(100,this.l+Zo*(arguments.length?t:1)),this.a,this.b)},$o.darker=function(t){return new ft(Math.max(0,this.l-Zo*(arguments.length?t:1)),this.a,this.b)},$o.rgb=function(){return dt(this.l,this.a,this.b)},so.rgb=yt;var ts=yt.prototype=new st;ts.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 yt(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new yt(i,i,i)},ts.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new yt(t*this.r,t*this.g,t*this.b)},ts.hsl=function(){return Mt(this.r,this.g,this.b)},ts.toString=function(){return\"#\"+_t(this.r)+_t(this.g)+_t(this.b)};var es=so.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});es.forEach(function(t,e){es.set(t,bt(e))}),so.functor=St,so.xhr=Et(b),so.dsv=function(t,e){function r(t,r,a){arguments.length<3&&(a=r,r=null);var o=Lt(t,e,null==r?n:i(r),a);return o.row=function(t){return arguments.length?o.response(null==(r=t)?n:i(t)):r},o}function n(t){return r.parse(t.responseText)}function i(t){return function(e){return r.parse(e.responseText,t)}}function a(e){return e.map(o).join(t)}function o(t){return s.test(t)?'\"'+t.replace(/\\\"/g,'\"\"')+'\"':t}var s=new RegExp('[\"'+t+\"\\n]\"),l=t.charCodeAt(0);return r.parse=function(t,e){var n;return r.parseRows(t,function(t,r){if(n)return n(t,r-1);var i=new Function(\"d\",\"return {\"+t.map(function(t,e){return JSON.stringify(t)+\": d[\"+e+\"]\"}).join(\",\")+\"}\");n=e?function(t,r){return e(i(t),r)}:i})},r.parseRows=function(t,e){function r(){if(c>=u)return o;if(i)return i=!1,a;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++<u;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}return c=r+2,13===(n=t.charCodeAt(r+1))?(i=!0,10===t.charCodeAt(r+2)&&++c):10===n&&(i=!0),t.slice(e+1,r).replace(/\"\"/g,'\"')}for(;c<u;){var n=t.charCodeAt(c++),s=1;if(10===n)i=!0;else if(13===n)i=!0,10===t.charCodeAt(c)&&(++c,++s);else if(n!==l)continue;return t.slice(e,c-s)}return t.slice(e)}for(var n,i,a={},o={},s=[],u=t.length,c=0,h=0;(n=r())!==o;){for(var f=[];n!==a&&n!==o;)f.push(n),n=r();e&&null==(f=e(f,h++))||s.push(f)}return s},r.format=function(e){if(Array.isArray(e[0]))return r.formatRows(e);var n=new y,i=[];return e.forEach(function(t){for(var e in t)n.has(e)||i.push(n.add(e))}),[i.map(o).join(t)].concat(e.map(function(e){return i.map(function(t){return o(e[t])}).join(t)})).join(\"\\n\")},r.formatRows=function(t){return t.map(a).join(\"\\n\")},r},so.csv=so.dsv(\",\",\"text/csv\"),so.tsv=so.dsv(\"\\t\",\"text/tab-separated-values\");var rs,ns,is,as,os=this[_(this,\"requestAnimationFrame\")]||function(t){setTimeout(t,17)};so.timer=function(){Dt.apply(this,arguments)},so.timer.flush=function(){Pt(),Ot()},so.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var ss=[\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"µ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"].map(Rt);so.formatPrefix=function(t,e){var r=0;return(t=+t)&&(t<0&&(t*=-1),e&&(t=so.round(t,jt(t,e))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((r-1)/3)))),ss[8+r/3]};var ls=/(?:([^{])?([<>=^]))?([+\\- ])?([$#])?(0)?(\\d+)?(,)?(\\.-?\\d+)?([a-z%])?/i,us=so.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=so.round(t,jt(t,e))).toFixed(Math.max(0,Math.min(20,jt(t*(1+1e-15),e))))}}),cs=so.time={},hs=Date;Bt.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(){fs.setUTCDate.apply(this._,arguments)},setDay:function(){fs.setUTCDay.apply(this._,arguments)},setFullYear:function(){fs.setUTCFullYear.apply(this._,arguments)},setHours:function(){fs.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){fs.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){fs.setUTCMinutes.apply(this._,arguments)},setMonth:function(){fs.setUTCMonth.apply(this._,arguments)},setSeconds:function(){fs.setUTCSeconds.apply(this._,arguments)},setTime:function(){fs.setTime.apply(this._,arguments)}};var fs=Date.prototype;cs.year=Ut(function(t){return(t=cs.day(t)).setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),cs.years=cs.year.range,cs.years.utc=cs.year.utc.range,cs.day=Ut(function(t){var e=new hs(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}),cs.days=cs.day.range,cs.days.utc=cs.day.utc.range,cs.dayOfYear=function(t){var e=cs.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=cs[t]=Ut(function(t){return(t=cs.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=cs.year(t).getDay();return Math.floor((cs.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});cs[t+\"s\"]=r.range,cs[t+\"s\"].utc=r.utc.range,cs[t+\"OfYear\"]=function(t){var r=cs.year(t).getDay();return Math.floor((cs.dayOfYear(t)+(r+e)%7)/7)}}),cs.week=cs.sunday,cs.weeks=cs.sunday.range,cs.weeks.utc=cs.sunday.utc.range,cs.weekOfYear=cs.sundayOfYear;var ds={\"-\":\"\",_:\" \",0:\"0\"},ps=/^\\s*\\d+/,ms=/^%/;so.locale=function(t){return{numberFormat:Ft(t),timeFormat:Ht(t)}};var gs=so.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\"]});so.format=gs.numberFormat,so.geo={},ce.prototype={s:0,t:0,add:function(t){he(t,this.t,vs),he(vs.s,this.s,this),this.s?this.t+=vs.t:this.s=vs.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var vs=new ce;so.geo.stream=function(t,e){t&&ys.hasOwnProperty(t.type)?ys[t.type](t,e):fe(t,e)};var ys={Feature:function(t,e){fe(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n<i;)fe(r[n].geometry,e)}},bs={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){de(t.coordinates,e,0)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)de(r[n],e,0)},Polygon:function(t,e){pe(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)pe(r[n],e)},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,i=r.length;++n<i;)fe(r[n],e)}};so.geo.area=function(t){return xs=0,so.geo.stream(t,ws),xs};var xs,_s=new ce,ws={sphere:function(){xs+=4*Ro},point:w,lineStart:w,lineEnd:w,polygonStart:function(){_s.reset(),ws.lineStart=me},polygonEnd:function(){var t=2*_s;xs+=t<0?4*Ro+t:t,ws.lineStart=ws.lineEnd=ws.point=w}};so.geo.bounds=function(){function t(t,e){b.push(x=[c=t,f=t]),e<h&&(h=e),e>d&&(d=e)}function e(e,r){var n=ge([e*Uo,r*Uo]);if(v){var i=ye(v,n),a=ye([i[1],-i[0],0],i);_e(a),a=we(a);var o=e-p,l=o>0?1:-1,u=a[0]*Vo*l,m=yo(o)>180;if(m^(l*p<u&&u<l*e))(g=a[1]*Vo)>d&&(d=g);else if(u=(u+360)%360-180,m^(l*p<u&&u<l*e)){var g=-a[1]*Vo;g<h&&(h=g)}else r<h&&(h=r),r>d&&(d=r);m?e<p?s(c,e)>s(c,f)&&(f=e):s(e,f)>s(c,f)&&(c=e):f>=c?(e<c&&(c=e),e>f&&(f=e)):e>p?s(c,e)>s(c,f)&&(f=e):s(e,f)>s(c,f)&&(c=e)}else t(e,r);v=n,p=e}function r(){_.point=e}function n(){x[0]=c,x[1]=f,_.point=t,v=null}function i(t,r){if(v){var n=t-p;y+=yo(n)>180?n+(n>0?360:-360):n}else m=t,g=r;ws.point(t,r),e(t,r)}function a(){ws.lineStart()}function o(){i(m,g),ws.lineEnd(),yo(y)>Oo&&(c=-(f=180)),x[0]=c,x[1]=f,v=null}function s(t,e){return(e-=t)<0?e+360:e}function l(t,e){return t[0]-e[0]}function u(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}var c,h,f,d,p,m,g,v,y,b,x,_={point:t,lineStart:r,lineEnd:n,polygonStart:function(){_.point=i,_.lineStart=a,_.lineEnd=o,y=0,ws.polygonStart()},polygonEnd:function(){ws.polygonEnd(),_.point=t,_.lineStart=r,_.lineEnd=n,_s<0?(c=-(f=180),h=-(d=90)):y>Oo?d=90:y<-Oo&&(h=-90),x[0]=c,x[1]=f}};return function(t){d=f=-(c=h=1/0),b=[],so.geo.stream(t,_);var e=b.length;if(e){b.sort(l);for(var r=1,n=[p=b[0]];r<e;++r)u((a=b[r])[0],p)||u(a[1],p)?(s(p[0],a[1])>s(p[0],p[1])&&(p[1]=a[1]),s(a[0],p[1])>s(p[0],p[1])&&(p[0]=a[0])):n.push(p=a);for(var i,a,o=-1/0,r=0,p=n[e=n.length-1];r<=e;p=a,++r)a=n[r],(i=s(p[1],a[0]))>o&&(o=i,c=a[0],f=p[1])}return b=x=null,c===1/0||h===1/0?[[NaN,NaN],[NaN,NaN]]:[[c,h],[f,d]]}}(),so.geo.centroid=function(t){Ms=ks=As=Ts=Ss=Es=Ls=Cs=zs=Ds=Is=0,so.geo.stream(t,Ps);var e=zs,r=Ds,n=Is,i=e*e+r*r+n*n;return i<jo&&(e=Es,r=Ls,n=Cs,ks<Oo&&(e=As,r=Ts,n=Ss),(i=e*e+r*r+n*n)<jo)?[NaN,NaN]:[Math.atan2(r,e)*Vo,rt(n/Math.sqrt(i))*Vo]};var Ms,ks,As,Ts,Ss,Es,Ls,Cs,zs,Ds,Is,Ps={sphere:w,point:ke,lineStart:Te,lineEnd:Se,polygonStart:function(){Ps.lineStart=Ee},polygonEnd:function(){Ps.lineStart=Te}},Os=Pe(Ce,Fe,Be,[-Ro,-Ro/2]),js=1e9;so.geo.clipExtent=function(){var t,e,r,n,i,a,o={stream:function(t){return i&&(i.valid=!1),i=a(t),i.valid=!0,i},extent:function(s){return arguments.length?(a=qe(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]])},(so.geo.conicEqualArea=function(){return Ge(Ye)}).raw=Ye,so.geo.albers=function(){return so.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},so.geo.albersUsa=function(){function t(t){var a=t[0],o=t[1];return e=null,r(a,o),e||(n(a,o),e)||i(a,o),e}var e,r,n,i,a=so.geo.albers(),o=so.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=so.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,r){e=[t,r]}};return t.invert=function(t){var e=a.scale(),r=a.translate(),n=(t[0]-r[0])/e,i=(t[1]-r[1])/e;return(i>=.12&&i<.234&&n>=-.425&&n<-.214?o:i>=.166&&i<.234&&n>=-.214&&n<-.115?s:a).invert(t)},t.stream=function(t){var e=a.stream(t),r=o.stream(t),n=s.stream(t);return{point:function(t,i){e.point(t,i),r.point(t,i),n.point(t,i)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},t.precision=function(e){return arguments.length?(a.precision(e),o.precision(e),s.precision(e),t):a.precision()},t.scale=function(e){return arguments.length?(a.scale(e),o.scale(.35*e),s.scale(e),t.translate(a.translate())):a.scale()},t.translate=function(e){if(!arguments.length)return a.translate();var u=a.scale(),c=+e[0],h=+e[1];return r=a.translate(e).clipExtent([[c-.455*u,h-.238*u],[c+.455*u,h+.238*u]]).stream(l).point,n=o.translate([c-.307*u,h+.201*u]).clipExtent([[c-.425*u+Oo,h+.12*u+Oo],[c-.214*u-Oo,h+.234*u-Oo]]).stream(l).point,i=s.translate([c-.205*u,h+.212*u]).clipExtent([[c-.214*u+Oo,h+.166*u+Oo],[c-.115*u-Oo,h+.234*u-Oo]]).stream(l).point,t},t.scale(1070)};var Rs,Fs,Ns,Bs,Us,Vs,Hs={point:w,lineStart:w,lineEnd:w,polygonStart:function(){Fs=0,Hs.lineStart=We},polygonEnd:function(){Hs.lineStart=Hs.lineEnd=Hs.point=w,Rs+=yo(Fs/2)}},qs={point:Xe,lineStart:w,lineEnd:w,polygonStart:w,polygonEnd:w},Gs={point:Qe,lineStart:Ke,lineEnd:$e,polygonStart:function(){Gs.lineStart=tr},polygonEnd:function(){Gs.point=Qe,Gs.lineStart=Ke,Gs.lineEnd=$e}};so.geo.path=function(){function t(t){return t&&(\"function\"==typeof s&&a.pointRadius(+s.apply(this,arguments)),o&&o.valid||(o=i(a)),so.geo.stream(t,o)),a.result()}function e(){return o=null,t}var r,n,i,a,o,s=4.5;return t.area=function(t){return Rs=0,so.geo.stream(t,i(Hs)),Rs},t.centroid=function(t){return As=Ts=Ss=Es=Ls=Cs=zs=Ds=Is=0,so.geo.stream(t,i(Gs)),Is?[zs/Is,Ds/Is]:Cs?[Es/Cs,Ls/Cs]:Ss?[As/Ss,Ts/Ss]:[NaN,NaN]},t.bounds=function(t){return Us=Vs=-(Ns=Bs=1/0),so.geo.stream(t,i(qs)),[[Ns,Bs],[Us,Vs]]},t.projection=function(t){return arguments.length?(i=(r=t)?t.stream||nr(t):b,e()):r},t.context=function(t){return arguments.length?(a=null==(n=t)?new Ze:new er(t),\"function\"!=typeof s&&a.pointRadius(s),e()):n},t.pointRadius=function(e){return arguments.length?(s=\"function\"==typeof e?e:(a.pointRadius(+e),+e),t):s},t.projection(so.geo.albersUsa()).context(null)},so.geo.transform=function(t){return{stream:function(e){var r=new ir(e);for(var n in t)r[n]=t[n];return r}}},ir.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()}},so.geo.projection=or,so.geo.projectionMutator=sr,(so.geo.equirectangular=function(){return or(ur)}).raw=ur.invert=ur,so.geo.rotation=function(t){function e(e){return e=t(e[0]*Uo,e[1]*Uo),e[0]*=Vo,e[1]*=Vo,e}return t=hr(t[0]%360*Uo,t[1]*Uo,t.length>2?t[2]*Uo:0),e.invert=function(e){return e=t.invert(e[0]*Uo,e[1]*Uo),e[0]*=Vo,e[1]*=Vo,e},e},cr.invert=ur,so.geo.circle=function(){function t(){var t=\"function\"==typeof n?n.apply(this,arguments):n,e=hr(-t[0]*Uo,-t[1]*Uo,0).invert,i=[];return r(null,null,1,{point:function(t,r){i.push(t=e(t,r)),t[0]*=Vo,t[1]*=Vo}}),{type:\"Polygon\",coordinates:[i]}}var e,r,n=[0,0],i=6;return t.origin=function(e){return arguments.length?(n=e,t):n},t.angle=function(n){return arguments.length?(r=mr((e=+n)*Uo,i*Uo),t):e},t.precision=function(n){return arguments.length?(r=mr(e*Uo,(i=+n)*Uo),t):i},t.angle(90)},so.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Uo,i=t[1]*Uo,a=e[1]*Uo,o=Math.sin(n),s=Math.cos(n),l=Math.sin(i),u=Math.cos(i),c=Math.sin(a),h=Math.cos(a);return Math.atan2(Math.sqrt((r=h*o)*r+(r=u*c-l*h*s)*r),l*c+u*h*s)},so.geo.graticule=function(){function t(){return{type:\"MultiLineString\",coordinates:e()}}function e(){return so.range(Math.ceil(a/g)*g,i,g).map(f).concat(so.range(Math.ceil(u/v)*v,l,v).map(d)).concat(so.range(Math.ceil(n/p)*p,r,p).filter(function(t){return yo(t%g)>Oo}).map(c)).concat(so.range(Math.ceil(s/m)*m,o,m).filter(function(t){return yo(t%v)>Oo}).map(h))}var r,n,i,a,o,s,l,u,c,h,f,d,p=10,m=p,g=90,v=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:\"LineString\",coordinates:t}})},t.outline=function(){return{type:\"Polygon\",coordinates:[f(a).concat(d(l).slice(1),f(i).reverse().slice(1),d(u).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(a=+e[0][0],i=+e[1][0],u=+e[0][1],l=+e[1][1],a>i&&(e=a,a=i,i=e),u>l&&(e=u,u=l,l=e),t.precision(y)):[[a,u],[i,l]]},t.minorExtent=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],s=+e[0][1],o=+e[1][1],n>r&&(e=n,n=r,r=e),s>o&&(e=s,s=o,o=e),t.precision(y)):[[n,s],[r,o]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(g=+e[0],v=+e[1],t):[g,v]},t.minorStep=function(e){return arguments.length?(p=+e[0],m=+e[1],t):[p,m]},t.precision=function(e){return arguments.length?(y=+e,c=vr(s,o,90),h=yr(n,r,y),f=vr(u,l,90),d=yr(a,i,y),t):y},t.majorExtent([[-180,-90+Oo],[180,90-Oo]]).minorExtent([[-180,-80-Oo],[180,80+Oo]])},so.geo.greatArc=function(){function t(){return{type:\"LineString\",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}var e,r,n=br,i=xr;return t.distance=function(){return so.geo.distance(e||n.apply(this,arguments),r||i.apply(this,arguments))},t.source=function(r){return arguments.length?(n=r,e=\"function\"==typeof r?null:r,t):n},t.target=function(e){return arguments.length?(i=e,r=\"function\"==typeof e?null:e,t):i},t.precision=function(){return arguments.length?t:0},t},so.geo.interpolate=function(t,e){return _r(t[0]*Uo,t[1]*Uo,e[0]*Uo,e[1]*Uo)},so.geo.length=function(t){return Ys=0,so.geo.stream(t,Ws),Ys};var Ys,Ws={sphere:w,point:w,lineStart:wr,lineEnd:w,polygonStart:w,polygonEnd:w},Xs=Mr(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(so.geo.azimuthalEqualArea=function(){return or(Xs)}).raw=Xs;var Zs=Mr(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},b);(so.geo.azimuthalEquidistant=function(){return or(Zs)}).raw=Zs,(so.geo.conicConformal=function(){return Ge(kr)}).raw=kr,(so.geo.conicEquidistant=function(){return Ge(Ar)}).raw=Ar;var Js=Mr(function(t){return 1/t},Math.atan);(so.geo.gnomonic=function(){return or(Js)}).raw=Js,Tr.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Bo]},(so.geo.mercator=function(){return Sr(Tr)}).raw=Tr;var Qs=Mr(function(){return 1},Math.asin);(so.geo.orthographic=function(){return or(Qs)}).raw=Qs;var Ks=Mr(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(so.geo.stereographic=function(){return or(Ks)}).raw=Ks,Er.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Bo]},(so.geo.transverseMercator=function(){var t=Sr(Er),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):(t=r(),[t[0],t[1],t[2]-90])},r([0,0,90])}).raw=Er,so.geom={},so.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=St(r),a=St(n),o=t.length,s=[],l=[];for(e=0;e<o;e++)s.push([+i.call(this,t[e],e),+a.call(this,t[e],e),e]);for(s.sort(Dr),e=0;e<o;e++)l.push([s[e][0],-s[e][1]]);var u=zr(s),c=zr(l),h=c[0]===u[0],f=c[c.length-1]===u[u.length-1],d=[];for(e=u.length-1;e>=0;--e)d.push(t[s[u[e]][2]]);for(e=+h;e<c.length-f;++e)d.push(t[s[c[e]][2]]);return d}var r=Lr,n=Cr;return arguments.length?e(t):(e.x=function(t){return arguments.length?(r=t,e):r},e.y=function(t){return arguments.length?(n=t,e):n},e)},so.geom.polygon=function(t){return Mo(t,$s),t};var $s=so.geom.polygon.prototype=[];$s.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},$s.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]},$s.clip=function(t){for(var e,r,n,i,a,o,s=Or(t),l=-1,u=this.length-Or(this),c=this[u-1];++l<u;){for(e=t.slice(),t.length=0,i=this[l],a=e[(n=e.length-s)-1],r=-1;++r<n;)Ir(o=e[r],c,i)?(Ir(a,c,i)||t.push(Pr(a,o,c,i)),t.push(o)):Ir(a,c,i)&&t.push(Pr(a,o,c,i)),a=o;s&&t.push(t[0]),c=i}return t};var tl,el,rl,nl,il,al=[],ol=[];Hr.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(Gr),e.length},en.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}},rn.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=sn(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&&(an(this,r),r=(t=r).U),r.C=!1,n.C=!0,on(this,n)):(i=n.L)&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.L&&(on(this,r),r=(t=r).U),r.C=!1,n.C=!0,an(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?sn(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,an(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,on(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,an(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,on(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,an(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,on(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}},so.geom.voronoi=function(t){function e(t){var e=new Array(t.length),n=s[0][0],i=s[0][1],a=s[1][0],o=s[1][1];return ln(r(t),s).cells.forEach(function(r,s){var l=r.edges,u=r.site;(e[s]=l.length?l.map(function(t){var e=t.start();return[e.x,e.y]}):u.x>=n&&u.x<=a&&u.y>=i&&u.y<=o?[[n,o],[a,o],[a,i],[n,i]]:[]).point=t[s]}),e}function r(t){return t.map(function(t,e){return{x:Math.round(a(t,e)/Oo)*Oo,y:Math.round(o(t,e)/Oo)*Oo,i:e}})}var n=Lr,i=Cr,a=n,o=i,s=sl;return t?e(t):(e.links=function(t){return ln(r(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return ln(r(t)).cells.forEach(function(r,n){for(var i,a=r.site,o=r.edges.sort(Gr),s=-1,l=o.length,u=o[l-1].edge,c=u.l===a?u.r:u.l;++s<l;)u,i=c,c=(u=o[s].edge).l===a?u.r:u.l,n<i.i&&n<c.i&&cn(a,i,c)<0&&e.push([t[n],t[i.i],t[c.i]])}),e},e.x=function(t){return arguments.length?(a=St(n=t),e):n},e.y=function(t){return arguments.length?(o=St(i=t),e):i},e.clipExtent=function(t){return arguments.length?(s=null==t?sl:t,e):s===sl?null:s},e.size=function(t){return arguments.length?e.clipExtent(t&&[[0,0],t]):s===sl?null:s&&s[1]},e)};var sl=[[-1e6,-1e6],[1e6,1e6]];so.geom.delaunay=function(t){return so.geom.voronoi().triangles(t)},so.geom.quadtree=function(t,e,r,n,i){function a(t){function a(t,e,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,c=t.y;if(null!=l)if(yo(l-r)+yo(c-n)<.01)u(t,e,r,n,i,a,o,s);else{var h=t.point;t.x=t.y=t.point=null,u(t,h,l,c,i,a,o,s),u(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else u(t,e,r,n,i,a,o,s)}function u(t,e,r,n,i,o,s,l){var u=.5*(i+s),c=.5*(o+l),h=r>=u,f=n>=c,d=f<<1|h;t.leaf=!1,t=t.nodes[d]||(t.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),h?i=u:s=u,f?o=c:l=c,a(t,e,r,n,i,o,s,l)}var c,h,f,d,p,m,g,v,y,b=St(s),x=St(l);if(null!=e)m=e,g=r,v=n,y=i;else if(v=y=-(m=g=1/0),h=[],f=[],p=t.length,o)for(d=0;d<p;++d)(c=t[d]).x<m&&(m=c.x),c.y<g&&(g=c.y),c.x>v&&(v=c.x),c.y>y&&(y=c.y),h.push(c.x),f.push(c.y);else for(d=0;d<p;++d){var _=+b(c=t[d],d),w=+x(c,d);_<m&&(m=_),w<g&&(g=w),_>v&&(v=_),w>y&&(y=w),h.push(_),f.push(w)}var M=v-m,k=y-g;M>k?y=g+M:v=m+k;var A={leaf:!0,nodes:[],point:null,x:null,y:null};if(A.add=function(t){a(A,t,+b(t,++d),+x(t,d),m,g,v,y)},A.visit=function(t){dn(t,A,m,g,v,y)},A.find=function(t){return pn(A,t[0],t[1],m,g,v,y)},d=-1,null==e){for(;++d<p;)a(A,t[d],h[d],f[d],m,g,v,y);--d}else t.forEach(A.add);return h=f=t=c=null,A}var o,s=Lr,l=Cr;return(o=arguments.length)?(s=hn,l=fn,3===o&&(i=r,n=e,r=e=0),a(t)):(a.x=function(t){return arguments.length?(s=t,a):s},a.y=function(t){return arguments.length?(l=t,a):l},a.extent=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=+t[0][0],r=+t[0][1],n=+t[1][0],i=+t[1][1]),a):null==e?null:[[e,r],[n,i]]},a.size=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=r=0,n=+t[0],i=+t[1]),a):null==e?null:[n-e,i-r]},a)},so.interpolateRgb=mn,so.interpolateObject=gn,so.interpolateNumber=vn,so.interpolateString=yn;var ll=/[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,ul=new RegExp(ll.source,\"g\");so.interpolate=bn,so.interpolators=[function(t,e){var r=typeof e;return(\"string\"===r?es.has(e.toLowerCase())||/^(#|rgb\\(|hsl\\()/i.test(e)?mn:yn:e instanceof st?mn:Array.isArray(e)?xn:\"object\"===r&&isNaN(e)?gn:vn)(t,e)}],so.interpolateArray=xn;var cl=function(){return b},hl=so.map({linear:cl,poly:Sn,quad:function(){return kn},cubic:function(){return An},sin:function(){return En},exp:function(){return Ln},circle:function(){return Cn},elastic:zn,back:Dn,bounce:function(){return In}}),fl=so.map({in:b,out:wn,\"in-out\":Mn,\"out-in\":function(t){return Mn(wn(t))}});so.ease=function(t){var e=t.indexOf(\"-\"),r=e>=0?t.slice(0,e):t,n=e>=0?t.slice(e+1):\"in\";return r=hl.get(r)||cl,n=fl.get(n)||b,_n(n(r.apply(null,lo.call(arguments,1))))},so.interpolateHcl=Pn,so.interpolateHsl=On,so.interpolateLab=jn,so.interpolateRound=Rn,so.transform=function(t){var e=co.createElementNS(so.ns.prefix.svg,\"g\");return(so.transform=function(t){if(null!=t){e.setAttribute(\"transform\",t);var r=e.transform.baseVal.consolidate()}return new Fn(r?r.matrix:dl)})(t)},Fn.prototype.toString=function(){return\"translate(\"+this.translate+\")rotate(\"+this.rotate+\")skewX(\"+this.skew+\")scale(\"+this.scale+\")\"};var dl={a:1,b:0,c:0,d:1,e:0,f:0};so.interpolateTransform=Wn,so.layout={},so.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r<n;)e.push(Jn(t[r]));return e}},so.layout.chord=function(){function t(){var t,u,h,f,d,p={},m=[],g=so.range(a),v=[];for(r=[],n=[],t=0,f=-1;++f<a;){for(u=0,d=-1;++d<a;)u+=i[f][d];m.push(u),v.push(so.range(a)),t+=u}for(o&&g.sort(function(t,e){return o(m[t],m[e])}),s&&v.forEach(function(t,e){t.sort(function(t,r){return s(i[e][t],i[e][r])})}),t=(Fo-c*a)/t,u=0,f=-1;++f<a;){for(h=u,d=-1;++d<a;){var y=g[f],b=v[y][d],x=i[y][b],_=u,w=u+=x*t;p[y+\"-\"+b]={index:y,subindex:b,startAngle:_,endAngle:w,value:x}}n[y]={index:y,startAngle:h,endAngle:u,value:m[y]},u+=c}for(f=-1;++f<a;)for(d=f-1;++d<a;){var M=p[f+\"-\"+d],k=p[d+\"-\"+f];(M.value||k.value)&&r.push(M.value<k.value?{source:k,target:M}:{source:M,target:k})}l&&e()}function e(){r.sort(function(t,e){return l((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}var r,n,i,a,o,s,l,u={},c=0;return u.matrix=function(t){return arguments.length?(a=(i=t)&&i.length,r=n=null,u):i},u.padding=function(t){return arguments.length?(c=t,r=n=null,u):c},u.sortGroups=function(t){return arguments.length?(o=t,r=n=null,u):o},u.sortSubgroups=function(t){return arguments.length?(s=t,r=null,u):s},u.sortChords=function(t){return arguments.length?(l=t,r&&e(),u):l},u.chords=function(){return r||t(),r},u.groups=function(){return n||t(),n},u},so.layout.force=function(){function t(t){return function(e,r,n,i){if(e.point!==t){var a=e.cx-t.x,o=e.cy-t.y,s=i-r,l=a*a+o*o;if(s*s/v<l){if(l<m){u=e.charge/l;t.px-=a*u,t.py-=o*u}return!0}if(e.point&&l&&l<m){var u=e.pointCharge/l;t.px-=a*u,t.py-=o*u}}return!e.charge}}function e(t){t.px=so.event.x,t.py=so.event.y,l.resume()}var r,n,i,a,o,s,l={},u=so.dispatch(\"start\",\"tick\",\"end\"),c=[1,1],h=.9,f=pl,d=ml,p=-30,m=gl,g=.1,v=.64,y=[],x=[];return l.tick=function(){if((i*=.99)<.005)return r=null,u.end({type:\"end\",alpha:i=0}),!0;var e,n,l,f,d,m,v,b,_,w=y.length,M=x.length;for(n=0;n<M;++n)f=(l=x[n]).source,(m=(b=(d=l.target).x-f.x)*b+(_=d.y-f.y)*_)&&(b*=m=i*o[n]*((m=Math.sqrt(m))-a[n])/m,_*=m,d.x-=b*(v=f.weight+d.weight?f.weight/(f.weight+d.weight):.5),d.y-=_*v,f.x+=b*(v=1-v),f.y+=_*v);if((v=i*g)&&(b=c[0]/2,_=c[1]/2,n=-1,v))for(;++n<w;)(l=y[n]).x+=(b-l.x)*v,l.y+=(_-l.y)*v;if(p)for(ni(e=so.geom.quadtree(y),i,s),n=-1;++n<w;)(l=y[n]).fixed||e.visit(t(l));for(n=-1;++n<w;)(l=y[n]).fixed?(l.x=l.px,l.y=l.py):(l.x-=(l.px-(l.px=l.x))*h,l.y-=(l.py-(l.py=l.y))*h);u.tick({type:\"tick\",alpha:i})},l.nodes=function(t){return arguments.length?(y=t,l):y},l.links=function(t){return arguments.length?(x=t,l):x},l.size=function(t){return arguments.length?(c=t,l):c},l.linkDistance=function(t){return arguments.length?(f=\"function\"==typeof t?t:+t,l):f},l.distance=l.linkDistance,l.linkStrength=function(t){return arguments.length?(d=\"function\"==typeof t?t:+t,l):d},l.friction=function(t){return arguments.length?(h=+t,l):h},l.charge=function(t){return arguments.length?(p=\"function\"==typeof t?t:+t,l):p},l.chargeDistance=function(t){return arguments.length?(m=t*t,l):Math.sqrt(m)},l.gravity=function(t){return arguments.length?(g=+t,l):g},l.theta=function(t){return arguments.length?(v=t*t,l):Math.sqrt(v)},l.alpha=function(t){return arguments.length?(t=+t,i?t>0?i=t:(r.c=null,r.t=NaN,r=null,u.end({type:\"end\",alpha:i=0})):t>0&&(u.start({type:\"start\",alpha:i=t}),r=Dt(l.tick)),l):i},l.start=function(){function t(t,n){if(!r){for(r=new Array(i),l=0;l<i;++l)r[l]=[];for(l=0;l<u;++l){var a=x[l];r[a.source.index].push(a.target),r[a.target.index].push(a.source)}}for(var o,s=r[e],l=-1,c=s.length;++l<c;)if(!isNaN(o=s[l][t]))return o;return Math.random()*n}var e,r,n,i=y.length,u=x.length,h=c[0],m=c[1];for(e=0;e<i;++e)(n=y[e]).index=e,n.weight=0;for(e=0;e<u;++e)\"number\"==typeof(n=x[e]).source&&(n.source=y[n.source]),\"number\"==typeof n.target&&(n.target=y[n.target]),++n.source.weight,++n.target.weight;for(e=0;e<i;++e)n=y[e],isNaN(n.x)&&(n.x=t(\"x\",h)),isNaN(n.y)&&(n.y=t(\"y\",m)),isNaN(n.px)&&(n.px=n.x),isNaN(n.py)&&(n.py=n.y);if(a=[],\"function\"==typeof f)for(e=0;e<u;++e)a[e]=+f.call(this,x[e],e);else for(e=0;e<u;++e)a[e]=f;if(o=[],\"function\"==typeof d)for(e=0;e<u;++e)o[e]=+d.call(this,x[e],e);else for(e=0;e<u;++e)o[e]=d;if(s=[],\"function\"==typeof p)for(e=0;e<i;++e)s[e]=+p.call(this,y[e],e);else for(e=0;e<i;++e)s[e]=p;return l.resume()},l.resume=function(){return l.alpha(.1)},l.stop=function(){return l.alpha(0)},l.drag=function(){if(n||(n=so.behavior.drag().origin(b).on(\"dragstart.force\",$n).on(\"drag.force\",e).on(\"dragend.force\",ti)),!arguments.length)return n;this.on(\"mouseover.force\",ei).on(\"mouseout.force\",ri).call(n)},so.rebind(l,u,\"on\")};var pl=20,ml=1,gl=1/0;so.layout.hierarchy=function(){function t(i){var a,o=[i],s=[];for(i.depth=0;null!=(a=o.pop());)if(s.push(a),(u=r.call(t,a,a.depth))&&(l=u.length)){for(var l,u,c;--l>=0;)o.push(c=u[l]),c.parent=a,c.depth=a.depth+1;n&&(a.value=0),a.children=u}else n&&(a.value=+n.call(t,a,a.depth)||0),delete a.children;return oi(i,function(t){var r,i;e&&(r=t.children)&&r.sort(e),n&&(i=t.parent)&&(i.value+=t.value)}),s}var e=ui,r=si,n=li;return t.sort=function(r){return arguments.length?(e=r,t):e},t.children=function(e){return arguments.length?(r=e,t):r},t.value=function(e){return arguments.length?(n=e,t):n},t.revalue=function(e){return n&&(ai(e,function(t){t.children&&(t.value=0)}),oi(e,function(e){var r;e.children||(e.value=+n.call(t,e,e.depth)||0),(r=e.parent)&&(r.value+=e.value)})),e},t},so.layout.partition=function(){function t(e,r,n,i){var a=e.children;if(e.x=r,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(o=a.length)){var o,s,l,u=-1;for(n=e.value?n/e.value:0;++u<o;)t(s=a[u],r,l=s.value*n,i),r+=l}}function e(t){var r=t.children,n=0;if(r&&(i=r.length))for(var i,a=-1;++a<i;)n=Math.max(n,e(r[a]));return 1+n}function r(r,a){var o=n.call(this,r,a);return t(o[0],0,i[0],i[1]/e(o[0])),o}var n=so.layout.hierarchy(),i=[1,1];return r.size=function(t){return arguments.length?(i=t,r):i},ii(r,n)},so.layout.pie=function(){function t(o){var s,l=o.length,u=o.map(function(r,n){return+e.call(t,r,n)}),c=+(\"function\"==typeof n?n.apply(this,arguments):n),h=(\"function\"==typeof i?i.apply(this,arguments):i)-c,f=Math.min(Math.abs(h)/l,+(\"function\"==typeof a?a.apply(this,arguments):a)),d=f*(h<0?-1:1),p=so.sum(u),m=p?(h-l*d)/p:0,g=so.range(l),v=[];return null!=r&&g.sort(r===vl?function(t,e){return u[e]-u[t]}:function(t,e){return r(o[t],o[e])}),g.forEach(function(t){v[t]={data:o[t],value:s=u[t],startAngle:c,endAngle:c+=s*m+d,padAngle:f}}),v}var e=Number,r=vl,n=0,i=Fo,a=0;return t.value=function(r){return arguments.length?(e=r,t):e},t.sort=function(e){return arguments.length?(r=e,t):r},t.startAngle=function(e){return arguments.length?(n=e,t):n},t.endAngle=function(e){return arguments.length?(i=e,t):i},t.padAngle=function(e){return arguments.length?(a=e,t):a},t};var vl={};so.layout.stack=function(){function t(s,l){if(!(f=s.length))return s;var u=s.map(function(r,n){return e.call(t,r,n)}),c=u.map(function(e){return e.map(function(e,r){return[a.call(t,e,r),o.call(t,e,r)]})}),h=r.call(t,c,l);u=so.permute(u,h),c=so.permute(c,h);var f,d,p,m,g=n.call(t,c,l),v=u[0].length;for(p=0;p<v;++p)for(i.call(t,u[0][p],m=g[p],c[0][p][1]),d=1;d<f;++d)i.call(t,u[d][p],m+=c[d-1][p][1],c[d][p][1]);return s}var e=b,r=pi,n=mi,i=di,a=hi,o=fi;return t.values=function(r){return arguments.length?(e=r,t):e},t.order=function(e){return arguments.length?(r=\"function\"==typeof e?e:yl.get(e)||pi,t):r},t.offset=function(e){return arguments.length?(n=\"function\"==typeof e?e:bl.get(e)||mi,t):n},t.x=function(e){return arguments.length?(a=e,t):a},t.y=function(e){return arguments.length?(o=e,t):o},t.out=function(e){return arguments.length?(i=e,t):i},t};var yl=so.map({\"inside-out\":function(t){var e,r,n=t.length,i=t.map(gi),a=t.map(vi),o=so.range(n).sort(function(t,e){return i[t]-i[e]}),s=0,l=0,u=[],c=[];for(e=0;e<n;++e)r=o[e],s<l?(s+=a[r],u.push(r)):(l+=a[r],c.push(r));return c.reverse().concat(u)},reverse:function(t){return so.range(t.length).reverse()},default:pi}),bl=so.map({silhouette:function(t){var e,r,n,i=t.length,a=t[0].length,o=[],s=0,l=[];for(r=0;r<a;++r){for(e=0,n=0;e<i;e++)n+=t[e][r][1];n>s&&(s=n),o.push(n)}for(r=0;r<a;++r)l[r]=(s-o[r])/2;return l},wiggle:function(t){var e,r,n,i,a,o,s,l,u,c=t.length,h=t[0],f=h.length,d=[];for(d[0]=l=u=0,r=1;r<f;++r){for(e=0,i=0;e<c;++e)i+=t[e][r][1];for(e=0,a=0,s=h[r][0]-h[r-1][0];e<c;++e){for(n=0,o=(t[e][r][1]-t[e][r-1][1])/(2*s);n<e;++n)o+=(t[n][r][1]-t[n][r-1][1])/s;a+=o*t[e][r][1]}d[r]=l-=i?a/i*s:0,l<u&&(u=l)}for(r=0;r<f;++r)d[r]-=u;return d},expand:function(t){var e,r,n,i=t.length,a=t[0].length,o=1/i,s=[];for(r=0;r<a;++r){for(e=0,n=0;e<i;e++)n+=t[e][r][1];if(n)for(e=0;e<i;e++)t[e][r][1]/=n;else for(e=0;e<i;e++)t[e][r][1]=o}for(r=0;r<a;++r)s[r]=0;return s},zero:mi});so.layout.histogram=function(){function t(t,a){for(var o,s,l=[],u=t.map(r,this),c=n.call(this,u,a),h=i.call(this,c,u,a),a=-1,f=u.length,d=h.length-1,p=e?1:1/f;++a<d;)(o=l[a]=[]).dx=h[a+1]-(o.x=h[a]),o.y=0;if(d>0)for(a=-1;++a<f;)(s=u[a])>=c[0]&&s<=c[1]&&((o=l[so.bisect(h,s,1,d)-1]).y+=p,o.push(t[a]));return l}var e=!0,r=Number,n=_i,i=bi;return t.value=function(e){return arguments.length?(r=e,t):r},t.range=function(e){return arguments.length?(n=St(e),t):n},t.bins=function(e){return arguments.length?(i=\"number\"==typeof e?function(t){return xi(t,e)}:St(e),t):i},t.frequency=function(r){return arguments.length?(e=!!r,t):e},t},so.layout.pack=function(){function t(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],u=i[1],c=null==e?Math.sqrt:\"function\"==typeof e?e:function(){return e};if(s.x=s.y=0,oi(s,function(t){t.r=+c(t.value)}),oi(s,Ti),n){var h=n*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;oi(s,function(t){t.r+=h}),oi(s,Ti),oi(s,function(t){t.r-=h})}return Li(s,l/2,u/2,e?1:1/Math.max(2*s.r/l,2*s.r/u)),o}var e,r=so.layout.hierarchy().sort(wi),n=0,i=[1,1];return t.size=function(e){return arguments.length?(i=e,t):i},t.radius=function(r){return arguments.length?(e=null==r||\"function\"==typeof r?r:+r,t):e},t.padding=function(e){return arguments.length?(n=+e,t):n},ii(t,r)},so.layout.tree=function(){function t(t,i){var c=o.call(this,t,i),h=c[0],f=e(h);if(oi(f,r),f.parent.m=-f.z,ai(f,n),u)ai(h,a);else{var d=h,p=h,m=h;ai(h,function(t){t.x<d.x&&(d=t),t.x>p.x&&(p=t),t.depth>m.depth&&(m=t)});var g=s(d,p)/2-d.x,v=l[0]/(p.x+s(p,d)/2+g),y=l[1]/(m.depth||1);ai(h,function(t){t.x=(t.x+g)*v,t.y=t.depth*y})}return c}function e(t){for(var e,r={A:null,children:[t]},n=[r];null!=(e=n.pop());)for(var i,a=e.children,o=0,s=a.length;o<s;++o)n.push((a[o]=i={_:a[o],parent:e,children:(i=a[o].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=i);return r.children[0]}function r(t){var e=t.children,r=t.parent.children,n=t.i?r[t.i-1]:null;if(e.length){Oi(t);var a=(e[0].z+e[e.length-1].z)/2;n?(t.z=n.z+s(t._,n._),t.m=t.z-a):t.z=a}else n&&(t.z=n.z+s(t._,n._));t.parent.A=i(t,n,t.parent.A||r[0])}function n(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function i(t,e,r){if(e){for(var n,i=t,a=t,o=e,l=i.parent.children[0],u=i.m,c=a.m,h=o.m,f=l.m;o=Ii(o),i=Di(i),o&&i;)l=Di(l),(a=Ii(a)).a=t,(n=o.z+h-i.z-u+s(o._,i._))>0&&(Pi(ji(o,t,r),t,n),u+=n,c+=n),h+=o.m,u+=i.m,f+=l.m,c+=a.m;o&&!Ii(a)&&(a.t=o,a.m+=h-c),i&&!Di(l)&&(l.t=i,l.m+=u-f,r=t)}return r}function a(t){t.x*=l[0],t.y=t.depth*l[1]}var o=so.layout.hierarchy().sort(null).value(null),s=zi,l=[1,1],u=null;return t.separation=function(e){return arguments.length?(s=e,t):s},t.size=function(e){return arguments.length?(u=null==(l=e)?a:null,t):u?null:l},t.nodeSize=function(e){return arguments.length?(u=null==(l=e)?null:a,t):u?l:null},ii(t,o)},so.layout.cluster=function(){function t(t,a){var o,s=e.call(this,t,a),l=s[0],u=0;oi(l,function(t){var e=t.children;e&&e.length?(t.x=Fi(e),t.y=Ri(e)):(t.x=o?u+=r(t,o):0,t.y=0,o=t)});var c=Ni(l),h=Bi(l),f=c.x-r(c,h)/2,d=h.x+r(h,c)/2;return oi(l,i?function(t){t.x=(t.x-l.x)*n[0],t.y=(l.y-t.y)*n[1]}:function(t){t.x=(t.x-f)/(d-f)*n[0],t.y=(1-(l.y?t.y/l.y:1))*n[1]}),s}var e=so.layout.hierarchy().sort(null).value(null),r=zi,n=[1,1],i=!1;return t.separation=function(e){return arguments.length?(r=e,t):r},t.size=function(e){return arguments.length?(i=null==(n=e),t):i?null:n},t.nodeSize=function(e){return arguments.length?(i=null!=(n=e),t):i?n:null},ii(t,e)},so.layout.treemap=function(){function t(t,e){for(var r,n,i=-1,a=t.length;++i<a;)n=(r=t[i]).value*(e<0?0:e),r.area=isNaN(n)||n<=0?0:n}function e(r){var a=r.children;if(a&&a.length){var o,s,l,u=h(r),c=[],f=a.slice(),p=1/0,m=\"slice\"===d?u.dx:\"dice\"===d?u.dy:\"slice-dice\"===d?1&r.depth?u.dy:u.dx:Math.min(u.dx,u.dy);for(t(f,u.dx*u.dy/r.value),c.area=0;(l=f.length)>0;)c.push(o=f[l-1]),c.area+=o.area,\"squarify\"!==d||(s=n(c,m))<=p?(f.pop(),p=s):(c.area-=c.pop().area,i(c,m,u,!1),m=Math.min(u.dx,u.dy),c.length=c.area=0,p=1/0);c.length&&(i(c,m,u,!0),c.length=c.area=0),a.forEach(e)}}function r(e){var n=e.children;if(n&&n.length){var a,o=h(e),s=n.slice(),l=[];for(t(s,o.dx*o.dy/e.value),l.area=0;a=s.pop();)l.push(a),l.area+=a.area,null!=a.z&&(i(l,a.z?o.dx:o.dy,o,!s.length),l.length=l.area=0);n.forEach(r)}}function n(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++o<s;)(r=t[o].area)&&(r<a&&(a=r),r>i&&(i=r));return n*=n,e*=e,n?Math.max(e*i*p/n,n/(e*a*p)):1/0}function i(t,e,r,n){var i,a=-1,o=t.length,s=r.x,u=r.y,c=e?l(t.area/e):0;if(e==r.dx){for((n||c>r.dy)&&(c=r.dy);++a<o;)(i=t[a]).x=s,i.y=u,i.dy=c,s+=i.dx=Math.min(r.x+r.dx-s,c?l(i.area/c):0);i.z=!0,i.dx+=r.x+r.dx-s,r.y+=c,r.dy-=c}else{for((n||c>r.dx)&&(c=r.dx);++a<o;)(i=t[a]).x=s,i.y=u,i.dx=c,u+=i.dy=Math.min(r.y+r.dy-u,c?l(i.area/c):0);i.z=!1,i.dy+=r.y+r.dy-u,r.x+=c,r.dx-=c}}function a(n){var i=o||s(n),a=i[0];return a.x=a.y=0,a.value?(a.dx=u[0],a.dy=u[1]):a.dx=a.dy=0,o&&s.revalue(a),t([a],a.dx*a.dy/a.value),(o?r:e)(a),f&&(o=i),i}var o,s=so.layout.hierarchy(),l=Math.round,u=[1,1],c=null,h=Ui,f=!1,d=\"squarify\",p=.5*(1+Math.sqrt(5));return a.size=function(t){return arguments.length?(u=t,a):u},a.padding=function(t){function e(e){var r=t.call(a,e,e.depth);return null==r?Ui(e):Vi(e,\"number\"==typeof r?[r,r,r,r]:r)}function r(e){return Vi(e,t)}if(!arguments.length)return c;var n;return h=null==(c=t)?Ui:\"function\"==(n=typeof t)?e:\"number\"===n?(t=[t,t,t,t],r):r,a},a.round=function(t){return arguments.length?(l=t?Math.round:Number,a):l!=Number},a.sticky=function(t){return arguments.length?(f=t,o=null,a):f},a.ratio=function(t){return arguments.length?(p=t,a):p},a.mode=function(t){return arguments.length?(d=t+\"\",a):d},ii(a,s)},so.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 t=so.random.normal.apply(so,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=so.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,r=0;r<t;r++)e+=Math.random();return e}}},so.scale={};var xl={floor:b,ceil:b};so.scale.linear=function(){return Zi([0,1],[0,1],bn,!1)};var _l={s:1,g:1,p:1,r:1,e:1};so.scale.log=function(){return na(so.scale.linear().domain([0,1]),10,!0,[1,10])};var wl=so.format(\".0e\"),Ml={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};so.scale.pow=function(){return ia(so.scale.linear(),1,[0,1])},so.scale.sqrt=function(){return so.scale.pow().exponent(.5)},so.scale.ordinal=function(){return oa([],{t:\"range\",a:[[]]})},so.scale.category10=function(){return so.scale.ordinal().range(kl)},so.scale.category20=function(){return so.scale.ordinal().range(Al)},so.scale.category20b=function(){return so.scale.ordinal().range(Tl)},so.scale.category20c=function(){return so.scale.ordinal().range(Sl)};var kl=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(xt),Al=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(xt),Tl=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(xt),Sl=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(xt);so.scale.quantile=function(){return sa([],[])},so.scale.quantize=function(){return la(0,1,[0,1])},so.scale.threshold=function(){return ua([.5],[0,1])},so.scale.identity=function(){return ca([0,1])},so.svg={},so.svg.arc=function(){function t(){var t=Math.max(0,+r.apply(this,arguments)),u=Math.max(0,+n.apply(this,arguments)),c=o.apply(this,arguments)-Bo,h=s.apply(this,arguments)-Bo,f=Math.abs(h-c),d=c>h?0:1;if(u<t&&(p=u,u=t,t=p),f>=No)return e(u,d)+(t?e(t,1-d):\"\")+\"Z\";var p,m,g,v,y,b,x,_,w,M,k,A,T=0,S=0,E=[];if((v=(+l.apply(this,arguments)||0)/2)&&(g=a===El?Math.sqrt(t*t+u*u):+a.apply(this,arguments),d||(S*=-1),u&&(S=rt(g/u*Math.sin(v))),t&&(T=rt(g/t*Math.sin(v)))),u){y=u*Math.cos(c+S),b=u*Math.sin(c+S),x=u*Math.cos(h-S),_=u*Math.sin(h-S);var L=Math.abs(h-c-2*S)<=Ro?0:1;if(S&&va(y,b,x,_)===d^L){var C=(c+h)/2;y=u*Math.cos(C),b=u*Math.sin(C),x=_=null}}else y=b=0;if(t){w=t*Math.cos(h-T),M=t*Math.sin(h-T),k=t*Math.cos(c+T),A=t*Math.sin(c+T);var z=Math.abs(c-h+2*T)<=Ro?0:1;if(T&&va(w,M,k,A)===1-d^z){var D=(c+h)/2;w=t*Math.cos(D),M=t*Math.sin(D),k=A=null}}else w=M=0;if(f>Oo&&(p=Math.min(Math.abs(u-t)/2,+i.apply(this,arguments)))>.001){m=t<u^d?0:1;var I=p,P=p;if(f<Ro){var O=null==k?[w,M]:null==x?[y,b]:Pr([y,b],[k,A],[x,_],[w,M]),j=y-O[0],R=b-O[1],F=x-O[0],N=_-O[1],B=1/Math.sin(Math.acos((j*F+R*N)/(Math.sqrt(j*j+R*R)*Math.sqrt(F*F+N*N)))/2),U=Math.sqrt(O[0]*O[0]+O[1]*O[1]);P=Math.min(p,(t-U)/(B-1)),I=Math.min(p,(u-U)/(B+1))}if(null!=x){var V=ya(null==k?[w,M]:[k,A],[y,b],u,I,d),H=ya([x,_],[w,M],u,I,d);p===I?E.push(\"M\",V[0],\"A\",I,\",\",I,\" 0 0,\",m,\" \",V[1],\"A\",u,\",\",u,\" 0 \",1-d^va(V[1][0],V[1][1],H[1][0],H[1][1]),\",\",d,\" \",H[1],\"A\",I,\",\",I,\" 0 0,\",m,\" \",H[0]):E.push(\"M\",V[0],\"A\",I,\",\",I,\" 0 1,\",m,\" \",H[0])}else E.push(\"M\",y,\",\",b);if(null!=k){var q=ya([y,b],[k,A],t,-P,d),G=ya([w,M],null==x?[y,b]:[x,_],t,-P,d);p===P?E.push(\"L\",G[0],\"A\",P,\",\",P,\" 0 0,\",m,\" \",G[1],\"A\",t,\",\",t,\" 0 \",d^va(G[1][0],G[1][1],q[1][0],q[1][1]),\",\",1-d,\" \",q[1],\"A\",P,\",\",P,\" 0 0,\",m,\" \",q[0]):E.push(\"L\",G[0],\"A\",P,\",\",P,\" 0 0,\",m,\" \",q[0])}else E.push(\"L\",w,\",\",M)}else E.push(\"M\",y,\",\",b),null!=x&&E.push(\"A\",u,\",\",u,\" 0 \",L,\",\",d,\" \",x,\",\",_),E.push(\"L\",w,\",\",M),null!=k&&E.push(\"A\",t,\",\",t,\" 0 \",z,\",\",1-d,\" \",k,\",\",A);return E.push(\"Z\"),E.join(\"\")}function e(t,e){return\"M0,\"+t+\"A\"+t+\",\"+t+\" 0 1,\"+e+\" 0,\"+-t+\"A\"+t+\",\"+t+\" 0 1,\"+e+\" 0,\"+t}var r=fa,n=da,i=ha,a=El,o=pa,s=ma,l=ga;return t.innerRadius=function(e){return arguments.length?(r=St(e),t):r},t.outerRadius=function(e){return arguments.length?(n=St(e),t):n},t.cornerRadius=function(e){return arguments.length?(i=St(e),t):i},t.padRadius=function(e){return arguments.length?(a=e==El?El:St(e),t):a},t.startAngle=function(e){return arguments.length?(o=St(e),t):o},t.endAngle=function(e){return arguments.length?(s=St(e),t):s},t.padAngle=function(e){return arguments.length?(l=St(e),t):l},t.centroid=function(){var t=(+r.apply(this,arguments)+ +n.apply(this,arguments))/2,e=(+o.apply(this,arguments)+ +s.apply(this,arguments))/2-Bo;return[Math.cos(e)*t,Math.sin(e)*t]},t};var El=\"auto\";so.svg.line=function(){return ba(b)};var Ll=so.map({linear:xa,\"linear-closed\":_a,step:wa,\"step-before\":Ma,\"step-after\":ka,basis:Ca,\"basis-open\":za,\"basis-closed\":Da,bundle:Ia,cardinal:Sa,\"cardinal-open\":Aa,\"cardinal-closed\":Ta,monotone:Na});Ll.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Cl=[0,2/3,1/3,0],zl=[0,1/3,2/3,0],Dl=[0,1/6,2/3,1/6];so.svg.line.radial=function(){var t=ba(Ba);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},Ma.reverse=ka,ka.reverse=Ma,so.svg.area=function(){return Ua(b)},so.svg.area.radial=function(){var t=Ua(Ba);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},so.svg.chord=function(){function t(t,s){var l=e(this,a,t,s),u=e(this,o,t,s);return\"M\"+l.p0+n(l.r,l.p1,l.a1-l.a0)+(r(l,u)?i(l.r,l.p1,l.r,l.p0):i(l.r,l.p1,u.r,u.p0)+n(u.r,u.p1,u.a1-u.a0)+i(u.r,u.p1,l.r,l.p0))+\"Z\"}function e(t,e,r,n){var i=e.call(t,r,n),a=s.call(t,i,n),o=l.call(t,i,n)-Bo,c=u.call(t,i,n)-Bo;return{r:a,a0:o,a1:c,p0:[a*Math.cos(o),a*Math.sin(o)],p1:[a*Math.cos(c),a*Math.sin(c)]}}function r(t,e){return t.a0==e.a0&&t.a1==e.a1}function n(t,e,r){return\"A\"+t+\",\"+t+\" 0 \"+ +(r>Ro)+\",1 \"+e}function i(t,e,r,n){return\"Q 0,0 \"+n}var a=br,o=xr,s=Va,l=pa,u=ma;return t.radius=function(e){return arguments.length?(s=St(e),t):s},t.source=function(e){return arguments.length?(a=St(e),t):a},t.target=function(e){return arguments.length?(o=St(e),t):o},t.startAngle=function(e){return arguments.length?(l=St(e),t):l},t.endAngle=function(e){return arguments.length?(u=St(e),t):u},t},so.svg.diagonal=function(){function t(t,i){var a=e.call(this,t,i),o=r.call(this,t,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return\"M\"+(l=l.map(n))[0]+\"C\"+l[1]+\" \"+l[2]+\" \"+l[3]}var e=br,r=xr,n=Ha;return t.source=function(r){return arguments.length?(e=St(r),t):e},t.target=function(e){return arguments.length?(r=St(e),t):r},t.projection=function(e){return arguments.length?(n=e,t):n},t},so.svg.diagonal.radial=function(){var t=so.svg.diagonal(),e=Ha,r=t.projection;return t.projection=function(t){return arguments.length?r(qa(e=t)):e},t},so.svg.symbol=function(){function t(t,n){return(Il.get(e.call(this,t,n))||Wa)(r.call(this,t,n))}var e=Ya,r=Ga;return t.type=function(r){return arguments.length?(e=St(r),t):e},t.size=function(e){return arguments.length?(r=St(e),t):r},t};var Il=so.map({circle:Wa,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*Ol)),r=e*Ol;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/Pl),r=e*Pl/2;return\"M0,\"+r+\"L\"+e+\",\"+-r+\" \"+-e+\",\"+-r+\"Z\"},\"triangle-up\":function(t){var e=Math.sqrt(t/Pl),r=e*Pl/2;return\"M0,\"+-r+\"L\"+e+\",\"+r+\" \"+-e+\",\"+r+\"Z\"}});so.svg.symbolTypes=Il.keys();var Pl=Math.sqrt(3),Ol=Math.tan(30*Uo);So.transition=function(t){for(var e,r,n=jl||++Bl,i=Ka(t),a=[],o=Rl||{time:Date.now(),ease:Tn,delay:0,duration:250},s=-1,l=this.length;++s<l;){a.push(e=[]);for(var u=this[s],c=-1,h=u.length;++c<h;)(r=u[c])&&$a(r,c,i,n,o),e.push(r)}return Za(a,i,n)},So.interrupt=function(t){return this.each(null==t?Fl:Xa(Ka(t)))};var jl,Rl,Fl=Xa(Ka()),Nl=[],Bl=0;Nl.call=So.call,Nl.empty=So.empty,Nl.node=So.node,Nl.size=So.size,so.transition=function(t,e){return t&&t.transition?jl?t.transition(e):t:so.selection().transition(t)},so.transition.prototype=Nl,Nl.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=L(t);for(var s=-1,l=this.length;++s<l;){o.push(e=[]);for(var u=this[s],c=-1,h=u.length;++c<h;)(n=u[c])&&(r=t.call(n,n.__data__,c,s))?(\"__data__\"in n&&(r.__data__=n.__data__),$a(r,c,a,i,n[a][i]),e.push(r)):e.push(null)}return Za(o,a,i)},Nl.selectAll=function(t){var e,r,n,i,a,o=this.id,s=this.namespace,l=[];t=C(t);for(var u=-1,c=this.length;++u<c;)for(var h=this[u],f=-1,d=h.length;++f<d;)if(n=h[f]){a=n[s][o],r=t.call(n,n.__data__,f,u),l.push(e=[]);for(var p=-1,m=r.length;++p<m;)(i=r[p])&&$a(i,p,s,o,a),e.push(i)}return Za(l,s,o)},Nl.filter=function(t){var e,r,n,i=[];\"function\"!=typeof t&&(t=V(t));for(var a=0,o=this.length;a<o;a++){i.push(e=[]);for(var s=0,l=(r=this[a]).length;s<l;s++)(n=r[s])&&t.call(n,n.__data__,s,a)&&e.push(n)}return Za(i,this.namespace,this.id)},Nl.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):q(this,null==e?function(e){e[n][r].tween.remove(t)}:function(i){i[n][r].tween.set(t,e)})},Nl.attr=function(t,e){function r(){this.removeAttribute(s)}function n(){this.removeAttributeNS(s.space,s.local)}function i(t){return null==t?r:(t+=\"\",function(){var e,r=this.getAttribute(s);return r!==t&&(e=o(r,t),function(t){this.setAttribute(s,e(t))})})}function a(t){return null==t?n:(t+=\"\",function(){var e,r=this.getAttributeNS(s.space,s.local);return r!==t&&(e=o(r,t),function(t){this.setAttributeNS(s.space,s.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var o=\"transform\"==t?Wn:bn,s=so.ns.qualify(t);return Ja(this,\"attr.\"+t,e,s.local?a:i)},Nl.attrTween=function(t,e){function r(t,r){var n=e.call(this,t,r,this.getAttribute(i));return n&&function(t){this.setAttribute(i,n(t))}}function n(t,r){var n=e.call(this,t,r,this.getAttributeNS(i.space,i.local));return n&&function(t){this.setAttributeNS(i.space,i.local,n(t))}}var i=so.ns.qualify(t);return this.tween(\"attr.\"+t,i.local?n:r)},Nl.style=function(t,e,n){function i(){this.style.removeProperty(t)}function a(e){return null==e?i:(e+=\"\",function(){var i,a=r(this).getComputedStyle(this,null).getPropertyValue(t);return a!==e&&(i=bn(a,e),function(e){this.style.setProperty(t,i(e),n)})})}var o=arguments.length;if(o<3){if(\"string\"!=typeof t){o<2&&(e=\"\");for(n in t)this.style(n,t[n],e);return this}n=\"\"}return Ja(this,\"style.\"+t,e,a)},Nl.styleTween=function(t,e,n){function i(i,a){var o=e.call(this,i,a,r(this).getComputedStyle(this,null).getPropertyValue(t));return o&&function(e){this.style.setProperty(t,o(e),n)}}return arguments.length<3&&(n=\"\"),this.tween(\"style.\"+t,i)},Nl.text=function(t){return Ja(this,\"text\",t,Qa)},Nl.remove=function(){var t=this.namespace;return this.each(\"end.transition\",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},Nl.ease=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].ease:(\"function\"!=typeof t&&(t=so.ease.apply(so,arguments)),q(this,function(n){n[r][e].ease=t}))},Nl.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:q(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}))},Nl.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:q(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}))},Nl.each=function(t,e){var r=this.id,n=this.namespace;if(arguments.length<2){var i=Rl,a=jl;try{jl=r,q(this,function(e,i,a){Rl=e[n][r],t.call(e,e.__data__,i,a)})}finally{Rl=i,jl=a}}else q(this,function(i){var a=i[n][r];(a.event||(a.event=so.dispatch(\"start\",\"end\",\"interrupt\"))).on(t,e)});return this},Nl.transition=function(){for(var t,e,r,n,i=this.id,a=++Bl,o=this.namespace,s=[],l=0,u=this.length;l<u;l++){s.push(t=[]);for(var c=0,h=(e=this[l]).length;c<h;c++)(r=e[c])&&$a(r,c,o,a,{time:(n=r[o][i]).time,ease:n.ease,delay:n.delay+n.duration,duration:n.duration}),t.push(r)}return Za(s,o,a)},so.svg.axis=function(){function t(t){t.each(function(){var t,u=so.select(this),c=this.__chart__||r,h=this.__chart__=r.copy(),f=null==l?h.ticks?h.ticks.apply(h,s):h.domain():l,d=null==e?h.tickFormat?h.tickFormat.apply(h,s):b:e,p=u.selectAll(\".tick\").data(f,h),m=p.enter().insert(\"g\",\".domain\").attr(\"class\",\"tick\").style(\"opacity\",Oo),g=so.transition(p.exit()).style(\"opacity\",Oo).remove(),v=so.transition(p.order()).style(\"opacity\",1),y=Math.max(i,0)+o,x=qi(h),_=u.selectAll(\".domain\").data([0]),w=(_.enter().append(\"path\").attr(\"class\",\"domain\"),so.transition(_));m.append(\"line\"),m.append(\"text\");var M,k,A,T,S=m.select(\"line\"),E=v.select(\"line\"),L=p.select(\"text\").text(d),C=m.select(\"text\"),z=v.select(\"text\"),D=\"top\"===n||\"left\"===n?-1:1;if(\"bottom\"===n||\"top\"===n?(t=to,M=\"x\",A=\"y\",k=\"x2\",T=\"y2\",L.attr(\"dy\",D<0?\"0em\":\".71em\").style(\"text-anchor\",\"middle\"),w.attr(\"d\",\"M\"+x[0]+\",\"+D*a+\"V0H\"+x[1]+\"V\"+D*a)):(t=eo,M=\"y\",A=\"x\",k=\"y2\",T=\"x2\",L.attr(\"dy\",\".32em\").style(\"text-anchor\",D<0?\"end\":\"start\"),w.attr(\"d\",\"M\"+D*a+\",\"+x[0]+\"H0V\"+x[1]+\"H\"+D*a)),S.attr(T,D*i),C.attr(A,D*y),E.attr(k,0).attr(T,D*i),z.attr(M,0).attr(A,D*y),h.rangeBand){var I=h,P=I.rangeBand()/2;c=h=function(t){return I(t)+P}}else c.rangeBand?c=h:g.call(t,h,c);m.call(t,c,h),v.call(t,h,h)})}var e,r=so.scale.linear(),n=Ul,i=6,a=6,o=3,s=[10],l=null;return t.scale=function(e){return arguments.length?(r=e,t):r},t.orient=function(e){return arguments.length?(n=e in Vl?e+\"\":Ul,t):n},t.ticks=function(){return arguments.length?(s=uo(arguments),t):s},t.tickValues=function(e){return arguments.length?(l=e,t):l},t.tickFormat=function(r){return arguments.length?(e=r,t):e},t.tickSize=function(e){var r=arguments.length;return r?(i=+e,a=+arguments[r-1],t):i},t.innerTickSize=function(e){return arguments.length?(i=+e,t):i},t.outerTickSize=function(e){return arguments.length?(a=+e,t):a},t.tickPadding=function(e){return arguments.length?(o=+e,t):o},t.tickSubdivide=function(){return arguments.length&&t},t};var Ul=\"bottom\",Vl={top:1,right:1,bottom:1,left:1};so.svg.brush=function(){function t(r){r.each(function(){var r=so.select(this).style(\"pointer-events\",\"all\").style(\"-webkit-tap-highlight-color\",\"rgba(0,0,0,0)\").on(\"mousedown.brush\",a).on(\"touchstart.brush\",a),o=r.selectAll(\".background\").data([0]);o.enter().append(\"rect\").attr(\"class\",\"background\").style(\"visibility\",\"hidden\").style(\"cursor\",\"crosshair\"),r.selectAll(\".extent\").data([0]).enter().append(\"rect\").attr(\"class\",\"extent\").style(\"cursor\",\"move\");var s=r.selectAll(\".resize\").data(m,b);s.exit().remove(),s.enter().append(\"g\").attr(\"class\",function(t){return\"resize \"+t}).style(\"cursor\",function(t){return Hl[t]}).append(\"rect\").attr(\"x\",function(t){return/[ew]$/.test(t)?-3:null}).attr(\"y\",function(t){return/^[ns]/.test(t)?-3:null}).attr(\"width\",6).attr(\"height\",6).style(\"visibility\",\"hidden\"),s.style(\"display\",t.empty()?\"none\":null);var l,h=so.transition(r),f=so.transition(o);u&&(l=qi(u),f.attr(\"x\",l[0]).attr(\"width\",l[1]-l[0]),n(h)),c&&(l=qi(c),f.attr(\"y\",l[0]).attr(\"height\",l[1]-l[0]),i(h)),e(h)})}function e(t){t.selectAll(\".resize\").attr(\"transform\",function(t){return\"translate(\"+h[+/e$/.test(t)]+\",\"+f[+/^s/.test(t)]+\")\"})}function n(t){t.select(\".extent\").attr(\"x\",h[0]),t.selectAll(\".extent,.n>rect,.s>rect\").attr(\"width\",h[1]-h[0])}function i(t){t.select(\".extent\").attr(\"y\",f[0]),t.selectAll(\".extent,.e>rect,.w>rect\").attr(\"height\",f[1]-f[0])}function a(){function a(){32==so.event.keyCode&&(L||(b=null,z[0]-=h[1],z[1]-=f[1],L=2),A())}function m(){32==so.event.keyCode&&2==L&&(z[0]+=h[1],z[1]+=f[1],L=0,A())}function g(){var t=so.mouse(_),r=!1;x&&(t[0]+=x[0],t[1]+=x[1]),L||(so.event.altKey?(b||(b=[(h[0]+h[1])/2,(f[0]+f[1])/2]),z[0]=h[+(t[0]<b[0])],z[1]=f[+(t[1]<b[1])]):b=null),S&&v(t,u,0)&&(n(k),r=!0),E&&v(t,c,1)&&(i(k),r=!0),r&&(e(k),M({type:\"brush\",mode:L?\"move\":\"resize\"}))}function v(t,e,r){var n,i,a=qi(e),l=a[0],u=a[1],c=z[r],m=r?f:h,g=m[1]-m[0];if(L&&(l-=c,u-=g+c),n=(r?p:d)?Math.max(l,Math.min(u,t[r])):t[r],L?i=(n+=c)+g:(b&&(c=Math.max(l,Math.min(u,2*b[r]-n))),c<n?(i=n,n=c):i=c),m[0]!=n||m[1]!=i)return r?s=null:o=null,m[0]=n,m[1]=i,!0}function y(){g(),k.style(\"pointer-events\",\"all\").selectAll(\".resize\").style(\"display\",t.empty()?\"none\":null),so.select(\"body\").style(\"cursor\",null),D.on(\"mousemove.brush\",null).on(\"mouseup.brush\",null).on(\"touchmove.brush\",null).on(\"touchend.brush\",null).on(\"keydown.brush\",null).on(\"keyup.brush\",null),C(),M({type:\"brushend\"})}var b,x,_=this,w=so.select(so.event.target),M=l.of(_,arguments),k=so.select(_),T=w.datum(),S=!/^(n|s)$/.test(T)&&u,E=!/^(e|w)$/.test(T)&&c,L=w.classed(\"extent\"),C=J(_),z=so.mouse(_),D=so.select(r(_)).on(\"keydown.brush\",a).on(\"keyup.brush\",m);if(so.event.changedTouches?D.on(\"touchmove.brush\",g).on(\"touchend.brush\",y):D.on(\"mousemove.brush\",g).on(\"mouseup.brush\",y),k.interrupt().selectAll(\"*\").interrupt(),L)z[0]=h[0]-z[0],z[1]=f[0]-z[1];else if(T){var I=+/w$/.test(T),P=+/^n/.test(T);x=[h[1-I]-z[0],f[1-P]-z[1]],z[0]=h[I],z[1]=f[P]}else so.event.altKey&&(b=z.slice());k.style(\"pointer-events\",\"none\").selectAll(\".resize\").style(\"display\",null),so.select(\"body\").style(\"cursor\",w.style(\"cursor\")),M({type:\"brushstart\"}),g()}var o,s,l=S(t,\"brushstart\",\"brush\",\"brushend\"),u=null,c=null,h=[0,0],f=[0,0],d=!0,p=!0,m=ql[0];return t.event=function(t){t.each(function(){var t=l.of(this,arguments),e={x:h,y:f,i:o,j:s},r=this.__chart__||e;this.__chart__=e,jl?so.select(this).transition().each(\"start.brush\",function(){o=r.i,s=r.j,h=r.x,f=r.y,t({type:\"brushstart\"})}).tween(\"brush:brush\",function(){var r=xn(h,e.x),n=xn(f,e.y);return o=s=null,function(i){h=e.x=r(i),f=e.y=n(i),t({type:\"brush\",mode:\"resize\"})}}).each(\"end.brush\",function(){o=e.i,s=e.j,t({type:\"brush\",mode:\"resize\"}),t({type:\"brushend\"})}):(t({type:\"brushstart\"}),t({type:\"brush\",mode:\"resize\"}),t({type:\"brushend\"}))})},t.x=function(e){return arguments.length?(u=e,m=ql[!u<<1|!c],t):u},t.y=function(e){return arguments.length?(c=e,m=ql[!u<<1|!c],t):c},t.clamp=function(e){return arguments.length?(u&&c?(d=!!e[0],p=!!e[1]):u?d=!!e:c&&(p=!!e),t):u&&c?[d,p]:u?d:c?p:null},t.extent=function(e){var r,n,i,a,l;return arguments.length?(u&&(r=e[0],n=e[1],c&&(r=r[0],n=n[0]),o=[r,n],u.invert&&(r=u(r),n=u(n)),n<r&&(l=r,r=n,n=l),r==h[0]&&n==h[1]||(h=[r,n])),c&&(i=e[0],a=e[1],u&&(i=i[1],a=a[1]),s=[i,a],c.invert&&(i=c(i),a=c(a)),a<i&&(l=i,i=a,a=l),i==f[0]&&a==f[1]||(f=[i,a])),t):(u&&(o?(r=o[0],n=o[1]):(r=h[0],n=h[1],u.invert&&(r=u.invert(r),n=u.invert(n)),n<r&&(l=r,r=n,n=l))),c&&(s?(i=s[0],a=s[1]):(i=f[0],a=f[1],c.invert&&(i=c.invert(i),a=c.invert(a)),a<i&&(l=i,i=a,a=l))),u&&c?[[r,i],[n,a]]:u?[r,n]:c&&[i,a])},t.clear=function(){return t.empty()||(h=[0,0],f=[0,0],o=s=null),t},t.empty=function(){return!!u&&h[0]==h[1]||!!c&&f[0]==f[1]},so.rebind(t,l,\"on\")};var Hl={n:\"ns-resize\",e:\"ew-resize\",s:\"ns-resize\",w:\"ew-resize\",nw:\"nwse-resize\",ne:\"nesw-resize\",se:\"nwse-resize\",sw:\"nesw-resize\"},ql=[[\"n\",\"e\",\"s\",\"w\",\"nw\",\"ne\",\"se\",\"sw\"],[\"e\",\"w\"],[\"n\",\"s\"],[]],Gl=cs.format=gs.timeFormat,Yl=Gl.utc,Wl=Yl(\"%Y-%m-%dT%H:%M:%S.%LZ\");Gl.iso=Date.prototype.toISOString&&+new Date(\"2000-01-01T00:00:00.000Z\")?ro:Wl,ro.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},ro.toString=Wl.toString,cs.second=Ut(function(t){return new hs(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),cs.seconds=cs.second.range,cs.seconds.utc=cs.second.utc.range,cs.minute=Ut(function(t){return new hs(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),cs.minutes=cs.minute.range,cs.minutes.utc=cs.minute.utc.range,cs.hour=Ut(function(t){var e=t.getTimezoneOffset()/60;return new hs(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),cs.hours=cs.hour.range,cs.hours.utc=cs.hour.utc.range,cs.month=Ut(function(t){return(t=cs.day(t)).setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),cs.months=cs.month.range,cs.months.utc=cs.month.utc.range;var Xl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Zl=[[cs.second,1],[cs.second,5],[cs.second,15],[cs.second,30],[cs.minute,1],[cs.minute,5],[cs.minute,15],[cs.minute,30],[cs.hour,1],[cs.hour,3],[cs.hour,6],[cs.hour,12],[cs.day,1],[cs.day,2],[cs.week,1],[cs.month,1],[cs.month,3],[cs.year,1]],Jl=Gl.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\",Ce]]),Ql={range:function(t,e,r){return so.range(Math.ceil(t/r)*r,+e,r).map(io)},floor:b,ceil:b};Zl.year=cs.year,cs.scale=function(){return no(so.scale.linear(),Zl,Jl)};var Kl=Zl.map(function(t){return[t[0].utc,t[1]]}),$l=Yl.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\",Ce]]);Kl.year=cs.year.utc,cs.scale.utc=function(){return no(so.scale.linear(),Kl,$l)},so.text=Et(function(t){return t.responseText}),so.json=function(t,e){return Lt(t,\"application/json\",ao,e)},so.html=function(t,e){return Lt(t,\"text/html\",oo,e)},so.xml=Et(function(t){return t.responseXML}),\"object\"==typeof e&&e.exports?e.exports=so:this.d3=so}()},{}],108:[function(t,e,r){\"use strict\";function n(t,e){this.point=t,this.index=e}function i(t,e){for(var r=t.point,n=e.point,i=r.length,a=0;a<i;++a){var o=n[a]-r[a];if(o)return o}return 0}function a(t,e,r){if(1===t)return r?[[-1,0]]:[];var n=e.map(function(t,e){return[t[0],e]});n.sort(function(t,e){return t[0]-e[0]});for(var i=new Array(t-1),a=1;a<t;++a){var o=n[a-1],s=n[a];i[a-1]=[o[1],s[1]]}return r&&i.push([-1,i[0][1]],[i[t-1][1],-1]),i}function o(t,e){var r=t.length;if(0===r)return[];var o=t[0].length;if(o<1)return[];if(1===o)return a(r,t,e);for(var u=new Array(r),c=1,h=0;h<r;++h){for(var f=t[h],d=new Array(o+1),p=0,m=0;m<o;++m){var g=f[m];d[m]=g,p+=g*g}d[o]=p,u[h]=new n(d,h),c=Math.max(p,c)}l(u,i),r=u.length;for(var v=new Array(r+o+1),y=new Array(r+o+1),b=(o+1)*(o+1)*c,x=new Array(o+1),h=0;h<=o;++h)x[h]=0;x[o]=b,v[0]=x.slice(),y[0]=-1;for(h=0;h<=o;++h)(d=x.slice())[h]=1,v[h+1]=d,y[h+1]=-1;for(h=0;h<r;++h){var _=u[h];v[h+o+1]=_.point,y[h+o+1]=_.index}var w=s(v,!1);if(w=e?w.filter(function(t){for(var e=0,r=0;r<=o;++r){var n=y[t[r]];if(n<0&&++e>=2)return!1;t[r]=n}return!0}):w.filter(function(t){for(var e=0;e<=o;++e){var r=y[t[e]];if(r<0)return!1;t[e]=r}return!0}),1&o)for(h=0;h<w.length;++h){d=(_=w[h])[0];_[0]=_[1],_[1]=d}return w}var s=t(\"incremental-convex-hull\"),l=t(\"uniq\");e.exports=o},{\"incremental-convex-hull\":273,uniq:523}],109:[function(t,e,r){(function(t){function r(t,e){return d[0]=t,d[1]=e,f[0]}function n(t){return f[0]=t,d[0]}function i(t){return f[0]=t,d[1]}function a(t,e){return d[1]=t,d[0]=e,f[0]}function o(t){return f[0]=t,d[1]}function s(t){return f[0]=t,d[0]}function l(t,e){return p.writeUInt32LE(t,0,!0),p.writeUInt32LE(e,4,!0),p.readDoubleLE(0,!0)}function u(t){return p.writeDoubleLE(t,0,!0),p.readUInt32LE(0,!0)}function c(t){return p.writeDoubleLE(t,0,!0),p.readUInt32LE(4,!0)}var h=!1;if(\"undefined\"!=typeof Float64Array){var f=new Float64Array(1),d=new Uint32Array(f.buffer);f[0]=1,h=!0,1072693248===d[1]?(e.exports=function(t){return f[0]=t,[d[0],d[1]]},e.exports.pack=r,e.exports.lo=n,e.exports.hi=i):1072693248===d[0]?(e.exports=function(t){return f[0]=t,[d[1],d[0]]},e.exports.pack=a,e.exports.lo=o,e.exports.hi=s):h=!1}if(!h){var p=new t(8);e.exports=function(t){return p.writeDoubleLE(t,0,!0),[p.readUInt32LE(0,!0),p.readUInt32LE(4,!0)]},e.exports.pack=l,e.exports.lo=u,e.exports.hi=c}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){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:70}],110:[function(t,e,r){\"use strict\";function n(t,e,r){var i=0|t[r];if(i<=0)return[];var a,o=new Array(i);if(r===t.length-1)for(a=0;a<i;++a)o[a]=e;else for(a=0;a<i;++a)o[a]=n(t,e,r+1);return o}function i(t,e){var r,n;for(r=new Array(t),n=0;n<t;++n)r[n]=e;return r}function a(t,e){switch(void 0===e&&(e=0),typeof t){case\"number\":if(t>0)return i(0|t,e);break;case\"object\":if(\"number\"==typeof t.length)return n(t,e,0)}return[]}e.exports=a},{}],111:[function(t,e,r){\"use strict\";function n(t,e,r){r=r||2;var n=e&&e.length,a=n?e[0]*r:t.length,s=i(t,0,a,r,!0),l=[];if(!s)return l;var u,c,f,d,p,m,g;if(n&&(s=h(t,e,s,r)),t.length>80*r){u=f=t[0],c=d=t[1];for(var v=r;v<a;v+=r)p=t[v],m=t[v+1],p<u&&(u=p),m<c&&(c=m),p>f&&(f=p),m>d&&(d=m);g=Math.max(f-u,d-c)}return o(s,l,r,u,c,g),l}function i(t,e,r,n,i){var a,o;if(i===z(t,e,r,n)>0)for(a=e;a<r;a+=n)o=E(a,t[a],t[a+1],o);else for(a=r-n;a>=e;a-=n)o=E(a,t[a],t[a+1],o);return o&&w(o,o.next)&&(L(o),o=o.next),o}function a(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!w(n,n.next)&&0!==_(n.prev,n,n.next))n=n.next;else{if(L(n),(n=e=n.prev)===n.next)return null;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,i,h,f){if(t){!f&&h&&m(t,n,i,h);for(var d,p,g=t;t.prev!==t.next;)if(d=t.prev,p=t.next,h?l(t,n,i,h):s(t))e.push(d.i/r),e.push(t.i/r),e.push(p.i/r),L(t),t=p.next,g=p.next;else if((t=p)===g){f?1===f?o(t=u(t,e,r),e,r,n,i,h,2):2===f&&c(t,e,r,n,i,h):o(a(t),e,r,n,i,h,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(_(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(b(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&_(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function l(t,e,r,n){var i=t.prev,a=t,o=t.next;if(_(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,l=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,u=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=v(s,l,e,r,n),f=v(u,c,e,r,n),d=t.nextZ;d&&d.z<=f;){if(d!==t.prev&&d!==t.next&&b(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=t.prevZ;d&&d.z>=h;){if(d!==t.prev&&d!==t.next&&b(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function u(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!w(i,a)&&M(i,n,n.next,a)&&A(i,a)&&A(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),L(n),L(n.next),n=t=a),n=n.next}while(n!==t);return n}function c(t,e,r,n,i,s){var l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&x(l,u)){var c=S(l,u);return l=a(l,l.next),c=a(c,c.next),o(l,e,r,n,i,s),void o(c,e,r,n,i,s)}u=u.next}l=l.next}while(l!==t)}function h(t,e,r,n){var o,s,l,u=[];for(o=0,s=e.length;o<s;o++)(l=i(t,e[o]*n,o<s-1?e[o+1]*n:t.length,n,!1))===l.next&&(l.steiner=!0),u.push(y(l));for(u.sort(f),o=0;o<u.length;o++)d(u[o],r),r=a(r,r.next);return r}function f(t,e){return t.x-e.x}function d(t,e){if(e=p(t,e)){var r=S(e,t);a(r,r.next)}}function p(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!r)return null;if(i===o)return r.prev;var l,u=r,c=r.x,h=r.y,f=1/0;for(n=r.next;n!==u;)i>=n.x&&n.x>=c&&b(a<h?i:o,a,c,h,a<h?o:i,a,n.x,n.y)&&((l=Math.abs(a-n.y)/(i-n.x))<f||l===f&&n.x>r.x)&&A(n,t)&&(r=n,f=l),n=n.next;return r}function m(t,e,r,n){var i=t;do{null===i.z&&(i.z=v(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,g(i)}function g(t){var e,r,n,i,a,o,s,l,u=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e<u&&(s++,n=n.nextZ);e++);for(l=u;s>0||l>0&&n;)0===s?(i=n,n=n.nextZ,l--):0!==l&&n?r.z<=n.z?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--):(i=r,r=r.nextZ,s--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,u*=2}while(o>1);return t}function v(t,e,r,n,i){return t=32767*(t-r)/i,e=32767*(e-n)/i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function y(t){var e=t,r=t;do{e.x<r.x&&(r=e),e=e.next}while(e!==t);return r}function b(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 x(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!k(t,e)&&A(t,e)&&A(e,t)&&T(t,e)}function _(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function w(t,e){return t.x===e.x&&t.y===e.y}function M(t,e,r,n){return!!(w(t,e)&&w(r,n)||w(t,n)&&w(r,e))||_(t,e,r)>0!=_(t,e,n)>0&&_(r,n,t)>0!=_(r,n,e)>0}function k(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&M(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function A(t,e){return _(t.prev,t,t.next)<0?_(t,e,t.next)>=0&&_(t,t.prev,e)>=0:_(t,e,t.prev)<0||_(t,t.next,e)<0}function T(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}function S(t,e){var r=new C(t.i,t.x,t.y),n=new C(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function E(t,e,r,n){var i=new C(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function L(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function C(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function z(t,e,r,n){for(var i=0,a=e,o=r-n;a<r;a+=n)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}e.exports=n,n.deviation=function(t,e,r,n){var i=e&&e.length,a=i?e[0]*r:t.length,o=Math.abs(z(t,0,a,r));if(i)for(var s=0,l=e.length;s<l;s++){var u=e[s]*r,c=s<l-1?e[s+1]*r:t.length;o-=Math.abs(z(t,u,c,r))}var h=0;for(s=0;s<n.length;s+=3){var f=n[s]*r,d=n[s+1]*r,p=n[s+2]*r;h+=Math.abs((t[f]-t[p])*(t[d+1]-t[f+1])-(t[f]-t[d])*(t[p+1]-t[f+1]))}return 0===o&&0===h?0:Math.abs((h-o)/o)},n.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var a=0;a<t[i].length;a++)for(var o=0;o<e;o++)r.vertices.push(t[i][a][o]);i>0&&(n+=t[i-1].length,r.holes.push(n))}return r}},{}],112:[function(t,e,r){\"use strict\";function n(t,e){var r=t.length;if(\"number\"!=typeof e){e=0;for(o=0;o<r;++o){var n=t[o];e=Math.max(e,n[0],n[1])}e=1+(0|e)}e|=0;for(var a=new Array(e),o=0;o<e;++o)a[o]=[];for(o=0;o<r;++o)a[(n=t[o])[0]].push(n[1]),a[n[1]].push(n[0]);for(var s=0;s<e;++s)i(a[s],function(t,e){return t-e});return a}e.exports=n;var i=t(\"uniq\")},{uniq:523}],113:[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||\"object\"==typeof t&&null!==t}function r(t){return\"function\"==typeof t}function a(t){G=t}function o(t){Y=t}function s(){return function(){q(u)}}function l(){var t=setTimeout;return function(){return t(u,1)}}function u(){for(var t=0;t<H;t+=2)(0,K[t])(K[t+1]),K[t]=void 0,K[t+1]=void 0;H=0}function c(t,e){var r=arguments,n=this,i=new this.constructor(f);void 0===i[tt]&&z(i);var a=n._state;return a?function(){var t=r[a-1];Y(function(){return E(a,i,t,n._result)})}():k(n,i,t,e),i}function h(t){var e=this;if(t&&\"object\"==typeof t&&t.constructor===e)return t;var r=new e(f);return x(r,t),r}function f(){}function d(){return new TypeError(\"You cannot resolve a promise with itself\")}function p(){return new TypeError(\"A promises callback cannot return that same promise.\")}function m(t){try{return t.then}catch(t){return it.error=t,it}}function g(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}function v(t,e,r){Y(function(t){var n=!1,i=g(r,e,function(r){n||(n=!0,e!==r?x(t,r):w(t,r))},function(e){n||(n=!0,M(t,e))},\"Settle: \"+(t._label||\" unknown promise\"));!n&&i&&(n=!0,M(t,i))},t)}function y(t,e){e._state===rt?w(t,e._result):e._state===nt?M(t,e._result):k(e,void 0,function(e){return x(t,e)},function(e){return M(t,e)})}function b(t,e,n){e.constructor===t.constructor&&n===c&&e.constructor.resolve===h?y(t,e):n===it?M(t,it.error):void 0===n?w(t,e):r(n)?v(t,e,n):w(t,e)}function x(t,r){t===r?M(t,d()):e(r)?b(t,r,m(r)):w(t,r)}function _(t){t._onerror&&t._onerror(t._result),A(t)}function w(t,e){t._state===et&&(t._result=e,t._state=rt,0!==t._subscribers.length&&Y(A,t))}function M(t,e){t._state===et&&(t._state=nt,t._result=e,Y(_,t))}function k(t,e,r,n){var i=t._subscribers,a=i.length;t._onerror=null,i[a]=e,i[a+rt]=r,i[a+nt]=n,0===a&&t._state&&Y(A,t)}function A(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?E(r,n,i,a):i(a);t._subscribers.length=0}}function T(){this.error=null}function S(t,e){try{return t(e)}catch(t){return at.error=t,at}}function E(t,e,n,i){var a=r(n),o=void 0,s=void 0,l=void 0,u=void 0;if(a){if(o=S(n,i),o===at?(u=!0,s=o.error,o=null):l=!0,e===o)return void M(e,p())}else o=i,l=!0;e._state!==et||(a&&l?x(e,o):u?M(e,s):t===rt?w(e,o):t===nt&&M(e,o))}function L(t,e){try{e(function(e){x(t,e)},function(e){M(t,e)})}catch(e){M(t,e)}}function C(){return ot++}function z(t){t[tt]=ot++,t._state=void 0,t._result=void 0,t._subscribers=[]}function D(t,e){this._instanceConstructor=t,this.promise=new t(f),this.promise[tt]||z(this.promise),V(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?w(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&w(this.promise,this._result))):M(this.promise,I())}function I(){return new Error(\"Array Methods must be provided an Array\")}function P(t){return new D(this,t).promise}function O(t){var e=this;return new e(V(t)?function(r,n){for(var i=t.length,a=0;a<i;a++)e.resolve(t[a]).then(r,n)}:function(t,e){return e(new TypeError(\"You must pass an array to race.\"))})}function j(t){var e=new this(f);return M(e,t),e}function R(){throw new TypeError(\"You must pass a resolver function as the first argument to the promise constructor\")}function F(){throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\")}function N(t){this[tt]=C(),this._result=this._state=void 0,this._subscribers=[],f!==t&&(\"function\"!=typeof t&&R(),this instanceof N?L(this,t):F())}function B(){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=N}var U=void 0,V=U=Array.isArray?Array.isArray:function(t){return\"[object Array]\"===Object.prototype.toString.call(t)},H=0,q=void 0,G=void 0,Y=function(t,e){K[H]=t,K[H+1]=e,2===(H+=2)&&(G?G(u):$())},W=\"undefined\"!=typeof window?window:void 0,X=W||{},Z=X.MutationObserver||X.WebKitMutationObserver,J=\"undefined\"==typeof self&&void 0!==n&&\"[object process]\"==={}.toString.call(n),Q=\"undefined\"!=typeof Uint8ClampedArray&&\"undefined\"!=typeof importScripts&&\"undefined\"!=typeof MessageChannel,K=new Array(1e3),$=void 0;$=J?function(){return function(){return n.nextTick(u)}}():Z?function(){var t=0,e=new Z(u),r=document.createTextNode(\"\");return e.observe(r,{characterData:!0}),function(){r.data=t=++t%2}}():Q?function(){var t=new MessageChannel;return t.port1.onmessage=u,function(){return t.port2.postMessage(0)}}():void 0===W&&\"function\"==typeof t?function(){try{var e=t(\"vertx\");return q=e.runOnLoop||e.runOnContext,s()}catch(t){return l()}}():l();var tt=Math.random().toString(36).substring(16),et=void 0,rt=1,nt=2,it=new T,at=new T,ot=0;return D.prototype._enumerate=function(){for(var t=this.length,e=this._input,r=0;this._state===et&&r<t;r++)this._eachEntry(e[r],r)},D.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===h){var i=m(t);if(i===c&&t._state!==et)this._settledAt(t._state,e,t._result);else if(\"function\"!=typeof i)this._remaining--,this._result[e]=t;else if(r===N){var a=new r(f);b(a,t,i),this._willSettleAt(a,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},D.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===et&&(this._remaining--,t===nt?M(n,r):this._result[e]=r),0===this._remaining&&w(n,this._result)},D.prototype._willSettleAt=function(t,e){var r=this;k(t,void 0,function(t){return r._settledAt(rt,e,t)},function(t){return r._settledAt(nt,e,t)})},N.all=P,N.race=O,N.resolve=h,N.reject=j,N._setScheduler=a,N._setAsap=o,N._asap=Y,N.prototype={constructor:N,then:c,catch:function(t){return this.then(null,t)}},B(),N.polyfill=B,N.Promise=N,N})}).call(this,t(\"_process\"),\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{_process:468}],114:[function(t,e,r){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return\"function\"==typeof t}function a(t){return\"number\"==typeof t}function o(t){return\"object\"==typeof t&&null!==t}function s(t){return void 0===t}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!a(t)||t<0||isNaN(t))throw TypeError(\"n must be a positive number\");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,r,n,a,l,u;if(this._events||(this._events={}),\"error\"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var c=new Error('Uncaught, unspecified \"error\" event. ('+e+\")\");throw c.context=e,c}if(r=this._events[t],s(r))return!1;if(i(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),r.apply(this,a)}else if(o(r))for(a=Array.prototype.slice.call(arguments,1),n=(u=r.slice()).length,l=0;l<n;l++)u[l].apply(this,a);return!0},n.prototype.addListener=function(t,e){var r;if(!i(e))throw TypeError(\"listener must be a function\");return this._events||(this._events={}),this._events.newListener&&this.emit(\"newListener\",t,i(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned&&(r=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&r>0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error(\"(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.\",this._events[t].length),\"function\"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError(\"listener must be a function\");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,a,s;if(!i(e))throw TypeError(\"listener must be a function\");if(!this._events||!this._events[t])return this;if(r=this._events[t],a=r.length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit(\"removeListener\",t,e);else if(o(r)){for(s=a;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit(\"removeListener\",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)\"removeListener\"!==e&&this.removeAllListeners(e);return this.removeAllListeners(\"removeListener\"),this._events={},this}if(r=this._events[t],i(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){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)}},{}],115:[function(t,e,r){\"use strict\";function n(t,e,r){var n=e||0,i=r||1;return[[t[12]+t[0],t[13]+t[1],t[14]+t[2],t[15]+t[3]],[t[12]-t[0],t[13]-t[1],t[14]-t[2],t[15]-t[3]],[t[12]+t[4],t[13]+t[5],t[14]+t[6],t[15]+t[7]],[t[12]-t[4],t[13]-t[5],t[14]-t[6],t[15]-t[7]],[n*t[12]+t[8],n*t[13]+t[9],n*t[14]+t[10],n*t[15]+t[11]],[i*t[12]-t[8],i*t[13]-t[9],i*t[14]-t[10],i*t[15]-t[11]]]}e.exports=n},{}],116:[function(t,e,r){\"use strict\";function n(t){for(var e,r=t.length,n=0;n<r;n++)if(((e=t.charCodeAt(n))<9||e>13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}e.exports=function(t){var e=typeof t;if(\"string\"===e){var r=t;if(0===(t=+t)&&n(r))return!1}else if(\"number\"!==e)return!1;return t-t<1}},{}],117:[function(t,e,r){\"use strict\";function n(t){return new Function(\"f\",\"var p = (f && f.properties || {}); return \"+i(t))}function i(t){if(!t)return\"true\";var e=t[0];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?c(s(t.slice(1),\"||\")):\"in\"===e?l(t[1],t.slice(2)):\"!in\"===e?c(l(t[1],t.slice(2))):\"has\"===e?u(t[1]):\"!has\"===e?c(u([t[1]])):\"true\")+\")\"}function a(t){return\"$type\"===t?\"f.type\":\"$id\"===t?\"f.id\":\"p[\"+JSON.stringify(t)+\"]\"}function o(t,e,r,n){var i=a(t),o=\"$type\"===t?f.indexOf(e):JSON.stringify(e);return(n?\"typeof \"+i+\"=== typeof \"+o+\"&&\":\"\")+i+r+o}function s(t,e){return t.map(i).join(e)}function l(t,e){\"$type\"===t&&(e=e.map(function(t){return f.indexOf(t)}));var r=JSON.stringify(e.sort(h)),n=a(t);return e.length<=200?r+\".indexOf(\"+n+\") !== -1\":\"function(v, a, i, j) {while (i <= j) { var m = (i + j) >> 1;    if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;}return false; }(\"+n+\", \"+r+\",0,\"+(e.length-1)+\")\"}function u(t){return JSON.stringify(t)+\" in p\"}function c(t){return\"!(\"+t+\")\"}function h(t,e){return t<e?-1:t>e?1:0}e.exports=n;var f=[\"Unknown\",\"Point\",\"LineString\",\"Polygon\"]},{}],118:[function(t,e,r){\"use strict\";function n(t,e,r){return Math.min(e,Math.max(t,r))}function i(t,e,r){this.dimension=t.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;n<this.dimension;++n)this.bounds[0][n]=-1/0,this.bounds[1][n]=1/0;this._state=t.slice().reverse(),this._velocity=e.slice().reverse(),this._time=[r],this._scratch=[t.slice(),t.slice(),t.slice(),t.slice(),t.slice()]}function a(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=0;return e}function o(t,e,r){switch(arguments.length){case 0:return new i([0],[0],0);case 1:return\"number\"==typeof t?new i(n=a(t),n,0):new i(t,a(t.length),0);case 2:if(\"number\"==typeof e){var n=a(t.length);return new i(t,n,+e)}r=0;case 3:if(t.length!==e.length)throw new Error(\"state and velocity lengths must match\");return new i(t,e,r)}}e.exports=o;var s=t(\"cubic-hermite\"),l=t(\"binary-search-bounds\"),u=i.prototype;u.flush=function(t){var e=l.gt(this._time,t)-1;e<=0||(this._time.splice(0,e),this._state.splice(0,e*this.dimension),this._velocity.splice(0,e*this.dimension))},u.curve=function(t){var e=this._time,r=e.length,i=l.le(e,t),a=this._scratch[0],o=this._state,u=this._velocity,c=this.dimension,h=this.bounds;if(i<0)for(var f=c-1,d=0;d<c;++d,--f)a[d]=o[f];else if(i>=r-1)for(var f=o.length-1,p=t-e[r-1],d=0;d<c;++d,--f)a[d]=o[f]+p*u[f];else{for(var f=c*(i+1)-1,m=e[i],g=e[i+1]-m||1,v=this._scratch[1],y=this._scratch[2],b=this._scratch[3],x=this._scratch[4],_=!0,d=0;d<c;++d,--f)v[d]=o[f],b[d]=u[f]*g,y[d]=o[f+c],x[d]=u[f+c]*g,_=_&&v[d]===y[d]&&b[d]===x[d]&&0===b[d];if(_)for(d=0;d<c;++d)a[d]=v[d];else s(v,b,y,x,(t-m)/g,a)}for(var w=h[0],M=h[1],d=0;d<c;++d)a[d]=n(w[d],M[d],a[d]);return a},u.dcurve=function(t){var e=this._time,r=e.length,n=l.le(e,t),i=this._scratch[0],a=this._state,o=this._velocity,u=this.dimension;if(n>=r-1)for(var c=a.length-1,h=(e[r-1],0);h<u;++h,--c)i[h]=o[c];else{for(var c=u*(n+1)-1,f=e[n],d=e[n+1]-f||1,p=this._scratch[1],m=this._scratch[2],g=this._scratch[3],v=this._scratch[4],y=!0,h=0;h<u;++h,--c)p[h]=a[c],g[h]=o[c]*d,m[h]=a[c+u],v[h]=o[c+u]*d,y=y&&p[h]===m[h]&&g[h]===v[h]&&0===g[h];if(y)for(h=0;h<u;++h)i[h]=0;else{s.derivative(p,g,m,v,(t-f)/d,i);for(h=0;h<u;++h)i[h]/=d}}return i},u.lastT=function(){var t=this._time;return t[t.length-1]},u.stable=function(){for(var t=this._velocity,e=t.length,r=this.dimension-1;r>=0;--r)if(t[--e])return!1;return!0},u.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t<e||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],u=s[1];this._time.push(e,t);for(var c=0;c<2;++c)for(h=0;h<r;++h)i.push(i[o++]),a.push(0);this._time.push(t);for(var h=r;h>0;--h)i.push(n(l[h-1],u[h-1],arguments[h])),a.push(0)}},u.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t<e||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=t-e,l=this.bounds,u=l[0],c=l[1],h=s>1e-6?1/s:0;this._time.push(t);for(var f=r;f>0;--f){var d=n(u[f-1],c[f-1],arguments[f]);i.push(d),a.push((d-i[o++])*h)}}},u.set=function(t){var e=this.dimension;if(!(t<this.lastT()||arguments.length!==e+1)){var r=this._state,i=this._velocity,a=this.bounds,o=a[0],s=a[1];this._time.push(t);for(var l=e;l>0;--l)r.push(n(o[l-1],s[l-1],arguments[l])),i.push(0)}},u.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],u=s[1],c=t-e,h=c>1e-6?1/c:0;this._time.push(t);for(var f=r;f>0;--f){var d=arguments[f];i.push(n(l[f-1],u[f-1],i[o++]+d)),a.push(d*h)}}},u.idle=function(t){var e=this.lastT();if(!(t<e)){var r=this.dimension,i=this._state,a=this._velocity,o=i.length-r,s=this.bounds,l=s[0],u=s[1],c=t-e;this._time.push(t);for(var h=r-1;h>=0;--h)i.push(n(l[h],u[h],i[o]+c*a[o])),a.push(0),o+=1}}},{\"binary-search-bounds\":59,\"cubic-hermite\":102}],119:[function(t,e,r){\"use strict\";function n(t){var e,r,n=(t=t||{}).canvas||document.createElement(\"canvas\"),a=t.family||\"monospace\",o=t.shape||[512,512],s=t.step||[32,32],l=t.size||16,u=t.chars||[32,126],c=Math.floor((s[0]-l)/2),h=t.radius||1.5*c,f=new i(l,c,h,0,a);if(\"number\"==typeof l&&(l+=\"px\"),Array.isArray(u)){if(2===u.length&&\"number\"==typeof u[0]&&\"number\"==typeof u[1]){var d=[];for(e=u[0],r=0;e<=u[1];e++)d[r++]=String.fromCharCode(e);u=d}}else u=String(u).split(\"\");o=o.slice(),n.width=o[0],n.height=o[1];var p=n.getContext(\"2d\");p.fillStyle=\"#000\",p.fillRect(0,0,n.width,n.height),p.font=l+\" \"+a,p.textBaseline=\"middle\";var m=0,g=0,v=Math.min(u.length,Math.floor(o[0]/s[0])*Math.ceil(o[1]/s[1])),y=f.ctx.textAlign,b=f.buffer;for(f.ctx.textAlign=\"center\",f.buffer=f.size/2,e=0;e<v;e++){var x=f.draw(u[e]);p.putImageData(x,m,g),(m+=s[0])>o[0]-s[0]&&(m=0,g+=s[1])}return f.ctx.textAlign=y,f.buffer=b,n}var i=t(\"tiny-sdf\");e.exports=n},{\"tiny-sdf\":513}],120:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=a}function i(t){return new n(t._color,t.key,t.value,t.left,t.right,t._count)}function a(t,e){return new n(t,e.key,e.value,e.left,e.right,e._count)}function o(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function s(t,e){this._compare=t,this.root=e}function l(t,e){if(e.left&&(r=l(t,e.left)))return r;var r=t(e.key,e.value);return r||(e.right?l(t,e.right):void 0)}function u(t,e,r,n){if(e(t,n.key)<=0){if(n.left&&(i=u(t,e,r,n.left)))return i;var i=r(n.key,n.value);if(i)return i}if(n.right)return u(t,e,r,n.right)}function c(t,e,r,n,i){var a,o=r(t,i.key),s=r(e,i.key);if(o<=0){if(i.left&&(a=c(t,e,r,n,i.left)))return a;if(s>0&&(a=n(i.key,i.value)))return a}if(s>0&&i.right)return c(t,e,r,n,i.right)}function h(t,e){this.tree=t,this._stack=e}function f(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function d(t){for(var e,r,n,s,l=t.length-1;l>=0;--l){if(e=t[l],0===l)return void(e._color=v);if((r=t[l-1]).left===e){if((n=r.right).right&&n.right._color===g)return n=r.right=i(n),s=n.right=i(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=v,r._color=v,s._color=v,o(r),o(n),l>1&&((u=t[l-2]).left===r?u.left=n:u.right=n),void(t[l-1]=n);if(n.left&&n.left._color===g)return n=r.right=i(n),s=n.left=i(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=v,n._color=v,e._color=v,o(r),o(n),o(s),l>1&&((u=t[l-2]).left===r?u.left=s:u.right=s),void(t[l-1]=s);if(n._color===v){if(r._color===g)return r._color=v,void(r.right=a(g,n));r.right=a(g,n);continue}n=i(n),r.right=n.left,n.left=r,n._color=r._color,r._color=g,o(r),o(n),l>1&&((u=t[l-2]).left===r?u.left=n:u.right=n),t[l-1]=n,t[l]=r,l+1<t.length?t[l+1]=e:t.push(e),l+=2}else{if((n=r.left).left&&n.left._color===g)return n=r.left=i(n),s=n.left=i(n.left),r.left=n.right,n.right=r,n.left=s,n._color=r._color,e._color=v,r._color=v,s._color=v,o(r),o(n),l>1&&((u=t[l-2]).right===r?u.right=n:u.left=n),void(t[l-1]=n);if(n.right&&n.right._color===g)return n=r.left=i(n),s=n.right=i(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=v,n._color=v,e._color=v,o(r),o(n),o(s),l>1&&((u=t[l-2]).right===r?u.right=s:u.left=s),void(t[l-1]=s);if(n._color===v){if(r._color===g)return r._color=v,void(r.left=a(g,n));r.left=a(g,n);continue}if(n=i(n),r.left=n.right,n.right=r,n._color=r._color,r._color=g,o(r),o(n),l>1){var u=t[l-2];u.right===r?u.right=n:u.left=n}t[l-1]=n,t[l]=r,l+1<t.length?t[l+1]=e:t.push(e),l+=2}}}function p(t,e){return t<e?-1:t>e?1:0}function m(t){return new s(t||p,null)}e.exports=m;var g=0,v=1,y=s.prototype;Object.defineProperty(y,\"keys\",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(y,\"values\",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(y,\"length\",{get:function(){return this.root?this.root._count:0}}),y.insert=function(t,e){for(var r=this._compare,i=this.root,l=[],u=[];i;){var c=r(t,i.key);l.push(i),u.push(c),i=c<=0?i.left:i.right}l.push(new n(g,t,e,null,null,1));for(h=l.length-2;h>=0;--h){i=l[h];u[h]<=0?l[h]=new n(i._color,i.key,i.value,l[h+1],i.right,i._count+1):l[h]=new n(i._color,i.key,i.value,i.left,l[h+1],i._count+1)}for(var h=l.length-1;h>1;--h){var f=l[h-1],i=l[h];if(f._color===v||i._color===v)break;var d=l[h-2];if(d.left===f)if(f.left===i){if(!(p=d.right)||p._color!==g){d._color=g,d.left=f.right,f._color=v,f.right=d,l[h-2]=f,l[h-1]=i,o(d),o(f),h>=3&&((m=l[h-3]).left===d?m.left=f:m.right=f);break}f._color=v,d.right=a(v,p),d._color=g,h-=1}else{if(!(p=d.right)||p._color!==g){f.right=i.left,d._color=g,d.left=i.right,i._color=v,i.left=f,i.right=d,l[h-2]=i,l[h-1]=f,o(d),o(f),o(i),h>=3&&((m=l[h-3]).left===d?m.left=i:m.right=i);break}f._color=v,d.right=a(v,p),d._color=g,h-=1}else if(f.right===i){if(!(p=d.left)||p._color!==g){d._color=g,d.right=f.left,f._color=v,f.left=d,l[h-2]=f,l[h-1]=i,o(d),o(f),h>=3&&((m=l[h-3]).right===d?m.right=f:m.left=f);break}f._color=v,d.left=a(v,p),d._color=g,h-=1}else{var p=d.left;if(!p||p._color!==g){if(f.left=i.right,d._color=g,d.right=i.left,i._color=v,i.right=f,i.left=d,l[h-2]=i,l[h-1]=f,o(d),o(f),o(i),h>=3){var m=l[h-3];m.right===d?m.right=i:m.left=i}break}f._color=v,d.left=a(v,p),d._color=g,h-=1}}return l[0]._color=v,new s(r,l[0])},y.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return l(t,this.root);case 2:return u(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return c(e,r,this._compare,t,this.root)}},Object.defineProperty(y,\"begin\",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new h(this,t)}}),Object.defineProperty(y,\"end\",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new h(this,t)}}),y.at=function(t){if(t<0)return new h(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t<e.left._count){e=e.left;continue}t-=e.left._count}if(!t)return new h(this,r);if(t-=1,!e.right)break;if(t>=e.right._count)break;e=e.right}return new h(this,[])},y.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new h(this,n)},y.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new h(this,n)},y.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new h(this,n)},y.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new h(this,n)},y.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new h(this,n);r=i<=0?r.left:r.right}return new h(this,[])},y.remove=function(t){var e=this.find(t);return e?e.remove():this},y.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var b=h.prototype;Object.defineProperty(b,\"valid\",{get:function(){return this._stack.length>0}}),Object.defineProperty(b,\"node\",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),b.clone=function(){return new h(this.tree,this._stack.slice())},b.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new n(r._color,r.key,r.value,r.left,r.right,r._count);for(l=t.length-2;l>=0;--l)(r=t[l]).left===t[l+1]?e[l]=new n(r._color,r.key,r.value,e[l+1],r.right,r._count):e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count);if((r=e[e.length-1]).left&&r.right){var i=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var a=e[i-1];e.push(new n(r._color,a.key,a.value,r.left,r.right,r._count)),e[i-1].key=r.key,e[i-1].value=r.value;for(l=e.length-2;l>=i;--l)r=e[l],e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count);e[i-1].left=e[i]}if((r=e[e.length-1])._color===g){var o=e[e.length-2];o.left===r?o.left=null:o.right===r&&(o.right=null),e.pop();for(l=0;l<e.length;++l)e[l]._count--;return new s(this.tree._compare,e[0])}if(r.left||r.right){r.left?f(r,r.left):r.right&&f(r,r.right),r._color=v;for(l=0;l<e.length-1;++l)e[l]._count--;return new s(this.tree._compare,e[0])}if(1===e.length)return new s(this.tree._compare,null);for(var l=0;l<e.length;++l)e[l]._count--;var u=e[e.length-2];return d(e),u.left===r?u.left=null:u.right=null,new s(this.tree._compare,e[0])},Object.defineProperty(b,\"key\",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(b,\"value\",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(b,\"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}),b.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(b,\"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}}),b.update=function(t){var e=this._stack;if(0===e.length)throw new Error(\"Can't update empty node!\");var r=new Array(e.length),i=e[e.length-1];r[r.length-1]=new n(i._color,i.key,t,i.left,i.right,i._count);for(var a=e.length-2;a>=0;--a)(i=e[a]).left===e[a+1]?r[a]=new n(i._color,i.key,i.value,r[a+1],i.right,i._count):r[a]=new n(i._color,i.key,i.value,i.left,r[a+1],i._count);return new s(this.tree._compare,r[0])},b.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(b,\"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}})},{}],121:[function(t,e,r){function n(t){if(t<0)return Number(\"0/0\");for(var e=o[0],r=o.length-1;r>0;--r)e+=o[r]/(t+r);var n=t+a+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}var i=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],a=607/128,o=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];e.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(n(e));e-=1;for(var r=i[0],a=1;a<9;a++)r+=i[a]/(e+a);var o=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,e+.5)*Math.exp(-o)*r},e.exports.log=n},{}],122:[function(t,e,r){function n(t){if(\"Polygon\"===t.type)return i(t.coordinates);if(\"MultiPolygon\"===t.type){for(var e=0,r=0;r<t.coordinates.length;r++)e+=i(t.coordinates[r]);return e}return null}function i(t){var e=0;if(t&&t.length>0){e+=Math.abs(a(t[0]));for(var r=1;r<t.length;r++)e-=Math.abs(a(t[r]))}return e}function a(t){var e=0;if(t.length>2){for(var r,n,i=0;i<t.length-1;i++)r=t[i],e+=o((n=t[i+1])[0]-r[0])*(2+Math.sin(o(r[1]))+Math.sin(o(n[1])));e=e*s.RADIUS*s.RADIUS/2}return e}function o(t){return t*Math.PI/180}var s=t(\"wgs84\");e.exports.geometry=n,e.exports.ring=a},{wgs84:545}],123:[function(t,e,r){function n(t,e){switch(t&&t.type||null){case\"FeatureCollection\":return t.features=t.features.map(i(n,e)),t;case\"Feature\":return t.geometry=n(t.geometry,e),t;case\"Polygon\":case\"MultiPolygon\":return a(t,e);default:return t}}function i(t,e){return function(r){return t(r,e)}}function a(t,e){return\"Polygon\"===t.type?t.coordinates=o(t.coordinates,e):\"MultiPolygon\"===t.type&&(t.coordinates=t.coordinates.map(i(o,e))),t}function o(t,e){e=!!e,t[0]=s(t[0],!e);for(var r=1;r<t.length;r++)t[r]=s(t[r],e);return t}function s(t,e){return l(t)===e?t:t.reverse()}function l(t){return u.ring(t)>=0}var u=t(\"geojson-area\");e.exports=n},{\"geojson-area\":122}],124:[function(t,e,r){\"use strict\";function n(t,e,r,n,o,l,u,c){if(r/=e,n/=e,u>=r&&c<=n)return t;if(u>n||c<r)return null;for(var h=[],f=0;f<t.length;f++){var d,p,m=t[f],g=m.geometry,v=m.type;if(d=m.min[o],p=m.max[o],d>=r&&p<=n)h.push(m);else if(!(d>n||p<r)){var y=1===v?i(g,r,n,o):a(g,r,n,o,l,3===v);y.length&&h.push(s(m.tags,v,y,m.id))}}return h.length?h:null}function i(t,e,r,n){for(var i=[],a=0;a<t.length;a++){var o=t[a],s=o[n];s>=e&&s<=r&&i.push(o)}return i}function a(t,e,r,n,i,a){for(var s=[],l=0;l<t.length;l++){var u,c,h,f=0,d=0,p=null,m=t[l],g=m.area,v=m.dist,y=m.outer,b=m.length,x=[];for(c=0;c<b-1;c++)u=p||m[c],p=m[c+1],f=d||u[n],d=p[n],f<e?d>r?(x.push(i(u,p,e),i(u,p,r)),a||(x=o(s,x,g,v,y))):d>=e&&x.push(i(u,p,e)):f>r?d<e?(x.push(i(u,p,r),i(u,p,e)),a||(x=o(s,x,g,v,y))):d<=r&&x.push(i(u,p,r)):(x.push(u),d<e?(x.push(i(u,p,e)),a||(x=o(s,x,g,v,y))):d>r&&(x.push(i(u,p,r)),a||(x=o(s,x,g,v,y))));(f=(u=m[b-1])[n])>=e&&f<=r&&x.push(u),h=x[x.length-1],a&&h&&(x[0][0]!==h[0]||x[0][1]!==h[1])&&x.push(x[0]),o(s,x,g,v,y)}return s}function o(t,e,r,n,i){return e.length&&(e.area=r,e.dist=n,void 0!==i&&(e.outer=i),t.push(e)),[]}e.exports=n;var s=t(\"./feature\")},{\"./feature\":126}],125:[function(t,e,r){\"use strict\";function n(t,e){var r=[];if(\"FeatureCollection\"===t.type)for(var n=0;n<t.features.length;n++)i(r,t.features[n],e);else\"Feature\"===t.type?i(r,t,e):i(r,{geometry:t},e);return r}function i(t,e,r){if(null!==e.geometry){var n,s,l,c,h=e.geometry,f=h.type,d=h.coordinates,p=e.properties,m=e.id;if(\"Point\"===f)t.push(u(p,1,[o(d)],m));else if(\"MultiPoint\"===f)t.push(u(p,1,a(d),m));else if(\"LineString\"===f)t.push(u(p,2,[a(d,r)],m));else if(\"MultiLineString\"===f||\"Polygon\"===f){for(l=[],n=0;n<d.length;n++)c=a(d[n],r),\"Polygon\"===f&&(c.outer=0===n),l.push(c);t.push(u(p,\"Polygon\"===f?3:2,l,m))}else if(\"MultiPolygon\"===f){for(l=[],n=0;n<d.length;n++)for(s=0;s<d[n].length;s++)(c=a(d[n][s],r)).outer=0===s,l.push(c);t.push(u(p,3,l,m))}else{if(\"GeometryCollection\"!==f)throw new Error(\"Input data is not a valid GeoJSON object.\");for(n=0;n<h.geometries.length;n++)i(t,{geometry:h.geometries[n],properties:p},r)}}}function a(t,e){for(var r=[],n=0;n<t.length;n++)r.push(o(t[n]));return e&&(l(r,e),s(r)),r}function o(t){var e=Math.sin(t[1]*Math.PI/180),r=t[0]/360+.5,n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n=n<0?0:n>1?1:n,[r,n,0]}function s(t){for(var e,r,n=0,i=0,a=0;a<t.length-1;a++)e=r||t[a],r=t[a+1],n+=e[0]*r[1]-r[0]*e[1],i+=Math.abs(r[0]-e[0])+Math.abs(r[1]-e[1]);t.area=Math.abs(n/2),t.dist=i}e.exports=n;var l=t(\"./simplify\"),u=t(\"./feature\")},{\"./feature\":126,\"./simplify\":128}],126:[function(t,e,r){\"use strict\";function n(t,e,r,n){var a={id:n||null,type:e,geometry:r,tags:t||null,min:[1/0,1/0],max:[-1/0,-1/0]};return i(a),a}function i(t){var e=t.geometry,r=t.min,n=t.max;if(1===t.type)a(r,n,e);else for(var i=0;i<e.length;i++)a(r,n,e[i]);return t}function a(t,e,r){for(var n,i=0;i<r.length;i++)n=r[i],t[0]=Math.min(n[0],t[0]),e[0]=Math.max(n[0],e[0]),t[1]=Math.min(n[1],t[1]),e[1]=Math.max(n[1],e[1])}e.exports=n},{}],127:[function(t,e,r){\"use strict\";function n(t,e){return new i(t,e)}function i(t,e){var r=(e=this.options=l(Object.create(this.options),e)).debug;r&&console.time(\"preprocess data\");var n=1<<e.maxZoom,i=c(t,e.tolerance/(n*e.extent));this.tiles={},this.tileCoords=[],r&&(console.timeEnd(\"preprocess data\"),console.log(\"index: maxZoom: %d, maxPoints: %d\",e.indexMaxZoom,e.indexMaxPoints),console.time(\"generate tiles\"),this.stats={},this.total=0),(i=d(i,e.buffer/e.extent,o)).length&&this.splitTile(i,0,0,0),r&&(i.length&&console.log(\"features: %d, points: %d\",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd(\"generate tiles\"),console.log(\"tiles generated:\",this.total,JSON.stringify(this.stats)))}function a(t,e,r){return 32*((1<<t)*r+e)+t}function o(t,e,r){return[r,(r-t[0])*(e[1]-t[1])/(e[0]-t[0])+t[1],1]}function s(t,e,r){return[(r-t[1])*(e[0]-t[0])/(e[1]-t[1])+t[0],r,1]}function l(t,e){for(var r in e)t[r]=e[r];return t}function u(t,e,r){var n=t.source;if(1!==n.length)return!1;var i=n[0];if(3!==i.type||i.geometry.length>1)return!1;var a=i.geometry[0].length;if(5!==a)return!1;for(var o=0;o<a;o++){var s=h.point(i.geometry[0][o],e,t.z2,t.x,t.y);if(s[0]!==-r&&s[0]!==e+r||s[1]!==-r&&s[1]!==e+r)return!1}return!0}e.exports=n;var c=t(\"./convert\"),h=t(\"./transform\"),f=t(\"./clip\"),d=t(\"./wrap\"),p=t(\"./tile\");i.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,solidChildren:!1,tolerance:3,extent:4096,buffer:64,debug:0},i.prototype.splitTile=function(t,e,r,n,i,l,c){for(var h=[t,e,r,n],d=this.options,m=d.debug,g=null;h.length;){n=h.pop(),r=h.pop(),e=h.pop(),t=h.pop();var v=1<<e,y=a(e,r,n),b=this.tiles[y],x=e===d.maxZoom?0:d.tolerance/(v*d.extent);if(!b&&(m>1&&console.time(\"creation\"),b=this.tiles[y]=p(t,v,r,n,x,e===d.maxZoom),this.tileCoords.push({z:e,x:r,y:n}),m)){m>1&&(console.log(\"tile z%d-%d-%d (features: %d, points: %d, simplified: %d)\",e,r,n,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===d.maxZoom||e===i)continue;var w=1<<i-e;if(r!==Math.floor(l/w)||n!==Math.floor(c/w))continue}else if(e===d.indexMaxZoom||b.numPoints<=d.indexMaxPoints)continue;if(d.solidChildren||!u(b,d.extent,d.buffer)){b.source=null,m>1&&console.time(\"clipping\");var M,k,A,T,S,E,L=.5*d.buffer/d.extent,C=.5-L,z=.5+L,D=1+L;M=k=A=T=null,S=f(t,v,r-L,r+z,0,o,b.min[0],b.max[0]),E=f(t,v,r+C,r+D,0,o,b.min[0],b.max[0]),S&&(M=f(S,v,n-L,n+z,1,s,b.min[1],b.max[1]),k=f(S,v,n+C,n+D,1,s,b.min[1],b.max[1])),E&&(A=f(E,v,n-L,n+z,1,s,b.min[1],b.max[1]),T=f(E,v,n+C,n+D,1,s,b.min[1],b.max[1])),m>1&&console.timeEnd(\"clipping\"),t.length&&(h.push(M||[],e+1,2*r,2*n),h.push(k||[],e+1,2*r,2*n+1),h.push(A||[],e+1,2*r+1,2*n),h.push(T||[],e+1,2*r+1,2*n+1))}else i&&(g=e)}return g},i.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,o=n.debug,s=1<<t,l=a(t,e=(e%s+s)%s,r);if(this.tiles[l])return h.tile(this.tiles[l],i);o>1&&console.log(\"drilling down to z%d-%d-%d\",t,e,r);for(var c,f=t,d=e,p=r;!c&&f>0;)f--,d=Math.floor(d/2),p=Math.floor(p/2),c=this.tiles[a(f,d,p)];if(!c||!c.source)return null;if(o>1&&console.log(\"found parent tile z%d-%d-%d\",f,d,p),u(c,i,n.buffer))return h.tile(c,i);o>1&&console.time(\"drilling down\");var m=this.splitTile(c.source,f,d,p,t,e,r);if(o>1&&console.timeEnd(\"drilling down\"),null!==m){var g=1<<t-m;l=a(m,Math.floor(e/g),Math.floor(r/g))}return this.tiles[l]?h.tile(this.tiles[l],i):null}},{\"./clip\":124,\"./convert\":125,\"./tile\":129,\"./transform\":130,\"./wrap\":131}],128:[function(t,e,r){\"use strict\";function n(t,e){var r,n,a,o,s=e*e,l=0,u=t.length-1,c=[];for(t[l][2]=1,t[u][2]=1;u;){for(n=0,r=l+1;r<u;r++)(a=i(t[r],t[l],t[u]))>n&&(o=r,n=a);n>s?(t[o][2]=n,c.push(l),c.push(o),l=o):(u=c.pop(),l=c.pop())}}function i(t,e,r){var n=e[0],i=e[1],a=r[0],o=r[1],s=t[0],l=t[1],u=a-n,c=o-i;if(0!==u||0!==c){var h=((s-n)*u+(l-i)*c)/(u*u+c*c);h>1?(n=a,i=o):h>0&&(n+=u*h,i+=c*h)}return u=s-n,c=l-i,u*u+c*c}e.exports=n},{}],129:[function(t,e,r){\"use strict\";function n(t,e,r,n,a,o){for(var s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z2:e,transformed:!1,min:[2,1],max:[-1,0]},l=0;l<t.length;l++){s.numFeatures++,i(s,t[l],a,o);var u=t[l].min,c=t[l].max;u[0]<s.min[0]&&(s.min[0]=u[0]),u[1]<s.min[1]&&(s.min[1]=u[1]),c[0]>s.max[0]&&(s.max[0]=c[0]),c[1]>s.max[1]&&(s.max[1]=c[1])}return s}function i(t,e,r,n){var i,o,s,l,u=e.geometry,c=e.type,h=[],f=r*r;if(1===c)for(i=0;i<u.length;i++)h.push(u[i]),t.numPoints++,t.numSimplified++;else for(i=0;i<u.length;i++)if(s=u[i],n||!(2===c&&s.dist<r||3===c&&s.area<f)){var d=[];for(o=0;o<s.length;o++)l=s[o],(n||l[2]>f)&&(d.push(l),t.numSimplified++),t.numPoints++;3===c&&a(d,s.outer),h.push(d)}else t.numPoints+=s.length;if(h.length){var p={geometry:h,type:c,tags:e.tags||null};null!==e.id&&(p.id=e.id),t.features.push(p)}}function a(t,e){o(t)<0===e&&t.reverse()}function o(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i<a;o=i++)e=t[i],n+=((r=t[o])[0]-e[0])*(e[1]+r[1]);return n}e.exports=n},{}],130:[function(t,e,r){\"use strict\";function n(t,e){if(t.transformed)return t;var r,n,a,o=t.z2,s=t.x,l=t.y;for(r=0;r<t.features.length;r++){var u=t.features[r],c=u.geometry;if(1===u.type)for(n=0;n<c.length;n++)c[n]=i(c[n],e,o,s,l);else for(n=0;n<c.length;n++){var h=c[n];for(a=0;a<h.length;a++)h[a]=i(h[a],e,o,s,l)}}return t.transformed=!0,t}function i(t,e,r,n,i){return[Math.round(e*(t[0]*r-n)),Math.round(e*(t[1]*r-i))]}r.tile=n,r.point=i},{}],131:[function(t,e,r){\"use strict\";function n(t,e,r){var n=t,a=o(t,1,-1-e,e,0,r,-1,2),s=o(t,1,1-e,2+e,0,r,-1,2);return(a||s)&&(n=o(t,1,-e,1+e,0,r,-1,2)||[],a&&(n=i(a,1).concat(n)),s&&(n=n.concat(i(s,-1)))),n}function i(t,e){for(var r=[],n=0;n<t.length;n++){var i,o=t[n],l=o.type;if(1===l)i=a(o.geometry,e);else{i=[];for(var u=0;u<o.geometry.length;u++)i.push(a(o.geometry[u],e))}r.push(s(o.tags,l,i,o.id))}return r}function a(t,e){var r=[];r.area=t.area,r.dist=t.dist;for(var n=0;n<t.length;n++)r.push([t[n][0]+e,t[n][1],t[n][2]]);return r}var o=t(\"./clip\"),s=t(\"./feature\");e.exports=n},{\"./clip\":124,\"./feature\":126}],132:[function(t,e,r){function n(t,e){if(\"string\"!=typeof t)throw new TypeError(\"must specify type string\");if(e=e||{},\"undefined\"==typeof document&&!e.canvas)return null;var r=e.canvas||document.createElement(\"canvas\");\"number\"==typeof e.width&&(r.width=e.width),\"number\"==typeof e.height&&(r.height=e.height);var n,i=e;try{var a=[t];0===t.indexOf(\"webgl\")&&a.push(\"experimental-\"+t);for(var o=0;o<a.length;o++)if(n=r.getContext(a[o],i))return n}catch(t){n=null}return n||null}e.exports=n},{}],133:[function(t,e,r){\"use strict\";function n(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function i(t){this.gl=t,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=[\"sans-serif\",\"sans-serif\",\"sans-serif\"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=[\"x\",\"y\",\"z\"],this.labelEnable=[!0,!0,!0],this.labelFont=\"sans-serif\",this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=c(t)}function a(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}function o(t,e,r,n,i){for(var a=t.primalOffset,o=t.primalMinor,s=t.mirrorOffset,l=t.mirrorMinor,u=n[e],c=0;c<3;++c)if(e!==c){var h=a,f=s,d=o,p=l;u&1<<c&&(h=s,f=a,d=l,p=o),h[c]=r[0][c],f[c]=r[1][c],i[c]>0?(d[c]=-1,p[c]=0):(d[c]=0,p[c]=1)}}function s(t,e){var r=new i(t);return r.update(e),r}e.exports=s;var l=t(\"./lib/text.js\"),u=t(\"./lib/lines.js\"),c=t(\"./lib/background.js\"),h=t(\"./lib/cube.js\"),f=t(\"./lib/ticks.js\"),d=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),p=i.prototype;p.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?Array.isArray(a)&&Array.isArray(a[0]):Array.isArray(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}t=t||{};var r,n=e.bind(this,!1,Number),i=e.bind(this,!1,Boolean),a=e.bind(this,!1,String),o=e.bind(this,!0,function(t){if(Array.isArray(t)){if(3===t.length)return[+t[0],+t[1],+t[2],1];if(4===t.length)return[+t[0],+t[1],+t[2],+t[3]]}return[0,0,0,1]}),s=!1,c=!1;if(\"bounds\"in t)for(var h=t.bounds,d=0;d<2;++d)for(var p=0;p<3;++p)h[d][p]!==this.bounds[d][p]&&(c=!0),this.bounds[d][p]=h[d][p];if(\"ticks\"in t){r=t.ticks,s=!0,this.autoTicks=!1;for(d=0;d<3;++d)this.tickSpacing[d]=0}else n(\"tickSpacing\")&&(this.autoTicks=!0,c=!0);if(this._firstInit&&(\"ticks\"in t||\"tickSpacing\"in t||(this.autoTicks=!0),c=!0,s=!0,this._firstInit=!1),c&&this.autoTicks&&(r=f.create(this.bounds,this.tickSpacing),s=!0),s){for(d=0;d<3;++d)r[d].sort(function(t,e){return t.x-e.x});f.equal(r,this.ticks)?s=!1:this.ticks=r}i(\"tickEnable\"),a(\"tickFont\")&&(s=!0),n(\"tickSize\"),n(\"tickAngle\"),n(\"tickPad\"),o(\"tickColor\");var m=a(\"labels\");a(\"labelFont\")&&(m=!0),i(\"labelEnable\"),n(\"labelSize\"),n(\"labelPad\"),o(\"labelColor\"),i(\"lineEnable\"),i(\"lineMirror\"),n(\"lineWidth\"),o(\"lineColor\"),i(\"lineTickEnable\"),i(\"lineTickMirror\"),n(\"lineTickLength\"),n(\"lineTickWidth\"),o(\"lineTickColor\"),i(\"gridEnable\"),n(\"gridWidth\"),o(\"gridColor\"),i(\"zeroEnable\"),o(\"zeroLineColor\"),n(\"zeroLineWidth\"),i(\"backgroundEnable\"),o(\"backgroundColor\"),this._text?this._text&&(m||s)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=l(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&s&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=u(this.gl,this.bounds,this.ticks))};var m=[new a,new a,new a],g=[0,0,0],v={model:d,view:d,projection:d};p.isOpaque=function(){return!0},p.isTransparent=function(){return!1},p.drawTransparent=function(t){};var y=[0,0,0],b=[0,0,0],x=[0,0,0];p.draw=function(t){t=t||v;for(var e=this.gl,r=t.model||d,i=t.view||d,a=t.projection||d,s=this.bounds,l=h(r,i,a,s),u=l.cubeEdges,c=l.axis,f=i[12],p=i[13],_=i[14],w=i[15],M=this.pixelRatio*(a[3]*f+a[7]*p+a[11]*_+a[15]*w)/e.drawingBufferHeight,k=0;k<3;++k)this.lastCubeProps.cubeEdges[k]=u[k],this.lastCubeProps.axis[k]=c[k];for(var A=m,k=0;k<3;++k)o(m[k],k,this.bounds,u,c);for(var e=this.gl,T=g,k=0;k<3;++k)this.backgroundEnable[k]?T[k]=c[k]:T[k]=0;this._background.draw(r,i,a,s,T,this.backgroundColor),this._lines.bind(r,i,a,this);for(k=0;k<3;++k){var S=[0,0,0];c[k]>0?S[k]=s[1][k]:S[k]=s[0][k];for(I=0;I<2;++I){var E=(k+1+I)%3,L=(k+1+(1^I))%3;this.gridEnable[E]&&this._lines.drawGrid(E,L,this.bounds,S,this.gridColor[E],this.gridWidth[E]*this.pixelRatio)}for(I=0;I<2;++I){var E=(k+1+I)%3,L=(k+1+(1^I))%3;this.zeroEnable[L]&&s[0][L]<=0&&s[1][L]>=0&&this._lines.drawZero(E,L,this.bounds,S,this.zeroLineColor[L],this.zeroLineWidth[L]*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);for(var C=n(y,A[k].primalMinor),z=n(b,A[k].mirrorMinor),D=this.lineTickLength,I=0;I<3;++I){var P=M/r[5*I];C[I]*=D[I]*P,z[I]*=D[I]*P}this.lineTickEnable[k]&&this._lines.drawAxisTicks(k,A[k].primalOffset,C,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._text.bind(r,i,a,this.pixelRatio);for(k=0;k<3;++k){for(var O=A[k].primalMinor,j=n(x,A[k].primalOffset),I=0;I<3;++I)this.lineTickEnable[k]&&(j[I]+=M*O[I]*Math.max(this.lineTickLength[I],0)/r[5*I]);if(this.tickEnable[k]){for(I=0;I<3;++I)j[I]+=M*O[I]*this.tickPad[I]/r[5*I];this._text.drawTicks(k,this.tickSize[k],this.tickAngle[k],j,this.tickColor[k])}if(this.labelEnable[k]){for(I=0;I<3;++I)j[I]+=M*O[I]*this.labelPad[I]/r[5*I];j[k]+=.5*(s[0][k]+s[1][k]),this._text.drawLabel(k,this.labelSize[k],this.labelAngle[k],j,this.labelColor[k])}}},p.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{\"./lib/background.js\":134,\"./lib/cube.js\":135,\"./lib/lines.js\":136,\"./lib/text.js\":138,\"./lib/ticks.js\":139}],134:[function(t,e,r){\"use strict\";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}function i(t){for(var e=[],r=[],i=0,l=0;l<3;++l)for(var u=(l+1)%3,c=(l+2)%3,h=[0,0,0],f=[0,0,0],d=-1;d<=1;d+=2){r.push(i,i+2,i+1,i+1,i+2,i+3),h[l]=d,f[l]=d;for(var p=-1;p<=1;p+=2){h[u]=p;for(var m=-1;m<=1;m+=2)h[c]=m,e.push(h[0],h[1],h[2],f[0],f[1],f[2]),i+=1}var g=u;u=c,c=g}var v=a(t,new Float32Array(e)),y=a(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),b=o(t,[{buffer:v,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:v,type:t.FLOAT,size:3,offset:12,stride:24}],y),x=s(t);return x.attributes.position.location=0,x.attributes.normal.location=1,new n(t,v,b,x)}e.exports=i;var a=t(\"gl-buffer\"),o=t(\"gl-vao\"),s=t(\"./shaders\").bg,l=n.prototype;l.draw=function(t,e,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),l.disable(l.POLYGON_OFFSET_FILL)}},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{\"./shaders\":137,\"gl-buffer\":141,\"gl-vao\":255}],135:[function(t,e,r){\"use strict\";function n(t,e,r){for(var n=0;n<4;++n){t[n]=r[12+n];for(var i=0;i<3;++i)t[n]+=e[i]*r[4*i+n]}}function i(t){for(a=0;a<m.length;++a)if((t=l.positive(t,m[a])).length<3)return 0;for(var e=t[0],r=e[0]/e[3],n=e[1]/e[3],i=0,a=1;a+1<t.length;++a){var o=t[a],s=t[a+1],u=o[0]/o[3]-r,c=o[1]/o[3]-n,h=s[0]/s[3]-r,f=s[1]/s[3]-n;i+=Math.abs(u*f-c*h)}return i}function a(t,e,r,a){s(c,e,t),s(c,r,c);for(var l=0,m=0;m<2;++m){d[2]=a[m][2];for(var b=0;b<2;++b){d[1]=a[b][1];for(var x=0;x<2;++x)d[0]=a[x][0],n(h[l],d,c),l+=1}}for(var _=-1,m=0;m<8;++m){for(var w=h[m][3],M=0;M<3;++M)f[m][M]=h[m][M]/w;w<0&&(_<0?_=m:f[m][2]<f[_][2]&&(_=m))}if(_<0){_=0;for(V=0;V<3;++V){for(var k=(V+2)%3,A=(V+1)%3,T=-1,S=-1,E=0;E<2;++E){var L=(z=E<<V)+(E<<k)+(1-E<<A),C=z+(1-E<<k)+(E<<A);u(f[z],f[L],f[C],p)<0||(E?T=1:S=1)}if(T<0||S<0)S>T&&(_|=1<<V);else{for(E=0;E<2;++E){var z=E<<V,L=z+(E<<k)+(1-E<<A),C=z+(1-E<<k)+(E<<A),D=i([h[z],h[L],h[C],h[z+(1<<k)+(1<<A)]]);E?T=D:S=D}S>T&&(_|=1<<V)}}}for(var I=7^_,P=-1,m=0;m<8;++m)m!==_&&m!==I&&(P<0?P=m:f[P][1]>f[m][1]&&(P=m));for(var O=-1,m=0;m<3;++m)(R=P^1<<m)!==_&&R!==I&&(O<0&&(O=R),(A=f[R])[0]<f[O][0]&&(O=R));for(var j=-1,m=0;m<3;++m){var R=P^1<<m;R!==_&&R!==I&&R!==O&&(j<0&&(j=R),(A=f[R])[0]>f[j][0]&&(j=R))}var F=g;F[0]=F[1]=F[2]=0,F[o.log2(O^P)]=P&O,F[o.log2(P^j)]=P&j;var N=7^j;N===_||N===I?(N=7^O,F[o.log2(j^N)]=N&j):F[o.log2(O^N)]=N&O;for(var B=v,U=_,V=0;V<3;++V)B[V]=U&1<<V?-1:1;return y}e.exports=a;var o=t(\"bit-twiddle\"),s=t(\"gl-mat4/multiply\"),l=(t(\"gl-mat4/invert\"),t(\"split-polygon\")),u=t(\"robust-orientation\"),c=new Array(16),h=(new Array(16),new Array(8)),f=new Array(8),d=new Array(3),p=[0,0,0];!function(){for(var t=0;t<8;++t)h[t]=[1,1,1,1],f[t]=[1,1,1]}();var m=[[0,0,1,0,0],[0,0,-1,1,0],[0,-1,0,1,0],[0,1,0,1,0],[-1,0,0,1,0],[1,0,0,1,0]],g=[1,1,1],v=[0,0,0],y={cubeEdges:g,axis:v}},{\"bit-twiddle\":60,\"gl-mat4/invert\":165,\"gl-mat4/multiply\":167,\"robust-orientation\":489,\"split-polygon\":507}],136:[function(t,e,r){\"use strict\";function n(t){return t[0]=t[1]=t[2]=0,t}function i(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function a(t,e,r,n,i,a,o,s){this.gl=t,this.vertBuffer=e,this.vao=r,this.shader=n,this.tickCount=i,this.tickOffset=a,this.gridCount=o,this.gridOffset=s}function o(t,e,r){var n=[],i=[0,0,0],o=[0,0,0],c=[0,0,0],h=[0,0,0];n.push(0,0,1,0,1,1,0,0,-1,0,0,-1,0,1,1,0,1,-1);for(var f=0;f<3;++f){for(var d=n.length/3|0,p=0;p<r[f].length;++p){g=+r[f][p].x;n.push(g,0,1,g,1,1,g,0,-1,g,0,-1,g,1,1,g,1,-1)}v=n.length/3|0;i[f]=d,o[f]=v-d;for(var d=n.length/3|0,m=0;m<r[f].length;++m){var g=+r[f][m].x;n.push(g,0,1,g,1,1,g,0,-1,g,0,-1,g,1,1,g,1,-1)}var v=n.length/3|0;c[f]=d,h[f]=v-d}var y=s(t,new Float32Array(n)),b=l(t,[{buffer:y,type:t.FLOAT,size:3,stride:0,offset:0}]),x=u(t);return x.attributes.position.location=0,new a(t,y,b,x,o,i,h,c)}e.exports=o;var s=t(\"gl-buffer\"),l=t(\"gl-vao\"),u=t(\"./shaders\").line,c=[0,0,0],h=[0,0,0],f=[0,0,0],d=[0,0,0],p=[1,1],m=a.prototype;m.bind=function(t,e,r){this.shader.bind(),this.shader.uniforms.model=t,this.shader.uniforms.view=e,this.shader.uniforms.projection=r,p[0]=this.gl.drawingBufferWidth,p[1]=this.gl.drawingBufferHeight,this.shader.uniforms.screenShape=p,this.vao.bind()},m.drawAxisLine=function(t,e,r,a,o){var s=n(h);this.shader.uniforms.majorAxis=h,s[t]=e[1][t]-e[0][t],this.shader.uniforms.minorAxis=s;var l=i(d,r);l[t]+=e[0][t],this.shader.uniforms.offset=l,this.shader.uniforms.lineWidth=o,this.shader.uniforms.color=a;var u=n(f);u[(t+2)%3]=1,this.shader.uniforms.screenAxis=u,this.vao.draw(this.gl.TRIANGLES,6),(u=n(f))[(t+1)%3]=1,this.shader.uniforms.screenAxis=u,this.vao.draw(this.gl.TRIANGLES,6)},m.drawAxisTicks=function(t,e,r,i,a){if(this.tickCount[t]){var o=n(c);o[t]=1,this.shader.uniforms.majorAxis=o,this.shader.uniforms.offset=e,this.shader.uniforms.minorAxis=r,this.shader.uniforms.color=i,this.shader.uniforms.lineWidth=a;var s=n(f);s[t]=1,this.shader.uniforms.screenAxis=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[t],this.tickOffset[t])}},m.drawGrid=function(t,e,r,a,o,s){if(this.gridCount[t]){var l=n(h);l[e]=r[1][e]-r[0][e],this.shader.uniforms.minorAxis=l;var u=i(d,a);u[e]+=r[0][e],this.shader.uniforms.offset=u;var p=n(c);p[t]=1,this.shader.uniforms.majorAxis=p;var m=n(f);m[t]=1,this.shader.uniforms.screenAxis=m,this.shader.uniforms.lineWidth=s,this.shader.uniforms.color=o,this.vao.draw(this.gl.TRIANGLES,this.gridCount[t],this.gridOffset[t])}},m.drawZero=function(t,e,r,a,o,s){var l=n(h);this.shader.uniforms.majorAxis=l,l[t]=r[1][t]-r[0][t],this.shader.uniforms.minorAxis=l;var u=i(d,a);u[t]+=r[0][t],this.shader.uniforms.offset=u;var c=n(f);c[e]=1,this.shader.uniforms.screenAxis=c,this.shader.uniforms.lineWidth=s,this.shader.uniforms.color=o,this.vao.draw(this.gl.TRIANGLES,6)},m.dispose=function(){this.vao.dispose(),this.vertBuffer.dispose(),this.shader.dispose()}},{\"./shaders\":137,\"gl-buffer\":141,\"gl-vao\":255}],137:[function(t,e,r){\"use strict\";var n=t(\"gl-shader\");r.line=function(t){return n(t,\"#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\",\"precision mediump float;\\n#define GLSLIFY 1\\nuniform vec4 color;\\nvoid main() {\\n  gl_FragColor = color;\\n}\",null,[{name:\"position\",type:\"vec3\"}])};r.text=function(t){return n(t,\"#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}\",\"precision mediump float;\\n#define GLSLIFY 1\\nuniform vec4 color;\\nvoid main() {\\n  gl_FragColor = color;\\n}\",null,[{name:\"position\",type:\"vec3\"}])};r.bg=function(t){return n(t,\"#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}\",\"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}\",null,[{name:\"position\",type:\"vec3\"},{name:\"normal\",type:\"vec3\"}])}},{\"gl-shader\":239}],138:[function(t,e,r){(function(r){\"use strict\";function n(t,e,r,n){this.gl=t,this.shader=e,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}function i(t,e){try{return l(t,e)}catch(t){return console.warn(\"error vectorizing text:\",t),{cells:[],positions:[]}}}function a(t,e,r,i,a,l){var c=o(t),h=s(t,[{buffer:c,size:3}]),f=u(t);f.attributes.position.location=0;var d=new n(t,f,c,h);return d.update(e,r,i,a,l),d}e.exports=a;var o=t(\"gl-buffer\"),s=t(\"gl-vao\"),l=t(\"vectorize-text\"),u=t(\"./shaders\").text,c=window||r.global||{},h=c.__TEXT_CACHE||{};c.__TEXT_CACHE={};var f=n.prototype,d=[0,0];f.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,d[0]=this.gl.drawingBufferWidth,d[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=d},f.update=function(t,e,r,n,a){function o(t,e,r,n){var a=h[r];a||(a=h[r]={});var o=a[e];o||(o=a[e]=i(e,{triangles:!0,font:r,textAlign:\"center\",textBaseline:\"middle\"}));for(var l=(n||12)/12,u=o.positions,c=o.cells,f=0,d=c.length;f<d;++f)for(var p=c[f],m=2;m>=0;--m){var g=u[p[m]];s.push(l*g[0],-l*g[1],t)}}this.gl;for(var s=[],l=[0,0,0],u=[0,0,0],c=[0,0,0],f=[0,0,0],d=0;d<3;++d){c[d]=s.length/3|0,o(.5*(t[0][d]+t[1][d]),e[d],r),f[d]=(s.length/3|0)-c[d],l[d]=s.length/3|0;for(var p=0;p<n[d].length;++p)n[d][p].text&&o(n[d][p].x,n[d][p].text,n[d][p].font||a,n[d][p].fontSize||12);u[d]=(s.length/3|0)-l[d]}this.buffer.update(s),this.tickOffset=l,this.tickCount=u,this.labelOffset=c,this.labelCount=f};var p=[0,0,0];f.drawTicks=function(t,e,r,n,i){if(this.tickCount[t]){var a=p;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 m=[0,0,0];f.drawLabel=function(t,e,r,n,i){this.labelCount[t]&&(this.shader.uniforms.axis=m,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]))},f.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()}}).call(this,t(\"_process\"))},{\"./shaders\":137,_process:468,\"gl-buffer\":141,\"gl-vao\":255,\"vectorize-text\":534}],139:[function(t,e,r){\"use strict\";function n(t,e){var r=t+\"\",n=r.indexOf(\".\"),i=0;n>=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(t*e*a),s=o+\"\";if(s.indexOf(\"e\")>=0)return s;var l=o/a,u=o%a;o<0?(l=0|-Math.ceil(l),u=0|-u):(l=0|Math.floor(l),u|=0);var c=\"\"+l;if(o<0&&(c=\"-\"+c),i){for(var h=\"\"+u;h.length<i;)h=\"0\"+h;return c+\".\"+h}return c}function i(t,e){for(var r=[],i=0;i<3;++i){for(var a=[],o=(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(o=-1;o*e[i]>=t[0][i];--o)a.push({x:o*e[i],text:n(e[i],o)});r.push(a)}return r}function a(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;++n){var i=t[r][n],a=e[r][n];if(i.x!==a.x||i.text!==a.text||i.font!==a.font||i.fontColor!==a.fontColor||i.fontSize!==a.fontSize||i.dx!==a.dx||i.dy!==a.dy)return!1}}return!0}r.create=i,r.equal=a},{}],140:[function(t,e,r){\"use strict\";function n(t,e,r){this.lo=t,this.hi=e,this.pixelsPerDataUnit=r}function i(t,e,r,n,i){for(var a=0;a<3;++a){for(var o=p,s=m,l=0;l<3;++l)s[l]=o[l]=r[l];s[3]=o[3]=1,s[a]+=1,h(s,s,e),s[3]<0&&(t[a]=1/0),o[a]-=1,h(o,o,e),o[3]<0&&(t[a]=1/0);var u=(o[0]/o[3]-s[0]/s[3])*n,c=(o[1]/o[3]-s[1]/s[3])*i;t[a]=.25*Math.sqrt(u*u+c*c)}return t}function a(t,e,r,n,a){var h=e.model||f,p=e.view||f,m=e.projection||f,y=t.bounds,b=(a=a||l(h,p,m,y)).axis;a.edges;u(d,p,h),u(d,m,d);for(var x=g,_=0;_<3;++_)x[_].lo=1/0,x[_].hi=-1/0,x[_].pixelsPerDataUnit=1/0;var w=o(c(d,d));c(d,d);for(var M=0;M<3;++M){var k=(M+1)%3,A=(M+2)%3,T=v;t:for(_=0;_<2;++_){var S=[];if(b[M]<0!=!!_){T[M]=y[_][M];for(E=0;E<2;++E){T[k]=y[E^_][k];for(C=0;C<2;++C)T[A]=y[C^E^_][A],S.push(T.slice())}for(E=0;E<w.length;++E){if(0===S.length)continue t;S=s.positive(S,w[E])}for(var E=0;E<S.length;++E)for(var A=S[E],L=i(v,d,A,r,n),C=0;C<3;++C)x[C].lo=Math.min(x[C].lo,A[C]),x[C].hi=Math.max(x[C].hi,A[C]),C!==M&&(x[C].pixelsPerDataUnit=Math.min(x[C].pixelsPerDataUnit,Math.abs(L[C])))}}}return x}e.exports=a;var o=t(\"extract-frustum-planes\"),s=t(\"split-polygon\"),l=t(\"./lib/cube.js\"),u=t(\"gl-mat4/multiply\"),c=t(\"gl-mat4/transpose\"),h=t(\"gl-vec4/transformMat4\"),f=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),d=new Float32Array(16),p=[0,0,0,1],m=[0,0,0,1],g=[new n(1/0,-1/0,1/0),new n(1/0,-1/0,1/0),new n(1/0,-1/0,1/0)],v=[0,0,0]},{\"./lib/cube.js\":135,\"extract-frustum-planes\":115,\"gl-mat4/multiply\":167,\"gl-mat4/transpose\":175,\"gl-vec4/transformMat4\":261,\"split-polygon\":507}],141:[function(t,e,r){\"use strict\";function n(t,e,r,n,i){this.gl=t,this.type=e,this.handle=r,this.length=n,this.usage=i}function i(t,e,r,n,i,a){var o=i.length*i.BYTES_PER_ELEMENT;if(a<0)return t.bufferData(e,i,n),o;if(o+a>r)throw new Error(\"gl-buffer: If resizing buffer, must not specify offset\");return t.bufferSubData(e,a,i),r}function a(t,e){for(var r=l.malloc(t.length,e),n=t.length,i=0;i<n;++i)r[i]=t[i];return r}function o(t,e){for(var r=1,n=e.length-1;n>=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}function s(t,e,r,i){if(r=r||t.ARRAY_BUFFER,i=i||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error(\"gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER\");if(i!==t.DYNAMIC_DRAW&&i!==t.STATIC_DRAW&&i!==t.STREAM_DRAW)throw new Error(\"gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW\");var a=new n(t,r,t.createBuffer(),0,i);return a.update(e),a}var l=t(\"typedarray-pool\"),u=t(\"ndarray-ops\"),c=t(\"ndarray\"),h=[\"uint8\",\"uint8_clamped\",\"uint16\",\"uint32\",\"int8\",\"int16\",\"int32\",\"float32\"],f=n.prototype;f.bind=function(){this.gl.bindBuffer(this.type,this.handle)},f.unbind=function(){this.gl.bindBuffer(this.type,null)},f.dispose=function(){this.gl.deleteBuffer(this.handle)},f.update=function(t,e){if(\"number\"!=typeof e&&(e=-1),this.bind(),\"object\"==typeof t&&void 0!==t.shape){var r=t.dtype;if(h.indexOf(r)<0&&(r=\"float32\"),this.type===this.gl.ELEMENT_ARRAY_BUFFER&&(r=gl.getExtension(\"OES_element_index_uint\")&&\"uint16\"!==r?\"uint32\":\"uint16\"),r===t.dtype&&o(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=i(this.gl,this.type,this.length,this.usage,t.data,e):this.length=i(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var n=l.malloc(t.size,r),s=c(n,t.shape);u.assign(s,t),this.length=e<0?i(this.gl,this.type,this.length,this.usage,n,e):i(this.gl,this.type,this.length,this.usage,n.subarray(0,t.size),e),l.free(n)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?a(t,\"uint16\"):a(t,\"float32\"),this.length=e<0?i(this.gl,this.type,this.length,this.usage,f,e):i(this.gl,this.type,this.length,this.usage,f.subarray(0,t.length),e),l.free(f)}else if(\"object\"==typeof t&&\"number\"==typeof t.length)this.length=i(this.gl,this.type,this.length,this.usage,t,e);else{if(\"number\"!=typeof t&&void 0!==t)throw new Error(\"gl-buffer: Invalid data type\");if(e>=0)throw new Error(\"gl-buffer: Cannot specify offset when resizing buffer\");(t|=0)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=s},{ndarray:449,\"ndarray-ops\":443,\"typedarray-pool\":521}],142:[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\",34e3:\"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\"}},{}],143:[function(t,e,r){var n=t(\"./1.0/numbers\");e.exports=function(t){return n[t]}},{\"./1.0/numbers\":142}],144:[function(t,e,r){\"use strict\";function n(t,e,r,n){this.plot=t,this.shader=e,this.bufferHi=r,this.bufferLo=n,this.bounds=[1/0,1/0,-1/0,-1/0],this.numPoints=0,this.color=[0,0,0,1]}function i(t,e){var r=new n(t,a(t.gl,l.vertex,l.fragment),o(t.gl),o(t.gl));return r.update(e),t.addObject(r),r}var a=t(\"gl-shader\"),o=t(\"gl-buffer\"),s=t(\"typedarray-pool\"),l=t(\"./lib/shaders\");e.exports=i;var u=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]],c=n.prototype;c.draw=function(){var t=new Float32Array([0,0]),e=new Float32Array([0,0]),r=new Float32Array([0,0]),n=new Float32Array([0,0]),i=[1,1];return function(){var a=this.plot,o=this.shader,s=this.bounds,l=this.numPoints;if(l){var c=a.gl,h=a.dataBox,f=a.viewBox,d=a.pixelRatio,p=s[2]-s[0],m=s[3]-s[1],g=h[2]-h[0],v=h[3]-h[1],y=2*p/g,b=2*m/v,x=(s[0]-h[0]-.5*g)/p,_=(s[1]-h[1]-.5*v)/m;t[0]=y,t[1]=b,e[0]=y-t[0],e[1]=b-t[1],r[0]=x,r[1]=_,n[0]=x-r[0],n[1]=_-r[1];var w=f[2]-f[0],M=f[3]-f[1];i[0]=2*d/w,i[1]=2*d/M,o.bind(),o.uniforms.scaleHi=t,o.uniforms.scaleLo=e,o.uniforms.translateHi=r,o.uniforms.translateLo=n,o.uniforms.pixelScale=i,o.uniforms.color=this.color,this.bufferLo.bind(),o.attributes.positionLo.pointer(c.FLOAT,!1,16,0),this.bufferHi.bind(),o.attributes.positionHi.pointer(c.FLOAT,!1,16,0),o.attributes.pixelOffset.pointer(c.FLOAT,!1,16,8),c.drawArrays(c.TRIANGLES,0,l*u.length)}}}(),c.drawPick=function(t){return t},c.pick=function(){return null},c.update=function(t){var e,r,n,i=(t=t||{}).positions||[],a=t.errors||[],o=1;\"lineWidth\"in t&&(o=+t.lineWidth);var l=5;\"capSize\"in t&&(l=+t.capSize),this.color=(t.color||[0,0,0,1]).slice();var c=this.bounds=[1/0,1/0,-1/0,-1/0],h=this.numPoints=i.length>>1;for(e=0;e<h;++e)r=i[2*e],n=i[2*e+1],c[0]=Math.min(r,c[0]),c[1]=Math.min(n,c[1]),c[2]=Math.max(r,c[2]),c[3]=Math.max(n,c[3]);c[2]===c[0]&&(c[2]+=1),c[3]===c[1]&&(c[3]+=1);var f=1/(c[2]-c[0]),d=1/(c[3]-c[1]),p=c[0],m=c[1],g=s.mallocFloat64(h*u.length*4),v=s.mallocFloat32(h*u.length*4),y=s.mallocFloat32(h*u.length*4),b=0;for(e=0;e<h;++e){r=i[2*e],n=i[2*e+1];for(var x=a[4*e],_=a[4*e+1],w=a[4*e+2],M=a[4*e+3],k=0;k<u.length;++k){var A=u[k],T=A[0],S=A[1];T<0?T*=x:T>0&&(T*=_),S<0?S*=w:S>0&&(S*=M),g[b++]=f*(r-p+T),g[b++]=d*(n-m+S),g[b++]=o*A[2]+(l+o)*A[4],g[b++]=o*A[3]+(l+o)*A[5]}}for(e=0;e<g.length;e++)v[e]=g[e],y[e]=g[e]-v[e];this.bufferHi.update(v),this.bufferLo.update(y),s.free(g)},c.dispose=function(){this.plot.removeObject(this),this.shader.dispose(),this.bufferHi.dispose(),this.bufferLo.dispose()}},{\"./lib/shaders\":145,\"gl-buffer\":141,\"gl-shader\":239,\"typedarray-pool\":521}],145:[function(t,e,r){e.exports={vertex:\"precision highp float;\\n#define GLSLIFY 1\\n\\nattribute vec2 positionHi;\\nattribute vec2 positionLo;\\nattribute vec2 pixelOffset;\\n\\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo, pixelScale;\\n\\nvec2 project(vec2 scHi, vec2 trHi, vec2 scLo, vec2 trLo, vec2 posHi, vec2 posLo) {\\n  return (posHi + trHi) * scHi\\n       + (posLo + trLo) * scHi\\n       + (posHi + trHi) * scLo\\n       + (posLo + trLo) * scLo;\\n}\\n\\nvoid main() {\\n  vec3 scrPosition = vec3(\\n         project(scaleHi, translateHi, scaleLo, translateLo, positionHi, positionLo),\\n         1);\\n  gl_Position = vec4(\\n    scrPosition.xy + scrPosition.z * pixelScale * pixelOffset,\\n    0,\\n    scrPosition.z);\\n}\\n\",fragment:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec4 color;\\n\\nvoid main() {\\n  gl_FragColor = vec4(color.rgb * color.a, color.a);\\n}\\n\"}},{}],146:[function(t,e,r){\"use strict\";function n(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1}function i(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}function a(t,e,r,n){for(var i=f[n],a=0;a<i.length;++a){var o=i[a];t.push(e[0],e[1],e[2],r[0],r[1],r[2],r[3],o[0],o[1],o[2])}return i.length}function o(t){var e=t.gl,r=s(e),i=l(e,[{buffer:r,type:e.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:e.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:e.FLOAT,size:3,offset:28,stride:40}]),a=u(e);a.attributes.position.location=0,a.attributes.color.location=1,a.attributes.offset.location=2;var o=new n(e,r,i,a);return o.update(t),o}e.exports=o;var s=t(\"gl-buffer\"),l=t(\"gl-vao\"),u=t(\"./shaders/index\"),c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],h=n.prototype;h.isOpaque=function(){return this.opacity>=1},h.isTransparent=function(){return this.opacity<1},h.drawTransparent=h.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||c,i=r.projection=t.projection||c;r.model=t.model||c,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],o=n[13],s=n[14],l=n[15],u=this.pixelRatio*(i[3]*a+i[7]*o+i[11]*s+i[15]*l)/e.drawingBufferHeight;this.vao.bind();for(var h=0;h<3;++h)e.lineWidth(this.lineWidth[h]),r.capSize=this.capSize[h]*u,e.drawArrays(e.LINES,this.lineOffset[h],this.lineCount[h]);this.vao.unbind()};var f=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=[0,0,0];a[(n+e)%3]=i,r.push(a)}t[e]=r}return t}();h.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 o=[],s=r.length,l=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var u=0;u<3;++u){this.lineOffset[u]=l;t:for(var c=0;c<s;++c){for(var h=r[c],f=0;f<3;++f)if(isNaN(h[f])||!isFinite(h[f]))continue t;var d=n[c],p=e[u];if(Array.isArray(p[0])&&(p=e[c]),3===p.length&&(p=[p[0],p[1],p[2],1]),!isNaN(d[0][u])&&!isNaN(d[1][u])&&(d[0][u]<0&&((m=h.slice())[u]+=d[0][u],o.push(h[0],h[1],h[2],p[0],p[1],p[2],p[3],0,0,0,m[0],m[1],m[2],p[0],p[1],p[2],p[3],0,0,0),i(this.bounds,m),l+=2+a(o,m,p,u)),d[1][u]>0)){var m=h.slice();m[u]+=d[1][u],o.push(h[0],h[1],h[2],p[0],p[1],p[2],p[3],0,0,0,m[0],m[1],m[2],p[0],p[1],p[2],p[3],0,0,0),i(this.bounds,m),l+=2+a(o,m,p,u)}}this.lineCount[u]=l-this.lineOffset[u]}this.buffer.update(o)}},h.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{\"./shaders/index\":147,\"gl-buffer\":141,\"gl-vao\":255}],147:[function(t,e,r){\"use strict\";var n=t(\"gl-shader\");e.exports=function(t){return n(t,\"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}\",\"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}\",null,[{name:\"position\",type:\"vec3\"},{name:\"offset\",type:\"vec3\"},{name:\"color\",type:\"vec4\"}])}},{\"gl-shader\":239}],148:[function(t,e,r){\"use strict\";function n(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function i(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function a(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);y=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;a<n;++a)i[a]=t.COLOR_ATTACHMENT0+a;for(a=n;a<r;++a)i[a]=t.NONE;y[n]=i}}function o(t){switch(t){case p:throw new Error(\"gl-fbo: Framebuffer unsupported\");case m:throw new Error(\"gl-fbo: Framebuffer incomplete attachment\");case g:throw new Error(\"gl-fbo: Framebuffer incomplete dimensions\");case v:throw new Error(\"gl-fbo: Framebuffer incomplete missing attachment\");default:throw new Error(\"gl-fbo: Framebuffer failed for unspecified reason\")}}function s(t,e,r,n,i,a){if(!n)return null;var o=d(t,e,r,i,n);return o.magFilter=t.NEAREST,o.minFilter=t.NEAREST,o.mipSamples=1,o.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,a,t.TEXTURE_2D,o.handle,0),o}function l(t,e,r,n,i){var a=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,a),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,i,t.RENDERBUFFER,a),a}function u(t){var e=n(t.gl),r=t.gl,a=t.handle=r.createFramebuffer(),u=t._shape[0],c=t._shape[1],h=t.color.length,f=t._ext,d=t._useStencil,p=t._useDepth,m=t._colorType;r.bindFramebuffer(r.FRAMEBUFFER,a);for(b=0;b<h;++b)t.color[b]=s(r,u,c,m,r.RGBA,r.COLOR_ATTACHMENT0+b);0===h?(t._color_rb=l(r,u,c,r.RGBA4,r.COLOR_ATTACHMENT0),f&&f.drawBuffersWEBGL(y[0])):h>1&&f.drawBuffersWEBGL(y[h]);var g=r.getExtension(\"WEBGL_depth_texture\");g?d?t.depth=s(r,u,c,g.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p&&(t.depth=s(r,u,c,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):p&&d?t._depth_rb=l(r,u,c,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p?t._depth_rb=l(r,u,c,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=l(r,u,c,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var v=r.checkFramebufferStatus(r.FRAMEBUFFER);if(v!==r.FRAMEBUFFER_COMPLETE){t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null);for(var b=0;b<t.color.length;++b)t.color[b].dispose(),t.color[b]=null;t._color_rb&&(r.deleteRenderbuffer(t._color_rb),t._color_rb=null),i(r,e),o(v)}i(r,e)}function c(t,e,r,n,i,a,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var l=0;l<i;++l)this.color[l]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=n,this._useDepth=a,this._useStencil=o;var c=this,h=[0|e,0|r];Object.defineProperties(h,{0:{get:function(){return c._shape[0]},set:function(t){return c.width=t}},1:{get:function(){return c._shape[1]},set:function(t){return c.height=t}}}),this._shapeVector=h,u(this)}function h(t,e,r){if(t._destroyed)throw new Error(\"gl-fbo: Can't resize destroyed FBO\");if(t._shape[0]!==e||t._shape[1]!==r){var a=t.gl,s=a.getParameter(a.MAX_RENDERBUFFER_SIZE);if(e<0||e>s||r<0||r>s)throw new Error(\"gl-fbo: Can't resize FBO, invalid dimensions\");t._shape[0]=e,t._shape[1]=r;for(var l=n(a),u=0;u<t.color.length;++u)t.color[u].shape=t._shape;t._color_rb&&(a.bindRenderbuffer(a.RENDERBUFFER,t._color_rb),a.renderbufferStorage(a.RENDERBUFFER,a.RGBA4,t._shape[0],t._shape[1])),t.depth&&(t.depth.shape=t._shape),t._depth_rb&&(a.bindRenderbuffer(a.RENDERBUFFER,t._depth_rb),t._useDepth&&t._useStencil?a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_STENCIL,t._shape[0],t._shape[1]):t._useDepth?a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_COMPONENT16,t._shape[0],t._shape[1]):t._useStencil&&a.renderbufferStorage(a.RENDERBUFFER,a.STENCIL_INDEX,t._shape[0],t._shape[1])),a.bindFramebuffer(a.FRAMEBUFFER,t.handle);var c=a.checkFramebufferStatus(a.FRAMEBUFFER);c!==a.FRAMEBUFFER_COMPLETE&&(t.dispose(),i(a,l),o(c)),i(a,l)}}function f(t,e,r,n){p||(p=t.FRAMEBUFFER_UNSUPPORTED,m=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,g=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,v=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var i=t.getExtension(\"WEBGL_draw_buffers\");if(!y&&i&&a(t,i),Array.isArray(e)&&(n=r,r=0|e[1],e=0|e[0]),\"number\"!=typeof e)throw new Error(\"gl-fbo: Missing shape parameter\");var o=t.getParameter(t.MAX_RENDERBUFFER_SIZE);if(e<0||e>o||r<0||r>o)throw new Error(\"gl-fbo: Parameters are too large for FBO\");var s=1;if(\"color\"in(n=n||{})){if((s=Math.max(0|n.color,0))<0)throw new Error(\"gl-fbo: Must specify a nonnegative number of colors\");if(s>1){if(!i)throw new Error(\"gl-fbo: Multiple draw buffer extension not supported\");if(s>t.getParameter(i.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error(\"gl-fbo: Context does not support \"+s+\" draw buffers\")}}var l=t.UNSIGNED_BYTE,u=t.getExtension(\"OES_texture_float\");if(n.float&&s>0){if(!u)throw new Error(\"gl-fbo: Context does not support floating point textures\");l=t.FLOAT}else n.preferFloat&&s>0&&u&&(l=t.FLOAT);var h=!0;\"depth\"in n&&(h=!!n.depth);var f=!1;return\"stencil\"in n&&(f=!!n.stencil),new c(t,e,r,l,s,h,f,i)}var d=t(\"gl-texture2d\");e.exports=f;var p,m,g,v,y=null,b=c.prototype;Object.defineProperties(b,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(t){if(Array.isArray(t)||(t=[0|t,0|t]),2!==t.length)throw new Error(\"gl-fbo: Shape vector must be length 2\");var e=0|t[0],r=0|t[1];return h(this,e,r),[e,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return t|=0,h(this,t,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t|=0,h(this,this._shape[0],t),t},enumerable:!1}}),b.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])}},b.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\":251}],149:[function(t,e,r){function n(t,e,r){\"use strict\";var n=o(e)||\"of unknown name (see npm glsl-shader-name)\",l=\"unknown type\";void 0!==r&&(l=r===a.FRAGMENT_SHADER?\"fragment\":\"vertex\");for(var u=i(\"Error compiling %s shader %s:\\n\",l,n),c=i(\"%s%s\",u,t),h=t.split(\"\\n\"),f={},d=0;d<h.length;d++){var p=h[d];if(\"\"!==p){var m=parseInt(p.split(\":\")[2]);if(isNaN(m))throw new Error(i(\"Could not parse error: %s\",p));f[m]=p}}for(var g=s(e).split(\"\\n\"),d=0;d<g.length;d++)if((f[d+3]||f[d+2]||f[d+1])&&(u+=g[d]+\"\\n\",f[d+1])){var v=f[d+1];v=v.substr(v.split(\":\",3).join(\":\").length+1).trim(),u+=i(\"^^^ %s\\n\\n\",v)}return{long:u.trim(),short:c.trim()}}var i=t(\"sprintf-js\").sprintf,a=t(\"gl-constants/lookup\"),o=t(\"glsl-shader-name\"),s=t(\"add-line-numbers\");e.exports=n},{\"add-line-numbers\":35,\"gl-constants/lookup\":143,\"glsl-shader-name\":263,\"sprintf-js\":508}],150:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o){this.plot=t,this.shader=e,this.pickShader=r,this.positionBuffer=n,this.weightBuffer=i,this.colorBuffer=a,this.idBuffer=o,this.xData=[],this.yData=[],this.shape=[0,0],this.bounds=[1/0,1/0,-1/0,-1/0],this.pickOffset=0}function i(t,e){var r=t.gl,i=new n(t,l(r,c.vertex,c.fragment),l(r,c.pickVertex,c.pickFragment),u(r),u(r),u(r),u(r));return i.update(e),t.addObject(i),i}e.exports=i;var a=t(\"binary-search-bounds\"),o=t(\"iota-array\"),s=t(\"typedarray-pool\"),l=t(\"gl-shader\"),u=t(\"gl-buffer\"),c=t(\"./lib/shaders\"),h=n.prototype,f=[0,0,1,0,0,1,1,0,1,1,0,1];h.draw=function(){var t=[1,0,0,0,1,0,0,0,1];return function(){var e=this.plot,r=this.shader,n=this.bounds,i=this.numVertices;if(!(i<=0)){var a=e.gl,o=e.dataBox,s=n[2]-n[0],l=n[3]-n[1],u=o[2]-o[0],c=o[3]-o[1];t[0]=2*s/u,t[4]=2*l/c,t[6]=2*(n[0]-o[0])/u-1,t[7]=2*(n[1]-o[1])/c-1,r.bind();var h=r.uniforms;h.viewTransform=t,h.shape=this.shape;var f=r.attributes;this.positionBuffer.bind(),f.position.pointer(),this.weightBuffer.bind(),f.weight.pointer(a.UNSIGNED_BYTE,!1),this.colorBuffer.bind(),f.color.pointer(a.UNSIGNED_BYTE,!0),a.drawArrays(a.TRIANGLES,0,i)}}}(),h.drawPick=function(){var t=[1,0,0,0,1,0,0,0,1],e=[0,0,0,0];return function(r){var n=this.plot,i=this.pickShader,a=this.bounds,o=this.numVertices;if(!(o<=0)){var s=n.gl,l=n.dataBox,u=a[2]-a[0],c=a[3]-a[1],h=l[2]-l[0],f=l[3]-l[1];t[0]=2*u/h,t[4]=2*c/f,t[6]=2*(a[0]-l[0])/h-1,t[7]=2*(a[1]-l[1])/f-1;for(var d=0;d<4;++d)e[d]=r>>8*d&255;this.pickOffset=r,i.bind();var p=i.uniforms;p.viewTransform=t,p.pickOffset=e,p.shape=this.shape;var m=i.attributes;return this.positionBuffer.bind(),m.position.pointer(),this.weightBuffer.bind(),m.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),m.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),h.pick=function(t,e,r){var n=this.pickOffset,i=this.shape[0]*this.shape[1];if(r<n||r>=n+i)return null;var a=r-n,o=this.xData,s=this.yData;return{object:this,pointId:a,dataCoord:[o[a%this.shape[0]],s[a/this.shape[0]|0]]}},h.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||o(e[0]),n=t.y||o(e[1]),i=t.z||new Float32Array(e[0]*e[1]);this.xData=r,this.yData=n;var l=t.colorLevels||[0],u=t.colorValues||[0,0,0,1],c=l.length,h=this.bounds,d=h[0]=r[0],p=h[1]=n[0],m=1/((h[2]=r[r.length-1])-d),g=1/((h[3]=n[n.length-1])-p),v=e[0],y=e[1];this.shape=[v,y];var b=(v-1)*(y-1)*(f.length>>>1);this.numVertices=b;for(var x=s.mallocUint8(4*b),_=s.mallocFloat32(2*b),w=s.mallocUint8(2*b),M=s.mallocUint32(b),k=0,A=0;A<y-1;++A)for(var T=g*(n[A]-p),S=g*(n[A+1]-p),E=0;E<v-1;++E)for(var L=m*(r[E]-d),C=m*(r[E+1]-d),z=0;z<f.length;z+=2){var D,I,P,O,j=f[z],R=f[z+1],F=i[(A+R)*v+(E+j)],N=a.le(l,F);if(N<0)D=u[0],I=u[1],P=u[2],O=u[3];else if(N===c-1)D=u[4*c-4],I=u[4*c-3],P=u[4*c-2],O=u[4*c-1];else{var B=(F-l[N])/(l[N+1]-l[N]),U=1-B,V=4*N,H=4*(N+1);D=U*u[V]+B*u[H],I=U*u[V+1]+B*u[H+1],P=U*u[V+2]+B*u[H+2],O=U*u[V+3]+B*u[H+3]}x[4*k]=255*D,x[4*k+1]=255*I,x[4*k+2]=255*P,x[4*k+3]=255*O,_[2*k]=.5*L+.5*C,_[2*k+1]=.5*T+.5*S,w[2*k]=j,w[2*k+1]=R,M[k]=A*v+E,k+=1}this.positionBuffer.update(_),this.weightBuffer.update(w),this.colorBuffer.update(x),this.idBuffer.update(M),s.free(_),s.free(x),s.free(w),s.free(M)},h.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.positionBuffer.dispose(),this.weightBuffer.dispose(),this.colorBuffer.dispose(),this.idBuffer.dispose(),this.plot.removeObject(this)}},{\"./lib/shaders\":151,\"binary-search-bounds\":152,\"gl-buffer\":141,\"gl-shader\":239,\"iota-array\":276,\"typedarray-pool\":521}],151:[function(t,e,r){\"use strict\";e.exports={fragment:\"precision lowp float;\\n#define GLSLIFY 1\\nvarying vec4 fragColor;\\nvoid main() {\\n  gl_FragColor = vec4(fragColor.rgb * fragColor.a, fragColor.a);\\n}\\n\",vertex:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec2 position;\\nattribute vec4 color;\\nattribute vec2 weight;\\n\\nuniform vec2 shape;\\nuniform mat3 viewTransform;\\n\\nvarying vec4 fragColor;\\n\\nvoid main() {\\n  vec3 vPosition = viewTransform * vec3( position + (weight-.5)/(shape-1.) , 1.0);\\n  fragColor = color;\\n  gl_Position = vec4(vPosition.xy, 0, vPosition.z);\\n}\\n\",pickFragment:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nvarying vec4 fragId;\\nvarying vec2 vWeight;\\n\\nuniform vec2 shape;\\nuniform vec4 pickOffset;\\n\\nvoid main() {\\n  vec2 d = step(.5, vWeight);\\n  vec4 id = fragId + pickOffset;\\n  id.x += d.x + d.y*shape.x;\\n\\n  id.y += floor(id.x / 256.0);\\n  id.x -= floor(id.x / 256.0) * 256.0;\\n\\n  id.z += floor(id.y / 256.0);\\n  id.y -= floor(id.y / 256.0) * 256.0;\\n\\n  id.w += floor(id.z / 256.0);\\n  id.z -= floor(id.z / 256.0) * 256.0;\\n\\n  gl_FragColor = id/255.;\\n}\\n\",pickVertex:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec2 position;\\nattribute vec4 pickId;\\nattribute vec2 weight;\\n\\nuniform vec2 shape;\\nuniform mat3 viewTransform;\\n\\nvarying vec4 fragId;\\nvarying vec2 vWeight;\\n\\nvoid main() {\\n  vWeight = weight;\\n\\n  fragId = pickId;\\n\\n  vec3 vPosition = viewTransform * vec3( position + (weight-.5)/(shape-1.) , 1.0);\\n  gl_Position = vec4(vPosition.xy, 0, vPosition.z);\\n}\\n\"}},{}],152:[function(t,e,r){arguments[4][77][0].apply(r,arguments)},{dup:77}],153:[function(t,e,r){r.lineVertex=\"precision highp float;\\n#define GLSLIFY 1\\n\\nattribute vec2 aHi, aLo, dHi, dLo;\\n\\nuniform vec2 scaleHi, translateHi, scaleLo, translateLo, screenShape;\\nuniform float width;\\n\\nvarying vec2 direction;\\n\\n\\nvec2 project_1_0(vec2 scHi, vec2 trHi, vec2 scLo, vec2 trLo, vec2 posHi, vec2 posLo) {\\n  return (posHi + trHi) * scHi\\n       + (posLo + trLo) * scHi\\n       + (posHi + trHi) * scLo\\n       + (posLo + trLo) * scLo;\\n}\\n\\n\\nvec2 project_2_1(vec2 scHi, vec2 scLo, vec2 posHi, vec2 posLo) {\\n  return scHi * posHi\\n       + scLo * posHi\\n       + scHi * posLo\\n       + scLo * posLo;\\n}\\n\\nvoid main() {\\n  vec2 p = project_1_0(scaleHi, translateHi, scaleLo, translateLo, aHi, aLo);\\n  vec2 dir = project_2_1(scaleHi, scaleLo, dHi, dLo);\\n  vec2 n = 0.5 * width * normalize(screenShape.yx * vec2(dir.y, -dir.x)) / screenShape.xy;\\n  vec2 tangent = normalize(screenShape.xy * dir);\\n  if(dir.x < 0.0 || (dir.x == 0.0 && dir.y < 0.0)) {\\n    direction = -tangent;\\n  } else {\\n    direction = tangent;\\n  }\\n  gl_Position = vec4(p + n, 0.0, 1.0);\\n}\",r.lineFragment=\"precision highp float;\\n#define GLSLIFY 1\\n\\nuniform vec4 color;\\nuniform vec2 screenShape;\\nuniform sampler2D dashPattern;\\nuniform float dashLength;\\n\\nvarying vec2 direction;\\n\\nvoid main() {\\n  float t = fract(dot(direction, gl_FragCoord.xy) / dashLength);\\n  vec4 pcolor = color * texture2D(dashPattern, vec2(t, 0.0)).r;\\n  gl_FragColor = vec4(pcolor.rgb * pcolor.a, pcolor.a);\\n}\",r.mitreVertex=\"precision highp float;\\n#define GLSLIFY 1\\n\\nattribute vec2 aHi, aLo;\\n\\nuniform vec2 scaleHi, translateHi, scaleLo, translateLo;\\nuniform float radius;\\n\\n\\nvec2 project_1_0(vec2 scHi, vec2 trHi, vec2 scLo, vec2 trLo, vec2 posHi, vec2 posLo) {\\n  return (posHi + trHi) * scHi\\n       + (posLo + trLo) * scHi\\n       + (posHi + trHi) * scLo\\n       + (posLo + trLo) * scLo;\\n}\\n\\n\\nvoid main() {\\n  vec2 p = project_1_0(scaleHi, translateHi, scaleLo, translateLo, aHi, aLo);\\n  gl_Position = vec4(p, 0.0, 1.0);\\n  gl_PointSize = radius;\\n}\",r.mitreFragment=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec4 color;\\n\\nvoid main() {\\n  if(length(gl_PointCoord.xy - 0.5) > 0.25) {\\n    discard;\\n  }\\n  gl_FragColor = vec4(color.rgb, color.a);\\n}\",r.pickVertex=\"precision highp float;\\n#define GLSLIFY 1\\n\\nattribute vec2 aHi, aLo, dHi;\\nattribute vec4 pick0, pick1;\\n\\nuniform vec2 scaleHi, translateHi, scaleLo, translateLo, screenShape;\\nuniform float width;\\n\\nvarying vec4 pickA, pickB;\\n\\n\\nvec2 project_1_0(vec2 scHi, vec2 trHi, vec2 scLo, vec2 trLo, vec2 posHi, vec2 posLo) {\\n  return (posHi + trHi) * scHi\\n       + (posLo + trLo) * scHi\\n       + (posHi + trHi) * scLo\\n       + (posLo + trLo) * scLo;\\n}\\n\\n\\nvoid main() {\\n  vec2 p = project_1_0(scaleHi, translateHi, scaleLo, translateLo, aHi, aLo);\\n  vec2 n = width * normalize(screenShape.yx * vec2(dHi.y, -dHi.x)) / screenShape.xy;\\n  gl_Position = vec4(p + n, 0, 1);\\n  pickA = pick0;\\n  pickB = pick1;\\n}\",r.pickFragment=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec4 pickOffset;\\n\\nvarying vec4 pickA, pickB;\\n\\nvoid main() {\\n  vec4 fragId = vec4(pickA.xyz, 0.0);\\n  if(pickB.w > pickA.w) {\\n    fragId.xyz = pickB.xyz;\\n  }\\n\\n  fragId += pickOffset;\\n\\n  fragId.y += floor(fragId.x / 256.0);\\n  fragId.x -= floor(fragId.x / 256.0) * 256.0;\\n\\n  fragId.z += floor(fragId.y / 256.0);\\n  fragId.y -= floor(fragId.y / 256.0) * 256.0;\\n\\n  fragId.w += floor(fragId.z / 256.0);\\n  fragId.z -= floor(fragId.z / 256.0) * 256.0;\\n\\n  gl_FragColor = fragId / 255.0;\\n}\",r.fillVertex=\"precision highp float;\\n#define GLSLIFY 1\\n\\nattribute vec2 aHi, aLo, dHi;\\n\\nuniform vec2 scaleHi, translateHi, scaleLo, translateLo, projectAxis;\\nuniform float projectValue, depth;\\n\\n\\nvec2 project_1_0(vec2 scHi, vec2 trHi, vec2 scLo, vec2 trLo, vec2 posHi, vec2 posLo) {\\n  return (posHi + trHi) * scHi\\n       + (posLo + trLo) * scHi\\n       + (posHi + trHi) * scLo\\n       + (posLo + trLo) * scLo;\\n}\\n\\n\\nvoid main() {\\n  vec2 p = project_1_0(scaleHi, translateHi, scaleLo, translateLo, aHi, aLo);\\n  if(dHi.y < 0.0 || (dHi.y == 0.0 && dHi.x < 0.0)) {\\n    if(dot(p, projectAxis) < projectValue) {\\n      p = p * (1.0 - abs(projectAxis)) + projectAxis * projectValue;\\n    }\\n  }\\n  gl_Position = vec4(p, depth, 1);\\n}\",r.fillFragment=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec4 color;\\n\\nvoid main() {\\n  gl_FragColor = vec4(color.rgb * color.a, color.a);\\n}\"},{}],154:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o,s,l){this.plot=t,this.dashPattern=e,this.lineBufferHi=r,this.lineBufferLo=n,this.pickBuffer=i,this.lineShader=a,this.mitreShader=o,this.fillShader=s,this.pickShader=l,this.usingDashes=!1,this.bounds=[1/0,1/0,-1/0,-1/0],this.width=1,this.color=[0,0,1,1],this.fill=[!1,!1,!1,!1],this.fillColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.data=null,this.numPoints=0,this.vertCount=0,this.pickOffset=0}function i(t){return t.map(function(t){return t.slice()})}function a(t,e){var r=t.gl,i=s(r),a=s(r),u=s(r),c=new n(t,l(r,[1,1]),i,a,u,o(r,h.lineVertex,h.lineFragment),o(r,h.mitreVertex,h.mitreFragment),o(r,h.fillVertex,h.fillFragment),o(r,h.pickVertex,h.pickFragment));return t.addObject(c),c.update(e),c}e.exports=a;var o=t(\"gl-shader\"),s=t(\"gl-buffer\"),l=t(\"gl-texture2d\"),u=t(\"ndarray\"),c=t(\"typedarray-pool\"),h=t(\"./lib/shaders\"),f=n.prototype;f.setProjectionModel=function(){var t={scaleHi:new Float32Array([0,0]),scaleLo:new Float32Array([0,0]),translateHi:new Float32Array([0,0]),translateLo:new Float32Array([0,0]),screenShape:[0,0]};return function(){var e=this.bounds,r=this.plot.viewBox,n=this.plot.dataBox,i=e[2]-e[0],a=e[3]-e[1],o=n[2]-n[0],s=n[3]-n[1],l=r[2]-r[0],u=r[3]-r[1],c=2*i/o,h=2*a/s,f=(e[0]-n[0]-.5*o)/i,d=(e[1]-n[1]-.5*s)/a;return t.scaleHi[0]=c,t.scaleHi[1]=h,t.scaleLo[0]=c-t.scaleHi[0],t.scaleLo[1]=h-t.scaleHi[1],t.translateHi[0]=f,t.translateHi[1]=d,t.translateLo[0]=f-t.translateHi[0],t.translateLo[1]=d-t.translateHi[1],t.screenShape[0]=l,t.screenShape[1]=u,t}}(),f.setProjectionUniforms=function(t,e){t.scaleHi=e.scaleHi,t.scaleLo=e.scaleLo,t.translateHi=e.translateHi,t.translateLo=e.translateLo,t.screenShape=e.screenShape},f.draw=function(){var t=[1,0],e=[-1,0],r=[0,1],n=[0,-1];return function(){var i=this.vertCount;if(i){var a=this.setProjectionModel(),o=this.plot,s=this.width,l=o.gl,u=o.pixelRatio,c=this.color,h=this.fillShader.attributes;this.lineBufferLo.bind(),h.aLo.pointer(l.FLOAT,!1,16,0),this.lineBufferHi.bind();var f=this.fill;if(f[0]||f[1]||f[2]||f[3]){var d=this.fillShader;d.bind();var p=d.uniforms;this.setProjectionUniforms(p,a),p.depth=o.nextDepthValue(),h.aHi.pointer(l.FLOAT,!1,16,0),h.dHi.pointer(l.FLOAT,!1,16,8),l.depthMask(!0),l.enable(l.DEPTH_TEST);var m=this.fillColor;f[0]&&(p.color=m[0],p.projectAxis=e,p.projectValue=1,l.drawArrays(l.TRIANGLES,0,i)),f[1]&&(p.color=m[1],p.projectAxis=n,p.projectValue=1,l.drawArrays(l.TRIANGLES,0,i)),f[2]&&(p.color=m[2],p.projectAxis=t,p.projectValue=1,l.drawArrays(l.TRIANGLES,0,i)),f[3]&&(p.color=m[3],p.projectAxis=r,p.projectValue=1,l.drawArrays(l.TRIANGLES,0,i)),l.depthMask(!1),l.disable(l.DEPTH_TEST)}var g=this.lineShader;g.bind(),this.lineBufferLo.bind(),g.attributes.aLo.pointer(l.FLOAT,!1,16,0),g.attributes.dLo.pointer(l.FLOAT,!1,16,8),this.lineBufferHi.bind();var v=g.uniforms;this.setProjectionUniforms(v,a),v.color=c,v.width=s*u,v.dashPattern=this.dashPattern.bind(),v.dashLength=this.dashLength*u;var y=g.attributes;if(y.aHi.pointer(l.FLOAT,!1,16,0),y.dHi.pointer(l.FLOAT,!1,16,8),l.drawArrays(l.TRIANGLES,0,i),s>2&&!this.usingDashes){var b=this.mitreShader;this.lineBufferLo.bind(),b.attributes.aLo.pointer(l.FLOAT,!1,48,0),this.lineBufferHi.bind(),b.bind();var x=b.uniforms;this.setProjectionUniforms(x,a),x.color=c,x.radius=s*u,b.attributes.aHi.pointer(l.FLOAT,!1,48,0),l.drawArrays(l.POINTS,0,i/3|0)}}}}(),f.drawPick=function(){var t=[0,0,0,0];return function(e){var r=this.vertCount,n=this.numPoints;if(this.pickOffset=e,!r)return e+n;var i=this.setProjectionModel(),a=this.plot,o=this.width,s=a.gl,l=a.pickPixelRatio,u=this.pickShader,c=this.pickBuffer;t[0]=255&e,t[1]=e>>>8&255,t[2]=e>>>16&255,t[3]=e>>>24,u.bind();var h=u.uniforms;this.setProjectionUniforms(h,i),h.width=o*l,h.pickOffset=t;var f=u.attributes;return this.lineBufferHi.bind(),f.aHi.pointer(s.FLOAT,!1,16,0),f.dHi.pointer(s.FLOAT,!1,16,8),this.lineBufferLo.bind(),f.aLo.pointer(s.FLOAT,!1,16,0),c.bind(),f.pick0.pointer(s.UNSIGNED_BYTE,!1,8,0),f.pick1.pointer(s.UNSIGNED_BYTE,!1,8,4),s.drawArrays(s.TRIANGLES,0,r),e+n}}(),f.pick=function(t,e,r){var n=this.pickOffset,i=this.numPoints;if(r<n||r>=n+i)return null;var a=r-n,o=this.data;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}},f.update=function(t){t=t||{};var e,r,n,a,o,s=this.plot.gl;this.color=(t.color||[0,0,1,1]).slice(),this.width=+(t.width||1),this.fill=(t.fill||[!1,!1,!1,!1]).slice(),this.fillColor=i(t.fillColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);var h=t.dashes||[1],f=0;for(e=0;e<h.length;++e)f+=h[e];var d=c.mallocUint8(f);n=0;var p=255;for(e=0;e<h.length;++e){for(r=0;r<h[e];++r)d[n++]=p;p^=255}this.dashPattern.dispose(),this.usingDashes=h.length>1,this.dashPattern=l(s,u(d,[f,1,4],[1,0,0])),this.dashPattern.minFilter=s.NEAREST,this.dashPattern.magFilter=s.NEAREST,this.dashLength=f,c.free(d);var m=t.positions;this.data=m;var g=this.bounds;g[0]=g[1]=1/0,g[2]=g[3]=-1/0;var v=this.numPoints=m.length>>>1;if(0!==v){for(e=0;e<v;++e)a=m[2*e],o=m[2*e+1],isNaN(a)||isNaN(o)||(g[0]=Math.min(g[0],a),g[1]=Math.min(g[1],o),g[2]=Math.max(g[2],a),g[3]=Math.max(g[3],o));g[0]===g[2]&&(g[2]+=1),g[3]===g[1]&&(g[3]+=1);var y=c.mallocFloat64(24*(v-1)),b=c.mallocFloat32(24*(v-1)),x=c.mallocFloat32(24*(v-1)),_=c.mallocUint32(12*(v-1)),w=b.length,M=_.length;n=v;for(var k=0;n>1;){var A=--n;a=m[2*n],o=m[2*n+1];var T=A-1,S=m[2*T],E=m[2*T+1];if(!(isNaN(a)||isNaN(o)||isNaN(S)||isNaN(E))){k+=1,a=(a-g[0])/(g[2]-g[0]),o=(o-g[1])/(g[3]-g[1]);var L=(S=(S-g[0])/(g[2]-g[0]))-a,C=(E=(E-g[1])/(g[3]-g[1]))-o,z=A|1<<24,D=A-1,I=A,P=A-1|1<<24;y[--w]=-C,y[--w]=-L,y[--w]=o,y[--w]=a,_[--M]=z,_[--M]=D,y[--w]=C,y[--w]=L,y[--w]=E,y[--w]=S,_[--M]=I,_[--M]=P,y[--w]=-C,y[--w]=-L,y[--w]=E,y[--w]=S,_[--M]=I,_[--M]=P,y[--w]=C,y[--w]=L,y[--w]=E,y[--w]=S,_[--M]=I,_[--M]=P,y[--w]=-C,y[--w]=-L,y[--w]=o,y[--w]=a,_[--M]=z,_[--M]=D,y[--w]=C,y[--w]=L,y[--w]=o,y[--w]=a,_[--M]=z,_[--M]=D}}for(e=0;e<y.length;e++)b[e]=y[e],x[e]=y[e]-b[e];this.vertCount=6*k,this.lineBufferHi.update(b.subarray(w)),this.lineBufferLo.update(x.subarray(w)),this.pickBuffer.update(_.subarray(M)),c.free(y),c.free(b),c.free(x),c.free(_)}},f.dispose=function(){this.plot.removeObject(this),this.lineBufferLo.dispose(),this.lineBufferHi.dispose(),this.pickBuffer.dispose(),this.lineShader.dispose(),this.mitreShader.dispose(),this.fillShader.dispose(),this.pickShader.dispose(),this.dashPattern.dispose()}},{\"./lib/shaders\":153,\"gl-buffer\":141,\"gl-shader\":239,\"gl-texture2d\":251,ndarray:449,\"typedarray-pool\":521}],155:[function(t,e,r){var n=t(\"gl-shader\"),i=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position, nextPosition;\\nattribute float arcLength, lineWidth;\\nattribute vec4 color;\\n\\nuniform vec2 screenShape;\\nuniform float pixelRatio;\\nuniform mat4 model, view, projection;\\n\\nvarying vec4 fragColor;\\nvarying vec3 worldPosition;\\nvarying float pixelArcLength;\\n\\nvoid main() {\\n  vec4 projected = projection * view * model * vec4(position, 1.0);\\n  vec4 tangentClip = projection * view * model * vec4(nextPosition - position, 0.0);\\n  vec2 tangent = normalize(screenShape * tangentClip.xy);\\n  vec2 offset = 0.5 * pixelRatio * lineWidth * vec2(tangent.y, -tangent.x) / screenShape;\\n\\n  gl_Position = vec4(projected.xy + projected.w * offset, projected.zw);\\n\\n  worldPosition = position;\\n  pixelArcLength = arcLength;\\n  fragColor = color;\\n}\\n\",a=[{name:\"position\",type:\"vec3\"},{name:\"nextPosition\",type:\"vec3\"},{name:\"arcLength\",type:\"float\"},{name:\"lineWidth\",type:\"float\"},{name:\"color\",type:\"vec4\"}];r.createShader=function(t){return n(t,i,\"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\",null,a)},r.createPickShader=function(t){return n(t,i,\"precision mediump float;\\n#define GLSLIFY 1\\n\\n#define FLOAT_MAX  1.70141184e38\\n#define FLOAT_MIN  1.17549435e-38\\n\\nlowp vec4 encode_float_1_0(highp float v) {\\n  highp float av = abs(v);\\n\\n  //Handle special cases\\n  if(av < FLOAT_MIN) {\\n    return vec4(0.0, 0.0, 0.0, 0.0);\\n  } else if(v > FLOAT_MAX) {\\n    return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\\n  } else if(v < -FLOAT_MAX) {\\n    return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\\n  }\\n\\n  highp vec4 c = vec4(0,0,0,0);\\n\\n  //Compute exponent and mantissa\\n  highp float e = floor(log2(av));\\n  highp float m = av * pow(2.0, -e) - 1.0;\\n  \\n  //Unpack mantissa\\n  c[1] = floor(128.0 * m);\\n  m -= c[1] / 128.0;\\n  c[2] = floor(32768.0 * m);\\n  m -= c[2] / 32768.0;\\n  c[3] = floor(8388608.0 * m);\\n  \\n  //Unpack exponent\\n  highp float ebias = e + 127.0;\\n  c[0] = floor(ebias / 2.0);\\n  ebias -= c[0] * 2.0;\\n  c[1] += floor(ebias) * 128.0; \\n\\n  //Unpack sign bit\\n  c[0] += 128.0 * step(0.0, -v);\\n\\n  //Scale back to range\\n  return c / 255.0;\\n}\\n\\n\\n\\nuniform float pickId;\\nuniform vec3 clipBounds[2];\\n\\nvarying vec3 worldPosition;\\nvarying float pixelArcLength;\\nvarying vec4 fragColor;\\n\\nvoid main() {\\n  if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\\n    discard;\\n  }\\n  gl_FragColor = vec4(pickId/255.0, encode_float_1_0(pixelArcLength).xyz);\\n}\",null,a)}},{\"gl-shader\":239}],156:[function(t,e,r){\"use strict\";function n(t,e){for(var r=0,n=0;n<3;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function i(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function a(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function o(t,e,r,n,i,a){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.dirty=!0,this.pixelRatio=1}function s(t){var e=t.gl||t.scene&&t.scene.gl,r=m(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var n=g(e);n.attributes.position.location=0,n.attributes.nextPosition.location=1,n.attributes.arcLength.location=2,n.attributes.lineWidth.location=3,n.attributes.color.location=4;for(var i=l(e),a=u(e,[{buffer:i,size:3,offset:0,stride:48},{buffer:i,size:3,offset:12,stride:48},{buffer:i,size:1,offset:24,stride:48},{buffer:i,size:1,offset:28,stride:48},{buffer:i,size:4,offset:32,stride:48}]),s=d(new Array(1024),[256,1,4]),h=0;h<1024;++h)s.data[h]=255;var f=c(e,s);f.wrap=e.REPEAT;var p=new o(e,r,n,i,a,f);return p.update(t),p}e.exports=s;var l=t(\"gl-buffer\"),u=t(\"gl-vao\"),c=t(\"gl-texture2d\"),h=t(\"glsl-read-float\"),f=t(\"binary-search-bounds\"),d=t(\"ndarray\"),p=t(\"./lib/shaders\"),m=p.createShader,g=p.createPickShader,v=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],y=o.prototype;y.isTransparent=function(){return this.opacity<1},y.isOpaque=function(){return this.opacity>=1},y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.drawTransparent=y.draw=function(t){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||v,view:t.view||v,projection:t.projection||v,clipBounds:i(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},y.drawPick=function(t){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||v,view:t.view||v,projection:t.projection||v,pickId:this.pickId,clipBounds:i(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},y.update=function(t){var e,r;this.dirty=!0;var i=!!t.connectGaps;\"dashScale\"in t&&(this.dashScale=t.dashScale),\"opacity\"in t&&(this.opacity=+t.opacity);var a=t.position||t.positions;if(a){var o=t.color||t.colors||[0,0,0,1],s=t.lineWidth||1,l=[],u=[],c=[],h=0,p=0,m=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],g=!1;t:for(e=1;e<a.length;++e){var v=a[e-1],y=a[e];for(u.push(h),c.push(v.slice()),r=0;r<3;++r){if(isNaN(v[r])||isNaN(y[r])||!isFinite(v[r])||!isFinite(y[r])){if(!i&&l.length>0){for(var b=0;b<24;++b)l.push(l[l.length-12]);p+=2,g=!0}continue t}m[0][r]=Math.min(m[0][r],v[r],y[r]),m[1][r]=Math.max(m[1][r],v[r],y[r])}var x,_;Array.isArray(o[0])?(x=o[e-1],_=o[e]):x=_=o,3===x.length&&(x=[x[0],x[1],x[2],1]),3===_.length&&(_=[_[0],_[1],_[2],1]);var w;w=Array.isArray(s)?s[e-1]:s;var M=h;if(h+=n(v,y),g){for(r=0;r<2;++r)l.push(v[0],v[1],v[2],y[0],y[1],y[2],M,w,x[0],x[1],x[2],x[3]);p+=2,g=!1}l.push(v[0],v[1],v[2],y[0],y[1],y[2],M,w,x[0],x[1],x[2],x[3],v[0],v[1],v[2],y[0],y[1],y[2],M,-w,x[0],x[1],x[2],x[3],y[0],y[1],y[2],v[0],v[1],v[2],h,-w,_[0],_[1],_[2],_[3],y[0],y[1],y[2],v[0],v[1],v[2],h,w,_[0],_[1],_[2],_[3]),p+=4}if(this.buffer.update(l),u.push(h),c.push(a[a.length-1].slice()),this.bounds=m,this.vertexCount=p,this.points=c,this.arcLength=u,\"dashes\"in t){var k=t.dashes.slice();for(k.unshift(0),e=1;e<k.length;++e)k[e]=k[e-1]+k[e];var A=d(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&f.le(k,k[k.length-1]*e/255)?A.set(e,0,0,0):A.set(e,0,0,255)}this.texture.setPixels(A)}}},y.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()},y.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=h(t.value[0],t.value[1],t.value[2],0),r=f.le(this.arcLength,e);if(r<0)return null;if(r===this.arcLength.length-1)return new a(this.arcLength[this.arcLength.length-1],this.points[this.points.length-1].slice(),r);for(var n=this.points[r],i=this.points[Math.min(r+1,this.points.length-1)],o=(e-this.arcLength[r])/(this.arcLength[r+1]-this.arcLength[r]),s=1-o,l=[0,0,0],u=0;u<3;++u)l[u]=s*n[u]+o*i[u];var c=Math.min(o<.5?r:r+1,this.points.length-1);return new a(e,l,c,this.points[c])}},{\"./lib/shaders\":155,\"binary-search-bounds\":59,\"gl-buffer\":141,\"gl-texture2d\":251,\"gl-vao\":255,\"glsl-read-float\":262,ndarray:449}],157:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*a-i*n;return o?(o=1/o,t[0]=a*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}e.exports=n},{}],158:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=c*o-s*u,f=-c*a+s*l,d=u*a-o*l,p=r*h+n*f+i*d;return p?(p=1/p,t[0]=h*p,t[1]=(-c*n+i*u)*p,t[2]=(s*n-i*o)*p,t[3]=f*p,t[4]=(c*r-i*l)*p,t[5]=(-s*r+i*a)*p,t[6]=d*p,t[7]=(-u*r+n*l)*p,t[8]=(o*r-n*a)*p,t):null}e.exports=n},{}],159:[function(t,e,r){function n(t){var e=new Float32Array(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}e.exports=n},{}],160:[function(t,e,r){function n(){var t=new Float32Array(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}e.exports=n},{}],161:[function(t,e,r){function n(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15];return(e*o-r*a)*(h*g-f*m)-(e*s-n*a)*(c*g-f*p)+(e*l-i*a)*(c*m-h*p)+(r*s-n*o)*(u*g-f*d)-(r*l-i*o)*(u*m-h*d)+(n*l-i*s)*(u*p-c*d)}e.exports=n},{}],162:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,u=r*o,c=n*o,h=n*s,f=i*o,d=i*s,p=i*l,m=a*o,g=a*s,v=a*l;return t[0]=1-h-p,t[1]=c+v,t[2]=f-g,t[3]=0,t[4]=c-v,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=f+g,t[9]=d-m,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}e.exports=n},{}],163:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=n+n,l=i+i,u=a+a,c=n*s,h=n*l,f=n*u,d=i*l,p=i*u,m=a*u,g=o*s,v=o*l,y=o*u;return t[0]=1-(d+m),t[1]=h+y,t[2]=f-v,t[3]=0,t[4]=h-y,t[5]=1-(c+m),t[6]=p+g,t[7]=0,t[8]=f+v,t[9]=p-g,t[10]=1-(c+d),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}e.exports=n},{}],164:[function(t,e,r){function n(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}e.exports=n},{}],165:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*s-n*o,b=r*l-i*o,x=r*u-a*o,_=n*l-i*s,w=n*u-a*s,M=i*u-a*l,k=c*m-h*p,A=c*g-f*p,T=c*v-d*p,S=h*g-f*m,E=h*v-d*m,L=f*v-d*g,C=y*L-b*E+x*S+_*T-w*A+M*k;return C?(C=1/C,t[0]=(s*L-l*E+u*S)*C,t[1]=(i*E-n*L-a*S)*C,t[2]=(m*M-g*w+v*_)*C,t[3]=(f*w-h*M-d*_)*C,t[4]=(l*T-o*L-u*A)*C,t[5]=(r*L-i*T+a*A)*C,t[6]=(g*x-p*M-v*b)*C,t[7]=(c*M-f*x+d*b)*C,t[8]=(o*E-s*T+u*k)*C,t[9]=(n*T-r*E-a*k)*C,t[10]=(p*w-m*x+v*y)*C,t[11]=(h*x-c*w-d*y)*C,t[12]=(s*A-o*S-l*k)*C,t[13]=(r*S-n*A+i*k)*C,t[14]=(m*b-p*_-g*y)*C,t[15]=(c*_-h*b+f*y)*C,t):null}e.exports=n},{}],166:[function(t,e,r){function n(t,e,r,n){var a,o,s,l,u,c,h,f,d,p,m=e[0],g=e[1],v=e[2],y=n[0],b=n[1],x=n[2],_=r[0],w=r[1],M=r[2];return Math.abs(m-_)<1e-6&&Math.abs(g-w)<1e-6&&Math.abs(v-M)<1e-6?i(t):(h=m-_,f=g-w,d=v-M,p=1/Math.sqrt(h*h+f*f+d*d),h*=p,f*=p,d*=p,a=b*d-x*f,o=x*h-y*d,s=y*f-b*h,p=Math.sqrt(a*a+o*o+s*s),p?(a*=p=1/p,o*=p,s*=p):(a=0,o=0,s=0),l=f*s-d*o,u=d*a-h*s,c=h*o-f*a,p=Math.sqrt(l*l+u*u+c*c),p?(l*=p=1/p,u*=p,c*=p):(l=0,u=0,c=0),t[0]=a,t[1]=l,t[2]=h,t[3]=0,t[4]=o,t[5]=u,t[6]=f,t[7]=0,t[8]=s,t[9]=c,t[10]=d,t[11]=0,t[12]=-(a*m+o*g+s*v),t[13]=-(l*m+u*g+c*v),t[14]=-(h*m+f*g+d*v),t[15]=1,t)}var i=t(\"./identity\");e.exports=n},{\"./identity\":164}],167:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=e[9],d=e[10],p=e[11],m=e[12],g=e[13],v=e[14],y=e[15],b=r[0],x=r[1],_=r[2],w=r[3];return t[0]=b*n+x*s+_*h+w*m,t[1]=b*i+x*l+_*f+w*g,t[2]=b*a+x*u+_*d+w*v,t[3]=b*o+x*c+_*p+w*y,b=r[4],x=r[5],_=r[6],w=r[7],t[4]=b*n+x*s+_*h+w*m,t[5]=b*i+x*l+_*f+w*g,t[6]=b*a+x*u+_*d+w*v,t[7]=b*o+x*c+_*p+w*y,b=r[8],x=r[9],_=r[10],w=r[11],t[8]=b*n+x*s+_*h+w*m,t[9]=b*i+x*l+_*f+w*g,t[10]=b*a+x*u+_*d+w*v,t[11]=b*o+x*c+_*p+w*y,b=r[12],x=r[13],_=r[14],w=r[15],t[12]=b*n+x*s+_*h+w*m,t[13]=b*i+x*l+_*f+w*g,t[14]=b*a+x*u+_*d+w*v,t[15]=b*o+x*c+_*p+w*y,t}e.exports=n},{}],168:[function(t,e,r){function n(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t}e.exports=n},{}],169:[function(t,e,r){function n(t,e,r,n){var i,a,o,s,l,u,c,h,f,d,p,m,g,v,y,b,x,_,w,M,k,A,T,S,E=n[0],L=n[1],C=n[2],z=Math.sqrt(E*E+L*L+C*C);return Math.abs(z)<1e-6?null:(z=1/z,E*=z,L*=z,C*=z,i=Math.sin(r),a=Math.cos(r),o=1-a,s=e[0],l=e[1],u=e[2],c=e[3],h=e[4],f=e[5],d=e[6],p=e[7],m=e[8],g=e[9],v=e[10],y=e[11],b=E*E*o+a,x=L*E*o+C*i,_=C*E*o-L*i,w=E*L*o-C*i,M=L*L*o+a,k=C*L*o+E*i,A=E*C*o+L*i,T=L*C*o-E*i,S=C*C*o+a,t[0]=s*b+h*x+m*_,t[1]=l*b+f*x+g*_,t[2]=u*b+d*x+v*_,t[3]=c*b+p*x+y*_,t[4]=s*w+h*M+m*k,t[5]=l*w+f*M+g*k,t[6]=u*w+d*M+v*k,t[7]=c*w+p*M+y*k,t[8]=s*A+h*T+m*S,t[9]=l*A+f*T+g*S,t[10]=u*A+d*T+v*S,t[11]=c*A+p*T+y*S,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}e.exports=n},{}],170:[function(t,e,r){function n(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+u*n,t[5]=o*i+c*n,t[6]=s*i+h*n,t[7]=l*i+f*n,t[8]=u*i-a*n,t[9]=c*i-o*n,t[10]=h*i-s*n,t[11]=f*i-l*n,t}e.exports=n},{}],171:[function(t,e,r){function n(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i-u*n,t[1]=o*i-c*n,t[2]=s*i-h*n,t[3]=l*i-f*n,t[8]=a*n+u*i,t[9]=o*n+c*i,t[10]=s*n+h*i,t[11]=l*n+f*i,t}e.exports=n},{}],172:[function(t,e,r){function n(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[4],c=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+u*n,t[1]=o*i+c*n,t[2]=s*i+h*n,t[3]=l*i+f*n,t[4]=u*i-a*n,t[5]=c*i-o*n,t[6]=h*i-s*n,t[7]=f*i-l*n,t}e.exports=n},{}],173:[function(t,e,r){function n(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}e.exports=n},{}],174:[function(t,e,r){function n(t,e,r){var n,i,a,o,s,l,u,c,h,f,d,p,m=r[0],g=r[1],v=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*v+e[12],t[13]=e[1]*m+e[5]*g+e[9]*v+e[13],t[14]=e[2]*m+e[6]*g+e[10]*v+e[14],t[15]=e[3]*m+e[7]*g+e[11]*v+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=f,t[10]=d,t[11]=p,t[12]=n*m+s*g+h*v+e[12],t[13]=i*m+l*g+f*v+e[13],t[14]=a*m+u*g+d*v+e[14],t[15]=o*m+c*g+p*v+e[15]),t}e.exports=n},{}],175:[function(t,e,r){function n(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}e.exports=n},{}],176:[function(t,e,r){\"use strict\";function n(t,e){switch(e.length){case 0:break;case 1:t[0]=1/e[0];break;case 4:i(t,e);break;case 9:a(t,e);break;case 16:o(t,e);break;default:throw new Error(\"currently supports matrices up to 4x4\")}return t}e.exports=n;var i=t(\"gl-mat2/invert\"),a=t(\"gl-mat3/invert\"),o=t(\"gl-mat4/invert\")},{\"gl-mat2/invert\":157,\"gl-mat3/invert\":158,\"gl-mat4/invert\":165}],177:[function(t,e,r){r.glMatrix=t(\"./gl-matrix/common.js\"),r.mat2=t(\"./gl-matrix/mat2.js\"),r.mat2d=t(\"./gl-matrix/mat2d.js\"),r.mat3=t(\"./gl-matrix/mat3.js\"),r.mat4=t(\"./gl-matrix/mat4.js\"),r.quat=t(\"./gl-matrix/quat.js\"),r.vec2=t(\"./gl-matrix/vec2.js\"),r.vec3=t(\"./gl-matrix/vec3.js\"),r.vec4=t(\"./gl-matrix/vec4.js\")},{\"./gl-matrix/common.js\":178,\"./gl-matrix/mat2.js\":179,\"./gl-matrix/mat2d.js\":180,\"./gl-matrix/mat3.js\":181,\"./gl-matrix/mat4.js\":182,\"./gl-matrix/quat.js\":183,\"./gl-matrix/vec2.js\":184,\"./gl-matrix/vec3.js\":185,\"./gl-matrix/vec4.js\":186}],178:[function(t,e,r){var n={};n.EPSILON=1e-6,n.ARRAY_TYPE=\"undefined\"!=typeof Float32Array?Float32Array:Array,n.RANDOM=Math.random,n.ENABLE_SIMD=!1,n.SIMD_AVAILABLE=n.ARRAY_TYPE===Float32Array&&\"SIMD\"in this,n.USE_SIMD=n.ENABLE_SIMD&&n.SIMD_AVAILABLE,n.setMatrixArrayType=function(t){n.ARRAY_TYPE=t};var i=Math.PI/180;n.toRadian=function(t){return t*i},n.equals=function(t,e){return Math.abs(t-e)<=n.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))},e.exports=n},{}],179:[function(t,e,r){var n=t(\"./common.js\"),i={};i.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},i.clone=function(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},i.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},i.fromValues=function(t,e,r,i){var a=new n.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a},i.set=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t},i.transpose=function(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},i.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*a-i*n;return o?(o=1/o,t[0]=a*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null},i.adjoint=function(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t},i.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},i.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1],u=r[2],c=r[3];return t[0]=n*s+a*l,t[1]=i*s+o*l,t[2]=n*u+a*c,t[3]=i*u+o*c,t},i.mul=i.multiply,i.rotate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+a*s,t[1]=i*l+o*s,t[2]=n*-s+a*l,t[3]=i*-s+o*l,t},i.scale=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1];return t[0]=n*s,t[1]=i*s,t[2]=a*l,t[3]=o*l,t},i.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t},i.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t},i.str=function(t){return\"mat2(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"},i.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},i.LDU=function(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t},i.sub=i.subtract,i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=e[0],l=e[1],u=e[2],c=e[3];return Math.abs(r-s)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-l)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-u)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(u))&&Math.abs(o-c)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))},i.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},i.multiplyScalarAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t},e.exports=i},{\"./common.js\":178}],180:[function(t,e,r){var n=t(\"./common.js\"),i={};i.create=function(){var t=new n.ARRAY_TYPE(6);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},i.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},i.fromValues=function(t,e,r,i,a,o){var s=new n.ARRAY_TYPE(6);return s[0]=t,s[1]=e,s[2]=r,s[3]=i,s[4]=a,s[5]=o,s},i.set=function(t,e,r,n,i,a,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t},i.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=r*a-n*i;return l?(l=1/l,t[0]=a*l,t[1]=-n*l,t[2]=-i*l,t[3]=r*l,t[4]=(i*s-a*o)*l,t[5]=(n*o-r*s)*l,t):null},i.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},i.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=r[0],c=r[1],h=r[2],f=r[3],d=r[4],p=r[5];return t[0]=n*u+a*c,t[1]=i*u+o*c,t[2]=n*h+a*f,t[3]=i*h+o*f,t[4]=n*d+a*p+s,t[5]=i*d+o*p+l,t},i.mul=i.multiply,i.rotate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=Math.sin(r),c=Math.cos(r);return t[0]=n*c+a*u,t[1]=i*c+o*u,t[2]=n*-u+a*c,t[3]=i*-u+o*c,t[4]=s,t[5]=l,t},i.scale=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=r[0],c=r[1];return t[0]=n*u,t[1]=i*u,t[2]=a*c,t[3]=o*c,t[4]=s,t[5]=l,t},i.translate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=n*u+a*c+s,t[5]=i*u+o*c+l,t},i.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t},i.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},i.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t},i.str=function(t){return\"mat2d(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\")\"},i.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t},i.sub=i.subtract,i.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t},i.multiplyScalarAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=e[0],c=e[1],h=e[2],f=e[3],d=e[4],p=e[5];return Math.abs(r-u)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-c)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(a-h)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(o-f)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(s-d)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(l-p)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(p))},e.exports=i},{\"./common.js\":178}],181:[function(t,e,r){var n=t(\"./common.js\"),i={};i.create=function(){var t=new n.ARRAY_TYPE(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},i.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},i.clone=function(t){var e=new n.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},i.fromValues=function(t,e,r,i,a,o,s,l,u){var c=new n.ARRAY_TYPE(9);return c[0]=t,c[1]=e,c[2]=r,c[3]=i,c[4]=a,c[5]=o,c[6]=s,c[7]=l,c[8]=u,c},i.set=function(t,e,r,n,i,a,o,s,l,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=l,t[8]=u,t},i.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},i.transpose=function(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},i.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=c*o-s*u,f=-c*a+s*l,d=u*a-o*l,p=r*h+n*f+i*d;return p?(p=1/p,t[0]=h*p,t[1]=(-c*n+i*u)*p,t[2]=(s*n-i*o)*p,t[3]=f*p,t[4]=(c*r-i*l)*p,t[5]=(-s*r+i*a)*p,t[6]=d*p,t[7]=(-u*r+n*l)*p,t[8]=(o*r-n*a)*p,t):null},i.adjoint=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8];return t[0]=o*c-s*u,t[1]=i*u-n*c,t[2]=n*s-i*o,t[3]=s*l-a*c,t[4]=r*c-i*l,t[5]=i*a-r*s,t[6]=a*u-o*l,t[7]=n*l-r*u,t[8]=r*o-n*a,t},i.determinant=function(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8];return e*(u*a-o*l)+r*(-u*i+o*s)+n*(l*i-a*s)},i.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=r[0],d=r[1],p=r[2],m=r[3],g=r[4],v=r[5],y=r[6],b=r[7],x=r[8];return t[0]=f*n+d*o+p*u,t[1]=f*i+d*s+p*c,t[2]=f*a+d*l+p*h,t[3]=m*n+g*o+v*u,t[4]=m*i+g*s+v*c,t[5]=m*a+g*l+v*h,t[6]=y*n+b*o+x*u,t[7]=y*i+b*s+x*c,t[8]=y*a+b*l+x*h,t},i.mul=i.multiply,i.translate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=f*n+d*o+u,t[7]=f*i+d*s+c,t[8]=f*a+d*l+h,t},i.rotate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=Math.sin(r),d=Math.cos(r);return t[0]=d*n+f*o,t[1]=d*i+f*s,t[2]=d*a+f*l,t[3]=d*o-f*n,t[4]=d*s-f*i,t[5]=d*l-f*a,t[6]=u,t[7]=c,t[8]=h,t},i.scale=function(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},i.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},i.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},i.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},i.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},i.fromQuat=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,u=r*o,c=n*o,h=n*s,f=i*o,d=i*s,p=i*l,m=a*o,g=a*s,v=a*l;return t[0]=1-h-p,t[3]=c-v,t[6]=f+g,t[1]=c+v,t[4]=1-u-p,t[7]=d-m,t[2]=f-g,t[5]=d+m,t[8]=1-u-h,t},i.normalFromMat4=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*s-n*o,b=r*l-i*o,x=r*u-a*o,_=n*l-i*s,w=n*u-a*s,M=i*u-a*l,k=c*m-h*p,A=c*g-f*p,T=c*v-d*p,S=h*g-f*m,E=h*v-d*m,L=f*v-d*g,C=y*L-b*E+x*S+_*T-w*A+M*k;return C?(C=1/C,t[0]=(s*L-l*E+u*S)*C,t[1]=(l*T-o*L-u*A)*C,t[2]=(o*E-s*T+u*k)*C,t[3]=(i*E-n*L-a*S)*C,t[4]=(r*L-i*T+a*A)*C,t[5]=(n*T-r*E-a*k)*C,t[6]=(m*M-g*w+v*_)*C,t[7]=(g*x-p*M-v*b)*C,t[8]=(p*w-m*x+v*y)*C,t):null},i.str=function(t){return\"mat3(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\")\"},i.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t},i.sub=i.subtract,i.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t},i.multiplyScalarAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],f=e[0],d=e[1],p=e[2],m=e[3],g=e[4],v=e[5],y=t[6],b=e[7],x=e[8];return Math.abs(r-f)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(i-d)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(a-p)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(o-m)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(s-g)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(l-v)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(v))&&Math.abs(u-y)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-b)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(h-x)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(x))},e.exports=i},{\"./common.js\":178}],182:[function(t,e,r){var n=t(\"./common.js\"),i={scalar:{},SIMD:{}};i.create=function(){var t=new n.ARRAY_TYPE(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.clone=function(t){var e=new n.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},i.fromValues=function(t,e,r,i,a,o,s,l,u,c,h,f,d,p,m,g){var v=new n.ARRAY_TYPE(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=i,v[4]=a,v[5]=o,v[6]=s,v[7]=l,v[8]=u,v[9]=c,v[10]=h,v[11]=f,v[12]=d,v[13]=p,v[14]=m,v[15]=g,v},i.set=function(t,e,r,n,i,a,o,s,l,u,c,h,f,d,p,m,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=l,t[8]=u,t[9]=c,t[10]=h,t[11]=f,t[12]=d,t[13]=p,t[14]=m,t[15]=g,t},i.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.scalar.transpose=function(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},i.SIMD.transpose=function(t,e){var r,n,i,a,o,s,l,u,c,h;return r=SIMD.Float32x4.load(e,0),n=SIMD.Float32x4.load(e,4),i=SIMD.Float32x4.load(e,8),a=SIMD.Float32x4.load(e,12),o=SIMD.Float32x4.shuffle(r,n,0,1,4,5),s=SIMD.Float32x4.shuffle(i,a,0,1,4,5),l=SIMD.Float32x4.shuffle(o,s,0,2,4,6),u=SIMD.Float32x4.shuffle(o,s,1,3,5,7),SIMD.Float32x4.store(t,0,l),SIMD.Float32x4.store(t,4,u),o=SIMD.Float32x4.shuffle(r,n,2,3,6,7),s=SIMD.Float32x4.shuffle(i,a,2,3,6,7),c=SIMD.Float32x4.shuffle(o,s,0,2,4,6),h=SIMD.Float32x4.shuffle(o,s,1,3,5,7),SIMD.Float32x4.store(t,8,c),SIMD.Float32x4.store(t,12,h),t},i.transpose=n.USE_SIMD?i.SIMD.transpose:i.scalar.transpose,i.scalar.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*s-n*o,b=r*l-i*o,x=r*u-a*o,_=n*l-i*s,w=n*u-a*s,M=i*u-a*l,k=c*m-h*p,A=c*g-f*p,T=c*v-d*p,S=h*g-f*m,E=h*v-d*m,L=f*v-d*g,C=y*L-b*E+x*S+_*T-w*A+M*k;return C?(C=1/C,t[0]=(s*L-l*E+u*S)*C,t[1]=(i*E-n*L-a*S)*C,t[2]=(m*M-g*w+v*_)*C,t[3]=(f*w-h*M-d*_)*C,t[4]=(l*T-o*L-u*A)*C,t[5]=(r*L-i*T+a*A)*C,t[6]=(g*x-p*M-v*b)*C,t[7]=(c*M-f*x+d*b)*C,t[8]=(o*E-s*T+u*k)*C,t[9]=(n*T-r*E-a*k)*C,t[10]=(p*w-m*x+v*y)*C,t[11]=(h*x-c*w-d*y)*C,t[12]=(s*A-o*S-l*k)*C,t[13]=(r*S-n*A+i*k)*C,t[14]=(m*b-p*_-g*y)*C,t[15]=(c*_-h*b+f*y)*C,t):null},i.SIMD.invert=function(t,e){var r,n,i,a,o,s,l,u,c,h,f=SIMD.Float32x4.load(e,0),d=SIMD.Float32x4.load(e,4),p=SIMD.Float32x4.load(e,8),m=SIMD.Float32x4.load(e,12);return o=SIMD.Float32x4.shuffle(f,d,0,1,4,5),n=SIMD.Float32x4.shuffle(p,m,0,1,4,5),r=SIMD.Float32x4.shuffle(o,n,0,2,4,6),n=SIMD.Float32x4.shuffle(n,o,1,3,5,7),o=SIMD.Float32x4.shuffle(f,d,2,3,6,7),a=SIMD.Float32x4.shuffle(p,m,2,3,6,7),i=SIMD.Float32x4.shuffle(o,a,0,2,4,6),a=SIMD.Float32x4.shuffle(a,o,1,3,5,7),o=SIMD.Float32x4.mul(i,a),o=SIMD.Float32x4.swizzle(o,1,0,3,2),s=SIMD.Float32x4.mul(n,o),l=SIMD.Float32x4.mul(r,o),o=SIMD.Float32x4.swizzle(o,2,3,0,1),s=SIMD.Float32x4.sub(SIMD.Float32x4.mul(n,o),s),l=SIMD.Float32x4.sub(SIMD.Float32x4.mul(r,o),l),l=SIMD.Float32x4.swizzle(l,2,3,0,1),o=SIMD.Float32x4.mul(n,i),o=SIMD.Float32x4.swizzle(o,1,0,3,2),s=SIMD.Float32x4.add(SIMD.Float32x4.mul(a,o),s),c=SIMD.Float32x4.mul(r,o),o=SIMD.Float32x4.swizzle(o,2,3,0,1),s=SIMD.Float32x4.sub(s,SIMD.Float32x4.mul(a,o)),c=SIMD.Float32x4.sub(SIMD.Float32x4.mul(r,o),c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),o=SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(n,2,3,0,1),a),o=SIMD.Float32x4.swizzle(o,1,0,3,2),i=SIMD.Float32x4.swizzle(i,2,3,0,1),s=SIMD.Float32x4.add(SIMD.Float32x4.mul(i,o),s),u=SIMD.Float32x4.mul(r,o),o=SIMD.Float32x4.swizzle(o,2,3,0,1),s=SIMD.Float32x4.sub(s,SIMD.Float32x4.mul(i,o)),u=SIMD.Float32x4.sub(SIMD.Float32x4.mul(r,o),u),u=SIMD.Float32x4.swizzle(u,2,3,0,1),o=SIMD.Float32x4.mul(r,n),o=SIMD.Float32x4.swizzle(o,1,0,3,2),u=SIMD.Float32x4.add(SIMD.Float32x4.mul(a,o),u),c=SIMD.Float32x4.sub(SIMD.Float32x4.mul(i,o),c),o=SIMD.Float32x4.swizzle(o,2,3,0,1),u=SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,o),u),c=SIMD.Float32x4.sub(c,SIMD.Float32x4.mul(i,o)),o=SIMD.Float32x4.mul(r,a),o=SIMD.Float32x4.swizzle(o,1,0,3,2),l=SIMD.Float32x4.sub(l,SIMD.Float32x4.mul(i,o)),u=SIMD.Float32x4.add(SIMD.Float32x4.mul(n,o),u),o=SIMD.Float32x4.swizzle(o,2,3,0,1),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(i,o),l),u=SIMD.Float32x4.sub(u,SIMD.Float32x4.mul(n,o)),o=SIMD.Float32x4.mul(r,i),o=SIMD.Float32x4.swizzle(o,1,0,3,2),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(a,o),l),c=SIMD.Float32x4.sub(c,SIMD.Float32x4.mul(n,o)),o=SIMD.Float32x4.swizzle(o,2,3,0,1),l=SIMD.Float32x4.sub(l,SIMD.Float32x4.mul(a,o)),c=SIMD.Float32x4.add(SIMD.Float32x4.mul(n,o),c),h=SIMD.Float32x4.mul(r,s),h=SIMD.Float32x4.add(SIMD.Float32x4.swizzle(h,2,3,0,1),h),h=SIMD.Float32x4.add(SIMD.Float32x4.swizzle(h,1,0,3,2),h),o=SIMD.Float32x4.reciprocalApproximation(h),h=SIMD.Float32x4.sub(SIMD.Float32x4.add(o,o),SIMD.Float32x4.mul(h,SIMD.Float32x4.mul(o,o))),(h=SIMD.Float32x4.swizzle(h,0,0,0,0))?(SIMD.Float32x4.store(t,0,SIMD.Float32x4.mul(h,s)),SIMD.Float32x4.store(t,4,SIMD.Float32x4.mul(h,l)),SIMD.Float32x4.store(t,8,SIMD.Float32x4.mul(h,u)),SIMD.Float32x4.store(t,12,SIMD.Float32x4.mul(h,c)),t):null},i.invert=n.USE_SIMD?i.SIMD.invert:i.scalar.invert,i.scalar.adjoint=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15];return t[0]=s*(f*v-d*g)-h*(l*v-u*g)+m*(l*d-u*f),t[1]=-(n*(f*v-d*g)-h*(i*v-a*g)+m*(i*d-a*f)),t[2]=n*(l*v-u*g)-s*(i*v-a*g)+m*(i*u-a*l),t[3]=-(n*(l*d-u*f)-s*(i*d-a*f)+h*(i*u-a*l)),t[4]=-(o*(f*v-d*g)-c*(l*v-u*g)+p*(l*d-u*f)),t[5]=r*(f*v-d*g)-c*(i*v-a*g)+p*(i*d-a*f),t[6]=-(r*(l*v-u*g)-o*(i*v-a*g)+p*(i*u-a*l)),t[7]=r*(l*d-u*f)-o*(i*d-a*f)+c*(i*u-a*l),t[8]=o*(h*v-d*m)-c*(s*v-u*m)+p*(s*d-u*h),t[9]=-(r*(h*v-d*m)-c*(n*v-a*m)+p*(n*d-a*h)),t[10]=r*(s*v-u*m)-o*(n*v-a*m)+p*(n*u-a*s),t[11]=-(r*(s*d-u*h)-o*(n*d-a*h)+c*(n*u-a*s)),t[12]=-(o*(h*g-f*m)-c*(s*g-l*m)+p*(s*f-l*h)),t[13]=r*(h*g-f*m)-c*(n*g-i*m)+p*(n*f-i*h),t[14]=-(r*(s*g-l*m)-o*(n*g-i*m)+p*(n*l-i*s)),t[15]=r*(s*f-l*h)-o*(n*f-i*h)+c*(n*l-i*s),t},i.SIMD.adjoint=function(t,e){var r,n,i,a,o,s,l,u,c,h=SIMD.Float32x4.load(e,0),f=SIMD.Float32x4.load(e,4),d=SIMD.Float32x4.load(e,8),p=SIMD.Float32x4.load(e,12);return o=SIMD.Float32x4.shuffle(h,f,0,1,4,5),n=SIMD.Float32x4.shuffle(d,p,0,1,4,5),r=SIMD.Float32x4.shuffle(o,n,0,2,4,6),n=SIMD.Float32x4.shuffle(n,o,1,3,5,7),o=SIMD.Float32x4.shuffle(h,f,2,3,6,7),a=SIMD.Float32x4.shuffle(d,p,2,3,6,7),i=SIMD.Float32x4.shuffle(o,a,0,2,4,6),a=SIMD.Float32x4.shuffle(a,o,1,3,5,7),o=SIMD.Float32x4.mul(i,a),o=SIMD.Float32x4.swizzle(o,1,0,3,2),s=SIMD.Float32x4.mul(n,o),l=SIMD.Float32x4.mul(r,o),o=SIMD.Float32x4.swizzle(o,2,3,0,1),s=SIMD.Float32x4.sub(SIMD.Float32x4.mul(n,o),s),l=SIMD.Float32x4.sub(SIMD.Float32x4.mul(r,o),l),l=SIMD.Float32x4.swizzle(l,2,3,0,1),o=SIMD.Float32x4.mul(n,i),o=SIMD.Float32x4.swizzle(o,1,0,3,2),s=SIMD.Float32x4.add(SIMD.Float32x4.mul(a,o),s),c=SIMD.Float32x4.mul(r,o),o=SIMD.Float32x4.swizzle(o,2,3,0,1),s=SIMD.Float32x4.sub(s,SIMD.Float32x4.mul(a,o)),c=SIMD.Float32x4.sub(SIMD.Float32x4.mul(r,o),c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),o=SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(n,2,3,0,1),a),o=SIMD.Float32x4.swizzle(o,1,0,3,2),i=SIMD.Float32x4.swizzle(i,2,3,0,1),s=SIMD.Float32x4.add(SIMD.Float32x4.mul(i,o),s),u=SIMD.Float32x4.mul(r,o),o=SIMD.Float32x4.swizzle(o,2,3,0,1),s=SIMD.Float32x4.sub(s,SIMD.Float32x4.mul(i,o)),u=SIMD.Float32x4.sub(SIMD.Float32x4.mul(r,o),u),u=SIMD.Float32x4.swizzle(u,2,3,0,1),o=SIMD.Float32x4.mul(r,n),o=SIMD.Float32x4.swizzle(o,1,0,3,2),u=SIMD.Float32x4.add(SIMD.Float32x4.mul(a,o),u),c=SIMD.Float32x4.sub(SIMD.Float32x4.mul(i,o),c),o=SIMD.Float32x4.swizzle(o,2,3,0,1),u=SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,o),u),c=SIMD.Float32x4.sub(c,SIMD.Float32x4.mul(i,o)),o=SIMD.Float32x4.mul(r,a),o=SIMD.Float32x4.swizzle(o,1,0,3,2),l=SIMD.Float32x4.sub(l,SIMD.Float32x4.mul(i,o)),u=SIMD.Float32x4.add(SIMD.Float32x4.mul(n,o),u),o=SIMD.Float32x4.swizzle(o,2,3,0,1),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(i,o),l),u=SIMD.Float32x4.sub(u,SIMD.Float32x4.mul(n,o)),o=SIMD.Float32x4.mul(r,i),o=SIMD.Float32x4.swizzle(o,1,0,3,2),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(a,o),l),c=SIMD.Float32x4.sub(c,SIMD.Float32x4.mul(n,o)),o=SIMD.Float32x4.swizzle(o,2,3,0,1),l=SIMD.Float32x4.sub(l,SIMD.Float32x4.mul(a,o)),c=SIMD.Float32x4.add(SIMD.Float32x4.mul(n,o),c),SIMD.Float32x4.store(t,0,s),SIMD.Float32x4.store(t,4,l),SIMD.Float32x4.store(t,8,u),SIMD.Float32x4.store(t,12,c),t},i.adjoint=n.USE_SIMD?i.SIMD.adjoint:i.scalar.adjoint,i.determinant=function(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15];return(e*o-r*a)*(h*g-f*m)-(e*s-n*a)*(c*g-f*p)+(e*l-i*a)*(c*m-h*p)+(r*s-n*o)*(u*g-f*d)-(r*l-i*o)*(u*m-h*d)+(n*l-i*s)*(u*p-c*d)},i.SIMD.multiply=function(t,e,r){var n=SIMD.Float32x4.load(e,0),i=SIMD.Float32x4.load(e,4),a=SIMD.Float32x4.load(e,8),o=SIMD.Float32x4.load(e,12),s=SIMD.Float32x4.load(r,0),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,0,0,0,0),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,1,1,1,1),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,2,2,2,2),a),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,3,3,3,3),o))));SIMD.Float32x4.store(t,0,l);var u=SIMD.Float32x4.load(r,4),c=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,0,0,0,0),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,1,1,1,1),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,2,2,2,2),a),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,3,3,3,3),o))));SIMD.Float32x4.store(t,4,c);var h=SIMD.Float32x4.load(r,8),f=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,0,0,0,0),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,1,1,1,1),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,2,2,2,2),a),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,3,3,3,3),o))));SIMD.Float32x4.store(t,8,f);var d=SIMD.Float32x4.load(r,12),p=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,0,0,0,0),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,1,1,1,1),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,2,2,2,2),a),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,3,3,3,3),o))));return SIMD.Float32x4.store(t,12,p),t},i.scalar.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=e[9],d=e[10],p=e[11],m=e[12],g=e[13],v=e[14],y=e[15],b=r[0],x=r[1],_=r[2],w=r[3];return t[0]=b*n+x*s+_*h+w*m,t[1]=b*i+x*l+_*f+w*g,t[2]=b*a+x*u+_*d+w*v,t[3]=b*o+x*c+_*p+w*y,b=r[4],x=r[5],_=r[6],w=r[7],t[4]=b*n+x*s+_*h+w*m,t[5]=b*i+x*l+_*f+w*g,t[6]=b*a+x*u+_*d+w*v,t[7]=b*o+x*c+_*p+w*y,b=r[8],x=r[9],_=r[10],w=r[11],t[8]=b*n+x*s+_*h+w*m,t[9]=b*i+x*l+_*f+w*g,t[10]=b*a+x*u+_*d+w*v,t[11]=b*o+x*c+_*p+w*y,b=r[12],x=r[13],_=r[14],w=r[15],t[12]=b*n+x*s+_*h+w*m,t[13]=b*i+x*l+_*f+w*g,t[14]=b*a+x*u+_*d+w*v,t[15]=b*o+x*c+_*p+w*y,t},i.multiply=n.USE_SIMD?i.SIMD.multiply:i.scalar.multiply,i.mul=i.multiply,i.scalar.translate=function(t,e,r){var n,i,a,o,s,l,u,c,h,f,d,p,m=r[0],g=r[1],v=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*v+e[12],t[13]=e[1]*m+e[5]*g+e[9]*v+e[13],t[14]=e[2]*m+e[6]*g+e[10]*v+e[14],t[15]=e[3]*m+e[7]*g+e[11]*v+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=f,t[10]=d,t[11]=p,t[12]=n*m+s*g+h*v+e[12],t[13]=i*m+l*g+f*v+e[13],t[14]=a*m+u*g+d*v+e[14],t[15]=o*m+c*g+p*v+e[15]),t},i.SIMD.translate=function(t,e,r){var n=SIMD.Float32x4.load(e,0),i=SIMD.Float32x4.load(e,4),a=SIMD.Float32x4.load(e,8),o=SIMD.Float32x4.load(e,12),s=SIMD.Float32x4(r[0],r[1],r[2],0);e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11]),n=SIMD.Float32x4.mul(n,SIMD.Float32x4.swizzle(s,0,0,0,0)),i=SIMD.Float32x4.mul(i,SIMD.Float32x4.swizzle(s,1,1,1,1)),a=SIMD.Float32x4.mul(a,SIMD.Float32x4.swizzle(s,2,2,2,2));var l=SIMD.Float32x4.add(n,SIMD.Float32x4.add(i,SIMD.Float32x4.add(a,o)));return SIMD.Float32x4.store(t,12,l),t},i.translate=n.USE_SIMD?i.SIMD.translate:i.scalar.translate,i.scalar.scale=function(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},i.SIMD.scale=function(t,e,r){var n,i,a,o=SIMD.Float32x4(r[0],r[1],r[2],0);return n=SIMD.Float32x4.load(e,0),SIMD.Float32x4.store(t,0,SIMD.Float32x4.mul(n,SIMD.Float32x4.swizzle(o,0,0,0,0))),i=SIMD.Float32x4.load(e,4),SIMD.Float32x4.store(t,4,SIMD.Float32x4.mul(i,SIMD.Float32x4.swizzle(o,1,1,1,1))),a=SIMD.Float32x4.load(e,8),SIMD.Float32x4.store(t,8,SIMD.Float32x4.mul(a,SIMD.Float32x4.swizzle(o,2,2,2,2))),t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},i.scale=n.USE_SIMD?i.SIMD.scale:i.scalar.scale,i.rotate=function(t,e,r,i){var a,o,s,l,u,c,h,f,d,p,m,g,v,y,b,x,_,w,M,k,A,T,S,E,L=i[0],C=i[1],z=i[2],D=Math.sqrt(L*L+C*C+z*z);return Math.abs(D)<n.EPSILON?null:(D=1/D,L*=D,C*=D,z*=D,a=Math.sin(r),o=Math.cos(r),s=1-o,l=e[0],u=e[1],c=e[2],h=e[3],f=e[4],d=e[5],p=e[6],m=e[7],g=e[8],v=e[9],y=e[10],b=e[11],x=L*L*s+o,_=C*L*s+z*a,w=z*L*s-C*a,M=L*C*s-z*a,k=C*C*s+o,A=z*C*s+L*a,T=L*z*s+C*a,S=C*z*s-L*a,E=z*z*s+o,t[0]=l*x+f*_+g*w,t[1]=u*x+d*_+v*w,t[2]=c*x+p*_+y*w,t[3]=h*x+m*_+b*w,t[4]=l*M+f*k+g*A,t[5]=u*M+d*k+v*A,t[6]=c*M+p*k+y*A,t[7]=h*M+m*k+b*A,t[8]=l*T+f*S+g*E,t[9]=u*T+d*S+v*E,t[10]=c*T+p*S+y*E,t[11]=h*T+m*S+b*E,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},i.scalar.rotateX=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+u*n,t[5]=o*i+c*n,t[6]=s*i+h*n,t[7]=l*i+f*n,t[8]=u*i-a*n,t[9]=c*i-o*n,t[10]=h*i-s*n,t[11]=f*i-l*n,t},i.SIMD.rotateX=function(t,e,r){var n=SIMD.Float32x4.splat(Math.sin(r)),i=SIMD.Float32x4.splat(Math.cos(r));e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);var a=SIMD.Float32x4.load(e,4),o=SIMD.Float32x4.load(e,8);return SIMD.Float32x4.store(t,4,SIMD.Float32x4.add(SIMD.Float32x4.mul(a,i),SIMD.Float32x4.mul(o,n))),SIMD.Float32x4.store(t,8,SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,i),SIMD.Float32x4.mul(a,n))),t},i.rotateX=n.USE_SIMD?i.SIMD.rotateX:i.scalar.rotateX,i.scalar.rotateY=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i-u*n,t[1]=o*i-c*n,t[2]=s*i-h*n,t[3]=l*i-f*n,t[8]=a*n+u*i,t[9]=o*n+c*i,t[10]=s*n+h*i,t[11]=l*n+f*i,t},i.SIMD.rotateY=function(t,e,r){var n=SIMD.Float32x4.splat(Math.sin(r)),i=SIMD.Float32x4.splat(Math.cos(r));e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);var a=SIMD.Float32x4.load(e,0),o=SIMD.Float32x4.load(e,8);return SIMD.Float32x4.store(t,0,SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,i),SIMD.Float32x4.mul(o,n))),SIMD.Float32x4.store(t,8,SIMD.Float32x4.add(SIMD.Float32x4.mul(a,n),SIMD.Float32x4.mul(o,i))),t},i.rotateY=n.USE_SIMD?i.SIMD.rotateY:i.scalar.rotateY,i.scalar.rotateZ=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[4],c=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+u*n,t[1]=o*i+c*n,t[2]=s*i+h*n,t[3]=l*i+f*n,t[4]=u*i-a*n,t[5]=c*i-o*n,t[6]=h*i-s*n,t[7]=f*i-l*n,t},i.SIMD.rotateZ=function(t,e,r){var n=SIMD.Float32x4.splat(Math.sin(r)),i=SIMD.Float32x4.splat(Math.cos(r));e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);var a=SIMD.Float32x4.load(e,0),o=SIMD.Float32x4.load(e,4);return SIMD.Float32x4.store(t,0,SIMD.Float32x4.add(SIMD.Float32x4.mul(a,i),SIMD.Float32x4.mul(o,n))),SIMD.Float32x4.store(t,4,SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,i),SIMD.Float32x4.mul(a,n))),t},i.rotateZ=n.USE_SIMD?i.SIMD.rotateZ:i.scalar.rotateZ,i.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t},i.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.fromRotation=function(t,e,r){var i,a,o,s=r[0],l=r[1],u=r[2],c=Math.sqrt(s*s+l*l+u*u);return Math.abs(c)<n.EPSILON?null:(c=1/c,s*=c,l*=c,u*=c,i=Math.sin(e),a=Math.cos(e),o=1-a,t[0]=s*s*o+a,t[1]=l*s*o+u*i,t[2]=u*s*o-l*i,t[3]=0,t[4]=s*l*o-u*i,t[5]=l*l*o+a,t[6]=u*l*o+s*i,t[7]=0,t[8]=s*u*o+l*i,t[9]=l*u*o-s*i,t[10]=u*u*o+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},i.fromXRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.fromYRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.fromZRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.fromRotationTranslation=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=n+n,l=i+i,u=a+a,c=n*s,h=n*l,f=n*u,d=i*l,p=i*u,m=a*u,g=o*s,v=o*l,y=o*u;return t[0]=1-(d+m),t[1]=h+y,t[2]=f-v,t[3]=0,t[4]=h-y,t[5]=1-(c+m),t[6]=p+g,t[7]=0,t[8]=f+v,t[9]=p-g,t[10]=1-(c+d),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},i.getTranslation=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},i.getRotation=function(t,e){var r=e[0]+e[5]+e[10],n=0;return r>0?(n=2*Math.sqrt(r+1),t[3]=.25*n,t[0]=(e[6]-e[9])/n,t[1]=(e[8]-e[2])/n,t[2]=(e[1]-e[4])/n):e[0]>e[5]&e[0]>e[10]?(n=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/n,t[0]=.25*n,t[1]=(e[1]+e[4])/n,t[2]=(e[8]+e[2])/n):e[5]>e[10]?(n=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/n,t[0]=(e[1]+e[4])/n,t[1]=.25*n,t[2]=(e[6]+e[9])/n):(n=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/n,t[0]=(e[8]+e[2])/n,t[1]=(e[6]+e[9])/n,t[2]=.25*n),t},i.fromRotationTranslationScale=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3],l=i+i,u=a+a,c=o+o,h=i*l,f=i*u,d=i*c,p=a*u,m=a*c,g=o*c,v=s*l,y=s*u,b=s*c,x=n[0],_=n[1],w=n[2];return t[0]=(1-(p+g))*x,t[1]=(f+b)*x,t[2]=(d-y)*x,t[3]=0,t[4]=(f-b)*_,t[5]=(1-(h+g))*_,t[6]=(m+v)*_,t[7]=0,t[8]=(d+y)*w,t[9]=(m-v)*w,t[10]=(1-(h+p))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},i.fromRotationTranslationScaleOrigin=function(t,e,r,n,i){var a=e[0],o=e[1],s=e[2],l=e[3],u=a+a,c=o+o,h=s+s,f=a*u,d=a*c,p=a*h,m=o*c,g=o*h,v=s*h,y=l*u,b=l*c,x=l*h,_=n[0],w=n[1],M=n[2],k=i[0],A=i[1],T=i[2];return t[0]=(1-(m+v))*_,t[1]=(d+x)*_,t[2]=(p-b)*_,t[3]=0,t[4]=(d-x)*w,t[5]=(1-(f+v))*w,t[6]=(g+y)*w,t[7]=0,t[8]=(p+b)*M,t[9]=(g-y)*M,t[10]=(1-(f+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},i.fromQuat=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,u=r*o,c=n*o,h=n*s,f=i*o,d=i*s,p=i*l,m=a*o,g=a*s,v=a*l;return t[0]=1-h-p,t[1]=c+v,t[2]=f-g,t[3]=0,t[4]=c-v,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=f+g,t[9]=d-m,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.frustum=function(t,e,r,n,i,a,o){var s=1/(r-e),l=1/(i-n),u=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*l,t[10]=(o+a)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*u,t[15]=0,t},i.perspective=function(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t},i.perspectiveFromFieldOfView=function(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),u=2/(i+a);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(o-s)*l*.5,t[9]=(i-a)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t},i.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),u=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*u,t[15]=1,t},i.lookAt=function(t,e,r,a){var o,s,l,u,c,h,f,d,p,m,g=e[0],v=e[1],y=e[2],b=a[0],x=a[1],_=a[2],w=r[0],M=r[1],k=r[2];return Math.abs(g-w)<n.EPSILON&&Math.abs(v-M)<n.EPSILON&&Math.abs(y-k)<n.EPSILON?i.identity(t):(f=g-w,d=v-M,p=y-k,m=1/Math.sqrt(f*f+d*d+p*p),f*=m,d*=m,p*=m,o=x*p-_*d,s=_*f-b*p,l=b*d-x*f,m=Math.sqrt(o*o+s*s+l*l),m?(o*=m=1/m,s*=m,l*=m):(o=0,s=0,l=0),u=d*l-p*s,c=p*o-f*l,h=f*s-d*o,m=Math.sqrt(u*u+c*c+h*h),m?(u*=m=1/m,c*=m,h*=m):(u=0,c=0,h=0),t[0]=o,t[1]=u,t[2]=f,t[3]=0,t[4]=s,t[5]=c,t[6]=d,t[7]=0,t[8]=l,t[9]=h,t[10]=p,t[11]=0,t[12]=-(o*g+s*v+l*y),t[13]=-(u*g+c*v+h*y),t[14]=-(f*g+d*v+p*y),t[15]=1,t)},i.str=function(t){return\"mat4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\", \"+t[9]+\", \"+t[10]+\", \"+t[11]+\", \"+t[12]+\", \"+t[13]+\", \"+t[14]+\", \"+t[15]+\")\"},i.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t},i.sub=i.subtract,i.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t},i.multiplyScalarAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],f=t[9],d=t[10],p=t[11],m=t[12],g=t[13],v=t[14],y=t[15],b=e[0],x=e[1],_=e[2],w=e[3],M=e[4],k=e[5],A=e[6],T=e[7],S=e[8],E=e[9],L=e[10],C=e[11],z=e[12],D=e[13],I=e[14],P=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(u-A)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(A))&&Math.abs(c-T)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(h-S)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(f-E)<=n.EPSILON*Math.max(1,Math.abs(f),Math.abs(E))&&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-z)<=n.EPSILON*Math.max(1,Math.abs(m),Math.abs(z))&&Math.abs(g-D)<=n.EPSILON*Math.max(1,Math.abs(g),Math.abs(D))&&Math.abs(v-I)<=n.EPSILON*Math.max(1,Math.abs(v),Math.abs(I))&&Math.abs(y-P)<=n.EPSILON*Math.max(1,Math.abs(y),Math.abs(P))},e.exports=i},{\"./common.js\":178}],183:[function(t,e,r){var n=t(\"./common.js\"),i=t(\"./mat3.js\"),a=t(\"./vec3.js\"),o=t(\"./vec4.js\"),s={};s.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},s.rotationTo=function(){var t=a.create(),e=a.fromValues(1,0,0),r=a.fromValues(0,1,0);return function(n,i,o){var l=a.dot(i,o);return l<-.999999?(a.cross(t,e,i),a.length(t)<1e-6&&a.cross(t,r,i),a.normalize(t,t),s.setAxisAngle(n,t,Math.PI),n):l>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(a.cross(t,i,o),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+l,s.normalize(n,n))}}(),s.setAxes=function(){var t=i.create();return function(e,r,n,i){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],s.normalize(e,s.fromMat3(e,t))}}(),s.clone=o.clone,s.fromValues=o.fromValues,s.copy=o.copy,s.set=o.set,s.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},s.setAxisAngle=function(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t},s.getAxisAngle=function(t,e){var r=2*Math.acos(e[3]),n=Math.sin(r/2);return 0!=n?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r},s.add=o.add,s.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1],u=r[2],c=r[3];return t[0]=n*c+o*s+i*u-a*l,t[1]=i*c+o*l+a*s-n*u,t[2]=a*c+o*u+n*l-i*s,t[3]=o*c-n*s-i*l-a*u,t},s.mul=s.multiply,s.scale=o.scale,s.rotateX=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+o*s,t[1]=i*l+a*s,t[2]=a*l-i*s,t[3]=o*l-n*s,t},s.rotateY=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l-a*s,t[1]=i*l+o*s,t[2]=a*l+n*s,t[3]=o*l-i*s,t},s.rotateZ=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+i*s,t[1]=i*l-n*s,t[2]=a*l+o*s,t[3]=o*l-a*s,t},s.calculateW=function(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t},s.dot=o.dot,s.lerp=o.lerp,s.slerp=function(t,e,r,n){var i,a,o,s,l,u=e[0],c=e[1],h=e[2],f=e[3],d=r[0],p=r[1],m=r[2],g=r[3];return(a=u*d+c*p+h*m+f*g)<0&&(a=-a,d=-d,p=-p,m=-m,g=-g),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*u+l*d,t[1]=s*c+l*p,t[2]=s*h+l*m,t[3]=s*f+l*g,t},s.sqlerp=function(){var t=s.create(),e=s.create();return function(r,n,i,a,o,l){return s.slerp(t,n,o,l),s.slerp(e,i,a,l),s.slerp(r,t,e,2*l*(1-l)),r}}(),s.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;return t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=a*s,t},s.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},s.length=o.length,s.len=s.length,s.squaredLength=o.squaredLength,s.sqrLen=s.squaredLength,s.normalize=o.normalize,s.fromMat3=function(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*a+a]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*a+o]-e[3*o+a])*r,t[a]=(e[3*a+i]+e[3*i+a])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t},s.str=function(t){return\"quat(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"},s.exactEquals=o.exactEquals,s.equals=o.equals,e.exports=s},{\"./common.js\":178,\"./mat3.js\":181,\"./vec3.js\":185,\"./vec4.js\":186}],184:[function(t,e,r){var n=t(\"./common.js\"),i={};i.create=function(){var t=new n.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},i.fromValues=function(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},i.set=function(t,e,r){return t[0]=e,t[1]=r,t},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t},i.sub=i.subtract,i.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t},i.mul=i.multiply,i.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},i.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t},i.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},i.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t},i.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t},i.distance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(r*r+n*n)},i.dist=i.distance,i.squaredDistance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],r=t[1];return Math.sqrt(e*e+r*r)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1];return e*e+r*r},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},i.cross=function(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t},i.lerp=function(t,e,r,n){var i=e[0],a=e[1];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t},i.transformMat2=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t},i.transformMat2d=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t},i.transformMat3=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=2),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s<l;s+=r)t[0]=e[s],t[1]=e[s+1],a(t,t,o),e[s]=t[0],e[s+1]=t[1];return e}}(),i.str=function(t){return\"vec2(\"+t[0]+\", \"+t[1]+\")\"},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},i.equals=function(t,e){var r=t[0],i=t[1],a=e[0],o=e[1];return Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-o)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))},e.exports=i},{\"./common.js\":178}],185:[function(t,e,r){var n=t(\"./common.js\"),i={};i.create=function(){var t=new n.ARRAY_TYPE(3);return t[0]=0,t[1]=0,t[2]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},i.fromValues=function(t,e,r){var i=new n.ARRAY_TYPE(3);return i[0]=t,i[1]=e,i[2]=r,i},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},i.set=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t},i.sub=i.subtract,i.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t},i.mul=i.multiply,i.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t},i.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t},i.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t},i.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t},i.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t},i.distance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(r*r+n*n+i*i)},i.dist=i.distance,i.squaredDistance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},i.cross=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t},i.lerp=function(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t},i.hermite=function(t,e,r,n,i,a){var o=a*a,s=o*(2*a-3)+1,l=o*(a-2)+a,u=o*(a-1),c=o*(3-2*a);return t[0]=e[0]*s+r[0]*l+n[0]*u+i[0]*c,t[1]=e[1]*s+r[1]*l+n[1]*u+i[1]*c,t[2]=e[2]*s+r[2]*l+n[2]*u+i[2]*c,t},i.bezier=function(t,e,r,n,i,a){var o=1-a,s=o*o,l=a*a,u=s*o,c=3*a*s,h=3*l*o,f=l*a;return t[0]=e[0]*u+r[0]*c+n[0]*h+i[0]*f,t[1]=e[1]*u+r[1]*c+n[1]*h+i[1]*f,t[2]=e[2]*u+r[2]*c+n[2]*h+i[2]*f,t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI,i=2*n.RANDOM()-1,a=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*a,t[1]=Math.sin(r)*a,t[2]=i*e,t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,t},i.transformMat3=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,h=u*i+l*n-o*a,f=u*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=c*u+d*-o+h*-l-f*-s,t[1]=h*u+d*-s+f*-o-c*-l,t[2]=f*u+d*-l+c*-s-h*-o,t},i.rotateX=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateY=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateZ=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=3),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s<l;s+=r)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],a(t,t,o),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2];return e}}(),i.angle=function(t,e){var r=i.fromValues(t[0],t[1],t[2]),n=i.fromValues(e[0],e[1],e[2]);i.normalize(r,r),i.normalize(n,n);var a=i.dot(r,n);return a>1?0:Math.acos(a)},i.str=function(t){return\"vec3(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\")\"},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=e[0],s=e[1],l=e[2];return Math.abs(r-o)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(l))},e.exports=i},{\"./common.js\":178}],186:[function(t,e,r){var n=t(\"./common.js\"),i={};i.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},i.fromValues=function(t,e,r,i){var a=new n.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},i.set=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t},i.sub=i.subtract,i.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t},i.mul=i.multiply,i.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},i.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t},i.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},i.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},i.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t},i.distance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(r*r+n*n+i*i+a*a)},i.dist=i.distance,i.squaredDistance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return r*r+n*n+i*i+a*a},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},i.lerp=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t},i.random=function(t,e){return e=e||1,t[0]=n.RANDOM(),t[1]=n.RANDOM(),t[2]=n.RANDOM(),t[3]=n.RANDOM(),i.normalize(t,t),i.scale(t,t,e),t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,h=u*i+l*n-o*a,f=u*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=c*u+d*-o+h*-l-f*-s,t[1]=h*u+d*-s+f*-o-c*-l,t[2]=f*u+d*-l+c*-s-h*-o,t[3]=e[3],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=4),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s<l;s+=r)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],t[3]=e[s+3],a(t,t,o),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2],e[s+3]=t[3];return e}}(),i.str=function(t){return\"vec4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=e[0],l=e[1],u=e[2],c=e[3];return Math.abs(r-s)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-l)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-u)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(u))&&Math.abs(o-c)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))},e.exports=i},{\"./common.js\":178}],187:[function(t,e,r){\"use strict\";function n(t,e){for(var r=[0,0,0,0],n=0;n<4;++n)for(var i=0;i<4;++i)r[i]+=t[4*n+i]*e[n];return r}function i(t,e,r,i,a){for(var o=n(i,n(r,n(e,[t[0],t[1],t[2],1]))),s=0;s<3;++s)o[s]/=o[3];return[.5*a[0]*(1+o[0]),.5*a[1]*(1-o[1])]}function a(t,e){if(2===t.length){for(var r=0,n=0,i=0;i<2;++i)r+=Math.pow(e[i]-t[0][i],2),n+=Math.pow(e[i]-t[1][i],2);return r=Math.sqrt(r),n=Math.sqrt(n),r+n<1e-6?[1,0]:[n/(r+n),r/(n+r)]}if(3===t.length){var a=[0,0];return u(t[0],t[1],t[2],e,a),l(t,a)}return[]}function o(t,e){for(var r=[0,0,0],n=0;n<t.length;++n)for(var i=t[n],a=e[n],o=0;o<3;++o)r[o]+=a*i[o];return r}function s(t,e,r,n,s,l){if(1===t.length)return[0,t[0].slice()];for(var u=new Array(t.length),c=0;c<t.length;++c)u[c]=i(t[c],r,n,s,l);for(var h=0,f=1/0,c=0;c<u.length;++c){for(var d=0,p=0;p<2;++p)d+=Math.pow(u[c][p]-e[p],2);d<f&&(f=d,h=c)}for(var m=a(u,e),g=0,c=0;c<3;++c){if(m[c]<-.001||m[c]>1.0001)return null;g+=m[c]}return Math.abs(g-1)>.001?null:[h,o(t,m),m]}var l=t(\"barycentric\"),u=t(\"polytope-closest-point/lib/closest_point_2d.js\");e.exports=s},{barycentric:42,\"polytope-closest-point/lib/closest_point_2d.js\":467}],188:[function(t,e,r){var 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}\";r.meshShader={vertex:\"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}\",fragment:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nfloat beckmannDistribution_2_0(float x, float roughness) {\\n  float NdotH = max(x, 0.0001);\\n  float cos2Alpha = NdotH * NdotH;\\n  float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\\n  float roughness2 = roughness * roughness;\\n  float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\\n  return exp(tan2Alpha / roughness2) / denom;\\n}\\n\\n\\n\\nfloat cookTorranceSpecular_1_1(\\n  vec3 lightDirection,\\n  vec3 viewDirection,\\n  vec3 surfaceNormal,\\n  float roughness,\\n  float fresnel) {\\n\\n  float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\\n  float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\\n\\n  //Half angle vector\\n  vec3 H = normalize(lightDirection + viewDirection);\\n\\n  //Geometric term\\n  float NdotH = max(dot(surfaceNormal, H), 0.0);\\n  float VdotH = max(dot(viewDirection, H), 0.000001);\\n  float LdotH = max(dot(lightDirection, H), 0.000001);\\n  float G1 = (2.0 * NdotH * VdotN) / VdotH;\\n  float G2 = (2.0 * NdotH * LdotN) / LdotH;\\n  float G = min(1.0, min(G1, G2));\\n  \\n  //Distribution term\\n  float D = beckmannDistribution_2_0(NdotH, roughness);\\n\\n  //Fresnel term\\n  float F = pow(1.0 - VdotN, fresnel);\\n\\n  //Multiply terms and done\\n  return  G * F * D / max(3.14159265 * VdotN, 0.000001);\\n}\\n\\n\\n\\nuniform vec3 clipBounds[2];\\nuniform float roughness\\n            , fresnel\\n            , kambient\\n            , kdiffuse\\n            , kspecular\\n            , opacity;\\nuniform sampler2D texture;\\n\\nvarying vec3 f_normal\\n           , f_lightDirection\\n           , f_eyeDirection\\n           , f_data;\\nvarying vec4 f_color;\\nvarying vec2 f_uv;\\n\\nvoid main() {\\n  if(any(lessThan(f_data, clipBounds[0])) || \\n     any(greaterThan(f_data, clipBounds[1]))) {\\n    discard;\\n  }\\n\\n  vec3 N = normalize(f_normal);\\n  vec3 L = normalize(f_lightDirection);\\n  vec3 V = normalize(f_eyeDirection);\\n  \\n  if(!gl_FrontFacing) {\\n    N = -N;\\n  }\\n\\n  float specular = cookTorranceSpecular_1_1(L, V, N, roughness, fresnel);\\n  float diffuse  = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\\n\\n  vec4 surfaceColor = f_color * texture2D(texture, f_uv);\\n  vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular,  1.0);\\n\\n  gl_FragColor = litColor * opacity;\\n}\",attributes:[{name:\"position\",type:\"vec3\"},{name:\"normal\",type:\"vec3\"},{name:\"color\",type:\"vec4\"},{name:\"uv\",type:\"vec2\"}]},r.wireShader={vertex:\"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}\",fragment:\"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}\",attributes:[{name:\"position\",type:\"vec3\"},{name:\"color\",type:\"vec4\"},{name:\"uv\",type:\"vec2\"}]},r.pointShader={vertex:\"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}\",fragment:\"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}\",attributes:[{name:\"position\",type:\"vec3\"},{name:\"color\",type:\"vec4\"},{name:\"uv\",type:\"vec2\"},{name:\"pointSize\",type:\"float\"}]},r.pickShader={vertex:\"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}\",fragment:n,attributes:[{name:\"position\",type:\"vec3\"},{name:\"id\",type:\"vec4\"}]},r.pointPickShader={vertex:\"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}\",fragment:n,attributes:[{name:\"position\",type:\"vec3\"},{name:\"pointSize\",type:\"float\"},{name:\"id\",type:\"vec4\"}]},r.contourShader={vertex:\"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}\",fragment:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec3 contourColor;\\n\\nvoid main() {\\n  gl_FragColor = vec4(contourColor,1);\\n}\\n\",attributes:[{name:\"position\",type:\"vec3\"}]}},{}],189:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o,s,l,u,c,h,f,d,p,m,g,v,y,b,x,_,w,M,k,A,T){this.gl=t,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=c,this.triangleNormals=f,this.triangleUVs=h,this.triangleIds=u,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=g,this.edgeUVs=v,this.edgeIds=m,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=b,this.pointColors=_,this.pointUVs=w,this.pointSizes=M,this.pointIds=x,this.pointVAO=k,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=A,this.contourVAO=T,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this._model=I,this._view=I,this._projection=I,this._resolution=[1,1]}function i(t){for(var e=w({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 _(r,[256,256,4],[4,0,1])}function a(t,e,r){for(var n=new Array(e),i=0;i<e;++i)n[i]=0;for(var a=t.length,i=0;i<a;++i)for(var o=t[i],s=0;s<o.length;++s)n[o[s]]=r[i];return n}function o(t){for(var e=t.length,r=new Array(e),n=0;n<e;++n)r[n]=t[n][2];return r}function s(t){var e=p(t,S);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.normal.location=4,e}function l(t){var e=p(t,E);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e}function u(t){var e=p(t,L);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}function c(t){var e=p(t,C);return e.attributes.position.location=0,e.attributes.id.location=1,e}function h(t){var e=p(t,z);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function f(t){var e=p(t,D);return e.attributes.position.location=0,e}function d(t){var e=t.gl,r=s(e),i=l(e),a=u(e),o=c(e),d=h(e),p=f(e),y=v(e,_(new Uint8Array([255,255,255,255]),[1,1,4]));y.generateMipmap(),y.minFilter=e.LINEAR_MIPMAP_LINEAR,y.magFilter=e.LINEAR;var b=m(e),x=m(e),w=m(e),M=m(e),k=m(e),A=g(e,[{buffer:b,type:e.FLOAT,size:3},{buffer:k,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:x,type:e.FLOAT,size:4},{buffer:w,type:e.FLOAT,size:2},{buffer:M,type:e.FLOAT,size:3}]),T=m(e),S=m(e),E=m(e),L=m(e),C=g(e,[{buffer:T,type:e.FLOAT,size:3},{buffer:L,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:S,type:e.FLOAT,size:4},{buffer:E,type:e.FLOAT,size:2}]),z=m(e),D=m(e),I=m(e),P=m(e),O=m(e),j=g(e,[{buffer:z,type:e.FLOAT,size:3},{buffer:O,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:D,type:e.FLOAT,size:4},{buffer:I,type:e.FLOAT,size:2},{buffer:P,type:e.FLOAT,size:1}]),R=m(e),F=new n(e,y,r,i,a,o,d,p,b,k,x,w,M,A,T,L,S,E,C,z,O,D,I,P,j,R,g(e,[{buffer:R,type:e.FLOAT,size:3}]));return F.update(t),F}var p=t(\"gl-shader\"),m=t(\"gl-buffer\"),g=t(\"gl-vao\"),v=t(\"gl-texture2d\"),y=t(\"normals\"),b=t(\"gl-mat4/multiply\"),x=t(\"gl-mat4/invert\"),_=t(\"ndarray\"),w=t(\"colormap\"),M=t(\"simplicial-complex-contour\"),k=t(\"typedarray-pool\"),A=t(\"./lib/shaders\"),T=t(\"./lib/closest-point\"),S=A.meshShader,E=A.wireShader,L=A.pointShader,C=A.pickShader,z=A.pointPickShader,D=A.contourShader,I=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],P=n.prototype;P.isOpaque=function(){return this.opacity>=1},P.isTransparent=function(){return this.opacity<1},P.pickSlots=1,P.setPickBase=function(t){this.pickId=t},P.highlight=function(t){if(t&&this.contourEnable){for(var e=M(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=k.mallocFloat32(6*a),s=0,l=0;l<a;++l)for(var u=r[l],c=0;c<2;++c){var h=u[0];2===u.length&&(h=u[c]);for(var f=n[h][0],d=n[h][1],p=i[h],m=1-p,g=this.positions[f],v=this.positions[d],y=0;y<3;++y)o[s++]=p*g[y]+m*v[y]}this.contourCount=s/3|0,this.contourPositions.update(o.subarray(0,s)),k.free(o)}else this.contourCount=0},P.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=v(e,t.texture)):t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(i(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions;if(n&&r){var s=[],l=[],u=[],c=[],h=[],f=[],d=[],p=[],m=[],g=[],b=[],x=[],_=[],w=[];this.cells=r,this.positions=n;var M=t.vertexNormals,k=t.cellNormals,A=void 0===t.vertexNormalsEpsilon?1e-6:t.vertexNormalsEpsilon,T=void 0===t.faceNormalsEpsilon?1e-6:t.faceNormalsEpsilon;t.useFacetNormals&&!k&&(k=y.faceNormals(r,n,T)),k||M||(M=y.vertexNormals(r,n,A));var S=t.vertexColors,E=t.cellColors,L=t.meshColor||[1,1,1,1],C=t.vertexUVs,z=t.vertexIntensity,D=t.cellUVs,I=t.cellIntensity,P=1/0,O=-1/0;if(!C&&!D)if(z)for(q=0;q<z.length;++q){j=z[q];P=Math.min(P,j),O=Math.max(O,j)}else if(I)for(q=0;q<I.length;++q){j=I[q];P=Math.min(P,j),O=Math.max(O,j)}else for(q=0;q<n.length;++q){var j=n[q][2];P=Math.min(P,j),O=Math.max(O,j)}this.intensity=z||(I?a(r,n.length,I):o(n));var R=t.pointSizes,F=t.pointSize||1;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(q=0;q<n.length;++q)for(var N=n[q],B=0;B<3;++B)!isNaN(N[B])&&isFinite(N[B])&&(this.bounds[0][B]=Math.min(this.bounds[0][B],N[B]),this.bounds[1][B]=Math.max(this.bounds[1][B],N[B]));var U=0,V=0,H=0;t:for(var q=0;q<r.length;++q){var G=r[q];switch(G.length){case 1:for(var N=n[W=G[0]],B=0;B<3;++B)if(isNaN(N[B])||!isFinite(N[B]))continue t;g.push(N[0],N[1],N[2]);3===(X=S?S[W]:E?E[q]:L).length?b.push(X[0],X[1],X[2],1):b.push(X[0],X[1],X[2],X[3]);Z=C?C[W]:z?[(z[W]-P)/(O-P),0]:D?D[q]:I?[(I[q]-P)/(O-P),0]:[(N[2]-P)/(O-P),0],x.push(Z[0],Z[1]),R?_.push(R[W]):_.push(F),w.push(q),H+=1;break;case 2:for(B=0;B<2;++B)for(var N=n[W=G[B]],Y=0;Y<3;++Y)if(isNaN(N[Y])||!isFinite(N[Y]))continue t;for(B=0;B<2;++B){N=n[W=G[B]];f.push(N[0],N[1],N[2]);3===(X=S?S[W]:E?E[q]:L).length?d.push(X[0],X[1],X[2],1):d.push(X[0],X[1],X[2],X[3]);Z=C?C[W]:z?[(z[W]-P)/(O-P),0]:D?D[q]:I?[(I[q]-P)/(O-P),0]:[(N[2]-P)/(O-P),0],p.push(Z[0],Z[1]),m.push(q)}V+=1;break;case 3:for(B=0;B<3;++B)for(var N=n[W=G[B]],Y=0;Y<3;++Y)if(isNaN(N[Y])||!isFinite(N[Y]))continue t;for(B=0;B<3;++B){var W=G[B],N=n[W];s.push(N[0],N[1],N[2]);var X;3===(X=S?S[W]:E?E[q]:L).length?l.push(X[0],X[1],X[2],1):l.push(X[0],X[1],X[2],X[3]);var Z;Z=C?C[W]:z?[(z[W]-P)/(O-P),0]:D?D[q]:I?[(I[q]-P)/(O-P),0]:[(N[2]-P)/(O-P),0],c.push(Z[0],Z[1]);var J;J=M?M[W]:k[q],u.push(J[0],J[1],J[2]),h.push(q)}U+=1}}this.pointCount=H,this.edgeCount=V,this.triangleCount=U,this.pointPositions.update(g),this.pointColors.update(b),this.pointUVs.update(x),this.pointSizes.update(_),this.pointIds.update(new Uint32Array(w)),this.edgePositions.update(f),this.edgeColors.update(d),this.edgeUVs.update(p),this.edgeIds.update(new Uint32Array(m)),this.trianglePositions.update(s),this.triangleColors.update(l),this.triangleUVs.update(c),this.triangleNormals.update(u),this.triangleIds.update(new Uint32Array(h))}},P.drawTransparent=P.draw=function(t){t=t||{};for(var e=this.gl,r=t.model||I,n=t.view||I,i=t.projection||I,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);var s={model:r,view:n,projection:i,clipBounds:a,kambient:this.ambientLight,kdiffuse:this.diffuseLight,kspecular:this.specularLight,roughness:this.roughness,fresnel:this.fresnel,eyePosition:[0,0,0],lightPosition:[0,0,0],opacity:this.opacity,contourColor:this.contourColor,texture:0};this.texture.bind(0);var l=new Array(16);b(l,s.view,s.model),b(l,s.projection,l),x(l,l);for(o=0;o<3;++o)s.eyePosition[o]=l[12+o]/l[15];for(var u=l[15],o=0;o<3;++o)u+=this.lightPosition[o]*l[4*o+3];for(o=0;o<3;++o){for(var c=l[12+o],h=0;h<3;++h)c+=l[4*h+o]*this.lightPosition[h];s.lightPosition[o]=c/u}if(this.triangleCount>0&&((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){var f=this.contourShader;f.bind(),f.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind()}},P.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||I,n=t.view||I,i=t.projection||I,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((l=this.pointPickShader).bind(),l.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},P.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=T(i,[t.coord[0],this._resolution[1]-t.coord[1]],this._model,this._view,this._projection,this._resolution);if(!o)return null;for(var s=o[2],l=0,a=0;a<r.length;++a)l+=s[a]*this.intensity[r[a]];return{position:o[1],index:r[o[0]],cell:r,cellId:e,intensity:l,dataCoordinate:this.positions[r[o[0]]]}},P.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.lineShader.dispose(),this.pointShader.dispose(),this.pickShader.dispose(),this.pointPickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose(),this.contourShader.dispose()},e.exports=d},{\"./lib/closest-point\":187,\"./lib/shaders\":188,colormap:92,\"gl-buffer\":141,\"gl-mat4/invert\":165,\"gl-mat4/multiply\":167,\"gl-shader\":239,\"gl-texture2d\":251,\"gl-vao\":255,ndarray:449,normals:451,\"simplicial-complex-contour\":498,\"typedarray-pool\":521}],190:[function(t,e,r){\"use strict\";function n(t,e,r){this.plot=t,this.vbo=e,this.shader=r}function i(t){var e=t.gl;return new n(t,a(e,[0,0,0,1,1,0,1,1]),o(e,s.boxVert,s.lineFrag))}e.exports=i;var a=t(\"gl-buffer\"),o=t(\"gl-shader\"),s=t(\"./shaders\"),l=n.prototype;l.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},l.drawBox=function(){var t=[0,0],e=[0,0];return function(r,n,i,a,o){var s=this.plot,l=this.shader,u=s.gl;t[0]=r,t[1]=n,e[0]=i,e[1]=a,l.uniforms.lo=t,l.uniforms.hi=e,l.uniforms.color=o,u.drawArrays(u.TRIANGLE_STRIP,0,4)}}(),l.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{\"./shaders\":193,\"gl-buffer\":141,\"gl-shader\":196}],191:[function(t,e,r){\"use strict\";function n(t,e,r,n){this.plot=t,this.vbo=e,this.shader=r,this.tickShader=n,this.ticks=[[],[]]}function i(t,e){return t-e}function a(t){var e=t.gl;return new n(t,o(e),s(e,u.gridVert,u.gridFrag),s(e,u.tickVert,u.gridFrag))}e.exports=a;var o=t(\"gl-buffer\"),s=t(\"gl-shader\"),l=t(\"binary-search-bounds\"),u=t(\"./shaders\"),c=n.prototype;c.draw=function(){var t=[0,0],e=[0,0],r=[0,0];return function(){for(var n=this.plot,i=this.vbo,a=this.shader,o=this.ticks,s=n.gl,l=n._tickBounds,u=n.dataBox,c=n.viewBox,h=n.gridLineWidth,f=n.gridLineColor,d=n.gridLineEnable,p=n.pixelRatio,m=0;m<2;++m){var g=l[m],v=l[m+2]-g,y=.5*(u[m+2]+u[m]),b=u[m+2]-u[m];e[m]=2*v/b,t[m]=2*(g-y)/b}a.bind(),i.bind(),a.attributes.dataCoord.pointer(),a.uniforms.dataShift=t,a.uniforms.dataScale=e;for(var x=0,m=0;m<2;++m){r[0]=r[1]=0,r[m]=1,a.uniforms.dataAxis=r,a.uniforms.lineWidth=h[m]/(c[m+2]-c[m])*p,a.uniforms.color=f[m];var _=6*o[m].length;d[m]&&_&&s.drawArrays(s.TRIANGLES,x,_),x+=_}}}(),c.drawTickMarks=function(){var t=[0,0],e=[0,0],r=[1,0],n=[0,1],a=[0,0],o=[0,0];return function(){for(var s=this.plot,u=this.vbo,c=this.tickShader,h=this.ticks,f=s.gl,d=s._tickBounds,p=s.dataBox,m=s.viewBox,g=s.pixelRatio,v=s.screenBox,y=v[2]-v[0],b=v[3]-v[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,c.bind(),u.bind(),c.attributes.dataCoord.pointer();var S=c.uniforms;S.dataShift=t,S.dataScale=e;var E=s.tickMarkLength,L=s.tickMarkWidth,C=s.tickMarkColor,z=6*h[0].length,D=Math.min(l.ge(h[0],(p[0]-d[0])/(d[2]-d[0]),i),h[0].length),I=Math.min(l.gt(h[0],(p[2]-d[0])/(d[2]-d[0]),i),h[0].length),P=0+6*D,O=6*Math.max(0,I-D),j=Math.min(l.ge(h[1],(p[1]-d[1])/(d[3]-d[1]),i),h[1].length),R=Math.min(l.gt(h[1],(p[3]-d[1])/(d[3]-d[1]),i),h[1].length),F=z+6*j,N=6*Math.max(0,R-j);a[0]=2*(m[0]-E[1])/y-1,a[1]=(m[3]+m[1])/b-1,o[0]=E[1]*g/y,o[1]=L[1]*g/b,N&&(S.color=C[1],S.tickScale=o,S.dataAxis=n,S.screenOffset=a,f.drawArrays(f.TRIANGLES,F,N)),a[0]=(m[2]+m[0])/y-1,a[1]=2*(m[1]-E[0])/b-1,o[0]=L[0]*g/y,o[1]=E[0]*g/b,O&&(S.color=C[0],S.tickScale=o,S.dataAxis=r,S.screenOffset=a,f.drawArrays(f.TRIANGLES,P,O)),a[0]=2*(m[2]+E[3])/y-1,a[1]=(m[3]+m[1])/b-1,o[0]=E[3]*g/y,o[1]=L[3]*g/b,N&&(S.color=C[3],S.tickScale=o,S.dataAxis=n,S.screenOffset=a,f.drawArrays(f.TRIANGLES,F,N)),a[0]=(m[2]+m[0])/y-1,a[1]=2*(m[3]+E[2])/b-1,o[0]=L[2]*g/y,o[1]=E[2]*g/b,O&&(S.color=C[2],S.tickScale=o,S.dataAxis=r,S.screenOffset=a,f.drawArrays(f.TRIANGLES,P,O))}}(),c.update=function(){var t=[1,1,-1,-1,1,-1],e=[1,-1,1,1,-1,-1];return function(r){for(var n=r.ticks,i=r.bounds,a=new Float32Array(18*(n[0].length+n[1].length)),o=(this.plot.zeroLineEnable,0),s=[[],[]],l=0;l<2;++l)for(var u=s[l],c=n[l],h=i[l],f=i[l+2],d=0;d<c.length;++d){var p=(c[d].x-h)/(f-h);u.push(p);for(var m=0;m<6;++m)a[o++]=p,a[o++]=t[m],a[o++]=e[m]}this.ticks=s,this.vbo.update(a)}}(),c.dispose=function(){this.vbo.dispose(),this.shader.dispose(),this.tickShader.dispose()}},{\"./shaders\":193,\"binary-search-bounds\":195,\"gl-buffer\":141,\"gl-shader\":196}],192:[function(t,e,r){\"use strict\";function n(t,e,r){this.plot=t,this.vbo=e,this.shader=r}function i(t){var e=t.gl;return new n(t,a(e,[-1,-1,-1,1,1,-1,1,1]),o(e,s.lineVert,s.lineFrag))}e.exports=i;var a=t(\"gl-buffer\"),o=t(\"gl-shader\"),s=t(\"./shaders\"),l=n.prototype;l.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},l.drawLine=function(){var t=[0,0],e=[0,0];return function(r,n,i,a,o,s){var l=this.plot,u=this.shader,c=l.gl;t[0]=r,t[1]=n,e[0]=i,e[1]=a,u.uniforms.start=t,u.uniforms.end=e,u.uniforms.width=o*l.pixelRatio,u.uniforms.color=s,c.drawArrays(c.TRIANGLE_STRIP,0,4)}}(),l.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{\"./shaders\":193,\"gl-buffer\":141,\"gl-shader\":196}],193:[function(t,e,r){\"use strict\";var n=\"precision lowp float;\\n#define GLSLIFY 1\\nuniform vec4 color;\\nvoid main() {\\n  gl_FragColor = vec4(color.xyz * color.w, color.w);\\n}\\n\";e.exports={lineVert:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec2 coord;\\n\\nuniform vec4 screenBox;\\nuniform vec2 start, end;\\nuniform float width;\\n\\nvec2 perp(vec2 v) {\\n  return vec2(v.y, -v.x);\\n}\\n\\nvec2 screen(vec2 v) {\\n  return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\\n}\\n\\nvoid main() {\\n  vec2 delta = normalize(perp(start - end));\\n  vec2 offset = mix(start, end, 0.5 * (coord.y+1.0));\\n  gl_Position = vec4(screen(offset + 0.5 * width * delta * coord.x), 0, 1);\\n}\\n\",lineFrag:n,textVert:\"#define GLSLIFY 1\\nattribute vec3 textCoordinate;\\n\\nuniform vec2 dataScale, dataShift, dataAxis, screenOffset, textScale;\\nuniform float angle;\\n\\nvoid main() {\\n  float dataOffset  = textCoordinate.z;\\n  vec2 glyphOffset  = textCoordinate.xy;\\n  mat2 glyphMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\\n  vec2 screenCoordinate = dataAxis * (dataScale * dataOffset + dataShift) +\\n    glyphMatrix * glyphOffset * textScale + screenOffset;\\n  gl_Position = vec4(screenCoordinate, 0, 1);\\n}\\n\",textFrag:n,gridVert:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 dataCoord;\\n\\nuniform vec2 dataAxis, dataShift, dataScale;\\nuniform float lineWidth;\\n\\nvoid main() {\\n  vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\\n  pos += 10.0 * dataCoord.y * vec2(dataAxis.y, -dataAxis.x) + dataCoord.z * lineWidth;\\n  gl_Position = vec4(pos, 0, 1);\\n}\\n\",gridFrag:n,boxVert:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec2 coord;\\n\\nuniform vec4 screenBox;\\nuniform vec2 lo, hi;\\n\\nvec2 screen(vec2 v) {\\n  return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\\n}\\n\\nvoid main() {\\n  gl_Position = vec4(screen(mix(lo, hi, coord)), 0, 1);\\n}\\n\",tickVert:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 dataCoord;\\n\\nuniform vec2 dataAxis, dataShift, dataScale, screenOffset, tickScale;\\n\\nvoid main() {\\n  vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\\n  gl_Position = vec4(pos + tickScale*dataCoord.yz + screenOffset, 0, 1);\\n}\\n\"}},{}],194:[function(t,e,r){\"use strict\";function n(t,e,r){this.plot=t,this.vbo=e,this.shader=r,this.tickOffset=[[],[]],this.tickX=[[],[]],this.labelOffset=[0,0],this.labelCount=[0,0]}function i(t){var e=t.gl;return new n(t,a(e),o(e,u.textVert,u.textFrag))}e.exports=i;var a=t(\"gl-buffer\"),o=t(\"gl-shader\"),s=t(\"text-cache\"),l=t(\"binary-search-bounds\"),u=t(\"./shaders\"),c=n.prototype;c.drawTicks=function(){var t=[0,0],e=[0,0],r=[0,0];return function(n){var i=this.plot,a=this.shader,o=this.tickX[n],s=this.tickOffset[n],u=i.gl,c=i.viewBox,h=i.dataBox,f=i.screenBox,d=i.pixelRatio,p=i.tickEnable,m=i.tickPad,g=i.tickColor,v=i.tickAngle,y=i.labelEnable,b=i.labelPad,x=i.labelColor,_=i.labelAngle,w=this.labelOffset[n],M=this.labelCount[n],k=l.lt(o,h[n]),A=l.le(o,h[n+2]);t[0]=t[1]=0,t[n]=1,e[n]=(c[2+n]+c[n])/(f[2+n]-f[n])-1;var T=2/f[2+(1^n)]-f[1^n];e[1^n]=T*c[1^n]-1,p[n]&&(e[1^n]-=T*d*m[n],k<A&&s[A]>s[k]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=g[n],a.uniforms.angle=v[n],u.drawArrays(u.TRIANGLES,s[k],s[A]-s[k]))),y[n]&&M&&(e[1^n]-=T*d*b[n],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=x[n],a.uniforms.angle=_[n],u.drawArrays(u.TRIANGLES,w,M)),e[1^n]=T*c[2+(1^n)]-1,p[n+2]&&(e[1^n]+=T*d*m[n+2],k<A&&s[A]>s[k]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=g[n+2],a.uniforms.angle=v[n+2],u.drawArrays(u.TRIANGLES,s[k],s[A]-s[k]))),y[n+2]&&M&&(e[1^n]+=T*d*b[n+2],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=x[n+2],a.uniforms.angle=_[n+2],u.drawArrays(u.TRIANGLES,w,M))}}(),c.drawTitle=function(){var t=[0,0],e=[0,0];return function(){var r=this.plot,n=this.shader,i=r.gl,a=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,u=r.pixelRatio;if(this.titleCount){for(var c=0;c<2;++c)e[c]=2*(o[c]*u-a[c])/(a[2+c]-a[c])-1;n.bind(),n.uniforms.dataAxis=t,n.uniforms.screenOffset=e,n.uniforms.angle=s,n.uniforms.color=l,i.drawArrays(i.TRIANGLES,this.titleOffset,this.titleCount)}}}(),c.bind=function(){var t=[0,0],e=[0,0],r=[0,0];return function(){var n=this.plot,i=this.shader,a=n._tickBounds,o=n.dataBox,s=n.screenBox,l=n.viewBox;i.bind();for(var u=0;u<2;++u){var c=a[u],h=a[u+2]-c,f=.5*(o[u+2]+o[u]),d=o[u+2]-o[u],p=l[u],m=l[u+2]-p,g=s[u],v=s[u+2]-g;e[u]=2*h/d*m/v,t[u]=2*(c-f)/d*m/v}r[1]=2*n.pixelRatio/(s[3]-s[1]),r[0]=r[1]*(s[3]-s[1])/(s[2]-s[0]),i.uniforms.dataScale=e,i.uniforms.dataShift=t,i.uniforms.textScale=r,this.vbo.bind(),i.attributes.textCoordinate.pointer()}}(),c.update=function(t){var e,r,n,i,a,o=[],l=t.ticks,u=t.bounds;for(a=0;a<2;++a){var c=[Math.floor(o.length/3)],h=[-1/0],f=l[a];for(e=0;e<f.length;++e){var d=f[e],p=d.x,m=d.text,g=d.font||\"sans-serif\";i=d.fontSize||12;for(var v=1/(u[a+2]-u[a]),y=u[a],b=m.split(\"\\n\"),x=0;x<b.length;x++)for(n=s(g,b[x]).data,r=0;r<n.length;r+=2)o.push(n[r]*i,-n[r+1]*i-x*i*1.2,(p-y)*v);c.push(Math.floor(o.length/3)),h.push(p)}this.tickOffset[a]=c,this.tickX[a]=h}for(a=0;a<2;++a){for(this.labelOffset[a]=Math.floor(o.length/3),n=s(t.labelFont[a],t.labels[a],{textAlign:\"center\"}).data,i=t.labelSize[a],e=0;e<n.length;e+=2)o.push(n[e]*i,-n[e+1]*i,0);this.labelCount[a]=Math.floor(o.length/3)-this.labelOffset[a]}for(this.titleOffset=Math.floor(o.length/3),n=s(t.titleFont,t.title).data,i=t.titleSize,e=0;e<n.length;e+=2)o.push(n[e]*i,-n[e+1]*i,0);this.titleCount=Math.floor(o.length/3)-this.titleOffset,this.vbo.update(o)},c.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{\"./shaders\":193,\"binary-search-bounds\":195,\"gl-buffer\":141,\"gl-shader\":196,\"text-cache\":512}],195:[function(t,e,r){arguments[4][77][0].apply(r,arguments)},{dup:77}],196:[function(t,e,r){\"use strict\";function n(t){this.gl=t,this.gl.lastAttribCount=0,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}function i(t,e){return t.name<e.name?-1:1}function a(t,e,r,i,a){var o=new n(t);return o.update(e,r,i,a),o}var o=t(\"./lib/create-uniforms\"),s=t(\"./lib/create-attributes\"),l=t(\"./lib/reflect\"),u=t(\"./lib/shader-cache\"),c=t(\"./lib/runtime-reflect\"),h=t(\"./lib/GLError\"),f=n.prototype;f.bind=function(){this.program||this._relink();var t,e=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES),r=this.gl.lastAttribCount;if(e>r)for(t=r;t<e;t++)this.gl.enableVertexAttribArray(t);else if(r>e)for(t=e;t<r;t++)this.gl.disableVertexAttribArray(t);this.gl.lastAttribCount=e,this.gl.useProgram(this.program)},f.dispose=function(){for(var t=this.gl.lastAttribCount,e=0;e<t;e++)this.gl.disableVertexAttribArray(e);this.gl.lastAttribCount=0,this._fref&&this._fref.dispose(),this._vref&&this._vref.dispose(),this.attributes=this.types=this.vertShader=this.fragShader=this.program=this._relink=this._fref=this._vref=null},f.update=function(t,e,r,n){function a(){d.program=u.program(p,d._vref,d._fref,_,w);for(var t=0;t<r.length;++t)E[t]=p.getUniformLocation(d.program,r[t].name)}if(!e||1===arguments.length){var f=t;t=f.vertex,e=f.fragment,r=f.uniforms,n=f.attributes}var d=this,p=d.gl,m=d._vref;d._vref=u.shader(p,p.VERTEX_SHADER,t),m&&m.dispose(),d.vertShader=d._vref.shader;var g=this._fref;if(d._fref=u.shader(p,p.FRAGMENT_SHADER,e),g&&g.dispose(),d.fragShader=d._fref.shader,!r||!n){var v=p.createProgram();if(p.attachShader(v,d.fragShader),p.attachShader(v,d.vertShader),p.linkProgram(v),!p.getProgramParameter(v,p.LINK_STATUS)){var y=p.getProgramInfoLog(v);throw new h(y,\"Error linking program:\"+y)}r=r||c.uniforms(p,v),n=n||c.attributes(p,v),p.deleteProgram(v)}(n=n.slice()).sort(i);var b,x=[],_=[],w=[];for(b=0;b<n.length;++b){var M=n[b];if(M.type.indexOf(\"mat\")>=0){for(var k=0|M.type.charAt(M.type.length-1),A=new Array(k),T=0;T<k;++T)A[T]=w.length,_.push(M.name+\"[\"+T+\"]\"),\"number\"==typeof M.location?w.push(M.location+T):Array.isArray(M.location)&&M.location.length===k&&\"number\"==typeof M.location[T]?w.push(0|M.location[T]):w.push(-1);x.push({name:M.name,type:M.type,locations:A})}else x.push({name:M.name,type:M.type,locations:[w.length]}),_.push(M.name),\"number\"==typeof M.location?w.push(0|M.location):w.push(-1)}var S=0;for(b=0;b<w.length;++b)if(w[b]<0){for(;w.indexOf(S)>=0;)S+=1;w[b]=S}var E=new Array(r.length);a(),d._relink=a,d.types={uniforms:l(r),attributes:l(n)},d.attributes=s(p,d,x,w),Object.defineProperty(d,\"uniforms\",o(p,d,r,E))},e.exports=a},{\"./lib/GLError\":197,\"./lib/create-attributes\":198,\"./lib/create-uniforms\":199,\"./lib/reflect\":200,\"./lib/runtime-reflect\":201,\"./lib/shader-cache\":202}],197:[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},{}],198:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}function i(t,e,r,i,a,o,s){for(var l=[\"gl\",\"v\"],u=[],c=0;c<a;++c)l.push(\"x\"+c),u.push(\"x\"+c);l.push(\"if(x0.length===void 0){return gl.vertexAttrib\"+a+\"f(v,\"+u.join()+\")}else{return gl.vertexAttrib\"+a+\"fv(v,x0)}\");var h=Function.apply(null,l),f=new n(t,e,r,i,a,h);Object.defineProperty(o,s,{set:function(e){return t.disableVertexAttribArray(i[r]),h(t,i[r],e),e},get:function(){return f},enumerable:!0})}function a(t,e,r,n,a,o,s){for(var l=new Array(a),u=new Array(a),c=0;c<a;++c)i(t,e,r[c],n,a,l,c),u[c]=l[c];Object.defineProperty(l,\"location\",{set:function(t){if(Array.isArray(t))for(e=0;e<a;++e)u[e].location=t[e];else for(var e=0;e<a;++e)u[e].location=t+e;return t},get:function(){for(var t=new Array(a),e=0;e<a;++e)t[e]=n[r[e]];return t},enumerable:!0}),l.pointer=function(e,i,o,s){e=e||t.FLOAT,i=!!i,o=o||a*a,s=s||0;for(var l=0;l<a;++l){var u=n[r[l]];t.vertexAttribPointer(u,a,e,i,o,s+l*a),t.enableVertexAttribArray(u)}};var h=new Array(a),f=t[\"vertexAttrib\"+a+\"fv\"];Object.defineProperty(o,s,{set:function(e){for(var i=0;i<a;++i){var o=n[r[i]];if(t.disableVertexAttribArray(o),Array.isArray(e[0]))f.call(t,o,e[i]);else{for(var s=0;s<a;++s)h[s]=e[a*i+s];f.call(t,o,h)}}return e},get:function(){return l},enumerable:!0})}function o(t,e,r,n){for(var o={},l=0,u=r.length;l<u;++l){var c=r[l],h=c.name,f=c.type,d=c.locations;switch(f){case\"bool\":case\"int\":case\"float\":i(t,e,d[0],n,1,o,h);break;default:if(f.indexOf(\"vec\")>=0){if((p=f.charCodeAt(f.length-1)-48)<2||p>4)throw new s(\"\",\"Invalid data type for attribute \"+h+\": \"+f);i(t,e,d[0],n,p,o,h)}else{if(!(f.indexOf(\"mat\")>=0))throw new s(\"\",\"Unknown data type for attribute \"+h+\": \"+f);var p=f.charCodeAt(f.length-1)-48;if(p<2||p>4)throw new s(\"\",\"Invalid data type for attribute \"+h+\": \"+f);a(t,e,d,n,p,o,h)}}}return o}e.exports=o;var s=t(\"./GLError\"),l=n.prototype;l.pointer=function(t,e,r,n){var i=this,a=i._gl,o=i._locations[i._index];a.vertexAttribPointer(o,i._dimension,t||a.FLOAT,!!e,r||0,n||0),a.enableVertexAttribArray(o)},l.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(l,\"location\",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}})},{\"./GLError\":197}],199:[function(t,e,r){\"use strict\";function n(t){return new Function(\"y\",\"return function(){return y}\")(t)}function i(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=e;return r}function a(t,e,r,a){function l(r){return new Function(\"gl\",\"wrapper\",\"locations\",\"return function(){return gl.getUniform(wrapper.program,locations[\"+r+\"])}\")(t,e,a)}function u(t,e,r){switch(r){case\"bool\":case\"int\":case\"sampler2D\":case\"samplerCube\":return\"gl.uniform1i(locations[\"+e+\"],obj\"+t+\")\";case\"float\":return\"gl.uniform1f(locations[\"+e+\"],obj\"+t+\")\";default:var n=r.indexOf(\"vec\");if(!(0<=n&&n<=1&&r.length===4+n)){if(0===r.indexOf(\"mat\")&&4===r.length){var i=r.charCodeAt(r.length-1)-48;if(i<2||i>4)throw new s(\"\",\"Invalid uniform dimension type for matrix \"+name+\": \"+r);return\"gl.uniformMatrix\"+i+\"fv(locations[\"+e+\"],false,obj\"+t+\")\"}throw new s(\"\",\"Unknown uniform data type for \"+name+\": \"+r)}if((i=r.charCodeAt(r.length-1)-48)<2||i>4)throw new s(\"\",\"Invalid data type\");switch(r.charAt(0)){case\"b\":case\"i\":return\"gl.uniform\"+i+\"iv(locations[\"+e+\"],obj\"+t+\")\";case\"v\":return\"gl.uniform\"+i+\"fv(locations[\"+e+\"],obj\"+t+\")\";default:throw new s(\"\",\"Unrecognized data type for vector \"+name+\": \"+r)}}}function c(t,e){if(\"object\"!=typeof e)return[[t,e]];var r=[];for(var n in e){var i=e[n],a=t;parseInt(n)+\"\"===n?a+=\"[\"+n+\"]\":a+=\".\"+n,\"object\"==typeof i?r.push.apply(r,c(a,i)):r.push([a,i])}return r}function h(e){for(var n=[\"return function updateProperty(obj){\"],i=c(\"\",e),o=0;o<i.length;++o){var s=i[o],l=s[0],h=s[1];a[h]&&n.push(u(l,h,r[h].type))}return n.push(\"return obj}\"),new Function(\"gl\",\"locations\",n.join(\"\\n\"))(t,a)}function f(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){if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new s(\"\",\"Invalid data type\");return\"b\"===t.charAt(0)?i(r,!1):i(r,0)}if(0===t.indexOf(\"mat\")&&4===t.length){var r=t.charCodeAt(t.length-1)-48;if(r<2||r>4)throw new s(\"\",\"Invalid uniform dimension type for matrix \"+name+\": \"+t);return i(r*r,0)}throw new s(\"\",\"Unknown uniform data type for \"+name+\": \"+t)}}function d(t,e,i){if(\"object\"==typeof i){var o=p(i);Object.defineProperty(t,e,{get:n(o),set:h(i),enumerable:!0,configurable:!1})}else a[i]?Object.defineProperty(t,e,{get:l(i),set:h(i),enumerable:!0,configurable:!1}):t[e]=f(r[i].type)}function p(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r<t.length;++r)d(e,r,t[r])}else{e={};for(var n in t)d(e,n,t[n])}return e}var m=o(r,!0);return{get:n(p(m)),set:h(m),enumerable:!0,configurable:!0}}var o=t(\"./reflect\"),s=t(\"./GLError\");e.exports=a},{\"./GLError\":197,\"./reflect\":200}],200:[function(t,e,r){\"use strict\";function n(t,e){for(var r={},n=0;n<t.length;++n)for(var i=t[n].name.split(\".\"),a=r,o=0;o<i.length;++o){var s=i[o].split(\"[\");if(s.length>1){s[0]in a||(a[s[0]]=[]),a=a[s[0]];for(var l=1;l<s.length;++l){var u=parseInt(s[l]);l<s.length-1||o<i.length-1?(u in a||(l<s.length-1?a[u]=[]:a[u]={}),a=a[u]):a[u]=e?n:t[n].type}}else o<i.length-1?(s[0]in a||(a[s[0]]={}),a=a[s[0]]):a[s[0]]=e?n:t[n].type}return r}e.exports=n},{}],201:[function(t,e,r){\"use strict\";function n(t,e){if(!s){var r=Object.keys(o);s={};for(var n=0;n<r.length;++n){var i=r[n];s[t[i]]=o[i]}}return s[e]}function i(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),i=[],a=0;a<r;++a){var o=t.getActiveUniform(e,a);if(o){var s=n(t,o.type);if(o.size>1)for(var l=0;l<o.size;++l)i.push({name:o.name.replace(\"[0]\",\"[\"+l+\"]\"),type:s});else i.push({name:o.name,type:s})}}return i}function a(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),i=[],a=0;a<r;++a){var o=t.getActiveAttrib(e,a);o&&i.push({name:o.name,type:n(t,o.type)})}return i}r.uniforms=i,r.attributes=a;var o={FLOAT:\"float\",FLOAT_VEC2:\"vec2\",FLOAT_VEC3:\"vec3\",FLOAT_VEC4:\"vec4\",INT:\"int\",INT_VEC2:\"ivec2\",INT_VEC3:\"ivec3\",INT_VEC4:\"ivec4\",BOOL:\"bool\",BOOL_VEC2:\"bvec2\",BOOL_VEC3:\"bvec3\",BOOL_VEC4:\"bvec4\",FLOAT_MAT2:\"mat2\",FLOAT_MAT3:\"mat3\",FLOAT_MAT4:\"mat4\",SAMPLER_2D:\"sampler2D\",SAMPLER_CUBE:\"samplerCube\"},s=null},{}],202:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o){this.id=t,this.src=e,this.type=r,this.shader=n,this.count=a,this.programs=[],this.cache=o}function i(t){this.gl=t,this.shaders=[{},{}],this.programs={}}function a(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS)){var i=t.getShaderInfoLog(n);try{var a=h(i,r,e)}catch(t){throw console.warn(\"Failed to format compiler error: \"+t),new c(i,\"Error compiling shader:\\n\"+i)}throw new c(i,a.short,a.long)}return n}function o(t,e,r,n,i){var a=t.createProgram();t.attachShader(a,e),t.attachShader(a,r);for(var o=0;o<n.length;++o)t.bindAttribLocation(a,i[o],n[o]);if(t.linkProgram(a),!t.getProgramParameter(a,t.LINK_STATUS)){var s=t.getProgramInfoLog(a);throw new c(s,\"Error linking program: \"+s)}return a}function s(t){var e=f.get(t);return e||(e=new i(t),f.set(t,e)),e}function l(t,e,r){return s(t).getShaderReference(e,r)}function u(t,e,r,n,i){return s(t).getProgram(e,r,n,i)}r.shader=l,r.program=u;var c=t(\"./GLError\"),h=t(\"gl-format-compiler-error\"),f=new(\"undefined\"==typeof WeakMap?t(\"weakmap-shim\"):WeakMap),d=0;n.prototype.dispose=function(){if(0==--this.count){for(var t=this.cache,e=t.gl,r=this.programs,n=0,i=r.length;n<i;++n){var a=t.programs[r[n]];a&&(delete t.programs[n],e.deleteProgram(a))}e.deleteShader(this.shader),delete t.shaders[this.type===e.FRAGMENT_SHADER|0][this.src]}};var p=i.prototype;p.getShaderReference=function(t,e){var r=this.gl,i=this.shaders[t===r.FRAGMENT_SHADER|0],o=i[e];if(o&&r.isShader(o.shader))o.count+=1;else{var s=a(r,t,e);o=i[e]=new n(d++,e,t,s,[],1,this)}return o},p.getProgram=function(t,e,r,n){var i=[t.id,e.id,r.join(\":\"),n.join(\":\")].join(\"@\"),a=this.programs[i];return a&&this.gl.isProgram(a)||(this.programs[i]=a=o(this.gl,t.shader,e.shader,r,n),t.programs.push(i),e.programs.push(i)),a}},{\"./GLError\":197,\"gl-format-compiler-error\":149,\"weakmap-shim\":542}],203:[function(t,e,r){\"use strict\";function n(t,e){this.gl=t,this.pickBuffer=e,this.screenBox=[0,0,t.drawingBufferWidth,t.drawingBufferHeight],this.viewBox=[0,0,0,0],this.dataBox=[-10,-10,10,10],this.gridLineEnable=[!0,!0],this.gridLineWidth=[1,1],this.gridLineColor=[[0,0,0,1],[0,0,0,1]],this.pixelRatio=1,this.tickMarkLength=[0,0,0,0],this.tickMarkWidth=[0,0,0,0],this.tickMarkColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[15,15,15,15],this.tickAngle=[0,0,0,0],this.tickEnable=[!0,!0,!0,!0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[15,15,15,15],this.labelAngle=[0,Math.PI/2,0,3*Math.PI/2],this.labelEnable=[!0,!0,!0,!0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.titleCenter=[0,0],this.titleEnable=!0,this.titleAngle=0,this.titleColor=[0,0,0,1],this.borderColor=[0,0,0,0],this.backgroundColor=[0,0,0,0],this.zeroLineEnable=[!0,!0],this.zeroLineWidth=[4,4],this.zeroLineColor=[[0,0,0,1],[0,0,0,1]],this.borderLineEnable=[!0,!0,!0,!0],this.borderLineWidth=[2,2,2,2],this.borderLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.grid=null,this.text=null,this.line=null,this.box=null,this.objects=[],this.overlays=[],this._tickBounds=[1/0,1/0,-1/0,-1/0],this.static=!1,this.dirty=!1,this.pickDirty=!1,this.pickDelay=120,this.pickRadius=10,this._pickTimeout=null,this._drawPick=this.drawPick.bind(this),this._depthCounter=0}function i(t){for(var e=t.slice(),r=0;r<e.length;++r)e[r]=e[r].slice();return e}function a(t,e){return t.x-e.x}function o(t){var e=t.gl,r=new n(e,s(e,[e.drawingBufferWidth,e.drawingBufferHeight]));return r.grid=l(r),r.text=u(r),r.line=c(r),r.box=h(r),r.update(t),r}e.exports=o;var s=t(\"gl-select-static\"),l=t(\"./lib/grid\"),u=t(\"./lib/text\"),c=t(\"./lib/line\"),h=t(\"./lib/box\"),f=n.prototype;f.setDirty=function(){this.dirty=this.pickDirty=!0},f.setOverlayDirty=function(){this.dirty=!0},f.nextDepthValue=function(){return this._depthCounter++/65536},f.draw=function(){return function(){var t=this.gl,e=this.screenBox,r=this.viewBox,n=this.dataBox,i=this.pixelRatio,a=this.grid,o=this.line,s=this.text,l=this.objects;if(this._depthCounter=0,this.pickDirty&&(this._pickTimeout&&clearTimeout(this._pickTimeout),this.pickDirty=!1,this._pickTimeout=setTimeout(this._drawPick,this.pickDelay)),this.dirty){this.dirty=!1,t.bindFramebuffer(t.FRAMEBUFFER,null),t.enable(t.SCISSOR_TEST),t.disable(t.DEPTH_TEST),t.depthFunc(t.LESS),t.depthMask(!1),t.enable(t.BLEND),t.blendEquation(t.FUNC_ADD,t.FUNC_ADD),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),t.scissor(e[0],e[1],e[2]-e[0],e[3]-e[1]);var u=this.borderColor;t.clearColor(u[0]*u[3],u[1]*u[3],u[2]*u[3],u[3]),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),t.scissor(r[0],r[1],r[2]-r[0],r[3]-r[1]),t.viewport(r[0],r[1],r[2]-r[0],r[3]-r[1]);var c=this.backgroundColor;t.clearColor(c[0]*c[3],c[1]*c[3],c[2]*c[3],c[3]),t.clear(t.COLOR_BUFFER_BIT),a.draw();var h=this.zeroLineEnable,f=this.zeroLineColor,d=this.zeroLineWidth;if(h[0]||h[1]){o.bind();for(b=0;b<2;++b)if(h[b]&&n[b]<=0&&n[b+2]>=0){var p=e[b]-n[b]*(e[b+2]-e[b])/(n[b+2]-n[b]);0===b?o.drawLine(p,e[1],p,e[3],d[b],f[b]):o.drawLine(e[0],p,e[2],p,d[b],f[b])}}for(b=0;b<l.length;++b)l[b].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 m=this.borderLineEnable,g=this.borderLineWidth,v=this.borderLineColor;m[1]&&o.drawLine(r[0],r[1]-.5*g[1]*i,r[0],r[3]+.5*g[3]*i,g[1],v[1]),m[0]&&o.drawLine(r[0]-.5*g[0]*i,r[1],r[2]+.5*g[2]*i,r[1],g[0],v[0]),m[3]&&o.drawLine(r[2],r[1]-.5*g[1]*i,r[2],r[3]+.5*g[3]*i,g[3],v[3]),m[2]&&o.drawLine(r[0]-.5*g[0]*i,r[3],r[2]+.5*g[2]*i,r[3],g[2],v[2]),s.bind();for(b=0;b<2;++b)s.drawTicks(b);this.titleEnable&&s.drawTitle();for(var y=this.overlays,b=0;b<y.length;++b)y[b].draw();t.disable(t.SCISSOR_TEST),t.disable(t.BLEND),t.depthMask(!0)}}}(),f.drawPick=function(){return function(){if(!this.static){var t=this.pickBuffer;this.gl;this._pickTimeout=null,t.begin();for(var e=1,r=this.objects,n=0;n<r.length;++n)e=r[n].drawPick(e);t.end()}}}(),f.pick=function(){return function(t,e){if(!this.static){var r=this.pixelRatio,n=this.pickPixelRatio,i=this.viewBox,a=0|Math.round((t-i[0]/r)*n),o=0|Math.round((e-i[1]/r)*n),s=this.pickBuffer.query(a,o,this.pickRadius);if(!s)return null;for(var l=s.id+(s.value[0]<<8)+(s.value[1]<<16)+(s.value[2]<<24),u=this.objects,c=0;c<u.length;++c){var h=u[c].pick(a,o,l);if(h)return h}return null}}}(),f.setScreenBox=function(t){var e=this.screenBox,r=this.pixelRatio;e[0]=0|Math.round(t[0]*r),e[1]=0|Math.round(t[1]*r),e[2]=0|Math.round(t[2]*r),e[3]=0|Math.round(t[3]*r),this.setDirty()},f.setDataBox=function(t){var e=this.dataBox;(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())},f.setViewBox=function(t){var e=this.pixelRatio,r=this.viewBox;r[0]=0|Math.round(t[0]*e),r[1]=0|Math.round(t[1]*e),r[2]=0|Math.round(t[2]*e),r[3]=0|Math.round(t[3]*e);var n=this.pickPixelRatio;this.pickBuffer.shape=[0|Math.round((t[2]-t[0])*n),0|Math.round((t[3]-t[1])*n)],this.setDirty()},f.update=function(t){t=t||{};var e=this.gl;this.pixelRatio=t.pixelRatio||1;var r=this.pixelRatio;this.pickPixelRatio=Math.max(r,1),this.setScreenBox(t.screenBox||[0,0,e.drawingBufferWidth/r,e.drawingBufferHeight/r]);this.screenBox;this.setViewBox(t.viewBox||[.125*(this.screenBox[2]-this.screenBox[0])/r,.125*(this.screenBox[3]-this.screenBox[1])/r,.875*(this.screenBox[2]-this.screenBox[0])/r,.875*(this.screenBox[3]-this.screenBox[1])/r]);var n=this.viewBox,o=(n[2]-n[0])/(n[3]-n[1]);this.setDataBox(t.dataBox||[-10,-10/o,10,10/o]),this.borderColor=(t.borderColor||[0,0,0,0]).slice(),this.backgroundColor=(t.backgroundColor||[0,0,0,0]).slice(),this.gridLineEnable=(t.gridLineEnable||[!0,!0]).slice(),this.gridLineWidth=(t.gridLineWidth||[1,1]).slice(),this.gridLineColor=i(t.gridLineColor||[[.5,.5,.5,1],[.5,.5,.5,1]]),this.zeroLineEnable=(t.zeroLineEnable||[!0,!0]).slice(),this.zeroLineWidth=(t.zeroLineWidth||[4,4]).slice(),this.zeroLineColor=i(t.zeroLineColor||[[0,0,0,1],[0,0,0,1]]),this.tickMarkLength=(t.tickMarkLength||[0,0,0,0]).slice(),this.tickMarkWidth=(t.tickMarkWidth||[0,0,0,0]).slice(),this.tickMarkColor=i(t.tickMarkColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.titleCenter=(t.titleCenter||[.5*(n[0]+n[2])/r,(n[3]+120)/r]).slice(),this.titleEnable=!(\"titleEnable\"in t&&!t.titleEnable),this.titleAngle=t.titleAngle||0,this.titleColor=(t.titleColor||[0,0,0,1]).slice(),this.labelPad=(t.labelPad||[15,15,15,15]).slice(),this.labelAngle=(t.labelAngle||[0,Math.PI/2,0,3*Math.PI/2]).slice(),this.labelEnable=(t.labelEnable||[!0,!0,!0,!0]).slice(),this.labelColor=i(t.labelColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.tickPad=(t.tickPad||[15,15,15,15]).slice(),this.tickAngle=(t.tickAngle||[0,0,0,0]).slice(),this.tickEnable=(t.tickEnable||[!0,!0,!0,!0]).slice(),this.tickColor=i(t.tickColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.borderLineEnable=(t.borderLineEnable||[!0,!0,!0,!0]).slice(),this.borderLineWidth=(t.borderLineWidth||[2,2,2,2]).slice(),this.borderLineColor=i(t.borderLineColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);var s=t.ticks||[[],[]],l=this._tickBounds;l[0]=l[1]=1/0,l[2]=l[3]=-1/0;for(var u=0;u<2;++u){var c=s[u].slice(0);0!==c.length&&(c.sort(a),l[u]=Math.min(l[u],c[0].x),l[u+2]=Math.max(l[u+2],c[c.length-1].x))}this.grid.update({bounds:l,ticks:s}),this.text.update({bounds:l,ticks:s,labels:t.labels||[\"x\",\"y\"],labelSize:t.labelSize||[12,12],labelFont:t.labelFont||[\"sans-serif\",\"sans-serif\"],title:t.title||\"\",titleSize:t.titleSize||18,titleFont:t.titleFont||\"sans-serif\"}),this.static=!!t.static,this.setDirty()},f.dispose=function(){this.box.dispose(),this.grid.dispose(),this.text.dispose(),this.line.dispose();for(t=this.objects.length-1;t>=0;--t)this.objects[t].dispose();this.objects.length=0;for(var t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},f.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},f.removeObject=function(t){for(var e=this.objects,r=0;r<e.length;++r)if(e[r]===t){e.splice(r,1),this.setDirty();break}},f.addOverlay=function(t){this.overlays.indexOf(t)<0&&(this.overlays.push(t),this.setOverlayDirty())},f.removeOverlay=function(t){for(var e=this.overlays,r=0;r<e.length;++r)if(e[r]===t){e.splice(r,1),this.setOverlayDirty();break}}},{\"./lib/box\":190,\"./lib/grid\":191,\"./lib/line\":192,\"./lib/text\":194,\"gl-select-static\":238}],204:[function(t,e,r){var n=t(\"gl-shader\");e.exports=function(t){return n(t,\"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}\",\"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}\",null,[{name:\"position\",type:\"vec2\"}])}},{\"gl-shader\":239}],205:[function(t,e,r){\"use strict\";function n(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function i(t,e){var r=null;try{(r=t.getContext(\"webgl\",e))||(r=t.getContext(\"experimental-webgl\",e))}catch(t){return null}return r}function a(t){var e=Math.round(Math.log(Math.abs(t))/Math.log(10));if(e<0){r=Math.round(Math.pow(10,-e));return Math.ceil(t*r)/r}if(e>0){var r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function o(t){return\"boolean\"!=typeof t||t}function s(t){function e(){if(!w&&q.autoResize){var t=M.parentNode,e=1,r=1;t&&t!==document.body?(e=t.clientWidth,r=t.clientHeight):(e=window.innerWidth,r=window.innerHeight);var n=0|Math.ceil(e*q.pixelRatio),i=0|Math.ceil(r*q.pixelRatio);if(n!==M.width||i!==M.height){M.width=n,M.height=i;var a=M.style;a.position=a.position||\"absolute\",a.left=\"0px\",a.top=\"0px\",a.width=e+\"px\",a.height=r+\"px\",F=!0}}}function r(){for(var t=P.length,e=R.length,r=0;r<e;++r)j[r]=0;t:for(r=0;r<t;++r){var n=P[r],i=n.pickSlots;if(i){for(var a=0;a<e;++a)if(j[a]+i<255){O[r]=a,n.setPickBase(j[a]+1),j[a]+=i;continue t}var o=f(k,H);O[r]=e,R.push(o),j.push(i),n.setPickBase(1),e+=1}else O[r]=-1}for(;e>0&&0===j[e-1];)j.pop(),R.pop().dispose()}function s(){if(q.contextLost)return!0;k.isContextLost()&&(q.contextLost=!0,q.mouseListener.enabled=!1,q.selection.object=null,q.oncontextloss&&q.oncontextloss())}function b(){if(!s()){k.colorMask(!0,!0,!0,!0),k.depthMask(!0),k.disable(k.BLEND),k.enable(k.DEPTH_TEST);for(var t=P.length,e=R.length,r=0;r<e;++r){var n=R[r];n.shape=G,n.begin();for(var i=0;i<t;++i)if(O[i]===r){var a=P[i];a.drawPick&&(a.pixelRatio=1,a.drawPick(V))}n.end()}}}function x(){if(!s()){e();var t=q.camera.tick();V.view=q.camera.matrix,F=F||t,N=N||t,z.pixelRatio=q.pixelRatio,I.pixelRatio=q.pixelRatio;var r=P.length,n=X[0],i=X[1];n[0]=n[1]=n[2]=1/0,i[0]=i[1]=i[2]=-1/0;for(y=0;y<r;++y){(L=P[y]).pixelRatio=q.pixelRatio,L.axes=q.axes,F=F||!!L.dirty,N=N||!!L.dirty;var o=L.bounds;if(o)for(var l=o[0],u=o[1],h=0;h<3;++h)n[h]=Math.min(n[h],l[h]),i[h]=Math.max(i[h],u[h])}var f=q.bounds;if(q.autoBounds)for(h=0;h<3;++h){if(i[h]<n[h])n[h]=-1,i[h]=1;else{n[h]===i[h]&&(n[h]-=1,i[h]+=1);var d=.05*(i[h]-n[h]);n[h]=n[h]-d,i[h]=i[h]+d}f[0][h]=n[h],f[1][h]=i[h]}for(var m=!1,h=0;h<3;++h)m=m||Z[0][h]!==f[0][h]||Z[1][h]!==f[1][h],Z[0][h]=f[0][h],Z[1][h]=f[1][h];if(N=N||m,F=F||m){if(m){for(var v=[0,0,0],y=0;y<3;++y)v[y]=a((f[1][y]-f[0][y])/10);z.autoTicks?z.update({bounds:f,tickSpacing:v}):z.update({bounds:f})}var x=k.drawingBufferWidth,_=k.drawingBufferHeight;H[0]=x,H[1]=_,G[0]=0|Math.max(x/q.pixelRatio,1),G[1]=0|Math.max(_/q.pixelRatio,1),g(B,q.fovy,x/_,q.zNear,q.zFar);for(y=0;y<16;++y)U[y]=0;U[15]=1;for(var w=0,y=0;y<3;++y)w=Math.max(w,f[1][y]-f[0][y]);for(y=0;y<3;++y)q.autoScale?U[5*y]=q.aspect[y]/(f[1][y]-f[0][y]):U[5*y]=1/w,q.autoCenter&&(U[12+y]=.5*-U[5*y]*(f[0][y]+f[1][y]));for(y=0;y<r;++y)(L=P[y]).axesBounds=f,q.clipToBounds&&(L.clipBounds=f);T.object&&(q.snapToData?I.position=T.dataCoordinate:I.position=T.dataPosition,I.bounds=f),N&&(N=!1,b()),q.axesPixels=c(q.axes,V,x,_),q.onrender&&q.onrender(),k.bindFramebuffer(k.FRAMEBUFFER,null),k.viewport(0,0,x,_);var M=q.clearColor;k.clearColor(M[0],M[1],M[2],M[3]),k.clear(k.COLOR_BUFFER_BIT|k.DEPTH_BUFFER_BIT),k.depthMask(!0),k.colorMask(!0,!0,!0,!0),k.enable(k.DEPTH_TEST),k.depthFunc(k.LEQUAL),k.disable(k.BLEND),k.disable(k.CULL_FACE);var A=!1;z.enable&&(A=A||z.isTransparent(),z.draw(V)),I.axes=z,T.object&&I.draw(V),k.disable(k.CULL_FACE);for(y=0;y<r;++y)(L=P[y]).axes=z,L.pixelRatio=q.pixelRatio,L.isOpaque&&L.isOpaque()&&L.draw(V),L.isTransparent&&L.isTransparent()&&(A=!0);if(A){S.shape=H,S.bind(),k.clear(k.DEPTH_BUFFER_BIT),k.colorMask(!1,!1,!1,!1),k.depthMask(!0),k.depthFunc(k.LESS),z.enable&&z.isTransparent()&&z.drawTransparent(V);for(y=0;y<r;++y)(L=P[y]).isOpaque&&L.isOpaque()&&L.draw(V);k.enable(k.BLEND),k.blendEquation(k.FUNC_ADD),k.blendFunc(k.ONE,k.ONE_MINUS_SRC_ALPHA),k.colorMask(!0,!0,!0,!0),k.depthMask(!1),k.clearColor(0,0,0,0),k.clear(k.COLOR_BUFFER_BIT),z.isTransparent()&&z.drawTransparent(V);for(y=0;y<r;++y){var L=P[y];L.isTransparent&&L.isTransparent()&&L.drawTransparent(V)}k.bindFramebuffer(k.FRAMEBUFFER,null),k.blendFunc(k.ONE,k.ONE_MINUS_SRC_ALPHA),k.disable(k.DEPTH_TEST),E.bind(),S.color[0].bind(0),E.uniforms.accumBuffer=0,p(k),k.disable(k.BLEND)}F=!1;for(y=0;y<r;++y)P[y].dirty=!1}}}function _(){w||q.contextLost||(requestAnimationFrame(_),x())}var w=!1,M=((t=t||{}).pixelRatio||parseFloat(window.devicePixelRatio),t.canvas);M||(M=document.createElement(\"canvas\"),t.container?t.container.appendChild(M):document.body.appendChild(M));var k=t.gl;if(k||(k=i(M,t.glOptions||{premultipliedAlpha:!0,antialias:!0})),!k)throw new Error(\"webgl not supported\");var A=t.bounds||[[-10,-10,-10],[10,10,10]],T=new n,S=d(k,[k.drawingBufferWidth,k.drawingBufferHeight],{preferFloat:!y}),E=v(k),L=t.camera||{eye:[2,0,0],center:[0,0,0],up:[0,1,0],zoomMin:.1,zoomMax:100,mode:\"turntable\"},C=t.axes||{},z=u(k,C);z.enable=!C.disable;var D=t.spikes||{},I=h(k,D),P=[],O=[],j=[],R=[],F=!0,N=!0,B=new Array(16),U=new Array(16),V={view:null,projection:B,model:U},N=!0,H=[k.drawingBufferWidth,k.drawingBufferHeight],q={gl:k,contextLost:!1,pixelRatio:t.pixelRatio||parseFloat(window.devicePixelRatio),canvas:M,selection:T,camera:l(M,L),axes:z,axesPixels:null,spikes:I,bounds:A,objects:P,shape:H,aspect:t.aspectRatio||[1,1,1],pickRadius:t.pickRadius||10,zNear:t.zNear||.01,zFar:t.zFar||1e3,fovy:t.fovy||Math.PI/4,clearColor:t.clearColor||[0,0,0,0],autoResize:o(t.autoResize),autoBounds:o(t.autoBounds),autoScale:!!t.autoScale,autoCenter:o(t.autoCenter),clipToBounds:o(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:V,oncontextloss:null,mouseListener:null},G=[k.drawingBufferWidth/q.pixelRatio|0,k.drawingBufferHeight/q.pixelRatio|0];q.autoResize&&e(),window.addEventListener(\"resize\",e),q.update=function(t){w||(t=t||{},F=!0,N=!0)},q.add=function(t){w||(t.axes=z,P.push(t),O.push(-1),F=!0,N=!0,r())},q.remove=function(t){if(!w){var e=P.indexOf(t);e<0||(P.splice(e,1),O.pop(),F=!0,N=!0,r())}},q.dispose=function(){if(!w&&(w=!0,window.removeEventListener(\"resize\",e),M.removeEventListener(\"webglcontextlost\",s),q.mouseListener.enabled=!1,!q.contextLost)){z.dispose(),I.dispose();for(t=0;t<P.length;++t)P[t].dispose();S.dispose();for(var t=0;t<R.length;++t)R[t].dispose();E.dispose(),k=null,z=null,I=null,P=[]}};var Y=!1,W=0;q.mouseListener=m(M,function(t,e,r){if(!w){var n=R.length,i=P.length,a=T.object;T.distance=1/0,T.mouse[0]=e,T.mouse[1]=r,T.object=null,T.screen=null,T.dataCoordinate=T.dataPosition=null;var o=!1;if(t&&W)Y=!0;else{Y&&(N=!0),Y=!1;for(var s=0;s<n;++s){var l=R[s].query(e,G[1]-r-1,q.pickRadius);if(l){if(l.distance>T.distance)continue;for(var u=0;u<i;++u){var c=P[u];if(O[u]===s){var h=c.pick(l);h&&(T.buttons=t,T.screen=l.coord,T.distance=l.distance,T.object=c,T.index=h.distance,T.dataPosition=h.position,T.dataCoordinate=h.dataCoordinate,T.data=h,o=!0)}}}}}a&&a!==T.object&&(a.highlight&&a.highlight(null),F=!0),T.object&&(T.object.highlight&&T.object.highlight(T.data),F=!0),(o=o||T.object!==a)&&q.onselect&&q.onselect(T),1&t&&!(1&W)&&q.onclick&&q.onclick(T),W=t}}),M.addEventListener(\"webglcontextlost\",s);var X=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],Z=[X[0].slice(),X[1].slice()];return _(),q.redraw=function(){w||(F=!0,x())},q}e.exports=s;var l=t(\"3d-view-controls\"),u=t(\"gl-axes3d\"),c=t(\"gl-axes3d/properties\"),h=t(\"gl-spikes3d\"),f=t(\"gl-select-static\"),d=t(\"gl-fbo\"),p=t(\"a-big-triangle\"),m=t(\"mouse-change\"),g=t(\"gl-mat4/perspective\"),v=t(\"./lib/shader\"),y=t(\"is-mobile\")()},{\"./lib/shader\":204,\"3d-view-controls\":32,\"a-big-triangle\":34,\"gl-axes3d\":133,\"gl-axes3d/properties\":140,\"gl-fbo\":148,\"gl-mat4/perspective\":168,\"gl-select-static\":238,\"gl-spikes3d\":248,\"is-mobile\":278,\"mouse-change\":434}],206:[function(t,e,r){r.pointVertex=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec2 position;\\n\\nuniform mat3 matrix;\\nuniform float pointSize;\\nuniform float pointCloud;\\n\\nhighp float rand(vec2 co) {\\n  highp float a = 12.9898;\\n  highp float b = 78.233;\\n  highp float c = 43758.5453;\\n  highp float d = dot(co.xy, vec2(a, b));\\n  highp float e = mod(d, 3.14);\\n  return fract(sin(e) * c);\\n}\\n\\nvoid main() {\\n  vec3 hgPosition = matrix * vec3(position, 1);\\n  gl_Position  = vec4(hgPosition.xy, 0, hgPosition.z);\\n    // if we don't jitter the point size a bit, overall point cloud\\n    // saturation 'jumps' on zooming, which is disturbing and confusing\\n  gl_PointSize = pointSize * ((19.5 + rand(position)) / 20.0);\\n  if(pointCloud != 0.0) { // pointCloud is truthy\\n    // get the same square surface as circle would be\\n    gl_PointSize *= 0.886;\\n  }\\n}\",r.pointFragment=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec4 color, borderColor;\\nuniform float centerFraction;\\nuniform float pointCloud;\\n\\nvoid main() {\\n  float radius;\\n  vec4 baseColor;\\n  if(pointCloud != 0.0) { // pointCloud is truthy\\n    if(centerFraction == 1.0) {\\n      gl_FragColor = color;\\n    } else {\\n      gl_FragColor = mix(borderColor, color, centerFraction);\\n    }\\n  } else {\\n    radius = length(2.0 * gl_PointCoord.xy - 1.0);\\n    if(radius > 1.0) {\\n      discard;\\n    }\\n    baseColor = mix(borderColor, color, step(radius, centerFraction));\\n    gl_FragColor = vec4(baseColor.rgb * baseColor.a, baseColor.a);\\n  }\\n}\\n\",r.pickVertex=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec2 position;\\nattribute vec4 pickId;\\n\\nuniform mat3 matrix;\\nuniform float pointSize;\\nuniform vec4 pickOffset;\\n\\nvarying vec4 fragId;\\n\\nvoid main() {\\n  vec3 hgPosition = matrix * vec3(position, 1);\\n  gl_Position  = vec4(hgPosition.xy, 0, hgPosition.z);\\n  gl_PointSize = pointSize;\\n\\n  vec4 id = pickId + pickOffset;\\n  id.y += floor(id.x / 256.0);\\n  id.x -= floor(id.x / 256.0) * 256.0;\\n\\n  id.z += floor(id.y / 256.0);\\n  id.y -= floor(id.y / 256.0) * 256.0;\\n\\n  id.w += floor(id.z / 256.0);\\n  id.z -= floor(id.z / 256.0) * 256.0;\\n\\n  fragId = id;\\n}\\n\",r.pickFragment=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nvarying vec4 fragId;\\n\\nvoid main() {\\n  float radius = length(2.0 * gl_PointCoord.xy - 1.0);\\n  if(radius > 1.0) {\\n    discard;\\n  }\\n  gl_FragColor = fragId / 255.0;\\n}\\n\"},{}],207:[function(t,e,r){arguments[4][196][0].apply(r,arguments)},{\"./lib/GLError\":208,\"./lib/create-attributes\":209,\"./lib/create-uniforms\":210,\"./lib/reflect\":211,\"./lib/runtime-reflect\":212,\"./lib/shader-cache\":213,dup:196}],208:[function(t,e,r){arguments[4][197][0].apply(r,arguments)},{dup:197}],209:[function(t,e,r){arguments[4][198][0].apply(r,arguments)},{\"./GLError\":208,dup:198}],210:[function(t,e,r){arguments[4][199][0].apply(r,arguments)},{\"./GLError\":208,\"./reflect\":211,dup:199}],211:[function(t,e,r){arguments[4][200][0].apply(r,arguments)},{dup:200}],212:[function(t,e,r){arguments[4][201][0].apply(r,arguments)},{dup:201}],213:[function(t,e,r){arguments[4][202][0].apply(r,arguments)},{\"./GLError\":208,dup:202,\"gl-format-compiler-error\":149,\"weakmap-shim\":542}],214:[function(t,e,r){\"use strict\";function n(t,e,r,n,i){this.plot=t,this.offsetBuffer=e,this.pickBuffer=r,this.shader=n,this.pickShader=i,this.sizeMin=.5,this.sizeMinCap=2,this.sizeMax=20,this.areaRatio=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.blend=!1,this.pickOffset=0,this.points=null}function i(t,e){var r,n=0,i=t.length>>>1;for(r=0;r<i;r++){var a=t[2*r],o=t[2*r+1];a>=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}function a(t,e){var r=t.gl,i=new n(t,s(r),s(r),o(r,u.pointVertex,u.pointFragment),o(r,u.pickVertex,u.pickFragment));return i.update(e),t.addObject(i),i}var o=t(\"gl-shader\"),s=t(\"gl-buffer\"),l=t(\"typedarray-pool\"),u=t(\"./lib/shader\");e.exports=a;var c=n.prototype;c.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},c.update=function(t){function e(e,r){return e in t?t[e]:r}var r;t=t||{},this.sizeMin=e(\"sizeMin\",.5),this.sizeMax=e(\"sizeMax\",20),this.color=e(\"color\",[1,0,0,1]).slice(),this.areaRatio=e(\"areaRatio\",1),this.borderColor=e(\"borderColor\",[0,0,0,1]).slice(),this.blend=e(\"blend\",!1);var n=t.positions.length>>>1,i=t.positions instanceof Float32Array,a=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,o=t.positions,s=i?o:l.mallocFloat32(o.length),u=a?t.idToIndex:l.mallocInt32(n);if(i||s.set(o),!a)for(s.set(o),r=0;r<n;r++)u[r]=r;this.points=o,this.offsetBuffer.update(s),this.pickBuffer.update(u),i||l.free(s),a||l.free(u),this.pointCount=n,this.pickOffset=0},c.unifiedDraw=function(){var t=[1,0,0,0,1,0,0,0,1],e=[0,0,0,0];return function(r){var n=void 0!==r,a=n?this.pickShader:this.shader,o=this.plot.gl,s=this.plot.dataBox;if(0===this.pointCount)return r;var l=s[2]-s[0],u=s[3]-s[1],c=i(this.points,s),h=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(c,.33333)));t[0]=2/l,t[4]=2/u,t[6]=-2*s[0]/l-1,t[7]=-2*s[1]/u-1,this.offsetBuffer.bind(),a.bind(),a.attributes.position.pointer(),a.uniforms.matrix=t,a.uniforms.color=this.color,a.uniforms.borderColor=this.borderColor,a.uniforms.pointCloud=h<5,a.uniforms.pointSize=h,a.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),n&&(e[0]=255&r,e[1]=r>>8&255,e[2]=r>>16&255,e[3]=r>>24&255,this.pickBuffer.bind(),a.attributes.pickId.pointer(o.UNSIGNED_BYTE),a.uniforms.pickOffset=e,this.pickOffset=r);var f=o.getParameter(o.BLEND),d=o.getParameter(o.DITHER);return f&&!this.blend&&o.disable(o.BLEND),d&&o.disable(o.DITHER),o.drawArrays(o.POINTS,0,this.pointCount),f&&!this.blend&&o.enable(o.BLEND),d&&o.enable(o.DITHER),r+this.pointCount}}(),c.draw=c.unifiedDraw,c.drawPick=c.unifiedDraw,c.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(r<n||r>=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}}},{\"./lib/shader\":206,\"gl-buffer\":141,\"gl-shader\":207,\"typedarray-pool\":521}],215:[function(t,e,r){function n(t,e,r,n){var i,a,o,s,l,u=e[0],c=e[1],h=e[2],f=e[3],d=r[0],p=r[1],m=r[2],g=r[3];return(a=u*d+c*p+h*m+f*g)<0&&(a=-a,d=-d,p=-p,m=-m,g=-g),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*u+l*d,t[1]=s*c+l*p,t[2]=s*h+l*m,t[3]=s*f+l*g,t}e.exports=n},{}],216:[function(t,e,r){\"use strict\";e.exports={vertex:\"precision highp float;\\n#define GLSLIFY 1\\n\\n\\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo) {\\n  return vec4((posHi + trHi) * scHi\\n  \\t\\t\\t//FIXME: this thingy does not give noticeable precision gain, need test\\n            + (posLo + trLo) * scHi\\n            + (posHi + trHi) * scLo\\n            + (posLo + trLo) * scLo\\n            , 0, 1);\\n}\\n\\n\\nattribute vec2 positionHi, positionLo;\\nattribute float size, border;\\nattribute vec2 char, color;\\n\\n//this is 64-bit form of scale and translate\\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\\nuniform float pixelRatio;\\nuniform vec4 viewBox;\\nuniform sampler2D palette;\\n\\nvarying vec4 charColor, borderColor;\\nvarying vec2 charId;\\nvarying vec2 pointCoord;\\nvarying float pointSize;\\nvarying float borderWidth;\\n\\n\\nvoid main() {\\n  charColor = texture2D(palette, vec2(color.x / 255., 0));\\n  borderColor = texture2D(palette, vec2(color.y / 255., 0));\\n\\n  gl_PointSize = size * pixelRatio;\\n  pointSize = size * pixelRatio;\\n\\n  charId = char;\\n  borderWidth = border;\\n\\n  gl_Position = computePosition_1_0(\\n    positionHi, positionLo,\\n    scaleHi, scaleLo,\\n    translateHi, translateLo);\\n\\n  pointCoord = viewBox.xy + (viewBox.zw - viewBox.xy) * (gl_Position.xy * .5 + .5);\\n}\\n\",fragment:\"precision highp float;\\n#define GLSLIFY 1\\n\\nuniform sampler2D chars;\\nuniform vec2 charsShape;\\nuniform float charsStep, pixelRatio, charOffset;\\n\\nvarying vec4 borderColor;\\nvarying vec4 charColor;\\nvarying vec2 charId;\\nvarying vec2 pointCoord;\\nvarying float pointSize;\\nvarying float borderWidth;\\n\\nvoid main() {\\n\\tvec2 pointUV = (pointCoord - gl_FragCoord.xy + pointSize * .5) / pointSize;\\n\\tpointUV.x = 1. - pointUV.x;\\n\\tpointUV.y += charOffset;\\n\\tvec2 texCoord = ((charId + pointUV) * charsStep) / charsShape;\\n\\tfloat dist = texture2D(chars, texCoord).r;\\n\\n\\t//max-distance alpha\\n\\tif (dist < 1e-2)\\n\\t\\tdiscard;\\n\\n\\tfloat dif = 5. * pixelRatio * borderWidth / pointSize;\\n\\tfloat borderLevel = .748 - dif * .5;\\n\\tfloat charLevel = .748 + dif * .5;\\n\\tfloat gamma = .005 * charsStep / pointSize;\\n\\n\\tfloat borderAmt = smoothstep(borderLevel - gamma, borderLevel + gamma, dist);\\n\\tfloat charAmt = smoothstep(charLevel - gamma, charLevel + gamma, dist);\\n\\n\\tvec4 color = borderColor;\\n\\tcolor.a *= borderAmt;\\n\\n\\tgl_FragColor = mix(color, charColor, charAmt);\\n}\\n\",pickVertex:\"precision highp float;\\n#define GLSLIFY 1\\n\\nattribute vec2 positionHi, positionLo;\\nattribute vec4 id;\\nattribute float size;\\n\\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\\nuniform vec4 pickOffset;\\nuniform float pixelRatio;\\n\\nvarying vec4 fragColor;\\n\\n\\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo) {\\n  return vec4((posHi + trHi) * scHi\\n  \\t\\t\\t//FIXME: this thingy does not give noticeable precision gain, need test\\n            + (posLo + trLo) * scHi\\n            + (posHi + trHi) * scLo\\n            + (posLo + trLo) * scLo\\n            , 0, 1);\\n}\\n\\n\\nvoid main() {\\n  vec4 fragId = id + pickOffset;\\n\\n  fragId.y += floor(fragId.x / 256.0);\\n  fragId.x -= floor(fragId.x / 256.0) * 256.0;\\n\\n  fragId.z += floor(fragId.y / 256.0);\\n  fragId.y -= floor(fragId.y / 256.0) * 256.0;\\n\\n  fragId.w += floor(fragId.z / 256.0);\\n  fragId.z -= floor(fragId.z / 256.0) * 256.0;\\n\\n  fragColor = fragId / 255.0;\\n\\n  gl_PointSize = size * .25 * pixelRatio;\\n\\n  gl_Position = computePosition_1_0(\\n    positionHi, positionLo,\\n    scaleHi, scaleLo,\\n    translateHi, translateLo);\\n}\\n\",pickFragment:\"precision lowp float;\\n#define GLSLIFY 1\\nvarying vec4 fragColor;\\nvoid main() {\\n  gl_FragColor = fragColor;\\n}\\n\"}},{}],217:[function(t,e,r){arguments[4][77][0].apply(r,arguments)},{dup:77}],218:[function(t,e,r){arguments[4][196][0].apply(r,arguments)},{\"./lib/GLError\":219,\"./lib/create-attributes\":220,\"./lib/create-uniforms\":221,\"./lib/reflect\":222,\"./lib/runtime-reflect\":223,\"./lib/shader-cache\":224,dup:196}],219:[function(t,e,r){arguments[4][197][0].apply(r,arguments)},{dup:197}],220:[function(t,e,r){arguments[4][198][0].apply(r,arguments)},{\"./GLError\":219,dup:198}],221:[function(t,e,r){arguments[4][199][0].apply(r,arguments)},{\"./GLError\":219,\"./reflect\":222,dup:199}],222:[function(t,e,r){arguments[4][200][0].apply(r,arguments)},{dup:200}],223:[function(t,e,r){arguments[4][201][0].apply(r,arguments)},{dup:201}],224:[function(t,e,r){arguments[4][202][0].apply(r,arguments)},{\"./GLError\":219,dup:202,\"gl-format-compiler-error\":149,\"weakmap-shim\":542}],225:[function(t,e,r){\"use strict\";function n(t,e,r,n,a){a<=4*f?i(0,a-1,t,e,r,n):h(0,a-1,t,e,r,n)}function i(t,e,r,n,i,a){for(var o=t+1;o<=e;++o){for(var s=r[o],l=n[2*o],u=n[2*o+1],c=i[o],h=a[o],f=o;f>t;){var d=r[f-1],p=n[2*(f-1)];if((d-s||l-p)>=0)break;r[f]=d,n[2*f]=p,n[2*f+1]=n[2*f-1],i[f]=i[f-1],a[f]=a[f-1],f-=1}r[f]=s,n[2*f]=l,n[2*f+1]=u,i[f]=c,a[f]=h}}function a(t,e,r,n,i,a){var o=r[t],s=n[2*t],l=n[2*t+1],u=i[t],c=a[t];r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e],r[e]=o,n[2*e]=s,n[2*e+1]=l,i[e]=u,a[e]=c}function o(t,e,r,n,i,a){r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e]}function s(t,e,r,n,i,a,o){var s=n[t],l=i[2*t],u=i[2*t+1],c=a[t],h=o[t];n[t]=n[e],i[2*t]=i[2*e],i[2*t+1]=i[2*e+1],a[t]=a[e],o[t]=o[e],n[e]=n[r],i[2*e]=i[2*r],i[2*e+1]=i[2*r+1],a[e]=a[r],o[e]=o[r],n[r]=s,i[2*r]=l,i[2*r+1]=u,a[r]=c,o[r]=h}function l(t,e,r,n,i,a,o,s,l,u,c){s[t]=s[e],l[2*t]=l[2*e],l[2*t+1]=l[2*e+1],u[t]=u[e],c[t]=c[e],s[e]=r,l[2*e]=n,l[2*e+1]=i,u[e]=a,c[e]=o}function u(t,e,r,n,i){return(r[t]-r[e]||n[2*e]-n[2*t]||i[t]-i[e])<0}function c(t,e,r,n,i,a,o,s){return(e-a[t]||o[2*t]-r||i-s[t])<0}function h(t,e,r,n,d,p){var m=(e-t+1)/6|0,g=t+m,v=e-m,y=t+e>>1,b=y-m,x=y+m,_=g,w=b,M=y,k=x,A=v,T=t+1,S=e-1,E=0;u(_,w,r,n,d,p)&&(E=_,_=w,w=E),u(k,A,r,n,d,p)&&(E=k,k=A,A=E),u(_,M,r,n,d,p)&&(E=_,_=M,M=E),u(w,M,r,n,d,p)&&(E=w,w=M,M=E),u(_,k,r,n,d,p)&&(E=_,_=k,k=E),u(M,k,r,n,d,p)&&(E=M,M=k,k=E),u(w,A,r,n,d,p)&&(E=w,w=A,A=E),u(w,M,r,n,d,p)&&(E=w,w=M,M=E),u(k,A,r,n,d,p)&&(E=k,k=A,A=E);var L=r[w],C=n[2*w],z=n[2*w+1],D=d[w],I=p[w],P=r[k],O=n[2*k],j=n[2*k+1],R=d[k],F=p[k],N=_,B=M,U=A,V=g,H=y,q=v,G=r[N],Y=r[B],W=r[U];r[V]=G,r[H]=Y,r[q]=W;for(var X=0;X<2;++X){var Z=n[2*N+X],J=n[2*B+X],Q=n[2*U+X];n[2*V+X]=Z,n[2*H+X]=J,n[2*q+X]=Q}var K=d[N],$=d[B],tt=d[U];d[V]=K,d[H]=$,d[q]=tt;var et=p[N],rt=p[B],nt=p[U];p[V]=et,p[H]=rt,p[q]=nt,o(b,t,r,n,d,p),o(x,e,r,n,d,p);for(var it=T;it<=S;++it)if(c(it,L,C,z,D,r,n,d))it!==T&&a(it,T,r,n,d,p),++T;else if(!c(it,P,O,j,R,r,n,d))for(;;){if(c(S,P,O,j,R,r,n,d)){c(S,L,C,z,D,r,n,d)?(s(it,T,S,r,n,d,p),++T,--S):(a(it,S,r,n,d,p),--S);break}if(--S<it)break}l(t,T-1,L,C,z,D,I,r,n,d,p),l(e,S+1,P,O,j,R,F,r,n,d,p),T-2-t<=f?i(t,T-2,r,n,d,p):h(t,T-2,r,n,d,p),e-(S+2)<=f?i(S+2,e,r,n,d,p):h(S+2,e,r,n,d,p),S-T<=f?i(T,S,r,n,d,p):h(T,S,r,n,d,p)}e.exports=n;var f=32},{}],226:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o,s){for(var l=r,u=r;u<n;++u){var c=t[2*u],h=t[2*u+1],f=e[u];i<=c&&c<=o&&a<=h&&h<=s&&(u===l?l+=1:(t[2*u]=t[2*l],t[2*u+1]=t[2*l+1],e[u]=e[l],t[2*l]=c,t[2*l+1]=h,e[l]=f,l+=1))}return l}function i(t,e,r){this.pixelSize=t,this.offset=e,this.count=r}function a(t,e,r,a){function l(i,a,o,s,u,c){var h=.5*o,f=s+1,d=u-s;r[_]=d,x[_++]=c;for(var p=0;p<2;++p)for(var m=0;m<2;++m){var g=i+p*h,v=a+m*h,y=n(t,e,f,u,g,v,g+h,v+h);if(y!==f){if(y-f>=Math.max(.9*d,32)){var b=u+s>>>1;l(g,v,h,f,b,c+1),f=b}l(g,v,h,f,y,c+1),f=y}}}var u=t.length>>>1;if(u<1)return[];for(var c=1/0,h=1/0,f=-1/0,d=-1/0,p=0;p<u;++p){var m=t[2*p],g=t[2*p+1];c=Math.min(c,m),f=Math.max(f,m),h=Math.min(h,g),d=Math.max(d,g),e[p]=p}c===f&&(f+=1+Math.abs(f)),h===d&&(d+=1+Math.abs(f));var v=1/(f-c),y=1/(d-h),b=Math.max(f-c,d-h);(a=a||[0,0,0,0])[0]=c,a[1]=h,a[2]=f,a[3]=d;var x=o.mallocInt32(u),_=0;l(c,h,b,0,u,0),s(x,t,e,r,u);for(var w=[],M=0,k=u,_=u-1;_>=0;--_){t[2*_]=(t[2*_]-c)*v,t[2*_+1]=(t[2*_+1]-h)*y;var A=x[_];A!==M&&(w.push(new i(b*Math.pow(.5,A),_+1,k-(_+1))),k=_+1,M=A)}return w.push(new i(b*Math.pow(.5,A+1),0,k)),o.free(x),w}var o=t(\"typedarray-pool\"),s=t(\"./lib/sort\");e.exports=a},{\"./lib/sort\":225,\"typedarray-pool\":521}],227:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o,s){this.plot=t,this.shader=e,this.pickShader=r,this.positionBuffer=n,this.sizeBuffer=i,this.colorBuffer=a,this.idBuffer=o,this.charBuffer=s,this.pointCount=0,this.pickOffset=0,this.points=null,this.scales=[],this.xCoords=[],this.charCanvas=document.createElement(\"canvas\"),this.charTexture=h(this.plot.gl,this.charCanvas),this.charStep=400,this.charOffset=.032,this.snapThreshold=1e4,this.paletteTexture=h(this.plot.gl,[256,1])}function i(t,e){var r=t.gl,i=new n(t,a(r,l.vertex,l.fragment),a(r,l.pickVertex,l.pickFragment),o(r),o(r),o(r),o(r),o(r));return i.update(e),t.addObject(i),i}e.exports=i;var a=t(\"gl-shader\"),o=t(\"gl-buffer\"),s=t(\"typedarray-pool\"),l=t(\"./lib/shaders\"),u=t(\"snap-points-2d\"),c=t(\"font-atlas-sdf\"),h=t(\"gl-texture2d\"),f=t(\"color-id\"),d=t(\"ndarray\"),p=t(\"clamp\"),m=t(\"binary-search-bounds\"),g=n.prototype;!function(){function t(){var t=this.plot,u=t.viewBox,c=t.dataBox,h=t.pixelRatio,f=c[2]-c[0],d=c[3]-c[1],p=2/f,m=2/d,g=-c[0]-.5*f,v=-c[1]-.5*d;i[0]=p,a[0]=p-i[0],i[1]=m,a[1]=m-i[1],o[0]=g,s[0]=g-o[0],o[1]=v,s[1]=v-o[1];var y=u[2]-u[0],b=u[3]-u[1];e=Math.min(f/y,d/b),l[0]=2*h/y,l[1]=2*h/b,r=c[0],n=c[2]}var e,r,n,i=new Float32Array([0,0]),a=new Float32Array([0,0]),o=new Float32Array([0,0]),s=new Float32Array([0,0]),l=[0,0],u=[0,0,0,0];g.drawPick=function(l){var c=void 0!==l,h=this.plot,f=this.pointCount,d=f>this.snapThreshold;if(!f)return l;t.call(this);var p=h.gl,g=c?this.pickShader:this.shader,v=p.isEnabled(p.BLEND);if(g.bind(),c){this.pickOffset=l;for(var y=0;y<4;++y)u[y]=l>>8*y&255;g.uniforms.pickOffset=u,this.idBuffer.bind(),g.attributes.id.pointer(p.UNSIGNED_BYTE,!1)}else p.blendFuncSeparate(p.SRC_ALPHA,p.ONE_MINUS_SRC_ALPHA,p.ONE,p.ONE_MINUS_SRC_ALPHA),p.blendColor(0,0,0,1),v||p.enable(p.BLEND),this.colorBuffer.bind(),g.attributes.color.pointer(p.UNSIGNED_BYTE,!1),this.charBuffer.bind(),g.attributes.char.pointer(p.UNSIGNED_BYTE,!1),g.uniforms.chars=this.charTexture.bind(0),g.uniforms.charsShape=[this.charCanvas.width,this.charCanvas.height],g.uniforms.charsStep=this.charStep,g.uniforms.palette=this.paletteTexture.bind(1),g.uniforms.charOffset=this.charOffset;this.sizeBuffer.bind(),g.attributes.size.pointer(p.FLOAT,!1,8,0),c||g.attributes.border.pointer(p.FLOAT,!1,8,4),this.positionBuffer.bind(),g.attributes.positionHi.pointer(p.FLOAT,!1,16,0),g.attributes.positionLo.pointer(p.FLOAT,!1,16,8),g.uniforms.pixelRatio=h.pixelRatio,g.uniforms.scaleHi=i,g.uniforms.scaleLo=a,g.uniforms.translateHi=o,g.uniforms.translateLo=s,g.uniforms.viewBox=h.viewBox;var b=this.scales;if(d)for(var x=b.length-1;x>=0;x--){var _=b[x];if(!(_.pixelSize&&_.pixelSize<1.25*e&&x>1)){var w=_.offset,M=_.count+w,k=m.ge(this.xCoords,r,w,M-1),A=m.lt(this.xCoords,n,k,M-1)+1;A>k&&p.drawArrays(p.POINTS,k,A-k)}}else p.drawArrays(p.POINTS,0,f);if(c)return l+f;v?p.blendFunc(p.ONE,p.ONE_MINUS_SRC_ALPHA):p.disable(p.BLEND)}}(),g.draw=g.drawPick,g.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]]}},g.update=function(t){var e=(t=t||{}).positions||[],r=t.colors||[],n=t.glyphs||[],i=t.sizes||[],a=t.borderWidths||[],o=t.borderColors||[],l=this.plot.gl;null!=t.charOffset&&(this.charOffset=t.charOffset),this.points=e;var h=this.points.length/2,m=s.mallocInt32(h),g=s.mallocFloat32(2*h),v=s.mallocFloat64(2*h);v.set(this.points),this.pointCount=h;var y=h>this.snapThreshold;y&&(this.scales=u(v,m,g));for(var b=s.mallocFloat32(4*h),x=s.mallocFloat32(2*h),_=s.mallocUint8(2*h),w=s.mallocUint32(h),M=s.mallocUint8(2*h),k={},A=[],T=[],S=[],E=0,L=h,C=0;E<L;++E){var z=[255*r[4*E],255*r[4*E+1],255*r[4*E+2],255*r[4*E+3]];null==k[X=f(z,!1)]&&(k[X]=C++,T.push(z[0]),T.push(z[1]),T.push(z[2]),T.push(z[3])),A.push(X),o&&o.length&&(null==k[X=f(z=[255*o[4*E],255*o[4*E+1],255*o[4*E+2],255*o[4*E+3]],!1)]&&(k[X]=C++,T.push(z[0]),T.push(z[1]),T.push(z[2]),T.push(z[3])),S.push(X))}for(var D={},E=0,L=h,C=0;E<L;E++)null==D[Q=n[E]]&&(D[Q]=C++);for(var I=0,E=0,L=i.length;E<L;++E)i[E]>I&&(I=i[E]);var P=this.charStep;this.charStep=p(Math.ceil(4*I),128,768);var O=Object.keys(D),j=this.charStep,R=Math.floor(j/2),F=l.getParameter(l.MAX_TEXTURE_SIZE),N=F/j*(F/j),B=Math.min(F,j*O.length),U=Math.min(F,j*Math.ceil(j*O.length/F)),V=Math.floor(B/j);O.length>N&&console.warn(\"gl-scatter2d-fancy: number of characters is more than maximum texture size. Try reducing it.\"),this.chars&&this.chars+\"\"==O+\"\"&&this.charStep==P||(this.charCanvas=c({canvas:this.charCanvas,family:\"sans-serif\",size:R,shape:[B,U],step:[j,j],chars:O}),this.chars=O);for(E=0;E<h;++E){var H=y?m[E]:E,q=e[2*H],G=e[2*H+1],Y=i[H],W=a[H];b[4*E]=q,b[4*E+1]=G,b[4*E+2]=q-b[4*E],b[4*E+3]=G-b[4*E+1],this.xCoords[E]=q,x[2*E]=2*Y,x[2*E+1]=W,w[E]=H;var X=A[H],Z=k[X];_[2*E]=Z;var J=k[S[H]];_[2*E+1]=J;var Q=n[H],K=D[Q];M[2*E+1]=Math.floor(K/V),M[2*E]=K%V}this.positionBuffer.update(b),this.sizeBuffer.update(x),this.colorBuffer.update(_),this.idBuffer.update(w),this.charBuffer.update(M),this.charTexture.shape=[this.charCanvas.width,this.charCanvas.height],this.charCanvas&&this.charCanvas.width&&this.charTexture.setPixels(this.charCanvas),this.paletteTexture.setPixels(d(T.slice(0,1024),[256,1,4])),s.free(b),s.free(x),s.free(_),s.free(w),s.free(M),s.free(v),s.free(m),s.free(g)},g.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.positionBuffer.dispose(),this.sizeBuffer.dispose(),this.colorBuffer.dispose(),this.idBuffer.dispose(),this.charBuffer.dispose(),this.plot.removeObject(this)}},{\"./lib/shaders\":216,\"binary-search-bounds\":217,clamp:81,\"color-id\":85,\"font-atlas-sdf\":119,\"gl-buffer\":141,\"gl-shader\":218,\"gl-texture2d\":251,ndarray:449,\"snap-points-2d\":226,\"typedarray-pool\":521}],228:[function(t,e,r){r.pointVertex=\"precision highp float;\\n#define GLSLIFY 1\\n\\nattribute vec2 positionHi, positionLo;\\nattribute float weight;\\n\\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\\nuniform float pointSize, useWeight;\\n\\nvarying float fragWeight;\\n\\n\\nvec4 pfx_1_0(vec2 scaleHi, vec2 scaleLo, vec2 translateHi, vec2 translateLo, vec2 positionHi, vec2 positionLo) {\\n  return vec4((positionHi + translateHi) * scaleHi\\n            + (positionLo + translateLo) * scaleHi\\n            + (positionHi + translateHi) * scaleLo\\n            + (positionLo + translateLo) * scaleLo, 0.0, 1.0);\\n}\\n\\nvoid main() {\\n  gl_Position = pfx_1_0(scaleHi, scaleLo, translateHi, translateLo, positionHi, positionLo);\\n  gl_PointSize = pointSize;\\n  fragWeight = mix(1.0, weight, useWeight);\\n}\",r.pointFragment=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec4 color, borderColor;\\nuniform float centerFraction;\\n\\nvarying float fragWeight;\\n\\nfloat smoothStep(float x, float y) {\\n  return 1.0 / (1.0 + exp(50.0*(x - y)));\\n}\\n\\nvoid main() {\\n  float radius = length(2.0*gl_PointCoord.xy-1.0);\\n  if(radius > 1.0) {\\n    discard;\\n  }\\n  vec4 baseColor = mix(borderColor, color, smoothStep(radius, centerFraction));\\n  float alpha = 1.0 - pow(1.0 - baseColor.a, fragWeight);\\n  gl_FragColor = vec4(baseColor.rgb * alpha, alpha);\\n}\",r.pickVertex=\"precision highp float;\\n#define GLSLIFY 1\\n\\nvec4 pfx_1_0(vec2 scaleHi, vec2 scaleLo, vec2 translateHi, vec2 translateLo, vec2 positionHi, vec2 positionLo) {\\n  return vec4((positionHi + translateHi) * scaleHi\\n            + (positionLo + translateLo) * scaleHi\\n            + (positionHi + translateHi) * scaleLo\\n            + (positionLo + translateLo) * scaleLo, 0.0, 1.0);\\n}\\n\\nattribute vec2 positionHi, positionLo;\\nattribute vec4 pickId;\\n\\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\\nuniform float pointSize;\\nuniform vec4 pickOffset;\\n\\nvarying vec4 fragId;\\n\\nvoid main() {\\n\\n  vec4 id = pickId + pickOffset;\\n  id.y += floor(id.x / 256.0);\\n  id.x -= floor(id.x / 256.0) * 256.0;\\n\\n  id.z += floor(id.y / 256.0);\\n  id.y -= floor(id.y / 256.0) * 256.0;\\n\\n  id.w += floor(id.z / 256.0);\\n  id.z -= floor(id.z / 256.0) * 256.0;\\n\\n  gl_Position = pfx_1_0(scaleHi, scaleLo, translateHi, translateLo, positionHi, positionLo);\\n  gl_PointSize = pointSize;\\n  fragId = id;\\n}\",r.pickFragment=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nvarying vec4 fragId;\\n\\nvoid main() {\\n  float radius = length(2.0 * gl_PointCoord.xy - 1.0);\\n  if(radius > 1.0) {\\n    discard;\\n  }\\n  gl_FragColor = fragId / 255.0;\\n}\"},{}],229:[function(t,e,r){arguments[4][77][0].apply(r,arguments)},{dup:77}],230:[function(t,e,r){arguments[4][225][0].apply(r,arguments)},{dup:225}],231:[function(t,e,r){arguments[4][226][0].apply(r,arguments)},{\"./lib/sort\":230,dup:226,\"typedarray-pool\":521}],232:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o){this.plot=t,this.positionBufferHi=e,this.positionBufferLo=r,this.pickBuffer=n,this.weightBuffer=i,this.shader=a,this.pickShader=o,this.scales=[],this.size=12,this.borderSize=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.bounds=[1/0,1/0,-1/0,-1/0],this.pickOffset=0,this.points=null,this.xCoords=null}function i(t,e){var r=t.gl,i=new n(t,o(r),o(r),o(r),o(r),a(r,c.pointVertex,c.pointFragment),a(r,c.pickVertex,c.pickFragment));return i.update(e),t.addObject(i),i}var a=t(\"gl-shader\"),o=t(\"gl-buffer\"),s=t(\"binary-search-bounds\"),l=t(\"snap-points-2d\"),u=t(\"typedarray-pool\"),c=t(\"./lib/shader\");e.exports=i;var h=n.prototype,f=new Float32Array(2),d=new Float32Array(2),p=new Float32Array(2),m=new Float32Array(2),g=[0,0,0,0];h.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.positionBufferHi.dispose(),this.positionBufferLo.dispose(),this.pickBuffer.dispose(),this.xCoords&&u.free(this.xCoords),this.plot.removeObject(this)},h.update=function(t){function e(e,r){return e in t?t[e]:r}t=t||{},this.size=e(\"size\",12),this.color=e(\"color\",[1,0,0,1]).slice(),this.borderSize=e(\"borderSize\",1),this.borderColor=e(\"borderColor\",[0,0,0,1]).slice(),this.xCoords&&u.free(this.xCoords),this.points=t.positions;var r=this.points.length>>>1,n=u.mallocInt32(r),i=u.mallocFloat32(2*r),a=u.mallocFloat64(2*r);a.set(this.points),this.scales=l(a,n,i,this.bounds);var o=u.mallocFloat64(r),s=u.mallocFloat32(2*r),c=u.mallocFloat32(2*r);s.set(a);for(var h=0,f=0;h<r;h++,f+=2)c[f]=a[f]-s[f],c[f+1]=a[f+1]-s[f+1],o[h]=a[f];this.positionBufferHi.update(s),this.positionBufferLo.update(c),this.pickBuffer.update(n),this.weightBuffer.update(i),u.free(n),u.free(a),u.free(s),u.free(c),u.free(i),this.xCoords=o,this.pointCount=r,this.pickOffset=0},h.draw=function(t){var e=void 0!==t,r=this.plot,n=e?this.pickShader:this.shader,i=this.scales,a=this.positionBufferHi,o=this.positionBufferLo,l=this.pickBuffer,u=this.bounds,c=this.size,h=this.borderSize,v=r.gl,y=e?r.pickPixelRatio:r.pixelRatio,b=r.viewBox,x=r.dataBox;if(0===this.pointCount)return t;var _=u[2]-u[0],w=u[3]-u[1],M=x[2]-x[0],k=x[3]-x[1],A=(b[2]-b[0])*y/r.pixelRatio,T=(b[3]-b[1])*y/r.pixelRatio,S=Math.min(M/A,k/T),E=2*_/M,L=2*w/k;f[0]=E,f[1]=L,d[0]=E-f[0],d[1]=L-f[1];var C=(u[0]-x[0]-.5*M)/_,z=(u[1]-x[1]-.5*k)/w;p[0]=C,p[1]=z,m[0]=C-p[0],m[1]=z-p[1],n.bind(),n.uniforms.scaleHi=f,n.uniforms.scaleLo=d,n.uniforms.translateHi=p,n.uniforms.translateLo=m,n.uniforms.color=this.color,n.uniforms.borderColor=this.borderColor,n.uniforms.pointSize=y*(c+h),n.uniforms.centerFraction=0===this.borderSize?2:c/(c+h+1.25),a.bind(),n.attributes.positionHi.pointer(),o.bind(),n.attributes.positionLo.pointer(),e?(this.pickOffset=t,g[0]=255&t,g[1]=t>>8&255,g[2]=t>>16&255,g[3]=t>>24&255,n.uniforms.pickOffset=g,l.bind(),n.attributes.pickId.pointer(v.UNSIGNED_BYTE)):(n.uniforms.useWeight=1,this.weightBuffer.bind(),n.attributes.weight.pointer());for(var D=this.xCoords,I=(x[0]-u[0]-S*c*y)/_,P=(x[2]-u[0]+S*c*y)/_,O=!0,j=i.length-1;j>=0;j--){var R=i[j];if(!(R.pixelSize<S&&j>1)){var F=R.offset,N=R.count+F,B=s.ge(D,I,F,N-1),U=s.lt(D,P,B,N-1)+1;U>B&&v.drawArrays(v.POINTS,B,U-B),!e&&O&&(O=!1,n.uniforms.useWeight=0)}}return t+this.pointCount},h.drawPick=h.draw,h.pick=function(t,e,r){var n=r-this.pickOffset;return n<0||n>=this.pointCount?null:{object:this,pointId:n,dataCoord:[this.points[2*n],this.points[2*n+1]]}}},{\"./lib/shader\":228,\"binary-search-bounds\":229,\"gl-buffer\":141,\"gl-shader\":239,\"snap-points-2d\":231,\"typedarray-pool\":521}],233:[function(t,e,r){\"use strict\";function n(t,e){var r=a[e];if(r||(r=a[e]={}),t in r)return r[t];for(var n=i(t,{textAlign:\"center\",textBaseline:\"middle\",lineHeight:1,font:e}),o=i(t,{triangles:!0,textAlign:\"center\",textBaseline:\"middle\",lineHeight:1,font:e}),s=[[1/0,1/0],[-1/0,-1/0]],l=0;l<n.positions.length;++l)for(var u=n.positions[l],c=0;c<2;++c)s[0][c]=Math.min(s[0][c],u[c]),s[1][c]=Math.max(s[1][c],u[c]);return r[t]=[o,n,s]}var i=t(\"vectorize-text\");e.exports=n;var a={}},{\"vectorize-text\":534}],234:[function(t,e,r){function n(t,e){var r=i(t,e),n=r.attributes;return n.position.location=0,n.color.location=1,n.glyph.location=2,n.id.location=3,r}var i=t(\"gl-shader\"),a=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position;\\nattribute vec4 color;\\nattribute vec2 glyph;\\nattribute vec4 id;\\n\\n\\nuniform vec4 highlightId;\\nuniform float highlightScale;\\nuniform mat4 model, view, projection;\\nuniform vec3 clipBounds[2];\\n\\nvarying vec4 interpColor;\\nvarying vec4 pickId;\\nvarying vec3 dataCoordinate;\\n\\nvoid main() {\\n  if(any(lessThan(position, clipBounds[0]))   || \\n     any(greaterThan(position, clipBounds[1])) ) {\\n    gl_Position = vec4(0,0,0,0);\\n  } else {\\n    float scale = 1.0;\\n    if(distance(highlightId, id) < 0.0001) {\\n      scale = highlightScale;\\n    }\\n\\n    vec4 worldPosition = model * vec4(position, 1);\\n    vec4 viewPosition = view * worldPosition;\\n    viewPosition = viewPosition / viewPosition.w;\\n    vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\\n    \\n    gl_Position = clipPosition;\\n    interpColor = color;\\n    pickId = id;\\n    dataCoordinate = position;\\n  }\\n}\",o=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position;\\nattribute vec4 color;\\nattribute vec2 glyph;\\nattribute vec4 id;\\n\\nuniform mat4 model, view, projection;\\nuniform vec2 screenSize;\\nuniform vec3 clipBounds[2];\\nuniform float highlightScale, pixelRatio;\\nuniform vec4 highlightId;\\n\\nvarying vec4 interpColor;\\nvarying vec4 pickId;\\nvarying vec3 dataCoordinate;\\n\\nvoid main() {\\n  if(any(lessThan(position, clipBounds[0])) || any(greaterThan(position, clipBounds[1]))) {\\n    gl_Position = vec4(0,0,0,0);\\n  } else {\\n    float scale = pixelRatio;\\n    if(distance(highlightId.bgr, id.bgr) < 0.001) {\\n      scale *= highlightScale;\\n    }\\n\\n    vec4 worldPosition = model * vec4(position, 1.0);\\n    vec4 viewPosition = view * worldPosition;\\n    vec4 clipPosition = projection * viewPosition;\\n    clipPosition /= clipPosition.w;\\n    \\n    gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\\n    interpColor = color;\\n    pickId = id;\\n    dataCoordinate = position;\\n  }\\n}\",s=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position;\\nattribute vec4 color;\\nattribute vec2 glyph;\\nattribute vec4 id;\\n\\nuniform float highlightScale;\\nuniform vec4 highlightId;\\nuniform vec3 axes[2];\\nuniform mat4 model, view, projection;\\nuniform vec2 screenSize;\\nuniform vec3 clipBounds[2];\\nuniform float scale, pixelRatio;\\n\\nvarying vec4 interpColor;\\nvarying vec4 pickId;\\nvarying vec3 dataCoordinate;\\n\\nvoid main() {\\n  if(any(lessThan(position, clipBounds[0]))   ||\\n     any(greaterThan(position, clipBounds[1])) ) {\\n    gl_Position = vec4(0,0,0,0);\\n  } else {\\n    float lscale = pixelRatio * scale;\\n    if(distance(highlightId, id) < 0.0001) {\\n      lscale *= highlightScale;\\n    }\\n\\n    vec4 clipCenter   = projection * view * model * vec4(position, 1);\\n    vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\\n    vec4 clipPosition = projection * view * model * vec4(dataPosition, 1);\\n\\n    gl_Position = clipPosition;\\n    interpColor = color;\\n    pickId = id;\\n    dataCoordinate = dataPosition;\\n  }\\n}\\n\",l=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec3 fragClipBounds[2];\\nuniform float opacity;\\n\\nvarying vec4 interpColor;\\nvarying vec4 pickId;\\nvarying vec3 dataCoordinate;\\n\\nvoid main() {\\n  if(any(lessThan(dataCoordinate, fragClipBounds[0]))   ||\\n     any(greaterThan(dataCoordinate, fragClipBounds[1])) ) {\\n    discard;\\n  } else {\\n    gl_FragColor = interpColor * opacity;\\n  }\\n}\\n\",u=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec3 fragClipBounds[2];\\nuniform float pickGroup;\\n\\nvarying vec4 pickId;\\nvarying vec3 dataCoordinate;\\n\\nvoid main() {\\n  if(any(lessThan(dataCoordinate, fragClipBounds[0]))   || \\n     any(greaterThan(dataCoordinate, fragClipBounds[1])) ) {\\n    discard;\\n  } else {\\n    gl_FragColor = vec4(pickGroup, pickId.bgr);\\n  }\\n}\",c=[{name:\"position\",type:\"vec3\"},{name:\"color\",type:\"vec4\"},{name:\"glyph\",type:\"vec2\"},{name:\"id\",type:\"vec4\"}],h={vertex:a,fragment:l,attributes:c},f={vertex:o,fragment:l,attributes:c},d={vertex:s,fragment:l,attributes:c},p={vertex:a,fragment:u,attributes:c},m={vertex:o,fragment:u,attributes:c},g={vertex:s,fragment:u,attributes:c};r.createPerspective=function(t){return n(t,h)},r.createOrtho=function(t){return n(t,f)},r.createProject=function(t){return n(t,d)},r.createPickPerspective=function(t){return n(t,p)},r.createPickOrtho=function(t){return n(t,m)},r.createPickProject=function(t){return n(t,g)}},{\"gl-shader\":239}],235:[function(t,e,r){\"use strict\";function n(t,e){var r=t[0],n=t[1],i=t[2],a=t[3];return t[0]=e[0]*r+e[4]*n+e[8]*i+e[12]*a,t[1]=e[1]*r+e[5]*n+e[9]*i+e[13]*a,t[2]=e[2]*r+e[6]*n+e[10]*i+e[14]*a,t[3]=e[3]*r+e[7]*n+e[11]*i+e[15]*a,t}function i(t,e,r,i){return n(i,i,r),n(i,i,e),n(i,i,t)}function a(t,e){this.index=t,this.dataCoordinate=this.position=e}function o(t,e,r,n,i,o,s,l,u,c,h,f){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=o,this.glyphBuffer=s,this.idBuffer=l,this.vao=u,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.pickId=0,this.pickPerspectiveShader=c,this.pickOrthoShader=h,this.pickProjectShader=f,this.points=[],this._selectResult=new a(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}function s(t){return t[0]=t[1]=t[2]=0,t}function l(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function u(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function c(t){for(var e=L,r=0;r<2;++r)for(var n=0;n<3;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}function h(t,e,r,n,a){var o,h=e.axesProject,f=e.gl,d=t.uniforms,p=r.model||x,m=r.view||x,g=r.projection||x,y=e.axesBounds,b=c(e.clipBounds);o=e.axes?e.axes.lastCubeProps.axis:[1,1,1],w[0]=2/f.drawingBufferWidth,w[1]=2/f.drawingBufferHeight,t.bind(),d.view=m,d.projection=g,d.screenSize=w,d.highlightId=e.highlightId,d.highlightScale=e.highlightScale,d.clipBounds=b,d.pickGroup=e.pickId/255,d.pixelRatio=e.pixelRatio;for(var _=0;_<3;++_)if(h[_]&&e.projectOpacity[_]<1===n){d.scale=e.projectScale[_],d.opacity=e.projectOpacity[_];for(var L=S,C=0;C<16;++C)L[C]=0;for(C=0;C<4;++C)L[5*C]=1;L[5*_]=0,o[_]<0?L[12+_]=y[0][_]:L[12+_]=y[1][_],v(L,p,L),d.model=L;var z=(_+1)%3,D=(_+2)%3,I=s(M),P=s(k);I[z]=1,P[D]=1;var O=i(g,m,p,l(A,I)),j=i(g,m,p,l(T,P));if(Math.abs(O[1])>Math.abs(j[1])){var R=O;O=j,j=R,R=I,I=P,P=R;var F=z;z=D,D=F}O[0]<0&&(I[z]=-1),j[1]>0&&(P[D]=-1);for(var N=0,B=0,C=0;C<4;++C)N+=Math.pow(p[4*z+C],2),B+=Math.pow(p[4*D+C],2);I[z]/=Math.sqrt(N),P[D]/=Math.sqrt(B),d.axes[0]=I,d.axes[1]=P,d.fragClipBounds[0]=u(E,b[0],_,-1e8),d.fragClipBounds[1]=u(E,b[1],_,1e8),e.vao.draw(f.TRIANGLES,e.vertexCount),e.lineWidth>0&&(f.lineWidth(e.lineWidth),e.vao.draw(f.LINES,e.lineVertexCount,e.vertexCount))}}function f(t,e,r,n,i,a){var o=r.gl;if(r.vao.bind(),i===r.opacity<1||a){t.bind();var s=t.uniforms;s.model=n.model||x,s.view=n.view||x,s.projection=n.projection||x,w[0]=2/o.drawingBufferWidth,w[1]=2/o.drawingBufferHeight,s.screenSize=w,s.highlightId=r.highlightId,s.highlightScale=r.highlightScale,s.fragClipBounds=C,s.clipBounds=r.axes.bounds,s.opacity=r.opacity,s.pickGroup=r.pickId/255,s.pixelRatio=r.pixelRatio,r.vao.draw(o.TRIANGLES,r.vertexCount),r.lineWidth>0&&(o.lineWidth(r.lineWidth),r.vao.draw(o.LINES,r.lineVertexCount,r.vertexCount))}h(e,r,n,i,a),r.vao.unbind()}function d(t){var e=t.gl,r=y.createPerspective(e),n=y.createOrtho(e),i=y.createProject(e),a=y.createPickPerspective(e),s=y.createPickOrtho(e),l=y.createPickProject(e),u=p(e),c=p(e),h=p(e),f=p(e),d=new o(e,r,n,i,u,c,h,f,m(e,[{buffer:u,size:3,type:e.FLOAT},{buffer:c,size:4,type:e.FLOAT},{buffer:h,size:2,type:e.FLOAT},{buffer:f,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),a,s,l);return d.update(t),d}var p=t(\"gl-buffer\"),m=t(\"gl-vao\"),g=t(\"typedarray-pool\"),v=t(\"gl-mat4/multiply\"),y=t(\"./lib/shaders\"),b=t(\"./lib/glyphs\"),x=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];e.exports=d;var _=o.prototype;_.pickSlots=1,_.setPickBase=function(t){this.pickId=t},_.isTransparent=function(){if(this.opacity<1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]<1)return!0;return!1},_.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var w=[0,0],M=[0,0,0],k=[0,0,0],A=[0,0,0,1],T=[0,0,0,1],S=x.slice(),E=[0,0,0],L=[[0,0,0],[0,0,0]],C=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];_.draw=function(t){f(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!1,!1)},_.drawTransparent=function(t){f(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!0,!1)},_.drawPick=function(t){f(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,!1,!0)},_.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(e>=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},_.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},_.update=function(t){if(\"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{r=+t.projectScale;this.projectScale=[r,r,r]}if(\"projectOpacity\"in t)if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{var r=+t.projectOpacity;this.projectOpacity=[r,r,r]}\"opacity\"in t&&(this.opacity=t.opacity),this.dirty=!0;var n=t.position;if(n){var i=t.font||\"normal\",a=t.alignment||[0,0],o=[1/0,1/0,1/0],s=[-1/0,-1/0,-1/0],l=t.glyph,u=t.color,c=t.size,h=t.angle,f=t.lineColor,d=0,p=0,m=0,v=n.length;t:for(j=0;j<v;++j){for(var y=n[j],x=0;x<3;++x)if(isNaN(y[x])||!isFinite(y[x]))continue t;var _=(R=Array.isArray(l)?b(l[j],i):l?b(l,i):b(\"●\",i))[0],w=R[1],M=R[2];p+=3*_.cells.length,m+=2*w.edges.length}var k=p+m,A=g.mallocFloat(3*k),T=g.mallocFloat(4*k),S=g.mallocFloat(2*k),E=g.mallocUint32(k),L=[0,a[1]],C=0,z=p,D=[0,0,0,1],I=[0,0,0,1],P=Array.isArray(u)&&Array.isArray(u[0]),O=Array.isArray(f)&&Array.isArray(f[0]);t:for(var j=0;j<v;++j){for(var y=n[j],x=0;x<3;++x){if(isNaN(y[x])||!isFinite(y[x])){d+=1;continue t}s[x]=Math.max(s[x],y[x]),o[x]=Math.min(o[x],y[x])}var R,_=(R=Array.isArray(l)?b(l[j],i):l?b(l,i):b(\"●\",i))[0],w=R[1],M=R[2];if(Array.isArray(u)){if(3===(F=P?u[j]:u).length){for(x=0;x<3;++x)D[x]=F[x];D[3]=1}else if(4===F.length)for(x=0;x<4;++x)D[x]=F[x]}else D[0]=D[1]=D[2]=0,D[3]=1;if(Array.isArray(f)){var F;if(3===(F=O?f[j]:f).length){for(x=0;x<3;++x)I[x]=F[x];I[x]=1}else if(4===F.length)for(x=0;x<4;++x)I[x]=F[x]}else I[0]=I[1]=I[2]=0,I[3]=1;var N=.5;Array.isArray(c)?N=+c[j]:c?N=+c:this.useOrtho&&(N=12);var B=0;Array.isArray(h)?B=+h[j]:h&&(B=+h);for(var U=Math.cos(B),V=Math.sin(B),y=n[j],x=0;x<3;++x)s[x]=Math.max(s[x],y[x]),o[x]=Math.min(o[x],y[x]);a[0]<0?L[0]=a[0]*(1+M[1][0]):a[0]>0&&(L[0]=-a[0]*(1+M[0][0]));for(var H=_.cells,q=_.positions,x=0;x<H.length;++x)for(var G=H[x],Y=0;Y<3;++Y){for(W=0;W<3;++W)A[3*C+W]=y[W];for(W=0;W<4;++W)T[4*C+W]=D[W];E[C]=d;X=q[G[Y]];S[2*C]=N*(U*X[0]-V*X[1]+L[0]),S[2*C+1]=N*(V*X[0]+U*X[1]+L[1]),C+=1}for(var H=w.edges,q=w.positions,x=0;x<H.length;++x)for(var G=H[x],Y=0;Y<2;++Y){for(W=0;W<3;++W)A[3*z+W]=y[W];for(var W=0;W<4;++W)T[4*z+W]=I[W];E[z]=d;var X=q[G[Y]];S[2*z]=N*(U*X[0]-V*X[1]+L[0]),S[2*z+1]=N*(V*X[0]+U*X[1]+L[1]),z+=1}d+=1}this.vertexCount=p,this.lineVertexCount=m,this.pointBuffer.update(A),this.colorBuffer.update(T),this.glyphBuffer.update(S),this.idBuffer.update(new Uint32Array(E)),g.free(A),g.free(T),g.free(S),g.free(E),this.bounds=[o,s],this.points=n,this.pointCount=n.length}},_.dispose=function(){this.shader.dispose(),this.orthoShader.dispose(),this.pickPerspectiveShader.dispose(),this.pickOrthoShader.dispose(),this.vao.dispose(),this.pointBuffer.dispose(),this.colorBuffer.dispose(),this.glyphBuffer.dispose(),this.idBuffer.dispose()}},{\"./lib/glyphs\":233,\"./lib/shaders\":234,\"gl-buffer\":141,\"gl-mat4/multiply\":167,\"gl-vao\":255,\"typedarray-pool\":521}],236:[function(t,e,r){\"use strict\";r.boxVertex=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec2 vertex;\\n\\nuniform vec2 cornerA, cornerB;\\n\\nvoid main() {\\n  gl_Position = vec4(mix(cornerA, cornerB, vertex), 0, 1);\\n}\\n\",r.boxFragment=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec4 color;\\n\\nvoid main() {\\n  gl_FragColor = color;\\n}\\n\"},{}],237:[function(t,e,r){\"use strict\";function n(t,e,r){this.plot=t,this.boxBuffer=e,this.boxShader=r,this.enabled=!0,this.selectBox=[1/0,1/0,-1/0,-1/0],this.borderColor=[0,0,0,1],this.innerFill=!1,this.innerColor=[0,0,0,.25],this.outerFill=!0,this.outerColor=[0,0,0,.5],this.borderWidth=10}function i(t,e){var r=t.gl,i=new n(t,o(r,[0,0,0,1,1,0,1,1]),a(r,s.boxVertex,s.boxFragment));return i.update(e),t.addOverlay(i),i}var a=t(\"gl-shader\"),o=t(\"gl-buffer\"),s=t(\"./lib/shaders\");e.exports=i;var l=n.prototype;l.draw=function(){if(this.enabled){var t=this.plot,e=this.selectBox,r=this.borderWidth,n=(this.innerFill,this.innerColor),i=(this.outerFill,this.outerColor),a=this.borderColor,o=t.box,s=t.screenBox,l=t.dataBox,u=t.viewBox,c=t.pixelRatio,h=(e[0]-l[0])*(u[2]-u[0])/(l[2]-l[0])+u[0],f=(e[1]-l[1])*(u[3]-u[1])/(l[3]-l[1])+u[1],d=(e[2]-l[0])*(u[2]-u[0])/(l[2]-l[0])+u[0],p=(e[3]-l[1])*(u[3]-u[1])/(l[3]-l[1])+u[1];if(h=Math.max(h,u[0]),f=Math.max(f,u[1]),d=Math.min(d,u[2]),p=Math.min(p,u[3]),!(d<h||p<f)){o.bind();var m=s[2]-s[0],g=s[3]-s[1];if(this.outerFill&&(o.drawBox(0,0,m,f,i),o.drawBox(0,f,h,p,i),o.drawBox(0,p,m,g,i),o.drawBox(d,f,m,p,i)),this.innerFill&&o.drawBox(h,f,d,p,n),r>0){var v=r*c;o.drawBox(h-v,f-v,d+v,f+v,a),o.drawBox(h-v,p-v,d+v,p+v,a),o.drawBox(h-v,f-v,h+v,p+v,a),o.drawBox(d-v,f-v,d+v,p+v,a)}}}},l.update=function(t){t=t||{},this.innerFill=!!t.innerFill,this.outerFill=!!t.outerFill,this.innerColor=(t.innerColor||[0,0,0,.5]).slice(),this.outerColor=(t.outerColor||[0,0,0,.5]).slice(),this.borderColor=(t.borderColor||[0,0,0,1]).slice(),this.borderWidth=t.borderWidth||0,this.selectBox=(t.selectBox||this.selectBox).slice()},l.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{\"./lib/shaders\":236,\"gl-buffer\":141,\"gl-shader\":239}],238:[function(t,e,r){\"use strict\";function n(t,e,r,n,i){this.coord=[t,e],this.id=r,this.value=n,this.distance=i}function i(t,e,r){this.gl=t,this.fbo=e,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}function a(t,e){return new i(t,o(t,e),s.mallocUint8(e[0]*e[1]*4))}e.exports=a;var o=t(\"gl-fbo\"),s=t(\"typedarray-pool\"),l=t(\"ndarray\"),u=t(\"bit-twiddle\").nextPow2,c=t(\"cwise/lib/wrapper\")({args:[\"array\",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},\"scalar\",\"scalar\",\"index\"],pre:{body:\"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}\",args:[],thisVars:[\"this_closestD2\",\"this_closestX\",\"this_closestY\"],localVars:[]},body:{body:\"{if(_inline_46_arg0_<255||_inline_46_arg1_<255||_inline_46_arg2_<255||_inline_46_arg3_<255){var _inline_46_l=_inline_46_arg4_-_inline_46_arg6_[0],_inline_46_a=_inline_46_arg5_-_inline_46_arg6_[1],_inline_46_f=_inline_46_l*_inline_46_l+_inline_46_a*_inline_46_a;_inline_46_f<this_closestD2&&(this_closestD2=_inline_46_f,this_closestX=_inline_46_arg6_[0],this_closestY=_inline_46_arg6_[1])}}\",args:[{name:\"_inline_46_arg0_\",lvalue:!1,rvalue:!0,count:1},{name:\"_inline_46_arg1_\",lvalue:!1,rvalue:!0,count:1},{name:\"_inline_46_arg2_\",lvalue:!1,rvalue:!0,count:1},{name:\"_inline_46_arg3_\",lvalue:!1,rvalue:!0,count:1},{name:\"_inline_46_arg4_\",lvalue:!1,rvalue:!0,count:1},{name:\"_inline_46_arg5_\",lvalue:!1,rvalue:!0,count:1},{name:\"_inline_46_arg6_\",lvalue:!1,rvalue:!0,count:4}],thisVars:[\"this_closestD2\",\"this_closestX\",\"this_closestY\"],localVars:[\"_inline_46_a\",\"_inline_46_f\",\"_inline_46_l\"]},post:{body:\"{return[this_closestX,this_closestY,this_closestD2]}\",args:[],thisVars:[\"this_closestD2\",\"this_closestX\",\"this_closestY\"],localVars:[]},debug:!1,funcName:\"cwise\",blockSize:64}),h=i.prototype;Object.defineProperty(h,\"shape\",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(t){if(this.gl){this.fbo.shape=t;var e=this.fbo.shape[0],r=this.fbo.shape[1];if(r*e*4>this.buffer.length){s.free(this.buffer);for(var n=this.buffer=s.mallocUint8(u(r*e*4)),i=0;i<r*e*4;++i)n[i]=255}return t}}}),h.begin=function(){var t=this.gl;this.shape;t&&(this.fbo.bind(),t.clearColor(1,1,1,1),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT))},h.end=function(){var t=this.gl;t&&(t.bindFramebuffer(t.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},h.query=function(t,e,r){if(!this.gl)return null;var i=this.fbo.shape.slice();t|=0,e|=0,\"number\"!=typeof r&&(r=1);var a=0|Math.min(Math.max(t-r,0),i[0]),o=0|Math.min(Math.max(t+r,0),i[0]),s=0|Math.min(Math.max(e-r,0),i[1]),u=0|Math.min(Math.max(e+r,0),i[1]);if(o<=a||u<=s)return null;var h=[o-a,u-s],f=l(this.buffer,[h[0],h[1],4],[4,4*i[0],1],4*(a+i[0]*s)),d=c(f.hi(h[0],h[1],1),r,r),p=d[0],m=d[1];return p<0||Math.pow(this.radius,2)<d[2]?null:new n(p+a|0,m+s|0,f.get(p,m,0),[f.get(p,m,1),f.get(p,m,2),f.get(p,m,3)],Math.sqrt(d[2]))},h.dispose=function(){this.gl&&(this.fbo.dispose(),s.free(this.buffer),this.gl=null,this._readTimeout&&clearTimeout(this._readTimeout))}},{\"bit-twiddle\":60,\"cwise/lib/wrapper\":106,\"gl-fbo\":148,ndarray:449,\"typedarray-pool\":521}],239:[function(t,e,r){\"use strict\";function n(t){this.gl=t,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}function i(t,e){return t.name<e.name?-1:1}function a(t,e,r,i,a){var o=new n(t);return o.update(e,r,i,a),o}var o=t(\"./lib/create-uniforms\"),s=t(\"./lib/create-attributes\"),l=t(\"./lib/reflect\"),u=t(\"./lib/shader-cache\"),c=t(\"./lib/runtime-reflect\"),h=t(\"./lib/GLError\"),f=n.prototype;f.bind=function(){this.program||this._relink(),this.gl.useProgram(this.program)},f.dispose=function(){this._fref&&this._fref.dispose(),this._vref&&this._vref.dispose(),this.attributes=this.types=this.vertShader=this.fragShader=this.program=this._relink=this._fref=this._vref=null},f.update=function(t,e,r,n){function a(){d.program=u.program(p,d._vref,d._fref,x,_);for(var t=0;t<r.length;++t)E[t]=p.getUniformLocation(d.program,r[t].name)}if(!e||1===arguments.length){var f=t;t=f.vertex,e=f.fragment,r=f.uniforms,n=f.attributes}var d=this,p=d.gl,m=d._vref;d._vref=u.shader(p,p.VERTEX_SHADER,t),m&&m.dispose(),d.vertShader=d._vref.shader;var g=this._fref;if(d._fref=u.shader(p,p.FRAGMENT_SHADER,e),g&&g.dispose(),d.fragShader=d._fref.shader,!r||!n){var v=p.createProgram();if(p.attachShader(v,d.fragShader),p.attachShader(v,d.vertShader),p.linkProgram(v),!p.getProgramParameter(v,p.LINK_STATUS)){var y=p.getProgramInfoLog(v);throw new h(y,\"Error linking program:\"+y)}r=r||c.uniforms(p,v),n=n||c.attributes(p,v),p.deleteProgram(v)}(n=n.slice()).sort(i);for(var b=[],x=[],_=[],w=0;w<n.length;++w){var M=n[w];if(M.type.indexOf(\"mat\")>=0){for(var k=0|M.type.charAt(M.type.length-1),A=new Array(k),T=0;T<k;++T)A[T]=_.length,x.push(M.name+\"[\"+T+\"]\"),\"number\"==typeof M.location?_.push(M.location+T):Array.isArray(M.location)&&M.location.length===k&&\"number\"==typeof M.location[T]?_.push(0|M.location[T]):_.push(-1);b.push({name:M.name,type:M.type,locations:A})}else b.push({name:M.name,type:M.type,locations:[_.length]}),x.push(M.name),\"number\"==typeof M.location?_.push(0|M.location):_.push(-1)}for(var S=0,w=0;w<_.length;++w)if(_[w]<0){for(;_.indexOf(S)>=0;)S+=1;_[w]=S}var E=new Array(r.length);a(),d._relink=a,d.types={uniforms:l(r),attributes:l(n)},d.attributes=s(p,d,b,_),Object.defineProperty(d,\"uniforms\",o(p,d,r,E))},e.exports=a},{\"./lib/GLError\":240,\"./lib/create-attributes\":241,\"./lib/create-uniforms\":242,\"./lib/reflect\":243,\"./lib/runtime-reflect\":244,\"./lib/shader-cache\":245}],240:[function(t,e,r){arguments[4][197][0].apply(r,arguments)},{dup:197}],241:[function(t,e,r){arguments[4][198][0].apply(r,arguments)},{\"./GLError\":240,dup:198}],242:[function(t,e,r){arguments[4][199][0].apply(r,arguments)},{\"./GLError\":240,\"./reflect\":243,dup:199}],243:[function(t,e,r){arguments[4][200][0].apply(r,arguments)},{dup:200}],244:[function(t,e,r){arguments[4][201][0].apply(r,arguments)},{dup:201}],245:[function(t,e,r){arguments[4][202][0].apply(r,arguments)},{\"./GLError\":240,dup:202,\"gl-format-compiler-error\":149,\"weakmap-shim\":542}],246:[function(t,e,r){\"use strict\";function n(t){this.plot=t,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}function i(t,e){var r=new n(t);return r.update(e),t.addOverlay(r),r}e.exports=i;var a=n.prototype;a.update=function(t){t=t||{},this.enable=(t.enable||[!0,!0,!1,!1]).slice(),this.width=(t.width||[1,1,1,1]).slice(),this.color=(t.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map(function(t){return t.slice()}),this.center=(t.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},a.draw=function(){var t=this.enable,e=this.width,r=this.color,n=this.center,i=this.plot,a=i.line,o=i.dataBox,s=i.viewBox;if(a.bind(),o[0]<=n[0]&&n[0]<=o[2]&&o[1]<=n[1]&&n[1]<=o[3]){var l=s[0]+(n[0]-o[0])/(o[2]-o[0])*(s[2]-s[0]),u=s[1]+(n[1]-o[1])/(o[3]-o[1])*(s[3]-s[1]);t[0]&&a.drawLine(l,u,s[0],u,e[0],r[0]),t[1]&&a.drawLine(l,u,l,s[1],e[1],r[1]),t[2]&&a.drawLine(l,u,s[2],u,e[2],r[2]),t[3]&&a.drawLine(l,u,l,s[3],e[3],r[3])}},a.dispose=function(){this.plot.removeOverlay(this)}},{}],247:[function(t,e,r){\"use strict\";var n=t(\"gl-shader\");e.exports=function(t){return n(t,\"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\",\"precision mediump float;\\n#define GLSLIFY 1\\n\\nvarying vec4 fragColor;\\n\\nvoid main() {\\n  gl_FragColor = fragColor;\\n}\",null,[{name:\"position\",type:\"vec3\"},{name:\"color\",type:\"vec3\"},{name:\"weight\",type:\"float\"}])}},{\"gl-shader\":239}],248:[function(t,e,r){\"use strict\";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}function i(t,e){function r(t,e,r,n,a,o){var s=[t,e,r,0,0,0,1];s[n+3]=1,s[n]=a,i.push.apply(i,s),s[6]=-1,i.push.apply(i,s),s[n]=o,i.push.apply(i,s),i.push.apply(i,s),s[6]=1,i.push.apply(i,s),s[n]=a,i.push.apply(i,s)}var i=[];r(0,0,0,0,0,1),r(0,0,0,1,0,1),r(0,0,0,2,0,1),r(1,0,0,1,-1,1),r(1,0,0,2,-1,1),r(0,1,0,0,-1,1),r(0,1,0,2,-1,1),r(0,0,1,0,-1,1),r(0,0,1,1,-1,1);var l=a(t,i),u=o(t,[{type:t.FLOAT,buffer:l,size:3,offset:0,stride:28},{type:t.FLOAT,buffer:l,size:3,offset:12,stride:28},{type:t.FLOAT,buffer:l,size:1,offset:24,stride:28}]),c=s(t);c.attributes.position.location=0,c.attributes.color.location=1,c.attributes.weight.location=2;var h=new n(t,l,u,c);return h.update(e),h}var a=t(\"gl-buffer\"),o=t(\"gl-vao\"),s=t(\"./shaders/index\");e.exports=i;var l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],u=n.prototype,c=[0,0,0],h=[0,0,0],f=[0,0];u.isTransparent=function(){return!1},u.drawTransparent=function(t){},u.draw=function(t){var e=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var i,a=t.model||l,o=t.view||l,s=t.projection||l;this.axes&&(i=this.axes.lastCubeProps.axis);for(var u=c,d=h,p=0;p<3;++p)i&&i[p]<0?(u[p]=this.bounds[0][p],d[p]=this.bounds[1][p]):(u[p]=this.bounds[1][p],d[p]=this.bounds[0][p]);f[0]=e.drawingBufferWidth,f[1]=e.drawingBufferHeight,n.uniforms.model=a,n.uniforms.view=o,n.uniforms.projection=s,n.uniforms.coordinates=[this.position,u,d],n.uniforms.colors=this.colors,n.uniforms.screenShape=f;for(p=0;p<3;++p)n.uniforms.lineWidth=this.lineWidth[p]*this.pixelRatio,this.enabled[p]&&(r.draw(e.TRIANGLES,6,6*p),this.drawSides[p]&&r.draw(e.TRIANGLES,12,18+12*p));r.unbind()},u.update=function(t){t&&(\"bounds\"in t&&(this.bounds=t.bounds),\"position\"in t&&(this.position=t.position),\"lineWidth\"in t&&(this.lineWidth=t.lineWidth),\"colors\"in t&&(this.colors=t.colors),\"enabled\"in t&&(this.enabled=t.enabled),\"drawSides\"in t&&(this.drawSides=t.drawSides))},u.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{\"./shaders/index\":247,\"gl-buffer\":141,\"gl-vao\":255}],249:[function(t,e,r){var n=t(\"gl-shader\"),i=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec4 uv;\\nattribute vec3 f;\\nattribute vec3 normal;\\n\\nuniform mat4 model, view, projection, inverseModel;\\nuniform vec3 lightPosition, eyePosition;\\nuniform sampler2D colormap;\\n\\nvarying float value, kill;\\nvarying vec3 worldCoordinate;\\nvarying vec2 planeCoordinate;\\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\\nvarying vec4 vColor;\\n\\nvoid main() {\\n  worldCoordinate = vec3(uv.zw, f.x);\\n  vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\\n  vec4 clipPosition = projection * view * worldPosition;\\n  gl_Position = clipPosition;\\n  kill = f.y;\\n  value = f.z;\\n  planeCoordinate = uv.xy;\\n\\n  vColor = texture2D(colormap, vec2(value, value));\\n\\n  //Lighting geometry parameters\\n  vec4 cameraCoordinate = view * worldPosition;\\n  cameraCoordinate.xyz /= cameraCoordinate.w;\\n  lightDirection = lightPosition - cameraCoordinate.xyz;\\n  eyeDirection   = eyePosition - cameraCoordinate.xyz;\\n  surfaceNormal  = normalize((vec4(normal,0) * inverseModel).xyz);\\n}\\n\",a=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nfloat beckmannDistribution_2_0(float x, float roughness) {\\n  float NdotH = max(x, 0.0001);\\n  float cos2Alpha = NdotH * NdotH;\\n  float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\\n  float roughness2 = roughness * roughness;\\n  float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\\n  return exp(tan2Alpha / roughness2) / denom;\\n}\\n\\n\\n\\nfloat beckmannSpecular_1_1(\\n  vec3 lightDirection,\\n  vec3 viewDirection,\\n  vec3 surfaceNormal,\\n  float roughness) {\\n  return beckmannDistribution_2_0(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\\n}\\n\\n\\n\\nuniform vec3 lowerBound, upperBound;\\nuniform float contourTint;\\nuniform vec4 contourColor;\\nuniform sampler2D colormap;\\nuniform vec3 clipBounds[2];\\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\\nuniform float vertexColor;\\n\\nvarying float value, kill;\\nvarying vec3 worldCoordinate;\\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\\nvarying vec4 vColor;\\n\\nvoid main() {\\n  if (kill > 0.0 ||\\n    any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\\n    discard;\\n  }\\n\\n  vec3 N = normalize(surfaceNormal);\\n  vec3 V = normalize(eyeDirection);\\n  vec3 L = normalize(lightDirection);\\n\\n  if(gl_FrontFacing) {\\n    N = -N;\\n  }\\n\\n  float specular = beckmannSpecular_1_1(L, V, N, roughness);\\n  float diffuse  = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\\n\\n  //decide how to interpolate color — in vertex or in fragment\\n  vec4 surfaceColor = step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + step(.5, vertexColor) * vColor;\\n\\n  vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular,  1.0);\\n\\n  gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\\n}\\n\",o=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec4 uv;\\nattribute float f;\\n\\nuniform mat3 permutation;\\nuniform mat4 model, view, projection;\\nuniform float height, zOffset;\\nuniform sampler2D colormap;\\n\\nvarying float value, kill;\\nvarying vec3 worldCoordinate;\\nvarying vec2 planeCoordinate;\\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\\nvarying vec4 vColor;\\n\\nvoid main() {\\n  vec3 dataCoordinate = permutation * vec3(uv.xy, height);\\n  vec4 worldPosition = model * vec4(dataCoordinate, 1.0);\\n\\n  vec4 clipPosition = projection * view * worldPosition;\\n  clipPosition.z = clipPosition.z + zOffset;\\n\\n  gl_Position = clipPosition;\\n  value = f;\\n  kill = -1.0;\\n  worldCoordinate = dataCoordinate;\\n  planeCoordinate = uv.zw;\\n\\n  vColor = texture2D(colormap, vec2(value, value));\\n\\n  //Don't do lighting for contours\\n  surfaceNormal   = vec3(1,0,0);\\n  eyeDirection    = vec3(0,1,0);\\n  lightDirection  = vec3(0,0,1);\\n}\\n\",s=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec2 shape;\\nuniform vec3 clipBounds[2];\\nuniform float pickId;\\n\\nvarying float value, kill;\\nvarying vec3 worldCoordinate;\\nvarying vec2 planeCoordinate;\\nvarying vec3 surfaceNormal;\\n\\nvec2 splitFloat(float v) {\\n  float vh = 255.0 * v;\\n  float upper = floor(vh);\\n  float lower = fract(vh);\\n  return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\\n}\\n\\nvoid main() {\\n  if(kill > 0.0 ||\\n    any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\\n    discard;\\n  }\\n  vec2 ux = splitFloat(planeCoordinate.x / shape.x);\\n  vec2 uy = splitFloat(planeCoordinate.y / shape.y);\\n  gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\\n}\\n\";r.createShader=function(t){var e=n(t,i,a,null,[{name:\"uv\",type:\"vec4\"},{name:\"f\",type:\"vec3\"},{name:\"normal\",type:\"vec3\"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createPickShader=function(t){var e=n(t,i,s,null,[{name:\"uv\",type:\"vec4\"},{name:\"f\",type:\"vec3\"},{name:\"normal\",type:\"vec3\"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createContourShader=function(t){var e=n(t,o,a,null,[{name:\"uv\",type:\"vec4\"},{name:\"f\",type:\"float\"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,o,s,null,[{name:\"uv\",type:\"vec4\"},{name:\"f\",type:\"float\"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{\"gl-shader\":239}],250:[function(t,e,r){\"use strict\";function n(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}function i(t){var e=x([y({colormap:t,nshades:j,format:\"rgba\"}).map(function(t){return[t[0],t[1],t[2],255*t[3]]})]);return b.divseq(e,255),e}function a(t,e,r,i,a,o,s,l,u,c,h,f,d,p){this.gl=t,this.shape=e,this.bounds=r,this.intensityBounds=[],this._shader=i,this._pickShader=a,this._coordinateBuffer=o,this._vao=s,this._colorMap=l,this._contourShader=u,this._contourPickShader=c,this._contourBuffer=h,this._contourVAO=f,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new n([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=p,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[_(v.mallocFloat(1024),[0,0]),_(v.mallocFloat(1024),[0,0]),_(v.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}function o(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||F,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=N.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(a[r]>0)][r],M(l,t.model,l);var u=N.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)u[i][n]=t.clipBounds[i][n];u[0][r]=-1e8,u[1][r]=1e8}return N.showSurface=o,N.showContour=s,N}function s(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=B;n.model=t.model||I,n.view=t.view||I,n.projection=t.projection||I,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=k(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],s=0;s<3;++s)a[s]=Math.min(Math.max(this.clipBounds[i][s],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=V,n.vertexColor=this.vertexColor;var l=U;for(M(l,n.view,n.model),M(l,n.projection,l),k(l,l),i=0;i<3;++i)n.eyePosition[i]=l[12+i]/l[15];var u=l[15];for(i=0;i<3;++i)u+=this.lightPosition[i]*l[4*i+3];for(i=0;i<3;++i){var c=l[12+i];for(s=0;s<3;++s)c+=l[4*s+i]*this.lightPosition[s];n.lightPosition[i]=c/u}var h=o(n,this);if(h.showSurface&&e===this.opacity<1){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=h.projections[i],this._shader.uniforms.clipBounds=h.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(h.showContour&&!e){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var d=this._contourVAO;for(d.bind(),i=0;i<3;++i)for(f.uniforms.permutation=O[i],r.lineWidth(this.contourWidth[i]),s=0;s<this.contourLevels[i].length;++s)this._contourCounts[i][s]&&(s===this.highlightLevel[i]?(f.uniforms.contourColor=this.highlightColor[i],f.uniforms.contourTint=this.highlightTint[i]):0!==s&&s-1!==this.highlightLevel[i]||(f.uniforms.contourColor=this.contourColor[i],f.uniforms.contourTint=this.contourTint[i]),f.uniforms.height=this.contourLevels[i][s],d.draw(r.LINES,this._contourCounts[i][s],this._contourOffsets[i][s]));for(i=0;i<3;++i)for(f.uniforms.model=h.projections[i],f.uniforms.clipBounds=h.clipBounds[i],s=0;s<3;++s)if(this.contourProject[i][s]){f.uniforms.permutation=O[s],r.lineWidth(this.contourWidth[s]);for(var p=0;p<this.contourLevels[s].length;++p)p===this.highlightLevel[s]?(f.uniforms.contourColor=this.highlightColor[s],f.uniforms.contourTint=this.highlightTint[s]):0!==p&&p-1!==this.highlightLevel[s]||(f.uniforms.contourColor=this.contourColor[s],f.uniforms.contourTint=this.contourTint[s]),f.uniforms.height=this.contourLevels[s][p],d.draw(r.LINES,this._contourCounts[s][p],this._contourOffsets[s][p])}for((d=this._dynamicVAO).bind(),i=0;i<3;++i)if(0!==this._dynamicCounts[i])for(f.uniforms.model=n.model,f.uniforms.clipBounds=n.clipBounds,f.uniforms.permutation=O[i],r.lineWidth(this.dynamicWidth[i]),f.uniforms.contourColor=this.dynamicColor[i],f.uniforms.contourTint=this.dynamicTint[i],f.uniforms.height=this.dynamicLevel[i],d.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]),s=0;s<3;++s)this.contourProject[s][i]&&(f.uniforms.model=h.projections[s],f.uniforms.clipBounds=h.clipBounds[s],d.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]));d.unbind()}}function l(t,e){var r=e.shape.slice(),n=t.shape.slice();b.assign(t.lo(1,1).hi(r[0],r[1]),e),b.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),b.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),b.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),b.assign(t.lo(n[0]-1,1).hi(1,r[1]),e.lo(r[0]-1)),t.set(0,0,e.get(0,0)),t.set(0,n[1]-1,e.get(0,r[1]-1)),t.set(n[0]-1,0,e.get(r[0]-1,0)),t.set(n[0]-1,n[1]-1,e.get(r[0]-1,r[1]-1))}function u(t,e){return Array.isArray(t)?[e(t[0]),e(t[1]),e(t[2])]:[e(t),e(t),e(t)]}function c(t){return Array.isArray(t)?3===t.length?[t[0],t[1],t[2],1]:[t[0],t[1],t[2],t[3]]:[0,0,0,1]}function h(t){if(Array.isArray(t)){if(Array.isArray(t))return[c(t[0]),c(t[1]),c(t[2])];var e=c(t);return[e.slice(),e.slice(),e.slice()]}}function f(t){var e=t.gl,r=E(e),n=C(e),i=L(e),o=z(e),s=p(e),l=m(e,[{buffer:s,size:4,stride:D,offset:0},{buffer:s,size:3,stride:D,offset:16},{buffer:s,size:3,stride:D,offset:28}]),u=p(e),c=m(e,[{buffer:u,size:4,stride:20,offset:0},{buffer:u,size:1,stride:20,offset:16}]),h=p(e),f=m(e,[{buffer:h,size:2,type:e.FLOAT}]),d=g(e,1,j,e.RGBA,e.UNSIGNED_BYTE);d.minFilter=e.LINEAR,d.magFilter=e.LINEAR;var v=new a(e,[0,0],[[0,0,0],[0,0,0]],r,n,s,l,d,i,o,u,c,h,f),y={levels:[[],[],[]]};for(var b in t)y[b]=t[b];return y.colormap=y.colormap||\"jet\",v.update(y),v}e.exports=f;var d=t(\"bit-twiddle\"),p=t(\"gl-buffer\"),m=t(\"gl-vao\"),g=t(\"gl-texture2d\"),v=t(\"typedarray-pool\"),y=t(\"colormap\"),b=t(\"ndarray-ops\"),x=t(\"ndarray-pack\"),_=t(\"ndarray\"),w=t(\"surface-nets\"),M=t(\"gl-mat4/multiply\"),k=t(\"gl-mat4/invert\"),A=t(\"binary-search-bounds\"),T=t(\"ndarray-gradient\"),S=t(\"./lib/shaders\"),E=S.createShader,L=S.createContourShader,C=S.createPickShader,z=S.createPickContourShader,D=40,I=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],P=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],O=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];!function(){for(var t=0;t<3;++t){var e=O[t],r=(t+2)%3;e[(t+1)%3+0]=1,e[r+3]=1,e[t+6]=1}}();var j=256,R=a.prototype;R.isTransparent=function(){return this.opacity<1},R.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},R.pickSlots=1,R.setPickBase=function(t){this.pickId=t};var F=[0,0,0],N={showSurface:!1,showContour:!1,projections:[I.slice(),I.slice(),I.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]},B={model:I,view:I,projection:I,inverseModel:I.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},U=I.slice(),V=[1,0,0,0,1,0,0,0,1];R.draw=function(t){return s.call(this,t,!1)},R.drawTransparent=function(t){return s.call(this,t,!0)};var H={model:I,view:I,projection:I,inverseModel:I,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]};R.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=H;r.model=t.model||I,r.view=t.view||I,r.projection=t.projection||I,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.permutation=V;for(var n=0;n<2;++n)for(var i=r.clipBounds[n],a=0;a<3;++a)i[a]=Math.min(Math.max(this.clipBounds[n][a],-1e8),1e8);var s=o(r,this);if(s.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(e.TRIANGLES,this._vertexCount),n=0;n<3;++n)this.surfaceProject[n]&&(this._pickShader.uniforms.model=s.projections[n],this._pickShader.uniforms.clipBounds=s.clipBounds[n],this._vao.draw(e.TRIANGLES,this._vertexCount));this._vao.unbind()}if(s.showContour){var l=this._contourPickShader;l.bind(),l.uniforms=r;var u=this._contourVAO;for(u.bind(),a=0;a<3;++a)for(e.lineWidth(this.contourWidth[a]),l.uniforms.permutation=O[a],n=0;n<this.contourLevels[a].length;++n)this._contourCounts[a][n]&&(l.uniforms.height=this.contourLevels[a][n],u.draw(e.LINES,this._contourCounts[a][n],this._contourOffsets[a][n]));for(n=0;n<3;++n)for(l.uniforms.model=s.projections[n],l.uniforms.clipBounds=s.clipBounds[n],a=0;a<3;++a)if(this.contourProject[n][a]){l.uniforms.permutation=O[a],e.lineWidth(this.contourWidth[a]);for(var c=0;c<this.contourLevels[a].length;++c)this._contourCounts[a][c]&&(l.uniforms.height=this.contourLevels[a][c],u.draw(e.LINES,this._contourCounts[a][c],this._contourOffsets[a][c]))}u.unbind()}},R.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=this._field[2].shape,r=this._pickResult,n=e[0]*(t.value[0]+(t.value[2]>>4)/16)/255,i=Math.floor(n),a=n-i,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var u=r.position;u[0]=u[1]=u[2]=0;for(var c=0;c<2;++c)for(var h=c?a:1-a,f=0;f<2;++f)for(var d=i+c,p=s+f,m=h*(f?l:1-l),g=0;g<3;++g)u[g]+=this._field[g].get(d,p)*m;for(var v=this._pickResult.level,y=0;y<3;++y)if(v[y]=A.le(this.contourLevels[y],u[y]),v[y]<0)this.contourLevels[y].length>0&&(v[y]=0);else if(v[y]<this.contourLevels[y].length-1){var b=this.contourLevels[y][v[y]],x=this.contourLevels[y][v[y]+1];Math.abs(b-u[y])>Math.abs(x-u[y])&&(v[y]+=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},R.update=function(t){t=t||{},this.dirty=!0,\"contourWidth\"in t&&(this.contourWidth=u(t.contourWidth,Number)),\"showContour\"in t&&(this.showContour=u(t.showContour,Boolean)),\"showSurface\"in t&&(this.showSurface=!!t.showSurface),\"contourTint\"in t&&(this.contourTint=u(t.contourTint,Boolean)),\"contourColor\"in t&&(this.contourColor=h(t.contourColor)),\"contourProject\"in t&&(this.contourProject=u(t.contourProject,function(t){return u(t,Boolean)})),\"surfaceProject\"in t&&(this.surfaceProject=t.surfaceProject),\"dynamicColor\"in t&&(this.dynamicColor=h(t.dynamicColor)),\"dynamicTint\"in t&&(this.dynamicTint=u(t.dynamicTint,Number)),\"dynamicWidth\"in t&&(this.dynamicWidth=u(t.dynamicWidth,Number)),\"opacity\"in t&&(this.opacity=t.opacity),\"colorBounds\"in t&&(this.colorBounds=t.colorBounds),\"vertexColor\"in t&&(this.vertexColor=t.vertexColor?1:0);var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),\"field\"in t||\"coords\"in t){var n=(e.shape[0]+2)*(e.shape[1]+2);n>this._field[2].data.length&&(v.freeFloat(this._field[2].data),this._field[2].data=v.mallocFloat(d.nextPow2(n))),this._field[2]=_(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),l(this._field[2],e),this.shape=e.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(v.freeFloat(this._field[o].data),this._field[o].data=v.mallocFloat(this._field[2].size)),this._field[o]=_(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var s=t.coords;if(!Array.isArray(s)||3!==s.length)throw new Error(\"gl-surface: invalid coordinates for x/y\");for(o=0;o<2;++o){var c=s[o];for(y=0;y<2;++y)if(c.shape[y]!==a[y])throw new Error(\"gl-surface: coords have incorrect shape\");l(this._field[o],c)}}else if(t.ticks){var f=t.ticks;if(!Array.isArray(f)||2!==f.length)throw new Error(\"gl-surface: invalid ticks\");for(o=0;o<2;++o){var p=f[o];if((Array.isArray(p)||p.length)&&(p=_(p)),p.shape[0]!==a[o])throw new Error(\"gl-surface: invalid tick length\");var m=_(p.data,a);m.stride[o]=p.stride[0],m.stride[1^o]=0,l(this._field[o],m)}}else{for(o=0;o<2;++o){var g=[0,0];g[o]=1,this._field[o]=_(this._field[o].data,[a[0]+2,a[1]+2],g,0)}this._field[0].set(0,0,0);for(var y=0;y<a[0];++y)this._field[0].set(y+1,0,y);for(this._field[0].set(a[0]+1,0,a[0]-1),this._field[1].set(0,0,0),y=0;y<a[1];++y)this._field[1].set(0,y+1,y);this._field[1].set(0,a[1]+1,a[1]-1)}var b=this._field,x=_(v.mallocFloat(3*b[2].size*2),[3,a[0]+2,a[1]+2,2]);for(o=0;o<3;++o)T(x.pick(o),b[o],\"mirror\");var M=_(v.mallocFloat(3*b[2].size),[a[0]+2,a[1]+2,3]);for(o=0;o<a[0]+2;++o)for(y=0;y<a[1]+2;++y){var k=x.get(0,o,y,0),A=x.get(0,o,y,1),S=x.get(1,o,y,0),E=x.get(1,o,y,1),L=x.get(2,o,y,0),C=x.get(2,o,y,1),z=S*C-E*L,D=L*A-C*k,I=k*E-A*S,O=Math.sqrt(z*z+D*D+I*I);O<1e-8?(O=Math.max(Math.abs(z),Math.abs(D),Math.abs(I)))<1e-8?(I=1,D=z=0,O=1):O=1/O:O=1/Math.sqrt(O),M.set(o,y,0,z*O),M.set(o,y,1,D*O),M.set(o,y,2,I*O)}v.free(x.data);var j=[1/0,1/0,1/0],R=[-1/0,-1/0,-1/0],F=1/0,N=-1/0,B=(a[0]-1)*(a[1]-1)*6,U=v.mallocFloat(d.nextPow2(10*B)),V=0,H=0;for(o=0;o<a[0]-1;++o)t:for(y=0;y<a[1]-1;++y){for(var q=0;q<2;++q)for(var G=0;G<2;++G)for(var Y=0;Y<3;++Y){var W=this._field[Y].get(1+o+q,1+y+G);if(isNaN(W)||!isFinite(W))continue t}for(Y=0;Y<6;++Y){var X=o+P[Y][0],Z=y+P[Y][1],J=this._field[0].get(X+1,Z+1),Q=this._field[1].get(X+1,Z+1),K=W=this._field[2].get(X+1,Z+1);z=M.get(X+1,Z+1,0),D=M.get(X+1,Z+1,1),I=M.get(X+1,Z+1,2),t.intensity&&(K=t.intensity.get(X,Z)),U[V++]=X,U[V++]=Z,U[V++]=J,U[V++]=Q,U[V++]=W,U[V++]=0,U[V++]=K,U[V++]=z,U[V++]=D,U[V++]=I,j[0]=Math.min(j[0],J),j[1]=Math.min(j[1],Q),j[2]=Math.min(j[2],W),F=Math.min(F,K),R[0]=Math.max(R[0],J),R[1]=Math.max(R[1],Q),R[2]=Math.max(R[2],W),N=Math.max(N,K),H+=1}}for(t.intensityBounds&&(F=+t.intensityBounds[0],N=+t.intensityBounds[1]),o=6;o<V;o+=10)U[o]=(U[o]-F)/(N-F);this._vertexCount=H,this._coordinateBuffer.update(U.subarray(0,V)),v.freeFloat(U),v.free(M.data),this.bounds=[j,R],this.intensity=t.intensity||this._field[2],this.intensityBounds[0]===F&&this.intensityBounds[1]===N||(r=!0),this.intensityBounds=[F,N]}if(\"levels\"in t){var $=t.levels;for($=Array.isArray($[0])?$.slice():[[],[],$],o=0;o<3;++o)$[o]=$[o].slice(),$.sort(function(t,e){return t-e});t:for(o=0;o<3;++o){if($[o].length!==this.contourLevels[o].length){r=!0;break}for(y=0;y<$[o].length;++y)if($[o][y]!==this.contourLevels[o][y]){r=!0;break t}}this.contourLevels=$}if(r){b=this._field,a=this.shape;for(var tt=[],et=0;et<3;++et){$=this.contourLevels[et];var rt=[],nt=[],it=[0,0,0];for(o=0;o<$.length;++o){var at=w(this._field[et],$[o]);rt.push(tt.length/5|0),H=0;t:for(y=0;y<at.cells.length;++y){var ot=at.cells[y];for(Y=0;Y<2;++Y){var st=at.positions[ot[Y]],lt=st[0],ut=0|Math.floor(lt),ct=lt-ut,ht=st[1],ft=0|Math.floor(ht),dt=ht-ft,pt=!1;e:for(var mt=0;mt<3;++mt){it[mt]=0;var gt=(et+mt+1)%3;for(q=0;q<2;++q){var vt=q?ct:1-ct;for(X=0|Math.min(Math.max(ut+q,0),a[0]),G=0;G<2;++G){var yt=G?dt:1-dt;if(Z=0|Math.min(Math.max(ft+G,0),a[1]),W=mt<2?this._field[gt].get(X,Z):(this.intensity.get(X,Z)-this.intensityBounds[0])/(this.intensityBounds[1]-this.intensityBounds[0]),!isFinite(W)||isNaN(W)){pt=!0;break e}var bt=vt*yt;it[mt]+=bt*W}}}if(pt){if(Y>0){for(var xt=0;xt<5;++xt)tt.pop();H-=1}continue t}tt.push(it[0],it[1],st[0],st[1],it[2]),H+=1}}nt.push(H)}this._contourOffsets[et]=rt,this._contourCounts[et]=nt}var _t=v.mallocFloat(tt.length);for(o=0;o<tt.length;++o)_t[o]=tt[o];this._contourBuffer.update(_t),v.freeFloat(_t)}t.colormap&&this._colorMap.setPixels(i(t.colormap))},R.dispose=function(){this._shader.dispose(),this._vao.dispose(),this._coordinateBuffer.dispose(),this._colorMap.dispose(),this._contourBuffer.dispose(),this._contourVAO.dispose(),this._contourShader.dispose(),this._contourPickShader.dispose(),this._dynamicBuffer.dispose(),this._dynamicVAO.dispose();for(var t=0;t<3;++t)v.freeFloat(this._field[t].data)},R.highlight=function(t){if(!t)return this._dynamicCounts=[0,0,0],this.dyanamicLevel=[NaN,NaN,NaN],void(this.highlightLevel=[-1,-1,-1]);for(var e=0;e<3;++e)this.enableHighlight[e]?this.highlightLevel[e]=t.level[e]:this.highlightLevel[e]=-1;var r;if(r=this.snapToData?t.dataCoordinate:t.position,this.enableDynamic[0]&&r[0]!==this.dynamicLevel[0]||this.enableDynamic[1]&&r[1]!==this.dynamicLevel[1]||this.enableDynamic[2]&&r[2]!==this.dynamicLevel[2]){for(var n=0,i=this.shape,a=v.mallocFloat(12*i[0]*i[1]),o=0;o<3;++o)if(this.enableDynamic[o]){this.dynamicLevel[o]=r[o];var s=(o+1)%3,l=(o+2)%3,u=this._field[o],c=this._field[s],h=this._field[l],f=(this.intensity,w(u,r[o])),d=f.cells,p=f.positions;for(this._dynamicOffsets[o]=n,e=0;e<d.length;++e)for(var m=d[e],g=0;g<2;++g){var y=p[m[g]],b=+y[0],x=0|b,_=0|Math.min(x+1,i[0]),M=b-x,k=1-M,A=+y[1],T=0|A,S=0|Math.min(T+1,i[1]),E=A-T,L=1-E,C=k*L,z=k*E,D=M*L,I=M*E,P=C*c.get(x,T)+z*c.get(x,S)+D*c.get(_,T)+I*c.get(_,S),O=C*h.get(x,T)+z*h.get(x,S)+D*h.get(_,T)+I*h.get(_,S);if(isNaN(P)||isNaN(O)){g&&(n-=1);break}a[2*n+0]=P,a[2*n+1]=O,n+=1}this._dynamicCounts[o]=n-this._dynamicOffsets[o]}else this.dynamicLevel[o]=NaN,this._dynamicCounts[o]=0;this._dynamicBuffer.update(a.subarray(0,2*n)),v.freeFloat(a)}}},{\"./lib/shaders\":249,\"binary-search-bounds\":59,\"bit-twiddle\":60,colormap:92,\"gl-buffer\":141,\"gl-mat4/invert\":165,\"gl-mat4/multiply\":167,\"gl-texture2d\":251,\"gl-vao\":255,ndarray:449,\"ndarray-gradient\":440,\"ndarray-ops\":443,\"ndarray-pack\":444,\"surface-nets\":511,\"typedarray-pool\":521}],251:[function(t,e,r){\"use strict\";function n(t){v=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],y=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],b=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}function i(t){return\"undefined\"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||\"undefined\"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||\"undefined\"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement||\"undefined\"!=typeof ImageData&&t instanceof ImageData}function a(t,e,r){var n=t.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error(\"gl-texture2d: Invalid texture size\");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function o(t,e,r,n,i,a){this.gl=t,this.handle=e,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}function s(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function l(t,e,r,n,i,a,o,l){var u=l.dtype,c=l.shape.slice();if(c.length<2||c.length>3)throw new Error(\"gl-texture2d: Invalid ndarray, must be 2d or 3d\");var h=0,f=0,d=s(c,l.stride.slice());\"float32\"===u?h=t.FLOAT:\"float64\"===u?(h=t.FLOAT,d=!1,u=\"float32\"):\"uint8\"===u?h=t.UNSIGNED_BYTE:(h=t.UNSIGNED_BYTE,d=!1,u=\"uint8\");if(2===c.length)f=t.LUMINANCE,c=[c[0],c[1],1],l=p(l.data,c,[l.stride[0],l.stride[1],1],l.offset);else{if(3!==c.length)throw new Error(\"gl-texture2d: Invalid shape for texture\");if(1===c[2])f=t.ALPHA;else if(2===c[2])f=t.LUMINANCE_ALPHA;else if(3===c[2])f=t.RGB;else{if(4!==c[2])throw new Error(\"gl-texture2d: Invalid shape for pixel coords\");f=t.RGBA}c[2]}if(f!==t.LUMINANCE&&f!==t.ALPHA||i!==t.LUMINANCE&&i!==t.ALPHA||(f=i),f!==i)throw new Error(\"gl-texture2d: Incompatible texture format for setPixels\");var v=l.size,y=o.indexOf(n)<0;if(y&&o.push(n),h===a&&d)0===l.offset&&l.data.length===v?y?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,l.data):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,l.data):y?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,l.data.subarray(l.offset,l.offset+v)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,l.data.subarray(l.offset,l.offset+v));else{var b;b=a===t.FLOAT?g.mallocFloat32(v):g.mallocUint8(v);var _=p(b,c,[c[2],c[2]*c[0],1]);h===t.FLOAT&&a===t.UNSIGNED_BYTE?x(_,l):m.assign(_,l),y?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,b.subarray(0,v)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,b.subarray(0,v)),a===t.FLOAT?g.freeFloat32(b):g.freeUint8(b)}}function u(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function c(t,e,r,n,i){var a=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error(\"gl-texture2d: Invalid texture shape\");if(i===t.FLOAT&&!t.getExtension(\"OES_texture_float\"))throw new Error(\"gl-texture2d: Floating point textures not supported on this platform\");var s=u(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new o(t,s,e,r,n,i)}function h(t,e,r,n,i,a){var s=u(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,a,e),new o(t,s,r,n,i,a)}function f(t,e){var r=e.dtype,n=e.shape.slice(),i=t.getParameter(t.MAX_TEXTURE_SIZE);if(n[0]<0||n[0]>i||n[1]<0||n[1]>i)throw new Error(\"gl-texture2d: Invalid texture size\");var a=s(n,e.stride.slice()),l=0;\"float32\"===r?l=t.FLOAT:\"float64\"===r?(l=t.FLOAT,a=!1,r=\"float32\"):\"uint8\"===r?l=t.UNSIGNED_BYTE:(l=t.UNSIGNED_BYTE,a=!1,r=\"uint8\");var c=0;if(2===n.length)c=t.LUMINANCE,n=[n[0],n[1],1],e=p(e.data,n,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==n.length)throw new Error(\"gl-texture2d: Invalid shape for texture\");if(1===n[2])c=t.ALPHA;else if(2===n[2])c=t.LUMINANCE_ALPHA;else if(3===n[2])c=t.RGB;else{if(4!==n[2])throw new Error(\"gl-texture2d: Invalid shape for pixel coords\");c=t.RGBA}}l!==t.FLOAT||t.getExtension(\"OES_texture_float\")||(l=t.UNSIGNED_BYTE,a=!1);var h,f,d=e.size;if(a)h=0===e.offset&&e.data.length===d?e.data:e.data.subarray(e.offset,e.offset+d);else{var v=[n[2],n[2]*n[0],1];f=g.malloc(d,r);var y=p(f,n,v,0);\"float32\"!==r&&\"float64\"!==r||l!==t.UNSIGNED_BYTE?m.assign(y,e):x(y,e),h=f.subarray(0,d)}var b=u(t);return t.texImage2D(t.TEXTURE_2D,0,c,n[0],n[1],0,c,l,h),a||g.free(f),new o(t,b,n[0],n[1],c,l)}function d(t){if(arguments.length<=1)throw new Error(\"gl-texture2d: Missing arguments for texture2d constructor\");if(v||n(t),\"number\"==typeof arguments[1])return c(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return c(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(\"object\"==typeof arguments[1]){var e=arguments[1],r=i(e)?e:e.raw;if(r)return h(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 f(t,e)}throw new Error(\"gl-texture2d: Invalid arguments for texture2d constructor\")}var p=t(\"ndarray\"),m=t(\"ndarray-ops\"),g=t(\"typedarray-pool\");e.exports=d;var v=null,y=null,b=null,x=function(t,e){m.muls(t,e,255)},_=o.prototype;Object.defineProperties(_,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&v.indexOf(t)>=0&&(e.getExtension(\"OES_texture_float_linear\")||(t=e.NEAREST)),y.indexOf(t)<0)throw new Error(\"gl-texture2d: Unknown filter mode \"+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&v.indexOf(t)>=0&&(e.getExtension(\"OES_texture_float_linear\")||(t=e.NEAREST)),y.indexOf(t)<0)throw new Error(\"gl-texture2d: Unknown filter mode \"+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension(\"EXT_texture_filter_anisotropic\");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),b.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(),b.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(b.indexOf(t[e])<0)throw new Error(\"gl-texture2d: Unknown wrap mode \"+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error(\"gl-texture2d: Invalid texture shape\")}else t=[0|t,0|t];return a(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return t|=0,a(this,t,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,a(this,this._shape[0],t),t}}}),_.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},_.dispose=function(){this.gl.deleteTexture(this.handle)},_.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},_.setPixels=function(t,e,r,n){var a=this.gl;this.bind(),Array.isArray(e)?(n=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),n=n||0;var o=i(t)?t:t.raw;if(o)this._mipLevels.indexOf(n)<0?(a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,this.type,o),this._mipLevels.push(n)):a.texSubImage2D(a.TEXTURE_2D,n,e,r,this.format,this.type,o);else{if(!(t.shape&&t.stride&&t.data))throw new Error(\"gl-texture2d: Unsupported data type\");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>n||r+t.shape[0]>this._shape[0]>>>n||e<0||r<0)throw new Error(\"gl-texture2d: Texture dimensions are out of bounds\");l(a,e,r,n,this.format,this.type,this._mipLevels,t)}}},{ndarray:449,\"ndarray-ops\":443,\"typedarray-pool\":521}],252:[function(t,e,r){\"use strict\";function n(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error(\"gl-vao: Too many vertex attributes\");for(h=0;h<r.length;++h){var i=r[h];if(i.buffer){var a=i.buffer,o=i.size||4,s=i.type||t.FLOAT,l=!!i.normalized,u=i.stride||0,c=i.offset||0;a.bind(),t.enableVertexAttribArray(h),t.vertexAttribPointer(h,o,s,l,u,c)}else{if(\"number\"==typeof i)t.vertexAttrib1f(h,i);else if(1===i.length)t.vertexAttrib1f(h,i[0]);else if(2===i.length)t.vertexAttrib2f(h,i[0],i[1]);else if(3===i.length)t.vertexAttrib3f(h,i[0],i[1],i[2]);else{if(4!==i.length)throw new Error(\"gl-vao: Invalid vertex attribute\");t.vertexAttrib4f(h,i[0],i[1],i[2],i[3])}t.disableVertexAttribArray(h)}}for(;h<n;++h)t.disableVertexAttribArray(h)}else{t.bindBuffer(t.ARRAY_BUFFER,null);for(var h=0;h<n;++h)t.disableVertexAttribArray(h)}}e.exports=n},{}],253:[function(t,e,r){\"use strict\";function n(t){this.gl=t,this._elements=null,this._attributes=null,this._elementsType=t.UNSIGNED_SHORT}function i(t){return new n(t)}var a=t(\"./do-bind.js\");n.prototype.bind=function(){a(this.gl,this._elements,this._attributes)},n.prototype.update=function(t,e,r){this._elements=e,this._attributes=t,this._elementsType=r||this.gl.UNSIGNED_SHORT},n.prototype.dispose=function(){},n.prototype.unbind=function(){},n.prototype.draw=function(t,e,r){r=r||0;var n=this.gl;this._elements?n.drawElements(t,e,this._elementsType,r):n.drawArrays(t,r,e)},e.exports=i},{\"./do-bind.js\":252}],254:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a){this.location=t,this.dimension=e,this.a=r,this.b=n,this.c=i,this.d=a}function i(t,e,r){this.gl=t,this._ext=e,this.handle=r,this._attribs=[],this._useElements=!1,this._elementsType=t.UNSIGNED_SHORT}function a(t,e){return new i(t,e,e.createVertexArrayOES())}var o=t(\"./do-bind.js\");n.prototype.bind=function(t){switch(this.dimension){case 1:t.vertexAttrib1f(this.location,this.a);break;case 2:t.vertexAttrib2f(this.location,this.a,this.b);break;case 3:t.vertexAttrib3f(this.location,this.a,this.b,this.c);break;case 4:t.vertexAttrib4f(this.location,this.a,this.b,this.c,this.d)}},i.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var t=0;t<this._attribs.length;++t)this._attribs[t].bind(this.gl)},i.prototype.unbind=function(){this._ext.bindVertexArrayOES(null)},i.prototype.dispose=function(){this._ext.deleteVertexArrayOES(this.handle)},i.prototype.update=function(t,e,r){if(this.bind(),o(this.gl,e,t),this.unbind(),this._attribs.length=0,t)for(var i=0;i<t.length;++i){var a=t[i];\"number\"==typeof a?this._attribs.push(new n(i,1,a)):Array.isArray(a)&&this._attribs.push(new n(i,a.length,a[0],a[1],a[2],a[3]))}this._useElements=!!e,this._elementsType=r||this.gl.UNSIGNED_SHORT},i.prototype.draw=function(t,e,r){r=r||0;var n=this.gl;this._useElements?n.drawElements(t,e,this._elementsType,r):n.drawArrays(t,r,e)},e.exports=a},{\"./do-bind.js\":252}],255:[function(t,e,r){\"use strict\";function n(t){this.bindVertexArrayOES=t.bindVertexArray.bind(t),this.createVertexArrayOES=t.createVertexArray.bind(t),this.deleteVertexArrayOES=t.deleteVertexArray.bind(t)}function i(t,e,r,i){var s,l=t.createVertexArray?new n(t):t.getExtension(\"OES_vertex_array_object\");return(s=l?a(t,l):o(t)).update(e,r,i),s}var a=t(\"./lib/vao-native.js\"),o=t(\"./lib/vao-emulated.js\");e.exports=i},{\"./lib/vao-emulated.js\":253,\"./lib/vao-native.js\":254}],256:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}e.exports=n},{}],257:[function(t,e,r){function n(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}e.exports=n},{}],258:[function(t,e,r){function n(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}e.exports=n},{}],259:[function(t,e,r){function n(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t}e.exports=n},{}],260:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}e.exports=n},{}],261:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}e.exports=n},{}],262:[function(t,e,r){function n(t,e,r,n){return i[0]=n,i[1]=r,i[2]=e,i[3]=t,a[0]}e.exports=n;var i=new Uint8Array(4),a=new Float32Array(i.buffer)},{}],263:[function(t,e,r){function n(t){for(var e=Array.isArray(t)?t:i(t),r=0;r<e.length;r++){var n=e[r];if(\"preprocessor\"===n.type){var o=n.data.match(/\\#define\\s+SHADER_NAME(_B64)?\\s+(.+)$/);if(o&&o[2]){var s=o[1],l=o[2];return(s?a(l):l).trim()}}}}var i=t(\"glsl-tokenizer\"),a=t(\"atob-lite\");e.exports=n},{\"atob-lite\":41,\"glsl-tokenizer\":270}],264:[function(t,e,r){function n(t){function e(t){t.length&&V.push({type:M[B],data:t,position:G,line:H,column:q})}function r(t){F=0,R=(X+=t).length;for(var e;O=X[F],F<R;){switch(e=F,B){case h:F=E();break;case f:F=S();break;case d:F=T();break;case p:F=L();break;case m:F=D();break;case w:F=z();break;case g:F=I();break;case c:F=P();break;case x:F=A();break;case u:F=k()}if(e!==F)switch(X[e]){case\"\\n\":q=0,++H;break;default:++q}}return N+=F,X=X.slice(F),V}function n(t){return U.length&&e(U.join(\"\")),B=_,e(\"(eof)\"),V}function k(){return U=U.length?[]:U,\"/\"===j&&\"*\"===O?(G=N+F-1,B=h,j=O,F+1):\"/\"===j&&\"/\"===O?(G=N+F-1,B=f,j=O,F+1):\"#\"===O?(B=d,G=N+F,F):/\\s/.test(O)?(B=x,G=N+F,F):(Y=/\\d/.test(O),W=/[^\\w_]/.test(O),G=N+F,B=Y?m:W?p:c,F)}function A(){return/[^\\s]/g.test(O)?(e(U.join(\"\")),B=u,F):(U.push(O),j=O,F+1)}function T(){return\"\\r\"!==O&&\"\\n\"!==O||\"\\\\\"===j?(U.push(O),j=O,F+1):(e(U.join(\"\")),B=u,F)}function S(){return T()}function E(){return\"/\"===O&&\"*\"===j?(U.push(O),e(U.join(\"\")),B=u,F+1):(U.push(O),j=O,F+1)}function L(){if(\".\"===j&&/\\d/.test(O))return B=g,F;if(\"/\"===j&&\"*\"===O)return B=h,F;if(\"/\"===j&&\"/\"===O)return B=f,F;if(\".\"===O&&U.length){for(;C(U););return B=g,F}if(\";\"===O||\")\"===O||\"(\"===O){if(U.length)for(;C(U););return e(O),B=u,F+1}var t=2===U.length&&\"=\"!==O;if(/[\\w_\\d\\s]/.test(O)||t){for(;C(U););return B=u,F}return U.push(O),j=O,F+1}function C(t){for(var r,n,i=0;;){if(r=a.indexOf(t.slice(0,t.length+i).join(\"\")),n=a[r],-1===r){if(i--+t.length>0)continue;n=t.slice(0,1).join(\"\")}return e(n),G+=n.length,(U=U.slice(n.length)).length}}function z(){return/[^a-fA-F0-9]/.test(O)?(e(U.join(\"\")),B=u,F):(U.push(O),j=O,F+1)}function D(){return\".\"===O?(U.push(O),B=g,j=O,F+1):/[eE]/.test(O)?(U.push(O),B=g,j=O,F+1):\"x\"===O&&1===U.length&&\"0\"===U[0]?(B=w,U.push(O),j=O,F+1):/[^\\d]/.test(O)?(e(U.join(\"\")),B=u,F):(U.push(O),j=O,F+1)}function I(){return\"f\"===O&&(U.push(O),j=O,F+=1),/[eE]/.test(O)?(U.push(O),j=O,F+1):\"-\"===O&&/[eE]/.test(j)?(U.push(O),j=O,F+1):/[^\\d]/.test(O)?(e(U.join(\"\")),B=u,F):(U.push(O),j=O,F+1)}function P(){if(/[^\\d\\w_]/.test(O)){var t=U.join(\"\");return B=J.indexOf(t)>-1?b:Z.indexOf(t)>-1?y:v,e(U.join(\"\")),B=u,F}return U.push(O),j=O,F+1}var O,j,R,F=0,N=0,B=u,U=[],V=[],H=1,q=0,G=0,Y=!1,W=!1,X=\"\",Z=o,J=i;return\"300 es\"===(t=t||{}).version&&(Z=l,J=s),function(t){return V=[],null!==t?r(t.replace?t.replace(/\\r\\n/g,\"\\n\"):t):n()}}e.exports=n;var i=t(\"./lib/literals\"),a=t(\"./lib/operators\"),o=t(\"./lib/builtins\"),s=t(\"./lib/literals-300es\"),l=t(\"./lib/builtins-300es\"),u=999,c=9999,h=0,f=1,d=2,p=3,m=4,g=5,v=6,y=7,b=8,x=9,_=10,w=11,M=[\"block-comment\",\"line-comment\",\"preprocessor\",\"operator\",\"integer\",\"float\",\"ident\",\"builtin\",\"keyword\",\"whitespace\",\"eof\",\"integer\"]},{\"./lib/builtins\":266,\"./lib/builtins-300es\":265,\"./lib/literals\":268,\"./lib/literals-300es\":267,\"./lib/operators\":269}],265:[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\":266}],266:[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\"]},{}],267:[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\":268}],268:[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\"]},{}],269:[function(t,e,r){e.exports=[\"<<=\",\">>=\",\"++\",\"--\",\"<<\",\">>\",\"<=\",\">=\",\"==\",\"!=\",\"&&\",\"||\",\"+=\",\"-=\",\"*=\",\"/=\",\"%=\",\"&=\",\"^^\",\"^=\",\"|=\",\"(\",\")\",\"[\",\"]\",\".\",\"!\",\"~\",\"*\",\"/\",\"%\",\"+\",\"-\",\"<\",\">\",\"&\",\"^\",\"|\",\"?\",\":\",\"=\",\",\",\";\",\"{\",\"}\"]},{}],270:[function(t,e,r){function n(t,e){var r=i(e),n=[];return n=n.concat(r(t)),n=n.concat(r(null))}var i=t(\"./index\");e.exports=n},{\"./index\":264}],271:[function(t,e,r){\"use strict\";function n(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var a=new Int32Array(this.arrayBuffer);t=a[0],e=a[1],r=a[2],this.d=e+2*r;for(var o=0;o<this.d*this.d;o++){var s=a[i+o],l=a[i+o+1];n.push(s===l?null:a.subarray(s,l))}var u=a[i+n.length],c=a[i+n.length+1];this.keys=a.subarray(u,c),this.bboxes=a.subarray(c),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var h=0;h<this.d*this.d;h++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var f=r/e*t;this.min=-f,this.max=t+f}e.exports=n;var i=3;n.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},n.prototype._insertReadonly=function(){throw\"Cannot insert into a GridIndex created from an ArrayBuffer.\"},n.prototype._insertCell=function(t,e,r,n,i,a){this.cells[i].push(a)},n.prototype.query=function(t,e,r,n){var i=this.min,a=this.max;if(t<=i&&e<=i&&a<=r&&a<=n)return Array.prototype.slice.call(this.keys);var o=[],s={};return this._forEachCell(t,e,r,n,this._queryCell,o,s),o},n.prototype._queryCell=function(t,e,r,n,i,a,o){var s=this.cells[i];if(null!==s)for(var l=this.keys,u=this.bboxes,c=0;c<s.length;c++){var h=s[c];if(void 0===o[h]){var f=4*h;t<=u[f+2]&&e<=u[f+3]&&r>=u[f+0]&&n>=u[f+1]?(o[h]=!0,a.push(l[h])):o[h]=!1}}},n.prototype._forEachCell=function(t,e,r,n,i,a,o){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),u=this._convertToCellCoord(r),c=this._convertToCellCoord(n),h=s;h<=u;h++)for(var f=l;f<=c;f++){var d=this.d*f+h;if(i.call(this,t,e,r,n,d,a,o))return}},n.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},n.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=i+this.cells.length+1+1,r=0,n=0;n<this.cells.length;n++)r+=this.cells[n].length;var a=new Int32Array(e+r+this.keys.length+this.bboxes.length);a[0]=this.extent,a[1]=this.n,a[2]=this.padding;for(var o=e,s=0;s<t.length;s++){var l=t[s];a[i+s]=o,a.set(l,o),o+=l.length}return a[i+t.length]=o,a.set(this.keys,o),o+=this.keys.length,a[i+t.length+1]=o,a.set(this.bboxes,o),o+=this.bboxes.length,a.buffer}},{}],272:[function(t,e,r){r.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,u=l>>1,c=-7,h=r?i-1:0,f=r?-1:1,d=t[e+h];for(h+=f,a=d&(1<<-c)-1,d>>=-c,c+=s;c>0;a=256*a+t[e+h],h+=f,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+h],h+=f,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=u}return(d?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<<u)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=c?(s=0,o=c):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<<i|s,u+=i;u>0;t[r+d]=255&o,d+=p,o/=256,u-=8);t[r+d-p]|=128*m}},{}],273:[function(t,e,r){\"use strict\";function n(t,e,r){this.vertices=t,this.adjacent=e,this.boundary=r,this.lastVisited=-1}function i(t,e,r){this.vertices=t,this.cell=e,this.index=r}function a(t,e){return c(t.vertices,e.vertices)}function o(t){for(var e=[\"function orient(){var tuple=this.tuple;return test(\"],r=0;r<=t;++r)r>0&&e.push(\",\"),e.push(\"tuple[\",r,\"]\");e.push(\")}return orient\");var n=new Function(\"test\",e.join(\"\")),i=u[t+1];return i||(i=u),n(i)}function s(t,e,r){this.dimension=t,this.vertices=e,this.simplices=r,this.interior=r.filter(function(t){return!t.boundary}),this.tuple=new Array(t+1);for(var n=0;n<=t;++n)this.tuple[n]=this.vertices[n];var i=h[t];i||(i=h[t]=o(t)),this.orient=i}function l(t,e){var r=t.length;if(0===r)throw new Error(\"Must have at least d+1 points\");var i=t[0].length;if(r<=i)throw new Error(\"Must input at least d+1 points\");var a=t.slice(0,i+1),o=u.apply(void 0,a);if(0===o)throw new Error(\"Input not in general position\");for(var l=new Array(i+1),c=0;c<=i;++c)l[c]=c;o<0&&(l[0]=1,l[1]=0);for(var h=new n(l,new Array(i+1),!1),f=h.adjacent,d=new Array(i+2),c=0;c<=i;++c){for(var p=l.slice(),m=0;m<=i;++m)m===c&&(p[m]=-1);var g=p[0];p[0]=p[1],p[1]=g;var v=new n(p,new Array(i+1),!0);f[c]=v,d[c]=v}d[i+1]=h;for(c=0;c<=i;++c)for(var p=f[c].vertices,y=f[c].adjacent,m=0;m<=i;++m){var b=p[m];if(b<0)y[m]=h;else for(var x=0;x<=i;++x)f[x].vertices.indexOf(b)<0&&(y[m]=f[x])}for(var _=new s(i,a,d),w=!!e,c=i+1;c<r;++c)_.insert(t[c],w);return _.boundary()}e.exports=l;var u=t(\"robust-orientation\"),c=t(\"simplicial-complex\").compareCells;n.prototype.flip=function(){var t=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=t;var e=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=e};var h=[],f=s.prototype;f.handleBoundaryDegeneracy=function(t,e){var r=this.dimension,n=this.vertices.length-1,i=this.tuple,a=this.vertices,o=[t];for(t.lastVisited=-n;o.length>0;){(t=o.pop()).vertices;for(var s=t.adjacent,l=0;l<=r;++l){var u=s[l];if(u.boundary&&!(u.lastVisited<=-n)){for(var c=u.vertices,h=0;h<=r;++h){var f=c[h];i[h]=f<0?e:a[f]}var d=this.orient();if(d>0)return u;u.lastVisited=-n,0===d&&o.push(u)}}}return null},f.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,u=s.adjacent,c=0;c<=n;++c)a[c]=i[l[c]];s.lastVisited=r;for(c=0;c<=n;++c){var h=u[c];if(!(h.lastVisited>=r)){var f=a[c];a[c]=t;var d=this.orient();if(a[c]=f,d<0){s=h;continue t}h.boundary?h.lastVisited=-r:h.lastVisited=r}}return}return s},f.addPeaks=function(t,e){var r=this.vertices.length-1,o=this.dimension,s=this.vertices,l=this.tuple,u=this.interior,c=this.simplices,h=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,u.push(e);for(var f=[];h.length>0;){var d=(e=h.pop()).vertices,p=e.adjacent,m=d.indexOf(r);if(!(m<0))for(C=0;C<=o;++C)if(C!==m){var g=p[C];if(g.boundary&&!(g.lastVisited>=r)){var v=g.vertices;if(g.lastVisited!==-r){for(var y=0,b=0;b<=o;++b)v[b]<0?(y=b,l[b]=t):l[b]=s[v[b]];if(this.orient()>0){v[y]=r,g.boundary=!1,u.push(g),h.push(g),g.lastVisited=r;continue}g.lastVisited=-r}var x=g.adjacent,_=d.slice(),w=p.slice(),M=new n(_,w,!0);c.push(M);var k=x.indexOf(e);if(!(k<0)){x[k]=M,w[m]=g,_[C]=-1,w[C]=e,p[C]=M,M.flip();for(b=0;b<=o;++b){var A=_[b];if(!(A<0||A===r)){for(var T=new Array(o-1),S=0,E=0;E<=o;++E){var L=_[E];L<0||E===b||(T[S++]=L)}f.push(new i(T,M,b))}}}}}}f.sort(a);for(var C=0;C+1<f.length;C+=2){var z=f[C],D=f[C+1],I=z.index,P=D.index;I<0||P<0||(z.cell.adjacent[z.index]=D.cell,D.cell.adjacent[D.index]=z.cell)}},f.insert=function(t,e){var r=this.vertices;r.push(t);var n=this.walk(t,e);if(n){for(var i=this.dimension,a=this.tuple,o=0;o<=i;++o){var s=n.vertices[o];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)}},f.boundary=function(){for(var t=this.dimension,e=[],r=this.simplices,n=r.length,i=0;i<n;++i){var a=r[i];if(a.boundary){for(var o=new Array(t),s=a.vertices,l=0,u=0,c=0;c<=t;++c)s[c]>=0?o[l++]=s[c]:u=1&c;if(u===(1&t)){var h=o[0];o[0]=o[1],o[1]=h}e.push(o)}}return e}},{\"robust-orientation\":489,\"simplicial-complex\":500}],274:[function(t,e,r){\"use strict\";function n(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}function i(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function a(t,e){var r=p(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function o(t,e){var r=t.intervals([]);r.push(e),a(t,r)}function s(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?y:(r.splice(n,1),a(t,r),b)}function l(t,e,r){for(var n=0;n<t.length&&t[n][0]<=e;++n){var i=r(t[n]);if(i)return i}}function u(t,e,r){for(var n=t.length-1;n>=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function c(t,e){for(var r=0;r<t.length;++r){var n=e(t[r]);if(n)return n}}function h(t,e){return t-e}function f(t,e){var r=t[0]-e[0];return r||t[1]-e[1]}function d(t,e){var r=t[1]-e[1];return r||t[0]-e[0]}function p(t){if(0===t.length)return null;for(var e=[],r=0;r<t.length;++r)e.push(t[r][0],t[r][1]);e.sort(h);for(var i=e[e.length>>1],a=[],o=[],s=[],r=0;r<t.length;++r){var l=t[r];l[1]<i?a.push(l):i<l[0]?o.push(l):s.push(l)}var u=s,c=s.slice();return u.sort(f),c.sort(d),new n(i,p(a),p(o),u,c)}function m(t){this.root=t}function g(t){return new m(t&&0!==t.length?p(t):null)}var v=t(\"binary-search-bounds\"),y=0,b=1;e.exports=g;var x=n.prototype;x.intervals=function(t){return t.push.apply(t,this.leftPoints),this.left&&this.left.intervals(t),this.right&&this.right.intervals(t),t},x.insert=function(t){var e=this.count-this.leftPoints.length;if(this.count+=1,t[1]<this.mid)this.left?4*(this.left.count+1)>3*(e+1)?o(this,t):this.left.insert(t):this.left=p([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?o(this,t):this.right.insert(t):this.right=p([t]);else{var r=v.ge(this.leftPoints,t,f),n=v.ge(this.rightPoints,t,d);this.leftPoints.splice(r,0,t),this.rightPoints.splice(n,0,t)}},x.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)?s(this,t):2===(o=this.left.remove(t))?(this.left=null,this.count-=1,b):(o===b&&(this.count-=1),o):y;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?s(this,t):2===(o=this.right.remove(t))?(this.right=null,this.count-=1,b):(o===b&&(this.count-=1),o):y;if(1===this.count)return this.leftPoints[0]===t?2:y;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,n=this.left;n.right;)r=n,n=n.right;if(r===this)n.right=this.right;else{var a=this.left,o=this.right;r.count-=n.count,r.right=n.left,n.left=a,n.right=o}i(this,n),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?i(this,this.left):i(this,this.right);return b}for(a=v.ge(this.leftPoints,t,f);a<this.leftPoints.length&&this.leftPoints[a][0]===t[0];++a)if(this.leftPoints[a]===t){this.count-=1,this.leftPoints.splice(a,1);for(o=v.ge(this.rightPoints,t,d);o<this.rightPoints.length&&this.rightPoints[o][1]===t[1];++o)if(this.rightPoints[o]===t)return this.rightPoints.splice(o,1),b}return y},x.queryPoint=function(t,e){if(t<this.mid)return this.left&&(r=this.left.queryPoint(t,e))?r:l(this.leftPoints,t,e);if(t>this.mid){if(this.right){var r=this.right.queryPoint(t,e);if(r)return r}return u(this.rightPoints,t,e)}return c(this.leftPoints,e)},x.queryInterval=function(t,e,r){if(t<this.mid&&this.left&&(n=this.left.queryInterval(t,e,r)))return n;if(e>this.mid&&this.right){var n=this.right.queryInterval(t,e,r);if(n)return n}return e<this.mid?l(this.leftPoints,e,r):t>this.mid?u(this.rightPoints,t,r):c(this.leftPoints,r)};var _=m.prototype;_.insert=function(t){this.root?this.root.insert(t):this.root=new n(t[0],null,null,[t],[t])},_.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),e!==y}return!1},_.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},_.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(_,\"count\",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(_,\"intervals\",{get:function(){return this.root?this.root.intervals([]):[]}})},{\"binary-search-bounds\":59}],275:[function(t,e,r){\"use strict\";function n(t,e){e=e||new Array(t.length);for(var r=0;r<t.length;++r)e[t[r]]=r;return e}e.exports=n},{}],276:[function(t,e,r){\"use strict\";function n(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=r;return e}e.exports=n},{}],277:[function(t,e,r){function n(t){return!!t.constructor&&\"function\"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function i(t){return\"function\"==typeof t.readFloatLE&&\"function\"==typeof t.slice&&n(t.slice(0,0))}e.exports=function(t){return null!=t&&(n(t)||i(t)||!!t._isBuffer)}},{}],278:[function(t,e,r){function n(t){return t||\"undefined\"==typeof navigator||(t=navigator.userAgent),t&&t.headers&&\"string\"==typeof t.headers[\"user-agent\"]&&(t=t.headers[\"user-agent\"]),\"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)))}e.exports=n},{}],279:[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({}))}},{}],280:[function(t,e,r){\"use strict\";function n(t,e,r,n,a){return new i(t,e,r,n,a)}function i(t,e,r,n,i){e=e||a,r=r||o,i=i||Array,this.nodeSize=n||64,this.points=t,this.ids=new i(t.length),this.coords=new i(2*t.length);for(var l=0;l<t.length;l++)this.ids[l]=l,this.coords[2*l]=e(t[l]),this.coords[2*l+1]=r(t[l]);s(this.ids,this.coords,this.nodeSize,0,this.ids.length-1,0)}function a(t){return t[0]}function o(t){return t[1]}var s=t(\"./sort\"),l=t(\"./range\"),u=t(\"./within\");e.exports=n,i.prototype={range:function(t,e,r,n){return l(this.ids,this.coords,t,e,r,n,this.nodeSize)},within:function(t,e,r){return u(this.ids,this.coords,t,e,r,this.nodeSize)}}},{\"./range\":281,\"./sort\":282,\"./within\":283}],281:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o){for(var s,l,u=[0,t.length-1,0],c=[];u.length;){var h=u.pop(),f=u.pop(),d=u.pop();if(f-d<=o)for(var p=d;p<=f;p++)s=e[2*p],l=e[2*p+1],s>=r&&s<=i&&l>=n&&l<=a&&c.push(t[p]);else{var m=Math.floor((d+f)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&c.push(t[m]);var g=(h+1)%2;(0===h?r<=s:n<=l)&&(u.push(d),u.push(m-1),u.push(g)),(0===h?i>=s:a>=l)&&(u.push(m+1),u.push(f),u.push(g))}}return c}e.exports=n},{}],282:[function(t,e,r){\"use strict\";function n(t,e,r,a,o,s){if(!(o-a<=r)){var l=Math.floor((a+o)/2);i(t,e,l,a,o,s%2),n(t,e,r,a,l-1,s+1),n(t,e,r,l+1,o,s+1)}}function i(t,e,r,n,o,s){for(;o>n;){if(o-n>600){var l=o-n+1,u=r-n+1,c=Math.log(l),h=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1);i(t,e,r,Math.max(n,Math.floor(r-u*h/l+f)),Math.min(o,Math.floor(r+(l-u)*h/l+f)),s)}var d=e[2*r+s],p=n,m=o;for(a(t,e,n,r),e[2*o+s]>d&&a(t,e,n,o);p<m;){for(a(t,e,p,m),p++,m--;e[2*p+s]<d;)p++;for(;e[2*m+s]>d;)m--}e[2*n+s]===d?a(t,e,n,m):a(t,e,++m,o),m<=r&&(n=m+1),r<=m&&(o=m-1)}}function a(t,e,r,n){o(t,r,n),o(e,2*r,2*n),o(e,2*r+1,2*n+1)}function o(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],283:[function(t,e,r){\"use strict\";function n(t,e,r,n,a,o){for(var s=[0,t.length-1,0],l=[],u=a*a;s.length;){var c=s.pop(),h=s.pop(),f=s.pop();if(h-f<=o)for(var d=f;d<=h;d++)i(e[2*d],e[2*d+1],r,n)<=u&&l.push(t[d]);else{var p=Math.floor((f+h)/2),m=e[2*p],g=e[2*p+1];i(m,g,r,n)<=u&&l.push(t[p]);var v=(c+1)%2;(0===c?r-a<=m:n-a<=g)&&(s.push(f),s.push(p-1),s.push(v)),(0===c?r+a>=m:n+a>=g)&&(s.push(p+1),s.push(h),s.push(v))}}return l}function i(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}e.exports=n},{}],284:[function(t,e,r){\"use strict\";function n(t,e){var r;if(h(t)){var l,u=t.stops&&\"object\"==typeof t.stops[0][0],c=u||void 0!==t.property,f=u||!c,d=t.type||e||\"exponential\";if(\"exponential\"===d)l=o;else if(\"interval\"===d)l=a;else if(\"categorical\"===d)l=i;else{if(\"identity\"!==d)throw new Error('Unknown function type \"'+d+'\"');l=s}if(u){for(var p={},m=[],g=0;g<t.stops.length;g++){var v=t.stops[g];void 0===p[v[0].zoom]&&(p[v[0].zoom]={zoom:v[0].zoom,type:t.type,property:t.property,stops:[]}),p[v[0].zoom].stops.push([v[0].value,v[1]])}for(var y in p)m.push([p[y].zoom,n(p[y])]);(r=function(e,r){return o({stops:m,base:t.base},e)(e,r)}).isFeatureConstant=!1,r.isZoomConstant=!1}else f?((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;;){if(n>=t.stops.length)break;if(e<=t.stops[n][0])break;n++}return 0===n?t.stops[n][1]:n===t.stops.length?t.stops[n-1][1]:l(e,r,t.stops[n-1][0],t.stops[n][0],t.stops[n-1][1],t.stops[n][1])}function s(t,e){return e}function l(t,e,r,n,i,a){return\"function\"==typeof i?function(){var o=i.apply(void 0,arguments),s=a.apply(void 0,arguments);return l(t,e,r,n,o,s)}:i.length?c(t,e,r,n,i,a):u(t,e,r,n,i,a)}function u(t,e,r,n,i,a){var o,s=n-r,l=t-r;return o=1===e?l/s:(Math.pow(e,l)-1)/(Math.pow(e,s)-1),i*(1-o)+a*o}function c(t,e,r,n,i,a){for(var o=[],s=0;s<i.length;s++)o[s]=u(t,e,r,n,i[s],a[s]);return o}function h(t){return\"object\"==typeof t&&(t.stops||\"identity\"===t.type)}e.exports.isFunctionDefinition=h,e.exports.interpolated=function(t){return n(t,\"exponential\")},e.exports[\"piecewise-constant\"]=function(t){return n(t,\"interval\")}},{}],285:[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:457}],286:[function(t,e,r){\"use strict\";function n(t,e){this.message=(t?t+\": \":\"\")+i.apply(i,Array.prototype.slice.call(arguments,2)),null!==e&&void 0!==e&&e.__line__&&(this.line=e.__line__)}var i=t(\"util\").format;e.exports=n},{util:529}],287:[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}},{}],288:[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}},{}],289:[function(t,e,r){\"use strict\";e.exports=function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}},{}],290:[function(t,e,r){\"use strict\";var n=t(\"../error/validation_error\"),i=t(\"../util/get_type\"),a=t(\"../util/extend\");e.exports=function(e){var r=t(\"./validate_function\"),o=t(\"./validate_object\"),s={\"*\":function(){return[]},array:t(\"./validate_array\"),boolean:t(\"./validate_boolean\"),number:t(\"./validate_number\"),color:t(\"./validate_color\"),constants:t(\"./validate_constants\"),enum:t(\"./validate_enum\"),filter:t(\"./validate_filter\"),function:t(\"./validate_function\"),layer:t(\"./validate_layer\"),object:t(\"./validate_object\"),source:t(\"./validate_source\"),string:t(\"./validate_string\")},l=e.value,u=e.valueSpec,c=e.key,h=e.styleSpec,f=e.style;if(\"string\"===i(l)&&\"@\"===l[0]){if(h.$version>7)return[new n(c,l,\"constants have been deprecated as of v8\")];if(!(l in f.constants))return[new n(c,l,'constant \"%s\" not found',l)];e=a({},e,{value:f.constants[l]})}return u.function&&\"object\"===i(l)?r(e):u.type&&s[u.type]?s[u.type](e):o(a({},e,{valueSpec:u.type?h[u.type]:u}))}},{\"../error/validation_error\":286,\"../util/extend\":287,\"../util/get_type\":288,\"./validate_array\":291,\"./validate_boolean\":292,\"./validate_color\":293,\"./validate_constants\":294,\"./validate_enum\":295,\"./validate_filter\":296,\"./validate_function\":297,\"./validate_layer\":299,\"./validate_number\":301,\"./validate_object\":302,\"./validate_source\":304,\"./validate_string\":305}],291:[function(t,e,r){\"use strict\";var n=t(\"../util/get_type\"),i=t(\"./validate\"),a=t(\"../error/validation_error\");e.exports=function(t){var e=t.value,r=t.valueSpec,o=t.style,s=t.styleSpec,l=t.key,u=t.arrayElementValidator||i;if(\"array\"!==n(e))return[new a(l,e,\"array expected, %s found\",n(e))];if(r.length&&e.length!==r.length)return[new a(l,e,\"array length %d expected, length %d found\",r.length,e.length)];if(r[\"min-length\"]&&e.length<r[\"min-length\"])return[new a(l,e,\"array length at least %d expected, length %d found\",r[\"min-length\"],e.length)];var c={type:r.value};s.$version<7&&(c.function=r.function),\"object\"===n(r.value)&&(c=r.value);for(var h=[],f=0;f<e.length;f++)h=h.concat(u({array:e,arrayIndex:f,value:e[f],valueSpec:c,style:o,styleSpec:s,key:l+\"[\"+f+\"]\"}));return h}},{\"../error/validation_error\":286,\"../util/get_type\":288,\"./validate\":290}],292:[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\":286,\"../util/get_type\":288}],293:[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\":286,\"../util/get_type\":288,csscolorparser:101}],294:[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\":286,\"../util/get_type\":288}],295:[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\":286,\"../util/unbundle_jsonlint\":289}],296:[function(t,e,r){\"use strict\";var n=t(\"../error/validation_error\"),i=t(\"./validate_enum\"),a=t(\"../util/get_type\"),o=t(\"../util/unbundle_jsonlint\");e.exports=function t(e){var r,s=e.value,l=e.key,u=e.styleSpec,c=[];if(\"array\"!==a(s))return[new n(l,s,\"array expected, %s found\",a(s))];if(s.length<1)return[new n(l,s,\"filter array must have at least 1 element\")];switch(c=c.concat(i({key:l+\"[0]\",value:s[0],valueSpec:u.filter_operator,style:e.style,styleSpec:e.styleSpec})),o(s[0])){case\"<\":case\"<=\":case\">\":case\">=\":s.length>=2&&\"$type\"==s[1]&&c.push(new n(l,s,'\"$type\" cannot be use with operator \"%s\"',s[0]));case\"==\":case\"!=\":3!=s.length&&c.push(new n(l,s,'filter array for operator \"%s\" must have 3 elements',s[0]));case\"in\":case\"!in\":s.length>=2&&(\"string\"!==(r=a(s[1]))?c.push(new n(l+\"[1]\",s[1],\"string expected, %s found\",r)):\"@\"===s[1][0]&&c.push(new n(l+\"[1]\",s[1],\"filter key cannot be a constant\")));for(var h=2;h<s.length;h++)r=a(s[h]),\"$type\"==s[1]?c=c.concat(i({key:l+\"[\"+h+\"]\",value:s[h],valueSpec:u.geometry_type,style:e.style,styleSpec:e.styleSpec})):\"string\"===r&&\"@\"===s[h][0]?c.push(new n(l+\"[\"+h+\"]\",s[h],\"filter value cannot be a constant\")):\"string\"!==r&&\"number\"!==r&&\"boolean\"!==r&&c.push(new n(l+\"[\"+h+\"]\",s[h],\"string, number, or boolean expected, %s found\",r));break;case\"any\":case\"all\":case\"none\":for(h=1;h<s.length;h++)c=c.concat(t({key:l+\"[\"+h+\"]\",value:s[h],style:e.style,styleSpec:e.styleSpec}));break;case\"has\":case\"!has\":r=a(s[1]),2!==s.length?c.push(new n(l,s,'filter array for \"%s\" operator must have 2 elements',s[0])):\"string\"!==r?c.push(new n(l+\"[1]\",s[1],\"string expected, %s found\",r)):\"@\"===s[1][0]&&c.push(new n(l+\"[1]\",s[1],\"filter key cannot be a constant\"))}return c}},{\"../error/validation_error\":286,\"../util/get_type\":288,\"../util/unbundle_jsonlint\":289,\"./validate_enum\":295}],297:[function(t,e,r){\"use strict\";var n=t(\"../error/validation_error\"),i=t(\"../util/get_type\"),a=t(\"./validate\"),o=t(\"./validate_object\"),s=t(\"./validate_array\"),l=t(\"./validate_number\");e.exports=function(t){function e(t){var e=[],a=t.value;return e=e.concat(s({key:t.key,value:a,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:r})),\"array\"===i(a)&&0===a.length&&e.push(new n(t.key,a,\"array must have at least one stop\")),e}function r(t){var e=[],r=t.value,s=t.key;if(\"array\"!==i(r))return[new n(s,r,\"array expected, %s found\",i(r))];if(2!==r.length)return[new n(s,r,\"array length %d expected, length %d found\",2,r.length)];var f=i(r[0]);if(c||(c=f),f!==c)return[new n(s,r,\"%s stop key type must match previous stop key type %s\",f,c)];if(\"object\"===f){if(void 0===r[0].zoom)return[new n(s,r,\"object stop key must have zoom\")];if(void 0===r[0].value)return[new n(s,r,\"object stop key must have value\")];e=e.concat(o({key:s+\"[0]\",value:r[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:l,value:u}}))}else e=e.concat((d?l:u)({key:s+\"[0]\",value:r[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec}));return e=e.concat(a({key:s+\"[1]\",value:r[1],valueSpec:h,style:t.style,styleSpec:t.styleSpec})),\"number\"===i(r[0])&&(\"piecewise-constant\"===h.function&&r[0]%1!=0&&e.push(new n(s+\"[0]\",r[0],\"zoom level for piecewise-constant functions must be an integer\")),0!==t.arrayIndex&&r[0]<t.array[t.arrayIndex-1][0]&&e.push(new n(s+\"[0]\",r[0],\"array stops must appear in ascending order\"))),e}function u(t){var e=[],r=i(t.value);return\"number\"!==r&&\"string\"!==r&&\"array\"!==r&&e.push(new n(t.key,t.value,\"property value must be a number, string or array\")),e}var c,h=t.valueSpec,f=void 0!==t.value.property||\"object\"===c,d=void 0===t.value.property||\"object\"===c,p=o({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:e}});return t.styleSpec.$version>=8&&(f&&!t.valueSpec[\"property-function\"]?p.push(new n(t.key,t.value,\"property functions not supported\")):d&&!t.valueSpec[\"zoom-function\"]&&p.push(new n(t.key,t.value,\"zoom functions not supported\"))),p}},{\"../error/validation_error\":286,\"../util/get_type\":288,\"./validate\":290,\"./validate_array\":291,\"./validate_number\":301,\"./validate_object\":302}],298:[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\":286,\"./validate_string\":305}],299:[function(t,e,r){\"use strict\";var n=t(\"../error/validation_error\"),i=t(\"../util/unbundle_jsonlint\"),a=t(\"./validate_object\"),o=t(\"./validate_filter\"),s=t(\"./validate_paint_property\"),l=t(\"./validate_layout_property\"),u=t(\"../util/extend\");e.exports=function(t){var e=[],r=t.value,c=t.key,h=t.style,f=t.styleSpec;r.type||r.ref||e.push(new n(c,r,'either \"type\" or \"ref\" is required'));var d=i(r.type),p=i(r.ref);if(r.id)for(var m=0;m<t.arrayIndex;m++){var g=h.layers[m];i(g.id)===i(r.id)&&e.push(new n(c,r.id,'duplicate layer id \"%s\", previously used at line %d',r.id,g.id.__line__))}if(\"ref\"in r){[\"type\",\"source\",\"source-layer\",\"filter\",\"layout\"].forEach(function(t){t in r&&e.push(new n(c,r[t],'\"%s\" is prohibited for ref layers',t))});var v;h.layers.forEach(function(t){t.id==p&&(v=t)}),v?v.ref?e.push(new n(c,r.ref,\"ref cannot reference another ref layer\")):d=i(v.type):e.push(new n(c,r.ref,'ref layer \"%s\" not found',p))}else if(\"background\"!==d)if(r.source){var y=h.sources&&h.sources[r.source];y?\"vector\"==y.type&&\"raster\"==d?e.push(new n(c,r.source,'layer \"%s\" requires a raster source',r.id)):\"raster\"==y.type&&\"raster\"!=d?e.push(new n(c,r.source,'layer \"%s\" requires a vector source',r.id)):\"vector\"!=y.type||r[\"source-layer\"]||e.push(new n(c,r,'layer \"%s\" must specify a \"source-layer\"',r.id)):e.push(new n(c,r.source,'source \"%s\" not found',r.source))}else e.push(new n(c,r,'missing required property \"source\"'));return e=e.concat(a({key:c,value:r,valueSpec:f.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{filter:o,layout:function(t){return a({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{\"*\":function(t){return l(u({layerType:d},t))}}})},paint:function(t){return a({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{\"*\":function(t){return s(u({layerType:d},t))}}})}}}))}},{\"../error/validation_error\":286,\"../util/extend\":287,\"../util/unbundle_jsonlint\":289,\"./validate_filter\":296,\"./validate_layout_property\":300,\"./validate_object\":302,\"./validate_paint_property\":303}],300:[function(t,e,r){\"use strict\";var n=t(\"./validate\"),i=t(\"../error/validation_error\");e.exports=function(t){var e=t.key,r=t.style,a=t.styleSpec,o=t.value,s=t.objectKey,l=a[\"layout_\"+t.layerType];if(t.valueSpec||l[s]){var u=[];return\"symbol\"===t.layerType&&(\"icon-image\"===s&&r&&!r.sprite?u.push(new i(e,o,'use of \"icon-image\" requires a style \"sprite\" property')):\"text-field\"===s&&r&&!r.glyphs&&u.push(new i(e,o,'use of \"text-field\" requires a style \"glyphs\" property'))),u.concat(n({key:t.key,value:o,valueSpec:t.valueSpec||l[s],style:r,styleSpec:a}))}return[new i(e,o,'unknown property \"%s\"',s)]}},{\"../error/validation_error\":286,\"./validate\":290}],301:[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\":286,\"../util/get_type\":288}],302:[function(t,e,r){\"use strict\";var n=t(\"../error/validation_error\"),i=t(\"../util/get_type\"),a=t(\"./validate\");e.exports=function(t){var e=t.key,r=t.value,o=t.valueSpec,s=t.objectElementValidators||{},l=t.style,u=t.styleSpec,c=[],h=i(r);if(\"object\"!==h)return[new n(e,r,\"object expected, %s found\",h)];for(var f in r){var d=f.split(\".\")[0],p=o&&(o[d]||o[\"*\"]),m=s[d]||s[\"*\"];p||m?c=c.concat((m||a)({key:(e?e+\".\":e)+f,value:r[f],valueSpec:p,style:l,styleSpec:u,object:r,objectKey:f})):\"\"!==e&&1!==e.split(\".\").length&&c.push(new n(e,r[f],'unknown property \"%s\"',f))}for(d in o)o[d].required&&void 0===o[d].default&&void 0===r[d]&&c.push(new n(e,r,'missing required property \"%s\"',d));return c}},{\"../error/validation_error\":286,\"../util/get_type\":288,\"./validate\":290}],303:[function(t,e,r){\"use strict\";var n=t(\"./validate\"),i=t(\"../error/validation_error\");e.exports=function(t){var e=t.key,r=t.style,a=t.styleSpec,o=t.value,s=t.objectKey,l=a[\"paint_\"+t.layerType],u=s.match(/^(.*)-transition$/);return u&&l[u[1]]&&l[u[1]].transition?n({key:e,value:o,valueSpec:a.transition,style:r,styleSpec:a}):t.valueSpec||l[s]?n({key:t.key,value:o,valueSpec:t.valueSpec||l[s],style:r,styleSpec:a}):[new i(e,o,'unknown property \"%s\"',s)]}},{\"../error/validation_error\":286,\"./validate\":290}],304:[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 u=[];if(u=u.concat(a({key:r,value:e,valueSpec:s.source_tile,style:t.style,styleSpec:s})),\"url\"in e)for(var c in e)[\"type\",\"url\",\"tileSize\"].indexOf(c)<0&&u.push(new n(r+\".\"+c,e[c],'a source with a \"url\" property may not include a \"%s\" property',c));return u;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\":286,\"../util/unbundle_jsonlint\":289,\"./validate_enum\":295,\"./validate_object\":302}],305:[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\":286,\"../util/get_type\":288}],306:[function(t,e,r){\"use strict\";function n(t,e){e=e||l;var r=[];return r=r.concat(s({key:\"\",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:u}})),e.$version>7&&t.constants&&(r=r.concat(o({key:\"constants\",value:t.constants,style:t,styleSpec:e}))),i(r)}function i(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function a(t){return function(){return i(t.apply(this,arguments))}}var o=t(\"./validate/validate_constants\"),s=t(\"./validate/validate\"),l=t(\"../reference/latest.min\"),u=t(\"./validate/validate_glyphs_url\");n.source=a(t(\"./validate/validate_source\")),n.layer=a(t(\"./validate/validate_layer\")),n.filter=a(t(\"./validate/validate_filter\")),n.paintProperty=a(t(\"./validate/validate_paint_property\")),n.layoutProperty=a(t(\"./validate/validate_layout_property\")),e.exports=n},{\"../reference/latest.min\":307,\"./validate/validate\":290,\"./validate/validate_constants\":294,\"./validate/validate_filter\":296,\"./validate/validate_glyphs_url\":298,\"./validate/validate_layer\":299,\"./validate/validate_layout_property\":300,\"./validate/validate_paint_property\":303,\"./validate/validate_source\":304}],307:[function(t,e,r){e.exports=t(\"./v8.min.json\")},{\"./v8.min.json\":308}],308:[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\"}}}},{}],309:[function(t,e,r){\"use strict\";function n(t){return!!(i()&&a()&&o()&&s()&&l()&&u()&&c()&&h(t&&t.failIfMajorPerformanceCaveat))}function i(){return\"undefined\"!=typeof window&&\"undefined\"!=typeof document}function a(){return Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray}function o(){return Function.prototype&&Function.prototype.bind}function s(){return Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions}function l(){return\"JSON\"in window&&\"parse\"in JSON&&\"stringify\"in JSON}function u(){return\"Worker\"in window}function c(){return\"Uint8ClampedArray\"in window}function h(t){return void 0===d[t]&&(d[t]=f(t)),d[t]}function f(t){var e=document.createElement(\"canvas\"),r=Object.create(n.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,e.probablySupportsContext?e.probablySupportsContext(\"webgl\",r)||e.probablySupportsContext(\"experimental-webgl\",r):e.supportsContext?e.supportsContext(\"webgl\",r)||e.supportsContext(\"experimental-webgl\",r):e.getContext(\"webgl\",r)||e.getContext(\"experimental-webgl\",r)}void 0!==e&&e.exports?e.exports=n:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=n);var d={};n.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],310:[function(t,e,r){\"use strict\";function n(t){var e=t.layoutVertexArrayType;this.layoutVertexArray=new e;var r=t.elementArrayType;r&&(this.elementArray=new r);var n=t.elementArrayType2;n&&(this.elementArray2=new n),this.paintVertexArrays=i.mapObject(t.paintVertexArrayTypes,function(t){return new t})}var i=t(\"../util/util\");e.exports=n,n.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,n.prototype.hasCapacityFor=function(t){return this.layoutVertexArray.length+t<=n.MAX_VERTEX_ARRAY_LENGTH},n.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},n.prototype.trim=function(){this.layoutVertexArray.trim(),this.elementArray&&this.elementArray.trim(),this.elementArray2&&this.elementArray2.trim();for(var t in this.paintVertexArrays)this.paintVertexArrays[t].trim()},n.prototype.serialize=function(){return{layoutVertexArray:this.layoutVertexArray.serialize(),elementArray:this.elementArray&&this.elementArray.serialize(),elementArray2:this.elementArray2&&this.elementArray2.serialize(),paintVertexArrays:i.mapObject(this.paintVertexArrays,function(t){return t.serialize()})}},n.prototype.getTransferables=function(t){t.push(this.layoutVertexArray.arrayBuffer),this.elementArray&&t.push(this.elementArray.arrayBuffer),this.elementArray2&&t.push(this.elementArray2.arrayBuffer);for(var e in this.paintVertexArrays)t.push(this.paintVertexArrays[e].arrayBuffer)}},{\"../util/util\":424}],311:[function(t,e,r){\"use strict\";function n(t){if(this.zoom=t.zoom,this.overscaling=t.overscaling,this.layer=t.layer,this.childLayers=t.childLayers,this.type=this.layer.type,this.features=[],this.id=this.layer.id,this.index=t.index,this.sourceLayer=this.layer.sourceLayer,this.sourceLayerIndex=t.sourceLayerIndex,this.minZoom=this.layer.minzoom,this.maxZoom=this.layer.maxzoom,this.paintAttributes=i(this),t.arrays){var e=this.programInterfaces;this.bufferGroups=c.mapObject(t.arrays,function(r,n){var i=e[n],a=t.paintVertexArrayTypes[n];return r.map(function(t){return new u(t,{layoutVertexArrayType:i.layoutVertexArrayType.serialize(),elementArrayType:i.elementArrayType&&i.elementArrayType.serialize(),elementArrayType2:i.elementArrayType2&&i.elementArrayType2.serialize(),paintVertexArrayTypes:a})})})}}function i(t){var e={};for(var r in t.programInterfaces){for(var n=e[r]={},i=0;i<t.childLayers.length;i++)n[t.childLayers[i].id]={attributes:[],uniforms:[],defines:[],vertexPragmas:{define:{},initialize:{}},fragmentPragmas:{define:{},initialize:{}}};var s=t.programInterfaces[r];if(s.paintAttributes)for(var l=0;l<s.paintAttributes.length;l++){var u=s.paintAttributes[l];u.multiplier=u.multiplier||1;for(var h=0;h<t.childLayers.length;h++){var d=t.childLayers[h],p=n[d.id],m=u.name;f(\"a_\"===u.name.slice(0,2));var g,v=u.name.slice(2);if(p.fragmentPragmas.initialize[v]=\"\",d.isPaintValueFeatureConstant(u.paintProperty))p.uniforms.push(u),p.fragmentPragmas.define[v]=p.vertexPragmas.define[v]=[\"uniform\",\"{precision}\",\"{type}\",m].join(\" \")+\";\",p.fragmentPragmas.initialize[v]=p.vertexPragmas.initialize[v]=[\"{precision}\",\"{type}\",v,\"=\",m].join(\" \")+\";\\n\";else if(d.isPaintValueZoomConstant(u.paintProperty)){p.attributes.push(c.extend({},u,{name:m})),g=[\"varying\",\"{precision}\",\"{type}\",v].join(\" \")+\";\\n\";var y=[p.fragmentPragmas.define[v],\"attribute\",\"{precision}\",\"{type}\",m].join(\" \")+\";\\n\";p.fragmentPragmas.define[v]=g,p.vertexPragmas.define[v]=g+y,p.vertexPragmas.initialize[v]=[v,\"=\",m,\"/\",u.multiplier.toFixed(1)].join(\" \")+\";\\n\"}else{for(var b=\"u_\"+m.slice(2)+\"_t\",x=d.getPaintValueStopZoomLevels(u.paintProperty),_=0;_<x.length&&x[_]<t.zoom;)_++;for(var w=Math.max(0,Math.min(x.length-4,_-2)),M=[],k=0;k<4;k++)M.push(x[Math.min(w+k,x.length-1)]);g=[\"varying\",\"{precision}\",\"{type}\",v].join(\" \")+\";\\n\",p.vertexPragmas.define[v]=g+[\"uniform\",\"lowp\",\"float\",b].join(\" \")+\";\\n\",p.fragmentPragmas.define[v]=g,p.uniforms.push(c.extend({},u,{name:b,getValue:o(u,w),components:1}));var A=u.components;if(1===A)p.attributes.push(c.extend({},u,{getValue:a(u,M),isFunction:!0,components:4*A})),p.vertexPragmas.define[v]+=[\"attribute\",\"{precision}\",\"vec4\",m].join(\" \")+\";\\n\",p.vertexPragmas.initialize[v]=[v,\"=\",\"evaluate_zoom_function_1(\"+m+\", \"+b+\")\",\"/\",u.multiplier.toFixed(1)].join(\" \")+\";\\n\";else{for(var T=[],S=0;S<4;S++)T.push(m+S),p.attributes.push(c.extend({},u,{getValue:a(u,[M[S]]),isFunction:!0,name:m+S})),p.vertexPragmas.define[v]+=[\"attribute\",\"{precision}\",\"{type}\",m+S].join(\" \")+\";\\n\";p.vertexPragmas.initialize[v]=[v,\" = \",\"evaluate_zoom_function_4(\"+T.join(\", \")+\", \"+b+\")\",\"/\",u.multiplier.toFixed(1)].join(\" \")+\";\\n\"}}}}}return e}function a(t,e){return function(r,n,i){if(1===e.length)return t.getValue(r,c.extend({},n,{zoom:e[0]}),i);for(var a=[],o=0;o<e.length;o++){var s=e[o];a.push(t.getValue(r,c.extend({},n,{zoom:s}),i)[0])}return a}}function o(t,e){return function(r,n){var i=r.getPaintInterpolationT(t.paintProperty,n.zoom);return[Math.max(0,Math.min(4,i-e))]}}var s=t(\"feature-filter\"),l=t(\"./array_group\"),u=t(\"./buffer_group\"),c=t(\"../util/util\"),h=t(\"../util/struct_array\"),f=t(\"assert\");e.exports=n,n.create=function(e){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)},n.EXTENT=8192,n.prototype.populateArrays=function(){this.createArrays(),this.recalculateStyleLayers();for(var t=0;t<this.features.length;t++)this.addFeature(this.features[t]);this.trimArrays()},n.prototype.prepareArrayGroup=function(t,e){var r=this.arrayGroups[t],n=r.length&&r[r.length-1];return n&&n.hasCapacityFor(e)||((n=new l({layoutVertexArrayType:this.programInterfaces[t].layoutVertexArrayType,elementArrayType:this.programInterfaces[t].elementArrayType,elementArrayType2:this.programInterfaces[t].elementArrayType2,paintVertexArrayTypes:this.paintVertexArrayTypes[t]})).index=r.length,r.push(n)),n},n.prototype.createArrays=function(){this.arrayGroups={},this.paintVertexArrayTypes={};for(var t in this.programInterfaces){this.arrayGroups[t]=[];var e=this.paintVertexArrayTypes[t]={},r=this.paintAttributes[t];for(var i in r)e[i]=new n.VertexArrayType(r[i].attributes)}},n.prototype.destroy=function(t){for(var e in this.bufferGroups)for(var r=this.bufferGroups[e],n=0;n<r.length;n++)r[n].destroy(t)},n.prototype.trimArrays=function(){for(var t in this.arrayGroups)for(var e=this.arrayGroups[t],r=0;r<e.length;r++)e[r].trim()},n.prototype.isEmpty=function(){for(var t in this.arrayGroups)for(var e=this.arrayGroups[t],r=0;r<e.length;r++)if(!e[r].isEmpty())return!1;return!0},n.prototype.getTransferables=function(t){for(var e in this.arrayGroups)for(var r=this.arrayGroups[e],n=0;n<r.length;n++)r[n].getTransferables(t)},n.prototype.setUniforms=function(t,e,r,n,i){for(var a=this.paintAttributes[e][n.id].uniforms,o=0;o<a.length;o++){var s=a[o],l=r[s.name];t[\"uniform\"+s.components+\"fv\"](l,s.getValue(n,i))}},n.prototype.serialize=function(){return{layerId:this.layer.id,zoom:this.zoom,arrays:c.mapObject(this.arrayGroups,function(t){return t.map(function(t){return t.serialize()})}),paintVertexArrayTypes:c.mapObject(this.paintVertexArrayTypes,function(t){return c.mapObject(t,function(t){return t.serialize()})}),childLayerIds:this.childLayers.map(function(t){return t.id})}},n.prototype.createFilter=function(){this.filter||(this.filter=s(this.layer.filter))};var d={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0};n.prototype.recalculateStyleLayers=function(){for(var t=0;t<this.childLayers.length;t++)this.childLayers[t].recalculate(this.zoom,d)},n.prototype.populatePaintArrays=function(t,e,r,n,i){for(var a=0;a<this.childLayers.length;a++)for(var o=this.childLayers[a],s=this.arrayGroups[t],l=n.index;l<s.length;l++){var u=s[l],c=u.layoutVertexArray.length,h=u.paintVertexArrays[o.id];h.resize(c);for(var f=this.paintAttributes[t][o.id].attributes,d=0;d<f.length;d++)for(var p=f[d],m=p.getValue(o,e,r),g=p.multiplier||1,v=p.components||1,y=l===n.index?i:0;y<c;y++)for(var b=h.get(y),x=0;x<v;x++)b[v>1?p.name+x:p.name]=m[x]*g}},n.VertexArrayType=function(t){return new h({members:t,alignment:4})},n.ElementArrayType=function(t){return new h({members:[{type:\"Uint16\",name:\"vertices\",components:t||3}]})}},{\"../util/struct_array\":422,\"../util/util\":424,\"./array_group\":310,\"./bucket/circle_bucket\":312,\"./bucket/fill_bucket\":313,\"./bucket/line_bucket\":314,\"./bucket/symbol_bucket\":315,\"./buffer_group\":317,assert:40,\"feature-filter\":117}],312:[function(t,e,r){\"use strict\";function n(){i.apply(this,arguments)}var i=t(\"../bucket\"),a=t(\"../../util/util\"),o=t(\"../load_geometry\"),s=i.EXTENT;e.exports=n,n.prototype=a.inherit(i,{}),n.prototype.addCircleVertex=function(t,e,r,n,i){return t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)},n.prototype.programInterfaces={circle:{layoutVertexArrayType:new i.VertexArrayType([{name:\"a_pos\",components:2,type:\"Int16\"}]),elementArrayType:new i.ElementArrayType,paintAttributes:[{name:\"a_color\",components:4,type:\"Uint8\",getValue:function(t,e,r){return t.getPaintValue(\"circle-color\",e,r)},multiplier:255,paintProperty:\"circle-color\"},{name:\"a_radius\",components:1,type:\"Uint16\",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue(\"circle-radius\",e,r)]},multiplier:10,paintProperty:\"circle-radius\"},{name:\"a_blur\",components:1,type:\"Uint16\",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue(\"circle-blur\",e,r)]},multiplier:10,paintProperty:\"circle-blur\"},{name:\"a_opacity\",components:1,type:\"Uint16\",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue(\"circle-opacity\",e,r)]},multiplier:255,paintProperty:\"circle-opacity\"}]}},n.prototype.addFeature=function(t){for(var e={zoom:this.zoom},r=o(t),n=this.prepareArrayGroup(\"circle\",0),i=n.layoutVertexArray.length,a=0;a<r.length;a++)for(var l=0;l<r[a].length;l++){var u=r[a][l].x,c=r[a][l].y;if(!(u<0||u>=s||c<0||c>=s)){var h=this.prepareArrayGroup(\"circle\",4),f=h.layoutVertexArray,d=this.addCircleVertex(f,u,c,-1,-1);this.addCircleVertex(f,u,c,1,-1),this.addCircleVertex(f,u,c,1,1),this.addCircleVertex(f,u,c,-1,1),h.elementArray.emplaceBack(d,d+1,d+2),h.elementArray.emplaceBack(d,d+3,d+2)}}this.populatePaintArrays(\"circle\",e,t.properties,n,i)}},{\"../../util/util\":424,\"../bucket\":311,\"../load_geometry\":319}],313:[function(t,e,r){\"use strict\";function n(){i.apply(this,arguments)}var i=t(\"../bucket\"),a=t(\"../../util/util\"),o=t(\"../load_geometry\"),s=t(\"earcut\"),l=t(\"../../util/classify_rings\");e.exports=n,n.prototype=a.inherit(i,{}),n.prototype.programInterfaces={fill:{layoutVertexArrayType:new i.VertexArrayType([{name:\"a_pos\",components:2,type:\"Int16\"}]),elementArrayType:new i.ElementArrayType(1),elementArrayType2:new i.ElementArrayType(2),paintAttributes:[{name:\"a_color\",components:4,type:\"Uint8\",getValue:function(t,e,r){return t.getPaintValue(\"fill-color\",e,r)},multiplier:255,paintProperty:\"fill-color\"},{name:\"a_outline_color\",components:4,type:\"Uint8\",getValue:function(t,e,r){return t.getPaintValue(\"fill-outline-color\",e,r)},multiplier:255,paintProperty:\"fill-outline-color\"},{name:\"a_opacity\",components:1,type:\"Uint8\",getValue:function(t,e,r){return[t.getPaintValue(\"fill-opacity\",e,r)]},multiplier:255,paintProperty:\"fill-opacity\"}]}},n.prototype.addFeature=function(t){for(var e=o(t),r=l(e,500),n=this.prepareArrayGroup(\"fill\",0),i=n.layoutVertexArray.length,a=0;a<r.length;a++)this.addPolygon(r[a]);this.populatePaintArrays(\"fill\",{zoom:this.zoom},t.properties,n,i)},n.prototype.addPolygon=function(t){for(var e=0,r=0;r<t.length;r++)e+=t[r].length;for(var n=this.prepareArrayGroup(\"fill\",e),i=[],a=[],o=n.layoutVertexArray.length,l=0;l<t.length;l++){var u=t[l];l>0&&a.push(i.length/2);for(var c=0;c<u.length;c++){var h=u[c],f=n.layoutVertexArray.emplaceBack(h.x,h.y);c>=1&&n.elementArray2.emplaceBack(f-1,f),i.push(h.x),i.push(h.y)}}for(var d=s(i,a),p=0;p<d.length;p++)n.elementArray.emplaceBack(d[p]+o)}},{\"../../util/classify_rings\":412,\"../../util/util\":424,\"../bucket\":311,\"../load_geometry\":319,earcut:111}],314:[function(t,e,r){\"use strict\";function n(){i.apply(this,arguments)}var i=t(\"../bucket\"),a=t(\"../../util/util\"),o=t(\"../load_geometry\"),s=i.EXTENT,l=Math.cos(Math.PI/180*37.5),u=Math.pow(2,14)/.5;e.exports=n,n.prototype=a.inherit(i,{}),n.prototype.addLineVertex=function(t,e,r,n,i,a,o){return t.emplaceBack(e.x<<1|n,e.y<<1|i,Math.round(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)},n.prototype.programInterfaces={line:{layoutVertexArrayType:new i.VertexArrayType([{name:\"a_pos\",components:2,type:\"Int16\"},{name:\"a_data\",components:4,type:\"Uint8\"}]),elementArrayType:new i.ElementArrayType}},n.prototype.addFeature=function(t){for(var e=o(t,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\"])},n.prototype.addLine=function(t,e,r,n,i){for(var a=t.length;a>2&&t[a-1].equals(t[a-2]);)a--;if(!(t.length<2)){\"bevel\"===e&&(n=1.05);var o=s/(512*this.overscaling)*15,u=t[0],c=t[a-1],h=u.equals(c);if(this.prepareArrayGroup(\"line\",10*a),2!==a||!h){this.distance=0;var f,d,p,m,g,v,y,b=r,x=h?\"butt\":r,_=!0;this.e1=this.e2=this.e3=-1,h&&(f=t[a-2],g=u.sub(f)._unit()._perp());for(var w=0;w<a;w++)if(!(p=h&&w===a-1?t[1]:t[w+1])||!t[w].equals(p)){g&&(m=g),f&&(d=f),f=t[w],g=p?p.sub(f)._unit()._perp():m;var M=(m=m||g).add(g)._unit(),k=M.x*g.x+M.y*g.y,A=1/k,T=k<l&&d&&p;if(T&&w>0){var S=f.dist(d);if(S>2*o){var E=f.sub(f.sub(d)._mult(o/S)._round());this.distance+=E.dist(d),this.addCurrentVertex(E,this.distance,m.mult(1),0,0,!1),d=E}}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+=f.dist(d)),\"miter\"===C)M._mult(A),this.addCurrentVertex(f,this.distance,M,0,0,!1);else if(\"flipbevel\"===C){if(A>100)M=g.clone();else{var z=m.x*g.y-m.y*g.x>0?-1:1,D=A*m.add(g).mag()/m.sub(g).mag();M._perp()._mult(D*z)}this.addCurrentVertex(f,this.distance,M,0,0,!1),this.addCurrentVertex(f,this.distance,M.mult(-1),0,0,!1)}else if(\"bevel\"===C||\"fakeround\"===C){var I=m.x*g.y-m.y*g.x>0,P=-Math.sqrt(A*A-1);if(I?(y=0,v=P):(v=0,y=P),_||this.addCurrentVertex(f,this.distance,m,v,y,!1),\"fakeround\"===C){for(var O,j=Math.floor(8*(.5-(k-.5))),R=0;R<j;R++)O=g.mult((R+1)/(j+1))._add(m)._unit(),this.addPieSliceVertex(f,this.distance,O,I);this.addPieSliceVertex(f,this.distance,M,I);for(var F=j-1;F>=0;F--)O=m.mult((F+1)/(j+1))._add(g)._unit(),this.addPieSliceVertex(f,this.distance,O,I)}p&&this.addCurrentVertex(f,this.distance,g,-v,-y,!1)}else\"butt\"===C?(_||this.addCurrentVertex(f,this.distance,m,0,0,!1),p&&this.addCurrentVertex(f,this.distance,g,0,0,!1)):\"square\"===C?(_||(this.addCurrentVertex(f,this.distance,m,1,1,!1),this.e1=this.e2=-1),p&&this.addCurrentVertex(f,this.distance,g,-1,-1,!1)):\"round\"===C&&(_||(this.addCurrentVertex(f,this.distance,m,0,0,!1),this.addCurrentVertex(f,this.distance,m,1,1,!0),this.e1=this.e2=-1),p&&(this.addCurrentVertex(f,this.distance,g,-1,-1,!0),this.addCurrentVertex(f,this.distance,g,0,0,!1)));if(T&&w<a-1){var N=f.dist(p);if(N>2*o){var B=f.add(p.sub(f)._mult(o/N)._round());this.distance+=B.dist(f),this.addCurrentVertex(B,this.distance,g.mult(1),0,0,!1),f=B}}_=!1}}}},n.prototype.addCurrentVertex=function(t,e,r,n,i,a){var o,s=a?1:0,l=this.arrayGroups.line[this.arrayGroups.line.length-1],c=l.layoutVertexArray,h=l.elementArray;o=r.clone(),n&&o._sub(r.perp()._mult(n)),this.e3=this.addLineVertex(c,t,o,s,0,n,e),this.e1>=0&&this.e2>=0&&h.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(c,t,o,s,1,-i,e),this.e1>=0&&this.e2>=0&&h.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,e>u/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,i,a))},n.prototype.addPieSliceVertex=function(t,e,r,n){var i=n?1:0;r=r.mult(n?-1:1);var a=this.arrayGroups.line[this.arrayGroups.line.length-1],o=a.layoutVertexArray,s=a.elementArray;this.e3=this.addLineVertex(o,t,r,0,i,0,e),this.e1>=0&&this.e2>=0&&s.emplaceBack(this.e1,this.e2,this.e3),n?this.e2=this.e3:this.e1=this.e3}},{\"../../util/util\":424,\"../bucket\":311,\"../load_geometry\":319}],315:[function(t,e,r){\"use strict\";function n(t){o.apply(this,arguments),this.showCollisionBoxes=t.showCollisionBoxes,this.overscaling=t.overscaling,this.collisionBoxArray=t.collisionBoxArray,this.symbolQuadsArray=t.symbolQuadsArray,this.symbolInstancesArray=t.symbolInstancesArray,this.sdfIcons=t.sdfIcons,this.iconsNeedLinear=t.iconsNeedLinear,this.adjustedTextSize=t.adjustedTextSize,this.adjustedIconSize=t.adjustedIconSize,this.fontstack=t.fontstack}function i(t,e,r,n,i,a,o,s,l,u,c){return t.emplaceBack(e,r,Math.round(64*n),Math.round(64*i),a/4,o/4,10*(u||0),c,10*(s||0),10*Math.min(l||25,25))}var a=t(\"point-geometry\"),o=t(\"../bucket\"),s=t(\"../../symbol/anchor\"),l=t(\"../../symbol/get_anchors\"),u=t(\"../../util/token\"),c=t(\"../../symbol/quads\"),h=t(\"../../symbol/shaping\"),f=t(\"../../symbol/resolve_text\"),d=t(\"../../symbol/mergelines\"),p=t(\"../../symbol/clip_line\"),m=t(\"../../util/util\"),g=t(\"../load_geometry\"),v=t(\"../../symbol/collision_feature\"),y=h.shapeText,b=h.shapeIcon,x=c.getGlyphQuads,_=c.getIconQuads,w=o.EXTENT;e.exports=n,n.MAX_QUADS=65535,n.prototype=m.inherit(o,{}),n.prototype.serialize=function(){var t=o.prototype.serialize.apply(this);return t.sdfIcons=this.sdfIcons,t.iconsNeedLinear=this.iconsNeedLinear,t.adjustedTextSize=this.adjustedTextSize,t.adjustedIconSize=this.adjustedIconSize,t.fontstack=this.fontstack,t};var M=new o.VertexArrayType([{name:\"a_pos\",components:2,type:\"Int16\"},{name:\"a_offset\",components:2,type:\"Int16\"},{name:\"a_texture_pos\",components:2,type:\"Uint16\"},{name:\"a_data\",components:4,type:\"Uint8\"}]),k=new o.ElementArrayType;n.prototype.addCollisionBoxVertex=function(t,e,r,n,i){return t.emplaceBack(e.x,e.y,Math.round(r.x),Math.round(r.y),10*n,10*i)},n.prototype.programInterfaces={glyph:{layoutVertexArrayType:M,elementArrayType:k},icon:{layoutVertexArrayType:M,elementArrayType:k},collisionBox:{layoutVertexArrayType:new o.VertexArrayType([{name:\"a_pos\",components:2,type:\"Int16\"},{name:\"a_extrude\",components:2,type:\"Int16\"},{name:\"a_data\",components:2,type:\"Uint8\"}])}},n.prototype.populateArrays=function(t,e,r){var n={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0};this.adjustedTextMaxSize=this.layer.getLayoutValue(\"text-size\",{zoom:18,zoomHistory:n}),this.adjustedTextSize=this.layer.getLayoutValue(\"text-size\",{zoom:this.zoom+1,zoomHistory:n}),this.adjustedIconMaxSize=this.layer.getLayoutValue(\"icon-size\",{zoom:18,zoomHistory:n}),this.adjustedIconSize=this.layer.getLayoutValue(\"icon-size\",{zoom:this.zoom+1,zoomHistory:n});var i=512*this.overscaling;this.tilePixelRatio=w/i,this.compareText={},this.iconsNeedLinear=!1,this.symbolInstancesStartIndex=this.symbolInstancesArray.length;var a=this.layer.layout,o=this.features,s=this.textFeatures,l=.5,c=.5;switch(a[\"text-anchor\"]){case\"right\":case\"top-right\":case\"bottom-right\":l=1;break;case\"left\":case\"top-left\":case\"bottom-left\":l=0}switch(a[\"text-anchor\"]){case\"bottom\":case\"bottom-right\":case\"bottom-left\":c=1;break;case\"top\":case\"top-right\":case\"top-left\":c=0}for(var h=\"right\"===a[\"text-justify\"]?1:\"left\"===a[\"text-justify\"]?0:.5,f=24*a[\"text-line-height\"],p=\"line\"!==a[\"symbol-placement\"]?24*a[\"text-max-width\"]:0,v=24*a[\"text-letter-spacing\"],x=[24*a[\"text-offset\"][0],24*a[\"text-offset\"][1]],_=this.fontstack=a[\"text-font\"].join(\",\"),M=[],k=0;k<o.length;k++)M.push(g(o[k]));if(\"line\"===a[\"symbol-placement\"]){var A=d(o,s,M);M=A.geometries,o=A.features,s=A.textFeatures}for(var T,S,E=0;E<o.length;E++)if(M[E]){if(T=s[E]?y(s[E],e[_],p,f,l,c,h,v,x):null,a[\"icon-image\"]){var L=r[u(o[E].properties,a[\"icon-image\"])];S=b(L,a),L&&(void 0===this.sdfIcons?this.sdfIcons=L.sdf:this.sdfIcons!==L.sdf&&m.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 S=null;(T||S)&&this.addFeature(M[E],T,S,o[E])}this.symbolInstancesEndIndex=this.symbolInstancesArray.length,this.placeFeatures(t,this.showCollisionBoxes),this.trimArrays()},n.prototype.addFeature=function(t,e,r,n){var i=this.layer.layout,a=this.adjustedTextSize/24,o=void 0!==this.adjustedTextMaxSize?this.adjustedTextMaxSize:this.adjustedTextSize,u=this.tilePixelRatio*a,c=this.tilePixelRatio*o/24,h=this.tilePixelRatio*this.adjustedIconSize,f=this.tilePixelRatio*i[\"symbol-spacing\"],d=i[\"symbol-avoid-edges\"],m=i[\"text-padding\"]*this.tilePixelRatio,g=i[\"icon-padding\"]*this.tilePixelRatio,v=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\"],x=i[\"text-allow-overlap\"]||i[\"icon-allow-overlap\"]||i[\"text-ignore-placement\"]||i[\"icon-ignore-placement\"],_=\"line\"===i[\"symbol-placement\"],M=f/2;_&&(t=p(t,0,0,w,w));for(var k=0;k<t.length;k++)for(var A,T=t[k],S=0,E=(A=_?l(T,f,v,e,r,24,c,this.overscaling,w):[new s(T[0].x,T[0].y,0)]).length;S<E;S++){var L=A[S];if(!(e&&_&&this.anchorIsTooClose(e.text,M,L))){var C=!(L.x<0||L.x>w||L.y<0||L.y>w);if(!d||C){var z=C||x;this.addSymbolInstance(L,T,e,r,this.layer,z,this.symbolInstancesArray.length,this.collisionBoxArray,n.index,this.sourceLayerIndex,this.index,u,m,y,h,g,b,{zoom:this.zoom},n.properties)}}}},n.prototype.anchorIsTooClose=function(t,e,r){var n=this.compareText;if(t in n){for(var i=n[t],a=i.length-1;a>=0;a--)if(r.dist(i[a])<e)return!0}else n[t]=[];return n[t].push(r),!1},n.prototype.placeFeatures=function(t,e){this.recalculateStyleLayers(),this.createArrays();var r=this.layer.layout,n=t.maxScale,i=\"map\"===r[\"text-rotation-alignment\"]&&\"line\"===r[\"symbol-placement\"],a=\"map\"===r[\"icon-rotation-alignment\"]&&\"line\"===r[\"symbol-placement\"];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),u=Math.cos(s);this.sortedSymbolInstances=o.sort(function(t,e){return(l*t.anchorPointX+u*t.anchorPointY|0)-(l*e.anchorPointX+u*e.anchorPointY|0)||e.index-t.index})}for(var c=this.symbolInstancesStartIndex;c<this.symbolInstancesEndIndex;c++){var h=this.sortedSymbolInstances?this.sortedSymbolInstances[c-this.symbolInstancesStartIndex]:this.symbolInstancesArray.get(c),f={boxStartIndex:h.textBoxStartIndex,boxEndIndex:h.textBoxEndIndex},d={boxStartIndex:h.iconBoxStartIndex,boxEndIndex:h.iconBoxEndIndex},p=!(h.textBoxStartIndex===h.textBoxEndIndex),m=!(h.iconBoxStartIndex===h.iconBoxEndIndex),g=r[\"text-optional\"]||!p,v=r[\"icon-optional\"]||!m,y=p?t.placeCollisionFeature(f,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;g||v?!v&&y?y=Math.max(b,y):!g&&b&&(b=Math.max(b,y)):b=y=Math.max(b,y),p&&(t.insertCollisionFeature(f,y,r[\"text-ignore-placement\"]),y<=n&&this.addSymbols(\"glyph\",h.glyphQuadStartIndex,h.glyphQuadEndIndex,y,r[\"text-keep-upright\"],i,t.angle)),m&&(t.insertCollisionFeature(d,b,r[\"icon-ignore-placement\"]),b<=n&&this.addSymbols(\"icon\",h.iconQuadStartIndex,h.iconQuadEndIndex,b,r[\"icon-keep-upright\"],a,t.angle))}e&&this.addToDebugBuffers(t)},n.prototype.addSymbols=function(t,e,r,n,a,o,s){for(var l=this.prepareArrayGroup(t,4*(r-e)),u=l.elementArray,c=l.layoutVertexArray,h=this.zoom,f=Math.max(Math.log(n)/Math.LN2+h,0),d=e;d<r;d++){var p=this.symbolQuadsArray.get(d).SymbolQuad,m=(p.anchorAngle+s+Math.PI)%(2*Math.PI);if(!(a&&o&&(m<=Math.PI/2||m>3*Math.PI/2))){var g=p.tl,v=p.tr,y=p.bl,b=p.br,x=p.tex,_=p.anchorPoint,w=Math.max(h+Math.log(p.minScale)/Math.LN2,f),M=Math.min(h+Math.log(p.maxScale)/Math.LN2,25);if(!(M<=w)){w===f&&(w=0);var k=Math.round(p.glyphAngle/(2*Math.PI)*256),A=i(c,_.x,_.y,g.x,g.y,x.x,x.y,w,M,f,k);i(c,_.x,_.y,v.x,v.y,x.x+x.w,x.y,w,M,f,k),i(c,_.x,_.y,y.x,y.y,x.x,x.y+x.h,w,M,f,k),i(c,_.x,_.y,b.x,b.y,x.x+x.w,x.y+x.h,w,M,f,k),u.emplaceBack(A,A+1,A+2),u.emplaceBack(A+1,A+2,A+3)}}}},n.prototype.updateIcons=function(t){this.recalculateStyleLayers();var e=this.layer.layout[\"icon-image\"];if(e)for(var r=0;r<this.features.length;r++){var n=u(this.features[r].properties,e);n&&(t[n]=!0)}},n.prototype.updateFont=function(t){this.recalculateStyleLayers();var e=this.layer.layout[\"text-font\"],r=t[e]=t[e]||{};this.textFeatures=f(this.features,this.layer.layout,r)},n.prototype.addToDebugBuffers=function(t){for(var e=this.prepareArrayGroup(\"collisionBox\",0).layoutVertexArray,r=-t.angle,n=t.yStretch,i=this.symbolInstancesStartIndex;i<this.symbolInstancesEndIndex;i++){var o=this.symbolInstancesArray.get(i);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 u=l.boxStartIndex;u<l.boxEndIndex;u++){var c=this.collisionBoxArray.get(u),h=c.anchorPoint,f=new a(c.x1,c.y1*n)._rotate(r),d=new a(c.x2,c.y1*n)._rotate(r),p=new a(c.x1,c.y2*n)._rotate(r),m=new a(c.x2,c.y2*n)._rotate(r),g=Math.max(0,Math.min(25,this.zoom+Math.log(c.maxScale)/Math.LN2)),v=Math.max(0,Math.min(25,this.zoom+Math.log(c.placementScale)/Math.LN2));this.addCollisionBoxVertex(e,h,f,g,v),this.addCollisionBoxVertex(e,h,d,g,v),this.addCollisionBoxVertex(e,h,d,g,v),this.addCollisionBoxVertex(e,h,m,g,v),this.addCollisionBoxVertex(e,h,m,g,v),this.addCollisionBoxVertex(e,h,p,g,v),this.addCollisionBoxVertex(e,h,p,g,v),this.addCollisionBoxVertex(e,h,f,g,v)}}}},n.prototype.addSymbolInstance=function(t,e,r,i,a,o,s,l,u,c,h,f,d,p,g,y,b,w,M){var k,A,T,S,E,L,C,z;if(r&&(C=o?x(t,r,f,e,a,p):[],E=new v(l,e,t,u,c,h,r,f,d,p,!1)),k=this.symbolQuadsArray.length,C&&C.length)for(var D=0;D<C.length;D++)this.addSymbolQuad(C[D]);A=this.symbolQuadsArray.length;var I=E?E.boxStartIndex:this.collisionBoxArray.length,P=E?E.boxEndIndex:this.collisionBoxArray.length;i&&(z=o?_(t,i,g,e,a,b,r,w,M):[],L=new v(l,e,t,u,c,h,i,g,y,b,!0)),T=this.symbolQuadsArray.length,z&&1===z.length&&this.addSymbolQuad(z[0]),S=this.symbolQuadsArray.length;var O=L?L.boxStartIndex:this.collisionBoxArray.length,j=L?L.boxEndIndex:this.collisionBoxArray.length;return S>n.MAX_QUADS&&m.warnOnce(\"Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907\"),A>n.MAX_QUADS&&m.warnOnce(\"Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907\"),this.symbolInstancesArray.emplaceBack(I,P,O,j,k,A,T,S,t.x,t.y,s)},n.prototype.addSymbolQuad=function(t){return this.symbolQuadsArray.emplaceBack(t.anchorPoint.x,t.anchorPoint.y,t.tl.x,t.tl.y,t.tr.x,t.tr.y,t.bl.x,t.bl.y,t.br.x,t.br.y,t.tex.h,t.tex.w,t.tex.x,t.tex.y,t.anchorAngle,t.glyphAngle,t.maxScale,t.minScale)}},{\"../../symbol/anchor\":373,\"../../symbol/clip_line\":375,\"../../symbol/collision_feature\":377,\"../../symbol/get_anchors\":379,\"../../symbol/mergelines\":382,\"../../symbol/quads\":383,\"../../symbol/resolve_text\":384,\"../../symbol/shaping\":385,\"../../util/token\":423,\"../../util/util\":424,\"../bucket\":311,\"../load_geometry\":319,\"point-geometry\":465}],316:[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\"}},{}],317:[function(t,e,r){\"use strict\";function n(t,e){this.layoutVertexBuffer=new a(t.layoutVertexArray,e.layoutVertexArrayType,a.BufferType.VERTEX),t.elementArray&&(this.elementBuffer=new a(t.elementArray,e.elementArrayType,a.BufferType.ELEMENT));var r,n=this.vaos={};t.elementArray2&&(this.elementBuffer2=new a(t.elementArray2,e.elementArrayType2,a.BufferType.ELEMENT),r=this.secondVaos={}),this.paintVertexBuffers=i.mapObject(t.paintVertexArrays,function(i,s){return n[s]=new o,t.elementArray2&&(r[s]=new o),new a(i,e.paintVertexArrayTypes[s],a.BufferType.VERTEX)})}var i=t(\"../util/util\"),a=t(\"./buffer\"),o=t(\"../render/vertex_array_object\");e.exports=n,n.prototype.destroy=function(t){this.layoutVertexBuffer.destroy(t),this.elementBuffer&&this.elementBuffer.destroy(t),this.elementBuffer2&&this.elementBuffer2.destroy(t);for(var e in this.paintVertexBuffers)this.paintVertexBuffers[e].destroy(t);for(var r in this.vaos)this.vaos[r].destroy(t);for(var n in this.secondVaos)this.secondVaos[n].destroy(t)}},{\"../render/vertex_array_object\":339,\"../util/util\":424,\"./buffer\":316}],318:[function(t,e,r){\"use strict\";function n(t,e,r){if(t.grid){var n=t,i=e;t=n.coord,e=n.overscaling,this.grid=new p(n.grid),this.featureIndexArray=new k(n.featureIndexArray),this.rawTileData=i,this.bucketLayerIDs=n.bucketLayerIDs}else this.grid=new p(h,16,0),this.featureIndexArray=new k;this.coord=t,this.overscaling=e,this.x=t.x,this.y=t.y,this.z=t.z-Math.log(e)/Math.LN2,this.setCollisionTile(r)}function i(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function a(t,e){return e-t}function o(t){return t[\"line-gap-width\"]>0?t[\"line-gap-width\"]+2*t[\"line-width\"]:t[\"line-width\"]}function s(t,e,r,n,i){if(!e[0]&&!e[1])return t;e=u.convert(e),\"viewport\"===r&&e._rotate(-n);for(var a=[],o=0;o<t.length;o++){for(var s=t[o],l=[],c=0;c<s.length;c++)l.push(s[c].sub(e._mult(i)));a.push(l)}return a}function l(t,e){for(var r=[],n=new u(0,0),i=0;i<t.length;i++){for(var a=t[i],o=[],s=0;s<a.length;s++){var l=a[s-1],c=a[s],h=a[s+1],f=0===s?n:c.sub(l)._unit()._perp(),d=s===a.length-1?n:h.sub(c)._unit()._perp(),p=f._add(d)._unit(),m=p.x*d.x+p.y*d.y;p._mult(1/m),o.push(p._mult(e)._add(c))}r.push(o)}return r}var u=t(\"point-geometry\"),c=t(\"./load_geometry\"),h=t(\"./bucket\").EXTENT,f=t(\"feature-filter\"),d=t(\"../util/struct_array\"),p=t(\"grid-index\"),m=t(\"../util/dictionary_coder\"),g=t(\"vector-tile\"),v=t(\"pbf\"),y=t(\"../util/vectortile_to_geojson\"),b=t(\"../util/util\").arraysIntersect,x=t(\"../util/intersection_tests\"),_=x.multiPolygonIntersectsBufferedMultiPoint,w=x.multiPolygonIntersectsMultiPolygon,M=x.multiPolygonIntersectsBufferedMultiLine,k=new d({members:[{type:\"Uint32\",name:\"featureIndex\"},{type:\"Uint16\",name:\"sourceLayerIndex\"},{type:\"Uint16\",name:\"bucketIndex\"}]});e.exports=n,n.prototype.insert=function(t,e,r,n){var i=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(e,r,n);for(var a=c(t),o=0;o<a.length;o++){for(var s=a[o],l=[1/0,1/0,-1/0,-1/0],u=0;u<s.length;u++){var h=s[u];l[0]=Math.min(l[0],h.x),l[1]=Math.min(l[1],h.y),l[2]=Math.max(l[2],h.x),l[3]=Math.max(l[3],h.y)}this.grid.insert(i,l[0],l[1],l[2],l[3])}},n.prototype.setCollisionTile=function(t){this.collisionTile=t},n.prototype.serialize=function(){var t={coord:this.coord,overscaling:this.overscaling,grid:this.grid.toArrayBuffer(),featureIndexArray:this.featureIndexArray.serialize(),bucketLayerIDs:this.bucketLayerIDs};return{data:t,transferables:[t.grid,t.featureIndexArray.arrayBuffer]}},n.prototype.query=function(t,e){this.vtLayers||(this.vtLayers=new g.VectorTile(new v(new Uint8Array(this.rawTileData))).layers,this.sourceLayerCoder=new m(this.vtLayers?Object.keys(this.vtLayers).sort():[\"_geojsonTileLayer\"]));var r={},n=t.params||{},s=h/t.tileSize/t.scale,l=f(n.filter),c=0;for(var d in e){var p=e[d],y=p.paint,b=0;\"line\"===p.type?b=o(y)/2+Math.abs(y[\"line-offset\"])+i(y[\"line-translate\"]):\"fill\"===p.type?b=i(y[\"fill-translate\"]):\"circle\"===p.type&&(b=y[\"circle-radius\"]+i(y[\"circle-translate\"])),c=Math.max(c,b*s)}for(var x=t.queryGeometry.map(function(t){return t.map(function(t){return new u(t.x,t.y)})}),_=1/0,w=1/0,M=-1/0,k=-1/0,A=0;A<x.length;A++)for(var T=x[A],S=0;S<T.length;S++){var E=T[S];_=Math.min(_,E.x),w=Math.min(w,E.y),M=Math.max(M,E.x),k=Math.max(k,E.y)}var L=this.grid.query(_-c,w-c,M+c,k+c);L.sort(a),this.filterMatching(r,L,this.featureIndexArray,x,l,n.layers,e,t.bearing,s);var C=this.collisionTile.queryRenderedSymbols(_,w,M,k,t.scale);return C.sort(),this.filterMatching(r,C,this.collisionTile.collisionBoxArray,x,l,n.layers,e,t.bearing,s),r},n.prototype.filterMatching=function(t,e,r,n,i,a,u,h,f){for(var d,p=0;p<e.length;p++){var m=e[p];if(m!==d){d=m;var g=r.get(m),v=this.bucketLayerIDs[g.bucketIndex];if(!a||b(a,v)){var x=this.sourceLayerCoder.decode(g.sourceLayerIndex),k=this.vtLayers[x].feature(g.featureIndex);if(i(k))for(var A=null,T=0;T<v.length;T++){var S=v[T];if(!(a&&a.indexOf(S)<0)){var E=u[S];if(E){var L;if(\"symbol\"!==E.type){A||(A=c(k));var C=E.paint;if(\"line\"===E.type){L=s(n,C[\"line-translate\"],C[\"line-translate-anchor\"],h,f);var z=o(C)/2*f;if(C[\"line-offset\"]&&(A=l(A,C[\"line-offset\"]*f)),!M(L,A,z))continue}else if(\"fill\"===E.type){if(L=s(n,C[\"fill-translate\"],C[\"fill-translate-anchor\"],h,f),!w(L,A))continue}else if(\"circle\"===E.type){L=s(n,C[\"circle-translate\"],C[\"circle-translate-anchor\"],h,f);var D=C[\"circle-radius\"]*f;if(!_(L,A,D))continue}}var I=new y(k,this.z,this.x,this.y);I.layer=E.serialize({includeRefProperties:!0});var P=t[S];void 0===P&&(P=t[S]=[]),P.push(I)}}}}}}}},{\"../util/dictionary_coder\":414,\"../util/intersection_tests\":419,\"../util/struct_array\":422,\"../util/util\":424,\"../util/vectortile_to_geojson\":425,\"./bucket\":311,\"./load_geometry\":319,\"feature-filter\":117,\"grid-index\":271,pbf:459,\"point-geometry\":465,\"vector-tile\":530}],319:[function(t,e,r){\"use strict\";function n(t){return{min:-1*Math.pow(2,t-1),max:Math.pow(2,t-1)-1}}var i=t(\"../util/util\"),a=t(\"./bucket\").EXTENT,o=t(\"assert\"),s={15:n(15),16:n(16)};e.exports=function(t,e){var r=s[e||16];o(r);for(var n=a/t.extent,l=t.loadGeometry(),u=0;u<l.length;u++)for(var c=l[u],h=0;h<c.length;h++){var f=c[h];f.x=Math.round(f.x*n),f.y=Math.round(f.y*n),(f.x<r.min||f.x>r.max||f.y<r.min||f.y>r.max)&&i.warnOnce(\"Geometry exceeds allowed extent, reduce your vector tile buffer size\")}return l}},{\"../util/util\":424,\"./bucket\":311,assert:40}],320:[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}}},{}],321:[function(t,e,r){\"use strict\";function n(t,e){if(isNaN(t)||isNaN(e))throw new Error(\"Invalid LngLat object: (\"+t+\", \"+e+\")\");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error(\"Invalid LngLat latitude value: must be between -90 and 90\")}e.exports=n;var i=t(\"../util/util\").wrap;n.prototype.wrap=function(){return new n(i(this.lng,-180,180),this.lat)},n.prototype.toArray=function(){return[this.lng,this.lat]},n.prototype.toString=function(){return\"LngLat(\"+this.lng+\", \"+this.lat+\")\"},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{\"../util/util\":424}],322:[function(t,e,r){\"use strict\";function n(t,e){t&&(e?this.extend(t).extend(e):4===t.length?this.extend([t[0],t[1]]).extend([t[2],t[3]]):this.extend(t[0]).extend(t[1]))}e.exports=n;var i=t(\"./lng_lat\");n.prototype={extend:function(t){var e,r,a=this._sw,o=this._ne;if(t instanceof i)e=t,r=t;else{if(!(t instanceof n))return t?this.extend(i.convert(t)||n.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return a||o?(a.lng=Math.min(e.lng,a.lng),a.lat=Math.min(e.lat,a.lat),o.lng=Math.max(r.lng,o.lng),o.lat=Math.max(r.lat,o.lat)):(this._sw=new i(e.lng,e.lat),this._ne=new i(r.lng,r.lat)),this},getCenter:function(){return new i((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},getSouthWest:function(){return this._sw},getNorthEast:function(){return this._ne},getNorthWest:function(){return new i(this.getWest(),this.getNorth())},getSouthEast:function(){return new i(this.getEast(),this.getSouth())},getWest:function(){return this._sw.lng},getSouth:function(){return this._sw.lat},getEast:function(){return this._ne.lng},getNorth:function(){return this._ne.lat},toArray:function(){return[this._sw.toArray(),this._ne.toArray()]},toString:function(){return\"LngLatBounds(\"+this._sw.toString()+\", \"+this._ne.toString()+\")\"}},n.convert=function(t){return!t||t instanceof n?t:new n(t)}},{\"./lng_lat\":321}],323:[function(t,e,r){\"use strict\";function n(t,e){this.tileSize=512,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new i(0,0),this.zoom=0,this.angle=0,this._altitude=1.5,this._pitch=0,this._unmodified=!0}var i=t(\"./lng_lat\"),a=t(\"point-geometry\"),o=t(\"./coordinate\"),s=t(\"../util/util\").wrap,l=t(\"../util/interpolate\"),u=t(\"../source/tile_coord\"),c=t(\"../data/bucket\").EXTENT,h=t(\"gl-matrix\"),f=h.vec4,d=h.mat4,p=h.mat2;e.exports=n,n.prototype={get minZoom(){return this._minZoom},set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},get maxZoom(){return this._maxZoom},set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},get worldSize(){return this.tileSize*this.scale},get centerPoint(){return this.size._div(2)},get size(){return new a(this.width,this.height)},get bearing(){return-this.angle/Math.PI*180},set bearing(t){var e=-s(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=p.create(),p.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},get pitch(){return this._pitch/Math.PI*180},set pitch(t){var e=Math.min(60,t)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},get altitude(){return this._altitude},set altitude(t){var e=Math.max(.75,t);this._altitude!==e&&(this._unmodified=!1,this._altitude=e,this._calcMatrices())},get zoom(){return this._zoom},set zoom(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._calcMatrices(),this._constrain())},get center(){return this._center},set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._calcMatrices(),this._constrain())},coveringZoomLevel:function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},coveringTiles:function(t){var e=this.coveringZoomLevel(t),r=e;if(e<t.minzoom)return[];e>t.maxzoom&&(e=t.maxzoom);var n=this,i=n.locationCoordinate(n.center)._zoomTo(e),o=new a(i.column-.5,i.row-.5);return u.cover(e,[n.pointCoordinate(new a(0,0))._zoomTo(e),n.pointCoordinate(new a(n.width,0))._zoomTo(e),n.pointCoordinate(new a(n.width,n.height))._zoomTo(e),n.pointCoordinate(new a(0,n.height))._zoomTo(e)],t.reparseOverscaled?r:e).sort(function(t,e){return o.dist(t)-o.dist(e)})},resize:function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._calcMatrices(),this._constrain()},get unmodified(){return this._unmodified},zoomScale:function(t){return Math.pow(2,t)},scaleZoom:function(t){return Math.log(t)/Math.LN2},project:function(t,e){return new a(this.lngX(t.lng,e),this.latY(t.lat,e))},unproject:function(t,e){return new i(this.xLng(t.x,e),this.yLat(t.y,e))},get x(){return this.lngX(this.center.lng)},get y(){return this.latY(this.center.lat)},get point(){return new a(this.x,this.y)},lngX:function(t,e){return(180+t)*(e||this.worldSize)/360},latY:function(t,e){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=i.convert(t);return new o(this.lngX(r.lng)*e,this.latY(r.lat)*e,this.tileZoom)},coordinateLocation:function(t){var e=this.zoomScale(t.zoom);return new i(this.xLng(t.column,e),this.yLat(t.row,e))},pointCoordinate:function(t){var e=[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],a=e[0]/n,s=r[0]/i,u=e[1]/n,c=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 o(l(a,s,p)/m,l(u,c,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 a(r[0]/r[3],r[1]/r[3])},calculatePosMatrix:function(t,e){void 0===e&&(e=1/0),t instanceof u&&(t=t.toCoordinate(e));var r=Math.min(t.zoom,e),n=this.worldSize/Math.pow(2,r),i=new Float64Array(16);return d.identity(i),d.translate(i,i,[t.column*n,t.row*n,0]),d.scale(i,i,[n/c,n/c,1]),d.multiply(i,this.projMatrix,i),new Float32Array(i)},_constrain:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,n,i,o,s,l,u=this.size,c=this._unmodified;this.latRange&&(t=this.latY(this.latRange[1]),i=(e=this.latY(this.latRange[0]))-t<u.y?u.y/(e-t):0),this.lngRange&&(r=this.lngX(this.lngRange[0]),o=(n=this.lngX(this.lngRange[1]))-r<u.x?u.x/(n-r):0);var h=Math.max(o||0,i||0);if(h)return this.center=this.unproject(new a(o?(n+r)/2:this.x,i?(e+t)/2:this.y)),this.zoom+=this.scaleZoom(h),this._unmodified=c,void(this._constraining=!1);if(this.latRange){var f=this.y,d=u.y/2;f-d<t&&(l=t+d),f+d>e&&(l=e-d)}if(this.lngRange){var p=this.x,m=u.x/2;p-m<r&&(s=r+m),p+m>n&&(s=n-m)}void 0===s&&void 0===l||(this.center=this.unproject(new a(void 0!==s?s:this.x,void 0!==l?l:this.y))),this._unmodified=c,this._constraining=!1}},_calcMatrices:function(){if(this.height){var t=Math.atan(.5/this.altitude),e=Math.sin(t)*this.altitude/Math.sin(Math.PI/2-this._pitch-t),r=Math.cos(Math.PI/2-this._pitch)*e+this.altitude,n=new Float64Array(16);if(d.perspective(n,2*Math.atan(this.height/2/this.altitude),this.width/this.height,.1,r),d.translate(n,n,[0,0,-this.altitude]),d.scale(n,n,[1,-1,1/this.height]),d.rotateX(n,n,this._pitch),d.rotateZ(n,n,this.angle),d.translate(n,n,[-this.x,-this.y,0]),this.projMatrix=n,n=d.create(),d.scale(n,n,[this.width/2,-this.height/2,1]),d.translate(n,n,[1,-1,0]),this.pixelMatrix=d.multiply(new Float64Array(16),n,this.projMatrix),!(n=d.invert(new Float64Array(16),this.pixelMatrix)))throw new Error(\"failed to invert matrix\");this.pixelMatrixInverse=n}}}},{\"../data/bucket\":311,\"../source/tile_coord\":351,\"../util/interpolate\":418,\"../util/util\":424,\"./coordinate\":320,\"./lng_lat\":321,\"gl-matrix\":177,\"point-geometry\":465}],324:[function(t,e,r){\"use strict\";var n={\" \":[16,[]],\"!\":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'\"':[16,[4,21,4,14,-1,-1,12,21,12,14]],\"#\":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],\"%\":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],\"&\":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],\"'\":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],\"(\":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],\")\":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],\"*\":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],\"+\":[26,[13,18,13,0,-1,-1,4,9,22,9]],\",\":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],\"-\":[26,[4,9,22,9]],\".\":[10,[5,2,4,1,5,0,6,1,5,2]],\"/\":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],\":\":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],\";\":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],\"<\":[24,[20,18,4,9,20,0]],\"=\":[26,[4,12,22,12,-1,-1,4,6,22,6]],\">\":[24,[4,18,20,9,4,0]],\"?\":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],\"@\":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],\"[\":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],\"\\\\\":[14,[0,21,14,-3]],\"]\":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],\"^\":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],\"`\":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],\"{\":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],\"|\":[8,[4,25,4,-7]],\"}\":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],\"~\":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]};e.exports=function(t,e,r,i){i=i||1;var a,o,s,l,u,c,h,f,d=[];for(a=0,o=t.length;a<o;a++)if(u=n[t[a]]){for(f=null,s=0,l=u[1].length;s<l;s+=2)-1===u[1][s]&&-1===u[1][s+1]?f=null:(c=e+u[1][s]*i,h=r-u[1][s+1]*i,f&&d.push(f.x,f.y,c,h),f={x:c,y:h});e+=u[0]*i}return d}},{}],325:[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\":426,\"./geo/lng_lat\":321,\"./geo/lng_lat_bounds\":322,\"./style/style\":360,\"./ui/control/attribution\":391,\"./ui/control/control\":392,\"./ui/control/geolocate\":393,\"./ui/control/navigation\":394,\"./ui/map\":403,\"./ui/marker\":404,\"./ui/popup\":405,\"./util/ajax\":407,\"./util/browser\":408,\"./util/config\":413,\"./util/evented\":416,\"./util/util\":424,\"point-geometry\":465}],326:[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:40}],327:[function(t,e,r){\"use strict\";function n(t,e,r){var n,s=t.gl,l=t.transform,u=r.paint[\"background-color\"],c=r.paint[\"background-pattern\"],h=r.paint[\"background-opacity\"],f=c?t.spriteAtlas.getPosition(c.from,!0):null,d=c?t.spriteAtlas.getPosition(c.to,!0):null;if(t.setDepthSublayer(0),f&&d){if(t.isOpaquePass)return;n=t.useProgram(\"pattern\"),s.uniform1i(n.u_image,0),s.uniform2fv(n.u_pattern_tl_a,f.tl),s.uniform2fv(n.u_pattern_br_a,f.br),s.uniform2fv(n.u_pattern_tl_b,d.tl),s.uniform2fv(n.u_pattern_br_b,d.br),s.uniform1f(n.u_opacity,h),s.uniform1f(n.u_mix,c.t),s.uniform2fv(n.u_pattern_size_a,f.size),s.uniform2fv(n.u_pattern_size_b,d.size),s.uniform1f(n.u_scale_a,c.fromScale),s.uniform1f(n.u_scale_b,c.toScale),s.activeTexture(s.TEXTURE0),t.spriteAtlas.bind(s,!0),t.tileExtentPatternVAO.bind(s,n,t.tileExtentBuffer)}else{if(t.isOpaquePass!==(1===u[3]))return;var p=a([{name:\"u_color\",components:4},{name:\"u_opacity\",components:1}]);n=t.useProgram(\"fill\",[],p,p),s.uniform4fv(n.u_color,u),s.uniform1f(n.u_opacity,h),t.tileExtentVAO.bind(s,n,t.tileExtentBuffer)}s.disable(s.STENCIL_TEST);for(var m=l.coveringTiles({tileSize:o}),g=0;g<m.length;g++){var v=m[g];if(f&&d){var y={coord:v,tileSize:o};s.uniform1f(n.u_tile_units_to_pixels,1/i(y,1,t.transform.tileZoom));var b=y.tileSize*Math.pow(2,t.transform.tileZoom-y.coord.z),x=b*(y.coord.x+v.w*Math.pow(2,y.coord.z)),_=b*y.coord.y;s.uniform2f(n.u_pixel_coord_upper,x>>16,_>>16),s.uniform2f(n.u_pixel_coord_lower,65535&x,65535&_)}s.uniformMatrix4fv(n.u_matrix,!1,t.transform.calculatePosMatrix(v)),s.drawArrays(s.TRIANGLE_STRIP,0,t.tileExtentBuffer.length)}s.stencilMask(0),s.stencilFunc(s.EQUAL,128,128)}var i=t(\"../source/pixels_to_tile_units\"),a=t(\"./create_uniform_pragmas\"),o=512;e.exports=n},{\"../source/pixels_to_tile_units\":345,\"./create_uniform_pragmas\":326}],328:[function(t,e,r){\"use strict\";function n(t,e,r,n){if(!t.isOpaquePass){var a=t.gl;t.setDepthSublayer(0),t.depthMask(!1),a.disable(a.STENCIL_TEST);for(var o=0;o<n.length;o++){var s=n[o],l=e.getTile(s),u=l.getBucket(r);if(u){var c=u.bufferGroups.circle;if(c){var h=u.paintAttributes.circle[r.id],f=t.useProgram(\"circle\",h.defines,h.vertexPragmas,h.fragmentPragmas);\"map\"===r.paint[\"circle-pitch-scale\"]?(a.uniform1i(f.u_scale_with_map,!0),a.uniform2f(f.u_extrude_scale,t.transform.pixelsToGLUnits[0]*t.transform.altitude,t.transform.pixelsToGLUnits[1]*t.transform.altitude)):(a.uniform1i(f.u_scale_with_map,!1),a.uniform2fv(f.u_extrude_scale,t.transform.pixelsToGLUnits)),a.uniform1f(f.u_devicepixelratio,i.devicePixelRatio),a.uniformMatrix4fv(f.u_matrix,!1,t.translatePosMatrix(s.posMatrix,l,r.paint[\"circle-translate\"],r.paint[\"circle-translate-anchor\"])),u.setUniforms(a,\"circle\",f,r,{zoom:t.transform.zoom});for(var d=0;d<c.length;d++){var p=c[d];p.vaos[r.id].bind(a,f,p.layoutVertexBuffer,p.elementBuffer,p.paintVertexBuffers[r.id]),a.drawElements(a.TRIANGLES,3*p.elementBuffer.length,a.UNSIGNED_SHORT,0)}}}}}}var i=t(\"../util/browser\");e.exports=n},{\"../util/browser\":408}],329:[function(t,e,r){\"use strict\";function n(t,e,r,n){var i=t.gl;i.enable(i.STENCIL_TEST);for(var a=t.useProgram(\"collisionbox\"),o=0;o<n.length;o++){var s=n[o],l=e.getTile(s),u=l.getBucket(r);if(u){var c=u.bufferGroups.collisionBox;if(c&&c.length){var h=c[0];0!==h.layoutVertexBuffer.length&&(i.uniformMatrix4fv(a.u_matrix,!1,s.posMatrix),t.enableTileClippingMask(s),t.lineWidth(1),i.uniform1f(a.u_scale,Math.pow(2,t.transform.zoom-l.coord.z)),i.uniform1f(a.u_zoom,10*t.transform.zoom),i.uniform1f(a.u_maxzoom,10*(l.coord.z+1)),h.vaos[r.id].bind(i,a,h.layoutVertexBuffer),i.drawArrays(i.LINES,0,h.layoutVertexBuffer.length))}}}}e.exports=n},{}],330:[function(t,e,r){\"use strict\";function n(t,e,r){if(!t.isOpaquePass&&t.options.debug)for(var n=0;n<r.length;n++)i(t,e,r[n])}function i(t,e,r){var n=t.gl;n.disable(n.STENCIL_TEST),t.lineWidth(1*o.devicePixelRatio);var i=r.posMatrix,h=t.useProgram(\"debug\");n.uniformMatrix4fv(h.u_matrix,!1,i),n.uniform4f(h.u_color,1,0,0,1),t.debugVAO.bind(n,h,t.debugBuffer),n.drawArrays(n.LINE_STRIP,0,t.debugBuffer.length);for(var f=a(r.toString(),50,200,5),d=new t.PosArray,p=0;p<f.length;p+=2)d.emplaceBack(f[p],f[p+1]);var m=new u(d.serialize(),t.PosArray.serialize(),u.BufferType.VERTEX);(new c).bind(n,h,m),n.uniform4f(h.u_color,1,1,1,1);for(var g=e.getTile(r).tileSize,v=l/(Math.pow(2,t.transform.zoom-r.z)*g),y=[[-1,-1],[-1,1],[1,-1],[1,1]],b=0;b<y.length;b++){var x=y[b];n.uniformMatrix4fv(h.u_matrix,!1,s.translate([],i,[v*x[0],v*x[1],0])),n.drawArrays(n.LINES,0,m.length)}n.uniform4f(h.u_color,0,0,0,1),n.uniformMatrix4fv(h.u_matrix,!1,i),n.drawArrays(n.LINES,0,m.length)}var a=t(\"../lib/debugtext\"),o=t(\"../util/browser\"),s=t(\"gl-matrix\").mat4,l=t(\"../data/bucket\").EXTENT,u=t(\"../data/buffer\"),c=t(\"./vertex_array_object\");e.exports=n},{\"../data/bucket\":311,\"../data/buffer\":316,\"../lib/debugtext\":324,\"../util/browser\":408,\"./vertex_array_object\":339,\"gl-matrix\":177}],331:[function(t,e,r){\"use strict\";function n(t,e,r,n){var o=t.gl;o.enable(o.STENCIL_TEST);var s;if(s=!r.paint[\"fill-pattern\"]&&(r.isPaintValueFeatureConstant(\"fill-color\")&&r.isPaintValueFeatureConstant(\"fill-opacity\")&&1===r.paint[\"fill-color\"][3]&&1===r.paint[\"fill-opacity\"]),t.isOpaquePass===s){t.setDepthSublayer(1);for(var l=0;l<n.length;l++)i(t,e,r,n[l])}if(!t.isOpaquePass&&r.paint[\"fill-antialias\"]){t.lineWidth(2),t.depthMask(!1);var u=r.getPaintProperty(\"fill-outline-color\");(u||!r.paint[\"fill-pattern\"])&&u?t.setDepthSublayer(2):t.setDepthSublayer(0);for(var c=0;c<n.length;c++)a(t,e,r,n[c])}}function i(t,e,r,n){var i=e.getTile(n),a=i.getBucket(r);if(a){var s=a.bufferGroups.fill;if(s){var l,u=t.gl,c=r.paint[\"fill-pattern\"];if(c)l=t.useProgram(\"pattern\"),o(c,r.paint[\"fill-opacity\"],i,n,t,l),u.activeTexture(u.TEXTURE0),t.spriteAtlas.bind(u,!0);else{var h=a.paintAttributes.fill[r.id];l=t.useProgram(\"fill\",h.defines,h.vertexPragmas,h.fragmentPragmas),a.setUniforms(u,\"fill\",l,r,{zoom:t.transform.zoom})}u.uniformMatrix4fv(l.u_matrix,!1,t.translatePosMatrix(n.posMatrix,i,r.paint[\"fill-translate\"],r.paint[\"fill-translate-anchor\"])),t.enableTileClippingMask(n);for(var f=0;f<s.length;f++){var d=s[f];d.vaos[r.id].bind(u,l,d.layoutVertexBuffer,d.elementBuffer,d.paintVertexBuffers[r.id]),u.drawElements(u.TRIANGLES,d.elementBuffer.length,u.UNSIGNED_SHORT,0)}}}}function a(t,e,r,n){var i=e.getTile(n),a=i.getBucket(r);if(a){var s,l=t.gl,u=a.bufferGroups.fill,c=r.paint[\"fill-pattern\"],h=r.paint[\"fill-opacity\"],f=r.getPaintProperty(\"fill-outline-color\");if(c&&!f)s=t.useProgram(\"outlinepattern\"),l.uniform2f(s.u_world,l.drawingBufferWidth,l.drawingBufferHeight);else{var d=a.paintAttributes.fill[r.id];s=t.useProgram(\"outline\",d.defines,d.vertexPragmas,d.fragmentPragmas),l.uniform2f(s.u_world,l.drawingBufferWidth,l.drawingBufferHeight),l.uniform1f(s.u_opacity,h),a.setUniforms(l,\"fill\",s,r,{zoom:t.transform.zoom})}l.uniformMatrix4fv(s.u_matrix,!1,t.translatePosMatrix(n.posMatrix,i,r.paint[\"fill-translate\"],r.paint[\"fill-translate-anchor\"])),c&&o(c,h,i,n,t,s),t.enableTileClippingMask(n);for(var p=0;p<u.length;p++){var m=u[p];m.secondVaos[r.id].bind(l,s,m.layoutVertexBuffer,m.elementBuffer2,m.paintVertexBuffers[r.id]),l.drawElements(l.LINES,2*m.elementBuffer2.length,l.UNSIGNED_SHORT,0)}}}function o(t,e,r,n,i,a){var o=i.gl,l=i.spriteAtlas.getPosition(t.from,!0),u=i.spriteAtlas.getPosition(t.to,!0);if(l&&u){o.uniform1i(a.u_image,0),o.uniform2fv(a.u_pattern_tl_a,l.tl),o.uniform2fv(a.u_pattern_br_a,l.br),o.uniform2fv(a.u_pattern_tl_b,u.tl),o.uniform2fv(a.u_pattern_br_b,u.br),o.uniform1f(a.u_opacity,e),o.uniform1f(a.u_mix,t.t),o.uniform1f(a.u_tile_units_to_pixels,1/s(r,1,i.transform.tileZoom)),o.uniform2fv(a.u_pattern_size_a,l.size),o.uniform2fv(a.u_pattern_size_b,u.size),o.uniform1f(a.u_scale_a,t.fromScale),o.uniform1f(a.u_scale_b,t.toScale);var c=r.tileSize*Math.pow(2,i.transform.tileZoom-r.coord.z),h=c*(r.coord.x+n.w*Math.pow(2,r.coord.z)),f=c*r.coord.y;o.uniform2f(a.u_pixel_coord_upper,h>>16,f>>16),o.uniform2f(a.u_pixel_coord_lower,65535&h,65535&f),o.activeTexture(o.TEXTURE0),i.spriteAtlas.bind(o,!0)}}var s=t(\"../source/pixels_to_tile_units\");e.exports=n},{\"../source/pixels_to_tile_units\":345}],332:[function(t,e,r){\"use strict\";var n=t(\"../util/browser\"),i=t(\"gl-matrix\").mat2,a=t(\"../source/pixels_to_tile_units\");e.exports=function(t,e,r,o){if(!t.isOpaquePass){t.setDepthSublayer(0),t.depthMask(!1);var s=t.gl;if(s.enable(s.STENCIL_TEST),!(r.paint[\"line-width\"]<=0)){var l=1/n.devicePixelRatio,u=r.paint[\"line-blur\"]+l,c=r.paint[\"line-color\"],h=t.transform,f=i.create();i.scale(f,f,[1,Math.cos(h._pitch)]),i.rotate(f,f,t.transform.angle);var d,p,m,g,v,y=Math.sqrt(h.height*h.height/4*(1+h.altitude*h.altitude)),b=(y+h.height/2*Math.tan(h._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,u),s.uniform4fv(d.u_color,c),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,f);else if(_){if(g=t.spriteAtlas.getPosition(_.from,!0),v=t.spriteAtlas.getPosition(_.to,!0),!g||!v)return;d=t.useProgram(\"linepattern\"),s.uniform1i(d.u_image,0),s.activeTexture(s.TEXTURE0),t.spriteAtlas.bind(s,!0),s.uniform1f(d.u_linewidth,r.paint[\"line-width\"]/2),s.uniform1f(d.u_gapwidth,r.paint[\"line-gap-width\"]/2),s.uniform1f(d.u_antialiasing,l/2),s.uniform1f(d.u_blur,u),s.uniform2fv(d.u_pattern_tl_a,g.tl),s.uniform2fv(d.u_pattern_br_a,g.br),s.uniform2fv(d.u_pattern_tl_b,v.tl),s.uniform2fv(d.u_pattern_br_b,v.br),s.uniform1f(d.u_fade,_.t),s.uniform1f(d.u_opacity,r.paint[\"line-opacity\"]),s.uniform1f(d.u_extra,b),s.uniform1f(d.u_offset,-r.paint[\"line-offset\"]),s.uniformMatrix2fv(d.u_antialiasingmatrix,!1,f)}else d=t.useProgram(\"line\"),s.uniform1f(d.u_linewidth,r.paint[\"line-width\"]/2),s.uniform1f(d.u_gapwidth,r.paint[\"line-gap-width\"]/2),s.uniform1f(d.u_antialiasing,l/2),s.uniform1f(d.u_blur,u),s.uniform1f(d.u_extra,b),s.uniform1f(d.u_offset,-r.paint[\"line-offset\"]),s.uniformMatrix2fv(d.u_antialiasingmatrix,!1,f),s.uniform4fv(d.u_color,c),s.uniform1f(d.u_opacity,r.paint[\"line-opacity\"]);for(var 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 S=t.translatePosMatrix(M.posMatrix,k,r.paint[\"line-translate\"],r.paint[\"line-translate-anchor\"]);s.uniformMatrix4fv(d.u_matrix,!1,S);var E=1/a(k,1,t.transform.zoom);if(x){var L=p.width*x.fromScale,C=m.width*x.toScale,z=[1/a(k,L,t.transform.tileZoom),-p.height/2],D=[1/a(k,C,t.transform.tileZoom),-m.height/2],I=t.lineAtlas.width/(256*Math.min(L,C)*n.devicePixelRatio)/2;s.uniform1f(d.u_ratio,E),s.uniform2fv(d.u_patternscale_a,z),s.uniform2fv(d.u_patternscale_b,D),s.uniform1f(d.u_sdfgamma,I)}else _?(s.uniform1f(d.u_ratio,E),s.uniform2fv(d.u_pattern_size_a,[a(k,g.size[0]*_.fromScale,t.transform.tileZoom),v.size[1]]),s.uniform2fv(d.u_pattern_size_b,[a(k,v.size[0]*_.toScale,t.transform.tileZoom),v.size[1]])):s.uniform1f(d.u_ratio,E);for(var P=0;P<T.length;P++){var O=T[P];O.vaos[r.id].bind(s,d,O.layoutVertexBuffer,O.elementBuffer),s.drawElements(s.TRIANGLES,3*O.elementBuffer.length,s.UNSIGNED_SHORT,0)}}}}}}}},{\"../source/pixels_to_tile_units\":345,\"../util/browser\":408,\"gl-matrix\":177}],333:[function(t,e,r){\"use strict\";function n(t,e,r,n){if(!t.isOpaquePass){var a=t.gl;a.enable(a.DEPTH_TEST),t.depthMask(!0),a.depthFunc(a.LESS);for(var o=n.length&&n[0].z,s=0;s<n.length;s++){var l=n[s];t.setDepthSublayer(l.z-o),i(t,e,r,l)}a.depthFunc(a.LEQUAL)}}function i(t,e,r,n){var i=t.gl;i.disable(i.STENCIL_TEST);var u=e.getTile(n),c=t.transform.calculatePosMatrix(n,e.maxzoom),h=t.useProgram(\"raster\");i.uniformMatrix4fv(h.u_matrix,!1,c),i.uniform1f(h.u_brightness_low,r.paint[\"raster-brightness-min\"]),i.uniform1f(h.u_brightness_high,r.paint[\"raster-brightness-max\"]),i.uniform1f(h.u_saturation_factor,s(r.paint[\"raster-saturation\"])),i.uniform1f(h.u_contrast_factor,o(r.paint[\"raster-contrast\"])),i.uniform3fv(h.u_spin_weights,a(r.paint[\"raster-hue-rotate\"]));var f,d,p=u.source&&u.source.findLoadedParent(n,0,{}),m=l(u,p,r,t.transform);i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,u.texture),i.activeTexture(i.TEXTURE1),p?(i.bindTexture(i.TEXTURE_2D,p.texture),f=Math.pow(2,p.coord.z-u.coord.z),d=[u.coord.x*f%1,u.coord.y*f%1]):(i.bindTexture(i.TEXTURE_2D,u.texture),m[1]=0),i.uniform2fv(h.u_tl_parent,d||[0,0]),i.uniform1f(h.u_scale_parent,f||1),i.uniform1f(h.u_buffer_scale,1),i.uniform1f(h.u_opacity0,m[0]),i.uniform1f(h.u_opacity1,m[1]),i.uniform1i(h.u_image0,0),i.uniform1i(h.u_image1,1);var g=u.boundsBuffer||t.rasterBoundsBuffer;(u.boundsVAO||t.rasterBoundsVAO).bind(i,h,g),i.drawArrays(i.TRIANGLE_STRIP,0,g.length)}function a(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}function o(t){return t>0?1/(1-t):1+t}function s(t){return t>0?1-1/(1.001-t):-t}function l(t,e,r,n){var i=[1,0],a=r.paint[\"raster-fade-duration\"];if(t.source&&a>0){var o=(new Date).getTime(),s=(o-t.timeAdded)/a,l=e?(o-e.timeAdded)/a:-1,c=n.coveringZoomLevel(t.source),h=!!e&&Math.abs(e.coord.z-c)>Math.abs(t.coord.z-c);!e||h?(i[0]=u.clamp(s,0,1),i[1]=1-i[0]):(i[0]=u.clamp(1-l,0,1),i[1]=1-i[0])}var f=r.paint[\"raster-opacity\"];return i[0]*=f,i[1]*=f,i}var u=t(\"../util/util\"),c=t(\"../util/struct_array\");e.exports=n,n.RasterBoundsArray=new c({members:[{name:\"a_pos\",type:\"Int16\",components:2},{name:\"a_texture_pos\",type:\"Int16\",components:2}]})},{\"../util/struct_array\":422,\"../util/util\":424}],334:[function(t,e,r){\"use strict\";function n(t,e,r,n){if(!t.isOpaquePass){var a=!(r.layout[\"text-allow-overlap\"]||r.layout[\"icon-allow-overlap\"]||r.layout[\"text-ignore-placement\"]||r.layout[\"icon-ignore-placement\"]),o=t.gl;a?o.disable(o.STENCIL_TEST):o.enable(o.STENCIL_TEST),t.setDepthSublayer(0),t.depthMask(!1),o.disable(o.DEPTH_TEST),i(t,e,r,n,!1,r.paint[\"icon-translate\"],r.paint[\"icon-translate-anchor\"],r.layout[\"icon-rotation-alignment\"],r.layout[\"icon-rotation-alignment\"],r.layout[\"icon-size\"],r.paint[\"icon-halo-width\"],r.paint[\"icon-halo-color\"],r.paint[\"icon-halo-blur\"],r.paint[\"icon-opacity\"],r.paint[\"icon-color\"]),i(t,e,r,n,!0,r.paint[\"text-translate\"],r.paint[\"text-translate-anchor\"],r.layout[\"text-rotation-alignment\"],r.layout[\"text-pitch-alignment\"],r.layout[\"text-size\"],r.paint[\"text-halo-width\"],r.paint[\"text-halo-color\"],r.paint[\"text-halo-blur\"],r.paint[\"text-opacity\"],r.paint[\"text-color\"]),o.enable(o.DEPTH_TEST),e.map.showCollisionBoxes&&s(t,e,r,n)}}function i(t,e,r,n,i,o,s,l,u,c,h,f,d,p,m){for(var g=0;g<n.length;g++){var v=e.getTile(n[g]),y=v.getBucket(r);if(y){var b=y.bufferGroups,x=i?b.glyph:b.icon;x.length&&(t.enableTileClippingMask(n[g]),a(t,r,n[g].posMatrix,v,y,x,i,i||y.sdfIcons,!i&&y.iconsNeedLinear,i?y.adjustedTextSize:y.adjustedIconSize,y.fontstack,o,s,l,u,c,h,f,d,p,m))}}}function a(t,e,r,n,i,a,s,u,c,h,f,d,p,m,g,v,y,b,x,_,w){var M,k,A,T=t.gl,S=t.transform,E=\"map\"===m,L=\"map\"===g,C=s?24:1,z=v/C;if(L?(k=l(n,1,t.transform.zoom)*z,A=1/Math.cos(S._pitch),M=[k,k]):(k=t.transform.altitude*z,A=1,M=[S.pixelsToGLUnits[0]*k,S.pixelsToGLUnits[1]*k]),s||t.style.sprite.loaded()){var D=t.useProgram(u?\"sdf\":\"icon\");if(T.uniformMatrix4fv(D.u_matrix,!1,t.translatePosMatrix(r,n,d,p)),T.uniform1i(D.u_rotate_with_map,E),T.uniform1i(D.u_pitch_with_map,L),T.uniform2fv(D.u_extrude_scale,M),T.activeTexture(T.TEXTURE0),T.uniform1i(D.u_texture,0),s){var I=f&&t.glyphSource.getGlyphAtlas(f);if(!I)return;I.updateTexture(T),T.uniform2f(D.u_texsize,I.width/4,I.height/4)}else{var P=t.options.rotating||t.options.zooming,O=1!==z||o.devicePixelRatio!==t.spriteAtlas.pixelRatio||c,j=L||t.transform.pitch;t.spriteAtlas.bind(T,u||P||O||j),T.uniform2f(D.u_texsize,t.spriteAtlas.width/4,t.spriteAtlas.height/4)}var R=Math.log(v/h)/Math.LN2||0;T.uniform1f(D.u_zoom,10*(t.transform.zoom-R)),T.activeTexture(T.TEXTURE1),t.frameHistory.bind(T),T.uniform1i(D.u_fadetexture,1);var F;if(u){var N=.105*C/v/o.devicePixelRatio;if(y){T.uniform1f(D.u_gamma,(1.19*x/z/8+N)*A),T.uniform4fv(D.u_color,b),T.uniform1f(D.u_opacity,_),T.uniform1f(D.u_buffer,(6-y/z)/8);for(var B=0;B<a.length;B++)(F=a[B]).vaos[e.id].bind(T,D,F.layoutVertexBuffer,F.elementBuffer),T.drawElements(T.TRIANGLES,3*F.elementBuffer.length,T.UNSIGNED_SHORT,0)}T.uniform1f(D.u_gamma,N*A),T.uniform4fv(D.u_color,w),T.uniform1f(D.u_opacity,_),T.uniform1f(D.u_buffer,.75),T.uniform1f(D.u_pitch,S.pitch/360*2*Math.PI),T.uniform1f(D.u_bearing,S.bearing/360*2*Math.PI),T.uniform1f(D.u_aspect_ratio,S.width/S.height);for(var U=0;U<a.length;U++)(F=a[U]).vaos[e.id].bind(T,D,F.layoutVertexBuffer,F.elementBuffer),T.drawElements(T.TRIANGLES,3*F.elementBuffer.length,T.UNSIGNED_SHORT,0)}else{T.uniform1f(D.u_opacity,_);for(var V=0;V<a.length;V++)(F=a[V]).vaos[e.id].bind(T,D,F.layoutVertexBuffer,F.elementBuffer),T.drawElements(T.TRIANGLES,3*F.elementBuffer.length,T.UNSIGNED_SHORT,0)}}}var o=t(\"../util/browser\"),s=t(\"./draw_collision_debug\"),l=t(\"../source/pixels_to_tile_units\");e.exports=n},{\"../source/pixels_to_tile_units\":345,\"../util/browser\":408,\"./draw_collision_debug\":329}],335:[function(t,e,r){\"use strict\";function n(){this.changeTimes=new Float64Array(256),this.changeOpacities=new Uint8Array(256),this.opacities=new Uint8ClampedArray(256),this.array=new Uint8Array(this.opacities.buffer),this.fadeDuration=300,this.previousZoom=0,this.firstFrame=!0}e.exports=n,n.prototype.record=function(t){var e=Date.now();this.firstFrame&&(e=0,this.firstFrame=!1);var r;if((t=Math.floor(10*t))<this.previousZoom)for(r=t+1;r<=this.previousZoom;r++)this.changeTimes[r]=e,this.changeOpacities[r]=this.opacities[r];else for(r=t;r>this.previousZoom;r--)this.changeTimes[r]=e,this.changeOpacities[r]=this.opacities[r];for(r=0;r<256;r++){var n=(e-this.changeTimes[r])/this.fadeDuration*255;this.opacities[r]=r<=t?this.changeOpacities[r]+n:this.changeOpacities[r]-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))}},{}],336:[function(t,e,r){\"use strict\";function n(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}}var i=t(\"../util/util\");e.exports=n,n.prototype.setSprite=function(t){this.sprite=t},n.prototype.getDash=function(t,e){var r=t.join(\",\")+e;return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},n.prototype.addDash=function(t,e){var r=e?7:0,n=2*r+1;if(this.nextRow+n>this.height)return i.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,u=t.length%2==1,c=-r;c<=r;c++)for(var h=this.nextRow+r+c,f=this.width*h,d=u?-t[t.length-1]:0,p=t[0],m=1,g=0;g<this.width;g++){for(;p<g/s;)d=p,p+=t[m],u&&m===t.length-1&&(p+=t[0]),m++;var v,y=Math.abs(g-d*s),b=Math.abs(g-p*s),x=Math.min(y,b),_=m%2==1;if(e){var w=r?c/r*(l+1):0;if(_){var M=l-Math.abs(w);v=Math.sqrt(x*x+M*M)}else v=l-Math.sqrt(x*x+w*w)}else v=(_?1:-1)*x;this.data[3+4*(f+g)]=Math.max(0,Math.min(255,v+128))}var k={y:(this.nextRow+r+.5)/this.height,height:2*r/this.height,width:a};return this.nextRow+=n,this.dirty=!0,k},n.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.RGBA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,this.data))}},{\"../util/util\":424}],337:[function(t,e,r){\"use strict\";function n(t,e){this.gl=t,this.transform=e,this.reusableTextures={},this.preFbos={},this.frameHistory=new o,this.setup(),this.numSublayers=s.maxUnderzooming+s.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.lineWidthRange=t.getParameter(t.ALIASED_LINE_WIDTH_RANGE)}var i=t(\"../util/browser\"),a=t(\"gl-matrix\").mat4,o=t(\"./frame_history\"),s=t(\"../source/source_cache\"),l=t(\"../data/bucket\").EXTENT,u=t(\"../source/pixels_to_tile_units\"),c=t(\"../util/util\"),h=t(\"../util/struct_array\"),f=t(\"../data/buffer\"),d=t(\"./vertex_array_object\"),p=t(\"./draw_raster\").RasterBoundsArray,m=t(\"./create_uniform_pragmas\");e.exports=n,c.extend(n.prototype,t(\"./painter/use_program\")),n.prototype.resize=function(t,e){var r=this.gl;this.width=t*i.devicePixelRatio,this.height=e*i.devicePixelRatio,r.viewport(0,0,this.width,this.height)},n.prototype.setup=function(){var t=this.gl;t.verbose=!0,t.enable(t.BLEND),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),t.enable(t.STENCIL_TEST),t.enable(t.DEPTH_TEST),t.depthFunc(t.LEQUAL),this._depthMask=!1,t.depthMask(!1);var e=this.PosArray=new h({members:[{name:\"a_pos\",type:\"Int16\",components:2}]}),r=new e;r.emplaceBack(0,0),r.emplaceBack(l,0),r.emplaceBack(0,l),r.emplaceBack(l,l),this.tileExtentBuffer=new f(r.serialize(),e.serialize(),f.BufferType.VERTEX),this.tileExtentVAO=new d,this.tileExtentPatternVAO=new d;var n=new e;n.emplaceBack(0,0),n.emplaceBack(l,0),n.emplaceBack(l,l),n.emplaceBack(0,l),n.emplaceBack(0,0),this.debugBuffer=new f(n.serialize(),e.serialize(),f.BufferType.VERTEX),this.debugVAO=new d;var i=new p;i.emplaceBack(0,0,0,0),i.emplaceBack(l,0,32767,0),i.emplaceBack(0,l,0,32767),i.emplaceBack(l,l,32767,32767),this.rasterBoundsBuffer=new f(i.serialize(),p.serialize(),f.BufferType.VERTEX),this.rasterBoundsVAO=new d},n.prototype.clearColor=function(){var t=this.gl;t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT)},n.prototype.clearStencil=function(){var t=this.gl;t.clearStencil(0),t.stencilMask(255),t.clear(t.STENCIL_BUFFER_BIT)},n.prototype.clearDepth=function(){var t=this.gl;t.clearDepth(1),this.depthMask(!0),t.clear(t.DEPTH_BUFFER_BIT)},n.prototype._renderTileClippingMasks=function(t){var e=this.gl;e.colorMask(!1,!1,!1,!1),this.depthMask(!1),e.disable(e.DEPTH_TEST),e.enable(e.STENCIL_TEST),e.stencilMask(248),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE);var r=1;this._tileClippingMaskIDs={};for(var n=0;n<t.length;n++){var i=t[n],a=this._tileClippingMaskIDs[i.id]=r++<<3;e.stencilFunc(e.ALWAYS,a,248);var o=m([{name:\"u_color\",components:4},{name:\"u_opacity\",components:1}]),s=this.useProgram(\"fill\",[],o,o);e.uniformMatrix4fv(s.u_matrix,!1,i.posMatrix),this.tileExtentVAO.bind(e,s,this.tileExtentBuffer),e.drawArrays(e.TRIANGLE_STRIP,0,this.tileExtentBuffer.length)}e.stencilMask(0),e.colorMask(!0,!0,!0,!0),this.depthMask(!0),e.enable(e.DEPTH_TEST)},n.prototype.enableTileClippingMask=function(t){var e=this.gl;e.stencilFunc(e.EQUAL,this._tileClippingMaskIDs[t.id],248)},n.prototype.prepareBuffers=function(){},n.prototype.bindDefaultFramebuffer=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,null)};var g={symbol:t(\"./draw_symbol\"),circle:t(\"./draw_circle\"),line:t(\"./draw_line\"),fill:t(\"./draw_fill\"),raster:t(\"./draw_raster\"),background:t(\"./draw_background\"),debug:t(\"./draw_debug\")};n.prototype.render=function(t,e){this.style=t,this.options=e,this.lineAtlas=t.lineAtlas,this.spriteAtlas=t.spriteAtlas,this.spriteAtlas.setSprite(t.sprite),this.glyphSource=t.glyphSource,this.frameHistory.record(this.transform.zoom),this.prepareBuffers(),this.clearColor(),this.clearDepth(),this.showOverdrawInspector(e.showOverdrawInspector),this.depthRange=(t._order.length+2)*this.numSublayers*this.depthEpsilon,this.renderPass({isOpaquePass:!0}),this.renderPass({isOpaquePass:!1})},n.prototype.renderPass=function(t){var e=this.style._groups,r=t.isOpaquePass;this.currentLayer=r?this.style._order.length:-1;for(var n=0;n<e.length;n++){var i,a=e[r?e.length-1-n:n],o=this.style.sources[a.source],s=[];if(o){for(s=o.getVisibleCoordinates(),i=0;i<s.length;i++)s[i].posMatrix=this.transform.calculatePosMatrix(s[i],o.maxzoom);this.clearStencil(),o.prepare&&o.prepare(),o.isTileClipped&&this._renderTileClippingMasks(s)}for(r?(this._showOverdrawInspector||this.gl.disable(this.gl.BLEND),this.isOpaquePass=!0):(this.gl.enable(this.gl.BLEND),this.isOpaquePass=!1,s.reverse()),i=0;i<a.length;i++){var l=a[r?a.length-1-i:i];this.currentLayer+=r?-1:1,this.renderLayer(this,o,l,s)}o&&g.debug(this,o,s)}},n.prototype.depthMask=function(t){t!==this._depthMask&&(this._depthMask=t,this.gl.depthMask(t))},n.prototype.renderLayer=function(t,e,r,n){r.isHidden(this.transform.zoom)||(\"background\"===r.type||n.length)&&(this.id=r.id,g[r.type](t,e,r,n))},n.prototype.setDepthSublayer=function(t){var e=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon,r=e-1+this.depthRange;this.gl.depthRange(r,e)},n.prototype.translatePosMatrix=function(t,e,r,n){if(!r[0]&&!r[1])return t;if(\"viewport\"===n){var i=Math.sin(-this.transform.angle),o=Math.cos(-this.transform.angle);r=[r[0]*o-r[1]*i,r[0]*i+r[1]*o]}var s=[u(e,r[0],this.transform.zoom),u(e,r[1],this.transform.zoom),0],l=new Float32Array(16);return a.translate(l,t,s),l},n.prototype.saveTexture=function(t){var e=this.reusableTextures[t.size];e?e.push(t):this.reusableTextures[t.size]=[t]},n.prototype.getTexture=function(t){var e=this.reusableTextures[t];return e&&e.length>0?e.pop():null},n.prototype.lineWidth=function(t){this.gl.lineWidth(c.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},n.prototype.showOverdrawInspector=function(t){if(t||this._showOverdrawInspector){this._showOverdrawInspector=t;var e=this.gl;if(t){e.blendFunc(e.CONSTANT_COLOR,e.ONE);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\":311,\"../data/buffer\":316,\"../source/pixels_to_tile_units\":345,\"../source/source_cache\":349,\"../util/browser\":408,\"../util/struct_array\":422,\"../util/util\":424,\"./create_uniform_pragmas\":326,\"./draw_background\":327,\"./draw_circle\":328,\"./draw_debug\":330,\"./draw_fill\":331,\"./draw_line\":332,\"./draw_raster\":333,\"./draw_symbol\":334,\"./frame_history\":335,\"./painter/use_program\":338,\"./vertex_array_object\":339,\"gl-matrix\":177}],338:[function(t,e,r){\"use strict\";function n(t,e){return t.replace(/#pragma mapbox: ([\\w]+) ([\\w]+) ([\\w]+) ([\\w]+)/g,function(t,r,n,i,a){return e[r][a].replace(/{type}/g,i).replace(/{precision}/g,n)})}var i=t(\"assert\"),a=t(\"../../util/util\"),o=t(\"mapbox-gl-shaders\"),s=o.util;e.exports._createProgram=function(t,e,r,l){for(var u=this.gl,c=u.createProgram(),h=o[t],f=\"#define MAPBOX_GL_JS;\\n\",d=0;d<e.length;d++)f+=\"#define \"+e[d]+\";\\n\";var p=u.createShader(u.FRAGMENT_SHADER);u.shaderSource(p,n(f+h.fragmentSource,l)),u.compileShader(p),i(u.getShaderParameter(p,u.COMPILE_STATUS),u.getShaderInfoLog(p)),u.attachShader(c,p);var m=u.createShader(u.VERTEX_SHADER);u.shaderSource(m,n(f+s+h.vertexSource,r)),u.compileShader(m),i(u.getShaderParameter(m,u.COMPILE_STATUS),u.getShaderInfoLog(m)),u.attachShader(c,m),u.linkProgram(c),i(u.getProgramParameter(c,u.LINK_STATUS),u.getProgramInfoLog(c));for(var g={},v=u.getProgramParameter(c,u.ACTIVE_ATTRIBUTES),y=0;y<v;y++){var b=u.getActiveAttrib(c,y);g[b.name]=u.getAttribLocation(c,b.name)}for(var x={},_=u.getProgramParameter(c,u.ACTIVE_UNIFORMS),w=0;w<_;w++){var M=u.getActiveUniform(c,w);x[M.name]=u.getUniformLocation(c,M.name)}return a.extend({program:c,definition:h,attributes:g,numAttributes:v},g,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\":424,assert:40,\"mapbox-gl-shaders\":285}],339:[function(t,e,r){\"use strict\";function n(){this.boundProgram=null,this.boundVertexBuffer=null,this.boundVertexBuffer2=null,this.boundElementBuffer=null,this.vao=null}var i=t(\"assert\");e.exports=n,n.prototype.bind=function(t,e,r,n,i){void 0===t.extVertexArrayObject&&(t.extVertexArrayObject=t.getExtension(\"OES_vertex_array_object\"));var a=!this.vao||this.boundProgram!==e||this.boundVertexBuffer!==r||this.boundVertexBuffer2!==i||this.boundElementBuffer!==n;!t.extVertexArrayObject||a?this.freshBind(t,e,r,n,i):t.extVertexArrayObject.bindVertexArrayOES(this.vao)},n.prototype.freshBind=function(t,e,r,n,a){var o,s=e.numAttributes;if(t.extVertexArrayObject)this.vao&&this.destroy(t),this.vao=t.extVertexArrayObject.createVertexArrayOES(),t.extVertexArrayObject.bindVertexArrayOES(this.vao),o=0,this.boundProgram=e,this.boundVertexBuffer=r,this.boundVertexBuffer2=a,this.boundElementBuffer=n;else{o=t.currentNumAttributes||0;for(var l=s;l<o;l++)i(0!==l),t.disableVertexAttribArray(l)}for(var u=o;u<s;u++)t.enableVertexAttribArray(u);r.bind(t),r.setVertexAttribPointers(t,e),a&&(a.bind(t),a.setVertexAttribPointers(t,e)),n&&n.bind(t),t.currentNumAttributes=s},n.prototype.unbind=function(t){var e=t.extVertexArrayObject;e&&e.bindVertexArrayOES(null)},n.prototype.destroy=function(t){var e=t.extVertexArrayObject;e&&this.vao&&(e.deleteVertexArrayOES(this.vao),this.vao=null)}},{assert:40}],340:[function(t,e,r){\"use strict\";function n(t,e,r){e=e||{},this.id=t,this.dispatcher=r,this._data=e.data,void 0!==e.maxzoom&&(this.maxzoom=e.maxzoom),e.type&&(this.type=e.type);var n=s/this.tileSize;this.workerOptions=a.extend({source:this.id,cluster:e.cluster||!1,geojsonVtOptions:{buffer:(void 0!==e.buffer?e.buffer:128)*n,tolerance:(void 0!==e.tolerance?e.tolerance:.375)*n,extent:s,maxZoom:this.maxzoom},superclusterOptions:{maxZoom:Math.min(e.clusterMaxZoom,this.maxzoom-1)||this.maxzoom-1,extent:s,radius:(e.clusterRadius||50)*n,log:!1}},e.workerOptions),this._updateWorkerData(function(t){t?this.fire(\"error\",{error:t}):this.fire(\"load\")}.bind(this))}var i=t(\"../util/evented\"),a=t(\"../util/util\"),o=t(\"resolve-url\"),s=t(\"../data/bucket\").EXTENT;e.exports=n,n.prototype=a.inherit(i,{type:\"geojson\",minzoom:0,maxzoom:18,tileSize:512,isTileClipped:!0,reparseOverscaled:!0,onAdd:function(t){this.map=t},setData:function(t){return this._data=t,this._updateWorkerData(function(t){if(t)return this.fire(\"error\",{error:t});this.fire(\"change\")}.bind(this)),this},_updateWorkerData:function(t){var e=a.extend({},this.workerOptions),r=this._data;\"string\"==typeof r?e.url=\"undefined\"!=typeof window?o(window.location.href,r):r:e.data=JSON.stringify(r),this.workerID=this.dispatcher.send(this.type+\".loadData\",e,function(e){this._loaded=!0,t(e)}.bind(this))},loadTile:function(t,e){var r=t.coord.z>this.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,n={type:this.type,uid:t.uid,coord:t.coord,zoom:t.coord.z,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,overscaling:r,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send(\"load tile\",n,function(r,n){if(t.unloadVectorData(this.map.painter),!t.aborted)return r?e(r):(t.loadVectorData(n,this.map.style),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(this)),e(null))}.bind(this),this.workerID)},abortTile:function(t){t.aborted=!0},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send(\"remove tile\",{uid:t.uid,source:this.id},function(){},t.workerID)},serialize:function(){return{type:this.type,data:this._data}}})},{\"../data/bucket\":311,\"../util/evented\":416,\"../util/util\":424,\"resolve-url\":482}],341:[function(t,e,r){\"use strict\";function n(t,e,r){r&&(this.loadGeoJSON=r),h.call(this,t,e)}var i=t(\"../util/util\"),a=t(\"../util/ajax\"),o=t(\"geojson-rewind\"),s=t(\"./geojson_wrapper\"),l=t(\"vt-pbf\"),u=t(\"supercluster\"),c=t(\"geojson-vt\"),h=t(\"./vector_tile_worker_source\");e.exports=n,n.prototype=i.inherit(h,{_geoJSONIndexes:{},loadVectorData:function(t,e){var r=t.source,n=t.coord;if(!this._geoJSONIndexes[r])return e(null,null);var i=this._geoJSONIndexes[r].getTile(Math.min(n.z,t.maxZoom),n.x,n.y);if(!i)return e(null,null);var a=new s(i.features);a.name=\"_geojsonTileLayer\";var o=l({layers:{_geojsonTileLayer:a}});0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{tile:a,rawTileData:o.buffer})},loadData:function(t,e){var r=function(r,n){return r?e(r):\"object\"!=typeof n?e(new Error(\"Input data is not a valid GeoJSON object.\")):(o(n,!0),void this._indexData(n,t,function(r,n){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)a.getJSON(t.url,e);else{if(\"string\"!=typeof t.data)return e(new Error(\"Input data is not a valid GeoJSON object.\"));try{return e(null,JSON.parse(t.data))}catch(t){return e(new Error(\"Input data is not a valid GeoJSON object.\"))}}},_indexData:function(t,e,r){try{e.cluster?r(null,u(e.superclusterOptions).load(t.features)):r(null,c(t,e.geojsonVtOptions))}catch(t){return r(t)}}})},{\"../util/ajax\":407,\"../util/util\":424,\"./geojson_wrapper\":342,\"./vector_tile_worker_source\":353,\"geojson-rewind\":123,\"geojson-vt\":127,supercluster:509,\"vt-pbf\":536}],342:[function(t,e,r){\"use strict\";function n(t){this.features=t,this.length=t.length,this.extent=s}function i(t){if(this.type=t.type,1===t.type){this.rawGeometry=[];for(var e=0;e<t.geometry.length;e++)this.rawGeometry.push([t.geometry[e]])}else this.rawGeometry=t.geometry;this.properties=t.tags,this.extent=s}var a=t(\"point-geometry\"),o=t(\"vector-tile\").VectorTileFeature,s=t(\"../data/bucket\").EXTENT;e.exports=n,n.prototype.feature=function(t){return new i(this.features[t])},i.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var r=t[e],n=[],i=0;i<r.length;i++)n.push(new a(r[i][0],r[i][1]));this.geometry.push(n)}return this.geometry},i.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-1/0,n=1/0,i=-1/0,a=0;a<t.length;a++)for(var o=t[a],s=0;s<o.length;s++){var l=o[s];e=Math.min(e,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.y)}return[e,n,r,i]},i.prototype.toGeoJSON=o.prototype.toGeoJSON},{\"../data/bucket\":311,\"point-geometry\":465,\"vector-tile\":530}],343:[function(t,e,r){\"use strict\";function n(t,e,r){this.id=t,this.dispatcher=r,this.url=e.url,this.coordinates=e.coordinates,u.getImage(e.url,function(t,r){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))}var i=t(\"../util/util\"),a=t(\"./tile_coord\"),o=t(\"../geo/lng_lat\"),s=t(\"point-geometry\"),l=t(\"../util/evented\"),u=t(\"../util/ajax\"),c=t(\"../data/bucket\").EXTENT,h=t(\"../render/draw_raster\").RasterBoundsArray,f=t(\"../data/buffer\"),d=t(\"../render/vertex_array_object\");e.exports=n,n.prototype=i.inherit(l,{minzoom:0,maxzoom:22,tileSize:512,onAdd:function(t){this.map=t,this.image&&this.setCoordinates(this.coordinates)},setCoordinates:function(t){this.coordinates=t;var e=this.map,r=t.map(function(t){return e.transform.locationCoordinate(o.convert(t)).zoomTo(0)}),n=this.centerCoord=i.getCoordinatesCenter(r);return n.column=Math.round(n.column),n.row=Math.round(n.row),this.minzoom=this.maxzoom=n.zoom,this._coord=new a(n.zoom,n.column,n.row),this._tileCoords=r.map(function(t){var e=t.zoomTo(n.zoom);return new s(Math.round((e.column-n.column)*c),Math.round((e.row-n.row)*c))}),this.fire(\"change\"),this},_setTile:function(t){this._prepared=!1,this.tile=t;var e=new h;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(),h.serialize(),f.BufferType.VERTEX),this.tile.boundsVAO=new d,this.tile.state=\"loaded\"},prepare:function(){if(this._loaded&&this.image&&this.image.complete&&this.tile){var t=this.map.painter.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\":311,\"../data/buffer\":316,\"../geo/lng_lat\":321,\"../render/draw_raster\":333,\"../render/vertex_array_object\":339,\"../util/ajax\":407,\"../util/evented\":416,\"../util/util\":424,\"./tile_coord\":351,\"point-geometry\":465}],344:[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\":407,\"../util/browser\":408,\"../util/mapbox\":421,\"../util/util\":424}],345:[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\":311}],346:[function(t,e,r){\"use strict\";function n(t,e){var r=t.coord,n=e.coord;return r.z-n.z||r.y-n.y||r.w-n.w||r.x-n.x}function i(t){for(var e=t[0]||{},r=1;r<t.length;r++){var n=t[r];for(var i in n){var a=n[i],o=e[i];if(void 0===o)o=e[i]=a;else for(var s=0;s<a.length;s++)o.push(a[s])}}return e}var a=t(\"./tile_coord\");r.rendered=function(t,e,r,a,o,s){var l=t.tilesIn(r);l.sort(n);for(var u=[],c=0;c<l.length;c++){var h=l[c];h.tile.featureIndex&&u.push(h.tile.featureIndex.query({queryGeometry:h.queryGeometry,scale:h.scale,tileSize:h.tile.tileSize,bearing:s,params:a},e))}return i(u)},r.source=function(t,e){for(var r=t.getRenderableIds().map(function(e){return t.getTileByID(e)}),n=[],i={},o=0;o<r.length;o++){var s=r[o],l=new a(Math.min(s.sourceMaxZoom,s.coord.z),s.coord.x,s.coord.y,0).id;i[l]||(i[l]=!0,s.querySourceFeatures(n,e))}return n}},{\"./tile_coord\":351}],347:[function(t,e,r){\"use strict\";function n(t,e,r){this.id=t,this.dispatcher=r,i.extend(this,i.pick(e,[\"url\",\"scheme\",\"tileSize\"])),s(e,function(t,e){if(t)return this.fire(\"error\",t);i.extend(this,e),this.fire(\"load\")}.bind(this))}var i=t(\"../util/util\"),a=t(\"../util/ajax\"),o=t(\"../util/evented\"),s=t(\"./load_tilejson\"),l=t(\"../util/mapbox\").normalizeTileURL;e.exports=n,n.prototype=i.inherit(o,{minzoom:0,maxzoom:22,roundZoom:!0,scheme:\"xyz\",tileSize:512,_loaded:!1,onAdd:function(t){this.map=t},serialize:function(){return{type:\"raster\",url:this.url,tileSize:this.tileSize}},loadTile:function(t,e){function r(r,n){if(delete t.request,!t.aborted){if(r)return e(r);var i=this.map.painter.gl;t.texture=this.map.painter.getTexture(n.width),t.texture?(i.bindTexture(i.TEXTURE_2D,t.texture),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,n)):(t.texture=i.createTexture(),i.bindTexture(i.TEXTURE_2D,t.texture),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR_MIPMAP_NEAREST),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,n),t.texture.size=n.width),i.generateMipmap(i.TEXTURE_2D),this.map.animationLoop.set(this.map.style.rasterFadeDuration),t.state=\"loaded\",e(null)}}var n=l(t.coord.url(this.tiles,null,this.scheme),this.url,this.tileSize);t.request=a.getImage(n,r.bind(this))},abortTile:function(t){t.request&&(t.request.abort(),delete t.request)},unloadTile:function(t){t.texture&&this.map.painter.saveTexture(t.texture)}})},{\"../util/ajax\":407,\"../util/evented\":416,\"../util/mapbox\":421,\"../util/util\":424,\"./load_tilejson\":344}],348:[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\":340,\"../source/image_source\":343,\"../source/raster_tile_source\":347,\"../source/vector_tile_source\":352,\"../source/video_source\":354,\"../util/util\":424}],349:[function(t,e,r){\"use strict\";function n(t,e,r){this.id=t,this.dispatcher=r;var n=this._source=o.create(t,e,r).on(\"load\",function(){this.map&&this._source.onAdd&&this._source.onAdd(this.map),this._sourceLoaded=!0,this.tileSize=n.tileSize,this.minzoom=n.minzoom,this.maxzoom=n.maxzoom,this.roundZoom=n.roundZoom,this.reparseOverscaled=n.reparseOverscaled,this.isTileClipped=n.isTileClipped,this.attribution=n.attribution,this.vectorLayerIds=n.vectorLayerIds,this.fire(\"load\")}.bind(this)).on(\"error\",function(t){this._sourceErrored=!0,this.fire(\"error\",t)}.bind(this)).on(\"change\",function(){this.reload(),this.transform&&this.update(this.transform,this.map&&this.map.style.rasterFadeDuration),this.fire(\"change\")}.bind(this));this._tiles={},this._cache=new c(0,this.unloadTile.bind(this)),this._isIdRenderable=this._isIdRenderable.bind(this)}function i(t,e,r){var n=r.zoomTo(Math.min(t.z,e));return{x:(n.column-(t.x+t.w*Math.pow(2,t.z)))*d,y:(n.row-t.y)*d}}function a(t,e){return t%32-e%32}var o=t(\"./source\"),s=t(\"./tile\"),l=t(\"../util/evented\"),u=t(\"./tile_coord\"),c=t(\"../util/lru_cache\"),h=t(\"../geo/coordinate\"),f=t(\"../util/util\"),d=t(\"../data/bucket\").EXTENT;e.exports=n,n.maxOverzooming=10,n.maxUnderzooming=3,n.prototype=f.inherit(l,{onAdd:function(t){this.map=t,this._source&&this._source.onAdd&&this._source.onAdd(t)},loaded:function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;for(var t in this._tiles){var e=this._tiles[t];if(\"loaded\"!==e.state&&\"errored\"!==e.state)return!1}return!0},getSource:function(){return this._source},loadTile:function(t,e){return this._source.loadTile(t,e)},unloadTile:function(t){if(this._source.unloadTile)return this._source.unloadTile(t)},abortTile:function(t){if(this._source.abortTile)return this._source.abortTile(t)},serialize:function(){return this._source.serialize()},prepare:function(){if(this._sourceLoaded&&this._source.prepare)return this._source.prepare()},getIds:function(){return Object.keys(this._tiles).map(Number).sort(a)},getRenderableIds:function(){return this.getIds().filter(this._isIdRenderable)},_isIdRenderable:function(t){return this._tiles[t].isRenderable()&&!this._coveredTiles[t]},reload:function(){this._cache.reset();for(var t in this._tiles){var e=this._tiles[t];\"loading\"!==e.state&&(e.state=\"reloading\"),this.loadTile(this._tiles[t],this._tileLoaded.bind(this,this._tiles[t]))}},_tileLoaded:function(t,e){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,i,a;this.updateCacheSize(t);var o=(this.roundZoom?Math.round:Math.floor)(this.getZoom(t)),s=Math.max(o-n.maxOverzooming,this.minzoom),l=Math.max(o+n.maxUnderzooming,this.minzoom),c={},h=(new Date).getTime();this._coveredTiles={};var d=this.used?t.coveringTiles(this._source):[];for(r=0;r<d.length;r++)i=d[r],a=this.addTile(i),c[i.id]=!0,a.isRenderable()||this.findLoadedChildren(i,l,c)||this.findLoadedParent(i,s,c);for(var p={},m=Object.keys(c),g=0;g<m.length;g++){var v=m[g];i=u.fromID(v),(a=this._tiles[v])&&a.timeAdded>h-(e||0)&&(this.findLoadedChildren(i,l,c)&&(c[v]=!0),this.findLoadedParent(i,s,p))}var y;for(y in p)c[y]||(this._coveredTiles[y]=!0);for(y in p)c[y]=!0;var b=f.keysDifference(this._tiles,c);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,i=n>this.maxzoom?Math.pow(2,n-this.maxzoom):1;e=new s(r,this.tileSize*i,this.maxzoom),this.loadTile(e,this._tileLoaded.bind(this,e))}return e.uses++,this._tiles[t.id]=e,this.fire(\"tile.add\",{tile:e}),this._source.fire(\"tile.add\",{tile:e}),e},removeTile:function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this.fire(\"tile.remove\",{tile:e}),this._source.fire(\"tile.remove\",{tile:e}),e.uses>0||(e.isRenderable()?this._cache.add(e.coord.wrapped().id,e):(e.aborted=!0,this.abortTile(e),this.unloadTile(e))))},clearTiles:function(){for(var t in this._tiles)this.removeTile(t);this._cache.reset()},tilesIn:function(t){for(var e={},r=this.getIds(),n=1/0,a=1/0,o=-1/0,s=-1/0,l=t[0].zoom,c=0;c<t.length;c++){var f=t[c];n=Math.min(n,f.column),a=Math.min(a,f.row),o=Math.max(o,f.column),s=Math.max(s,f.row)}for(var p=0;p<r.length;p++){var m=this._tiles[r[p]],g=u.fromID(r[p]),v=[i(g,m.sourceMaxZoom,new h(n,a,l)),i(g,m.sourceMaxZoom,new h(o,s,l))];if(v[0].x<d&&v[0].y<d&&v[1].x>=0&&v[1].y>=0){for(var y=[],b=0;b<t.length;b++)y.push(i(g,m.sourceMaxZoom,t[b]));var x=e[m.coord.id];void 0===x&&(x=e[m.coord.id]={tile:m,coord:g,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(u.fromID)}})},{\"../data/bucket\":311,\"../geo/coordinate\":320,\"../util/evented\":416,\"../util/lru_cache\":420,\"../util/util\":424,\"./source\":348,\"./tile\":350,\"./tile_coord\":351}],350:[function(t,e,r){\"use strict\";function n(t,e,r){this.coord=t,this.uid=a.uniqueId(),this.uses=0,this.tileSize=e,this.sourceMaxZoom=r,this.buckets={},this.state=\"loading\"}function i(t,e){if(e){for(var r={},n=0;n<t.length;n++){var i=e.getLayer(t[n].layerId);if(i){var s=o.create(a.extend({layer:i,childLayers:t[n].childLayerIds.map(e.getLayer.bind(e)).filter(function(t){return t})},t[n]));r[s.id]=s}}return r}}var a=t(\"../util/util\"),o=t(\"../data/bucket\"),s=t(\"../data/feature_index\"),l=t(\"vector-tile\"),u=t(\"pbf\"),c=t(\"../util/vectortile_to_geojson\"),h=t(\"feature-filter\"),f=t(\"../symbol/collision_tile\"),d=t(\"../symbol/collision_box\"),p=t(\"../symbol/symbol_instances\"),m=t(\"../symbol/symbol_quads\");e.exports=n,n.prototype={loadVectorData:function(t,e){this.state=\"loaded\",t&&(this.collisionBoxArray=new d(t.collisionBoxArray),this.collisionTile=new f(t.collisionTile,this.collisionBoxArray),this.symbolInstancesArray=new p(t.symbolInstancesArray),this.symbolQuadsArray=new m(t.symbolQuadsArray),this.featureIndex=new s(t.featureIndex,t.rawTileData,this.collisionTile),this.rawTileData=t.rawTileData,this.buckets=i(t.buckets,e))},reloadSymbolData:function(t,e,r){if(\"unloaded\"!==this.state){this.collisionTile=new f(t.collisionTile,this.collisionBoxArray),this.featureIndex.setCollisionTile(this.collisionTile);for(var n in this.buckets){var o=this.buckets[n];\"symbol\"===o.type&&(o.destroy(e.gl),delete this.buckets[n])}a.extend(this.buckets,i(t.buckets,r))}},unloadVectorData:function(t){for(var e in this.buckets)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){function e(e,r){this.reloadSymbolData(r,t.map.painter,t.map.style),t.fire(\"tile.load\",{tile:this}),this.state=\"loaded\",this.redoWhenDone&&(this.redoPlacement(t),this.redoWhenDone=!1)}\"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},e.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 l.VectorTile(new u(new Uint8Array(this.rawTileData))).layers);var r=this.vtLayers._geojsonTileLayer||this.vtLayers[e.sourceLayer];if(r)for(var n=h(e.filter),i={z:this.coord.z,x:this.coord.x,y:this.coord.y},a=0;a<r.length;a++){var o=r.feature(a);if(n(o)){var s=new c(o,this.coord.z,this.coord.x,this.coord.y);s.tile=i,t.push(s)}}}},isRenderable:function(){return\"loaded\"===this.state||\"reloading\"===this.state}}},{\"../data/bucket\":311,\"../data/feature_index\":318,\"../symbol/collision_box\":376,\"../symbol/collision_tile\":378,\"../symbol/symbol_instances\":387,\"../symbol/symbol_quads\":388,\"../util/util\":424,\"../util/vectortile_to_geojson\":425,\"feature-filter\":117,pbf:459,\"vector-tile\":530}],351:[function(t,e,r){\"use strict\";function n(t,e,r,n){l(!isNaN(t)&&t>=0&&t%1==0),l(!isNaN(e)&&e>=0&&e%1==0),l(!isNaN(r)&&r>=0&&r%1==0),isNaN(n)&&(n=0),this.z=+t,this.x=+e,this.y=+r,this.w=+n,(n*=2)<0&&(n=-1*n-1);var i=1<<this.z;this.id=32*(i*i*n+i*this.y+this.x)+this.z,this.posMatrix=null}function i(t,e,r){for(var n,i=\"\",a=t;a>0;a--)i+=(e&(n=1<<a-1)?1:0)+(r&n?2:0);return i}function a(t,e){if(t.row>e.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function o(t,e,r,n,i){var a=Math.max(r,Math.floor(e.y0)),o=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx<e.x1:t.x1-e.dy/t.dy*t.dx<e.x0){var s=t;t=e,e=s}for(var l=t.dx/t.dy,u=e.dx/e.dy,c=t.dx>0,h=e.dx<0,f=a;f<o;f++){var d=l*Math.max(0,Math.min(t.dy,f+c-t.y0))+t.x0,p=u*Math.max(0,Math.min(e.dy,f+h-e.y0))+e.x0;i(Math.floor(p),Math.ceil(d),f)}}function s(t,e,r,n,i,s){var l,u=a(t,e),c=a(e,r),h=a(r,t);u.dy>c.dy&&(l=u,u=c,c=l),u.dy>h.dy&&(l=u,u=h,h=l),c.dy>h.dy&&(l=c,c=h,h=l),u.dy&&o(h,u,n,i,s),c.dy&&o(h,c,n,i,s)}var l=t(\"assert\"),u=t(\"whoots-js\"),c=t(\"../geo/coordinate\");e.exports=n,n.prototype.toString=function(){return this.z+\"/\"+this.x+\"/\"+this.y},n.prototype.toCoordinate=function(t){var e=Math.min(this.z,t),r=Math.pow(2,e),n=this.y,i=this.x+r*this.w;return new c(i,n,e)},n.fromID=function(t){var e=t%32,r=1<<e,i=(t-e)/32,a=i%r,o=(i-a)/r%r,s=Math.floor(i/(r*r));return s%2!=0&&(s=-1*s-1),s/=2,new n(e,a,o,s)},n.prototype.url=function(t,e,r){var n=u.getTileBBox(this.x,this.y,this.z),a=i(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(\"{prefix}\",(this.x%16).toString(16)+(this.y%16).toString(16)).replace(\"{z}\",Math.min(this.z,e||this.z)).replace(\"{x}\",this.x).replace(\"{y}\",\"tms\"===r?Math.pow(2,this.z)-this.y-1:this.y).replace(\"{quadkey}\",a).replace(\"{bbox-epsg-3857}\",n)},n.prototype.parent=function(t){return 0===this.z?null:this.z>t?new n(this.z-1,this.x,this.y,this.w):new n(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},n.prototype.wrapped=function(){return new n(this.z,this.x,this.y,0)},n.prototype.children=function(t){if(this.z>=t)return[new n(this.z+1,this.x,this.y,this.w)];var e=this.z+1,r=2*this.x,i=2*this.y;return[new n(e,r,i,this.w),new n(e,r+1,i,this.w),new n(e,r,i+1,this.w),new n(e,r+1,i+1,this.w)]},n.cover=function(t,e,r){function i(t,e,i){var s,l;if(i>=0&&i<=a)for(s=t;s<e;s++)l=new n(r,(s%a+a)%a,i,Math.floor(s/a)),o[l.id]=l}var a=1<<t,o={};return s(e[0],e[1],e[2],0,a,i),s(e[2],e[3],e[0],0,a,i),Object.keys(o).map(function(t){return o[t]})}},{\"../geo/coordinate\":320,assert:40,\"whoots-js\":546}],352:[function(t,e,r){\"use strict\";function n(t,e,r){if(this.id=t,this.dispatcher=r,a.extend(this,a.pick(e,[\"url\",\"scheme\",\"tileSize\"])),this._options=a.extend({type:\"vector\"},e),512!==this.tileSize)throw new Error(\"vector tile sources must have a tileSize of 512\");o(e,function(t,e){t?this.fire(\"error\",t):(a.extend(this,e),this.fire(\"load\"))}.bind(this))}var i=t(\"../util/evented\"),a=t(\"../util/util\"),o=t(\"./load_tilejson\"),s=t(\"../util/mapbox\").normalizeTileURL;e.exports=n,n.prototype=a.inherit(i,{minzoom:0,maxzoom:22,scheme:\"xyz\",tileSize:512,reparseOverscaled:!0,isTileClipped:!0,onAdd:function(t){this.map=t},serialize:function(){return a.extend({},this._options)},loadTile:function(t,e){function r(r,n){if(!t.aborted){if(r)return e(r);t.loadVectorData(n,this.map.style),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(this)),e(null),t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)}}var n=t.coord.z>this.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i={url:s(t.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),uid:t.uid,coord:t.coord,zoom:t.coord.z,tileSize:this.tileSize*n,source:this.id,overscaling:n,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID?\"loading\"===t.state?t.reloadCallback=e:(i.rawTileData=t.rawTileData,this.dispatcher.send(\"reload tile\",i,r.bind(this),t.workerID)):t.workerID=this.dispatcher.send(\"load tile\",i,r.bind(this))},abortTile:function(t){this.dispatcher.send(\"abort tile\",{uid:t.uid,source:this.id},null,t.workerID)},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send(\"remove tile\",{uid:t.uid,source:this.id},null,t.workerID)}})},{\"../util/evented\":416,\"../util/mapbox\":421,\"../util/util\":424,\"./load_tilejson\":344}],353:[function(t,e,r){\"use strict\";function n(t,e,r){this.actor=t,this.styleLayers=e,r&&(this.loadVectorData=r),this.loading={},this.loaded={}}var i=t(\"../util/ajax\"),a=t(\"vector-tile\"),o=t(\"pbf\"),s=t(\"./worker_tile\");e.exports=n,n.prototype={loadTile:function(t,e){function r(t,r){return delete this.loading[n][i],t?e(t):r?(a.data=r.tile,a.parse(a.data,this.styleLayers.getLayerFamilies(),this.actor,r.rawTileData,e),this.loaded[n]=this.loaded[n]||{},void(this.loaded[n][i]=a)):e(null,null)}var n=t.source,i=t.uid;this.loading[n]||(this.loading[n]={});var a=this.loading[n][i]=new s(t);a.abort=this.loadVectorData(t,r.bind(this))},reloadTile:function(t,e){var r=this.loaded[t.source],n=t.uid;if(r&&r[n]){var i=r[n];i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,t.rawTileData,e)}},abortTile:function(t){var e=this.loading[t.source],r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort(),delete e[r])},removeTile:function(t){var e=this.loaded[t.source],r=t.uid;e&&e[r]&&delete e[r]},loadVectorData:function(t,e){function r(t,r){if(t)return e(t);var n=new a.VectorTile(new o(new Uint8Array(r)));e(t,{tile:n,rawTileData:r})}var n=i.getArrayBuffer(t.url,r.bind(this));return function(){n.abort()}},redoPlacement:function(t,e){var r=this.loaded[t.source],n=this.loading[t.source],i=t.uid;if(r&&r[i]){var a=r[i].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\":407,\"./worker_tile\":356,pbf:459,\"vector-tile\":530}],354:[function(t,e,r){\"use strict\";function n(t,e){this.id=t,this.urls=e.urls,this.coordinates=e.coordinates,u.getVideo(e.urls,function(t,r){if(t)return this.fire(\"error\",{error:t});this.video=r,this.video.loop=!0;var n;this.video.addEventListener(\"playing\",function(){n=this.map.style.animationLoop.set(1/0),this.map._rerender()}.bind(this)),this.video.addEventListener(\"pause\",function(){this.map.style.animationLoop.cancel(n)}.bind(this)),this.map&&(this.video.play(),this.setCoordinates(e.coordinates)),this.fire(\"load\")}.bind(this))}var i=t(\"../util/util\"),a=t(\"./tile_coord\"),o=t(\"../geo/lng_lat\"),s=t(\"point-geometry\"),l=t(\"../util/evented\"),u=t(\"../util/ajax\"),c=t(\"../data/bucket\").EXTENT,h=t(\"../render/draw_raster\").RasterBoundsArray,f=t(\"../data/buffer\"),d=t(\"../render/vertex_array_object\");e.exports=n,n.prototype=i.inherit(l,{minzoom:0,maxzoom:22,tileSize:512,roundZoom:!0,getVideo:function(){return this.video},onAdd:function(t){this.map||(this.map=t,this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},setCoordinates:function(t){this.coordinates=t;var e=this.map,r=t.map(function(t){return e.transform.locationCoordinate(o.convert(t)).zoomTo(0)}),n=this.centerCoord=i.getCoordinatesCenter(r);return n.column=Math.round(n.column),n.row=Math.round(n.row),this.minzoom=this.maxzoom=n.zoom,this._coord=new a(n.zoom,n.column,n.row),this._tileCoords=r.map(function(t){var e=t.zoomTo(n.zoom);return new s(Math.round((e.column-n.column)*c),Math.round((e.row-n.row)*c))}),this.fire(\"change\"),this},_setTile:function(t){this._prepared=!1,this.tile=t;var e=new h;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(),h.serialize(),f.BufferType.VERTEX),this.tile.boundsVAO=new d,this.tile.state=\"loaded\"},prepare:function(){if(!(this.video.readyState<2)&&this.tile){var t=this.map.painter.gl;this._prepared?(t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,this.video)):(this._prepared=!0,this.tile.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.video)),this._currentTime=this.video.currentTime}},loadTile:function(t,e){this._coord&&this._coord.toString()===t.coord.toString()?(this._setTile(t),e(null)):(t.state=\"errored\",e(null))},serialize:function(){return{type:\"video\",urls:this.urls,coordinates:this.coordinates}}})},{\"../data/bucket\":311,\"../data/buffer\":316,\"../geo/lng_lat\":321,\"../render/draw_raster\":333,\"../render/vertex_array_object\":339,\"../util/ajax\":407,\"../util/evented\":416,\"../util/util\":424,\"./tile_coord\":351,\"point-geometry\":465}],355:[function(t,e,r){\"use strict\";function n(t){this.self=t,this.actor=new a(t,this);var e={getLayers:function(){return this.layers}.bind(this),getLayerFamilies:function(){return this.layerFamilies}.bind(this)};this.workerSources={vector:new l(this.actor,e),geojson:new u(this.actor,e)},this.self.registerWorkerSource=function(t,r){if(this.workerSources[t])throw new Error('Worker source with name \"'+t+'\" already registered.');this.workerSources[t]=new r(this.actor,e)}.bind(this)}function i(t){var e={};for(var r in t){var n=t[r],i=n.ref||n.id,a=t[i];a.layout&&\"none\"===a.layout.visibility||(e[i]=e[i]||[],r===i?e[i].unshift(n):e[i].push(n))}return e}var a=t(\"../util/actor\"),o=t(\"../style/style_layer\"),s=t(\"../util/util\"),l=t(\"./vector_tile_worker_source\"),u=t(\"./geojson_worker_source\");e.exports=function(t){return new n(t)},s.extend(n.prototype,{\"set layers\":function(t){function e(t){var e=o.create(t,t.ref&&r.layers[t.ref]);e.updatePaintTransitions({},{transition:!1}),r.layers[e.id]=e}this.layers={};for(var r=this,n=[],a=0;a<t.length;a++){var s=t[a];\"fill\"!==s.type&&\"line\"!==s.type&&\"circle\"!==s.type&&\"symbol\"!==s.type||(s.ref?n.push(a):e(s))}for(var l=0;l<n.length;l++)e(t[n[l]]);this.layerFamilies=i(this.layers)},\"update layers\":function(t){function e(t){var e=a.layers[t.ref];a.layers[t.id]?a.layers[t.id].set(t,e):a.layers[t.id]=o.create(t,e),a.layers[t.id].updatePaintTransitions({},{transition:!1})}var r,n,a=this;for(r in t)(n=t[r]).ref&&e(n);for(r in t)(n=t[r]).ref||e(n);this.layerFamilies=i(this.layers)},\"load tile\":function(t,e){var r=t.type||\"vector\";this.workerSources[r].loadTile(t,e)},\"reload tile\":function(t,e){var r=t.type||\"vector\";this.workerSources[r].reloadTile(t,e)},\"abort tile\":function(t){var e=t.type||\"vector\";this.workerSources[e].abortTile(t)},\"remove tile\":function(t){var e=t.type||\"vector\";this.workerSources[e].removeTile(t)},\"redo placement\":function(t,e){var r=t.type||\"vector\";this.workerSources[r].redoPlacement(t,e)},\"load worker source\":function(t,e){try{this.self.importScripts(t.url),e()}catch(t){e(t)}}})},{\"../style/style_layer\":363,\"../util/actor\":406,\"../util/util\":424,\"./geojson_worker_source\":341,\"./vector_tile_worker_source\":353}],356:[function(t,e,r){\"use strict\";function n(t){this.coord=t.coord,this.uid=t.uid,this.zoom=t.zoom,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=t.overscaling,this.angle=t.angle,this.pitch=t.pitch,this.showCollisionBoxes=t.showCollisionBoxes}function i(t){return!t.isEmpty()}function a(t){return t.serialize()}function o(t){var e=[];for(var r in t)t[r].getTransferables(e);return e}function s(t){return t.id}var l=t(\"../data/feature_index\"),u=t(\"../symbol/collision_tile\"),c=t(\"../data/bucket\"),h=t(\"../symbol/collision_box\"),f=t(\"../util/dictionary_coder\"),d=t(\"../util/util\"),p=t(\"../symbol/symbol_instances\"),m=t(\"../symbol/symbol_quads\");e.exports=n,n.prototype.parse=function(t,e,r,n,g){function v(t,e){for(var r=0;r<t.length;r++){var n=t.feature(r);n.index=r;for(var i in e)e[i].filter(n)&&e[i].features.push(n)}}function y(t){if(t)return g(t);if(2===++N){for(var e=P.length-1;e>=0;e--)b(E,P[e]);x()}}function b(t,e){if(e.populateArrays(A,F,R),\"symbol\"!==e.type)for(var r=0;r<e.features.length;r++){var n=e.features[r];T.insert(n,n.index,e.sourceLayerIndex,e.index)}e.features=null}function x(){E.status=\"done\",E.redoPlacementAfterDone&&(E.redoPlacement(E.angle,E.pitch,null),E.redoPlacementAfterDone=!1);var t=T.serialize(),e=A.serialize(),r=E.collisionBoxArray.serialize(),s=E.symbolInstancesArray.serialize(),l=E.symbolQuadsArray.serialize(),u=[n].concat(t.transferables).concat(e.transferables),c=I.filter(i);g(null,{buckets:c.map(a),featureIndex:t.data,collisionTile:e.data,collisionBoxArray:r,symbolInstancesArray:s,symbolQuadsArray:l,rawTileData:n},o(c).concat(u))}this.status=\"parsing\",this.data=t,this.collisionBoxArray=new h,this.symbolInstancesArray=new p,this.symbolQuadsArray=new m;var _,w,M,k,A=new u(this.angle,this.pitch,this.collisionBoxArray),T=new l(this.coord,this.overscaling,A,t.layers),S=new f(t.layers?Object.keys(t.layers).sort():[\"_geojsonTileLayer\"]),E=this,L={},C={},z=0;for(var D in e)(w=e[D][0]).source===this.source&&(w.ref||w.minzoom&&this.zoom<w.minzoom||w.maxzoom&&this.zoom>=w.maxzoom||w.layout&&\"none\"===w.layout.visibility||t.layers&&!t.layers[w.sourceLayer]||((k=c.create({layer:w,index:z++,childLayers:e[D],zoom:this.zoom,overscaling:this.overscaling,showCollisionBoxes:this.showCollisionBoxes,collisionBoxArray:this.collisionBoxArray,symbolQuadsArray:this.symbolQuadsArray,symbolInstancesArray:this.symbolInstancesArray,sourceLayerIndex:S.encode(w.sourceLayer||\"_geojsonTileLayer\")})).createFilter(),L[w.id]=k,t.layers&&(C[M=w.sourceLayer]=C[M]||{},C[M][w.id]=k)));if(t.layers)for(M in C)1===w.version&&d.warnOnce('Vector tile source \"'+this.source+'\" layer \"'+M+'\" does not use vector tile spec v2 and therefore may have some rendering errors.'),(w=t.layers[M])&&v(w,C[M]);else v(t,L);var I=[],P=this.symbolBuckets=[],O=[];T.bucketLayerIDs={};for(var j in L)0!==(k=L[j]).features.length&&(T.bucketLayerIDs[k.index]=k.childLayers.map(s),I.push(k),\"symbol\"===k.type?P.push(k):O.push(k));var R={},F={},N=0;if(P.length>0){for(_=P.length-1;_>=0;_--)P[_].updateIcons(R),P[_].updateFont(F);for(var B in F)F[B]=Object.keys(F[B]).map(Number);R=Object.keys(R),r.send(\"get glyphs\",{uid:this.uid,stacks:F},function(t,e){F=e,y(t)}),R.length?r.send(\"get icons\",{icons:R},function(t,e){R=e,y(t)}):y()}for(_=O.length-1;_>=0;_--)b(this,O[_]);if(0===P.length)return x()},n.prototype.redoPlacement=function(t,e,r){if(\"done\"!==this.status)return this.redoPlacementAfterDone=!0,this.angle=t,{};for(var n=new u(t,e,this.collisionBoxArray),s=this.symbolBuckets,l=s.length-1;l>=0;l--)s[l].placeFeatures(n,r);var c=n.serialize(),h=s.filter(i);return{result:{buckets:h.map(a),collisionTile:c.data},transferables:o(h).concat(c.transferables)}}},{\"../data/bucket\":311,\"../data/feature_index\":318,\"../symbol/collision_box\":376,\"../symbol/collision_tile\":378,\"../symbol/symbol_instances\":387,\"../symbol/symbol_quads\":388,\"../util/dictionary_coder\":414,\"../util/util\":424}],357:[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})}},{}],358:[function(t,e,r){\"use strict\";function n(t){this.base=t,this.retina=s.devicePixelRatio>1;var e=this.retina?\"@2x\":\"\";o.getJSON(l(t,e,\".json\"),function(t,e){t?this.fire(\"error\",{error:t}):(this.data=e,this.img&&this.fire(\"load\"))}.bind(this)),o.getImage(l(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 i(){}var a=t(\"../util/evented\"),o=t(\"../util/ajax\"),s=t(\"../util/browser\"),l=t(\"../util/mapbox\").normalizeSpriteURL;e.exports=n,n.prototype=Object.create(a),n.prototype.toJSON=function(){return this.base},n.prototype.loaded=function(){return!(!this.data||!this.img)},n.prototype.resize=function(){if(s.devicePixelRatio>1!==this.retina){var t=new n(this.base);t.on(\"load\",function(){this.img=t.img,this.data=t.data,this.retina=t.retina}.bind(this))}},i.prototype={x:0,y:0,width:0,height:0,pixelRatio:1,sdf:!1},n.prototype.getSpritePosition=function(t){if(!this.loaded())return new i;var e=this.data&&this.data[t];return e&&this.img?e:new i}},{\"../util/ajax\":407,\"../util/browser\":408,\"../util/evented\":416,\"../util/mapbox\":421}],359:[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\":424,\"./style_function\":362,csscolorparser:101}],360:[function(t,e,r){\"use strict\";function n(t,e,r){this.animationLoop=e||new m,this.dispatcher=new p(r||1,this),this.spriteAtlas=new l(1024,1024),this.lineAtlas=new u(256,512),this._layers={},this._order=[],this._groups=[],this.sources={},this.zoomHistory={},c.bindAll([\"_forwardSourceEvent\",\"_forwardTileEvent\",\"_forwardLayerEvent\",\"_redoPlacement\"],this),this._resetUpdates();var n=function(t,e){if(t)this.fire(\"error\",{error:t});else if(!g.emitErrors(this,g(e))){this._loaded=!0,this.stylesheet=e,this.updateClasses();var r=e.sources;for(var n in r)this.addSource(n,r[n]);e.sprite&&(this.sprite=new o(e.sprite),this.sprite.on(\"load\",this.fire.bind(this,\"change\"))),this.glyphSource=new s(e.glyphs),this._resolve(),this.fire(\"load\")}}.bind(this);\"string\"==typeof t?h.getJSON(f(t),n):d.frame(n.bind(this,null,t)),this.on(\"source.load\",function(t){var e=t.source;if(e&&e.vectorLayerIds)for(var r in this._layers){var n=this._layers[r];n.source===e.id&&this._validateLayer(n)}})}var i=t(\"../util/evented\"),a=t(\"./style_layer\"),o=t(\"./image_sprite\"),s=t(\"../symbol/glyph_source\"),l=t(\"../symbol/sprite_atlas\"),u=t(\"../render/line_atlas\"),c=t(\"../util/util\"),h=t(\"../util/ajax\"),f=t(\"../util/mapbox\").normalizeStyleURL,d=t(\"../util/browser\"),p=t(\"../util/dispatcher\"),m=t(\"./animation_loop\"),g=t(\"./validate_style\"),v=t(\"../source/source\"),y=t(\"../source/query_features\"),b=t(\"../source/source_cache\"),x=t(\"./style_spec\"),_=t(\"./style_function\");e.exports=n,n.prototype=c.inherit(i,{_loaded:!1,_validateLayer:function(t){var e=this.sources[t.source];t.sourceLayer&&e&&e.vectorLayerIds&&-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=a.create(e),this._layers[t.id]=t,t.on(\"error\",this._forwardLayerEvent));for(var n=0;n<this.stylesheet.layers.length;n++)if((e=this.stylesheet.layers[n]).ref){var i=this.getLayer(e.ref);t=a.create(e,i),this._layers[t.id]=t,t.on(\"error\",this._forwardLayerEvent)}this._groupLayers(),this._updateWorkerLayers()},_groupLayers:function(){var t;this._groups=[];for(var e=0;e<this._order.length;++e){var r=this._layers[this._order[e]];t&&r.source===t.source||((t=[]).source=r.source,this._groups.push(t)),t.push(r)}},_updateWorkerLayers:function(t){this.dispatcher.broadcast(t?\"update layers\":\"set layers\",this._serializeLayers(t))},_serializeLayers:function(t){t=t||this._order;for(var e=[],r={includeRefProperties:!0},n=0;n<t.length;n++)e.push(this._layers[t[n]].serialize(r));return e},_applyClasses:function(t,e){if(this._loaded){t=t||[],e=e||{transition:!0};var r=this.stylesheet.transition||{},n=this._updates.allPaintProps?this._layers:this._updates.paintProps;for(var i in n){var a=this._layers[i],o=this._updates.paintProps[i];if(this._updates.allPaintProps||o.all)a.updatePaintTransitions(t,e,r,this.animationLoop);else for(var s in o)this._layers[i].updatePaintTransition(s,t,e,r,this.animationLoop)}}},_recalculate:function(t){for(var e in this.sources)this.sources[e].used=!1;this._updateZoomHistory(t),this.rasterFadeDuration=300;for(var r in this._layers){var n=this._layers[r];n.recalculate(t,this.zoomHistory),!n.isHidden(t)&&n.source&&(this.sources[n.source].used=!0)}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(g.source,\"sources.\"+t,e)?this:(e=new b(t,e,this.dispatcher),this.sources[t]=e,e.style=this,e.on(\"load\",this._forwardSourceEvent).on(\"error\",this._forwardSourceEvent).on(\"change\",this._forwardSourceEvent).on(\"tile.add\",this._forwardTileEvent).on(\"tile.load\",this._forwardTileEvent).on(\"tile.error\",this._forwardTileEvent).on(\"tile.remove\",this._forwardTileEvent).on(\"tile.stats\",this._forwardTileEvent),this._updates.events.push([\"source.add\",{source:e}]),this._updates.changed=!0,this)},removeSource:function(t){if(this._checkLoaded(),void 0===this.sources[t])throw new Error(\"There is no source with this ID\");var e=this.sources[t];return delete this.sources[t],delete this._updates.sources[t],e.off(\"load\",this._forwardSourceEvent).off(\"error\",this._forwardSourceEvent).off(\"change\",this._forwardSourceEvent).off(\"tile.add\",this._forwardTileEvent).off(\"tile.load\",this._forwardTileEvent).off(\"tile.error\",this._forwardTileEvent).off(\"tile.remove\",this._forwardTileEvent).off(\"tile.stats\",this._forwardTileEvent),this._updates.events.push([\"source.remove\",{source:e}]),this._updates.changed=!0,this},getSource:function(t){return this.sources[t]&&this.sources[t].getSource()},addLayer:function(t,e){if(this._checkLoaded(),!(t instanceof a)){if(this._handleErrors(g.layer,\"layers.\"+t.id,t,!1,{arrayIndex:-1}))return this;var r=t.ref&&this.getLayer(t.ref);t=a.create(t,r)}return this._validateLayer(t),t.on(\"error\",this._forwardLayerEvent),this._layers[t.id]=t,this._order.splice(e?this._order.indexOf(e):1/0,0,t.id),this._updates.allLayers=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.events.push([\"layer.add\",{layer:t}]),this.updateClasses(t.id)},removeLayer:function(t){this._checkLoaded();var e=this._layers[t];if(void 0===e)throw new Error(\"There is no layer with this ID\");for(var r in this._layers)this._layers[r].ref===t&&this.removeLayer(r);return e.off(\"error\",this._forwardLayerEvent),delete this._layers[t],delete this._updates.layers[t],delete this._updates.paintProps[t],this._order.splice(this._order.indexOf(t),1),this._updates.allLayers=!0,this._updates.events.push([\"layer.remove\",{layer:e}]),this._updates.changed=!0,this},getLayer:function(t){return this._layers[t]},getReferentLayer:function(t){var e=this.getLayer(t);return e.ref&&(e=this.getLayer(e.ref)),e},setLayerZoomRange:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return n.minzoom===e&&n.maxzoom===r?this:(null!=e&&(n.minzoom=e),null!=r&&(n.maxzoom=r),this._updateLayer(n))},setFilter:function(t,e){this._checkLoaded();var r=this.getReferentLayer(t);return null!==e&&this._handleErrors(g.filter,\"layers.\"+r.id+\".filter\",e)?this:c.deepEqual(r.filter,e)?this:(r.filter=c.clone(e),this._updateLayer(r))},getFilter:function(t){return this.getReferentLayer(t).filter},setLayoutProperty:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return c.deepEqual(n.getLayoutProperty(e),r)?this:(n.setLayoutProperty(e,r),this._updateLayer(n))},getLayoutProperty:function(t,e){return this.getReferentLayer(t).getLayoutProperty(e)},setPaintProperty:function(t,e,r,n){this._checkLoaded();var i=this.getLayer(t);if(c.deepEqual(i.getPaintProperty(e,n),r))return this;var a=i.isPaintValueFeatureConstant(e);return i.setPaintProperty(e,r,n),!(r&&_.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(g.filter,\"queryRenderedFeatures.filter\",e.filter,!0);var i={};if(e&&e.layers)for(var a=0;a<e.layers.length;a++){var o=e.layers[a];i[this._layers[o].source]=!0}var s=[];for(var l in this.sources)if(!e.layers||i[l]){var u=this.sources[l],c=y.rendered(u,this._layers,t,e,r,n);s.push(c)}return this._flattenRenderedFeatures(s)},querySourceFeatures:function(t,e){e&&e.filter&&this._handleErrors(g.filter,\"querySourceFeatures.filter\",e.filter,!0);var r=this.sources[t];return r?y.source(r,e):[]},addSourceType:function(t,e,r){return v.getType(t)?r(new Error('A source type called \"'+t+'\" already exists.')):(v.setType(t,e),e.workerSourceURL?void this.dispatcher.broadcast(\"load worker source\",{name:t,url:e.workerSourceURL},r):r(null,null))},_handleErrors:function(t,e,r,n,i){var a=n?g.throwErrors:g.emitErrors,o=t.call(g,c.extend({key:e,style:this.serialize(),value:r,styleSpec:x},i));return a.call(g,this,o)},_remove:function(){this.dispatcher.remove()},_reloadSource:function(t){this.sources[t].reload()},_updateSources:function(t){for(var e in this.sources)this.sources[e].update(t)},_redoPlacement:function(){for(var t in this.sources)this.sources[t].redoPlacement&&this.sources[t].redoPlacement()},_forwardSourceEvent:function(t){this.fire(\"source.\"+t.type,c.extend({source:t.target.getSource()},t))},_forwardTileEvent:function(t){this.fire(t.type,c.extend({source:t.target},t))},_forwardLayerEvent:function(t){this.fire(\"layer.\"+t.type,c.extend({layer:{id:t.target.id}},t))},\"get sprite json\":function(t,e){var r=this.sprite;r.loaded()?e(null,{sprite:r.data,retina:r.retina}):r.on(\"load\",function(){e(null,{sprite:r.data,retina:r.retina})})},\"get icons\":function(t,e){var r=this.sprite,n=this.spriteAtlas;r.loaded()?(n.setSprite(r),n.addIcons(t.icons,e)):r.on(\"load\",function(){n.setSprite(r),n.addIcons(t.icons,e)})},\"get glyphs\":function(t,e){function r(t,r,n){t&&console.error(t),a[n]=r,0===--i&&e(null,a)}var n=t.stacks,i=Object.keys(n).length,a={};for(var o in n)this.glyphSource.getSimpleGlyphs(o,n[o],t.uid,r)}})},{\"../render/line_atlas\":336,\"../source/query_features\":346,\"../source/source\":348,\"../source/source_cache\":349,\"../symbol/glyph_source\":381,\"../symbol/sprite_atlas\":386,\"../util/ajax\":407,\"../util/browser\":408,\"../util/dispatcher\":415,\"../util/evented\":416,\"../util/mapbox\":421,\"../util/util\":424,\"./animation_loop\":357,\"./image_sprite\":358,\"./style_function\":362,\"./style_layer\":363,\"./style_spec\":370,\"./validate_style\":372}],361:[function(t,e,r){\"use strict\";function n(t,e){this.value=s.clone(e),this.isFunction=a.isFunctionDefinition(e),this.json=JSON.stringify(this.value);var r=\"color\"===t.type&&this.value?o(this.value):e;if(this.calculate=a[t.function||\"piecewise-constant\"](r),this.isFeatureConstant=this.calculate.isFeatureConstant,this.isZoomConstant=this.calculate.isZoomConstant,\"piecewise-constant\"===t.function&&t.transition&&(this.calculate=i(this.calculate)),!this.isFeatureConstant&&!this.isZoomConstant){this.stopZoomLevels=[];for(var n=[],l=this.value.stops,u=0;u<this.value.stops.length;u++){var c=l[u][0].zoom;this.stopZoomLevels.indexOf(c)<0&&(this.stopZoomLevels.push(c),n.push([c,n.length]))}this.calculateInterpolationT=a.interpolated({stops:n,base:e.base})}}function i(t){return function(e,r){var n,i,a,o=e.zoom,s=e.zoomHistory,l=e.duration,u=o%1,c=Math.min((Date.now()-s.lastIntegerZoomTime)/l,1),h=1;return o>s.lastIntegerZoom?(n=u+(1-u)*c,h*=2,i=t({zoom:o-1},r),a=t({zoom:o},r)):(n=1-(1-c)*u,a=t({zoom:o},r),i=t({zoom:o+1},r),h/=2),void 0===i||void 0===a?void 0:{from:i,fromScale:h,to:a,toScale:1,t:n}}}var a=t(\"./style_function\"),o=t(\"./parse_color\"),s=t(\"../util/util\");e.exports=n},{\"../util/util\":424,\"./parse_color\":359,\"./style_function\":362}],362:[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\":284}],363:[function(t,e,r){\"use strict\";function n(t,e){this.set(t,e)}function i(t){return t.value}var a=t(\"../util/util\"),o=t(\"./style_transition\"),s=t(\"./style_declaration\"),l=t(\"./style_spec\"),u=t(\"./validate_style\"),c=t(\"./parse_color\"),h=t(\"../util/evented\");e.exports=n;n.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)},n.prototype=a.inherit(h,{set:function(t,e){this.id=t.id,this.ref=t.ref,this.metadata=t.metadata,this.type=(e||t).type,this.source=(e||t).source,this.sourceLayer=(e||t)[\"source-layer\"],this.minzoom=(e||t).minzoom,this.maxzoom=(e||t).maxzoom,this.filter=(e||t).filter,this.paint={},this.layout={},this._paintSpecifications=l[\"paint_\"+this.type],this._layoutSpecifications=l[\"layout_\"+this.type],this._paintTransitions={},this._paintTransitionOptions={},this._paintDeclarations={},this._layoutDeclarations={},this._layoutFunctions={};var r,n;for(var i in t){var a=i.match(/^paint(?:\\.(.*))?$/);if(a){var o=a[1]||\"\";for(r in t[i])this.setPaintProperty(r,t[i][r],o)}}if(this.ref)this._layoutDeclarations=e._layoutDeclarations;else for(n in t.layout)this.setLayoutProperty(n,t.layout[n]);for(r in this._paintSpecifications)this.paint[r]=this.getPaintValue(r);for(n in this._layoutSpecifications)this._updateLayoutValue(n)},setLayoutProperty:function(t,e){if(null==e)delete this._layoutDeclarations[t];else{var r=\"layers.\"+this.id+\".layout.\"+t;if(this._handleErrors(u.layoutProperty,r,t,e))return;this._layoutDeclarations[t]=new s(this._layoutSpecifications[t],e)}this._updateLayoutValue(t)},getLayoutProperty:function(t){return this._layoutDeclarations[t]&&this._layoutDeclarations[t].value},getLayoutValue:function(t,e,r){var n=this._layoutSpecifications[t],i=this._layoutDeclarations[t];return i?i.calculate(e,r):n.default},setPaintProperty:function(t,e,r){var n=\"layers.\"+this.id+(r?'[\"paint.'+r+'\"].':\".paint.\")+t;if(a.endsWith(t,\"-transition\"))if(this._paintTransitionOptions[r||\"\"]||(this._paintTransitionOptions[r||\"\"]={}),null===e||void 0===e)delete this._paintTransitionOptions[r||\"\"][t];else{if(this._handleErrors(u.paintProperty,n,t,e))return;this._paintTransitionOptions[r||\"\"][t]=e}else if(this._paintDeclarations[r||\"\"]||(this._paintDeclarations[r||\"\"]={}),null===e||void 0===e)delete this._paintDeclarations[r||\"\"][t];else{if(this._handleErrors(u.paintProperty,n,t,e))return;this._paintDeclarations[r||\"\"][t]=new s(this._paintSpecifications[t],e)}},getPaintProperty:function(t,e){return e=e||\"\",a.endsWith(t,\"-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?c(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,n){for(var i=a.extend({},this._paintDeclarations[\"\"]),o=0;o<t.length;o++)a.extend(i,this._paintDeclarations[t[o]]);var s;for(s in i)this._applyPaintDeclaration(s,i[s],e,r,n);for(s in this._paintTransitions)s in i||this._applyPaintDeclaration(s,null,e,r,n)},updatePaintTransition:function(t,e,r,n,i){for(var a=this._paintDeclarations[\"\"][t],o=0;o<e.length;o++){var s=this._paintDeclarations[e[o]];s&&s[t]&&(a=s[t])}this._applyPaintDeclaration(t,a,r,n,i)},recalculate:function(t,e){for(var r in this._paintTransitions)this.paint[r]=this.getPaintValue(r,{zoom:t,zoomHistory:e});for(var n in this._layoutFunctions)this.layout[n]=this.getLayoutValue(n,{zoom:t,zoomHistory:e})},serialize:function(t){var e={id:this.id,ref:this.ref,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom};for(var r in this._paintDeclarations)e[\"\"===r?\"paint\":\"paint.\"+r]=a.mapObject(this._paintDeclarations[r],i);return(!this.ref||t&&t.includeRefProperties)&&a.extend(e,{type:this.type,source:this.source,\"source-layer\":this.sourceLayer,filter:this.filter,layout:a.mapObject(this._layoutDeclarations,i)}),a.filterObject(e,function(t,e){return void 0!==t&&!(\"layout\"===e&&!Object.keys(t).length)})},_applyPaintDeclaration:function(t,e,r,n,i){var l=r.transition?this._paintTransitions[t]:void 0,u=this._paintSpecifications[t];if(null!==e&&void 0!==e||(e=new s(u,u.default)),!l||l.declaration.json!==e.json){var c=a.extend({duration:300,delay:0},n,this.getPaintProperty(t+\"-transition\")),h=this._paintTransitions[t]=new o(u,e,l,c);h.instant()||(h.loopID=i.set(h.endTime-Date.now())),l&&i.cancel(l.loopID)}},_updateLayoutValue:function(t){var e=this._layoutDeclarations[t];e&&e.isFunction?this._layoutFunctions[t]=!0:(delete this._layoutFunctions[t],this.layout[t]=this.getLayoutValue(t))},_handleErrors:function(t,e,r,n){return u.emitErrors(this,t.call(u,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:l,style:{glyphs:!0,sprite:!0}}))}})},{\"../util/evented\":416,\"../util/util\":424,\"./parse_color\":359,\"./style_declaration\":361,\"./style_layer/background_style_layer\":364,\"./style_layer/circle_style_layer\":365,\"./style_layer/fill_style_layer\":366,\"./style_layer/line_style_layer\":367,\"./style_layer/raster_style_layer\":368,\"./style_layer/symbol_style_layer\":369,\"./style_spec\":370,\"./style_transition\":371,\"./validate_style\":372}],364:[function(t,e,r){\"use strict\";function n(){a.apply(this,arguments)}var i=t(\"../../util/util\"),a=t(\"../style_layer\");e.exports=n,n.prototype=i.inherit(a,{})},{\"../../util/util\":424,\"../style_layer\":363}],365:[function(t,e,r){\"use strict\";function n(){a.apply(this,arguments)}var i=t(\"../../util/util\"),a=t(\"../style_layer\");e.exports=n,n.prototype=i.inherit(a,{})},{\"../../util/util\":424,\"../style_layer\":363}],366:[function(t,e,r){\"use strict\";function n(){a.apply(this,arguments)}var i=t(\"../../util/util\"),a=t(\"../style_layer\");n.prototype=i.inherit(a,{getPaintValue:function(t,e,r){return\"fill-outline-color\"===t&&void 0===this.getPaintProperty(\"fill-outline-color\")?a.prototype.getPaintValue.call(this,\"fill-color\",e,r):a.prototype.getPaintValue.call(this,t,e,r)},getPaintValueStopZoomLevels:function(t){return\"fill-outline-color\"===t&&void 0===this.getPaintProperty(\"fill-outline-color\")?a.prototype.getPaintValueStopZoomLevels.call(this,\"fill-color\"):a.prototype.getPaintValueStopZoomLevels.call(this,arguments)},getPaintInterpolationT:function(t,e){return\"fill-outline-color\"===t&&void 0===this.getPaintProperty(\"fill-outline-color\")?a.prototype.getPaintInterpolationT.call(this,\"fill-color\",e):a.prototype.getPaintInterpolationT.call(this,t,e)},isPaintValueFeatureConstant:function(t){return\"fill-outline-color\"===t&&void 0===this.getPaintProperty(\"fill-outline-color\")?a.prototype.isPaintValueFeatureConstant.call(this,\"fill-color\"):a.prototype.isPaintValueFeatureConstant.call(this,t)},isPaintValueZoomConstant:function(t){return\"fill-outline-color\"===t&&void 0===this.getPaintProperty(\"fill-outline-color\")?a.prototype.isPaintValueZoomConstant.call(this,\"fill-color\"):a.prototype.isPaintValueZoomConstant.call(this,t)}}),e.exports=n},{\"../../util/util\":424,\"../style_layer\":363}],367:[function(t,e,r){\"use strict\";function n(){a.apply(this,arguments)}var i=t(\"../../util/util\"),a=t(\"../style_layer\");e.exports=n,n.prototype=i.inherit(a,{getPaintValue:function(t,e,r){var n=a.prototype.getPaintValue.apply(this,arguments);if(n&&\"line-dasharray\"===t){var i=Math.floor(e.zoom);this._flooredZoom!==i&&(this._flooredZoom=i,this._flooredLineWidth=this.getPaintValue(\"line-width\",e,r)),n.fromScale*=this._flooredLineWidth,n.toScale*=this._flooredLineWidth}return n}})},{\"../../util/util\":424,\"../style_layer\":363}],368:[function(t,e,r){\"use strict\";function n(){a.apply(this,arguments)}var i=t(\"../../util/util\"),a=t(\"../style_layer\");e.exports=n,n.prototype=i.inherit(a,{})},{\"../../util/util\":424,\"../style_layer\":363}],369:[function(t,e,r){\"use strict\";function n(){a.apply(this,arguments)}var i=t(\"../../util/util\"),a=t(\"../style_layer\");e.exports=n,n.prototype=i.inherit(a,{isHidden:function(){if(a.prototype.isHidden.apply(this,arguments))return!0;var t=0===this.paint[\"text-opacity\"]||!this.layout[\"text-field\"],e=0===this.paint[\"icon-opacity\"]||!this.layout[\"icon-image\"];return!(!t||!e)},getLayoutValue:function(t,e,r){return(\"text-rotation-alignment\"!==t||\"line\"!==this.getLayoutValue(\"symbol-placement\",e,r)||this.getLayoutProperty(\"text-rotation-alignment\"))&&(\"icon-rotation-alignment\"!==t||\"line\"!==this.getLayoutValue(\"symbol-placement\",e,r)||this.getLayoutProperty(\"icon-rotation-alignment\"))?\"text-pitch-alignment\"!==t||this.getLayoutProperty(\"text-pitch-alignment\")?a.prototype.getLayoutValue.apply(this,arguments):this.getLayoutValue(\"text-rotation-alignment\"):\"map\"}})},{\"../../util/util\":424,\"../style_layer\":363}],370:[function(t,e,r){\"use strict\";e.exports=t(\"mapbox-gl-style-spec/reference/latest.min\")},{\"mapbox-gl-style-spec/reference/latest.min\":307}],371:[function(t,e,r){\"use strict\";function n(t,e,r,n){this.declaration=e,this.startTime=this.endTime=(new Date).getTime(),\"piecewise-constant\"===t.function&&t.transition?this.interp=i:this.interp=o[t.type],this.oldTransition=r,this.duration=n.duration||0,this.delay=n.delay||0,this.instant()||(this.endTime=this.startTime+this.duration+this.delay,this.ease=a.easeCubicInOut),r&&r.endTime<=this.startTime&&delete r.oldTransition}function i(t,e,r){return void 0===(t&&t.to)||void 0===(e&&e.to)?void 0:{from:t.to,fromScale:t.toScale,to:e.to,toScale:e.toScale,t:r}}var a=t(\"../util/util\"),o=t(\"../util/interpolate\");e.exports=n,n.prototype.instant=function(){return!this.oldTransition||!this.interp||0===this.duration&&0===this.delay},n.prototype.calculate=function(t,e){var r=this.declaration.calculate(a.extend({},t,{duration:this.duration}),e);if(this.instant())return r;var n=t.time||Date.now();if(n<this.endTime){var i=this.oldTransition.calculate(a.extend({},t,{time:this.startTime}),e),o=this.ease((n-this.startTime-this.delay)/this.duration);r=this.interp(i,r,o)}return r}},{\"../util/interpolate\":418,\"../util/util\":424}],372:[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\":306}],373:[function(t,e,r){\"use strict\";function n(t,e,r,n){this.x=t,this.y=e,this.angle=r,void 0!==n&&(this.segment=n)}var i=t(\"point-geometry\");e.exports=n,n.prototype=Object.create(i.prototype),n.prototype.clone=function(){return new n(this.x,this.y,this.angle,this.segment)}},{\"point-geometry\":465}],374:[function(t,e,r){\"use strict\";function n(t,e,r,n,i){if(void 0===e.segment)return!0;for(var a=e,o=e.segment+1,s=0;s>-r/2;){if(--o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],u=0;s<r/2;){var c=t[o-1],h=t[o],f=t[o+1];if(!f)return!1;var d=c.angleTo(h)-h.angleTo(f);for(d=Math.abs((d+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:d}),u+=d;s-l[0].distance>n;)u-=l.shift().angleDelta;if(u>i)return!1;o++,s+=h.dist(f)}return!0}e.exports=n},{}],375:[function(t,e,r){\"use strict\";function n(t,e,r,n,a){for(var o=[],s=0;s<t.length;s++)for(var l,u=t[s],c=0;c<u.length-1;c++){var h=u[c],f=u[c+1];h.x<e&&f.x<e||(h.x<e?h=new i(e,h.y+(f.y-h.y)*((e-h.x)/(f.x-h.x)))._round():f.x<e&&(f=new i(e,h.y+(f.y-h.y)*((e-h.x)/(f.x-h.x)))._round()),h.y<r&&f.y<r||(h.y<r?h=new i(h.x+(f.x-h.x)*((r-h.y)/(f.y-h.y)),r)._round():f.y<r&&(f=new i(h.x+(f.x-h.x)*((r-h.y)/(f.y-h.y)),r)._round()),h.x>=n&&f.x>=n||(h.x>=n?h=new i(n,h.y+(f.y-h.y)*((n-h.x)/(f.x-h.x)))._round():f.x>=n&&(f=new i(n,h.y+(f.y-h.y)*((n-h.x)/(f.x-h.x)))._round()),h.y>=a&&f.y>=a||(h.y>=a?h=new i(h.x+(f.x-h.x)*((a-h.y)/(f.y-h.y)),a)._round():f.y>=a&&(f=new i(h.x+(f.x-h.x)*((a-h.y)/(f.y-h.y)),a)._round()),l&&h.equals(l[l.length-1])||(l=[h],o.push(l)),l.push(f)))))}return o}var i=t(\"point-geometry\");e.exports=n},{\"point-geometry\":465}],376:[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\":422,\"../util/util\":424,\"point-geometry\":465}],377:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o,s,l,u,c){var h=o.top*s-l,f=o.bottom*s+l,d=o.left*s-l,p=o.right*s+l;if(this.boxStartIndex=t.length,u){var m=f-h,g=p-d;if(m>0)if(m=Math.max(10*s,m),c){var v=e[r.segment+1].sub(e[r.segment])._unit()._mult(g),y=[r.sub(v),r.add(v)];this._addLineCollisionBoxes(t,y,r,0,g,m,n,i,a)}else this._addLineCollisionBoxes(t,e,r,r.segment,g,m,n,i,a)}else t.emplaceBack(r.x,r.y,d,h,p,f,1/0,n,i,a,0,0,0,0,0);this.boxEndIndex=t.length}e.exports=n,n.prototype._addLineCollisionBoxes=function(t,e,r,n,i,a,o,s,l){var u=a/2,c=Math.floor(i/u),h=-a/2,f=this.boxes,d=r,p=n+1,m=h;do{if(--p<0)return f;m-=e[p].dist(d),d=e[p]}while(m>-i/2);for(var g=e[p].dist(e[p+1]),v=0;v<c;v++){for(var y=-i/2+v*u;m+g<y;){if(m+=g,++p+1>=e.length)return f;g=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-h)-u/2,0);t.emplaceBack(_.x,_.y,-a/2,-a/2,a/2,a/2,w,o,s,l,0,0,0,0,0)}return f}},{}],378:[function(t,e,r){\"use strict\";function n(t,e,r){if(\"object\"==typeof t){var n=t;r=e,t=n.angle,e=n.pitch,this.grid=new o(n.grid),this.ignoredGrid=new o(n.ignoredGrid)}else this.grid=new o(a,12,6),this.ignoredGrid=new o(a,12,0);this.angle=t,this.pitch=e;var i=Math.sin(t),s=Math.cos(t);if(this.rotationMatrix=[s,-i,i,s],this.reverseRotationMatrix=[s,i,-i,s],this.yStretch=1/Math.cos(e/180*Math.PI),this.yStretch=Math.pow(this.yStretch,1.3),this.collisionBoxArray=r,0===r.length){r.emplaceBack();r.emplaceBack(0,0,0,-32767,0,32767,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(a,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,a,-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)]}var i=t(\"point-geometry\"),a=t(\"../data/bucket\").EXTENT,o=t(\"grid-index\");e.exports=n,n.prototype.serialize=function(){var t={angle:this.angle,pitch:this.pitch,grid:this.grid.toArrayBuffer(),ignoredGrid:this.ignoredGrid.toArrayBuffer()};return{data:t,transferables:[t.grid,t.ignoredGrid]}},n.prototype.minScale=.25,n.prototype.maxScale=2,n.prototype.placeCollisionFeature=function(t,e,r){for(var n=this.collisionBoxArray,a=this.minScale,o=this.rotationMatrix,s=this.yStretch,l=t.boxStartIndex;l<t.boxEndIndex;l++){var u=n.get(l),c=u.anchorPoint._matMult(o),h=c.x,f=c.y,d=h+u.x1,p=f+u.y1*s,m=h+u.x2,g=f+u.y2*s;if(u.bbox0=d,u.bbox1=p,u.bbox2=m,u.bbox3=g,!e)for(var v=this.grid.query(d,p,m,g),y=0;y<v.length;y++){var b=n.get(v[y]),x=b.anchorPoint._matMult(o);if((a=this.getPlacementScale(a,c,u,x,b))>=this.maxScale)return a}if(r){var _;if(this.angle){var w=this.reverseRotationMatrix,M=new i(u.x1,u.y1).matMult(w),k=new i(u.x2,u.y1).matMult(w),A=new i(u.x1,u.y2).matMult(w),T=new i(u.x2,u.y2).matMult(w);(_=this.tempCollisionBox).anchorPointX=u.anchorPoint.x,_.anchorPointY=u.anchorPoint.y,_.x1=Math.min(M.x,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=u.maxScale}else _=u;for(var S=0;S<this.edges.length;S++){var E=this.edges[S];if((a=this.getPlacementScale(a,u.anchorPoint,_,E.anchorPoint,E))>=this.maxScale)return a}}}return a},n.prototype.queryRenderedSymbols=function(t,e,r,n,a){var o={},s=[],l=this.collisionBoxArray,u=this.rotationMatrix,c=new i(t,e)._matMult(u),h=this.tempCollisionBox;h.anchorX=c.x,h.anchorY=c.y,h.x1=0,h.y1=0,h.x2=r-t,h.y2=n-e,h.maxScale=a,a=h.maxScale;for(var f=[c.x+h.x1/a,c.y+h.y1/a*this.yStretch,c.x+h.x2/a,c.y+h.y2/a*this.yStretch],d=this.grid.query(f[0],f[1],f[2],f[3]),p=this.ignoredGrid.query(f[0],f[1],f[2],f[3]),m=0;m<p.length;m++)d.push(p[m]);for(var g=0;g<d.length;g++){var v=l.get(d[g]),y=v.sourceLayerIndex,b=v.featureIndex;if(void 0===o[y]&&(o[y]={}),!o[y][b]){var x=v.anchorPoint.matMult(u);this.getPlacementScale(this.minScale,c,h,x,v)>=a&&(o[y][b]=!0,s.push(d[g]))}}return s},n.prototype.getPlacementScale=function(t,e,r,n,i){var a=e.x-n.x,o=e.y-n.y,s=(i.x1-r.x2)/a,l=(i.x2-r.x1)/a,u=(i.y1-r.y2)*this.yStretch/o,c=(i.y2-r.y1)*this.yStretch/o;(isNaN(s)||isNaN(l))&&(s=l=1),(isNaN(u)||isNaN(c))&&(u=c=1);var h=Math.min(Math.max(s,l),Math.max(u,c)),f=i.maxScale,d=r.maxScale;return h>f&&(h=f),h>d&&(h=d),h>t&&h>=i.placementScale&&(t=h),t},n.prototype.insertCollisionFeature=function(t,e,r){for(var n=r?this.ignoredGrid:this.grid,i=this.collisionBoxArray,a=t.boxStartIndex;a<t.boxEndIndex;a++){var o=i.get(a);o.placementScale=e,e<this.maxScale&&n.insert(a,o.bbox0,o.bbox1,o.bbox2,o.bbox3)}}},{\"../data/bucket\":311,\"grid-index\":271,\"point-geometry\":465}],379:[function(t,e,r){\"use strict\";function n(t,e,r,n,a,o,s,l,u){var c=n?.6*o*s:0,h=Math.max(n?n.right-n.left:0,a?a.right-a.left:0),f=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;e-h*s<e/4&&(e=h*s+e/4);var d=2*o;return i(t,f?e/2*l%e:(h/2+d)*s*l%e,e,c,r,h*s,f,!1,u)}function i(t,e,r,n,l,u,c,h,f){for(var d=u/2,p=0,m=0;m<t.length-1;m++)p+=t[m].dist(t[m+1]);for(var g=0,v=e-r,y=[],b=0;b<t.length-1;b++){for(var x=t[b],_=t[b+1],w=x.dist(_),M=_.angleTo(x);v+r<g+w;){var k=((v+=r)-g)/w,A=a(x.x,_.x,k),T=a(x.y,_.y,k);if(A>=0&&A<f&&T>=0&&T<f&&v-d>=0&&v+d<=p){var S=new o(A,T,M,b)._round();n&&!s(t,S,u,n,l)||y.push(S)}}g+=w}return h||y.length||c||(y=i(t,g/2,r,n,l,u,c,!0,f)),y}var a=t(\"../util/interpolate\"),o=t(\"../symbol/anchor\"),s=t(\"./check_max_angle\");e.exports=n},{\"../symbol/anchor\":373,\"../util/interpolate\":418,\"./check_max_angle\":374}],380:[function(t,e,r){\"use strict\";function n(){this.width=o,this.height=o,this.bin=new i(this.width,this.height),this.index={},this.ids={},this.data=new Uint8Array(this.width*this.height)}var i=t(\"shelf-pack\"),a=t(\"../util/util\"),o=128;e.exports=n,n.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},n.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},n.prototype.addGlyph=function(t,e,r,n){if(!r)return null;var i=e+\"#\"+r.id;if(this.index[i])return this.ids[i].indexOf(t)<0&&this.ids[i].push(t),this.index[i];if(!r.bitmap)return null;var o=r.width+2*n,s=r.height+2*n,l=o+2,u=s+2;l+=4-l%4,u+=4-u%4;var c=this.bin.packOne(l,u);if(c||(this.resize(),c=this.bin.packOne(l,u)),!c)return a.warnOnce(\"glyph bitmap overflow\"),null;this.index[i]=c,this.ids[i]=[t];for(var h=this.data,f=r.bitmap,d=0;d<s;d++)for(var p=this.width*(c.y+d+1)+c.x+1,m=o*d,g=0;g<o;g++)h[p+g]=f[m+g];return this.dirty=!0,c},n.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)}},n.prototype.bind=function(t){this.gl=t,this.texture?t.bindTexture(t.TEXTURE_2D,this.texture):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,this.width,this.height,0,t.ALPHA,t.UNSIGNED_BYTE,null))},n.prototype.updateTexture=function(t){this.bind(t),this.dirty&&(t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.ALPHA,t.UNSIGNED_BYTE,this.data),this.dirty=!1)}},{\"../util/util\":424,\"shelf-pack\":495}],381:[function(t,e,r){\"use strict\";function n(t){this.url=t&&o(t),this.atlases={},this.stacks={},this.loading={}}function i(t,e,r){this.advance=t.advance,this.left=t.left-r-1,this.top=t.top+r+1,this.rect=e}function a(t,e,r,n){return n=n||\"abc\",r.replace(\"{s}\",n[t.length%n.length]).replace(\"{fontstack}\",t).replace(\"{range}\",e)}var o=t(\"../util/mapbox\").normalizeGlyphsURL,s=t(\"../util/ajax\").getArrayBuffer,l=t(\"../util/glyphs\"),u=t(\"../symbol/glyph_atlas\"),c=t(\"pbf\");e.exports=n,n.prototype.getSimpleGlyphs=function(t,e,r,n){void 0===this.stacks[t]&&(this.stacks[t]={}),void 0===this.atlases[t]&&(this.atlases[t]=new u);for(var a,o={},s=this.stacks[t],l=this.atlases[t],c={},h=0,f=0;f<e.length;f++){var d=e[f];if(a=Math.floor(d/256),s[a]){var p=s[a].glyphs[d],m=l.addGlyph(r,t,p,3);p&&(o[d]=new i(p,m,3))}else void 0===c[a]&&(c[a]=[],h++),c[a].push(d)}h||n(void 0,o,t);var g=function(e,a,s){if(!e)for(var u=this.stacks[t][a]=s.stacks[0],f=0;f<c[a].length;f++){var d=c[a][f],p=u.glyphs[d],m=l.addGlyph(r,t,p,3);p&&(o[d]=new i(p,m,3))}--h||n(void 0,o,t)}.bind(this);for(var v in c)this.loadRange(t,v,g)},n.prototype.loadRange=function(t,e,r){if(256*e>65535)return r(\"glyphs > 65535 not supported\");void 0===this.loading[t]&&(this.loading[t]={});var n=this.loading[t];if(n[e])n[e].push(r);else{n[e]=[r];var i=a(t,256*e+\"-\"+(256*e+255),this.url);s(i,function(t,r){for(var i=!t&&new l(new c(new Uint8Array(r))),a=0;a<n[e].length;a++)n[e][a](t,e,i);delete n[e]})}},n.prototype.getGlyphAtlas=function(t){return this.atlases[t]}},{\"../symbol/glyph_atlas\":380,\"../util/ajax\":407,\"../util/glyphs\":417,\"../util/mapbox\":421,pbf:459}],382:[function(t,e,r){\"use strict\";e.exports=function(t,e,r){function n(n){c.push(t[n]),h.push(r[n]),f.push(e[n]),d++}function i(t,e,r){var n=u[t];return delete u[t],u[e]=n,h[n][0].pop(),h[n][0]=h[n][0].concat(r[0]),n}function a(t,e,r){var n=l[e];return delete l[e],l[t]=n,h[n][0].shift(),h[n][0]=r[0].concat(h[n][0]),n}function o(t,e,r){var n=r?e[0][e[0].length-1]:e[0][0];return t+\":\"+n.x+\":\"+n.y}var s,l={},u={},c=[],h=[],f=[],d=0;for(s=0;s<t.length;s++){var p=r[s],m=e[s];if(m){var g=o(m,p),v=o(m,p,!0);if(g in u&&v in l&&u[g]!==l[v]){var y=a(g,v,p),b=i(g,v,h[y]);delete l[g],delete u[v],u[o(m,h[b],!0)]=b,h[y]=null}else g in u?i(g,v,p):v in l?a(g,v,p):(n(s),l[g]=d-1,u[v]=d-1)}else n(s)}return{features:c,textFeatures:f,geometries:h}}},{}],383:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o,s,l,u){this.anchorPoint=t,this.tl=e,this.tr=r,this.bl=n,this.br=i,this.tex=a,this.anchorAngle=o,this.glyphAngle=s,this.minScale=l,this.maxScale=u}function i(t,e,r,i,a,o,u,c,h){var f,d,p,m,g=e.image.rect,v=a.layout,y=e.left-1,b=y+g.w/e.image.pixelRatio,x=e.top-1,_=x+g.h/e.image.pixelRatio;if(\"none\"!==v[\"icon-text-fit\"]&&u){var w=b-y,M=_-x,k=v[\"text-size\"]/24,A=u.left*k,T=u.right*k,S=u.top*k,E=T-A,L=u.bottom*k-S,C=v[\"icon-text-fit-padding\"][0],z=v[\"icon-text-fit-padding\"][1],D=v[\"icon-text-fit-padding\"][2],I=v[\"icon-text-fit-padding\"][3],P=\"width\"===v[\"icon-text-fit\"]?.5*(L-M):0,O=\"height\"===v[\"icon-text-fit\"]?.5*(E-w):0,j=\"width\"===v[\"icon-text-fit\"]||\"both\"===v[\"icon-text-fit\"]?E:w,R=\"height\"===v[\"icon-text-fit\"]||\"both\"===v[\"icon-text-fit\"]?L:M;f=new s(A+O-I,S+P-C),d=new s(A+O+z+j,S+P-C),p=new s(A+O+z+j,S+P+D+R),m=new s(A+O-I,S+P+D+R)}else f=new s(y,x),d=new s(b,x),p=new s(b,_),m=new s(y,_);var F=a.getLayoutValue(\"icon-rotate\",c,h)*Math.PI/180;if(o){var N=i[t.segment];if(t.y===N.y&&t.x===N.x&&t.segment+1<i.length){var B=i[t.segment+1];F+=Math.atan2(t.y-B.y,t.x-B.x)+Math.PI}else F+=Math.atan2(t.y-N.y,t.x-N.x)}if(F){var U=Math.sin(F),V=Math.cos(F),H=[V,-U,U,V];f=f.matMult(H),d=d.matMult(H),m=m.matMult(H),p=p.matMult(H)}return[new n(new s(t.x,t.y),f,d,m,p,e.image.rect,0,0,l,1/0)]}function a(t,e,r,i,a,u){for(var c=a.layout[\"text-rotate\"]*Math.PI/180,h=a.layout[\"text-keep-upright\"],f=e.positionedGlyphs,d=[],p=0;p<f.length;p++){var m=f[p],g=m.glyph,v=g.rect;if(v){var y,b=(m.x+g.advance/2)*r,x=l;u?(x=o(y=[],t,b,i,t.segment,!0),h&&(x=Math.min(x,o(y,t,b,i,t.segment,!1)))):y=[{anchorPoint:new s(t.x,t.y),offset:0,angle:0,maxScale:1/0,minScale:l}];for(var _=m.x+g.left,w=m.y-g.top,M=_+v.w,k=w+v.h,A=new s(_,w),T=new s(M,w),S=new s(_,k),E=new s(M,k),L=0;L<y.length;L++){var C=y[L],z=A,D=T,I=S,P=E;if(c){var O=Math.sin(c),j=Math.cos(c),R=[j,-O,O,j];z=z.matMult(R),D=D.matMult(R),I=I.matMult(R),P=P.matMult(R)}var F=Math.max(C.minScale,x),N=(t.angle+C.offset+2*Math.PI)%(2*Math.PI),B=(C.angle+C.offset+2*Math.PI)%(2*Math.PI);d.push(new n(C.anchorPoint,z,D,I,P,v,N,B,F,C.maxScale))}}}return d}function o(t,e,r,n,i,a){var o=!a;r<0&&(a=!a),a&&i++;var u=new s(e.x,e.y),c=n[i],h=1/0;r=Math.abs(r);for(var f=l;;){var d=u.dist(c),p=r/d,m=Math.atan2(c.y-u.y,c.x-u.x);if(a||(m+=Math.PI),t.push({anchorPoint:u,offset:o?Math.PI:0,minScale:p,maxScale:h,angle:(m+2*Math.PI)%(2*Math.PI)}),p<=f)break;for(u=c;u.equals(c);)if(i+=a?1:-1,!(c=n[i]))return p;var g=c.sub(u)._unit();u=u.sub(g._mult(d)),h=p}return f}var s=t(\"point-geometry\");e.exports={getIconQuads:i,getGlyphQuads:a,SymbolQuad:n};var l=.5},{\"point-geometry\":465}],384:[function(t,e,r){\"use strict\";function n(t,e,r){for(var n=[],a=0,o=t.length;a<o;a++){var s=i(t[a].properties,e[\"text-field\"]);if(s){s=s.toString();var l=e[\"text-transform\"];\"uppercase\"===l?s=s.toLocaleUpperCase():\"lowercase\"===l&&(s=s.toLocaleLowerCase());for(var u=0;u<s.length;u++)r[s.charCodeAt(u)]=!0;n[a]=s}else n[a]=null}return n}var i=t(\"../util/token\");e.exports=n},{\"../util/token\":423}],385:[function(t,e,r){\"use strict\";function n(t,e,r,n){this.codePoint=t,this.x=e,this.y=r,this.glyph=n}function i(t,e,r,n,i,a){this.positionedGlyphs=t,this.text=e,this.top=r,this.bottom=n,this.left=i,this.right=a}function a(t,e,r,a,s,l,u,c,h){for(var f=[],d=new i(f,t,h[1],h[1],h[0],h[0]),p=0,m=0;m<t.length;m++){var g=t.charCodeAt(m),v=e[g];v&&(f.push(new n(g,p,-17,v)),p+=v.advance+c)}return!!f.length&&(o(d,e,a,r,s,l,u,h),d)}function o(t,e,r,n,i,a,o,u){var c=null,d=0,p=0,m=0,g=0,v=t.positionedGlyphs;if(n)for(var y=0;y<v.length;y++){var b=v[y];if(b.x-=d,b.y+=r*m,b.x>n&&null!==c){var x=v[c+1].x;g=Math.max(x,g);for(var _=c+1;_<=y;_++)v[_].y+=r,v[_].x-=x;if(o){var w=c;h[v[c].codePoint]&&w--,s(v,e,p,w,o)}p=c+1,c=null,d+=x,m++}f[b.codePoint]&&(c=y)}var M=v[v.length-1],k=M.x+e[M.codePoint].advance;g=Math.max(g,k);var A=(m+1)*r;s(v,e,p,v.length-1,o),l(v,o,i,a,g,r,m,u),t.top+=-a*A,t.bottom=t.top+A,t.left+=-i*g,t.right=t.left+g}function s(t,e,r,n,i){for(var a=e[t[n].codePoint].advance,o=(t[n].x+a)*i,s=r;s<=n;s++)t[s].x-=o}function l(t,e,r,n,i,a,o,s){for(var l=(e-r)*i+s[0],u=(-n*(o+1)+.5)*a+s[1],c=0;c<t.length;c++)t[c].x+=l,t[c].y+=u}function u(t,e){if(!t||!t.rect)return null;var r=e[\"icon-offset\"][0],n=e[\"icon-offset\"][1],i=r-t.width/2,a=i+t.width,o=n-t.height/2;return new c(t,o,o+t.height,i,a)}function c(t,e,r,n,i){this.image=t,this.top=e,this.bottom=r,this.left=n,this.right=i}e.exports={shapeText:a,shapeIcon:u};var h={32:!0,8203:!0},f={32:!0,38:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0}},{}],386:[function(t,e,r){\"use strict\";function n(t,e){this.width=t,this.height=e,this.bin=new o(t,e),this.images={},this.data=!1,this.texture=0,this.filter=0,this.pixelRatio=1,this.dirty=!0}function i(t,e,r,n,i,a,o,s,l,u,c){var h,f,d=n*e+r,p=s*a+o;if(c)for(p-=a,f=-1;f<=u;f++,d=((f+u)%u+n)*e+r,p+=a)for(h=-1;h<=l;h++)i[p+h]=t[d+(h+l)%l];else for(f=0;f<u;f++,d+=e,p+=a)for(h=0;h<l;h++)i[p+h]=t[d+h]}function a(t,e,r,n,i){this.rect=t,this.width=e,this.height=r,this.sdf=n,this.pixelRatio=i}var o=t(\"shelf-pack\"),s=t(\"../util/browser\"),l=t(\"../util/util\");e.exports=n,n.prototype.allocateImage=function(t,e){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||(l.warnOnce(\"SpriteAtlas out of space.\"),null)},n.prototype.getImage=function(t,e){if(this.images[t])return this.images[t];if(!this.sprite)return null;var r=this.sprite.getSpritePosition(t);if(!r.width||!r.height)return null;var n=this.allocateImage(r.width,r.height);if(!n)return null;var i=new a(n,r.width/r.pixelRatio,r.height/r.pixelRatio,r.sdf,r.pixelRatio/this.pixelRatio);return this.images[t]=i,this.copy(n,r,e),i},n.prototype.getPosition=function(t,e){var r=this.getImage(t,e),n=r&&r.rect;if(!n)return null;var i=r.width*r.pixelRatio,a=r.height*r.pixelRatio;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]}},n.prototype.allocate=function(){if(!this.data){var t=Math.floor(this.width*this.pixelRatio),e=Math.floor(this.height*this.pixelRatio);this.data=new Uint32Array(t*e);for(var r=0;r<this.data.length;r++)this.data[r]=0}},n.prototype.copy=function(t,e,r){if(this.sprite.img.data){var n=new Uint32Array(this.sprite.img.data.buffer);this.allocate();var a=this.data;i(n,this.sprite.img.width,e.x,e.y,a,this.width*this.pixelRatio,(t.x+1)*this.pixelRatio,(t.y+1)*this.pixelRatio,e.width,e.height,r),this.dirty=!0}},n.prototype.setSprite=function(t){t&&(this.pixelRatio=s.devicePixelRatio>1?2:1,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio)),this.sprite=t},n.prototype.addIcons=function(t,e){for(var r=0;r<t.length;r++)this.getImage(t[r]);e(null,this.images)},n.prototype.bind=function(t,e){var r=!1;this.texture?t.bindTexture(t.TEXTURE_2D,this.texture):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),r=!0);var n=e?t.LINEAR:t.NEAREST;n!==this.filter&&(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n),this.filter=n),this.dirty&&(this.allocate(),r?t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width*this.pixelRatio,this.height*this.pixelRatio,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(this.data.buffer)):t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width*this.pixelRatio,this.height*this.pixelRatio,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(this.data.buffer)),this.dirty=!1)}},{\"../util/browser\":408,\"../util/util\":424,\"shelf-pack\":495}],387:[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\":422,\"../util/util\":424,\"point-geometry\":465}],388:[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\":422,\"../util/util\":424,\"./quads\":383,\"point-geometry\":465}],389:[function(t,e,r){\"use strict\";var n=t(\"../util/dom\"),i=t(\"point-geometry\"),a={scrollZoom:t(\"./handler/scroll_zoom\"),boxZoom:t(\"./handler/box_zoom\"),dragRotate:t(\"./handler/drag_rotate\"),dragPan:t(\"./handler/drag_pan\"),keyboard:t(\"./handler/keyboard\"),doubleClickZoom:t(\"./handler/dblclick_zoom\"),touchZoomRotate:t(\"./handler/touch_zoom_rotate\")};e.exports=function(t,e){function r(t){v(\"mouseout\",t)}function o(e){t.stop(),_=n.mousePos(b,e),v(\"mousedown\",e)}function s(e){var r=t.dragRotate&&t.dragRotate.isActive();x&&!r&&v(\"contextmenu\",x),x=null,v(\"mouseup\",e)}function l(e){if(!(t.dragPan&&t.dragPan.isActive()||t.dragRotate&&t.dragRotate.isActive())){for(var r=e.toElement||e.target;r&&r!==b;)r=r.parentNode;r===b&&v(\"mousemove\",e)}}function u(e){t.stop(),y(\"touchstart\",e),!e.touches||e.touches.length>1||(w?(clearTimeout(w),w=null,v(\"dblclick\",e)):w=setTimeout(d,300))}function c(t){y(\"touchmove\",t)}function h(t){y(\"touchend\",t)}function f(t){y(\"touchcancel\",t)}function d(){w=null}function p(t){n.mousePos(b,t).equals(_)&&v(\"click\",t)}function m(t){v(\"dblclick\",t),t.preventDefault()}function g(t){x=t,t.preventDefault()}function v(e,r){var i=n.mousePos(b,r);return t.fire(e,{lngLat:t.unproject(i),point:i,originalEvent:r})}function y(e,r){var a=n.touchPos(b,r),o=a.reduce(function(t,e,r,n){return t.add(e.div(n.length))},new i(0,0));return t.fire(e,{lngLat:t.unproject(o),point:o,lngLats:a.map(function(e){return t.unproject(e)},this),points:a,originalEvent:r})}var b=t.getCanvasContainer(),x=null,_=null,w=null;for(var M in a)t[M]=new a[M](t,e),e.interactive&&e[M]&&t[M].enable();b.addEventListener(\"mouseout\",r,!1),b.addEventListener(\"mousedown\",o,!1),b.addEventListener(\"mouseup\",s,!1),b.addEventListener(\"mousemove\",l,!1),b.addEventListener(\"touchstart\",u,!1),b.addEventListener(\"touchend\",h,!1),b.addEventListener(\"touchmove\",c,!1),b.addEventListener(\"touchcancel\",f,!1),b.addEventListener(\"click\",p,!1),b.addEventListener(\"dblclick\",m,!1),b.addEventListener(\"contextmenu\",g,!1)}},{\"../util/dom\":410,\"./handler/box_zoom\":395,\"./handler/dblclick_zoom\":396,\"./handler/drag_pan\":397,\"./handler/drag_rotate\":398,\"./handler/keyboard\":399,\"./handler/scroll_zoom\":400,\"./handler/touch_zoom_rotate\":401,\"point-geometry\":465}],390:[function(t,e,r){\"use strict\";var n=t(\"../util/util\"),i=t(\"../util/interpolate\"),a=t(\"../util/browser\"),o=t(\"../geo/lng_lat\"),s=t(\"../geo/lng_lat_bounds\"),l=t(\"point-geometry\"),u=e.exports=function(){};n.extend(u.prototype,{getCenter:function(){return this.transform.center},setCenter:function(t,e){return this.jumpTo({center:t},e),this},panBy:function(t,e,r){return this.panTo(this.transform.center,n.extend({offset:l.convert(t).mult(-1)},e),r),this},panTo:function(t,e,r){return this.easeTo(n.extend({center:t},e),r)},getZoom:function(){return this.transform.zoom},setZoom:function(t,e){return this.jumpTo({zoom:t},e),this},zoomTo:function(t,e,r){return this.easeTo(n.extend({zoom:t},e),r)},zoomIn:function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},zoomOut:function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},getBearing:function(){return this.transform.bearing},setBearing:function(t,e){return this.jumpTo({bearing:t},e),this},rotateTo:function(t,e,r){return this.easeTo(n.extend({bearing:t},e),r)},resetNorth:function(t,e){return this.rotateTo(0,n.extend({duration:1e3},t),e),this},snapToNorth:function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},getPitch:function(){return this.transform.pitch},setPitch:function(t,e){return this.jumpTo({pitch:t},e),this},fitBounds:function(t,e,r){e=n.extend({padding:0,offset:[0,0],maxZoom:1/0},e),t=s.convert(t);var i=l.convert(e.offset),a=this.transform,o=a.project(t.getNorthWest()),u=a.project(t.getSouthEast()),c=u.sub(o),h=(a.width-2*e.padding-2*Math.abs(i.x))/c.x,f=(a.height-2*e.padding-2*Math.abs(i.y))/c.y;return e.center=a.unproject(o.add(u).div(2)),e.zoom=Math.min(a.scaleZoom(a.scale*Math.min(h,f)),e.maxZoom),e.bearing=0,e.linear?this.easeTo(e,r):this.flyTo(e,r)},jumpTo:function(t,e){this.stop();var r=this.transform,n=!1,i=!1,a=!1;return\"zoom\"in t&&r.zoom!==+t.zoom&&(n=!0,r.zoom=+t.zoom),\"center\"in t&&(r.center=o.convert(t.center)),\"bearing\"in t&&r.bearing!==+t.bearing&&(i=!0,r.bearing=+t.bearing),\"pitch\"in t&&r.pitch!==+t.pitch&&(a=!0,r.pitch=+t.pitch),this.fire(\"movestart\",e).fire(\"move\",e),n&&this.fire(\"zoomstart\",e).fire(\"zoom\",e).fire(\"zoomend\",e),i&&this.fire(\"rotate\",e),a&&this.fire(\"pitch\",e),this.fire(\"moveend\",e)},easeTo:function(t,e){this.stop(),t=n.extend({offset:[0,0],duration:500,easing:n.ease},t);var r,a,s=this.transform,u=l.convert(t.offset),c=this.getZoom(),h=this.getBearing(),f=this.getPitch(),d=\"zoom\"in t?+t.zoom:c,p=\"bearing\"in t?this._normalizeBearing(t.bearing,h):h,m=\"pitch\"in t?+t.pitch:f;\"center\"in t?(r=o.convert(t.center),a=s.centerPoint.add(u)):\"around\"in t?(r=o.convert(t.around),a=s.locationPoint(r)):(a=s.centerPoint.add(u),r=s.pointLocation(a));var g=s.locationPoint(r);return!1===t.animate&&(t.duration=0),this.zooming=d!==c,this.rotating=h!==p,this.pitching=m!==f,t.noMoveStart||this.fire(\"movestart\",e),this.zooming&&this.fire(\"zoomstart\",e),clearTimeout(this._onEaseEnd),this._ease(function(t){this.zooming&&(s.zoom=i(c,d,t)),this.rotating&&(s.bearing=i(h,p,t)),this.pitching&&(s.pitch=i(f,m,t)),s.setLocationAtPoint(r,g.add(a.sub(g)._mult(t))),this.fire(\"move\",e),this.zooming&&this.fire(\"zoom\",e),this.rotating&&this.fire(\"rotate\",e),this.pitching&&this.fire(\"pitch\",e)},function(){t.delayEndEvents?this._onEaseEnd=setTimeout(this._easeToEnd.bind(this,e),t.delayEndEvents):this._easeToEnd(e)}.bind(this),t),this},_easeToEnd:function(t){var e=this.zooming;this.zooming=!1,this.rotating=!1,this.pitching=!1,e&&this.fire(\"zoomend\",t),this.fire(\"moveend\",t)},flyTo:function(t,e){function r(t){var e=(A*A-k*k+(t?-1:1)*L*L*T*T)/(2*(t?A:k)*L*T);return Math.log(Math.sqrt(e*e+1)-e)}function a(t){return(Math.exp(t)-Math.exp(-t))/2}function s(t){return(Math.exp(t)+Math.exp(-t))/2}function u(t){return a(t)/s(t)}this.stop(),t=n.extend({offset:[0,0],speed:1.2,curve:1.42,easing:n.ease},t);var c=this.transform,h=l.convert(t.offset),f=this.getZoom(),d=this.getBearing(),p=this.getPitch(),m=\"center\"in t?o.convert(t.center):this.getCenter(),g=\"zoom\"in t?+t.zoom:f,v=\"bearing\"in t?this._normalizeBearing(t.bearing,d):d,y=\"pitch\"in t?+t.pitch:p;Math.abs(c.center.lng)+Math.abs(m.lng)>180&&(c.center.lng>0&&m.lng<0?m.lng+=360:c.center.lng<0&&m.lng>0&&(m.lng-=360));var b=c.zoomScale(g-f),x=c.point,_=\"center\"in t?c.project(m).sub(h.div(b)):x,w=c.worldSize,M=t.curve,k=Math.max(c.width,c.height),A=k/b,T=_.sub(x).mag();if(\"minZoom\"in t){var S=n.clamp(Math.min(t.minZoom,f,g),c.minZoom,c.maxZoom),E=k/c.zoomScale(S-f);M=Math.sqrt(E/T*2)}var L=M*M,C=r(0),z=function(t){return s(C)/s(C+M*t)},D=function(t){return k*((s(C)*u(C+M*t)-a(C))/L)/T},I=(r(1)-C)/M;if(Math.abs(T)<1e-6){if(Math.abs(k-A)<1e-6)return this.easeTo(t);var P=A<k?-1:1;I=Math.abs(Math.log(A/k))/M,D=function(){return 0},z=function(t){return Math.exp(P*M*t)}}if(\"duration\"in t)t.duration=+t.duration;else{var O=\"screenSpeed\"in t?+t.screenSpeed/M:+t.speed;t.duration=1e3*I/O}return this.zooming=!0,d!==v&&(this.rotating=!0),p!==y&&(this.pitching=!0),this.fire(\"movestart\",e),this.fire(\"zoomstart\",e),this._ease(function(t){var r=t*I,n=D(r);c.zoom=f+c.scaleZoom(1/z(r)),c.center=c.unproject(x.add(_.sub(x).mult(n)),w),this.rotating&&(c.bearing=i(d,v,t)),this.pitching&&(c.pitch=i(p,y,t)),this.fire(\"move\",e),this.fire(\"zoom\",e),this.rotating&&this.fire(\"rotate\",e),this.pitching&&this.fire(\"pitch\",e)},function(){this.zooming=!1,this.rotating=!1,this.pitching=!1,this.fire(\"zoomend\",e),this.fire(\"moveend\",e)},t),this},isEasing:function(){return!!this._abortFn},stop:function(){return this._abortFn&&(this._abortFn(),this._finishEase()),this},_ease:function(t,e,r){this._finishFn=e,this._abortFn=a.timed(function(e){t.call(this,r.easing(e)),1===e&&this._finishEase()},!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,u=Math.sqrt(.0729-l*l);i=n.bezier(l,u,.25,1)}else i=r?n.bezier.apply(n,r):n.ease;return this.ease={start:(new Date).getTime(),to:Math.pow(2,e),duration:t,easing:i},i}})},{\"../geo/lng_lat\":321,\"../geo/lng_lat_bounds\":322,\"../util/browser\":408,\"../util/interpolate\":418,\"../util/util\":424,\"point-geometry\":465}],391:[function(t,e,r){\"use strict\";function n(t){o.setOptions(this,t)}var i=t(\"./control\"),a=t(\"../../util/dom\"),o=t(\"../../util/util\");e.exports=n,n.createAttributionString=function(t){var e=[];for(var r in t){var n=t[r];n.attribution&&e.indexOf(n.attribution)<0&&e.push(n.attribution)}return e.sort(function(t,e){return t.length-e.length}),(e=e.filter(function(t,r){for(var n=r+1;n<e.length;n++)if(e[n].indexOf(t)>=0)return!1;return!0})).join(\" | \")},n.prototype=o.inherit(i,{options:{position:\"bottom-right\"},onAdd:function(t){var e=this._container=a.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=n.createAttributionString(this._map.style.sources)),this._editLink=this._container.getElementsByClassName(\"mapbox-improve-map\")[0],this._updateEditLink()},_updateEditLink:function(){if(this._editLink){var t=this._map.getCenter();this._editLink.href=\"https://www.mapbox.com/map-feedback/#/\"+t.lng+\"/\"+t.lat+\"/\"+Math.round(this._map.getZoom()+1)}}})},{\"../../util/dom\":410,\"../../util/util\":424,\"./control\":392}],392:[function(t,e,r){\"use strict\";function n(){}var i=t(\"../../util/util\"),a=t(\"../../util/evented\");e.exports=n,n.prototype={addTo:function(t){this._map=t;var e=this._container=this.onAdd(t);if(this.options&&this.options.position){var r=this.options.position,n=t._controlCorners[r];e.className+=\" mapboxgl-ctrl\",-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}},i.extend(n.prototype,a)},{\"../../util/evented\":416,\"../../util/util\":424}],393:[function(t,e,r){\"use strict\";function n(t){s.setOptions(this,t)}var i=t(\"./control\"),a=t(\"../../util/browser\"),o=t(\"../../util/dom\"),s=t(\"../../util/util\");e.exports=n;var l={enableHighAccuracy:!1,timeout:6e3};n.prototype=s.inherit(i,{options:{position:\"top-right\"},onAdd:function(t){var e=this._container=o.create(\"div\",\"mapboxgl-ctrl-group\",t.getContainer());return a.supportsGeolocation?(this._container.addEventListener(\"contextmenu\",this._onContextMenu.bind(this)),this._geolocateButton=o.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),l),this._timeoutId=setTimeout(this._finish.bind(this),1e4)},_success:function(t){this._map.jumpTo({center:[t.coords.longitude,t.coords.latitude],zoom:17,bearing:0,pitch:0}),this.fire(\"geolocate\",t),this._finish()},_error:function(t){this.fire(\"error\",t),this._finish()},_finish:function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}})},{\"../../util/browser\":408,\"../../util/dom\":410,\"../../util/util\":424,\"./control\":392}],394:[function(t,e,r){\"use strict\";function n(t){s.setOptions(this,t)}function i(t){return new MouseEvent(t.type,{button:2,buttons:2,bubbles:!0,cancelable:!0,detail:t.detail,view:t.view,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY,movementX:t.movementX,movementY:t.movementY,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey})}var a=t(\"./control\"),o=t(\"../../util/dom\"),s=t(\"../../util/util\");e.exports=n,n.prototype=s.inherit(a,{options:{position:\"top-right\"},onAdd:function(t){var e=\"mapboxgl-ctrl\",r=this._container=o.create(\"div\",e+\"-group\",t.getContainer());return this._container.addEventListener(\"contextmenu\",this._onContextMenu.bind(this)),this._zoomInButton=this._createButton(e+\"-icon \"+e+\"-zoom-in\",t.zoomIn.bind(t)),this._zoomOutButton=this._createButton(e+\"-icon \"+e+\"-zoom-out\",t.zoomOut.bind(t)),this._compass=this._createButton(e+\"-icon \"+e+\"-compass\",t.resetNorth.bind(t)),this._compassArrow=o.create(\"div\",\"arrow\",this._compass),this._compass.addEventListener(\"mousedown\",this._onCompassDown.bind(this)),this._onCompassMove=this._onCompassMove.bind(this),this._onCompassUp=this._onCompassUp.bind(this),t.on(\"rotate\",this._rotateCompassArrow.bind(this)),this._rotateCompassArrow(),this._el=t.getCanvasContainer(),r},_onContextMenu:function(t){t.preventDefault()},_onCompassDown:function(t){0===t.button&&(o.disableDrag(),document.addEventListener(\"mousemove\",this._onCompassMove),document.addEventListener(\"mouseup\",this._onCompassUp),this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassMove:function(t){0===t.button&&(this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassUp:function(t){0===t.button&&(document.removeEventListener(\"mousemove\",this._onCompassMove),document.removeEventListener(\"mouseup\",this._onCompassUp),o.enableDrag(),this._el.dispatchEvent(i(t)),t.stopPropagation())},_createButton:function(t,e){var r=o.create(\"button\",t,this._container);return r.type=\"button\",r.addEventListener(\"click\",function(){e()}),r},_rotateCompassArrow:function(){var t=\"rotate(\"+this._map.transform.angle*(180/Math.PI)+\"deg)\";this._compassArrow.style.transform=t}})},{\"../../util/dom\":410,\"../../util/util\":424,\"./control\":392}],395:[function(t,e,r){\"use strict\";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),o.bindHandlers(this)}var i=t(\"../../util/dom\"),a=t(\"../../geo/lng_lat_bounds\"),o=t(\"../../util/util\");e.exports=n,n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener(\"mousedown\",this._onMouseDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener(\"mousedown\",this._onMouseDown),this._enabled=!1)},_onMouseDown:function(t){t.shiftKey&&0===t.button&&(document.addEventListener(\"mousemove\",this._onMouseMove,!1),document.addEventListener(\"keydown\",this._onKeyDown,!1),document.addEventListener(\"mouseup\",this._onMouseUp,!1),i.disableDrag(),this._startPos=i.mousePos(this._el,t),this._active=!0)},_onMouseMove:function(t){var e=this._startPos,r=i.mousePos(this._el,t);this._box||(this._box=i.create(\"div\",\"mapboxgl-boxzoom\",this._container),this._container.classList.add(\"mapboxgl-crosshair\"),this._fireEvent(\"boxzoomstart\",t));var n=Math.min(e.x,r.x),a=Math.max(e.x,r.x),o=Math.min(e.y,r.y),s=Math.max(e.y,r.y);i.setTransform(this._box,\"translate(\"+n+\"px,\"+o+\"px)\"),this._box.style.width=a-n+\"px\",this._box.style.height=s-o+\"px\"},_onMouseUp:function(t){if(0===t.button){var e=this._startPos,r=i.mousePos(this._el,t),n=new a(this._map.unproject(e),this._map.unproject(r));this._finish(),e.x===r.x&&e.y===r.y?this._fireEvent(\"boxzoomcancel\",t):this._map.fitBounds(n,{linear:!0}).fire(\"boxzoomend\",{originalEvent:t,boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._fireEvent(\"boxzoomcancel\",t))},_finish:function(){this._active=!1,document.removeEventListener(\"mousemove\",this._onMouseMove,!1),document.removeEventListener(\"keydown\",this._onKeyDown,!1),document.removeEventListener(\"mouseup\",this._onMouseUp,!1),this._container.classList.remove(\"mapboxgl-crosshair\"),this._box&&(this._box.parentNode.removeChild(this._box),this._box=null),i.enableDrag()},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})}}},{\"../../geo/lng_lat_bounds\":322,\"../../util/dom\":410,\"../../util/util\":424}],396:[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)}}},{}],397:[function(t,e,r){\"use strict\";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t(\"../../util/dom\"),a=t(\"../../util/util\");e.exports=n;var o=a.bezier(0,0,.3,1);n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener(\"mousedown\",this._onDown),this._el.addEventListener(\"touchstart\",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener(\"mousedown\",this._onDown),this._el.removeEventListener(\"touchstart\",this._onDown),this._enabled=!1)},_onDown:function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(document.addEventListener(\"touchmove\",this._onMove),document.addEventListener(\"touchend\",this._onTouchEnd)):(document.addEventListener(\"mousemove\",this._onMove),document.addEventListener(\"mouseup\",this._onMouseUp)),this._active=!1,this._startPos=this._pos=i.mousePos(this._el,t),this._inertia=[[Date.now(),this._pos]])},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent(\"dragstart\",t),this._fireEvent(\"movestart\",t));var e=i.mousePos(this._el,t),r=this._map;r.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),r.transform.setLocationAtPoint(r.transform.pointLocation(this._pos),e),this._fireEvent(\"drag\",t),this._fireEvent(\"move\",t),this._pos=e,t.preventDefault()}},_onUp:function(t){if(this.isActive()){this._active=!1,this._fireEvent(\"dragend\",t),this._drainInertiaBuffer();var e=function(){this._fireEvent(\"moveend\",t)}.bind(this),r=this._inertia;if(r.length<2)e();else{var n=r[r.length-1],i=r[0],a=n[1].sub(i[1]),s=(n[0]-i[0])/1e3;if(0===s||n[1].equals(i[1]))e();else{var l=a.mult(.3/s),u=l.mag();u>1400&&(u=1400,l._unit()._mult(u));var c=u/750,h=l.mult(-c/2);this._map.panBy(h,{duration:1e3*c,easing:o,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\":410,\"../../util/util\":424}],398:[function(t,e,r){\"use strict\";function n(t,e){this._map=t,this._el=t.getCanvasContainer(),this._bearingSnap=e.bearingSnap,o.bindHandlers(this)}var i=t(\"../../util/dom\"),a=t(\"point-geometry\"),o=t(\"../../util/util\");e.exports=n;var s=o.bezier(0,0,.25,1);n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener(\"mousedown\",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener(\"mousedown\",this._onDown),this._enabled=!1)},_onDown:function(t){if(!this._ignoreEvent(t)&&!this.isActive()){document.addEventListener(\"mousemove\",this._onMove),document.addEventListener(\"mouseup\",this._onUp),this._active=!1,this._inertia=[[Date.now(),this._map.getBearing()]],this._startPos=this._pos=i.mousePos(this._el,t),this._center=this._map.transform.centerPoint;var e=this._startPos.sub(this._center);e.mag()<200&&(this._center=this._startPos.add(new a(-200,0)._rotate(e.angle()))),t.preventDefault()}},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent(\"rotatestart\",t),this._fireEvent(\"movestart\",t));var e=this._map;e.stop();var r=this._pos,n=i.mousePos(this._el,t),a=this._center,o=r.sub(a).angleWith(n.sub(a))/Math.PI*180,s=e.getBearing()-o,l=this._inertia,u=l[l.length-1];this._drainInertiaBuffer(),l.push([Date.now(),e._normalizeBearing(s,u[1])]),e.transform.bearing=s,this._fireEvent(\"rotate\",t),this._fireEvent(\"move\",t),this._pos=n}},_onUp:function(t){if(!this._ignoreEvent(t)&&(document.removeEventListener(\"mousemove\",this._onMove),document.removeEventListener(\"mouseup\",this._onUp),this.isActive())){this._active=!1,this._fireEvent(\"rotateend\",t),this._drainInertiaBuffer();var e=this._map,r=e.getBearing(),n=this._inertia,i=function(){Math.abs(r)<this._bearingSnap?e.resetNorth({noMoveStart:!0},{originalEvent:t}):this._fireEvent(\"moveend\",t)}.bind(this);if(n.length<2)i();else{var a=n[0],o=n[n.length-1],l=n[n.length-2],u=e._normalizeBearing(r,l[1]),c=o[1]-a[1],h=c<0?-1:1,f=(o[0]-a[0])/1e3;if(0!==c&&0!==f){var d=Math.abs(c*(.25/f));d>180&&(d=180);var p=d/180;u+=h*d*(p/2),Math.abs(e._normalizeBearing(u,0))<this._bearingSnap&&(u=e._normalizeBearing(0,u)),e.rotateTo(u,{duration:1e3*p,easing:s,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\":410,\"../../util/util\":424,\"point-geometry\":465}],399:[function(t,e,r){\"use strict\";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)}e.exports=n;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))}}}}},{}],400:[function(t,e,r){\"use strict\";function n(t){this._map=t,this._el=t.getCanvasContainer(),o.bindHandlers(this)}var i=t(\"../../util/dom\"),a=t(\"../../util/browser\"),o=t(\"../../util/util\");e.exports=n;var s=\"undefined\"!=typeof navigator?navigator.userAgent.toLowerCase():\"\",l=-1!==s.indexOf(\"firefox\"),u=-1!==s.indexOf(\"safari\")&&-1===s.indexOf(\"chrom\");n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener(\"wheel\",this._onWheel,!1),this._el.addEventListener(\"mousewheel\",this._onWheel,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener(\"wheel\",this._onWheel),this._el.removeEventListener(\"mousewheel\",this._onWheel),this._enabled=!1)},_onWheel:function(t){var e;\"wheel\"===t.type?(e=t.deltaY,l&&t.deltaMode===window.WheelEvent.DOM_DELTA_PIXEL&&(e/=a.devicePixelRatio),t.deltaMode===window.WheelEvent.DOM_DELTA_LINE&&(e*=40)):\"mousewheel\"===t.type&&(e=-t.wheelDeltaY,u&&(e/=3));var r=a.now(),n=r-(this._time||0);this._pos=i.mousePos(this._el,t),this._time=r,0!==e&&e%4.000244140625==0?(this._type=\"wheel\",e=Math.floor(e/4)):0!==e&&Math.abs(e)<4?this._type=\"trackpad\":n>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(n*e)<200?\"trackpad\":\"wheel\",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&this._zoom(-e,t),t.preventDefault()},_onTimeout:function(){this._type=\"wheel\",this._zoom(-this._lastValue)},_zoom:function(t,e){if(0!==t){var r=this._map,n=2/(1+Math.exp(-Math.abs(t/100)));t<0&&0!==n&&(n=1/n);var i=r.ease?r.ease.to:r.transform.scale,a=r.transform.scaleZoom(i*n);r.zoomTo(a,{duration:0,around:r.unproject(this._pos),delayEndEvents:200},{originalEvent:e})}}}},{\"../../util/browser\":408,\"../../util/dom\":410,\"../../util/util\":424}],401:[function(t,e,r){\"use strict\";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t(\"../../util/dom\"),a=t(\"../../util/util\");e.exports=n;var o=a.bezier(0,0,.15,1);n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener(\"touchstart\",this._onStart,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener(\"touchstart\",this._onStart),this._enabled=!1)},disableRotation:function(){this._rotationDisabled=!0},enableRotation:function(){this._rotationDisabled=!1},_onStart:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]);this._startVec=e.sub(r),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],document.addEventListener(\"touchmove\",this._onMove,!1),document.addEventListener(\"touchend\",this._onEnd,!1)}},_onMove:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]),n=e.add(r).div(2),a=e.sub(r),o=a.mag()/this._startVec.mag(),s=this._rotationDisabled?0:180*a.angleWith(this._startVec)/Math.PI,l=this._map;if(this._gestureIntent){var u={duration:0,around:l.unproject(n)};\"rotate\"===this._gestureIntent&&(u.bearing=this._startBearing+s),\"zoom\"!==this._gestureIntent&&\"rotate\"!==this._gestureIntent||(u.zoom=l.transform.scaleZoom(this._startScale*o)),l.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),o,n]),l.easeTo(u,{originalEvent:t})}else{var c=Math.abs(1-o)>.15;Math.abs(s)>4?this._gestureIntent=\"rotate\":c&&(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],a=r.transform.scaleZoom(this._startScale*n[1]),s=r.transform.scaleZoom(this._startScale*i[1]),l=a-s,u=(n[0]-i[0])/1e3,c=n[2];if(0!==u&&a!==s){var h=.15*l/u;Math.abs(h)>2.5&&(h=h>0?2.5:-2.5);var f=1e3*Math.abs(h/(12*.15)),d=a+h*f/2e3;d<0&&(d=0),r.easeTo({zoom:d,duration:f,easing:o,around:r.unproject(c)},{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\":410,\"../../util/util\":424}],402:[function(t,e,r){\"use strict\";function n(){i.bindAll([\"_onHashChange\",\"_updateHash\"],this)}e.exports=n;var i=t(\"../util/util\");n.prototype={addTo:function(t){return this._map=t,window.addEventListener(\"hashchange\",this._onHashChange,!1),this._map.on(\"moveend\",this._updateHash),this},remove:function(){return window.removeEventListener(\"hashchange\",this._onHashChange,!1),this._map.off(\"moveend\",this._updateHash),delete this._map,this},_onHashChange:function(){var t=location.hash.replace(\"#\",\"\").split(\"/\");return t.length>=3&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0)}),!0)},_updateHash:function(){var t=this._map.getCenter(),e=this._map.getZoom(),r=this._map.getBearing(),n=Math.max(0,Math.ceil(Math.log(e)/Math.LN2)),i=\"#\"+Math.round(100*e)/100+\"/\"+t.lat.toFixed(n)+\"/\"+t.lng.toFixed(n)+(r?\"/\"+Math.round(10*r)/10:\"\");window.history.replaceState(\"\",\"\",i)}}},{\"../util/util\":424}],403:[function(t,e,r){\"use strict\";function n(t){t.parentNode&&t.parentNode.removeChild(t)}var i=t(\"../util/canvas\"),a=t(\"../util/util\"),o=t(\"../util/browser\"),s=t(\"../util/browser\").window,l=t(\"../util/evented\"),u=t(\"../util/dom\"),c=t(\"../style/style\"),h=t(\"../style/animation_loop\"),f=t(\"../render/painter\"),d=t(\"../geo/transform\"),p=t(\"./hash\"),m=t(\"./bind_handlers\"),g=t(\"./camera\"),v=t(\"../geo/lng_lat\"),y=t(\"../geo/lng_lat_bounds\"),b=t(\"point-geometry\"),x=t(\"./control/attribution\"),_={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(o.hardwareConcurrency-1,1)},w=e.exports=function(t){if((t=a.extend({},_,t)).workerCount<1)throw new Error(\"workerCount must an integer greater than or equal to 1.\");this._interactive=t.interactive,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._trackResize=t.trackResize,this._workerCount=t.workerCount,this._bearingSnap=t.bearingSnap,\"string\"==typeof t.container?this._container=document.getElementById(t.container):this._container=t.container,this.animationLoop=new h,this.transform=new d(t.minZoom,t.maxZoom),t.maxBounds&&this.setMaxBounds(t.maxBounds),a.bindAll([\"_forwardStyleEvent\",\"_forwardSourceEvent\",\"_forwardLayerEvent\",\"_forwardTileEvent\",\"_onStyleLoad\",\"_onStyleChange\",\"_onSourceAdd\",\"_onSourceRemove\",\"_onSourceUpdate\",\"_onWindowOnline\",\"_onWindowResize\",\"_update\",\"_render\"],this),this._setupContainer(),this._setupPainter(),this.on(\"move\",this._update.bind(this,!1)),this.on(\"zoom\",this._update.bind(this,!0)),this.on(\"moveend\",function(){this.animationLoop.set(300),this._rerender()}.bind(this)),void 0!==s&&(s.addEventListener(\"online\",this._onWindowOnline,!1),s.addEventListener(\"resize\",this._onWindowResize,!1)),m(this,t),this._hash=t.hash&&(new p).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),this.stacks={},this._classes=[],this.resize(),t.classes&&this.setClasses(t.classes),t.style&&this.setStyle(t.style),t.attributionControl&&this.addControl(new x(t.attributionControl));var e=this.fire.bind(this,\"error\");this.on(\"style.error\",e),this.on(\"source.error\",e),this.on(\"tile.error\",e),this.on(\"layer.error\",e)};a.extend(w.prototype,l),a.extend(w.prototype,g.prototype),a.extend(w.prototype,{addControl:function(t){return t.addTo(this),this},addClass:function(t,e){return this._classes.indexOf(t)>=0||\"\"===t?this:(this._classes.push(t),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},removeClass:function(t,e){var r=this._classes.indexOf(t);return r<0||\"\"===t?this:(this._classes.splice(r,1),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},setClasses:function(t,e){for(var r={},n=0;n<t.length;n++)\"\"!==t[n]&&(r[t[n]]=!0);return this._classes=Object.keys(r),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0)},hasClass:function(t){return this._classes.indexOf(t)>=0},getClasses:function(){return this._classes},resize:function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),this._canvas.resize(t,e),this.transform.resize(t,e),this.painter.resize(t,e),this.fire(\"movestart\").fire(\"move\").fire(\"resize\").fire(\"moveend\")},getBounds:function(){var t=new y(this.transform.pointLocation(new b(0,0)),this.transform.pointLocation(this.transform.size));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new b(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new b(0,this.transform.size.y)))),t},setMaxBounds:function(t){if(t){var e=y.convert(t);this.transform.lngRange=[e.getWest(),e.getEast()],this.transform.latRange=[e.getSouth(),e.getNorth()],this.transform._constrain(),this._update()}else null!==t&&void 0!==t||(this.transform.lngRange=[],this.transform.latRange=[],this._update());return this},setMinZoom:function(t){if((t=null===t||void 0===t?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(b.convert(t))},queryRenderedFeatures:function(){var t,e={};return 2===arguments.length?(t=arguments[0],e=arguments[1]):1===arguments.length&&function(t){return t instanceof b||Array.isArray(t)}(arguments[0])?t=arguments[0]:1===arguments.length&&(e=arguments[0]),this.style.queryRenderedFeatures(this._makeQueryGeometry(t),e,this.transform.zoom,this.transform.angle)},_makeQueryGeometry:function(t){void 0===t&&(t=[b.convert([0,0]),b.convert([this.transform.width,this.transform.height])]);var e;if(t instanceof b||\"number\"==typeof t[0])e=[b.convert(t)];else{var r=[b.convert(t[0]),b.convert(t[1])];e=[r[0],new b(r[1].x,r[0].y),r[1],new b(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=u.create(\"div\",\"mapboxgl-canvas-container\",t);this._interactive&&e.classList.add(\"mapboxgl-interactive\"),this._canvas=new i(this,e);var r=this._controlContainer=u.create(\"div\",\"mapboxgl-control-container\",t),n=this._controlCorners={};[\"top-left\",\"top-right\",\"bottom-left\",\"bottom-right\"].forEach(function(t){n[t]=u.create(\"div\",\"mapboxgl-ctrl-\"+t,r)})},_setupPainter:function(){var t=this._canvas.getWebGLContext({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer});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&&o.cancelFrame(this._frameId),this.fire(\"webglcontextlost\",{originalEvent:t})},_contextRestored:function(t){this._setupPainter(),this.resize(),this._update(),this.fire(\"webglcontextrestored\",{originalEvent:t})},loaded:function(){return!this._styleDirty&&!this._sourcesDirty&&!(!this.style||!this.style.loaded())},_update:function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender(),this):this},_render:function(){try{this.style&&this._styleDirty&&(this._styleDirty=!1,this.style.update(this._classes,this._classOptions),this._classOptions=null,this.style._recalculate(this.transform.zoom)),this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.painter.render(this.style,{debug:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,vertices:this.vertices,rotating:this.rotating,zooming:this.zooming}),this.fire(\"render\"),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(\"load\")),this._frameId=null,this.animationLoop.stopped()||(this._styleDirty=!0),(this._sourcesDirty||this._repaint||this._styleDirty)&&this._rerender()}catch(t){this.fire(\"error\",{error:t})}return this},remove:function(){this._hash&&this._hash.remove(),o.cancelFrame(this._frameId),this.setStyle(null),void 0!==s&&s.removeEventListener(\"resize\",this._onWindowResize,!1);var t=this.painter.gl.getExtension(\"WEBGL_lose_context\");t&&t.loseContext(),n(this._canvasContainer),n(this._controlContainer),this._container.classList.remove(\"mapboxgl-map\")},_rerender:function(){this.style&&!this._frameId&&(this._frameId=o.frame(this._render))},_forwardStyleEvent:function(t){this.fire(\"style.\"+t.type,a.extend({style:t.target},t))},_forwardSourceEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardLayerEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardTileEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_onStyleLoad:function(t){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style.update(this._classes,{transition:!1}),this._forwardStyleEvent(t)},_onStyleChange:function(t){this._update(!0),this._forwardStyleEvent(t)},_onSourceAdd:function(t){var e=t.source;e.onAdd&&e.onAdd(this),this._forwardSourceEvent(t)},_onSourceRemove:function(t){var e=t.source;e.onRemove&&e.onRemove(this),this._forwardSourceEvent(t)},_onSourceUpdate:function(t){this._update(),this._forwardSourceEvent(t)},_onWindowOnline:function(){this._update()},_onWindowResize:function(){this._trackResize&&this.stop().resize()._update()}}),a.extendAll(w.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\":321,\"../geo/lng_lat_bounds\":322,\"../geo/transform\":323,\"../render/painter\":337,\"../style/animation_loop\":357,\"../style/style\":360,\"../util/browser\":408,\"../util/canvas\":409,\"../util/dom\":410,\"../util/evented\":416,\"../util/util\":424,\"./bind_handlers\":389,\"./camera\":390,\"./control/attribution\":391,\"./hash\":402,\"point-geometry\":465}],404:[function(t,e,r){\"use strict\";function n(t,e){t||(t=i.create(\"div\")),t.classList.add(\"mapboxgl-marker\"),this._el=t,this._offset=o.convert(e&&e.offset||[0,0]),this._update=this._update.bind(this)}e.exports=n;var i=t(\"../util/dom\"),a=t(\"../geo/lng_lat\"),o=t(\"point-geometry\");n.prototype={addTo:function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._el),t.on(\"move\",this._update),this._update(),this},remove:function(){this._map&&(this._map.off(\"move\",this._update),this._map=null);var t=this._el.parentNode;return t&&t.removeChild(this._el),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=a.convert(t),this._update(),this},getElement:function(){return this._el},_update:function(){if(this._map){var t=this._map.project(this._lngLat)._add(this._offset);i.setTransform(this._el,\"translate(\"+t.x+\"px,\"+t.y+\"px)\")}}}},{\"../geo/lng_lat\":321,\"../util/dom\":410,\"point-geometry\":465}],405:[function(t,e,r){\"use strict\";function n(t){i.setOptions(this,t),i.bindAll([\"_update\",\"_onClickClose\"],this)}e.exports=n;var i=t(\"../util/util\"),a=t(\"../util/evented\"),o=t(\"../util/dom\"),s=t(\"../geo/lng_lat\");n.prototype=i.inherit(a,{options:{closeButton:!0,closeOnClick:!0},addTo:function(t){return this._map=t,this._map.on(\"move\",this._update),this.options.closeOnClick&&this._map.on(\"click\",this._onClickClose),this._update(),this},remove:function(){return this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._container&&(this._container.parentNode.removeChild(this._container),delete this._container),this._map&&(this._map.off(\"move\",this._update),this._map.off(\"click\",this._onClickClose),delete this._map),this.fire(\"close\"),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=s.convert(t),this._update(),this},setText:function(t){return this.setDOMContent(document.createTextNode(t))},setHTML:function(t){var e,r=document.createDocumentFragment(),n=document.createElement(\"body\");for(n.innerHTML=t;;){if(!(e=n.firstChild))break;r.appendChild(e)}return this.setDOMContent(r)},setDOMContent:function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},_createContent:function(){this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._content=o.create(\"div\",\"mapboxgl-popup-content\",this._container),this.options.closeButton&&(this._closeButton=o.create(\"button\",\"mapboxgl-popup-close-button\",this._content),this._closeButton.type=\"button\",this._closeButton.innerHTML=\"&#215;\",this._closeButton.addEventListener(\"click\",this._onClickClose))},_update:function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=o.create(\"div\",\"mapboxgl-popup\",this._map.getContainer()),this._tip=o.create(\"div\",\"mapboxgl-popup-tip\",this._container),this._container.appendChild(this._content));var t=this._map.project(this._lngLat).round(),e=this.options.anchor;if(!e){var r=this._container.offsetWidth,n=this._container.offsetHeight;e=t.y<n?[\"top\"]:t.y>this._map.transform.height-n?[\"bottom\"]:[],t.x<r/2?e.push(\"left\"):t.x>this._map.transform.width-r/2&&e.push(\"right\"),e=0===e.length?\"bottom\":e.join(\"-\")}var i={top:\"translate(-50%,0)\",\"top-left\":\"translate(0,0)\",\"top-right\":\"translate(-100%,0)\",bottom:\"translate(-50%,-100%)\",\"bottom-left\":\"translate(0,-100%)\",\"bottom-right\":\"translate(-100%,-100%)\",left:\"translate(0,-50%)\",right:\"translate(-100%,-50%)\"},a=this._container.classList;for(var s in i)a.remove(\"mapboxgl-popup-anchor-\"+s);a.add(\"mapboxgl-popup-anchor-\"+e),o.setTransform(this._container,i[e]+\" translate(\"+t.x+\"px,\"+t.y+\"px)\")}},_onClickClose:function(){this.remove()}})},{\"../geo/lng_lat\":321,\"../util/dom\":410,\"../util/evented\":416,\"../util/util\":424}],406:[function(t,e,r){\"use strict\";function n(t,e){this.target=t,this.parent=e,this.callbacks={},this.callbackID=0,this.receive=this.receive.bind(this),this.target.addEventListener(\"message\",this.receive,!1)}e.exports=n,n.prototype.receive=function(t){function e(t,e,r){this.postMessage({type:\"<response>\",id:String(i),error:t?String(t):null,data:e},r)}var r,n=t.data,i=n.id;if(\"<response>\"===n.type)r=this.callbacks[n.id],delete this.callbacks[n.id],r&&r(n.error||null,n.data);else if(void 0!==n.id&&this.parent[n.type])this.parent[n.type](n.data,e.bind(this));else if(void 0!==n.id&&this.parent.workerSources){var a=n.type.split(\".\");this.parent.workerSources[a[0]][a[1]](n.data,e.bind(this))}else this.parent[n.type](n.data)},n.prototype.send=function(t,e,r,n){var i=null;r&&(this.callbacks[i=this.callbackID++]=r),this.postMessage({type:t,id:String(i),data:e},n)},n.prototype.postMessage=function(t,e){this.target.postMessage(t,e)}},{}],407:[function(t,e,r){\"use strict\";function n(t){var e=document.createElement(\"a\");return e.href=t,e.protocol===document.location.protocol&&e.host===document.location.host}r.getJSON=function(t,e){var r=new XMLHttpRequest;return r.open(\"GET\",t,!0),r.setRequestHeader(\"Accept\",\"application/json\"),r.onerror=function(t){e(t)},r.onload=function(){if(r.status>=200&&r.status<300&&r.response){var t;try{t=JSON.parse(r.response)}catch(t){return e(t)}e(null,t)}else e(new Error(r.statusText))},r.send(),r},r.getArrayBuffer=function(t,e){var r=new XMLHttpRequest;return r.open(\"GET\",t,!0),r.responseType=\"arraybuffer\",r.onerror=function(t){e(t)},r.onload=function(){r.status>=200&&r.status<300&&r.response?e(null,r.response):e(new Error(r.statusText))},r.send(),r},r.getImage=function(t,e){return r.getArrayBuffer(t,function(t,r){if(t)return e(t);var n=new Image;n.onload=function(){e(null,n),(window.URL||window.webkitURL).revokeObjectURL(n.src)};var i=new Blob([new Uint8Array(r)],{type:\"image/png\"});return n.src=(window.URL||window.webkitURL).createObjectURL(i),n.getData=function(){var t=document.createElement(\"canvas\"),e=t.getContext(\"2d\");return t.width=n.width,t.height=n.height,e.drawImage(n,0,0),e.getImageData(0,0,n.width,n.height).data},n})},r.getVideo=function(t,e){var r=document.createElement(\"video\");r.onloadstart=function(){e(null,r)};for(var i=0;i<t.length;i++){var a=document.createElement(\"source\");n(t[i])||(r.crossOrigin=\"Anonymous\"),a.src=t[i],r.appendChild(a)}return r.getData=function(){return r},r}},{}],408:[function(t,e,r){\"use strict\";r.window=window,e.exports.now=function(){return window.performance&&window.performance.now?window.performance.now.bind(window.performance):Date.now.bind(Date)}();var n=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;r.frame=function(t){return n(t)};var i=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame;r.cancelFrame=function(t){i(t)},r.timed=function(t,n,i){function a(l){o||((l=e.exports.now())>=s+n?t.call(i,1):(t.call(i,(l-s)/n),r.frame(a)))}if(!n)return t.call(i,1),null;var o=!1,s=e.exports.now();return r.frame(a),function(){o=!0}},r.supported=t(\"mapbox-gl-supported\"),r.hardwareConcurrency=navigator.hardwareConcurrency||4,Object.defineProperty(r,\"devicePixelRatio\",{get:function(){return window.devicePixelRatio}}),r.supportsWebp=!1;var a=document.createElement(\"img\");a.onload=function(){r.supportsWebp=!0},a.src=\"data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=\",r.supportsGeolocation=!!navigator.geolocation},{\"mapbox-gl-supported\":309}],409:[function(t,e,r){\"use strict\";function n(t,e){this.canvas=document.createElement(\"canvas\"),t&&e&&(this.canvas.style.position=\"absolute\",this.canvas.classList.add(\"mapboxgl-canvas\"),this.canvas.addEventListener(\"webglcontextlost\",t._contextLost.bind(t),!1),this.canvas.addEventListener(\"webglcontextrestored\",t._contextRestored.bind(t),!1),this.canvas.setAttribute(\"tabindex\",0),e.appendChild(this.canvas))}var i=t(\"../util\"),a=t(\"mapbox-gl-supported\");e.exports=n,n.prototype.resize=function(t,e){var r=window.devicePixelRatio||1;this.canvas.width=r*t,this.canvas.height=r*e,this.canvas.style.width=t+\"px\",this.canvas.style.height=e+\"px\"},n.prototype.getWebGLContext=function(t){return t=i.extend({},t,a.webGLContextAttributes),this.canvas.getContext(\"webgl\",t)||this.canvas.getContext(\"experimental-webgl\",t)},n.prototype.getElement=function(){return this.canvas}},{\"../util\":424,\"mapbox-gl-supported\":309}],410:[function(t,e,r){\"use strict\";function n(t){for(var e=0;e<t.length;e++)if(t[e]in s)return t[e]}function i(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener(\"click\",i,!0)}var a=t(\"point-geometry\");r.create=function(t,e,r){var n=document.createElement(t);return e&&(n.className=e),r&&r.appendChild(n),n};var o,s=document.documentElement.style,l=n([\"userSelect\",\"MozUserSelect\",\"WebkitUserSelect\",\"msUserSelect\"]);r.disableDrag=function(){l&&(o=s[l],s[l]=\"none\")},r.enableDrag=function(){l&&(s[l]=o)};var u=n([\"transform\",\"WebkitTransform\"]);r.setTransform=function(t,e){t.style[u]=e},r.suppressClick=function(){window.addEventListener(\"click\",i,!0),window.setTimeout(function(){window.removeEventListener(\"click\",i,!0)},0)},r.mousePos=function(t,e){var r=t.getBoundingClientRect();return e=e.touches?e.touches[0]:e,new a(e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop)},r.touchPos=function(t,e){for(var r=t.getBoundingClientRect(),n=[],i=0;i<e.touches.length;i++)n.push(new a(e.touches[i].clientX-r.left-t.clientLeft,e.touches[i].clientY-r.top-t.clientTop));return n}},{\"point-geometry\":465}],411:[function(t,e,r){\"use strict\";var n=t(\"webworkify\");e.exports=function(){return new n(t(\"../../source/worker\"))}},{\"../../source/worker\":355,webworkify:544}],412:[function(t,e,r){\"use strict\";function n(t,e){return e.area-t.area}function i(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i<a;o=i++)e=t[i],n+=((r=t[o]).x-e.x)*(e.y+r.y);return n}var a=t(\"quickselect\");e.exports=function(t,e){var r=t.length;if(r<=1)return[t];for(var o,s,l=[],u=0;u<r;u++){var c=i(t[u]);0!==c&&(t[u].area=Math.abs(c),void 0===s&&(s=c<0),s===c<0?(o&&l.push(o),o=[t[u]]):o.push(t[u]))}if(o&&l.push(o),e>1)for(var h=0;h<l.length;h++)l[h].length<=e||(a(l[h],e,1,l[h].length-1,n),l[h]=l[h].slice(0,e));return l}},{quickselect:474}],413:[function(t,e,r){\"use strict\";e.exports={API_URL:\"https://api.mapbox.com\",REQUIRE_ACCESS_TOKEN:!0}},{}],414:[function(t,e,r){\"use strict\";function n(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r}}var i=t(\"assert\");e.exports=n,n.prototype.encode=function(t){return i(t in this._stringToNumber),this._stringToNumber[t]},n.prototype.decode=function(t){return i(t<this._numberToString.length),this._numberToString[t]}},{assert:40}],415:[function(t,e,r){\"use strict\";function n(t,e){this.actors=[],this.currentActor=0;for(var r=0;r<t;r++){var n=new o,i=new a(n,e);i.name=\"Worker \"+r,this.actors.push(i)}}var i=t(\"./util\"),a=t(\"./actor\"),o=t(\"./web_worker\");e.exports=n,n.prototype={broadcast:function(t,e,r){r=r||function(){},i.asyncAll(this.actors,function(r,n){r.send(t,e,n)},r)},send:function(t,e,r,n,i){return(\"number\"!=typeof n||isNaN(n))&&(n=this.currentActor=(this.currentActor+1)%this.actors.length),this.actors[n].send(t,e,r,i),n},remove:function(){for(var t=0;t<this.actors.length;t++)this.actors[t].target.terminate();this.actors=[]}}},{\"./actor\":406,\"./util\":424,\"./web_worker\":411}],416:[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\":424}],417:[function(t,e,r){\"use strict\";function n(t,e){this.stacks=t.readFields(i,[],e)}function i(t,e,r){if(1===t){var n=r.readMessage(a,{glyphs:{}});e.push(n)}}function a(t,e,r){if(1===t)e.name=r.readString();else if(2===t)e.range=r.readString();else if(3===t){var n=r.readMessage(o,{});e.glyphs[n.id]=n}}function o(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}e.exports=n},{}],418:[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)})}},{}],419:[function(t,e,r){\"use strict\";function n(t,e,r){for(var n=0;n<t.length;n++)for(var i=t[n],a=0;a<e.length;a++)for(var o=e[a],s=0;s<o.length;s++){var l=o[s];if(d(i,l))return!0;if(c(l,i,r))return!0}return!1}function i(t,e){if(1===t.length&&1===t[0].length)return f(e,t[0][0]);for(var r=0;r<e.length;r++)for(var n=e[r],i=0;i<n.length;i++)if(f(t,n[i]))return!0;for(var a=0;a<t.length;a++){for(var o=t[a],l=0;l<o.length;l++)if(f(e,o[l]))return!0;for(var u=0;u<e.length;u++)if(s(o,e[u]))return!0}return!1}function a(t,e,r){for(var n=0;n<e.length;n++)for(var i=e[n],a=0;a<t.length;a++){var s=t[a];if(s.length>=3)for(var l=0;l<i.length;l++)if(d(s,i[l]))return!0;if(o(s,i,r))return!0}return!1}function o(t,e,r){if(t.length>1){if(s(t,e))return!0;for(var n=0;n<e.length;n++)if(c(e[n],t,r))return!0}for(var i=0;i<t.length;i++)if(c(t[i],e,r))return!0;return!1}function s(t,e){for(var r=0;r<t.length-1;r++)for(var n=t[r],i=t[r+1],a=0;a<e.length-1;a++)if(u(n,i,e[a],e[a+1]))return!0;return!1}function l(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function u(t,e,r,n){return l(t,r,n)!==l(e,r,n)&&l(t,e,r)!==l(t,e,n)}function c(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])<n;for(var i=1;i<e.length;i++)if(h(t,e[i-1],e[i])<n)return!0;return!1}function h(t,e,r){var n=e.distSqr(r);if(0===n)return t.distSqr(e);var i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return i<0?t.distSqr(e):i>1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function f(t,e){for(var r,n,i,a=!1,o=0;o<t.length;o++)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 d(t,e){for(var r=!1,n=0,i=t.length-1;n<t.length;i=n++){var a=t[n],o=t[i];a.y>e.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}e.exports={multiPolygonIntersectsBufferedMultiPoint:n,multiPolygonIntersectsMultiPolygon:i,multiPolygonIntersectsBufferedMultiLine:a}},{}],420:[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}},{}],421:[function(t,e,r){\"use strict\";function n(t,e,r){if(!(r=r||o.ACCESS_TOKEN)&&o.REQUIRE_ACCESS_TOKEN)throw new Error(\"An API access token is required to use Mapbox GL. See https://www.mapbox.com/developers/api/#access-tokens\");if(t=t.replace(/^mapbox:\\/\\//,o.API_URL+e),t+=-1!==t.indexOf(\"?\")?\"&access_token=\":\"?access_token=\",o.REQUIRE_ACCESS_TOKEN){if(\"s\"===r[0])throw new Error(\"Use a public access token (pk.*) with Mapbox GL JS, not a secret access token (sk.*). See https://www.mapbox.com/developers/api/#access-tokens\");t+=r}return t}function i(t){return t?\"?\"+t:\"\"}function a(t){return t.access_token&&\"tk.\"===t.access_token.slice(0,3)?u.extend({},t,{access_token:o.ACCESS_TOKEN}):t}var o=t(\"./config\"),s=t(\"./browser\"),l=t(\"url\"),u=t(\"./util\");e.exports.normalizeStyleURL=function(t,e){var r=l.parse(t);return\"mapbox:\"!==r.protocol?t:n(\"mapbox:/\"+r.pathname+i(r.query),\"/styles/v1/\",e)},e.exports.normalizeSourceURL=function(t,e){return\"mapbox:\"!==l.parse(t).protocol?t:n(t+\".json\",\"/v4/\",e)+\"&secure\"},e.exports.normalizeGlyphsURL=function(t,e){var r=l.parse(t);return\"mapbox:\"!==r.protocol?t:n(\"mapbox://\"+r.pathname.split(\"/\")[1]+\"/{fontstack}/{range}.pbf\"+i(r.query),\"/fonts/v1/\",e)},e.exports.normalizeSpriteURL=function(t,e,r,a){var o=l.parse(t);return\"mapbox:\"!==o.protocol?(o.pathname+=e+r,l.format(o)):n(\"mapbox:/\"+o.pathname+\"/sprite\"+e+r+i(o.query),\"/styles/v1/\",a)},e.exports.normalizeTileURL=function(t,e,r){var n=l.parse(t,!0);if(!e)return t;if(\"mapbox:\"!==l.parse(e).protocol)return t;var i=s.supportsWebp?\".webp\":\"$1\",o=s.devicePixelRatio>=2||512===r?\"@2x\":\"\";return l.format({protocol:n.protocol,hostname:n.hostname,pathname:n.pathname.replace(/(\\.(?:png|jpg)\\d*)/,o+i),query:a(n.query)})}},{\"./browser\":408,\"./config\":413,\"./util\":424,url:525}],422:[function(t,e,r){\"use strict\";function n(t){function e(){f.apply(this,arguments)}function r(){d.apply(this,arguments),this.members=e.prototype.members}var n=JSON.stringify(t);if(g[n])return g[n];void 0===t.alignment&&(t.alignment=1),e.prototype=Object.create(f.prototype);var s=0,u=0,v=[\"Uint8\"];return e.prototype.members=t.members.map(function(r){r={name:r.name,type:r.type,components:r.components||1},p(r.name.length),p(r.type in m),v.indexOf(r.type)<0&&v.push(r.type);var n=o(r.type);u=Math.max(u,n),r.offset=s=a(s,Math.max(t.alignment,n));for(var i=0;i<r.components;i++)Object.defineProperty(e.prototype,r.name+(1===r.components?\"\":i),{get:c(r,i),set:h(r,i)});return s+=n*r.components,r}),e.prototype.alignment=t.alignment,e.prototype.size=a(s,Math.max(u,t.alignment)),r.serialize=i,r.prototype=Object.create(d.prototype),r.prototype.StructType=e,r.prototype.bytesPerElement=e.prototype.size,r.prototype.emplaceBack=l(e.prototype.members,e.prototype.size),r.prototype._usedTypes=v,g[n]=r,r}function i(){return{members:this.prototype.StructType.prototype.members,alignment:this.prototype.StructType.prototype.alignment,bytesPerElement:this.prototype.bytesPerElement}}function a(t,e){return Math.ceil(t/e)*e}function o(t){return m[t].BYTES_PER_ELEMENT}function s(t){return t.toLowerCase()}function l(t,e){for(var r=[],n=[],i=\"var i = this.length;\\nthis.resize(this.length + 1);\\n\",a=0;a<t.length;a++){var l=t[a],u=o(l.type);r.indexOf(u)<0&&(r.push(u),i+=\"var o\"+u.toFixed(0)+\" = i * \"+(e/u).toFixed(0)+\";\\n\");for(var c=0;c<l.components;c++){var h=\"v\"+n.length,f=\"o\"+u.toFixed(0)+\" + \"+(l.offset/u+c).toFixed(0);i+=\"this.\"+s(l.type)+\"[\"+f+\"] = \"+h+\";\\n\",n.push(h)}}return i+=\"return i;\",new Function(n,i)}function u(t,e){var r=\"this._pos\"+o(t.type).toFixed(0)+\" + \"+(t.offset/o(t.type)+e).toFixed(0);return\"this._structArray.\"+s(t.type)+\"[\"+r+\"]\"}function c(t,e){return new Function([],\"return \"+u(t,e)+\";\")}function h(t,e){return new Function([\"x\"],u(t,e)+\" = x;\")}function f(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}function d(t){void 0!==t?(this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.capacity=this.arrayBuffer.byteLength/this.bytesPerElement,this._refreshViews()):(this.capacity=-1,this.resize(0))}var p=t(\"assert\");e.exports=n;var m={Int8:Int8Array,Uint8:Uint8Array,Uint8Clamped:Uint8ClampedArray,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array,Float64:Float64Array},g={};d.prototype.DEFAULT_CAPACITY=128,d.prototype.RESIZE_MULTIPLIER=5,d.prototype.serialize=function(){return this.trim(),{length:this.length,arrayBuffer:this.arrayBuffer}},d.prototype.get=function(t){return new this.StructType(this,t)},d.prototype.trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},d.prototype.resize=function(t){if(this.length=t,t>this.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*this.RESIZE_MULTIPLIER),this.DEFAULT_CAPACITY),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},d.prototype._refreshViews=function(){for(var t=0;t<this._usedTypes.length;t++){var e=this._usedTypes[t];this[s(e)]=new m[e](this.arrayBuffer)}},d.prototype.toArray=function(t,e){for(var r=[],n=t;n<e;n++){var i=this.get(n);r.push(i)}return r}},{assert:40}],423:[function(t,e,r){\"use strict\";function n(t,e){return e.replace(/{([^{}]+)}/g,function(e,r){return r in t?t[r]:\"\"})}e.exports=n},{}],424:[function(t,e,r){\"use strict\";var n=t(\"unitbezier\"),i=t(\"../geo/coordinate\");r.easeCubicInOut=function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},r.bezier=function(t,e,r,i){var a=new n(t,e,r,i);return function(t){return a.solve(t)}},r.ease=r.bezier(.25,.1,.25,1),r.clamp=function(t,e,r){return Math.min(r,Math.max(e,t))},r.wrap=function(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i},r.coalesce=function(){for(var t=0;t<arguments.length;t++){var e=arguments[t];if(null!==e&&void 0!==e)return e}},r.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var n=t.length,i=new Array(t.length),a=null;t.forEach(function(t,o){e(t,function(t,e){t&&(a=t),i[o]=e,0==--n&&r(a,i)})})},r.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},r.extend=function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)t[n]=r[n]}return t},r.extendAll=function(t,e){for(var r in e)Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r));return t},r.inherit=function(t,e){var n=\"function\"==typeof t?t.prototype:t,i=Object.create(n);return r.extendAll(i,e),i},r.pick=function(t,e){for(var r={},n=0;n<e.length;n++){var i=e[n];i in t&&(r[i]=t[i])}return r};var a=1;r.uniqueId=function(){return a++},r.debounce=function(t,e){var r,n;return function(){n=arguments,clearTimeout(r),r=setTimeout(function(){t.apply(null,n)},e)}},r.bindAll=function(t,e){t.forEach(function(t){e[t]&&(e[t]=e[t].bind(e))})},r.bindHandlers=function(t){for(var e in t)\"function\"==typeof t[e]&&0===e.indexOf(\"_on\")&&(t[e]=t[e].bind(t))},r.setOptions=function(t,e){t.hasOwnProperty(\"options\")||(t.options=t.options?Object.create(t.options):{});for(var r in e)t.options[r]=e[r];return t.options},r.getCoordinatesCenter=function(t){for(var e=1/0,r=1/0,n=-1/0,a=-1/0,o=0;o<t.length;o++)e=Math.min(e,t[o].column),r=Math.min(r,t[o].row),n=Math.max(n,t[o].column),a=Math.max(a,t[o].row);var s=n-e,l=a-r,u=Math.max(s,l);return new i((e+n)/2,(r+a)/2,0).zoomTo(Math.floor(-Math.log(u)/Math.LN2))},r.endsWith=function(t,e){return-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\":320,unitbezier:524}],425:[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}}},{}],426:[function(t,e,r){e.exports={_args:[[{raw:\"mapbox-gl@^0.22.0\",scope:null,escapedName:\"mapbox-gl\",name:\"mapbox-gl\",rawSpec:\"^0.22.0\",spec:\">=0.22.0 <0.23.0\",type:\"range\"},\"/home/etienne/Documents/plotly/plotly.js\"]],_from:\"mapbox-gl@>=0.22.0 <0.23.0\",_id:\"mapbox-gl@0.22.1\",_inCache:!0,_location:\"/mapbox-gl\",_nodeVersion:\"4.4.5\",_npmOperationalInternal:{host:\"packages-12-west.internal.npmjs.com\",tmp:\"tmp/mapbox-gl-0.22.1.tgz_1471549891670_0.8762630566488951\"},_npmUser:{name:\"lucaswoj\",email:\"lucas@lucaswoj.com\"},_npmVersion:\"2.15.5\",_phantomChildren:{},_requested:{raw:\"mapbox-gl@^0.22.0\",scope:null,escapedName:\"mapbox-gl\",name:\"mapbox-gl\",rawSpec:\"^0.22.0\",spec:\">=0.22.0 <0.23.0\",type:\"range\"},_requiredBy:[\"#USER\",\"/\"],_resolved:\"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz\",_shasum:\"92a965547d4c2f24c22cbc487eeda48694cb627a\",_shrinkwrap:null,_spec:\"mapbox-gl@^0.22.0\",_where:\"/home/etienne/Documents/plotly/plotly.js\",browser:{\"./js/util/ajax.js\":\"./js/util/browser/ajax.js\",\"./js/util/browser.js\":\"./js/util/browser/browser.js\",\"./js/util/canvas.js\":\"./js/util/browser/canvas.js\",\"./js/util/dom.js\":\"./js/util/browser/dom.js\",\"./js/util/web_worker.js\":\"./js/util/browser/web_worker.js\"},bugs:{url:\"https://github.com/mapbox/mapbox-gl-js/issues\"},dependencies:{csscolorparser:\"^1.0.2\",earcut:\"^2.0.3\",\"feature-filter\":\"^2.2.0\",\"geojson-rewind\":\"^0.1.0\",\"geojson-vt\":\"^2.4.0\",\"gl-matrix\":\"^2.3.1\",\"grid-index\":\"^1.0.0\",\"mapbox-gl-function\":\"^1.2.1\",\"mapbox-gl-shaders\":\"github:mapbox/mapbox-gl-shaders#de2ab007455aa2587c552694c68583f94c9f2747\",\"mapbox-gl-style-spec\":\"github:mapbox/mapbox-gl-style-spec#83b1a3e5837d785af582efd5ed1a212f2df6a4ae\",\"mapbox-gl-supported\":\"^1.2.0\",pbf:\"^1.3.2\",pngjs:\"^2.2.0\",\"point-geometry\":\"^0.0.0\",quickselect:\"^1.0.0\",request:\"^2.39.0\",\"resolve-url\":\"^0.2.1\",\"shelf-pack\":\"^1.0.0\",supercluster:\"^2.0.1\",unassertify:\"^2.0.0\",unitbezier:\"^0.0.0\",\"vector-tile\":\"^1.3.0\",\"vt-pbf\":\"^2.0.2\",webworkify:\"^1.3.0\",\"whoots-js\":\"^2.0.0\"},description:\"A WebGL interactive maps library\",devDependencies:{\"babel-preset-react\":\"^6.11.1\",babelify:\"^7.3.0\",benchmark:\"~2.1.0\",browserify:\"^13.0.0\",clipboard:\"^1.5.12\",\"concat-stream\":\"1.5.1\",coveralls:\"^2.11.8\",doctrine:\"^1.2.1\",documentation:\"https://github.com/documentationjs/documentation/archive/bb41619c734e59ef3fbc3648610032efcfdaaace.tar.gz\",\"documentation-theme-utils\":\"3.0.0\",envify:\"^3.4.0\",eslint:\"^2.5.3\",\"eslint-config-mourner\":\"^2.0.0\",\"eslint-plugin-html\":\"^1.5.1\",gl:\"^4.0.1\",handlebars:\"4.0.5\",\"highlight.js\":\"9.3.0\",istanbul:\"^0.4.2\",\"json-loader\":\"^0.5.4\",lodash:\"^4.13.1\",\"mapbox-gl-test-suite\":\"github:mapbox/mapbox-gl-test-suite#7babab52fb02788ebbc38384139bf350e8e38552\",\"memory-fs\":\"^0.3.0\",minifyify:\"^7.0.1\",\"npm-run-all\":\"^3.0.0\",nyc:\"6.4.0\",proxyquire:\"^1.7.9\",remark:\"4.2.2\",\"remark-html\":\"3.0.0\",sinon:\"^1.15.4\",st:\"^1.2.0\",tap:\"^5.7.0\",\"transform-loader\":\"^0.2.3\",\"unist-util-visit\":\"1.1.0\",vinyl:\"1.1.1\",\"vinyl-fs\":\"2.4.3\",watchify:\"^3.7.0\",webpack:\"^1.13.1\",\"webworkify-webpack\":\"^1.1.3\"},directories:{},dist:{shasum:\"92a965547d4c2f24c22cbc487eeda48694cb627a\",tarball:\"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz\"},engines:{node:\">=4.0.0\"},gitHead:\"13a9015341f0602ccb55c98c53079838ad4b70b5\",homepage:\"https://github.com/mapbox/mapbox-gl-js#readme\",license:\"BSD-3-Clause\",main:\"js/mapbox-gl.js\",maintainers:[{name:\"aaronlidman\",email:\"aaronlidman@gmail.com\"},{name:\"ajashton\",email:\"aj.ashton@gmail.com\"},{name:\"ansis\",email:\"ansis.brammanis@gmail.com\"},{name:\"bergwerkgis\",email:\"wb@bergwerk-gis.at\"},{name:\"bhousel\",email:\"bryan@mapbox.com\"},{name:\"bsudekum\",email:\"bobby@mapbox.com\"},{name:\"camilleanne\",email:\"camille@mapbox.com\"},{name:\"dnomadb\",email:\"damon@mapbox.com\"},{name:\"dthompson\",email:\"dthompson@gmail.com\"},{name:\"emilymcafee\",email:\"emily@mapbox.com\"},{name:\"flippmoke\",email:\"flippmoke@gmail.com\"},{name:\"freenerd\",email:\"spam@freenerd.de\"},{name:\"gretacb\",email:\"carol@mapbox.com\"},{name:\"ian29\",email:\"ian.villeda@gmail.com\"},{name:\"ianshward\",email:\"ian@mapbox.com\"},{name:\"ingalls\",email:\"nicholas.ingalls@gmail.com\"},{name:\"jfirebaugh\",email:\"john.firebaugh@gmail.com\"},{name:\"jrpruit1\",email:\"jake@jakepruitt.com\"},{name:\"karenzshea\",email:\"karen@mapbox.com\"},{name:\"kkaefer\",email:\"kkaefer@gmail.com\"},{name:\"lbud\",email:\"lauren@mapbox.com\"},{name:\"lucaswoj\",email:\"lucas@lucaswoj.com\"},{name:\"lxbarth\",email:\"alex@mapbox.com\"},{name:\"lyzidiamond\",email:\"lyzi@mapbox.com\"},{name:\"mapbox-admin\",email:\"accounts@mapbox.com\"},{name:\"mateov\",email:\"matt@mapbox.com\"},{name:\"mcwhittemore\",email:\"mcwhittemore@gmail.com\"},{name:\"miccolis\",email:\"jeff@miccolis.net\"},{name:\"mikemorris\",email:\"michael.patrick.morris@gmail.com\"},{name:\"morganherlocker\",email:\"morgan.herlocker@gmail.com\"},{name:\"mourner\",email:\"agafonkin@gmail.com\"},{name:\"nickidlugash\",email:\"nicki@mapbox.com\"},{name:\"rclark\",email:\"ryan.clark.j@gmail.com\"},{name:\"samanbb\",email:\"saman@mapbox.com\"},{name:\"sbma44\",email:\"tlee@mapbox.com\"},{name:\"scothis\",email:\"scothis@gmail.com\"},{name:\"sgillies\",email:\"sean@mapbox.com\"},{name:\"springmeyer\",email:\"dane@mapbox.com\"},{name:\"themarex\",email:\"patrick@mapbox.com\"},{name:\"tmcw\",email:\"tom@macwright.org\"},{name:\"tristen\",email:\"tristen.brown@gmail.com\"},{name:\"willwhite\",email:\"will@mapbox.com\"},{name:\"yhahn\",email:\"young@mapbox.com\"}],name:\"mapbox-gl\",optionalDependencies:{},readme:\"ERROR: No README data found!\",repository:{type:\"git\",url:\"git://github.com/mapbox/mapbox-gl-js.git\"},scripts:{build:\"npm run build-docs # invoked by publisher when publishing docs on the mb-pages branch\",\"build-dev\":\"browserify js/mapbox-gl.js --debug --standalone mapboxgl > dist/mapbox-gl-dev.js && tap --no-coverage test/build/dev.test.js\",\"build-docs\":\"documentation build --github --format html -c documentation.yml --theme ./docs/_theme --output docs/api/\",\"build-min\":\"browserify js/mapbox-gl.js --debug -t unassertify --plugin [minifyify --map mapbox-gl.js.map --output dist/mapbox-gl.js.map] --standalone mapboxgl > dist/mapbox-gl.js && tap --no-coverage test/build/min.test.js\",\"build-token\":\"browserify debug/access-token-src.js --debug -t envify > debug/access-token.js\",lint:\"eslint  --ignore-path .gitignore js test bench docs/_posts/examples/*.html\",\"open-changed-examples\":\"git diff --name-only mb-pages HEAD -- docs/_posts/examples/*.html | awk '{print \\\"http://127.0.0.1:4000/mapbox-gl-js/example/\\\" substr($0,33,length($0)-37)}' | xargs open\",start:\"run-p build-token watch-dev watch-bench start-server\",\"start-bench\":\"run-p build-token watch-bench start-server\",\"start-debug\":\"run-p build-token watch-dev start-server\",\"start-docs\":\"npm run build-min && npm run build-docs && jekyll serve -w\",\"start-server\":\"st --no-cache --localhost --port 9966 --index index.html .\",test:\"npm run lint && tap --reporter dot test/js/*/*.js test/build/webpack.test.js\",\"test-suite\":\"node test/render.test.js && node test/query.test.js\",\"watch-bench\":\"node bench/download-data.js && watchify bench/index.js --plugin [minifyify --no-map] -t [babelify --presets react] -t unassertify -t envify -o bench/bench.js -v\",\"watch-dev\":\"watchify js/mapbox-gl.js --debug --standalone mapboxgl -o dist/mapbox-gl-dev.js -v\"},version:\"0.22.1\"}},{}],427:[function(t,e,r){\"use strict\";function n(t,e,r){for(var n=new Array(t),i=0;i<t;++i)n[i]=0,i===e&&(n[i]+=.5),i===r&&(n[i]+=.5);return n}function i(t,e){if(0===e||e===(1<<t+1)-1)return[];for(var r=[],i=[],a=0;a<=t;++a)if(e&1<<a){r.push(n(t,a-1,a-1)),i.push(null);for(h=0;h<=t;++h)~e&1<<h&&(r.push(n(t,a-1,h-1)),i.push([a,h]))}var s=o(r),l=[];t:for(a=0;a<s.length;++a){for(var u=s[a],c=[],h=0;h<u.length;++h){if(!i[u[h]])continue t;c.push(i[u[h]].slice())}l.push(c)}return l}function a(t){for(var e=1<<t+1,r=new Array(e),n=0;n<e;++n)r[n]=i(t,n);return r}e.exports=a;var o=t(\"convex-hull\")},{\"convex-hull\":96}],428:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}function i(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}function a(t,e,r,n,i){t[0]=e[0]*n+r[0]*i,t[1]=e[1]*n+r[1]*i,t[2]=e[2]*n+r[2]*i}var o=t(\"./normalize\"),s=t(\"gl-mat4/create\"),l=t(\"gl-mat4/clone\"),u=t(\"gl-mat4/determinant\"),c=t(\"gl-mat4/invert\"),h=t(\"gl-mat4/transpose\"),f={length:t(\"gl-vec3/length\"),normalize:t(\"gl-vec3/normalize\"),dot:t(\"gl-vec3/dot\"),cross:t(\"gl-vec3/cross\")},d=s(),p=s(),m=[0,0,0,0],g=[[0,0,0],[0,0,0],[0,0,0]],v=[0,0,0];e.exports=function(t,e,r,s,y,b){if(e||(e=[0,0,0]),r||(r=[0,0,0]),s||(s=[0,0,0]),y||(y=[0,0,0,1]),b||(b=[0,0,0,1]),!o(d,t))return!1;if(l(p,d),p[3]=0,p[7]=0,p[11]=0,p[15]=1,Math.abs(u(p)<1e-8))return!1;var x=d[3],_=d[7],w=d[11],M=d[12],k=d[13],A=d[14],T=d[15];if(0!==x||0!==_||0!==w){if(m[0]=x,m[1]=_,m[2]=w,m[3]=T,!c(p,p))return!1;h(p,p),n(y,m,p)}else y[0]=y[1]=y[2]=0,y[3]=1;if(e[0]=M,e[1]=k,e[2]=A,i(g,d),r[0]=f.length(g[0]),f.normalize(g[0],g[0]),s[0]=f.dot(g[0],g[1]),a(g[1],g[1],g[0],1,-s[0]),r[1]=f.length(g[1]),f.normalize(g[1],g[1]),s[0]/=r[1],s[1]=f.dot(g[0],g[2]),a(g[2],g[2],g[0],1,-s[1]),s[2]=f.dot(g[1],g[2]),a(g[2],g[2],g[1],1,-s[2]),r[2]=f.length(g[2]),f.normalize(g[2],g[2]),s[1]/=r[2],s[2]/=r[2],f.cross(v,g[1],g[2]),f.dot(g[0],v)<0)for(var S=0;S<3;S++)r[S]*=-1,g[S][0]*=-1,g[S][1]*=-1,g[S][2]*=-1;return b[0]=.5*Math.sqrt(Math.max(1+g[0][0]-g[1][1]-g[2][2],0)),b[1]=.5*Math.sqrt(Math.max(1-g[0][0]+g[1][1]-g[2][2],0)),b[2]=.5*Math.sqrt(Math.max(1-g[0][0]-g[1][1]+g[2][2],0)),b[3]=.5*Math.sqrt(Math.max(1+g[0][0]+g[1][1]+g[2][2],0)),g[2][1]>g[1][2]&&(b[0]=-b[0]),g[0][2]>g[2][0]&&(b[1]=-b[1]),g[1][0]>g[0][1]&&(b[2]=-b[2]),!0}},{\"./normalize\":429,\"gl-mat4/clone\":159,\"gl-mat4/create\":160,\"gl-mat4/determinant\":161,\"gl-mat4/invert\":165,\"gl-mat4/transpose\":175,\"gl-vec3/cross\":256,\"gl-vec3/dot\":257,\"gl-vec3/length\":258,\"gl-vec3/normalize\":260}],429:[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}},{}],430:[function(t,e,r){function n(t,e,r,n){if(0===u(e)||0===u(r))return!1;var i=l(e,h.translate,h.scale,h.skew,h.perspective,h.quaternion),a=l(r,f.translate,f.scale,f.skew,f.perspective,f.quaternion);return!(!i||!a)&&(o(d.translate,h.translate,f.translate,n),o(d.skew,h.skew,f.skew,n),o(d.scale,h.scale,f.scale,n),o(d.perspective,h.perspective,f.perspective,n),c(d.quaternion,h.quaternion,f.quaternion,n),s(t,d.translate,d.scale,d.skew,d.perspective,d.quaternion),!0)}function i(){return{translate:a(),scale:a(1),skew:a(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function a(t){return[t||0,t||0,t||0]}var o=t(\"gl-vec3/lerp\"),s=t(\"mat4-recompose\"),l=t(\"mat4-decompose\"),u=t(\"gl-mat4/determinant\"),c=t(\"quat-slerp\"),h=i(),f=i(),d=i();e.exports=n},{\"gl-mat4/determinant\":161,\"gl-vec3/lerp\":259,\"mat4-decompose\":428,\"mat4-recompose\":431,\"quat-slerp\":470}],431:[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\":160,\"gl-mat4/fromRotationTranslation\":163,\"gl-mat4/identity\":164,\"gl-mat4/multiply\":167,\"gl-mat4/scale\":173,\"gl-mat4/translate\":174}],432:[function(t,e,r){\"use strict\";function n(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}function i(t){return new n((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}var a=t(\"binary-search-bounds\"),o=t(\"mat4-interpolate\"),s=t(\"gl-mat4/invert\"),l=t(\"gl-mat4/rotateX\"),u=t(\"gl-mat4/rotateY\"),c=t(\"gl-mat4/rotateZ\"),h=t(\"gl-mat4/lookAt\"),f=t(\"gl-mat4/translate\"),d=(t(\"gl-mat4/scale\"),t(\"gl-vec3/normalize\")),p=[0,0,0];e.exports=i;var m=n.prototype;m.recalcMatrix=function(t){var e=this._time,r=a.le(e,t),n=this.computedMatrix;if(!(r<0)){var i=this._components;if(r===e.length-1)for(var l=16*r,u=0;u<16;++u)n[u]=i[l++];else{for(var c=e[r+1]-e[r],l=16*r,h=this.prevMatrix,f=!0,u=0;u<16;++u)h[u]=i[l++];for(var p=this.nextMatrix,u=0;u<16;++u)p[u]=i[l++],f=f&&h[u]===p[u];if(c<1e-6||f)for(u=0;u<16;++u)n[u]=h[u];else o(n,h,p,(t-e[r])/c)}var m=this.computedUp;m[0]=n[1],m[1]=n[5],m[2]=n[9],d(m,m);var g=this.computedInverse;s(g,n);var v=this.computedEye,y=g[15];v[0]=g[12]/y,v[1]=g[13]/y,v[2]=g[14]/y;for(var b=this.computedCenter,x=Math.exp(this.computedRadius[0]),u=0;u<3;++u)b[u]=v[u]-n[2+4*u]*x}},m.idle=function(t){if(!(t<this.lastT())){for(var e=this._components,r=e.length-16,n=0;n<16;++n)e.push(e[r++]);this._time.push(t)}},m.flush=function(t){var e=a.gt(this._time,t)-2;e<0||(this._time.splice(0,e),this._components.splice(0,16*e))},m.lastT=function(){return this._time[this._time.length-1]},m.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||p,n=n||this.computedUp,this.setMatrix(t,h(this.computedMatrix,e,r,n));for(var i=0,a=0;a<3;++a)i+=Math.pow(r[a]-e[a],2);i=Math.log(Math.sqrt(i)),this.computedRadius[0]=i},m.rotate=function(t,e,r,n){this.recalcMatrix(t);var i=this.computedInverse;e&&u(i,i,e),r&&l(i,i,r),n&&c(i,i,n),this.setMatrix(t,s(this.computedMatrix,i))};var g=[0,0,0];m.pan=function(t,e,r,n){g[0]=-(e||0),g[1]=-(r||0),g[2]=-(n||0),this.recalcMatrix(t);var i=this.computedInverse;f(i,i,g),this.setMatrix(t,s(i,i))},m.translate=function(t,e,r,n){g[0]=e||0,g[1]=r||0,g[2]=n||0,this.recalcMatrix(t);var i=this.computedMatrix;f(i,i,g),this.setMatrix(t,i)},m.setMatrix=function(t,e){if(!(t<this.lastT())){this._time.push(t);for(var r=0;r<16;++r)this._components.push(e[r])}},m.setDistance=function(t,e){this.computedRadius[0]=e},m.setDistanceLimits=function(t,e){var r=this._limits;r[0]=t,r[1]=e},m.getDistanceLimits=function(t){var e=this._limits;return t?(t[0]=e[0],t[1]=e[1],t):e}},{\"binary-search-bounds\":59,\"gl-mat4/invert\":165,\"gl-mat4/lookAt\":166,\"gl-mat4/rotateX\":170,\"gl-mat4/rotateY\":171,\"gl-mat4/rotateZ\":172,\"gl-mat4/scale\":173,\"gl-mat4/translate\":174,\"gl-vec3/normalize\":260,\"mat4-interpolate\":430}],433:[function(t,e,r){\"use strict\";function n(t){var e=t.length;if(e<3){for(var r=new Array(e),n=0;n<e;++n)r[n]=n;return 2===e&&t[0][0]===t[1][0]&&t[0][1]===t[1][1]?[0]:r}for(var a=new Array(e),n=0;n<e;++n)a[n]=n;a.sort(function(e,r){var n=t[e][0]-t[r][0];return n||t[e][1]-t[r][1]});for(var o=[a[0],a[1]],s=[a[0],a[1]],n=2;n<e;++n){for(var l=a[n],u=t[l],c=o.length;c>1&&i(t[o[c-2]],t[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(l),c=s.length;c>1&&i(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(l)}for(var r=new Array(s.length+o.length-2),h=0,n=0,f=o.length;n<f;++n)r[h++]=o[n];for(var d=s.length-2;d>0;--d)r[h++]=s[d];return r}e.exports=n;var i=t(\"robust-orientation\")[3]},{\"robust-orientation\":489}],434:[function(t,e,r){\"use strict\";function n(t,e){function r(t){var e=!1;return\"altKey\"in t&&(e=e||t.altKey!==g.alt,g.alt=!!t.altKey),\"shiftKey\"in t&&(e=e||t.shiftKey!==g.shift,g.shift=!!t.shiftKey),\"ctrlKey\"in t&&(e=e||t.ctrlKey!==g.control,g.control=!!t.ctrlKey),\"metaKey\"in t&&(e=e||t.metaKey!==g.meta,g.meta=!!t.metaKey),e}function n(t,n){var a=i.x(n),o=i.y(n);\"buttons\"in n&&(t=0|n.buttons),(t!==d||a!==p||o!==m||r(n))&&(d=0|t,p=a||0,m=o||0,e&&e(d,p,m,g))}function a(t){n(0,t)}function o(){(d||p||m||g.shift||g.alt||g.meta||g.control)&&(p=m=0,d=0,g.shift=g.alt=g.control=g.meta=!1,e&&e(0,0,0,g))}function s(t){r(t)&&e&&e(d,p,m,g)}function l(t){0===i.buttons(t)?n(0,t):n(d,t)}function u(t){n(d|i.buttons(t),t)}function c(t){n(d&~i.buttons(t),t)}function h(){v||(v=!0,t.addEventListener(\"mousemove\",l),t.addEventListener(\"mousedown\",u),t.addEventListener(\"mouseup\",c),t.addEventListener(\"mouseleave\",a),t.addEventListener(\"mouseenter\",a),t.addEventListener(\"mouseout\",a),t.addEventListener(\"mouseover\",a),t.addEventListener(\"blur\",o),t.addEventListener(\"keyup\",s),t.addEventListener(\"keydown\",s),t.addEventListener(\"keypress\",s),t!==window&&(window.addEventListener(\"blur\",o),window.addEventListener(\"keyup\",s),window.addEventListener(\"keydown\",s),window.addEventListener(\"keypress\",s)))}function f(){v&&(v=!1,t.removeEventListener(\"mousemove\",l),t.removeEventListener(\"mousedown\",u),t.removeEventListener(\"mouseup\",c),t.removeEventListener(\"mouseleave\",a),t.removeEventListener(\"mouseenter\",a),t.removeEventListener(\"mouseout\",a),t.removeEventListener(\"mouseover\",a),t.removeEventListener(\"blur\",o),t.removeEventListener(\"keyup\",s),t.removeEventListener(\"keydown\",s),t.removeEventListener(\"keypress\",s),t!==window&&(window.removeEventListener(\"blur\",o),window.removeEventListener(\"keyup\",s),window.removeEventListener(\"keydown\",s),window.removeEventListener(\"keypress\",s)))}e||(e=t,t=window);var d=0,p=0,m=0,g={shift:!1,alt:!1,control:!1,meta:!1},v=!1;h();var y={element:t};return Object.defineProperties(y,{enabled:{get:function(){return v},set:function(t){t?h():f()},enumerable:!0},buttons:{get:function(){return d},enumerable:!0},x:{get:function(){return p},enumerable:!0},y:{get:function(){return m},enumerable:!0},mods:{get:function(){return g},enumerable:!0}}),y}e.exports=n;var i=t(\"mouse-event\")},{\"mouse-event\":436}],435:[function(t,e,r){function n(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var n=t.clientX||0,a=t.clientY||0,o=i(e);return r[0]=n-o.left,r[1]=a-o.top,r}function i(t){return t===window||t===document||t===document.body?a:t.getBoundingClientRect()}var a={left:0,top:0};e.exports=n},{}],436:[function(t,e,r){\"use strict\";function n(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=t.button;if(1===e)return 4;if(2===e)return 2;if(e>=0)return 1<<e}}return 0}function i(t){return t.target||t.srcElement||window}function a(t){if(\"object\"==typeof t){if(\"offsetX\"in t)return t.offsetX;var e=i(t).getBoundingClientRect();return t.clientX-e.left}return 0}function o(t){if(\"object\"==typeof t){if(\"offsetY\"in t)return t.offsetY;var e=i(t).getBoundingClientRect();return t.clientY-e.top}return 0}r.buttons=n,r.element=i,r.x=a,r.y=o},{}],437:[function(t,e,r){\"use strict\";function n(t,e,r){\"function\"==typeof t&&(r=!!e,e=t,t=window);var n=i(\"ex\",t),a=function(t){r&&t.preventDefault();var i=t.deltaX||0,a=t.deltaY||0,o=t.deltaZ||0,s=1;switch(t.deltaMode){case 1:s=n;break;case 2:s=window.innerHeight}if(i*=s,a*=s,o*=s,i||a||o)return e(i,a,o,t)};return t.addEventListener(\"wheel\",a),a}var i=t(\"to-px\");e.exports=n},{\"to-px\":515}],438:[function(t,e,r){\"use strict\";function n(t){return\"a\"+t}function i(t){return\"d\"+t}function a(t,e){return\"c\"+t+\"_\"+e}function o(t){return\"s\"+t}function s(t,e){return\"t\"+t+\"_\"+e}function l(t){return\"o\"+t}function u(t){return\"x\"+t}function c(t){return\"p\"+t}function h(t,e){return\"d\"+t+\"_\"+e}function f(t){return\"i\"+t}function d(t,e){return\"u\"+t+\"_\"+e}function p(t){return\"b\"+t}function m(t){return\"y\"+t}function g(t){return\"e\"+t}function v(t){return\"v\"+t}function y(t,e,r){for(var n=0,i=0;i<t;++i)e&1<<i&&(n|=1<<r[i]);return n}function b(t,e,r,b,x,E){function L(t,e){F.push(\"for(\",f(x[t]),\"=\",e,\";\",f(x[t]),\"<\",o(x[t]),\";\",\"++\",f(x[t]),\"){\")}function C(t){for(var e=0;e<O;++e)F.push(c(e),\"+=\",d(e,x[t]),\";\");F.push(\"}\")}function z(t){for(r=t-1;r>=0;--r)L(r,0);for(var e=[],r=0;r<O;++r)E[r]?e.push(i(r)+\".get(\"+c(r)+\")\"):e.push(i(r)+\"[\"+c(r)+\"]\");for(r=0;r<b;++r)e.push(u(r));F.push(M,\"[\",T,\"++]=phase(\",e.join(),\");\");for(r=0;r<t;++r)C(r);for(var n=0;n<O;++n)F.push(c(n),\"+=\",d(n,x[t]),\";\")}function D(t){for(r=0;r<O;++r)E[r]?F.push(a(r,0),\"=\",i(r),\".get(\",c(r),\");\"):F.push(a(r,0),\"=\",i(r),\"[\",c(r),\"];\");for(var e=[],r=0;r<O;++r)e.push(a(r,0));for(r=0;r<b;++r)e.push(u(r));F.push(p(0),\"=\",M,\"[\",T,\"]=phase(\",e.join(),\");\");for(o=1;o<1<<j;++o)F.push(p(o),\"=\",M,\"[\",T,\"+\",g(o),\"];\");for(var n=[],o=1;o<1<<j;++o)n.push(\"(\"+p(0)+\"!==\"+p(o)+\")\");F.push(\"if(\",n.join(\"||\"),\"){\");for(var s=[],r=0;r<j;++r)s.push(f(r));for(r=0;r<O;++r){s.push(a(r,0));for(o=1;o<1<<j;++o)E[r]?F.push(a(r,o),\"=\",i(r),\".get(\",c(r),\"+\",h(r,o),\");\"):F.push(a(r,o),\"=\",i(r),\"[\",c(r),\"+\",h(r,o),\"];\"),s.push(a(r,o))}for(r=0;r<1<<j;++r)s.push(p(r));for(r=0;r<b;++r)s.push(u(r));F.push(\"vertex(\",s.join(),\");\",v(0),\"=\",w,\"[\",T,\"]=\",k,\"++;\");for(var l=(1<<j)-1,d=p(l),o=0;o<j;++o)if(0==(t&~(1<<o))){for(var m=l^1<<o,y=p(m),x=[],_=m;_>0;_=_-1&m)x.push(w+\"[\"+T+\"+\"+g(_)+\"]\");x.push(v(0));for(_=0;_<O;++_)1&o?x.push(a(_,l),a(_,m)):x.push(a(_,m),a(_,l));1&o?x.push(d,y):x.push(y,d);for(_=0;_<b;++_)x.push(u(_));F.push(\"if(\",d,\"!==\",y,\"){\",\"face(\",x.join(),\")}\")}F.push(\"}\",T,\"+=1;\")}function I(){for(var t=1;t<1<<j;++t)F.push(S,\"=\",g(t),\";\",g(t),\"=\",m(t),\";\",m(t),\"=\",S,\";\")}function P(t,e){if(t<0)D(e);else{z(t),F.push(\"if(\",o(x[t]),\">0){\",f(x[t]),\"=1;\"),P(t-1,e|1<<x[t]);for(var r=0;r<O;++r)F.push(c(r),\"+=\",d(r,x[t]),\";\");t===j-1&&(F.push(T,\"=0;\"),I()),L(t,2),P(t-1,e),t===j-1&&(F.push(\"if(\",f(x[j-1]),\"&1){\",T,\"=0;}\"),I()),C(t),F.push(\"}\")}}var O=E.length,j=x.length;if(j<2)throw new Error(\"ndarray-extract-contour: Dimension must be at least 2\");for(var R=\"extractContour\"+x.join(\"_\"),F=[],N=[],B=[],U=0;U<O;++U)B.push(n(U));for(U=0;U<b;++U)B.push(u(U));for(U=0;U<j;++U)N.push(o(U)+\"=\"+n(0)+\".shape[\"+U+\"]|0\");for(U=0;U<O;++U){N.push(i(U)+\"=\"+n(U)+\".data\",l(U)+\"=\"+n(U)+\".offset|0\");for(Y=0;Y<j;++Y)N.push(s(U,Y)+\"=\"+n(U)+\".stride[\"+Y+\"]|0\")}for(U=0;U<O;++U){N.push(c(U)+\"=\"+l(U)),N.push(a(U,0));for(Y=1;Y<1<<j;++Y){for(var V=[],H=0;H<j;++H)Y&1<<H&&V.push(\"-\"+s(U,H));N.push(h(U,Y)+\"=(\"+V.join(\"\")+\")|0\"),N.push(a(U,Y)+\"=0\")}}for(U=0;U<O;++U)for(Y=0;Y<j;++Y){var q=[s(U,x[Y])];Y>0&&q.push(s(U,x[Y-1])+\"*\"+o(x[Y-1])),N.push(d(U,x[Y])+\"=(\"+q.join(\"-\")+\")|0\")}for(U=0;U<j;++U)N.push(f(U)+\"=0\");N.push(k+\"=0\");for(var G=[\"2\"],U=j-2;U>=0;--U)G.push(o(x[U]));N.push(A+\"=(\"+G.join(\"*\")+\")|0\",M+\"=mallocUint32(\"+A+\")\",w+\"=mallocUint32(\"+A+\")\",T+\"=0\"),N.push(p(0)+\"=0\");for(var Y=1;Y<1<<j;++Y){for(var W=[],X=[],H=0;H<j;++H)Y&1<<H&&(0===X.length?W.push(\"1\"):W.unshift(X.join(\"*\"))),X.push(o(x[H]));var Z=\"\";W[0].indexOf(o(x[j-2]))<0&&(Z=\"-\");var J=y(j,Y,x);N.push(g(J)+\"=(-\"+W.join(\"-\")+\")|0\",m(J)+\"=(\"+Z+W.join(\"-\")+\")|0\",p(J)+\"=0\")}N.push(v(0)+\"=0\",S+\"=0\"),P(j-1,0),F.push(\"freeUint32(\",w,\");freeUint32(\",M,\");\");var Q=[\"'use strict';\",\"function \",R,\"(\",B.join(),\"){\",\"var \",N.join(),\";\",F.join(\"\"),\"}\",\"return \",R].join(\"\");return new Function(\"vertex\",\"face\",\"phase\",\"mallocUint32\",\"freeUint32\",Q)(t,e,r,_.mallocUint32,_.freeUint32)}function x(t){function e(t){throw new Error(\"ndarray-extract-contour: \"+t)}\"object\"!=typeof t&&e(\"Must specify arguments\");var r=t.order;Array.isArray(r)||e(\"Must specify order\");var n=t.arrayArguments||1;n<1&&e(\"Must have at least one array argument\");var i=t.scalarArguments||0;i<0&&e(\"Scalar arg count must be > 0\"),\"function\"!=typeof t.vertex&&e(\"Must specify vertex creation function\"),\"function\"!=typeof t.cell&&e(\"Must specify cell creation function\"),\"function\"!=typeof t.phase&&e(\"Must specify phase function\");for(var a=t.getters||[],o=new Array(n),s=0;s<n;++s)a.indexOf(s)>=0?o[s]=!0:o[s]=!1;return b(t.vertex,t.cell,t.phase,i,r,o)}var _=t(\"typedarray-pool\");e.exports=x;var w=\"V\",M=\"P\",k=\"N\",A=\"Q\",T=\"X\",S=\"T\"},{\"typedarray-pool\":521}],439:[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\":106}],440:[function(t,e,r){\"use strict\";function n(t){if(t in l)return l[t];for(var e=[],r=0;r<t;++r)e.push(\"out\",r,\"s=0.5*(inp\",r,\"l-inp\",r,\"r);\");for(var n=[\"array\"],i=[\"junk\"],r=0;r<t;++r){n.push(\"array\"),i.push(\"out\"+r+\"s\");var a=o(t);a[r]=-1,n.push({array:0,offset:a.slice()}),a[r]=1,n.push({array:0,offset:a.slice()}),i.push(\"inp\"+r+\"l\",\"inp\"+r+\"r\")}return l[t]=s({args:n,pre:c,post:c,body:{body:e.join(\"\"),args:i.map(function(t){return{name:t,lvalue:0===t.indexOf(\"out\"),rvalue:0===t.indexOf(\"inp\"),count:\"junk\"!==t|0}}),thisVars:[],localVars:[]},funcName:\"fdTemplate\"+t})}function i(t){var e=t.join();if(g=u[e])return g;for(var r=t.length,i=[\"function gradient(dst,src){var s=src.shape.slice();\"],a=0;a<1<<r;++a){for(var o=[],s=0;s<r;++s)a&1<<s&&o.push(s+1);for(var c=0;c<1<<o.length;++c){for(var d=o.slice(),s=0;s<o.length;++s)c&1<<s&&(d[s]=-d[s]);!function(e){for(var n=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 u=\".lo(\"+a.join()+\").hi(\"+o.join()+\")\";if(0===a.length&&(u=\"\"),n>0){for(i.push(\"if(1\"),l=0;l<r;++l)e.indexOf(l+1)>=0||e.indexOf(-(l+1))>=0||i.push(\"&&s[\",l,\"]>2\");for(i.push(\"){grad\",n,\"(src.pick(\",s.join(),\")\",u),l=0;l<r;++l)e.indexOf(l+1)>=0||e.indexOf(-(l+1))>=0||i.push(\",dst.pick(\",s.join(),\",\",l,\")\",u);i.push(\");\")}for(l=0;l<e.length;++l){var c=Math.abs(e[l])-1,h=\"dst.pick(\"+s.join()+\",\"+c+\")\"+u;switch(t[c]){case\"clamp\":var f=s.slice(),d=s.slice();e[l]<0?f[c]=\"s[\"+c+\"]-2\":d[c]=\"1\",0===n?i.push(\"if(s[\",c,\"]>1){dst.set(\",s.join(),\",\",c,\",0.5*(src.get(\",f.join(),\")-src.get(\",d.join(),\")))}else{dst.set(\",s.join(),\",\",c,\",0)};\"):i.push(\"if(s[\",c,\"]>1){diff(\",h,\",src.pick(\",f.join(),\")\",u,\",src.pick(\",d.join(),\")\",u,\");}else{zero(\",h,\");};\");break;case\"mirror\":0===n?i.push(\"dst.set(\",s.join(),\",\",c,\",0);\"):i.push(\"zero(\",h,\");\");break;case\"wrap\":var p=s.slice(),m=s.slice();e[l]<0?(p[c]=\"s[\"+c+\"]-2\",m[c]=\"0\"):(p[c]=\"s[\"+c+\"]-1\",m[c]=\"1\"),0===n?i.push(\"if(s[\",c,\"]>2){dst.set(\",s.join(),\",\",c,\",0.5*(src.get(\",p.join(),\")-src.get(\",m.join(),\")))}else{dst.set(\",s.join(),\",\",c,\",0)};\"):i.push(\"if(s[\",c,\"]>2){diff(\",h,\",src.pick(\",p.join(),\")\",u,\",src.pick(\",m.join(),\")\",u,\");}else{zero(\",h,\");};\");break;default:throw new Error(\"ndarray-gradient: Invalid boundary condition\")}}n>0&&i.push(\"};\")}(d)}}i.push(\"return dst;};return gradient\");for(var p=[\"diff\",\"zero\"],m=[h,f],a=1;a<=r;++a)p.push(\"grad\"+a),m.push(n(a));p.push(i.join(\"\"));var g=Function.apply(void 0,p).apply(void 0,m);return l[e]=g,g}function a(t,e,r){if(Array.isArray(r)){if(r.length!==e.dimension)throw new Error(\"ndarray-gradient: invalid boundary conditions\")}else r=\"string\"==typeof r?o(e.dimension,r):o(e.dimension,\"clamp\");if(t.dimension!==e.dimension+1)throw new Error(\"ndarray-gradient: output dimension must be +1 input dimension\");if(t.shape[e.dimension]!==e.dimension)throw new Error(\"ndarray-gradient: output shape must match input shape\");for(var n=0;n<e.dimension;++n)if(t.shape[n]!==e.shape[n])throw new Error(\"ndarray-gradient: shape mismatch\");return 0===e.size?t:e.dimension<=0?(t.set(0),t):i(r)(t,e)}e.exports=a;var o=t(\"dup\"),s=t(\"cwise-compiler\"),l={},u={},c={body:\"\",args:[],thisVars:[],localVars:[]},h=s({args:[\"array\",\"array\",\"array\"],pre:c,post:c,body:{args:[{name:\"out\",lvalue:!0,rvalue:!1,count:1},{name:\"left\",lvalue:!1,rvalue:!0,count:1},{name:\"right\",lvalue:!1,rvalue:!0,count:1}],body:\"out=0.5*(left-right)\",thisVars:[],localVars:[]},funcName:\"cdiff\"}),f=s({args:[\"array\"],pre:c,post:c,body:{args:[{name:\"out\",lvalue:!0,rvalue:!1,count:1}],body:\"out=0\",thisVars:[],localVars:[]},funcName:\"zero\"})},{\"cwise-compiler\":103,dup:110}],441:[function(t,e,r){\"use strict\";function n(t,e,r){var n=e.dimension,o=a([],r);return i(t,e,function(t,e){for(s=0;s<n;++s){t[s]=o[(n+1)*n+s];for(i=0;i<n;++i)t[s]+=o[(n+1)*i+s]*e[i]}for(var r=o[(n+1)*(n+1)-1],i=0;i<n;++i)r+=o[(n+1)*i+n]*e[i];for(var a=1/r,s=0;s<n;++s)t[s]*=a;return t}),t}var i=t(\"ndarray-warp\"),a=t(\"gl-matrix-invert\");e.exports=n},{\"gl-matrix-invert\":176,\"ndarray-warp\":448}],442:[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,u=0<=s&&s<t.shape[1],c=0<=s+1&&s+1<t.shape[1],h=a&&u?t.get(n,s):0,f=a&&c?t.get(n,s+1):0;return(1-l)*((1-i)*h+i*(o&&u?t.get(n+1,s):0))+l*((1-i)*f+i*(o&&c?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),u=r-l,c=0<=l&&l<t.shape[1],h=0<=l+1&&l+1<t.shape[1],f=Math.floor(n),d=n-f,p=0<=f&&f<t.shape[2],m=0<=f+1&&f+1<t.shape[2],g=o&&c&&p?t.get(i,l,f):0,v=o&&h&&p?t.get(i,l+1,f):0,y=s&&c&&p?t.get(i+1,l,f):0,b=s&&h&&p?t.get(i+1,l+1,f):0,x=o&&c&&m?t.get(i,l,f+1):0,_=o&&h&&m?t.get(i,l+1,f+1):0;return(1-d)*((1-u)*((1-a)*g+a*y)+u*((1-a)*v+a*b))+d*((1-u)*((1-a)*x+a*(s&&c&&m?t.get(i+1,l,f+1):0))+u*((1-a)*_+a*(s&&h&&m?t.get(i+1,l+1,f+1):0)))}function o(t){var e,r,n=0|t.shape.length,i=new Array(n),a=new Array(n),o=new Array(n),s=new Array(n);for(e=0;e<n;++e)r=+arguments[e+1],i[e]=Math.floor(r),a[e]=r-i[e],o[e]=0<=i[e]&&i[e]<t.shape[e],s[e]=0<=i[e]+1&&i[e]+1<t.shape[e];var l,u,c,h=0;t:for(e=0;e<1<<n;++e){for(u=1,c=t.offset,l=0;l<n;++l)if(e&1<<l){if(!s[l])continue t;u*=a[l],c+=t.stride[l]*(i[l]+1)}else{if(!o[l])continue t;u*=1-a[l],c+=t.stride[l]*i[l]}h+=u*t.data[c]}return h}function s(t,e,r,s){switch(t.shape.length){case 0:return 0;case 1:return n(t,e);case 2:return i(t,e,r);case 3:return a(t,e,r,s);default:return o.apply(void 0,arguments)}}e.exports=s,e.exports.d1=n,e.exports.d2=i,e.exports.d3=a},{}],443:[function(t,e,r){\"use strict\";function n(t){if(!t)return s;for(var e=0;e<t.args.length;++e){var r=t.args[e];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 i(t){return o({args:t.args,pre:n(t.pre),body:n(t.body),post:n(t.proc),funcName:t.funcName})}function a(t){for(var e=[],r=0;r<t.args.length;++r)e.push(\"a\"+r);return new Function(\"P\",[\"return function \",t.funcName,\"_ndarrayops(\",e.join(\",\"),\") {P(\",e.join(\",\"),\");return a0}\"].join(\"\"))(i(t))}var o=t(\"cwise-compiler\"),s={body:\"\",args:[],thisVars:[],localVars:[]},l={add:\"+\",sub:\"-\",mul:\"*\",div:\"/\",mod:\"%\",band:\"&\",bor:\"|\",bxor:\"^\",lshift:\"<<\",rshift:\">>\",rrshift:\">>>\"};!function(){for(var t in l){var e=l[t];r[t]=a({args:[\"array\",\"array\",\"array\"],body:{args:[\"a\",\"b\",\"c\"],body:\"a=b\"+e+\"c\"},funcName:t}),r[t+\"eq\"]=a({args:[\"array\",\"array\"],body:{args:[\"a\",\"b\"],body:\"a\"+e+\"=b\"},rvalue:!0,funcName:t+\"eq\"}),r[t+\"s\"]=a({args:[\"array\",\"array\",\"scalar\"],body:{args:[\"a\",\"b\",\"s\"],body:\"a=b\"+e+\"s\"},funcName:t+\"s\"}),r[t+\"seq\"]=a({args:[\"array\",\"scalar\"],body:{args:[\"a\",\"s\"],body:\"a\"+e+\"=s\"},rvalue:!0,funcName:t+\"seq\"})}}();var u={not:\"!\",bnot:\"~\",neg:\"-\",recip:\"1.0/\"};!function(){for(var t in u){var e=u[t];r[t]=a({args:[\"array\",\"array\"],body:{args:[\"a\",\"b\"],body:\"a=\"+e+\"b\"},funcName:t}),r[t+\"eq\"]=a({args:[\"array\"],body:{args:[\"a\"],body:\"a=\"+e+\"a\"},rvalue:!0,count:2,funcName:t+\"eq\"})}}();var c={and:\"&&\",or:\"||\",eq:\"===\",neq:\"!==\",lt:\"<\",gt:\">\",leq:\"<=\",geq:\">=\"};!function(){for(var t in c){var e=c[t];r[t]=a({args:[\"array\",\"array\",\"array\"],body:{args:[\"a\",\"b\",\"c\"],body:\"a=b\"+e+\"c\"},funcName:t}),r[t+\"s\"]=a({args:[\"array\",\"array\",\"scalar\"],body:{args:[\"a\",\"b\",\"s\"],body:\"a=b\"+e+\"s\"},funcName:t+\"s\"}),r[t+\"eq\"]=a({args:[\"array\",\"array\"],body:{args:[\"a\",\"b\"],body:\"a=a\"+e+\"b\"},rvalue:!0,count:2,funcName:t+\"eq\"}),r[t+\"seq\"]=a({args:[\"array\",\"scalar\"],body:{args:[\"a\",\"s\"],body:\"a=a\"+e+\"s\"},rvalue:!0,count:2,funcName:t+\"seq\"})}}();var h=[\"abs\",\"acos\",\"asin\",\"atan\",\"ceil\",\"cos\",\"exp\",\"floor\",\"log\",\"round\",\"sin\",\"sqrt\",\"tan\"];!function(){for(var t=0;t<h.length;++t){var e=h[t];r[e]=a({args:[\"array\",\"array\"],pre:{args:[],body:\"this_f=Math.\"+e,thisVars:[\"this_f\"]},body:{args:[\"a\",\"b\"],body:\"a=this_f(b)\",thisVars:[\"this_f\"]},funcName:e}),r[e+\"eq\"]=a({args:[\"array\"],pre:{args:[],body:\"this_f=Math.\"+e,thisVars:[\"this_f\"]},body:{args:[\"a\"],body:\"a=this_f(a)\",thisVars:[\"this_f\"]},rvalue:!0,count:2,funcName:e+\"eq\"})}}();var f=[\"max\",\"min\",\"atan2\",\"pow\"];!function(){for(var t=0;t<f.length;++t){var e=f[t];r[e]=a({args:[\"array\",\"array\",\"array\"],pre:{args:[],body:\"this_f=Math.\"+e,thisVars:[\"this_f\"]},body:{args:[\"a\",\"b\",\"c\"],body:\"a=this_f(b,c)\",thisVars:[\"this_f\"]},funcName:e}),r[e+\"s\"]=a({args:[\"array\",\"array\",\"scalar\"],pre:{args:[],body:\"this_f=Math.\"+e,thisVars:[\"this_f\"]},body:{args:[\"a\",\"b\",\"c\"],body:\"a=this_f(b,c)\",thisVars:[\"this_f\"]},funcName:e+\"s\"}),r[e+\"eq\"]=a({args:[\"array\",\"array\"],pre:{args:[],body:\"this_f=Math.\"+e,thisVars:[\"this_f\"]},body:{args:[\"a\",\"b\"],body:\"a=this_f(a,b)\",thisVars:[\"this_f\"]},rvalue:!0,count:2,funcName:e+\"eq\"}),r[e+\"seq\"]=a({args:[\"array\",\"scalar\"],pre:{args:[],body:\"this_f=Math.\"+e,thisVars:[\"this_f\"]},body:{args:[\"a\",\"b\"],body:\"a=this_f(a,b)\",thisVars:[\"this_f\"]},rvalue:!0,count:2,funcName:e+\"seq\"})}}();var d=[\"atan2\",\"pow\"];!function(){for(var t=0;t<d.length;++t){var e=d[t];r[e+\"op\"]=a({args:[\"array\",\"array\",\"array\"],pre:{args:[],body:\"this_f=Math.\"+e,thisVars:[\"this_f\"]},body:{args:[\"a\",\"b\",\"c\"],body:\"a=this_f(c,b)\",thisVars:[\"this_f\"]},funcName:e+\"op\"}),r[e+\"ops\"]=a({args:[\"array\",\"array\",\"scalar\"],pre:{args:[],body:\"this_f=Math.\"+e,thisVars:[\"this_f\"]},body:{args:[\"a\",\"b\",\"c\"],body:\"a=this_f(c,b)\",thisVars:[\"this_f\"]},funcName:e+\"ops\"}),r[e+\"opeq\"]=a({args:[\"array\",\"array\"],pre:{args:[],body:\"this_f=Math.\"+e,thisVars:[\"this_f\"]},body:{args:[\"a\",\"b\"],body:\"a=this_f(b,a)\",thisVars:[\"this_f\"]},rvalue:!0,count:2,funcName:e+\"opeq\"}),r[e+\"opseq\"]=a({args:[\"array\",\"scalar\"],pre:{args:[],body:\"this_f=Math.\"+e,thisVars:[\"this_f\"]},body:{args:[\"a\",\"b\"],body:\"a=this_f(b,a)\",thisVars:[\"this_f\"]},rvalue:!0,count:2,funcName:e+\"opseq\"})}}(),r.any=o({args:[\"array\"],pre:s,body:{args:[{name:\"a\",lvalue:!1,rvalue:!0,count:1}],body:\"if(a){return true}\",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:\"return false\"},funcName:\"any\"}),r.all=o({args:[\"array\"],pre:s,body:{args:[{name:\"x\",lvalue:!1,rvalue:!0,count:1}],body:\"if(!x){return false}\",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:\"return true\"},funcName:\"all\"}),r.sum=o({args:[\"array\"],pre:{args:[],localVars:[],thisVars:[\"this_s\"],body:\"this_s=0\"},body:{args:[{name:\"a\",lvalue:!1,rvalue:!0,count:1}],body:\"this_s+=a\",localVars:[],thisVars:[\"this_s\"]},post:{args:[],localVars:[],thisVars:[\"this_s\"],body:\"return this_s\"},funcName:\"sum\"}),r.prod=o({args:[\"array\"],pre:{args:[],localVars:[],thisVars:[\"this_s\"],body:\"this_s=1\"},body:{args:[{name:\"a\",lvalue:!1,rvalue:!0,count:1}],body:\"this_s*=a\",localVars:[],thisVars:[\"this_s\"]},post:{args:[],localVars:[],thisVars:[\"this_s\"],body:\"return this_s\"},funcName:\"prod\"}),r.norm2squared=o({args:[\"array\"],pre:{args:[],localVars:[],thisVars:[\"this_s\"],body:\"this_s=0\"},body:{args:[{name:\"a\",lvalue:!1,rvalue:!0,count:2}],body:\"this_s+=a*a\",localVars:[],thisVars:[\"this_s\"]},post:{args:[],localVars:[],thisVars:[\"this_s\"],body:\"return this_s\"},funcName:\"norm2squared\"}),r.norm2=o({args:[\"array\"],pre:{args:[],localVars:[],thisVars:[\"this_s\"],body:\"this_s=0\"},body:{args:[{name:\"a\",lvalue:!1,rvalue:!0,count:2}],body:\"this_s+=a*a\",localVars:[],thisVars:[\"this_s\"]},post:{args:[],localVars:[],thisVars:[\"this_s\"],body:\"return Math.sqrt(this_s)\"},funcName:\"norm2\"}),r.norminf=o({args:[\"array\"],pre:{args:[],localVars:[],thisVars:[\"this_s\"],body:\"this_s=0\"},body:{args:[{name:\"a\",lvalue:!1,rvalue:!0,count:4}],body:\"if(-a>this_s){this_s=-a}else if(a>this_s){this_s=a}\",localVars:[],thisVars:[\"this_s\"]},post:{args:[],localVars:[],thisVars:[\"this_s\"],body:\"return this_s\"},funcName:\"norminf\"}),r.norm1=o({args:[\"array\"],pre:{args:[],localVars:[],thisVars:[\"this_s\"],body:\"this_s=0\"},body:{args:[{name:\"a\",lvalue:!1,rvalue:!0,count:3}],body:\"this_s+=a<0?-a:a\",localVars:[],thisVars:[\"this_s\"]},post:{args:[],localVars:[],thisVars:[\"this_s\"],body:\"return this_s\"},funcName:\"norm1\"}),r.sup=o({args:[\"array\"],pre:{body:\"this_h=-Infinity\",args:[],thisVars:[\"this_h\"],localVars:[]},body:{body:\"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_\",args:[{name:\"_inline_1_arg0_\",lvalue:!1,rvalue:!0,count:2}],thisVars:[\"this_h\"],localVars:[]},post:{body:\"return this_h\",args:[],thisVars:[\"this_h\"],localVars:[]}}),r.inf=o({args:[\"array\"],pre:{body:\"this_h=Infinity\",args:[],thisVars:[\"this_h\"],localVars:[]},body:{body:\"if(_inline_1_arg0_<this_h)this_h=_inline_1_arg0_\",args:[{name:\"_inline_1_arg0_\",lvalue:!1,rvalue:!0,count:2}],thisVars:[\"this_h\"],localVars:[]},post:{body:\"return this_h\",args:[],thisVars:[\"this_h\"],localVars:[]}}),r.argmin=o({args:[\"index\",\"array\",\"shape\"],pre:{body:\"{this_v=Infinity;this_i=_inline_0_arg2_.slice(0)}\",args:[{name:\"_inline_0_arg0_\",lvalue:!1,rvalue:!1,count:0},{name:\"_inline_0_arg1_\",lvalue:!1,rvalue:!1,count:0},{name:\"_inline_0_arg2_\",lvalue:!1,rvalue:!0,count:1}],thisVars:[\"this_i\",\"this_v\"],localVars:[]},body:{body:\"{if(_inline_1_arg1_<this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}\",args:[{name:\"_inline_1_arg0_\",lvalue:!1,rvalue:!0,count:2},{name:\"_inline_1_arg1_\",lvalue:!1,rvalue:!0,count:2}],thisVars:[\"this_i\",\"this_v\"],localVars:[\"_inline_1_k\"]},post:{body:\"{return this_i}\",args:[],thisVars:[\"this_i\"],localVars:[]}}),r.argmax=o({args:[\"index\",\"array\",\"shape\"],pre:{body:\"{this_v=-Infinity;this_i=_inline_0_arg2_.slice(0)}\",args:[{name:\"_inline_0_arg0_\",lvalue:!1,rvalue:!1,count:0},{name:\"_inline_0_arg1_\",lvalue:!1,rvalue:!1,count:0},{name:\"_inline_0_arg2_\",lvalue:!1,rvalue:!0,count:1}],thisVars:[\"this_i\",\"this_v\"],localVars:[]},body:{body:\"{if(_inline_1_arg1_>this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}\",args:[{name:\"_inline_1_arg0_\",lvalue:!1,rvalue:!0,count:2},{name:\"_inline_1_arg1_\",lvalue:!1,rvalue:!0,count:2}],thisVars:[\"this_i\",\"this_v\"],localVars:[\"_inline_1_k\"]},post:{body:\"{return this_i}\",args:[],thisVars:[\"this_i\"],localVars:[]}}),r.random=a({args:[\"array\"],pre:{args:[],body:\"this_f=Math.random\",thisVars:[\"this_f\"]},body:{args:[\"a\"],body:\"a=this_f()\",thisVars:[\"this_f\"]},funcName:\"random\"}),r.assign=a({args:[\"array\",\"array\"],body:{args:[\"a\",\"b\"],body:\"a=b\"},funcName:\"assign\"}),r.assigns=a({args:[\"array\",\"scalar\"],body:{args:[\"a\",\"b\"],body:\"a=b\"},funcName:\"assigns\"}),r.equals=o({args:[\"array\",\"array\"],pre:s,body:{args:[{name:\"x\",lvalue:!1,rvalue:!0,count:1},{name:\"y\",lvalue:!1,rvalue:!0,count:1}],body:\"if(x!==y){return false}\",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:\"return true\"},funcName:\"equals\"})},{\"cwise-compiler\":103}],444:[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\":445,ndarray:449}],445:[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\":103}],446:[function(t,e,r){\"use strict\";function n(t){switch(t){case\"uint8\":return[l.mallocUint8,l.freeUint8];case\"uint16\":return[l.mallocUint16,l.freeUint16];case\"uint32\":return[l.mallocUint32,l.freeUint32];case\"int8\":return[l.mallocInt8,l.freeInt8];case\"int16\":return[l.mallocInt16,l.freeInt16];case\"int32\":return[l.mallocInt32,l.freeInt32];case\"float32\":return[l.mallocFloat,l.freeFloat];case\"float64\":return[l.mallocDouble,l.freeDouble];default:return null}}function i(t){for(var e=[],r=0;r<t;++r)e.push(\"s\"+r);for(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}function a(t,e){function r(t){return\"generic\"===e?[\"data.get(\",t,\")\"].join(\"\"):[\"data[\",t,\"]\"].join(\"\")}function a(t,r){return\"generic\"===e?[\"data.set(\",t,\",\",r,\")\"].join(\"\"):[\"data[\",t,\"]=\",r].join(\"\")}var o=[\"'use strict'\"],s=[\"ndarrayInsertionSort\",t.join(\"d\"),e].join(\"\"),l=[\"left\",\"right\",\"data\",\"offset\"].concat(i(t.length)),u=n(e),c=[\"i,j,cptr,ptr=left*s0+offset\"];if(t.length>1){for(var h=[],f=1;f<t.length;++f)c.push(\"i\"+f),h.push(\"n\"+f);u?c.push(\"scratch=malloc(\"+h.join(\"*\")+\")\"):c.push(\"scratch=new Array(\"+h.join(\"*\")+\")\"),c.push(\"dptr\",\"sptr\",\"a\",\"b\")}else c.push(\"scratch\");if(o.push([\"function \",s,\"(\",l.join(\",\"),\"){var \",c.join(\",\")].join(\"\"),\"for(i=left+1;i<=right;++i){\",\"j=i;ptr+=s0\",\"cptr=ptr\"),t.length>1){o.push(\"dptr=0;sptr=ptr\");for(f=t.length-1;f>=0;--f)0!==(d=t[f])&&o.push([\"for(i\",d,\"=0;i\",d,\"<n\",d,\";++i\",d,\"){\"].join(\"\"));o.push(\"scratch[dptr++]=\",r(\"sptr\"));for(f=0;f<t.length;++f)0!==(d=t[f])&&o.push(\"sptr+=d\"+d,\"}\");o.push(\"__g:while(j--\\x3eleft){\",\"dptr=0\",\"sptr=cptr-s0\");for(f=1;f<t.length;++f)1===f&&o.push(\"__l:\"),o.push([\"for(i\",f,\"=0;i\",f,\"<n\",f,\";++i\",f,\"){\"].join(\"\"));o.push([\"a=\",r(\"sptr\"),\"\\nb=scratch[dptr]\\nif(a<b){break __g}\\nif(a>b){break __l}\"].join(\"\"));for(f=t.length-1;f>=1;--f)o.push(\"sptr+=e\"+f,\"dptr+=f\"+f,\"}\");o.push(\"dptr=cptr;sptr=cptr-s0\");for(f=t.length-1;f>=0;--f)0!==(d=t[f])&&o.push([\"for(i\",d,\"=0;i\",d,\"<n\",d,\";++i\",d,\"){\"].join(\"\"));o.push(a(\"dptr\",r(\"sptr\")));for(f=0;f<t.length;++f)0!==(d=t[f])&&o.push([\"dptr+=d\",d,\";sptr+=d\",d].join(\"\"),\"}\");o.push(\"cptr-=s0\\n}\"),o.push(\"dptr=cptr;sptr=0\");for(f=t.length-1;f>=0;--f)0!==(d=t[f])&&o.push([\"for(i\",d,\"=0;i\",d,\"<n\",d,\";++i\",d,\"){\"].join(\"\"));o.push(a(\"dptr\",\"scratch[sptr++]\"));for(f=0;f<t.length;++f){var d=t[f];0!==d&&o.push(\"dptr+=d\"+d,\"}\")}}else o.push(\"scratch=\"+r(\"ptr\"),\"while((j--\\x3eleft)&&(\"+r(\"cptr-s0\")+\">scratch)){\",a(\"cptr\",r(\"cptr-s0\")),\"cptr-=s0\",\"}\",a(\"cptr\",\"scratch\"));if(o.push(\"}\"),t.length>1&&u&&o.push(\"free(scratch)\"),o.push(\"} return \"+s),u)return(p=new Function(\"malloc\",\"free\",o.join(\"\\n\")))(u[0],u[1]);var p=new Function(o.join(\"\\n\"));return p()}function o(t,e,r){function a(t){return[\"(offset+\",t,\"*s0)\"].join(\"\")}function o(t){return\"generic\"===e?[\"data.get(\",t,\")\"].join(\"\"):[\"data[\",t,\"]\"].join(\"\")}function s(t,r){return\"generic\"===e?[\"data.set(\",t,\",\",r,\")\"].join(\"\"):[\"data[\",t,\"]=\",r].join(\"\")}function l(e,r,n){if(1===e.length)_.push(\"ptr0=\"+a(e[0]));else for(i=0;i<e.length;++i)_.push([\"b_ptr\",i,\"=s0*\",e[i]].join(\"\"));r&&_.push(\"pivot_ptr=0\"),_.push(\"ptr_shift=offset\");for(i=t.length-1;i>=0;--i)0!==(o=t[i])&&_.push([\"for(i\",o,\"=0;i\",o,\"<n\",o,\";++i\",o,\"){\"].join(\"\"));if(e.length>1)for(i=0;i<e.length;++i)_.push([\"ptr\",i,\"=b_ptr\",i,\"+ptr_shift\"].join(\"\"));_.push(n),r&&_.push(\"++pivot_ptr\");for(var i=0;i<t.length;++i){var o=t[i];0!==o&&(e.length>1?_.push(\"ptr_shift+=d\"+o):_.push(\"ptr0+=d\"+o),_.push(\"}\"))}}function c(e,r,n,i){if(1===r.length)_.push(\"ptr0=\"+a(r[0]));else{for(o=0;o<r.length;++o)_.push([\"b_ptr\",o,\"=s0*\",r[o]].join(\"\"));_.push(\"ptr_shift=offset\")}n&&_.push(\"pivot_ptr=0\"),e&&_.push(e+\":\");for(o=1;o<t.length;++o)_.push([\"for(i\",o,\"=0;i\",o,\"<n\",o,\";++i\",o,\"){\"].join(\"\"));if(r.length>1)for(o=0;o<r.length;++o)_.push([\"ptr\",o,\"=b_ptr\",o,\"+ptr_shift\"].join(\"\"));_.push(i);for(var o=t.length-1;o>=1;--o)n&&_.push(\"pivot_ptr+=f\"+o),r.length>1?_.push(\"ptr_shift+=e\"+o):_.push(\"ptr0+=e\"+o),_.push(\"}\")}function h(){t.length>1&&k&&_.push(\"free(pivot1)\",\"free(pivot2)\")}function f(e,r){var n=\"el\"+e,i=\"el\"+r;if(t.length>1){var s=\"__l\"+ ++A;c(s,[n,i],!1,[\"comp=\",o(\"ptr0\"),\"-\",o(\"ptr1\"),\"\\n\",\"if(comp>0){tmp0=\",n,\";\",n,\"=\",i,\";\",i,\"=tmp0;break \",s,\"}\\n\",\"if(comp<0){break \",s,\"}\"].join(\"\"))}else _.push([\"if(\",o(a(n)),\">\",o(a(i)),\"){tmp0=\",n,\";\",n,\"=\",i,\";\",i,\"=tmp0}\"].join(\"\"))}function d(e,r){t.length>1?l([e,r],!1,s(\"ptr0\",o(\"ptr1\"))):_.push(s(a(e),o(a(r))))}function p(e,r,n){if(t.length>1){var i=\"__l\"+ ++A;c(i,[r],!0,[e,\"=\",o(\"ptr0\"),\"-pivot\",n,\"[pivot_ptr]\\n\",\"if(\",e,\"!==0){break \",i,\"}\"].join(\"\"))}else _.push([e,\"=\",o(a(r)),\"-pivot\",n].join(\"\"))}function m(e,r){t.length>1?l([e,r],!1,[\"tmp=\",o(\"ptr0\"),\"\\n\",s(\"ptr0\",o(\"ptr1\")),\"\\n\",s(\"ptr1\",\"tmp\")].join(\"\")):_.push([\"ptr0=\",a(e),\"\\n\",\"ptr1=\",a(r),\"\\n\",\"tmp=\",o(\"ptr0\"),\"\\n\",s(\"ptr0\",o(\"ptr1\")),\"\\n\",s(\"ptr1\",\"tmp\")].join(\"\"))}function g(e,r,n){t.length>1?(l([e,r,n],!1,[\"tmp=\",o(\"ptr0\"),\"\\n\",s(\"ptr0\",o(\"ptr1\")),\"\\n\",s(\"ptr1\",o(\"ptr2\")),\"\\n\",s(\"ptr2\",\"tmp\")].join(\"\")),_.push(\"++\"+r,\"--\"+n)):_.push([\"ptr0=\",a(e),\"\\n\",\"ptr1=\",a(r),\"\\n\",\"ptr2=\",a(n),\"\\n\",\"++\",r,\"\\n\",\"--\",n,\"\\n\",\"tmp=\",o(\"ptr0\"),\"\\n\",s(\"ptr0\",o(\"ptr1\")),\"\\n\",s(\"ptr1\",o(\"ptr2\")),\"\\n\",s(\"ptr2\",\"tmp\")].join(\"\"))}function v(t,e){m(t,e),_.push(\"--\"+e)}function y(e,r,n){t.length>1?l([e,r],!0,[s(\"ptr0\",o(\"ptr1\")),\"\\n\",s(\"ptr1\",[\"pivot\",n,\"[pivot_ptr]\"].join(\"\"))].join(\"\")):_.push(s(a(e),o(a(r))),s(a(r),\"pivot\"+n))}function b(e,r){_.push([\"if((\",r,\"-\",e,\")<=\",u,\"){\\n\",\"insertionSort(\",e,\",\",r,\",data,offset,\",i(t.length).join(\",\"),\")\\n\",\"}else{\\n\",w,\"(\",e,\",\",r,\",data,offset,\",i(t.length).join(\",\"),\")\\n\",\"}\"].join(\"\"))}function x(e,r,n){t.length>1?(_.push([\"__l\",++A,\":while(true){\"].join(\"\")),l([e],!0,[\"if(\",o(\"ptr0\"),\"!==pivot\",r,\"[pivot_ptr]){break __l\",A,\"}\"].join(\"\")),_.push(n,\"}\")):_.push([\"while(\",o(a(e)),\"===pivot\",r,\"){\",n,\"}\"].join(\"\"))}var _=[\"'use strict'\"],w=[\"ndarrayQuickSort\",t.join(\"d\"),e].join(\"\"),M=[\"left\",\"right\",\"data\",\"offset\"].concat(i(t.length)),k=n(e),A=0;_.push([\"function \",w,\"(\",M.join(\",\"),\"){\"].join(\"\"));var T=[\"sixth=((right-left+1)/6)|0\",\"index1=left+sixth\",\"index5=right-sixth\",\"index3=(left+right)>>1\",\"index2=index3-sixth\",\"index4=index3+sixth\",\"el1=index1\",\"el2=index2\",\"el3=index3\",\"el4=index4\",\"el5=index5\",\"less=left+1\",\"great=right-1\",\"pivots_are_equal=true\",\"tmp\",\"tmp0\",\"x\",\"y\",\"z\",\"k\",\"ptr0\",\"ptr1\",\"ptr2\",\"comp_pivot1=0\",\"comp_pivot2=0\",\"comp=0\"];if(t.length>1){for(var S=[],E=1;E<t.length;++E)S.push(\"n\"+E),T.push(\"i\"+E);for(E=0;E<8;++E)T.push(\"b_ptr\"+E);T.push(\"ptr3\",\"ptr4\",\"ptr5\",\"ptr6\",\"ptr7\",\"pivot_ptr\",\"ptr_shift\",\"elementSize=\"+S.join(\"*\")),k?T.push(\"pivot1=malloc(elementSize)\",\"pivot2=malloc(elementSize)\"):T.push(\"pivot1=new Array(elementSize),pivot2=new Array(elementSize)\")}else T.push(\"pivot1\",\"pivot2\");if(_.push(\"var \"+T.join(\",\")),f(1,2),f(4,5),f(1,3),f(2,3),f(1,4),f(3,4),f(2,5),f(2,3),f(4,5),t.length>1?l([\"el1\",\"el2\",\"el3\",\"el4\",\"el5\",\"index1\",\"index3\",\"index5\"],!0,[\"pivot1[pivot_ptr]=\",o(\"ptr1\"),\"\\n\",\"pivot2[pivot_ptr]=\",o(\"ptr3\"),\"\\n\",\"pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\\n\",\"x=\",o(\"ptr0\"),\"\\n\",\"y=\",o(\"ptr2\"),\"\\n\",\"z=\",o(\"ptr4\"),\"\\n\",s(\"ptr5\",\"x\"),\"\\n\",s(\"ptr6\",\"y\"),\"\\n\",s(\"ptr7\",\"z\")].join(\"\")):_.push([\"pivot1=\",o(a(\"el2\")),\"\\n\",\"pivot2=\",o(a(\"el4\")),\"\\n\",\"pivots_are_equal=pivot1===pivot2\\n\",\"x=\",o(a(\"el1\")),\"\\n\",\"y=\",o(a(\"el3\")),\"\\n\",\"z=\",o(a(\"el5\")),\"\\n\",s(a(\"index1\"),\"x\"),\"\\n\",s(a(\"index3\"),\"y\"),\"\\n\",s(a(\"index5\"),\"z\")].join(\"\")),d(\"index2\",\"left\"),d(\"index4\",\"right\"),_.push(\"if(pivots_are_equal){\"),_.push(\"for(k=less;k<=great;++k){\"),p(\"comp\",\"k\",1),_.push(\"if(comp===0){continue}\"),_.push(\"if(comp<0){\"),_.push(\"if(k!==less){\"),m(\"k\",\"less\"),_.push(\"}\"),_.push(\"++less\"),_.push(\"}else{\"),_.push(\"while(true){\"),p(\"comp\",\"great\",1),_.push(\"if(comp>0){\"),_.push(\"great--\"),_.push(\"}else if(comp<0){\"),g(\"k\",\"less\",\"great\"),_.push(\"break\"),_.push(\"}else{\"),v(\"k\",\"great\"),_.push(\"break\"),_.push(\"}\"),_.push(\"}\"),_.push(\"}\"),_.push(\"}\"),_.push(\"}else{\"),_.push(\"for(k=less;k<=great;++k){\"),p(\"comp_pivot1\",\"k\",1),_.push(\"if(comp_pivot1<0){\"),_.push(\"if(k!==less){\"),m(\"k\",\"less\"),_.push(\"}\"),_.push(\"++less\"),_.push(\"}else{\"),p(\"comp_pivot2\",\"k\",2),_.push(\"if(comp_pivot2>0){\"),_.push(\"while(true){\"),p(\"comp\",\"great\",2),_.push(\"if(comp>0){\"),_.push(\"if(--great<k){break}\"),_.push(\"continue\"),_.push(\"}else{\"),p(\"comp\",\"great\",1),_.push(\"if(comp<0){\"),g(\"k\",\"less\",\"great\"),_.push(\"}else{\"),v(\"k\",\"great\"),_.push(\"}\"),_.push(\"break\"),_.push(\"}\"),_.push(\"}\"),_.push(\"}\"),_.push(\"}\"),_.push(\"}\"),_.push(\"}\"),y(\"left\",\"(less-1)\",1),y(\"right\",\"(great+1)\",2),b(\"left\",\"(less-2)\"),b(\"(great+2)\",\"right\"),_.push(\"if(pivots_are_equal){\"),h(),_.push(\"return\"),_.push(\"}\"),_.push(\"if(less<index1&&great>index5){\"),x(\"less\",1,\"++less\"),x(\"great\",2,\"--great\"),_.push(\"for(k=less;k<=great;++k){\"),p(\"comp_pivot1\",\"k\",1),_.push(\"if(comp_pivot1===0){\"),_.push(\"if(k!==less){\"),m(\"k\",\"less\"),_.push(\"}\"),_.push(\"++less\"),_.push(\"}else{\"),p(\"comp_pivot2\",\"k\",2),_.push(\"if(comp_pivot2===0){\"),_.push(\"while(true){\"),p(\"comp\",\"great\",2),_.push(\"if(comp===0){\"),_.push(\"if(--great<k){break}\"),_.push(\"continue\"),_.push(\"}else{\"),p(\"comp\",\"great\",1),_.push(\"if(comp<0){\"),g(\"k\",\"less\",\"great\"),_.push(\"}else{\"),v(\"k\",\"great\"),_.push(\"}\"),_.push(\"break\"),_.push(\"}\"),_.push(\"}\"),_.push(\"}\"),_.push(\"}\"),_.push(\"}\"),_.push(\"}\"),h(),b(\"less\",\"great\"),_.push(\"}return \"+w),t.length>1&&k)return(L=new Function(\"insertionSort\",\"malloc\",\"free\",_.join(\"\\n\")))(r,k[0],k[1]);var L=new Function(\"insertionSort\",_.join(\"\\n\"));return L(r)}function s(t,e){var r=[\"'use strict'\"],n=[\"ndarraySortWrapper\",t.join(\"d\"),e].join(\"\"),s=[\"array\"];r.push([\"function \",n,\"(\",s.join(\",\"),\"){\"].join(\"\"));for(var l=[\"data=array.data,offset=array.offset|0,shape=array.shape,stride=array.stride\"],c=0;c<t.length;++c)l.push([\"s\",c,\"=stride[\",c,\"]|0,n\",c,\"=shape[\",c,\"]|0\"].join(\"\"));for(var h=new Array(t.length),f=[],c=0;c<t.length;++c)0!==(g=t[c])&&(0===f.length?h[g]=\"1\":h[g]=f.join(\"*\"),f.push(\"n\"+g));for(var d=-1,p=-1,c=0;c<t.length;++c){var m=t[c];0!==m&&(d>0?l.push([\"d\",m,\"=s\",m,\"-d\",d,\"*n\",d].join(\"\")):l.push([\"d\",m,\"=s\",m].join(\"\")),d=m);var g=t.length-1-c;0!==g&&(p>0?l.push([\"e\",g,\"=s\",g,\"-e\",p,\"*n\",p,\",f\",g,\"=\",h[g],\"-f\",p,\"*n\",p].join(\"\")):l.push([\"e\",g,\"=s\",g,\",f\",g,\"=\",h[g]].join(\"\")),p=g)}r.push(\"var \"+l.join(\",\"));var v=[\"0\",\"n0-1\",\"data\",\"offset\"].concat(i(t.length));r.push([\"if(n0<=\",u,\"){\",\"insertionSort(\",v.join(\",\"),\")}else{\",\"quickSort(\",v.join(\",\"),\")}\"].join(\"\")),r.push(\"}return \"+n);var y=new Function(\"insertionSort\",\"quickSort\",r.join(\"\\n\")),b=a(t,e);return y(b,o(t,e,b))}var l=t(\"typedarray-pool\"),u=32;e.exports=s},{\"typedarray-pool\":521}],447:[function(t,e,r){\"use strict\";function n(t){var e=t.order,r=t.dtype,n=[e,r].join(\":\"),o=a[n];return o||(a[n]=o=i(e,r)),o(t),t}var i=t(\"./lib/compile_sort.js\"),a={};e.exports=n},{\"./lib/compile_sort.js\":446}],448:[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\":106,\"ndarray-linear-interpolate\":442}],449:[function(t,e,r){function n(t,e){return t[0]-e[0]}function i(){var t,e=this.stride,r=new Array(e.length);for(t=0;t<r.length;++t)r[t]=[Math.abs(e[t]),t];r.sort(n);var i=new Array(r.length);for(t=0;t<i.length;++t)i[t]=r[t][1];return i}function a(t,e){var r=[\"View\",e,\"d\",t].join(\"\");e<0&&(r=\"View_Nil\"+t);var n=\"generic\"===t;if(-1===e){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(y=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 \"+(n?\"this.data.get(this.offset)\":\"this.data[this.offset]\")+\"};proto.set=function \"+r+\"_set(v){return \"+(n?\"this.data.set(this.offset,v)\":\"this.data[this.offset]=v\")+\"};return function construct_\"+r+\"(a,b,c,d){return new \"+r+\"(a,d)}\";return(y=new Function(\"TrivialArray\",a))(h[t][0])}var a=[\"'use strict'\"],o=l(e),s=o.map(function(t){return\"i\"+t}),u=\"this.offset+\"+o.map(function(t){return\"this.stride[\"+t+\"]*i\"+t}).join(\"+\"),c=o.map(function(t){return\"b\"+t}).join(\",\"),f=o.map(function(t){return\"c\"+t}).join(\",\");a.push(\"function \"+r+\"(a,\"+c+\",\"+f+\",d){this.data=a\",\"this.shape=[\"+c+\"]\",\"this.stride=[\"+f+\"]\",\"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(\"+s.join(\",\")+\",v){\"),n?a.push(\"return this.data.set(\"+u+\",v)}\"):a.push(\"return this.data[\"+u+\"]=v}\"),a.push(\"proto.get=function \"+r+\"_get(\"+s.join(\",\")+\"){\"),n?a.push(\"return this.data.get(\"+u+\")}\"):a.push(\"return this.data[\"+u+\"]}\"),a.push(\"proto.index=function \"+r+\"_index(\",s.join(),\"){return \"+u+\"}\"),a.push(\"proto.hi=function \"+r+\"_hi(\"+s.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(\"+s.join(\",\")+\"){var b=this.offset,d=0,\"+d.join(\",\")+\",\"+p.join(\",\"));for(v=0;v<e;++v)a.push(\"if(typeof i\"+v+\"==='number'&&i\"+v+\">=0){d=i\"+v+\"|0;b+=c\"+v+\"*d;a\"+v+\"-=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(\"+s.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(v=0;v<e;++v)a.push(\"if(typeof i\"+v+\"==='number'){d=i\"+v+\"|0;if(d<0){c+=b\"+v+\"*(a\"+v+\"-1);a\"+v+\"=ceil(-a\"+v+\"/d)}else{a\"+v+\"=ceil(a\"+v+\"/d)}b\"+v+\"*=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)}\");for(var m=new Array(e),g=new Array(e),v=0;v<e;++v)m[v]=\"a[i\"+v+\"]\",g[v]=\"b[i\"+v+\"]\";a.push(\"proto.transpose=function \"+r+\"_transpose(\"+s+\"){\"+s.map(function(t,e){return t+\"=(\"+t+\"===undefined?\"+e+\":\"+t+\"|0)\"}).join(\";\"),\"var a=this.shape,b=this.stride;return new \"+r+\"(this.data,\"+m.join(\",\")+\",\"+g.join(\",\")+\",this.offset)}\"),a.push(\"proto.pick=function \"+r+\"_pick(\"+s+\"){var a=[],b=[],c=this.offset\");for(v=0;v<e;++v)a.push(\"if(typeof i\"+v+\"==='number'&&i\"+v+\">=0){c=(c+this.stride[\"+v+\"]*i\"+v+\")|0}else{a.push(this.shape[\"+v+\"]);b.push(this.stride[\"+v+\"])}\");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)}\");var y=new Function(\"CTOR_LIST\",\"ORDER\",a.join(\"\\n\"));return y(h[t],i)}function o(t){if(u(t))return\"buffer\";if(c)switch(Object.prototype.toString.call(t)){case\"[object Float64Array]\":return\"float64\";case\"[object Float32Array]\":return\"float32\";case\"[object Int8Array]\":return\"int8\";case\"[object Int16Array]\":return\"int16\";case\"[object Int32Array]\":return\"int32\";case\"[object Uint8Array]\":return\"uint8\";case\"[object Uint16Array]\":return\"uint16\";case\"[object Uint32Array]\":return\"uint32\";case\"[object Uint8ClampedArray]\":return\"uint8_clamped\"}return Array.isArray(t)?\"array\":\"generic\"}function s(t,e,r,n){if(void 0===t)return(f=h.array[0])([]);\"number\"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var i=e.length;if(void 0===r){r=new Array(i);for(var s=i-1,l=1;s>=0;--s)r[s]=l,l*=e[s]}if(void 0===n){n=0;for(s=0;s<i;++s)r[s]<0&&(n-=(e[s]-1)*r[s])}for(var u=o(t),c=h[u];c.length<=i+1;)c.push(a(u,c.length-1));var f=c[i+1];return f(t,e,r,n)}var l=t(\"iota-array\"),u=t(\"is-buffer\"),c=\"undefined\"!=typeof Float64Array,h={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=s},{\"iota-array\":276,\"is-buffer\":277}],450:[function(t,e,r){\"use strict\";function n(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return e<0?-a:a;var r=i.hi(t),n=i.lo(t);return e>t==t>0?n===o?(r+=1,n=0):n+=1:0===n?(n=o,r-=1):n-=1,i.pack(n,r)}var i=t(\"double-bits\"),a=Math.pow(2,-1074),o=-1>>>0;e.exports=n},{\"double-bits\":109}],451:[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,u=s[s.length-1],c=s[0],h=0;h<s.length;++h){l=u,u=c,c=s[(h+1)%s.length];for(var f=e[l],d=e[u],p=e[c],m=new Array(3),g=0,v=new Array(3),y=0,b=0;b<3;++b)m[b]=f[b]-d[b],g+=m[b]*m[b],v[b]=p[b]-d[b],y+=v[b]*v[b];if(g*y>a)for(var x=i[u],_=1/Math.sqrt(g*y),b=0;b<3;++b){var w=(b+1)%3,M=(b+2)%3;x[b]+=_*(v[w]*m[M]-v[M]*m[w])}}for(o=0;o<n;++o){for(var x=i[o],k=0,b=0;b<3;++b)k+=x[b]*x[b];if(k>a)for(var _=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),u=0;u<3;++u)l[u]=e[s[u]];for(var c=new Array(3),h=new Array(3),u=0;u<3;++u)c[u]=l[1][u]-l[0][u],h[u]=l[2][u]-l[0][u];for(var f=new Array(3),d=0,u=0;u<3;++u){var p=(u+1)%3,m=(u+2)%3;f[u]=c[p]*h[m]-c[m]*h[p],d+=f[u]*f[u]}d=d>a?1/Math.sqrt(d):0;for(u=0;u<3;++u)f[u]*=d;i[o]=f}return i}},{}],452:[function(t,e,r){\"use strict\";function n(t){if(null===t||void 0===t)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(t)}var i=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,o=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,s,l=n(t),u=1;u<arguments.length;u++){r=Object(arguments[u]);for(var c in r)a.call(r,c)&&(l[c]=r[c]);if(i){s=i(r);for(var h=0;h<s.length;h++)o.call(r,s[h])&&(l[s[h]]=r[s[h]])}}return l}},{}],453:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o,s,l,u){var c=e+a+u;if(f>0){f=Math.sqrt(c+1);t[0]=.5*(o-l)/f,t[1]=.5*(s-n)/f,t[2]=.5*(r-a)/f,t[3]=.5*f}else{var h=Math.max(e,a,u),f=Math.sqrt(2*h-c+1);e>=h?(t[0]=.5*f,t[1]=.5*(i+r)/f,t[2]=.5*(s+n)/f,t[3]=.5*(o-l)/f):a>=h?(t[0]=.5*(r+i)/f,t[1]=.5*f,t[2]=.5*(l+o)/f,t[3]=.5*(s-n)/f):(t[0]=.5*(n+s)/f,t[1]=.5*(o+l)/f,t[2]=.5*f,t[3]=.5*(r-i)/f)}return t}e.exports=n},{}],454:[function(t,e,r){\"use strict\";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function a(t,e){var r=e[0],n=e[1],a=e[2],o=e[3],s=i(r,n,a,o);s>1e-6?(t[0]=r/s,t[1]=n/s,t[2]=a/s,t[3]=o/s):(t[0]=t[1]=t[2]=0,t[3]=1)}function o(t,e,r){this.radius=l([r]),this.center=l(e),this.rotation=l(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}function s(t){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),a(r=[].slice.call(r,0,4),r);var i=new o(r,e,Math.log(n));return i.setDistanceLimits(t.zoomMin,t.zoomMax),(\"eye\"in t||\"up\"in t)&&i.lookAt(0,t.eye,t.center,t.up),i}e.exports=s;var l=t(\"filtered-vector\"),u=t(\"gl-mat4/lookAt\"),c=t(\"gl-mat4/fromQuat\"),h=t(\"gl-mat4/invert\"),f=t(\"./lib/quatFromFrame\"),d=o.prototype;d.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},d.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;a(e,e);var r=this.computedMatrix;c(r,e);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var u=0,h=0;h<3;++h)u+=r[l+4*h]*i[h];r[12+l]=-u}},d.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r},d.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},d.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},d.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=a[1],s=a[5],l=a[9],u=n(o,s,l);o/=u,s/=u,l/=u;var c=a[0],h=a[4],f=a[8],d=c*o+h*s+f*l,p=n(c-=o*d,h-=s*d,f-=l*d);c/=p,h/=p,f/=p;var m=a[2],g=a[6],v=a[10],y=m*o+g*s+v*l,b=m*c+g*h+v*f,x=n(m-=y*o+b*c,g-=y*s+b*h,v-=y*l+b*f);m/=x,g/=x,v/=x;var _=c*e+o*r,w=h*e+s*r,M=f*e+l*r;this.center.move(t,_,w,M);var k=Math.exp(this.computedRadius[0]);k=Math.max(1e-4,k+i),this.radius.set(t,Math.log(k))},d.rotate=function(t,e,r,a){this.recalcMatrix(t),e=e||0,r=r||0;var o=this.computedMatrix,s=o[0],l=o[4],u=o[8],c=o[1],h=o[5],f=o[9],d=o[2],p=o[6],m=o[10],g=e*s+r*c,v=e*l+r*h,y=e*u+r*f,b=-(p*y-m*v),x=-(m*g-d*y),_=-(d*v-p*g),w=Math.sqrt(Math.max(0,1-Math.pow(b,2)-Math.pow(x,2)-Math.pow(_,2))),M=i(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],S=k[2],E=k[3],L=A*w+E*b+T*_-S*x,C=T*w+E*x+S*b-A*_,z=S*w+E*_+A*x-T*b,D=E*w-A*b-T*x-S*_;if(a){b=d,x=p,_=m;var I=Math.sin(a)/n(b,x,_);b*=I,x*=I,_*=I,D=D*(w=Math.cos(e))-(L=L*w+D*b+C*_-z*x)*b-(C=C*w+D*x+z*b-L*_)*x-(z=z*w+D*_+L*x-C*b)*_}var P=i(L,C,z,D);P>1e-6?(L/=P,C/=P,z/=P,D/=P):(L=C=z=0,D=1),this.rotation.set(t,L,C,z,D)},d.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var i=this.computedMatrix;u(i,e,r,n);var o=this.computedRotation;f(o,i[0],i[1],i[2],i[4],i[5],i[6],i[8],i[9],i[10]),a(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var s=0,l=0;l<3;++l)s+=Math.pow(r[l]-e[l],2);this.radius.set(t,.5*Math.log(Math.max(s,1e-6))),this.center.set(t,r[0],r[1],r[2])},d.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},d.setMatrix=function(t,e){var r=this.computedRotation;f(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),a(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;h(n,e);var i=n[15];if(Math.abs(i)>1e-6){var o=n[12]/i,s=n[13]/i,l=n[14]/i;this.recalcMatrix(t);var u=Math.exp(this.computedRadius[0]);this.center.set(t,o-n[2]*u,s-n[6]*u,l-n[10]*u),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},d.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},d.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},d.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},d.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},d.fromJSON=function(t){var e=this.lastT(),r=t.center;r&&this.center.set(e,r[0],r[1],r[2]);var n=t.rotation;n&&this.rotation.set(e,n[0],n[1],n[2],n[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},{\"./lib/quatFromFrame\":453,\"filtered-vector\":118,\"gl-mat4/fromQuat\":162,\"gl-mat4/invert\":165,\"gl-mat4/lookAt\":166}],455:[function(t,e,r){\"use strict\";var n=t(\"repeat-string\");e.exports=function(t,e,r){return r=void 0!==r?r+\"\":\" \",n(r,e)+t}},{\"repeat-string\":481}],456:[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}},{}],457:[function(t,e,r){(function(t){function e(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];\".\"===i?t.splice(n,1):\"..\"===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift(\"..\");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n<t.length;n++)e(t[n],n,t)&&r.push(t[n]);return r}var i=/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/,a=function(t){return i.exec(t).slice(1)};r.resolve=function(){for(var r=\"\",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var o=a>=0?arguments[a]:t.cwd();if(\"string\"!=typeof o)throw new TypeError(\"Arguments to path.resolve must be strings\");o&&(r=o+\"/\"+r,i=\"/\"===o.charAt(0))}return r=e(n(r.split(\"/\"),function(t){return!!t}),!i).join(\"/\"),(i?\"/\":\"\")+r||\".\"},r.normalize=function(t){var i=r.isAbsolute(t),a=\"/\"===o(t,-1);return(t=e(n(t.split(\"/\"),function(t){return!!t}),!i).join(\"/\"))||i||(t=\".\"),t&&a&&(t+=\"/\"),(i?\"/\":\"\")+t},r.isAbsolute=function(t){return\"/\"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if(\"string\"!=typeof t)throw new TypeError(\"Arguments to path.join must be strings\");return t}).join(\"/\"))},r.relative=function(t,e){function n(t){for(var e=0;e<t.length&&\"\"===t[e];e++);for(var r=t.length-1;r>=0&&\"\"===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split(\"/\")),a=n(e.split(\"/\")),o=Math.min(i.length,a.length),s=o,l=0;l<o;l++)if(i[l]!==a[l]){s=l;break}for(var u=[],l=s;l<i.length;l++)u.push(\"..\");return(u=u.concat(a.slice(s))).join(\"/\")},r.sep=\"/\",r.delimiter=\":\",r.dirname=function(t){var e=a(t),r=e[0],n=e[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):\".\"},r.basename=function(t,e){var r=a(t)[2];return e&&r.substr(-1*e.length)===e&&(r=r.substr(0,r.length-e.length)),r},r.extname=function(t){return a(t)[3]};var o=\"b\"===\"ab\".substr(-1)?function(t,e,r){return t.substr(e,r)}:function(t,e,r){return e<0&&(e=t.length+e),t.substr(e,r)}}).call(this,t(\"_process\"))},{_process:468}],458:[function(t,e,r){\"use strict\";function n(t){var e;t&&t.length&&(t=(e=t).length);var r=new Uint8Array(t||0);return e&&r.set(e),r.readUInt32LE=a.readUInt32LE,r.writeUInt32LE=a.writeUInt32LE,r.readInt32LE=a.readInt32LE,r.writeInt32LE=a.writeInt32LE,r.readFloatLE=a.readFloatLE,r.writeFloatLE=a.writeFloatLE,r.readDoubleLE=a.readDoubleLE,r.writeDoubleLE=a.writeDoubleLE,r.toString=a.toString,r.write=a.write,r.slice=a.slice,r.copy=a.copy,r._isBuffer=!0,r}function i(t){for(var e,r,n=t.length,i=[],a=0;a<n;a++){if((e=t.charCodeAt(a))>55295&&e<57344){if(!r){e>56319||a+1===n?i.push(239,191,189):r=e;continue}if(e<56320){i.push(239,191,189),r=e;continue}e=r-55296<<10|e-56320|65536,r=null}else r&&(i.push(239,191,189),r=null);e<128?i.push(e):e<2048?i.push(e>>6|192,63&e|128):e<65536?i.push(e>>12|224,e>>6&63|128,63&e|128):i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}return i}e.exports=n;var a,o,s,l=t(\"ieee754\");(a={readUInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},writeUInt32LE:function(t,e){this[e]=t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24},readInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+(this[t+3]<<24)},readFloatLE:function(t){return l.read(this,t,!0,23,4)},readDoubleLE:function(t){return l.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return l.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return l.write(this,t,e,!0,52,8)},toString:function(t,e,r){var n=\"\",i=\"\";e=e||0,r=Math.min(this.length,r||this.length);for(var a=e;a<r;a++){var o=this[a];o<=127?(n+=decodeURIComponent(i)+String.fromCharCode(o),i=\"\"):i+=\"%\"+o.toString(16)}return n+=decodeURIComponent(i)},write:function(t,e){for(var r=t===o?s:i(t),n=0;n<r.length;n++)this[e+n]=r[n]},slice:function(t,e){return this.subarray(t,e)},copy:function(t,e){e=e||0;for(var r=0;r<this.length;r++)t[e+r]=this[r]}}).writeInt32LE=a.writeUInt32LE,n.byteLength=function(t){return o=t,(s=i(t)).length},n.isBuffer=function(t){return!(!t||!t._isBuffer)}},{ieee754:272}],459:[function(t,e,r){(function(r){\"use strict\";function n(t){this.buf=g.isBuffer(t)?t:new g(t||0),this.pos=0,this.length=this.buf.length}function i(t,e){var r,n=e.buf;if(r=n[e.pos++],t+=268435456*(127&r),r<128)return t;if(r=n[e.pos++],t+=34359738368*(127&r),r<128)return t;if(r=n[e.pos++],t+=4398046511104*(127&r),r<128)return t;if(r=n[e.pos++],t+=562949953421312*(127&r),r<128)return t;if(r=n[e.pos++],t+=72057594037927940*(127&r),r<128)return t;if(r=n[e.pos++],t+=0x8000000000000000*(127&r),r<128)return t;throw new Error(\"Expected varint not more than 10 bytes\")}function a(t,e){e.realloc(10);for(var r=e.pos+10;t>=1;){if(e.pos>=r)throw new Error(\"Given varint doesn't fit into 10 bytes\");var n=255&t;e.buf[e.pos++]=n|(t>=128?128:0),t/=128}}function o(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function s(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function l(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function u(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function c(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function h(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function f(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function d(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function p(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function m(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}e.exports=n;var g=r.Buffer||t(\"./buffer\");n.Varint=0,n.Fixed64=1,n.Bytes=2,n.Fixed32=5;var v=Math.pow(2,63);n.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,a=this.pos;t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=this.buf.readUInt32LE(this.pos);return this.pos+=4,t},readSFixed32:function(){var t=this.buf.readInt32LE(this.pos);return this.pos+=4,t},readFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+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 e=r[this.pos++],t=127&e,e<128?t:(e=r[this.pos++],t|=(127&e)<<7,e<128?t:(e=r[this.pos++],t|=(127&e)<<14,e<128?t:(e=r[this.pos++],t|=(127&e)<<21,e<128?t:i(t,this))))},readVarint64:function(){var t=this.pos,e=this.readVarint();if(e<v)return e;for(var r=this.pos-2;255===this.buf[r];)r--;r<t&&(r=t),e=0;for(var n=0;n<r-t+1;n++){var i=127&~this.buf[t+n];e+=n<4?i<<7*n:i*Math.pow(2,7*n)}return-e-1},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.buf.toString(\"utf8\",this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.slice(this.pos,t);return this.pos=t,e},readPackedVarint:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readVarint());return e},readPackedSVarint:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(t){var e=7&t;if(e===n.Varint)for(;this.buf[this.pos++]>127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error(\"Unimplemented type: \"+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new g(e);this.buf.copy(r),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.slice(0,this.length)},writeFixed32:function(t){this.realloc(4),this.buf.writeUInt32LE(t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),this.buf.writeInt32LE(t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),this.buf.writeInt32LE(-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?a(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=g.byteLength(t);this.writeVarint(e),this.realloc(e),this.buf.write(t,this.pos),this.pos+=e},writeFloat:function(t){this.realloc(4),this.buf.writeFloatLE(t,this.pos),this.pos+=4},writeDouble:function(t){this.realloc(8),this.buf.writeDoubleLE(t,this.pos),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){var r=++this.pos;t(e,this);var n=this.pos-r;n>=128&&o(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,s,e)},writePackedSVarint:function(t,e){this.writeMessage(t,l,e)},writePackedBoolean:function(t,e){this.writeMessage(t,h,e)},writePackedFloat:function(t,e){this.writeMessage(t,u,e)},writePackedDouble:function(t,e){this.writeMessage(t,c,e)},writePackedFixed32:function(t,e){this.writeMessage(t,f,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,d,e)},writePackedFixed64:function(t,e){this.writeMessage(t,p,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,m,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{\"./buffer\":458}],460:[function(t,e,r){\"use strict\";function n(t){var e=t.length;if(e<i){for(var r=1,n=0;n<e;++n)for(l=0;l<n;++l)if(t[n]<t[l])r=-r;else if(t[n]===t[l])return 0;return r}for(var o=a.mallocUint8(e),n=0;n<e;++n)o[n]=0;for(var r=1,n=0;n<e;++n)if(!o[n]){var s=1;o[n]=1;for(var l=t[n];l!==n;l=t[l]){if(o[l])return a.freeUint8(o),0;s+=1,o[l]=1}1&s||(r=-r)}return a.freeUint8(o),r}e.exports=n;var i=32,a=t(\"typedarray-pool\")},{\"typedarray-pool\":521}],461:[function(t,e,r){\"use strict\";function n(t){var e=t.length;switch(e){case 0:case 1:return 0;case 2:return t[1]}var r,n,i,s=a.mallocUint32(e),l=a.mallocUint32(e),u=0;for(o(t,l),i=0;i<e;++i)s[i]=t[i];for(i=e-1;i>0;--i)n=l[i],r=s[i],s[i]=s[n],s[n]=r,l[i]=l[r],l[r]=n,u=(u+r)*i;return a.freeUint32(l),a.freeUint32(s),u}function i(t,e,r){switch(t){case 0:return r||[];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}var a=t(\"typedarray-pool\"),o=t(\"invert-permutation\");r.rank=n,r.unrank=i},{\"invert-permutation\":275,\"typedarray-pool\":521}],462:[function(t,e,r){\"use strict\";function n(t,e){function r(t,e){var r=s[e][t[e]];r.splice(r.indexOf(t),1)}function n(t,n,a){for(var o,l,u,c=0;c<2;++c)if(s[c][n].length>0){o=s[c][n][0],u=c;break}l=o[1^u];for(var h=0;h<2;++h)for(var f=s[h][n],d=0;d<f.length;++d){var p=f[d],m=p[1^h];i(e[t],e[n],e[l],e[m])>0&&(o=p,l=m,u=h)}return a?l:(o&&r(o,u),l)}for(var a=0|e.length,o=t.length,s=[new Array(a),new Array(a)],l=0;l<a;++l)s[0][l]=[],s[1][l]=[];for(l=0;l<o;++l){var u=t[l];s[0][u[0]].push(u),s[1][u[1]].push(u)}for(var c=[],l=0;l<a;++l)s[0][l].length+s[1][l].length===0&&c.push([l]);for(l=0;l<a;++l)for(var h=0;h<2;++h){for(var f=[];s[h][l].length>0;){s[0][l].length;var d=function(t,a){var o=s[a][t][0],l=[t];r(o,a);for(var u=o[1^a];;){for(;u!==t;)l.push(u),u=n(l[l.length-2],u,!1);if(s[0][t].length+s[1][t].length===0)break;var c=l[l.length-1],h=t,f=l[1],d=n(c,h,!0);if(i(e[c],e[h],e[f],e[d])<0)break;l.push(t),u=n(c,h)}return l}(l,h);!function(t,e){return e[1]===e[e.length-1]}(f,d)?(f.length>0&&c.push(f),f=d):f.push.apply(f,d)}f.length>0&&c.push(f)}return c}e.exports=n;var i=t(\"compare-angle\")},{\"compare-angle\":93}],463:[function(t,e,r){\"use strict\";function n(t,e){for(var r=i(t,e.length),n=new Array(e.length),a=new Array(e.length),o=[],s=0;s<e.length;++s){var l=r[s].length;a[s]=l,n[s]=!0,l<=1&&o.push(s)}for(;o.length>0;){n[d=o.pop()]=!1;for(var u=r[d],s=0;s<u.length;++s){var c=u[s];0==--a[c]&&o.push(c)}}for(var h=new Array(e.length),f=[],s=0;s<e.length;++s)if(n[s]){var d=f.length;h[s]=d,f.push(e[s])}else h[s]=-1;for(var p=[],s=0;s<t.length;++s){var m=t[s];n[m[0]]&&n[m[1]]&&p.push([h[m[0]],h[m[1]]])}return[p,f]}e.exports=n;var i=t(\"edges-to-adjacency-list\")},{\"edges-to-adjacency-list\":112}],464:[function(t,e,r){\"use strict\";function n(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=e;return r}function i(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=[];return e}function a(t,e){function r(t){for(var r=t.length,n=[0],i=0;i<r;++i){var a=e[t[i]],o=e[t[(i+1)%r]],s=u(-a[0],a[1]),l=u(-a[0],o[1]),h=u(o[0],a[1]),f=u(o[0],o[1]);n=c(n,c(c(s,l),c(h,f)))}return n[n.length-1]>0}function a(t){for(var e=t.length,r=0;r<e;++r)if(!D[t[r]])return!1;return!0}t=(N=f(t,e))[0];for(var d=(e=N[1]).length,p=(t.length,o(t,e.length)),m=0;m<d;++m)if(p[m].length%2==1)throw new Error(\"planar-graph-to-polyline: graph must be manifold\");for(var g=s(t,e),v=(g=g.filter(r)).length,y=new Array(v),b=new Array(v),m=0;m<v;++m){y[m]=m;var x=new Array(v),_=g[m].map(function(t){return e[t]}),w=l([_]),M=0;t:for(L=0;L<v;++L)if(x[L]=0,m!==L){for(var k=(Y=g[L]).length,A=0;A<k;++A){var T=w(e[Y[A]]);if(0!==T){T<0&&(x[L]=1,M+=1);continue t}}x[L]=1,M+=1}b[m]=[M,m,x]}b.sort(function(t,e){return e[0]-t[0]});for(m=0;m<v;++m)for(var S=(x=b[m])[1],E=x[2],L=0;L<v;++L)E[L]&&(y[L]=S);for(var C=i(v),m=0;m<v;++m)C[m].push(y[m]),C[y[m]].push(m);for(var z={},D=n(d,!1),m=0;m<v;++m)for(var k=(Y=g[m]).length,L=0;L<k;++L){var I=Y[L],P=Y[(L+1)%k],O=Math.min(I,P)+\":\"+Math.max(I,P);if(O in z){var j=z[O];C[j].push(m),C[m].push(j),D[I]=D[P]=!0}else z[O]=m}for(var R=[],F=n(v,-1),m=0;m<v;++m)y[m]!==m||a(g[m])?F[m]=-1:(R.push(m),F[m]=0);for(var N=[];R.length>0;){var B=R.pop(),U=C[B];h(U,function(t,e){return t-e});var V,H=U.length,q=F[B];0===q&&(V=[Y=g[B]]);for(m=0;m<H;++m){var G=U[m];if(!(F[G]>=0)&&(F[G]=1^q,R.push(G),0===q)){var Y=g[G];a(Y)||(Y.reverse(),V.push(Y))}}0===q&&N.push(V)}return N}e.exports=a;var o=t(\"edges-to-adjacency-list\"),s=t(\"planar-dual\"),l=t(\"point-in-big-polygon\"),u=t(\"two-product\"),c=t(\"robust-sum\"),h=t(\"uniq\"),f=t(\"./lib/trim-leaves\")},{\"./lib/trim-leaves\":463,\"edges-to-adjacency-list\":112,\"planar-dual\":462,\"point-in-big-polygon\":466,\"robust-sum\":494,\"two-product\":519,uniq:523}],465:[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}},{}],466:[function(t,e,r){function n(){return!0}function i(t){return function(e,r){var i=t[e];return!!i&&!!i.queryPoint(r,n)}}function a(t){for(var e={},r=0;r<t.length;++r){var n=t[r],a=n[0][0],o=n[0][1],s=n[1][1],l=[Math.min(o,s),Math.max(o,s)];a in e?e[a].push(l):e[a]=[l]}for(var u={},c=Object.keys(e),r=0;r<c.length;++r){var h=e[c[r]];u[c[r]]=d(h)}return i(u)}function o(t,e){return function(r){var n=p.le(e,r[0]);if(n<0)return 1;var i=t[n];if(!i){if(!(n>0&&e[n]===r[0]))return 1;i=t[n-1]}for(var a=1;i;){var o=i.key,s=h(r,o[0],o[1]);if(o[0][0]<o[1][0])if(s<0)i=i.left;else{if(!(s>0))return 0;a=-1,i=i.right}else if(s>0)i=i.left;else{if(!(s<0))return 0;a=1,i=i.right}}return a}}function s(t){return 1}function l(t){return function(e){return t(e[0],e[1])?0:1}}function u(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}function c(t){for(var e=t.length,r=[],n=[],i=0;i<e;++i)for(var c=t[i],h=c.length,d=h-1,p=0;p<h;d=p++){var m=c[d],g=c[p];m[0]===g[0]?n.push([m,g]):r.push([m,g])}if(0===r.length)return 0===n.length?s:l(a(n));var v=f(r),y=o(v.slabs,v.coordinates);return 0===n.length?y:u(a(n),y)}e.exports=c;var h=t(\"robust-orientation\")[3],f=t(\"slab-decomposition\"),d=t(\"interval-tree-1d\"),p=t(\"binary-search-bounds\")},{\"binary-search-bounds\":59,\"interval-tree-1d\":274,\"robust-orientation\":489,\"slab-decomposition\":506}],467:[function(t,e,r){\"use strict\";function n(t,e,r,n,s){i.length<n.length&&(i=new Float64Array(n.length),a=new Float64Array(n.length),o=new Float64Array(n.length));for(p=0;p<n.length;++p)i[p]=t[p]-n[p],a[p]=e[p]-t[p],o[p]=r[p]-t[p];for(var l=0,u=0,c=0,h=0,f=0,d=0,p=0;p<n.length;++p){var m=a[p],g=o[p],v=i[p];l+=m*m,u+=m*g,c+=g*g,h+=v*m,f+=v*g,d+=v*v}var y,b=Math.abs(l*c-u*u),x=u*f-c*h,_=u*h-l*f;if(x+_<=b)if(x<0)_<0&&h<0?(_=0,-h>=l?(x=1,y=l+2*h+d):y=h*(x=-h/l)+d):(x=0,f>=0?(_=0,y=d):-f>=c?(_=1,y=c+2*f+d):y=f*(_=-f/c)+d);else if(_<0)_=0,h>=0?(x=0,y=d):-h>=l?(x=1,y=l+2*h+d):y=h*(x=-h/l)+d;else{var w=1/b;y=(x*=w)*(l*x+u*(_*=w)+2*h)+_*(u*x+c*_+2*f)+d}else{var M,k,A,T;x<0?(k=c+f)>(M=u+h)?(A=k-M)>=(T=l-2*u+c)?(x=1,_=0,y=l+2*h+d):y=(x=A/T)*(l*x+u*(_=1-x)+2*h)+_*(u*x+c*_+2*f)+d:(x=0,k<=0?(_=1,y=c+2*f+d):f>=0?(_=0,y=d):y=f*(_=-f/c)+d):_<0?(k=l+h)>(M=u+f)?(A=k-M)>=(T=l-2*u+c)?(_=1,x=0,y=c+2*f+d):y=(x=1-(_=A/T))*(l*x+u*_+2*h)+_*(u*x+c*_+2*f)+d:(_=0,k<=0?(x=1,y=l+2*h+d):h>=0?(x=0,y=d):y=h*(x=-h/l)+d):(A=c+f-u-h)<=0?(x=0,_=1,y=c+2*f+d):A>=(T=l-2*u+c)?(x=1,_=0,y=l+2*h+d):y=(x=A/T)*(l*x+u*(_=1-x)+2*h)+_*(u*x+c*_+2*f)+d}for(var S=1-x-_,p=0;p<n.length;++p)s[p]=S*t[p]+x*e[p]+_*r[p];return y<0?0:y}var i=new Float64Array(4),a=new Float64Array(4),o=new Float64Array(4);e.exports=n},{}],468:[function(t,e,r){function n(){throw new Error(\"setTimeout has not been defined\")}function i(){throw new Error(\"clearTimeout has not been defined\")}function a(t){if(h===setTimeout)return setTimeout(t,0);if((h===n||!h)&&setTimeout)return h=setTimeout,setTimeout(t,0);try{return h(t,0)}catch(e){try{return h.call(null,t,0)}catch(e){return h.call(this,t,0)}}}function o(t){if(f===clearTimeout)return clearTimeout(t);if((f===i||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(t);try{return f(t)}catch(e){try{return f.call(null,t)}catch(e){return f.call(this,t)}}}function s(){g&&p&&(g=!1,p.length?m=p.concat(m):v=-1,m.length&&l())}function l(){if(!g){var t=a(s);g=!0;for(var e=m.length;e;){for(p=m,m=[];++v<e;)p&&p[v].run();v=-1,e=m.length}p=null,g=!1,o(t)}}function u(t,e){this.fun=t,this.array=e}function c(){}var h,f,d=e.exports={};!function(){try{h=\"function\"==typeof setTimeout?setTimeout:n}catch(t){h=n}try{f=\"function\"==typeof clearTimeout?clearTimeout:i}catch(t){f=i}}();var p,m=[],g=!1,v=-1;d.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];m.push(new u(t,e)),1!==m.length||g||a(l)},u.prototype.run=function(){this.fun.apply(null,this.array)},d.title=\"browser\",d.browser=!0,d.env={},d.argv=[],d.version=\"\",d.versions={},d.on=c,d.addListener=c,d.once=c,d.off=c,d.removeListener=c,d.removeAllListeners=c,d.emit=c,d.binding=function(t){throw new Error(\"process.binding is not supported\")},d.cwd=function(){return\"/\"},d.chdir=function(t){throw new Error(\"process.chdir is not supported\")},d.umask=function(){return 0}},{}],469:[function(t,e,r){(function(t){!function(n){function i(t){throw new RangeError(I[t])}function a(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function o(t,e){var r=t.split(\"@\"),n=\"\";return r.length>1&&(n=r[0]+\"@\",t=r[1]),n+a((t=t.replace(D,\".\")).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 a(t,function(t){var e=\"\";return t>65535&&(e+=j((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=j(t)}).join(\"\")}function u(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:w}function c(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function h(t,e,r){var n=0;for(t=r?O(t/T):t>>1,t+=O(t/e);t>P*k>>1;n+=w)t=O(t/P);return O(n+(P+1)*t/(t+A))}function f(t){var e,r,n,a,o,s,c,f,d,p,m=[],g=t.length,v=0,y=E,b=S;for((r=t.lastIndexOf(L))<0&&(r=0),n=0;n<r;++n)t.charCodeAt(n)>=128&&i(\"not-basic\"),m.push(t.charCodeAt(n));for(a=r>0?r+1:0;a<g;){for(o=v,s=1,c=w;a>=g&&i(\"invalid-input\"),((f=u(t.charCodeAt(a++)))>=w||f>O((_-v)/s))&&i(\"overflow\"),v+=f*s,d=c<=b?M:c>=b+k?k:c-b,!(f<d);c+=w)s>O(_/(p=w-d))&&i(\"overflow\"),s*=p;b=h(v-o,e=m.length+1,0==o),O(v/e)>_-y&&i(\"overflow\"),y+=O(v/e),v%=e,m.splice(v++,0,y)}return l(m)}function d(t){var e,r,n,a,o,l,u,f,d,p,m,g,v,y,b,x=[];for(g=(t=s(t)).length,e=E,r=0,o=S,l=0;l<g;++l)(m=t[l])<128&&x.push(j(m));for(n=a=x.length,a&&x.push(L);n<g;){for(u=_,l=0;l<g;++l)(m=t[l])>=e&&m<u&&(u=m);for(u-e>O((_-r)/(v=n+1))&&i(\"overflow\"),r+=(u-e)*v,e=u,l=0;l<g;++l)if((m=t[l])<e&&++r>_&&i(\"overflow\"),m==e){for(f=r,d=w;p=d<=o?M:d>=o+k?k:d-o,!(f<p);d+=w)b=f-p,y=w-p,x.push(j(c(p+b%y,0))),f=O(b/y);x.push(j(c(f,0))),o=h(r,v,n==a),r=0,++n}++r,++e}return x.join(\"\")}function p(t){return o(t,function(t){return C.test(t)?f(t.slice(4).toLowerCase()):t})}function m(t){return o(t,function(t){return z.test(t)?\"xn--\"+d(t):t})}var g=\"object\"==typeof r&&r&&!r.nodeType&&r,v=\"object\"==typeof e&&e&&!e.nodeType&&e,y=\"object\"==typeof t&&t;y.global!==y&&y.window!==y&&y.self!==y||(n=y);var b,x,_=2147483647,w=36,M=1,k=26,A=38,T=700,S=72,E=128,L=\"-\",C=/^xn--/,z=/[^\\x20-\\x7E]/,D=/[\\x2E\\u3002\\uFF0E\\uFF61]/g,I={overflow:\"Overflow: input needs wider integers to process\",\"not-basic\":\"Illegal input >= 0x80 (not a basic code point)\",\"invalid-input\":\"Invalid input\"},P=w-M,O=Math.floor,j=String.fromCharCode;if(b={version:\"1.4.1\",ucs2:{decode:s,encode:l},decode:f,encode:d,toASCII:m,toUnicode:p},g&&v)if(e.exports==g)v.exports=b;else for(x in b)b.hasOwnProperty(x)&&(g[x]=b[x]);else n.punycode=b}(this)}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}],470:[function(t,e,r){e.exports=t(\"gl-quat/slerp\")},{\"gl-quat/slerp\":215}],471:[function(t,e,r){\"use strict\";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,a){e=e||\"&\",r=r||\"=\";var o={};if(\"string\"!=typeof t||0===t.length)return o;var s=/\\+/g;t=t.split(e);var l=1e3;a&&\"number\"==typeof a.maxKeys&&(l=a.maxKeys);var u=t.length;l>0&&u>l&&(u=l);for(var c=0;c<u;++c){var h,f,d,p,m=t[c].replace(s,\"%20\"),g=m.indexOf(r);g>=0?(h=m.substr(0,g),f=m.substr(g+1)):(h=m,f=\"\"),d=decodeURIComponent(h),p=decodeURIComponent(f),n(o,d)?i(o[d])?o[d].push(p):o[d]=[o[d],p]:o[d]=p}return o};var i=Array.isArray||function(t){return\"[object Array]\"===Object.prototype.toString.call(t)}},{}],472:[function(t,e,r){\"use strict\";function n(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n<t.length;n++)r.push(e(t[n],n));return r}var i=function(t){switch(typeof t){case\"string\":return t;case\"boolean\":return t?\"true\":\"false\";case\"number\":return isFinite(t)?t:\"\";default:return\"\"}};e.exports=function(t,e,r,s){return e=e||\"&\",r=r||\"=\",null===t&&(t=void 0),\"object\"==typeof t?n(o(t),function(o){var s=encodeURIComponent(i(o))+r;return a(t[o])?n(t[o],function(t){return s+encodeURIComponent(i(t))}).join(e):s+encodeURIComponent(i(t[o]))}).join(e):s?encodeURIComponent(i(s))+r+encodeURIComponent(i(t)):\"\"};var a=Array.isArray||function(t){return\"[object Array]\"===Object.prototype.toString.call(t)},o=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}},{}],473:[function(t,e,r){\"use strict\";r.decode=r.parse=t(\"./decode\"),r.encode=r.stringify=t(\"./encode\")},{\"./decode\":471,\"./encode\":472}],474:[function(t,e,r){\"use strict\";function n(t,e,r,o,s){for(r=r||0,o=o||t.length-1,s=s||a;o>r;){if(o-r>600){var l=o-r+1,u=e-r+1,c=Math.log(l),h=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1);n(t,e,Math.max(r,Math.floor(e-u*h/l+f)),Math.min(o,Math.floor(e+(l-u)*h/l+f)),s)}var d=t[e],p=r,m=o;for(i(t,r,e),s(t[o],d)>0&&i(t,r,o);p<m;){for(i(t,p,m),p++,m--;s(t[p],d)<0;)p++;for(;s(t[m],d)>0;)m--}0===s(t[r],d)?i(t,r,m):i(t,++m,o),m<=e&&(r=m+1),e<=m&&(o=m-1)}}function i(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function a(t,e){return t<e?-1:t>e?1:0}e.exports=n},{}],475:[function(t,e,r){\"use strict\";function n(t,e){for(var r=t.length,n=new Array(r),a=0;a<r;++a)n[a]=i(t[a],e[a]);return n}var i=t(\"big-rat/add\");e.exports=n},{\"big-rat/add\":43}],476:[function(t,e,r){\"use strict\";function n(t){for(var e=new Array(t.length),r=0;r<t.length;++r)e[r]=i(t[r]);return e}e.exports=n;var i=t(\"big-rat\")},{\"big-rat\":46}],477:[function(t,e,r){\"use strict\";function n(t,e){for(var r=i(e),n=t.length,o=new Array(n),s=0;s<n;++s)o[s]=a(t[s],r);return o}var i=t(\"big-rat\"),a=t(\"big-rat/mul\");e.exports=n},{\"big-rat\":46,\"big-rat/mul\":55}],478:[function(t,e,r){\"use strict\";function n(t,e){for(var r=t.length,n=new Array(r),a=0;a<r;++a)n[a]=i(t[a],e[a]);return n}var i=t(\"big-rat/sub\");e.exports=n},{\"big-rat/sub\":57}],479:[function(t,e,r){\"use strict\";function n(t){t.sort(a);for(var e=t.length,r=0,n=0;n<e;++n){var s=t[n],l=o(s);if(0!==l){if(r>0){var u=t[r-1];if(0===i(s,u)&&o(u)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}var i=t(\"compare-cell\"),a=t(\"compare-oriented-cell\"),o=t(\"cell-orientation\");e.exports=n},{\"cell-orientation\":78,\"compare-cell\":94,\"compare-oriented-cell\":95}],480:[function(t,e,r){!function(t,n){\"object\"==typeof r&&void 0!==e?e.exports=n():t.createREGL=n()}(this,function(){\"use strict\";function t(t){return\"undefined\"!=typeof btoa?btoa(t):\"base64:\"+t}function e(t){var e=new Error(\"(regl) \"+t);throw console.error(e),e}function r(t,r){t||e(r)}function n(t){return t?\": \"+t:\"\"}function i(t,r,i){t in r||e(\"unknown parameter (\"+t+\")\"+n(i)+\". possible values: \"+Object.keys(r).join())}function a(t,r){Kt(t)||e(\"invalid parameter type\"+n(r)+\". must be a typed array\")}function o(t,r,i){typeof t!==r&&e(\"invalid parameter type\"+n(i)+\". expected \"+r+\", got \"+typeof t)}function s(t,r){t>=0&&(0|t)===t||e(\"invalid parameter type, (\"+t+\")\"+n(r)+\". must be a nonnegative integer\")}function l(t,r,i){r.indexOf(t)<0&&e(\"invalid value\"+n(i)+\". must be one of: \"+r)}function u(t){Object.keys(t).forEach(function(t){te.indexOf(t)<0&&e('invalid regl constructor argument \"'+t+'\". must be one of '+te)})}function c(t,e){for(t+=\"\";t.length<e;)t=\" \"+t;return t}function h(){this.name=\"unknown\",this.lines=[],this.index={},this.hasErrors=!1}function f(t,e){this.number=t,this.line=e,this.errors=[]}function d(t,e,r){this.file=t,this.line=e,this.message=r}function p(){var t=new Error,e=(t.stack||t).toString(),r=/compileProcedure.*\\n\\s*at.*\\((.*)\\)/.exec(e);if(r)return r[1];var n=/compileProcedure.*\\n\\s*at\\s+(.*)(\\n|$)/.exec(e);return n?n[1]:\"unknown\"}function m(){var t=new Error,e=(t.stack||t).toString(),r=/at REGLCommand.*\\n\\s+at.*\\((.*)\\)/.exec(e);if(r)return r[1];var n=/at REGLCommand.*\\n\\s+at\\s+(.*)\\n/.exec(e);return n?n[1]:\"unknown\"}function g(e,r){var n=e.split(\"\\n\"),i=1,a=0,o={unknown:new h,0:new h};o.unknown.name=o[0].name=r||p(),o.unknown.lines.push(new f(0,\"\"));for(var s=0;s<n.length;++s){var l=n[s],u=/^\\s*\\#\\s*(\\w+)\\s+(.+)\\s*$/.exec(l);if(u)switch(u[1]){case\"line\":var c=/(\\d+)(\\s+\\d+)?/.exec(u[2]);c&&(i=0|c[1],c[2]&&((a=0|c[2])in o||(o[a]=new h)));break;case\"define\":var d=/SHADER_NAME(_B64)?\\s+(.*)$/.exec(u[2]);d&&(o[a].name=d[1]?t(d[2]):d[2])}o[a].lines.push(new f(i++,l))}return Object.keys(o).forEach(function(t){var e=o[t];e.lines.forEach(function(t){e.index[t.number]=t})}),o}function v(t){var e=[];return t.split(\"\\n\").forEach(function(t){if(!(t.length<5)){var r=/^ERROR\\:\\s+(\\d+)\\:(\\d+)\\:\\s*(.*)$/.exec(t);r?e.push(new d(0|r[1],0|r[2],r[3].trim())):t.length>0&&e.push(new d(\"unknown\",0,t))}}),e}function y(t,e){e.forEach(function(e){var r=t[e.file];if(r){var n=r.index[e.line];if(n)return n.errors.push(e),void(r.hasErrors=!0)}t.unknown.hasErrors=!0,t.unknown.lines[0].errors.push(e)})}function b(t,e,n,i,a){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var o=t.getShaderInfoLog(e),s=i===t.FRAGMENT_SHADER?\"fragment\":\"vertex\";T(n,\"string\",s+\" shader source must be a string\",a);var l=g(n,a),u=v(o);y(l,u),Object.keys(l).forEach(function(t){function e(t,e){n.push(t),i.push(e||\"\")}var r=l[t];if(r.hasErrors){var n=[\"\"],i=[\"\"];e(\"file number \"+t+\": \"+r.name+\"\\n\",\"color:red;text-decoration:underline;font-weight:bold\"),r.lines.forEach(function(t){if(t.errors.length>0){e(c(t.number,4)+\"|  \",\"background-color:yellow; font-weight:bold\"),e(t.line+\"\\n\",\"color:red; background-color:yellow; font-weight:bold\");var r=0;t.errors.forEach(function(n){var i=n.message,a=/^\\s*\\'(.*)\\'\\s*\\:\\s*(.*)$/.exec(i);if(a){var o=a[1];switch(i=a[2],o){case\"assign\":o=\"=\"}r=Math.max(t.line.indexOf(o,r),0)}else r=0;e(c(\"| \",6)),e(c(\"^^^\",r+3)+\"\\n\",\"font-weight:bold\"),e(c(\"| \",6)),e(i+\"\\n\",\"font-weight:bold\")}),e(c(\"| \",6)+\"\\n\")}else e(c(t.number,4)+\"|  \"),e(t.line+\"\\n\",\"color:red\")}),\"undefined\"!=typeof document?(i[0]=n.join(\"%c\"),console.log.apply(console,i)):console.log(n.join(\"\"))}}),r.raise(\"Error compiling \"+s+\" shader, \"+l[0].name)}}function x(t,e,n,i,a){if(!t.getProgramParameter(e,t.LINK_STATUS)){var o=t.getProgramInfoLog(e),s=g(n,a),l='Error linking program with vertex shader, \"'+g(i,a)[0].name+'\", and fragment shader \"'+s[0].name+'\"';\"undefined\"!=typeof document?console.log(\"%c\"+l+\"\\n%c\"+o,\"color:red;text-decoration:underline;font-weight:bold\",\"color:red\"):console.log(l+\"\\n\"+o),r.raise(l)}}function _(t){t._commandRef=p()}function w(t,e,r,n){function i(t){return t?n.id(t):0}function a(t,e){Object.keys(e).forEach(function(e){t[n.id(e)]=!0})}_(t),t._fragId=i(t.static.frag),t._vertId=i(t.static.vert);var o=t._uniformSet={};a(o,e.static),a(o,e.dynamic);var s=t._attributeSet={};a(s,r.static),a(s,r.dynamic),t._hasCount=\"count\"in t.static||\"count\"in t.dynamic||\"elements\"in t.static||\"elements\"in t.dynamic}function M(t,r){var n=m();e(t+\" in command \"+(r||p())+(\"unknown\"===n?\"\":\" called from \"+n))}function k(t,e,r){t||M(e,r||p())}function A(t,e,r,i){t in e||M(\"unknown parameter (\"+t+\")\"+n(r)+\". possible values: \"+Object.keys(e).join(),i||p())}function T(t,e,r,i){typeof t!==e&&M(\"invalid parameter type\"+n(r)+\". expected \"+e+\", got \"+typeof t,i||p())}function S(t){t()}function E(t,e,r){t.texture?l(t.texture._texture.internalformat,e,\"unsupported texture format for attachment\"):l(t.renderbuffer._renderbuffer.format,r,\"unsupported renderbuffer format for attachment\")}function L(t,e){return t===ue||t===le||t===ce?2:t===he?4:fe[t]*e}function C(t){return!(t&t-1||!t)}function z(t,e,n){var i,a=e.width,o=e.height,s=e.channels;r(a>0&&a<=n.maxTextureSize&&o>0&&o<=n.maxTextureSize,\"invalid texture shape\"),t.wrapS===ee&&t.wrapT===ee||r(C(a)&&C(o),\"incompatible wrap mode for texture, both width and height must be power of 2\"),1===e.mipmask?1!==a&&1!==o&&r(t.minFilter!==ne&&t.minFilter!==ae&&t.minFilter!==ie&&t.minFilter!==oe,\"min filter requires mipmap\"):(r(C(a)&&C(o),\"texture must be a square power of 2 to support mipmapping\"),r(e.mipmask===(a<<1)-1,\"missing or incomplete mipmap data\")),e.type===se&&(n.extensions.indexOf(\"oes_texture_float_linear\")<0&&r(t.minFilter===re&&t.magFilter===re,\"filter not supported, must enable oes_texture_float_linear\"),r(!t.genMipmaps,\"mipmap generation not supported with float textures\"));var l=e.images;for(i=0;i<16;++i)if(l[i]){var u=a>>i,c=o>>i;r(e.mipmask&1<<i,\"missing mipmap data\");var h=l[i];if(r(h.width===u&&h.height===c,\"invalid shape for mip images\"),r(h.format===e.format&&h.internalformat===e.internalformat&&h.type===e.type,\"incompatible type for mip image\"),h.compressed);else if(h.data){var f=Math.ceil(L(h.type,s)*u/h.unpackAlignment)*h.unpackAlignment;r(h.data.byteLength===f*c,\"invalid data for image, buffer size is inconsistent with image format\")}else h.element||h.copy}else t.genMipmaps||r(0==(e.mipmask&1<<i),\"extra mipmap data\");e.compressed&&r(!t.genMipmaps,\"mipmap generation for compressed images not supported\")}function D(t,e,n,i){var a=t.width,o=t.height,s=t.channels;r(a>0&&a<=i.maxTextureSize&&o>0&&o<=i.maxTextureSize,\"invalid texture shape\"),r(a===o,\"cube map must be square\"),r(e.wrapS===ee&&e.wrapT===ee,\"wrap mode not supported by cube map\");for(var l=0;l<n.length;++l){var u=n[l];r(u.width===a&&u.height===o,\"inconsistent cube map face shape\"),e.genMipmaps&&(r(!u.compressed,\"can not generate mipmap for compressed textures\"),r(1===u.mipmask,\"can not specify mipmaps and generate mipmaps\"));for(var c=u.images,h=0;h<16;++h){var f=c[h];if(f){var d=a>>h,p=o>>h;r(u.mipmask&1<<h,\"missing mipmap data\"),r(f.width===d&&f.height===p,\"invalid shape for mip images\"),r(f.format===t.format&&f.internalformat===t.internalformat&&f.type===t.type,\"incompatible type for mip image\"),f.compressed||(f.data?r(f.data.byteLength===d*p*Math.max(L(f.type,s),f.unpackAlignment),\"invalid data for image, buffer size is inconsistent with image format\"):f.element||f.copy)}}}}function I(t,e){this.id=pe++,this.type=t,this.data=e}function P(t){return t.replace(/\\\\/g,\"\\\\\\\\\").replace(/\"/g,'\\\\\"')}function O(t){if(0===t.length)return[];var e=t.charAt(0),r=t.charAt(t.length-1);if(t.length>1&&e===r&&('\"'===e||\"'\"===e))return['\"'+P(t.substr(1,t.length-2))+'\"'];var n=/\\[(false|true|null|\\d+|'[^']*'|\"[^\"]*\")\\]/.exec(t);if(n)return O(t.substr(0,n.index)).concat(O(n[1])).concat(O(t.substr(n.index+n[0].length)));var i=t.split(\".\");if(1===i.length)return['\"'+P(t)+'\"'];for(var a=[],o=0;o<i.length;++o)a=a.concat(O(i[o]));return a}function j(t){return\"[\"+O(t).join(\"][\")+\"]\"}function R(t,e){return new I(t,j(e+\"\"))}function F(t){return\"function\"==typeof t&&!t._reglType||t instanceof I}function N(t,e){return\"function\"==typeof t?new I(me,t):t}function B(){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]}}}function U(t,e,r){function n(){var e=window.innerWidth,n=window.innerHeight;if(t!==document.body){var i=t.getBoundingClientRect();e=i.right-i.left,n=i.bottom-i.top}a.width=r*e,a.height=r*n,$t(a.style,{width:e+\"px\",height:n+\"px\"})}function i(){window.removeEventListener(\"resize\",n),t.removeChild(a)}var a=document.createElement(\"canvas\");return $t(a.style,{border:0,margin:0,padding:0,top:0,left:0}),t.appendChild(a),t===document.body&&(a.style.position=\"absolute\",$t(t.style,{margin:0,padding:0})),window.addEventListener(\"resize\",n,!1),n(),{canvas:a,onDestroy:i}}function V(t,e){function r(r){try{return t.getContext(r,e)}catch(t){return null}}return r(\"webgl\")||r(\"experimental-webgl\")||r(\"webgl-experimental\")}function H(t){return\"string\"==typeof t.nodeName&&\"function\"==typeof t.appendChild&&\"function\"==typeof t.getBoundingClientRect}function q(t){return\"function\"==typeof t.drawArrays||\"function\"==typeof t.drawElements}function G(t){return\"string\"==typeof t?t.split():(de(Array.isArray(t),\"invalid extension array\"),t)}function Y(t){return\"string\"==typeof t?(de(\"undefined\"!=typeof document,\"not supported outside of DOM\"),document.querySelector(t)):t}function W(t){var e,r,n,i,a=t||{},o={},s=[],l=[],u=\"undefined\"==typeof window?1:window.devicePixelRatio,c=!1,h=function(t){t&&de.raise(t)},f=function(){};if(\"string\"==typeof a?(de(\"undefined\"!=typeof document,\"selector queries only supported in DOM enviroments\"),e=document.querySelector(a),de(e,\"invalid query string for element\")):\"object\"==typeof a?H(a)?e=a:q(a)?n=(i=a).canvas:(de.constructor(a),\"gl\"in a?i=a.gl:\"canvas\"in a?n=Y(a.canvas):\"container\"in a&&(r=Y(a.container)),\"attributes\"in a&&(o=a.attributes,de.type(o,\"object\",\"invalid context attributes\")),\"extensions\"in a&&(s=G(a.extensions)),\"optionalExtensions\"in a&&(l=G(a.optionalExtensions)),\"onDone\"in a&&(de.type(a.onDone,\"function\",\"invalid or missing onDone callback\"),h=a.onDone),\"profile\"in a&&(c=!!a.profile),\"pixelRatio\"in a&&de((u=+a.pixelRatio)>0,\"invalid pixel ratio\")):de.raise(\"invalid arguments to regl\"),e&&(\"canvas\"===e.nodeName.toLowerCase()?n=e:r=e),!i){if(!n){de(\"undefined\"!=typeof document,\"must manually specify webgl context outside of DOM environments\");var d=U(r||document.body,h,u);if(!d)return null;n=d.canvas,f=d.onDestroy}i=V(n,o)}return i?{gl:i,canvas:n,container:r,extensions:s,optionalExtensions:l,pixelRatio:u,profile:c,onDone:h,onDestroy:f}:(f(),h(\"webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org\"),null)}function X(t,e){function r(e){de.type(e,\"string\",\"extension name must be string\");var r,i=e.toLowerCase();try{r=n[i]=t.getExtension(i)}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 new Error(\"(regl): error restoring extension \"+t)})}}}function Z(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)||Kt(t.data))}function J(t,e){for(var r=Array(t),n=0;n<t;++n)r[n]=e(n);return r}function Q(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}function K(t){var e,r;return e=(t>65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,(e|=r)|t>>1}function $(t){var e=Q(t),r=Ee[K(e)>>2];return r.length>0?r.pop():new ArrayBuffer(e)}function tt(t){Ee[K(t.byteLength)>>2].push(t)}function et(t,e){var r=null;switch(t){case _e:r=new Int8Array($(e),0,e);break;case we:r=new Uint8Array($(e),0,e);break;case Me:r=new Int16Array($(2*e),0,e);break;case ke:r=new Uint16Array($(2*e),0,e);break;case Ae:r=new Int32Array($(4*e),0,e);break;case Te:r=new Uint32Array($(4*e),0,e);break;case Se:r=new Float32Array($(4*e),0,e);break;default:return null}return r.length!==e?r.subarray(0,e):r}function rt(t){tt(t.buffer)}function nt(t,e,r){for(var n=0;n<e;++n)r[n]=t[n]}function it(t,e,r,n){for(var i=0,a=0;a<e;++a)for(var o=t[a],s=0;s<r;++s)n[i++]=o[s]}function at(t,e,r,n,i,a){for(var o=a,s=0;s<e;++s)for(var l=t[s],u=0;u<r;++u)for(var c=l[u],h=0;h<n;++h)i[o++]=c[h]}function ot(t,e,r,n,i){for(var a=1,o=r+1;o<e.length;++o)a*=e[o];var s=e[r];if(e.length-r==4){var l=e[r+1],u=e[r+2],c=e[r+3];for(o=0;o<s;++o)at(t[o],l,u,c,n,i),i+=a}else for(o=0;o<s;++o)ot(t[o],e,r+1,n,i),i+=a}function st(t,e,r,n){var i=1;if(e.length)for(var a=0;a<e.length;++a)i*=e[a];else i=0;var o=n||Le.allocType(r,i);switch(e.length){case 0:break;case 1:nt(t,e[0],o);break;case 2:it(t,e[0],e[1],o);break;case 3:at(t,e[0],e[1],e[2],o,0);break;default:ot(t,e,0,o,0)}return o}function lt(t){for(var e=[],r=t;r.length;r=r[0])e.push(r.length);return e}function ut(t){return 0|Qt[Object.prototype.toString.call(t)]}function ct(t,e){for(var r=0;r<e.length;++r)t[r]=e[r]}function ht(t,e,r,n,i,a,o){for(var s=0,l=0;l<r;++l)for(var u=0;u<n;++u)t[s++]=e[i*l+a*u+o]}function ft(t,e,r){function n(e){this.id=h++,this.buffer=t.createBuffer(),this.type=e,this.usage=Oe,this.byteLength=0,this.dimension=1,this.dtype=Re,this.persistentData=null,r.profile&&(this.stats={size:0})}function i(t,e){var r=d.pop();return r||(r=new n(t)),r.bind(),s(r,e,je,0,1,!1),r}function a(t){d.push(t)}function o(e,r,n){e.byteLength=r.byteLength,t.bufferData(e.type,r,n)}function s(t,e,r,n,i,a){var s;if(t.usage=r,Array.isArray(e)){if(t.dtype=n||Fe,e.length>0){var l;if(Array.isArray(e[0])){s=Pe(e);for(var u=1,c=1;c<s.length;++c)u*=s[c];t.dimension=u,o(t,l=Ie(e,s,t.dtype),r),a?t.persistentData=l:Le.freeType(l)}else if(\"number\"==typeof e[0]){t.dimension=i;var h=Le.allocType(t.dtype,e.length);ct(h,e),o(t,h,r),a?t.persistentData=h:Le.freeType(h)}else Kt(e[0])?(t.dimension=e[0].length,t.dtype=n||ut(e[0])||Fe,o(t,l=Ie(e,[e.length,e[0].length],t.dtype),r),a?t.persistentData=l:Le.freeType(l)):de.raise(\"invalid buffer data\")}}else if(Kt(e))t.dtype=n||ut(e),t.dimension=i,o(t,e,r),a&&(t.persistentData=new Uint8Array(new Uint8Array(e.buffer)));else if(Z(e)){s=e.shape;var f=e.stride,d=e.offset,p=0,m=0,g=0,v=0;1===s.length?(p=s[0],m=1,g=f[0],v=0):2===s.length?(p=s[0],m=s[1],g=f[0],v=f[1]):de.raise(\"invalid shape\"),t.dtype=n||ut(e.data)||Fe,t.dimension=m;var y=Le.allocType(t.dtype,p*m);ht(y,e.data,p,m,g,v,d),o(t,y,r),a?t.persistentData=y:Le.freeType(y)}else de.raise(\"invalid buffer data\")}function l(r){e.bufferCount--;var n=r.buffer;de(n,\"buffer must not be deleted already\"),t.deleteBuffer(n),r.buffer=null,delete f[r.id]}function u(i,a,o,u){function c(e){var n=Oe,i=null,a=0,o=0,l=1;return Array.isArray(e)||Kt(e)||Z(e)?i=e:\"number\"==typeof e?a=0|e:e&&(de.type(e,\"object\",\"buffer arguments must be an object, a number or an array\"),\"data\"in e&&(de(null===i||Array.isArray(i)||Kt(i)||Z(i),\"invalid data for buffer\"),i=e.data),\"usage\"in e&&(de.parameter(e.usage,De,\"invalid buffer usage\"),n=De[e.usage]),\"type\"in e&&(de.parameter(e.type,ze,\"invalid buffer type\"),o=ze[e.type]),\"dimension\"in e&&(de.type(e.dimension,\"number\",\"invalid dimension\"),l=0|e.dimension),\"length\"in e&&(de.nni(a,\"buffer length must be a nonnegative integer\"),a=0|e.length)),p.bind(),i?s(p,i,n,o,l,u):(t.bufferData(p.type,a,n),p.dtype=o||Re,p.usage=n,p.dimension=l,p.byteLength=a),r.profile&&(p.stats.size=p.byteLength*Ne[p.dtype]),c}function h(e,r){de(r+e.byteLength<=p.byteLength,\"invalid buffer subdata call, buffer is too small.  Can't write data of size \"+e.byteLength+\" starting from offset \"+r+\" to a buffer of size \"+p.byteLength),t.bufferSubData(p.type,r,e)}function d(t,e){var r,n=0|(e||0);if(p.bind(),Array.isArray(t)){if(t.length>0)if(\"number\"==typeof t[0]){var i=Le.allocType(p.dtype,t.length);ct(i,t),h(i,n),Le.freeType(i)}else if(Array.isArray(t[0])||Kt(t[0])){r=Pe(t);var a=Ie(t,r,p.dtype);h(a,n),Le.freeType(a)}else de.raise(\"invalid buffer data\")}else if(Kt(t))h(t,n);else if(Z(t)){r=t.shape;var o=t.stride,s=0,l=0,u=0,f=0;1===r.length?(s=r[0],l=1,u=o[0],f=0):2===r.length?(s=r[0],l=r[1],u=o[0],f=o[1]):de.raise(\"invalid shape\");var d=Array.isArray(t.data)?p.dtype:ut(t.data),m=Le.allocType(d,s*l);ht(m,t.data,s,l,u,f,t.offset),h(m,n),Le.freeType(m)}else de.raise(\"invalid data for buffer subdata\");return c}e.bufferCount++;var p=new n(a);return f[p.id]=p,o||c(i),c._reglType=\"buffer\",c._buffer=p,c.subdata=d,r.profile&&(c.stats=p.stats),c.destroy=function(){l(p)},c}function c(){xe(f).forEach(function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)})}var h=0,f={};n.prototype.bind=function(){t.bindBuffer(this.type,this.buffer)},n.prototype.destroy=function(){l(this)};var d=[];return r.profile&&(e.getTotalBufferSize=function(){var t=0;return Object.keys(f).forEach(function(e){t+=f[e].stats.size}),t}),{create:u,createStream:i,destroyStream:a,clear:function(){xe(f).forEach(l),d.forEach(l)},getBuffer:function(t){return t&&t._buffer instanceof n?t._buffer:null},restore:c,_initBuffer:s}}function dt(t,e,r,n){function i(t){this.id=h++,c[this.id]=this,this.buffer=t,this.primType=He,this.vertCount=0,this.type=0}function a(t){var e=d.pop();return e||(e=new i(r.create(null,Je,!0,!1)._buffer)),s(e,t,Qe,-1,-1,0,0),e}function o(t){d.push(t)}function s(n,i,a,o,s,l,u){if(n.buffer.bind(),i){var c=u;u||Kt(i)&&(!Z(i)||Kt(i.data))||(c=e.oes_element_index_uint?Ze:We),r._initBuffer(n.buffer,i,a,c,3)}else t.bufferData(Je,l,a),n.buffer.dtype=h||Ge,n.buffer.usage=a,n.buffer.dimension=3,n.buffer.byteLength=l;var h=u;if(!u){switch(n.buffer.dtype){case Ge:case qe:h=Ge;break;case We:case Ye:h=We;break;case Ze:case Xe:h=Ze;break;default:de.raise(\"unsupported type for element array\")}n.buffer.dtype=h}n.type=h,de(h!==Ze||!!e.oes_element_index_uint,\"32 bit element buffers not supported, enable oes_element_index_uint first\");var f=s;f<0&&(f=n.buffer.byteLength,h===We?f>>=1:h===Ze&&(f>>=2)),n.vertCount=f;var d=o;if(o<0){d=He;var p=n.buffer.dimension;1===p&&(d=Ue),2===p&&(d=Ve),3===p&&(d=He)}n.primType=d}function l(t){n.elementsCount--,de(null!==t.buffer,\"must not double destroy elements\"),delete c[t.id],t.buffer.destroy(),t.buffer=null}function u(t,e){function a(t){if(t)if(\"number\"==typeof t)o(t),u.primType=He,u.vertCount=0|t,u.type=Ge;else{var e=null,r=Ke,n=-1,i=-1,l=0,c=0;Array.isArray(t)||Kt(t)||Z(t)?e=t:(de.type(t,\"object\",\"invalid arguments for elements\"),\"data\"in t&&(e=t.data,de(Array.isArray(e)||Kt(e)||Z(e),\"invalid data for element buffer\")),\"usage\"in t&&(de.parameter(t.usage,De,\"invalid element buffer usage\"),r=De[t.usage]),\"primitive\"in t&&(de.parameter(t.primitive,Be,\"invalid element buffer primitive\"),n=Be[t.primitive]),\"count\"in t&&(de(\"number\"==typeof t.count&&t.count>=0,\"invalid vertex count for elements\"),i=0|t.count),\"type\"in t&&(de.parameter(t.type,f,\"invalid buffer type\"),c=f[t.type]),\"length\"in t?l=0|t.length:(l=i,c===We||c===Ye?l*=2:c!==Ze&&c!==Xe||(l*=4))),s(u,e,r,n,i,l,c)}else o(),u.primType=He,u.vertCount=0,u.type=Ge;return a}var o=r.create(null,Je,!0),u=new i(o._buffer);return n.elementsCount++,a(t),a._reglType=\"elements\",a._elements=u,a.subdata=function(t,e){return o.subdata(t,e),a},a.destroy=function(){l(u)},a}var c={},h=0,f={uint8:Ge,uint16:We};e.oes_element_index_uint&&(f.uint32=Ze),i.prototype.bind=function(){this.buffer.bind()};var d=[];return{create:u,createStream:a,destroyStream:o,getElements:function(t){return\"function\"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){xe(c).forEach(l)}}}function pt(t){for(var e=Le.allocType(er,t.length),r=0;r<t.length;++r)if(isNaN(t[r]))e[r]=65535;else if(t[r]===1/0)e[r]=31744;else if(t[r]===-1/0)e[r]=64512;else{$e[0]=t[r];var n=tr[0],i=n>>>31<<15,a=(n<<1>>>24)-127,o=n>>13&1023;if(a<-24)e[r]=i;else if(a<-14){var s=-14-a;e[r]=i+(o+1024>>s)}else e[r]=a>15?i+31744:i+(a+15<<10)+o}return e}function mt(t){return Array.isArray(t)||Kt(t)}function gt(t){return\"[object \"+t+\"]\"}function vt(t){return Array.isArray(t)&&(0===t.length||\"number\"==typeof t[0])}function yt(t){return!!Array.isArray(t)&&!(0===t.length||!mt(t[0]))}function bt(t){return Object.prototype.toString.call(t)}function xt(t){return bt(t)===dn}function _t(t){return bt(t)===pn}function wt(t){return bt(t)===mn}function Mt(t){return bt(t)===gn}function kt(t){if(!t)return!1;var e=bt(t);return vn.indexOf(e)>=0||(vt(t)||yt(t)||Z(t))}function At(t){return 0|Qt[Object.prototype.toString.call(t)]}function Tt(t,e){var r=e.length;switch(t.type){case Or:case jr:case Rr:case Fr:var n=Le.allocType(t.type,r);n.set(e),t.data=n;break;case wr:t.data=pt(e);break;default:de.raise(\"unsupported texture type, must specify a typed array\")}}function St(t,e){return Le.allocType(t.type===wr?Fr:t.type,e)}function Et(t,e){t.type===wr?(t.data=pt(e),Le.freeType(e)):t.data=e}function Lt(t,e,r,n,i,a){for(var o=t.width,s=t.height,l=t.channels,u=St(t,o*s*l),c=0,h=0;h<s;++h)for(var f=0;f<o;++f)for(var d=0;d<l;++d)u[c++]=e[r*f+n*h+i*d+a];Et(t,u)}function Ct(t,e,r,n,i,a){var o;if(o=void 0!==bn[t]?bn[t]:fn[t]*yn[e],a&&(o*=6),i){for(var s=0,l=r;l>=1;)s+=o*l*l,l/=2;return s}return o*r*n}function zt(t,e,r,n,i,a,o){function s(){this.internalformat=or,this.format=or,this.type=Or,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=0,this.width=0,this.height=0,this.channels=0}function l(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,n){if(\"object\"==typeof n&&n){if(\"premultiplyAlpha\"in n&&(de.type(n.premultiplyAlpha,\"boolean\",\"invalid premultiplyAlpha\"),t.premultiplyAlpha=n.premultiplyAlpha),\"flipY\"in n&&(de.type(n.flipY,\"boolean\",\"invalid texture flip\"),t.flipY=n.flipY),\"alignment\"in n&&(de.oneOf(n.alignment,[1,2,4,8],\"invalid texture unpack alignment\"),t.unpackAlignment=n.alignment),\"colorSpace\"in n&&(de.parameter(n.colorSpace,F,\"invalid colorSpace\"),t.colorSpace=F[n.colorSpace]),\"type\"in n){var i=n.type;de(e.oes_texture_float||!(\"float\"===i||\"float32\"===i),\"you must enable the OES_texture_float extension in order to use floating point textures.\"),de(e.oes_texture_half_float||!(\"half float\"===i||\"float16\"===i),\"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures.\"),de(e.webgl_depth_texture||!(\"uint16\"===i||\"uint32\"===i||\"depth stencil\"===i),\"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures.\"),de.parameter(i,N,\"invalid texture type\"),t.type=N[i]}var a=t.width,o=t.height,s=t.channels,l=!1;\"shape\"in n?(de(Array.isArray(n.shape)&&n.shape.length>=2,\"shape must be an array\"),a=n.shape[0],o=n.shape[1],3===n.shape.length&&(s=n.shape[2],de(s>0&&s<=4,\"invalid number of channels\"),l=!0),de(a>=0&&a<=r.maxTextureSize,\"invalid width\"),de(o>=0&&o<=r.maxTextureSize,\"invalid height\")):(\"radius\"in n&&(a=o=n.radius,de(a>=0&&a<=r.maxTextureSize,\"invalid radius\")),\"width\"in n&&(a=n.width,de(a>=0&&a<=r.maxTextureSize,\"invalid width\")),\"height\"in n&&(o=n.height,de(o>=0&&o<=r.maxTextureSize,\"invalid height\")),\"channels\"in n&&(s=n.channels,de(s>0&&s<=4,\"invalid number of channels\"),l=!0)),t.width=0|a,t.height=0|o,t.channels=0|s;var u=!1;if(\"format\"in n){var c=n.format;de(e.webgl_depth_texture||!(\"depth\"===c||\"depth stencil\"===c),\"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures.\"),de.parameter(c,B,\"invalid texture format\");var h=t.internalformat=B[c];t.format=J[h],c in N&&(\"type\"in n||(t.type=N[c])),c in U&&(t.compressed=!0),u=!0}!l&&u?t.channels=fn[t.format]:l&&!u?t.channels!==hn[t.format]&&(t.format=t.internalformat=hn[t.channels]):u&&l&&de(t.channels===fn[t.format],\"number of channels inconsistent with specified format\")}}function c(e){t.pixelStorei(an,e.flipY),t.pixelStorei(on,e.premultiplyAlpha),t.pixelStorei(sn,e.colorSpace),t.pixelStorei(nn,e.unpackAlignment)}function h(){s.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function f(t,e){var n=null;if(kt(e)?n=e:e&&(de.type(e,\"object\",\"invalid pixel data type\"),u(t,e),\"x\"in e&&(t.xOffset=0|e.x),\"y\"in e&&(t.yOffset=0|e.y),kt(e.data)&&(n=e.data)),de(!t.compressed||n instanceof Uint8Array,\"compressed texture data must be stored in a uint8array\"),e.copy){de(!n,\"can not specify copy and data field for the same texture\");var a=i.viewportWidth,o=i.viewportHeight;t.width=t.width||a-t.xOffset,t.height=t.height||o-t.yOffset,t.needsCopy=!0,de(t.xOffset>=0&&t.xOffset<a&&t.yOffset>=0&&t.yOffset<o&&t.width>0&&t.width<=a&&t.height>0&&t.height<=o,\"copy texture read out of bounds\")}else if(n){if(Kt(n))t.channels=t.channels||4,t.data=n,\"type\"in e||t.type!==Or||(t.type=At(n));else if(vt(n))t.channels=t.channels||4,Tt(t,n),t.alignment=1,t.needsFree=!0;else if(Z(n)){var s=n.data;Array.isArray(s)||t.type!==Or||(t.type=At(s));var l,c,h,f,d,p,m=n.shape,g=n.stride;3===m.length?(h=m[2],p=g[2]):(de(2===m.length,\"invalid ndarray pixel data, must be 2 or 3D\"),h=1,p=1),l=m[0],c=m[1],f=g[0],d=g[1],t.alignment=1,t.width=l,t.height=c,t.channels=h,t.format=t.internalformat=hn[h],t.needsFree=!0,Lt(t,s,f,d,p,n.offset)}else if(xt(n)||_t(n))xt(n)?t.element=n:t.element=n.canvas,t.width=t.element.width,t.height=t.element.height,t.channels=4;else if(wt(n))t.element=n,t.width=n.naturalWidth,t.height=n.naturalHeight,t.channels=4;else if(Mt(n))t.element=n,t.width=n.videoWidth,t.height=n.videoHeight,t.channels=4;else if(yt(n)){var v=t.width||n[0].length,y=t.height||n.length,b=t.channels;b=mt(n[0][0])?b||n[0][0].length:b||1;for(var x=Ce.shape(n),_=1,w=0;w<x.length;++w)_*=x[w];var M=St(t,_);Ce.flatten(n,x,\"\",M),Et(t,M),t.alignment=1,t.width=v,t.height=y,t.channels=b,t.format=t.internalformat=hn[b],t.needsFree=!0}}else t.width=t.width||1,t.height=t.height||1,t.channels=t.channels||4;t.type===Fr?de(r.extensions.indexOf(\"oes_texture_float\")>=0,\"oes_texture_float extension not enabled\"):t.type===wr&&de(r.extensions.indexOf(\"oes_texture_half_float\")>=0,\"oes_texture_half_float extension not enabled\")}function d(e,r,i){var a=e.element,o=e.data,s=e.internalformat,l=e.format,u=e.type,h=e.width,f=e.height;c(e),a?t.texImage2D(r,i,l,l,u,a):e.compressed?t.compressedTexImage2D(r,i,s,h,f,0,o):e.needsCopy?(n(),t.copyTexImage2D(r,i,l,e.xOffset,e.yOffset,h,f,0)):t.texImage2D(r,i,l,h,f,0,l,u,o)}function p(e,r,i,a,o){var s=e.element,l=e.data,u=e.internalformat,h=e.format,f=e.type,d=e.width,p=e.height;c(e),s?t.texSubImage2D(r,o,i,a,h,f,s):e.compressed?t.compressedTexSubImage2D(r,o,i,a,u,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,h,f,l)}function m(){return Q.pop()||new h}function g(t){t.needsFree&&Le.freeType(t.data),h.call(t),Q.push(t)}function v(){s.call(this),this.genMipmaps=!1,this.mipmapHint=$r,this.mipmask=0,this.images=Array(16)}function y(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 b(t,e){var r=null;if(kt(e))l(r=t.images[0]=m(),t),f(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)l(r=t.images[i]=m(),t),r.width>>=i,r.height>>=i,f(r,n[i]),t.mipmask|=1<<i;else l(r=t.images[0]=m(),t),f(r,e),t.mipmask=1;l(t,t.images[0]),(t.compressed&&t.internalformat===Mr||t.internalformat===kr||t.internalformat===Ar||t.internalformat===Tr)&&de(t.width%4==0&&t.height%4==0,\"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4\")}function x(t,e){for(var r=t.images,n=0;n<r.length;++n){if(!r[n])return;d(r[n],e,n)}}function _(){var t=K.pop()||new v;s.call(t),t.mipmask=0;for(var e=0;e<16;++e)t.images[e]=null;return t}function w(t){for(var e=t.images,r=0;r<e.length;++r)e[r]&&g(e[r]),e[r]=null;K.push(t)}function M(){this.minFilter=Yr,this.magFilter=Yr,this.wrapS=Vr,this.wrapT=Vr,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=$r}function k(t,e){if(\"min\"in e){var n=e.min;de.parameter(n,R),t.minFilter=R[n],cn.indexOf(t.minFilter)>=0&&(t.genMipmaps=!0)}if(\"mag\"in e){var i=e.mag;de.parameter(i,j),t.magFilter=j[i]}var a=t.wrapS,o=t.wrapT;if(\"wrap\"in e){var s=e.wrap;\"string\"==typeof s?(de.parameter(s,O),a=o=O[s]):Array.isArray(s)&&(de.parameter(s[0],O),de.parameter(s[1],O),a=O[s[0]],o=O[s[1]])}else{if(\"wrapS\"in e){var l=e.wrapS;de.parameter(l,O),a=O[l]}if(\"wrapT\"in e){var u=e.wrapT;de.parameter(u,O),o=O[u]}}if(t.wrapS=a,t.wrapT=o,\"anisotropic\"in e){var c=e.anisotropic;de(\"number\"==typeof c&&c>=1&&c<=r.maxAnisotropic,\"aniso samples must be between 1 and \"),t.anisotropic=e.anisotropic}if(\"mipmap\"in e){var h=!1;switch(typeof e.mipmap){case\"string\":de.parameter(e.mipmap,P,\"invalid mipmap hint\"),t.mipmapHint=P[e.mipmap],t.genMipmaps=!0,h=!0;break;case\"boolean\":h=t.genMipmaps=e.mipmap;break;case\"object\":de(Array.isArray(e.mipmap),\"invalid mipmap type\"),t.genMipmaps=!1,h=!0;break;default:de.raise(\"invalid mipmap type\")}!h||\"min\"in e||(t.minFilter=Xr)}}function A(r,n){t.texParameteri(n,Gr,r.minFilter),t.texParameteri(n,qr,r.magFilter),t.texParameteri(n,Nr,r.wrapS),t.texParameteri(n,Br,r.wrapT),e.ext_texture_filter_anisotropic&&t.texParameteri(n,rn,r.anisotropic),r.genMipmaps&&(t.hint(Kr,r.mipmapHint),t.generateMipmap(n))}function T(e){s.call(this),this.mipmask=0,this.internalformat=or,this.id=$++,this.refCount=1,this.target=e,this.texture=t.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new M,o.profile&&(this.stats={size:0})}function S(e){t.activeTexture(un),t.bindTexture(e.target,e.texture)}function E(){var e=rt[0];e?t.bindTexture(e.target,e.texture):t.bindTexture(nr,null)}function L(e){var r=e.texture;de(r,\"must not double destroy texture\");var n=e.unit,i=e.target;n>=0&&(t.activeTexture(un+n),t.bindTexture(i,null),rt[n]=null),t.deleteTexture(r),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete tt[e.id],a.textureCount--}function C(e,n){function i(t,e){var n=c.texInfo;M.call(n);var a=_();return\"number\"==typeof t?\"number\"==typeof e?y(a,0|t,0|e):y(a,0|t,0|t):t?(de.type(t,\"object\",\"invalid arguments to regl.texture\"),k(n,t),b(a,t)):y(a,1,1),n.genMipmaps&&(a.mipmask=(a.width<<1)-1),c.mipmask=a.mipmask,l(c,a),de.texture2D(n,a,r),c.internalformat=a.internalformat,i.width=a.width,i.height=a.height,S(c),x(a,nr),A(n,nr),E(),w(a),o.profile&&(c.stats.size=Ct(c.internalformat,c.type,a.width,a.height,n.genMipmaps,!1)),i.format=q[c.internalformat],i.type=G[c.type],i.mag=Y[n.magFilter],i.min=W[n.minFilter],i.wrapS=X[n.wrapS],i.wrapT=X[n.wrapT],i}function s(t,e,r,n){de(!!t,\"must specify image data\");var a=0|e,o=0|r,s=0|n,u=m();return l(u,c),u.width=0,u.height=0,f(u,t),u.width=u.width||(c.width>>s)-a,u.height=u.height||(c.height>>s)-o,de(c.type===u.type&&c.format===u.format&&c.internalformat===u.internalformat,\"incompatible format for texture.subimage\"),de(a>=0&&o>=0&&a+u.width<=c.width&&o+u.height<=c.height,\"texture.subimage write out of bounds\"),de(c.mipmask&1<<s,\"missing mipmap data\"),de(u.data||u.element||u.needsCopy,\"missing image data\"),S(c),p(u,nr,a,o,s),E(),g(u),i}function u(e,r){var n=0|e,a=0|r||n;if(n===c.width&&a===c.height)return i;i.width=c.width=n,i.height=c.height=a,S(c);for(var s=0;c.mipmask>>s;++s)t.texImage2D(nr,s,c.format,n>>s,a>>s,0,c.format,c.type,null);return E(),o.profile&&(c.stats.size=Ct(c.internalformat,c.type,n,a,!1,!1)),i}var c=new T(nr);return tt[c.id]=c,a.textureCount++,i(e,n),i.subimage=s,i.resize=u,i._reglType=\"texture2d\",i._texture=c,o.profile&&(i.stats=c.stats),i.destroy=function(){c.decRef()},i}function z(e,n,i,s,c,h){function d(t,e,n,i,a,s){var c,h=C.texInfo;for(M.call(h),c=0;c<6;++c)z[c]=_();if(\"number\"!=typeof t&&t)if(\"object\"==typeof t)if(e)b(z[0],t),b(z[1],e),b(z[2],n),b(z[3],i),b(z[4],a),b(z[5],s);else if(k(h,t),u(C,t),\"faces\"in t){var f=t.faces;for(de(Array.isArray(f)&&6===f.length,\"cube faces must be a length 6 array\"),c=0;c<6;++c)de(\"object\"==typeof f[c]&&!!f[c],\"invalid input for cube map face\"),l(z[c],C),b(z[c],f[c])}else for(c=0;c<6;++c)b(z[c],t);else de.raise(\"invalid arguments to cube map\");else{var p=0|t||1;for(c=0;c<6;++c)y(z[c],p,p)}for(l(C,z[0]),h.genMipmaps?C.mipmask=(z[0].width<<1)-1:C.mipmask=z[0].mipmask,de.textureCube(C,h,z,r),C.internalformat=z[0].internalformat,d.width=z[0].width,d.height=z[0].height,S(C),c=0;c<6;++c)x(z[c],ar+c);for(A(h,ir),E(),o.profile&&(C.stats.size=Ct(C.internalformat,C.type,d.width,d.height,h.genMipmaps,!0)),d.format=q[C.internalformat],d.type=G[C.type],d.mag=Y[h.magFilter],d.min=W[h.minFilter],d.wrapS=X[h.wrapS],d.wrapT=X[h.wrapT],c=0;c<6;++c)w(z[c]);return d}function v(t,e,r,n,i){de(!!e,\"must specify image data\"),de(\"number\"==typeof t&&t===(0|t)&&t>=0&&t<6,\"invalid face\");var a=0|r,o=0|n,s=0|i,u=m();return l(u,C),u.width=0,u.height=0,f(u,e),u.width=u.width||(C.width>>s)-a,u.height=u.height||(C.height>>s)-o,de(C.type===u.type&&C.format===u.format&&C.internalformat===u.internalformat,\"incompatible format for texture.subimage\"),de(a>=0&&o>=0&&a+u.width<=C.width&&o+u.height<=C.height,\"texture.subimage write out of bounds\"),de(C.mipmask&1<<s,\"missing mipmap data\"),de(u.data||u.element||u.needsCopy,\"missing image data\"),S(C),p(u,ar+t,a,o,s),E(),g(u),d}function L(e){var r=0|e;if(r!==C.width){d.width=C.width=r,d.height=C.height=r,S(C);for(var n=0;n<6;++n)for(var i=0;C.mipmask>>i;++i)t.texImage2D(ar+n,i,C.format,r>>i,r>>i,0,C.format,C.type,null);return E(),o.profile&&(C.stats.size=Ct(C.internalformat,C.type,d.width,d.height,!1,!0)),d}}var C=new T(ir);tt[C.id]=C,a.cubeCount++;var z=new Array(6);return d(e,n,i,s,c,h),d.subimage=v,d.resize=L,d._reglType=\"textureCube\",d._texture=C,o.profile&&(d.stats=C.stats),d.destroy=function(){C.decRef()},d}function D(){for(var e=0;e<et;++e)t.activeTexture(un+e),t.bindTexture(nr,null),rt[e]=null;xe(tt).forEach(L),a.cubeCount=0,a.textureCount=0}function I(){xe(tt).forEach(function(e){e.texture=t.createTexture(),t.bindTexture(e.target,e.texture);for(var r=0;r<32;++r)if(0!=(e.mipmask&1<<r))if(e.target===nr)t.texImage2D(nr,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;n<6;++n)t.texImage2D(ar+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);A(e.texInfo,e.target)})}var P={\"don't care\":$r,\"dont care\":$r,nice:en,fast:tn},O={repeat:Ur,clamp:Vr,mirror:Hr},j={nearest:Yr,linear:Wr},R=$t({mipmap:Qr,\"nearest mipmap nearest\":Xr,\"linear mipmap nearest\":Zr,\"nearest mipmap linear\":Jr,\"linear mipmap linear\":Qr},j),F={none:0,browser:ln},N={uint8:Or,rgba4:pr,rgb565:gr,\"rgb5 a1\":mr},B={alpha:sr,luminance:ur,\"luminance alpha\":cr,rgb:lr,rgba:or,rgba4:hr,\"rgb5 a1\":fr,rgb565:dr},U={};e.ext_srgb&&(B.srgb=xr,B.srgba=_r),e.oes_texture_float&&(N.float32=N.float=Fr),e.oes_texture_half_float&&(N.float16=N[\"half float\"]=wr),e.webgl_depth_texture&&($t(B,{depth:yr,\"depth stencil\":br}),$t(N,{uint16:jr,uint32:Rr,\"depth stencil\":vr})),e.webgl_compressed_texture_s3tc&&$t(U,{\"rgb s3tc dxt1\":Mr,\"rgba s3tc dxt1\":kr,\"rgba s3tc dxt3\":Ar,\"rgba s3tc dxt5\":Tr}),e.webgl_compressed_texture_atc&&$t(U,{\"rgb atc\":Sr,\"rgba atc explicit alpha\":Er,\"rgba atc interpolated alpha\":Lr}),e.webgl_compressed_texture_pvrtc&&$t(U,{\"rgb pvrtc 4bppv1\":Cr,\"rgb pvrtc 2bppv1\":zr,\"rgba pvrtc 4bppv1\":Dr,\"rgba pvrtc 2bppv1\":Ir}),e.webgl_compressed_texture_etc1&&(U[\"rgb etc1\"]=Pr);var V=Array.prototype.slice.call(t.getParameter(rr));Object.keys(U).forEach(function(t){var e=U[t];V.indexOf(e)>=0&&(B[t]=e)});var H=Object.keys(B);r.textureFormats=H;var q=[];Object.keys(B).forEach(function(t){var e=B[t];q[e]=t});var G=[];Object.keys(N).forEach(function(t){var e=N[t];G[e]=t});var Y=[];Object.keys(j).forEach(function(t){var e=j[t];Y[e]=t});var W=[];Object.keys(R).forEach(function(t){var e=R[t];W[e]=t});var X=[];Object.keys(O).forEach(function(t){var e=O[t];X[e]=t});var J=H.reduce(function(t,e){var r=B[e];return r===ur||r===sr||r===ur||r===cr||r===yr||r===br?t[r]=r:r===fr||e.indexOf(\"rgba\")>=0?t[r]=or:t[r]=lr,t},{}),Q=[],K=[],$=0,tt={},et=r.maxTextureUnits,rt=Array(et).map(function(){return null});return $t(T.prototype,{bind:function(){var e=this;e.bindCount+=1;var r=e.unit;if(r<0){for(var n=0;n<et;++n){var i=rt[n];if(i){if(i.bindCount>0)continue;i.unit=-1}rt[n]=e,r=n;break}r>=et&&de.raise(\"insufficient number of texture units\"),o.profile&&a.maxTextureUnits<r+1&&(a.maxTextureUnits=r+1),e.unit=r,t.activeTexture(un+r),t.bindTexture(e.target,e.texture)}return r},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&L(this)}}),o.profile&&(a.getTotalTextureSize=function(){var t=0;return Object.keys(tt).forEach(function(e){t+=tt[e].stats.size}),t}),{create2D:C,createCube:z,clear:D,getTexture:function(t){return null},restore:I}}function Dt(t,e,r){return wn[t]*e*r}function It(t,e,r,n,i,a){function o(t,e,r){this.target=t,this.texture=e,this.renderbuffer=r;var n=0,i=0;e?(n=e.width,i=e.height):r&&(n=r.width,i=r.height),this.width=n,this.height=i}function s(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function l(t,e,r){if(t)if(t.texture){var n=t.texture._texture,i=Math.max(1,n.width),a=Math.max(1,n.height);de(i===e&&a===r,\"inconsistent width/height for supplied texture\"),n.refCount+=1}else{var o=t.renderbuffer._renderbuffer;de(o.width===e&&o.height===r,\"inconsistent width/height for renderbuffer\"),o.refCount+=1}}function u(e,r){r&&(r.texture?t.framebufferTexture2D(kn,e,r.target,r.texture._texture.texture,0):t.framebufferRenderbuffer(kn,e,An,r.renderbuffer._renderbuffer.renderbuffer))}function c(t){var e=Tn,r=null,n=null,i=t;\"object\"==typeof t&&(i=t.data,\"target\"in t&&(e=0|t.target)),de.type(i,\"function\",\"invalid attachment data\");var a=i._reglType;return\"texture2d\"===a?(r=i,de(e===Tn)):\"textureCube\"===a?(r=i,de(e>=Sn&&e<Sn+6,\"invalid cube map target\")):\"renderbuffer\"===a?(n=i,e=An):de.raise(\"invalid regl object for attachment\"),new o(e,r,n)}function h(t,e,r,a,s){if(r){var l=n.create2D({width:t,height:e,format:a,type:s});return l._texture.refCount=0,new o(Tn,l,null)}var u=i.create({width:t,height:e,format:a});return u._renderbuffer.refCount=0,new o(An,null,u)}function f(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=A++,T[this.id]=this,this.framebuffer=t.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function m(t){t.colorAttachments.forEach(s),s(t.depthAttachment),s(t.stencilAttachment),s(t.depthStencilAttachment)}function g(e){var r=e.framebuffer;de(r,\"must not double destroy framebuffer\"),t.deleteFramebuffer(r),e.framebuffer=null,a.framebufferCount--,delete T[e.id]}function v(e){var n;t.bindFramebuffer(kn,e.framebuffer);var i=e.colorAttachments;for(n=0;n<i.length;++n)u(En+n,i[n]);for(n=i.length;n<r.maxColorAttachments;++n)t.framebufferTexture2D(kn,En+n,Tn,null,0);t.framebufferTexture2D(kn,zn,Tn,null,0),t.framebufferTexture2D(kn,Ln,Tn,null,0),t.framebufferTexture2D(kn,Cn,Tn,null,0),u(Ln,e.depthAttachment),u(Cn,e.stencilAttachment),u(zn,e.depthStencilAttachment);var a=t.checkFramebufferStatus(kn);a!==Dn&&de.raise(\"framebuffer configuration not supported, status = \"+Un[a]),t.bindFramebuffer(kn,_.next),_.cur=_.next,t.getError()}function y(t,n){function i(t,n){var a;de(_.next!==s,\"can not update framebuffer which is currently in use\");var o=e.webgl_draw_buffers,u=0,d=0,p=!0,g=!0,y=null,b=!0,x=\"rgba\",A=\"uint8\",T=1,S=null,E=null,L=null,C=!1;if(\"number\"==typeof t)u=0|t,d=0|n||u;else if(t){de.type(t,\"object\",\"invalid arguments for framebuffer\");var z=t;if(\"shape\"in z){var D=z.shape;de(Array.isArray(D)&&D.length>=2,\"invalid shape for framebuffer\"),u=D[0],d=D[1]}else\"radius\"in z&&(u=d=z.radius),\"width\"in z&&(u=z.width),\"height\"in z&&(d=z.height);(\"color\"in z||\"colors\"in z)&&(y=z.color||z.colors,Array.isArray(y)&&de(1===y.length||o,\"multiple render targets not supported\")),y||(\"colorCount\"in z&&(T=0|z.colorCount,de(T>0,\"invalid color buffer count\")),\"colorTexture\"in z&&(b=!!z.colorTexture,x=\"rgba4\"),\"colorType\"in z&&(A=z.colorType,b?(de(e.oes_texture_float||!(\"float\"===A||\"float32\"===A),\"you must enable OES_texture_float in order to use floating point framebuffer objects\"),de(e.oes_texture_half_float||!(\"half float\"===A||\"float16\"===A),\"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects\")):\"half float\"===A||\"float16\"===A?(de(e.ext_color_buffer_half_float,\"you must enable EXT_color_buffer_half_float to use 16-bit render buffers\"),x=\"rgba16f\"):\"float\"!==A&&\"float32\"!==A||(de(e.webgl_color_buffer_float,\"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers\"),x=\"rgba32f\"),de.oneOf(A,k,\"invalid color type\")),\"colorFormat\"in z&&(x=z.colorFormat,w.indexOf(x)>=0?b=!0:M.indexOf(x)>=0?b=!1:b?de.oneOf(z.colorFormat,w,\"invalid color format for texture\"):de.oneOf(z.colorFormat,M,\"invalid color format for renderbuffer\"))),(\"depthTexture\"in z||\"depthStencilTexture\"in z)&&(C=!(!z.depthTexture&&!z.depthStencilTexture),de(!C||e.webgl_depth_texture,\"webgl_depth_texture extension not supported\")),\"depth\"in z&&(\"boolean\"==typeof z.depth?p=z.depth:(S=z.depth,g=!1)),\"stencil\"in z&&(\"boolean\"==typeof z.stencil?g=z.stencil:(E=z.stencil,p=!1)),\"depthStencil\"in z&&(\"boolean\"==typeof z.depthStencil?p=g=z.depthStencil:(L=z.depthStencil,p=!1,g=!1))}else u=d=1;var I=null,P=null,O=null,j=null;if(Array.isArray(y))I=y.map(c);else if(y)I=[c(y)];else for(I=new Array(T),a=0;a<T;++a)I[a]=h(u,d,b,x,A);de(e.webgl_draw_buffers||I.length<=1,\"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers.\"),de(I.length<=r.maxColorAttachments,\"too many color attachments, not supported\"),u=u||I[0].width,d=d||I[0].height,S?P=c(S):p&&!g&&(P=h(u,d,C,\"depth\",\"uint32\")),E?O=c(E):g&&!p&&(O=h(u,d,!1,\"stencil\",\"uint8\")),L?j=c(L):!S&&!E&&g&&p&&(j=h(u,d,C,\"depth stencil\",\"depth stencil\")),de(!!S+!!E+!!L<=1,\"invalid framebuffer configuration, can specify exactly one depth/stencil attachment\");var R=null;for(a=0;a<I.length;++a)if(l(I[a],u,d),de(!I[a]||I[a].texture&&Pn.indexOf(I[a].texture._texture.format)>=0||I[a].renderbuffer&&Bn.indexOf(I[a].renderbuffer._renderbuffer.format)>=0,\"framebuffer color attachment \"+a+\" is invalid\"),I[a]&&I[a].texture){var F=On[I[a].texture._texture.format]*jn[I[a].texture._texture.type];null===R?R=F:de(R===F,\"all color attachments much have the same number of bits per pixel.\")}return l(P,u,d),de(!P||P.texture&&P.texture._texture.format===In||P.renderbuffer&&P.renderbuffer._renderbuffer.format===Rn,\"invalid depth attachment for framebuffer object\"),l(O,u,d),de(!O||O.renderbuffer&&O.renderbuffer._renderbuffer.format===Fn,\"invalid stencil attachment for framebuffer object\"),l(j,u,d),de(!j||j.texture&&j.texture._texture.format===Nn||j.renderbuffer&&j.renderbuffer._renderbuffer.format===Nn,\"invalid depth-stencil attachment for framebuffer object\"),m(s),s.width=u,s.height=d,s.colorAttachments=I,s.depthAttachment=P,s.stencilAttachment=O,s.depthStencilAttachment=j,i.color=I.map(f),i.depth=f(P),i.stencil=f(O),i.depthStencil=f(j),i.width=s.width,i.height=s.height,v(s),i}function o(t,e){de(_.next!==s,\"can not resize a framebuffer which is currently in use\");var r=0|t,n=0|e||r;if(r===s.width&&n===s.height)return i;for(var a=s.colorAttachments,o=0;o<a.length;++o)d(a[o],r,n);return d(s.depthAttachment,r,n),d(s.stencilAttachment,r,n),d(s.depthStencilAttachment,r,n),s.width=i.width=r,s.height=i.height=n,v(s),i}var s=new p;return a.framebufferCount++,i(t,n),$t(i,{resize:o,_reglType:\"framebuffer\",_framebuffer:s,destroy:function(){g(s),m(s)},use:function(t){_.setFBO({framebuffer:i},t)}})}function b(t){function i(t){var r;de(o.indexOf(_.next)<0,\"can not update framebuffer which is currently in use\");var a=e.webgl_draw_buffers,s={color:null},l=0,u=null,c=\"rgba\",h=\"uint8\",f=1;if(\"number\"==typeof t)l=0|t;else if(t){de.type(t,\"object\",\"invalid arguments for framebuffer\");var d=t;if(\"shape\"in d){var p=d.shape;de(Array.isArray(p)&&p.length>=2,\"invalid shape for framebuffer\"),de(p[0]===p[1],\"cube framebuffer must be square\"),l=p[0]}else\"radius\"in d&&(l=0|d.radius),\"width\"in d?(l=0|d.width,\"height\"in d&&de(d.height===l,\"must be square\")):\"height\"in d&&(l=0|d.height);(\"color\"in d||\"colors\"in d)&&(u=d.color||d.colors,Array.isArray(u)&&de(1===u.length||a,\"multiple render targets not supported\")),u||(\"colorCount\"in d&&(f=0|d.colorCount,de(f>0,\"invalid color buffer count\")),\"colorType\"in d&&(de.oneOf(d.colorType,k,\"invalid color type\"),h=d.colorType),\"colorFormat\"in d&&(c=d.colorFormat,de.oneOf(d.colorFormat,w,\"invalid color format for texture\"))),\"depth\"in d&&(s.depth=d.depth),\"stencil\"in d&&(s.stencil=d.stencil),\"depthStencil\"in d&&(s.depthStencil=d.depthStencil)}else l=1;var m;if(u)if(Array.isArray(u))for(m=[],r=0;r<u.length;++r)m[r]=u[r];else m=[u];else{m=Array(f);var g={radius:l,format:c,type:h};for(r=0;r<f;++r)m[r]=n.createCube(g)}for(s.color=Array(m.length),r=0;r<m.length;++r){var v=m[r];de(\"function\"==typeof v&&\"textureCube\"===v._reglType,\"invalid cube map\"),l=l||v.width,de(v.width===l&&v.height===l,\"invalid cube map shape\"),s.color[r]={target:Sn,data:m[r]}}for(r=0;r<6;++r){for(var b=0;b<m.length;++b)s.color[b].target=Sn+r;r>0&&(s.depth=o[0].depth,s.stencil=o[0].stencil,s.depthStencil=o[0].depthStencil),o[r]?o[r](s):o[r]=y(s)}return $t(i,{width:l,height:l,color:m})}function a(t){var e,n=0|t;if(de(n>0&&n<=r.maxCubeMapSize,\"invalid radius for cube fbo\"),n===i.width)return i;var a=i.color;for(e=0;e<a.length;++e)a[e].resize(n);for(e=0;e<6;++e)o[e].resize(n);return i.width=i.height=n,i}var o=Array(6);return i(t),$t(i,{faces:o,resize:a,_reglType:\"framebufferCube\",destroy:function(){o.forEach(function(t){t.destroy()})}})}function x(){xe(T).forEach(function(e){e.framebuffer=t.createFramebuffer(),v(e)})}var _={cur:null,next:null,dirty:!1,setFBO:null},w=[\"rgba\"],M=[\"rgba4\",\"rgb565\",\"rgb5 a1\"];e.ext_srgb&&M.push(\"srgba\"),e.ext_color_buffer_half_float&&M.push(\"rgba16f\",\"rgb16f\"),e.webgl_color_buffer_float&&M.push(\"rgba32f\");var k=[\"uint8\"];e.oes_texture_half_float&&k.push(\"half float\",\"float16\"),e.oes_texture_float&&k.push(\"float\",\"float32\");var A=0,T={};return $t(_,{getFramebuffer:function(t){if(\"function\"==typeof t&&\"framebuffer\"===t._reglType){var e=t._framebuffer;if(e instanceof p)return e}return null},create:y,createCube:b,clear:function(){xe(T).forEach(g)},restore:x})}function Pt(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=Vn,this.offset=0,this.stride=0,this.divisor=0}function Ot(t,e,r,n,i){for(var a=r.maxAttributes,o=new Array(a),s=0;s<a;++s)o[s]=new Pt;return{Record:Pt,scope:{},state:o}}function jt(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){var a=r===Hn?c:h,o=a[n];if(!o){var s=e.str(n);o=t.createShader(r),t.shaderSource(o,s),t.compileShader(o),de.shaderError(t,o,s,r,i),a[n]=o}return o}function s(t,e){this.id=p++,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,u,c=o(Hn,r.fragId),h=o(qn,r.vertId),f=r.program=t.createProgram();t.attachShader(f,c),t.attachShader(f,h),t.linkProgram(f),de.linkError(t,f,e.str(r.fragId),e.str(r.vertId),s);var d=t.getProgramParameter(f,Gn);n.profile&&(r.stats.uniformsCount=d);var p=r.uniforms;for(l=0;l<d;++l)if(u=t.getActiveUniform(f,l))if(u.size>1)for(var m=0;m<u.size;++m){var g=u.name.replace(\"[0]\",\"[\"+m+\"]\");a(p,new i(g,e.id(g),t.getUniformLocation(f,g),u))}else a(p,new i(u.name,e.id(u.name),t.getUniformLocation(f,u.name),u));var v=t.getProgramParameter(f,Yn);n.profile&&(r.stats.attributesCount=v);var y=r.attributes;for(l=0;l<v;++l)(u=t.getActiveAttrib(f,l))&&a(y,new i(u.name,e.id(u.name),t.getAttribLocation(f,u.name),u))}function u(){c={},h={};for(var t=0;t<d.length;++t)l(d[t])}var c={},h={},f={},d=[],p=0;return n.profile&&(r.getMaxUniformsCount=function(){var t=0;return d.forEach(function(e){e.stats.uniformsCount>t&&(t=e.stats.uniformsCount)}),t},r.getMaxAttributesCount=function(){var t=0;return d.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var e=t.deleteShader.bind(t);xe(c).forEach(e),c={},xe(h).forEach(e),h={},d.forEach(function(e){t.deleteProgram(e.program)}),d.length=0,f={},r.shaderCount=0},program:function(t,e,n){de.command(t>=0,\"missing vertex shader\",n),de.command(e>=0,\"missing fragment shader\",n);var i=f[e];i||(i=f[e]={});var a=i[t];return a||(a=new s(e,t),r.shaderCount++,l(a,n),i[t]=a,d.push(a)),a},restore:u,shader:o,frag:-1,vert:-1}}function Rt(t,e,r,n,i,a){function o(o){var s;null===e.next?(de(i.preserveDrawingBuffer,'you must create a webgl context with \"preserveDrawingBuffer\":true in order to read pixels from the drawing buffer'),s=Xn):(de(null!==e.next.colorAttachments[0].texture,\"You cannot read from a renderbuffer\"),s=e.next.colorAttachments[0].texture._texture.type,a.oes_texture_float?de(s===Xn||s===Jn,\"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'\"):de(s===Xn,\"Reading from a framebuffer is only allowed for the type 'uint8'\"));var l=0,u=0,c=n.framebufferWidth,h=n.framebufferHeight,f=null;Kt(o)?f=o:o&&(de.type(o,\"object\",\"invalid arguments to regl.read()\"),l=0|o.x,u=0|o.y,de(l>=0&&l<n.framebufferWidth,\"invalid x offset for regl.read\"),de(u>=0&&u<n.framebufferHeight,\"invalid y offset for regl.read\"),c=0|(o.width||n.framebufferWidth-l),h=0|(o.height||n.framebufferHeight-u),f=o.data||null),f&&(s===Xn?de(f instanceof Uint8Array,\"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'\"):s===Jn&&de(f instanceof Float32Array,\"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'\")),de(c>0&&c+l<=n.framebufferWidth,\"invalid width for read pixels\"),de(h>0&&h+u<=n.framebufferHeight,\"invalid height for read pixels\"),r();var d=c*h*4;return f||(s===Xn?f=new Uint8Array(d):s===Jn&&(f=f||new Float32Array(d))),de.isTypedArray(f,\"data buffer for regl.read() must be a typedarray\"),de(f.byteLength>=d,\"data buffer for regl.read() too small\"),t.pixelStorei(Zn,4),t.readPixels(l,u,c,h,Wn,s,f),f}function s(t){var r;return e.setFBO({framebuffer:t.framebuffer},function(){r=o(t)}),r}function l(t){return t&&\"framebuffer\"in t?s(t):o(t)}return l}function Ft(t){return Array.prototype.slice.call(t)}function Nt(t){return Ft(t).join(\"\")}function Bt(){function t(t){for(var e=0;e<l.length;++e)if(l[e]===t)return s[e];var r=\"g\"+o++;return s.push(r),l.push(t),r}function e(){function t(){r.push.apply(r,Ft(arguments))}function e(){var t=\"v\"+o++;return n.push(t),arguments.length>0&&(r.push(t,\"=\"),r.push.apply(r,Ft(arguments)),r.push(\";\")),t}var r=[],n=[];return $t(t,{def:e,toString:function(){return Nt([n.length>0?\"var \"+n+\";\":\"\",Nt(r)])}})}function r(){function t(t,e){n(t,e,\"=\",r.def(t,e),\";\")}var r=e(),n=e(),i=r.toString,a=n.toString;return $t(function(){r.apply(r,Ft(arguments))},{def:r.def,entry:r,exit:n,save:t,set:function(e,n,i){t(e,n),r(e,n,\"=\",i,\";\")},toString:function(){return i()+a()}})}function n(){var t=Nt(arguments),e=r(),n=r(),i=e.toString,a=n.toString;return $t(e,{then:function(){return e.apply(e,Ft(arguments)),this},else:function(){return n.apply(n,Ft(arguments)),this},toString:function(){var e=a();return e&&(e=\"else{\"+e+\"}\"),Nt([\"if(\",t,\"){\",i(),\"}\",e])}})}function i(t,e){function n(){var t=\"a\"+i.length;return i.push(t),t}var i=[];e=e||0;for(var a=0;a<e;++a)n();var o=r(),s=o.toString;return c[t]=$t(o,{arg:n,toString:function(){return Nt([\"function(\",i.join(),\"){\",s(),\"}\"])}})}function a(){var t=['\"use strict\";',u,\"return {\"];Object.keys(c).forEach(function(e){t.push('\"',e,'\":',c[e].toString(),\",\")}),t.push(\"}\");var e=Nt(t).replace(/;/g,\";\\n\").replace(/}/g,\"}\\n\").replace(/{/g,\"{\\n\");return Function.apply(null,s.concat(e)).apply(null,l)}var o=0,s=[],l=[],u=e(),c={};return{global:u,link:t,block:e,proc:i,scope:r,cond:n,compile:a}}function Ut(t){return Array.isArray(t)||Kt(t)||Z(t)}function Vt(t){return t.sort(function(t,e){return t===Di?-1:e===Di?1:t<e?-1:1})}function Ht(t,e,r,n){this.thisDep=t,this.contextDep=e,this.propDep=r,this.append=n}function qt(t){return t&&!(t.thisDep||t.contextDep||t.propDep)}function Gt(t){return new Ht(!1,!1,!1,t)}function Yt(t,e){var r=t.type;if(r===ei){var n=t.data.length;return new Ht(!0,n>=1,n>=2,e)}if(r===ai){var i=t.data;return new Ht(i.thisDep,i.contextDep,i.propDep,e)}return new Ht(r===ii,r===ni,r===ri,e)}function Wt(t,e,r,n,i,a,o,s,l,u,c,h,f,d,p){function m(t){return t.replace(\".\",\"_\")}function g(t,e,r){var n=m(t);et.push(t),tt[n]=$[n]=!!r,rt[n]=e}function v(t,e,r){var n=m(t);et.push(t),Array.isArray(r)?($[n]=r.slice(),tt[n]=r.slice()):$[n]=tt[n]=r,nt[n]=e}function y(){var t=Bt(),r=t.link,n=t.global;t.id=ot++,t.batchId=\"0\";var i=r(it),a=t.shared={props:\"a0\"};Object.keys(it).forEach(function(t){a[t]=n.def(i,\".\",t)}),de.optional(function(){t.CHECK=r(de),t.commandStr=de.guessCommand(),t.command=r(t.commandStr),t.assert=function(t,e,n){t(\"if(!(\",e,\"))\",this.CHECK,\".commandRaise(\",r(n),\",\",this.command,\");\")},at.invalidBlendCombinations=Ua});var o=t.next={},s=t.current={};Object.keys(nt).forEach(function(t){Array.isArray($[t])&&(o[t]=n.def(a.next,\".\",t),s[t]=n.def(a.current,\".\",t))});var l=t.constants={};Object.keys(at).forEach(function(t){l[t]=n.def(JSON.stringify(at[t]))}),t.invoke=function(e,n){switch(n.type){case ei: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 ri:return e.def(a.props,n.data);case ni:return e.def(a.context,n.data);case ii:return e.def(\"this\",n.data);case ai:return n.data.append(t,e),n.data.ref}},t.attribCache={};var c={};return t.scopeAttrib=function(t){var n=e.id(t);if(n in c)return c[n];var i=u.scope[n];return i||(i=u.scope[n]=new X),c[n]=r(i)},t}function b(t){var e,r=t.static,n=t.dynamic;if(Ii in r){var i=!!r[Ii];(e=Gt(function(t,e){return i})).enable=i}else if(Ii in n){var a=n[Ii];e=Yt(a,function(t,e){return t.invoke(e,a)})}return e}function x(t,e){var r=t.static,n=t.dynamic;if(Pi in r){var i=r[Pi];return i?(i=s.getFramebuffer(i),de.command(i,\"invalid framebuffer object\"),Gt(function(t,e){var r=t.link(i),n=t.shared;e.set(n.framebuffer,\".next\",r);var a=n.context;return e.set(a,\".\"+Vi,r+\".width\"),e.set(a,\".\"+Hi,r+\".height\"),r})):Gt(function(t,e){var r=t.shared;e.set(r.framebuffer,\".next\",\"null\");var n=r.context;return e.set(n,\".\"+Vi,n+\".\"+Yi),e.set(n,\".\"+Hi,n+\".\"+Wi),\"null\"})}if(Pi in n){var a=n[Pi];return Yt(a,function(t,e){var r=t.invoke(e,a),n=t.shared,i=n.framebuffer,o=e.def(i,\".getFramebuffer(\",r,\")\");de.optional(function(){t.assert(e,\"!\"+r+\"||\"+o,\"invalid framebuffer object\")}),e.set(i,\".next\",o);var s=n.context;return e.set(s,\".\"+Vi,o+\"?\"+o+\".width:\"+s+\".\"+Yi),e.set(s,\".\"+Hi,o+\"?\"+o+\".height:\"+s+\".\"+Wi),o})}return null}function _(t,e,r){function n(t){if(t in i){var n=i[t];de.commandType(n,\"object\",\"invalid \"+t,r.commandStr);var o,s,l=!0,u=0|n.x,c=0|n.y;return\"width\"in n?(o=0|n.width,de.command(o>=0,\"invalid \"+t,r.commandStr)):l=!1,\"height\"in n?(s=0|n.height,de.command(s>=0,\"invalid \"+t,r.commandStr)):l=!1,new Ht(!l&&e&&e.thisDep,!l&&e&&e.contextDep,!l&&e&&e.propDep,function(t,e){var r=t.shared.context,i=o;\"width\"in n||(i=e.def(r,\".\",Vi,\"-\",u));var a=s;return\"height\"in n||(a=e.def(r,\".\",Hi,\"-\",c)),[u,c,i,a]})}if(t in a){var h=a[t],f=Yt(h,function(e,r){var n=e.invoke(r,h);de.optional(function(){e.assert(r,n+\"&&typeof \"+n+'===\"object\"',\"invalid \"+t)});var i=e.shared.context,a=r.def(n,\".x|0\"),o=r.def(n,\".y|0\"),s=r.def('\"width\" in ',n,\"?\",n,\".width|0:\",\"(\",i,\".\",Vi,\"-\",a,\")\"),l=r.def('\"height\" in ',n,\"?\",n,\".height|0:\",\"(\",i,\".\",Hi,\"-\",o,\")\");return de.optional(function(){e.assert(r,s+\">=0&&\"+l+\">=0\",\"invalid \"+t)}),[a,o,s,l]});return e&&(f.thisDep=f.thisDep||e.thisDep,f.contextDep=f.contextDep||e.contextDep,f.propDep=f.propDep||e.propDep),f}return e?new Ht(e.thisDep,e.contextDep,e.propDep,function(t,e){var r=t.shared.context;return[0,0,e.def(r,\".\",Vi),e.def(r,\".\",Hi)]}):null}var i=t.static,a=t.dynamic,o=n(Di);if(o){var s=o;o=new Ht(o.thisDep,o.contextDep,o.propDep,function(t,e){var r=s.append(t,e),n=t.shared.context;return e.set(n,\".\"+qi,r[2]),e.set(n,\".\"+Gi,r[3]),r})}return{viewport:o,scissor_box:n(zi)}}function w(t){function r(t){if(t in i){var r=e.id(i[t]);de.optional(function(){c.shader(qa[t],r,de.guessCommand())});var n=Gt(function(){return r});return n.id=r,n}if(t in a){var o=a[t];return Yt(o,function(e,r){var n=e.invoke(r,o),i=r.def(e.shared.strings,\".id(\",n,\")\");return de.optional(function(){r(e.shared.shader,\".shader(\",qa[t],\",\",i,\",\",e.command,\");\")}),i})}return null}var n,i=t.static,a=t.dynamic,o=r(ji),s=r(Oi),l=null;return qt(o)&&qt(s)?(l=c.program(s.id,o.id),n=Gt(function(t,e){return t.link(l)})):n=new Ht(o&&o.thisDep||s&&s.thisDep,o&&o.contextDep||s&&s.contextDep,o&&o.propDep||s&&s.propDep,function(t,e){var r,n=t.shared.shader;r=o?o.append(t,e):e.def(n,\".\",ji);var i,a=n+\".program(\"+(i=s?s.append(t,e):e.def(n,\".\",Oi))+\",\"+r;return de.optional(function(){a+=\",\"+t.command}),e.def(a+\")\")}),{frag:o,vert:s,progVar:n,program:l}}function M(t,e){function r(t,r){if(t in n){var a=0|n[t];return de.command(!r||a>=0,\"invalid \"+t,e.commandStr),Gt(function(t,e){return r&&(t.OFFSET=a),a})}if(t in i){var s=i[t];return Yt(s,function(e,n){var i=e.invoke(n,s);return r&&(e.OFFSET=i,de.optional(function(){e.assert(n,i+\">=0\",\"invalid \"+t)})),i})}return r&&o?Gt(function(t,e){return t.OFFSET=\"0\",0}):null}var n=t.static,i=t.dynamic,o=function(){if(Ri in n){var t=n[Ri];Ut(t)?t=a.getElements(a.create(t,!0)):t&&(t=a.getElements(t),de.command(t,\"invalid elements\",e.commandStr));var r=Gt(function(e,r){if(t){var n=e.link(t);return e.ELEMENTS=n,n}return e.ELEMENTS=null,null});return r.value=t,r}if(Ri in i){var o=i[Ri];return Yt(o,function(t,e){var r=t.shared,n=r.isBufferArgs,i=r.elements,a=t.invoke(e,o),s=e.def(\"null\"),l=e.def(n,\"(\",a,\")\"),u=t.cond(l).then(s,\"=\",i,\".createStream(\",a,\");\").else(s,\"=\",i,\".getElements(\",a,\");\");return de.optional(function(){t.assert(u.else,\"!\"+a+\"||\"+s,\"invalid elements\")}),e.entry(u),e.exit(t.cond(l).then(i,\".destroyStream(\",s,\");\")),t.ELEMENTS=s,s})}return null}(),s=r(Bi,!0);return{elements:o,primitive:function(){if(Fi in n){var t=n[Fi];return de.commandParameter(t,Be,\"invalid primitve\",e.commandStr),Gt(function(e,r){return Be[t]})}if(Fi in i){var r=i[Fi];return Yt(r,function(t,e){var n=t.constants.primTypes,i=t.invoke(e,r);return de.optional(function(){t.assert(e,i+\" in \"+n,\"invalid primitive, must be one of \"+Object.keys(Be))}),e.def(n,\"[\",i,\"]\")})}return o?qt(o)?Gt(o.value?function(t,e){return e.def(t.ELEMENTS,\".primType\")}:function(){return Aa}):new Ht(o.thisDep,o.contextDep,o.propDep,function(t,e){var r=t.ELEMENTS;return e.def(r,\"?\",r,\".primType:\",Aa)}):null}(),count:function(){if(Ni in n){var t=0|n[Ni];return de.command(\"number\"==typeof t&&t>=0,\"invalid vertex count\",e.commandStr),Gt(function(){return t})}if(Ni in i){var r=i[Ni];return Yt(r,function(t,e){var n=t.invoke(e,r);return de.optional(function(){t.assert(e,\"typeof \"+n+'===\"number\"&&'+n+\">=0&&\"+n+\"===(\"+n+\"|0)\",\"invalid vertex count\")}),n})}if(o){if(qt(o)){if(o)return s?new Ht(s.thisDep,s.contextDep,s.propDep,function(t,e){var r=e.def(t.ELEMENTS,\".vertCount-\",t.OFFSET);return de.optional(function(){t.assert(e,r+\">=0\",\"invalid vertex offset/element buffer too small\")}),r}):Gt(function(t,e){return e.def(t.ELEMENTS,\".vertCount\")});var a=Gt(function(){return-1});return de.optional(function(){a.MISSING=!0}),a}var l=new Ht(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\")});return de.optional(function(){l.DYNAMIC=!0}),l}return null}(),instances:r(Ui,!1),offset:s}}function k(t,e){var r=t.static,i=t.dynamic,a={};return et.forEach(function(t){function o(e,n){if(t in r){var o=e(r[t]);a[s]=Gt(function(){return o})}else if(t in i){var l=i[t];a[s]=Yt(l,function(t,e){return n(t,e,t.invoke(e,l))})}}var s=m(t);switch(t){case gi:case si:case oi:case Ai:case hi:case Ci:case xi:case wi:case Mi:case pi:return o(function(r){return de.commandType(r,\"boolean\",t,e.commandStr),r},function(e,r,n){return de.optional(function(){e.assert(r,\"typeof \"+n+'===\"boolean\"',\"invalid flag \"+t,e.commandStr)}),n});case fi:return o(function(r){return de.commandParameter(r,Va,\"invalid \"+t,e.commandStr),Va[r]},function(e,r,n){var i=e.constants.compareFuncs;return de.optional(function(){e.assert(r,n+\" in \"+i,\"invalid \"+t+\", must be one of \"+Object.keys(Va))}),r.def(i,\"[\",n,\"]\")});case di:return o(function(t){return de.command(mt(t)&&2===t.length&&\"number\"==typeof t[0]&&\"number\"==typeof t[1]&&t[0]<=t[1],\"depth range is 2d array\",e.commandStr),t},function(t,e,r){return de.optional(function(){t.assert(e,t.shared.isArrayLike+\"(\"+r+\")&&\"+r+\".length===2&&typeof \"+r+'[0]===\"number\"&&typeof '+r+'[1]===\"number\"&&'+r+\"[0]<=\"+r+\"[1]\",\"depth range must be a 2d array\")}),[e.def(\"+\",r,\"[0]\"),e.def(\"+\",r,\"[1]\")]});case ci:return o(function(t){de.commandType(t,\"object\",\"blend.func\",e.commandStr);var r=\"srcRGB\"in t?t.srcRGB:t.src,n=\"srcAlpha\"in t?t.srcAlpha:t.src,i=\"dstRGB\"in t?t.dstRGB:t.dst,a=\"dstAlpha\"in t?t.dstAlpha:t.dst;return de.commandParameter(r,Ba,s+\".srcRGB\",e.commandStr),de.commandParameter(n,Ba,s+\".srcAlpha\",e.commandStr),de.commandParameter(i,Ba,s+\".dstRGB\",e.commandStr),de.commandParameter(a,Ba,s+\".dstAlpha\",e.commandStr),de.command(-1===Ua.indexOf(r+\", \"+i),\"unallowed blending combination (srcRGB, dstRGB) = (\"+r+\", \"+i+\")\",e.commandStr),[Ba[r],Ba[i],Ba[n],Ba[a]]},function(e,r,n){function i(i,o){var s=r.def('\"',i,o,'\" in ',n,\"?\",n,\".\",i,o,\":\",n,\".\",i);return de.optional(function(){e.assert(r,s+\" in \"+a,\"invalid \"+t+\".\"+i+o+\", must be one of \"+Object.keys(Ba))}),s}var a=e.constants.blendFuncs;de.optional(function(){e.assert(r,n+\"&&typeof \"+n+'===\"object\"',\"invalid blend func, must be an object\")});var o=i(\"src\",\"RGB\"),s=i(\"dst\",\"RGB\");de.optional(function(){var t=e.constants.invalidBlendCombinations;e.assert(r,t+\".indexOf(\"+o+'+\", \"+'+s+\") === -1 \",\"unallowed blending combination for (srcRGB, dstRGB)\")});var l=r.def(a,\"[\",o,\"]\"),u=r.def(a,\"[\",i(\"src\",\"Alpha\"),\"]\");return[l,r.def(a,\"[\",s,\"]\"),u,r.def(a,\"[\",i(\"dst\",\"Alpha\"),\"]\")]});case ui:return o(function(r){return\"string\"==typeof r?(de.commandParameter(r,Z,\"invalid \"+t,e.commandStr),[Z[r],Z[r]]):\"object\"==typeof r?(de.commandParameter(r.rgb,Z,t+\".rgb\",e.commandStr),de.commandParameter(r.alpha,Z,t+\".alpha\",e.commandStr),[Z[r.rgb],Z[r.alpha]]):void de.commandRaise(\"invalid blend.equation\",e.commandStr)},function(e,r,n){var i=e.constants.blendEquations,a=r.def(),o=r.def(),s=e.cond(\"typeof \",n,'===\"string\"');return de.optional(function(){function r(t,r,n){e.assert(t,n+\" in \"+i,\"invalid \"+r+\", must be one of \"+Object.keys(Z))}r(s.then,t,n),e.assert(s.else,n+\"&&typeof \"+n+'===\"object\"',\"invalid \"+t),r(s.else,t+\".rgb\",n+\".rgb\"),r(s.else,t+\".alpha\",n+\".alpha\")}),s.then(a,\"=\",o,\"=\",i,\"[\",n,\"];\"),s.else(a,\"=\",i,\"[\",n,\".rgb];\",o,\"=\",i,\"[\",n,\".alpha];\"),r(s),[a,o]});case li:return o(function(t){return de.command(mt(t)&&4===t.length,\"blend.color must be a 4d array\",e.commandStr),J(4,function(e){return+t[e]})},function(t,e,r){return de.optional(function(){t.assert(e,t.shared.isArrayLike+\"(\"+r+\")&&\"+r+\".length===4\",\"blend.color must be a 4d array\")}),J(4,function(t){return e.def(\"+\",r,\"[\",t,\"]\")})});case Ti:return o(function(t){return de.commandType(t,\"number\",s,e.commandStr),0|t},function(t,e,r){return de.optional(function(){t.assert(e,\"typeof \"+r+'===\"number\"',\"invalid stencil.mask\")}),e.def(r,\"|0\")});case Si:return o(function(r){de.commandType(r,\"object\",s,e.commandStr);var n=r.cmp||\"keep\",i=r.ref||0,a=\"mask\"in r?r.mask:-1;return de.commandParameter(n,Va,t+\".cmp\",e.commandStr),de.commandType(i,\"number\",t+\".ref\",e.commandStr),de.commandType(a,\"number\",t+\".mask\",e.commandStr),[Va[n],i,a]},function(t,e,r){var n=t.constants.compareFuncs;return de.optional(function(){function i(){t.assert(e,Array.prototype.join.call(arguments,\"\"),\"invalid stencil.func\")}i(r+\"&&typeof \",r,'===\"object\"'),i('!(\"cmp\" in ',r,\")||(\",r,\".cmp in \",n,\")\")}),[e.def('\"cmp\" in ',r,\"?\",n,\"[\",r,\".cmp]\",\":\",Ia),e.def(r,\".ref|0\"),e.def('\"mask\" in ',r,\"?\",r,\".mask|0:-1\")]});case Ei:case Li:return o(function(r){de.commandType(r,\"object\",s,e.commandStr);var n=r.fail||\"keep\",i=r.zfail||\"keep\",a=r.zpass||\"keep\";return de.commandParameter(n,Ha,t+\".fail\",e.commandStr),de.commandParameter(i,Ha,t+\".zfail\",e.commandStr),de.commandParameter(a,Ha,t+\".zpass\",e.commandStr),[t===Li?Sa:Ta,Ha[n],Ha[i],Ha[a]]},function(e,r,n){function i(i){return de.optional(function(){e.assert(r,'!(\"'+i+'\" in '+n+\")||(\"+n+\".\"+i+\" in \"+a+\")\",\"invalid \"+t+\".\"+i+\", must be one of \"+Object.keys(Ha))}),r.def('\"',i,'\" in ',n,\"?\",a,\"[\",n,\".\",i,\"]:\",Ia)}var a=e.constants.stencilOps;return de.optional(function(){e.assert(r,n+\"&&typeof \"+n+'===\"object\"',\"invalid \"+t)}),[t===Li?Sa:Ta,i(\"fail\"),i(\"zfail\"),i(\"zpass\")]});case _i:return o(function(t){de.commandType(t,\"object\",s,e.commandStr);var r=0|t.factor,n=0|t.units;return de.commandType(r,\"number\",s+\".factor\",e.commandStr),de.commandType(n,\"number\",s+\".units\",e.commandStr),[r,n]},function(e,r,n){return de.optional(function(){e.assert(r,n+\"&&typeof \"+n+'===\"object\"',\"invalid \"+t)}),[r.def(n,\".factor|0\"),r.def(n,\".units|0\")]});case vi:return o(function(t){var r=0;return\"front\"===t?r=Ta:\"back\"===t&&(r=Sa),de.command(!!r,s,e.commandStr),r},function(t,e,r){return de.optional(function(){t.assert(e,r+'===\"front\"||'+r+'===\"back\"',\"invalid cull.face\")}),e.def(r,'===\"front\"?',Ta,\":\",Sa)});case bi:return o(function(t){return de.command(\"number\"==typeof t&&t>=n.lineWidthDims[0]&&t<=n.lineWidthDims[1],\"invalid line width, must positive number between \"+n.lineWidthDims[0]+\" and \"+n.lineWidthDims[1],e.commandStr),t},function(t,e,r){return de.optional(function(){t.assert(e,\"typeof \"+r+'===\"number\"&&'+r+\">=\"+n.lineWidthDims[0]+\"&&\"+r+\"<=\"+n.lineWidthDims[1],\"invalid line width\")}),r});case yi:return o(function(t){return de.commandParameter(t,Ga,s,e.commandStr),Ga[t]},function(t,e,r){return de.optional(function(){t.assert(e,r+'===\"cw\"||'+r+'===\"ccw\"',\"invalid frontFace, must be one of cw,ccw\")}),e.def(r+'===\"cw\"?'+Ea+\":\"+La)});case mi:return o(function(t){return de.command(mt(t)&&4===t.length,\"color.mask must be length 4 array\",e.commandStr),t.map(function(t){return!!t})},function(t,e,r){return de.optional(function(){t.assert(e,t.shared.isArrayLike+\"(\"+r+\")&&\"+r+\".length===4\",\"invalid color.mask\")}),J(4,function(t){return\"!!\"+r+\"[\"+t+\"]\"})});case ki:return o(function(t){de.command(\"object\"==typeof t&&t,s,e.commandStr);var r=\"value\"in t?t.value:1,n=!!t.invert;return de.command(\"number\"==typeof r&&r>=0&&r<=1,\"sample.coverage.value must be a number between 0 and 1\",e.commandStr),[r,n]},function(t,e,r){return de.optional(function(){t.assert(e,r+\"&&typeof \"+r+'===\"object\"',\"invalid sample.coverage\")}),[e.def('\"value\" in ',r,\"?+\",r,\".value:1\"),e.def(\"!!\",r,\".invert\")]})}}),a}function A(t,e){var r=t.static,n=t.dynamic,i={};return Object.keys(r).forEach(function(t){var n,a=r[t];if(\"number\"==typeof a||\"boolean\"==typeof a)n=Gt(function(){return a});else if(\"function\"==typeof a){var o=a._reglType;\"texture2d\"===o||\"textureCube\"===o?n=Gt(function(t){return t.link(a)}):\"framebuffer\"===o||\"framebufferCube\"===o?(de.command(a.color.length>0,'missing color attachment for framebuffer sent to uniform \"'+t+'\"',e.commandStr),n=Gt(function(t){return t.link(a.color[0])})):de.commandRaise('invalid data for uniform \"'+t+'\"',e.commandStr)}else mt(a)?n=Gt(function(e){return e.global.def(\"[\",J(a.length,function(r){return de.command(\"number\"==typeof a[r]||\"boolean\"==typeof a[r],\"invalid uniform \"+t,e.commandStr),a[r]}),\"]\")}):de.commandRaise('invalid or missing data for uniform \"'+t+'\"',e.commandStr);n.value=a,i[t]=n}),Object.keys(n).forEach(function(t){var e=n[t];i[t]=Yt(e,function(t,r){return t.invoke(r,e)})}),i}function T(t,r){var n=t.static,a=t.dynamic,o={};return Object.keys(n).forEach(function(t){var a=n[t],s=e.id(t),l=new X;if(Ut(a))l.state=$n,l.buffer=i.getBuffer(i.create(a,Zi,!1,!0)),l.type=0;else{var u=i.getBuffer(a);if(u)l.state=$n,l.buffer=u,l.type=0;else if(de.command(\"object\"==typeof a&&a,\"invalid data for attribute \"+t,r.commandStr),a.constant){var c=a.constant;l.buffer=\"null\",l.state=ti,\"number\"==typeof c?l.x=c:(de.command(mt(c)&&c.length>0&&c.length<=4,\"invalid constant for attribute \"+t,r.commandStr),Qn.forEach(function(t,e){e<c.length&&(l[t]=c[e])}))}else{u=Ut(a.buffer)?i.getBuffer(i.create(a.buffer,Zi,!1,!0)):i.getBuffer(a.buffer),de.command(!!u,'missing buffer for attribute \"'+t+'\"',r.commandStr);var h=0|a.offset;de.command(h>=0,'invalid offset for attribute \"'+t+'\"',r.commandStr);var f=0|a.stride;de.command(f>=0&&f<256,'invalid stride for attribute \"'+t+'\", must be integer betweeen [0, 255]',r.commandStr);var d=0|a.size;de.command(!(\"size\"in a)||d>0&&d<=4,'invalid size for attribute \"'+t+'\", must be 1,2,3,4',r.commandStr);var p=!!a.normalized,m=0;\"type\"in a&&(de.commandParameter(a.type,ze,\"invalid type for attribute \"+t,r.commandStr),m=ze[a.type]);var g=0|a.divisor;\"divisor\"in a&&(de.command(0===g||Q,'cannot specify divisor for attribute \"'+t+'\", instancing not supported',r.commandStr),de.command(g>=0,'invalid divisor for attribute \"'+t+'\"',r.commandStr)),de.optional(function(){var e=r.commandStr,n=[\"buffer\",\"offset\",\"divisor\",\"normalized\",\"type\",\"size\",\"stride\"];Object.keys(a).forEach(function(r){de.command(n.indexOf(r)>=0,'unknown parameter \"'+r+'\" for attribute pointer \"'+t+'\" (valid parameters are '+n+\")\",e)})}),l.buffer=u,l.state=$n,l.size=d,l.normalized=p,l.type=m||u.dtype,l.offset=h,l.stride=f,l.divisor=g}}o[t]=Gt(function(t,e){var r=t.attribCache;if(s in r)return r[s];var n={isStream:!1};return Object.keys(l).forEach(function(t){n[t]=l[t]}),l.buffer&&(n.buffer=t.link(l.buffer),n.type=n.type||n.buffer+\".dtype\"),r[s]=n,n})}),Object.keys(a).forEach(function(t){function e(e,n){function i(t){n(u[t],\"=\",a,\".\",t,\"|0;\")}var a=e.invoke(n,r),o=e.shared,s=o.isBufferArgs,l=o.buffer;de.optional(function(){e.assert(n,a+\"&&(typeof \"+a+'===\"object\"||typeof '+a+'===\"function\")&&('+s+\"(\"+a+\")||\"+l+\".getBuffer(\"+a+\")||\"+l+\".getBuffer(\"+a+\".buffer)||\"+s+\"(\"+a+'.buffer)||(\"constant\" in '+a+\"&&(typeof \"+a+'.constant===\"number\"||'+o.isArrayLike+\"(\"+a+\".constant))))\",'invalid dynamic attribute \"'+t+'\"')});var u={isStream:n.def(!1)},c=new X;c.state=$n,Object.keys(c).forEach(function(t){u[t]=n.def(\"\"+c[t])});var h=u.buffer,f=u.type;return n(\"if(\",s,\"(\",a,\")){\",u.isStream,\"=true;\",h,\"=\",l,\".createStream(\",Zi,\",\",a,\");\",f,\"=\",h,\".dtype;\",\"}else{\",h,\"=\",l,\".getBuffer(\",a,\");\",\"if(\",h,\"){\",f,\"=\",h,\".dtype;\",'}else if(\"constant\" in ',a,\"){\",u.state,\"=\",ti,\";\",\"if(typeof \"+a+'.constant === \"number\"){',u[Qn[0]],\"=\",a,\".constant;\",Qn.slice(1).map(function(t){return u[t]}).join(\"=\"),\"=0;\",\"}else{\",Qn.map(function(t,e){return u[t]+\"=\"+a+\".constant.length>=\"+e+\"?\"+a+\".constant[\"+e+\"]:0;\"}).join(\"\"),\"}}else{\",\"if(\",s,\"(\",a,\".buffer)){\",h,\"=\",l,\".createStream(\",Zi,\",\",a,\".buffer);\",\"}else{\",h,\"=\",l,\".getBuffer(\",a,\".buffer);\",\"}\",f,'=\"type\" in ',a,\"?\",o.glTypes,\"[\",a,\".type]:\",h,\".dtype;\",u.normalized,\"=!!\",a,\".normalized;\"),i(\"size\"),i(\"offset\"),i(\"stride\"),i(\"divisor\"),n(\"}}\"),n.exit(\"if(\",u.isStream,\"){\",l,\".destroyStream(\",h,\");\",\"}\"),u}var r=a[t];o[t]=Yt(r,e)}),o}function S(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach(function(t){var r=e[t];n[t]=Gt(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]=Yt(e,function(t,r){return t.invoke(r,e)})}),n}function E(t,e,r,n,i){function a(t){var e=u[t];e&&(h[t]=e)}var o=t.static,s=t.dynamic;de.optional(function(){function t(t){Object.keys(t).forEach(function(t){de.command(e.indexOf(t)>=0,'unknown parameter \"'+t+'\"',i.commandStr)})}var e=[Pi,Oi,ji,Ri,Fi,Bi,Ni,Ui,Ii].concat(et);t(o),t(s)});var l=x(t,i),u=_(t,l,i),c=M(t,i),h=k(t,i),f=w(t,i);a(Di),a(m(zi));var d=Object.keys(h).length>0,p={framebuffer:l,draw:c,shader:f,state:h,dirty:d};return p.profile=b(t,i),p.uniforms=A(r,i),p.attributes=T(e,i),p.context=S(n,i),p}function L(t,e,r){var n=t.shared.context,i=t.scope();Object.keys(r).forEach(function(a){e.save(n,\".\"+a);var o=r[a];i(n,\".\",a,\"=\",o.append(t,e),\";\")}),e(i)}function C(t,e,r,n){var i,a=t.shared,o=a.gl,s=a.framebuffer;K&&(i=e.def(a.extensions,\".webgl_draw_buffers\"));var l,u=t.constants,c=u.drawBuffer,h=u.backBuffer;l=r?r.append(t,e):e.def(s,\".next\"),n||e(\"if(\",l,\"!==\",s,\".cur){\"),e(\"if(\",l,\"){\",o,\".bindFramebuffer(\",Fa,\",\",l,\".framebuffer);\"),K&&e(i,\".drawBuffersWEBGL(\",c,\"[\",l,\".colorAttachments.length]);\"),e(\"}else{\",o,\".bindFramebuffer(\",Fa,\",null);\"),K&&e(i,\".drawBuffersWEBGL(\",h,\");\"),e(\"}\",s,\".cur=\",l,\";\"),n||e(\"}\")}function z(t,e,r){var n=t.shared,i=n.gl,a=t.current,o=t.next,s=n.current,l=n.next,u=t.cond(s,\".dirty\");et.forEach(function(e){var n=m(e);if(!(n in r.state)){var c,h;if(n in o){c=o[n],h=a[n];var f=J($[n].length,function(t){return u.def(c,\"[\",t,\"]\")});u(t.cond(f.map(function(t,e){return t+\"!==\"+h+\"[\"+e+\"]\"}).join(\"||\")).then(i,\".\",nt[n],\"(\",f,\");\",f.map(function(t,e){return h+\"[\"+e+\"]=\"+t}).join(\";\"),\";\"))}else{c=u.def(l,\".\",n);var d=t.cond(c,\"!==\",s,\".\",n);u(d),n in rt?d(t.cond(c).then(i,\".enable(\",rt[n],\");\").else(i,\".disable(\",rt[n],\");\"),s,\".\",n,\"=\",c,\";\"):d(i,\".\",nt[n],\"(\",c,\");\",s,\".\",n,\"=\",c,\";\")}}}),0===Object.keys(r.state).length&&u(s,\".dirty=false;\"),e(u)}function D(t,e,r,n){var i=t.shared,a=t.current,o=i.current,s=i.gl;Vt(Object.keys(r)).forEach(function(i){var l=r[i];if(!n||n(l)){var u=l.append(t,e);if(rt[i]){var c=rt[i];qt(l)?u?e(s,\".enable(\",c,\");\"):e(s,\".disable(\",c,\");\"):e(t.cond(u).then(s,\".enable(\",c,\");\").else(s,\".disable(\",c,\");\")),e(o,\".\",i,\"=\",u,\";\")}else if(mt(u)){var h=a[i];e(s,\".\",nt[i],\"(\",u,\");\",u.map(function(t,e){return h+\"[\"+e+\"]=\"+t}).join(\";\"),\";\")}else e(s,\".\",nt[i],\"(\",u,\");\",o,\".\",i,\"=\",u,\";\")}})}function I(t,e){Q&&(t.instancing=e.def(t.shared.extensions,\".angle_instanced_arrays\"))}function P(t,e,r,n,i){function a(){return\"undefined\"==typeof performance?\"Date.now()\":\"performance.now()\"}function o(t){t(u=e.def(),\"=\",a(),\";\"),\"string\"==typeof i?t(p,\".count+=\",i,\";\"):t(p,\".count++;\"),d&&(n?t(c=e.def(),\"=\",g,\".getNumPendingQueries();\"):t(g,\".beginQuery(\",p,\");\"))}function s(t){t(p,\".cpuTime+=\",a(),\"-\",u,\";\"),d&&(n?t(g,\".pushScopeStats(\",c,\",\",g,\".getNumPendingQueries(),\",p,\");\"):t(g,\".endQuery();\"))}function l(t){var r=e.def(m,\".profile\");e(m,\".profile=\",t,\";\"),e.exit(m,\".profile=\",r,\";\")}var u,c,h,f=t.shared,p=t.stats,m=f.current,g=f.timer,v=r.profile;if(v){if(qt(v))return void(v.enable?(o(e),s(e.exit),l(\"true\")):l(\"false\"));l(h=v.append(t,e))}else h=e.def(m,\".profile\");var y=t.block();o(y),e(\"if(\",h,\"){\",y,\"}\");var b=t.block();s(b),e.exit(\"if(\",h,\"){\",b,\"}\")}function O(t,e,r,n,i){function a(t){switch(t){case ua:case da:case va:return 2;case ca:case pa:case ya:return 3;case ha:case ma:case ba:return 4;default:return 1}}function o(r,n,i){function a(){e(\"if(!\",c,\".buffer){\",l,\".enableVertexAttribArray(\",u,\");}\");var r,a=i.type;if(r=i.size?e.def(i.size,\"||\",n):n,e(\"if(\",c,\".type!==\",a,\"||\",c,\".size!==\",r,\"||\",p.map(function(t){return c+\".\"+t+\"!==\"+i[t]}).join(\"||\"),\"){\",l,\".bindBuffer(\",Zi,\",\",f,\".buffer);\",l,\".vertexAttribPointer(\",[u,r,a,i.normalized,i.stride,i.offset],\");\",c,\".type=\",a,\";\",c,\".size=\",r,\";\",p.map(function(t){return c+\".\"+t+\"=\"+i[t]+\";\"}).join(\"\"),\"}\"),Q){var o=i.divisor;e(\"if(\",c,\".divisor!==\",o,\"){\",t.instancing,\".vertexAttribDivisorANGLE(\",[u,o],\");\",c,\".divisor=\",o,\";}\")}}function o(){e(\"if(\",c,\".buffer){\",l,\".disableVertexAttribArray(\",u,\");\",\"}if(\",Qn.map(function(t,e){return c+\".\"+t+\"!==\"+d[e]}).join(\"||\"),\"){\",l,\".vertexAttrib4f(\",u,\",\",d,\");\",Qn.map(function(t,e){return c+\".\"+t+\"=\"+d[e]+\";\"}).join(\"\"),\"}\")}var l=s.gl,u=e.def(r,\".location\"),c=e.def(s.attributes,\"[\",u,\"]\"),h=i.state,f=i.buffer,d=[i.x,i.y,i.z,i.w],p=[\"buffer\",\"normalized\",\"offset\",\"stride\"];h===$n?a():h===ti?o():(e(\"if(\",h,\"===\",$n,\"){\"),a(),e(\"}else{\"),o(),e(\"}\"))}var s=t.shared;n.forEach(function(n){var s,l=n.name,u=r.attributes[l];if(u){if(!i(u))return;s=u.append(t,e)}else{if(!i(Ya))return;var c=t.scopeAttrib(l);de.optional(function(){t.assert(e,c+\".state\",\"missing attribute \"+l)}),s={},Object.keys(new X).forEach(function(t){s[t]=e.def(c,\".\",t)})}o(t.link(n),a(n.info.type),s)})}function j(t,r,n,i,a){for(var o,s=t.shared,l=s.gl,u=0;u<i.length;++u){var c,h=i[u],f=h.name,d=h.info.type,p=n.uniforms[f],m=t.link(h)+\".location\";if(p){if(!a(p))continue;if(qt(p)){var g=p.value;if(de.command(null!==g&&void 0!==g,'missing uniform \"'+f+'\"',t.commandStr),d===Ma||d===ka){de.command(\"function\"==typeof g&&(d===Ma&&(\"texture2d\"===g._reglType||\"framebuffer\"===g._reglType)||d===ka&&(\"textureCube\"===g._reglType||\"framebufferCube\"===g._reglType)),\"invalid texture for uniform \"+f,t.commandStr);var v=t.link(g._texture||g.color[0]._texture);r(l,\".uniform1i(\",m,\",\",v+\".bind());\"),r.exit(v,\".unbind();\")}else if(d===xa||d===_a||d===wa){de.optional(function(){de.command(mt(g),\"invalid matrix for uniform \"+f,t.commandStr),de.command(d===xa&&4===g.length||d===_a&&9===g.length||d===wa&&16===g.length,\"invalid length for matrix uniform \"+f,t.commandStr)});var y=t.global.def(\"new Float32Array([\"+Array.prototype.slice.call(g)+\"])\"),b=2;d===_a?b=3:d===wa&&(b=4),r(l,\".uniformMatrix\",b,\"fv(\",m,\",false,\",y,\");\")}else{switch(d){case la:de.commandType(g,\"number\",\"uniform \"+f,t.commandStr),o=\"1f\";break;case ua:de.command(mt(g)&&2===g.length,\"uniform \"+f,t.commandStr),o=\"2f\";break;case ca:de.command(mt(g)&&3===g.length,\"uniform \"+f,t.commandStr),o=\"3f\";break;case ha:de.command(mt(g)&&4===g.length,\"uniform \"+f,t.commandStr),o=\"4f\";break;case ga:de.commandType(g,\"boolean\",\"uniform \"+f,t.commandStr),o=\"1i\";break;case fa:de.commandType(g,\"number\",\"uniform \"+f,t.commandStr),o=\"1i\";break;case va:case da:de.command(mt(g)&&2===g.length,\"uniform \"+f,t.commandStr),o=\"2i\";break;case ya:case pa:de.command(mt(g)&&3===g.length,\"uniform \"+f,t.commandStr),o=\"3i\";break;case ba:case ma:de.command(mt(g)&&4===g.length,\"uniform \"+f,t.commandStr),o=\"4i\"}r(l,\".uniform\",o,\"(\",m,\",\",mt(g)?Array.prototype.slice.call(g):g,\");\")}continue}c=p.append(t,r)}else{if(!a(Ya))continue;c=r.def(s.uniforms,\"[\",e.id(f),\"]\")}d===Ma?r(\"if(\",c,\"&&\",c,'._reglType===\"framebuffer\"){',c,\"=\",c,\".color[0];\",\"}\"):d===ka&&r(\"if(\",c,\"&&\",c,'._reglType===\"framebufferCube\"){',c,\"=\",c,\".color[0];\",\"}\"),de.optional(function(){function e(e,n){t.assert(r,e,'bad data or missing for uniform \"'+f+'\".  '+n)}function n(t){e(\"typeof \"+c+'===\"'+t+'\"',\"invalid type, expected \"+t)}function i(r,n){e(s.isArrayLike+\"(\"+c+\")&&\"+c+\".length===\"+r,\"invalid vector, should have length \"+r,t.commandStr)}function a(r){e(\"typeof \"+c+'===\"function\"&&'+c+'._reglType===\"texture'+(r===Qi?\"2d\":\"Cube\")+'\"',\"invalid texture type\",t.commandStr)}switch(d){case fa:n(\"number\");break;case da:i(2,\"number\");break;case pa:i(3,\"number\");break;case ma:i(4,\"number\");break;case la:n(\"number\");break;case ua:i(2,\"number\");break;case ca:i(3,\"number\");break;case ha:i(4,\"number\");break;case ga:n(\"boolean\");break;case va:i(2,\"boolean\");break;case ya:i(3,\"boolean\");break;case ba:i(4,\"boolean\");break;case xa:i(4,\"number\");break;case _a:i(9,\"number\");break;case wa:i(16,\"number\");break;case Ma:a(Qi);break;case ka:a(Ki)}});var x=1;switch(d){case Ma:case ka:var _=r.def(c,\"._texture\");r(l,\".uniform1i(\",m,\",\",_,\".bind());\"),r.exit(_,\".unbind();\");continue;case fa:case ga:o=\"1i\";break;case da:case va:o=\"2i\",x=2;break;case pa:case ya:o=\"3i\",x=3;break;case ma:case ba:o=\"4i\",x=4;break;case la:o=\"1f\";break;case ua:o=\"2f\",x=2;break;case ca:o=\"3f\",x=3;break;case ha:o=\"4f\",x=4;break;case xa:o=\"Matrix2fv\";break;case _a:o=\"Matrix3fv\";break;case wa:o=\"Matrix4fv\"}if(r(l,\".uniform\",o,\"(\",m,\",\"),\"M\"===o.charAt(0)){var w=Math.pow(d-xa+2,2),M=t.global.def(\"new Float32Array(\",w,\")\");r(\"false,(Array.isArray(\",c,\")||\",c,\" instanceof Float32Array)?\",c,\":(\",J(w,function(t){return M+\"[\"+t+\"]=\"+c+\"[\"+t+\"]\"}),\",\",M,\")\")}else r(x>1?J(x,function(t){return c+\"[\"+t+\"]\"}):c);r(\");\")}}function R(t,e,r,n){function i(i){var a=c[i];return a?a.contextDep&&n.contextDynamic||a.propDep?a.append(t,r):a.append(t,e):e.def(u,\".\",i)}function a(){function t(){r(g,\".drawElementsInstancedANGLE(\",[f,p,v,d+\"<<((\"+v+\"-\"+Kn+\")>>1)\",m],\");\")}function e(){r(g,\".drawArraysInstancedANGLE(\",[f,d,p,m],\");\")}h?y?t():(r(\"if(\",h,\"){\"),t(),r(\"}else{\"),e(),r(\"}\")):e()}function o(){function t(){r(l+\".drawElements(\"+[f,p,v,d+\"<<((\"+v+\"-\"+Kn+\")>>1)\"]+\");\")}function e(){r(l+\".drawArrays(\"+[f,d,p]+\");\")}h?y?t():(r(\"if(\",h,\"){\"),t(),r(\"}else{\"),e(),r(\"}\")):e()}var s=t.shared,l=s.gl,u=s.draw,c=n.draw,h=function(){var i,a=c.elements,o=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(t,o)):i=o.def(u,\".\",Ri),i&&o(\"if(\"+i+\")\"+l+\".bindBuffer(\"+Ji+\",\"+i+\".buffer.buffer);\"),i}(),f=i(Fi),d=i(Bi),p=function(){var i,a=c.count,o=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(t,o),de.optional(function(){a.MISSING&&t.assert(e,\"false\",\"missing vertex count\"),a.DYNAMIC&&t.assert(o,i+\">=0\",\"missing vertex count\")})):(i=o.def(u,\".\",Ni),de.optional(function(){t.assert(o,i+\">=0\",\"missing vertex count\")})),i}();if(\"number\"==typeof p){if(0===p)return}else r(\"if(\",p,\"){\"),r.exit(\"}\");var m,g;Q&&(m=i(Ui),g=t.instancing);var v=h+\".type\",y=c.elements&&qt(c.elements);Q&&(\"number\"!=typeof m||m>=0)?\"string\"==typeof m?(r(\"if(\",m,\">0){\"),a(),r(\"}else if(\",m,\"<0){\"),o(),r(\"}\")):a():o()}function F(t,e,r,n,i){var a=y(),o=a.proc(\"body\",i);return de.optional(function(){a.commandStr=e.commandStr,a.command=a.link(e.commandStr)}),Q&&(a.instancing=o.def(a.shared.extensions,\".angle_instanced_arrays\")),t(a,o,r,n),a.compile().body}function N(t,e,r,n){I(t,e),O(t,e,r,n.attributes,function(){return!0}),j(t,e,r,n.uniforms,function(){return!0}),R(t,e,e,r)}function B(t,e){var r=t.proc(\"draw\",1);I(t,r),L(t,r,e.context),C(t,r,e.framebuffer),z(t,r,e),D(t,r,e.state),P(t,r,e,!1,!0);var n=e.shader.progVar.append(t,r);if(r(t.shared.gl,\".useProgram(\",n,\".program);\"),e.shader.program)N(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 F(N,t,e,r,1)}),\"(\",n,\");\",o,\".call(this,a0);\"))}Object.keys(e.state).length>0&&r(t.shared.current,\".dirty=true;\")}function U(t,e,r,n){function i(){return!0}t.batchId=\"a1\",I(t,e),O(t,e,r,n.attributes,i),j(t,e,r,n.uniforms,i),R(t,e,e,r)}function V(t,e,r,n){function i(t){return t.contextDep&&o||t.propDep}function a(t){return!i(t)}I(t,e);var o=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var u=t.scope(),c=t.scope();if(e(u.entry,\"for(\",s,\"=0;\",s,\"<\",\"a1\",\";++\",s,\"){\",l,\"=\",\"a0\",\"[\",s,\"];\",c,\"}\",u.exit),r.needsContext&&L(t,c,r.context),r.needsFramebuffer&&C(t,c,r.framebuffer),D(t,c,r.state,i),r.profile&&i(r.profile)&&P(t,c,r,!1,!0),n)O(t,u,r,n.attributes,a),O(t,c,r,n.attributes,i),j(t,u,r,n.uniforms,a),j(t,c,r,n.uniforms,i),R(t,u,c,r);else{var h=t.global.def(\"{}\"),f=r.shader.progVar.append(t,c),d=c.def(f,\".id\"),p=c.def(h,\"[\",d,\"]\");c(t.shared.gl,\".useProgram(\",f,\".program);\",\"if(!\",p,\"){\",p,\"=\",h,\"[\",d,\"]=\",t.link(function(e){return F(U,t,r,e,2)}),\"(\",f,\");}\",p,\".call(this,a0[\",s,\"],\",s,\");\")}}function H(t,e){function r(t){return t.contextDep&&i||t.propDep}var n=t.proc(\"batch\",2);t.batchId=\"0\",I(t,n);var i=!1,a=!0;Object.keys(e.context).forEach(function(t){i=i||e.context[t].propDep}),i||(L(t,n,e.context),a=!1);var o=e.framebuffer,s=!1;o?(o.propDep?i=s=!0:o.contextDep&&i&&(s=!0),s||C(t,n,o)):C(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(i=!0),z(t,n,e),D(t,n,e.state,function(t){return!r(t)}),e.profile&&r(e.profile)||P(t,n,e,!1,\"a1\"),e.contextDep=i,e.needsContext=a,e.needsFramebuffer=s;var l=e.shader.progVar;if(l.contextDep&&i||l.propDep)V(t,n,e,null);else{var u=l.append(t,n);if(n(t.shared.gl,\".useProgram(\",u,\".program);\"),e.shader.program)V(t,n,e,e.shader.program);else{var c=t.global.def(\"{}\"),h=n.def(u,\".id\"),f=n.def(c,\"[\",h,\"]\");n(t.cond(f).then(f,\".call(this,a0,a1);\").else(f,\"=\",c,\"[\",h,\"]=\",t.link(function(r){return F(V,t,e,r,2)}),\"(\",u,\");\",f,\".call(this,a0,a1);\"))}}Object.keys(e.state).length>0&&n(t.shared.current,\".dirty=true;\")}function q(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;L(t,i,r.context),r.framebuffer&&r.framebuffer.append(t,i),Vt(Object.keys(r.state)).forEach(function(e){var n=r.state[e].append(t,i);mt(n)?n.forEach(function(r,n){i.set(t.next[e],\"[\"+n+\"]\",r)}):i.set(a.next,\".\"+e,n)}),P(t,i,r,!0,!0),[Ri,Bi,Ni,Ui,Fi].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 X).forEach(function(t){i.set(a,\".\"+t,n[t])})}),n(Oi),n(ji),Object.keys(r.state).length>0&&(i(o,\".dirty=true;\"),i.exit(o,\".dirty=true;\")),i(\"a1(\",t.shared.context,\",a0,\",t.batchId,\");\")}function G(t){if(\"object\"==typeof t&&!mt(t)){for(var e=Object.keys(t),r=0;r<e.length;++r)if(ge.isDynamic(t[e[r]]))return!0;return!1}}function Y(t,e,r){function n(t,e){o.forEach(function(r){var n=i[r];if(ge.isDynamic(n)){var a=t.invoke(e,n);e(c,\".\",r,\"=\",a,\";\")}})}var i=e.static[r];if(i&&G(i)){var a=t.global,o=Object.keys(i),s=!1,l=!1,u=!1,c=t.global.def(\"{}\");o.forEach(function(e){var r=i[e];if(ge.isDynamic(r)){\"function\"==typeof r&&(r=i[e]=ge.unbox(r));var n=Yt(r,null);s=s||n.thisDep,u=u||n.propDep,l=l||n.contextDep}else{switch(a(c,\".\",e,\"=\"),typeof r){case\"number\":a(r);break;case\"string\":a('\"',r,'\"');break;case\"object\":Array.isArray(r)&&a(\"[\",r.join(),\"]\");break;default:a(t.link(r))}a(\";\")}}),e.dynamic[r]=new ge.DynamicVariable(ai,{thisDep:s,contextDep:l,propDep:u,ref:c,append:n}),delete e.static[r]}}function W(t,e,r,n,i){var a=y();a.stats=a.link(i),Object.keys(e.static).forEach(function(t){Y(a,e,t)}),Xi.forEach(function(e){Y(a,t,e)});var o=E(t,e,r,n,a);return B(a,o),q(a,o),H(a,o),a.compile()}var X=u.Record,Z={add:32774,subtract:32778,\"reverse subtract\":32779};r.ext_blend_minmax&&(Z.min=Ca,Z.max=za);var Q=r.angle_instanced_arrays,K=r.webgl_draw_buffers,$={dirty:!0,profile:p.profile},tt={},et=[],rt={},nt={};g(oi,ea),g(si,ta),v(li,\"blendColor\",[0,0,0,0]),v(ui,\"blendEquationSeparate\",[ja,ja]),v(ci,\"blendFuncSeparate\",[Oa,Pa,Oa,Pa]),g(hi,na,!0),v(fi,\"depthFunc\",Ra),v(di,\"depthRange\",[0,1]),v(pi,\"depthMask\",!0),v(mi,mi,[!0,!0,!0,!0]),g(gi,$i),v(vi,\"cullFace\",Sa),v(yi,yi,La),v(bi,bi,1),g(xi,aa),v(_i,\"polygonOffset\",[0,0]),g(wi,oa),g(Mi,sa),v(ki,\"sampleCoverage\",[1,!1]),g(Ai,ra),v(Ti,\"stencilMask\",-1),v(Si,\"stencilFunc\",[Da,0,-1]),v(Ei,\"stencilOpSeparate\",[Ta,Ia,Ia,Ia]),v(Li,\"stencilOpSeparate\",[Sa,Ia,Ia,Ia]),g(Ci,ia),v(zi,\"scissor\",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),v(Di,Di,[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var it={gl:t,context:f,strings:e,next:tt,current:$,draw:h,elements:a,buffer:i,shader:c,attributes:u.state,uniforms:l,framebuffer:s,extensions:r,timer:d,isBufferArgs:Ut},at={primTypes:Be,compareFuncs:Va,blendFuncs:Ba,blendEquations:Z,stencilOps:Ha,glTypes:ze,orientationType:Ga};de.optional(function(){it.isArrayLike=mt}),K&&(at.backBuffer=[Sa],at.drawBuffer=J(n.maxDrawbuffers,function(t){return 0===t?[0]:J(t,function(t){return Na+t})}));var ot=0;return{next:tt,current:$,procs:function(){var e=y(),r=e.proc(\"poll\"),i=e.proc(\"refresh\"),a=e.block();r(a),i(a);var o=e.shared,s=o.gl,l=o.next,u=o.current;a(u,\".dirty=false;\"),C(e,r),C(e,i,null,!0);var c,h=t.getExtension(\"angle_instanced_arrays\");h&&(c=e.link(h));for(var f=0;f<n.maxAttributes;++f){var d=i.def(o.attributes,\"[\",f,\"]\"),p=e.cond(d,\".buffer\");p.then(s,\".enableVertexAttribArray(\",f,\");\",s,\".bindBuffer(\",Zi,\",\",d,\".buffer.buffer);\",s,\".vertexAttribPointer(\",f,\",\",d,\".size,\",d,\".type,\",d,\".normalized,\",d,\".stride,\",d,\".offset);\").else(s,\".disableVertexAttribArray(\",f,\");\",s,\".vertexAttrib4f(\",f,\",\",d,\".x,\",d,\".y,\",d,\".z,\",d,\".w);\",d,\".buffer=null;\"),i(p),h&&i(c,\".vertexAttribDivisorANGLE(\",f,\",\",d,\".divisor);\")}return Object.keys(rt).forEach(function(t){var n=rt[t],o=a.def(l,\".\",t),c=e.block();c(\"if(\",o,\"){\",s,\".enable(\",n,\")}else{\",s,\".disable(\",n,\")}\",u,\".\",t,\"=\",o,\";\"),i(c),r(\"if(\",o,\"!==\",u,\".\",t,\"){\",c,\"}\")}),Object.keys(nt).forEach(function(t){var n,o,c=nt[t],h=$[t],f=e.block();if(f(s,\".\",c,\"(\"),mt(h)){var d=h.length;n=e.global.def(l,\".\",t),o=e.global.def(u,\".\",t),f(J(d,function(t){return n+\"[\"+t+\"]\"}),\");\",J(d,function(t){return o+\"[\"+t+\"]=\"+n+\"[\"+t+\"];\"}).join(\"\")),r(\"if(\",J(d,function(t){return n+\"[\"+t+\"]!==\"+o+\"[\"+t+\"]\"}).join(\"||\"),\"){\",f,\"}\")}else n=a.def(l,\".\",t),o=a.def(u,\".\",t),f(n,\");\",u,\".\",t,\"=\",n,\";\"),r(\"if(\",n,\"!==\",o,\"){\",f,\"}\");i(f)}),e.compile()}(),compile:W}}function Xt(){return{bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}function Zt(t,e){for(var r=0;r<t.length;++r)if(t[r]===e)return r;return-1}function Jt(t){function e(){if(0===q.length)return k&&k.update(),void(J=null);J=ve.next(e),f();for(var t=q.length-1;t>=0;--t){var r=q[t];r&&r(E,null,0)}v.flush(),k&&k.update()}function r(){!J&&q.length>0&&(J=ve.next(e))}function n(){J&&(ve.cancel(e),J=null)}function i(t){t.preventDefault(),b=!0,n(),G.forEach(function(t){t()})}function a(t){v.getError(),b=!1,x.restore(),O.restore(),D.restore(),j.restore(),R.restore(),F.restore(),k&&k.restore(),N.procs.refresh(),r(),Y.forEach(function(t){t()})}function o(){q.length=0,n(),H&&(H.removeEventListener(eo,i),H.removeEventListener(ro,a)),O.clear(),F.clear(),R.clear(),j.clear(),I.clear(),D.clear(),k&&k.clear(),Z.forEach(function(t){t()})}function s(t){function e(t){var e={},r={};return Object.keys(t).forEach(function(n){var i=t[n];ge.isDynamic(i)?r[n]=ge.unbox(i,n):e[n]=i}),{dynamic:r,static:e}}function r(t){for(;d.length<t;)d.push(null);return d}function n(t,e){var n;if(b&&de.raise(\"context lost\"),\"function\"==typeof t)return f.call(this,null,t,0);if(\"function\"==typeof e){if(\"number\"==typeof t){for(n=0;n<t;++n)f.call(this,null,e,n);return}if(Array.isArray(t)){for(n=0;n<t.length;++n)f.call(this,t[n],e,n);return}return f.call(this,t,e,0)}if(\"number\"==typeof t){if(t>0)return h.call(this,r(0|t),0|t)}else{if(!Array.isArray(t))return c.call(this,t);if(t.length)return h.call(this,t,t.length)}}de(!!t,\"invalid args to regl({...})\"),de.type(t,\"object\",\"invalid args to regl({...})\");var i=e(t.context||{}),a=e(t.uniforms||{}),o=e(t.attributes||{}),s=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=$t({},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)),l={gpuTime:0,cpuTime:0,count:0},u=N.compile(s,o,a,i,l),c=u.draw,h=u.batch,f=u.scope,d=[];return $t(n,{stats:l})}function l(t,e){var r=0;N.procs.poll();var n=e.color;n&&(v.clearColor(+n[0]||0,+n[1]||0,+n[2]||0,+n[3]||0),r|=Qa),\"depth\"in e&&(v.clearDepth(+e.depth),r|=Ka),\"stencil\"in e&&(v.clearStencil(0|e.stencil),r|=$a),de(!!r,\"called regl.clear with no buffer specified\"),v.clear(r)}function u(t){if(de(\"object\"==typeof t&&t,\"regl.clear() takes an object as input\"),\"framebuffer\"in t)if(t.framebuffer&&\"framebufferCube\"===t.framebuffer_reglType)for(var e=0;e<6;++e)Q($t({framebuffer:t.framebuffer.faces[e]},t),l);else Q(t,l);else l(null,t)}function c(t){function e(){function e(){var t=Zt(q,e);q[t]=q[q.length-1],q.length-=1,q.length<=0&&n()}var r=Zt(q,t);de(r>=0,\"cannot cancel a frame twice\"),q[r]=e}return de.type(t,\"function\",\"regl.frame() callback must be a function\"),q.push(t),r(),{cancel:e}}function h(){var t=V.viewport,e=V.scissor_box;t[0]=t[1]=e[0]=e[1]=0,E.viewportWidth=E.framebufferWidth=E.drawingBufferWidth=t[2]=e[2]=v.drawingBufferWidth,E.viewportHeight=E.framebufferHeight=E.drawingBufferHeight=t[3]=e[3]=v.drawingBufferHeight}function f(){E.tick+=1,E.time=p(),h(),N.procs.poll()}function d(){h(),N.procs.refresh(),k&&k.update()}function p(){return(ye()-A)/1e3}function m(t,e){de.type(e,\"function\",\"listener callback must be a function\");var r;switch(t){case\"frame\":return c(e);case\"lost\":r=G;break;case\"restore\":r=Y;break;case\"destroy\":r=Z;break;default:de.raise(\"invalid event, must be one of frame,lost,restore,destroy\")}return r.push(e),{cancel:function(){for(var t=0;t<r.length;++t)if(r[t]===e)return r[t]=r[r.length-1],void r.pop()}}}var g=W(t);if(!g)return null;var v=g.gl,y=v.getContextAttributes(),b=v.isContextLost(),x=X(v,g);if(!x)return null;var _=B(),w=Xt(),M=x.extensions,k=Ja(v,M),A=ye(),T=v.drawingBufferWidth,S=v.drawingBufferHeight,E={tick:0,time:0,viewportWidth:T,viewportHeight:S,framebufferWidth:T,framebufferHeight:S,drawingBufferWidth:T,drawingBufferHeight:S,pixelRatio:g.pixelRatio},L={},C={elements:null,primitive:4,count:-1,offset:0,instances:-1},z=be(v,M),D=ft(v,w,g),I=dt(v,M,D,w),P=Ot(v,M,z,D,_),O=jt(v,_,w,g),j=zt(v,M,z,function(){N.procs.poll()},E,w,g),R=Mn(v,M,z,w,g),F=It(v,M,z,j,R,w),N=Wt(v,_,M,z,D,I,j,F,L,P,O,C,E,k,g),U=Rt(v,F,N.procs.poll,E,y,M),V=N.next,H=v.canvas,q=[],G=[],Y=[],Z=[g.onDestroy],J=null;H&&(H.addEventListener(eo,i,!1),H.addEventListener(ro,a,!1));var Q=F.setFBO=s({framebuffer:ge.define.call(null,no,\"framebuffer\")});d();var K=$t(s,{clear:u,prop:ge.define.bind(null,no),context:ge.define.bind(null,io),this:ge.define.bind(null,ao),draw:s({}),buffer:function(t){return D.create(t,to,!1,!1)},elements:function(t){return I.create(t,!1)},texture:j.create2D,cube:j.createCube,renderbuffer:R.create,framebuffer:F.create,framebufferCube:F.createCube,attributes:y,frame:c,on:m,limits:z,hasExtension:function(t){return z.extensions.indexOf(t.toLowerCase())>=0},read:U,destroy:o,_gl:v,_refresh:d,poll:function(){f(),k&&k.update()},now:p,stats:w});return g.onDone(null,K),K}var Qt={\"[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},Kt=function(t){return Object.prototype.toString.call(t)in Qt},$t=function(t,e){for(var r=Object.keys(e),n=0;n<r.length;++n)t[r[n]]=e[r[n]];return t},te=[\"gl\",\"canvas\",\"container\",\"attributes\",\"pixelRatio\",\"extensions\",\"optionalExtensions\",\"profile\",\"onDone\"],ee=33071,re=9728,ne=9984,ie=9985,ae=9986,oe=9987,se=5126,le=32819,ue=32820,ce=33635,he=34042,fe={};fe[5120]=fe[5121]=1,fe[5122]=fe[5123]=fe[36193]=fe[ce]=fe[le]=fe[ue]=2,fe[5124]=fe[5125]=fe[se]=fe[he]=4;var de=$t(r,{optional:S,raise:e,commandRaise:M,command:k,parameter:i,commandParameter:A,constructor:u,type:o,commandType:T,isTypedArray:a,nni:s,oneOf:l,shaderError:b,linkError:x,callSite:m,saveCommandRef:_,saveDrawInfo:w,framebufferFormat:E,guessCommand:p,texture2D:z,textureCube:D}),pe=0,me=0,ge={DynamicVariable:I,define:R,isDynamic:F,unbox:N,accessor:j},ve={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},ye=\"undefined\"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date},be=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)}},xe=function(t){return Object.keys(t).map(function(e){return t[e]})},_e=5120,we=5121,Me=5122,ke=5123,Ae=5124,Te=5125,Se=5126,Ee=J(8,function(){return[]}),Le={alloc:$,free:tt,allocType:et,freeType:rt},Ce={shape:lt,flatten:st},ze={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},De={dynamic:35048,stream:35040,static:35044},Ie=Ce.flatten,Pe=Ce.shape,Oe=35044,je=35040,Re=5121,Fe=5126,Ne=[];Ne[5120]=1,Ne[5122]=2,Ne[5124]=4,Ne[5121]=1,Ne[5123]=2,Ne[5125]=4,Ne[5126]=4;var Be={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,\"line loop\":2,\"line strip\":3,\"triangle strip\":5,\"triangle fan\":6},Ue=0,Ve=1,He=4,qe=5120,Ge=5121,Ye=5122,We=5123,Xe=5124,Ze=5125,Je=34963,Qe=35040,Ke=35044,$e=new Float32Array(1),tr=new Uint32Array($e.buffer),er=5123,rr=34467,nr=3553,ir=34067,ar=34069,or=6408,sr=6406,lr=6407,ur=6409,cr=6410,hr=32854,fr=32855,dr=36194,pr=32819,mr=32820,gr=33635,vr=34042,yr=6402,br=34041,xr=35904,_r=35906,wr=36193,Mr=33776,kr=33777,Ar=33778,Tr=33779,Sr=35986,Er=35987,Lr=34798,Cr=35840,zr=35841,Dr=35842,Ir=35843,Pr=36196,Or=5121,jr=5123,Rr=5125,Fr=5126,Nr=10242,Br=10243,Ur=10497,Vr=33071,Hr=33648,qr=10240,Gr=10241,Yr=9728,Wr=9729,Xr=9984,Zr=9985,Jr=9986,Qr=9987,Kr=33170,$r=4352,tn=4353,en=4354,rn=34046,nn=3317,an=37440,on=37441,sn=37443,ln=37444,un=33984,cn=[Xr,Jr,Zr,Qr],hn=[0,ur,cr,lr,or],fn={};fn[ur]=fn[sr]=fn[yr]=1,fn[br]=fn[cr]=2,fn[lr]=fn[xr]=3,fn[or]=fn[_r]=4;var dn=gt(\"HTMLCanvasElement\"),pn=gt(\"CanvasRenderingContext2D\"),mn=gt(\"HTMLImageElement\"),gn=gt(\"HTMLVideoElement\"),vn=Object.keys(Qt).concat([dn,pn,mn,gn]),yn=[];yn[Or]=1,yn[Fr]=4,yn[wr]=2,yn[jr]=2,yn[Rr]=4;var bn=[];bn[hr]=2,bn[fr]=2,bn[dr]=2,bn[br]=4,bn[Mr]=.5,bn[kr]=.5,bn[Ar]=1,bn[Tr]=1,bn[Sr]=.5,bn[Er]=1,bn[Lr]=1,bn[Cr]=.5,bn[zr]=.25,bn[Dr]=.5,bn[Ir]=.25,bn[Pr]=.5;var xn=36161,_n=32854,wn=[];wn[_n]=2,wn[32855]=2,wn[36194]=2,wn[33189]=2,wn[36168]=1,wn[34041]=4,wn[35907]=4,wn[34836]=16,wn[34842]=8,wn[34843]=6;var Mn=function(t,e,r,n,i){function a(t){this.id=h++,this.refCount=1,this.renderbuffer=t,this.format=_n,this.width=0,this.height=0,i.profile&&(this.stats={size:0})}function o(e){var r=e.renderbuffer;de(r,\"must not double destroy renderbuffer\"),t.bindRenderbuffer(xn,null),t.deleteRenderbuffer(r),e.renderbuffer=null,e.refCount=0,delete f[e.id],n.renderbufferCount--}function s(e,o){function s(e,n){var a=0,o=0,l=_n;if(\"object\"==typeof e&&e){var f=e;if(\"shape\"in f){var d=f.shape;de(Array.isArray(d)&&d.length>=2,\"invalid renderbuffer shape\"),a=0|d[0],o=0|d[1]}else\"radius\"in f&&(a=o=0|f.radius),\"width\"in f&&(a=0|f.width),\"height\"in f&&(o=0|f.height);\"format\"in f&&(de.parameter(f.format,u,\"invalid renderbuffer format\"),l=u[f.format])}else\"number\"==typeof e?(a=0|e,o=\"number\"==typeof n?0|n:a):e?de.raise(\"invalid arguments to renderbuffer constructor\"):a=o=1;if(de(a>0&&o>0&&a<=r.maxRenderbufferSize&&o<=r.maxRenderbufferSize,\"invalid renderbuffer size\"),a!==h.width||o!==h.height||l!==h.format)return s.width=h.width=a,s.height=h.height=o,h.format=l,t.bindRenderbuffer(xn,h.renderbuffer),t.renderbufferStorage(xn,l,a,o),i.profile&&(h.stats.size=Dt(h.format,h.width,h.height)),s.format=c[h.format],s}function l(e,n){var a=0|e,o=0|n||a;return a===h.width&&o===h.height?s:(de(a>0&&o>0&&a<=r.maxRenderbufferSize&&o<=r.maxRenderbufferSize,\"invalid renderbuffer size\"),s.width=h.width=a,s.height=h.height=o,t.bindRenderbuffer(xn,h.renderbuffer),t.renderbufferStorage(xn,h.format,a,o),i.profile&&(h.stats.size=Dt(h.format,h.width,h.height)),s)}var h=new a(t.createRenderbuffer());return f[h.id]=h,n.renderbufferCount++,s(e,o),s.resize=l,s._reglType=\"renderbuffer\",s._renderbuffer=h,i.profile&&(s.stats=h.stats),s.destroy=function(){h.decRef()},s}function l(){xe(f).forEach(function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(xn,e.renderbuffer),t.renderbufferStorage(xn,e.format,e.width,e.height)}),t.bindRenderbuffer(xn,null)}var u={rgba4:_n,rgb565:36194,\"rgb5 a1\":32855,depth:33189,stencil:36168,\"depth stencil\":34041};e.ext_srgb&&(u.srgba=35907),e.ext_color_buffer_half_float&&(u.rgba16f=34842,u.rgb16f=34843),e.webgl_color_buffer_float&&(u.rgba32f=34836);var c=[];Object.keys(u).forEach(function(t){var e=u[t];c[e]=t});var h=0,f={};return a.prototype.decRef=function(){--this.refCount<=0&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(f).forEach(function(e){t+=f[e].stats.size}),t}),{create:s,clear:function(){xe(f).forEach(o)},restore:l}},kn=36160,An=36161,Tn=3553,Sn=34069,En=36064,Ln=36096,Cn=36128,zn=33306,Dn=36053,In=6402,Pn=[6408],On=[];On[6408]=4;var jn=[];jn[5121]=1,jn[5126]=4,jn[36193]=2;var Rn=33189,Fn=36168,Nn=34041,Bn=[32854,32855,36194,35907,34842,34843,34836],Un={};Un[Dn]=\"complete\",Un[36054]=\"incomplete attachment\",Un[36057]=\"incomplete dimensions\",Un[36055]=\"incomplete, missing attachment\",Un[36061]=\"unsupported\";var Vn=5126,Hn=35632,qn=35633,Gn=35718,Yn=35721,Wn=6408,Xn=5121,Zn=3333,Jn=5126,Qn=\"xyzw\".split(\"\"),Kn=5121,$n=1,ti=2,ei=0,ri=1,ni=2,ii=3,ai=4,oi=\"dither\",si=\"blend.enable\",li=\"blend.color\",ui=\"blend.equation\",ci=\"blend.func\",hi=\"depth.enable\",fi=\"depth.func\",di=\"depth.range\",pi=\"depth.mask\",mi=\"colorMask\",gi=\"cull.enable\",vi=\"cull.face\",yi=\"frontFace\",bi=\"lineWidth\",xi=\"polygonOffset.enable\",_i=\"polygonOffset.offset\",wi=\"sample.alpha\",Mi=\"sample.enable\",ki=\"sample.coverage\",Ai=\"stencil.enable\",Ti=\"stencil.mask\",Si=\"stencil.func\",Ei=\"stencil.opFront\",Li=\"stencil.opBack\",Ci=\"scissor.enable\",zi=\"scissor.box\",Di=\"viewport\",Ii=\"profile\",Pi=\"framebuffer\",Oi=\"vert\",ji=\"frag\",Ri=\"elements\",Fi=\"primitive\",Ni=\"count\",Bi=\"offset\",Ui=\"instances\",Vi=Pi+\"Width\",Hi=Pi+\"Height\",qi=Di+\"Width\",Gi=Di+\"Height\",Yi=\"drawingBufferWidth\",Wi=\"drawingBufferHeight\",Xi=[ci,ui,Si,Ei,Li,ki,Di,zi,_i],Zi=34962,Ji=34963,Qi=3553,Ki=34067,$i=2884,ta=3042,ea=3024,ra=2960,na=2929,ia=3089,aa=32823,oa=32926,sa=32928,la=5126,ua=35664,ca=35665,ha=35666,fa=5124,da=35667,pa=35668,ma=35669,ga=35670,va=35671,ya=35672,ba=35673,xa=35674,_a=35675,wa=35676,Ma=35678,ka=35680,Aa=4,Ta=1028,Sa=1029,Ea=2304,La=2305,Ca=32775,za=32776,Da=519,Ia=7680,Pa=0,Oa=1,ja=32774,Ra=513,Fa=36160,Na=36064,Ba={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},Ua=[\"constant color, constant alpha\",\"one minus constant color, constant alpha\",\"constant color, one minus constant alpha\",\"one minus constant color, one minus constant alpha\",\"constant alpha, constant color\",\"constant alpha, one minus constant color\",\"one minus constant alpha, constant color\",\"one minus constant alpha, one minus constant color\"],Va={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},Ha={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,\"increment wrap\":34055,\"decrement wrap\":34056,invert:5386},qa={frag:35632,vert:35633},Ga={cw:Ea,ccw:La},Ya=new Ht(!1,!1,!1,function(){}),Wa=34918,Xa=34919,Za=35007,Ja=function(t,e){function r(){return f.pop()||h.createQueryEXT()}function n(t){f.push(t)}function i(t){var e=r();h.beginQueryEXT(Za,e),d.push(e),u(d.length-1,d.length,t)}function a(){h.endQueryEXT(Za)}function o(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}function s(){return p.pop()||new o}function l(t){p.push(t)}function u(t,e,r){var n=s();n.startQueryIndex=t,n.endQueryIndex=e,n.sum=0,n.stats=r,m.push(n)}function c(){var t,e,r=d.length;if(0!==r){v.length=Math.max(v.length,r+1),g.length=Math.max(g.length,r+1),g[0]=0,v[0]=0;var i=0;for(t=0,e=0;e<d.length;++e){var a=d[e];h.getQueryObjectEXT(a,Xa)?(i+=h.getQueryObjectEXT(a,Wa),n(a)):d[t++]=a,g[e+1]=i,v[e+1]=t}for(d.length=t,t=0,e=0;e<m.length;++e){var o=m[e],s=o.startQueryIndex,u=o.endQueryIndex;o.sum+=g[u]-g[s];var c=v[s],f=v[u];f===c?(o.stats.gpuTime+=o.sum/1e6,l(o)):(o.startQueryIndex=c,o.endQueryIndex=f,m[t++]=o)}m.length=t}}var h=e.ext_disjoint_timer_query;if(!h)return null;var f=[],d=[],p=[],m=[],g=[],v=[];return{beginQuery:i,endQuery:a,pushScopeStats:u,update:c,getNumPendingQueries:function(){return d.length},clear:function(){f.push.apply(f,d);for(var t=0;t<f.length;t++)h.deleteQueryEXT(f[t]);d.length=0,f.length=0},restore:function(){d.length=0,f.length=0}}},Qa=16384,Ka=256,$a=1024,to=34962,eo=\"webglcontextlost\",ro=\"webglcontextrestored\",no=1,io=2,ao=3;return Jt})},{}],481:[function(t,e,r){\"use strict\";function n(t,e){if(\"string\"!=typeof t)throw new TypeError(\"expected a string\");if(1===e)return t;if(2===e)return t+t;var r=t.length*e;if(i!==t||void 0===i)i=t,a=\"\";else if(a.length>=r)return a.substr(0,r);for(;r>a.length&&e>1;)1&e&&(a+=t),e>>=1,t+=t;return a+=t,a=a.substr(0,r)}var i,a=\"\";e.exports=n},{}],482:[function(t,e,r){!function(t,n){\"object\"==typeof r?e.exports=n():t.resolveUrl=n()}(this,function(){function t(){var t=arguments.length;if(0===t)throw new Error(\"resolveUrl requires at least one argument; got none.\");var e=document.createElement(\"base\");if(e.href=arguments[0],1===t)return e.href;var r=document.getElementsByTagName(\"head\")[0];r.insertBefore(e,r.firstChild);for(var n,i=document.createElement(\"a\"),a=1;a<t;a++)i.href=arguments[a],n=i.href,e.href=n;return r.removeChild(e),n}return t})},{}],483:[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:{})},{}],484:[function(t,e,r){\"use strict\";function n(t){for(var e=t.length,r=t[t.length-1],n=e,i=e-2;i>=0;--i){var a=r;(u=(s=t[i])-(l=(r=a+s)-a))&&(t[--n]=r,r=u)}for(var o=0,i=n;i<e;++i){var s=r,l=(r=(a=t[i])+s)-a,u=s-l;u&&(t[o++]=u)}return t[o++]=r,t.length=o,t}e.exports=n},{}],485:[function(t,e,r){\"use strict\";function n(t,e){for(var r=new Array(t.length-1),n=1;n<t.length;++n)for(var i=r[n-1]=new Array(t.length-1),a=0,o=0;a<t.length;++a)a!==e&&(i[o++]=t[n][a]);return r}function i(t){for(var e=new Array(t),r=0;r<t;++r){e[r]=new Array(t);for(var n=0;n<t;++n)e[r][n]=[\"m[\",r,\"][\",n,\"]\"].join(\"\")}return e}function a(t){return 1&t?\"-\":\"\"}function o(t){if(1===t.length)return t[0];if(2===t.length)return[\"sum(\",t[0],\",\",t[1],\")\"].join(\"\");var e=t.length>>1;return[\"sum(\",o(t.slice(0,e)),\",\",o(t.slice(e)),\")\"].join(\"\")}function s(t){if(2===t.length)return[\"sum(prod(\",t[0][0],\",\",t[1][1],\"),prod(-\",t[0][1],\",\",t[1][0],\"))\"].join(\"\");for(var e=[],r=0;r<t.length;++r)e.push([\"scale(\",s(n(t,r)),\",\",a(r),t[0][r],\")\"].join(\"\"));return o(e)}function l(t){return new Function(\"sum\",\"scale\",\"prod\",\"compress\",[\"function robustDeterminant\",t,\"(m){return compress(\",s(i(t)),\")};return robustDeterminant\",t].join(\"\"))(c,h,u,f)}var u=t(\"two-product\"),c=t(\"robust-sum\"),h=t(\"robust-scale\"),f=t(\"robust-compress\"),d=6,p=[function(){return[0]},function(t){return[t[0][0]]}];!function(){for(;p.length<d;)p.push(l(p.length));for(var t=[],r=[\"function robustDeterminant(m){switch(m.length){\"],n=0;n<d;++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,p.concat([p,l])),n=0;n<p.length;++n)e.exports[n]=p[n]}()},{\"robust-compress\":484,\"robust-scale\":491,\"robust-sum\":494,\"two-product\":519}],486:[function(t,e,r){\"use strict\";function n(t,e){for(var r=i(t[0],e[0]),n=1;n<t.length;++n)r=a(r,i(t[n],e[n]));return r}var i=t(\"two-product\"),a=t(\"robust-sum\");e.exports=n},{\"robust-sum\":494,\"two-product\":519}],487:[function(t,e,r){\"use strict\";function n(t,e){for(var r=new Array(t.length-1),n=1;n<t.length;++n)for(var i=r[n-1]=new Array(t.length-1),a=0,o=0;a<t.length;++a)a!==e&&(i[o++]=t[n][a]);return r}function i(t){for(var e=new Array(t),r=0;r<t;++r){e[r]=new Array(t);for(var n=0;n<t;++n)e[r][n]=[\"m\",n,\"[\",t-r-2,\"]\"].join(\"\")}return e}function a(t){if(1===t.length)return t[0];if(2===t.length)return[\"sum(\",t[0],\",\",t[1],\")\"].join(\"\");var e=t.length>>1;return[\"sum(\",a(t.slice(0,e)),\",\",a(t.slice(e)),\")\"].join(\"\")}function o(t,e){if(\"m\"===t.charAt(0)){if(\"w\"===e.charAt(0)){var r=t.split(\"[\");return[\"w\",e.substr(1),\"m\",r[0].substr(1)].join(\"\")}return[\"prod(\",t,\",\",e,\")\"].join(\"\")}return o(e,t)}function s(t){return!0&t?\"-\":\"\"}function l(t){if(2===t.length)return[[\"diff(\",o(t[0][0],t[1][1]),\",\",o(t[1][0],t[0][1]),\")\"].join(\"\")];for(var e=[],r=0;r<t.length;++r)e.push([\"scale(\",a(l(n(t,r))),\",\",s(r),t[0][r],\")\"].join(\"\"));return e}function u(t,e){for(var r=[],n=0;n<e-2;++n)r.push([\"prod(m\",t,\"[\",n,\"],m\",t,\"[\",n,\"])\"].join(\"\"));return a(r)}function c(t){for(var e=[],r=[],o=i(t),s=0;s<t;++s)o[0][s]=\"1\",o[t-1][s]=\"w\"+s;for(s=0;s<t;++s)0==(1&s)?e.push.apply(e,l(n(o,s))):r.push.apply(r,l(n(o,s)));for(var c=a(e),h=a(r),f=\"exactInSphere\"+t,d=[],s=0;s<t;++s)d.push(\"m\"+s);for(var p=[\"function \",f,\"(\",d.join(),\"){\"],s=0;s<t;++s){p.push(\"var w\",s,\"=\",u(s,t),\";\");for(var b=0;b<t;++b)b!==s&&p.push(\"var w\",s,\"m\",b,\"=scale(w\",s,\",m\",b,\"[0]);\")}return p.push(\"var p=\",c,\",n=\",h,\",d=diff(p,n);return d[d.length-1];}return \",f),new Function(\"sum\",\"diff\",\"prod\",\"scale\",p.join(\"\"))(g,v,m,y)}function h(){return 0}function f(){return 0}function d(){return 0}function p(t){var e=x[t.length];return e||(e=x[t.length]=c(t.length)),e.apply(void 0,t)}var m=t(\"two-product\"),g=t(\"robust-sum\"),v=t(\"robust-subtract\"),y=t(\"robust-scale\"),b=6,x=[h,f,d];!function(){for(;x.length<=b;)x.push(c(x.length));for(var t=[],r=[\"slow\"],n=0;n<=b;++n)t.push(\"a\"+n),r.push(\"o\"+n);for(var i=[\"function testInSphere(\",t.join(),\"){switch(arguments.length){case 0:case 1:return 0;\"],n=2;n<=b;++n)i.push(\"case \",n,\":return o\",n,\"(\",t.slice(0,n).join(),\");\");i.push(\"}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return testInSphere\"),r.push(i.join(\"\"));var a=Function.apply(void 0,r);for(e.exports=a.apply(void 0,[p].concat(x)),n=0;n<=b;++n)e.exports[n]=x[n]}()},{\"robust-scale\":491,\"robust-subtract\":493,\"robust-sum\":494,\"two-product\":519}],488:[function(t,e,r){\"use strict\";function n(t){for(var e=\"robustLinearSolve\"+t+\"d\",r=[\"function \",e,\"(A,b){return [\"],n=0;n<t;++n){r.push(\"det([\");for(var i=0;i<t;++i){i>0&&r.push(\",\"),r.push(\"[\");for(var a=0;a<t;++a)a>0&&r.push(\",\"),a===n?r.push(\"+b[\",i,\"]\"):r.push(\"+A[\",i,\"][\",a,\"]\");r.push(\"]\")}r.push(\"]),\")}r.push(\"det(A)]}return \",e);var s=new Function(\"det\",r.join(\"\"));return s(t<6?o[t]:o)}function i(){return[0]}function a(t,e){return[[e[0]],[t[0][0]]]}var o=t(\"robust-determinant\"),s=6,l=[i,a];!function(){for(;l.length<s;)l.push(n(l.length));for(var t=[],r=[\"function dispatchLinearSolve(A,b){switch(A.length){\"],i=0;i<s;++i)t.push(\"s\"+i),r.push(\"case \",i,\":return s\",i,\"(A,b);\");r.push(\"}var s=CACHE[A.length];if(!s)s=CACHE[A.length]=g(A.length);return s(A,b)}return dispatchLinearSolve\"),t.push(\"CACHE\",\"g\",r.join(\"\"));var a=Function.apply(void 0,t);for(e.exports=a.apply(void 0,l.concat([l,n])),i=0;i<s;++i)e.exports[i]=l[i]}()},{\"robust-determinant\":485}],489:[function(t,e,r){\"use strict\";function n(t,e){for(var r=new Array(t.length-1),n=1;n<t.length;++n)for(var i=r[n-1]=new Array(t.length-1),a=0,o=0;a<t.length;++a)a!==e&&(i[o++]=t[n][a]);return r}function i(t){for(var e=new Array(t),r=0;r<t;++r){e[r]=new Array(t);for(var n=0;n<t;++n)e[r][n]=[\"m\",n,\"[\",t-r-1,\"]\"].join(\"\")}return e}function a(t){return 1&t?\"-\":\"\"}function o(t){if(1===t.length)return t[0];if(2===t.length)return[\"sum(\",t[0],\",\",t[1],\")\"].join(\"\");var e=t.length>>1;return[\"sum(\",o(t.slice(0,e)),\",\",o(t.slice(e)),\")\"].join(\"\")}function s(t){if(2===t.length)return[[\"sum(prod(\",t[0][0],\",\",t[1][1],\"),prod(-\",t[0][1],\",\",t[1][0],\"))\"].join(\"\")];for(var e=[],r=0;r<t.length;++r)e.push([\"scale(\",o(s(n(t,r))),\",\",a(r),t[0][r],\")\"].join(\"\"));return e}function l(t){for(var e=[],r=[],a=i(t),l=[],u=0;u<t;++u)0==(1&u)?e.push.apply(e,s(n(a,u))):r.push.apply(r,s(n(a,u))),l.push(\"m\"+u);var p=o(e),m=o(r),g=\"orientation\"+t+\"Exact\",v=[\"function \",g,\"(\",l.join(),\"){var p=\",p,\",n=\",m,\",d=sub(p,n);return d[d.length-1];};return \",g].join(\"\");return new Function(\"sum\",\"prod\",\"scale\",\"sub\",v)(h,c,f,d)}function u(t){var e=v[t.length];return e||(e=v[t.length]=l(t.length)),e.apply(void 0,t)}var c=t(\"two-product\"),h=t(\"robust-sum\"),f=t(\"robust-scale\"),d=t(\"robust-subtract\"),p=5,m=l(3),g=l(4),v=[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:m(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],u=r[1]-n[1],c=t[2]-n[2],h=e[2]-n[2],f=r[2]-n[2],d=a*u,p=o*l,m=o*s,v=i*u,y=i*l,b=a*s,x=c*(d-p)+h*(m-v)+f*(y-b),_=7.771561172376103e-16*((Math.abs(d)+Math.abs(p))*Math.abs(c)+(Math.abs(m)+Math.abs(v))*Math.abs(h)+(Math.abs(y)+Math.abs(b))*Math.abs(f));return x>_||-x>_?x:g(t,e,r,n)}];!function(){for(;v.length<=p;)v.push(l(v.length));for(var t=[],r=[\"slow\"],n=0;n<=p;++n)t.push(\"a\"+n),r.push(\"o\"+n);for(var i=[\"function getOrientation(\",t.join(),\"){switch(arguments.length){case 0:case 1:return 0;\"],n=2;n<=p;++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,[u].concat(v)),n=0;n<=p;++n)e.exports[n]=v[n]}()},{\"robust-scale\":491,\"robust-subtract\":493,\"robust-sum\":494,\"two-product\":519}],490:[function(t,e,r){\"use strict\";function n(t,e){if(1===t.length)return a(e,t[0]);if(1===e.length)return a(t,e[0]);if(0===t.length||0===e.length)return[0];var r=[0];if(t.length<e.length)for(n=0;n<t.length;++n)r=i(r,a(e,t[n]));else for(var n=0;n<e.length;++n)r=i(r,a(t,e[n]));return r}var i=t(\"robust-sum\"),a=t(\"robust-scale\");e.exports=n},{\"robust-scale\":491,\"robust-sum\":494}],491:[function(t,e,r){\"use strict\";function n(t,e){var r=t.length;if(1===r){var n=i(t[0],e);return n[0]?n:[n[1]]}var o=new Array(2*r),s=[.1,.1],l=[.1,.1],u=0;i(t[0],e,s),s[0]&&(o[u++]=s[0]);for(var c=1;c<r;++c){i(t[c],e,l);var h=s[1];a(h,l[0],s),s[0]&&(o[u++]=s[0]);var f=l[1],d=s[1],p=f+d,m=d-(p-f);s[1]=p,m&&(o[u++]=m)}return s[1]&&(o[u++]=s[1]),0===u&&(o[u++]=0),o.length=u,o}var i=t(\"two-product\"),a=t(\"two-sum\");e.exports=n},{\"two-product\":519,\"two-sum\":520}],492:[function(t,e,r){\"use strict\";function n(t,e,r,n){for(var i=0;i<2;++i){var a=t[i],o=e[i],s=Math.min(a,o),l=Math.max(a,o),u=r[i],c=n[i],h=Math.min(u,c);if(Math.max(u,c)<s||l<h)return!1}return!0}function i(t,e,r,i){var o=a(t,r,i),s=a(e,r,i);if(o>0&&s>0||o<0&&s<0)return!1;var l=a(r,t,e),u=a(i,t,e);return!(l>0&&u>0||l<0&&u<0)&&(0!==o||0!==s||0!==l||0!==u||n(t,e,r,i))}e.exports=i;var a=t(\"robust-orientation\")[3]},{\"robust-orientation\":489}],493:[function(t,e,r){\"use strict\";function n(t,e){var r=t+e,n=r-t,i=t-(r-n)+(e-n);return i?[i,r]:[r]}function i(t,e){var r=0|t.length,i=0|e.length;if(1===r&&1===i)return n(t[0],-e[0]);var a,o,s=r+i,l=new Array(s),u=0,c=0,h=0,f=Math.abs,d=t[c],p=f(d),m=-e[h],g=f(m);p<g?(o=d,(c+=1)<r&&(p=f(d=t[c]))):(o=m,(h+=1)<i&&(g=f(m=-e[h]))),c<r&&p<g||h>=i?(a=d,(c+=1)<r&&(p=f(d=t[c]))):(a=m,(h+=1)<i&&(g=f(m=-e[h])));for(var v,y,b=a+o,x=b-a,_=o-x,w=_,M=b;c<r&&h<i;)p<g?(a=d,(c+=1)<r&&(p=f(d=t[c]))):(a=m,(h+=1)<i&&(g=f(m=-e[h]))),(_=(o=w)-(x=(b=a+o)-a))&&(l[u++]=_),w=M-((v=M+b)-(y=v-M))+(b-y),M=v;for(;c<r;)(_=(o=w)-(x=(b=(a=d)+o)-a))&&(l[u++]=_),w=M-((v=M+b)-(y=v-M))+(b-y),M=v,(c+=1)<r&&(d=t[c]);for(;h<i;)(_=(o=w)-(x=(b=(a=m)+o)-a))&&(l[u++]=_),w=M-((v=M+b)-(y=v-M))+(b-y),M=v,(h+=1)<i&&(m=-e[h]);return w&&(l[u++]=w),M&&(l[u++]=M),u||(l[u++]=0),l.length=u,l}e.exports=i},{}],494:[function(t,e,r){\"use strict\";function n(t,e){var r=t+e,n=r-t,i=t-(r-n)+(e-n);return i?[i,r]:[r]}function i(t,e){var r=0|t.length,i=0|e.length;if(1===r&&1===i)return n(t[0],e[0]);var a,o,s=r+i,l=new Array(s),u=0,c=0,h=0,f=Math.abs,d=t[c],p=f(d),m=e[h],g=f(m);p<g?(o=d,(c+=1)<r&&(p=f(d=t[c]))):(o=m,(h+=1)<i&&(g=f(m=e[h]))),c<r&&p<g||h>=i?(a=d,(c+=1)<r&&(p=f(d=t[c]))):(a=m,(h+=1)<i&&(g=f(m=e[h])));for(var v,y,b=a+o,x=b-a,_=o-x,w=_,M=b;c<r&&h<i;)p<g?(a=d,(c+=1)<r&&(p=f(d=t[c]))):(a=m,(h+=1)<i&&(g=f(m=e[h]))),(_=(o=w)-(x=(b=a+o)-a))&&(l[u++]=_),w=M-((v=M+b)-(y=v-M))+(b-y),M=v;for(;c<r;)(_=(o=w)-(x=(b=(a=d)+o)-a))&&(l[u++]=_),w=M-((v=M+b)-(y=v-M))+(b-y),M=v,(c+=1)<r&&(d=t[c]);for(;h<i;)(_=(o=w)-(x=(b=(a=m)+o)-a))&&(l[u++]=_),w=M-((v=M+b)-(y=v-M))+(b-y),M=v,(h+=1)<i&&(m=e[h]);return w&&(l[u++]=w),M&&(l[u++]=M),u||(l[u++]=0),l.length=u,l}e.exports=i},{}],495:[function(t,e,r){!function(t,n){\"object\"==typeof r&&void 0!==e?e.exports=n():t.ShelfPack=n()}(this,function(){function t(t,e,r){r=r||{},this.w=t||64,this.h=e||64,this.autoResize=!!r.autoResize,this.shelves=[],this.stats={},this.count=function(t){this.stats[t]=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,u=0;u<this.shelves.length;u++){var c=this.shelves[u];l+=c.h,s=Math.max(c.w-c.free,s)}this.resize(s,l)}return a},t.prototype.packOne=function(t,r){for(var n,i,a=0,o={shelf:-1,waste:1/0},s=0;s<this.shelves.length;s++){if(n=this.shelves[s],a+=n.h,r===n.h&&t<=n.free)return this.count(r),n.alloc(t,r);r>n.h||t>n.free||r<n.h&&t<=n.free&&(i=n.h-r)<o.waste&&(o.waste=i,o.shelf=s)}if(-1!==o.shelf)return n=this.shelves[o.shelf],this.count(r),n.alloc(t,r);if(r<=this.h-a&&t<=this.w)return n=new e(a,this.w,r),this.shelves.push(n),this.count(r),n.alloc(t,r);if(this.autoResize){var l,u,c,h;return l=u=this.h,((c=h=this.w)<=l||t>c)&&(h=2*Math.max(t,c)),(l<c||r>l)&&(u=2*Math.max(r,l)),this.resize(h,u),this.packOne(t,r)}return null},t.prototype.clear=function(){this.shelves=[],this.stats={}},t.prototype.resize=function(t,e){this.w=t,this.h=e;for(var r=0;r<this.shelves.length;r++)this.shelves[r].resize(t);return!0},e.prototype.alloc=function(t,e){if(t>this.free||e>this.h)return null;var r=this.x;return this.x+=t,this.free-=t,{x:r,y:this.y,w:t,h:e,width:t,height:e}},e.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0},t})},{}],496:[function(t,e,r){\"use strict\";e.exports=function(t){return t<0?-1:t>0?1:0}},{}],497:[function(t,e,r){\"use strict\";function n(t){return a(i(t))}e.exports=n;var i=t(\"boundary-cells\"),a=t(\"reduce-simplicial-complex\")},{\"boundary-cells\":62,\"reduce-simplicial-complex\":479}],498:[function(t,e,r){\"use strict\";function n(t){for(var e=t.length,r=0,n=0;n<e;++n)r=0|Math.max(r,t[n].length);return r-1}function i(t,e){for(var r=t.length,n=h.mallocUint8(r),i=0;i<r;++i)n[i]=t[i]<e|0;return n}function a(t,e){for(var r=t.length,n=e*(e+1)/2*r|0,i=h.mallocUint32(2*n),a=0,o=0;o<r;++o)for(var s=t[o],e=s.length,l=0;l<e;++l)for(var u=0;u<l;++u){var d=s[u],p=s[l];i[a++]=0|Math.min(d,p),i[a++]=0|Math.max(d,p)}f(c(i,[a/2|0,2]));for(var m=2,o=2;o<a;o+=2)i[o-2]===i[o]&&i[o-1]===i[o+1]||(i[m++]=i[o],i[m++]=i[o+1]);return c(i,[m/2|0,2])}function o(t,e,r,n){for(var i=t.data,a=t.shape[0],o=h.mallocDouble(a),s=0,l=0;l<a;++l){var u=i[2*l],f=i[2*l+1];if(r[u]!==r[f]){var d=e[u],p=e[f];i[2*s]=u,i[2*s+1]=f,o[s++]=(p-n)/(p-d)}}return t.shape[0]=s,c(o,[s])}function s(t,e){var r=h.mallocInt32(2*e),n=t.shape[0],i=t.data;r[0]=0;for(var a=0,o=0;o<n;++o){var s=i[2*o];if(s!==a){for(r[2*a+1]=o;++a<s;)r[2*a]=o,r[2*a+1]=o;r[2*a]=o}}for(r[2*a+1]=n;++a<e;)r[2*a]=r[2*a+1]=n;return r}function l(t){for(var e=0|t.shape[0],r=t.data,n=new Array(e),i=0;i<e;++i)n[i]=[r[2*i],r[2*i+1]];return n}function u(t,e,r,u){if(r=r||0,void 0===u&&(u=n(t)),0===t.length||u<1)return{cells:[],vertexIds:[],vertexWeights:[]};var c=i(e,+r),f=a(t,u),p=o(f,e,c,+r),m=s(f,0|e.length),g=d(u)(t,f.data,m,c),v=l(f),y=[].slice.call(p.data,0,p.shape[0]);return h.free(c),h.free(f.data),h.free(p.data),h.free(m),{cells:g,vertexIds:v,vertexWeights:y}}e.exports=u;var c=t(\"ndarray\"),h=t(\"typedarray-pool\"),f=t(\"ndarray-sort\"),d=t(\"./lib/codegen\")},{\"./lib/codegen\":499,ndarray:449,\"ndarray-sort\":447,\"typedarray-pool\":521}],499:[function(t,e,r){\"use strict\";function n(t){var e=0,r=new Array(t+1);r[0]=[[]];for(l=1;l<=t;++l)for(var n=r[l]=o(l),i=0;i<n.length;++i)e=Math.max(e,n[l].length);for(var s=[\"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;\"],l=t+1;l>1;--l){l<t+1&&s.push(\"else \"),s.push(\"if(l===\",l,\"){\");for(var u=[],i=0;i<l;++i)u.push(\"(S[c[\"+i+\"]]<<\"+i+\")\");s.push(\"var M=\",u.join(\"+\"),\";if(M===0||M===\",(1<<l)-1,\"){continue}switch(M){\");for(var n=r[l-1],i=0;i<n.length;++i)s.push(\"case \",i,\":\"),function(t){if(!(t.length<=0)){s.push(\"R.push(\");for(var e=0;e<t.length;++e){var r=t[e];e>0&&s.push(\",\"),s.push(\"[\");for(var n=0;n<r.length;++n){var i=r[n];n>0&&s.push(\",\"),s.push(\"B(C,E,c[\",i[0],\"],c[\",i[1],\"])\")}s.push(\"]\")}s.push(\");\")}}(n[i]),s.push(\"break;\");s.push(\"}}\")}return s.push(\"}return R;};return getContour\",t,\"d\"),new Function(\"pool\",s.join(\"\"))(a)}function i(t){var e=s[t];return e||(e=s[t]=n(t)),e}e.exports=i;var a=t(\"typedarray-pool\"),o=t(\"marching-simplex-table\"),s={}},{\"marching-simplex-table\":427,\"typedarray-pool\":521}],500:[function(t,e,r){\"use strict\";\"use restrict\";function n(t){for(var e=0,r=Math.max,n=0,i=t.length;n<i;++n)e=r(e,t[n].length);return e-1}function i(t){for(var e=-1,r=Math.max,n=0,i=t.length;n<i;++n)for(var a=t[n],o=0,s=a.length;o<s;++o)e=r(e,a[o]);return e+1}function a(t){for(var e=new Array(t.length),r=0,n=t.length;r<n;++r)e[r]=t[r].slice(0);return e}function o(t,e){var r=t.length,n=t.length-e.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return(u=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(u=a+t[2]-(o+e[2]))return u;var s=i(t[0],t[1]),l=i(e[0],e[1]),u=i(s,t[2])-i(l,e[2]);return u||i(s+t[2],a)-i(l+e[2],o);default:var c=t.slice(0);c.sort();var h=e.slice(0);h.sort();for(var f=0;f<r;++f)if(n=c[f]-h[f])return n;return 0}}function s(t,e){return o(t[0],e[0])}function l(t,e){if(e){for(var r=t.length,n=new Array(r),i=0;i<r;++i)n[i]=[t[i],e[i]];n.sort(s);for(i=0;i<r;++i)t[i]=n[i][0],e[i]=n[i][1];return t}return t.sort(o),t}function u(t){if(0===t.length)return[];for(var e=1,r=t.length,n=1;n<r;++n){var i=t[n];if(o(i,t[n-1])){if(n===e){e++;continue}t[e++]=i}}return t.length=e,t}function c(t,e){for(var r=0,n=t.length-1,i=-1;r<=n;){var a=r+n>>1,s=o(t[a],e);s<=0?(0===s&&(i=a),r=a+1):s>0&&(n=a-1)}return i}function h(t,e){for(var r=new Array(t.length),n=0,i=r.length;n<i;++n)r[n]=[];for(var a=[],n=0,s=e.length;n<s;++n)for(var l=e[n],u=l.length,h=1,f=1<<u;h<f;++h){a.length=b.popCount(h);for(var d=0,p=0;p<u;++p)h&1<<p&&(a[d++]=l[p]);var m=c(t,a);if(!(m<0))for(;;)if(r[m++].push(n),m>=t.length||0!==o(t[m],a))break}return r}function f(t,e){if(!e)return h(u(p(t,0)),t,0);for(var r=new Array(e),n=0;n<e;++n)r[n]=[];for(var n=0,i=t.length;n<i;++n)for(var a=t[n],o=0,s=a.length;o<s;++o)r[a[o]].push(n);return r}function d(t){for(var e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0|i.length,o=1,s=1<<a;o<s;++o){for(var u=[],c=0;c<a;++c)o>>>c&1&&u.push(i[c]);e.push(u)}return l(e)}function p(t,e){if(e<0)return[];for(var r=[],n=(1<<e+1)-1,i=0;i<t.length;++i)for(var a=t[i],o=n;o<1<<a.length;o=b.nextCombination(o)){for(var s=new Array(e+1),u=0,c=0;c<a.length;++c)o&1<<c&&(s[u++]=a[c]);r.push(s)}return l(r)}function m(t){for(var e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,o=i.length;a<o;++a){for(var s=new Array(i.length-1),u=0,c=0;u<o;++u)u!==a&&(s[c++]=i[u]);e.push(s)}return l(e)}function g(t,e){for(var r=new x(e),n=0;n<t.length;++n)for(var i=t[n],a=0;a<i.length;++a)for(var o=a+1;o<i.length;++o)r.link(i[a],i[o]);for(var s=[],l=r.ranks,n=0;n<l.length;++n)l[n]=-1;for(n=0;n<t.length;++n){var u=r.find(t[n][0]);l[u]<0?(l[u]=s.length,s.push([t[n].slice(0)])):s[l[u]].push(t[n].slice(0))}return s}function v(t){for(var e=u(l(p(t,0))),r=new x(e.length),n=0;n<t.length;++n)for(var i=t[n],a=0;a<i.length;++a)for(var o=c(e,[i[a]]),s=a+1;s<i.length;++s)r.link(o,c(e,[i[s]]));for(var h=[],f=r.ranks,n=0;n<f.length;++n)f[n]=-1;for(n=0;n<t.length;++n){var d=r.find(c(e,[t[n][0]]));f[d]<0?(f[d]=h.length,h.push([t[n].slice(0)])):h[f[d]].push(t[n].slice(0))}return h}function y(t,e){return e?g(t,e):v(t)}var b=t(\"bit-twiddle\"),x=t(\"union-find\");r.dimension=n,r.countVertices=i,r.cloneCells=a,r.compareCells=o,r.normalize=l,r.unique=u,r.findCell=c,r.incidence=h,r.dual=f,r.explode=d,r.skeleton=p,r.boundary=m,r.connectedComponents=y},{\"bit-twiddle\":60,\"union-find\":522}],501:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],502:[function(t,e,r){arguments[4][500][0].apply(r,arguments)},{\"bit-twiddle\":501,dup:500,\"union-find\":503}],503:[function(t,e,r){\"use strict\";\"use restrict\";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e<t;++e)this.roots[e]=e,this.ranks[e]=0}e.exports=n,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])}}},{}],504:[function(t,e,r){\"use strict\";function n(t,e,r){return Math.abs(a(t,e,r))/Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}function i(t,e,r){function i(t){if(b[t])return 1/0;var r=g[t],i=v[t];return r<0||i<0?1/0:n(e[t],e[r],e[i])}function a(t,e){var r=k[t],n=k[e];k[t]=n,k[e]=r,A[r]=e,A[n]=t}function s(t){return y[k[t]]}function l(t){return 1&t?t-1>>1:(t>>1)-1}function u(t){for(var e=s(t);;){var r=e,n=2*t+1,i=2*(t+1),o=t;if(n<T){var l=s(n);l<r&&(o=n,r=l)}if(i<T&&s(i)<r&&(o=i),o===t)return t;a(t,o),t=o}}function c(t){for(var e=s(t);t>0;){var r=l(t);{if(!(r>=0&&e<s(r)))return t;a(t,r),t=r}}}function h(){if(T>0){var t=k[0];return a(0,T-1),T-=1,u(0),t}return-1}function f(t,e){var r=k[t];return y[r]===e?t:(y[r]=-1/0,c(t),h(),y[r]=e,T+=1,c(T-1))}function d(t,e){if(t[e]<0)return e;var r=e,n=e;do{var i=t[n];if(!b[n]||i<0||i===n)break;if(n=i,i=t[n],!b[n]||i<0||i===n)break;n=i,r=t[r]}while(r!==n);for(var a=e;a!==n;a=t[a])t[a]=n;return n}for(var p=e.length,m=t.length,g=new Array(p),v=new Array(p),y=new Array(p),b=new Array(p),x=0;x<p;++x)g[x]=v[x]=-1,y[x]=1/0,b[x]=!1;for(x=0;x<m;++x){var _=t[x];if(2!==_.length)throw new Error(\"Input must be a graph\");var w=_[1],M=_[0];-1!==v[M]?v[M]=-2:v[M]=w,-1!==g[w]?g[w]=-2:g[w]=M}for(var k=[],A=new Array(p),x=0;x<p;++x)(y[x]=i(x))<1/0?(A[x]=k.length,k.push(x)):A[x]=-1;for(var T=k.length,x=T>>1;x>=0;--x)u(x);for(;;){var S=h();if(S<0||y[S]>r)break;!function(t){if(!b[t]){b[t]=!0;var e=g[t],r=v[t];g[r]>=0&&(g[r]=e),v[e]>=0&&(v[e]=r),A[e]>=0&&f(A[e],i(e)),A[r]>=0&&f(A[r],i(r))}}(S)}for(var E=[],x=0;x<p;++x)b[x]||(A[x]=E.length,E.push(e[x].slice()));E.length;var L=[];return t.forEach(function(t){var e=d(g,t[0]),r=d(v,t[1]);if(e>=0&&r>=0&&e!==r){var n=A[e],i=A[r];n!==i&&L.push([n,i])}}),o.unique(o.normalize(L)),{positions:E,edges:L}}e.exports=i;var a=t(\"robust-orientation\"),o=t(\"simplicial-complex\")},{\"robust-orientation\":489,\"simplicial-complex\":502}],505:[function(t,e,r){\"use strict\";function n(t,e){var r,n;if(e[0][0]<e[1][0])r=e[0],n=e[1];else{if(!(e[0][0]>e[1][0])){var i=Math.min(t[0][1],t[1][1]),o=Math.max(t[0][1],t[1][1]),s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]);return o<s?o-s:i>l?i-l:o-l}r=e[1],n=e[0]}var u,c;t[0][1]<t[1][1]?(u=t[0],c=t[1]):(u=t[1],c=t[0]);var h=a(n,r,u);return h||((h=a(n,r,c))||c-n)}function i(t,e){var r,i;if(e[0][0]<e[1][0])r=e[0],i=e[1];else{if(!(e[0][0]>e[1][0]))return n(e,t);r=e[1],i=e[0]}var o,s;if(t[0][0]<t[1][0])o=t[0],s=t[1];else{if(!(t[0][0]>t[1][0]))return-n(t,e);o=t[1],s=t[0]}var l=a(r,i,s),u=a(r,i,o);if(l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;if(l=a(s,o,i),u=a(s,o,r),l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;return i[0]-s[0]}e.exports=i;var a=t(\"robust-orientation\")},{\"robust-orientation\":489}],506:[function(t,e,r){\"use strict\";function n(t,e,r){this.slabs=t,this.coordinates=e,this.horizontal=r}function i(t,e){return t.y-e}function a(t,e){for(var r=null;t;){var n,i,o=t.key;o[0][0]<o[1][0]?(n=o[0],i=o[1]):(n=o[1],i=o[0]);var s=h(n,i,e);if(s<0)t=t.left;else if(s>0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=a(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l=a(t.right,e);if(l)return l;t=t.left}}return r}function o(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function s(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}function l(t){for(var e=t.length,r=2*e,i=new Array(r),a=0;a<e;++a){var l=t[a],u=l[0][0]<l[1][0];i[2*a]=new s(l[0][0],l,u,a),i[2*a+1]=new s(l[1][0],l,!u,a)}i.sort(function(t,e){var r=t.x-e.x;return r||((r=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=c(f),d=[],p=[],m=[],a=0;a<r;){for(var g=i[a].x,v=[];a<r;){var y=i[a];if(y.x!==g)break;a+=1,y.segment[0][0]===y.x&&y.segment[1][0]===y.x?y.create&&(y.segment[0][1]<y.segment[1][1]?(v.push(new o(y.segment[0][1],y.index,!0,!0)),v.push(new o(y.segment[1][1],y.index,!1,!1))):(v.push(new o(y.segment[1][1],y.index,!0,!1)),v.push(new o(y.segment[0][1],y.index,!1,!0)))):h=y.create?h.insert(y.segment,y.index):h.remove(y.segment)}d.push(h.root),p.push(g),m.push(v)}return new n(d,p,m)}e.exports=l;var u=t(\"binary-search-bounds\"),c=t(\"functional-red-black-tree\"),h=t(\"robust-orientation\"),f=t(\"./lib/order-segments\");n.prototype.castUp=function(t){var e=u.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=a(this.slabs[e],t),n=-1;if(r&&(n=r.value),this.coordinates[e]===t[0]){var o=null;if(r&&(o=r.key),e>0){var s=a(this.slabs[e-1],t);s&&(o?f(s.key,o)>0&&(o=s.key,n=s.value):(n=s.value,o=s.key))}var l=this.horizontal[e];if(l.length>0){var c=u.ge(l,t[1],i);if(c<l.length){var d=l[c];if(t[1]===d.y){if(d.closed)return d.index;for(;c<l.length-1&&l[c+1].y===t[1];)if(c+=1,(d=l[c]).closed)return d.index;if(d.y===t[1]&&!d.start){if((c+=1)>=l.length)return n;d=l[c]}}if(d.start)if(o){var p=h(o[0],o[1],[t[0],d.y]);o[0][0]>o[1][0]&&(p=-p),p>0&&(n=d.index)}else n=d.index;else d.y!==t[1]&&(n=d.index)}}}return n}},{\"./lib/order-segments\":505,\"binary-search-bounds\":59,\"functional-red-black-tree\":120,\"robust-orientation\":489}],507:[function(t,e,r){\"use strict\";function n(t,e){var r=u(l(t,e),[e[e.length-1]]);return r[r.length-1]}function i(t,e,r,n){var i=-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}function a(t,e){for(var r=[],a=[],o=n(t[t.length-1],e),s=t[t.length-1],l=t[0],u=0;u<t.length;++u,s=l){var c=n(l=t[u],e);if(o<0&&c>0||o>0&&c<0){var h=i(s,c,l,o);r.push(h),a.push(h.slice())}c<0?a.push(l.slice()):c>0?r.push(l.slice()):(r.push(l.slice()),a.push(l.slice())),o=c}return{positive:r,negative:a}}function o(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l<t.length;++l,o=s){var u=n(s=t[l],e);(a<0&&u>0||a>0&&u<0)&&r.push(i(o,u,s,a)),u>=0&&r.push(s.slice()),a=u}return r}function s(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l<t.length;++l,o=s){var u=n(s=t[l],e);(a<0&&u>0||a>0&&u<0)&&r.push(i(o,u,s,a)),u<=0&&r.push(s.slice()),a=u}return r}var l=t(\"robust-dot-product\"),u=t(\"robust-sum\");e.exports=a,e.exports.positive=o,e.exports.negative=s},{\"robust-dot-product\":486,\"robust-sum\":494}],508:[function(t,e,r){!function(t){function e(){var t=arguments[0],r=e.cache;return r[t]&&r.hasOwnProperty(t)||(r[t]=e.parse(t)),e.format.call(null,r[t],arguments)}function n(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function i(t,e){return Array(e+1).join(t)}var a={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\\x25]+/,modulo:/^\\x25{2}/,placeholder:/^\\x25(?:([1-9]\\d*)\\$|\\(([^\\)]+)\\))?(\\+)?(0|'[^$])?(-)?(\\d+)?(?:\\.(\\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\\d]*)/i,key_access:/^\\.([a-z_][a-z_\\d]*)/i,index_access:/^\\[(\\d+)\\]/,sign:/^[\\+\\-]/};e.format=function(t,r){var o,s,l,u,c,h,f,d=1,p=t.length,m=\"\",g=[],v=!0,y=\"\";for(s=0;s<p;s++)if(\"string\"===(m=n(t[s])))g[g.length]=t[s];else if(\"array\"===m){if((u=t[s])[2])for(o=r[d],l=0;l<u[2].length;l++){if(!o.hasOwnProperty(u[2][l]))throw new Error(e(\"[sprintf] property '%s' does not exist\",u[2][l]));o=o[u[2][l]]}else o=u[1]?r[u[1]]:r[d++];if(\"function\"==n(o)&&(o=o()),a.not_string.test(u[8])&&a.not_json.test(u[8])&&\"number\"!=n(o)&&isNaN(o))throw new TypeError(e(\"[sprintf] expecting number but found %s\",n(o)));switch(a.number.test(u[8])&&(v=o>=0),u[8]){case\"b\":o=o.toString(2);break;case\"c\":o=String.fromCharCode(o);break;case\"d\":case\"i\":o=parseInt(o,10);break;case\"j\":o=JSON.stringify(o,null,u[6]?parseInt(u[6]):0);break;case\"e\":o=u[7]?o.toExponential(u[7]):o.toExponential();break;case\"f\":o=u[7]?parseFloat(o).toFixed(u[7]):parseFloat(o);break;case\"g\":o=u[7]?parseFloat(o).toPrecision(u[7]):parseFloat(o);break;case\"o\":o=o.toString(8);break;case\"s\":o=(o=String(o))&&u[7]?o.substring(0,u[7]):o;break;case\"u\":o>>>=0;break;case\"x\":o=o.toString(16);break;case\"X\":o=o.toString(16).toUpperCase()}a.json.test(u[8])?g[g.length]=o:(!a.number.test(u[8])||v&&!u[3]?y=\"\":(y=v?\"+\":\"-\",o=o.toString().replace(a.sign,\"\")),h=u[4]?\"0\"===u[4]?\"0\":u[4].charAt(1):\" \",f=u[6]-(y+o).length,c=u[6]&&f>0?i(h,f):\"\",g[g.length]=u[5]?y+o+c:\"0\"===h?y+c+o:c+y+o)}return g.join(\"\")},e.cache={},e.parse=function(t){for(var e=t,r=[],n=[],i=0;e;){if(null!==(r=a.text.exec(e)))n[n.length]=r[0];else if(null!==(r=a.modulo.exec(e)))n[n.length]=\"%\";else{if(null===(r=a.placeholder.exec(e)))throw new SyntaxError(\"[sprintf] unexpected placeholder\");if(r[2]){i|=1;var o=[],s=r[2],l=[];if(null===(l=a.key.exec(s)))throw new SyntaxError(\"[sprintf] failed to parse named argument key\");for(o[o.length]=l[1];\"\"!==(s=s.substring(l[0].length));)if(null!==(l=a.key_access.exec(s)))o[o.length]=l[1];else{if(null===(l=a.index_access.exec(s)))throw new SyntaxError(\"[sprintf] failed to parse named argument key\");o[o.length]=l[1]}r[2]=o}else i|=2;if(3===i)throw new Error(\"[sprintf] mixing positional and named placeholders is not (yet) supported\");n[n.length]=r}e=e.substring(r[0].length)}return n};var o=function(t,r,n){return(n=(r||[]).slice(0)).splice(0,0,t),e.apply(null,n)};void 0!==r?(r.sprintf=e,r.vsprintf=o):(t.sprintf=e,t.vsprintf=o)}(\"undefined\"==typeof window?this:window)},{}],509:[function(t,e,r){\"use strict\";function n(t){return new i(t)}function i(t){this.options=d(Object.create(this.options),t),this.trees=new Array(this.options.maxZoom+1)}function a(t,e,r,n,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:u(r[0]),y:c(r[1]),zoom:1/0,id:e,parentId:-1}}function s(t){return{type:\"Feature\",properties:l(t),geometry:{type:\"Point\",coordinates:[h(t.x),f(t.y)]}}}function l(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+\"k\":e>=1e3?Math.round(e/100)/10+\"k\":e;return d(d({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function u(t){return t/360+.5}function c(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function h(t){return 360*(t-.5)}function f(t){var e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function d(t,e){for(var r in e)t[r]=e[r];return t}function p(t){return t.x}function m(t){return t.y}var g=t(\"kdbush\");e.exports=n,i.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,initial:function(){return{}},map:function(t){return t}},load:function(t){var e=this.options.log;e&&console.time(\"total time\");var r=\"prepare \"+t.length+\" points\";e&&console.time(r),this.points=t;var n=t.map(o);e&&console.timeEnd(r);for(var i=this.options.maxZoom;i>=this.options.minZoom;i--){var a=+Date.now();this.trees[i+1]=g(n,p,m,this.options.nodeSize,Float32Array),n=this._cluster(n,i),e&&console.log(\"z%d: %d clusters in %dms\",i,n.length,+Date.now()-a)}return this.trees[this.options.minZoom]=g(n,p,m,this.options.nodeSize,Float32Array),e&&console.timeEnd(\"total time\"),this},getClusters:function(t,e){for(var r=this.trees[this._limitZoom(e)],n=r.range(u(t[0]),c(t[3]),u(t[2]),c(t[1])),i=[],a=0;a<n.length;a++){var o=r.points[n[a]];i.push(o.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,u={features:[]};return this._addTileFeatures(n.range((e-o)/i,s,(e+1+o)/i,l),n.points,e,r,i,u),0===e&&this._addTileFeatures(n.range(1-o/i,s,1,l),n.points,i,r,i,u),e===i-1&&this._addTileFeatures(n.range(0,s,o/i,l),n.points,-1,r,i,u),u.features.length?u: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),u=o.numPoints||1,c=o.x*u,h=o.y*u,f=null;this.options.reduce&&(f=this.options.initial(),this._accumulate(f,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,c+=p.x*m,h+=p.y*m,u+=m,p.parentId=i,this.options.reduce&&this._accumulate(f,p)}}1===u?r.push(o):(o.parentId=i,r.push(a(c/u,h/u,u,i,f)))}}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:280}],510:[function(t,e,r){\"use strict\";function n(t){return t.split(\"\").map(function(t){return t in i?i[t]:\"\"}).join(\"\")}e.exports=n;var i={\" \":\" \",0:\"⁰\",1:\"¹\",2:\"²\",3:\"³\",4:\"⁴\",5:\"⁵\",6:\"⁶\",7:\"⁷\",8:\"⁸\",9:\"⁹\",\"+\":\"⁺\",\"-\":\"⁻\",a:\"ᵃ\",b:\"ᵇ\",c:\"ᶜ\",d:\"ᵈ\",e:\"ᵉ\",f:\"ᶠ\",g:\"ᵍ\",h:\"ʰ\",i:\"ⁱ\",j:\"ʲ\",k:\"ᵏ\",l:\"ˡ\",m:\"ᵐ\",n:\"ⁿ\",o:\"ᵒ\",p:\"ᵖ\",r:\"ʳ\",s:\"ˢ\",t:\"ᵗ\",u:\"ᵘ\",v:\"ᵛ\",w:\"ʷ\",x:\"ˣ\",y:\"ʸ\",z:\"ᶻ\"}},{}],511:[function(t,e,r){\"use strict\";function n(t,e){var r=t.length,n=[\"'use strict';\"],i=\"surfaceNets\"+t.join(\"_\")+\"d\"+e;n.push(\"var contour=genContour({\",\"order:[\",t.join(),\"],\",\"scalarArguments: 3,\",\"phase:function phaseFunc(p,a,b,c) { return (p > c)|0 },\"),\"generic\"===e&&n.push(\"getters:[0],\");for(var a=[],l=[],u=0;u<r;++u)a.push(\"d\"+u),l.push(\"d\"+u);for(u=0;u<1<<r;++u)a.push(\"v\"+u),l.push(\"v\"+u);for(u=0;u<1<<r;++u)a.push(\"p\"+u),l.push(\"p\"+u);a.push(\"a\",\"b\",\"c\"),l.push(\"a\",\"c\"),n.push(\"vertex:function vertexFunc(\",a.join(),\"){\");for(var c=[],u=0;u<1<<r;++u)c.push(\"(p\"+u+\"<<\"+u+\")\");n.push(\"var m=(\",c.join(\"+\"),\")|0;if(m===0||m===\",(1<<(1<<r))-1,\"){return}\");var h=[],f=[];1<<(1<<r)<=128?(n.push(\"switch(m){\"),f=n):n.push(\"switch(m>>>7){\");for(u=0;u<1<<(1<<r);++u){if(1<<(1<<r)>128&&u%128==0){h.length>0&&f.push(\"}}\");var d=\"vExtra\"+h.length;n.push(\"case \",u>>>7,\":\",d,\"(m&0x7f,\",l.join(),\");break;\"),f=[\"function \",d,\"(m,\",l.join(),\"){switch(m){\"],h.push(f)}f.push(\"case \",127&u,\":\");for(var p=new Array(r),m=new Array(r),g=new Array(r),v=new Array(r),y=0,b=0;b<r;++b)p[b]=[],m[b]=[],g[b]=0,v[b]=0;for(b=0;b<1<<r;++b)for(k=0;k<r;++k){var x=b^1<<k;if(!(x>b)&&!(u&1<<x)!=!(u&1<<b)){var _=1;u&1<<x?m[k].push(\"v\"+x+\"-v\"+b):(m[k].push(\"v\"+b+\"-v\"+x),_=-_),_<0?(p[k].push(\"-v\"+b+\"-v\"+x),g[k]+=2):(p[k].push(\"v\"+b+\"+v\"+x),g[k]-=2),y+=1;for(var w=0;w<r;++w)w!==k&&(x&1<<w?v[w]+=1:v[w]-=1)}}for(var M=[],k=0;k<r;++k)if(0===p[k].length)M.push(\"d\"+k+\"-0.5\");else{var A=\"\";g[k]<0?A=g[k]+\"*c\":g[k]>0&&(A=\"+\"+g[k]+\"*c\");var T=p[k].length/y*.5,S=.5+v[k]/y*.5;M.push(\"d\"+k+\"-\"+S+\"-\"+T+\"*(\"+p[k].join(\"+\")+A+\")/(\"+m[k].join(\"+\")+\")\")}f.push(\"a.push([\",M.join(),\"]);\",\"break;\")}n.push(\"}},\"),h.length>0&&f.push(\"}}\");for(var E=[],u=0;u<1<<r-1;++u)E.push(\"v\"+u);E.push(\"c0\",\"c1\",\"p0\",\"p1\",\"a\",\"b\",\"c\"),n.push(\"cell:function cellFunc(\",E.join(),\"){\");var L=s(r-1);n.push(\"if(p0){b.push(\",L.map(function(t){return\"[\"+t.map(function(t){return\"v\"+t})+\"]\"}).join(),\")}else{b.push(\",L.map(function(t){var e=t.slice();return e.reverse(),\"[\"+e.map(function(t){return\"v\"+t})+\"]\"}).join(),\")}}});function \",i,\"(array,level){var verts=[],cells=[];contour(array,verts,cells,level);return {positions:verts,cells:cells};} return \",i,\";\");for(u=0;u<h.length;++u)n.push(h[u].join(\"\"));return new Function(\"genContour\",n.join(\"\"))(o)}function i(t,e){for(var r=l(t,e),n=r.length,i=new Array(n),a=new Array(n),o=0;o<n;++o)i[o]=[r[o]],a[o]=[o];return{positions:i,cells:a}}function a(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return i(t,e);var r=t.order.join()+\"-\"+t.dtype,a=u[r],e=+e||0;return a||(a=u[r]=n(t.order,t.dtype)),a(t,e)}e.exports=a;var o=t(\"ndarray-extract-contour\"),s=t(\"triangulate-hypercube\"),l=t(\"zero-crossings\"),u={}},{\"ndarray-extract-contour\":438,\"triangulate-hypercube\":517,\"zero-crossings\":564}],512:[function(t,e,r){(function(r){\"use strict\";function n(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),i=0,a=0,o=0;o<e.length;++o)for(var s=e[o],l=0;l<3;++l){var u=r[s[l]];n[i++]=u[0],n[i++]=u[1]+1.4,a=Math.max(u[0],a)}return{data:n,shape:a}}function i(t,e,r){var r=r||{},o=s[t];o||(o=s[t]={\" \":{data:new Float32Array(0),shape:.2}});var l=o[e];if(!l)if(e.length<=1||!/\\d/.test(e))l=o[e]=n(a(e,{triangles:!0,font:t,textAlign:r.textAlign||\"left\",textBaseline:\"alphabetic\"}));else{for(var u=e.split(/(\\d|\\s)/),c=new Array(u.length),h=0,f=0,d=0;d<u.length;++d)c[d]=i(t,u[d]),h+=c[d].data.length,f+=c[d].shape,d>0&&(f+=.02);for(var p=new Float32Array(h),m=0,g=-.5*f,d=0;d<c.length;++d){for(var v=c[d].data,y=0;y<v.length;y+=2)p[m++]=v[y]+g,p[m++]=v[y+1];g+=c[d].shape+.02}l=o[e]={data:p,shape:f}}return l}e.exports=i;var a=t(\"vectorize-text\"),o=window||r.global||{},s=o.__TEXT_CACHE||{};o.__TEXT_CACHE={}}).call(this,t(\"_process\"))},{_process:468,\"vectorize-text\":534}],513:[function(t,e,r){\"use strict\";function n(t,e,r,n,i){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=n||.25,this.fontFamily=i||\"sans-serif\",this.radius=r||8;var a=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement(\"canvas\"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext(\"2d\"),this.ctx.font=t+\"px \"+this.fontFamily,this.ctx.textBaseline=\"middle\",this.ctx.fillStyle=\"black\",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.d=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Int16Array(a),this.middle=Math.round(a/2*(navigator.userAgent.indexOf(\"Gecko/\")>=0?1.2:1))}function i(t,e,r,n,i,o,s){for(var l=0;l<e;l++){for(var u=0;u<r;u++)n[u]=t[u*e+l];for(a(n,i,o,s,r),u=0;u<r;u++)t[u*e+l]=i[u]}for(u=0;u<r;u++){for(l=0;l<e;l++)n[l]=t[u*e+l];for(a(n,i,o,s,e),l=0;l<e;l++)t[u*e+l]=Math.sqrt(i[l])}}function a(t,e,r,n,i){r[0]=0,n[0]=-o,n[1]=+o;for(var a=1,s=0;a<i;a++){for(var l=(t[a]+a*a-(t[r[s]]+r[s]*r[s]))/(2*a-2*r[s]);l<=n[s];)s--,l=(t[a]+a*a-(t[r[s]]+r[s]*r[s]))/(2*a-2*r[s]);r[++s]=a,n[s]=l,n[s+1]=+o}for(a=0,s=0;a<i;a++){for(;n[s+1]<a;)s++;e[a]=(a-r[s])*(a-r[s])+t[r[s]]}}e.exports=n;var o=1e20;n.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),r=e.data,n=0;n<this.size*this.size;n++){var a=r[4*n+3]/255;this.gridOuter[n]=1===a?0:0===a?o:Math.pow(Math.max(0,.5-a),2),this.gridInner[n]=1===a?o:0===a?0:Math.pow(Math.max(0,a-.5),2)}for(i(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),i(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),n=0;n<this.size*this.size;n++){var s=this.gridOuter[n]-this.gridInner[n],l=Math.max(0,Math.min(255,Math.round(255-255*(s/this.radius+this.cutoff))));r[4*n+0]=l,r[4*n+1]=l,r[4*n+2]=l,r[4*n+3]=255}return e}},{}],514:[function(t,e,r){!function(t){function r(t,e){if(t=t||\"\",e=e||{},t instanceof r)return t;if(!(this instanceof r))return new r(t,e);var i=n(t);this._originalInput=t,this._r=i.r,this._g=i.g,this._b=i.b,this._a=i.a,this._roundA=U(100*this._a)/100,this._format=e.format||i.format,this._gradientType=e.gradientType,this._r<1&&(this._r=U(this._r)),this._g<1&&(this._g=U(this._g)),this._b<1&&(this._b=U(this._b)),this._ok=i.ok,this._tc_id=B++}function n(t){var e={r:0,g:0,b:0},r=1,n=null,a=null,s=null,u=!1,c=!1;return\"string\"==typeof t&&(t=j(t)),\"object\"==typeof t&&(O(t.r)&&O(t.g)&&O(t.b)?(e=i(t.r,t.g,t.b),u=!0,c=\"%\"===String(t.r).substr(-1)?\"prgb\":\"rgb\"):O(t.h)&&O(t.s)&&O(t.v)?(n=D(t.s),a=D(t.v),e=l(t.h,n,a),u=!0,c=\"hsv\"):O(t.h)&&O(t.s)&&O(t.l)&&(n=D(t.s),s=D(t.l),e=o(t.h,n,s),u=!0,c=\"hsl\"),t.hasOwnProperty(\"a\")&&(r=t.a)),r=A(r),{ok:u,format:t.format||c,r:V(255,H(e.r,0)),g:V(255,H(e.g,0)),b:V(255,H(e.b,0)),a:r}}function i(t,e,r){return{r:255*T(t,255),g:255*T(e,255),b:255*T(r,255)}}function a(t,e,r){t=T(t,255),e=T(e,255),r=T(r,255);var n,i,a=H(t,e,r),o=V(t,e,r),s=(a+o)/2;if(a==o)n=i=0;else{var l=a-o;switch(i=s>.5?l/(2-a-o):l/(a+o),a){case t:n=(e-r)/l+(e<r?6:0);break;case e:n=(r-t)/l+2;break;case r:n=(t-e)/l+4}n/=6}return{h:n,s:i,l:s}}function o(t,e,r){function n(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}var i,a,o;if(t=T(t,360),e=T(e,100),r=T(r,100),0===e)i=a=o=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;i=n(l,s,t+1/3),a=n(l,s,t),o=n(l,s,t-1/3)}return{r:255*i,g:255*a,b:255*o}}function s(t,e,r){t=T(t,255),e=T(e,255),r=T(r,255);var n,i,a=H(t,e,r),o=V(t,e,r),s=a,l=a-o;if(i=0===a?0:l/a,a==o)n=0;else{switch(a){case t:n=(e-r)/l+(e<r?6:0);break;case e:n=(r-t)/l+2;break;case r:n=(t-e)/l+4}n/=6}return{h:n,s:i,v:s}}function l(e,r,n){e=6*T(e,360),r=T(r,100),n=T(n,100);var i=t.floor(e),a=e-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),u=i%6;return{r:255*[n,s,o,o,l,n][u],g:255*[l,n,n,s,o,o][u],b:255*[o,o,l,n,n,s][u]}}function u(t,e,r,n){var i=[z(U(t).toString(16)),z(U(e).toString(16)),z(U(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 c(t,e,r,n,i){var a=[z(U(t).toString(16)),z(U(e).toString(16)),z(U(r).toString(16)),z(I(n))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join(\"\")}function h(t,e,r,n){return[z(I(n)),z(U(t).toString(16)),z(U(e).toString(16)),z(U(r).toString(16))].join(\"\")}function f(t,e){e=0===e?0:e||10;var n=r(t).toHsl();return n.s-=e/100,n.s=S(n.s),r(n)}function d(t,e){e=0===e?0:e||10;var n=r(t).toHsl();return n.s+=e/100,n.s=S(n.s),r(n)}function p(t){return r(t).desaturate(100)}function m(t,e){e=0===e?0:e||10;var n=r(t).toHsl();return n.l+=e/100,n.l=S(n.l),r(n)}function g(t,e){e=0===e?0:e||10;var n=r(t).toRgb();return n.r=H(0,V(255,n.r-U(-e/100*255))),n.g=H(0,V(255,n.g-U(-e/100*255))),n.b=H(0,V(255,n.b-U(-e/100*255))),r(n)}function v(t,e){e=0===e?0:e||10;var n=r(t).toHsl();return n.l-=e/100,n.l=S(n.l),r(n)}function y(t,e){var n=r(t).toHsl(),i=(n.h+e)%360;return n.h=i<0?360+i:i,r(n)}function b(t){var e=r(t).toHsl();return e.h=(e.h+180)%360,r(e)}function x(t){var e=r(t).toHsl(),n=e.h;return[r(t),r({h:(n+120)%360,s:e.s,l:e.l}),r({h:(n+240)%360,s:e.s,l:e.l})]}function _(t){var e=r(t).toHsl(),n=e.h;return[r(t),r({h:(n+90)%360,s:e.s,l:e.l}),r({h:(n+180)%360,s:e.s,l:e.l}),r({h:(n+270)%360,s:e.s,l:e.l})]}function w(t){var e=r(t).toHsl(),n=e.h;return[r(t),r({h:(n+72)%360,s:e.s,l:e.l}),r({h:(n+216)%360,s:e.s,l:e.l})]}function M(t,e,n){e=e||6,n=n||30;var i=r(t).toHsl(),a=360/n,o=[r(t)];for(i.h=(i.h-(a*e>>1)+720)%360;--e;)i.h=(i.h+a)%360,o.push(r(i));return o}function k(t,e){e=e||6;for(var n=r(t).toHsv(),i=n.h,a=n.s,o=n.v,s=[],l=1/e;e--;)s.push(r({h:i,s:a,v:o})),o=(o+l)%1;return s}function A(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function T(e,r){L(e)&&(e=\"100%\");var n=C(e);return e=V(r,H(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function S(t){return V(1,H(0,t))}function E(t){return parseInt(t,16)}function L(t){return\"string\"==typeof t&&-1!=t.indexOf(\".\")&&1===parseFloat(t)}function C(t){return\"string\"==typeof t&&-1!=t.indexOf(\"%\")}function z(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 P(t){return E(t)/255}function O(t){return!!W.CSS_UNIT.exec(t)}function j(t){t=t.replace(F,\"\").replace(N,\"\").toLowerCase();var e=!1;if(G[t])t=G[t],e=!0;else if(\"transparent\"==t)return{r:0,g:0,b:0,a:0,format:\"name\"};var r;return(r=W.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=W.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=W.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=W.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=W.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=W.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=W.hex8.exec(t))?{r:E(r[1]),g:E(r[2]),b:E(r[3]),a:P(r[4]),format:e?\"name\":\"hex8\"}:(r=W.hex6.exec(t))?{r:E(r[1]),g:E(r[2]),b:E(r[3]),format:e?\"name\":\"hex\"}:(r=W.hex4.exec(t))?{r:E(r[1]+\"\"+r[1]),g:E(r[2]+\"\"+r[2]),b:E(r[3]+\"\"+r[3]),a:P(r[4]+\"\"+r[4]),format:e?\"name\":\"hex8\"}:!!(r=W.hex3.exec(t))&&{r:E(r[1]+\"\"+r[1]),g:E(r[2]+\"\"+r[2]),b:E(r[3]+\"\"+r[3]),format:e?\"name\":\"hex\"}}function R(t){var e,r;return t=t||{level:\"AA\",size:\"small\"},e=(t.level||\"AA\").toUpperCase(),r=(t.size||\"small\").toLowerCase(),\"AA\"!==e&&\"AAA\"!==e&&(e=\"AA\"),\"small\"!==r&&\"large\"!==r&&(r=\"small\"),{level:e,size:r}}var F=/^\\s+/,N=/\\s+$/,B=0,U=t.round,V=t.min,H=t.max,q=t.random;r.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,i,a,o,s=this.toRgb();return e=s.r/255,r=s.g/255,n=s.b/255,i=e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4),a=r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4),o=n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4),.2126*i+.7152*a+.0722*o},setAlpha:function(t){return this._a=A(t),this._roundA=U(100*this._a)/100,this},toHsv:function(){var t=s(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=s(this._r,this._g,this._b),e=U(360*t.h),r=U(100*t.s),n=U(100*t.v);return 1==this._a?\"hsv(\"+e+\", \"+r+\"%, \"+n+\"%)\":\"hsva(\"+e+\", \"+r+\"%, \"+n+\"%, \"+this._roundA+\")\"},toHsl:function(){var t=a(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=a(this._r,this._g,this._b),e=U(360*t.h),r=U(100*t.s),n=U(100*t.l);return 1==this._a?\"hsl(\"+e+\", \"+r+\"%, \"+n+\"%)\":\"hsla(\"+e+\", \"+r+\"%, \"+n+\"%, \"+this._roundA+\")\"},toHex:function(t){return u(this._r,this._g,this._b,t)},toHexString:function(t){return\"#\"+this.toHex(t)},toHex8:function(t){return c(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return\"#\"+this.toHex8(t)},toRgb:function(){return{r:U(this._r),g:U(this._g),b:U(this._b),a:this._a}},toRgbString:function(){return 1==this._a?\"rgb(\"+U(this._r)+\", \"+U(this._g)+\", \"+U(this._b)+\")\":\"rgba(\"+U(this._r)+\", \"+U(this._g)+\", \"+U(this._b)+\", \"+this._roundA+\")\"},toPercentageRgb:function(){return{r:U(100*T(this._r,255))+\"%\",g:U(100*T(this._g,255))+\"%\",b:U(100*T(this._b,255))+\"%\",a:this._a}},toPercentageRgbString:function(){return 1==this._a?\"rgb(\"+U(100*T(this._r,255))+\"%, \"+U(100*T(this._g,255))+\"%, \"+U(100*T(this._b,255))+\"%)\":\"rgba(\"+U(100*T(this._r,255))+\"%, \"+U(100*T(this._g,255))+\"%, \"+U(100*T(this._b,255))+\"%, \"+this._roundA+\")\"},toName:function(){return 0===this._a?\"transparent\":!(this._a<1)&&(Y[u(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e=\"#\"+h(this._r,this._g,this._b,this._a),n=e,i=this._gradientType?\"GradientType = 1, \":\"\";if(t){var a=r(t);n=\"#\"+h(a._r,a._g,a._b,a._a)}return\"progid:DXImageTransform.Microsoft.gradient(\"+i+\"startColorstr=\"+e+\",endColorstr=\"+n+\")\"},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 r(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(m,arguments)},brighten:function(){return this._applyModification(g,arguments)},darken:function(){return this._applyModification(v,arguments)},desaturate:function(){return this._applyModification(f,arguments)},saturate:function(){return this._applyModification(d,arguments)},greyscale:function(){return this._applyModification(p,arguments)},spin:function(){return this._applyModification(y,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(w,arguments)},triad:function(){return this._applyCombination(x,arguments)},tetrad:function(){return this._applyCombination(_,arguments)}},r.fromRatio=function(t,e){if(\"object\"==typeof t){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]=\"a\"===i?t[i]:D(t[i]));t=n}return r(t,e)},r.equals=function(t,e){return!(!t||!e)&&r(t).toRgbString()==r(e).toRgbString()},r.random=function(){return r.fromRatio({r:q(),g:q(),b:q()})},r.mix=function(t,e,n){n=0===n?0:n||50;var i=r(t).toRgb(),a=r(e).toRgb(),o=n/100;return r({r:(a.r-i.r)*o+i.r,g:(a.g-i.g)*o+i.g,b:(a.b-i.b)*o+i.b,a:(a.a-i.a)*o+i.a})},r.readability=function(e,n){var i=r(e),a=r(n);return(t.max(i.getLuminance(),a.getLuminance())+.05)/(t.min(i.getLuminance(),a.getLuminance())+.05)},r.isReadable=function(t,e,n){var i,a,o=r.readability(t,e);switch(a=!1,(i=R(n)).level+i.size){case\"AAsmall\":case\"AAAlarge\":a=o>=4.5;break;case\"AAlarge\":a=o>=3;break;case\"AAAsmall\":a=o>=7}return a},r.mostReadable=function(t,e,n){var i,a,o,s,l=null,u=0;a=(n=n||{}).includeFallbackColors,o=n.level,s=n.size;for(var c=0;c<e.length;c++)(i=r.readability(t,e[c]))>u&&(u=i,l=r(e[c]));return r.isReadable(t,l,{level:o,size:s})||!a?l:(n.includeFallbackColors=!1,r.mostReadable(t,[\"#fff\",\"#000\"],n))};var G=r.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\"},Y=r.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(G),W=function(){var t=\"(?:[-\\\\+]?\\\\d*\\\\.\\\\d+%?)|(?:[-\\\\+]?\\\\d+%?)\",e=\"[\\\\s|\\\\(]+(\"+t+\")[,|\\\\s]+(\"+t+\")[,|\\\\s]+(\"+t+\")\\\\s*\\\\)?\",r=\"[\\\\s|\\\\(]+(\"+t+\")[,|\\\\s]+(\"+t+\")[,|\\\\s]+(\"+t+\")[,|\\\\s]+(\"+t+\")\\\\s*\\\\)?\";return{CSS_UNIT:new RegExp(t),rgb:new RegExp(\"rgb\"+e),rgba:new RegExp(\"rgba\"+r),hsl:new RegExp(\"hsl\"+e),hsla:new RegExp(\"hsla\"+r),hsv:new RegExp(\"hsv\"+e),hsva:new RegExp(\"hsva\"+r),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})$/}}();void 0!==e&&e.exports?e.exports=r:window.tinycolor=r}(Math)},{}],515:[function(t,e,r){\"use strict\";function n(t,e){var r=o(getComputedStyle(t).getPropertyValue(e));return r[0]*a(r[1],t)}function i(t,e){var r=document.createElement(\"div\");r.style[\"font-size\"]=\"128\"+t,e.appendChild(r);var i=n(r,\"font-size\")/128;return e.removeChild(r),i}function a(t,e){switch(e=e||document.body,t=(t||\"px\").trim().toLowerCase(),e!==window&&e!==document||(e=document.body),t){case\"%\":return e.clientHeight/100;case\"ch\":case\"ex\":return i(t,e);case\"em\":return n(e,\"font-size\");case\"rem\":return n(document.body,\"font-size\");case\"vw\":return window.innerWidth/100;case\"vh\":return window.innerHeight/100;case\"vmin\":return Math.min(window.innerWidth,window.innerHeight)/100;case\"vmax\":return Math.max(window.innerWidth,window.innerHeight)/100;case\"in\":return s;case\"cm\":return s/2.54;case\"mm\":return s/25.4;case\"pt\":return s/72;case\"pc\":return s/6}return 1}var o=t(\"parse-unit\");e.exports=a;var s=96},{\"parse-unit\":456}],516:[function(t,e,r){!function(t,n){n(\"object\"==typeof r&&void 0!==e?r:t.topojson=t.topojson||{})}(this,function(t){\"use strict\";function e(t,e){var n=e.id,i=e.bbox,a=null==e.properties?{}:e.properties,o=r(t,e);return null==n&&null==i?{type:\"Feature\",properties:a,geometry:o}:null==i?{type:\"Feature\",id:n,properties:a,geometry:o}:{type:\"Feature\",id:n,bbox:i,properties:a,geometry:o}}function r(t,e){function r(t,e){e.length&&e.pop();for(var r=h[t<0?~t:t],n=0,i=r.length;n<i;++n)e.push(u(r[n].slice(),n));t<0&&c(e,i)}function n(t){return u(t.slice())}function i(t){for(var e=[],n=0,i=t.length;n<i;++n)r(t[n],e);return e.length<2&&e.push(e[0].slice()),e}function a(t){for(var e=i(t);e.length<4;)e.push(e[0].slice());return e}function o(t){return t.map(a)}function s(t){var e,r=t.type;switch(r){case\"GeometryCollection\":return{type:r,geometries:t.geometries.map(s)};case\"Point\":e=n(t.coordinates);break;case\"MultiPoint\":e=t.coordinates.map(n);break;case\"LineString\":e=i(t.arcs);break;case\"MultiLineString\":e=t.arcs.map(i);break;case\"Polygon\":e=o(t.arcs);break;case\"MultiPolygon\":e=t.arcs.map(o);break;default:return null}return{type:r,coordinates:e}}var u=l(t),h=t.arcs;return s(e)}function n(t,e,r){var n,a,o;if(arguments.length>1)n=i(t,e,r);else for(a=0,n=new Array(o=t.arcs.length);a<o;++a)n[a]=a;return{type:\"MultiLineString\",arcs:f(t,n)}}function i(t,e,r){function n(t){var e=t<0?~t:t;(c[e]||(c[e]=[])).push({i:t,g:l})}function i(t){t.forEach(n)}function a(t){t.forEach(i)}function o(t){t.forEach(a)}function s(t){switch(l=t,t.type){case\"GeometryCollection\":t.geometries.forEach(s);break;case\"LineString\":i(t.arcs);break;case\"MultiLineString\":case\"Polygon\":a(t.arcs);break;case\"MultiPolygon\":o(t.arcs)}}var l,u=[],c=[];return s(e),c.forEach(null==r?function(t){u.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&u.push(t[0].i)}),u}function a(t){for(var e,r=-1,n=t.length,i=t[n-1],a=0;++r<n;)e=i,i=t[r],a+=e[0]*i[1]-e[1]*i[0];return Math.abs(a)}function o(t,e){function n(t){switch(t.type){case\"GeometryCollection\":t.geometries.forEach(n);break;case\"Polygon\":i(t.arcs);break;case\"MultiPolygon\":t.arcs.forEach(i)}}function i(t){t.forEach(function(e){e.forEach(function(e){(s[e=e<0?~e:e]||(s[e]=[])).push(t)})}),l.push(t)}function o(e){return a(r(t,{type:\"Polygon\",arcs:[e]}).coordinates[0])}var s={},l=[],u=[];return e.forEach(n),l.forEach(function(t){if(!t._){var e=[],r=[t];for(t._=1,u.push(e);t=r.pop();)e.push(t),t.forEach(function(t){t.forEach(function(t){s[t<0?~t:t].forEach(function(t){t._||(t._=1,r.push(t))})})})}}),l.forEach(function(t){delete t._}),{type:\"MultiPolygon\",arcs:u.map(function(e){var r,n=[];if(e.forEach(function(t){t.forEach(function(t){t.forEach(function(t){s[t<0?~t:t].length<2&&n.push(t)})})}),n=f(t,n),(r=n.length)>1)for(var i,a,l=1,u=o(n[0]);l<r;++l)(i=o(n[l]))>u&&(a=n[0],n[0]=n[l],n[l]=a,u=i);return n})}}var s=function(t){return t},l=function(t){if(null==(e=t.transform))return s;var e,r,n,i=e.scale[0],a=e.scale[1],o=e.translate[0],l=e.translate[1];return function(t,e){return e||(r=n=0),t[0]=(r+=t[0])*i+o,t[1]=(n+=t[1])*a+l,t}},u=function(t){function e(t){s[0]=t[0],s[1]=t[1],o(s),s[0]<u&&(u=s[0]),s[0]>h&&(h=s[0]),s[1]<c&&(c=s[1]),s[1]>f&&(f=s[1])}function r(t){switch(t.type){case\"GeometryCollection\":t.geometries.forEach(r);break;case\"Point\":e(t.coordinates);break;case\"MultiPoint\":t.coordinates.forEach(e)}}var n=t.bbox;if(!n){var i,a,o=l(t),s=new Array(2),u=1/0,c=u,h=-u,f=-u;t.arcs.forEach(function(t){for(var e=-1,r=t.length;++e<r;)i=t[e],s[0]=i[0],s[1]=i[1],o(s,e),s[0]<u&&(u=s[0]),s[0]>h&&(h=s[0]),s[1]<c&&(c=s[1]),s[1]>f&&(f=s[1])});for(a in t.objects)r(t.objects[a]);n=t.bbox=[u,c,h,f]}return n},c=function(t,e){for(var r,n=t.length,i=n-e;i<--n;)r=t[i],t[i++]=t[n],t[n]=r},h=function(t,r){return\"GeometryCollection\"===r.type?{type:\"FeatureCollection\",features:r.geometries.map(function(r){return e(t,r)})}:e(t,r)},f=function(t,e){function r(e){var r,n=t.arcs[e<0?~e:e],i=n[0];return t.transform?(r=[0,0],n.forEach(function(t){r[0]+=t[0],r[1]+=t[1]})):r=n[n.length-1],e<0?[r,i]:[i,r]}function n(t,e){for(var r in t){var n=t[r];delete e[n.start],delete n.start,delete n.end,n.forEach(function(t){i[t<0?~t:t]=1}),s.push(n)}}var i={},a={},o={},s=[],l=-1;return e.forEach(function(r,n){var i,a=t.arcs[r<0?~r:r];a.length<3&&!a[1][0]&&!a[1][1]&&(i=e[++l],e[l]=r,e[n]=i)}),e.forEach(function(t){var e,n,i=r(t),s=i[0],l=i[1];if(e=o[s])if(delete o[e.end],e.push(t),e.end=l,n=a[l]){delete a[n.start];var u=n===e?e:e.concat(n);a[u.start=e.start]=o[u.end=n.end]=u}else a[e.start]=o[e.end]=e;else if(e=a[l])if(delete a[e.start],e.unshift(t),e.start=s,n=o[s]){delete o[n.end];var c=n===e?e:n.concat(e);a[c.start=n.start]=o[c.end=e.end]=c}else a[e.start]=o[e.end]=e;else a[(e=[t]).start=s]=o[e.end=l]=e}),n(o,a),n(a,o),e.forEach(function(t){i[t<0?~t:t]||s.push([t])}),s},d=function(t){return r(t,n.apply(this,arguments))},p=function(t){return r(t,o.apply(this,arguments))},m=function(t,e){for(var r=0,n=t.length;r<n;){var i=r+n>>>1;t[i]<e?r=i+1:n=i}return r},g=function(t){function e(t,e){t.forEach(function(t){t<0&&(t=~t);var r=i[t];r?r.push(e):i[t]=[e]})}function r(t,r){t.forEach(function(t){e(t,r)})}function n(t,e){\"GeometryCollection\"===t.type?t.geometries.forEach(function(t){n(t,e)}):t.type in o&&o[t.type](t.arcs,e)}var i={},a=t.map(function(){return[]}),o={LineString:e,MultiLineString:r,Polygon:r,MultiPolygon:function(t,e){t.forEach(function(t){r(t,e)})}};t.forEach(n);for(var s in i)for(var l=i[s],u=l.length,c=0;c<u;++c)for(var h=c+1;h<u;++h){var f,d=l[c],p=l[h];(f=a[d])[s=m(f,p)]!==p&&f.splice(s,0,p),(f=a[p])[s=m(f,d)]!==d&&f.splice(s,0,d)}return a},v=function(t,e){function r(t){t[0]=Math.round((t[0]-o)/s),t[1]=Math.round((t[1]-l)/c)}function n(t){switch(t.type){case\"GeometryCollection\":t.geometries.forEach(n);break;case\"Point\":r(t.coordinates);break;case\"MultiPoint\":t.coordinates.forEach(r)}}if(!((e=Math.floor(e))>=2))throw new Error(\"n must be ≥2\");if(t.transform)throw new Error(\"already quantized\");var i,a=u(t),o=a[0],s=(a[2]-o)/(e-1)||1,l=a[1],c=(a[3]-l)/(e-1)||1;t.arcs.forEach(function(t){for(var e,r,n,i=1,a=1,u=t.length,h=t[0],f=h[0]=Math.round((h[0]-o)/s),d=h[1]=Math.round((h[1]-l)/c);i<u;++i)h=t[i],r=Math.round((h[0]-o)/s),n=Math.round((h[1]-l)/c),r===f&&n===d||((e=t[a++])[0]=r-f,f=r,e[1]=n-d,d=n);a<2&&((e=t[a++])[0]=0,e[1]=0),t.length=a});for(i in t.objects)n(t.objects[i]);return t.transform={scale:[s,c],translate:[o,l]},t},y=function(t){if(null==(e=t.transform))return s;var e,r,n,i=e.scale[0],a=e.scale[1],o=e.translate[0],l=e.translate[1];return function(t,e){e||(r=n=0);var s=Math.round((t[0]-o)/i),u=Math.round((t[1]-l)/a);return t[0]=s-r,r=s,t[1]=u-n,n=u,t}};t.bbox=u,t.feature=h,t.mesh=d,t.meshArcs=n,t.merge=p,t.mergeArcs=o,t.neighbors=g,t.quantize=v,t.transform=l,t.untransform=y,Object.defineProperty(t,\"__esModule\",{value:!0})})},{}],517:[function(t,e,r){\"use strict\";function n(t){if(t<0)return[];if(0===t)return[[0]];for(var e=0|Math.round(o(t+1)),r=[],n=0;n<e;++n){for(var s=i.unrank(t,n),l=[0],u=0,c=0;c<s.length;++c)u+=1<<s[c],l.push(u);a(s)<1&&(l[0]=u,l[t]=0),r.push(l)}return r}e.exports=n;var i=t(\"permutation-rank\"),a=t(\"permutation-parity\"),o=t(\"gamma\")},{gamma:121,\"permutation-parity\":460,\"permutation-rank\":461}],518:[function(t,e,r){\"use strict\";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t){return Math.min(1,Math.max(-1,t))}function a(t){var e=Math.abs(t[0]),r=Math.abs(t[1]),n=Math.abs(t[2]),i=[0,0,0];e>Math.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,s=0;s<3;++s)a+=t[s]*t[s],o+=i[s]*t[s];for(s=0;s<3;++s)i[s]-=o/a*t[s];return f(i,i),i}function o(t,e,r,n,i,a,o,s){this.center=l(r),this.up=l(n),this.right=l(i),this.radius=l([a]),this.angle=l([o,s]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var u=0;u<16;++u)this.computedMatrix[u]=.5;this.recalcMatrix(0)}function s(t){var e=(t=t||{}).center||[0,0,0],r=t.up||[0,1,0],i=t.right||a(r),s=t.radius||1,l=t.theta||0,u=t.phi||0;if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),f(r,r),i=[].slice.call(i,0,3),f(i,i),\"eye\"in t){var c=t.eye,p=[c[0]-e[0],c[1]-e[1],c[2]-e[2]];h(i,p,r),n(i[0],i[1],i[2])<1e-6?i=a(r):f(i,i),s=n(p[0],p[1],p[2]);var m=d(r,p)/s,g=d(i,p)/s;u=Math.acos(m),l=Math.acos(g)}return s=Math.log(s),new o(t.zoomMin,t.zoomMax,e,r,i,s,l,u)}e.exports=s;var l=t(\"filtered-vector\"),u=t(\"gl-mat4/invert\"),c=t(\"gl-mat4/rotate\"),h=t(\"gl-vec3/cross\"),f=t(\"gl-vec3/normalize\"),d=t(\"gl-vec3/dot\"),p=o.prototype;p.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},p.getDistanceLimits=function(t){var e=this.radius.bounds[0];return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},p.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,i=0,a=0,o=0;o<3;++o)a+=e[o]*r[o],i+=e[o]*e[o];for(var s=Math.sqrt(i),l=0,o=0;o<3;++o)r[o]-=e[o]*a/i,l+=r[o]*r[o],e[o]/=s;for(var u=Math.sqrt(l),o=0;o<3;++o)r[o]/=u;var c=this.computedToward;h(c,e,r),f(c,c);for(var d=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],m=this.computedAngle[1],g=Math.cos(p),v=Math.sin(p),y=Math.cos(m),b=Math.sin(m),x=this.computedCenter,_=g*y,w=v*y,M=b,k=-g*b,A=-v*b,T=y,S=this.computedEye,E=this.computedMatrix,o=0;o<3;++o){var L=_*r[o]+w*c[o]+M*e[o];E[4*o+1]=k*r[o]+A*c[o]+T*e[o],E[4*o+2]=L,E[4*o+3]=0}var C=E[1],z=E[5],D=E[9],I=E[2],P=E[6],O=E[10],j=z*O-D*P,R=D*I-C*O,F=C*P-z*I,N=n(j,R,F);j/=N,R/=N,F/=N,E[0]=j,E[4]=R,E[8]=F;for(o=0;o<3;++o)S[o]=x[o]+E[2+4*o]*d;for(o=0;o<3;++o){for(var l=0,B=0;B<3;++B)l+=E[o+4*B]*S[B];E[12+o]=-l}E[15]=1},p.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r};var m=[0,0,0];p.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;m[0]=i[2],m[1]=i[6],m[2]=i[10];for(var a=this.computedUp,o=this.computedRight,s=this.computedToward,l=0;l<3;++l)i[4*l]=a[l],i[4*l+1]=o[l],i[4*l+2]=s[l];c(i,i,n,m);for(l=0;l<3;++l)a[l]=i[4*l],o[l]=i[4*l+1];this.up.set(t,a[0],a[1],a[2]),this.right.set(t,o[0],o[1],o[2])}},p.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=(Math.exp(this.computedRadius[0]),a[1]),s=a[5],l=a[9],u=n(o,s,l);o/=u,s/=u,l/=u;var c=a[0],h=a[4],f=a[8],d=c*o+h*s+f*l,p=n(c-=o*d,h-=s*d,f-=l*d),m=(c/=p)*e+o*r,g=(h/=p)*e+s*r,v=(f/=p)*e+l*r;this.center.move(t,m,g,v);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+i),this.radius.set(t,Math.log(y))},p.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},p.setMatrix=function(t,e,r,a){var o=1;\"number\"==typeof r&&(o=0|r),(o<0||o>3)&&(o=1);var s=(o+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var l=e[o],c=e[o+4],h=e[o+8];if(a){var f=Math.abs(l),d=Math.abs(c),p=Math.abs(h),m=Math.max(f,d,p);f===m?(l=l<0?-1:1,c=h=0):p===m?(h=h<0?-1:1,l=c=0):(c=c<0?-1:1,l=h=0)}else{var g=n(l,c,h);l/=g,c/=g,h/=g}var v=e[s],y=e[s+4],b=e[s+8],x=v*l+y*c+b*h,_=n(v-=l*x,y-=c*x,b-=h*x),w=c*(b/=_)-h*(y/=_),M=h*(v/=_)-l*b,k=l*y-c*v,A=n(w,M,k);w/=A,M/=A,k/=A,this.center.jump(t,q,G,Y),this.radius.idle(t),this.up.jump(t,l,c,h),this.right.jump(t,v,y,b);var T,S;if(2===o){var E=e[1],L=e[5],C=e[9],z=E*v+L*y+C*b,D=E*w+L*M+C*k;T=j<0?-Math.PI/2:Math.PI/2,S=Math.atan2(D,z)}else{var I=e[2],P=e[6],O=e[10],j=I*l+P*c+O*h,R=I*v+P*y+O*b,F=I*w+P*M+O*k;T=Math.asin(i(j)),S=Math.atan2(F,R)}this.angle.jump(t,S,T),this.recalcMatrix(t);var N=e[2],B=e[6],U=e[10],V=this.computedMatrix;u(V,e);var H=V[15],q=V[12]/H,G=V[13]/H,Y=V[14]/H,W=Math.exp(this.computedRadius[0]);this.center.jump(t,q-N*W,G-B*W,Y-U*W)},p.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},p.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},p.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},p.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},p.lookAt=function(t,e,r,a){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var o=(a=a||this.computedUp)[0],s=a[1],l=a[2],u=n(o,s,l);if(!(u<1e-6)){o/=u,s/=u,l/=u;var c=e[0]-r[0],h=e[1]-r[1],f=e[2]-r[2],d=n(c,h,f);if(!(d<1e-6)){c/=d,h/=d,f/=d;var p=this.computedRight,m=p[0],g=p[1],v=p[2],y=o*m+s*g+l*v,b=n(m-=y*o,g-=y*s,v-=y*l);if(!(b<.01&&(m=s*f-l*h,g=l*c-o*f,v=o*h-s*c,(b=n(m,g,v))<1e-6))){m/=b,g/=b,v/=b,this.up.set(t,o,s,l),this.right.set(t,m,g,v),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(d));var x=s*v-l*g,_=l*m-o*v,w=o*g-s*m,M=n(x,_,w),k=o*c+s*h+l*f,A=m*c+g*h+v*f,T=(x/=M)*c+(_/=M)*h+(w/=M)*f,S=Math.asin(i(k)),E=Math.atan2(T,A),L=this.angle._state,C=L[L.length-1],z=L[L.length-2];C%=2*Math.PI;var D=Math.abs(C+2*Math.PI-E),I=Math.abs(C-E),P=Math.abs(C-2*Math.PI-E);D<I&&(C+=2*Math.PI),P<I&&(C-=2*Math.PI),this.angle.jump(this.angle.lastT(),C,z),this.angle.set(t,E,S)}}}}},{\"filtered-vector\":118,\"gl-mat4/invert\":165,\"gl-mat4/rotate\":169,\"gl-vec3/cross\":256,\"gl-vec3/dot\":257,\"gl-vec3/normalize\":260}],519:[function(t,e,r){\"use strict\";function n(t,e,r){var n=t*e,a=i*t,o=a-(a-t),s=t-o,l=i*e,u=l-(l-e),c=e-u,h=s*c-(n-o*u-s*u-o*c);return r?(r[0]=h,r[1]=n,r):[h,n]}e.exports=n;var i=+(Math.pow(2,27)+1)},{}],520:[function(t,e,r){\"use strict\";function n(t,e,r){var n=t+e,i=n-t,a=e-i,o=t-(n-i);return r?(r[0]=o+a,r[1]=n,r):[o+a,n]}e.exports=n},{}],521:[function(t,e,r){(function(e,n){\"use strict\";function i(t){if(t){var e=t.length||t.byteLength,r=y.log2(e);w[r].push(t)}}function a(t){i(t.buffer)}function o(t){var t=y.nextPow2(t),e=y.log2(t),r=w[e];return r.length>0?r.pop():new ArrayBuffer(t)}function s(t){return new Uint8Array(o(t),0,t)}function l(t){return new Uint16Array(o(2*t),0,t)}function u(t){return new Uint32Array(o(4*t),0,t)}function c(t){return new Int8Array(o(t),0,t)}function h(t){return new Int16Array(o(2*t),0,t)}function f(t){return new Int32Array(o(4*t),0,t)}function d(t){return new Float32Array(o(4*t),0,t)}function p(t){return new Float64Array(o(8*t),0,t)}function m(t){return x?new Uint8ClampedArray(o(t),0,t):s(t)}function g(t){return new DataView(o(t),0,t)}function v(t){t=y.nextPow2(t);var e=y.log2(t),r=M[e];return r.length>0?r.pop():new n(t)}var y=t(\"bit-twiddle\"),b=t(\"dup\");e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:b([32,0]),UINT16:b([32,0]),UINT32:b([32,0]),INT8:b([32,0]),INT16:b([32,0]),INT32:b([32,0]),FLOAT:b([32,0]),DOUBLE:b([32,0]),DATA:b([32,0]),UINT8C:b([32,0]),BUFFER:b([32,0])});var x=\"undefined\"!=typeof Uint8ClampedArray,_=e.__TYPEDARRAY_POOL;_.UINT8C||(_.UINT8C=b([32,0])),_.BUFFER||(_.BUFFER=b([32,0]));var w=_.DATA,M=_.BUFFER;r.free=function(t){if(n.isBuffer(t))M[y.log2(t.length)].push(t);else{if(\"[object ArrayBuffer]\"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|y.log2(e);w[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=a,r.freeArrayBuffer=i,r.freeBuffer=function(t){M[y.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||\"arraybuffer\"===e)return o(t);switch(e){case\"uint8\":return s(t);case\"uint16\":return l(t);case\"uint32\":return u(t);case\"int8\":return c(t);case\"int16\":return h(t);case\"int32\":return f(t);case\"float\":case\"float32\":return d(t);case\"double\":case\"float64\":return p(t);case\"uint8_clamped\":return m(t);case\"buffer\":return v(t);case\"data\":case\"dataview\":return g(t);default:return null}return null},r.mallocArrayBuffer=o,r.mallocUint8=s,r.mallocUint16=l,r.mallocUint32=u,r.mallocInt8=c,r.mallocInt16=h,r.mallocInt32=f,r.mallocFloat32=r.mallocFloat=d,r.mallocFloat64=r.mallocDouble=p,r.mallocUint8Clamped=m,r.mallocDataView=g,r.mallocBuffer=v,r.clearCache=function(){for(var t=0;t<32;++t)_.UINT8[t].length=0,_.UINT16[t].length=0,_.UINT32[t].length=0,_.INT8[t].length=0,_.INT16[t].length=0,_.INT32[t].length=0,_.FLOAT[t].length=0,_.DOUBLE[t].length=0,_.UINT8C[t].length=0,w[t].length=0,M[t].length=0}}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{},t(\"buffer\").Buffer)},{\"bit-twiddle\":60,buffer:70,dup:110}],522:[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])}}},{}],523:[function(t,e,r){\"use strict\";function n(t,e){for(var r=1,n=t.length,i=t[0],a=t[0],o=1;o<n;++o)if(a=i,i=t[o],e(i,a)){if(o===r){r++;continue}t[r++]=i}return t.length=r,t}function i(t){for(var e=1,r=t.length,n=t[0],i=t[0],a=1;a<r;++a,i=n)if(i=n,(n=t[a])!==i){if(a===e){e++;continue}t[e++]=n}return t.length=e,t}function a(t,e,r){return 0===t.length?t:e?(r||t.sort(e),n(t,e)):(r||t.sort(),i(t))}e.exports=a},{}],524:[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){void 0===e&&(e=1e-6);var r,n,i,a,o;for(i=t,o=0;o<8;o++){if(a=this.sampleCurveX(i)-t,Math.abs(a)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=a/s}if(r=0,n=1,(i=t)<r)return r;if(i>n)return n;for(;r<n;){if(a=this.sampleCurveX(i),Math.abs(a-t)<e)return i;t>a?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},{}],525:[function(t,e,r){\"use strict\";function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(t,e,r){if(t&&u.isObject(t)&&t instanceof n)return t;var i=new n;return i.parse(t,e,r),i}function a(t){return u.isString(t)&&(t=i(t)),t instanceof n?t.format():n.prototype.format.call(t)}function o(t,e){return i(t,!1,!0).resolve(e)}function s(t,e){return t?i(t,!1,!0).resolveObject(e):e}var l=t(\"punycode\"),u=t(\"./util\");r.parse=i,r.resolve=o,r.resolveObject=s,r.format=a,r.Url=n;var c=/^([a-z0-9.+-]+:)/i,h=/:[0-9]*$/,f=/^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,d=[\"<\",\">\",'\"',\"`\",\" \",\"\\r\",\"\\n\",\"\\t\"],p=[\"{\",\"}\",\"|\",\"\\\\\",\"^\",\"`\"].concat(d),m=[\"'\"].concat(p),g=[\"%\",\"/\",\"?\",\";\",\"#\"].concat(m),v=[\"/\",\"?\",\"#\"],y=/^[+a-z0-9A-Z_-]{0,63}$/,b=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,x={javascript:!0,\"javascript:\":!0},_={javascript:!0,\"javascript:\":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,\"http:\":!0,\"https:\":!0,\"ftp:\":!0,\"gopher:\":!0,\"file:\":!0},M=t(\"querystring\");n.prototype.parse=function(t,e,r){if(!u.isString(t))throw new TypeError(\"Parameter 'url' must be a string, not \"+typeof t);var n=t.indexOf(\"?\"),i=-1!==n&&n<t.indexOf(\"#\")?\"?\":\"#\",a=t.split(i),o=/\\\\/g;a[0]=a[0].replace(o,\"/\");var s=t=a.join(i);if(s=s.trim(),!r&&1===t.split(\"#\").length){var h=f.exec(s);if(h)return this.path=s,this.href=s,this.pathname=h[1],h[2]?(this.search=h[2],this.query=e?M.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search=\"\",this.query={}),this}var d=c.exec(s);if(d){var p=(d=d[0]).toLowerCase();this.protocol=p,s=s.substr(d.length)}if(r||d||s.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)){var k=\"//\"===s.substr(0,2);!k||d&&_[d]||(s=s.substr(2),this.slashes=!0)}if(!_[d]&&(k||d&&!w[d])){for(var A=-1,T=0;T<v.length;T++)-1!==(L=s.indexOf(v[T]))&&(-1===A||L<A)&&(A=L);var S,E;-1!==(E=-1===A?s.lastIndexOf(\"@\"):s.lastIndexOf(\"@\",A))&&(S=s.slice(0,E),s=s.slice(E+1),this.auth=decodeURIComponent(S)),A=-1;for(T=0;T<g.length;T++){var L=s.indexOf(g[T]);-1!==L&&(-1===A||L<A)&&(A=L)}-1===A&&(A=s.length),this.host=s.slice(0,A),s=s.slice(A),this.parseHost(),this.hostname=this.hostname||\"\";var C=\"[\"===this.hostname[0]&&\"]\"===this.hostname[this.hostname.length-1];if(!C)for(var z=this.hostname.split(/\\./),T=0,D=z.length;T<D;T++){var I=z[T];if(I&&!I.match(y)){for(var P=\"\",O=0,j=I.length;O<j;O++)I.charCodeAt(O)>127?P+=\"x\":P+=I[O];if(!P.match(y)){var R=z.slice(0,T),F=z.slice(T+1),N=I.match(b);N&&(R.push(N[1]),F.unshift(N[2])),F.length&&(s=\"/\"+F.join(\".\")+s),this.hostname=R.join(\".\");break}}}this.hostname.length>255?this.hostname=\"\":this.hostname=this.hostname.toLowerCase(),C||(this.hostname=l.toASCII(this.hostname));var B=this.port?\":\"+this.port:\"\",U=this.hostname||\"\";this.host=U+B,this.href+=this.host,C&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),\"/\"!==s[0]&&(s=\"/\"+s))}if(!x[p])for(var T=0,D=m.length;T<D;T++){var V=m[T];if(-1!==s.indexOf(V)){var H=encodeURIComponent(V);H===V&&(H=escape(V)),s=s.split(V).join(H)}}var q=s.indexOf(\"#\");-1!==q&&(this.hash=s.substr(q),s=s.slice(0,q));var G=s.indexOf(\"?\");if(-1!==G?(this.search=s.substr(G),this.query=s.substr(G+1),e&&(this.query=M.parse(this.query)),s=s.slice(0,G)):e&&(this.search=\"\",this.query={}),s&&(this.pathname=s),w[p]&&this.hostname&&!this.pathname&&(this.pathname=\"/\"),this.pathname||this.search){var B=this.pathname||\"\",Y=this.search||\"\";this.path=B+Y}return this.href=this.format(),this},n.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||\"\",i=!1,a=\"\";this.host?i=t+this.host:this.hostname&&(i=t+(-1===this.hostname.indexOf(\":\")?this.hostname:\"[\"+this.hostname+\"]\"),this.port&&(i+=\":\"+this.port)),this.query&&u.isObject(this.query)&&Object.keys(this.query).length&&(a=M.stringify(this.query));var o=this.search||a&&\"?\"+a||\"\";return e&&\":\"!==e.substr(-1)&&(e+=\":\"),this.slashes||(!e||w[e])&&!1!==i?(i=\"//\"+(i||\"\"),r&&\"/\"!==r.charAt(0)&&(r=\"/\"+r)):i||(i=\"\"),n&&\"#\"!==n.charAt(0)&&(n=\"#\"+n),o&&\"?\"!==o.charAt(0)&&(o=\"?\"+o),r=r.replace(/[?#]/g,function(t){return encodeURIComponent(t)}),o=o.replace(\"#\",\"%23\"),e+i+r+o+n},n.prototype.resolve=function(t){return this.resolveObject(i(t,!1,!0)).format()},n.prototype.resolveObject=function(t){if(u.isString(t)){var e=new n;e.parse(t,!1,!0),t=e}for(var r=new n,i=Object.keys(this),a=0;a<i.length;a++){var o=i[a];r[o]=this[o]}if(r.hash=t.hash,\"\"===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),l=0;l<s.length;l++){var c=s[l];\"protocol\"!==c&&(r[c]=t[c])}return w[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname=\"/\"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!w[t.protocol]){for(var h=Object.keys(t),f=0;f<h.length;f++){var d=h[f];r[d]=t[d]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||_[t.protocol])r.pathname=t.pathname;else{for(M=(t.pathname||\"\").split(\"/\");M.length&&!(t.host=M.shift()););t.host||(t.host=\"\"),t.hostname||(t.hostname=\"\"),\"\"!==M[0]&&M.unshift(\"\"),M.length<2&&M.unshift(\"\"),r.pathname=M.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 p=r.pathname||\"\",m=r.search||\"\";r.path=p+m}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var g=r.pathname&&\"/\"===r.pathname.charAt(0),v=t.host||t.pathname&&\"/\"===t.pathname.charAt(0),y=v||g||r.host&&t.pathname,b=y,x=r.pathname&&r.pathname.split(\"/\")||[],M=t.pathname&&t.pathname.split(\"/\")||[],k=r.protocol&&!w[r.protocol];if(k&&(r.hostname=\"\",r.port=null,r.host&&(\"\"===x[0]?x[0]=r.host:x.unshift(r.host)),r.host=\"\",t.protocol&&(t.hostname=null,t.port=null,t.host&&(\"\"===M[0]?M[0]=t.host:M.unshift(t.host)),t.host=null),y=y&&(\"\"===M[0]||\"\"===x[0])),v)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,x=M;else if(M.length)x||(x=[]),x.pop(),x=x.concat(M),r.search=t.search,r.query=t.query;else if(!u.isNullOrUndefined(t.search))return k&&(r.hostname=r.host=x.shift(),(C=!!(r.host&&r.host.indexOf(\"@\")>0)&&r.host.split(\"@\"))&&(r.auth=C.shift(),r.host=r.hostname=C.shift())),r.search=t.search,r.query=t.query,u.isNull(r.pathname)&&u.isNull(r.search)||(r.path=(r.pathname?r.pathname:\"\")+(r.search?r.search:\"\")),r.href=r.format(),r;if(!x.length)return r.pathname=null,r.search?r.path=\"/\"+r.search:r.path=null,r.href=r.format(),r;for(var A=x.slice(-1)[0],T=(r.host||t.host||x.length>1)&&(\".\"===A||\"..\"===A)||\"\"===A,S=0,E=x.length;E>=0;E--)\".\"===(A=x[E])?x.splice(E,1):\"..\"===A?(x.splice(E,1),S++):S&&(x.splice(E,1),S--);if(!y&&!b)for(;S--;S)x.unshift(\"..\");!y||\"\"===x[0]||x[0]&&\"/\"===x[0].charAt(0)||x.unshift(\"\"),T&&\"/\"!==x.join(\"/\").substr(-1)&&x.push(\"\");var L=\"\"===x[0]||x[0]&&\"/\"===x[0].charAt(0);if(k){r.hostname=r.host=L?\"\":x.length?x.shift():\"\";var C=!!(r.host&&r.host.indexOf(\"@\")>0)&&r.host.split(\"@\");C&&(r.auth=C.shift(),r.host=r.hostname=C.shift())}return(y=y||r.host&&x.length)&&!L&&x.unshift(\"\"),x.length?r.pathname=x.join(\"/\"):(r.pathname=null,r.path=null),u.isNull(r.pathname)&&u.isNull(r.search)||(r.path=(r.pathname?r.pathname:\"\")+(r.search?r.search:\"\")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var t=this.host,e=h.exec(t);e&&(\":\"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{\"./util\":526,punycode:469,querystring:473}],526:[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}}},{}],527:[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}},{}],528:[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}},{}],529:[function(t,e,r){(function(e,n){function i(t,e){var n={seen:[],stylize:o};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(e)?n.showHidden=e:e&&r._extend(n,e),_(n.showHidden)&&(n.showHidden=!1),_(n.depth)&&(n.depth=2),_(n.colors)&&(n.colors=!1),_(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a),l(n,t,n.depth)}function a(t,e){var r=i.styles[e];return r?\"\u001b[\"+i.colors[r][0]+\"m\"+t+\"\u001b[\"+i.colors[r][1]+\"m\":t}function o(t,e){return t}function s(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}function l(t,e,n){if(t.customInspect&&e&&T(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return b(i)||(i=l(t,i,n)),i}var a=u(t,e);if(a)return a;var o=Object.keys(e),m=s(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),A(e)&&(o.indexOf(\"message\")>=0||o.indexOf(\"description\")>=0))return c(e);if(0===o.length){if(T(e)){var g=e.name?\": \"+e.name:\"\";return t.stylize(\"[Function\"+g+\"]\",\"special\")}if(w(e))return t.stylize(RegExp.prototype.toString.call(e),\"regexp\");if(k(e))return t.stylize(Date.prototype.toString.call(e),\"date\");if(A(e))return c(e)}var v=\"\",y=!1,x=[\"{\",\"}\"];if(p(e)&&(y=!0,x=[\"[\",\"]\"]),T(e)&&(v=\" [Function\"+(e.name?\": \"+e.name:\"\")+\"]\"),w(e)&&(v=\" \"+RegExp.prototype.toString.call(e)),k(e)&&(v=\" \"+Date.prototype.toUTCString.call(e)),A(e)&&(v=\" \"+c(e)),0===o.length&&(!y||0==e.length))return x[0]+v+x[1];if(n<0)return w(e)?t.stylize(RegExp.prototype.toString.call(e),\"regexp\"):t.stylize(\"[Object]\",\"special\");t.seen.push(e);var _;return _=y?h(t,e,n,m,o):o.map(function(r){return f(t,e,n,m,r,y)}),t.seen.pop(),d(_,v,x)}function u(t,e){if(_(e))return t.stylize(\"undefined\",\"undefined\");if(b(e)){var r=\"'\"+JSON.stringify(e).replace(/^\"|\"$/g,\"\").replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"')+\"'\";return t.stylize(r,\"string\")}return y(e)?t.stylize(\"\"+e,\"number\"):m(e)?t.stylize(\"\"+e,\"boolean\"):g(e)?t.stylize(\"null\",\"null\"):void 0}function c(t){return\"[\"+Error.prototype.toString.call(t)+\"]\"}function h(t,e,r,n,i){for(var a=[],o=0,s=e.length;o<s;++o)z(e,String(o))?a.push(f(t,e,r,n,String(o),!0)):a.push(\"\");return i.forEach(function(i){i.match(/^\\d+$/)||a.push(f(t,e,r,n,i,!0))}),a}function f(t,e,r,n,i,a){var o,s,u;if(u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},u.get?s=u.set?t.stylize(\"[Getter/Setter]\",\"special\"):t.stylize(\"[Getter]\",\"special\"):u.set&&(s=t.stylize(\"[Setter]\",\"special\")),z(n,i)||(o=\"[\"+i+\"]\"),s||(t.seen.indexOf(u.value)<0?(s=g(r)?l(t,u.value,null):l(t,u.value,r-1)).indexOf(\"\\n\")>-1&&(s=a?s.split(\"\\n\").map(function(t){return\"  \"+t}).join(\"\\n\").substr(2):\"\\n\"+s.split(\"\\n\").map(function(t){return\"   \"+t}).join(\"\\n\")):s=t.stylize(\"[Circular]\",\"special\")),_(o)){if(a&&i.match(/^\\d+$/))return s;(o=JSON.stringify(\"\"+i)).match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,\"name\")):(o=o.replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"').replace(/(^\"|\"$)/g,\"'\"),o=t.stylize(o,\"string\"))}return o+\": \"+s}function d(t,e,r){var n=0;return t.reduce(function(t,e){return n++,e.indexOf(\"\\n\")>=0&&n++,t+e.replace(/\\u001b\\[\\d\\d?m/g,\"\").length+1},0)>60?r[0]+(\"\"===e?\"\":e+\"\\n \")+\" \"+t.join(\",\\n  \")+\" \"+r[1]:r[0]+e+\" \"+t.join(\", \")+\" \"+r[1]}function p(t){return Array.isArray(t)}function m(t){return\"boolean\"==typeof t}function g(t){return null===t}function v(t){return null==t}function y(t){return\"number\"==typeof t}function b(t){return\"string\"==typeof t}function x(t){return\"symbol\"==typeof t}function _(t){return void 0===t}function w(t){return M(t)&&\"[object RegExp]\"===E(t)}function M(t){return\"object\"==typeof t&&null!==t}function k(t){return M(t)&&\"[object Date]\"===E(t)}function A(t){return M(t)&&(\"[object Error]\"===E(t)||t instanceof Error)}function T(t){return\"function\"==typeof t}function S(t){return null===t||\"boolean\"==typeof t||\"number\"==typeof t||\"string\"==typeof t||\"symbol\"==typeof t||void 0===t}function E(t){return Object.prototype.toString.call(t)}function L(t){return t<10?\"0\"+t.toString(10):t.toString(10)}function C(){var t=new Date,e=[L(t.getHours()),L(t.getMinutes()),L(t.getSeconds())].join(\":\");return[t.getDate(),O[t.getMonth()],e].join(\" \")}function z(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var D=/%[sdj%]/g;r.format=function(t){if(!b(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(i(arguments[r]));return e.join(\" \")}for(var r=1,n=arguments,a=n.length,o=String(t).replace(D,function(t){if(\"%%\"===t)return\"%\";if(r>=a)return t;switch(t){case\"%s\":return String(n[r++]);case\"%d\":return Number(n[r++]);case\"%j\":try{return JSON.stringify(n[r++])}catch(t){return\"[Circular]\"}default:return t}}),s=n[r];r<a;s=n[++r])g(s)||!M(s)?o+=\" \"+s:o+=\" \"+i(s);return o},r.deprecate=function(t,i){function a(){if(!o){if(e.throwDeprecation)throw new Error(i);e.traceDeprecation?console.trace(i):console.error(i),o=!0}return t.apply(this,arguments)}if(_(n.process))return function(){return r.deprecate(t,i).apply(this,arguments)};if(!0===e.noDeprecation)return t;var o=!1;return a};var I,P={};r.debuglog=function(t){if(_(I)&&(I=e.env.NODE_DEBUG||\"\"),t=t.toUpperCase(),!P[t])if(new RegExp(\"\\\\b\"+t+\"\\\\b\",\"i\").test(I)){var n=e.pid;P[t]=function(){var e=r.format.apply(r,arguments);console.error(\"%s %d: %s\",t,n,e)}}else P[t]=function(){};return P[t]},r.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:\"cyan\",number:\"yellow\",boolean:\"yellow\",undefined:\"grey\",null:\"bold\",string:\"green\",date:\"magenta\",regexp:\"red\"},r.isArray=p,r.isBoolean=m,r.isNull=g,r.isNullOrUndefined=v,r.isNumber=y,r.isString=b,r.isSymbol=x,r.isUndefined=_,r.isRegExp=w,r.isObject=M,r.isDate=k,r.isError=A,r.isFunction=T,r.isPrimitive=S,r.isBuffer=t(\"./support/isBuffer\");var O=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"];r.log=function(){console.log(\"%s - %s\",C(),r.format.apply(r,arguments))},r.inherits=t(\"inherits\"),r._extend=function(t,e){if(!e||!M(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this,t(\"_process\"),\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{\"./support/isBuffer\":528,_process:468,inherits:527}],530:[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\":531,\"./lib/vectortilefeature.js\":532,\"./lib/vectortilelayer.js\":533}],531:[function(t,e,r){\"use strict\";function n(t,e){this.layers=t.readFields(i,{},e)}function i(t,e,r){if(3===t){var n=new a(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}var a=t(\"./vectortilelayer\");e.exports=n},{\"./vectortilelayer\":533}],532:[function(t,e,r){\"use strict\";function n(t,e,r,n,a){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=a,t.readFields(i,this,e)}function i(t,e,r){1==t?e.id=r.readVarint():2==t?a(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function a(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}function o(t){var e=t.length;if(e<=1)return[t];for(var r,n,i=[],a=0;a<e;a++){var o=s(t[a]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(r&&i.push(r),r=[t[a]]):r.push(t[a]))}return r&&i.push(r),i}function s(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i<a;o=i++)e=t[i],n+=((r=t[o]).x-e.x)*(e.y+r.y);return n}var l=t(\"point-geometry\");e.exports=n,n.types=[\"Unknown\",\"Point\",\"LineString\",\"Polygon\"],n.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,i=0,a=0,o=0,s=[];t.pos<r;){if(!i){var u=t.readVarint();n=7&u,i=u>>3}if(i--,1===n||2===n)a+=t.readSVarint(),o+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e.push(new l(a,o));else{if(7!==n)throw new Error(\"unknown command \"+n);e&&e.push(e[0].clone())}}return e&&s.push(e),s},n.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,u=-1/0;t.pos<e;){if(!n){var c=t.readVarint();r=7&c,n=c>>3}if(n--,1===r||2===r)i+=t.readSVarint(),a+=t.readSVarint(),i<o&&(o=i),i>s&&(s=i),a<l&&(l=a),a>u&&(u=a);else if(7!==r)throw new Error(\"unknown command \"+r)}return[o,l,s,u]},n.prototype.toGeoJSON=function(t,e,r){function i(t){for(var e=0;e<t.length;e++){var r=t[e],n=180-360*(r.y+c)/l;t[e]=[360*(r.x+u)/l-180,360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90]}}var a,s,l=this.extent*Math.pow(2,r),u=this.extent*t,c=this.extent*e,h=this.loadGeometry(),f=n.types[this.type];switch(this.type){case 1:var d=[];for(a=0;a<h.length;a++)d[a]=h[a][0];i(h=d);break;case 2:for(a=0;a<h.length;a++)i(h[a]);break;case 3:for(h=o(h),a=0;a<h.length;a++)for(s=0;s<h[a].length;s++)i(h[a][s])}1===h.length?h=h[0]:f=\"Multi\"+f;var p={type:\"Feature\",geometry:{type:f,coordinates:h},properties:this.properties};return\"id\"in this&&(p.id=this.id),p}},{\"point-geometry\":465}],533:[function(t,e,r){\"use strict\";function n(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(i,this,e),this.length=this._features.length}function i(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(a(r))}function a(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}var o=t(\"./vectortilefeature.js\");e.exports=n,n.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error(\"feature index out of bounds\");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new o(this._pbf,e,this.extent,this._keys,this._values)}},{\"./vectortilefeature.js\":532}],534:[function(t,e,r){\"use strict\";function n(t,e){return\"object\"==typeof e&&null!==e||(e={}),i(t,e.canvas||a,e.context||o,e)}e.exports=n;var i=t(\"./lib/vtext\"),a=null,o=null;\"undefined\"!=typeof document&&((a=document.createElement(\"canvas\")).width=8192,a.height=1024,o=a.getContext(\"2d\"))},{\"./lib/vtext\":535}],535:[function(t,e,r){\"use strict\";function n(t,e,r){for(var n=e.textAlign||\"start\",i=e.textBaseline||\"alphabetic\",a=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l<s;++l)for(var u=t[l],c=0;c<2;++c)a[c]=0|Math.min(a[c],u[c]),o[c]=0|Math.max(o[c],u[c]);var h=0;switch(n){case\"center\":h=-.5*(a[0]+o[0]);break;case\"right\":case\"end\":h=-o[0];break;case\"left\":case\"start\":h=-a[0];break;default:throw new Error(\"vectorize-text: Unrecognized textAlign: '\"+n+\"'\")}var f=0;switch(i){case\"hanging\":case\"top\":f=-a[1];break;case\"middle\":f=-.5*(a[1]+o[1]);break;case\"alphabetic\":case\"ideographic\":f=-3*r;break;case\"bottom\":f=-o[1];break;default:throw new Error(\"vectorize-text: Unrecoginized textBaseline: '\"+i+\"'\")}var d=1/r;return\"lineHeight\"in e?d*=+e.lineHeight:\"width\"in e?d=e.width/(o[0]-a[0]):\"height\"in e&&(d=e.height/(o[1]-a[1])),t.map(function(t){return[d*(t[0]+h),d*(t[1]+f)]})}function i(t,e,r,n){var i=0|Math.ceil(e.measureText(r).width+2*n);if(i>8192)throw new Error(\"vectorize-text: String too long (sorry, this will get fixed later)\");var a=3*n;t.height<a&&(t.height=a),e.fillStyle=\"#000\",e.fillRect(0,0,t.width,t.height),e.fillStyle=\"#fff\",e.fillText(r,n,2*n);var o=e.getImageData(0,0,i,a);return c(o.data,[a,i,4]).pick(-1,-1,0).transpose(1,0)}function a(t,e){var r=u(t,128);return e?h(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function o(t,e,r,i){var o=a(t,i),s=n(o.positions,e,r),l=o.edges,u=\"ccw\"===e.orientation;if(f(s,l),e.polygons||e.polygon||e.polyline){for(var c=p(l,s),h=new Array(c.length),m=0;m<c.length;++m){for(var g=c[m],v=new Array(g.length),y=0;y<g.length;++y){for(var b=g[y],x=new Array(b.length),_=0;_<b.length;++_)x[_]=s[b[_]].slice();u&&x.reverse(),v[y]=x}h[m]=v}return h}return e.triangles||e.triangulate||e.triangle?{cells:d(s,l,{delaunay:!1,exterior:!1,interior:!0}),positions:s}:{edges:l,positions:s}}function s(t,e,r){try{return o(t,e,r,!0)}catch(t){}try{return o(t,e,r,!1)}catch(t){}return e.polygons||e.polyline||e.polygon?[]:e.triangles||e.triangulate||e.triangle?{cells:[],positions:[]}:{edges:[],positions:[]}}function l(t,e,r,n){var a=n.size||64,o=n.font||\"normal\";return r.font=a+\"px \"+o,r.textAlign=\"start\",r.textBaseline=\"alphabetic\",r.direction=\"ltr\",s(i(e,r,t,a),n,a)}e.exports=l,e.exports.processPixels=s;var u=t(\"surface-nets\"),c=t(\"ndarray\"),h=t(\"simplify-planar-graph\"),f=t(\"clean-pslg\"),d=t(\"cdt2d\"),p=t(\"planar-graph-to-polyline\")},{cdt2d:72,\"clean-pslg\":82,ndarray:449,\"planar-graph-to-polyline\":464,\"simplify-planar-graph\":504,\"surface-nets\":511}],536:[function(t,e,r){function n(t){var e=[];for(var r in t.layers)e.push(a(t.layers[r]));var n=new c;return h.tile.write({layers:e},n),n.finish()}function i(t){var e={};for(var r in t)e[r]=new f(t[r].features),e[r].name=r;return n({layers:e})}function a(t){for(var e={name:t.name||\"\",version:t.version||1,extent:t.extent||4096,keys:[],values:[],features:[]},r={},n={},i=0;i<t.length;i++){var a=t.feature(i);a.geometry=l(a.loadGeometry());var o=[];for(var s in a.properties){var c=r[s];void 0===c&&(e.keys.push(s),c=e.keys.length-1,r[s]=c);var h=u(a.properties[s]),f=n[h.key];void 0===f&&(e.values.push(h),f=e.values.length-1,n[h.key]=f),o.push(c),o.push(f)}a.tags=o,e.features.push(a)}return e}function o(t,e){return(e<<3)+(7&t)}function s(t){return t<<1^t>>31}function l(t){for(var e=[],r=0,n=0,i=t.length,a=0;a<i;a++){var l=t[a];e.push(o(1,1));for(var u=0;u<l.length;u++){1===u&&e.push(o(2,l.length-1));var c=l[u].x-r,h=l[u].y-n;e.push(s(c),s(h)),r+=c,n+=h}}return e}function u(t){var e,r=typeof t;return 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)},e.key=r+\":\"+t,e}var c=t(\"pbf\"),h=t(\"./vector-tile-pb\"),f=t(\"./lib/geojson_wrapper\");e.exports=n,e.exports.fromVectorTileJs=n,e.exports.fromGeojsonVt=i,e.exports.GeoJSONWrapper=f},{\"./lib/geojson_wrapper\":537,\"./vector-tile-pb\":538,pbf:459}],537:[function(t,e,r){\"use strict\";function n(t){this.features=t,this.length=t.length}function i(t){this.id=\"number\"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=4096}var a=t(\"point-geometry\"),o=t(\"vector-tile\").VectorTileFeature;e.exports=n,n.prototype.feature=function(t){return new i(this.features[t])},i.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var r=t[e],n=[],i=0;i<r.length;i++)n.push(new a(r[i][0],r[i][1]));this.geometry.push(n)}return this.geometry},i.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-1/0,n=1/0,i=-1/0,a=0;a<t.length;a++)for(var o=t[a],s=0;s<o.length;s++){var l=o[s];e=Math.min(e,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.y)}return[e,n,r,i]},i.prototype.toGeoJSON=o.prototype.toGeoJSON},{\"point-geometry\":465,\"vector-tile\":530}],538:[function(t,e,r){\"use strict\";function n(t,e){return t.readFields(i,{layers:[]},e)}function i(t,e,r){3===t&&e.layers.push(f(r,r.readVarint()+r.pos))}function a(t,e){var r;if(void 0!==t.layers)for(r=0;r<t.layers.length;r++)e.writeMessage(3,p,t.layers[r])}function o(t,e){return t.readFields(s,{},e)}function s(t,e,r){1===t?e.string_value=r.readString():2===t?e.float_value=r.readFloat():3===t?e.double_value=r.readDouble():4===t?e.int_value=r.readVarint():5===t?e.uint_value=r.readVarint():6===t?e.sint_value=r.readSVarint():7===t&&(e.bool_value=r.readBoolean())}function l(t,e){void 0!==t.string_value&&e.writeStringField(1,t.string_value),void 0!==t.float_value&&e.writeFloatField(2,t.float_value),void 0!==t.double_value&&e.writeDoubleField(3,t.double_value),void 0!==t.int_value&&e.writeVarintField(4,t.int_value),void 0!==t.uint_value&&e.writeVarintField(5,t.uint_value),void 0!==t.sint_value&&e.writeSVarintField(6,t.sint_value),void 0!==t.bool_value&&e.writeBooleanField(7,t.bool_value)}function u(t,e){var r=t.readFields(c,{},e);return void 0===r.type&&(r.type=\"Unknown\"),r}function c(t,e,r){1===t?e.id=r.readVarint():2===t?e.tags=r.readPackedVarint():3===t?e.type=r.readVarint():4===t&&(e.geometry=r.readPackedVarint())}function h(t,e){void 0!==t.id&&e.writeVarintField(1,t.id),void 0!==t.tags&&e.writePackedVarint(2,t.tags),void 0!==t.type&&e.writeVarintField(3,t.type),void 0!==t.geometry&&e.writePackedVarint(4,t.geometry)}function f(t,e){return t.readFields(d,{features:[],keys:[],values:[]},e)}function d(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():2===t?e.features.push(u(r,r.readVarint()+r.pos)):3===t?e.keys.push(r.readString()):4===t?e.values.push(o(r,r.readVarint()+r.pos)):5===t&&(e.extent=r.readVarint())}function p(t,e){void 0!==t.version&&e.writeVarintField(15,t.version),void 0!==t.name&&e.writeStringField(1,t.name);var r;if(void 0!==t.features)for(r=0;r<t.features.length;r++)e.writeMessage(2,h,t.features[r]);if(void 0!==t.keys)for(r=0;r<t.keys.length;r++)e.writeStringField(3,t.keys[r]);if(void 0!==t.values)for(r=0;r<t.values.length;r++)e.writeMessage(4,l,t.values[r]);void 0!==t.extent&&e.writeVarintField(5,t.extent)}var m=r.tile={read:n,write:a};m.GeomType={Unknown:0,Point:1,LineString:2,Polygon:3},m.value={read:o,write:l},m.feature={read:u,write:h},m.layer={read:f,write:p}},{}],539:[function(t,e,r){!function(){\"use strict\";function t(e){e.permitHostObjects___&&e.permitHostObjects___(t)}function r(t){return!(t.substr(0,d.length)==d&&\"___\"===t.substr(t.length-3))}function n(t){if(t!==Object(t))throw new TypeError(\"Not an object: \"+t);var e=t[p];if(e&&e.key===t)return e;if(f(t)){e={key:t};try{return h(t,p,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function i(t){return t.prototype=null,Object.freeze(t)}function a(){y||\"undefined\"==typeof console||(y=!0,console.warn(\"WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future.\"))}if(\"undefined\"==typeof ses||!ses.ok||ses.ok()){\"undefined\"!=typeof ses&&(ses.weakMapPermitHostObjects=t);var o=!1;if(\"function\"==typeof WeakMap){var s=WeakMap;if(\"undefined\"!=typeof navigator&&/Firefox/.test(navigator.userAgent));else{var l=new s,u=Object.freeze({});if(l.set(u,1),1===l.get(u))return void(e.exports=WeakMap);o=!0}}Object.prototype.hasOwnProperty;var c=Object.getOwnPropertyNames,h=Object.defineProperty,f=Object.isExtensible,d=\"weakmap:\",p=d+\"ident:\"+Math.random()+\"___\";if(\"undefined\"!=typeof crypto&&\"function\"==typeof crypto.getRandomValues&&\"function\"==typeof ArrayBuffer&&\"function\"==typeof Uint8Array){var m=new ArrayBuffer(25),g=new Uint8Array(m);crypto.getRandomValues(g),p=d+\"rand:\"+Array.prototype.map.call(g,function(t){return(t%36).toString(36)}).join(\"\")+\"___\"}if(h(Object,\"getOwnPropertyNames\",{value:function(t){return c(t).filter(r)}}),\"getPropertyNames\"in Object){var v=Object.getPropertyNames;h(Object,\"getPropertyNames\",{value:function(t){return v(t).filter(r)}})}!function(){var t=Object.freeze;h(Object,\"freeze\",{value:function(e){return n(e),t(e)}});var e=Object.seal;h(Object,\"seal\",{value:function(t){return n(t),e(t)}});var r=Object.preventExtensions;h(Object,\"preventExtensions\",{value:function(t){return n(t),r(t)}})}();var y=!1,b=0,x=function(){function t(t,e){var r,i=n(t);return i?u in i?i[u]:e:(r=s.indexOf(t),r>=0?l[r]:e)}function e(t){var e=n(t);return e?u in e:s.indexOf(t)>=0}function r(t,e){var r,i=n(t);return i?i[u]=e:(r=s.indexOf(t))>=0?l[r]=e:(r=s.length,l[r]=e,s[r]=t),this}function o(t){var e,r,i=n(t);return i?u in i&&delete i[u]:!((e=s.indexOf(t))<0)&&(r=s.length-1,s[e]=void 0,l[e]=l[r],s[e]=s[r],s.length=r,l.length=r,!0)}this instanceof x||a();var s=[],l=[],u=b++;return Object.create(x.prototype,{get___:{value:i(t)},has___:{value:i(e)},set___:{value:i(r)},delete___:{value:i(o)}})};x.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),\"function\"==typeof s?function(){function r(){function e(t,e){return c?u.has(t)?u.get(t):c.get___(t,e):u.get(t,e)}function r(t){return u.has(t)||!!c&&c.has___(t)}function n(t){var e=!!u.delete(t);return c?c.delete___(t)||e:e}this instanceof x||a();var l,u=new s,c=void 0,h=!1;return l=o?function(t,e){return u.set(t,e),u.has(t)||(c||(c=new x),c.set(t,e)),this}:function(t,e){if(h)try{u.set(t,e)}catch(r){c||(c=new x),c.set___(t,e)}else u.set(t,e);return this},Object.create(x.prototype,{get___:{value:i(e)},has___:{value:i(r)},set___:{value:i(l)},delete___:{value:i(n)},permitHostObjects___:{value:i(function(e){if(e!==t)throw new Error(\"bogus call to permitHostObjects___\");h=!0})}})}o&&\"undefined\"!=typeof Proxy&&(Proxy=void 0),r.prototype=x.prototype,e.exports=r,Object.defineProperty(WeakMap.prototype,\"constructor\",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():(\"undefined\"!=typeof Proxy&&(Proxy=void 0),e.exports=x)}}()},{}],540:[function(t,e,r){function n(){var t={};return function(e){if((\"object\"!=typeof e||null===e)&&\"function\"!=typeof e)throw new Error(\"Weakmap-shim: Key must be object\");var r=e.valueOf(t);return r&&r.identity===t?r:i(e,t)}}var i=t(\"./hidden-store.js\");e.exports=n},{\"./hidden-store.js\":541}],541:[function(t,e,r){function n(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,\"valueOf\",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}e.exports=n},{}],542:[function(t,e,r){function n(){var t=i();return{get:function(e,r){var n=t(e);return n.hasOwnProperty(\"value\")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return\"value\"in t(e)},delete:function(e){return delete t(e).value}}}var i=t(\"./create-store.js\");e.exports=n},{\"./create-store.js\":540}],543:[function(t,e,r){var n=t(\"get-canvas-context\");e.exports=function(t){return n(\"webgl\",t)}},{\"get-canvas-context\":132}],544:[function(t,e,r){var n=arguments[3],i=arguments[4],a=arguments[5],o=JSON.stringify;e.exports=function(t,e){function r(t){g[t]=!0;for(var e in i[t][1]){var n=i[t][1][e];g[n]||r(n)}}for(var s,l=Object.keys(a),u=0,c=l.length;u<c;u++){var h=l[u],f=a[h].exports;if(f===t||f&&f.default===t){s=h;break}}if(!s){s=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var d={},u=0,c=l.length;u<c;u++)d[h=l[u]]=h;i[s]=[Function([\"require\",\"module\",\"exports\"],\"(\"+t+\")(self)\"),d]}var p=Math.floor(Math.pow(16,8)*Math.random()).toString(16),m={};m[s]=s,i[p]=[Function([\"require\"],\"var f = require(\"+o(s)+\");(f.default ? f.default : f)(self);\"),m];var g={};r(p);var v=\"(\"+n+\")({\"+Object.keys(g).map(function(t){return o(t)+\":[\"+i[t][0]+\",\"+o(i[t][1])+\"]\"}).join(\",\")+\"},{},[\"+o(p)+\"])\",y=window.URL||window.webkitURL||window.mozURL||window.msURL,b=new Blob([v],{type:\"text/javascript\"});if(e&&e.bare)return b;var x=y.createObjectURL(b),_=new Worker(x);return _.objectURL=x,_}},{}],545:[function(t,e,r){e.exports.RADIUS=6378137,e.exports.FLATTENING=1/298.257223563,e.exports.POLAR_RADIUS=6356752.3142},{}],546:[function(t,e,r){!function(t,n){n(\"object\"==typeof r&&void 0!==e?r:t.WhooTS=t.WhooTS||{})}(this,function(t){function e(t,e,n,i,a,o){return o=o||{},t+\"?\"+[\"bbox=\"+r(n,i,a),\"format=\"+(o.format||\"image/png\"),\"service=\"+(o.service||\"WMS\"),\"version=\"+(o.version||\"1.1.1\"),\"request=\"+(o.request||\"GetMap\"),\"srs=\"+(o.srs||\"EPSG:3857\"),\"width=\"+(o.width||256),\"height=\"+(o.height||256),\"layers=\"+e].join(\"&\")}function r(t,e,r){var i=n(256*t,256*(e=Math.pow(2,r)-e-1),r),a=n(256*(t+1),256*(e+1),r);return i[0]+\",\"+i[1]+\",\"+a[0]+\",\"+a[1]}function n(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}t.getURL=e,t.getTileBBox=r,t.getMercCoords=n,Object.defineProperty(t,\"__esModule\",{value:!0})})},{}],547:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}function i(t,e,r,n){var i,a;if(\"object\"==typeof t)i=t,a=e||{};else{if(!(\"number\"==typeof t&&t>=1888&&t<=2111))throw new Error(\"Solar year outside range 1888-2111\");if(!(\"number\"==typeof e&&e>=1&&e<=12))throw new Error(\"Solar month outside range 1 - 12\");if(!(\"number\"==typeof r&&r>=1&&r<=31))throw new Error(\"Solar day outside range 1 - 31\");i={year:t,month:e,day:r},a=n||{}}var o=p[i.year-p[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1;var l,u=(o=p[a.year-p[0]])>>9&4095,c=o>>5&15,h=31&o,f=new Date(u,c-1,h),m=new Date(i.year,i.month-1,i.day);l=Math.round((m-f)/864e5);var g,v=d[a.year-d[0]];for(g=0;g<13;g++){var y=v&1<<12-g?30:29;if(l<y)break;l-=y}var b=v>>13;return!b||g<b?(a.isIntercalary=!1,a.month=1+g):g===b?(a.isIntercalary=!0,a.month=g):(a.isIntercalary=!1,a.month=g),a.day=1+l,a}function a(t,e,r,n,i){var a,o;if(\"object\"==typeof t)o=t,a=e||{};else{if(!(\"number\"==typeof t&&t>=1888&&t<=2111))throw new Error(\"Lunar year outside range 1888-2111\");if(!(\"number\"==typeof e&&e>=1&&e<=12))throw new Error(\"Lunar month outside range 1 - 12\");if(!(\"number\"==typeof r&&r>=1&&r<=30))throw new Error(\"Lunar day outside range 1 - 30\");var s;\"object\"==typeof n?(s=!1,a=n):(s=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:s}}var l;l=o.day-1;var u,c=d[o.year-d[0]],h=c>>13;u=h?o.month>h?o.month:o.isIntercalary?o.month:o.month-1:o.month-1;for(var f=0;f<u;f++)l+=c&1<<12-f?30:29;var m=p[o.year-p[0]],g=m>>9&4095,v=m>>5&15,y=31&m,b=new Date(g,v-1,y+l);return a.year=b.getFullYear(),a.month=1+b.getMonth(),a.day=b.getDate(),a}var o=t(\"../main\"),s=t(\"object-assign\"),l=o.instance();n.prototype=new o.baseCalendar,s(n.prototype,{name:\"Chinese\",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{\"\":{name:\"Chinese\",epochs:[\"BEC\",\"EC\"],monthNumbers:function(t,e){if(\"string\"==typeof t){var r=t.match(c);return r?r[0]:\"\"}var n=this._validateYear(t),i=t.month(),a=\"\"+this.toChineseMonth(n,i);return e&&a.length<2&&(a=\"0\"+a),this.isIntercalaryMonth(n,i)&&(a+=\"i\"),a},monthNames:function(t){if(\"string\"==typeof t){var e=t.match(h);return e?e[0]:\"\"}var r=this._validateYear(t),n=t.month(),i=[\"一月\",\"二月\",\"三月\",\"四月\",\"五月\",\"六月\",\"七月\",\"八月\",\"九月\",\"十月\",\"十一月\",\"十二月\"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i=\"闰\"+i),i},monthNamesShort:function(t){if(\"string\"==typeof t){var e=t.match(f);return e?e[0]:\"\"}var r=this._validateYear(t),n=t.month(),i=[\"一\",\"二\",\"三\",\"四\",\"五\",\"六\",\"七\",\"八\",\"九\",\"十\",\"十一\",\"十二\"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i=\"闰\"+i),i},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))\"闰\"===e[0]&&(r=!0,e=e.substring(1)),\"月\"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+[\"一\",\"二\",\"三\",\"四\",\"五\",\"六\",\"七\",\"八\",\"九\",\"十\",\"十一\",\"十二\"].indexOf(e);else{var i=e[e.length-1];r=\"i\"===i||\"I\"===i}return this.toMonthIndex(t,n,r)},dayNames:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],dayNamesShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],dayNamesMin:[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],digits:null,dateFormat:\"yyyy/mm/dd\",firstDay:1,isRTL:!1}},_validateYear:function(t,e){if(t.year&&(t=t.year()),\"number\"!=typeof t||t<1888||t>2111)throw e.replace(/\\{0\\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var n=this.intercalaryMonth(t);if(r&&e!==n||e<1||e>12)throw o.local.invalidMonth.replace(/\\{0\\}/,this.local.name);return n?!r&&e<=n?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t),n=r?12:11;if(e<0||e>n)throw o.local.invalidMonth.replace(/\\{0\\}/,this.local.name);return r?e<r?e+1:e:e+1},intercalaryMonth:function(t){return t=this._validateYear(t),d[t-d[0]]>>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var n,i=this._validateYear(t,o.local.invalidyear),a=p[i-p[0]],s=a>>9&4095,u=a>>5&15,c=31&a;(n=l.newDate(s,u,c)).add(4-(n.dayOfWeek()||7),\"d\");var h=this.toJD(t,e,r)-n.toJD();return 1+Math.floor(h/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(t,e){t.year&&(e=t.month(),t=t.year()),t=this._validateYear(t);var r=d[t-d[0]];if(e>(r>>13?12:11))throw o.local.invalidMonth.replace(/\\{0\\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,s,r,o.local.invalidDate);t=this._validateYear(n.year()),e=n.month(),r=n.day();var i=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),u=a(t,s,r,i);return l.toJD(u.year,u.month,u.day)},fromJD:function(t){var e=l.fromJD(t),r=i(e.year(),e.month(),e.day()),n=this.toMonthIndex(r.year,r.month,r.isIntercalary);return this.newDate(r.year,n,r.day)},fromString:function(t){var e=t.match(u),r=this._validateYear(+e[1]),n=+e[2],i=!!e[3],a=this.toMonthIndex(r,n,i),o=+e[4];return this.newDate(r,a,o)},add:function(t,e,r){var i=t.year(),a=t.month(),o=this.isIntercalaryMonth(i,a),s=this.toChineseMonth(i,a),l=Object.getPrototypeOf(n.prototype).add.call(this,t,e,r);if(\"y\"===r){var u=l.year(),c=l.month(),h=this.isIntercalaryMonth(u,s),f=o&&h?this.toMonthIndex(u,s,!0):this.toMonthIndex(u,s,!1);f!==c&&l.month(f)}return l}});var u=/^\\s*(-?\\d\\d\\d\\d|\\d\\d)[-/](\\d?\\d)([iI]?)[-/](\\d?\\d)/m,c=/^\\d?\\d[iI]?/m,h=/^闰?十?[一二三四五六七八九]?月/m,f=/^闰?十?[一二三四五六七八九]?/m;o.calendars.chinese=n;var d=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],p=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904]},{\"../main\":561,\"object-assign\":452}],548:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}var i=t(\"../main\"),a=t(\"object-assign\");n.prototype=new i.baseCalendar,a(n.prototype,{name:\"Coptic\",jdEpoch:1825029.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{\"\":{name:\"Coptic\",epochs:[\"BAM\",\"AM\"],monthNames:[\"Thout\",\"Paopi\",\"Hathor\",\"Koiak\",\"Tobi\",\"Meshir\",\"Paremhat\",\"Paremoude\",\"Pashons\",\"Paoni\",\"Epip\",\"Mesori\",\"Pi Kogi Enavot\"],monthNamesShort:[\"Tho\",\"Pao\",\"Hath\",\"Koi\",\"Tob\",\"Mesh\",\"Pat\",\"Pad\",\"Pash\",\"Pao\",\"Epi\",\"Meso\",\"PiK\"],dayNames:[\"Tkyriaka\",\"Pesnau\",\"Pshoment\",\"Peftoou\",\"Ptiou\",\"Psoou\",\"Psabbaton\"],dayNamesShort:[\"Tky\",\"Pes\",\"Psh\",\"Pef\",\"Pti\",\"Pso\",\"Psa\"],dayNamesMin:[\"Tk\",\"Pes\",\"Psh\",\"Pef\",\"Pt\",\"Pso\",\"Psa\"],digits:null,dateFormat:\"dd/mm/yyyy\",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);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,i.local.invalidYear||i.regionalOptions[\"\"].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),\"d\"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return(t=n.year())<0&&t++,n.day()+30*(n.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),i.calendars.coptic=n},{\"../main\":561,\"object-assign\":452}],549:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}var i=t(\"../main\"),a=t(\"object-assign\");n.prototype=new i.baseCalendar,a(n.prototype,{name:\"Discworld\",jdEpoch:1721425.5,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{\"\":{name:\"Discworld\",epochs:[\"BUC\",\"UC\"],monthNames:[\"Ick\",\"Offle\",\"February\",\"March\",\"April\",\"May\",\"June\",\"Grune\",\"August\",\"Spune\",\"Sektober\",\"Ember\",\"December\"],monthNamesShort:[\"Ick\",\"Off\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Gru\",\"Aug\",\"Spu\",\"Sek\",\"Emb\",\"Dec\"],dayNames:[\"Sunday\",\"Octeday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],dayNamesShort:[\"Sun\",\"Oct\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],dayNamesMin:[\"Su\",\"Oc\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],digits:null,dateFormat:\"yyyy/mm/dd\",firstDay:2,isRTL:!1}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),!1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),13},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),400},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),\"d\"),Math.floor((n.dayOfYear()-1)/8)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(t,e,r){return(this._validate(t,e,r,i.local.invalidDate).day()+1)%8},weekDay:function(t,e,r){var n=this.dayOfWeek(t,e,r);return n>=2&&n<=6},extraInfo:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return{century:o[Math.floor((n.year()-1)/100)+1]||\"\"}},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year()+(n.year()<0?1:0),e=n.month(),(r=n.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var o={20:\"Fruitbat\",21:\"Anchovy\"};i.calendars.discworld=n},{\"../main\":561,\"object-assign\":452}],550:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}var i=t(\"../main\"),a=t(\"object-assign\");n.prototype=new i.baseCalendar,a(n.prototype,{name:\"Ethiopian\",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{\"\":{name:\"Ethiopian\",epochs:[\"BEE\",\"EE\"],monthNames:[\"Meskerem\",\"Tikemet\",\"Hidar\",\"Tahesas\",\"Tir\",\"Yekatit\",\"Megabit\",\"Miazia\",\"Genbot\",\"Sene\",\"Hamle\",\"Nehase\",\"Pagume\"],monthNamesShort:[\"Mes\",\"Tik\",\"Hid\",\"Tah\",\"Tir\",\"Yek\",\"Meg\",\"Mia\",\"Gen\",\"Sen\",\"Ham\",\"Neh\",\"Pag\"],dayNames:[\"Ehud\",\"Segno\",\"Maksegno\",\"Irob\",\"Hamus\",\"Arb\",\"Kidame\"],dayNamesShort:[\"Ehu\",\"Seg\",\"Mak\",\"Iro\",\"Ham\",\"Arb\",\"Kid\"],dayNamesMin:[\"Eh\",\"Se\",\"Ma\",\"Ir\",\"Ha\",\"Ar\",\"Ki\"],digits:null,dateFormat:\"dd/mm/yyyy\",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);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,i.local.invalidYear||i.regionalOptions[\"\"].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),\"d\"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return(t=n.year())<0&&t++,n.day()+30*(n.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),i.calendars.ethiopian=n},{\"../main\":561,\"object-assign\":452}],551:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}function i(t,e){return t-e*Math.floor(t/e)}var a=t(\"../main\"),o=t(\"object-assign\");n.prototype=new a.baseCalendar,o(n.prototype,{name:\"Hebrew\",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{\"\":{name:\"Hebrew\",epochs:[\"BAM\",\"AM\"],monthNames:[\"Nisan\",\"Iyar\",\"Sivan\",\"Tammuz\",\"Av\",\"Elul\",\"Tishrei\",\"Cheshvan\",\"Kislev\",\"Tevet\",\"Shevat\",\"Adar\",\"Adar II\"],monthNamesShort:[\"Nis\",\"Iya\",\"Siv\",\"Tam\",\"Av\",\"Elu\",\"Tis\",\"Che\",\"Kis\",\"Tev\",\"She\",\"Ada\",\"Ad2\"],dayNames:[\"Yom Rishon\",\"Yom Sheni\",\"Yom Shlishi\",\"Yom Revi'i\",\"Yom Chamishi\",\"Yom Shishi\",\"Yom Shabbat\"],dayNamesShort:[\"Ris\",\"She\",\"Shl\",\"Rev\",\"Cha\",\"Shi\",\"Sha\"],dayNamesMin:[\"Ri\",\"She\",\"Shl\",\"Re\",\"Ch\",\"Shi\",\"Sha\"],digits:null,dateFormat:\"dd/mm/yyyy\",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,a.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return t=t<0?t+1:t,i(7*t+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,a.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),\"d\"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return t=this._validate(t,this.minMonth,this.minDay,a.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,a.local.invalidMonth),12===e&&this.leapYear(t)?30:8===e&&5===i(this.daysInYear(t),10)?30:9===e&&3===i(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);return{yearType:(this.leapYear(n)?\"embolismic\":\"common\")+\" \"+[\"deficient\",\"regular\",\"complete\"][this.daysInYear(n)%10-3]}},toJD:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var i=t<=0?t+1:t,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(e<7){for(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(var s=7;s<e;s++)o+=this.daysInMonth(t,s);return o},_delay1:function(t){var e=Math.floor((235*t-234)/19),r=12084+13753*e,n=29*e+Math.floor(r/25920);return i(3*(n+1),7)<3&&n++,n},_delay2:function(t){var e=this._delay1(t-1),r=this._delay1(t);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)}}),a.calendars.hebrew=n},{\"../main\":561,\"object-assign\":452}],552:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}var i=t(\"../main\"),a=t(\"object-assign\");n.prototype=new i.baseCalendar,a(n.prototype,{name:\"Islamic\",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{\"\":{name:\"Islamic\",epochs:[\"BH\",\"AH\"],monthNames:[\"Muharram\",\"Safar\",\"Rabi' al-awwal\",\"Rabi' al-thani\",\"Jumada al-awwal\",\"Jumada al-thani\",\"Rajab\",\"Sha'aban\",\"Ramadan\",\"Shawwal\",\"Dhu al-Qi'dah\",\"Dhu al-Hijjah\"],monthNamesShort:[\"Muh\",\"Saf\",\"Rab1\",\"Rab2\",\"Jum1\",\"Jum2\",\"Raj\",\"Sha'\",\"Ram\",\"Shaw\",\"DhuQ\",\"DhuH\"],dayNames:[\"Yawm al-ahad\",\"Yawm al-ithnayn\",\"Yawm ath-thulaathaa'\",\"Yawm al-arbi'aa'\",\"Yawm al-khamīs\",\"Yawm al-jum'a\",\"Yawm as-sabt\"],dayNamesShort:[\"Aha\",\"Ith\",\"Thu\",\"Arb\",\"Kha\",\"Jum\",\"Sab\"],dayNamesMin:[\"Ah\",\"It\",\"Th\",\"Ar\",\"Kh\",\"Ju\",\"Sa\"],digits:null,dateFormat:\"yyyy/mm/dd\",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,i.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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t=t<=0?t+1:t,r+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),i.calendars.islamic=n},{\"../main\":561,\"object-assign\":452}],553:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}var i=t(\"../main\"),a=t(\"object-assign\");n.prototype=new i.baseCalendar,a(n.prototype,{name:\"Julian\",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{\"\":{name:\"Julian\",epochs:[\"BC\",\"AD\"],monthNames:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],monthNamesShort:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],dayNames:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],dayNamesShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],dayNamesMin:[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],digits:null,dateFormat:\"mm/dd/yyyy\",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+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)}}),i.calendars.julian=n},{\"../main\":561,\"object-assign\":452}],554:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}function i(t,e){return t-e*Math.floor(t/e)}function a(t,e){return i(t-1,e)+1}var o=t(\"../main\"),s=t(\"object-assign\");n.prototype=new o.baseCalendar,s(n.prototype,{name:\"Mayan\",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{\"\":{name:\"Mayan\",epochs:[\"\",\"\"],monthNames:[\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"11\",\"12\",\"13\",\"14\",\"15\",\"16\",\"17\"],monthNamesShort:[\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"11\",\"12\",\"13\",\"14\",\"15\",\"16\",\"17\"],dayNames:[\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"11\",\"12\",\"13\",\"14\",\"15\",\"16\",\"17\",\"18\",\"19\"],dayNamesShort:[\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"11\",\"12\",\"13\",\"14\",\"15\",\"16\",\"17\",\"18\",\"19\"],dayNamesMin:[\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"11\",\"12\",\"13\",\"14\",\"15\",\"16\",\"17\",\"18\",\"19\"],digits:null,dateFormat:\"YYYY.m.d\",firstDay:0,isRTL:!1,haabMonths:[\"Pop\",\"Uo\",\"Zip\",\"Zotz\",\"Tzec\",\"Xul\",\"Yaxkin\",\"Mol\",\"Chen\",\"Yax\",\"Zac\",\"Ceh\",\"Mac\",\"Kankin\",\"Muan\",\"Pax\",\"Kayab\",\"Cumku\",\"Uayeb\"],tzolkinMonths:[\"Imix\",\"Ik\",\"Akbal\",\"Kan\",\"Chicchan\",\"Cimi\",\"Manik\",\"Lamat\",\"Muluc\",\"Oc\",\"Chuen\",\"Eb\",\"Ben\",\"Ix\",\"Men\",\"Cib\",\"Caban\",\"Etznab\",\"Cauac\",\"Ahau\"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,o.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,o.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,o.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,o.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,o.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),!0},extraInfo:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate).toJD(),i=this._toHaab(n),a=this._toTzolkin(n);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[a[0]-1],tzolkinDay:a[0],tzolkinTrecena:a[1]}},_toHaab:function(t){var e=i((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,i(e,20)]},_toTzolkin:function(t){return t-=this.jdEpoch,[a(t+20,20),a(t+4,13)]},toJD:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate);return n.day()+20*n.month()+360*n.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),o.calendars.mayan=n},{\"../main\":561,\"object-assign\":452}],555:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}var i=t(\"../main\"),a=t(\"object-assign\");n.prototype=new i.baseCalendar;var o=i.instance(\"gregorian\");a(n.prototype,{name:\"Nanakshahi\",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{\"\":{name:\"Nanakshahi\",epochs:[\"BN\",\"AN\"],monthNames:[\"Chet\",\"Vaisakh\",\"Jeth\",\"Harh\",\"Sawan\",\"Bhadon\",\"Assu\",\"Katak\",\"Maghar\",\"Poh\",\"Magh\",\"Phagun\"],monthNamesShort:[\"Che\",\"Vai\",\"Jet\",\"Har\",\"Saw\",\"Bha\",\"Ass\",\"Kat\",\"Mgr\",\"Poh\",\"Mgh\",\"Pha\"],dayNames:[\"Somvaar\",\"Mangalvar\",\"Budhvaar\",\"Veervaar\",\"Shukarvaar\",\"Sanicharvaar\",\"Etvaar\"],dayNamesShort:[\"Som\",\"Mangal\",\"Budh\",\"Veer\",\"Shukar\",\"Sanichar\",\"Et\"],dayNamesMin:[\"So\",\"Ma\",\"Bu\",\"Ve\",\"Sh\",\"Sa\",\"Et\"],digits:null,dateFormat:\"dd-mm-yyyy\",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear||i.regionalOptions[\"\"].invalidYear);return o.leapYear(e.year()+(e.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),\"d\"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidMonth);(t=n.year())<0&&t++;for(var a=n.day(),s=1;s<n.month();s++)a+=this.daysPerMonth[s-1];return a+o.toJD(t+1468,3,13)},fromJD:function(t){t=Math.floor(t+.5);for(var e=Math.floor((t-(this.jdEpoch-1))/366);t>=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),i.calendars.nanakshahi=n},{\"../main\":561,\"object-assign\":452}],556:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}var i=t(\"../main\"),a=t(\"object-assign\");n.prototype=new i.baseCalendar,a(n.prototype,{name:\"Nepali\",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{\"\":{name:\"Nepali\",epochs:[\"BBS\",\"ABS\"],monthNames:[\"Baisakh\",\"Jestha\",\"Ashadh\",\"Shrawan\",\"Bhadra\",\"Ashwin\",\"Kartik\",\"Mangsir\",\"Paush\",\"Mangh\",\"Falgun\",\"Chaitra\"],monthNamesShort:[\"Bai\",\"Je\",\"As\",\"Shra\",\"Bha\",\"Ash\",\"Kar\",\"Mang\",\"Pau\",\"Ma\",\"Fal\",\"Chai\"],dayNames:[\"Aaitabaar\",\"Sombaar\",\"Manglbaar\",\"Budhabaar\",\"Bihibaar\",\"Shukrabaar\",\"Shanibaar\"],dayNamesShort:[\"Aaita\",\"Som\",\"Mangl\",\"Budha\",\"Bihi\",\"Shukra\",\"Shani\"],dayNamesMin:[\"Aai\",\"So\",\"Man\",\"Bu\",\"Bi\",\"Shu\",\"Sha\"],digits:null,dateFormat:\"dd/mm/yyyy\",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),\"d\"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){if(t=this._validate(t,this.minMonth,this.minDay,i.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,i.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var a=i.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var u=t-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==e&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===e?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(u)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(u,1,1).add(o,\"d\").toJD()},fromJD:function(t){var e=i.instance().fromJD(t),r=e.year(),n=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;n>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var u=this.NEPALI_CALENDAR_DATA[a][o]-(l-n);return this.newDate(a,o,u)},_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],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),i.calendars.nepali=n},{\"../main\":561,\"object-assign\":452}],557:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}function i(t,e){return t-e*Math.floor(t/e)}var a=t(\"../main\"),o=t(\"object-assign\");n.prototype=new a.baseCalendar,o(n.prototype,{name:\"Persian\",jdEpoch:1948320.5,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{\"\":{name:\"Persian\",epochs:[\"BP\",\"AP\"],monthNames:[\"Farvardin\",\"Ordibehesht\",\"Khordad\",\"Tir\",\"Mordad\",\"Shahrivar\",\"Mehr\",\"Aban\",\"Azar\",\"Day\",\"Bahman\",\"Esfand\"],monthNamesShort:[\"Far\",\"Ord\",\"Kho\",\"Tir\",\"Mor\",\"Sha\",\"Meh\",\"Aba\",\"Aza\",\"Day\",\"Bah\",\"Esf\"],dayNames:[\"Yekshambe\",\"Doshambe\",\"Seshambe\",\"Chæharshambe\",\"Panjshambe\",\"Jom'e\",\"Shambe\"],dayNamesShort:[\"Yek\",\"Do\",\"Se\",\"Chæ\",\"Panj\",\"Jom\",\"Sha\"],dayNamesMin:[\"Ye\",\"Do\",\"Se\",\"Ch\",\"Pa\",\"Jo\",\"Sh\"],digits:null,dateFormat:\"yyyy/mm/dd\",firstDay:6,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,a.local.invalidYear);return 682*((e.year()-(e.year()>0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-(n.dayOfWeek()+1)%7,\"d\"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,a.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var o=t-(t>=0?474:473),s=474+i(o,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(o/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=i(e,1029983),a=2820;if(1029982!==n){var o=Math.floor(n/366),s=i(n,366);a=Math.floor((2134*o+2816*s+2815)/1028522)+o+1}var l=a+2820*r+474;l=l<=0?l-1:l;var u=t-this.toJD(l,1,1)+1,c=u<=186?Math.ceil(u/31):Math.ceil((u-6)/30),h=t-this.toJD(l,c,1)+1;return this.newDate(l,c,h)}}),a.calendars.persian=n,a.calendars.jalali=n},{\"../main\":561,\"object-assign\":452}],558:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}var i=t(\"../main\"),a=t(\"object-assign\"),o=i.instance();n.prototype=new i.baseCalendar,a(n.prototype,{name:\"Taiwan\",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{\"\":{name:\"Taiwan\",epochs:[\"BROC\",\"ROC\"],monthNames:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],monthNamesShort:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],dayNames:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],dayNamesShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],dayNamesMin:[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],digits:null,dateFormat:\"yyyy/mm/dd\",firstDay:1,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate),t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),i.calendars.taiwan=n},{\"../main\":561,\"object-assign\":452}],559:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}var i=t(\"../main\"),a=t(\"object-assign\"),o=i.instance();n.prototype=new i.baseCalendar,a(n.prototype,{name:\"Thai\",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{\"\":{name:\"Thai\",epochs:[\"BBE\",\"BE\"],monthNames:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],monthNamesShort:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],dayNames:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],dayNamesShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],dayNamesMin:[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],digits:null,dateFormat:\"dd/mm/yyyy\",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate),t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),i.calendars.thai=n},{\"../main\":561,\"object-assign\":452}],560:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}var i=t(\"../main\"),a=t(\"object-assign\");n.prototype=new i.baseCalendar,a(n.prototype,{name:\"UmmAlQura\",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{\"\":{name:\"Umm al-Qura\",epochs:[\"BH\",\"AH\"],monthNames:[\"Al-Muharram\",\"Safar\",\"Rabi' al-awwal\",\"Rabi' Al-Thani\",\"Jumada Al-Awwal\",\"Jumada Al-Thani\",\"Rajab\",\"Sha'aban\",\"Ramadan\",\"Shawwal\",\"Dhu al-Qi'dah\",\"Dhu al-Hijjah\"],monthNamesShort:[\"Muh\",\"Saf\",\"Rab1\",\"Rab2\",\"Jum1\",\"Jum2\",\"Raj\",\"Sha'\",\"Ram\",\"Shaw\",\"DhuQ\",\"DhuH\"],dayNames:[\"Yawm al-Ahad\",\"Yawm al-Ithnain\",\"Yawm al-Thalāthā’\",\"Yawm al-Arba‘ā’\",\"Yawm al-Khamīs\",\"Yawm al-Jum‘a\",\"Yawm al-Sabt\"],dayNamesMin:[\"Ah\",\"Ith\",\"Th\",\"Ar\",\"Kh\",\"Ju\",\"Sa\"],digits:null,dateFormat:\"yyyy/mm/dd\",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);return 355===this.daysInYear(e.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),\"d\"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(t,e){for(var r=this._validate(t,e,this.minDay,i.local.invalidMonth).toJD()-24e5+.5,n=0,a=0;a<o.length;a++){if(o[a]>r)return o[n]-o[n-1];n++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate),a=12*(n.year()-1)+n.month()-15292;return n.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,u=e-o[r-1]+1;return this.newDate(s,l,u)},isValid:function(t,e,r){var n=i.baseCalendar.prototype.isValid.apply(this,arguments);return n&&(n=(t=null!=t.year?t.year:t)>=1276&&t<=1500),n},_validate:function(t,e,r,n){var a=i.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw n.replace(/\\{0\\}/,this.local.name);return a}}),i.calendars.ummalqura=n;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{\"../main\":561,\"object-assign\":452}],561:[function(t,e,r){function n(){this.regionalOptions=[],this.regionalOptions[\"\"]={invalidCalendar:\"Calendar {0} not found\",invalidDate:\"Invalid {0} date\",invalidMonth:\"Invalid {0} month\",invalidYear:\"Invalid {0} year\",differentCalendars:\"Cannot mix {0} and {1} dates\"},this.local=this.regionalOptions[\"\"],this.calendars={},this._localCals={}}function i(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(u.local.invalidDate||u.regionalOptions[\"\"].invalidDate).replace(/\\{0\\}/,this._calendar.local.name)}function a(t,e){return t=\"\"+t,\"000000\".substring(0,e-t.length)+t}function o(){this.shortYearCutoff=\"+10\"}function s(t){this.local=this.regionalOptions[t]||this.regionalOptions[\"\"]}var l=t(\"object-assign\");l(n.prototype,{instance:function(t,e){t=(t||\"gregorian\").toLowerCase(),e=e||\"\";var r=this._localCals[t+\"-\"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+\"-\"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[\"\"].invalidCalendar).replace(/\\{0\\}/,t);return r},newDate:function(t,e,r,n,i){return(n=(null!=t&&t.year?t.calendar():\"string\"==typeof n?this.instance(n,i):n)||this.instance()).newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+\"\").replace(/[0-9]/g,function(e){return t[e]})}},substituteChineseDigits:function(t,e){return function(r){for(var n=\"\",i=0;r>0;){var a=r%10;n=(0===a?\"\":t[a]+e[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),l(i.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,\"y\")},month:function(t){return 0===arguments.length?this._month:this.set(t,\"m\")},day:function(t){return 0===arguments.length?this._day:this.set(t,\"d\")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(u.local.invalidDate||u.regionalOptions[\"\"].invalidDate).replace(/\\{0\\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(u.local.differentCalendars||u.regionalOptions[\"\"].differentCalendars).replace(/\\{0\\}/,this._calendar.local.name).replace(/\\{1\\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?\"-\":\"\")+a(Math.abs(this.year()),4)+\"-\"+a(this.month(),2)+\"-\"+a(this.day(),2)}}),l(o.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[\"\"].invalidDate),r=t.day(),e=t.month(),t=t.year()),new i(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[\"\"].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[\"\"].invalidYear);return(e.year()<0?\"-\":\"\")+a(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[\"\"].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,u.local.invalidMonth||u.regionalOptions[\"\"].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,u.local.invalidMonth||u.regionalOptions[\"\"].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[\"\"].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[\"\"].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[\"\"].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[\"\"].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[\"\"].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,\"d\"===r||\"w\"===r){var n=t.toJD()+e*(\"w\"===r?this.daysInWeek():1),i=t.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=t.year()+(\"y\"===r?e:0),o=t.monthOfYear()+(\"m\"===r?e:0),i=t.day();\"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,u.local.invalidDate||u.regionalOptions[\"\"].invalidDate);var n=\"y\"===r?e:t.year(),i=\"m\"===r?e:t.month(),a=\"d\"===r?e:t.day();return\"y\"!==r&&\"m\"!==r||(a=Math.min(a,this.daysInMonth(n,i))),t.date(n,i,a)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var i=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth<this.monthsInYear(i)&&r>=this.minDay&&r-this.minDay<this.daysInMonth(i)}return this._validateLevel--,n},toJSDate:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[\"\"].invalidDate);return u.instance().fromJD(this.toJD(n)).toJSDate()},fromJSDate:function(t){return this.fromJD(u.instance().fromJSDate(t).toJD())},_validate:function(t,e,r,n){if(t.year){if(0===this._validateLevel&&this.name!==t.calendar().name)throw(u.local.differentCalendars||u.regionalOptions[\"\"].differentCalendars).replace(/\\{0\\}/,this.local.name).replace(/\\{1\\}/,t.calendar().local.name);return t}try{if(1===++this._validateLevel&&!this.isValid(t,e,r))throw n.replace(/\\{0\\}/,this.local.name);var i=this.newDate(t,e,r);return this._validateLevel--,i}catch(t){throw this._validateLevel--,t}}}),s.prototype=new o,l(s.prototype,{name:\"Gregorian\",jdEpoch:1721425.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{\"\":{name:\"Gregorian\",epochs:[\"BCE\",\"CE\"],monthNames:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],monthNamesShort:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],dayNames:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],dayNamesShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],dayNamesMin:[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],digits:null,dateFormat:\"mm/dd/yyyy\",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[\"\"].invalidYear);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,u.local.invalidMonth||u.regionalOptions[\"\"].invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[\"\"].invalidDate);t=n.year(),e=n.month(),r=n.day(),t<0&&t++,e<3&&(e+=12,t--);var i=Math.floor(t/100),a=2-i+Math.floor(i/4);return Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r+a-1524.5},fromJD:function(t){var e=Math.floor(t+.5),r=Math.floor((e-1867216.25)/36524.25),n=(r=e+1+r-Math.floor(r/4))+1524,i=Math.floor((n-122.1)/365.25),a=Math.floor(365.25*i),o=Math.floor((n-a)/30.6001),s=n-a-Math.floor(30.6001*o),l=o-(o>13.5?13:1),u=i-(l>2.5?4716:4715);return u<=0&&u--,this.newDate(u,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[\"\"].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var u=e.exports=new n;u.cdate=i,u.baseCalendar=o,u.calendars.gregorian=s},{\"object-assign\":452}],562:[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=(r=r||{}).dayNamesShort||this.local.dayNamesShort,a=r.dayNames||this.local.dayNames,o=r.monthNumbers||this.local.monthNumbers,s=r.monthNamesShort||this.local.monthNamesShort,l=r.monthNames||this.local.monthNames,u=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;g+n<t.length&&t.charAt(g+n)===e;)n++;return g+=n-1,Math.floor(n/(r||1))>1}),c=function(t,e,r,n){var i=\"\"+e;if(u(t,n))for(;i.length<r;)i=\"0\"+i;return i},h=this,f=this.local.digits,d=function(t){return r.localNumbers&&f?f(t):t},p=\"\",m=!1,g=0;g<t.length;g++)if(m)\"'\"!==t.charAt(g)||u(\"'\")?p+=t.charAt(g):m=!1;else switch(t.charAt(g)){case\"d\":p+=d(c(\"d\",e.day(),2));break;case\"D\":p+=function(t,e,r,n){return u(t)?n[e]:r[e]}(\"D\",e.dayOfWeek(),n,a);break;case\"o\":p+=c(\"o\",e.dayOfYear(),3);break;case\"w\":p+=c(\"w\",e.weekOfYear(),2);break;case\"m\":p+=function(t){return\"function\"==typeof o?o.call(h,t,u(\"m\")):d(c(\"m\",t.month(),2))}(e);break;case\"M\":p+=function(t,e){return e?\"function\"==typeof l?l.call(h,t):l[t.month()-h.minMonth]:\"function\"==typeof s?s.call(h,t):s[t.month()-h.minMonth]}(e,u(\"M\"));break;case\"y\":p+=u(\"y\",2)?e.year():(e.year()%100<10?\"0\":\"\")+e.year()%100;break;case\"Y\":u(\"Y\",2),p+=e.formatYear();break;case\"J\":p+=e.toJD();break;case\"@\":p+=(e.toJD()-this.UNIX_EPOCH)*this.SECS_PER_DAY;break;case\"!\":p+=(e.toJD()-this.TICKS_EPOCH)*this.TICKS_PER_DAY;break;case\"'\":u(\"'\")?p+=\"'\":m=!0;break;default:p+=t.charAt(g)}return p},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,u=r.monthNamesShort||this.local.monthNamesShort,c=r.monthNames||this.local.monthNames,h=-1,f=-1,d=-1,p=-1,m=-1,g=!1,v=!1,y=function(e,r){for(var n=1;k+n<t.length&&t.charAt(k+n)===e;)n++;return k+=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(M).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[\"\"].missingNumberAt).replace(/\\{0\\}/,M);return M+=s[0].length,parseInt(s[0],10)},x=this,_=function(t,r,n,a){for(var o=y(t,a)?n:r,s=0;s<o.length;s++)if(e.substr(M,o[s].length).toLowerCase()===o[s].toLowerCase())return M+=o[s].length,s+x.minMonth;throw(i.local.unknownNameAt||i.regionalOptions[\"\"].unknownNameAt).replace(/\\{0\\}/,M)},w=function(){if(e.charAt(M)!==t.charAt(k))throw(i.local.unexpectedLiteralAt||i.regionalOptions[\"\"].unexpectedLiteralAt).replace(/\\{0\\}/,M);M++},M=0,k=0;k<t.length;k++)if(v)\"'\"!==t.charAt(k)||y(\"'\")?w():v=!1;else switch(t.charAt(k)){case\"d\":p=b(\"d\");break;case\"D\":_(\"D\",a,o);break;case\"o\":m=b(\"o\");break;case\"w\":b(\"w\");break;case\"m\":d=function(){if(\"function\"==typeof l){y(\"m\");var t=l.call(x,e.substring(M));return M+=t.length,t}return b(\"m\")}();break;case\"M\":d=function(){if(\"function\"==typeof c){var t=y(\"M\")?c.call(x,e.substring(M)):u.call(x,e.substring(M));return M+=t.length,t}return _(\"M\",u,c)}();break;case\"y\":var A=k;g=!y(\"y\",2),k=A,f=b(\"y\",2);break;case\"Y\":f=b(\"Y\",2);break;case\"J\":h=b(\"J\")+.5,\".\"===e.charAt(M)&&(M++,b(\"J\"));break;case\"@\":h=b(\"@\")/this.SECS_PER_DAY+this.UNIX_EPOCH;break;case\"!\":h=b(\"!\")/this.TICKS_PER_DAY+this.TICKS_EPOCH;break;case\"*\":M=e.length;break;case\"'\":y(\"'\")?w():v=!0;break;default:w()}if(M<e.length)throw i.local.unexpectedText||i.regionalOptions[\"\"].unexpectedText;if(-1===f?f=this.today().year():f<100&&g&&(f+=-1===n?1900:this.today().year()-this.today().year()%100-(f<=n?0:100)),\"string\"==typeof d&&(d=s.call(this,f,d)),m>-1){d=1,p=m;for(var T=this.daysInMonth(f,d);p>T;T=this.daysInMonth(f,d))d++,p-=T}return h>-1?this.fromJD(h):this.newDate(f,d,p)},determineDate:function(t,e,r,n,i){r&&\"object\"!=typeof r&&(i=n,n=r,r=null),\"string\"!=typeof n&&(i=n,n=\"\");var a=this;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\":561,\"object-assign\":452}],563:[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\":103}],564:[function(t,e,r){\"use strict\";function n(t,e){var r=[];return e=+e||0,i(t.hi(t.shape[0]-1),r,e),r}e.exports=n;var i=t(\"./lib/zc-core\")},{\"./lib/zc-core\":563}],565:[function(t,e,r){\"use strict\";var n=t(\"../../lib\"),i=t(\"../color\"),a=t(\"../../plots/cartesian/axes\"),o=t(\"../../plots/cartesian/constants\"),s=t(\"./attributes\");e.exports=function(t,e,r,l,u){function c(r,i){return n.coerce(t,e,s,r,i)}l=l||{};var h=c(\"visible\",!(u=u||{}).itemIsNotPlainObject),f=c(\"clicktoshow\");if(!h&&!f)return e;c(\"opacity\");var d=c(\"bgcolor\"),p=c(\"bordercolor\"),m=i.opacity(p);c(\"borderpad\");var g=c(\"borderwidth\"),v=c(\"showarrow\");c(\"text\",v?\" \":\"new text\"),c(\"textangle\"),n.coerceFont(c,\"font\",r.font),c(\"width\"),c(\"align\"),c(\"height\")&&c(\"valign\");for(var y=[\"x\",\"y\"],b=[-10,-30],x={_fullLayout:r},_=0;_<2;_++){var w=y[_],M=a.coerceRef(t,e,x,w,\"\",\"paper\");if(a.coercePosition(e,x,c,M,w,.5),v){var k=\"a\"+w,A=a.coerceRef(t,e,x,k,\"pixel\");\"pixel\"!==A&&A!==M&&(A=e[k]=\"pixel\");var T=\"pixel\"===A?b[_]:.4;a.coercePosition(e,x,c,A,k,T)}c(w+\"anchor\"),c(w+\"shift\")}if(n.noneOrAll(t,e,[\"x\",\"y\"]),v&&(c(\"arrowcolor\",m?e.bordercolor:i.defaultLine),c(\"arrowhead\"),c(\"arrowsize\"),c(\"arrowwidth\",2*(m&&g||1)),c(\"standoff\"),n.noneOrAll(t,e,[\"ax\",\"ay\"])),f){var S=c(\"xclick\"),E=c(\"yclick\");e._xclick=void 0===S?e.x:S,e._yclick=void 0===E?e.y:E}var L=c(\"hovertext\");if(L){var C=c(\"hoverlabel.bgcolor\",i.opacity(d)?i.rgb(d):i.defaultLine),z=c(\"hoverlabel.bordercolor\",i.contrast(C));n.coerceFont(c,\"hoverlabel.font\",{family:o.HOVERFONT,size:o.HOVERFONTSIZE,color:z})}return c(\"captureevents\",!!L),e}},{\"../../lib\":685,\"../../plots/cartesian/axes\":724,\"../../plots/cartesian/constants\":729,\"../color\":578,\"./attributes\":567}],566:[function(t,e,r){\"use strict\";e.exports=[{path:\"\",backoff:0},{path:\"M-2.4,-3V3L0.6,0Z\",backoff:.6},{path:\"M-3.7,-2.5V2.5L1.3,0Z\",backoff:1.3},{path:\"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z\",backoff:1.55},{path:\"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z\",backoff:1.6},{path:\"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z\",backoff:2},{path:\"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z\",backoff:0},{path:\"M2,2V-2H-2V2Z\",backoff:0}]},{}],567:[function(t,e,r){\"use strict\";var n=t(\"./arrow_paths\"),i=t(\"../../plots/font_attributes\"),a=t(\"../../plots/cartesian/constants\"),o=t(\"../../lib/extend\").extendFlat;e.exports={_isLinkedToArray:\"annotation\",visible:{valType:\"boolean\",dflt:!0},text:{valType:\"string\"},textangle:{valType:\"angle\",dflt:0},font:o({},i,{}),width:{valType:\"number\",min:1,dflt:null},height:{valType:\"number\",min:1,dflt:null},opacity:{valType:\"number\",min:0,max:1,dflt:1},align:{valType:\"enumerated\",values:[\"left\",\"center\",\"right\"],dflt:\"center\"},valign:{valType:\"enumerated\",values:[\"top\",\"middle\",\"bottom\"],dflt:\"middle\"},bgcolor:{valType:\"color\",dflt:\"rgba(0,0,0,0)\"},bordercolor:{valType:\"color\",dflt:\"rgba(0,0,0,0)\"},borderpad:{valType:\"number\",min:0,dflt:1},borderwidth:{valType:\"number\",min:0,dflt:1},showarrow:{valType:\"boolean\",dflt:!0},arrowcolor:{valType:\"color\"},arrowhead:{valType:\"integer\",min:0,max:n.length,dflt:1},arrowsize:{valType:\"number\",min:.3,dflt:1},arrowwidth:{valType:\"number\",min:.1},standoff:{valType:\"number\",min:0,dflt:0},ax:{valType:\"any\"},ay:{valType:\"any\"},axref:{valType:\"enumerated\",dflt:\"pixel\",values:[\"pixel\",a.idRegex.x.toString()]},ayref:{valType:\"enumerated\",dflt:\"pixel\",values:[\"pixel\",a.idRegex.y.toString()]},xref:{valType:\"enumerated\",values:[\"paper\",a.idRegex.x.toString()]},x:{valType:\"any\"},xanchor:{valType:\"enumerated\",values:[\"auto\",\"left\",\"center\",\"right\"],dflt:\"auto\"},xshift:{valType:\"number\",dflt:0},yref:{valType:\"enumerated\",values:[\"paper\",a.idRegex.y.toString()]},y:{valType:\"any\"},yanchor:{valType:\"enumerated\",values:[\"auto\",\"top\",\"middle\",\"bottom\"],dflt:\"auto\"},yshift:{valType:\"number\",dflt:0},clicktoshow:{valType:\"enumerated\",values:[!1,\"onoff\",\"onout\"],dflt:!1},xclick:{valType:\"any\"},yclick:{valType:\"any\"},hovertext:{valType:\"string\"},hoverlabel:{bgcolor:{valType:\"color\"},bordercolor:{valType:\"color\"},font:o({},i,{})},captureevents:{valType:\"boolean\"},_deprecated:{ref:{valType:\"string\"}}}},{\"../../lib/extend\":677,\"../../plots/cartesian/constants\":729,\"../../plots/font_attributes\":748,\"./arrow_paths\":566}],568:[function(t,e,r){\"use strict\";function n(t){var e=t._fullLayout;i.filterVisible(e.annotations).forEach(function(e){var r,n,i=a.getFromId(t,e.xref),o=a.getFromId(t,e.yref),s=3*e.arrowsize*e.arrowwidth||0;i&&i.autorange&&(r=s+e.xshift,n=s-e.xshift,e.axref===e.xref?(a.expand(i,[i.r2c(e.x)],{ppadplus:r,ppadminus:n}),a.expand(i,[i.r2c(e.ax)],{ppadplus:e._xpadplus,ppadminus:e._xpadminus})):a.expand(i,[i.r2c(e.x)],{ppadplus:Math.max(e._xpadplus,r),ppadminus:Math.max(e._xpadminus,n)})),o&&o.autorange&&(r=s-e.yshift,n=s+e.yshift,e.ayref===e.yref?(a.expand(o,[o.r2c(e.y)],{ppadplus:r,ppadminus:n}),a.expand(o,[o.r2c(e.ay)],{ppadplus:e._ypadplus,ppadminus:e._ypadminus})):a.expand(o,[o.r2c(e.y)],{ppadplus:Math.max(e._ypadplus,r),ppadminus:Math.max(e._ypadminus,n)}))})}var i=t(\"../../lib\"),a=t(\"../../plots/cartesian/axes\"),o=t(\"./draw\").draw;e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.annotations);if(r.length&&t._fullData.length){var s={};if(r.forEach(function(t){s[t.xref]=!0,s[t.yref]=!0}),a.list(t).filter(function(t){return t.autorange&&s[t._id]}).length)return i.syncOrAsync([o,n],t)}}},{\"../../lib\":685,\"../../plots/cartesian/axes\":724,\"./draw\":572}],569:[function(t,e,r){\"use strict\";function n(t,e){var r=a(t,e);return r.on.length>0||r.explicitOff.length>0}function i(t,e){var r,n=a(t,e),i=n.on,s=n.off.concat(n.explicitOff),l={};if(i.length||s.length){for(r=0;r<i.length;r++)l[\"annotations[\"+i[r]+\"].visible\"]=!0;for(r=0;r<s.length;r++)l[\"annotations[\"+s[r]+\"].visible\"]=!1;return o.update(t,{},l)}}function a(t,e){var r,n,i,a,o,s=t._fullLayout.annotations,l=[],u=[],c=[],h=(e||[]).length;for(r=0;r<s.length;r++)if(i=s[r],a=i.clicktoshow){for(n=0;n<h;n++)if((o=e[n]).xaxis._id===i.xref&&o.yaxis._id===i.yref&&o.xaxis.d2r(o.x)===i._xclick&&o.yaxis.d2r(o.y)===i._yclick){(i.visible?\"onout\"===a?u:c:l).push(r);break}n===h&&i.visible&&\"onout\"===a&&u.push(r)}return{on:l,off:u,explicitOff:c}}var o=t(\"../../plotly\");e.exports={hasClickToShow:n,onClick:i}},{\"../../plotly\":719}],570:[function(t,e,r){\"use strict\";var n=t(\"fast-isnumeric\"),i=t(\"../../lib/to_log_range\");e.exports=function(t,e,r,a){function o(t){var r=u[t],o=null;o=s?i(r,e.range):Math.pow(10,r),n(o)||(o=null),a(c+t,o)}e=e||{};var s=\"log\"===r&&\"linear\"===e.type,l=\"linear\"===r&&\"log\"===e.type;if(s||l)for(var u,c,h=t._fullLayout.annotations,f=e._id.charAt(0),d=0;d<h.length;d++)u=h[d],c=\"annotations[\"+d+\"].\",u[f+\"ref\"]===e._id&&o(f),u[\"a\"+f+\"ref\"]===e._id&&o(\"a\"+f)}},{\"../../lib/to_log_range\":705,\"fast-isnumeric\":116}],571:[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\":721,\"./annotation_defaults\":565}],572:[function(t,e,r){\"use strict\";function n(t){var e=t._fullLayout;e._infolayer.selectAll(\".annotation\").remove();for(var r=0;r<e.annotations.length;r++)e.annotations[r].visible&&i(t,r);return l.previousPromises(t)}function i(t,e){function r(t){return t.call(d.font,O).attr({\"text-anchor\":{left:\"start\",right:\"end\"}[x.align]||\"middle\"}),p.convertToTspans(t,n),t}function n(){function r(t,e){return\"auto\"===e&&(e=t<1/3?\"left\":t>2/3?\"right\":\"center\"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}j.selectAll(\"tspan.line\").attr({y:0,x:0});var n=E.select(\".annotation-math-group\"),i=!n.empty(),h=d.bBox((i?n:j).node()),p=h.width,b=h.height,C=x.width||p,O=x.height||b,R=Math.round(C+2*z),F=Math.round(O+2*z);x._w=C,x._h=O;var N=!1;if([\"x\",\"y\"].forEach(function(e){var n,i,a,o,s,h=x[e+\"ref\"]||e,f=x[\"a\"+e+\"ref\"],d=c.getFromId(t,h),p=(A+(\"x\"===e?0:-90))*Math.PI/180,m=R*Math.cos(p),g=F*Math.sin(p),v=Math.abs(m)+Math.abs(g),b=x[e+\"anchor\"],_=x[e+\"shift\"]*(\"x\"===e?1:-1),w=k[e];if(d){var M=d.r2fraction(x[e]);if((t._dragging||!d.autorange)&&(M<0||M>1)&&(f===h?((M=d.r2fraction(x[\"a\"+e]))<0||M>1)&&(N=!0):N=!0,N))return;n=d._offset+d.r2p(x[e]),o=.5}else\"x\"===e?(a=x[e],n=y.l+y.w*a):(a=1-x[e],n=y.t+y.h*a),o=x.showarrow?.5:a;if(x.showarrow){w.head=n;var T=x[\"a\"+e];s=m*r(.5,x.xanchor)-g*r(.5,x.yanchor),f===h?(w.tail=d._offset+d.r2p(T),i=s):(w.tail=n+T,i=s+T),w.text=w.tail+s;var S=l[\"x\"===e?\"width\":\"height\"];if(\"paper\"===h&&(w.head=u.constrain(w.head,1,S-1)),\"pixel\"===f){var E=-Math.max(w.tail-3,w.text),L=Math.min(w.tail+3,w.text)-S;E>0?(w.tail+=E,w.text+=E):L>0&&(w.tail-=L,w.text-=L)}w.tail+=_,w.head+=_}else i=s=v*r(o,b),w.text=n+s;w.text+=_,s+=_,i+=_,x[\"_\"+e+\"padplus\"]=v/2+i,x[\"_\"+e+\"padminus\"]=v/2-i,x[\"_\"+e+\"size\"]=v,x[\"_\"+e+\"shift\"]=s}),N)E.remove();else{var B=0,U=0;if(\"left\"!==x.align&&(B=(C-p)*(\"center\"===x.align?.5:1)),\"top\"!==x.valign&&(U=(O-b)*(\"middle\"===x.valign?.5:1)),i)n.select(\"svg\").attr({x:z+B-1,y:z+U}).call(d.setClipUrl,I?_:null);else{var V=z+U-h.top,H=z+B-h.left;j.attr({x:H,y:V}).call(d.setClipUrl,I?_:null),j.selectAll(\"tspan.line\").attr({y:V,x:H})}P.select(\"rect\").call(d.setRect,z,z,C,O),D.call(d.setRect,L/2,L/2,R-L,F-L),E.call(d.setTranslate,Math.round(k.x.text-R/2),Math.round(k.y.text-F/2)),S.attr({transform:\"rotate(\"+A+\",\"+k.x.text+\",\"+k.y.text+\")\"});var q=\"annotations[\"+e+\"]\",G=function(r,n){o.select(t).selectAll('.annotation-arrow-g[data-index=\"'+e+'\"]').remove();var i=k.x.head,l=k.y.head,c=k.x.tail+r,h=k.y.tail+n,p=k.x.text+r,m=k.y.text+n,b=u.rotationXYMatrix(A,p,m),_=u.apply2DTransform(b),L=u.apply2DTransform2(b),C=+D.attr(\"width\"),z=+D.attr(\"height\"),I=p-.5*C,P=I+C,O=m-.5*z,j=O+z,R=[[I,O,I,j],[I,j,P,j],[P,j,P,O],[P,O,I,O]].map(L);if(!R.reduce(function(t,e){return t^!!a(i,l,i+1e6,l+1e6,e[0],e[1],e[2],e[3])},!1)){R.forEach(function(t){var e=a(c,h,i,l,t[0],t[1],t[2],t[3]);e&&(c=e.x,h=e.y)});var F=x.arrowwidth,N=x.arrowcolor,B=T.append(\"g\").style({opacity:f.opacity(N)}).classed(\"annotation-arrow-g\",!0).attr(\"data-index\",String(e)),U=B.append(\"path\").attr(\"d\",\"M\"+c+\",\"+h+\"L\"+i+\",\"+l).style(\"stroke-width\",F+\"px\").call(f.stroke,f.rgb(N));if(v(U,x.arrowhead,\"end\",x.arrowsize,x.standoff),t._context.editable&&U.node().parentNode){var V=i,H=l;if(x.standoff){var G=Math.sqrt(Math.pow(i-c,2)+Math.pow(l-h,2));V+=x.standoff*(c-i)/G,H+=x.standoff*(h-l)/G}var Y,W,X,Z=B.append(\"path\").classed(\"annotation\",!0).classed(\"anndrag\",!0).attr({\"data-index\":String(e),d:\"M3,3H-3V-3H3ZM0,0L\"+(c-V)+\",\"+(h-H),transform:\"translate(\"+V+\",\"+H+\")\"}).style(\"stroke-width\",F+6+\"px\").call(f.stroke,\"rgba(0,0,0,0)\").call(f.fill,\"rgba(0,0,0,0)\");g.init({element:Z.node(),prepFn:function(){var t=d.getTranslate(E);W=t.x,X=t.y,Y={},w&&w.autorange&&(Y[w._name+\".autorange\"]=!0),M&&M.autorange&&(Y[M._name+\".autorange\"]=!0)},moveFn:function(t,e){var r=_(W,X),n=r[0]+t,i=r[1]+e;E.call(d.setTranslate,n,i),Y[q+\".x\"]=w?w.p2r(w.r2p(x.x)+t):x.x+t/y.w,Y[q+\".y\"]=M?M.p2r(M.r2p(x.y)+e):x.y-e/y.h,x.axref===x.xref&&(Y[q+\".ax\"]=w.p2r(w.r2p(x.ax)+t)),x.ayref===x.yref&&(Y[q+\".ay\"]=M.p2r(M.r2p(x.ay)+e)),B.attr(\"transform\",\"translate(\"+t+\",\"+e+\")\"),S.attr({transform:\"rotate(\"+A+\",\"+n+\",\"+i+\")\"})},doneFn:function(e){if(e){s.relayout(t,Y);var r=document.querySelector(\".js-notes-box-panel\");r&&r.redraw(r.selectedObj)}}})}}};if(x.showarrow&&G(0,0),t._context.editable){var Y,W;g.init({element:E.node(),prepFn:function(){W=S.attr(\"transform\"),Y={}},moveFn:function(t,e){var r=\"pointer\";if(x.showarrow)x.axref===x.xref?Y[q+\".ax\"]=w.p2r(w.r2p(x.ax)+t):Y[q+\".ax\"]=x.ax+t,x.ayref===x.yref?Y[q+\".ay\"]=M.p2r(M.r2p(x.ay)+e):Y[q+\".ay\"]=x.ay+e,G(t,e);else{if(w)Y[q+\".x\"]=x.x+t/w._m;else{var n=x._xsize/y.w,i=x.x+(x._xshift-x.xshift)/y.w-n/2;Y[q+\".x\"]=g.align(i+t/y.w,n,0,1,x.xanchor)}if(M)Y[q+\".y\"]=x.y+e/M._m;else{var a=x._ysize/y.h,o=x.y-(x._yshift+x.yshift)/y.h-a/2;Y[q+\".y\"]=g.align(o-e/y.h,a,0,1,x.yanchor)}w&&M||(r=g.getCursor(w?.5:Y[q+\".x\"],M?.5:Y[q+\".y\"],x.xanchor,x.yanchor))}S.attr({transform:\"translate(\"+t+\",\"+e+\")\"+W}),m(E,r)},doneFn:function(e){if(m(E),e){s.relayout(t,Y);var r=document.querySelector(\".js-notes-box-panel\");r&&r.redraw(r.selectedObj)}}})}}}var i=t.layout,l=t._fullLayout,y=t._fullLayout._size;l._infolayer.selectAll('.annotation[data-index=\"'+e+'\"]').remove();var b=(i.annotations||[])[e],x=l.annotations[e],_=\"clip\"+l._uid+\"_ann\"+e;if(b&&!1!==x.visible){var w=c.getFromId(t,x.xref),M=c.getFromId(t,x.yref),k={x:{},y:{}},A=+x.textangle||0,T=l._infolayer.append(\"g\").classed(\"annotation\",!0).attr(\"data-index\",String(e)).style(\"opacity\",x.opacity),S=T.append(\"g\").classed(\"annotation-text-g\",!0).attr(\"data-index\",String(e)),E=S.append(\"g\").style(\"pointer-events\",x.captureevents?\"all\":null).call(m,\"default\").on(\"click\",function(){t._dragging=!1,t.emit(\"plotly_clickannotation\",{index:e,annotation:b,fullAnnotation:x})});x.hovertext&&E.on(\"mouseover\",function(){var e=x.hoverlabel,r=e.font,n=this.getBoundingClientRect(),i=t.getBoundingClientRect();h.loneHover({x0:n.left-i.left,x1:n.right-i.left,y:(n.top+n.bottom)/2-i.top,text:x.hovertext,color:e.bgcolor,borderColor:e.bordercolor,fontFamily:r.family,fontSize:r.size,fontColor:r.color},{container:l._hoverlayer.node(),outerContainer:l._paper.node()})}).on(\"mouseout\",function(){h.loneUnhover(l._hoverlayer.node())});var L=x.borderwidth,C=x.borderpad,z=L+C,D=E.append(\"rect\").attr(\"class\",\"bg\").style(\"stroke-width\",L+\"px\").call(f.stroke,x.bordercolor).call(f.fill,x.bgcolor),I=x.width||x.height,P=l._defs.select(\".clips\").selectAll(\"#\"+_).data(I?[0]:[]);P.enter().append(\"clipPath\").classed(\"annclip\",!0).attr(\"id\",_).append(\"rect\"),P.exit().remove();var O=x.font,j=E.append(\"text\").classed(\"annotation\",!0).attr(\"data-unformatted\",x.text).text(x.text);t._context.editable?j.call(p.makeEditable,E).call(r).on(\"edit\",function(n){x.text=n,this.attr({\"data-unformatted\":x.text}),this.call(r);var i={};i[\"annotations[\"+e+\"].text\"]=x.text,w&&w.autorange&&(i[w._name+\".autorange\"]=!0),M&&M.autorange&&(i[M._name+\".autorange\"]=!0),s.relayout(t,i)}):j.call(r)}else o.selectAll(\"#\"+_).remove()}function a(t,e,r,n,i,a,o,s){var l=r-t,u=i-t,c=o-i,h=n-e,f=a-e,d=s-a,p=l*d-c*h;if(0===p)return null;var m=(u*d-c*f)/p,g=(u*h-l*f)/p;return g<0||g>1||m<0||m>1?null:{x:t+l*m,y:e+h*m}}var o=t(\"d3\"),s=t(\"../../plotly\"),l=t(\"../../plots/plots\"),u=t(\"../../lib\"),c=t(\"../../plots/cartesian/axes\"),h=t(\"../../plots/cartesian/graph_interact\"),f=t(\"../color\"),d=t(\"../drawing\"),p=t(\"../../lib/svg_text_utils\"),m=t(\"../../lib/setcursor\"),g=t(\"../dragelement\"),v=t(\"./draw_arrow_head\");e.exports={draw:n,drawOne:i}},{\"../../lib\":685,\"../../lib/setcursor\":700,\"../../lib/svg_text_utils\":704,\"../../plotly\":719,\"../../plots/cartesian/axes\":724,\"../../plots/cartesian/graph_interact\":733,\"../../plots/plots\":787,\"../color\":578,\"../dragelement\":599,\"../drawing\":602,\"./draw_arrow_head\":573,d3:107}],573:[function(t,e,r){\"use strict\";var n=t(\"d3\"),i=t(\"fast-isnumeric\"),a=t(\"../color\"),o=t(\"../drawing\"),s=t(\"./arrow_paths\");e.exports=function(t,e,r,l,u){function c(){t.style(\"stroke-dasharray\",\"0px,100px\")}function h(r,i){d.path&&(e>5&&(i=0),n.select(f.parentElement).append(\"path\").attr({class:t.attr(\"class\"),d:d.path,transform:\"translate(\"+r.x+\",\"+r.y+\")rotate(\"+180*i/Math.PI+\")scale(\"+y+\")\"}).style({fill:b,opacity:x,\"stroke-width\":0}))}i(l)||(l=1);var f=t.node(),d=s[e||0];\"string\"==typeof r&&r||(r=\"end\");var p,m,g,v,y=(o.getPx(t,\"stroke-width\")||1)*l,b=t.style(\"stroke\")||a.defaultLine,x=t.style(\"stroke-opacity\")||1,_=r.indexOf(\"start\")>=0,w=r.indexOf(\"end\")>=0,M=d.backoff*y+u;if(\"line\"===f.nodeName){p={x:+t.attr(\"x1\"),y:+t.attr(\"y1\")},m={x:+t.attr(\"x2\"),y:+t.attr(\"y2\")};var k=p.x-m.x,A=p.y-m.y;if(g=Math.atan2(A,k),v=g+Math.PI,M){if(M*M>k*k+A*A)return void c();var T=M*Math.cos(g),S=M*Math.sin(g);_&&(p.x-=T,p.y-=S,t.attr({x1:p.x,y1:p.y})),w&&(m.x+=T,m.y+=S,t.attr({x2:m.x,y2:m.y}))}}else if(\"path\"===f.nodeName){var E=f.getTotalLength(),L=\"\";if(E<M)return void c();if(_){var C=f.getPointAtLength(0),z=f.getPointAtLength(.1);g=Math.atan2(C.y-z.y,C.x-z.x),p=f.getPointAtLength(Math.min(M,E)),M&&(L=\"0px,\"+M+\"px,\")}if(w){var D=f.getPointAtLength(E),I=f.getPointAtLength(E-.1);v=Math.atan2(D.y-I.y,D.x-I.x),m=f.getPointAtLength(Math.max(0,E-M)),M&&(L+=E-(L?2*M:M)+\"px,\"+E+\"px\")}else L&&(L+=E+\"px\");L&&t.style(\"stroke-dasharray\",L)}_&&h(p,g),w&&h(m,v)}},{\"../color\":578,\"../drawing\":602,\"./arrow_paths\":566,d3:107,\"fast-isnumeric\":116}],574:[function(t,e,r){\"use strict\";var n=t(\"./draw\"),i=t(\"./click\");e.exports={moduleType:\"component\",name:\"annotations\",layoutAttributes:t(\"./attributes\"),supplyLayoutDefaults:t(\"./defaults\"),calcAutorange:t(\"./calc_autorange\"),draw:n.draw,drawOne:n.drawOne,hasClickToShow:i.hasClickToShow,onClick:i.onClick,convertCoords:t(\"./convert_coords\")}},{\"./attributes\":567,\"./calc_autorange\":568,\"./click\":569,\"./convert_coords\":570,\"./defaults\":571,\"./draw\":572}],575:[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\":547,\"world-calendars/dist/calendars/coptic\":548,\"world-calendars/dist/calendars/discworld\":549,\"world-calendars/dist/calendars/ethiopian\":550,\"world-calendars/dist/calendars/hebrew\":551,\"world-calendars/dist/calendars/islamic\":552,\"world-calendars/dist/calendars/julian\":553,\"world-calendars/dist/calendars/mayan\":554,\"world-calendars/dist/calendars/nanakshahi\":555,\"world-calendars/dist/calendars/nepali\":556,\"world-calendars/dist/calendars/persian\":557,\"world-calendars/dist/calendars/taiwan\":558,\"world-calendars/dist/calendars/thai\":559,\"world-calendars/dist/calendars/ummalqura\":560,\"world-calendars/dist/main\":561,\"world-calendars/dist/plus\":562}],576:[function(t,e,r){\"use strict\";function n(t,e,r){for(var n,a,o,s,l,u=Math.floor((e+.05)/h)+c,f=i(r).fromJD(u),d=0;-1!==(d=t.indexOf(\"%\",d));)\"0\"===(n=t.charAt(d+1))||\"-\"===n||\"_\"===n?(o=3,a=t.charAt(d+2),\"_\"===n&&(n=\"-\")):(a=n,n=\"0\",o=2),(s=b[a])?(l=s===y?y:f.formatDate(s[n]),t=t.substr(0,d)+l+t.substr(d+o),d+=l.length):d+=o;return t}function i(t){var e=x[t];return e||(e=x[t]=s.instance(t))}function a(t){return l.extendFlat({},f,{description:t})}function o(t){return\"Sets the calendar system to use with `\"+t+\"` date data.\"}var s=t(\"./calendars\"),l=t(\"../../lib\"),u=t(\"../../constants/numerical\"),c=u.EPOCHJD,h=u.ONEDAY,f={valType:\"enumerated\",values:Object.keys(s.calendars),dflt:\"gregorian\"},d=function(t,e,r,n){var i={};return i[r]=f,l.coerce(t,e,i,r,n)},p=function(t,e,r,n){for(var i=0;i<r.length;i++)d(t,e,r[i]+\"calendar\",n.calendar)},m={chinese:\"2000-01-01\",coptic:\"2000-01-01\",discworld:\"2000-01-01\",ethiopian:\"2000-01-01\",hebrew:\"5000-01-01\",islamic:\"1000-01-01\",julian:\"2000-01-01\",mayan:\"5000-01-01\",nanakshahi:\"1000-01-01\",nepali:\"2000-01-01\",persian:\"1000-01-01\",jalali:\"1000-01-01\",taiwan:\"1000-01-01\",thai:\"2000-01-01\",ummalqura:\"1400-01-01\"},g={chinese:\"2000-01-02\",coptic:\"2000-01-03\",discworld:\"2000-01-03\",ethiopian:\"2000-01-05\",hebrew:\"5000-01-01\",islamic:\"1000-01-02\",julian:\"2000-01-03\",mayan:\"5000-01-01\",nanakshahi:\"1000-01-05\",nepali:\"2000-01-05\",persian:\"1000-01-01\",jalali:\"1000-01-01\",taiwan:\"1000-01-04\",thai:\"2000-01-04\",ummalqura:\"1400-01-06\"},v={chinese:[\"2000-01-01\",\"2001-01-01\"],coptic:[\"1700-01-01\",\"1701-01-01\"],discworld:[\"1800-01-01\",\"1801-01-01\"],ethiopian:[\"2000-01-01\",\"2001-01-01\"],hebrew:[\"5700-01-01\",\"5701-01-01\"],islamic:[\"1400-01-01\",\"1401-01-01\"],julian:[\"2000-01-01\",\"2001-01-01\"],mayan:[\"5200-01-01\",\"5201-01-01\"],nanakshahi:[\"0500-01-01\",\"0501-01-01\"],nepali:[\"2000-01-01\",\"2001-01-01\"],persian:[\"1400-01-01\",\"1401-01-01\"],jalali:[\"1400-01-01\",\"1401-01-01\"],taiwan:[\"0100-01-01\",\"0101-01-01\"],thai:[\"2500-01-01\",\"2501-01-01\"],ummalqura:[\"1400-01-01\",\"1401-01-01\"]},y=\"##\",b={d:{0:\"dd\",\"-\":\"d\"},e:{0:\"d\",\"-\":\"d\"},a:{0:\"D\",\"-\":\"D\"},A:{0:\"DD\",\"-\":\"DD\"},j:{0:\"oo\",\"-\":\"o\"},W:{0:\"ww\",\"-\":\"w\"},m:{0:\"mm\",\"-\":\"m\"},b:{0:\"M\",\"-\":\"M\"},B:{0:\"MM\",\"-\":\"MM\"},y:{0:\"yy\",\"-\":\"yy\"},Y:{0:\"yyyy\",\"-\":\"yyyy\"},U:y,w:y,c:{0:\"D M d %X yyyy\",\"-\":\"D M d %X yyyy\"},x:{0:\"mm/dd/yyyy\",\"-\":\"mm/dd/yyyy\"}},x={},_={xcalendar:a(o(\"x\"))},w=l.extendFlat({},_,{ycalendar:a(o(\"y\"))}),M=l.extendFlat({},w,{zcalendar:a(o(\"z\"))}),k=a([\"Sets the calendar system to use for `range` and `tick0`\",\"if this is a date axis. This does not set the calendar for\",\"interpreting data on this axis, that's specified in the trace\",\"or via the global `layout.calendar`\"].join(\" \"));e.exports={moduleType:\"component\",name:\"calendars\",schema:{traces:{scatter:w,bar:w,heatmap:w,contour:w,histogram:w,histogram2d:w,histogram2dcontour:w,scatter3d:M,surface:M,mesh3d:M,scattergl:w,ohlc:_,candlestick:_},layout:{calendar:a([\"Sets the default calendar system to use for interpreting and\",\"displaying dates throughout the plot.\"].join(\" \")),\"xaxis.calendar\":k,\"yaxis.calendar\":k,\"scene.xaxis.calendar\":k,\"scene.yaxis.calendar\":k,\"scene.zaxis.calendar\":k},transforms:{filter:{valuecalendar:a([\"Sets the calendar system to use for `value`, if it is a date.\"].join(\" \")),targetcalendar:a([\"Sets the calendar system to use for `target`, if it is an\",\"array of dates. If `target` is a string (eg *x*) we use the\",\"corresponding trace attribute (eg `xcalendar`) if it exists,\",\"even if `targetcalendar` is provided.\"].join(\" \"))}}},layoutAttributes:f,handleDefaults:d,handleTraceDefaults:p,CANONICAL_SUNDAY:g,CANONICAL_TICK:m,DFLTRANGE:v,getCal:i,worldCalFmt:n}},{\"../../constants/numerical\":666,\"../../lib\":685,\"./calendars\":575}],577:[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},{}],578:[function(t,e,r){\"use strict\";function n(t){if(a(t)||\"string\"!=typeof t)return t;var e=t.trim();if(\"rgb\"!==e.substr(0,3))return t;var r=e.match(/^rgba?\\s*\\(([^()]*)\\)$/);if(!r)return t;var n=r[1].trim().split(/\\s*[\\s,]\\s*/),i=\"a\"===e.charAt(3)&&4===n.length;if(!i&&3!==n.length)return t;for(var o=0;o<n.length;o++){if(!n[o].length)return t;if(n[o]=Number(n[o]),!(n[o]>=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+\", \"+Math.round(255*n[1])+\", \"+Math.round(255*n[2]);return i?\"rgba(\"+s+\", \"+n[3]+\")\":\"rgb(\"+s+\")\"}var i=t(\"tinycolor2\"),a=t(\"fast-isnumeric\"),o=e.exports={},s=t(\"./attributes\");o.defaults=s.defaults;var l=o.defaultLine=s.defaultLine;o.lightLine=s.lightLine;var u=o.background=s.background;o.tinyRGB=function(t){var e=t.toRgb();return\"rgb(\"+Math.round(e.r)+\", \"+Math.round(e.g)+\", \"+Math.round(e.b)+\")\"},o.rgb=function(t){return o.tinyRGB(i(t))},o.opacity=function(t){return t?i(t).getAlpha():0},o.addOpacity=function(t,e){var r=i(t).toRgb();return\"rgba(\"+Math.round(r.r)+\", \"+Math.round(r.g)+\", \"+Math.round(r.b)+\", \"+e+\")\"},o.combine=function(t,e){var r=i(t).toRgb();if(1===r.a)return i(t).toRgbString();var n=i(e||u).toRgb(),a=1===n.a?n:{r:255*(1-n.a)+n.r*n.a,g:255*(1-n.a)+n.g*n.a,b:255*(1-n.a)+n.b*n.a},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 i(o).toRgbString()},o.contrast=function(t,e,r){var n=i(t);return 1!==n.getAlpha()&&(n=i(o.combine(t,u))),(n.isDark()?e?n.lighten(e):u:r?n.darken(r):l).toString()},o.stroke=function(t,e){var r=i(e);t.style({stroke:o.tinyRGB(r),\"stroke-opacity\":r.getAlpha()})},o.fill=function(t,e){var r=i(e);t.style({fill:o.tinyRGB(r),\"fill-opacity\":r.getAlpha()})},o.clean=function(t){if(t&&\"object\"==typeof t){var e,r,i,a,s=Object.keys(t);for(e=0;e<s.length;e++)if(i=s[e],a=t[i],\"color\"===i.substr(i.length-5))if(Array.isArray(a))for(r=0;r<a.length;r++)a[r]=n(a[r]);else t[i]=n(a);else if(\"colorscale\"===i.substr(i.length-10)&&Array.isArray(a))for(r=0;r<a.length;r++)Array.isArray(a[r])&&(a[r][1]=n(a[r][1]));else if(Array.isArray(a)){var l=a[0];if(!Array.isArray(l)&&l&&\"object\"==typeof l)for(r=0;r<a.length;r++)o.clean(a[r])}else a&&\"object\"==typeof a&&o.clean(a)}}},{\"./attributes\":577,\"fast-isnumeric\":116,tinycolor2:514}],579:[function(t,e,r){\"use strict\";var n=t(\"../../plots/cartesian/layout_attributes\"),i=t(\"../../plots/font_attributes\"),a=t(\"../../lib/extend\").extendFlat;e.exports={thicknessmode:{valType:\"enumerated\",values:[\"fraction\",\"pixels\"],dflt:\"pixels\"},thickness:{valType:\"number\",min:0,dflt:30},lenmode:{valType:\"enumerated\",values:[\"fraction\",\"pixels\"],dflt:\"fraction\"},len:{valType:\"number\",min:0,dflt:1},x:{valType:\"number\",dflt:1.02,min:-2,max:3},xanchor:{valType:\"enumerated\",values:[\"left\",\"center\",\"right\"],dflt:\"left\"},xpad:{valType:\"number\",min:0,dflt:10},y:{valType:\"number\",dflt:.5,min:-2,max:3},yanchor:{valType:\"enumerated\",values:[\"top\",\"middle\",\"bottom\"],dflt:\"middle\"},ypad:{valType:\"number\",min:0,dflt:10},outlinecolor:n.linecolor,outlinewidth:n.linewidth,bordercolor:n.linecolor,borderwidth:{valType:\"number\",min:0,dflt:0},bgcolor:{valType:\"color\",dflt:\"rgba(0,0,0,0)\"},tickmode:n.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:a({},n.ticks,{dflt:\"\"}),ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,tickfont:n.tickfont,tickangle:n.tickangle,tickformat:n.tickformat,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,separatethousands:n.separatethousands,exponentformat:n.exponentformat,showexponent:n.showexponent,title:{valType:\"string\",dflt:\"Click to enter colorscale title\"},titlefont:a({},i,{}),titleside:{valType:\"enumerated\",values:[\"right\",\"top\",\"bottom\"],dflt:\"top\"}}},{\"../../lib/extend\":677,\"../../plots/cartesian/layout_attributes\":735,\"../../plots/font_attributes\":748}],580:[function(t,e,r){\"use strict\";var n=t(\"../../lib\"),i=t(\"../../plots/cartesian/tick_value_defaults\"),a=t(\"../../plots/cartesian/tick_mark_defaults\"),o=t(\"../../plots/cartesian/tick_label_defaults\"),s=t(\"./attributes\");e.exports=function(t,e,r){function l(t,e){return n.coerce(c,u,s,t,e)}var u=e.colorbar={},c=t.colorbar||{};l(\"thickness\",\"fraction\"===l(\"thicknessmode\")?30/(r.width-r.margin.l-r.margin.r):30),l(\"len\",\"fraction\"===l(\"lenmode\")?1:r.height-r.margin.t-r.margin.b),l(\"x\"),l(\"xanchor\"),l(\"xpad\"),l(\"y\"),l(\"yanchor\"),l(\"ypad\"),n.noneOrAll(c,u,[\"x\",\"y\"]),l(\"outlinecolor\"),l(\"outlinewidth\"),l(\"bordercolor\"),l(\"borderwidth\"),l(\"bgcolor\"),i(c,u,l,\"linear\"),o(c,u,l,\"linear\",{outerTicks:!1,font:r.font,noHover:!0}),a(c,u,l,\"linear\",{outerTicks:!1,font:r.font,noHover:!0}),l(\"title\"),n.coerceFont(l,\"titlefont\",r.font),l(\"titleside\")}},{\"../../lib\":685,\"../../plots/cartesian/tick_label_defaults\":742,\"../../plots/cartesian/tick_mark_defaults\":743,\"../../plots/cartesian/tick_value_defaults\":744,\"./attributes\":579}],581:[function(t,e,r){\"use strict\";var n=t(\"d3\"),i=t(\"tinycolor2\"),a=t(\"../../plotly\"),o=t(\"../../plots/plots\"),s=t(\"../../registry\"),l=t(\"../../plots/cartesian/axes\"),u=t(\"../dragelement\"),c=t(\"../../lib\"),h=t(\"../../lib/extend\").extendFlat,f=t(\"../../lib/setcursor\"),d=t(\"../drawing\"),p=t(\"../color\"),m=t(\"../titles\"),g=t(\"../../plots/cartesian/axis_defaults\"),v=t(\"../../plots/cartesian/position_defaults\"),y=t(\"../../plots/cartesian/layout_attributes\"),b=t(\"./attributes\");e.exports=function(t,e){function r(){function b(t,e){return c.coerce(K,$,y,t,e)}function w(){if(-1!==[\"top\",\"bottom\"].indexOf(_.titleside)){var e=at.select(\".cbtitle\"),r=e.select(\"text\"),a=[-_.outlinewidth/2,_.outlinewidth/2],o=e.select(\".h\"+$._id+\"title-math-group\").node(),s=15.6;if(r.node()&&(s=1.3*parseInt(r.style(\"font-size\"),10)),o?(st=d.bBox(o).height)>s&&(a[1]-=(st-s)/2):r.node()&&!r.classed(\"js-placeholder\")&&(st=d.bBox(e.node()).height),st){if(st+=5,\"top\"===_.titleside)$.domain[1]-=st/T.h,a[1]*=-1;else{$.domain[0]+=st/T.h;var u=Math.max(1,r.selectAll(\"tspan.line\").size());a[1]+=(1-u)*s}e.attr(\"transform\",\"translate(\"+a+\")\"),$.setScale()}}at.selectAll(\".cbfills,.cblines,.cbaxis\").attr(\"transform\",\"translate(0,\"+Math.round(T.h*(1-$.domain[1]))+\")\");var h=at.select(\".cbfills\").selectAll(\"rect.cbfill\").data(C);h.enter().append(\"rect\").classed(\"cbfill\",!0).style(\"stroke\",\"none\"),h.exit().remove(),h.each(function(t,e){var r=[0===e?E[0]:(C[e]+C[e-1])/2,e===C.length-1?E[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=D(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 f=at.select(\".cblines\").selectAll(\"path.cbline\").data(_.line.color&&_.line.width?L:[]);return f.enter().append(\"path\").classed(\"cbline\",!0),f.exit().remove(),f.each(function(t){n.select(this).attr(\"d\",\"M\"+W+\",\"+(Math.round($.c2p(t))+_.line.width/2%1)+\"h\"+B).call(d.lineGroupStyle,_.line.width,z(t),_.line.dash)}),$._axislayer.selectAll(\"g.\"+$._id+\"tick,path\").remove(),$._pos=W+B+(_.outlinewidth||0)/2-(\"outside\"===_.ticks?1:0),$.side=\"right\",c.syncOrAsync([function(){return l.doTicks(t,$,!0)},function(){if(-1===[\"top\",\"bottom\"].indexOf(_.titleside)){var e=$.titlefont.size,r=$._offset+$._length/2,i=T.l+($.position||0)*T.w+(\"right\"===$.side?10+e*($.showticklabels?1:.5):-10-e*($.showticklabels?.5:0));M(\"h\"+$._id+\"title\",{avoid:{selection:n.select(t).selectAll(\"g.\"+$._id+\"tick\"),side:_.titleside,offsetLeft:T.l,offsetTop:T.t,maxShift:A.width},attributes:{x:i,y:r,\"text-anchor\":\"middle\"},transform:{rotate:\"-90\",offset:0}})}}])}function M(e,r){var n,i=x();n=s.traceIs(i,\"markerColorscale\")?\"marker.colorbar.title\":\"colorbar.title\";var a={propContainer:$,propName:n,traceIndex:i.index,dfltName:\"colorscale\",containerGroup:at.select(\".cbtitle\")},o=\"h\"===e.charAt(0)?e.substr(1):\"h\"+e;at.selectAll(\".\"+o+\",.\"+o+\"-math-group\").remove(),m.draw(t,e,h(a,r||{}))}function k(){var r=B+_.outlinewidth/2+d.bBox($._axislayer.node()).width;if((R=ot.select(\"text\")).node()&&!R.classed(\"js-placeholder\")){var n,i=ot.select(\".h\"+$._id+\"title-math-group\").node();n=i&&-1!==[\"top\",\"bottom\"].indexOf(_.titleside)?d.bBox(i).width:d.bBox(ot.node()).right-W-T.l,r=Math.max(r,n)}var a=2*_.xpad+r+_.borderwidth+_.outlinewidth/2,s=J-Q;at.select(\".cbbg\").attr({x:W-_.xpad-(_.borderwidth+_.outlinewidth)/2,y:Q-G,width:Math.max(a,2),height:Math.max(s+2*G,2)}).call(p.fill,_.bgcolor).call(p.stroke,_.bordercolor).style({\"stroke-width\":_.borderwidth}),at.selectAll(\".cboutline\").attr({x:W,y:Q+_.ypad+(\"top\"===_.titleside?st:0),width:Math.max(B,2),height:Math.max(s-2*_.ypad-st,2)}).call(p.stroke,_.outlinecolor).style({fill:\"None\",\"stroke-width\":_.outlinewidth});var l=({center:.5,right:1}[_.xanchor]||0)*a;at.attr(\"transform\",\"translate(\"+(T.l-l)+\",\"+T.t+\")\"),o.autoMargin(t,e,{x:_.x,y:_.y,l:a*({right:1,center:.5}[_.xanchor]||0),r:a*({left:1,center:.5}[_.xanchor]||0),t:s*({bottom:1,middle:.5}[_.yanchor]||0),b:s*({top:1,middle:.5}[_.yanchor]||0)})}var A=t._fullLayout,T=A._size;{if(\"function\"==typeof _.fillcolor||\"function\"==typeof _.line.color){var S,E=n.extent((\"function\"==typeof _.fillcolor?_.fillcolor:_.line.color).domain()),L=[],C=[],z=\"function\"==typeof _.line.color?_.line.color:function(){return _.line.color},D=\"function\"==typeof _.fillcolor?_.fillcolor:function(){return _.fillcolor},I=_.levels.end+_.levels.size/100,P=_.levels.size,O=1.001*E[0]-.001*E[1],j=1.001*E[1]-.001*E[0];for(S=_.levels.start;(S-I)*P<0;S+=P)S>O&&S<j&&L.push(S);if(\"function\"==typeof _.fillcolor)if(_.filllevels)for(I=_.filllevels.end+_.filllevels.size/100,P=_.filllevels.size,S=_.filllevels.start;(S-I)*P<0;S+=P)S>E[0]&&S<E[1]&&C.push(S);else(C=L.map(function(t){return t-_.levels.size/2})).push(C[C.length-1]+_.levels.size);else _.fillcolor&&\"string\"==typeof _.fillcolor&&(C=[0]);_.levels.size<0&&(L.reverse(),C.reverse());var R,F=A.height-A.margin.t-A.margin.b,N=A.width-A.margin.l-A.margin.r,B=Math.round(_.thickness*(\"fraction\"===_.thicknessmode?N:1)),U=B/T.w,V=Math.round(_.len*(\"fraction\"===_.lenmode?F:1)),H=V/T.h,q=_.xpad/T.w,G=(_.borderwidth+_.outlinewidth)/2,Y=_.ypad/T.h,W=Math.round(_.x*T.w+_.xpad),X=_.x-U*({middle:.5,right:1}[_.xanchor]||0),Z=_.y+H*(({top:-.5,bottom:.5}[_.yanchor]||0)-.5),J=Math.round(T.h*(1-Z)),Q=J-V,K={type:\"linear\",range:E,tickmode:_.tickmode,nticks:_.nticks,tick0:_.tick0,dtick:_.dtick,tickvals:_.tickvals,ticktext:_.ticktext,ticks:_.ticks,ticklen:_.ticklen,tickwidth:_.tickwidth,tickcolor:_.tickcolor,showticklabels:_.showticklabels,tickfont:_.tickfont,tickangle:_.tickangle,tickformat:_.tickformat,exponentformat:_.exponentformat,separatethousands:_.separatethousands,showexponent:_.showexponent,showtickprefix:_.showtickprefix,tickprefix:_.tickprefix,showticksuffix:_.showticksuffix,ticksuffix:_.ticksuffix,title:_.title,titlefont:_.titlefont,anchor:\"free\",position:1},$={type:\"linear\",_id:\"y\"+e},tt={letter:\"y\",font:A.font,noHover:!0,calendar:A.calendar};if(g(K,$,b,tt,A),v(K,$,b,tt),$.position=_.x+q+U,r.axis=$,-1!==[\"top\",\"bottom\"].indexOf(_.titleside)&&($.titleside=_.titleside,$.titlex=_.x+q,$.titley=Z+(\"top\"===_.titleside?H-Y:Y)),_.line.color&&\"auto\"===_.tickmode){$.tickmode=\"linear\",$.tick0=_.levels.start;var et=_.levels.size,rt=c.constrain((J-Q)/50,4,15)+1,nt=(E[1]-E[0])/((_.nticks||rt)*et);if(nt>1){var it=Math.pow(10,Math.floor(Math.log(nt)/Math.LN10));et*=it*c.roundUp(nt/it,[2,5,10]),(Math.abs(_.levels.start)/_.levels.size+1e-6)%1<2e-6&&($.tick0=0)}$.dtick=et}$.domain=[Z+Y,Z+H-Y],$.setScale();var at=A._infolayer.selectAll(\"g.\"+e).data([0]);at.enter().append(\"g\").classed(e,!0).each(function(){var t=n.select(this);t.append(\"rect\").classed(\"cbbg\",!0),t.append(\"g\").classed(\"cbfills\",!0),t.append(\"g\").classed(\"cblines\",!0),t.append(\"g\").classed(\"cbaxis\",!0).classed(\"crisp\",!0),t.append(\"g\").classed(\"cbtitleunshift\",!0).append(\"g\").classed(\"cbtitle\",!0),t.append(\"rect\").classed(\"cboutline\",!0),t.select(\".cbtitle\").datum(0)}),at.attr(\"transform\",\"translate(\"+Math.round(T.l)+\",\"+Math.round(T.t)+\")\");var ot=at.select(\".cbtitleunshift\").attr(\"transform\",\"translate(-\"+Math.round(T.l)+\",-\"+Math.round(T.t)+\")\");$._axislayer=at.select(\".cbaxis\");var st=0;if(-1!==[\"top\",\"bottom\"].indexOf(_.titleside)){var lt,ut=T.l+(_.x+q)*T.w,ct=$.titlefont.size;lt=\"top\"===_.titleside?(1-(Z+H-Y))*T.h+T.t+3+.75*ct:(1-(Z+Y))*T.h+T.t-3-.25*ct,M($._id+\"title\",{attributes:{x:ut,y:lt,\"text-anchor\":\"start\"}})}var ht=c.syncOrAsync([o.previousPromises,w,o.previousPromises,k],t);if(ht&&ht.then&&(t._promises||[]).push(ht),t._context.editable){var ft,dt,pt;u.init({element:at.node(),prepFn:function(){ft=at.attr(\"transform\"),f(at)},moveFn:function(t,e){at.attr(\"transform\",ft+\" translate(\"+t+\",\"+e+\")\"),dt=u.align(X+t/T.w,U,0,1,_.xanchor),pt=u.align(Z-e/T.h,H,0,1,_.yanchor);var r=u.getCursor(dt,pt,_.xanchor,_.yanchor);f(at,r)},doneFn:function(e){f(at),e&&void 0!==dt&&void 0!==pt&&a.restyle(t,{\"colorbar.x\":dt,\"colorbar.y\":pt},x().index)}})}return ht}A._infolayer.selectAll(\"g.\"+e).remove()}}function x(){var r,n,i=e.substr(2);for(r=0;r<t._fullData.length;r++)if((n=t._fullData[r]).uid===i)return n}var _={};return Object.keys(b).forEach(function(t){_[t]=null}),_.fillcolor=null,_.line={color:null,width:null,dash:null},_.levels={start:null,end:null,size:null},_.filllevels=null,Object.keys(_).forEach(function(t){r[t]=function(e){return arguments.length?(_[t]=c.isPlainObject(_[t])?c.extendFlat(_[t],e):e,r):_[t]}}),r.options=function(t){return Object.keys(t).forEach(function(e){\"function\"==typeof r[e]&&r[e](t[e])}),r},r._opts=_,r}},{\"../../lib\":685,\"../../lib/extend\":677,\"../../lib/setcursor\":700,\"../../plotly\":719,\"../../plots/cartesian/axes\":724,\"../../plots/cartesian/axis_defaults\":726,\"../../plots/cartesian/layout_attributes\":735,\"../../plots/cartesian/position_defaults\":738,\"../../plots/plots\":787,\"../../registry\":802,\"../color\":578,\"../dragelement\":599,\"../drawing\":602,\"../titles\":655,\"./attributes\":579,d3:107,tinycolor2:514}],582:[function(t,e,r){\"use strict\";var n=t(\"../../lib\");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{\"../../lib\":685}],583:[function(t,e,r){\"use strict\";e.exports={zauto:{valType:\"boolean\",dflt:!0},zmin:{valType:\"number\",dflt:null},zmax:{valType:\"number\",dflt:null},colorscale:{valType:\"colorscale\"},autocolorscale:{valType:\"boolean\",dflt:!0},reversescale:{valType:\"boolean\",dflt:!1},showscale:{valType:\"boolean\",dflt:!0}}},{}],584:[function(t,e,r){\"use strict\";var n=t(\"../../lib\"),i=t(\"./scales\"),a=t(\"./flip_scale\");e.exports=function(t,e,r,o){var s,l;r?(s=n.nestedProperty(t,r).get(),l=n.nestedProperty(t._input,r).get()):(s=t,l=t._input);var u=o+\"auto\",c=o+\"min\",h=o+\"max\",f=s[u],d=s[c],p=s[h],m=s.colorscale;!1===f&&void 0!==d||(d=n.aggNums(Math.min,null,e)),!1===f&&void 0!==p||(p=n.aggNums(Math.max,null,e)),d===p&&(d-=.5,p+=.5),s[c]=d,s[h]=p,l[c]=d,l[h]=p,l[u]=!1!==f||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\":685,\"./flip_scale\":589,\"./scales\":596}],585:[function(t,e,r){\"use strict\";var n=t(\"./attributes\"),i=t(\"../../lib/extend\").extendDeep;t(\"./scales.js\");e.exports=function(t){return{color:{valType:\"color\",arrayOk:!0},colorscale:i({},n.colorscale,{}),cauto:i({},n.zauto,{}),cmax:i({},n.zmax,{}),cmin:i({},n.zmin,{}),autocolorscale:i({},n.autocolorscale,{}),reversescale:i({},n.reversescale,{})}}},{\"../../lib/extend\":677,\"./attributes\":583,\"./scales.js\":596}],586:[function(t,e,r){\"use strict\";var n=t(\"./scales\");e.exports=n.RdBu},{\"./scales\":596}],587:[function(t,e,r){\"use strict\";var n=t(\"fast-isnumeric\"),i=t(\"../../lib\"),a=t(\"../colorbar/has_colorbar\"),o=t(\"../colorbar/defaults\"),s=t(\"./is_valid_scale\"),l=t(\"./flip_scale\");e.exports=function(t,e,r,u,c){var h=c.prefix,f=c.cLetter,d=h.slice(0,h.length-1),p=h?i.nestedProperty(t,d).get()||{}:t,m=h?i.nestedProperty(e,d).get()||{}:e,g=p[f+\"min\"],v=p[f+\"max\"],y=p.colorscale;u(h+f+\"auto\",!(n(g)&&n(v)&&g<v)),u(h+f+\"min\"),u(h+f+\"max\");var b;void 0!==y&&(b=!s(y)),u(h+\"autocolorscale\",b);var x=u(h+\"colorscale\");if(u(h+\"reversescale\")&&(m.colorscale=l(x)),\"marker.line.\"!==h){var _;h&&(_=a(p)),u(h+\"showscale\",_)&&o(p,m,r)}}},{\"../../lib\":685,\"../colorbar/defaults\":580,\"../colorbar/has_colorbar\":582,\"./flip_scale\":589,\"./is_valid_scale\":593,\"fast-isnumeric\":116}],588:[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}}},{}],589:[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}},{}],590:[function(t,e,r){\"use strict\";var n=t(\"./scales\"),i=t(\"./default_scale\"),a=t(\"./is_valid_scale_array\");e.exports=function(t,e){function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return e||(e=i),t?(\"string\"==typeof t&&(r(),\"string\"==typeof t&&r()),a(t)?t:e):e}},{\"./default_scale\":586,\"./is_valid_scale_array\":594,\"./scales\":596}],591:[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\":685,\"./is_valid_scale\":593,\"fast-isnumeric\":116}],592:[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\":583,\"./calc\":584,\"./default_scale\":586,\"./defaults\":587,\"./extract_scale\":588,\"./flip_scale\":589,\"./get_scale\":590,\"./has_colorscale\":591,\"./is_valid_scale\":593,\"./make_color_scale_func\":595,\"./scales\":596}],593:[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\":594,\"./scales\":596}],594:[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:514}],595:[function(t,e,r){\"use strict\";function n(t){var e={r:t[0],g:t[1],b:t[2],a:t[3]};return a(e).toRgbString()}var i=t(\"d3\"),a=t(\"tinycolor2\"),o=t(\"fast-isnumeric\"),s=t(\"../color\");e.exports=function(t,e){e=e||{};for(var r=t.domain,l=t.range,u=l.length,c=new Array(u),h=0;h<u;h++){var f=a(l[h]).toRgb();c[h]=[f.r,f.g,f.b,f.a]}var d,p=i.scale.linear().domain(r).range(c).clamp(!0),m=e.noNumericCheck,g=e.returnArray;return d=m&&g?p:m?function(t){return n(p(t))}:g?function(t){return o(t)?p(t):a(t).isValid()?t:s.defaultLine}:function(t){return o(t)?n(p(t)):a(t).isValid()?t:s.defaultLine},d.domain=p.domain,d.range=function(){return l},d}},{\"../color\":578,d3:107,\"fast-isnumeric\":116,tinycolor2:514}],596:[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\"]]}},{}],597:[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}},{}],598:[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\":685}],599:[function(t,e,r){\"use strict\";function n(){var t=document.createElement(\"div\");t.className=\"dragcover\";var e=t.style;return e.position=\"fixed\",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background=\"none\",document.body.appendChild(t),t}function i(t){t._dragging=!1,t._replotPending&&a.plot(t)}var a=t(\"../../plotly\"),o=t(\"../../lib\"),s=t(\"../../plots/cartesian/constants\"),l=t(\"../../constants/interactions\"),u=e.exports={};u.align=t(\"./align\"),u.getCursor=t(\"./cursor\");var c=t(\"./unhover\");u.unhover=c.wrapped,u.unhoverRaw=c.raw,u.init=function(t){function e(e){return t.element.onmousemove=m,g._dragged=!1,g._dragging=!0,c=e.clientX,h=e.clientY,p=e.target,f=(new Date).getTime(),f-g._mouseDownTime<y?v+=1:(v=1,g._mouseDownTime=f),t.prepFn&&t.prepFn(e,c,h),d=n(),d.onmousemove=r,d.onmouseup=a,d.onmouseout=a,d.style.cursor=window.getComputedStyle(t.element).cursor,o.pauseEvent(e)}function r(e){var r=e.clientX-c,n=e.clientY-h,i=t.minDrag||s.MINDRAG;return Math.abs(r)<i&&(r=0),Math.abs(n)<i&&(n=0),(r||n)&&(g._dragged=!0,u.unhover(g)),t.moveFn&&t.moveFn(r,n,g._dragged),o.pauseEvent(e)}function a(e){if(m=t.element.onmousemove,t.setCursor&&(t.element.onmousemove=t.setCursor),d.onmousemove=null,d.onmouseup=null,d.onmouseout=null,o.removeElement(d),g._dragging){if(g._dragging=!1,(new Date).getTime()-g._mouseDownTime>y&&(v=Math.max(v-1,1)),t.doneFn&&t.doneFn(g._dragged,v,e),!g._dragged){var r;try{r=new MouseEvent(\"click\",e)}catch(t){(r=document.createEvent(\"MouseEvents\")).initMouseEvent(\"click\",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}p.dispatchEvent(r)}return i(g),g._dragged=!1,o.pauseEvent(e)}g._dragged=!1}var c,h,f,d,p,m,g=o.getPlotDiv(t.element)||{},v=1,y=l.DBLCLICKDELAY;g._mouseDownTime||(g._mouseDownTime=0),m=t.element.onmousemove,t.setCursor&&(t.element.onmousemove=t.setCursor),t.element.onmousedown=e,t.element.style.pointerEvents=\"all\"},u.coverSlip=n},{\"../../constants/interactions\":665,\"../../lib\":685,\"../../plotly\":719,\"../../plots/cartesian/constants\":729,\"./align\":597,\"./cursor\":598,\"./unhover\":600}],600:[function(t,e,r){\"use strict\";var n=t(\"../../lib/events\"),i=e.exports={};i.wrapped=function(t,e,r){\"string\"==typeof t&&(t=document.getElementById(t)),t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),i.raw(t,e,r)},i.raw=function(t,e){var r=t._fullLayout,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\":676}],601:[function(t,e,r){\"use strict\";r.dash={valType:\"string\",values:[\"solid\",\"dot\",\"dash\",\"longdash\",\"dashdot\",\"longdashdot\"],dflt:\"solid\"}},{}],602:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o){if(s.traceIs(r,\"symbols\")){var u=p(r);e.attr(\"d\",function(t){var e;e=\"various\"===t.ms||\"various\"===a.size?3:d.isBubble(r)?u(t.ms):(a.size||6)/2,t.mrc=e;var n=m.symbolNumber(t.mx||a.symbol)||0,i=n%100;return t.om=n%200>=100,m.symbolFuncs[i](e)+(n>=200?y:\"\")}).style(\"opacity\",function(t){return(t.mo+1||a.opacity+1)-1})}var c,h,f;t.so?(f=o.outlierwidth,h=o.outliercolor,c=a.outliercolor):(f=(t.mlw+1||o.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,h=\"mlc\"in t?t.mlcc=i(t.mlc):Array.isArray(o.color)?l.defaultLine:o.color,c=\"mc\"in t?t.mcc=n(t.mc):Array.isArray(a.color)?l.defaultLine:a.color||\"rgba(0,0,0,0)\"),t.om?e.call(l.stroke,c).style({\"stroke-width\":(f||1)+\"px\",fill:\"none\"}):(e.style(\"stroke-width\",f+\"px\").call(l.fill,c),f&&e.call(l.stroke,h))}function i(t,e,r,n){var i=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],u=Math.pow(i*i+o*o,x/2),c=Math.pow(s*s+l*l,x/2),h=(c*c*i-u*u*s)*n,f=(c*c*o-u*u*l)*n,d=3*c*(u+c),p=3*u*(u+c);return[[a.round(e[0]+(d&&h/d),2),a.round(e[1]+(d&&f/d),2)],[a.round(e[0]-(p&&h/p),2),a.round(e[1]-(p&&f/p),2)]]}var a=t(\"d3\"),o=t(\"fast-isnumeric\"),s=t(\"../../registry\"),l=t(\"../color\"),u=t(\"../colorscale\"),c=t(\"../../lib\"),h=t(\"../../lib/svg_text_utils\"),f=t(\"../../constants/xmlns_namespaces\"),d=t(\"../../traces/scatter/subtypes\"),p=t(\"../../traces/scatter/make_bubble_size_func\"),m=e.exports={};m.font=function(t,e,r,n){e&&e.family&&(n=e.color,r=e.size,e=e.family),e&&t.style(\"font-family\",e),r+1&&t.style(\"font-size\",r+\"px\"),n&&t.call(l.fill,n)},m.setPosition=function(t,e,r){t.attr(\"x\",e).attr(\"y\",r)},m.setSize=function(t,e,r){t.attr(\"width\",e).attr(\"height\",r)},m.setRect=function(t,e,r,n,i){t.call(m.setPosition,e,r).call(m.setSize,n,i)},m.translatePoint=function(t,e,r,n){var i=t.xp||r.c2p(t.x),a=t.yp||n.c2p(t.y);o(i)&&o(a)&&e.node()?\"text\"===e.node().nodeName?e.attr(\"x\",i).attr(\"y\",a):e.attr(\"transform\",\"translate(\"+i+\",\"+a+\")\"):e.remove()},m.translatePoints=function(t,e,r,n){t.each(function(t){var i=a.select(this);m.translatePoint(t,i,e,r,n)})},m.getPx=function(t,e){return Number(t.style(e).replace(/px$/,\"\"))},m.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},m.singleLineStyle=function(t,e,r,n,i){e.style(\"fill\",\"none\");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,s=i||a.dash||\"\";l.stroke(e,n||a.color),m.dashLine(e,s,o)},m.lineGroupStyle=function(t,e,r,n){t.style(\"fill\",\"none\").each(function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},o=e||i.width||0,s=n||i.dash||\"\";a.select(this).call(l.stroke,r||i.color).call(m.dashLine,s,o)})},m.dashLine=function(t,e,r){r=+r||0,e=m.dashStyle(e,r),t.style({\"stroke-dasharray\":e,\"stroke-width\":r+\"px\"})},m.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return\"solid\"===t?t=\"\":\"dot\"===t?t=r+\"px,\"+r+\"px\":\"dash\"===t?t=3*r+\"px,\"+3*r+\"px\":\"longdash\"===t?t=5*r+\"px,\"+5*r+\"px\":\"dashdot\"===t?t=3*r+\"px,\"+r+\"px,\"+r+\"px,\"+r+\"px\":\"longdashdot\"===t&&(t=5*r+\"px,\"+2*r+\"px,\"+r+\"px,\"+2*r+\"px\"),t},m.fillGroupStyle=function(t){t.style(\"stroke-width\",0).each(function(e){var r=a.select(this);try{r.call(l.fill,e[0].trace.fillcolor)}catch(e){c.error(e,t),r.remove()}})};var g=t(\"./symbol_defs\");m.symbolNames=[],m.symbolFuncs=[],m.symbolNeedLines={},m.symbolNoDot={},m.symbolList=[],Object.keys(g).forEach(function(t){var e=g[t];m.symbolList=m.symbolList.concat([e.n,t,e.n+100,t+\"-open\"]),m.symbolNames[e.n]=t,m.symbolFuncs[e.n]=e.f,e.needLine&&(m.symbolNeedLines[e.n]=!0),e.noDot?m.symbolNoDot[e.n]=!0:m.symbolList=m.symbolList.concat([e.n+200,t+\"-dot\",e.n+300,t+\"-open-dot\"])});var v=m.symbolNames.length,y=\"M0,0.5L0.5,0L0,-0.5L-0.5,0Z\";m.symbolNumber=function(t){if(\"string\"==typeof t){var e=0;t.indexOf(\"-open\")>0&&(e=100,t=t.replace(\"-open\",\"\")),t.indexOf(\"-dot\")>0&&(e+=200,t=t.replace(\"-dot\",\"\")),(t=m.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=v||t>=400?0:Math.floor(Math.max(t,0))},m.singlePointStyle=function(t,e,r){var i=r.marker,a=i.line;n(t,e,r,m.tryColorscale(i,\"\"),m.tryColorscale(i,\"line\"),i,a)},m.pointStyle=function(t,e){if(t.size()){var r=e.marker,n=m.tryColorscale(r,\"\"),i=m.tryColorscale(r,\"line\");t.each(function(t){m.singlePointStyle(t,a.select(this),e,n,i)})}},m.tryColorscale=function(t,e){var r=e?c.nestedProperty(t,e).get():t,n=r.colorscale,i=r.color;return n&&Array.isArray(i)?u.makeColorScaleFunc(u.extractScale(n,r.cmin,r.cmax)):c.identity};var b={start:1,end:-1,middle:0,bottom:1,top:-1};m.textPointStyle=function(t,e){t.each(function(t){var r=a.select(this),n=t.tx||e.text;if(n&&!Array.isArray(n)){var i=t.tp||e.textposition,s=-1!==i.indexOf(\"top\")?\"top\":-1!==i.indexOf(\"bottom\")?\"bottom\":\"middle\",l=-1!==i.indexOf(\"left\")?\"end\":-1!==i.indexOf(\"right\")?\"start\":\"middle\",u=t.ts||e.textfont.size,c=t.mrc?t.mrc/.8+1:0;u=o(u)&&u>0?u:0,r.call(m.font,t.tf||e.textfont.family,u,t.tc||e.textfont.color).attr(\"text-anchor\",l).text(n).call(h.convertToTspans);var f=a.select(this.parentNode),d=r.selectAll(\"tspan.line\"),p=1.3*((d[0].length||1)-1)+1,g=b[l]*c,v=.75*u+b[s]*c+(b[s]-1)*p*u/2;f.attr(\"transform\",\"translate(\"+g+\",\"+v+\")\"),p>1&&d.attr({x:r.attr(\"x\"),y:r.attr(\"y\")})}else r.remove()})};var x=.5;m.smoothopen=function(t,e){if(t.length<3)return\"M\"+t.join(\"L\");var r,n=\"M\"+t[0],a=[];for(r=1;r<t.length-1;r++)a.push(i(t[r-1],t[r],t[r+1],e));for(n+=\"Q\"+a[0][0]+\" \"+t[1],r=2;r<t.length-1;r++)n+=\"C\"+a[r-2][1]+\" \"+a[r-1][0]+\" \"+t[r];return n+=\"Q\"+a[t.length-3][1]+\" \"+t[t.length-1]},m.smoothclosed=function(t,e){if(t.length<3)return\"M\"+t.join(\"L\")+\"Z\";var r,n=\"M\"+t[0],a=t.length-1,o=[i(t[a],t[0],t[1],e)];for(r=1;r<a;r++)o.push(i(t[r-1],t[r],t[r+1],e));for(o.push(i(t[a-1],t[a],t[0],e)),r=1;r<=a;r++)n+=\"C\"+o[r-1][1]+\" \"+o[r][0]+\" \"+t[r];return n+=\"C\"+o[a][1]+\" \"+o[0][0]+\" \"+t[0]+\"Z\"};var _={hv:function(t,e){return\"H\"+a.round(e[0],2)+\"V\"+a.round(e[1],2)},vh:function(t,e){return\"V\"+a.round(e[1],2)+\"H\"+a.round(e[0],2)},hvh:function(t,e){return\"H\"+a.round((t[0]+e[0])/2,2)+\"V\"+a.round(e[1],2)+\"H\"+a.round(e[0],2)},vhv:function(t,e){return\"V\"+a.round((t[1]+e[1])/2,2)+\"H\"+a.round(e[0],2)+\"V\"+a.round(e[1],2)}},w=function(t,e){return\"L\"+a.round(e[0],2)+\",\"+a.round(e[1],2)};m.steps=function(t){var e=_[t]||w;return function(t){for(var r=\"M\"+a.round(t[0][0],2)+\",\"+a.round(t[0][1],2),n=1;n<t.length;n++)r+=e(t[n-1],t[n]);return r}},m.makeTester=function(t){var e=a.select(\"body\").selectAll(\"#js-plotly-tester\").data([0]);e.enter().append(\"svg\").attr(\"id\",\"js-plotly-tester\").attr(f.svgAttrs).style({position:\"absolute\",left:\"-10000px\",top:\"-10000px\",width:\"9000px\",height:\"9000px\",\"z-index\":\"1\"});var r=e.selectAll(\".js-reference-point\").data([0]);r.enter().append(\"path\").classed(\"js-reference-point\",!0).attr(\"d\",\"M0,0H1V1H0Z\").style({\"stroke-width\":0,fill:\"black\"}),e.node()._cache||(e.node()._cache={}),t._tester=e,t._testref=r};var M=[];m.bBox=function(t){var e=t.attributes[\"data-bb\"];if(e&&e.value)return c.extendFlat({},M[e.value]);var r=a.select(\"#js-plotly-tester\"),n=r.node(),i=t.cloneNode(!0);n.appendChild(i),a.select(i).attr({x:0,y:0,transform:\"\"});var o=i.getBoundingClientRect(),s=r.select(\".js-reference-point\").node().getBoundingClientRect();n.removeChild(i);var l={height:o.height,width:o.width,left:o.left-s.left,top:o.top-s.top,right:o.right-s.left,bottom:o.bottom-s.top};return M.length>=1e4&&(a.selectAll(\"[data-bb]\").attr(\"data-bb\",null),M=[]),t.setAttribute(\"data-bb\",M.length),M.push(l),c.extendFlat({},l)},m.setClipUrl=function(t,e){if(e){var r=\"#\"+e,n=a.select(\"base\");n.size()&&n.attr(\"href\")&&(r=window.location.href.split(\"#\")[0]+r),t.attr(\"clip-path\",\"url(\"+r+\")\")}else t.attr(\"clip-path\",null)},m.getTranslate=function(t){var e=/.*\\btranslate\\((-?\\d*\\.?\\d*)[^-\\d]*(-?\\d*\\.?\\d*)[^\\d].*/,r=(t[t.attr?\"attr\":\"getAttribute\"](\"transform\")||\"\").replace(e,function(t,e,r){return[e,r].join(\" \")}).split(\" \");return{x:+r[0]||0,y:+r[1]||0}},m.setTranslate=function(t,e,r){var n=/(\\btranslate\\(.*?\\);?)/,i=t.attr?\"attr\":\"getAttribute\",a=t.attr?\"attr\":\"setAttribute\",o=t[i](\"transform\")||\"\";return e=e||0,r=r||0,o=o.replace(n,\"\").trim(),o+=\" translate(\"+e+\", \"+r+\")\",o=o.trim(),t[a](\"transform\",o),o},m.getScale=function(t){var e=/.*\\bscale\\((\\d*\\.?\\d*)[^\\d]*(\\d*\\.?\\d*)[^\\d].*/,r=(t[t.attr?\"attr\":\"getAttribute\"](\"transform\")||\"\").replace(e,function(t,e,r){return[e,r].join(\" \")}).split(\" \");return{x:+r[0]||1,y:+r[1]||1}},m.setScale=function(t,e,r){var n=/(\\bscale\\(.*?\\);?)/,i=t.attr?\"attr\":\"getAttribute\",a=t.attr?\"attr\":\"setAttribute\",o=t[i](\"transform\")||\"\";return e=e||1,r=r||1,o=o.replace(n,\"\").trim(),o+=\" scale(\"+e+\", \"+r+\")\",o=o.trim(),t[a](\"transform\",o),o},m.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},m.measureText=function(t,e,r){var n=t.append(\"text\").text(e).call(m.font,r),i=m.bBox(n.node());return n.remove(),i}},{\"../../constants/xmlns_namespaces\":668,\"../../lib\":685,\"../../lib/svg_text_utils\":704,\"../../registry\":802,\"../../traces/scatter/make_bubble_size_func\":991,\"../../traces/scatter/subtypes\":996,\"../color\":578,\"../colorscale\":592,\"./symbol_defs\":603,d3:107,\"fast-isnumeric\":116}],603:[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),u=n.round(.118*e,2),c=n.round(.809*e,2);return\"M\"+r+\",\"+l+\"H\"+i+\"L\"+a+\",\"+u+\"L\"+o+\",\"+c+\"L0,\"+n.round(.382*e,2)+\"L-\"+o+\",\"+c+\"L-\"+a+\",\"+u+\"L-\"+i+\",\"+l+\"H-\"+r+\"L0,\"+s+\"Z\"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return\"M-\"+i+\",0l-\"+r+\",-\"+e+\"h\"+i+\"l\"+r+\",-\"+e+\"l\"+r+\",\"+e+\"h\"+i+\"l-\"+r+\",\"+e+\"l\"+r+\",\"+e+\"h-\"+i+\"l-\"+r+\",\"+e+\"l-\"+r+\",-\"+e+\"h-\"+i+\"Z\"}},\"star-triangle-up\":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o=\"A \"+a+\",\"+a+\" 0 0 1 \";return\"M-\"+e+\",\"+r+o+e+\",\"+r+o+\"0,-\"+i+o+\"-\"+e+\",\"+r+\"Z\"}},\"star-triangle-down\":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o=\"A \"+a+\",\"+a+\" 0 0 1 \";return\"M\"+e+\",-\"+r+o+\"-\"+e+\",-\"+r+o+\"0,\"+i+o+e+\",-\"+r+\"Z\"}},\"star-square\":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i=\"A \"+r+\",\"+r+\" 0 0 1 \";return\"M-\"+e+\",-\"+e+i+\"-\"+e+\",\"+e+i+e+\",\"+e+i+e+\",-\"+e+i+\"-\"+e+\",-\"+e+\"Z\"}},\"star-diamond\":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i=\"A \"+r+\",\"+r+\" 0 0 1 \";return\"M-\"+e+\",0\"+i+\"0,\"+e+i+e+\",0\"+i+\"0,-\"+e+i+\"-\"+e+\",0Z\"}},\"diamond-tall\":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return\"M0,\"+r+\"L\"+e+\",0L0,-\"+r+\"L-\"+e+\",0Z\"}},\"diamond-wide\":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return\"M0,\"+r+\"L\"+e+\",0L0,-\"+r+\"L-\"+e+\",0Z\"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return\"M\"+e+\",\"+e+\"H-\"+e+\"L\"+e+\",-\"+e+\"H-\"+e+\"Z\"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return\"M\"+e+\",\"+e+\"V-\"+e+\"L-\"+e+\",\"+e+\"V-\"+e+\"Z\"},noDot:!0},\"circle-cross\":{n:27,f:function(t){var e=n.round(t,2);return\"M0,\"+e+\"V-\"+e+\"M\"+e+\",0H-\"+e+\"M\"+e+\",0A\"+e+\",\"+e+\" 0 1,1 0,-\"+e+\"A\"+e+\",\"+e+\" 0 0,1 \"+e+\",0Z\"},needLine:!0,noDot:!0},\"circle-x\":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return\"M\"+r+\",\"+r+\"L-\"+r+\",-\"+r+\"M\"+r+\",-\"+r+\"L-\"+r+\",\"+r+\"M\"+e+\",0A\"+e+\",\"+e+\" 0 1,1 0,-\"+e+\"A\"+e+\",\"+e+\" 0 0,1 \"+e+\",0Z\"},needLine:!0,noDot:!0},\"square-cross\":{n:29,f:function(t){var e=n.round(t,2);return\"M0,\"+e+\"V-\"+e+\"M\"+e+\",0H-\"+e+\"M\"+e+\",\"+e+\"H-\"+e+\"V-\"+e+\"H\"+e+\"Z\"},needLine:!0,noDot:!0},\"square-x\":{n:30,f:function(t){var e=n.round(t,2);return\"M\"+e+\",\"+e+\"L-\"+e+\",-\"+e+\"M\"+e+\",-\"+e+\"L-\"+e+\",\"+e+\"M\"+e+\",\"+e+\"H-\"+e+\"V-\"+e+\"H\"+e+\"Z\"},needLine:!0,noDot:!0},\"diamond-cross\":{n:31,f:function(t){var e=n.round(1.3*t,2);return\"M\"+e+\",0L0,\"+e+\"L-\"+e+\",0L0,-\"+e+\"ZM0,-\"+e+\"V\"+e+\"M-\"+e+\",0H\"+e},needLine:!0,noDot:!0},\"diamond-x\":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return\"M\"+e+\",0L0,\"+e+\"L-\"+e+\",0L0,-\"+e+\"ZM-\"+r+\",-\"+r+\"L\"+r+\",\"+r+\"M-\"+r+\",\"+r+\"L\"+r+\",-\"+r},needLine:!0,noDot:!0},\"cross-thin\":{n:33,f:function(t){var e=n.round(1.4*t,2);return\"M0,\"+e+\"V-\"+e+\"M\"+e+\",0H-\"+e},needLine:!0,noDot:!0},\"x-thin\":{n:34,f:function(t){var e=n.round(t,2);return\"M\"+e+\",\"+e+\"L-\"+e+\",-\"+e+\"M\"+e+\",-\"+e+\"L-\"+e+\",\"+e},needLine:!0,noDot:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return\"M0,\"+e+\"V-\"+e+\"M\"+e+\",0H-\"+e+\"M\"+r+\",\"+r+\"L-\"+r+\",-\"+r+\"M\"+r+\",-\"+r+\"L-\"+r+\",\"+r},needLine:!0,noDot:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return\"M\"+e+\",\"+r+\"V-\"+r+\"m-\"+r+\",0V\"+r+\"M\"+r+\",\"+e+\"H-\"+r+\"m0,-\"+r+\"H\"+r},needLine:!0},\"y-up\":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return\"M-\"+e+\",\"+i+\"L0,0M\"+e+\",\"+i+\"L0,0M0,-\"+r+\"L0,0\"},needLine:!0,noDot:!0},\"y-down\":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return\"M-\"+e+\",-\"+i+\"L0,0M\"+e+\",-\"+i+\"L0,0M0,\"+r+\"L0,0\"},needLine:!0,noDot:!0},\"y-left\":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return\"M\"+i+\",\"+e+\"L0,0M\"+i+\",-\"+e+\"L0,0M-\"+r+\",0L0,0\"},needLine:!0,noDot:!0},\"y-right\":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return\"M-\"+i+\",\"+e+\"L0,0M-\"+i+\",-\"+e+\"L0,0M\"+r+\",0L0,0\"},needLine:!0,noDot:!0},\"line-ew\":{n:41,f:function(t){var e=n.round(1.4*t,2);return\"M\"+e+\",0H-\"+e},needLine:!0,noDot:!0},\"line-ns\":{n:42,f:function(t){var e=n.round(1.4*t,2);return\"M0,\"+e+\"V-\"+e},needLine:!0,noDot:!0},\"line-ne\":{n:43,f:function(t){var e=n.round(t,2);return\"M\"+e+\",-\"+e+\"L-\"+e+\",\"+e},needLine:!0,noDot:!0},\"line-nw\":{n:44,f:function(t){var e=n.round(t,2);return\"M\"+e+\",\"+e+\"L-\"+e+\",-\"+e},needLine:!0,noDot:!0}}},{d3:107}],604:[function(t,e,r){\"use strict\";e.exports={visible:{valType:\"boolean\"},type:{valType:\"enumerated\",values:[\"percent\",\"constant\",\"sqrt\",\"data\"]},symmetric:{valType:\"boolean\"},array:{valType:\"data_array\"},arrayminus:{valType:\"data_array\"},value:{valType:\"number\",min:0,dflt:10},valueminus:{valType:\"number\",min:0,dflt:10},traceref:{valType:\"integer\",min:0,dflt:0},tracerefminus:{valType:\"integer\",min:0,dflt:0},copy_ystyle:{valType:\"boolean\"},copy_zstyle:{valType:\"boolean\"},color:{valType:\"color\"},thickness:{valType:\"number\",min:0,dflt:2},width:{valType:\"number\",min:0},_deprecated:{opacity:{valType:\"number\"}}}},{}],605:[function(t,e,r){\"use strict\";function n(t,e,r,n){var a=e[\"error_\"+n]||{},l=[];if(a.visible&&-1!==[\"linear\",\"log\"].indexOf(r.type)){for(var u=s(a),c=0;c<t.length;c++){var h=t[c],f=h[n];if(i(r.c2l(f))){var d=u(f,c);if(i(d[0])&&i(d[1])){var p=h[n+\"s\"]=f-d[0],m=h[n+\"h\"]=f+d[1];l.push(p,m)}}}o.expand(r,l,{padded:!0})}}var i=t(\"fast-isnumeric\"),a=t(\"../../registry\"),o=t(\"../../plots/cartesian/axes\"),s=t(\"./compute_error\");e.exports=function(t){for(var e=t.calcdata,r=0;r<e.length;r++){var i=e[r],s=i[0].trace;if(a.traceIs(s,\"errorBarsOK\")){var l=o.getFromId(t,s.xaxis),u=o.getFromId(t,s.yaxis);n(i,s,l,\"x\"),n(i,s,u,\"y\")}}}},{\"../../plots/cartesian/axes\":724,\"../../registry\":802,\"./compute_error\":606,\"fast-isnumeric\":116}],606:[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)]}}},{}],607:[function(t,e,r){\"use strict\";var n=t(\"fast-isnumeric\"),i=t(\"../../registry\"),a=t(\"../../lib\"),o=t(\"./attributes\");e.exports=function(t,e,r,s){function l(t,e){return a.coerce(h,c,o,t,e)}var u=\"error_\"+s.axis,c=e[u]={},h=t[u]||{};if(!1!==l(\"visible\",void 0!==h.array||void 0!==h.value||\"sqrt\"===h.type)){var f=l(\"type\",\"array\"in h?\"data\":\"percent\"),d=!0;\"sqrt\"!==f&&(d=l(\"symmetric\",!((\"data\"===f?\"arrayminus\":\"valueminus\")in h))),\"data\"===f?(l(\"array\")||(c.array=[]),l(\"traceref\"),d||(l(\"arrayminus\")||(c.arrayminus=[]),l(\"tracerefminus\"))):\"percent\"!==f&&\"constant\"!==f||(l(\"value\"),d||l(\"valueminus\"));var p=\"copy_\"+s.inherit+\"style\";s.inherit&&(e[\"error_\"+s.inherit]||{}).visible&&l(p,!(h.color||n(h.thickness)||n(h.width))),s.inherit&&c[p]||(l(\"color\",r),l(\"thickness\"),l(\"width\",i.traceIs(e,\"gl3d\")?0:4))}}},{\"../../lib\":685,\"../../registry\":802,\"./attributes\":604,\"fast-isnumeric\":116}],608:[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\":604,\"./calc\":605,\"./defaults\":607,\"./plot\":609,\"./style\":610}],609:[function(t,e,r){\"use strict\";function n(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0))),void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),a(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0))),n}var i=t(\"d3\"),a=t(\"fast-isnumeric\"),o=t(\"../../traces/scatter/subtypes\");e.exports=function(t,e,r){var s,l=e.xaxis,u=e.yaxis,c=r&&r.duration>0;t.each(function(t){var e,h=t[0].trace,f=h.error_x||{},d=h.error_y||{};h.ids&&(e=function(t){return t.id});var p=o.hasMarkers(h)&&h.marker.maxdisplayed>0;if(d.visible||f.visible){var m=i.select(this).selectAll(\"g.errorbar\").data(t,e);m.exit().remove(),m.style(\"opacity\",1);var g=m.enter().append(\"g\").classed(\"errorbar\",!0);c&&g.style(\"opacity\",0).transition().duration(r.duration).style(\"opacity\",1),m.each(function(t){var e=i.select(this),o=n(t,l,u);if(!p||t.vis){var h;if(d.visible&&a(o.x)&&a(o.yh)&&a(o.ys)){var m=d.width;h=\"M\"+(o.x-m)+\",\"+o.yh+\"h\"+2*m+\"m-\"+m+\",0V\"+o.ys,o.noYS||(h+=\"m-\"+m+\",0h\"+2*m);var g=e.select(\"path.yerror\");(s=!g.size())?g=e.append(\"path\").classed(\"yerror\",!0):c&&(g=g.transition().duration(r.duration).ease(r.easing)),g.attr(\"d\",h)}if(f.visible&&a(o.y)&&a(o.xh)&&a(o.xs)){var v=(f.copy_ystyle?d:f).width;h=\"M\"+o.xh+\",\"+(o.y-v)+\"v\"+2*v+\"m0,-\"+v+\"H\"+o.xs,o.noXS||(h+=\"m0,-\"+v+\"v\"+2*v);var y=e.select(\"path.xerror\");(s=!y.size())?y=e.append(\"path\").classed(\"xerror\",!0):c&&(y=y.transition().duration(r.duration).ease(r.easing)),y.attr(\"d\",h)}}})}})}},{\"../../traces/scatter/subtypes\":996,d3:107,\"fast-isnumeric\":116}],610:[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\":578,d3:107}],611:[function(t,e,r){\"use strict\";var n=t(\"../../plots/cartesian/constants\");e.exports={_isLinkedToArray:\"image\",visible:{valType:\"boolean\",dflt:!0},source:{valType:\"string\"},layer:{valType:\"enumerated\",values:[\"below\",\"above\"],dflt:\"above\"},sizex:{valType:\"number\",dflt:0},sizey:{valType:\"number\",dflt:0},sizing:{valType:\"enumerated\",values:[\"fill\",\"contain\",\"stretch\"],dflt:\"contain\"},opacity:{valType:\"number\",min:0,max:1,dflt:1},x:{valType:\"any\",dflt:0},y:{valType:\"any\",dflt:0},xanchor:{valType:\"enumerated\",values:[\"left\",\"center\",\"right\"],dflt:\"left\"},yanchor:{valType:\"enumerated\",values:[\"top\",\"middle\",\"bottom\"],dflt:\"top\"},xref:{valType:\"enumerated\",values:[\"paper\",n.idRegex.x.toString()],dflt:\"paper\"},yref:{valType:\"enumerated\",values:[\"paper\",n.idRegex.y.toString()],dflt:\"paper\"}}},{\"../../plots/cartesian/constants\":729}],612:[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,u,c=t._fullLayout.images,h=e._id.charAt(0),f=0;f<c.length;f++)if(l=c[f],u=\"images[\"+f+\"].\",l[h+\"ref\"]===e._id){var d=l[h],p=l[\"size\"+h],m=null,g=null;if(o){m=i(d,e.range);var v=p/Math.pow(10,m)/2;g=2*Math.log(v+Math.sqrt(1+v*v))/Math.LN10}else g=(m=Math.pow(10,d))*(Math.pow(10,p/2)-Math.pow(10,-p/2));n(m)?n(g)||(g=null):(m=null,g=null),a(u+h,m),a(u+\"size\"+h,g)}}},{\"../../lib/to_log_range\":705,\"fast-isnumeric\":116}],613:[function(t,e,r){\"use strict\";function n(t,e,r){function n(r,n){return i.coerce(t,e,s,r,n)}if(!n(\"visible\",!!n(\"source\")))return e;n(\"layer\"),n(\"xanchor\"),n(\"yanchor\"),n(\"sizex\"),n(\"sizey\"),n(\"sizing\"),n(\"opacity\");for(var o={_fullLayout:r},l=[\"x\",\"y\"],u=0;u<2;u++){var c=l[u],h=a.coerceRef(t,e,o,c,\"paper\");a.coercePosition(e,o,n,h,c,0)}return e}var i=t(\"../../lib\"),a=t(\"../../plots/cartesian/axes\"),o=t(\"../../plots/array_container_defaults\"),s=t(\"./attributes\");e.exports=function(t,e){o(t,e,{name:\"images\",handleItemDefaults:n})}},{\"../../lib\":685,\"../../plots/array_container_defaults\":721,\"../../plots/cartesian/axes\":724,\"./attributes\":611}],614:[function(t,e,r){\"use strict\";var n=t(\"d3\"),i=t(\"../drawing\"),a=t(\"../../plots/cartesian/axes\"),o=t(\"../../constants/xmlns_namespaces\");e.exports=function(t){function e(e){var r=n.select(this);if(!this.img||this.img.src!==e.source){r.attr(\"xmlns\",o.svg);var i=new Promise(function(t){function n(){r.remove(),t()}var i=new Image;this.img=i,i.setAttribute(\"crossOrigin\",\"anonymous\"),i.onerror=n,i.onload=function(){var t=document.createElement(\"canvas\");t.width=this.width,t.height=this.height,t.getContext(\"2d\").drawImage(this,0,0);var e=t.toDataURL(\"image/png\");r.attr(\"xlink:href\",e)},r.on(\"error\",n),r.on(\"load\",t),i.src=e.source}.bind(this));t._promises.push(i)}}function r(e){var r=n.select(this),o=a.getFromId(t,e.xref),s=a.getFromId(t,e.yref),l=u._size,c=o?Math.abs(o.l2p(e.sizex)-o.l2p(0)):e.sizex*l.w,h=s?Math.abs(s.l2p(e.sizey)-s.l2p(0)):e.sizey*l.h,f=c*m.x[e.xanchor].offset,d=h*m.y[e.yanchor].offset,p=m.x[e.xanchor].sizing+m.y[e.yanchor].sizing,g=(o?o.r2p(e.x)+o._offset:e.x*l.w+l.l)+f,v=(s?s.r2p(e.y)+s._offset:l.h-e.y*l.h+l.t)+d;switch(e.sizing){case\"fill\":p+=\" slice\";break;case\"stretch\":p=\"none\"}r.attr({x:g,y:v,width:c,height:h,preserveAspectRatio:p,opacity:e.opacity});var y=(o?o._id:\"\")+(s?s._id:\"\");r.call(i.setClipUrl,y?\"clip\"+u._uid+y:null)}var s,l,u=t._fullLayout,c=[],h={},f=[];for(l=0;l<u.images.length;l++){var d=u.images[l];if(d.visible)if(\"below\"===d.layer&&\"paper\"!==d.xref&&\"paper\"!==d.yref){s=d.xref+d.yref;var p=u._plots[s];if(!p){f.push(d);continue}p.mainplot&&(s=p.mainplot.id),h[s]||(h[s]=[]),h[s].push(d)}else\"above\"===d.layer?c.push(d):f.push(d)}var m={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}}},g=u._imageLowerLayer.selectAll(\"image\").data(f),v=u._imageUpperLayer.selectAll(\"image\").data(c);g.enter().append(\"image\"),v.enter().append(\"image\"),g.exit().remove(),v.exit().remove(),g.each(function(t){e.bind(this)(t),r.bind(this)(t)}),v.each(function(t){e.bind(this)(t),r.bind(this)(t)});var y=Object.keys(u._plots);for(l=0;l<y.length;l++){s=y[l];var b=u._plots[s];if(b.imagelayer){var x=b.imagelayer.selectAll(\"image\").data(h[s]||[]);x.enter().append(\"image\"),x.exit().remove(),x.each(function(t){e.bind(this)(t),r.bind(this)(t)})}}}},{\"../../constants/xmlns_namespaces\":668,\"../../plots/cartesian/axes\":724,\"../drawing\":602,d3:107}],615:[function(t,e,r){\"use strict\";e.exports={moduleType:\"component\",name:\"images\",layoutAttributes:t(\"./attributes\"),supplyLayoutDefaults:t(\"./defaults\"),draw:t(\"./draw\"),convertCoords:t(\"./convert_coords\")}},{\"./attributes\":611,\"./convert_coords\":612,\"./defaults\":613,\"./draw\":614}],616:[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}},{}],617:[function(t,e,r){\"use strict\";var n=t(\"../../plots/font_attributes\"),i=t(\"../color/attributes\"),a=t(\"../../lib/extend\").extendFlat;e.exports={bgcolor:{valType:\"color\"},bordercolor:{valType:\"color\",dflt:i.defaultLine},borderwidth:{valType:\"number\",min:0,dflt:0},font:a({},n,{}),orientation:{valType:\"enumerated\",values:[\"v\",\"h\"],dflt:\"v\"},traceorder:{valType:\"flaglist\",flags:[\"reversed\",\"grouped\"],extras:[\"normal\"]},tracegroupgap:{valType:\"number\",min:0,dflt:10},x:{valType:\"number\",min:-2,max:3,dflt:1.02},xanchor:{valType:\"enumerated\",values:[\"auto\",\"left\",\"center\",\"right\"],dflt:\"left\"},y:{valType:\"number\",min:-2,max:3,dflt:1},yanchor:{valType:\"enumerated\",values:[\"auto\",\"top\",\"middle\",\"bottom\"],dflt:\"auto\"}}},{\"../../lib/extend\":677,\"../../plots/font_attributes\":748,\"../color/attributes\":577}],618:[function(t,e,r){\"use strict\";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:\"#808BA4\",scrollBarMargin:4}},{}],619:[function(t,e,r){\"use strict\";var n=t(\"../../registry\"),i=t(\"../../lib\"),a=t(\"./attributes\"),o=t(\"../../plots/layout_attributes\"),s=t(\"./helpers\");e.exports=function(t,e,r){function l(t,e){return i.coerce(d,p,a,t,e)}for(var u,c,h,f,d=t.legend||{},p=e.legend={},m=0,g=\"normal\",v=0;v<r.length;v++){var y=r[v];s.legendGetsTrace(y)&&(m++,n.traceIs(y,\"pie\")&&m++),(n.traceIs(y,\"bar\")&&\"stack\"===e.barmode||-1!==[\"tonextx\",\"tonexty\"].indexOf(y.fill))&&(g=s.isGrouped({traceorder:g})?\"grouped+reversed\":\"reversed\"),void 0!==y.legendgroup&&\"\"!==y.legendgroup&&(g=s.isReversed({traceorder:g})?\"reversed+grouped\":\"grouped\")}if(!1!==i.coerce(t,e,o,\"showlegend\",m>1)){if(l(\"bgcolor\",e.paper_bgcolor),l(\"bordercolor\"),l(\"borderwidth\"),i.coerceFont(l,\"font\",e.font),l(\"orientation\"),\"h\"===p.orientation){var b=t.xaxis;b&&b.rangeslider&&b.rangeslider.visible?(u=0,h=\"left\",c=1.1,f=\"bottom\"):(u=0,h=\"left\",c=-.1,f=\"top\")}l(\"traceorder\",g),s.isGrouped(e.legend)&&l(\"tracegroupgap\"),l(\"x\",u),l(\"xanchor\",h),l(\"y\",c),l(\"yanchor\",f),i.noneOrAll(d,p,[\"x\",\"y\"])}}},{\"../../lib\":685,\"../../plots/layout_attributes\":778,\"../../registry\":802,\"./attributes\":617,\"./helpers\":622}],620:[function(t,e,r){\"use strict\";function n(t,e){function r(r){y.convertToTspans(r,function(){r.selectAll(\"tspan.line\").attr({x:r.attr(\"x\")}),t.call(o,e)})}var n=t.data()[0][0],i=e._fullLayout,a=n.trace,s=p.traceIs(a,\"pie\"),l=a.index,u=s?n.label:a.name,c=t.selectAll(\"text.legendtext\").data([0]);c.enter().append(\"text\").classed(\"legendtext\",!0),c.attr({x:40,y:0,\"data-unformatted\":u}).style(\"text-anchor\",\"start\").classed(\"user-select-none\",!0).call(g.font,i.legend.font).text(u),e._context.editable&&!s?c.call(y.makeEditable).call(r).on(\"edit\",function(t){this.attr({\"data-unformatted\":t}),this.text(t).call(r),this.text()||(t=\"    \");var i,a=n.trace._fullInput||{};if(-1!==[\"ohlc\",\"candlestick\"].indexOf(a.type)){var o=n.trace.transforms;i=o[o.length-1].direction+\".name\"}else i=\"name\";h.restyle(e,i,t,l)}):c.call(r)}function i(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(v.fill,\"rgba(0,0,0,0)\"),i.on(\"mousedown\",function(){(r=(new Date).getTime())-e._legendMouseDownTime<T?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>T&&(n=Math.max(n-1,1)),1===n?r._clickTimeout=setTimeout(function(){a(t,e,n)},T):2===n&&(r._clickTimeout&&clearTimeout(r._clickTimeout),e._legendMouseDownTime=0,a(t,e,n))}})}function a(t,e,r){if(!e._dragged&&!e._editing){var n,i,a=e._fullLayout.hiddenlabels?e._fullLayout.hiddenlabels.slice():[],o=t.data()[0][0],s=e._fullData,l=o.trace,u=l.legendgroup,c=[];if(1===r&&A&&e.data&&e._context.showTips?(f.notifier(\"Double click on legend to isolate individual trace\",\"long\"),A=!1):A=!1,p.traceIs(l,\"pie\")){var d=o.label,m=a.indexOf(d);1===r?-1===m?a.push(d):a.splice(m,1):2===r&&(a=[],e.calcdata[0].forEach(function(t){d!==t.label&&a.push(t.label)}),e._fullLayout.hiddenlabels&&e._fullLayout.hiddenlabels.length===a.length&&-1===m&&(a=[])),h.relayout(e,\"hiddenlabels\",a)}else{var g,v=[],y=[];for(g=0;g<s.length;g++)v.push(g),y.push(\"legendonly\");if(\"\"===u)c=[l.index],y[l.index]=!0;else for(g=0;g<s.length;g++)(n=s[g]).legendgroup===u&&(c.push(n.index),y[v.indexOf(g)]=!0);if(1===r)i=!0!==l.visible||\"legendonly\",h.restyle(e,\"visible\",i,c);else if(2===r){var b=!0;for(g=0;g<s.length;g++)if(s[g].visible!==y[g]){b=!1;break}b&&(y=!0);var x=[];for(g=0;g<s.length;g++)x.push(v[g]);h.restyle(e,\"visible\",y,x)}}}}function o(t,e){var r,n,i=t.data()[0][0],a=t.select(\"g[class*=math-group]\"),o=1.3*e._fullLayout.legend.font.size;if(i.trace.showlegend){if(a.node()){var s=g.bBox(a.node());r=s.height,n=s.width,g.setTranslate(a,0,r/4)}else{var l=t.selectAll(\".legendtext\"),u=t.selectAll(\".legendtext>tspan\"),c=u[0].length||1;r=o*c,n=l.node()&&g.bBox(l.node()).width;var h=o*(.3+(1-c)/2);l.attr(\"y\",h),u.attr(\"y\",h)}r=Math.max(r,16)+3,i.height=r,i.width=n}else t.remove()}function s(t,e,r){var n=t._fullLayout,i=n.legend,a=i.borderwidth,o=M.isGrouped(i);if(M.isVertical(i))o&&e.each(function(t,e){g.setTranslate(this,0,e*i.tracegroupgap)}),i.width=0,i.height=0,r.each(function(t){var e=t[0],r=e.height,n=e.width;g.setTranslate(this,a,5+a+i.height+r/2),i.height+=r,i.width=Math.max(i.width,n)}),i.width+=45+2*a,i.height+=10+2*a,o&&(i.height+=(i._lgroupsLength-1)*i.tracegroupgap),i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.each(function(e){var r=e[0];c.select(this).select(\".legendtoggle\").call(g.setRect,0,-r.height/2,(t._context.editable?0:i.width)+40,r.height)});else if(o){i.width=0,i.height=0;for(var s=[i.width],l=e.data(),u=0,h=l.length;u<h;u++){var f=l[u].map(function(t){return t[0].width}),d=40+Math.max.apply(null,f);i.width+=i.tracegroupgap+d,s.push(i.width)}e.each(function(t,e){g.setTranslate(this,s[e],0)}),e.each(function(){var t=0;c.select(this).selectAll(\"g.traces\").each(function(e){var r=e[0].height;g.setTranslate(this,0,5+a+t+r/2),t+=r}),i.height=Math.max(i.height,t)}),i.height+=10+2*a,i.width+=2*a,i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.each(function(e){var r=e[0];c.select(this).select(\".legendtoggle\").call(g.setRect,0,-r.height/2,t._context.editable?0:i.width,r.height)})}else{i.width=0,i.height=0;var p=0,m=0,v=0,y=0;r.each(function(t){v=Math.max(40+t[0].width,v)}),r.each(function(t){var e=t[0],r=v,o=i.tracegroupgap||5;a+y+o+r>n.width-(n.margin.r+n.margin.l)&&(y=0,p+=m,i.height=i.height+m,m=0),g.setTranslate(this,a+y,5+a+e.height/2+p),i.width+=o+r,i.height=Math.max(i.height,e.height),y+=o+r,m=Math.max(e.height,m)}),i.width+=2*a,i.height+=10+2*a,i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.each(function(e){var r=e[0];c.select(this).select(\".legendtoggle\").call(g.setRect,0,-r.height/2,t._context.editable?0:i.width,r.height)})}}function l(t){var e=t._fullLayout.legend,r=\"left\";k.isRightAnchor(e)?r=\"right\":k.isCenterAnchor(e)&&(r=\"center\");var n=\"top\";k.isBottomAnchor(e)?n=\"bottom\":k.isMiddleAnchor(e)&&(n=\"middle\"),d.autoMargin(t,\"legend\",{x:e.x,y:e.y,l:e.width*({right:1,center:.5}[r]||0),r:e.width*({left:1,center:.5}[r]||0),b:e.height*({top:1,middle:.5}[n]||0),t:e.height*({bottom:1,middle:.5}[n]||0)})}function u(t){var e=t._fullLayout.legend,r=\"left\";k.isRightAnchor(e)?r=\"right\":k.isCenterAnchor(e)&&(r=\"center\"),d.autoMargin(t,\"legend\",{x:e.x,y:.5,l:e.width*({right:1,center:.5}[r]||0),r:e.width*({left:1,center:.5}[r]||0),b:0,t:0})}var c=t(\"d3\"),h=t(\"../../plotly\"),f=t(\"../../lib\"),d=t(\"../../plots/plots\"),p=t(\"../../registry\"),m=t(\"../dragelement\"),g=t(\"../drawing\"),v=t(\"../color\"),y=t(\"../../lib/svg_text_utils\"),b=t(\"./constants\"),x=t(\"../../constants/interactions\"),_=t(\"./get_legend_data\"),w=t(\"./style\"),M=t(\"./helpers\"),k=t(\"./anchor_utils\"),A=!0,T=x.DBLCLICKDELAY;e.exports=function(t){function e(t,e){L.attr(\"data-scroll\",e).call(g.setTranslate,0,e),C.call(g.setRect,N,t,b.scrollBarWidth,b.scrollBarHeight),S.select(\"rect\").attr({y:y.borderwidth-e})}var r=t._fullLayout,o=\"legend\"+r._uid;if(r._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var y=r.legend,x=r.showlegend&&_(t.calcdata,y),M=r.hiddenlabels||[];if(!r.showlegend||!x.length)return r._infolayer.selectAll(\".legend\").remove(),r._topdefs.select(\"#\"+o).remove(),void d.autoMargin(t,\"legend\");var A=r._infolayer.selectAll(\"g.legend\").data([0]);A.enter().append(\"g\").attr({class:\"legend\",\"pointer-events\":\"all\"});var S=r._topdefs.selectAll(\"#\"+o).data([0]);S.enter().append(\"clipPath\").attr(\"id\",o).append(\"rect\");var E=A.selectAll(\"rect.bg\").data([0]);E.enter().append(\"rect\").attr({class:\"bg\",\"shape-rendering\":\"crispEdges\"}),E.call(v.stroke,y.bordercolor),E.call(v.fill,y.bgcolor),E.style(\"stroke-width\",y.borderwidth+\"px\");var L=A.selectAll(\"g.scrollbox\").data([0]);L.enter().append(\"g\").attr(\"class\",\"scrollbox\");var C=A.selectAll(\"rect.scrollbar\").data([0]);C.enter().append(\"rect\").attr({class:\"scrollbar\",rx:20,ry:2,width:0,height:0}).call(v.fill,\"#808BA4\");var z=L.selectAll(\"g.groups\").data(x);z.enter().append(\"g\").attr(\"class\",\"groups\"),z.exit().remove();var D=z.selectAll(\"g.traces\").data(f.identity);D.enter().append(\"g\").attr(\"class\",\"traces\"),D.exit().remove(),D.call(w).style(\"opacity\",function(t){var e=t[0].trace;return p.traceIs(e,\"pie\")?-1!==M.indexOf(t[0].label)?.5:1:\"legendonly\"===e.visible?.5:1}).each(function(){c.select(this).call(n,t).call(i,t)});var I=0!==A.enter().size();I&&(s(t,z,D),l(t));var P=r.width,O=r.height;s(t,z,D),y.height>O?u(t):l(t);var j=r._size,R=j.l+j.w*y.x,F=j.t+j.h*(1-y.y);k.isRightAnchor(y)?R-=y.width:k.isCenterAnchor(y)&&(R-=y.width/2),k.isBottomAnchor(y)?F-=y.height:k.isMiddleAnchor(y)&&(F-=y.height/2);var N=y.width,B=j.w;N>B?(R=j.l,N=B):(R+N>P&&(R=P-N),R<0&&(R=0),N=Math.min(P-R,y.width));var U=y.height,V=j.h;U>V?(F=j.t,U=V):(F+U>O&&(F=O-U),F<0&&(F=0),U=Math.min(O-F,y.height)),g.setTranslate(A,R,F);var H,q,G=U-b.scrollBarHeight-2*b.scrollBarMargin,Y=y.height-U;if(y.height<=U||t._context.staticPlot)E.attr({width:N-y.borderwidth,height:U-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),g.setTranslate(L,0,0),S.select(\"rect\").attr({width:N-2*y.borderwidth,height:U-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth}),L.call(g.setClipUrl,o);else{H=b.scrollBarMargin,q=L.attr(\"data-scroll\")||0,E.attr({width:N-2*y.borderwidth+b.scrollBarWidth+b.scrollBarMargin,height:U-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),S.select(\"rect\").attr({width:N-2*y.borderwidth+b.scrollBarWidth+b.scrollBarMargin,height:U-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth-q}),L.call(g.setClipUrl,o),I&&e(H,q),A.on(\"wheel\",null),A.on(\"wheel\",function(){q=f.constrain(L.attr(\"data-scroll\")-c.event.deltaY/G*Y,-Y,0),e(H=b.scrollBarMargin-q/Y*G,q),0!==q&&q!==-Y&&c.event.preventDefault()}),C.on(\".drag\",null),L.on(\".drag\",null);var W=c.behavior.drag().on(\"drag\",function(){H=f.constrain(c.event.y-b.scrollBarHeight/2,b.scrollBarMargin,b.scrollBarMargin+G),q=-(H-b.scrollBarMargin)/G*Y,e(H,q)});C.call(W),L.call(W)}if(t._context.editable){var X,Z,J,Q;A.classed(\"cursor-move\",!0),m.init({element:A.node(),prepFn:function(){var t=g.getTranslate(A);J=t.x,Q=t.y},moveFn:function(t,e){var r=J+t,n=Q+e;g.setTranslate(A,r,n),X=m.align(r,0,j.l,j.l+j.w,y.xanchor),Z=m.align(n,0,j.t+j.h,j.t,y.yanchor)},doneFn:function(e,n,i){if(e&&void 0!==X&&void 0!==Z)h.relayout(t,{\"legend.x\":X,\"legend.y\":Z});else{var o=r._infolayer.selectAll(\"g.traces\").filter(function(){var t=this.getBoundingClientRect();return i.clientX>=t.left&&i.clientX<=t.right&&i.clientY>=t.top&&i.clientY<=t.bottom});o.size()>0&&(1===n?A._clickTimeout=setTimeout(function(){a(o,t,n)},T):2===n&&(A._clickTimeout&&clearTimeout(A._clickTimeout),a(o,t,n)))}}})}}}},{\"../../constants/interactions\":665,\"../../lib\":685,\"../../lib/svg_text_utils\":704,\"../../plotly\":719,\"../../plots/plots\":787,\"../../registry\":802,\"../color\":578,\"../dragelement\":599,\"../drawing\":602,\"./anchor_utils\":616,\"./constants\":618,\"./get_legend_data\":621,\"./helpers\":622,\"./style\":624,d3:107}],621:[function(t,e,r){\"use strict\";var n=t(\"../../registry\"),i=t(\"./helpers\");e.exports=function(t,e){function r(t,r){if(\"\"!==t&&i.isGrouped(e))-1===l.indexOf(t)?(l.push(t),u=!0,s[t]=[[r]]):s[t].push([r]);else{var n=\"~~i\"+h;l.push(n),s[n]=[[r]],h++}}var a,o,s={},l=[],u=!1,c={},h=0;for(a=0;a<t.length;a++){var f=t[a],d=f[0],p=d.trace,m=p.legendgroup;if(i.legendGetsTrace(p)&&p.showlegend)if(n.traceIs(p,\"pie\"))for(c[m]||(c[m]={}),o=0;o<f.length;o++){var g=f[o].label;c[m][g]||(r(m,{label:g,color:f[o].color,i:f[o].i,trace:p}),c[m][g]=!0)}else r(m,d)}if(!l.length)return[];var v,y,b=l.length;if(u&&i.isGrouped(e))for(y=new Array(b),a=0;a<b;a++)v=s[l[a]],y[a]=i.isReversed(e)?v.reverse():v;else{for(y=[new Array(b)],a=0;a<b;a++)v=s[l[a]][0],y[0][i.isReversed(e)?b-a-1:a]=v;b=1}return e._lgroupsLength=b,y}},{\"../../registry\":802,\"./helpers\":622}],622:[function(t,e,r){\"use strict\";var n=t(\"../../registry\");r.legendGetsTrace=function(t){return t.visible&&n.traceIs(t,\"showLegend\")},r.isGrouped=function(t){return-1!==(t.traceorder||\"\").indexOf(\"grouped\")},r.isVertical=function(t){return\"h\"!==t.orientation},r.isReversed=function(t){return-1!==(t.traceorder||\"\").indexOf(\"reversed\")}},{\"../../registry\":802}],623:[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\":617,\"./defaults\":619,\"./draw\":620,\"./style\":624}],624:[function(t,e,r){\"use strict\";function n(t){var e=t[0].trace,r=e.visible&&e.fill&&\"none\"!==e.fill,n=d.hasLines(e);e&&e._module&&\"contourcarpet\"===e._module.name&&(n=e.contours.showlines,r=\"fill\"===e.contours.coloring);var i=l.select(this).select(\".legendfill\").selectAll(\"path\").data(r?[t]:[]);i.enter().append(\"path\").classed(\"js-fill\",!0),i.exit().remove(),i.attr(\"d\",\"M5,0h30v6h-30z\").call(h.fillGroupStyle);var a=l.select(this).select(\".legendlines\").selectAll(\"path\").data(n?[t]:[]);a.enter().append(\"path\").classed(\"js-line\",!0).attr(\"d\",\"M5,0h30\"),a.exit().remove(),a.call(h.lineGroupStyle)}function i(t){function e(t,e,r){var n=c.nestedProperty(o,t).get(),i=Array.isArray(n)&&e?e(n):n;if(r){if(i<r[0])return r[0];if(i>r[1])return r[1]}return i}function r(t){return t[0]}var n,i,a=t[0],o=a.trace,s=d.hasMarkers(o),u=d.hasText(o),f=d.hasLines(o);if(s||u||f){var p={},m={};s&&(p.mc=e(\"marker.color\",r),p.mo=e(\"marker.opacity\",c.mean,[.2,1]),p.ms=e(\"marker.size\",c.mean,[2,16]),p.mlc=e(\"marker.line.color\",r),p.mlw=e(\"marker.line.width\",c.mean,[0,5]),m.marker={sizeref:1,sizemin:1,sizemode:\"diameter\"}),f&&(m.line={width:e(\"line.width\",r,[0,10])}),u&&(p.tx=\"Aa\",p.tp=e(\"textposition\",r),p.ts=10,p.tc=e(\"textfont.color\",r),p.tf=e(\"textfont.family\",r)),n=[c.minExtend(a,p)],i=c.minExtend(o,m)}var g=l.select(this).select(\"g.legendpoints\"),v=g.selectAll(\"path.scatterpts\").data(s?n:[]);v.enter().append(\"path\").classed(\"scatterpts\",!0).attr(\"transform\",\"translate(20,0)\"),v.exit().remove(),v.call(h.pointStyle,i),s&&(n[0].mrc=3);var y=g.selectAll(\"g.pointtext\").data(u?n:[]);y.enter().append(\"g\").classed(\"pointtext\",!0).append(\"text\").attr(\"transform\",\"translate(20,0)\"),y.exit().remove(),y.selectAll(\"text\").call(h.textPointStyle,i)}function a(t){var e=t[0].trace,r=e.marker||{},n=r.line||{},i=l.select(this).select(\"g.legendpoints\").selectAll(\"path.legendbar\").data(u.traceIs(e,\"bar\")?[t]:[]);i.enter().append(\"path\").classed(\"legendbar\",!0).attr(\"d\",\"M6,6H-6V-6H6Z\").attr(\"transform\",\"translate(20,0)\"),i.exit().remove(),i.each(function(t){var e=l.select(this),i=t[0],a=(i.mlw+1||n.width+1)-1;e.style(\"stroke-width\",a+\"px\").call(f.fill,i.mc||r.color),a&&e.call(f.stroke,i.mlc||n.color)})}function o(t){var e=t[0].trace,r=l.select(this).select(\"g.legendpoints\").selectAll(\"path.legendbox\").data(u.traceIs(e,\"box\")&&e.visible?[t]:[]);r.enter().append(\"path\").classed(\"legendbox\",!0).attr(\"d\",\"M6,6H-6V-6H6Z\").attr(\"transform\",\"translate(20,0)\"),r.exit().remove(),r.each(function(){var t=e.line.width,r=l.select(this);r.style(\"stroke-width\",t+\"px\").call(f.fill,e.fillcolor),t&&r.call(f.stroke,e.line.color)})}function s(t){var e=t[0].trace,r=l.select(this).select(\"g.legendpoints\").selectAll(\"path.legendpie\").data(u.traceIs(e,\"pie\")&&e.visible?[t]:[]);r.enter().append(\"path\").classed(\"legendpie\",!0).attr(\"d\",\"M6,6H-6V-6H6Z\").attr(\"transform\",\"translate(20,0)\"),r.exit().remove(),r.size()&&r.call(p,t[0],e)}var l=t(\"d3\"),u=t(\"../../registry\"),c=t(\"../../lib\"),h=t(\"../drawing\"),f=t(\"../color\"),d=t(\"../../traces/scatter/subtypes\"),p=t(\"../../traces/pie/style_one\");e.exports=function(t){t.each(function(t){var e=l.select(this).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(a).each(o).each(s).each(n).each(i)}},{\"../../lib\":685,\"../../registry\":802,\"../../traces/pie/style_one\":970,\"../../traces/scatter/subtypes\":996,\"../color\":578,\"../drawing\":602,d3:107}],625:[function(t,e,r){\"use strict\";function n(t,e){var r,n,i=e.currentTarget,a=i.getAttribute(\"data-attr\"),o=i.getAttribute(\"data-val\")||!0,s=t._fullLayout,l={},u=f.list(t,null,!0),h=\"on\";if(\"zoom\"===a){var d,p=\"in\"===o?.5:2,m=(1+p)/2,g=(1-p)/2;for(n=0;n<u.length;n++)if(!(r=u[n]).fixedrange)if(d=r._name,\"auto\"===o)l[d+\".autorange\"]=!0;else if(\"reset\"===o){if(void 0===r._rangeInitial)l[d+\".autorange\"]=!0;else{var v=r._rangeInitial.slice();l[d+\".range[0]\"]=v[0],l[d+\".range[1]\"]=v[1]}void 0!==r._showSpikeInitial&&(l[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]+g*y[1],m*y[1]+g*y[0]];l[d+\".range[0]\"]=r.l2r(b[0]),l[d+\".range[1]\"]=r.l2r(b[1])}s._cartesianSpikesEnabled=h}else{if(\"hovermode\"!==a||\"x\"!==o&&\"y\"!==o){if(\"hovermode\"===a&&\"closest\"===o){for(n=0;n<u.length;n++)r=u[n],\"on\"!==h||r.showspikes||(h=\"off\");s._cartesianSpikesEnabled=h}}else o=s._isHoriz?\"y\":\"x\",i.setAttribute(\"data-val\",o),\"closest\"!==o&&(s._cartesianSpikesEnabled=\"off\");l[a]=o}c.relayout(t,l)}function i(t,e){for(var r=e.currentTarget,n=r.getAttribute(\"data-attr\"),i=r.getAttribute(\"data-val\")||!0,a=t._fullLayout,o=h.getSubplotIds(a,\"gl3d\"),s={},l=n.split(\".\"),u=0;u<o.length;u++)s[o[u]+\".\"+l[1]]=i;c.relayout(t,s)}function a(t,e){for(var r=e.currentTarget.getAttribute(\"data-attr\"),n=t._fullLayout,i=h.getSubplotIds(n,\"gl3d\"),a={},o=0;o<i.length;o++){var s=i[o],l=s+\".camera\",u=n[s]._scene;\"resetDefault\"===r?a[l]=null:\"resetLastSave\"===r&&(a[l]=d.extendDeep({},u.cameraInitial))}c.relayout(t,a)}function o(t,e){var r=e.currentTarget,n=r._previousVal||!1,i=t.layout,a=t._fullLayout,o=h.getSubplotIds(a,\"gl3d\"),s=[\"xaxis\",\"yaxis\",\"zaxis\"],l=[\"showspikes\",\"spikesides\",\"spikethickness\",\"spikecolor\"],u={},f={},p={};if(n)p=d.extendDeep(i,n),r._previousVal=null;else{p={\"allaxes.showspikes\":!1};for(var m=0;m<o.length;m++){var g=o[m],v=a[g],y=u[g]={};y.hovermode=v.hovermode,p[g+\".hovermode\"]=!1;for(var b=0;b<3;b++){var x=s[b];f=y[x]={};for(var _=0;_<l.length;_++){var w=l[_];f[w]=v[x][w]}}}r._previousVal=d.extendDeep({},u)}c.relayout(t,p)}function s(t,e){for(var r=e.currentTarget,n=r.getAttribute(\"data-attr\"),i=r.getAttribute(\"data-val\")||!0,a=t._fullLayout,o=h.getSubplotIds(a,\"geo\"),s=0;s<o.length;s++){var l=a[o[s]]._subplot;if(\"zoom\"===n){var u=l.projection.scale(),c=\"in\"===i?2*u:.5*u;l.projection.scale(c),l.zoom.scale(c),l.render()}else\"reset\"===n&&l.zoomReset()}}function l(t){var e,r=t._fullLayout;e=r._has(\"cartesian\")?r._isHoriz?\"y\":\"x\":\"closest\";var n=!t._fullLayout.hovermode&&e;c.relayout(t,\"hovermode\",n)}function u(t){for(var e=t._fullLayout,r=f.list(t,null,!0),n={},i=0;i<r.length;i++)n[r[i]._name+\".showspikes\"]=\"on\"===e._cartesianSpikesEnabled;return n}var c=t(\"../../plotly\"),h=t(\"../../plots/plots\"),f=t(\"../../plots/cartesian/axes\"),d=t(\"../../lib\"),p=t(\"../../snapshot/download\"),m=t(\"../../../build/ploticon\"),g=e.exports={};g.toImage={name:\"toImage\",title:\"Download plot as a png\",icon:m.camera,click:function(t){var e=\"png\";d.notifier(\"Taking snapshot - this may take a few seconds\",\"long\"),d.isIE()&&(d.notifier(\"IE only supports svg.  Changing format to svg.\",\"long\"),e=\"svg\"),p(t,{format:e}).then(function(t){d.notifier(\"Snapshot succeeded - \"+t,\"long\")}).catch(function(){d.notifier(\"Sorry there was a problem downloading your snapshot!\",\"long\")})}},g.sendDataToCloud={name:\"sendDataToCloud\",title:\"Save and edit plot in cloud\",icon:m.disk,click:function(t){h.sendDataToCloud(t)}},g.zoom2d={name:\"zoom2d\",title:\"Zoom\",attr:\"dragmode\",val:\"zoom\",icon:m.zoombox,click:n},g.pan2d={name:\"pan2d\",title:\"Pan\",attr:\"dragmode\",val:\"pan\",icon:m.pan,click:n},g.select2d={name:\"select2d\",title:\"Box Select\",attr:\"dragmode\",val:\"select\",icon:m.selectbox,click:n},g.lasso2d={name:\"lasso2d\",title:\"Lasso Select\",attr:\"dragmode\",val:\"lasso\",icon:m.lasso,click:n},g.zoomIn2d={name:\"zoomIn2d\",title:\"Zoom in\",attr:\"zoom\",val:\"in\",icon:m.zoom_plus,click:n},g.zoomOut2d={name:\"zoomOut2d\",title:\"Zoom out\",attr:\"zoom\",val:\"out\",icon:m.zoom_minus,click:n},g.autoScale2d={name:\"autoScale2d\",title:\"Autoscale\",attr:\"zoom\",val:\"auto\",icon:m.autoscale,click:n},g.resetScale2d={name:\"resetScale2d\",title:\"Reset axes\",attr:\"zoom\",val:\"reset\",icon:m.home,click:n},g.hoverClosestCartesian={name:\"hoverClosestCartesian\",title:\"Show closest data on hover\",attr:\"hovermode\",val:\"closest\",icon:m.tooltip_basic,gravity:\"ne\",click:n},g.hoverCompareCartesian={name:\"hoverCompareCartesian\",title:\"Compare data on hover\",attr:\"hovermode\",val:function(t){return t._fullLayout._isHoriz?\"y\":\"x\"},icon:m.tooltip_compare,gravity:\"ne\",click:n},g.zoom3d={name:\"zoom3d\",title:\"Zoom\",attr:\"scene.dragmode\",val:\"zoom\",icon:m.zoombox,click:i},g.pan3d={name:\"pan3d\",title:\"Pan\",attr:\"scene.dragmode\",val:\"pan\",icon:m.pan,click:i},g.orbitRotation={name:\"orbitRotation\",title:\"orbital rotation\",attr:\"scene.dragmode\",val:\"orbit\",icon:m[\"3d_rotate\"],click:i},g.tableRotation={name:\"tableRotation\",title:\"turntable rotation\",attr:\"scene.dragmode\",val:\"turntable\",icon:m[\"z-axis\"],click:i},g.resetCameraDefault3d={name:\"resetCameraDefault3d\",title:\"Reset camera to default\",attr:\"resetDefault\",icon:m.home,click:a},g.resetCameraLastSave3d={name:\"resetCameraLastSave3d\",title:\"Reset camera to last save\",attr:\"resetLastSave\",icon:m.movie,click:a},g.hoverClosest3d={name:\"hoverClosest3d\",title:\"Toggle show closest data on hover\",attr:\"hovermode\",val:null,toggle:!0,icon:m.tooltip_basic,gravity:\"ne\",click:o},g.zoomInGeo={name:\"zoomInGeo\",title:\"Zoom in\",attr:\"zoom\",val:\"in\",icon:m.zoom_plus,click:s},g.zoomOutGeo={name:\"zoomOutGeo\",title:\"Zoom out\",attr:\"zoom\",val:\"out\",icon:m.zoom_minus,click:s},g.resetGeo={name:\"resetGeo\",title:\"Reset\",attr:\"reset\",val:null,icon:m.autoscale,click:s},g.hoverClosestGeo={name:\"hoverClosestGeo\",title:\"Toggle show closest data on hover\",attr:\"hovermode\",val:null,toggle:!0,icon:m.tooltip_basic,gravity:\"ne\",click:l},g.hoverClosestGl2d={name:\"hoverClosestGl2d\",title:\"Toggle show closest data on hover\",attr:\"hovermode\",val:null,toggle:!0,icon:m.tooltip_basic,gravity:\"ne\",click:l},g.hoverClosestPie={name:\"hoverClosestPie\",title:\"Toggle show closest data on hover\",attr:\"hovermode\",val:\"closest\",icon:m.tooltip_basic,gravity:\"ne\",click:l},g.toggleHover={name:\"toggleHover\",title:\"Toggle show closest data on hover\",attr:\"hovermode\",val:null,toggle:!0,icon:m.tooltip_basic,gravity:\"ne\",click:function(t,e){l(t),o(t,e)}},g.resetViews={name:\"resetViews\",title:\"Reset views\",icon:m.home,click:function(t,e){var r=e.currentTarget;r.setAttribute(\"data-attr\",\"zoom\"),r.setAttribute(\"data-val\",\"reset\"),n(t,e),r.setAttribute(\"data-attr\",\"resetLastSave\"),a(t,e)}},g.toggleSpikelines={name:\"toggleSpikelines\",title:\"Toggle Spike Lines\",icon:m.spikeline,attr:\"_cartesianSpikesEnabled\",val:\"on\",click:function(t){var e=t._fullLayout;e._cartesianSpikesEnabled=\"closest\"===e.hovermode&&\"on\"===e._cartesianSpikesEnabled?\"off\":\"on\";var r=u(t);r.hovermode=\"closest\",c.relayout(t,r)}}},{\"../../../build/ploticon\":2,\"../../lib\":685,\"../../plotly\":719,\"../../plots/cartesian/axes\":724,\"../../plots/plots\":787,\"../../snapshot/download\":804}],626:[function(t,e,r){\"use strict\";r.manage=t(\"./manage\")},{\"./manage\":627}],627:[function(t,e,r){\"use strict\";function n(t,e,r){function n(t){for(var r=[],n=0;n<t.length;n++){var i=t[n];-1===e.indexOf(i)&&r.push(h[i])}g.push(r)}var s=t._fullLayout,l=t._fullData,u=s._has(\"cartesian\"),c=s._has(\"gl3d\"),f=s._has(\"geo\"),d=s._has(\"pie\"),p=s._has(\"gl2d\"),m=s._has(\"ternary\"),g=[];if(n([\"toImage\",\"sendDataToCloud\"]),(u||p||d||m)+f+c>1)return n([\"resetViews\",\"toggleHover\"]),o(g,r);c&&(n([\"zoom3d\",\"pan3d\",\"orbitRotation\",\"tableRotation\"]),n([\"resetCameraDefault3d\",\"resetCameraLastSave3d\"]),n([\"hoverClosest3d\"])),f&&(n([\"zoomInGeo\",\"zoomOutGeo\",\"resetGeo\"]),n([\"hoverClosestGeo\"]));var v=i(s),y=[];return((u||p)&&!v||m)&&(y=[\"zoom2d\",\"pan2d\"]),(u||m)&&a(l)&&(y.push(\"select2d\"),y.push(\"lasso2d\")),y.length&&n(y),!u&&!p||v||m||n([\"zoomIn2d\",\"zoomOut2d\",\"autoScale2d\",\"resetScale2d\"]),u&&d?n([\"toggleHover\"]):p?n([\"hoverClosestGl2d\"]):u?n([\"toggleSpikelines\",\"hoverClosestCartesian\",\"hoverCompareCartesian\"]):d&&n([\"hoverClosestPie\"]),o(g,r)}function i(t){for(var e=l.list({_fullLayout:t},null,!0),r=!0,n=0;n<e.length;n++)if(!e[n].fixedrange){r=!1;break}return r}function a(t){for(var e=!1,r=0;r<t.length&&!e;r++){var n=t[r];n._module&&n._module.selectPoints&&(\"scatter\"===n.type||\"scatterternary\"===n.type?(u.hasMarkers(n)||u.hasText(n))&&(e=!0):e=!0)}return e}function o(t,e){if(e.length)if(Array.isArray(e[0]))for(var r=0;r<e.length;r++)t.push(e[r]);else t.push(e);return t}function s(t){for(var e=0;e<t.length;e++)for(var r=t[e],n=0;n<r.length;n++){var i=r[n];if(\"string\"==typeof i){if(void 0===h[i])throw new Error([\"*modeBarButtons* configuration options\",\"invalid button name\"].join(\" \"));t[e][n]=h[i]}}return t}var l=t(\"../../plots/cartesian/axes\"),u=t(\"../../traces/scatter/subtypes\"),c=t(\"./modebar\"),h=t(\"./buttons\");e.exports=function(t){var e=t._fullLayout,r=t._context,i=e._modeBar;if(r.displayModeBar){if(!Array.isArray(r.modeBarButtonsToRemove))throw new Error([\"*modeBarButtonsToRemove* configuration options\",\"must be an array.\"].join(\" \"));if(!Array.isArray(r.modeBarButtonsToAdd))throw new Error([\"*modeBarButtonsToAdd* configuration options\",\"must be an array.\"].join(\" \"));var a,o=r.modeBarButtons;a=Array.isArray(o)&&o.length?s(o):n(t,r.modeBarButtonsToRemove,r.modeBarButtonsToAdd),i?i.update(t,a):e._modeBar=c(t,a)}else i&&(i.destroy(),delete e._modeBar)}},{\"../../plots/cartesian/axes\":724,\"../../traces/scatter/subtypes\":996,\"./buttons\":625,\"./modebar\":628}],628:[function(t,e,r){\"use strict\";function n(t){this.container=t.container,this.element=document.createElement(\"div\"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}function i(t,e){var r=t._fullLayout,i=new n({graphInfo:t,container:r._paperdiv.node(),buttons:e});return r._privateplot&&a.select(i.element).append(\"span\").classed(\"badge-private float--left\",!0).text(\"PRIVATE\"),i}var a=t(\"d3\"),o=t(\"../../lib\"),s=t(\"../../../build/ploticon\"),l=n.prototype;l.update=function(t,e){this.graphInfo=t;var r=this.graphInfo._context;\"hover\"===r.displayModeBar?this.element.className=\"modebar modebar--hover\":this.element.className=\"modebar\";var n=!this.hasButtons(e),i=this.hasLogo!==r.displaylogo;(n||i)&&(this.removeAllButtons(),this.updateButtons(e),r.displaylogo&&(this.element.appendChild(this.getLogo()),this.hasLogo=!0)),this.updateActiveButton()},l.updateButtons=function(t){var e=this;this.buttons=t,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(t){var r=e.createGroup();t.forEach(function(t){var n=t.name;if(!n)throw new Error(\"must provide button 'name' in button config\");if(-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)})},l.createGroup=function(){var t=document.createElement(\"div\");return t.className=\"modebar-group\",t},l.createButton=function(t){var e=this,r=document.createElement(\"a\");r.setAttribute(\"rel\",\"tooltip\"),r.className=\"modebar-btn\";var n=t.title;void 0===n&&(n=t.name),(n||0===n)&&r.setAttribute(\"data-title\",n),void 0!==t.attr&&r.setAttribute(\"data-attr\",t.attr);var i=t.val;if(void 0!==i&&(\"function\"==typeof i&&(i=i(this.graphInfo)),r.setAttribute(\"data-val\",i)),\"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&&a.select(r).classed(\"active\",!0),r.appendChild(this.createIcon(t.icon||s.question,t.name)),r.setAttribute(\"data-gravity\",t.gravity||\"n\"),r},l.createIcon=function(t,e){var r=t.ascent-t.descent,n=\"http://www.w3.org/2000/svg\",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},l.updateActiveButton=function(t){var e=this.graphInfo._fullLayout,r=void 0!==t?t.getAttribute(\"data-attr\"):null;this.buttonElements.forEach(function(t){var n=t.getAttribute(\"data-val\")||!0,i=t.getAttribute(\"data-attr\"),s=\"true\"===t.getAttribute(\"data-toggle\"),l=a.select(t);if(s)i===r&&l.classed(\"active\",!l.classed(\"active\"));else{var u=null===i?i:o.nestedProperty(e,i).get();l.classed(\"active\",u===n)}})},l.hasButtons=function(t){var e=this.buttons;if(!e)return!1;if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;n++)if(t[r][n].name!==e[r][n].name)return!1}return!0},l.getLogo=function(){var t=this.createGroup(),e=document.createElement(\"a\");return e.href=\"https://plot.ly/\",e.target=\"_blank\",e.setAttribute(\"data-title\",\"Produced with Plotly\"),e.className=\"modebar-btn plotlyjsicon modebar-btn--logo\",e.appendChild(this.createIcon(s.plotlylogo)),t.appendChild(e),t},l.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},l.destroy=function(){o.removeElement(this.container.querySelector(\".modebar\"))},e.exports=i},{\"../../../build/ploticon\":2,\"../../lib\":685,d3:107}],629:[function(t,e,r){\"use strict\";var n=t(\"../../plots/font_attributes\"),i=t(\"../color/attributes\"),a=t(\"../../lib/extend\").extendFlat,o=t(\"./button_attributes\");o=a(o,{_isLinkedToArray:\"button\"}),e.exports={visible:{valType:\"boolean\"},buttons:o,x:{valType:\"number\",min:-2,max:3},xanchor:{valType:\"enumerated\",values:[\"auto\",\"left\",\"center\",\"right\"],dflt:\"left\"},y:{valType:\"number\",min:-2,max:3},yanchor:{valType:\"enumerated\",values:[\"auto\",\"top\",\"middle\",\"bottom\"],dflt:\"bottom\"},font:a({},n,{}),bgcolor:{valType:\"color\",dflt:i.lightLine},activecolor:{valType:\"color\"},bordercolor:{valType:\"color\",dflt:i.defaultLine},borderwidth:{valType:\"number\",min:0,dflt:0}}},{\"../../lib/extend\":677,\"../../plots/font_attributes\":748,\"../color/attributes\":577,\"./button_attributes\":630}],630:[function(t,e,r){\"use strict\";e.exports={step:{valType:\"enumerated\",values:[\"month\",\"year\",\"day\",\"hour\",\"minute\",\"second\",\"all\"],dflt:\"month\"},stepmode:{valType:\"enumerated\",values:[\"backward\",\"todate\"],dflt:\"backward\"},count:{valType:\"number\",min:0,dflt:1},label:{valType:\"string\"}}},{}],631:[function(t,e,r){\"use strict\";e.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}},{}],632:[function(t,e,r){\"use strict\";function n(t,e,r){function n(t,e){return a.coerce(i,o,l,t,e)}for(var i,o,s=t.buttons||[],u=e.buttons=[],c=0;c<s.length;c++)if(i=s[c],o={},a.isPlainObject(i)){var h=n(\"step\");\"all\"!==h&&(!r||\"gregorian\"===r||\"month\"!==h&&\"year\"!==h?n(\"stepmode\"):o.stepmode=\"backward\",n(\"count\")),n(\"label\"),o._index=c,u.push(o)}return u}function i(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),i=0,a=0;a<n.length;a++){var o=e[n[a]].domain;o&&(i=Math.max(o[1],i))}return[t.domain[0],i+u.yPad]}var a=t(\"../../lib\"),o=t(\"../color\"),s=t(\"./attributes\"),l=t(\"./button_attributes\"),u=t(\"./constants\");e.exports=function(t,e,r,l,c){function h(t,e){return a.coerce(f,d,s,t,e)}var f=t.rangeselector||{},d=e.rangeselector={};if(h(\"visible\",n(f,d,c).length>0)){var p=i(e,r,l);h(\"x\",p[0]),h(\"y\",p[1]),a.noneOrAll(t,e,[\"x\",\"y\"]),h(\"xanchor\"),h(\"yanchor\"),a.coerceFont(h,\"font\",r.font);var m=h(\"bgcolor\");h(\"activecolor\",o.contrast(m,u.lightAmount,u.darkAmount)),h(\"bordercolor\"),h(\"borderwidth\")}}},{\"../../lib\":685,\"../color\":578,\"./attributes\":629,\"./button_attributes\":630,\"./constants\":631}],633:[function(t,e,r){\"use strict\";function n(t){for(var e=v.list(t,\"x\",!0),r=[],n=0;n<e.length;n++){var i=e[n];i.rangeselector&&i.rangeselector.visible&&r.push(i)}return r}function i(t){return t._id}function a(t,e,r){if(\"all\"===e.step)return!0===t.autorange;var n=Object.keys(r);return t.range[0]===r[n[0]]&&t.range[1]===r[n[1]]}function o(t,e,r){var n=t.selectAll(\"rect\").data([0]);n.enter().append(\"rect\").classed(\"selector-rect\",!0),n.attr(\"shape-rendering\",\"crispEdges\"),n.attr({rx:b.rx,ry:b.ry}),n.call(p.stroke,e.bordercolor).call(p.fill,s(e,r)).style(\"stroke-width\",e.borderwidth+\"px\")}function s(t,e){return e.isActive||e.isHovered?t.activecolor:t.bgcolor}function l(t,e,r){function n(t){g.convertToTspans(t)}var i=t.selectAll(\"text\").data([0]);i.enter().append(\"text\").classed(\"selector-text\",!0).classed(\"user-select-none\",!0),i.attr(\"text-anchor\",\"middle\"),i.call(m.font,e.font).text(u(r)).call(n)}function u(t){return t.label?t.label:\"all\"===t.step?\"all\":t.count+t.step.charAt(0)}function c(t,e,r,n){r.width=0,r.height=0;var i=r.borderwidth;e.each(function(){var t=h.select(this).select(\".selector-text\").selectAll(\"tspan\"),e=1.3*r.font.size,n=t[0].length||1,i=Math.max(e*n,16)+3;r.height=Math.max(r.height,i)}),e.each(function(){var t=h.select(this),e=t.select(\".selector-rect\"),n=t.select(\".selector-text\"),a=n.selectAll(\"tspan\"),o=n.node()&&m.bBox(n.node()).width,s=1.3*r.font.size,l=a[0].length||1,u=Math.max(o+10,b.minButtonWidth);t.attr(\"transform\",\"translate(\"+(i+r.width)+\",\"+i+\")\"),e.attr({x:0,y:0,width:u,height:r.height});var c={x:u/2,y:r.height/2-(l-1)*s/2+3};n.attr(c),a.attr(c),r.width+=u+5}),e.selectAll(\"rect\").attr(\"height\",r.height);var a=t._fullLayout._size;r.lx=a.l+a.w*r.x,r.ly=a.t+a.h*(1-r.y);var o=\"left\";y.isRightAnchor(r)&&(r.lx-=r.width,o=\"right\"),y.isCenterAnchor(r)&&(r.lx-=r.width/2,o=\"center\");var s=\"top\";y.isBottomAnchor(r)&&(r.ly-=r.height,s=\"bottom\"),y.isMiddleAnchor(r)&&(r.ly-=r.height/2,s=\"middle\"),r.width=Math.ceil(r.width),r.height=Math.ceil(r.height),r.lx=Math.round(r.lx),r.ly=Math.round(r.ly),d.autoMargin(t,n+\"-range-selector\",{x:r.x,y:r.y,l:r.width*({right:1,center:.5}[o]||0),r:r.width*({left:1,center:.5}[o]||0),b:r.height*({top:1,middle:.5}[s]||0),t:r.height*({bottom:1,middle:.5}[s]||0)})}var h=t(\"d3\"),f=t(\"../../plotly\"),d=t(\"../../plots/plots\"),p=t(\"../color\"),m=t(\"../drawing\"),g=t(\"../../lib/svg_text_utils\"),v=t(\"../../plots/cartesian/axis_ids\"),y=t(\"../legend/anchor_utils\"),b=t(\"./constants\"),x=t(\"./get_update_object\");e.exports=function(t){var e=t._fullLayout._infolayer.selectAll(\".rangeselector\").data(n(t),i);e.enter().append(\"g\").classed(\"rangeselector\",!0),e.exit().remove(),e.style({cursor:\"pointer\",\"pointer-events\":\"all\"}),e.each(function(e){var r=h.select(this),n=e,i=n.rangeselector,s=r.selectAll(\"g.button\").data(i.buttons);s.enter().append(\"g\").classed(\"button\",!0),s.exit().remove(),s.each(function(e){var r=h.select(this),s=x(n,e);e.isActive=a(n,e,s),r.call(o,i,e),r.call(l,i,e),r.on(\"click\",function(){t._dragged||f.relayout(t,s)}),r.on(\"mouseover\",function(){e.isHovered=!0,r.call(o,i,e)}),r.on(\"mouseout\",function(){e.isHovered=!1,r.call(o,i,e)})}),c(t,s,i,n._name),r.attr(\"transform\",\"translate(\"+i.lx+\",\"+i.ly+\")\")})}},{\"../../lib/svg_text_utils\":704,\"../../plotly\":719,\"../../plots/cartesian/axis_ids\":727,\"../../plots/plots\":787,\"../color\":578,\"../drawing\":602,\"../legend/anchor_utils\":616,\"./constants\":631,\"./get_update_object\":634,d3:107}],634:[function(t,e,r){\"use strict\";function n(t,e){var r,n=t.range,a=new Date(t.r2l(n[1])),o=e.step,s=e.count;switch(e.stepmode){case\"backward\":r=t.l2r(+i.time[o].utc.offset(a,-s));break;case\"todate\":var l=i.time[o].utc.offset(a,-s);r=t.l2r(+i.time[o].utc.ceil(l))}return[r,n[1]]}var i=t(\"d3\");e.exports=function(t,e){var r=t._name,i={};if(\"all\"===e.step)i[r+\".autorange\"]=!0;else{var a=n(t,e);i[r+\".range[0]\"]=a[0],i[r+\".range[1]\"]=a[1]}return i}},{d3:107}],635:[function(t,e,r){\"use strict\";e.exports={moduleType:\"component\",name:\"rangeselector\",schema:{layout:{\"xaxis.rangeselector\":t(\"./attributes\")}},layoutAttributes:t(\"./attributes\"),handleDefaults:t(\"./defaults\"),draw:t(\"./draw\")}},{\"./attributes\":629,\"./defaults\":632,\"./draw\":633}],636:[function(t,e,r){\"use strict\";var n=t(\"../color/attributes\");e.exports={bgcolor:{valType:\"color\",dflt:n.background},bordercolor:{valType:\"color\",dflt:n.defaultLine},borderwidth:{valType:\"integer\",dflt:0,min:0},autorange:{valType:\"boolean\",dflt:!0},range:{valType:\"info_array\",items:[{valType:\"any\"},{valType:\"any\"}]},thickness:{valType:\"number\",dflt:.15,min:0,max:1},visible:{valType:\"boolean\",dflt:!0}}},{\"../color/attributes\":577}],637:[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\":724,\"./constants\":638}],638:[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}},{}],639:[function(t,e,r){\"use strict\";var n=t(\"../../lib\"),i=t(\"./attributes\");e.exports=function(t,e,r){function a(t,e){return n.coerce(o,l,i,t,e)}if(t[r].rangeslider){n.isPlainObject(t[r].rangeslider)||(t[r].rangeslider={});var o=t[r].rangeslider,s=e[r],l=s.rangeslider={};if(a(\"visible\")){if(a(\"bgcolor\",e.plot_bgcolor),a(\"bordercolor\"),a(\"borderwidth\"),a(\"thickness\"),a(\"autorange\",!s.isValidRange(o.range)),a(\"range\"),l.range){var u=l.range,c=s.range;u[0]=s.l2r(Math.min(s.r2l(u[0]),s.r2l(c[0]))),u[1]=s.l2r(Math.max(s.r2l(u[1]),s.r2l(c[1])))}s.cleanRange(\"rangeslider.range\"),l._input=o}}}},{\"../../lib\":685,\"./attributes\":636}],640:[function(t,e,r){\"use strict\";function n(t){var e=w.list({_fullLayout:t},\"x\",!0),r=A.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}function i(t,e,r,n){var i=t.select(\"rect.\"+A.slideBoxClassName).node(),o=t.select(\"rect.\"+A.grabAreaMinClassName).node(),s=t.select(\"rect.\"+A.grabAreaMaxClassName).node();t.on(\"mousedown\",function(){function l(l){var u,c,y,b=+l.clientX-f;switch(h){case i:y=\"ew-resize\",u=p+b,c=g+b;break;case o:y=\"col-resize\",u=p+b,c=g;break;case s:y=\"col-resize\",u=p,c=g+b;break;default:y=\"ew-resize\",u=d,c=d+b}if(c<u){var x=c;c=u,u=x}n._pixelMin=u,n._pixelMax=c,k(m.select(v),y),a(t,e,r,n)}function u(){v.removeEventListener(\"mousemove\",l),v.removeEventListener(\"mouseup\",u),y.removeElement(v)}var c=m.event,h=c.target,f=c.clientX,d=f-t.node().getBoundingClientRect().left,p=n.d2p(r._rl[0]),g=n.d2p(r._rl[1]),v=M.coverSlip();v.addEventListener(\"mousemove\",l),v.addEventListener(\"mouseup\",u)})}function a(t,e,r,n){function i(t){return r.l2r(y.constrain(t,n._rl[0],n._rl[1]))}var a=i(n.p2d(n._pixelMin)),o=i(n.p2d(n._pixelMax));window.requestAnimationFrame(function(){g.relayout(e,r._name+\".range\",[a,o])})}function o(t,e,r,n){function i(t){return y.constrain(t,0,n._width)}function a(t){return y.constrain(t,-o,n._width+o)}var o=A.handleWidth/2,s=i(n.d2p(r._rl[0])),l=i(n.d2p(r._rl[1]));t.select(\"rect.\"+A.slideBoxClassName).attr(\"x\",s).attr(\"width\",l-s),t.select(\"rect.\"+A.maskMinClassName).attr(\"width\",s),t.select(\"rect.\"+A.maskMaxClassName).attr(\"x\",l).attr(\"width\",n._width-l);var u=Math.round(a(s-o))-.5,c=Math.round(a(l-o))+.5;t.select(\"g.\"+A.grabberMinClassName).attr(\"transform\",\"translate(\"+u+\",0.5)\"),t.select(\"g.\"+A.grabberMaxClassName).attr(\"transform\",\"translate(\"+c+\",0.5)\")}function s(t,e,r,n){var i=t.selectAll(\"rect.\"+A.bgClassName).data([0]);i.enter().append(\"rect\").classed(A.bgClassName,!0).attr({x:0,y:0,\"shape-rendering\":\"crispEdges\"});var a=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,o=-n._offsetShift,s=b.crispRound(e,n.borderwidth);i.attr({width:n._width+a,height:n._height+a,transform:\"translate(\"+o+\",\"+o+\")\",fill:n.bgcolor,stroke:n.bordercolor,\"stroke-width\":s})}function l(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 u(t,e,r,n){var i=w.getSubplots(e,r),a=e.calcdata,o=t.selectAll(\"g.\"+A.rangePlotClassName).data(i,y.identity);o.enter().append(\"g\").attr(\"class\",function(t){return A.rangePlotClassName+\" \"+t}).call(b.setClipUrl,n._clipId),o.order(),o.exit().remove();var s;o.each(function(t,i){var o=m.select(this),l=0===i,u=w.getFromId(e,t,\"y\"),h=u._name,f={data:[],layout:{xaxis:{type:r.type,domain:[0,1],range:n.range.slice(),calendar:r.calendar},width:n._width,height:n._height,margin:{t:0,b:0,l:0,r:0}}};f.layout[h]={type:u.type,domain:[0,1],range:u.range.slice(),calendar:u.calendar},v.supplyDefaults(f);var d={id:t,plotgroup:o,xaxis:f._fullLayout.xaxis,yaxis:f._fullLayout[h]};l?s=d:(d.mainplot=\"xy\",d.mainplotinfo=s),_.rangePlot(e,d,c(a,t))})}function c(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n],a=i[0].trace;a.xaxis+a.yaxis===e&&r.push(i)}return r}function h(t,e,r,n){var i=t.selectAll(\"rect.\"+A.maskMinClassName).data([0]);i.enter().append(\"rect\").classed(A.maskMinClassName,!0).attr({x:0,y:0}).attr(\"shape-rendering\",\"crispEdges\"),i.attr(\"height\",n._height).call(x.fill,A.maskColor);var a=t.selectAll(\"rect.\"+A.maskMaxClassName).data([0]);a.enter().append(\"rect\").classed(A.maskMaxClassName,!0).attr(\"y\",0).attr(\"shape-rendering\",\"crispEdges\"),a.attr(\"height\",n._height).call(x.fill,A.maskColor)}function f(t,e,r,n){if(!e._context.staticPlot){var i=t.selectAll(\"rect.\"+A.slideBoxClassName).data([0]);i.enter().append(\"rect\").classed(A.slideBoxClassName,!0).attr(\"y\",0).attr(\"cursor\",A.slideBoxCursor).attr(\"shape-rendering\",\"crispEdges\"),i.attr({height:n._height,fill:A.slideBoxFill})}}function d(t,e,r,n){var i=t.selectAll(\"g.\"+A.grabberMinClassName).data([0]);i.enter().append(\"g\").classed(A.grabberMinClassName,!0);var a=t.selectAll(\"g.\"+A.grabberMaxClassName).data([0]);a.enter().append(\"g\").classed(A.grabberMaxClassName,!0);var o={x:0,width:A.handleWidth,rx:A.handleRadius,fill:x.background,stroke:x.defaultLine,\"stroke-width\":A.handleStrokeWidth,\"shape-rendering\":\"crispEdges\"},s={y:Math.round(n._height/4),height:Math.round(n._height/2)},l=i.selectAll(\"rect.\"+A.handleMinClassName).data([0]);l.enter().append(\"rect\").classed(A.handleMinClassName,!0).attr(o),l.attr(s);var u=a.selectAll(\"rect.\"+A.handleMaxClassName).data([0]);if(u.enter().append(\"rect\").classed(A.handleMaxClassName,!0).attr(o),u.attr(s),!e._context.staticPlot){var c={width:A.grabAreaWidth,x:0,y:0,fill:A.grabAreaFill,cursor:A.grabAreaCursor},h=i.selectAll(\"rect.\"+A.grabAreaMinClassName).data([0]);h.enter().append(\"rect\").classed(A.grabAreaMinClassName,!0).attr(c),h.attr(\"height\",n._height);var f=a.selectAll(\"rect.\"+A.grabAreaMaxClassName).data([0]);f.enter().append(\"rect\").classed(A.grabAreaMaxClassName,!0).attr(c),f.attr(\"height\",n._height)}}function p(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var i=r[n];-1!==i.indexOf(A.name)&&v.autoMargin(t,i)}}var m=t(\"d3\"),g=t(\"../../plotly\"),v=t(\"../../plots/plots\"),y=t(\"../../lib\"),b=t(\"../drawing\"),x=t(\"../color\"),_=t(\"../../plots/cartesian\"),w=t(\"../../plots/cartesian/axes\"),M=t(\"../dragelement\"),k=t(\"../../lib/setcursor\"),A=t(\"./constants\");e.exports=function(t){function e(t){return t._name}var r=t._fullLayout,a=n(r),c=r._infolayer.selectAll(\"g.\"+A.containerClassName).data(a,e);c.enter().append(\"g\").classed(A.containerClassName,!0).attr(\"pointer-events\",\"all\"),c.exit().each(function(t){var e=m.select(this),n=t[A.name];e.remove(),r._topdefs.select(\"#\"+n._clipId).remove()}),c.exit().size()&&p(t),0!==a.length&&c.each(function(e){var n=m.select(this),a=e[A.name],c=r[w.id2name(e.anchor)],p=r.margin,g=r._size,y=e.domain,b=c.domain,x=(e._boundingBox||{}).height||0;a._id=A.name+e._id,a._clipId=a._id+\"-\"+r._uid,a._width=g.w*(y[1]-y[0]),a._height=(r.height-p.b-p.t)*a.thickness,a._offsetShift=Math.floor(a.borderwidth/2);var _=Math.round(p.l+g.w*y[0]),M=Math.round(p.t+g.h*(1-b[0])+x+a._offsetShift+A.extraPad);n.attr(\"transform\",\"translate(\"+_+\",\"+M+\")\");var k=e.r2l(a.range[0]),T=e.r2l(a.range[1]),S=T-k;a.p2d=function(t){return t/a._width*S+k},a.d2p=function(t){return(t-k)/S*a._width},a._rl=[k,T],n.call(s,t,e,a).call(l,t,e,a).call(u,t,e,a).call(h,t,e,a).call(f,t,e,a).call(d,t,e,a),i(n,t,e,a),o(n,t,e,a),v.autoMargin(t,a._id,{x:y[0],y:b[0],l:0,r:0,t:0,b:a._height+p.b+x,pad:A.extraPad+2*a._offsetShift})})}},{\"../../lib\":685,\"../../lib/setcursor\":700,\"../../plotly\":719,\"../../plots/cartesian\":734,\"../../plots/cartesian/axes\":724,\"../../plots/plots\":787,\"../color\":578,\"../dragelement\":599,\"../drawing\":602,\"./constants\":638,d3:107}],641:[function(t,e,r){\"use strict\";e.exports={moduleType:\"component\",name:\"rangeslider\",schema:{layout:{\"xaxis.rangeslider\":t(\"./attributes\")}},layoutAttributes:t(\"./attributes\"),handleDefaults:t(\"./defaults\"),calcAutorange:t(\"./calc_autorange\"),draw:t(\"./draw\")}},{\"./attributes\":636,\"./calc_autorange\":637,\"./defaults\":639,\"./draw\":640}],642:[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},type:{valType:\"enumerated\",values:[\"circle\",\"rect\",\"path\",\"line\"]},layer:{valType:\"enumerated\",values:[\"below\",\"above\"],dflt:\"above\"},xref:o({},n.xref,{}),x0:{valType:\"any\"},x1:{valType:\"any\"},yref:o({},n.yref,{}),y0:{valType:\"any\"},y1:{valType:\"any\"},path:{valType:\"string\"},opacity:{valType:\"number\",min:0,max:1,dflt:1},line:{color:i.color,width:i.width,dash:a},fillcolor:{valType:\"color\",dflt:\"rgba(0,0,0,0)\"}}},{\"../../lib/extend\":677,\"../../traces/scatter/attributes\":976,\"../annotations/attributes\":567,\"../drawing/attributes\":601}],643:[function(t,e,r){\"use strict\";function n(t,e,r,n,i){var a=\"category\"===t.type?Number:t.d2c;if(void 0!==e)return[a(e),a(r)];if(n){var l,u,c,h,f=1/0,d=-1/0,p=n.match(o.segmentRE);for(\"date\"===t.type&&(a=s.decodeDate(a)),l=0;l<p.length;l++)void 0!==(u=i[p[l].charAt(0)].drawn)&&(!(c=p[l].substr(1).match(o.paramRE))||c.length<u||((h=a(c[u]))<f&&(f=h),h>d&&(d=h)));return d>=f?[f,d]:void 0}}var i=t(\"../../lib\"),a=t(\"../../plots/cartesian/axes\"),o=t(\"./constants\"),s=t(\"./helpers\");e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var s=0;s<r.length;s++){var l,u,c=r[s],h=c.line.width/2;\"paper\"!==c.xref&&(u=n(l=a.getFromId(t,c.xref),c.x0,c.x1,c.path,o.paramIsX))&&a.expand(l,u,{ppad:h}),\"paper\"!==c.yref&&(u=n(l=a.getFromId(t,c.yref),c.y0,c.y1,c.path,o.paramIsY))&&a.expand(l,u,{ppad:h})}}},{\"../../lib\":685,\"../../plots/cartesian/axes\":724,\"./constants\":644,\"./helpers\":647}],644:[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}}},{}],645:[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\":721,\"./shape_defaults\":649}],646:[function(t,e,r){\"use strict\";function n(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&&i(t,r)}function i(t,e){function r(r){var n={\"data-index\":e,\"fill-rule\":\"evenodd\",d:o(t,i)},s=i.line.width?i.line.color:\"rgba(0,0,0,0)\",l=r.append(\"path\").attr(n).style(\"opacity\",i.opacity).call(f.stroke,s).call(f.fill,i.fillcolor).call(d.dashLine,i.line.dash,i.line.width),u=(i.xref+i.yref).replace(/paper/g,\"\");l.call(d.setClipUrl,u?\"clip\"+t._fullLayout._uid+u:null),t._context.editable&&a(t,l,i,e)}t._fullLayout._paper.selectAll('.shapelayer [data-index=\"'+e+'\"]').remove();var n=(t.layout.shapes||[])[e],i=t._fullLayout.shapes[e];if(n&&!1!==i.visible)if(\"below\"!==i.layer)r(t._fullLayout._shapeUpperLayer);else if(\"paper\"===i.xref||\"paper\"===i.yref)r(t._fullLayout._shapeLowerLayer);else{var s=t._fullLayout._plots[i.xref+i.yref];r(s?(s.mainplot||s).shapelayer:t._fullLayout._shapeLowerLayer)}}function a(t,e,r,n){function i(t){var r=Z.right-Z.left,n=Z.bottom-Z.top,i=t.clientX-Z.left,a=t.clientY-Z.top,o=r>Y&&n>W&&!t.shiftKey?p.getCursor(i/r,1-a/n):\"move\";m(e,o),G=o.split(\"-\")[0]}function a(e){N=h.getFromId(t,r.xref),B=h.getFromId(t,r.yref),U=v.getDataToPixel(t,N),V=v.getDataToPixel(t,B,!0),H=v.getPixelToData(t,N),q=v.getPixelToData(t,B,!0);var a=\"shapes[\"+n+\"]\";\"path\"===r.type?(R=r.path,F=a+\".path\"):(g=U(r.x0),y=V(r.y0),b=U(r.x1),x=V(r.y1),_=a+\".x0\",w=a+\".y0\",M=a+\".x1\",k=a+\".y1\"),g<b?(S=g,z=a+\".x0\",O=\"x0\",E=b,D=a+\".x1\",j=\"x1\"):(S=b,z=a+\".x1\",O=\"x1\",E=g,D=a+\".x0\",j=\"x0\"),y<x?(A=y,L=a+\".y0\",I=\"y0\",T=x,C=a+\".y1\",P=\"y1\"):(A=x,L=a+\".y1\",I=\"y1\",T=y,C=a+\".y0\",P=\"y0\"),d={},i(e),X.moveFn=\"move\"===G?c:f}function s(r){m(e),r&&u.relayout(t,d)}function c(n,i){if(\"path\"===r.type){var a=function(t){return H(U(t)+n)};N&&\"date\"===N.type&&(a=v.encodeDate(a));var s=function(t){return q(V(t)+i)};B&&\"date\"===B.type&&(s=v.encodeDate(s)),r.path=l(R,a,s),d[F]=r.path}else d[_]=r.x0=H(g+n),d[w]=r.y0=q(y+i),d[M]=r.x1=H(b+n),d[k]=r.y1=q(x+i);e.attr(\"d\",o(t,r))}function f(n,i){if(\"path\"===r.type){var a=function(t){return H(U(t)+n)};N&&\"date\"===N.type&&(a=v.encodeDate(a));var s=function(t){return q(V(t)+i)};B&&\"date\"===B.type&&(s=v.encodeDate(s)),r.path=l(R,a,s),d[F]=r.path}else{var u=~G.indexOf(\"n\")?A+i:A,c=~G.indexOf(\"s\")?T+i:T,h=~G.indexOf(\"w\")?S+n:S,f=~G.indexOf(\"e\")?E+n:E;c-u>W&&(d[L]=r[I]=q(u),d[C]=r[P]=q(c)),f-h>Y&&(d[z]=r[O]=H(h),d[D]=r[j]=H(f))}e.attr(\"d\",o(t,r))}var d,g,y,b,x,_,w,M,k,A,T,S,E,L,C,z,D,I,P,O,j,R,F,N,B,U,V,H,q,G,Y=10,W=10,X={setCursor:i,element:e.node(),prepFn:a,doneFn:s},Z=X.element.getBoundingClientRect();p.init(X)}function o(t,e){var r,n,i,a,o=e.type,l=h.getFromId(t,e.xref),u=h.getFromId(t,e.yref),c=t._fullLayout._size;if(l?(r=v.shapePositionToRange(l),n=function(t){return l._offset+l.r2p(r(t,!0))}):n=function(t){return c.l+c.w*t},u?(i=v.shapePositionToRange(u),a=function(t){return u._offset+u.r2p(i(t,!0))}):a=function(t){return c.t+c.h*(1-t)},\"path\"===o)return l&&\"date\"===l.type&&(n=v.decodeDate(n)),u&&\"date\"===u.type&&(a=v.decodeDate(a)),s(e.path,n,a);var f=n(e.x0),d=n(e.x1),p=a(e.y0),m=a(e.y1);if(\"line\"===o)return\"M\"+f+\",\"+p+\"L\"+d+\",\"+m;if(\"rect\"===o)return\"M\"+f+\",\"+p+\"H\"+d+\"V\"+m+\"H\"+f+\"Z\";var g=(f+d)/2,y=(p+m)/2,b=Math.abs(g-f),x=Math.abs(y-p),_=\"A\"+b+\",\"+x,w=g+b+\",\"+y;return\"M\"+w+_+\" 0 1,1 \"+(g+\",\"+(y-x))+_+\" 0 0,1 \"+w+\"Z\"}function s(t,e,r){return t.replace(g.segmentRE,function(t){var n=0,i=t.charAt(0),a=g.paramIsX[i],o=g.paramIsY[i],s=g.numParams[i],l=t.substr(1).replace(g.paramRE,function(t){return a[n]?t=e(t):o[n]&&(t=r(t)),++n>s&&(t=\"X\"),t});return n>s&&(l=l.replace(/[\\s,]*X.*/,\"\"),c.log(\"Ignoring extra params in segment \"+t)),i+l})}function l(t,e,r){return t.replace(g.segmentRE,function(t){var n=0,i=t.charAt(0),a=g.paramIsX[i],o=g.paramIsY[i],s=g.numParams[i];return i+t.substr(1).replace(g.paramRE,function(t){return n>=s?t:(a[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}var u=t(\"../../plotly\"),c=t(\"../../lib\"),h=t(\"../../plots/cartesian/axes\"),f=t(\"../color\"),d=t(\"../drawing\"),p=t(\"../dragelement\"),m=t(\"../../lib/setcursor\"),g=t(\"./constants\"),v=t(\"./helpers\");e.exports={draw:n,drawOne:i}},{\"../../lib\":685,\"../../lib/setcursor\":700,\"../../plotly\":719,\"../../plots/cartesian/axes\":724,\"../color\":578,\"../dragelement\":599,\"../drawing\":602,\"./constants\":644,\"./helpers\":647}],647:[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}},{}],648:[function(t,e,r){\"use strict\";var n=t(\"./draw\");e.exports={moduleType:\"component\",name:\"shapes\",layoutAttributes:t(\"./attributes\"),supplyLayoutDefaults:t(\"./defaults\"),calcAutorange:t(\"./calc_autorange\"),draw:n.draw,drawOne:n.drawOne}},{\"./attributes\":642,\"./calc_autorange\":643,\"./defaults\":645,\"./draw\":646}],649:[function(t,e,r){\"use strict\";var n=t(\"../../lib\"),i=t(\"../../plots/cartesian/axes\"),a=t(\"./attributes\"),o=t(\"./helpers\");e.exports=function(t,e,r,s,l){function u(r,i){return n.coerce(t,e,a,r,i)}if(s=s||{},!u(\"visible\",!(l=l||{}).itemIsNotPlainObject))return e;u(\"layer\"),u(\"opacity\"),u(\"fillcolor\"),u(\"line.color\"),u(\"line.width\"),u(\"line.dash\");for(var c=u(\"type\",t.path?\"path\":\"rect\"),h=[\"x\",\"y\"],f=0;f<2;f++){var d=h[f],p={_fullLayout:r},m=i.coerceRef(t,e,p,d,\"\",\"paper\");if(\"path\"!==c){var g,v,y;\"paper\"!==m?(g=i.getFromId(p,m),y=o.rangeToShapePosition(g),v=o.shapePositionToRange(g)):v=y=n.identity;var b=d+\"0\",x=d+\"1\",_=t[b],w=t[x];t[b]=v(t[b],!0),t[x]=v(t[x],!0),i.coercePosition(e,p,u,m,b,.25),i.coercePosition(e,p,u,m,x,.75),e[b]=y(e[b]),e[x]=y(e[x]),t[b]=_,t[x]=w}}return\"path\"===c?u(\"path\"):n.noneOrAll(t,e,[\"x0\",\"x1\",\"y0\",\"y1\"]),e}},{\"../../lib\":685,\"../../plots/cartesian/axes\":724,\"./attributes\":642,\"./helpers\":647}],650:[function(t,e,r){\"use strict\";var n=t(\"../../plots/font_attributes\"),i=t(\"../../plots/pad_attributes\"),a=t(\"../../lib/extend\").extendFlat,o=t(\"../../lib/extend\").extendDeep,s=t(\"../../plots/animation_attributes\"),l=t(\"./constants\"),u={_isLinkedToArray:\"step\",method:{valType:\"enumerated\",values:[\"restyle\",\"relayout\",\"animate\",\"update\"],dflt:\"restyle\"},args:{valType:\"info_array\",freeLength:!0,items:[{valType:\"any\"},{valType:\"any\"},{valType:\"any\"}]},label:{valType:\"string\"},value:{valType:\"string\"}};e.exports={_isLinkedToArray:\"slider\",visible:{valType:\"boolean\",dflt:!0},active:{valType:\"number\",min:0,dflt:0},steps:u,lenmode:{valType:\"enumerated\",values:[\"fraction\",\"pixels\"],dflt:\"fraction\"},len:{valType:\"number\",min:0,dflt:1},x:{valType:\"number\",min:-2,max:3,dflt:0},pad:o({},i,{},{t:{dflt:20}}),xanchor:{valType:\"enumerated\",values:[\"auto\",\"left\",\"center\",\"right\"],dflt:\"left\"},y:{valType:\"number\",min:-2,max:3,dflt:0},yanchor:{valType:\"enumerated\",values:[\"auto\",\"top\",\"middle\",\"bottom\"],dflt:\"top\"},transition:{duration:{valType:\"number\",min:0,dflt:150},easing:{valType:\"enumerated\",values:s.transition.easing.values,dflt:\"cubic-in-out\"}},currentvalue:{visible:{valType:\"boolean\",dflt:!0},xanchor:{valType:\"enumerated\",values:[\"left\",\"center\",\"right\"],dflt:\"left\"},offset:{valType:\"number\",dflt:10},prefix:{valType:\"string\"},suffix:{valType:\"string\"},font:a({},n,{})},font:a({},n,{}),activebgcolor:{valType:\"color\",dflt:l.gripBgActiveColor},bgcolor:{valType:\"color\",dflt:l.railBgColor},bordercolor:{valType:\"color\",dflt:l.railBorderColor},borderwidth:{valType:\"number\",min:0,dflt:l.railBorderWidth},ticklen:{valType:\"number\",min:0,dflt:l.tickLength},tickcolor:{valType:\"color\",dflt:l.tickColor},tickwidth:{valType:\"number\",min:0,dflt:1},minorticklen:{valType:\"number\",min:0,dflt:l.minorTickLength}}},{\"../../lib/extend\":677,\"../../plots/animation_attributes\":720,\"../../plots/font_attributes\":748,\"../../plots/pad_attributes\":786,\"./constants\":651}],651:[function(t,e,r){\"use strict\";e.exports={name:\"sliders\",containerClassName:\"slider-container\",groupClassName:\"slider-group\",inputAreaClass:\"slider-input-area\",railRectClass:\"slider-rail-rect\",railTouchRectClass:\"slider-rail-touch-rect\",gripRectClass:\"slider-grip-rect\",tickRectClass:\"slider-tick-rect\",inputProxyClass:\"slider-input-proxy\",labelsClass:\"slider-labels\",labelGroupClass:\"slider-label-group\",labelClass:\"slider-label\",currentValueClass:\"slider-current-value\",railHeight:5,menuIndexAttrName:\"slider-active-index\",autoMarginIdRoot:\"slider-\",minWidth:30,minHeight:30,textPadX:40,fontSizeToHeight:1.3,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:\"#bec8d9\",railBgColor:\"#f8fafc\",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:\"#bec8d9\",gripBgColor:\"#f6f8fa\",gripBgActiveColor:\"#dbdde0\",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:\"#333\",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:\"#333\",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],652:[function(t,e,r){\"use strict\";function n(t,e,r){function n(r,n){return a.coerce(t,e,s,r,n)}n(\"visible\",i(t,e).length>0)&&(n(\"active\"),n(\"x\"),n(\"y\"),a.noneOrAll(t,e,[\"x\",\"y\"]),n(\"xanchor\"),n(\"yanchor\"),n(\"len\"),n(\"lenmode\"),n(\"pad.t\"),n(\"pad.r\"),n(\"pad.b\"),n(\"pad.l\"),a.coerceFont(n,\"font\",r.font),n(\"currentvalue.visible\")&&(n(\"currentvalue.xanchor\"),n(\"currentvalue.prefix\"),n(\"currentvalue.suffix\"),n(\"currentvalue.offset\"),a.coerceFont(n,\"currentvalue.font\",e.font)),n(\"transition.duration\"),n(\"transition.easing\"),n(\"bgcolor\"),n(\"activebgcolor\"),n(\"bordercolor\"),n(\"borderwidth\"),n(\"ticklen\"),n(\"tickwidth\"),n(\"tickcolor\"),n(\"minorticklen\"))}function i(t,e){function r(t,e){return a.coerce(n,i,u,t,e)}for(var n,i,o=t.steps||[],s=e.steps=[],l=0;l<o.length;l++)n=o[l],i={},a.isPlainObject(n)&&Array.isArray(n.args)&&(r(\"method\"),r(\"args\"),r(\"label\",\"step-\"+l),r(\"value\",i.label),s.push(i));return s}var a=t(\"../../lib\"),o=t(\"../../plots/array_container_defaults\"),s=t(\"./attributes\"),l=t(\"./constants\").name,u=s.steps;e.exports=function(t,e){o(t,e,{name:l,handleItemDefaults:n})}},{\"../../lib\":685,\"../../plots/array_container_defaults\":721,\"./attributes\":650,\"./constants\":651}],653:[function(t,e,r){\"use strict\";function n(t){for(var e=t[E.name],r=[],n=0;n<e.length;n++){var i=e[n];i.visible&&i.steps.length&&r.push(i)}return r}function i(t){return t._index}function a(t,e){var r=t._tester.selectAll(\"g.\"+E.labelGroupClass).data(e.steps);r.enter().append(\"g\").classed(E.labelGroupClass,!0);var n=0,i=0;if(r.each(function(t){var r=u(w.select(this),{step:t},e),a=r.node()&&A.bBox(r.node()).width||0;i=r.node()&&A.bBox(r.node()).height||0,n=Math.max(n,a)}),r.remove(),e.inputAreaWidth=Math.max(E.railWidth,E.gripHeight),e.currentValueMaxWidth=0,e.currentValueHeight=0,e.currentValueTotalHeight=0,e.currentvalue.visible){var a=t._tester.append(\"g\");r.each(function(t){var r=s(a,e,t.label),n=r.node()&&A.bBox(r.node())||{width:0,height:0};e.currentValueMaxWidth=Math.max(e.currentValueMaxWidth,Math.ceil(n.width)),e.currentValueHeight=Math.max(e.currentValueHeight,Math.ceil(n.height))}),e.currentValueTotalHeight=e.currentValueHeight+e.currentvalue.offset,a.remove()}var o=t._fullLayout._size;e.lx=o.l+o.w*e.x,e.ly=o.t+o.h*(1-e.y),\"fraction\"===e.lenmode?e.outerLength=Math.round(o.w*e.len):e.outerLength=e.len,e.lenPad=Math.round(.5*E.gripWidth),e.inputAreaStart=0,e.inputAreaLength=Math.round(e.outerLength-e.pad.l-e.pad.r);var l=(e.inputAreaLength-2*E.stepInset)/(e.steps.length-1),c=n+E.labelPadding;e.labelStride=Math.max(1,Math.ceil(c/l)),e.labelHeight=i,e.height=e.currentValueTotalHeight+E.tickOffset+e.ticklen+E.labelOffset+e.labelHeight+e.pad.t+e.pad.b;var h=\"left\";S.isRightAnchor(e)&&(e.lx-=e.outerLength,h=\"right\"),S.isCenterAnchor(e)&&(e.lx-=e.outerLength/2,h=\"center\");var f=\"top\";S.isBottomAnchor(e)&&(e.ly-=e.height,f=\"bottom\"),S.isMiddleAnchor(e)&&(e.ly-=e.height/2,f=\"middle\"),e.outerLength=Math.ceil(e.outerLength),e.height=Math.ceil(e.height),e.lx=Math.round(e.lx),e.ly=Math.round(e.ly),M.autoMargin(t,E.autoMarginIdRoot+e._index,{x:e.x,y:e.y,l:e.outerLength*({right:1,center:.5}[h]||0),r:e.outerLength*({left:1,center:.5}[h]||0),b:e.height*({top:1,middle:.5}[f]||0),t:e.height*({bottom:1,middle:.5}[f]||0)})}function o(t,e,r){r.active>=r.steps.length&&(r.active=0),e.call(s,r).call(x,r).call(c,r).call(p,r).call(b,t,r).call(l,t,r),A.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(g,r,r.active/(r.steps.length-1),!1),e.call(s,r)}function s(t,e,r){if(e.currentvalue.visible){var n,i,a=t.selectAll(\"text\").data([0]);switch(e.currentvalue.xanchor){case\"right\":n=e.inputAreaLength-E.currentValueInset-e.currentValueMaxWidth,i=\"left\";break;case\"center\":n=.5*e.inputAreaLength,i=\"middle\";break;default:n=E.currentValueInset,i=\"left\"}a.enter().append(\"text\").classed(E.labelClass,!0).classed(\"user-select-none\",!0).attr(\"text-anchor\",i);var o=e.currentvalue.prefix?e.currentvalue.prefix:\"\";return o+=\"string\"==typeof r?r:e.steps[e.active].label,e.currentvalue.suffix&&(o+=e.currentvalue.suffix),a.call(A.font,e.currentvalue.font).text(o).call(T.convertToTspans),A.setTranslate(a,n,e.currentValueHeight),a}}function l(t,e,r){var n=t.selectAll(\"rect.\"+E.gripRectClass).data([0]);n.enter().append(\"rect\").classed(E.gripRectClass,!0).call(d,e,t,r).style(\"pointer-events\",\"all\"),n.attr({width:E.gripWidth,height:E.gripHeight,rx:E.gripRadius,ry:E.gripRadius}).call(k.stroke,r.bordercolor).call(k.fill,r.bgcolor).style(\"stroke-width\",r.borderwidth+\"px\")}function u(t,e,r){var n=t.selectAll(\"text\").data([0]);return n.enter().append(\"text\").classed(E.labelClass,!0).classed(\"user-select-none\",!0).attr(\"text-anchor\",\"middle\"),n.call(A.font,r.font).text(e.step.label).call(T.convertToTspans),n}function c(t,e){var r=t.selectAll(\"g.\"+E.labelsClass).data([0]);r.enter().append(\"g\").classed(E.labelsClass,!0);var n=r.selectAll(\"g.\"+E.labelGroupClass).data(e.labelSteps);n.enter().append(\"g\").classed(E.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=w.select(this);r.call(u,t,e),A.setTranslate(r,v(e,t.fraction),E.tickOffset+e.ticklen+e.labelHeight+E.labelOffset+e.currentValueTotalHeight)})}function h(t,e,r,n,i){var a=Math.round(n*(r.steps.length-1));a!==r.active&&f(t,e,r,a,!0,i)}function f(t,e,r,n,i,a){var o=r.active;r._input.active=r.active=n;var l=r.steps[r.active];e.call(g,r,r.active/(r.steps.length-1),a),e.call(s,r),t.emit(\"plotly_sliderchange\",{slider:r,step:r.steps[r.active],interaction:i,previousActive:o}),l&&l.method&&i&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=i,e._nextMethod.doTransition=a):(e._nextMethod={step:l,doCallback:i,doTransition:a},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(M.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function d(t,e,r){function n(){return r.data()[0]}var i=r.node(),a=w.select(e);t.on(\"mousedown\",function(){var t=n();e.emit(\"plotly_sliderstart\",{slider:t});var o=r.select(\".\"+E.gripRectClass);w.event.stopPropagation(),w.event.preventDefault(),o.call(k.fill,t.activebgcolor);var s=y(t,w.mouse(i)[0]);h(e,r,t,s,!0),t._dragging=!0,a.on(\"mousemove\",function(){var t=n(),a=y(t,w.mouse(i)[0]);h(e,r,t,a,!1)}),a.on(\"mouseup\",function(){var t=n();t._dragging=!1,o.call(k.fill,t.bgcolor),a.on(\"mouseup\",null),a.on(\"mousemove\",null),e.emit(\"plotly_sliderend\",{slider:t,step:t.steps[t.active]})})})}function p(t,e){var r=t.selectAll(\"rect.\"+E.tickRectClass).data(e.steps);r.enter().append(\"rect\").classed(E.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+\"px\",\"shape-rendering\":\"crispEdges\"}),r.each(function(t,r){var n=r%e.labelStride==0,i=w.select(this);i.attr({height:n?e.ticklen:e.minorticklen}).call(k.fill,e.tickcolor),A.setTranslate(i,v(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?E.tickOffset:E.minorTickOffset)+e.currentValueTotalHeight)})}function m(t){t.labelSteps=[];for(var e=t.steps.length,r=0;r<e;r+=t.labelStride)t.labelSteps.push({fraction:r/(e-1),step:t.steps[r]})}function g(t,e,r,n){var i=t.select(\"rect.\"+E.gripRectClass),a=v(e,r);if(!e._invokingCommand){var o=i;n&&e.transition.duration>0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr(\"transform\",\"translate(\"+(a-.5*E.gripWidth)+\",\"+e.currentValueTotalHeight+\")\")}}function v(t,e){return t.inputAreaStart+E.stepInset+(t.inputAreaLength-2*E.stepInset)*Math.min(1,Math.max(0,e))}function y(t,e){return Math.min(1,Math.max(0,(e-E.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*E.stepInset-2*t.inputAreaStart)))}function b(t,e,r){var n=t.selectAll(\"rect.\"+E.railTouchRectClass).data([0]);n.enter().append(\"rect\").classed(E.railTouchRectClass,!0).call(d,e,t,r).style(\"pointer-events\",\"all\"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,E.tickOffset+r.ticklen+r.labelHeight)}).call(k.fill,r.bgcolor).attr(\"opacity\",0),A.setTranslate(n,0,r.currentValueTotalHeight)}function x(t,e){var r=t.selectAll(\"rect.\"+E.railRectClass).data([0]);r.enter().append(\"rect\").classed(E.railRectClass,!0);var n=e.inputAreaLength-2*E.railInset;r.attr({width:n,height:E.railWidth,rx:E.railRadius,ry:E.railRadius,\"shape-rendering\":\"crispEdges\"}).call(k.stroke,e.bordercolor).call(k.fill,e.bgcolor).style(\"stroke-width\",e.borderwidth+\"px\"),A.setTranslate(r,E.railInset,.5*(e.inputAreaWidth-E.railWidth)+e.currentValueTotalHeight)}function _(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var i=r[n];-1!==i.indexOf(E.autoMarginIdRoot)&&M.autoMargin(t,i)}}var w=t(\"d3\"),M=t(\"../../plots/plots\"),k=t(\"../color\"),A=t(\"../drawing\"),T=t(\"../../lib/svg_text_utils\"),S=t(\"../legend/anchor_utils\"),E=t(\"./constants\");e.exports=function(t){var e=t._fullLayout,r=n(e),s=e._infolayer.selectAll(\"g.\"+E.containerClassName).data(r.length>0?[0]:[]);if(s.enter().append(\"g\").classed(E.containerClassName,!0).style(\"cursor\",\"ew-resize\"),s.exit().remove(),s.exit().size()&&_(t),0!==r.length){var l=s.selectAll(\"g.\"+E.groupClassName).data(r,i);l.enter().append(\"g\").classed(E.groupClassName,!0),l.exit().each(function(e){w.select(this).remove(),e._commandObserver.remove(),delete e._commandObserver,M.autoMargin(t,E.autoMarginIdRoot+e._index)});for(var u=0;u<r.length;u++){var c=r[u];a(t,c)}l.each(function(e){if(!(e.steps.length<2)){var r=w.select(this);m(e),M.manageCommandObserver(t,e,e.steps,function(e){var n=r.data()[0];n.active!==e.index&&(n._dragging||f(t,r,n,e.index,!1,!0))}),o(t,w.select(this),e)}})}}},{\"../../lib/svg_text_utils\":704,\"../../plots/plots\":787,\"../color\":578,\"../drawing\":602,\"../legend/anchor_utils\":616,\"./constants\":651,d3:107}],654:[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\":650,\"./constants\":651,\"./defaults\":652,\"./draw\":653}],655:[function(t,e,r){\"use strict\";var n=t(\"d3\"),i=t(\"fast-isnumeric\"),a=t(\"../../plotly\"),o=t(\"../../plots/plots\"),s=t(\"../../lib\"),l=t(\"../drawing\"),u=t(\"../color\"),c=t(\"../../lib/svg_text_utils\"),h=t(\"../../constants/interactions\");(e.exports={}).draw=function(t,e,r){function f(t){s.syncOrAsync([d,p],t)}function d(e){return e.attr(\"transform\",_?\"rotate(\"+[_.rotate,x.x,x.y]+\") translate(0, \"+_.offset+\")\":null),e.style({\"font-family\":k,\"font-size\":n.round(A,2)+\"px\",fill:u.rgb(T),opacity:S*u.opacity(T),\"font-weight\":o.fontWeight}).attr(x).call(c.convertToTspans).attr(x),e.selectAll(\"tspan.line\").attr(x),o.previousPromises(t)}function p(t){var e=n.select(t.node().parentNode);if(b&&b.selection&&b.side&&L){e.attr(\"transform\",null);var r=0,a={left:\"right\",right:\"left\",top:\"bottom\",bottom:\"top\"}[b.side],o=-1!==[\"left\",\"top\"].indexOf(b.side)?-1:1,u=i(b.pad)?b.pad:2,c=l.bBox(e.node()),h={left:0,top:0,right:M.width,bottom:M.height},f=b.maxShift||(h[b.side]-c[b.side])*(\"left\"===b.side||\"top\"===b.side?-1:1);if(f<0)r=f;else{var d=b.offsetLeft||0,p=b.offsetTop||0;c.left-=d,c.right-=d,c.top-=p,c.bottom-=p,b.selection.each(function(){var t=l.bBox(this);s.bBoxIntersect(c,t,u)&&(r=Math.max(r,o*(t[b.side]-c[a])+u))}),r=Math.min(f,r)}if(r>0||f<0){var m={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[b.side];e.attr(\"transform\",\"translate(\"+m+\")\")}}}var m=r.propContainer,g=r.propName,v=r.traceIndex,y=r.dfltName,b=r.avoid||{},x=r.attributes,_=r.transform,w=r.containerGroup,M=t._fullLayout,k=m.titlefont.family,A=m.titlefont.size,T=m.titlefont.color,S=1,E=!1,L=m.title.trim();\"\"===L&&(S=0),L.match(/Click to enter .+ title/)&&(S=.2,E=!0),w||(w=M._infolayer.selectAll(\".g-\"+e).data([0])).enter().append(\"g\").classed(\"g-\"+e,!0);var C=w.selectAll(\"text\").data([0]);C.enter().append(\"text\"),C.text(L).attr(\"class\",e),C.attr({\"data-unformatted\":L}).call(f);var z=\"Click to enter \"+y+\" title\";t._context.editable?(L?C.on(\".opacity\",null):function(){S=0,E=!0,L=z,C.attr({\"data-unformatted\":L}).text(L).on(\"mouseover.opacity\",function(){n.select(this).transition().duration(h.SHOW_PLACEHOLDER).style(\"opacity\",1)}).on(\"mouseout.opacity\",function(){n.select(this).transition().duration(h.HIDE_PLACEHOLDER).style(\"opacity\",0)})}(),C.call(c.makeEditable).on(\"edit\",function(e){void 0!==v?a.restyle(t,g,e,v):a.relayout(t,g,e)}).on(\"cancel\",function(){this.text(this.attr(\"data-unformatted\")).call(f)}).on(\"input\",function(t){this.text(t||\" \").attr(x).selectAll(\"tspan.line\").attr(x)})):L&&!L.match(/Click to enter .+ title/)||C.remove(),C.classed(\"js-placeholder\",E)}},{\"../../constants/interactions\":665,\"../../lib\":685,\"../../lib/svg_text_utils\":704,\"../../plotly\":719,\"../../plots/plots\":787,\"../color\":578,\"../drawing\":602,d3:107,\"fast-isnumeric\":116}],656:[function(t,e,r){\"use strict\";var n=t(\"../../plots/font_attributes\"),i=t(\"../color/attributes\"),a=t(\"../../lib/extend\").extendFlat,o=t(\"../../plots/pad_attributes\"),s={_isLinkedToArray:\"button\",method:{valType:\"enumerated\",values:[\"restyle\",\"relayout\",\"animate\",\"update\"],dflt:\"restyle\"},args:{valType:\"info_array\",freeLength:!0,items:[{valType:\"any\"},{valType:\"any\"},{valType:\"any\"}]},label:{valType:\"string\",dflt:\"\"}};e.exports={_isLinkedToArray:\"updatemenu\",_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:s,x:{valType:\"number\",min:-2,max:3,dflt:-.05},xanchor:{valType:\"enumerated\",values:[\"auto\",\"left\",\"center\",\"right\"],dflt:\"right\"},y:{valType:\"number\",min:-2,max:3,dflt:1},yanchor:{valType:\"enumerated\",values:[\"auto\",\"top\",\"middle\",\"bottom\"],dflt:\"top\"},pad:a({},o,{}),font:a({},n,{}),bgcolor:{valType:\"color\"},bordercolor:{valType:\"color\",dflt:i.borderLine},borderwidth:{valType:\"number\",min:0,dflt:1}}},{\"../../lib/extend\":677,\"../../plots/font_attributes\":748,\"../../plots/pad_attributes\":786,\"../color/attributes\":577}],657:[function(t,e,r){\"use strict\";e.exports={name:\"updatemenus\",containerClassName:\"updatemenu-container\",headerGroupClassName:\"updatemenu-header-group\",headerClassName:\"updatemenu-header\",headerArrowClassName:\"updatemenu-header-arrow\",dropdownButtonGroupClassName:\"updatemenu-dropdown-button-group\",dropdownButtonClassName:\"updatemenu-dropdown-button\",buttonClassName:\"updatemenu-button\",itemRectClassName:\"updatemenu-item-rect\",itemTextClassName:\"updatemenu-item-text\",menuIndexAttrName:\"updatemenu-active-index\",autoMarginIdRoot:\"updatemenu-\",blankHeaderOpts:{label:\"  \"},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,fontSizeToHeight:1.3,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:\"#F4FAFF\",hoverColor:\"#F4FAFF\"}},{}],658:[function(t,e,r){\"use strict\";function n(t,e,r){function n(r,n){return a.coerce(t,e,s,r,n)}n(\"visible\",i(t,e).length>0)&&(n(\"active\"),n(\"direction\"),n(\"type\"),n(\"showactive\"),n(\"x\"),n(\"y\"),a.noneOrAll(t,e,[\"x\",\"y\"]),n(\"xanchor\"),n(\"yanchor\"),n(\"pad.t\"),n(\"pad.r\"),n(\"pad.b\"),n(\"pad.l\"),a.coerceFont(n,\"font\",r.font),n(\"bgcolor\",r.paper_bgcolor),n(\"bordercolor\"),n(\"borderwidth\"))}function i(t,e){function r(t,e){return a.coerce(n,i,u,t,e)}for(var n,i,o=t.buttons||[],s=e.buttons=[],l=0;l<o.length;l++)n=o[l],i={},a.isPlainObject(n)&&Array.isArray(n.args)&&(r(\"method\"),r(\"args\"),r(\"label\"),i._index=l,s.push(i));return s}var a=t(\"../../lib\"),o=t(\"../../plots/array_container_defaults\"),s=t(\"./attributes\"),l=t(\"./constants\").name,u=s.buttons;e.exports=function(t,e){o(t,e,{name:l,handleItemDefaults:n})}},{\"../../lib\":685,\"../../plots/array_container_defaults\":721,\"./attributes\":656,\"./constants\":657}],659:[function(t,e,r){\"use strict\";function n(t){for(var e=t[E.name],r=[],n=0;n<e.length;n++){var i=e[n];i.visible&&r.push(i)}return r}function i(t){return t._index}function a(t){return-1==+t.attr(E.menuIndexAttrName)}function o(t,e){return+t.attr(E.menuIndexAttrName)===e._index}function s(t,e,r,n,i,a,o,s){e._input.active=e.active=o,\"buttons\"===e.type?u(t,n,null,null,e):\"dropdown\"===e.type&&(i.attr(E.menuIndexAttrName,\"-1\"),l(t,n,i,a,e),s||u(t,n,i,a,e))}function l(t,e,r,n,i){var a=e.selectAll(\"g.\"+E.headerClassName).data([0]);a.enter().append(\"g\").classed(E.headerClassName,!0).style(\"pointer-events\",\"all\");var s=i.active,l=i.buttons[s]||E.blankHeaderOpts,c={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},h={width:i.headerWidth,height:i.headerHeight};a.call(f,i,l).call(b,i,c,h);var d=e.selectAll(\"text.\"+E.headerArrowClassName).data([0]);d.enter().append(\"text\").classed(E.headerArrowClassName,!0).classed(\"user-select-none\",!0).attr(\"text-anchor\",\"end\").call(A.font,i.font).text(\"▼\"),d.attr({x:i.headerWidth-E.arrowOffsetX+i.pad.l,y:i.headerHeight/2+E.textOffsetY+i.pad.t}),a.on(\"click\",function(){r.call(x),r.attr(E.menuIndexAttrName,o(r,i)?-1:String(i._index)),u(t,e,r,n,i)}),a.on(\"mouseover\",function(){a.call(g)}),a.on(\"mouseout\",function(){a.call(v,i)}),A.setTranslate(e,i.lx,i.ly)}function u(t,e,r,n,i){r||(r=e).attr(\"pointer-events\",\"all\");var o=a(r)&&\"buttons\"!==i.type?[]:i.buttons,l=\"dropdown\"===i.type?E.dropdownButtonClassName:E.buttonClassName,u=r.selectAll(\"g.\"+l).data(o),d=u.enter().append(\"g\").classed(l,!0),p=u.exit();\"dropdown\"===i.type?(d.attr(\"opacity\",\"0\").transition().attr(\"opacity\",\"1\"),p.transition().attr(\"opacity\",\"0\").remove()):p.remove();var y=0,x=0,_=-1!==[\"up\",\"down\"].indexOf(i.direction);\"dropdown\"===i.type&&(_?x=i.headerHeight+E.gapButtonHeader:y=i.headerWidth+E.gapButtonHeader),\"dropdown\"===i.type&&\"up\"===i.direction&&(x=-E.gapButtonHeader+E.gapButton-i.openHeight),\"dropdown\"===i.type&&\"left\"===i.direction&&(y=-E.gapButtonHeader+E.gapButton-i.openWidth);var k={x:i.lx+y+i.pad.l,y:i.ly+x+i.pad.t,yPad:E.gapButton,xPad:E.gapButton,index:0},A={l:k.x+i.borderwidth,t:k.y+i.borderwidth};u.each(function(a,o){var l=w.select(this);l.call(f,i,a).call(b,i,k),l.on(\"click\",function(){w.event.defaultPrevented||(s(t,i,a,e,r,n,o),M.executeAPICommand(t,a.method,a.args),t.emit(\"plotly_buttonclicked\",{menu:i,button:a,active:i.active}))}),l.on(\"mouseover\",function(){l.call(g)}),l.on(\"mouseout\",function(){l.call(v,i),u.call(m,i)})}),u.call(m,i),_?(A.w=Math.max(i.openWidth,i.headerWidth),A.h=k.y-A.t):(A.w=k.x-A.l,A.h=Math.max(i.openHeight,i.headerHeight)),A.direction=i.direction,n&&(u.size()?c(t,e,r,n,i,A):h(n))}function c(t,e,r,n,i,a){var o,s,l,u=i.direction,c=\"up\"===u||\"down\"===u,h=i.active;if(c)for(s=0,l=0;l<h;l++)s+=i.heights[l]+E.gapButton;else for(o=0,l=0;l<h;l++)o+=i.widths[l]+E.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\")}function h(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()})}function f(t,e,r){t.call(d,e).call(p,e,r)}function d(t,e){var r=t.selectAll(\"rect\").data([0]);r.enter().append(\"rect\").classed(E.itemRectClassName,!0).attr({rx:E.rx,ry:E.ry,\"shape-rendering\":\"crispEdges\"}),r.call(k.stroke,e.bordercolor).call(k.fill,e.bgcolor).style(\"stroke-width\",e.borderwidth+\"px\")}function p(t,e,r){var n=t.selectAll(\"text\").data([0]);n.enter().append(\"text\").classed(E.itemTextClassName,!0).classed(\"user-select-none\",!0).attr(\"text-anchor\",\"start\"),n.call(A.font,e.font).text(r.label).call(T.convertToTspans)}function m(t,e){var r=e.active;t.each(function(t,n){var i=w.select(this);n===r&&e.showactive&&i.select(\"rect.\"+E.itemRectClassName).call(k.fill,E.activeColor)})}function g(t){t.select(\"rect.\"+E.itemRectClassName).call(k.fill,E.hoverColor)}function v(t,e){t.select(\"rect.\"+E.itemRectClassName).call(k.fill,e.bgcolor)}function y(t,e){e.width1=0,e.height1=0,e.heights=[],e.widths=[],e.totalWidth=0,e.totalHeight=0,e.openWidth=0,e.openHeight=0,e.lx=0,e.ly=0;var r=t._tester.selectAll(\"g.\"+E.dropdownButtonClassName).data(e.buttons);r.enter().append(\"g\").classed(E.dropdownButtonClassName,!0);var n=-1!==[\"up\",\"down\"].indexOf(e.direction);r.each(function(t,r){var i=w.select(this);i.call(f,e,t);var a=i.select(\".\"+E.itemTextClassName),o=a.selectAll(\"tspan\"),s=a.node()&&A.bBox(a.node()).width,l=Math.max(s+E.textPadX,E.minWidth),u=e.font.size*E.fontSizeToHeight,c=o[0].length||1,h=Math.max(u*c,E.minHeight)+E.textOffsetY;h=Math.ceil(h),l=Math.ceil(l),e.widths[r]=l,e.heights[r]=h,e.height1=Math.max(e.height1,h),e.width1=Math.max(e.width1,l),n?(e.totalWidth=Math.max(e.totalWidth,l),e.openWidth=e.totalWidth,e.totalHeight+=h+E.gapButton,e.openHeight+=h+E.gapButton):(e.totalWidth+=l+E.gapButton,e.openWidth+=l+E.gapButton,e.totalHeight=Math.max(e.totalHeight,h),e.openHeight=e.totalHeight)}),n?e.totalHeight-=E.gapButton:e.totalWidth-=E.gapButton,e.headerWidth=e.width1+E.arrowPadX,e.headerHeight=e.height1,\"dropdown\"===e.type&&(n?(e.width1+=E.arrowPadX,e.totalHeight=e.height1):e.totalWidth=e.width1,e.totalWidth+=E.arrowPadX),r.remove();var i=e.totalWidth+e.pad.l+e.pad.r,a=e.totalHeight+e.pad.t+e.pad.b,o=t._fullLayout._size;e.lx=o.l+o.w*e.x,e.ly=o.t+o.h*(1-e.y);var s=\"left\";S.isRightAnchor(e)&&(e.lx-=i,s=\"right\"),S.isCenterAnchor(e)&&(e.lx-=i/2,s=\"center\");var l=\"top\";S.isBottomAnchor(e)&&(e.ly-=a,l=\"bottom\"),S.isMiddleAnchor(e)&&(e.ly-=a/2,l=\"middle\"),e.totalWidth=Math.ceil(e.totalWidth),e.totalHeight=Math.ceil(e.totalHeight),e.lx=Math.round(e.lx),e.ly=Math.round(e.ly),M.autoMargin(t,E.autoMarginIdRoot+e._index,{x:e.x,y:e.y,l:i*({right:1,center:.5}[s]||0),r:i*({left:1,center:.5}[s]||0),b:a*({top:1,middle:.5}[l]||0),t:a*({bottom:1,middle:.5}[l]||0)})}function b(t,e,r,n){n=n||{};var i=t.select(\".\"+E.itemRectClassName),a=t.select(\".\"+E.itemTextClassName),o=a.selectAll(\"tspan\"),s=e.borderwidth,l=r.index;A.setTranslate(t,s+r.x,s+r.y);var u=-1!==[\"up\",\"down\"].indexOf(e.direction);i.attr({x:0,y:0,width:n.width||(u?e.width1:e.widths[l]),height:n.height||(u?e.heights[l]:e.height1)});var c=e.font.size*E.fontSizeToHeight,h=((o[0].length||1)-1)*c/4,f={x:E.textOffsetX,y:e.heights[l]/2-h+E.textOffsetY};a.attr(f),o.attr(f),u?r.y+=e.heights[l]+r.yPad:r.x+=e.widths[l]+r.xPad,r.index++}function x(t){t.selectAll(\"g.\"+E.dropdownButtonClassName).remove()}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(E.autoMarginIdRoot)&&M.autoMargin(t,i)}}var w=t(\"d3\"),M=t(\"../../plots/plots\"),k=t(\"../color\"),A=t(\"../drawing\"),T=t(\"../../lib/svg_text_utils\"),S=t(\"../legend/anchor_utils\"),E=t(\"./constants\"),L=t(\"./scrollbox\");e.exports=function(t){var e=t._fullLayout,r=n(e),a=e._infolayer.selectAll(\"g.\"+E.containerClassName).data(r.length>0?[0]:[]);if(a.enter().append(\"g\").classed(E.containerClassName,!0).style(\"cursor\",\"pointer\"),a.exit().remove(),a.exit().size()&&_(t),0!==r.length){var c=a.selectAll(\"g.\"+E.headerGroupClassName).data(r,i);c.enter().append(\"g\").classed(E.headerGroupClassName,!0);var h=a.selectAll(\"g.\"+E.dropdownButtonGroupClassName).data([0]);h.enter().append(\"g\").classed(E.dropdownButtonGroupClassName,!0).style(\"pointer-events\",\"all\");for(var f=0;f<r.length;f++){var d=r[f];y(t,d)}var p=\"updatemenus\"+e._uid,m=new L(t,h,p);c.enter().size()&&h.call(x).attr(E.menuIndexAttrName,\"-1\"),c.exit().each(function(e){w.select(this).remove(),h.call(x).attr(E.menuIndexAttrName,\"-1\"),M.autoMargin(t,E.autoMarginIdRoot+e._index)}),c.each(function(e){var r=w.select(this),n=\"dropdown\"===e.type?h:null;M.manageCommandObserver(t,e,e.buttons,function(i){s(t,e,e.buttons[i.index],r,n,m,i.index,!0)}),\"dropdown\"===e.type?(l(t,r,h,m,e),o(h,e)&&u(t,r,h,m,e)):u(t,r,null,null,e)})}}},{\"../../lib/svg_text_utils\":704,\"../../plots/plots\":787,\"../color\":578,\"../drawing\":602,\"../legend/anchor_utils\":616,\"./constants\":657,\"./scrollbox\":661,d3:107}],660:[function(t,e,r){arguments[4][654][0].apply(r,arguments)},{\"./attributes\":656,\"./constants\":657,\"./defaults\":658,\"./draw\":659,dup:654}],661:[function(t,e,r){\"use strict\";function n(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})}e.exports=n;var i=t(\"d3\"),a=t(\"../color\"),o=t(\"../drawing\"),s=t(\"../../lib\");n.barWidth=2,n.barLength=20,n.barRadius=2,n.barPad=1,n.barColor=\"#808BA4\",n.prototype.enable=function(t,e,r){var s=this.gd._fullLayout,l=s.width,u=s.height;this.position=t;var c,h,f,d,p=this.position.l,m=this.position.w,g=this.position.t,v=this.position.h,y=this.position.direction,b=\"down\"===y,x=\"left\"===y,_=\"right\"===y,w=\"up\"===y,M=m,k=v;b||x||_||w||(this.position.direction=\"down\",b=!0),b||w?(h=(c=p)+M,b?(f=g,k=(d=Math.min(f+k,u))-f):k=(d=g+k)-(f=Math.max(d-k,0))):(d=(f=g)+k,x?M=(h=p+M)-(c=Math.max(h-M,0)):(c=p,M=(h=Math.min(c+M,l))-c)),this._box={l:c,t:f,w:M,h:k};var A=m>M,T=n.barLength+2*n.barPad,S=n.barWidth+2*n.barPad,E=p,L=g+v;L+S>u&&(L=u-S);var C=this.container.selectAll(\"rect.scrollbar-horizontal\").data(A?[0]:[]);C.exit().on(\".drag\",null).remove(),C.enter().append(\"rect\").classed(\"scrollbar-horizontal\",!0).call(a.fill,n.barColor),A?(this.hbar=C.attr({rx:n.barRadius,ry:n.barRadius,x:E,y:L,width:T,height:S}),this._hbarXMin=E+T/2,this._hbarTranslateMax=M-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var z=v>k,D=n.barWidth+2*n.barPad,I=n.barLength+2*n.barPad,P=p+m,O=g;P+D>l&&(P=l-D);var j=this.container.selectAll(\"rect.scrollbar-vertical\").data(z?[0]:[]);j.exit().on(\".drag\",null).remove(),j.enter().append(\"rect\").classed(\"scrollbar-vertical\",!0).call(a.fill,n.barColor),z?(this.vbar=j.attr({rx:n.barRadius,ry:n.barRadius,x:P,y:O,width:D,height:I}),this._vbarYMin=O+I/2,this._vbarTranslateMax=k-I):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=c-.5,N=z?h+D+.5:h+.5,B=f-.5,U=A?d+S+.5:d+.5,V=s._topdefs.selectAll(\"#\"+R).data(A||z?[0]:[]);if(V.exit().remove(),V.enter().append(\"clipPath\").attr(\"id\",R).append(\"rect\"),A||z?(this._clipRect=V.select(\"rect\").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(N)-Math.floor(F),height:Math.ceil(U)-Math.floor(B)}),this.container.call(o.setClipUrl,R),this.bg.attr({x:p,y:g,width:m,height:v})):(this.bg.attr({width:0,height:0}),this.container.on(\"wheel\",null).on(\".drag\",null).call(o.setClipUrl,null),delete this._clipRect),A||z){var H=i.behavior.drag().on(\"dragstart\",function(){i.event.sourceEvent.preventDefault()}).on(\"drag\",this._onBoxDrag.bind(this));this.container.on(\"wheel\",null).on(\"wheel\",this._onBoxWheel.bind(this)).on(\".drag\",null).call(H);var q=i.behavior.drag().on(\"dragstart\",function(){i.event.sourceEvent.preventDefault(),i.event.sourceEvent.stopPropagation()}).on(\"drag\",this._onBarDrag.bind(this));A&&this.hbar.on(\".drag\",null).call(q),z&&this.vbar.on(\".drag\",null).call(q)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on(\"wheel\",null).on(\".drag\",null).call(o.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)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=i.event.dx),this.vbar&&(e-=i.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=i.event.deltaY),this.vbar&&(e+=i.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(s.constrain(i.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,o=a+this._vbarTranslateMax;e=(s.constrain(i.event.y,a,o)-a)/(o-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=s.constrain(t||0,0,r),e=s.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.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(o.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var a=e/n;this.vbar.call(o.setTranslate,t,e+a*this._vbarTranslateMax)}}},{\"../../lib\":685,\"../color\":578,\"../drawing\":602,d3:107}],662:[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]}},{}],663:[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]}},{}],664:[function(t,e,r){\"use strict\";e.exports={circle:\"●\",\"circle-open\":\"○\",square:\"■\",\"square-open\":\"□\",diamond:\"◆\",\"diamond-open\":\"◇\",cross:\"+\",x:\"❌\"}},{}],665:[function(t,e,r){\"use strict\";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300}},{}],666:[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}},{}],667:[function(t,e,r){\"use strict\";e.exports={entityToUnicode:{mu:\"μ\",amp:\"&\",lt:\"<\",gt:\">\",nbsp:\" \",times:\"×\",plusmn:\"±\",deg:\"°\"},unicodeToEntity:{\"&\":\"amp\",\"<\":\"lt\",\">\":\"gt\",'\"':\"quot\",\"'\":\"#x27\",\"/\":\"#x2F\"}}},{}],668:[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}},{}],669:[function(t,e,r){\"use strict\";var n=t(\"./plotly\");r.version=\"1.26.1\",t(\"es6-promise\").polyfill(),t(\"../build/plotcss\"),t(\"./fonts/mathjax_config\"),r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.update=n.update,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.setPlotConfig=t(\"./plot_api/set_plot_config\"),r.register=t(\"./plot_api/register\"),r.toImage=t(\"./plot_api/to_image\"),r.downloadImage=t(\"./snapshot/download\"),r.validate=t(\"./plot_api/validate\"),r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.register(t(\"./traces/scatter\")),r.register([t(\"./components/legend\"),t(\"./components/annotations\"),t(\"./components/shapes\"),t(\"./components/images\"),t(\"./components/updatemenus\"),t(\"./components/sliders\"),t(\"./components/rangeslider\"),t(\"./components/rangeselector\")]),r.Icons=t(\"../build/ploticon\"),r.Plots=n.Plots,r.Fx=n.Fx,r.Snapshot=t(\"./snapshot\"),r.PlotSchema=t(\"./plot_api/plot_schema\"),r.Queue=t(\"./lib/queue\"),r.d3=t(\"d3\")},{\"../build/plotcss\":1,\"../build/ploticon\":2,\"./components/annotations\":574,\"./components/images\":615,\"./components/legend\":623,\"./components/rangeselector\":635,\"./components/rangeslider\":641,\"./components/shapes\":648,\"./components/sliders\":654,\"./components/updatemenus\":660,\"./fonts/mathjax_config\":670,\"./lib/queue\":697,\"./plot_api/plot_schema\":713,\"./plot_api/register\":714,\"./plot_api/set_plot_config\":715,\"./plot_api/to_image\":717,\"./plot_api/validate\":718,\"./plotly\":719,\"./snapshot\":807,\"./snapshot/download\":804,\"./traces/scatter\":986,d3:107,\"es6-promise\":113}],670:[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},{}],671:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,n){Array.isArray(t)&&(e[r]=t[n])}},{}],672:[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\":666,\"fast-isnumeric\":116}],673:[function(t,e,r){\"use strict\";var n=t(\"fast-isnumeric\"),i=t(\"tinycolor2\"),a=t(\"../components/colorscale/get_scale\"),o=(Object.keys(t(\"../components/colorscale/scales\")),t(\"./nested_property\")),s=/^([2-9]|[1-9][0-9]+)$/;r.valObjects={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)}},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)}},colorscale:{coerceFunction:function(t,e,r){e.set(a(t,r))}},angle:{coerceFunction:function(t,e,r){\"auto\"===t?e.set(\"auto\"):n(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r){var n=r.length;\"string\"==typeof t&&t.substr(0,n)===r&&s.test(t.substr(n))?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt,n=r.length;return t===r||\"string\"==typeof t&&!(t.substr(0,n)!==r||!s.test(t.substr(n)))}},flaglist:{coerceFunction:function(t,e,r,n){if(\"string\"==typeof t)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 s=o(n,i).get(),l=o(t,i),u=o(e,i),c=l.get();return void 0===a&&(a=s.dflt),s.arrayOk&&Array.isArray(c)?(u.set(c),c):(r.valObjects[s.valType].coerceFunction(c,u,a,s),u.get())},r.coerce2=function(t,e,n,i,a){var s=o(t,i),l=r.coerce(t,e,n,i,a),u=s.get();return void 0!==u&&null!==u&&l},r.coerceFont=function(t,e,r){var n={};return r=r||{},n.family=t(e+\".family\",r.family),n.size=t(e+\".size\",r.size),n.color=t(e+\".color\",r.color),n},r.validate=function(t,e){var n=r.valObjects[e.valType];if(e.arrayOk&&Array.isArray(t))return!0;if(n.validateFunction)return n.validateFunction(t,e);var i={},a=i,o={set:function(t){a=t}};return n.coerceFunction(t,o,i,e),a!==i}},{\"../components/colorscale/get_scale\":590,\"../components/colorscale/scales\":596,\"./nested_property\":691,\"fast-isnumeric\":116,tinycolor2:514}],674:[function(t,e,r){\"use strict\";function n(t){return t&&M.componentsRegistry.calendars&&\"string\"==typeof t&&\"gregorian\"!==t}function i(t,e){return String(t+Math.pow(10,e)).substr(1)}function a(t,e,r,n,a){if((e||r||n||a)&&(t+=\" \"+i(e,2)+\":\"+i(r,2),(n||a)&&(t+=\":\"+i(n,2),a))){for(var o=4;a%10==0;)o-=1,a/=10;t+=\".\"+i(a,o)}return t}function o(t,e,r){t=t.replace(I,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(r))try{t=M.getComponentMethod(\"calendars\",\"worldCalFmt\")(t,e,r)}catch(t){return\"Invalid\"}return k(t)(i)}function s(t,e){var r=m(t+.05,y),n=i(Math.floor(r/b),2)+\":\"+i(m(Math.floor(r/x),60),2);if(\"M\"!==e){d(e)||(e=0);var a=(100+Math.min(m(t/_,60),P[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,\"\").replace(/[\\.]$/,\"\")),n+=\":\"+a}return n}function l(t){return t.formatDate(\"yyyy\")}function u(t){return t.formatDate(\"M yyyy\")}function c(t){return t.formatDate(\"M d\")}function h(t){return t.formatDate(\"M d, yyyy\")}var f=t(\"d3\"),d=t(\"fast-isnumeric\"),p=t(\"./loggers\").error,m=t(\"./mod\"),g=t(\"../constants/numerical\"),v=g.BADNUM,y=g.ONEDAY,b=g.ONEHOUR,x=g.ONEMIN,_=g.ONESEC,w=g.EPOCHJD,M=t(\"../registry\"),k=f.time.format.utc,A=/^\\s*(-?\\d\\d\\d\\d|\\d\\d)(-(\\d?\\d)(-(\\d?\\d)([ Tt]([01]?\\d|2[0-3])(:([0-5]\\d)(:([0-5]\\d(\\.\\d+)?))?(Z|z|[+\\-]\\d\\d:?\\d\\d)?)?)?)?)?\\s*$/m,T=/^\\s*(-?\\d\\d\\d\\d|\\d\\d)(-(\\d?\\di?)(-(\\d?\\d)([ Tt]([01]?\\d|2[0-3])(:([0-5]\\d)(:([0-5]\\d(\\.\\d+)?))?(Z|z|[+\\-]\\d\\d:?\\d\\d)?)?)?)?)?\\s*$/m,S=(new Date).getFullYear()-70;r.dateTick0=function(t,e){return n(t)?e?M.getComponentMethod(\"calendars\",\"CANONICAL_SUNDAY\")[t]:M.getComponentMethod(\"calendars\",\"CANONICAL_TICK\")[t]:e?\"2000-01-02\":\"2000-01-01\"},r.dfltRange=function(t){return n(t)?M.getComponentMethod(\"calendars\",\"DFLTRANGE\")[t]:[\"2000-01-01\",\"2001-01-01\"]},r.isJSDate=function(t){return\"object\"==typeof t&&null!==t&&\"function\"==typeof t.getTime};var E,L;r.dateTime2ms=function(t,e){if(r.isJSDate(t))return t=Number(t)-t.getTimezoneOffset()*x,t>=E&&t<=L?t:v;if(\"string\"!=typeof t&&\"number\"!=typeof t)return v;t=String(t);var i=n(e),a=t.charAt(0);!i||\"G\"!==a&&\"g\"!==a||(t=t.substr(1),e=\"\");var o=i&&\"chinese\"===e.substr(0,7),s=t.match(o?T:A);if(!s)return v;var l=s[1],u=s[3]||\"1\",c=Number(s[5]||1),h=Number(s[7]||0),f=Number(s[9]||0),d=Number(s[11]||0);if(i){if(2===l.length)return v;l=Number(l);var p;try{var m=M.getComponentMethod(\"calendars\",\"getCal\")(e);if(o){var g=\"i\"===u.charAt(u.length-1);u=parseInt(u,10),p=m.newDate(l,m.toMonthIndex(l,u,g),c)}else p=m.newDate(l,Number(u),c)}catch(t){return v}return p?(p.toJD()-w)*y+h*b+f*x+d*_:v}l=2===l.length?(Number(l)+2e3-S)%100+S:Number(l),u-=1;var k=new Date(Date.UTC(2e3,u,c,h,f));return k.setUTCFullYear(l),k.getUTCMonth()!==u?v:k.getUTCDate()!==c?v:k.getTime()+d*_},E=r.MIN_MS=r.dateTime2ms(\"-9999\"),L=r.MAX_MS=r.dateTime2ms(\"9999-12-31 23:59:59.9999\"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==v};var C=90*y,z=3*b,D=5*x;r.ms2DateTime=function(t,e,r){if(\"number\"!=typeof t||!(t>=E&&t<=L))return v;e||(e=0);var i,o,s,l,u,c,h=Math.floor(10*m(t+.05,1)),f=Math.round(t-h/10);if(n(r)){var d=Math.floor(f/y)+w,p=Math.floor(m(t,y));try{i=M.getComponentMethod(\"calendars\",\"getCal\")(r).fromJD(d).formatDate(\"yyyy-mm-dd\")}catch(t){i=k(\"G%Y-%m-%d\")(new Date(f))}if(\"-\"===i.charAt(0))for(;i.length<11;)i=\"-0\"+i.substr(1);else for(;i.length<10;)i=\"0\"+i;o=e<C?Math.floor(p/b):0,s=e<C?Math.floor(p%b/x):0,l=e<z?Math.floor(p%x/_):0,u=e<D?p%_*10+h:0}else c=new Date(f),i=k(\"%Y-%m-%d\")(c),o=e<C?c.getUTCHours():0,s=e<C?c.getUTCMinutes():0,l=e<z?c.getUTCSeconds():0,u=e<D?10*c.getUTCMilliseconds()+h:0;return a(i,o,s,l,u)},r.ms2DateTimeLocal=function(t){if(!(t>=E+y&&t<=L-y))return v;var e=Math.floor(10*m(t+.05,1)),r=new Date(Math.round(t-e/10));return a(f.time.format(\"%Y-%m-%d\")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,i){if(r.isJSDate(t)||\"number\"==typeof t){if(n(i))return p(\"JS Dates and milliseconds are incompatible with world calendars\",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,i))return p(\"unrecognized date\",t),e;return t};var I=/%\\d?f/g,P=[59,59.9,59.99,59.999,59.9999],O=k(\"%Y\"),j=k(\"%b %Y\"),R=k(\"%b %-d\"),F=k(\"%b %-d, %Y\");r.formatDate=function(t,e,r,i){var a,f;if(i=n(i)&&i,e)return o(e,t,i);if(i)try{var d=Math.floor((t+.05)/y)+w,p=M.getComponentMethod(\"calendars\",\"getCal\")(i).fromJD(d);\"y\"===r?f=l(p):\"m\"===r?f=u(p):\"d\"===r?(a=l(p),f=c(p)):(a=h(p),f=s(t,r))}catch(t){return\"Invalid\"}else{var m=new Date(Math.floor(t+.05));\"y\"===r?f=O(m):\"m\"===r?f=j(m):\"d\"===r?(a=O(m),f=R(m)):(a=F(m),f=s(t,r))}return f+(a?\"\\n\"+a:\"\")};var N=3*y;r.incrementMonth=function(t,e,r){r=n(r)&&r;var i=m(t,y);if(t=Math.round(t-i),r)try{var a=Math.round(t/y)+w,o=M.getComponentMethod(\"calendars\",\"getCal\")(r),s=o.fromJD(a);return e%12?o.add(s,e,\"m\"):o.add(s,e/12,\"y\"),(s.toJD()-w)*y+i}catch(e){p(\"invalid ms \"+t+\" in calendar \"+r)}var l=new Date(t+N);return l.setUTCMonth(l.getUTCMonth()+e)+i-N},r.findExactDates=function(t,e){for(var r,i,a=0,o=0,s=0,l=0,u=n(e)&&M.getComponentMethod(\"calendars\",\"getCal\")(e),c=0;c<t.length;c++)if(i=t[c],d(i)){if(!(i%y))if(u)try{1===(r=u.fromJD(i/y+w)).day()?1===r.month()?a++:o++:s++}catch(t){}else 1===(r=new Date(i)).getUTCDate()?0===r.getUTCMonth()?a++:o++:s++}else l++;s+=o+=a;var h=t.length-l;return{exactYears:a/h,exactMonths:o/h,exactDays:s/h}}},{\"../constants/numerical\":666,\"../registry\":802,\"./loggers\":688,\"./mod\":690,d3:107,\"fast-isnumeric\":116}],675:[function(t,e,r){\"use strict\";e.exports=function(t,e){return Array.isArray(t)||(t=[]),t.length=e,t}},{}],676:[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:114}],677:[function(t,e,r){\"use strict\";function n(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}function i(t,e,r,s){var l,u,c,h,f,d,p=t[0],m=t.length;if(2===m&&o(p)&&o(t[1])&&0===p.length){if(n(t[1],p))return p;p.splice(0,p.length)}for(var g=1;g<m;g++){l=t[g];for(u in l)c=p[u],h=l[u],s&&o(h)?p[u]=h:e&&h&&(a(h)||(f=o(h)))?(f?(f=!1,d=c&&o(c)?c:[]):d=c&&a(c)?c:{},p[u]=i([d,h],e,r,s)):(void 0!==h||r)&&(p[u]=h)}return p}var a=t(\"./is_plain_object.js\"),o=Array.isArray;r.extendFlat=function(){return i(arguments,!1,!1,!1)},r.extendDeep=function(){return i(arguments,!0,!1,!1)},r.extendDeepAll=function(){return i(arguments,!0,!0,!1)},r.extendDeepNoArrays=function(){return i(arguments,!0,!1,!0)}},{\"./is_plain_object.js\":687}],678:[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}},{}],679:[function(t,e,r){\"use strict\";e.exports=function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];!0===n.visible&&e.push(n)}return e}},{}],680:[function(t,e,r){\"use strict\";function n(t,e){return(0,l[t])(e)}function i(t){for(var e=0;e<s.length;e++){var r=s[e];if(new RegExp(a[r]).test(t.trim().toLowerCase()))return r}return o.warn(\"Unrecognized country name: \"+t+\".\"),!1}var a=t(\"country-regex\"),o=t(\"../lib\"),s=Object.keys(a),l={\"ISO-3\":o.identity,\"USA-states\":o.identity,\"country names\":i};r.locationToFeature=function(t,e,r){var i=n(t,e);if(i){for(var a=0;a<r.length;a++){var s=r[a];if(s.id===i)return s}o.warn([\"Location with id\",i,\"does not have a matching topojson feature at this resolution.\"].join(\" \"))}return!1}},{\"../lib\":685,\"country-regex\":100}],681:[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,e){var r={};return r=1===t.length?{type:\"LineString\",coordinates:t[0]}:{type:\"MultiLineString\",coordinates:t},e&&(r.trace=e),r},r.makePolygon=function(t,e){var r={};if(1===t.length)r={type:\"Polygon\",coordinates:t};else{for(var n=new Array(t.length),i=0;i<t.length;i++)n[i]=[t[i]];r={type:\"MultiPolygon\",coordinates:n}}return e&&(r.trace=e),r},r.makeBlank=function(){return{type:\"Point\",coordinates:[]}}},{\"../constants/numerical\":666}],682:[function(t,e,r){\"use strict\";function n(t,e){var r=t;return r[3]*=e,r}function i(t){if(s(t))return h;var e=l(t);return e.length?e:h}function a(t){return s(t)?t:f}function o(t,e,r){var o,s,c,d,p,m=t.color,g=Array.isArray(m),v=Array.isArray(e),y=[];if(o=void 0!==t.colorscale?u.makeColorScaleFunc(u.extractScale(t.colorscale,t.cmin,t.cmax)):i,s=g?function(t,e){return void 0===t[e]?h:l(o(t[e]))}:i,c=v?function(t,e){return void 0===t[e]?f:a(t[e])}:a,g||v)for(var b=0;b<r;b++)d=s(m,b),p=c(e,b),y[b]=n(d,p);else y=n(l(m),e);return y}var s=t(\"fast-isnumeric\"),l=t(\"color-rgba\"),u=t(\"../components/colorscale\"),c=t(\"../components/color/attributes\").defaultLine,h=l(c),f=1;e.exports=o},{\"../components/color/attributes\":577,\"../components/colorscale\":592,\"color-rgba\":88,\"fast-isnumeric\":116}],683:[function(t,e,r){\"use strict\";function n(t){for(var e=0;(e=t.indexOf(\"<sup>\",e))>=0;){var r=t.indexOf(\"</sup>\",e);if(r<e)break;t=t.slice(0,e)+l(t.slice(e+5,r))+t.slice(r+6)}return t}function i(t){return t.replace(/\\<br\\>/g,\"\\n\")}function a(t){return t.replace(/\\<.*\\>/g,\"\")}function o(t){for(var e=u.entityToUnicode,r=0;(r=t.indexOf(\"&\",r))>=0;){var n=t.indexOf(\";\",r);if(n<r)r+=1;else{var i=e[t.slice(r+1,n)];t=i?t.slice(0,r)+i+t.slice(n+1):t.slice(0,r)+t.slice(n+1)}}return t}function s(t){return\"\"+o(a(n(i(t))))}var l=t(\"superscript-text\"),u=t(\"../constants/string_mappings\");e.exports=s},{\"../constants/string_mappings\":667,\"superscript-text\":510}],684:[function(t,e,r){\"use strict\";e.exports=function(t){return t}},{}],685:[function(t,e,r){\"use strict\";var n=t(\"d3\"),i=e.exports={};i.nestedProperty=t(\"./nested_property\"),i.isPlainObject=t(\"./is_plain_object\"),i.isArray=t(\"./is_array\"),i.mod=t(\"./mod\"),i.toLogRange=t(\"./to_log_range\"),i.relinkPrivateKeys=t(\"./relink_private\"),i.ensureArray=t(\"./ensure_array\");var a=t(\"./coerce\");i.valObjects=a.valObjects,i.coerce=a.coerce,i.coerce2=a.coerce2,i.coerceFont=a.coerceFont,i.validate=a.validate;var o=t(\"./dates\");i.dateTime2ms=o.dateTime2ms,i.isDateTime=o.isDateTime,i.ms2DateTime=o.ms2DateTime,i.ms2DateTimeLocal=o.ms2DateTimeLocal,i.cleanDate=o.cleanDate,i.isJSDate=o.isJSDate,i.formatDate=o.formatDate,i.incrementMonth=o.incrementMonth,i.dateTick0=o.dateTick0,i.dfltRange=o.dfltRange,i.findExactDates=o.findExactDates,i.MIN_MS=o.MIN_MS,i.MAX_MS=o.MAX_MS;var s=t(\"./search\");i.findBin=s.findBin,i.sorterAsc=s.sorterAsc,i.sorterDes=s.sorterDes,i.distinctVals=s.distinctVals,i.roundUp=s.roundUp;var l=t(\"./stats\");i.aggNums=l.aggNums,i.len=l.len,i.mean=l.mean,i.variance=l.variance,i.stdev=l.stdev,i.interp=l.interp;var u=t(\"./matrix\");i.init2dArray=u.init2dArray,i.transposeRagged=u.transposeRagged,i.dot=u.dot,i.translationMatrix=u.translationMatrix,i.rotationMatrix=u.rotationMatrix,i.rotationXYMatrix=u.rotationXYMatrix,i.apply2DTransform=u.apply2DTransform,i.apply2DTransform2=u.apply2DTransform2;var c=t(\"./extend\");i.extendFlat=c.extendFlat,i.extendDeep=c.extendDeep,i.extendDeepAll=c.extendDeepAll,i.extendDeepNoArrays=c.extendDeepNoArrays;var h=t(\"./loggers\");i.log=h.log,i.warn=h.warn,i.error=h.error,i.notifier=t(\"./notifier\"),i.filterUnique=t(\"./filter_unique\"),i.filterVisible=t(\"./filter_visible\"),i.pushUnique=t(\"./push_unique\"),i.cleanNumber=t(\"./clean_number\"),i.noop=t(\"./noop\"),i.identity=t(\"./identity\"),i.swapAttrs=function(t,e,r,n){r||(r=\"x\"),n||(n=\"y\");for(var a=0;a<e.length;a++){var o=e[a],s=i.nestedProperty(t,o.replace(\"?\",r)),l=i.nestedProperty(t,o.replace(\"?\",n)),u=s.get();s.set(l.get()),l.set(u)}},i.pauseEvent=function(t){return t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.cancelBubble=!0,!1},i.constrain=function(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},i.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},i.simpleMap=function(t,e,r,n){for(var i=t.length,a=new Array(i),o=0;o<i;o++)a[o]=e(t[o],r,n);return a},i.randstr=function t(e,r,n){if(n||(n=16),void 0===r&&(r=24),r<=0)return\"0\";var i,a,o=Math.log(Math.pow(2,r))/Math.log(n),s=\"\";for(i=2;o===1/0;i*=2)o=Math.log(Math.pow(2,r/i))/Math.log(n)*i;var l=o-Math.floor(o);for(i=0;i<Math.floor(o);i++)s=Math.floor(Math.random()*n).toString(n)+s;l&&(a=Math.pow(n,l),s=Math.floor(Math.random()*a).toString(n)+s);var u=parseInt(s,n);return e&&e.indexOf(s)>-1||u!==1/0&&u>=Math.pow(2,r)?t(e,r,n):s},i.OptionControl=function(t,e){t||(t={}),e||(e=\"opt\");var r={};return r.optionList=[],r._newoption=function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)},r[\"_\"+e]=t,r},i.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r<l;r++)u[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;r<o;r++){for(a=0,n=0;n<l;n++)(i=r+n+1-e)<-o?i-=s*Math.round(i/s):i>=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[n];c[r]=a}return c},i.syncOrAsync=function(t,e,r){function n(){return i.syncOrAsync(t,e,r)}for(var a,o;t.length;)if(o=t.splice(0,1)[0],(a=o(e))&&a.then)return a.then(n).then(void 0,i.promiseError);return r&&r(e)},i.stripTrailingSlash=function(t){return\"/\"===t.substr(-1)?t.substr(0,t.length-1):t},i.noneOrAll=function(t,e,r){if(t){var n,i,a=!1,o=!0;for(n=0;n<r.length;n++)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]]}},i.mergeArray=function(t,e,r){if(Array.isArray(t))for(var n=Math.min(t.length,e.length),i=0;i<n;i++)e[i][r]=t[i]},i.minExtend=function(t,e){var r={};\"object\"!=typeof e&&(e={});var n,a,o,s=Object.keys(t);for(n=0;n<s.length;n++)o=t[a=s[n]],\"_\"!==a.charAt(0)&&\"function\"!=typeof o&&(\"module\"===a?r[a]=o:Array.isArray(o)?r[a]=o.slice(0,3):r[a]=o&&\"object\"==typeof o?i.minExtend(t[a],e[a]):o);for(s=Object.keys(e),n=0;n<s.length;n++)\"object\"==typeof(o=e[a=s[n]])&&a in r&&\"object\"==typeof r[a]||(r[a]=o);return r},i.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)},i.containsAny=function(t,e){for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r]))return!0;return!1},i.getPlotDiv=function(t){for(;t&&t.removeAttribute;t=t.parentNode)if(i.isPlotDiv(t))return t},i.isPlotDiv=function(t){var e=n.select(t);return e.node()instanceof HTMLElement&&e.size()&&e.classed(\"js-plotly-plot\")},i.removeElement=function(t){var e=t&&t.parentNode;e&&e.removeChild(t)},i.addStyleRule=function(t,e){if(!i.styleSheet){var r=document.createElement(\"style\");r.appendChild(document.createTextNode(\"\")),document.head.appendChild(r),i.styleSheet=r.sheet}var n=i.styleSheet;n.insertRule?n.insertRule(t+\"{\"+e+\"}\",0):n.addRule?n.addRule(t,e,0):i.warn(\"addStyleRule failed\")},i.isIE=function(){return void 0!==window.navigator.msSaveBlob},i.isD3Selection=function(t){return t&&\"function\"==typeof t.classed},i.objectFromPath=function(t,e){for(var r,n=t.split(\".\"),i=r={},a=0;a<n.length;a++){var o=n[a],s=null,l=n[a].match(/(.*)\\[([0-9]+)\\]/);l?(o=l[1],s=l[2],r=r[o]=[],a===n.length-1?r[s]=e:r[s]={},r=r[s]):(a===n.length-1?r[o]=e:r[o]={},r=r[o])}return i};var f=/^([^\\[\\.]+)\\.(.+)?/,d=/^([^\\.]+)\\[([0-9]+)\\](\\.)?(.+)?/;i.expandObjectPaths=function(t){var e,r,n,a,o,s,l;if(\"object\"==typeof t&&!Array.isArray(t))for(r in t)t.hasOwnProperty(r)&&((e=r.match(f))?(a=t[r],n=e[1],delete t[r],t[n]=i.extendDeepNoArrays(t[n]||{},i.objectFromPath(r,i.expandObjectPaths(a))[n])):(e=r.match(d))?(a=t[r],n=e[1],o=parseInt(e[2]),delete t[r],t[n]=t[n]||[],\".\"===e[3]?(l=e[4],s=t[n][o]=t[n][o]||{},i.extendDeepNoArrays(s,i.objectFromPath(l,i.expandObjectPaths(a)))):t[n][o]=i.expandObjectPaths(a)):t[r]=i.expandObjectPaths(t[r]));return t},i.numSeparate=function(t,e,r){if(r||(r=!1),\"string\"!=typeof e||0===e.length)throw new Error(\"Separator string required for formatting!\");\"number\"==typeof t&&(t=String(t));var n=/(\\d+)(\\d{3})/,i=e.charAt(0),a=e.charAt(1),o=t.split(\".\"),s=o[0],l=o.length>1?i+o[1]:\"\";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,\"$1\"+a+\"$2\");return s+l}},{\"./clean_number\":672,\"./coerce\":673,\"./dates\":674,\"./ensure_array\":675,\"./extend\":677,\"./filter_unique\":678,\"./filter_visible\":679,\"./identity\":684,\"./is_array\":686,\"./is_plain_object\":687,\"./loggers\":688,\"./matrix\":689,\"./mod\":690,\"./nested_property\":691,\"./noop\":692,\"./notifier\":693,\"./push_unique\":696,\"./relink_private\":698,\"./search\":699,\"./stats\":702,\"./to_log_range\":705,d3:107}],686:[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)}},{}],687:[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}},{}],688:[function(t,e,r){\"use strict\";function n(t,e){if(t.apply)t.apply(t,e);else for(var r=0;r<e.length;r++)t(e[r])}var i=t(\"../plot_api/plot_config\"),a=e.exports={};a.log=function(){if(i.logging>1){for(var t=[\"LOG:\"],e=0;e<arguments.length;e++)t.push(arguments[e]);n(console.trace||console.log,t)}},a.warn=function(){if(i.logging>0){for(var t=[\"WARN:\"],e=0;e<arguments.length;e++)t.push(arguments[e]);n(console.trace||console.log,t)}},a.error=function(){if(i.logging>0){for(var t=[\"ERROR:\"],e=0;e<arguments.length;e++)t.push(arguments[e]);n(console.error,t)}}},{\"../plot_api/plot_config\":712}],689:[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)))}}},{}],690:[function(t,e,r){\"use strict\";e.exports=function(t,e){var r=t%e;return r<0?r+e:r}},{}],691:[function(t,e,r){\"use strict\";function n(t,e){return function(){var r,i,a,o,s,l=t;for(o=0;o<e.length-1;o++){if(-1===(r=e[o])){for(i=!0,a=[],s=0;s<l.length;s++)a[s]=n(l[s],e.slice(o+1))(),a[s]!==a[0]&&(i=!1);return i?a[0]:a}if(\"number\"==typeof r&&!d(l))return;if(\"object\"!=typeof(l=l[r])||null===l)return}if(\"object\"==typeof l&&null!==l&&null!==(a=l[e[o]]))return a}}function i(t,e){if(!c(t)||p(t)&&\"]\"===e.charAt(e.length-1)||e.match(v)&&void 0!==t)return!1;if(!d(t))return!0;if(e.match(g))return!0;var r=m(e);return r&&\"\"===r.index}function a(t,e,r){return function(n){var a,c,h=t,f=\"\",p=[[t,f]],m=i(n,r);for(c=0;c<e.length-1;c++){if(\"number\"==typeof(a=e[c])&&!d(h))throw\"array index but container is not an array\";if(-1===a){if(m=!s(h,e.slice(c+1),n,r))break;return}if(!l(h,a,e[c+1],m))break;if(\"object\"!=typeof(h=h[a])||null===h)throw\"container is not an object\";f=o(f,a),p.push([h,f])}m?(c===e.length-1&&delete h[e[c]],u(p)):h[e[c]]=n}}function o(t,e){var r=e;return f(e)?r=\"[\"+e+\"]\":t&&(r=\".\"+e),t+r}function s(t,e,r,n){var o,s=d(r),u=!0,c=r,h=n.replace(\"-1\",0),f=!s&&i(r,h),p=e[0];for(o=0;o<t.length;o++)h=n.replace(\"-1\",o),s&&(f=i(c=r[o%r.length],h)),f&&(u=!1),l(t,o,p,f)&&a(t[o],e,n.replace(\"-1\",o))(c);return u}function l(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]=\"number\"==typeof r?[]:{}}return!0}function u(t){var e,r,n,a,s,l;for(e=t.length-1;e>=0;e--){if(n=t[e][0],a=t[e][1],l=!1,d(n))for(r=n.length-1;r>=0;r--)i(n[r],o(a,r))?l?n[r]=void 0:n.pop():l=!0;else if(\"object\"==typeof n&&null!==n)for(l=!1,r=(s=Object.keys(n)).length-1;r>=0;r--)i(n[s[r]],o(a,s[r]))?delete n[s[r]]:l=!0;if(l)return}}function c(t){return void 0===t||null===t||\"object\"==typeof t&&(d(t)?!t.length:!Object.keys(t).length)}function h(t,e,r){return{set:function(){throw\"bad container\"},get:function(){},astr:e,parts:r,obj:t}}var f=t(\"fast-isnumeric\"),d=t(\"./is_array\"),p=t(\"./is_plain_object\"),m=t(\"../plot_api/container_array_match\");e.exports=function(t,e){if(f(e))e=String(e);else if(\"string\"!=typeof e||\"[-1]\"===e.substr(e.length-4))throw\"bad property string\";for(var r,i,o,s=0,l=e.split(\".\");s<l.length;){if(r=String(l[s]).match(/^([^\\[\\]]*)((\\[\\-?[0-9]*\\])+)$/)){if(r[1])l[s]=r[1];else{if(0!==s)throw\"bad property string\";l.splice(0,1)}for(i=r[2].substr(1,r[2].length-2).split(\"][\"),o=0;o<i.length;o++)s++,l.splice(s,0,Number(i[o]))}s++}return\"object\"!=typeof t?h(t,e,l):{set:a(t,l,e),get:n(t,l),astr:e,parts:l,obj:t}};var g=/(^|\\.)((domain|range)(\\.[xy])?|args|parallels)$/,v=/(^|\\.)args\\[/},{\"../plot_api/container_array_match\":708,\"./is_array\":686,\"./is_plain_object\":687,\"fast-isnumeric\":116}],692:[function(t,e,r){\"use strict\";e.exports=function(){}},{}],693:[function(t,e,r){\"use strict\";var n=t(\"d3\"),i=t(\"fast-isnumeric\"),a=[];e.exports=function(t,e){function r(t){t.duration(700).style(\"opacity\",0).each(\"end\",function(t){var e=a.indexOf(t);-1!==e&&a.splice(e,1),n.select(this).remove()})}if(-1===a.indexOf(t)){a.push(t);var o=1e3;i(e)?o=e:\"long\"===e&&(o=3e3);var s=n.select(\"body\").selectAll(\".plotly-notifier\").data([0]);s.enter().append(\"div\").classed(\"plotly-notifier\",!0),s.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(\"&times;\").on(\"click\",function(){e.transition().call(r)});for(var i=e.append(\"p\"),a=t.split(/<br\\s*\\/?>/g),s=0;s<a.length;s++)s&&i.append(\"br\"),i.append(\"span\").text(a[s]);e.transition().duration(700).style(\"opacity\",1).transition().delay(o).call(r)})}}},{d3:107,\"fast-isnumeric\":116}],694:[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\":700}],695:[function(t,e,r){\"use strict\";var n=t(\"./matrix\").dot,i=e.exports={};i.tester=function(t){function e(t,e){var r=t[0],n=t[1];return!(r<i||r>a||n<o||n>s)&&(!e||!u(t))}function r(t,e){var r=t[0],l=t[1];if(r<i||r>a||l<o||l>s)return!1;var u,c,h,f,d,p=n.length,m=n[0][0],g=n[0][1],v=0;for(u=1;u<p;u++)if(c=m,h=g,m=n[u][0],g=n[u][1],f=Math.min(c,m),!(r<f||r>Math.max(c,m)||l>Math.max(h,g)))if(l<Math.min(h,g))r!==f&&v++;else{if(d=m===c?l:h+(r-c)*(g-h)/(m-c),l===d)return 1!==u||!e;l<=d&&r!==f&&v++}return v%2==1}var n=t.slice(),i=n[0][0],a=i,o=n[0][1],s=o;n.push(n[0]);for(var l=1;l<n.length;l++)i=Math.min(i,n[l][0]),a=Math.max(a,n[l][0]),o=Math.min(o,n[l][1]),s=Math.max(s,n[l][1]);var u,c=!1;return 5===n.length&&(n[0][0]===n[1][0]?n[2][0]===n[3][0]&&n[0][1]===n[3][1]&&n[1][1]===n[2][1]&&(c=!0,u=function(t){return t[0]===n[0][0]}):n[0][1]===n[1][1]&&n[2][1]===n[3][1]&&n[0][0]===n[3][0]&&n[1][0]===n[2][0]&&(c=!0,u=function(t){return t[1]===n[0][1]})),{xmin:i,xmax:a,ymin:o,ymax:s,pts:n,contains:c?e:r,isRect:c}};var a=i.isSegmentBent=function(t,e,r,i){var a,o,s,l=t[e],u=[t[r][0]-l[0],t[r][1]-l[1]],c=n(u,u),h=Math.sqrt(c),f=[-u[1]/h,u[0]/h];for(a=e+1;a<r;a++)if(o=[t[a][0]-l[0],t[a][1]-l[1]],(s=n(o,u))<0||s>c||Math.abs(n(o,f))>i)return!0;return!1};i.filter=function(t,e){function r(r){t.push(r);var s=n.length,l=i;n.splice(o+1);for(var u=l+1;u<t.length;u++)(u===t.length-1||a(t,l,u+1,e))&&(n.push(t[u]),n.length<s-2&&(i=u,o=n.length-1),l=u)}var n=[t[0]],i=0,o=0;return t.length>1&&r(t.pop()),{addPt:r,raw:t,filtered:n}}},{\"./matrix\":689}],696:[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&&-1===t.indexOf(e)&&t.push(e);return t}},{}],697:[function(t,e,r){\"use strict\";function n(t,e){for(var r,n=[],a=0;a<e.length;a++)r=e[a],n[a]=r===t?r:\"object\"==typeof r?Array.isArray(r)?i.extendDeep([],r):i.extendDeepAll({},r):r;return n}var i=t(\"../lib\"),a=t(\"../plot_api/plot_config\"),o={};o.add=function(t,e,r,n,i){var o,s;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(i)),t.undoQueue.queue.length>a.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},o.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},o.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},o.undo=function(t){var e,r;if(t.framework&&t.framework.isPolar)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++)o.plotDo(t,e.undo.calls[r],e.undo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1}},o.redo=function(t){var e,r;if(t.framework&&t.framework.isPolar)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++)o.plotDo(t,e.redo.calls[r],e.redo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1,t.undoQueue.index++}},o.plotDo=function(t,e,r){t.autoplay=!0,r=n(t,r),e.apply(null,r)},e.exports=o},{\"../lib\":685,\"../plot_api/plot_config\":712}],698:[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],u=e[s];if(\"_\"===s.charAt(0)||\"function\"==typeof l){if(s in e)continue;e[s]=l}else if(n(l)&&n(u)&&i(l[0]))for(var c=0;c<l.length;c++)i(l[c])&&i(u[c])&&t(u[c],l[c]);else i(l)&&i(u)&&(t(u,l),Object.keys(u).length||delete e[s])}}},{\"./is_array\":686,\"./is_plain_object\":687}],699:[function(t,e,r){\"use strict\";function n(t,e){return t<e}function i(t,e){return t<=e}function a(t,e){return t>e}function o(t,e){return t>=e}var s=t(\"fast-isnumeric\"),l=t(\"./loggers\");r.findBin=function(t,e,r){if(s(e.start))return r?Math.ceil((t-e.start)/e.size)-1:Math.floor((t-e.start)/e.size);var u,c,h=0,f=e.length,d=0;for(c=e[e.length-1]>=e[0]?r?n:i:r?o:a;h<f&&d++<100;)c(e[u=Math.floor((h+f)/2)],t)?h=u+1:f=u;return d>90&&l.log(\"Long binary search...\"),h-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,i=e[n]-e[0]||1,a=i/(n||1)/1e4,o=[e[0]],s=0;s<n;s++)e[s+1]>e[s]+a&&(i=Math.min(i,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:i}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;i<a&&o++<100;)e[n=u((i+a)/2)]<=t?i=n+s:a=n-l;return e[i]}},{\"./loggers\":688,\"fast-isnumeric\":116}],700:[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)}},{}],701:[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\":578}],702:[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\":116}],703:[function(t,e,r){\"use strict\";function n(t){var e=i(t);return e.length?e:[0,0,0,1]}var i=t(\"color-rgba\");e.exports=n},{\"color-rgba\":88}],704:[function(t,e,r){\"use strict\";function n(t,e){return t.node().getBoundingClientRect()[e]}function i(t){return t.replace(/(<|&lt;|&#60;)/g,\"\\\\lt \").replace(/(>|&gt;|&#62;)/g,\"\\\\gt \")}function a(t,e,r){var n=\"math-output-\"+f.randstr([],64),a=h.select(\"body\").append(\"div\").attr({id:n}).style({visibility:\"hidden\",position:\"absolute\"}).style({\"font-size\":e.fontSize+\"px\"}).text(i(t));MathJax.Hub.Queue([\"Typeset\",MathJax.Hub,a.node()],function(){var e=h.select(\"body\").select(\"#MathJax_SVG_glyphs\");if(a.select(\".MathJax_SVG\").empty()||!a.select(\"svg\").node())f.log(\"There was an error in the tex syntax.\",t),r();else{var n=a.select(\"svg\").node().getBoundingClientRect();r(a.select(\".MathJax_SVG\"),e,n)}a.remove()})}function o(t,e){for(var r=t||\"\",n=0;n<e.length;n++){var i=e[n];r=r.replace(i.regExp,i.sub)}return r}function s(t){return o(t,y)}function l(t){return o(t,b)}function u(t){for(var e=(t=(t=s(t)).replace(x,\" \")).split(/(<[^<>]*>)/).map(function(t){var e=t.match(/<(\\/?)([^ >]*)\\s*(.*)>/i),n=e&&e[2].toLowerCase(),i=m[n];if(void 0!==i){var a=e[1],o=e[3],s=o.match(/^style\\s*=\\s*\"([^\"]+)\"\\s*/i);if(\"a\"===n){if(a)return\"</a>\";if(\"href\"!==o.substr(0,4).toLowerCase())return\"<a>\";var u=o.substr(4).replace(/[\"']/g,\"\").replace(/=/,\"\"),c=document.createElement(\"a\");return c.href=u,-1===g.indexOf(c.protocol)?\"<a>\":'<a xlink:show=\"new\" xlink:href=\"'+l(u)+'\">'}if(\"br\"===n)return\"<br>\";if(a)return\"sup\"===n?'</tspan><tspan dy=\"0.42em\">&#x200b;</tspan>':\"sub\"===n?'</tspan><tspan dy=\"-0.21em\">&#x200b;</tspan>':\"</tspan>\";var h=\"<tspan\";return\"sup\"!==n&&\"sub\"!==n||(h=\"&#x200b;\"+h),s&&(i=l(s=s[1].replace(/(^|;)\\s*color:/,\"$1 fill:\"))+(i?\";\"+i:\"\")),h+(i?' style=\"'+i+'\"':\"\")+\">\"}return r.xml_entity_encode(t).replace(/</g,\"&lt;\")}),n=[],i=e.indexOf(\"<br>\");i>0;i=e.indexOf(\"<br>\",i+1))n.push(i);var a=0;n.forEach(function(t){for(var r=t+a,n=e.slice(0,r),i=\"\",o=n.length-1;o>=0;o--){var s=n[o].match(/<(\\/?).*>/i);if(s&&\"<br>\"!==n[o]){s[1]||(i=n[o]);break}}i&&(e.splice(r+1,0,i),e.splice(r,0,\"</tspan>\"),a+=2)});var o=e.join(\"\").split(/<br>/gi);return o.length>1&&(e=o.map(function(t,e){return'<tspan class=\"line\" dy=\"'+1.3*e+'em\">'+t+\"</tspan>\"})),e.join(\"\")}function c(t,e,r){var n,i,a,o=r.horizontalAlign,s=r.verticalAlign||\"top\",l=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return i=\"bottom\"===s?function(){return l.bottom-n.height}:\"middle\"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},a=\"right\"===o?function(){return l.right-n.width}:\"center\"===o?function(){return l.left+(l.width-n.width)/2}:function(){return l.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:i()-u.top+\"px\",left:a()-u.left+\"px\",\"z-index\":1e3}),this}}var h=t(\"d3\"),f=t(\"../lib\"),d=t(\"../constants/xmlns_namespaces\"),p=t(\"../constants/string_mappings\");h.selection.prototype.appendSVG=function(t){for(var e=['<svg xmlns=\"',d.svg,'\" ','xmlns:xlink=\"',d.xlink,'\">',t,\"</svg>\"].join(\"\"),r=(new DOMParser).parseFromString(e,\"application/xml\"),n=r.documentElement.firstChild;n;)this.node().appendChild(this.node().ownerDocument.importNode(n,!0)),n=n.nextSibling;return r.querySelector(\"parsererror\")?(f.log(r.querySelector(\"parsererror div\").textContent),null):h.select(this.node().lastChild)},r.html_entity_decode=function(t){var e=h.select(\"body\").append(\"div\").style({display:\"none\"}).html(\"\"),r=t.replace(/(&[^;]*;)/gi,function(t){return\"&lt;\"===t?\"&#60;\":\"&rt;\"===t?\"&#62;\":-1!==t.indexOf(\"<\")||-1!==t.indexOf(\">\")?\"\":e.html(t).text()});return e.remove(),r},r.xml_entity_encode=function(t){return t.replace(/&(?!\\w+;|\\#[0-9]+;| \\#x[0-9A-F]+;)/g,\"&amp;\")},r.convertToTspans=function(t,e){function r(){d.empty()||(p=s.attr(\"class\")+\"-math\",d.select(\"svg.\"+p).remove()),t.text(\"\").style({visibility:\"inherit\",\"white-space\":\"pre\"}),(c=t.appendSVG(o))||t.text(i),t.select(\"a\").size()&&t.style(\"pointer-events\",\"all\"),e&&e.call(s)}var i=t.text(),o=u(i),s=t,l=!s.attr(\"data-notex\")&&o.match(/([^$]*)([$]+[^$]*[$]+)([^$]*)/),c=i,d=h.select(s.node().parentNode);if(!d.empty()){var p=s.attr(\"class\")?s.attr(\"class\").split(\" \")[0]:\"text\";p+=\"-math\",d.selectAll(\"svg.\"+p).remove(),d.selectAll(\"g.\"+p+\"-group\").remove(),t.style({visibility:null});for(var m=t.node();m&&m.removeAttribute;m=m.parentNode)m.removeAttribute(\"data-bb\");if(l){var g=f.getPlotDiv(s.node());(g&&g._promises||[]).push(new Promise(function(t){s.style({visibility:\"hidden\"});var i={fontSize:parseInt(s.style(\"font-size\"),10)};a(l[2],i,function(i,a,o){d.selectAll(\"svg.\"+p).remove(),d.selectAll(\"g.\"+p+\"-group\").remove();var l=i&&i.select(\"svg\");if(!l||!l.node())return r(),void t();var u=d.append(\"g\").classed(p+\"-group\",!0).attr({\"pointer-events\":\"none\"});u.node().appendChild(l.node()),a&&a.node()&&l.node().insertBefore(a.node().cloneNode(!0),l.node().firstChild),l.attr({class:p,height:o.height,preserveAspectRatio:\"xMinYMin meet\"}).style({overflow:\"visible\",\"pointer-events\":\"none\"});var c=s.style(\"fill\")||\"black\";l.select(\"g\").attr({fill:c,stroke:c});var h=n(l,\"width\"),f=n(l,\"height\"),m=+s.attr(\"x\")-h*{start:0,middle:.5,end:1}[s.attr(\"text-anchor\")||\"start\"],g=-(parseInt(s.style(\"font-size\"),10)||n(s,\"height\"))/4;\"y\"===p[0]?(u.attr({transform:\"rotate(\"+[-90,+s.attr(\"x\"),+s.attr(\"y\")]+\") translate(\"+[-h/2,g-f/2]+\")\"}),l.attr({x:+s.attr(\"x\"),y:+s.attr(\"y\")})):\"l\"===p[0]?l.attr({x:s.attr(\"x\"),y:g-f/2}):\"a\"===p[0]?l.attr({x:0,y:g}):l.attr({x:m,y:+s.attr(\"y\")+g-f/2}),e&&e.call(s,u),t(u)})}))}else r();return t}};var m={sup:'font-size:70%\" dy=\"-0.6em',sub:'font-size:70%\" dy=\"0.3em',b:\"font-weight:bold\",i:\"font-style:italic\",a:\"\",span:\"\",br:\"\",em:\"font-style:italic;font-weight:bold\"},g=[\"http:\",\"https:\",\"mailto:\"],v=new RegExp(\"</?(\"+Object.keys(m).join(\"|\")+\")( [^>]*)?/?>\",\"g\"),y=Object.keys(p.entityToUnicode).map(function(t){return{regExp:new RegExp(\"&\"+t+\";\",\"g\"),sub:p.entityToUnicode[t]}}),b=Object.keys(p.unicodeToEntity).map(function(t){return{regExp:new RegExp(t,\"g\"),sub:\"&\"+p.unicodeToEntity[t]+\";\"}}),x=/(\\r\\n?|\\n)/g;r.plainText=function(t){return(t||\"\").replace(v,\" \")},r.makeEditable=function(t,e,r){function n(){a(),o.style({opacity:0});var t,e=u.attr(\"class\");(t=e?\".\"+e.split(\" \")[0]+\"-math-group\":\"[class*=-math-group]\")&&h.select(o.node().parentNode).select(t).style({opacity:0})}function i(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}function a(){var t=f.getPlotDiv(o.node()),e=h.select(t).select(\".svg-container\"),n=e.append(\"div\");n.classed(\"plugin-editable editable\",!0).style({position:\"absolute\",\"font-family\":o.style(\"font-family\")||\"Arial\",\"font-size\":o.style(\"font-size\")||12,color:r.fill||o.style(\"fill\")||\"black\",opacity:1,\"background-color\":r.background||\"transparent\",outline:\"#ffffff33 1px solid\",margin:[-parseFloat(o.style(\"font-size\"))/8+1,0,0,-1].join(\"px \")+\"px\",padding:\"0\",\"box-sizing\":\"border-box\"}).attr({contenteditable:!0}).text(r.text||o.attr(\"data-unformatted\")).call(c(o,e,r)).on(\"blur\",function(){t._editing=!1,o.text(this.textContent).style({opacity:1});var e,r=h.select(this).attr(\"class\");(e=r?\".\"+r.split(\" \")[0]+\"-math-group\":\"[class*=-math-group]\")&&h.select(o.node().parentNode).select(e).style({opacity:0});var n=this.textContent;h.select(this).transition().duration(0).remove(),h.select(document).on(\"mouseup\",null),s.edit.call(o,n)}).on(\"focus\",function(){var e=this;t._editing=!0,h.select(document).on(\"mouseup\",function(){if(h.event.target===e)return!1;document.activeElement===n.node()&&n.node().blur()})}).on(\"keyup\",function(){27===h.event.which?(t._editing=!1,o.style({opacity:1}),h.select(this).style({opacity:0}).on(\"blur\",function(){return!1}).transition().remove(),s.cancel.call(o,this.textContent)):(s.input.call(o,this.textContent),h.select(this).call(c(o,e,r)))}).on(\"keydown\",function(){13===h.event.which&&this.blur()}).call(i)}r||(r={});var o=this,s=h.dispatch(\"edit\",\"input\",\"cancel\"),l=h.select(this.node()).style({\"pointer-events\":\"all\"}),u=e||l;return e&&l.style({\"pointer-events\":\"none\"}),r.immediate?n():u.on(\"click\",n),h.rebind(this,s,\"on\")}},{\"../constants/string_mappings\":667,\"../constants/xmlns_namespaces\":668,\"../lib\":685,d3:107}],705:[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\":116}],706:[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\":750,\"topojson-client\":516}],707:[function(t,e,r){\"use strict\";function n(t,e){for(var r=new Float32Array(e),n=0;n<e;n++)r[n]=t[n];return r}function i(t,e){for(var r=new Float64Array(e),n=0;n<e;n++)r[n]=t[n];return r}e.exports=function(t,e){if(t instanceof Float32Array)return n(t,e);if(t instanceof Float64Array)return i(t,e);throw new Error(\"This array type is not yet supported by `truncate`.\")}},{}],708:[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\":802}],709:[function(t,e,r){\"use strict\";function n(t,e){var r=t[e],n=e.charAt(0);r&&\"paper\"!==r&&(t[e]=f.cleanId(r,n))}function i(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 a(t,e){return e in t&&\"object\"==typeof t[e]&&0===Object.keys(t[e]).length}function o(t){var e=t.search(p);if(e>0)return t.substr(0,e)}var s=t(\"fast-isnumeric\"),l=t(\"gl-mat4/fromQuat\"),u=t(\"../registry\"),c=t(\"../lib\"),h=t(\"../plots/plots\"),f=t(\"../plots/cartesian/axes\"),d=t(\"../components/color\");r.getGraphDiv=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},r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&c.log(\"Clearing previous rejected promises from queue.\"),t._promises=[]},r.cleanLayout=function(t){var e,r;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1);var i=f.list({_fullLayout:t});for(e=0;e<i.length;e++){var o=i[e];o.anchor&&\"free\"!==o.anchor&&(o.anchor=f.cleanId(o.anchor)),o.overlaying&&(o.overlaying=f.cleanId(o.overlaying)),o.type||(o.isdate?o.type=\"date\":o.islog?o.type=\"log\":!1===o.isdate&&!1===o.islog&&(o.type=\"linear\")),\"withzero\"!==o.autorange&&\"tozero\"!==o.autorange||(o.autorange=!0,o.rangemode=\"tozero\"),delete o.islog,delete o.isdate,delete o.categories,a(o,\"domain\")&&delete o.domain,void 0!==o.autotick&&(void 0===o.tickmode&&(o.tickmode=o.autotick?\"auto\":\"linear\"),delete o.autotick)}var s=Array.isArray(t.annotations)?t.annotations.length:0;for(e=0;e<s;e++){var u=t.annotations[e];c.isPlainObject(u)&&(u.ref&&(\"paper\"===u.ref?(u.xref=\"paper\",u.yref=\"paper\"):\"data\"===u.ref&&(u.xref=\"x\",u.yref=\"y\"),delete u.ref),n(u,\"xref\"),n(u,\"yref\"))}var p=Array.isArray(t.shapes)?t.shapes.length:0;for(e=0;e<p;e++){var m=t.shapes[e];c.isPlainObject(m)&&(n(m,\"xref\"),n(m,\"yref\"))}var g=t.legend;g&&(g.x>3?(g.x=1.02,g.xanchor=\"left\"):g.x<-2&&(g.x=-.02,g.xanchor=\"right\"),g.y>3?(g.y=1.02,g.yanchor=\"bottom\"):g.y<-2&&(g.y=-.02,g.yanchor=\"top\")),\"rotate\"===t.dragmode&&(t.dragmode=\"orbit\"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var v=h.getSubplotIds(t,\"gl3d\");for(e=0;e<v.length;e++){var y=t[v[e]],b=y.cameraposition;if(Array.isArray(b)&&4===b[0].length){var x=b[0],_=b[1],w=b[2],M=l([],x),k=[];for(r=0;r<3;++r)k[r]=_[e]+w*M[2+4*r];y.camera={eye:{x:k[0],y:k[1],z:k[2]},center:{x:_[0],y:_[1],z:_[2]},up:{x:M[1],y:M[5],z:M[9]}},delete y.cameraposition}}return d.clean(t),t},r.cleanData=function(t,e){for(var n=[],o=(t.concat(Array.isArray(e)?e:[]).filter(function(t){return\"uid\"in t}).map(function(t){return t.uid})),s=0;s<t.length;s++){var l,p=t[s];if(!(\"uid\"in p)||-1!==n.indexOf(p.uid)){var m;for(l=0;l<100&&(m=c.randstr(o),-1!==n.indexOf(m));l++);p.uid=c.randstr(o),o.push(p.uid)}if(n.push(p.uid),\"histogramy\"===p.type&&\"xbins\"in p&&!(\"ybins\"in p)&&(p.ybins=p.xbins,delete p.xbins),p.error_y&&\"opacity\"in p.error_y){var g=d.defaults,v=p.error_y.color||(u.traceIs(p,\"bar\")?d.defaultLine:g[s%g.length]);p.error_y.color=d.addOpacity(d.rgb(v),d.opacity(v)*p.error_y.opacity),delete p.error_y.opacity}if(\"bardir\"in p&&(\"h\"!==p.bardir||!u.traceIs(p,\"bar\")&&\"histogram\"!==p.type.substr(0,9)||(p.orientation=\"h\",r.swapXYData(p)),delete p.bardir),\"histogramy\"===p.type&&r.swapXYData(p),\"histogramx\"!==p.type&&\"histogramy\"!==p.type||(p.type=\"histogram\"),\"scl\"in p&&(p.colorscale=p.scl,delete p.scl),\"reversescl\"in p&&(p.reversescale=p.reversescl,delete p.reversescl),p.xaxis&&(p.xaxis=f.cleanId(p.xaxis,\"x\")),p.yaxis&&(p.yaxis=f.cleanId(p.yaxis,\"y\")),u.traceIs(p,\"gl3d\")&&p.scene&&(p.scene=h.subplotsRegistry.gl3d.cleanId(p.scene)),u.traceIs(p,\"pie\")||u.traceIs(p,\"bar\")||(Array.isArray(p.textposition)?p.textposition=p.textposition.map(i):p.textposition&&(p.textposition=i(p.textposition))),u.traceIs(p,\"2dMap\")&&(\"YIGnBu\"===p.colorscale&&(p.colorscale=\"YlGnBu\"),\"YIOrRd\"===p.colorscale&&(p.colorscale=\"YlOrRd\")),u.traceIs(p,\"markerColorscale\")&&p.marker){var y=p.marker;\"YIGnBu\"===y.colorscale&&(y.colorscale=\"YlGnBu\"),\"YIOrRd\"===y.colorscale&&(y.colorscale=\"YlOrRd\")}if(\"surface\"===p.type&&c.isPlainObject(p.contours)){var b=[\"x\",\"y\",\"z\"];for(l=0;l<b.length;l++){var x=p.contours[b[l]];c.isPlainObject(x)&&(x.highlightColor&&(x.highlightcolor=x.highlightColor,delete x.highlightColor),x.highlightWidth&&(x.highlightwidth=x.highlightWidth,delete x.highlightWidth))}}if(Array.isArray(p.transforms)){var _=p.transforms;for(l=0;l<_.length;l++){var w=_[l];c.isPlainObject(w)&&(\"filter\"===w.type&&(w.filtersrc&&(w.target=w.filtersrc,delete w.filtersrc),w.calendar&&(w.valuecalendar||(w.valuecalendar=w.calendar),delete w.calendar)))}}a(p,\"line\")&&delete p.line,\"marker\"in p&&(a(p.marker,\"line\")&&delete p.marker.line,a(p,\"marker\")&&delete p.marker),d.clean(p)}},r.swapXYData=function(t){var e;if(c.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);c.swapAttrs(t,[\"error_?.copy_ystyle\"]),n&&c.swapAttrs(t,[\"error_?.color\",\"error_?.thickness\",\"error_?.width\"])}if(t.hoverinfo){var i=t.hoverinfo.split(\"+\");for(e=0;e<i.length;e++)\"x\"===i[e]?i[e]=\"y\":\"y\"===i[e]&&(i[e]=\"x\");t.hoverinfo=i.join(\"+\")}},r.coerceTraceIndices=function(t,e){return s(e)?[e]:Array.isArray(e)&&e.length?e:t.data.map(function(t,e){return e})},r.manageArrayContainers=function(t,e,r){var n=t.obj,i=t.parts,a=i.length,o=i[a-1],l=s(o);if(l&&null===e){var u=i.slice(0,a-1).join(\".\");c.nestedProperty(n,u).get().splice(o,1)}else l&&void 0===t.get()?(void 0===t.get()&&(r[t.astr]=null),t.set(e)):t.set(e)};var p=/(\\.[^\\[\\]\\.]+|\\[[^\\[\\]\\.]+\\])$/;r.hasParent=function(t,e){for(var r=o(e);r;){if(r in t)return!0;r=o(r)}return!1}},{\"../components/color\":578,\"../lib\":685,\"../plots/cartesian/axes\":724,\"../plots/plots\":787,\"../registry\":802,\"fast-isnumeric\":116,\"gl-mat4/fromQuat\":162}],710:[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(\"../registry\");r.containerArrayMatch=t(\"./container_array_match\");var l=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 c=e.astr,h=s.getComponentMethod(c,\"supplyLayoutDefaults\"),f=s.getComponentMethod(c,\"draw\"),d=s.getComponentMethod(c,\"drawOne\"),p=i.replot||i.recalc||h===a||f===a,m=t.layout,g=t._fullLayout;if(r[\"\"]){Object.keys(r).length>1&&o.warn(\"Full array edits are incompatible with other edits\",c);var v=r[\"\"][\"\"];if(u(v))e.set(null);else{if(!Array.isArray(v))return o.warn(\"Unrecognized full array edit value\",c,v),!0;e.set(v)}return!p&&(h(m,g),f(t),!0)}var y,b,x,_,w,M,k,A=Object.keys(r).map(Number).sort(),T=e.get(),S=T||[],E=n(g,c).get(),L=[],C=-1,z=S.length;for(y=0;y<A.length;y++)if(x=A[y],_=r[x],w=Object.keys(_),M=_[\"\"],k=l(M),x<0||x>S.length-(k?0:1))o.warn(\"index out of range\",c,x);else if(void 0!==M)w.length>1&&o.warn(\"Insertion & removal are incompatible with edits to the same index.\",c,x),u(M)?L.push(x):k?(\"add\"===M&&(M={}),S.splice(x,0,M),E&&E.splice(x,0,{})):o.warn(\"Unrecognized full object edit value\",c,x,M),-1===C&&(C=x);else for(b=0;b<w.length;b++)n(S[x],w[b]).set(_[w[b]]);for(y=L.length-1;y>=0;y--)S.splice(L[y],1),E&&E.splice(L[y],1);if(S.length?T||e.set(S):e.set(null),p)return!1;if(h(m,g),d!==a){var D;if(-1===C)D=A;else{for(z=Math.max(S.length,z),D=[],y=0;y<A.length&&!((x=A[y])>=C);y++)D.push(x);for(y=C;y<z;y++)D.push(y)}for(y=0;y<D.length;y++)d(t,D[y])}else f(t);return!0}},{\"../lib/is_plain_object\":687,\"../lib/loggers\":688,\"../lib/nested_property\":691,\"../lib/noop\":692,\"../registry\":802,\"./container_array_match\":708}],711:[function(t,e,r){\"use strict\";function n(t,e){t._fullLayout._paperdiv.style(\"background\",\"white\"),y.defaultConfig.setBackground(t,e)}function i(t,e){t._context||(t._context=b.extendFlat({},y.defaultConfig));var r=t._context;e&&(Object.keys(e).forEach(function(t){t in r&&(\"setBackground\"===t&&\"opaque\"===e[t]?r[t]=n:r[t]=e[t])}),e.plot3dPixelRatio&&!r.plotGlPixelRatio&&(r.plotGlPixelRatio=r.plot3dPixelRatio)),r.staticPlot&&(r.editable=!1,r.autosizable=!1,r.scrollZoom=!1,r.doubleClick=!1,r.showTips=!1,r.showLink=!1,r.displayModeBar=!1)}function a(t,e,r){var n=g.select(t).selectAll(\".plot-container\").data([0]);n.enter().insert(\"div\",\":first-child\").classed(\"plot-container plotly\",!0);var i=n.selectAll(\".svg-container\").data([0]);i.enter().append(\"div\").classed(\"svg-container\",!0).style(\"position\",\"relative\"),i.html(\"\"),e&&(t.data=e),r&&(t.layout=r),A.manager.fillLayout(t),i.style({width:t._fullLayout.width+\"px\",height:t._fullLayout.height+\"px\"}),t.framework=A.manager.framework(t),t.framework({data:t.data,layout:t.layout},i.node()),t.framework.setUndoPoint();var a=t.framework.svg(),o=1,s=t._fullLayout.title;\"\"!==s&&s||(o=0);var l=function(){this.call(L.convertToTspans)},u=a.select(\".title-group text\").call(l);if(t._context.editable){u.attr({\"data-unformatted\":s}),s&&\"Click to enter title\"!==s||(o=.2,u.attr({\"data-unformatted\":\"Click to enter title\"}).text(\"Click to enter title\").style({opacity:o}).on(\"mouseover.opacity\",function(){g.select(this).transition().duration(100).style(\"opacity\",1)}).on(\"mouseout.opacity\",function(){g.select(this).transition().duration(1e3).style(\"opacity\",0)}));var c=function(){this.call(L.makeEditable).on(\"edit\",function(e){t.framework({layout:{title:e}}),this.attr({\"data-unformatted\":e}).text(e).call(l),this.call(c)}).on(\"cancel\",function(){var t=this.attr(\"data-unformatted\");this.text(t).call(l)})};u.call(c)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),M.addLinks(t),Promise.resolve()}function o(t,e){var r,n,i=e+1,a=[];for(r=0;r<t.length;r++)(n=t[r])<0?a.push(i+n):a.push(n);return a}function s(t,e,r){var n,i;for(n=0;n<e.length;n++){if((i=e[n])!==parseInt(i,10))throw new Error(\"all values in \"+r+\" must be integers\");if(i>=t.data.length||i<-t.data.length)throw new Error(r+\" must be valid indices for gd.data.\");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error(\"each index in \"+r+\" must be unique.\")}}function l(t,e,r){if(!Array.isArray(t.data))throw new Error(\"gd.data must be an array.\");if(void 0===e)throw new Error(\"currentIndices is a required argument.\");if(Array.isArray(e)||(e=[e]),s(t,e,\"currentIndices\"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&s(t,r,\"newIndices\"),void 0!==r&&e.length!==r.length)throw new Error(\"current and new indices must be of equal length.\")}function u(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error(\"gd.data must be an array.\");if(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\")}function c(t,e,r,n){var i=b.isPlainObject(n);if(!Array.isArray(t.data))throw new Error(\"gd.data must be an array\");if(!b.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\");s(t,r,\"indices\");for(var a in e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error(\"attribute \"+a+\" must be an array of length equal to indices array length\");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error(\"when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object\")}}function h(t,e,r,n){var i,a,s,l,u,c=b.isPlainObject(n),h=[];Array.isArray(r)||(r=[r]),r=o(r,t.data.length-1);for(var f in e)for(var d=0;d<r.length;d++){if(i=t.data[r[d]],s=b.nestedProperty(i,f),a=s.get(),l=e[f][d],!Array.isArray(l))throw new Error(\"attribute: \"+f+\" index: \"+d+\" must be an array\");if(!Array.isArray(a))throw new Error(\"cannot extend missing or non-array attribute: \"+f);u=c?n[f][d]:n,v(u)||(u=-1),h.push({prop:s,target:a,insert:l,maxp:Math.floor(u)})}return h}function f(t,e,r,n,i,a){c(t,e,r,n);for(var o,s,l,u=h(t,e,r,n),f=[],d={},p={},m=0;m<u.length;m++)s=u[m].prop,l=u[m].maxp,o=i(u[m].target,u[m].insert),l>=0&&l<o.length&&(f=a(o,l)),l=u[m].target.length,s.set(o),Array.isArray(d[s.astr])||(d[s.astr]=[]),Array.isArray(p[s.astr])||(p[s.astr]=[]),d[s.astr].push(f),p[s.astr].push(l);return{update:d,maxPoints:p}}function d(t,e,r){function n(){return d.map(function(){})}function i(t){var e=y.Axes.id2name(t);-1===u.indexOf(e)&&u.push(e)}function a(t){return\"LAYOUT\"+t+\".autorange\"}function o(t){return\"LAYOUT\"+t+\".range\"}function s(r,i,a){if(Array.isArray(r))r.forEach(function(t){s(t,i,a)});else if(!(r in e||z.hasParent(e,r))){var o;o=\"LAYOUT\"===r.substr(0,6)?b.nestedProperty(t.layout,r.replace(\"LAYOUT\",\"\")):b.nestedProperty(f[d[a]],r),r in g||(g[r]=n()),void 0===g[r][a]&&(g[r][a]=o.get()),void 0!==i&&o.set(i)}}var l,u,c=t._fullLayout,h=t._fullData,f=t.data,d=z.coerceTraceIndices(t,r),p={docalc:!1,docalcAutorange:!1,doplot:!1,dostyle:!1,docolorbars:!1,autorangeOn:!1,clearCalc:!1,fullReplot:!1},m={},g={},v={},x=[\"mode\",\"visible\",\"type\",\"orientation\",\"fill\",\"histfunc\",\"histnorm\",\"text\",\"x\",\"y\",\"z\",\"a\",\"b\",\"c\",\"open\",\"high\",\"low\",\"close\",\"base\",\"width\",\"offset\",\"xtype\",\"x0\",\"dx\",\"ytype\",\"y0\",\"dy\",\"xaxis\",\"yaxis\",\"line.width\",\"connectgaps\",\"transpose\",\"zsmooth\",\"showscale\",\"marker.showscale\",\"zauto\",\"marker.cauto\",\"autocolorscale\",\"marker.autocolorscale\",\"colorscale\",\"marker.colorscale\",\"reversescale\",\"marker.reversescale\",\"autobinx\",\"nbinsx\",\"xbins\",\"xbins.start\",\"xbins.end\",\"xbins.size\",\"autobiny\",\"nbinsy\",\"ybins\",\"ybins.start\",\"ybins.end\",\"ybins.size\",\"autocontour\",\"ncontours\",\"contours\",\"contours.coloring\",\"contours.operation\",\"contours.value\",\"contours.type\",\"contours.value[0]\",\"contours.value[1]\",\"error_y\",\"error_y.visible\",\"error_y.value\",\"error_y.type\",\"error_y.traceref\",\"error_y.array\",\"error_y.symmetric\",\"error_y.arrayminus\",\"error_y.valueminus\",\"error_y.tracerefminus\",\"error_x\",\"error_x.visible\",\"error_x.value\",\"error_x.type\",\"error_x.traceref\",\"error_x.array\",\"error_x.symmetric\",\"error_x.arrayminus\",\"error_x.valueminus\",\"error_x.tracerefminus\",\"swapxy\",\"swapxyaxes\",\"orientationaxes\",\"marker.colors\",\"values\",\"labels\",\"label0\",\"dlabel\",\"sort\",\"textinfo\",\"textposition\",\"textfont.size\",\"textfont.family\",\"textfont.color\",\"insidetextfont.size\",\"insidetextfont.family\",\"insidetextfont.color\",\"outsidetextfont.size\",\"outsidetextfont.family\",\"outsidetextfont.color\",\"hole\",\"scalegroup\",\"domain\",\"domain.x\",\"domain.y\",\"domain.x[0]\",\"domain.x[1]\",\"domain.y[0]\",\"domain.y[1]\",\"tilt\",\"tiltaxis\",\"depth\",\"direction\",\"rotation\",\"pull\",\"line.showscale\",\"line.cauto\",\"line.autocolorscale\",\"line.reversescale\",\"marker.line.showscale\",\"marker.line.cauto\",\"marker.line.autocolorscale\",\"marker.line.reversescale\",\"xcalendar\",\"ycalendar\",\"cumulative\",\"cumulative.enabled\",\"cumulative.direction\",\"cumulative.currentbin\",\"a0\",\"da\",\"b0\",\"db\",\"atype\",\"btype\",\"cheaterslope\",\"carpet\",\"sum\"],_=[\"color\",\"smoothing\",\"title\",\"titlefont\",\"titlefont.size\",\"titlefont.family\",\"titlefont.color\",\"titleoffset\",\"type\",\"autorange\",\"rangemode\",\"range\",\"fixedrange\",\"cheatertype\",\"tickmode\",\"nticks\",\"tickvals\",\"ticktext\",\"ticks\",\"mirror\",\"ticklen\",\"tickwidth\",\"tickcolor\",\"showticklabels\",\"tickfont\",\"tickfont.size\",\"tickfont.family\",\"tickfont.color\",\"tickprefix\",\"showtickprefix\",\"ticksuffix\",\"showticksuffix\",\"showexponent\",\"exponentformat\",\"separatethousands\",\"tickformat\",\"categoryorder\",\"categoryarray\",\"labelpadding\",\"labelprefix\",\"labelsuffix\",\"labelfont\",\"labelfont.family\",\"labelfont.size\",\"labelfont.color\",\"showline\",\"linecolor\",\"linewidth\",\"gridcolor\",\"gridwidth\",\"showgrid\",\"minorgridcount\",\"minorgridwidth\",\"minorgridcolor\",\"startline\",\"startlinecolor\",\"startlinewidth\",\"endline\",\"endlinewidth\",\"endlinecolor\",\"tick0\",\"dtick\",\"arraytick0\",\"arraydtick\",\"hoverformat\",\"tickangle\"];for(l=0;l<_.length;l++)x.push(\"aaxis.\"+_[l]),x.push(\"baxis.\"+_[l]);for(l=0;l<d.length;l++)if(w.traceIs(h[d[l]],\"box\")){x.push(\"name\");break}var k=[\"marker\",\"marker.size\",\"textfont\",\"boxpoints\",\"jitter\",\"pointpos\",\"whiskerwidth\",\"boxmean\",\"tickwidth\"],A=[\"zmin\",\"zmax\",\"zauto\",\"xgap\",\"ygap\",\"marker.cmin\",\"marker.cmax\",\"marker.cauto\",\"line.cmin\",\"line.cmax\",\"marker.line.cmin\",\"marker.line.cmax\",\"contours.start\",\"contours.end\",\"contours.size\",\"contours.showlines\",\"line\",\"line.smoothing\",\"line.shape\",\"error_y.width\",\"error_x.width\",\"error_x.copy_ystyle\",\"marker.maxdisplayed\"],T=[\"type\",\"x\",\"y\",\"x0\",\"y0\",\"orientation\",\"xaxis\",\"yaxis\"],S=[\"zmin\",\"zmax\"],E=[\"xbins.start\",\"xbins.end\",\"xbins.size\"],L=[\"ybins.start\",\"ybins.end\",\"ybins.size\"],C=[\"contours.start\",\"contours.end\",\"contours.size\"],D=[\"cartesian\",\"pie\",\"ternary\"];c._basePlotModules.forEach(function(t){-1===D.indexOf(t.name)&&(p.docalc=!0)});for(var I in e){if(z.hasParent(e,I))throw new Error(\"cannot set \"+I+\"and a parent attribute simultaneously\");var P,O,j,R,F,N=e[I];if(m[I]=N,\"LAYOUT\"!==I.substr(0,6)){for(g[I]=n(),l=0;l<d.length;l++)if(P=f[d[l]],O=h[d[l]],j=b.nestedProperty(P,I),R=j.get(),void 0!==(F=Array.isArray(N)?N[l%N.length]:N)){if(-1!==S.indexOf(I))s(\"zauto\",!1,l);else if(\"colorscale\"===I)s(\"autocolorscale\",!1,l);else if(\"autocolorscale\"===I)s(\"colorscale\",void 0,l);else if(\"marker.colorscale\"===I)s(\"marker.autocolorscale\",!1,l);else if(\"marker.autocolorscale\"===I)s(\"marker.colorscale\",void 0,l);else if(\"zauto\"===I)s(S,void 0,l);else if(-1!==E.indexOf(I))s(\"autobinx\",!1,l);else if(\"autobinx\"===I)s(E,void 0,l);else if(-1!==L.indexOf(I))s(\"autobiny\",!1,l);else if(\"autobiny\"===I)s(L,void 0,l);else if(-1!==C.indexOf(I))s(\"autocontour\",!1,l);else if(\"autocontour\"===I)s(C,void 0,l);else if(-1!==[\"x0\",\"dx\"].indexOf(I)&&O.x&&\"scaled\"!==O.xtype)s(\"xtype\",\"scaled\",l);else if(-1!==[\"y0\",\"dy\"].indexOf(I)&&O.y&&\"scaled\"!==O.ytype)s(\"ytype\",\"scaled\",l);else if(\"colorbar.thicknessmode\"===I&&j.get()!==F&&-1!==[\"fraction\",\"pixels\"].indexOf(F)&&O.colorbar){var B=-1!==[\"top\",\"bottom\"].indexOf(O.colorbar.orient)?c.height-c.margin.t-c.margin.b:c.width-c.margin.l-c.margin.r;s(\"colorbar.thickness\",O.colorbar.thickness*(\"fraction\"===F?1/B:B),l)}else if(\"colorbar.lenmode\"===I&&j.get()!==F&&-1!==[\"fraction\",\"pixels\"].indexOf(F)&&O.colorbar){var U=-1!==[\"top\",\"bottom\"].indexOf(O.colorbar.orient)?c.width-c.margin.l-c.margin.r:c.height-c.margin.t-c.margin.b;s(\"colorbar.len\",O.colorbar.len*(\"fraction\"===F?1/U:U),l)}else\"colorbar.tick0\"===I||\"colorbar.dtick\"===I?s(\"colorbar.tickmode\",\"linear\",l):\"colorbar.tickmode\"===I&&s([\"colorbar.tick0\",\"colorbar.dtick\"],void 0,l);if(\"type\"===I&&\"pie\"===F!=(\"pie\"===R)){var V=\"x\",H=\"y\";\"bar\"!==F&&\"bar\"!==R||\"h\"!==P.orientation||(V=\"y\",H=\"x\"),b.swapAttrs(P,[\"?\",\"?src\"],\"labels\",V),b.swapAttrs(P,[\"d?\",\"?0\"],\"label\",V),b.swapAttrs(P,[\"?\",\"?src\"],\"values\",H),\"pie\"===R?(b.nestedProperty(P,\"marker.color\").set(b.nestedProperty(P,\"marker.colors\").get()),c._pielayer.selectAll(\"g.trace\").remove()):w.traceIs(P,\"cartesian\")&&(b.nestedProperty(P,\"marker.colors\").set(b.nestedProperty(P,\"marker.color\").get()),v[P.xaxis||\"x\"]=!0,v[P.yaxis||\"y\"]=!0)}if(g[I][l]=R,-1!==[\"swapxy\",\"swapxyaxes\",\"orientation\",\"orientationaxes\"].indexOf(I)){if(\"orientation\"===I){if(j.set(F),j.get()===g[I][l])continue}else\"orientationaxes\"===I&&(P.orientation={v:\"h\",h:\"v\"}[O.orientation]);z.swapXYData(P)}else if(-1!==M.dataArrayContainers.indexOf(j.parts[0]))z.manageArrayContainers(j,F,g),p.docalc=!0;else{var q=(O._module||{}).attributes||{},G=b.nestedProperty(q,I).get()||{};G.valType||(p.docalc=!0),G.arrayOk&&(Array.isArray(F)||Array.isArray(R))&&(p.docalc=!0),j.set(F)}}if(-1!==[\"swapxyaxes\",\"orientationaxes\"].indexOf(I)&&y.Axes.swap(t,d),\"orientationaxes\"===I){var Y=b.nestedProperty(t.layout,\"hovermode\");\"x\"===Y.get()?Y.set(\"y\"):\"y\"===Y.get()&&Y.set(\"x\")}-1!==d.indexOf(0)&&-1!==T.indexOf(I)&&(y.Axes.clearTypes(t,d),p.docalc=!0),-1!==[\"autobinx\",\"autobiny\",\"zauto\"].indexOf(I)&&!1===F||(p.dostyle=!0),(-1!==[\"colorbar\",\"line\"].indexOf(j.parts[0])||\"marker\"===j.parts[0]&&\"colorbar\"===j.parts[1])&&(p.docolorbars=!0);var W=I.indexOf(\"[\"),X=-1===W?I:I.substr(0,W);if(-1!==x.indexOf(X)){if(-1!==[\"orientation\",\"type\"].indexOf(I)){for(u=[],l=0;l<d.length;l++){var Z=f[d[l]];w.traceIs(Z,\"cartesian\")&&(i(Z.xaxis||\"x\"),i(Z.yaxis||\"y\"),\"type\"===I&&s([\"autobinx\",\"autobiny\"],!0,l))}s(u.map(a),!0,0),s(u.map(o),[0,1],0)}p.docalc=!0}else-1!==A.indexOf(X)?p.doplot=!0:0===X.indexOf(\"aaxis\")||0===X.indexOf(\"baxis\")?p.doplot=!0:-1!==k.indexOf(X)&&(p.docalcAutorange=!0)}else j=b.nestedProperty(t.layout,I.replace(\"LAYOUT\",\"\")),g[I]=[j.get()],j.set(Array.isArray(N)?N[0]:N),p.docalc=!0}y.Axes.list(t).forEach(function(t){t.autorange&&(p.autorangeOn=!0)});var J=Object.keys(v);t:for(l=0;l<J.length;l++){for(var Q=J[l],K=Q.charAt(0),$=K+\"axis\",tt=0;tt<f.length;tt++)if(w.traceIs(f[tt],\"cartesian\")&&(f[tt][$]||K)===Q)continue t;s(\"LAYOUT\"+y.Axes.id2name(Q),null,0)}return(p.docalc||p.docalcAutorange&&p.autorangeOn)&&(p.clearCalc=!0),(p.docalc||p.doplot||p.docalcAutorange)&&(p.fullReplot=!0),{flags:p,undoit:g,redoit:m,traces:d,eventData:b.extendDeepNoArrays([],[m,d])}}function p(t,e){function r(t,n){if(Array.isArray(t))t.forEach(function(t){r(t,n)});else if(!(t in e||z.hasParent(e,t))){var i=b.nestedProperty(l,t);t in x||(x[t]=i.get()),void 0!==n&&i.set(n)}}function n(e,r){if(!b.isPlainObject(e))return!1;var n=e[r+\"ref\"]||r,i=y.Axes.getFromId(t,n);return i||n.charAt(0)!==r||(i=y.Axes.getFromId(t,r)),(i||{}).autorange}function i(t){var e=O.name2id(t.split(\".\")[0]);_[e]=1}var a,o,s,l=t.layout,u=t._fullLayout,c=Object.keys(e),h=y.Axes.list(t),f={};for(o=0;o<c.length;o++)if(0===c[o].indexOf(\"allaxes\")){for(s=0;s<h.length;s++){var d=h[s]._id.substr(1),p=-1!==d.indexOf(\"scene\")?d+\".\":\"\",m=c[o].replace(\"allaxes\",p+h[s]._name);e[m]||(e[m]=e[c[o]])}delete e[c[o]]}var g={dolegend:!1,doticks:!1,dolayoutstyle:!1,doplot:!1,docalc:!1,domodebar:!1,docamera:!1,layoutReplot:!1},v={},x={},_={};for(var k in e){if(z.hasParent(e,k))throw new Error(\"cannot set \"+k+\"and a parent attribute simultaneously\");var A=b.nestedProperty(l,k),T=e[k],S=A.parts.length,E=\"string\"==typeof A.parts[S-1]?S-1:S-2,L=A.parts[0],D=A.parts[E],P=A.parts[E-1]+\".\"+D,j=A.parts.slice(0,E).join(\".\"),R=b.nestedProperty(t.layout,j).get(),F=b.nestedProperty(u,j).get();if(void 0!==T){if(v[k]=T,x[k]=\"reverse\"===D?T:A.get(),-1!==[\"width\",\"height\"].indexOf(k)&&null===T?u[k]=t._initialAutoSize[k]:P.match(/^[xyz]axis[0-9]*\\.range(\\[[0|1]\\])?$/)?(r(j+\".autorange\",!1),i(P)):P.match(/^[xyz]axis[0-9]*\\.autorange$/)?(r([j+\".range[0]\",j+\".range[1]\"],void 0),i(P)):P.match(/^aspectratio\\.[xyz]$/)?r(L+\".aspectmode\",\"manual\"):P.match(/^aspectmode$/)?r([j+\".x\",j+\".y\",j+\".z\"],void 0):\"tick0\"===D||\"dtick\"===D?r(j+\".tickmode\",\"linear\"):\"tickmode\"===D?r([j+\".tick0\",j+\".dtick\"],void 0):/[xy]axis[0-9]*?$/.test(D)&&!Object.keys(T||{}).length?g.docalc=!0:/[xy]axis[0-9]*\\.categoryorder$/.test(P)?g.docalc=!0:/[xy]axis[0-9]*\\.categoryarray/.test(P)&&(g.docalc=!0),-1!==P.indexOf(\"rangeslider\")&&(g.docalc=!0),\"type\"===D){var N=R,B=\"linear\"===F.type&&\"log\"===T,U=\"log\"===F.type&&\"linear\"===T;if(B||U){if(N&&N.range)if(F.autorange)B&&(N.range=N.range[1]>N.range[0]?[1,2]:[2,1]);else{var V=N.range[0],H=N.range[1];B?(V<=0&&H<=0&&r(j+\".autorange\",!0),V<=0?V=H/1e6:H<=0&&(H=V/1e6),r(j+\".range[0]\",Math.log(V)/Math.LN10),r(j+\".range[1]\",Math.log(H)/Math.LN10)):(r(j+\".range[0]\",Math.pow(10,V)),r(j+\".range[1]\",Math.pow(10,H)))}else r(j+\".autorange\",!0);w.getComponentMethod(\"annotations\",\"convertCoords\")(t,F,T,r),w.getComponentMethod(\"images\",\"convertCoords\")(t,F,T,r)}else r(j+\".autorange\",!0)}else if(D.match(I.AX_NAME_PATTERN)){var q=b.nestedProperty(u,k).get(),G=(T||{}).type;G&&\"-\"!==G||(G=\"linear\"),w.getComponentMethod(\"annotations\",\"convertCoords\")(t,q,G,r),w.getComponentMethod(\"images\",\"convertCoords\")(t,q,G,r)}var Y=C.containerArrayMatch(k);if(Y){a=Y.array,o=Y.index;var W=Y.property,X=(b.nestedProperty(l,a)||[])[o]||{};if(\"\"===o)-1===k.indexOf(\"updatemenus\")&&(g.docalc=!0);else if(\"\"===W){var Z=T;C.isAddVal(T)?x[k]=null:C.isRemoveVal(T)?(x[k]=X,Z=X):b.warn(\"unrecognized full object value\",e),(n(Z,\"x\")||n(Z,\"y\")&&-1===k.indexOf(\"updatemenus\"))&&(g.docalc=!0)}else!n(X,\"x\")&&!n(X,\"y\")||b.containsAny(k,[\"color\",\"opacity\",\"align\",\"dash\",\"updatemenus\"])||(g.docalc=!0);f[a]||(f[a]={});var J=f[a][o];J||(J=f[a][o]={}),J[W]=T,delete e[k]}else if(\"reverse\"===D)R.range?R.range.reverse():(r(j+\".autorange\",!0),R.range=[1,0]),F.autorange?g.docalc=!0:g.doplot=!0;else{var Q=String(A.parts[1]||\"\");0===L.indexOf(\"scene\")?\"camera\"===A.parts[1]?g.docamera=!0:g.doplot=!0:0===L.indexOf(\"geo\")?g.doplot=!0:0===L.indexOf(\"ternary\")?g.doplot=!0:\"paper_bgcolor\"===k?g.doplot=!0:\"margin\"===L||\"autorange\"===Q||\"rangemode\"===Q||\"type\"===Q||\"domain\"===Q||\"fixedrange\"===Q||\"scaleanchor\"===Q||\"scaleratio\"===Q||-1!==k.indexOf(\"calendar\")||k.match(/^(bar|box|font)/)?g.docalc=!0:!u._has(\"gl2d\")||-1===k.indexOf(\"axis\")&&\"plot_bgcolor\"!==k?\"hiddenlabels\"===k?g.docalc=!0:-1!==L.indexOf(\"legend\")?g.dolegend=!0:-1!==k.indexOf(\"title\")?g.doticks=!0:-1!==L.indexOf(\"bgcolor\")?g.dolayoutstyle=!0:S>1&&b.containsAny(Q,[\"tick\",\"exponent\",\"grid\",\"zeroline\"])?g.doticks=!0:-1!==k.indexOf(\".linewidth\")&&-1!==k.indexOf(\"axis\")?g.doticks=g.dolayoutstyle=!0:S>1&&-1!==Q.indexOf(\"line\")?g.dolayoutstyle=!0:S>1&&\"mirror\"===Q?g.doticks=g.dolayoutstyle=!0:\"margin.pad\"===k?g.doticks=g.dolayoutstyle=!0:-1!==[\"hovermode\",\"dragmode\"].indexOf(k)||-1!==k.indexOf(\"spike\")?g.domodebar=!0:-1===[\"height\",\"width\",\"autosize\"].indexOf(k)&&(g.doplot=!0):g.doplot=!0,A.set(T)}}}for(a in f)C.applyContainerArrayChanges(t,b.nestedProperty(l,a),f[a],g)||(g.doplot=!0);var K=u._axisConstraintGroups;for(var $ in _)for(o=0;o<K.length;o++){var tt=K[o];if(tt[$]){g.docalc=!0;for(var et in tt)_[et]||(O.getFromId(t,et)._constraintShrinkable=!0)}}var rt=u.width,nt=u.height;return t.layout.autosize&&M.plotAutoSize(t,t.layout,u),(e.height||e.width||u.width!==rt||u.height!==nt)&&(g.docalc=!0),(g.doplot||g.docalc)&&(g.layoutReplot=!0),{flags:g,undoit:x,redoit:v,eventData:b.extendDeep({},v)}}function m(t){var e=g.select(t),r=t._fullLayout;if(r._container=e.selectAll(\".plot-container\").data([0]),r._container.enter().insert(\"div\",\":first-child\").classed(\"plot-container\",!0).classed(\"plotly\",!0),r._paperdiv=r._container.selectAll(\".svg-container\").data([0]),r._paperdiv.enter().append(\"div\").classed(\"svg-container\",!0).style(\"position\",\"relative\"),r._glcontainer=r._paperdiv.selectAll(\".gl-container\").data([0]),r._glcontainer.enter().append(\"div\").classed(\"gl-container\",!0),r._paperdiv.selectAll(\".main-svg\").remove(),r._paper=r._paperdiv.insert(\"svg\",\":first-child\").classed(\"main-svg\",!0),r._toppaper=r._paperdiv.append(\"svg\").classed(\"main-svg\",!0),!r._uid){var n=[];g.selectAll(\"defs\").each(function(){this.id&&n.push(this.id.split(\"-\")[1])}),r._uid=b.randstr(n)}r._paperdiv.selectAll(\".main-svg\").attr(E.svgAttrs),r._defs=r._paper.append(\"defs\").attr(\"id\",\"defs-\"+r._uid),r._topdefs=r._toppaper.append(\"defs\").attr(\"id\",\"topdefs-\"+r._uid),r._bgLayer=r._paper.append(\"g\").classed(\"bglayer\",!0),r._draggers=r._paper.append(\"g\").classed(\"draglayer\",!0);var i=r._paper.append(\"g\").classed(\"layer-below\",!0);r._imageLowerLayer=i.append(\"g\").classed(\"imagelayer\",!0),r._shapeLowerLayer=i.append(\"g\").classed(\"shapelayer\",!0),r._cartesianlayer=r._paper.append(\"g\").classed(\"cartesianlayer\",!0),r._ternarylayer=r._paper.append(\"g\").classed(\"ternarylayer\",!0),r._geolayer=r._paper.append(\"g\").classed(\"geolayer\",!0);var a=r._paper.append(\"g\").classed(\"layer-above\",!0);r._imageUpperLayer=a.append(\"g\").classed(\"imagelayer\",!0),r._shapeUpperLayer=a.append(\"g\").classed(\"shapelayer\",!0),r._pielayer=r._paper.append(\"g\").classed(\"pielayer\",!0),r._glimages=r._paper.append(\"g\").classed(\"glimages\",!0),r._infolayer=r._toppaper.append(\"g\").classed(\"infolayer\",!0),r._zoomlayer=r._toppaper.append(\"g\").classed(\"zoomlayer\",!0),r._hoverlayer=r._toppaper.append(\"g\").classed(\"hoverlayer\",!0),t.emit(\"plotly_framework\")}var g=t(\"d3\"),v=t(\"fast-isnumeric\"),y=t(\"../plotly\"),b=t(\"../lib\"),x=t(\"../lib/events\"),_=t(\"../lib/queue\"),w=t(\"../registry\"),M=t(\"../plots/plots\"),k=t(\"../plots/cartesian/graph_interact\"),A=t(\"../plots/polar\"),T=t(\"../components/drawing\"),S=t(\"../components/errorbars\"),E=t(\"../constants/xmlns_namespaces\"),L=t(\"../lib/svg_text_utils\"),C=t(\"./manage_arrays\"),z=t(\"./helpers\"),D=t(\"./subroutines\"),I=t(\"../plots/cartesian/constants\"),P=t(\"../plots/cartesian/constraints\"),O=t(\"../plots/cartesian/axis_ids\");y.plot=function(t,e,r,n){function o(){if(v)return y.addFrames(t,v)}function s(){for(var e=E._basePlotModules,r=0;r<e.length;r++)e[r].drawFramework&&e[r].drawFramework(t);return b.syncOrAsync([D.layoutStyles,f,k.init],t)}function l(){var e,r,n,i=t.calcdata;for(w.getComponentMethod(\"legend\",\"draw\")(t),w.getComponentMethod(\"rangeselector\",\"draw\")(t),w.getComponentMethod(\"sliders\",\"draw\")(t),w.getComponentMethod(\"updatemenus\",\"draw\")(t),e=0;e<i.length;e++)!0===(n=(r=i[e])[0].trace).visible&&n._module.colorbar?n._module.colorbar(t,r):M.autoMargin(t,\"cb\"+n.uid);return M.doAutoMargin(t),M.previousPromises(t)}function u(){var e=JSON.stringify(E._size)===I?[]:[l,D.layoutStyles];return e=e.concat(k.init),b.syncOrAsync(e,t)}function c(){if(L){for(var e,r,n=M.getSubplotIds(E,\"cartesian\"),i=E._modules,a=0;a<n.length;a++){e=E._plots[n[a]];for(var o=0;o<i.length;o++)(r=i[o]).setPositions&&r.setPositions(t,e)}return S.calc(t),b.syncOrAsync([w.getComponentMethod(\"shapes\",\"calcAutorange\"),w.getComponentMethod(\"annotations\",\"calcAutorange\"),h,w.getComponentMethod(\"rangeslider\",\"calcAutorange\")],t)}}function h(){if(!t._transitioning){for(var e=y.Axes.list(t,\"\",!0),r=0;r<e.length;r++)y.Axes.doAutoRange(e[r]);P(t),A&&y.Axes.saveRangeInitial(t)}}function f(){return y.Axes.doTicks(t,\"redraw\")}function d(){var e,r=t.calcdata;for(e=0;e<r.length;e++){var n=r[e][0].trace,i=!0===n.visible,a=n.uid;if(!i||!w.traceIs(n,\"2dMap\")){var o=\".hm\"+a+\",.contour\"+a+\",#clip\"+a;E._paper.selectAll(o).remove(),E._infolayer.selectAll(\"g.rangeslider-container\").selectAll(o).remove()}i&&n._module.colorbar||E._infolayer.selectAll(\".cb\"+a).remove()}var s=E._basePlotModules;for(e=0;e<s.length;e++)s[e].plot(t);var l=E._paper.selectAll(\".layer-subplot\");return E._shapeSubplotLayers=l.selectAll(\".shapelayer\"),M.style(t),w.getComponentMethod(\"shapes\",\"draw\")(t),w.getComponentMethod(\"annotations\",\"draw\")(t),M.addLinks(t),E._replotting=!1,M.previousPromises(t)}function p(){w.getComponentMethod(\"shapes\",\"draw\")(t),w.getComponentMethod(\"images\",\"draw\")(t),w.getComponentMethod(\"annotations\",\"draw\")(t),w.getComponentMethod(\"legend\",\"draw\")(t),w.getComponentMethod(\"rangeslider\",\"draw\")(t),w.getComponentMethod(\"rangeselector\",\"draw\")(t),w.getComponentMethod(\"sliders\",\"draw\")(t),w.getComponentMethod(\"updatemenus\",\"draw\")(t)}var v;if(t=z.getGraphDiv(t),x.init(t),b.isPlainObject(e)){var _=e;e=_.data,r=_.layout,n=_.config,v=_.frames}if(!1===x.triggerHandler(t,\"plotly_beforeplot\",[e,r,n]))return Promise.reject();e||r||b.isPlotDiv(t)||b.warn(\"Calling Plotly.plot as if redrawing but this container doesn't yet have a plot.\",t),i(t,n),r||(r={}),g.select(t).classed(\"js-plotly-plot\",!0),T.makeTester(t),t._promises=[];var A=0===(t.data||[]).length&&Array.isArray(e);if(Array.isArray(e)&&(z.cleanData(e,t.data),A?t.data=e:t.data.push.apply(t.data,e),t.empty=!1),t.layout&&!A||(t.layout=z.cleanLayout(r)),t._dragging&&!t._transitioning)return t._replotPending=!0,Promise.reject();t._replotPending=!1,M.supplyDefaults(t);var E=t._fullLayout;if(e&&e[0]&&e[0].r)return a(t,e,r);E._replotting=!0,A&&m(t),t.framework!==m&&(t.framework=m,m(t)),A&&y.Axes.saveShowSpikeInitial(t);var L=!t.calcdata||t.calcdata.length!==(t._fullData||[]).length;L&&M.doCalcdata(t);for(var C=0;C<t.calcdata.length;C++)t.calcdata[C][0].trace=t._fullData[C];var I=JSON.stringify(E._size),O=[M.previousPromises,o,s,l,u,c,D.layoutStyles,f,d,p,M.rehover];return b.syncOrAsync(O,t),Promise.all(t._promises).then(function(){return t.emit(\"plotly_afterplot\"),t})},y.redraw=function(t){if(t=z.getGraphDiv(t),!b.isPlotDiv(t))throw new Error(\"This element is not a Plotly plot: \"+t);return z.cleanData(t.data,t.data),z.cleanLayout(t.layout),t.calcdata=void 0,y.plot(t).then(function(){return t.emit(\"plotly_redraw\"),t})},y.newPlot=function(t,e,r,n){return t=z.getGraphDiv(t),M.cleanPlot([],{},t._fullData||{},t._fullLayout||{}),M.purge(t),y.plot(t,e,r,n)},y.extendTraces=function t(e,r,n,i){var a=f(e=z.getGraphDiv(e),r,n,i,function(t,e){return t.concat(e)},function(t,e){return t.splice(0,t.length-e)}),o=y.redraw(e),s=[e,a.update,n,a.maxPoints];return _.add(e,y.prependTraces,s,t,arguments),o},y.prependTraces=function t(e,r,n,i){var a=f(e=z.getGraphDiv(e),r,n,i,function(t,e){return e.concat(t)},function(t,e){return t.splice(e,t.length)}),o=y.redraw(e),s=[e,a.update,n,a.maxPoints];return _.add(e,y.extendTraces,s,t,arguments),o},y.addTraces=function t(e,r,n){e=z.getGraphDiv(e);var i,a,o=[],s=y.deleteTraces,c=t,h=[e,o],f=[e,r];for(u(e,r,n),Array.isArray(r)||(r=[r]),r=r.map(function(t){return b.extendFlat({},t)}),z.cleanData(r,e.data),i=0;i<r.length;i++)e.data.push(r[i]);for(i=0;i<r.length;i++)o.push(-r.length+i);if(void 0===n)return a=y.redraw(e),_.add(e,s,h,c,f),a;Array.isArray(n)||(n=[n]);try{l(e,o,n)}catch(t){throw e.data.splice(e.data.length-r.length,r.length),t}return _.startSequence(e),_.add(e,s,h,c,f),a=y.moveTraces(e,o,n),_.stopSequence(e),a},y.deleteTraces=function t(e,r){e=z.getGraphDiv(e);var n,i,a=[],l=y.addTraces,u=t,c=[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]),s(e,r,\"indices\"),(r=o(r,e.data.length-1)).sort(b.sorterDes),n=0;n<r.length;n+=1)i=e.data.splice(r[n],1)[0],a.push(i);var f=y.redraw(e);return _.add(e,l,c,u,h),f},y.moveTraces=function t(e,r,n){var i,a=[],s=[],u=t,c=t,h=[e=z.getGraphDiv(e),n,r],f=[e,r,n];if(l(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++)s.push({newIndex:n[i],trace:e.data[r[i]]});for(s.sort(function(t,e){return t.newIndex-e.newIndex}),i=0;i<s.length;i+=1)a.splice(s[i].newIndex,0,s[i].trace);e.data=a;var d=y.redraw(e);return _.add(e,u,h,c,f),d},y.restyle=function t(e,r,n,i){e=z.getGraphDiv(e),z.clearPromiseQueue(e);var a={};if(\"string\"==typeof r)a[r]=n;else{if(!b.isPlainObject(r))return b.warn(\"Restyle fail.\",r,n,i),Promise.reject();a=b.extendFlat({},r),void 0===i&&(i=n)}Object.keys(a).length&&(e.changed=!0);var o=d(e,a,i),s=o.flags;s.clearCalc&&(e.calcdata=void 0);var l=[];s.fullReplot?l.push(y.plot):(l.push(M.previousPromises),M.supplyDefaults(e),s.dostyle&&l.push(D.doTraceStyle),s.docolorbars&&l.push(D.doColorBars)),l.push(M.rehover),_.add(e,t,[e,o.undoit,o.traces],t,[e,o.redoit,o.traces]);var u=b.syncOrAsync(l,e);return u&&u.then||(u=Promise.resolve()),u.then(function(){return e.emit(\"plotly_restyle\",o.eventData),e})},y.relayout=function t(e,r,n){if(e=z.getGraphDiv(e),z.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);var i={};if(\"string\"==typeof r)i[r]=n;else{if(!b.isPlainObject(r))return b.warn(\"Relayout fail.\",r,n),Promise.reject();i=b.extendFlat({},r)}Object.keys(i).length&&(e.changed=!0);var a=p(e,i),o=a.flags;o.docalc&&(e.calcdata=void 0);var s=[M.previousPromises];o.layoutReplot?s.push(D.layoutReplot):Object.keys(i).length&&(M.supplyDefaults(e),o.dolegend&&s.push(D.doLegend),o.dolayoutstyle&&s.push(D.layoutStyles),o.doticks&&s.push(D.doTicksRelayout),o.domodebar&&s.push(D.doModeBar),o.docamera&&s.push(D.doCamera)),s.push(M.rehover),_.add(e,t,[e,a.undoit],t,[e,a.redoit]);var l=b.syncOrAsync(s,e);return l&&l.then||(l=Promise.resolve(e)),l.then(function(){return e.emit(\"plotly_relayout\",a.eventData),e})},y.update=function t(e,r,n,i){if(e=z.getGraphDiv(e),z.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);b.isPlainObject(r)||(r={}),b.isPlainObject(n)||(n={}),Object.keys(r).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var a=d(e,b.extendFlat({},r),i),o=a.flags,s=p(e,b.extendFlat({},n)),l=s.flags;(o.clearCalc||l.docalc)&&(e.calcdata=void 0);var u=[];if(o.fullReplot&&l.layoutReplot){var c=e.data,h=e.layout;e.data=void 0,e.layout=void 0,u.push(function(){return y.plot(e,c,h)})}else o.fullReplot?u.push(y.plot):l.layoutReplot?u.push(D.layoutReplot):(u.push(M.previousPromises),M.supplyDefaults(e),o.dostyle&&u.push(D.doTraceStyle),o.docolorbars&&u.push(D.doColorBars),l.dolegend&&u.push(D.doLegend),l.dolayoutstyle&&u.push(D.layoutStyles),l.doticks&&u.push(D.doTicksRelayout),l.domodebar&&u.push(D.doModeBar),l.doCamera&&u.push(D.doCamera));u.push(M.rehover),_.add(e,t,[e,a.undoit,s.undoit,a.traces],t,[e,a.redoit,s.redoit,a.traces]);var f=b.syncOrAsync(u,e);return f&&f.then||(f=Promise.resolve(e)),f.then(function(){return e.emit(\"plotly_update\",{data:a.eventData,layout:s.eventData}),e})},y.animate=function(t,e,r){function n(t){return Array.isArray(s)?t>=s.length?s[0]:s[t]:s}function i(t){return Array.isArray(l)?t>=l.length?l[0]:l[t]:l}function a(t,e){var r=0;return function(){if(t&&++r===e)return t()}}if(t=z.getGraphDiv(t),!b.isPlotDiv(t))throw new Error(\"This element is not a Plotly plot: \"+t+\". It's likely that you've failed to create a plot before animating it. For more details, see https://plot.ly/javascript/animations/\");var o=t._transitionData;o._frameQueue||(o._frameQueue=[]);var s=(r=M.supplyAnimationDefaults(r)).transition,l=r.frame;return void 0===o._frameWaitingCnt&&(o._frameWaitingCnt=0),new Promise(function(l,u){function c(){t.emit(\"plotly_animated\"),window.cancelAnimationFrame(o._animationRaf),o._animationRaf=null}function h(){o._currentFrame&&o._currentFrame.onComplete&&o._currentFrame.onComplete();var e=o._currentFrame=o._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,o._lastFrameAt=Date.now(),o._timeToNext=e.frameOpts.duration,M.transition(t,e.frame.data,e.frame.layout,z.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 c()}function f(){t.emit(\"plotly_animating\"),o._lastFrameAt=-1/0,o._timeToNext=0,o._runningTransitions=0,o._currentFrame=null;var e=function(){o._animationRaf=window.requestAnimationFrame(e),Date.now()-o._lastFrameAt>o._timeToNext&&h()};e()}function d(t){return Array.isArray(s)?g>=s.length?t.transitionOpts=s[g]:t.transitionOpts=s[0]:t.transitionOpts=s,g++,t}var p,m,g=0,v=[],y=void 0===e||null===e,x=Array.isArray(e);if(!y&&!x&&b.isPlainObject(e))v.push({type:\"object\",data:d(b.extendFlat({},e))});else if(y||-1!==[\"string\",\"number\"].indexOf(typeof e))for(p=0;p<o._frames.length;p++)(m=o._frames[p])&&(y||String(m.group)===String(e))&&v.push({type:\"byname\",name:String(m.name),data:d({name:m.name})});else if(x)for(p=0;p<e.length;p++){var _=e[p];-1!==[\"number\",\"string\"].indexOf(typeof _)?(_=String(_),v.push({type:\"byname\",name:_,data:d({name:_})})):b.isPlainObject(_)&&v.push({type:\"object\",data:d(b.extendFlat({},_))})}for(p=0;p<v.length;p++)if(\"byname\"===(m=v[p]).type&&!o._frameHash[m.data.name])return b.warn('animate failure: frame not found: \"'+m.data.name+'\"'),void u();-1!==[\"next\",\"immediate\"].indexOf(r.mode)&&function(){if(0!==o._frameQueue.length){for(;o._frameQueue.length;){var e=o._frameQueue.pop();e.onInterrupt&&e.onInterrupt()}t.emit(\"plotly_animationinterrupted\",[])}}(),\"reverse\"===r.direction&&v.reverse();var w=t._fullLayout._currentFrame;if(w&&r.fromcurrent){var k=-1;for(p=0;p<v.length;p++)if(\"byname\"===(m=v[p]).type&&m.name===w){k=p;break}if(k>0&&k<v.length-1){var A=[];for(p=0;p<v.length;p++)m=v[p],(\"byname\"!==v[p].type||p>k)&&A.push(m);v=A}}v.length>0?function(e){if(0!==e.length){for(var s=0;s<e.length;s++){var c;c=\"byname\"===e[s].type?M.computeFrame(t,e[s].name):e[s].data;var h=i(s),d=n(s);d.duration=Math.min(d.duration,h.duration);var p={frame:c,name:e[s].name,frameOpts:h,transitionOpts:d};s===e.length-1&&(p.onComplete=a(l,2),p.onInterrupt=u),o._frameQueue.push(p)}\"immediate\"===r.mode&&(o._lastFrameAt=-1/0),o._animationRaf||f()}}(v):(t.emit(\"plotly_animated\"),l())})},y.addFrames=function(t,e,r){t=z.getGraphDiv(t);var n=0;if(null===e||void 0===e)return Promise.resolve();if(!b.isPlotDiv(t))throw new Error(\"This element is not a Plotly plot: \"+t+\". It's likely that you've failed to create a plot before adding frames. For more details, see https://plot.ly/javascript/animations/\");var i,a,o,s,l=t._transitionData._frames,u=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error(\"addFrames failure: frameList must be an Array of frame definitions\"+e);var c=l.length+2*e.length,h=[];for(i=e.length-1;i>=0;i--)if(b.isPlainObject(e[i])){var f=(u[e[i].name]||{}).name,d=e[i].name;f&&d&&\"number\"==typeof d&&u[f]&&(n++,b.warn('addFrames: overwriting frame \"'+u[f].name+'\" with a frame whose name of type \"number\" also equates to \"'+f+'\". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),n>5&&b.warn(\"addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.\")),h.push({frame:M.supplyFrameDefaults(e[i]),index:r&&void 0!==r[i]&&null!==r[i]?r[i]:c+i})}h.sort(function(t,e){return t.index>e.index?-1:t.index<e.index?1:0});var p=[],m=[],g=l.length;for(i=h.length-1;i>=0;i--){if(\"number\"==typeof(a=h[i].frame).name&&b.warn(\"Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings\"),!a.name)for(;u[a.name=\"frame \"+t._transitionData._counter++];);if(u[a.name]){for(o=0;o<l.length&&(l[o]||{}).name!==a.name;o++);p.push({type:\"replace\",index:o,value:a}),m.unshift({type:\"replace\",index:o,value:l[o]})}else s=Math.max(0,Math.min(h[i].index,g)),p.push({type:\"insert\",index:s,value:a}),m.unshift({type:\"delete\",index:s}),g++}var v=M.modifyFrames,y=M.modifyFrames,x=[t,m],w=[t,p];return _&&_.add(t,v,x,y,w),M.modifyFrames(t,p)},y.deleteFrames=function(t,e){if(t=z.getGraphDiv(t),!b.isPlotDiv(t))throw new Error(\"This element is not a Plotly plot: \"+t);var r,n,i=t._transitionData._frames,a=[],o=[];if(!e)for(e=[],r=0;r<i.length;r++)e.push(r);for((e=e.slice(0)).sort(),r=e.length-1;r>=0;r--)n=e[r],a.push({type:\"delete\",index:n}),o.unshift({type:\"insert\",index:n,value:i[n]});var s=M.modifyFrames,l=M.modifyFrames,u=[t,o],c=[t,a];return _&&_.add(t,s,u,l,c),M.modifyFrames(t,a)},y.purge=function(t){var e=(t=z.getGraphDiv(t))._fullLayout||{},r=t._fullData||[];return M.cleanPlot([],{},r,e),M.purge(t),x.purge(t),e._container&&e._container.remove(),delete t._context,delete t._replotPending,delete t._mouseDownTime,delete t._legendMouseDownTime,delete t._hmpixcount,delete t._hmlumcount,t}},{\"../components/drawing\":602,\"../components/errorbars\":608,\"../constants/xmlns_namespaces\":668,\"../lib\":685,\"../lib/events\":676,\"../lib/queue\":697,\"../lib/svg_text_utils\":704,\"../plotly\":719,\"../plots/cartesian/axis_ids\":727,\"../plots/cartesian/constants\":729,\"../plots/cartesian/constraints\":731,\"../plots/cartesian/graph_interact\":733,\"../plots/plots\":787,\"../plots/polar\":790,\"../registry\":802,\"./helpers\":709,\"./manage_arrays\":710,\"./subroutines\":716,d3:107,\"fast-isnumeric\":116}],712:[function(t,e,r){\"use strict\";function n(t,r){try{t._fullLayout._paper.style(\"background\",r)}catch(t){e.exports.logging>0&&console.error(t)}}e.exports={staticPlot:!1,editable:!1,autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:\"reset+autosize\",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:\"Edit chart\",showSources:!1,displayModeBar:\"hover\",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:n,topojsonURL:\"https://cdn.plot.ly/\",mapboxAccessToken:null,logging:!1,globalTransforms:[]}},{}],713:[function(t,e,r){\"use strict\";function n(t){var e,r;\"area\"===t?(e={attributes:b},r={}):r=(e=d.modules[t]._module).basePlotModule;var n={};n.type=null,w(n,m),w(n,e.attributes),r.attributes&&w(n,r.attributes),Object.keys(d.componentsRegistry).forEach(function(e){var r=d.componentsRegistry[e];r.schema&&r.schema.traces&&r.schema.traces[t]&&Object.keys(r.schema.traces[t]).forEach(function(e){f(n,r.schema.traces[t][e],e)})}),n.type=t;var i={meta:e.meta||{},attributes:s(n)};if(e.layoutAttributes){var a={};w(a,e.layoutAttributes),i.layoutAttributes=s(a)}return i}function i(){var t={};return w(t,g),Object.keys(d.subplotsRegistry).forEach(function(e){var r=d.subplotsRegistry[e];if(r.layoutAttributes)if(\"cartesian\"===r.name)h(t,r,\"xaxis\"),h(t,r,\"yaxis\");else{var n=\"subplot\"===r.attr?r.name:r.attr;h(t,r,n)}}),t=c(t),Object.keys(d.componentsRegistry).forEach(function(e){var r=d.componentsRegistry[e];r.layoutAttributes&&(r.schema&&r.schema.layout?Object.keys(r.schema.layout).forEach(function(e){f(t,r.schema.layout[e],e)}):f(t,r.layoutAttributes,r.name))}),{layoutAttributes:s(t)}}function a(t){var e=d.transformsRegistry[t],r=w({},e.attributes);return Object.keys(d.componentsRegistry).forEach(function(e){var n=d.componentsRegistry[e];n.schema&&n.schema.transforms&&n.schema.transforms[t]&&Object.keys(n.schema.transforms[t]).forEach(function(e){f(r,n.schema.transforms[t][e],e)})}),{attributes:s(r)}}function o(){var t={frames:p.extendDeep({},v)};return s(t),t.frames}function s(t){return l(t),u(t),t}function l(t){function e(t){return{valType:\"string\"}}function n(t,n,i){r.isValObject(t)?\"data_array\"===t.valType?(t.role=\"data\",i[n+\"src\"]=e(n)):!0===t.arrayOk&&(i[n+\"src\"]=e(n)):p.isPlainObject(t)&&(t.role=\"object\")}r.crawl(t,n)}function u(t){function e(t,e,r){if(t){var n=t[k];n&&(delete t[k],r[e]={items:{}},r[e].items[n]=t,r[e].role=\"object\")}}r.crawl(t,e)}function c(t){return _(t,{radialaxis:x.radialaxis,angularaxis:x.angularaxis}),_(t,x.layout),t}function h(t,e,r){var n=p.nestedProperty(t,r),i=w({},e.layoutAttributes);i[M]=!0,n.set(i)}function f(t,e,r){var n=p.nestedProperty(t,r);n.set(w(n.get()||{},e))}var d=t(\"../registry\"),p=t(\"../lib\"),m=t(\"../plots/attributes\"),g=t(\"../plots/layout_attributes\"),v=t(\"../plots/frame_attributes\"),y=t(\"../plots/animation_attributes\"),b=t(\"../plots/polar/area_attributes\"),x=t(\"../plots/polar/axis_attributes\"),_=p.extendFlat,w=p.extendDeep,M=\"_isSubplotObj\",k=\"_isLinkedToArray\",A=[M,k,\"_arrayAttrRegexps\",\"_deprecated\"];r.IS_SUBPLOT_OBJ=M,r.IS_LINKED_TO_ARRAY=k,r.DEPRECATED=\"_deprecated\",r.UNDERSCORE_ATTRS=A,r.get=function(){var t={};d.allTypes.concat(\"area\").forEach(function(e){t[e]=n(e)});var e={};return Object.keys(d.transformsRegistry).forEach(function(t){e[t]=a(t)}),{defs:{valObjects:p.valObjects,metaKeys:A.concat([\"description\",\"role\"])},traces:t,layout:i(),transforms:e,frames:o(),animation:s(y)}},r.crawl=function(t,e,n){var i=n||0;Object.keys(t).forEach(function(n){var a=t[n];-1===A.indexOf(n)&&(e(a,n,t,i),r.isValObject(a)||p.isPlainObject(a)&&r.crawl(a,e,i+1))})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){function e(e,r,o,s){if(a=a.slice(0,s).concat([r]),e&&(\"data_array\"===e.valType||!0===e.arrayOk)){var l=n(a),u=p.nestedProperty(t,l).get();Array.isArray(u)&&i.push(l)}}function n(t){return t.join(\".\")}var i=[],a=[];if(r.crawl(t._module.attributes,e),t.transforms)for(var o=t.transforms,s=0;s<o.length;s++){var l=o[s];a=[\"transforms[\"+s+\"]\"],r.crawl(l._module.attributes,e,1)}return t._fullInput&&(r.crawl(t._fullInput._module.attributes,e),i=p.filterUnique(i)),i}},{\"../lib\":685,\"../plots/animation_attributes\":720,\"../plots/attributes\":722,\"../plots/frame_attributes\":749,\"../plots/layout_attributes\":778,\"../plots/polar/area_attributes\":788,\"../plots/polar/axis_attributes\":789,\"../registry\":802}],714:[function(t,e,r){\"use strict\";function n(t){o.register(t,t.name,t.categories,t.meta),o.subplotsRegistry[t.basePlotModule.name]||o.registerSubplot(t.basePlotModule)}function i(t){if(\"string\"!=typeof t.name)throw new Error(\"Transform module *name* must be a string.\");var e=\"Transform module \"+t.name,r=\"function\"==typeof t.transform,n=\"function\"==typeof t.calcTransform;if(!r&&!n)throw new Error(e+\" is missing a *transform* or *calcTransform* method.\");r&&n&&s.log([e+\" has both a *transform* and *calcTransform* methods.\",\"Please note that all *transform* methods are executed\",\"before all *calcTransform* methods.\"].join(\" \")),s.isPlainObject(t.attributes)||s.log(e+\" registered without an *attributes* object.\"),\"function\"!=typeof t.supplyDefaults&&s.log(e+\" registered without a *supplyDefaults* method.\"),o.transformsRegistry[t.name]=t}function a(t){if(\"string\"!=typeof t.name)throw new Error(\"Component module *name* must be a string.\");o.registerComponent(t)}var o=t(\"../registry\"),s=t(\"../lib\");e.exports=function(t){if(!t)throw new Error(\"No argument passed to Plotly.register.\");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;e<t.length;e++){var r=t[e];if(!r)throw new Error(\"Invalid module was attempted to be registered!\");switch(r.moduleType){case\"trace\":n(r);break;case\"transform\":i(r);break;case\"component\":a(r);break;default:throw new Error(\"Invalid module was attempted to be registered!\")}}}},{\"../lib\":685,\"../registry\":802}],715:[function(t,e,r){\"use strict\";var n=t(\"../plotly\"),i=t(\"../lib\");e.exports=function(t){return i.extendFlat(n.defaultConfig,t)}},{\"../lib\":685,\"../plotly\":719}],716:[function(t,e,r){\"use strict\";function n(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}var i=t(\"d3\"),a=t(\"../plotly\"),o=t(\"../registry\"),s=t(\"../plots/plots\"),l=t(\"../lib\"),u=t(\"../components/color\"),c=t(\"../components/drawing\"),h=t(\"../components/titles\"),f=t(\"../components/modebar\");r.layoutStyles=function(t){return l.syncOrAsync([s.doAutoMargin,r.lsInner],t)},r.lsInner=function(t){var e,o=t._fullLayout,s=o._size,l=a.Axes.list(t);for(e=0;e<l.length;e++)l[e]._linepositions={};o._paperdiv.style({width:o.width+\"px\",height:o.height+\"px\"}).selectAll(\".main-svg\").call(c.setSize,o.width,o.height),t._context.setBackground(t,o.paper_bgcolor);var h=o._paper.selectAll(\"g.subplot\"),d=[],p=[];h.each(function(e){var r=o._plots[e];if(r.mainplot)return r.bg&&r.bg.remove(),void(r.bg=void 0);var i=a.Axes.getFromId(t,e,\"x\"),s=a.Axes.getFromId(t,e,\"y\"),l=i.domain,u=s.domain,c=[];n(l,u,p)?c=[0]:(d.push(e),p.push([l,u]));var h=r.plotgroup.selectAll(\".bg\").data(c);h.enter().append(\"rect\").classed(\"bg\",!0),h.exit().remove(),h.each(function(){r.bg=h;var t=r.plotgroup.node();t.insertBefore(this,t.childNodes[0])})});var m=o._bgLayer.selectAll(\".bg\").data(d);m.enter().append(\"rect\").classed(\"bg\",!0),m.exit().remove(),m.each(function(t){o._plots[t].bg=i.select(this)});var g=[];return h.each(function(e){var r=o._plots[e],n=a.Axes.getFromId(t,e,\"x\"),i=a.Axes.getFromId(t,e,\"y\");n.setScale(),i.setScale(),r.bg&&r.bg.call(c.setRect,n._offset-s.p,i._offset-s.p,n._length+2*s.p,i._length+2*s.p).call(u.fill,o.plot_bgcolor).style(\"stroke-width\",0),r.clipId=\"clip\"+o._uid+e+\"plot\";var l=o._defs.selectAll(\"g.clips\").selectAll(\"#\"+r.clipId).data([0]);l.enter().append(\"clipPath\").attr({class:\"plotclip\",id:r.clipId}).append(\"rect\"),l.selectAll(\"rect\").attr({width:n._length,height:i._length}),r.plot.call(c.setTranslate,n._offset,i._offset),r.plot.call(c.setClipUrl,r.clipId);var h=c.crispRound(t,n.linewidth,1),f=c.crispRound(t,i.linewidth,1),d=s.p+f,p=\"M\"+-d+\",\",m=\"h\"+(n._length+2*d),v=\"free\"===n.anchor&&-1===g.indexOf(n._id),y=s.h*(1-(n.position||0))+h/2%1,b=n.anchor===i._id&&(n.mirror||\"top\"!==n.side)||\"all\"===n.mirror||\"allticks\"===n.mirror||n.mirrors&&n.mirrors[i._id+\"bottom\"],x=i._length+s.p+h/2,_=n.anchor===i._id&&(n.mirror||\"top\"===n.side)||\"all\"===n.mirror||\"allticks\"===n.mirror||n.mirrors&&n.mirrors[i._id+\"top\"],w=-s.p-h/2,M=s.p,k=b?0:h,A=_?0:h,T=\",\"+(-M-A)+\"v\"+(i._length+2*M+A+k),S=\"free\"===i.anchor&&-1===g.indexOf(i._id),E=s.w*(i.position||0)+f/2%1,L=i.anchor===n._id&&(i.mirror||\"right\"!==i.side)||\"all\"===i.mirror||\"allticks\"===i.mirror||i.mirrors&&i.mirrors[n._id+\"left\"],C=-s.p-f/2,z=i.anchor===n._id&&(i.mirror||\"right\"===i.side)||\"all\"===i.mirror||\"allticks\"===i.mirror||i.mirrors&&i.mirrors[n._id+\"right\"],D=n._length+s.p+f/2;n._linepositions[e]=[b?x:void 0,_?w:void 0,v?y:void 0],n.anchor===i._id?n._linepositions[e][3]=\"top\"===n.side?w:x:v&&(n._linepositions[e][3]=y),i._linepositions[e]=[L?C:void 0,z?D:void 0,S?E:void 0],i.anchor===n._id?i._linepositions[e][3]=\"right\"===i.side?D:C:S&&(i._linepositions[e][3]=E);var I=\"translate(\"+n._offset+\",\"+i._offset+\")\",P=I,O=I;v&&(P=\"translate(\"+n._offset+\",\"+s.t+\")\",w+=i._offset-s.t,x+=i._offset-s.t),S&&(O=\"translate(\"+s.l+\",\"+i._offset+\")\",C+=n._offset-s.l,D+=n._offset-s.l),r.xlines.attr(\"transform\",P).attr(\"d\",(b?p+x+m:\"\")+(_?p+w+m:\"\")+(v?p+y+m:\"\")||\"M0,0\").style(\"stroke-width\",h+\"px\").call(u.stroke,n.showline?n.linecolor:\"rgba(0,0,0,0)\"),r.ylines.attr(\"transform\",O).attr(\"d\",(L?\"M\"+C+T:\"\")+(z?\"M\"+D+T:\"\")+(S?\"M\"+E+T:\"\")||\"M0,0\").attr(\"stroke-width\",f+\"px\").call(u.stroke,i.showline?i.linecolor:\"rgba(0,0,0,0)\"),r.xaxislayer.attr(\"transform\",P),r.yaxislayer.attr(\"transform\",O),r.gridlayer.attr(\"transform\",I),r.zerolinelayer.attr(\"transform\",I),r.draglayer.attr(\"transform\",I),v&&g.push(n._id),S&&g.push(i._id)}),a.Axes.makeClipPaths(t),r.drawMainTitle(t),f.manage(t),t._promises.length&&Promise.all(t._promises)},r.drawMainTitle=function(t){var e=t._fullLayout;h.draw(t,\"gtitle\",{propContainer:e,propName:\"title\",dfltName:\"Plot\",attributes:{x:e.width/2,y:e._size.t/2,\"text-anchor\":\"middle\"}})},r.doTraceStyle=function(t){for(var e=0;e<t.calcdata.length;e++){var r=t.calcdata[e],n=(((r[0]||{}).trace||{})._module||{}).arraysToCalcdata;n&&n(r,r[0].trace)}return s.style(t),o.getComponentMethod(\"legend\",\"draw\")(t),s.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;o.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}),o.traceIs(n,\"markerColorscale\")?i.options(n.marker.colorbar)():i.options(n.colorbar)()}}return s.previousPromises(t)},r.layoutReplot=function(t){var e=t.layout;return t.layout=void 0,a.plot(t,\"\",e)},r.doLegend=function(t){return o.getComponentMethod(\"legend\",\"draw\")(t),s.previousPromises(t)},r.doTicksRelayout=function(t){return a.Axes.doTicks(t,\"redraw\"),r.drawMainTitle(t),s.previousPromises(t)},r.doModeBar=function(t){var e,r,n=t._fullLayout;for(f.manage(t),a.Fx.init(t),e=s.getSubplotIds(n,\"gl3d\"),r=0;r<e.length;r++)n[e[r]]._scene.updateFx(n.dragmode,n.hovermode);return s.previousPromises(t)},r.doCamera=function(t){for(var e=t._fullLayout,r=s.getSubplotIds(e,\"gl3d\"),n=0;n<r.length;n++){var i=e[r[n]];i._scene.setCamera(i.camera)}}},{\"../components/color\":578,\"../components/drawing\":602,\"../components/modebar\":626,\"../components/titles\":655,\"../lib\":685,\"../plotly\":719,\"../plots/plots\":787,\"../registry\":802,d3:107}],717:[function(t,e,r){\"use strict\";function n(t,e){return new Promise(function(r,n){function h(){var t=s.getDelay(p._fullLayout);return new Promise(function(r,n){setTimeout(function(){var t=u(p),i=document.createElement(\"canvas\");i.id=o.randstr(),c({format:e.format,width:p._fullLayout.width,height:p._fullLayout.height,canvas:i,svg:t,promise:!0}).then(function(t){p&&document.body.removeChild(p),r(t)}).catch(function(t){n(t)})},t)})}(e=e||{}).format=e.format||\"png\";var f=function(t){return void 0===t||null===t||!!(i(t)&&t>1)};f(e.width)&&f(e.height)||n(new Error(\"Height and width should be pixel values.\"));var d=l(t,{format:\"png\",height:e.height,width:e.width}),p=d.gd;p.style.position=\"absolute\",p.style.left=\"-5000px\",document.body.appendChild(p);var m=s.getRedrawFunc(p);a.plot(p,d.data,d.layout,d.config).then(m).then(h).then(function(t){r(t)}).catch(function(t){n(t)})})}var i=t(\"fast-isnumeric\"),a=t(\"../plotly\"),o=t(\"../lib\"),s=t(\"../snapshot/helpers\"),l=t(\"../snapshot/cloneplot\"),u=t(\"../snapshot/tosvg\"),c=t(\"../snapshot/svgtoimg\");e.exports=n},{\"../lib\":685,\"../plotly\":719,\"../snapshot/cloneplot\":803,\"../snapshot/helpers\":806,\"../snapshot/svgtoimg\":808,\"../snapshot/tosvg\":810,\"fast-isnumeric\":116}],718:[function(t,e,r){\"use strict\";function n(t,e,r,i,a,u){u=u||[];for(var c=Object.keys(t),f=0;f<c.length;f++){var d=c[f];if(\"transforms\"!==d){var g=u.slice();g.push(d);var v=t[d],y=e[d],b=l(r,d),x=\"info_array\"===(b||{}).valType,_=\"colorscale\"===(b||{}).valType;if(s(r,d))if(p(v)&&p(y))n(v,y,b,i,a,g);else if(b.items&&!x&&m(v)){var w,M,k=b.items,A=k[Object.keys(k)[0]],T=[];for(w=0;w<y.length;w++){var S=y[w]._index||w;(M=g.slice()).push(S),p(v[S])&&p(y[w])&&(T.push(S),n(v[S],y[w],A,i,a,M))}for(w=0;w<v.length;w++)(M=g.slice()).push(w),p(v[w])?-1===T.indexOf(w)&&i.push(o(\"unused\",a,M)):i.push(o(\"object\",a,M,v[w]))}else!p(v)&&p(y)?i.push(o(\"object\",a,g,v)):m(v)||!m(y)||x||_?d in e?h.validate(v,b)||i.push(o(\"value\",a,g,v)):i.push(o(\"unused\",a,g,v)):i.push(o(\"array\",a,g,v));else i.push(o(\"schema\",a,g))}}return i}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r].type,i=t.traces[n].layoutAttributes;i&&h.extendFlat(t.layout.layoutAttributes,i)}return t.layout.layoutAttributes}function a(t){return m(t)?\"In data trace \"+t[1]+\", \":\"In \"+t+\", \"}function o(t,e,r,n){r=r||\"\";var i,a;m(e)?(i=e[0],a=e[1]):(i=e,a=null);var o=c(r),s=g[t](e,o,n);return h.log(s),{code:t,container:i,trace:a,path:r,astr:o,msg:s}}function s(t,e){var r=u(e),n=r.keyMinusId,i=r.id;return!!(n in t&&t[n]._isSubplotObj&&i)||e in t}function l(t,e){return t[u(e).keyMinusId]}function u(t){var e=/([2-9]|[1-9][0-9]+)$/,r=t.split(e)[0];return{keyMinusId:r,id:t.substr(r.length,t.length)}}function c(t){if(!m(t))return String(t);for(var e=\"\",r=0;r<t.length;r++){var n=t[r];\"number\"==typeof n?e=e.substr(0,e.length-1)+\"[\"+n+\"]\":e+=n,r<t.length-1&&(e+=\".\")}return e}var h=t(\"../lib\"),f=t(\"../plots/plots\"),d=t(\"./plot_schema\"),p=h.isPlainObject,m=Array.isArray;e.exports=function(t,e){var r,a,s=d.get(),l=[],u={};m(t)?(u.data=h.extendDeep([],t),r=t):(u.data=[],r=[],l.push(o(\"array\",\"data\"))),p(e)?(u.layout=h.extendDeep({},e),a=e):(u.layout={},a={},arguments.length>1&&l.push(o(\"object\",\"layout\"))),f.supplyDefaults(u);for(var c=u._fullData,g=r.length,v=0;v<g;v++){var y=r[v],b=[\"data\",v];if(p(y)){var x=c[v],_=x.type,w=s.traces[_].attributes;w.type={valType:\"enumerated\",values:[_]},!1===x.visible&&!1!==y.visible&&l.push(o(\"invisible\",b)),n(y,x,w,l,b);var M=y.transforms,k=x.transforms;if(M){m(M)||l.push(o(\"array\",b,[\"transforms\"])),b.push(\"transforms\");for(var A=0;A<M.length;A++){var T=[\"transforms\",A],S=M[A].type;if(p(M[A])){var E=s.transforms[S]?s.transforms[S].attributes:{};E.type={valType:\"enumerated\",values:Object.keys(s.transforms)},n(M[A],k[A],E,l,b,T)}else l.push(o(\"object\",b,T))}}}else l.push(o(\"object\",b))}return n(a,u._fullLayout,i(s,c),l,\"layout\"),0===l.length?void 0:l};var g={object:function(t,e){return(\"layout\"===t&&\"\"===e?\"The layout argument\":\"data\"===t[0]&&\"\"===e?\"Trace \"+t[1]+\" in the data argument\":a(t)+\"key \"+e)+\" must be linked to an object container\"},array:function(t,e){return(\"data\"===t?\"The data argument\":a(t)+\"key \"+e)+\" must be linked to an array container\"},schema:function(t,e){return a(t)+\"key \"+e+\" is not part of the schema\"},unused:function(t,e,r){var n=p(r)?\"container\":\"key\";return a(t)+n+\" \"+e+\" did not get coerced\"},invisible:function(t){return\"Trace \"+t[1]+\" got defaulted to be not visible\"},value:function(t,e,r){return[a(t)+\"key \"+e,\"is set to an invalid value (\"+r+\")\"].join(\" \")}}},{\"../lib\":685,\"../plots/plots\":787,\"./plot_schema\":713}],719:[function(t,e,r){\"use strict\";r.defaultConfig=t(\"./plot_api/plot_config\"),r.Plots=t(\"./plots/plots\"),r.Axes=t(\"./plots/cartesian/axes\"),r.Fx=t(\"./plots/cartesian/graph_interact\"),r.ModeBar=t(\"./components/modebar\"),t(\"./plot_api/plot_api\")},{\"./components/modebar\":626,\"./plot_api/plot_api\":711,\"./plot_api/plot_config\":712,\"./plots/cartesian/axes\":724,\"./plots/cartesian/graph_interact\":733,\"./plots/plots\":787}],720:[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\"]}}}},{}],721:[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 u=s[i],c={},h={};n.isPlainObject(u)||(h.itemIsNotPlainObject=!0,u={}),r.handleItemDefaults(u,c,e,r,h),c._input=u,c._index=i,l.push(c)}if(n.isArray(o)){var f=Math.min(o.length,l.length);for(i=0;i<f;i++)n.relinkPrivateKeys(l[i],o[i])}}},{\"../lib\":685}],722:[function(t,e,r){\"use strict\";e.exports={type:{valType:\"enumerated\",values:[],dflt:\"scatter\"},visible:{valType:\"enumerated\",values:[!0,!1,\"legendonly\"],dflt:!0},showlegend:{valType:\"boolean\",dflt:!0},legendgroup:{valType:\"string\",dflt:\"\"},opacity:{valType:\"number\",min:0,max:1,dflt:1},name:{valType:\"string\"},uid:{valType:\"string\",dflt:\"\"},hoverinfo:{valType:\"flaglist\",flags:[\"x\",\"y\",\"z\",\"text\",\"name\"],extras:[\"all\",\"none\",\"skip\"],dflt:\"all\"},stream:{token:{valType:\"string\",noBlank:!0,strict:!0},maxpoints:{valType:\"number\",min:0,max:1e4,dflt:500}}}},{}],723:[function(t,e,r){\"use strict\";e.exports={xaxis:{valType:\"subplotid\",dflt:\"x\"},yaxis:{valType:\"subplotid\",dflt:\"y\"}}},{}],724:[function(t,e,r){\"use strict\";function n(t,e,r,n,i){function a(e){return(1+100*(e-t)/r.dtick)%100<2}for(var o=0,s=0,l=0,u=0,c=0;c<e.length;c++)e[c]%1==0?l++:b(e[c])||u++,a(e[c])&&o++,a(e[c]+r.dtick/2)&&s++;var h=e.length-u;if(l===h&&\"date\"!==r.type)r.dtick<1?t=n-.5*r.dtick:(t-=.5)+r.dtick<n&&(t+=r.dtick);else if(s<.1*h&&(o>.3*h||a(n)||a(i))){var f=r.dtick/2;t+=t+f<n?f:-f}return t}function i(t,e,r,n,i){var a=_.findExactDates(e,i);if(a.exactDays>.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=O.tickIncrement(t,\"M6\",\"reverse\")+1.5*C:a.exactMonths>.8?t=O.tickIncrement(t,\"M1\",\"reverse\")+15.5*C:t-=C/2;var s=O.tickIncrement(t,r);if(s<=n)return s}return t}function a(t){var e,r,n=t.tickvals,i=t.ticktext,a=new Array(n.length),o=_.simpleMap(t.range,t.r2l),s=1.0001*o[0]-1e-4*o[1],u=1.0001*o[1]-1e-4*o[0],c=Math.min(s,u),h=Math.max(s,u),f=0;Array.isArray(i)||(i=[]);var d=\"category\"===t.type?t.d2l_noadd:t.d2l;for(\"log\"===t.type&&\"L\"!==String(t.dtick).charAt(0)&&(t.dtick=\"L\"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1)),r=0;r<n.length;r++)(e=d(n[r]))>c&&e<h&&(void 0===i[r]?a[f]=O.tickText(t,e):a[f]=l(t,e,String(i[r])),f++);return f<n.length&&a.splice(f,n.length-f),a}function o(t,e,r){return e*_.roundUp(t/e,r)}function s(t){var e=t.dtick;if(t._tickexponent=0,b(e)||\"string\"==typeof e||(e=1),\"category\"===t.type&&(t._tickround=null),\"date\"===t.type){var r=t.r2l(t.tick0),n=t.l2r(r).replace(/(^-|i)/g,\"\"),i=n.length;if(\"M\"===String(e).charAt(0))i>10||\"01-01\"!==n.substr(5)?t._tickround=\"d\":t._tickround=+e.substr(1)%12==0?\"y\":\"m\";else if(e>=C&&i<=10||e>=15*C)t._tickround=\"d\";else if(e>=D&&i<=16||e>=z)t._tickround=\"M\";else if(e>=I&&i<=19||e>=D)t._tickround=\"S\";else{var a=t.l2r(r+e).replace(/^-/,\"\").length;t._tickround=Math.max(i,a)-20}}else if(b(e)||\"L\"===e.charAt(0)){var o=t.range.map(t.r2d||Number);b(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(o[0]),Math.abs(o[1])),l=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(l)>3&&(\"SI\"===t.exponentformat||\"B\"===t.exponentformat?t._tickexponent=3*Math.round((l-1)/3):t._tickexponent=l)}else t._tickround=null}function l(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||\"\",fontSize:n.size,font:n.family,fontColor:n.color}}function u(t,e,r,n){var i=t._tickround,a=r&&t.hoverformat||t.tickformat;n&&(i=b(i)?4:{y:\"m\",m:\"d\",d:\"M\",M:\"S\",S:4}[i]);var o,s=_.formatDate(e.x,a,i,t.calendar),l=s.indexOf(\"\\n\");-1!==l&&(o=s.substr(l+1),s=s.substr(0,l)),n&&(\"00:00:00\"===s||\"00:00\"===s?(s=o,o=\"\"):8===s.length&&(s=s.replace(/:00$/,\"\"))),o&&(r?\"d\"===i?s+=\", \"+o:s=o+(s?\", \"+s:\"\"):t._inCalcTicks&&o===t._prevDateHead||(s+=\"<br>\"+o,t._prevDateHead=o)),e.text=s}function c(t,e,r,n,i){var a=t.dtick,o=e.x;if(!n||\"string\"==typeof a&&\"L\"===a.charAt(0)||(a=\"L3\"),t.tickformat||\"string\"==typeof a&&\"L\"===a.charAt(0))e.text=d(Math.pow(10,o),t,i,n);else if(b(a)||\"D\"===a.charAt(0)&&_.mod(o+.01,1)<.1)if(-1!==[\"e\",\"E\",\"power\"].indexOf(t.exponentformat)){var s=Math.round(o);e.text=0===s?1:1===s?\"10\":s>1?\"10<sup>\"+s+\"</sup>\":\"10<sup>−\"+-s+\"</sup>\",e.fontSize*=1.25}else e.text=d(Math.pow(10,o),t,\"\",\"fakehover\"),\"D1\"===a&&\"y\"===t._id.charAt(0)&&(e.dy-=e.fontSize/6);else{if(\"D\"!==a.charAt(0))throw\"unrecognized dtick \"+String(a);e.text=String(Math.round(Math.pow(10,_.mod(o,1)))),e.fontSize*=.75}if(\"D1\"===t.dtick){var l=String(e.text).charAt(0);\"0\"!==l&&\"1\"!==l||(\"y\"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(o<0?.5:.25)))}}function h(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=\"\"),e.text=String(r)}function f(t,e,r,n,i){\"all\"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i=\"hide\"),e.text=d(e.x,t,i,n)}function d(t,e,r,n){var i=t<0,a=e._tickround,o=r||e.exponentformat||\"B\",l=e._tickexponent,u=e.tickformat,c=e.separatethousands;if(n){var h={exponentformat:e.exponentformat,dtick:\"none\"===e.showexponent?e.dtick:b(t)?Math.abs(t)||1:1,range:\"none\"===e.showexponent?e.range.map(e.r2d):[0,t||1]};s(h),a=(Number(h._tickround)||0)+4,l=h._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return y.format(u)(t).replace(/-/g,\"−\");var f=Math.pow(10,-a)/2;if(\"none\"===o&&(l=0),(t=Math.abs(t))<f)t=\"0\",i=!1;else{if(t+=f,l&&(t*=Math.pow(10,-l),a+=l),0===a)t=String(Math.floor(t));else if(a<0){t=(t=String(Math.round(t))).substr(0,t.length+a);for(var d=a;d<0;d++)t+=\"0\"}else{var p=(t=String(t)).indexOf(\".\")+1;p&&(t=t.substr(0,p+a).replace(/\\.?0+$/,\"\"))}t=_.numSeparate(t,e._separators,c)}if(l&&\"hide\"!==o){var m;m=l<0?\"−\"+-l:\"power\"!==o?\"+\"+l:String(l),\"e\"===o||(\"SI\"===o||\"B\"===o)&&(l>12||l<-15)?t+=\"e\"+m:\"E\"===o?t+=\"E\"+m:\"power\"===o?t+=\"×10<sup>\"+m+\"</sup>\":\"B\"===o&&9===l?t+=\"B\":\"SI\"!==o&&\"B\"!==o||(t+=H[l/3+5])}return i?\"−\"+t:t}function p(t,e){var r,n,i=[];for(r=0;r<e.length;r++){var a=[],o=t._fullData[e[r]].xaxis,s=t._fullData[e[r]].yaxis;if(o&&s){for(n=0;n<i.length;n++)-1===i[n].x.indexOf(o)&&-1===i[n].y.indexOf(s)||a.push(n);if(a.length){var l,u=i[a[0]];if(a.length>1)for(n=1;n<a.length;n++)l=i[a[n]],m(u.x,l.x),m(u.y,l.y);m(u.x,[o]),m(u.y,[s])}else i.push({x:[o],y:[s]})}}return i}function m(t,e){for(var r=0;r<e.length;r++)-1===t.indexOf(e[r])&&t.push(e[r])}function g(t,e,r){var n,i,a=[],o=[],s=t.layout;for(n=0;n<e.length;n++)a.push(O.getFromId(t,e[n]));for(n=0;n<r.length;n++)o.push(O.getFromId(t,r[n]));var l=Object.keys(a[0]),u=[\"anchor\",\"domain\",\"overlaying\",\"position\",\"side\",\"tickangle\"],c=[\"linear\",\"log\"];for(n=0;n<l.length;n++){var h=l[n],f=a[0][h],d=o[0][h],p=!0,m=!1,g=!1;if(\"_\"!==h.charAt(0)&&\"function\"!=typeof f&&-1===u.indexOf(h)){for(i=1;i<a.length&&p;i++){var y=a[i][h];\"type\"===h&&-1!==c.indexOf(f)&&-1!==c.indexOf(y)&&f!==y?m=!0:y!==f&&(p=!1)}for(i=1;i<o.length&&p;i++){var b=o[i][h];\"type\"===h&&-1!==c.indexOf(d)&&-1!==c.indexOf(b)&&d!==b?g=!0:o[i][h]!==d&&(p=!1)}p&&(m&&(s[a[0]._name].type=\"linear\"),g&&(s[o[0]._name].type=\"linear\"),v(s,h,a,o))}}for(n=0;n<t._fullLayout.annotations.length;n++){var x=t._fullLayout.annotations[n];-1!==e.indexOf(x.xref)&&-1!==r.indexOf(x.yref)&&_.swapAttrs(s.annotations[n],[\"?\"])}}function v(t,e,r,n){var i,a=_.nestedProperty,o=a(t[r[0]._name],e).get(),s=a(t[n[0]._name],e).get();for(\"title\"===e&&(\"Click to enter X axis title\"===o&&(o=\"Click to enter Y axis title\"),\"Click to enter Y axis title\"===s&&(s=\"Click to enter X axis title\")),i=0;i<r.length;i++)a(t,r[i]._name+\".\"+e).set(s);for(i=0;i<n.length;i++)a(t,n[i]._name+\".\"+e).set(o)}var y=t(\"d3\"),b=t(\"fast-isnumeric\"),x=t(\"../../registry\"),_=t(\"../../lib\"),w=t(\"../../lib/svg_text_utils\"),M=t(\"../../components/titles\"),k=t(\"../../components/color\"),A=t(\"../../components/drawing\"),T=t(\"../../constants/numerical\"),S=T.FP_SAFE,E=T.ONEAVGYEAR,L=T.ONEAVGMONTH,C=T.ONEDAY,z=T.ONEHOUR,D=T.ONEMIN,I=T.ONESEC,P=T.BADNUM,O=e.exports={};O.layoutAttributes=t(\"./layout_attributes\"),O.supplyLayoutDefaults=t(\"./layout_defaults\"),O.setConvert=t(\"./set_convert\");var j=t(\"./axis_ids\");O.id2name=j.id2name,O.cleanId=j.cleanId,O.list=j.list,O.listIds=j.listIds,O.getFromId=j.getFromId,O.getFromTrace=j.getFromTrace,O.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),s=O.listIds(r,o),l=n+\"ref\",u={};return i||(i=s[0]||a),a||(a=i),u[l]={valType:\"enumerated\",values:s.concat(a?[a]:[]),dflt:i},_.coerce(t,e,u,l)},O.coercePosition=function(t,e,r,n,i,a){var o,s;if(\"paper\"===n||\"pixel\"===n)o=r(i,a);else{var l=O.getFromId(e,n);if(a=l.fraction2r(a),o=r(i,a),\"category\"===l.type){if(\"string\"==typeof o&&(l._categories||[]).length)return s=l._categories.indexOf(o),void(t[i]=-1===s?a:s)}else if(\"date\"===l.type)return void(t[i]=_.cleanDate(o,P,l.calendar))}t[i]=b(o)?Number(o):a},O.clearTypes=function(t,e){Array.isArray(e)&&e.length||(e=t._fullData.map(function(t,e){return e})),e.forEach(function(e){var r=t.data[e];delete(O.getFromId(t,r.xaxis)||{}).type,delete(O.getFromId(t,r.yaxis)||{}).type})},O.counterLetter=function(t){var e=t.charAt(0);return\"x\"===e?\"y\":\"y\"===e?\"x\":void 0},O.minDtick=function(t,e,r,n){-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},O.getAutoRange=function(t){var e,r=[],n=t._min[0].val,i=t._max[0].val;for(e=1;e<t._min.length&&n===i;e++)n=Math.min(n,t._min[e].val);for(e=1;e<t._max.length&&n===i;e++)i=Math.max(i,t._max[e].val);var a,o,s,l,u,c,h,f=0,d=!1;if(t.range){var p=_.simpleMap(t.range,t.r2l);d=p[1]<p[0]}for(\"reversed\"===t.autorange&&(d=!0,t.autorange=!0),e=0;e<t._min.length;e++)for(o=t._min[e],a=0;a<t._max.length;a++)h=(s=t._max[a]).val-o.val,c=t._length-o.pad-s.pad,h>0&&c>0&&h/c>f&&(l=o,u=s,f=h/c);if(n===i){var m=n-1,g=n+1;r=\"tozero\"===t.rangemode?n<0?[m,0]:[0,g]:\"nonnegative\"===t.rangemode?[Math.max(0,m),Math.max(0,g)]:[m,g]}else f&&(\"linear\"!==t.type&&\"-\"!==t.type||(\"tozero\"===t.rangemode?(l.val>=0&&(l={val:0,pad:0}),u.val<=0&&(u={val:0,pad:0})):\"nonnegative\"===t.rangemode&&(l.val-f*l.pad<0&&(l={val:0,pad:0}),u.val<0&&(u={val:1,pad:0})),f=(u.val-l.val)/(t._length-l.pad-u.pad)),r=[l.val-f*l.pad,u.val+f*u.pad]);return r[0]===r[1]&&(\"tozero\"===t.rangemode?r=r[0]<0?[r[0],0]:r[0]>0?[0,r[0]]:[0,1]:(r=[r[0]-1,r[0]+1],\"nonnegative\"===t.rangemode&&(r[0]=Math.max(0,r[0])))),d&&r.reverse(),_.simpleMap(r,t.l2r||Number)},O.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=O.getAutoRange(t);var r=t._input;r.range=t.range.slice(),r.autorange=t.autorange}},O.saveRangeInitial=function(t,e){for(var r=O.list(t,\"\",!0),n=!1,i=0;i<r.length;i++){var a=r[i],o=void 0===a._rangeInitial,s=o||!(a.range[0]===a._rangeInitial[0]&&a.range[1]===a._rangeInitial[1]);(o&&!1===a.autorange||e&&s)&&(a._rangeInitial=a.range.slice(),n=!0)}return n},O.saveShowSpikeInitial=function(t,e){for(var r=O.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},O.expand=function(t,e,r){function n(t){if(Array.isArray(t))return function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}function i(r){function n(t){return b(t)&&Math.abs(t)<S}if(l=e[r],b(l)){if(h=x(r)+v,f=w(r)+v,p=l-k(r),m=l+M(r),\"log\"===t.type&&p<m/10&&(p=m/10),u=t.c2l(p),c=t.c2l(m),y&&(u=Math.min(0,u),c=Math.max(0,c)),n(u)){for(d=!0,o=0;o<t._min.length&&d;o++)(s=t._min[o]).val<=u&&s.pad>=f?d=!1:s.val>=u&&s.pad<=f&&(t._min.splice(o,1),o--);d&&t._min.push({val:u,pad:y&&0===u?0:f})}if(n(c)){for(d=!0,o=0;o<t._max.length&&d;o++)(s=t._max[o]).val>=c&&s.pad>=h?d=!1:s.val<=c&&s.pad<=h&&(t._max.splice(o,1),o--);d&&t._max.push({val:c,pad:y&&0===c?0:h})}}}if((t.autorange||!!_.nestedProperty(t,\"rangeslider.autorange\").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var a,o,s,l,u,c,h,f,d,p,m,g=e.length,v=r.padded?.05*t._length:0,y=r.tozero&&(\"linear\"===t.type||\"-\"===t.type),x=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),w=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),M=n(r.vpadplus||r.vpad),k=n(r.vpadminus||r.vpad);for(a=0;a<6;a++)i(a);for(a=g-1;a>5;a--)i(a)}},O.autoBin=function(t,e,r,a,o){var s=_.aggNums(Math.min,null,t),l=_.aggNums(Math.max,null,t);if(o||(o=e.calendar),\"category\"===e.type)return{start:s-.5,end:l+.5,size:1};var u;if(r)u=(l-s)/r;else{var c=_.distinctVals(t),h=Math.pow(10,Math.floor(Math.log(c.minDiff)/Math.LN10)),f=h*_.roundUp(c.minDiff/h,[.9,1.9,4.9,9.9],!0);u=Math.max(f,2*_.stdev(t)/Math.pow(t.length,a?.25:.4)),b(u)||(u=1)}var d;d=\"log\"===e.type?{type:\"linear\",range:[s,l]}:{type:e.type,range:_.simpleMap([s,l],e.c2r,0,o),calendar:o},O.setConvert(d),O.autoTicks(d,u);var p,m=O.tickIncrement(O.tickFirst(d),d.dtick,\"reverse\",o);if(\"number\"==typeof d.dtick)p=(m=n(m,t,d,s,l))+(1+Math.floor((l-m)/d.dtick))*d.dtick;else for(\"M\"===d.dtick.charAt(0)&&(m=i(m,t,d.dtick,s,o)),p=m;p<=l;)p=O.tickIncrement(p,d.dtick,!1,o);return{start:e.c2r(m,0,o),end:e.c2r(p,0,o),size:d.dtick}},O.calcTicks=function(t){var e=_.simpleMap(t.range,t.r2l);if(\"auto\"===t.tickmode||!t.dtick){var r,n=t.nticks;n||(\"category\"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r=\"y\"===t._id.charAt(0)?40:80,n=_.constrain(t._length/r,4,9)+1)),\"array\"===t.tickmode&&(n*=100),O.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}if(t.tick0||(t.tick0=\"date\"===t.type?\"2000-01-01\":0),s(t),\"array\"===t.tickmode)return a(t);t._tmin=O.tickFirst(t);var i=e[1]<e[0],o=[],l=1.0001*e[1]-1e-4*e[0];\"category\"===t.type&&(l=i?Math.max(-.5,l):Math.min(t._categories.length-.5,l));for(var u=t._tmin;(i?u>=l:u<=l)&&(o.push(u),!(o.length>1e3));u=O.tickIncrement(u,t.dtick,i,t.calendar));t._tmax=o[o.length-1],t._prevDateHead=\"\",t._inCalcTicks=!0;for(var c=new Array(o.length),h=0;h<o.length;h++)c[h]=O.tickText(t,o[h]);return t._inCalcTicks=!1,c};var R=[2,5,10],F=[1,2,3,6,12],N=[1,2,5,10,15,30],B=[1,2,3,7,14],U=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],V=[-.301,0,.301,.699,1];O.autoTicks=function(t,e){var r;if(\"date\"===t.type){t.tick0=_.dateTick0(t.calendar);var n=2*e;n>E?(e/=E,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=\"M\"+12*o(e,r,R)):n>L?(e/=L,t.dtick=\"M\"+o(e,1,F)):n>C?(t.dtick=o(e,C,B),t.tick0=_.dateTick0(t.calendar,!0)):n>z?t.dtick=o(e,z,F):n>D?t.dtick=o(e,D,N):n>I?t.dtick=o(e,I,N):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=o(e,r,R))}else if(\"log\"===t.type){t.tick0=0;var i=_.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(i[1]-i[0])<1){var a=1.5*Math.abs((i[1]-i[0])/e);e=Math.abs(Math.pow(10,i[1])-Math.pow(10,i[0]))/a,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=\"L\"+o(e,r,R)}else t.dtick=e>.3?\"D2\":\"D1\"}else\"category\"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):(t.tick0=0,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=o(e,r,R));if(0===t.dtick&&(t.dtick=1),!b(t.dtick)&&\"string\"!=typeof t.dtick){var s=t.dtick;throw t.dtick=1,\"ax.dtick error: \"+String(s)}},O.tickIncrement=function(t,e,r,n){var i=r?-1:1;if(b(e))return t+i*e;var a=e.charAt(0),o=i*Number(e.substr(1));if(\"M\"===a)return _.incrementMonth(t,o,n);if(\"L\"===a)return Math.log(Math.pow(10,t)+o)/Math.LN10;if(\"D\"===a){var s=\"D2\"===e?V:U,l=t+.01*i,u=_.roundUp(_.mod(l,1),s,r);return Math.floor(l)+Math.log(y.round(Math.pow(10,u),1))/Math.LN10}throw\"unrecognized dtick \"+String(e)},O.tickFirst=function(t){var e=t.r2l||Number,r=_.simpleMap(t.range,e),n=r[1]<r[0],i=n?Math.floor:Math.ceil,a=1.0001*r[0]-1e-4*r[1],o=t.dtick,s=e(t.tick0);if(b(o)){var l=i((a-s)/o)*o+s;return\"category\"===t.type&&(l=_.constrain(l,0,t._categories.length-1)),l}var u=o.charAt(0),c=Number(o.substr(1));if(\"M\"===u){for(var h,f,d,p=0,m=s;p<10;){if(((h=O.tickIncrement(m,o,n,t.calendar))-a)*(m-a)<=0)return n?Math.min(m,h):Math.max(m,h);f=(a-(m+h)/2)/(h-m),d=u+(Math.abs(Math.round(f))||1)*c,m=O.tickIncrement(m,d,f<0?!n:n,t.calendar),p++}return _.error(\"tickFirst did not converge\",t),m}if(\"L\"===u)return Math.log(i((Math.pow(10,a)-s)/c)*c+s)/Math.LN10;if(\"D\"===u){var g=\"D2\"===o?V:U,v=_.roundUp(_.mod(a,1),g,n);return Math.floor(a)+Math.log(y.round(Math.pow(10,v),1))/Math.LN10}throw\"unrecognized dtick \"+String(o)},O.tickText=function(t,e,r){function n(n){var i;return void 0===n||(r?\"none\"===n:(i={first:t._tmin,last:t._tmax}[n],\"all\"!==n&&e!==i))}var i,a,o=l(t,e),s=\"array\"===t.tickmode,d=r||s,p=\"category\"===t.type?t.d2l_noadd:t.d2l;if(s&&Array.isArray(t.ticktext)){var m=_.simpleMap(t.range,t.r2l),g=Math.abs(m[1]-m[0])/1e4;for(a=0;a<t.ticktext.length&&!(Math.abs(e-p(t.tickvals[a]))<g);a++);if(a<t.ticktext.length)return o.text=String(t.ticktext[a]),o}return i=\"none\"!==t.exponentformat&&n(t.showexponent)?\"hide\":\"\",\"date\"===t.type?u(t,o,r,d):\"log\"===t.type?c(t,o,r,d,i):\"category\"===t.type?h(t,o):f(t,o,r,d,i),t.tickprefix&&!n(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!n(t.showticksuffix)&&(o.text+=t.ticksuffix),o};var H=[\"f\",\"p\",\"n\",\"μ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\"];O.subplotMatch=/^x([0-9]*)y([0-9]*)$/,O.getSubplots=function(t,e){var r,n,i,a=[],o=t._fullData||t.data||[];for(r=0;r<o.length;r++){var s=o[r];!1!==s.visible&&\"legendonly\"!==s.visible&&(x.traceIs(s,\"cartesian\")||x.traceIs(s,\"gl2d\"))&&(i=(s.xaxis||\"x\")+(s.yaxis||\"y\"),-1===a.indexOf(i)&&a.push(i))}var l=O.list(t,\"\",!0);for(r=0;r<l.length;r++){var u=l[r],c=u._id.charAt(0),h=\"free\"===u.anchor?\"x\"===c?\"y\":\"x\":u.anchor,f=O.getFromId(t,h),d=!1;for(n=0;n<a.length;n++)if(function(t,e){return-1!==t.indexOf(e._id)}(a[n],u)){d=!0;break}\"free\"===u.anchor&&d||f&&(i=\"x\"===c?u._id+f._id:f._id+u._id,-1===a.indexOf(i)&&a.push(i))}var p=O.subplotMatch,m=[];for(r=0;r<a.length;r++)i=a[r],p.test(i)&&m.push(i);return m.sort(function(t,e){var r=t.match(p),n=e.match(p);return r[1]===n[1]?+(r[2]||1)-(n[2]||1):+(r[1]||0)-(n[1]||0)}),e?O.findSubplotsWithAxis(m,e):m},O.findSubplotsWithAxis=function(t,e){for(var r=new RegExp(\"x\"===e._id.charAt(0)?\"^\"+e._id+\"y\":e._id+\"$\"),n=[],i=0;i<t.length;i++){var a=t[i];r.test(a)&&n.push(a)}return n},O.makeClipPaths=function(t){var e,r,n=t._fullLayout,i=n._defs,a={_offset:0,_length:n.width,_id:\"\"},o={_offset:0,_length:n.height,_id:\"\"},s=O.list(t,\"x\",!0),l=O.list(t,\"y\",!0),u=[];for(e=0;e<s.length;e++)for(u.push({x:s[e],y:o}),r=0;r<l.length;r++)0===e&&u.push({x:a,y:l[r]}),u.push({x:s[e],y:l[r]});var c=i.selectAll(\"g.clips\").data([0]);c.enter().append(\"g\").classed(\"clips\",!0);var h=c.selectAll(\".axesclip\").data(u,function(t){return t.x._id+t.y._id});h.enter().append(\"clipPath\").classed(\"axesclip\",!0).attr(\"id\",function(t){return\"clip\"+n._uid+t.x._id+t.y._id}).append(\"rect\"),h.exit().remove(),h.each(function(t){y.select(this).select(\"rect\").attr({x:t.x._offset||0,y:t.y._offset||0,width:t.x._length||1,height:t.y._length||1})})},O.doTicks=function(t,e,r){function n(t){var e=u.l2p(t.x);return e>1&&e<u._length-1}function i(t,e){var r=t.selectAll(\"path.\"+L).data(\"inside\"===u.ticks?H:S,E);e&&u.ticks?(r.enter().append(\"path\").classed(L,1).classed(\"ticks\",1).classed(\"crisp\",1).call(k.stroke,u.tickcolor).style(\"stroke-width\",N+\"px\").attr(\"d\",e),r.attr(\"transform\",d),r.exit().remove()):r.remove()}function a(r,n){function i(t,e){t.each(function(t){var r=x(e),n=y.select(this),i=n.select(\".text-math-group\"),a=d(t)+(b(e)&&0!=+e?\" rotate(\"+e+\",\"+f(t)+\",\"+(p(t)-t.fontSize/2)+\")\":\"\");if(i.empty()){var o=n.select(\"text\").attr({transform:a,\"text-anchor\":r});o.empty()||o.selectAll(\"tspan.line\").attr({x:o.attr(\"x\"),y:o.attr(\"y\")})}else{var s=A.bBox(i.node()).width*{end:-.5,start:.5}[r];i.attr(\"transform\",a+(s?\"translate(\"+s+\",0)\":\"\"))}})}function a(){return z.length&&Promise.all(z)}function s(){if(i(h,u.tickangle),\"x\"===v&&!b(u.tickangle)&&(\"log\"!==u.type||\"D\"!==String(u.dtick).charAt(0))){var t=[];for(h.each(function(e){var r=y.select(this),n=r.select(\".text-math-group\"),i=u.l2p(e.x);n.empty()&&(n=r.select(\"text\"));var a=A.bBox(n.node());t.push({top:0,bottom:10,height:10,left:i-a.width/2,right:i+a.width/2+2,width:a.width+2})}),g=0;g<t.length-1;g++)if(_.bBoxIntersect(t[g],t[g+1])){C=30;break}C&&(Math.abs((S[S.length-1].x-S[0].x)*u._m)/(S.length-1)<2.5*T&&(C=90),i(h,C)),u._lastangle=C}return o(),e+\" done\"}function l(){function e(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.max(t[1],e[1])}var n=r.node().getBoundingClientRect(),i=t.getBoundingClientRect();if(u._boundingBox={width:n.width,height:n.height,left:n.left-i.left,right:n.right-i.left,top:n.top-i.top,bottom:n.bottom-i.top},m){var a=u._counterSpan=[1/0,-1/0];for(g=0;g<m.length;g++){var o=c._plots[m[g]][\"x\"===v?\"yaxis\":\"xaxis\"];e(a,[o._offset,o._offset+o._length])}\"free\"===u.anchor&&e(a,\"x\"===v?[u._boundingBox.bottom,u._boundingBox.top]:[u._boundingBox.right,u._boundingBox.left])}}var h=r.selectAll(\"g.\"+L).data(S,E);if(!u.showticklabels||!b(n))return h.remove(),void o();var f,p,x,M,k;\"x\"===v?(f=function(t){return t.dx+P*k},M=n+(I+D)*(k=\"bottom\"===U?1:-1),p=function(t){return t.dy+M+t.fontSize*(\"bottom\"===U?1:-.5)},x=function(t){return b(t)&&0!==t&&180!==t?t*k<0?\"end\":\"start\":\"middle\"}):(k=\"right\"===U?1:-1,p=function(t){return t.dy+t.fontSize/2-P*k},f=function(t){return t.dx+n+(I+D+(90===Math.abs(u.tickangle)?t.fontSize/2:0))*k},x=function(t){return b(t)&&90===Math.abs(t)?\"middle\":\"right\"===U?\"start\":\"end\"});var T=0,C=0,z=[];h.enter().append(\"g\").classed(L,1).append(\"text\").attr(\"text-anchor\",\"middle\").each(function(e){var r=y.select(this),n=t._promises.length;r.call(A.setPosition,f(e),p(e)).call(A.font,e.font,e.fontSize,e.fontColor).text(e.text).call(w.convertToTspans),(n=t._promises[n])?z.push(t._promises.pop().then(function(){i(r,u.tickangle)})):i(r,u.tickangle)}),h.exit().remove(),h.each(function(t){T=Math.max(T,t.fontSize)}),i(h,u._lastangle||u.tickangle);var O=_.syncOrAsync([a,s,l]);return O&&O.then&&t._promises.push(O),O}function o(){if(!r){var n,i,a,o,s=j.getFromId(t,e),l=y.select(t).selectAll(\"g.\"+e+\"tick\"),u={selection:l,side:s.side},h=e.charAt(0),f=t._fullLayout._size,d=s.titlefont.size;if(l.size()){var p=A.getTranslate(l.node().parentNode);u.offsetLeft=p.x,u.offsetTop=p.y}\"x\"===h?(i=\"free\"===s.anchor?{_offset:f.t+(1-(s.position||0))*f.h,_length:0}:j.getFromId(t,s.anchor),a=s._offset+s._length/2,o=i._offset+(\"top\"===s.side?-10-d*(1.5+(s.showticklabels?1:0)):i._length+10+d*(1.5+(s.showticklabels?1.5:.5))),s.rangeslider&&s.rangeslider.visible&&s._boundingBox&&(o+=(c.height-c.margin.b-c.margin.t)*s.rangeslider.thickness+s._boundingBox.height),u.side||(u.side=\"bottom\")):(i=\"free\"===s.anchor?{_offset:f.l+(s.position||0)*f.w,_length:0}:j.getFromId(t,s.anchor),o=s._offset+s._length/2,a=i._offset+(\"right\"===s.side?i._length+10+d*(1.5+(s.showticklabels?1:.5)):-10-d*(1.5+(s.showticklabels?.5:0))),n={rotate:\"-90\",offset:0},u.side||(u.side=\"left\")),M.draw(t,e+\"title\",{propContainer:s,propName:s._name+\".title\",dfltName:h.toUpperCase()+\" axis\",avoid:u,transform:n,attributes:{x:a,y:o,\"text-anchor\":\"middle\"}})}}function s(t,e){return!0===t.visible&&t.xaxis+t.yaxis===e&&(!(!x.traceIs(t,\"bar\")||t.orientation!=={x:\"h\",y:\"v\"}[v])||t.fill&&t.fill.charAt(t.fill.length-1)===v)}function l(e,r,i){var a=e.gridlayer,o=e.zerolinelayer,l=e[\"hidegrid\"+v]?[]:H,c=u._gridpath||\"M0,0\"+(\"x\"===v?\"v\":\"h\")+r._length,h=a.selectAll(\"path.\"+C).data(!1===u.showgrid?[]:l,E);if(h.enter().append(\"path\").classed(C,1).classed(\"crisp\",1).attr(\"d\",c).each(function(t){u.zeroline&&(\"linear\"===u.type||\"-\"===u.type)&&Math.abs(t.x)<u.dtick/100&&y.select(this).remove()}),h.attr(\"transform\",d).call(k.stroke,u.gridcolor||\"#ddd\").style(\"stroke-width\",R+\"px\"),h.exit().remove(),o){for(var f=!1,p=0;p<t._fullData.length;p++)if(s(t._fullData[p],i)){f=!0;break}var m=_.simpleMap(u.range,u.r2l),g=m[0]*m[1]<=0&&u.zeroline&&(\"linear\"===u.type||\"-\"===u.type)&&l.length&&(f||n({x:0})||!u.showline),b=o.selectAll(\"path.\"+z).data(g?[{x:0}]:[]);b.enter().append(\"path\").classed(z,1).classed(\"zl\",1).classed(\"crisp\",1).attr(\"d\",c),b.attr(\"transform\",d).call(k.stroke,u.zerolinecolor||k.defaultLine).style(\"stroke-width\",F+\"px\"),b.exit().remove()}}var u,c=t._fullLayout,h=!1;if(\"object\"==typeof e)e=(u=e)._id,h=!0;else if(u=O.getFromId(t,e),\"redraw\"===e&&c._paper.selectAll(\"g.subplot\").each(function(t){var e=c._plots[t],r=e.xaxis,n=e.yaxis;e.xaxislayer.selectAll(\".\"+r._id+\"tick\").remove(),e.yaxislayer.selectAll(\".\"+n._id+\"tick\").remove(),e.gridlayer.selectAll(\"path\").remove(),e.zerolinelayer.selectAll(\"path\").remove()}),!e||\"redraw\"===e)return _.syncOrAsync(O.list(t,\"\",!0).map(function(r){return function(){if(r._id){var n=O.doTicks(t,r._id);return\"redraw\"===e&&(r._r=r.range.slice(),r._rl=_.simpleMap(r._r,r.r2l)),n}}}));u.tickformat||(-1===[\"none\",\"e\",\"E\",\"power\",\"SI\",\"B\"].indexOf(u.exponentformat)&&(u.exponentformat=\"e\"),-1===[\"all\",\"first\",\"last\",\"none\"].indexOf(u.showexponent)&&(u.showexponent=\"all\")),u.setScale();var f,d,p,m,g,v=e.charAt(0),T=O.counterLetter(e),S=O.calcTicks(u),E=function(t){return[t.text,t.x,u.mirror].join(\"_\")},L=e+\"tick\",C=e+\"grid\",z=e+\"zl\",D=(u.linewidth||1)/2,I=(\"outside\"===u.ticks?u.ticklen:1)+(u.linewidth||0),P=0,R=A.crispRound(t,u.gridwidth,1),F=A.crispRound(t,u.zerolinewidth,R),N=A.crispRound(t,u.tickwidth,1);if(u._counterangle&&\"outside\"===u.ticks){var B=u._counterangle*Math.PI/180;I=u.ticklen*Math.cos(B)+(u.linewidth||0),P=u.ticklen*Math.sin(B)}if(\"x\"===v)f=[\"bottom\",\"top\"],d=function(t){return\"translate(\"+u.l2p(t.x)+\",0)\"},p=function(t,e){if(u._counterangle){var r=u._counterangle*Math.PI/180;return\"M0,\"+t+\"l\"+Math.sin(r)*e+\",\"+Math.cos(r)*e}return\"M0,\"+t+\"v\"+e};else{if(\"y\"!==v)return void _.warn(\"Unrecognized doTicks axis:\",e);f=[\"left\",\"right\"],d=function(t){return\"translate(0,\"+u.l2p(t.x)+\")\"},p=function(t,e){if(u._counterangle){var r=u._counterangle*Math.PI/180;return\"M\"+t+\",0l\"+Math.cos(r)*e+\",\"+-Math.sin(r)*e}return\"M\"+t+\",0h\"+e}}var U=u.side||f[0],V=[-1,1,U===f[1]?1:-1];if(\"inside\"!==u.ticks==(\"x\"===v)&&(V=V.map(function(t){return-t})),u.visible){var H=S.filter(n);if(h)return i(u._axislayer,p(u._pos+D*V[2],V[2]*u.ticklen)),u._counteraxis&&l({gridlayer:u._gridlayer,zerolinelayer:u._zerolinelayer},u._counteraxis),a(u._axislayer,u._pos);var q=(m=O.getSubplots(t,u)).map(function(t){var e=c._plots[t];if(c._has(\"cartesian\")){var r=e[v+\"axislayer\"],n=u._linepositions[t]||[],o=e[T+\"axis\"],s=o._id===u.anchor,h=[!1,!1,!1],d=\"\";if(\"allticks\"===u.mirror?h=[!0,!0,!1]:s&&(\"ticks\"===u.mirror?h=[!0,!0,!1]:h[f.indexOf(U)]=!0),u.mirrors)for(g=0;g<2;g++){var m=u.mirrors[o._id+f[g]];\"ticks\"!==m&&\"labels\"!==m||(h[g]=!0)}return void 0!==n[2]&&(h[2]=!0),h.forEach(function(t,e){var r=n[e],i=V[e];t&&b(r)&&(d+=p(r+D*i,i*u.ticklen))}),i(r,d),l(e,o,t),a(r,n[3])}}).filter(function(t){return t&&t.then});return q.length?Promise.all(q):0}},O.swap=function(t,e){for(var r=p(t,e),n=0;n<r.length;n++)g(t,r[n].x,r[n].y)}},{\"../../components/color\":578,\"../../components/drawing\":602,\"../../components/titles\":655,\"../../constants/numerical\":666,\"../../lib\":685,\"../../lib/svg_text_utils\":704,\"../../registry\":802,\"./axis_ids\":727,\"./layout_attributes\":735,\"./layout_defaults\":736,\"./set_convert\":741,d3:107,\"fast-isnumeric\":116}],725:[function(t,e,r){\"use strict\";function n(t){if(!t)return!1;for(var e=0;e<t.length;e++)if(o(t[e]))return!0;return!1}function i(t,e){for(var r,n=0,i=0,a=Math.max(1,(t.length-1)/1e3),l=0;l<t.length;l+=a)r=t[Math.round(l)],s.isDateTime(r,e)&&(n+=1),o(r)&&(i+=1);return n>2*i}function a(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,i=0,a=0;a<t.length;a+=r)e=t[Math.round(a)],s.cleanNumber(e)!==l?n++:\"string\"==typeof e&&\"\"!==e&&\"None\"!==e&&i++;return i>2*n}var o=t(\"fast-isnumeric\"),s=t(\"../../lib\"),l=t(\"../../constants/numerical\").BADNUM;e.exports=function(t,e){return i(t,e)?\"date\":a(t)?\"category\":n(t)?\"linear\":\"-\"}},{\"../../constants/numerical\":666,\"../../lib\":685,\"fast-isnumeric\":116}],726:[function(t,e,r){\"use strict\";var n=t(\"tinycolor2\").mix,i=t(\"../../registry\"),a=t(\"../../lib\"),o=t(\"../../components/color/attributes\").lightFraction,s=t(\"./layout_attributes\"),l=t(\"./tick_value_defaults\"),u=t(\"./tick_mark_defaults\"),c=t(\"./tick_label_defaults\"),h=t(\"./category_order_defaults\"),f=t(\"./set_convert\"),d=t(\"./ordered_categories\");e.exports=function(t,e,r,p,m){function g(r,n){return a.coerce2(t,e,s,r,n)}var v=p.letter,y=p.font||{},b=\"Click to enter \"+(p.title||v.toUpperCase()+\" axis\")+\" title\",x=r(\"visible\",!p.cheateronly),_=e.type;if(\"date\"===_&&i.getComponentMethod(\"calendars\",\"handleDefaults\")(t,e,\"calendar\",p.calendar),f(e,m),r(\"autorange\",!e.isValidRange(t.range))&&r(\"rangemode\"),r(\"range\"),e.cleanRange(),h(t,e,r),e._initialCategories=\"category\"===_?d(v,e.categoryorder,e.categoryarray,p.data):[],!x)return e;var w=r(\"color\"),M=w===t.color?w:y.color;r(\"title\",b),a.coerceFont(r,\"titlefont\",{family:y.family,size:Math.round(1.2*y.size),color:M}),l(t,e,r,_),c(t,e,r,_,p),u(t,e,r,p);var k=g(\"linecolor\",w),A=g(\"linewidth\"),T=r(\"showline\",!!k||!!A);T||(delete e.linecolor,delete e.linewidth),(T||e.ticks)&&r(\"mirror\");var S=g(\"gridcolor\",n(w,p.bgColor,o).toRgbString()),E=g(\"gridwidth\");r(\"showgrid\",p.showGrid||!!S||!!E)||(delete e.gridcolor,delete e.gridwidth);var L=g(\"zerolinecolor\",w),C=g(\"zerolinewidth\");return r(\"zeroline\",p.showGrid||!!L||!!C)||(delete e.zerolinecolor,delete e.zerolinewidth),e}},{\"../../components/color/attributes\":577,\"../../lib\":685,\"../../registry\":802,\"./category_order_defaults\":728,\"./layout_attributes\":735,\"./ordered_categories\":737,\"./set_convert\":741,\"./tick_label_defaults\":742,\"./tick_mark_defaults\":743,\"./tick_value_defaults\":744,tinycolor2:514}],727:[function(t,e,r){\"use strict\";function n(t,e,r){function n(t,r){for(var n=Object.keys(t),i=/^[xyz]axis[0-9]*/,a=[],o=0;o<n.length;o++){var s=n[o];e&&s.charAt(0)!==e||i.test(s)&&a.push(r+s)}return a.sort()}var i=t._fullLayout;if(!i)return[];var o=n(i,\"\");if(r)return o;for(var s=a.getSubplotIds(i,\"gl3d\")||[],l=0;l<s.length;l++){var u=s[l];o=o.concat(n(i[u],u+\".\"))}return o}var i=t(\"../../registry\"),a=t(\"../plots\"),o=t(\"../../lib\"),s=t(\"./constants\");r.id2name=function(t){if(\"string\"==typeof t&&t.match(s.AX_ID_PATTERN)){var e=t.substr(1);return\"1\"===e&&(e=\"\"),t.charAt(0)+\"axis\"+e}},r.name2id=function(t){if(t.match(s.AX_NAME_PATTERN)){var e=t.substr(5);return\"1\"===e&&(e=\"\"),t.charAt(0)+e}},r.cleanId=function(t,e){if(t.match(s.AX_ID_PATTERN)&&(!e||t.charAt(0)===e)){var r=t.substr(1).replace(/^0+/,\"\");return\"1\"===r&&(r=\"\"),t.charAt(0)+r}},r.list=function(t,e,r){return n(t,e,r).map(function(e){return o.nestedProperty(t._fullLayout,e).get()})},r.listIds=function(t,e){return n(t,e,!0).map(r.name2id)},r.getFromId=function(t,e,n){var i=t._fullLayout;return\"x\"===n?e=e.replace(/y[0-9]*/,\"\"):\"y\"===n&&(e=e.replace(/x[0-9]*/,\"\")),i[r.id2name(e)]},r.getFromTrace=function(t,e,n){var a=t._fullLayout,o=null;if(i.traceIs(e,\"gl3d\")){var s=e.scene;\"scene\"===s.substr(0,5)&&(o=a[s][n+\"axis\"])}else o=r.getFromId(t,e[n+\"axis\"]||n);return o}},{\"../../lib\":685,\"../../registry\":802,\"../plots\":787,\"./constants\":729}],728:[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\")}}},{}],729:[function(t,e,r){\"use strict\";e.exports={idRegex:{x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},attrRegex:{x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},xAxisMatch:/^xaxis[0-9]*$/,yAxisMatch:/^yaxis[0-9]*$/,AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,MAXDIST:20,YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:\"Arial, sans-serif\",HOVERMINTIME:50,BENDPX:1.5,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4]}},{}],730:[function(t,e,r){\"use strict\";function n(t,e,r,n){var i,a,s,l,u=n[o(e)].type,c=[];for(a=0;a<r.length;a++)(s=r[a])!==e&&((l=n[o(s)]).type!==u||l.fixedrange||c.push(s));for(i=0;i<t.length;i++)if(t[i][e]){var h=t[i],f=[];for(a=0;a<c.length;a++)h[s=c[a]]||f.push(s);return{linkableAxes:f,thisGroup:h}}return{linkableAxes:c,thisGroup:null}}function i(t,e,r,n,i){var a,o,s,l,u;null===e?((e={})[r]=1,u=t.length,t.push(e)):u=t.indexOf(e);var c=Object.keys(e);for(a=0;a<t.length;a++)if(s=t[a],a!==u&&s[n]){var h=s[n];for(o=0;o<c.length;o++)s[l=c[o]]=h*i*e[l];return void t.splice(u,1)}if(1!==i)for(o=0;o<c.length;o++)e[c[o]]*=i;e[n]=1}var a=t(\"../../lib\"),o=t(\"./axis_ids\").id2name;e.exports=function(t,e,r,o,s){var l=s._axisConstraintGroups;if(!e.fixedrange&&t.scaleanchor){var u=n(l,e._id,o,s),c=a.coerce(t,e,{scaleanchor:{valType:\"enumerated\",values:u.linkableAxes}},\"scaleanchor\");if(c){var h=r(\"scaleratio\");h||(h=e.scaleratio=1),i(l,u.thisGroup,e._id,c,h)}else-1!==o.indexOf(t.scaleanchor)&&a.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\":685,\"./axis_ids\":727}],731:[function(t,e,r){\"use strict\";var n=t(\"./axis_ids\").id2name,i=t(\"./scale_zoom\"),a=t(\"../../constants/numerical\").ALMOST_EQUAL;e.exports=function(t){var e,r,o,s,l,u=t._fullLayout,c=u._axisConstraintGroups;for(e=0;e<c.length;e++){var h=c[e],f=Object.keys(h),d=1/0,p=0,m=1/0,g={},v={};for(r=0;r<f.length;r++)v[o=f[r]]=s=u[n(o)],s.setScale(),g[o]=l=Math.abs(s._m)/h[o],d=Math.min(d,l),s._constraintShrinkable?delete s._constraintShrinkable:m=Math.min(m,l),p=Math.max(p,l);if(!(d>a*p))for(r=0;r<f.length;r++)(l=g[o=f[r]])!==m&&i(v[o],l/m)}}},{\"../../constants/numerical\":666,\"./axis_ids\":727,\"./scale_zoom\":739}],732:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o){var s=t.draglayer.selectAll(\".\"+e).data([0]);return s.enter().append(\"rect\").classed(\"drag\",!0).classed(e,!0).style({fill:\"transparent\",\"stroke-width\":0}).attr(\"data-subplot\",t.id),s.call(S.setRect,n,i,a,o).call(E,r),s.node()}function i(t,e){for(var r=0;r<t.length;r++)if(!t[r].fixedrange)return e;return\"\"}function a(t,e){var r,n=t.range[e],i=Math.abs(n-t.range[1-e]);return\"date\"===t.type?n:\"log\"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,x.format(\".\"+r+\"g\")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,x.format(\".\"+String(r)+\"g\")(n))}function o(t,e,r,n){var i,a,s,l;for(i=0;i<t.length;i++)(a=t[i]).fixedrange||(s=a._rl[0],l=a._rl[1]-s,a.range=[a.l2r(s+l*e),a.l2r(s+l*r)]);if(n&&n.length){var u=(e+(1-r))/2;o(n,u,1-u)}}function s(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 l(t){return 1-(t>=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function u(t,e){return t?\"nsew\"===t?\"pan\"===e?\"move\":\"crosshair\":t.toLowerCase()+\"-resize\":\"pointer\"}function c(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 h(t,e,r){return t.append(\"path\").attr(\"class\",\"zoombox-corners\").style({fill:T.background,stroke:T.defaultLine,\"stroke-width\":1,opacity:0}).attr(\"transform\",\"translate(\"+e+\", \"+r+\")\").attr(\"d\",\"M0,0Z\")}function f(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.transition().style(\"fill\",a>.2?\"rgba(0,0,0,0.4)\":\"rgba(255,255,255,0.3)\").duration(200),e.transition().style(\"opacity\",1).duration(200))}function p(t){x.select(t).selectAll(\".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners\").remove()}function m(t){return-1!==[\"lasso\",\"select\"].indexOf(t)}function g(t,e){return\"M\"+(t.l-.5)+\",\"+(e-j-.5)+\"h-3v\"+(2*j+1)+\"h3ZM\"+(t.r+.5)+\",\"+(e-j-.5)+\"h3v\"+(2*j+1)+\"h-3Z\"}function v(t,e){return\"M\"+(e-j-.5)+\",\"+(t.t-.5)+\"v-3h\"+(2*j+1)+\"v3ZM\"+(e-j-.5)+\",\"+(t.b+.5)+\"v3h\"+(2*j+1)+\"v-3Z\"}function y(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,j)/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,r){var n,i,a,o,s,l,u=!1,c={},h={};for(n=0;n<t.length;n++){for(o=t[n],i=0;i<e.length;i++)if(o[e[i]]){for(s in o)-1===(\"x\"===s.charAt(0)?e:r).indexOf(s)&&(c[s]=1);for(a=0;a<r.length;a++)o[r[a]]&&(u=!0)}for(i=0;i<r.length;i++)if(o[r[i]])for(l in o)-1===(\"x\"===l.charAt(0)?e:r).indexOf(l)&&(h[l]=1)}return u&&(k.extendFlat(c,h),h={}),{x:c,y:h,xy:u}}var x=t(\"d3\"),_=t(\"tinycolor2\"),w=t(\"../../plotly\"),M=t(\"../../registry\"),k=t(\"../../lib\"),A=t(\"../../lib/svg_text_utils\"),T=t(\"../../components/color\"),S=t(\"../../components/drawing\"),E=t(\"../../lib/setcursor\"),L=t(\"../../components/dragelement\"),C=t(\"./axes\").doTicks,z=t(\"./axis_ids\").getFromId,D=t(\"./select\"),I=t(\"./scale_zoom\"),P=t(\"./constants\"),O=P.MINDRAG,j=P.MINZOOM,R=!0;e.exports=function(t,e,r,T,E,F,N,B){function U(){$=[e.xaxis],tt=[e.yaxis];var r=$[0],n=tt[0];nt=r._length,it=n._length;var a=ht._axisConstraintGroups,o=[r._id],s=[n._id];K=[e].concat(N&&B?e.overlays:[]);for(var l=1;l<K.length;l++){var c=K[l].xaxis,h=K[l].yaxis;-1===$.indexOf(c)&&($.push(c),o.push(c._id)),-1===tt.indexOf(h)&&(tt.push(h),s.push(h._id))}at=i($,B),ot=i(tt,N),st=u(ot+at,ht.dragmode),et=r._offset,rt=n._offset;var f=b(a,o,s);lt=f.xy,ut=[];for(var d in f.x)ut.push(z(t,d));ct=[];for(var p in f.y)ct.push(z(t,p))}function V(e,r,n){var i=pt.getBoundingClientRect();gt=r-i.left,vt=n-i.top,yt={l:gt,r:gt,w:0,t:vt,b:vt,h:0},bt=t._hmpixcount?t._hmlumcount/t._hmpixcount:_(t._fullLayout.plot_bgcolor).getLuminance(),_t=!1,wt=\"xy\",Mt=c(ft,bt,et,rt,xt=\"M0,0H\"+nt+\"V\"+it+\"H0V0\"),kt=h(ft,et,rt),f(ft)}function H(e,r){function n(){wt=\"\",yt.r=yt.l,yt.t=yt.b,kt.attr(\"d\",\"M0,0Z\")}if(t._transitioningWithDuration)return!1;var i=Math.max(0,Math.min(nt,e+gt)),a=Math.max(0,Math.min(it,r+vt)),o=Math.abs(i-gt),s=Math.abs(a-vt);yt.l=Math.min(gt,i),yt.r=Math.max(gt,i),yt.t=Math.min(vt,a),yt.b=Math.max(vt,a),lt?o>j||s>j?(wt=\"xy\",o/nt>s/it?(s=o*it/nt,vt>a?yt.t=vt-s:yt.b=vt+s):(o=s*nt/it,gt>i?yt.l=gt-o:yt.r=gt+o),kt.attr(\"d\",y(yt))):n():!ot||s<Math.min(Math.max(.6*o,O),j)?o<O?n():(yt.t=0,yt.b=it,wt=\"x\",kt.attr(\"d\",g(yt,vt))):!at||o<Math.min(.6*s,j)?(yt.l=0,yt.r=nt,wt=\"y\",kt.attr(\"d\",v(yt,gt))):(wt=\"xy\",kt.attr(\"d\",y(yt))),yt.w=yt.r-yt.l,yt.h=yt.b-yt.t,d(Mt,kt,yt,xt,_t,bt),_t=!0}function q(e,r){if(Math.min(yt.h,yt.w)<2*O)return 2===r&&Z(),p(t);\"xy\"!==wt&&\"x\"!==wt||o($,yt.l/nt,yt.r/nt,ut),\"xy\"!==wt&&\"y\"!==wt||o(tt,(it-yt.b)/it,(it-yt.t)/it,ct),p(t),J(wt),R&&t.data&&t._context.showTips&&(k.notifier(\"Double-click to<br>zoom back out\",\"long\"),R=!1)}function G(e,r){var n=1===(N+B).length;if(e)J();else if(2!==r||n){if(1===r&&n){var i=N?tt[0]:$[0],o=\"s\"===N||\"w\"===B?0:1,s=i._name+\".range[\"+o+\"]\",l=a(i,o),u=\"left\",c=\"middle\";if(i.fixedrange)return;N?(c=\"n\"===N?\"top\":\"bottom\",\"right\"===i.side&&(u=\"right\")):\"e\"===B&&(u=\"right\"),t._context.showAxisRangeEntryBoxes&&x.select(pt).call(A.makeEditable,null,{immediate:!0,background:ht.paper_bgcolor,text:String(l),fill:i.tickfont?i.tickfont.color:\"#444\",horizontalAlign:u,verticalAlign:c}).on(\"edit\",function(e){var r=i.d2r(e);void 0!==r&&w.relayout(t,s,r)})}}else Z()}function Y(e){function r(t,e,r){function n(e){return t.l2r(a+(e-a)*r)}if(!t.fixedrange){var i=k.simpleMap(t.range,t.r2l),a=i[0]+(i[1]-i[0])*e;t.range=i.map(n)}}if(t._context.scrollZoom||ht._enablescrollzoom){if(t._transitioningWithDuration)return k.pauseEvent(e);var n=t.querySelector(\".plotly\");if(U(),!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(Tt);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),isFinite(i)){var a,o=Math.exp(-Math.min(Math.max(i,-20),20)/100),s=Et.draglayer.select(\".nsewdrag\").node().getBoundingClientRect(),l=(e.clientX-s.left)/s.width,u=(s.bottom-e.clientY)/s.height;if(B||lt){for(B||(l=.5),a=0;a<$.length;a++)r($[a],l,o);At[2]*=o,At[0]+=At[2]*l*(1/o-1)}if(N||lt){for(N||(u=.5),a=0;a<tt.length;a++)r(tt[a],u,o);At[3]*=o,At[1]+=At[3]*(1-u)*(1/o-1)}return Q(At),X(N,B),Tt=setTimeout(function(){At=[0,0,nt,it];J(lt?\"xy\":(B?\"x\":\"\")+(N?\"y\":\"\"))},St),k.pauseEvent(e)}k.log(\"Did not find wheel motion attributes: \",e)}}}function W(e,r){function n(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])/l(r/s._length);var u=s.l2r(i);!1!==u&&void 0!==u&&(s.range[e]=u)}}return n._length*(n._rl[e]-i)/(n._rl[e]-n._rl[a])}if(!t._transitioningWithDuration){if(U(),\"ew\"===at||\"ns\"===ot)return at&&s($,e),ot&&s(tt,r),Q([at?-e:0,ot?-r:0,nt,it]),void X(ot,at);if(lt&&at&&ot){var i=\"w\"===at==(\"n\"===ot)?1:-1,a=(e/nt+i*r/it)/2;e=a*nt,r=i*a*it}\"w\"===at?e=n($,0,e):\"e\"===at?e=n($,1,-e):at||(e=0),\"n\"===ot?r=n(tt,1,r):\"s\"===ot?r=n(tt,0,-r):ot||(r=0);var o=\"w\"===at?e:0,u=\"n\"===ot?r:0;if(lt){var c;if(!at&&1===ot.length){for(c=0;c<$.length;c++)$[c].range=$[c]._r.slice(),I($[c],1-r/it);o=(e=r*nt/it)/2}if(!ot&&1===at.length){for(c=0;c<tt.length;c++)tt[c].range=tt[c]._r.slice(),I(tt[c],1-e/nt);u=(r=e*it/nt)/2}}Q([o,u,nt-e,it-r]),X(ot,at)}}function X(e,r){function n(t){for(a=0;a<t.length;a++)t[a].fixedrange||o.push(t[a]._id)}function i(n,i,s){for(a=0;a<n.length;a++){var l=n[a];if((r&&-1!==o.indexOf(l.xref)||e&&-1!==o.indexOf(l.yref))&&(i(t,a),s))return}}var a,o=[];for((r||lt)&&(n($),n(ut)),(e||lt)&&(n(tt),n(ct)),a=0;a<o.length;a++)C(t,o[a],!0);i(ht.annotations||[],M.getComponentMethod(\"annotations\",\"drawOne\")),i(ht.shapes||[],M.getComponentMethod(\"shapes\",\"drawOne\")),i(ht.images||[],M.getComponentMethod(\"images\",\"draw\"),!0)}function Z(){if(!t._transitioningWithDuration){var e,r,n,i=t._context.doubleClick,a=(at?$:[]).concat(ot?tt:[]),o={};if(\"reset+autosize\"===i)for(i=\"autosize\",r=0;r<a.length;r++)if((e=a[r])._rangeInitial&&(e.range[0]!==e._rangeInitial[0]||e.range[1]!==e._rangeInitial[1])||!e._rangeInitial&&!e.autorange){i=\"reset\";break}if(\"autosize\"===i)for(r=0;r<a.length;r++)(e=a[r]).fixedrange||(o[e._name+\".autorange\"]=!0);else if(\"reset\"===i)for((at||lt)&&(a=a.concat(ut)),ot&&!lt&&(a=a.concat(ct)),lt&&(at?ot||(a=a.concat(tt)):a=a.concat($)),r=0;r<a.length;r++)(e=a[r])._rangeInitial?(n=e._rangeInitial,o[e._name+\".range[0]\"]=n[0],o[e._name+\".range[1]\"]=n[1]):o[e._name+\".autorange\"]=!0;t.emit(\"plotly_doubleclick\",null),w.relayout(t,o)}}function J(e){void 0===e&&(e=(B?\"x\":\"\")+(N?\"y\":\"\"));var r,n={};\"xy\"===e?r=$.concat(tt):\"x\"===e?r=$:\"y\"===e&&(r=tt);for(var i=0;i<r.length;i++){var a=r[i];a._r[0]!==a.range[0]&&(n[a._name+\".range[0]\"]=a.range[0]),a._r[1]!==a.range[1]&&(n[a._name+\".range[1]\"]=a.range[1]),a.range=a._input.range=a._r.slice()}Q([0,0,nt,it]),w.relayout(t,n)}function Q(t){function e(t){return t.fixedrange?0:f&&-1!==ut.indexOf(t)?c:d&&-1!==(lt?ut:ct).indexOf(t)?h:0}function r(t,e){return e?(t.range=t._r.slice(),I(t,e),t._length*(1-e)/2):0}var n,i,a,o,s,l=ht._plots,u=Object.keys(l),c=t[2]/$[0]._length,h=t[3]/tt[0]._length,f=B||lt,d=N||lt;for(n=0;n<u.length;n++){var p=l[u[n]],m=p.xaxis,g=p.yaxis,v=f&&!m.fixedrange&&-1!==$.indexOf(m),y=d&&!g.fixedrange&&-1!==tt.indexOf(g);if(v?(i=c,o=t[0]):o=r(m,i=e(m)),y?(a=h,s=t[1]):s=r(g,a=e(g)),i||a){i||(i=1),a||(a=1);var b=m._offset-o/i,x=g._offset-s/a;ht._defs.selectAll(\"#\"+p.clipId).call(S.setTranslate,o,s).call(S.setScale,i,a),p.plot.call(S.setTranslate,b,x).call(S.setScale,1/i,1/a).select(\".scatterlayer\").selectAll(\".points\").selectAll(\".point\").call(S.setPointGroupScale,i,a)}}}var K,$,tt,et,rt,nt,it,at,ot,st,lt,ut,ct,ht=t._fullLayout,ft=t._fullLayout._zoomlayer,dt=N+B===\"nsew\";U();var pt=n(e,N+B+\"drag\",st,r,T,E,F);if(!ot&&!at&&!m(ht.dragmode))return pt.onmousedown=null,pt.style.pointerEvents=dt?\"all\":\"none\",pt;var mt={element:pt,gd:t,plotinfo:e,doubleclick:Z,prepFn:function(e,r,n){var i=t._fullLayout.dragmode;dt?e.shiftKey&&(i=\"pan\"===i?\"zoom\":\"pan\"):i=\"pan\",mt.minDrag=\"lasso\"===i?1:void 0,\"zoom\"===i?(mt.moveFn=H,mt.doneFn=q,mt.minDrag=1,V(e,r,n)):\"pan\"===i?(mt.moveFn=W,mt.doneFn=G,f(ft)):m(i)&&(mt.xaxes=$,mt.yaxes=tt,D(e,r,n,mt,i))}};L.init(mt);var gt,vt,yt,bt,xt,_t,wt,Mt,kt,At=[0,0,nt,it],Tt=null,St=P.REDRAWDELAY,Et=e.mainplot?ht._plots[e.mainplot]:e;return N.length*B.length!=1&&(void 0!==pt.onwheel?pt.onwheel=Y:void 0!==pt.onmousewheel&&(pt.onmousewheel=Y)),pt}},{\"../../components/color\":578,\"../../components/dragelement\":599,\"../../components/drawing\":602,\"../../lib\":685,\"../../lib/setcursor\":700,\"../../lib/svg_text_utils\":704,\"../../plotly\":719,\"../../registry\":802,\"./axes\":724,\"./axis_ids\":727,\"./constants\":729,\"./scale_zoom\":739,\"./select\":740,d3:107,tinycolor2:514}],733:[function(t,e,r){\"use strict\";function n(t,e){for(var r=[],n=t.length;n>0;n--)r.push(e);return r}function i(t,e){for(var r=[],n=0;n<t.length;n++)r.push(t[n].p2c(e));return r}function a(t,e){return function(r){var n=t(r),i=e(r);return Math.sqrt(n*n+i*i)}}function o(t,e,r){if(\"pie\"!==r){r||(r=\"xy\");var a=Array.isArray(r)?r:[r],o=t._fullLayout,g=o._plots||[],b=g[r];if(b){var _=b.overlays.map(function(t){return t.id});a=a.concat(_)}for(var S=a.length,E=new Array(S),L=new Array(S),C=0;C<S;C++){var z=a[C],D=g[z];if(D)E[C]=A.getFromId(t,D.xaxis._id),L[C]=A.getFromId(t,D.yaxis._id);else{var I=o[z]._subplot;E[C]=I.xaxis,L[C]=I.yaxis}}var P=e.hovermode||o.hovermode;if(-1===[\"x\",\"y\",\"closest\"].indexOf(P)||!t.calcdata||t.querySelector(\".zoombox\")||t._dragging)return w.unhoverRaw(t,e);var O,j,R,F,N,B,U,V,H,q,G,Y,W,X=[],Z=[];if(Array.isArray(e))for(P=\"array\",R=0;R<e.length;R++)\"skip\"!==(N=t.calcdata[e[R].curveNumber||0])[0].trace.hoverinfo&&Z.push(N);else{for(F=0;F<t.calcdata.length;F++)\"skip\"!==(B=(N=t.calcdata[F])[0].trace).hoverinfo&&-1!==a.indexOf(s(B))&&Z.push(N);var J,Q;if(!e.target)J=\"xpx\"in e?e.xpx:E[0]._length/2,Q=\"ypx\"in e?e.ypx:L[0]._length/2;else{if(!1===y.triggerHandler(t,\"plotly_beforehover\",e))return;var K=e.target.getBoundingClientRect();if(J=e.clientX-K.left,Q=e.clientY-K.top,J<0||J>K.width||Q<0||Q>K.height)return w.unhoverRaw(t,e)}if(O=\"xval\"in e?n(a,e.xval):i(E,J),j=\"yval\"in e?n(a,e.yval):i(L,Q),!m(O[0])||!m(j[0]))return v.warn(\"Fx.hover failed\",e,t),w.unhoverRaw(t,e)}var $=1/0;for(F=0;F<Z.length;F++)if((N=Z[F])&&N[0]&&N[0].trace&&!0===N[0].trace.visible&&(B=N[0].trace,-1===[\"carpet\",\"contourcarpet\"].indexOf(B._module.name))){if(U=s(B),V=a.indexOf(U),H=P,Y={cd:N,trace:B,xa:E[V],ya:L[V],name:t.data.length>1||-1!==B.hoverinfo.indexOf(\"name\")?B.name:void 0,index:!1,distance:Math.min($,T.MAXDIST),color:x.defaultLine,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},o[U]&&(Y.subplot=o[U]._subplot),W=X.length,\"array\"===H){var tt=e[F];\"pointNumber\"in tt?(Y.index=tt.pointNumber,H=\"closest\"):(H=\"\",\"xval\"in tt&&(q=tt.xval,H=\"x\"),\"yval\"in tt&&(G=tt.yval,H=H?\"closest\":\"y\"))}else q=O[V],G=j[V];if(B._module&&B._module.hoverPoints){var et=B._module.hoverPoints(Y,q,G,H);if(et)for(var rt,nt=0;nt<et.length;nt++)rt=et[nt],m(rt.x0)&&m(rt.y0)&&X.push(l(rt,P))}else v.log(\"Unrecognized trace type in hover:\",B);\"closest\"===P&&X.length>W&&(X.splice(0,W),$=X[0].distance)}if(0===X.length)return w.unhoverRaw(t,e);X.sort(function(t,e){return t.distance-e.distance});var it=t._hoverdata,at=[];for(R=0;R<X.length;R++){var ot=X[R],st={data:ot.trace._input,fullData:ot.trace,curveNumber:ot.trace.index,pointNumber:ot.index};ot.trace._module.eventData?st=ot.trace._module.eventData(st,ot):(st.x=ot.xVal,st.y=ot.yVal,st.xaxis=ot.xa,st.yaxis=ot.ya,void 0!==ot.zLabelVal&&(st.z=ot.zLabelVal)),at.push(st)}t._hoverdata=at,d(t,e,it)&&o._hasCartesian&&u(X,{hovermode:P,fullLayout:o,container:o._hoverlayer,outerContainer:o._paperdiv});var lt=\"y\"===P&&Z.length>1,ut=c(X,{hovermode:P,rotateLabels:lt,bgColor:x.combine(o.plot_bgcolor||x.background,o.paper_bgcolor),container:o._hoverlayer,outerContainer:o._paperdiv});if(h(X,lt?\"xa\":\"ya\"),f(ut,lt),e.target&&e.target.tagName){var ct=k.getComponentMethod(\"annotations\",\"hasClickToShow\")(t,at);M(p.select(e.target),ct?\"pointer\":\"\")}e.target&&d(t,e,it)&&(it&&t.emit(\"plotly_unhover\",{event:e,points:it}),t.emit(\"plotly_hover\",{event:e,points:t._hoverdata,xaxes:E,yaxes:L,xvals:O,yvals:j}))}else t.emit(\"plotly_hover\",{event:e.originalEvent,points:[e]})}function s(t){return t.subplot||t.xaxis+t.yaxis||t.geo}function l(t,e){t.posref=\"y\"===e?(t.x0+t.x1)/2:(t.y0+t.y1)/2,t.x0=v.constrain(t.x0,0,t.xa._length),t.x1=v.constrain(t.x1,0,t.xa._length),t.y0=v.constrain(t.y0,0,t.ya._length),t.y1=v.constrain(t.y1,0,t.ya._length);var r;if(void 0!==t.xLabelVal){r=\"log\"===t.xa.type&&t.xLabelVal<=0;var n=A.tickText(t.xa,t.xa.c2l(r?-t.xLabelVal:t.xLabelVal),\"hover\");r?0===t.xLabelVal?t.xLabel=\"0\":t.xLabel=\"-\"+n.text:t.xLabel=n.text,t.xVal=t.xa.c2d(t.xLabelVal)}if(void 0!==t.yLabelVal){r=\"log\"===t.ya.type&&t.yLabelVal<=0;var i=A.tickText(t.ya,t.ya.c2l(r?-t.yLabelVal:t.yLabelVal),\"hover\");r?0===t.yLabelVal?t.yLabel=\"0\":t.yLabel=\"-\"+i.text:t.yLabel=i.text,t.yVal=t.ya.c2d(t.yLabelVal)}if(void 0!==t.zLabelVal&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||\"log\"===t.xa.type&&t.xerr<=0)){var a=A.tickText(t.xa,t.xa.c2l(t.xerr),\"hover\").text;void 0!==t.xerrneg?t.xLabel+=\" +\"+a+\" / -\"+A.tickText(t.xa,t.xa.c2l(t.xerrneg),\"hover\").text:t.xLabel+=\" ± \"+a,\"x\"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||\"log\"===t.ya.type&&t.yerr<=0)){var o=A.tickText(t.ya,t.ya.c2l(t.yerr),\"hover\").text;void 0!==t.yerrneg?t.yLabel+=\" +\"+o+\" / -\"+A.tickText(t.ya,t.ya.c2l(t.yerrneg),\"hover\").text:t.yLabel+=\" ± \"+o,\"y\"===e&&(t.distance+=1)}var s=t.trace.hoverinfo;return\"all\"!==s&&(-1===(s=s.split(\"+\")).indexOf(\"x\")&&(t.xLabel=void 0),-1===s.indexOf(\"y\")&&(t.yLabel=void 0),-1===s.indexOf(\"z\")&&(t.zLabel=void 0),-1===s.indexOf(\"text\")&&(t.text=void 0),-1===s.indexOf(\"name\")&&(t.name=void 0)),t}function u(t,e){var r=e.hovermode,n=e.container,i=t[0],a=i.xa,o=i.ya,s=a.showspikes,l=o.showspikes;if(n.selectAll(\".spikeline\").remove(),\"closest\"===r&&(s||l)){var u=e.fullLayout,c=a._offset+(i.x0+i.x1)/2,h=o._offset+(i.y0+i.y1)/2,f=x.combine(u.plot_bgcolor,u.paper_bgcolor),d=g.readability(i.color,f)<1.5?x.contrast(f):i.color;if(l){var p=o.spikemode,m=o.spikethickness,v=o.spikecolor||d,y=o._boundingBox,b=(y.left+y.right)/2<c?y.right:y.left;if(-1!==p.indexOf(\"toaxis\")||-1!==p.indexOf(\"across\")){var w=b,M=c;-1!==p.indexOf(\"across\")&&(w=o._counterSpan[0],M=o._counterSpan[1]),n.append(\"line\").attr({x1:w,x2:M,y1:h,y2:h,\"stroke-width\":m+2,stroke:f}).classed(\"spikeline\",!0).classed(\"crisp\",!0),n.append(\"line\").attr({x1:w,x2:M,y1:h,y2:h,\"stroke-width\":m,stroke:v,\"stroke-dasharray\":_.dashStyle(o.spikedash,m)}).classed(\"spikeline\",!0).classed(\"crisp\",!0)}-1!==p.indexOf(\"marker\")&&n.append(\"circle\").attr({cx:b+(\"right\"!==o.side?m:-m),cy:h,r:m,fill:v}).classed(\"spikeline\",!0)}if(s){var k=a.spikemode,A=a.spikethickness,T=a.spikecolor||d,S=a._boundingBox,E=(S.top+S.bottom)/2<h?S.bottom:S.top;if(-1!==k.indexOf(\"toaxis\")||-1!==k.indexOf(\"across\")){var L=E,C=h;-1!==k.indexOf(\"across\")&&(L=a._counterSpan[0],C=a._counterSpan[1]),n.append(\"line\").attr({x1:c,x2:c,y1:L,y2:C,\"stroke-width\":A+2,stroke:f}).classed(\"spikeline\",!0).classed(\"crisp\",!0),n.append(\"line\").attr({x1:c,x2:c,y1:L,y2:C,\"stroke-width\":A,stroke:T,\"stroke-dasharray\":_.dashStyle(a.spikedash,A)}).classed(\"spikeline\",!0).classed(\"crisp\",!0)}-1!==k.indexOf(\"marker\")&&n.append(\"circle\").attr({cx:c,cy:E-(\"top\"!==a.side?A:-A),r:A,fill:T}).classed(\"spikeline\",!0)}}}function c(t,e){var r,n,i=e.hovermode,a=e.rotateLabels,o=e.bgColor,s=e.container,l=e.outerContainer,u=e.fontFamily||T.HOVERFONT,c=e.fontSize||T.HOVERFONTSIZE,h=t[0],f=h.xa,d=h.ya,m=\"y\"===i?\"yLabel\":\"xLabel\",g=h[m],v=(String(g)||\"\").split(\" \")[0],y=l.node().getBoundingClientRect(),w=y.top,M=y.width,k=y.height,A=h.distance<=T.MAXDIST&&(\"x\"===i||\"y\"===i);for(r=0;r<t.length;r++){var S=(n=t[r].trace.hoverinfo).split(\"+\");if(-1===S.indexOf(\"all\")&&-1===S.indexOf(i)){A=!1;break}}var E=s.selectAll(\"g.axistext\").data(A?[0]:[]);E.enter().append(\"g\").classed(\"axistext\",!0),E.exit().remove(),E.each(function(){var e=p.select(this),r=e.selectAll(\"path\").data([0]),n=e.selectAll(\"text\").data([0]);r.enter().append(\"path\").style({fill:x.defaultLine,\"stroke-width\":\"1px\",stroke:x.background}),n.enter().append(\"text\").call(_.font,u,c,x.background).attr(\"data-notex\",1),n.text(g).call(b.convertToTspans).call(_.setPosition,0,0).selectAll(\"tspan.line\").call(_.setPosition,0,0),e.attr(\"transform\",\"\");var a=n.node().getBoundingClientRect();if(\"x\"===i){n.attr(\"text-anchor\",\"middle\").call(_.setPosition,0,\"top\"===f.side?w-a.bottom-O-j:w-a.top+O+j).selectAll(\"tspan.line\").attr({x:n.attr(\"x\"),y:n.attr(\"y\")});var o=\"top\"===f.side?\"-\":\"\";r.attr(\"d\",\"M0,0L\"+O+\",\"+o+O+\"H\"+(j+a.width/2)+\"v\"+o+(2*j+a.height)+\"H-\"+(j+a.width/2)+\"V\"+o+O+\"H-\"+O+\"Z\"),e.attr(\"transform\",\"translate(\"+(f._offset+(h.x0+h.x1)/2)+\",\"+(d._offset+(\"top\"===f.side?0:d._length))+\")\")}else{n.attr(\"text-anchor\",\"right\"===d.side?\"start\":\"end\").call(_.setPosition,(\"right\"===d.side?1:-1)*(j+O),w-a.top-a.height/2).selectAll(\"tspan.line\").attr({x:n.attr(\"x\"),y:n.attr(\"y\")});var s=\"right\"===d.side?\"\":\"-\";r.attr(\"d\",\"M0,0L\"+s+O+\",\"+O+\"V\"+(j+a.height/2)+\"h\"+s+(2*j+a.width)+\"V-\"+(j+a.height/2)+\"H\"+s+O+\"V-\"+O+\"Z\"),e.attr(\"transform\",\"translate(\"+(f._offset+(\"right\"===d.side?f._length:0))+\",\"+(d._offset+(h.y0+h.y1)/2)+\")\")}t=t.filter(function(t){return void 0!==t.zLabelVal||(t[m]||\"\").split(\" \")[0]===v})});var L=s.selectAll(\"g.hovertext\").data(t,function(t){return[t.trace.index,t.index,t.x0,t.y0,t.name,t.attr,t.xa,t.ya||\"\"].join(\",\")});return L.enter().append(\"g\").classed(\"hovertext\",!0).each(function(){var t=p.select(this);t.append(\"rect\").call(x.fill,x.addOpacity(o,.8)),t.append(\"text\").classed(\"name\",!0),t.append(\"path\").style(\"stroke-width\",\"1px\"),t.append(\"text\").classed(\"nums\",!0).call(_.font,u,c)}),L.exit().remove(),L.each(function(t){var e=p.select(this).attr(\"transform\",\"\"),r=\"\",n=\"\",s=x.opacity(t.color)?t.color:x.defaultLine,l=x.combine(s,o),h=t.borderColor||x.contrast(l);void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&void 0===t.zLabelVal&&(r=b.plainText(t.name||\"\")).length>15&&(r=r.substr(0,12)+\"...\"),void 0!==t.extraText&&(n+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(n+=\"x: \"+t.xLabel+\"<br>\"),void 0!==t.yLabel&&(n+=\"y: \"+t.yLabel+\"<br>\"),n+=(n?\"z: \":\"\")+t.zLabel):A&&t[i+\"Label\"]===g?n=t[(\"x\"===i?\"y\":\"x\")+\"Label\"]||\"\":void 0===t.xLabel?void 0!==t.yLabel&&(n=t.yLabel):n=void 0===t.yLabel?t.xLabel:\"(\"+t.xLabel+\", \"+t.yLabel+\")\",t.text&&!Array.isArray(t.text)&&(n+=(n?\"<br>\":\"\")+t.text),\"\"===n&&(\"\"===r&&e.remove(),n=r);var f=e.select(\"text.nums\").call(_.font,t.fontFamily||u,t.fontSize||c,t.fontColor||h).call(_.setPosition,0,0).text(n).attr(\"data-notex\",1).call(b.convertToTspans);f.selectAll(\"tspan.line\").call(_.setPosition,0,0);var d=e.select(\"text.name\"),m=0;r&&r!==n?(d.call(_.font,t.fontFamily||u,t.fontSize||c,l).text(r).call(_.setPosition,0,0).attr(\"data-notex\",1).call(b.convertToTspans),d.selectAll(\"tspan.line\").call(_.setPosition,0,0),m=d.node().getBoundingClientRect().width+2*j):(d.remove(),e.select(\"rect\").remove()),e.select(\"path\").style({fill:l,stroke:h});var v,y,T=f.node().getBoundingClientRect(),S=t.xa._offset+(t.x0+t.x1)/2,E=t.ya._offset+(t.y0+t.y1)/2,L=Math.abs(t.x1-t.x0),z=Math.abs(t.y1-t.y0),D=T.width+O+j+m;t.ty0=w-T.top,t.bx=T.width+2*j,t.by=T.height+2*j,t.anchor=\"start\",t.txwidth=T.width,t.tx2width=m,t.offset=0,a?(t.pos=S,v=E+z/2+D<=k,y=E-z/2-D>=0,\"top\"!==t.idealAlign&&v||!y?v?(E+=z/2,t.anchor=\"start\"):t.anchor=\"middle\":(E-=z/2,t.anchor=\"end\")):(t.pos=E,v=S+L/2+D<=M,y=S-L/2-D>=0,\"left\"!==t.idealAlign&&v||!y?v?(S+=L/2,t.anchor=\"start\"):t.anchor=\"middle\":(S-=L/2,t.anchor=\"end\")),f.attr(\"text-anchor\",t.anchor),m&&d.attr(\"text-anchor\",t.anchor),e.attr(\"transform\",\"translate(\"+S+\",\"+E+\")\"+(a?\"rotate(\"+C+\")\":\"\"))}),L}function h(t,e){function r(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var u=0;for(o=0;o<t.length;o++)(l=t[o]).pos+l.dp+l.size>e.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o<t.length&&!(u<=0);o++)if((l=t[o]).pos<e.pmin+1)for(l.del=!0,u--,a=2*l.size,s=t.length-1;s>=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}for(var n,i,a,o,s,l,u,c=0,h=t.map(function(t,r){var n=t[e];return[{i:r,dp:0,pos:t.pos,posref:t.posref,size:t.by*(\"x\"===n._id.charAt(0)?D:1)/2,pmin:n._offset,pmax:n._offset+n._length}]}).sort(function(t,e){return t[0].posref-e[0].posref});!n&&c<=t.length;){for(c++,n=!0,o=0;o<h.length-1;){var f=h[o],d=h[o+1],p=f[f.length-1],m=d[0];if((i=p.pos+p.dp+p.size-m.pos-m.dp+m.size)>.01&&p.pmin===m.pmin&&p.pmax===m.pmax){for(s=d.length-1;s>=0;s--)d[s].dp+=i;for(f.push.apply(f,d),h.splice(o+1,1),u=0,s=f.length-1;s>=0;s--)u+=f[s].dp;for(a=u/f.length,s=f.length-1;s>=0;s--)f[s].dp-=a;n=!1}else o++}h.forEach(r)}for(o=h.length-1;o>=0;o--){var g=h[o];for(s=g.length-1;s>=0;s--){var v=g[s],y=t[v.i];y.offset=v.dp,y.del=v.del}}}function f(t,e){t.each(function(t){var r=p.select(this);if(t.del)r.remove();else{var n=\"end\"===t.anchor?-1:1,i=r.select(\"text.nums\"),a={start:1,end:-1,middle:0}[t.anchor],o=a*(O+j),s=o+a*(t.txwidth+j),l=0,u=t.offset;\"middle\"===t.anchor&&(o-=t.tx2width/2,s-=t.tx2width/2),e&&(u*=-P,l=t.offset*I),r.select(\"path\").attr(\"d\",\"middle\"===t.anchor?\"M-\"+t.bx/2+\",-\"+t.by/2+\"h\"+t.bx+\"v\"+t.by+\"h-\"+t.bx+\"Z\":\"M0,0L\"+(n*O+l)+\",\"+(O+u)+\"v\"+(t.by/2-O)+\"h\"+n*t.bx+\"v-\"+t.by+\"H\"+(n*O+l)+\"V\"+(u-O)+\"Z\"),i.call(_.setPosition,o+l,u+t.ty0-t.by/2+j).selectAll(\"tspan.line\").attr({x:i.attr(\"x\"),y:i.attr(\"y\")}),t.tx2width&&(r.select(\"text.name, text.name tspan.line\").call(_.setPosition,s+a*j+l,u+t.ty0-t.by/2+j),r.select(\"rect\").call(_.setRect,s+(a-1)*t.tx2width/2+l,u-t.by/2-1,t.tx2width,t.by+2))}})}function d(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}var p=t(\"d3\"),m=t(\"fast-isnumeric\"),g=t(\"tinycolor2\"),v=t(\"../../lib\"),y=t(\"../../lib/events\"),b=t(\"../../lib/svg_text_utils\"),x=t(\"../../components/color\"),_=t(\"../../components/drawing\"),w=t(\"../../components/dragelement\"),M=t(\"../../lib/override_cursor\"),k=t(\"../../registry\"),A=t(\"./axes\"),T=t(\"./constants\"),S=t(\"./dragbox\"),E=t(\"../layout_attributes\"),L=e.exports={};L.unhover=w.unhover,L.supplyLayoutDefaults=function(t,e,r){function n(r,n){return v.coerce(t,e,E,r,n)}n(\"dragmode\");n(\"hovermode\",e._has(\"cartesian\")?(e._isHoriz=L.isHoriz(r))?\"y\":\"x\":\"closest\")},L.isHoriz=function(t){for(var e=!0,r=0;r<t.length;r++)if(\"h\"!==t[r].orientation){e=!1;break}return e},L.init=function(t){var e=t._fullLayout;if(e._has(\"cartesian\")&&!t._context.staticPlot){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];if(e._has(\"cartesian\")){var i=n.xaxis,a=n.yaxis,o=(i._linepositions[r]||[])[3],s=(a._linepositions[r]||[])[3],l=T.DRAGGERSIZE;if(m(o)&&\"top\"===i.side&&(o-=l),m(s)&&\"right\"!==a.side&&(s-=l),!n.mainplot){var u=S(t,n,0,0,i._length,a._length,\"ns\",\"ew\");u.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===r&&L.hover(t,e,r)},L.hover(t,e,r),t._fullLayout._lasthover=u,t._fullLayout._hoversubplot=r},u.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,w.unhover(t,e))},u.onclick=function(e){L.click(t,e)},t._context.showAxisDragHandles&&(S(t,n,-l,-l,l,l,\"n\",\"w\"),S(t,n,i._length,-l,l,l,\"n\",\"e\"),S(t,n,-l,a._length,l,l,\"s\",\"w\"),S(t,n,i._length,a._length,l,l,\"s\",\"e\"))}t._context.showAxisDragHandles&&(m(o)&&(\"free\"===i.anchor&&(o-=e._size.h*(1-a.domain[1])),S(t,n,.1*i._length,o,.8*i._length,l,\"\",\"ew\"),S(t,n,0,o,.1*i._length,l,\"\",\"w\"),S(t,n,.9*i._length,o,.1*i._length,l,\"\",\"e\")),m(s)&&(\"free\"===a.anchor&&(s-=e._size.w*i.domain[0]),S(t,n,s,.1*a._length,l,.8*a._length,\"ns\",\"\"),S(t,n,s,.9*a._length,l,.1*a._length,\"s\",\"\"),S(t,n,s,0,l,.1*a._length,\"n\",\"\")))}});var r=e._hoverlayer.node();r.onmousemove=function(r){r.target=e._lasthover,L.hover(t,r,e._hoversubplot)},r.onclick=function(r){r.target=e._lasthover,L.click(t,r)},r.onmousedown=function(t){e._lasthover.onmousedown(t)}}};var C=T.YANGLE,z=Math.PI*C/180,D=1/Math.sin(z),I=Math.cos(z),P=Math.sin(z),O=T.HOVERARROWSIZE,j=T.HOVERTEXTPAD;L.hover=function(t,e,r){if(\"string\"==typeof t&&(t=document.getElementById(t)),void 0===t._lastHoverTime&&(t._lastHoverTime=0),void 0!==t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),Date.now()>t._lastHoverTime+T.HOVERMINTIME)return o(t,e,r),void(t._lastHoverTime=Date.now());t._hoverTimer=setTimeout(function(){o(t,e,r),t._lastHoverTime=Date.now(),t._hoverTimer=void 0},T.HOVERMINTIME)},L.getDistanceFunction=function(t,e,r,n){return\"closest\"===t?n||a(e,r):\"x\"===t?e:r},L.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},L.loneHover=function(t,e){var r={color:t.color||x.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:{index:0,hoverinfo:\"\"},xa:{_offset:0},ya:{_offset:0},index:0},n=p.select(e.container),i=e.outerContainer?p.select(e.outerContainer):n,a={hovermode:\"closest\",rotateLabels:!1,bgColor:e.bgColor||x.background,container:n,outerContainer:i},o=c([r],a);return f(o,a.rotateLabels),o.node()},L.loneUnhover=function(t){var e=v.isD3Selection(t)?t:p.select(t);e.selectAll(\"g.hovertext\").remove(),e.selectAll(\".spikeline\").remove()},L.click=function(t,e){function r(){t.emit(\"plotly_click\",{points:t._hoverdata,event:e})}var n=k.getComponentMethod(\"annotations\",\"onClick\")(t,t._hoverdata);t._hoverdata&&e&&e.target&&(n&&n.then?n.then(r):r(),e.stopImmediatePropagation&&e.stopImmediatePropagation())},L.inbox=function(t,e){return t*e<0||0===t?T.MAXDIST*(.6-.3/Math.max(3,Math.abs(t-e))):1/0}},{\"../../components/color\":578,\"../../components/dragelement\":599,\"../../components/drawing\":602,\"../../lib\":685,\"../../lib/events\":676,\"../../lib/override_cursor\":694,\"../../lib/svg_text_utils\":704,\"../../registry\":802,\"../layout_attributes\":778,\"./axes\":724,\"./constants\":729,\"./dragbox\":732,d3:107,\"fast-isnumeric\":116,tinycolor2:514}],734:[function(t,e,r){\"use strict\";function n(t,e,r,n,i){var a=t._fullLayout._modules;e.plot&&e.plot.selectAll(\"g:not(.scatterlayer)\").selectAll(\"g.trace\").remove();for(var o=0;o<a.length;o++){var s=a[o];if(\"cartesian\"===s.basePlotModule.name){for(var l=[],u=0;u<r.length;u++){var c=r[u],h=c[0].trace;h._module===s&&!0===h.visible&&l.push(c)}s.plot(t,e,l,n,i)}}}function i(t){for(var e=t._fullLayout,r=Object.keys(e._plots),n=[],i=[],a=0;a<r.length;a++){var o=r[a],s=e._plots[o],l=s.xaxis,u=s.yaxis,c=h.getFromId(t,l.overlaying)||l;c!==l&&c.overlaying&&(c=l,l.overlaying=!1);var f=h.getFromId(t,u.overlaying)||u;f!==u&&f.overlaying&&(f=u,u.overlaying=!1);var d=c._id+f._id;d!==o&&-1!==r.indexOf(d)?(s.mainplot=d,s.mainplotinfo=e._plots[d],i.push(o),l.domain=c.domain.slice(),u.domain=f.domain.slice()):n.push(o)}return n=n.concat(i)}function a(t){function e(t){s(t,\"g\",\"imagelayer\"),s(t,\"g\",\"maplayer\"),s(t,\"g\",\"barlayer\"),s(t,\"g\",\"carpetlayer\"),s(t,\"g\",\"boxlayer\"),s(t,\"g\",\"scatterlayer\")}var r=t.plotgroup,n=t.id;if(t.mainplot){var i=t.mainplotinfo;t.gridlayer=s(i.overgrid,\"g\",n),t.zerolinelayer=s(i.overzero,\"g\",n),t.plot=s(i.overplot,\"g\",n),t.xlines=s(i.overlines,\"path\",n),t.ylines=s(i.overlines,\"path\",n),t.xaxislayer=s(i.overaxes,\"g\",n),t.yaxislayer=s(i.overaxes,\"g\",n)}else{var a=s(r,\"g\",\"layer-subplot\");t.shapelayer=s(a,\"g\",\"shapelayer\"),t.imagelayer=s(a,\"g\",\"imagelayer\"),t.gridlayer=s(r,\"g\",\"gridlayer\"),t.overgrid=s(r,\"g\",\"overgrid\"),t.zerolinelayer=s(r,\"g\",\"zerolinelayer\"),t.overzero=s(r,\"g\",\"overzero\"),t.plot=s(r,\"g\",\"plot\"),t.overplot=s(r,\"g\",\"overplot\"),t.xlines=s(r,\"path\",\"xlines\"),t.ylines=s(r,\"path\",\"ylines\"),t.overlines=s(r,\"g\",\"overlines\"),t.xaxislayer=s(r,\"g\",\"xaxislayer\"),t.yaxislayer=s(r,\"g\",\"yaxislayer\"),t.overaxes=s(r,\"g\",\"overaxes\")}t.plot.call(e),t.xlines.style(\"fill\",\"none\").classed(\"crisp\",!0),t.ylines.style(\"fill\",\"none\").classed(\"crisp\",!0)}function o(t,e){t&&t.each(function(t){var r=l.select(this),n=\"clip\"+e._uid+t+\"plot\";r.remove(),e._draggers.selectAll(\"g.\"+t).remove(),e._defs.select(\"#\"+n).remove()})}function s(t,e,r){var n=t.selectAll(\".\"+r).data([0]);return n.enter().append(e).classed(r,!0),n}var l=t(\"d3\"),u=t(\"../../lib\"),c=t(\"../plots\"),h=t(\"./axis_ids\"),f=t(\"./constants\");r.name=\"cartesian\",r.attr=[\"xaxis\",\"yaxis\"],r.idRoot=[\"x\",\"y\"],r.idRegex=f.idRegex,r.attrRegex=f.attrRegex,r.attributes=t(\"./attributes\"),r.layoutAttributes=t(\"./layout_attributes\"),r.transitionAxes=t(\"./transition_axes\"),r.plot=function(t,e,r,i){var a,o=t._fullLayout,s=c.getSubplotIds(o,\"cartesian\"),l=t.calcdata;if(!Array.isArray(e))for(e=[],a=0;a<l.length;a++)e.push(a);for(a=0;a<s.length;a++){for(var u,h=s[a],f=o._plots[h],d=[],p=0;p<l.length;p++){var m=l[p],g=m[0].trace;g.xaxis+g.yaxis===h&&((-1!==e.indexOf(g.index)||g.carpet)&&(u&&u[0].trace.xaxis+u[0].trace.yaxis===h&&-1!==[\"tonextx\",\"tonexty\",\"tonext\"].indexOf(g.fill)&&-1===d.indexOf(u)&&d.push(u),d.push(m)),u=m)}n(t,f,d,r,i)}},r.clean=function(t,e,r,n){var i,a,s,l=n._modules||[],u=e._modules||[];for(s=0;s<l.length;s++)if(\"scatter\"===l[s].name){i=!0;break}for(s=0;s<u.length;s++)if(\"scatter\"===u[s].name){a=!0;break}if(i&&!a){var c=n._plots,f=Object.keys(c||{});for(s=0;s<f.length;s++){var d=c[f[s]];d.plot&&d.plot.select(\"g.scatterlayer\").selectAll(\"g.trace\").remove()}n._infolayer.selectAll(\"g.rangeslider-container\").select(\"g.scatterlayer\").selectAll(\"g.trace\").remove()}var p=n._has&&n._has(\"cartesian\"),m=e._has&&e._has(\"cartesian\");if(p&&!m){var g=n._cartesianlayer.selectAll(\".subplot\"),v=h.listIds({_fullLayout:n});for(g.call(o,n),n._defs.selectAll(\".axesclip\").remove(),s=0;s<v.length;s++)n._infolayer.select(\".\"+v[s]+\"title\").remove()}},r.drawFramework=function(t){var e=t._fullLayout,r=i(t),n=e._cartesianlayer.selectAll(\".subplot\").data(r,u.identity);n.enter().append(\"g\").attr(\"class\",function(t){return\"subplot \"+t}),n.order(),n.exit().call(o,e),n.each(function(t){var r=e._plots[t];r.plotgroup=l.select(this),r.overlays=[],a(r),r.mainplot&&e._plots[r.mainplot].overlays.push(r),r.draglayer=s(e._draggers,\"g\",t)})},r.rangePlot=function(t,e,r){a(e),n(t,e,r),c.style(t)}},{\"../../lib\":685,\"../plots\":787,\"./attributes\":723,\"./axis_ids\":727,\"./constants\":729,\"./layout_attributes\":735,\"./transition_axes\":745,d3:107}],735:[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\"},color:{valType:\"color\",dflt:i.defaultLine},title:{valType:\"string\"},titlefont:o({},n,{}),type:{valType:\"enumerated\",values:[\"-\",\"linear\",\"log\",\"date\",\"category\"],dflt:\"-\"},autorange:{valType:\"enumerated\",values:[!0,!1,\"reversed\"],dflt:!0},rangemode:{valType:\"enumerated\",values:[\"normal\",\"tozero\",\"nonnegative\"],dflt:\"normal\"},range:{valType:\"info_array\",items:[{valType:\"any\"},{valType:\"any\"}]},fixedrange:{valType:\"boolean\",dflt:!1},scaleanchor:{valType:\"enumerated\",values:[s.idRegex.x.toString(),s.idRegex.y.toString()]},scaleratio:{valType:\"number\",min:0,dflt:1},tickmode:{valType:\"enumerated\",values:[\"auto\",\"linear\",\"array\"]},nticks:{valType:\"integer\",min:0,dflt:0},tick0:{valType:\"any\"},dtick:{valType:\"any\"},tickvals:{valType:\"data_array\"},ticktext:{valType:\"data_array\"},ticks:{valType:\"enumerated\",values:[\"outside\",\"inside\",\"\"]},mirror:{valType:\"enumerated\",values:[!0,\"ticks\",!1,\"all\",\"allticks\"],dflt:!1},ticklen:{valType:\"number\",min:0,dflt:5},tickwidth:{valType:\"number\",min:0,dflt:1},tickcolor:{valType:\"color\",dflt:i.defaultLine},showticklabels:{valType:\"boolean\",dflt:!0},showspikes:{valType:\"boolean\",dflt:!1},spikecolor:{valType:\"color\",dflt:null},spikethickness:{valType:\"number\",dflt:3},spikedash:o({},a,{dflt:\"dash\"}),spikemode:{valType:\"flaglist\",flags:[\"toaxis\",\"across\",\"marker\"],dflt:\"toaxis\"},tickfont:o({},n,{}),tickangle:{valType:\"angle\",dflt:\"auto\"},tickprefix:{valType:\"string\",dflt:\"\"},showtickprefix:{valType:\"enumerated\",values:[\"all\",\"first\",\"last\",\"none\"],dflt:\"all\"},ticksuffix:{valType:\"string\",dflt:\"\"},showticksuffix:{valType:\"enumerated\",values:[\"all\",\"first\",\"last\",\"none\"],dflt:\"all\"},showexponent:{valType:\"enumerated\",values:[\"all\",\"first\",\"last\",\"none\"],dflt:\"all\"},exponentformat:{valType:\"enumerated\",values:[\"none\",\"e\",\"E\",\"power\",\"SI\",\"B\"],dflt:\"B\"},separatethousands:{valType:\"boolean\",dflt:!1},tickformat:{valType:\"string\",dflt:\"\"},hoverformat:{valType:\"string\",dflt:\"\"},showline:{valType:\"boolean\",dflt:!1},linecolor:{valType:\"color\",dflt:i.defaultLine},linewidth:{valType:\"number\",min:0,dflt:1},showgrid:{valType:\"boolean\"},gridcolor:{valType:\"color\",dflt:i.lightLine},gridwidth:{valType:\"number\",min:0,dflt:1},zeroline:{valType:\"boolean\"},zerolinecolor:{valType:\"color\",dflt:i.defaultLine},zerolinewidth:{valType:\"number\",dflt:1},anchor:{valType:\"enumerated\",values:[\"free\",s.idRegex.x.toString(),s.idRegex.y.toString()]},side:{valType:\"enumerated\",values:[\"top\",\"bottom\",\"left\",\"right\"]},overlaying:{valType:\"enumerated\",values:[\"free\",s.idRegex.x.toString(),s.idRegex.y.toString()]},domain:{valType:\"info_array\",items:[{valType:\"number\",min:0,max:1},{valType:\"number\",min:0,max:1}],dflt:[0,1]},position:{valType:\"number\",min:0,max:1,dflt:0},categoryorder:{valType:\"enumerated\",values:[\"trace\",\"category ascending\",\"category descending\",\"array\"],dflt:\"trace\"},categoryarray:{valType:\"data_array\"},_deprecated:{autotick:{valType:\"boolean\"}}}},{\"../../components/color/attributes\":577,\"../../components/drawing/attributes\":601,\"../../lib/extend\":677,\"../font_attributes\":748,\"./constants\":729}],736:[function(t,e,r){\"use strict\";var n=t(\"../../registry\"),i=t(\"../../lib\"),a=t(\"../../components/color\"),o=t(\"../layout_attributes\"),s=t(\"./constants\"),l=t(\"./layout_attributes\"),u=t(\"./type_defaults\"),c=t(\"./axis_defaults\"),h=t(\"./constraint_defaults\"),f=t(\"./position_defaults\"),d=t(\"./axis_ids\");e.exports=function(t,e,r){function p(t,e){return Number(t.substr(5)||1)-Number(e.substr(5)||1)}function m(t,e){return i.coerce(N,B,l,t,e)}function g(t){var e={x:P,y:I}[t];return i.simpleMap(e,d.name2id)}var v,y=Object.keys(t),b=[],x=[],_=[],w=[],M=[],k=[],A={},T={};for(v=0;v<r.length;v++){var S,E,L=r[v];if(n.traceIs(L,\"cartesian\"))S=b,E=x;else{if(!n.traceIs(L,\"gl2d\"))continue;S=_,E=w}var C=d.id2name(L.xaxis),z=d.id2name(L.yaxis);n.traceIs(L,\"carpet\")&&(\"carpet\"!==L.type||L._cheater)||C&&i.pushUnique(k,C),\"carpet\"===L.type&&L._cheater&&C&&i.pushUnique(M,C),C&&-1===S.indexOf(C)&&S.push(C),z&&-1===E.indexOf(z)&&E.push(z),n.traceIs(L,\"2dMap\")&&(A[C]=!0,A[z]=!0),n.traceIs(L,\"oriented\")&&(T[\"h\"===L.orientation?z:C]=!0)}if(!(e._has(\"gl3d\")||e._has(\"geo\")))for(v=0;v<y.length;v++){var D=y[v];-1===_.indexOf(D)&&-1===b.indexOf(D)&&s.xAxisMatch.test(D)?b.push(D):-1===w.indexOf(D)&&-1===x.indexOf(D)&&s.yAxisMatch.test(D)&&x.push(D)}b.length&&x.length&&i.pushUnique(e._basePlotModules,n.subplotsRegistry.cartesian);var I=b.concat(_).sort(p),P=x.concat(w).sort(p),O=I.concat(P),j=a.background;I.length&&P.length&&(j=i.coerce(t,e,o,\"plot_bgcolor\"));var R,F,N,B,U=a.combine(j,e.paper_bgcolor),V={x:g(\"x\"),y:g(\"y\")};for(v=0;v<O.length;v++){R=O[v],i.isPlainObject(t[R])||(t[R]={}),N=t[R],B=e[R]={},u(N,B,m,r,R);var H=function(e,r){for(var n={x:I,y:P}[e],i=[],a=0;a<n.length;a++){var o=n[a];o===r||(t[o]||{}).overlaying||i.push(d.name2id(o))}return i}(F=R.charAt(0),R),q={letter:F,font:e.font,outerTicks:A[R],showGrid:!T[R],data:r,bgColor:U,calendar:e.calendar,cheateronly:\"x\"===F&&-1!==M.indexOf(R)&&-1===k.indexOf(R)};c(N,B,m,q,e),m(\"showspikes\")&&(m(\"spikecolor\"),m(\"spikethickness\"),m(\"spikedash\"),m(\"spikemode\"));var G={letter:F,counterAxes:V[F],overlayableAxes:H};f(N,B,m,G),B._input=N}var Y=n.getComponentMethod(\"rangeslider\",\"handleDefaults\"),W=n.getComponentMethod(\"rangeselector\",\"handleDefaults\");for(v=0;v<I.length;v++)R=I[v],N=t[R],B=e[R],Y(t,e,R),\"date\"===B.type&&W(N,B,e,P,B.calendar),m(\"fixedrange\");for(v=0;v<P.length;v++){R=P[v],N=t[R],B=e[R];var X=e[d.id2name(B.anchor)];m(\"fixedrange\",X&&X.rangeslider&&X.rangeslider.visible)}e._axisConstraintGroups=[];var Z=V.x.concat(V.y);for(v=0;v<O.length;v++)F=(R=O[v]).charAt(0),N=t[R],B=e[R],h(N,B,m,Z,e)}},{\"../../components/color\":578,\"../../lib\":685,\"../../registry\":802,\"../layout_attributes\":778,\"./axis_defaults\":726,\"./axis_ids\":727,\"./constants\":729,\"./constraint_defaults\":730,\"./layout_attributes\":735,\"./position_defaults\":738,\"./type_defaults\":746}],737:[function(t,e,r){\"use strict\";function n(t,e,r){var n,a,o,s,l,u=[],c=r.map(function(e){return e[t]}),h=i.bisector(e).left;for(n=0;n<c.length;n++)for(o=c[n],a=0;a<o.length;a++)null!==(s=o[a])&&void 0!==s&&((l=h(u,s))<u.length&&u[l]===s||u.splice(l,0,s));return u}var i=t(\"d3\");e.exports=function(t,e,r,a){switch(e){case\"array\":return Array.isArray(r)?r.slice():[];case\"category ascending\":return n(t,i.ascending,a);case\"category descending\":return n(t,i.descending,a);case\"trace\":default:return[]}}},{d3:107}],738:[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 u=!1;if(s.length&&(u=i.coerce(t,e,{overlaying:{valType:\"enumerated\",values:[!1].concat(s),dflt:!1}},\"overlaying\")),!u){var c=r(\"domain\");c[0]>c[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return e}},{\"../../lib\":685,\"fast-isnumeric\":116}],739:[function(t,e,r){\"use strict\";e.exports=function(t,e,r){void 0===r&&(r=.5);var n=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=n[0]+(n[1]-n[0])*r,a=(i-n[0])*e;t.range=t._input.range=[t.l2r(i-a),t.l2r(i+a)]}},{}],740:[function(t,e,r){\"use strict\";function n(t){return t._id}var i=t(\"../../lib/polygon\"),a=t(\"../../components/color\"),o=t(\"./axes\"),s=t(\"./constants\"),l=i.filter,u=i.tester,c=s.MINSELECT;e.exports=function(t,e,r,i,h){function f(t){var e=\"y\"===t._id.charAt(0)?1:0;return function(r){return t.p2d(r[e])}}function d(t,e){return t-e}var p,m=i.gd._fullLayout._zoomlayer,g=i.element.getBoundingClientRect(),v=i.plotinfo.xaxis._offset,y=i.plotinfo.yaxis._offset,b=e-g.left,x=r-g.top,_=b,w=x,M=\"M\"+b+\",\"+x,k=i.xaxes[0]._length,A=i.yaxes[0]._length,T=i.xaxes.map(n),S=i.yaxes.map(n),E=i.xaxes.concat(i.yaxes);\"lasso\"===h&&(p=l([[b,x]],s.BENDPX));var L=m.selectAll(\"path.select-outline\").data([1,2]);L.enter().append(\"path\").attr(\"class\",function(t){return\"select-outline select-outline-\"+t}).attr(\"transform\",\"translate(\"+v+\", \"+y+\")\").attr(\"d\",M+\"Z\");var C,z,D,I,P,O=m.append(\"path\").attr(\"class\",\"zoombox-corners\").style({fill:a.background,stroke:a.defaultLine,\"stroke-width\":1}).attr(\"transform\",\"translate(\"+v+\", \"+y+\")\").attr(\"d\",\"M0,0Z\"),j=[],R=i.gd,F=[];for(C=0;C<R.calcdata.length;C++)if(z=R.calcdata[C],(D=z[0].trace)._module&&D._module.selectPoints)if(i.subplot){if(D.subplot!==i.subplot)continue;j.push({selectPoints:D._module.selectPoints,cd:z,xaxis:i.xaxes[0],yaxis:i.yaxes[0]})}else{if(-1===T.indexOf(D.xaxis))continue;if(-1===S.indexOf(D.yaxis))continue;j.push({selectPoints:D._module.selectPoints,cd:z,xaxis:o.getFromId(R,D.xaxis),yaxis:o.getFromId(R,D.yaxis)})}i.moveFn=function(t,e){var r,n;_=Math.max(0,Math.min(k,t+b)),w=Math.max(0,Math.min(A,e+x));var a=Math.abs(_-b),o=Math.abs(w-x);for(\"select\"===h?(o<Math.min(.6*a,c)?(r=u([[b,0],[b,A],[_,A],[_,0]]),O.attr(\"d\",\"M\"+r.xmin+\",\"+(x-c)+\"h-4v\"+2*c+\"h4ZM\"+(r.xmax-1)+\",\"+(x-c)+\"h4v\"+2*c+\"h-4Z\")):a<Math.min(.6*o,c)?(r=u([[0,x],[0,w],[k,w],[k,x]]),O.attr(\"d\",\"M\"+(b-c)+\",\"+r.ymin+\"v-4h\"+2*c+\"v4ZM\"+(b-c)+\",\"+(r.ymax-1)+\"v4h\"+2*c+\"v-4Z\")):(r=u([[b,x],[b,w],[_,w],[_,x]]),O.attr(\"d\",\"M0,0Z\")),L.attr(\"d\",\"M\"+r.xmin+\",\"+r.ymin+\"H\"+(r.xmax-1)+\"V\"+(r.ymax-1)+\"H\"+r.xmin+\"Z\")):\"lasso\"===h&&(p.addPt([_,w]),r=u(p.filtered),L.attr(\"d\",\"M\"+p.filtered.join(\"L\")+\"Z\")),F=[],C=0;C<j.length;C++)I=j[C],[].push.apply(F,I.selectPoints(I,r));if(P={points:F},\"select\"===h){var s,l=P.range={};for(C=0;C<E.length;C++)s=(n=E[C])._id.charAt(0),l[n._id]=[n.p2d(r[s+\"min\"]),n.p2d(r[s+\"max\"])].sort(d)}else{var m=P.lassoPoints={};for(C=0;C<E.length;C++)m[(n=E[C])._id]=p.filtered.map(f(n))}i.gd.emit(\"plotly_selecting\",P)},i.doneFn=function(t,e){if(O.remove(),t||2!==e)i.gd.emit(\"plotly_selected\",P);else{for(L.remove(),C=0;C<j.length;C++)(I=j[C]).selectPoints(I,!1);R.emit(\"plotly_deselect\",null)}}}},{\"../../components/color\":578,\"../../lib/polygon\":695,\"./axes\":724,\"./constants\":729}],741:[function(t,e,r){\"use strict\";function n(t){return Math.pow(10,t)}function i(t){return o(t)?(t=Number(t),t<-f||t>f?d:o(t)?Number(t):d):d}var a=t(\"d3\"),o=t(\"fast-isnumeric\"),s=t(\"../../lib\"),l=s.cleanNumber,u=s.ms2DateTime,c=s.dateTime2ms,h=t(\"../../constants/numerical\"),f=h.FP_SAFE,d=h.BADNUM,p=t(\"./constants\"),m=t(\"./axis_ids\");e.exports=function(t,e){function r(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*w*Math.abs(n-i))}return d}function h(e,r,n){var i=c(e,n||t.calendar);if(i===d){if(!o(e))return d;i=c(new Date(+e))}return i}function g(e,r,n){return u(e,r,n||t.calendar)}function v(e){return t._categories[Math.round(e)]}function y(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 d}function b(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(\"number\"==typeof e)return e}function x(e){return o(e)?a.round(t._b+t._m*e,2):d}function _(e){return(e-t._b)/t._m}e=e||{};var w=10;t.c2l=\"log\"===t.type?r:i,t.l2c=\"log\"===t.type?n:i,t.l2p=x,t.p2l=_,t.c2p=\"log\"===t.type?function(t,e){return x(r(t,e))}:x,t.p2c=\"log\"===t.type?function(t){return n(_(t))}:_,-1!==[\"linear\",\"-\"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=i,t.d2p=t.r2p=function(t){return x(l(t))},t.p2d=t.p2r=_):\"log\"===t.type?(t.d2r=t.d2l=function(t,e){return r(l(t),e)},t.r2d=t.r2c=function(t){return n(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=i,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return x(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(t){return x(l(t))},t.p2r=_):\"date\"===t.type?(t.d2r=t.r2d=s.identity,t.d2c=t.r2c=t.d2l=t.r2l=h,t.c2d=t.c2r=t.l2d=t.l2r=g,t.d2p=t.r2p=function(t,e,r){return x(h(t,0,r))},t.p2d=t.p2r=function(t,e,r){return g(_(t),e,r)}):\"category\"===t.type&&(t.d2r=t.d2c=t.d2l=y,t.r2d=t.c2d=t.l2d=v,t.d2l_noadd=b,t.r2l=t.l2r=t.r2c=t.c2r=i,t.d2p=function(t){return x(b(t))},t.p2d=function(t){return v(_(t))},t.r2p=x,t.p2r=_),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e){e||(e=\"range\");var r,n,i=s.nestedProperty(t,e).get(),a=(t._id||\"x\").charAt(0);if(n=\"date\"===t.type?s.dfltRange(t.calendar):\"y\"===a?p.DFLTRANGEY:p.DFLTRANGEX,n=n.slice(),i&&2===i.length)for(\"date\"===t.type&&(i[0]=s.cleanDate(i[0],d,t.calendar),i[1]=s.cleanDate(i[1],d,t.calendar)),r=0;r<2;r++)if(\"date\"===t.type){if(!s.isDateTime(i[r],t.calendar)){t[e]=n;break}if(t.r2l(i[0])===t.r2l(i[1])){var l=s.constrain(t.r2l(i[0]),s.MIN_MS+1e3,s.MAX_MS-1e3);i[0]=t.l2r(l-1e3),i[1]=t.l2r(l+1e3);break}}else{if(!o(i[r])){if(!o(i[1-r])){t[e]=n;break}i[r]=i[1-r]*(r?10:.1)}if(i[r]<-f?i[r]=-f:i[r]>f&&(i[r]=f),i[0]===i[1]){var u=Math.max(1,Math.abs(1e-6*i[0]));i[0]-=u,i[1]+=u}}else s.nestedProperty(t,e).set(n)},t.setScale=function(r){var n=e._size,i=t._id.charAt(0);if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var a=m.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var o=r&&t._r?\"_r\":\"range\",l=t.calendar;t.cleanRange(o);var u=t.r2l(t[o][0],l),c=t.r2l(t[o][1],l);if(\"y\"===i?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u),!isFinite(t._m)||!isFinite(t._b))throw s.notifier(\"Something went wrong with axis scaling\",\"long\"),e._replotting=!1,new Error(\"axis scaling\")},t.makeCalcdata=function(e,r){var n,i,a,o=\"date\"===t.type&&e[r+\"calendar\"];if(r in e)for(n=e[r],i=new Array(n.length),a=0;a<n.length;a++)i[a]=t.d2c(n[a],0,o);else{var s=r+\"0\"in e?t.d2c(e[r+\"0\"],0,o):0,l=e[\"d\"+r]?Number(e[\"d\"+r]):1;for(n=e[{x:\"y\",y:\"x\"}[r]],i=new Array(n.length),a=0;a<n.length;a++)i[a]=s+a*l}return i},t.isValidRange=function(e){return Array.isArray(e)&&2===e.length&&o(t.r2l(e[0]))&&o(t.r2l(e[1]))},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{\"../../constants/numerical\":666,\"../../lib\":685,\"./axis_ids\":727,\"./constants\":729,d3:107,\"fast-isnumeric\":116}],742:[function(t,e,r){\"use strict\";function n(t){var e=[\"showexponent\",\"showtickprefix\",\"showticksuffix\"].filter(function(e){return void 0!==t[e]}),r=function(r){return t[r]===t[e[0]]};if(e.every(r)||1===e.length)return t[e[0]]}var i=t(\"../../lib\");e.exports=function(t,e,r,a,o){var s=n(t);if(r(\"tickprefix\")&&r(\"showtickprefix\",s),r(\"ticksuffix\")&&r(\"showticksuffix\",s),r(\"showticklabels\")){var l=o.font||{},u=e.color===t.color?e.color:l.color;i.coerceFont(r,\"tickfont\",{family:l.family,size:l.size,color:u}),r(\"tickangle\"),\"category\"!==a&&(r(\"tickformat\")||\"date\"===a||(r(\"showexponent\",s),r(\"exponentformat\"),r(\"separatethousands\")))}\"category\"===a||o.noHover||r(\"hoverformat\")}},{\"../../lib\":685}],743:[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\":685,\"./layout_attributes\":735}],744:[function(t,e,r){\"use strict\";var n=t(\"fast-isnumeric\"),i=t(\"../../lib\"),a=t(\"../../constants/numerical\").ONEDAY;e.exports=function(t,e,r,o){var s=\"auto\";\"array\"!==t.tickmode||\"log\"!==o&&\"date\"!==o||(t.tickmode=\"auto\"),Array.isArray(t.tickvals)?s=\"array\":t.dtick&&(s=\"linear\");var l=r(\"tickmode\",s);if(\"auto\"===l)r(\"nticks\");else if(\"linear\"===l){var u=\"date\"===o?a:1,c=r(\"dtick\",u);if(n(c))e.dtick=c>0?Number(c):u;else if(\"string\"!=typeof c)e.dtick=u;else{var h=c.charAt(0),f=c.substr(1);((f=n(f)?Number(f):0)<=0||!(\"date\"===o&&\"M\"===h&&f===Math.round(f)||\"log\"===o&&\"L\"===h||\"log\"===o&&\"D\"===h&&(1===f||2===f)))&&(e.dtick=u)}var d=\"date\"===o?i.dateTick0(e.calendar):0,p=r(\"tick0\",d);\"date\"===o?e.tick0=i.cleanDate(p,d):n(p)&&\"D1\"!==c&&\"D2\"!==c?e.tick0=Number(p):e.tick0=d}else void 0===r(\"tickvals\")?e.tickmode=\"auto\":r(\"ticktext\")}},{\"../../constants/numerical\":666,\"../../lib\":685,\"fast-isnumeric\":116}],745:[function(t,e,r){\"use strict\";var n=t(\"d3\"),i=t(\"../../plotly\"),a=t(\"../../registry\"),o=t(\"../../components/drawing\"),s=t(\"./axes\"),l=/((x|y)([2-9]|[1-9][0-9]+)?)axis$/;e.exports=function(t,e,r,u){function c(e,r){function n(e,r){for(i=0;i<e.length;i++){var n=e[i];-1===o.indexOf(n.xref)&&-1===o.indexOf(n.yref)||r(t,i)}}var i,o=[];for(o=[e._id,r._id],i=0;i<o.length;i++)s.doTicks(t,o[i],!0);n(g.annotations||[],a.getComponentMethod(\"annotations\",\"drawOne\")),n(g.shapes||[],a.getComponentMethod(\"shapes\",\"drawOne\")),n(g.images||[],a.getComponentMethod(\"images\",\"draw\"))}function h(t){var e=t.xaxis,r=t.yaxis;g._defs.selectAll(\"#\"+t.clipId).call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1).selectAll(\".points\").selectAll(\".point\").call(o.setPointGroupScale,1,1)}function f(e,r){var n,i,a,s=y[e.xaxis._id],l=y[e.yaxis._id],u=[];if(s){i=(n=t._fullLayout[s.axisName])._r,a=s.to,u[0]=(i[0]*(1-r)+r*a[0]-i[0])/(i[1]-i[0])*e.xaxis._length;var h=i[1]-i[0],f=a[1]-a[0];n.range[0]=i[0]*(1-r)+r*a[0],n.range[1]=i[1]*(1-r)+r*a[1],u[2]=e.xaxis._length*(1-r+r*f/h)}else u[0]=0,u[2]=e.xaxis._length;if(l){i=(n=t._fullLayout[l.axisName])._r,a=l.to,u[1]=(i[1]*(1-r)+r*a[1]-i[1])/(i[0]-i[1])*e.yaxis._length;var d=i[1]-i[0],p=a[1]-a[0];n.range[0]=i[0]*(1-r)+r*a[0],n.range[1]=i[1]*(1-r)+r*a[1],u[3]=e.yaxis._length*(1-r+r*p/d)}else u[1]=0,u[3]=e.yaxis._length;c(e.xaxis,e.yaxis);var m=e.xaxis,v=e.yaxis,b=!!s,x=!!l,_=b?m._length/u[2]:1,w=x?v._length/u[3]:1,M=b?u[0]:0,k=x?u[1]:0,A=b?u[0]/u[2]*m._length:0,T=x?u[1]/u[3]*v._length:0,S=m._offset-A,E=v._offset-T;g._defs.selectAll(\"#\"+e.clipId).call(o.setTranslate,M,k).call(o.setScale,1/_,1/w),e.plot.call(o.setTranslate,S,E).call(o.setScale,_,w).selectAll(\".points\").selectAll(\".point\").call(o.setPointGroupScale,1/_,1/w)}function d(){for(var e={},r=0;r<b.length;r++){var n=t._fullLayout[y[b[r]].axisName],a=y[b[r]].to;e[n._name+\".range[0]\"]=a[0],e[n._name+\".range[1]\"]=a[1],n.range=a.slice()}return _&&_(),i.relayout(t,e).then(function(){for(var t=0;t<x.length;t++)h(x[t])})}function p(){for(var e={},r=0;r<b.length;r++){var n=t._fullLayout[b[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<x.length;t++)h(x[t])})}function m(){M=Date.now();for(var t=Math.min(1,(M-w)/r.duration),e=A(t),n=0;n<x.length;n++)f(x[n],e);M-w>r.duration?(d(),k=window.cancelAnimationFrame(m)):k=window.requestAnimationFrame(m)}var g=t._fullLayout,v=[],y=function(t){var e,r,n,i,a,o={};for(e in t)if(r=e.split(\".\"),n=r[0].match(l)){var s=n[1],u=s+\"axis\";if(i=g[u],a={},Array.isArray(t[e])?a.to=t[e].slice(0):Array.isArray(t[e].range)&&(a.to=t[e].range.slice(0)),!a.to)continue;a.axisName=u,a.length=i._length,v.push(s),o[s]=a}return o}(e),b=Object.keys(y),x=function(t,e,r){var n,i,a,o=t._plots,s=[];for(n in o){var l=o[n];if(-1===s.indexOf(l)){var u=l.xaxis._id,c=l.yaxis._id,h=l.xaxis.range,f=l.yaxis.range;l.xaxis._r=l.xaxis.range.slice(),l.yaxis._r=l.yaxis.range.slice(),i=r[u]?r[u].to:h,a=r[c]?r[c].to:f,h[0]===i[0]&&h[1]===i[1]&&f[0]===a[0]&&f[1]===a[1]||-1===e.indexOf(u)&&-1===e.indexOf(c)||s.push(l)}}return s}(g,b,y);if(!x.length)return!1;var _;u&&(_=u());var w,M,k,A=n.ease(r.easing);return t._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(k),k=null,p()}),w=Date.now(),k=window.requestAnimationFrame(m),Promise.resolve()}},{\"../../components/drawing\":602,\"../../plotly\":719,\"../../registry\":802,\"./axes\":724,d3:107}],746:[function(t,e,r){\"use strict\";function n(t,e){if(\"-\"===t.type){var r=t._id,n=r.charAt(0);-1!==r.indexOf(\"scene\")&&(r=n);var u=i(e,r,n);if(u)if(\"histogram\"!==u.type||n!=={v:\"y\",h:\"x\"}[u.orientation||\"v\"]){var c=n+\"calendar\",h=u[c];if(o(u,n)){for(var f,d=a(u),p=[],m=0;m<e.length;m++)f=e[m],s.traceIs(f,\"box\")&&(f[n+\"axis\"]||n)===r&&(void 0!==f[d]?p.push(f[d][0]):void 0!==f.name?p.push(f.name):p.push(\"text\"),f[c]!==h&&(h=void 0));t.type=l(p,h)}else t.type=l(u[n]||[u[n+\"0\"]],h)}else t.type=\"linear\"}}function i(t,e,r){for(var n=0;n<t.length;n++){var i=t[n];if((i[r+\"axis\"]||r)===e){if(o(i,r))return i;if((i[r]||[]).length||i[r+\"0\"])return i}}}function a(t){return{v:\"x\",h:\"y\"}[t.orientation||\"v\"]}function o(t,e){var r=a(t),n=s.traceIs(t,\"box\"),i=s.traceIs(t._fullInput||{},\"candlestick\");return n&&!i&&e===r&&void 0===t[r]&&void 0===t[r+\"0\"]}var s=t(\"../../registry\"),l=t(\"./axis_autotype\"),u=t(\"./axis_ids\").name2id;e.exports=function(t,e,r,i,a){a&&(e._name=a,e._id=u(a)),\"-\"===r(\"type\")&&(n(e,i),\"-\"===e.type?e.type=\"linear\":t.type=e.type)}},{\"../../registry\":802,\"./axis_autotype\":725,\"./axis_ids\":727}],747:[function(t,e,r){\"use strict\";function n(t,e,r){var n,i,a,o=!1;if(\"data\"===e.type)n=t._fullData[null!==e.traces?e.traces[0]:0];else{if(\"layout\"!==e.type)return!1;n=t._fullLayout}return i=u.nestedProperty(n,e.prop).get(),(a=r[e.type]=r[e.type]||{}).hasOwnProperty(e.prop)&&a[e.prop]!==i&&(o=!0),a[e.prop]=i,{changed:o,value:i}}function i(t,e){return Array.isArray(e[0])&&1===e[0].length&&-1!==[\"string\",\"number\"].indexOf(typeof e[0][0])?[{type:\"layout\",prop:\"_currentFrame\",value:e[0][0].toString()}]:[]}function a(t,e){var r=[],n=e[0],i={};if(\"string\"==typeof n)i[n]=e[1];else{if(!u.isPlainObject(n))return r;i=n}return s(i,function(t,e,n){r.push({type:\"layout\",prop:t,value:n})},\"\",0),r}function o(t,e){var r,n,i,a,o=[];if(n=e[0],i=e[1],r=e[2],a={},\"string\"==typeof n)a[n]=i;else{if(!u.isPlainObject(n))return o;a=n,void 0===r&&(r=i)}return void 0===r&&(r=null),s(a,function(e,n,i){var a;if(Array.isArray(i)){var s=Math.min(i.length,t.data.length);r&&(s=Math.min(s,r.length)),a=[];for(var l=0;l<s;l++)a[l]=r?r[l]:l}else a=r?r.slice(0):null;if(null===a)Array.isArray(i)&&(i=i[0]);else if(Array.isArray(a)){if(!Array.isArray(i)){var u=i;i=[];for(var c=0;c<a.length;c++)i[c]=u}i.length=Math.min(a.length,i.length)}o.push({type:\"data\",prop:e,traces:a,value:i})},\"\",0),o}function s(t,e,r,n){Object.keys(t).forEach(function(i){var a=t[i];if(\"_\"!==i[0]){var o=r+(n>0?\".\":\"\")+i;u.isPlainObject(a)?s(a,e,o,n+1):e(o,i,a)}})}var l=t(\"../plotly\"),u=t(\"../lib\");r.manageCommandObserver=function(t,e,i,a){var o={},s=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var l=r.hasSimpleAPICommandBindings(t,i,o.lookupTable);if(e&&e._commandObserver){if(l)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(l){n(t,l,o.cache),o.check=function(){if(s){var e=n(t,l,o.cache);return e.changed&&a&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(a({value:e.value,type:l.type,prop:l.prop,traces:l.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var c=[\"plotly_relayout\",\"plotly_redraw\",\"plotly_restyle\",\"plotly_update\",\"plotly_animatingframe\",\"plotly_afterplot\"],h=0;h<c.length;h++)t._internalOn(c[h],o.check);o.remove=function(){for(var e=0;e<c.length;e++)t._removeInternalListener(c[e],o.check)}}else u.warn(\"Unable to automatically bind plot updates to API command\"),o.lookupTable={},o.remove=function(){};return o.disable=function(){s=!1},o.enable=function(){s=!0},e&&(e._commandObserver=o),o},r.hasSimpleAPICommandBindings=function(t,e,n){var i,a,o=e.length;for(i=0;i<o;i++){var s,l=e[i],u=l.method,c=l.args;if(Array.isArray(c)||(c=[]),!u)return!1;var h=r.computeAPICommandBindings(t,u,c);if(1!==h.length)return!1;if(a){if((s=h[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 f=0;f<a.traces.length;f++)if(a.traces[f]!==s.traces[f])return!1}else if(s.prop!==a.prop)return!1}else a=h[0],Array.isArray(a.traces)&&a.traces.sort();var d=(s=h[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){var n=l[e],i=[t];Array.isArray(r)||(r=[]);for(var a=0;a<r.length;a++)i.push(r[a]);return n.apply(null,i).catch(function(t){return u.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=o(t,r);break;case\"relayout\":n=a(t,r);break;case\"update\":n=o(t,[r[0],r[2]]).concat(a(t,[r[1]]));break;case\"animate\":n=i(t,r);break;default:n=[]}return n}},{\"../lib\":685,\"../plotly\":719}],748:[function(t,e,r){\"use strict\";e.exports={family:{valType:\"string\",noBlank:!0,strict:!0},size:{valType:\"number\",min:1},color:{valType:\"color\"}}},{}],749:[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\"}}},{}],750:[function(t,e,r){\"use strict\";var n=e.exports={};n.projNames={equirectangular:\"equirectangular\",mercator:\"mercator\",orthographic:\"orthographic\",\"natural earth\":\"naturalEarth\",kavrayskiy7:\"kavrayskiy7\",miller:\"miller\",robinson:\"robinson\",eckert4:\"eckert4\",\"azimuthal equal area\":\"azimuthalEqualArea\",\"azimuthal equidistant\":\"azimuthalEquidistant\",\"conic equal area\":\"conicEqualArea\",\"conic conformal\":\"conicConformal\",\"conic equidistant\":\"conicEquidistant\",gnomonic:\"gnomonic\",stereographic:\"stereographic\",mollweide:\"mollweide\",hammer:\"hammer\",\"transverse mercator\":\"transverseMercator\",\"albers usa\":\"albersUsa\",\"winkel tripel\":\"winkel3\",aitoff:\"aitoff\",sinusoidal:\"sinusoidal\"},n.axesNames=[\"lonaxis\",\"lataxis\"],n.lonaxisSpan={orthographic:180,\"azimuthal equal area\":360,\"azimuthal equidistant\":360,\"conic conformal\":180,gnomonic:160,stereographic:180,\"transverse mercator\":180,\"*\":360},n.lataxisSpan={\"conic conformal\":150,stereographic:179.5,\"*\":180},n.scopeDefaults={world:{lonaxisRange:[-180,180],lataxisRange:[-90,90],projType:\"equirectangular\",projRotate:[0,0,0]},usa:{lonaxisRange:[-180,-50],lataxisRange:[15,80],projType:\"albers usa\"},europe:{lonaxisRange:[-30,60],lataxisRange:[30,80],projType:\"conic conformal\",projRotate:[15,0,0],projParallels:[0,60]},asia:{lonaxisRange:[22,160],lataxisRange:[-15,55],projType:\"mercator\",projRotate:[0,0,0]},africa:{lonaxisRange:[-30,60],lataxisRange:[-40,40],projType:\"mercator\",projRotate:[0,0,0]},\"north america\":{lonaxisRange:[-180,-45],lataxisRange:[5,85],projType:\"conic conformal\",projRotate:[-100,0,0],projParallels:[29.5,45.5]},\"south america\":{lonaxisRange:[-100,-30],lataxisRange:[-60,15],projType:\"mercator\",projRotate:[0,0,0]}},n.clipPad=.001,n.precision=.1,n.landColor=\"#F0DC82\",n.waterColor=\"#3399FF\",n.locationmodeToLayer={\"ISO-3\":\"countries\",\"USA-states\":\"subunits\",\"country names\":\"countries\"},n.sphereSVG={type:\"Sphere\"},n.fillLayers=[\"ocean\",\"land\",\"lakes\"],n.lineLayers=[\"subunits\",\"countries\",\"coastlines\",\"rivers\",\"frame\"],n.baseLayers=[\"ocean\",\"land\",\"lakes\",\"subunits\",\"countries\",\"coastlines\",\"rivers\",\"lataxis\",\"lonaxis\",\"frame\"],n.layerNameToAdjective={ocean:\"ocean\",land:\"land\",lakes:\"lake\",subunits:\"subunit\",countries:\"country\",coastlines:\"coastline\",rivers:\"river\",frame:\"frame\"},n.baseLayersOverChoropleth=[\"rivers\",\"lakes\"]},{}],751:[function(t,e,r){\"use strict\";function n(t){this.id=t.id,this.graphDiv=t.graphDiv,this.container=t.container,this.topojsonURL=t.topojsonURL,this.topojsonName=null,this.topojson=null,this.projectionType=null,this.projection=null,this.clipAngle=null,this.setScale=null,this.path=null,this.zoom=null,this.zoomReset=null,this.makeFramework(),this.traceHash={}}function i(t,e,r){return u.geo.graticule().extent([[t[0],e[0]],[t[1],e[1]]]).step(r)}function a(t,e,r){var n=b.layerNameToAdjective[e];t.select(\".\"+e).selectAll(\"path\").attr(\"stroke\",\"none\").call(c.fill,r[n+\"color\"])}function o(t,e,r){var n=b.layerNameToAdjective[e];t.select(\".\"+e).selectAll(\"path\").attr(\"fill\",\"none\").call(c.stroke,r[n+\"color\"]).call(h.dashLine,\"\",r[n+\"width\"])}function s(t,e,r){t.select(\".\"+e+\"graticule\").selectAll(\"path\").attr(\"fill\",\"none\").call(c.stroke,r[e].gridcolor).call(h.dashLine,\"\",r[e].gridwidth)}function l(t){var e={type:\"linear\",showexponent:\"all\",exponentformat:d.layoutAttributes.exponentformat.dflt};return d.setConvert(e,t),e}var u=t(\"d3\"),c=t(\"../../components/color\"),h=t(\"../../components/drawing\"),f=t(\"../plots\"),d=t(\"../cartesian/axes\"),p=t(\"../cartesian/graph_interact\"),m=t(\"./projections\"),g=t(\"./set_scale\"),v=t(\"./zoom\"),y=t(\"./zoom_reset\"),b=t(\"./constants\"),x=t(\"../../lib/topojson_utils\"),_=t(\"topojson-client\").feature;m(u),e.exports=n;var w=n.prototype;w.plot=function(t,e,r){var n,i,a=this,o=e[a.id],s=e._size;a.projection=null,a.setScale=g(o,s),a.makeProjection(o),a.makePath(),a.adjustLayout(o,s),a.zoom=v(a,o),a.zoomReset=y(a,o),a.mockAxis=l(e),a.framework.call(a.zoom).on(\"dblclick.zoom\",a.zoomReset),a.framework.on(\"mousemove\",function(){var t=u.mouse(this),e=a.projection.invert(t);if(e&&!isNaN(e[0])&&!isNaN(e[1])){var r=u.event;r.xpx=t[0],r.ypx=t[1],a.xaxis.c2p=function(){return t[0]},a.xaxis.p2c=function(){return e[0]},a.yaxis.c2p=function(){return t[1]},a.yaxis.p2c=function(){return e[1]},p.hover(a.graphDiv,r,a.id)}}),a.framework.on(\"mouseout\",function(){p.loneUnhover(e._toppaper)}),a.framework.on(\"click\",function(){p.click(a.graphDiv,u.event)}),n=x.getTopojsonName(o),null===a.topojson||n!==a.topojsonName?(a.topojsonName=n,void 0!==PlotlyGeoAssets.topojson[a.topojsonName]?(a.topojson=PlotlyGeoAssets.topojson[a.topojsonName],a.onceTopojsonIsLoaded(t,o)):(i=x.getTopojsonPath(a.topojsonURL,a.topojsonName),r.push(new Promise(function(e,r){u.json(i,function(n,s){n?r(404===n.status?new Error([\"plotly.js could not find topojson file at\",i,\".\",\"Make sure the *topojsonURL* plot config option\",\"is set properly.\"].join(\" \")):new Error([\"unexpected error while fetching topojson file at\",i].join(\" \"))):(a.topojson=s,PlotlyGeoAssets.topojson[a.topojsonName]=s,a.onceTopojsonIsLoaded(t,o),e())})})))):a.onceTopojsonIsLoaded(t,o)},w.onceTopojsonIsLoaded=function(t,e){this.drawLayout(e),f.generalUpdatePerTraceModule(this,t,e),this.render()},w.makeProjection=function(t){var e,r=t.projection,n=r.type,i=null===this.projection||n!==this.projectionType;i?(this.projectionType=n,e=this.projection=u.geo[b.projNames[n]]()):e=this.projection,e.translate(r._translate0).precision(b.precision),t._isAlbersUsa||e.rotate(r._rotate).center(r._center),t._clipAngle?(this.clipAngle=t._clipAngle,e.clipAngle(t._clipAngle-b.clipPad)):this.clipAngle=null,r.parallels&&e.parallels(r.parallels),i&&this.setScale(e),e.translate(r._translate).scale(r._scale)},w.makePath=function(){this.path=u.geo.path().projection(this.projection)},w.makeFramework=function(){var t=this.graphDiv._fullLayout,e=\"clip\"+t._uid+this.id,r=t._defs.selectAll(\"g.clips\").data([0]);r.enter().append(\"g\").classed(\"clips\",!0),(this.clipDef=r.selectAll(\"#\"+e).data([0])).enter().append(\"clipPath\").attr(\"id\",e).append(\"rect\");var n=this.framework=u.select(this.container).append(\"g\");n.attr(\"class\",\"geo \"+this.id).style(\"pointer-events\",\"all\").call(h.setClipUrl,e),n.append(\"g\").attr(\"class\",\"bglayer\").append(\"rect\"),n.append(\"g\").attr(\"class\",\"baselayer\"),n.append(\"g\").attr(\"class\",\"choroplethlayer\"),n.append(\"g\").attr(\"class\",\"baselayeroverchoropleth\"),n.append(\"g\").attr(\"class\",\"scattergeolayer\"),n.on(\"dblclick.zoom\",null),this.xaxis={_id:\"x\"},this.yaxis={_id:\"y\"}},w.adjustLayout=function(t,e){var r=t.domain,n=e.l+e.w*r.x[0]+t._marginX,i=e.t+e.h*(1-r.y[1])+t._marginY;h.setTranslate(this.framework,n,i);var a={x:0,y:0,width:t._width,height:t._height};this.clipDef.select(\"rect\").attr(a),this.framework.select(\".bglayer\").select(\"rect\").attr(a).call(c.fill,t.bgcolor),this.xaxis._offset=n,this.xaxis._length=t._width,this.yaxis._offset=i,this.yaxis._length=t._height},w.drawTopo=function(t,e,r){if(!0===r[\"show\"+e]){var n=this.topojson,i=\"frame\"===e?b.sphereSVG:_(n,n.objects[e]);t.append(\"g\").datum(i).attr(\"class\",e).append(\"path\").attr(\"class\",\"basepath\")}},w.drawGraticule=function(t,e,r){var n=r[e];if(!0===n.showgrid){var a=b.scopeDefaults[r.scope],o=i(a.lonaxisRange,a.lataxisRange,\"lonaxis\"===e?[n.dtick]:[0,n.dtick]);t.append(\"g\").datum(o).attr(\"class\",e+\"graticule\").append(\"path\").attr(\"class\",\"graticulepath\")}},w.drawLayout=function(t){var e,r=this.framework.select(\"g.baselayer\"),n=b.baseLayers,i=b.axesNames;r.selectAll(\"*\").remove();for(var a=0;a<n.length;a++)e=n[a],-1!==i.indexOf(e)?this.drawGraticule(r,e,t):this.drawTopo(r,e,t);this.styleLayout(t)},w.styleLayer=function(t,e,r){var n=b.fillLayers,i=b.lineLayers;-1!==n.indexOf(e)?a(t,e,r):-1!==i.indexOf(e)&&o(t,e,r)},w.styleLayout=function(t){for(var e,r=this.framework.select(\"g.baselayer\"),n=b.baseLayers,i=b.axesNames,a=0;a<n.length;a++)e=n[a],-1!==i.indexOf(e)?s(r,e,t):this.styleLayer(r,e,t)},w.isLonLatOverEdges=function(t){var e=this.clipAngle;if(null===e)return!1;var r=this.projection.rotate();return u.geo.distance(t,[-r[0],-r[1]])>e*Math.PI/180},w.render=function(){function t(t){var e=r.projection(t.lonlat);return e?\"translate(\"+e[0]+\",\"+e[1]+\")\":null}function e(t){return r.isLonLatOverEdges(t.lonlat)?\"0\":\"1.0\"}var r=this,n=r.framework,i=n.select(\"g.choroplethlayer\"),a=n.select(\"g.scattergeolayer\"),o=r.path;n.selectAll(\"path.basepath\").attr(\"d\",o),n.selectAll(\"path.graticulepath\").attr(\"d\",o),i.selectAll(\"path.choroplethlocation\").attr(\"d\",o),i.selectAll(\"path.basepath\").attr(\"d\",o),a.selectAll(\"path.js-line\").attr(\"d\",o),null!==r.clipAngle?(a.selectAll(\"path.point\").style(\"opacity\",e).attr(\"transform\",t),a.selectAll(\"text\").style(\"opacity\",e).attr(\"transform\",t)):(a.selectAll(\"path.point\").attr(\"transform\",t),a.selectAll(\"text\").attr(\"transform\",t))}},{\"../../components/color\":578,\"../../components/drawing\":602,\"../../lib/topojson_utils\":706,\"../cartesian/axes\":724,\"../cartesian/graph_interact\":733,\"../plots\":787,\"./constants\":750,\"./projections\":758,\"./set_scale\":759,\"./zoom\":760,\"./zoom_reset\":761,d3:107,\"topojson-client\":516}],752:[function(t,e,r){\"use strict\";var n=t(\"./geo\"),i=t(\"../../plots/plots\");r.name=\"geo\",r.attr=\"geo\",r.idRoot=\"geo\",r.idRegex=/^geo([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^geo([2-9]|[1-9][0-9]+)?$/,r.attributes=t(\"./layout/attributes\"),r.layoutAttributes=t(\"./layout/layout_attributes\"),r.supplyLayoutDefaults=t(\"./layout/defaults\"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,a=i.getSubplotIds(e,\"geo\");void 0===window.PlotlyGeoAssets&&(window.PlotlyGeoAssets={topojson:{}});for(var o=0;o<a.length;o++){var s=a[o],l=i.getSubplotCalcData(r,\"geo\",s),u=e[s]._subplot;u||(u=new n({id:s,graphDiv:t,container:e._geolayer.node(),topojsonURL:t._context.topojsonURL}),e[s]._subplot=u),u.plot(l,e,t._promises)}},r.clean=function(t,e,r,n){for(var a=i.getSubplotIds(n,\"geo\"),o=0;o<a.length;o++){var s=a[o],l=n[s]._subplot;!e[s]&&l&&(l.framework.remove(),l.clipDef.remove())}}},{\"../../plots/plots\":787,\"./geo\":751,\"./layout/attributes\":753,\"./layout/defaults\":756,\"./layout/layout_attributes\":757}],753:[function(t,e,r){\"use strict\";e.exports={geo:{valType:\"subplotid\",dflt:\"geo\"}}},{}],754:[function(t,e,r){\"use strict\";var n=t(\"../../../components/color/attributes\");e.exports={range:{valType:\"info_array\",items:[{valType:\"number\"},{valType:\"number\"}]},showgrid:{valType:\"boolean\",dflt:!1},tick0:{valType:\"number\"},dtick:{valType:\"number\"},gridcolor:{valType:\"color\",dflt:n.lightLine},gridwidth:{valType:\"number\",min:0,dflt:1}}},{\"../../../components/color/attributes\":577}],755:[function(t,e,r){\"use strict\";var n=t(\"../../../lib\"),i=t(\"../constants\"),a=t(\"./axis_attributes\");e.exports=function(t,e){function r(t,e){return n.coerce(o,s,a,t,e)}for(var o,s,l=i.axesNames,u=0;u<l.length;u++){var c=l[u];o=t[c]||{},s={};var h=function(t){var r,n,a,o,s,l,u=e.scope;return\"world\"===u?(r=e.projection,n=r.type,a=r.rotation,s=i[t+\"Span\"],l=void 0!==s[n]?s[n]/2:s[\"*\"]/2,o=\"lonaxis\"===t?a.lon:a.lat,[o-l,o+l]):i.scopeDefaults[u][t+\"Range\"]}(c),f=r(\"range\",h);n.noneOrAll(o.range,s.range,[0,1]),r(\"tick0\",f[0]),r(\"dtick\",\"lonaxis\"===c?30:10),r(\"showgrid\")&&(r(\"gridcolor\"),r(\"gridwidth\")),e[c]=s,e[c]._fullRange=h}}},{\"../../../lib\":685,\"../constants\":750,\"./axis_attributes\":754}],756:[function(t,e,r){\"use strict\";function n(t,e,r){var n=r(\"scope\"),i=\"world\"!==n,o=a.scopeDefaults[n],l=r(\"resolution\"),u=r(\"projection.type\",o.projType),c=\"albers usa\"===u,h=-1!==u.indexOf(\"conic\");if(h&&r(\"projection.parallels\",o.projParallels||[0,60]),c)e.scope=\"usa\";else{var f=o.projRotate||[0,0,0];r(\"projection.rotation.lon\",f[0]),r(\"projection.rotation.lat\",f[1]),r(\"projection.rotation.roll\",f[2]),r(\"showcoastlines\",!i)&&(r(\"coastlinecolor\"),r(\"coastlinewidth\")),r(\"showocean\")&&r(\"oceancolor\")}r(\"projection.scale\"),r(\"showland\")&&r(\"landcolor\"),r(\"showlakes\")&&r(\"lakecolor\"),r(\"showrivers\")&&(r(\"rivercolor\"),r(\"riverwidth\")),r(\"showcountries\",i&&\"usa\"!==n)&&(r(\"countrycolor\"),r(\"countrywidth\")),(\"usa\"===n||\"north america\"===n&&50===l)&&(r(\"showsubunits\",!0),r(\"subunitcolor\"),r(\"subunitwidth\")),i||r(\"showframe\",!0)&&(r(\"framecolor\"),r(\"framewidth\")),r(\"bgcolor\"),s(t,e),e._isHighRes=50===l,e._clipAngle=a.lonaxisSpan[u]/2,e._isAlbersUsa=c,e._isConic=h,e._isScoped=i;var d=e.projection.rotation||{};e.projection._rotate=[-d.lon||0,-d.lat||0,d.roll||0]}var i=t(\"../../subplot_defaults\"),a=t(\"../constants\"),o=t(\"./layout_attributes\"),s=t(\"./axis_defaults\");e.exports=function(t,e,r){i(t,e,r,{type:\"geo\",attributes:o,handleDefaults:n,partition:\"y\"})}},{\"../../subplot_defaults\":794,\"../constants\":750,\"./axis_defaults\":755,\"./layout_attributes\":757}],757:[function(t,e,r){\"use strict\";var n=t(\"../../../components/color/attributes\"),i=t(\"../constants\"),a=t(\"./axis_attributes\");e.exports={domain:{x:{valType:\"info_array\",items:[{valType:\"number\",min:0,max:1},{valType:\"number\",min:0,max:1}],dflt:[0,1]},y:{valType:\"info_array\",items:[{valType:\"number\",min:0,max:1},{valType:\"number\",min:0,max:1}],dflt:[0,1]}},resolution:{valType:\"enumerated\",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:\"enumerated\",values:Object.keys(i.scopeDefaults),dflt:\"world\"},projection:{type:{valType:\"enumerated\",values:Object.keys(i.projNames)},rotation:{lon:{valType:\"number\"},lat:{valType:\"number\"},roll:{valType:\"number\"}},parallels:{valType:\"info_array\",items:[{valType:\"number\"},{valType:\"number\"}]},scale:{valType:\"number\",min:0,max:10,dflt:1}},showcoastlines:{valType:\"boolean\"},coastlinecolor:{valType:\"color\",dflt:n.defaultLine},coastlinewidth:{valType:\"number\",min:0,dflt:1},showland:{valType:\"boolean\",dflt:!1},landcolor:{valType:\"color\",dflt:i.landColor},showocean:{valType:\"boolean\",dflt:!1},oceancolor:{valType:\"color\",dflt:i.waterColor},showlakes:{valType:\"boolean\",dflt:!1},lakecolor:{valType:\"color\",dflt:i.waterColor},showrivers:{valType:\"boolean\",dflt:!1},rivercolor:{valType:\"color\",dflt:i.waterColor},riverwidth:{valType:\"number\",min:0,dflt:1},showcountries:{valType:\"boolean\"},countrycolor:{valType:\"color\",dflt:n.defaultLine},countrywidth:{valType:\"number\",min:0,dflt:1},showsubunits:{valType:\"boolean\"},subunitcolor:{valType:\"color\",dflt:n.defaultLine},subunitwidth:{valType:\"number\",min:0,dflt:1},showframe:{valType:\"boolean\"},framecolor:{valType:\"color\",dflt:n.defaultLine},framewidth:{valType:\"number\",min:0,dflt:1},bgcolor:{valType:\"color\",dflt:n.background},lonaxis:a,lataxis:a}},{\"../../../components/color/attributes\":577,\"../constants\":750,\"./axis_attributes\":754}],758:[function(t,e,r){\"use strict\";function n(t){function e(t,e){return{type:\"Feature\",id:t.id,properties:t.properties,geometry:r(t.geometry,e)}}function r(e,n){if(!e)return null;if(\"GeometryCollection\"===e.type)return{type:\"GeometryCollection\",geometries:object.geometries.map(function(t){return r(t,n)})};if(!S.hasOwnProperty(e.type))return null;var i=S[e.type];return t.geo.stream(e,n(i)),i.result()}function n(){}function i(t){if((e=t.length)<4)return!1;for(var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++r<e;)n+=t[r-1][1]*t[r][0]-t[r-1][0]*t[r][1];return n<=0}function a(t,e){for(var r=e[0],n=e[1],i=!1,a=0,o=t.length,s=o-1;a<o;s=a++){var l=t[a],u=l[0],c=l[1],h=t[s],f=h[0],d=h[1];c>n^d>n&&r<(f-u)*(n-c)/(d-c)+u&&(i=!i)}return i}function o(t){return t?t/Math.sin(t):1}function s(t){return t>1?z:t<-1?-z:Math.asin(t)}function l(t){return t>1?0:t<-1?C:Math.acos(t)}function u(t,e){var r=(2+z)*Math.sin(e);e/=2;for(var n=0,i=1/0;n<10&&Math.abs(i)>E;n++){var a=Math.cos(e);e-=i=(e+Math.sin(e)*(a+2)-r)/(2*a*(1+a))}return[2/Math.sqrt(C*(4+C))*t*(1+Math.cos(e)),2*Math.sqrt(C/(4+C))*Math.sin(e)]}function c(t,e){function r(r,n){var i=j(r/e,n);return i[0]*=t,i}return arguments.length<2&&(e=t),1===e?j:e===1/0?f:(r.invert=function(r,n){var i=j.invert(r/t,n);return i[0]*=e,i},r)}function h(){var t=2,e=O(c),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}function f(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function d(t,e){return[3*t/(2*C)*Math.sqrt(C*C/3-e*e),e]}function p(t,e){return[t,1.25*Math.log(Math.tan(C/4+.4*e))]}function m(t){return function(e){var r,n=t*Math.sin(e),i=30;do{e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e))}while(Math.abs(r)>E&&--i>0);return e/2}}function g(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)))]}function v(t,e){var r,n=Math.min(18,36*Math.abs(e)/C),i=Math.floor(n),a=n-i,o=(r=F[i])[0],s=r[1],l=(r=F[++i])[0],u=r[1],c=(r=F[Math.min(19,++i)])[0],h=r[1];return[t*(l+a*(c-o)/2+a*a*(c-2*l+o)/2),(e>0?z:-z)*(u+a*(h-s)/2+a*a*(h-2*u+s)/2)]}function y(t,e){return[t*Math.cos(e),e]}function b(t,e){var r=Math.cos(e),n=o(l(r*Math.cos(t/=2)));return[2*r*Math.sin(t)*n,Math.sin(e)*n]}function x(t,e){var r=b(t,e);return[(r[0]+t/z)/2,(r[1]+e)/2]}t.geo.project=function(t,e){var n=e.stream;if(!n)throw new Error(\"not yet supported\");return(t&&_.hasOwnProperty(t.type)?_[t.type]:r)(t,n)};var _={Feature:e,FeatureCollection:function(t,r){return{type:\"FeatureCollection\",features:t.features.map(function(t){return e(t,r)})}}},w=[],M=[],k={point:function(t,e){w.push([t,e])},result:function(){var t=w.length?w.length<2?{type:\"Point\",coordinates:w[0]}:{type:\"MultiPoint\",coordinates:w}:null;return w=[],t}},A={lineStart:n,point:function(t,e){w.push([t,e])},lineEnd:function(){w.length&&(M.push(w),w=[])},result:function(){var t=M.length?M.length<2?{type:\"LineString\",coordinates:M[0]}:{type:\"MultiLineString\",coordinates:M}:null;return M=[],t}},T={polygonStart:n,lineStart:n,point:function(t,e){w.push([t,e])},lineEnd:function(){var t=w.length;if(t){do{w.push(w[0].slice())}while(++t<4);M.push(w),w=[]}},polygonEnd:n,result:function(){if(!M.length)return null;var t=[],e=[];return M.forEach(function(r){i(r)?t.push([r]):e.push(r)}),e.forEach(function(e){var r=e[0];t.some(function(t){if(a(t[0],r))return t.push(e),!0})||t.push([e])}),M=[],t.length?t.length>1?{type:\"MultiPolygon\",coordinates:t}:{type:\"Polygon\",coordinates:t[0]}:null}},S={Point:k,MultiPoint:k,LineString:A,MultiLineString:A,Polygon:T,MultiPolygon:T,Sphere:T},E=1e-6,L=E*E,C=Math.PI,z=C/2,D=(Math.sqrt(C),C/180),I=180/C,P=t.geo.projection,O=t.geo.projectionMutator;t.geo.interrupt=function(e){function r(t,r){for(var n=r<0?-1:1,i=l[+(r<0)],a=0,o=i.length-1;a<o&&t>i[a][2][0];++a);var s=e(t-i[a][1][0],r);return s[0]+=e(i[a][1][0],n*r>n*i[a][0][1]?i[a][0][1]:r)[0],s}function n(){s=l.map(function(t){return t.map(function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]})})}function i(){for(var e=1e-6,r=[],n=0,i=l[0].length;n<i;++n){var o=180*(f=l[0][n])[0][0]/C,s=180*f[0][1]/C,u=180*f[1][1]/C,c=180*f[2][0]/C,h=180*f[2][1]/C;r.push(a([[o+e,s+e],[o+e,u-e],[c-e,u-e],[c-e,h+e]],30))}for(n=l[1].length-1;n>=0;--n){var f=l[1][n],o=180*f[0][0]/C,s=180*f[0][1]/C,u=180*f[1][1]/C,c=180*f[2][0]/C,h=180*f[2][1]/C;r.push(a([[c-e,h-e],[c-e,u+e],[o+e,u+e],[o+e,s-e]],30))}return{type:\"Polygon\",coordinates:[t.merge(r)]}}function a(t,e){for(var r,n,i,a=-1,o=t.length,s=t[0],l=[];++a<o;){n=((r=t[a])[0]-s[0])/e,i=(r[1]-s[1])/e;for(var u=0;u<e;++u)l.push([s[0]+u*n,s[1]+u*i]);s=r}return l.push(r),l}function o(t,e){return Math.abs(t[0]-e[0])<E&&Math.abs(t[1]-e[1])<E}var s,l=[[[[-C,0],[0,z],[C,0]]],[[[-C,0],[0,-z],[C,0]]]];e.invert&&(r.invert=function(t,n){for(var i=s[+(n<0)],a=l[+(n<0)],u=0,c=i.length;u<c;++u){var h=i[u];if(h[0][0]<=t&&t<h[1][0]&&h[0][1]<=n&&n<h[1][1]){var f=e.invert(t-e(a[u][1][0],0)[0],n);return f[0]+=a[u][1][0],o(r(f[0],f[1]),[t,n])?f:null}}});var u=t.geo.projection(r),c=u.stream;return u.stream=function(e){var r=u.rotate(),n=c(e),a=(u.rotate([0,0]),c(e));return u.rotate(r),n.sphere=function(){t.geo.stream(i(),a)},n},u.lobes=function(t){return arguments.length?(l=t.map(function(t){return t.map(function(t){return[[t[0][0]*C/180,t[0][1]*C/180],[t[1][0]*C/180,t[1][1]*C/180],[t[2][0]*C/180,t[2][1]*C/180]]})}),n(),u):l.map(function(t){return t.map(function(t){return[[180*t[0][0]/C,180*t[0][1]/C],[180*t[1][0]/C,180*t[1][1]/C],[180*t[2][0]/C,180*t[2][1]/C]]})})},u},u.invert=function(t,e){var r=.5*e*Math.sqrt((4+C)/C),n=s(r),i=Math.cos(n);return[t/(2/Math.sqrt(C*(4+C))*(1+i)),s((n+r*(i+2))/(2+z))]},(t.geo.eckert4=function(){return P(u)}).raw=u;var j=t.geo.azimuthalEqualArea.raw;f.invert=function(t,e){var r=2*s(e/2);return[t*Math.cos(r/2)/Math.cos(r),r]},(t.geo.hammer=h).raw=c,d.invert=function(t,e){return[2/3*C*t/Math.sqrt(C*C/3-e*e),e]},(t.geo.kavrayskiy7=function(){return P(d)}).raw=d,p.invert=function(t,e){return[t,2.5*Math.atan(Math.exp(.8*e))-.625*C]},(t.geo.miller=function(){return P(p)}).raw=p;m(C);var R=function(t,e,r){function n(r,n){return[t*r*Math.cos(n=i(n)),e*Math.sin(n)]}var i=m(r);return n.invert=function(n,i){var a=s(i/e);return[n/(t*Math.cos(a)),s((2*a+Math.sin(2*a))/r)]},n}(Math.SQRT2/z,Math.SQRT2,C);(t.geo.mollweide=function(){return P(R)}).raw=R,g.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)>E&&--i>0);return[t/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},(t.geo.naturalEarth=function(){return P(g)}).raw=g;var F=[[.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]];F.forEach(function(t){t[1]*=1.0144}),v.invert=function(t,e){var r=e/z,n=90*r,i=Math.min(18,Math.abs(n/5)),a=Math.max(0,Math.floor(i));do{var o=F[a][1],s=F[a+1][1],l=F[Math.min(19,a+2)][1],u=l-o,c=l-2*s+o,h=2*(Math.abs(r)-s)/u,f=c/u,d=h*(1-f*h*(1-2*f*h));if(d>=0||1===a){n=(e>=0?5:-5)*(d+i);var p,m=50;do{d=(i=Math.min(18,Math.abs(n)/5))-(a=Math.floor(i)),o=F[a][1],s=F[a+1][1],l=F[Math.min(19,a+2)][1],n-=(p=(e>=0?z:-z)*(s+d*(l-o)/2+d*d*(l-2*s+o)/2)-e)*I}while(Math.abs(p)>L&&--m>0);break}}while(--a>=0);var g=F[a][0],v=F[a+1][0],y=F[Math.min(19,a+2)][0];return[t/(v+d*(y-g)/2+d*d*(y-2*v+g)/2),n*D]},(t.geo.robinson=function(){return P(v)}).raw=v,y.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return P(y)}).raw=y,b.invert=function(t,e){if(!(t*t+4*e*e>C*C+E)){var r=t,n=e,i=25;do{var a,o=Math.sin(r),s=Math.sin(r/2),u=Math.cos(r/2),c=Math.sin(n),h=Math.cos(n),f=Math.sin(2*n),d=c*c,p=h*h,m=s*s,g=1-p*u*u,v=g?l(h*u)*Math.sqrt(a=1/g):a=0,y=2*v*h*s-t,b=v*c-e,x=a*(p*m+v*h*u*d),_=a*(.5*o*f-2*v*c*s),w=.25*a*(f*s-v*c*p*o),M=a*(d*u+v*m*h),k=_*w-M*x;if(!k)break;var A=(b*_-y*M)/k,T=(y*w-b*x)/k;r-=A,n-=T}while((Math.abs(A)>E||Math.abs(T)>E)&&--i>0);return[r,n]}},(t.geo.aitoff=function(){return P(b)}).raw=b,x.invert=function(t,e){var r=t,n=e,i=25;do{var a,o=Math.cos(n),s=Math.sin(n),u=Math.sin(2*n),c=s*s,h=o*o,f=Math.sin(r),d=Math.cos(r/2),p=Math.sin(r/2),m=p*p,g=1-h*d*d,v=g?l(o*d)*Math.sqrt(a=1/g):a=0,y=.5*(2*v*o*p+r/z)-t,b=.5*(v*s+n)-e,x=.5*a*(h*m+v*o*d*c)+.5/z,_=a*(f*u/4-v*s*p),w=.125*a*(u*p-v*s*h*f),M=.5*a*(c*d+v*m*o)+.5,k=_*w-M*x,A=(b*_-y*M)/k,T=(y*w-b*x)/k;r-=A,n-=T}while((Math.abs(A)>E||Math.abs(T)>E)&&--i>0);return[r,n]},(t.geo.winkel3=function(){return P(x)}).raw=x}e.exports=n},{}],759:[function(t,e,r){\"use strict\";function n(t,e){var r=t.projection,n=t.lonaxis,o=t.lataxis,l=t.domain,u=t.framewidth||0,c=e.w*(l.x[1]-l.x[0]),h=e.h*(l.y[1]-l.y[0]),f=n.range[0]+s,d=n.range[1]-s,p=o.range[0]+s,m=o.range[1]-s,g=n._fullRange[0]+s,v=n._fullRange[1]-s,y=o._fullRange[0]+s,b=o._fullRange[1]-s;r._translate0=[e.l+c/2,e.t+h/2];var x=[f+(d-f)/2,p+(m-p)/2],_=r._rotate;return r._center=[x[0]+_[0],x[1]+_[1]],function(e){function n(t){return Math.min(_*c/(t[1][0]-t[0][0]),_*h/(t[1][1]-t[0][1]))}var o,s,l,x,_=e.scale(),w=r._translate0,M=i(f,p,d,m),k=i(g,y,v,b);o=n(l=a(e,M)),x=a(e,k),r._fullScale=n(x),e.scale(o),l=a(e,M),s=[w[0]-l[0][0]+u,w[1]-l[0][1]+u],r._translate=s,e.translate(s),l=a(e,M),t._isAlbersUsa||e.clipExtent(l),o=r.scale*o,r._scale=o,t._width=Math.round(l[1][0])+u,t._height=Math.round(l[1][1])+u,t._marginX=(c-Math.round(l[1][0]))/2,t._marginY=(h-Math.round(l[1][1]))/2}}function i(t,e,r,n){var i=(r-t)/4;return{type:\"Polygon\",coordinates:[[[t,e],[t,n],[t+i,n],[t+2*i,n],[t+3*i,n],[r,n],[r,e],[r-i,e],[r-2*i,e],[r-3*i,e],[t,e]]]}}function a(t,e){return o.geo.path().projection(t).bounds(e)}var o=t(\"d3\"),s=t(\"./constants\").clipPad;e.exports=n},{\"./constants\":750,d3:107}],760:[function(t,e,r){\"use strict\";function n(t,e){return(e._isScoped?a:e._clipAngle?s:o)(t,e.projection)}function i(t,e){var r=e._fullScale;return _.behavior.zoom().translate(t.translate()).scale(t.scale()).scaleExtent([.5*r,100*r])}function a(t,e){function r(){_.select(this).style(k)}function n(){o.scale(_.event.scale).translate(_.event.translate),t.render()}function a(){_.select(this).style(A)}var o=t.projection,s=i(o,e);return s.on(\"zoomstart\",r).on(\"zoom\",n).on(\"zoomend\",a),s}function o(t,e){function r(t){return g.invert(t)}function n(t){var e=g(r(t));return Math.abs(e[0]-t[0])>y||Math.abs(e[1]-t[1])>y}function a(){_.select(this).style(k),l=_.mouse(this),u=g.rotate(),c=g.translate(),h=u,f=r(l)}function o(){if(d=_.mouse(this),n(l))return v.scale(g.scale()),void v.translate(g.translate());g.scale(_.event.scale),g.translate([c[0],_.event.translate[1]]),f?r(d)&&(m=r(d),p=[h[0]+(m[0]-f[0]),u[1],u[2]],g.rotate(p),h=p):f=r(l=d),t.render()}function s(){_.select(this).style(A)}var l,u,c,h,f,d,p,m,g=t.projection,v=i(g,e),y=2;return v.on(\"zoomstart\",a).on(\"zoom\",o).on(\"zoomend\",s),v}function s(t,e){function r(t){v++||t({type:\"zoomstart\"})}function n(t){t({type:\"zoom\"})}function a(t){--v||t({type:\"zoomend\"})}var o,s=t.projection,d={r:s.rotate(),k:s.scale()},p=i(s,e),m=x(p,\"zoomstart\",\"zoom\",\"zoomend\"),v=0,y=p.on;return p.on(\"zoomstart\",function(){_.select(this).style(k);var t=_.mouse(this),e=s.rotate(),i=e,a=s.translate(),v=u(e);o=l(s,t),y.call(p,\"zoom\",function(){var r=_.mouse(this);if(s.scale(d.k=_.event.scale),o){if(l(s,r)){s.rotate(e).translate(a);var u=l(s,r),p=h(o,u),y=g(c(v,p)),b=d.r=f(y,o,i);isFinite(b[0])&&isFinite(b[1])&&isFinite(b[2])||(b=i),s.rotate(b),i=b}}else o=l(s,t=r);n(m.of(this,arguments))}),r(m.of(this,arguments))}).on(\"zoomend\",function(){_.select(this).style(A),y.call(p,\"zoom\",null),a(m.of(this,arguments))}).on(\"zoom.redraw\",function(){t.render()}),_.rebind(p,m,\"on\")}function l(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&v(r)}function u(t){var e=.5*t[0]*w,r=.5*t[1]*w,n=.5*t[2]*w,i=Math.sin(e),a=Math.cos(e),o=Math.sin(r),s=Math.cos(r),l=Math.sin(n),u=Math.cos(n);return[a*s*u+i*o*l,i*s*u-a*o*l,a*o*u+i*s*l,a*s*l-i*o*u]}function c(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=e[0],s=e[1],l=e[2],u=e[3];return[r*o-n*s-i*l-a*u,r*s+n*o+i*u-a*l,r*l-n*u+i*o+a*s,r*u+n*l-i*s+a*o]}function h(t,e){if(t&&e){var r=b(t,e),n=Math.sqrt(y(r,r)),i=.5*Math.acos(Math.max(-1,Math.min(1,y(t,e)))),a=Math.sin(i)/n;return n&&[Math.cos(i),r[2]*a,-r[1]*a,r[0]*a]}}function f(t,e,r){var n=m(e,2,t[0]);n=m(n=m(n,1,t[1]),0,t[2]-r[2]);var i,a,o=e[0],s=e[1],l=e[2],u=n[0],c=n[1],h=n[2],f=Math.atan2(s,o)*M,p=Math.sqrt(o*o+s*s);Math.abs(c)>p?(a=(c>0?90:-90)-f,i=0):(a=Math.asin(c/p)*M-f,i=Math.sqrt(p*p-c*c));var g=180-a-2*f,v=(Math.atan2(h,u)-Math.atan2(l,i))*M,y=(Math.atan2(h,u)-Math.atan2(l,-i))*M;return d(r[0],r[1],a,v)<=d(r[0],r[1],g,y)?[a,v,r[2]]:[g,y,r[2]]}function d(t,e,r,n){var i=p(r-t),a=p(n-e);return Math.sqrt(i*i+a*a)}function p(t){return(t%360+540)%360-180}function m(t,e,r){var n=r*w,i=t.slice(),a=0===e?1:0,o=2===e?1:2,s=Math.cos(n),l=Math.sin(n);return i[a]=t[a]*s-t[o]*l,i[o]=t[o]*s+t[a]*l,i}function g(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*M,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*M,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*M]}function v(t){var e=t[0]*w,r=t[1]*w,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function y(t,e){for(var r=0,n=0,i=t.length;n<i;++n)r+=t[n]*e[n];return r}function b(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 x(t){for(var e=0,r=arguments.length,n=[];++e<r;)n.push(arguments[e]);var i=_.dispatch.apply(null,n);return i.of=function(e,r){return function(n){var a;try{a=n.sourceEvent=_.event,n.target=t,_.event=n,i[n.type].apply(e,r)}finally{_.event=a}}},i}var _=t(\"d3\"),w=Math.PI/180,M=180/Math.PI,k={cursor:\"pointer\"},A={cursor:\"auto\"};e.exports=n},{d3:107}],761:[function(t,e,r){\"use strict\";e.exports=function(t,e){var r=t.projection,n=t.zoom;return function(){t.makeProjection(e),t.makePath(),n.scale(r.scale()),n.translate(r.translate()),t.render()}}},{}],762:[function(t,e,r){\"use strict\";function n(t,e){this.element=t,this.plot=e,this.mouseListener=null,this.wheelListener=null,this.lastInputTime=Date.now(),this.lastPos=[0,0],this.boxEnabled=!1,this.boxInited=!1,this.boxStart=[0,0],this.boxEnd=[0,0],this.dragStart=[0,0]}function i(t){function e(){t.xaxis.autorange=!1,t.yaxis.autorange=!1}function r(){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}var i=t.mouseContainer,l=t.glplot,u=new n(i,l);return u.mouseListener=a(i,function(n,i,a){function o(e,r,n){var i=Math.min(r,n),a=Math.max(r,n);i!==a?(f[e]=i,f[e+2]=a,u.dataBox=f,t.setRanges(f)):(t.selectBox.selectBox=[0,0,1,1],t.glplot.setDirty())}var c,h,f=t.calcDataBox(),d=l.viewBox,p=u.lastPos[0],m=u.lastPos[1],g=s.MINDRAG*l.pixelRatio,v=s.MINZOOM*l.pixelRatio;switch(i*=l.pixelRatio,a*=l.pixelRatio,a=d[3]-d[1]-a,t.fullLayout.dragmode){case\"zoom\":if(n){var y=i/(d[2]-d[0])*(f[2]-f[0])+f[0],b=a/(d[3]-d[1])*(f[3]-f[1])+f[1];u.boxInited||(u.boxStart[0]=y,u.boxStart[1]=b,u.dragStart[0]=i,u.dragStart[1]=a),u.boxEnd[0]=y,u.boxEnd[1]=b,u.boxInited=!0,u.boxEnabled||u.boxStart[0]===u.boxEnd[0]&&u.boxStart[1]===u.boxEnd[1]||(u.boxEnabled=!0);var x=Math.abs(u.dragStart[0]-i)<v,_=Math.abs(u.dragStart[1]-a)<v;if(!r()||x&&_)x&&(u.boxEnd[0]=u.boxStart[0]),_&&(u.boxEnd[1]=u.boxStart[1]);else{c=u.boxEnd[0]-u.boxStart[0],h=u.boxEnd[1]-u.boxStart[1];var w=(f[3]-f[1])/(f[2]-f[0]);Math.abs(c*w)>Math.abs(h)?(u.boxEnd[1]=u.boxStart[1]+Math.abs(c)*w*(Math.sign(h)||1),u.boxEnd[1]<f[1]?(u.boxEnd[1]=f[1],u.boxEnd[0]=u.boxStart[0]+(f[1]-u.boxStart[1])/Math.abs(w)):u.boxEnd[1]>f[3]&&(u.boxEnd[1]=f[3],u.boxEnd[0]=u.boxStart[0]+(f[3]-u.boxStart[1])/Math.abs(w))):(u.boxEnd[0]=u.boxStart[0]+Math.abs(h)/w*(Math.sign(c)||1),u.boxEnd[0]<f[0]?(u.boxEnd[0]=f[0],u.boxEnd[1]=u.boxStart[1]+(f[0]-u.boxStart[0])*Math.abs(w)):u.boxEnd[0]>f[2]&&(u.boxEnd[0]=f[2],u.boxEnd[1]=u.boxStart[1]+(f[2]-u.boxStart[0])*Math.abs(w)))}}else u.boxEnabled&&(c=u.boxStart[0]!==u.boxEnd[0],h=u.boxStart[1]!==u.boxEnd[1],c||h?(c&&(o(0,u.boxStart[0],u.boxEnd[0]),t.xaxis.autorange=!1),h&&(o(1,u.boxStart[1],u.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),u.boxEnabled=!1,u.boxInited=!1);break;case\"pan\":u.boxEnabled=!1,u.boxInited=!1,n?(u.panning||(u.dragStart[0]=i,u.dragStart[1]=a),Math.abs(u.dragStart[0]-i)<g&&(i=u.dragStart[0]),Math.abs(u.dragStart[1]-a)<g&&(a=u.dragStart[1]),c=(p-i)*(f[2]-f[0])/(l.viewBox[2]-l.viewBox[0]),h=(m-a)*(f[3]-f[1])/(l.viewBox[3]-l.viewBox[1]),f[0]+=c,f[2]+=c,f[1]+=h,f[3]+=h,t.setRanges(f),u.panning=!0,u.lastInputTime=Date.now(),e(),t.cameraChanged(),t.handleAnnotations()):u.panning&&(u.panning=!1,t.relayoutCallback())}u.lastPos[0]=i,u.lastPos[1]=a}),u.wheelListener=o(i,function(r,n){var i=t.calcDataBox(),a=l.viewBox,o=u.lastPos[0],s=u.lastPos[1];switch(t.fullLayout.dragmode){case\"zoom\":break;case\"pan\":var c=Math.exp(.1*n/(a[3]-a[1])),h=o/(a[2]-a[0])*(i[2]-i[0])+i[0],f=s/(a[3]-a[1])*(i[3]-i[1])+i[1];i[0]=(i[0]-h)*c+h,i[2]=(i[2]-h)*c+h,i[1]=(i[1]-f)*c+f,i[3]=(i[3]-f)*c+f,t.setRanges(i),u.lastInputTime=Date.now(),e(),t.cameraChanged(),t.handleAnnotations(),t.relayoutCallback()}return!0}),u}var a=t(\"mouse-change\"),o=t(\"mouse-wheel\"),s=t(\"../cartesian/constants\");e.exports=i},{\"../cartesian/constants\":729,\"mouse-change\":434,\"mouse-wheel\":437}],763:[function(t,e,r){\"use strict\";function n(t){this.scene=t,this.gl=t.gl,this.pixelRatio=t.pixelRatio,this.screenBox=[0,0,1,1],this.viewBox=[0,0,1,1],this.dataBox=[-1,-1,1,1],this.borderLineEnable=[!1,!1,!1,!1],this.borderLineWidth=[1,1,1,1],this.borderLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.ticks=[[],[]],this.tickEnable=[!0,!0,!1,!1],this.tickPad=[15,15,15,15],this.tickAngle=[0,0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickMarkLength=[0,0,0,0],this.tickMarkWidth=[0,0,0,0],this.tickMarkColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labels=[\"x\",\"y\"],this.labelEnable=[!0,!0,!1,!1],this.labelAngle=[0,Math.PI/2,0,3*Math.PI/2],this.labelPad=[15,15,15,15],this.labelSize=[12,12],this.labelFont=[\"sans-serif\",\"sans-serif\"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.title=\"\",this.titleEnable=!0,this.titleCenter=[0,0,0,0],this.titleAngle=0,this.titleColor=[0,0,0,1],this.titleFont=\"sans-serif\",this.titleSize=18,this.gridLineEnable=[!0,!0],this.gridLineColor=[[0,0,0,.5],[0,0,0,.5]],this.gridLineWidth=[1,1],this.zeroLineEnable=[!0,!0],this.zeroLineWidth=[1,1],this.zeroLineColor=[[0,0,0,1],[0,0,0,1]],this.borderColor=[0,0,0,0],this.backgroundColor=[0,0,0,0],this.static=this.scene.staticPlot}function i(t){return new n(t)}var a=t(\"../plots\"),o=t(\"../cartesian/axes\"),s=t(\"../../lib/html2unicode\"),l=t(\"../../lib/str2rgbarray\"),u=n.prototype,c=[\"xaxis\",\"yaxis\"];u.merge=function(t){this.titleEnable=!1,this.backgroundColor=l(t.plot_bgcolor);var e,r,n,i,a,o,u,h,f,d,p;for(d=0;d<2;++d){for(e=c[d],r=t[this.scene[e]._name],n=/Click to enter .+ title/.test(r.title)?\"\":r.title,p=0;p<=2;p+=2)this.labelEnable[d+p]=!1,this.labels[d+p]=s(n),this.labelColor[d+p]=l(r.titlefont.color),this.labelFont[d+p]=r.titlefont.family,this.labelSize[d+p]=r.titlefont.size,this.labelPad[d+p]=this.getLabelPad(e,r),this.tickEnable[d+p]=!1,this.tickColor[d+p]=l((r.tickfont||{}).color),this.tickAngle[d+p]=\"auto\"===r.tickangle?0:Math.PI*-r.tickangle/180,this.tickPad[d+p]=this.getTickPad(r),this.tickMarkLength[d+p]=0,this.tickMarkWidth[d+p]=r.tickwidth||0,this.tickMarkColor[d+p]=l(r.tickcolor),this.borderLineEnable[d+p]=!1,this.borderLineColor[d+p]=l(r.linecolor),this.borderLineWidth[d+p]=r.linewidth||0;u=this.hasSharedAxis(r),a=this.hasAxisInDfltPos(e,r)&&!u,o=this.hasAxisInAltrPos(e,r)&&!u,i=r.mirror||!1,h=u?-1!==String(i).indexOf(\"all\"):!!i,f=u?\"allticks\"===i:-1!==String(i).indexOf(\"ticks\"),a?this.labelEnable[d]=!0:o&&(this.labelEnable[d+2]=!0),a?this.tickEnable[d]=r.showticklabels:o&&(this.tickEnable[d+2]=r.showticklabels),(a||h)&&(this.borderLineEnable[d]=r.showline),(o||h)&&(this.borderLineEnable[d+2]=r.showline),(a||f)&&(this.tickMarkLength[d]=this.getTickMarkLength(r)),(o||f)&&(this.tickMarkLength[d+2]=this.getTickMarkLength(r)),this.gridLineEnable[d]=r.showgrid,this.gridLineColor[d]=l(r.gridcolor),this.gridLineWidth[d]=r.gridwidth,this.zeroLineEnable[d]=r.zeroline,this.zeroLineColor[d]=l(r.zerolinecolor),this.zeroLineWidth[d]=r.zerolinewidth}},u.hasSharedAxis=function(t){var e=this.scene,r=a.getSubplotIds(e.fullLayout,\"gl2d\");return 0!==o.findSubplotsWithAxis(r,t).indexOf(e.id)},u.hasAxisInDfltPos=function(t,e){var r=e.side;return\"xaxis\"===t?\"bottom\"===r:\"yaxis\"===t?\"left\"===r:void 0},u.hasAxisInAltrPos=function(t,e){var r=e.side;return\"xaxis\"===t?\"top\"===r:\"yaxis\"===t?\"right\"===r:void 0},u.getLabelPad=function(t,e){var r=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},u.getTickPad=function(t){return\"outside\"===t.ticks?10+t.ticklen:15},u.getTickMarkLength=function(t){if(!t.ticks)return 0;var e=t.ticklen;return\"inside\"===t.ticks?-e:e},e.exports=i},{\"../../lib/html2unicode\":683,\"../../lib/str2rgbarray\":703,\"../cartesian/axes\":724,\"../plots\":787}],764:[function(t,e,r){\"use strict\";var n=t(\"./scene2d\"),i=t(\"../plots\"),a=t(\"../../constants/xmlns_namespaces\");r.name=\"gl2d\",r.attr=[\"xaxis\",\"yaxis\"],r.idRoot=[\"x\",\"y\"],r.idRegex={x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},r.attrRegex={x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},r.attributes=t(\"../cartesian/attributes\"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,a=i.getSubplotIds(e,\"gl2d\"),o=0;o<a.length;o++){var s=a[o],l=e._plots[s],u=i.getSubplotData(r,\"gl2d\",s),c=l._scene2d;void 0===c&&(c=new n({id:s,graphDiv:t,container:t.querySelector(\".gl-container\"),staticPlot:t._context.staticPlot,plotGlPixelRatio:t._context.plotGlPixelRatio},e),l._scene2d=c),c.plot(u,t.calcdata,e,t.layout)}},r.clean=function(t,e,r,n){for(var a=i.getSubplotIds(n,\"gl2d\"),o=0;o<a.length;o++){var s=a[o],l=n._plots[s];l._scene2d&&(0===i.getSubplotData(t,\"gl2d\",s).length&&(l._scene2d.destroy(),delete n._plots[s]))}},r.toSVG=function(t){for(var e=t._fullLayout,r=i.getSubplotIds(e,\"gl2d\"),n=0;n<r.length;n++){var o=e._plots[r[n]]._scene2d,s=o.toImage(\"png\");e._glimages.append(\"svg:image\").attr({xmlns:a.svg,\"xlink:href\":s,x:0,y:0,width:\"100%\",height:\"100%\",preserveAspectRatio:\"none\"}),o.destroy()}}},{\"../../constants/xmlns_namespaces\":668,\"../cartesian/attributes\":723,\"../plots\":787,\"./scene2d\":765}],765:[function(t,e,r){\"use strict\";function n(t,e){this.container=t.container,this.graphDiv=t.graphDiv,this.pixelRatio=t.plotGlPixelRatio||window.devicePixelRatio,this.id=t.id,this.staticPlot=!!t.staticPlot,this.fullData=null,this.updateRefs(e),this.makeFramework(),this.glplotOptions=p(this),this.glplotOptions.merge(e),this.glplot=c(this.glplotOptions),this.camera=m(this),this.traces={},this.spikes=h(this.glplot),this.selectBox=f(this.glplot,{innerFill:!1,outerFill:!0}),this.lastButtonState=0,this.pickResult=null,this.bounds=[1/0,1/0,-1/0,-1/0],this.stopped=!1,this.redraw=this.draw.bind(this),this.redraw()}function i(t,e){for(var r=0;r<2;++r){var n=t[r],i=e[r];if(n.length!==i.length)return!0;for(var a=0;a<n.length;++a)if(n[a].x!==i[a].x)return!0}return!1}var a,o,s=t(\"../../registry\"),l=t(\"../../plots/cartesian/axes\"),u=t(\"../../plots/cartesian/graph_interact\"),c=t(\"gl-plot2d\"),h=t(\"gl-spikes2d\"),f=t(\"gl-select-box\"),d=t(\"webgl-context\"),p=t(\"./convert\"),m=t(\"./camera\"),g=t(\"../../lib/html2unicode\"),v=t(\"../../lib/show_no_webgl_msg\"),y=t(\"../../plots/cartesian/constraints\"),b=[\"xaxis\",\"yaxis\"];e.exports=n;var x=n.prototype;x.makeFramework=function(){if(this.staticPlot){if(!(o||(a=document.createElement(\"canvas\"),o=d({canvas:a,preserveDrawingBuffer:!1,premultipliedAlpha:!0,antialias:!0}))))throw new Error(\"Error creating static canvas/context for image server\");this.canvas=a,this.gl=o}else{var t=document.createElement(\"canvas\"),e=d({canvas:t,premultipliedAlpha:!0});e||v(this),this.canvas=t,this.gl=e}var r=this.canvas;r.style.width=\"100%\",r.style.height=\"100%\",r.style.position=\"absolute\",r.style.top=\"0px\",r.style.left=\"0px\",r.style[\"pointer-events\"]=\"none\",this.updateSize(r),r.className+=\"user-select-none\";var n=this.svgContainer=document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\");n.style.position=\"absolute\",n.style.top=n.style.left=\"0px\",n.style.width=n.style.height=\"100%\",n.style[\"z-index\"]=20,n.style[\"pointer-events\"]=\"none\";var i=this.mouseContainer=document.createElement(\"div\");i.style.position=\"absolute\";var s=this.container;s.appendChild(r),s.appendChild(n),s.appendChild(i)},x.toImage=function(t){t||(t=\"png\"),this.stopped=!0,this.staticPlot&&this.container.appendChild(a),this.updateSize(this.canvas),this.glplot.setDirty(),this.glplot.draw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var o=0,s=n-1;o<s;++o,--s)for(var l=0;l<r;++l)for(var u=0;u<4;++u){var c=i[4*(r*o+l)+u];i[4*(r*o+l)+u]=i[4*(r*s+l)+u],i[4*(r*s+l)+u]=c}var h=document.createElement(\"canvas\");h.width=r,h.height=n;var f=h.getContext(\"2d\"),d=f.createImageData(r,n);d.data.set(i),f.putImageData(d,0,0);var p;switch(t){case\"jpeg\":p=h.toDataURL(\"image/jpeg\");break;case\"webp\":p=h.toDataURL(\"image/webp\");break;default:p=h.toDataURL(\"image/png\")}return this.staticPlot&&this.container.removeChild(a),p},x.updateSize=function(t){t||(t=this.canvas);var e=this.pixelRatio,r=this.fullLayout,n=r.width,i=r.height,a=0|Math.ceil(e*n),o=0|Math.ceil(e*i);return t.width===a&&t.height===o||(t.width=a,t.height=o),this.redraw&&this.redraw(),t},x.computeTickMarks=function(){this.xaxis.setScale(),this.yaxis.setScale(),this.xaxis._length=this.glplot.viewBox[2]-this.glplot.viewBox[0],this.yaxis._length=this.glplot.viewBox[3]-this.glplot.viewBox[1];for(var t=[l.calcTicks(this.xaxis),l.calcTicks(this.yaxis)],e=0;e<2;++e)for(var r=0;r<t[e].length;++r)t[e][r].text=g(t[e][r].text+\"\");return t},x.updateRefs=function(t){this.fullLayout=t;var e=l.subplotMatch,r=\"xaxis\"+this.id.match(e)[1],n=\"yaxis\"+this.id.match(e)[2];this.xaxis=this.fullLayout[r],this.yaxis=this.fullLayout[n]},x.relayoutCallback=function(){var t=this.graphDiv,e=this.xaxis,r=this.yaxis,n=t.layout;n.xaxis.autorange=e.autorange,n.xaxis.range=e.range.slice(0),n.yaxis.autorange=r.autorange,n.yaxis.range=r.range.slice(0);var i={lastInputTime:this.camera.lastInputTime};i[e._name]=e.range.slice(0),i[r._name]=r.range.slice(0),t.emit(\"plotly_relayout\",i)},x.cameraChanged=function(){var t=this.camera;this.glplot.setDataBox(this.calcDataBox());var e=this.computeTickMarks();i(e,this.glplotOptions.ticks)&&(this.glplotOptions.ticks=e,this.glplotOptions.dataBox=t.dataBox,this.glplot.update(this.glplotOptions),this.handleAnnotations())},x.handleAnnotations=function(){for(var t=this.graphDiv,e=this.fullLayout.annotations,r=0;r<e.length;r++){var n=e[r];n.xref===this.xaxis._id&&n.yref===this.yaxis._id&&s.getComponentMethod(\"annotations\",\"drawOne\")(t,r)}},x.destroy=function(){var t=this.traces;t&&Object.keys(t).map(function(e){t[e].dispose(),delete t[e]}),this.glplot.dispose(),this.staticPlot||this.container.removeChild(this.canvas),this.container.removeChild(this.svgContainer),this.container.removeChild(this.mouseContainer),this.fullData=null,this.glplot=null,this.stopped=!0},x.plot=function(t,e,r){var n=this.glplot;this.updateRefs(r),this.updateTraces(t,e);var i=r.width,a=r.height;this.updateSize(this.canvas);var o=this.glplotOptions;o.merge(r),o.screenBox=[0,0,i,a];var s=r._size,u=this.xaxis.domain,c=this.yaxis.domain;o.viewBox=[s.l+u[0]*s.w,s.b+c[0]*s.h,i-s.r-(1-u[1])*s.w,a-s.t-(1-c[1])*s.h],this.mouseContainer.style.width=s.w*(u[1]-u[0])+\"px\",this.mouseContainer.style.height=s.h*(c[1]-c[0])+\"px\",this.mouseContainer.height=s.h*(c[1]-c[0]),this.mouseContainer.style.left=s.l+u[0]*s.w+\"px\",this.mouseContainer.style.top=s.t+(1-c[1])*s.h+\"px\";var h=this.bounds;h[0]=h[1]=1/0,h[2]=h[3]=-1/0;var f,d,p=Object.keys(this.traces);for(d=0;d<p.length;++d)for(var m=this.traces[p[d]],g=0;g<2;++g)h[g]=Math.min(h[g],m.bounds[g]),h[g+2]=Math.max(h[g+2],m.bounds[g+2]);for(d=0;d<2;++d)h[d]>h[d+2]&&(h[d]=-1,h[d+2]=1),(f=this[b[d]])._length=o.viewBox[d+2]-o.viewBox[d],l.doAutoRange(f),f.setScale();var v={_axisConstraintGroups:this.graphDiv._fullLayout._axisConstraintGroups,xaxis:this.xaxis,yaxis:this.yaxis};y({_fullLayout:v}),o.ticks=this.computeTickMarks(),o.dataBox=this.calcDataBox(),o.merge(r),n.update(o),this.glplot.draw()},x.calcDataBox=function(){var t=this.xaxis,e=this.yaxis,r=t.range,n=e.range,i=t.r2l,a=e.r2l;return[i(r[0]),a(n[0]),i(r[1]),a(n[1])]},x.setRanges=function(t){var e=this.xaxis,r=this.yaxis,n=e.l2r,i=r.l2r;e.range=[n(t[0]),n(t[2])],r.range=[i(t[1]),i(t[3])]},x.updateTraces=function(t,e){var r,n,i,a=Object.keys(this.traces);this.fullData=t;t:for(r=0;r<a.length;r++){var o=a[r],s=this.traces[o];for(n=0;n<t.length;n++)if((i=t[n]).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],u=this.traces[i.uid];u?u.update(i,l):(u=i._module.plot(this,i,l),this.traces[i.uid]=u)}this.glplot.objects.sort(function(t,e){return t._trace.index-e._trace.index})},x.emitPointAction=function(t,e){for(var r,n=t.trace.uid,i=0;i<this.fullData.length;i++)this.fullData[i].uid===n&&(r=this.fullData[i]);this.graphDiv.emit(e,{points:[{x:t.traceCoord[0],y:t.traceCoord[1],curveNumber:r.index,pointNumber:t.pointIndex,data:r._input,fullData:this.fullData,xaxis:this.xaxis,yaxis:this.yaxis}]})},x.draw=function(){if(!this.stopped){requestAnimationFrame(this.redraw);var t=this.glplot,e=this.camera,r=e.mouseListener,n=1===this.lastButtonState&&0===r.buttons,i=this.fullLayout;this.lastButtonState=r.buttons,this.cameraChanged();var a,o=r.x*t.pixelRatio,s=this.canvas.height-t.pixelRatio*r.y;if(e.boxEnabled&&\"zoom\"===i.dragmode){this.selectBox.enabled=!0;for(var l=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])],c=0;c<2;c++)e.boxStart[c]===e.boxEnd[c]&&(l[c]=t.dataBox[c],l[c+2]=t.dataBox[c+2]);t.setDirty()}else if(!e.panning){this.selectBox.enabled=!1;var h=i._size,f=this.xaxis.domain,d=this.yaxis.domain,p=(a=t.pick(o/t.pixelRatio+h.l+f[0]*h.w,s/t.pixelRatio-(h.t+(1-d[1])*h.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 g=m.hoverinfo;if(\"all\"!==g){var v=g.split(\"+\");-1===v.indexOf(\"x\")&&(m.traceCoord[0]=void 0),-1===v.indexOf(\"y\")&&(m.traceCoord[1]=void 0),-1===v.indexOf(\"z\")&&(m.traceCoord[2]=void 0),-1===v.indexOf(\"text\")&&(m.textLabel=void 0),-1===v.indexOf(\"name\")&&(m.name=void 0)}u.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:m.color},{container:this.svgContainer})}}!a&&this.lastPickResult&&(this.spikes.update({}),this.lastPickResult=null,this.graphDiv.emit(\"plotly_unhover\"),u.loneUnhover(this.svgContainer)),t.draw()}},x.hoverFormatter=function(t,e){if(void 0!==e){var r=this[t];return l.tickText(r,r.c2l(e),\"hover\").text}}},{\"../../lib/html2unicode\":683,\"../../lib/show_no_webgl_msg\":701,\"../../plots/cartesian/axes\":724,\"../../plots/cartesian/constraints\":731,\"../../plots/cartesian/graph_interact\":733,\"../../registry\":802,\"./camera\":762,\"./convert\":763,\"gl-plot2d\":203,\"gl-select-box\":237,\"gl-spikes2d\":246,\"webgl-context\":543}],766:[function(t,e,r){\"use strict\";function n(t,e){t=t||document.body;var r=[.01,1/0];\"distanceLimits\"in(e=e||{})&&(r[0]=e.distanceLimits[0],r[1]=e.distanceLimits[1]),\"zoomMin\"in e&&(r[0]=e.zoomMin),\"zoomMax\"in e&&(r[1]=e.zoomMax);var n=a({center:e.center||[0,0,0],up:e.up||[0,1,0],eye:e.eye||[0,0,10],mode:e.mode||\"orbit\",distanceLimits:r}),l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0,c=t.clientWidth,h=t.clientHeight,f={keyBindingMode:\"rotate\",view:n,element:t,delay:e.delay||16,rotateSpeed:e.rotateSpeed||1,zoomSpeed:e.zoomSpeed||1,translateSpeed:e.translateSpeed||1,flipX:!!e.flipX,flipY:!!e.flipY,modes:n.modes,tick:function(){var e=i(),r=this.delay,a=e-2*r;n.idle(e-r),n.recalcMatrix(a),n.flush(e-(100+2*r));for(var o=!0,s=n.computedMatrix,f=0;f<16;++f)o=o&&l[f]===s[f],l[f]=s[f];var d=t.clientWidth===c&&t.clientHeight===h;return c=t.clientWidth,h=t.clientHeight,o?!d:(u=Math.exp(n.computedRadius[0]),!0)},lookAt:function(t,e,r){n.lookAt(n.lastT(),t,e,r)},rotate:function(t,e,r){n.rotate(n.lastT(),t,e,r)},pan:function(t,e,r){n.pan(n.lastT(),t,e,r)},translate:function(t,e,r){n.translate(n.lastT(),t,e,r)}};Object.defineProperties(f,{matrix:{get:function(){return n.computedMatrix},set:function(t){return n.setMatrix(n.lastT(),t),n.computedMatrix},enumerable:!0},mode:{get:function(){return n.getMode()},set:function(t){var e=n.computedUp.slice(),r=n.computedEye.slice(),a=n.computedCenter.slice();if(n.setMode(t),\"turntable\"===t){var o=i();n._active.lookAt(o,r,a,e),n._active.lookAt(o+500,r,a,[0,0,1]),n._active.flush(o)}return n.getMode()},enumerable:!0},center:{get:function(){return n.computedCenter},set:function(t){return n.lookAt(n.lastT(),null,t),n.computedCenter},enumerable:!0},eye:{get:function(){return n.computedEye},set:function(t){return n.lookAt(n.lastT(),t),n.computedEye},enumerable:!0},up:{get:function(){return n.computedUp},set:function(t){return n.lookAt(n.lastT(),null,null,t),n.computedUp},enumerable:!0},distance:{get:function(){return u},set:function(t){return n.setDistance(n.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return n.getDistanceLimits(r)},set:function(t){return n.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener(\"contextmenu\",function(t){return t.preventDefault(),!1});var d=0,p=0;return o(t,function(e,r,a,o){var s=f.keyBindingMode;if(!1!==s){var l=\"rotate\"===s,c=\"pan\"===s,h=\"zoom\"===s,m=!!o.control,g=!!o.alt,v=!!o.shift,y=!!(1&e),b=!!(2&e),x=!!(4&e),_=1/t.clientHeight,w=_*(r-d),M=_*(a-p),k=f.flipX?1:-1,A=f.flipY?1:-1,T=i(),S=Math.PI*f.rotateSpeed;if((l&&y&&!m&&!g&&!v||y&&!m&&!g&&v)&&n.rotate(T,k*S*w,-A*S*M,0),(c&&y&&!m&&!g&&!v||b||y&&m&&!g&&!v)&&n.pan(T,-f.translateSpeed*w*u,f.translateSpeed*M*u,0),h&&y&&!m&&!g&&!v||x||y&&!m&&g&&!v){var E=-f.zoomSpeed*M/window.innerHeight*(T-n.lastT())*100;n.pan(T,0,0,u*(Math.exp(E)-1))}return d=r,p=a,!0}}),s(t,function(t,e){if(!1!==f.keyBindingMode){var r=f.flipX?1:-1,a=f.flipY?1:-1,o=i();if(Math.abs(t)>Math.abs(e))n.rotate(o,0,0,-t*r*Math.PI*f.rotateSpeed/window.innerWidth);else{var s=-f.zoomSpeed*a*e/window.innerHeight*(o-n.lastT())/100;n.pan(o,0,0,u*(Math.exp(s)-1))}}},!0),f}e.exports=n;var i=t(\"right-now\"),a=t(\"3d-view\"),o=t(\"mouse-change\"),s=t(\"mouse-wheel\")},{\"3d-view\":33,\"mouse-change\":434,\"mouse-wheel\":437,\"right-now\":483}],767:[function(t,e,r){\"use strict\";var n=t(\"./scene\"),i=t(\"../plots\"),a=t(\"../../lib\"),o=t(\"../../constants/xmlns_namespaces\");r.name=\"gl3d\",r.attr=\"scene\",r.idRoot=\"scene\",r.idRegex=/^scene([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^scene([2-9]|[1-9][0-9]+)?$/,r.attributes=t(\"./layout/attributes\"),r.layoutAttributes=t(\"./layout/layout_attributes\"),r.supplyLayoutDefaults=t(\"./layout/defaults\"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,o=i.getSubplotIds(e,\"gl3d\"),s=0;s<o.length;s++){var l=o[s],u=i.getSubplotData(r,\"gl3d\",l),c=e[l],h=c._scene;h||(h=new n({id:l,graphDiv:t,container:t.querySelector(\".gl-container\"),staticPlot:t._context.staticPlot,plotGlPixelRatio:t._context.plotGlPixelRatio},e),c._scene=h),h.cameraInitial||(h.cameraInitial=a.extendDeep({},c.camera)),h.plot(u,e,t.layout)}},r.clean=function(t,e,r,n){for(var a=i.getSubplotIds(n,\"gl3d\"),o=0;o<a.length;o++){var s=a[o];!e[s]&&n[s]._scene&&n[s]._scene.destroy()}},r.toSVG=function(t){for(var e=t._fullLayout,r=i.getSubplotIds(e,\"gl3d\"),n=e._size,a=0;a<r.length;a++){var s=e[r[a]],l=s.domain,u=s._scene,c=u.toImage(\"png\");e._glimages.append(\"svg:image\").attr({xmlns:o.svg,\"xlink:href\":c,x:n.l+n.w*l.x[0],y:n.t+n.h*(1-l.y[1]),width:n.w*(l.x[1]-l.x[0]),height:n.h*(l.y[1]-l.y[0]),preserveAspectRatio:\"none\"}),u.destroy()}},r.cleanId=function(t){if(t.match(/^scene[0-9]*$/)){var e=t.substr(5);return\"1\"===e&&(e=\"\"),\"scene\"+e}}},{\"../../constants/xmlns_namespaces\":668,\"../../lib\":685,\"../plots\":787,\"./layout/attributes\":768,\"./layout/defaults\":772,\"./layout/layout_attributes\":773,\"./scene\":777}],768:[function(t,e,r){\"use strict\";e.exports={scene:{valType:\"subplotid\",dflt:\"scene\"}}},{}],769:[function(t,e,r){\"use strict\";var n=t(\"../../../components/color\"),i=t(\"../../cartesian/layout_attributes\"),a=t(\"../../../lib/extend\").extendFlat;e.exports={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,hoverformat:i.hoverformat,showline:i.showline,linecolor:i.linecolor,linewidth:i.linewidth,showgrid:i.showgrid,gridcolor:a({},i.gridcolor,{dflt:\"rgb(204, 204, 204)\"}),gridwidth:i.gridwidth,zeroline:i.zeroline,zerolinecolor:i.zerolinecolor,zerolinewidth:i.zerolinewidth}},{\"../../../components/color\":578,\"../../../lib/extend\":677,\"../../cartesian/layout_attributes\":735}],770:[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){function u(t,e){return i.coerce(c,h,a,t,e)}for(var c,h,f=0;f<l.length;f++){var d=l[f];c=t[d]||{},h=e[d]={_id:d[0]+r.scene,_name:d},o(c,h,u,r.data),s(c,h,u,{font:r.font,letter:d[0],data:r.data,showGrid:!0,bgColor:r.bgColor,calendar:r.calendar}),u(\"gridcolor\",n(h.color,r.bgColor,13600/187).toRgbString()),u(\"title\",d[0]),h.setScale=i.noop,u(\"showspikes\")&&(u(\"spikesides\"),u(\"spikethickness\"),u(\"spikecolor\",h.color)),u(\"showaxeslabels\"),u(\"showbackground\")&&u(\"backgroundcolor\")}}},{\"../../../lib\":685,\"../../cartesian/axis_defaults\":726,\"../../cartesian/type_defaults\":746,\"./axis_attributes\":769,tinycolor2:514}],771:[function(t,e,r){\"use strict\";function n(){this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.tickEnable=[!0,!0,!0],this.tickFont=[\"sans-serif\",\"sans-serif\",\"sans-serif\"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[18,18,18],this.labels=[\"x\",\"y\",\"z\"],this.labelEnable=[!0,!0,!0],this.labelFont=[\"Open Sans\",\"Open Sans\",\"Open Sans\"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[30,30,30],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[10,10,10],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!0,!0,!0],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._defaultTickPad=this.tickPad.slice(),this._defaultLabelPad=this.labelPad.slice(),this._defaultLineTickLength=this.lineTickLength.slice()}function i(t){var e=new n;return e.merge(t),e}var a=t(\"../../../lib/html2unicode\"),o=t(\"../../../lib/str2rgbarray\"),s=[\"xaxis\",\"yaxis\",\"zaxis\"];n.prototype.merge=function(t){for(var e=this,r=0;r<3;++r){var n=t[s[r]];n.visible?(e.labels[r]=a(n.title),\"titlefont\"in n&&(n.titlefont.color&&(e.labelColor[r]=o(n.titlefont.color)),n.titlefont.family&&(e.labelFont[r]=n.titlefont.family),n.titlefont.size&&(e.labelSize[r]=n.titlefont.size)),\"showline\"in n&&(e.lineEnable[r]=n.showline),\"linecolor\"in n&&(e.lineColor[r]=o(n.linecolor)),\"linewidth\"in n&&(e.lineWidth[r]=n.linewidth),\"showgrid\"in n&&(e.gridEnable[r]=n.showgrid),\"gridcolor\"in n&&(e.gridColor[r]=o(n.gridcolor)),\"gridwidth\"in n&&(e.gridWidth[r]=n.gridwidth),\"log\"===n.type?e.zeroEnable[r]=!1:\"zeroline\"in n&&(e.zeroEnable[r]=n.zeroline),\"zerolinecolor\"in n&&(e.zeroLineColor[r]=o(n.zerolinecolor)),\"zerolinewidth\"in n&&(e.zeroLineWidth[r]=n.zerolinewidth),\"ticks\"in n&&n.ticks?e.lineTickEnable[r]=!0:e.lineTickEnable[r]=!1,\"ticklen\"in n&&(e.lineTickLength[r]=e._defaultLineTickLength[r]=n.ticklen),\"tickcolor\"in n&&(e.lineTickColor[r]=o(n.tickcolor)),\"tickwidth\"in n&&(e.lineTickWidth[r]=n.tickwidth),\"tickangle\"in n&&(e.tickAngle[r]=\"auto\"===n.tickangle?0:Math.PI*-n.tickangle/180),\"showticklabels\"in n&&(e.tickEnable[r]=n.showticklabels),\"tickfont\"in n&&(n.tickfont.color&&(e.tickColor[r]=o(n.tickfont.color)),n.tickfont.family&&(e.tickFont[r]=n.tickfont.family),n.tickfont.size&&(e.tickSize[r]=n.tickfont.size)),\"mirror\"in n?-1!==[\"ticks\",\"all\",\"allticks\"].indexOf(n.mirror)?(e.lineTickMirror[r]=!0,e.lineMirror[r]=!0):!0===n.mirror?(e.lineTickMirror[r]=!1,e.lineMirror[r]=!0):(e.lineTickMirror[r]=!1,e.lineMirror[r]=!1):e.lineMirror[r]=!1,\"showbackground\"in n&&!1!==n.showbackground?(e.backgroundEnable[r]=!0,e.backgroundColor[r]=o(n.backgroundcolor)):e.backgroundEnable[r]=!1):(e.tickEnable[r]=!1,e.labelEnable[r]=!1,e.lineEnable[r]=!1,e.lineTickEnable[r]=!1,e.gridEnable[r]=!1,e.zeroEnable[r]=!1,e.backgroundEnable[r]=!1)}},e.exports=i},{\"../../../lib/html2unicode\":683,\"../../../lib/str2rgbarray\":703}],772:[function(t,e,r){\"use strict\";function n(t,e,r,n){for(var i=r(\"bgcolor\"),o=a.combine(i,n.paper_bgcolor),u=Object.keys(s.camera),c=0;c<u.length;c++)r(\"camera.\"+u[c]+\".x\"),r(\"camera.\"+u[c]+\".y\"),r(\"camera.\"+u[c]+\".z\");var h=!!r(\"aspectratio.x\")&&!!r(\"aspectratio.y\")&&!!r(\"aspectratio.z\"),f=r(\"aspectmode\",h?\"manual\":\"auto\");h||(t.aspectratio=e.aspectratio={x:1,y:1,z:1},\"manual\"===f&&(e.aspectmode=\"auto\")),l(t,e,{font:n.font,scene:n.id,data:n.fullData,bgColor:o,calendar:n.calendar}),r(\"dragmode\",n.getDfltFromLayout(\"dragmode\")),r(\"hovermode\",n.getDfltFromLayout(\"hovermode\"))}var i=t(\"../../../lib\"),a=t(\"../../../components/color\"),o=t(\"../../subplot_defaults\"),s=t(\"./layout_attributes\"),l=t(\"./axis_defaults\");e.exports=function(t,e,r){function a(e){if(!l)return i.validate(t[e],s[e])?t[e]:void 0}var l=e._basePlotModules.length>1;o(t,e,r,{type:\"gl3d\",attributes:s,handleDefaults:n,font:e.font,fullData:r,getDfltFromLayout:a,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{\"../../../components/color\":578,\"../../../lib\":685,\"../../subplot_defaults\":794,\"./axis_defaults\":770,\"./layout_attributes\":773}],773:[function(t,e,r){\"use strict\";function n(t,e,r){return{x:{valType:\"number\",dflt:t},y:{valType:\"number\",dflt:e},z:{valType:\"number\",dflt:r}}}var i=t(\"./axis_attributes\"),a=t(\"../../../lib/extend\").extendFlat;e.exports={bgcolor:{valType:\"color\",dflt:\"rgba(0,0,0,0)\"},camera:{up:a(n(0,0,1),{}),center:a(n(0,0,0),{}),eye:a(n(1.25,1.25,1.25),{})},domain:{x:{valType:\"info_array\",items:[{valType:\"number\",min:0,max:1},{valType:\"number\",min:0,max:1}],dflt:[0,1]},y:{valType:\"info_array\",items:[{valType:\"number\",min:0,max:1},{valType:\"number\",min:0,max:1}],dflt:[0,1]}},aspectmode:{valType:\"enumerated\",values:[\"auto\",\"cube\",\"data\",\"manual\"],dflt:\"auto\"},aspectratio:{x:{valType:\"number\",min:0},y:{valType:\"number\",min:0},z:{valType:\"number\",min:0}},xaxis:i,yaxis:i,zaxis:i,dragmode:{valType:\"enumerated\",values:[\"orbit\",\"turntable\",\"zoom\",\"pan\",!1],dflt:\"turntable\"},hovermode:{valType:\"enumerated\",values:[\"closest\",!1],dflt:\"closest\"},_deprecated:{cameraposition:{valType:\"info_array\"}}}},{\"../../../lib/extend\":677,\"./axis_attributes\":769}],774:[function(t,e,r){\"use strict\";function n(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}function i(t){var e=new n;return e.merge(t),e}var a=t(\"../../../lib/str2rgbarray\"),o=[\"xaxis\",\"yaxis\",\"zaxis\"];n.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[o[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=a(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=i},{\"../../../lib/str2rgbarray\":703}],775:[function(t,e,r){\"use strict\";function n(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;a<n.length;++a)i[a]=n[a].x;e[r]=i}return e}function i(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,i=t.fullSceneLayout,c=[[],[],[]],h=0;h<3;++h){var f=i[l[h]];if(f._length=(r[h].hi-r[h].lo)*r[h].pixelsPerDataUnit/t.dataScale[h],Math.abs(f._length)===1/0)c[h]=[];else{f.range[0]=r[h].lo/t.dataScale[h],f.range[1]=r[h].hi/t.dataScale[h],f._m=1/(t.dataScale[h]*r[h].pixelsPerDataUnit),f.range[0]===f.range[1]&&(f.range[0]-=1,f.range[1]+=1);var d=f.tickmode;if(\"auto\"===f.tickmode){f.tickmode=\"linear\";var p=f.nticks||o.constrain(f._length/40,4,9);a.autoTicks(f,Math.abs(f.range[1]-f.range[0])/p)}for(var m=a.calcTicks(f),g=0;g<m.length;++g)m[g].x=m[g].x*t.dataScale[h],m[g].text=s(m[g].text);c[h]=m,f.tickmode=d}}e.ticks=c;for(h=0;h<3;++h){u[h]=.5*(t.glplot.bounds[0][h]+t.glplot.bounds[1][h]);for(g=0;g<2;++g)e.bounds[g][h]=t.glplot.bounds[g][h]}t.contourLevels=n(c)}e.exports=i;var a=t(\"../../cartesian/axes\"),o=t(\"../../../lib\"),s=t(\"../../../lib/html2unicode\"),l=[\"xaxis\",\"yaxis\",\"zaxis\"],u=[0,0,0]},{\"../../../lib\":685,\"../../../lib/html2unicode\":683,\"../../cartesian/axes\":724}],776:[function(t,e,r){\"use strict\";function n(t,e){var r,n,i=[0,0,0,0];for(r=0;r<4;++r)for(n=0;n<4;++n)i[n]+=t[4*r+n]*e[r];return i}function i(t,e){return n(t.projection,n(t.view,n(t.model,[e[0],e[1],e[2],1])))}e.exports=i},{}],777:[function(t,e,r){\"use strict\";function n(t){function e(e,r){var n=t.fullSceneLayout[e];return m.tickText(n,n.d2l(r),\"hover\").text}var r,n=t.svgContainer,i=t.container.getBoundingClientRect(),a=i.width,o=i.height;n.setAttributeNS(null,\"viewBox\",\"0 0 \"+a+\" \"+o),n.setAttributeNS(null,\"width\",a),n.setAttributeNS(null,\"height\",o),M(t),t.glplot.axes.update(t.axesOptions);for(var s=Object.keys(t.traces),l=null,u=t.glplot.selection,c=0;c<s.length;++c)\"skip\"!==(r=t.traces[s[c]]).data.hoverinfo&&r.handlePick(u)&&(l=r),r.setContourLevels&&r.setContourLevels();var h;if(null!==l){var f=x(t.glplot.cameraParams,u.dataCoordinate),d=(r=l.data).hoverinfo,p=e(\"xaxis\",u.traceCoordinate[0]),v=e(\"yaxis\",u.traceCoordinate[1]),y=e(\"zaxis\",u.traceCoordinate[2]);if(\"all\"!==d){var b=d.split(\"+\");-1===b.indexOf(\"x\")&&(p=void 0),-1===b.indexOf(\"y\")&&(v=void 0),-1===b.indexOf(\"z\")&&(y=void 0),-1===b.indexOf(\"text\")&&(u.textLabel=void 0),-1===b.indexOf(\"name\")&&(l.name=void 0)}t.fullSceneLayout.hovermode&&g.loneHover({x:(.5+.5*f[0]/f[3])*a,y:(.5-.5*f[1]/f[3])*o,xLabel:p,yLabel:v,zLabel:y,text:u.textLabel,name:l.name,color:l.color},{container:n});var _={points:[{x:p,y:v,z:y,data:r._input,fullData:r,curveNumber:r.index,pointNumber:u.data.index}]};u.buttons&&u.distance<5?t.graphDiv.emit(\"plotly_click\",_):t.graphDiv.emit(\"plotly_hover\",_),h=_}else g.loneUnhover(n),t.graphDiv.emit(\"plotly_unhover\",h)}function i(t,e,r,i){var a={canvas:r,gl:i,container:t.container,axes:t.axesOptions,spikes:t.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1};if(t.staticMode){if(!(h||(c=document.createElement(\"canvas\"),h=d({canvas:c,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}))))throw new Error(\"error creating static canvas/context for image server\");a.pixelRatio=t.pixelRatio,a.gl=h,a.canvas=c}try{t.glplot=f(a)}catch(e){y(t)}var o=function(t){if(!1!==t.fullSceneLayout.dragmode){var e={};e[t.id]=u(t.camera),t.saveCamera(t.graphDiv.layout),t.graphDiv.emit(\"plotly_relayout\",e)}};if(t.glplot.canvas.addEventListener(\"mouseup\",o.bind(null,t)),t.glplot.canvas.addEventListener(\"wheel\",o.bind(null,t)),t.staticMode||t.glplot.canvas.addEventListener(\"webglcontextlost\",function(t){p.warn(\"Lost WebGL context.\"),t.preventDefault()}),!t.camera){var s=t.fullSceneLayout.camera;t.camera=b(t.container,{center:[s.center.x,s.center.y,s.center.z],eye:[s.eye.x,s.eye.y,s.eye.z],up:[s.up.x,s.up.y,s.up.z],zoomMin:.1,zoomMax:100,mode:\"orbit\"})}return t.glplot.camera=t.camera,t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=n.bind(null,t),t.traces={},!0}function a(t,e){var r=document.createElement(\"div\"),n=t.container;this.graphDiv=t.graphDiv;var a=document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\");a.style.position=\"absolute\",a.style.top=a.style.left=\"0px\",a.style.width=a.style.height=\"100%\",a.style[\"z-index\"]=20,a.style[\"pointer-events\"]=\"none\",r.appendChild(a),this.svgContainer=a,r.id=t.id,r.style.position=\"absolute\",r.style.top=r.style.left=\"0px\",r.style.width=r.style.height=\"100%\",n.appendChild(r),this.fullLayout=e,this.id=t.id||\"scene\",this.fullSceneLayout=e[this.id],this.plotArgs=[[],{},{}],this.axesOptions=_(e[this.id]),this.spikeOptions=w(e[this.id]),this.container=r,this.staticMode=!!t.staticPlot,this.pixelRatio=t.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],i(this,e)}function o(t,e,r,n,i){for(var a,o=0;o<e.length;++o)if(Array.isArray(e[o]))for(var s=0;s<e[o].length;++s)a=t.d2l(e[o][s],0,i),!isNaN(a)&&isFinite(a)&&(n[0][r]=Math.min(n[0][r],a),n[1][r]=Math.max(n[1][r],a));else a=t.d2l(e[o],0,i),!isNaN(a)&&isFinite(a)&&(n[0][r]=Math.min(n[0][r],a),n[1][r]=Math.max(n[1][r],a))}function s(t,e,r){var n=t.fullSceneLayout;o(n.xaxis,e.x,0,r,e.xcalendar),o(n.yaxis,e.y,1,r,e.ycalendar),o(n.zaxis,e.z,2,r,e.zcalendar)}function l(t){return[[t.eye.x,t.eye.y,t.eye.z],[t.center.x,t.center.y,t.center.z],[t.up.x,t.up.y,t.up.z]]}function u(t){return{up:{x:t.up[0],y:t.up[1],z:t.up[2]},center:{x:t.center[0],y:t.center[1],z:t.center[2]},eye:{x:t.eye[0],y:t.eye[1],z:t.eye[2]}}}var c,h,f=t(\"gl-plot3d\"),d=t(\"webgl-context\"),p=t(\"../../lib\"),m=t(\"../../plots/cartesian/axes\"),g=t(\"../../plots/cartesian/graph_interact\"),v=t(\"../../lib/str2rgbarray\"),y=t(\"../../lib/show_no_webgl_msg\"),b=t(\"./camera\"),x=t(\"./project\"),_=t(\"./layout/convert\"),w=t(\"./layout/spikes\"),M=t(\"./layout/tick_marks\"),k=a.prototype;k.recoverContext=function(){function t(){r.isContextLost()?requestAnimationFrame(t):i(e,e.fullLayout,n,r)?e.plot.apply(e,e.plotArgs):p.error(\"Catastrophic and unrecoverable WebGL error. Context lost.\")}var e=this,r=this.glplot.gl,n=this.glplot.canvas;this.glplot.dispose(),requestAnimationFrame(t)};var A=[\"xaxis\",\"yaxis\",\"zaxis\"];k.plot=function(t,e,r){if(this.plotArgs=[t,e,r],!this.glplot.contextLost){var n,i,a,o,l,u,c=e[this.id],h=r[this.id];c.bgcolor?this.glplot.clearColor=v(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(l),t?Array.isArray(t)||(t=[t]):t=[];var f=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(a=0;a<t.length;++a)!0===(n=t[a]).visible&&s(this,n,f);var d=[1,1,1];for(o=0;o<3;++o)f[0][o]>f[1][o]?d[o]=1:f[1][o]===f[0][o]?d[o]=1:d[o]=1/(f[1][o]-f[0][o]);for(this.dataScale=d,a=0;a<t.length;++a)!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]],g=[],y={};for(a=0;a<3;++a){if(l=c[A[a]],u=l.type,u in y?(y[u].acc*=d[a],y[u].count+=1):y[u]={acc:d[a],count:1},l.autorange){for(m[0][a]=1/0,m[1][a]=-1/0,o=0;o<this.glplot.objects.length;++o){var b=this.glplot.objects[o].bounds;m[0][a]=Math.min(m[0][a],b[0][a]/d[a]),m[1][a]=Math.max(m[1][a],b[1][a]/d[a])}if(\"rangemode\"in l&&\"tozero\"===l.rangemode&&(m[0][a]=Math.min(m[0][a],0),m[1][a]=Math.max(m[1][a],0)),m[0][a]>m[1][a])m[0][a]=-1,m[1][a]=1;else{var x=m[1][a]-m[0][a];m[0][a]-=x/32,m[1][a]+=x/32}}else{var _=c[A[a]].range;m[0][a]=_[0],m[1][a]=_[1]}m[0][a]===m[1][a]&&(m[0][a]-=1,m[1][a]+=1),g[a]=m[1][a]-m[0][a],this.glplot.bounds[0][a]=m[0][a]*d[a],this.glplot.bounds[1][a]=m[1][a]*d[a]}var w=[1,1,1];for(a=0;a<3;++a){var M=y[u=(l=c[A[a]]).type];w[a]=Math.pow(M.acc,1/M.count)/d[a]}var k;if(\"auto\"===c.aspectmode)k=Math.max.apply(null,w)/Math.min.apply(null,w)<=4?w:[1,1,1];else if(\"cube\"===c.aspectmode)k=[1,1,1];else if(\"data\"===c.aspectmode)k=w;else{if(\"manual\"!==c.aspectmode)throw new Error(\"scene.js aspectRatio was not one of the enumerated types\");var T=c.aspectratio;k=[T.x,T.y,T.z]}c.aspectratio.x=h.aspectratio.x=k[0],c.aspectratio.y=h.aspectratio.y=k[1],c.aspectratio.z=h.aspectratio.z=k[2],this.glplot.aspect=k;var S=c.domain||null,E=e._size||null;if(S&&E){var L=this.container.style;L.position=\"absolute\",L.left=E.l+S.x[0]*E.w+\"px\",L.top=E.t+(1-S.y[1])*E.h+\"px\",L.width=E.w*(S.x[1]-S.x[0])+\"px\",L.height=E.h*(S.y[1]-S.y[0])+\"px\"}this.glplot.redraw()}},k.destroy=function(){this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null},k.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),u(this.glplot.camera)},k.setCamera=function(t){this.glplot.camera.lookAt.apply(this,l(t))},k.saveCamera=function(t){var e=this.getCamera(),r=p.nestedProperty(t,this.id+\".camera\"),n=r.get(),i=!1;if(void 0===n)i=!0;else for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!function(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]]}(e,n,a,o)){i=!0;break}return i&&r.set(e),i},k.updateFx=function(t,e){var r=this.camera;r&&(\"orbit\"===t?(r.mode=\"orbit\",r.keyBindingMode=\"rotate\"):\"turntable\"===t?(r.up=[0,0,1],r.mode=\"turntable\",r.keyBindingMode=\"rotate\"):r.keyBindingMode=t),this.fullSceneLayout.hovermode=e},k.toImage=function(t){t||(t=\"png\"),this.staticMode&&this.container.appendChild(c),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var a=0,o=n-1;a<o;++a,--o)for(var s=0;s<r;++s)for(var l=0;l<4;++l){var u=i[4*(r*a+s)+l];i[4*(r*a+s)+l]=i[4*(r*o+s)+l],i[4*(r*o+s)+l]=u}var h=document.createElement(\"canvas\");h.width=r,h.height=n;var f=h.getContext(\"2d\"),d=f.createImageData(r,n);d.data.set(i),f.putImageData(d,0,0);var p;switch(t){case\"jpeg\":p=h.toDataURL(\"image/jpeg\");break;case\"webp\":p=h.toDataURL(\"image/webp\");break;default:p=h.toDataURL(\"image/png\")}return this.staticMode&&this.container.removeChild(c),p},k.setConvert=function(){for(var t=0;t<3;++t){var e=this.fullSceneLayout[A[t]];m.setConvert(e,this.fullLayout),e.setScale=p.noop}},e.exports=a},{\"../../lib\":685,\"../../lib/show_no_webgl_msg\":701,\"../../lib/str2rgbarray\":703,\"../../plots/cartesian/axes\":724,\"../../plots/cartesian/graph_interact\":733,\"./camera\":766,\"./layout/convert\":771,\"./layout/spikes\":774,\"./layout/tick_marks\":775,\"./project\":776,\"gl-plot3d\":205,\"webgl-context\":543}],778:[function(t,e,r){\"use strict\";var n=t(\"../lib\").extendFlat,i=t(\"./font_attributes\"),a=t(\"../components/color/attributes\");e.exports={font:{family:n({},i.family,{dflt:'\"Open Sans\", verdana, arial, sans-serif'}),size:n({},i.size,{dflt:12}),color:n({},i.color,{dflt:a.defaultLine})},title:{valType:\"string\",dflt:\"Click to enter Plot title\"},titlefont:n({},i,{}),autosize:{valType:\"boolean\",dflt:!1},width:{valType:\"number\",min:10,dflt:700},height:{valType:\"number\",min:10,dflt:450},margin:{l:{valType:\"number\",min:0,dflt:80},r:{valType:\"number\",min:0,dflt:80},t:{valType:\"number\",min:0,dflt:100},b:{valType:\"number\",min:0,dflt:80},pad:{valType:\"number\",min:0,dflt:0},autoexpand:{valType:\"boolean\",dflt:!0}},paper_bgcolor:{valType:\"color\",dflt:a.background},plot_bgcolor:{valType:\"color\",dflt:a.background},separators:{valType:\"string\",dflt:\".,\"},hidesources:{valType:\"boolean\",dflt:!1},smith:{valType:\"enumerated\",values:[!1],dflt:!1},showlegend:{valType:\"boolean\"},dragmode:{valType:\"enumerated\",values:[\"zoom\",\"pan\",\"select\",\"lasso\",\"orbit\",\"turntable\"],dflt:\"zoom\"},hovermode:{valType:\"enumerated\",values:[\"x\",\"y\",\"closest\",!1]}}},{\"../components/color/attributes\":577,\"../lib\":685,\"./font_attributes\":748}],779:[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.\"}},{}],780:[function(t,e,r){\"use strict\";var n=t(\"../../lib\");e.exports=function(t,e){var r=t.split(\" \"),i=r[0],a=r[1],o=Array.isArray(e)?n.mean(e):e,s=.5+o/100,l=1.5+o/100,u=[\"\",\"\"],c=[0,0];switch(i){case\"top\":u[0]=\"top\",c[1]=-l;break;case\"bottom\":u[0]=\"bottom\",c[1]=l}switch(a){case\"left\":u[1]=\"right\",c[0]=-s;break;case\"right\":u[1]=\"left\",c[0]=s}var h;return h=u[0]&&u[1]?u.join(\"-\"):u[0]?u[0]:u[1]?u[1]:\"center\",{anchor:h,offset:c}}},{\"../../lib\":685}],781:[function(t,e,r){\"use strict\";function n(t,e){var r=t._fullLayout,n=t._context;if(\"\"===n.mapboxAccessToken)return\"\";for(var i=n.mapboxAccessToken,a=0;a<e.length;a++){var o=r[e[a]];if(o.accesstoken){i=o.accesstoken;break}}if(!i)throw new Error(l.noAccessTokenErrorMsg);return i}var i=t(\"mapbox-gl\"),a=t(\"../plots\"),o=t(\"../../constants/xmlns_namespaces\"),s=t(\"./mapbox\"),l=t(\"./constants\");r.name=\"mapbox\",r.attr=\"subplot\",r.idRoot=\"mapbox\",r.idRegex=/^mapbox([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^mapbox([2-9]|[1-9][0-9]+)?$/,r.attributes={subplot:{valType:\"subplotid\",dflt:\"mapbox\"}},r.layoutAttributes=t(\"./layout_attributes\"),r.supplyLayoutDefaults=t(\"./layout_defaults\"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,o=a.getSubplotIds(e,\"mapbox\"),l=n(t,o);i.accessToken=l;for(var u=0;u<o.length;u++){var c=o[u],h=a.getSubplotCalcData(r,\"mapbox\",c),f=e[c],d=f._subplot;f.accesstoken=l,d||(d=s({gd:t,container:e._glcontainer.node(),id:c,fullLayout:e,staticPlot:t._context.staticPlot}),e[c]._subplot=d),d.plot(h,e,t._promises)}},r.clean=function(t,e,r,n){for(var i=a.getSubplotIds(n,\"mapbox\"),o=0;o<i.length;o++){var s=i[o];!e[s]&&n[s]._subplot&&n[s]._subplot.destroy()}},r.toSVG=function(t){for(var e=t._fullLayout,r=a.getSubplotIds(e,\"mapbox\"),n=e._size,i=0;i<r.length;i++){var s=e[r[i]],l=s.domain,u=s._subplot,c=u.toImage(\"png\");e._glimages.append(\"svg:image\").attr({xmlns:o.svg,\"xlink:href\":c,x:n.l+n.w*l.x[0],y:n.t+n.h*(1-l.y[1]),width:n.w*(l.x[1]-l.x[0]),height:n.h*(l.y[1]-l.y[0]),preserveAspectRatio:\"none\"}),u.destroy()}}},{\"../../constants/xmlns_namespaces\":668,\"../plots\":787,\"./constants\":779,\"./layout_attributes\":783,\"./layout_defaults\":784,\"./mapbox\":785,\"mapbox-gl\":325}],782:[function(t,e,r){\"use strict\";function n(t,e){this.mapbox=t,this.map=t.map,this.uid=t.uid+\"-layer\"+e,this.idSource=this.uid+\"-source\",this.idLayer=this.uid+\"-layer\",this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}function i(t){var e=t.source;return s.isPlainObject(e)||\"string\"==typeof e&&e.length>0}function a(t){var e={},r={};switch(t.type){case\"circle\":s.extendFlat(r,{\"circle-radius\":t.circle.radius,\"circle-color\":t.color,\"circle-opacity\":t.opacity});break;case\"line\":s.extendFlat(r,{\"line-width\":t.line.width,\"line-color\":t.color,\"line-opacity\":t.opacity});break;case\"fill\":s.extendFlat(r,{\"fill-color\":t.color,\"fill-outline-color\":t.fill.outlinecolor,\"fill-opacity\":t.opacity});break;case\"symbol\":var n=t.symbol,i=l(n.textposition,n.iconsize);s.extendFlat(e,{\"icon-image\":n.icon+\"-15\",\"icon-size\":n.iconsize/10,\"text-field\":n.text,\"text-size\":n.textfont.size,\"text-anchor\":i.anchor,\"text-offset\":i.offset}),s.extendFlat(r,{\"icon-color\":t.color,\"text-color\":n.textfont.color,\"text-opacity\":t.opacity})}return{layout:e,paint:r}}function o(t){var e,r=t.sourcetype,n=t.source,i={type:r},a=\"string\"==typeof n;return\"geojson\"===r?e=\"data\":\"vector\"===r&&(e=a?\"url\":\"tiles\"),i[e]=n,i}var s=t(\"../../lib\"),l=t(\"./convert_text_opts\"),u=n.prototype;u.update=function(t){this.visible?this.needsNewSource(t)?(this.updateLayer(t),this.updateSource(t)):this.needsNewLayer(t)&&this.updateLayer(t):(this.updateSource(t),this.updateLayer(t)),this.updateStyle(t),this.visible=i(t)},u.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},u.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==t.below},u.updateSource=function(t){var e=this.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,i(t)){var r=o(t);e.addSource(this.idSource,r)}},u.updateLayer=function(t){var e=this.map;if(e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),this.layerType=t.type,i(t)){e.addLayer({id:this.idLayer,source:this.idSource,\"source-layer\":t.sourcelayer||\"\",type:t.type},t.below);var r={visibility:\"visible\"};this.mapbox.setOptions(this.idLayer,\"setLayoutProperty\",r)}},u.updateStyle=function(t){var e=a(t);i(t)&&(this.mapbox.setOptions(this.idLayer,\"setLayoutProperty\",e.layout),this.mapbox.setOptions(this.idLayer,\"setPaintProperty\",e.paint))},u.dispose=function(){var t=this.map;t.removeLayer(this.idLayer),t.removeSource(this.idSource)},e.exports=function(t,e,r){var i=new n(t,e);return i.update(r),i}},{\"../../lib\":685,\"./convert_text_opts\":780}],783:[function(t,e,r){\"use strict\";var n=t(\"../../lib\"),i=t(\"../../components/color\").defaultLine,a=t(\"../font_attributes\"),o=t(\"../../traces/scatter/attributes\").textposition;e.exports={_arrayAttrRegexps:[/^mapbox([2-9]|[1-9][0-9]+)?\\.layers/],domain:{x:{valType:\"info_array\",items:[{valType:\"number\",min:0,max:1},{valType:\"number\",min:0,max:1}],dflt:[0,1]},y:{valType:\"info_array\",items:[{valType:\"number\",min:0,max:1},{valType:\"number\",min:0,max:1}],dflt:[0,1]}},accesstoken:{valType:\"string\",noBlank:!0,strict:!0},style:{valType:\"any\",values:[\"basic\",\"streets\",\"outdoors\",\"light\",\"dark\",\"satellite\",\"satellite-streets\"],dflt:\"basic\"},center:{lon:{valType:\"number\",dflt:0},lat:{valType:\"number\",dflt:0}},zoom:{valType:\"number\",dflt:1},bearing:{valType:\"number\",dflt:0},pitch:{valType:\"number\",dflt:0},layers:{_isLinkedToArray:\"layer\",sourcetype:{valType:\"enumerated\",values:[\"geojson\",\"vector\"],dflt:\"geojson\"},source:{valType:\"any\"},sourcelayer:{valType:\"string\",dflt:\"\"},type:{valType:\"enumerated\",values:[\"circle\",\"line\",\"fill\",\"symbol\"],dflt:\"circle\"},below:{valType:\"string\",dflt:\"\"},color:{valType:\"color\",dflt:i},opacity:{valType:\"number\",min:0,max:1,dflt:1},circle:{radius:{valType:\"number\",dflt:15}},line:{width:{valType:\"number\",dflt:2}},fill:{outlinecolor:{valType:\"color\",dflt:i}},symbol:{icon:{valType:\"string\",dflt:\"marker\"},iconsize:{valType:\"number\",dflt:10},text:{valType:\"string\",dflt:\"\"},textfont:n.extendDeep({},a,{family:{dflt:\"Open Sans Regular, Arial Unicode MS Regular\"}}),textposition:n.extendFlat({},o,{arrayOk:!1})}}}},{\"../../components/color\":578,\"../../lib\":685,\"../../traces/scatter/attributes\":976,\"../font_attributes\":748}],784:[function(t,e,r){\"use strict\";function n(t,e,r){r(\"accesstoken\"),r(\"style\"),r(\"center.lon\"),r(\"center.lat\"),r(\"zoom\"),r(\"bearing\"),r(\"pitch\"),i(t,e),e._input=t}function i(t,e){function r(t,e){return a.coerce(n,i,s.layers,t,e)}for(var n,i,o=t.layers||[],l=e.layers=[],u=0;u<o.length;u++)if(n=o[u],i={},a.isPlainObject(n)){var c=r(\"sourcetype\");r(\"source\"),\"vector\"===c&&r(\"sourcelayer\");var h=r(\"type\");r(\"below\"),r(\"color\"),r(\"opacity\"),\"circle\"===h&&r(\"circle.radius\"),\"line\"===h&&r(\"line.width\"),\"fill\"===h&&r(\"fill.outlinecolor\"),\"symbol\"===h&&(r(\"symbol.icon\"),r(\"symbol.iconsize\"),r(\"symbol.text\"),a.coerceFont(r,\"symbol.textfont\"),r(\"symbol.textposition\")),i._index=u,l.push(i)}}var a=t(\"../../lib\"),o=t(\"../subplot_defaults\"),s=t(\"./layout_attributes\");e.exports=function(t,e,r){o(t,e,r,{type:\"mapbox\",attributes:s,handleDefaults:n,partition:\"y\"})}},{\"../../lib\":685,\"../subplot_defaults\":794,\"./layout_attributes\":783}],785:[function(t,e,r){\"use strict\";function n(t){this.id=t.id,this.gd=t.gd,this.container=t.container,this.isStatic=t.staticPlot;var e=t.fullLayout;this.uid=e._uid+\"-\"+this.id,this.opts=e[this.id],this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(e),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[]}function i(t){var e=h.style.values,r=h.style.dflt,n={};return u.isPlainObject(t)?(n.id=t.id,n.style=t):\"string\"==typeof t?(n.id=t,n.style=-1!==e.indexOf(t)?a(t):t):(n.id=r,n.style=a(r)),n}function a(t){return c.styleUrlPrefix+t+\"-\"+c.styleUrlSuffix}function o(t){return[t.lon,t.lat]}var s=t(\"mapbox-gl\"),l=t(\"../cartesian/graph_interact\"),u=t(\"../../lib\"),c=t(\"./constants\"),h=t(\"./layout_attributes\"),f=t(\"./layers\"),d=n.prototype;e.exports=function(t){return new n(t)},d.plot=function(t,e,r){var n=this,i=n.opts=e[this.id];n.map&&i.accesstoken!==n.accessToken&&(n.map.remove(),n.map=null,n.styleObj=null,n.traceHash=[],n.layerList={});var a;a=n.map?new Promise(function(r,i){n.updateMap(t,e,r,i)}):new Promise(function(r,i){n.createMap(t,e,r,i)}),r.push(a)},d.createMap=function(t,e,r,n){function a(){l.loneUnhover(e._toppaper)}var h=this,f=h.gd,d=h.opts,p=h.styleObj=i(d.style);h.accessToken=d.accesstoken;var m=h.map=new s.Map({container:h.div,style:p.style,center:o(d.center),zoom:d.zoom,bearing:d.bearing,pitch:d.pitch,interactive:!h.isStatic,preserveDrawingBuffer:h.isStatic}),g=c.controlContainerClassName,v=h.div.getElementsByClassName(g)[0];h.div.removeChild(v),m._canvas.canvas.style.left=\"0px\",m._canvas.canvas.style.top=\"0px\",h.rejectOnError(n),m.once(\"load\",function(){h.updateData(t),h.updateLayout(e),h.resolveOnRender(r)}),m.on(\"moveend\",function(t){if(h.map){var e=h.getView();if(d._input.center=d.center=e.center,d._input.zoom=d.zoom=e.zoom,d._input.bearing=d.bearing=e.bearing,d._input.pitch=d.pitch=e.pitch,t.originalEvent){var r={};r[h.id]=u.extendFlat({},e),f.emit(\"plotly_relayout\",r)}}}),m.on(\"mousemove\",function(t){var e=h.div.getBoundingClientRect();t.clientX=t.point.x+e.left,t.clientY=t.point.y+e.top,t.target.getBoundingClientRect=function(){return e},h.xaxis.p2c=function(){return t.lngLat.lng},h.yaxis.p2c=function(){return t.lngLat.lat},l.hover(f,t,h.id)}),m.on(\"click\",function(t){l.click(f,t.originalEvent)}),m.on(\"dragstart\",a),m.on(\"zoomstart\",a)},d.updateMap=function(t,e,r,n){var a=this,o=a.map;a.rejectOnError(n);var s=i(a.opts.style);a.styleObj.id!==s.id?(a.styleObj=s,o.setStyle(s.style),o.style.once(\"load\",function(){a.traceHash={},a.updateData(t),a.updateLayout(e),a.resolveOnRender(r)})):(a.updateData(t),a.updateLayout(e),a.resolveOnRender(r))},d.updateData=function(t){var e,r,n,i,a=this.traceHash;for(n=0;n<t.length;n++){var o=t[n];(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(r=t[i][0].trace,l===r.uid)continue t;(e=a[l]).dispose(),delete a[l]}},d.updateLayout=function(t){var e=this.map,r=this.opts;e.setCenter(o(r.center)),e.setZoom(r.zoom),e.setBearing(r.bearing),e.setPitch(r.pitch),this.updateLayers(),this.updateFramework(t),this.map.resize()},d.resolveOnRender=function(t){var e=this.map;e.on(\"render\",function r(){e.loaded()&&(e.off(\"render\",r),t())})},d.rejectOnError=function(t){function e(){t(new Error(c.mapOnErrorMsg))}var r=this.map;r.once(\"error\",e),r.once(\"style.error\",e),r.once(\"source.error\",e),r.once(\"tile.error\",e),r.once(\"layer.error\",e)},d.createFramework=function(t){var e=this,r=e.div=document.createElement(\"div\");r.id=e.uid,r.style.position=\"absolute\",e.container.appendChild(r),e.xaxis={_id:\"x\",c2p:function(t){return e.project(t).x}},e.yaxis={_id:\"y\",c2p:function(t){return e.project(t).y}},e.updateFramework(t)},d.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+\"px\",n.height=r.h*(e.y[1]-e.y[0])+\"px\",n.left=r.l+e.x[0]*r.w+\"px\",n.top=r.t+(1-e.y[1])*r.h+\"px\",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},d.updateLayers=function(){var t,e=this.opts.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(f(this,t,e[t]))}else for(t=0;t<e.length;t++)r[t].update(e[t])},d.destroy=function(){this.map&&(this.map.remove(),this.map=null),this.container.removeChild(this.div)},d.toImage=function(){return this.map.getCanvas().toDataURL()},d.initSource=function(t){var e={type:\"geojson\",data:{type:\"Feature\",geometry:{type:\"Point\",coordinates:[]}}};return this.map.addSource(t,e)},d.setSourceData=function(t,e){this.map.getSource(t).setData(e)},d.setOptions=function(t,e,r){for(var n=this.map,i=Object.keys(r),a=0;a<i.length;a++){var o=i[a];n[e](t,o,r[o])}},d.project=function(t){return this.map.project(new s.LngLat(t[0],t[1]))},d.getView=function(){var t=this.map,e=t.getCenter();return{center:{lon:e.lng,lat:e.lat},zoom:t.getZoom(),bearing:t.getBearing(),pitch:t.getPitch()}}},{\"../../lib\":685,\"../cartesian/graph_interact\":733,\"./constants\":779,\"./layers\":782,\"./layout_attributes\":783,\"mapbox-gl\":325}],786:[function(t,e,r){\"use strict\";e.exports={t:{valType:\"number\",dflt:0},r:{valType:\"number\",dflt:0},b:{valType:\"number\",dflt:0},l:{valType:\"number\",dflt:0}}},{}],787:[function(t,e,r){\"use strict\";function n(t,e){e.text(\"\");var r=e.append(\"a\").attr({\"xlink:xlink:href\":\"#\",class:\"link--impt link--embedview\",\"font-weight\":\"bold\"}).text(t._context.linkText+\" \"+String.fromCharCode(187));if(t._context.sendData)r.on(\"click\",function(){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})}}function i(t,e,r,n){for(var i=t.transforms,a=[t],o=0;o<i.length;o++){var s=i[o],l=y[s.type];l&&l.transform&&(a=l.transform(a,{transform:s,fullTrace:t,fullData:e,layout:r,fullLayout:n,transformIndex:o}))}return a}function a(t){var e,r={left:0,right:0,bottom:0,top:0};if(t)for(e in t)t.hasOwnProperty(e)&&(r.left+=t[e].left||0,r.right+=t[e].right||0,r.bottom+=t[e].bottom||0,r.top+=t[e].top||0);return r}var o=t(\"d3\"),s=t(\"fast-isnumeric\"),l=t(\"../plotly\"),u=t(\"../registry\"),c=t(\"../lib\"),h=t(\"../components/color\"),f=t(\"../constants/numerical\").BADNUM,d=e.exports={},p=t(\"./animation_attributes\"),m=t(\"./frame_attributes\"),g=c.relinkPrivateKeys;c.extendFlat(d,u),d.attributes=t(\"./attributes\"),d.attributes.type.values=d.allTypes,d.fontAttrs=t(\"./font_attributes\"),d.layoutAttributes=t(\"./layout_attributes\"),d.fontWeight=\"normal\";var v=d.subplotsRegistry,y=d.transformsRegistry,b=t(\"../components/errorbars\"),x=t(\"./command\");d.executeAPICommand=x.executeAPICommand,d.computeAPICommandBindings=x.computeAPICommandBindings,d.manageCommandObserver=x.manageCommandObserver,d.hasSimpleAPICommandBindings=x.hasSimpleAPICommandBindings,d.findSubplotIds=function(t,e){var r=[];if(!d.subplotsRegistry[e])return r;for(var n=d.subplotsRegistry[e].attr,i=0;i<t.length;i++){var a=t[i];d.traceIs(a,e)&&-1===r.indexOf(a[n])&&r.push(a[n])}return r},d.getSubplotIds=function(t,e){var r=d.subplotsRegistry[e];if(!r)return[];if(!(\"cartesian\"!==e||t._has&&t._has(\"cartesian\")))return[];if(!(\"gl2d\"!==e||t._has&&t._has(\"gl2d\")))return[];if(\"cartesian\"===e||\"gl2d\"===e)return Object.keys(t._plots||{});for(var n=r.idRegex,i=Object.keys(t),a=[],o=0;o<i.length;o++){var s=i[o];n.test(s)&&a.push(s)}var l=r.idRoot.length;return a.sort(function(t,e){return+(t.substr(l)||1)-+(e.substr(l)||1)}),a},d.getSubplotData=function(t,e,r){if(!d.subplotsRegistry[e])return[];for(var n,i=d.subplotsRegistry[e].attr,a=[],o=0;o<t.length;o++)if(n=t[o],\"gl2d\"===e&&d.traceIs(n,\"gl2d\")){var s=l.Axes.subplotMatch,u=\"x\"+r.match(s)[1],c=\"y\"+r.match(s)[2];n[i[0]]===u&&n[i[1]]===c&&a.push(n)}else n[i]===r&&a.push(n);return a},d.getSubplotCalcData=function(t,e,r){if(!d.subplotsRegistry[e])return[];for(var n=d.subplotsRegistry[e].attr,i=[],a=0;a<t.length;a++){var o=t[a];o[0].trace[n]===r&&i.push(o)}return i},d.redrawText=function(t){if(!(t.data&&t.data[0]&&t.data[0].r))return new Promise(function(e){setTimeout(function(){u.getComponentMethod(\"annotations\",\"draw\")(t),u.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 new Promise(function(e,r){t&&\"none\"!==o.select(t).style(\"display\")||r(new Error(\"Resize must be passed a plot div element.\")),t._redrawTimer&&clearTimeout(t._redrawTimer),t._redrawTimer=setTimeout(function(){if(t.layout.width&&t.layout.height)e(t);else{delete t.layout.width,delete t.layout.height;var r=t.changed;t.autoplay=!0,l.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:h.defaultLine,\"pointer-events\":\"all\"}).each(function(){var t=o.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 s=r.select(\".js-link-to-tool\"),l=r.select(\".js-link-spacer\"),u=r.select(\".js-sourcelinks\");t._context.showSources&&t._context.showSources(t),t._context.showLink&&n(t,s),l.text(s.text()&&u.text()?\" - \":\"\")}},d.sendDataToCloud=function(t){t.emit(\"plotly_beforeexport\");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||\"https://plot.ly\",r=o.select(t).append(\"div\").attr(\"id\",\"hiddenform\").style(\"display\",\"none\"),n=r.append(\"form\").attr({action:e+\"/external\",method:\"post\",target:\"_blank\"});return n.append(\"input\").attr({type:\"text\",name:\"data\"}).node().value=d.graphJson(t,!1,\"keepdata\"),n.node().submit(),r.remove(),t.emit(\"plotly_afterexport\"),!1},d.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},i=t.layout||{},a=t._fullData||[],o=t._fullData=[],s=t.data||[];if(t._transitionData||d.createTransitionData(t),r._initialAutoSizeIsDone){var u=r.width,c=r.height;d.supplyLayoutGlobalDefaults(i,n),i.width||(n.width=u),i.height||(n.height=c)}else{d.supplyLayoutGlobalDefaults(i,n);var h=!i.width||!i.height,f=n.autosize,p=t._context&&t._context.autosizable;h&&(f||p)?d.plotAutoSize(t,i,n):h&&d.sanitizeMargins(t),!f&&h&&(i.width=n.width,i.height=n.height)}n._initialAutoSizeIsDone=!0,n._dataLength=s.length,n._globalTransforms=(t._context||{}).globalTransforms,d.supplyDataDefaults(s,o,i,n),n._has=d._hasPlotType.bind(n);var m=n._modules;for(e=0;e<m.length;e++){var v=m[e];v.cleanData&&v.cleanData(o)}if(a.length===s.length)for(e=0;e<o.length;e++)g(o[e],a[e]);d.supplyLayoutModuleDefaults(i,n,o,t._transitionData),n._hasCartesian=n._has(\"cartesian\"),n._hasGeo=n._has(\"geo\"),n._hasGL3D=n._has(\"gl3d\"),n._hasGL2D=n._has(\"gl2d\"),n._hasTernary=n._has(\"ternary\"),n._hasPie=n._has(\"pie\"),d.cleanPlot(o,n,a,r),d.linkSubplots(o,n,a,r),g(n,r),d.doAutoMargin(t);var y=l.Axes.list(t);for(e=0;e<y.length;e++)y[e].setScale();if((t.calcdata||[]).length===o.length)for(e=0;e<o.length;e++){var b=o[e];(t.calcdata[e][0]||{}).trace=b}},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){for(var e=this._basePlotModules||[],r=0;r<e.length;r++)if(e[r].name===t)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,u=!!n._infolayer;t:for(i=0;i<r.length;i++){var c=r[i].uid;for(a=0;a<t.length;a++)if(c===t[a].uid)continue t;var h=\".hm\"+c+\",.contour\"+c+\",.carpet\"+c+\",#clip\"+c+\",.trace\"+c;l&&n._paper.selectAll(h).remove(),u&&(n._infolayer.selectAll(\".cb\"+c).remove(),n._infolayer.selectAll(\"g.rangeslider-container\").selectAll(h).remove())}},d.linkSubplots=function(t,e,r,n){for(var i=n._plots||{},a=e._plots={},o={_fullData:t,_fullLayout:e},s=l.Axes.getSubplots(o),u=0;u<s.length;u++){var c,h=s[u],f=i[h];f?(c=a[h]=f)._scene2d&&c._scene2d.updateRefs(e):(c=a[h]={}).id=h,c.xaxis=l.Axes.getFromId(o,h,\"x\"),c.yaxis=l.Axes.getFromId(o,h,\"y\")}},d.supplyDataDefaults=function(t,e,r,n){function a(t){e.push(t);var r=t._module;r&&(c.pushUnique(h,r),c.pushUnique(f,t._module.basePlotModule),p++)}var o,s,l,h=n._modules=[],f=n._basePlotModules=[],p=0;n._transformModules=[];var m={},g=[];for(o=0;o<t.length;o++){if(l=t[o],s=d.supplyTraceDefaults(l,p,n,o),s.index=o,s._input=l,s._expandedIndex=p,s.transforms&&s.transforms.length)for(var v=i(s,e,r,n),y=0;y<v.length;y++){var b=v[y],x=d.supplyTraceDefaults(b,p,n,o);b.uid=x.uid=s.uid+y,x.index=o,x._input=l,x._fullInput=s,x._expandedIndex=p,x._expandedInput=b,a(x)}else s._fullInput=s,s._expandedInput=s,a(s);u.traceIs(s,\"carpetAxis\")&&(m[s.carpet]=s),u.traceIs(s,\"carpetDependent\")&&g.push(o)}for(o=0;o<g.length;o++)if((s=e[g[o]]).visible){var _=m[s.carpet];s._carpet=_,_&&_.visible?(s.xaxis=_.xaxis,s.yaxis=_.yaxis):s.visible=!1}},d.supplyAnimationDefaults=function(t){function e(e,r){return c.coerce(t||{},n,p,e,r)}t=t||{};var r,n={};if(e(\"mode\"),e(\"direction\"),e(\"fromcurrent\"),Array.isArray(t.frame))for(n.frame=[],r=0;r<t.frame.length;r++)n.frame[r]=d.supplyAnimationFrameDefaults(t.frame[r]||{});else n.frame=d.supplyAnimationFrameDefaults(t.frame||{});if(Array.isArray(t.transition))for(n.transition=[],r=0;r<t.transition.length;r++)n.transition[r]=d.supplyAnimationTransitionDefaults(t.transition[r]||{});else n.transition=d.supplyAnimationTransitionDefaults(t.transition||{});return n},d.supplyAnimationFrameDefaults=function(t){function e(e,n){return c.coerce(t||{},r,p.frame,e,n)}var r={};return e(\"duration\"),e(\"redraw\"),r},d.supplyAnimationTransitionDefaults=function(t){function e(e,n){return c.coerce(t||{},r,p.transition,e,n)}var r={};return e(\"duration\"),e(\"easing\"),r},d.supplyFrameDefaults=function(t){function e(e,n){return c.coerce(t,r,m,e,n)}var r={};return e(\"group\"),e(\"name\"),e(\"traces\"),e(\"baseframe\"),e(\"data\"),e(\"layout\"),r},d.supplyTraceDefaults=function(t,e,r,n){function i(e,r){return c.coerce(t,o,d.attributes,e,r)}function a(e,r){if(d.traceIs(o,e))return c.coerce(t,o,d.subplotsRegistry[e].attributes,r)}var o={},s=h.defaults[e%h.defaults.length],l=i(\"visible\");i(\"type\"),i(\"uid\"),i(\"name\",\"trace \"+n);for(var u=Object.keys(v),f=0;f<u.length;f++){var p=u[f];if(-1===[\"cartesian\",\"gl2d\"].indexOf(p)){var m=v[p].attr;m&&a(p,m)}}if(l){var g=d.getModule(o);o._module=g,i(\"hoverinfo\",1===r._dataLength?\"x+y+z+text\":void 0),d.traceIs(o,\"showLegend\")&&(i(\"showlegend\"),i(\"legendgroup\")),g&&g.supplyDefaults(t,o,s,r),d.traceIs(o,\"noOpacity\")||i(\"opacity\"),a(\"cartesian\",\"xaxis\"),a(\"cartesian\",\"yaxis\"),a(\"gl2d\",\"xaxis\"),a(\"gl2d\",\"yaxis\"),d.traceIs(o,\"notLegendIsolatable\")&&(o.visible=!!o.visible),d.supplyTransformDefaults(t,o,r)}return 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,h=o[l],f=h.type,d=y[f];d||c.warn(\"Unrecognized transform type \"+f+\".\"),d&&d.supplyDefaults?((u=d.supplyDefaults(h,e,r,t)).type=f,u._module=d,c.pushUnique(i,d)):u=c.extendFlat({},h),s.push(u)}},d.supplyLayoutGlobalDefaults=function(t,e){function r(r,n){return c.coerce(t,e,d.layoutAttributes,r,n)}var n=c.coerceFont(r,\"font\");r(\"title\"),c.coerceFont(r,\"titlefont\",{family:n.family,size:Math.round(1.4*n.size),color:n.color}),r(\"autosize\",!(t.width&&t.height)),r(\"width\"),r(\"height\"),r(\"margin.l\"),r(\"margin.r\"),r(\"margin.t\"),r(\"margin.b\"),r(\"margin.pad\"),r(\"margin.autoexpand\"),t.width&&t.height&&d.sanitizeMargins(e),r(\"paper_bgcolor\"),r(\"separators\"),r(\"hidesources\"),r(\"smith\"),u.getComponentMethod(\"calendars\",\"handleDefaults\")(t,e,\"calendar\")},d.plotAutoSize=function(t,e,r){var n,i,o=t._context||{},l=o.frameMargins,u=c.isPlotDiv(t);if(u&&t.emit(\"plotly_autosize\"),o.fillFrame)n=window.innerWidth,i=window.innerHeight,document.body.style.overflow=\"hidden\";else if(s(l)&&l>0){var h=a(t._boundingBoxMargins),f=h.left+h.right,p=h.bottom+h.top,m=1-2*l,g=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(m*(g.width-f)),i=Math.round(m*(g.height-p))}else{var v=u?window.getComputedStyle(t):{};n=parseFloat(v.width)||r.width,i=parseFloat(v.height)||r.height}var y=d.layoutAttributes.width.min,b=d.layoutAttributes.height.min;n<y&&(n=y),i<b&&(i=b);var x=!e.width&&Math.abs(r.width-n)>1,_=!e.height&&Math.abs(r.height-i)>1;(_||x)&&(x&&(r.width=n),_&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),d.sanitizeMargins(r)},d.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a;l.Axes.supplyLayoutDefaults(t,e,r);var o=e._basePlotModules;for(i=0;i<o.length;i++)\"cartesian\"!==(a=o[i]).name&&a.supplyLayoutDefaults&&a.supplyLayoutDefaults(t,e,r);var s=e._modules;for(i=0;i<s.length;i++)(a=s[i]).supplyLayoutDefaults&&a.supplyLayoutDefaults(t,e,r);var c=e._transformModules;for(i=0;i<c.length;i++)(a=c[i]).supplyLayoutDefaults&&a.supplyLayoutDefaults(t,e,r,n);l.Fx.supplyLayoutDefaults(t,e,r);var h=Object.keys(u.componentsRegistry);for(i=0;i<h.length;i++)(a=u.componentsRegistry[h[i]]).supplyLayoutDefaults&&a.supplyLayoutDefaults(t,e,r)},d.purge=function(t){var e=t._fullLayout||{};void 0!==e._glcontainer&&e._glcontainer.remove(),void 0!==e._geocontainer&&e._geocontainer.remove(),e._modeBar&&e._modeBar.destroy(),t._transitionData&&(t._transitionData._interruptCallbacks&&(t._transitionData._interruptCallbacks.length=0),t._transitionData._animationRaf&&window.cancelAnimationFrame(t._transitionData._animationRaf)),delete t.data,delete t.layout,delete t._fullData,delete t._fullLayout,delete t.calcdata,delete t.framework,delete t.empty,delete t.fid,delete t.undoqueue,delete t.undonum,delete t.autoplay,delete t.changed,delete t._tester,delete t._testref,delete t._promises,delete t._redrawTimer,delete t.firstscatter,delete t.hmlumcount,delete t.hmpixcount,delete t.numboxes,delete t._hoverTimer,delete t._lastHoverTime,delete t._transitionData,delete t._transitioning,delete t._initialAutoSize,t.removeAllListeners&&t.removeAllListeners()},d.style=function(t){for(var e=t._fullLayout._modules,r=0;r<e.length;r++){var n=e[r];n.style&&n.style(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),i=Math.max(e.margin.l||0,0),a=Math.max(e.margin.r||0,0),o=Math.max(e.margin.t||0,0),u=Math.max(e.margin.b||0,0),c=e._pushmargin;if(!1!==e.margin.autoexpand){c.base={l:{val:0,size:i},r:{val:1,size:a},t:{val:1,size:o},b:{val:0,size:u}};for(var h=Object.keys(c),f=0;f<h.length;f++)for(var d=h[f],p=c[d].l||{},m=c[d].b||{},g=p.val,v=p.size,y=m.val,b=m.size,x=0;x<h.length;x++){var _=h[x];if(s(v)&&c[_].r){var w=c[_].r.val,M=c[_].r.size;if(w>g){var k=(v*w+(M-e.width)*g)/(w-g),A=(M*(1-g)+(v-e.width)*(1-w))/(w-g);k>=0&&A>=0&&k+A>i+a&&(i=k,a=A)}}if(s(b)&&c[_].t){var T=c[_].t.val,S=c[_].t.size;if(T>y){var E=(b*T+(S-e.height)*y)/(T-y),L=(S*(1-y)+(b-e.height)*(1-T))/(T-y);E>=0&&L>=0&&E+L>u+o&&(u=E,o=L)}}}}if(r.l=Math.round(i),r.r=Math.round(a),r.t=Math.round(o),r.b=Math.round(u),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 l.plot(t)},d.graphJson=function(t,e,r,n,i){function a(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]=a(t[e])}return i}return Array.isArray(t)?t.map(a):c.isJSDate(t)?c.ms2DateTimeLocal(+t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&d.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames,u={data:(o||[]).map(function(t){var r=a(t);return e&&delete r.fit,r})};return e||(u.layout=a(s)),t.framework&&t.framework.isPolar&&(u=t.framework.getConfig()),l&&(u.frames=a(l)),\"object\"===n?u:JSON.stringify(u)},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],u=[s.name];s.baseframe&&(s=o[s.baseframe.toString()])&&-1===u.indexOf(s.name);)l.push(s),u.push(s.name);for(var c={};s=l.pop();)if(s.layout&&(c.layout=d.extendLayout(c.layout,s.layout)),s.data){if(c.data||(c.data=[]),!(n=s.traces))for(n=[],r=0;r<s.data.length;r++)n[r]=r;for(c.traces||(c.traces=[]),r=0;r<s.data.length;r++)void 0!==(i=n[r])&&null!==i&&(-1===(a=c.traces.indexOf(i))&&(a=c.data.length,c.traces[a]=i),c.data[a]=d.extendTrace(c.data[a],s.data[r]))}return c},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,h,f=c.extendDeepNoArrays({},e||{}),p=c.expandObjectPaths(f),m={};if(r&&r.length)for(a=0;a<r.length;a++)void 0===(i=(n=c.nestedProperty(p,r[a])).get())?c.nestedProperty(m,r[a]).set(null):(n.set(null),c.nestedProperty(m,r[a]).set(i));if(t=c.extendDeepNoArrays(t||{},p),r&&r.length)for(a=0;a<r.length;a++)if(s=c.nestedProperty(m,r[a]),u=s.get()){for(h=(l=c.nestedProperty(t,r[a])).get(),Array.isArray(h)||(h=[],l.set(h)),o=0;o<u.length;o++){var g=u[o];h[o]=null===g?null:d.extendObjectWithContainers(h[o],g)}l.set(h)}return t},d.dataArrayContainers=[\"transforms\"],d.layoutArrayContainers=u.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,a){function o(){var n;for(n=0;n<y.length;n++){var i=y[n],a=t._fullData[i]._module;a&&(a.animatable&&x.push(i),t.data[y[n]]=d.extendTrace(t.data[y[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),d.supplyDefaults(t),d.doCalcdata(t),b.calc(t),Promise.resolve()}function s(t){var e=Promise.resolve();if(!t)return e;for(;t.length;)e=e.then(t.shift());return e}function u(t){if(t)for(;t.length;)t.shift()}function h(){return t.emit(\"plotly_transitioning\",[]),new Promise(function(e){function n(){return u++,function(){h++,_||h!==u||f(e)}}t._transitioning=!0,a.duration>0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){_=!0}),i.redraw&&t._transitionData._interruptCallbacks.push(function(){return l.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit(\"plotly_transitioninterrupted\",[])});var o,s,u=0,h=0,d=t._fullLayout._basePlotModules,p=!1;if(r)for(s=0;s<d.length;s++)if(d[s].transitionAxes){var m=c.expandObjectPaths(r);p=d[s].transitionAxes(t,m,a,n)||p}for(p?(o=c.extendFlat({},a)).duration=0:o=a,s=0;s<d.length;s++)d[s].plot(t,x,o,n);setTimeout(n())})}function f(e){if(t._transitionData)return u(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(i.redraw)return l.redraw(t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit(\"plotly_transitioned\",[])}).then(e)}function p(){if(t._transitionData)return t._transitioning=!1,s(t._transitionData._interruptCallbacks)}var m,g,v=Array.isArray(e)?e.length:0,y=n.slice(0,v),x=[],_=!1;for(m=0;m<y.length;m++){g=y[m];var w=t._fullData[g]._module;if(w&&!w.animatable){var M={};for(var k in e[m])M[k]=[e[m][k]]}}var A=[d.previousPromises,p,o,d.rehover,h],T=c.syncOrAsync(A,t);return T&&T.then||(T=Promise.resolve()),T.then(function(){return t})},d.doCalcdata=function(t,e){var r,n,i,a,o=l.Axes.list(t),s=t._fullData,c=t._fullLayout,h=!1,d=new Array(s.length),p=(t.calcdata||[]).slice(0);for(t.calcdata=d,t.firstscatter=!0,t.numboxes=0,t._hmpixcount=0,t._hmlumcount=0,c._piecolormap={},c._piedefaultcolorcount=0,i=0;i<o.length;i++){for(o[i]._categories=o[i]._initialCategories.slice(),o[i]._categoriesMap={},a=0;a<o[i]._categories.length;a++)o[i]._categoriesMap[o[i]._categories[a]]=a;\"category\"===o[i].type&&(h=!0)}for(i=0;i<s.length;i++)Array.isArray(e)&&-1===e.indexOf(i)&&(d[i]=p[i]);var m=!1;for(i=0;i<s.length;i++)if(!0===(r=s[i]).visible&&r.transforms)for((n=r._module)&&n.calc&&n.calc(t,r),a=0;a<r.transforms.length;a++){var g=r.transforms[a];(n=y[g.type])&&n.calcTransform&&(m=!0,n.calcTransform(t,r,g))}if(m)for(i=0;i<o.length;i++)o[i]._min=[],o[i]._max=[],o[i]._categories=[],o[i]._categoriesMap={};for(i=0;i<s.length;i++){var v=[];!0===(r=s[i]).visible&&(n=r._module)&&n.calc&&(v=n.calc(t,r)),Array.isArray(v)&&v[0]||(v=[{x:f,y:f}]),v[0].t||(v[0].t={}),v[0].trace=r,d[i]=v}if(h){var b=[\"annotations\",\"shapes\",\"images\"];for(i=0;i<b.length;i++)u.getComponentMethod(b[i],\"supplyLayoutDefaults\")(t.layout,c,s)}},d.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},d.generalUpdatePerTraceModule=function(t,e,r){var n,i=t.traceHash,a={};for(n=0;n<e.length;n++){var o=e[n],s=o[0].trace;s.visible&&(a[s.type]=a[s.type]||[],a[s.type].push(o))}var l=Object.keys(i),u=Object.keys(a);for(n=0;n<l.length;n++){var c=l[n];if(-1===u.indexOf(c)){var h=i[c][0];h[0].trace.visible=!1,a[c]=[h]}}for(u=Object.keys(a),n=0;n<u.length;n++){var f=a[u[n]];f[0][0].trace._module.plot(t,function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];!0===n[0].trace.visible&&e.push(n)}return e}(f),r)}t.traceHash=a}},{\"../components/color\":578,\"../components/errorbars\":608,\"../constants/numerical\":666,\"../lib\":685,\"../plotly\":719,\"../registry\":802,\"./animation_attributes\":720,\"./attributes\":722,\"./command\":747,\"./font_attributes\":748,\"./frame_attributes\":749,\"./layout_attributes\":778,d3:107,\"fast-isnumeric\":116}],788:[function(t,e,r){\"use strict\";var n=t(\"../../traces/scatter/attributes\"),i=n.marker;e.exports={r:n.r,t:n.t,marker:{color:i.color,size:i.size,symbol:i.symbol,opacity:i.opacity}}},{\"../../traces/scatter/attributes\":976}],789:[function(t,e,r){\"use strict\";function n(t,e){return a({},e,{showline:{valType:\"boolean\"},showticklabels:{valType:\"boolean\"},tickorientation:{valType:\"enumerated\",values:[\"horizontal\",\"vertical\"]},ticklen:{valType:\"number\",min:0},tickcolor:{valType:\"color\"},ticksuffix:{valType:\"string\"},endpadding:{valType:\"number\"},visible:{valType:\"boolean\"}})}var i=t(\"../cartesian/layout_attributes\"),a=t(\"../../lib/extend\").extendFlat,o=a({},i.domain,{});e.exports={radialaxis:n(\"radial\",{range:{valType:\"info_array\",items:[{valType:\"number\"},{valType:\"number\"}]},domain:o,orientation:{valType:\"number\"}}),angularaxis:n(\"angular\",{range:{valType:\"info_array\",items:[{valType:\"number\",dflt:0},{valType:\"number\",dflt:360}]},domain:o}),layout:{direction:{valType:\"enumerated\",values:[\"clockwise\",\"counterclockwise\"]},orientation:{valType:\"angle\"}}}},{\"../../lib/extend\":677,\"../cartesian/layout_attributes\":735}],790:[function(t,e,r){\"use strict\";(e.exports=t(\"./micropolar\")).manager=t(\"./micropolar_manager\")},{\"./micropolar\":791,\"./micropolar_manager\":792}],791:[function(t,e,r){var n=t(\"d3\"),i=t(\"../../lib\").extendDeepAll,a=e.exports={version:\"0.2.2\"};a.Axis=function(){function t(t){r=t||r;var u=l.data,h=l.layout;return(\"string\"==typeof r||r.nodeName)&&(r=n.select(r)),r.datum(u).each(function(t,r){function l(t,e){return s(t)%360+h.orientation}var u=t.slice();c={data:a.util.cloneJson(u),layout:a.util.cloneJson(h)};var f=0;u.forEach(function(t,e){t.color||(t.color=h.defaultColorRange[f],f=(f+1)%h.defaultColorRange.length),t.strokeColor||(t.strokeColor=\"LinePlot\"===t.geometry?t.color:n.rgb(t.color).darker().toString()),c.data[e].color=t.color,c.data[e].strokeColor=t.strokeColor,c.data[e].strokeDash=t.strokeDash,c.data[e].strokeSize=t.strokeSize});var d=u.filter(function(t,e){var r=t.visible;return void 0===r||!0===r}),p=!1,m=d.map(function(t,e){return p=p||void 0!==t.groupId,t});if(p){var g=[],v=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],g.push(r),r=a.util.sumArrays(t.r,r)}),t.values});d=n.merge(v)}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(a.util.sumArrays(a.util.arrayLast(d).r[0],a.util.arrayLast(g)))]:n.extent(a.util.flattenArray(d.map(function(t,e){return t.r}))),h.radialAxis.domain!=a.DATAEXTENT&&(b[0]=0),o=n.scale.linear().domain(h.radialAxis.domain!=a.DATAEXTENT&&h.radialAxis.domain?h.radialAxis.domain:b).range([0,y]),c.layout.radialAxis.domain=o.domain();var _,w=a.util.flattenArray(d.map(function(t,e){return t.t})),M=\"string\"==typeof w[0];M&&(w=a.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!=a.DATAEXTENT&&!M&&h.angularAxis.domain[0]>=0?h.angularAxis.domain:n.extent(w),S=Math.abs(w[1]-w[0]);k&&!M&&(S=0);var E=T.slice();A&&M&&(E[1]+=S);var L=h.angularAxis.ticksCount||4;L>8&&(L=L/(L/8)+L%8),h.angularAxis.ticksStep&&(L=(E[1]-E[0])/L);var C=h.angularAxis.ticksStep||(E[1]-E[0])/(L*(h.minorTicks+1));_&&(C=Math.max(Math.round(C),1)),E[2]||(E[2]=C);var z=n.range.apply(this,E);if(z=z.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=n.scale.linear().domain(E.slice(0,2)).range(\"clockwise\"===h.direction?[0,360]:[360,0]),c.layout.angularAxis.domain=s.domain(),c.layout.angularAxis.endPadding=A?S:0,void 0===(e=n.select(this).select(\"svg.chart-root\"))||e.empty()){var D=(new DOMParser).parseFromString(\"<svg xmlns='http://www.w3.org/2000/svg' class='chart-root'>' + '<g class='outer-group'>' + '<g class='chart-group'>' + '<circle class='background-circle'></circle>' + '<g class='geometry-group'></g>' + '<g class='radial axis-group'>' + '<circle class='outside-circle'></circle>' + '</g>' + '<g class='angular axis-group'></g>' + '<g class='guides-group'><line></line><circle r='0'></circle></g>' + '</g>' + '<g class='legend-group'></g>' + '<g class='tooltips-group'></g>' + '<g class='title-group'><text></text></g>' + '</g>' + '</svg>\",\"application/xml\"),I=this.appendChild(this.ownerDocument.importNode(D.documentElement,!0));e=n.select(I)}e.select(\".guides-group\").style({\"pointer-events\":\"none\"}),e.select(\".angular.axis-group\").style({\"pointer-events\":\"none\"}),e.select(\".radial.axis-group\").style({\"pointer-events\":\"none\"});var P,O=e.select(\".chart-group\"),j={fill:\"none\",stroke:h.tickColor},R={\"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){P=e.select(\".legend-group\").attr({transform:\"translate(\"+[y,h.margin.top]+\")\"}).style({display:\"block\"});var F=d.map(function(t,e){var r=a.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});a.Legend().config({data:d.map(function(t,e){return t.name||\"Element\"+e}),legendConfig:i({},a.Legend.defaultConfig().legendConfig,{container:P,elements:F,reverseOrder:h.legend.reverseOrder})})();var N;try{N=P.node().getBBox()}catch(t){N={width:100,height:10}}y=Math.min(h.width-N.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],o.range([0,y]),c.layout.radialAxis.domain=o.domain(),P.attr(\"transform\",\"translate(\"+[x[0]+y,x[1]-y]+\")\")}else P=e.select(\".legend-group\").style({display:\"none\"});e.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),O.attr(\"transform\",\"translate(\"+x+\")\").style({cursor:\"crosshair\"});var B=[(h.width-(h.margin.left+h.margin.right+2*y+(N?N.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]),e.select(\".outer-group\").attr(\"transform\",\"translate(\"+B+\")\"),h.title){var U=e.select(\"g.title-group text\").style(R).text(h.title),V=U.node().getBBox();U.attr({x:x[0]-V.width/2,y:x[1]-y-20})}var H=e.select(\".radial.axis-group\");if(h.radialAxis.gridLinesVisible){var q=H.selectAll(\"circle.grid-circle\").data(o.ticks(5));q.enter().append(\"circle\").attr({class:\"grid-circle\"}).style(j),q.attr(\"r\",o),q.exit().remove()}H.select(\"circle.outside-circle\").attr({r:y}).style(j);var G=e.select(\"circle.background-circle\").attr({r:y}).style({fill:h.backgroundColor,stroke:h.stroke});if(h.radialAxis.visible){var Y=n.svg.axis().scale(o).ticks(5).tickSize(5);H.call(Y).attr({transform:\"rotate(\"+h.radialAxis.orientation+\")\"}),H.selectAll(\".domain\").style(j),H.selectAll(\"g>text\").text(function(t,e){return this.textContent+h.radialAxis.ticksSuffix}).style(R).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,R[\"font-size\"]]+\")\":\"translate(\"+[0,R[\"font-size\"]]+\")\"}}),H.selectAll(\"g>line\").style({stroke:\"black\"})}var W=e.select(\".angular.axis-group\").selectAll(\"g.angular-tick\").data(z),X=W.enter().append(\"g\").classed(\"angular-tick\",!0);W.attr({transform:function(t,e){return\"rotate(\"+l(t,e)+\")\"}}).style({display:h.angularAxis.visible?\"block\":\"none\"}),W.exit().remove(),X.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(j),X.selectAll(\".minor\").style({stroke:h.minorTickColor}),W.select(\"line.grid-line\").attr({x1:h.tickLength?y-h.tickLength:0,x2:y}).style({display:h.angularAxis.gridLinesVisible?\"block\":\"none\"}),X.append(\"text\").classed(\"axis-text\",!0).style(R);var Z=W.select(\"text.axis-text\").attr({x:y+h.labelOffset,dy:\".35em\",transform:function(t,e){var r=l(t,e),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(R);h.angularAxis.rewriteTicks&&Z.text(function(t,e){return e%(h.minorTicks+1)!=0?\"\":h.angularAxis.rewriteTicks(this.textContent,e)});var J=n.max(O.selectAll(\".angular-tick text\")[0].map(function(t,e){try{return t.getCTM().e+t.getBBox().width}catch(t){return 50}}));P.attr({transform:\"translate(\"+[y+J,h.margin.top]+\")\"});var Q=e.select(\"g.geometry-group\").selectAll(\"g\").size()>0,K=e.select(\"g.geometry-group\").selectAll(\"g.geometry\").data(d);if(K.enter().append(\"g\").attr({class:function(t,e){return\"geometry geometry\"+e}}),K.exit().remove(),d[0]||Q){var $=[];d.forEach(function(t,e){var r={};r.radialScale=o,r.angularScale=s,r.container=K.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=h.orientation,r.direction=h.direction,r.index=e,$.push({data:t,geometryConfig:r})});var tt=[];n.nest().key(function(t,e){return void 0!==t.data.groupId||\"unstacked\"}).entries($).forEach(function(t,e){\"unstacked\"===t.key?tt=tt.concat(t.values.map(function(t,e){return[t]})):tt.push(t.values)}),tt.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(a[r].defaultConfig(),t)});a[r]().config(n)()})}var et,rt,nt=e.select(\".guides-group\"),it=e.select(\".tooltips-group\"),at=a.tooltipPanel().config({container:it,fontSize:8})(),ot=a.tooltipPanel().config({container:it,fontSize:8})(),st=a.tooltipPanel().config({container:it,hasTick:!0})();if(!M){var lt=nt.select(\"line\").attr({x1:0,y1:0,y2:0}).style({stroke:\"grey\",\"pointer-events\":\"none\"});O.on(\"mousemove.angular-guide\",function(t,e){var r=a.util.getMousePos(G).angle;lt.attr({x2:-y,transform:\"rotate(\"+r+\")\"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;et=s.invert(n);var i=a.util.convertToCartesian(y+12,r+180);at.text(a.util.round(et)).move([i[0]+x[0],i[1]+x[1]])}).on(\"mouseout.angular-guide\",function(t,e){nt.select(\"line\").style({opacity:0})})}var ut=nt.select(\"circle\").style({stroke:\"grey\",fill:\"none\"});O.on(\"mousemove.radial-guide\",function(t,e){var r=a.util.getMousePos(G).radius;ut.attr({r:r}).style({opacity:.5}),rt=o.invert(a.util.getMousePos(G).radius);var n=a.util.convertToCartesian(r,h.radialAxis.orientation);ot.text(a.util.round(rt)).move([n[0]+x[0],n[1]+x[1]])}).on(\"mouseout.radial-guide\",function(t,e){ut.style({opacity:0}),st.hide(),at.hide(),ot.hide()}),e.selectAll(\".geometry-group .mark\").on(\"mouseover.tooltip\",function(t,r){var i=n.select(this),o=i.style(\"fill\"),s=\"black\",l=i.style(\"opacity\")||1;if(i.attr({\"data-opacity\":l}),\"none\"!=o){i.attr({\"data-fill\":o}),s=n.hsl(o).darker().toString(),i.style({fill:s,opacity:1});var u={t:a.util.round(t[0],5),r:a.util.round(t[1],5)};M&&(u.t=_[t[0]]);var c=\"r: \"+u.r+\", t: \"+u.t,h=this.getBoundingClientRect(),f=e.node().getBoundingClientRect(),d=[h.left+h.width/2-B[0]-f.left,h.top+h.height/2-B[1]-f.top];st.config({color:s}).text(c),st.move(d)}else o=i.style(\"stroke\"),i.attr({\"data-stroke\":o}),s=n.hsl(o).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\")&&st.show()}).on(\"mouseout.tooltip\",function(t,e){st.hide();var r=n.select(this),i=r.attr(\"data-fill\");i?r.style({fill:i,opacity:r.attr(\"data-opacity\")}):r.style({stroke:r.attr(\"data-stroke\"),opacity:r.attr(\"data-opacity\")})})}),f}var e,r,o,s,l={data:[],layout:{}},u={},c={},h=n.dispatch(\"hover\"),f={};return f.render=function(e){return t(e),this},f.config=function(t){if(!arguments.length)return l;var e=a.util.cloneJson(t);return e.data.forEach(function(t,e){l.data[e]||(l.data[e]={}),i(l.data[e],a.Axis.defaultConfig().data[0]),i(l.data[e],t)}),i(l.layout,a.Axis.defaultConfig().layout),i(l.layout,e.layout),this},f.getLiveConfig=function(){return c},f.getinputConfig=function(){return u},f.radialScale=function(t){return o},f.angularScale=function(t){return s},f.svg=function(){return e},n.rebind(f,h,\"on\"),f},a.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}}},a.util={},a.DATAEXTENT=\"dataExtent\",a.AREA=\"AreaChart\",a.LINE=\"LinePlot\",a.DOT=\"DotPlot\",a.BAR=\"BarChart\",a.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},a.util._extend=function(t,e){for(var r in t)e[r]=t[r]},a.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},a.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)]})},a.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},a.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]})},a.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=a.util.ensureArray(t[e],r)}),t},a.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},a.util.validateKeys=function(t,e){\"string\"==typeof e&&(e=e.split(\".\"));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},a.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},a.util.arrayLast=function(t){return t[t.length-1]},a.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},a.util.flattenArray=function(t){for(var e=[];!a.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},a.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},a.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},a.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},a.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},a.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},a.util.duplicates=function(t){return Object.keys(a.util.duplicatesCount(t))},a.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))},a.PolyChart=function(){function t(){var t=e[0].geometryConfig,r=t.container;\"string\"==typeof r&&(r=n.select(r)),r.datum(e).each(function(e,r){function i(e,r){return{r:t.radialScale(e[1]),t:(t.angularScale(e[0])+t.orientation)*Math.PI/180}}function a(t){return{x:t.r*Math.cos(t.t),y:t.r*Math.sin(t.t)}}var s=!!e[0].data.yStack,l=e.map(function(t,e){return s?n.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):n.zip(t.data.t[0],t.data.r[0])}),u=t.angularScale,c=t.radialScale.domain()[0],h={};h.bar=function(r,i,a){var o=e[a].data,s=t.radialScale(r[1])-t.radialScale(0),l=t.radialScale(r[2]||0),c=o.barWidth;n.select(this).attr({class:\"mark bar\",d:\"M\"+[[s+l,-c/2],[s+l,c/2],[l,c/2],[l,-c/2]].join(\"L\")+\"Z\",transform:function(e,r){return\"rotate(\"+(t.orientation+u(e[0]))+\")\"}})},h.dot=function(t,r,o){var s=t[2]?[t[0],t[1]+t[2]]:t,l=n.svg.symbol().size(e[o].data.dotSize).type(e[o].data.dotType)(t,r);n.select(this).attr({class:\"mark dot\",d:l,transform:function(t,e){var r=a(i(s));return\"translate(\"+[r.x,r.y]+\")\"}})};var f=n.svg.line.radial().interpolate(e[0].data.lineInterpolation).radius(function(e){return t.radialScale(e[1])}).angle(function(e){return t.angularScale(e[0])*Math.PI/180});h.line=function(r,i,a){var o=r[2]?l[a].map(function(t,e){return[t[0],t[1]+t[2]]}):l[a];if(n.select(this).each(h.dot).style({opacity:function(t,r){return+e[a].data.dotVisible},fill:g.stroke(r,i,a)}).attr({class:\"mark dot\"}),!(i>0)){var s=n.select(this.parentNode).selectAll(\"path.line\").data([0]);s.enter().insert(\"path\"),s.attr({class:\"line\",d:f(o),transform:function(e,r){return\"rotate(\"+(t.orientation+90)+\")\"},\"pointer-events\":\"none\"}).style({fill:function(t,e){return g.fill(r,i,a)},\"fill-opacity\":0,stroke:function(t,e){return g.stroke(r,i,a)},\"stroke-width\":function(t,e){return g[\"stroke-width\"](r,i,a)},\"stroke-dasharray\":function(t,e){return g[\"stroke-dasharray\"](r,i,a)},opacity:function(t,e){return g.opacity(r,i,a)},display:function(t,e){return g.display(r,i,a)}})}};var d=t.angularScale.range(),p=Math.abs(d[1]-d[0])/l[0].length*Math.PI/180,m=n.svg.arc().startAngle(function(t){return-p/2}).endAngle(function(t){return p/2}).innerRadius(function(e){return t.radialScale(c+(e[2]||0))}).outerRadius(function(e){return t.radialScale(c+(e[2]||0))+t.radialScale(e[1])});h.arc=function(e,r,i){n.select(this).attr({class:\"mark arc\",d:m,transform:function(e,r){return\"rotate(\"+(t.orientation+u(e[0])+90)+\")\"}})};var g={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},\"stroke-width\":function(t,r,n){return e[n].data.strokeSize+\"px\"},\"stroke-dasharray\":function(t,r,n){return o[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return void 0===e[n].data.visible||e[n].data.visible?\"block\":\"none\"}},v=n.select(this).selectAll(\"g.layer\").data(l);v.enter().append(\"g\").attr({class:\"layer\"});var y=v.selectAll(\"path.mark\").data(function(t,e){return t});y.enter().append(\"path\").attr({class:\"mark\"}),y.style(g).each(h[t.geometryType]),y.exit().remove(),v.exit().remove()})}var e=[a.PolyChart.defaultConfig()],r=n.dispatch(\"hover\"),o={solid:\"none\",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,r){e[r]||(e[r]={}),i(e[r],a.PolyChart.defaultConfig()),i(e[r],t)}),this):e},t.getColorScale=function(){},n.rebind(t,r,\"on\"),t},a.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()}}},a.BarChart=function(){return a.PolyChart()},a.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:\"bar\"}}},a.AreaChart=function(){return a.PolyChart()},a.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:\"arc\"}}},a.DotPlot=function(){return a.PolyChart()},a.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:\"dot\",dotType:\"circle\"}}},a.LinePlot=function(){return a.PolyChart()},a.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:\"line\"}}},a.Legend=function(){function t(){var r=e.legendConfig,a=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var a=i({},r.elements[e]);return a.name=t,a.color=[].concat(r.elements[e].color)[n],a})}),o=n.merge(a);o=o.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||void 0===r.elements[e].visibleInLegend)}),r.reverseOrder&&(o=o.reverse());var s=r.container;(\"string\"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map(function(t,e){return t.color}),u=r.fontSize,c=null==r.isContinuous?\"number\"==typeof o[0]:r.isContinuous,h=c?r.height:u*o.length,f=s.classed(\"legend-group\",!0).selectAll(\"svg\").data([0]),d=f.enter().append(\"svg\").attr({width:300,height:h+u,xmlns:\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",version:\"1.1\"});d.append(\"g\").classed(\"legend-axis\",!0),d.append(\"g\").classed(\"legend-marks\",!0);var p=n.range(o.length),m=n.scale[c?\"linear\":\"ordinal\"]().domain(p).range(l),g=n.scale[c?\"linear\":\"ordinal\"]().domain(p)[c?\"range\":\"rangePoints\"]([0,h]),v=function(t,e){var r=3*e;return\"line\"===t?\"M\"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+\"Z\":-1!=n.svg.symbolTypes.indexOf(t)?n.svg.symbol().type(t).size(r)():n.svg.symbol().type(\"square\").size(r)()};if(c){var y=f.select(\".legend-marks\").append(\"defs\").append(\"linearGradient\").attr({id:\"grad1\",x1:\"0%\",y1:\"0%\",x2:\"0%\",y2:\"100%\"}).selectAll(\"stop\").data(l);y.enter().append(\"stop\"),y.attr({offset:function(t,e){return e/(l.length-1)*100+\"%\"}}).style({\"stop-color\":function(t,e){return t}}),f.append(\"rect\").classed(\"legend-mark\",!0).attr({height:r.height,width:r.colorBandWidth,fill:\"url(#grad1)\"})}else{var b=f.select(\".legend-marks\").selectAll(\"path.legend-mark\").data(o);b.enter().append(\"path\").classed(\"legend-mark\",!0),b.attr({transform:function(t,e){return\"translate(\"+[u/2,g(e)+u/2]+\")\"},d:function(t,e){var r=t.symbol;return v(r,u)},fill:function(t,e){return m(e)}}),b.exit().remove()}var x=n.svg.axis().scale(g).orient(\"right\"),_=f.select(\"g.legend-axis\").attr({transform:\"translate(\"+[c?r.colorBandWidth:u,u/2]+\")\"}).call(x);return _.selectAll(\".domain\").style({fill:\"none\",stroke:\"none\"}),_.selectAll(\"line\").style({fill:\"none\",stroke:c?r.textColor:\"none\"}),_.selectAll(\"text\").style({fill:r.textColor,\"font-size\":r.fontSize}).text(function(t,e){return o[e].name}),t}var e=a.Legend.defaultConfig(),r=n.dispatch(\"hover\");return t.config=function(t){return arguments.length?(i(e,t),this):e},n.rebind(t,r,\"on\"),t},a.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}}},a.tooltipPanel=function(){var t,e,r,o={container:null,hasTick:!1,fontSize:12,color:\"white\",padding:5},s=\"tooltip-\"+a.tooltipPanel.uid++,l=function(){var n=(t=o.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:o.padding+10,dy:.3*+o.fontSize}),l};return l.text=function(i){var a=n.hsl(o.color).l,s=a>=.5?\"#aaa\":\"white\",u=a>=.5?\"black\":\"white\",c=i||\"\";e.style({fill:u,\"font-size\":o.fontSize+\"px\"}).text(c);var h,f=o.padding;try{h=e.node().getBBox()}catch(t){h={width:100,height:10}}var d={fill:o.color,stroke:s,\"stroke-width\":\"2px\"},p=h.width+2*f+10,m=h.height+2*f;return r.attr({d:\"M\"+[[10,-m/2],[10,-m/4],[o.hasTick?0:10,0],[10,m/4],[10,m/2],[p,m/2],[p,-m/2]].join(\"L\")+\"Z\"}).style(d),t.attr({transform:\"translate(\"+[10,-m/2+2*f]+\")\"}),t.style({display:\"block\"}),l},l.move=function(e){if(t)return t.attr({transform:\"translate(\"+[e[0],e[1]]+\")\"}).style({display:\"block\"}),l},l.hide=function(){if(t)return t.style({display:\"none\"}),l},l.show=function(){if(t)return t.style({display:\"block\"}),l},l.config=function(t){return i(o,t),l},l},a.tooltipPanel.uid=1,a.adapter={},a.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=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){a.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 o=a.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=o.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){a.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\"],u=[\"top\",\"right\",\"bottom\",\"left\",\"pad\"],c={};n.entries(s.margin).forEach(function(t,e){c[u[l.indexOf(t.key)]]=t.value}),s.margin=c}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),r.layout=s}return r},t}},{\"../../lib\":685,d3:107}],792:[function(t,e,r){\"use strict\";var n=t(\"d3\"),i=t(\"../../lib\"),a=t(\"../../components/color\"),o=t(\"./micropolar\"),s=t(\"./undo_manager\"),l=i.extendDeepAll,u=e.exports={};u.framework=function(t){function e(e,i){return i&&(h=i),n.select(n.select(h).node().parentNode).selectAll(\".svg-container>*:not(.chart-root)\").remove(),r=r?l(r,e):e,a||(a=o.Axis()),c=o.adapter.plotly().convert(r),a.config(c).render(h),t.data=r.data,t.layout=r.layout,u.fillLayout(t),r}var r,i,a,c,h,f=new s;return e.isPolar=!0,e.svg=function(){return a.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},e.setUndoPoint=function(){var t=this,e=o.util.cloneJson(r);!function(e,r){f.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,i),i=o.util.cloneJson(e)},e.undo=function(){f.undo()},e.redo=function(){f.redo()},e},u.fillLayout=function(t){var e=n.select(t).selectAll(\".plot-container\"),r=e.selectAll(\".svg-container\"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{\"../../components/color\":578,\"../../lib\":685,\"./micropolar\":791,\"./undo_manager\":793,d3:107}],793:[function(t,e,r){\"use strict\";e.exports=function(){function t(t,e){return t?(i=!0,t[e](),i=!1,this):this}var e,r=[],n=-1,i=!1;return{add:function(t){return i?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var i=r[n];return i?(t(i,\"undo\"),n-=1,e&&e(i.undo),this):this},redo:function(){var i=r[n+1];return i?(t(i,\"redo\"),n+=1,e&&e(i.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return-1!==n},hasRedo:function(){return n<r.length-1},getCommands:function(){return r},getPreviousCommand:function(){return r[n-1]},getIndex:function(){return n}}}},{}],794:[function(t,e,r){\"use strict\";var n=t(\"../lib\"),i=t(\"./plots\");e.exports=function(t,e,r,a){function o(t,e){return n.coerce(s,l,c,t,e)}for(var s,l,u=a.type,c=a.attributes,h=a.handleDefaults,f=a.partition||\"x\",d=i.findSubplotIds(r,u),p=d.length,m=0;m<p;m++){var g=d[m];s=t[g]?t[g]:t[g]={},e[g]=l={},o(\"domain.\"+f,[m/p,(m+1)/p]),o(\"domain.\"+{x:\"y\",y:\"x\"}[f]),a.id=g,h(s,l,o,a)}}},{\"../lib\":685,\"./plots\":787}],795:[function(t,e,r){\"use strict\";var n=t(\"./ternary\"),i=t(\"../../plots/plots\");r.name=\"ternary\",r.attr=\"subplot\",r.idRoot=\"ternary\",r.idRegex=/^ternary([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^ternary([2-9]|[1-9][0-9]+)?$/,r.attributes=t(\"./layout/attributes\"),r.layoutAttributes=t(\"./layout/layout_attributes\"),r.supplyLayoutDefaults=t(\"./layout/defaults\"),r.plot=function(t){for(var e=t._fullLayout,r=t.calcdata,a=i.getSubplotIds(e,\"ternary\"),o=0;o<a.length;o++){var s=a[o],l=i.getSubplotCalcData(r,\"ternary\",s),u=e[s]._subplot;u||(u=new n({id:s,graphDiv:t,container:e._ternarylayer.node()},e),e[s]._subplot=u),u.plot(l,e,t._promises)}},r.clean=function(t,e,r,n){for(var a=i.getSubplotIds(n,\"ternary\"),o=0;o<a.length;o++){var s=a[o],l=n[s]._subplot;!e[s]&&l&&(l.plotContainer.remove(),l.clipDef.remove())}}},{\"../../plots/plots\":787,\"./layout/attributes\":796,\"./layout/defaults\":799,\"./layout/layout_attributes\":800,\"./ternary\":801}],796:[function(t,e,r){\"use strict\";e.exports={subplot:{valType:\"subplotid\",dflt:\"ternary\"}}},{}],797:[function(t,e,r){\"use strict\";var n=t(\"../../cartesian/layout_attributes\"),i=t(\"../../../lib/extend\").extendFlat;e.exports={title:n.title,titlefont:n.titlefont,color:n.color,tickmode:n.tickmode,nticks:i({},n.nticks,{dflt:6,min:1}),tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:n.ticks,ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,showtickprefix:n.showtickprefix,tickprefix:n.tickprefix,showticksuffix:n.showticksuffix,ticksuffix:n.ticksuffix,showexponent:n.showexponent,exponentformat:n.exponentformat,separatethousands:n.separatethousands,tickfont:n.tickfont,tickangle:n.tickangle,tickformat:n.tickformat,hoverformat:n.hoverformat,showline:i({},n.showline,{dflt:!0}),linecolor:n.linecolor,linewidth:n.linewidth,showgrid:i({},n.showgrid,{dflt:!0}),gridcolor:n.gridcolor,gridwidth:n.gridwidth,min:{valType:\"number\",dflt:0,min:0}}},{\"../../../lib/extend\":677,\"../../cartesian/layout_attributes\":735}],798:[function(t,e,r){\"use strict\";var n=t(\"tinycolor2\").mix,i=t(\"../../../lib\"),a=t(\"./axis_attributes\"),o=t(\"../../cartesian/tick_label_defaults\"),s=t(\"../../cartesian/tick_mark_defaults\"),l=t(\"../../cartesian/tick_value_defaults\");e.exports=function(t,e,r){function u(r,n){return i.coerce(t,e,a,r,n)}e.type=\"linear\";var c=u(\"color\"),h=c===t.color?c:r.font.color,f=e._name.charAt(0).toUpperCase(),d=\"Component \"+f,p=u(\"title\",d);e._hovertitle=p===d?p:f,i.coerceFont(u,\"titlefont\",{family:r.font.family,size:Math.round(1.2*r.font.size),color:h}),u(\"min\"),l(t,e,u,\"linear\"),o(t,e,u,\"linear\",{noHover:!1}),s(t,e,u,{outerTicks:!0}),u(\"showticklabels\")&&(i.coerceFont(u,\"tickfont\",{family:r.font.family,size:r.font.size,color:h}),u(\"tickangle\"),u(\"tickformat\")),u(\"hoverformat\"),u(\"showline\")&&(u(\"linecolor\",c),u(\"linewidth\")),u(\"showgrid\")&&(u(\"gridcolor\",n(c,r.bgColor,60).toRgbString()),u(\"gridwidth\"))}},{\"../../../lib\":685,\"../../cartesian/tick_label_defaults\":742,\"../../cartesian/tick_mark_defaults\":743,\"../../cartesian/tick_value_defaults\":744,\"./axis_attributes\":797,tinycolor2:514}],799:[function(t,e,r){\"use strict\";function n(t,e,r,n){var a=r(\"bgcolor\"),o=r(\"sum\");n.bgColor=i.combine(a,n.paper_bgcolor);for(var u,c,h,f=0;f<l.length;f++)c=t[u=l[f]]||{},h=e[u]={_name:u,type:\"linear\"},s(c,h,n);var d=e.aaxis,p=e.baxis,m=e.caxis;d.min+p.min+m.min>=o&&(d.min=0,p.min=0,m.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}var i=t(\"../../../components/color\"),a=t(\"../../subplot_defaults\"),o=t(\"./layout_attributes\"),s=t(\"./axis_defaults\"),l=[\"aaxis\",\"baxis\",\"caxis\"];e.exports=function(t,e,r){a(t,e,r,{type:\"ternary\",attributes:o,handleDefaults:n,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{\"../../../components/color\":578,\"../../subplot_defaults\":794,\"./axis_defaults\":798,\"./layout_attributes\":800}],800:[function(t,e,r){\"use strict\";var n=t(\"../../../components/color/attributes\"),i=t(\"./axis_attributes\");e.exports={domain:{x:{valType:\"info_array\",items:[{valType:\"number\",min:0,max:1},{valType:\"number\",min:0,max:1}],dflt:[0,1]},y:{valType:\"info_array\",items:[{valType:\"number\",min:0,max:1},{valType:\"number\",min:0,max:1}],dflt:[0,1]}},bgcolor:{valType:\"color\",dflt:n.background},sum:{valType:\"number\",dflt:1,min:0},aaxis:i,baxis:i,caxis:i}},{\"../../../components/color/attributes\":577,\"./axis_attributes\":797}],801:[function(t,e,r){\"use strict\";function n(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework()}function i(t){a.select(t).selectAll(\".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners\").remove()}var a=t(\"d3\"),o=t(\"tinycolor2\"),s=t(\"../../plotly\"),l=t(\"../../lib\"),u=t(\"../../components/color\"),c=t(\"../../components/drawing\"),h=t(\"../cartesian/set_convert\"),f=t(\"../../lib/extend\").extendFlat,d=t(\"../plots\"),p=t(\"../cartesian/axes\"),m=t(\"../../components/dragelement\"),g=t(\"../../components/titles\"),v=t(\"../cartesian/select\"),y=t(\"../cartesian/constants\"),b=t(\"../cartesian/graph_interact\");e.exports=n;var x=n.prototype;x.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={}},x.plot=function(t,e){var r=this,n=e[r.id],i=e._size;r.adjustLayout(n,i),d.generalUpdatePerTraceModule(r,t,n),r.layers.plotbg.select(\"path\").call(u.fill,n.bgcolor)},x.makeFramework=function(){var t=this,e=t.defs.selectAll(\"g.clips\").data([0]);e.enter().append(\"g\").classed(\"clips\",!0);var r=\"clip\"+t.layoutId+t.id;t.clipDef=e.selectAll(\"#\"+r).data([0]),t.clipDef.enter().append(\"clipPath\").attr(\"id\",r).append(\"path\").attr(\"d\",\"M0,0Z\"),t.plotContainer=t.container.selectAll(\"g.\"+t.id).data([0]),t.plotContainer.enter().append(\"g\").classed(t.id,!0),t.layers={};var n=[\"draglayer\",\"plotbg\",\"backplot\",\"grids\",\"frontplot\",\"zoom\",\"aaxis\",\"baxis\",\"caxis\",\"axlines\"];t.plotContainer.selectAll(\"g.toplevel\").data(n).enter().append(\"g\").attr(\"class\",function(t){return\"toplevel \"+t}).each(function(e){var r=a.select(this);t.layers[e]=r,\"frontplot\"===e?r.append(\"g\").classed(\"scatterlayer\",!0):\"backplot\"===e?r.append(\"g\").classed(\"maplayer\",!0):\"plotbg\"===e?r.append(\"path\").attr(\"d\",\"M0,0Z\"):\"axlines\"===e&&r.selectAll(\"path\").data([\"aline\",\"bline\",\"cline\"]).enter().append(\"path\").each(function(t){a.select(this).classed(t,!0)})}),t.plotContainer.select(\".grids\").selectAll(\"g.grid\").data([\"agrid\",\"bgrid\",\"cgrid\"]).enter().append(\"g\").attr(\"class\",function(t){return\"grid \"+t}).each(function(e){t.layers[e]=a.select(this)}),t.plotContainer.selectAll(\".backplot,.frontplot,.grids\").call(c.setClipUrl,r),t.graphDiv._context.staticPlot||t.initInteractions()};var _=Math.sqrt(4/3);x.adjustLayout=function(t,e){var r,n,i,a,o,s,l=this,c=t.domain,d=(c.x[0]+c.x[1])/2,p=(c.y[0]+c.y[1])/2,m=c.x[1]-c.x[0],g=c.y[1]-c.y[0],v=m*e.w,y=g*e.h,b=t.sum,x=t.aaxis.min,w=t.baxis.min,M=t.caxis.min;v>_*y?i=(a=y)*_:a=(i=v)/_,o=m*i/v,s=g*a/y,r=e.l+e.w*d-i/2,n=e.t+e.h*(1-p)-a/2,l.x0=r,l.y0=n,l.w=i,l.h=a,l.sum=b,l.xaxis={type:\"linear\",range:[x+2*M-b,b-x-2*w],domain:[d-o/2,d+o/2],_id:\"x\"},h(l.xaxis,l.graphDiv._fullLayout),l.xaxis.setScale(),l.yaxis={type:\"linear\",range:[x,b-w-M],domain:[p-s/2,p+s/2],_id:\"y\"},h(l.yaxis,l.graphDiv._fullLayout),l.yaxis.setScale();var k=l.yaxis.domain[0],A=l.aaxis=f({},t.aaxis,{visible:!0,range:[x,b-w-M],side:\"left\",_counterangle:30,tickangle:(+t.aaxis.tickangle||0)-30,domain:[k,k+s*_],_axislayer:l.layers.aaxis,_gridlayer:l.layers.agrid,_pos:0,_id:\"y\",_length:i,_gridpath:\"M0,0l\"+a+\",-\"+i/2});h(A,l.graphDiv._fullLayout),A.setScale();var T=l.baxis=f({},t.baxis,{visible:!0,range:[b-x-M,w],side:\"bottom\",_counterangle:30,domain:l.xaxis.domain,_axislayer:l.layers.baxis,_gridlayer:l.layers.bgrid,_counteraxis:l.aaxis,_pos:0,_id:\"x\",_length:i,_gridpath:\"M0,0l-\"+i/2+\",-\"+a});h(T,l.graphDiv._fullLayout),T.setScale(),A._counteraxis=T;var S=l.caxis=f({},t.caxis,{visible:!0,range:[b-x-w,M],side:\"right\",_counterangle:30,tickangle:(+t.caxis.tickangle||0)+30,domain:[k,k+s*_],_axislayer:l.layers.caxis,_gridlayer:l.layers.cgrid,_counteraxis:l.baxis,_pos:0,_id:\"y\",_length:i,_gridpath:\"M0,0l-\"+a+\",\"+i/2});h(S,l.graphDiv._fullLayout),S.setScale();var E=\"M\"+r+\",\"+(n+a)+\"h\"+i+\"l-\"+i/2+\",-\"+a+\"Z\";l.clipDef.select(\"path\").attr(\"d\",E),l.layers.plotbg.select(\"path\").attr(\"d\",E);var L=\"translate(\"+r+\",\"+n+\")\";l.plotContainer.selectAll(\".scatterlayer,.maplayer,.zoom\").attr(\"transform\",L);var C=\"translate(\"+r+\",\"+(n+a)+\")\";l.layers.baxis.attr(\"transform\",C),l.layers.bgrid.attr(\"transform\",C);var z=\"translate(\"+(r+i/2)+\",\"+n+\")rotate(30)\";l.layers.aaxis.attr(\"transform\",z),l.layers.agrid.attr(\"transform\",z);var D=\"translate(\"+(r+i/2)+\",\"+n+\")rotate(-30)\";l.layers.caxis.attr(\"transform\",D),l.layers.cgrid.attr(\"transform\",D),l.drawAxes(!0),l.plotContainer.selectAll(\".crisp\").classed(\"crisp\",!1);var I=l.layers.axlines;I.select(\".aline\").attr(\"d\",A.showline?\"M\"+r+\",\"+(n+a)+\"l\"+i/2+\",-\"+a:\"M0,0\").call(u.stroke,A.linecolor||\"#000\").style(\"stroke-width\",(A.linewidth||0)+\"px\"),I.select(\".bline\").attr(\"d\",T.showline?\"M\"+r+\",\"+(n+a)+\"h\"+i:\"M0,0\").call(u.stroke,T.linecolor||\"#000\").style(\"stroke-width\",(T.linewidth||0)+\"px\"),I.select(\".cline\").attr(\"d\",S.showline?\"M\"+(r+i/2)+\",\"+n+\"l\"+i/2+\",\"+a:\"M0,0\").call(u.stroke,S.linecolor||\"#000\").style(\"stroke-width\",(S.linewidth||0)+\"px\")},x.drawAxes=function(t){var e=this,r=e.graphDiv,n=e.id.substr(7)+\"title\",i=e.aaxis,a=e.baxis,o=e.caxis;if(p.doTicks(r,i,!0),p.doTicks(r,a,!0),p.doTicks(r,o,!0),t){var s=Math.max(i.showticklabels?i.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+(\"outside\"===o.ticks?.87*o.ticklen:0));g.draw(r,\"a\"+n,{propContainer:i,propName:e.id+\".aaxis.title\",dfltName:\"Component A\",attributes:{x:e.x0+e.w/2,y:e.y0-i.titlefont.size/3-s,\"text-anchor\":\"middle\"}});var l=(a.showticklabels?a.tickfont.size:0)+(\"outside\"===a.ticks?a.ticklen:0)+3;g.draw(r,\"b\"+n,{propContainer:a,propName:e.id+\".baxis.title\",dfltName:\"Component B\",attributes:{x:e.x0-l,y:e.y0+e.h+.83*a.titlefont.size+l,\"text-anchor\":\"middle\"}}),g.draw(r,\"c\"+n,{propContainer:o,propName:e.id+\".caxis.title\",dfltName:\"Component C\",attributes:{x:e.x0+e.w+l,y:e.y0+e.h+.83*o.titlefont.size+l,\"text-anchor\":\"middle\"}})}};var w=y.MINZOOM/2+.87,M=\"m-0.87,.5h\"+w+\"v3h-\"+(w+5.2)+\"l\"+(w/2+2.6)+\",-\"+(.87*w+4.5)+\"l2.6,1.5l-\"+w/2+\",\"+.87*w+\"Z\",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\",S=!0;x.initInteractions=function(){function t(t,e,r){var n=R.getBoundingClientRect();x=e-n.left,w=r-n.top,E={a:j.aaxis.range[0],b:j.baxis.range[1],c:j.caxis.range[1]},C=E,L=j.aaxis.range[1]-E.a,z=o(j.graphDiv._fullLayout[j.id].bgcolor).getLuminance(),D=\"M0,\"+j.h+\"L\"+j.w/2+\", 0L\"+j.w+\",\"+j.h+\"Z\",I=!1,P=N.append(\"path\").attr(\"class\",\"zoombox\").style({fill:z>.2?\"rgba(0,0,0,0)\":\"rgba(255,255,255,0)\",\"stroke-width\":0}).attr(\"d\",D),O=N.append(\"path\").attr(\"class\",\"zoombox-corners\").style({fill:u.background,stroke:u.defaultLine,\"stroke-width\":1,opacity:0}).attr(\"d\",\"M0,0Z\"),p()}function e(t,e){return 1-e/j.h}function r(t,e){return 1-(t+(j.h-e)/Math.sqrt(3))/j.w}function n(t,e){return(t-(j.h-e)/Math.sqrt(3))/j.w}function a(t,i){var a=x+t,o=w+i,s=Math.max(0,Math.min(1,e(x,w),e(a,o))),l=Math.max(0,Math.min(1,r(x,w),r(a,o))),u=Math.max(0,Math.min(1,n(x,w),n(a,o))),c=(s/2+u)*j.w,h=(1-s/2-l)*j.w,f=(c+h)/2,d=h-c,p=(1-s)*j.h,m=p-d/_;d<y.MINZOOM?(C=E,P.attr(\"d\",D),O.attr(\"d\",\"M0,0Z\")):(C={a:E.a+s*L,b:E.b+l*L,c:E.c+u*L},P.attr(\"d\",D+\"M\"+c+\",\"+p+\"H\"+h+\"L\"+f+\",\"+m+\"L\"+c+\",\"+p+\"Z\"),O.attr(\"d\",\"M\"+x+\",\"+w+T+\"M\"+c+\",\"+p+M+\"M\"+h+\",\"+p+k+\"M\"+f+\",\"+m+A)),I||(P.transition().style(\"fill\",z>.2?\"rgba(0,0,0,0.4)\":\"rgba(255,255,255,0.3)\").duration(200),O.transition().style(\"opacity\",1).duration(200),I=!0)}function c(t,e){if(C===E)return 2===e&&g(),i(F);i(F);var r={};r[j.id+\".aaxis.min\"]=C.a,r[j.id+\".baxis.min\"]=C.b,r[j.id+\".caxis.min\"]=C.c,s.relayout(F,r),S&&F.data&&F._context.showTips&&(l.notifier(\"Double-click to<br>zoom back out\",\"long\"),S=!1)}function h(){E={a:j.aaxis.range[0],b:j.baxis.range[1],c:j.caxis.range[1]},C=E}function f(t,e){var r=t/j.xaxis._m,n=e/j.yaxis._m,i=[(C={a:E.a-n,b:E.b+(r+n)/2,c:E.c-(r-n)/2}).a,C.b,C.c].sort(),a={a:i.indexOf(C.a),b:i.indexOf(C.b),c:i.indexOf(C.c)};i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),C={a:i[a.a],b:i[a.b],c:i[a.c]},e=(E.a-C.a)*j.yaxis._m,t=(E.c-C.c-E.b+C.b)*j.xaxis._m);var o=\"translate(\"+(j.x0+t)+\",\"+(j.y0+e)+\")\";j.plotContainer.selectAll(\".scatterlayer,.maplayer\").attr(\"transform\",o),j.aaxis.range=[C.a,j.sum-C.b-C.c],j.baxis.range=[j.sum-C.a-C.c,C.b],j.caxis.range=[j.sum-C.a-C.b,C.c],j.drawAxes(!1),j.plotContainer.selectAll(\".crisp\").classed(\"crisp\",!1)}function d(t,e){if(t){var r={};r[j.id+\".aaxis.min\"]=C.a,r[j.id+\".baxis.min\"]=C.b,r[j.id+\".caxis.min\"]=C.c,s.relayout(F,r)}else 2===e&&g()}function p(){j.plotContainer.selectAll(\".select-outline\").remove()}function g(){var t={};t[j.id+\".aaxis.min\"]=0,t[j.id+\".baxis.min\"]=0,t[j.id+\".caxis.min\"]=0,F.emit(\"plotly_doubleclick\",null),s.relayout(F,t)}var x,w,E,L,C,z,D,I,P,O,j=this,R=j.layers.plotbg.select(\"path\").node(),F=j.graphDiv,N=j.layers.zoom,B={element:R,gd:F,plotinfo:{plot:N},doubleclick:g,subplot:j.id,prepFn:function(e,r,n){B.xaxes=[j.xaxis],B.yaxes=[j.yaxis];var i=F._fullLayout.dragmode;e.shiftKey&&(i=\"pan\"===i?\"zoom\":\"pan\"),B.minDrag=\"lasso\"===i?1:void 0,\"zoom\"===i?(B.moveFn=a,B.doneFn=c,t(e,r,n)):\"pan\"===i?(B.moveFn=f,B.doneFn=d,h(),p()):\"select\"!==i&&\"lasso\"!==i||v(e,r,n,B,i)}};R.onmousemove=function(t){b.hover(F,t,j.id),F._fullLayout._lasthover=R,F._fullLayout._hoversubplot=j.id},R.onmouseout=function(t){F._dragging||m.unhover(F,t)},R.onclick=function(t){b.click(F,t)},m.init(B)}},{\"../../components/color\":578,\"../../components/dragelement\":599,\"../../components/drawing\":602,\"../../components/titles\":655,\"../../lib\":685,\"../../lib/extend\":677,\"../../plotly\":719,\"../cartesian/axes\":724,\"../cartesian/constants\":729,\"../cartesian/graph_interact\":733,\"../cartesian/select\":740,\"../cartesian/set_convert\":741,\"../plots\":787,d3:107,tinycolor2:514}],802:[function(t,e,r){\"use strict\";function n(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n<e.length;n++)s(r.layoutArrayRegexes,e[n])}}function i(t){return\"object\"==typeof t&&(t=t.type),t}var a=t(\"./lib/loggers\"),o=t(\"./lib/noop\"),s=t(\"./lib/push_unique\"),l=t(\"./plots/attributes\");r.modules={},r.allCategories={},r.allTypes=[],r.subplotsRegistry={},r.transformsRegistry={},r.componentsRegistry={},r.layoutArrayContainers=[],r.layoutArrayRegexes=[],r.register=function(t,e,n,i){if(r.modules[e])a.log(\"Type \"+e+\" already registered\");else{for(var o={},s=0;s<n.length;s++)o[n[s]]=!0,r.allCategories[n[s]]=!0;r.modules[e]={_module:t,categories:o},i&&Object.keys(i).length&&(r.modules[e].meta=i),r.allTypes.push(e)}},r.registerSubplot=function(t){var e=t.name;r.subplotsRegistry[e]?a.log(\"Plot type \"+e+\" already registered.\"):(n(t),r.subplotsRegistry[e]=t)},r.registerComponent=function(t){var e=t.name;r.componentsRegistry[e]=t,t.layoutAttributes&&(t.layoutAttributes._isLinkedToArray&&s(r.layoutArrayContainers,e),n(t))},r.getModule=function(t){if(void 0!==t.r)return a.warn(\"Tried to put a polar trace on an incompatible graph of cartesian data. Ignoring this dataset.\",t),!1;var e=r.modules[i(t)];return!!e&&e._module},r.traceIs=function(t,e){if(\"various\"===(t=i(t)))return!1;var n=r.modules[t];return n||(t&&\"area\"!==t&&a.log(\"Unrecognized trace type \"+t+\".\"),n=r.modules[l.type.dflt]),!!n.categories[e]},r.getComponentMethod=function(t,e){var n=r.componentsRegistry[t];return n?n[e]||o:o}},{\"./lib/loggers\":688,\"./lib/noop\":692,\"./lib/push_unique\":696,\"./plots/attributes\":722}],803:[function(t,e,r){\"use strict\";function n(t){var e;switch(t){case\"themes__thumb\":e={autosize:!0,width:150,height:150,title:\"\",showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case\"thumbnail\":e={title:\"\",hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:\"\",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}function i(t){return[\"xaxis\",\"yaxis\",\"zaxis\"].indexOf(t.slice(0,5))>-1}var a=t(\"../lib\"),o=t(\"../plots/plots\"),s=a.extendFlat,l=a.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,a=t.data,u=t.layout,c=l([],a),h=l({},u,n(e.tileClass)),f=t._context||{};if(e.width&&(h.width=e.width),e.height&&(h.height=e.height),\"thumbnail\"===e.tileClass||\"themes__thumb\"===e.tileClass){h.annotations=[];var d=Object.keys(h);for(r=0;r<d.length;r++)i(d[r])&&(h[d[r]].title=\"\");for(r=0;r<c.length;r++){var p=c[r];p.showscale=!1,p.marker&&(p.marker.showscale=!1),\"pie\"===p.type&&(p.textposition=\"none\")}}if(Array.isArray(e.annotations))for(r=0;r<e.annotations.length;r++)h.annotations.push(e.annotations[r]);var m=o.getSubplotIds(h,\"gl3d\");if(m.length){var g={};for(\"thumbnail\"===e.tileClass&&(g={title:\"\",showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),r=0;r<m.length;r++){var v=h[m[r]];v.xaxis||(v.xaxis={}),v.yaxis||(v.yaxis={}),v.zaxis||(v.zaxis={}),s(v.xaxis,g),s(v.yaxis,g),s(v.zaxis,g),v._scene=null}}var y=document.createElement(\"div\");e.tileClass&&(y.className=e.tileClass);var b={gd:y,td:y,layout:h,data:c,config:{staticPlot:void 0===e.staticPlot||e.staticPlot,plotGlPixelRatio:void 0===e.plotGlPixelRatio?2:e.plotGlPixelRatio,displaylogo:e.displaylogo||!1,showLink:e.showLink||!1,showTips:e.showTips||!1,mapboxAccessToken:f.mapboxAccessToken}};return\"transparent\"!==e.setBackground&&(b.config.setBackground=e.setBackground||\"opaque\"),b.gd.defaultLayout=n(e.tileClass),b}},{\"../lib\":685,\"../plots/plots\":787}],804:[function(t,e,r){\"use strict\";function n(t,e){return e=e||{},e.format=e.format||\"png\",new Promise(function(r,n){t._snapshotInProgress&&n(new Error(\"Snapshotting already in progress.\")),a.isIE()&&\"svg\"!==e.format&&n(new Error(\"Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.\")),t._snapshotInProgress=!0;var s=i(t,e),l=e.filename||t.fn||\"newplot\";l+=\".\"+e.format,s.then(function(e){return t._snapshotInProgress=!1,o(e,l)}).then(function(t){r(t)}).catch(function(e){t._snapshotInProgress=!1,n(e)})})}var i=t(\"../plot_api/to_image\"),a=t(\"../lib\"),o=t(\"./filesaver\");e.exports=n},{\"../lib\":685,\"../plot_api/to_image\":717,\"./filesaver\":805}],805:[function(t,e,r){\"use strict\";var n=function(t,e){var r=document.createElement(\"a\"),n=\"download\"in r,i=/Version\\/[\\d\\.]+.*Safari/.test(navigator.userAgent);return new Promise(function(a,o){\"undefined\"!=typeof navigator&&/MSIE [1-9]\\./.test(navigator.userAgent)&&o(new Error(\"IE < 10 unsupported\")),i&&(document.location.href=\"data:application/octet-stream\"+t.slice(t.search(/[,;]/)),a(e)),e||(e=\"download\"),n&&(r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r),a(e)),\"undefined\"!=typeof navigator&&navigator.msSaveBlob&&(navigator.msSaveBlob(new Blob([t]),e),a(e)),o(new Error(\"download error\"))})};e.exports=n},{}],806:[function(t,e,r){\"use strict\";r.getDelay=function(t){return t._has&&(t._has(\"gl3d\")||t._has(\"gl2d\"))?500:0},r.getRedrawFunc=function(t){if(!(t.data&&t.data[0]&&t.data[0].r))return function(){(t.calcdata||[]).forEach(function(t){t[0]&&t[0].t&&t[0].t.cb&&t[0].t.cb()})}}},{}],807:[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\":803,\"./download\":804,\"./helpers\":806,\"./svgtoimg\":808,\"./toimage\":809,\"./tosvg\":810}],808:[function(t,e,r){\"use strict\";function n(t){var e=t.emitter||new a,r=new Promise(function(n,a){var o=window.Image,s=t.svg,l=t.format||\"png\";if(i.isIE()&&(s=s.replace(/\"/gi,\"'\"),s=s.replace(/(\\('#)(.*)('\\))/gi,'(\"$2\")'),s=s.replace(/(\\\\')/gi,'\"'),\"svg\"!==l)){var u=new Error(\"Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.\");return a(u),t.promise?r:e.emit(\"error\",u)}var c=t.canvas,h=c.getContext(\"2d\"),f=new o,d=\"data:image/svg+xml,\"+encodeURIComponent(s);c.height=t.height||150,c.width=t.width||300,f.onload=function(){var r;switch(\"svg\"!==l&&h.drawImage(f,0,0),l){case\"jpeg\":r=c.toDataURL(\"image/jpeg\");break;case\"png\":r=c.toDataURL(\"image/png\");break;case\"webp\":r=c.toDataURL(\"image/webp\");break;case\"svg\":r=d;break;default:if(a(new Error(\"Image format is not jpeg, png or svg\")),!t.promise)return e.emit(\"error\",\"Image format is not jpeg, png or svg\")}n(r),t.promise||e.emit(\"success\",r)},f.onerror=function(r){if(a(r),!t.promise)return e.emit(\"error\",r)},f.src=d});return t.promise?r:e}var i=t(\"../lib\"),a=t(\"events\").EventEmitter;e.exports=n},{\"../lib\":685,events:114}],809:[function(t,e,r){\"use strict\";function n(t,e){function r(){var t=s.getDelay(f._fullLayout);setTimeout(function(){var t=u(f),r=document.createElement(\"canvas\");r.id=o.randstr(),(n=c({format:e.format,width:f._fullLayout.width,height:f._fullLayout.height,canvas:r,emitter:n,svg:t})).clean=function(){f&&document.body.removeChild(f)}},t)}var n=new i,h=l(t,{format:\"png\"}),f=h.gd;f.style.position=\"absolute\",f.style.left=\"-5000px\",document.body.appendChild(f);var d=s.getRedrawFunc(f);return a.plot(f,h.data,h.layout,h.config).then(d).then(r).catch(function(t){n.emit(\"error\",t)}),n}var i=t(\"events\").EventEmitter,a=t(\"../plotly\"),o=t(\"../lib\"),s=t(\"./helpers\"),l=t(\"./cloneplot\"),u=t(\"./tosvg\"),c=t(\"./svgtoimg\");e.exports=n},{\"../lib\":685,\"../plotly\":719,\"./cloneplot\":803,\"./helpers\":806,\"./svgtoimg\":808,\"./tosvg\":810,events:114}],810:[function(t,e,r){\"use strict\";var n=t(\"d3\"),i=t(\"../lib/svg_text_utils\"),a=t(\"../components/drawing\"),o=t(\"../components/color\"),s=t(\"../constants/xmlns_namespaces\");e.exports=function(t,e){var r,l=t._fullLayout,u=l._paper,c=l._toppaper;u.insert(\"rect\",\":first-child\").call(a.setRect,0,0,l.width,l.height).call(o.fill,l.paper_bgcolor);var h=l._basePlotModules||[];for(r=0;r<h.length;r++){var f=h[r];f.toSVG&&f.toSVG(t)}if(c){var d=c.node().childNodes,p=Array.prototype.slice.call(d);for(r=0;r<p.length;r++){var m=p[r];m.childNodes.length&&u.node().appendChild(m)}}l._draggers&&l._draggers.remove(),u.node().style.background=\"\",u.selectAll(\"text\").attr(\"data-unformatted\",null).each(function(){var t=n.select(this);if(\"hidden\"!==t.style(\"visibility\")){t.style(\"visibility\",\"visible\");var e=t.style(\"font-family\");e&&-1!==e.indexOf('\"')&&t.style(\"font-family\",e.replace(/\"/g,\"TOBESTRIPPED\"))}else t.remove()}),\"pdf\"!==e&&\"eps\"!==e||u.selectAll(\"#MathJax_SVG_glyphs path\").attr(\"stroke-width\",0),u.node().setAttributeNS(s.xmlns,\"xmlns\",s.svg),u.node().setAttributeNS(s.xmlns,\"xmlns:xlink\",s.xlink);var g=(new window.XMLSerializer).serializeToString(u.node());return g=i.html_entity_decode(g),g=i.xml_entity_encode(g),g=g.replace(/(\"TOBESTRIPPED)|(TOBESTRIPPED\")/g,\"'\")}},{\"../components/color\":578,\"../components/drawing\":602,\"../constants/xmlns_namespaces\":668,\"../lib/svg_text_utils\":704,d3:107}],811:[function(t,e,r){\"use strict\";var n=t(\"../../lib\").mergeArray;e.exports=function(t,e){n(e.text,t,\"tx\"),n(e.hovertext,t,\"htx\");var r=e.marker;if(r){n(r.opacity,t,\"mo\"),n(r.color,t,\"mc\");var i=r.line;i&&(n(i.color,t,\"mlc\"),n(i.width,t,\"mlw\"))}}},{\"../../lib\":685}],812:[function(t,e,r){\"use strict\";var n=t(\"../scatter/attributes\"),i=t(\"../../components/colorscale/color_attributes\"),a=t(\"../../components/errorbars/attributes\"),o=t(\"../../components/colorbar/attributes\"),s=t(\"../../plots/font_attributes\"),l=t(\"../../lib/extend\").extendFlat,u=(0,t(\"../../lib/extend\").extendDeep)({},s);u.family.arrayOk=!0,u.size.arrayOk=!0,u.color.arrayOk=!0;var c=n.marker,h=l({},{line:l({},{width:l({},c.line.width,{dflt:0})},i(\"marker.line\"))},i(\"marker\"),{showscale:c.showscale,colorbar:o});e.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:n.text,hovertext:n.hovertext,textposition:{valType:\"enumerated\",values:[\"inside\",\"outside\",\"auto\",\"none\"],dflt:\"none\",arrayOk:!0},textfont:l({},u,{}),insidetextfont:l({},u,{}),outsidetextfont:l({},u,{}),orientation:{valType:\"enumerated\",values:[\"v\",\"h\"]},base:{valType:\"any\",dflt:null,arrayOk:!0},offset:{valType:\"number\",dflt:null,arrayOk:!0},width:{valType:\"number\",dflt:null,min:0,arrayOk:!0},marker:h,r:n.r,t:n.t,error_y:a,error_x:a,_deprecated:{bardir:{valType:\"enumerated\",values:[\"v\",\"h\"]}}}},{\"../../components/colorbar/attributes\":579,\"../../components/colorscale/color_attributes\":585,\"../../components/errorbars/attributes\":604,\"../../lib/extend\":677,\"../../plots/font_attributes\":748,\"../scatter/attributes\":976}],813:[function(t,e,r){\"use strict\";var n=t(\"fast-isnumeric\"),i=t(\"../../plots/cartesian/axes\"),a=t(\"../../components/colorscale/has_colorscale\"),o=t(\"../../components/colorscale/calc\"),s=t(\"./arrays_to_calcdata\");e.exports=function(t,e){var r,l,u,c,h,f=i.getFromId(t,e.xaxis||\"x\"),d=i.getFromId(t,e.yaxis||\"y\");\"h\"===(e.orientation||(e.x&&!e.y?\"h\":\"v\"))?(r=f,u=f.makeCalcdata(e,\"x\"),l=d.makeCalcdata(e,\"y\"),h=e.xcalendar):(r=d,u=d.makeCalcdata(e,\"y\"),l=f.makeCalcdata(e,\"x\"),h=e.ycalendar);var p=Math.min(l.length,u.length),m=new Array(p);for(c=0;c<p;c++)m[c]={p:l[c],s:u[c]};var g,v=e.base;if(Array.isArray(v)){for(c=0;c<Math.min(v.length,m.length);c++)g=r.d2c(v[c],0,h),m[c].b=n(g)?g:0;for(;c<m.length;c++)m[c].b=0}else for(g=r.d2c(v,0,h),g=n(g)?g:0,c=0;c<m.length;c++)m[c].b=g;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(m,e),m}},{\"../../components/colorscale/calc\":584,\"../../components/colorscale/has_colorscale\":591,\"../../plots/cartesian/axes\":724,\"./arrays_to_calcdata\":811,\"fast-isnumeric\":116}],814:[function(t,e,r){\"use strict\";var n=t(\"../../lib\"),i=t(\"../../components/color\"),a=t(\"../scatter/xy_defaults\"),o=t(\"../bar/style_defaults\"),s=t(\"../../components/errorbars/defaults\"),l=t(\"./attributes\");e.exports=function(t,e,r,u){function c(r,i){return n.coerce(t,e,l,r,i)}var h=n.coerceFont;if(a(t,e,u,c)){c(\"orientation\",e.x&&!e.y?\"h\":\"v\"),c(\"base\"),c(\"offset\"),c(\"width\"),c(\"text\"),c(\"hovertext\");var f=c(\"textposition\"),d=Array.isArray(f)||\"auto\"===f,p=d||\"inside\"===f,m=d||\"outside\"===f;if(p||m){var g=h(c,\"textfont\",u.font);p&&h(c,\"insidetextfont\",g),m&&h(c,\"outsidetextfont\",g)}o(t,e,c,r,u),s(t,e,i.defaultLine,{axis:\"y\"}),s(t,e,i.defaultLine,{axis:\"x\",inherit:\"y\"})}else e.visible=!1}},{\"../../components/color\":578,\"../../components/errorbars/defaults\":607,\"../../lib\":685,\"../bar/style_defaults\":823,\"../scatter/xy_defaults\":998,\"./attributes\":812}],815:[function(t,e,r){\"use strict\";var n=t(\"../../plots/cartesian/graph_interact\"),i=t(\"../../components/errorbars\"),a=t(\"../../components/color\");e.exports=function(t,e,r,o){var s,l,u,c,h,f,d,p=t.cd,m=p[0].trace,g=p[0].t,v=t.xa,y=t.ya,b=function(t){return n.inbox(c(t)-s,h(t)-s)};\"h\"===m.orientation?(s=r,l=function(t){return t.y-t.w/2},u=function(t){return t.y+t.w/2},f=function(t){return n.inbox(t.b-e,t.x-e)+(t.x-e)/(t.x-t.b)},d=b):(s=e,l=function(t){return t.x-t.w/2},u=function(t){return t.x+t.w/2},d=function(t){return n.inbox(t.b-r,t.y-r)+(t.y-r)/(t.y-t.b)},f=b),c=\"closest\"===o?l:function(t){return Math.min(l(t),t.p-g.bargroupwidth/2)},h=\"closest\"===o?u:function(t){return Math.max(u(t),t.p+g.bargroupwidth/2)};var x=n.getDistanceFunction(o,f,d);if(n.getClosest(p,x,t),!1!==t.index){var _=p[t.index],w=_.mcc||m.marker.color,M=_.mlcc||m.marker.line.color,k=_.mlw||m.marker.line.width;a.opacity(w)?t.color=w:a.opacity(M)&&k&&(t.color=M);var A=m.base?_.b+_.s:_.s;return\"h\"===m.orientation?(t.x0=t.x1=v.c2p(_.x,!0),t.xLabelVal=A,t.y0=y.c2p(c(_),!0),t.y1=y.c2p(h(_),!0),t.yLabelVal=_.p):(t.y0=t.y1=y.c2p(_.y,!0),t.yLabelVal=A,t.x0=v.c2p(c(_),!0),t.x1=v.c2p(h(_),!0),t.xLabelVal=_.p),_.htx?t.text=_.htx:m.hovertext?t.text=m.hovertext:_.tx?t.text=_.tx:m.text&&(t.text=m.text),i.hoverInfo(_,m,t),[t]}}},{\"../../components/color\":578,\"../../components/errorbars\":608,\"../../plots/cartesian/graph_interact\":733}],816:[function(t,e,r){\"use strict\";var n={};n.attributes=t(\"./attributes\"),n.layoutAttributes=t(\"./layout_attributes\"),n.supplyDefaults=t(\"./defaults\"),n.supplyLayoutDefaults=t(\"./layout_defaults\"),n.calc=t(\"./calc\"),n.setPositions=t(\"./set_positions\"),n.colorbar=t(\"../scatter/colorbar\"),n.arraysToCalcdata=t(\"./arrays_to_calcdata\"),n.plot=t(\"./plot\"),n.style=t(\"./style\"),n.hoverPoints=t(\"./hover\"),n.moduleType=\"trace\",n.name=\"bar\",n.basePlotModule=t(\"../../plots/cartesian\"),n.categories=[\"cartesian\",\"bar\",\"oriented\",\"markerColorscale\",\"errorBarsOK\",\"showLegend\"],n.meta={},e.exports=n},{\"../../plots/cartesian\":734,\"../scatter/colorbar\":979,\"./arrays_to_calcdata\":811,\"./attributes\":812,\"./calc\":813,\"./defaults\":814,\"./hover\":815,\"./layout_attributes\":817,\"./layout_defaults\":818,\"./plot\":819,\"./set_positions\":820,\"./style\":822}],817:[function(t,e,r){\"use strict\";e.exports={barmode:{valType:\"enumerated\",values:[\"stack\",\"group\",\"overlay\",\"relative\"],dflt:\"group\"},barnorm:{valType:\"enumerated\",values:[\"\",\"fraction\",\"percent\"],dflt:\"\"},bargap:{valType:\"number\",min:0,max:1},bargroupgap:{valType:\"number\",min:0,max:1,dflt:0}}},{}],818:[function(t,e,r){\"use strict\";var n=t(\"../../registry\"),i=t(\"../../plots/cartesian/axes\"),a=t(\"../../lib\"),o=t(\"./layout_attributes\");e.exports=function(t,e,r){function s(r,n){return a.coerce(t,e,o,r,n)}for(var l=!1,u=!1,c=!1,h={},f=0;f<r.length;f++){var d=r[f];if(n.traceIs(d,\"bar\")){if(l=!0,\"overlay\"!==t.barmode&&\"stack\"!==t.barmode){var p=d.xaxis+d.yaxis;h[p]&&(c=!0),h[p]=!0}d.visible&&\"histogram\"===d.type&&\"category\"!==i.getFromId({_fullLayout:e},d[\"v\"===d.orientation?\"xaxis\":\"yaxis\"]).type&&(u=!0)}}l&&(\"overlay\"!==s(\"barmode\")&&s(\"barnorm\"),s(\"bargap\",u&&!c?0:.2),s(\"bargroupgap\"))}},{\"../../lib\":685,\"../../plots/cartesian/axes\":724,\"../../registry\":802,\"./layout_attributes\":817}],819:[function(t,e,r){\"use strict\";function n(t,e,r,n,o,f,d,p){function m(t,e,r){var n=t.append(\"text\").attr(\"data-notex\",1).text(e).attr({class:\"bartext\",transform:\"\",\"data-bb\":\"\",\"text-anchor\":\"middle\",x:0,y:0}).call(k.font,r);return n.call(w.convertToTspans),n.selectAll(\"tspan.line\").attr({x:0,y:0}),n}var g=r[0].trace,v=g.orientation,y=s(g,n);if(y){var b=l(g,n);if(\"none\"!==b){var x,_,M,A,T=u(g,n,t._fullLayout.font),S=c(g,n,T),E=h(g,n,T),L=t._fullLayout.barmode,C=\"relative\"===L,z=\"stack\"===L||C,I=r[n],P=!z||I._outmost,O=Math.abs(f-o)-2*D,j=Math.abs(p-d)-2*D;if(\"outside\"===b&&(P||(b=\"inside\")),\"auto\"===b)if(P){x=m(e,y,S),M=(_=k.bBox(x.node())).width,A=_.height;var R=M>0&&A>0,F=M<=O&&A<=j,N=M<=j&&A<=O,B=\"h\"===v?O>=M*(j/A):j>=A*(O/M);R&&(F||N||B)?b=\"inside\":(b=\"outside\",x.remove(),x=null)}else b=\"inside\";if(!x&&(x=m(e,y,\"outside\"===b?E:S),_=k.bBox(x.node()),M=_.width,A=_.height,M<=0||A<=0))x.remove();else{var U;U=\"outside\"===b?a(o,f,d,p,_,v):i(o,f,d,p,_,v),x.attr(\"transform\",U)}}}}function i(t,e,r,n,i,a){var s,l,u,c,h,f=i.width,d=i.height,p=(i.left+i.right)/2,m=(i.top+i.bottom)/2,g=Math.abs(e-t),v=Math.abs(n-r);g>2*D&&v>2*D?(g-=2*(h=D),v-=2*h):h=0;var y,b;return f<=g&&d<=v?(y=!1,b=1):f<=v&&d<=g?(y=!0,b=1):f<d==g<v?(y=!1,b=Math.min(g/f,v/d)):(y=!0,b=Math.min(v/f,g/d)),y&&(y=90),y?(s=b*d,l=b*f):(s=b*f,l=b*d),\"h\"===a?e<t?(u=e+h+s/2,c=(r+n)/2):(u=e-h-s/2,c=(r+n)/2):n>r?(u=(t+e)/2,c=n-h-l/2):(u=(t+e)/2,c=n+h+l/2),o(p,m,u,c,b,y)}function a(t,e,r,n,i,a){var s,l=\"h\"===a?Math.abs(n-r):Math.abs(e-t);l>2*D&&(l-=2*(s=D));var u,c,h,f,d=\"h\"===a?Math.min(1,l/i.height):Math.min(1,l/i.width),p=(i.left+i.right)/2,m=(i.top+i.bottom)/2;return u=d*i.width,c=d*i.height,\"h\"===a?e<t?(h=e-s-u/2,f=(r+n)/2):(h=e+s+u/2,f=(r+n)/2):n>r?(h=(t+e)/2,f=n+s+c/2):(h=(t+e)/2,f=n-s-c/2),o(p,m,h,f,d,!1)}function o(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 s(t,e){var r=d(t.text,e);return p(S,r)}function l(t,e){var r=d(t.textposition,e);return m(E,r)}function u(t,e,r){return f(L,t.textfont,e,r)}function c(t,e,r){return f(C,t.insidetextfont,e,r)}function h(t,e,r){return f(z,t.outsidetextfont,e,r)}function f(t,e,r,n){var i=d((e=e||{}).family,r),a=d(e.size,r),o=d(e.color,r);return{family:p(t.family,i,n.family),size:g(t.size,a,n.size),color:v(t.color,o,n.color)}}function d(t,e){var r;return Array.isArray(t)?e<t.length&&(r=t[e]):r=t,r}function p(t,e,r){if(\"string\"==typeof e){if(e||!t.noBlank)return e}else if(\"number\"==typeof e&&!t.strict)return String(e);return void 0!==r?r:t.dflt}function m(t,e,r){return t.coerceNumber&&(e=+e),-1!==t.values.indexOf(e)?e:void 0!==r?r:t.dflt}function g(t,e,r){if(b(e)){e=+e;var n=t.min,i=t.max;if(!(void 0!==n&&e<n||void 0!==i&&e>i))return e}return void 0!==r?r:t.dflt}function v(t,e,r){return x(e).isValid()?e:void 0!==r?r:t.dflt}var y=t(\"d3\"),b=t(\"fast-isnumeric\"),x=t(\"tinycolor2\"),_=t(\"../../lib\"),w=t(\"../../lib/svg_text_utils\"),M=t(\"../../components/color\"),k=t(\"../../components/drawing\"),A=t(\"../../components/errorbars\"),T=t(\"./attributes\"),S=T.text,E=T.textposition,L=T.textfont,C=T.insidetextfont,z=T.outsidetextfont,D=3;e.exports=function(t,e,r){var i=e.xaxis,a=e.yaxis,o=t._fullLayout,s=e.plot.select(\".barlayer\").selectAll(\"g.trace.bars\").data(r);s.enter().append(\"g\").attr(\"class\",\"trace bars\"),s.append(\"g\").attr(\"class\",\"points\").each(function(e){var r=e[0].t,s=e[0].trace,l=r.poffset,u=Array.isArray(l);y.select(this).selectAll(\"g.point\").data(_.identity).enter().append(\"g\").classed(\"point\",!0).each(function(r,c){function h(t){return 0===o.bargap&&0===o.bargroupgap?y.round(Math.round(t)-A,2):t}function f(t,e){return Math.abs(t-e)>=2?h(t):t>e?Math.ceil(t):Math.floor(t)}var d,p,m,g,v=r.p+(u?l[c]:l),x=v+r.w,_=r.b,w=_+r.s;if(\"h\"===s.orientation?(m=a.c2p(v,!0),g=a.c2p(x,!0),d=i.c2p(_,!0),p=i.c2p(w,!0)):(d=i.c2p(v,!0),p=i.c2p(x,!0),m=a.c2p(_,!0),g=a.c2p(w,!0)),b(d)&&b(p)&&b(m)&&b(g)&&d!==p&&m!==g){var k=(r.mlw+1||s.marker.line.width+1||(r.trace?r.trace.marker.line.width:0)+1)-1,A=y.round(k/2%1,2);if(!t._context.staticPlot){var T=M.opacity(r.mc||s.marker.color)<1||k>.01?h:f;p=T(p,d=T(d,p)),g=T(g,m=T(m,g))}var S=y.select(this);S.append(\"path\").attr(\"d\",\"M\"+d+\",\"+m+\"V\"+g+\"H\"+p+\"V\"+m+\"Z\"),n(t,S,e,c,d,p,m,g)}else y.select(this).remove()})}),s.call(A.plot,e)}},{\"../../components/color\":578,\"../../components/drawing\":602,\"../../components/errorbars\":608,\"../../lib\":685,\"../../lib/svg_text_utils\":704,\"./attributes\":812,d3:107,\"fast-isnumeric\":116,tinycolor2:514}],820:[function(t,e,r){\"use strict\";function n(t,e,r,n){if(n.length){var s,l,u,c,h=t._fullLayout.barmode,f=\"group\"===h;if(\"overlay\"===h)i(t,e,r,n);else if(f){for(s=[],l=[],u=0;u<n.length;u++)void 0===(c=n[u])[0].trace.offset?l.push(c):s.push(c);l.length&&a(t,e,r,l),s.length&&i(t,e,r,s)}else{for(s=[],l=[],u=0;u<n.length;u++)void 0===(c=n[u])[0].trace.base?l.push(c):s.push(c);l.length&&o(t,e,r,l),s.length&&i(t,e,r,s)}}}function i(t,e,r,n){for(var i=t._fullLayout.barnorm,a=!i,o=0;o<n.length;o++){var l=n[o],u=new w([l],!1,a);s(t,e,u),i?(m(t,r,u),g(t,r,u)):d(t,r,u)}}function a(t,e,r,n){var i=t._fullLayout.barnorm,a=new w(n,!1,!i);l(t,e,a),i?(m(t,r,a),g(t,r,a)):d(t,r,a)}function o(t,e,r,n){var i=t._fullLayout.barmode,a=\"stack\"===i,o=\"relative\"===i,l=t._fullLayout.barnorm,u=new w(n,o,!(l||a||o));s(t,e,u),p(t,r,u);for(var c=0;c<n.length;c++)for(var h=n[c],f=0;f<h.length;f++){var d=h[f];d.s!==b&&(d.b+d.s===u.get(d.p,d.s)&&(d._outmost=!0))}l&&g(t,r,u)}function s(t,e,r){var n,i,a=t._fullLayout,o=a.bargap,s=a.bargroupgap,l=r.minDiff,f=r.traces,d=l*(1-o),p=d*(1-s),m=-p/2;for(n=0;n<f.length;n++)(i=f[n][0].t).barwidth=p,i.poffset=m,i.bargroupwidth=d;r.binWidth=f[0][0].t.barwidth/100,u(r),c(t,e,r),h(t,e,r)}function l(t,e,r){var n,i,a,o=t._fullLayout,s=o.bargap,l=o.bargroupgap,f=r.positions,d=r.distinctPositions,p=r.minDiff,m=r.traces,g=f.length!==d.length,v=m.length,y=p*(1-s),b=g?y/v:y,x=b*(1-l);for(n=0;n<v;n++){i=m[n][0];var _=g?((2*n+1-v)*b-x)/2:-x/2;(a=i.t).barwidth=x,a.poffset=_,a.bargroupwidth=y}r.binWidth=m[0][0].t.barwidth/100,u(r),c(t,e,r),h(t,e,r,g)}function u(t){var e,r,n,i,a,o,s=t.traces;for(e=0;e<s.length;e++){i=(n=(r=s[e])[0]).trace,o=n.t;var l,u=i.offset,c=o.poffset;if(Array.isArray(u)){for(l=u.slice(0,r.length),a=0;a<l.length;a++)y(l[a])||(l[a]=c);for(a=l.length;a<r.length;a++)l.push(c);o.poffset=l}else void 0!==u&&(o.poffset=u);var h=i.width,f=o.barwidth;if(Array.isArray(h)){var d=h.slice(0,r.length);for(a=0;a<d.length;a++)y(d[a])||(d[a]=f);for(a=d.length;a<r.length;a++)d.push(f);if(o.barwidth=d,void 0===u){for(l=[],a=0;a<r.length;a++)l.push(c+(f-d[a])/2);o.poffset=l}}else void 0!==h&&(o.barwidth=h,void 0===u&&(o.poffset=c+(f-h)/2))}}function c(t,e,r){for(var n=r.traces,i=v(e),a=0;a<n.length;a++)for(var o=n[a],s=o[0].t,l=s.poffset,u=Array.isArray(l),c=s.barwidth,h=Array.isArray(c),f=0;f<o.length;f++){var d=o[f],p=d.w=h?c[f]:c;d[i]=d.p+(u?l[f]:l)+p/2}}function h(t,e,r,n){var i=r.traces,a=r.distinctPositions,o=a[0],s=r.minDiff,l=s/2;_.minDtick(e,s,o,n);for(var u=Math.min.apply(Math,a)-l,c=Math.max.apply(Math,a)+l,h=0;h<i.length;h++){var f=i[h],d=f[0],p=d.trace;if(void 0!==p.width||void 0!==p.offset)for(var m=d.t,g=m.poffset,v=m.barwidth,y=Array.isArray(g),b=Array.isArray(v),x=0;x<f.length;x++){var w=f[x],M=y?g[x]:g,k=b?v[x]:v,A=w.p+M,T=A+k;u=Math.min(u,A),c=Math.max(c,T)}}_.expand(e,[u,c],{padded:!1})}function f(t,e){y(t[0])?t[0]=Math.min(t[0],e):t[0]=e,y(t[1])?t[1]=Math.max(t[1],e):t[1]=e}function d(t,e,r){for(var n=r.traces,i=v(e),a=e.l2c(e.c2l(0)),o=[a,a],s=0;s<n.length;s++)for(var l=n[s],u=0;u<l.length;u++){var c=l[u],h=c.b,d=h+c.s;c[i]=d,y(e.c2l(d))&&f(o,d),y(e.c2l(h))&&f(o,h)}_.expand(e,o,{tozero:!0,padded:!0})}function p(t,e,r){var n,i,a,o,s=t._fullLayout.barnorm,l=v(e),u=r.traces,c=e.l2c(e.c2l(0)),h=[c,c];for(n=0;n<u.length;n++)for(i=u[n],a=0;a<i.length;a++)if((o=i[a]).s!==b){var d=r.put(o.p,o.b+o.s),p=d+o.b+o.s;o.b=d,o[l]=p,s||(y(e.c2l(p))&&f(h,p),y(e.c2l(d))&&f(h,d))}s||_.expand(e,h,{tozero:!0,padded:!0})}function m(t,e,r){for(var n=r.traces,i=0;i<n.length;i++)for(var a=n[i],o=0;o<a.length;o++){var s=a[o];s.s!==b&&r.put(s.p,s.b+s.s)}}function g(t,e,r){function n(t){y(e.c2l(t))&&(t<l-s||t>u+s||!y(l))&&(h=!0,f(c,t))}for(var i=r.traces,a=v(e),o=\"fraction\"===t._fullLayout.barnorm?1:100,s=o/1e9,l=e.l2c(e.c2l(0)),u=\"stack\"===t._fullLayout.barmode?o:l,c=[l,u],h=!1,d=0;d<i.length;d++)for(var p=i[d],m=0;m<p.length;m++){var g=p[m];if(g.s!==b){var x=Math.abs(o/r.get(g.p,g.s));g.b*=x,g.s*=x;var w=g.b,M=w+g.s;g[a]=M,n(M),n(w)}}_.expand(e,c,{tozero:!0,padded:h})}function v(t){return t._id.charAt(0)}var y=t(\"fast-isnumeric\"),b=t(\"../../constants/numerical\").BADNUM,x=t(\"../../registry\"),_=t(\"../../plots/cartesian/axes\"),w=t(\"./sieve.js\");e.exports=function(t,e){var r,i=e.xaxis,a=e.yaxis,o=t._fullData,s=t.calcdata,l=[],u=[];for(r=0;r<o.length;r++){var c=o[r];!0===c.visible&&x.traceIs(c,\"bar\")&&c.xaxis===i._id&&c.yaxis===a._id&&(\"h\"===c.orientation?l.push(s[r]):u.push(s[r]))}n(t,i,a,u),n(t,a,i,l)}},{\"../../constants/numerical\":666,\"../../plots/cartesian/axes\":724,\"../../registry\":802,\"./sieve.js\":821,\"fast-isnumeric\":116}],821:[function(t,e,r){\"use strict\";function n(t,e,r){this.traces=t,this.separateNegativeValues=e,this.dontMergeOverlappingData=r;for(var n=[],o=0;o<t.length;o++)for(var s=t[o],l=0;l<s.length;l++){var u=s[l];u.p!==a&&n.push(u.p)}this.positions=n;var c=i.distinctVals(this.positions);this.distinctPositions=c.vals,this.minDiff=c.minDiff,this.binWidth=this.minDiff,this.bins={}}e.exports=n;var i=t(\"../../lib\"),a=t(\"../../constants/numerical\").BADNUM;n.prototype.put=function(t,e){var r=this.getLabel(t,e),n=this.bins[r]||0;return this.bins[r]=n+e,n},n.prototype.get=function(t,e){var r=this.getLabel(t,e);return this.bins[r]||0},n.prototype.getLabel=function(t,e){return(e<0&&this.separateNegativeValues?\"v\":\"^\")+(this.dontMergeOverlappingData?t:Math.round(t/this.binWidth))}},{\"../../constants/numerical\":666,\"../../lib\":685}],822:[function(t,e,r){\"use strict\";var n=t(\"d3\"),i=t(\"../../components/color\"),a=t(\"../../components/drawing\"),o=t(\"../../components/errorbars\");e.exports=function(t){var e=n.select(t).selectAll(\"g.trace.bars\"),r=e.size(),s=t._fullLayout;e.style(\"opacity\",function(t){return t[0].trace.opacity}).each(function(t){(\"stack\"===s.barmode&&r>1||0===s.bargap&&0===s.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr(\"shape-rendering\",\"crispEdges\")}),e.selectAll(\"g.points\").each(function(t){var e=t[0].trace.marker,r=e.line,o=a.tryColorscale(e,\"\"),s=a.tryColorscale(e,\"line\");n.select(this).selectAll(\"path\").each(function(t){var a,l,u=(t.mlw+1||r.width+1)-1,c=n.select(this);a=\"mc\"in t?t.mcc=o(t.mc):Array.isArray(e.color)?i.defaultLine:e.color,c.style(\"stroke-width\",u+\"px\").call(i.fill,a),u&&(l=\"mlc\"in t?t.mlcc=s(t.mlc):Array.isArray(r.color)?i.defaultLine:r.color,c.call(i.stroke,l))})}),e.call(o.style)}},{\"../../components/color\":578,\"../../components/drawing\":602,\"../../components/errorbars\":608,d3:107}],823:[function(t,e,r){\"use strict\";var n=t(\"../../components/color\"),i=t(\"../../components/colorscale/has_colorscale\"),a=t(\"../../components/colorscale/defaults\");e.exports=function(t,e,r,o,s){r(\"marker.color\",o),i(t,\"marker\")&&a(t,e,s,r,{prefix:\"marker.\",cLetter:\"c\"}),r(\"marker.line.color\",n.defaultLine),i(t,\"marker.line\")&&a(t,e,s,r,{prefix:\"marker.line.\",cLetter:\"c\"}),r(\"marker.line.width\")}},{\"../../components/color\":578,\"../../components/colorscale/defaults\":587,\"../../components/colorscale/has_colorscale\":591}],824:[function(t,e,r){\"use strict\";var n=t(\"../scatter/attributes\"),i=t(\"../../components/color/attributes\"),a=t(\"../../lib/extend\").extendFlat,o=n.marker,s=o.line;e.exports={y:{valType:\"data_array\"},x:{valType:\"data_array\"},x0:{valType:\"any\"},y0:{valType:\"any\"},xcalendar:n.xcalendar,ycalendar:n.ycalendar,whiskerwidth:{valType:\"number\",min:0,max:1,dflt:.5},boxpoints:{valType:\"enumerated\",values:[\"all\",\"outliers\",\"suspectedoutliers\",!1],dflt:\"outliers\"},boxmean:{valType:\"enumerated\",values:[!0,\"sd\",!1],dflt:!1},jitter:{valType:\"number\",min:0,max:1},pointpos:{valType:\"number\",min:-2,max:2},orientation:{valType:\"enumerated\",values:[\"v\",\"h\"]},marker:{outliercolor:{valType:\"color\",dflt:\"rgba(0, 0, 0, 0)\"},symbol:a({},o.symbol,{arrayOk:!1}),opacity:a({},o.opacity,{arrayOk:!1,dflt:1}),size:a({},o.size,{arrayOk:!1}),color:a({},o.color,{arrayOk:!1}),line:{color:a({},s.color,{arrayOk:!1,dflt:i.defaultLine}),width:a({},s.width,{arrayOk:!1,dflt:0}),outliercolor:{valType:\"color\"},outlierwidth:{valType:\"number\",min:0,dflt:1}}},line:{color:{valType:\"color\"},width:{valType:\"number\",min:0,dflt:2}},fillcolor:n.fillcolor}},{\"../../components/color/attributes\":577,\"../../lib/extend\":677,\"../scatter/attributes\":976}],825:[function(t,e,r){\"use strict\";var n=t(\"fast-isnumeric\"),i=t(\"../../lib\"),a=t(\"../../plots/cartesian/axes\");e.exports=function(t,e){var r,o,s,l,u,c,h,f,d,p=a.getFromId(t,e.xaxis||\"x\"),m=a.getFromId(t,e.yaxis||\"y\"),g=[];\"h\"===e.orientation?(r=p,o=\"x\",u=m,c=\"y\"):(r=m,o=\"y\",u=p,c=\"x\"),s=r.makeCalcdata(e,o),a.expand(r,s,{padded:!0}),h=function(t,e,r,a,o){var s;return r in e?h=a.makeCalcdata(e,r):(s=r+\"0\"in e?e[r+\"0\"]:\"name\"in e&&(\"category\"===a.type||n(e.name)&&-1!==[\"linear\",\"log\"].indexOf(a.type)||i.isDateTime(e.name)&&\"date\"===a.type)?e.name:t.numboxes,s=a.d2c(s,0,e[r+\"calendar\"]),h=o.map(function(){return s})),h}(t,e,c,u,s);var v=i.distinctVals(h);return f=v.vals,d=v.minDiff/2,l=function(t,e,r,a,o){var s,l,u,c,h=a.length,f=e.length,d=[],p=[];for(s=0;s<h;++s)l=a[s],t[s]={pos:l},p[s]=l-o,d[s]=[];for(p.push(a[h-1]+o),s=0;s<f;++s)c=e[s],n(c)&&(u=i.findBin(r[s],p))>=0&&u<f&&d[u].push(c);return d}(g,s,h,f,d),function(t,e){var r,n,a,o;for(o=0;o<e.length;++o)n=(r=e[o].sort(i.sorterAsc)).length,(a=t[o]).val=r,a.min=r[0],a.max=r[n-1],a.mean=i.mean(r,n),a.sd=i.stdev(r,n,a.mean),a.q1=i.interp(r,.25),a.med=i.interp(r,.5),a.q3=i.interp(r,.75),a.lf=Math.min(a.q1,r[Math.min(i.findBin(2.5*a.q1-1.5*a.q3,r,!0)+1,n-1)]),a.uf=Math.max(a.q3,r[Math.max(i.findBin(2.5*a.q3-1.5*a.q1,r),0)]),a.lo=4*a.q1-3*a.q3,a.uo=4*a.q3-3*a.q1}(g,l),(g=g.filter(function(t){return t.val&&t.val.length})).length?(g[0].t={boxnum:t.numboxes,dPos:d},t.numboxes++,g):[{t:{emptybox:!0}}]}},{\"../../lib\":685,\"../../plots/cartesian/axes\":724,\"fast-isnumeric\":116}],826:[function(t,e,r){\"use strict\";var n=t(\"../../lib\"),i=t(\"../../registry\"),a=t(\"../../components/color\"),o=t(\"./attributes\");e.exports=function(t,e,r,s){function l(r,i){return n.coerce(t,e,o,r,i)}var u,c=l(\"y\"),h=l(\"x\");if(c&&c.length)u=\"v\",h||l(\"x0\");else{if(!h||!h.length)return void(e.visible=!1);u=\"h\",l(\"y0\")}i.getComponentMethod(\"calendars\",\"handleTraceDefaults\")(t,e,[\"x\",\"y\"],s),l(\"orientation\",u),l(\"line.color\",(t.marker||{}).color||r),l(\"line.width\",2),l(\"fillcolor\",a.addOpacity(e.line.color,.5)),l(\"whiskerwidth\"),l(\"boxmean\");var f=n.coerce2(t,e,o,\"marker.outliercolor\"),d=l(\"marker.line.outliercolor\"),p=f||d?l(\"boxpoints\",\"suspectedoutliers\"):l(\"boxpoints\");p&&(l(\"jitter\",\"all\"===p?.3:0),l(\"pointpos\",\"all\"===p?-1.5:0),l(\"marker.symbol\"),l(\"marker.opacity\"),l(\"marker.size\"),l(\"marker.color\",e.line.color),l(\"marker.line.color\"),l(\"marker.line.width\"),\"suspectedoutliers\"===p&&(l(\"marker.line.outliercolor\",e.marker.color),l(\"marker.line.outlierwidth\")))}},{\"../../components/color\":578,\"../../lib\":685,\"../../registry\":802,\"./attributes\":824}],827:[function(t,e,r){\"use strict\";var n=t(\"../../plots/cartesian/axes\"),i=t(\"../../plots/cartesian/graph_interact\"),a=t(\"../../lib\"),o=t(\"../../components/color\");e.exports=function(t,e,r,s){var l,u,c,h,f,d,p,m,g,v=t.cd,y=v[0].trace,b=v[0].t,x=t.xa,_=t.ya,w=[];if(h=\"closest\"===s?2.5*b.bdPos:b.bdPos,\"h\"===y.orientation?(l=function(t){return i.inbox(t.min-e,t.max-e)},u=function(t){var e=t.pos+b.bPos-r;return i.inbox(e-h,e+h)},f=\"y\",d=_,m=\"x\",g=x):(l=function(t){var r=t.pos+b.bPos-e;return i.inbox(r-h,r+h)},u=function(t){return i.inbox(t.min-r,t.max-r)},f=\"x\",d=x,m=\"y\",g=_),c=i.getDistanceFunction(s,l,u),i.getClosest(v,c,t),!1!==t.index){var M=v[t.index],k=y.line.color,A=(y.marker||{}).color;o.opacity(k)&&y.line.width?t.color=k:o.opacity(A)&&y.boxpoints?t.color=A:t.color=y.fillcolor,t[f+\"0\"]=d.c2p(M.pos+b.bPos-b.bdPos,!0),t[f+\"1\"]=d.c2p(M.pos+b.bPos+b.bdPos,!0),n.tickText(d,d.c2l(M.pos),\"hover\").text,t[f+\"LabelVal\"]=M.pos;var T,S,E={},L=[\"med\",\"min\",\"q1\",\"q3\",\"max\"];y.boxmean&&L.push(\"mean\"),y.boxpoints&&[].push.apply(L,[\"lf\",\"uf\"]);for(var C=0;C<L.length;C++)(T=L[C])in M&&!(M[T]in E)&&(E[M[T]]=!0,p=g.c2p(M[T],!0),(S=a.extendFlat({},t))[m+\"0\"]=S[m+\"1\"]=p,S[m+\"LabelVal\"]=M[T],S.attr=T,\"mean\"===T&&\"sd\"in M&&\"sd\"===y.boxmean&&(S[m+\"err\"]=M.sd),t.name=\"\",w.push(S));return w}}},{\"../../components/color\":578,\"../../lib\":685,\"../../plots/cartesian/axes\":724,\"../../plots/cartesian/graph_interact\":733}],828:[function(t,e,r){\"use strict\";var n={};n.attributes=t(\"./attributes\"),n.layoutAttributes=t(\"./layout_attributes\"),n.supplyDefaults=t(\"./defaults\"),n.supplyLayoutDefaults=t(\"./layout_defaults\"),n.calc=t(\"./calc\"),n.setPositions=t(\"./set_positions\"),n.plot=t(\"./plot\"),n.style=t(\"./style\"),n.hoverPoints=t(\"./hover\"),n.moduleType=\"trace\",n.name=\"box\",n.basePlotModule=t(\"../../plots/cartesian\"),n.categories=[\"cartesian\",\"symbols\",\"oriented\",\"box\",\"showLegend\"],n.meta={},e.exports=n},{\"../../plots/cartesian\":734,\"./attributes\":824,\"./calc\":825,\"./defaults\":826,\"./hover\":827,\"./layout_attributes\":829,\"./layout_defaults\":830,\"./plot\":831,\"./set_positions\":832,\"./style\":833}],829:[function(t,e,r){\"use strict\";e.exports={boxmode:{valType:\"enumerated\",values:[\"group\",\"overlay\"],dflt:\"overlay\"},boxgap:{valType:\"number\",min:0,max:1,dflt:.3},boxgroupgap:{valType:\"number\",min:0,max:1,dflt:.3}}},{}],830:[function(t,e,r){\"use strict\";var n=t(\"../../registry\"),i=t(\"../../lib\"),a=t(\"./layout_attributes\");e.exports=function(t,e,r){function o(r,n){return i.coerce(t,e,a,r,n)}for(var s,l=0;l<r.length;l++)if(n.traceIs(r[l],\"box\")){s=!0;break}s&&(o(\"boxmode\"),o(\"boxgap\"),o(\"boxgroupgap\"))}},{\"../../lib\":685,\"../../registry\":802,\"./layout_attributes\":829}],831:[function(t,e,r){\"use strict\";function n(){l=2e9}function i(){var t=l;return l=(69069*l+1)%4294967296,Math.abs(l-t)<429496729?i():l/4294967296}var a=t(\"d3\"),o=t(\"../../lib\"),s=t(\"../../components/drawing\"),l=2e9;e.exports=function(t,e,r){var l,u,c=t._fullLayout,h=e.xaxis,f=e.yaxis;e.plot.select(\".boxlayer\").selectAll(\"g.trace.boxes\").data(r).enter().append(\"g\").attr(\"class\",\"trace boxes\").each(function(e){var r=e[0].t,d=e[0].trace,p=\"group\"===c.boxmode&&t.numboxes>1,m=r.dPos*(1-c.boxgap)*(1-c.boxgroupgap)/(p?t.numboxes:1),g=p?2*r.dPos*((r.boxnum+.5)/t.numboxes-.5)*(1-c.boxgap):0,v=m*d.whiskerwidth;!0!==d.visible||r.emptybox?a.select(this).remove():(\"h\"===d.orientation?(l=f,u=h):(l=h,u=f),r.bPos=g,r.bdPos=m,n(),a.select(this).selectAll(\"path.box\").data(o.identity).enter().append(\"path\").attr(\"class\",\"box\").each(function(t){var e=l.c2p(t.pos+g,!0),r=l.c2p(t.pos+g-m,!0),n=l.c2p(t.pos+g+m,!0),i=l.c2p(t.pos+g-v,!0),s=l.c2p(t.pos+g+v,!0),c=u.c2p(t.q1,!0),h=u.c2p(t.q3,!0),f=o.constrain(u.c2p(t.med,!0),Math.min(c,h)+1,Math.max(c,h)-1),p=u.c2p(!1===d.boxpoints?t.min:t.lf,!0),y=u.c2p(!1===d.boxpoints?t.max:t.uf,!0);\"h\"===d.orientation?a.select(this).attr(\"d\",\"M\"+f+\",\"+r+\"V\"+n+\"M\"+c+\",\"+r+\"V\"+n+\"H\"+h+\"V\"+r+\"ZM\"+c+\",\"+e+\"H\"+p+\"M\"+h+\",\"+e+\"H\"+y+(0===d.whiskerwidth?\"\":\"M\"+p+\",\"+i+\"V\"+s+\"M\"+y+\",\"+i+\"V\"+s)):a.select(this).attr(\"d\",\"M\"+r+\",\"+f+\"H\"+n+\"M\"+r+\",\"+c+\"H\"+n+\"V\"+h+\"H\"+r+\"ZM\"+e+\",\"+c+\"V\"+p+\"M\"+e+\",\"+h+\"V\"+y+(0===d.whiskerwidth?\"\":\"M\"+i+\",\"+p+\"H\"+s+\"M\"+i+\",\"+y+\"H\"+s))}),d.boxpoints&&a.select(this).selectAll(\"g.points\").data(function(t){return t.forEach(function(t){t.t=r,t.trace=d}),t}).enter().append(\"g\").attr(\"class\",\"points\").selectAll(\"path\").data(function(t){var e,r,n,a,s,l,u,c=\"all\"===d.boxpoints?t.val:t.val.filter(function(e){return e<t.lf||e>t.uf}),h=Math.max((t.max-t.min)/10,t.q3-t.q1),f=1e-9*h,p=.01*h,v=[],y=0;if(d.jitter){if(0===h)for(y=1,v=new Array(c.length),e=0;e<c.length;e++)v[e]=1;else for(e=0;e<c.length;e++)a=c[r=Math.max(0,e-5)],s=c[n=Math.min(c.length-1,e+5)],\"all\"!==d.boxpoints&&(c[e]<t.lf?s=Math.min(s,t.lf):a=Math.max(a,t.uf)),l=Math.sqrt(p*(n-r)/(s-a+f))||0,l=o.constrain(Math.abs(l),0,1),v.push(l),y=Math.max(l,y);u=2*d.jitter/y}return c.map(function(e,r){var n,a=d.pointpos;return d.jitter&&(a+=u*v[r]*(i()-.5)),n=\"h\"===d.orientation?{y:t.pos+a*m+g,x:e}:{x:t.pos+a*m+g,y:e},\"suspectedoutliers\"===d.boxpoints&&e<t.uo&&e>t.lo&&(n.so=!0),n})}).enter().append(\"path\").call(s.translatePoints,h,f),d.boxmean&&a.select(this).selectAll(\"path.mean\").data(o.identity).enter().append(\"path\").attr(\"class\",\"mean\").style(\"fill\",\"none\").each(function(t){var e=l.c2p(t.pos+g,!0),r=l.c2p(t.pos+g-m,!0),n=l.c2p(t.pos+g+m,!0),i=u.c2p(t.mean,!0),o=u.c2p(t.mean-t.sd,!0),s=u.c2p(t.mean+t.sd,!0);\"h\"===d.orientation?a.select(this).attr(\"d\",\"M\"+i+\",\"+r+\"V\"+n+(\"sd\"!==d.boxmean?\"\":\"m0,0L\"+o+\",\"+e+\"L\"+i+\",\"+r+\"L\"+s+\",\"+e+\"Z\")):a.select(this).attr(\"d\",\"M\"+r+\",\"+i+\"H\"+n+(\"sd\"!==d.boxmean?\"\":\"m0,0L\"+e+\",\"+o+\"L\"+r+\",\"+i+\"L\"+e+\",\"+s+\"Z\"))}))})}},{\"../../components/drawing\":602,\"../../lib\":685,d3:107}],832:[function(t,e,r){\"use strict\";var n=t(\"../../registry\"),i=t(\"../../plots/cartesian/axes\"),a=t(\"../../lib\");e.exports=function(t,e){var r,o,s,l,u=t._fullLayout,c=e.xaxis,h=e.yaxis,f=[\"v\",\"h\"];for(o=0;o<f.length;++o){var d,p,m,g=f[o],v=[],y=[],b=0,x=0;for(r=\"h\"===g?h:c,s=0;s<t.calcdata.length;++s)p=(d=t.calcdata[s])[0].t,!0===(m=d[0].trace).visible&&n.traceIs(m,\"box\")&&!p.emptybox&&m.orientation===g&&m.xaxis===c._id&&m.yaxis===h._id&&(v.push(s),!1!==m.boxpoints&&(b=Math.max(b,m.jitter-m.pointpos-1),x=Math.max(x,m.jitter+m.pointpos-1)));for(s=0;s<v.length;s++)for(d=t.calcdata[v[s]],l=0;l<d.length;l++)y.push(d[l].pos);if(y.length){var _=a.distinctVals(y),w=_.minDiff/2;for(y.length===_.vals.length&&(t.numboxes=1),i.minDtick(r,_.minDiff,_.vals[0],!0),o=0;o<v.length;o++){var M=v[o];t.calcdata[M][0].t.dPos=w}var k=(1-u.boxgap)*(1-u.boxgroupgap)*w/t.numboxes;i.expand(r,_.vals,{vpadminus:w+b*k,vpadplus:w+x*k})}}}},{\"../../lib\":685,\"../../plots/cartesian/axes\":724,\"../../registry\":802}],833:[function(t,e,r){\"use strict\";var n=t(\"d3\"),i=t(\"../../components/color\"),a=t(\"../../components/drawing\");e.exports=function(t){n.select(t).selectAll(\"g.trace.boxes\").style(\"opacity\",function(t){return t[0].trace.opacity}).each(function(t){var e=t[0].trace,r=e.line.width;n.select(this).selectAll(\"path.box\").style(\"stroke-width\",r+\"px\").call(i.stroke,e.line.color).call(i.fill,e.fillcolor),n.select(this).selectAll(\"path.mean\").style({\"stroke-width\":r,\"stroke-dasharray\":2*r+\"px,\"+r+\"px\"}).call(i.stroke,e.line.color),n.select(this).selectAll(\"g.points path\").call(a.pointStyle,e)})}},{\"../../components/color\":578,\"../../components/drawing\":602,d3:107}],834:[function(t,e,r){\"use strict\";var n=t(\"../../lib\"),i=t(\"../ohlc/attributes\"),a=t(\"../box/attributes\"),o={name:i.increasing.name,showlegend:i.increasing.showlegend,line:{color:n.extendFlat({},a.line.color),width:n.extendFlat({},a.line.width)},fillcolor:n.extendFlat({},a.fillcolor)};e.exports={x:i.x,open:i.open,high:i.high,low:i.low,close:i.close,line:{width:n.extendFlat({},a.line.width,{})},increasing:n.extendDeep({},o,{line:{color:{dflt:i.increasing.line.color.dflt}}}),decreasing:n.extendDeep({},o,{line:{color:{dflt:i.decreasing.line.color.dflt}}}),text:i.text,whiskerwidth:n.extendFlat({},a.whiskerwidth,{dflt:0})}},{\"../../lib\":685,\"../box/attributes\":824,\"../ohlc/attributes\":943}],835:[function(t,e,r){\"use strict\";function n(t,e,r,n){o(t,e,r,n),r(n+\".line.color\"),r(n+\".line.width\",e.line.width),r(n+\".fillcolor\")}var i=t(\"../../lib\"),a=t(\"../ohlc/ohlc_defaults\"),o=t(\"../ohlc/direction_defaults\"),s=t(\"../ohlc/helpers\"),l=t(\"./attributes\");e.exports=function(t,e,r,o){function u(r,n){return i.coerce(t,e,l,r,n)}s.pushDummyTransformOpts(t,e),0!==a(t,e,u,o)?(u(\"line.width\"),n(t,e,u,\"increasing\"),n(t,e,u,\"decreasing\"),u(\"text\"),u(\"whiskerwidth\")):e.visible=!1}},{\"../../lib\":685,\"../ohlc/direction_defaults\":945,\"../ohlc/helpers\":946,\"../ohlc/ohlc_defaults\":948,\"./attributes\":834}],836:[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\":714,\"../../plots/cartesian\":734,\"../box\":828,\"./attributes\":834,\"./defaults\":835,\"./transform\":837}],837:[function(t,e,r){\"use strict\";function n(t,e,r){var n={type:\"box\",boxpoints:!1,visible:t.visible,hoverinfo:t.hoverinfo,opacity:t.opacity,xaxis:t.xaxis,yaxis:t.yaxis,transforms:a.makeTransform(t,e,r)},o=t[r];return o&&i.extendFlat(n,{x:t.x||[0],xcalendar:t.xcalendar,y:[].concat(t.low).concat(t.high),whiskerwidth:t.whiskerwidth,text:t.text,name:o.name,showlegend:o.showlegend,line:o.line,fillcolor:o.fillcolor}),n}var i=t(\"../../lib\"),a=t(\"../ohlc/helpers\");r.moduleType=\"transform\",r.name=\"candlestick\",r.attributes={},r.supplyDefaults=function(t,e,r,n){return a.clearEphemeralTransformOpts(n),a.copyOHLC(t,e),t},r.transform=function(t,e){for(var r=[],i=0;i<t.length;i++){var o=t[i];\"candlestick\"===o.type?r.push(n(o,e,\"increasing\"),n(o,e,\"decreasing\")):r.push(o)}return a.addRangeSlider(r,e.layout),r},r.calcTransform=function(t,e,r){for(var n=r.direction,i=a.getFilterFn(n),o=e.open,s=e.high,l=e.low,u=e.close,c=o.length,h=[],f=[],d=e._fullInput.x?function(t){var r=e.x[t];h.push(r,r,r,r,r,r)}:function(t){h.push(t,t,t,t,t,t)},p=0;p<c;p++)i(o[p],u[p])&&(d(p),function(t,e,r,n){f.push(r,t,n,n,n,e)}(o[p],s[p],l[p],u[p]));e.x=h,e.y=f}},{\"../../lib\":685,\"../ohlc/helpers\":946}],838:[function(t,e,r){\"use strict\";function n(t,e,r,n){[\"aaxis\",\"baxis\"].forEach(function(a){var o=a.charAt(0),s=t[a]||{},l={},u={tickfont:\"x\",id:o+\"axis\",letter:o,font:e.font,name:a,data:t[o],calendar:e.calendar,dfltColor:n,bgColor:r.paper_bgcolor,fullLayout:r};i(s,l,u),l._categories=l._categories||[],e[a]=l,t[a]||\"-\"===s.type||(t[a]={type:s.type})})}var i=t(\"./axis_defaults\");e.exports=function(t,e,r,i,a){i(\"a\")||(i(\"da\"),i(\"a0\")),i(\"b\")||(i(\"db\"),i(\"b0\")),n(t,e,r,a)}},{\"./axis_defaults\":843}],839:[function(t,e,r){\"use strict\";function n(t,e){if(!Array.isArray(t)||e>=10)return null;for(var r=1/0,i=-1/0,a=t.length,o=0;o<a;o++){var s=t[o];if(Array.isArray(s)){var l=n(s,e+1);l&&(r=Math.min(l[0],r),i=Math.max(l[1],i))}else r=Math.min(s,r),i=Math.max(s,i)}return[r,i]}e.exports=function(t){return n(t,0)}},{}],840:[function(t,e,r){\"use strict\";var n=t(\"../../lib/extend\").extendFlat,i=t(\"../../plots/font_attributes\"),a=t(\"./axis_attributes\"),o=t(\"../../components/color/attributes\");e.exports={carpet:{valType:\"string\"},x:{valType:\"data_array\"},y:{valType:\"data_array\"},a:{valType:\"data_array\"},a0:{valType:\"number\",dflt:0},da:{valType:\"number\",dflt:1},b:{valType:\"data_array\"},b0:{valType:\"number\",dflt:0},db:{valType:\"number\",dflt:1},cheaterslope:{valType:\"number\",dflt:1},aaxis:n({},a),baxis:n({},a),font:{family:n({},i.family,{dflt:'\"Open Sans\", verdana, arial, sans-serif'}),size:n({},i.size,{dflt:12}),color:n({},i.color,{dflt:o.defaultLine})},color:{valType:\"color\",dflt:o.defaultLine}}},{\"../../components/color/attributes\":577,\"../../lib/extend\":677,\"../../plots/font_attributes\":748,\"./axis_attributes\":842}],841:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,n){var i,a,o,s,l,u,c,h,f,d,p,m,g,v=Array.isArray(r)?\"a\":\"b\",y=(\"a\"===v?t.aaxis:t.baxis).smoothing,b=\"a\"===v?t.a2i:t.b2j,x=\"a\"===v?r:n,_=\"a\"===v?n:r,w=\"a\"===v?e.a.length:e.b.length,M=\"a\"===v?e.b.length:e.a.length,k=Math.floor(\"a\"===v?t.b2j(_):t.a2i(_)),A=\"a\"===v?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\"===v?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]),S=b(x[1]),E=T<S?1:-1,L=1e-8*(S-T),C=E>0?Math.floor:Math.ceil,z=E>0?Math.ceil:Math.floor,D=E>0?Math.min:Math.max,I=E>0?Math.max:Math.min,P=C(T+L),O=z(S-L),j=[[c=A(T)]];for(i=P;i*E<O*E;i+=E)l=[],p=I(T,i),g=(m=D(S,i+E))-p,u=Math.max(0,Math.min(w-2,Math.floor(.5*(p+m)))),h=A(m),y&&(f=a(u,p-u),d=a(u,m-u),l.push([c[0]+f[0]/3*g,c[1]+f[1]/3*g]),l.push([h[0]-d[0]/3*g,h[1]-d[1]/3*g])),l.push(h),j.push(l),c=h;return j}},{}],842:[function(t,e,r){\"use strict\";var n=t(\"../../lib/extend\").extendFlat,i=t(\"../../plots/font_attributes\"),a=t(\"../../components/color/attributes\");e.exports={color:{valType:\"color\"},smoothing:{valType:\"number\",dflt:1,min:0,max:1.3},title:{valType:\"string\"},titlefont:n({},i,{}),titleoffset:{valType:\"number\",dflt:10},type:{valType:\"enumerated\",values:[\"-\",\"linear\",\"date\",\"category\"],dflt:\"-\"},autorange:{valType:\"enumerated\",values:[!0,!1,\"reversed\"],dflt:!0},rangemode:{valType:\"enumerated\",values:[\"normal\",\"tozero\",\"nonnegative\"],dflt:\"normal\"},range:{valType:\"info_array\",items:[{valType:\"any\"},{valType:\"any\"}]},fixedrange:{valType:\"boolean\",dflt:!1},cheatertype:{valType:\"enumerated\",values:[\"index\",\"value\"],dflt:\"value\"},tickmode:{valType:\"enumerated\",values:[\"linear\",\"array\"],dflt:\"array\"},nticks:{valType:\"integer\",min:0,dflt:0},tickvals:{valType:\"data_array\"},ticktext:{valType:\"data_array\"},showticklabels:{valType:\"enumerated\",values:[\"start\",\"end\",\"both\",\"none\"],dflt:\"start\"},tickfont:n({},i,{}),tickangle:{valType:\"angle\",dflt:\"auto\"},tickprefix:{valType:\"string\",dflt:\"\"},showtickprefix:{valType:\"enumerated\",values:[\"all\",\"first\",\"last\",\"none\"],dflt:\"all\"},ticksuffix:{valType:\"string\",dflt:\"\"},showticksuffix:{valType:\"enumerated\",values:[\"all\",\"first\",\"last\",\"none\"],dflt:\"all\"},showexponent:{valType:\"enumerated\",values:[\"all\",\"first\",\"last\",\"none\"],dflt:\"all\"},exponentformat:{valType:\"enumerated\",values:[\"none\",\"e\",\"E\",\"power\",\"SI\",\"B\"],dflt:\"B\"},separatethousands:{valType:\"boolean\",dflt:!1},tickformat:{valType:\"string\",dflt:\"\"},categoryorder:{valType:\"enumerated\",values:[\"trace\",\"category ascending\",\"category descending\",\"array\"],dflt:\"trace\"},categoryarray:{valType:\"data_array\"},labelpadding:{valType:\"integer\",dflt:10},labelprefix:{valType:\"string\"},labelsuffix:{valType:\"string\",dflt:\"\"},showline:{valType:\"boolean\",dflt:!1},linecolor:{valType:\"color\",dflt:a.defaultLine},linewidth:{valType:\"number\",min:0,dflt:1},gridcolor:{valType:\"color\"},gridwidth:{valType:\"number\",min:0,dflt:1},showgrid:{valType:\"boolean\",dflt:!0},minorgridcount:{valType:\"integer\",min:0,dflt:0},minorgridwidth:{valType:\"number\",min:0,dflt:1},minorgridcolor:{valType:\"color\",dflt:a.lightLine},startline:{valType:\"boolean\"},startlinecolor:{valType:\"color\"},startlinewidth:{valType:\"number\",dflt:1},endline:{valType:\"boolean\"},endlinewidth:{valType:\"number\",dflt:1},endlinecolor:{valType:\"color\"},tick0:{valType:\"number\",min:0,dflt:0},dtick:{valType:\"number\",min:0,dflt:1},arraytick0:{valType:\"integer\",min:0,dflt:0},arraydtick:{valType:\"integer\",min:1,dflt:1}}},{\"../../components/color/attributes\":577,\"../../lib/extend\":677,\"../../plots/font_attributes\":748}],843:[function(t,e,r){\"use strict\";function n(t,e){if(\"-\"===t.type){var r=t[t._id.charAt(0)+\"calendar\"];t.type=d(e,r)}}var i=t(\"./attributes\"),a=t(\"../../components/color\").addOpacity,o=t(\"../../registry\"),s=t(\"../../lib\"),l=t(\"../../plots/cartesian/tick_value_defaults\"),u=t(\"../../plots/cartesian/tick_label_defaults\"),c=t(\"../../plots/cartesian/category_order_defaults\"),h=t(\"../../plots/cartesian/set_convert\"),f=t(\"../../plots/cartesian/ordered_categories\"),d=t(\"../../plots/cartesian/axis_autotype\");e.exports=function(t,e,r){function d(r,n){return s.coerce(t,e,v,r,n)}function p(r,n){return s.coerce2(t,e,v,r,n)}var m=r.letter,g=r.font||{},v=i[m+\"axis\"];r.noHover=!0,r.name&&(e._name=r.name,e._id=r.name);var y=d(\"type\");\"-\"===y&&(r.data&&n(e,r.data),\"-\"===e.type?e.type=\"linear\":y=t.type=e.type),d(\"smoothing\"),d(\"cheatertype\"),d(\"showticklabels\"),d(\"labelprefix\",m+\" = \"),d(\"labelsuffix\"),d(\"showtickprefix\"),d(\"showticksuffix\"),d(\"separatethousands\"),d(\"tickformat\"),d(\"exponentformat\"),d(\"showexponent\"),d(\"categoryorder\"),d(\"tickmode\"),d(\"tickvals\"),d(\"ticktext\"),d(\"tick0\"),d(\"dtick\"),\"array\"===e.tickmode&&(d(\"arraytick0\"),d(\"arraydtick\")),d(\"labelpadding\"),e._hovertitle=m,\"date\"===y&&o.getComponentMethod(\"calendars\",\"handleDefaults\")(t,e,\"calendar\",r.calendar),h(e,r.fullLayout);var b=d(\"color\",r.dfltColor),x=b===t.color?b:g.color;d(\"title\"),s.coerceFont(d,\"titlefont\",{family:g.family,size:Math.round(1.2*g.size),color:x}),d(\"titleoffset\"),d(\"tickangle\"),d(\"autorange\",!e.isValidRange(t.range))&&d(\"rangemode\"),d(\"range\"),e.cleanRange(),d(\"fixedrange\"),l(t,e,d,y),u(t,e,d,y,r),c(t,e,d);var _=p(\"gridcolor\",a(b,.3)),w=p(\"gridwidth\"),M=d(\"showgrid\");M||(delete e.gridcolor,delete e.gridwidth);var k=p(\"startlinecolor\",b),A=p(\"startlinewidth\",w);d(\"startline\",e.showgrid||!!k||!!A)||(delete e.startlinecolor,delete e.startlinewidth);var T=p(\"endlinecolor\",b),S=p(\"endlinewidth\",w);return d(\"endline\",e.showgrid||!!T||!!S)||(delete e.endlinecolor,delete e.endlinewidth),M?(d(\"minorgridcount\"),d(\"minorgridwidth\",w),d(\"minorgridcolor\",a(_,.06)),e.minorgridcount||(delete e.minorgridwidth,delete e.minorgridcolor)):(delete e.gridcolor,delete e.gridWidth),e._separators=r.fullLayout.separators,e._initialCategories=\"category\"===y?f(m,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,d(\"tickmode\"),(!e.title||e.title&&0===e.title.length)&&(delete e.titlefont,delete e.titleoffset),e}},{\"../../components/color\":578,\"../../lib\":685,\"../../plots/cartesian/axis_autotype\":725,\"../../plots/cartesian/category_order_defaults\":728,\"../../plots/cartesian/ordered_categories\":737,\"../../plots/cartesian/set_convert\":741,\"../../plots/cartesian/tick_label_defaults\":742,\"../../plots/cartesian/tick_value_defaults\":744,\"../../registry\":802,\"./attributes\":840}],844:[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\"),u=t(\"./calc_clippath\"),c=t(\"../heatmap/clean_2d_array\"),h=t(\"./smooth_fill_2d_array\");e.exports=function(t,e){var r,f=n.getFromId(t,e.xaxis||\"x\"),d=n.getFromId(t,e.yaxis||\"y\"),p=e.aaxis,m=e.baxis,g=e._a=e.a,v=e._b=e.b,y={},b=e.y;if(e._cheater){var x=\"index\"===p.cheatertype?g.length:g,_=\"index\"===m.cheatertype?v.length:v;e.x=r=i(x,_,e.cheaterslope)}else r=e.x;e._x=e.x=r=c(r),e._y=e.y=b=c(b),h(r,g,v),h(b,g,v),e.setScale(),y.xp=e.xp=o(e.xp,r,f.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]),S=.5*(M[1]+M[0]);return w=[A-1.3*k,A+1.3*k],M=[S-1.3*T,S+1.3*T],n.expand(f,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=u(e.xctrl,e.yctrl,p,m),y.x=r,y.y=b,y.a=g,y.b=v,[y]}},{\"../../plots/cartesian/axes\":724,\"../heatmap/clean_2d_array\":905,\"./array_minmax\":839,\"./calc_clippath\":845,\"./calc_gridlines\":846,\"./calc_labels\":847,\"./cheater_basis\":849,\"./map_2d_array\":861,\"./smooth_fill_2d_array\":865}],845:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,n){var i,a,o,s=[],l=!!r.smoothing,u=!!n.smoothing,c=t[0].length-1,h=t.length-1;for(i=0,a=[],o=[];i<=c;i++)a[i]=t[0][i],o[i]=e[0][i];for(s.push({x:a,y:o,bicubic:l}),i=0,a=[],o=[];i<=h;i++)a[i]=t[i][c],o[i]=e[i][c];for(s.push({x:a,y:o,bicubic:u}),i=c,a=[],o=[];i>=0;i--)a[c-i]=t[h][i],o[c-i]=e[h][i];for(s.push({x:a,y:o,bicubic:l}),i=h,a=[],o=[];i>=0;i--)a[h-i]=t[i][0],o[h-i]=e[i][0];return s.push({x:a,y:o,bicubic:u}),s}},{}],846:[function(t,e,r){\"use strict\";var n=t(\"../../plots/cartesian/axes\"),i=t(\"../../lib/extend\").extendFlat;e.exports=function(t,e,r,a){function o(e){var n,i,o,s,l,u,c,h,f,d,p,g,v=[],y=[],b={};if(\"b\"===r)for(i=t.b2j(e),o=Math.floor(Math.max(0,Math.min(P-2,i))),s=i-o,b.length=P,b.crossLength=I,b.xy=function(e){return t.evalxy([],e,i)},b.dxy=function(e,r){return t.dxydi([],e,o,r,s)},n=0;n<I;n++)u=Math.min(I-2,n),c=n-u,h=t.evalxy([],n,i),E.smoothing&&n>0&&(f=t.dxydi([],n-1,o,0,s),v.push(l[0]+f[0]/3),y.push(l[1]+f[1]/3),d=t.dxydi([],n-1,o,1,s),v.push(h[0]-d[0]/3),y.push(h[1]-d[1]/3)),v.push(h[0]),y.push(h[1]),l=h;else for(n=t.a2i(e),u=Math.floor(Math.max(0,Math.min(I-2,n))),c=n-u,b.length=I,b.crossLength=P,b.xy=function(e){return t.evalxy([],n,e)},b.dxy=function(e,r){return t.dxydj([],u,e,c,r)},i=0;i<P;i++)o=Math.min(P-2,i),s=i-o,h=t.evalxy([],n,i),E.smoothing&&i>0&&(p=t.dxydj([],u,i-1,c,0),v.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),g=t.dxydj([],u,i-1,c,1),v.push(h[0]-g[0]/3),y.push(h[1]-g[1]/3)),v.push(h[0]),y.push(h[1]),l=h;return b.axisLetter=r,b.axis=M,b.crossAxis=E,b.value=e,b.constvar=a,b.index=m,b.x=v,b.y=y,b.smoothing=E.smoothing,b}function s(e){var n,i,o,s,l,u=[],c=[],h={};if(h.length=w.length,h.crossLength=S.length,\"b\"===r)for(o=Math.max(0,Math.min(P-2,e)),l=Math.min(1,Math.max(0,e-o)),h.xy=function(r){return t.evalxy([],r,e)},h.dxy=function(e,r){return t.dxydi([],e,o,r,l)},n=0;n<z;n++)u[n]=L[e*O][n],c[n]=C[e*O][n];else for(i=Math.max(0,Math.min(I-2,e)),s=Math.min(1,Math.max(0,e-i)),h.xy=function(r){return t.evalxy([],e,r)},h.dxy=function(e,r){return t.dxydj([],i,e,s,r)},n=0;n<D;n++)u[n]=L[n][e*O],c[n]=C[n][e*O];return h.axisLetter=r,h.axis=M,h.crossAxis=E,h.value=w[e],h.constvar=a,h.index=e,h.x=u,h.y=c,h.smoothing=E.smoothing,h}var l,u,c,h,f,d,p,m,g,v,y,b,x,_,w=t[r],M=t[r+\"axis\"],k=M._gridlines=[],A=M._minorgridlines=[],T=M._boundarylines=[],S=t[a],E=t[a+\"axis\"];if(\"array\"===M.tickmode)for(M.tickvals=[],l=0;l<w.length;l++)M.tickvals.push(w[l]);var L=t.xctrl,C=t.yctrl,z=L[0].length,D=L.length,I=t.a.length,P=t.b.length;n.calcTicks(M);var O=M.smoothing?3:1;if(\"array\"===M.tickmode){for(h=5e-15,d=(f=[Math.floor((w.length-1-M.arraytick0)/M.arraydtick*(1+h)),Math.ceil(-M.arraytick0/M.arraydtick/(1+h))].sort(function(t,e){return t-e}))[0]-1,p=f[1]+1,m=d;m<p;m++)(u=M.arraytick0+M.arraydtick*m)<0||u>w.length-1||k.push(i(s(u),{color:M.gridcolor,width:M.gridwidth}));for(m=d;m<p;m++)if(c=M.arraytick0+M.arraydtick*m,y=Math.min(c+M.arraydtick,w.length-1),!(c<0||c>w.length-1||y<0||y>w.length-1))for(b=w[c],x=w[y],l=0;l<M.minorgridcount;l++)(_=y-c)<=0||(v=b+(x-b)*(l+1)/(M.minorgridcount+1)*(M.arraydtick/_))<w[0]||v>w[w.length-1]||A.push(i(o(v),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&T.push(i(s(0),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&T.push(i(s(w.length-1),{color:M.endlinecolor,width:M.endlinewidth}))}else{for(h=5e-15,d=(f=[Math.floor((w[w.length-1]-M.tick0)/M.dtick*(1+h)),Math.ceil((w[0]-M.tick0)/M.dtick/(1+h))].sort(function(t,e){return t-e}))[0],p=f[1],m=d;m<=p;m++)g=M.tick0+M.dtick*m,k.push(i(o(g),{color:M.gridcolor,width:M.gridwidth}));for(m=d-1;m<p+1;m++)for(g=M.tick0+M.dtick*m,l=0;l<M.minorgridcount;l++)(v=g+M.dtick*(l+1)/(M.minorgridcount+1))<w[0]||v>w[w.length-1]||A.push(i(o(v),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&T.push(i(o(w[0]),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&T.push(i(o(w[w.length-1]),{color:M.endlinecolor,width:M.endlinewidth}))}}},{\"../../lib/extend\":677,\"../../plots/cartesian/axes\":724}],847:[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\":677,\"../../plots/cartesian/axes\":724}],848:[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),u=Math.pow(o*o+s*s,.25),c=(u*u*i-l*l*o)*n,h=(u*u*a-l*l*s)*n,f=u*(l+u)*3,d=l*(l+u)*3;return[[e[0]+(f&&c/f),e[1]+(f&&h/f)],[e[0]-(d&&c/d),e[1]-(d&&h/d)]]}},{}],849:[function(t,e,r){\"use strict\";var n=t(\"../../lib\").isArray;e.exports=function(t,e,r){var i,a,o,s,l,u=[],c=n(t)?t.length:t,h=n(e)?e.length:e,f=n(t)?t:null,d=n(e)?e:null;f&&(o=(f.length-1)/(f[f.length-1]-f[0])/(c-1)),d&&(s=(d.length-1)/(d[d.length-1]-d[0])/(h-1));var p,m=1/0,g=-1/0;for(a=0;a<h;a++)for(u[a]=[],l=d?(d[a]-d[0])*s:a/(h-1),i=0;i<c;i++)p=(f?(f[i]-f[0])*o:i/(c-1))-l*r,m=Math.min(p,m),g=Math.max(p,g),u[a][i]=p;var v=1/(g-m),y=-m*v;for(a=0;a<h;a++)for(i=0;i<c;i++)u[a][i]=v*u[a][i]+y;return u}},{\"../../lib\":685}],850:[function(t,e,r){\"use strict\";function n(t,e,r){var n=-.5*r[0]+1.5*e[0],i=-.5*r[1]+1.5*e[1];return[(2*n+t[0])/3,(2*i+t[1])/3]}var i=t(\"./catmull_rom\"),a=t(\"../../lib\").ensureArray;e.exports=function(t,e,r,o,s,l){var u,c,h,f,d,p,m,g,v,y,b=r[0].length,x=r.length,_=s?3*b-2:b,w=l?3*x-2:x;for(t=a(t,w),e=a(e,w),h=0;h<w;h++)t[h]=a(t[h],_),e[h]=a(e[h],_);for(c=0,f=0;c<x;c++,f+=l?3:1)for(d=t[f],p=e[f],m=r[c],g=o[c],u=0,h=0;u<b;u++,h+=s?3:1)d[h]=m[u],p[h]=g[u];if(s)for(c=0,f=0;c<x;c++,f+=l?3:1){for(u=1,h=3;u<b-1;u++,h+=3)v=i([r[c][u-1],o[c][u-1]],[r[c][u],o[c][u]],[r[c][u+1],o[c][u+1]],s),t[f][h-1]=v[0][0],e[f][h-1]=v[0][1],t[f][h+1]=v[1][0],e[f][h+1]=v[1][1];y=n([t[f][0],e[f][0]],[t[f][2],e[f][2]],[t[f][3],e[f][3]]),t[f][1]=y[0],e[f][1]=y[1],y=n([t[f][_-1],e[f][_-1]],[t[f][_-3],e[f][_-3]],[t[f][_-4],e[f][_-4]]),t[f][_-2]=y[0],e[f][_-2]=y[1]}if(l)for(h=0;h<_;h++){for(f=3;f<w-3;f+=3)v=i([t[f-3][h],e[f-3][h]],[t[f][h],e[f][h]],[t[f+3][h],e[f+3][h]],l),t[f-1][h]=v[0][0],e[f-1][h]=v[0][1],t[f+1][h]=v[1][0],e[f+1][h]=v[1][1];y=n([t[0][h],e[0][h]],[t[2][h],e[2][h]],[t[3][h],e[3][h]]),t[1][h]=y[0],e[1][h]=y[1],y=n([t[w-1][h],e[w-1][h]],[t[w-3][h],e[w-3][h]],[t[w-4][h],e[w-4][h]]),t[w-2][h]=y[0],e[w-2][h]=y[1]}if(s&&l)for(f=1;f<w;f+=(f+1)%3==0?2:1){for(h=3;h<_-3;h+=3)v=i([t[f][h-3],e[f][h-3]],[t[f][h],e[f][h]],[t[f][h+3],e[f][h+3]],s),t[f][h-1]=.5*(t[f][h-1]+v[0][0]),e[f][h-1]=.5*(e[f][h-1]+v[0][1]),t[f][h+1]=.5*(t[f][h+1]+v[1][0]),e[f][h+1]=.5*(e[f][h+1]+v[1][1]);y=n([t[f][0],e[f][0]],[t[f][2],e[f][2]],[t[f][3],e[f][3]]),t[f][1]=.5*(t[f][1]+y[0]),e[f][1]=.5*(e[f][1]+y[1]),y=n([t[f][_-1],e[f][_-1]],[t[f][_-3],e[f][_-3]],[t[f][_-4],e[f][_-4]]),t[f][_-2]=.5*(t[f][_-2]+y[0]),e[f][_-2]=.5*(e[f][_-2]+y[1])}return[t,e]}},{\"../../lib\":685,\"./catmull_rom\":848}],851:[function(t,e,r){\"use strict\";e.exports={RELATIVE_CULL_TOLERANCE:1e-6}},{}],852:[function(t,e,r){\"use strict\";e.exports=function(t,e,r){return e&&r?function(e,r,n,i,a){e||(e=[]);var o,s,l,u,c,h;r*=3,n*=3;var f=i*i,d=1-i,p=d*d,m=d*i*2,g=-3*p,v=3*(p-m),y=3*(m-f),b=3*f,x=a*a,_=x*a,w=1-a,M=w*w,k=M*w;for(h=0;h<t.length;h++)o=g*(c=t[h])[n][r]+v*c[n][r+1]+y*c[n][r+2]+b*c[n][r+3],s=g*c[n+1][r]+v*c[n+1][r+1]+y*c[n+1][r+2]+b*c[n+1][r+3],l=g*c[n+2][r]+v*c[n+2][r+1]+y*c[n+2][r+2]+b*c[n+2][r+3],u=g*c[n+3][r]+v*c[n+3][r+1]+y*c[n+3][r+2]+b*c[n+3][r+3],e[h]=k*o+3*(M*a*s+w*x*l)+_*u;return e}:e?function(e,r,n,i,a){e||(e=[]);var o,s,l,u;r*=3;var c=i*i,h=1-i,f=h*h,d=h*i*2,p=-3*f,m=3*(f-d),g=3*(d-c),v=3*c,y=1-a;for(l=0;l<t.length;l++)o=p*(u=t[l])[n][r]+m*u[n][r+1]+g*u[n][r+2]+v*u[n][r+3],s=p*u[n+1][r]+m*u[n+1][r+1]+g*u[n+1][r+2]+v*u[n+1][r+3],e[l]=y*o+a*s;return e}:r?function(e,r,n,i,a){e||(e=[]);var o,s,l,u,c,h;n*=3;var f=a*a,d=f*a,p=1-a,m=p*p,g=m*p;for(c=0;c<t.length;c++)o=(h=t[c])[n][r+1]-h[n][r],s=h[n+1][r+1]-h[n+1][r],l=h[n+2][r+1]-h[n+2][r],u=h[n+3][r+1]-h[n+3][r],e[c]=g*o+3*(m*a*s+p*f*l)+d*u;return e}:function(e,r,n,i,a){e||(e=[]);var o,s,l,u,c=1-a;for(l=0;l<t.length;l++)o=(u=t[l])[n][r+1]-u[n][r],s=u[n+1][r+1]-u[n+1][r],e[l]=c*o+a*s;return e}}},{}],853:[function(t,e,r){\"use strict\";e.exports=function(t,e,r){return e&&r?function(e,r,n,i,a){e||(e=[]);var o,s,l,u,c,h;r*=3,n*=3;var f=i*i,d=f*i,p=1-i,m=p*p,g=m*p,v=a*a,y=1-a,b=y*y,x=y*a*2,_=-3*b,w=3*(b-x),M=3*(x-v),k=3*v;for(h=0;h<t.length;h++)o=_*(c=t[h])[n][r]+w*c[n+1][r]+M*c[n+2][r]+k*c[n+3][r],s=_*c[n][r+1]+w*c[n+1][r+1]+M*c[n+2][r+1]+k*c[n+3][r+1],l=_*c[n][r+2]+w*c[n+1][r+2]+M*c[n+2][r+2]+k*c[n+3][r+2],u=_*c[n][r+3]+w*c[n+1][r+3]+M*c[n+2][r+3]+k*c[n+3][r+3],e[h]=g*o+3*(m*i*s+p*f*l)+d*u;return e}:e?function(e,r,n,i,a){e||(e=[]);var o,s,l,u,c,h;r*=3;var f=a*a,d=f*a,p=1-a,m=p*p,g=m*p;for(c=0;c<t.length;c++)o=(h=t[c])[n+1][r]-h[n][r],s=h[n+1][r+1]-h[n][r+1],l=h[n+1][r+2]-h[n][r+2],u=h[n+1][r+3]-h[n][r+3],e[c]=g*o+3*(m*a*s+p*f*l)+d*u;return e}:r?function(e,r,n,i,a){e||(e=[]);var o,s,l,u;n*=3;var c=1-i,h=a*a,f=1-a,d=f*f,p=f*a*2,m=-3*d,g=3*(d-p),v=3*(p-h),y=3*h;for(l=0;l<t.length;l++)o=m*(u=t[l])[n][r]+g*u[n+1][r]+v*u[n+2][r]+y*u[n+3][r],s=m*u[n][r+1]+g*u[n+1][r+1]+v*u[n+2][r+1]+y*u[n+3][r+1],e[l]=c*o+i*s;return e}:function(e,r,n,i,a){e||(e=[]);var o,s,l,u,c=1-i;for(l=0;l<t.length;l++)o=(u=t[l])[n+1][r]-u[n][r],s=u[n+1][r+1]-u[n][r+1],e[l]=c*o+i*s;return e}}},{}],854:[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){e||(e=[]);var i,s,l,u,c,h,f=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-f)),m=Math.max(0,Math.min(1,n-d));f*=3,d*=3;var g=p*p,v=g*p,y=1-p,b=y*y,x=b*y,_=m*m,w=_*m,M=1-m,k=M*M,A=k*M;for(h=0;h<t.length;h++)i=x*(c=t[h])[d][f]+3*(b*p*c[d][f+1]+y*g*c[d][f+2])+v*c[d][f+3],s=x*c[d+1][f]+3*(b*p*c[d+1][f+1]+y*g*c[d+1][f+2])+v*c[d+1][f+3],l=x*c[d+2][f]+3*(b*p*c[d+2][f+1]+y*g*c[d+2][f+2])+v*c[d+2][f+3],u=x*c[d+3][f]+3*(b*p*c[d+3][f+1]+y*g*c[d+3][f+2])+v*c[d+3][f+3],e[h]=A*i+3*(k*m*s+M*_*l)+w*u;return e}:n?function(e,r,n){e||(e=[]);var i,s,l,u,c,h,f=Math.max(0,Math.min(Math.floor(r),a)),d=Math.max(0,Math.min(Math.floor(n),o)),p=Math.max(0,Math.min(1,r-f)),m=Math.max(0,Math.min(1,n-d));f*=3;var g=p*p,v=g*p,y=1-p,b=y*y,x=b*y,_=1-m;for(c=0;c<t.length;c++)i=_*(h=t[c])[d][f]+m*h[d+1][f],s=_*h[d][f+1]+m*h[d+1][f+1],l=_*h[d][f+2]+m*h[d+1][f+1],u=_*h[d][f+3]+m*h[d+1][f+1],e[c]=x*i+3*(b*p*s+y*g*l)+v*u;return e}:i?function(e,r,n){e||(e=[]);var i,s,l,u,c,h,f=Math.max(0,Math.min(Math.floor(r),a)),d=Math.max(0,Math.min(Math.floor(n),o)),p=Math.max(0,Math.min(1,r-f)),m=Math.max(0,Math.min(1,n-d));d*=3;var g=m*m,v=g*m,y=1-m,b=y*y,x=b*y,_=1-p;for(c=0;c<t.length;c++)i=_*(h=t[c])[d][f]+p*h[d][f+1],s=_*h[d+1][f]+p*h[d+1][f+1],l=_*h[d+2][f]+p*h[d+2][f+1],u=_*h[d+3][f]+p*h[d+3][f+1],e[c]=x*i+3*(b*m*s+y*g*l)+v*u;return e}:function(e,r,n){e||(e=[]);var i,s,l,u,c=Math.max(0,Math.min(Math.floor(r),a)),h=Math.max(0,Math.min(Math.floor(n),o)),f=Math.max(0,Math.min(1,r-c)),d=Math.max(0,Math.min(1,n-h)),p=1-d,m=1-f;for(l=0;l<t.length;l++)i=m*(u=t[l])[h][c]+f*u[h][c+1],s=m*u[h+1][c]+f*u[h+1][c+1],e[l]=p*i+d*s;return e}}},{}],855:[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,u){function c(r,i){return n.coerce(t,e,s,r,i)}var h=c(\"color\",l.defaultLine);if(n.coerceFont(c,\"font\"),c(\"carpet\"),a(t,e,u,c,h),e.a&&e.b){e.a.length<3&&(e.aaxis.smoothing=0),e.b.length<3&&(e.baxis.smoothing=0);var f=i(t,e,c);return o(e),e._cheater&&c(\"cheaterslope\"),f?void 0:void(e.visible=!1)}e.visible=!1}},{\"../../components/color/attributes\":577,\"../../lib\":685,\"./ab_defaults\":838,\"./attributes\":840,\"./set_convert\":864,\"./xy_defaults\":866}],856:[function(t,e,r){\"use strict\";e.exports=function(t){return Array.isArray(t[0])}},{}],857:[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\":734,\"./attributes\":840,\"./calc\":844,\"./defaults\":855,\"./plot\":863}],858:[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}},{}],859:[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\")}},{}],860:[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}},{}],861:[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}},{}],862:[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,u=1;if(a){var c=Math.sqrt(i[0]*i[0]+i[1]*i[1]),h=Math.sqrt(a[0]*a[0]+a[1]*a[1]),f=(i[0]*a[0]+i[1]*a[1])/c/h;u=Math.max(0,f)}var 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:u}}},{}],863:[function(t,e,r){\"use strict\";function n(t,e,r){var n=t.selectAll(e+\".\"+r).data([0]);return n.enter().append(e).classed(r,!0),n}function i(t,e,r){var i=r[0],u=r[0].trace,c=e.xaxis,h=e.yaxis,f=u.aaxis,d=u.baxis,p=t._fullLayout,m=e.plot.selectAll(\".carpetlayer\"),g=n(p._defs,\"g\",\"clips\"),v=n(m,\"g\",\"carpet\"+u.uid).classed(\"trace\",!0),y=n(v,\"g\",\"minorlayer\"),b=n(v,\"g\",\"majorlayer\"),x=n(v,\"g\",\"boundarylayer\"),_=n(v,\"g\",\"labellayer\");v.style(\"opacity\",u.opacity),o(c,h,b,f,\"a\",f._gridlines),o(c,h,b,d,\"b\",d._gridlines),o(c,h,y,f,\"a\",f._minorgridlines),o(c,h,y,d,\"b\",d._minorgridlines),o(c,h,x,f,\"a-boundary\",f._boundarylines),o(c,h,x,d,\"b-boundary\",d._boundarylines),l(_,u,i,c,h,s(t._tester,c,h,u,i,_,f._labels,\"a-label\"),s(t._tester,c,h,u,i,_,d._labels,\"b-label\")),a(u,i,g,c,h)}function a(t,e,r,i,a){var o,s,l,u;t.clipPathId=\"clip\"+t.uid+\"carpet\";var c=r.select(\"#\"+t.clipPathId);c.size()||(c=r.append(\"clipPath\").classed(\"carpetclip\",!0));var h=n(c,\"path\",\"carpetboundary\"),p=e.clipsegments,m=[];for(u=0;u<p.length;u++)o=p[u],s=f([],o.x,i.c2p),l=f([],o.y,a.c2p),m.push(d(s,l,o.bicubic));t.clipPathData=\"M\"+m.join(\"L\")+\"Z\",c.attr(\"id\",t.clipPathId),h.attr(\"d\",t.clipPathData)}function o(t,e,r,n,i,a){var o=\"const-\"+i+\"-lines\",s=r.selectAll(\".\"+o).data(a);s.enter().append(\"path\").classed(o,!0).style(\"vector-effect\",\"non-scaling-stroke\"),s.each(function(r){var n=r,i=n.x,a=n.y,o=f([],i,t.c2p),s=f([],a,e.c2p),l=\"M\"+d(o,s,n.smoothing);c.select(this).attr(\"d\",l).style(\"stroke-width\",n.width).style(\"stroke\",n.color).style(\"fill\",\"none\")}),s.exit().remove()}function s(t,e,r,n,i,a,o,s){var l=a.selectAll(\"text.\"+s).data(o);l.enter().append(\"text\").classed(s,!0);var u=0;return l.each(function(i){var a;if(\"auto\"===i.axis.tickangle)a=p(n,e,r,i.xy,i.dxy);else{var o=(i.axis.tickangle+180)*Math.PI/180;a=p(n,e,r,i.xy,[Math.cos(o),Math.sin(o)])}var s=(i.endAnchor?-1:1)*a.flip,l=h.measureText(t,i.text,i.font);c.select(this).attr(\"text-anchor\",s>0?\"start\":\"end\").text(i.text).attr(\"transform\",\"translate(\"+a.p[0]+\",\"+a.p[1]+\") rotate(\"+a.angle+\")translate(\"+i.axis.labelpadding*s+\",\"+.3*l.height+\")\").call(h.font,i.font.family,i.font.size,i.font.color),u=Math.max(u,l.width+i.axis.labelpadding)}),l.exit().remove(),u}function l(t,e,r,n,i,a,o){var s,l;s=.5*(e.a[0]+e.a[e.a.length-1]),l=e.b[0],u(t,e,r,e.ab2xy(s,l,!0),e.dxyda_rough(s,l),e.aaxis,n,i,a,\"a-title\"),s=e.a[0],l=.5*(e.b[0]+e.b[e.b.length-1]),u(t,e,r,e.ab2xy(s,l,!0),e.dxydb_rough(s,l),e.baxis,n,i,o,\"b-title\")}function u(t,e,r,n,i,a,o,s,l,u){var f=[];a.title&&f.push(a.title);var d=t.selectAll(\"text.\"+u).data(f);d.enter().append(\"text\").classed(u,!0),d.each(function(){var t=p(e,o,s,n,i);-1===[\"start\",\"both\"].indexOf(a.showticklabels)&&(l=0),l+=a.titlefont.size+a.titleoffset,c.select(this).text(a.title||\"\").attr(\"transform\",\"translate(\"+t.p[0]+\",\"+t.p[1]+\") rotate(\"+t.angle+\") translate(0,\"+l+\")\").classed(\"user-select-none\",!0).attr(\"text-anchor\",\"middle\").call(h.font,a.titlefont)}),d.exit().remove()}var c=t(\"d3\"),h=t(\"../../components/drawing\"),f=t(\"./map_1d_array\"),d=t(\"./makepath\"),p=t(\"./orient_text\");e.exports=function(t,e,r){for(var n=0;n<r.length;n++)i(t,e,r[n])}},{\"../../components/drawing\":602,\"./makepath\":859,\"./map_1d_array\":860,\"./orient_text\":862,d3:107}],864:[function(t,e,r){\"use strict\";var n=t(\"./constants\"),i=t(\"../../lib/search\").findBin,a=t(\"./compute_control_points\"),o=t(\"./create_spline_evaluator\"),s=t(\"./create_i_derivative_evaluator\"),l=t(\"./create_j_derivative_evaluator\");e.exports=function(t){var e=t.a,r=t.b,u=t.a.length,c=t.b.length,h=t.aaxis,f=t.baxis,d=e[0],p=e[u-1],m=r[0],g=r[c-1],v=e[e.length-1]-e[0],y=r[r.length-1]-r[0],b=v*n.RELATIVE_CULL_TOLERANCE,x=y*n.RELATIVE_CULL_TOLERANCE;d-=b,p+=b,m-=x,g+=x,t.isVisible=function(t,e){return t>d&&t<p&&e>m&&e<g},t.isOccluded=function(t,e){return t<d||t>p||e<m||e>g},h.c2p=function(t){return t},f.c2p=function(t){return t},t.setScale=function(){var e=t.x,r=t.y,n=a(t.xctrl,t.yctrl,e,r,h.smoothing,f.smoothing);t.xctrl=n[0],t.yctrl=n[1],t.evalxy=o([t.xctrl,t.yctrl],u,c,h.smoothing,f.smoothing),t.dxydi=s([t.xctrl,t.yctrl],h.smoothing,f.smoothing),t.dxydj=l([t.xctrl,t.yctrl],h.smoothing,f.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),u-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),u-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(i(t,e),u-2)),n=e[r],a=e[r+1];return Math.max(0,Math.min(u-1,r+(t-n)/(a-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(i(t,r),c-2)),n=r[e],a=r[e+1];return Math.max(0,Math.min(c-1,e+(t-n)/(a-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,i,a){if(!a&&(n<e[0]||n>e[u-1]|i<r[0]||i>r[c-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(i),l=t.evalxy([],o,s);if(a){var h,f,d,p,m=0,g=0,v=[];n<e[0]?(h=0,f=0,m=(n-e[0])/(e[1]-e[0])):n>e[u-1]?(h=u-2,f=1,m=(n-e[u-1])/(e[u-1]-e[u-2])):f=o-(h=Math.max(0,Math.min(u-2,Math.floor(o)))),i<r[0]?(d=0,p=0,g=(i-r[0])/(r[1]-r[0])):i>r[c-1]?(d=c-2,p=1,g=(i-r[c-1])/(r[c-1]-r[c-2])):p=s-(d=Math.max(0,Math.min(c-2,Math.floor(s)))),m&&(t.dxydi(v,h,d,f,p),l[0]+=v[0]*m,l[1]+=v[1]*m),g&&(t.dxydj(v,h,d,f,p),l[0]+=v[0]*g,l[1]+=v[1]*g)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=v*(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\":699,\"./compute_control_points\":850,\"./constants\":851,\"./create_i_derivative_evaluator\":852,\"./create_j_derivative_evaluator\":853,\"./create_spline_evaluator\":854}],865:[function(t,e,r){\"use strict\";var n=t(\"../../lib\");e.exports=function(t,e,r){var i,a,o,s=[],l=[],u=t[0].length,c=t.length,h=0;for(i=0;i<u;i++)for(a=0;a<c;a++)void 0===t[a][i]&&(s.push(i),l.push(a),t[a][i]=function(e,r){var n,i=0,a=0;return e>0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e<u-1&&void 0!==(n=t[r][e+1])&&(a++,i+=n),r>0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r<c-1&&void 0!==(n=t[r+1][e])&&(a++,i+=n),i/Math.max(1,a)}(i,a)),h=Math.max(h,Math.abs(t[a][i]));if(!s.length)return t;var f,d,p,m,g,v,y,b,x,_,w,M=0,k=0,A=s.length;do{for(M=0,o=0;o<A;o++){i=s[o],a=l[o];var T,S,E,L,C,z,D=0,I=0;0===i?(E=e[C=Math.min(u-1,2)],L=e[1],T=t[a][C],I+=(S=t[a][1])+(S-T)*(e[0]-L)/(L-E),D++):i===u-1&&(E=e[C=Math.max(0,u-3)],L=e[u-2],T=t[a][C],I+=(S=t[a][u-2])+(S-T)*(e[u-1]-L)/(L-E),D++),(0===i||i===u-1)&&a>0&&a<c-1&&(f=r[a+1]-r[a],I+=((d=r[a]-r[a-1])*t[a+1][i]+f*t[a-1][i])/(d+f),D++),0===a?(E=r[z=Math.min(c-1,2)],L=r[1],T=t[z][i],I+=(S=t[1][i])+(S-T)*(r[0]-L)/(L-E),D++):a===c-1&&(E=r[z=Math.max(0,c-3)],L=r[c-2],T=t[z][i],I+=(S=t[c-2][i])+(S-T)*(r[c-1]-L)/(L-E),D++),(0===a||a===c-1)&&i>0&&i<u-1&&(f=e[i+1]-e[i],I+=((d=e[i]-e[i-1])*t[a][i+1]+f*t[a][i-1])/(d+f),D++),D?I/=D:(p=e[i+1]-e[i],m=e[i]-e[i-1],b=(g=r[a+1]-r[a])*(v=r[a]-r[a-1])*(g+v),I=((y=p*m*(p+m))*(v*t[a+1][i]+g*t[a-1][i])+b*(m*t[a][i+1]+p*t[a][i-1]))/(b*(m+p)+y*(v+g))),M+=(_=(x=I-t[a][i])/h)*_,w=D?0:.85,t[a][i]+=x*(1+w)}M=Math.sqrt(M)}while(k++<100&&M>1e-5);return n.log(\"Smoother converged to\",M,\"after\",k,\"iterations\"),t}},{\"../../lib\":685}],866:[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\":907,\"./has_columns\":856}],867:[function(t,e,r){\"use strict\";var n=t(\"../scattergeo/attributes\"),i=t(\"../../components/colorscale/attributes\"),a=t(\"../../components/colorbar/attributes\"),o=t(\"../../plots/attributes\"),s=t(\"../../lib/extend\").extendFlat,l=n.marker.line;e.exports=s({},{locations:{valType:\"data_array\"},locationmode:n.locationmode,z:{valType:\"data_array\"},text:{valType:\"data_array\"},marker:{line:{color:l.color,width:s({},l.width,{dflt:1})}},hoverinfo:s({},o.hoverinfo,{flags:[\"location\",\"z\",\"text\",\"name\"]})},i,{colorbar:a})},{\"../../components/colorbar/attributes\":579,\"../../components/colorscale/attributes\":583,\"../../lib/extend\":677,\"../../plots/attributes\":722,\"../scattergeo/attributes\":1013}],868:[function(t,e,r){\"use strict\";var n=t(\"../../components/colorscale/calc\");e.exports=function(t,e){n(e,e.z,\"\",\"z\")}},{\"../../components/colorscale/calc\":584}],869:[function(t,e,r){\"use strict\";var n=t(\"../../lib\"),i=t(\"../../components/colorscale/defaults\"),a=t(\"./attributes\");e.exports=function(t,e,r,o){function s(r,i){return n.coerce(t,e,a,r,i)}var l,u=s(\"locations\");if(u&&(l=u.length),u&&l){var c=s(\"z\");Array.isArray(c)?(c.length>l&&(e.z=c.slice(0,l)),s(\"locationmode\"),s(\"text\"),s(\"marker.line.color\"),s(\"marker.line.width\"),i(t,e,o,s,{prefix:\"\",cLetter:\"z\"}),s(\"hoverinfo\",1===o._dataLength?\"location+z+text\":void 0)):e.visible=!1}else e.visible=!1}},{\"../../components/colorscale/defaults\":587,\"../../lib\":685,\"./attributes\":867}],870:[function(t,e,r){\"use strict\";e.exports=function(t,e){return t.location=e.location,t.z=e.z,t}},{}],871:[function(t,e,r){\"use strict\";function n(t,e,r,n){var o=e.hoverinfo,s=\"all\"===o?a.hoverinfo.flags:o.split(\"+\"),l=-1!==s.indexOf(\"name\"),u=-1!==s.indexOf(\"location\"),c=-1!==s.indexOf(\"z\"),h=-1!==s.indexOf(\"text\"),f=[];!l&&u?t.nameOverride=r.id:(l&&(t.nameOverride=e.name),u&&f.push(r.id)),c&&f.push(function(t){return i.tickText(n,n.c2l(t),\"hover\").text}(r.z)),h&&f.push(r.tx),t.extraText=f.join(\"<br>\")}var i=t(\"../../plots/cartesian/axes\"),a=t(\"./attributes\");e.exports=function(t){var e=t.cd[0].trace,r=t.subplot,i=r.choroplethHoverPt;if(i){var a=r.projection(i.properties.ct);return t.x0=t.x1=a[0],t.y0=t.y1=a[1],t.index=i.index,t.location=i.id,t.z=i.z,n(t,e,i,r.mockAxis),[t]}}},{\"../../plots/cartesian/axes\":724,\"./attributes\":867}],872:[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.hoverPoints=t(\"./hover\"),n.eventData=t(\"./event_data\"),n.moduleType=\"trace\",n.name=\"choropleth\",n.basePlotModule=t(\"../../plots/geo\"),n.categories=[\"geo\",\"noOpacity\"],n.meta={},e.exports=n},{\"../../plots/geo\":752,\"../heatmap/colorbar\":906,\"./attributes\":867,\"./calc\":868,\"./defaults\":869,\"./event_data\":870,\"./hover\":871,\"./plot\":873}],873:[function(t,e,r){\"use strict\";function n(t,e){for(var r,n=[],i=t.locations,a=i.length,o=u(t,e),s=(t.marker||{}).line||{},l=0;l<a;l++)(r=c(t.locationmode,i[l],o))&&(r.z=t.z[l],void 0!==t.text&&(r.tx=t.text[l]),h(s.color,r,\"mlc\",l),h(s.width,r,\"mlw\",l),r.index=l,n.push(r));return n.length>0&&(n[0].trace=t),n}function i(t){t.framework.selectAll(\"g.trace.choropleth\").each(function(t){var e=t[0].trace,r=a.select(this),n=(e.marker||{}).line||{},i=l.makeColorScaleFunc(l.extractScale(e.colorscale,e.zmin,e.zmax));r.selectAll(\"path.choroplethlocation\").each(function(t){a.select(this).attr(\"fill\",function(t){return i(t.z)}).call(o.stroke,t.mlc||n.color).call(s.dashLine,\"\",t.mlw||n.width||0)})})}var a=t(\"d3\"),o=t(\"../../components/color\"),s=t(\"../../components/drawing\"),l=t(\"../../components/colorscale\"),u=t(\"../../lib/topojson_utils\").getTopojsonFeatures,c=t(\"../../lib/geo_location_utils\").locationToFeature,h=t(\"../../lib/array_to_calc_item\"),f=t(\"../../plots/geo/constants\");e.exports=function(t,e,r){function o(t){return t[0].trace.uid}var s,l=t.framework,u=l.select(\"g.choroplethlayer\"),c=l.select(\"g.baselayer\"),h=l.select(\"g.baselayeroverchoropleth\"),d=f.baseLayersOverChoropleth,p=u.selectAll(\"g.trace.choropleth\").data(e,o);p.enter().append(\"g\").attr(\"class\",\"trace choropleth\"),p.exit().remove(),p.each(function(e){var r=n(e[0].trace,t.topojson),i=a.select(this).selectAll(\"path.choroplethlocation\").data(r);i.enter().append(\"path\").classed(\"choroplethlocation\",!0).on(\"mouseover\",function(e){t.choroplethHoverPt=e}).on(\"mouseout\",function(){t.choroplethHoverPt=null}),i.exit().remove()}),h.selectAll(\"*\").remove();for(var m=0;m<d.length;m++)s=d[m],c.select(\"g.\"+s).remove(),t.drawTopo(h,s,r),t.styleLayer(h,s,r);i(t)}},{\"../../components/color\":578,\"../../components/colorscale\":592,\"../../components/drawing\":602,\"../../lib/array_to_calc_item\":671,\"../../lib/geo_location_utils\":680,\"../../lib/topojson_utils\":706,\"../../plots/geo/constants\":750,d3:107}],874:[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(\"../../lib/extend\").extendFlat,u=i.line;e.exports=l({},{z:n.z,x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:n.text,transpose:n.transpose,xtype:n.xtype,ytype:n.ytype,connectgaps:n.connectgaps,autocontour:{valType:\"boolean\",dflt:!0},ncontours:{valType:\"integer\",dflt:15,min:1},contours:{start:{valType:\"number\",dflt:null},end:{valType:\"number\",dflt:null},size:{valType:\"number\",dflt:null,min:0},coloring:{valType:\"enumerated\",values:[\"fill\",\"heatmap\",\"lines\",\"none\"],dflt:\"fill\"},showlines:{valType:\"boolean\",dflt:!0}},line:{color:l({},u.color,{}),width:u.width,dash:s,smoothing:l({},u.smoothing,{})}},a,{autocolorscale:l({},a.autocolorscale,{dflt:!1})},{colorbar:o})},{\"../../components/colorbar/attributes\":579,\"../../components/colorscale/attributes\":583,\"../../components/drawing/attributes\":601,\"../../lib/extend\":677,\"../heatmap/attributes\":903,\"../scatter/attributes\":976}],875:[function(t,e,r){\"use strict\";function n(t,e,r){var n={type:\"linear\",range:[t,e]};return i.autoTicks(n,(e-t)/(r||15)),n}var i=t(\"../../plots/cartesian/axes\"),a=t(\"../../lib\").extendFlat,o=t(\"../heatmap/calc\");e.exports=function(t,e){var r=o(t,e),s=e.contours;if(!1!==e.autocontour){var l=n(e.zmin,e.zmax,e.ncontours);s.size=l.dtick,s.start=i.tickFirst(l),l.range.reverse(),s.end=i.tickFirst(l),s.start===e.zmin&&(s.start+=s.size),s.end===e.zmax&&(s.end-=s.size),s.start>s.end&&(s.start=s.end=(s.start+s.end)/2),e._input.contours||(e._input.contours={}),a(e._input.contours,{start:s.start,end:s.end,size:s.size}),e._input.autocontour=!0}else{var u=s.start,c=s.end,h=e._input.contours;if(u>c&&(s.start=h.start=c,c=s.end=h.end=u,u=s.start),!(s.size>0)){var f;f=u===c?1:n(u,c,e.ncontours).dtick,h.size=s.size=f}}return r}},{\"../../lib\":685,\"../../plots/cartesian/axes\":724,\"../heatmap/calc\":904}],876:[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 u=r.contours,c=r.line,h=u.size||1,f=u.coloring,d=a(r,{isColorbar:!0});\"heatmap\"===f&&l.filllevels({start:r.zmin,end:r.zmax,size:(r.zmax-r.zmin)/254}),l.fillcolor(\"fill\"===f||\"heatmap\"===f?d:\"\").line({color:\"lines\"===f?d:c.color,width:!1!==u.showlines?c.width:0,dash:c.dash}).levels({start:u.start,end:o(u),size:h}).options(r.colorbar)()}else n.autoMargin(t,s)}},{\"../../components/colorbar/draw\":581,\"../../plots/plots\":787,\"./end_plus\":880,\"./make_color_map\":884}],877:[function(t,e,r){\"use strict\";e.exports.BOTTOMSTART=[1,9,13,104,713],e.exports.TOPSTART=[4,6,7,104,713],e.exports.LEFTSTART=[8,12,14,208,1114],e.exports.RIGHTSTART=[2,3,11,208,1114],e.exports.NEWDELTA=[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],e.exports.CHOOSESADDLE={104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},e.exports.SADDLEREMAINDER={1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11}},{}],878:[function(t,e,r){\"use strict\";var n=t(\"../../lib\"),i=t(\"./attributes\");e.exports=function(t,e,r){var a=n.coerce2(t,e,i,\"contours.start\"),o=n.coerce2(t,e,i,\"contours.end\"),s=!1===a||!1===o,l=r(\"contours.size\");!(s?e.autocontour=!0:r(\"autocontour\",!1))&&l||r(\"ncontours\")}},{\"../../lib\":685,\"./attributes\":874}],879:[function(t,e,r){\"use strict\";var n=t(\"../../lib\"),i=t(\"../heatmap/has_columns\"),a=t(\"../heatmap/xyz_defaults\"),o=t(\"./contours_defaults\"),s=t(\"./style_defaults\"),l=t(\"./attributes\");e.exports=function(t,e,r,u){function c(r,i){return n.coerce(t,e,l,r,i)}a(t,e,c,u)?(c(\"text\"),c(\"connectgaps\",i(e)),o(t,e,c),s(t,e,c,u)):e.visible=!1}},{\"../../lib\":685,\"../heatmap/has_columns\":910,\"../heatmap/xyz_defaults\":918,\"./attributes\":874,\"./contours_defaults\":878,\"./style_defaults\":888}],880:[function(t,e,r){\"use strict\";e.exports=function(t){return t.end+t.size/1e6}},{}],881:[function(t,e,r){\"use strict\";function n(t,e,r,n){return Math.abs(t[0]-e[0])<r&&Math.abs(t[1]-e[1])<n}function i(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function a(t,e,r,a,c){function h(t){return v[t%v.length]}var f,d=e.join(\",\"),p=d,m=t.crossings[p],g=o(m,r,e),v=[s(t,e,[-g[0],-g[1]])],y=g.join(\",\"),b=t.z.length,x=t.z[0].length;for(f=0;f<1e4;f++){if(m>20?(m=u.CHOOSESADDLE[m][(g[0]||g[1])<0?0:1],t.crossings[p]=u.SADDLEREMAINDER[m]):delete t.crossings[p],!(g=u.NEWDELTA[m])){l.log(\"Found bad marching index:\",m,e,t.level);break}v.push(s(t,e,g)),e[0]+=g[0],e[1]+=g[1],n(v[v.length-1],v[v.length-2],a,c)&&v.pop(),p=e.join(\",\");var _=g[0]&&(e[0]<0||e[0]>x-2)||g[1]&&(e[1]<0||e[1]>b-2);if(p===d&&g.join(\",\")===y||r&&_)break;m=t.crossings[p]}1e4===f&&l.log(\"Infinite loop in contour?\");var w,M,k,A,T,S,E,L=n(v[0],v[v.length-1],a,c),C=0,z=.2*t.smoothing,D=[],I=0;for(f=1;f<v.length;f++)C+=E=i(v[f],v[f-1]),D.push(E);var P=C/D.length*z;for(f=v.length-2;f>=I;f--)if((w=D[f])<P){for(k=0,M=f-1;M>=I&&w+D[M]<P;M--)w+=D[M];if(L&&f===v.length-2)for(k=0;k<M&&w+D[k]<P;k++)w+=D[k];T=f-M+k+1,S=Math.floor((f+M+k+2)/2),A=L||f!==v.length-2?L||-1!==M?T%2?h(S):[(h(S)[0]+h(S+1)[0])/2,(h(S)[1]+h(S+1)[1])/2]:v[0]:v[v.length-1],v.splice(M+1,f-M+1,A),f=M+1,k&&(I=k),L&&(f===v.length-2?v[k]=v[v.length-1]:0===f&&(v[v.length-1]=v[0]))}if(v.splice(0,I),!(v.length<2))if(L)v.pop(),t.paths.push(v);else{r||l.log(\"Unclosed interior contour?\",t.level,d,v.join(\"L\"));var O=!1;t.edgepaths.forEach(function(e,r){if(!O&&n(e[0],v[v.length-1],a,c)){v.pop(),O=!0;var i=!1;t.edgepaths.forEach(function(e,o){!i&&n(e[e.length-1],v[0],a,c)&&(i=!0,v.splice(0,1),t.edgepaths.splice(r,1),o===r?t.paths.push(v.concat(e)):t.edgepaths[o]=t.edgepaths[o].concat(v,e))}),i||(t.edgepaths[r]=v.concat(e))}}),t.edgepaths.forEach(function(e,r){!O&&n(e[e.length-1],v[0],a,c)&&(v.splice(0,1),t.edgepaths[r]=e.concat(v),O=!0)}),O||t.edgepaths.push(v)}}function o(t,e,r){var n=0,i=0;return t>20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==u.BOTTOMSTART.indexOf(t)?i=1:-1!==u.LEFTSTART.indexOf(t)?n=1:-1!==u.TOPSTART.indexOf(t)?i=-1:n=-1,[n,i]}function s(t,e,r){var n=e[0]+Math.max(r[0],0),i=e[1]+Math.max(r[1],0),a=t.z[i][n],o=t.xaxis,s=t.yaxis;if(r[1]){var l=(t.level-a)/(t.z[i][n+1]-a);return[o.c2p((1-l)*t.x[n]+l*t.x[n+1],!0),s.c2p(t.y[i],!0)]}var u=(t.level-a)/(t.z[i+1][n]-a);return[o.c2p(t.x[n],!0),s.c2p((1-u)*t.y[i]+u*t.y[i+1],!0)]}var l=t(\"../../lib\"),u=t(\"./constants\");e.exports=function(t,e,r){var n,i,o,s;for(e=e||.01,r=r||.01,i=0;i<t.length;i++){for(o=t[i],s=0;s<o.starts.length;s++)a(o,o.starts[s],\"edge\",e,r);for(n=0;Object.keys(o.crossings).length&&n<1e4;)n++,a(o,Object.keys(o.crossings)[0].split(\",\").map(Number),void 0,e,r);1e4===n&&l.log(\"Infinite loop in contour?\")}}},{\"../../lib\":685,\"./constants\":877}],882:[function(t,e,r){\"use strict\";var n=t(\"../heatmap/hover\");e.exports=function(t,e,r,i){return n(t,e,r,i,!0)}},{\"../heatmap/hover\":911}],883:[function(t,e,r){\"use strict\";var n={};n.attributes=t(\"./attributes\"),n.supplyDefaults=t(\"./defaults\"),n.calc=t(\"./calc\"),n.plot=t(\"./plot\"),n.style=t(\"./style\"),n.colorbar=t(\"./colorbar\"),n.hoverPoints=t(\"./hover\"),n.moduleType=\"trace\",n.name=\"contour\",n.basePlotModule=t(\"../../plots/cartesian\"),n.categories=[\"cartesian\",\"2dMap\",\"contour\"],n.meta={},e.exports=n},{\"../../plots/cartesian\":734,\"./attributes\":874,\"./calc\":875,\"./colorbar\":876,\"./defaults\":879,\"./hover\":882,\"./plot\":886,\"./style\":887}],884:[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,u=\"lines\"===e.coloring?0:1;isFinite(s)||(s=1,l=1);var c,h,f=t.colorscale,d=f.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),h=0;h<d;h++)c=f[h],p[h]=c[0]*(t.zmax-t.zmin)+t.zmin,m[h]=c[1];var g=n.extent([t.zmin,t.zmax,e.start,e.start+s*(l-1)]),v=g[t.zmin<t.zmax?0:1],y=g[t.zmin<t.zmax?1:0];v!==t.zmin&&(p.splice(0,0,v),m.splice(0,0,Range[0])),y!==t.zmax&&(p.push(y),m.push(m[m.length-1]))}else for(h=0;h<d;h++)c=f[h],p[h]=(c[0]*(l+u-1)-u/2)*s+r,m[h]=c[1];return i.makeColorScaleFunc({domain:p,range:m},{noNumericCheck:!0})}},{\"../../components/colorscale\":592,\"./end_plus\":880,d3:107}],885:[function(t,e,r){\"use strict\";function n(t,e){var r=(e[0][0]>t?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);return 5===r||10===r?t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}var i=t(\"./constants\");e.exports=function(t){var e,r,a,o,s,l,u,c,h,f=t[0].z,d=f.length,p=f[0].length,m=2===d||2===p;for(r=0;r<d-1;r++)for(o=[],0===r&&(o=o.concat(i.BOTTOMSTART)),r===d-2&&(o=o.concat(i.TOPSTART)),e=0;e<p-1;e++)for(a=o.slice(),0===e&&(a=a.concat(i.LEFTSTART)),e===p-2&&(a=a.concat(i.RIGHTSTART)),s=e+\",\"+r,l=[[f[r][e],f[r][e+1]],[f[r+1][e],f[r+1][e+1]]],h=0;h<t.length;h++)(u=n((c=t[h]).level,l))&&(c.crossings[s]=u,-1!==a.indexOf(u)&&(c.starts.push([e,r]),m&&-1!==a.indexOf(u,a.indexOf(u)+1)&&c.starts.push([e,r])))}},{\"./constants\":877}],886:[function(t,e,r){\"use strict\";function n(t,e,r){var n=r[0].trace,l=r[0].x,h=r[0].y,f=n.contours,d=n.uid,p=e.xaxis,y=e.yaxis,b=t._fullLayout,x=\"contour\"+d,_=i(f,e,r[0]);if(!0!==n.visible)return b._paper.selectAll(\".\"+x+\",.hm\"+d).remove(),void b._infolayer.selectAll(\".cb\"+d).remove();\"heatmap\"===f.coloring?(n.zauto&&!1===n.autocontour&&(n._input.zmin=n.zmin=f.start-f.size/2,n._input.zmax=n.zmax=n.zmin+_.length*f.size),m(t,e,[r])):(b._paper.selectAll(\".hm\"+d).remove(),b._infolayer.selectAll(\"g.rangeslider-container\").selectAll(\".hm\"+d).remove()),g(_),v(_);var w=p.c2p(l[0],!0),M=p.c2p(l[l.length-1],!0),k=y.c2p(h[0],!0),A=y.c2p(h[h.length-1],!0),T=[[w,A],[M,A],[M,k],[w,k]],S=a(e,r,x);o(S,T,f),s(S,_,T,f),u(S,_,f),c(S,e,r[0],T)}function i(t,e,r){for(var n=t.size,i=[],a=y(t),o=t.start;o<a;o+=n)if(i.push({level:o,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:e.xaxis,yaxis:e.yaxis,x:r.x,y:r.y,z:r.z,smoothing:r.trace.line.smoothing}),i.length>1e3){d.warn(\"Too many contours, clipping at 1000\",t);break}return i}function a(t,e,r){var n=t.plot.select(\".maplayer\").selectAll(\"g.contour.\"+r).data(e);return n.enter().append(\"g\").classed(\"contour\",!0).classed(r,!0),n.exit().remove(),n}function o(t,e,r){var n=t.selectAll(\"g.contourbg\").data([0]);n.enter().append(\"g\").classed(\"contourbg\",!0);var i=n.selectAll(\"path\").data(\"fill\"===r.coloring?[0]:[]);i.enter().append(\"path\"),i.exit().remove(),i.attr(\"d\",\"M\"+e.join(\"L\")+\"Z\").style(\"stroke\",\"none\")}function s(t,e,r,n){var i=t.selectAll(\"g.contourfill\").data([0]);i.enter().append(\"g\").classed(\"contourfill\",!0);var a=i.selectAll(\"path\").data(\"fill\"===n.coloring?e:[]);a.enter().append(\"path\"),a.exit().remove(),a.each(function(t){var e=l(t,r);e?f.select(this).attr(\"d\",e).style(\"stroke\",\"none\"):f.select(this).remove()})}function l(t,e){function r(t){return Math.abs(t[0]-e[2][0])<.01}for(var n,i,a,o,s,l,u=Math.min(t.z[0][0],t.z[0][1]),c=t.edgepaths.length||u<=t.level?\"\":\"M\"+e.join(\"L\")+\"Z\",h=0,f=t.edgepaths.map(function(t,e){return e}),m=!0;f.length;){for(l=p.smoothopen(t.edgepaths[h],t.smoothing),c+=m?l:l.replace(/^M/,\"L\"),f.splice(f.indexOf(h),1),n=t.edgepaths[h][t.edgepaths[h].length-1],o=-1,a=0;a<4;a++){if(!n){d.log(\"Missing end?\",h,t);break}for(!function(t){return Math.abs(t[1]-e[0][1])<.01}(n)||r(n)?!function(t){return Math.abs(t[0]-e[0][0])<.01}(n)?!function(t){return Math.abs(t[1]-e[2][1])<.01}(n)?r(n)&&(i=e[2]):i=e[3]:i=e[0]:i=e[1],s=0;s<t.edgepaths.length;s++){var g=t.edgepaths[s][0];Math.abs(n[0]-i[0])<.01?Math.abs(n[0]-g[0])<.01&&(g[1]-n[1])*(i[1]-g[1])>=0&&(i=g,o=s):Math.abs(n[1]-i[1])<.01?Math.abs(n[1]-g[1])<.01&&(g[0]-n[0])*(i[0]-g[0])>=0&&(i=g,o=s):d.log(\"endpt to newendpt is not vert. or horz.\",n,i,g)}if(n=i,o>=0)break;c+=\"L\"+i}if(o===t.edgepaths.length){d.log(\"unclosed perimeter path\");break}h=o,(m=-1===f.indexOf(h))&&(h=f[0],c+=\"Z\")}for(h=0;h<t.paths.length;h++)c+=p.smoothclosed(t.paths[h],t.smoothing);return c}function u(t,e,r){var n=e[0].smoothing,i=t.selectAll(\"g.contourlevel\").data(!1===r.showlines?[]:e);i.enter().append(\"g\").classed(\"contourlevel\",!0),i.exit().remove();var a=i.selectAll(\"path.openline\").data(function(t){return t.edgepaths});a.enter().append(\"path\").classed(\"openline\",!0),a.exit().remove(),a.attr(\"d\",function(t){return p.smoothopen(t,n)}).style(\"stroke-miterlimit\",1).style(\"vector-effect\",\"non-scaling-stroke\");var o=i.selectAll(\"path.closedline\").data(function(t){return t.paths});o.enter().append(\"path\").classed(\"closedline\",!0),o.exit().remove(),o.attr(\"d\",function(t){return p.smoothclosed(t,n)}).style(\"stroke-miterlimit\",1).style(\"vector-effect\",\"non-scaling-stroke\")}function c(t,e,r,n){var i=\"clip\"+r.trace.uid,a=e.plot.selectAll(\"defs\").data([0]);a.enter().append(\"defs\");var o=a.selectAll(\"#\"+i).data(r.trace.connectgaps?[]:[0]);if(o.enter().append(\"clipPath\").attr(\"id\",i),o.exit().remove(),!1===r.trace.connectgaps){var s={level:.9,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:e.xaxis,yaxis:e.yaxis,x:r.x,y:r.y,z:h(r),smoothing:0};g([s]),v([s]);var u=l(s,n),c=o.selectAll(\"path\").data([0]);c.enter().append(\"path\"),c.attr(\"d\",u)}else i=null;t.call(p.setClipUrl,i),e.plot.selectAll(\".hm\"+r.trace.uid).call(p.setClipUrl,i)}function h(t){var e,r,n=t.trace._emptypoints,i=[],a=t.z.length,o=t.z[0].length,s=[];for(e=0;e<o;e++)s.push(1);for(e=0;e<a;e++)i.push(s.slice());for(e=0;e<n.length;e++)i[(r=n[e])[0]][r[1]]=0;return t.zmask=i,i}var f=t(\"d3\"),d=t(\"../../lib\"),p=t(\"../../components/drawing\"),m=t(\"../heatmap/plot\"),g=t(\"./make_crossings\"),v=t(\"./find_all_paths\"),y=t(\"./end_plus\");e.exports=function(t,e,r){for(var i=0;i<r.length;i++)n(t,e,r[i])}},{\"../../components/drawing\":602,\"../../lib\":685,\"../heatmap/plot\":916,\"./end_plus\":880,\"./find_all_paths\":881,\"./make_crossings\":885,d3:107}],887:[function(t,e,r){\"use strict\";var n=t(\"d3\"),i=t(\"../../components/drawing\"),a=t(\"../heatmap/style\"),o=t(\"./make_color_map\");e.exports=function(t){var e=n.select(t).selectAll(\"g.contour\");e.style(\"opacity\",function(t){return t.trace.opacity}),e.each(function(t){var e=n.select(this),r=t.trace,a=r.contours,s=r.line,l=a.size||1,u=a.start,c=o(r);e.selectAll(\"g.contourlevel\").each(function(t){n.select(this).selectAll(\"path\").call(i.lineGroupStyle,s.width,\"lines\"===a.coloring?c(t.level):s.color,s.dash)});var h;e.selectAll(\"g.contourfill path\").style(\"fill\",function(t){return void 0===h&&(h=t.level),c(t.level+.5*l)}),void 0===h&&(h=u),e.selectAll(\"g.contourbg path\").style(\"fill\",c(h-.5*l))}),a(t)}},{\"../../components/drawing\":602,\"../heatmap/style\":917,\"./make_color_map\":884,d3:107}],888:[function(t,e,r){\"use strict\";var n=t(\"../../components/colorscale/defaults\");e.exports=function(t,e,r,i,a,o){var s,l=r(\"contours.coloring\");\"fill\"===l&&(s=r(\"contours.showlines\")),!1!==s&&(\"lines\"!==l&&r(\"line.color\",a||\"#000\"),r(\"line.width\",void 0===o?.5:o),r(\"line.dash\")),r(\"line.smoothing\"),\"none\"!==(e.contours||{}).coloring&&n(t,e,i,r,{prefix:\"\",cLetter:\"z\"})}},{\"../../components/colorscale/defaults\":587}],889:[function(t,e,r){\"use strict\";var n=t(\"../heatmap/attributes\"),i=t(\"../scatter/attributes\"),a=t(\"../../components/colorscale/attributes\"),o=t(\"../../components/colorbar/attributes\"),s=t(\"../../lib/extend\").extendFlat,l=i.line,u=t(\"./constants\");e.exports=s({},{carpet:{valType:\"string\"},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,mode:{valType:\"flaglist\",flags:[\"lines\",\"fill\"],extras:[\"none\"]},connectgaps:n.connectgaps,fillcolor:{valType:\"color\"},autocontour:{valType:\"boolean\",dflt:!0},ncontours:{valType:\"integer\",dflt:15,min:1},contours:{type:{valType:\"enumerated\",values:[\"levels\",\"constraint\"],dflt:\"levels\"},start:{valType:\"number\",dflt:null},end:{valType:\"number\",dflt:null},size:{valType:\"number\",dflt:null,min:0},coloring:{valType:\"enumerated\",values:[\"fill\",\"lines\",\"none\"],dflt:\"fill\"},showlines:{valType:\"boolean\",dflt:!0},operation:{valType:\"enumerated\",values:[].concat(u.INEQUALITY_OPS).concat(u.INTERVAL_OPS).concat(u.SET_OPS),dflt:\"=\"},value:{valType:\"any\",dflt:0}},line:{color:s({},l.color,{}),width:l.width,dash:l.dash,smoothing:s({},l.smoothing,{})}},a,{autocolorscale:s({},a.autocolorscale,{dflt:!1})},{colorbar:o})},{\"../../components/colorbar/attributes\":579,\"../../components/colorscale/attributes\":583,\"../../lib/extend\":677,\"../heatmap/attributes\":903,\"../scatter/attributes\":976,\"./constants\":892}],890:[function(t,e,r){\"use strict\";function n(t,e,r){var n={type:\"linear\",range:[t,e]};return o.autoTicks(n,(e-t)/(r||15)),n}function i(t,e){function r(t){k=e._input.zsmooth=e.zsmooth=!1,a.notifier(\"cannot fast-zsmooth: \"+t)}var n,i,o,s,v,y,b,x,_=e.carpetTrace,w=_.aaxis,M=_.baxis,k=l.traceIs(e,\"contour\")?\"best\":e.zsmooth;if(w._minDtick=0,M._minDtick=0,c(e)&&h(e,w,M,\"a\",\"b\",[\"z\"]),n=e.a?w.makeCalcdata(e,\"a\"):[],s=e.b?M.makeCalcdata(e,\"b\"):[],i=e.a0||0,o=e.da||1,v=e.b0||0,y=e.db||1,b=f(e.z,e.transpose),e._emptypoints=m(b),e._interpz=p(b,e._emptypoints,e._interpz),\"fast\"===k)if(\"log\"===w.type||\"log\"===M.type)r(\"log axis found\");else{if(n.length){var A=(n[n.length-1]-n[0])/(n.length-1),T=Math.abs(A/100);for(x=0;x<n.length-1;x++)if(Math.abs(n[x+1]-n[x]-A)>T){r(\"a scale is not linear\");break}}if(s.length&&\"fast\"===k){var S=(s[s.length-1]-s[0])/(s.length-1),E=Math.abs(S/100);for(x=0;x<s.length-1;x++)if(Math.abs(s[x+1]-s[x]-S)>E){r(\"b scale is not linear\");break}}}var L=d(b),C=\"scaled\"===e.xtype?\"\":n,z=g(e,C,i,o,L,w),D=\"scaled\"===e.ytype?\"\":s,I={a:z,b:g(e,D,v,y,b.length,M),z:b};return\"levels\"===e.contours.type&&u(e,b,\"\",\"z\"),[I]}var a=t(\"../../lib\"),o=t(\"../../plots/cartesian/axes\"),s=t(\"../../lib\").extendFlat,l=t(\"../../registry\"),u=t(\"../../components/colorscale/calc\"),c=t(\"../heatmap/has_columns\"),h=t(\"../heatmap/convert_column_xyz\"),f=t(\"../heatmap/clean_2d_array\"),d=t(\"../heatmap/max_row_length\"),p=t(\"../heatmap/interp2d\"),m=t(\"../heatmap/find_empties\"),g=t(\"../heatmap/make_bound_array\"),v=t(\"./defaults\"),y=t(\"../carpet/lookup_carpetid\");e.exports=function(t,e){var r=e.carpetTrace=y(t,e);if(r&&r.visible&&\"legendonly\"!==r.visible){if(!e.a||!e.b){var a=t.data[r.index],l=t.data[e.index];l.a||(l.a=a.a),l.b||(l.b=a.b),v(l,e,e._defaultColor,t._fullLayout)}var u=i(t,e),c=e.contours;if(!0===e.autocontour){var h=n(e.zmin,e.zmax,e.ncontours);c.size=h.dtick,c.start=o.tickFirst(h),h.range.reverse(),c.end=o.tickFirst(h),c.start===e.zmin&&(c.start+=c.size),c.end===e.zmax&&(c.end-=c.size),c.start>c.end&&(c.start=c.end=(c.start+c.end)/2),e._input.contours=s({},c)}else{var f=c.start,d=c.end,p=e._input.contours;if(f>d&&(c.start=p.start=d,d=c.end=p.end=f,f=c.start),!(c.size>0)){var m;m=f===d?1:n(f,d,e.ncontours).dtick,p.size=c.size=m}}return u}}},{\"../../components/colorscale/calc\":584,\"../../lib\":685,\"../../plots/cartesian/axes\":724,\"../../registry\":802,\"../carpet/lookup_carpetid\":858,\"../heatmap/clean_2d_array\":905,\"../heatmap/convert_column_xyz\":907,\"../heatmap/find_empties\":909,\"../heatmap/has_columns\":910,\"../heatmap/interp2d\":913,\"../heatmap/make_bound_array\":914,\"../heatmap/max_row_length\":915,\"./defaults\":896}],891:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,n){var i,a,o,s=n.a.length,l=n.b.length,u=n.z,c=-1/0,h=1/0;for(i=0;i<l;i++)h=Math.min(h,u[i][0]),h=Math.min(h,u[i][s-1]),c=Math.max(c,u[i][0]),c=Math.max(c,u[i][s-1]);for(i=1;i<s-1;i++)h=Math.min(h,u[0][i]),h=Math.min(h,u[l-1][i]),c=Math.max(c,u[0][i]),c=Math.max(c,u[l-1][i]);switch(e){case\">\":case\">=\":n.contours.value>c&&(t[0].prefixBoundary=!0);break;case\"<\":case\"<=\":n.contours.value<h&&(t[0].prefixBoundary=!0);break;case\"[]\":case\"()\":a=Math.min.apply(null,n.contours.value),(o=Math.max.apply(null,n.contours.value))<h&&(t[0].prefixBoundary=!0),a>c&&(t[0].prefixBoundary=!0);break;case\"][\":case\")(\":a=Math.min.apply(null,n.contours.value),o=Math.max.apply(null,n.contours.value),a<h&&o>c&&(t[0].prefixBoundary=!0)}}},{}],892:[function(t,e,r){\"use strict\";e.exports={INEQUALITY_OPS:[\"=\",\"<\",\">=\",\">\",\"<=\"],INTERVAL_OPS:[\"[]\",\"()\",\"[)\",\"(]\",\"][\",\")(\",\"](\",\")[\"],SET_OPS:[\"{}\",\"}{\"]}},{}],893:[function(t,e,r){\"use strict\";function n(t,e){function r(t){return s(t)?+t:null}var n,i=Array.isArray(e);return-1!==o.INEQUALITY_OPS.indexOf(t)?n=r(i?e[0]:e):-1!==o.INTERVAL_OPS.indexOf(t)?n=i?[r(e[0]),r(e[1])]:[r(e),r(e)]:-1!==o.SET_OPS.indexOf(t)&&(n=i?e.map(r):[r(e)]),n}function i(t){return function(e){e=n(t,e);var r=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return{start:r,end:i,size:i-r}}}function a(t){return function(e){return e=n(t,e),{start:e,end:1/0,size:1/0}}}var o=t(\"./constants\"),s=t(\"fast-isnumeric\");e.exports[\"[]\"]=i(\"[]\"),e.exports[\"()\"]=i(\"()\"),e.exports[\"[)\"]=i(\"[)\"),e.exports[\"(]\"]=i(\"(]\"),e.exports[\"][\"]=i(\"][\"),e.exports[\")(\"]=i(\")(\"),e.exports[\")[\"]=i(\")[\"),e.exports[\"](\"]=i(\"](\"),e.exports[\">\"]=a(\">\"),e.exports[\">=\"]=a(\">=\"),e.exports[\"<\"]=a(\"<\"),e.exports[\"<=\"]=a(\"<=\"),e.exports[\"=\"]=a(\"=\")},{\"./constants\":892,\"fast-isnumeric\":116}],894:[function(t,e,r){\"use strict\";var n=t(\"./constraint_mapping\"),i=t(\"fast-isnumeric\");e.exports=function(t,e){var r;-1===[\"=\",\"<\",\"<=\",\">\",\">=\"].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])]:i(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t(\"contours.value\",0),i(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0));var a=n[e.operation](e.value);e.start=a.start,e.end=a.end,e.size=a.size}},{\"./constraint_mapping\":893,\"fast-isnumeric\":116}],895:[function(t,e,r){\"use strict\";var n=t(\"../../lib\");e.exports=function(t,e){var r,i,a,o=function(t){return t.reverse()},s=function(t){return t};switch(e){case\"][\":case\")[\":case\"](\":case\")(\":var l=o;o=s,s=l;case\"[]\":case\"[)\":case\"(]\":case\"()\":if(2!==t.length)return void n.warn(\"Contour data invalid for the specified inequality range operation.\");for(i=t[0],a=t[1],r=0;r<i.edgepaths.length;r++)i.edgepaths[r]=o(i.edgepaths[r]);for(r=0;r<i.paths.length;r++)i.paths[r]=o(i.paths[r]);for(;a.edgepaths.length;)i.edgepaths.push(s(a.edgepaths.shift()));for(;a.paths.length;)i.paths.push(s(a.paths.shift()));t.pop();break;case\">=\":case\">\":if(1!==t.length)return void n.warn(\"Contour data invalid for the specified inequality operation.\");for(i=t[0],r=0;r<i.edgepaths.length;r++)i.edgepaths[r]=o(i.edgepaths[r]);for(r=0;r<i.paths.length;r++)i.paths[r]=o(i.paths[r])}}},{\"../../lib\":685}],896:[function(t,e,r){\"use strict\";var n=t(\"../../lib\"),i=t(\"../heatmap/xyz_defaults\"),a=t(\"./attributes\"),o=t(\"../contour/style_defaults\"),s=t(\"../scatter/fillcolor_defaults\"),l=t(\"../../plots/attributes\"),u=t(\"./constraint_value_defaults\"),c=t(\"../../components/color\").addOpacity;e.exports=function(t,e,r,h){function f(r,i){return n.coerce(t,e,a,r,i)}if(f(\"carpet\"),t.a&&t.b){var d,p,m;if(!i(t,e,f,h,\"a\",\"b\"))return void(e.visible=!1);f(\"text\"),f(\"contours.type\");var g=e.contours;if(\"constraint\"===g.type){f(\"contours.operation\"),u(f,g),n.coerce(t,e,l,\"showlegend\",!0),f(\"contours.coloring\",\"=\"===g.operation?\"lines\":\"fill\"),f(\"contours.showlines\",!0),\"=\"===g.operation&&(g.coloring=\"lines\"),s(t,e,r,f);var v=e.fillcolor?c(e.fillcolor,1):r;o(t,e,f,h,v,2),\"=\"===g.operation&&(f(\"line.color\",r),\"fill\"===g.coloring&&(g.coloring=\"lines\"),\"lines\"===g.coloring&&delete e.fillcolor),delete e.showscale,delete e.autocontour,delete e.autocolorscale,delete e.colorscale,delete e.ncontours,delete e.colorbar,e.line&&(delete e.line.autocolorscale,delete e.line.colorscale,delete e.line.mincolor,delete e.line.maxcolor)}else n.coerce(t,e,l,\"showlegend\",!1),p=n.coerce2(t,e,a,\"contours.start\"),m=n.coerce2(t,e,a,\"contours.end\"),d=f(\"contours.size\"),f(\"contours.coloring\"),!(!1===p||!1===m?e.autocontour=!0:f(\"autocontour\",!1))&&d||f(\"ncontours\"),o(t,e,f,h),delete e.value,delete e.operation}else e._defaultColor=r}},{\"../../components/color\":578,\"../../lib\":685,\"../../plots/attributes\":722,\"../contour/style_defaults\":888,\"../heatmap/xyz_defaults\":918,\"../scatter/fillcolor_defaults\":983,\"./attributes\":889,\"./constraint_value_defaults\":894}],897:[function(t,e,r){\"use strict\";var n=t(\"../../lib\");e.exports=function(t,e,r){for(var i=t.size,a=[],o=r.trace.carpetTrace,s=t.start;s<t.end+i/10;s+=i)if(a.push({level:s,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:o.aaxis,yaxis:o.baxis,x:r.a,y:r.b,z:r.z,smoothing:r.trace.line.smoothing}),a.length>1e3){n.warn(\"Too many contours, clipping at 1000\",t);break}return a}},{\"../../lib\":685}],898:[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(\"./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\":734,\"../contour/colorbar\":876,\"./attributes\":889,\"./calc\":890,\"./defaults\":896,\"./plot\":901,\"./style\":902}],899:[function(t,e,r){\"use strict\";var n=t(\"../../components/drawing\"),i=t(\"../carpet/axis_aligned_line\"),a=t(\"../../lib\");e.exports=function(t,e,r,o,s,l,u,c){function h(t){return Math.abs(t[1]-r[0][1])<S}function f(t){return Math.abs(t[1]-r[2][1])<S}function d(t){return Math.abs(t[0]-r[0][0])<T}function p(t){return Math.abs(t[0]-r[2][0])<T}function m(t,e){var r,n,a,o,m=\"\";for(h(t)&&!p(t)||f(t)&&!d(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(m+=o.smoothing?\"C\":\"L\",n=0;n<a[r].length;n++){var g=a[r][n];m+=[u.c2p(g[0]),c.c2p(g[1])]+\" \"}return m}var g,v,y,b,x,_,w,M=\"\",k=e.edgepaths.map(function(t,e){return e}),A=!0,T=1e-4*Math.abs(r[0][0]-r[2][0]),S=1e-4*Math.abs(r[0][1]-r[2][1]);for(g=0,v=null;k.length;){var E=e.edgepaths[g][0];for(v&&(M+=m(v,E)),w=n.smoothopen(e.edgepaths[g].map(o),e.smoothing),M+=A?w:w.replace(/^M/,\"L\"),k.splice(k.indexOf(g),1),v=e.edgepaths[g][e.edgepaths[g].length-1],x=-1,b=0;b<4;b++){if(!v){a.log(\"Missing end?\",g,e);break}for(h(v)&&!p(v)?y=r[1]:d(v)?y=r[0]:f(v)?y=r[3]:p(v)&&(y=r[2]),_=0;_<e.edgepaths.length;_++){var L=e.edgepaths[_][0];Math.abs(v[0]-y[0])<T?Math.abs(v[0]-L[0])<T&&(L[1]-v[1])*(y[1]-L[1])>=0&&(y=L,x=_):Math.abs(v[1]-y[1])<S?Math.abs(v[1]-L[1])<S&&(L[0]-v[0])*(y[0]-L[0])>=0&&(y=L,x=_):a.log(\"endpt to newendpt is not vert. or horz.\",v,y,L)}if(x>=0)break;M+=m(v,y),v=y}if(x===e.edgepaths.length){a.log(\"unclosed perimeter path\");break}g=x,(A=-1===k.indexOf(g))&&(g=k[0],M+=m(v,y)+\"Z\",v=null)}for(g=0;g<e.paths.length;g++)M+=n.smoothclosed(e.paths[g].map(o),e.smoothing);return M}},{\"../../components/drawing\":602,\"../../lib\":685,\"../carpet/axis_aligned_line\":841}],900:[function(t,e,r){\"use strict\";e.exports=function(t,e){var r,n,i,a,o,s,l,u,c;for(r=0;r<t.length;r++){for(o=(a=t[r]).pedgepaths=[],s=a.ppaths=[],n=0;n<a.edgepaths.length;n++){for(c=a.edgepaths[n],l=[],i=0;i<c.length;i++)l[i]=e(c[i]);o.push(l)}for(n=0;n<a.paths.length;n++){for(c=a.paths[n],u=[],i=0;i<c.length;i++)u[i]=e(c[i]);s.push(u)}}}},{}],901:[function(t,e,r){\"use strict\";function n(t,e,r){var n=t.selectAll(e+\".\"+r).data([0]);return n.enter().append(e).classed(r,!0),n}function i(t,e,r){function n(t){var e=c.ab2xy(t[0],t[1],!0);return[A.c2p(e[0]),T.c2p(e[1])]}var i=r[0].trace,c=i.carpetTrace=x(t,i),d=t.calcdata[c.index][0];if(c.visible&&\"legendonly\"!==c.visible){var v=r[0].a,w=r[0].b,M=i.contours,k=i.uid,A=e.xaxis,T=e.yaxis,S=t._fullLayout,E=\"contour\"+k,L=y(M,e,r[0]),C=\"constraint\"===i.contours.type;if(!0===i.visible){var z=[[v[0],w[w.length-1]],[v[v.length-1],w[w.length-1]],[v[v.length-1],w[0]],[v[0],w[0]]];p(L);var D=1e-8*(v[v.length-1]-v[0]),I=1e-8*(w[w.length-1]-w[0]);m(L,D,I),\"constraint\"===i.contours.type&&(g(L,i.contours.operation),_(L,i.contours.operation,z,i)),b(L,n);var P,O,j,R,F=o(e,r,E),N=[];for(R=d.clipsegments.length-1;R>=0;R--)P=d.clipsegments[R],O=h([],P.x,A.c2p),j=h([],P.y,T.c2p),O.reverse(),j.reverse(),N.push(f(O,j,P.bicubic));var B=\"M\"+N.join(\"L\")+\"Z\";l(F,d.clipsegments,A,T,C,M.coloring),u(i,F,A,T,L,z,n,c,d,M.coloring,B),s(F,L,M),a(F,c)}else S._infolayer.selectAll(\".cb\"+k).remove()}}function a(t,e){t.attr(\"clip-path\",\"url(#\"+e.clipPathId+\")\")}function o(t,e,r){var n=t.plot.select(\".maplayer\").selectAll(\"g.contour.\"+r).classed(\"trace\",!0).data(e);return n.enter().append(\"g\").classed(\"contour\",!0).classed(r,!0),n.exit().remove(),n}function s(t,e,r){var n=e[0].smoothing,i=t.selectAll(\"g.contourlevel\").data(!1===r.showlines?[]:e);i.enter().append(\"g\").classed(\"contourlevel\",!0),i.exit().remove();var a=i.selectAll(\"path.openline\").data(function(t){return t.pedgepaths});a.enter().append(\"path\").classed(\"openline\",!0),a.exit().remove(),a.attr(\"d\",function(t){return d.smoothopen(t,n)}).style(\"vector-effect\",\"non-scaling-stroke\");var o=i.selectAll(\"path.closedline\").data(function(t){return t.ppaths});o.enter().append(\"path\").classed(\"closedline\",!0),o.exit().remove(),o.attr(\"d\",function(t){return d.smoothclosed(t,n)}).style(\"vector-effect\",\"non-scaling-stroke\").style(\"stroke-miterlimit\",1)}function l(t,e,r,i,a,o){var s,l,u,c,d=n(t,\"g\",\"contourbg\").selectAll(\"path\").data(\"fill\"!==o||a?[]:[0]);d.enter().append(\"path\"),d.exit().remove();var p=[];for(c=0;c<e.length;c++)s=e[c],l=h([],s.x,r.c2p),u=h([],s.y,i.c2p),p.push(f(l,u,s.bicubic));d.attr(\"d\",\"M\"+p.join(\"L\")+\"Z\").style(\"stroke\",\"none\")}function u(t,e,r,n,i,a,o,s,l,u,h){var f=e.selectAll(\"g.contourfill\").data([0]);f.enter().append(\"g\").classed(\"contourfill\",!0);var d=f.selectAll(\"path\").data(\"fill\"===u?i:[]);d.enter().append(\"path\"),d.exit().remove(),d.each(function(e){var i=v(t,e,a,o,s,l,r,n);e.prefixBoundary&&(i=h+i),i?c.select(this).attr(\"d\",i).style(\"stroke\",\"none\"):c.select(this).remove()})}var c=t(\"d3\"),h=t(\"../carpet/map_1d_array\"),f=t(\"../carpet/makepath\"),d=t(\"../../components/drawing\"),p=t(\"../contour/make_crossings\"),m=t(\"../contour/find_all_paths\"),g=t(\"./convert_to_constraints\"),v=t(\"./join_all_paths\"),y=t(\"./empty_pathinfo\"),b=t(\"./map_pathinfo\"),x=t(\"../carpet/lookup_carpetid\"),_=t(\"./close_boundaries\");e.exports=function(t,e,r){for(var n=0;n<r.length;n++)i(t,e,r[n])}},{\"../../components/drawing\":602,\"../carpet/lookup_carpetid\":858,\"../carpet/makepath\":859,\"../carpet/map_1d_array\":860,\"../contour/find_all_paths\":881,\"../contour/make_crossings\":885,\"./close_boundaries\":891,\"./convert_to_constraints\":895,\"./empty_pathinfo\":897,\"./join_all_paths\":899,\"./map_pathinfo\":900,d3:107}],902:[function(t,e,r){\"use strict\";var n=t(\"d3\"),i=t(\"../../components/drawing\"),a=t(\"../heatmap/style\"),o=t(\"../contour/make_color_map\");e.exports=function(t){var e=n.select(t).selectAll(\"g.contour\");e.style(\"opacity\",function(t){return t.trace.opacity}),e.each(function(t){var e=n.select(this),r=t.trace,a=r.contours,s=r.line,l=a.size||1,u=a.start;if(isFinite(l)||(l=0),e.selectAll(\"g.contourlevel\").each(function(){n.select(this).selectAll(\"path\").call(i.lineGroupStyle,s.width,s.color,s.dash)}),\"levels\"===r.contours.type&&\"none\"!==r.contours.coloring){var c=o(r);e.selectAll(\"g.contourbg path\").style(\"fill\",c(u-l/2)),e.selectAll(\"g.contourfill path\").style(\"fill\",function(t,e){return c(u+(e+.5)*l)})}else e.selectAll(\"g.contourfill path\").style(\"fill\",r.fillcolor)}),a(t)}},{\"../../components/drawing\":602,\"../contour/make_color_map\":884,\"../heatmap/style\":917,d3:107}],903:[function(t,e,r){\"use strict\";var n=t(\"../scatter/attributes\"),i=t(\"../../components/colorscale/attributes\"),a=t(\"../../components/colorbar/attributes\"),o=t(\"../../lib/extend\").extendFlat;e.exports=o({},{z:{valType:\"data_array\"},x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:{valType:\"data_array\"},transpose:{valType:\"boolean\",dflt:!1},xtype:{valType:\"enumerated\",values:[\"array\",\"scaled\"]},ytype:{valType:\"enumerated\",values:[\"array\",\"scaled\"]},zsmooth:{valType:\"enumerated\",values:[\"fast\",\"best\",!1],dflt:!1},connectgaps:{valType:\"boolean\",dflt:!1},xgap:{valType:\"number\",dflt:0,min:0},ygap:{valType:\"number\",dflt:0,min:0}},i,{autocolorscale:o({},i.autocolorscale,{dflt:!1})},{colorbar:a})},{\"../../components/colorbar/attributes\":579,\"../../components/colorscale/attributes\":583,\"../../lib/extend\":677,\"../scatter/attributes\":976}],904:[function(t,e,r){\"use strict\";var n=t(\"../../registry\"),i=t(\"../../lib\"),a=t(\"../../plots/cartesian/axes\"),o=t(\"../histogram2d/calc\"),s=t(\"../../components/colorscale/calc\"),l=t(\"./has_columns\"),u=t(\"./convert_column_xyz\"),c=t(\"./max_row_length\"),h=t(\"./clean_2d_array\"),f=t(\"./interp2d\"),d=t(\"./find_empties\"),p=t(\"./make_bound_array\");e.exports=function(t,e){function r(t){E=e._input.zsmooth=e.zsmooth=!1,i.notifier(\"cannot fast-zsmooth: \"+t)}var m,g,v,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\"),S=n.traceIs(e,\"gl2d\"),E=A?\"best\":e.zsmooth;if(M._minDtick=0,k._minDtick=0,T){var L=o(t,e);m=L.x,g=L.x0,v=L.dx,y=L.y,b=L.y0,x=L.dy,_=L.z}else l(e)&&u(e,M,k,\"x\",\"y\",[\"z\"]),m=e.x?M.makeCalcdata(e,\"x\"):[],y=e.y?k.makeCalcdata(e,\"y\"):[],g=e.x0||0,v=e.dx||1,b=e.y0||0,x=e.dy||1,_=h(e.z,e.transpose),(A||e.connectgaps)&&(e._emptypoints=d(_),e._interpz=f(_,e._emptypoints,e._interpz));if(\"fast\"===E)if(\"log\"===M.type||\"log\"===k.type)r(\"log axis found\");else if(!T){if(m.length){var C=(m[m.length-1]-m[0])/(m.length-1),z=Math.abs(C/100);for(w=0;w<m.length-1;w++)if(Math.abs(m[w+1]-m[w]-C)>z){r(\"x scale is not linear\");break}}if(y.length&&\"fast\"===E){var D=(y[y.length-1]-y[0])/(y.length-1),I=Math.abs(D/100);for(w=0;w<y.length-1;w++)if(Math.abs(y[w+1]-y[w]-D)>I){r(\"y scale is not linear\");break}}}var P=c(_),O=\"scaled\"===e.xtype?\"\":m,j=p(e,O,g,v,P,M),R=\"scaled\"===e.ytype?\"\":y,F=p(e,R,b,x,_.length,k);S||(a.expand(M,j),a.expand(k,F));var N={x:j,y:F,z:_,text:e.text};if(s(e,_,\"\",\"z\"),A&&e.contours&&\"heatmap\"===e.contours.coloring){var B={type:\"contour\"===e.type?\"heatmap\":\"histogram2d\",xcalendar:e.xcalendar,ycalendar:e.ycalendar};N.xfill=p(B,O,g,v,P,M),N.yfill=p(B,R,b,x,_.length,k)}return[N]}},{\"../../components/colorscale/calc\":584,\"../../lib\":685,\"../../plots/cartesian/axes\":724,\"../../registry\":802,\"../histogram2d/calc\":932,\"./clean_2d_array\":905,\"./convert_column_xyz\":907,\"./find_empties\":909,\"./has_columns\":910,\"./interp2d\":913,\"./make_bound_array\":914,\"./max_row_length\":915}],905:[function(t,e,r){\"use strict\";var n=t(\"fast-isnumeric\");e.exports=function(t,e){var r,i,a,o,s,l;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]=function(t){if(n(t))return+t}(o(t,s,l));return u}},{\"fast-isnumeric\":116}],906:[function(t,e,r){\"use strict\";var n=t(\"fast-isnumeric\"),i=t(\"../../lib\"),a=t(\"../../plots/plots\"),o=t(\"../../components/colorscale\"),s=t(\"../../components/colorbar/draw\");e.exports=function(t,e){var r=e[0].trace,l=\"cb\"+r.uid,u=r.zmin,c=r.zmax;if(n(u)||(u=i.aggNums(Math.min,null,r.z)),n(c)||(c=i.aggNums(Math.max,null,r.z)),t._fullLayout._infolayer.selectAll(\".\"+l).remove(),r.showscale){var h=e[0].t.cb=s(t,l),f=o.makeColorScaleFunc(o.extractScale(r.colorscale,u,c),{noNumericCheck:!0});h.fillcolor(f).filllevels({start:u,end:c,size:(c-u)/254}).options(r.colorbar)()}else a.autoMargin(t,l)}},{\"../../components/colorbar/draw\":581,\"../../components/colorscale\":592,\"../../lib\":685,\"../../plots/plots\":787,\"fast-isnumeric\":116}],907:[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,u,c,h=t[a].slice(),f=t[o].slice(),d=t.text,p=Math.min(h.length,f.length),m=void 0!==d&&!Array.isArray(d[0]),g=t[a+\"calendar\"],v=t[o+\"calendar\"];for(l=0;l<s.length;l++)(c=t[s[l]])&&(p=Math.min(p,c.length));for(p<h.length&&(h=h.slice(0,p)),p<f.length&&(f=f.slice(0,p)),l=0;l<p;l++)h[l]=e.d2c(h[l],0,g),f[l]=r.d2c(f[l],0,v);var y=n.distinctVals(h),b=y.vals,x=n.distinctVals(f),_=x.vals,w=[];for(l=0;l<s.length;l++)w[l]=n.init2dArray(_.length,b.length);var M,k,A;for(m&&(A=n.init2dArray(_.length,b.length)),l=0;l<p;l++)if(h[l]!==i&&f[l]!==i){for(M=n.findBin(h[l]+y.minDiff/2,b),k=n.findBin(f[l]+x.minDiff/2,_),u=0;u<s.length;u++)c=t[s[u]],w[u][k][M]=c[l];m&&(A[k][M]=d[l])}for(t[a]=b,t[o]=_,u=0;u<s.length;u++)t[s[u]]=w[u];m&&(t.text=A)}},{\"../../constants/numerical\":666,\"../../lib\":685}],908:[function(t,e,r){\"use strict\";var n=t(\"../../lib\"),i=t(\"./has_columns\"),a=t(\"./xyz_defaults\"),o=t(\"../../components/colorscale/defaults\"),s=t(\"./attributes\");e.exports=function(t,e,r,l){function u(r,i){return n.coerce(t,e,s,r,i)}a(t,e,u,l)?(u(\"text\"),!1===u(\"zsmooth\")&&(u(\"xgap\"),u(\"ygap\")),u(\"connectgaps\",i(e)&&!1!==e.zsmooth),o(t,e,l,u,{prefix:\"\",cLetter:\"z\"})):e.visible=!1}},{\"../../components/colorscale/defaults\":587,\"../../lib\":685,\"./attributes\":903,\"./has_columns\":910,\"./xyz_defaults\":918}],909:[function(t,e,r){\"use strict\";var n=t(\"./max_row_length\");e.exports=function(t){var e,r,i,a,o,s,l,u,c=[],h={},f=[],d=t[0],p=[],m=[0,0,0],g=n(t);for(r=0;r<t.length;r++)for(e=p,p=d,d=t[r+1]||[],i=0;i<g;i++)void 0===p[i]&&((s=(void 0!==p[i-1]?1:0)+(void 0!==p[i+1]?1:0)+(void 0!==e[i]?1:0)+(void 0!==d[i]?1:0))?(0===r&&s++,0===i&&s++,r===t.length-1&&s++,i===p.length-1&&s++,s<4&&(h[[r,i]]=[r,i,s]),c.push([r,i,s])):f.push([r,i]));for(;f.length;){for(l={},u=!1,o=f.length-1;o>=0;o--)(s=((h[[(r=(a=f[o])[0])-1,i=a[1]]]||m)[2]+(h[[r+1,i]]||m)[2]+(h[[r,i-1]]||m)[2]+(h[[r,i+1]]||m)[2])/20)&&(l[a]=[r,i,s],f.splice(o,1),u=!0);if(!u)throw\"findEmpties iterated with no new neighbors\";for(a in l)h[a]=l[a],c.push(l[a])}return c.sort(function(t,e){return e[2]-t[2]})}},{\"./max_row_length\":915}],910:[function(t,e,r){\"use strict\";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],911:[function(t,e,r){\"use strict\";var n=t(\"../../plots/cartesian/graph_interact\"),i=t(\"../../lib\"),a=t(\"../../plots/cartesian/constants\").MAXDIST;e.exports=function(t,e,r,o,s){if(!(t.distance<a)){var l,u,c,h,f=t.cd[0],d=f.trace,p=t.xa,m=t.ya,g=f.x,v=f.y,y=f.z,b=f.zmask,x=g,_=v;if(!1!==t.index){try{c=Math.round(t.index[1]),h=Math.round(t.index[0])}catch(e){return void i.error(\"Error hovering on heatmap, pointNumber must be [row,col], found:\",t.index)}if(c<0||c>=y[0].length||h<0||h>y.length)return}else{if(n.inbox(e-g[0],e-g[g.length-1])>a||n.inbox(r-v[0],r-v[v.length-1])>a)return;if(s){var w;for(x=[2*g[0]-g[1]],w=1;w<g.length;w++)x.push((g[w]+g[w-1])/2);for(x.push([2*g[g.length-1]-g[g.length-2]]),_=[2*v[0]-v[1]],w=1;w<v.length;w++)_.push((v[w]+v[w-1])/2);_.push([2*v[v.length-1]-v[v.length-2]])}c=Math.max(0,Math.min(x.length-2,i.findBin(e,x))),h=Math.max(0,Math.min(_.length-2,i.findBin(r,_)))}var M=p.c2p(g[c]),k=p.c2p(g[c+1]),A=m.c2p(v[h]),T=m.c2p(v[h+1]);s?(k=M,l=g[c],T=A,u=v[h]):(l=(g[c]+g[c+1])/2,u=(v[h]+v[h+1])/2,d.zsmooth&&(M=k=(M+k)/2,A=T=(A+T)/2));var S=y[h][c];b&&!b[h][c]&&(S=void 0);var E;return Array.isArray(f.text)&&Array.isArray(f.text[h])&&(E=f.text[h][c]),[i.extendFlat(t,{index:[h,c],distance:a+10,x0:M,x1:k,y0:A,y1:T,xLabelVal:l,yLabelVal:u,zLabelVal:S,text:E})]}}},{\"../../lib\":685,\"../../plots/cartesian/constants\":729,\"../../plots/cartesian/graph_interact\":733}],912:[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\":734,\"./attributes\":903,\"./calc\":904,\"./colorbar\":906,\"./defaults\":908,\"./hover\":911,\"./plot\":916,\"./style\":917}],913:[function(t,e,r){\"use strict\";function n(t){return.5-.25*Math.min(1,.5*t)}function i(t,e,r){var n,i,a,s,l,u,c,h,f,d,p,m,g,v=0;for(s=0;s<e.length;s++){for(i=(n=e[s])[0],a=n[1],p=t[i][a],d=0,f=0,l=0;l<4;l++)(c=t[i+(u=o[l])[0]])&&void 0!==(h=c[a+u[1]])&&(0===d?m=g=h:(m=Math.min(m,h),g=Math.max(g,h)),f++,d+=h);if(0===f)throw\"iterateInterp2d order is wrong: no defined neighbors\";t[i][a]=d/f,void 0===p?f<4&&(v=1):(t[i][a]=(1+r)*t[i][a]-r*p,g>m&&(v=Math.max(v,Math.abs(t[i][a]-p)/(g-m))))}return v}var a=t(\"../../lib\"),o=[[-1,0],[1,0],[0,-1],[0,1]];e.exports=function(t,e,r){var o,s,l=1;if(Array.isArray(r))for(o=0;o<e.length;o++)t[(s=e[o])[0]][s[1]]=r[s[0]][s[1]];else i(t,e);for(o=0;o<e.length&&!(e[o][2]<4);o++);for(e=e.slice(o),o=0;o<100&&l>.01;o++)l=i(t,e,n(l));return l>.01&&a.log(\"interp2d didn't converge quickly\",l),t}},{\"../../lib\":685}],914:[function(t,e,r){\"use strict\";var n=t(\"../../registry\");e.exports=function(t,e,r,i,a,o){var s,l,u,c=[],h=n.traceIs(t,\"contour\"),f=n.traceIs(t,\"histogram\"),d=n.traceIs(t,\"gl2d\");if(Array.isArray(e)&&e.length>1&&!f&&\"category\"!==o.type){var p=e.length;if(!(p<=a))return h?e.slice(0,a):e.slice(0,a+1);if(h||d)c=e.slice(0,a);else if(1===a)c=[e[0]-.5,e[0]+.5];else{for(c=[1.5*e[0]-.5*e[1]],u=1;u<p;u++)c.push(.5*(e[u-1]+e[u]));c.push(1.5*e[p-1]-.5*e[p-2])}if(p<a){var m=c[c.length-1],g=m-c[c.length-2];for(u=p;u<a;u++)m+=g,c.push(m)}}else{l=i||1;var v=t[o._id.charAt(0)+\"calendar\"];for(s=f||\"category\"===o.type?o.r2c(r,0,v)||0:Array.isArray(e)&&1===e.length?e[0]:void 0===r?0:o.d2c(r,0,v),u=h||d?0:-.5;u<a;u++)c.push(s+l*u)}return c}},{\"../../registry\":802}],915:[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}},{}],916:[function(t,e,r){\"use strict\";function n(t,e,r){function n(t,e){var r=e.length-2,n=o.constrain(o.findBin(t,e),0,r),i=e[n],a=e[n+1],s=o.constrain(n+(t-i)/(a-i)-.5,0,r),l=Math.round(s),u=Math.abs(s-l);return s&&s!==r&&u?{bin0:l,frac:u,bin1:Math.round(l+u/(s-l))}:{bin0:l,bin1:l,frac:0}}function c(t,e){if(void 0!==t){var r=q(t);return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),et+=e,rt+=r[0]*e,nt+=r[1]*e,it+=r[2]*e,r}return[0,0,0,0]}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])}var f=r[0].trace,d=f.uid,p=e.xaxis,m=e.yaxis,g=t._fullLayout,v=\"hm\"+d;if(g._paper.selectAll(\".contour\"+d).remove(),g._infolayer.selectAll(\"g.rangeslider-container\").selectAll(\".contour\"+d).remove(),!0!==f.visible)return g._paper.selectAll(\".\"+v).remove(),void g._infolayer.selectAll(\".cb\"+d).remove();var y,b,x,_,w,M,k=r[0].z,A=r[0].x,T=r[0].y,S=a.traceIs(f,\"contour\"),E=S?\"best\":f.zsmooth,L=k.length,C=u(k),z=!1,D=!1;for(M=0;void 0===y&&M<A.length-1;)y=p.c2p(A[M]),M++;for(M=A.length-1;void 0===b&&M>0;)b=p.c2p(A[M]),M--;for(b<y&&(x=b,b=y,y=x,z=!0),M=0;void 0===_&&M<T.length-1;)_=m.c2p(T[M]),M++;for(M=T.length-1;void 0===w&&M>0;)w=m.c2p(T[M]),M--;if(w<_&&(x=_,_=w,w=x,D=!0),S&&(A=r[0].xfill,T=r[0].yfill),\"fast\"!==E){var I=\"best\"===E?0:.5;y=Math.max(-I*p._length,y),b=Math.min((1+I)*p._length,b),_=Math.max(-I*m._length,_),w=Math.min((1+I)*m._length,w)}var P=Math.round(b-y),O=Math.round(w-_),j=P<=0||O<=0,R=e.plot.select(\".imagelayer\").selectAll(\"g.hm.\"+v).data(j?[]:[0]);if(R.enter().append(\"g\").classed(\"hm\",!0).classed(v,!0),R.exit().remove(),!j){var F,N;\"fast\"===E?(F=C,N=L):(F=P,N=O);var B=document.createElement(\"canvas\");B.width=F,B.height=N;var U,V,H=B.getContext(\"2d\"),q=s.makeColorScaleFunc(s.extractScale(f.colorscale,f.zmin,f.zmax),{noNumericCheck:!0,returnArray:!0});\"fast\"===E?(U=z?function(t){return C-1-t}:o.identity,V=D?function(t){return L-1-t}:o.identity):(U=function(t){return o.constrain(Math.round(p.c2p(A[t])-y),0,P)},V=function(t){return o.constrain(Math.round(m.c2p(T[t])-_),0,O)});var G,Y,W,X,Z,J,Q=V(0),K=[Q,Q],$=z?0:1,tt=D?0:1,et=0,rt=0,nt=0,it=0;if(E){var at,ot=0;try{at=new Uint8Array(P*O*4)}catch(t){at=new Array(P*O*4)}if(\"best\"===E){var st,lt,ut,ct=new Array(A.length),ht=new Array(T.length),ft=new Array(P);for(M=0;M<A.length;M++)ct[M]=Math.round(p.c2p(A[M])-y);for(M=0;M<T.length;M++)ht[M]=Math.round(m.c2p(T[M])-_);for(M=0;M<P;M++)ft[M]=n(M,ct);for(W=0;W<O;W++)for(lt=k[(st=n(W,ht)).bin0],ut=k[st.bin1],M=0;M<P;M++,ot+=4)J=function(t,e,r,n){var i=t[r.bin0];if(void 0===i)return c(void 0,1);var a,o=t[r.bin1],s=e[r.bin0],l=e[r.bin1],u=o-i||0,h=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,c(i+r.frac*u+n.frac*(h+r.frac*a))}(lt,ut,ft[M],st),h(at,ot,J)}else for(W=0;W<L;W++)for(Z=k[W],K=V(W),M=0;M<P;M++)J=c(Z[M],1),ot=4*(K*P+U(M)),h(at,ot,J);var dt=H.createImageData(P,O);try{dt.data.set(at)}catch(t){var pt=dt.data,mt=pt.length;for(W=0;W<mt;W++)pt[W]=at[W]}H.putImageData(dt,0,0)}else for(W=0;W<L;W++)if(Z=k[W],K.reverse(),K[tt]=V(W+1),K[0]!==K[1]&&void 0!==K[0]&&void 0!==K[1])for(Y=[X=U(0),X],M=0;M<C;M++)Y.reverse(),Y[$]=U(M+1),Y[0]!==Y[1]&&void 0!==Y[0]&&void 0!==Y[1]&&(J=c(Z[M],(Y[1]-Y[0])*(K[1]-K[0])),H.fillStyle=\"rgba(\"+J.join(\",\")+\")\",G=function(t,e,r,n,i,a,o,s,l){var u={x0:e,x1:r,y0:n,y1:i},c=2*t.xgap/3,h=2*t.ygap/3,f=t.xgap/3,d=t.ygap/3;return s===l-1&&(u.y1=i-h),a===o-1&&(u.x0=e+c),0===s&&(u.y0=n+h),0===a&&(u.x1=r-c),a>0&&a<o-1&&(u.x0=e+f,u.x1=r-f),s>0&&s<l-1&&(u.y0=n+d,u.y1=i-d),u}(f,Y[0],Y[1],K[0],K[1],M,C,W,L),H.fillRect(G.x0,G.y0,G.x1-G.x0,G.y1-G.y0));rt=Math.round(rt/et),nt=Math.round(nt/et),it=Math.round(it/et);var gt=i(\"rgb(\"+rt+\",\"+nt+\",\"+it+\")\");t._hmpixcount=(t._hmpixcount||0)+et,t._hmlumcount=(t._hmlumcount||0)+et*gt.getLuminance();var vt=R.selectAll(\"image\").data(r);vt.enter().append(\"svg:image\").attr({xmlns:l.svg,preserveAspectRatio:\"none\"}),vt.attr({height:O,width:P,x:y,y:_,\"xlink:href\":B.toDataURL(\"image/png\")}),vt.exit().remove()}}var i=t(\"tinycolor2\"),a=t(\"../../registry\"),o=t(\"../../lib\"),s=t(\"../../components/colorscale\"),l=t(\"../../constants/xmlns_namespaces\"),u=t(\"./max_row_length\");e.exports=function(t,e,r){for(var i=0;i<r.length;i++)n(t,e,r[i])}},{\"../../components/colorscale\":592,\"../../constants/xmlns_namespaces\":668,\"../../lib\":685,\"../../registry\":802,\"./max_row_length\":915,tinycolor2:514}],917:[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:107}],918:[function(t,e,r){\"use strict\";function n(t,e){var r=e(t);return\"scaled\"===(r?e(t+\"type\",\"array\"):\"scaled\")&&(e(t+\"0\"),e(\"d\"+t)),r}function i(t){for(var e,r=!0,n=!1,i=!1,o=0;o<t.length;o++){if(e=t[o],!Array.isArray(e)){r=!1;break}e.length>0&&(n=!0);for(var s=0;s<e.length;s++)if(a(e[s])){i=!0;break}}return r&&n&&i}var a=t(\"fast-isnumeric\"),o=t(\"../../registry\"),s=t(\"./has_columns\");e.exports=function(t,e,r,a,l,u){var c=r(\"z\");l=l||\"x\",u=u||\"y\";var h,f;if(void 0===c||!c.length)return 0;if(s(t)){if(h=r(l),f=r(u),!h||!f)return 0}else{if(h=n(l,r),f=n(u,r),!i(c))return 0;r(\"transpose\")}return o.getComponentMethod(\"calendars\",\"handleTraceDefaults\")(t,e,[l,u],a),e.z.length}},{\"../../registry\":802,\"./has_columns\":910,\"fast-isnumeric\":116}],919:[function(t,e,r){\"use strict\";for(var n=t(\"../heatmap/attributes\"),i=t(\"../../components/colorscale/attributes\"),a=t(\"../../components/colorbar/attributes\"),o=t(\"../../lib/extend\").extendFlat,s=[\"z\",\"x\",\"x0\",\"dx\",\"y\",\"y0\",\"dy\",\"text\",\"transpose\",\"xtype\",\"ytype\"],l={},u=0;u<s.length;u++){var c=s[u];l[c]=n[c]}o(l,i,{autocolorscale:o({},i.autocolorscale,{dflt:!1})},{colorbar:a}),e.exports=l},{\"../../components/colorbar/attributes\":579,\"../../components/colorscale/attributes\":583,\"../../lib/extend\":677,\"../heatmap/attributes\":903}],920:[function(t,e,r){\"use strict\";function n(t,e){this.scene=t,this.uid=e,this.type=\"heatmapgl\",this.name=\"\",this.hoverinfo=\"all\",this.xData=[],this.yData=[],this.zData=[],this.textLabels=[],this.idToIndex=[],this.bounds=[0,0,0,0],this.options={z:[],x:[],y:[],shape:[0,0],colorLevels:[0],colorValues:[0,0,0,1]},this.heatmap=o(t.glplot,this.options),this.heatmap._trace=this}function i(t){for(var e=t.colorscale,r=t.zmin,n=t.zmax,i=e.length,a=new Array(i),o=new Array(4*i),s=0;s<i;s++){var u=e[s],c=l(u[1]);a[s]=r+u[0]*(n-r);for(var h=0;h<4;h++)o[4*s+h]=c[h]}return{colorLevels:a,colorValues:o}}function a(t,e,r){var i=new n(t,e.uid);return i.update(e,r),i}var o=t(\"gl-heatmap2d\"),s=t(\"../../plots/cartesian/axes\"),l=t(\"../../lib/str2rgbarray\"),u=n.prototype;u.handlePick=function(t){var e=this.options,r=e.shape,n=t.pointId,i=n%r[0],a=Math.floor(n/r[0]),o=n;return{trace:this,dataCoord:t.dataCoord,traceCoord:[e.x[i],e.y[a],e.z[o]],textLabel:this.textLabels[n],name:this.name,pointIndex:[i,a],hoverinfo:this.hoverinfo}},u.update=function(t,e){var r=e[0];this.name=t.name,this.hoverinfo=t.hoverinfo;var n=r.z;this.options.z=[].concat.apply([],n);var a=n[0].length,o=n.length;this.options.shape=[a,o],this.options.x=r.x,this.options.y=r.y;var l=i(t);this.options.colorLevels=l.colorLevels,this.options.colorValues=l.colorValues,this.textLabels=[].concat.apply([],t.text),this.heatmap.update(this.options),s.expand(this.scene.xaxis,r.x),s.expand(this.scene.yaxis,r.y)},u.dispose=function(){this.heatmap.dispose()},e.exports=a},{\"../../lib/str2rgbarray\":703,\"../../plots/cartesian/axes\":724,\"gl-heatmap2d\":150}],921:[function(t,e,r){\"use strict\";var n={};n.attributes=t(\"./attributes\"),n.supplyDefaults=t(\"../heatmap/defaults\"),n.colorbar=t(\"../heatmap/colorbar\"),n.calc=t(\"../heatmap/calc\"),n.plot=t(\"./convert\"),n.moduleType=\"trace\",n.name=\"heatmapgl\",n.basePlotModule=t(\"../../plots/gl2d\"),n.categories=[\"gl2d\",\"2dMap\"],n.meta={},e.exports=n},{\"../../plots/gl2d\":764,\"../heatmap/calc\":904,\"../heatmap/colorbar\":906,\"../heatmap/defaults\":908,\"./attributes\":919,\"./convert\":920}],922:[function(t,e,r){\"use strict\";var n=t(\"../bar/attributes\");e.exports={x:{valType:\"data_array\"},y:{valType:\"data_array\"},text:n.text,orientation:n.orientation,histfunc:{valType:\"enumerated\",values:[\"count\",\"sum\",\"avg\",\"min\",\"max\"],dflt:\"count\"},histnorm:{valType:\"enumerated\",values:[\"\",\"percent\",\"probability\",\"density\",\"probability density\"],dflt:\"\"},cumulative:{enabled:{valType:\"boolean\",dflt:!1},direction:{valType:\"enumerated\",values:[\"increasing\",\"decreasing\"],dflt:\"increasing\"},currentbin:{valType:\"enumerated\",values:[\"include\",\"exclude\",\"half\"],dflt:\"include\"}},autobinx:{valType:\"boolean\",dflt:null},nbinsx:{valType:\"integer\",min:0,dflt:0},xbins:{start:{valType:\"any\",dflt:null},end:{valType:\"any\",dflt:null},size:{valType:\"any\",dflt:null}},autobiny:{valType:\"boolean\",dflt:null},nbinsy:{valType:\"integer\",min:0,dflt:0},ybins:{start:{valType:\"any\",dflt:null},end:{valType:\"any\",dflt:null},size:{valType:\"any\",dflt:null}},marker:n.marker,error_y:n.error_y,error_x:n.error_x,_deprecated:{bardir:n._deprecated.bardir}}},{\"../bar/attributes\":812}],923:[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}},{}],924:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,n){return r(\"histnorm\"),n.forEach(function(t){r(t+\"bins.start\"),r(t+\"bins.end\"),r(t+\"bins.size\"),r(\"autobin\"+t),r(\"nbins\"+t)}),e}},{}],925:[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\":116}],926:[function(t,e,r){\"use strict\";function n(t,e,r){function n(e){s=t[e],t[e]/=2}function i(e){o=t[e],t[e]=s+o/2,s+=o}var a,o,s;if(\"half\"===r)if(\"increasing\"===e)for(n(0),a=1;a<t.length;a++)i(a);else for(n(t.length-1),a=t.length-2;a>=0;a--)i(a);else if(\"increasing\"===e){for(a=1;a<t.length;a++)t[a]+=t[a-1];\"exclude\"===r&&(t.unshift(0),t.pop())}else{for(a=t.length-2;a>=0;a--)t[a]+=t[a+1];\"exclude\"===r&&(t.push(0),t.shift())}}var i=t(\"fast-isnumeric\"),a=t(\"../../lib\"),o=t(\"../../plots/cartesian/axes\"),s=t(\"../bar/arrays_to_calcdata\"),l=t(\"./bin_functions\"),u=t(\"./norm_functions\"),c=t(\"./average\"),h=t(\"./clean_bins\");e.exports=function(t,e){if(!0===e.visible){var r,f=[],d=[],p=o.getFromId(t,\"h\"===e.orientation?e.yaxis||\"y\":e.xaxis||\"x\"),m=\"h\"===e.orientation?\"y\":\"x\",g={x:\"y\",y:\"x\"}[m],v=e[m+\"calendar\"],y=e.cumulative;h(e,p,m);var b,x=p.makeCalcdata(e,m),_=m+\"bins\";!1===e[\"autobin\"+m]&&_ in e?b=e[_]:(b=o.autoBin(x,p,e[\"nbins\"+m],!1,v),y.enabled&&\"include\"!==y.currentbin&&(\"decreasing\"===y.direction?b.start=p.c2r(p.r2c(b.start)-b.size):b.end=p.c2r(p.r2c(b.end)+b.size)),e._input[_]=e[_]=b);var w,M,k,A=\"string\"==typeof b.size,T=A?[]:b,S=[],E=[],L=0,C=e.histnorm,z=e.histfunc,D=-1!==C.indexOf(\"density\");y.enabled&&D&&(C=C.replace(/ ?density$/,\"\"),D=!1);var I,P=\"max\"===z||\"min\"===z?null:0,O=l.count,j=u[C],R=!1,F=function(t){return p.r2c(t,0,v)};for(Array.isArray(e[g])&&\"count\"!==z&&(I=e[g],R=\"avg\"===z,O=l[z]),r=F(b.start),M=F(b.end)+(r-o.tickIncrement(r,b.size,!1,v))/1e6;r<M&&f.length<5e3;)w=o.tickIncrement(r,b.size,!1,v),f.push((r+w)/2),d.push(P),A&&T.push(r),D&&S.push(1/(w-r)),R&&E.push(0),r=w;A||\"date\"!==p.type||(T={start:F(T.start),end:F(T.end),size:T.size});var N=d.length;for(r=0;r<x.length;r++)(k=a.findBin(x[r],T))>=0&&k<N&&(L+=O(k,r,d,I,E));R&&(L=c(d,E)),j&&j(d,L,S),y.enabled&&n(d,y.direction,y.currentbin);var B=Math.min(f.length,d.length),U=[],V=0,H=B-1;for(r=0;r<B;r++)if(d[r]){V=r;break}for(r=B-1;r>V;r--)if(d[r]){H=r;break}for(r=V;r<=H;r++)i(f[r])&&i(d[r])&&U.push({p:f[r],s:d[r],b:0});return s(U,e),U}}},{\"../../lib\":685,\"../../plots/cartesian/axes\":724,\"../bar/arrays_to_calcdata\":811,\"./average\":923,\"./bin_functions\":925,\"./clean_bins\":927,\"./norm_functions\":930,\"fast-isnumeric\":116}],927:[function(t,e,r){\"use strict\";var n=t(\"fast-isnumeric\"),i=t(\"../../lib\").cleanDate,a=t(\"../../constants/numerical\"),o=a.ONEDAY,s=a.BADNUM;e.exports=function(t,e,r){var a=e.type,l=r+\"bins\",u=t[l];u||(u=t[l]={});var c=\"date\"===a?function(t){return t||0===t?i(t,s,u.calendar):null}:function(t){return n(t)?Number(t):null};u.start=c(u.start),u.end=c(u.end);var h=\"date\"===a?o:1,f=u.size;if(n(f))u.size=f>0?Number(f):h;else if(\"string\"!=typeof f)u.size=h;else{var d=f.charAt(0),p=f.substr(1);((p=n(p)?Number(p):0)<=0||\"date\"!==a||\"M\"!==d||p!==Math.round(p))&&(u.size=h)}var m=\"autobin\"+r;\"boolean\"!=typeof t[m]&&(t[m]=!((u.start||0===u.start)&&(u.end||0===u.end))),t[m]||delete t[\"nbins\"+r]}},{\"../../constants/numerical\":666,\"../../lib\":685,\"fast-isnumeric\":116}],928:[function(t,e,r){\"use strict\";var n=t(\"../../registry\"),i=t(\"../../lib\"),a=t(\"../../components/color\"),o=t(\"./bin_defaults\"),s=t(\"../bar/style_defaults\"),l=t(\"../../components/errorbars/defaults\"),u=t(\"./attributes\");e.exports=function(t,e,r,c){function h(r,n){return i.coerce(t,e,u,r,n)}var f=h(\"x\"),d=h(\"y\");h(\"cumulative.enabled\")&&(h(\"cumulative.direction\"),h(\"cumulative.currentbin\")),h(\"text\");var p=h(\"orientation\",d&&!f?\"h\":\"v\"),m=e[\"v\"===p?\"x\":\"y\"];m&&m.length?(n.getComponentMethod(\"calendars\",\"handleTraceDefaults\")(t,e,[\"x\",\"y\"],c),e[\"h\"===p?\"x\":\"y\"]&&h(\"histfunc\"),o(t,e,h,\"h\"===p?[\"y\"]:[\"x\"]),s(t,e,h,r,c),l(t,e,a.defaultLine,{axis:\"y\"}),l(t,e,a.defaultLine,{axis:\"x\",inherit:\"y\"})):e.visible=!1}},{\"../../components/color\":578,\"../../components/errorbars/defaults\":607,\"../../lib\":685,\"../../registry\":802,\"../bar/style_defaults\":823,\"./attributes\":922,\"./bin_defaults\":924}],929:[function(t,e,r){\"use strict\";var n={};n.attributes=t(\"./attributes\"),n.layoutAttributes=t(\"../bar/layout_attributes\"),n.supplyDefaults=t(\"./defaults\"),n.supplyLayoutDefaults=t(\"../bar/layout_defaults\"),n.calc=t(\"./calc\"),n.setPositions=t(\"../bar/set_positions\"),n.plot=t(\"../bar/plot\"),n.style=t(\"../bar/style\"),n.colorbar=t(\"../scatter/colorbar\"),n.hoverPoints=t(\"../bar/hover\"),n.moduleType=\"trace\",n.name=\"histogram\",n.basePlotModule=t(\"../../plots/cartesian\"),n.categories=[\"cartesian\",\"bar\",\"histogram\",\"oriented\",\"errorBarsOK\",\"showLegend\"],n.meta={},e.exports=n},{\"../../plots/cartesian\":734,\"../bar/hover\":815,\"../bar/layout_attributes\":817,\"../bar/layout_defaults\":818,\"../bar/plot\":819,\"../bar/set_positions\":820,\"../bar/style\":822,\"../scatter/colorbar\":979,\"./attributes\":922,\"./calc\":926,\"./defaults\":928}],930:[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}}},{}],931:[function(t,e,r){\"use strict\";var n=t(\"../histogram/attributes\"),i=t(\"../heatmap/attributes\"),a=t(\"../../components/colorscale/attributes\"),o=t(\"../../components/colorbar/attributes\"),s=t(\"../../lib/extend\").extendFlat;e.exports=s({},{x:n.x,y:n.y,z:{valType:\"data_array\"},marker:{color:{valType:\"data_array\"}},histnorm:n.histnorm,histfunc:n.histfunc,autobinx:n.autobinx,nbinsx:n.nbinsx,xbins:n.xbins,autobiny:n.autobiny,nbinsy:n.nbinsy,ybins:n.ybins,xgap:i.xgap,ygap:i.ygap,zsmooth:i.zsmooth},a,{autocolorscale:s({},a.autocolorscale,{dflt:!1})},{colorbar:o})},{\"../../components/colorbar/attributes\":579,\"../../components/colorscale/attributes\":583,\"../../lib/extend\":677,\"../heatmap/attributes\":903,\"../histogram/attributes\":922}],932:[function(t,e,r){\"use strict\";var n=t(\"../../lib\"),i=t(\"../../plots/cartesian/axes\"),a=t(\"../histogram/bin_functions\"),o=t(\"../histogram/norm_functions\"),s=t(\"../histogram/average\"),l=t(\"../histogram/clean_bins\");e.exports=function(t,e){var r,u,c,h,f,d,p=i.getFromId(t,e.xaxis||\"x\"),m=e.x?p.makeCalcdata(e,\"x\"):[],g=i.getFromId(t,e.yaxis||\"y\"),v=e.y?g.makeCalcdata(e,\"y\"):[],y=e.xcalendar,b=e.ycalendar,x=function(t){return p.r2c(t,0,y)},_=function(t){return g.r2c(t,0,b)},w=function(t){return p.c2r(t,0,y)},M=function(t){return g.c2r(t,0,b)};l(e,p,\"x\"),l(e,g,\"y\");var k=Math.min(m.length,v.length);m.length>k&&m.splice(k,m.length-k),v.length>k&&v.splice(k,v.length-k),!e.autobinx&&\"xbins\"in e||(e.xbins=i.autoBin(m,p,e.nbinsx,\"2d\",y),\"histogram2dcontour\"===e.type&&(e.xbins.start=w(i.tickIncrement(x(e.xbins.start),e.xbins.size,!0,y)),e.xbins.end=w(i.tickIncrement(x(e.xbins.end),e.xbins.size,!1,y))),e._input.xbins=e.xbins),!e.autobiny&&\"ybins\"in e||(e.ybins=i.autoBin(v,g,e.nbinsy,\"2d\",b),\"histogram2dcontour\"===e.type&&(e.ybins.start=M(i.tickIncrement(_(e.ybins.start),e.ybins.size,!0,b)),e.ybins.end=M(i.tickIncrement(_(e.ybins.end),e.ybins.size,!1,b))),e._input.ybins=e.ybins),f=[];var A,T,S=[],E=[],L=\"string\"==typeof e.xbins.size,C=\"string\"==typeof e.ybins.size,z=L?[]:e.xbins,D=C?[]:e.ybins,I=0,P=[],O=e.histnorm,j=e.histfunc,R=-1!==O.indexOf(\"density\"),F=\"max\"===j||\"min\"===j?null:0,N=a.count,B=o[O],U=!1,V=[],H=[],q=\"z\"in e?e.z:\"marker\"in e&&Array.isArray(e.marker.color)?e.marker.color:\"\";q&&\"count\"!==j&&(U=\"avg\"===j,N=a[j]);var G=e.xbins,Y=x(G.start),W=x(G.end)+(Y-i.tickIncrement(Y,G.size,!1,y))/1e6;for(d=Y;d<W;d=i.tickIncrement(d,G.size,!1,y))S.push(F),L&&z.push(d),U&&E.push(0);L&&z.push(d);var X=S.length,Z=x(r=e.xbins.start);for(r=w(Z+(u=(d-Z)/X)/2),Y=_((G=e.ybins).start),W=_(G.end)+(Y-i.tickIncrement(Y,G.size,!1,b))/1e6,d=Y;d<W;d=i.tickIncrement(d,G.size,!1,b))f.push(S.concat()),C&&D.push(d),U&&P.push(E.concat());C&&D.push(d);var J=f.length,Q=_(c=e.ybins.start);for(c=M(Q+(h=(d-Q)/J)/2),R&&(V=S.map(function(t,e){return L?1/(z[e+1]-z[e]):1/u}),H=f.map(function(t,e){return C?1/(D[e+1]-D[e]):1/h})),L||\"date\"!==p.type||(z={start:x(z.start),end:x(z.end),size:z.size}),C||\"date\"!==g.type||(D={start:_(D.start),end:_(D.end),size:D.size}),d=0;d<k;d++)A=n.findBin(m[d],z),T=n.findBin(v[d],D),A>=0&&A<X&&T>=0&&T<J&&(I+=N(A,d,f[T],q,P[T]));if(U)for(T=0;T<J;T++)I+=s(f[T],P[T]);if(B)for(T=0;T<J;T++)B(f[T],I,V,H[T]);return{x:m,x0:r,dx:u,y:v,y0:c,dy:h,z:f}}},{\"../../lib\":685,\"../../plots/cartesian/axes\":724,\"../histogram/average\":923,\"../histogram/bin_functions\":925,\"../histogram/clean_bins\":927,\"../histogram/norm_functions\":930}],933:[function(t,e,r){\"use strict\";var n=t(\"../../lib\"),i=t(\"./sample_defaults\"),a=t(\"../../components/colorscale/defaults\"),o=t(\"./attributes\");e.exports=function(t,e,r,s){function l(r,i){return n.coerce(t,e,o,r,i)}i(t,e,l,s),!1===l(\"zsmooth\")&&(l(\"xgap\"),l(\"ygap\")),a(t,e,s,l,{prefix:\"\",cLetter:\"z\"})}},{\"../../components/colorscale/defaults\":587,\"../../lib\":685,\"./attributes\":931,\"./sample_defaults\":935}],934:[function(t,e,r){\"use strict\";var n={};n.attributes=t(\"./attributes\"),n.supplyDefaults=t(\"./defaults\"),n.calc=t(\"../heatmap/calc\"),n.plot=t(\"../heatmap/plot\"),n.colorbar=t(\"../heatmap/colorbar\"),n.style=t(\"../heatmap/style\"),n.hoverPoints=t(\"../heatmap/hover\"),n.moduleType=\"trace\",n.name=\"histogram2d\",n.basePlotModule=t(\"../../plots/cartesian\"),n.categories=[\"cartesian\",\"2dMap\",\"histogram\"],n.meta={},e.exports=n},{\"../../plots/cartesian\":734,\"../heatmap/calc\":904,\"../heatmap/colorbar\":906,\"../heatmap/hover\":911,\"../heatmap/plot\":916,\"../heatmap/style\":917,\"./attributes\":931,\"./defaults\":933}],935:[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\");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\"])):e.visible=!1}},{\"../../registry\":802,\"../histogram/bin_defaults\":924}],936:[function(t,e,r){\"use strict\";var n=t(\"../histogram2d/attributes\"),i=t(\"../contour/attributes\"),a=t(\"../../components/colorscale/attributes\"),o=t(\"../../components/colorbar/attributes\"),s=t(\"../../lib/extend\").extendFlat;e.exports=s({},{x:n.x,y:n.y,z:n.z,marker:n.marker,histnorm:n.histnorm,histfunc:n.histfunc,autobinx:n.autobinx,nbinsx:n.nbinsx,xbins:n.xbins,autobiny:n.autobiny,nbinsy:n.nbinsy,ybins:n.ybins,autocontour:i.autocontour,ncontours:i.ncontours,contours:i.contours,line:i.line},a,{colorbar:o})},{\"../../components/colorbar/attributes\":579,\"../../components/colorscale/attributes\":583,\"../../lib/extend\":677,\"../contour/attributes\":874,\"../histogram2d/attributes\":931}],937:[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 u(r,i){return n.coerce(t,e,s,r,i)}i(t,e,u,l),a(t,e,u),o(t,e,u,l)}},{\"../../lib\":685,\"../contour/contours_defaults\":878,\"../contour/style_defaults\":888,\"../histogram2d/sample_defaults\":935,\"./attributes\":936}],938:[function(t,e,r){\"use strict\";var n={};n.attributes=t(\"./attributes\"),n.supplyDefaults=t(\"./defaults\"),n.calc=t(\"../contour/calc\"),n.plot=t(\"../contour/plot\"),n.style=t(\"../contour/style\"),n.colorbar=t(\"../contour/colorbar\"),n.hoverPoints=t(\"../contour/hover\"),n.moduleType=\"trace\",n.name=\"histogram2dcontour\",n.basePlotModule=t(\"../../plots/cartesian\"),n.categories=[\"cartesian\",\"2dMap\",\"contour\",\"histogram\"],n.meta={},e.exports=n},{\"../../plots/cartesian\":734,\"../contour/calc\":875,\"../contour/colorbar\":876,\"../contour/hover\":882,\"../contour/plot\":886,\"../contour/style\":887,\"./attributes\":936,\"./defaults\":937}],939:[function(t,e,r){\"use strict\";var n=t(\"../../components/colorscale/attributes\"),i=t(\"../../components/colorbar/attributes\"),a=t(\"../surface/attributes\"),o=t(\"../../lib/extend\").extendFlat;e.exports={x:{valType:\"data_array\"},y:{valType:\"data_array\"},z:{valType:\"data_array\"},i:{valType:\"data_array\"},j:{valType:\"data_array\"},k:{valType:\"data_array\"},delaunayaxis:{valType:\"enumerated\",values:[\"x\",\"y\",\"z\"],dflt:\"z\"},alphahull:{valType:\"number\",dflt:-1},intensity:{valType:\"data_array\"},color:{valType:\"color\"},vertexcolor:{valType:\"data_array\"},facecolor:{valType:\"data_array\"},opacity:o({},a.opacity),flatshading:{valType:\"boolean\",dflt:!1},contour:{show:o({},a.contours.x.show,{}),color:o({},a.contours.x.color),width:o({},a.contours.x.width)},colorscale:n.colorscale,reversescale:n.reversescale,showscale:n.showscale,colorbar:i,lightposition:{x:o({},a.lightposition.x,{dflt:1e5}),y:o({},a.lightposition.y,{dflt:1e5}),z:o({},a.lightposition.z,{dflt:0})},lighting:o({},{vertexnormalsepsilon:{valType:\"number\",min:0,max:1,dflt:1e-12},facenormalsepsilon:{valType:\"number\",min:0,max:1,dflt:1e-6}},a.lighting)}},{\"../../components/colorbar/attributes\":579,\"../../components/colorscale/attributes\":583,\"../../lib/extend\":677,\"../surface/attributes\":1039}],940:[function(t,e,r){\"use strict\";function n(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name=\"\",this.color=\"#fff\",this.data=null,this.showContour=!1}function i(t){return t.map(function(t){var e=t[0],r=u(t[1]).toRgb();return{index:e,rgb:[r.r,r.g,r.b,1]}})}function a(t){return t.map(d)}function o(t,e,r){for(var n=new Array(t.length),i=0;i<t.length;++i)n[i]=[t[i],e[i],r[i]];return n}function s(t,e){var r=t.glplot.gl,i=l({gl:r}),a=new n(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}var l=t(\"gl-mesh3d\"),u=t(\"tinycolor2\"),c=t(\"delaunay-triangulate\"),h=t(\"alpha-shape\"),f=t(\"convex-hull\"),d=t(\"../../lib/str2rgbarray\"),p=n.prototype;p.handlePick=function(t){if(t.object===this.mesh){var e=t.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},p.update=function(t){function e(t,e,r,n){return e.map(function(e){return t.d2l(e,0,n)*r})}var r=this.scene,n=r.fullSceneLayout;this.data=t;var s,l=o(e(n.xaxis,t.x,r.dataScale[0],t.xcalendar),e(n.yaxis,t.y,r.dataScale[1],t.ycalendar),e(n.zaxis,t.z,r.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k)s=o(t.i,t.j,t.k);else if(0===t.alphahull)s=f(l);else if(t.alphahull>0)s=h(t.alphahull,l);else{var u=[\"x\",\"y\",\"z\"].indexOf(t.delaunayaxis);s=c(l.map(function(t){return[t[(u+1)%3],t[(u+2)%3]]}))}var p={positions:l,cells:s,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:d(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color=\"#fff\",p.vertexIntensity=t.intensity,p.colormap=i(t.colorscale)):t.vertexcolor?(this.color=t.vertexcolors[0],p.vertexColors=a(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],p.cellColors=a(t.facecolor)):(this.color=t.color,p.meshColor=d(t.color)),this.mesh.update(p)},p.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=s},{\"../../lib/str2rgbarray\":703,\"alpha-shape\":38,\"convex-hull\":96,\"delaunay-triangulate\":108,\"gl-mesh3d\":189,tinycolor2:514}],941:[function(t,e,r){\"use strict\";var n=t(\"../../registry\"),i=t(\"../../lib\"),a=t(\"../../components/colorbar/defaults\"),o=t(\"./attributes\");e.exports=function(t,e,r,s){function l(r,n){return i.coerce(t,e,o,r,n)}function u(t){var e=t.map(function(t){var e=l(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var c=u([\"x\",\"y\",\"z\"]),h=u([\"i\",\"j\",\"k\"]);c?(h&&h.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\"),l(\"showscale\",!0)):(e.showscale=!1,\"vertexcolor\"in t?l(\"vertexcolor\"):\"facecolor\"in t?l(\"facecolor\"):l(\"color\",r)),e.reversescale&&(e.colorscale=e.colorscale.map(function(t){return[1-t[0],t[1]]}).reverse()),e.showscale&&a(t,e,s)):e.visible=!1}},{\"../../components/colorbar/defaults\":580,\"../../lib\":685,\"../../registry\":802,\"./attributes\":939}],942:[function(t,e,r){\"use strict\";var n={};n.attributes=t(\"./attributes\"),n.supplyDefaults=t(\"./defaults\"),n.colorbar=t(\"../heatmap/colorbar\"),n.plot=t(\"./convert\"),n.moduleType=\"trace\",n.name=\"mesh3d\",n.basePlotModule=t(\"../../plots/gl3d\"),n.categories=[\"gl3d\"],n.meta={},e.exports=n},{\"../../plots/gl3d\":767,\"../heatmap/colorbar\":906,\"./attributes\":939,\"./convert\":940,\"./defaults\":941}],943:[function(t,e,r){\"use strict\";var n=t(\"../../lib\"),i=t(\"../scatter/attributes\"),a=t(\"../../components/drawing/attributes\").dash,o=i.line,s={name:{valType:\"string\"},showlegend:{valType:\"boolean\",dflt:!0},line:{color:o.color,width:o.width,dash:a}};e.exports={x:{valType:\"data_array\"},open:{valType:\"data_array\",dflt:[]},high:{valType:\"data_array\",dflt:[]},low:{valType:\"data_array\",dflt:[]},close:{valType:\"data_array\",dflt:[]},line:{width:n.extendFlat({},o.width,{}),dash:n.extendFlat({},a,{})},increasing:n.extendDeep({},s,{line:{color:{dflt:\"#3D9970\"}}}),decreasing:n.extendDeep({},s,{line:{color:{dflt:\"#FF4136\"}}}),text:{valType:\"string\",dflt:\"\",arrayOk:!0},tickwidth:{valType:\"number\",min:0,max:.5,dflt:.3}}},{\"../../components/drawing/attributes\":601,\"../../lib\":685,\"../scatter/attributes\":976}],944:[function(t,e,r){\"use strict\";function n(t,e,r,n){o(t,e,r,n),r(n+\".line.color\"),r(n+\".line.width\",e.line.width),r(n+\".line.dash\",e.line.dash)}var i=t(\"../../lib\"),a=t(\"./ohlc_defaults\"),o=t(\"./direction_defaults\"),s=t(\"./attributes\"),l=t(\"./helpers\");e.exports=function(t,e,r,o){function u(r,n){return i.coerce(t,e,s,r,n)}l.pushDummyTransformOpts(t,e),0!==a(t,e,u,o)?(u(\"line.width\"),u(\"line.dash\"),n(t,e,u,\"increasing\"),n(t,e,u,\"decreasing\"),u(\"text\"),u(\"tickwidth\")):e.visible=!1}},{\"../../lib\":685,\"./attributes\":943,\"./direction_defaults\":945,\"./helpers\":946,\"./ohlc_defaults\":948}],945:[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)}},{}],946:[function(t,e,r){\"use strict\";var n=t(\"../../lib\");r.pushDummyTransformOpts=function(t,e){var r={type:e.type,_ephemeral:!0};Array.isArray(t.transforms)?t.transforms.push(r):t.transforms=[r]},r.clearEphemeralTransformOpts=function(t){var e=t.transforms;if(Array.isArray(e)){for(var r=0;r<e.length;r++)e[r]._ephemeral&&e.splice(r,1);0===e.length&&delete t.transforms}},r.copyOHLC=function(t,e){t.open&&(e.open=t.open),t.high&&(e.high=t.high),t.low&&(e.low=t.low),t.close&&(e.close=t.close)},r.makeTransform=function(t,e,r){var i=n.extendFlat([],t.transforms);return i[e.transformIndex]={type:t.type,direction:r,open:t.open,high:t.high,low:t.low,close:t.close},i},r.getFilterFn=function(t){switch(t){case\"increasing\":return function(t,e){return t<=e};case\"decreasing\":return function(t,e){return t>e}}},r.addRangeSlider=function(t,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\":685}],947:[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\":714,\"../../plots/cartesian\":734,\"../scatter\":986,\"./attributes\":943,\"./defaults\":944,\"./transform\":949}],948:[function(t,e,r){\"use strict\";var n=t(\"../../registry\");e.exports=function(t,e,r,i){var a,o=r(\"x\"),s=r(\"open\"),l=r(\"high\"),u=r(\"low\"),c=r(\"close\");return n.getComponentMethod(\"calendars\",\"handleTraceDefaults\")(t,e,[\"x\"],i),a=Math.min(s.length,l.length,u.length,c.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<u.length&&(e.low=u.slice(0,a)),a<c.length&&(e.close=c.slice(0,a)),a}},{\"../../registry\":802}],949:[function(t,e,r){\"use strict\";function n(t,e,r){var n={type:\"scatter\",mode:\"lines\",connectgaps:!1,visible:t.visible,opacity:t.opacity,xaxis:t.xaxis,yaxis:t.yaxis,hoverinfo:i(t),transforms:s.makeTransform(t,e,r)},a=t[r];return a&&o.extendFlat(n,{x:t.x||[0],xcalendar:t.xcalendar,y:[].concat(t.low).concat(t.high),text:t.text,name:a.name,showlegend:a.showlegend,line:a.line}),n}function i(t){var e=t.hoverinfo;if(\"all\"===e)return\"x+text+name\";var r=e.split(\"+\"),n=r.indexOf(\"y\"),i=r.indexOf(\"text\");return-1!==n&&(r.splice(n,1),-1===i&&r.push(\"text\")),r.join(\"+\")}function a(t,e,r){var n=r._fullInput,i=n.tickwidth,a=n._minDiff;if(!a){var s=t._fullData,l=[];a=1/0;var u;for(u=0;u<s.length;u++){var c=s[u]._fullInput;if(\"ohlc\"===c.type&&!0===c.visible&&c.xaxis===e._id&&(l.push(c),c.x&&c.x.length>1)){var h=o.simpleMap(c.x,e.d2c,0,r.xcalendar),f=o.distinctVals(h).minDiff;a=Math.min(a,f)}}for(a===1/0&&(a=1),u=0;u<l.length;u++)l[u]._minDiff=a}return a*i}var o=t(\"../../lib\"),s=t(\"./helpers\"),l=t(\"../../plots/cartesian/axes\"),u=t(\"../../plots/cartesian/axis_ids\");r.moduleType=\"transform\",r.name=\"ohlc\",r.attributes={},r.supplyDefaults=function(t,e,r,n){return s.clearEphemeralTransformOpts(n),s.copyOHLC(t,e),t},r.transform=function(t,e){for(var r=[],i=0;i<t.length;i++){var a=t[i];\"ohlc\"===a.type?r.push(n(a,e,\"increasing\"),n(a,e,\"decreasing\")):r.push(a)}return s.addRangeSlider(r,e.layout),r},r.calcTransform=function(t,e,r){var n,i=r.direction,o=s.getFilterFn(i),c=u.getFromTrace(t,e,\"x\"),h=u.getFromTrace(t,e,\"y\"),f=a(t,c,e),d=e.open,p=e.high,m=e.low,g=e.close,v=e.text,y=d.length,b=[],x=[],_=[];n=e._fullInput.x?function(t){var r=e.x[t],n=e.xcalendar,i=c.d2c(r,0,n);b.push(c.c2d(i-f,0,n),r,r,r,r,c.c2d(i+f,0,n),null)}:function(t){b.push(t-f,t,t,t,t,t+f,null)};for(var w=function(t,e){return l.tickText(t,t.c2l(e),\"hover\").text},M=e._fullInput.hoverinfo,k=M.split(\"+\"),A=\"all\"===M,T=A||-1!==k.indexOf(\"y\"),S=A||-1!==k.indexOf(\"text\"),E=Array.isArray(v)?function(t){return v[t]||\"\"}:function(){return v},L=0;L<y;L++)o(d[L],g[L])&&(n(L),function(t,e,r,n){x.push(t,t,e,r,n,n,null)}(d[L],p[L],m[L],g[L]),function(t,e,r,n,i){var a=[];T&&(a.push(\"Open: \"+w(h,e)),a.push(\"High: \"+w(h,r)),a.push(\"Low: \"+w(h,n)),a.push(\"Close: \"+w(h,i))),S&&a.push(E(t));var o=a.join(\"<br>\");_.push(o,o,o,o,o,o,null)}(L,d[L],p[L],m[L],g[L]));e.x=b,e.y=x,e.text=_}},{\"../../lib\":685,\"../../plots/cartesian/axes\":724,\"../../plots/cartesian/axis_ids\":727,\"./helpers\":946}],950:[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(\"../../lib/extend\").extendDeep,l=t(\"../../lib/extend\").extendFlat;e.exports={domain:{x:{valType:\"info_array\",items:[{valType:\"number\",min:0,max:1},{valType:\"number\",min:0,max:1}],dflt:[0,1]},y:{valType:\"info_array\",items:[{valType:\"number\",min:0,max:1},{valType:\"number\",min:0,max:1}],dflt:[0,1]}},dimensions:{_isLinkedToArray:\"dimension\",label:{valType:\"string\"},tickvals:o.tickvals,ticktext:o.ticktext,tickformat:{valType:\"string\",dflt:\"3s\"},visible:{valType:\"boolean\",dflt:!0},range:{valType:\"info_array\",items:[{valType:\"number\"},{valType:\"number\"}]},constraintrange:{valType:\"info_array\",items:[{valType:\"number\"},{valType:\"number\"}]},values:{valType:\"data_array\",dflt:[]}},line:l({},s({},n(\"line\"),{colorscale:s({},n(\"line\").colorscale,{dflt:a.Viridis}),autocolorscale:s({},n(\"line\").autocolorscale,{dflt:!1})}),{showscale:{valType:\"boolean\",dflt:!1},colorbar:i})}},{\"../../components/colorbar/attributes\":579,\"../../components/colorscale/color_attributes\":585,\"../../components/colorscale/scales\":596,\"../../lib/extend\":677,\"../../plots/cartesian/layout_attributes\":735}],951:[function(t,e,r){\"use strict\";var n=t(\"d3\"),i=t(\"../../plots/plots\"),a=t(\"./plot\"),o=t(\"../../constants/xmlns_namespaces\"),s=t(\"./constants\");r.name=\"parcoords\",r.attr=\"type\",r.plot=function(t){var e=i.getSubplotCalcData(t.calcdata,\"parcoords\",\"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-line-layers\").remove(),n._paperdiv.selectAll(\".parcoords-line-layers\").remove(),n._paperdiv.selectAll(\".parcoords\").remove(),n._paperdiv.selectAll(\".parcoords\").remove(),n._glimages.selectAll(\"*\").remove())},r.toSVG=function(t){function e(e){var n=this.toDataURL(\"image/png\"),i=r.append(\"svg:image\"),a=t._fullLayout._size,l=t._fullData[e.model.key].domain;i.attr({xmlns:o.svg,\"xlink:href\":n,x:a.l+a.w*l.x[0]-s.overdrag,y:a.t+a.h*(1-l.y[1]),width:(l.x[1]-l.x[0])*a.w+2*s.overdrag,height:(l.y[1]-l.y[0])*a.h,preserveAspectRatio:\"none\"})}var r=t._fullLayout._glimages,i=n.selectAll(\".svg-container\");i.filter(function(t,e){return e===i.size()-1}).selectAll(\".parcoords-lines.context, .parcoords-lines.focus\").each(e),window.setTimeout(function(){n.selectAll(\"#filterBarPattern\").attr(\"id\",\"filterBarPattern\")},60)}},{\"../../constants/xmlns_namespaces\":668,\"../../plots/plots\":787,\"./constants\":954,\"./plot\":959,d3:107}],952:[function(t,e,r){\"use strict\";var n=t(\"../../components/colorscale/has_colorscale\"),i=t(\"../../components/colorscale/calc\"),a=t(\"../../lib\");e.exports=function(t,e){var r=!!e.line.colorscale&&a.isArray(e.line.color),o=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}),s=r?e.line.colorscale:[[0,e.line.color],[1,e.line.color]];return n(e,\"line\")&&i(e,e.line.color,\"line\",\"c\"),[{lineColor:o,cscale:s}]}},{\"../../components/colorscale/calc\":584,\"../../components/colorscale/has_colorscale\":591,\"../../lib\":685}],953:[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,u=\"cb\"+r.uid;if(t._fullLayout._infolayer.selectAll(\".\"+u).remove(),void 0!==l&&l.showscale){var c=l.color,h=l.cmin,f=l.cmax;n(h)||(h=i.aggNums(Math.min,null,c)),n(f)||(f=i.aggNums(Math.max,null,c));var d=e[0].t.cb=s(t,u),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,h,f),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:h,end:f,size:(f-h)/254}).options(l.colorbar)()}else a.autoMargin(t,u)}},{\"../../components/colorbar/draw\":581,\"../../components/colorscale\":592,\"../../lib\":685,\"../../plots/plots\":787,\"fast-isnumeric\":116}],954:[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}}},{}],955:[function(t,e,r){\"use strict\";function n(t,e,r,n,i){i(\"line.color\",r),s(t,\"line\")&&a.isArray(t.line.color)?(i(\"line.colorscale\"),l(t,e,n,i,{prefix:\"line.\",cLetter:\"c\"})):i(\"line.color\",r)}function i(t,e){function r(t,e){return a.coerce(n,i,o.dimensions,t,e)}var n,i,s,l=t.dimensions||[],c=e.dimensions=[],h=1/0;for(l.length>u&&(a.log(\"parcoords traces support up to \"+u+\" dimensions at the moment\"),l.splice(u)),s=0;s<l.length;s++)n=l[s],i={},a.isPlainObject(n)&&(r(\"visible\",r(\"values\").length>0)&&(r(\"label\"),r(\"tickvals\"),r(\"ticktext\"),r(\"tickformat\"),r(\"range\"),r(\"constraintrange\"),h=Math.min(h,i.values.length)),i._index=s,c.push(i));if(isFinite(h))for(s=0;s<c.length;s++)(i=c[s]).visible&&i.values.length>h&&(i.values=i.values.slice(0,h));return c}var a=t(\"../../lib\"),o=t(\"./attributes\"),s=t(\"../../components/colorscale/has_colorscale\"),l=t(\"../../components/colorscale/defaults\"),u=t(\"./constants\").maxDimensionCount;e.exports=function(t,e,r,s){function l(r,n){return a.coerce(t,e,o,r,n)}var u=i(t,e);n(t,e,r,s,l),l(\"domain.x\"),l(\"domain.y\"),Array.isArray(u)&&u.length||(e.visible=!1)}},{\"../../components/colorscale/defaults\":587,\"../../components/colorscale/has_colorscale\":591,\"../../lib\":685,\"./attributes\":950,\"./constants\":954}],956:[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\",\"noOpacity\"],n.meta={},e.exports=n},{\"./attributes\":950,\"./base_plot\":951,\"./calc\":952,\"./colorbar\":953,\"./defaults\":955,\"./plot\":959}],957:[function(t,e,r){\"use strict\";function n(t){t.read({x:0,y:0,width:1,height:1,data:x})}function i(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 a(t,e,r,a,o,s){function l(n){var c;c=Math.min(a,o-n*a),s.offset=v*n*a,s.count=v*c,0===n&&(window.cancelAnimationFrame(r.currentRafs[u]),delete r.currentRafs[u],i(t,s.scissorX,s.scissorY,s.scissorWidth,s.viewBoxSize[1])),r.clearOnly||(e(s),n*a+c<o&&(r.currentRafs[u]=window.requestAnimationFrame(function(){l(n+1)})),r.drawCompleted=!1)}var u=s.key;r.drawCompleted||(n(t),r.drawCompleted=!0),l(0)}function o(t){return Math.max(m,Math.min(1-m,t))}function s(t,e,r){for(var n=[],i=0;i<256;i++){var a=t(i/255);n.push((e?b:a).concat(r))}return n}function l(t,e){return(t>>>8*e)%256/255}function u(t,e,r,n){for(var i=[],a=0;a<t;a++)for(var s=0;s<g;s++)i.push(s<e?r[s].paddedUnitValues[a]:s===g-1?o(n[a]):s>=g-4?l(a,g-2-s):.5);return i}function c(t,e,r){var n,i,a,o=[];for(i=0;i<t;i++)for(a=0;a<v;a++)for(n=0;n<y;n++)o.push(e[i*g+r*y+n]),r*y+n===g-1&&a%2==0&&(o[o.length-1]*=-1);return o}function h(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 c(t,e,r)}).forEach(function(t,e){r[\"p\"+e.toString(16)]=t}),r}function f(t,e,r){return t+e<=r}var d=t(\"regl\"),p=t(\"./constants\").verticalPadding,m=1e-6,g=64,v=2,y=4,b=[119,119,119],x=new Uint8Array(4),_=new Uint8Array(4);e.exports=function(t,e,r,n,o,l,c,m,g,v){function y(t){F[0]=t[0],F[1]=t[1]}function b(t,e,i,a,o,s,l,u,c,h,d){var g,v,y,b,x=[t,e],_=p/s,w=[0,1].map(function(){return[0,1,2,3].map(function(){return new Float32Array(16)})}),M=[0,1].map(function(){return[0,1,2,3].map(function(){return new Float32Array(16)})});for(g=0;g<2;g++)for(b=x[g],v=0;v<4;v++)for(y=0;y<16;y++){var k=y+16*v;w[g][v][y]=y+16*v===b?1:0,M[g][v][y]=(!m&&f(y,16*v,D)?A[0===k?0:1+(k-1)%(A.length-1)].filter[g]:g)+(2*g-1)*_}return{key:l,resolution:[r,n],viewBoxPosition:[i+z,a],viewBoxSize:[o,s],i:t,ii:e,dim1A:w[0][0],dim1B:w[0][1],dim1C:w[0][2],dim1D:w[0][3],dim2A:w[1][0],dim2B:w[1][1],dim2C:w[1][2],dim2D:w[1][3],loA:M[0][0],loB:M[0][1],loC:M[0][2],loD:M[0][3],hiA:M[1][0],hiB:M[1][1],hiC:M[1][2],hiD:M[1][3],colorClamp:F,scatter:u||0,scissorX:c===h?0:i+z,scissorWidth:(c===d?r-i+z:o+.5)+(c===h?i+z:0),scissorY:a,scissorHeight:s}}function x(t,o,s){var l,u,c,h=1/0,f=-1/0;for(l=0;l<D;l++)t[l].dim2.canvasX>f&&(f=t[l].dim2.canvasX,c=l),t[l].dim1.canvasX<h&&(h=t[l].dim1.canvasX,u=l);for(0===D&&i(O,0,0,r,n),l=0;l<D;l++){var d=t[l],p=d.dim1,m=p.crossfilterDimensionIndex,g=d.canvasX,y=d.canvasY,x=d.dim2.crossfilterDimensionIndex,_=d.panelSizeX,w=d.panelSizeY,M=g+_;if(o||!N[m]||N[m][0]!==g||N[m][1]!==M){N[m]=[g,M];var A=b(m,x,g,y,_,w,p.crossfilterDimensionIndex,v||p.scatter?1:0,l,u,c);k.clearOnly=s,a(O,R,k,o?e.blockLineCount:S,S,A)}}}function w(t,e){return O.read({x:t,y:e,width:1,height:1,data:_}),_}function M(t,e,r,n){var i=new Uint8Array(4*r*n);return O.read({x:t,y:e,width:r,height:n,data:i}),i}var k={currentRafs:{},drawCompleted:!0,clearOnly:!1},A=o.slice(),T=A.length,S=A[0]?A[0].values.length:0,E=m,L=g?e.color.map(function(t,r){return r/e.color.length}):e.color,C=Math.max(1/255,Math.pow(1/L.length,1/3)),z=e.canvasOverdrag,D=l.length,I=u(S,T,A,L),P=h(S,I),O=d({canvas:t,attributes:{preserveDrawingBuffer:!0,antialias:!g}}),j=O.texture({shape:[256,1],format:\"rgba\",type:\"uint8\",mag:\"nearest\",min:\"nearest\",data:s(c,m,Math.round(255*(m?C:1)))}),R=O({profile:!1,blend:{enable:E,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:!E,mask:!0,func:\"less\",range:[0,1]},cull:{enable:!0,face:\"back\"},scissor:{enable:!0,box:{x:O.prop(\"scissorX\"),y:O.prop(\"scissorY\"),width:O.prop(\"scissorWidth\"),height:O.prop(\"scissorHeight\")}},dither:!1,vert:g?\"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\":\"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\",frag:\"precision lowp float;\\n#define GLSLIFY 1\\n\\nvarying vec4 fragColor;\\n\\nvoid main() {\\n    gl_FragColor = fragColor;\\n}\\n\",primitive:\"lines\",lineWidth:1,attributes:P,uniforms:{resolution:O.prop(\"resolution\"),viewBoxPosition:O.prop(\"viewBoxPosition\"),viewBoxSize:O.prop(\"viewBoxSize\"),dim1A:O.prop(\"dim1A\"),dim2A:O.prop(\"dim2A\"),dim1B:O.prop(\"dim1B\"),dim2B:O.prop(\"dim2B\"),dim1C:O.prop(\"dim1C\"),dim2C:O.prop(\"dim2C\"),dim1D:O.prop(\"dim1D\"),dim2D:O.prop(\"dim2D\"),loA:O.prop(\"loA\"),hiA:O.prop(\"hiA\"),loB:O.prop(\"loB\"),hiB:O.prop(\"hiB\"),loC:O.prop(\"loC\"),hiC:O.prop(\"hiC\"),loD:O.prop(\"loD\"),hiD:O.prop(\"hiD\"),palette:j,colorClamp:O.prop(\"colorClamp\"),scatter:O.prop(\"scatter\")},offset:O.prop(\"offset\"),count:O.prop(\"count\")}),F=[0,1],N=[];return{setColorDomain:y,render:x,readPixel:w,readPixels:M,destroy:O.destroy}}},{\"./constants\":954,regl:480}],958:[function(t,e,r){\"use strict\";function n(t){return t.key}function i(t){return[t]}function a(t){return!(\"visible\"in t)||t.visible}function o(t){var e=t.range?t.range[0]:_.min(t.values),r=t.range?t.range[1]:_.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 s(t,e){var r,n,i,a,o;for(r=0,i=1/0,a=(n=t.range())[0],o;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 l(t,e,r){var n=o(r);return r.tickvals?_.scale.ordinal().domain(r.tickvals).range(r.tickvals.map(function(t){return(t-n[0])/(n[1]-n[0])}).map(function(r){return t-e+r*(e-(t-e))})):_.scale.linear().domain(n).range([t-e,e])}function u(t,e){return _.scale.linear().range([t-e,e])}function c(t){return _.scale.linear().domain(o(t))}function h(t){var e=o(t);return t.tickvals&&_.scale.ordinal().domain(t.tickvals).range(t.tickvals.map(function(t){return(t-e[0])/(e[1]-e[0])}))}function f(t){var e=t.map(function(t){return t[0]}),r=t.map(function(t){return t[1]}).map(function(t){return _.rgb(t)}),n=function(t){return function(e){return e[t]}},i=\"rgb\".split(\"\").map(function(t){return _.scale.linear().clamp(!0).domain(e).range(r.map(n(t)))});return function(t){return i.map(function(e){return e(t)})}}function d(t){return t[0]}function p(t,e,r){var n=d(e),i=n.trace,o=n.lineColor,s=n.cscale,l=i.line,u=i.domain,h=i.dimensions,p=t.width,m=x.extendDeep({},l,{color:o.map(c({values:o,range:[l.cmin,l.cmax]})),blockLineCount:b.blockLineCount,canvasOverdrag:b.overdrag*b.canvasPixelRatio}),g=Math.floor(p*(u.x[1]-u.x[0])),v=Math.floor(t.height*(u.y[1]-u.y[0])),y=t.margin||{l:80,r:80,t:100,b:80},_=g,w=v;return{key:r,colCount:h.filter(a).length,dimensions:h,tickDistance:b.tickDistance,unitToColor:f(s),lines:m,translateX:u.x[0]*p,translateY:t.height-u.y[1]*t.height,pad:y,canvasWidth:_*b.canvasPixelRatio+2*m.canvasOverdrag,canvasHeight:w*b.canvasPixelRatio,width:_,height:w,canvasPixelRatio:b.canvasPixelRatio}}function m(t){var e=t.width,r=t.height,n=t.dimensions,i=t.canvasPixelRatio,o=function(r){return e*r/Math.max(1,t.colCount-1)},s=b.verticalPadding/(r*i),f=1-2*s,d=function(t){return s+f*t},p={key:t.key,xScale:o,model:t},m={};return p.dimensions=n.filter(a).map(function(e,n){var a=c(e),s=m[e.label];return m[e.label]=(s||0)+1,{key:e.label+(s?\"__\"+s:\"\"),label:e.label,tickFormat:e.tickformat,tickvals:e.tickvals,ticktext:e.ticktext,ordinal:!!e.tickvals,scatter:b.scatter||e.scatter,xIndex:n,crossfilterDimensionIndex:n,visibleIndex:e._index,height:r,values:e.values,paddedUnitValues:e.values.map(a).map(d),xScale:o,x:o(n),canvasX:o(n)*i,unitScale:u(r,b.verticalPadding),domainScale:l(r,b.verticalPadding,e),ordinalScale:h(e),domainToUnitScale:a,filter:e.constraintrange?e.constraintrange.map(a):[0,1],parent:p,model:t}}),p}function g(t){return b.layers.map(function(e){return{key:e,context:\"contextLineLayer\"===e,pick:\"pickLineLayer\"===e,viewModel:t,model:t.model}})}function v(t){t.classed(\"axisExtentText\",!0).attr(\"text-anchor\",\"middle\").style(\"font-weight\",100).style(\"font-size\",\"10px\").style(\"cursor\",\"default\").style(\"user-select\",\"none\")}var y=t(\"./lines\"),b=t(\"./constants\"),x=t(\"../../lib\"),_=t(\"d3\");e.exports=function(t,e,r,a,o){function l(t){var e=t.selectAll(\"defs\").data(i,n);e.enter().append(\"defs\");var r=e.selectAll(\"#filterBarPattern\").data(i,n);r.enter().append(\"pattern\").attr(\"id\",\"filterBarPattern\").attr(\"patternUnits\",\"userSpaceOnUse\"),r.attr(\"x\",-b.bar.width).attr(\"width\",b.bar.capturewidth).attr(\"height\",function(t){return t.model.height});var a=r.selectAll(\"rect\").data(i,n);a.enter().append(\"rect\").attr(\"shape-rendering\",\"crispEdges\"),a.attr(\"height\",function(t){return t.model.height}).attr(\"width\",b.bar.width).attr(\"x\",b.bar.width/2).attr(\"fill\",b.bar.fillcolor).attr(\"fill-opacity\",b.bar.fillopacity).attr(\"stroke\",b.bar.strokecolor).attr(\"stroke-opacity\",b.bar.strokeopacity).attr(\"stroke-width\",b.bar.strokewidth)}function u(t){return t.dimensions.some(function(t){return 0!==t.filter[0]||1!==t.filter[1]})}function c(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],u=n[o+1];s.dim1=l,s.dim2=u,s.canvasX=l.canvasX,s.panelSizeX=u.canvasX-l.canvasX,s.panelSizeY=e.model.canvasHeight/1,s.y=a*s.panelSizeY,s.canvasY=e.model.canvasHeight-s.y-s.panelSizeY}}function h(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]={}),u=n[s],c=n[s+1];l.dim1=n[o+1],l.dim2=c,l.canvasX=u.canvasX,l.panelSizeX=c.canvasX-u.canvasX,l.panelSizeY=e.model.canvasHeight/a,l.y=o*l.panelSizeY,l.canvasY=e.model.canvasHeight-l.y-l.panelSizeY}}function f(t,e){return(b.scatter?h:c)(t,e)}function x(t){return t.ordinal?function(){return\"\"}:_.format(t.tickFormat)}function w(){Y=!0,A=!0}function M(t){T=!1;var e=t.parent,r=t.brush.extent(),n=e.dimensions,i=n[t.xIndex].filter,a=Y&&r[0]===r[1];a&&(t.brush.clear(),_.select(this).select(\"rect.extent\").attr(\"y\",-100));var o=a?[0,1]:r.slice();if(o[0]!==i[0]||o[1]!==i[1]){n[t.xIndex].filter=o,e.focusLineLayer&&e.focusLineLayer.render(e.panels,!0);var s=u(e);!W&&s?(e.contextLineLayer&&e.contextLineLayer.render(e.panels,!0),W=!0):W&&!s&&(e.contextLineLayer&&e.contextLineLayer.render(e.panels,!0,!0),W=!1)}Y=!1}function k(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]=s(t.ordinalScale,i[0]),i[1]=s(t.ordinalScale,i[1]),i[0]===i[1]&&(i[0]=Math.max(0,i[0]-.05),i[1]=Math.min(1,i[1]+.05)),_.select(this).transition().duration(150).call(t.brush.extent(i)),e.focusLineLayer.render(e.panels,!0)),e.pickLineLayer&&e.pickLineLayer.render(e.panels,!0),T=!0,A=\"ending\",o&&o.filterChanged){var a=t.domainToUnitScale.invert,l=i.map(a);o.filterChanged(e.key,t.visibleIndex,l)}}var A=!1,T=!0,S=r.filter(function(t){return d(t).trace.visible}).map(p.bind(0,a)).map(m);t.selectAll(\".parcoords-line-layers\").remove();var E=t.selectAll(\".parcoords-line-layers\").data(S,n);E.enter().insert(\"div\",\".\"+e.attr(\"class\").split(\" \").join(\" .\")).classed(\"parcoords-line-layers\",!0).style(\"box-sizing\",\"content-box\"),E.style(\"transform\",function(t){return\"translate(\"+(t.model.translateX-b.overdrag)+\"px,\"+t.model.translateY+\"px)\"});var L=E.selectAll(\".parcoords-lines\").data(g,n),C={renderers:[],dimensions:[]},z=null;L.enter().append(\"canvas\").attr(\"class\",function(t){return\"parcoords-lines \"+(t.context?\"context\":t.pick?\"pick\":\"focus\")}).style(\"box-sizing\",\"content-box\").style(\"float\",\"left\").style(\"clear\",\"both\").style(\"left\",0).style(\"overflow\",\"visible\").style(\"position\",function(t,e){return\"absolute\"}).filter(function(t){return t.pick}).on(\"mousemove\",function(t){if(T&&t.lineLayer&&o&&o.hover){var e=_.event,r=this.width,n=this.height,i=_.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),u=0!==l[3],c=u?l[2]+256*(l[1]+256*l[0]):null,h={x:a,y:s,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:c};c!==z&&(u?o.hover(h):o.unhover&&o.unhover(h),z=c)}}),L.style(\"margin\",function(t){var e=t.model.pad;return e.t+\"px \"+e.r+\"px \"+e.b+\"px \"+e.l+\"px\"}).attr(\"width\",function(t){return t.model.canvasWidth}).attr(\"height\",function(t){return t.model.canvasHeight}).style(\"width\",function(t){return t.model.width+2*b.overdrag+\"px\"}).style(\"height\",function(t){return t.model.height+\"px\"}).style(\"opacity\",function(t){return t.pick?.01:1}),e.style(\"background\",\"rgba(255, 255, 255, 0)\");var D=e.selectAll(\".parcoords\").data(S,n);D.exit().remove(),D.enter().append(\"g\").classed(\"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(l),D.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 I=D.selectAll(\".parcoordsControlView\").data(i,n);I.enter().append(\"g\").classed(\"parcoordsControlView\",!0).style(\"box-sizing\",\"content-box\"),I.attr(\"transform\",function(t){return\"translate(\"+t.model.pad.l+\",\"+t.model.pad.t+\")\"});var P=I.selectAll(\".yAxis\").data(function(t){return t.dimensions},n);P.enter().append(\"g\").classed(\"yAxis\",!0).each(function(t){C.dimensions.push(t)}),I.each(function(t){f(P,t)}),L.each(function(t){t.lineLayer=y(this,t.model.lines,t.model.canvasWidth,t.model.canvasHeight,t.viewModel.dimensions,t.viewModel.panels,t.model.unitToColor,t.context,t.pick,b.scatter),t.viewModel[t.key]=t.lineLayer,C.renderers.push(function(){t.lineLayer.render(t.viewModel.panels,!0)}),t.lineLayer.render(t.viewModel.panels,!t.context)}),P.attr(\"transform\",function(t){return\"translate(\"+t.xScale(t.xIndex)+\", 0)\"}),P.call(_.behavior.drag().origin(function(t){return t}).on(\"drag\",function(t){var e=t.parent;T=!1,A||(t.x=Math.max(-b.overdrag,Math.min(t.model.width+b.overdrag,_.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,P.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}),f(P,e),P.filter(function(e){return 0!==Math.abs(t.xIndex-e.xIndex)}).attr(\"transform\",function(t){return\"translate(\"+t.xScale(t.xIndex)+\", 0)\"}),_.select(this).attr(\"transform\",\"translate(\"+t.x+\", 0)\"),P.each(function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)}),e.contextLineLayer&&e.contextLineLayer.render(e.panels,!1,!u(e)),e.focusLineLayer.render&&e.focusLineLayer.render(e.panels))}).on(\"dragend\",function(t){var e=t.parent;A?\"ending\"===A&&(A=!1):(t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,f(P,e),_.select(this).attr(\"transform\",function(t){return\"translate(\"+t.x+\", 0)\"}),e.contextLineLayer&&e.contextLineLayer.render(e.panels,!1,!u(e)),e.focusLineLayer&&e.focusLineLayer.render(e.panels),e.pickLineLayer&&e.pickLineLayer.render(e.panels,!0),T=!0,o&&o.axesMoved&&o.axesMoved(e.key,e.dimensions.map(function(t){return t.crossfilterDimensionIndex})))})),P.exit().remove();var O=P.selectAll(\".axisOverlays\").data(i,n);O.enter().append(\"g\").classed(\"axisOverlays\",!0),O.selectAll(\".axis\").remove();var j=O.selectAll(\".axis\").data(i,n);j.enter().append(\"g\").classed(\"axis\",!0),j.each(function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,n=r.domain(),i=t.ticktext;_.select(this).call(_.svg.axis().orient(\"left\").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?n.map(function(t,e){return i&&i[e]||t}):null).tickFormat(t.ordinal?function(t){return t}:null).scale(r))}),j.selectAll(\".domain, .tick\").attr(\"fill\",\"none\").attr(\"stroke\",\"black\").attr(\"stroke-opacity\",.25).attr(\"stroke-width\",\"1px\"),j.selectAll(\"text\").style(\"font-weight\",100).style(\"font-size\",\"10px\").style(\"fill\",\"black\").style(\"fill-opacity\",1).style(\"stroke\",\"none\").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 R=O.selectAll(\".axisHeading\").data(i,n);R.enter().append(\"g\").classed(\"axisHeading\",!0);var F=R.selectAll(\".axisTitle\").data(i,n);F.enter().append(\"text\").classed(\"axisTitle\",!0).attr(\"text-anchor\",\"middle\").style(\"font-family\",\"sans-serif\").style(\"font-size\",\"10px\").style(\"cursor\",\"ew-resize\").style(\"user-select\",\"none\").style(\"pointer-events\",\"auto\"),F.attr(\"transform\",\"translate(0,\"+-b.axisTitleOffset+\")\").text(function(t){return t.label});var N=O.selectAll(\".axisExtent\").data(i,n);N.enter().append(\"g\").classed(\"axisExtent\",!0);var B=N.selectAll(\".axisExtentTop\").data(i,n);B.enter().append(\"g\").classed(\"axisExtentTop\",!0),B.attr(\"transform\",\"translate(0,\"+-b.axisExtentOffset+\")\");var U=B.selectAll(\".axisExtentTopText\").data(i,n);U.enter().append(\"text\").classed(\"axisExtentTopText\",!0).attr(\"alignment-baseline\",\"after-edge\").call(v),U.text(function(t){return x(t)(t.domainScale.domain().slice(-1)[0])});var V=N.selectAll(\".axisExtentBottom\").data(i,n);V.enter().append(\"g\").classed(\"axisExtentBottom\",!0),V.attr(\"transform\",function(t){return\"translate(0,\"+(t.model.height+b.axisExtentOffset)+\")\"});var H=V.selectAll(\".axisExtentBottomText\").data(i,n);H.enter().append(\"text\").classed(\"axisExtentBottomText\",!0).attr(\"alignment-baseline\",\"before-edge\").call(v),H.text(function(t){return x(t)(t.domainScale.domain()[0])});var q=O.selectAll(\".axisBrush\").data(i,n),G=q.enter().append(\"g\").classed(\"axisBrush\",!0);q.each(function(t){t.brush||(t.brush=_.svg.brush().y(t.unitScale).on(\"brushstart\",w).on(\"brush\",M).on(\"brushend\",k),0===t.filter[0]&&1===t.filter[1]||t.brush.extent(t.filter),_.select(this).call(t.brush))}),G.selectAll(\"rect\").attr(\"x\",-b.bar.capturewidth/2).attr(\"width\",b.bar.capturewidth),G.selectAll(\"rect.extent\").attr(\"fill\",\"url(#filterBarPattern)\").style(\"cursor\",\"ns-resize\").filter(function(t){return 0===t.filter[0]&&1===t.filter[1]}).attr(\"y\",-100),G.selectAll(\".resize rect\").attr(\"height\",b.bar.handleheight).attr(\"opacity\",0).style(\"visibility\",\"visible\"),G.selectAll(\".resize.n rect\").style(\"cursor\",\"n-resize\").attr(\"y\",b.bar.handleoverlap-b.bar.handleheight),G.selectAll(\".resize.s rect\").style(\"cursor\",\"s-resize\").attr(\"y\",b.bar.handleoverlap);var Y=!1,W=!1;return C}},{\"../../lib\":685,\"./constants\":954,\"./lines\":957,d3:107}],959:[function(t,e,r){\"use strict\";var n=t(\"./parcoords\");e.exports=function(t,e){var r=t._fullLayout,i=r._paper,a=r._paperdiv,o={},s={},l=r._size;e.forEach(function(e,r){o[r]=t.data[r].dimensions,s[r]=t.data[r].dimensions.slice()});var u=function(e,r,n){var i=s[e][r],a=i.constraintrange;a&&2===a.length||(a=i.constraintrange=[]),a[0]=n[0],a[1]=n[1],t.emit(\"plotly_restyle\")},c=function(e){t.emit(\"plotly_hover\",e)},h=function(e){t.emit(\"plotly_unhover\",e)},f=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)}}(s[e].filter(n));o[e].sort(a),s[e].filter(function(t){return!n(t)}).sort(function(t){return s[e].indexOf(t)}).forEach(function(t){o[e].splice(o[e].indexOf(t),1),o[e].splice(s[e].indexOf(t),0,t)}),t.emit(\"plotly_restyle\")};n(a,i,e,{width:l.w,height:l.h,margin:{t:l.t,r:l.r,b:l.b,l:l.l}},{filterChanged:u,hover:c,unhover:h,axesMoved:f})}},{\"./parcoords\":958}],960:[function(t,e,r){\"use strict\";var n=t(\"../../components/color/attributes\"),i=t(\"../../plots/font_attributes\"),a=t(\"../../plots/attributes\"),o=t(\"../../lib/extend\").extendFlat;e.exports={labels:{valType:\"data_array\"},label0:{valType:\"number\",dflt:0},dlabel:{valType:\"number\",dflt:1},values:{valType:\"data_array\"},marker:{colors:{valType:\"data_array\"},line:{color:{valType:\"color\",dflt:n.defaultLine,arrayOk:!0},width:{valType:\"number\",min:0,dflt:0,arrayOk:!0}}},text:{valType:\"data_array\"},hovertext:{valType:\"string\",dflt:\"\",arrayOk:!0},scalegroup:{valType:\"string\",dflt:\"\"},textinfo:{valType:\"flaglist\",flags:[\"label\",\"text\",\"value\",\"percent\"],extras:[\"none\"]},hoverinfo:o({},a.hoverinfo,{flags:[\"label\",\"text\",\"value\",\"percent\",\"name\"]}),textposition:{valType:\"enumerated\",values:[\"inside\",\"outside\",\"auto\",\"none\"],dflt:\"auto\",arrayOk:!0},textfont:o({},i,{}),insidetextfont:o({},i,{}),outsidetextfont:o({},i,{}),domain:{x:{valType:\"info_array\",items:[{valType:\"number\",min:0,max:1},{valType:\"number\",min:0,max:1}],dflt:[0,1]},y:{valType:\"info_array\",items:[{valType:\"number\",min:0,max:1},{valType:\"number\",min:0,max:1}],dflt:[0,1]}},hole:{valType:\"number\",min:0,max:1,dflt:0},sort:{valType:\"boolean\",dflt:!0},direction:{valType:\"enumerated\",values:[\"clockwise\",\"counterclockwise\"],dflt:\"counterclockwise\"},rotation:{valType:\"number\",min:-360,max:360,dflt:0},pull:{valType:\"number\",min:0,max:1,dflt:0,arrayOk:!0}}},{\"../../components/color/attributes\":577,\"../../lib/extend\":677,\"../../plots/attributes\":722,\"../../plots/font_attributes\":748}],961:[function(t,e,r){\"use strict\";function n(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n],a=i[0].trace;a._module===e&&!0===a.visible&&r.push(i)}return r}var i=t(\"../../registry\");r.name=\"pie\",r.plot=function(t){var e=i.getModule(\"pie\"),r=n(t.calcdata,e);r.length&&e.plot(t,r)},r.clean=function(t,e,r,n){var i=n._has&&n._has(\"pie\"),a=e._has&&e._has(\"pie\");i&&!a&&n._pielayer.selectAll(\"g.trace\").remove()}},{\"../../registry\":802}],962:[function(t,e,r){\"use strict\";function n(t){if(!l){var e=o.defaults;l=e.slice();var r;for(r=0;r<e.length;r++)l.push(a(e[r]).lighten(20).toHexString());for(r=0;r<o.defaults.length;r++)l.push(a(e[r]).darken(20).toHexString())}return l[t%l.length]}var i=t(\"fast-isnumeric\"),a=t(\"tinycolor2\"),o=t(\"../../components/color\"),s=t(\"./helpers\");e.exports=function(t,e){var r,l,u,c,h,f,d=e.values,p=e.labels,m=[],g=t._fullLayout,v=g._piecolormap,y={},b=!1,x=0,_=g.hiddenlabels||[];if(e.dlabel)for(p=new Array(d.length),r=0;r<d.length;r++)p[r]=String(e.label0+r*e.dlabel);for(r=0;r<d.length;r++)l=d[r],i(l)&&((l=+l)<0||(void 0!==(u=p[r])&&\"\"!==u||(u=r),void 0===y[u=String(u)]&&(y[u]=!0,(c=a(e.marker.colors[r])).isValid()?(c=o.addOpacity(c,c.getAlpha()),v[u]||(v[u]=c)):v[u]?c=v[u]:(c=!1,b=!0),(h=-1!==_.indexOf(u))||(x+=l),m.push({v:l,label:u,color:c,i:r,hidden:h}))));if(e.sort&&m.sort(function(t,e){return e.v-t.v}),b)for(r=0;r<m.length;r++)!1===(f=m[r]).color&&(v[f.label]=f.color=n(g._piedefaultcolorcount),g._piedefaultcolorcount++);if(m[0]&&(m[0].vTotal=x),e.textinfo&&\"none\"!==e.textinfo){var w,M=-1!==e.textinfo.indexOf(\"label\"),k=-1!==e.textinfo.indexOf(\"text\"),A=-1!==e.textinfo.indexOf(\"value\"),T=-1!==e.textinfo.indexOf(\"percent\"),S=g.separators;for(r=0;r<m.length;r++)f=m[r],w=M?[f.label]:[],k&&e.text[f.i]&&w.push(e.text[f.i]),A&&w.push(s.formatPieValue(f.v,S)),T&&w.push(s.formatPiePercent(f.v/x,S)),f.text=w.join(\"<br>\")}return m};var l},{\"../../components/color\":578,\"./helpers\":964,\"fast-isnumeric\":116,tinycolor2:514}],963:[function(t,e,r){\"use strict\";var n=t(\"../../lib\"),i=t(\"./attributes\");e.exports=function(t,e,r,a){function o(r,a){return n.coerce(t,e,i,r,a)}var s=n.coerceFont,l=o(\"values\");if(Array.isArray(l)&&l.length){var u=o(\"labels\");Array.isArray(u)||(o(\"label0\"),o(\"dlabel\")),o(\"marker.line.width\")&&o(\"marker.line.color\");var c=o(\"marker.colors\");Array.isArray(c)||(e.marker.colors=[]),o(\"scalegroup\");var h=o(\"text\"),f=o(\"textinfo\",Array.isArray(h)?\"text+percent\":\"percent\");if(o(\"hovertext\"),o(\"hoverinfo\",1===a._dataLength?\"label+text+value+percent\":void 0),f&&\"none\"!==f){var d=o(\"textposition\"),p=Array.isArray(d)||\"auto\"===d,m=p||\"inside\"===d,g=p||\"outside\"===d;if(m||g){var v=s(o,\"textfont\",a.font);m&&s(o,\"insidetextfont\",v),g&&s(o,\"outsidetextfont\",v)}}o(\"domain.x\"),o(\"domain.y\"),o(\"hole\"),o(\"sort\"),o(\"direction\"),o(\"rotation\"),o(\"pull\")}else e.visible=!1}},{\"../../lib\":685,\"./attributes\":960}],964:[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)}},{\"../../lib\":685}],965:[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\":960,\"./base_plot\":961,\"./calc\":962,\"./defaults\":963,\"./layout_attributes\":966,\"./layout_defaults\":967,\"./plot\":968,\"./style\":969,\"./style_one\":970}],966:[function(t,e,r){\"use strict\";e.exports={hiddenlabels:{valType:\"data_array\"}}},{}],967:[function(t,e,r){\"use strict\";var n=t(\"../../lib\"),i=t(\"./layout_attributes\");e.exports=function(t,e){!function(r,a){n.coerce(t,e,i,r,a)}(\"hiddenlabels\")}},{\"../../lib\":685,\"./layout_attributes\":966}],968:[function(t,e,r){\"use strict\";function n(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),a=t.width/t.height,o=Math.PI*Math.min(e.v/r.vTotal,.5),s=1-r.trace.hole,l=i(e,r),u={scale:l*r.r*2/n,rCenter:1-l,rotate:0};if(u.scale>=1)return u;var c=a+1/(2*Math.tan(o)),h=r.r*Math.min(1/(Math.sqrt(c*c+.5)+c),s/(Math.sqrt(a*a+s/2)+a)),f={scale:2*h/t.height,rCenter:Math.cos(h/r.r)-h*a/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},d=1/a,p=d+1/(2*Math.tan(o)),m=r.r*Math.min(1/(Math.sqrt(p*p+.5)+p),s/(Math.sqrt(d*d+s/2)+d)),g={scale:2*m/t.width,rCenter:Math.cos(m/r.r)-m/a/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},v=g.scale>f.scale?g:f;return u.scale<1&&v.scale>u.scale?v:u}function i(t,e){if(t.v===e.vTotal&&!e.trace.hole)return 1;var r=Math.PI*Math.min(t.v/e.vTotal,.5);return Math.min(1/(1+1/Math.sin(r)),(1-e.trace.hole)/2)}function a(t,e){var r=e.pxmid[0],n=e.pxmid[1],i=t.width/2,a=t.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function o(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}var i,a,o,s,l,u,c,h,f,d,p,m,g;for(a=0;a<2;a++)for(o=a?r:n,l=a?Math.max:Math.min,c=a?1:-1,i=0;i<2;i++){for(s=i?Math.max:Math.min,u=i?1:-1,(h=t[a][i]).sort(o),f=t[1-a][i],d=f.concat(h),m=[],p=0;p<h.length;p++)void 0!==h[p].yLabelMid&&m.push(h[p]);for(g=!1,p=0;a&&p<f.length;p++)if(void 0!==f[p].yLabelMid){g=f[p];break}for(p=0;p<m.length;p++){var v=p&&m[p-1];g&&!p&&(v=g),function(t,r){r||(r={});var n,i,o,h,f=r.labelExtraY+(a?r.yLabelMax:r.yLabelMin),p=a?t.yLabelMin:t.yLabelMax,m=a?t.yLabelMax:t.yLabelMin,g=t.cyFinal+l(t.px0[1],t.px1[1]),v=f-p;if(v*c>0&&(t.labelExtraY=v),Array.isArray(e.pull))for(i=0;i<d.length;i++)(o=d[i])===t||(e.pull[t.i]||0)>=e.pull[o.i]||((t.pxmid[1]-o.pxmid[1])*c>0?(v=o.cyFinal+l(o.px0[1],o.px1[1])-p-t.labelExtraY)*c>0&&(t.labelExtraY+=v):(m+t.labelExtraY-g)*c>0&&(n=3*u*Math.abs(i-d.indexOf(t)),(h=o.cxFinal+s(o.px0[0],o.px1[0])+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*u>0&&(t.labelExtraX+=h)))}(m[p],v)}}}function s(t,e){var r,n,i,a,o,s,l,c,h,f,d=[];for(i=0;i<t.length;i++){if(o=t[i][0],s=o.trace,r=e.w*(s.domain.x[1]-s.domain.x[0]),n=e.h*(s.domain.y[1]-s.domain.y[0]),l=s.tiltaxis*Math.PI/180,c=s.pull,Array.isArray(c))for(c=0,a=0;a<s.pull.length;a++)s.pull[a]>c&&(c=s.pull[a]);o.r=Math.min(r/u(s.tilt,Math.sin(l),s.depth),n/u(s.tilt,Math.cos(l),s.depth))/(2+2*c),o.cx=e.l+e.w*(s.domain.x[1]+s.domain.x[0])/2,o.cy=e.t+e.h*(2-s.domain.y[1]-s.domain.y[0])/2,s.scalegroup&&-1===d.indexOf(s.scalegroup)&&d.push(s.scalegroup)}for(a=0;a<d.length;a++){for(f=1/0,h=d[a],i=0;i<t.length;i++)(o=t[i][0]).trace.scalegroup===h&&(f=Math.min(f,o.r*o.r/o.vTotal));for(i=0;i<t.length;i++)(o=t[i][0]).trace.scalegroup===h&&(o.r=Math.sqrt(f*o.vTotal))}}function l(t){function e(t){var e=h.r*Math.sin(t),r=-h.r*Math.cos(t);return d?[e*(1-s*n*n)+r*o*s,e*o*s+r*(1-s*i*i),Math.sin(a)*(r*i-e*n)]:[e,r]}var r,n,i,a,o,s,l,u,c,h=t[0],f=h.trace,d=f.tilt,p=f.rotation*Math.PI/180,m=2*Math.PI/h.vTotal,g=\"px0\",v=\"px1\";if(\"counterclockwise\"===f.direction){for(l=0;l<t.length&&t[l].hidden;l++);if(l===t.length)return;p+=m*t[l].v,m*=-1,g=\"px1\",v=\"px0\"}for(d&&(a=d*Math.PI/180,r=f.tiltaxis*Math.PI/180,o=Math.sin(r)*Math.cos(r),s=1-Math.cos(a),n=Math.sin(r),i=Math.cos(r)),c=e(p),l=0;l<t.length;l++)(u=t[l]).hidden||(u[g]=c,p+=m*u.v/2,u.pxmid=e(p),u.midangle=p,c=e(p+=m*u.v/2),u[v]=c,u.largeArc=u.v>h.vTotal/2?1:0)}function u(t,e,r){if(!t)return 1;var n=Math.sin(t*Math.PI/180);return Math.max(.01,r*n*Math.abs(e)+2*Math.sqrt(1-n*n*e*e))}var c=t(\"d3\"),h=t(\"../../plots/cartesian/graph_interact\"),f=t(\"../../components/color\"),d=t(\"../../components/drawing\"),p=t(\"../../lib/svg_text_utils\"),m=t(\"./helpers\");e.exports=function(t,e){var r=t._fullLayout;s(e,r._size);var u=r._pielayer.selectAll(\"g.trace\").data(e);u.enter().append(\"g\").attr({\"stroke-linejoin\":\"round\",class:\"trace\"}),u.exit().remove(),u.order(),u.each(function(e){var s=c.select(this),u=e[0],g=u.trace,v=(g.depth||0)*u.r*Math.sin(0)/2,y=g.tiltaxis||0,b=y*Math.PI/180,x=[v*Math.sin(b),v*Math.cos(b)],_=u.r*Math.cos(0),w=s.selectAll(\"g.part\").data(g.tilt?[\"top\",\"sides\"]:[\"top\"]);w.enter().append(\"g\").attr(\"class\",function(t){return t+\" part\"}),w.exit().remove(),w.order(),l(e),s.selectAll(\".top\").each(function(){var s=c.select(this).selectAll(\"g.slice\").data(e);s.enter().append(\"g\").classed(\"slice\",!0),s.exit().remove();var l=[[[],[]],[[],[]]],v=!1;s.each(function(e){function o(n){n.originalEvent=c.event;var a=t._fullLayout,o=t._fullData[g.index],s=o.hoverinfo;if(\"all\"===s&&(s=\"label+text+value+percent+name\"),!t._dragging&&!1!==a.hovermode&&\"none\"!==s&&\"skip\"!==s&&s){var l=i(e,u),f=w+e.pxmid[0]*(1-l),d=M+e.pxmid[1]*(1-l),p=r.separators,v=[];-1!==s.indexOf(\"label\")&&v.push(e.label),-1!==s.indexOf(\"text\")&&(o.hovertext?v.push(Array.isArray(o.hovertext)?o.hovertext[e.i]:o.hovertext):o.text&&o.text[e.i]&&v.push(o.text[e.i])),-1!==s.indexOf(\"value\")&&v.push(m.formatPieValue(e.v,p)),-1!==s.indexOf(\"percent\")&&v.push(m.formatPiePercent(e.v/u.vTotal,p)),h.loneHover({x0:f-l*u.r,x1:f+l*u.r,y:d,text:v.join(\"<br>\"),name:-1!==s.indexOf(\"name\")?o.name:void 0,color:e.color,idealAlign:e.pxmid[0]<0?\"left\":\"right\"},{container:a._hoverlayer.node(),outerContainer:a._paper.node()}),h.hover(t,n,\"pie\"),T=!0}else h.hover(t,n,\"pie\")}function s(e){e.originalEvent=c.event,t.emit(\"plotly_unhover\",{event:c.event,points:[e]}),T&&(h.loneUnhover(r._hoverlayer.node()),T=!1)}function f(){t._hoverdata=[e],t._hoverdata.trace=u.trace,h.click(t,c.event)}function b(t,r,n,i){return\"a\"+i*u.r+\",\"+i*_+\" \"+y+\" \"+e.largeArc+(n?\" 1 \":\" 0 \")+i*(r[0]-t[0])+\",\"+i*(r[1]-t[1])}if(e.hidden)c.select(this).selectAll(\"path,g\").remove();else{l[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var w=u.cx+x[0],M=u.cy+x[1],k=c.select(this),A=k.selectAll(\"path.surface\").data([e]),T=!1;if(A.enter().append(\"path\").classed(\"surface\",!0).style({\"pointer-events\":\"all\"}),k.select(\"path.textline\").remove(),k.on(\"mouseover\",o).on(\"mouseout\",s).on(\"click\",f),g.pull){var S=+(Array.isArray(g.pull)?g.pull[e.i]:g.pull)||0;S>0&&(w+=S*e.pxmid[0],M+=S*e.pxmid[1])}e.cxFinal=w,e.cyFinal=M;var E=g.hole;if(e.v===u.vTotal){var L=\"M\"+(w+e.px0[0])+\",\"+(M+e.px0[1])+b(e.px0,e.pxmid,!0,1)+b(e.pxmid,e.px0,!0,1)+\"Z\";E?A.attr(\"d\",\"M\"+(w+E*e.px0[0])+\",\"+(M+E*e.px0[1])+b(e.px0,e.pxmid,!1,E)+b(e.pxmid,e.px0,!1,E)+\"Z\"+L):A.attr(\"d\",L)}else{var C=b(e.px0,e.px1,!0,1);if(E){var z=1-E;A.attr(\"d\",\"M\"+(w+E*e.px1[0])+\",\"+(M+E*e.px1[1])+b(e.px1,e.px0,!1,E)+\"l\"+z*e.px0[0]+\",\"+z*e.px0[1]+C+\"Z\")}else A.attr(\"d\",\"M\"+w+\",\"+M+\"l\"+e.px0[0]+\",\"+e.px0[1]+C+\"Z\")}var D=Array.isArray(g.textposition)?g.textposition[e.i]:g.textposition,I=k.selectAll(\"g.slicetext\").data(e.text&&\"none\"!==D?[0]:[]);I.enter().append(\"g\").classed(\"slicetext\",!0),I.exit().remove(),I.each(function(){var t=c.select(this).selectAll(\"text\").data([0]);t.enter().append(\"text\").attr(\"data-notex\",1),t.exit().remove(),t.text(e.text).attr({class:\"slicetext\",transform:\"\",\"data-bb\":\"\",\"text-anchor\":\"middle\",x:0,y:0}).call(d.font,\"outside\"===D?g.outsidetextfont:g.insidetextfont).call(p.convertToTspans),t.selectAll(\"tspan.line\").attr({x:0,y:0});var r,i=d.bBox(t.node());\"outside\"===D?r=a(i,e):(r=n(i,e,u),\"auto\"===D&&r.scale<1&&(t.call(d.font,g.outsidetextfont),g.outsidetextfont.family===g.insidetextfont.family&&g.outsidetextfont.size===g.insidetextfont.size||(t.attr({\"data-bb\":\"\"}),i=d.bBox(t.node())),r=a(i,e)));var o=w+e.pxmid[0]*r.rCenter+(r.x||0),s=M+e.pxmid[1]*r.rCenter+(r.y||0);r.outside&&(e.yLabelMin=s-i.height/2,e.yLabelMid=s,e.yLabelMax=s+i.height/2,e.labelExtraX=0,e.labelExtraY=0,v=!0),t.attr(\"transform\",\"translate(\"+o+\",\"+s+\")\"+(r.scale<1?\"scale(\"+r.scale+\")\":\"\")+(r.rotate?\"rotate(\"+r.rotate+\")\":\"\")+\"translate(\"+-(i.left+i.right)/2+\",\"+-(i.top+i.bottom)/2+\")\")})}}),v&&o(l,g),s.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=c.select(this),r=e.select(\"g.slicetext text\");r.attr(\"transform\",\"translate(\"+t.labelExtraX+\",\"+t.labelExtraY+\")\"+r.attr(\"transform\"));var n=t.cxFinal+t.pxmid[0],i=\"M\"+n+\",\"+(t.cyFinal+t.pxmid[1]),a=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var o=t.labelExtraX*t.pxmid[1]/t.pxmid[0],s=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);Math.abs(o)>Math.abs(s)?i+=\"l\"+s*t.pxmid[0]/t.pxmid[1]+\",\"+s+\"H\"+(n+t.labelExtraX+a):i+=\"l\"+t.labelExtraX+\",\"+o+\"v\"+(s-o)+\"h\"+a}else i+=\"V\"+(t.yLabelMid+t.labelExtraY)+\"h\"+a;e.append(\"path\").classed(\"textline\",!0).call(f.stroke,g.outsidetextfont.color).attr({\"stroke-width\":Math.min(2,g.outsidetextfont.size/8),d:i,fill:\"none\"})}})})}),setTimeout(function(){u.selectAll(\"tspan\").each(function(){var t=c.select(this);t.attr(\"dy\")&&t.attr(\"dy\",t.attr(\"dy\"))})},0)}},{\"../../components/color\":578,\"../../components/drawing\":602,\"../../lib/svg_text_utils\":704,\"../../plots/cartesian/graph_interact\":733,\"./helpers\":964,d3:107}],969:[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(\".top path.surface\").each(function(t){n.select(this).call(i,t,e)})})}},{\"./style_one\":970,d3:107}],970:[function(t,e,r){\"use strict\";var n=t(\"../../components/color\");e.exports=function(t,e,r){var i=r.marker.line.color;Array.isArray(i)&&(i=i[e.i]||n.defaultLine);var a=r.marker.line.width||0;Array.isArray(a)&&(a=a[e.i]||0),t.style({\"stroke-width\":a}).call(n.fill,e.color).call(n.stroke,i)}},{\"../../components/color\":578}],971:[function(t,e,r){\"use strict\";var n=t(\"../scattergl/attributes\");e.exports={x:n.x,y:n.y,xy:{valType:\"data_array\"},indices:{valType:\"data_array\"},xbounds:{valType:\"data_array\"},ybounds:{valType:\"data_array\"},text:n.text,marker:{color:{valType:\"color\",arrayOk:!1},opacity:{valType:\"number\",min:0,max:1,dflt:1,arrayOk:!1},blend:{valType:\"boolean\",dflt:null},sizemin:{valType:\"number\",min:.1,max:2,dflt:.5},sizemax:{valType:\"number\",min:.1,dflt:20},border:{color:{valType:\"color\",arrayOk:!1},arearatio:{valType:\"number\",min:0,max:1,dflt:0}}}}},{\"../scattergl/attributes\":1020}],972:[function(t,e,r){\"use strict\";function n(t,e){this.scene=t,this.uid=e,this.type=\"pointcloud\",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color=\"rgb(0, 0, 0)\",this.name=\"\",this.hoverinfo=\"all\",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=a(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}function i(t,e){var r=new n(t,e.uid);return r.update(e),r}var a=t(\"gl-pointcloud2d\"),o=t(\"../../lib/str2rgbarray\"),s=t(\"../scatter/get_trace_color\"),l=[\"xaxis\",\"yaxis\"],u=n.prototype;u.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},u.update=function(t){this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(t),this.color=s(t,{})},u.updateFast=function(t){var e,r,n,i,a,s,l=this.xData=this.pickXData=t.x,u=this.yData=this.pickYData=t.y,c=this.pickXYData=t.xy,h=t.xbounds&&t.ybounds,f=t.indices,d=this.bounds;if(c){if(n=c,e=c.length>>>1,h)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(s=0;s<e;s++)i=n[2*s],a=n[2*s+1],i<d[0]&&(d[0]=i),i>d[2]&&(d[2]=i),a<d[1]&&(d[1]=a),a>d[3]&&(d[3]=a);if(f)r=f;else for(r=new Int32Array(e),s=0;s<e;s++)r[s]=s}else for(e=l.length,n=new Float32Array(2*e),r=new Int32Array(e),s=0;s<e;s++)i=l[s],a=u[s],r[s]=s,n[2*s]=i,n[2*s+1]=a,i<d[0]&&(d[0]=i),i>d[2]&&(d[2]=i),a<d[1]&&(d[1]=a),a>d[3]&&(d[3]=a);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var p=o(t.marker.color),m=o(t.marker.border.color),g=t.opacity*t.marker.opacity;p[3]*=g,this.pointcloudOptions.color=p;var v=t.marker.blend;if(null===v){v=l.length<100||u.length<100}this.pointcloudOptions.blend=v,m[3]*=g,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)},u.expandAxesFast=function(t,e){for(var r,n,i,a=e||.5,o=0;o<2;o++)(n=(r=this.scene[l[o]])._min)||(n=[]),n.push({val:t[o],pad:a}),(i=r._max)||(i=[]),i.push({val:t[o+2],pad:a})},u.dispose=function(){this.pointcloud.dispose()},e.exports=i},{\"../../lib/str2rgbarray\":703,\"../scatter/get_trace_color\":984,\"gl-pointcloud2d\":214}],973:[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\":685,\"./attributes\":971}],974:[function(t,e,r){\"use strict\";var n={};n.attributes=t(\"./attributes\"),n.supplyDefaults=t(\"./defaults\"),n.calc=t(\"../scatter3d/calc\"),n.plot=t(\"./convert\"),n.moduleType=\"trace\",n.name=\"pointcloud\",n.basePlotModule=t(\"../../plots/gl2d\"),n.categories=[\"gl2d\",\"showLegend\"],n.meta={},e.exports=n},{\"../../plots/gl2d\":764,\"../scatter3d/calc\":1e3,\"./attributes\":971,\"./convert\":972,\"./defaults\":973}],975:[function(t,e,r){\"use strict\";var n=t(\"../../lib\");e.exports=function(t,e){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 r=e.marker;if(r){n.mergeArray(r.size,t,\"ms\"),n.mergeArray(r.opacity,t,\"mo\"),n.mergeArray(r.symbol,t,\"mx\"),n.mergeArray(r.color,t,\"mc\");var i=r.line;r.line&&(n.mergeArray(i.color,t,\"mlc\"),n.mergeArray(i.width,t,\"mlw\"))}}},{\"../../lib\":685}],976:[function(t,e,r){\"use strict\";var n=t(\"../../components/colorscale/color_attributes\"),i=t(\"../../components/errorbars/attributes\"),a=t(\"../../components/colorbar/attributes\"),o=t(\"../../components/drawing/attributes\").dash,s=t(\"../../components/drawing\"),l=(t(\"./constants\"),t(\"../../lib/extend\").extendFlat);e.exports={x:{valType:\"data_array\"},x0:{valType:\"any\",dflt:0},dx:{valType:\"number\",dflt:1},y:{valType:\"data_array\"},y0:{valType:\"any\",dflt:0},customdata:{valType:\"data_array\"},dy:{valType:\"number\",dflt:1},ids:{valType:\"data_array\"},text:{valType:\"string\",dflt:\"\",arrayOk:!0},hovertext:{valType:\"string\",dflt:\"\",arrayOk:!0},mode:{valType:\"flaglist\",flags:[\"lines\",\"markers\",\"text\"],extras:[\"none\"]},hoveron:{valType:\"flaglist\",flags:[\"points\",\"fills\"]},line:{color:{valType:\"color\"},width:{valType:\"number\",min:0,dflt:2},shape:{valType:\"enumerated\",values:[\"linear\",\"spline\",\"hv\",\"vh\",\"hvh\",\"vhv\"],dflt:\"linear\"},smoothing:{valType:\"number\",min:0,max:1.3,dflt:1},dash:o,simplify:{valType:\"boolean\",dflt:!0}},connectgaps:{valType:\"boolean\",dflt:!1},fill:{valType:\"enumerated\",values:[\"none\",\"tozeroy\",\"tozerox\",\"tonexty\",\"tonextx\",\"toself\",\"tonext\"],dflt:\"none\"},fillcolor:{valType:\"color\"},marker:l({},{symbol:{valType:\"enumerated\",values:s.symbolList,dflt:\"circle\",arrayOk:!0},opacity:{valType:\"number\",min:0,max:1,arrayOk:!0},size:{valType:\"number\",min:0,dflt:6,arrayOk:!0},maxdisplayed:{valType:\"number\",min:0,dflt:0},sizeref:{valType:\"number\",dflt:1},sizemin:{valType:\"number\",min:0,dflt:0},sizemode:{valType:\"enumerated\",values:[\"diameter\",\"area\"],dflt:\"diameter\"},showscale:{valType:\"boolean\",dflt:!1},colorbar:a,line:l({},{width:{valType:\"number\",min:0,arrayOk:!0}},n(\"marker.line\"))},n(\"marker\")),textposition:{valType:\"enumerated\",values:[\"top left\",\"top center\",\"top right\",\"middle left\",\"middle center\",\"middle right\",\"bottom left\",\"bottom center\",\"bottom right\"],dflt:\"middle center\",arrayOk:!0},textfont:{family:{valType:\"string\",noBlank:!0,strict:!0,arrayOk:!0},size:{valType:\"number\",min:1,arrayOk:!0},color:{valType:\"color\",arrayOk:!0}},r:{valType:\"data_array\"},t:{valType:\"data_array\"},error_y:i,error_x:i}},{\"../../components/colorbar/attributes\":579,\"../../components/colorscale/color_attributes\":585,\"../../components/drawing\":602,\"../../components/drawing/attributes\":601,\"../../components/errorbars/attributes\":604,\"../../lib/extend\":677,\"./constants\":981}],977:[function(t,e,r){\"use strict\";var n=t(\"fast-isnumeric\"),i=t(\"../../plots/cartesian/axes\"),a=t(\"./subtypes\"),o=t(\"./colorscale_calc\"),s=t(\"./arrays_to_calcdata\");e.exports=function(t,e){var r,l,u,c=i.getFromId(t,e.xaxis||\"x\"),h=i.getFromId(t,e.yaxis||\"y\"),f=c.makeCalcdata(e,\"x\"),d=h.makeCalcdata(e,\"y\"),p=Math.min(f.length,d.length);c._minDtick=0,h._minDtick=0,f.length>p&&f.splice(p,f.length-p),d.length>p&&d.splice(p,d.length-p);var m={padded:!0},g={padded:!0};if(a.hasMarkers(e)){if(r=e.marker,l=r.size,Array.isArray(l)){var v={type:\"linear\"};i.setConvert(v),(l=v.makeCalcdata(e.marker,\"size\")).length>p&&l.splice(p,l.length-p)}var y,b=1.6*(e.marker.sizeref||1);y=\"area\"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/b),3)}:function(t){return Math.max((t||0)/b,3)},m.ppad=g.ppad=Array.isArray(l)?l.map(y):y(l)}o(e),!(\"tozerox\"===e.fill||\"tonextx\"===e.fill&&t.firstscatter)||f[0]===f[p-1]&&d[0]===d[p-1]?e.error_y.visible||-1===[\"tonexty\",\"tozeroy\"].indexOf(e.fill)&&(a.hasMarkers(e)||a.hasText(e))||(m.padded=!1,m.ppad=0):m.tozero=!0,!(\"tozeroy\"===e.fill||\"tonexty\"===e.fill&&t.firstscatter)||f[0]===f[p-1]&&d[0]===d[p-1]?-1!==[\"tonextx\",\"tozerox\"].indexOf(e.fill)&&(g.padded=!1):g.tozero=!0,i.expand(c,f,m),i.expand(h,d,g);var x=new Array(p);for(u=0;u<p;u++)x[u]=n(f[u])&&n(d[u])?{x:f[u],y:d[u]}:{x:!1,y:!1},e.ids&&(x[u].id=String(e.ids[u]));return s(x,e),t.firstscatter=!1,x}},{\"../../plots/cartesian/axes\":724,\"./arrays_to_calcdata\":975,\"./colorscale_calc\":980,\"./subtypes\":996,\"fast-isnumeric\":116}],978:[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}}}}}},{}],979:[function(t,e,r){\"use strict\";var n=t(\"fast-isnumeric\"),i=t(\"../../lib\"),a=t(\"../../plots/plots\"),o=t(\"../../components/colorscale\"),s=t(\"../../components/colorbar/draw\");e.exports=function(t,e){var r=e[0].trace,l=r.marker,u=\"cb\"+r.uid;if(t._fullLayout._infolayer.selectAll(\".\"+u).remove(),void 0!==l&&l.showscale){var c=l.color,h=l.cmin,f=l.cmax;n(h)||(h=i.aggNums(Math.min,null,c)),n(f)||(f=i.aggNums(Math.max,null,c));var d=e[0].t.cb=s(t,u),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,h,f),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:h,end:f,size:(f-h)/254}).options(l.colorbar)()}else a.autoMargin(t,u)}},{\"../../components/colorbar/draw\":581,\"../../components/colorscale\":592,\"../../lib\":685,\"../../plots/plots\":787,\"fast-isnumeric\":116}],980:[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\":584,\"../../components/colorscale/has_colorscale\":591,\"./subtypes\":996}],981:[function(t,e,r){\"use strict\";e.exports={PTS_LINESONLY:20}},{}],982:[function(t,e,r){\"use strict\";var n=t(\"../../lib\"),i=t(\"./attributes\"),a=t(\"./constants\"),o=t(\"./subtypes\"),s=t(\"./xy_defaults\"),l=t(\"./marker_defaults\"),u=t(\"./line_defaults\"),c=t(\"./line_shape_defaults\"),h=t(\"./text_defaults\"),f=t(\"./fillcolor_defaults\"),d=t(\"../../components/errorbars/defaults\");e.exports=function(t,e,r,p){function m(r,a){return n.coerce(t,e,i,r,a)}var g=s(t,e,p,m),v=g<a.PTS_LINESONLY?\"lines+markers\":\"lines\";if(g){m(\"customdata\"),m(\"text\"),m(\"hovertext\"),m(\"mode\",v),m(\"ids\"),o.hasLines(e)&&(u(t,e,r,p,m),c(t,e,m),m(\"connectgaps\"),m(\"line.simplify\")),o.hasMarkers(e)&&l(t,e,r,p,m),o.hasText(e)&&h(t,e,p,m);var y=[];(o.hasMarkers(e)||o.hasText(e))&&(m(\"marker.maxdisplayed\"),y.push(\"points\")),m(\"fill\"),\"none\"!==e.fill&&(f(t,e,r,m),o.hasLines(e)||c(t,e,m)),\"tonext\"!==e.fill&&\"toself\"!==e.fill||y.push(\"fills\"),m(\"hoveron\",y.join(\"+\")||\"points\"),d(t,e,r,{axis:\"y\"}),d(t,e,r,{axis:\"x\",inherit:\"y\"})}else e.visible=!1}},{\"../../components/errorbars/defaults\":607,\"../../lib\":685,\"./attributes\":976,\"./constants\":981,\"./fillcolor_defaults\":983,\"./line_defaults\":987,\"./line_shape_defaults\":989,\"./marker_defaults\":992,\"./subtypes\":996,\"./text_defaults\":997,\"./xy_defaults\":998}],983:[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\":578}],984:[function(t,e,r){\"use strict\";var n=t(\"../../components/color\"),i=t(\"./subtypes\");e.exports=function(t,e){var r,a;if(\"lines\"===t.mode)return r=t.line.color,r&&n.opacity(r)?r:t.fillcolor;if(\"none\"===t.mode)return t.fill?t.fillcolor:\"\";var o=e.mcc||(t.marker||{}).color,s=e.mlcc||((t.marker||{}).line||{}).color;return a=o&&n.opacity(o)?o:s&&n.opacity(s)&&(e.mlw||((t.marker||{}).line||{}).width)?s:\"\",a?n.opacity(a)<.3?n.addOpacity(a,.3):a:(r=(t.line||{}).color,r&&n.opacity(r)&&i.hasLines(t)&&t.line.width?r:t.fillcolor)}},{\"../../components/color\":578,\"./subtypes\":996}],985:[function(t,e,r){\"use strict\";var n=t(\"../../lib\"),i=t(\"../../plots/cartesian/graph_interact\"),a=t(\"../../plots/cartesian/constants\"),o=t(\"../../components/errorbars\"),s=t(\"./get_trace_color\"),l=t(\"../../components/color\");e.exports=function(t,e,r,u){var c=t.cd,h=c[0].trace,f=t.xa,d=t.ya,p=f.c2p(e),m=d.c2p(r),g=[p,m];if(-1!==h.hoveron.indexOf(\"points\")){var v=function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(f.c2p(t.x)-p)-e,1-3/e)},y=function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(d.c2p(t.y)-m)-e,1-3/e)},b=function(t){var e=Math.max(3,t.mrc||0),r=f.c2p(t.x)-p,n=d.c2p(t.y)-m;return Math.max(Math.sqrt(r*r+n*n)-e,1-3/e)},x=i.getDistanceFunction(u,v,y,b);if(i.getClosest(c,x,t),!1!==t.index){var _=c[t.index],w=f.c2p(_.x,!0),M=d.c2p(_.y,!0),k=_.mrc||1;return n.extendFlat(t,{color:s(h,_),x0:w-k,x1:w+k,xLabelVal:_.x,y0:M-k,y1:M+k,yLabelVal:_.y}),_.htx?t.text=_.htx:h.hovertext?t.text=h.hovertext:_.tx?t.text=_.tx:h.text&&(t.text=h.text),o.hoverInfo(_,h,t),[t]}}if(-1!==h.hoveron.indexOf(\"fills\")&&h._polygons){var A,T,S,E,L,C,z,D,I=h._polygons,P=[],O=!1,j=1/0,R=-1/0,F=1/0,N=-1/0;for(A=0;A<I.length;A++)(S=I[A]).contains(g)&&(O=!O,P.push(S),F=Math.min(F,S.ymin),N=Math.max(N,S.ymax));if(O){var B=((F=Math.max(F,0))+(N=Math.min(N,d._length)))/2;for(A=0;A<P.length;A++)for(E=P[A].pts,T=1;T<E.length;T++)(z=E[T-1][1])>B!=(D=E[T][1])>=B&&(L=(C=E[T-1][0])+(E[T][0]-C)*(B-z)/(D-z),j=Math.min(j,L),R=Math.max(R,L));j=Math.max(j,0),R=Math.min(R,f._length);var U=l.defaultLine;return l.opacity(h.fillcolor)?U=h.fillcolor:l.opacity((h.line||{}).color)&&(U=h.line.color),n.extendFlat(t,{distance:a.MAXDIST+10,x0:j,x1:R,y0:B,y1:B,color:U}),delete t.index,h.text&&!Array.isArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}},{\"../../components/color\":578,\"../../components/errorbars\":608,\"../../lib\":685,\"../../plots/cartesian/constants\":729,\"../../plots/cartesian/graph_interact\":733,\"./get_trace_color\":984}],986:[function(t,e,r){\"use strict\";var n={},i=t(\"./subtypes\");n.hasLines=i.hasLines,n.hasMarkers=i.hasMarkers,n.hasText=i.hasText,n.isBubble=i.isBubble,n.attributes=t(\"./attributes\"),n.supplyDefaults=t(\"./defaults\"),n.cleanData=t(\"./clean_data\"),n.calc=t(\"./calc\"),n.arraysToCalcdata=t(\"./arrays_to_calcdata\"),n.plot=t(\"./plot\"),n.colorbar=t(\"./colorbar\"),n.style=t(\"./style\"),n.hoverPoints=t(\"./hover\"),n.selectPoints=t(\"./select\"),n.animatable=!0,n.moduleType=\"trace\",n.name=\"scatter\",n.basePlotModule=t(\"../../plots/cartesian\"),n.categories=[\"cartesian\",\"symbols\",\"markerColorscale\",\"errorBarsOK\",\"showLegend\"],n.meta={},e.exports=n},{\"../../plots/cartesian\":734,\"./arrays_to_calcdata\":975,\"./attributes\":976,\"./calc\":977,\"./clean_data\":978,\"./colorbar\":979,\"./defaults\":982,\"./hover\":985,\"./plot\":993,\"./select\":994,\"./style\":995,\"./subtypes\":996}],987:[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\":587,\"../../components/colorscale/has_colorscale\":591}],988:[function(t,e,r){\"use strict\";var n=t(\"../../constants/numerical\").BADNUM;e.exports=function(t,e){function r(e){var r=_.c2p(t[e].x),i=w.c2p(t[e].y);return r!==n&&i!==n&&[r,i]}function i(t){var e=t[0]/_._length,r=t[1]/w._length;return(1+10*Math.max(0,-e,e-1,-r,r-1))*A}var a,o,s,l,u,c,h,f,d,p,m,g,v,y,b,x,_=e.xaxis,w=e.yaxis,M=e.simplify,k=e.connectGaps,A=e.baseTolerance,T=e.linear,S=[],E=.2,L=new Array(t.length),C=0;for(M||(A=E=-1),a=0;a<t.length;a++)if(o=r(a)){for(C=0,L[C++]=o,a++;a<t.length;a++){if(!(l=r(a))){if(k)continue;break}if(T){if(!((h=function(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}(l,o))<i(l)*E)){for(d=[(l[0]-o[0])/h,(l[1]-o[1])/h],u=o,m=h,g=y=b=0,f=!1,s=l,a++;a<t.length;a++){if(!(c=r(a))){if(k)continue;break}if(p=[c[0]-o[0],c[1]-o[1]],x=p[0]*d[1]-p[1]*d[0],y=Math.min(y,x),(b=Math.max(b,x))-y>i(c))break;s=c,(v=p[0]*d[0]+p[1]*d[1])>m?(m=v,l=c,f=!1):v<g&&(g=v,u=c,f=!0)}if(f?(L[C++]=l,s!==u&&(L[C++]=u)):(u!==o&&(L[C++]=u),s!==l&&(L[C++]=l)),L[C++]=s,a>=t.length||!c)break;L[C++]=c,o=c}}else L[C++]=l}S.push(L.slice(0,C))}return S}},{\"../../constants/numerical\":666}],989:[function(t,e,r){\"use strict\";e.exports=function(t,e,r){\"spline\"===r(\"line.shape\")&&r(\"line.smoothing\")}},{}],990:[function(t,e,r){\"use strict\";e.exports=function(t,e,r){for(var n,i=null,a=0;a<r.length;++a)!0===(n=r[a][0].trace).visible?(n._nexttrace=null,-1!==[\"tonextx\",\"tonexty\",\"tonext\"].indexOf(n.fill)&&(n._prevtrace=i,i&&(i._nexttrace=n)),i=n):n._prevtrace=n._nexttrace=null}},{}],991:[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\":116}],992:[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,u){var c=o.isBubble(t),h=(t.line||{}).color;h&&(r=h),l(\"marker.symbol\"),l(\"marker.opacity\",c?.7:1),l(\"marker.size\"),l(\"marker.color\",r),i(t,\"marker\")&&a(t,e,s,l,{prefix:\"marker.\",cLetter:\"c\"}),(u||{}).noLine||(l(\"marker.line.color\",h&&!Array.isArray(h)&&e.marker.color!==h?h:c?n.background:n.defaultLine),i(t,\"marker.line\")&&a(t,e,s,l,{prefix:\"marker.line.\",cLetter:\"c\"}),l(\"marker.line.width\",c?1:0)),c&&(l(\"marker.sizeref\"),l(\"marker.sizemin\"),l(\"marker.sizemode\"))}},{\"../../components/color\":578,\"../../components/colorscale/defaults\":587,\"../../components/colorscale/has_colorscale\":591,\"./subtypes\":996}],993:[function(t,e,r){\"use strict\";function n(t,e){var r;e.selectAll(\"g.trace\").each(function(t){var e=o.select(this);if((r=t[0].trace)._nexttrace){if(r._nextFill=e.select(\".js-fill.js-tonext\"),!r._nextFill.size()){var n=\":first-child\";e.select(\".js-fill.js-tozero\").size()&&(n+=\" + *\"),r._nextFill=e.insert(\"path\",n).attr(\"class\",\"js-fill js-tonext\")}}else e.selectAll(\".js-fill.js-tonext\").remove(),r._nextFill=null;r.fill&&(\"tozero\"===r.fill.substr(0,6)||\"toself\"===r.fill||\"to\"===r.fill.substr(0,2)&&!r._prevtrace)?(r._ownFill=e.select(\".js-fill.js-tozero\"),r._ownFill.size()||(r._ownFill=e.insert(\"path\",\":first-child\").attr(\"class\",\"js-fill js-tozero\"))):(e.selectAll(\".js-fill.js-tozero\").remove(),r._ownFill=null)})}function i(t,e,r,n,i,f,p){function m(t){return M?t.transition():t}function g(t){return t.filter(function(t){return t.vis})}function v(t){return t.id}function y(t){if(t.ids)return v}function b(){return!1}function x(t){var e,r,n=t[0].trace,i=o.select(this),a=c.hasMarkers(n),u=c.hasText(n),h=y(n),f=b,d=b;a&&(f=n.marker.maxdisplayed||n._needsCull?g:s.identity),u&&(d=n.marker.maxdisplayed||n._needsCull?g:s.identity);var p=(e=(r=i.selectAll(\"path.point\")).data(f,h)).enter().append(\"path\").classed(\"point\",!0);p.call(l.pointStyle,n).call(l.translatePoints,k,A,n),M&&p.style(\"opacity\",0).transition().style(\"opacity\",1),e.each(function(t){var e=o.select(this),r=m(e);l.translatePoint(t,r,k,A),l.singlePointStyle(t,r,n),n.customdata&&e.classed(\"plotly-customdata\",null!==t.data&&void 0!==t.data)}),M?e.exit().transition().style(\"opacity\",0).remove():e.exit().remove(),(e=(r=i.selectAll(\"g\")).data(d,h)).enter().append(\"g\").append(\"text\"),e.each(function(t){var e=m(o.select(this).select(\"text\"));l.translatePoint(t,e,k,A)}),e.selectAll(\"text\").call(l.textPointStyle,n).each(function(t){var e=t.xp||k.c2p(t.x),r=t.yp||A.c2p(t.y);o.select(this).selectAll(\"tspan.line\").each(function(){m(o.select(this)).attr({x:e,y:r})})}),e.exit().remove()}var _,w;a(t,e,r,n,i);var M=!!p&&p.duration>0,k=r.xaxis,A=r.yaxis,T=n[0].trace,S=T.line,E=o.select(f);if(E.call(u.plot,r,p),!0===T.visible){m(E).style(\"opacity\",T.opacity);var L,C,z=T.fill.charAt(T.fill.length-1);\"x\"!==z&&\"y\"!==z&&(z=\"\"),n[0].node3=E;var D=\"\",I=[],P=T._prevtrace;P&&(D=P._prevRevpath||\"\",C=P._nextFill,I=P._polygons);var O,j,R,F,N,B,U,V,H,q=\"\",G=\"\",Y=[],W=[],X=s.noop;if(L=T._ownFill,c.hasLines(T)||\"none\"!==T.fill){for(C&&C.datum(n),-1!==[\"hv\",\"vh\",\"hvh\",\"vhv\"].indexOf(S.shape)?(R=l.steps(S.shape),F=l.steps(S.shape.split(\"\").reverse().join(\"\"))):R=F=\"spline\"===S.shape?function(t){var e=t[t.length-1];return t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),S.smoothing):l.smoothopen(t,S.smoothing)}:function(t){return\"M\"+t.join(\"L\")},N=function(t){return F(t.reverse())},Y=h(n,{xaxis:k,yaxis:A,connectGaps:T.connectgaps,baseTolerance:Math.max(S.width||1,3)/4,linear:\"linear\"===S.shape,simplify:S.simplify}),H=T._polygons=new Array(Y.length),w=0;w<Y.length;w++)T._polygons[w]=d(Y[w]);Y.length&&(B=Y[0][0],V=(U=Y[Y.length-1])[U.length-1]),W=Y.filter(function(t){return t.length>1}),X=function(t){return function(e){if(O=R(e),j=N(e),q?z?(q+=\"L\"+O.substr(1),G=j+\"L\"+G.substr(1)):(q+=\"Z\"+O,G=j+\"Z\"+G):(q=O,G=j),c.hasLines(T)&&e.length>1){var r=o.select(this);if(r.datum(n),t)m(r.style(\"opacity\",0).attr(\"d\",O).call(l.lineGroupStyle)).style(\"opacity\",1);else{var i=m(r);i.attr(\"d\",O),l.singleLineStyle(n,i)}}}}}var Z=E.selectAll(\".js-line\").data(W);m(Z.exit()).style(\"opacity\",0).remove(),Z.each(X(!1)),Z.enter().append(\"path\").classed(\"js-line\",!0).style(\"vector-effect\",\"non-scaling-stroke\").call(l.lineGroupStyle).each(X(!0)),Y.length&&(L?B&&V&&(z?(\"y\"===z?B[1]=V[1]=A.c2p(0,!0):\"x\"===z&&(B[0]=V[0]=k.c2p(0,!0)),m(L).attr(\"d\",\"M\"+V+\"L\"+B+\"L\"+q.substr(1))):m(L).attr(\"d\",q+\"Z\")):\"tonext\"===T.fill.substr(0,6)&&q&&D&&(\"tonext\"===T.fill?m(C).attr(\"d\",q+\"Z\"+D+\"Z\"):m(C).attr(\"d\",q+\"L\"+D.substr(1)+\"Z\"),T._polygons=T._polygons.concat(I)),T._prevRevpath=G,T._prevPolygons=H);var J=E.selectAll(\".points\");_=J.data([n]),J.each(x),_.enter().append(\"g\").classed(\"points\",!0).each(x),_.exit().remove()}}function a(t,e,r,n,i){var a=r.xaxis,l=r.yaxis,u=o.extent(s.simpleMap(a.range,a.r2c)),h=o.extent(s.simpleMap(l.range,l.r2c)),f=n[0].trace;if(c.hasMarkers(f)){var d=f.marker.maxdisplayed;if(0!==d){var p=n.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=h[0]&&t.y<=h[1]}),m=Math.ceil(p.length/d),g=0;i.forEach(function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r<e&&g++});var v=Math.round(g*m/3+Math.floor(g/3)*m/7.1);n.forEach(function(t){delete t.vis}),p.forEach(function(t,e){0===Math.round((e+v)%m)&&(t.vis=!0)})}}}var o=t(\"d3\"),s=t(\"../../lib\"),l=t(\"../../components/drawing\"),u=t(\"../../components/errorbars\"),c=t(\"./subtypes\"),h=t(\"./line_points\"),f=t(\"./link_traces\"),d=t(\"../../lib/polygon\").tester;e.exports=function(t,e,r,a,s){var l,u,c,h,d=e.plot.select(\"g.scatterlayer\"),p=!a,m=!!a&&a.duration>0;for((c=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),f(t,e,r),n(t,d),l=0,u={};l<r.length;l++)u[r[l][0].trace.uid]=l;d.selectAll(\"g.trace\").sort(function(t,e){return u[t[0].trace.uid]>u[e[0].trace.uid]?1:-1}),m?(s&&(h=s()),o.transition().duration(a.duration).ease(a.easing).each(\"end\",function(){h&&h()}).each(\"interrupt\",function(){h&&h()}).each(function(){d.selectAll(\"g.trace\").each(function(n,o){i(t,o,e,n,r,this,a)})})):d.selectAll(\"g.trace\").each(function(n,o){i(t,o,e,n,r,this,a)}),p&&c.exit().remove(),d.selectAll(\"path:not([d])\").remove()}},{\"../../components/drawing\":602,\"../../components/errorbars\":608,\"../../lib\":685,\"../../lib/polygon\":695,\"./line_points\":988,\"./link_traces\":990,\"./subtypes\":996,d3:107}],994:[function(t,e,r){\"use strict\";var n=t(\"./subtypes\");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[],h=s[0].trace,f=h.index,d=h.marker,p=!n.hasMarkers(h)&&!n.hasText(h);if(!0===h.visible&&!p){var m=Array.isArray(d.opacity)?1:d.opacity;if(!1===e)for(r=0;r<s.length;r++)s[r].dim=0;else for(r=0;r<s.length;r++)i=s[r],a=l.c2p(i.x),o=u.c2p(i.y),e.contains([a,o])?(c.push({curveNumber:f,pointNumber:r,x:i.x,y:i.y,id:i.id}),i.dim=0):i.dim=1;return s[0].node3.selectAll(\"path.point\").style(\"opacity\",function(t){return((t.mo+1||m+1)-1)*(t.dim?.2:1)}),s[0].node3.selectAll(\"text\").style(\"opacity\",function(t){return t.dim?.2:1}),c}}},{\"./subtypes\":996}],995:[function(t,e,r){\"use strict\";var n=t(\"d3\"),i=t(\"../../components/drawing\"),a=t(\"../../components/errorbars\");e.exports=function(t){var e=n.select(t).selectAll(\"g.trace.scatter\");e.style(\"opacity\",function(t){return t[0].trace.opacity}),e.selectAll(\"g.points\").each(function(t){var e=n.select(this),r=e.selectAll(\"path.point\"),a=t.trace||t[0].trace;r.call(i.pointStyle,a),e.selectAll(\"text\").call(i.textPointStyle,a)}),e.selectAll(\"g.trace path.js-line\").call(i.lineGroupStyle),e.selectAll(\"g.trace path.js-fill\").call(i.fillGroupStyle),e.call(a.style)}},{\"../../components/drawing\":602,\"../../components/errorbars\":608,d3:107}],996:[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\":685}],997:[function(t,e,r){\"use strict\";var n=t(\"../../lib\");e.exports=function(t,e,r,i){i(\"textposition\"),n.coerceFont(i,\"textfont\",r.font)}},{\"../../lib\":685}],998:[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))<o.length&&(e.x=o.slice(0,a)),a<s.length&&(e.y=s.slice(0,a))):(a=o.length,i(\"y0\"),i(\"dy\"));else{if(!s)return 0;a=e.y.length,i(\"x0\"),i(\"dx\")}return a}},{\"../../registry\":802}],999:[function(t,e,r){\"use strict\";var n=t(\"../scatter/attributes\"),i=t(\"../../components/colorscale/color_attributes\"),a=t(\"../../components/errorbars/attributes\"),o=t(\"../../constants/gl3d_dashes\"),s=t(\"../../constants/gl_markers\"),l=t(\"../../lib/extend\").extendFlat,u=n.line,c=n.marker,h=c.line;e.exports={x:{valType:\"data_array\"},y:{valType:\"data_array\"},z:{valType:\"data_array\"},text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),mode:l({},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:l({},{width:u.width,dash:{valType:\"enumerated\",values:Object.keys(o),dflt:\"solid\"},showscale:{valType:\"boolean\",dflt:!1}},i(\"line\")),marker:l({},{symbol:{valType:\"enumerated\",values:Object.keys(s),dflt:\"circle\",arrayOk:!0},size:l({},c.size,{dflt:8}),sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,opacity:l({},c.opacity,{arrayOk:!1}),showscale:c.showscale,colorbar:c.colorbar,line:l({},{width:l({},h.width,{arrayOk:!1})},i(\"marker.line\"))},i(\"marker\")),textposition:l({},n.textposition,{dflt:\"top center\"}),textfont:n.textfont,error_x:a,error_y:a,error_z:a}},{\"../../components/colorscale/color_attributes\":585,\"../../components/errorbars/attributes\":604,\"../../constants/gl3d_dashes\":663,\"../../constants/gl_markers\":664,\"../../lib/extend\":677,\"../scatter/attributes\":976}],1e3:[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\":975,\"../scatter/colorscale_calc\":980}],1001:[function(t,e,r){\"use strict\";function n(t,e,r){if(!e||!e.visible)return null;for(var n=o(e),i=new Array(t.length),a=0;a<t.length;a++){var s=n(+t[a],a);i[a]=[-s[0]*r,s[1]*r]}return i}function i(t){for(var e=0;e<t.length;e++)if(t[e])return t[e].length;return 0}function a(t,e){var r=[n(t.x,t.error_x,e[0]),n(t.y,t.error_y,e[1]),n(t.z,t.error_z,e[2])],a=i(r);if(0===a)return null;for(var o=new Array(a),s=0;s<a;s++){for(var l=[[0,0,0],[0,0,0]],u=0;u<3;u++)if(r[u])for(var c=0;c<2;c++)l[c][u]=r[u][s][c];o[s]=l}return o}var o=t(\"../../components/errorbars/compute_error\");e.exports=a},{\"../../components/errorbars/compute_error\":606}],1002:[function(t,e,r){\"use strict\";function n(t,e){this.scene=t,this.uid=e,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode=\"\",this.dataPoints=[],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}function i(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],s=[];for(n=0;n<t.length;++n){var l=t[n];!isNaN(l[i])&&isFinite(l[i])&&!isNaN(l[a])&&isFinite(l[a])&&(o.push([l[i],l[a]]),s.push(n))}var u=v(o);for(n=0;n<u.length;++n)for(var c=u[n],h=0;h<c.length;++h)c[h]=s[c[h]];return{positions:t,cells:u,meshColor:e}}function a(t){for(var e=[0,0,0],r=[[0,0,0],[0,0,0],[0,0,0]],n=[0,0,0],i=0;i<3;i++){var a=t[i];a&&!1!==a.copy_zstyle&&(a=t[2]),a&&(e[i]=a.width/2,r[i]=b(a.color),n=a.thickness)}return{capSize:e,color:r,lineWidth:n}}function o(t){var e=[0,0];return Array.isArray(t)?[0,-1]:(t.indexOf(\"bottom\")>=0&&(e[1]+=1),t.indexOf(\"top\")>=0&&(e[1]-=1),t.indexOf(\"left\")>=0&&(e[0]-=1),t.indexOf(\"right\")>=0&&(e[0]+=1),e)}function s(t,e){return e(4*t)}function l(t){return M[t]}function u(t,e,r,n,i){var a=null;if(Array.isArray(t)){a=[];for(var o=0;o<e;o++)void 0===t[o]?a[o]=n:a[o]=r(t[o],i)}else a=r(t,y.identity);return a}function c(t,e){var r,n,i,c,h,f,d=[],p=t.fullSceneLayout,m=t.dataScale,g=p.xaxis,v=p.yaxis,w=p.zaxis,M=e.marker,A=e.line,T=e.x||[],S=e.y||[],E=e.z||[],L=T.length,C=e.xcalendar,z=e.ycalendar,D=e.zcalendar;for(n=0;n<L;n++)i=g.d2l(T[n],0,C)*m[0],c=v.d2l(S[n],0,z)*m[1],h=w.d2l(E[n],0,D)*m[2],d[n]=[i,c,h];if(Array.isArray(e.text))f=e.text;else if(void 0!==e.text)for(f=new Array(L),n=0;n<L;n++)f[n]=e.text;if(r={position:d,mode:e.mode,text:f},\"line\"in e&&(r.lineColor=x(A,1,L),r.lineWidth=A.width,r.lineDashes=A.dash),\"marker\"in e){var I=_(e);r.scatterColor=x(M,1,L),r.scatterSize=u(M.size,L,s,20,I),r.scatterMarker=u(M.symbol,L,l,\"●\"),r.scatterLineWidth=M.line.width,r.scatterLineColor=x(M.line,1,L),r.scatterAngle=0}\"textposition\"in e&&(r.textOffset=o(e.textposition),r.textColor=x(e.textfont,1,L),r.textSize=u(e.textfont.size,L,y.identity,12),r.textFont=e.textfont.family,r.textAngle=0);var P=[\"x\",\"y\",\"z\"];for(r.project=[!1,!1,!1],r.projectScale=[1,1,1],r.projectOpacity=[1,1,1],n=0;n<3;++n){var O=e.projection[P[n]];(r.project[n]=O.show)&&(r.projectOpacity[n]=O.opacity,r.projectScale[n]=O.scale)}r.errorBounds=k(e,m);var j=a([e.error_x,e.error_y,e.error_z]);return r.errorColor=j.color,r.errorLineWidth=j.lineWidth,r.errorCapSize=j.capSize,r.delaunayAxis=e.surfaceaxis,r.delaunayColor=b(e.surfacecolor),r}function h(t){if(Array.isArray(t)){var e=t[0];return Array.isArray(e)&&(t=e),\"rgb(\"+t.slice(0,3).map(function(t){return Math.round(255*t)})+\")\"}return null}function f(t,e){var r=new n(t,e.uid);return r.update(e),r}var d=t(\"gl-line3d\"),p=t(\"gl-scatter3d\"),m=t(\"gl-error3d\"),g=t(\"gl-mesh3d\"),v=t(\"delaunay-triangulate\"),y=t(\"../../lib\"),b=t(\"../../lib/str2rgbarray\"),x=t(\"../../lib/gl_format_color\"),_=t(\"../scatter/make_bubble_size_func\"),w=t(\"../../constants/gl3d_dashes\"),M=t(\"../../constants/gl_markers\"),k=t(\"./calc_errors\"),A=n.prototype;A.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.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},A.update=function(t){var e,r,n,a,o=this.scene.glplot.gl,s=w.solid;this.data=t;var l=c(this.scene,t);\"mode\"in l&&(this.mode=l.mode),\"lineDashes\"in l&&l.lineDashes in w&&(s=w[l.lineDashes]),this.color=h(l.scatterColor)||h(l.lineColor),this.dataPoints=l.position,e={gl:o,position:l.position,color:l.lineColor,lineWidth:l.lineWidth||1,dashes:s[0],dashScale:s[1],opacity:t.opacity,connectGaps:t.connectgaps},-1!==this.mode.indexOf(\"lines\")?this.linePlot?this.linePlot.update(e):(this.linePlot=d(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 u=t.opacity;if(t.marker&&t.marker.opacity&&(u*=t.marker.opacity),r={gl:o,position:l.position,color:l.scatterColor,size:l.scatterSize,glyph:l.scatterMarker,opacity:u,orthographic:!0,lineWidth:l.scatterLineWidth,lineColor:l.scatterLineColor,project:l.project,projectScale:l.projectScale,projectOpacity:l.projectOpacity},-1!==this.mode.indexOf(\"markers\")?this.scatterPlot?this.scatterPlot.update(r):(this.scatterPlot=p(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),a={gl:o,position:l.position,glyph:l.text,color:l.textColor,size:l.textSize,angle:l.textAngle,alignment:l.textOffset,font:l.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:t.opacity},this.textLabels=t.hovertext||t.text,-1!==this.mode.indexOf(\"text\")?this.textMarkers?this.textMarkers.update(a):(this.textMarkers=p(a),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),n={gl:o,position:l.position,color:l.errorColor,error:l.errorBounds,lineWidth:l.errorLineWidth,capSize:l.errorCapSize,opacity:t.opacity},this.errorBars?l.errorBounds?this.errorBars.update(n):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):l.errorBounds&&(this.errorBars=m(n),this.errorBars._trace=this,this.scene.glplot.add(this.errorBars)),l.delaunayAxis>=0){var f=i(l.position,l.delaunayColor,l.delaunayAxis);f.opacity=t.opacity,this.delaunayMesh?this.delaunayMesh.update(f):(f.gl=o,this.delaunayMesh=g(f),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},A.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())},e.exports=f},{\"../../constants/gl3d_dashes\":663,\"../../constants/gl_markers\":664,\"../../lib\":685,\"../../lib/gl_format_color\":682,\"../../lib/str2rgbarray\":703,\"../scatter/make_bubble_size_func\":991,\"./calc_errors\":1001,\"delaunay-triangulate\":108,\"gl-error3d\":146,\"gl-line3d\":156,\"gl-mesh3d\":189,\"gl-scatter3d\":235}],1003:[function(t,e,r){\"use strict\";function n(t,e,r,n){var a=0,o=r(\"x\"),s=r(\"y\"),l=r(\"z\");return i.getComponentMethod(\"calendars\",\"handleTraceDefaults\")(t,e,[\"x\",\"y\",\"z\"],n),o&&s&&l&&((a=Math.min(o.length,s.length,l.length))<o.length&&(e.x=o.slice(0,a)),a<s.length&&(e.y=s.slice(0,a)),a<l.length&&(e.z=l.slice(0,a))),a}var i=t(\"../../registry\"),a=t(\"../../lib\"),o=t(\"../scatter/subtypes\"),s=t(\"../scatter/marker_defaults\"),l=t(\"../scatter/line_defaults\"),u=t(\"../scatter/text_defaults\"),c=t(\"../../components/errorbars/defaults\"),h=t(\"./attributes\");e.exports=function(t,e,r,i){function f(r,n){return a.coerce(t,e,h,r,n)}if(n(t,e,f,i)){f(\"text\"),f(\"hovertext\"),f(\"mode\"),o.hasLines(e)&&(f(\"connectgaps\"),l(t,e,r,i,f)),o.hasMarkers(e)&&s(t,e,r,i,f),o.hasText(e)&&u(t,e,i,f);var d=(e.line||{}).color,p=(e.marker||{}).color;f(\"surfaceaxis\")>=0&&f(\"surfacecolor\",d||p);for(var m=[\"x\",\"y\",\"z\"],g=0;g<3;++g){var v=\"projection.\"+m[g];f(v+\".show\")&&(f(v+\".opacity\"),f(v+\".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\":607,\"../../lib\":685,\"../../registry\":802,\"../scatter/line_defaults\":987,\"../scatter/marker_defaults\":992,\"../scatter/subtypes\":996,\"../scatter/text_defaults\":997,\"./attributes\":999}],1004:[function(t,e,r){\"use strict\";var n={};n.plot=t(\"./convert\"),n.attributes=t(\"./attributes\"),n.markerSymbols=t(\"../../constants/gl_markers\"),n.supplyDefaults=t(\"./defaults\"),n.colorbar=t(\"../scatter/colorbar\"),n.calc=t(\"./calc\"),n.moduleType=\"trace\",n.name=\"scatter3d\",n.basePlotModule=t(\"../../plots/gl3d\"),n.categories=[\"gl3d\",\"symbols\",\"markerColorscale\",\"showLegend\"],n.meta={},e.exports=n},{\"../../constants/gl_markers\":664,\"../../plots/gl3d\":767,\"../scatter/colorbar\":979,\"./attributes\":999,\"./calc\":1e3,\"./convert\":1002,\"./defaults\":1003}],1005:[function(t,e,r){\"use strict\";var n=t(\"../scatter/attributes\"),i=t(\"../../plots/attributes\"),a=t(\"../../components/colorscale/color_attributes\"),o=t(\"../../components/colorbar/attributes\"),s=t(\"../../lib/extend\").extendFlat,l=n.marker,u=n.line,c=l.line;e.exports={carpet:{valType:\"string\"},a:{valType:\"data_array\"},b:{valType:\"data_array\"},sum:{valType:\"number\",dflt:0,min:0},mode:s({},n.mode,{dflt:\"markers\"}),text:s({},n.text,{}),line:{color:u.color,width:u.width,dash:u.dash,shape:s({},u.shape,{values:[\"linear\",\"spline\"]}),smoothing:u.smoothing},connectgaps:n.connectgaps,fill:s({},n.fill,{values:[\"none\",\"toself\",\"tonext\"]}),fillcolor:n.fillcolor,marker:s({},{symbol:l.symbol,opacity:l.opacity,maxdisplayed:l.maxdisplayed,size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,line:s({},{width:c.width},a(\"marker\".line))},a(\"marker\"),{showscale:l.showscale,colorbar:o}),textfont:n.textfont,textposition:n.textposition,hoverinfo:s({},i.hoverinfo,{flags:[\"a\",\"b\",\"c\",\"text\",\"name\"]}),hoveron:n.hoveron}},{\"../../components/colorbar/attributes\":579,\"../../components/colorscale/color_attributes\":585,\"../../lib/extend\":677,\"../../plots/attributes\":722,\"../scatter/attributes\":976}],1006:[function(t,e,r){\"use strict\";var n=t(\"fast-isnumeric\"),i=t(\"../../plots/cartesian/axes\"),a=t(\"../../lib\"),o=t(\"../scatter/subtypes\"),s=t(\"../scatter/colorscale_calc\"),l=t(\"../carpet/lookup_carpetid\");e.exports=function(t,e){var r=e.carpetTrace=l(t,e);if(r&&r.visible&&\"legendonly\"!==r.visible){var u;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var c,h,f=e.a.length,d=new Array(f),p=!1;for(u=0;u<f;u++)if(c=e.a[u],h=e.b[u],n(c)&&n(h)){var m=r.ab2xy(+c,+h,!0),g=r.isVisible(+c,+h);g||(p=!0),d[u]={x:m[0],y:m[1],a:c,b:h,vis:g}}else d[u]={x:!1,y:!1};e._needsCull=p,d[0].carpet=r,d[0].trace=e;var v,y;if(o.hasMarkers(e)&&(v=e.marker,y=v.size,Array.isArray(y))){var b={type:\"linear\"};i.setConvert(b),(y=b.makeCalcdata(e.marker,\"size\")).length>f&&y.splice(f,y.length-f)}return s(e),void 0!==y&&a.mergeArray(y,d,\"ms\"),d}}},{\"../../lib\":685,\"../../plots/cartesian/axes\":724,\"../carpet/lookup_carpetid\":858,\"../scatter/colorscale_calc\":980,\"../scatter/subtypes\":996,\"fast-isnumeric\":116}],1007:[function(t,e,r){\"use strict\";var n=t(\"../../lib\"),i=t(\"../scatter/constants\"),a=t(\"../scatter/subtypes\"),o=t(\"../scatter/marker_defaults\"),s=t(\"../scatter/line_defaults\"),l=t(\"../scatter/line_shape_defaults\"),u=t(\"../scatter/text_defaults\"),c=t(\"../scatter/fillcolor_defaults\"),h=t(\"./attributes\");e.exports=function(t,e,r,f){function d(r,i){return n.coerce(t,e,h,r,i)}d(\"carpet\"),e.xaxis=\"x\",e.yaxis=\"y\";var p,m=d(\"a\"),g=d(\"b\");if(p=Math.min(m.length,g.length)){m&&p<m.length&&(e.a=m.slice(0,p)),g&&p<g.length&&(e.b=g.slice(0,p)),d(\"sum\"),d(\"text\"),d(\"mode\",p<i.PTS_LINESONLY?\"lines+markers\":\"lines\"),a.hasLines(e)&&(s(t,e,r,f,d),l(t,e,d),d(\"connectgaps\")),a.hasMarkers(e)&&o(t,e,r,f,d),a.hasText(e)&&u(t,e,f,d);var v=[];(a.hasMarkers(e)||a.hasText(e))&&(d(\"marker.maxdisplayed\"),v.push(\"points\")),d(\"fill\"),\"none\"!==e.fill&&(c(t,e,r,d),a.hasLines(e)||l(t,e,d)),d(\"hoverinfo\",1===f._dataLength?\"a+b+text\":void 0),\"tonext\"!==e.fill&&\"toself\"!==e.fill||v.push(\"fills\"),d(\"hoveron\",v.join(\"+\")||\"points\")}else e.visible=!1}},{\"../../lib\":685,\"../scatter/constants\":981,\"../scatter/fillcolor_defaults\":983,\"../scatter/line_defaults\":987,\"../scatter/line_shape_defaults\":989,\"../scatter/marker_defaults\":992,\"../scatter/subtypes\":996,\"../scatter/text_defaults\":997,\"./attributes\":1005}],1008:[function(t,e,r){\"use strict\";var n=t(\"../scatter/hover\");e.exports=function(t,e,r,i){function a(t,e){g.push((t.labelprefix&&t.labelprefix.length>0?t.labelprefix:t._hovertitle+\": \")+e.toFixed(3)+t.labelsuffix)}var o=n(t,e,r,i);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index){var l=1-s.y0/t.ya._length,u=t.xa._length,c=u*l/2,h=u-c;return s.x0=Math.max(Math.min(s.x0,h),c),s.x1=Math.max(Math.min(s.x1,h),c),o}var f=s.cd[s.index];s.a=f.a,s.b=f.b,s.xLabelVal=void 0,s.yLabelVal=void 0;var d=s.trace,p=d._carpet,m=d.hoverinfo.split(\"+\"),g=[];-1!==m.indexOf(\"all\")&&(m=[\"a\",\"b\"]),-1!==m.indexOf(\"a\")&&a(p.aaxis,f.a),-1!==m.indexOf(\"b\")&&a(p.baxis,f.b);var v=p.ab2ij([f.a,f.b]),y=Math.floor(v[0]),b=v[0]-y,x=Math.floor(v[1]),_=v[1]-x,w=p.evalxy([],y,x,b,_);return g.push(\"y: \"+w[1].toFixed(3)),s.extraText=g.join(\"<br>\"),o}}},{\"../scatter/hover\":985}],1009:[function(t,e,r){\"use strict\";var n={};n.attributes=t(\"./attributes\"),n.supplyDefaults=t(\"./defaults\"),n.colorbar=t(\"../scatter/colorbar\"),n.calc=t(\"./calc\"),n.plot=t(\"./plot\"),n.style=t(\"./style\"),n.hoverPoints=t(\"./hover\"),n.selectPoints=t(\"./select\"),n.moduleType=\"trace\",n.name=\"scattercarpet\",n.basePlotModule=t(\"../../plots/cartesian\"),n.categories=[\"carpet\",\"symbols\",\"markerColorscale\",\"showLegend\",\"carpetDependent\"],n.meta={},e.exports=n},{\"../../plots/cartesian\":734,\"../scatter/colorbar\":979,\"./attributes\":1005,\"./calc\":1006,\"./defaults\":1007,\"./hover\":1008,\"./plot\":1010,\"./select\":1011,\"./style\":1012}],1010:[function(t,e,r){\"use strict\";var n=t(\"../scatter/plot\"),i=t(\"../../plots/cartesian/axes\");e.exports=function(t,e,r){var a,o,s=r[0][0].carpet,l={xaxis:i.getFromId(t,s.xaxis||\"x\"),yaxis:i.getFromId(t,s.yaxis||\"y\"),plot:e.plot};for(n(l.graphDiv,l,r),a=0;a<r.length;a++)o=r[a][0].trace,l.plot.selectAll(\"g.trace\"+o.uid+\" .js-line\").attr(\"clip-path\",\"url(#clip\"+s.uid+\"carpet)\")}},{\"../../plots/cartesian/axes\":724,\"../scatter/plot\":993}],1011:[function(t,e,r){\"use strict\";var n=t(\"../scatter/select\");e.exports=function(t,e){var r=n(t,e);if(r){var i,a,o,s=t.cd;for(o=0;o<r.length;o++)a=s[(i=r[o]).pointNumber],i.a=a.a,i.b=a.b,i.c=a.c,delete i.x,delete i.y;return r}}},{\"../scatter/select\":994}],1012:[function(t,e,r){\"use strict\";var n=t(\"../scatter/style\");e.exports=function(t){for(var e=t._fullLayout._modules,r=0;r<e.length;r++)if(\"scatter\"===e[r].name)return;n(t)}},{\"../scatter/style\":995}],1013:[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=n.marker,u=n.line,c=l.line;e.exports={lon:{valType:\"data_array\"},lat:{valType:\"data_array\"},locations:{valType:\"data_array\"},locationmode:{valType:\"enumerated\",values:[\"ISO-3\",\"USA-states\",\"country names\"],dflt:\"ISO-3\"},mode: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:l.symbol,opacity:l.opacity,size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,showscale:l.showscale,colorbar:l.colorbar,line:s({},{width:c.width},a(\"marker.line\"))},a(\"marker\")),fill:{valType:\"enumerated\",values:[\"none\",\"toself\"],dflt:\"none\"},fillcolor:n.fillcolor,hoverinfo:s({},i.hoverinfo,{flags:[\"lon\",\"lat\",\"location\",\"text\",\"name\"]})}},{\"../../components/colorscale/color_attributes\":585,\"../../components/drawing/attributes\":601,\"../../lib/extend\":677,\"../../plots/attributes\":722,\"../scatter/attributes\":976}],1014:[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\");e.exports=function(t,e){for(var r=Array.isArray(e.locations),s=r?e.locations.length:e.lon.length,l=new Array(s),u=0;u<s;u++){var c=l[u]={};if(r){var h=e.locations[u];c.loc=\"string\"==typeof h?h:null}else{var f=e.lon[u],d=e.lat[u];n(f)&&n(d)?c.lonlat=[+f,+d]:c.lonlat=[i,i]}}return o(l,e),a(e),l}},{\"../../constants/numerical\":666,\"../scatter/arrays_to_calcdata\":975,\"../scatter/colorscale_calc\":980,\"fast-isnumeric\":116}],1015:[function(t,e,r){\"use strict\";function n(t,e,r){var n,i,a=0,o=r(\"locations\");return o?(r(\"locationmode\"),a=o.length):(n=r(\"lon\")||[],i=r(\"lat\")||[],(a=Math.min(n.length,i.length))<n.length&&(e.lon=n.slice(0,a)),a<i.length&&(e.lat=i.slice(0,a)),a)}var i=t(\"../../lib\"),a=t(\"../scatter/subtypes\"),o=t(\"../scatter/marker_defaults\"),s=t(\"../scatter/line_defaults\"),l=t(\"../scatter/text_defaults\"),u=t(\"../scatter/fillcolor_defaults\"),c=t(\"./attributes\");e.exports=function(t,e,r,h){function f(r,n){return i.coerce(t,e,c,r,n)}n(t,e,f)?(f(\"text\"),f(\"hovertext\"),f(\"mode\"),a.hasLines(e)&&(s(t,e,r,h,f),f(\"connectgaps\")),a.hasMarkers(e)&&o(t,e,r,h,f),a.hasText(e)&&l(t,e,h,f),f(\"fill\"),\"none\"!==e.fill&&u(t,e,r,f),f(\"hoverinfo\",1===h._dataLength?\"lon+lat+location+text\":void 0)):e.visible=!1}},{\"../../lib\":685,\"../scatter/fillcolor_defaults\":983,\"../scatter/line_defaults\":987,\"../scatter/marker_defaults\":992,\"../scatter/subtypes\":996,\"../scatter/text_defaults\":997,\"./attributes\":1013}],1016:[function(t,e,r){\"use strict\";e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.location=e.lon?e.lon:null,t}},{}],1017:[function(t,e,r){\"use strict\";function n(t,e,r){function n(t){return a.tickText(r,r.c2l(t),\"hover\").text+\"°\"}var i=t.hoverinfo,o=\"all\"===i?l.hoverinfo.flags:i.split(\"+\"),s=-1!==o.indexOf(\"location\")&&Array.isArray(t.locations),u=-1!==o.indexOf(\"lon\"),c=-1!==o.indexOf(\"lat\"),h=-1!==o.indexOf(\"text\"),f=[];if(s?f.push(e.loc):u&&c?f.push(\"(\"+n(e.lonlat[0])+\", \"+n(e.lonlat[1])+\")\"):u?f.push(\"lon: \"+n(e.lonlat[0])):c&&f.push(\"lat: \"+n(e.lonlat[1])),h){var d;e.htx?d=e.htx:t.hovertext?d=t.hovertext:e.tx?d=e.tx:t.text&&(d=t.text),Array.isArray(d)||f.push(d)}return f.join(\"<br>\")}var i=t(\"../../plots/cartesian/graph_interact\"),a=t(\"../../plots/cartesian/axes\"),o=t(\"../../constants/numerical\").BADNUM,s=t(\"../scatter/get_trace_color\"),l=t(\"./attributes\");e.exports=function(t){function e(t){return h.projection(t)}function r(t){var r=t.lonlat;if(r[0]===o)return 1/0;if(h.isLonLatOverEdges(r))return 1/0;var n=e(r),i=u.c2p(),a=c.c2p(),s=Math.abs(i-n[0]),l=Math.abs(a-n[1]),f=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(s*s+l*l)-f,1-3/f)}var a=t.cd,l=a[0].trace,u=t.xa,c=t.ya,h=t.subplot;if(i.getClosest(a,r,t),!1!==t.index){var f=a[t.index],d=f.lonlat,p=e(d),m=f.mrc||1;return t.x0=p[0]-m,t.x1=p[0]+m,t.y0=p[1]-m,t.y1=p[1]+m,t.loc=f.loc,t.lat=d[0],t.lon=d[1],t.color=s(l,f),t.extraText=n(l,f,h.mockAxis),[t]}}},{\"../../constants/numerical\":666,\"../../plots/cartesian/axes\":724,\"../../plots/cartesian/graph_interact\":733,\"../scatter/get_trace_color\":984,\"./attributes\":1013}],1018:[function(t,e,r){\"use strict\";var n={};n.attributes=t(\"./attributes\"),n.supplyDefaults=t(\"./defaults\"),n.colorbar=t(\"../scatter/colorbar\"),n.calc=t(\"./calc\"),n.plot=t(\"./plot\"),n.hoverPoints=t(\"./hover\"),n.eventData=t(\"./event_data\"),n.moduleType=\"trace\",n.name=\"scattergeo\",n.basePlotModule=t(\"../../plots/geo\"),n.categories=[\"geo\",\"symbols\",\"markerColorscale\",\"showLegend\"],n.meta={},e.exports=n},{\"../../plots/geo\":752,\"../scatter/colorbar\":979,\"./attributes\":1013,\"./calc\":1014,\"./defaults\":1015,\"./event_data\":1016,\"./hover\":1017,\"./plot\":1019}],1019:[function(t,e,r){\"use strict\";function n(t,e){var r=t[0].trace;if(Array.isArray(r.locations))for(var n=c(r,e),i=r.locationmode,a=0;a<t.length;a++){var o=t[a],s=h(i,o.loc,n);o.lonlat=s?s.properties.ct:[u,u]}}function i(t){var e=t.framework.selectAll(\"g.trace.scattergeo\");e.style(\"opacity\",function(t){return t[0].trace.opacity}),e.each(function(t){var e=t[0].trace,r=a.select(this);r.selectAll(\"path.point\").call(o.pointStyle,e),r.selectAll(\"text\").call(o.textPointStyle,e)}),e.selectAll(\"path.js-line\").style(\"fill\",\"none\").each(function(t){var e=a.select(this),r=t.trace,n=r.line||{};e.call(s.stroke,n.color).call(o.dashLine,n.dash||\"\",n.width||0),\"none\"!==r.fill&&e.call(s.fill,r.fillcolor)})}var a=t(\"d3\"),o=t(\"../../components/drawing\"),s=t(\"../../components/color\"),l=t(\"../../lib\"),u=t(\"../../constants/numerical\").BADNUM,c=t(\"../../lib/topojson_utils\").getTopojsonFeatures,h=t(\"../../lib/geo_location_utils\").locationToFeature,f=t(\"../../lib/geojson_utils\"),d=t(\"../scatter/subtypes\");e.exports=function(t,e){function r(t){return t[0].trace.uid}function o(t,e){t.lonlat[0]===u&&a.select(e).remove()}for(var s=0;s<e.length;s++)n(e[s],t.topojson);var c=t.framework.select(\".scattergeolayer\").selectAll(\"g.trace.scattergeo\").data(e,r);c.enter().append(\"g\").attr(\"class\",\"trace scattergeo\"),c.exit().remove(),c.selectAll(\"*\").remove(),c.each(function(t){var e=a.select(this),r=t[0].trace;if(d.hasLines(r)||\"none\"!==r.fill){var n=f.calcTraceToLineCoords(t),i=\"none\"!==r.fill?f.makePolygon(n,r):f.makeLine(n,r);e.selectAll(\"path.js-line\").data([i]).enter().append(\"path\").classed(\"js-line\",!0)}d.hasMarkers(r)&&e.selectAll(\"path.point\").data(l.identity).enter().append(\"path\").classed(\"point\",!0).each(function(t){o(t,this)}),d.hasText(r)&&e.selectAll(\"g\").data(l.identity).enter().append(\"g\").append(\"text\").each(function(t){o(t,this)})}),i(t)}},{\"../../components/color\":578,\"../../components/drawing\":602,\"../../constants/numerical\":666,\"../../lib\":685,\"../../lib/geo_location_utils\":680,\"../../lib/geojson_utils\":681,\"../../lib/topojson_utils\":706,\"../scatter/subtypes\":996,d3:107}],1020:[function(t,e,r){\"use strict\";var n=t(\"../scatter/attributes\"),i=t(\"../../components/colorscale/color_attributes\"),a=t(\"../../constants/gl2d_dashes\"),o=t(\"../../constants/gl_markers\"),s=t(\"../../lib/extend\").extendFlat,l=t(\"../../lib/extend\").extendDeep,u=n.line,c=n.marker,h=c.line;e.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:s({},n.text,{}),mode:{valType:\"flaglist\",flags:[\"lines\",\"markers\"],extras:[\"none\"]},line:{color:u.color,width:u.width,dash:{valType:\"enumerated\",values:Object.keys(a),dflt:\"solid\"}},marker:l({},i(\"marker\"),{symbol:{valType:\"enumerated\",values:Object.keys(o),dflt:\"circle\",arrayOk:!0},size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,opacity:c.opacity,showscale:c.showscale,colorbar:c.colorbar,line:l({},i(\"marker.line\"),{width:h.width})}),connectgaps:n.connectgaps,fill:s({},n.fill,{values:[\"none\",\"tozeroy\",\"tozerox\"]}),fillcolor:n.fillcolor,error_y:n.error_y,error_x:n.error_x}},{\"../../components/colorscale/color_attributes\":585,\"../../constants/gl2d_dashes\":662,\"../../constants/gl_markers\":664,\"../../lib/extend\":677,\"../scatter/attributes\":976}],1021:[function(t,e,r){\"use strict\";function n(t,e){this.scene=t,this.uid=e,this.type=\"scattergl\",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color=\"rgb(0, 0, 0)\",this.name=\"\",this.hoverinfo=\"all\",this.connectgaps=!0,this.index=null,this.idToIndex=[],this.bounds=[0,0,0,0],this.isVisible=!1,this.hasLines=!1,this.hasErrorX=!1,this.hasErrorY=!1,this.hasMarkers=!1,this.line=this.initObject(d,{positions:new Float64Array(0),color:[0,0,0,1],width:1,fill:[!1,!1,!1,!1],fillColor:[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],dashes:[1]},0),this.errorX=this.initObject(p,{positions:new Float64Array(0),errors:new Float64Array(0),lineWidth:1,capSize:0,color:[0,0,0,1]},1),this.errorY=this.initObject(p,{positions:new Float64Array(0),errors:new Float64Array(0),lineWidth:1,capSize:0,color:[0,0,0,1]},2);var r={positions:new Float64Array(0),sizes:[],colors:[],glyphs:[],borderWidths:[],borderColors:[],size:12,color:[0,0,0,1],borderSize:1,borderColor:[0,0,0,1]};this.scatter=this.initObject(h,r,3),this.fancyScatter=this.initObject(f,r,4)}function i(t,e,r){return Array.isArray(e)||(e=[e]),a(t,e,r)}function a(t,e,r){for(var n=new Array(r),i=e[0],a=0;a<r;++a)n[a]=t(a>=e.length?i:e[a]);return n}function o(t,e,r){return l(z(t,r),C(e,r),r)}function s(t,e,r,n){var i=w(t,e,n);return i=Array.isArray(i[0])?i:a(g.identity,[i],n),l(i,C(r,n),n)}function l(t,e,r){for(var n=new Array(4*r),i=0;i<r;++i){for(var a=0;a<3;++a)n[4*i+a]=t[i][a];n[4*i+3]=t[i][3]*e[i]}return n}function u(t){for(var e,r=t.length,n=Math.max(1,(r-1)/Math.min(Math.max(r,1),1e3)),i=0;i<r;i+=n)if(e=t[Math.floor(i)],!(m(e)||e instanceof Date))return!1;return!0}function c(t,e){var r=new n(t,e.uid);return r.update(e),r}var h=t(\"gl-scatter2d\"),f=t(\"gl-scatter2d-sdf\"),d=t(\"gl-line2d\"),p=t(\"gl-error2d\"),m=t(\"fast-isnumeric\"),g=t(\"../../lib\"),v=t(\"../../plots/cartesian/axes\"),y=t(\"../../plots/cartesian/axis_autotype\"),b=t(\"../../components/errorbars\"),x=t(\"../../lib/str2rgbarray\"),_=t(\"../../lib/typed_array_truncate\"),w=t(\"../../lib/gl_format_color\"),M=t(\"../scatter/subtypes\"),k=t(\"../scatter/make_bubble_size_func\"),A=t(\"../scatter/get_trace_color\"),T=t(\"../../constants/gl_markers\"),S=t(\"../../constants/gl2d_dashes\"),E=[\"xaxis\",\"yaxis\"],L=n.prototype;L.initObject=function(t,e,r){function n(){u||((u=t(s,e))._trace=o,u._index=r),u.update(e)}function i(){u&&u.update(l)}function a(){u&&u.dispose()}var o=this,s=o.scene.glplot,l=g.extendFlat({},e),u=null;return{options:e,update:n,clear:i,dispose:a}},L.handlePick=function(t){var e=t.pointId;(t.object!==this.line||this.connectgaps)&&(e=this.idToIndex[t.pointId]);var r=this.pickXData[e];return{trace:this,dataCoord:t.dataCoord,traceCoord:[m(r)||!g.isDateTime(r)?r:g.dateTime2ms(r),this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:Array.isArray(this.color)?this.color[e]:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},L.isFancy=function(t){if(\"linear\"!==this.scene.xaxis.type&&\"date\"!==this.scene.xaxis.type)return!0;if(\"linear\"!==this.scene.yaxis.type)return!0;if(!t.x||!t.y)return!0;if(this.hasMarkers){var e=t.marker||{};if(Array.isArray(e.symbol)||\"circle\"!==e.symbol||Array.isArray(e.size)||Array.isArray(e.color)||Array.isArray(e.line.width)||Array.isArray(e.line.color)||Array.isArray(e.opacity))return!0}return!(!this.hasLines||this.connectgaps)||(!!this.hasErrorX||!!this.hasErrorY)};var C=i.bind(null,function(t){return+t}),z=i.bind(null,x),D=i.bind(null,function(t){return T[t]||\"●\"});L.update=function(t){!0!==t.visible?(this.isVisible=!1,this.hasLines=!1,this.hasErrorX=!1,this.hasErrorY=!1,this.hasMarkers=!1):(this.isVisible=!0,this.hasLines=M.hasLines(t),this.hasErrorX=!0===t.error_x.visible,this.hasErrorY=!0===t.error_y.visible,this.hasMarkers=M.hasMarkers(t)),this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.connectgaps=!!t.connectgaps,this.isVisible?this.isFancy(t)?this.updateFancy(t):this.updateFast(t):(this.line.clear(),this.errorX.clear(),this.errorY.clear(),this.scatter.clear(),this.fancyScatter.clear()),this.scene.glplot.objects.sort(function(t,e){return t._index-e._index}),this.index=t.index,this.color=A(t,{})},L.updateFast=function(t){var e,r,n=this.xData=this.pickXData=t.x,i=this.yData=this.pickYData=t.y,a=n.length,o=new Array(a),s=new Float64Array(2*a),l=this.bounds,c=0,h=0,f=t.xcalendar,d=u(n),p=!d&&\"date\"===y(n,f);if(d||p)for(var v=0;v<a;++v)e=n[v],r=i[v],m(r)&&(d||(e=g.dateTime2ms(e,f)),o[c++]=v,s[h++]=e,s[h++]=r,l[0]=Math.min(l[0],e),l[1]=Math.min(l[1],r),l[2]=Math.max(l[2],e),l[3]=Math.max(l[3],r));s=_(s,h),this.idToIndex=o,this.updateLines(t,s),this.updateError(\"X\",t),this.updateError(\"Y\",t);var b;if(this.hasMarkers){this.scatter.options.positions=s;var w=x(t.marker.color),M=x(t.marker.line.color),k=t.opacity*t.marker.opacity;w[3]*=k,this.scatter.options.color=w,M[3]*=k,this.scatter.options.borderColor=M,b=t.marker.size,this.scatter.options.size=b,this.scatter.options.borderSize=t.marker.line.width,this.scatter.update()}else this.scatter.clear();this.fancyScatter.clear(),this.expandAxesFast(l,b)},L.updateFancy=function(t){var e=this.scene,r=e.xaxis,n=e.yaxis,a=this.bounds,o=this.pickXData=r.makeCalcdata(t,\"x\").slice(),l=this.pickYData=n.makeCalcdata(t,\"y\").slice();this.xData=o.slice(),this.yData=l.slice();var u,c,h,f,d,p,m,g,v=b.calcFromTrace(t,e.fullLayout),y=o.length,x=new Array(y),w=new Float64Array(2*y),M=new Float64Array(4*y),A=new Float64Array(4*y),T=0,S=0,E=0,L=0,z=\"log\"===r.type?r.d2l:function(t){return t},I=\"log\"===n.type?n.d2l:function(t){return t};for(u=0;u<y;++u)this.xData[u]=h=z(o[u]),this.yData[u]=f=I(l[u]),isNaN(h)||isNaN(f)||(x[T++]=u,w[S++]=h,w[S++]=f,d=M[E++]=h-v[u].xs||0,p=M[E++]=v[u].xh-h||0,M[E++]=0,M[E++]=0,A[L++]=0,A[L++]=0,m=A[L++]=f-v[u].ys||0,g=A[L++]=v[u].yh-f||0,a[0]=Math.min(a[0],h-d),a[1]=Math.min(a[1],f-m),a[2]=Math.max(a[2],h+p),a[3]=Math.max(a[3],f+g));w=_(w,S),this.idToIndex=x,this.updateLines(t,w),this.updateError(\"X\",t,w,M),this.updateError(\"Y\",t,w,A);var P;if(this.hasMarkers){this.scatter.options.positions=w,this.scatter.options.sizes=new Array(T),this.scatter.options.glyphs=new Array(T),this.scatter.options.borderWidths=new Array(T),this.scatter.options.colors=new Array(4*T),this.scatter.options.borderColors=new Array(4*T);var O,j=k(t),R=t.marker,F=R.opacity,N=t.opacity,B=s(R,F,N,y),U=D(R.symbol,y),V=C(R.line.width,y),H=s(R.line,F,N,y);for(P=i(j,R.size,y),u=0;u<T;++u)for(O=x[u],this.scatter.options.sizes[u]=4*P[O],this.scatter.options.glyphs[u]=U[O],this.scatter.options.borderWidths[u]=.5*V[O],c=0;c<4;++c)this.scatter.options.colors[4*u+c]=B[4*O+c],this.scatter.options.borderColors[4*u+c]=H[4*O+c];this.fancyScatter.update()}else this.fancyScatter.clear();this.scatter.clear(),this.expandAxesFancy(o,l,P)},L.updateLines=function(t,e){var r;if(this.hasLines){var n=e;if(!t.connectgaps){var i=0,a=this.xData,s=this.yData;for(n=new Float64Array(2*a.length),r=0;r<a.length;++r)n[i++]=a[r],n[i++]=s[r]}this.line.options.positions=n;var l=o(t.line.color,t.opacity,1),u=Math.round(.5*this.line.options.width),c=(S[t.line.dash]||[1]).slice();for(r=0;r<c.length;++r)c[r]*=u;switch(t.fill){case\"tozeroy\":this.line.options.fill=[!1,!0,!1,!1];break;case\"tozerox\":this.line.options.fill=[!0,!1,!1,!1];break;default:this.line.options.fill=[!1,!1,!1,!1]}var h=x(t.fillcolor);this.line.options.color=l,this.line.options.width=2*t.line.width,this.line.options.dashes=c,this.line.options.fillColor=[h,h,h,h],this.line.update()}else this.line.clear()},L.updateError=function(t,e,r,n){var i=this[\"error\"+t],a=e[\"error_\"+t.toLowerCase()];\"x\"===t.toLowerCase()&&a.copy_ystyle&&(a=e.error_y),this[\"hasError\"+t]?(i.options.positions=r,i.options.errors=n,i.options.capSize=a.width,i.options.lineWidth=a.thickness/2,i.options.color=o(a.color,1,1),i.update()):i.clear()},L.expandAxesFast=function(t,e){for(var r,n,i,a=e||10,o=0;o<2;o++)(n=(r=this.scene[E[o]])._min)||(n=[]),n.push({val:t[o],pad:a}),(i=r._max)||(i=[]),i.push({val:t[o+2],pad:a})},L.expandAxesFancy=function(t,e,r){var n=this.scene,i={padded:!0,ppad:r};v.expand(n.xaxis,t,i),v.expand(n.yaxis,e,i)},L.dispose=function(){this.line.dispose(),this.errorX.dispose(),this.errorY.dispose(),this.scatter.dispose(),this.fancyScatter.dispose()},e.exports=c},{\"../../components/errorbars\":608,\"../../constants/gl2d_dashes\":662,\"../../constants/gl_markers\":664,\"../../lib\":685,\"../../lib/gl_format_color\":682,\"../../lib/str2rgbarray\":703,\"../../lib/typed_array_truncate\":707,\"../../plots/cartesian/axes\":724,\"../../plots/cartesian/axis_autotype\":725,\"../scatter/get_trace_color\":984,\"../scatter/make_bubble_size_func\":991,\"../scatter/subtypes\":996,\"fast-isnumeric\":116,\"gl-error2d\":144,\"gl-line2d\":154,\"gl-scatter2d\":232,\"gl-scatter2d-sdf\":227}],1022:[function(t,e,r){\"use strict\";var n=t(\"../../lib\"),i=t(\"../scatter/constants\"),a=t(\"../scatter/subtypes\"),o=t(\"../scatter/xy_defaults\"),s=t(\"../scatter/marker_defaults\"),l=t(\"../scatter/line_defaults\"),u=t(\"../scatter/fillcolor_defaults\"),c=t(\"../../components/errorbars/defaults\"),h=t(\"./attributes\");e.exports=function(t,e,r,f){function d(r,i){return n.coerce(t,e,h,r,i)}var p=o(t,e,f,d);p?(d(\"text\"),d(\"mode\",p<i.PTS_LINESONLY?\"lines+markers\":\"lines\"),a.hasLines(e)&&(d(\"connectgaps\"),l(t,e,r,f,d)),a.hasMarkers(e)&&s(t,e,r,f,d),d(\"fill\"),\"none\"!==e.fill&&u(t,e,r,d),c(t,e,r,{axis:\"y\"}),c(t,e,r,{axis:\"x\",inherit:\"y\"})):e.visible=!1}},{\"../../components/errorbars/defaults\":607,\"../../lib\":685,\"../scatter/constants\":981,\"../scatter/fillcolor_defaults\":983,\"../scatter/line_defaults\":987,\"../scatter/marker_defaults\":992,\"../scatter/subtypes\":996,\"../scatter/xy_defaults\":998,\"./attributes\":1020}],1023:[function(t,e,r){\"use strict\";var n={};n.attributes=t(\"./attributes\"),n.supplyDefaults=t(\"./defaults\"),n.colorbar=t(\"../scatter/colorbar\"),n.calc=t(\"../scatter3d/calc\"),n.plot=t(\"./convert\"),n.moduleType=\"trace\",n.name=\"scattergl\",n.basePlotModule=t(\"../../plots/gl2d\"),n.categories=[\"gl2d\",\"symbols\",\"errorBarsOK\",\"markerColorscale\",\"showLegend\"],n.meta={},e.exports=n},{\"../../plots/gl2d\":764,\"../scatter/colorbar\":979,\"../scatter3d/calc\":1e3,\"./attributes\":1020,\"./convert\":1021,\"./defaults\":1022}],1024:[function(t,e,r){\"use strict\";var n=t(\"../scattergeo/attributes\"),i=t(\"../scatter/attributes\"),a=t(\"../../plots/mapbox/layout_attributes\"),o=t(\"../../plots/attributes\"),s=t(\"../../components/colorbar/attributes\"),l=t(\"../../lib/extend\").extendFlat,u=n.line,c=n.marker;e.exports={lon:n.lon,lat:n.lat,mode: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:l({},c.opacity,{arrayOk:!1}),size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,color:c.color,colorscale:c.colorscale,cauto:c.cauto,cmax:c.cmax,cmin:c.cmin,autocolorscale:c.autocolorscale,reversescale:c.reversescale,showscale:c.showscale,colorbar:s},fill:n.fill,fillcolor:i.fillcolor,textfont:a.layers.symbol.textfont,textposition:a.layers.symbol.textposition,hoverinfo:l({},o.hoverinfo,{flags:[\"lon\",\"lat\",\"text\",\"name\"]})}},{\"../../components/colorbar/attributes\":579,\"../../lib/extend\":677,\"../../plots/attributes\":722,\"../../plots/mapbox/layout_attributes\":783,\"../scatter/attributes\":976,\"../scattergeo/attributes\":1013}],1025:[function(t,e,r){\"use strict\";function n(){return{geojson:d.makeBlank(),layout:{visibility:\"none\"},paint:{}}}function i(t,e){function r(t,r,n,i){void 0===e[r][n]&&(e[r][n]=i),t[r]=e[r][n]}var n,i=t[0].trace,a=i.marker;p.hasColorscale(i,\"marker\")?n=p.makeColorScaleFunc(p.extractScale(a.colorscale,a.cmin,a.cmax)):Array.isArray(a.color)&&(n=h.identity);var o;g.isBubble(i)?o=m(i):Array.isArray(a.size)&&(o=h.identity);for(var s=[],l=0;l<t.length;l++){var u=t[l],f=u.lonlat;if(!c(f)){var d={};n&&r(d,y,n(u.mc),l),o&&r(d,b,o(u.ms),l),s.push({type:\"Feature\",geometry:{type:\"Point\",coordinates:f},properties:d})}}return{type:\"FeatureCollection\",features:s}}function a(t){for(var e=t[0].trace,r=(e.marker||{}).symbol,n=e.text,i=\"circle\"!==r?l(r):u,a=g.hasText(e)?l(n):u,o=[],s=0;s<t.length;s++){var h=t[s];c(h.lonlat)||o.push({type:\"Feature\",geometry:{type:\"Point\",coordinates:h.lonlat},properties:{symbol:i(h.mx),text:a(h.tx)}})}return{type:\"FeatureCollection\",features:o}}function o(t,e){var r,n=t.marker;if(Array.isArray(n.color)){for(var i=Object.keys(e[y]),a=[],o=0;o<i.length;o++){var s=i[o];a.push([e[y][s],s])}r={property:y,stops:a}}else r=n.color;return r}function s(t,e){var r,n=t.marker;if(Array.isArray(n.size)){for(var i=Object.keys(e[b]),a=[],o=0;o<i.length;o++){var s=i[o];a.push([e[b][s],+s])}a.sort(function(t,e){return t[0]-e[0]}),r={property:b,stops:a}}else r=n.size/2;return r}function l(t){return Array.isArray(t)?function(t){return t}:t?function(){return t}:u}function u(){return\"\"}function c(t){return t[0]===f}var h=t(\"../../lib\"),f=t(\"../../constants/numerical\").BADNUM,d=t(\"../../lib/geojson_utils\"),p=t(\"../../components/colorscale\"),m=t(\"../scatter/make_bubble_size_func\"),g=t(\"../scatter/subtypes\"),v=t(\"../../plots/mapbox/convert_text_opts\"),y=\"circle-color\",b=\"circle-radius\";e.exports=function(t){var e=t[0].trace,r=!0===e.visible,l=\"none\"!==e.fill,u=g.hasLines(e),c=g.hasMarkers(e),f=g.hasText(e),p=c&&\"circle\"===e.marker.symbol,m=c&&\"circle\"!==e.marker.symbol,x=n(),_=n(),w=n(),M=n(),k={fill:x,line:_,circle:w,symbol:M};if(!r)return k;var A;if((l||u)&&(A=d.calcTraceToLineCoords(t)),l&&(x.geojson=d.makePolygon(A),x.layout.visibility=\"visible\",h.extendFlat(x.paint,{\"fill-color\":e.fillcolor})),u&&(_.geojson=d.makeLine(A),_.layout.visibility=\"visible\",h.extendFlat(_.paint,{\"line-width\":e.line.width,\"line-color\":e.line.color,\"line-opacity\":e.opacity})),p){var T={};T[y]={},T[b]={},w.geojson=i(t,T),w.layout.visibility=\"visible\",h.extendFlat(w.paint,{\"circle-opacity\":e.opacity*e.marker.opacity,\"circle-color\":o(e,T),\"circle-radius\":s(e,T)})}if((m||f)&&(M.geojson=a(t),h.extendFlat(M.layout,{visibility:\"visible\",\"icon-image\":\"{symbol}-15\",\"text-field\":\"{text}\"}),m&&(h.extendFlat(M.layout,{\"icon-size\":e.marker.size/10}),h.extendFlat(M.paint,{\"icon-opacity\":e.opacity*e.marker.opacity,\"icon-color\":e.marker.color})),f)){var S=(e.marker||{}).size,E=v(e.textposition,S);h.extendFlat(M.layout,{\"text-size\":e.textfont.size,\"text-anchor\":E.anchor,\"text-offset\":E.offset}),h.extendFlat(M.paint,{\"text-color\":e.textfont.color,\"text-opacity\":e.opacity})}return k}},{\"../../components/colorscale\":592,\"../../constants/numerical\":666,\"../../lib\":685,\"../../lib/geojson_utils\":681,\"../../plots/mapbox/convert_text_opts\":780,\"../scatter/make_bubble_size_func\":991,\"../scatter/subtypes\":996}],1026:[function(t,e,r){\"use strict\";function n(t,e,r){var n=r(\"lon\")||[],i=r(\"lat\")||[],a=Math.min(n.length,i.length);return a<n.length&&(e.lon=n.slice(0,a)),a<i.length&&(e.lat=i.slice(0,a)),a}var i=t(\"../../lib\"),a=t(\"../scatter/subtypes\"),o=t(\"../scatter/marker_defaults\"),s=t(\"../scatter/line_defaults\"),l=t(\"../scatter/text_defaults\"),u=t(\"../scatter/fillcolor_defaults\"),c=t(\"./attributes\");e.exports=function(t,e,r,h){function f(r,n){return i.coerce(t,e,c,r,n)}if(n(t,e,f)){if(f(\"text\"),f(\"hovertext\"),f(\"mode\"),a.hasLines(e)&&(s(t,e,r,h,f,{noDash:!0}),f(\"connectgaps\")),a.hasMarkers(e)){o(t,e,r,h,f,{noLine:!0});var d=e.marker;d.line={width:0},\"circle\"!==d.symbol&&(Array.isArray(d.size)&&(d.size=d.size[0]),Array.isArray(d.color)&&(d.color=d.color[0]))}a.hasText(e)&&l(t,e,h,f),f(\"fill\"),\"none\"!==e.fill&&u(t,e,r,f),f(\"hoverinfo\",1===h._dataLength?\"lon+lat+text\":void 0)}else e.visible=!1}},{\"../../lib\":685,\"../scatter/fillcolor_defaults\":983,\"../scatter/line_defaults\":987,\"../scatter/marker_defaults\":992,\"../scatter/subtypes\":996,\"../scatter/text_defaults\":997,\"./attributes\":1024}],1027:[function(t,e,r){\"use strict\";e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t}},{}],1028:[function(t,e,r){\"use strict\";function n(t,e){function r(t){return t+\"°\"}var n=t.hoverinfo.split(\"+\"),i=-1!==n.indexOf(\"all\"),a=-1!==n.indexOf(\"lon\"),o=-1!==n.indexOf(\"lat\"),s=e.lonlat,l=[];if(i||a&&o?l.push(\"(\"+r(s[0])+\", \"+r(s[1])+\")\"):a?l.push(\"lon: \"+r(s[0])):o&&l.push(\"lat: \"+r(s[1])),i||-1!==n.indexOf(\"text\")){var u;e.htx?u=e.htx:t.hovertext?u=t.hovertext:e.tx?u=e.tx:t.text&&(u=t.text),Array.isArray(u)||l.push(u)}return l.join(\"<br>\")}var i=t(\"../../plots/cartesian/graph_interact\"),a=t(\"../scatter/get_trace_color\"),o=t(\"../../constants/numerical\").BADNUM;e.exports=function(t,e,r){function s(t){var e=t.lonlat;if(e[0]===o)return 1/0;var n=Math.abs(c.c2p(e)-c.c2p([d,e[1]])),i=Math.abs(h.c2p(e)-h.c2p([e[0],r])),a=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(n*n+i*i)-a,1-3/a)}var l=t.cd,u=l[0].trace,c=t.xa,h=t.ya,f=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),d=e-f;if(i.getClosest(l,s,t),!1!==t.index){var p=l[t.index],m=p.lonlat,g=[m[0]+f,m[1]],v=c.c2p(g),y=h.c2p(g),b=p.mrc||1;return t.x0=v-b,t.x1=v+b,t.y0=y-b,t.y1=y+b,t.color=a(u,p),t.extraText=n(u,p),[t]}}},{\"../../constants/numerical\":666,\"../../plots/cartesian/graph_interact\":733,\"../scatter/get_trace_color\":984}],1029:[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.hoverPoints=t(\"./hover\"),n.eventData=t(\"./event_data\"),n.plot=t(\"./plot\"),n.moduleType=\"trace\",n.name=\"scattermapbox\",n.basePlotModule=t(\"../../plots/mapbox\"),n.categories=[\"mapbox\",\"gl\",\"symbols\",\"markerColorscale\",\"showLegend\"],n.meta={},e.exports=n},{\"../../plots/mapbox\":781,\"../scatter/colorbar\":979,\"../scattergeo/calc\":1014,\"./attributes\":1024,\"./defaults\":1026,\"./event_data\":1027,\"./hover\":1028,\"./plot\":1030}],1030:[function(t,e,r){\"use strict\";function n(t,e){this.mapbox=t,this.map=t.map,this.uid=e,this.idSourceFill=e+\"-source-fill\",this.idSourceLine=e+\"-source-line\",this.idSourceCircle=e+\"-source-circle\",this.idSourceSymbol=e+\"-source-symbol\",this.idLayerFill=e+\"-layer-fill\",this.idLayerLine=e+\"-layer-line\",this.idLayerCircle=e+\"-layer-circle\",this.idLayerSymbol=e+\"-layer-symbol\",this.mapbox.initSource(this.idSourceFill),this.mapbox.initSource(this.idSourceLine),this.mapbox.initSource(this.idSourceCircle),this.mapbox.initSource(this.idSourceSymbol),this.map.addLayer({id:this.idLayerFill,source:this.idSourceFill,type:\"fill\"}),this.map.addLayer({id:this.idLayerLine,source:this.idSourceLine,type:\"line\"}),this.map.addLayer({id:this.idLayerCircle,source:this.idSourceCircle,type:\"circle\"}),this.map.addLayer({id:this.idLayerSymbol,source:this.idSourceSymbol,type:\"symbol\"})}function i(t){return\"visible\"===t.layout.visibility}var a=t(\"./convert\"),o=n.prototype;o.update=function(t){var e=this.mapbox,r=a(t);e.setOptions(this.idLayerFill,\"setLayoutProperty\",r.fill.layout),e.setOptions(this.idLayerLine,\"setLayoutProperty\",r.line.layout),e.setOptions(this.idLayerCircle,\"setLayoutProperty\",r.circle.layout),e.setOptions(this.idLayerSymbol,\"setLayoutProperty\",r.symbol.layout),i(r.fill)&&(e.setSourceData(this.idSourceFill,r.fill.geojson),e.setOptions(this.idLayerFill,\"setPaintProperty\",r.fill.paint)),i(r.line)&&(e.setSourceData(this.idSourceLine,r.line.geojson),e.setOptions(this.idLayerLine,\"setPaintProperty\",r.line.paint)),i(r.circle)&&(e.setSourceData(this.idSourceCircle,r.circle.geojson),e.setOptions(this.idLayerCircle,\"setPaintProperty\",r.circle.paint)),i(r.symbol)&&(e.setSourceData(this.idSourceSymbol,r.symbol.geojson),e.setOptions(this.idLayerSymbol,\"setPaintProperty\",r.symbol.paint))},o.dispose=function(){var t=this.map;t.removeLayer(this.idLayerFill),t.removeLayer(this.idLayerLine),t.removeLayer(this.idLayerCircle),t.removeLayer(this.idLayerSymbol),t.removeSource(this.idSourceFill),t.removeSource(this.idSourceLine),t.removeSource(this.idSourceCircle),t.removeSource(this.idSourceSymbol)},e.exports=function(t,e){var r=new n(t,e[0].trace.uid);return r.update(e),r}},{\"./convert\":1025}],1031:[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,u=n.marker,c=n.line,h=u.line;e.exports={a:{valType:\"data_array\"},b:{valType:\"data_array\"},c:{valType:\"data_array\"},sum:{valType:\"number\",dflt:0,min:0},mode:l({},n.mode,{dflt:\"markers\"}),text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),line:{color:c.color,width:c.width,dash:s,shape:l({},c.shape,{values:[\"linear\",\"spline\"]}),smoothing:c.smoothing},connectgaps:n.connectgaps,fill:l({},n.fill,{values:[\"none\",\"toself\",\"tonext\"]}),fillcolor:n.fillcolor,marker:l({},{symbol:u.symbol,opacity:u.opacity,maxdisplayed:u.maxdisplayed,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:l({},{width:h.width},a(\"marker\".line))},a(\"marker\"),{showscale:u.showscale,colorbar:o}),textfont:n.textfont,textposition:n.textposition,hoverinfo:l({},i.hoverinfo,{flags:[\"a\",\"b\",\"c\",\"text\",\"name\"]}),hoveron:n.hoveron}},{\"../../components/colorbar/attributes\":579,\"../../components/colorscale/color_attributes\":585,\"../../components/drawing/attributes\":601,\"../../lib/extend\":677,\"../../plots/attributes\":722,\"../scatter/attributes\":976}],1032:[function(t,e,r){\"use strict\";var n=t(\"fast-isnumeric\"),i=t(\"../../plots/cartesian/axes\"),a=t(\"../scatter/subtypes\"),o=t(\"../scatter/colorscale_calc\"),s=t(\"../scatter/arrays_to_calcdata\"),l=[\"a\",\"b\",\"c\"],u={a:[\"b\",\"c\"],b:[\"a\",\"c\"],c:[\"a\",\"b\"]};e.exports=function(t,e){var r,c,h,f,d,p,m=t._fullLayout[e.subplot].sum,g=e.sum||m;for(r=0;r<l.length;r++)if(h=l[r],!e[h]){for(d=e[u[h][0]],p=e[u[h][1]],f=new Array(d.length),c=0;c<d.length;c++)f[c]=g-d[c]-p[c];e[h]=f}var v,y,b,x,_,w,M=e.a.length,k=new Array(M);for(r=0;r<M;r++)v=e.a[r],y=e.b[r],b=e.c[r],n(v)&&n(y)&&n(b)?(1!==(x=m/((v=+v)+(y=+y)+(b=+b)))&&(v*=x,y*=x,b*=x),w=v,_=b-y,k[r]={x:_,y:w,a:v,b:y,c:b}):k[r]={x:!1,y:!1};var A,T;if(a.hasMarkers(e)&&(A=e.marker,T=A.size,Array.isArray(T))){var S={type:\"linear\"};i.setConvert(S),(T=S.makeCalcdata(e.marker,\"size\")).length>M&&T.splice(M,T.length-M)}return o(e),s(k,e),k}},{\"../../plots/cartesian/axes\":724,\"../scatter/arrays_to_calcdata\":975,\"../scatter/colorscale_calc\":980,\"../scatter/subtypes\":996,\"fast-isnumeric\":116}],1033:[function(t,e,r){\"use strict\";var n=t(\"../../lib\"),i=t(\"../scatter/constants\"),a=t(\"../scatter/subtypes\"),o=t(\"../scatter/marker_defaults\"),s=t(\"../scatter/line_defaults\"),l=t(\"../scatter/line_shape_defaults\"),u=t(\"../scatter/text_defaults\"),c=t(\"../scatter/fillcolor_defaults\"),h=t(\"./attributes\");e.exports=function(t,e,r,f){function d(r,i){return n.coerce(t,e,h,r,i)}var p,m=d(\"a\"),g=d(\"b\"),v=d(\"c\");if(m?(p=m.length,g?(p=Math.min(p,g.length),v&&(p=Math.min(p,v.length))):p=v?Math.min(p,v.length):0):g&&v&&(p=Math.min(g.length,v.length)),p){m&&p<m.length&&(e.a=m.slice(0,p)),g&&p<g.length&&(e.b=g.slice(0,p)),v&&p<v.length&&(e.c=v.slice(0,p)),d(\"sum\"),d(\"text\"),d(\"hovertext\"),d(\"mode\",p<i.PTS_LINESONLY?\"lines+markers\":\"lines\"),a.hasLines(e)&&(s(t,e,r,f,d),l(t,e,d),d(\"connectgaps\")),a.hasMarkers(e)&&o(t,e,r,f,d),a.hasText(e)&&u(t,e,f,d);var y=[];(a.hasMarkers(e)||a.hasText(e))&&(d(\"marker.maxdisplayed\"),y.push(\"points\")),d(\"fill\"),\"none\"!==e.fill&&(c(t,e,r,d),a.hasLines(e)||l(t,e,d)),d(\"hoverinfo\",1===f._dataLength?\"a+b+c+text\":void 0),\"tonext\"!==e.fill&&\"toself\"!==e.fill||y.push(\"fills\"),d(\"hoveron\",y.join(\"+\")||\"points\")}else e.visible=!1}},{\"../../lib\":685,\"../scatter/constants\":981,\"../scatter/fillcolor_defaults\":983,\"../scatter/line_defaults\":987,\"../scatter/line_shape_defaults\":989,\"../scatter/marker_defaults\":992,\"../scatter/subtypes\":996,\"../scatter/text_defaults\":997,\"./attributes\":1031}],1034:[function(t,e,r){\"use strict\";var n=t(\"../scatter/hover\"),i=t(\"../../plots/cartesian/axes\");e.exports=function(t,e,r,a){function o(t,e){v.push(t._hovertitle+\": \"+i.tickText(t,e,\"hover\").text)}var s=n(t,e,r,a);if(s&&!1!==s[0].index){var l=s[0];if(void 0===l.index){var u=1-l.y0/t.ya._length,c=t.xa._length,h=c*u/2,f=c-h;return l.x0=Math.max(Math.min(l.x0,f),h),l.x1=Math.max(Math.min(l.x1,f),h),s}var d=l.cd[l.index];l.a=d.a,l.b=d.b,l.c=d.c,l.xLabelVal=void 0,l.yLabelVal=void 0;var p=l.trace,m=p._ternary,g=p.hoverinfo.split(\"+\"),v=[];return-1!==g.indexOf(\"all\")&&(g=[\"a\",\"b\",\"c\"]),-1!==g.indexOf(\"a\")&&o(m.aaxis,d.a),-1!==g.indexOf(\"b\")&&o(m.baxis,d.b),-1!==g.indexOf(\"c\")&&o(m.caxis,d.c),l.extraText=v.join(\"<br>\"),s}}},{\"../../plots/cartesian/axes\":724,\"../scatter/hover\":985}],1035:[function(t,e,r){\"use strict\";var n={};n.attributes=t(\"./attributes\"),n.supplyDefaults=t(\"./defaults\"),n.colorbar=t(\"../scatter/colorbar\"),n.calc=t(\"./calc\"),n.plot=t(\"./plot\"),n.style=t(\"./style\"),n.hoverPoints=t(\"./hover\"),n.selectPoints=t(\"./select\"),n.moduleType=\"trace\",n.name=\"scatterternary\",n.basePlotModule=t(\"../../plots/ternary\"),n.categories=[\"ternary\",\"symbols\",\"markerColorscale\",\"showLegend\"],n.meta={},e.exports=n},{\"../../plots/ternary\":795,\"../scatter/colorbar\":979,\"./attributes\":1031,\"./calc\":1032,\"./defaults\":1033,\"./hover\":1034,\"./plot\":1036,\"./select\":1037,\"./style\":1038}],1036:[function(t,e,r){\"use strict\";var n=t(\"../scatter/plot\");e.exports=function(t,e){var r=t.plotContainer;r.select(\".scatterlayer\").selectAll(\"*\").remove();for(var i={xaxis:t.xaxis,yaxis:t.yaxis,plot:r},a=0;a<e.length;a++)e[a][0].trace._ternary=t;n(t.graphDiv,i,e)}},{\"../scatter/plot\":993}],1037:[function(t,e,r){arguments[4][1011][0].apply(r,arguments)},{\"../scatter/select\":994,dup:1011}],1038:[function(t,e,r){arguments[4][1012][0].apply(r,arguments)},{\"../scatter/style\":995,dup:1012}],1039:[function(t,e,r){\"use strict\";function n(t){return{valType:\"boolean\",dflt:!1}}function i(t){return{show:{valType:\"boolean\",dflt:!1},project:{x:n(\"x\"),y:n(\"y\"),z:n(\"z\")},color:{valType:\"color\",dflt:a.defaultLine},usecolormap:{valType:\"boolean\",dflt:!1},width:{valType:\"number\",min:1,max:16,dflt:2},highlight:{valType:\"boolean\",dflt:!0},highlightcolor:{valType:\"color\",dflt:a.defaultLine},highlightwidth:{valType:\"number\",min:1,max:16,dflt:2}}}var a=t(\"../../components/color\"),o=t(\"../../components/colorscale/attributes\"),s=t(\"../../components/colorbar/attributes\"),l=t(\"../../lib/extend\").extendFlat;e.exports={z:{valType:\"data_array\"},x:{valType:\"data_array\"},y:{valType:\"data_array\"},text:{valType:\"data_array\"},surfacecolor:{valType:\"data_array\"},cauto:o.zauto,cmin:o.zmin,cmax:o.zmax,colorscale:o.colorscale,autocolorscale:l({},o.autocolorscale,{dflt:!1}),reversescale:o.reversescale,showscale:o.showscale,colorbar:s,contours:{x:i(\"x\"),y:i(\"y\"),z:i(\"z\")},hidesurface:{valType:\"boolean\",dflt:!1},lightposition:{x:{valType:\"number\",min:-1e5,max:1e5,dflt:10},y:{valType:\"number\",min:-1e5,max:1e5,dflt:1e4},z:{valType:\"number\",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:\"number\",min:0,max:1,dflt:.8},diffuse:{valType:\"number\",min:0,max:1,dflt:.8},specular:{valType:\"number\",min:0,max:2,dflt:.05},roughness:{valType:\"number\",min:0,max:1,dflt:.5},fresnel:{valType:\"number\",min:0,max:5,dflt:.2}},opacity:{valType:\"number\",min:0,max:1,dflt:1},_deprecated:{zauto:l({},o.zauto,{}),zmin:l({},o.zmin,{}),zmax:l({},o.zmax,{})}}},{\"../../components/color\":578,\"../../components/colorbar/attributes\":579,\"../../components/colorscale/attributes\":583,\"../../lib/extend\":677}],1040:[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\":584}],1041:[function(t,e,r){\"use strict\";var n=t(\"fast-isnumeric\"),i=t(\"../../lib\"),a=t(\"../../plots/plots\"),o=t(\"../../components/colorscale\"),s=t(\"../../components/colorbar/draw\");e.exports=function(t,e){var r=e[0].trace,l=\"cb\"+r.uid,u=r.cmin,c=r.cmax,h=r.surfacecolor||r.z;if(n(u)||(u=i.aggNums(Math.min,null,h)),n(c)||(c=i.aggNums(Math.max,null,h)),t._fullLayout._infolayer.selectAll(\".\"+l).remove(),r.showscale){var f=e[0].t.cb=s(t,l),d=o.makeColorScaleFunc(o.extractScale(r.colorscale,u,c),{noNumericCheck:!0});f.fillcolor(d).filllevels({start:u,end:c,size:(c-u)/254}).options(r.colorbar)()}else a.autoMargin(t,l)}},{\"../../components/colorbar/draw\":581,\"../../components/colorscale\":592,\"../../lib\":685,\"../../plots/plots\":787,\"fast-isnumeric\":116}],1042:[function(t,e,r){\"use strict\";function n(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.dataScale=1}function i(t,e){return void 0===e&&(e=1),t.map(function(t){var r=t[0],n=p(t[1]).toRgb();return{index:r,rgb:[n.r,n.g,n.b,e]}})}function a(t){var e=t[0].rgb,r=t[t.length-1].rgb;return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]}function o(t){var e=t.shape,r=[e[0]+2,e[1]+2],n=c(new Float32Array(r[0]*r[1]),r);return d.assign(n.lo(1,1).hi(e[0],e[1]),t),d.assign(n.lo(1).hi(e[0],1),t.hi(e[0],1)),d.assign(n.lo(1,r[1]-1).hi(e[0],1),t.lo(0,e[1]-1).hi(e[0],1)),d.assign(n.lo(0,1).hi(1,e[1]),t.hi(1)),d.assign(n.lo(r[0]-1,1).hi(1,e[1]),t.lo(e[0]-1)),n.set(0,0,t.get(0,0)),n.set(0,r[1]-1,t.get(0,e[1]-1)),n.set(r[0]-1,0,t.get(e[0]-1,0)),n.set(r[0]-1,r[1]-1,t.get(e[0]-1,e[1]-1)),n}function s(t){var e=Math.max(t[0].shape[0],t[0].shape[1]);if(e<g){for(var r=g/e,n=[0|Math.floor(t[0].shape[0]*r+1),0|Math.floor(t[0].shape[1]*r+1)],i=n[0]*n[1],a=0;a<t.length;++a){var s=o(t[a]),l=c(new Float32Array(i),n);h(l,s,[r,0,0,0,r,0,0,0,1]),t[a]=l}return r}return 1}function l(t,e){var r=t.glplot.gl,i=u({gl:r}),a=new n(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}var u=t(\"gl-surface3d\"),c=t(\"ndarray\"),h=t(\"ndarray-homography\"),f=t(\"ndarray-fill\"),d=t(\"ndarray-ops\"),p=t(\"tinycolor2\"),m=t(\"../../lib/str2rgbarray\"),g=128,v=n.prototype;v.handlePick=function(t){if(t.object===this.surface){var e=[Math.min(0|Math.round(t.data.index[0]/this.dataScale-1),this.data.z[0].length-1),Math.min(0|Math.round(t.data.index[1]/this.dataScale-1),this.data.z.length-1)],r=[0,0,0];Array.isArray(this.data.x[0])?r[0]=this.data.x[e[1]][e[0]]:r[0]=this.data.x[e[0]],Array.isArray(this.data.y[0])?r[1]=this.data.y[e[1]][e[0]]:r[1]=this.data.y[e[1]],r[2]=this.data.z[e[1]][e[0]],t.traceCoordinate=r;var n=this.scene.fullSceneLayout;t.dataCoordinate=[n.xaxis.d2l(r[0],0,this.data.xcalendar)*this.scene.dataScale[0],n.yaxis.d2l(r[1],0,this.data.ycalendar)*this.scene.dataScale[1],n.zaxis.d2l(r[2],0,this.data.zcalendar)*this.scene.dataScale[2]];var i=this.data.text;return i&&i[e[1]]&&void 0!==i[e[1]][e[0]]?t.textLabel=i[e[1]][e[0]]:t.textLabel=\"\",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}},v.setContourLevels=function(){for(var t=[[],[],[]],e=!1,r=0;r<3;++r)this.showContour[r]&&(e=!0,t[r]=this.scene.contourLevels[r]);e&&this.surface.update({levels:t})},v.update=function(t){var e,r=this.scene,n=r.fullSceneLayout,o=this.surface,l=t.opacity,u=i(t.colorscale,l),h=t.z,d=t.x,p=t.y,g=n.xaxis,v=n.yaxis,y=n.zaxis,b=r.dataScale,x=h[0].length,_=h.length,w=[c(new Float32Array(x*_),[x,_]),c(new Float32Array(x*_),[x,_]),c(new Float32Array(x*_),[x,_])],M=w[0],k=w[1],A=r.contourLevels;this.data=t;var T=t.xcalendar,S=t.ycalendar,E=t.zcalendar;f(w[2],function(t,e){return y.d2l(h[e][t],0,E)*b[2]}),Array.isArray(d[0])?f(M,function(t,e){return g.d2l(d[e][t],0,T)*b[0]}):f(M,function(t){return g.d2l(d[t],0,T)*b[0]}),Array.isArray(p[0])?f(k,function(t,e){return v.d2l(p[e][t],0,S)*b[1]}):f(k,function(t,e){return v.d2l(p[e],0,S)*b[1]});var L={colormap:u,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!t.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacity:t.opacity};if(L.intensityBounds=[t.cmin,t.cmax],t.surfacecolor){var C=c(new Float32Array(x*_),[x,_]);f(C,function(e,r){return t.surfacecolor[r][e]}),w.push(C)}else L.intensityBounds[0]*=b[2],L.intensityBounds[1]*=b[2];this.dataScale=s(w),t.surfacecolor&&(L.intensity=w.pop());var z=[!0,!0,!0],D=[\"x\",\"y\",\"z\"];for(e=0;e<3;++e){var I=t.contours[D[e]];z[e]=I.highlight,L.showContour[e]=I.show||I.highlight,L.showContour[e]&&(L.contourProject[e]=[I.project.x,I.project.y,I.project.z],I.show?(this.showContour[e]=!0,L.levels[e]=A[e],o.highlightColor[e]=L.contourColor[e]=m(I.color),I.usecolormap?o.highlightTint[e]=L.contourTint[e]=0:o.highlightTint[e]=L.contourTint[e]=1,L.contourWidth[e]=I.width):this.showContour[e]=!1,I.highlight&&(L.dynamicColor[e]=m(I.highlightcolor),L.dynamicWidth[e]=I.highlightwidth))}a(u)&&(L.vertexColor=!0),L.coords=w,o.update(L),o.visible=t.visible,o.enableDynamic=z,o.snapToData=!0,\"lighting\"in t&&(o.ambientLight=t.lighting.ambient,o.diffuseLight=t.lighting.diffuse,o.specularLight=t.lighting.specular,o.roughness=t.lighting.roughness,o.fresnel=t.lighting.fresnel),\"lightposition\"in t&&(o.lightPosition=[t.lightposition.x,t.lightposition.y,t.lightposition.z]),l&&l<1&&(o.supportsTransparency=!0)},v.dispose=function(){this.scene.glplot.remove(this.surface),this.surface.dispose()},e.exports=l},{\"../../lib/str2rgbarray\":703,\"gl-surface3d\":250,ndarray:449,\"ndarray-fill\":439,\"ndarray-homography\":441,\"ndarray-ops\":443,tinycolor2:514}],1043:[function(t,e,r){\"use strict\";function n(t,e,r){e in t&&!(r in t)&&(t[r]=t[e])}var i=t(\"../../registry\"),a=t(\"../../lib\"),o=t(\"../../components/colorscale/defaults\"),s=t(\"./attributes\");e.exports=function(t,e,r,l){function u(r,n){return a.coerce(t,e,s,r,n)}var c,h,f=u(\"z\");if(f){var d=f[0].length,p=f.length;if(u(\"x\"),u(\"y\"),i.getComponentMethod(\"calendars\",\"handleTraceDefaults\")(t,e,[\"x\",\"y\",\"z\"],l),!Array.isArray(e.x))for(e.x=[],c=0;c<d;++c)e.x[c]=c;if(u(\"text\"),!Array.isArray(e.y))for(e.y=[],c=0;c<p;++c)e.y[c]=c;[\"lighting.ambient\",\"lighting.diffuse\",\"lighting.specular\",\"lighting.roughness\",\"lighting.fresnel\",\"lightposition.x\",\"lightposition.y\",\"lightposition.z\",\"hidesurface\",\"opacity\"].forEach(function(t){u(t)});var m=u(\"surfacecolor\");u(\"colorscale\");var g=[\"x\",\"y\",\"z\"];for(c=0;c<3;++c){var v=\"contours.\"+g[c],y=u(v+\".show\"),b=u(v+\".highlight\");if(y||b)for(h=0;h<3;++h)u(v+\".project.\"+g[h]);y&&(u(v+\".color\"),u(v+\".width\"),u(v+\".usecolormap\")),b&&(u(v+\".highlightcolor\"),u(v+\".highlightwidth\"))}m||(n(t,\"zmin\",\"cmin\"),n(t,\"zmax\",\"cmax\"),n(t,\"zauto\",\"cauto\")),o(t,e,l,u,{prefix:\"\",cLetter:\"c\"})}else e.visible=!1}},{\"../../components/colorscale/defaults\":587,\"../../lib\":685,\"../../registry\":802,\"./attributes\":1039}],1044:[function(t,e,r){\"use strict\";var n={};n.attributes=t(\"./attributes\"),n.supplyDefaults=t(\"./defaults\"),n.colorbar=t(\"./colorbar\"),n.calc=t(\"./calc\"),n.plot=t(\"./convert\"),n.moduleType=\"trace\",n.name=\"surface\",n.basePlotModule=t(\"../../plots/gl3d\"),n.categories=[\"gl3d\",\"noOpacity\"],n.meta={},e.exports=n},{\"../../plots/gl3d\":767,\"./attributes\":1039,\"./calc\":1040,\"./colorbar\":1041,\"./convert\":1042,\"./defaults\":1043}],1045:[function(t,e,r){\"use strict\";function n(t,e){if(\"string\"==typeof e&&e){var r=o.nestedProperty(t,e).get();return Array.isArray(r)?r:[]}return!!Array.isArray(e)&&e.slice()}function i(t,e,r){var n;if(Array.isArray(r)){if(n={type:c(r),_categories:[]},h(n),\"category\"===n.type)for(var i=0;i<r.length;i++)n.d2c(r[i])}else n=u.getFromTrace(t,e,r);return n?n.d2c:\"ids\"===r?function(t){return String(t)}:function(t){return+t}}function a(t,e,r){function n(t){return-1!==t.indexOf(a)}var i,a=t.operation,o=t.value,s=Array.isArray(o),l=function(r){return e(r,0,t.valuecalendar)},u=function(t){return e(t,0,r)};switch(n(f)?i=l(s?o[0]:o):n(d)?i=s?[l(o[0]),l(o[1])]:[l(o),l(o)]:n(p)&&(i=s?o.map(l):[l(o)]),a){case\"=\":return function(t){return u(t)===i};case\"<\":return function(t){return u(t)<i};case\"<=\":return function(t){return u(t)<=i};case\">\":return function(t){return u(t)>i};case\">=\":return function(t){return u(t)>=i};case\"[]\":return function(t){var e=u(t);return e>=i[0]&&e<=i[1]};case\"()\":return function(t){var e=u(t);return e>i[0]&&e<i[1]};case\"[)\":return function(t){var e=u(t);return e>=i[0]&&e<i[1]};case\"(]\":return function(t){var e=u(t);return e>i[0]&&e<=i[1]};case\"][\":return function(t){var e=u(t);return e<=i[0]||e>=i[1]};case\")(\":return function(t){var e=u(t);return e<i[0]||e>i[1]};case\"](\":return function(t){var e=u(t);return e<=i[0]||e>i[1]};case\")[\":return function(t){var e=u(t);return e<i[0]||e>=i[1]};case\"{}\":return function(t){return-1!==i.indexOf(u(t))};case\"}{\":return function(t){return-1===i.indexOf(u(t))}}}var o=t(\"../lib\"),s=t(\"../registry\"),l=t(\"../plot_api/plot_schema\"),u=t(\"../plots/cartesian/axis_ids\"),c=t(\"../plots/cartesian/axis_autotype\"),h=t(\"../plots/cartesian/set_convert\"),f=[\"=\",\"<\",\">=\",\">\",\"<=\"],d=[\"[]\",\"()\",\"[)\",\"(]\",\"][\",\")(\",\"](\",\")[\"],p=[\"{}\",\"}{\"];r.moduleType=\"transform\",r.name=\"filter\",r.attributes={enabled:{valType:\"boolean\",dflt:!0},target:{valType:\"string\",strict:!0,noBlank:!0,arrayOk:!0,dflt:\"x\"},operation:{valType:\"enumerated\",values:[].concat(f).concat(d).concat(p),dflt:\"=\"},value:{valType:\"any\",dflt:0}},r.supplyDefaults=function(t){function e(e,i){return o.coerce(t,n,r.attributes,e,i)}var n={};if(e(\"enabled\")){e(\"operation\"),e(\"value\"),e(\"target\");var i=s.getComponentMethod(\"calendars\",\"handleDefaults\");i(t,n,\"valuecalendar\",null),i(t,n,\"targetcalendar\",null)}return n},r.calcTransform=function(t,e,r){if(r.enabled){var s=r.target,u=n(e,s),c=u.length;if(c){var h=r.targetcalendar;if(\"string\"==typeof s){var f=o.nestedProperty(e,s+\"calendar\").get();f&&(h=f)}for(var d=a(r,i(t,e,\"x\"===s||\"y\"===s||\"z\"===s?s:u),h),p=l.findArrayAttributes(e),m={},g=0;g<p.length;g++){var v=p[g],y=o.nestedProperty(e,v);m[v]=o.extendDeep([],y.get()),y.set([])}for(var b=0;b<c;b++)if(d(u[b]))for(var x=0;x<p.length;x++)!function(t,r){var n=m[t];o.nestedProperty(e,t).get().push(n[r])}(p[x],b)}}}},{\"../lib\":685,\"../plot_api/plot_schema\":713,\"../plots/cartesian/axis_autotype\":725,\"../plots/cartesian/axis_ids\":727,\"../plots/cartesian/set_convert\":741,\"../registry\":802}],1046:[function(t,e,r){\"use strict\";function n(t,e){o.nestedProperty(t,e).set([])}function i(t,e,r,n){o.nestedProperty(t,n).set(o.nestedProperty(t,n).get().concat([o.nestedProperty(e,n).get()[r]]))}function a(t,e){var r=e.transform,a=t.transforms[e.transformIndex].groups;if(!Array.isArray(a)||0===a.length)return t;for(var l=o.filterUnique(a),u=new Array(l.length),c=a.length,h=s.findArrayAttributes(t),f=r.style||{},d=0;d<l.length;d++){var p=l[d],m=u[d]=o.extendDeepNoArrays({},t);h.forEach(n.bind(null,m));for(var g=0;g<c;g++)a[g]===p&&h.forEach(i.bind(0,m,t,g));m.name=p,m=o.extendDeepNoArrays(m,f[p]||{})}return u}var o=t(\"../lib\"),s=t(\"../plot_api/plot_schema\");r.moduleType=\"transform\",r.name=\"groupby\",r.attributes={enabled:{valType:\"boolean\",dflt:!0},groups:{valType:\"data_array\",dflt:[]},style:{valType:\"any\",dflt:{}}},r.supplyDefaults=function(t){function e(e,i){return o.coerce(t,n,r.attributes,e,i)}var n={};return e(\"enabled\")?(e(\"groups\"),e(\"style\"),n):n},r.transform=function(t,e){for(var r=[],n=0;n<t.length;n++)r=r.concat(a(t[n],e));return r}},{\"../lib\":685,\"../plot_api/plot_schema\":713}]},{},[19])(19)});});require(['plotly'], function(Plotly) {window.Plotly = Plotly;});}</script><div id='notebook_load_status' style='font-style:italic;color:blue'>Loading...</div>\n",
       "<script type='text/javascript'>\n",
       "  require(['jquery','jquery-UI','plotly','katex', 'autorender'],\n",
       "     function($,ui,Plotly,katex,auto) {\n",
       "     $(document).ready( function() {\n",
       "       var txt = '';\n",
       "       if( typeof($('#notebook_load_status').resizable) === 'undefined') {\n",
       "         txt += '<span class=\"failmsg\">JQueryUI not loaded correctly</span><br>';\n",
       "       }\n",
       "       if( typeof(Plotly.newPlot) === 'undefined') {\n",
       "         txt += '<span class=\"failmsg\">Plotly not loaded correctly</span><br>';\n",
       "       }\n",
       "       if(txt.length == 0) {\n",
       "         txt += '<span class=\"successmsg\">Notebook Initialization Complete</span>';\n",
       "         if( typeof MathJax !== 'undefined') {\n",
       "           txt += '<span class=\"successmsg2\"> (+MathJax)</span>';\n",
       "         } else {\n",
       "           txt += '<span class=\"successmsg2\"> (+KaTeX)</span>';\n",
       "         }\n",
       "       }\n",
       "       $('#notebook_load_status').html(txt);\n",
       "      }); });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from pygsti.report import Workspace\n",
    "ws = Workspace()\n",
    "ws.init_notebook_mode(connected=False, autodisplay=True)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### Model Violation summary: \n",
    "The aggregate log-likelihood as a function of GST iterations''')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'gs_finalAllL' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-3-da3877e2bc83>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m ws.FitComparisonBarPlot(Ls, gs_finalAllL, switchBd.gsAllL, \n\u001b[0m\u001b[1;32m      3\u001b[0m                         eff_ds, switchBd.objective, 'L')\n",
      "\u001b[0;31mNameError\u001b[0m: name 'gs_finalAllL' is not defined"
     ]
    }
   ],
   "source": [
    "\n",
    "ws.FitComparisonBarPlot(Ls, gs_finalAllL, switchBd.gsAllL, \n",
    "                        eff_ds, switchBd.objective, 'L')\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### Per-sequence model violation: \n",
    "Each point displays the goodness of fit for a single gate sequence.''')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'switchBd' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-4-cae4ff6034fa>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      2\u001b[0m colorScatterPlot = ws.ColorBoxPlot(\n\u001b[0;32m----> 3\u001b[0;31m     \u001b[0mswitchBd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mobjective\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgs_final\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0meff_ds\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgsL\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      4\u001b[0m     \u001b[0mlinlg_pcntle\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlinlogPercentile\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m/\u001b[0m \u001b[0;36m100\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      5\u001b[0m     minProbClipForWeighting=switchBd.mpc, scatter=True) #TODO: L-switchboard on summary page?\n",
      "\u001b[0;31mNameError\u001b[0m: name 'switchBd' is not defined"
     ]
    }
   ],
   "source": [
    "\n",
    "colorScatterPlot = ws.ColorBoxPlot(\n",
    "    switchBd.objective, gs_final, eff_ds, gsL,\n",
    "    linlg_pcntle=float(linlogPercentile) / 100,\n",
    "    minProbClipForWeighting=switchBd.mpc, scatter=True) #TODO: L-switchboard on summary page?\n",
    "colorScatterPlot.set_render_options(click_to_display=True)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### Comparison of GST estimated gates to target gates: \n",
    "This table presents, for each of the gates, three different measures of distance or discrepancy from the GST estimate to the ideal target operation.  See text for more detail.''')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "shapes (4,4) and (0,0) not aligned: 4 (dim 1) != 0 (dim 0)",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-5-10bfa932eee8>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mws\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mGatesVsTargetTable\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgs_final\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgs_target\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcri\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;32m<string>\u001b[0m in \u001b[0;36mfactoryfn\u001b[0;34m(gateset, targetGateset, confidenceRegionInfo)\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspacetables.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, ws, gateset, targetGateset, confidenceRegionInfo)\u001b[0m\n\u001b[1;32m    477\u001b[0m         \"\"\"\n\u001b[1;32m    478\u001b[0m         super(GatesVsTargetTable,self).__init__(ws, self._create, gateset,\n\u001b[0;32m--> 479\u001b[0;31m                                                 targetGateset, confidenceRegionInfo)\n\u001b[0m\u001b[1;32m    480\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    481\u001b[0m     \u001b[0;32mdef\u001b[0m \u001b[0m_create\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtargetGateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfidenceRegionInfo\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspace.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, ws, fn, *args)\u001b[0m\n\u001b[1;32m   1521\u001b[0m         \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minitargs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0margs\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1522\u001b[0m         \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtables\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mswitchboards\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msbSwitchIndices\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mswitchpos_map\u001b[0m \u001b[0;34m=\u001b[0m\u001b[0;31m \u001b[0m\u001b[0;31m\\\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1523\u001b[0;31m             \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mws\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mswitchedCompute\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtablefn\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minitargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   1524\u001b[0m         \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0moptions\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m{\u001b[0m \u001b[0;34m'click_to_display'\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;32mFalse\u001b[0m \u001b[0;34m}\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1525\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspace.py\u001b[0m in \u001b[0;36mswitchedCompute\u001b[0;34m(self, fn, *args)\u001b[0m\n\u001b[1;32m    610\u001b[0m                     \u001b[0mkey\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"NA\"\u001b[0m\u001b[0;34m;\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mv\u001b[0m\u001b[0;34m;\u001b[0m \u001b[0;32mbreak\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    611\u001b[0m             \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 612\u001b[0;31m                 \u001b[0mkey\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msmartCache\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcached_compute\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfn\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0margVals\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    613\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    614\u001b[0m             \u001b[0;32mif\u001b[0m \u001b[0mkey\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mstoredKeys\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0mkey\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'INEFFECTIVE'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/smartcache.py\u001b[0m in \u001b[0;36mcached_compute\u001b[0;34m(self, fn, argVals, kwargs)\u001b[0m\n\u001b[1;32m    177\u001b[0m                 \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtypesigs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname_key\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtypesig\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    178\u001b[0m                 \u001b[0;32mwith\u001b[0m \u001b[0m_timed_block\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'call'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtimes\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 179\u001b[0;31m                     \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcache\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margVals\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    180\u001b[0m                 \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmisses\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m+=\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    181\u001b[0m                 \u001b[0mhashtime\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtimes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'hash'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspacetables.py\u001b[0m in \u001b[0;36m_create\u001b[0;34m(self, gateset, targetGateset, confidenceRegionInfo)\u001b[0m\n\u001b[1;32m    486\u001b[0m         \u001b[0mformatters\u001b[0m  \u001b[0;34m=\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m'Conversion'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m'Conversion'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m'Conversion'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# ,'Conversion'\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    487\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 488\u001b[0;31m         \u001b[0minfidelities\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0m_reportables\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mprocess_infidelity\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtargetGateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfidenceRegionInfo\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mgl\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mgateLabels\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    489\u001b[0m         \u001b[0mjt_diffs\u001b[0m     \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0m_reportables\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjt_diff\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtargetGateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfidenceRegionInfo\u001b[0m\u001b[0;34m)\u001b[0m            \u001b[0;32mfor\u001b[0m \u001b[0mgl\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mgateLabels\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    490\u001b[0m         \u001b[0mdnorms\u001b[0m       \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0m_reportables\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhalf_diamond_norm\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtargetGateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfidenceRegionInfo\u001b[0m\u001b[0;34m)\u001b[0m  \u001b[0;32mfor\u001b[0m \u001b[0mgl\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mgateLabels\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspacetables.py\u001b[0m in \u001b[0;36m<listcomp>\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m    486\u001b[0m         \u001b[0mformatters\u001b[0m  \u001b[0;34m=\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m'Conversion'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m'Conversion'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m'Conversion'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# ,'Conversion'\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    487\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 488\u001b[0;31m         \u001b[0minfidelities\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0m_reportables\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mprocess_infidelity\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtargetGateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfidenceRegionInfo\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mgl\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mgateLabels\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    489\u001b[0m         \u001b[0mjt_diffs\u001b[0m     \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0m_reportables\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjt_diff\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtargetGateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfidenceRegionInfo\u001b[0m\u001b[0;34m)\u001b[0m            \u001b[0;32mfor\u001b[0m \u001b[0mgl\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mgateLabels\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    490\u001b[0m         \u001b[0mdnorms\u001b[0m       \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0m_reportables\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhalf_diamond_norm\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtargetGateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfidenceRegionInfo\u001b[0m\u001b[0;34m)\u001b[0m  \u001b[0;32mfor\u001b[0m \u001b[0mgl\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mgateLabels\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/smartcache.py\u001b[0m in \u001b[0;36mcacher\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m    312\u001b[0m     \u001b[0;34m@\u001b[0m\u001b[0m_functools\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwraps\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mobj\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    313\u001b[0m     \u001b[0;32mdef\u001b[0m \u001b[0mcacher\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 314\u001b[0;31m         \u001b[0mk\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mv\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcache\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcached_compute\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mobj\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    315\u001b[0m         \u001b[0;32mreturn\u001b[0m \u001b[0mv\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    316\u001b[0m     \u001b[0;32mreturn\u001b[0m \u001b[0mcacher\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/smartcache.py\u001b[0m in \u001b[0;36mcached_compute\u001b[0;34m(self, fn, argVals, kwargs)\u001b[0m\n\u001b[1;32m    177\u001b[0m                 \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtypesigs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname_key\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtypesig\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    178\u001b[0m                 \u001b[0;32mwith\u001b[0m \u001b[0m_timed_block\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'call'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtimes\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 179\u001b[0;31m                     \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcache\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margVals\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    180\u001b[0m                 \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmisses\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m+=\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    181\u001b[0m                 \u001b[0mhashtime\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtimes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'hash'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/reportables.py\u001b[0m in \u001b[0;36mcompute_quantity\u001b[0;34m(gatesetA, gatesetB, gateLabel, confidenceRegionInfo)\u001b[0m\n\u001b[1;32m    749\u001b[0m         \u001b[0mB\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mgatesetB\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgates\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mgateLabel\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    750\u001b[0m         \u001b[0;32mif\u001b[0m \u001b[0mconfidenceRegionInfo\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;31m# No Error bars\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 751\u001b[0;31m             \u001b[0;32mreturn\u001b[0m \u001b[0mReportableQty\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfnOfGates\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mA\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mB\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmxBasis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    752\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    753\u001b[0m         \u001b[0;31m# make sure the gateset we're given is the one used to generate the confidence region\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/reportables.py\u001b[0m in \u001b[0;36mprocess_infidelity\u001b[0;34m(A, B, mxBasis)\u001b[0m\n\u001b[1;32m    769\u001b[0m \u001b[0;34m@\u001b[0m\u001b[0mgates_quantity\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# This function changes arguments to (gatesetA, gatesetB, gateLabel, confidenceRegionInfo)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    770\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mprocess_infidelity\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mA\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mB\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmxBasis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 771\u001b[0;31m     \u001b[0;32mreturn\u001b[0m \u001b[0;36m1\u001b[0m \u001b[0;34m-\u001b[0m \u001b[0m_tools\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mprocess_fidelity\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mA\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mB\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmxBasis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    772\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    773\u001b[0m \u001b[0;34m@\u001b[0m\u001b[0mgates_quantity\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# This function changes arguments to (gatesetA, gatesetB, gateLabel, confidenceRegionInfo)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/gatetools.py\u001b[0m in \u001b[0;36mprocess_fidelity\u001b[0;34m(A, B, mxBasis)\u001b[0m\n\u001b[1;32m    343\u001b[0m     \u001b[0;32mif\u001b[0m \u001b[0mmxBasis\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    344\u001b[0m         \u001b[0mmxBasis\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_basis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mBasis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'gm'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mround\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m_np\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msqrt\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mA\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 345\u001b[0;31m     \u001b[0mJA\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_jam\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjamiolkowski_iso\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mA\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmxBasis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    346\u001b[0m     \u001b[0mJB\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_jam\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjamiolkowski_iso\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mB\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmxBasis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    347\u001b[0m     \u001b[0;32mreturn\u001b[0m \u001b[0mfidelity\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mJA\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mJB\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/jamiolkowski.py\u001b[0m in \u001b[0;36mjamiolkowski_iso\u001b[0;34m(gateMx, gateMxBasis, choiMxBasis)\u001b[0m\n\u001b[1;32m     85\u001b[0m     \u001b[0mgateMxBasis\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mchoiMxBasis\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_basis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbuild_basis_pair\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgateMx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgateMxBasis\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mchoiMxBasis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     86\u001b[0m     \u001b[0mgateMx\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_np\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0masarray\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgateMx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 87\u001b[0;31m     \u001b[0mgateMxInStdBasis\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_basis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mchange_basis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgateMx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgateMxBasis\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgateMxBasis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstd_equivalent\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m     88\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     89\u001b[0m     \u001b[0;31m#expand gate matrix so it acts on entire space of dmDim x dmDim density matrices\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/basis.py\u001b[0m in \u001b[0;36mchange_basis\u001b[0;34m(mx, from_basis, to_basis, dimOrBlockDims, resize)\u001b[0m\n\u001b[1;32m    430\u001b[0m     \u001b[0misMx\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmx\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;36m2\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0mmx\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0mmx\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    431\u001b[0m     \u001b[0;32mif\u001b[0m \u001b[0misMx\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 432\u001b[0;31m         \u001b[0mret\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_np\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtoMx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m_np\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfromMx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    433\u001b[0m     \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;31m# isVec\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    434\u001b[0m         \u001b[0mret\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_np\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtoMx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mValueError\u001b[0m: shapes (4,4) and (0,0) not aligned: 4 (dim 1) != 0 (dim 0)"
     ]
    }
   ],
   "source": [
    "\n",
    "ws.GatesVsTargetTable(gs_final, gs_target, cri)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "# Model Violation Analysis\n",
    "Metrics indicating how well the estimated gate set can be trusted -- i.e., how well it fits the data.\n",
    "### ProgressTable:\n",
    "Comparison between the computed and expected maximum $\\log(\\mathcal{L})$ for different values of $L$. \n",
    "$N_S$ and $N_p$ are the number of gate strings and parameters, respectively.  \n",
    "The quantity $2\\Delta\\log(\\mathcal{L})$ measures the goodness of fit of the GST model (small is better) and is expected to lie within $[k-\\sqrt{2k},k+\\sqrt{2k}]$ where $k = N_s-N_p$. \n",
    "$N_\\sigma = (2\\Delta\\log(\\mathcal{L})-k)/\\sqrt{2k}$ is the number of standard deviations from the mean (a $p$-value can be straightforwardly derived from $N_\\sigma$).  \n",
    "The rating from 1 to 5 stars gives a very crude indication of goodness of fit.\n",
    "\n",
    "  <!--<span class=\"math\">p</span> is the p-value derived from a <span class=\"math\">\\chi^2_k</span> distribution.(For example, if <span class=\"math\">p=0.05</span>, then the probability of observing a <span class=\"math\">\\chi^{2}</span> value as large as, or larger than, the one indicated in the table is 5%%, assuming the GST model is valid.) -->\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'gs_finalAllL' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-6-da3877e2bc83>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m ws.FitComparisonBarPlot(Ls, gs_finalAllL, switchBd.gsAllL, \n\u001b[0m\u001b[1;32m      3\u001b[0m                         eff_ds, switchBd.objective, 'L')\n",
      "\u001b[0;31mNameError\u001b[0m: name 'gs_finalAllL' is not defined"
     ]
    }
   ],
   "source": [
    "\n",
    "ws.FitComparisonBarPlot(Ls, gs_finalAllL, switchBd.gsAllL, \n",
    "                        eff_ds, switchBd.objective, 'L')\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### bestEstimateColorBoxPlot:\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'switchBd' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-7-5c265eeb2d3d>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      2\u001b[0m colorScatterPlot = ws.ColorBoxPlot(\n\u001b[0;32m----> 3\u001b[0;31m     \u001b[0mswitchBd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mobjective\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgs_final\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0meff_ds\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgsL\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      4\u001b[0m     \u001b[0mlinlg_pcntle\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlinlogPercentile\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m/\u001b[0m \u001b[0;36m100\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      5\u001b[0m     minProbClipForWeighting=switchBd.mpc, scatter=True) #TODO: L-switchboard on summary page?\n",
      "\u001b[0;31mNameError\u001b[0m: name 'switchBd' is not defined"
     ]
    }
   ],
   "source": [
    "\n",
    "colorScatterPlot = ws.ColorBoxPlot(\n",
    "    switchBd.objective, gs_final, eff_ds, gsL,\n",
    "    linlg_pcntle=float(linlogPercentile) / 100,\n",
    "    minProbClipForWeighting=switchBd.mpc, scatter=True) #TODO: L-switchboard on summary page?\n",
    "colorScatterPlot.set_render_options(click_to_display=True)\n",
    "#switchBd.view(maxLView,\"v6\")\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### $2\\Delta\\log(\\mathcal{L})$ contributions for every individual experiment in the dataset.\n",
    "Each pixel represents a single experiment (gate sequence), and its color indicates whether GST was able to fit the corresponding frequency well.  Shades of white/gray are typical. Red squares represent statistically significant evidence for model violation (non-Markovianity), and should appear with probability at most *linlg_pcntle* if the data really are Markovian. Square blocks of pixels correspond to base sequences (arranged vertically by germ and horizontally by length); each pixel within a block corresponds to a specific choice of pre- and post-fiducial sequences.  See text for further details.\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### dataScalingColorBoxPlot\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'switchBd' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-8-434a18b3c4f2>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m ws.ColorBoxPlot(\"scaling\", switchBd.gs_finalFinal, eff_ds, switchBd.gs_finalIter,\n\u001b[0m\u001b[1;32m      3\u001b[0m         submatrices=switchBd.scaledSubMxsDict)\n",
      "\u001b[0;31mNameError\u001b[0m: name 'switchBd' is not defined"
     ]
    }
   ],
   "source": [
    "\n",
    "ws.ColorBoxPlot(\"scaling\", switchBd.gs_finalFinal, eff_ds, switchBd.gs_finalIter,\n",
    "        submatrices=switchBd.scaledSubMxsDict)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### Data scaling factor for every individual experiment in the dataset.\n",
    "Each pixel represents a single experiment (gate sequence), and its color indicates the amount of scaling that was applied to the original data counts when computing the log-likelihood or $\\chi^2$ for this estimate.  \n",
    "Values of 1.0 indicate all of the original data was used, whereas numbers between 0 and 1 indicate that the data counts for the experiement were artificially decreased (usually to improve the fit).\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    " \n",
    "# Gauge Invariant Outputs\n",
    "Quantities which are *gauge-invariant* are the most reliable means of assessing the quality of the gates, as these do not depend on any unphysical gauge degrees of freedom\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### Eigenvalues of estimated gates: \n",
    "The spectrum (Eigenvalues column) of each estimated gate.  The second column displays these eigenvalues over the complex disc.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "require(['jquery','jquery-UI','plotly'],function($,ui,Plotly) {require(['jquery','jquery-UI','plotly','autorender'],function($,ui,Plotly,renderMathInElement) {\n",
       "  $(document).ready(function() {\n",
       "var switchmap_table_7072 = new Array();\n",
       "switchmap_table_7072[ [] ] = 'table_7072_0';\n",
       "window.switchmap_table_7072 = switchmap_table_7072;\n",
       "\n",
       "function connect_table_7072_to_switches(){  if(true) {    console.log('Switches initialized: table_7072 handlers set');\n",
       "    $( '#table_7072' ).show()\n",
       "  }\n",
       "  else {\n",
       "    setTimeout(connect_table_7072_to_switches, 500);\n",
       "    console.log('table_7072 switches NOT initialized: Waiting...');\n",
       "  }\n",
       "};\n",
       "$(document).ready(function() {\n",
       "  connect_table_7072_to_switches();\n",
       "});\n",
       "\n",
       "  plotman.enqueue(function() { \n",
       "    renderMathInElement(document.getElementById(\"table_7072\"), { delimiters: [\n",
       "             {left: \"$$\", right: \"$$\", display: true},\n",
       "             {left: \"$\", right: \"$\", display: false},\n",
       "             ] } );\n",
       "    make_wstable_resizable(\"table_7072\");\n",
       "    trigger_wstable_plot_creation(\"table_7072\");\n",
       "  }, \"Rendering math in table_7072\" );\n",
       "}); //end on-ready handler\n",
       "}); //end require block\n",
       " });</script><div id='table_7072' class='pygsti-wsoutput-group'>\n",
       "<div class='single_switched_value' id='table_7072_0'>\n",
       "<table class=\"dataTable\" id=\"table_7072_0_tbl\"><thead><tr><th> <span title=\"Gate\">Gate</span> </th><th> <span title=\"Eigenvalues\">Eigenvalues</span> </th><th> <span title=\"Real log(eval)\">Real log(eval)</span> </th><th> <span title=\"Imag log(eval)\">Imag log(eval)</span> </th></tr></thead><tbody><tr><td><span title=\"Gi\">Gi</span></td><td><span title=\"[[ 0.89920630+0.00585843j]\n",
       " [ 0.89920630-0.00585843j]\n",
       " [ 0.90257705+0.j        ]\n",
       " [ 1.00000000+0.j        ]]\">$ \\begin{pmatrix}\n",
       "0.899225e^{i0.002\\pi} \\\\ \n",
       "0.899225e^{-i0.002\\pi} \\\\ \n",
       "0.902577 \\\\ \n",
       "1\n",
       " \\end{pmatrix} $\n",
       "</span></td><td><span title=\"[[-0.10622157]\n",
       " [-0.10622157]\n",
       " [-0.10250122]\n",
       " [ 0.        ]]\">$ \\begin{pmatrix}\n",
       "-0.106222 \\\\ \n",
       "-0.106222 \\\\ \n",
       "-0.102501 \\\\ \n",
       "0\n",
       " \\end{pmatrix} $\n",
       "</span></td><td><span title=\"[[ 0.00207379]\n",
       " [-0.00207379]\n",
       " [ 0.        ]\n",
       " [ 0.        ]]\">$ \\begin{pmatrix}\n",
       "0.002074 \\\\ \n",
       "-0.002074 \\\\ \n",
       "0 \\\\ \n",
       "0\n",
       " \\end{pmatrix} $\n",
       "&pi;</span></td></tr><tr><td><span title=\"Gx\">Gx</span></td><td><span title=\"[[-0.00187970+0.90199328j]\n",
       " [-0.00187970-0.90199328j]\n",
       " [ 1.00000000+0.j        ]\n",
       " [ 0.91243214+0.j        ]]\">$ \\begin{pmatrix}\n",
       "0.901995e^{i0.501\\pi} \\\\ \n",
       "0.901995e^{-i0.501\\pi} \\\\ \n",
       "1 \\\\ \n",
       "0.912432\n",
       " \\end{pmatrix} $\n",
       "</span></td><td><span title=\"[[ -1.03146037e-01]\n",
       " [ -1.03146037e-01]\n",
       " [  2.22044605e-16]\n",
       " [ -9.16415684e-02]]\">$ \\begin{pmatrix}\n",
       "-0.103146 \\\\ \n",
       "-0.103146 \\\\ \n",
       "0 \\\\ \n",
       "-0.091642\n",
       " \\end{pmatrix} $\n",
       "</span></td><td><span title=\"[[ 0.50066334]\n",
       " [-0.50066334]\n",
       " [ 0.        ]\n",
       " [ 0.        ]]\">$ \\begin{pmatrix}\n",
       "0.500663 \\\\ \n",
       "-0.500663 \\\\ \n",
       "0 \\\\ \n",
       "0\n",
       " \\end{pmatrix} $\n",
       "&pi;</span></td></tr><tr><td><span title=\"Gy\">Gy</span></td><td><span title=\"[[  1.00000000e+00+0.j        ]\n",
       " [  8.98010613e-01+0.j        ]\n",
       " [ -1.41793659e-04+0.89709246j]\n",
       " [ -1.41793659e-04-0.89709246j]]\">$ \\begin{pmatrix}\n",
       "1 \\\\ \n",
       "0.898011 \\\\ \n",
       "0.897092e^{i0.500\\pi} \\\\ \n",
       "0.897092e^{-i0.500\\pi}\n",
       " \\end{pmatrix} $\n",
       "</span></td><td><span title=\"[[ -3.33066907e-16]\n",
       " [ -1.07573392e-01]\n",
       " [ -1.08596334e-01]\n",
       " [ -1.08596334e-01]]\">$ \\begin{pmatrix}\n",
       "0 \\\\ \n",
       "-0.107573 \\\\ \n",
       "-0.108596 \\\\ \n",
       "-0.108596\n",
       " \\end{pmatrix} $\n",
       "</span></td><td><span title=\"[[ 0.        ]\n",
       " [ 0.        ]\n",
       " [ 0.50005031]\n",
       " [-0.50005031]]\">$ \\begin{pmatrix}\n",
       "0 \\\\ \n",
       "0 \\\\ \n",
       "0.50005 \\\\ \n",
       "-0.50005\n",
       " \\end{pmatrix} $\n",
       "&pi;</span></td></tr></tbody></table>\n",
       "</div>\n",
       "\n",
       "</div>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "<pygsti.report.workspacetables.GateEigenvalueTable at 0x7f13b6c9bb38>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "ws.GateEigenvalueTable(gs_final, gs_target, cri, display=('evals','log-evals'))\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### Gram Matrix Eigenvalues: \n",
    "Compares the eigenvalues of the data-derived Gram matrix with those of a Gram matrix computed using the target gates.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "require(['jquery','jquery-UI','plotly'],function($,ui,Plotly) {require(['jquery','jquery-UI','plotly'],function($,ui,Plotly) {\n",
       "  $(document).ready(function() {\n",
       "  $(\"#66ca5b2c-0b38-4d91-a67a-e3e16790154c\").addClass(\"pygsti-plotgroup-master\");\n",
       "  $(\"#66ca5b2c-0b38-4d91-a67a-e3e16790154c\").on(\"init\", function(event) {\n",
       "    pex_init_plotdiv($(\"#66ca5b2c-0b38-4d91-a67a-e3e16790154c\"), 400.0, 300.0);\n",
       "    pex_init_slaves($(\"#66ca5b2c-0b38-4d91-a67a-e3e16790154c\"));\n",
       "    console.log(\"Initialized 66ca5b2c-0b38-4d91-a67a-e3e16790154c\");\n",
       "  });\n",
       "  $(\"#66ca5b2c-0b38-4d91-a67a-e3e16790154c\").on(\"click.pygsti\", function(event) {\n",
       "     plotman.enqueue(function() { \n",
       "        \n",
       "     }, \"Click-creating Plot 66ca5b2c-0b38-4d91-a67a-e3e16790154c\" );\n",
       "     $(\"#66ca5b2c-0b38-4d91-a67a-e3e16790154c\").off(\"click.pygsti\");\n",
       "     console.log(\"Click-Created 66ca5b2c-0b38-4d91-a67a-e3e16790154c\");\n",
       "  });\n",
       "  $(\"#66ca5b2c-0b38-4d91-a67a-e3e16790154c\").on(\"create\", function(event, fracw, frach) {\n",
       "     pex_update_plotdiv_size($(\"#66ca5b2c-0b38-4d91-a67a-e3e16790154c\"), 1.3333333333333333, fracw, frach, 400.0, 300.0);\n",
       "     plotman.enqueue(function() { \n",
       "       $(\"#66ca5b2c-0b38-4d91-a67a-e3e16790154c\").addClass(\"pygBackground\");\n",
       "       window.PLOTLYENV=window.PLOTLYENV || {};window.PLOTLYENV.BASE_URL=\"https://plot.ly\";Plotly.newPlot(\"66ca5b2c-0b38-4d91-a67a-e3e16790154c\", [{\"hoverinfo\": \"y\", \"type\": \"bar\", \"marker\": {\"color\": \"blue\"}, \"name\": \"from Data\", \"y\": [0.005636649996705195, 0.027675065275790674, 0.038176176081117626, 0.6485705677854028, 0.6839941443364523, 1.1731515426132666, 3.4343035080928277], \"x\": [0, 1, 2, 3, 4, 5, 6]}, {\"hoverinfo\": \"y\", \"type\": \"bar\", \"marker\": {\"color\": \"black\"}, \"name\": \"from Target\", \"y\": [6.450472754302674e-17, 1.1200201659284765e-16, 3.1153224494604497e-16, 0.9999999999999998, 1.0, 1.4494897427831777, 3.449489742783177], \"x\": [0, 1, 2, 3, 4, 5, 6]}], {\"xaxis\": {\"title\": \"index\", \"tickvals\": [0, 1, 2, 3, 4, 5, 6]}, \"yaxis\": {\"type\": \"log\", \"exponentformat\": \"power\", \"title\": \"eigenvalue\"}, \"bargap\": 0.1}, {\"showLink\": false, \"linkText\": \"Export to plot.ly\"}) \n",
       "       pex_create_slaves($(\"#66ca5b2c-0b38-4d91-a67a-e3e16790154c\"), 400.0, 300.0);\n",
       "     }, \"Creating Plot 66ca5b2c-0b38-4d91-a67a-e3e16790154c\" );\n",
       "     console.log(\"Created 66ca5b2c-0b38-4d91-a67a-e3e16790154c\");\n",
       "  });\n",
       "  $(\"#66ca5b2c-0b38-4d91-a67a-e3e16790154c\").on(\"resize\", function(event,fracw,frach) {\n",
       "    pex_update_plotdiv_size($(\"#66ca5b2c-0b38-4d91-a67a-e3e16790154c\"), 1.3333333333333333, fracw, frach, 400.0, 300.0);\n",
       "    plotman.enqueue(function() { \n",
       "        Plotly.Plots.resize(document.getElementById(\"66ca5b2c-0b38-4d91-a67a-e3e16790154c\")); \n",
       "      pex_resize_slaves($(\"#66ca5b2c-0b38-4d91-a67a-e3e16790154c\"), 400.0, 300.0);\n",
       "     }, \"Resizing Plot 66ca5b2c-0b38-4d91-a67a-e3e16790154c\" );\n",
       "    //console.log(\"Resized 66ca5b2c-0b38-4d91-a67a-e3e16790154c\");\n",
       "  });\n",
       "var switchmap_plot_5899 = new Array();\n",
       "switchmap_plot_5899[ [] ] = '66ca5b2c-0b38-4d91-a67a-e3e16790154c';\n",
       "window.switchmap_plot_5899 = switchmap_plot_5899;\n",
       "\n",
       "function connect_plot_5899_to_switches(){  if(true) {    console.log('Switches initialized: plot_5899 handlers set');\n",
       "    $( '#plot_5899' ).show()\n",
       "  }\n",
       "  else {\n",
       "    setTimeout(connect_plot_5899_to_switches, 500);\n",
       "    console.log('plot_5899 switches NOT initialized: Waiting...');\n",
       "  }\n",
       "};\n",
       "$(document).ready(function() {\n",
       "  connect_plot_5899_to_switches();\n",
       "});\n",
       "\n",
       "make_wsplot_resizable(\"plot_5899\");\n",
       "trigger_wsplot_plot_creation(\"plot_5899\");\n",
       "}); //end on-ready handler\n",
       "}); //end require block\n",
       " });</script><div id='plot_5899' class='pygsti-wsoutput-group'>\n",
       "<div class='relwrap single_switched_value'><div class='abswrap'><div id=\"66ca5b2c-0b38-4d91-a67a-e3e16790154c\" style=\"height: 100%; width: 100%;\" class=\"plotly-graph-div\"></div></div></div>\n",
       "</div>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "<pygsti.report.workspaceplots.GramMatrixBarPlot at 0x7f13b6b8c9b0>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    " \n",
    "ws.GramMatrixBarPlot(ds, gs_target, 10)#, strs)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### Gauge Variant Outputs\n",
    "The raw estimated gate set, and then some useful derived quantities.  These quanties are <q>gauge-dependent</q>, meaning they will depend on unphysical gauge degrees of freedom that are a necessary byproduct of estimating an entire gate set at once (akin to a freedom of reference frame).  After finding a best-estimate based on the (physical) data, GST optimizes within the space of all (unphysical) gauge degrees of freedom using the parameters in Table\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "\n",
    "# Choose G.O. params\n",
    "# goSwitchBoard2\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### Gauge Optimization Details. \n",
    "A list of the parameters used when performing the gauge optimization that produced the final GST results found in subsequent tables and figures.\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'switchBd' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-12-2f015ad838f8>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mws\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mGaugeOptParamsTable\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mswitchBd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgoparams\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      3\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mNameError\u001b[0m: name 'switchBd' is not defined"
     ]
    }
   ],
   "source": [
    "\n",
    "ws.GaugeOptParamsTable(switchBd.goparams)\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### The GST estimate of the SPAM operations. Compares the estimated SPAM operations to those desired for convenience.\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'switchBd' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-13-cbd7b88b0b35>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m ws.SpamTable(switchBd.gsTargetAndFinal,\n\u001b[0m\u001b[1;32m      3\u001b[0m              \u001b[0;34m[\u001b[0m\u001b[0;34m'Target'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m'Estimated'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      4\u001b[0m              cri, includeHSVec=False)\n\u001b[1;32m      5\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mNameError\u001b[0m: name 'switchBd' is not defined"
     ]
    }
   ],
   "source": [
    "\n",
    "ws.SpamTable(switchBd.gsTargetAndFinal,\n",
    "             ['Target','Estimated'],\n",
    "             cri, includeHSVec=False)\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### GST estimate of SPAM probabilities.\n",
    "Computed by taking the dot products of vectors in bestGatesetSpamTable. The symbol $E_C$, when it appears, refers to the <q>complement</q> effect given by subtracting each of the other effects from the identity.\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "require(['jquery','jquery-UI','plotly'],function($,ui,Plotly) {require(['jquery','jquery-UI','plotly','autorender'],function($,ui,Plotly,renderMathInElement) {\n",
       "  $(document).ready(function() {\n",
       "var switchmap_table_8156 = new Array();\n",
       "switchmap_table_8156[ [] ] = 'table_8156_0';\n",
       "window.switchmap_table_8156 = switchmap_table_8156;\n",
       "\n",
       "function connect_table_8156_to_switches(){  if(true) {    console.log('Switches initialized: table_8156 handlers set');\n",
       "    $( '#table_8156' ).show()\n",
       "  }\n",
       "  else {\n",
       "    setTimeout(connect_table_8156_to_switches, 500);\n",
       "    console.log('table_8156 switches NOT initialized: Waiting...');\n",
       "  }\n",
       "};\n",
       "$(document).ready(function() {\n",
       "  connect_table_8156_to_switches();\n",
       "});\n",
       "\n",
       "    make_wstable_resizable(\"table_8156\");\n",
       "    trigger_wstable_plot_creation(\"table_8156\");\n",
       "}); //end on-ready handler\n",
       "}); //end require block\n",
       " });</script><div id='table_8156' class='pygsti-wsoutput-group'>\n",
       "<div class='single_switched_value' id='table_8156_0'>\n",
       "<table class=\"dataTable\" id=\"table_8156_0_tbl\"><thead><tr><th> <span title=\"\"></span> </th><th> <span title=\"E0\">E<sub>0</sub></span> </th><th> <span title=\"remainder\">E<sub>C</sub></span> </th></tr></thead><tbody><tr><td><span title=\"rho0\">&rho;<sub>0</sub></span></td><td><span title=\"-8.77887577516e-06\">-0.000009</span></td><td><span title=\"1.00000877888\">1.000009</span></td></tr></tbody></table>\n",
       "</div>\n",
       "\n",
       "</div>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "<pygsti.report.workspacetables.SpamParametersTable at 0x7f13b6bb16a0>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "ws.SpamParametersTable(gs_final, cri)\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### Decomposition of estimated gates.\n",
    "A rotation axis and angle are extracted from each gate by considering the projection of its logarithm onto a the Pauli Hamiltonian projectors.  The direction and magnitude (up to a conventional constant) give the axis and angle respectively.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "Automatic basis expanding/contracting temporarily disabled",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-15-c216ce4f0a71>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mws\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mGateDecompTable\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgs_final\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgs_target\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcri\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      3\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m<string>\u001b[0m in \u001b[0;36mfactoryfn\u001b[0;34m(gateset, targetGateset, confidenceRegionInfo)\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspacetables.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, ws, gateset, targetGateset, confidenceRegionInfo)\u001b[0m\n\u001b[1;32m    781\u001b[0m         \"\"\"\n\u001b[1;32m    782\u001b[0m         super(GateDecompTable,self).__init__(ws, self._create, gateset,\n\u001b[0;32m--> 783\u001b[0;31m                                              targetGateset, confidenceRegionInfo)\n\u001b[0m\u001b[1;32m    784\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    785\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspace.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, ws, fn, *args)\u001b[0m\n\u001b[1;32m   1521\u001b[0m         \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minitargs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0margs\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1522\u001b[0m         \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtables\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mswitchboards\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msbSwitchIndices\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mswitchpos_map\u001b[0m \u001b[0;34m=\u001b[0m\u001b[0;31m \u001b[0m\u001b[0;31m\\\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1523\u001b[0;31m             \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mws\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mswitchedCompute\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtablefn\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minitargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   1524\u001b[0m         \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0moptions\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m{\u001b[0m \u001b[0;34m'click_to_display'\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;32mFalse\u001b[0m \u001b[0;34m}\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1525\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspace.py\u001b[0m in \u001b[0;36mswitchedCompute\u001b[0;34m(self, fn, *args)\u001b[0m\n\u001b[1;32m    610\u001b[0m                     \u001b[0mkey\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"NA\"\u001b[0m\u001b[0;34m;\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mv\u001b[0m\u001b[0;34m;\u001b[0m \u001b[0;32mbreak\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    611\u001b[0m             \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 612\u001b[0;31m                 \u001b[0mkey\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msmartCache\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcached_compute\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfn\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0margVals\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    613\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    614\u001b[0m             \u001b[0;32mif\u001b[0m \u001b[0mkey\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mstoredKeys\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0mkey\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'INEFFECTIVE'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/smartcache.py\u001b[0m in \u001b[0;36mcached_compute\u001b[0;34m(self, fn, argVals, kwargs)\u001b[0m\n\u001b[1;32m    177\u001b[0m                 \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtypesigs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname_key\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtypesig\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    178\u001b[0m                 \u001b[0;32mwith\u001b[0m \u001b[0m_timed_block\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'call'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtimes\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 179\u001b[0;31m                     \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcache\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margVals\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    180\u001b[0m                 \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmisses\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m+=\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    181\u001b[0m                 \u001b[0mhashtime\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtimes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'hash'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspacetables.py\u001b[0m in \u001b[0;36m_create\u001b[0;34m(self, gateset, targetGateset, confidenceRegionInfo)\u001b[0m\n\u001b[1;32m    804\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    805\u001b[0m             hamProjs, hamGens = _tools.std_errgen_projections(\n\u001b[0;32m--> 806\u001b[0;31m                 logG, \"hamiltonian\", basisNm, basisNm, return_generators=True)\n\u001b[0m\u001b[1;32m    807\u001b[0m             \u001b[0mnorm\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_np\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlinalg\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnorm\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mhamProjs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    808\u001b[0m             \u001b[0maxes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mgl\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mhamProjs\u001b[0m \u001b[0;34m/\u001b[0m \u001b[0mnorm\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mnorm\u001b[0m \u001b[0;34m>\u001b[0m \u001b[0;36m1e-15\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32melse\u001b[0m \u001b[0mhamProjs\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/gatetools.py\u001b[0m in \u001b[0;36mstd_errgen_projections\u001b[0;34m(errgen, projection_type, projection_basis, mxBasis, return_generators)\u001b[0m\n\u001b[1;32m    866\u001b[0m     \"\"\"\n\u001b[1;32m    867\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 868\u001b[0;31m     \u001b[0merrgen_std\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mchange_basis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0merrgen\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmxBasis\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"std\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    869\u001b[0m     \u001b[0md2\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0merrgen\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    870\u001b[0m     \u001b[0md\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m_np\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msqrt\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0md2\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/basis.py\u001b[0m in \u001b[0;36mchange_basis\u001b[0;34m(mx, from_basis, to_basis, dimOrBlockDims, resize)\u001b[0m\n\u001b[1;32m    407\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    408\u001b[0m     \u001b[0;32mif\u001b[0m \u001b[0mfrom_basis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdim\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgateDim\u001b[0m \u001b[0;34m!=\u001b[0m \u001b[0mto_basis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdim\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgateDim\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 409\u001b[0;31m         \u001b[0;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'Automatic basis expanding/contracting temporarily disabled'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    410\u001b[0m         \u001b[0;31m#or \\\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    411\u001b[0m         \u001b[0;31m#    resize is not None:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mValueError\u001b[0m: Automatic basis expanding/contracting temporarily disabled"
     ]
    }
   ],
   "source": [
    "\n",
    "ws.GateDecompTable(gs_final, gs_target, cri)\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### Relative Eigenvalues of estimated gates.\n",
    "The spectrum of each estimated gate pre-multiplied by the inverse of it's ideal (target) counterpart.  The second column displays these eigenvalues over the complex disc.\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "require(['jquery','jquery-UI','plotly'],function($,ui,Plotly) {require(['jquery','jquery-UI','plotly','autorender'],function($,ui,Plotly,renderMathInElement) {\n",
       "  $(document).ready(function() {\n",
       "var switchmap_table_8605 = new Array();\n",
       "switchmap_table_8605[ [] ] = 'table_8605_0';\n",
       "window.switchmap_table_8605 = switchmap_table_8605;\n",
       "\n",
       "function connect_table_8605_to_switches(){  if(true) {    console.log('Switches initialized: table_8605 handlers set');\n",
       "    $( '#table_8605' ).show()\n",
       "  }\n",
       "  else {\n",
       "    setTimeout(connect_table_8605_to_switches, 500);\n",
       "    console.log('table_8605 switches NOT initialized: Waiting...');\n",
       "  }\n",
       "};\n",
       "$(document).ready(function() {\n",
       "  connect_table_8605_to_switches();\n",
       "});\n",
       "\n",
       "  plotman.enqueue(function() { \n",
       "    renderMathInElement(document.getElementById(\"table_8605\"), { delimiters: [\n",
       "             {left: \"$$\", right: \"$$\", display: true},\n",
       "             {left: \"$\", right: \"$\", display: false},\n",
       "             ] } );\n",
       "    make_wstable_resizable(\"table_8605\");\n",
       "    trigger_wstable_plot_creation(\"table_8605\");\n",
       "  }, \"Rendering math in table_8605\" );\n",
       "}); //end on-ready handler\n",
       "}); //end require block\n",
       " });</script><div id='table_8605' class='pygsti-wsoutput-group'>\n",
       "<div class='single_switched_value' id='table_8605_0'>\n",
       "<table class=\"dataTable\" id=\"table_8605_0_tbl\"><thead><tr><th> <span title=\"Gate\">Gate</span> </th><th> <span title=\"Rel. Evals\">Rel. Evals</span> </th><th> <span title=\"Real log(rel. eval)\">Real log(rel. eval)</span> </th><th> <span title=\"Imag log(rel. eval)\">Imag log(rel. eval)</span> </th></tr></thead><tbody><tr><td><span title=\"Gi\">Gi</span></td><td><span title=\"[[ 0.89920630+0.00585843j]\n",
       " [ 0.89920630-0.00585843j]\n",
       " [ 0.90257705+0.j        ]\n",
       " [ 1.00000000+0.j        ]]\">$ \\begin{pmatrix}\n",
       "0.899225e^{i0.002\\pi} \\\\ \n",
       "0.899225e^{-i0.002\\pi} \\\\ \n",
       "0.902577 \\\\ \n",
       "1\n",
       " \\end{pmatrix} $\n",
       "</span></td><td><span title=\"[[-0.10622157]\n",
       " [-0.10622157]\n",
       " [-0.10250122]\n",
       " [ 0.        ]]\">$ \\begin{pmatrix}\n",
       "-0.106222 \\\\ \n",
       "-0.106222 \\\\ \n",
       "-0.102501 \\\\ \n",
       "0\n",
       " \\end{pmatrix} $\n",
       "</span></td><td><span title=\"[[ 0.00207379]\n",
       " [-0.00207379]\n",
       " [ 0.        ]\n",
       " [ 0.        ]]\">$ \\begin{pmatrix}\n",
       "0.002074 \\\\ \n",
       "-0.002074 \\\\ \n",
       "0 \\\\ \n",
       "0\n",
       " \\end{pmatrix} $\n",
       "&pi;</span></td></tr><tr><td><span title=\"Gx\">Gx</span></td><td><span title=\"[[ 1.        ]\n",
       " [ 0.89807728]\n",
       " [ 0.90506386]\n",
       " [ 0.91330562]]\">$ \\begin{pmatrix}\n",
       "1 \\\\ \n",
       "0.898077 \\\\ \n",
       "0.905064 \\\\ \n",
       "0.913306\n",
       " \\end{pmatrix} $\n",
       "</span></td><td><span title=\"[[ -2.22044605e-16]\n",
       " [ -1.07499153e-01]\n",
       " [ -9.97497780e-02]\n",
       " [ -9.06847103e-02]]\">$ \\begin{pmatrix}\n",
       "0 \\\\ \n",
       "-0.107499 \\\\ \n",
       "-0.09975 \\\\ \n",
       "-0.090685\n",
       " \\end{pmatrix} $\n",
       "</span></td><td><span title=\"[[ 0.]\n",
       " [ 0.]\n",
       " [ 0.]\n",
       " [ 0.]]\">$ \\begin{pmatrix}\n",
       "0 \\\\ \n",
       "0 \\\\ \n",
       "0 \\\\ \n",
       "0\n",
       " \\end{pmatrix} $\n",
       "&pi;</span></td></tr><tr><td><span title=\"Gy\">Gy</span></td><td><span title=\"[[ 1.        ]\n",
       " [ 0.9035682 ]\n",
       " [ 0.8917158 ]\n",
       " [ 0.89695053]]\">$ \\begin{pmatrix}\n",
       "1 \\\\ \n",
       "0.903568 \\\\ \n",
       "0.891716 \\\\ \n",
       "0.896951\n",
       " \\end{pmatrix} $\n",
       "</span></td><td><span title=\"[[ -7.77156117e-16]\n",
       " [ -1.01403684e-01]\n",
       " [ -1.14607806e-01]\n",
       " [ -1.08754570e-01]]\">$ \\begin{pmatrix}\n",
       "0 \\\\ \n",
       "-0.101404 \\\\ \n",
       "-0.114608 \\\\ \n",
       "-0.108755\n",
       " \\end{pmatrix} $\n",
       "</span></td><td><span title=\"[[ 0.]\n",
       " [ 0.]\n",
       " [ 0.]\n",
       " [ 0.]]\">$ \\begin{pmatrix}\n",
       "0 \\\\ \n",
       "0 \\\\ \n",
       "0 \\\\ \n",
       "0\n",
       " \\end{pmatrix} $\n",
       "&pi;</span></td></tr></tbody></table>\n",
       "</div>\n",
       "\n",
       "</div>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "<pygsti.report.workspacetables.GateEigenvalueTable at 0x7f13b6b471d0>"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "ws.GateEigenvalueTable(gs_final, gs_target, cri, display=('rel','log-rel'))\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### Comparison of GST estimated gates to target gates:\n",
    "This table presents, for each of the gates, three different measures of distance or discrepancy from the GST estimate to the ideal target operation.  See text for more detail.\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "shapes (4,4) and (0,0) not aligned: 4 (dim 1) != 0 (dim 0)",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-17-94a678e298cf>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mws\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mGatesVsTargetTable\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgs_final\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgs_target\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcri\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      3\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m<string>\u001b[0m in \u001b[0;36mfactoryfn\u001b[0;34m(gateset, targetGateset, confidenceRegionInfo)\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspacetables.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, ws, gateset, targetGateset, confidenceRegionInfo)\u001b[0m\n\u001b[1;32m    477\u001b[0m         \"\"\"\n\u001b[1;32m    478\u001b[0m         super(GatesVsTargetTable,self).__init__(ws, self._create, gateset,\n\u001b[0;32m--> 479\u001b[0;31m                                                 targetGateset, confidenceRegionInfo)\n\u001b[0m\u001b[1;32m    480\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    481\u001b[0m     \u001b[0;32mdef\u001b[0m \u001b[0m_create\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtargetGateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfidenceRegionInfo\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspace.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, ws, fn, *args)\u001b[0m\n\u001b[1;32m   1521\u001b[0m         \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minitargs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0margs\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1522\u001b[0m         \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtables\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mswitchboards\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msbSwitchIndices\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mswitchpos_map\u001b[0m \u001b[0;34m=\u001b[0m\u001b[0;31m \u001b[0m\u001b[0;31m\\\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1523\u001b[0;31m             \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mws\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mswitchedCompute\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtablefn\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minitargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   1524\u001b[0m         \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0moptions\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m{\u001b[0m \u001b[0;34m'click_to_display'\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;32mFalse\u001b[0m \u001b[0;34m}\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1525\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspace.py\u001b[0m in \u001b[0;36mswitchedCompute\u001b[0;34m(self, fn, *args)\u001b[0m\n\u001b[1;32m    610\u001b[0m                     \u001b[0mkey\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"NA\"\u001b[0m\u001b[0;34m;\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mv\u001b[0m\u001b[0;34m;\u001b[0m \u001b[0;32mbreak\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    611\u001b[0m             \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 612\u001b[0;31m                 \u001b[0mkey\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msmartCache\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcached_compute\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfn\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0margVals\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    613\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    614\u001b[0m             \u001b[0;32mif\u001b[0m \u001b[0mkey\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mstoredKeys\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0mkey\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'INEFFECTIVE'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/smartcache.py\u001b[0m in \u001b[0;36mcached_compute\u001b[0;34m(self, fn, argVals, kwargs)\u001b[0m\n\u001b[1;32m    177\u001b[0m                 \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtypesigs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname_key\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtypesig\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    178\u001b[0m                 \u001b[0;32mwith\u001b[0m \u001b[0m_timed_block\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'call'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtimes\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 179\u001b[0;31m                     \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcache\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margVals\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    180\u001b[0m                 \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmisses\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m+=\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    181\u001b[0m                 \u001b[0mhashtime\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtimes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'hash'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspacetables.py\u001b[0m in \u001b[0;36m_create\u001b[0;34m(self, gateset, targetGateset, confidenceRegionInfo)\u001b[0m\n\u001b[1;32m    486\u001b[0m         \u001b[0mformatters\u001b[0m  \u001b[0;34m=\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m'Conversion'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m'Conversion'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m'Conversion'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# ,'Conversion'\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    487\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 488\u001b[0;31m         \u001b[0minfidelities\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0m_reportables\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mprocess_infidelity\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtargetGateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfidenceRegionInfo\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mgl\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mgateLabels\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    489\u001b[0m         \u001b[0mjt_diffs\u001b[0m     \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0m_reportables\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjt_diff\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtargetGateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfidenceRegionInfo\u001b[0m\u001b[0;34m)\u001b[0m            \u001b[0;32mfor\u001b[0m \u001b[0mgl\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mgateLabels\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    490\u001b[0m         \u001b[0mdnorms\u001b[0m       \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0m_reportables\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhalf_diamond_norm\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtargetGateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfidenceRegionInfo\u001b[0m\u001b[0;34m)\u001b[0m  \u001b[0;32mfor\u001b[0m \u001b[0mgl\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mgateLabels\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspacetables.py\u001b[0m in \u001b[0;36m<listcomp>\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m    486\u001b[0m         \u001b[0mformatters\u001b[0m  \u001b[0;34m=\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m'Conversion'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m'Conversion'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m'Conversion'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# ,'Conversion'\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    487\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 488\u001b[0;31m         \u001b[0minfidelities\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0m_reportables\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mprocess_infidelity\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtargetGateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfidenceRegionInfo\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mgl\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mgateLabels\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    489\u001b[0m         \u001b[0mjt_diffs\u001b[0m     \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0m_reportables\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjt_diff\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtargetGateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfidenceRegionInfo\u001b[0m\u001b[0;34m)\u001b[0m            \u001b[0;32mfor\u001b[0m \u001b[0mgl\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mgateLabels\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    490\u001b[0m         \u001b[0mdnorms\u001b[0m       \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0m_reportables\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhalf_diamond_norm\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtargetGateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfidenceRegionInfo\u001b[0m\u001b[0;34m)\u001b[0m  \u001b[0;32mfor\u001b[0m \u001b[0mgl\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mgateLabels\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/smartcache.py\u001b[0m in \u001b[0;36mcacher\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m    312\u001b[0m     \u001b[0;34m@\u001b[0m\u001b[0m_functools\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwraps\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mobj\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    313\u001b[0m     \u001b[0;32mdef\u001b[0m \u001b[0mcacher\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 314\u001b[0;31m         \u001b[0mk\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mv\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcache\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcached_compute\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mobj\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    315\u001b[0m         \u001b[0;32mreturn\u001b[0m \u001b[0mv\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    316\u001b[0m     \u001b[0;32mreturn\u001b[0m \u001b[0mcacher\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/smartcache.py\u001b[0m in \u001b[0;36mcached_compute\u001b[0;34m(self, fn, argVals, kwargs)\u001b[0m\n\u001b[1;32m    177\u001b[0m                 \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtypesigs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname_key\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtypesig\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    178\u001b[0m                 \u001b[0;32mwith\u001b[0m \u001b[0m_timed_block\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'call'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtimes\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 179\u001b[0;31m                     \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcache\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margVals\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    180\u001b[0m                 \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmisses\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m+=\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    181\u001b[0m                 \u001b[0mhashtime\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtimes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'hash'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/reportables.py\u001b[0m in \u001b[0;36mcompute_quantity\u001b[0;34m(gatesetA, gatesetB, gateLabel, confidenceRegionInfo)\u001b[0m\n\u001b[1;32m    749\u001b[0m         \u001b[0mB\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mgatesetB\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgates\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mgateLabel\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    750\u001b[0m         \u001b[0;32mif\u001b[0m \u001b[0mconfidenceRegionInfo\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;31m# No Error bars\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 751\u001b[0;31m             \u001b[0;32mreturn\u001b[0m \u001b[0mReportableQty\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfnOfGates\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mA\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mB\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmxBasis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    752\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    753\u001b[0m         \u001b[0;31m# make sure the gateset we're given is the one used to generate the confidence region\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/reportables.py\u001b[0m in \u001b[0;36mprocess_infidelity\u001b[0;34m(A, B, mxBasis)\u001b[0m\n\u001b[1;32m    769\u001b[0m \u001b[0;34m@\u001b[0m\u001b[0mgates_quantity\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# This function changes arguments to (gatesetA, gatesetB, gateLabel, confidenceRegionInfo)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    770\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mprocess_infidelity\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mA\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mB\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmxBasis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 771\u001b[0;31m     \u001b[0;32mreturn\u001b[0m \u001b[0;36m1\u001b[0m \u001b[0;34m-\u001b[0m \u001b[0m_tools\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mprocess_fidelity\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mA\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mB\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmxBasis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    772\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    773\u001b[0m \u001b[0;34m@\u001b[0m\u001b[0mgates_quantity\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# This function changes arguments to (gatesetA, gatesetB, gateLabel, confidenceRegionInfo)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/gatetools.py\u001b[0m in \u001b[0;36mprocess_fidelity\u001b[0;34m(A, B, mxBasis)\u001b[0m\n\u001b[1;32m    343\u001b[0m     \u001b[0;32mif\u001b[0m \u001b[0mmxBasis\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    344\u001b[0m         \u001b[0mmxBasis\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_basis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mBasis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'gm'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mround\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m_np\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msqrt\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mA\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 345\u001b[0;31m     \u001b[0mJA\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_jam\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjamiolkowski_iso\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mA\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmxBasis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    346\u001b[0m     \u001b[0mJB\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_jam\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjamiolkowski_iso\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mB\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmxBasis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    347\u001b[0m     \u001b[0;32mreturn\u001b[0m \u001b[0mfidelity\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mJA\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mJB\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/jamiolkowski.py\u001b[0m in \u001b[0;36mjamiolkowski_iso\u001b[0;34m(gateMx, gateMxBasis, choiMxBasis)\u001b[0m\n\u001b[1;32m     85\u001b[0m     \u001b[0mgateMxBasis\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mchoiMxBasis\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_basis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbuild_basis_pair\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgateMx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgateMxBasis\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mchoiMxBasis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     86\u001b[0m     \u001b[0mgateMx\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_np\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0masarray\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgateMx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 87\u001b[0;31m     \u001b[0mgateMxInStdBasis\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_basis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mchange_basis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgateMx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgateMxBasis\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgateMxBasis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstd_equivalent\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m     88\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     89\u001b[0m     \u001b[0;31m#expand gate matrix so it acts on entire space of dmDim x dmDim density matrices\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/basis.py\u001b[0m in \u001b[0;36mchange_basis\u001b[0;34m(mx, from_basis, to_basis, dimOrBlockDims, resize)\u001b[0m\n\u001b[1;32m    430\u001b[0m     \u001b[0misMx\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmx\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;36m2\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0mmx\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0mmx\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    431\u001b[0m     \u001b[0;32mif\u001b[0m \u001b[0misMx\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 432\u001b[0;31m         \u001b[0mret\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_np\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtoMx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m_np\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfromMx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    433\u001b[0m     \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;31m# isVec\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    434\u001b[0m         \u001b[0mret\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_np\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtoMx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mValueError\u001b[0m: shapes (4,4) and (0,0) not aligned: 4 (dim 1) != 0 (dim 0)"
     ]
    }
   ],
   "source": [
    "\n",
    "ws.GatesVsTargetTable(gs_final, gs_target, cri)\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### Comparison of GST estimated SPAM to target SPAM.\n",
    "This table presents, for each state preparation and POVM effect, two different measures of distance or discrepancy from the GST estimate to the ideal target operation.  See text for more detail.\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Matrix is singular and may not have a square root.\n"
     ]
    },
    {
     "ename": "AssertionError",
     "evalue": "",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mAssertionError\u001b[0m                            Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-18-2c9b60b5fda5>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mws\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mSpamVsTargetTable\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgs_final\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgs_target\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcri\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      3\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m<string>\u001b[0m in \u001b[0;36mfactoryfn\u001b[0;34m(gateset, targetGateset, confidenceRegionInfo)\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspacetables.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, ws, gateset, targetGateset, confidenceRegionInfo)\u001b[0m\n\u001b[1;32m    522\u001b[0m         \"\"\"\n\u001b[1;32m    523\u001b[0m         super(SpamVsTargetTable,self).__init__(ws, self._create, gateset,\n\u001b[0;32m--> 524\u001b[0;31m                                                targetGateset, confidenceRegionInfo)\n\u001b[0m\u001b[1;32m    525\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    526\u001b[0m     \u001b[0;32mdef\u001b[0m \u001b[0m_create\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtargetGateset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfidenceRegionInfo\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspace.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, ws, fn, *args)\u001b[0m\n\u001b[1;32m   1521\u001b[0m         \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minitargs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0margs\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1522\u001b[0m         \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtables\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mswitchboards\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msbSwitchIndices\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mswitchpos_map\u001b[0m \u001b[0;34m=\u001b[0m\u001b[0;31m \u001b[0m\u001b[0;31m\\\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1523\u001b[0;31m             \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mws\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mswitchedCompute\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtablefn\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minitargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   1524\u001b[0m         \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0moptions\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m{\u001b[0m \u001b[0;34m'click_to_display'\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;32mFalse\u001b[0m \u001b[0;34m}\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1525\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspace.py\u001b[0m in \u001b[0;36mswitchedCompute\u001b[0;34m(self, fn, *args)\u001b[0m\n\u001b[1;32m    610\u001b[0m                     \u001b[0mkey\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"NA\"\u001b[0m\u001b[0;34m;\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mv\u001b[0m\u001b[0;34m;\u001b[0m \u001b[0;32mbreak\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    611\u001b[0m             \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 612\u001b[0;31m                 \u001b[0mkey\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msmartCache\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcached_compute\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfn\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0margVals\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    613\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    614\u001b[0m             \u001b[0;32mif\u001b[0m \u001b[0mkey\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mstoredKeys\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0mkey\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'INEFFECTIVE'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/smartcache.py\u001b[0m in \u001b[0;36mcached_compute\u001b[0;34m(self, fn, argVals, kwargs)\u001b[0m\n\u001b[1;32m    177\u001b[0m                 \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtypesigs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname_key\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtypesig\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    178\u001b[0m                 \u001b[0;32mwith\u001b[0m \u001b[0m_timed_block\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'call'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtimes\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 179\u001b[0;31m                     \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcache\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margVals\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    180\u001b[0m                 \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmisses\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m+=\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    181\u001b[0m                 \u001b[0mhashtime\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtimes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'hash'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspacetables.py\u001b[0m in \u001b[0;36m_create\u001b[0;34m(self, gateset, targetGateset, confidenceRegionInfo)\u001b[0m\n\u001b[1;32m    537\u001b[0m         prepInfidelities = [_reportables.vec_infidelity(gateset, targetGateset, l, \n\u001b[1;32m    538\u001b[0m                                                         'prep', confidenceRegionInfo)\n\u001b[0;32m--> 539\u001b[0;31m                             for l in prepLabels]\n\u001b[0m\u001b[1;32m    540\u001b[0m         prepTraceDists   = [_reportables.vec_tr_diff(gateset, targetGateset, l, \n\u001b[1;32m    541\u001b[0m                                                         'prep', confidenceRegionInfo)\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspacetables.py\u001b[0m in \u001b[0;36m<listcomp>\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m    537\u001b[0m         prepInfidelities = [_reportables.vec_infidelity(gateset, targetGateset, l, \n\u001b[1;32m    538\u001b[0m                                                         'prep', confidenceRegionInfo)\n\u001b[0;32m--> 539\u001b[0;31m                             for l in prepLabels]\n\u001b[0m\u001b[1;32m    540\u001b[0m         prepTraceDists   = [_reportables.vec_tr_diff(gateset, targetGateset, l, \n\u001b[1;32m    541\u001b[0m                                                         'prep', confidenceRegionInfo)\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/smartcache.py\u001b[0m in \u001b[0;36mcacher\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m    312\u001b[0m     \u001b[0;34m@\u001b[0m\u001b[0m_functools\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwraps\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mobj\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    313\u001b[0m     \u001b[0;32mdef\u001b[0m \u001b[0mcacher\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 314\u001b[0;31m         \u001b[0mk\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mv\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcache\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcached_compute\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mobj\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    315\u001b[0m         \u001b[0;32mreturn\u001b[0m \u001b[0mv\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    316\u001b[0m     \u001b[0;32mreturn\u001b[0m \u001b[0mcacher\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/smartcache.py\u001b[0m in \u001b[0;36mcached_compute\u001b[0;34m(self, fn, argVals, kwargs)\u001b[0m\n\u001b[1;32m    177\u001b[0m                 \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtypesigs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname_key\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtypesig\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    178\u001b[0m                 \u001b[0;32mwith\u001b[0m \u001b[0m_timed_block\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'call'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtimes\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 179\u001b[0;31m                     \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcache\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margVals\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    180\u001b[0m                 \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmisses\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m+=\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    181\u001b[0m                 \u001b[0mhashtime\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtimes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'hash'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/reportables.py\u001b[0m in \u001b[0;36mcompute_quantity\u001b[0;34m(gatesetA, gatesetB, label, typ, confidenceRegionInfo)\u001b[0m\n\u001b[1;32m    855\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    856\u001b[0m         \u001b[0;32mif\u001b[0m \u001b[0mconfidenceRegionInfo\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;31m# No Error bars\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 857\u001b[0;31m             \u001b[0;32mreturn\u001b[0m \u001b[0mReportableQty\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfnOfVectors\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mA\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mB\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmxBasis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    858\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    859\u001b[0m         \u001b[0;31m# make sure the gateset we're given is the one used to generate the confidence region\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/reportables.py\u001b[0m in \u001b[0;36mvec_infidelity\u001b[0;34m(A, B, mxBasis)\u001b[0m\n\u001b[1;32m    885\u001b[0m     \u001b[0mrhoMx1\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_tools\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvec_to_stdmx\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mA\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmxBasis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    886\u001b[0m     \u001b[0mrhoMx2\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_tools\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvec_to_stdmx\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mB\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmxBasis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 887\u001b[0;31m     \u001b[0;32mreturn\u001b[0m \u001b[0;36m1\u001b[0m \u001b[0;34m-\u001b[0m \u001b[0m_tools\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfidelity\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mrhoMx1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrhoMx2\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    888\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    889\u001b[0m \u001b[0;34m@\u001b[0m\u001b[0mvectors_quantity\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# This function changes arguments to (gatsetA, gatesetB, label, typ, confidenceRegionInfo)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/gatetools.py\u001b[0m in \u001b[0;36mfidelity\u001b[0;34m(A, B)\u001b[0m\n\u001b[1;32m     62\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     63\u001b[0m     \u001b[0msqrtA\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_hack_sqrtm\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mA\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m#_spl.sqrtm(A)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 64\u001b[0;31m     \u001b[0;32massert\u001b[0m\u001b[0;34m(\u001b[0m \u001b[0m_np\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlinalg\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnorm\u001b[0m\u001b[0;34m(\u001b[0m \u001b[0m_np\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msqrtA\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0msqrtA\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m-\u001b[0m \u001b[0mA\u001b[0m \u001b[0;34m)\u001b[0m \u001b[0;34m<\u001b[0m \u001b[0;36m1e-8\u001b[0m \u001b[0;34m)\u001b[0m \u001b[0;31m#test the scipy sqrtm function\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m     65\u001b[0m     \u001b[0mF\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0m_mt\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrace\u001b[0m\u001b[0;34m(\u001b[0m \u001b[0m_hack_sqrtm\u001b[0m\u001b[0;34m(\u001b[0m \u001b[0m_np\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdot\u001b[0m\u001b[0;34m(\u001b[0m \u001b[0msqrtA\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m_np\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mB\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msqrtA\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m)\u001b[0m \u001b[0;34m)\u001b[0m \u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mreal\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0;36m2\u001b[0m \u001b[0;31m# Tr( sqrt{ sqrt(A) * B * sqrt(A) } )^2\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     66\u001b[0m     \u001b[0;32mreturn\u001b[0m \u001b[0mF\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mAssertionError\u001b[0m: "
     ]
    }
   ],
   "source": [
    "\n",
    "ws.SpamVsTargetTable(gs_final, gs_target, cri)\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### The GST estimate of the logic gate operations.\n",
    "Compares the *ideal* (generally unitary) logic gates (second column, also in targetGatesetTable) with those *estimated* by GST (third column).  Each gate is represented as a $d^2\\times d^2$ *superoperator* that acts by matrix multiplication on vectors in $\\mathcal{B}(\\mathcal{H})$.  Matrices are displayed using a heat map that ranges between 1.0 (red) and -1.0 (blue).  Note that it is impossible to discern even order-1%% deviations from the ideal using this color scale, and one should rely on other analysis for more a precise comparison.\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'switchBd' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-19-36c3f316c909>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m ws.GatesTable(switchBd.gsTargetAndFinal,\n\u001b[0m\u001b[1;32m      3\u001b[0m               ['Target','Estimated'], \"boxes\", cri)\n",
      "\u001b[0;31mNameError\u001b[0m: name 'switchBd' is not defined"
     ]
    }
   ],
   "source": [
    "\n",
    "ws.GatesTable(switchBd.gsTargetAndFinal,\n",
    "              ['Target','Estimated'], \"boxes\", cri)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "# Dataset comparisons\n",
    "This report contains information for more than one data set.  This page shows comparisons between different data sets.\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### Histogram of p-values comparing two data sets. \n",
    "Each gate sequence is assigned a p-value based on how consistent that sequence's counts are between the two selected data sets.  The line shows what would be expected for perfectly consistent data.\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'dscmp_switchBd' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-20-1a6bd038ebbb>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mws\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mDatasetComparisonPlot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdscmp_switchBd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdscmp\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      3\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mNameError\u001b[0m: name 'dscmp_switchBd' is not defined"
     ]
    }
   ],
   "source": [
    "\n",
    "ws.DatasetComparisonPlot(dscmp_switchBd.dscmp)\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "# Per-sequence $2\\Delta\\log(\\mathcal{L})$ values comparing two data sets.\n",
    "In a similar fashion to other color box plots, this plot shows two times the log-likelihood-ratio for each gate sequence corresponding to how consistent that sequences' counts are between the two selected data sets.  The likelihood ratio is between a models that supposes there is either one or two separate probability distributions from which the data counts are drawn.\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'dscmp_switchBd' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-21-db3165bbd365>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m ws.ColorBoxPlot('dscmp', dscmp_switchBd.dscmp_gs_final,\n\u001b[0m\u001b[1;32m      3\u001b[0m                 None, None, dscomparator=dscmp_switchBd.dscmp)\n",
      "\u001b[0;31mNameError\u001b[0m: name 'dscmp_switchBd' is not defined"
     ]
    }
   ],
   "source": [
    "\n",
    "ws.ColorBoxPlot('dscmp', dscmp_switchBd.dscmp_gs_final,\n",
    "                None, None, dscomparator=dscmp_switchBd.dscmp)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "# Input Summary\n",
    "Information pertaining to the target gate set and data set.\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### Target gate set: SPAM (state preparation and measurement).\n",
    "The *ideal* input state ($\\rho_0$) and `plus' POVM effect $E_0$ for the device on which we report.  SPAM gates are given here as $d\\times d$ matrices.\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "require(['jquery','jquery-UI','plotly'],function($,ui,Plotly) {require(['jquery','jquery-UI','plotly','autorender'],function($,ui,Plotly,renderMathInElement) {\n",
       "  $(document).ready(function() {\n",
       "var switchmap_table_2431 = new Array();\n",
       "switchmap_table_2431[ [] ] = 'table_2431_0';\n",
       "window.switchmap_table_2431 = switchmap_table_2431;\n",
       "\n",
       "function connect_table_2431_to_switches(){  if(true) {    console.log('Switches initialized: table_2431 handlers set');\n",
       "    $( '#table_2431' ).show()\n",
       "  }\n",
       "  else {\n",
       "    setTimeout(connect_table_2431_to_switches, 500);\n",
       "    console.log('table_2431 switches NOT initialized: Waiting...');\n",
       "  }\n",
       "};\n",
       "$(document).ready(function() {\n",
       "  connect_table_2431_to_switches();\n",
       "});\n",
       "\n",
       "  plotman.enqueue(function() { \n",
       "    renderMathInElement(document.getElementById(\"table_2431\"), { delimiters: [\n",
       "             {left: \"$$\", right: \"$$\", display: true},\n",
       "             {left: \"$\", right: \"$\", display: false},\n",
       "             ] } );\n",
       "    make_wstable_resizable(\"table_2431\");\n",
       "    trigger_wstable_plot_creation(\"table_2431\");\n",
       "  }, \"Rendering math in table_2431\" );\n",
       "}); //end on-ready handler\n",
       "}); //end require block\n",
       " });</script><div id='table_2431' class='pygsti-wsoutput-group'>\n",
       "<div class='single_switched_value' id='table_2431_0'>\n",
       "<table class=\"dataTable\" id=\"table_2431_0_tbl\"><thead><tr><th> <span title=\"Operator\">Operator</span> </th><th> <span title=\"Matrix\">Matrix</span> </th><th> <span title=\"Eigenvals\">Eigenvals</span> </th></tr></thead><tbody><tr><td><span title=\"rho0\">&rho;<sub>0</sub></span></td><td><span title=\"[[ 1.+0.j  0.+0.j]\n",
       " [ 0.+0.j  0.+0.j]]\">$ \\begin{pmatrix}\n",
       "1 & 0 \\\\ \n",
       "0 & 0\n",
       " \\end{pmatrix} $\n",
       "</span></td><td><span title=\"[ 1.+0.j  0.+0.j]\">$ \\begin{pmatrix}\n",
       "1 \\\\ \n",
       "0\n",
       " \\end{pmatrix} $\n",
       "</span></td></tr><tr><td><span title=\"E0\">E<sub>0</sub></span></td><td><span title=\"[[ 0.+0.j  0.+0.j]\n",
       " [ 0.+0.j  1.+0.j]]\">$ \\begin{pmatrix}\n",
       "0 & 0 \\\\ \n",
       "0 & 1\n",
       " \\end{pmatrix} $\n",
       "</span></td><td><span title=\"[ 0.+0.j  1.+0.j]\">$ \\begin{pmatrix}\n",
       "0 \\\\ \n",
       "1\n",
       " \\end{pmatrix} $\n",
       "</span></td></tr></tbody></table>\n",
       "</div>\n",
       "\n",
       "</div>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "<pygsti.report.workspacetables.SpamTable at 0x7f13b6b56208>"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "ws.SpamTable(gs_target, None, includeHSVec=False)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### Fiducial sequences.\n",
    "A list of the preparation and measurement <q>fiducial</q> gate sequences. See discussion in text.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'strs' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-23-857890282a45>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mws\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mGatestringTable\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mstrs\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"Prep.\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\"Measure\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcommonTitle\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"Fiducials\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      3\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mNameError\u001b[0m: name 'strs' is not defined"
     ]
    }
   ],
   "source": [
    " \n",
    "ws.GatestringTable(strs,[\"Prep.\",\"Measure\"], commonTitle=\"Fiducials\")\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### Germ sequences.\n",
    "A list of the <q>germ</q> gate sequences.  See discussion in text.\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'germs' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-24-e67eb0fe9596>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mws\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mGatestringTable\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgerms\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"Germ\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnCols\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      3\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mNameError\u001b[0m: name 'germs' is not defined"
     ]
    }
   ],
   "source": [
    "\n",
    "ws.GatestringTable(germs, \"Germ\", nCols=2)\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### General dataset properties.\n",
    "See discussion in text.\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "require(['jquery','jquery-UI','plotly'],function($,ui,Plotly) {require(['jquery','jquery-UI','plotly','autorender'],function($,ui,Plotly,renderMathInElement) {\n",
       "  $(document).ready(function() {\n",
       "var switchmap_table_5890 = new Array();\n",
       "switchmap_table_5890[ [] ] = 'table_5890_0';\n",
       "window.switchmap_table_5890 = switchmap_table_5890;\n",
       "\n",
       "function connect_table_5890_to_switches(){  if(true) {    console.log('Switches initialized: table_5890 handlers set');\n",
       "    $( '#table_5890' ).show()\n",
       "  }\n",
       "  else {\n",
       "    setTimeout(connect_table_5890_to_switches, 500);\n",
       "    console.log('table_5890 switches NOT initialized: Waiting...');\n",
       "  }\n",
       "};\n",
       "$(document).ready(function() {\n",
       "  connect_table_5890_to_switches();\n",
       "});\n",
       "\n",
       "    make_wstable_resizable(\"table_5890\");\n",
       "    trigger_wstable_plot_creation(\"table_5890\");\n",
       "}); //end on-ready handler\n",
       "}); //end require block\n",
       " });</script><div id='table_5890' class='pygsti-wsoutput-group'>\n",
       "<div class='single_switched_value' id='table_5890_0'>\n",
       "<table class=\"dataTable\" id=\"table_5890_0_tbl\"><thead><tr><th> <span title=\"Quantity\">Quantity</span> </th><th> <span title=\"Value\">Value</span> </th></tr></thead><tbody><tr><td><span title=\"Number of strings\">Number of strings</span></td><td><span title=\"817\">817</span></td></tr><tr><td><span title=\"Gate labels\">Gate labels</span></td><td><span title=\"Gx, Gy, Gi\">Gx, Gy, Gi</span></td></tr><tr><td><span title=\"SPAM labels\">SPAM labels</span></td><td><span title=\"minus, plus\">minus, plus</span></td></tr><tr><td><span title=\"Counts per string\">Counts per string</span></td><td><span title=\"1000\">1000</span></td></tr></tbody></table>\n",
       "</div>\n",
       "\n",
       "</div>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "<pygsti.report.workspacetables.DataSetOverviewTable at 0x7f13b6b56be0>"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "ws.DataSetOverviewTable(ds)\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### Target gate set: logic gates.\n",
    "The *ideal* (generally unitary) logic gates.  Each has a name starting with <q>G</q>, and is represented as a $d^2\\times d^2$ *superoperator* that acts by matrix multiplication on vectors in $\\mathcal{B}(\\mathcal{H})$.  Matrices are displayed using a heat map that ranges between 1.0 (red) and -1.0 (blue).\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "require(['jquery','jquery-UI','plotly'],function($,ui,Plotly) {require(['jquery','jquery-UI','plotly','autorender'],function($,ui,Plotly,renderMathInElement) {\n",
       "  $(document).ready(function() {\n",
       "  $(\"#55238c3a-a1ab-4abc-8800-a9a055d38ec8\").addClass(\"pygsti-plotgroup-master\");\n",
       "  $(\"#55238c3a-a1ab-4abc-8800-a9a055d38ec8\").on(\"init\", function(event) {\n",
       "    pex_init_plotdiv($(\"#55238c3a-a1ab-4abc-8800-a9a055d38ec8\"), 218.75, 218.75);\n",
       "    pex_init_slaves($(\"#55238c3a-a1ab-4abc-8800-a9a055d38ec8\"));\n",
       "    console.log(\"Initialized 55238c3a-a1ab-4abc-8800-a9a055d38ec8\");\n",
       "  });\n",
       "  $(\"#55238c3a-a1ab-4abc-8800-a9a055d38ec8\").on(\"click.pygsti\", function(event) {\n",
       "     plotman.enqueue(function() { \n",
       "        \n",
       "     }, \"Click-creating Plot 55238c3a-a1ab-4abc-8800-a9a055d38ec8\" );\n",
       "     $(\"#55238c3a-a1ab-4abc-8800-a9a055d38ec8\").off(\"click.pygsti\");\n",
       "     console.log(\"Click-Created 55238c3a-a1ab-4abc-8800-a9a055d38ec8\");\n",
       "  });\n",
       "  $(\"#55238c3a-a1ab-4abc-8800-a9a055d38ec8\").on(\"create\", function(event, fracw, frach) {\n",
       "     pex_update_plotdiv_size($(\"#55238c3a-a1ab-4abc-8800-a9a055d38ec8\"), 1.0, fracw, frach, 218.75, 218.75);\n",
       "     plotman.enqueue(function() { \n",
       "       $(\"#55238c3a-a1ab-4abc-8800-a9a055d38ec8\").addClass(\"pygBackground\");\n",
       "       window.PLOTLYENV=window.PLOTLYENV || {};window.PLOTLYENV.BASE_URL=\"https://plot.ly\";Plotly.newPlot(\"55238c3a-a1ab-4abc-8800-a9a055d38ec8\", [{\"hoverinfo\": \"text\", \"type\": \"heatmap\", \"text\": [[\"0.0\", \"0.0\", \"0.0\", \"1.0\"], [\"0.0\", \"0.0\", \"1.0\", \"0.0\"], [\"0.0\", \"1.0\", \"0.0\", \"0.0\"], [\"1.0\", \"0.0\", \"0.0\", \"0.0\"]], \"colorscale\": [[0.0, \"rgb(0,0,255)\"], [0.5, \"rgb(255,255,255)\"], [1.0, \"rgb(255,0,0)\"]], \"showscale\": false, \"zmin\": -1.0, \"z\": [[0.0, 0.0, 0.0, 1.0], [0.0, 0.0, 1.0, 0.0], [0.0, 1.0, 0.0, 0.0], [1.0, 0.0, 0.0, 0.0]], \"zmax\": 1.0}], {\"annotations\": [], \"shapes\": [{\"type\": \"line\", \"y1\": 3.5, \"y0\": -0.5, \"x0\": 0.5, \"line\": {\"color\": \"black\", \"width\": 1}, \"x1\": 0.5}, {\"type\": \"line\", \"y1\": 3.5, \"y0\": -0.5, \"x0\": 1.5, \"line\": {\"color\": \"black\", \"width\": 1}, \"x1\": 1.5}, {\"type\": \"line\", \"y1\": 3.5, \"y0\": -0.5, \"x0\": 2.5, \"line\": {\"color\": \"black\", \"width\": 1}, \"x1\": 2.5}, {\"type\": \"line\", \"y1\": 0.5, \"y0\": 0.5, \"x0\": -0.5, \"line\": {\"color\": \"black\", \"width\": 1}, \"x1\": 3.5}, {\"type\": \"line\", \"y1\": 1.5, \"y0\": 1.5, \"x0\": -0.5, \"line\": {\"color\": \"black\", \"width\": 1}, \"x1\": 3.5}, {\"type\": \"line\", \"y1\": 2.5, \"y0\": 2.5, \"x0\": -0.5, \"line\": {\"color\": \"black\", \"width\": 1}, \"x1\": 3.5}], \"margin\": {\"r\": 50, \"t\": 50, \"l\": 50, \"b\": 50}, \"xaxis\": {\"range\": [-0.5, 3.5], \"mirror\": true, \"side\": \"top\", \"tickvals\": [0, 1, 2, 3], \"ticks\": \"\", \"showline\": true, \"zeroline\": false, \"showticklabels\": true, \"tickangle\": -90, \"linewidth\": 2, \"ticktext\": [\"<i>I^{(0)}</i>\", \"<i>X^{(0)}_{0,1}</i>\", \"<i>Y^{(0)}_{0,1}</i>\", \"<i>Z^{(0)}_{1}</i>\"], \"showgrid\": false, \"title\": null}, \"yaxis\": {\"range\": [-0.5, 3.5], \"mirror\": true, \"title\": null, \"ticktext\": [\"<i>Z^{(0)}_{1}</i>\", \"<i>Y^{(0)}_{0,1}</i>\", \"<i>X^{(0)}_{0,1}</i>\", \"<i>I^{(0)}</i>\"], \"tickvals\": [0, 1, 2, 3], \"ticks\": \"\", \"zeroline\": false, \"showticklabels\": true, \"side\": \"left\", \"linewidth\": 2, \"showline\": true, \"showgrid\": false}}, {\"showLink\": false, \"linkText\": \"Export to plot.ly\"}) \n",
       "       pex_create_slaves($(\"#55238c3a-a1ab-4abc-8800-a9a055d38ec8\"), 218.75, 218.75);\n",
       "     }, \"Creating Plot 55238c3a-a1ab-4abc-8800-a9a055d38ec8\" );\n",
       "     console.log(\"Created 55238c3a-a1ab-4abc-8800-a9a055d38ec8\");\n",
       "  });\n",
       "  $(\"#55238c3a-a1ab-4abc-8800-a9a055d38ec8\").on(\"resize\", function(event,fracw,frach) {\n",
       "    pex_update_plotdiv_size($(\"#55238c3a-a1ab-4abc-8800-a9a055d38ec8\"), 1.0, fracw, frach, 218.75, 218.75);\n",
       "    plotman.enqueue(function() { \n",
       "        Plotly.Plots.resize(document.getElementById(\"55238c3a-a1ab-4abc-8800-a9a055d38ec8\")); \n",
       "      pex_resize_slaves($(\"#55238c3a-a1ab-4abc-8800-a9a055d38ec8\"), 218.75, 218.75);\n",
       "     }, \"Resizing Plot 55238c3a-a1ab-4abc-8800-a9a055d38ec8\" );\n",
       "    //console.log(\"Resized 55238c3a-a1ab-4abc-8800-a9a055d38ec8\");\n",
       "  });\n",
       "var switchmap_plot_2016 = new Array();\n",
       "switchmap_plot_2016[ [] ] = '55238c3a-a1ab-4abc-8800-a9a055d38ec8';\n",
       "window.switchmap_plot_2016 = switchmap_plot_2016;\n",
       "\n",
       "function connect_plot_2016_to_switches(){  if(true) {    console.log('Switches initialized: plot_2016 handlers set');\n",
       "    $( '#plot_2016' ).show()\n",
       "  }\n",
       "  else {\n",
       "    setTimeout(connect_plot_2016_to_switches, 500);\n",
       "    console.log('plot_2016 switches NOT initialized: Waiting...');\n",
       "  }\n",
       "};\n",
       "$(document).ready(function() {\n",
       "  connect_plot_2016_to_switches();\n",
       "});\n",
       "\n",
       "\n",
       "  $(\"#f08c5951-59c0-4d06-8274-e83267de1fda\").addClass(\"pygsti-plotgroup-master\");\n",
       "  $(\"#f08c5951-59c0-4d06-8274-e83267de1fda\").on(\"init\", function(event) {\n",
       "    pex_init_plotdiv($(\"#f08c5951-59c0-4d06-8274-e83267de1fda\"), 218.75, 218.75);\n",
       "    pex_init_slaves($(\"#f08c5951-59c0-4d06-8274-e83267de1fda\"));\n",
       "    console.log(\"Initialized f08c5951-59c0-4d06-8274-e83267de1fda\");\n",
       "  });\n",
       "  $(\"#f08c5951-59c0-4d06-8274-e83267de1fda\").on(\"click.pygsti\", function(event) {\n",
       "     plotman.enqueue(function() { \n",
       "        \n",
       "     }, \"Click-creating Plot f08c5951-59c0-4d06-8274-e83267de1fda\" );\n",
       "     $(\"#f08c5951-59c0-4d06-8274-e83267de1fda\").off(\"click.pygsti\");\n",
       "     console.log(\"Click-Created f08c5951-59c0-4d06-8274-e83267de1fda\");\n",
       "  });\n",
       "  $(\"#f08c5951-59c0-4d06-8274-e83267de1fda\").on(\"create\", function(event, fracw, frach) {\n",
       "     pex_update_plotdiv_size($(\"#f08c5951-59c0-4d06-8274-e83267de1fda\"), 1.0, fracw, frach, 218.75, 218.75);\n",
       "     plotman.enqueue(function() { \n",
       "       $(\"#f08c5951-59c0-4d06-8274-e83267de1fda\").addClass(\"pygBackground\");\n",
       "       window.PLOTLYENV=window.PLOTLYENV || {};window.PLOTLYENV.BASE_URL=\"https://plot.ly\";Plotly.newPlot(\"f08c5951-59c0-4d06-8274-e83267de1fda\", [{\"hoverinfo\": \"text\", \"type\": \"heatmap\", \"text\": [[\"1.11022302463e-16\", \"0.0\", \"1.0\", \"2.35513868803e-16\"], [\"7.85046229342e-17\", \"0.0\", \"2.35513868803e-16\", \"-1.0\"], [\"0.0\", \"1.0\", \"0.0\", \"0.0\"], [\"1.0\", \"0.0\", \"1.11022302463e-16\", \"-7.85046229342e-17\"]], \"colorscale\": [[0.0, \"rgb(0,0,255)\"], [0.5, \"rgb(255,255,255)\"], [1.0, \"rgb(255,0,0)\"]], \"showscale\": false, \"zmin\": -1.0, \"z\": [[1.1102230246251565e-16, 0.0, 0.9999999999999999, 2.355138688025663e-16], [7.850462293418876e-17, 0.0, 2.355138688025663e-16, -1.0], [0.0, 1.0, 0.0, 0.0], [0.9999999999999999, 0.0, 1.1102230246251565e-16, -7.850462293418876e-17]], \"zmax\": 1.0}], {\"annotations\": [], \"shapes\": [{\"type\": \"line\", \"y1\": 3.5, \"y0\": -0.5, \"x0\": 0.5, \"line\": {\"color\": \"black\", \"width\": 1}, \"x1\": 0.5}, {\"type\": \"line\", \"y1\": 3.5, \"y0\": -0.5, \"x0\": 1.5, \"line\": {\"color\": \"black\", \"width\": 1}, \"x1\": 1.5}, {\"type\": \"line\", \"y1\": 3.5, \"y0\": -0.5, \"x0\": 2.5, \"line\": {\"color\": \"black\", \"width\": 1}, \"x1\": 2.5}, {\"type\": \"line\", \"y1\": 0.5, \"y0\": 0.5, \"x0\": -0.5, \"line\": {\"color\": \"black\", \"width\": 1}, \"x1\": 3.5}, {\"type\": \"line\", \"y1\": 1.5, \"y0\": 1.5, \"x0\": -0.5, \"line\": {\"color\": \"black\", \"width\": 1}, \"x1\": 3.5}, {\"type\": \"line\", \"y1\": 2.5, \"y0\": 2.5, \"x0\": -0.5, \"line\": {\"color\": \"black\", \"width\": 1}, \"x1\": 3.5}], \"margin\": {\"r\": 50, \"t\": 50, \"l\": 50, \"b\": 50}, \"xaxis\": {\"range\": [-0.5, 3.5], \"mirror\": true, \"side\": \"top\", \"tickvals\": [0, 1, 2, 3], \"ticks\": \"\", \"showline\": true, \"zeroline\": false, \"showticklabels\": true, \"tickangle\": -90, \"linewidth\": 2, \"ticktext\": [\"<i>I^{(0)}</i>\", \"<i>X^{(0)}_{0,1}</i>\", \"<i>Y^{(0)}_{0,1}</i>\", \"<i>Z^{(0)}_{1}</i>\"], \"showgrid\": false, \"title\": null}, \"yaxis\": {\"range\": [-0.5, 3.5], \"mirror\": true, \"title\": null, \"ticktext\": [\"<i>Z^{(0)}_{1}</i>\", \"<i>Y^{(0)}_{0,1}</i>\", \"<i>X^{(0)}_{0,1}</i>\", \"<i>I^{(0)}</i>\"], \"tickvals\": [0, 1, 2, 3], \"ticks\": \"\", \"zeroline\": false, \"showticklabels\": true, \"side\": \"left\", \"linewidth\": 2, \"showline\": true, \"showgrid\": false}}, {\"showLink\": false, \"linkText\": \"Export to plot.ly\"}) \n",
       "       pex_create_slaves($(\"#f08c5951-59c0-4d06-8274-e83267de1fda\"), 218.75, 218.75);\n",
       "     }, \"Creating Plot f08c5951-59c0-4d06-8274-e83267de1fda\" );\n",
       "     console.log(\"Created f08c5951-59c0-4d06-8274-e83267de1fda\");\n",
       "  });\n",
       "  $(\"#f08c5951-59c0-4d06-8274-e83267de1fda\").on(\"resize\", function(event,fracw,frach) {\n",
       "    pex_update_plotdiv_size($(\"#f08c5951-59c0-4d06-8274-e83267de1fda\"), 1.0, fracw, frach, 218.75, 218.75);\n",
       "    plotman.enqueue(function() { \n",
       "        Plotly.Plots.resize(document.getElementById(\"f08c5951-59c0-4d06-8274-e83267de1fda\")); \n",
       "      pex_resize_slaves($(\"#f08c5951-59c0-4d06-8274-e83267de1fda\"), 218.75, 218.75);\n",
       "     }, \"Resizing Plot f08c5951-59c0-4d06-8274-e83267de1fda\" );\n",
       "    //console.log(\"Resized f08c5951-59c0-4d06-8274-e83267de1fda\");\n",
       "  });\n",
       "var switchmap_plot_5910 = new Array();\n",
       "switchmap_plot_5910[ [] ] = 'f08c5951-59c0-4d06-8274-e83267de1fda';\n",
       "window.switchmap_plot_5910 = switchmap_plot_5910;\n",
       "\n",
       "function connect_plot_5910_to_switches(){  if(true) {    console.log('Switches initialized: plot_5910 handlers set');\n",
       "    $( '#plot_5910' ).show()\n",
       "  }\n",
       "  else {\n",
       "    setTimeout(connect_plot_5910_to_switches, 500);\n",
       "    console.log('plot_5910 switches NOT initialized: Waiting...');\n",
       "  }\n",
       "};\n",
       "$(document).ready(function() {\n",
       "  connect_plot_5910_to_switches();\n",
       "});\n",
       "\n",
       "\n",
       "  $(\"#86dce702-d9bf-4671-a73a-c76c519bb7cd\").addClass(\"pygsti-plotgroup-master\");\n",
       "  $(\"#86dce702-d9bf-4671-a73a-c76c519bb7cd\").on(\"init\", function(event) {\n",
       "    pex_init_plotdiv($(\"#86dce702-d9bf-4671-a73a-c76c519bb7cd\"), 218.75, 218.75);\n",
       "    pex_init_slaves($(\"#86dce702-d9bf-4671-a73a-c76c519bb7cd\"));\n",
       "    console.log(\"Initialized 86dce702-d9bf-4671-a73a-c76c519bb7cd\");\n",
       "  });\n",
       "  $(\"#86dce702-d9bf-4671-a73a-c76c519bb7cd\").on(\"click.pygsti\", function(event) {\n",
       "     plotman.enqueue(function() { \n",
       "        \n",
       "     }, \"Click-creating Plot 86dce702-d9bf-4671-a73a-c76c519bb7cd\" );\n",
       "     $(\"#86dce702-d9bf-4671-a73a-c76c519bb7cd\").off(\"click.pygsti\");\n",
       "     console.log(\"Click-Created 86dce702-d9bf-4671-a73a-c76c519bb7cd\");\n",
       "  });\n",
       "  $(\"#86dce702-d9bf-4671-a73a-c76c519bb7cd\").on(\"create\", function(event, fracw, frach) {\n",
       "     pex_update_plotdiv_size($(\"#86dce702-d9bf-4671-a73a-c76c519bb7cd\"), 1.0, fracw, frach, 218.75, 218.75);\n",
       "     plotman.enqueue(function() { \n",
       "       $(\"#86dce702-d9bf-4671-a73a-c76c519bb7cd\").addClass(\"pygBackground\");\n",
       "       window.PLOTLYENV=window.PLOTLYENV || {};window.PLOTLYENV.BASE_URL=\"https://plot.ly\";Plotly.newPlot(\"86dce702-d9bf-4671-a73a-c76c519bb7cd\", [{\"hoverinfo\": \"text\", \"type\": \"heatmap\", \"text\": [[\"1.11022302463e-16\", \"-1.0\", \"0.0\", \"2.35513868803e-16\"], [\"0.0\", \"0.0\", \"1.0\", \"0.0\"], [\"-7.85046229342e-17\", \"2.35513868803e-16\", \"0.0\", \"1.0\"], [\"1.0\", \"-1.11022302463e-16\", \"0.0\", \"-7.85046229342e-17\"]], \"colorscale\": [[0.0, \"rgb(0,0,255)\"], [0.5, \"rgb(255,255,255)\"], [1.0, \"rgb(255,0,0)\"]], \"showscale\": false, \"zmin\": -1.0, \"z\": [[1.1102230246251565e-16, -0.9999999999999999, 0.0, 2.355138688025663e-16], [0.0, 0.0, 1.0, 0.0], [-7.850462293418876e-17, 2.355138688025663e-16, 0.0, 1.0], [0.9999999999999999, -1.1102230246251565e-16, 0.0, -7.850462293418876e-17]], \"zmax\": 1.0}], {\"annotations\": [], \"shapes\": [{\"type\": \"line\", \"y1\": 3.5, \"y0\": -0.5, \"x0\": 0.5, \"line\": {\"color\": \"black\", \"width\": 1}, \"x1\": 0.5}, {\"type\": \"line\", \"y1\": 3.5, \"y0\": -0.5, \"x0\": 1.5, \"line\": {\"color\": \"black\", \"width\": 1}, \"x1\": 1.5}, {\"type\": \"line\", \"y1\": 3.5, \"y0\": -0.5, \"x0\": 2.5, \"line\": {\"color\": \"black\", \"width\": 1}, \"x1\": 2.5}, {\"type\": \"line\", \"y1\": 0.5, \"y0\": 0.5, \"x0\": -0.5, \"line\": {\"color\": \"black\", \"width\": 1}, \"x1\": 3.5}, {\"type\": \"line\", \"y1\": 1.5, \"y0\": 1.5, \"x0\": -0.5, \"line\": {\"color\": \"black\", \"width\": 1}, \"x1\": 3.5}, {\"type\": \"line\", \"y1\": 2.5, \"y0\": 2.5, \"x0\": -0.5, \"line\": {\"color\": \"black\", \"width\": 1}, \"x1\": 3.5}], \"margin\": {\"r\": 50, \"t\": 50, \"l\": 50, \"b\": 50}, \"xaxis\": {\"range\": [-0.5, 3.5], \"mirror\": true, \"side\": \"top\", \"tickvals\": [0, 1, 2, 3], \"ticks\": \"\", \"showline\": true, \"zeroline\": false, \"showticklabels\": true, \"tickangle\": -90, \"linewidth\": 2, \"ticktext\": [\"<i>I^{(0)}</i>\", \"<i>X^{(0)}_{0,1}</i>\", \"<i>Y^{(0)}_{0,1}</i>\", \"<i>Z^{(0)}_{1}</i>\"], \"showgrid\": false, \"title\": null}, \"yaxis\": {\"range\": [-0.5, 3.5], \"mirror\": true, \"title\": null, \"ticktext\": [\"<i>Z^{(0)}_{1}</i>\", \"<i>Y^{(0)}_{0,1}</i>\", \"<i>X^{(0)}_{0,1}</i>\", \"<i>I^{(0)}</i>\"], \"tickvals\": [0, 1, 2, 3], \"ticks\": \"\", \"zeroline\": false, \"showticklabels\": true, \"side\": \"left\", \"linewidth\": 2, \"showline\": true, \"showgrid\": false}}, {\"showLink\": false, \"linkText\": \"Export to plot.ly\"}) \n",
       "       pex_create_slaves($(\"#86dce702-d9bf-4671-a73a-c76c519bb7cd\"), 218.75, 218.75);\n",
       "     }, \"Creating Plot 86dce702-d9bf-4671-a73a-c76c519bb7cd\" );\n",
       "     console.log(\"Created 86dce702-d9bf-4671-a73a-c76c519bb7cd\");\n",
       "  });\n",
       "  $(\"#86dce702-d9bf-4671-a73a-c76c519bb7cd\").on(\"resize\", function(event,fracw,frach) {\n",
       "    pex_update_plotdiv_size($(\"#86dce702-d9bf-4671-a73a-c76c519bb7cd\"), 1.0, fracw, frach, 218.75, 218.75);\n",
       "    plotman.enqueue(function() { \n",
       "        Plotly.Plots.resize(document.getElementById(\"86dce702-d9bf-4671-a73a-c76c519bb7cd\")); \n",
       "      pex_resize_slaves($(\"#86dce702-d9bf-4671-a73a-c76c519bb7cd\"), 218.75, 218.75);\n",
       "     }, \"Resizing Plot 86dce702-d9bf-4671-a73a-c76c519bb7cd\" );\n",
       "    //console.log(\"Resized 86dce702-d9bf-4671-a73a-c76c519bb7cd\");\n",
       "  });\n",
       "var switchmap_plot_5526 = new Array();\n",
       "switchmap_plot_5526[ [] ] = '86dce702-d9bf-4671-a73a-c76c519bb7cd';\n",
       "window.switchmap_plot_5526 = switchmap_plot_5526;\n",
       "\n",
       "function connect_plot_5526_to_switches(){  if(true) {    console.log('Switches initialized: plot_5526 handlers set');\n",
       "    $( '#plot_5526' ).show()\n",
       "  }\n",
       "  else {\n",
       "    setTimeout(connect_plot_5526_to_switches, 500);\n",
       "    console.log('plot_5526 switches NOT initialized: Waiting...');\n",
       "  }\n",
       "};\n",
       "$(document).ready(function() {\n",
       "  connect_plot_5526_to_switches();\n",
       "});\n",
       "\n",
       "\n",
       "var switchmap_table_316 = new Array();\n",
       "switchmap_table_316[ [] ] = 'table_316_0';\n",
       "window.switchmap_table_316 = switchmap_table_316;\n",
       "\n",
       "function connect_table_316_to_switches(){  if(true) {    console.log('Switches initialized: table_316 handlers set');\n",
       "    $( '#table_316' ).show()\n",
       "  }\n",
       "  else {\n",
       "    setTimeout(connect_table_316_to_switches, 500);\n",
       "    console.log('table_316 switches NOT initialized: Waiting...');\n",
       "  }\n",
       "};\n",
       "$(document).ready(function() {\n",
       "  connect_table_316_to_switches();\n",
       "});\n",
       "\n",
       "    make_wstable_resizable(\"table_316\");\n",
       "    trigger_wstable_plot_creation(\"table_316\");\n",
       "}); //end on-ready handler\n",
       "}); //end require block\n",
       " });</script><div id='table_316' class='pygsti-wsoutput-group'>\n",
       "<div class='single_switched_value' id='table_316_0'>\n",
       "<table class=\"dataTable\" id=\"table_316_0_tbl\"><thead><tr><th> <span title=\"Gate\">Gate</span> </th><th> <span title=\"Superoperator (Gell-Mann basis)\">Superoperator (Gell-Mann basis)</span> </th></tr></thead><tbody><tr><td><span title=\"Gi\">Gi</span></td><td><div id='plot_2016' class='pygsti-wsoutput-group'>\n",
       "<div class='relwrap single_switched_value'><div class='abswrap'><div id=\"55238c3a-a1ab-4abc-8800-a9a055d38ec8\" style=\"height: 100%; width: 100%;\" class=\"plotly-graph-div\"></div></div></div>\n",
       "</div>\n",
       "</td></tr><tr><td><span title=\"Gx\">Gx</span></td><td><div id='plot_5910' class='pygsti-wsoutput-group'>\n",
       "<div class='relwrap single_switched_value'><div class='abswrap'><div id=\"f08c5951-59c0-4d06-8274-e83267de1fda\" style=\"height: 100%; width: 100%;\" class=\"plotly-graph-div\"></div></div></div>\n",
       "</div>\n",
       "</td></tr><tr><td><span title=\"Gy\">Gy</span></td><td><div id='plot_5526' class='pygsti-wsoutput-group'>\n",
       "<div class='relwrap single_switched_value'><div class='abswrap'><div id=\"86dce702-d9bf-4671-a73a-c76c519bb7cd\" style=\"height: 100%; width: 100%;\" class=\"plotly-graph-div\"></div></div></div>\n",
       "</div>\n",
       "</td></tr></tbody></table>\n",
       "</div>\n",
       "\n",
       "</div>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "<pygsti.report.workspacetables.GatesTable at 0x7f13b6b4b828>"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "ws.GatesTable(gs_target, display_as=\"boxes\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "# System and pyGSTi parameters\n",
    "This section contains a raw dump of system information and various pyGSTi parameters.  It's purpose is to stamp this report with parameters indicating how exactly GST was run to create it, as well as to record the software environment in within which the report creation was run.  Note that if the core GST computation was done on a machine different from the one that created this report, the software information contained here will be of less value.\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### Listing of GST parameters and meta-data.\n",
    "These parameters and related metadata describe how the GST computation was performed which led to this report.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'switchBd' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-27-198a7eb73f66>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mws\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mMetadataTable\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgs_final\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mswitchBd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mparams\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      3\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mNameError\u001b[0m: name 'switchBd' is not defined"
     ]
    }
   ],
   "source": [
    "\n",
    "ws.MetadataTable(gs_final, switchBd.params)\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    " \n",
    "### Listing of the software environment.\n",
    "Note that this describes the software environment of the machine used to generate this report, and not necessarily the machine used to perform the core GST gate set estimation.\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "require(['jquery','jquery-UI','plotly'],function($,ui,Plotly) {require(['jquery','jquery-UI','plotly','autorender'],function($,ui,Plotly,renderMathInElement) {\n",
       "  $(document).ready(function() {\n",
       "var switchmap_table_5544 = new Array();\n",
       "switchmap_table_5544[ [] ] = 'table_5544_0';\n",
       "window.switchmap_table_5544 = switchmap_table_5544;\n",
       "\n",
       "function connect_table_5544_to_switches(){  if(true) {    console.log('Switches initialized: table_5544 handlers set');\n",
       "    $( '#table_5544' ).show()\n",
       "  }\n",
       "  else {\n",
       "    setTimeout(connect_table_5544_to_switches, 500);\n",
       "    console.log('table_5544 switches NOT initialized: Waiting...');\n",
       "  }\n",
       "};\n",
       "$(document).ready(function() {\n",
       "  connect_table_5544_to_switches();\n",
       "});\n",
       "\n",
       "    make_wstable_resizable(\"table_5544\");\n",
       "    trigger_wstable_plot_creation(\"table_5544\");\n",
       "}); //end on-ready handler\n",
       "}); //end require block\n",
       " });</script><div id='table_5544' class='pygsti-wsoutput-group'>\n",
       "<div class='single_switched_value' id='table_5544_0'>\n",
       "<table class=\"dataTable\" id=\"table_5544_0_tbl\"><thead><tr><th> <span title=\"Quantity\"><b>Quantity</b></span> </th><th> <span title=\"Value\"><b>Value</b></span> </th></tr></thead><tbody><tr><td><span title=\"pyGSTi version\">pyGSTi version</span></td><td><span title=\"0.9.3\">0.9.3</span></td></tr><tr><td><span title=\"numpy\">numpy</span></td><td><span title=\"1.11.2\">1.11.2</span></td></tr><tr><td><span title=\"scipy\">scipy</span></td><td><span title=\"0.18.1\">0.18.1</span></td></tr><tr><td><span title=\"matplotlib\">matplotlib</span></td><td><span title=\"1.5.3\">1.5.3</span></td></tr><tr><td><span title=\"pyparsing\">pyparsing</span></td><td><span title=\"2.1.10\">2.1.10</span></td></tr><tr><td><span title=\"cvxopt\">cvxopt</span></td><td><span title=\"1.1.8\">1.1.8</span></td></tr><tr><td><span title=\"cvxpy\">cvxpy</span></td><td><span title=\"0.4.6\">0.4.6</span></td></tr><tr><td><span title=\"nose\">nose</span></td><td><span title=\"1.3.7\">1.3.7</span></td></tr><tr><td><span title=\"PIL\">PIL</span></td><td><span title=\"3.4.2\">3.4.2</span></td></tr><tr><td><span title=\"psutil\">psutil</span></td><td><span title=\"4.3.1\">4.3.1</span></td></tr><tr><td><span title=\"Python version\">Python version</span></td><td><span title=\"3.5.2\">3.5.2</span></td></tr><tr><td><span title=\"Python type\">Python type</span></td><td><span title=\"CPython\">CPython</span></td></tr><tr><td><span title=\"Python compiler\">Python compiler</span></td><td><span title=\"GCC 4.8.5 20150623 (Red Hat 4.8.5-4)\">GCC 4.8.5 20150623 (Red Hat 4.8.5-4)</span></td></tr><tr><td><span title=\"Python build\">Python build</span></td><td><span title=\"('default', 'Oct 20 2016 13:11:26')\">('default', 'Oct 20 2016 13:11:26')</span></td></tr><tr><td><span title=\"Python branch\">Python branch</span></td><td><span title=\"\"></span></td></tr><tr><td><span title=\"Python revision\">Python revision</span></td><td><span title=\"\"></span></td></tr><tr><td><span title=\"Platform summary\">Platform summary</span></td><td><span title=\"Linux-3.10.0-327.36.1.el7.x86_64-x86_64-with-redhat-7.2-Maipo\">Linux-3.10.0-327.36.1.el7.x86_64-x86_64-with-redhat-7.2-Maipo</span></td></tr><tr><td><span title=\"System\">System</span></td><td><span title=\"Linux\">Linux</span></td></tr><tr><td><span title=\"Sys Release\">Sys Release</span></td><td><span title=\"3.10.0-327.36.1.el7.x86_64\">3.10.0-327.36.1.el7.x86_64</span></td></tr><tr><td><span title=\"Sys Version\">Sys Version</span></td><td><span title=\"#1 SMP Wed Aug 17 03:02:37 EDT 2016\">#1 SMP Wed Aug 17 03:02:37 EDT 2016</span></td></tr><tr><td><span title=\"Machine\">Machine</span></td><td><span title=\"x86_64\">x86_64</span></td></tr><tr><td><span title=\"Processor\">Processor</span></td><td><span title=\"x86_64\">x86_64</span></td></tr></tbody></table>\n",
       "</div>\n",
       "\n",
       "</div>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "<pygsti.report.workspacetables.SoftwareEnvTable at 0x7f13b6b6bb70>"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "ws.SoftwareEnvTable()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
