Skip to content

Instantly share code, notes, and snippets.

@pokgak
Created July 21, 2020 15:31
Show Gist options
  • Save pokgak/aaa9335783b7ce024bd8a958eb63e76c to your computer and use it in GitHub Desktop.
Save pokgak/aaa9335783b7ce024bd8a958eb63e76c to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
<html>
<head><meta charset="utf-8" /></head>
<body>
<div>
<script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>
<script type="text/javascript">/**
* plotly.js v1.54.5
* Copyright 2012-2020, Plotly, Inc.
* All rights reserved.
* Licensed under the MIT license
*/
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Plotly=t()}}((function(){return function t(e,r,n){function a(o,s){if(!r[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(i)return i(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[o]={exports:{}};e[o][0].call(u.exports,(function(t){return a(e[o][1][t]||t)}),u,u.exports,t,e,r,n)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;o<n.length;o++)a(n[o]);return a}({1:[function(t,e,r){"use strict";var n=t("../src/lib"),a={"X,X div":"direction:ltr;font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;","X input,X button":"font-family:'Open Sans', verdana, arial, sans-serif;","X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg":"overflow:hidden;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color 0.3s ease 0s;-moz-transition:background-color 0.3s ease 0s;-ms-transition:background-color 0.3s ease 0s;-o-transition:background-color 0.3s ease 0s;transition:background-color 0.3s ease 0s;","X .modebar--hover>:not(.watermark)":"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 .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","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 .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;","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', verdana, arial, sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;","Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,0.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:0.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(var i in a){var o=i.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(o,a[i])}},{"../src/lib":728}],2:[function(t,e,r){"use strict";e.exports=t("../src/transforms/aggregate")},{"../src/transforms/aggregate":1310}],3:[function(t,e,r){"use strict";e.exports=t("../src/traces/bar")},{"../src/traces/bar":877}],4:[function(t,e,r){"use strict";e.exports=t("../src/traces/barpolar")},{"../src/traces/barpolar":890}],5:[function(t,e,r){"use strict";e.exports=t("../src/traces/box")},{"../src/traces/box":900}],6:[function(t,e,r){"use strict";e.exports=t("../src/components/calendars")},{"../src/components/calendars":593}],7:[function(t,e,r){"use strict";e.exports=t("../src/traces/candlestick")},{"../src/traces/candlestick":909}],8:[function(t,e,r){"use strict";e.exports=t("../src/traces/carpet")},{"../src/traces/carpet":928}],9:[function(t,e,r){"use strict";e.exports=t("../src/traces/choropleth")},{"../src/traces/choropleth":942}],10:[function(t,e,r){"use strict";e.exports=t("../src/traces/choroplethmapbox")},{"../src/traces/choroplethmapbox":949}],11:[function(t,e,r){"use strict";e.exports=t("../src/traces/cone")},{"../src/traces/cone":955}],12:[function(t,e,r){"use strict";e.exports=t("../src/traces/contour")},{"../src/traces/contour":970}],13:[function(t,e,r){"use strict";e.exports=t("../src/traces/contourcarpet")},{"../src/traces/contourcarpet":981}],14:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":706}],15:[function(t,e,r){"use strict";e.exports=t("../src/traces/densitymapbox")},{"../src/traces/densitymapbox":989}],16:[function(t,e,r){"use strict";e.exports=t("../src/transforms/filter")},{"../src/transforms/filter":1311}],17:[function(t,e,r){"use strict";e.exports=t("../src/traces/funnel")},{"../src/traces/funnel":999}],18:[function(t,e,r){"use strict";e.exports=t("../src/traces/funnelarea")},{"../src/traces/funnelarea":1008}],19:[function(t,e,r){"use strict";e.exports=t("../src/transforms/groupby")},{"../src/transforms/groupby":1312}],20:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmap")},{"../src/traces/heatmap":1021}],21:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmapgl")},{"../src/traces/heatmapgl":1030}],22:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram")},{"../src/traces/histogram":1042}],23:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2d")},{"../src/traces/histogram2d":1048}],24:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2dcontour")},{"../src/traces/histogram2dcontour":1052}],25:[function(t,e,r){"use strict";e.exports=t("../src/traces/image")},{"../src/traces/image":1059}],26:[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("./contour"),t("./scatterternary"),t("./violin"),t("./funnel"),t("./waterfall"),t("./image"),t("./pie"),t("./sunburst"),t("./treemap"),t("./funnelarea"),t("./scatter3d"),t("./surface"),t("./isosurface"),t("./volume"),t("./mesh3d"),t("./cone"),t("./streamtube"),t("./scattergeo"),t("./choropleth"),t("./scattergl"),t("./splom"),t("./pointcloud"),t("./heatmapgl"),t("./parcoords"),t("./parcats"),t("./scattermapbox"),t("./choroplethmapbox"),t("./densitymapbox"),t("./sankey"),t("./indicator"),t("./table"),t("./carpet"),t("./scattercarpet"),t("./contourcarpet"),t("./ohlc"),t("./candlestick"),t("./scatterpolar"),t("./scatterpolargl"),t("./barpolar")]),n.register([t("./aggregate"),t("./filter"),t("./groupby"),t("./sort")]),n.register([t("./calendars")]),e.exports=n},{"./aggregate":2,"./bar":3,"./barpolar":4,"./box":5,"./calendars":6,"./candlestick":7,"./carpet":8,"./choropleth":9,"./choroplethmapbox":10,"./cone":11,"./contour":12,"./contourcarpet":13,"./core":14,"./densitymapbox":15,"./filter":16,"./funnel":17,"./funnelarea":18,"./groupby":19,"./heatmap":20,"./heatmapgl":21,"./histogram":22,"./histogram2d":23,"./histogram2dcontour":24,"./image":25,"./indicator":27,"./isosurface":28,"./mesh3d":29,"./ohlc":30,"./parcats":31,"./parcoords":32,"./pie":33,"./pointcloud":34,"./sankey":35,"./scatter3d":36,"./scattercarpet":37,"./scattergeo":38,"./scattergl":39,"./scattermapbox":40,"./scatterpolar":41,"./scatterpolargl":42,"./scatterternary":43,"./sort":44,"./splom":45,"./streamtube":46,"./sunburst":47,"./surface":48,"./table":49,"./treemap":50,"./violin":51,"./volume":52,"./waterfall":53}],27:[function(t,e,r){"use strict";e.exports=t("../src/traces/indicator")},{"../src/traces/indicator":1067}],28:[function(t,e,r){"use strict";e.exports=t("../src/traces/isosurface")},{"../src/traces/isosurface":1073}],29:[function(t,e,r){"use strict";e.exports=t("../src/traces/mesh3d")},{"../src/traces/mesh3d":1078}],30:[function(t,e,r){"use strict";e.exports=t("../src/traces/ohlc")},{"../src/traces/ohlc":1083}],31:[function(t,e,r){"use strict";e.exports=t("../src/traces/parcats")},{"../src/traces/parcats":1092}],32:[function(t,e,r){"use strict";e.exports=t("../src/traces/parcoords")},{"../src/traces/parcoords":1102}],33:[function(t,e,r){"use strict";e.exports=t("../src/traces/pie")},{"../src/traces/pie":1113}],34:[function(t,e,r){"use strict";e.exports=t("../src/traces/pointcloud")},{"../src/traces/pointcloud":1122}],35:[function(t,e,r){"use strict";e.exports=t("../src/traces/sankey")},{"../src/traces/sankey":1128}],36:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatter3d")},{"../src/traces/scatter3d":1165}],37:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattercarpet")},{"../src/traces/scattercarpet":1172}],38:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattergeo")},{"../src/traces/scattergeo":1180}],39:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattergl")},{"../src/traces/scattergl":1193}],40:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattermapbox")},{"../src/traces/scattermapbox":1203}],41:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterpolar")},{"../src/traces/scatterpolar":1211}],42:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterpolargl")},{"../src/traces/scatterpolargl":1218}],43:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterternary")},{"../src/traces/scatterternary":1226}],44:[function(t,e,r){"use strict";e.exports=t("../src/transforms/sort")},{"../src/transforms/sort":1314}],45:[function(t,e,r){"use strict";e.exports=t("../src/traces/splom")},{"../src/traces/splom":1235}],46:[function(t,e,r){"use strict";e.exports=t("../src/traces/streamtube")},{"../src/traces/streamtube":1243}],47:[function(t,e,r){"use strict";e.exports=t("../src/traces/sunburst")},{"../src/traces/sunburst":1251}],48:[function(t,e,r){"use strict";e.exports=t("../src/traces/surface")},{"../src/traces/surface":1260}],49:[function(t,e,r){"use strict";e.exports=t("../src/traces/table")},{"../src/traces/table":1268}],50:[function(t,e,r){"use strict";e.exports=t("../src/traces/treemap")},{"../src/traces/treemap":1277}],51:[function(t,e,r){"use strict";e.exports=t("../src/traces/violin")},{"../src/traces/violin":1289}],52:[function(t,e,r){"use strict";e.exports=t("../src/traces/volume")},{"../src/traces/volume":1297}],53:[function(t,e,r){"use strict";e.exports=t("../src/traces/waterfall")},{"../src/traces/waterfall":1305}],54:[function(t,e,r){"use strict";e.exports=function(t){var e=(t=t||{}).eye||[0,0,1],r=t.center||[0,0,0],s=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],c=t.mode||"turntable",u=n(),h=a(),f=i();return u.setDistanceLimits(l[0],l[1]),u.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,s),new o({turntable:u,orbit:h,matrix:f},c)};var n=t("turntable-camera-controller"),a=t("orbit-camera-controller"),i=t("matrix-camera-controller");function o(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map((function(e){return t[e]})),this._mode=e,this._active=t[e],this._active||(this._mode="turntable",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=o.prototype;[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]].forEach((function(t){for(var e=t[0],r=[],n=0;n<t[1];++n)r.push("a"+n);var a="var cc=this._controllerList;for(var i=0;i<cc.length;++i){cc[i]."+t[0]+"("+r.join()+")}";s[e]=Function.apply(null,r.concat(a))})),s.recalcMatrix=function(t){this._active.recalcMatrix(t)},s.getDistance=function(t){return this._active.getDistance(t)},s.getDistanceLimits=function(t){return this._active.getDistanceLimits(t)},s.lastT=function(){return this._active.lastT()},s.setMode=function(t){if(t!==this._mode){var e=this._controllerNames.indexOf(t);if(!(e<0)){var r=this._active,n=this._controllerList[e],a=Math.max(r.lastT(),n.lastT());r.recalcMatrix(a),n.setMatrix(a,r.computedMatrix),this._active=n,this._mode=t,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}}},s.getMode=function(){return this._mode}},{"matrix-camera-controller":433,"orbit-camera-controller":454,"turntable-camera-controller":533}],55:[function(t,e,r){!function(n,a){"object"==typeof r&&"undefined"!=typeof e?a(r,t("d3-array"),t("d3-collection"),t("d3-shape"),t("elementary-circuits-directed-graph")):a(n.d3=n.d3||{},n.d3,n.d3,n.d3,null)}(this,(function(t,e,r,n,a){"use strict";function i(t){return t.target.depth}function o(t,e){return t.sourceLinks.length?t.depth:e-1}function s(t){return function(){return t}}a=a&&a.hasOwnProperty("default")?a.default:a;var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function c(t,e){return h(t.source,e.source)||t.index-e.index}function u(t,e){return h(t.target,e.target)||t.index-e.index}function h(t,e){return t.partOfCycle===e.partOfCycle?t.y0-e.y0:"top"===t.circularLinkType||"bottom"===e.circularLinkType?-1:1}function f(t){return t.value}function p(t){return(t.y0+t.y1)/2}function d(t){return p(t.source)}function g(t){return p(t.target)}function m(t){return t.index}function v(t){return t.nodes}function y(t){return t.links}function x(t,e){var r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function b(t,e){return e(t)}function _(t,e,r){var n=0;if(null===r){for(var i=[],o=0;o<t.links.length;o++){var s=t.links[o],l=s.source.index,c=s.target.index;i[l]||(i[l]=[]),i[c]||(i[c]=[]),-1===i[l].indexOf(c)&&i[l].push(c)}var u=a(i);u.sort((function(t,e){return t.length-e.length}));var h={};for(o=0;o<u.length;o++){var f=u[o].slice(-2);h[f[0]]||(h[f[0]]={}),h[f[0]][f[1]]=!0}t.links.forEach((function(t){var e=t.target.index,r=t.source.index;e===r||h[r]&&h[r][e]?(t.circular=!0,t.circularLinkID=n,n+=1):t.circular=!1}))}else t.links.forEach((function(t){t.source[r]<t.target[r]?t.circular=!1:(t.circular=!0,t.circularLinkID=n,n+=1)}))}function w(t,e){var r=0,n=0;t.links.forEach((function(a){a.circular&&(a.source.circularLinkType||a.target.circularLinkType?a.circularLinkType=a.source.circularLinkType?a.source.circularLinkType:a.target.circularLinkType:a.circularLinkType=r<n?"top":"bottom","top"==a.circularLinkType?r+=1:n+=1,t.nodes.forEach((function(t){b(t,e)!=b(a.source,e)&&b(t,e)!=b(a.target,e)||(t.circularLinkType=a.circularLinkType)})))})),t.links.forEach((function(t){t.circular&&(t.source.circularLinkType==t.target.circularLinkType&&(t.circularLinkType=t.source.circularLinkType),H(t,e)&&(t.circularLinkType=t.source.circularLinkType))}))}function T(t){var e=Math.abs(t.y1-t.y0),r=Math.abs(t.target.x0-t.source.x1);return Math.atan(r/e)}function k(t,e){var r=0;t.sourceLinks.forEach((function(t){r=t.circular&&!H(t,e)?r+1:r}));var n=0;return t.targetLinks.forEach((function(t){n=t.circular&&!H(t,e)?n+1:n})),r+n}function A(t){var e=t.source.sourceLinks,r=0;e.forEach((function(t){r=t.circular?r+1:r}));var n=t.target.targetLinks,a=0;return n.forEach((function(t){a=t.circular?a+1:a})),!(r>1||a>1)}function M(t,e,r){return t.sort(E),t.forEach((function(n,a){var i,o,s=0;if(H(n,r)&&A(n))n.circularPathData.verticalBuffer=s+n.width/2;else{for(var l=0;l<a;l++)if(i=t[a],o=t[l],!(i.source.column<o.target.column||i.target.column>o.source.column)){var c=t[l].circularPathData.verticalBuffer+t[l].width/2+e;s=c>s?c:s}n.circularPathData.verticalBuffer=s+n.width/2}})),t}function S(t,r,a,i){var o=e.min(t.links,(function(t){return t.source.y0}));t.links.forEach((function(t){t.circular&&(t.circularPathData={})})),M(t.links.filter((function(t){return"top"==t.circularLinkType})),r,i),M(t.links.filter((function(t){return"bottom"==t.circularLinkType})),r,i),t.links.forEach((function(e){if(e.circular){if(e.circularPathData.arcRadius=e.width+10,e.circularPathData.leftNodeBuffer=5,e.circularPathData.rightNodeBuffer=5,e.circularPathData.sourceWidth=e.source.x1-e.source.x0,e.circularPathData.sourceX=e.source.x0+e.circularPathData.sourceWidth,e.circularPathData.targetX=e.target.x0,e.circularPathData.sourceY=e.y0,e.circularPathData.targetY=e.y1,H(e,i)&&A(e))e.circularPathData.leftSmallArcRadius=10+e.width/2,e.circularPathData.leftLargeArcRadius=10+e.width/2,e.circularPathData.rightSmallArcRadius=10+e.width/2,e.circularPathData.rightLargeArcRadius=10+e.width/2,"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=e.source.y1+25+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=e.source.y0-25-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius);else{var s=e.source.column,l=e.circularLinkType,c=t.links.filter((function(t){return t.source.column==s&&t.circularLinkType==l}));"bottom"==e.circularLinkType?c.sort(L):c.sort(C);var u=0;c.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.leftSmallArcRadius=10+e.width/2+u,e.circularPathData.leftLargeArcRadius=10+e.width/2+n*r+u),u+=t.width})),s=e.target.column,c=t.links.filter((function(t){return t.target.column==s&&t.circularLinkType==l})),"bottom"==e.circularLinkType?c.sort(I):c.sort(P),u=0,c.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.rightSmallArcRadius=10+e.width/2+u,e.circularPathData.rightLargeArcRadius=10+e.width/2+n*r+u),u+=t.width})),"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=Math.max(a,e.source.y1,e.target.y1)+25+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=o-25-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius)}e.circularPathData.leftInnerExtent=e.circularPathData.sourceX+e.circularPathData.leftNodeBuffer,e.circularPathData.rightInnerExtent=e.circularPathData.targetX-e.circularPathData.rightNodeBuffer,e.circularPathData.leftFullExtent=e.circularPathData.sourceX+e.circularPathData.leftLargeArcRadius+e.circularPathData.leftNodeBuffer,e.circularPathData.rightFullExtent=e.circularPathData.targetX-e.circularPathData.rightLargeArcRadius-e.circularPathData.rightNodeBuffer}if(e.circular)e.path=function(t){var e="";e="top"==t.circularLinkType?"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 0 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY-t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 0 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 0 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY-t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 0 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY:"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 1 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY+t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 1 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 1 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY+t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 1 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY;return e}(e);else{var h=n.linkHorizontal().source((function(t){return[t.source.x0+(t.source.x1-t.source.x0),t.y0]})).target((function(t){return[t.target.x0,t.y1]}));e.path=h(e)}}))}function E(t,e){return z(t)==z(e)?"bottom"==t.circularLinkType?L(t,e):C(t,e):z(e)-z(t)}function C(t,e){return t.y0-e.y0}function L(t,e){return e.y0-t.y0}function P(t,e){return t.y1-e.y1}function I(t,e){return e.y1-t.y1}function z(t){return t.target.column-t.source.column}function O(t){return t.target.x0-t.source.x1}function D(t,e){var r=T(t),n=O(e)/Math.tan(r);return"up"==q(t)?t.y1+n:t.y1-n}function R(t,e){var r=T(t),n=O(e)/Math.tan(r);return"up"==q(t)?t.y1-n:t.y1+n}function F(t,e,r,n){t.links.forEach((function(a){if(!a.circular&&a.target.column-a.source.column>1){var i=a.source.column+1,o=a.target.column-1,s=1,l=o-i+1;for(s=1;i<=o;i++,s++)t.nodes.forEach((function(o){if(o.column==i){var c,u=s/(l+1),h=Math.pow(1-u,3),f=3*u*Math.pow(1-u,2),p=3*Math.pow(u,2)*(1-u),d=Math.pow(u,3),g=h*a.y0+f*a.y0+p*a.y1+d*a.y1,m=g-a.width/2,v=g+a.width/2;m>o.y0&&m<o.y1?(c=o.y1-m+10,c="bottom"==o.circularLinkType?c:-c,o=N(o,c,e,r),t.nodes.forEach((function(t){b(t,n)!=b(o,n)&&t.column==o.column&&B(o,t)&&N(t,c,e,r)}))):(v>o.y0&&v<o.y1||m<o.y0&&v>o.y1)&&(c=v-o.y0+10,o=N(o,c,e,r),t.nodes.forEach((function(t){b(t,n)!=b(o,n)&&t.column==o.column&&t.y0<o.y1&&t.y1>o.y1&&N(t,c,e,r)})))}}))}}))}function B(t,e){return t.y0>e.y0&&t.y0<e.y1||(t.y1>e.y0&&t.y1<e.y1||t.y0<e.y0&&t.y1>e.y1)}function N(t,e,r,n){return t.y0+e>=r&&t.y1+e<=n&&(t.y0=t.y0+e,t.y1=t.y1+e,t.targetLinks.forEach((function(t){t.y1=t.y1+e})),t.sourceLinks.forEach((function(t){t.y0=t.y0+e}))),t}function j(t,e,r,n){t.nodes.forEach((function(a){n&&a.y+(a.y1-a.y0)>e&&(a.y=a.y-(a.y+(a.y1-a.y0)-e));var i=t.links.filter((function(t){return b(t.source,r)==b(a,r)})),o=i.length;o>1&&i.sort((function(t,e){if(!t.circular&&!e.circular){if(t.target.column==e.target.column)return t.y1-e.y1;if(!U(t,e))return t.y1-e.y1;if(t.target.column>e.target.column){var r=R(e,t);return t.y1-r}if(e.target.column>t.target.column)return R(t,e)-e.y1}return t.circular&&!e.circular?"top"==t.circularLinkType?-1:1:e.circular&&!t.circular?"top"==e.circularLinkType?1:-1:t.circular&&e.circular?t.circularLinkType===e.circularLinkType&&"top"==t.circularLinkType?t.target.column===e.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:t.circularLinkType===e.circularLinkType&&"bottom"==t.circularLinkType?t.target.column===e.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:"top"==t.circularLinkType?-1:1:void 0}));var s=a.y0;i.forEach((function(t){t.y0=s+t.width/2,s+=t.width})),i.forEach((function(t,e){if("bottom"==t.circularLinkType){for(var r=e+1,n=0;r<o;r++)n+=i[r].width;t.y0=a.y1-n-t.width/2}}))}))}function V(t,e,r){t.nodes.forEach((function(e){var n=t.links.filter((function(t){return b(t.target,r)==b(e,r)})),a=n.length;a>1&&n.sort((function(t,e){if(!t.circular&&!e.circular){if(t.source.column==e.source.column)return t.y0-e.y0;if(!U(t,e))return t.y0-e.y0;if(e.source.column<t.source.column){var r=D(e,t);return t.y0-r}if(t.source.column<e.source.column)return D(t,e)-e.y0}return t.circular&&!e.circular?"top"==t.circularLinkType?-1:1:e.circular&&!t.circular?"top"==e.circularLinkType?1:-1:t.circular&&e.circular?t.circularLinkType===e.circularLinkType&&"top"==t.circularLinkType?t.source.column===e.source.column?t.source.y1-e.source.y1:t.source.column-e.source.column:t.circularLinkType===e.circularLinkType&&"bottom"==t.circularLinkType?t.source.column===e.source.column?t.source.y1-e.source.y1:e.source.column-t.source.column:"top"==t.circularLinkType?-1:1:void 0}));var i=e.y0;n.forEach((function(t){t.y1=i+t.width/2,i+=t.width})),n.forEach((function(t,r){if("bottom"==t.circularLinkType){for(var i=r+1,o=0;i<a;i++)o+=n[i].width;t.y1=e.y1-o-t.width/2}}))}))}function U(t,e){return q(t)==q(e)}function q(t){return t.y0-t.y1>0?"up":"down"}function H(t,e){return b(t.source,e)==b(t.target,e)}function G(t,r,n){var a=t.nodes,i=t.links,o=!1,s=!1;if(i.forEach((function(t){"top"==t.circularLinkType?o=!0:"bottom"==t.circularLinkType&&(s=!0)})),0==o||0==s){var l=e.min(a,(function(t){return t.y0})),c=(n-r)/(e.max(a,(function(t){return t.y1}))-l);a.forEach((function(t){var e=(t.y1-t.y0)*c;t.y0=(t.y0-l)*c,t.y1=t.y0+e})),i.forEach((function(t){t.y0=(t.y0-l)*c,t.y1=(t.y1-l)*c,t.width=t.width*c}))}}t.sankeyCircular=function(){var t,n,a=0,i=0,b=1,T=1,A=24,M=m,E=o,C=v,L=y,P=32,I=2,z=null;function O(){var t={nodes:C.apply(null,arguments),links:L.apply(null,arguments)};D(t),_(t,M,z),R(t),B(t),w(t,M),N(t,P,M),U(t);for(var e=4,r=0;r<e;r++)j(t,T,M),V(t,T,M),F(t,i,T,M),j(t,T,M),V(t,T,M);return G(t,i,T),S(t,I,T,M),t}function D(t){t.nodes.forEach((function(t,e){t.index=e,t.sourceLinks=[],t.targetLinks=[]}));var e=r.map(t.nodes,M);return t.links.forEach((function(t,r){t.index=r;var n=t.source,a=t.target;"object"!==("undefined"==typeof n?"undefined":l(n))&&(n=t.source=x(e,n)),"object"!==("undefined"==typeof a?"undefined":l(a))&&(a=t.target=x(e,a)),n.sourceLinks.push(t),a.targetLinks.push(t)})),t}function R(t){t.nodes.forEach((function(t){t.partOfCycle=!1,t.value=Math.max(e.sum(t.sourceLinks,f),e.sum(t.targetLinks,f)),t.sourceLinks.forEach((function(e){e.circular&&(t.partOfCycle=!0,t.circularLinkType=e.circularLinkType)})),t.targetLinks.forEach((function(e){e.circular&&(t.partOfCycle=!0,t.circularLinkType=e.circularLinkType)}))}))}function B(t){var e,r,n;for(e=t.nodes,r=[],n=0;e.length;++n,e=r,r=[])e.forEach((function(t){t.depth=n,t.sourceLinks.forEach((function(t){r.indexOf(t.target)<0&&!t.circular&&r.push(t.target)}))}));for(e=t.nodes,r=[],n=0;e.length;++n,e=r,r=[])e.forEach((function(t){t.height=n,t.targetLinks.forEach((function(t){r.indexOf(t.source)<0&&!t.circular&&r.push(t.source)}))}));t.nodes.forEach((function(t){t.column=Math.floor(E.call(null,t,n))}))}function N(o,s,l){var c=r.nest().key((function(t){return t.column})).sortKeys(e.ascending).entries(o.nodes).map((function(t){return t.values}));!function(r){if(n){var s=1/0;c.forEach((function(t){var e=T*n/(t.length+1);s=e<s?e:s})),t=s}var l=e.min(c,(function(r){return(T-i-(r.length-1)*t)/e.sum(r,f)}));l*=.3,o.links.forEach((function(t){t.width=t.value*l}));var u=function(t){var r=0,n=0,a=0,i=0,o=e.max(t.nodes,(function(t){return t.column}));return t.links.forEach((function(t){t.circular&&("top"==t.circularLinkType?r+=t.width:n+=t.width,0==t.target.column&&(i+=t.width),t.source.column==o&&(a+=t.width))})),{top:r=r>0?r+25+10:r,bottom:n=n>0?n+25+10:n,left:i=i>0?i+25+10:i,right:a=a>0?a+25+10:a}}(o),h=function(t,r){var n=e.max(t.nodes,(function(t){return t.column})),o=b-a,s=T-i,l=o/(o+r.right+r.left),c=s/(s+r.top+r.bottom);return a=a*l+r.left,b=0==r.right?b:b*l,i=i*c+r.top,T*=c,t.nodes.forEach((function(t){t.x0=a+t.column*((b-a-A)/n),t.x1=t.x0+A})),c}(o,u);l*=h,o.links.forEach((function(t){t.width=t.value*l})),c.forEach((function(t){var e=t.length;t.forEach((function(t,n){t.depth==c.length-1&&1==e||0==t.depth&&1==e?(t.y0=T/2-t.value*l,t.y1=t.y0+t.value*l):t.partOfCycle?0==k(t,r)?(t.y0=T/2+n,t.y1=t.y0+t.value*l):"top"==t.circularLinkType?(t.y0=i+n,t.y1=t.y0+t.value*l):(t.y0=T-t.value*l-n,t.y1=t.y0+t.value*l):0==u.top||0==u.bottom?(t.y0=(T-i)/e*n,t.y1=t.y0+t.value*l):(t.y0=(T-i)/2-e/2+n,t.y1=t.y0+t.value*l)}))}))}(l),y();for(var u=1,m=s;m>0;--m)v(u*=.99,l),y();function v(t,r){var n=c.length;c.forEach((function(a){var i=a.length,o=a[0].depth;a.forEach((function(a){var s;if(a.sourceLinks.length||a.targetLinks.length)if(a.partOfCycle&&k(a,r)>0);else if(0==o&&1==i)s=a.y1-a.y0,a.y0=T/2-s/2,a.y1=T/2+s/2;else if(o==n-1&&1==i)s=a.y1-a.y0,a.y0=T/2-s/2,a.y1=T/2+s/2;else{var l=e.mean(a.sourceLinks,g),c=e.mean(a.targetLinks,d),u=((l&&c?(l+c)/2:l||c)-p(a))*t;a.y0+=u,a.y1+=u}}))}))}function y(){c.forEach((function(e){var r,n,a,o=i,s=e.length;for(e.sort(h),a=0;a<s;++a)(n=o-(r=e[a]).y0)>0&&(r.y0+=n,r.y1+=n),o=r.y1+t;if((n=o-t-T)>0)for(o=r.y0-=n,r.y1-=n,a=s-2;a>=0;--a)(n=(r=e[a]).y1+t-o)>0&&(r.y0-=n,r.y1-=n),o=r.y0}))}}function U(t){t.nodes.forEach((function(t){t.sourceLinks.sort(u),t.targetLinks.sort(c)})),t.nodes.forEach((function(t){var e=t.y0,r=e,n=t.y1,a=n;t.sourceLinks.forEach((function(t){t.circular?(t.y0=n-t.width/2,n-=t.width):(t.y0=e+t.width/2,e+=t.width)})),t.targetLinks.forEach((function(t){t.circular?(t.y1=a-t.width/2,a-=t.width):(t.y1=r+t.width/2,r+=t.width)}))}))}return O.nodeId=function(t){return arguments.length?(M="function"==typeof t?t:s(t),O):M},O.nodeAlign=function(t){return arguments.length?(E="function"==typeof t?t:s(t),O):E},O.nodeWidth=function(t){return arguments.length?(A=+t,O):A},O.nodePadding=function(e){return arguments.length?(t=+e,O):t},O.nodes=function(t){return arguments.length?(C="function"==typeof t?t:s(t),O):C},O.links=function(t){return arguments.length?(L="function"==typeof t?t:s(t),O):L},O.size=function(t){return arguments.length?(a=i=0,b=+t[0],T=+t[1],O):[b-a,T-i]},O.extent=function(t){return arguments.length?(a=+t[0][0],b=+t[1][0],i=+t[0][1],T=+t[1][1],O):[[a,i],[b,T]]},O.iterations=function(t){return arguments.length?(P=+t,O):P},O.circularLinkGap=function(t){return arguments.length?(I=+t,O):I},O.nodePaddingRatio=function(t){return arguments.length?(n=+t,O):n},O.sortNodes=function(t){return arguments.length?(z=t,O):z},O.update=function(t){return w(t,M),U(t),t.links.forEach((function(t){t.circular&&(t.circularLinkType=t.y0+t.y1<T?"top":"bottom",t.source.circularLinkType=t.circularLinkType,t.target.circularLinkType=t.circularLinkType)})),j(t,T,M,!1),V(t,T,M),S(t,I,T,M),t},O},t.sankeyCenter=function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?e.min(t.sourceLinks,i)-1:0},t.sankeyLeft=function(t){return t.depth},t.sankeyRight=function(t,e){return e-1-t.height},t.sankeyJustify=o,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-array":153,"d3-collection":154,"d3-shape":162,"elementary-circuits-directed-graph":174}],56:[function(t,e,r){!function(n,a){"object"==typeof r&&"undefined"!=typeof e?a(r,t("d3-array"),t("d3-collection"),t("d3-shape")):a(n.d3=n.d3||{},n.d3,n.d3,n.d3)}(this,(function(t,e,r,n){"use strict";function a(t){return t.target.depth}function i(t,e){return t.sourceLinks.length?t.depth:e-1}function o(t){return function(){return t}}function s(t,e){return c(t.source,e.source)||t.index-e.index}function l(t,e){return c(t.target,e.target)||t.index-e.index}function c(t,e){return t.y0-e.y0}function u(t){return t.value}function h(t){return(t.y0+t.y1)/2}function f(t){return h(t.source)*t.value}function p(t){return h(t.target)*t.value}function d(t){return t.index}function g(t){return t.nodes}function m(t){return t.links}function v(t,e){var r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function y(t){return[t.source.x1,t.y0]}function x(t){return[t.target.x0,t.y1]}t.sankey=function(){var t=0,n=0,a=1,y=1,x=24,b=8,_=d,w=i,T=g,k=m,A=32;function M(){var t={nodes:T.apply(null,arguments),links:k.apply(null,arguments)};return S(t),E(t),C(t),L(t),P(t),t}function S(t){t.nodes.forEach((function(t,e){t.index=e,t.sourceLinks=[],t.targetLinks=[]}));var e=r.map(t.nodes,_);t.links.forEach((function(t,r){t.index=r;var n=t.source,a=t.target;"object"!=typeof n&&(n=t.source=v(e,n)),"object"!=typeof a&&(a=t.target=v(e,a)),n.sourceLinks.push(t),a.targetLinks.push(t)}))}function E(t){t.nodes.forEach((function(t){t.value=Math.max(e.sum(t.sourceLinks,u),e.sum(t.targetLinks,u))}))}function C(e){var r,n,i;for(r=e.nodes,n=[],i=0;r.length;++i,r=n,n=[])r.forEach((function(t){t.depth=i,t.sourceLinks.forEach((function(t){n.indexOf(t.target)<0&&n.push(t.target)}))}));for(r=e.nodes,n=[],i=0;r.length;++i,r=n,n=[])r.forEach((function(t){t.height=i,t.targetLinks.forEach((function(t){n.indexOf(t.source)<0&&n.push(t.source)}))}));var o=(a-t-x)/(i-1);e.nodes.forEach((function(e){e.x1=(e.x0=t+Math.max(0,Math.min(i-1,Math.floor(w.call(null,e,i))))*o)+x}))}function L(t){var a=r.nest().key((function(t){return t.x0})).sortKeys(e.ascending).entries(t.nodes).map((function(t){return t.values}));!function(){var r=e.max(a,(function(t){return t.length})),i=2/3*(y-n)/(r-1);b>i&&(b=i);var o=e.min(a,(function(t){return(y-n-(t.length-1)*b)/e.sum(t,u)}));a.forEach((function(t){t.forEach((function(t,e){t.y1=(t.y0=e)+t.value*o}))})),t.links.forEach((function(t){t.width=t.value*o}))}(),d();for(var i=1,o=A;o>0;--o)l(i*=.99),d(),s(i),d();function s(t){a.forEach((function(r){r.forEach((function(r){if(r.targetLinks.length){var n=(e.sum(r.targetLinks,f)/e.sum(r.targetLinks,u)-h(r))*t;r.y0+=n,r.y1+=n}}))}))}function l(t){a.slice().reverse().forEach((function(r){r.forEach((function(r){if(r.sourceLinks.length){var n=(e.sum(r.sourceLinks,p)/e.sum(r.sourceLinks,u)-h(r))*t;r.y0+=n,r.y1+=n}}))}))}function d(){a.forEach((function(t){var e,r,a,i=n,o=t.length;for(t.sort(c),a=0;a<o;++a)(r=i-(e=t[a]).y0)>0&&(e.y0+=r,e.y1+=r),i=e.y1+b;if((r=i-b-y)>0)for(i=e.y0-=r,e.y1-=r,a=o-2;a>=0;--a)(r=(e=t[a]).y1+b-i)>0&&(e.y0-=r,e.y1-=r),i=e.y0}))}}function P(t){t.nodes.forEach((function(t){t.sourceLinks.sort(l),t.targetLinks.sort(s)})),t.nodes.forEach((function(t){var e=t.y0,r=e;t.sourceLinks.forEach((function(t){t.y0=e+t.width/2,e+=t.width})),t.targetLinks.forEach((function(t){t.y1=r+t.width/2,r+=t.width}))}))}return M.update=function(t){return P(t),t},M.nodeId=function(t){return arguments.length?(_="function"==typeof t?t:o(t),M):_},M.nodeAlign=function(t){return arguments.length?(w="function"==typeof t?t:o(t),M):w},M.nodeWidth=function(t){return arguments.length?(x=+t,M):x},M.nodePadding=function(t){return arguments.length?(b=+t,M):b},M.nodes=function(t){return arguments.length?(T="function"==typeof t?t:o(t),M):T},M.links=function(t){return arguments.length?(k="function"==typeof t?t:o(t),M):k},M.size=function(e){return arguments.length?(t=n=0,a=+e[0],y=+e[1],M):[a-t,y-n]},M.extent=function(e){return arguments.length?(t=+e[0][0],a=+e[1][0],n=+e[0][1],y=+e[1][1],M):[[t,n],[a,y]]},M.iterations=function(t){return arguments.length?(A=+t,M):A},M},t.sankeyCenter=function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?e.min(t.sourceLinks,a)-1:0},t.sankeyLeft=function(t){return t.depth},t.sankeyRight=function(t,e){return e-1-t.height},t.sankeyJustify=i,t.sankeyLinkHorizontal=function(){return n.linkHorizontal().source(y).target(x)},Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-array":153,"d3-collection":154,"d3-shape":162}],57:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/meta");function a(t){var e=0;if(t&&t.length>0){e+=Math.abs(i(t[0]));for(var r=1;r<t.length;r++)e-=Math.abs(i(t[r]))}return e}function i(t){var e,r,n,a,i,s,l=0,c=t.length;if(c>2){for(s=0;s<c;s++)s===c-2?(n=c-2,a=c-1,i=0):s===c-1?(n=c-1,a=0,i=1):(n=s,a=s+1,i=s+2),e=t[n],r=t[a],l+=(o(t[i][0])-o(e[0]))*Math.sin(o(r[1]));l=6378137*l*6378137/2}return l}function o(t){return t*Math.PI/180}r.default=function(t){return n.geomReduce(t,(function(t,e){return t+function(t){var e,r=0;switch(t.type){case"Polygon":return a(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)r+=a(t.coordinates[e]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(e)}),0)}},{"@turf/meta":61}],58:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/meta");r.default=function(t){var e=[1/0,1/0,-1/0,-1/0];return n.coordEach(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}},{"@turf/meta":61}],59:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/meta"),a=t("@turf/helpers");r.default=function(t,e){void 0===e&&(e={});var r=0,i=0,o=0;return n.coordEach(t,(function(t){r+=t[0],i+=t[1],o++})),a.point([r/o,i/o],e.properties)}},{"@turf/helpers":60,"@turf/meta":61}],60:[function(t,e,r){"use strict";function n(t,e,r){void 0===r&&(r={});var n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}function a(t,e,r){return void 0===r&&(r={}),n({type:"Point",coordinates:t},e,r)}function i(t,e,r){void 0===r&&(r={});for(var a=0,i=t;a<i.length;a++){var o=i[a];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}return n({type:"Polygon",coordinates:t},e,r)}function o(t,e,r){if(void 0===r&&(r={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return n({type:"LineString",coordinates:t},e,r)}function s(t,e){void 0===e&&(e={});var r={type:"FeatureCollection"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}function l(t,e,r){return void 0===r&&(r={}),n({type:"MultiLineString",coordinates:t},e,r)}function c(t,e,r){return void 0===r&&(r={}),n({type:"MultiPoint",coordinates:t},e,r)}function u(t,e,r){return void 0===r&&(r={}),n({type:"MultiPolygon",coordinates:t},e,r)}function h(t,e){void 0===e&&(e="kilometers");var n=r.factors[e];if(!n)throw new Error(e+" units is invalid");return t*n}function f(t,e){void 0===e&&(e="kilometers");var n=r.factors[e];if(!n)throw new Error(e+" units is invalid");return t/n}function p(t){return 180*(t%(2*Math.PI))/Math.PI}function d(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)&&!/^\s*$/.test(t)}Object.defineProperty(r,"__esModule",{value:!0}),r.earthRadius=6371008.8,r.factors={centimeters:100*r.earthRadius,centimetres:100*r.earthRadius,degrees:r.earthRadius/111325,feet:3.28084*r.earthRadius,inches:39.37*r.earthRadius,kilometers:r.earthRadius/1e3,kilometres:r.earthRadius/1e3,meters:r.earthRadius,metres:r.earthRadius,miles:r.earthRadius/1609.344,millimeters:1e3*r.earthRadius,millimetres:1e3*r.earthRadius,nauticalmiles:r.earthRadius/1852,radians:1,yards:r.earthRadius/1.0936},r.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/r.earthRadius,yards:1/1.0936},r.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},r.feature=n,r.geometry=function(t,e,r){switch(void 0===r&&(r={}),t){case"Point":return a(e).geometry;case"LineString":return o(e).geometry;case"Polygon":return i(e).geometry;case"MultiPoint":return c(e).geometry;case"MultiLineString":return l(e).geometry;case"MultiPolygon":return u(e).geometry;default:throw new Error(t+" is invalid")}},r.point=a,r.points=function(t,e,r){return void 0===r&&(r={}),s(t.map((function(t){return a(t,e)})),r)},r.polygon=i,r.polygons=function(t,e,r){return void 0===r&&(r={}),s(t.map((function(t){return i(t,e)})),r)},r.lineString=o,r.lineStrings=function(t,e,r){return void 0===r&&(r={}),s(t.map((function(t){return o(t,e)})),r)},r.featureCollection=s,r.multiLineString=l,r.multiPoint=c,r.multiPolygon=u,r.geometryCollection=function(t,e,r){return void 0===r&&(r={}),n({type:"GeometryCollection",geometries:t},e,r)},r.round=function(t,e){if(void 0===e&&(e=0),e&&!(e>=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r},r.radiansToLength=h,r.lengthToRadians=f,r.lengthToDegrees=function(t,e){return p(f(t,e))},r.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},r.radiansToDegrees=p,r.degreesToRadians=function(t){return t%360*Math.PI/180},r.convertLength=function(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return h(f(t,e),r)},r.convertArea=function(t,e,n){if(void 0===e&&(e="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var a=r.areaFactors[e];if(!a)throw new Error("invalid original units");var i=r.areaFactors[n];if(!i)throw new Error("invalid final units");return t/a*i},r.isNumber=d,r.isObject=function(t){return!!t&&t.constructor===Object},r.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!d(t))throw new Error("bbox must only contain numbers")}))},r.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")},r.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},r.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},r.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},r.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},r.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},r.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},r.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},{}],61:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/helpers");function a(t,e,r){if(null!==t)for(var n,i,o,s,l,c,u,h,f=0,p=0,d=t.type,g="FeatureCollection"===d,m="Feature"===d,v=g?t.features.length:1,y=0;y<v;y++){l=(h=!!(u=g?t.features[y].geometry:m?t.geometry:t)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var x=0;x<l;x++){var b=0,_=0;if(null!==(s=h?u.geometries[x]:u)){c=s.coordinates;var w=s.type;switch(f=!r||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===e(c,p,y,b,_))return!1;p++,b++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(!1===e(c[n],p,y,b,_))return!1;p++,"MultiPoint"===w&&b++}"LineString"===w&&b++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(i=0;i<c[n].length-f;i++){if(!1===e(c[n][i],p,y,b,_))return!1;p++}"MultiLineString"===w&&b++,"Polygon"===w&&_++}"Polygon"===w&&b++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(_=0,i=0;i<c[n].length;i++){for(o=0;o<c[n][i].length-f;o++){if(!1===e(c[n][i][o],p,y,b,_))return!1;p++}_++}b++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(!1===a(s.geometries[n],e,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function i(t,e){var r;switch(t.type){case"FeatureCollection":for(r=0;r<t.features.length&&!1!==e(t.features[r].properties,r);r++);break;case"Feature":e(t.properties,0)}}function o(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var r=0;r<t.features.length&&!1!==e(t.features[r],r);r++);}function s(t,e){var r,n,a,i,o,s,l,c,u,h,f=0,p="FeatureCollection"===t.type,d="Feature"===t.type,g=p?t.features.length:1;for(r=0;r<g;r++){for(s=p?t.features[r].geometry:d?t.geometry:t,c=p?t.features[r].properties:d?t.properties:{},u=p?t.features[r].bbox:d?t.bbox:void 0,h=p?t.features[r].id:d?t.id:void 0,o=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,a=0;a<o;a++)if(null!==(i=l?s.geometries[a]:s))switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(i,f,c,u,h))return!1;break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===e(i.geometries[n],f,c,u,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,f,c,u,h))return!1;f++}}function l(t,e){s(t,(function(t,r,a,i,o){var s,l=null===t?null:t.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return!1!==e(n.feature(t,a,{bbox:i,id:o}),r,0)&&void 0}switch(l){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var c=0;c<t.coordinates.length;c++){var u={type:s,coordinates:t.coordinates[c]};if(!1===e(n.feature(u,a),r,c))return!1}}))}function c(t,e){l(t,(function(t,r,i){var o=0;if(t.geometry){var s=t.geometry.type;if("Point"!==s&&"MultiPoint"!==s){var l,c=0,u=0,h=0;return!1!==a(t,(function(a,s,f,p,d){if(void 0===l||r>c||p>u||d>h)return l=a,c=r,u=p,h=d,void(o=0);var g=n.lineString([l,a],t.properties);if(!1===e(g,r,i,d,o))return!1;o++,l=a}))&&void 0}}}))}function u(t,e){if(!t)throw new Error("geojson is required");l(t,(function(t,r,a){if(null!==t.geometry){var i=t.geometry.type,o=t.geometry.coordinates;switch(i){case"LineString":if(!1===e(t,r,a,0,0))return!1;break;case"Polygon":for(var s=0;s<o.length;s++)if(!1===e(n.lineString(o[s],t.properties),r,a,s))return!1}}}))}r.coordEach=a,r.coordReduce=function(t,e,r,n){var i=r;return a(t,(function(t,n,a,o,s){i=0===n&&void 0===r?t:e(i,t,n,a,o,s)}),n),i},r.propEach=i,r.propReduce=function(t,e,r){var n=r;return i(t,(function(t,a){n=0===a&&void 0===r?t:e(n,t,a)})),n},r.featureEach=o,r.featureReduce=function(t,e,r){var n=r;return o(t,(function(t,a){n=0===a&&void 0===r?t:e(n,t,a)})),n},r.coordAll=function(t){var e=[];return a(t,(function(t){e.push(t)})),e},r.geomEach=s,r.geomReduce=function(t,e,r){var n=r;return s(t,(function(t,a,i,o,s){n=0===a&&void 0===r?t:e(n,t,a,i,o,s)})),n},r.flattenEach=l,r.flattenReduce=function(t,e,r){var n=r;return l(t,(function(t,a,i){n=0===a&&0===i&&void 0===r?t:e(n,t,a,i)})),n},r.segmentEach=c,r.segmentReduce=function(t,e,r){var n=r,a=!1;return c(t,(function(t,i,o,s,l){n=!1===a&&void 0===r?t:e(n,t,i,o,s,l),a=!0})),n},r.lineEach=u,r.lineReduce=function(t,e,r){var n=r;return u(t,(function(t,a,i,o){n=0===a&&void 0===r?t:e(n,t,a,i,o)})),n},r.findSegment=function(t,e){if(e=e||{},!n.isObject(e))throw new Error("options is invalid");var r,a=e.featureIndex||0,i=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.segmentIndex||0,l=e.properties;switch(t.type){case"FeatureCollection":a<0&&(a=t.features.length+a),l=l||t.features[a].properties,r=t.features[a].geometry;break;case"Feature":l=l||t.properties,r=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=t;break;default:throw new Error("geojson is invalid")}if(null===r)return null;var c=r.coordinates;switch(r.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=c.length+s-1),n.lineString([c[s],c[s+1]],l,e);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s-1),n.lineString([c[o][s],c[o][s+1]],l,e);case"MultiLineString":return i<0&&(i=c.length+i),s<0&&(s=c[i].length+s-1),n.lineString([c[i][s],c[i][s+1]],l,e);case"MultiPolygon":return i<0&&(i=c.length+i),o<0&&(o=c[i].length+o),s<0&&(s=c[i][o].length-s-1),n.lineString([c[i][o][s],c[i][o][s+1]],l,e)}throw new Error("geojson is invalid")},r.findPoint=function(t,e){if(e=e||{},!n.isObject(e))throw new Error("options is invalid");var r,a=e.featureIndex||0,i=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.coordIndex||0,l=e.properties;switch(t.type){case"FeatureCollection":a<0&&(a=t.features.length+a),l=l||t.features[a].properties,r=t.features[a].geometry;break;case"Feature":l=l||t.properties,r=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=t;break;default:throw new Error("geojson is invalid")}if(null===r)return null;var c=r.coordinates;switch(r.type){case"Point":return n.point(c,l,e);case"MultiPoint":return i<0&&(i=c.length+i),n.point(c[i],l,e);case"LineString":return s<0&&(s=c.length+s),n.point(c[s],l,e);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s),n.point(c[o][s],l,e);case"MultiLineString":return i<0&&(i=c.length+i),s<0&&(s=c[i].length+s),n.point(c[i][s],l,e);case"MultiPolygon":return i<0&&(i=c.length+i),o<0&&(o=c[i].length+o),s<0&&(s=c[i][o].length-s),n.point(c[i][o][s],l,e)}throw new Error("geojson is invalid")}},{"@turf/helpers":60}],62:[function(t,e,r){"use strict";var n="undefined"==typeof WeakMap?t("weak-map"):WeakMap,a=t("gl-buffer"),i=t("gl-vao"),o=new n;e.exports=function(t){var e=o.get(t),r=e&&(e._triangleBuffer.handle||e._triangleBuffer.buffer);if(!r||!t.isBuffer(r)){var n=a(t,new Float32Array([-1,-1,-1,4,4,-1]));(e=i(t,[{buffer:n,type:t.FLOAT,size:2}]))._triangleBuffer=n,o.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}},{"gl-buffer":253,"gl-vao":327,"weak-map":554}],63:[function(t,e,r){e.exports=function(t){var e=0,r=0,n=0,a=0;return t.map((function(t){var i=(t=t.slice())[0],o=i.toUpperCase();if(i!=o)switch(t[0]=o,i){case"a":t[6]+=n,t[7]+=a;break;case"v":t[1]+=a;break;case"h":t[1]+=n;break;default:for(var s=1;s<t.length;)t[s++]+=n,t[s++]+=a}switch(o){case"Z":n=e,a=r;break;case"H":n=t[1];break;case"V":a=t[1];break;case"M":n=e=t[1],a=r=t[2];break;default:n=t[t.length-2],a=t[t.length-1]}return t}))}},{}],64:[function(t,e,r){var n=t("pad-left");e.exports=function(t,e,r){e="number"==typeof e?e:1,r=r||": ";var a=t.split(/\r?\n/),i=String(a.length+e-1).length;return a.map((function(t,a){var o=a+e,s=String(o).length;return n(o,i-s)+r+t})).join("\n")}},{"pad-left":455}],65:[function(t,e,r){"use strict";e.exports=function(t){var e=t.length;if(0===e)return[];if(1===e)return[0];for(var r=t[0].length,n=[t[0]],i=[0],o=1;o<e;++o)if(n.push(t[o]),a(n,r)){if(i.push(o),i.length===r+1)return i}else n.pop();return i};var n=t("robust-orientation");function a(t,e){for(var r=new Array(e+1),a=0;a<t.length;++a)r[a]=t[a];for(a=0;a<=t.length;++a){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-a,s);r[i]=o}if(n.apply(void 0,r))return!0}return!1}},{"robust-orientation":500}],66:[function(t,e,r){"use strict";e.exports=function(t,e){return n(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}))};var n=t("delaunay-triangulate"),a=t("circumradius")},{circumradius:116,"delaunay-triangulate":166}],67:[function(t,e,r){e.exports=function(t,e){return a(n(t,e))};var n=t("alpha-complex"),a=t("simplicial-complex-boundary")},{"alpha-complex":66,"simplicial-complex-boundary":507}],68:[function(t,e,r){"use strict";e.exports=function(t,e){if(!t||null==t.length)throw Error("Argument should be an array");e=null==e?1:Math.floor(e);for(var r=Array(2*e),n=0;n<e;n++){for(var a=-1/0,i=1/0,o=n,s=t.length;o<s;o+=e)t[o]>a&&(a=t[o]),t[o]<i&&(i=t[o]);r[n]=i,r[e+n]=a}return r}},{}],69:[function(t,e,r){"use strict";var n=t("array-bounds");e.exports=function(t,e,r){if(!t||null==t.length)throw Error("Argument should be an array");null==e&&(e=1);null==r&&(r=n(t,e));for(var a=0;a<e;a++){var i=r[e+a],o=r[a],s=a,l=t.length;if(i===1/0&&o===-1/0)for(s=a;s<l;s+=e)t[s]=t[s]===i?1:t[s]===o?0:.5;else if(i===1/0)for(s=a;s<l;s+=e)t[s]=t[s]===i?1:0;else if(o===-1/0)for(s=a;s<l;s+=e)t[s]=t[s]===o?0:1;else{var c=i-o;for(s=a;s<l;s+=e)isNaN(t[s])||(t[s]=0===c?.5:(t[s]-o)/c)}}return t}},{"array-bounds":68}],70:[function(t,e,r){e.exports=function(t,e){var r="number"==typeof t,n="number"==typeof e;r&&!n?(e=t,t=0):r||n||(t=0,e=0);var a=(e|=0)-(t|=0);if(a<0)throw new Error("array length must be positive");for(var i=new Array(a),o=0,s=t;o<a;o++,s++)i[o]=s;return i}},{}],71:[function(t,e,r){(function(r){"use strict";var n=t("object-assign");
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/function a(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,a=0,i=Math.min(r,n);a<i;++a)if(t[a]!==e[a]){r=t[a],n=e[a];break}return r<n?-1:n<r?1:0}function i(t){return r.Buffer&&"function"==typeof r.Buffer.isBuffer?r.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}var o=t("util/"),s=Object.prototype.hasOwnProperty,l=Array.prototype.slice,c="foo"===function(){}.name;function u(t){return Object.prototype.toString.call(t)}function h(t){return!i(t)&&("function"==typeof r.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}var f=e.exports=y,p=/\s*function\s+([^\(\s]*)\s*/;function d(t){if(o.isFunction(t)){if(c)return t.name;var e=t.toString().match(p);return e&&e[1]}}function g(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function m(t){if(c||!o.isFunction(t))return o.inspect(t);var e=d(t);return"[Function"+(e?": "+e:"")+"]"}function v(t,e,r,n,a){throw new f.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:a})}function y(t,e){t||v(t,!0,e,"==",f.ok)}function x(t,e,r,n){if(t===e)return!0;if(i(t)&&i(e))return 0===a(t,e);if(o.isDate(t)&&o.isDate(e))return t.getTime()===e.getTime();if(o.isRegExp(t)&&o.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(h(t)&&h(e)&&u(t)===u(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===a(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(i(t)!==i(e))return!1;var s=(n=n||{actual:[],expected:[]}).actual.indexOf(t);return-1!==s&&s===n.expected.indexOf(e)||(n.actual.push(t),n.expected.push(e),function(t,e,r,n){if(null==t||null==e)return!1;if(o.isPrimitive(t)||o.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var a=b(t),i=b(e);if(a&&!i||!a&&i)return!1;if(a)return t=l.call(t),e=l.call(e),x(t,e,r);var s,c,u=T(t),h=T(e);if(u.length!==h.length)return!1;for(u.sort(),h.sort(),c=u.length-1;c>=0;c--)if(u[c]!==h[c])return!1;for(c=u.length-1;c>=0;c--)if(s=u[c],!x(t[s],e[s],r,n))return!1;return!0}(t,e,r,n))}return r?t===e:t==e}function b(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function _(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 w(t,e,r,n){var a;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),a=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!a&&v(a,r,"Missing expected exception"+n);var i="string"==typeof n,s=!t&&a&&!r;if((!t&&o.isError(a)&&i&&_(a,r)||s)&&v(a,r,"Got unwanted exception"+n),t&&a&&r&&!_(a,r)||!t&&a)throw a}f.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=function(t){return g(m(t.actual),128)+" "+t.operator+" "+g(m(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||v;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,a=d(e),i=n.indexOf("\n"+a);if(i>=0){var o=n.indexOf("\n",i+1);n=n.substring(o+1)}this.stack=n}}},o.inherits(f.AssertionError,Error),f.fail=v,f.ok=y,f.equal=function(t,e,r){t!=e&&v(t,e,r,"==",f.equal)},f.notEqual=function(t,e,r){t==e&&v(t,e,r,"!=",f.notEqual)},f.deepEqual=function(t,e,r){x(t,e,!1)||v(t,e,r,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(t,e,r){x(t,e,!0)||v(t,e,r,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(t,e,r){x(t,e,!1)&&v(t,e,r,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function t(e,r,n){x(e,r,!0)&&v(e,r,n,"notDeepStrictEqual",t)},f.strictEqual=function(t,e,r){t!==e&&v(t,e,r,"===",f.strictEqual)},f.notStrictEqual=function(t,e,r){t===e&&v(t,e,r,"!==",f.notStrictEqual)},f.throws=function(t,e,r){w(!0,t,e,r)},f.doesNotThrow=function(t,e,r){w(!1,t,e,r)},f.ifError=function(t){if(t)throw t},f.strict=n((function t(e,r){e||v(e,!0,r,"==",t)}),f,{equal:f.strictEqual,deepEqual:f.deepStrictEqual,notEqual:f.notStrictEqual,notDeepEqual:f.notDeepStrictEqual}),f.strict.strict=f.strict;var T=Object.keys||function(t){var e=[];for(var r in t)s.call(t,r)&&e.push(r);return e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"object-assign":452,"util/":74}],72:[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}},{}],73:[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}},{}],74:[function(t,e,r){(function(e,n){var a=/%[sdj%]/g;r.format=function(t){if(!v(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(s(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,i=n.length,o=String(t).replace(a,(function(t){if("%%"===t)return"%";if(r>=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),l=n[r];r<i;l=n[++r])g(l)||!b(l)?o+=" "+l:o+=" "+s(l);return o},r.deprecate=function(t,a){if(y(n.process))return function(){return r.deprecate(t,a).apply(this,arguments)};if(!0===e.noDeprecation)return t;var i=!1;return function(){if(!i){if(e.throwDeprecation)throw new Error(a);e.traceDeprecation?console.trace(a):console.error(a),i=!0}return t.apply(this,arguments)}};var i,o={};function s(t,e){var n={seen:[],stylize:c};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(e)?n.showHidden=e:e&&r._extend(n,e),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),u(n,t,n.depth)}function l(t,e){var r=s.styles[e];return r?"\x1b["+s.colors[r][0]+"m"+t+"\x1b["+s.colors[r][1]+"m":t}function c(t,e){return t}function u(t,e,n){if(t.customInspect&&e&&T(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var a=e.inspect(n,t);return v(a)||(a=u(t,a,n)),a}var i=function(t,e){if(y(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(m(e))return t.stylize(""+e,"number");if(d(e))return t.stylize(""+e,"boolean");if(g(e))return t.stylize("null","null")}(t,e);if(i)return i;var o=Object.keys(e),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),w(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return h(e);if(0===o.length){if(T(e)){var l=e.name?": "+e.name:"";return t.stylize("[Function"+l+"]","special")}if(x(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(_(e))return t.stylize(Date.prototype.toString.call(e),"date");if(w(e))return h(e)}var c,b="",k=!1,A=["{","}"];(p(e)&&(k=!0,A=["[","]"]),T(e))&&(b=" [Function"+(e.name?": "+e.name:"")+"]");return x(e)&&(b=" "+RegExp.prototype.toString.call(e)),_(e)&&(b=" "+Date.prototype.toUTCString.call(e)),w(e)&&(b=" "+h(e)),0!==o.length||k&&0!=e.length?n<0?x(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),c=k?function(t,e,r,n,a){for(var i=[],o=0,s=e.length;o<s;++o)E(e,String(o))?i.push(f(t,e,r,n,String(o),!0)):i.push("");return a.forEach((function(a){a.match(/^\d+$/)||i.push(f(t,e,r,n,a,!0))})),i}(t,e,n,s,o):o.map((function(r){return f(t,e,n,s,r,k)})),t.seen.pop(),function(t,e,r){if(t.reduce((function(t,e){return e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(c,b,A)):A[0]+b+A[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,r,n,a,i){var o,s,l;if((l=Object.getOwnPropertyDescriptor(e,a)||{value:e[a]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),E(n,a)||(o="["+a+"]"),s||(t.seen.indexOf(l.value)<0?(s=g(r)?u(t,l.value,null):u(t,l.value,r-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),y(o)){if(i&&a.match(/^\d+$/))return s;(o=JSON.stringify(""+a)).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 p(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function g(t){return null===t}function m(t){return"number"==typeof t}function v(t){return"string"==typeof t}function y(t){return void 0===t}function x(t){return b(t)&&"[object RegExp]"===k(t)}function b(t){return"object"==typeof t&&null!==t}function _(t){return b(t)&&"[object Date]"===k(t)}function w(t){return b(t)&&("[object Error]"===k(t)||t instanceof Error)}function T(t){return"function"==typeof t}function k(t){return Object.prototype.toString.call(t)}function A(t){return t<10?"0"+t.toString(10):t.toString(10)}r.debuglog=function(t){if(y(i)&&(i=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!o[t])if(new RegExp("\\b"+t+"\\b","i").test(i)){var n=e.pid;o[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else o[t]=function(){};return o[t]},r.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=p,r.isBoolean=d,r.isNull=g,r.isNullOrUndefined=function(t){return null==t},r.isNumber=m,r.isString=v,r.isSymbol=function(t){return"symbol"==typeof t},r.isUndefined=y,r.isRegExp=x,r.isObject=b,r.isDate=_,r.isError=w,r.isFunction=T,r.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t},r.isBuffer=t("./support/isBuffer");var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function S(){var t=new Date,e=[A(t.getHours()),A(t.getMinutes()),A(t.getSeconds())].join(":");return[t.getDate(),M[t.getMonth()],e].join(" ")}function E(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.log=function(){console.log("%s - %s",S(),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!b(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":73,_process:480,inherits:72}],75:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],76:[function(t,e,r){"use strict";e.exports=function(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;var c=new Array(r+1);for(o=0;o<r;++o)c[o]=e[o];c[r]=1;var u=n(i,c),h=a(u[r+1]);0===h&&(h=1);var f=new Array(r+1);for(o=0;o<=r;++o)f[o]=a(u[o])/h;return f};var n=t("robust-linear-solve");function a(t){for(var e=0,r=0;r<t.length;++r)e+=t[r];return e}},{"robust-linear-solve":499}],77:[function(t,e,r){"use strict";r.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},r.toByteArray=function(t){var e,r,n=c(t),o=n[0],s=n[1],l=new i(function(t,e,r){return 3*(e+r)/4-r}(0,o,s)),u=0,h=s>0?o-4:o;for(r=0;r<h;r+=4)e=a[t.charCodeAt(r)]<<18|a[t.charCodeAt(r+1)]<<12|a[t.charCodeAt(r+2)]<<6|a[t.charCodeAt(r+3)],l[u++]=e>>16&255,l[u++]=e>>8&255,l[u++]=255&e;2===s&&(e=a[t.charCodeAt(r)]<<2|a[t.charCodeAt(r+1)]>>4,l[u++]=255&e);1===s&&(e=a[t.charCodeAt(r)]<<10|a[t.charCodeAt(r+1)]<<4|a[t.charCodeAt(r+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e);return l},r.fromByteArray=function(t){for(var e,r=t.length,a=r%3,i=[],o=0,s=r-a;o<s;o+=16383)i.push(u(t,o,o+16383>s?s:o+16383));1===a?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===a&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],a=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s<l;++s)n[s]=o[s],a[o.charCodeAt(s)]=s;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,r){for(var a,i,o=[],s=e;s<r;s+=3)a=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(n[(i=a)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},{}],78:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}},{"./lib/rationalize":88}],79:[function(t,e,r){"use strict";e.exports=function(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}},{}],80:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]),t[1].mul(e[0]))}},{"./lib/rationalize":88}],81:[function(t,e,r){"use strict";var n=t("./is-rat"),a=t("./lib/is-bn"),i=t("./lib/num-to-bn"),o=t("./lib/str-to-bn"),s=t("./lib/rationalize"),l=t("./div");e.exports=function t(e,r){if(n(e))return r?l(e,t(r)):[e[0].clone(),e[1].clone()];var c,u,h=0;if(a(e))c=e.clone();else if("string"==typeof e)c=o(e);else{if(0===e)return[i(0),i(1)];if(e===Math.floor(e))c=i(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),h-=256;c=i(e)}}if(n(r))c.mul(r[1]),u=r[0].clone();else if(a(r))u=r.clone();else if("string"==typeof r)u=o(r);else if(r)if(r===Math.floor(r))u=i(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),h+=256;u=i(r)}else u=i(1);h>0?c=c.ushln(h):h<0&&(u=u.ushln(-h));return s(c,u)}},{"./div":80,"./is-rat":82,"./lib/is-bn":86,"./lib/num-to-bn":87,"./lib/rationalize":88,"./lib/str-to-bn":89}],82:[function(t,e,r){"use strict";var n=t("./lib/is-bn");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{"./lib/is-bn":86}],83:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return t.cmp(new n(0))}},{"bn.js":97}],84:[function(t,e,r){"use strict";var n=t("./bn-sign");e.exports=function(t){var e=t.length,r=t.words,a=0;if(1===e)a=r[0];else if(2===e)a=r[0]+67108864*r[1];else for(var i=0;i<e;i++){var o=r[i];a+=o*Math.pow(67108864,i)}return n(t)*a}},{"./bn-sign":83}],85:[function(t,e,r){"use strict";var n=t("double-bits"),a=t("bit-twiddle").countTrailingZeros;e.exports=function(t){var e=a(n.lo(t));if(e<32)return e;var r=a(n.hi(t));if(r>20)return 52;return r+32}},{"bit-twiddle":95,"double-bits":168}],86:[function(t,e,r){"use strict";t("bn.js");e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":97}],87:[function(t,e,r){"use strict";var n=t("bn.js"),a=t("double-bits");e.exports=function(t){var e=a.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},{"bn.js":97,"double-bits":168}],88:[function(t,e,r){"use strict";var n=t("./num-to-bn"),a=t("./bn-sign");e.exports=function(t,e){var r=a(t),i=a(e);if(0===r)return[n(0),n(1)];if(0===i)return[n(0),n(0)];i<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);if(o.cmpn(1))return[t.div(o),e.div(o)];return[t,e]}},{"./bn-sign":83,"./num-to-bn":87}],89:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return new n(t)}},{"bn.js":97}],90:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{"./lib/rationalize":88}],91:[function(t,e,r){"use strict";var n=t("./lib/bn-sign");e.exports=function(t){return n(t[0])*n(t[1])}},{"./lib/bn-sign":83}],92:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{"./lib/rationalize":88}],93:[function(t,e,r){"use strict";var n=t("./lib/bn-to-num"),a=t("./lib/ctz");e.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var i=e.abs().divmod(r.abs()),o=i.div,s=n(o),l=i.mod,c=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=a(s)+4,h=n(l.ushln(u).divRound(r));return c*(s+h*Math.pow(2,-u))}var f=r.bitLength()-l.bitLength()+53;h=n(l.ushln(f).divRound(r));return f<1023?c*h*Math.pow(2,-f):(h*=Math.pow(2,-1023),c*h*Math.pow(2,1023-f))}},{"./lib/bn-to-num":84,"./lib/ctz":85}],94:[function(t,e,r){"use strict";function n(t,e,r,n,a){var i=["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[m]"];return a?e.indexOf("c")<0?i.push(";if(x===y){return m}else if(x<=y){"):i.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):i.push(";if(",e,"){i=m;"),r?i.push("l=m+1}else{h=m-1}"):i.push("h=m-1}else{l=m+1}"),i.push("}"),a?i.push("return -1};"):i.push("return i};"),i.join("")}function a(t,e,r,a){return new Function([n("A","x"+t+"y",e,["y"],a),n("P","c(x,y)"+t+"0",e,["y","c"],a),"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:a(">=",!1,"GE"),gt:a(">",!1,"GT"),lt:a("<",!0,"LT"),le:a("<=",!0,"LE"),eq:a("-",!0,"EQ",!0)}},{}],95:[function(t,e,r){"use strict";function n(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t<e)},r.max=function(t,e){return t^(t^e)&-(t<e)},r.isPow2=function(t){return!(t&t-1||!t)},r.log2=function(t){var e,r;return e=(t>65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var a=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,a=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--a;t[e]=n<<a&255}}(a),r.reverse=function(t){return a[255&t]<<24|a[t>>>8&255]<<16|a[t>>>16&255]<<8|a[t>>>24&255]},r.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},r.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],96:[function(t,e,r){"use strict";var n=t("clamp");e.exports=function(t,e){e||(e={});var r,o,s,l,c,u,h,f,p,d,g,m=null==e.cutoff?.25:e.cutoff,v=null==e.radius?8:e.radius,y=e.channel||0;if(ArrayBuffer.isView(t)||Array.isArray(t)){if(!e.width||!e.height)throw Error("For raw data width and height should be provided by options");r=e.width,o=e.height,l=t,u=e.stride?e.stride:Math.floor(t.length/r/o)}else window.HTMLCanvasElement&&t instanceof window.HTMLCanvasElement?(h=(f=t).getContext("2d"),r=f.width,o=f.height,p=h.getImageData(0,0,r,o),l=p.data,u=4):window.CanvasRenderingContext2D&&t instanceof window.CanvasRenderingContext2D?(f=t.canvas,h=t,r=f.width,o=f.height,p=h.getImageData(0,0,r,o),l=p.data,u=4):window.ImageData&&t instanceof window.ImageData&&(p=t,r=t.width,o=t.height,l=p.data,u=4);if(s=Math.max(r,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(c=l,l=Array(r*o),d=0,g=c.length;d<g;d++)l[d]=c[d*u+y]/255;else if(1!==u)throw Error("Raw data can have only 1 value per pixel");var x=Array(r*o),b=Array(r*o),_=Array(s),w=Array(s),T=Array(s+1),k=Array(s);for(d=0,g=r*o;d<g;d++){var A=l[d];x[d]=1===A?0:0===A?a:Math.pow(Math.max(0,.5-A),2),b[d]=1===A?a:0===A?0:Math.pow(Math.max(0,A-.5),2)}i(x,r,o,_,w,k,T),i(b,r,o,_,w,k,T);var M=window.Float32Array?new Float32Array(r*o):new Array(r*o);for(d=0,g=r*o;d<g;d++)M[d]=n(1-((x[d]-b[d])/v+m),0,1);return M};var a=1e20;function i(t,e,r,n,a,i,s){for(var l=0;l<e;l++){for(var c=0;c<r;c++)n[c]=t[c*e+l];for(o(n,a,i,s,r),c=0;c<r;c++)t[c*e+l]=a[c]}for(c=0;c<r;c++){for(l=0;l<e;l++)n[l]=t[c*e+l];for(o(n,a,i,s,e),l=0;l<e;l++)t[c*e+l]=Math.sqrt(a[l])}}function o(t,e,r,n,i){r[0]=0,n[0]=-a,n[1]=+a;for(var o=1,s=0;o<i;o++){for(var l=(t[o]+o*o-(t[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);l<=n[s];)s--,l=(t[o]+o*o-(t[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);r[++s]=o,n[s]=l,n[s+1]=+a}for(o=0,s=0;o<i;o++){for(;n[s+1]<o;)s++;e[o]=(o-r[s])*(o-r[s])+t[r[s]]}}},{clamp:117}],97:[function(t,e,r){!function(e,r){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function a(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function i(t,e,r){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof e?e.exports=i:r.BN=i,i.BN=i,i.wordSize=26;try{o=t("buffer").Buffer}catch(t){}function s(t,e,r){for(var n=0,a=Math.min(t.length,r),i=e;i<a;i++){var o=t.charCodeAt(i)-48;n<<=4,n|=o>=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function l(t,e,r,n){for(var a=0,i=Math.min(t.length,r),o=e;o<i;o++){var s=t.charCodeAt(o)-48;a*=n,a+=s>=49?s-49+10:s>=17?s-17+10:s}return a}i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.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 a=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&a++,16===e?this._parseHex(t,a):this._parseBase(t,e,a),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},i.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)},i.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 a=0;a<this.length;a++)this.words[a]=0;var i,o,s=0;if("be"===r)for(a=t.length-1,i=0;a>=0;a-=3)o=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[i]|=o<<s&67108863,this.words[i+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===r)for(a=0,i=0;a<t.length;a+=3)o=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[i]|=o<<s&67108863,this.words[i+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},i.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,a,i=0;for(r=t.length-6,n=0;r>=e;r-=6)a=s(t,r,r+6),this.words[n]|=a<<i&67108863,this.words[n+1]|=a>>>26-i&4194303,(i+=24)>=26&&(i-=26,n++);r+6!==e&&(a=s(t,e,r+6),this.words[n]|=a<<i&67108863,this.words[n+1]|=a>>>26-i&4194303),this.strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=e)n++;n--,a=a/e|0;for(var i=t.length-r,o=i%n,s=Math.min(i,i-o)+r,c=0,u=r;u<s;u+=n)c=l(t,u,u+n,e),this.imuln(a),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==o){var h=1;for(c=l(t,u,t.length,e),u=0;u<o;u++)h*=e;this.imuln(h),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}},i.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var a=0|t.words[0],i=0|e.words[0],o=a*i,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var c=1;c<n;c++){for(var u=l>>>26,h=67108863&l,f=Math.min(c,e.length-1),p=Math.max(0,c-t.length+1);p<=f;p++){var d=c-p|0;u+=(o=(a=0|t.words[d])*(i=0|e.words[p])+h)/67108864|0,h=67108863&o}r.words[c]=0|h,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}i.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var a=0,i=0,o=0;o<this.length;o++){var s=this.words[o],l=(16777215&(s<<a|i)).toString(16);r=0!==(i=s>>>24-a&16777215)||o!==this.length-1?c[6-l.length]+l+r:l+r,(a+=2)>=26&&(a-=26,o--)}for(0!==i&&(r=i.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 f=u[t],p=h[t];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var g=d.modn(p).toString(t);r=(d=d.idivn(p)).isZero()?g+r:c[f-g.length]+g+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")},i.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},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(t,e){return n("undefined"!=typeof o),this.toArrayLike(o,t,e)},i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,r){var a=this.byteLength(),i=r||Math.max(1,a);n(a<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,c=new t(i),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[s]=o;for(;s<i;s++)c[s]=0}else{for(s=0;s<i-a;s++)c[s]=0;for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[i-s-1]=o}return c},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.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},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},i.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.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()},i.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.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()},i.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.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()},i.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.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 a=0;a<e;a++)this.words[a]=67108863&~this.words[a];return r>0&&(this.words[a]=~this.words[a]&67108863>>26-r),this.strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,a=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<a:this.words[r]&~(1<<a),this.strip()},i.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var a=0,i=0;i<n.length;i++)e=(0|r.words[i])+(0|n.words[i])+a,this.words[i]=67108863&e,a=e>>>26;for(;0!==a&&i<r.length;i++)e=(0|r.words[i])+a,this.words[i]=67108863&e,a=e>>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},i.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)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,a=this.cmp(t);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)i=(e=(0|r.words[o])-(0|n.words[o])+i)>>26,this.words[o]=67108863&e;for(;0!==i&&o<r.length;o++)i=(e=(0|r.words[o])+i)>>26,this.words[o]=67108863&e;if(0===i&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,a,i,o=t.words,s=e.words,l=r.words,c=0,u=0|o[0],h=8191&u,f=u>>>13,p=0|o[1],d=8191&p,g=p>>>13,m=0|o[2],v=8191&m,y=m>>>13,x=0|o[3],b=8191&x,_=x>>>13,w=0|o[4],T=8191&w,k=w>>>13,A=0|o[5],M=8191&A,S=A>>>13,E=0|o[6],C=8191&E,L=E>>>13,P=0|o[7],I=8191&P,z=P>>>13,O=0|o[8],D=8191&O,R=O>>>13,F=0|o[9],B=8191&F,N=F>>>13,j=0|s[0],V=8191&j,U=j>>>13,q=0|s[1],H=8191&q,G=q>>>13,Y=0|s[2],W=8191&Y,Z=Y>>>13,X=0|s[3],J=8191&X,K=X>>>13,Q=0|s[4],$=8191&Q,tt=Q>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,at=0|s[6],it=8191&at,ot=at>>>13,st=0|s[7],lt=8191&st,ct=st>>>13,ut=0|s[8],ht=8191&ut,ft=ut>>>13,pt=0|s[9],dt=8191&pt,gt=pt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(c+(n=Math.imul(h,V))|0)+((8191&(a=(a=Math.imul(h,U))+Math.imul(f,V)|0))<<13)|0;c=((i=Math.imul(f,U))+(a>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(d,V),a=(a=Math.imul(d,U))+Math.imul(g,V)|0,i=Math.imul(g,U);var vt=(c+(n=n+Math.imul(h,H)|0)|0)+((8191&(a=(a=a+Math.imul(h,G)|0)+Math.imul(f,H)|0))<<13)|0;c=((i=i+Math.imul(f,G)|0)+(a>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,V),a=(a=Math.imul(v,U))+Math.imul(y,V)|0,i=Math.imul(y,U),n=n+Math.imul(d,H)|0,a=(a=a+Math.imul(d,G)|0)+Math.imul(g,H)|0,i=i+Math.imul(g,G)|0;var yt=(c+(n=n+Math.imul(h,W)|0)|0)+((8191&(a=(a=a+Math.imul(h,Z)|0)+Math.imul(f,W)|0))<<13)|0;c=((i=i+Math.imul(f,Z)|0)+(a>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(b,V),a=(a=Math.imul(b,U))+Math.imul(_,V)|0,i=Math.imul(_,U),n=n+Math.imul(v,H)|0,a=(a=a+Math.imul(v,G)|0)+Math.imul(y,H)|0,i=i+Math.imul(y,G)|0,n=n+Math.imul(d,W)|0,a=(a=a+Math.imul(d,Z)|0)+Math.imul(g,W)|0,i=i+Math.imul(g,Z)|0;var xt=(c+(n=n+Math.imul(h,J)|0)|0)+((8191&(a=(a=a+Math.imul(h,K)|0)+Math.imul(f,J)|0))<<13)|0;c=((i=i+Math.imul(f,K)|0)+(a>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(T,V),a=(a=Math.imul(T,U))+Math.imul(k,V)|0,i=Math.imul(k,U),n=n+Math.imul(b,H)|0,a=(a=a+Math.imul(b,G)|0)+Math.imul(_,H)|0,i=i+Math.imul(_,G)|0,n=n+Math.imul(v,W)|0,a=(a=a+Math.imul(v,Z)|0)+Math.imul(y,W)|0,i=i+Math.imul(y,Z)|0,n=n+Math.imul(d,J)|0,a=(a=a+Math.imul(d,K)|0)+Math.imul(g,J)|0,i=i+Math.imul(g,K)|0;var bt=(c+(n=n+Math.imul(h,$)|0)|0)+((8191&(a=(a=a+Math.imul(h,tt)|0)+Math.imul(f,$)|0))<<13)|0;c=((i=i+Math.imul(f,tt)|0)+(a>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,V),a=(a=Math.imul(M,U))+Math.imul(S,V)|0,i=Math.imul(S,U),n=n+Math.imul(T,H)|0,a=(a=a+Math.imul(T,G)|0)+Math.imul(k,H)|0,i=i+Math.imul(k,G)|0,n=n+Math.imul(b,W)|0,a=(a=a+Math.imul(b,Z)|0)+Math.imul(_,W)|0,i=i+Math.imul(_,Z)|0,n=n+Math.imul(v,J)|0,a=(a=a+Math.imul(v,K)|0)+Math.imul(y,J)|0,i=i+Math.imul(y,K)|0,n=n+Math.imul(d,$)|0,a=(a=a+Math.imul(d,tt)|0)+Math.imul(g,$)|0,i=i+Math.imul(g,tt)|0;var _t=(c+(n=n+Math.imul(h,rt)|0)|0)+((8191&(a=(a=a+Math.imul(h,nt)|0)+Math.imul(f,rt)|0))<<13)|0;c=((i=i+Math.imul(f,nt)|0)+(a>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(C,V),a=(a=Math.imul(C,U))+Math.imul(L,V)|0,i=Math.imul(L,U),n=n+Math.imul(M,H)|0,a=(a=a+Math.imul(M,G)|0)+Math.imul(S,H)|0,i=i+Math.imul(S,G)|0,n=n+Math.imul(T,W)|0,a=(a=a+Math.imul(T,Z)|0)+Math.imul(k,W)|0,i=i+Math.imul(k,Z)|0,n=n+Math.imul(b,J)|0,a=(a=a+Math.imul(b,K)|0)+Math.imul(_,J)|0,i=i+Math.imul(_,K)|0,n=n+Math.imul(v,$)|0,a=(a=a+Math.imul(v,tt)|0)+Math.imul(y,$)|0,i=i+Math.imul(y,tt)|0,n=n+Math.imul(d,rt)|0,a=(a=a+Math.imul(d,nt)|0)+Math.imul(g,rt)|0,i=i+Math.imul(g,nt)|0;var wt=(c+(n=n+Math.imul(h,it)|0)|0)+((8191&(a=(a=a+Math.imul(h,ot)|0)+Math.imul(f,it)|0))<<13)|0;c=((i=i+Math.imul(f,ot)|0)+(a>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(I,V),a=(a=Math.imul(I,U))+Math.imul(z,V)|0,i=Math.imul(z,U),n=n+Math.imul(C,H)|0,a=(a=a+Math.imul(C,G)|0)+Math.imul(L,H)|0,i=i+Math.imul(L,G)|0,n=n+Math.imul(M,W)|0,a=(a=a+Math.imul(M,Z)|0)+Math.imul(S,W)|0,i=i+Math.imul(S,Z)|0,n=n+Math.imul(T,J)|0,a=(a=a+Math.imul(T,K)|0)+Math.imul(k,J)|0,i=i+Math.imul(k,K)|0,n=n+Math.imul(b,$)|0,a=(a=a+Math.imul(b,tt)|0)+Math.imul(_,$)|0,i=i+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,a=(a=a+Math.imul(v,nt)|0)+Math.imul(y,rt)|0,i=i+Math.imul(y,nt)|0,n=n+Math.imul(d,it)|0,a=(a=a+Math.imul(d,ot)|0)+Math.imul(g,it)|0,i=i+Math.imul(g,ot)|0;var Tt=(c+(n=n+Math.imul(h,lt)|0)|0)+((8191&(a=(a=a+Math.imul(h,ct)|0)+Math.imul(f,lt)|0))<<13)|0;c=((i=i+Math.imul(f,ct)|0)+(a>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,V),a=(a=Math.imul(D,U))+Math.imul(R,V)|0,i=Math.imul(R,U),n=n+Math.imul(I,H)|0,a=(a=a+Math.imul(I,G)|0)+Math.imul(z,H)|0,i=i+Math.imul(z,G)|0,n=n+Math.imul(C,W)|0,a=(a=a+Math.imul(C,Z)|0)+Math.imul(L,W)|0,i=i+Math.imul(L,Z)|0,n=n+Math.imul(M,J)|0,a=(a=a+Math.imul(M,K)|0)+Math.imul(S,J)|0,i=i+Math.imul(S,K)|0,n=n+Math.imul(T,$)|0,a=(a=a+Math.imul(T,tt)|0)+Math.imul(k,$)|0,i=i+Math.imul(k,tt)|0,n=n+Math.imul(b,rt)|0,a=(a=a+Math.imul(b,nt)|0)+Math.imul(_,rt)|0,i=i+Math.imul(_,nt)|0,n=n+Math.imul(v,it)|0,a=(a=a+Math.imul(v,ot)|0)+Math.imul(y,it)|0,i=i+Math.imul(y,ot)|0,n=n+Math.imul(d,lt)|0,a=(a=a+Math.imul(d,ct)|0)+Math.imul(g,lt)|0,i=i+Math.imul(g,ct)|0;var kt=(c+(n=n+Math.imul(h,ht)|0)|0)+((8191&(a=(a=a+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;c=((i=i+Math.imul(f,ft)|0)+(a>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(B,V),a=(a=Math.imul(B,U))+Math.imul(N,V)|0,i=Math.imul(N,U),n=n+Math.imul(D,H)|0,a=(a=a+Math.imul(D,G)|0)+Math.imul(R,H)|0,i=i+Math.imul(R,G)|0,n=n+Math.imul(I,W)|0,a=(a=a+Math.imul(I,Z)|0)+Math.imul(z,W)|0,i=i+Math.imul(z,Z)|0,n=n+Math.imul(C,J)|0,a=(a=a+Math.imul(C,K)|0)+Math.imul(L,J)|0,i=i+Math.imul(L,K)|0,n=n+Math.imul(M,$)|0,a=(a=a+Math.imul(M,tt)|0)+Math.imul(S,$)|0,i=i+Math.imul(S,tt)|0,n=n+Math.imul(T,rt)|0,a=(a=a+Math.imul(T,nt)|0)+Math.imul(k,rt)|0,i=i+Math.imul(k,nt)|0,n=n+Math.imul(b,it)|0,a=(a=a+Math.imul(b,ot)|0)+Math.imul(_,it)|0,i=i+Math.imul(_,ot)|0,n=n+Math.imul(v,lt)|0,a=(a=a+Math.imul(v,ct)|0)+Math.imul(y,lt)|0,i=i+Math.imul(y,ct)|0,n=n+Math.imul(d,ht)|0,a=(a=a+Math.imul(d,ft)|0)+Math.imul(g,ht)|0,i=i+Math.imul(g,ft)|0;var At=(c+(n=n+Math.imul(h,dt)|0)|0)+((8191&(a=(a=a+Math.imul(h,gt)|0)+Math.imul(f,dt)|0))<<13)|0;c=((i=i+Math.imul(f,gt)|0)+(a>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,H),a=(a=Math.imul(B,G))+Math.imul(N,H)|0,i=Math.imul(N,G),n=n+Math.imul(D,W)|0,a=(a=a+Math.imul(D,Z)|0)+Math.imul(R,W)|0,i=i+Math.imul(R,Z)|0,n=n+Math.imul(I,J)|0,a=(a=a+Math.imul(I,K)|0)+Math.imul(z,J)|0,i=i+Math.imul(z,K)|0,n=n+Math.imul(C,$)|0,a=(a=a+Math.imul(C,tt)|0)+Math.imul(L,$)|0,i=i+Math.imul(L,tt)|0,n=n+Math.imul(M,rt)|0,a=(a=a+Math.imul(M,nt)|0)+Math.imul(S,rt)|0,i=i+Math.imul(S,nt)|0,n=n+Math.imul(T,it)|0,a=(a=a+Math.imul(T,ot)|0)+Math.imul(k,it)|0,i=i+Math.imul(k,ot)|0,n=n+Math.imul(b,lt)|0,a=(a=a+Math.imul(b,ct)|0)+Math.imul(_,lt)|0,i=i+Math.imul(_,ct)|0,n=n+Math.imul(v,ht)|0,a=(a=a+Math.imul(v,ft)|0)+Math.imul(y,ht)|0,i=i+Math.imul(y,ft)|0;var Mt=(c+(n=n+Math.imul(d,dt)|0)|0)+((8191&(a=(a=a+Math.imul(d,gt)|0)+Math.imul(g,dt)|0))<<13)|0;c=((i=i+Math.imul(g,gt)|0)+(a>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,W),a=(a=Math.imul(B,Z))+Math.imul(N,W)|0,i=Math.imul(N,Z),n=n+Math.imul(D,J)|0,a=(a=a+Math.imul(D,K)|0)+Math.imul(R,J)|0,i=i+Math.imul(R,K)|0,n=n+Math.imul(I,$)|0,a=(a=a+Math.imul(I,tt)|0)+Math.imul(z,$)|0,i=i+Math.imul(z,tt)|0,n=n+Math.imul(C,rt)|0,a=(a=a+Math.imul(C,nt)|0)+Math.imul(L,rt)|0,i=i+Math.imul(L,nt)|0,n=n+Math.imul(M,it)|0,a=(a=a+Math.imul(M,ot)|0)+Math.imul(S,it)|0,i=i+Math.imul(S,ot)|0,n=n+Math.imul(T,lt)|0,a=(a=a+Math.imul(T,ct)|0)+Math.imul(k,lt)|0,i=i+Math.imul(k,ct)|0,n=n+Math.imul(b,ht)|0,a=(a=a+Math.imul(b,ft)|0)+Math.imul(_,ht)|0,i=i+Math.imul(_,ft)|0;var St=(c+(n=n+Math.imul(v,dt)|0)|0)+((8191&(a=(a=a+Math.imul(v,gt)|0)+Math.imul(y,dt)|0))<<13)|0;c=((i=i+Math.imul(y,gt)|0)+(a>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(B,J),a=(a=Math.imul(B,K))+Math.imul(N,J)|0,i=Math.imul(N,K),n=n+Math.imul(D,$)|0,a=(a=a+Math.imul(D,tt)|0)+Math.imul(R,$)|0,i=i+Math.imul(R,tt)|0,n=n+Math.imul(I,rt)|0,a=(a=a+Math.imul(I,nt)|0)+Math.imul(z,rt)|0,i=i+Math.imul(z,nt)|0,n=n+Math.imul(C,it)|0,a=(a=a+Math.imul(C,ot)|0)+Math.imul(L,it)|0,i=i+Math.imul(L,ot)|0,n=n+Math.imul(M,lt)|0,a=(a=a+Math.imul(M,ct)|0)+Math.imul(S,lt)|0,i=i+Math.imul(S,ct)|0,n=n+Math.imul(T,ht)|0,a=(a=a+Math.imul(T,ft)|0)+Math.imul(k,ht)|0,i=i+Math.imul(k,ft)|0;var Et=(c+(n=n+Math.imul(b,dt)|0)|0)+((8191&(a=(a=a+Math.imul(b,gt)|0)+Math.imul(_,dt)|0))<<13)|0;c=((i=i+Math.imul(_,gt)|0)+(a>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(B,$),a=(a=Math.imul(B,tt))+Math.imul(N,$)|0,i=Math.imul(N,tt),n=n+Math.imul(D,rt)|0,a=(a=a+Math.imul(D,nt)|0)+Math.imul(R,rt)|0,i=i+Math.imul(R,nt)|0,n=n+Math.imul(I,it)|0,a=(a=a+Math.imul(I,ot)|0)+Math.imul(z,it)|0,i=i+Math.imul(z,ot)|0,n=n+Math.imul(C,lt)|0,a=(a=a+Math.imul(C,ct)|0)+Math.imul(L,lt)|0,i=i+Math.imul(L,ct)|0,n=n+Math.imul(M,ht)|0,a=(a=a+Math.imul(M,ft)|0)+Math.imul(S,ht)|0,i=i+Math.imul(S,ft)|0;var Ct=(c+(n=n+Math.imul(T,dt)|0)|0)+((8191&(a=(a=a+Math.imul(T,gt)|0)+Math.imul(k,dt)|0))<<13)|0;c=((i=i+Math.imul(k,gt)|0)+(a>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(B,rt),a=(a=Math.imul(B,nt))+Math.imul(N,rt)|0,i=Math.imul(N,nt),n=n+Math.imul(D,it)|0,a=(a=a+Math.imul(D,ot)|0)+Math.imul(R,it)|0,i=i+Math.imul(R,ot)|0,n=n+Math.imul(I,lt)|0,a=(a=a+Math.imul(I,ct)|0)+Math.imul(z,lt)|0,i=i+Math.imul(z,ct)|0,n=n+Math.imul(C,ht)|0,a=(a=a+Math.imul(C,ft)|0)+Math.imul(L,ht)|0,i=i+Math.imul(L,ft)|0;var Lt=(c+(n=n+Math.imul(M,dt)|0)|0)+((8191&(a=(a=a+Math.imul(M,gt)|0)+Math.imul(S,dt)|0))<<13)|0;c=((i=i+Math.imul(S,gt)|0)+(a>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(B,it),a=(a=Math.imul(B,ot))+Math.imul(N,it)|0,i=Math.imul(N,ot),n=n+Math.imul(D,lt)|0,a=(a=a+Math.imul(D,ct)|0)+Math.imul(R,lt)|0,i=i+Math.imul(R,ct)|0,n=n+Math.imul(I,ht)|0,a=(a=a+Math.imul(I,ft)|0)+Math.imul(z,ht)|0,i=i+Math.imul(z,ft)|0;var Pt=(c+(n=n+Math.imul(C,dt)|0)|0)+((8191&(a=(a=a+Math.imul(C,gt)|0)+Math.imul(L,dt)|0))<<13)|0;c=((i=i+Math.imul(L,gt)|0)+(a>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(B,lt),a=(a=Math.imul(B,ct))+Math.imul(N,lt)|0,i=Math.imul(N,ct),n=n+Math.imul(D,ht)|0,a=(a=a+Math.imul(D,ft)|0)+Math.imul(R,ht)|0,i=i+Math.imul(R,ft)|0;var It=(c+(n=n+Math.imul(I,dt)|0)|0)+((8191&(a=(a=a+Math.imul(I,gt)|0)+Math.imul(z,dt)|0))<<13)|0;c=((i=i+Math.imul(z,gt)|0)+(a>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(B,ht),a=(a=Math.imul(B,ft))+Math.imul(N,ht)|0,i=Math.imul(N,ft);var zt=(c+(n=n+Math.imul(D,dt)|0)|0)+((8191&(a=(a=a+Math.imul(D,gt)|0)+Math.imul(R,dt)|0))<<13)|0;c=((i=i+Math.imul(R,gt)|0)+(a>>>13)|0)+(zt>>>26)|0,zt&=67108863;var Ot=(c+(n=Math.imul(B,dt))|0)+((8191&(a=(a=Math.imul(B,gt))+Math.imul(N,dt)|0))<<13)|0;return c=((i=Math.imul(N,gt))+(a>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,l[0]=mt,l[1]=vt,l[2]=yt,l[3]=xt,l[4]=bt,l[5]=_t,l[6]=wt,l[7]=Tt,l[8]=kt,l[9]=At,l[10]=Mt,l[11]=St,l[12]=Et,l[13]=Ct,l[14]=Lt,l[15]=Pt,l[16]=It,l[17]=zt,l[18]=Ot,0!==c&&(l[19]=c,r.length++),r};function d(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=f),i.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?p(this,t,e):r<63?f(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,a=0,i=0;i<r.length-1;i++){var o=a;a=0;for(var s=67108863&n,l=Math.min(i,e.length-1),c=Math.max(0,i-t.length+1);c<=l;c++){var u=i-c,h=(0|t.words[u])*(0|e.words[c]),f=67108863&h;s=67108863&(f=f+s|0),a+=(o=(o=o+(h/67108864|0)|0)+(f>>>26)|0)>>>26,o&=67108863}r.words[i]=s,n=o,o=a}return 0!==n?r.words[i]=n:r.length--,r.strip()}(this,t,e):d(this,t,e)},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=i.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,a=0;a<e;a++)n|=(1&t)<<e-a-1,t>>=1;return n},g.prototype.permute=function(t,e,r,n,a,i){for(var o=0;o<i;o++)n[o]=e[t[o]],a[o]=r[t[o]]},g.prototype.transform=function(t,e,r,n,a,i){this.permute(i,t,e,r,n,a);for(var o=1;o<a;o<<=1)for(var s=o<<1,l=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),u=0;u<a;u+=s)for(var h=l,f=c,p=0;p<o;p++){var d=r[u+p],g=n[u+p],m=r[u+p+o],v=n[u+p+o],y=h*m-f*v;v=h*v+f*m,m=y,r[u+p]=d+m,n[u+p]=g+v,r[u+p+o]=d-m,n[u+p+o]=g-v,p!==s&&(y=l*h-c*f,f=l*f+c*h,h=y)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,a=0;for(r=r/2|0;r;r>>>=1)a++;return 1<<a+1+n},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var a=t[n];t[n]=t[r-n-1],t[r-n-1]=a,a=e[n],e[n]=-e[r-n-1],e[r-n-1]=-a}},g.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var a=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&a,r=a<67108864?0:a/67108864|0}return t},g.prototype.convert13b=function(t,e,r,a){for(var i=0,o=0;o<e;o++)i+=0|t[o],r[2*o]=8191&i,i>>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*e;o<a;++o)r[o]=0;n(0===i),n(0==(-8192&i))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),a=this.makeRBT(n),i=this.stub(n),o=new Array(n),s=new Array(n),l=new Array(n),c=new Array(n),u=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,c,n),this.transform(o,i,s,l,n,a),this.transform(c,i,u,h,n,a);for(var p=0;p<n;p++){var d=s[p]*u[p]-l[p]*h[p];l[p]=s[p]*h[p]+l[p]*u[p],s[p]=d}return this.conjugate(s,l,n),this.transform(s,l,f,i,n,a),this.conjugate(f,i,n),this.normalize13b(f,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),d(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var a=(0|this.words[r])*t,i=(67108863&a)+(67108863&e);e>>=26,e+=a/67108864|0,e+=i>>>26,this.words[r]=67108863&i}return 0!==e&&(this.words[r]=e,this.length++),this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,a=r%26;e[r]=(t.words[n]&1<<a)>>>a}return e}(t);if(0===e.length)return new i(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var a=r.sqr();n<e.length;n++,a=a.sqr())0!==e[n]&&(r=r.mul(a));return r},i.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,a=(t-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var s=this.words[e]&i,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!==a){for(e=this.length-1;e>=0;e--)this.words[e+a]=this.words[e];for(e=0;e<a;e++)this.words[e]=0;this.length+=a}return this.strip()},i.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},i.prototype.iushrn=function(t,e,r){var a;n("number"==typeof t&&t>=0),a=e?(e-e%26)/26:0;var i=t%26,o=Math.min((t-i)/26,this.length),s=67108863^67108863>>>i<<i,l=r;if(a-=o,a=Math.max(0,a),l){for(var c=0;c<o;c++)l.words[c]=this.words[c];l.length=o}if(0===o);else if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var u=0;for(c=this.length-1;c>=0&&(0!==u||c>=a);c--){var h=0|this.words[c];this.words[c]=u<<26-i|h>>>i,u=h&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,a=1<<e;return!(this.length<=r)&&!!(this.words[r]&a)},i.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 a=67108863^67108863>>>e<<e;this.words[this.length-1]&=a}return this.strip()},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.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)},i.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(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()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,r){var a,i,o=t.length+r;this._expand(o);var s=0;for(a=0;a<t.length;a++){i=(0|this.words[a+r])+s;var l=(0|t.words[a])*e;s=((i-=67108863&l)>>26)-(l/67108864|0),this.words[a+r]=67108863&i}for(;a<this.length-r;a++)s=(i=(0|this.words[a+r])+s)>>26,this.words[a+r]=67108863&i;if(0===s)return this.strip();for(n(-1===s),s=0,a=0;a<this.length;a++)s=(i=-(0|this.words[a])+s)>>26,this.words[a]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),a=t,o=0|a.words[a.length-1];0!==(r=26-this._countBits(o))&&(a=a.ushln(r),n.iushln(r),o=0|a.words[a.length-1]);var s,l=n.length-a.length;if("mod"!==e){(s=new i(null)).length=l+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var u=n.clone()._ishlnsubmul(a,1,l);0===u.negative&&(n=u,s&&(s.words[l]=1));for(var h=l-1;h>=0;h--){var f=67108864*(0|n.words[a.length+h])+(0|n.words[a.length+h-1]);for(f=Math.min(f/o|0,67108863),n._ishlnsubmul(a,f,h);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(a,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}},i.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(a=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:a,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(a=s.div.neg()),{div:a,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 i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,e);var a,o,s},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.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),a=t.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,a=this.length-1;a>=0;a--)r=(e*r+(0|this.words[a]))%t;return r},i.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var a=(0|this.words[r])+67108864*e;this.words[r]=a/t|0,e=a%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.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 a=new i(1),o=new i(0),s=new i(0),l=new i(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),h=e.clone();!e.isZero();){for(var f=0,p=1;0==(e.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(u),o.isub(h)),a.iushrn(1),o.iushrn(1);for(var d=0,g=1;0==(r.words[0]&g)&&d<26;++d,g<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(h)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s),o.isub(l)):(r.isub(e),s.isub(a),l.isub(o))}return{a:s,b:l,gcd:r.iushln(c)}},i.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 a,o=new i(1),s=new i(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;0==(e.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(e.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var h=0,f=1;0==(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(a=0===e.cmpn(1)?o:s).cmpn(0)<0&&a.iadd(t),a},i.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 a=e.cmp(r);if(a<0){var i=e;e=r,r=i}else if(0===a||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,a=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=a,this;for(var i=a,o=r;0!==i&&o<this.length;o++){var s=0|this.words[o];i=(s+=i)>>>26,s&=67108863,this.words[o]=s}return 0!==i&&(this.words[o]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var a=0|this.words[0];e=a===t?0:a<t?-1:1}return 0!==this.negative?0|-e:e},i.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},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],a=0|t.words[r];if(n!==a){n<a?e=-1:n>a&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new w(t)},i.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)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=i._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 T(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}v.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.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},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},a(y,v),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var a=t.words[9];for(e.words[e.length++]=4194303&a,n=10;n<t.length;n++){var i=0|t.words[n];t.words[n-10]=(4194303&i)<<4|a>>>22,a=i}a>>>=22,t.words[n-10]=a,0===a&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},a(x,v),a(b,v),a(_,v),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,a=67108863&n;n>>>=26,t.words[r]=a,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new x;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return m[t]=e,e},w.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},w.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},w.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},w.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new i(1)).iushrn(2);return this.pow(t,r)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);n(!a.isZero());var s=new i(1).toRed(this),l=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var h=this.pow(u,a),f=this.pow(t,a.addn(1).iushrn(1)),p=this.pow(t,a),d=o;0!==p.cmp(s);){for(var g=p,m=0;0!==g.cmp(s);m++)g=g.redSqr();n(m<d);var v=this.pow(h,new i(1).iushln(d-m-1));f=f.redMul(v),h=v.redSqr(),p=p.redMul(h),d=m}return f},w.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},w.prototype.pow=function(t,e){if(e.isZero())return new i(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var a=r[0],o=0,s=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],u=l-1;u>=0;u--){var h=c>>u&1;a!==r[0]&&(a=this.sqr(a)),0!==h||0!==o?(o<<=1,o|=h,(4===++s||0===n&&0===u)&&(a=this.mul(a,r[o]),s=0,o=0)):s=0}l=26}return a},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new T(t)},a(T,w),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.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),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},T.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}("undefined"==typeof e||e,this)},{buffer:106}],98:[function(t,e,r){"use strict";e.exports=function(t){var e,r,n,a=t.length,i=0;for(e=0;e<a;++e)i+=t[e].length;var o=new Array(i),s=0;for(e=0;e<a;++e){var l=t[e],c=l.length;for(r=0;r<c;++r){var u=o[s++]=new Array(c-1),h=0;for(n=0;n<c;++n)n!==r&&(u[h++]=l[n]);if(1&r){var f=u[1];u[1]=u[0],u[0]=f}}}return o}},{}],99:[function(t,e,r){"use strict";e.exports=function(t,e,r){switch(arguments.length){case 1:return h(t);case 2:return"function"==typeof e?c(t,t,e,!0):f(t,e);case 3:return c(t,e,r,!1);default:throw new Error("box-intersect: Invalid arguments")}};var n,a=t("typedarray-pool"),i=t("./lib/sweep"),o=t("./lib/intersect");function s(t,e){for(var r=0;r<t;++r)if(!(e[r]<=e[r+t]))return!0;return!1}function l(t,e,r,n){for(var a=0,i=0,o=0,l=t.length;o<l;++o){var c=t[o];if(!s(e,c)){for(var u=0;u<2*e;++u)r[a++]=c[u];n[i++]=o}}return i}function c(t,e,r,n){var s=t.length,c=e.length;if(!(s<=0||c<=0)){var u=t[0].length>>>1;if(!(u<=0)){var h,f=a.mallocDouble(2*u*s),p=a.mallocInt32(s);if((s=l(t,u,f,p))>0){if(1===u&&n)i.init(s),h=i.sweepComplete(u,r,0,s,f,p,0,s,f,p);else{var d=a.mallocDouble(2*u*c),g=a.mallocInt32(c);(c=l(e,u,d,g))>0&&(i.init(s+c),h=1===u?i.sweepBipartite(u,r,0,s,f,p,0,c,d,g):o(u,r,n,s,f,p,c,d,g),a.free(d),a.free(g))}a.free(f),a.free(p)}return h}}}function u(t,e){n.push([t,e])}function h(t){return n=[],c(t,t,u,!0),n}function f(t,e){return n=[],c(t,e,u,!1),n}},{"./lib/intersect":101,"./lib/sweep":105,"typedarray-pool":547}],100:[function(t,e,r){"use strict";var n=["d","ax","vv","rs","re","rb","ri","bs","be","bb","bi"];function a(t){var e="bruteForce"+(t?"Full":"Partial"),r=[],a=n.slice();t||a.splice(3,0,"fp");var i=["function "+e+"("+a.join()+"){"];function o(e,a){var o=function(t,e,r){var a="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),i=["function ",a,"(",n.join(),"){","var ","es","=2*","d",";"],o="for(var i=rs,rp=es*rs;i<re;++i,rp+=es){var x0=rb[ax+rp],x1=rb[ax+rp+d],xi=ri[i];",s="for(var j=bs,bp=es*bs;j<be;++j,bp+=es){var y0=bb[ax+bp],"+(r?"y1=bb[ax+bp+d],":"")+"yi=bi[j];";return t?i.push(o,"Q",":",s):i.push(s,"Q",":",o),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=ax+1;k<d;++k){var r0=rb[k+rp],r1=rb[k+d+rp],b0=bb[k+bp],b1=bb[k+d+bp];if(r1<b0||b1<r0)continue Q;}var rv=vv("),e?i.push("yi,xi"):i.push("xi,yi"),i.push(");if(rv!==void 0)return rv;}}}"),{name:a,code:i.join("")}}(e,a,t);r.push(o.code),i.push("return "+o.name+"("+n.join()+");")}i.push("if(re-rs>be-bs){"),t?(o(!0,!1),i.push("}else{"),o(!1,!1)):(i.push("if(fp){"),o(!0,!0),i.push("}else{"),o(!0,!1),i.push("}}else{if(fp){"),o(!1,!0),i.push("}else{"),o(!1,!1),i.push("}")),i.push("}}return "+e);var s=r.join("")+i.join("");return new Function(s)()}r.partial=a(!1),r.full=a(!0)},{}],101:[function(t,e,r){"use strict";e.exports=function(t,e,r,i,u,w,T,k,A){!function(t,e){var r=8*a.log2(e+1)*(t+1)|0,i=a.nextPow2(6*r);v.length<i&&(n.free(v),v=n.mallocInt32(i));var o=a.nextPow2(2*r);y.length<o&&(n.free(y),y=n.mallocDouble(o))}(t,i+T);var M,S=0,E=2*t;x(S++,0,0,i,0,T,r?16:0,-1/0,1/0),r||x(S++,0,0,T,0,i,1,-1/0,1/0);for(;S>0;){var C=6*(S-=1),L=v[C],P=v[C+1],I=v[C+2],z=v[C+3],O=v[C+4],D=v[C+5],R=2*S,F=y[R],B=y[R+1],N=1&D,j=!!(16&D),V=u,U=w,q=k,H=A;if(N&&(V=k,U=A,q=u,H=w),!(2&D&&(I=p(t,L,P,I,V,U,B),P>=I)||4&D&&(P=d(t,L,P,I,V,U,F))>=I)){var G=I-P,Y=O-z;if(j){if(t*G*(G+Y)<1<<22){if(void 0!==(M=l.scanComplete(t,L,e,P,I,V,U,z,O,q,H)))return M;continue}}else{if(t*Math.min(G,Y)<128){if(void 0!==(M=o(t,L,e,N,P,I,V,U,z,O,q,H)))return M;continue}if(t*G*Y<1<<22){if(void 0!==(M=l.scanBipartite(t,L,e,N,P,I,V,U,z,O,q,H)))return M;continue}}var W=h(t,L,P,I,V,U,F,B);if(P<W)if(t*(W-P)<128){if(void 0!==(M=s(t,L+1,e,P,W,V,U,z,O,q,H)))return M}else if(L===t-2){if(void 0!==(M=N?l.sweepBipartite(t,e,z,O,q,H,P,W,V,U):l.sweepBipartite(t,e,P,W,V,U,z,O,q,H)))return M}else x(S++,L+1,P,W,z,O,N,-1/0,1/0),x(S++,L+1,z,O,P,W,1^N,-1/0,1/0);if(W<I){var Z=c(t,L,z,O,q,H),X=q[E*Z+L],J=f(t,L,Z,O,q,H,X);if(J<O&&x(S++,L,W,I,J,O,(4|N)+(j?16:0),X,B),z<Z&&x(S++,L,W,I,z,Z,(2|N)+(j?16:0),F,X),Z+1===J){if(void 0!==(M=j?_(t,L,e,W,I,V,U,Z,q,H[Z]):b(t,L,e,N,W,I,V,U,Z,q,H[Z])))return M}else if(Z<J){var K;if(j){if(K=g(t,L,W,I,V,U,X),W<K){var Q=f(t,L,W,K,V,U,X);if(L===t-2){if(W<Q&&void 0!==(M=l.sweepComplete(t,e,W,Q,V,U,Z,J,q,H)))return M;if(Q<K&&void 0!==(M=l.sweepBipartite(t,e,Q,K,V,U,Z,J,q,H)))return M}else W<Q&&x(S++,L+1,W,Q,Z,J,16,-1/0,1/0),Q<K&&(x(S++,L+1,Q,K,Z,J,0,-1/0,1/0),x(S++,L+1,Z,J,Q,K,1,-1/0,1/0))}}else K=N?m(t,L,W,I,V,U,X):g(t,L,W,I,V,U,X),W<K&&(L===t-2?M=N?l.sweepBipartite(t,e,Z,J,q,H,W,K,V,U):l.sweepBipartite(t,e,W,K,V,U,Z,J,q,H):(x(S++,L+1,W,K,Z,J,N,-1/0,1/0),x(S++,L+1,Z,J,W,K,1^N,-1/0,1/0)))}}}}};var n=t("typedarray-pool"),a=t("bit-twiddle"),i=t("./brute"),o=i.partial,s=i.full,l=t("./sweep"),c=t("./median"),u=t("./partition"),h=u("!(lo>=p0)&&!(p1>=hi)",["p0","p1"]),f=u("lo===p0",["p0"]),p=u("lo<p0",["p0"]),d=u("hi<=p0",["p0"]),g=u("lo<=p0&&p0<=hi",["p0"]),m=u("lo<p0&&p0<=hi",["p0"]),v=n.mallocInt32(1024),y=n.mallocDouble(1024);function x(t,e,r,n,a,i,o,s,l){var c=6*t;v[c]=e,v[c+1]=r,v[c+2]=n,v[c+3]=a,v[c+4]=i,v[c+5]=o;var u=2*t;y[u]=s,y[u+1]=l}function b(t,e,r,n,a,i,o,s,l,c,u){var h=2*t,f=l*h,p=c[f+e];t:for(var d=a,g=a*h;d<i;++d,g+=h){var m=o[g+e],v=o[g+e+t];if(!(p<m||v<p)&&(!n||p!==m)){for(var y,x=s[d],b=e+1;b<t;++b){m=o[g+b],v=o[g+b+t];var _=c[f+b],w=c[f+b+t];if(v<_||w<m)continue t}if(void 0!==(y=n?r(u,x):r(x,u)))return y}}}function _(t,e,r,n,a,i,o,s,l,c){var u=2*t,h=s*u,f=l[h+e];t:for(var p=n,d=n*u;p<a;++p,d+=u){var g=o[p];if(g!==c){var m=i[d+e],v=i[d+e+t];if(!(f<m||v<f)){for(var y=e+1;y<t;++y){m=i[d+y],v=i[d+y+t];var x=l[h+y],b=l[h+y+t];if(v<x||b<m)continue t}var _=r(g,c);if(void 0!==_)return _}}}}},{"./brute":100,"./median":102,"./partition":103,"./sweep":105,"bit-twiddle":95,"typedarray-pool":547}],102:[function(t,e,r){"use strict";e.exports=function(t,e,r,i,o,s){if(i<=r+1)return r;var l=r,c=i,u=i+r>>>1,h=2*t,f=u,p=o[h*u+e];for(;l<c;){if(c-l<8){a(t,e,l,c,o,s),p=o[h*u+e];break}var d=c-l,g=Math.random()*d+l|0,m=o[h*g+e],v=Math.random()*d+l|0,y=o[h*v+e],x=Math.random()*d+l|0,b=o[h*x+e];m<=y?b>=y?(f=v,p=y):m>=b?(f=g,p=m):(f=x,p=b):y>=b?(f=v,p=y):b>=m?(f=g,p=m):(f=x,p=b);for(var _=h*(c-1),w=h*f,T=0;T<h;++T,++_,++w){var k=o[_];o[_]=o[w],o[w]=k}var A=s[c-1];s[c-1]=s[f],s[f]=A,f=n(t,e,l,c-1,o,s,p);for(_=h*(c-1),w=h*f,T=0;T<h;++T,++_,++w){k=o[_];o[_]=o[w],o[w]=k}A=s[c-1];if(s[c-1]=s[f],s[f]=A,u<f){for(c=f-1;l<c&&o[h*(c-1)+e]===p;)c-=1;c+=1}else{if(!(f<u))break;for(l=f+1;l<c&&o[h*l+e]===p;)l+=1}}return n(t,e,r,u,o,s,o[h*u+e])};var n=t("./partition")("lo<p0",["p0"]);function a(t,e,r,n,a,i){for(var o=2*t,s=o*(r+1)+e,l=r+1;l<n;++l,s+=o)for(var c=a[s],u=l,h=o*(l-1);u>r&&a[h+e]>c;--u,h-=o){for(var f=h,p=h+o,d=0;d<o;++d,++f,++p){var g=a[f];a[f]=a[p],a[p]=g}var m=i[u];i[u]=i[u-1],i[u-1]=m}}},{"./partition":103}],103:[function(t,e,r){"use strict";e.exports=function(t,e){var r="abcdef".split("").concat(e),n=[];t.indexOf("lo")>=0&&n.push("lo=e[k+n]");t.indexOf("hi")>=0&&n.push("hi=e[k+o]");return r.push("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".replace("_",n.join()).replace("$",t)),Function.apply(void 0,r)}},{}],104:[function(t,e,r){"use strict";e.exports=function(t,e){e<=128?n(0,e-1,t):function t(e,r,u){var h=(r-e+1)/6|0,f=e+h,p=r-h,d=e+r>>1,g=d-h,m=d+h,v=f,y=g,x=d,b=m,_=p,w=e+1,T=r-1,k=0;l(v,y,u)&&(k=v,v=y,y=k);l(b,_,u)&&(k=b,b=_,_=k);l(v,x,u)&&(k=v,v=x,x=k);l(y,x,u)&&(k=y,y=x,x=k);l(v,b,u)&&(k=v,v=b,b=k);l(x,b,u)&&(k=x,x=b,b=k);l(y,_,u)&&(k=y,y=_,_=k);l(y,x,u)&&(k=y,y=x,x=k);l(b,_,u)&&(k=b,b=_,_=k);for(var A=u[2*y],M=u[2*y+1],S=u[2*b],E=u[2*b+1],C=2*v,L=2*x,P=2*_,I=2*f,z=2*d,O=2*p,D=0;D<2;++D){var R=u[C+D],F=u[L+D],B=u[P+D];u[I+D]=R,u[z+D]=F,u[O+D]=B}i(g,e,u),i(m,r,u);for(var N=w;N<=T;++N)if(c(N,A,M,u))N!==w&&a(N,w,u),++w;else if(!c(N,S,E,u))for(;;){if(c(T,S,E,u)){c(T,A,M,u)?(o(N,w,T,u),++w,--T):(a(N,T,u),--T);break}if(--T<N)break}s(e,w-1,A,M,u),s(r,T+1,S,E,u),w-2-e<=32?n(e,w-2,u):t(e,w-2,u);r-(T+2)<=32?n(T+2,r,u):t(T+2,r,u);T-w<=32?n(w,T,u):t(w,T,u)}(0,e-1,t)};function n(t,e,r){for(var n=2*(t+1),a=t+1;a<=e;++a){for(var i=r[n++],o=r[n++],s=a,l=n-2;s-- >t;){var c=r[l-2],u=r[l-1];if(c<i)break;if(c===i&&u<o)break;r[l]=c,r[l+1]=u,l-=2}r[l]=i,r[l+1]=o}}function a(t,e,r){e*=2;var n=r[t*=2],a=r[t+1];r[t]=r[e],r[t+1]=r[e+1],r[e]=n,r[e+1]=a}function i(t,e,r){e*=2,r[t*=2]=r[e],r[t+1]=r[e+1]}function o(t,e,r,n){e*=2,r*=2;var a=n[t*=2],i=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]=a,n[r+1]=i}function s(t,e,r,n,a){e*=2,a[t*=2]=a[e],a[e]=r,a[t+1]=a[e+1],a[e+1]=n}function l(t,e,r){e*=2;var n=r[t*=2],a=r[e];return!(n<a)&&(n!==a||r[t+1]>r[e+1])}function c(t,e,r,n){var a=n[t*=2];return a<e||a===e&&n[t+1]<r}},{}],105:[function(t,e,r){"use strict";e.exports={init:function(t){var e=a.nextPow2(t);o.length<e&&(n.free(o),o=n.mallocInt32(e));s.length<e&&(n.free(s),s=n.mallocInt32(e));l.length<e&&(n.free(l),l=n.mallocInt32(e));c.length<e&&(n.free(c),c=n.mallocInt32(e));u.length<e&&(n.free(u),u=n.mallocInt32(e));h.length<e&&(n.free(h),h=n.mallocInt32(e));var r=8*e;f.length<r&&(n.free(f),f=n.mallocDouble(r))},sweepBipartite:function(t,e,r,n,a,u,h,g,m,v){for(var y=0,x=2*t,b=t-1,_=x-1,w=r;w<n;++w){var T=u[w],k=x*w;f[y++]=a[k+b],f[y++]=-(T+1),f[y++]=a[k+_],f[y++]=T}for(w=h;w<g;++w){T=v[w]+(1<<28);var A=x*w;f[y++]=m[A+b],f[y++]=-T,f[y++]=m[A+_],f[y++]=T}var M=y>>>1;i(f,M);var S=0,E=0;for(w=0;w<M;++w){var C=0|f[2*w+1];if(C>=1<<28)p(l,c,E--,C=C-(1<<28)|0);else if(C>=0)p(o,s,S--,C);else if(C<=-(1<<28)){C=-C-(1<<28)|0;for(var L=0;L<S;++L){if(void 0!==(P=e(o[L],C)))return P}d(l,c,E++,C)}else{C=-C-1|0;for(L=0;L<E;++L){var P;if(void 0!==(P=e(C,l[L])))return P}d(o,s,S++,C)}}},sweepComplete:function(t,e,r,n,a,g,m,v,y,x){for(var b=0,_=2*t,w=t-1,T=_-1,k=r;k<n;++k){var A=g[k]+1<<1,M=_*k;f[b++]=a[M+w],f[b++]=-A,f[b++]=a[M+T],f[b++]=A}for(k=m;k<v;++k){A=x[k]+1<<1;var S=_*k;f[b++]=y[S+w],f[b++]=1|-A,f[b++]=y[S+T],f[b++]=1|A}var E=b>>>1;i(f,E);var C=0,L=0,P=0;for(k=0;k<E;++k){var I=0|f[2*k+1],z=1&I;if(k<E-1&&I>>1==f[2*k+3]>>1&&(z=2,k+=1),I<0){for(var O=-(I>>1)-1,D=0;D<P;++D){if(void 0!==(R=e(u[D],O)))return R}if(0!==z)for(D=0;D<C;++D){if(void 0!==(R=e(o[D],O)))return R}if(1!==z)for(D=0;D<L;++D){var R;if(void 0!==(R=e(l[D],O)))return R}0===z?d(o,s,C++,O):1===z?d(l,c,L++,O):2===z&&d(u,h,P++,O)}else{O=(I>>1)-1;0===z?p(o,s,C--,O):1===z?p(l,c,L--,O):2===z&&p(u,h,P--,O)}}},scanBipartite:function(t,e,r,n,a,l,c,u,h,g,m,v){var y=0,x=2*t,b=e,_=e+t,w=1,T=1;n?T=1<<28:w=1<<28;for(var k=a;k<l;++k){var A=k+w,M=x*k;f[y++]=c[M+b],f[y++]=-A,f[y++]=c[M+_],f[y++]=A}for(k=h;k<g;++k){A=k+T;var S=x*k;f[y++]=m[S+b],f[y++]=-A}var E=y>>>1;i(f,E);var C=0;for(k=0;k<E;++k){var L=0|f[2*k+1];if(L<0){var P=!1;if((A=-L)>=1<<28?(P=!n,A-=1<<28):(P=!!n,A-=1),P)d(o,s,C++,A);else{var I=v[A],z=x*A,O=m[z+e+1],D=m[z+e+1+t];t:for(var R=0;R<C;++R){var F=o[R],B=x*F;if(!(D<c[B+e+1]||c[B+e+1+t]<O)){for(var N=e+2;N<t;++N)if(m[z+N+t]<c[B+N]||c[B+N+t]<m[z+N])continue t;var j,V=u[F];if(void 0!==(j=n?r(I,V):r(V,I)))return j}}}}else p(o,s,C--,L-w)}},scanComplete:function(t,e,r,n,a,s,l,c,u,h,p){for(var d=0,g=2*t,m=e,v=e+t,y=n;y<a;++y){var x=y+(1<<28),b=g*y;f[d++]=s[b+m],f[d++]=-x,f[d++]=s[b+v],f[d++]=x}for(y=c;y<u;++y){x=y+1;var _=g*y;f[d++]=h[_+m],f[d++]=-x}var w=d>>>1;i(f,w);var T=0;for(y=0;y<w;++y){var k=0|f[2*y+1];if(k<0){if((x=-k)>=1<<28)o[T++]=x-(1<<28);else{var A=p[x-=1],M=g*x,S=h[M+e+1],E=h[M+e+1+t];t:for(var C=0;C<T;++C){var L=o[C],P=l[L];if(P===A)break;var I=g*L;if(!(E<s[I+e+1]||s[I+e+1+t]<S)){for(var z=e+2;z<t;++z)if(h[M+z+t]<s[I+z]||s[I+z+t]<h[M+z])continue t;var O=r(P,A);if(void 0!==O)return O}}}}else{for(x=k-(1<<28),C=T-1;C>=0;--C)if(o[C]===x){for(z=C+1;z<T;++z)o[z-1]=o[z];break}--T}}}};var n=t("typedarray-pool"),a=t("bit-twiddle"),i=t("./sort"),o=n.mallocInt32(1024),s=n.mallocInt32(1024),l=n.mallocInt32(1024),c=n.mallocInt32(1024),u=n.mallocInt32(1024),h=n.mallocInt32(1024),f=n.mallocDouble(8192);function p(t,e,r,n){var a=e[n],i=t[r-1];t[a]=i,e[i]=a}function d(t,e,r,n){t[r]=n,e[n]=r}},{"./sort":104,"bit-twiddle":95,"typedarray-pool":547}],106:[function(t,e,r){},{}],107:[function(t,e,r){var n=Object.create||function(t){var e=function(){};return e.prototype=t,new e},a=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return r},i=Function.prototype.bind||function(t){var e=this;return function(){return e.apply(t,arguments)}};function o(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=n(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}e.exports=o,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._maxListeners=void 0;var s,l=10;try{var c={};Object.defineProperty&&Object.defineProperty(c,"x",{value:0}),s=0===c.x}catch(t){s=!1}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function h(t,e,r){if(e)t.call(r);else for(var n=t.length,a=_(t,n),i=0;i<n;++i)a[i].call(r)}function f(t,e,r,n){if(e)t.call(r,n);else for(var a=t.length,i=_(t,a),o=0;o<a;++o)i[o].call(r,n)}function p(t,e,r,n,a){if(e)t.call(r,n,a);else for(var i=t.length,o=_(t,i),s=0;s<i;++s)o[s].call(r,n,a)}function d(t,e,r,n,a,i){if(e)t.call(r,n,a,i);else for(var o=t.length,s=_(t,o),l=0;l<o;++l)s[l].call(r,n,a,i)}function g(t,e,r,n){if(e)t.apply(r,n);else for(var a=t.length,i=_(t,a),o=0;o<a;++o)i[o].apply(r,n)}function m(t,e,r,a){var i,o,s;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((o=t._events)?(o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]):(o=t._events=n(null),t._eventsCount=0),s){if("function"==typeof s?s=o[e]=a?[r,s]:[s,r]:a?s.unshift(r):s.push(r),!s.warned&&(i=u(t))&&i>0&&s.length>i){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",l.name,l.message)}}else s=o[e]=r,++t._eventsCount;return t}function v(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var t=new Array(arguments.length),e=0;e<t.length;++e)t[e]=arguments[e];this.listener.apply(this.target,t)}}function y(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},a=i.call(v,n);return a.listener=r,n.wrapFn=a,a}function x(t,e,r){var n=t._events;if(!n)return[];var a=n[e];return a?"function"==typeof a?r?[a.listener||a]:[a]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(a):_(a,a.length):[]}function b(t){var e=this._events;if(e){var r=e[t];if("function"==typeof r)return 1;if(r)return r.length}return 0}function _(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}s?Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(t){if("number"!=typeof t||t<0||t!=t)throw new TypeError('"defaultMaxListeners" must be a positive number');l=t}}):o.defaultMaxListeners=l,o.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(t){var e,r,n,a,i,o,s="error"===t;if(o=this._events)s=s&&null==o.error;else if(!s)return!1;if(s){if(arguments.length>1&&(e=arguments[1]),e instanceof Error)throw e;var l=new Error('Unhandled "error" event. ('+e+")");throw l.context=e,l}if(!(r=o[t]))return!1;var c="function"==typeof r;switch(n=arguments.length){case 1:h(r,c,this);break;case 2:f(r,c,this,arguments[1]);break;case 3:p(r,c,this,arguments[1],arguments[2]);break;case 4:d(r,c,this,arguments[1],arguments[2],arguments[3]);break;default:for(a=new Array(n-1),i=1;i<n;i++)a[i-1]=arguments[i];g(r,c,this,a)}return!0},o.prototype.addListener=function(t,e){return m(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return m(this,t,e,!0)},o.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,y(this,t,e)),this},o.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,y(this,t,e)),this},o.prototype.removeListener=function(t,e){var r,a,i,o,s;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');if(!(a=this._events))return this;if(!(r=a[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=n(null):(delete a[t],a.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(var r=e,n=r+1,a=t.length;n<a;r+=1,n+=1)t[r]=t[n];t.pop()}(r,i),1===r.length&&(a[t]=r[0]),a.removeListener&&this.emit("removeListener",t,s||e)}return this},o.prototype.removeAllListeners=function(t){var e,r,i;if(!(r=this._events))return this;if(!r.removeListener)return 0===arguments.length?(this._events=n(null),this._eventsCount=0):r[t]&&(0==--this._eventsCount?this._events=n(null):delete r[t]),this;if(0===arguments.length){var o,s=a(r);for(i=0;i<s.length;++i)"removeListener"!==(o=s[i])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=n(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},o.prototype.listeners=function(t){return x(this,t,!0)},o.prototype.rawListeners=function(t){return x(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):b.call(t,e)},o.prototype.listenerCount=b,o.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],108:[function(t,e,r){(function(e){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
"use strict";var n=t("base64-js"),a=t("ieee754");r.Buffer=e,r.SlowBuffer=function(t){+t!=t&&(t=0);return e.alloc(+t)},r.INSPECT_MAX_BYTES=50;function i(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var r=new Uint8Array(t);return r.__proto__=e.prototype,r}function e(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return o(t,e,r)}function o(t,r,n){if("string"==typeof t)return function(t,r){"string"==typeof r&&""!==r||(r="utf8");if(!e.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var n=0|h(t,r),a=i(n),o=a.write(t,r);o!==n&&(a=a.slice(0,o));return a}(t,r);if(ArrayBuffer.isView(t))return c(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(B(t,ArrayBuffer)||t&&B(t.buffer,ArrayBuffer))return function(t,r,n){if(r<0||t.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<r+(n||0))throw new RangeError('"length" is outside of buffer bounds');var a;a=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);return a.__proto__=e.prototype,a}(t,r,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var a=t.valueOf&&t.valueOf();if(null!=a&&a!==t)return e.from(a,r,n);var o=function(t){if(e.isBuffer(t)){var r=0|u(t.length),n=i(r);return 0===n.length||t.copy(n,0,0,r),n}if(void 0!==t.length)return"number"!=typeof t.length||N(t.length)?i(0):c(t);if("Buffer"===t.type&&Array.isArray(t.data))return c(t.data)}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return e.from(t[Symbol.toPrimitive]("string"),r,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return s(t),i(t<0?0:0|u(t))}function c(t){for(var e=t.length<0?0:0|u(t.length),r=i(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function u(t){if(t>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function h(t,r){if(e.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||B(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,a=arguments.length>2&&!0===arguments[2];if(!a&&0===n)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return D(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return R(t).length;default:if(i)return a?-1:D(t).length;r=(""+r).toLowerCase(),i=!0}}function f(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return M(this,e,r);case"utf8":case"utf-8":return T(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return A(this,e,r);case"base64":return w(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function p(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function d(t,r,n,a,i){if(0===t.length)return-1;if("string"==typeof n?(a=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),N(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof r&&(r=e.from(r,a)),e.isBuffer(r))return 0===r.length?-1:g(t,r,n,a,i);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,n):Uint8Array.prototype.lastIndexOf.call(t,r,n):g(t,[r],n,a,i);throw new TypeError("val must be string, number or Buffer")}function g(t,e,r,n,a){var i,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(a){var u=-1;for(i=r;i<s;i++)if(c(t,i)===c(e,-1===u?0:i-u)){if(-1===u&&(u=i),i-u+1===l)return u*o}else-1!==u&&(i-=i-u),u=-1}else for(r+l>s&&(r=s-l),i=r;i>=0;i--){for(var h=!0,f=0;f<l;f++)if(c(t,i+f)!==c(e,f)){h=!1;break}if(h)return i}return-1}function m(t,e,r,n){r=Number(r)||0;var a=t.length-r;n?(n=Number(n))>a&&(n=a):n=a;var i=e.length;n>i/2&&(n=i/2);for(var o=0;o<n;++o){var s=parseInt(e.substr(2*o,2),16);if(N(s))return o;t[r+o]=s}return o}function v(t,e,r,n){return F(D(e,t.length-r),t,r,n)}function y(t,e,r,n){return F(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function x(t,e,r,n){return y(t,e,r,n)}function b(t,e,r,n){return F(R(e),t,r,n)}function _(t,e,r,n){return F(function(t,e){for(var r,n,a,i=[],o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),n=r>>8,a=r%256,i.push(a),i.push(n);return i}(e,t.length-r),t,r,n)}function w(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function T(t,e,r){r=Math.min(t.length,r);for(var n=[],a=e;a<r;){var i,o,s,l,c=t[a],u=null,h=c>239?4:c>223?3:c>191?2:1;if(a+h<=r)switch(h){case 1:c<128&&(u=c);break;case 2:128==(192&(i=t[a+1]))&&(l=(31&c)<<6|63&i)>127&&(u=l);break;case 3:i=t[a+1],o=t[a+2],128==(192&i)&&128==(192&o)&&(l=(15&c)<<12|(63&i)<<6|63&o)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:i=t[a+1],o=t[a+2],s=t[a+3],128==(192&i)&&128==(192&o)&&128==(192&s)&&(l=(15&c)<<18|(63&i)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,h=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),a+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}r.kMaxLength=2147483647,e.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}}(),e.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."),Object.defineProperty(e.prototype,"parent",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.buffer}}),Object.defineProperty(e.prototype,"offset",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&e[Symbol.species]===e&&Object.defineProperty(e,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),e.poolSize=8192,e.from=function(t,e,r){return o(t,e,r)},e.prototype.__proto__=Uint8Array.prototype,e.__proto__=Uint8Array,e.alloc=function(t,e,r){return function(t,e,r){return s(t),t<=0?i(t):void 0!==e?"string"==typeof r?i(t).fill(e,r):i(t).fill(e):i(t)}(t,e,r)},e.allocUnsafe=function(t){return l(t)},e.allocUnsafeSlow=function(t){return l(t)},e.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==e.prototype},e.compare=function(t,r){if(B(t,Uint8Array)&&(t=e.from(t,t.offset,t.byteLength)),B(r,Uint8Array)&&(r=e.from(r,r.offset,r.byteLength)),!e.isBuffer(t)||!e.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var n=t.length,a=r.length,i=0,o=Math.min(n,a);i<o;++i)if(t[i]!==r[i]){n=t[i],a=r[i];break}return n<a?-1:a<n?1:0},e.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}},e.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return e.alloc(0);var n;if(void 0===r)for(r=0,n=0;n<t.length;++n)r+=t[n].length;var a=e.allocUnsafe(r),i=0;for(n=0;n<t.length;++n){var o=t[n];if(B(o,Uint8Array)&&(o=e.from(o)),!e.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(a,i),i+=o.length}return a},e.byteLength=h,e.prototype._isBuffer=!0,e.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)p(this,e,e+1);return this},e.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)p(this,e,e+3),p(this,e+1,e+2);return this},e.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)p(this,e,e+7),p(this,e+1,e+6),p(this,e+2,e+5),p(this,e+3,e+4);return this},e.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?T(this,0,t):f.apply(this,arguments)},e.prototype.toLocaleString=e.prototype.toString,e.prototype.equals=function(t){if(!e.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===e.compare(this,t)},e.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},e.prototype.compare=function(t,r,n,a,i){if(B(t,Uint8Array)&&(t=e.from(t,t.offset,t.byteLength)),!e.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===r&&(r=0),void 0===n&&(n=t?t.length:0),void 0===a&&(a=0),void 0===i&&(i=this.length),r<0||n>t.length||a<0||i>this.length)throw new RangeError("out of range index");if(a>=i&&r>=n)return 0;if(a>=i)return-1;if(r>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(a>>>=0),s=(n>>>=0)-(r>>>=0),l=Math.min(o,s),c=this.slice(a,i),u=t.slice(r,n),h=0;h<l;++h)if(c[h]!==u[h]){o=c[h],s=u[h];break}return o<s?-1:s<o?1:0},e.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},e.prototype.indexOf=function(t,e,r){return d(this,t,e,r,!0)},e.prototype.lastIndexOf=function(t,e,r){return d(this,t,e,r,!1)},e.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 a=this.length-e;if((void 0===r||r>a)&&(r=a),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return m(this,t,e,r);case"utf8":case"utf-8":return v(this,t,e,r);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return x(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function k(t,e,r){var n="";r=Math.min(t.length,r);for(var a=e;a<r;++a)n+=String.fromCharCode(127&t[a]);return n}function A(t,e,r){var n="";r=Math.min(t.length,r);for(var a=e;a<r;++a)n+=String.fromCharCode(t[a]);return n}function M(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var a="",i=e;i<r;++i)a+=O(t[i]);return a}function S(t,e,r){for(var n=t.slice(e,r),a="",i=0;i<n.length;i+=2)a+=String.fromCharCode(n[i]+256*n[i+1]);return a}function E(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 C(t,r,n,a,i,o){if(!e.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(n+a>t.length)throw new RangeError("Index out of range")}function L(t,e,r,n,a,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function P(t,e,r,n,i){return e=+e,r>>>=0,i||L(t,0,r,4),a.write(t,e,r,n,23,4),r+4}function I(t,e,r,n,i){return e=+e,r>>>=0,i||L(t,0,r,8),a.write(t,e,r,n,52,8),r+8}e.prototype.slice=function(t,r){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t);var a=this.subarray(t,r);return a.__proto__=e.prototype,a},e.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t],a=1,i=0;++i<e&&(a*=256);)n+=this[t+i]*a;return n},e.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t+--e],a=1;e>0&&(a*=256);)n+=this[t+--e]*a;return n},e.prototype.readUInt8=function(t,e){return t>>>=0,e||E(t,1,this.length),this[t]},e.prototype.readUInt16LE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]|this[t+1]<<8},e.prototype.readUInt16BE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]<<8|this[t+1]},e.prototype.readUInt32LE=function(t,e){return t>>>=0,e||E(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},e.prototype.readUInt32BE=function(t,e){return t>>>=0,e||E(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},e.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t],a=1,i=0;++i<e&&(a*=256);)n+=this[t+i]*a;return n>=(a*=128)&&(n-=Math.pow(2,8*e)),n},e.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=e,a=1,i=this[t+--n];n>0&&(a*=256);)i+=this[t+--n]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*e)),i},e.prototype.readInt8=function(t,e){return t>>>=0,e||E(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},e.prototype.readInt16LE=function(t,e){t>>>=0,e||E(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},e.prototype.readInt16BE=function(t,e){t>>>=0,e||E(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},e.prototype.readInt32LE=function(t,e){return t>>>=0,e||E(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},e.prototype.readInt32BE=function(t,e){return t>>>=0,e||E(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},e.prototype.readFloatLE=function(t,e){return t>>>=0,e||E(t,4,this.length),a.read(this,t,!0,23,4)},e.prototype.readFloatBE=function(t,e){return t>>>=0,e||E(t,4,this.length),a.read(this,t,!1,23,4)},e.prototype.readDoubleLE=function(t,e){return t>>>=0,e||E(t,8,this.length),a.read(this,t,!0,52,8)},e.prototype.readDoubleBE=function(t,e){return t>>>=0,e||E(t,8,this.length),a.read(this,t,!1,52,8)},e.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||C(this,t,e,r,Math.pow(2,8*r)-1,0);var a=1,i=0;for(this[e]=255&t;++i<r&&(a*=256);)this[e+i]=t/a&255;return e+r},e.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||C(this,t,e,r,Math.pow(2,8*r)-1,0);var a=r-1,i=1;for(this[e+a]=255&t;--a>=0&&(i*=256);)this[e+a]=t/i&255;return e+r},e.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,255,0),this[e]=255&t,e+1},e.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},e.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},e.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(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},e.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(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},e.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var a=Math.pow(2,8*r-1);C(this,t,e,r,a-1,-a)}var i=0,o=1,s=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},e.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var a=Math.pow(2,8*r-1);C(this,t,e,r,a-1,-a)}var i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},e.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},e.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},e.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},e.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(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},e.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(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},e.prototype.writeFloatLE=function(t,e,r){return P(this,t,e,!0,r)},e.prototype.writeFloatBE=function(t,e,r){return P(this,t,e,!1,r)},e.prototype.writeDoubleLE=function(t,e,r){return I(this,t,e,!0,r)},e.prototype.writeDoubleBE=function(t,e,r){return I(this,t,e,!1,r)},e.prototype.copy=function(t,r,n,a){if(!e.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),a||0===a||(a=this.length),r>=t.length&&(r=t.length),r||(r=0),a>0&&a<n&&(a=n),a===n)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),t.length-r<a-n&&(a=t.length-r+n);var i=a-n;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(r,n,a);else if(this===t&&n<r&&r<a)for(var o=i-1;o>=0;--o)t[o+r]=this[o+n];else Uint8Array.prototype.set.call(t,this.subarray(n,a),r);return i},e.prototype.fill=function(t,r,n,a){if("string"==typeof t){if("string"==typeof r?(a=r,r=0,n=this.length):"string"==typeof n&&(a=n,n=this.length),void 0!==a&&"string"!=typeof a)throw new TypeError("encoding must be a string");if("string"==typeof a&&!e.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(1===t.length){var i=t.charCodeAt(0);("utf8"===a&&i<128||"latin1"===a)&&(t=i)}}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;var o;if(r>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=r;o<n;++o)this[o]=t;else{var s=e.isBuffer(t)?t:e.from(t,a),l=s.length;if(0===l)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<n-r;++o)this[o+r]=s[o%l]}return this};var z=/[^+/0-9A-Za-z-_]/g;function O(t){return t<16?"0"+t.toString(16):t.toString(16)}function D(t,e){var r;e=e||1/0;for(var n=t.length,a=null,i=[],o=0;o<n;++o){if((r=t.charCodeAt(o))>55295&&r<57344){if(!a){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&i.push(239,191,189);continue}a=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(e-=3)>-1&&i.push(239,191,189);if(a=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.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;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function R(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,r,n){for(var a=0;a<n&&!(a+r>=e.length||a>=t.length);++a)e[a+r]=t[a];return a}function B(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function N(t){return t!=t}}).call(this,t("buffer").Buffer)},{"base64-js":77,buffer:108,ieee754:411}],109:[function(t,e,r){"use strict";var n=t("./lib/monotone"),a=t("./lib/triangulation"),i=t("./lib/delaunay"),o=t("./lib/filter");function s(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function l(t,e){return t[0]-e[0]||t[1]-e[1]}function c(t,e,r){return e in t?t[e]:r}e.exports=function(t,e,r){Array.isArray(e)?(r=r||{},e=e||[]):(r=e||{},e=[]);var u=!!c(r,"delaunay",!0),h=!!c(r,"interior",!0),f=!!c(r,"exterior",!0),p=!!c(r,"infinity",!1);if(!h&&!f||0===t.length)return[];var d=n(t,e);if(u||h!==f||p){for(var g=a(t.length,function(t){return t.map(s).sort(l)}(e)),m=0;m<d.length;++m){var v=d[m];g.addTriangle(v[0],v[1],v[2])}return u&&i(t,g),f?h?p?o(g,0,p):g.cells():o(g,1,p):o(g,-1)}return d}},{"./lib/delaunay":110,"./lib/filter":111,"./lib/monotone":112,"./lib/triangulation":113}],110:[function(t,e,r){"use strict";var n=t("robust-in-sphere")[4];t("binary-search-bounds");function a(t,e,r,a,i,o){var s=e.opposite(a,i);if(!(s<0)){if(i<a){var l=a;a=i,i=l,l=o,o=s,s=l}e.isConstraint(a,i)||n(t[a],t[i],t[o],t[s])<0&&r.push(a,i)}}e.exports=function(t,e){for(var r=[],i=t.length,o=e.stars,s=0;s<i;++s)for(var l=o[s],c=1;c<l.length;c+=2){if(!((p=l[c])<s)&&!e.isConstraint(s,p)){for(var u=l[c-1],h=-1,f=1;f<l.length;f+=2)if(l[f-1]===p){h=l[f];break}h<0||n(t[s],t[p],t[u],t[h])<0&&r.push(s,p)}}for(;r.length>0;){for(var p=r.pop(),d=(s=r.pop(),u=-1,h=-1,l=o[s],1);d<l.length;d+=2){var g=l[d-1],m=l[d];g===p?h=m:m===p&&(u=g)}u<0||h<0||(n(t[s],t[p],t[u],t[h])>=0||(e.flip(s,p),a(t,e,r,u,s,h),a(t,e,r,s,h,u),a(t,e,r,h,p,u),a(t,e,r,p,u,h)))}}},{"binary-search-bounds":94,"robust-in-sphere":498}],111:[function(t,e,r){"use strict";var n,a=t("binary-search-bounds");function i(t,e,r,n,a,i,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=a,this.next=i,this.boundary=o}function o(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}e.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,a=0;a<n;++a){var s=(v=r[a])[0],l=v[1],c=v[2];l<c?l<s&&(v[0]=l,v[1]=c,v[2]=s):c<s&&(v[0]=c,v[1]=s,v[2]=l)}r.sort(o);var u=new Array(n);for(a=0;a<u.length;++a)u[a]=0;var h=[],f=[],p=new Array(3*n),d=new Array(3*n),g=null;e&&(g=[]);var m=new i(r,p,d,u,h,f,g);for(a=0;a<n;++a)for(var v=r[a],y=0;y<3;++y){s=v[y],l=v[(y+1)%3];var x=p[3*a+y]=m.locate(l,s,t.opposite(l,s)),b=d[3*a+y]=t.isConstraint(s,l);x<0&&(b?f.push(a):(h.push(a),u[a]=1),e&&g.push([l,s,-1]))}return m}(t,r);if(0===e)return r?n.cells.concat(n.boundary):n.cells;var a=1,s=n.active,l=n.next,c=n.flags,u=n.cells,h=n.constraint,f=n.neighbor;for(;s.length>0||l.length>0;){for(;s.length>0;){var p=s.pop();if(c[p]!==-a){c[p]=a;u[p];for(var d=0;d<3;++d){var g=f[3*p+d];g>=0&&0===c[g]&&(h[3*p+d]?l.push(g):(s.push(g),c[g]=a))}}}var m=l;l=s,s=m,l.length=0,a=-a}var v=function(t,e,r){for(var n=0,a=0;a<t.length;++a)e[a]===r&&(t[n++]=t[a]);return t.length=n,t}(u,c,e);if(r)return v.concat(n.boundary);return v},i.prototype.locate=(n=[0,0,0],function(t,e,r){var i=t,s=e,l=r;return e<r?e<t&&(i=e,s=r,l=t):r<t&&(i=r,s=t,l=e),i<0?-1:(n[0]=i,n[1]=s,n[2]=l,a.eq(this.cells,n,o))})},{"binary-search-bounds":94}],112:[function(t,e,r){"use strict";var n=t("binary-search-bounds"),a=t("robust-orientation")[3];function i(t,e,r,n,a){this.a=t,this.b=e,this.idx=r,this.lowerIds=n,this.upperIds=a}function o(t,e,r,n){this.a=t,this.b=e,this.type=r,this.idx=n}function s(t,e){var r=t.a[0]-e.a[0]||t.a[1]-e.a[1]||t.type-e.type;return r||(0!==t.type&&(r=a(t.a,t.b,e.b))?r:t.idx-e.idx)}function l(t,e){return a(t.a,t.b,e)}function c(t,e,r,i,o){for(var s=n.lt(e,i,l),c=n.gt(e,i,l),u=s;u<c;++u){for(var h=e[u],f=h.lowerIds,p=f.length;p>1&&a(r[f[p-2]],r[f[p-1]],i)>0;)t.push([f[p-1],f[p-2],o]),p-=1;f.length=p,f.push(o);var d=h.upperIds;for(p=d.length;p>1&&a(r[d[p-2]],r[d[p-1]],i)<0;)t.push([d[p-2],d[p-1],o]),p-=1;d.length=p,d.push(o)}}function u(t,e){var r;return(r=t.a[0]<e.a[0]?a(t.a,t.b,e.a):a(e.b,e.a,t.a))?r:(r=e.b[0]<t.b[0]?a(t.a,t.b,e.b):a(e.b,e.a,t.b))||t.idx-e.idx}function h(t,e,r){var a=n.le(t,r,u),o=t[a],s=o.upperIds,l=s[s.length-1];o.upperIds=[l],t.splice(a+1,0,new i(r.a,r.b,r.idx,[l],s))}function f(t,e,r){var a=r.a;r.a=r.b,r.b=a;var i=n.eq(t,r,u),o=t[i];t[i-1].upperIds=o.upperIds,t.splice(i,1)}e.exports=function(t,e){for(var r=t.length,n=e.length,a=[],l=0;l<r;++l)a.push(new o(t[l],null,0,l));for(l=0;l<n;++l){var u=e[l],p=t[u[0]],d=t[u[1]];p[0]<d[0]?a.push(new o(p,d,2,l),new o(d,p,1,l)):p[0]>d[0]&&a.push(new o(d,p,2,l),new o(p,d,1,l))}a.sort(s);for(var g=a[0].a[0]-(1+Math.abs(a[0].a[0]))*Math.pow(2,-52),m=[new i([g,1],[g,0],-1,[],[],[],[])],v=[],y=(l=0,a.length);l<y;++l){var x=a[l],b=x.type;0===b?c(v,m,t,x.a,x.idx):2===b?h(m,t,x):f(m,t,x)}return v}},{"binary-search-bounds":94,"robust-orientation":500}],113:[function(t,e,r){"use strict";var n=t("binary-search-bounds");function a(t,e){this.stars=t,this.edges=e}e.exports=function(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=[];return new a(r,e)};var i=a.prototype;function o(t,e,r){for(var n=1,a=t.length;n<a;n+=2)if(t[n-1]===e&&t[n]===r)return t[n-1]=t[a-2],t[n]=t[a-1],void(t.length=a-2)}i.isConstraint=function(){var t=[0,0];function e(t,e){return t[0]-e[0]||t[1]-e[1]}return function(r,a){return t[0]=Math.min(r,a),t[1]=Math.max(r,a),n.eq(this.edges,t,e)>=0}}(),i.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},i.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},i.opposite=function(t,e){for(var r=this.stars[e],n=1,a=r.length;n<a;n+=2)if(r[n]===t)return r[n-1];return-1},i.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)},i.edges=function(){for(var t=this.stars,e=[],r=0,n=t.length;r<n;++r)for(var a=t[r],i=0,o=a.length;i<o;i+=2)e.push([a[i],a[i+1]]);return e},i.cells=function(){for(var t=this.stars,e=[],r=0,n=t.length;r<n;++r)for(var a=t[r],i=0,o=a.length;i<o;i+=2){var s=a[i],l=a[i+1];r<Math.min(s,l)&&e.push([r,s,l])}return e}},{"binary-search-bounds":94}],114:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1,r=1;r<t.length;++r)for(var n=0;n<r;++n)if(t[r]<t[n])e=-e;else if(t[n]===t[r])return 0;return e}},{}],115:[function(t,e,r){"use strict";var n=t("dup"),a=t("robust-linear-solve");function i(t,e){for(var r=0,n=t.length,a=0;a<n;++a)r+=t[a]*e[a];return r}function o(t){var e=t.length;if(0===e)return[];t[0].length;var r=n([t.length+1,t.length+1],1),o=n([t.length+1],1);r[e][e]=0;for(var s=0;s<e;++s){for(var l=0;l<=s;++l)r[l][s]=r[s][l]=2*i(t[s],t[l]);o[s]=i(t[s],t[s])}var c=a(r,o),u=0,h=c[e+1];for(s=0;s<h.length;++s)u+=h[s];var f=new Array(e);for(s=0;s<e;++s){h=c[s];var p=0;for(l=0;l<h.length;++l)p+=h[l];f[s]=p/u}return f}function s(t){if(0===t.length)return[];for(var e=t[0].length,r=n([e]),a=o(t),i=0;i<t.length;++i)for(var s=0;s<e;++s)r[s]+=t[i][s]*a[i];return r}s.barycenetric=o,e.exports=s},{dup:171,"robust-linear-solve":499}],116:[function(t,e,r){e.exports=function(t){for(var e=n(t),r=0,a=0;a<t.length;++a)for(var i=t[a],o=0;o<e.length;++o)r+=Math.pow(i[o]-e[o],2);return Math.sqrt(r/t.length)};var n=t("circumcenter")},{circumcenter:115}],117:[function(t,e,r){e.exports=function(t,e,r){return e<r?t<e?e:t>r?r:t:t<r?r:t>e?e:t}},{}],118:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n;if(r){n=e;for(var a=new Array(e.length),i=0;i<e.length;++i){var o=e[i];a[i]=[o[0],o[1],r[i]]}e=a}var s=function(t,e,r){var n=d(t,[],p(t));return v(e,n,r),!!n}(t,e,!!r);for(;y(t,e,!!r);)s=!0;if(r&&s){n.length=0,r.length=0;for(i=0;i<e.length;++i){o=e[i];n.push([o[0],o[1]]),r.push(o[2])}}return s};var n=t("union-find"),a=t("box-intersect"),i=t("robust-segment-intersect"),o=t("big-rat"),s=t("big-rat/cmp"),l=t("big-rat/to-float"),c=t("rat-vec"),u=t("nextafter"),h=t("./lib/rat-seg-intersect");function f(t){var e=l(t);return[u(e,-1/0),u(e,1/0)]}function p(t){for(var e=new Array(t.length),r=0;r<t.length;++r){var n=t[r];e[r]=[u(n[0],-1/0),u(n[1],-1/0),u(n[0],1/0),u(n[1],1/0)]}return e}function d(t,e,r){for(var i=e.length,o=new n(i),s=[],l=0;l<e.length;++l){var c=e[l],h=f(c[0]),p=f(c[1]);s.push([u(h[0],-1/0),u(p[0],-1/0),u(h[1],1/0),u(p[1],1/0)])}a(s,(function(t,e){o.link(t,e)}));var d=!0,g=new Array(i);for(l=0;l<i;++l){(v=o.find(l))!==l&&(d=!1,t[v]=[Math.min(t[l][0],t[v][0]),Math.min(t[l][1],t[v][1])])}if(d)return null;var m=0;for(l=0;l<i;++l){var v;(v=o.find(l))===l?(g[l]=m,t[m++]=t[l]):g[l]=-1}t.length=m;for(l=0;l<i;++l)g[l]<0&&(g[l]=g[o.find(l)]);return g}function g(t,e){return t[0]-e[0]||t[1]-e[1]}function m(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 v(t,e,r){if(0!==t.length){if(e)for(var n=0;n<t.length;++n){var a=e[(o=t[n])[0]],i=e[o[1]];o[0]=Math.min(a,i),o[1]=Math.max(a,i)}else for(n=0;n<t.length;++n){var o;a=(o=t[n])[0],i=o[1];o[0]=Math.min(a,i),o[1]=Math.max(a,i)}r?t.sort(m):t.sort(g);var s=1;for(n=1;n<t.length;++n){var l=t[n-1],c=t[n];(c[0]!==l[0]||c[1]!==l[1]||r&&c[2]!==l[2])&&(t[s++]=c)}t.length=s}}function y(t,e,r){var n=function(t,e){for(var r=new Array(e.length),n=0;n<e.length;++n){var a=e[n],i=t[a[0]],o=t[a[1]];r[n]=[u(Math.min(i[0],o[0]),-1/0),u(Math.min(i[1],o[1]),-1/0),u(Math.max(i[0],o[0]),1/0),u(Math.max(i[1],o[1]),1/0)]}return r}(t,e),f=function(t,e,r){var n=[];return a(r,(function(r,a){var o=e[r],s=e[a];if(o[0]!==s[0]&&o[0]!==s[1]&&o[1]!==s[0]&&o[1]!==s[1]){var l=t[o[0]],c=t[o[1]],u=t[s[0]],h=t[s[1]];i(l,c,u,h)&&n.push([r,a])}})),n}(t,e,n),g=p(t),m=function(t,e,r,n){var o=[];return a(r,n,(function(r,n){var a=e[r];if(a[0]!==n&&a[1]!==n){var s=t[n],l=t[a[0]],c=t[a[1]];i(l,c,s,s)&&o.push([r,n])}})),o}(t,e,n,g),y=d(t,function(t,e,r,n,a){var i,u,f=t.map((function(t){return[o(t[0]),o(t[1])]}));for(i=0;i<r.length;++i){var p=r[i];u=p[0];var d=p[1],g=e[u],m=e[d],v=h(c(t[g[0]]),c(t[g[1]]),c(t[m[0]]),c(t[m[1]]));if(v){var y=t.length;t.push([l(v[0]),l(v[1])]),f.push(v),n.push([u,y],[d,y])}}for(n.sort((function(t,e){if(t[0]!==e[0])return t[0]-e[0];var r=f[t[1]],n=f[e[1]];return s(r[0],n[0])||s(r[1],n[1])})),i=n.length-1;i>=0;--i){var x=e[u=(S=n[i])[0]],b=x[0],_=x[1],w=t[b],T=t[_];if((w[0]-T[0]||w[1]-T[1])<0){var k=b;b=_,_=k}x[0]=b;var A,M=x[1]=S[1];for(a&&(A=x[2]);i>0&&n[i-1][0]===u;){var S,E=(S=n[--i])[1];a?e.push([M,E,A]):e.push([M,E]),M=E}a?e.push([M,_,A]):e.push([M,_])}return f}(t,e,f,m,r));return v(e,y,r),!!y||(f.length>0||m.length>0)}},{"./lib/rat-seg-intersect":119,"big-rat":81,"big-rat/cmp":79,"big-rat/to-float":93,"box-intersect":99,nextafter:449,"rat-vec":484,"robust-segment-intersect":503,"union-find":548}],119:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=s(e,t),h=s(n,r),f=u(i,h);if(0===o(f))return null;var p=s(t,r),d=u(h,p),g=a(d,f),m=c(i,g);return l(t,m)};var n=t("big-rat/mul"),a=t("big-rat/div"),i=t("big-rat/sub"),o=t("big-rat/sign"),s=t("rat-vec/sub"),l=t("rat-vec/add"),c=t("rat-vec/muls");function u(t,e){return i(n(t[0],e[1]),n(t[1],e[0]))}},{"big-rat/div":80,"big-rat/mul":90,"big-rat/sign":91,"big-rat/sub":92,"rat-vec/add":483,"rat-vec/muls":485,"rat-vec/sub":486}],120:[function(t,e,r){"use strict";var n=t("clamp");function a(t,e){null==e&&(e=!0);var r=t[0],a=t[1],i=t[2],o=t[3];return null==o&&(o=e?1:255),e&&(r*=255,a*=255,i*=255,o*=255),16777216*(r=255&n(r,0,255))+((a=255&n(a,0,255))<<16)+((i=255&n(i,0,255))<<8)+(o=255&n(o,0,255))}e.exports=a,e.exports.to=a,e.exports.from=function(t,e){var r=(t=+t)>>>24,n=(16711680&t)>>>16,a=(65280&t)>>>8,i=255&t;return!1===e?[r,n,a,i]:[r/255,n/255,a/255,i/255]}},{clamp:117}],121:[function(t,e,r){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],122:[function(t,e,r){"use strict";var n=t("color-rgba"),a=t("clamp"),i=t("dtype");e.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var r=new(i(e))(4),o="uint8"!==e&&"uint8_clamped"!==e;return t.length&&"string"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),function(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||!!(Array.isArray(t)&&(t[0]>1||0===t[0])&&(t[1]>1||0===t[1])&&(t[2]>1||0===t[2])&&(!t[3]||t[3]>1))}(t)?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:255,o&&(r[0]/=255,r[1]/=255,r[2]/=255,r[3]/=255),r):(o?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:1):(r[0]=a(Math.floor(255*t[0]),0,255),r[1]=a(Math.floor(255*t[1]),0,255),r[2]=a(Math.floor(255*t[2]),0,255),r[3]=null==t[3]?255:a(Math.floor(255*t[3]),0,255)),r)}},{clamp:117,"color-rgba":124,dtype:170}],123:[function(t,e,r){(function(r){"use strict";var n=t("color-name"),a=t("is-plain-obj"),i=t("defined");e.exports=function(t){var e,s,l=[],c=1;if("string"==typeof t)if(n[t])l=n[t].slice(),s="rgb";else if("transparent"===t)c=0,s="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var u=(p=t.slice(1)).length;c=1,u<=4?(l=[parseInt(p[0]+p[0],16),parseInt(p[1]+p[1],16),parseInt(p[2]+p[2],16)],4===u&&(c=parseInt(p[3]+p[3],16)/255)):(l=[parseInt(p[0]+p[1],16),parseInt(p[2]+p[3],16),parseInt(p[4]+p[5],16)],8===u&&(c=parseInt(p[6]+p[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var h=e[1],f="rgb"===h,p=h.replace(/a$/,"");s=p;u="cmyk"===p?4:"gray"===p?1:3;l=e[2].trim().split(/\s*,\s*/).map((function(t,e){if(/%$/.test(t))return e===u?parseFloat(t)/100:"rgb"===p?255*parseFloat(t)/100:parseFloat(t);if("h"===p[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)})),h===p&&l.push(1),c=f||void 0===l[u]?1:l[u],l=l.slice(0,u)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(l=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),s=t.match(/([a-z])/gi).join("").toLowerCase());else if(isNaN(t))if(a(t)){var d=i(t.r,t.red,t.R,null);null!==d?(s="rgb",l=[d,i(t.g,t.green,t.G),i(t.b,t.blue,t.B)]):(s="hsl",l=[i(t.h,t.hue,t.H),i(t.s,t.saturation,t.S),i(t.l,t.lightness,t.L,t.b,t.brightness)]),c=i(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(c/=100)}else(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(l=[t[0],t[1],t[2]],s="rgb",c=4===t.length?t[3]:1);else s="rgb",l=[t>>>16,(65280&t)>>>8,255&t];return{space:s,values:l,alpha:c}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":121,defined:165,"is-plain-obj":422}],124:[function(t,e,r){"use strict";var n=t("color-parse"),a=t("color-space/hsl"),i=t("clamp");e.exports=function(t){var e,r=n(t);return r.space?((e=Array(3))[0]=i(r.values[0],0,255),e[1]=i(r.values[1],0,255),e[2]=i(r.values[2],0,255),"h"===r.space[0]&&(e=a.rgb(e)),e.push(i(r.alpha,0,1)),e):[]}},{clamp:117,"color-parse":123,"color-space/hsl":125}],125:[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,a,i,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[i=255*l,i,i];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var c=0;c<3;c++)(n=o+1/3*-(c-1))<0?n++:n>1&&n--,i=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,a[c]=255*i;return a}},n.hsl=function(t){var e,r,n=t[0]/255,a=t[1]/255,i=t[2]/255,o=Math.min(n,a,i),s=Math.max(n,a,i),l=s-o;return s===o?e=0:n===s?e=(a-i)/l:a===s?e=2+(i-n)/l:i===s&&(e=4+(n-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(o+s)/2,[e,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}},{"./rgb":126}],126:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],127:[function(t,e,r){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},{}],128:[function(t,e,r){"use strict";var n=t("./colorScale"),a=t("lerp");function i(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function o(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function s(t){return"rgba("+t.join(",")+")"}e.exports=function(t){var e,r,l,c,u,h,f,p,d,g;t||(t={});p=(t.nshades||72)-1,f=t.format||"hex",(h=t.colormap)||(h="jet");if("string"==typeof h){if(h=h.toLowerCase(),!n[h])throw Error(h+" not a supported colorscale");u=n[h]}else{if(!Array.isArray(h))throw Error("unsupported colormap option",h);u=h.slice()}if(u.length>p+1)throw new Error(h+" map requires nshades to be at least size "+u.length);d=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1];e=u.map((function(t){return Math.round(t.index*p)})),d[0]=Math.min(Math.max(d[0],0),1),d[1]=Math.min(Math.max(d[1],0),1);var m=u.map((function(t,e){var r=u[e].index,n=u[e].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=d[0]+(d[1]-d[0])*r),n})),v=[];for(g=0;g<e.length-1;++g){c=e[g+1]-e[g],r=m[g],l=m[g+1];for(var y=0;y<c;y++){var x=y/c;v.push([Math.round(a(r[0],l[0],x)),Math.round(a(r[1],l[1],x)),Math.round(a(r[2],l[2],x)),a(r[3],l[3],x)])}}v.push(u[u.length-1].rgb.concat(d[1])),"hex"===f?v=v.map(o):"rgbaString"===f?v=v.map(s):"float"===f&&(v=v.map(i));return v}},{"./colorScale":127,lerp:425}],129:[function(t,e,r){"use strict";e.exports=function(t,e,r,i){var o=n(e,r,i);if(0===o){var s=a(n(t,e,r)),c=a(n(t,e,i));if(s===c){if(0===s){var u=l(t,e,r),h=l(t,e,i);return u===h?0:u?1:-1}return 0}return 0===c?s>0||l(t,e,i)?-1:1:0===s?c>0||l(t,e,r)?1:-1:a(c-s)}var f=n(t,e,r);return f>0?o>0&&n(t,e,i)>0?1:-1:f<0?o>0||n(t,e,i)>0?1:-1:n(t,e,i)>0||l(t,e,r)?1:-1};var n=t("robust-orientation"),a=t("signum"),i=t("two-sum"),o=t("robust-product"),s=t("robust-sum");function l(t,e,r){var n=i(t[0],-e[0]),a=i(t[1],-e[1]),l=i(r[0],-e[0]),c=i(r[1],-e[1]),u=s(o(n,l),o(a,c));return u[u.length-1]>=0}},{"robust-orientation":500,"robust-product":501,"robust-sum":505,signum:506,"two-sum":535}],130:[function(t,e,r){e.exports=function(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]||n(t[0],t[1])-n(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=n(t[0],t[1]),c=n(e[0],e[1]);return n(l,t[2])-n(c,e[2])||n(l+t[2],o)-n(c+e[2],s);case 4:var u=t[0],h=t[1],f=t[2],p=t[3],d=e[0],g=e[1],m=e[2],v=e[3];return u+h+f+p-(d+g+m+v)||n(u,h,f,p)-n(d,g,m,v,d)||n(u+h,u+f,u+p,h+f,h+p,f+p)-n(d+g,d+m,d+v,g+m,g+v,m+v)||n(u+h+f,u+h+p,u+f+p,h+f+p)-n(d+g+m,d+g+v,d+m+v,g+m+v);default:for(var y=t.slice().sort(a),x=e.slice().sort(a),b=0;b<r;++b)if(i=y[b]-x[b])return i;return 0}};var n=Math.min;function a(t,e){return t-e}},{}],131:[function(t,e,r){"use strict";var n=t("compare-cell"),a=t("cell-orientation");e.exports=function(t,e){return n(t,e)||a(t)-a(e)}},{"cell-orientation":114,"compare-cell":130}],132:[function(t,e,r){"use strict";var n=t("./lib/ch1d"),a=t("./lib/ch2d"),i=t("./lib/chnd");e.exports=function(t){var e=t.length;if(0===e)return[];if(1===e)return[[0]];var r=t[0].length;if(0===r)return[];if(1===r)return n(t);if(2===r)return a(t);return i(t,r)}},{"./lib/ch1d":133,"./lib/ch2d":134,"./lib/chnd":135}],133:[function(t,e,r){"use strict";e.exports=function(t){for(var e=0,r=0,n=1;n<t.length;++n)t[n][0]<t[e][0]&&(e=n),t[n][0]>t[r][0]&&(r=n);return e<r?[[e],[r]]:e>r?[[r],[e]]:[[e]]}},{}],134:[function(t,e,r){"use strict";e.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var a=new Array(r),i=e[r-1],o=0;o<r;++o){var s=e[o];a[o]=[i,s],i=s}return a};var n=t("monotone-convex-hull-2d")},{"monotone-convex-hull-2d":435}],135:[function(t,e,r){"use strict";e.exports=function(t,e){try{return n(t,!0)}catch(o){var r=a(t);if(r.length<=e)return[];var i=function(t,e){for(var r=t.length,n=new Array(r),a=0;a<e.length;++a)n[a]=t[e[a]];var i=e.length;for(a=0;a<r;++a)e.indexOf(a)<0&&(n[i++]=t[a]);return n}(t,r);return function(t,e){for(var r=t.length,n=e.length,a=0;a<r;++a)for(var i=t[a],o=0;o<i.length;++o){var s=i[o];if(s<n)i[o]=e[s];else{s-=n;for(var l=0;l<n;++l)s>=e[l]&&(s+=1);i[o]=s}}return t}(n(i,!0),r)}};var n=t("incremental-convex-hull"),a=t("affine-hull")},{"affine-hull":65,"incremental-convex-hull":412}],136:[function(t,e,r){e.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|\xe7)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|\xe9)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|\xe9)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|\xe3)o.?tom(e|\xe9)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},{}],137:[function(t,e,r){e.exports=["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]},{}],138:[function(t,e,r){e.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]},{}],139:[function(t,e,r){e.exports=["normal","italic","oblique"]},{}],140:[function(t,e,r){e.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]},{}],141:[function(t,e,r){"use strict";e.exports={parse:t("./parse"),stringify:t("./stringify")}},{"./parse":143,"./stringify":144}],142:[function(t,e,r){"use strict";var n=t("css-font-size-keywords");e.exports={isSize:function(t){return/^[\d\.]/.test(t)||-1!==t.indexOf("/")||-1!==n.indexOf(t)}}},{"css-font-size-keywords":137}],143:[function(t,e,r){"use strict";var n=t("unquote"),a=t("css-global-keywords"),i=t("css-system-font-keywords"),o=t("css-font-weight-keywords"),s=t("css-font-style-keywords"),l=t("css-font-stretch-keywords"),c=t("string-split-by"),u=t("./lib/util").isSize;e.exports=f;var h=f.cache={};function f(t){if("string"!=typeof t)throw new Error("Font argument must be a string.");if(h[t])return h[t];if(""===t)throw new Error("Cannot parse an empty string.");if(-1!==i.indexOf(t))return h[t]={system:t};for(var e,r={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},f=c(t,/\s+/);e=f.shift();){if(-1!==a.indexOf(e))return["style","variant","weight","stretch"].forEach((function(t){r[t]=e})),h[t]=r;if(-1===s.indexOf(e))if("normal"!==e&&"small-caps"!==e)if(-1===l.indexOf(e)){if(-1===o.indexOf(e)){if(u(e)){var d=c(e,"/");if(r.size=d[0],null!=d[1]?r.lineHeight=p(d[1]):"/"===f[0]&&(f.shift(),r.lineHeight=p(f.shift())),!f.length)throw new Error("Missing required font-family.");return r.family=c(f.join(" "),/\s*,\s*/).map(n),h[t]=r}throw new Error("Unknown or unsupported font token: "+e)}r.weight=e}else r.stretch=e;else r.variant=e;else r.style=e}throw new Error("Missing required font-size.")}function p(t){var e=parseFloat(t);return e.toString()===t?e:t}},{"./lib/util":142,"css-font-stretch-keywords":138,"css-font-style-keywords":139,"css-font-weight-keywords":140,"css-global-keywords":145,"css-system-font-keywords":146,"string-split-by":520,unquote:550}],144:[function(t,e,r){"use strict";var n=t("pick-by-alias"),a=t("./lib/util").isSize,i=g(t("css-global-keywords")),o=g(t("css-system-font-keywords")),s=g(t("css-font-weight-keywords")),l=g(t("css-font-style-keywords")),c=g(t("css-font-stretch-keywords")),u={normal:1,"small-caps":1},h={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},f="1rem",p="serif";function d(t,e){if(t&&!e[t]&&!i[t])throw Error("Unknown keyword `"+t+"`");return t}function g(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=1;return e}e.exports=function(t){if((t=n(t,{style:"style fontstyle fontStyle font-style slope distinction",variant:"variant font-variant fontVariant fontvariant var capitalization",weight:"weight w font-weight fontWeight fontweight",stretch:"stretch font-stretch fontStretch fontstretch width",size:"size s font-size fontSize fontsize height em emSize",lineHeight:"lh line-height lineHeight lineheight leading",family:"font family fontFamily font-family fontfamily type typeface face",system:"system reserved default global"})).system)return t.system&&d(t.system,o),t.system;if(d(t.style,l),d(t.variant,u),d(t.weight,s),d(t.stretch,c),null==t.size&&(t.size=f),"number"==typeof t.size&&(t.size+="px"),!a)throw Error("Bad size value `"+t.size+"`");t.family||(t.family=p),Array.isArray(t.family)&&(t.family.length||(t.family=[p]),t.family=t.family.map((function(t){return h[t]?t:'"'+t+'"'})).join(", "));var e=[];return e.push(t.style),t.variant!==t.style&&e.push(t.variant),t.weight!==t.variant&&t.weight!==t.style&&e.push(t.weight),t.stretch!==t.weight&&t.stretch!==t.variant&&t.stretch!==t.style&&e.push(t.stretch),e.push(t.size+(null==t.lineHeight||"normal"===t.lineHeight||t.lineHeight+""=="1"?"":"/"+t.lineHeight)),e.push(t.family),e.filter(Boolean).join(" ")}},{"./lib/util":142,"css-font-stretch-keywords":138,"css-font-style-keywords":139,"css-font-weight-keywords":140,"css-global-keywords":145,"css-system-font-keywords":146,"pick-by-alias":463}],145:[function(t,e,r){e.exports=["inherit","initial","unset"]},{}],146:[function(t,e,r){e.exports=["caption","icon","menu","message-box","small-caption","status-bar"]},{}],147:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,a,i){var o=a-1,s=a*a,l=o*o,c=(1+2*a)*l,u=a*l,h=s*(3-2*a),f=s*o;if(t.length){i||(i=new Array(t.length));for(var p=t.length-1;p>=0;--p)i[p]=c*t[p]+u*e[p]+h*r[p]+f*n[p];return i}return c*t+u*e+h*r+f*n},e.exports.derivative=function(t,e,r,n,a,i){var o=6*a*a-6*a,s=3*a*a-4*a+1,l=-6*a*a+6*a,c=3*a*a-2*a;if(t.length){i||(i=new Array(t.length));for(var u=t.length-1;u>=0;--u)i[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return i}return o*t+s*e+l*r[u]+c*n}},{}],148:[function(t,e,r){"use strict";var n=t("./lib/thunk.js");function a(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}e.exports=function(t){var e=new a;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,n(e)}},{"./lib/thunk.js":150}],149:[function(t,e,r){"use strict";var n=t("uniq");function a(t,e,r){var n,a,i=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],c=[],u=0,h=0;for(n=0;n<i;++n)c.push(["i",n,"=0"].join(""));for(a=0;a<o;++a)for(n=0;n<i;++n)h=u,u=t[n],0===n?c.push(["d",a,"s",n,"=t",a,"p",u].join("")):c.push(["d",a,"s",n,"=(t",a,"p",u,"-s",h,"*t",a,"p",h,")"].join(""));for(c.length>0&&l.push("var "+c.join(",")),n=i-1;n>=0;--n)u=t[n],l.push(["for(i",n,"=0;i",n,"<s",u,";++i",n,"){"].join(""));for(l.push(r),n=0;n<i;++n){for(h=u,u=t[n],a=0;a<o;++a)l.push(["p",a,"+=d",a,"s",n].join(""));s&&(n>0&&l.push(["index[",h,"]-=s",h].join("")),l.push(["++index[",u,"]"].join(""))),l.push("}")}return l.join("\n")}function i(t,e,r){for(var n=t.body,a=[],i=[],o=0;o<t.args.length;++o){var s=t.args[o];if(!(s.count<=0)){var l=new RegExp(s.name,"g"),c="",u=e.arrayArgs.indexOf(o);switch(e.argTypes[o]){case"offset":var h=e.offsetArgIndex.indexOf(o);u=e.offsetArgs[h].array,c="+q"+h;case"array":c="p"+u+c;var f="l"+o,p="a"+u;if(0===e.arrayBlockIndices[u])1===s.count?"generic"===r[u]?s.lvalue?(a.push(["var ",f,"=",p,".get(",c,")"].join("")),n=n.replace(l,f),i.push([p,".set(",c,",",f,")"].join(""))):n=n.replace(l,[p,".get(",c,")"].join("")):n=n.replace(l,[p,"[",c,"]"].join("")):"generic"===r[u]?(a.push(["var ",f,"=",p,".get(",c,")"].join("")),n=n.replace(l,f),s.lvalue&&i.push([p,".set(",c,",",f,")"].join(""))):(a.push(["var ",f,"=",p,"[",c,"]"].join("")),n=n.replace(l,f),s.lvalue&&i.push([p,"[",c,"]=",f].join("")));else{for(var d=[s.name],g=[c],m=0;m<Math.abs(e.arrayBlockIndices[u]);m++)d.push("\\s*\\[([^\\]]+)\\]"),g.push("$"+(m+1)+"*t"+u+"b"+m);if(l=new RegExp(d.join(""),"g"),c=g.join("+"),"generic"===r[u])throw new Error("cwise: Generic arrays not supported in combination with blocks!");n=n.replace(l,[p,"[",c,"]"].join(""))}break;case"scalar":n=n.replace(l,"Y"+e.scalarArgs.indexOf(o));break;case"index":n=n.replace(l,"index");break;case"shape":n=n.replace(l,"shape")}}}return[a.join("\n"),n,i.join("\n")].join("\n").trim()}function o(t){for(var e=new Array(t.length),r=!0,n=0;n<t.length;++n){var a=t[n],i=a.match(/\d+/);i=i?i[0]:"",0===a.charAt(0)?e[n]="u"+a.charAt(1)+i:e[n]=a.charAt(0)+i,n>0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}e.exports=function(t,e){for(var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,s=new Array(t.arrayArgs.length),l=new Array(t.arrayArgs.length),c=0;c<t.arrayArgs.length;++c)l[c]=e[2*c],s[c]=e[2*c+1];var u=[],h=[],f=[],p=[],d=[];for(c=0;c<t.arrayArgs.length;++c){t.arrayBlockIndices[c]<0?(f.push(0),p.push(r),u.push(r),h.push(r+t.arrayBlockIndices[c])):(f.push(t.arrayBlockIndices[c]),p.push(t.arrayBlockIndices[c]+r),u.push(0),h.push(t.arrayBlockIndices[c]));for(var g=[],m=0;m<s[c].length;m++)f[c]<=s[c][m]&&s[c][m]<p[c]&&g.push(s[c][m]-f[c]);d.push(g)}var v=["SS"],y=["'use strict'"],x=[];for(m=0;m<r;++m)x.push(["s",m,"=SS[",m,"]"].join(""));for(c=0;c<t.arrayArgs.length;++c){v.push("a"+c),v.push("t"+c),v.push("p"+c);for(m=0;m<r;++m)x.push(["t",c,"p",m,"=t",c,"[",f[c]+m,"]"].join(""));for(m=0;m<Math.abs(t.arrayBlockIndices[c]);++m)x.push(["t",c,"b",m,"=t",c,"[",u[c]+m,"]"].join(""))}for(c=0;c<t.scalarArgs.length;++c)v.push("Y"+c);if(t.shapeArgs.length>0&&x.push("shape=SS.slice(0)"),t.indexArgs.length>0){var b=new Array(r);for(c=0;c<r;++c)b[c]="0";x.push(["index=[",b.join(","),"]"].join(""))}for(c=0;c<t.offsetArgs.length;++c){var _=t.offsetArgs[c],w=[];for(m=0;m<_.offset.length;++m)0!==_.offset[m]&&(1===_.offset[m]?w.push(["t",_.array,"p",m].join("")):w.push([_.offset[m],"*t",_.array,"p",m].join("")));0===w.length?x.push("q"+c+"=0"):x.push(["q",c,"=",w.join("+")].join(""))}var T=n([].concat(t.pre.thisVars).concat(t.body.thisVars).concat(t.post.thisVars));for((x=x.concat(T)).length>0&&y.push("var "+x.join(",")),c=0;c<t.arrayArgs.length;++c)y.push("p"+c+"|=0");t.pre.body.length>3&&y.push(i(t.pre,t,l));var k=i(t.body,t,l),A=function(t){for(var e=0,r=t[0].length;e<r;){for(var n=1;n<t.length;++n)if(t[n][e]!==t[0][e])return e;++e}return e}(d);A<r?y.push(function(t,e,r,n){for(var i=e.length,o=r.arrayArgs.length,s=r.blockSize,l=r.indexArgs.length>0,c=[],u=0;u<o;++u)c.push(["var offset",u,"=p",u].join(""));for(u=t;u<i;++u)c.push(["for(var j"+u+"=SS[",e[u],"]|0;j",u,">0;){"].join("")),c.push(["if(j",u,"<",s,"){"].join("")),c.push(["s",e[u],"=j",u].join("")),c.push(["j",u,"=0"].join("")),c.push(["}else{s",e[u],"=",s].join("")),c.push(["j",u,"-=",s,"}"].join("")),l&&c.push(["index[",e[u],"]=j",u].join(""));for(u=0;u<o;++u){for(var h=["offset"+u],f=t;f<i;++f)h.push(["j",f,"*t",u,"p",e[f]].join(""));c.push(["p",u,"=(",h.join("+"),")"].join(""))}for(c.push(a(e,r,n)),u=t;u<i;++u)c.push("}");return c.join("\n")}(A,d[0],t,k)):y.push(a(d[0],t,k)),t.post.body.length>3&&y.push(i(t.post,t,l)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+y.join("\n")+"\n----------");var M=[t.funcName||"unnamed","_cwise_loop_",s[0].join("s"),"m",A,o(l)].join("");return new Function(["function ",M,"(",v.join(","),"){",y.join("\n"),"} return ",M].join(""))()}},{uniq:549}],150:[function(t,e,r){"use strict";var n=t("./compile.js");e.exports=function(t){var e=["'use strict'","var CACHED={}"],r=[],a=t.funcName+"_cwise_thunk";e.push(["return function ",a,"(",t.shimArgs.join(","),"){"].join(""));for(var i=[],o=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],l=[],c=[],u=0;u<t.arrayArgs.length;++u){var h=t.arrayArgs[u];r.push(["t",h,"=array",h,".dtype,","r",h,"=array",h,".order"].join("")),i.push("t"+h),i.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"),u>0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+h+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[u]))),c.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+h+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[u])+"]"))}for(t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+c.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}")),u=0;u<t.scalarArgs.length;++u)s.push("scalar"+t.scalarArgs[u]);return r.push(["type=[",o.join(","),"].join()"].join("")),r.push("proc=CACHED[type]"),e.push("var "+r.join(",")),e.push(["if(!proc){","CACHED[type]=proc=compile([",i.join(","),"])}","return proc(",s.join(","),")}"].join("")),t.debug&&console.log("-----Generated thunk:\n"+e.join("\n")+"\n----------"),new Function("compile",e.join("\n"))(n.bind(void 0,t))}},{"./compile.js":149}],151:[function(t,e,r){"use strict";var n,a=t("type/value/is"),i=t("type/value/ensure"),o=t("type/plain-function/ensure"),s=t("es5-ext/object/copy"),l=t("es5-ext/object/normalize-options"),c=t("es5-ext/object/map"),u=Function.prototype.bind,h=Object.defineProperty,f=Object.prototype.hasOwnProperty;n=function(t,e,r){var n,a=i(e)&&o(e.value);return delete(n=s(e)).writable,delete n.value,n.get=function(){return!r.overwriteDefinition&&f.call(this,t)?a:(e.value=u.call(a,r.resolveContext?r.resolveContext(this):this),h(this,t,e),this[t])},n},e.exports=function(t){var e=l(arguments[1]);return a(e.resolveContext)&&o(e.resolveContext),c(t,(function(t,r){return n(r,t,e)}))}},{"es5-ext/object/copy":191,"es5-ext/object/map":199,"es5-ext/object/normalize-options":200,"type/plain-function/ensure":541,"type/value/ensure":545,"type/value/is":546}],152:[function(t,e,r){"use strict";var n=t("type/value/is"),a=t("type/plain-function/is"),i=t("es5-ext/object/assign"),o=t("es5-ext/object/normalize-options"),s=t("es5-ext/string/#/contains");(e.exports=function(t,e){var r,a,l,c,u;return arguments.length<2||"string"!=typeof t?(c=e,e=t,t=null):c=arguments[2],n(t)?(r=s.call(t,"c"),a=s.call(t,"e"),l=s.call(t,"w")):(r=l=!0,a=!1),u={value:e,configurable:r,enumerable:a,writable:l},c?i(o(c),u):u}).gs=function(t,e,r){var l,c,u,h;return"string"!=typeof t?(u=r,r=e,e=t,t=null):u=arguments[3],n(e)?a(e)?n(r)?a(r)||(u=r,r=void 0):r=void 0:(u=e,e=r=void 0):e=void 0,n(t)?(l=s.call(t,"c"),c=s.call(t,"e")):(l=!0,c=!1),h={get:e,set:r,configurable:l,enumerable:c},u?i(o(u),h):h}},{"es5-ext/object/assign":188,"es5-ext/object/normalize-options":200,"es5-ext/string/#/contains":207,"type/plain-function/is":542,"type/value/is":546}],153:[function(t,e,r){!function(t,n){n("object"==typeof r&&"undefined"!=typeof e?r:t.d3=t.d3||{})}(this,(function(t){"use strict";function e(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function r(t){var r;return 1===t.length&&(r=t,t=function(t,n){return e(r(t),n)}),{left:function(e,r,n,a){for(null==n&&(n=0),null==a&&(a=e.length);n<a;){var i=n+a>>>1;t(e[i],r)<0?n=i+1:a=i}return n},right:function(e,r,n,a){for(null==n&&(n=0),null==a&&(a=e.length);n<a;){var i=n+a>>>1;t(e[i],r)>0?a=i:n=i+1}return n}}}var n=r(e),a=n.right,i=n.left;function o(t,e){return[t,e]}function s(t){return null===t?NaN:+t}function l(t,e){var r,n,a=t.length,i=0,o=-1,l=0,c=0;if(null==e)for(;++o<a;)isNaN(r=s(t[o]))||(c+=(n=r-l)*(r-(l+=n/++i)));else for(;++o<a;)isNaN(r=s(e(t[o],o,t)))||(c+=(n=r-l)*(r-(l+=n/++i)));if(i>1)return c/(i-1)}function c(t,e){var r=l(t,e);return r?Math.sqrt(r):r}function u(t,e){var r,n,a,i=t.length,o=-1;if(null==e){for(;++o<i;)if(null!=(r=t[o])&&r>=r)for(n=a=r;++o<i;)null!=(r=t[o])&&(n>r&&(n=r),a<r&&(a=r))}else for(;++o<i;)if(null!=(r=e(t[o],o,t))&&r>=r)for(n=a=r;++o<i;)null!=(r=e(t[o],o,t))&&(n>r&&(n=r),a<r&&(a=r));return[n,a]}var h=Array.prototype,f=h.slice,p=h.map;function d(t){return function(){return t}}function g(t){return t}function m(t,e,r){t=+t,e=+e,r=(a=arguments.length)<2?(e=t,t=0,1):a<3?1:+r;for(var n=-1,a=0|Math.max(0,Math.ceil((e-t)/r)),i=new Array(a);++n<a;)i[n]=t+n*r;return i}var v=Math.sqrt(50),y=Math.sqrt(10),x=Math.sqrt(2);function b(t,e,r){var n=(e-t)/Math.max(0,r),a=Math.floor(Math.log(n)/Math.LN10),i=n/Math.pow(10,a);return a>=0?(i>=v?10:i>=y?5:i>=x?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(i>=v?10:i>=y?5:i>=x?2:1)}function _(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),a=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),i=n/a;return i>=v?a*=10:i>=y?a*=5:i>=x&&(a*=2),e<t?-a:a}function w(t){return Math.ceil(Math.log(t.length)/Math.LN2)+1}function T(t,e,r){if(null==r&&(r=s),n=t.length){if((e=+e)<=0||n<2)return+r(t[0],0,t);if(e>=1)return+r(t[n-1],n-1,t);var n,a=(n-1)*e,i=Math.floor(a),o=+r(t[i],i,t);return o+(+r(t[i+1],i+1,t)-o)*(a-i)}}function k(t,e){var r,n,a=t.length,i=-1;if(null==e){for(;++i<a;)if(null!=(r=t[i])&&r>=r)for(n=r;++i<a;)null!=(r=t[i])&&n>r&&(n=r)}else for(;++i<a;)if(null!=(r=e(t[i],i,t))&&r>=r)for(n=r;++i<a;)null!=(r=e(t[i],i,t))&&n>r&&(n=r);return n}function A(t){if(!(a=t.length))return[];for(var e=-1,r=k(t,M),n=new Array(r);++e<r;)for(var a,i=-1,o=n[e]=new Array(a);++i<a;)o[i]=t[i][e];return n}function M(t){return t.length}t.bisect=a,t.bisectRight=a,t.bisectLeft=i,t.ascending=e,t.bisector=r,t.cross=function(t,e,r){var n,a,i,s,l=t.length,c=e.length,u=new Array(l*c);for(null==r&&(r=o),n=i=0;n<l;++n)for(s=t[n],a=0;a<c;++a,++i)u[i]=r(s,e[a]);return u},t.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},t.deviation=c,t.extent=u,t.histogram=function(){var t=g,e=u,r=w;function n(n){var i,o,s=n.length,l=new Array(s);for(i=0;i<s;++i)l[i]=t(n[i],i,n);var c=e(l),u=c[0],h=c[1],f=r(l,u,h);Array.isArray(f)||(f=_(u,h,f),f=m(Math.ceil(u/f)*f,h,f));for(var p=f.length;f[0]<=u;)f.shift(),--p;for(;f[p-1]>h;)f.pop(),--p;var d,g=new Array(p+1);for(i=0;i<=p;++i)(d=g[i]=[]).x0=i>0?f[i-1]:u,d.x1=i<p?f[i]:h;for(i=0;i<s;++i)u<=(o=l[i])&&o<=h&&g[a(f,o,0,p)].push(n[i]);return g}return n.value=function(e){return arguments.length?(t="function"==typeof e?e:d(e),n):t},n.domain=function(t){return arguments.length?(e="function"==typeof t?t:d([t[0],t[1]]),n):e},n.thresholds=function(t){return arguments.length?(r="function"==typeof t?t:Array.isArray(t)?d(f.call(t)):d(t),n):r},n},t.thresholdFreedmanDiaconis=function(t,r,n){return t=p.call(t,s).sort(e),Math.ceil((n-r)/(2*(T(t,.75)-T(t,.25))*Math.pow(t.length,-1/3)))},t.thresholdScott=function(t,e,r){return Math.ceil((r-e)/(3.5*c(t)*Math.pow(t.length,-1/3)))},t.thresholdSturges=w,t.max=function(t,e){var r,n,a=t.length,i=-1;if(null==e){for(;++i<a;)if(null!=(r=t[i])&&r>=r)for(n=r;++i<a;)null!=(r=t[i])&&r>n&&(n=r)}else for(;++i<a;)if(null!=(r=e(t[i],i,t))&&r>=r)for(n=r;++i<a;)null!=(r=e(t[i],i,t))&&r>n&&(n=r);return n},t.mean=function(t,e){var r,n=t.length,a=n,i=-1,o=0;if(null==e)for(;++i<n;)isNaN(r=s(t[i]))?--a:o+=r;else for(;++i<n;)isNaN(r=s(e(t[i],i,t)))?--a:o+=r;if(a)return o/a},t.median=function(t,r){var n,a=t.length,i=-1,o=[];if(null==r)for(;++i<a;)isNaN(n=s(t[i]))||o.push(n);else for(;++i<a;)isNaN(n=s(r(t[i],i,t)))||o.push(n);return T(o.sort(e),.5)},t.merge=function(t){for(var e,r,n,a=t.length,i=-1,o=0;++i<a;)o+=t[i].length;for(r=new Array(o);--a>=0;)for(e=(n=t[a]).length;--e>=0;)r[--o]=n[e];return r},t.min=k,t.pairs=function(t,e){null==e&&(e=o);for(var r=0,n=t.length-1,a=t[0],i=new Array(n<0?0:n);r<n;)i[r]=e(a,a=t[++r]);return i},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.quantile=T,t.range=m,t.scan=function(t,r){if(n=t.length){var n,a,i=0,o=0,s=t[o];for(null==r&&(r=e);++i<n;)(r(a=t[i],s)<0||0!==r(s,s))&&(s=a,o=i);return 0===r(s,s)?o:void 0}},t.shuffle=function(t,e,r){for(var n,a,i=(null==r?t.length:r)-(e=null==e?0:+e);i;)a=Math.random()*i--|0,n=t[i+e],t[i+e]=t[a+e],t[a+e]=n;return t},t.sum=function(t,e){var r,n=t.length,a=-1,i=0;if(null==e)for(;++a<n;)(r=+t[a])&&(i+=r);else for(;++a<n;)(r=+e(t[a],a,t))&&(i+=r);return i},t.ticks=function(t,e,r){var n,a,i,o,s=-1;if(r=+r,(t=+t)===(e=+e)&&r>0)return[t];if((n=e<t)&&(a=t,t=e,e=a),0===(o=b(t,e,r))||!isFinite(o))return[];if(o>0)for(t=Math.ceil(t/o),e=Math.floor(e/o),i=new Array(a=Math.ceil(e-t+1));++s<a;)i[s]=(t+s)*o;else for(t=Math.floor(t*o),e=Math.ceil(e*o),i=new Array(a=Math.ceil(t-e+1));++s<a;)i[s]=(t-s)/o;return n&&i.reverse(),i},t.tickIncrement=b,t.tickStep=_,t.transpose=A,t.variance=l,t.zip=function(){return A(arguments)},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],154:[function(t,e,r){!function(t,n){n("object"==typeof r&&"undefined"!=typeof e?r:t.d3=t.d3||{})}(this,(function(t){"use strict";function e(){}function r(t,r){var n=new e;if(t instanceof e)t.each((function(t,e){n.set(e,t)}));else if(Array.isArray(t)){var a,i=-1,o=t.length;if(null==r)for(;++i<o;)n.set(i,t[i]);else for(;++i<o;)n.set(r(a=t[i],i,t),a)}else if(t)for(var s in t)n.set(s,t[s]);return n}function n(){return{}}function a(t,e,r){t[e]=r}function i(){return r()}function o(t,e,r){t.set(e,r)}function s(){}e.prototype=r.prototype={constructor:e,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,e){return this["$"+t]=e,this},remove:function(t){var e="$"+t;return e in this&&delete this[e]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)"$"===e[0]&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)"$"===e[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var e in this)"$"===e[0]&&t(this[e],e.slice(1),this)}};var l=r.prototype;function c(t,e){var r=new s;if(t instanceof s)t.each((function(t){r.add(t)}));else if(t){var n=-1,a=t.length;if(null==e)for(;++n<a;)r.add(t[n]);else for(;++n<a;)r.add(e(t[n],n,t))}return r}s.prototype=c.prototype={constructor:s,has:l.has,add:function(t){return this["$"+(t+="")]=t,this},remove:l.remove,clear:l.clear,values:l.keys,size:l.size,empty:l.empty,each:l.each},t.nest=function(){var t,e,s,l=[],c=[];function u(n,a,i,o){if(a>=l.length)return null!=t&&n.sort(t),null!=e?e(n):n;for(var s,c,h,f=-1,p=n.length,d=l[a++],g=r(),m=i();++f<p;)(h=g.get(s=d(c=n[f])+""))?h.push(c):g.set(s,[c]);return g.each((function(t,e){o(m,e,u(t,a,i,o))})),m}return s={object:function(t){return u(t,0,n,a)},map:function(t){return u(t,0,i,o)},entries:function(t){return function t(r,n){if(++n>l.length)return r;var a,i=c[n-1];return null!=e&&n>=l.length?a=r.entries():(a=[],r.each((function(e,r){a.push({key:r,values:t(e,n)})}))),null!=i?a.sort((function(t,e){return i(t.key,e.key)})):a}(u(t,0,i,o),0)},key:function(t){return l.push(t),s},sortKeys:function(t){return c[l.length-1]=t,s},sortValues:function(e){return t=e,s},rollup:function(t){return e=t,s}}},t.set=c,t.map=r,t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],155:[function(t,e,r){!function(t,n){"object"==typeof r&&"undefined"!=typeof e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";function e(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function r(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function n(){}var a="\\s*([+-]?\\d+)\\s*",i="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",o="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",s=/^#([0-9a-f]{3,8})$/,l=new RegExp("^rgb\\("+[a,a,a]+"\\)$"),c=new RegExp("^rgb\\("+[o,o,o]+"\\)$"),u=new RegExp("^rgba\\("+[a,a,a,i]+"\\)$"),h=new RegExp("^rgba\\("+[o,o,o,i]+"\\)$"),f=new RegExp("^hsl\\("+[i,o,o]+"\\)$"),p=new RegExp("^hsla\\("+[i,o,o,i]+"\\)$"),d={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function g(){return this.rgb().formatHex()}function m(){return this.rgb().formatRgb()}function v(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=s.exec(t))?(r=e[1].length,e=parseInt(e[1],16),6===r?y(e):3===r?new w(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?x(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?x(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=l.exec(t))?new w(e[1],e[2],e[3],1):(e=c.exec(t))?new w(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=u.exec(t))?x(e[1],e[2],e[3],e[4]):(e=h.exec(t))?x(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=f.exec(t))?M(e[1],e[2]/100,e[3]/100,1):(e=p.exec(t))?M(e[1],e[2]/100,e[3]/100,e[4]):d.hasOwnProperty(t)?y(d[t]):"transparent"===t?new w(NaN,NaN,NaN,0):null}function y(t){return new w(t>>16&255,t>>8&255,255&t,1)}function x(t,e,r,n){return n<=0&&(t=e=r=NaN),new w(t,e,r,n)}function b(t){return t instanceof n||(t=v(t)),t?new w((t=t.rgb()).r,t.g,t.b,t.opacity):new w}function _(t,e,r,n){return 1===arguments.length?b(t):new w(t,e,r,null==n?1:n)}function w(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function T(){return"#"+A(this.r)+A(this.g)+A(this.b)}function k(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function A(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function M(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new C(t,e,r,n)}function S(t){if(t instanceof C)return new C(t.h,t.s,t.l,t.opacity);if(t instanceof n||(t=v(t)),!t)return new C;if(t instanceof C)return t;var e=(t=t.rgb()).r/255,r=t.g/255,a=t.b/255,i=Math.min(e,r,a),o=Math.max(e,r,a),s=NaN,l=o-i,c=(o+i)/2;return l?(s=e===o?(r-a)/l+6*(r<a):r===o?(a-e)/l+2:(e-r)/l+4,l/=c<.5?o+i:2-o-i,s*=60):l=c>0&&c<1?0:s,new C(s,l,c,t.opacity)}function E(t,e,r,n){return 1===arguments.length?S(t):new C(t,e,r,null==n?1:n)}function C(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function L(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}e(n,v,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:g,formatHex:g,formatHsl:function(){return S(this).formatHsl()},formatRgb:m,toString:m}),e(w,_,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new w(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new w(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:T,formatHex:T,formatRgb:k,toString:k})),e(C,E,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new C(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new C(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,a=2*r-n;return new w(L(t>=240?t-240:t+120,a,n),L(t,a,n),L(t<120?t+240:t-120,a,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var P=Math.PI/180,I=180/Math.PI,z=6/29,O=3*z*z;function D(t){if(t instanceof F)return new F(t.l,t.a,t.b,t.opacity);if(t instanceof H)return G(t);t instanceof w||(t=b(t));var e,r,n=V(t.r),a=V(t.g),i=V(t.b),o=B((.2225045*n+.7168786*a+.0606169*i)/1);return n===a&&a===i?e=r=o:(e=B((.4360747*n+.3850649*a+.1430804*i)/.96422),r=B((.0139322*n+.0971045*a+.7141733*i)/.82521)),new F(116*o-16,500*(e-o),200*(o-r),t.opacity)}function R(t,e,r,n){return 1===arguments.length?D(t):new F(t,e,r,null==n?1:n)}function F(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function B(t){return t>.008856451679035631?Math.pow(t,1/3):t/O+4/29}function N(t){return t>z?t*t*t:O*(t-4/29)}function j(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function V(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function U(t){if(t instanceof H)return new H(t.h,t.c,t.l,t.opacity);if(t instanceof F||(t=D(t)),0===t.a&&0===t.b)return new H(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*I;return new H(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function q(t,e,r,n){return 1===arguments.length?U(t):new H(t,e,r,null==n?1:n)}function H(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function G(t){if(isNaN(t.h))return new F(t.l,0,0,t.opacity);var e=t.h*P;return new F(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}e(F,R,r(n,{brighter:function(t){return new F(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new F(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return new w(j(3.1338561*(e=.96422*N(e))-1.6168667*(t=1*N(t))-.4906146*(r=.82521*N(r))),j(-.9787684*e+1.9161415*t+.033454*r),j(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}})),e(H,q,r(n,{brighter:function(t){return new H(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new H(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return G(this).rgb()}}));var Y=-.14861,W=1.78277,Z=-.29227,X=-.90649,J=1.97294,K=J*X,Q=J*W,$=W*Z-X*Y;function tt(t){if(t instanceof rt)return new rt(t.h,t.s,t.l,t.opacity);t instanceof w||(t=b(t));var e=t.r/255,r=t.g/255,n=t.b/255,a=($*n+K*e-Q*r)/($+K-Q),i=n-a,o=(J*(r-a)-Z*i)/X,s=Math.sqrt(o*o+i*i)/(J*a*(1-a)),l=s?Math.atan2(o,i)*I-120:NaN;return new rt(l<0?l+360:l,s,a,t.opacity)}function et(t,e,r,n){return 1===arguments.length?tt(t):new rt(t,e,r,null==n?1:n)}function rt(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}e(rt,et,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new rt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new rt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*P,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),a=Math.sin(t);return new w(255*(e+r*(Y*n+W*a)),255*(e+r*(Z*n+X*a)),255*(e+r*(J*n)),this.opacity)}})),t.color=v,t.cubehelix=et,t.gray=function(t,e){return new F(t,0,0,null==e?1:e)},t.hcl=q,t.hsl=E,t.lab=R,t.lch=function(t,e,r,n){return 1===arguments.length?U(t):new H(r,e,t,null==n?1:n)},t.rgb=_,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],156:[function(t,e,r){!function(t,n){"object"==typeof r&&"undefined"!=typeof e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";var e={value:function(){}};function r(){for(var t,e=0,r=arguments.length,a={};e<r;++e){if(!(t=arguments[e]+"")||t in a||/[\s.]/.test(t))throw new Error("illegal type: "+t);a[t]=[]}return new n(a)}function n(t){this._=t}function a(t,e){return t.trim().split(/^|\s+/).map((function(t){var r="",n=t.indexOf(".");if(n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}}))}function i(t,e){for(var r,n=0,a=t.length;n<a;++n)if((r=t[n]).name===e)return r.value}function o(t,r,n){for(var a=0,i=t.length;a<i;++a)if(t[a].name===r){t[a]=e,t=t.slice(0,a).concat(t.slice(a+1));break}return null!=n&&t.push({name:r,value:n}),t}n.prototype=r.prototype={constructor:n,on:function(t,e){var r,n=this._,s=a(t+"",n),l=-1,c=s.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++l<c;)if(r=(t=s[l]).type)n[r]=o(n[r],t.name,e);else if(null==e)for(r in n)n[r]=o(n[r],t.name,null);return this}for(;++l<c;)if((r=(t=s[l]).type)&&(r=i(n[r],t.name)))return r},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new n(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var r,n,a=new Array(r),i=0;i<r;++i)a[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,r=(n=this._[t]).length;i<r;++i)n[i].value.apply(e,a)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],a=0,i=n.length;a<i;++a)n[a].value.apply(e,r)}},t.dispatch=r,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],157:[function(t,e,r){!function(n,a){"object"==typeof r&&"undefined"!=typeof e?a(r,t("d3-quadtree"),t("d3-collection"),t("d3-dispatch"),t("d3-timer")):a(n.d3=n.d3||{},n.d3,n.d3,n.d3,n.d3)}(this,(function(t,e,r,n,a){"use strict";function i(t){return function(){return t}}function o(){return 1e-6*(Math.random()-.5)}function s(t){return t.x+t.vx}function l(t){return t.y+t.vy}function c(t){return t.index}function u(t,e){var r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function h(t){return t.x}function f(t){return t.y}var p=Math.PI*(3-Math.sqrt(5));t.forceCenter=function(t,e){var r;function n(){var n,a,i=r.length,o=0,s=0;for(n=0;n<i;++n)o+=(a=r[n]).x,s+=a.y;for(o=o/i-t,s=s/i-e,n=0;n<i;++n)(a=r[n]).x-=o,a.y-=s}return null==t&&(t=0),null==e&&(e=0),n.initialize=function(t){r=t},n.x=function(e){return arguments.length?(t=+e,n):t},n.y=function(t){return arguments.length?(e=+t,n):e},n},t.forceCollide=function(t){var r,n,a=1,c=1;function u(){for(var t,i,u,f,p,d,g,m=r.length,v=0;v<c;++v)for(i=e.quadtree(r,s,l).visitAfter(h),t=0;t<m;++t)u=r[t],d=n[u.index],g=d*d,f=u.x+u.vx,p=u.y+u.vy,i.visit(y);function y(t,e,r,n,i){var s=t.data,l=t.r,c=d+l;if(!s)return e>f+c||n<f-c||r>p+c||i<p-c;if(s.index>u.index){var h=f-s.x-s.vx,m=p-s.y-s.vy,v=h*h+m*m;v<c*c&&(0===h&&(v+=(h=o())*h),0===m&&(v+=(m=o())*m),v=(c-(v=Math.sqrt(v)))/v*a,u.vx+=(h*=v)*(c=(l*=l)/(g+l)),u.vy+=(m*=v)*c,s.vx-=h*(c=1-c),s.vy-=m*c)}}}function h(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function f(){if(r){var e,a,i=r.length;for(n=new Array(i),e=0;e<i;++e)a=r[e],n[a.index]=+t(a,e,r)}}return"function"!=typeof t&&(t=i(null==t?1:+t)),u.initialize=function(t){r=t,f()},u.iterations=function(t){return arguments.length?(c=+t,u):c},u.strength=function(t){return arguments.length?(a=+t,u):a},u.radius=function(e){return arguments.length?(t="function"==typeof e?e:i(+e),f(),u):t},u},t.forceLink=function(t){var e,n,a,s,l,h=c,f=function(t){return 1/Math.min(s[t.source.index],s[t.target.index])},p=i(30),d=1;function g(r){for(var a=0,i=t.length;a<d;++a)for(var s,c,u,h,f,p,g,m=0;m<i;++m)c=(s=t[m]).source,h=(u=s.target).x+u.vx-c.x-c.vx||o(),f=u.y+u.vy-c.y-c.vy||o(),h*=p=((p=Math.sqrt(h*h+f*f))-n[m])/p*r*e[m],f*=p,u.vx-=h*(g=l[m]),u.vy-=f*g,c.vx+=h*(g=1-g),c.vy+=f*g}function m(){if(a){var i,o,c=a.length,f=t.length,p=r.map(a,h);for(i=0,s=new Array(c);i<f;++i)(o=t[i]).index=i,"object"!=typeof o.source&&(o.source=u(p,o.source)),"object"!=typeof o.target&&(o.target=u(p,o.target)),s[o.source.index]=(s[o.source.index]||0)+1,s[o.target.index]=(s[o.target.index]||0)+1;for(i=0,l=new Array(f);i<f;++i)o=t[i],l[i]=s[o.source.index]/(s[o.source.index]+s[o.target.index]);e=new Array(f),v(),n=new Array(f),y()}}function v(){if(a)for(var r=0,n=t.length;r<n;++r)e[r]=+f(t[r],r,t)}function y(){if(a)for(var e=0,r=t.length;e<r;++e)n[e]=+p(t[e],e,t)}return null==t&&(t=[]),g.initialize=function(t){a=t,m()},g.links=function(e){return arguments.length?(t=e,m(),g):t},g.id=function(t){return arguments.length?(h=t,g):h},g.iterations=function(t){return arguments.length?(d=+t,g):d},g.strength=function(t){return arguments.length?(f="function"==typeof t?t:i(+t),v(),g):f},g.distance=function(t){return arguments.length?(p="function"==typeof t?t:i(+t),y(),g):p},g},t.forceManyBody=function(){var t,r,n,a,s=i(-30),l=1,c=1/0,u=.81;function p(a){var i,o=t.length,s=e.quadtree(t,h,f).visitAfter(g);for(n=a,i=0;i<o;++i)r=t[i],s.visit(m)}function d(){if(t){var e,r,n=t.length;for(a=new Array(n),e=0;e<n;++e)r=t[e],a[r.index]=+s(r,e,t)}}function g(t){var e,r,n,i,o,s=0,l=0;if(t.length){for(n=i=o=0;o<4;++o)(e=t[o])&&(r=Math.abs(e.value))&&(s+=e.value,l+=r,n+=r*e.x,i+=r*e.y);t.x=n/l,t.y=i/l}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=a[e.data.index]}while(e=e.next)}t.value=s}function m(t,e,i,s){if(!t.value)return!0;var h=t.x-r.x,f=t.y-r.y,p=s-e,d=h*h+f*f;if(p*p/u<d)return d<c&&(0===h&&(d+=(h=o())*h),0===f&&(d+=(f=o())*f),d<l&&(d=Math.sqrt(l*d)),r.vx+=h*t.value*n/d,r.vy+=f*t.value*n/d),!0;if(!(t.length||d>=c)){(t.data!==r||t.next)&&(0===h&&(d+=(h=o())*h),0===f&&(d+=(f=o())*f),d<l&&(d=Math.sqrt(l*d)));do{t.data!==r&&(p=a[t.data.index]*n/d,r.vx+=h*p,r.vy+=f*p)}while(t=t.next)}}return p.initialize=function(e){t=e,d()},p.strength=function(t){return arguments.length?(s="function"==typeof t?t:i(+t),d(),p):s},p.distanceMin=function(t){return arguments.length?(l=t*t,p):Math.sqrt(l)},p.distanceMax=function(t){return arguments.length?(c=t*t,p):Math.sqrt(c)},p.theta=function(t){return arguments.length?(u=t*t,p):Math.sqrt(u)},p},t.forceRadial=function(t,e,r){var n,a,o,s=i(.1);function l(t){for(var i=0,s=n.length;i<s;++i){var l=n[i],c=l.x-e||1e-6,u=l.y-r||1e-6,h=Math.sqrt(c*c+u*u),f=(o[i]-h)*a[i]*t/h;l.vx+=c*f,l.vy+=u*f}}function c(){if(n){var e,r=n.length;for(a=new Array(r),o=new Array(r),e=0;e<r;++e)o[e]=+t(n[e],e,n),a[e]=isNaN(o[e])?0:+s(n[e],e,n)}}return"function"!=typeof t&&(t=i(+t)),null==e&&(e=0),null==r&&(r=0),l.initialize=function(t){n=t,c()},l.strength=function(t){return arguments.length?(s="function"==typeof t?t:i(+t),c(),l):s},l.radius=function(e){return arguments.length?(t="function"==typeof e?e:i(+e),c(),l):t},l.x=function(t){return arguments.length?(e=+t,l):e},l.y=function(t){return arguments.length?(r=+t,l):r},l},t.forceSimulation=function(t){var e,i=1,o=.001,s=1-Math.pow(o,1/300),l=0,c=.6,u=r.map(),h=a.timer(d),f=n.dispatch("tick","end");function d(){g(),f.call("tick",e),i<o&&(h.stop(),f.call("end",e))}function g(r){var n,a,o=t.length;void 0===r&&(r=1);for(var h=0;h<r;++h)for(i+=(l-i)*s,u.each((function(t){t(i)})),n=0;n<o;++n)null==(a=t[n]).fx?a.x+=a.vx*=c:(a.x=a.fx,a.vx=0),null==a.fy?a.y+=a.vy*=c:(a.y=a.fy,a.vy=0);return e}function m(){for(var e,r=0,n=t.length;r<n;++r){if((e=t[r]).index=r,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var a=10*Math.sqrt(r),i=r*p;e.x=a*Math.cos(i),e.y=a*Math.sin(i)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function v(e){return e.initialize&&e.initialize(t),e}return null==t&&(t=[]),m(),e={tick:g,restart:function(){return h.restart(d),e},stop:function(){return h.stop(),e},nodes:function(r){return arguments.length?(t=r,m(),u.each(v),e):t},alpha:function(t){return arguments.length?(i=+t,e):i},alphaMin:function(t){return arguments.length?(o=+t,e):o},alphaDecay:function(t){return arguments.length?(s=+t,e):+s},alphaTarget:function(t){return arguments.length?(l=+t,e):l},velocityDecay:function(t){return arguments.length?(c=1-t,e):1-c},force:function(t,r){return arguments.length>1?(null==r?u.remove(t):u.set(t,v(r)),e):u.get(t)},find:function(e,r,n){var a,i,o,s,l,c=0,u=t.length;for(null==n?n=1/0:n*=n,c=0;c<u;++c)(o=(a=e-(s=t[c]).x)*a+(i=r-s.y)*i)<n&&(l=s,n=o);return l},on:function(t,r){return arguments.length>1?(f.on(t,r),e):f.on(t)}}},t.forceX=function(t){var e,r,n,a=i(.1);function o(t){for(var a,i=0,o=e.length;i<o;++i)(a=e[i]).vx+=(n[i]-a.x)*r[i]*t}function s(){if(e){var i,o=e.length;for(r=new Array(o),n=new Array(o),i=0;i<o;++i)r[i]=isNaN(n[i]=+t(e[i],i,e))?0:+a(e[i],i,e)}}return"function"!=typeof t&&(t=i(null==t?0:+t)),o.initialize=function(t){e=t,s()},o.strength=function(t){return arguments.length?(a="function"==typeof t?t:i(+t),s(),o):a},o.x=function(e){return arguments.length?(t="function"==typeof e?e:i(+e),s(),o):t},o},t.forceY=function(t){var e,r,n,a=i(.1);function o(t){for(var a,i=0,o=e.length;i<o;++i)(a=e[i]).vy+=(n[i]-a.y)*r[i]*t}function s(){if(e){var i,o=e.length;for(r=new Array(o),n=new Array(o),i=0;i<o;++i)r[i]=isNaN(n[i]=+t(e[i],i,e))?0:+a(e[i],i,e)}}return"function"!=typeof t&&(t=i(null==t?0:+t)),o.initialize=function(t){e=t,s()},o.strength=function(t){return arguments.length?(a="function"==typeof t?t:i(+t),s(),o):a},o.y=function(e){return arguments.length?(t="function"==typeof e?e:i(+e),s(),o):t},o},Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-collection":154,"d3-dispatch":156,"d3-quadtree":161,"d3-timer":163}],158:[function(t,e,r){!function(t,n){"object"==typeof r&&"undefined"!=typeof e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";function e(t,e){return t.parent===e.parent?1:2}function r(t,e){return t+e.x}function n(t,e){return Math.max(t,e.y)}function a(t){var e=0,r=t.children,n=r&&r.length;if(n)for(;--n>=0;)e+=r[n].value;else e=1;t.value=e}function i(t,e){var r,n,a,i,s,u=new c(t),h=+t.value&&(u.value=t.value),f=[u];for(null==e&&(e=o);r=f.pop();)if(h&&(r.value=+r.data.value),(a=e(r.data))&&(s=a.length))for(r.children=new Array(s),i=s-1;i>=0;--i)f.push(n=r.children[i]=new c(a[i])),n.parent=r,n.depth=r.depth+1;return u.eachBefore(l)}function o(t){return t.children}function s(t){t.data=t.data.data}function l(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function c(t){this.data=t,this.depth=this.height=0,this.parent=null}c.prototype=i.prototype={constructor:c,count:function(){return this.eachAfter(a)},each:function(t){var e,r,n,a,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(t(i),r=i.children)for(n=0,a=r.length;n<a;++n)o.push(r[n])}while(o.length);return this},eachAfter:function(t){for(var e,r,n,a=this,i=[a],o=[];a=i.pop();)if(o.push(a),e=a.children)for(r=0,n=e.length;r<n;++r)i.push(e[r]);for(;a=o.pop();)t(a);return this},eachBefore:function(t){for(var e,r,n=this,a=[n];n=a.pop();)if(t(n),e=n.children)for(r=e.length-1;r>=0;--r)a.push(e[r]);return this},sum:function(t){return this.eachAfter((function(e){for(var r=+t(e.data)||0,n=e.children,a=n&&n.length;--a>=0;)r+=n[a].value;e.value=r}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,r=function(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),a=null;t=r.pop(),e=n.pop();for(;t===e;)a=t,t=r.pop(),e=n.pop();return a}(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var a=n.length;t!==r;)n.splice(a,0,t),t=t.parent;return n},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(r){r!==t&&e.push({source:r.parent,target:r})})),e},copy:function(){return i(this).eachBefore(s)}};var u=Array.prototype.slice;function h(t){for(var e,r,n=0,a=(t=function(t){for(var e,r,n=t.length;n;)r=Math.random()*n--|0,e=t[n],t[n]=t[r],t[r]=e;return t}(u.call(t))).length,i=[];n<a;)e=t[n],r&&d(r,e)?++n:(r=m(i=f(i,e)),n=0);return r}function f(t,e){var r,n;if(g(e,t))return[e];for(r=0;r<t.length;++r)if(p(e,t[r])&&g(v(t[r],e),t))return[t[r],e];for(r=0;r<t.length-1;++r)for(n=r+1;n<t.length;++n)if(p(v(t[r],t[n]),e)&&p(v(t[r],e),t[n])&&p(v(t[n],e),t[r])&&g(y(t[r],t[n],e),t))return[t[r],t[n],e];throw new Error}function p(t,e){var r=t.r-e.r,n=e.x-t.x,a=e.y-t.y;return r<0||r*r<n*n+a*a}function d(t,e){var r=t.r-e.r+1e-6,n=e.x-t.x,a=e.y-t.y;return r>0&&r*r>n*n+a*a}function g(t,e){for(var r=0;r<e.length;++r)if(!d(t,e[r]))return!1;return!0}function m(t){switch(t.length){case 1:return{x:(e=t[0]).x,y:e.y,r:e.r};case 2:return v(t[0],t[1]);case 3:return y(t[0],t[1],t[2])}var e}function v(t,e){var r=t.x,n=t.y,a=t.r,i=e.x,o=e.y,s=e.r,l=i-r,c=o-n,u=s-a,h=Math.sqrt(l*l+c*c);return{x:(r+i+l/h*u)/2,y:(n+o+c/h*u)/2,r:(h+a+s)/2}}function y(t,e,r){var n=t.x,a=t.y,i=t.r,o=e.x,s=e.y,l=e.r,c=r.x,u=r.y,h=r.r,f=n-o,p=n-c,d=a-s,g=a-u,m=l-i,v=h-i,y=n*n+a*a-i*i,x=y-o*o-s*s+l*l,b=y-c*c-u*u+h*h,_=p*d-f*g,w=(d*b-g*x)/(2*_)-n,T=(g*m-d*v)/_,k=(p*x-f*b)/(2*_)-a,A=(f*v-p*m)/_,M=T*T+A*A-1,S=2*(i+w*T+k*A),E=w*w+k*k-i*i,C=-(M?(S+Math.sqrt(S*S-4*M*E))/(2*M):E/S);return{x:n+w+T*C,y:a+k+A*C,r:C}}function x(t,e,r){var n,a,i,o,s=t.x-e.x,l=t.y-e.y,c=s*s+l*l;c?(a=e.r+r.r,a*=a,o=t.r+r.r,a>(o*=o)?(n=(c+o-a)/(2*c),i=Math.sqrt(Math.max(0,o/c-n*n)),r.x=t.x-n*s-i*l,r.y=t.y-n*l+i*s):(n=(c+a-o)/(2*c),i=Math.sqrt(Math.max(0,a/c-n*n)),r.x=e.x+n*s-i*l,r.y=e.y+n*l+i*s)):(r.x=e.x+r.r,r.y=e.y)}function b(t,e){var r=t.r+e.r-1e-6,n=e.x-t.x,a=e.y-t.y;return r>0&&r*r>n*n+a*a}function _(t){var e=t._,r=t.next._,n=e.r+r.r,a=(e.x*r.r+r.x*e.r)/n,i=(e.y*r.r+r.y*e.r)/n;return a*a+i*i}function w(t){this._=t,this.next=null,this.previous=null}function T(t){if(!(a=t.length))return 0;var e,r,n,a,i,o,s,l,c,u,f;if((e=t[0]).x=0,e.y=0,!(a>1))return e.r;if(r=t[1],e.x=-r.r,r.x=e.r,r.y=0,!(a>2))return e.r+r.r;x(r,e,n=t[2]),e=new w(e),r=new w(r),n=new w(n),e.next=n.previous=r,r.next=e.previous=n,n.next=r.previous=e;t:for(s=3;s<a;++s){x(e._,r._,n=t[s]),n=new w(n),l=r.next,c=e.previous,u=r._.r,f=e._.r;do{if(u<=f){if(b(l._,n._)){r=l,e.next=r,r.previous=e,--s;continue t}u+=l._.r,l=l.next}else{if(b(c._,n._)){(e=c).next=r,r.previous=e,--s;continue t}f+=c._.r,c=c.previous}}while(l!==c.next);for(n.previous=e,n.next=r,e.next=r.previous=r=n,i=_(e);(n=n.next)!==r;)(o=_(n))<i&&(e=n,i=o);r=e.next}for(e=[r._],n=r;(n=n.next)!==r;)e.push(n._);for(n=h(e),s=0;s<a;++s)(e=t[s]).x-=n.x,e.y-=n.y;return n.r}function k(t){return null==t?null:A(t)}function A(t){if("function"!=typeof t)throw new Error;return t}function M(){return 0}function S(t){return function(){return t}}function E(t){return Math.sqrt(t.value)}function C(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function L(t,e){return function(r){if(n=r.children){var n,a,i,o=n.length,s=t(r)*e||0;if(s)for(a=0;a<o;++a)n[a].r+=s;if(i=T(n),s)for(a=0;a<o;++a)n[a].r-=s;r.r=i+s}}}function P(t){return function(e){var r=e.parent;e.r*=t,r&&(e.x=r.x+t*e.x,e.y=r.y+t*e.y)}}function I(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function z(t,e,r,n,a){for(var i,o=t.children,s=-1,l=o.length,c=t.value&&(n-e)/t.value;++s<l;)(i=o[s]).y0=r,i.y1=a,i.x0=e,i.x1=e+=i.value*c}var O={depth:-1},D={};function R(t){return t.id}function F(t){return t.parentId}function B(t,e){return t.parent===e.parent?1:2}function N(t){var e=t.children;return e?e[0]:t.t}function j(t){var e=t.children;return e?e[e.length-1]:t.t}function V(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 U(t,e,r){return t.a.parent===e.parent?t.a:r}function q(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function H(t,e,r,n,a){for(var i,o=t.children,s=-1,l=o.length,c=t.value&&(a-r)/t.value;++s<l;)(i=o[s]).x0=e,i.x1=n,i.y0=r,i.y1=r+=i.value*c}q.prototype=Object.create(c.prototype);var G=(1+Math.sqrt(5))/2;function Y(t,e,r,n,a,i){for(var o,s,l,c,u,h,f,p,d,g,m,v=[],y=e.children,x=0,b=0,_=y.length,w=e.value;x<_;){l=a-r,c=i-n;do{u=y[b++].value}while(!u&&b<_);for(h=f=u,m=u*u*(g=Math.max(c/l,l/c)/(w*t)),d=Math.max(f/m,m/h);b<_;++b){if(u+=s=y[b].value,s<h&&(h=s),s>f&&(f=s),m=u*u*g,(p=Math.max(f/m,m/h))>d){u-=s;break}d=p}v.push(o={value:u,dice:l<c,children:y.slice(x,b)}),o.dice?z(o,r,n,a,w?n+=c*u/w:i):H(o,r,n,w?r+=l*u/w:a,i),w-=u,x=b}return v}var W=function t(e){function r(t,r,n,a,i){Y(e,t,r,n,a,i)}return r.ratio=function(e){return t((e=+e)>1?e:1)},r}(G);var Z=function t(e){function r(t,r,n,a,i){if((o=t._squarify)&&o.ratio===e)for(var o,s,l,c,u,h=-1,f=o.length,p=t.value;++h<f;){for(l=(s=o[h]).children,c=s.value=0,u=l.length;c<u;++c)s.value+=l[c].value;s.dice?z(s,r,n,a,n+=(i-n)*s.value/p):H(s,r,n,r+=(a-r)*s.value/p,i),p-=s.value}else t._squarify=o=Y(e,t,r,n,a,i),o.ratio=e}return r.ratio=function(e){return t((e=+e)>1?e:1)},r}(G);t.cluster=function(){var t=e,a=1,i=1,o=!1;function s(e){var s,l=0;e.eachAfter((function(e){var a=e.children;a?(e.x=function(t){return t.reduce(r,0)/t.length}(a),e.y=function(t){return 1+t.reduce(n,0)}(a)):(e.x=s?l+=t(e,s):0,e.y=0,s=e)}));var c=function(t){for(var e;e=t.children;)t=e[0];return t}(e),u=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(e),h=c.x-t(c,u)/2,f=u.x+t(u,c)/2;return e.eachAfter(o?function(t){t.x=(t.x-e.x)*a,t.y=(e.y-t.y)*i}:function(t){t.x=(t.x-h)/(f-h)*a,t.y=(1-(e.y?t.y/e.y:1))*i})}return s.separation=function(e){return arguments.length?(t=e,s):t},s.size=function(t){return arguments.length?(o=!1,a=+t[0],i=+t[1],s):o?null:[a,i]},s.nodeSize=function(t){return arguments.length?(o=!0,a=+t[0],i=+t[1],s):o?[a,i]:null},s},t.hierarchy=i,t.pack=function(){var t=null,e=1,r=1,n=M;function a(a){return a.x=e/2,a.y=r/2,t?a.eachBefore(C(t)).eachAfter(L(n,.5)).eachBefore(P(1)):a.eachBefore(C(E)).eachAfter(L(M,1)).eachAfter(L(n,a.r/Math.min(e,r))).eachBefore(P(Math.min(e,r)/(2*a.r))),a}return a.radius=function(e){return arguments.length?(t=k(e),a):t},a.size=function(t){return arguments.length?(e=+t[0],r=+t[1],a):[e,r]},a.padding=function(t){return arguments.length?(n="function"==typeof t?t:S(+t),a):n},a},t.packEnclose=h,t.packSiblings=function(t){return T(t),t},t.partition=function(){var t=1,e=1,r=0,n=!1;function a(a){var i=a.height+1;return a.x0=a.y0=r,a.x1=t,a.y1=e/i,a.eachBefore(function(t,e){return function(n){n.children&&z(n,n.x0,t*(n.depth+1)/e,n.x1,t*(n.depth+2)/e);var a=n.x0,i=n.y0,o=n.x1-r,s=n.y1-r;o<a&&(a=o=(a+o)/2),s<i&&(i=s=(i+s)/2),n.x0=a,n.y0=i,n.x1=o,n.y1=s}}(e,i)),n&&a.eachBefore(I),a}return a.round=function(t){return arguments.length?(n=!!t,a):n},a.size=function(r){return arguments.length?(t=+r[0],e=+r[1],a):[t,e]},a.padding=function(t){return arguments.length?(r=+t,a):r},a},t.stratify=function(){var t=R,e=F;function r(r){var n,a,i,o,s,u,h,f=r.length,p=new Array(f),d={};for(a=0;a<f;++a)n=r[a],s=p[a]=new c(n),null!=(u=t(n,a,r))&&(u+="")&&(d[h="$"+(s.id=u)]=h in d?D:s);for(a=0;a<f;++a)if(s=p[a],null!=(u=e(r[a],a,r))&&(u+="")){if(!(o=d["$"+u]))throw new Error("missing: "+u);if(o===D)throw new Error("ambiguous: "+u);o.children?o.children.push(s):o.children=[s],s.parent=o}else{if(i)throw new Error("multiple roots");i=s}if(!i)throw new Error("no root");if(i.parent=O,i.eachBefore((function(t){t.depth=t.parent.depth+1,--f})).eachBefore(l),i.parent=null,f>0)throw new Error("cycle");return i}return r.id=function(e){return arguments.length?(t=A(e),r):t},r.parentId=function(t){return arguments.length?(e=A(t),r):e},r},t.tree=function(){var t=B,e=1,r=1,n=null;function a(a){var l=function(t){for(var e,r,n,a,i,o=new q(t,0),s=[o];e=s.pop();)if(n=e._.children)for(e.children=new Array(i=n.length),a=i-1;a>=0;--a)s.push(r=e.children[a]=new q(n[a],a)),r.parent=e;return(o.parent=new q(null,0)).children=[o],o}(a);if(l.eachAfter(i),l.parent.m=-l.z,l.eachBefore(o),n)a.eachBefore(s);else{var c=a,u=a,h=a;a.eachBefore((function(t){t.x<c.x&&(c=t),t.x>u.x&&(u=t),t.depth>h.depth&&(h=t)}));var f=c===u?1:t(c,u)/2,p=f-c.x,d=e/(u.x+f+p),g=r/(h.depth||1);a.eachBefore((function(t){t.x=(t.x+p)*d,t.y=t.depth*g}))}return a}function i(e){var r=e.children,n=e.parent.children,a=e.i?n[e.i-1]:null;if(r){!function(t){for(var e,r=0,n=0,a=t.children,i=a.length;--i>=0;)(e=a[i]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(e);var i=(r[0].z+r[r.length-1].z)/2;a?(e.z=a.z+t(e._,a._),e.m=e.z-i):e.z=i}else a&&(e.z=a.z+t(e._,a._));e.parent.A=function(e,r,n){if(r){for(var a,i=e,o=e,s=r,l=i.parent.children[0],c=i.m,u=o.m,h=s.m,f=l.m;s=j(s),i=N(i),s&&i;)l=N(l),(o=j(o)).a=e,(a=s.z+h-i.z-c+t(s._,i._))>0&&(V(U(s,e,n),e,a),c+=a,u+=a),h+=s.m,c+=i.m,f+=l.m,u+=o.m;s&&!j(o)&&(o.t=s,o.m+=h-u),i&&!N(l)&&(l.t=i,l.m+=c-f,n=e)}return n}(e,a,e.parent.A||n[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*r}return a.separation=function(e){return arguments.length?(t=e,a):t},a.size=function(t){return arguments.length?(n=!1,e=+t[0],r=+t[1],a):n?null:[e,r]},a.nodeSize=function(t){return arguments.length?(n=!0,e=+t[0],r=+t[1],a):n?[e,r]:null},a},t.treemap=function(){var t=W,e=!1,r=1,n=1,a=[0],i=M,o=M,s=M,l=M,c=M;function u(t){return t.x0=t.y0=0,t.x1=r,t.y1=n,t.eachBefore(h),a=[0],e&&t.eachBefore(I),t}function h(e){var r=a[e.depth],n=e.x0+r,u=e.y0+r,h=e.x1-r,f=e.y1-r;h<n&&(n=h=(n+h)/2),f<u&&(u=f=(u+f)/2),e.x0=n,e.y0=u,e.x1=h,e.y1=f,e.children&&(r=a[e.depth+1]=i(e)/2,n+=c(e)-r,u+=o(e)-r,(h-=s(e)-r)<n&&(n=h=(n+h)/2),(f-=l(e)-r)<u&&(u=f=(u+f)/2),t(e,n,u,h,f))}return u.round=function(t){return arguments.length?(e=!!t,u):e},u.size=function(t){return arguments.length?(r=+t[0],n=+t[1],u):[r,n]},u.tile=function(e){return arguments.length?(t=A(e),u):t},u.padding=function(t){return arguments.length?u.paddingInner(t).paddingOuter(t):u.paddingInner()},u.paddingInner=function(t){return arguments.length?(i="function"==typeof t?t:S(+t),u):i},u.paddingOuter=function(t){return arguments.length?u.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):u.paddingTop()},u.paddingTop=function(t){return arguments.length?(o="function"==typeof t?t:S(+t),u):o},u.paddingRight=function(t){return arguments.length?(s="function"==typeof t?t:S(+t),u):s},u.paddingBottom=function(t){return arguments.length?(l="function"==typeof t?t:S(+t),u):l},u.paddingLeft=function(t){return arguments.length?(c="function"==typeof t?t:S(+t),u):c},u},t.treemapBinary=function(t,e,r,n,a){var i,o,s=t.children,l=s.length,c=new Array(l+1);for(c[0]=o=i=0;i<l;++i)c[i+1]=o+=s[i].value;!function t(e,r,n,a,i,o,l){if(e>=r-1){var u=s[e];return u.x0=a,u.y0=i,u.x1=o,void(u.y1=l)}var h=c[e],f=n/2+h,p=e+1,d=r-1;for(;p<d;){var g=p+d>>>1;c[g]<f?p=g+1:d=g}f-c[p-1]<c[p]-f&&e+1<p&&--p;var m=c[p]-h,v=n-m;if(o-a>l-i){var y=(a*v+o*m)/n;t(e,p,m,a,i,y,l),t(p,r,v,y,i,o,l)}else{var x=(i*v+l*m)/n;t(e,p,m,a,i,o,x),t(p,r,v,a,x,o,l)}}(0,l,t.value,e,r,n,a)},t.treemapDice=z,t.treemapResquarify=Z,t.treemapSlice=H,t.treemapSliceDice=function(t,e,r,n,a){(1&t.depth?H:z)(t,e,r,n,a)},t.treemapSquarify=W,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],159:[function(t,e,r){!function(n,a){"object"==typeof r&&"undefined"!=typeof e?a(r,t("d3-color")):a((n=n||self).d3=n.d3||{},n.d3)}(this,(function(t,e){"use strict";function r(t,e,r,n,a){var i=t*t,o=i*t;return((1-3*t+3*i-o)*e+(4-6*i+3*o)*r+(1+3*t+3*i-3*o)*n+o*a)/6}function n(t){var e=t.length-1;return function(n){var a=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[a],o=t[a+1],s=a>0?t[a-1]:2*i-o,l=a<e-1?t[a+2]:2*o-i;return r((n-a/e)*e,s,i,o,l)}}function a(t){var e=t.length;return function(n){var a=Math.floor(((n%=1)<0?++n:n)*e),i=t[(a+e-1)%e],o=t[a%e],s=t[(a+1)%e],l=t[(a+2)%e];return r((n-a/e)*e,i,o,s,l)}}function i(t){return function(){return t}}function o(t,e){return function(r){return t+r*e}}function s(t,e){var r=e-t;return r?o(t,r>180||r<-180?r-360*Math.round(r/360):r):i(isNaN(t)?e:t)}function l(t){return 1==(t=+t)?c:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):i(isNaN(e)?r:e)}}function c(t,e){var r=e-t;return r?o(t,r):i(isNaN(t)?e:t)}var u=function t(r){var n=l(r);function a(t,r){var a=n((t=e.rgb(t)).r,(r=e.rgb(r)).r),i=n(t.g,r.g),o=n(t.b,r.b),s=c(t.opacity,r.opacity);return function(e){return t.r=a(e),t.g=i(e),t.b=o(e),t.opacity=s(e),t+""}}return a.gamma=t,a}(1);function h(t){return function(r){var n,a,i=r.length,o=new Array(i),s=new Array(i),l=new Array(i);for(n=0;n<i;++n)a=e.rgb(r[n]),o[n]=a.r||0,s[n]=a.g||0,l[n]=a.b||0;return o=t(o),s=t(s),l=t(l),a.opacity=1,function(t){return a.r=o(t),a.g=s(t),a.b=l(t),a+""}}}var f=h(n),p=h(a);function d(t,e){e||(e=[]);var r,n=t?Math.min(e.length,t.length):0,a=e.slice();return function(i){for(r=0;r<n;++r)a[r]=t[r]*(1-i)+e[r]*i;return a}}function g(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function m(t,e){var r,n=e?e.length:0,a=t?Math.min(n,t.length):0,i=new Array(a),o=new Array(n);for(r=0;r<a;++r)i[r]=T(t[r],e[r]);for(;r<n;++r)o[r]=e[r];return function(t){for(r=0;r<a;++r)o[r]=i[r](t);return o}}function v(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function y(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function x(t,e){var r,n={},a={};for(r in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)r in t?n[r]=T(t[r],e[r]):a[r]=e[r];return function(t){for(r in n)a[r]=n[r](t);return a}}var b=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_=new RegExp(b.source,"g");function w(t,e){var r,n,a,i=b.lastIndex=_.lastIndex=0,o=-1,s=[],l=[];for(t+="",e+="";(r=b.exec(t))&&(n=_.exec(e));)(a=n.index)>i&&(a=e.slice(i,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:y(r,n)})),i=_.lastIndex;return i<e.length&&(a=e.slice(i),s[o]?s[o]+=a:s[++o]=a),s.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var r,n=0;n<e;++n)s[(r=l[n]).i]=r.x(t);return s.join("")})}function T(t,r){var n,a=typeof r;return null==r||"boolean"===a?i(r):("number"===a?y:"string"===a?(n=e.color(r))?(r=n,u):w:r instanceof e.color?u:r instanceof Date?v:g(r)?d:Array.isArray(r)?m:"function"!=typeof r.valueOf&&"function"!=typeof r.toString||isNaN(r)?x:y)(t,r)}var k,A,M,S,E=180/Math.PI,C={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function L(t,e,r,n,a,i){var o,s,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*r+e*n)&&(r-=t*l,n-=e*l),(s=Math.sqrt(r*r+n*n))&&(r/=s,n/=s,l/=s),t*n<e*r&&(t=-t,e=-e,l=-l,o=-o),{translateX:a,translateY:i,rotate:Math.atan2(e,t)*E,skewX:Math.atan(l)*E,scaleX:o,scaleY:s}}function P(t,e,r,n){function a(t){return t.length?t.pop()+" ":""}return function(i,o){var s=[],l=[];return i=t(i),o=t(o),function(t,n,a,i,o,s){if(t!==a||n!==i){var l=o.push("translate(",null,e,null,r);s.push({i:l-4,x:y(t,a)},{i:l-2,x:y(n,i)})}else(a||i)&&o.push("translate("+a+e+i+r)}(i.translateX,i.translateY,o.translateX,o.translateY,s,l),function(t,e,r,i){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),i.push({i:r.push(a(r)+"rotate(",null,n)-2,x:y(t,e)})):e&&r.push(a(r)+"rotate("+e+n)}(i.rotate,o.rotate,s,l),function(t,e,r,i){t!==e?i.push({i:r.push(a(r)+"skewX(",null,n)-2,x:y(t,e)}):e&&r.push(a(r)+"skewX("+e+n)}(i.skewX,o.skewX,s,l),function(t,e,r,n,i,o){if(t!==r||e!==n){var s=i.push(a(i)+"scale(",null,",",null,")");o.push({i:s-4,x:y(t,r)},{i:s-2,x:y(e,n)})}else 1===r&&1===n||i.push(a(i)+"scale("+r+","+n+")")}(i.scaleX,i.scaleY,o.scaleX,o.scaleY,s,l),i=o=null,function(t){for(var e,r=-1,n=l.length;++r<n;)s[(e=l[r]).i]=e.x(t);return s.join("")}}}var I=P((function(t){return"none"===t?C:(k||(k=document.createElement("DIV"),A=document.documentElement,M=document.defaultView),k.style.transform=t,t=M.getComputedStyle(A.appendChild(k),null).getPropertyValue("transform"),A.removeChild(k),L(+(t=t.slice(7,-1).split(","))[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),z=P((function(t){return null==t?C:(S||(S=document.createElementNS("http://www.w3.org/2000/svg","g")),S.setAttribute("transform",t),(t=S.transform.baseVal.consolidate())?L((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):C)}),", ",")",")"),O=Math.SQRT2;function D(t){return((t=Math.exp(t))+1/t)/2}function R(t){return function(r,n){var a=t((r=e.hsl(r)).h,(n=e.hsl(n)).h),i=c(r.s,n.s),o=c(r.l,n.l),s=c(r.opacity,n.opacity);return function(t){return r.h=a(t),r.s=i(t),r.l=o(t),r.opacity=s(t),r+""}}}var F=R(s),B=R(c);function N(t){return function(r,n){var a=t((r=e.hcl(r)).h,(n=e.hcl(n)).h),i=c(r.c,n.c),o=c(r.l,n.l),s=c(r.opacity,n.opacity);return function(t){return r.h=a(t),r.c=i(t),r.l=o(t),r.opacity=s(t),r+""}}}var j=N(s),V=N(c);function U(t){return function r(n){function a(r,a){var i=t((r=e.cubehelix(r)).h,(a=e.cubehelix(a)).h),o=c(r.s,a.s),s=c(r.l,a.l),l=c(r.opacity,a.opacity);return function(t){return r.h=i(t),r.s=o(t),r.l=s(Math.pow(t,n)),r.opacity=l(t),r+""}}return n=+n,a.gamma=r,a}(1)}var q=U(s),H=U(c);t.interpolate=T,t.interpolateArray=function(t,e){return(g(e)?d:m)(t,e)},t.interpolateBasis=n,t.interpolateBasisClosed=a,t.interpolateCubehelix=q,t.interpolateCubehelixLong=H,t.interpolateDate=v,t.interpolateDiscrete=function(t){var e=t.length;return function(r){return t[Math.max(0,Math.min(e-1,Math.floor(r*e)))]}},t.interpolateHcl=j,t.interpolateHclLong=V,t.interpolateHsl=F,t.interpolateHslLong=B,t.interpolateHue=function(t,e){var r=s(+t,+e);return function(t){var e=r(t);return e-360*Math.floor(e/360)}},t.interpolateLab=function(t,r){var n=c((t=e.lab(t)).l,(r=e.lab(r)).l),a=c(t.a,r.a),i=c(t.b,r.b),o=c(t.opacity,r.opacity);return function(e){return t.l=n(e),t.a=a(e),t.b=i(e),t.opacity=o(e),t+""}},t.interpolateNumber=y,t.interpolateNumberArray=d,t.interpolateObject=x,t.interpolateRgb=u,t.interpolateRgbBasis=f,t.interpolateRgbBasisClosed=p,t.interpolateRound=function(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}},t.interpolateString=w,t.interpolateTransformCss=I,t.interpolateTransformSvg=z,t.interpolateZoom=function(t,e){var r,n,a=t[0],i=t[1],o=t[2],s=e[0],l=e[1],c=e[2],u=s-a,h=l-i,f=u*u+h*h;if(f<1e-12)n=Math.log(c/o)/O,r=function(t){return[a+t*u,i+t*h,o*Math.exp(O*t*n)]};else{var p=Math.sqrt(f),d=(c*c-o*o+4*f)/(2*o*2*p),g=(c*c-o*o-4*f)/(2*c*2*p),m=Math.log(Math.sqrt(d*d+1)-d),v=Math.log(Math.sqrt(g*g+1)-g);n=(v-m)/O,r=function(t){var e,r=t*n,s=D(m),l=o/(2*p)*(s*(e=O*r+m,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(m));return[a+l*u,i+l*h,o*s/D(O*r+m)]}}return r.duration=1e3*n,r},t.piecewise=function(t,e){for(var r=0,n=e.length-1,a=e[0],i=new Array(n<0?0:n);r<n;)i[r]=t(a,a=e[++r]);return function(t){var e=Math.max(0,Math.min(n-1,Math.floor(t*=n)));return i[e](t-e)}},t.quantize=function(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t(n/(e-1));return r},Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-color":155}],160:[function(t,e,r){!function(t,n){"object"==typeof r&&"undefined"!=typeof e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";var e=Math.PI,r=2*e,n=r-1e-6;function a(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function i(){return new a}a.prototype=i.prototype={constructor:a,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,r,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(t,e,r,n,a,i){this._+="C"+ +t+","+ +e+","+ +r+","+ +n+","+(this._x1=+a)+","+(this._y1=+i)},arcTo:function(t,r,n,a,i){t=+t,r=+r,n=+n,a=+a,i=+i;var o=this._x1,s=this._y1,l=n-t,c=a-r,u=o-t,h=s-r,f=u*u+h*h;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=r);else if(f>1e-6)if(Math.abs(h*l-c*u)>1e-6&&i){var p=n-o,d=a-s,g=l*l+c*c,m=p*p+d*d,v=Math.sqrt(g),y=Math.sqrt(f),x=i*Math.tan((e-Math.acos((g+f-m)/(2*v*y)))/2),b=x/y,_=x/v;Math.abs(b-1)>1e-6&&(this._+="L"+(t+b*u)+","+(r+b*h)),this._+="A"+i+","+i+",0,0,"+ +(h*p>u*d)+","+(this._x1=t+_*l)+","+(this._y1=r+_*c)}else this._+="L"+(this._x1=t)+","+(this._y1=r);else;},arc:function(t,a,i,o,s,l){t=+t,a=+a,l=!!l;var c=(i=+i)*Math.cos(o),u=i*Math.sin(o),h=t+c,f=a+u,p=1^l,d=l?o-s:s-o;if(i<0)throw new Error("negative radius: "+i);null===this._x1?this._+="M"+h+","+f:(Math.abs(this._x1-h)>1e-6||Math.abs(this._y1-f)>1e-6)&&(this._+="L"+h+","+f),i&&(d<0&&(d=d%r+r),d>n?this._+="A"+i+","+i+",0,1,"+p+","+(t-c)+","+(a-u)+"A"+i+","+i+",0,1,"+p+","+(this._x1=h)+","+(this._y1=f):d>1e-6&&(this._+="A"+i+","+i+",0,"+ +(d>=e)+","+p+","+(this._x1=t+i*Math.cos(s))+","+(this._y1=a+i*Math.sin(s))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}},t.path=i,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],161:[function(t,e,r){!function(t,n){"object"==typeof r&&"undefined"!=typeof e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";function e(t,e,r,n){if(isNaN(e)||isNaN(r))return t;var a,i,o,s,l,c,u,h,f,p=t._root,d={data:n},g=t._x0,m=t._y0,v=t._x1,y=t._y1;if(!p)return t._root=d,t;for(;p.length;)if((c=e>=(i=(g+v)/2))?g=i:v=i,(u=r>=(o=(m+y)/2))?m=o:y=o,a=p,!(p=p[h=u<<1|c]))return a[h]=d,t;if(s=+t._x.call(null,p.data),l=+t._y.call(null,p.data),e===s&&r===l)return d.next=p,a?a[h]=d:t._root=d,t;do{a=a?a[h]=new Array(4):t._root=new Array(4),(c=e>=(i=(g+v)/2))?g=i:v=i,(u=r>=(o=(m+y)/2))?m=o:y=o}while((h=u<<1|c)==(f=(l>=o)<<1|s>=i));return a[f]=p,a[h]=d,t}function r(t,e,r,n,a){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=a}function n(t){return t[0]}function a(t){return t[1]}function i(t,e,r){var i=new o(null==e?n:e,null==r?a:r,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function o(t,e,r,n,a,i){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=a,this._y1=i,this._root=void 0}function s(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var l=i.prototype=o.prototype;l.copy=function(){var t,e,r=new o(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=s(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var a=0;a<4;++a)(e=n.source[a])&&(e.length?t.push({source:e,target:n.target[a]=new Array(4)}):n.target[a]=s(e));return r},l.add=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},l.addAll=function(t){var r,n,a,i,o=t.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,h=-1/0,f=-1/0;for(n=0;n<o;++n)isNaN(a=+this._x.call(null,r=t[n]))||isNaN(i=+this._y.call(null,r))||(s[n]=a,l[n]=i,a<c&&(c=a),a>h&&(h=a),i<u&&(u=i),i>f&&(f=i));if(c>h||u>f)return this;for(this.cover(c,u).cover(h,f),n=0;n<o;++n)e(this,s[n],l[n],t[n]);return this},l.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var r=this._x0,n=this._y0,a=this._x1,i=this._y1;if(isNaN(r))a=(r=Math.floor(t))+1,i=(n=Math.floor(e))+1;else{for(var o,s,l=a-r,c=this._root;r>t||t>=a||n>e||e>=i;)switch(s=(e<n)<<1|t<r,(o=new Array(4))[s]=c,c=o,l*=2,s){case 0:a=r+l,i=n+l;break;case 1:r=a-l,i=n+l;break;case 2:a=r+l,n=i-l;break;case 3:r=a-l,n=i-l}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=a,this._y1=i,this},l.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},l.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},l.find=function(t,e,n){var a,i,o,s,l,c,u,h=this._x0,f=this._y0,p=this._x1,d=this._y1,g=[],m=this._root;for(m&&g.push(new r(m,h,f,p,d)),null==n?n=1/0:(h=t-n,f=e-n,p=t+n,d=e+n,n*=n);c=g.pop();)if(!(!(m=c.node)||(i=c.x0)>p||(o=c.y0)>d||(s=c.x1)<h||(l=c.y1)<f))if(m.length){var v=(i+s)/2,y=(o+l)/2;g.push(new r(m[3],v,y,s,l),new r(m[2],i,y,v,l),new r(m[1],v,o,s,y),new r(m[0],i,o,v,y)),(u=(e>=y)<<1|t>=v)&&(c=g[g.length-1],g[g.length-1]=g[g.length-1-u],g[g.length-1-u]=c)}else{var x=t-+this._x.call(null,m.data),b=e-+this._y.call(null,m.data),_=x*x+b*b;if(_<n){var w=Math.sqrt(n=_);h=t-w,f=e-w,p=t+w,d=e+w,a=m.data}}return a},l.remove=function(t){if(isNaN(i=+this._x.call(null,t))||isNaN(o=+this._y.call(null,t)))return this;var e,r,n,a,i,o,s,l,c,u,h,f,p=this._root,d=this._x0,g=this._y0,m=this._x1,v=this._y1;if(!p)return this;if(p.length)for(;;){if((c=i>=(s=(d+m)/2))?d=s:m=s,(u=o>=(l=(g+v)/2))?g=l:v=l,e=p,!(p=p[h=u<<1|c]))return this;if(!p.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(r=e,f=h)}for(;p.data!==t;)if(n=p,!(p=p.next))return this;return(a=p.next)&&delete p.next,n?(a?n.next=a:delete n.next,this):e?(a?e[h]=a:delete e[h],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(r?r[f]=p:this._root=p),this):(this._root=a,this)},l.removeAll=function(t){for(var e=0,r=t.length;e<r;++e)this.remove(t[e]);return this},l.root=function(){return this._root},l.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},l.visit=function(t){var e,n,a,i,o,s,l=[],c=this._root;for(c&&l.push(new r(c,this._x0,this._y0,this._x1,this._y1));e=l.pop();)if(!t(c=e.node,a=e.x0,i=e.y0,o=e.x1,s=e.y1)&&c.length){var u=(a+o)/2,h=(i+s)/2;(n=c[3])&&l.push(new r(n,u,h,o,s)),(n=c[2])&&l.push(new r(n,a,h,u,s)),(n=c[1])&&l.push(new r(n,u,i,o,h)),(n=c[0])&&l.push(new r(n,a,i,u,h))}return this},l.visitAfter=function(t){var e,n=[],a=[];for(this._root&&n.push(new r(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,s=e.x0,l=e.y0,c=e.x1,u=e.y1,h=(s+c)/2,f=(l+u)/2;(o=i[0])&&n.push(new r(o,s,l,h,f)),(o=i[1])&&n.push(new r(o,h,l,c,f)),(o=i[2])&&n.push(new r(o,s,f,h,u)),(o=i[3])&&n.push(new r(o,h,f,c,u))}a.push(e)}for(;e=a.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},l.x=function(t){return arguments.length?(this._x=t,this):this._x},l.y=function(t){return arguments.length?(this._y=t,this):this._y},t.quadtree=i,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],162:[function(t,e,r){!function(n,a){"object"==typeof r&&"undefined"!=typeof e?a(r,t("d3-path")):a((n=n||self).d3=n.d3||{},n.d3)}(this,(function(t,e){"use strict";function r(t){return function(){return t}}var n=Math.abs,a=Math.atan2,i=Math.cos,o=Math.max,s=Math.min,l=Math.sin,c=Math.sqrt,u=Math.PI,h=u/2,f=2*u;function p(t){return t>1?0:t<-1?u:Math.acos(t)}function d(t){return t>=1?h:t<=-1?-h:Math.asin(t)}function g(t){return t.innerRadius}function m(t){return t.outerRadius}function v(t){return t.startAngle}function y(t){return t.endAngle}function x(t){return t&&t.padAngle}function b(t,e,r,n,a,i,o,s){var l=r-t,c=n-e,u=o-a,h=s-i,f=h*l-u*c;if(!(f*f<1e-12))return[t+(f=(u*(e-i)-h*(t-a))/f)*l,e+f*c]}function _(t,e,r,n,a,i,s){var l=t-r,u=e-n,h=(s?i:-i)/c(l*l+u*u),f=h*u,p=-h*l,d=t+f,g=e+p,m=r+f,v=n+p,y=(d+m)/2,x=(g+v)/2,b=m-d,_=v-g,w=b*b+_*_,T=a-i,k=d*v-m*g,A=(_<0?-1:1)*c(o(0,T*T*w-k*k)),M=(k*_-b*A)/w,S=(-k*b-_*A)/w,E=(k*_+b*A)/w,C=(-k*b+_*A)/w,L=M-y,P=S-x,I=E-y,z=C-x;return L*L+P*P>I*I+z*z&&(M=E,S=C),{cx:M,cy:S,x01:-f,y01:-p,x11:M*(a/T-1),y11:S*(a/T-1)}}function w(t){this._context=t}function T(t){return new w(t)}function k(t){return t[0]}function A(t){return t[1]}function M(){var t=k,n=A,a=r(!0),i=null,o=T,s=null;function l(r){var l,c,u,h=r.length,f=!1;for(null==i&&(s=o(u=e.path())),l=0;l<=h;++l)!(l<h&&a(c=r[l],l,r))===f&&((f=!f)?s.lineStart():s.lineEnd()),f&&s.point(+t(c,l,r),+n(c,l,r));if(u)return s=null,u+""||null}return l.x=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),l):t},l.y=function(t){return arguments.length?(n="function"==typeof t?t:r(+t),l):n},l.defined=function(t){return arguments.length?(a="function"==typeof t?t:r(!!t),l):a},l.curve=function(t){return arguments.length?(o=t,null!=i&&(s=o(i)),l):o},l.context=function(t){return arguments.length?(null==t?i=s=null:s=o(i=t),l):i},l}function S(){var t=k,n=null,a=r(0),i=A,o=r(!0),s=null,l=T,c=null;function u(r){var u,h,f,p,d,g=r.length,m=!1,v=new Array(g),y=new Array(g);for(null==s&&(c=l(d=e.path())),u=0;u<=g;++u){if(!(u<g&&o(p=r[u],u,r))===m)if(m=!m)h=u,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),f=u-1;f>=h;--f)c.point(v[f],y[f]);c.lineEnd(),c.areaEnd()}m&&(v[u]=+t(p,u,r),y[u]=+a(p,u,r),c.point(n?+n(p,u,r):v[u],i?+i(p,u,r):y[u]))}if(d)return c=null,d+""||null}function h(){return M().defined(o).curve(l).context(s)}return u.x=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),n=null,u):t},u.x0=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),u):t},u.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:r(+t),u):n},u.y=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),i=null,u):a},u.y0=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),u):a},u.y1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:r(+t),u):i},u.lineX0=u.lineY0=function(){return h().x(t).y(a)},u.lineY1=function(){return h().x(t).y(i)},u.lineX1=function(){return h().x(n).y(a)},u.defined=function(t){return arguments.length?(o="function"==typeof t?t:r(!!t),u):o},u.curve=function(t){return arguments.length?(l=t,null!=s&&(c=l(s)),u):l},u.context=function(t){return arguments.length?(null==t?s=c=null:c=l(s=t),u):s},u}function E(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function C(t){return t}w.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var L=I(T);function P(t){this._curve=t}function I(t){function e(e){return new P(t(e))}return e._curve=t,e}function z(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(I(t)):e()._curve},t}function O(){return z(M().curve(L))}function D(){var t=S().curve(L),e=t.curve,r=t.lineX0,n=t.lineX1,a=t.lineY0,i=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return z(r())},delete t.lineX0,t.lineEndAngle=function(){return z(n())},delete t.lineX1,t.lineInnerRadius=function(){return z(a())},delete t.lineY0,t.lineOuterRadius=function(){return z(i())},delete t.lineY1,t.curve=function(t){return arguments.length?e(I(t)):e()._curve},t}function R(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}P.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var F=Array.prototype.slice;function B(t){return t.source}function N(t){return t.target}function j(t){var n=B,a=N,i=k,o=A,s=null;function l(){var r,l=F.call(arguments),c=n.apply(this,l),u=a.apply(this,l);if(s||(s=r=e.path()),t(s,+i.apply(this,(l[0]=c,l)),+o.apply(this,l),+i.apply(this,(l[0]=u,l)),+o.apply(this,l)),r)return s=null,r+""||null}return l.source=function(t){return arguments.length?(n=t,l):n},l.target=function(t){return arguments.length?(a=t,l):a},l.x=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),l):i},l.y=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),l):o},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function V(t,e,r,n,a){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,a,n,a)}function U(t,e,r,n,a){t.moveTo(e,r),t.bezierCurveTo(e,r=(r+a)/2,n,r,n,a)}function q(t,e,r,n,a){var i=R(e,r),o=R(e,r=(r+a)/2),s=R(n,r),l=R(n,a);t.moveTo(i[0],i[1]),t.bezierCurveTo(o[0],o[1],s[0],s[1],l[0],l[1])}var H={draw:function(t,e){var r=Math.sqrt(e/u);t.moveTo(r,0),t.arc(0,0,r,0,f)}},G={draw:function(t,e){var r=Math.sqrt(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},Y=Math.sqrt(1/3),W=2*Y,Z={draw:function(t,e){var r=Math.sqrt(e/W),n=r*Y;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},X=Math.sin(u/10)/Math.sin(7*u/10),J=Math.sin(f/10)*X,K=-Math.cos(f/10)*X,Q={draw:function(t,e){var r=Math.sqrt(.8908130915292852*e),n=J*r,a=K*r;t.moveTo(0,-r),t.lineTo(n,a);for(var i=1;i<5;++i){var o=f*i/5,s=Math.cos(o),l=Math.sin(o);t.lineTo(l*r,-s*r),t.lineTo(s*n-l*a,l*n+s*a)}t.closePath()}},$={draw:function(t,e){var r=Math.sqrt(e),n=-r/2;t.rect(n,n,r,r)}},tt=Math.sqrt(3),et={draw:function(t,e){var r=-Math.sqrt(e/(3*tt));t.moveTo(0,2*r),t.lineTo(-tt*r,-r),t.lineTo(tt*r,-r),t.closePath()}},rt=-.5,nt=Math.sqrt(3)/2,at=1/Math.sqrt(12),it=3*(at/2+1),ot={draw:function(t,e){var r=Math.sqrt(e/it),n=r/2,a=r*at,i=n,o=r*at+r,s=-i,l=o;t.moveTo(n,a),t.lineTo(i,o),t.lineTo(s,l),t.lineTo(rt*n-nt*a,nt*n+rt*a),t.lineTo(rt*i-nt*o,nt*i+rt*o),t.lineTo(rt*s-nt*l,nt*s+rt*l),t.lineTo(rt*n+nt*a,rt*a-nt*n),t.lineTo(rt*i+nt*o,rt*o-nt*i),t.lineTo(rt*s+nt*l,rt*l-nt*s),t.closePath()}},st=[H,G,Z,$,Q,et,ot];function lt(){}function ct(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function ut(t){this._context=t}function ht(t){this._context=t}function ft(t){this._context=t}function pt(t,e){this._basis=new ut(t),this._beta=e}ut.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ct(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ht.prototype={areaStart:lt,areaEnd:lt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ft.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},pt.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n,a=t[0],i=e[0],o=t[r]-a,s=e[r]-i,l=-1;++l<=r;)n=l/r,this._basis.point(this._beta*t[l]+(1-this._beta)*(a+n*o),this._beta*e[l]+(1-this._beta)*(i+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var dt=function t(e){function r(t){return 1===e?new ut(t):new pt(t,e)}return r.beta=function(e){return t(+e)},r}(.85);function gt(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function mt(t,e){this._context=t,this._k=(1-e)/6}mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:gt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:gt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var vt=function t(e){function r(t){return new mt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function yt(t,e){this._context=t,this._k=(1-e)/6}yt.prototype={areaStart:lt,areaEnd:lt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:gt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var xt=function t(e){function r(t){return new yt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function bt(t,e){this._context=t,this._k=(1-e)/6}bt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:gt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var _t=function t(e){function r(t){return new bt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function wt(t,e,r){var n=t._x1,a=t._y1,i=t._x2,o=t._y2;if(t._l01_a>1e-12){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,a=(a*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>1e-12){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);i=(i*c+t._x1*t._l23_2a-e*t._l12_2a)/u,o=(o*c+t._y1*t._l23_2a-r*t._l12_2a)/u}t._context.bezierCurveTo(n,a,i,o,t._x2,t._y2)}function Tt(t,e){this._context=t,this._alpha=e}Tt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:wt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var kt=function t(e){function r(t){return e?new Tt(t,e):new mt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function At(t,e){this._context=t,this._alpha=e}At.prototype={areaStart:lt,areaEnd:lt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:wt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Mt=function t(e){function r(t){return e?new At(t,e):new yt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function St(t,e){this._context=t,this._alpha=e}St.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:wt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Et=function t(e){function r(t){return e?new St(t,e):new bt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Ct(t){this._context=t}function Lt(t){return t<0?-1:1}function Pt(t,e,r){var n=t._x1-t._x0,a=e-t._x1,i=(t._y1-t._y0)/(n||a<0&&-0),o=(r-t._y1)/(a||n<0&&-0),s=(i*a+o*n)/(n+a);return(Lt(i)+Lt(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(s))||0}function It(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function zt(t,e,r){var n=t._x0,a=t._y0,i=t._x1,o=t._y1,s=(i-n)/3;t._context.bezierCurveTo(n+s,a+s*e,i-s,o-s*r,i,o)}function Ot(t){this._context=t}function Dt(t){this._context=new Rt(t)}function Rt(t){this._context=t}function Ft(t){this._context=t}function Bt(t){var e,r,n=t.length-1,a=new Array(n),i=new Array(n),o=new Array(n);for(a[0]=0,i[0]=2,o[0]=t[0]+2*t[1],e=1;e<n-1;++e)a[e]=1,i[e]=4,o[e]=4*t[e]+2*t[e+1];for(a[n-1]=2,i[n-1]=7,o[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)r=a[e]/i[e-1],i[e]-=r,o[e]-=r*o[e-1];for(a[n-1]=o[n-1]/i[n-1],e=n-2;e>=0;--e)a[e]=(o[e]-a[e+1])/i[e];for(i[n-1]=(t[n]+a[n-1])/2,e=0;e<n-1;++e)i[e]=2*t[e+1]-a[e+1];return[a,i]}function Nt(t,e){this._context=t,this._t=e}function jt(t,e){if((a=t.length)>1)for(var r,n,a,i=1,o=t[e[0]],s=o.length;i<a;++i)for(n=o,o=t[e[i]],r=0;r<s;++r)o[r][1]+=o[r][0]=isNaN(n[r][1])?n[r][0]:n[r][1]}function Vt(t){for(var e=t.length,r=new Array(e);--e>=0;)r[e]=e;return r}function Ut(t,e){return t[e]}function qt(t){var e=t.map(Ht);return Vt(t).sort((function(t,r){return e[t]-e[r]}))}function Ht(t){for(var e,r=-1,n=0,a=t.length,i=-1/0;++r<a;)(e=+t[r][1])>i&&(i=e,n=r);return n}function Gt(t){var e=t.map(Yt);return Vt(t).sort((function(t,r){return e[t]-e[r]}))}function Yt(t){for(var e,r=0,n=-1,a=t.length;++n<a;)(e=+t[n][1])&&(r+=e);return r}Ct.prototype={areaStart:lt,areaEnd:lt,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},Ot.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:zt(this,this._t0,It(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,zt(this,It(this,r=Pt(this,t,e)),r);break;default:zt(this,this._t0,r=Pt(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}},(Dt.prototype=Object.create(Ot.prototype)).point=function(t,e){Ot.prototype.point.call(this,e,t)},Rt.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,a,i){this._context.bezierCurveTo(e,t,n,r,i,a)}},Ft.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===r)this._context.lineTo(t[1],e[1]);else for(var n=Bt(t),a=Bt(e),i=0,o=1;o<r;++i,++o)this._context.bezierCurveTo(n[0][i],a[0][i],n[1][i],a[1][i],t[o],e[o]);(this._line||0!==this._line&&1===r)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},Nt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}}this._x=t,this._y=e}},t.arc=function(){var t=g,o=m,w=r(0),T=null,k=v,A=y,M=x,S=null;function E(){var r,g,m=+t.apply(this,arguments),v=+o.apply(this,arguments),y=k.apply(this,arguments)-h,x=A.apply(this,arguments)-h,E=n(x-y),C=x>y;if(S||(S=r=e.path()),v<m&&(g=v,v=m,m=g),v>1e-12)if(E>f-1e-12)S.moveTo(v*i(y),v*l(y)),S.arc(0,0,v,y,x,!C),m>1e-12&&(S.moveTo(m*i(x),m*l(x)),S.arc(0,0,m,x,y,C));else{var L,P,I=y,z=x,O=y,D=x,R=E,F=E,B=M.apply(this,arguments)/2,N=B>1e-12&&(T?+T.apply(this,arguments):c(m*m+v*v)),j=s(n(v-m)/2,+w.apply(this,arguments)),V=j,U=j;if(N>1e-12){var q=d(N/m*l(B)),H=d(N/v*l(B));(R-=2*q)>1e-12?(O+=q*=C?1:-1,D-=q):(R=0,O=D=(y+x)/2),(F-=2*H)>1e-12?(I+=H*=C?1:-1,z-=H):(F=0,I=z=(y+x)/2)}var G=v*i(I),Y=v*l(I),W=m*i(D),Z=m*l(D);if(j>1e-12){var X,J=v*i(z),K=v*l(z),Q=m*i(O),$=m*l(O);if(E<u&&(X=b(G,Y,Q,$,J,K,W,Z))){var tt=G-X[0],et=Y-X[1],rt=J-X[0],nt=K-X[1],at=1/l(p((tt*rt+et*nt)/(c(tt*tt+et*et)*c(rt*rt+nt*nt)))/2),it=c(X[0]*X[0]+X[1]*X[1]);V=s(j,(m-it)/(at-1)),U=s(j,(v-it)/(at+1))}}F>1e-12?U>1e-12?(L=_(Q,$,G,Y,v,U,C),P=_(J,K,W,Z,v,U,C),S.moveTo(L.cx+L.x01,L.cy+L.y01),U<j?S.arc(L.cx,L.cy,U,a(L.y01,L.x01),a(P.y01,P.x01),!C):(S.arc(L.cx,L.cy,U,a(L.y01,L.x01),a(L.y11,L.x11),!C),S.arc(0,0,v,a(L.cy+L.y11,L.cx+L.x11),a(P.cy+P.y11,P.cx+P.x11),!C),S.arc(P.cx,P.cy,U,a(P.y11,P.x11),a(P.y01,P.x01),!C))):(S.moveTo(G,Y),S.arc(0,0,v,I,z,!C)):S.moveTo(G,Y),m>1e-12&&R>1e-12?V>1e-12?(L=_(W,Z,J,K,m,-V,C),P=_(G,Y,Q,$,m,-V,C),S.lineTo(L.cx+L.x01,L.cy+L.y01),V<j?S.arc(L.cx,L.cy,V,a(L.y01,L.x01),a(P.y01,P.x01),!C):(S.arc(L.cx,L.cy,V,a(L.y01,L.x01),a(L.y11,L.x11),!C),S.arc(0,0,m,a(L.cy+L.y11,L.cx+L.x11),a(P.cy+P.y11,P.cx+P.x11),C),S.arc(P.cx,P.cy,V,a(P.y11,P.x11),a(P.y01,P.x01),!C))):S.arc(0,0,m,D,O,C):S.lineTo(W,Z)}else S.moveTo(0,0);if(S.closePath(),r)return S=null,r+""||null}return E.centroid=function(){var e=(+t.apply(this,arguments)+ +o.apply(this,arguments))/2,r=(+k.apply(this,arguments)+ +A.apply(this,arguments))/2-u/2;return[i(r)*e,l(r)*e]},E.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),E):t},E.outerRadius=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),E):o},E.cornerRadius=function(t){return arguments.length?(w="function"==typeof t?t:r(+t),E):w},E.padRadius=function(t){return arguments.length?(T=null==t?null:"function"==typeof t?t:r(+t),E):T},E.startAngle=function(t){return arguments.length?(k="function"==typeof t?t:r(+t),E):k},E.endAngle=function(t){return arguments.length?(A="function"==typeof t?t:r(+t),E):A},E.padAngle=function(t){return arguments.length?(M="function"==typeof t?t:r(+t),E):M},E.context=function(t){return arguments.length?(S=null==t?null:t,E):S},E},t.area=S,t.areaRadial=D,t.curveBasis=function(t){return new ut(t)},t.curveBasisClosed=function(t){return new ht(t)},t.curveBasisOpen=function(t){return new ft(t)},t.curveBundle=dt,t.curveCardinal=vt,t.curveCardinalClosed=xt,t.curveCardinalOpen=_t,t.curveCatmullRom=kt,t.curveCatmullRomClosed=Mt,t.curveCatmullRomOpen=Et,t.curveLinear=T,t.curveLinearClosed=function(t){return new Ct(t)},t.curveMonotoneX=function(t){return new Ot(t)},t.curveMonotoneY=function(t){return new Dt(t)},t.curveNatural=function(t){return new Ft(t)},t.curveStep=function(t){return new Nt(t,.5)},t.curveStepAfter=function(t){return new Nt(t,1)},t.curveStepBefore=function(t){return new Nt(t,0)},t.line=M,t.lineRadial=O,t.linkHorizontal=function(){return j(V)},t.linkRadial=function(){var t=j(q);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.linkVertical=function(){return j(U)},t.pie=function(){var t=C,e=E,n=null,a=r(0),i=r(f),o=r(0);function s(r){var s,l,c,u,h,p=r.length,d=0,g=new Array(p),m=new Array(p),v=+a.apply(this,arguments),y=Math.min(f,Math.max(-f,i.apply(this,arguments)-v)),x=Math.min(Math.abs(y)/p,o.apply(this,arguments)),b=x*(y<0?-1:1);for(s=0;s<p;++s)(h=m[g[s]=s]=+t(r[s],s,r))>0&&(d+=h);for(null!=e?g.sort((function(t,r){return e(m[t],m[r])})):null!=n&&g.sort((function(t,e){return n(r[t],r[e])})),s=0,c=d?(y-p*b)/d:0;s<p;++s,v=u)l=g[s],u=v+((h=m[l])>0?h*c:0)+b,m[l]={data:r[l],index:s,value:h,startAngle:v,endAngle:u,padAngle:x};return m}return s.value=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),s):t},s.sortValues=function(t){return arguments.length?(e=t,n=null,s):e},s.sort=function(t){return arguments.length?(n=t,e=null,s):n},s.startAngle=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),s):a},s.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),s):i},s.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),s):o},s},t.pointRadial=R,t.radialArea=D,t.radialLine=O,t.stack=function(){var t=r([]),e=Vt,n=jt,a=Ut;function i(r){var i,o,s=t.apply(this,arguments),l=r.length,c=s.length,u=new Array(c);for(i=0;i<c;++i){for(var h,f=s[i],p=u[i]=new Array(l),d=0;d<l;++d)p[d]=h=[0,+a(r[d],f,d,r)],h.data=r[d];p.key=f}for(i=0,o=e(u);i<c;++i)u[o[i]].index=i;return n(u,o),u}return i.keys=function(e){return arguments.length?(t="function"==typeof e?e:r(F.call(e)),i):t},i.value=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),i):a},i.order=function(t){return arguments.length?(e=null==t?Vt:"function"==typeof t?t:r(F.call(t)),i):e},i.offset=function(t){return arguments.length?(n=null==t?jt:t,i):n},i},t.stackOffsetDiverging=function(t,e){if((s=t.length)>0)for(var r,n,a,i,o,s,l=0,c=t[e[0]].length;l<c;++l)for(i=o=0,r=0;r<s;++r)(a=(n=t[e[r]][l])[1]-n[0])>0?(n[0]=i,n[1]=i+=a):a<0?(n[1]=o,n[0]=o+=a):(n[0]=0,n[1]=a)},t.stackOffsetExpand=function(t,e){if((n=t.length)>0){for(var r,n,a,i=0,o=t[0].length;i<o;++i){for(a=r=0;r<n;++r)a+=t[r][i][1]||0;if(a)for(r=0;r<n;++r)t[r][i][1]/=a}jt(t,e)}},t.stackOffsetNone=jt,t.stackOffsetSilhouette=function(t,e){if((r=t.length)>0){for(var r,n=0,a=t[e[0]],i=a.length;n<i;++n){for(var o=0,s=0;o<r;++o)s+=t[o][n][1]||0;a[n][1]+=a[n][0]=-s/2}jt(t,e)}},t.stackOffsetWiggle=function(t,e){if((a=t.length)>0&&(n=(r=t[e[0]]).length)>0){for(var r,n,a,i=0,o=1;o<n;++o){for(var s=0,l=0,c=0;s<a;++s){for(var u=t[e[s]],h=u[o][1]||0,f=(h-(u[o-1][1]||0))/2,p=0;p<s;++p){var d=t[e[p]];f+=(d[o][1]||0)-(d[o-1][1]||0)}l+=h,c+=f*h}r[o-1][1]+=r[o-1][0]=i,l&&(i-=c/l)}r[o-1][1]+=r[o-1][0]=i,jt(t,e)}},t.stackOrderAppearance=qt,t.stackOrderAscending=Gt,t.stackOrderDescending=function(t){return Gt(t).reverse()},t.stackOrderInsideOut=function(t){var e,r,n=t.length,a=t.map(Yt),i=qt(t),o=0,s=0,l=[],c=[];for(e=0;e<n;++e)r=i[e],o<s?(o+=a[r],l.push(r)):(s+=a[r],c.push(r));return c.reverse().concat(l)},t.stackOrderNone=Vt,t.stackOrderReverse=function(t){return Vt(t).reverse()},t.symbol=function(){var t=r(H),n=r(64),a=null;function i(){var r;if(a||(a=r=e.path()),t.apply(this,arguments).draw(a,+n.apply(this,arguments)),r)return a=null,r+""||null}return i.type=function(e){return arguments.length?(t="function"==typeof e?e:r(e),i):t},i.size=function(t){return arguments.length?(n="function"==typeof t?t:r(+t),i):n},i.context=function(t){return arguments.length?(a=null==t?null:t,i):a},i},t.symbolCircle=H,t.symbolCross=G,t.symbolDiamond=Z,t.symbolSquare=$,t.symbolStar=Q,t.symbolTriangle=et,t.symbolWye=ot,t.symbols=st,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-path":160}],163:[function(t,e,r){!function(t,n){"object"==typeof r&&"undefined"!=typeof e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";var e,r,n=0,a=0,i=0,o=0,s=0,l=0,c="object"==typeof performance&&performance.now?performance:Date,u="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function h(){return s||(u(f),s=c.now()+l)}function f(){s=0}function p(){this._call=this._time=this._next=null}function d(t,e,r){var n=new p;return n.restart(t,e,r),n}function g(){h(),++n;for(var t,r=e;r;)(t=s-r._time)>=0&&r._call.call(null,t),r=r._next;--n}function m(){s=(o=c.now())+l,n=a=0;try{g()}finally{n=0,function(){var t,n,a=e,i=1/0;for(;a;)a._call?(i>a._time&&(i=a._time),t=a,a=a._next):(n=a._next,a._next=null,a=t?t._next=n:e=n);r=t,y(i)}(),s=0}}function v(){var t=c.now(),e=t-o;e>1e3&&(l-=e,o=t)}function y(t){n||(a&&(a=clearTimeout(a)),t-s>24?(t<1/0&&(a=setTimeout(m,t-c.now()-l)),i&&(i=clearInterval(i))):(i||(o=c.now(),i=setInterval(v,1e3)),n=1,u(m)))}p.prototype=d.prototype={constructor:p,restart:function(t,n,a){if("function"!=typeof t)throw new TypeError("callback is not a function");a=(null==a?h():+a)+(null==n?0:+n),this._next||r===this||(r?r._next=this:e=this,r=this),this._call=t,this._time=a,y()},stop:function(){this._call&&(this._call=null,this._time=1/0,y())}},t.interval=function(t,e,r){var n=new p,a=e;return null==e?(n.restart(t,e,r),n):(e=+e,r=null==r?h():+r,n.restart((function i(o){o+=a,n.restart(i,a+=e,r),t(o)}),e,r),n)},t.now=h,t.timeout=function(t,e,r){var n=new p;return e=null==e?0:+e,n.restart((function(r){n.stop(),t(r+e)}),e,r),n},t.timer=d,t.timerFlush=g,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],164:[function(t,e,r){!function(){var t={version:"3.5.17"},r=[].slice,n=function(t){return r.call(t)},a=this.document;function i(t){return t&&(t.ownerDocument||t.document||t).documentElement}function o(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(a)try{n(a.documentElement.childNodes)[0].nodeType}catch(t){n=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),a)try{a.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var s=this.Element.prototype,l=s.setAttribute,c=s.setAttributeNS,u=this.CSSStyleDeclaration.prototype,h=u.setProperty;s.setAttribute=function(t,e){l.call(this,t,e+"")},s.setAttributeNS=function(t,e,r){c.call(this,t,e,r+"")},u.setProperty=function(t,e,r){h.call(this,t,e+"",r)}}function f(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function p(t){return null===t?NaN:+t}function d(t){return!isNaN(t)}function g(t){return{left:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n<a;){var i=n+a>>>1;t(e[i],r)<0?n=i+1:a=i}return n},right:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n<a;){var i=n+a>>>1;t(e[i],r)>0?a=i:n=i+1}return n}}}t.ascending=f,t.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},t.min=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a<i;)if(null!=(n=t[a])&&n>=n){r=n;break}for(;++a<i;)null!=(n=t[a])&&r>n&&(r=n)}else{for(;++a<i;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=n;break}for(;++a<i;)null!=(n=e.call(t,t[a],a))&&r>n&&(r=n)}return r},t.max=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a<i;)if(null!=(n=t[a])&&n>=n){r=n;break}for(;++a<i;)null!=(n=t[a])&&n>r&&(r=n)}else{for(;++a<i;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=n;break}for(;++a<i;)null!=(n=e.call(t,t[a],a))&&n>r&&(r=n)}return r},t.extent=function(t,e){var r,n,a,i=-1,o=t.length;if(1===arguments.length){for(;++i<o;)if(null!=(n=t[i])&&n>=n){r=a=n;break}for(;++i<o;)null!=(n=t[i])&&(r>n&&(r=n),a<n&&(a=n))}else{for(;++i<o;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=a=n;break}for(;++i<o;)null!=(n=e.call(t,t[i],i))&&(r>n&&(r=n),a<n&&(a=n))}return[r,a]},t.sum=function(t,e){var r,n=0,a=t.length,i=-1;if(1===arguments.length)for(;++i<a;)d(r=+t[i])&&(n+=r);else for(;++i<a;)d(r=+e.call(t,t[i],i))&&(n+=r);return n},t.mean=function(t,e){var r,n=0,a=t.length,i=-1,o=a;if(1===arguments.length)for(;++i<a;)d(r=p(t[i]))?n+=r:--o;else for(;++i<a;)d(r=p(e.call(t,t[i],i)))?n+=r:--o;if(o)return n/o},t.quantile=function(t,e){var r=(t.length-1)*e+1,n=Math.floor(r),a=+t[n-1],i=r-n;return i?a+i*(t[n]-a):a},t.median=function(e,r){var n,a=[],i=e.length,o=-1;if(1===arguments.length)for(;++o<i;)d(n=p(e[o]))&&a.push(n);else for(;++o<i;)d(n=p(r.call(e,e[o],o)))&&a.push(n);if(a.length)return t.quantile(a.sort(f),.5)},t.variance=function(t,e){var r,n,a=t.length,i=0,o=0,s=-1,l=0;if(1===arguments.length)for(;++s<a;)d(r=p(t[s]))&&(o+=(n=r-i)*(r-(i+=n/++l)));else for(;++s<a;)d(r=p(e.call(t,t[s],s)))&&(o+=(n=r-i)*(r-(i+=n/++l)));if(l>1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var m=g(f);function v(t){return t.length}t.bisectLeft=m.left,t.bisect=t.bisectRight=m.right,t.bisector=function(t){return g(1===t.length?function(e,r){return f(t(e),r)}:t)},t.shuffle=function(t,e,r){(i=arguments.length)<3&&(r=t.length,i<2&&(e=0));for(var n,a,i=r-e;i;)a=Math.random()*i--|0,n=t[i+e],t[i+e]=t[a+e],t[a+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],a=new Array(r<0?0:r);e<r;)a[e]=[n,n=t[++e]];return a},t.transpose=function(e){if(!(i=e.length))return[];for(var r=-1,n=t.min(e,v),a=new Array(n);++r<n;)for(var i,o=-1,s=a[r]=new Array(i);++o<i;)s[o]=e[o][r];return a},t.zip=function(){return t.transpose(arguments)},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},t.merge=function(t){for(var e,r,n,a=t.length,i=-1,o=0;++i<a;)o+=t[i].length;for(r=new Array(o);--a>=0;)for(e=(n=t[a]).length;--e>=0;)r[--o]=n[e];return r};var y=Math.abs;function x(t){for(var e=1;t*e%1;)e*=10;return e}function b(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function _(){this._=Object.create(null)}t.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r==1/0)throw new Error("infinite range");var n,a=[],i=x(y(r)),o=-1;if(t*=i,e*=i,(r*=i)<0)for(;(n=t+r*++o)>e;)a.push(n/i);else for(;(n=t+r*++o)<e;)a.push(n/i);return a},t.map=function(t,e){var r=new _;if(t instanceof _)t.forEach((function(t,e){r.set(t,e)}));else if(Array.isArray(t)){var n,a=-1,i=t.length;if(1===arguments.length)for(;++a<i;)r.set(a,t[a]);else for(;++a<i;)r.set(e.call(t,n=t[a],a),n)}else for(var o in t)r.set(o,t[o]);return r};function w(t){return"__proto__"==(t+="")||"\0"===t[0]?"\0"+t:t}function T(t){return"\0"===(t+="")[0]?t.slice(1):t}function k(t){return w(t)in this._}function A(t){return(t=w(t))in this._&&delete this._[t]}function M(){var t=[];for(var e in this._)t.push(T(e));return t}function S(){var t=0;for(var e in this._)++t;return t}function E(){for(var t in this._)return!1;return!0}function C(){this._=Object.create(null)}function L(t){return t}function P(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function I(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=z.length;r<n;++r){var a=z[r]+e;if(a in t)return a}}b(_,{has:k,get:function(t){return this._[w(t)]},set:function(t,e){return this._[w(t)]=e},remove:A,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:T(e),value:this._[e]});return t},size:S,empty:E,forEach:function(t){for(var e in this._)t.call(this,T(e),this._[e])}}),t.nest=function(){var e,r,n={},a=[],i=[];function o(t,i,s){if(s>=a.length)return r?r.call(n,i):e?i.sort(e):i;for(var l,c,u,h,f=-1,p=i.length,d=a[s++],g=new _;++f<p;)(h=g.get(l=d(c=i[f])))?h.push(c):g.set(l,[c]);return t?(c=t(),u=function(e,r){c.set(e,o(t,r,s))}):(c={},u=function(e,r){c[e]=o(t,r,s)}),g.forEach(u),c}return n.map=function(t,e){return o(e,t,0)},n.entries=function(e){return function t(e,r){if(r>=a.length)return e;var n=[],o=i[r++];return e.forEach((function(e,a){n.push({key:e,values:t(a,r)})})),o?n.sort((function(t,e){return o(t.key,e.key)})):n}(o(t.map,e,0),0)},n.key=function(t){return a.push(t),n},n.sortKeys=function(t){return i[a.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new C;if(t)for(var r=0,n=t.length;r<n;++r)e.add(t[r]);return e},b(C,{has:k,add:function(t){return this._[w(t+="")]=!0,t},remove:A,values:M,size:S,empty:E,forEach:function(t){for(var e in this._)t.call(this,T(e))}}),t.behavior={},t.rebind=function(t,e){for(var r,n=1,a=arguments.length;++n<a;)t[r=arguments[n]]=P(t,e,e[r]);return t};var z=["webkit","ms","moz","Moz","o","O"];function O(){}function D(){}function R(t){var e=[],r=new _;function n(){for(var r,n=e,a=-1,i=n.length;++a<i;)(r=n[a].on)&&r.apply(this,arguments);return t}return n.on=function(n,a){var i,o=r.get(n);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,i=e.indexOf(o)).concat(e.slice(i+1)),r.remove(n)),a&&e.push(r.set(n,{on:a})),t)},n}function F(){t.event.preventDefault()}function B(){for(var e,r=t.event;e=r.sourceEvent;)r=e;return r}function N(e){for(var r=new D,n=0,a=arguments.length;++n<a;)r[arguments[n]]=R(r);return r.of=function(n,a){return function(i){try{var o=i.sourceEvent=t.event;i.target=e,t.event=i,r[i.type].apply(n,a)}finally{t.event=o}}},r}t.dispatch=function(){for(var t=new D,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=R(t);return t},D.prototype.on=function(t,e){var r=t.indexOf("."),n="";if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},t.event=null,t.requote=function(t){return t.replace(j,"\\$&")};var j=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,V={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function U(t){return V(t,Y),t}var q=function(t,e){return e.querySelector(t)},H=function(t,e){return e.querySelectorAll(t)},G=function(t,e){var r=t.matches||t[I(t,"matchesSelector")];return(G=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(q=function(t,e){return Sizzle(t,e)[0]||null},H=Sizzle,G=Sizzle.matchesSelector),t.selection=function(){return t.select(a.documentElement)};var Y=t.selection.prototype=[];function W(t){return"function"==typeof t?t:function(){return q(t,this)}}function Z(t){return"function"==typeof t?t:function(){return H(t,this)}}Y.select=function(t){var e,r,n,a,i=[];t=W(t);for(var o=-1,s=this.length;++o<s;){i.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var l=-1,c=n.length;++l<c;)(a=n[l])?(e.push(r=t.call(a,a.__data__,l,o)),r&&"__data__"in a&&(r.__data__=a.__data__)):e.push(null)}return U(i)},Y.selectAll=function(t){var e,r,a=[];t=Z(t);for(var i=-1,o=this.length;++i<o;)for(var s=this[i],l=-1,c=s.length;++l<c;)(r=s[l])&&(a.push(e=n(t.call(r,r.__data__,l,i))),e.parentNode=r);return U(a)};var X="http://www.w3.org/1999/xhtml",J={svg:"http://www.w3.org/2000/svg",xhtml:X,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function K(e,r){return e=t.ns.qualify(e),null==r?e.local?function(){this.removeAttributeNS(e.space,e.local)}:function(){this.removeAttribute(e)}:"function"==typeof r?e.local?function(){var t=r.apply(this,arguments);null==t?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,t)}:function(){var t=r.apply(this,arguments);null==t?this.removeAttribute(e):this.setAttribute(e,t)}:e.local?function(){this.setAttributeNS(e.space,e.local,r)}:function(){this.setAttribute(e,r)}}function Q(t){return t.trim().replace(/\s+/g," ")}function $(e){return new RegExp("(?:^|\\s+)"+t.requote(e)+"(?:\\s+|$)","g")}function tt(t){return(t+"").trim().split(/^|\s+/)}function et(t,e){var r=(t=tt(t).map(rt)).length;return"function"==typeof e?function(){for(var n=-1,a=e.apply(this,arguments);++n<r;)t[n](this,a)}:function(){for(var n=-1;++n<r;)t[n](this,e)}}function rt(t){var e=$(t);return function(r,n){if(a=r.classList)return n?a.add(t):a.remove(t);var a=r.getAttribute("class")||"";n?(e.lastIndex=0,e.test(a)||r.setAttribute("class",Q(a+" "+t))):r.setAttribute("class",Q(a.replace(e," ")))}}function nt(t,e,r){return null==e?function(){this.style.removeProperty(t)}:"function"==typeof e?function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}:function(){this.style.setProperty(t,e,r)}}function at(t,e){return null==e?function(){delete this[t]}:"function"==typeof e?function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}:function(){this[t]=e}}function it(e){return"function"==typeof e?e:(e=t.ns.qualify(e)).local?function(){return this.ownerDocument.createElementNS(e.space,e.local)}:function(){var t=this.ownerDocument,r=this.namespaceURI;return r===X&&t.documentElement.namespaceURI===X?t.createElement(e):t.createElementNS(r,e)}}function ot(){var t=this.parentNode;t&&t.removeChild(this)}function st(t){return{__data__:t}}function lt(t){return function(){return G(this,t)}}function ct(t){return arguments.length||(t=f),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}function ut(t,e){for(var r=0,n=t.length;r<n;r++)for(var a,i=t[r],o=0,s=i.length;o<s;o++)(a=i[o])&&e(a,o,r);return t}function ht(t){return V(t,ft),t}t.ns={prefix:J,qualify:function(t){var e=t.indexOf(":"),r=t;return e>=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),J.hasOwnProperty(r)?{space:J[r],local:t}:t}},Y.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(K(r,e[r]));return this}return this.each(K(e,r))},Y.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=tt(t)).length,a=-1;if(e=r.classList){for(;++a<n;)if(!e.contains(t[a]))return!1}else for(e=r.getAttribute("class");++a<n;)if(!$(t[a]).test(e))return!1;return!0}for(e in t)this.each(et(e,t[e]));return this}return this.each(et(t,e))},Y.style=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=""),t)this.each(nt(r,t[r],e));return this}if(n<2){var a=this.node();return o(a).getComputedStyle(a,null).getPropertyValue(t)}r=""}return this.each(nt(t,e,r))},Y.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(at(e,t[e]));return this}return this.each(at(t,e))},Y.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},Y.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},Y.append=function(t){return t=it(t),this.select((function(){return this.appendChild(t.apply(this,arguments))}))},Y.insert=function(t,e){return t=it(t),e=W(e),this.select((function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)}))},Y.remove=function(){return this.each(ot)},Y.data=function(t,e){var r,n,a=-1,i=this.length;if(!arguments.length){for(t=new Array(i=(r=this[0]).length);++a<i;)(n=r[a])&&(t[a]=n.__data__);return t}function o(t,r){var n,a,i,o=t.length,u=r.length,h=Math.min(o,u),f=new Array(u),p=new Array(u),d=new Array(o);if(e){var g,m=new _,v=new Array(o);for(n=-1;++n<o;)(a=t[n])&&(m.has(g=e.call(a,a.__data__,n))?d[n]=a:m.set(g,a),v[n]=g);for(n=-1;++n<u;)(a=m.get(g=e.call(r,i=r[n],n)))?!0!==a&&(f[n]=a,a.__data__=i):p[n]=st(i),m.set(g,!0);for(n=-1;++n<o;)n in v&&!0!==m.get(v[n])&&(d[n]=t[n])}else{for(n=-1;++n<h;)a=t[n],i=r[n],a?(a.__data__=i,f[n]=a):p[n]=st(i);for(;n<u;++n)p[n]=st(r[n]);for(;n<o;++n)d[n]=t[n]}p.update=f,p.parentNode=f.parentNode=d.parentNode=t.parentNode,s.push(p),l.push(f),c.push(d)}var s=ht([]),l=U([]),c=U([]);if("function"==typeof t)for(;++a<i;)o(r=this[a],t.call(r,r.parentNode.__data__,a));else for(;++a<i;)o(r=this[a],t);return l.enter=function(){return s},l.exit=function(){return c},l},Y.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},Y.filter=function(t){var e,r,n,a=[];"function"!=typeof t&&(t=lt(t));for(var i=0,o=this.length;i<o;i++){a.push(e=[]),e.parentNode=(r=this[i]).parentNode;for(var s=0,l=r.length;s<l;s++)(n=r[s])&&t.call(n,n.__data__,s,i)&&e.push(n)}return U(a)},Y.order=function(){for(var t=-1,e=this.length;++t<e;)for(var r,n=this[t],a=n.length-1,i=n[a];--a>=0;)(r=n[a])&&(i&&i!==r.nextSibling&&i.parentNode.insertBefore(r,i),i=r);return this},Y.sort=function(t){t=ct.apply(this,arguments);for(var e=-1,r=this.length;++e<r;)this[e].sort(t);return this.order()},Y.each=function(t){return ut(this,(function(e,r,n){t.call(e,e.__data__,r,n)}))},Y.call=function(t){var e=n(arguments);return t.apply(e[0]=this,e),this},Y.empty=function(){return!this.node()},Y.node=function(){for(var t=0,e=this.length;t<e;t++)for(var r=this[t],n=0,a=r.length;n<a;n++){var i=r[n];if(i)return i}return null},Y.size=function(){var t=0;return ut(this,(function(){++t})),t};var ft=[];function pt(t){var e,r;return function(n,a,i){var o,s=t[i].update,l=s.length;for(i!=r&&(r=i,e=0),a>=e&&(e=a+1);!(o=s[e])&&++e<l;);return o}}function dt(e,r,a){var i="__on"+e,o=e.indexOf("."),s=mt;o>0&&(e=e.slice(0,o));var l=gt.get(e);function c(){var t=this[i];t&&(this.removeEventListener(e,t,t.$),delete this[i])}return l&&(e=l,s=vt),o?r?function(){var t=s(r,n(arguments));c.call(this),this.addEventListener(e,this[i]=t,t.$=a),t._=r}:c:r?O:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var a in this)if(r=a.match(n)){var i=this[a];this.removeEventListener(r[1],i,i.$),delete this[a]}}}t.selection.enter=ht,t.selection.enter.prototype=ft,ft.append=Y.append,ft.empty=Y.empty,ft.node=Y.node,ft.call=Y.call,ft.size=Y.size,ft.select=function(t){for(var e,r,n,a,i,o=[],s=-1,l=this.length;++s<l;){n=(a=this[s]).update,o.push(e=[]),e.parentNode=a.parentNode;for(var c=-1,u=a.length;++c<u;)(i=a[c])?(e.push(n[c]=r=t.call(a.parentNode,i.__data__,c,s)),r.__data__=i.__data__):e.push(null)}return U(o)},ft.insert=function(t,e){return arguments.length<2&&(e=pt(this)),Y.insert.call(this,t,e)},t.select=function(t){var e;return"string"==typeof t?(e=[q(t,a)]).parentNode=a.documentElement:(e=[t]).parentNode=i(t),U([e])},t.selectAll=function(t){var e;return"string"==typeof t?(e=n(H(t,a))).parentNode=a.documentElement:(e=n(t)).parentNode=null,U([e])},Y.on=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=!1),t)this.each(dt(r,t[r],e));return this}if(n<2)return(n=this.node()["__on"+t])&&n._;r=!1}return this.each(dt(t,e,r))};var gt=t.map({mouseenter:"mouseover",mouseleave:"mouseout"});function mt(e,r){return function(n){var a=t.event;t.event=n,r[0]=this.__data__;try{e.apply(this,r)}finally{t.event=a}}}function vt(t,e){var r=mt(t,e);return function(t){var e=t.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||r.call(this,t)}}a&&gt.forEach((function(t){"on"+t in a&&gt.remove(t)}));var yt,xt=0;function bt(e){var r=".dragsuppress-"+ ++xt,n="click"+r,a=t.select(o(e)).on("touchmove"+r,F).on("dragstart"+r,F).on("selectstart"+r,F);if(null==yt&&(yt=!("onselectstart"in e)&&I(e.style,"userSelect")),yt){var s=i(e).style,l=s[yt];s[yt]="none"}return function(t){if(a.on(r,null),yt&&(s[yt]=l),t){var e=function(){a.on(n,null)};a.on(n,(function(){F(),e()}),!0),setTimeout(e,0)}}}t.mouse=function(t){return wt(t,B())};var _t=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function wt(e,r){r.changedTouches&&(r=r.changedTouches[0]);var n=e.ownerSVGElement||e;if(n.createSVGPoint){var a=n.createSVGPoint();if(_t<0){var i=o(e);if(i.scrollX||i.scrollY){var s=(n=t.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();_t=!(s.f||s.e),n.remove()}}return _t?(a.x=r.pageX,a.y=r.pageY):(a.x=r.clientX,a.y=r.clientY),[(a=a.matrixTransform(e.getScreenCTM().inverse())).x,a.y]}var l=e.getBoundingClientRect();return[r.clientX-l.left-e.clientLeft,r.clientY-l.top-e.clientTop]}function Tt(){return t.event.changedTouches[0].identifier}t.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=B().changedTouches),e)for(var n,a=0,i=e.length;a<i;++a)if((n=e[a]).identifier===r)return wt(t,n)},t.behavior.drag=function(){var e=N(i,"drag","dragstart","dragend"),r=null,n=s(O,t.mouse,o,"mousemove","mouseup"),a=s(Tt,t.touch,L,"touchmove","touchend");function i(){this.on("mousedown.drag",n).on("touchstart.drag",a)}function s(n,a,i,o,s){return function(){var l,c=this,u=t.event.target.correspondingElement||t.event.target,h=c.parentNode,f=e.of(c,arguments),p=0,d=n(),g=".drag"+(null==d?"":"-"+d),m=t.select(i(u)).on(o+g,x).on(s+g,b),v=bt(u),y=a(h,d);function x(){var t,e,r=a(h,d);r&&(t=r[0]-y[0],e=r[1]-y[1],p|=t|e,y=r,f({type:"drag",x:r[0]+l[0],y:r[1]+l[1],dx:t,dy:e}))}function b(){a(h,d)&&(m.on(o+g,null).on(s+g,null),v(p),f({type:"dragend"}))}l=r?[(l=r.apply(c,arguments)).x-y[0],l.y-y[1]]:[0,0],f({type:"dragstart"})}}return i.origin=function(t){return arguments.length?(r=t,i):r},t.rebind(i,e,"on")},t.touches=function(t,e){return arguments.length<2&&(e=B().touches),e?n(e).map((function(e){var r=wt(t,e);return r.identifier=e.identifier,r})):[]};var kt=1e-6,At=1e-12,Mt=Math.PI,St=2*Mt,Et=St-kt,Ct=Mt/2,Lt=Mt/180,Pt=180/Mt;function It(t){return t>0?1:t<0?-1:0}function zt(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function Ot(t){return t>1?0:t<-1?Mt:Math.acos(t)}function Dt(t){return t>1?Ct:t<-1?-Ct:Math.asin(t)}function Rt(t){return((t=Math.exp(t))+1/t)/2}function Ft(t){return(t=Math.sin(t/2))*t}var Bt=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,a=t[0],i=t[1],o=t[2],s=e[0],l=e[1],c=e[2],u=s-a,h=l-i,f=u*u+h*h;if(f<At)n=Math.log(c/o)/Bt,r=function(t){return[a+t*u,i+t*h,o*Math.exp(Bt*t*n)]};else{var p=Math.sqrt(f),d=(c*c-o*o+4*f)/(2*o*2*p),g=(c*c-o*o-4*f)/(2*c*2*p),m=Math.log(Math.sqrt(d*d+1)-d),v=Math.log(Math.sqrt(g*g+1)-g);n=(v-m)/Bt,r=function(t){var e,r=t*n,s=Rt(m),l=o/(2*p)*(s*(e=Bt*r+m,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(m));return[a+l*u,i+l*h,o*s/Rt(Bt*r+m)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,i,s,l,c,u,h,f={x:0,y:0,k:1},p=[960,500],d=Vt,g=250,m=0,v="mousedown.zoom",y="mousemove.zoom",x="mouseup.zoom",b="touchstart.zoom",_=N(w,"zoomstart","zoom","zoomend");function w(t){t.on(v,P).on(jt+".zoom",z).on("dblclick.zoom",O).on(b,I)}function T(t){return[(t[0]-f.x)/f.k,(t[1]-f.y)/f.k]}function k(t){f.k=Math.max(d[0],Math.min(d[1],t))}function A(t,e){e=function(t){return[t[0]*f.k+f.x,t[1]*f.k+f.y]}(e),f.x+=t[0]-e[0],f.y+=t[1]-e[1]}function M(e,n,a,i){e.__chart__={x:f.x,y:f.y,k:f.k},k(Math.pow(2,i)),A(r=n,a),e=t.select(e),g>0&&(e=e.transition().duration(g)),e.call(w.event)}function S(){c&&c.domain(l.range().map((function(t){return(t-f.x)/f.k})).map(l.invert)),h&&h.domain(u.range().map((function(t){return(t-f.y)/f.k})).map(u.invert))}function E(t){m++||t({type:"zoomstart"})}function C(t){S(),t({type:"zoom",scale:f.k,translate:[f.x,f.y]})}function L(t){--m||(t({type:"zoomend"}),r=null)}function P(){var e=this,r=_.of(e,arguments),n=0,a=t.select(o(e)).on(y,l).on(x,c),i=T(t.mouse(e)),s=bt(e);function l(){n=1,A(t.mouse(e),i),C(r)}function c(){a.on(y,null).on(x,null),s(n),L(r)}vs.call(e),E(r)}function I(){var e,r=this,n=_.of(r,arguments),a={},i=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,c="touchend"+o,u=[],h=t.select(r),p=bt(r);function d(){var n=t.touches(r);return e=f.k,n.forEach((function(t){t.identifier in a&&(a[t.identifier]=T(t))})),n}function g(){var e=t.event.target;t.select(e).on(l,m).on(c,y),u.push(e);for(var n=t.event.changedTouches,o=0,h=n.length;o<h;++o)a[n[o].identifier]=null;var p=d(),g=Date.now();if(1===p.length){if(g-s<500){var v=p[0];M(r,v,a[v.identifier],Math.floor(Math.log(f.k)/Math.LN2)+1),F()}s=g}else if(p.length>1){v=p[0];var x=p[1],b=v[0]-x[0],_=v[1]-x[1];i=b*b+_*_}}function m(){var o,l,c,u,h=t.touches(r);vs.call(r);for(var f=0,p=h.length;f<p;++f,u=null)if(c=h[f],u=a[c.identifier]){if(l)break;o=c,l=u}if(u){var d=(d=c[0]-o[0])*d+(d=c[1]-o[1])*d,g=i&&Math.sqrt(d/i);o=[(o[0]+c[0])/2,(o[1]+c[1])/2],l=[(l[0]+u[0])/2,(l[1]+u[1])/2],k(g*e)}s=null,A(o,l),C(n)}function y(){if(t.event.touches.length){for(var e=t.event.changedTouches,r=0,i=e.length;r<i;++r)delete a[e[r].identifier];for(var s in a)return void d()}t.selectAll(u).on(o,null),h.on(v,P).on(b,I),p(),L(n)}g(),E(n),h.on(v,null).on(b,g)}function z(){var a=_.of(this,arguments);i?clearTimeout(i):(vs.call(this),e=T(r=n||t.mouse(this)),E(a)),i=setTimeout((function(){i=null,L(a)}),50),F(),k(Math.pow(2,.002*Nt())*f.k),A(r,e),C(a)}function O(){var e=t.mouse(this),r=Math.log(f.k)/Math.LN2;M(this,e,T(e),t.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}return jt||(jt="onwheel"in a?(Nt=function(){return-t.event.deltaY*(t.event.deltaMode?120:1)},"wheel"):"onmousewheel"in a?(Nt=function(){return t.event.wheelDelta},"mousewheel"):(Nt=function(){return-t.event.detail},"MozMousePixelScroll")),w.event=function(e){e.each((function(){var e=_.of(this,arguments),n=f;bs?t.select(this).transition().each("start.zoom",(function(){f=this.__chart__||{x:0,y:0,k:1},E(e)})).tween("zoom:zoom",(function(){var a=p[0],i=p[1],o=r?r[0]:a/2,s=r?r[1]:i/2,l=t.interpolateZoom([(o-f.x)/f.k,(s-f.y)/f.k,a/f.k],[(o-n.x)/n.k,(s-n.y)/n.k,a/n.k]);return function(t){var r=l(t),n=a/r[2];this.__chart__=f={x:o-r[0]*n,y:s-r[1]*n,k:n},C(e)}})).each("interrupt.zoom",(function(){L(e)})).each("end.zoom",(function(){L(e)})):(this.__chart__=f,E(e),C(e),L(e))}))},w.translate=function(t){return arguments.length?(f={x:+t[0],y:+t[1],k:f.k},S(),w):[f.x,f.y]},w.scale=function(t){return arguments.length?(f={x:f.x,y:f.y,k:null},k(+t),S(),w):f.k},w.scaleExtent=function(t){return arguments.length?(d=null==t?Vt:[+t[0],+t[1]],w):d},w.center=function(t){return arguments.length?(n=t&&[+t[0],+t[1]],w):n},w.size=function(t){return arguments.length?(p=t&&[+t[0],+t[1]],w):p},w.duration=function(t){return arguments.length?(g=+t,w):g},w.x=function(t){return arguments.length?(c=t,l=t.copy(),f={x:0,y:0,k:1},w):c},w.y=function(t){return arguments.length?(h=t,u=t.copy(),f={x:0,y:0,k:1},w):h},t.rebind(w,_,"on")};var Nt,jt,Vt=[0,1/0];function Ut(){}function qt(t,e,r){return this instanceof qt?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof qt?new qt(t.h,t.s,t.l):le(""+t,ce,qt):new qt(t,e,r)}t.color=Ut,Ut.prototype.toString=function(){return this.rgb()+""},t.hsl=qt;var Ht=qt.prototype=new Ut;function Gt(t,e,r){var n,a;function i(t){return Math.round(255*function(t){return t>360?t-=360:t<0&&(t+=360),t<60?n+(a-n)*t/60:t<180?a:t<240?n+(a-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(a=r<=.5?r*(1+e):r+e-r*e),new ne(i(t+120),i(t),i(t-120))}function Yt(e,r,n){return this instanceof Yt?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Yt?new Yt(e.h,e.c,e.l):$t(e instanceof Xt?e.l:(e=ue((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Yt(e,r,n)}Ht.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new qt(this.h,this.s,this.l/t)},Ht.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new qt(this.h,this.s,t*this.l)},Ht.rgb=function(){return Gt(this.h,this.s,this.l)},t.hcl=Yt;var Wt=Yt.prototype=new Ut;function Zt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Xt(r,Math.cos(t*=Lt)*e,Math.sin(t)*e)}function Xt(t,e,r){return this instanceof Xt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Xt?new Xt(t.l,t.a,t.b):t instanceof Yt?Zt(t.h,t.c,t.l):ue((t=ne(t)).r,t.g,t.b):new Xt(t,e,r)}Wt.brighter=function(t){return new Yt(this.h,this.c,Math.min(100,this.l+Jt*(arguments.length?t:1)))},Wt.darker=function(t){return new Yt(this.h,this.c,Math.max(0,this.l-Jt*(arguments.length?t:1)))},Wt.rgb=function(){return Zt(this.h,this.c,this.l).rgb()},t.lab=Xt;var Jt=18,Kt=Xt.prototype=new Ut;function Qt(t,e,r){var n=(t+16)/116,a=n+e/500,i=n-r/200;return new ne(re(3.2404542*(a=.95047*te(a))-1.5371385*(n=1*te(n))-.4985314*(i=1.08883*te(i))),re(-.969266*a+1.8760108*n+.041556*i),re(.0556434*a-.2040259*n+1.0572252*i))}function $t(t,e,r){return t>0?new Yt(Math.atan2(r,e)*Pt,Math.sqrt(e*e+r*r),t):new Yt(NaN,NaN,t)}function te(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ee(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function re(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ne(t,e,r){return this instanceof ne?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ne?new ne(t.r,t.g,t.b):le(""+t,ne,Gt):new ne(t,e,r)}function ae(t){return new ne(t>>16,t>>8&255,255&t)}function ie(t){return ae(t)+""}Kt.brighter=function(t){return new Xt(Math.min(100,this.l+Jt*(arguments.length?t:1)),this.a,this.b)},Kt.darker=function(t){return new Xt(Math.max(0,this.l-Jt*(arguments.length?t:1)),this.a,this.b)},Kt.rgb=function(){return Qt(this.l,this.a,this.b)},t.rgb=ne;var oe=ne.prototype=new Ut;function se(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function le(t,e,r){var n,a,i,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(a=n[2].split(","),n[1]){case"hsl":return r(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return e(fe(a[0]),fe(a[1]),fe(a[2]))}return(i=pe.get(t))?e(i.r,i.g,i.b):(null==t||"#"!==t.charAt(0)||isNaN(i=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&i)>>4,o|=o>>4,s=240&i,s|=s>>4,l=15&i,l|=l<<4):7===t.length&&(o=(16711680&i)>>16,s=(65280&i)>>8,l=255&i)),e(o,s,l))}function ce(t,e,r){var n,a,i=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-i,l=(o+i)/2;return s?(a=l<.5?s/(o+i):s/(2-o-i),n=t==o?(e-r)/s+(e<r?6:0):e==o?(r-t)/s+2:(t-e)/s+4,n*=60):(n=NaN,a=l>0&&l<1?0:n),new qt(n,a,l)}function ue(t,e,r){var n=ee((.4124564*(t=he(t))+.3575761*(e=he(e))+.1804375*(r=he(r)))/.95047),a=ee((.2126729*t+.7151522*e+.072175*r)/1);return Xt(116*a-16,500*(n-a),200*(a-ee((.0193339*t+.119192*e+.9503041*r)/1.08883)))}function he(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function fe(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}oe.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,a=30;return e||r||n?(e&&e<a&&(e=a),r&&r<a&&(r=a),n&&n<a&&(n=a),new ne(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new ne(a,a,a)},oe.darker=function(t){return new ne((t=Math.pow(.7,arguments.length?t:1))*this.r,t*this.g,t*this.b)},oe.hsl=function(){return ce(this.r,this.g,this.b)},oe.toString=function(){return"#"+se(this.r)+se(this.g)+se(this.b)};var pe=t.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});function de(t){return"function"==typeof t?t:function(){return t}}function ge(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),me(e,r,t,n)}}function me(e,r,a,i){var o={},s=t.dispatch("beforesend","progress","load","error"),l={},c=new XMLHttpRequest,u=null;function h(){var t,e=c.status;if(!e&&function(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}(c)||e>=200&&e<300||304===e){try{t=a.call(o,c)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,c)}return this.XDomainRequest&&!("withCredentials"in c)&&/^(http(s)?:)?\/\//.test(e)&&(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=h:c.onreadystatechange=function(){c.readyState>3&&h()},c.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,c)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(u=t,o):u},o.response=function(t){return a=t,o},["get","post"].forEach((function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}})),o.send=function(t,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),c.open(t,e,!0),null==r||"accept"in l||(l.accept=r+",*/*"),c.setRequestHeader)for(var i in l)c.setRequestHeader(i,l[i]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),null!=a&&o.on("error",a).on("load",(function(t){a(null,t)})),s.beforesend.call(o,c),c.send(null==n?null:n),o},o.abort=function(){return c.abort(),o},t.rebind(o,s,"on"),null==i?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(i))}pe.forEach((function(t,e){pe.set(t,ae(e))})),t.functor=de,t.xhr=ge(L),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function a(t,r,n){arguments.length<3&&(n=r,r=null);var a=me(t,e,null==r?i:o(r),n);return a.row=function(t){return arguments.length?a.response(null==(r=t)?i:o(t)):r},a}function i(t){return a.parse(t.responseText)}function o(t){return function(e){return a.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return a.parse=function(t,e){var r;return a.parseRows(t,(function(t,n){if(r)return r(t,n-1);var a=new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+"]"})).join(",")+"}");r=e?function(t,r){return e(a(t),r)}:a}))},a.parseRows=function(t,e){var r,a,i={},o={},s=[],l=t.length,c=0,u=0;function h(){if(c>=l)return o;if(a)return a=!1,i;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++<l;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}return c=r+2,13===(s=t.charCodeAt(r+1))?(a=!0,10===t.charCodeAt(r+2)&&++c):10===s&&(a=!0),t.slice(e+1,r).replace(/""/g,'"')}for(;c<l;){var s,u=1;if(10===(s=t.charCodeAt(c++)))a=!0;else if(13===s)a=!0,10===t.charCodeAt(c)&&(++c,++u);else if(s!==n)continue;return t.slice(e,c-u)}return t.slice(e)}for(;(r=h())!==o;){for(var f=[];r!==i&&r!==o;)f.push(r),r=h();e&&null==(f=e(f,u++))||s.push(f)}return s},a.format=function(e){if(Array.isArray(e[0]))return a.formatRows(e);var r=new C,n=[];return e.forEach((function(t){for(var e in t)r.has(e)||n.push(r.add(e))})),[n.map(l).join(t)].concat(e.map((function(e){return n.map((function(t){return l(e[t])})).join(t)}))).join("\n")},a.formatRows=function(t){return t.map(s).join("\n")},a},t.csv=t.dsv(",","text/csv"),t.tsv=t.dsv("\t","text/tab-separated-values");var ve,ye,xe,be,_e=this[I(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};function we(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var a=r+e,i={c:t,t:a,n:null};return ye?ye.n=i:ve=i,ye=i,xe||(be=clearTimeout(be),xe=1,_e(Te)),i}function Te(){var t=ke(),e=Ae()-t;e>24?(isFinite(e)&&(clearTimeout(be),be=setTimeout(Te,e)),xe=0):(xe=1,_e(Te))}function ke(){for(var t=Date.now(),e=ve;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Ae(){for(var t,e=ve,r=1/0;e;)e.c?(e.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:ve=e.n;return ye=t,r}function Me(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}t.timer=function(){we.apply(this,arguments)},t.timer.flush=function(){ke(),Ae()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var Se=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map((function(t,e){var r=Math.pow(10,3*y(8-e));return{scale:e>8?function(t){return t/r}:function(t){return t*r},symbol:t}}));function Ee(e){var r=e.decimal,n=e.thousands,a=e.grouping,i=e.currency,o=a&&n?function(t,e){for(var r=t.length,i=[],o=0,s=a[0],l=0;r>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),i.push(t.substring(r-=s,r+s)),!((l+=s+1)>e));)s=a[o=(o+1)%a.length];return i.reverse().join(n)}:L;return function(e){var n=Ce.exec(e),a=n[1]||" ",s=n[2]||">",l=n[3]||"-",c=n[4]||"",u=n[5],h=+n[6],f=n[7],p=n[8],d=n[9],g=1,m="",v="",y=!1,x=!0;switch(p&&(p=+p.substring(1)),(u||"0"===a&&"="===s)&&(u=a="0",s="="),d){case"n":f=!0,d="g";break;case"%":g=100,v="%",d="f";break;case"p":g=100,v="%",d="r";break;case"b":case"o":case"x":case"X":"#"===c&&(m="0"+d.toLowerCase());case"c":x=!1;case"d":y=!0,p=0;break;case"s":g=-1,d="r"}"$"===c&&(m=i[0],v=i[1]),"r"!=d||p||(d="g"),null!=p&&("g"==d?p=Math.max(1,Math.min(21,p)):"e"!=d&&"f"!=d||(p=Math.max(0,Math.min(20,p)))),d=Le.get(d)||Pe;var b=u&&f;return function(e){var n=v;if(y&&e%1)return"";var i=e<0||0===e&&1/e<0?(e=-e,"-"):"-"===l?"":l;if(g<0){var c=t.formatPrefix(e,p);e=c.scale(e),n=c.symbol+v}else e*=g;var _,w,T=(e=d(e,p)).lastIndexOf(".");if(T<0){var k=x?e.lastIndexOf("e"):-1;k<0?(_=e,w=""):(_=e.substring(0,k),w=e.substring(k))}else _=e.substring(0,T),w=r+e.substring(T+1);!u&&f&&(_=o(_,1/0));var A=m.length+_.length+w.length+(b?0:i.length),M=A<h?new Array(A=h-A+1).join(a):"";return b&&(_=o(M+_,M.length?h-w.length:1/0)),i+=m,e=_+w,("<"===s?i+e+M:">"===s?M+i+e:"^"===s?M.substring(0,A>>=1)+i+e+M.substring(A):i+(b?e:M+e))+n}}}t.formatPrefix=function(e,r){var n=0;return(e=+e)&&(e<0&&(e*=-1),r&&(e=t.round(e,Me(e,r))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Se[8+n/3]};var Ce=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Le=t.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(e,r){return(e=t.round(e,Me(e,r))).toFixed(Math.max(0,Math.min(20,Me(e*(1+1e-15),r))))}});function Pe(t){return t+""}var Ie=t.time={},ze=Date;function Oe(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Oe.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){De.setUTCDate.apply(this._,arguments)},setDay:function(){De.setUTCDay.apply(this._,arguments)},setFullYear:function(){De.setUTCFullYear.apply(this._,arguments)},setHours:function(){De.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){De.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){De.setUTCMinutes.apply(this._,arguments)},setMonth:function(){De.setUTCMonth.apply(this._,arguments)},setSeconds:function(){De.setUTCSeconds.apply(this._,arguments)},setTime:function(){De.setTime.apply(this._,arguments)}};var De=Date.prototype;function Re(t,e,r){function n(e){var r=t(e),n=i(r,1);return e-r<n-e?r:n}function a(r){return e(r=t(new ze(r-1)),1),r}function i(t,r){return e(t=new ze(+t),r),t}function o(t,n,i){var o=a(t),s=[];if(i>1)for(;o<n;)r(o)%i||s.push(new Date(+o)),e(o,1);else for(;o<n;)s.push(new Date(+o)),e(o,1);return s}t.floor=t,t.round=n,t.ceil=a,t.offset=i,t.range=o;var s=t.utc=Fe(t);return s.floor=s,s.round=Fe(n),s.ceil=Fe(a),s.offset=Fe(i),s.range=function(t,e,r){try{ze=Oe;var n=new Oe;return n._=t,o(n,e,r)}finally{ze=Date}},t}function Fe(t){return function(e,r){try{ze=Oe;var n=new Oe;return n._=e,t(n,r)._}finally{ze=Date}}}function Be(e){var r=e.dateTime,n=e.date,a=e.time,i=e.periods,o=e.days,s=e.shortDays,l=e.months,c=e.shortMonths;function u(t){var e=t.length;function r(r){for(var n,a,i,o=[],s=-1,l=0;++s<e;)37===t.charCodeAt(s)&&(o.push(t.slice(l,s)),null!=(a=Ne[n=t.charAt(++s)])&&(n=t.charAt(++s)),(i=_[n])&&(n=i(r,null==a?"e"===n?" ":"0":a)),o.push(n),l=s+1);return o.push(t.slice(l,s)),o.join("")}return r.parse=function(e){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(h(r,t,e,0)!=e.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var n=null!=r.Z&&ze!==Oe,a=new(n?Oe:ze);return"j"in r?a.setFullYear(r.y,0,r.j):"W"in r||"U"in r?("w"in r||(r.w="W"in r?1:0),a.setFullYear(r.y,0,1),a.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(a.getDay()+5)%7:r.w+7*r.U-(a.getDay()+6)%7)):a.setFullYear(r.y,r.m,r.d),a.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),n?a._:a},r.toString=function(){return t},r}function h(t,e,r,n){for(var a,i,o,s=0,l=e.length,c=r.length;s<l;){if(n>=c)return-1;if(37===(a=e.charCodeAt(s++))){if(o=e.charAt(s++),!(i=w[o in Ne?e.charAt(s++):o])||(n=i(t,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}u.utc=function(t){var e=u(t);function r(t){try{var r=new(ze=Oe);return r._=t,e(r)}finally{ze=Date}}return r.parse=function(t){try{ze=Oe;var r=e.parse(t);return r&&r._}finally{ze=Date}},r.toString=e.toString,r},u.multi=u.utc.multi=or;var f=t.map(),p=qe(o),d=He(o),g=qe(s),m=He(s),v=qe(l),y=He(l),x=qe(c),b=He(c);i.forEach((function(t,e){f.set(t.toLowerCase(),e)}));var _={a:function(t){return s[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return l[t.getMonth()]},c:u(r),d:function(t,e){return Ue(t.getDate(),e,2)},e:function(t,e){return Ue(t.getDate(),e,2)},H:function(t,e){return Ue(t.getHours(),e,2)},I:function(t,e){return Ue(t.getHours()%12||12,e,2)},j:function(t,e){return Ue(1+Ie.dayOfYear(t),e,3)},L:function(t,e){return Ue(t.getMilliseconds(),e,3)},m:function(t,e){return Ue(t.getMonth()+1,e,2)},M:function(t,e){return Ue(t.getMinutes(),e,2)},p:function(t){return i[+(t.getHours()>=12)]},S:function(t,e){return Ue(t.getSeconds(),e,2)},U:function(t,e){return Ue(Ie.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Ue(Ie.mondayOfYear(t),e,2)},x:u(n),X:u(a),y:function(t,e){return Ue(t.getFullYear()%100,e,2)},Y:function(t,e){return Ue(t.getFullYear()%1e4,e,4)},Z:ar,"%":function(){return"%"}},w={a:function(t,e,r){g.lastIndex=0;var n=g.exec(e.slice(r));return n?(t.w=m.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){p.lastIndex=0;var n=p.exec(e.slice(r));return n?(t.w=d.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){x.lastIndex=0;var n=x.exec(e.slice(r));return n?(t.m=b.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){v.lastIndex=0;var n=v.exec(e.slice(r));return n?(t.m=y.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,r){return h(t,_.c.toString(),e,r)},d:Qe,e:Qe,H:tr,I:tr,j:$e,L:nr,m:Ke,M:er,p:function(t,e,r){var n=f.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:rr,U:Ye,w:Ge,W:We,x:function(t,e,r){return h(t,_.x.toString(),e,r)},X:function(t,e,r){return h(t,_.X.toString(),e,r)},y:Xe,Y:Ze,Z:Je,"%":ir};return u}Ie.year=Re((function(t){return(t=Ie.day(t)).setMonth(0,1),t}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t){return t.getFullYear()})),Ie.years=Ie.year.range,Ie.years.utc=Ie.year.utc.range,Ie.day=Re((function(t){var e=new ze(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t){return t.getDate()-1})),Ie.days=Ie.day.range,Ie.days.utc=Ie.day.utc.range,Ie.dayOfYear=function(t){var e=Ie.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach((function(t,e){e=7-e;var r=Ie[t]=Re((function(t){return(t=Ie.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t}),(function(t,e){t.setDate(t.getDate()+7*Math.floor(e))}),(function(t){var r=Ie.year(t).getDay();return Math.floor((Ie.dayOfYear(t)+(r+e)%7)/7)-(r!==e)}));Ie[t+"s"]=r.range,Ie[t+"s"].utc=r.utc.range,Ie[t+"OfYear"]=function(t){var r=Ie.year(t).getDay();return Math.floor((Ie.dayOfYear(t)+(r+e)%7)/7)}})),Ie.week=Ie.sunday,Ie.weeks=Ie.sunday.range,Ie.weeks.utc=Ie.sunday.utc.range,Ie.weekOfYear=Ie.sundayOfYear;var Ne={"-":"",_:" ",0:"0"},je=/^\s*\d+/,Ve=/^%/;function Ue(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",i=a.length;return n+(i<r?new Array(r-i+1).join(e)+a:a)}function qe(e){return new RegExp("^(?:"+e.map(t.requote).join("|")+")","i")}function He(t){for(var e=new _,r=-1,n=t.length;++r<n;)e.set(t[r].toLowerCase(),r);return e}function Ge(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Ye(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r));return n?(t.U=+n[0],r+n[0].length):-1}function We(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r));return n?(t.W=+n[0],r+n[0].length):-1}function Ze(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Xe(t,e,r){je.lastIndex=0;var n,a=je.exec(e.slice(r,r+2));return a?(t.y=(n=+a[0])+(n>68?1900:2e3),r+a[0].length):-1}function Je(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Ke(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Qe(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function $e(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function tr(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function er(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function rr(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function nr(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function ar(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=y(e)/60|0,a=y(e)%60;return r+Ue(n,"0",2)+Ue(a,"0",2)}function ir(t,e,r){Ve.lastIndex=0;var n=Ve.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function or(t){for(var e=t.length,r=-1;++r<e;)t[r][0]=this(t[r][0]);return function(e){for(var r=0,n=t[r];!n[1](e);)n=t[++r];return n[0](e)}}t.locale=function(t){return{numberFormat:Ee(t),timeFormat:Be(t)}};var sr=t.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function lr(){}t.format=sr.numberFormat,t.geo={},lr.prototype={s:0,t:0,add:function(t){ur(t,this.t,cr),ur(cr.s,this.s,this),this.s?this.t+=cr.t:this.s=cr.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var cr=new lr;function ur(t,e,r){var n=r.s=t+e,a=n-t,i=n-a;r.t=t-i+(e-a)}function hr(t,e){t&&pr.hasOwnProperty(t.type)&&pr[t.type](t,e)}t.geo.stream=function(t,e){t&&fr.hasOwnProperty(t.type)?fr[t.type](t,e):hr(t,e)};var fr={Feature:function(t,e){hr(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,a=r.length;++n<a;)hr(r[n].geometry,e)}},pr={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)t=r[n],e.point(t[0],t[1],t[2])},LineString:function(t,e){dr(t.coordinates,e,0)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)dr(r[n],e,0)},Polygon:function(t,e){gr(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)gr(r[n],e)},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,a=r.length;++n<a;)hr(r[n],e)}};function dr(t,e,r){var n,a=-1,i=t.length-r;for(e.lineStart();++a<i;)n=t[a],e.point(n[0],n[1],n[2]);e.lineEnd()}function gr(t,e){var r=-1,n=t.length;for(e.polygonStart();++r<n;)dr(t[r],e,1);e.polygonEnd()}t.geo.area=function(e){return mr=0,t.geo.stream(e,Cr),mr};var mr,vr,yr,xr,br,_r,wr,Tr,kr,Ar,Mr,Sr,Er=new lr,Cr={sphere:function(){mr+=4*Mt},point:O,lineStart:O,lineEnd:O,polygonStart:function(){Er.reset(),Cr.lineStart=Lr},polygonEnd:function(){var t=2*Er;mr+=t<0?4*Mt+t:t,Cr.lineStart=Cr.lineEnd=Cr.point=O}};function Lr(){var t,e,r,n,a;function i(t,e){e=e*Lt/2+Mt/4;var i=(t*=Lt)-r,o=i>=0?1:-1,s=o*i,l=Math.cos(e),c=Math.sin(e),u=a*c,h=n*l+u*Math.cos(s),f=u*o*Math.sin(s);Er.add(Math.atan2(f,h)),r=t,n=l,a=c}Cr.point=function(o,s){Cr.point=i,r=(t=o)*Lt,n=Math.cos(s=(e=s)*Lt/2+Mt/4),a=Math.sin(s)},Cr.lineEnd=function(){i(t,e)}}function Pr(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function Ir(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function zr(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 Or(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Dr(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Rr(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Fr(t){return[Math.atan2(t[1],t[0]),Dt(t[2])]}function Br(t,e){return y(t[0]-e[0])<kt&&y(t[1]-e[1])<kt}t.geo.bounds=function(){var e,r,n,a,i,o,s,l,c,u,h,f={point:p,lineStart:g,lineEnd:m,polygonStart:function(){f.point=v,f.lineStart=x,f.lineEnd=b,c=0,Cr.polygonStart()},polygonEnd:function(){Cr.polygonEnd(),f.point=p,f.lineStart=g,f.lineEnd=m,Er<0?(e=-(n=180),r=-(a=90)):c>kt?a=90:c<-kt&&(r=-90),h[0]=e,h[1]=n}};function p(t,i){u.push(h=[e=t,n=t]),i<r&&(r=i),i>a&&(a=i)}function d(t,o){var s=Pr([t*Lt,o*Lt]);if(l){var c=zr(l,s),u=zr([c[1],-c[0],0],c);Rr(u),u=Fr(u);var h=t-i,f=h>0?1:-1,d=u[0]*Pt*f,g=y(h)>180;if(g^(f*i<d&&d<f*t))(m=u[1]*Pt)>a&&(a=m);else if(g^(f*i<(d=(d+360)%360-180)&&d<f*t)){var m;(m=-u[1]*Pt)<r&&(r=m)}else o<r&&(r=o),o>a&&(a=o);g?t<i?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t):n>=e?(t<e&&(e=t),t>n&&(n=t)):t>i?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t)}else p(t,o);l=s,i=t}function g(){f.point=d}function m(){h[0]=e,h[1]=n,f.point=p,l=null}function v(t,e){if(l){var r=t-i;c+=y(r)>180?r+(r>0?360:-360):r}else o=t,s=e;Cr.point(t,e),d(t,e)}function x(){Cr.lineStart()}function b(){v(o,s),Cr.lineEnd(),y(c)>kt&&(e=-(n=180)),h[0]=e,h[1]=n,l=null}function _(t,e){return(e-=t)<0?e+360:e}function w(t,e){return t[0]-e[0]}function T(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}return function(i){if(a=n=-(e=r=1/0),u=[],t.geo.stream(i,f),c=u.length){u.sort(w);for(var o=1,s=[g=u[0]];o<c;++o)T((p=u[o])[0],g)||T(p[1],g)?(_(g[0],p[1])>_(g[0],g[1])&&(g[1]=p[1]),_(p[0],g[1])>_(g[0],g[1])&&(g[0]=p[0])):s.push(g=p);for(var l,c,p,d=-1/0,g=(o=0,s[c=s.length-1]);o<=c;g=p,++o)p=s[o],(l=_(g[1],p[0]))>d&&(d=l,e=p[0],n=g[1])}return u=h=null,e===1/0||r===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,r],[n,a]]}}(),t.geo.centroid=function(e){vr=yr=xr=br=_r=wr=Tr=kr=Ar=Mr=Sr=0,t.geo.stream(e,Nr);var r=Ar,n=Mr,a=Sr,i=r*r+n*n+a*a;return i<At&&(r=wr,n=Tr,a=kr,yr<kt&&(r=xr,n=br,a=_r),(i=r*r+n*n+a*a)<At)?[NaN,NaN]:[Math.atan2(n,r)*Pt,Dt(a/Math.sqrt(i))*Pt]};var Nr={sphere:O,point:jr,lineStart:Ur,lineEnd:qr,polygonStart:function(){Nr.lineStart=Hr},polygonEnd:function(){Nr.lineStart=Ur}};function jr(t,e){t*=Lt;var r=Math.cos(e*=Lt);Vr(r*Math.cos(t),r*Math.sin(t),Math.sin(e))}function Vr(t,e,r){++vr,xr+=(t-xr)/vr,br+=(e-br)/vr,_r+=(r-_r)/vr}function Ur(){var t,e,r;function n(n,a){n*=Lt;var i=Math.cos(a*=Lt),o=i*Math.cos(n),s=i*Math.sin(n),l=Math.sin(a),c=Math.atan2(Math.sqrt((c=e*l-r*s)*c+(c=r*o-t*l)*c+(c=t*s-e*o)*c),t*o+e*s+r*l);yr+=c,wr+=c*(t+(t=o)),Tr+=c*(e+(e=s)),kr+=c*(r+(r=l)),Vr(t,e,r)}Nr.point=function(a,i){a*=Lt;var o=Math.cos(i*=Lt);t=o*Math.cos(a),e=o*Math.sin(a),r=Math.sin(i),Nr.point=n,Vr(t,e,r)}}function qr(){Nr.point=jr}function Hr(){var t,e,r,n,a;function i(t,e){t*=Lt;var i=Math.cos(e*=Lt),o=i*Math.cos(t),s=i*Math.sin(t),l=Math.sin(e),c=n*l-a*s,u=a*o-r*l,h=r*s-n*o,f=Math.sqrt(c*c+u*u+h*h),p=r*o+n*s+a*l,d=f&&-Ot(p)/f,g=Math.atan2(f,p);Ar+=d*c,Mr+=d*u,Sr+=d*h,yr+=g,wr+=g*(r+(r=o)),Tr+=g*(n+(n=s)),kr+=g*(a+(a=l)),Vr(r,n,a)}Nr.point=function(o,s){t=o,e=s,Nr.point=i,o*=Lt;var l=Math.cos(s*=Lt);r=l*Math.cos(o),n=l*Math.sin(o),a=Math.sin(s),Vr(r,n,a)},Nr.lineEnd=function(){i(t,e),Nr.lineEnd=qr,Nr.point=jr}}function Gr(t,e){function r(r,n){return r=t(r,n),e(r[0],r[1])}return t.invert&&e.invert&&(r.invert=function(r,n){return(r=e.invert(r,n))&&t.invert(r[0],r[1])}),r}function Yr(){return!0}function Wr(t,e,r,n,a){var i=[],o=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,r=t[0],n=t[e];if(Br(r,n)){a.lineStart();for(var s=0;s<e;++s)a.point((r=t[s])[0],r[1]);a.lineEnd()}else{var l=new Xr(r,t,null,!0),c=new Xr(r,null,l,!1);l.o=c,i.push(l),o.push(c),l=new Xr(n,t,null,!1),c=new Xr(n,null,l,!0),l.o=c,i.push(l),o.push(c)}}})),o.sort(e),Zr(i),Zr(o),i.length){for(var s=0,l=r,c=o.length;s<c;++s)o[s].e=l=!l;for(var u,h,f=i[0];;){for(var p=f,d=!0;p.v;)if((p=p.n)===f)return;u=p.z,a.lineStart();do{if(p.v=p.o.v=!0,p.e){if(d)for(s=0,c=u.length;s<c;++s)a.point((h=u[s])[0],h[1]);else n(p.x,p.n.x,1,a);p=p.n}else{if(d)for(s=(u=p.p.z).length-1;s>=0;--s)a.point((h=u[s])[0],h[1]);else n(p.x,p.p.x,-1,a);p=p.p}u=(p=p.o).z,d=!d}while(!p.v);a.lineEnd()}}}function Zr(t){if(e=t.length){for(var e,r,n=0,a=t[0];++n<e;)a.n=r=t[n],r.p=a,a=r;a.n=r=t[0],r.p=a}}function Xr(t,e,r,n){this.x=t,this.z=e,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function Jr(e,r,n,a){return function(i,o){var s,l=r(o),c=i.invert(a[0],a[1]),u={point:h,lineStart:p,lineEnd:d,polygonStart:function(){u.point=b,u.lineStart=_,u.lineEnd=w,s=[],g=[]},polygonEnd:function(){u.point=h,u.lineStart=p,u.lineEnd=d,s=t.merge(s);var e=function(t,e){var r=t[0],n=t[1],a=[Math.sin(r),-Math.cos(r),0],i=0,o=0;Er.reset();for(var s=0,l=e.length;s<l;++s){var c=e[s],u=c.length;if(u)for(var h=c[0],f=h[0],p=h[1]/2+Mt/4,d=Math.sin(p),g=Math.cos(p),m=1;;){m===u&&(m=0);var v=(t=c[m])[0],y=t[1]/2+Mt/4,x=Math.sin(y),b=Math.cos(y),_=v-f,w=_>=0?1:-1,T=w*_,k=T>Mt,A=d*x;if(Er.add(Math.atan2(A*w*Math.sin(T),g*b+A*Math.cos(T))),i+=k?_+w*St:_,k^f>=r^v>=r){var M=zr(Pr(h),Pr(t));Rr(M);var S=zr(a,M);Rr(S);var E=(k^_>=0?-1:1)*Dt(S[2]);(n>E||n===E&&(M[0]||M[1]))&&(o+=k^_>=0?1:-1)}if(!m++)break;f=v,d=x,g=b,h=t}}return(i<-kt||i<kt&&Er<-kt)^1&o}(c,g);s.length?(x||(o.polygonStart(),x=!0),Wr(s,$r,e,n,o)):e&&(x||(o.polygonStart(),x=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),x&&(o.polygonEnd(),x=!1),s=g=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function h(t,r){var n=i(t,r);e(t=n[0],r=n[1])&&o.point(t,r)}function f(t,e){var r=i(t,e);l.point(r[0],r[1])}function p(){u.point=f,l.lineStart()}function d(){u.point=h,l.lineEnd()}var g,m,v=Qr(),y=r(v),x=!1;function b(t,e){m.push([t,e]);var r=i(t,e);y.point(r[0],r[1])}function _(){y.lineStart(),m=[]}function w(){b(m[0][0],m[0][1]),y.lineEnd();var t,e=y.clean(),r=v.buffer(),n=r.length;if(m.pop(),g.push(m),m=null,n)if(1&e){var a,i=-1;if((n=(t=r[0]).length-1)>0){for(x||(o.polygonStart(),x=!0),o.lineStart();++i<n;)o.point((a=t[i])[0],a[1]);o.lineEnd()}}else n>1&&2&e&&r.push(r.pop().concat(r.shift())),s.push(r.filter(Kr))}return u}}function Kr(t){return t.length>1}function Qr(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:O,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function $r(t,e){return((t=t.x)[0]<0?t[1]-Ct-kt:Ct-t[1])-((e=e.x)[0]<0?e[1]-Ct-kt:Ct-e[1])}var tn=Jr(Yr,(function(t){var e,r=NaN,n=NaN,a=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(i,o){var s=i>0?Mt:-Mt,l=y(i-r);y(l-Mt)<kt?(t.point(r,n=(n+o)/2>0?Ct:-Ct),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(i,n),e=0):a!==s&&l>=Mt&&(y(r-a)<kt&&(r-=a*kt),y(i-s)<kt&&(i-=s*kt),n=function(t,e,r,n){var a,i,o=Math.sin(t-r);return y(o)>kt?Math.atan((Math.sin(e)*(i=Math.cos(n))*Math.sin(r)-Math.sin(n)*(a=Math.cos(e))*Math.sin(t))/(a*i*o)):(e+n)/2}(r,n,i,o),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=i,n=o),a=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}),(function(t,e,r,n){var a;if(null==t)a=r*Ct,n.point(-Mt,a),n.point(0,a),n.point(Mt,a),n.point(Mt,0),n.point(Mt,-a),n.point(0,-a),n.point(-Mt,-a),n.point(-Mt,0),n.point(-Mt,a);else if(y(t[0]-e[0])>kt){var i=t[0]<e[0]?Mt:-Mt;a=r*i/2,n.point(-i,a),n.point(0,a),n.point(i,a)}else n.point(e[0],e[1])}),[-Mt,-Mt/2]);function en(t){var e=Math.cos(t),r=e>0,n=y(e)>kt;return Jr(a,(function(t){var e,s,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(h,f){var p,d=[h,f],g=a(h,f),m=r?g?0:o(h,f):g?o(h+(h<0?Mt:-Mt),f):0;if(!e&&(c=l=g)&&t.lineStart(),g!==l&&(p=i(e,d),(Br(e,p)||Br(d,p))&&(d[0]+=kt,d[1]+=kt,g=a(d[0],d[1]))),g!==l)u=0,g?(t.lineStart(),p=i(d,e),t.point(p[0],p[1])):(p=i(e,d),t.point(p[0],p[1]),t.lineEnd()),e=p;else if(n&&e&&r^g){var v;m&s||!(v=i(d,e,!0))||(u=0,r?(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])))}!g||e&&Br(e,d)||t.point(d[0],d[1]),e=d,l=g,s=m},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return u|(c&&l)<<1}}}),Bn(t,6*Lt),r?[0,-t]:[-Mt,t-Mt]);function a(t,r){return Math.cos(t)*Math.cos(r)>e}function i(t,r,n){var a=[1,0,0],i=zr(Pr(t),Pr(r)),o=Ir(i,i),s=i[0],l=o-s*s;if(!l)return!n&&t;var c=e*o/l,u=-e*s/l,h=zr(a,i),f=Dr(a,c);Or(f,Dr(i,u));var p=h,d=Ir(f,p),g=Ir(p,p),m=d*d-g*(Ir(f,f)-1);if(!(m<0)){var v=Math.sqrt(m),x=Dr(p,(-d-v)/g);if(Or(x,f),x=Fr(x),!n)return x;var b,_=t[0],w=r[0],T=t[1],k=r[1];w<_&&(b=_,_=w,w=b);var A=w-_,M=y(A-Mt)<kt;if(!M&&k<T&&(b=T,T=k,k=b),M||A<kt?M?T+k>0^x[1]<(y(x[0]-_)<kt?T:k):T<=x[1]&&x[1]<=k:A>Mt^(_<=x[0]&&x[0]<=w)){var S=Dr(p,(-d+v)/g);return Or(S,f),[x,Fr(S)]}}}function o(e,n){var a=r?t:Mt-t,i=0;return e<-a?i|=1:e>a&&(i|=2),n<-a?i|=4:n>a&&(i|=8),i}}function rn(t,e,r,n){return function(a){var i,o=a.a,s=a.b,l=o.x,c=o.y,u=0,h=1,f=s.x-l,p=s.y-c;if(i=t-l,f||!(i>0)){if(i/=f,f<0){if(i<u)return;i<h&&(h=i)}else if(f>0){if(i>h)return;i>u&&(u=i)}if(i=r-l,f||!(i<0)){if(i/=f,f<0){if(i>h)return;i>u&&(u=i)}else if(f>0){if(i<u)return;i<h&&(h=i)}if(i=e-c,p||!(i>0)){if(i/=p,p<0){if(i<u)return;i<h&&(h=i)}else if(p>0){if(i>h)return;i>u&&(u=i)}if(i=n-c,p||!(i<0)){if(i/=p,p<0){if(i>h)return;i>u&&(u=i)}else if(p>0){if(i<u)return;i<h&&(h=i)}return u>0&&(a.a={x:l+u*f,y:c+u*p}),h<1&&(a.b={x:l+h*f,y:c+h*p}),a}}}}}}function nn(e,r,n,a){return function(l){var c,u,h,f,p,d,g,m,v,y,x,b=l,_=Qr(),w=rn(e,r,n,a),T={point:M,lineStart:function(){T.point=S,u&&u.push(h=[]);y=!0,v=!1,g=m=NaN},lineEnd:function(){c&&(S(f,p),d&&v&&_.rejoin(),c.push(_.buffer()));T.point=M,v&&l.lineEnd()},polygonStart:function(){l=_,c=[],u=[],x=!0},polygonEnd:function(){l=b,c=t.merge(c);var r=function(t){for(var e=0,r=u.length,n=t[1],a=0;a<r;++a)for(var i,o=1,s=u[a],l=s.length,c=s[0];o<l;++o)i=s[o],c[1]<=n?i[1]>n&&zt(c,i,t)>0&&++e:i[1]<=n&&zt(c,i,t)<0&&--e,c=i;return 0!==e}([e,a]),n=x&&r,i=c.length;(n||i)&&(l.polygonStart(),n&&(l.lineStart(),k(null,null,1,l),l.lineEnd()),i&&Wr(c,o,r,k,l),l.polygonEnd()),c=u=h=null}};function k(t,o,l,c){var u=0,h=0;if(null==t||(u=i(t,l))!==(h=i(o,l))||s(t,o)<0^l>0)do{c.point(0===u||3===u?e:n,u>1?a:r)}while((u=(u+l+4)%4)!==h);else c.point(o[0],o[1])}function A(t,i){return e<=t&&t<=n&&r<=i&&i<=a}function M(t,e){A(t,e)&&l.point(t,e)}function S(t,e){var r=A(t=Math.max(-1e9,Math.min(1e9,t)),e=Math.max(-1e9,Math.min(1e9,e)));if(u&&h.push([t,e]),y)f=t,p=e,d=r,y=!1,r&&(l.lineStart(),l.point(t,e));else if(r&&v)l.point(t,e);else{var n={a:{x:g,y:m},b:{x:t,y:e}};w(n)?(v||(l.lineStart(),l.point(n.a.x,n.a.y)),l.point(n.b.x,n.b.y),r||l.lineEnd(),x=!1):r&&(l.lineStart(),l.point(t,e),x=!1)}g=t,m=e,v=r}return T};function i(t,a){return y(t[0]-e)<kt?a>0?0:3:y(t[0]-n)<kt?a>0?2:1:y(t[1]-r)<kt?a>0?1:0:a>0?3:2}function o(t,e){return s(t.x,e.x)}function s(t,e){var r=i(t,1),n=i(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}}function an(t){var e=0,r=Mt/3,n=Ln(t),a=n(e,r);return a.parallels=function(t){return arguments.length?n(e=t[0]*Mt/180,r=t[1]*Mt/180):[e/Mt*180,r/Mt*180]},a}function on(t,e){var r=Math.sin(t),n=(r+Math.sin(e))/2,a=1+r*(2*n-r),i=Math.sqrt(a)/n;function o(t,e){var r=Math.sqrt(a-2*n*Math.sin(e))/n;return[r*Math.sin(t*=n),i-r*Math.cos(t)]}return o.invert=function(t,e){var r=i-e;return[Math.atan2(t,r)/n,Dt((a-(t*t+r*r)*n*n)/(2*n))]},o}t.geo.clipExtent=function(){var t,e,r,n,a,i,o={stream:function(t){return a&&(a.valid=!1),(a=i(t)).valid=!0,a},extent:function(s){return arguments.length?(i=nn(t=+s[0][0],e=+s[0][1],r=+s[1][0],n=+s[1][1]),a&&(a.valid=!1,a=null),o):[[t,e],[r,n]]}};return o.extent([[0,0],[960,500]])},(t.geo.conicEqualArea=function(){return an(on)}).raw=on,t.geo.albers=function(){return t.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},t.geo.albersUsa=function(){var e,r,n,a,i=t.geo.albers(),o=t.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=t.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,r){e=[t,r]}};function c(t){var i=t[0],o=t[1];return e=null,r(i,o),e||(n(i,o),e)||a(i,o),e}return c.invert=function(t){var e=i.scale(),r=i.translate(),n=(t[0]-r[0])/e,a=(t[1]-r[1])/e;return(a>=.12&&a<.234&&n>=-.425&&n<-.214?o:a>=.166&&a<.234&&n>=-.214&&n<-.115?s:i).invert(t)},c.stream=function(t){var e=i.stream(t),r=o.stream(t),n=s.stream(t);return{point:function(t,a){e.point(t,a),r.point(t,a),n.point(t,a)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},c.precision=function(t){return arguments.length?(i.precision(t),o.precision(t),s.precision(t),c):i.precision()},c.scale=function(t){return arguments.length?(i.scale(t),o.scale(.35*t),s.scale(t),c.translate(i.translate())):i.scale()},c.translate=function(t){if(!arguments.length)return i.translate();var e=i.scale(),u=+t[0],h=+t[1];return r=i.translate(t).clipExtent([[u-.455*e,h-.238*e],[u+.455*e,h+.238*e]]).stream(l).point,n=o.translate([u-.307*e,h+.201*e]).clipExtent([[u-.425*e+kt,h+.12*e+kt],[u-.214*e-kt,h+.234*e-kt]]).stream(l).point,a=s.translate([u-.205*e,h+.212*e]).clipExtent([[u-.214*e+kt,h+.166*e+kt],[u-.115*e-kt,h+.234*e-kt]]).stream(l).point,c},c.scale(1070)};var sn,ln,cn,un,hn,fn,pn={point:O,lineStart:O,lineEnd:O,polygonStart:function(){ln=0,pn.lineStart=dn},polygonEnd:function(){pn.lineStart=pn.lineEnd=pn.point=O,sn+=y(ln/2)}};function dn(){var t,e,r,n;function a(t,e){ln+=n*t-r*e,r=t,n=e}pn.point=function(i,o){pn.point=a,t=r=i,e=n=o},pn.lineEnd=function(){a(t,e)}}var gn={point:function(t,e){t<cn&&(cn=t);t>hn&&(hn=t);e<un&&(un=e);e>fn&&(fn=e)},lineStart:O,lineEnd:O,polygonStart:O,polygonEnd:O};function mn(){var t=vn(4.5),e=[],r={point:n,lineStart:function(){r.point=a},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(e){return t=vn(e),r},result:function(){if(e.length){var t=e.join("");return e=[],t}}};function n(r,n){e.push("M",r,",",n,t)}function a(t,n){e.push("M",t,",",n),r.point=i}function i(t,r){e.push("L",t,",",r)}function o(){r.point=n}function s(){e.push("Z")}return r}function vn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}var yn,xn={point:bn,lineStart:_n,lineEnd:wn,polygonStart:function(){xn.lineStart=Tn},polygonEnd:function(){xn.point=bn,xn.lineStart=_n,xn.lineEnd=wn}};function bn(t,e){xr+=t,br+=e,++_r}function _n(){var t,e;function r(r,n){var a=r-t,i=n-e,o=Math.sqrt(a*a+i*i);wr+=o*(t+r)/2,Tr+=o*(e+n)/2,kr+=o,bn(t=r,e=n)}xn.point=function(n,a){xn.point=r,bn(t=n,e=a)}}function wn(){xn.point=bn}function Tn(){var t,e,r,n;function a(t,e){var a=t-r,i=e-n,o=Math.sqrt(a*a+i*i);wr+=o*(r+t)/2,Tr+=o*(n+e)/2,kr+=o,Ar+=(o=n*t-r*e)*(r+t),Mr+=o*(n+e),Sr+=3*o,bn(r=t,n=e)}xn.point=function(i,o){xn.point=a,bn(t=r=i,e=n=o)},xn.lineEnd=function(){a(t,e)}}function kn(t){var e=4.5,r={point:n,lineStart:function(){r.point=a},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(t){return e=t,r},result:O};function n(r,n){t.moveTo(r+e,n),t.arc(r,n,e,0,St)}function a(e,n){t.moveTo(e,n),r.point=i}function i(e,r){t.lineTo(e,r)}function o(){r.point=n}function s(){t.closePath()}return r}function An(t){var e=.5,r=Math.cos(30*Lt),n=16;function a(t){return(n?o:i)(t)}function i(e){return En(e,(function(r,n){r=t(r,n),e.point(r[0],r[1])}))}function o(e){var r,a,i,o,l,c,u,h,f,p,d,g,m={point:v,lineStart:y,lineEnd:b,polygonStart:function(){e.polygonStart(),m.lineStart=_},polygonEnd:function(){e.polygonEnd(),m.lineStart=y}};function v(r,n){r=t(r,n),e.point(r[0],r[1])}function y(){h=NaN,m.point=x,e.lineStart()}function x(r,a){var i=Pr([r,a]),o=t(r,a);s(h,f,u,p,d,g,h=o[0],f=o[1],u=r,p=i[0],d=i[1],g=i[2],n,e),e.point(h,f)}function b(){m.point=v,e.lineEnd()}function _(){y(),m.point=w,m.lineEnd=T}function w(t,e){x(r=t,e),a=h,i=f,o=p,l=d,c=g,m.point=x}function T(){s(h,f,u,p,d,g,a,i,r,o,l,c,n,e),m.lineEnd=b,b()}return m}function s(n,a,i,o,l,c,u,h,f,p,d,g,m,v){var x=u-n,b=h-a,_=x*x+b*b;if(_>4*e&&m--){var w=o+p,T=l+d,k=c+g,A=Math.sqrt(w*w+T*T+k*k),M=Math.asin(k/=A),S=y(y(k)-1)<kt||y(i-f)<kt?(i+f)/2:Math.atan2(T,w),E=t(S,M),C=E[0],L=E[1],P=C-n,I=L-a,z=b*P-x*I;(z*z/_>e||y((x*P+b*I)/_-.5)>.3||o*p+l*d+c*g<r)&&(s(n,a,i,o,l,c,C,L,S,w/=A,T/=A,k,m,v),v.point(C,L),s(C,L,S,w,T,k,u,h,f,p,d,g,m,v))}}return a.precision=function(t){return arguments.length?(n=(e=t*t)>0&&16,a):Math.sqrt(e)},a}function Mn(t){var e=An((function(e,r){return t([e*Pt,r*Pt])}));return function(t){return Pn(e(t))}}function Sn(t){this.stream=t}function En(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 Cn(t){return Ln((function(){return t}))()}function Ln(e){var r,n,a,i,o,s,l=An((function(t,e){return[(t=r(t,e))[0]*c+i,o-t[1]*c]})),c=150,u=480,h=250,f=0,p=0,d=0,g=0,m=0,v=tn,y=L,x=null,b=null;function _(t){return[(t=a(t[0]*Lt,t[1]*Lt))[0]*c+i,o-t[1]*c]}function w(t){return(t=a.invert((t[0]-i)/c,(o-t[1])/c))&&[t[0]*Pt,t[1]*Pt]}function T(){a=Gr(n=On(d,g,m),r);var t=r(f,p);return i=u-t[0]*c,o=h+t[1]*c,k()}function k(){return s&&(s.valid=!1,s=null),_}return _.stream=function(t){return s&&(s.valid=!1),(s=Pn(v(n,l(y(t))))).valid=!0,s},_.clipAngle=function(t){return arguments.length?(v=null==t?(x=t,tn):en((x=+t)*Lt),k()):x},_.clipExtent=function(t){return arguments.length?(b=t,y=t?nn(t[0][0],t[0][1],t[1][0],t[1][1]):L,k()):b},_.scale=function(t){return arguments.length?(c=+t,T()):c},_.translate=function(t){return arguments.length?(u=+t[0],h=+t[1],T()):[u,h]},_.center=function(t){return arguments.length?(f=t[0]%360*Lt,p=t[1]%360*Lt,T()):[f*Pt,p*Pt]},_.rotate=function(t){return arguments.length?(d=t[0]%360*Lt,g=t[1]%360*Lt,m=t.length>2?t[2]%360*Lt:0,T()):[d*Pt,g*Pt,m*Pt]},t.rebind(_,l,"precision"),function(){return r=e.apply(this,arguments),_.invert=r.invert&&w,T()}}function Pn(t){return En(t,(function(e,r){t.point(e*Lt,r*Lt)}))}function In(t,e){return[t,e]}function zn(t,e){return[t>Mt?t-St:t<-Mt?t+St:t,e]}function On(t,e,r){return t?e||r?Gr(Rn(t),Fn(e,r)):Rn(t):e||r?Fn(e,r):zn}function Dn(t){return function(e,r){return[(e+=t)>Mt?e-St:e<-Mt?e+St:e,r]}}function Rn(t){var e=Dn(t);return e.invert=Dn(-t),e}function Fn(t,e){var r=Math.cos(t),n=Math.sin(t),a=Math.cos(e),i=Math.sin(e);function o(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,c=Math.sin(e),u=c*r+s*n;return[Math.atan2(l*a-u*i,s*r-c*n),Dt(u*a+l*i)]}return o.invert=function(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,c=Math.sin(e),u=c*a-l*i;return[Math.atan2(l*a+c*i,s*r+u*n),Dt(u*r-s*n)]},o}function Bn(t,e){var r=Math.cos(t),n=Math.sin(t);return function(a,i,o,s){var l=o*e;null!=a?(a=Nn(r,a),i=Nn(r,i),(o>0?a<i:a>i)&&(a+=o*St)):(a=t+o*St,i=t-.5*l);for(var c,u=a;o>0?u>i:u<i;u-=l)s.point((c=Fr([r,-n*Math.cos(u),-n*Math.sin(u)]))[0],c[1])}}function Nn(t,e){var r=Pr(e);r[0]-=t,Rr(r);var n=Ot(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-kt)%(2*Math.PI)}function jn(e,r,n){var a=t.range(e,r-kt,n).concat(r);return function(t){return a.map((function(e){return[t,e]}))}}function Vn(e,r,n){var a=t.range(e,r-kt,n).concat(r);return function(t){return a.map((function(e){return[e,t]}))}}function Un(t){return t.source}function qn(t){return t.target}t.geo.path=function(){var e,r,n,a,i,o=4.5;function s(e){return e&&("function"==typeof o&&a.pointRadius(+o.apply(this,arguments)),i&&i.valid||(i=n(a)),t.geo.stream(e,i)),a.result()}function l(){return i=null,s}return s.area=function(e){return sn=0,t.geo.stream(e,n(pn)),sn},s.centroid=function(e){return xr=br=_r=wr=Tr=kr=Ar=Mr=Sr=0,t.geo.stream(e,n(xn)),Sr?[Ar/Sr,Mr/Sr]:kr?[wr/kr,Tr/kr]:_r?[xr/_r,br/_r]:[NaN,NaN]},s.bounds=function(e){return hn=fn=-(cn=un=1/0),t.geo.stream(e,n(gn)),[[cn,un],[hn,fn]]},s.projection=function(t){return arguments.length?(n=(e=t)?t.stream||Mn(t):L,l()):e},s.context=function(t){return arguments.length?(a=null==(r=t)?new mn:new kn(t),"function"!=typeof o&&a.pointRadius(o),l()):r},s.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(a.pointRadius(+t),+t),s):o},s.projection(t.geo.albersUsa()).context(null)},t.geo.transform=function(t){return{stream:function(e){var r=new Sn(e);for(var n in t)r[n]=t[n];return r}}},Sn.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},t.geo.projection=Cn,t.geo.projectionMutator=Ln,(t.geo.equirectangular=function(){return Cn(In)}).raw=In.invert=In,t.geo.rotation=function(t){function e(e){return(e=t(e[0]*Lt,e[1]*Lt))[0]*=Pt,e[1]*=Pt,e}return t=On(t[0]%360*Lt,t[1]*Lt,t.length>2?t[2]*Lt:0),e.invert=function(e){return(e=t.invert(e[0]*Lt,e[1]*Lt))[0]*=Pt,e[1]*=Pt,e},e},zn.invert=In,t.geo.circle=function(){var t,e,r=[0,0],n=6;function a(){var t="function"==typeof r?r.apply(this,arguments):r,n=On(-t[0]*Lt,-t[1]*Lt,0).invert,a=[];return e(null,null,1,{point:function(t,e){a.push(t=n(t,e)),t[0]*=Pt,t[1]*=Pt}}),{type:"Polygon",coordinates:[a]}}return a.origin=function(t){return arguments.length?(r=t,a):r},a.angle=function(r){return arguments.length?(e=Bn((t=+r)*Lt,n*Lt),a):t},a.precision=function(r){return arguments.length?(e=Bn(t*Lt,(n=+r)*Lt),a):n},a.angle(90)},t.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Lt,a=t[1]*Lt,i=e[1]*Lt,o=Math.sin(n),s=Math.cos(n),l=Math.sin(a),c=Math.cos(a),u=Math.sin(i),h=Math.cos(i);return Math.atan2(Math.sqrt((r=h*o)*r+(r=c*u-l*h*s)*r),l*u+c*h*s)},t.geo.graticule=function(){var e,r,n,a,i,o,s,l,c,u,h,f,p=10,d=p,g=90,m=360,v=2.5;function x(){return{type:"MultiLineString",coordinates:b()}}function b(){return t.range(Math.ceil(a/g)*g,n,g).map(h).concat(t.range(Math.ceil(l/m)*m,s,m).map(f)).concat(t.range(Math.ceil(r/p)*p,e,p).filter((function(t){return y(t%g)>kt})).map(c)).concat(t.range(Math.ceil(o/d)*d,i,d).filter((function(t){return y(t%m)>kt})).map(u))}return x.lines=function(){return b().map((function(t){return{type:"LineString",coordinates:t}}))},x.outline=function(){return{type:"Polygon",coordinates:[h(a).concat(f(s).slice(1),h(n).reverse().slice(1),f(l).reverse().slice(1))]}},x.extent=function(t){return arguments.length?x.majorExtent(t).minorExtent(t):x.minorExtent()},x.majorExtent=function(t){return arguments.length?(a=+t[0][0],n=+t[1][0],l=+t[0][1],s=+t[1][1],a>n&&(t=a,a=n,n=t),l>s&&(t=l,l=s,s=t),x.precision(v)):[[a,l],[n,s]]},x.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],o=+t[0][1],i=+t[1][1],r>e&&(t=r,r=e,e=t),o>i&&(t=o,o=i,i=t),x.precision(v)):[[r,o],[e,i]]},x.step=function(t){return arguments.length?x.majorStep(t).minorStep(t):x.minorStep()},x.majorStep=function(t){return arguments.length?(g=+t[0],m=+t[1],x):[g,m]},x.minorStep=function(t){return arguments.length?(p=+t[0],d=+t[1],x):[p,d]},x.precision=function(t){return arguments.length?(v=+t,c=jn(o,i,90),u=Vn(r,e,v),h=jn(l,s,90),f=Vn(a,n,v),x):v},x.majorExtent([[-180,-90+kt],[180,90-kt]]).minorExtent([[-180,-80-kt],[180,80+kt]])},t.geo.greatArc=function(){var e,r,n=Un,a=qn;function i(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||a.apply(this,arguments)]}}return i.distance=function(){return t.geo.distance(e||n.apply(this,arguments),r||a.apply(this,arguments))},i.source=function(t){return arguments.length?(n=t,e="function"==typeof t?null:t,i):n},i.target=function(t){return arguments.length?(a=t,r="function"==typeof t?null:t,i):a},i.precision=function(){return arguments.length?i:0},i},t.geo.interpolate=function(t,e){return r=t[0]*Lt,n=t[1]*Lt,a=e[0]*Lt,i=e[1]*Lt,o=Math.cos(n),s=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=o*Math.cos(r),h=o*Math.sin(r),f=l*Math.cos(a),p=l*Math.sin(a),d=2*Math.asin(Math.sqrt(Ft(i-n)+o*l*Ft(a-r))),g=1/Math.sin(d),(m=d?function(t){var e=Math.sin(t*=d)*g,r=Math.sin(d-t)*g,n=r*u+e*f,a=r*h+e*p,i=r*s+e*c;return[Math.atan2(a,n)*Pt,Math.atan2(i,Math.sqrt(n*n+a*a))*Pt]}:function(){return[r*Pt,n*Pt]}).distance=d,m;var r,n,a,i,o,s,l,c,u,h,f,p,d,g,m},t.geo.length=function(e){return yn=0,t.geo.stream(e,Hn),yn};var Hn={sphere:O,point:O,lineStart:function(){var t,e,r;function n(n,a){var i=Math.sin(a*=Lt),o=Math.cos(a),s=y((n*=Lt)-t),l=Math.cos(s);yn+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=r*i-e*o*l)*s),e*i+r*o*l),t=n,e=i,r=o}Hn.point=function(a,i){t=a*Lt,e=Math.sin(i*=Lt),r=Math.cos(i),Hn.point=n},Hn.lineEnd=function(){Hn.point=Hn.lineEnd=O}},lineEnd:O,polygonStart:O,polygonEnd:O};function Gn(t,e){function r(e,r){var n=Math.cos(e),a=Math.cos(r),i=t(n*a);return[i*a*Math.sin(e),i*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),a=e(n),i=Math.sin(a),o=Math.cos(a);return[Math.atan2(t*i,n*o),Math.asin(n&&r*i/n)]},r}var Yn=Gn((function(t){return Math.sqrt(2/(1+t))}),(function(t){return 2*Math.asin(t/2)}));(t.geo.azimuthalEqualArea=function(){return Cn(Yn)}).raw=Yn;var Wn=Gn((function(t){var e=Math.acos(t);return e&&e/Math.sin(e)}),L);function Zn(t,e){var r=Math.cos(t),n=function(t){return Math.tan(Mt/4+t/2)},a=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(n(e)/n(t)),i=r*Math.pow(n(t),a)/a;if(!a)return Kn;function o(t,e){i>0?e<-Ct+kt&&(e=-Ct+kt):e>Ct-kt&&(e=Ct-kt);var r=i/Math.pow(n(e),a);return[r*Math.sin(a*t),i-r*Math.cos(a*t)]}return o.invert=function(t,e){var r=i-e,n=It(a)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/a,2*Math.atan(Math.pow(i/n,1/a))-Ct]},o}function Xn(t,e){var r=Math.cos(t),n=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),a=r/n+t;if(y(n)<kt)return In;function i(t,e){var r=a-e;return[r*Math.sin(n*t),a-r*Math.cos(n*t)]}return i.invert=function(t,e){var r=a-e;return[Math.atan2(t,r)/n,a-It(n)*Math.sqrt(t*t+r*r)]},i}(t.geo.azimuthalEquidistant=function(){return Cn(Wn)}).raw=Wn,(t.geo.conicConformal=function(){return an(Zn)}).raw=Zn,(t.geo.conicEquidistant=function(){return an(Xn)}).raw=Xn;var Jn=Gn((function(t){return 1/t}),Math.atan);function Kn(t,e){return[t,Math.log(Math.tan(Mt/4+e/2))]}function Qn(t){var e,r=Cn(t),n=r.scale,a=r.translate,i=r.clipExtent;return r.scale=function(){var t=n.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.translate=function(){var t=a.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.clipExtent=function(t){var o=i.apply(r,arguments);if(o===r){if(e=null==t){var s=Mt*n(),l=a();i([[l[0]-s,l[1]-s],[l[0]+s,l[1]+s]])}}else e&&(o=null);return o},r.clipExtent(null)}(t.geo.gnomonic=function(){return Cn(Jn)}).raw=Jn,Kn.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Ct]},(t.geo.mercator=function(){return Qn(Kn)}).raw=Kn;var $n=Gn((function(){return 1}),Math.asin);(t.geo.orthographic=function(){return Cn($n)}).raw=$n;var ta=Gn((function(t){return 1/(1+t)}),(function(t){return 2*Math.atan(t)}));function ea(t,e){return[Math.log(Math.tan(Mt/4+e/2)),-t]}function ra(t){return t[0]}function na(t){return t[1]}function aa(t){for(var e=t.length,r=[0,1],n=2,a=2;a<e;a++){for(;n>1&&zt(t[r[n-2]],t[r[n-1]],t[a])<=0;)--n;r[n++]=a}return r.slice(0,n)}function ia(t,e){return t[0]-e[0]||t[1]-e[1]}(t.geo.stereographic=function(){return Cn(ta)}).raw=ta,ea.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Ct]},(t.geo.transverseMercator=function(){var t=Qn(ea),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90])}).raw=ea,t.geom={},t.geom.hull=function(t){var e=ra,r=na;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,a=de(e),i=de(r),o=t.length,s=[],l=[];for(n=0;n<o;n++)s.push([+a.call(this,t[n],n),+i.call(this,t[n],n),n]);for(s.sort(ia),n=0;n<o;n++)l.push([s[n][0],-s[n][1]]);var c=aa(s),u=aa(l),h=u[0]===c[0],f=u[u.length-1]===c[c.length-1],p=[];for(n=c.length-1;n>=0;--n)p.push(t[s[c[n]][2]]);for(n=+h;n<u.length-f;++n)p.push(t[s[u[n]][2]]);return p}return n.x=function(t){return arguments.length?(e=t,n):e},n.y=function(t){return arguments.length?(r=t,n):r},n},t.geom.polygon=function(t){return V(t,oa),t};var oa=t.geom.polygon.prototype=[];function sa(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function la(t,e,r,n){var a=t[0],i=r[0],o=e[0]-a,s=n[0]-i,l=t[1],c=r[1],u=e[1]-l,h=n[1]-c,f=(s*(l-c)-h*(a-i))/(h*o-s*u);return[a+f*o,l+f*u]}function ca(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}oa.area=function(){for(var t,e=-1,r=this.length,n=this[r-1],a=0;++e<r;)t=n,n=this[e],a+=t[1]*n[0]-t[0]*n[1];return.5*a},oa.centroid=function(t){var e,r,n=-1,a=this.length,i=0,o=0,s=this[a-1];for(arguments.length||(t=-1/(6*this.area()));++n<a;)e=s,s=this[n],r=e[0]*s[1]-s[0]*e[1],i+=(e[0]+s[0])*r,o+=(e[1]+s[1])*r;return[i*t,o*t]},oa.clip=function(t){for(var e,r,n,a,i,o,s=ca(t),l=-1,c=this.length-ca(this),u=this[c-1];++l<c;){for(e=t.slice(),t.length=0,a=this[l],i=e[(n=e.length-s)-1],r=-1;++r<n;)sa(o=e[r],u,a)?(sa(i,u,a)||t.push(la(i,o,u,a)),t.push(o)):sa(i,u,a)&&t.push(la(i,o,u,a)),i=o;s&&t.push(t[0]),u=a}return t};var ua,ha,fa,pa,da,ga=[],ma=[];function va(){Ra(this),this.edge=this.site=this.circle=null}function ya(t){var e=ga.pop()||new va;return e.site=t,e}function xa(t){Ea(t),fa.remove(t),ga.push(t),Ra(t)}function ba(t){var e=t.circle,r=e.x,n=e.cy,a={x:r,y:n},i=t.P,o=t.N,s=[t];xa(t);for(var l=i;l.circle&&y(r-l.circle.x)<kt&&y(n-l.circle.cy)<kt;)i=l.P,s.unshift(l),xa(l),l=i;s.unshift(l),Ea(l);for(var c=o;c.circle&&y(r-c.circle.x)<kt&&y(n-c.circle.cy)<kt;)o=c.N,s.push(c),xa(c),c=o;s.push(c),Ea(c);var u,h=s.length;for(u=1;u<h;++u)c=s[u],l=s[u-1],za(c.edge,l.site,c.site,a);l=s[0],(c=s[h-1]).edge=Pa(l.site,c.site,null,a),Sa(l),Sa(c)}function _a(t){for(var e,r,n,a,i=t.x,o=t.y,s=fa._;s;)if((n=wa(s,o)-i)>kt)s=s.L;else{if(!((a=i-Ta(s,o))>kt)){n>-kt?(e=s.P,r=s):a>-kt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=ya(t);if(fa.insert(e,l),e||r){if(e===r)return Ea(e),r=ya(e.site),fa.insert(l,r),l.edge=r.edge=Pa(e.site,l.site),Sa(e),void Sa(r);if(r){Ea(e),Ea(r);var c=e.site,u=c.x,h=c.y,f=t.x-u,p=t.y-h,d=r.site,g=d.x-u,m=d.y-h,v=2*(f*m-p*g),y=f*f+p*p,x=g*g+m*m,b={x:(m*y-p*x)/v+u,y:(f*x-g*y)/v+h};za(r.edge,c,d,b),l.edge=Pa(c,t,null,b),r.edge=Pa(t,d,null,b),Sa(e),Sa(r)}else l.edge=Pa(e.site,l.site)}}function wa(t,e){var r=t.site,n=r.x,a=r.y,i=a-e;if(!i)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,c=l-e;if(!c)return s;var u=s-n,h=1/i-1/c,f=u/c;return h?(-f+Math.sqrt(f*f-2*h*(u*u/(-2*c)-l+c/2+a-i/2)))/h+n:(n+s)/2}function Ta(t,e){var r=t.N;if(r)return wa(r,e);var n=t.site;return n.y===e?n.x:1/0}function ka(t){this.site=t,this.edges=[]}function Aa(t,e){return e.angle-t.angle}function Ma(){Ra(this),this.x=this.y=this.arc=this.site=this.cy=null}function Sa(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,a=t.site,i=r.site;if(n!==i){var o=a.x,s=a.y,l=n.x-o,c=n.y-s,u=i.x-o,h=2*(l*(m=i.y-s)-c*u);if(!(h>=-At)){var f=l*l+c*c,p=u*u+m*m,d=(m*f-c*p)/h,g=(l*p-u*f)/h,m=g+s,v=ma.pop()||new Ma;v.arc=t,v.site=a,v.x=d+o,v.y=m+Math.sqrt(d*d+g*g),v.cy=m,t.circle=v;for(var y=null,x=da._;x;)if(v.y<x.y||v.y===x.y&&v.x<=x.x){if(!x.L){y=x.P;break}x=x.L}else{if(!x.R){y=x;break}x=x.R}da.insert(y,v),y||(pa=v)}}}}function Ea(t){var e=t.circle;e&&(e.P||(pa=e.N),da.remove(e),ma.push(e),Ra(e),t.circle=null)}function Ca(t,e){var r=t.b;if(r)return!0;var n,a,i=t.a,o=e[0][0],s=e[1][0],l=e[0][1],c=e[1][1],u=t.l,h=t.r,f=u.x,p=u.y,d=h.x,g=h.y,m=(f+d)/2,v=(p+g)/2;if(g===p){if(m<o||m>=s)return;if(f>d){if(i){if(i.y>=c)return}else i={x:m,y:l};r={x:m,y:c}}else{if(i){if(i.y<l)return}else i={x:m,y:c};r={x:m,y:l}}}else if(a=v-(n=(f-d)/(g-p))*m,n<-1||n>1)if(f>d){if(i){if(i.y>=c)return}else i={x:(l-a)/n,y:l};r={x:(c-a)/n,y:c}}else{if(i){if(i.y<l)return}else i={x:(c-a)/n,y:c};r={x:(l-a)/n,y:l}}else if(p<g){if(i){if(i.x>=s)return}else i={x:o,y:n*o+a};r={x:s,y:n*s+a}}else{if(i){if(i.x<o)return}else i={x:s,y:n*s+a};r={x:o,y:n*o+a}}return t.a=i,t.b=r,!0}function La(t,e){this.l=t,this.r=e,this.a=this.b=null}function Pa(t,e,r,n){var a=new La(t,e);return ua.push(a),r&&za(a,t,e,r),n&&za(a,e,t,n),ha[t.i].edges.push(new Oa(a,t,e)),ha[e.i].edges.push(new Oa(a,e,t)),a}function Ia(t,e,r){var n=new La(t,null);return n.a=e,n.b=r,ua.push(n),n}function za(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 Oa(t,e,r){var n=t.a,a=t.b;this.edge=t,this.site=e,this.angle=r?Math.atan2(r.y-e.y,r.x-e.x):t.l===e?Math.atan2(a.x-n.x,n.y-a.y):Math.atan2(n.x-a.x,a.y-n.y)}function Da(){this._=null}function Ra(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Fa(t,e){var r=e,n=e.R,a=r.U;a?a.L===r?a.L=n:a.R=n:t._=n,n.U=a,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}function Ba(t,e){var r=e,n=e.L,a=r.U;a?a.L===r?a.L=n:a.R=n:t._=n,n.U=a,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}function Na(t){for(;t.L;)t=t.L;return t}function ja(t,e){var r,n,a,i=t.sort(Va).pop();for(ua=[],ha=new Array(t.length),fa=new Da,da=new Da;;)if(a=pa,i&&(!a||i.y<a.y||i.y===a.y&&i.x<a.x))i.x===r&&i.y===n||(ha[i.i]=new ka(i),_a(i),r=i.x,n=i.y),i=t.pop();else{if(!a)break;ba(a.arc)}e&&(function(t){for(var e,r=ua,n=rn(t[0][0],t[0][1],t[1][0],t[1][1]),a=r.length;a--;)(!Ca(e=r[a],t)||!n(e)||y(e.a.x-e.b.x)<kt&&y(e.a.y-e.b.y)<kt)&&(e.a=e.b=null,r.splice(a,1))}(e),function(t){for(var e,r,n,a,i,o,s,l,c,u,h=t[0][0],f=t[1][0],p=t[0][1],d=t[1][1],g=ha,m=g.length;m--;)if((i=g[m])&&i.prepare())for(l=(s=i.edges).length,o=0;o<l;)n=(u=s[o].end()).x,a=u.y,e=(c=s[++o%l].start()).x,r=c.y,(y(n-e)>kt||y(a-r)>kt)&&(s.splice(o,0,new Oa(Ia(i.site,u,y(n-h)<kt&&d-a>kt?{x:h,y:y(e-h)<kt?r:d}:y(a-d)<kt&&f-n>kt?{x:y(r-d)<kt?e:f,y:d}:y(n-f)<kt&&a-p>kt?{x:f,y:y(e-f)<kt?r:p}:y(a-p)<kt&&n-h>kt?{x:y(r-p)<kt?e:h,y:p}:null),i.site,null)),++l)}(e));var o={cells:ha,edges:ua};return fa=da=ua=ha=null,o}function Va(t,e){return e.y-t.y||e.x-t.x}ka.prototype.prepare=function(){for(var t,e=this.edges,r=e.length;r--;)(t=e[r].edge).b&&t.a||e.splice(r,1);return e.sort(Aa),e.length},Oa.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},Da.prototype={insert:function(t,e){var r,n,a;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;r=t}else this._?(t=Na(this._),e.P=null,e.N=t,t.P=t.L=e,r=t):(e.P=e.N=null,this._=e,r=null);for(e.L=e.R=null,e.U=r,e.C=!0,t=e;r&&r.C;)r===(n=r.U).L?(a=n.R)&&a.C?(r.C=a.C=!1,n.C=!0,t=n):(t===r.R&&(Fa(this,r),r=(t=r).U),r.C=!1,n.C=!0,Ba(this,n)):(a=n.L)&&a.C?(r.C=a.C=!1,n.C=!0,t=n):(t===r.L&&(Ba(this,r),r=(t=r).U),r.C=!1,n.C=!0,Fa(this,n)),r=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,r,n,a=t.U,i=t.L,o=t.R;if(r=i?o?Na(o):i:o,a?a.L===t?a.L=r:a.R=r:this._=r,i&&o?(n=r.C,r.C=t.C,r.L=i,i.U=r,r!==o?(a=r.U,r.U=t.U,t=r.R,a.L=t,r.R=o,o.U=r):(r.U=a,a=r,t=r.R)):(n=t.C,t=r),t&&(t.U=a),!n)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===a.L){if((e=a.R).C&&(e.C=!1,a.C=!0,Fa(this,a),e=a.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,Ba(this,e),e=a.R),e.C=a.C,a.C=e.R.C=!1,Fa(this,a),t=this._;break}}else if((e=a.L).C&&(e.C=!1,a.C=!0,Ba(this,a),e=a.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,Fa(this,e),e=a.L),e.C=a.C,a.C=e.L.C=!1,Ba(this,a),t=this._;break}e.C=!0,t=a,a=a.U}while(!t.C);t&&(t.C=!1)}}},t.geom.voronoi=function(t){var e=ra,r=na,n=e,a=r,i=Ua;if(t)return o(t);function o(t){var e=new Array(t.length),r=i[0][0],n=i[0][1],a=i[1][0],o=i[1][1];return ja(s(t),i).cells.forEach((function(i,s){var l=i.edges,c=i.site;(e[s]=l.length?l.map((function(t){var e=t.start();return[e.x,e.y]})):c.x>=r&&c.x<=a&&c.y>=n&&c.y<=o?[[r,o],[a,o],[a,n],[r,n]]:[]).point=t[s]})),e}function s(t){return t.map((function(t,e){return{x:Math.round(n(t,e)/kt)*kt,y:Math.round(a(t,e)/kt)*kt,i:e}}))}return o.links=function(t){return ja(s(t)).edges.filter((function(t){return t.l&&t.r})).map((function(e){return{source:t[e.l.i],target:t[e.r.i]}}))},o.triangles=function(t){var e=[];return ja(s(t)).cells.forEach((function(r,n){for(var a,i,o,s,l=r.site,c=r.edges.sort(Aa),u=-1,h=c.length,f=c[h-1].edge,p=f.l===l?f.r:f.l;++u<h;)f,a=p,p=(f=c[u].edge).l===l?f.r:f.l,n<a.i&&n<p.i&&(o=a,s=p,((i=l).x-s.x)*(o.y-i.y)-(i.x-o.x)*(s.y-i.y)<0)&&e.push([t[n],t[a.i],t[p.i]])})),e},o.x=function(t){return arguments.length?(n=de(e=t),o):e},o.y=function(t){return arguments.length?(a=de(r=t),o):r},o.clipExtent=function(t){return arguments.length?(i=null==t?Ua:t,o):i===Ua?null:i},o.size=function(t){return arguments.length?o.clipExtent(t&&[[0,0],t]):i===Ua?null:i&&i[1]},o};var Ua=[[-1e6,-1e6],[1e6,1e6]];function qa(t){return t.x}function Ha(t){return t.y}function Ga(t,e,r,n,a,i){if(!t(e,r,n,a,i)){var o=.5*(r+a),s=.5*(n+i),l=e.nodes;l[0]&&Ga(t,l[0],r,n,o,s),l[1]&&Ga(t,l[1],o,n,a,s),l[2]&&Ga(t,l[2],r,s,o,i),l[3]&&Ga(t,l[3],o,s,a,i)}}function Ya(t,e,r,n,a,i,o){var s,l=1/0;return function t(c,u,h,f,p){if(!(u>i||h>o||f<n||p<a)){if(d=c.point){var d,g=e-c.x,m=r-c.y,v=g*g+m*m;if(v<l){var y=Math.sqrt(l=v);n=e-y,a=r-y,i=e+y,o=r+y,s=d}}for(var x=c.nodes,b=.5*(u+f),_=.5*(h+p),w=(r>=_)<<1|e>=b,T=w+4;w<T;++w)if(c=x[3&w])switch(3&w){case 0:t(c,u,h,b,_);break;case 1:t(c,b,h,f,_);break;case 2:t(c,u,_,b,p);break;case 3:t(c,b,_,f,p)}}}(t,n,a,i,o),s}function Wa(e,r){e=t.rgb(e),r=t.rgb(r);var n=e.r,a=e.g,i=e.b,o=r.r-n,s=r.g-a,l=r.b-i;return function(t){return"#"+se(Math.round(n+o*t))+se(Math.round(a+s*t))+se(Math.round(i+l*t))}}function Za(t,e){var r,n={},a={};for(r in t)r in e?n[r]=$a(t[r],e[r]):a[r]=t[r];for(r in e)r in t||(a[r]=e[r]);return function(t){for(r in n)a[r]=n[r](t);return a}}function Xa(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Ja(t,e){var r,n,a,i=Ka.lastIndex=Qa.lastIndex=0,o=-1,s=[],l=[];for(t+="",e+="";(r=Ka.exec(t))&&(n=Qa.exec(e));)(a=n.index)>i&&(a=e.slice(i,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:Xa(r,n)})),i=Qa.lastIndex;return i<e.length&&(a=e.slice(i),s[o]?s[o]+=a:s[++o]=a),s.length<2?l[0]?(e=l[0].x,function(t){return e(t)+""}):function(){return e}:(e=l.length,function(t){for(var r,n=0;n<e;++n)s[(r=l[n]).i]=r.x(t);return s.join("")})}t.geom.delaunay=function(e){return t.geom.voronoi().triangles(e)},t.geom.quadtree=function(t,e,r,n,a){var i,o=ra,s=na;if(i=arguments.length)return o=qa,s=Ha,3===i&&(a=r,n=e,r=e=0),l(t);function l(t){var l,c,u,h,f,p,d,g,m,v=de(o),x=de(s);if(null!=e)p=e,d=r,g=n,m=a;else if(g=m=-(p=d=1/0),c=[],u=[],f=t.length,i)for(h=0;h<f;++h)(l=t[h]).x<p&&(p=l.x),l.y<d&&(d=l.y),l.x>g&&(g=l.x),l.y>m&&(m=l.y),c.push(l.x),u.push(l.y);else for(h=0;h<f;++h){var b=+v(l=t[h],h),_=+x(l,h);b<p&&(p=b),_<d&&(d=_),b>g&&(g=b),_>m&&(m=_),c.push(b),u.push(_)}var w=g-p,T=m-d;function k(t,e,r,n,a,i,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,c=t.y;if(null!=l)if(y(l-r)+y(c-n)<.01)A(t,e,r,n,a,i,o,s);else{var u=t.point;t.x=t.y=t.point=null,A(t,u,l,c,a,i,o,s),A(t,e,r,n,a,i,o,s)}else t.x=r,t.y=n,t.point=e}else A(t,e,r,n,a,i,o,s)}function A(t,e,r,n,a,i,o,s){var l=.5*(a+o),c=.5*(i+s),u=r>=l,h=n>=c,f=h<<1|u;t.leaf=!1,u?a=l:o=l,h?i=c:s=c,k(t=t.nodes[f]||(t.nodes[f]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,a,i,o,s)}w>T?m=d+w:g=p+T;var M={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){k(M,t,+v(t,++h),+x(t,h),p,d,g,m)},visit:function(t){Ga(t,M,p,d,g,m)},find:function(t){return Ya(M,t[0],t[1],p,d,g,m)}};if(h=-1,null==e){for(;++h<f;)k(M,t[h],c[h],u[h],p,d,g,m);--h}else t.forEach(M.add);return c=u=t=l=null,M}return l.x=function(t){return arguments.length?(o=t,l):o},l.y=function(t){return arguments.length?(s=t,l):s},l.extent=function(t){return arguments.length?(null==t?e=r=n=a=null:(e=+t[0][0],r=+t[0][1],n=+t[1][0],a=+t[1][1]),l):null==e?null:[[e,r],[n,a]]},l.size=function(t){return arguments.length?(null==t?e=r=n=a=null:(e=r=0,n=+t[0],a=+t[1]),l):null==e?null:[n-e,a-r]},l},t.interpolateRgb=Wa,t.interpolateObject=Za,t.interpolateNumber=Xa,t.interpolateString=Ja;var Ka=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Qa=new RegExp(Ka.source,"g");function $a(e,r){for(var n,a=t.interpolators.length;--a>=0&&!(n=t.interpolators[a](e,r)););return n}function ti(t,e){var r,n=[],a=[],i=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r<s;++r)n.push($a(t[r],e[r]));for(;r<i;++r)a[r]=t[r];for(;r<o;++r)a[r]=e[r];return function(t){for(r=0;r<s;++r)a[r]=n[r](t);return a}}t.interpolate=$a,t.interpolators=[function(t,e){var r=typeof e;return("string"===r?pe.has(e.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(e)?Wa:Ja:e instanceof Ut?Wa:Array.isArray(e)?ti:"object"===r&&isNaN(e)?Za:Xa)(t,e)}],t.interpolateArray=ti;var ei=function(){return L},ri=t.map({linear:ei,poly:function(t){return function(e){return Math.pow(e,t)}},quad:function(){return si},cubic:function(){return li},sin:function(){return ui},exp:function(){return hi},circle:function(){return fi},elastic:function(t,e){var r;arguments.length<2&&(e=.45);arguments.length?r=e/St*Math.asin(1/t):(t=1,r=e/4);return function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*St/e)}},back:function(t){t||(t=1.70158);return function(e){return e*e*((t+1)*e-t)}},bounce:function(){return pi}}),ni=t.map({in:L,out:ii,"in-out":oi,"out-in":function(t){return oi(ii(t))}});function ai(t){return function(e){return e<=0?0:e>=1?1:t(e)}}function ii(t){return function(e){return 1-t(1-e)}}function oi(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function si(t){return t*t}function li(t){return t*t*t}function ci(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 ui(t){return 1-Math.cos(t*Ct)}function hi(t){return Math.pow(2,10*(t-1))}function fi(t){return 1-Math.sqrt(1-t*t)}function pi(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 di(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function gi(t){var e,r,n,a=[t.a,t.b],i=[t.c,t.d],o=vi(a),s=mi(a,i),l=vi(((e=i)[0]+=(n=-s)*(r=a)[0],e[1]+=n*r[1],e))||0;a[0]*i[1]<i[0]*a[1]&&(a[0]*=-1,a[1]*=-1,o*=-1,s*=-1),this.rotate=(o?Math.atan2(a[1],a[0]):Math.atan2(-i[0],i[1]))*Pt,this.translate=[t.e,t.f],this.scale=[o,l],this.skew=l?Math.atan2(s,l)*Pt:0}function mi(t,e){return t[0]*e[0]+t[1]*e[1]}function vi(t){var e=Math.sqrt(mi(t,t));return e&&(t[0]/=e,t[1]/=e),e}t.ease=function(t){var e=t.indexOf("-"),n=e>=0?t.slice(0,e):t,a=e>=0?t.slice(e+1):"in";return n=ri.get(n)||ei,ai((a=ni.get(a)||L)(n.apply(null,r.call(arguments,1))))},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,a=e.c,i=e.l,o=r.h-n,s=r.c-a,l=r.l-i;isNaN(s)&&(s=0,a=isNaN(a)?r.c:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Zt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,a=e.s,i=e.l,o=r.h-n,s=r.s-a,l=r.l-i;isNaN(s)&&(s=0,a=isNaN(a)?r.s:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Gt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,a=e.a,i=e.b,o=r.l-n,s=r.a-a,l=r.b-i;return function(t){return Qt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateRound=di,t.transform=function(e){var r=a.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new gi(e?e.matrix:yi)})(e)},gi.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var yi={a:1,b:0,c:0,d:1,e:0,f:0};function xi(t){return t.length?t.pop()+",":""}function bi(e,r){var n=[],a=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push("translate(",null,",",null,")");n.push({i:a-4,x:Xa(t[0],e[0])},{i:a-2,x:Xa(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,a),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(xi(r)+"rotate(",null,")")-2,x:Xa(t,e)})):e&&r.push(xi(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,a),function(t,e,r,n){t!==e?n.push({i:r.push(xi(r)+"skewX(",null,")")-2,x:Xa(t,e)}):e&&r.push(xi(r)+"skewX("+e+")")}(e.skew,r.skew,n,a),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push(xi(r)+"scale(",null,",",null,")");n.push({i:a-4,x:Xa(t[0],e[0])},{i:a-2,x:Xa(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(xi(r)+"scale("+e+")")}(e.scale,r.scale,n,a),e=r=null,function(t){for(var e,r=-1,i=a.length;++r<i;)n[(e=a[r]).i]=e.x(t);return n.join("")}}function _i(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function wi(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function Ti(t){for(var e=t.source,r=t.target,n=function(t,e){if(t===e)return t;var r=ki(t),n=ki(e),a=r.pop(),i=n.pop(),o=null;for(;a===i;)o=a,a=r.pop(),i=n.pop();return o}(e,r),a=[e];e!==n;)e=e.parent,a.push(e);for(var i=a.length;r!==n;)a.splice(i,0,r),r=r.parent;return a}function ki(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function Ai(t){t.fixed|=2}function Mi(t){t.fixed&=-7}function Si(t){t.fixed|=4,t.px=t.x,t.py=t.y}function Ei(t){t.fixed&=-5}t.interpolateTransform=bi,t.layout={},t.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r<n;)e.push(Ti(t[r]));return e}},t.layout.chord=function(){var e,r,n,a,i,o,s,l={},c=0;function u(){var l,u,f,p,d,g={},m=[],v=t.range(a),y=[];for(e=[],r=[],l=0,p=-1;++p<a;){for(u=0,d=-1;++d<a;)u+=n[p][d];m.push(u),y.push(t.range(a)),l+=u}for(i&&v.sort((function(t,e){return i(m[t],m[e])})),o&&y.forEach((function(t,e){t.sort((function(t,r){return o(n[e][t],n[e][r])}))})),l=(St-c*a)/l,u=0,p=-1;++p<a;){for(f=u,d=-1;++d<a;){var x=v[p],b=y[x][d],_=n[x][b],w=u,T=u+=_*l;g[x+"-"+b]={index:x,subindex:b,startAngle:w,endAngle:T,value:_}}r[x]={index:x,startAngle:f,endAngle:u,value:m[x]},u+=c}for(p=-1;++p<a;)for(d=p-1;++d<a;){var k=g[p+"-"+d],A=g[d+"-"+p];(k.value||A.value)&&e.push(k.value<A.value?{source:A,target:k}:{source:k,target:A})}s&&h()}function h(){e.sort((function(t,e){return s((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)}))}return l.matrix=function(t){return arguments.length?(a=(n=t)&&n.length,e=r=null,l):n},l.padding=function(t){return arguments.length?(c=t,e=r=null,l):c},l.sortGroups=function(t){return arguments.length?(i=t,e=r=null,l):i},l.sortSubgroups=function(t){return arguments.length?(o=t,e=null,l):o},l.sortChords=function(t){return arguments.length?(s=t,e&&h(),l):s},l.chords=function(){return e||u(),e},l.groups=function(){return r||u(),r},l},t.layout.force=function(){var e,r,n,a,i,o,s={},l=t.dispatch("start","tick","end"),c=[1,1],u=.9,h=Ci,f=Li,p=-30,d=Pi,g=.1,m=.64,v=[],y=[];function x(t){return function(e,r,n,a){if(e.point!==t){var i=e.cx-t.x,o=e.cy-t.y,s=a-r,l=i*i+o*o;if(s*s/m<l){if(l<d){var c=e.charge/l;t.px-=i*c,t.py-=o*c}return!0}if(e.point&&l&&l<d){c=e.pointCharge/l;t.px-=i*c,t.py-=o*c}}return!e.charge}}function b(e){e.px=t.event.x,e.py=t.event.y,s.resume()}return s.tick=function(){if((n*=.99)<.005)return e=null,l.end({type:"end",alpha:n=0}),!0;var r,s,h,f,d,m,b,_,w,T=v.length,k=y.length;for(s=0;s<k;++s)f=(h=y[s]).source,(m=(_=(d=h.target).x-f.x)*_+(w=d.y-f.y)*w)&&(_*=m=n*i[s]*((m=Math.sqrt(m))-a[s])/m,w*=m,d.x-=_*(b=f.weight+d.weight?f.weight/(f.weight+d.weight):.5),d.y-=w*b,f.x+=_*(b=1-b),f.y+=w*b);if((b=n*g)&&(_=c[0]/2,w=c[1]/2,s=-1,b))for(;++s<T;)(h=v[s]).x+=(_-h.x)*b,h.y+=(w-h.y)*b;if(p)for(!function t(e,r,n){var a=0,i=0;if(e.charge=0,!e.leaf)for(var o,s=e.nodes,l=s.length,c=-1;++c<l;)null!=(o=s[c])&&(t(o,r,n),e.charge+=o.charge,a+=o.charge*o.cx,i+=o.charge*o.cy);if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var u=r*n[e.point.index];e.charge+=e.pointCharge=u,a+=u*e.point.x,i+=u*e.point.y}e.cx=a/e.charge,e.cy=i/e.charge}(r=t.geom.quadtree(v),n,o),s=-1;++s<T;)(h=v[s]).fixed||r.visit(x(h));for(s=-1;++s<T;)(h=v[s]).fixed?(h.x=h.px,h.y=h.py):(h.x-=(h.px-(h.px=h.x))*u,h.y-=(h.py-(h.py=h.y))*u);l.tick({type:"tick",alpha:n})},s.nodes=function(t){return arguments.length?(v=t,s):v},s.links=function(t){return arguments.length?(y=t,s):y},s.size=function(t){return arguments.length?(c=t,s):c},s.linkDistance=function(t){return arguments.length?(h="function"==typeof t?t:+t,s):h},s.distance=s.linkDistance,s.linkStrength=function(t){return arguments.length?(f="function"==typeof t?t:+t,s):f},s.friction=function(t){return arguments.length?(u=+t,s):u},s.charge=function(t){return arguments.length?(p="function"==typeof t?t:+t,s):p},s.chargeDistance=function(t){return arguments.length?(d=t*t,s):Math.sqrt(d)},s.gravity=function(t){return arguments.length?(g=+t,s):g},s.theta=function(t){return arguments.length?(m=t*t,s):Math.sqrt(m)},s.alpha=function(t){return arguments.length?(t=+t,n?t>0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=we(s.tick)),s):n},s.start=function(){var t,e,r,n=v.length,l=y.length,u=c[0],d=c[1];for(t=0;t<n;++t)(r=v[t]).index=t,r.weight=0;for(t=0;t<l;++t)"number"==typeof(r=y[t]).source&&(r.source=v[r.source]),"number"==typeof r.target&&(r.target=v[r.target]),++r.source.weight,++r.target.weight;for(t=0;t<n;++t)r=v[t],isNaN(r.x)&&(r.x=g("x",u)),isNaN(r.y)&&(r.y=g("y",d)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(a=[],"function"==typeof h)for(t=0;t<l;++t)a[t]=+h.call(this,y[t],t);else for(t=0;t<l;++t)a[t]=h;if(i=[],"function"==typeof f)for(t=0;t<l;++t)i[t]=+f.call(this,y[t],t);else for(t=0;t<l;++t)i[t]=f;if(o=[],"function"==typeof p)for(t=0;t<n;++t)o[t]=+p.call(this,v[t],t);else for(t=0;t<n;++t)o[t]=p;function g(r,a){if(!e){for(e=new Array(n),c=0;c<n;++c)e[c]=[];for(c=0;c<l;++c){var i=y[c];e[i.source.index].push(i.target),e[i.target.index].push(i.source)}}for(var o,s=e[t],c=-1,u=s.length;++c<u;)if(!isNaN(o=s[c][r]))return o;return Math.random()*a}return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){if(r||(r=t.behavior.drag().origin(L).on("dragstart.force",Ai).on("drag.force",b).on("dragend.force",Mi)),!arguments.length)return r;this.on("mouseover.force",Si).on("mouseout.force",Ei).call(r)},t.rebind(s,l,"on")};var Ci=20,Li=1,Pi=1/0;function Ii(e,r){return t.rebind(e,r,"sort","children","value"),e.nodes=e,e.links=Bi,e}function zi(t,e){for(var r=[t];null!=(t=r.pop());)if(e(t),(a=t.children)&&(n=a.length))for(var n,a;--n>=0;)r.push(a[n])}function Oi(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(i=t.children)&&(a=i.length))for(var a,i,o=-1;++o<a;)r.push(i[o]);for(;null!=(t=n.pop());)e(t)}function Di(t){return t.children}function Ri(t){return t.value}function Fi(t,e){return e.value-t.value}function Bi(e){return t.merge(e.map((function(t){return(t.children||[]).map((function(e){return{source:t,target:e}}))})))}t.layout.hierarchy=function(){var t=Fi,e=Di,r=Ri;function n(a){var i,o=[a],s=[];for(a.depth=0;null!=(i=o.pop());)if(s.push(i),(c=e.call(n,i,i.depth))&&(l=c.length)){for(var l,c,u;--l>=0;)o.push(u=c[l]),u.parent=i,u.depth=i.depth+1;r&&(i.value=0),i.children=c}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return Oi(a,(function(e){var n,a;t&&(n=e.children)&&n.sort(t),r&&(a=e.parent)&&(a.value+=e.value)})),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(zi(t,(function(t){t.children&&(t.value=0)})),Oi(t,(function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)}))),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,n){var a=e.call(this,t,n);return function t(e,r,n,a){var i=e.children;if(e.x=r,e.y=e.depth*a,e.dx=n,e.dy=a,i&&(o=i.length)){var o,s,l,c=-1;for(n=e.value?n/e.value:0;++c<o;)t(s=i[c],r,l=s.value*n,a),r+=l}}(a[0],0,r[0],r[1]/function t(e){var r=e.children,n=0;if(r&&(a=r.length))for(var a,i=-1;++i<a;)n=Math.max(n,t(r[i]));return 1+n}(a[0])),a}return n.size=function(t){return arguments.length?(r=t,n):r},Ii(n,e)},t.layout.pie=function(){var e=Number,r=Ni,n=0,a=St,i=0;function o(s){var l,c=s.length,u=s.map((function(t,r){return+e.call(o,t,r)})),h=+("function"==typeof n?n.apply(this,arguments):n),f=("function"==typeof a?a.apply(this,arguments):a)-h,p=Math.min(Math.abs(f)/c,+("function"==typeof i?i.apply(this,arguments):i)),d=p*(f<0?-1:1),g=t.sum(u),m=g?(f-c*d)/g:0,v=t.range(c),y=[];return null!=r&&v.sort(r===Ni?function(t,e){return u[e]-u[t]}:function(t,e){return r(s[t],s[e])}),v.forEach((function(t){y[t]={data:s[t],value:l=u[t],startAngle:h,endAngle:h+=l*m+d,padAngle:p}})),y}return o.value=function(t){return arguments.length?(e=t,o):e},o.sort=function(t){return arguments.length?(r=t,o):r},o.startAngle=function(t){return arguments.length?(n=t,o):n},o.endAngle=function(t){return arguments.length?(a=t,o):a},o.padAngle=function(t){return arguments.length?(i=t,o):i},o};var Ni={};function ji(t){return t.x}function Vi(t){return t.y}function Ui(t,e,r){t.y0=e,t.y=r}t.layout.stack=function(){var e=L,r=Gi,n=Yi,a=Ui,i=ji,o=Vi;function s(l,c){if(!(p=l.length))return l;var u=l.map((function(t,r){return e.call(s,t,r)})),h=u.map((function(t){return t.map((function(t,e){return[i.call(s,t,e),o.call(s,t,e)]}))})),f=r.call(s,h,c);u=t.permute(u,f),h=t.permute(h,f);var p,d,g,m,v=n.call(s,h,c),y=u[0].length;for(g=0;g<y;++g)for(a.call(s,u[0][g],m=v[g],h[0][g][1]),d=1;d<p;++d)a.call(s,u[d][g],m+=h[d-1][g][1],h[d][g][1]);return l}return s.values=function(t){return arguments.length?(e=t,s):e},s.order=function(t){return arguments.length?(r="function"==typeof t?t:qi.get(t)||Gi,s):r},s.offset=function(t){return arguments.length?(n="function"==typeof t?t:Hi.get(t)||Yi,s):n},s.x=function(t){return arguments.length?(i=t,s):i},s.y=function(t){return arguments.length?(o=t,s):o},s.out=function(t){return arguments.length?(a=t,s):a},s};var qi=t.map({"inside-out":function(e){var r,n,a=e.length,i=e.map(Wi),o=e.map(Zi),s=t.range(a).sort((function(t,e){return i[t]-i[e]})),l=0,c=0,u=[],h=[];for(r=0;r<a;++r)n=s[r],l<c?(l+=o[n],u.push(n)):(c+=o[n],h.push(n));return h.reverse().concat(u)},reverse:function(e){return t.range(e.length).reverse()},default:Gi}),Hi=t.map({silhouette:function(t){var e,r,n,a=t.length,i=t[0].length,o=[],s=0,l=[];for(r=0;r<i;++r){for(e=0,n=0;e<a;e++)n+=t[e][r][1];n>s&&(s=n),o.push(n)}for(r=0;r<i;++r)l[r]=(s-o[r])/2;return l},wiggle:function(t){var e,r,n,a,i,o,s,l,c,u=t.length,h=t[0],f=h.length,p=[];for(p[0]=l=c=0,r=1;r<f;++r){for(e=0,a=0;e<u;++e)a+=t[e][r][1];for(e=0,i=0,s=h[r][0]-h[r-1][0];e<u;++e){for(n=0,o=(t[e][r][1]-t[e][r-1][1])/(2*s);n<e;++n)o+=(t[n][r][1]-t[n][r-1][1])/s;i+=o*t[e][r][1]}p[r]=l-=a?i/a*s:0,l<c&&(c=l)}for(r=0;r<f;++r)p[r]-=c;return p},expand:function(t){var e,r,n,a=t.length,i=t[0].length,o=1/a,s=[];for(r=0;r<i;++r){for(e=0,n=0;e<a;e++)n+=t[e][r][1];if(n)for(e=0;e<a;e++)t[e][r][1]/=n;else for(e=0;e<a;e++)t[e][r][1]=o}for(r=0;r<i;++r)s[r]=0;return s},zero:Yi});function Gi(e){return t.range(e.length)}function Yi(t){for(var e=-1,r=t[0].length,n=[];++e<r;)n[e]=0;return n}function Wi(t){for(var e,r=1,n=0,a=t[0][1],i=t.length;r<i;++r)(e=t[r][1])>a&&(n=r,a=e);return n}function Zi(t){return t.reduce(Xi,0)}function Xi(t,e){return t+e[1]}function Ji(t,e){return Ki(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Ki(t,e){for(var r=-1,n=+t[0],a=(t[1]-n)/e,i=[];++r<=e;)i[r]=a*r+n;return i}function Qi(e){return[t.min(e),t.max(e)]}function $i(t,e){return t.value-e.value}function to(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function eo(t,e){t._pack_next=e,e._pack_prev=t}function ro(t,e){var r=e.x-t.x,n=e.y-t.y,a=t.r+e.r;return.999*a*a>r*r+n*n}function no(t){if((e=t.children)&&(l=e.length)){var e,r,n,a,i,o,s,l,c=1/0,u=-1/0,h=1/0,f=-1/0;if(e.forEach(ao),(r=e[0]).x=-r.r,r.y=0,x(r),l>1&&((n=e[1]).x=n.r,n.y=0,x(n),l>2))for(oo(r,n,a=e[2]),x(a),to(r,a),r._pack_prev=a,to(a,n),n=r._pack_next,i=3;i<l;i++){oo(r,n,a=e[i]);var p=0,d=1,g=1;for(o=n._pack_next;o!==n;o=o._pack_next,d++)if(ro(o,a)){p=1;break}if(1==p)for(s=r._pack_prev;s!==o._pack_prev&&!ro(s,a);s=s._pack_prev,g++);p?(d<g||d==g&&n.r<r.r?eo(r,n=o):eo(r=s,n),i--):(to(r,a),n=a,x(a))}var m=(c+u)/2,v=(h+f)/2,y=0;for(i=0;i<l;i++)(a=e[i]).x-=m,a.y-=v,y=Math.max(y,a.r+Math.sqrt(a.x*a.x+a.y*a.y));t.r=y,e.forEach(io)}function x(t){c=Math.min(t.x-t.r,c),u=Math.max(t.x+t.r,u),h=Math.min(t.y-t.r,h),f=Math.max(t.y+t.r,f)}}function ao(t){t._pack_next=t._pack_prev=t}function io(t){delete t._pack_next,delete t._pack_prev}function oo(t,e,r){var n=t.r+r.r,a=e.x-t.x,i=e.y-t.y;if(n&&(a||i)){var o=e.r+r.r,s=a*a+i*i,l=.5+((n*=n)-(o*=o))/(2*s),c=Math.sqrt(Math.max(0,2*o*(n+s)-(n-=s)*n-o*o))/(2*s);r.x=t.x+l*a+c*i,r.y=t.y+l*i-c*a}else r.x=t.x+n,r.y=t.y}function so(t,e){return t.parent==e.parent?1:2}function lo(t){var e=t.children;return e.length?e[0]:t.t}function co(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function uo(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 ho(t,e,r){return t.a.parent===e.parent?t.a:r}function fo(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function po(t,e){var r=t.x+e[3],n=t.y+e[0],a=t.dx-e[1]-e[3],i=t.dy-e[0]-e[2];return a<0&&(r+=a/2,a=0),i<0&&(n+=i/2,i=0),{x:r,y:n,dx:a,dy:i}}function go(t){var e=t[0],r=t[t.length-1];return e<r?[e,r]:[r,e]}function mo(t){return t.rangeExtent?t.rangeExtent():go(t.range())}function vo(t,e,r,n){var a=r(t[0],t[1]),i=n(e[0],e[1]);return function(t){return i(a(t))}}function yo(t,e){var r,n=0,a=t.length-1,i=t[n],o=t[a];return o<i&&(r=n,n=a,a=r,r=i,i=o,o=r),t[n]=e.floor(i),t[a]=e.ceil(o),t}function xo(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:bo}t.layout.histogram=function(){var e=!0,r=Number,n=Qi,a=Ji;function i(i,o){for(var s,l,c=[],u=i.map(r,this),h=n.call(this,u,o),f=a.call(this,h,u,o),p=(o=-1,u.length),d=f.length-1,g=e?1:1/p;++o<d;)(s=c[o]=[]).dx=f[o+1]-(s.x=f[o]),s.y=0;if(d>0)for(o=-1;++o<p;)(l=u[o])>=h[0]&&l<=h[1]&&((s=c[t.bisect(f,l,1,d)-1]).y+=g,s.push(i[o]));return c}return i.value=function(t){return arguments.length?(r=t,i):r},i.range=function(t){return arguments.length?(n=de(t),i):n},i.bins=function(t){return arguments.length?(a="number"==typeof t?function(e){return Ki(e,t)}:de(t),i):a},i.frequency=function(t){return arguments.length?(e=!!t,i):e},i},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort($i),n=0,a=[1,1];function i(t,i){var o=r.call(this,t,i),s=o[0],l=a[0],c=a[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,Oi(s,(function(t){t.r=+u(t.value)})),Oi(s,no),n){var h=n*(e?1:Math.max(2*s.r/l,2*s.r/c))/2;Oi(s,(function(t){t.r+=h})),Oi(s,no),Oi(s,(function(t){t.r-=h}))}return function t(e,r,n,a){var i=e.children;if(e.x=r+=a*e.x,e.y=n+=a*e.y,e.r*=a,i)for(var o=-1,s=i.length;++o<s;)t(i[o],r,n,a)}(s,l/2,c/2,e?1:1/Math.max(2*s.r/l,2*s.r/c)),o}return i.size=function(t){return arguments.length?(a=t,i):a},i.radius=function(t){return arguments.length?(e=null==t||"function"==typeof t?t:+t,i):e},i.padding=function(t){return arguments.length?(n=+t,i):n},Ii(i,r)},t.layout.tree=function(){var e=t.layout.hierarchy().sort(null).value(null),r=so,n=[1,1],a=null;function i(t,i){var c=e.call(this,t,i),u=c[0],h=function(t){var e,r={A:null,children:[t]},n=[r];for(;null!=(e=n.pop());)for(var a,i=e.children,o=0,s=i.length;o<s;++o)n.push((i[o]=a={_:i[o],parent:e,children:(a=i[o].children)&&a.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=a);return r.children[0]}(u);if(Oi(h,o),h.parent.m=-h.z,zi(h,s),a)zi(u,l);else{var f=u,p=u,d=u;zi(u,(function(t){t.x<f.x&&(f=t),t.x>p.x&&(p=t),t.depth>d.depth&&(d=t)}));var g=r(f,p)/2-f.x,m=n[0]/(p.x+r(p,f)/2+g),v=n[1]/(d.depth||1);zi(u,(function(t){t.x=(t.x+g)*m,t.y=t.depth*v}))}return c}function o(t){var e=t.children,n=t.parent.children,a=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,r=0,n=0,a=t.children,i=a.length;for(;--i>=0;)(e=a[i]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var i=(e[0].z+e[e.length-1].z)/2;a?(t.z=a.z+r(t._,a._),t.m=t.z-i):t.z=i}else a&&(t.z=a.z+r(t._,a._));t.parent.A=function(t,e,n){if(e){for(var a,i=t,o=t,s=e,l=i.parent.children[0],c=i.m,u=o.m,h=s.m,f=l.m;s=co(s),i=lo(i),s&&i;)l=lo(l),(o=co(o)).a=t,(a=s.z+h-i.z-c+r(s._,i._))>0&&(uo(ho(s,t,n),t,a),c+=a,u+=a),h+=s.m,c+=i.m,f+=l.m,u+=o.m;s&&!co(o)&&(o.t=s,o.m+=h-u),i&&!lo(l)&&(l.t=i,l.m+=c-f,n=t)}return n}(t,a,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t)?l:null,i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null==(n=t)?null:l,i):a?n:null},Ii(i,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=so,n=[1,1],a=!1;function i(i,o){var s,l=e.call(this,i,o),c=l[0],u=0;Oi(c,(function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce((function(t,e){return t+e.x}),0)/t.length}(n),e.y=function(e){return 1+t.max(e,(function(t){return t.y}))}(n)):(e.x=s?u+=r(e,s):0,e.y=0,s=e)}));var h=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(c),f=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(c),p=h.x-r(h,f)/2,d=f.x+r(f,h)/2;return Oi(c,a?function(t){t.x=(t.x-c.x)*n[0],t.y=(c.y-t.y)*n[1]}:function(t){t.x=(t.x-p)/(d-p)*n[0],t.y=(1-(c.y?t.y/c.y:1))*n[1]}),l}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t),i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null!=(n=t),i):a?n:null},Ii(i,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,a=[1,1],i=null,o=fo,s=!1,l="squarify",c=.5*(1+Math.sqrt(5));function u(t,e){for(var r,n,a=-1,i=t.length;++a<i;)n=(r=t[a]).value*(e<0?0:e),r.area=isNaN(n)||n<=0?0:n}function h(t){var e=t.children;if(e&&e.length){var r,n,a,i=o(t),s=[],c=e.slice(),f=1/0,g="slice"===l?i.dx:"dice"===l?i.dy:"slice-dice"===l?1&t.depth?i.dy:i.dx:Math.min(i.dx,i.dy);for(u(c,i.dx*i.dy/t.value),s.area=0;(a=c.length)>0;)s.push(r=c[a-1]),s.area+=r.area,"squarify"!==l||(n=p(s,g))<=f?(c.pop(),f=n):(s.area-=s.pop().area,d(s,g,i,!1),g=Math.min(i.dx,i.dy),s.length=s.area=0,f=1/0);s.length&&(d(s,g,i,!0),s.length=s.area=0),e.forEach(h)}}function f(t){var e=t.children;if(e&&e.length){var r,n=o(t),a=e.slice(),i=[];for(u(a,n.dx*n.dy/t.value),i.area=0;r=a.pop();)i.push(r),i.area+=r.area,null!=r.z&&(d(i,r.z?n.dx:n.dy,n,!a.length),i.length=i.area=0);e.forEach(f)}}function p(t,e){for(var r,n=t.area,a=0,i=1/0,o=-1,s=t.length;++o<s;)(r=t[o].area)&&(r<i&&(i=r),r>a&&(a=r));return e*=e,(n*=n)?Math.max(e*a*c/n,n/(e*i*c)):1/0}function d(t,e,r,a){var i,o=-1,s=t.length,l=r.x,c=r.y,u=e?n(t.area/e):0;if(e==r.dx){for((a||u>r.dy)&&(u=r.dy);++o<s;)(i=t[o]).x=l,i.y=c,i.dy=u,l+=i.dx=Math.min(r.x+r.dx-l,u?n(i.area/u):0);i.z=!0,i.dx+=r.x+r.dx-l,r.y+=u,r.dy-=u}else{for((a||u>r.dx)&&(u=r.dx);++o<s;)(i=t[o]).x=l,i.y=c,i.dx=u,c+=i.dy=Math.min(r.y+r.dy-c,u?n(i.area/u):0);i.z=!1,i.dy+=r.y+r.dy-c,r.x+=u,r.dx-=u}}function g(t){var n=e||r(t),i=n[0];return i.x=i.y=0,i.value?(i.dx=a[0],i.dy=a[1]):i.dx=i.dy=0,e&&r.revalue(i),u([i],i.dx*i.dy/i.value),(e?f:h)(i),s&&(e=n),n}return g.size=function(t){return arguments.length?(a=t,g):a},g.padding=function(t){if(!arguments.length)return i;function e(e){var r=t.call(g,e,e.depth);return null==r?fo(e):po(e,"number"==typeof r?[r,r,r,r]:r)}function r(e){return po(e,t)}var n;return o=null==(i=t)?fo:"function"==(n=typeof t)?e:"number"===n?(t=[t,t,t,t],r):r,g},g.round=function(t){return arguments.length?(n=t?Math.round:Number,g):n!=Number},g.sticky=function(t){return arguments.length?(s=t,e=null,g):s},g.ratio=function(t){return arguments.length?(c=t,g):c},g.mode=function(t){return arguments.length?(l=t+"",g):l},Ii(g,r)},t.random={normal:function(t,e){var r=arguments.length;return r<2&&(e=1),r<1&&(t=0),function(){var r,n,a;do{a=(r=2*Math.random()-1)*r+(n=2*Math.random()-1)*n}while(!a||a>1);return t+e*r*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r<t;r++)e+=Math.random();return e}}},t.scale={};var bo={floor:L,ceil:L};function _o(e,r,n,a){var i=[],o=[],s=0,l=Math.min(e.length,r.length)-1;for(e[l]<e[0]&&(e=e.slice().reverse(),r=r.slice().reverse());++s<=l;)i.push(n(e[s-1],e[s])),o.push(a(r[s-1],r[s]));return function(r){var n=t.bisect(e,r,1,l)-1;return o[n](i[n](r))}}function wo(e,r){return t.rebind(e,r,"range","rangeRound","interpolate","clamp")}function To(t,e){return yo(t,xo(ko(t,e)[2])),yo(t,xo(ko(t,e)[2])),t}function ko(t,e){null==e&&(e=10);var r=go(t),n=r[1]-r[0],a=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),i=e/n*a;return i<=.15?a*=10:i<=.35?a*=5:i<=.75&&(a*=2),r[0]=Math.ceil(r[0]/a)*a,r[1]=Math.floor(r[1]/a)*a+.5*a,r[2]=a,r}function Ao(e,r){return t.range.apply(t,ko(e,r))}function Mo(e,r,n){var a=ko(e,r);if(n){var i=Ce.exec(n);if(i.shift(),"s"===i[8]){var o=t.formatPrefix(Math.max(y(a[0]),y(a[1])));return i[7]||(i[7]="."+Eo(o.scale(a[2]))),i[8]="f",n=t.format(i.join("")),function(t){return n(o.scale(t))+o.symbol}}i[7]||(i[7]="."+function(t,e){var r=Eo(e[2]);return t in So?Math.abs(r-Eo(Math.max(y(e[0]),y(e[1]))))+ +("e"!==t):r-2*("%"===t)}(i[8],a)),n=i.join("")}else n=",."+Eo(a[2])+"f";return t.format(n)}t.scale.linear=function(){return function t(e,r,n,a){var i,o;function s(){var t=Math.min(e.length,r.length)>2?_o:vo,s=a?wi:_i;return i=t(e,r,s,n),o=t(r,e,s,$a),l}function l(t){return i(t)}return l.invert=function(t){return o(t)},l.domain=function(t){return arguments.length?(e=t.map(Number),s()):e},l.range=function(t){return arguments.length?(r=t,s()):r},l.rangeRound=function(t){return l.range(t).interpolate(di)},l.clamp=function(t){return arguments.length?(a=t,s()):a},l.interpolate=function(t){return arguments.length?(n=t,s()):n},l.ticks=function(t){return Ao(e,t)},l.tickFormat=function(t,r){return Mo(e,t,r)},l.nice=function(t){return To(e,t),s()},l.copy=function(){return t(e,r,n,a)},s()}([0,1],[0,1],$a,!1)};var So={s:1,g:1,p:1,r:1,e:1};function Eo(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}t.scale.log=function(){return function e(r,n,a,i){function o(t){return(a?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(n)}function s(t){return a?Math.pow(n,t):-Math.pow(n,-t)}function l(t){return r(o(t))}return l.invert=function(t){return s(r.invert(t))},l.domain=function(t){return arguments.length?(a=t[0]>=0,r.domain((i=t.map(Number)).map(o)),l):i},l.base=function(t){return arguments.length?(n=+t,r.domain(i.map(o)),l):n},l.nice=function(){var t=yo(i.map(o),a?Math:Lo);return r.domain(t),i=t.map(s),l},l.ticks=function(){var t=go(i),e=[],r=t[0],l=t[1],c=Math.floor(o(r)),u=Math.ceil(o(l)),h=n%1?2:n;if(isFinite(u-c)){if(a){for(;c<u;c++)for(var f=1;f<h;f++)e.push(s(c)*f);e.push(s(c))}else for(e.push(s(c));c++<u;)for(f=h-1;f>0;f--)e.push(s(c)*f);for(c=0;e[c]<r;c++);for(u=e.length;e[u-1]>l;u--);e=e.slice(c,u)}return e},l.tickFormat=function(e,r){if(!arguments.length)return Co;arguments.length<2?r=Co:"function"!=typeof r&&(r=t.format(r));var a=Math.max(1,n*e/l.ticks().length);return function(t){var e=t/s(Math.round(o(t)));return e*n<n-.5&&(e*=n),e<=a?r(t):""}},l.copy=function(){return e(r.copy(),n,a,i)},wo(l,r)}(t.scale.linear().domain([0,1]),10,!0,[1,10])};var Co=t.format(".0e"),Lo={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function Po(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}t.scale.pow=function(){return function t(e,r,n){var a=Po(r),i=Po(1/r);function o(t){return e(a(t))}return o.invert=function(t){return i(e.invert(t))},o.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(a)),o):n},o.ticks=function(t){return Ao(n,t)},o.tickFormat=function(t,e){return Mo(n,t,e)},o.nice=function(t){return o.domain(To(n,t))},o.exponent=function(t){return arguments.length?(a=Po(r=t),i=Po(1/r),e.domain(n.map(a)),o):r},o.copy=function(){return t(e.copy(),r,n)},wo(o,e)}(t.scale.linear(),1,[0,1])},t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return function e(r,n){var a,i,o;function s(t){return i[((a.get(t)||("range"===n.t?a.set(t,r.push(t)):NaN))-1)%i.length]}function l(e,n){return t.range(r.length).map((function(t){return e+n*t}))}return s.domain=function(t){if(!arguments.length)return r;r=[],a=new _;for(var e,i=-1,o=t.length;++i<o;)a.has(e=t[i])||a.set(e,r.push(e));return s[n.t].apply(s,n.a)},s.range=function(t){return arguments.length?(i=t,o=0,n={t:"range",a:arguments},s):i},s.rangePoints=function(t,e){arguments.length<2&&(e=0);var a=t[0],c=t[1],u=r.length<2?(a=(a+c)/2,0):(c-a)/(r.length-1+e);return i=l(a+u*e/2,u),o=0,n={t:"rangePoints",a:arguments},s},s.rangeRoundPoints=function(t,e){arguments.length<2&&(e=0);var a=t[0],c=t[1],u=r.length<2?(a=c=Math.round((a+c)/2),0):(c-a)/(r.length-1+e)|0;return i=l(a+Math.round(u*e/2+(c-a-(r.length-1+e)*u)/2),u),o=0,n={t:"rangeRoundPoints",a:arguments},s},s.rangeBands=function(t,e,a){arguments.length<2&&(e=0),arguments.length<3&&(a=e);var c=t[1]<t[0],u=t[c-0],h=t[1-c],f=(h-u)/(r.length-e+2*a);return i=l(u+f*a,f),c&&i.reverse(),o=f*(1-e),n={t:"rangeBands",a:arguments},s},s.rangeRoundBands=function(t,e,a){arguments.length<2&&(e=0),arguments.length<3&&(a=e);var c=t[1]<t[0],u=t[c-0],h=t[1-c],f=Math.floor((h-u)/(r.length-e+2*a));return i=l(u+Math.round((h-u-(r.length-e)*f)/2),f),c&&i.reverse(),o=Math.round(f*(1-e)),n={t:"rangeRoundBands",a:arguments},s},s.rangeBand=function(){return o},s.rangeExtent=function(){return go(n.a[0])},s.copy=function(){return e(r,n)},s.domain(r)}([],{t:"range",a:[[]]})},t.scale.category10=function(){return t.scale.ordinal().range(Io)},t.scale.category20=function(){return t.scale.ordinal().range(zo)},t.scale.category20b=function(){return t.scale.ordinal().range(Oo)},t.scale.category20c=function(){return t.scale.ordinal().range(Do)};var Io=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(ie),zo=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(ie),Oo=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(ie),Do=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(ie);function Ro(){return 0}t.scale.quantile=function(){return function e(r,n){var a;function i(){var e=0,i=n.length;for(a=[];++e<i;)a[e-1]=t.quantile(r,e/i);return o}function o(e){if(!isNaN(e=+e))return n[t.bisect(a,e)]}return o.domain=function(t){return arguments.length?(r=t.map(p).filter(d).sort(f),i()):r},o.range=function(t){return arguments.length?(n=t,i()):n},o.quantiles=function(){return a},o.invertExtent=function(t){return(t=n.indexOf(t))<0?[NaN,NaN]:[t>0?a[t-1]:r[0],t<a.length?a[t]:r[r.length-1]]},o.copy=function(){return e(r,n)},i()}([],[])},t.scale.quantize=function(){return function t(e,r,n){var a,i;function o(t){return n[Math.max(0,Math.min(i,Math.floor(a*(t-e))))]}function s(){return a=n.length/(r-e),i=n.length-1,o}return o.domain=function(t){return arguments.length?(e=+t[0],r=+t[t.length-1],s()):[e,r]},o.range=function(t){return arguments.length?(n=t,s()):n},o.invertExtent=function(t){return[t=(t=n.indexOf(t))<0?NaN:t/a+e,t+1/a]},o.copy=function(){return t(e,r,n)},s()}(0,1,[0,1])},t.scale.threshold=function(){return function e(r,n){function a(e){if(e<=e)return n[t.bisect(r,e)]}return a.domain=function(t){return arguments.length?(r=t,a):r},a.range=function(t){return arguments.length?(n=t,a):n},a.invertExtent=function(t){return t=n.indexOf(t),[r[t-1],r[t]]},a.copy=function(){return e(r,n)},a}([.5],[0,1])},t.scale.identity=function(){return function t(e){function r(t){return+t}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(e=t.map(r),r):e},r.ticks=function(t){return Ao(e,t)},r.tickFormat=function(t,r){return Mo(e,t,r)},r.copy=function(){return t(e)},r}([0,1])},t.svg={},t.svg.arc=function(){var t=Bo,e=No,r=Ro,n=Fo,a=jo,i=Vo,o=Uo;function s(){var s=Math.max(0,+t.apply(this,arguments)),c=Math.max(0,+e.apply(this,arguments)),u=a.apply(this,arguments)-Ct,h=i.apply(this,arguments)-Ct,f=Math.abs(h-u),p=u>h?0:1;if(c<s&&(d=c,c=s,s=d),f>=Et)return l(c,p)+(s?l(s,1-p):"")+"Z";var d,g,m,v,y,x,b,_,w,T,k,A,M=0,S=0,E=[];if((v=(+o.apply(this,arguments)||0)/2)&&(m=n===Fo?Math.sqrt(s*s+c*c):+n.apply(this,arguments),p||(S*=-1),c&&(S=Dt(m/c*Math.sin(v))),s&&(M=Dt(m/s*Math.sin(v)))),c){y=c*Math.cos(u+S),x=c*Math.sin(u+S),b=c*Math.cos(h-S),_=c*Math.sin(h-S);var C=Math.abs(h-u-2*S)<=Mt?0:1;if(S&&qo(y,x,b,_)===p^C){var L=(u+h)/2;y=c*Math.cos(L),x=c*Math.sin(L),b=_=null}}else y=x=0;if(s){w=s*Math.cos(h-M),T=s*Math.sin(h-M),k=s*Math.cos(u+M),A=s*Math.sin(u+M);var P=Math.abs(u-h+2*M)<=Mt?0:1;if(M&&qo(w,T,k,A)===1-p^P){var I=(u+h)/2;w=s*Math.cos(I),T=s*Math.sin(I),k=A=null}}else w=T=0;if(f>kt&&(d=Math.min(Math.abs(c-s)/2,+r.apply(this,arguments)))>.001){g=s<c^p?0:1;var z=d,O=d;if(f<Mt){var D=null==k?[w,T]:null==b?[y,x]:la([y,x],[k,A],[b,_],[w,T]),R=y-D[0],F=x-D[1],B=b-D[0],N=_-D[1],j=1/Math.sin(Math.acos((R*B+F*N)/(Math.sqrt(R*R+F*F)*Math.sqrt(B*B+N*N)))/2),V=Math.sqrt(D[0]*D[0]+D[1]*D[1]);O=Math.min(d,(s-V)/(j-1)),z=Math.min(d,(c-V)/(j+1))}if(null!=b){var U=Ho(null==k?[w,T]:[k,A],[y,x],c,z,p),q=Ho([b,_],[w,T],c,z,p);d===z?E.push("M",U[0],"A",z,",",z," 0 0,",g," ",U[1],"A",c,",",c," 0 ",1-p^qo(U[1][0],U[1][1],q[1][0],q[1][1]),",",p," ",q[1],"A",z,",",z," 0 0,",g," ",q[0]):E.push("M",U[0],"A",z,",",z," 0 1,",g," ",q[0])}else E.push("M",y,",",x);if(null!=k){var H=Ho([y,x],[k,A],s,-O,p),G=Ho([w,T],null==b?[y,x]:[b,_],s,-O,p);d===O?E.push("L",G[0],"A",O,",",O," 0 0,",g," ",G[1],"A",s,",",s," 0 ",p^qo(G[1][0],G[1][1],H[1][0],H[1][1]),",",1-p," ",H[1],"A",O,",",O," 0 0,",g," ",H[0]):E.push("L",G[0],"A",O,",",O," 0 0,",g," ",H[0])}else E.push("L",w,",",T)}else E.push("M",y,",",x),null!=b&&E.push("A",c,",",c," 0 ",C,",",p," ",b,",",_),E.push("L",w,",",T),null!=k&&E.push("A",s,",",s," 0 ",P,",",1-p," ",k,",",A);return E.push("Z"),E.join("")}function l(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}return s.innerRadius=function(e){return arguments.length?(t=de(e),s):t},s.outerRadius=function(t){return arguments.length?(e=de(t),s):e},s.cornerRadius=function(t){return arguments.length?(r=de(t),s):r},s.padRadius=function(t){return arguments.length?(n=t==Fo?Fo:de(t),s):n},s.startAngle=function(t){return arguments.length?(a=de(t),s):a},s.endAngle=function(t){return arguments.length?(i=de(t),s):i},s.padAngle=function(t){return arguments.length?(o=de(t),s):o},s.centroid=function(){var r=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+a.apply(this,arguments)+ +i.apply(this,arguments))/2-Ct;return[Math.cos(n)*r,Math.sin(n)*r]},s};var Fo="auto";function Bo(t){return t.innerRadius}function No(t){return t.outerRadius}function jo(t){return t.startAngle}function Vo(t){return t.endAngle}function Uo(t){return t&&t.padAngle}function qo(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function Ho(t,e,r,n,a){var i=t[0]-e[0],o=t[1]-e[1],s=(a?n:-n)/Math.sqrt(i*i+o*o),l=s*o,c=-s*i,u=t[0]+l,h=t[1]+c,f=e[0]+l,p=e[1]+c,d=(u+f)/2,g=(h+p)/2,m=f-u,v=p-h,y=m*m+v*v,x=r-n,b=u*p-f*h,_=(v<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*v-m*_)/y,T=(-b*m-v*_)/y,k=(b*v+m*_)/y,A=(-b*m+v*_)/y,M=w-d,S=T-g,E=k-d,C=A-g;return M*M+S*S>E*E+C*C&&(w=k,T=A),[[w-l,T-c],[w*r/x,T*r/x]]}function Go(t){var e=ra,r=na,n=Yr,a=Wo,i=a.key,o=.7;function s(i){var s,l=[],c=[],u=-1,h=i.length,f=de(e),p=de(r);function d(){l.push("M",a(t(c),o))}for(;++u<h;)n.call(this,s=i[u],u)?c.push([+f.call(this,s,u),+p.call(this,s,u)]):c.length&&(d(),c=[]);return c.length&&d(),l.length?l.join(""):null}return s.x=function(t){return arguments.length?(e=t,s):e},s.y=function(t){return arguments.length?(r=t,s):r},s.defined=function(t){return arguments.length?(n=t,s):n},s.interpolate=function(t){return arguments.length?(i="function"==typeof t?a=t:(a=Yo.get(t)||Wo).key,s):i},s.tension=function(t){return arguments.length?(o=t,s):o},s}t.svg.line=function(){return Go(L)};var Yo=t.map({linear:Wo,"linear-closed":Zo,step:function(t){var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];for(;++e<r;)a.push("H",(n[0]+(n=t[e])[0])/2,"V",n[1]);r>1&&a.push("H",n[0]);return a.join("")},"step-before":Xo,"step-after":Jo,basis:$o,"basis-open":function(t){if(t.length<4)return Wo(t);var e,r=[],n=-1,a=t.length,i=[0],o=[0];for(;++n<3;)e=t[n],i.push(e[0]),o.push(e[1]);r.push(ts(ns,i)+","+ts(ns,o)),--n;for(;++n<a;)e=t[n],i.shift(),i.push(e[0]),o.shift(),o.push(e[1]),as(r,i,o);return r.join("")},"basis-closed":function(t){var e,r,n=-1,a=t.length,i=a+4,o=[],s=[];for(;++n<4;)r=t[n%a],o.push(r[0]),s.push(r[1]);e=[ts(ns,o),",",ts(ns,s)],--n;for(;++n<i;)r=t[n%a],o.shift(),o.push(r[0]),s.shift(),s.push(r[1]),as(e,o,s);return e.join("")},bundle:function(t,e){var r=t.length-1;if(r)for(var n,a,i=t[0][0],o=t[0][1],s=t[r][0]-i,l=t[r][1]-o,c=-1;++c<=r;)n=t[c],a=c/r,n[0]=e*n[0]+(1-e)*(i+a*s),n[1]=e*n[1]+(1-e)*(o+a*l);return $o(t)},cardinal:function(t,e){return t.length<3?Wo(t):t[0]+Ko(t,Qo(t,e))},"cardinal-open":function(t,e){return t.length<4?Wo(t):t[1]+Ko(t.slice(1,-1),Qo(t,e))},"cardinal-closed":function(t,e){return t.length<3?Zo(t):t[0]+Ko((t.push(t[0]),t),Qo([t[t.length-2]].concat(t,[t[1]]),e))},monotone:function(t){return t.length<3?Wo(t):t[0]+Ko(t,function(t){var e,r,n,a,i=[],o=function(t){var e=0,r=t.length-1,n=[],a=t[0],i=t[1],o=n[0]=is(a,i);for(;++e<r;)n[e]=(o+(o=is(a=i,i=t[e+1])))/2;return n[e]=o,n}(t),s=-1,l=t.length-1;for(;++s<l;)e=is(t[s],t[s+1]),y(e)<kt?o[s]=o[s+1]=0:(r=o[s]/e,n=o[s+1]/e,(a=r*r+n*n)>9&&(a=3*e/Math.sqrt(a),o[s]=a*r,o[s+1]=a*n));s=-1;for(;++s<=l;)a=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),i.push([a||0,o[s]*a||0]);return i}(t))}});function Wo(t){return t.length>1?t.join("L"):t+"Z"}function Zo(t){return t.join("L")+"Z"}function Xo(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e<r;)a.push("V",(n=t[e])[1],"H",n[0]);return a.join("")}function Jo(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e<r;)a.push("H",(n=t[e])[0],"V",n[1]);return a.join("")}function Ko(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return Wo(t);var r=t.length!=e.length,n="",a=t[0],i=t[1],o=e[0],s=o,l=1;if(r&&(n+="Q"+(i[0]-2*o[0]/3)+","+(i[1]-2*o[1]/3)+","+i[0]+","+i[1],a=t[1],l=2),e.length>1){s=e[1],i=t[l],l++,n+="C"+(a[0]+o[0])+","+(a[1]+o[1])+","+(i[0]-s[0])+","+(i[1]-s[1])+","+i[0]+","+i[1];for(var c=2;c<e.length;c++,l++)i=t[l],s=e[c],n+="S"+(i[0]-s[0])+","+(i[1]-s[1])+","+i[0]+","+i[1]}if(r){var u=t[l];n+="Q"+(i[0]+2*s[0]/3)+","+(i[1]+2*s[1]/3)+","+u[0]+","+u[1]}return n}function Qo(t,e){for(var r,n=[],a=(1-e)/2,i=t[0],o=t[1],s=1,l=t.length;++s<l;)r=i,i=o,o=t[s],n.push([a*(o[0]-r[0]),a*(o[1]-r[1])]);return n}function $o(t){if(t.length<3)return Wo(t);var e=1,r=t.length,n=t[0],a=n[0],i=n[1],o=[a,a,a,(n=t[1])[0]],s=[i,i,i,n[1]],l=[a,",",i,"L",ts(ns,o),",",ts(ns,s)];for(t.push(t[r-1]);++e<=r;)n=t[e],o.shift(),o.push(n[0]),s.shift(),s.push(n[1]),as(l,o,s);return t.pop(),l.push("L",n),l.join("")}function ts(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}Yo.forEach((function(t,e){e.key=t,e.closed=/-closed$/.test(t)}));var es=[0,2/3,1/3,0],rs=[0,1/3,2/3,0],ns=[0,1/6,2/3,1/6];function as(t,e,r){t.push("C",ts(es,e),",",ts(es,r),",",ts(rs,e),",",ts(rs,r),",",ts(ns,e),",",ts(ns,r))}function is(t,e){return(e[1]-t[1])/(e[0]-t[0])}function os(t){for(var e,r,n,a=-1,i=t.length;++a<i;)r=(e=t[a])[0],n=e[1]-Ct,e[0]=r*Math.cos(n),e[1]=r*Math.sin(n);return t}function ss(t){var e=ra,r=ra,n=0,a=na,i=Yr,o=Wo,s=o.key,l=o,c="L",u=.7;function h(s){var h,f,p,d=[],g=[],m=[],v=-1,y=s.length,x=de(e),b=de(n),_=e===r?function(){return f}:de(r),w=n===a?function(){return p}:de(a);function T(){d.push("M",o(t(m),u),c,l(t(g.reverse()),u),"Z")}for(;++v<y;)i.call(this,h=s[v],v)?(g.push([f=+x.call(this,h,v),p=+b.call(this,h,v)]),m.push([+_.call(this,h,v),+w.call(this,h,v)])):g.length&&(T(),g=[],m=[]);return g.length&&T(),d.length?d.join(""):null}return h.x=function(t){return arguments.length?(e=r=t,h):r},h.x0=function(t){return arguments.length?(e=t,h):e},h.x1=function(t){return arguments.length?(r=t,h):r},h.y=function(t){return arguments.length?(n=a=t,h):a},h.y0=function(t){return arguments.length?(n=t,h):n},h.y1=function(t){return arguments.length?(a=t,h):a},h.defined=function(t){return arguments.length?(i=t,h):i},h.interpolate=function(t){return arguments.length?(s="function"==typeof t?o=t:(o=Yo.get(t)||Wo).key,l=o.reverse||o,c=o.closed?"M":"L",h):s},h.tension=function(t){return arguments.length?(u=t,h):u},h}function ls(t){return t.radius}function cs(t){return[t.x,t.y]}function us(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Ct;return[r*Math.cos(n),r*Math.sin(n)]}}function hs(){return 64}function fs(){return"circle"}function ps(t){var e=Math.sqrt(t/Mt);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}t.svg.line.radial=function(){var t=Go(os);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},Xo.reverse=Jo,Jo.reverse=Xo,t.svg.area=function(){return ss(L)},t.svg.area.radial=function(){var t=ss(os);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},t.svg.chord=function(){var t=Un,e=qn,r=ls,n=jo,a=Vo;function i(r,n){var a,i,c=o(this,t,r,n),u=o(this,e,r,n);return"M"+c.p0+s(c.r,c.p1,c.a1-c.a0)+(i=u,((a=c).a0==i.a0&&a.a1==i.a1?l(c.r,c.p1,c.r,c.p0):l(c.r,c.p1,u.r,u.p0)+s(u.r,u.p1,u.a1-u.a0)+l(u.r,u.p1,c.r,c.p0))+"Z")}function o(t,e,i,o){var s=e.call(t,i,o),l=r.call(t,s,o),c=n.call(t,s,o)-Ct,u=a.call(t,s,o)-Ct;return{r:l,a0:c,a1:u,p0:[l*Math.cos(c),l*Math.sin(c)],p1:[l*Math.cos(u),l*Math.sin(u)]}}function s(t,e,r){return"A"+t+","+t+" 0 "+ +(r>Mt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return i.radius=function(t){return arguments.length?(r=de(t),i):r},i.source=function(e){return arguments.length?(t=de(e),i):t},i.target=function(t){return arguments.length?(e=de(t),i):e},i.startAngle=function(t){return arguments.length?(n=de(t),i):n},i.endAngle=function(t){return arguments.length?(a=de(t),i):a},i},t.svg.diagonal=function(){var t=Un,e=qn,r=cs;function n(n,a){var i=t.call(this,n,a),o=e.call(this,n,a),s=(i.y+o.y)/2,l=[i,{x:i.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=de(e),n):t},n.target=function(t){return arguments.length?(e=de(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=cs,n=e.projection;return e.projection=function(t){return arguments.length?n(us(r=t)):r},e},t.svg.symbol=function(){var t=fs,e=hs;function r(r,n){return(ds.get(t.call(this,r,n))||ps)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=de(e),r):t},r.size=function(t){return arguments.length?(e=de(t),r):e},r};var ds=t.map({circle:ps,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*ms)),r=e*ms;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/gs),r=e*gs/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/gs),r=e*gs/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=ds.keys();var gs=Math.sqrt(3),ms=Math.tan(30*Lt);Y.transition=function(t){for(var e,r,n=bs||++Ts,a=Ms(t),i=[],o=_s||{time:Date.now(),ease:ci,delay:0,duration:250},s=-1,l=this.length;++s<l;){i.push(e=[]);for(var c=this[s],u=-1,h=c.length;++u<h;)(r=c[u])&&Ss(r,u,a,n,o),e.push(r)}return xs(i,a,n)},Y.interrupt=function(t){return this.each(null==t?vs:ys(Ms(t)))};var vs=ys(Ms());function ys(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 xs(t,e,r){return V(t,ws),t.namespace=e,t.id=r,t}var bs,_s,ws=[],Ts=0;function ks(t,e,r,n){var a=t.id,i=t.namespace;return ut(t,"function"==typeof r?function(t,o,s){t[i][a].tween.set(e,n(r.call(t,t.__data__,o,s)))}:(r=n(r),function(t){t[i][a].tween.set(e,r)}))}function As(t){return null==t&&(t=""),function(){this.textContent=t}}function Ms(t){return null==t?"__transition__":"__transition_"+t+"__"}function Ss(t,e,r,n,a){var i,o,s,l,c,u=t[r]||(t[r]={active:0,count:0}),h=u[n];function f(r){var a=u.active,f=u[a];for(var d in f&&(f.timer.c=null,f.timer.t=NaN,--u.count,delete u[a],f.event&&f.event.interrupt.call(t,t.__data__,f.index)),u)if(+d<n){var g=u[d];g.timer.c=null,g.timer.t=NaN,--u.count,delete u[d]}o.c=p,we((function(){return o.c&&p(r||1)&&(o.c=null,o.t=NaN),1}),0,i),u.active=n,h.event&&h.event.start.call(t,t.__data__,e),c=[],h.tween.forEach((function(r,n){(n=n.call(t,t.__data__,e))&&c.push(n)})),l=h.ease,s=h.duration}function p(a){for(var i=a/s,o=l(i),f=c.length;f>0;)c[--f].call(t,o);if(i>=1)return h.event&&h.event.end.call(t,t.__data__,e),--u.count?delete u[n]:delete t[r],1}h||(i=a.time,o=we((function(t){var e=h.delay;if(o.t=e+i,e<=t)return f(t-e);o.c=f}),0,i),h=u[n]={tween:new _,time:i,timer:o,delay:a.delay,duration:a.duration,ease:a.ease,index:e},a=null,++u.count)}ws.call=Y.call,ws.empty=Y.empty,ws.node=Y.node,ws.size=Y.size,t.transition=function(e,r){return e&&e.transition?bs?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=ws,ws.select=function(t){var e,r,n,a=this.id,i=this.namespace,o=[];t=W(t);for(var s=-1,l=this.length;++s<l;){o.push(e=[]);for(var c=this[s],u=-1,h=c.length;++u<h;)(n=c[u])&&(r=t.call(n,n.__data__,u,s))?("__data__"in n&&(r.__data__=n.__data__),Ss(r,u,i,a,n[i][a]),e.push(r)):e.push(null)}return xs(o,i,a)},ws.selectAll=function(t){var e,r,n,a,i,o=this.id,s=this.namespace,l=[];t=Z(t);for(var c=-1,u=this.length;++c<u;)for(var h=this[c],f=-1,p=h.length;++f<p;)if(n=h[f]){i=n[s][o],r=t.call(n,n.__data__,f,c),l.push(e=[]);for(var d=-1,g=r.length;++d<g;)(a=r[d])&&Ss(a,d,s,o,i),e.push(a)}return xs(l,s,o)},ws.filter=function(t){var e,r,n=[];"function"!=typeof t&&(t=lt(t));for(var a=0,i=this.length;a<i;a++){n.push(e=[]);for(var o,s=0,l=(o=this[a]).length;s<l;s++)(r=o[s])&&t.call(r,r.__data__,s,a)&&e.push(r)}return xs(n,this.namespace,this.id)},ws.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):ut(this,null==e?function(e){e[n][r].tween.remove(t)}:function(a){a[n][r].tween.set(t,e)})},ws.attr=function(e,r){if(arguments.length<2){for(r in e)this.attr(r,e[r]);return this}var n="transform"==e?bi:$a,a=t.ns.qualify(e);function i(){this.removeAttribute(a)}function o(){this.removeAttributeNS(a.space,a.local)}function s(t){return null==t?i:(t+="",function(){var e,r=this.getAttribute(a);return r!==t&&(e=n(r,t),function(t){this.setAttribute(a,e(t))})})}function l(t){return null==t?o:(t+="",function(){var e,r=this.getAttributeNS(a.space,a.local);return r!==t&&(e=n(r,t),function(t){this.setAttributeNS(a.space,a.local,e(t))})})}return ks(this,"attr."+e,r,a.local?l:s)},ws.attrTween=function(e,r){var n=t.ns.qualify(e);return this.tween("attr."+e,n.local?function(t,e){var a=r.call(this,t,e,this.getAttributeNS(n.space,n.local));return a&&function(t){this.setAttributeNS(n.space,n.local,a(t))}}:function(t,e){var a=r.call(this,t,e,this.getAttribute(n));return a&&function(t){this.setAttribute(n,a(t))}})},ws.style=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=""),t)this.style(r,t[r],e);return this}r=""}function a(){this.style.removeProperty(t)}function i(e){return null==e?a:(e+="",function(){var n,a=o(this).getComputedStyle(this,null).getPropertyValue(t);return a!==e&&(n=$a(a,e),function(e){this.style.setProperty(t,n(e),r)})})}return ks(this,"style."+t,e,i)},ws.styleTween=function(t,e,r){function n(n,a){var i=e.call(this,n,a,o(this).getComputedStyle(this,null).getPropertyValue(t));return i&&function(e){this.style.setProperty(t,i(e),r)}}return arguments.length<3&&(r=""),this.tween("style."+t,n)},ws.text=function(t){return ks(this,"text",t,As)},ws.remove=function(){var t=this.namespace;return this.each("end.transition",(function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)}))},ws.ease=function(e){var r=this.id,n=this.namespace;return arguments.length<1?this.node()[n][r].ease:("function"!=typeof e&&(e=t.ease.apply(t,arguments)),ut(this,(function(t){t[n][r].ease=e})))},ws.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:ut(this,"function"==typeof t?function(n,a,i){n[r][e].delay=+t.call(n,n.__data__,a,i)}:(t=+t,function(n){n[r][e].delay=t}))},ws.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:ut(this,"function"==typeof t?function(n,a,i){n[r][e].duration=Math.max(1,t.call(n,n.__data__,a,i))}:(t=Math.max(1,t),function(n){n[r][e].duration=t}))},ws.each=function(e,r){var n=this.id,a=this.namespace;if(arguments.length<2){var i=_s,o=bs;try{bs=n,ut(this,(function(t,r,i){_s=t[a][n],e.call(t,t.__data__,r,i)}))}finally{_s=i,bs=o}}else ut(this,(function(i){var o=i[a][n];(o.event||(o.event=t.dispatch("start","end","interrupt"))).on(e,r)}));return this},ws.transition=function(){for(var t,e,r,n=this.id,a=++Ts,i=this.namespace,o=[],s=0,l=this.length;s<l;s++){o.push(t=[]);for(var c,u=0,h=(c=this[s]).length;u<h;u++)(e=c[u])&&Ss(e,u,i,a,{time:(r=e[i][n]).time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration}),t.push(e)}return xs(o,i,a)},t.svg.axis=function(){var e,r=t.scale.linear(),a=Es,i=6,o=6,s=3,l=[10],c=null;function u(n){n.each((function(){var n,u=t.select(this),h=this.__chart__||r,f=this.__chart__=r.copy(),p=null==c?f.ticks?f.ticks.apply(f,l):f.domain():c,d=null==e?f.tickFormat?f.tickFormat.apply(f,l):L:e,g=u.selectAll(".tick").data(p,f),m=g.enter().insert("g",".domain").attr("class","tick").style("opacity",kt),v=t.transition(g.exit()).style("opacity",kt).remove(),y=t.transition(g.order()).style("opacity",1),x=Math.max(i,0)+s,b=mo(f),_=u.selectAll(".domain").data([0]),w=(_.enter().append("path").attr("class","domain"),t.transition(_));m.append("line"),m.append("text");var T,k,A,M,S=m.select("line"),E=y.select("line"),C=g.select("text").text(d),P=m.select("text"),I=y.select("text"),z="top"===a||"left"===a?-1:1;if("bottom"===a||"top"===a?(n=Ls,T="x",A="y",k="x2",M="y2",C.attr("dy",z<0?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+b[0]+","+z*o+"V0H"+b[1]+"V"+z*o)):(n=Ps,T="y",A="x",k="y2",M="x2",C.attr("dy",".32em").style("text-anchor",z<0?"end":"start"),w.attr("d","M"+z*o+","+b[0]+"H0V"+b[1]+"H"+z*o)),S.attr(M,z*i),P.attr(A,z*x),E.attr(k,0).attr(M,z*i),I.attr(T,0).attr(A,z*x),f.rangeBand){var O=f,D=O.rangeBand()/2;h=f=function(t){return O(t)+D}}else h.rangeBand?h=f:v.call(n,f,h);m.call(n,h,f),y.call(n,f,f)}))}return u.scale=function(t){return arguments.length?(r=t,u):r},u.orient=function(t){return arguments.length?(a=t in Cs?t+"":Es,u):a},u.ticks=function(){return arguments.length?(l=n(arguments),u):l},u.tickValues=function(t){return arguments.length?(c=t,u):c},u.tickFormat=function(t){return arguments.length?(e=t,u):e},u.tickSize=function(t){var e=arguments.length;return e?(i=+t,o=+arguments[e-1],u):i},u.innerTickSize=function(t){return arguments.length?(i=+t,u):i},u.outerTickSize=function(t){return arguments.length?(o=+t,u):o},u.tickPadding=function(t){return arguments.length?(s=+t,u):s},u.tickSubdivide=function(){return arguments.length&&u},u};var Es="bottom",Cs={top:1,right:1,bottom:1,left:1};function Ls(t,e,r){t.attr("transform",(function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"}))}function Ps(t,e,r){t.attr("transform",(function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"}))}t.svg.brush=function(){var e,r,n=N(f,"brushstart","brush","brushend"),a=null,i=null,s=[0,0],l=[0,0],c=!0,u=!0,h=zs[0];function f(e){e.each((function(){var e=t.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",m).on("touchstart.brush",m),r=e.selectAll(".background").data([0]);r.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),e.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var n=e.selectAll(".resize").data(h,L);n.exit().remove(),n.enter().append("g").attr("class",(function(t){return"resize "+t})).style("cursor",(function(t){return Is[t]})).append("rect").attr("x",(function(t){return/[ew]$/.test(t)?-3:null})).attr("y",(function(t){return/^[ns]/.test(t)?-3:null})).attr("width",6).attr("height",6).style("visibility","hidden"),n.style("display",f.empty()?"none":null);var o,s=t.transition(e),l=t.transition(r);a&&(o=mo(a),l.attr("x",o[0]).attr("width",o[1]-o[0]),d(s)),i&&(o=mo(i),l.attr("y",o[0]).attr("height",o[1]-o[0]),g(s)),p(s)}))}function p(t){t.selectAll(".resize").attr("transform",(function(t){return"translate("+s[+/e$/.test(t)]+","+l[+/^s/.test(t)]+")"}))}function d(t){t.select(".extent").attr("x",s[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1]-s[0])}function g(t){t.select(".extent").attr("y",l[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function m(){var h,m,v=this,y=t.select(t.event.target),x=n.of(v,arguments),b=t.select(v),_=y.datum(),w=!/^(n|s)$/.test(_)&&a,T=!/^(e|w)$/.test(_)&&i,k=y.classed("extent"),A=bt(v),M=t.mouse(v),S=t.select(o(v)).on("keydown.brush",L).on("keyup.brush",P);if(t.event.changedTouches?S.on("touchmove.brush",I).on("touchend.brush",O):S.on("mousemove.brush",I).on("mouseup.brush",O),b.interrupt().selectAll("*").interrupt(),k)M[0]=s[0]-M[0],M[1]=l[0]-M[1];else if(_){var E=+/w$/.test(_),C=+/^n/.test(_);m=[s[1-E]-M[0],l[1-C]-M[1]],M[0]=s[E],M[1]=l[C]}else t.event.altKey&&(h=M.slice());function L(){32==t.event.keyCode&&(k||(h=null,M[0]-=s[1],M[1]-=l[1],k=2),F())}function P(){32==t.event.keyCode&&2==k&&(M[0]+=s[1],M[1]+=l[1],k=0,F())}function I(){var e=t.mouse(v),r=!1;m&&(e[0]+=m[0],e[1]+=m[1]),k||(t.event.altKey?(h||(h=[(s[0]+s[1])/2,(l[0]+l[1])/2]),M[0]=s[+(e[0]<h[0])],M[1]=l[+(e[1]<h[1])]):h=null),w&&z(e,a,0)&&(d(b),r=!0),T&&z(e,i,1)&&(g(b),r=!0),r&&(p(b),x({type:"brush",mode:k?"move":"resize"}))}function z(t,n,a){var i,o,f=mo(n),p=f[0],d=f[1],g=M[a],m=a?l:s,v=m[1]-m[0];if(k&&(p-=g,d-=v+g),i=(a?u:c)?Math.max(p,Math.min(d,t[a])):t[a],k?o=(i+=g)+v:(h&&(g=Math.max(p,Math.min(d,2*h[a]-i))),g<i?(o=i,i=g):o=g),m[0]!=i||m[1]!=o)return a?r=null:e=null,m[0]=i,m[1]=o,!0}function O(){I(),b.style("pointer-events","all").selectAll(".resize").style("display",f.empty()?"none":null),t.select("body").style("cursor",null),S.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),A(),x({type:"brushend"})}b.style("pointer-events","none").selectAll(".resize").style("display",null),t.select("body").style("cursor",y.style("cursor")),x({type:"brushstart"}),I()}return f.event=function(a){a.each((function(){var a=n.of(this,arguments),i={x:s,y:l,i:e,j:r},o=this.__chart__||i;this.__chart__=i,bs?t.select(this).transition().each("start.brush",(function(){e=o.i,r=o.j,s=o.x,l=o.y,a({type:"brushstart"})})).tween("brush:brush",(function(){var t=ti(s,i.x),n=ti(l,i.y);return e=r=null,function(e){s=i.x=t(e),l=i.y=n(e),a({type:"brush",mode:"resize"})}})).each("end.brush",(function(){e=i.i,r=i.j,a({type:"brush",mode:"resize"}),a({type:"brushend"})})):(a({type:"brushstart"}),a({type:"brush",mode:"resize"}),a({type:"brushend"}))}))},f.x=function(t){return arguments.length?(h=zs[!(a=t)<<1|!i],f):a},f.y=function(t){return arguments.length?(h=zs[!a<<1|!(i=t)],f):i},f.clamp=function(t){return arguments.length?(a&&i?(c=!!t[0],u=!!t[1]):a?c=!!t:i&&(u=!!t),f):a&&i?[c,u]:a?c:i?u:null},f.extent=function(t){var n,o,c,u,h;return arguments.length?(a&&(n=t[0],o=t[1],i&&(n=n[0],o=o[0]),e=[n,o],a.invert&&(n=a(n),o=a(o)),o<n&&(h=n,n=o,o=h),n==s[0]&&o==s[1]||(s=[n,o])),i&&(c=t[0],u=t[1],a&&(c=c[1],u=u[1]),r=[c,u],i.invert&&(c=i(c),u=i(u)),u<c&&(h=c,c=u,u=h),c==l[0]&&u==l[1]||(l=[c,u])),f):(a&&(e?(n=e[0],o=e[1]):(n=s[0],o=s[1],a.invert&&(n=a.invert(n),o=a.invert(o)),o<n&&(h=n,n=o,o=h))),i&&(r?(c=r[0],u=r[1]):(c=l[0],u=l[1],i.invert&&(c=i.invert(c),u=i.invert(u)),u<c&&(h=c,c=u,u=h))),a&&i?[[n,c],[o,u]]:a?[n,o]:i&&[c,u])},f.clear=function(){return f.empty()||(s=[0,0],l=[0,0],e=r=null),f},f.empty=function(){return!!a&&s[0]==s[1]||!!i&&l[0]==l[1]},t.rebind(f,n,"on")};var Is={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},zs=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Os=Ie.format=sr.timeFormat,Ds=Os.utc,Rs=Ds("%Y-%m-%dT%H:%M:%S.%LZ");function Fs(t){return t.toISOString()}function Bs(e,r,n){function a(t){return e(t)}function i(e,n){var a=(e[1]-e[0])/n,i=t.bisect(js,a);return i==js.length?[r.year,ko(e.map((function(t){return t/31536e6})),n)[2]]:i?r[a/js[i-1]<js[i]/a?i-1:i]:[qs,ko(e,n)[2]]}return a.invert=function(t){return Ns(e.invert(t))},a.domain=function(t){return arguments.length?(e.domain(t),a):e.domain().map(Ns)},a.nice=function(t,e){var r=a.domain(),n=go(r),o=null==t?i(n,10):"number"==typeof t&&i(n,t);function s(r){return!isNaN(r)&&!t.range(r,Ns(+r+1),e).length}return o&&(t=o[0],e=o[1]),a.domain(yo(r,e>1?{floor:function(e){for(;s(e=t.floor(e));)e=Ns(e-1);return e},ceil:function(e){for(;s(e=t.ceil(e));)e=Ns(+e+1);return e}}:t))},a.ticks=function(t,e){var r=go(a.domain()),n=null==t?i(r,10):"number"==typeof t?i(r,t):!t.range&&[{range:t},e];return n&&(t=n[0],e=n[1]),t.range(r[0],Ns(+r[1]+1),e<1?1:e)},a.tickFormat=function(){return n},a.copy=function(){return Bs(e.copy(),r,n)},wo(a,e)}function Ns(t){return new Date(t)}Os.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Fs:Rs,Fs.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Fs.toString=Rs.toString,Ie.second=Re((function(t){return new ze(1e3*Math.floor(t/1e3))}),(function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))}),(function(t){return t.getSeconds()})),Ie.seconds=Ie.second.range,Ie.seconds.utc=Ie.second.utc.range,Ie.minute=Re((function(t){return new ze(6e4*Math.floor(t/6e4))}),(function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))}),(function(t){return t.getMinutes()})),Ie.minutes=Ie.minute.range,Ie.minutes.utc=Ie.minute.utc.range,Ie.hour=Re((function(t){var e=t.getTimezoneOffset()/60;return new ze(36e5*(Math.floor(t/36e5-e)+e))}),(function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))}),(function(t){return t.getHours()})),Ie.hours=Ie.hour.range,Ie.hours.utc=Ie.hour.utc.range,Ie.month=Re((function(t){return(t=Ie.day(t)).setDate(1),t}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t){return t.getMonth()})),Ie.months=Ie.month.range,Ie.months.utc=Ie.month.utc.range;var js=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Vs=[[Ie.second,1],[Ie.second,5],[Ie.second,15],[Ie.second,30],[Ie.minute,1],[Ie.minute,5],[Ie.minute,15],[Ie.minute,30],[Ie.hour,1],[Ie.hour,3],[Ie.hour,6],[Ie.hour,12],[Ie.day,1],[Ie.day,2],[Ie.week,1],[Ie.month,1],[Ie.month,3],[Ie.year,1]],Us=Os.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Yr]]),qs={range:function(e,r,n){return t.range(Math.ceil(e/n)*n,+r,n).map(Ns)},floor:L,ceil:L};Vs.year=Ie.year,Ie.scale=function(){return Bs(t.scale.linear(),Vs,Us)};var Hs=Vs.map((function(t){return[t[0].utc,t[1]]})),Gs=Ds.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Yr]]);function Ys(t){return JSON.parse(t.responseText)}function Ws(t){var e=a.createRange();return e.selectNode(a.body),e.createContextualFragment(t.responseText)}Hs.year=Ie.year.utc,Ie.scale.utc=function(){return Bs(t.scale.linear(),Hs,Gs)},t.text=ge((function(t){return t.responseText})),t.json=function(t,e){return me(t,"application/json",Ys,e)},t.html=function(t,e){return me(t,"text/html",Ws,e)},t.xml=ge((function(t){return t.responseXML})),"object"==typeof e&&e.exports?e.exports=t:this.d3=t}()},{}],165:[function(t,e,r){e.exports=function(){for(var t=0;t<arguments.length;t++)if(void 0!==arguments[t])return arguments[t]}},{}],166:[function(t,e,r){"use strict";var n=t("incremental-convex-hull"),a=t("uniq");function i(t,e){this.point=t,this.index=e}function o(t,e){for(var r=t.point,n=e.point,a=r.length,i=0;i<a;++i){var o=n[i]-r[i];if(o)return o}return 0}e.exports=function(t,e){var r=t.length;if(0===r)return[];var s=t[0].length;if(s<1)return[];if(1===s)return function(t,e,r){if(1===t)return r?[[-1,0]]:[];var n=e.map((function(t,e){return[t[0],e]}));n.sort((function(t,e){return t[0]-e[0]}));for(var a=new Array(t-1),i=1;i<t;++i){var o=n[i-1],s=n[i];a[i-1]=[o[1],s[1]]}r&&a.push([-1,a[0][1]],[a[t-1][1],-1]);return a}(r,t,e);for(var l=new Array(r),c=1,u=0;u<r;++u){for(var h=t[u],f=new Array(s+1),p=0,d=0;d<s;++d){var g=h[d];f[d]=g,p+=g*g}f[s]=p,l[u]=new i(f,u),c=Math.max(p,c)}a(l,o),r=l.length;var m=new Array(r+s+1),v=new Array(r+s+1),y=(s+1)*(s+1)*c,x=new Array(s+1);for(u=0;u<=s;++u)x[u]=0;x[s]=y,m[0]=x.slice(),v[0]=-1;for(u=0;u<=s;++u){(f=x.slice())[u]=1,m[u+1]=f,v[u+1]=-1}for(u=0;u<r;++u){var b=l[u];m[u+s+1]=b.point,v[u+s+1]=b.index}var _=n(m,!1);_=e?_.filter((function(t){for(var e=0,r=0;r<=s;++r){var n=v[t[r]];if(n<0&&++e>=2)return!1;t[r]=n}return!0})):_.filter((function(t){for(var e=0;e<=s;++e){var r=v[t[e]];if(r<0)return!1;t[e]=r}return!0}));if(1&s)for(u=0;u<_.length;++u){f=(b=_[u])[0];b[0]=b[1],b[1]=f}return _}},{"incremental-convex-hull":412,uniq:549}],167:[function(t,e,r){"use strict";e.exports=i;var n=(i.canvas=document.createElement("canvas")).getContext("2d"),a=o([32,126]);function i(t,e){Array.isArray(t)&&(t=t.join(", "));var r,i={},s=16,l=.05;e&&(2===e.length&&"number"==typeof e[0]?r=o(e):Array.isArray(e)?r=e:(e.o?r=o(e.o):e.pairs&&(r=e.pairs),e.fontSize&&(s=e.fontSize),null!=e.threshold&&(l=e.threshold))),r||(r=a),n.font=s+"px "+t;for(var c=0;c<r.length;c++){var u=r[c],h=n.measureText(u[0]).width+n.measureText(u[1]).width,f=n.measureText(u).width;if(Math.abs(h-f)>s*l){var p=(f-h)/s;i[u]=1e3*p}}return i}function o(t){for(var e=[],r=t[0];r<=t[1];r++)for(var n=String.fromCharCode(r),a=t[0];a<t[1];a++){var i=n+String.fromCharCode(a);e.push(i)}return e}i.createPairs=o,i.ascii=a},{}],168:[function(t,e,r){(function(t){var r=!1;if("undefined"!=typeof Float64Array){var n=new Float64Array(1),a=new Uint32Array(n.buffer);if(n[0]=1,r=!0,1072693248===a[1]){e.exports=function(t){return n[0]=t,[a[0],a[1]]},e.exports.pack=function(t,e){return a[0]=t,a[1]=e,n[0]},e.exports.lo=function(t){return n[0]=t,a[0]},e.exports.hi=function(t){return n[0]=t,a[1]}}else if(1072693248===a[0]){e.exports=function(t){return n[0]=t,[a[1],a[0]]},e.exports.pack=function(t,e){return a[1]=t,a[0]=e,n[0]},e.exports.lo=function(t){return n[0]=t,a[1]},e.exports.hi=function(t){return n[0]=t,a[0]}}else r=!1}if(!r){var i=new t(8);e.exports=function(t){return i.writeDoubleLE(t,0,!0),[i.readUInt32LE(0,!0),i.readUInt32LE(4,!0)]},e.exports.pack=function(t,e){return i.writeUInt32LE(t,0,!0),i.writeUInt32LE(e,4,!0),i.readDoubleLE(0,!0)},e.exports.lo=function(t){return i.writeDoubleLE(t,0,!0),i.readUInt32LE(0,!0)},e.exports.hi=function(t){return i.writeDoubleLE(t,0,!0),i.readUInt32LE(4,!0)}}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),a=1048575&n;return 2146435072&n&&(a+=1<<20),[r,a]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this,t("buffer").Buffer)},{buffer:108}],169:[function(t,e,r){var n=t("abs-svg-path"),a=t("normalize-svg-path"),i={M:"moveTo",C:"bezierCurveTo"};e.exports=function(t,e){t.beginPath(),a(n(e)).forEach((function(e){var r=e[0],n=e.slice(1);t[i[r]].apply(t,n)})),t.closePath()}},{"abs-svg-path":63,"normalize-svg-path":450}],170:[function(t,e,r){e.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}},{}],171:[function(t,e,r){"use strict";e.exports=function(t,e){switch("undefined"==typeof e&&(e=0),typeof t){case"number":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n<t;++n)r[n]=e;return r}(0|t,e);break;case"object":if("number"==typeof t.length)return function t(e,r,n){var a=0|e[n];if(a<=0)return[];var i,o=new Array(a);if(n===e.length-1)for(i=0;i<a;++i)o[i]=r;else for(i=0;i<a;++i)o[i]=t(e,r,n+1);return o}(t,e,0)}return[]}},{}],172:[function(t,e,r){"use strict";function n(t,e,r){r=r||2;var n,s,l,c,u,p,d,m=e&&e.length,v=m?e[0]*r:t.length,y=a(t,0,v,r,!0),x=[];if(!y||y.next===y.prev)return x;if(m&&(y=function(t,e,r,n){var o,s,l,c,u,p=[];for(o=0,s=e.length;o<s;o++)l=e[o]*n,c=o<s-1?e[o+1]*n:t.length,(u=a(t,l,c,n,!1))===u.next&&(u.steiner=!0),p.push(g(u));for(p.sort(h),o=0;o<p.length;o++)f(p[o],r),r=i(r,r.next);return r}(t,e,y,r)),t.length>80*r){n=l=t[0],s=c=t[1];for(var b=r;b<v;b+=r)(u=t[b])<n&&(n=u),(p=t[b+1])<s&&(s=p),u>l&&(l=u),p>c&&(c=p);d=0!==(d=Math.max(l-n,c-s))?1/d:0}return o(y,x,r,n,s,d),x}function a(t,e,r,n,a){var i,o;if(a===E(t,e,r,n)>0)for(i=e;i<r;i+=n)o=A(i,t[i],t[i+1],o);else for(i=r-n;i>=e;i-=n)o=A(i,t[i],t[i+1],o);return o&&x(o,o.next)&&(M(o),o=o.next),o}function i(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!x(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(M(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,a,h,f){if(t){!f&&h&&function(t,e,r,n){var a=t;do{null===a.z&&(a.z=d(a.x,a.y,e,r,n)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next}while(a!==t);a.prevZ.nextZ=null,a.prevZ=null,function(t){var e,r,n,a,i,o,s,l,c=1;do{for(r=t,t=null,i=null,o=0;r;){for(o++,n=r,s=0,e=0;e<c&&(s++,n=n.nextZ);e++);for(l=c;s>0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,l--),i?i.nextZ=a:t=a,a.prevZ=i,i=a;r=n}i.nextZ=null,c*=2}while(o>1)}(a)}(t,n,a,h);for(var p,g,m=t;t.prev!==t.next;)if(p=t.prev,g=t.next,h?l(t,n,a,h):s(t))e.push(p.i/r),e.push(t.i/r),e.push(g.i/r),M(t),t=g.next,m=g.next;else if((t=g)===m){f?1===f?o(t=c(i(t),e,r),e,r,n,a,h,2):2===f&&u(t,e,r,n,a,h):o(i(t),e,r,n,a,h,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(y(e,r,n)>=0)return!1;for(var a=t.next.next;a!==t.prev;){if(m(e.x,e.y,r.x,r.y,n.x,n.y,a.x,a.y)&&y(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function l(t,e,r,n){var a=t.prev,i=t,o=t.next;if(y(a,i,o)>=0)return!1;for(var s=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,l=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,u=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,h=d(s,l,e,r,n),f=d(c,u,e,r,n),p=t.prevZ,g=t.nextZ;p&&p.z>=h&&g&&g.z<=f;){if(p!==t.prev&&p!==t.next&&m(a.x,a.y,i.x,i.y,o.x,o.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,g!==t.prev&&g!==t.next&&m(a.x,a.y,i.x,i.y,o.x,o.y,g.x,g.y)&&y(g.prev,g,g.next)>=0)return!1;g=g.nextZ}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&m(a.x,a.y,i.x,i.y,o.x,o.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;g&&g.z<=f;){if(g!==t.prev&&g!==t.next&&m(a.x,a.y,i.x,i.y,o.x,o.y,g.x,g.y)&&y(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function c(t,e,r){var n=t;do{var a=n.prev,o=n.next.next;!x(a,o)&&b(a,n,n.next,o)&&T(a,o)&&T(o,a)&&(e.push(a.i/r),e.push(n.i/r),e.push(o.i/r),M(n),M(n.next),n=t=o),n=n.next}while(n!==t);return i(n)}function u(t,e,r,n,a,s){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&v(l,c)){var u=k(l,c);return l=i(l,l.next),u=i(u,u.next),o(l,e,r,n,a,s),void o(u,e,r,n,a,s)}c=c.next}l=l.next}while(l!==t)}function h(t,e){return t.x-e.x}function f(t,e){if(e=function(t,e){var r,n=e,a=t.x,i=t.y,o=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=a&&s>o){if(o=s,s===a){if(i===n.y)return n;if(i===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(a===o)return r;var l,c=r,u=r.x,h=r.y,f=1/0;n=r;do{a>=n.x&&n.x>=u&&a!==n.x&&m(i<h?a:o,i,u,h,i<h?o:a,i,n.x,n.y)&&(l=Math.abs(i-n.y)/(a-n.x),T(n,t)&&(l<f||l===f&&(n.x>r.x||n.x===r.x&&p(r,n)))&&(r=n,f=l)),n=n.next}while(n!==c);return r}(t,e)){var r=k(e,t);i(e,e.next),i(r,r.next)}}function p(t,e){return y(t.prev,t,e.prev)<0&&y(e.next,t,t.next)<0}function d(t,e,r,n,a){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*a)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*a)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function g(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function m(t,e,r,n,a,i,o,s){return(a-o)*(e-s)-(t-o)*(i-s)>=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(i-s)-(a-o)*(n-s)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&b(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(T(t,e)&&T(e,t)&&function(t,e){var r=t,n=!1,a=(t.x+e.x)/2,i=(t.y+e.y)/2;do{r.y>i!=r.next.y>i&&r.next.y!==r.y&&a<(r.next.x-r.x)*(i-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(y(t.prev,t,e.prev)||y(t,e.prev,e))||x(t,e)&&y(t.prev,t,t.next)>0&&y(e.prev,e,e.next)>0)}function y(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function x(t,e){return t.x===e.x&&t.y===e.y}function b(t,e,r,n){var a=w(y(t,e,r)),i=w(y(t,e,n)),o=w(y(r,n,t)),s=w(y(r,n,e));return a!==i&&o!==s||(!(0!==a||!_(t,r,e))||(!(0!==i||!_(t,n,e))||(!(0!==o||!_(r,t,n))||!(0!==s||!_(r,e,n)))))}function _(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function w(t){return t>0?1:t<0?-1:0}function T(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function k(t,e){var r=new S(t.i,t.x,t.y),n=new S(e.i,e.x,e.y),a=t.next,i=e.prev;return t.next=e,e.prev=t,r.next=a,a.prev=r,n.next=r,r.prev=n,i.next=n,n.prev=i,n}function A(t,e,r,n){var a=new S(t,e,r);return n?(a.next=n.next,a.prev=n,n.next.prev=a,n.next=a):(a.prev=a,a.next=a),a}function M(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function S(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 E(t,e,r,n){for(var a=0,i=e,o=r-n;i<r;i+=n)a+=(t[o]-t[i])*(t[i+1]+t[o+1]),o=i;return a}e.exports=n,e.exports.default=n,n.deviation=function(t,e,r,n){var a=e&&e.length,i=a?e[0]*r:t.length,o=Math.abs(E(t,0,i,r));if(a)for(var s=0,l=e.length;s<l;s++){var c=e[s]*r,u=s<l-1?e[s+1]*r:t.length;o-=Math.abs(E(t,c,u,r))}var h=0;for(s=0;s<n.length;s+=3){var f=n[s]*r,p=n[s+1]*r,d=n[s+2]*r;h+=Math.abs((t[f]-t[d])*(t[p+1]-t[f+1])-(t[f]-t[p])*(t[d+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,a=0;a<t.length;a++){for(var i=0;i<t[a].length;i++)for(var o=0;o<e;o++)r.vertices.push(t[a][i][o]);a>0&&(n+=t[a-1].length,r.holes.push(n))}return r}},{}],173:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.length;if("number"!=typeof e){e=0;for(var a=0;a<r;++a){var i=t[a];e=Math.max(e,i[0],i[1])}e=1+(0|e)}e|=0;var o=new Array(e);for(a=0;a<e;++a)o[a]=[];for(a=0;a<r;++a){i=t[a];o[i[0]].push(i[1]),o[i[1]].push(i[0])}for(var s=0;s<e;++s)n(o[s],(function(t,e){return t-e}));return o};var n=t("uniq")},{uniq:549}],174:[function(t,e,r){var n=t("strongly-connected-components");e.exports=function(t,e){var r,a=[],i=[],o=[],s={},l=[];function c(t){var e,n,a=!1;for(i.push(t),o[t]=!0,e=0;e<l[t].length;e++)(n=l[t][e])===r?(u(r,i),a=!0):o[n]||(a=c(n));if(a)!function t(e){o[e]=!1,s.hasOwnProperty(e)&&Object.keys(s[e]).forEach((function(r){delete s[e][r],o[r]&&t(r)}))}(t);else for(e=0;e<l[t].length;e++){n=l[t][e];var h=s[n];h||(h={},s[n]=h),h[n]=!0}return i.pop(),a}function u(t,r){var n=[].concat(r).concat(t);e?e(c):a.push(n)}function h(e){!function(e){for(var r=0;r<t.length;r++)r<e&&(t[r]=[]),t[r]=t[r].filter((function(t){return t>=e}))}(e);for(var r,a=n(t).components.filter((function(t){return t.length>1})),i=1/0,o=0;o<a.length;o++)for(var s=0;s<a[o].length;s++)a[o][s]<i&&(i=a[o][s],r=o);var l=a[r];return!!l&&{leastVertex:i,adjList:t.map((function(t,e){return-1===l.indexOf(e)?[]:t.filter((function(t){return-1!==l.indexOf(t)}))}))}}r=0;for(var f=t.length;r<f;){var p=h(r);if(r=p.leastVertex,l=p.adjList){for(var d=0;d<l.length;d++)for(var g=0;g<l[d].length;g++){var m=l[d][g];o[+m]=!1,s[m]={}}c(r),r+=1}else r=f}return e?void 0:a}},{"strongly-connected-components":521}],175:[function(t,e,r){"use strict";var n=t("../../object/valid-value");e.exports=function(){return n(this).length=0,this}},{"../../object/valid-value":206}],176:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?Array.from:t("./shim")},{"./is-implemented":177,"./shim":178}],177:[function(t,e,r){"use strict";e.exports=function(){var t,e,r=Array.from;return"function"==typeof r&&(e=r(t=["raz","dwa"]),Boolean(e&&e!==t&&"dwa"===e[1]))}},{}],178:[function(t,e,r){"use strict";var n=t("es6-symbol").iterator,a=t("../../function/is-arguments"),i=t("../../function/is-function"),o=t("../../number/to-pos-integer"),s=t("../../object/valid-callable"),l=t("../../object/valid-value"),c=t("../../object/is-value"),u=t("../../string/is-string"),h=Array.isArray,f=Function.prototype.call,p={configurable:!0,enumerable:!0,writable:!0,value:null},d=Object.defineProperty;e.exports=function(t){var e,r,g,m,v,y,x,b,_,w,T=arguments[1],k=arguments[2];if(t=Object(l(t)),c(T)&&s(T),this&&this!==Array&&i(this))e=this;else{if(!T){if(a(t))return 1!==(v=t.length)?Array.apply(null,t):((m=new Array(1))[0]=t[0],m);if(h(t)){for(m=new Array(v=t.length),r=0;r<v;++r)m[r]=t[r];return m}}m=[]}if(!h(t))if(void 0!==(_=t[n])){for(x=s(_).call(t),e&&(m=new e),b=x.next(),r=0;!b.done;)w=T?f.call(T,k,b.value,r):b.value,e?(p.value=w,d(m,r,p)):m[r]=w,b=x.next(),++r;v=r}else if(u(t)){for(v=t.length,e&&(m=new e),r=0,g=0;r<v;++r)w=t[r],r+1<v&&(y=w.charCodeAt(0))>=55296&&y<=56319&&(w+=t[++r]),w=T?f.call(T,k,w,g):w,e?(p.value=w,d(m,g,p)):m[g]=w,++g;v=g}if(void 0===v)for(v=o(t.length),e&&(m=new e(v)),r=0;r<v;++r)w=T?f.call(T,k,t[r],r):t[r],e?(p.value=w,d(m,r,p)):m[r]=w;return e&&(p.value=null,m.length=v),m}},{"../../function/is-arguments":179,"../../function/is-function":180,"../../number/to-pos-integer":186,"../../object/is-value":195,"../../object/valid-callable":204,"../../object/valid-value":206,"../../string/is-string":210,"es6-symbol":220}],179:[function(t,e,r){"use strict";var n=Object.prototype.toString,a=n.call(function(){return arguments}());e.exports=function(t){return n.call(t)===a}},{}],180:[function(t,e,r){"use strict";var n=Object.prototype.toString,a=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);e.exports=function(t){return"function"==typeof t&&a(n.call(t))}},{}],181:[function(t,e,r){"use strict";e.exports=function(){}},{}],182:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?Math.sign:t("./shim")},{"./is-implemented":183,"./shim":184}],183:[function(t,e,r){"use strict";e.exports=function(){var t=Math.sign;return"function"==typeof t&&(1===t(10)&&-1===t(-20))}},{}],184:[function(t,e,r){"use strict";e.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1}},{}],185:[function(t,e,r){"use strict";var n=t("../math/sign"),a=Math.abs,i=Math.floor;e.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?n(t)*i(a(t)):t}},{"../math/sign":182}],186:[function(t,e,r){"use strict";var n=t("./to-integer"),a=Math.max;e.exports=function(t){return a(0,n(t))}},{"./to-integer":185}],187:[function(t,e,r){"use strict";var n=t("./valid-callable"),a=t("./valid-value"),i=Function.prototype.bind,o=Function.prototype.call,s=Object.keys,l=Object.prototype.propertyIsEnumerable;e.exports=function(t,e){return function(r,c){var u,h=arguments[2],f=arguments[3];return r=Object(a(r)),n(c),u=s(r),f&&u.sort("function"==typeof f?i.call(f,r):void 0),"function"!=typeof t&&(t=u[t]),o.call(t,u,(function(t,n){return l.call(r,t)?o.call(c,h,r[t],t,r,n):e}))}}},{"./valid-callable":204,"./valid-value":206}],188:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?Object.assign:t("./shim")},{"./is-implemented":189,"./shim":190}],189:[function(t,e,r){"use strict";e.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},{}],190:[function(t,e,r){"use strict";var n=t("../keys"),a=t("../valid-value"),i=Math.max;e.exports=function(t,e){var r,o,s,l=i(arguments.length,2);for(t=Object(a(t)),s=function(n){try{t[n]=e[n]}catch(t){r||(r=t)}},o=1;o<l;++o)n(e=arguments[o]).forEach(s);if(void 0!==r)throw r;return t}},{"../keys":196,"../valid-value":206}],191:[function(t,e,r){"use strict";var n=t("../array/from"),a=t("./assign"),i=t("./valid-value");e.exports=function(t){var e=Object(i(t)),r=arguments[1],o=Object(arguments[2]);if(e!==t&&!r)return e;var s={};return r?n(r,(function(e){(o.ensure||e in t)&&(s[e]=t[e])})):a(s,t),s}},{"../array/from":176,"./assign":188,"./valid-value":206}],192:[function(t,e,r){"use strict";var n,a,i,o,s=Object.create;t("./set-prototype-of/is-implemented")()||(n=t("./set-prototype-of/shim")),e.exports=n?1!==n.level?s:(a={},i={},o={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach((function(t){i[t]="__proto__"!==t?o:{configurable:!0,enumerable:!1,writable:!0,value:void 0}})),Object.defineProperties(a,i),Object.defineProperty(n,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:a}),function(t,e){return s(null===t?a:t,e)}):s},{"./set-prototype-of/is-implemented":202,"./set-prototype-of/shim":203}],193:[function(t,e,r){"use strict";e.exports=t("./_iterate")("forEach")},{"./_iterate":187}],194:[function(t,e,r){"use strict";var n=t("./is-value"),a={function:!0,object:!0};e.exports=function(t){return n(t)&&a[typeof t]||!1}},{"./is-value":195}],195:[function(t,e,r){"use strict";var n=t("../function/noop")();e.exports=function(t){return t!==n&&null!==t}},{"../function/noop":181}],196:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?Object.keys:t("./shim")},{"./is-implemented":197,"./shim":198}],197:[function(t,e,r){"use strict";e.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},{}],198:[function(t,e,r){"use strict";var n=t("../is-value"),a=Object.keys;e.exports=function(t){return a(n(t)?Object(t):t)}},{"../is-value":195}],199:[function(t,e,r){"use strict";var n=t("./valid-callable"),a=t("./for-each"),i=Function.prototype.call;e.exports=function(t,e){var r={},o=arguments[2];return n(e),a(t,(function(t,n,a,s){r[n]=i.call(e,o,t,n,a,s)})),r}},{"./for-each":193,"./valid-callable":204}],200:[function(t,e,r){"use strict";var n=t("./is-value"),a=Array.prototype.forEach,i=Object.create,o=function(t,e){var r;for(r in t)e[r]=t[r]};e.exports=function(t){var e=i(null);return a.call(arguments,(function(t){n(t)&&o(Object(t),e)})),e}},{"./is-value":195}],201:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?Object.setPrototypeOf:t("./shim")},{"./is-implemented":202,"./shim":203}],202:[function(t,e,r){"use strict";var n=Object.create,a=Object.getPrototypeOf,i={};e.exports=function(){var t=Object.setPrototypeOf,e=arguments[0]||n;return"function"==typeof t&&a(t(e(null),i))===i}},{}],203:[function(t,e,r){"use strict";var n,a=t("../is-object"),i=t("../valid-value"),o=Object.prototype.isPrototypeOf,s=Object.defineProperty,l={configurable:!0,enumerable:!1,writable:!0,value:void 0};n=function(t,e){if(i(t),null===e||a(e))return t;throw new TypeError("Prototype must be null or an object")},e.exports=function(t){var e,r;return t?(2===t.level?t.set?(r=t.set,e=function(t,e){return r.call(n(t,e),e),t}):e=function(t,e){return n(t,e).__proto__=e,t}:e=function t(e,r){var a;return n(e,r),(a=o.call(t.nullPolyfill,e))&&delete t.nullPolyfill.__proto__,null===r&&(r=t.nullPolyfill),e.__proto__=r,a&&s(t.nullPolyfill,"__proto__",l),e},Object.defineProperty(e,"level",{configurable:!1,enumerable:!1,writable:!1,value:t.level})):null}(function(){var t,e=Object.create(null),r={},n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(n){try{(t=n.set).call(e,r)}catch(t){}if(Object.getPrototypeOf(e)===r)return{set:t,level:2}}return e.__proto__=r,Object.getPrototypeOf(e)===r?{level:2}:((e={}).__proto__=r,Object.getPrototypeOf(e)===r&&{level:1})}()),t("../create")},{"../create":192,"../is-object":194,"../valid-value":206}],204:[function(t,e,r){"use strict";e.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},{}],205:[function(t,e,r){"use strict";var n=t("./is-object");e.exports=function(t){if(!n(t))throw new TypeError(t+" is not an Object");return t}},{"./is-object":194}],206:[function(t,e,r){"use strict";var n=t("./is-value");e.exports=function(t){if(!n(t))throw new TypeError("Cannot use null or undefined");return t}},{"./is-value":195}],207:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?String.prototype.contains:t("./shim")},{"./is-implemented":208,"./shim":209}],208:[function(t,e,r){"use strict";var n="razdwatrzy";e.exports=function(){return"function"==typeof n.contains&&(!0===n.contains("dwa")&&!1===n.contains("foo"))}},{}],209:[function(t,e,r){"use strict";var n=String.prototype.indexOf;e.exports=function(t){return n.call(this,t,arguments[1])>-1}},{}],210:[function(t,e,r){"use strict";var n=Object.prototype.toString,a=n.call("");e.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||n.call(t)===a)||!1}},{}],211:[function(t,e,r){"use strict";var n=Object.create(null),a=Math.random;e.exports=function(){var t;do{t=a().toString(36).slice(2)}while(n[t]);return t}},{}],212:[function(t,e,r){"use strict";var n,a=t("es5-ext/object/set-prototype-of"),i=t("es5-ext/string/#/contains"),o=t("d"),s=t("es6-symbol"),l=t("./"),c=Object.defineProperty;n=e.exports=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");l.call(this,t),e=e?i.call(e,"key+value")?"key+value":i.call(e,"key")?"key":"value":"value",c(this,"__kind__",o("",e))},a&&a(n,l),delete n.prototype.constructor,n.prototype=Object.create(l.prototype,{_resolve:o((function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t}))}),c(n.prototype,s.toStringTag,o("c","Array Iterator"))},{"./":215,d:152,"es5-ext/object/set-prototype-of":201,"es5-ext/string/#/contains":207,"es6-symbol":220}],213:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),a=t("es5-ext/object/valid-callable"),i=t("es5-ext/string/is-string"),o=t("./get"),s=Array.isArray,l=Function.prototype.call,c=Array.prototype.some;e.exports=function(t,e){var r,u,h,f,p,d,g,m,v=arguments[2];if(s(t)||n(t)?r="array":i(t)?r="string":t=o(t),a(e),h=function(){f=!0},"array"!==r)if("string"!==r)for(u=t.next();!u.done;){if(l.call(e,v,u.value,h),f)return;u=t.next()}else for(d=t.length,p=0;p<d&&(g=t[p],p+1<d&&(m=g.charCodeAt(0))>=55296&&m<=56319&&(g+=t[++p]),l.call(e,v,g,h),!f);++p);else c.call(t,(function(t){return l.call(e,v,t,h),f}))}},{"./get":214,"es5-ext/function/is-arguments":179,"es5-ext/object/valid-callable":204,"es5-ext/string/is-string":210}],214:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),a=t("es5-ext/string/is-string"),i=t("./array"),o=t("./string"),s=t("./valid-iterable"),l=t("es6-symbol").iterator;e.exports=function(t){return"function"==typeof s(t)[l]?t[l]():n(t)?new i(t):a(t)?new o(t):new i(t)}},{"./array":212,"./string":217,"./valid-iterable":218,"es5-ext/function/is-arguments":179,"es5-ext/string/is-string":210,"es6-symbol":220}],215:[function(t,e,r){"use strict";var n,a=t("es5-ext/array/#/clear"),i=t("es5-ext/object/assign"),o=t("es5-ext/object/valid-callable"),s=t("es5-ext/object/valid-value"),l=t("d"),c=t("d/auto-bind"),u=t("es6-symbol"),h=Object.defineProperty,f=Object.defineProperties;e.exports=n=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");f(this,{__list__:l("w",s(t)),__context__:l("w",e),__nextIndex__:l("w",0)}),e&&(o(e.on),e.on("_add",this._onAdd),e.on("_delete",this._onDelete),e.on("_clear",this._onClear))},delete n.prototype.constructor,f(n.prototype,i({_next:l((function(){var t;if(this.__list__)return this.__redo__&&void 0!==(t=this.__redo__.shift())?t:this.__nextIndex__<this.__list__.length?this.__nextIndex__++:void this._unBind()})),next:l((function(){return this._createResult(this._next())})),_createResult:l((function(t){return void 0===t?{done:!0,value:void 0}:{done:!1,value:this._resolve(t)}})),_resolve:l((function(t){return this.__list__[t]})),_unBind:l((function(){this.__list__=null,delete this.__redo__,this.__context__&&(this.__context__.off("_add",this._onAdd),this.__context__.off("_delete",this._onDelete),this.__context__.off("_clear",this._onClear),this.__context__=null)})),toString:l((function(){return"[object "+(this[u.toStringTag]||"Object")+"]"}))},c({_onAdd:l((function(t){t>=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach((function(e,r){e>=t&&(this.__redo__[r]=++e)}),this),this.__redo__.push(t)):h(this,"__redo__",l("c",[t])))})),_onDelete:l((function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach((function(e,r){e>t&&(this.__redo__[r]=--e)}),this)))})),_onClear:l((function(){this.__redo__&&a.call(this.__redo__),this.__nextIndex__=0}))}))),h(n.prototype,u.iterator,l((function(){return this})))},{d:152,"d/auto-bind":151,"es5-ext/array/#/clear":175,"es5-ext/object/assign":188,"es5-ext/object/valid-callable":204,"es5-ext/object/valid-value":206,"es6-symbol":220}],216:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),a=t("es5-ext/object/is-value"),i=t("es5-ext/string/is-string"),o=t("es6-symbol").iterator,s=Array.isArray;e.exports=function(t){return!!a(t)&&(!!s(t)||(!!i(t)||(!!n(t)||"function"==typeof t[o])))}},{"es5-ext/function/is-arguments":179,"es5-ext/object/is-value":195,"es5-ext/string/is-string":210,"es6-symbol":220}],217:[function(t,e,r){"use strict";var n,a=t("es5-ext/object/set-prototype-of"),i=t("d"),o=t("es6-symbol"),s=t("./"),l=Object.defineProperty;n=e.exports=function(t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");t=String(t),s.call(this,t),l(this,"__length__",i("",t.length))},a&&a(n,s),delete n.prototype.constructor,n.prototype=Object.create(s.prototype,{_next:i((function(){if(this.__list__)return this.__nextIndex__<this.__length__?this.__nextIndex__++:void this._unBind()})),_resolve:i((function(t){var e,r=this.__list__[t];return this.__nextIndex__===this.__length__?r:(e=r.charCodeAt(0))>=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r}))}),l(n.prototype,o.toStringTag,i("c","String Iterator"))},{"./":215,d:152,"es5-ext/object/set-prototype-of":201,"es6-symbol":220}],218:[function(t,e,r){"use strict";var n=t("./is-iterable");e.exports=function(t){if(!n(t))throw new TypeError(t+" is not iterable");return t}},{"./is-iterable":216}],219:[function(t,e,r){(function(n,a){
/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
* @version v4.2.8+1e68dce6
*/
!function(t,n){"object"==typeof r&&"undefined"!=typeof e?e.exports=n():t.ES6Promise=n()}(this,(function(){"use strict";function e(t){return"function"==typeof t}var r=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=0,o=void 0,s=void 0,l=function(t,e){g[i]=t,g[i+1]=e,2===(i+=2)&&(s?s(m):_())};var c="undefined"!=typeof window?window:void 0,u=c||{},h=u.MutationObserver||u.WebKitMutationObserver,f="undefined"==typeof self&&"undefined"!=typeof n&&"[object process]"==={}.toString.call(n),p="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function d(){var t=setTimeout;return function(){return t(m,1)}}var g=new Array(1e3);function m(){for(var t=0;t<i;t+=2){(0,g[t])(g[t+1]),g[t]=void 0,g[t+1]=void 0}i=0}var v,y,x,b,_=void 0;function w(t,e){var r=this,n=new this.constructor(A);void 0===n[k]&&D(n);var a=r._state;if(a){var i=arguments[a-1];l((function(){return z(a,n,i,r._result)}))}else P(r,n,t,e);return n}function T(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(A);return S(e,t),e}f?_=function(){return n.nextTick(m)}:h?(y=0,x=new h(m),b=document.createTextNode(""),x.observe(b,{characterData:!0}),_=function(){b.data=y=++y%2}):p?((v=new MessageChannel).port1.onmessage=m,_=function(){return v.port2.postMessage(0)}):_=void 0===c&&"function"==typeof t?function(){try{var t=Function("return this")().require("vertx");return"undefined"!=typeof(o=t.runOnLoop||t.runOnContext)?function(){o(m)}:d()}catch(t){return d()}}():d();var k=Math.random().toString(36).substring(2);function A(){}function M(t,r,n){r.constructor===t.constructor&&n===w&&r.constructor.resolve===T?function(t,e){1===e._state?C(t,e._result):2===e._state?L(t,e._result):P(e,void 0,(function(e){return S(t,e)}),(function(e){return L(t,e)}))}(t,r):void 0===n?C(t,r):e(n)?function(t,e,r){l((function(t){var n=!1,a=function(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}(r,e,(function(r){n||(n=!0,e!==r?S(t,r):C(t,r))}),(function(e){n||(n=!0,L(t,e))}),t._label);!n&&a&&(n=!0,L(t,a))}),t)}(t,r,n):C(t,r)}function S(t,e){if(t===e)L(t,new TypeError("You cannot resolve a promise with itself"));else if(a=typeof(n=e),null===n||"object"!==a&&"function"!==a)C(t,e);else{var r=void 0;try{r=e.then}catch(e){return void L(t,e)}M(t,e,r)}var n,a}function E(t){t._onerror&&t._onerror(t._result),I(t)}function C(t,e){void 0===t._state&&(t._result=e,t._state=1,0!==t._subscribers.length&&l(I,t))}function L(t,e){void 0===t._state&&(t._state=2,t._result=e,l(E,t))}function P(t,e,r,n){var a=t._subscribers,i=a.length;t._onerror=null,a[i]=e,a[i+1]=r,a[i+2]=n,0===i&&t._state&&l(I,t)}function I(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,a=void 0,i=t._result,o=0;o<e.length;o+=3)n=e[o],a=e[o+r],n?z(r,n,a,i):a(i);t._subscribers.length=0}}function z(t,r,n,a){var i=e(n),o=void 0,s=void 0,l=!0;if(i){try{o=n(a)}catch(t){l=!1,s=t}if(r===o)return void L(r,new TypeError("A promises callback cannot return that same promise."))}else o=a;void 0!==r._state||(i&&l?S(r,o):!1===l?L(r,s):1===t?C(r,o):2===t&&L(r,o))}var O=0;function D(t){t[k]=O++,t._state=void 0,t._result=void 0,t._subscribers=[]}var R=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(A),this.promise[k]||D(this.promise),r(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?C(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&C(this.promise,this._result))):L(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;void 0===this._state&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===T){var a=void 0,i=void 0,o=!1;try{a=t.then}catch(t){o=!0,i=t}if(a===w&&void 0!==t._state)this._settledAt(t._state,e,t._result);else if("function"!=typeof a)this._remaining--,this._result[e]=t;else if(r===F){var s=new r(A);o?L(s,i):M(s,t,a),this._willSettleAt(s,e)}else this._willSettleAt(new r((function(e){return e(t)})),e)}else this._willSettleAt(n(t),e)},t.prototype._settledAt=function(t,e,r){var n=this.promise;void 0===n._state&&(this._remaining--,2===t?L(n,r):this._result[e]=r),0===this._remaining&&C(n,this._result)},t.prototype._willSettleAt=function(t,e){var r=this;P(t,void 0,(function(t){return r._settledAt(1,e,t)}),(function(t){return r._settledAt(2,e,t)}))},t}();var F=function(){function t(e){this[k]=O++,this._result=this._state=void 0,this._subscribers=[],A!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(t,e){try{e((function(e){S(t,e)}),(function(e){L(t,e)}))}catch(e){L(t,e)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.finally=function(t){var r=this.constructor;return e(t)?this.then((function(e){return r.resolve(t()).then((function(){return e}))}),(function(e){return r.resolve(t()).then((function(){throw e}))})):this.then(t,t)},t}();return F.prototype.then=w,F.all=function(t){return new R(this,t).promise},F.race=function(t){var e=this;return r(t)?new e((function(r,n){for(var a=t.length,i=0;i<a;i++)e.resolve(t[i]).then(r,n)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},F.resolve=T,F.reject=function(t){var e=new this(A);return L(e,t),e},F._setScheduler=function(t){s=t},F._setAsap=function(t){l=t},F._asap=l,F.polyfill=function(){var t=void 0;if("undefined"!=typeof a)t=a;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===r&&!e.cast)return}t.Promise=F},F.Promise=F,F}))}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:480}],220:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?t("ext/global-this").Symbol:t("./polyfill")},{"./is-implemented":221,"./polyfill":226,"ext/global-this":233}],221:[function(t,e,r){"use strict";var n=t("ext/global-this"),a={object:!0,symbol:!0};e.exports=function(){var t,e=n.Symbol;if("function"!=typeof e)return!1;t=e("test symbol");try{String(t)}catch(t){return!1}return!!a[typeof e.iterator]&&(!!a[typeof e.toPrimitive]&&!!a[typeof e.toStringTag])}},{"ext/global-this":233}],222:[function(t,e,r){"use strict";e.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&("Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag]))}},{}],223:[function(t,e,r){"use strict";var n=t("d"),a=Object.create,i=Object.defineProperty,o=Object.prototype,s=a(null);e.exports=function(t){for(var e,r,a=0;s[t+(a||"")];)++a;return s[t+=a||""]=!0,i(o,e="@@"+t,n.gs(null,(function(t){r||(r=!0,i(this,e,n(t)),r=!1)}))),e}},{d:152}],224:[function(t,e,r){"use strict";var n=t("d"),a=t("ext/global-this").Symbol;e.exports=function(t){return Object.defineProperties(t,{hasInstance:n("",a&&a.hasInstance||t("hasInstance")),isConcatSpreadable:n("",a&&a.isConcatSpreadable||t("isConcatSpreadable")),iterator:n("",a&&a.iterator||t("iterator")),match:n("",a&&a.match||t("match")),replace:n("",a&&a.replace||t("replace")),search:n("",a&&a.search||t("search")),species:n("",a&&a.species||t("species")),split:n("",a&&a.split||t("split")),toPrimitive:n("",a&&a.toPrimitive||t("toPrimitive")),toStringTag:n("",a&&a.toStringTag||t("toStringTag")),unscopables:n("",a&&a.unscopables||t("unscopables"))})}},{d:152,"ext/global-this":233}],225:[function(t,e,r){"use strict";var n=t("d"),a=t("../../../validate-symbol"),i=Object.create(null);e.exports=function(t){return Object.defineProperties(t,{for:n((function(e){return i[e]?i[e]:i[e]=t(String(e))})),keyFor:n((function(t){var e;for(e in a(t),i)if(i[e]===t)return e}))})}},{"../../../validate-symbol":227,d:152}],226:[function(t,e,r){"use strict";var n,a,i,o=t("d"),s=t("./validate-symbol"),l=t("ext/global-this").Symbol,c=t("./lib/private/generate-name"),u=t("./lib/private/setup/standard-symbols"),h=t("./lib/private/setup/symbol-registry"),f=Object.create,p=Object.defineProperties,d=Object.defineProperty;if("function"==typeof l)try{String(l()),i=!0}catch(t){}else l=null;a=function(t){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return n(t)},e.exports=n=function t(e){var r;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return i?l(e):(r=f(a.prototype),e=void 0===e?"":String(e),p(r,{__description__:o("",e),__name__:o("",c(e))}))},u(n),h(n),p(a.prototype,{constructor:o(n),toString:o("",(function(){return this.__name__}))}),p(n.prototype,{toString:o((function(){return"Symbol ("+s(this).__description__+")"})),valueOf:o((function(){return s(this)}))}),d(n.prototype,n.toPrimitive,o("",(function(){var t=s(this);return"symbol"==typeof t?t:t.toString()}))),d(n.prototype,n.toStringTag,o("c","Symbol")),d(a.prototype,n.toStringTag,o("c",n.prototype[n.toStringTag])),d(a.prototype,n.toPrimitive,o("c",n.prototype[n.toPrimitive]))},{"./lib/private/generate-name":223,"./lib/private/setup/standard-symbols":224,"./lib/private/setup/symbol-registry":225,"./validate-symbol":227,d:152,"ext/global-this":233}],227:[function(t,e,r){"use strict";var n=t("./is-symbol");e.exports=function(t){if(!n(t))throw new TypeError(t+" is not a symbol");return t}},{"./is-symbol":222}],228:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?WeakMap:t("./polyfill")},{"./is-implemented":229,"./polyfill":231}],229:[function(t,e,r){"use strict";e.exports=function(){var t,e;if("function"!=typeof WeakMap)return!1;try{t=new WeakMap([[e={},"one"],[{},"two"],[{},"three"]])}catch(t){return!1}return"[object WeakMap]"===String(t)&&("function"==typeof t.set&&(t.set({},1)===t&&("function"==typeof t.delete&&("function"==typeof t.has&&"one"===t.get(e)))))}},{}],230:[function(t,e,r){"use strict";e.exports="function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)},{}],231:[function(t,e,r){"use strict";var n,a=t("es5-ext/object/is-value"),i=t("es5-ext/object/set-prototype-of"),o=t("es5-ext/object/valid-object"),s=t("es5-ext/object/valid-value"),l=t("es5-ext/string/random-uniq"),c=t("d"),u=t("es6-iterator/get"),h=t("es6-iterator/for-of"),f=t("es6-symbol").toStringTag,p=t("./is-native-implemented"),d=Array.isArray,g=Object.defineProperty,m=Object.prototype.hasOwnProperty,v=Object.getPrototypeOf;e.exports=n=function(){var t,e=arguments[0];if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");return t=p&&i&&WeakMap!==n?i(new WeakMap,v(this)):this,a(e)&&(d(e)||(e=u(e))),g(t,"__weakMapData__",c("c","$weakMap$"+l())),e?(h(e,(function(e){s(e),t.set(e[0],e[1])})),t):t},p&&(i&&i(n,WeakMap),n.prototype=Object.create(WeakMap.prototype,{constructor:c(n)})),Object.defineProperties(n.prototype,{delete:c((function(t){return!!m.call(o(t),this.__weakMapData__)&&(delete t[this.__weakMapData__],!0)})),get:c((function(t){if(m.call(o(t),this.__weakMapData__))return t[this.__weakMapData__]})),has:c((function(t){return m.call(o(t),this.__weakMapData__)})),set:c((function(t,e){return g(o(t),this.__weakMapData__,c("c",e)),this})),toString:c((function(){return"[object WeakMap]"}))}),g(n.prototype,f,c("c","WeakMap"))},{"./is-native-implemented":230,d:152,"es5-ext/object/is-value":195,"es5-ext/object/set-prototype-of":201,"es5-ext/object/valid-object":205,"es5-ext/object/valid-value":206,"es5-ext/string/random-uniq":211,"es6-iterator/for-of":213,"es6-iterator/get":214,"es6-symbol":220}],232:[function(t,e,r){var n=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return n()}try{return __global__||n()}finally{delete Object.prototype.__global__}}()},{}],233:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?globalThis:t("./implementation")},{"./implementation":232,"./is-implemented":234}],234:[function(t,e,r){"use strict";e.exports=function(){return"object"==typeof globalThis&&(!!globalThis&&globalThis.Array===Array)}},{}],235:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=e||0,a=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]],[a*t[12]-t[8],a*t[13]-t[9],a*t[14]-t[10],a*t[15]-t[11]]]}},{}],236:[function(t,e,r){"use strict";var n=t("is-string-blank");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}},{"is-string-blank":423}],237:[function(t,e,r){"use strict";e.exports=function(t,e,r){switch(arguments.length){case 0:return new o([0],[0],0);case 1:return"number"==typeof t?new o(n=l(t),n,0):new o(t,l(t.length),0);case 2:if("number"==typeof e){var n=l(t.length);return new o(t,n,+e)}r=0;case 3:if(t.length!==e.length)throw new Error("state and velocity lengths must match");return new o(t,e,r)}};var n=t("cubic-hermite"),a=t("binary-search-bounds");function i(t,e,r){return Math.min(e,Math.max(t,r))}function o(t,e,r){this.dimension=t.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;n<this.dimension;++n)this.bounds[0][n]=-1/0,this.bounds[1][n]=1/0;this._state=t.slice().reverse(),this._velocity=e.slice().reverse(),this._time=[r],this._scratch=[t.slice(),t.slice(),t.slice(),t.slice(),t.slice()]}var s=o.prototype;function l(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=0;return e}s.flush=function(t){var e=a.gt(this._time,t)-1;e<=0||(this._time.splice(0,e),this._state.splice(0,e*this.dimension),this._velocity.splice(0,e*this.dimension))},s.curve=function(t){var e=this._time,r=e.length,o=a.le(e,t),s=this._scratch[0],l=this._state,c=this._velocity,u=this.dimension,h=this.bounds;if(o<0)for(var f=u-1,p=0;p<u;++p,--f)s[p]=l[f];else if(o>=r-1){f=l.length-1;var d=t-e[r-1];for(p=0;p<u;++p,--f)s[p]=l[f]+d*c[f]}else{f=u*(o+1)-1;var g=e[o],m=e[o+1]-g||1,v=this._scratch[1],y=this._scratch[2],x=this._scratch[3],b=this._scratch[4],_=!0;for(p=0;p<u;++p,--f)v[p]=l[f],x[p]=c[f]*m,y[p]=l[f+u],b[p]=c[f+u]*m,_=_&&v[p]===y[p]&&x[p]===b[p]&&0===x[p];if(_)for(p=0;p<u;++p)s[p]=v[p];else n(v,x,y,b,(t-g)/m,s)}var w=h[0],T=h[1];for(p=0;p<u;++p)s[p]=i(w[p],T[p],s[p]);return s},s.dcurve=function(t){var e=this._time,r=e.length,i=a.le(e,t),o=this._scratch[0],s=this._state,l=this._velocity,c=this.dimension;if(i>=r-1)for(var u=s.length-1,h=(e[r-1],0);h<c;++h,--u)o[h]=l[u];else{u=c*(i+1)-1;var f=e[i],p=e[i+1]-f||1,d=this._scratch[1],g=this._scratch[2],m=this._scratch[3],v=this._scratch[4],y=!0;for(h=0;h<c;++h,--u)d[h]=s[u],m[h]=l[u]*p,g[h]=s[u+c],v[h]=l[u+c]*p,y=y&&d[h]===g[h]&&m[h]===v[h]&&0===m[h];if(y)for(h=0;h<c;++h)o[h]=0;else{n.derivative(d,m,g,v,(t-f)/p,o);for(h=0;h<c;++h)o[h]/=p}}return o},s.lastT=function(){var t=this._time;return t[t.length-1]},s.stable=function(){for(var t=this._velocity,e=t.length,r=this.dimension-1;r>=0;--r)if(t[--e])return!1;return!0},s.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t<e||arguments.length!==r+1)){var n=this._state,a=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1];this._time.push(e,t);for(var u=0;u<2;++u)for(var h=0;h<r;++h)n.push(n[o++]),a.push(0);this._time.push(t);for(h=r;h>0;--h)n.push(i(l[h-1],c[h-1],arguments[h])),a.push(0)}},s.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t<e||arguments.length!==r+1)){var n=this._state,a=this._velocity,o=n.length-this.dimension,s=t-e,l=this.bounds,c=l[0],u=l[1],h=s>1e-6?1/s:0;this._time.push(t);for(var f=r;f>0;--f){var p=i(c[f-1],u[f-1],arguments[f]);n.push(p),a.push((p-n[o++])*h)}}},s.set=function(t){var e=this.dimension;if(!(t<this.lastT()||arguments.length!==e+1)){var r=this._state,n=this._velocity,a=this.bounds,o=a[0],s=a[1];this._time.push(t);for(var l=e;l>0;--l)r.push(i(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var n=this._state,a=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=t-e,h=u>1e-6?1/u:0;this._time.push(t);for(var f=r;f>0;--f){var p=arguments[f];n.push(i(l[f-1],c[f-1],n[o++]+p)),a.push(p*h)}}},s.idle=function(t){var e=this.lastT();if(!(t<e)){var r=this.dimension,n=this._state,a=this._velocity,o=n.length-r,s=this.bounds,l=s[0],c=s[1],u=t-e;this._time.push(t);for(var h=r-1;h>=0;--h)n.push(i(l[h],c[h],n[o]+u*a[o])),a.push(0),o+=1}}},{"binary-search-bounds":238,"cubic-hermite":147}],238:[function(t,e,r){"use strict";function n(t,e,r,n,a,i){var o=["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",a?".get(m)":"[m]"];return i?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("}"),i?o.push("return -1};"):o.push("return i};"),o.join("")}function a(t,e,r,a){return new Function([n("A","x"+t+"y",e,["y"],!1,a),n("B","x"+t+"y",e,["y"],!0,a),n("P","c(x,y)"+t+"0",e,["y","c"],!1,a),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,a),"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:a(">=",!1,"GE"),gt:a(">",!1,"GT"),lt:a("<",!0,"LT"),le:a("<=",!0,"LE"),eq:a("-",!0,"EQ",!0)}},{}],239:[function(t,e,r){var n=t("dtype");e.exports=function(t,e,r){if(!t)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(t)&&t[0]&&"number"==typeof t[0][0]){var a,i,o,s,l=t[0].length,c=t.length*l;e&&"string"!=typeof e||(e=new(n(e||"float32"))(c+r));var u=e.length-r;if(c!==u)throw new Error("source length "+c+" ("+l+"x"+t.length+") does not match destination length "+u);for(a=0,o=r;a<t.length;a++)for(i=0;i<l;i++)e[o++]=null===t[a][i]?NaN:t[a][i]}else if(e&&"string"!=typeof e)e.set(t,r);else{var h=n(e||"float32");if(Array.isArray(t)||"array"===e)for(e=new h(t.length+r),a=0,o=r,s=e.length;o<s;o++,a++)e[o]=null===t[a]?NaN:t[a];else 0===r?e=new h(t):(e=new h(t.length+r)).set(t,r)}return e}},{dtype:170}],240:[function(t,e,r){"use strict";var n=t("css-font/stringify"),a=[32,126];e.exports=function(t){var e=(t=t||{}).shape?t.shape:t.canvas?[t.canvas.width,t.canvas.height]:[512,512],r=t.canvas||document.createElement("canvas"),i=t.font,o="number"==typeof t.step?[t.step,t.step]:t.step||[32,32],s=t.chars||a;i&&"string"!=typeof i&&(i=n(i));if(Array.isArray(s)){if(2===s.length&&"number"==typeof s[0]&&"number"==typeof s[1]){for(var l=[],c=s[0],u=0;c<=s[1];c++)l[u++]=String.fromCharCode(c);s=l}}else s=String(s).split("");e=e.slice(),r.width=e[0],r.height=e[1];var h=r.getContext("2d");h.fillStyle="#000",h.fillRect(0,0,r.width,r.height),h.font=i,h.textAlign="center",h.textBaseline="middle",h.fillStyle="#fff";var f=o[0]/2,p=o[1]/2;for(c=0;c<s.length;c++)h.fillText(s[c],f,p),(f+=o[0])>e[0]-o[0]/2&&(f=o[0]/2,p+=o[1]);return r}},{"css-font/stringify":144}],241:[function(t,e,r){"use strict";function n(t,e){e||(e={}),("string"==typeof t||Array.isArray(t))&&(e.family=t);var r=Array.isArray(e.family)?e.family.join(", "):e.family;if(!r)throw Error("`family` must be defined");var s=e.size||e.fontSize||e.em||48,l=e.weight||e.fontWeight||"",c=(t=[e.style||e.fontStyle||"",l,s].join(" ")+"px "+r,e.origin||"top");if(n.cache[r]&&s<=n.cache[r].em)return a(n.cache[r],c);var u=e.canvas||n.canvas,h=u.getContext("2d"),f={upper:void 0!==e.upper?e.upper:"H",lower:void 0!==e.lower?e.lower:"x",descent:void 0!==e.descent?e.descent:"p",ascent:void 0!==e.ascent?e.ascent:"h",tittle:void 0!==e.tittle?e.tittle:"i",overshoot:void 0!==e.overshoot?e.overshoot:"O"},p=Math.ceil(1.5*s);u.height=p,u.width=.5*p,h.font=t;var d={top:0};h.clearRect(0,0,p,p),h.textBaseline="top",h.fillStyle="black",h.fillText("H",0,0);var g=i(h.getImageData(0,0,p,p));h.clearRect(0,0,p,p),h.textBaseline="bottom",h.fillText("H",0,p);var m=i(h.getImageData(0,0,p,p));d.lineHeight=d.bottom=p-m+g,h.clearRect(0,0,p,p),h.textBaseline="alphabetic",h.fillText("H",0,p);var v=p-i(h.getImageData(0,0,p,p))-1+g;d.baseline=d.alphabetic=v,h.clearRect(0,0,p,p),h.textBaseline="middle",h.fillText("H",0,.5*p);var y=i(h.getImageData(0,0,p,p));d.median=d.middle=p-y-1+g-.5*p,h.clearRect(0,0,p,p),h.textBaseline="hanging",h.fillText("H",0,.5*p);var x=i(h.getImageData(0,0,p,p));d.hanging=p-x-1+g-.5*p,h.clearRect(0,0,p,p),h.textBaseline="ideographic",h.fillText("H",0,p);var b=i(h.getImageData(0,0,p,p));if(d.ideographic=p-b-1+g,f.upper&&(h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(f.upper,0,0),d.upper=i(h.getImageData(0,0,p,p)),d.capHeight=d.baseline-d.upper),f.lower&&(h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(f.lower,0,0),d.lower=i(h.getImageData(0,0,p,p)),d.xHeight=d.baseline-d.lower),f.tittle&&(h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(f.tittle,0,0),d.tittle=i(h.getImageData(0,0,p,p))),f.ascent&&(h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(f.ascent,0,0),d.ascent=i(h.getImageData(0,0,p,p))),f.descent&&(h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(f.descent,0,0),d.descent=o(h.getImageData(0,0,p,p))),f.overshoot){h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(f.overshoot,0,0);var _=o(h.getImageData(0,0,p,p));d.overshoot=_-v}for(var w in d)d[w]/=s;return d.em=s,n.cache[r]=d,a(d,c)}function a(t,e){var r={};for(var n in"string"==typeof e&&(e=t[e]),t)"em"!==n&&(r[n]=t[n]-e);return r}function i(t){for(var e=t.height,r=t.data,n=3;n<r.length;n+=4)if(0!==r[n])return Math.floor(.25*(n-3)/e)}function o(t){for(var e=t.height,r=t.data,n=r.length-1;n>0;n-=4)if(0!==r[n])return Math.floor(.25*(n-3)/e)}e.exports=n,n.canvas=document.createElement("canvas"),n.cache={}},{}],242:[function(t,e,r){"use strict";e.exports=function(t){return new s(t||g,null)};function n(t,e,r,n,a,i){this._color=t,this.key=e,this.value=r,this.left=n,this.right=a,this._count=i}function a(t){return new n(t._color,t.key,t.value,t.left,t.right,t._count)}function i(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}var l=s.prototype;function c(t,e){var r;if(e.left&&(r=c(t,e.left)))return r;return(r=t(e.key,e.value))||(e.right?c(t,e.right):void 0)}function u(t,e,r,n){if(e(t,n.key)<=0){var a;if(n.left)if(a=u(t,e,r,n.left))return a;if(a=r(n.key,n.value))return a}if(n.right)return u(t,e,r,n.right)}function h(t,e,r,n,a){var i,o=r(t,a.key),s=r(e,a.key);if(o<=0){if(a.left&&(i=h(t,e,r,n,a.left)))return i;if(s>0&&(i=n(a.key,a.value)))return i}if(s>0&&a.right)return h(t,e,r,n,a.right)}function f(t,e){this.tree=t,this._stack=e}Object.defineProperty(l,"keys",{get:function(){var t=[];return this.forEach((function(e,r){t.push(e)})),t}}),Object.defineProperty(l,"values",{get:function(){var t=[];return this.forEach((function(e,r){t.push(r)})),t}}),Object.defineProperty(l,"length",{get:function(){return this.root?this.root._count:0}}),l.insert=function(t,e){for(var r=this._compare,a=this.root,l=[],c=[];a;){var u=r(t,a.key);l.push(a),c.push(u),a=u<=0?a.left:a.right}l.push(new n(0,t,e,null,null,1));for(var h=l.length-2;h>=0;--h){a=l[h];c[h]<=0?l[h]=new n(a._color,a.key,a.value,l[h+1],a.right,a._count+1):l[h]=new n(a._color,a.key,a.value,a.left,l[h+1],a._count+1)}for(h=l.length-1;h>1;--h){var f=l[h-1];a=l[h];if(1===f._color||1===a._color)break;var p=l[h-2];if(p.left===f)if(f.left===a){if(!(d=p.right)||0!==d._color){if(p._color=0,p.left=f.right,f._color=1,f.right=p,l[h-2]=f,l[h-1]=a,o(p),o(f),h>=3)(g=l[h-3]).left===p?g.left=f:g.right=f;break}f._color=1,p.right=i(1,d),p._color=0,h-=1}else{if(!(d=p.right)||0!==d._color){if(f.right=a.left,p._color=0,p.left=a.right,a._color=1,a.left=f,a.right=p,l[h-2]=a,l[h-1]=f,o(p),o(f),o(a),h>=3)(g=l[h-3]).left===p?g.left=a:g.right=a;break}f._color=1,p.right=i(1,d),p._color=0,h-=1}else if(f.right===a){if(!(d=p.left)||0!==d._color){if(p._color=0,p.right=f.left,f._color=1,f.left=p,l[h-2]=f,l[h-1]=a,o(p),o(f),h>=3)(g=l[h-3]).right===p?g.right=f:g.left=f;break}f._color=1,p.left=i(1,d),p._color=0,h-=1}else{var d;if(!(d=p.left)||0!==d._color){var g;if(f.left=a.right,p._color=0,p.right=a.left,a._color=1,a.right=f,a.left=p,l[h-2]=a,l[h-1]=f,o(p),o(f),o(a),h>=3)(g=l[h-3]).right===p?g.right=a:g.left=a;break}f._color=1,p.left=i(1,d),p._color=0,h-=1}}return l[0]._color=1,new s(r,l[0])},l.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return c(t,this.root);case 2:return u(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return h(e,r,this._compare,t,this.root)}},Object.defineProperty(l,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new f(this,t)}}),Object.defineProperty(l,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new f(this,t)}}),l.at=function(t){if(t<0)return new f(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t<e.left._count){e=e.left;continue}t-=e.left._count}if(!t)return new f(this,r);if(t-=1,!e.right)break;if(t>=e.right._count)break;e=e.right}return new f(this,[])},l.ge=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i<=0&&(a=n.length),r=i<=0?r.left:r.right}return n.length=a,new f(this,n)},l.gt=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i<0&&(a=n.length),r=i<0?r.left:r.right}return n.length=a,new f(this,n)},l.lt=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i>0&&(a=n.length),r=i<=0?r.left:r.right}return n.length=a,new f(this,n)},l.le=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i>=0&&(a=n.length),r=i<0?r.left:r.right}return n.length=a,new f(this,n)},l.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var a=e(t,r.key);if(n.push(r),0===a)return new f(this,n);r=a<=0?r.left:r.right}return new f(this,[])},l.remove=function(t){var e=this.find(t);return e?e.remove():this},l.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 p=f.prototype;function d(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function g(t,e){return t<e?-1:t>e?1:0}Object.defineProperty(p,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(p,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),p.clone=function(){return new f(this.tree,this._stack.slice())},p.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new n(r._color,r.key,r.value,r.left,r.right,r._count);for(var 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 c=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var u=e[c-1];e.push(new n(r._color,u.key,u.value,r.left,r.right,r._count)),e[c-1].key=r.key,e[c-1].value=r.value;for(l=e.length-2;l>=c;--l)r=e[l],e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count);e[c-1].left=e[c]}if(0===(r=e[e.length-1])._color){var h=e[e.length-2];h.left===r?h.left=null:h.right===r&&(h.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?d(r,r.left):r.right&&d(r,r.right),r._color=1;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(l=0;l<e.length;++l)e[l]._count--;var f=e[e.length-2];return function(t){for(var e,r,n,s,l=t.length-1;l>=0;--l){if(e=t[l],0===l)return void(e._color=1);if((r=t[l-1]).left===e){if((n=r.right).right&&0===n.right._color){if(s=(n=r.right=a(n)).right=a(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=1,r._color=1,s._color=1,o(r),o(n),l>1)(c=t[l-2]).left===r?c.left=n:c.right=n;return void(t[l-1]=n)}if(n.left&&0===n.left._color){if(s=(n=r.right=a(n)).left=a(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1)(c=t[l-2]).left===r?c.left=s:c.right=s;return void(t[l-1]=s)}if(1===n._color){if(0===r._color)return r._color=1,void(r.right=i(0,n));r.right=i(0,n);continue}n=a(n),r.right=n.left,n.left=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((c=t[l-2]).left===r?c.left=n:c.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&&0===n.left._color){if(s=(n=r.left=a(n)).left=a(n.left),r.left=n.right,n.right=r,n.left=s,n._color=r._color,e._color=1,r._color=1,s._color=1,o(r),o(n),l>1)(c=t[l-2]).right===r?c.right=n:c.left=n;return void(t[l-1]=n)}if(n.right&&0===n.right._color){if(s=(n=r.left=a(n)).right=a(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1)(c=t[l-2]).right===r?c.right=s:c.left=s;return void(t[l-1]=s)}if(1===n._color){if(0===r._color)return r._color=1,void(r.left=i(0,n));r.left=i(0,n);continue}var c;n=a(n),r.left=n.right,n.right=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((c=t[l-2]).right===r?c.right=n:c.left=n),t[l-1]=n,t[l]=r,l+1<t.length?t[l+1]=e:t.push(e),l+=2}}}(e),f.left===r?f.left=null:f.right=null,new s(this.tree._compare,e[0])},Object.defineProperty(p,"key",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(p,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(p,"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}),p.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(p,"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}}),p.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),a=e[e.length-1];r[r.length-1]=new n(a._color,a.key,t,a.left,a.right,a._count);for(var i=e.length-2;i>=0;--i)(a=e[i]).left===e[i+1]?r[i]=new n(a._color,a.key,a.value,r[i+1],a.right,a._count):r[i]=new n(a._color,a.key,a.value,a.left,r[i+1],a._count);return new s(this.tree._compare,r[0])},p.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(p,"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}})},{}],243:[function(t,e,r){var n=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],a=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];function i(t){if(t<0)return Number("0/0");for(var e=a[0],r=a.length-1;r>0;--r)e+=a[r]/(t+r);var n=t+607/128+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}e.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(i(e));e-=1;for(var r=n[0],a=1;a<9;a++)r+=n[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=i},{}],244:[function(t,e,r){e.exports=function(t,e){if("string"!=typeof t)throw new TypeError("must specify type string");if(e=e||{},"undefined"==typeof document&&!e.canvas)return null;var r=e.canvas||document.createElement("canvas");"number"==typeof e.width&&(r.width=e.width);"number"==typeof e.height&&(r.height=e.height);var n,a=e;try{var i=[t];0===t.indexOf("webgl")&&i.push("experimental-"+t);for(var o=0;o<i.length;o++)if(n=r.getContext(i[o],a))return n}catch(t){n=null}return n||null}},{}],245:[function(t,e,r){"use strict";e.exports=function(t,e){var r=new u(t);return r.update(e),r};var n=t("./lib/text.js"),a=t("./lib/lines.js"),i=t("./lib/background.js"),o=t("./lib/cube.js"),s=t("./lib/ticks.js"),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);function c(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function u(t){this.gl=t,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],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.labelAlign=["auto","auto","auto"],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=i(t)}var h=u.prototype;function f(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}h.update=function(t){function e(e,r,n){if(n in t){var a,i=t[n],o=this[n];(e?Array.isArray(i)&&Array.isArray(i[0]):Array.isArray(i))?this[n]=a=[r(i[0]),r(i[1]),r(i[2])]:this[n]=a=[r(i),r(i),r(i)];for(var s=0;s<3;++s)if(a[s]!==o[s])return!0}return!1}t=t||{};var r,i=e.bind(this,!1,Number),o=e.bind(this,!1,Boolean),l=e.bind(this,!1,String),c=e.bind(this,!0,(function(t){if(Array.isArray(t)){if(3===t.length)return[+t[0],+t[1],+t[2],1];if(4===t.length)return[+t[0],+t[1],+t[2],+t[3]]}return[0,0,0,1]})),u=!1,h=!1;if("bounds"in t)for(var f=t.bounds,p=0;p<2;++p)for(var d=0;d<3;++d)f[p][d]!==this.bounds[p][d]&&(h=!0),this.bounds[p][d]=f[p][d];if("ticks"in t){r=t.ticks,u=!0,this.autoTicks=!1;for(p=0;p<3;++p)this.tickSpacing[p]=0}else i("tickSpacing")&&(this.autoTicks=!0,h=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),h=!0,u=!0,this._firstInit=!1),h&&this.autoTicks&&(r=s.create(this.bounds,this.tickSpacing),u=!0),u){for(p=0;p<3;++p)r[p].sort((function(t,e){return t.x-e.x}));s.equal(r,this.ticks)?u=!1:this.ticks=r}o("tickEnable"),l("tickFont")&&(u=!0),i("tickSize"),i("tickAngle"),i("tickPad"),c("tickColor");var g=l("labels");l("labelFont")&&(g=!0),o("labelEnable"),i("labelSize"),i("labelPad"),c("labelColor"),o("lineEnable"),o("lineMirror"),i("lineWidth"),c("lineColor"),o("lineTickEnable"),o("lineTickMirror"),i("lineTickLength"),i("lineTickWidth"),c("lineTickColor"),o("gridEnable"),i("gridWidth"),c("gridColor"),o("zeroEnable"),c("zeroLineColor"),i("zeroLineWidth"),o("backgroundEnable"),c("backgroundColor"),this._text?this._text&&(g||u)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=n(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&u&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=a(this.gl,this.bounds,this.ticks))};var p=[new f,new f,new f];function d(t,e,r,n,a){for(var i=t.primalOffset,o=t.primalMinor,s=t.mirrorOffset,l=t.mirrorMinor,c=n[e],u=0;u<3;++u)if(e!==u){var h=i,f=s,p=o,d=l;c&1<<u&&(h=s,f=i,p=l,d=o),h[u]=r[0][u],f[u]=r[1][u],a[u]>0?(p[u]=-1,d[u]=0):(p[u]=0,d[u]=1)}}var g=[0,0,0],m={model:l,view:l,projection:l,_ortho:!1};h.isOpaque=function(){return!0},h.isTransparent=function(){return!1},h.drawTransparent=function(t){};var v=[0,0,0],y=[0,0,0],x=[0,0,0];h.draw=function(t){t=t||m;for(var e=this.gl,r=t.model||l,n=t.view||l,a=t.projection||l,i=this.bounds,s=t._ortho||!1,u=o(r,n,a,i,s),h=u.cubeEdges,f=u.axis,b=n[12],_=n[13],w=n[14],T=n[15],k=(s?2:1)*this.pixelRatio*(a[3]*b+a[7]*_+a[11]*w+a[15]*T)/e.drawingBufferHeight,A=0;A<3;++A)this.lastCubeProps.cubeEdges[A]=h[A],this.lastCubeProps.axis[A]=f[A];var M=p;for(A=0;A<3;++A)d(p[A],A,this.bounds,h,f);e=this.gl;var S,E=g;for(A=0;A<3;++A)this.backgroundEnable[A]?E[A]=f[A]:E[A]=0;this._background.draw(r,n,a,i,E,this.backgroundColor),this._lines.bind(r,n,a,this);for(A=0;A<3;++A){var C=[0,0,0];f[A]>0?C[A]=i[1][A]:C[A]=i[0][A];for(var L=0;L<2;++L){var P=(A+1+L)%3,I=(A+1+(1^L))%3;this.gridEnable[P]&&this._lines.drawGrid(P,I,this.bounds,C,this.gridColor[P],this.gridWidth[P]*this.pixelRatio)}for(L=0;L<2;++L){P=(A+1+L)%3,I=(A+1+(1^L))%3;this.zeroEnable[I]&&Math.min(i[0][I],i[1][I])<=0&&Math.max(i[0][I],i[1][I])>=0&&this._lines.drawZero(P,I,this.bounds,C,this.zeroLineColor[I],this.zeroLineWidth[I]*this.pixelRatio)}}for(A=0;A<3;++A){this.lineEnable[A]&&this._lines.drawAxisLine(A,this.bounds,M[A].primalOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio),this.lineMirror[A]&&this._lines.drawAxisLine(A,this.bounds,M[A].mirrorOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio);var z=c(v,M[A].primalMinor),O=c(y,M[A].mirrorMinor),D=this.lineTickLength;for(L=0;L<3;++L){var R=k/r[5*L];z[L]*=D[L]*R,O[L]*=D[L]*R}this.lineTickEnable[A]&&this._lines.drawAxisTicks(A,M[A].primalOffset,z,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio),this.lineTickMirror[A]&&this._lines.drawAxisTicks(A,M[A].mirrorOffset,O,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio)}this._lines.unbind(),this._text.bind(r,n,a,this.pixelRatio);var F,B;function N(t){(B=[0,0,0])[t]=1}function j(t,e,r){var n=(t+1)%3,a=(t+2)%3,i=e[n],o=e[a],s=r[n],l=r[a];i>0&&l>0||i>0&&l<0||i<0&&l>0||i<0&&l<0?N(n):(o>0&&s>0||o>0&&s<0||o<0&&s>0||o<0&&s<0)&&N(a)}for(A=0;A<3;++A){var V=M[A].primalMinor,U=M[A].mirrorMinor,q=c(x,M[A].primalOffset);for(L=0;L<3;++L)this.lineTickEnable[A]&&(q[L]+=k*V[L]*Math.max(this.lineTickLength[L],0)/r[5*L]);var H=[0,0,0];if(H[A]=1,this.tickEnable[A]){-3600===this.tickAngle[A]?(this.tickAngle[A]=0,this.tickAlign[A]="auto"):this.tickAlign[A]=-1,F=1,"auto"===(S=[this.tickAlign[A],.5,F])[0]?S[0]=0:S[0]=parseInt(""+S[0]),B=[0,0,0],j(A,V,U);for(L=0;L<3;++L)q[L]+=k*V[L]*this.tickPad[L]/r[5*L];this._text.drawTicks(A,this.tickSize[A],this.tickAngle[A],q,this.tickColor[A],H,B,S)}if(this.labelEnable[A]){F=0,B=[0,0,0],this.labels[A].length>4&&(N(A),F=1),"auto"===(S=[this.labelAlign[A],.5,F])[0]?S[0]=0:S[0]=parseInt(""+S[0]);for(L=0;L<3;++L)q[L]+=k*V[L]*this.labelPad[L]/r[5*L];q[A]+=.5*(i[0][A]+i[1][A]),this._text.drawLabel(A,this.labelSize[A],this.labelAngle[A],q,this.labelColor[A],[0,0,0],B,S)}}this._text.unbind()},h.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":246,"./lib/cube.js":247,"./lib/lines.js":248,"./lib/text.js":250,"./lib/ticks.js":251}],246:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(l+2)%3,h=[0,0,0],f=[0,0,0],p=-1;p<=1;p+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),h[l]=p,f[l]=p;for(var d=-1;d<=1;d+=2){h[c]=d;for(var g=-1;g<=1;g+=2)h[u]=g,e.push(h[0],h[1],h[2],f[0],f[1],f[2]),s+=1}var m=c;c=u,u=m}var v=n(t,new Float32Array(e)),y=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),x=a(t,[{buffer:v,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:v,type:t.FLOAT,size:3,offset:12,stride:24}],y),b=i(t);return b.attributes.position.location=0,b.attributes.normal.location=1,new o(t,v,x,b)};var n=t("gl-buffer"),a=t("gl-vao"),i=t("./shaders").bg;function o(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(t,e,r,n,a,i){for(var o=!1,s=0;s<3;++s)o=o||a[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:a,colors:i},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":249,"gl-buffer":253,"gl-vao":327}],247:[function(t,e,r){"use strict";e.exports=function(t,e,r,i,p){a(s,e,t),a(s,r,s);for(var y=0,x=0;x<2;++x){u[2]=i[x][2];for(var b=0;b<2;++b){u[1]=i[b][1];for(var _=0;_<2;++_)u[0]=i[_][0],f(l[y],u,s),y+=1}}var w=-1;for(x=0;x<8;++x){for(var T=l[x][3],k=0;k<3;++k)c[x][k]=l[x][k]/T;p&&(c[x][2]*=-1),T<0&&(w<0||c[x][2]<c[w][2])&&(w=x)}if(w<0){w=0;for(var A=0;A<3;++A){for(var M=(A+2)%3,S=(A+1)%3,E=-1,C=-1,L=0;L<2;++L){var P=(z=L<<A)+(L<<M)+(1-L<<S),I=z+(1-L<<M)+(L<<S);o(c[z],c[P],c[I],h)<0||(L?E=1:C=1)}if(E<0||C<0)C>E&&(w|=1<<A);else{for(L=0;L<2;++L){P=(z=L<<A)+(L<<M)+(1-L<<S),I=z+(1-L<<M)+(L<<S);var z,O=d([l[z],l[P],l[I],l[z+(1<<M)+(1<<S)]]);L?E=O:C=O}C>E&&(w|=1<<A)}}}var D=7^w,R=-1;for(x=0;x<8;++x)x!==w&&x!==D&&(R<0||c[R][1]>c[x][1])&&(R=x);var F=-1;for(x=0;x<3;++x){if((N=R^1<<x)!==w&&N!==D)F<0&&(F=N),(S=c[N])[0]<c[F][0]&&(F=N)}var B=-1;for(x=0;x<3;++x){var N;if((N=R^1<<x)!==w&&N!==D&&N!==F)B<0&&(B=N),(S=c[N])[0]>c[B][0]&&(B=N)}var j=g;j[0]=j[1]=j[2]=0,j[n.log2(F^R)]=R&F,j[n.log2(R^B)]=R&B;var V=7^B;V===w||V===D?(V=7^F,j[n.log2(B^V)]=V&B):j[n.log2(F^V)]=V&F;var U=m,q=w;for(A=0;A<3;++A)U[A]=q&1<<A?-1:1;return v};var n=t("bit-twiddle"),a=t("gl-mat4/multiply"),i=t("split-polygon"),o=t("robust-orientation"),s=new Array(16),l=new Array(8),c=new Array(8),u=new Array(3),h=[0,0,0];function f(t,e,r){for(var n=0;n<4;++n){t[n]=r[12+n];for(var a=0;a<3;++a)t[n]+=e[a]*r[4*a+n]}}!function(){for(var t=0;t<8;++t)l[t]=[1,1,1,1],c[t]=[1,1,1]}();var p=[[0,0,1,0,0],[0,0,-1,1,0],[0,-1,0,1,0],[0,1,0,1,0],[-1,0,0,1,0],[1,0,0,1,0]];function d(t){for(var e=0;e<p.length;++e)if((t=i.positive(t,p[e])).length<3)return 0;var r=t[0],n=r[0]/r[3],a=r[1]/r[3],o=0;for(e=1;e+1<t.length;++e){var s=t[e],l=t[e+1],c=s[0]/s[3]-n,u=s[1]/s[3]-a,h=l[0]/l[3]-n,f=l[1]/l[3]-a;o+=Math.abs(c*f-u*h)}return o}var g=[1,1,1],m=[0,0,0],v={cubeEdges:g,axis:m}},{"bit-twiddle":95,"gl-mat4/multiply":275,"robust-orientation":500,"split-polygon":518}],248:[function(t,e,r){"use strict";e.exports=function(t,e,r){var o=[],s=[0,0,0],l=[0,0,0],c=[0,0,0],u=[0,0,0];o.push(0,0,1,0,1,1,0,0,-1,0,0,-1,0,1,1,0,1,-1);for(var h=0;h<3;++h){for(var f=o.length/3|0,d=0;d<r[h].length;++d){var g=+r[h][d].x;o.push(g,0,1,g,1,1,g,0,-1,g,0,-1,g,1,1,g,1,-1)}var m=o.length/3|0;s[h]=f,l[h]=m-f;f=o.length/3|0;for(var v=0;v<r[h].length;++v){g=+r[h][v].x;o.push(g,0,1,g,1,1,g,0,-1,g,0,-1,g,1,1,g,1,-1)}m=o.length/3|0;c[h]=f,u[h]=m-f}var y=n(t,new Float32Array(o)),x=a(t,[{buffer:y,type:t.FLOAT,size:3,stride:0,offset:0}]),b=i(t);return b.attributes.position.location=0,new p(t,y,x,b,l,s,u,c)};var n=t("gl-buffer"),a=t("gl-vao"),i=t("./shaders").line,o=[0,0,0],s=[0,0,0],l=[0,0,0],c=[0,0,0],u=[1,1];function h(t){return t[0]=t[1]=t[2]=0,t}function f(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function p(t,e,r,n,a,i,o,s){this.gl=t,this.vertBuffer=e,this.vao=r,this.shader=n,this.tickCount=a,this.tickOffset=i,this.gridCount=o,this.gridOffset=s}var d=p.prototype;d.bind=function(t,e,r){this.shader.bind(),this.shader.uniforms.model=t,this.shader.uniforms.view=e,this.shader.uniforms.projection=r,u[0]=this.gl.drawingBufferWidth,u[1]=this.gl.drawingBufferHeight,this.shader.uniforms.screenShape=u,this.vao.bind()},d.unbind=function(){this.vao.unbind()},d.drawAxisLine=function(t,e,r,n,a){var i=h(s);this.shader.uniforms.majorAxis=s,i[t]=e[1][t]-e[0][t],this.shader.uniforms.minorAxis=i;var o,u=f(c,r);u[t]+=e[0][t],this.shader.uniforms.offset=u,this.shader.uniforms.lineWidth=a,this.shader.uniforms.color=n,(o=h(l))[(t+2)%3]=1,this.shader.uniforms.screenAxis=o,this.vao.draw(this.gl.TRIANGLES,6),(o=h(l))[(t+1)%3]=1,this.shader.uniforms.screenAxis=o,this.vao.draw(this.gl.TRIANGLES,6)},d.drawAxisTicks=function(t,e,r,n,a){if(this.tickCount[t]){var i=h(o);i[t]=1,this.shader.uniforms.majorAxis=i,this.shader.uniforms.offset=e,this.shader.uniforms.minorAxis=r,this.shader.uniforms.color=n,this.shader.uniforms.lineWidth=a;var s=h(l);s[t]=1,this.shader.uniforms.screenAxis=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[t],this.tickOffset[t])}},d.drawGrid=function(t,e,r,n,a,i){if(this.gridCount[t]){var u=h(s);u[e]=r[1][e]-r[0][e],this.shader.uniforms.minorAxis=u;var p=f(c,n);p[e]+=r[0][e],this.shader.uniforms.offset=p;var d=h(o);d[t]=1,this.shader.uniforms.majorAxis=d;var g=h(l);g[t]=1,this.shader.uniforms.screenAxis=g,this.shader.uniforms.lineWidth=i,this.shader.uniforms.color=a,this.vao.draw(this.gl.TRIANGLES,this.gridCount[t],this.gridOffset[t])}},d.drawZero=function(t,e,r,n,a,i){var o=h(s);this.shader.uniforms.majorAxis=o,o[t]=r[1][t]-r[0][t],this.shader.uniforms.minorAxis=o;var u=f(c,n);u[t]+=r[0][t],this.shader.uniforms.offset=u;var p=h(l);p[e]=1,this.shader.uniforms.screenAxis=p,this.shader.uniforms.lineWidth=i,this.shader.uniforms.color=a,this.vao.draw(this.gl.TRIANGLES,6)},d.dispose=function(){this.vao.dispose(),this.vertBuffer.dispose(),this.shader.dispose()}},{"./shaders":249,"gl-buffer":253,"gl-vao":327}],249:[function(t,e,r){"use strict";var n=t("glslify"),a=t("gl-shader"),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\nuniform vec3 offset, majorAxis, minorAxis, screenAxis;\nuniform float lineWidth;\nuniform vec2 screenShape;\n\nvec3 project(vec3 p) {\n vec4 pp = projection * view * model * vec4(p, 1.0);\n return pp.xyz / max(pp.w, 0.0001);\n}\n\nvoid main() {\n vec3 major = position.x * majorAxis;\n vec3 minor = position.y * minorAxis;\n\n vec3 vPosition = major + minor + offset;\n vec3 pPosition = project(vPosition);\n vec3 offset = project(vPosition + screenAxis * position.z);\n\n vec2 screen = normalize((offset - pPosition).xy * screenShape) / screenShape;\n\n gl_Position = vec4(pPosition + vec3(0.5 * screen * lineWidth, 0), 1.0);\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);r.line=function(t){return a(t,i,o,null,[{name:"position",type:"vec3"}])};var s=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\nuniform vec3 offset, axis, alignDir, alignOpt;\nuniform float scale, angle, pixelScale;\nuniform vec2 resolution;\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\nfloat computeViewAngle(vec3 a, vec3 b) {\n vec3 A = project(a);\n vec3 B = project(b);\n\n return atan(\n (B.y - A.y) * resolution.y,\n (B.x - A.x) * resolution.x\n );\n}\n\nconst float PI = 3.141592;\nconst float TWO_PI = 2.0 * PI;\nconst float HALF_PI = 0.5 * PI;\nconst float ONE_AND_HALF_PI = 1.5 * PI;\n\nint option = int(floor(alignOpt.x + 0.001));\nfloat hv_ratio = alignOpt.y;\nbool enableAlign = (alignOpt.z != 0.0);\n\nfloat mod_angle(float a) {\n return mod(a, PI);\n}\n\nfloat positive_angle(float a) {\n return mod_angle((a < 0.0) ?\n a + TWO_PI :\n a\n );\n}\n\nfloat look_upwards(float a) {\n float b = positive_angle(a);\n return ((b > HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);r.text=function(t){return a(t,s,l,null,[{name:"position",type:"vec3"}])};var c=n(["precision highp float;\n#define GLSLIFY 1\n\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\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 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\n colorChannel = abs(realNormal);\n}"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] +\n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}"]);r.bg=function(t){return a(t,c,u,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":307,glslify:408}],250:[function(t,e,r){(function(r){"use strict";e.exports=function(t,e,r,i,s,l){var u=n(t),h=a(t,[{buffer:u,size:3}]),f=o(t);f.attributes.position.location=0;var p=new c(t,f,u,h);return p.update(e,r,i,s,l),p};var n=t("gl-buffer"),a=t("gl-vao"),i=t("vectorize-text"),o=t("./shaders").text,s=window||r.global||{},l=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};function c(t,e,r,n){this.gl=t,this.shader=e,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var u=c.prototype,h=[0,0];u.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var a=this.shader.uniforms;a.model=t,a.view=e,a.projection=r,a.pixelScale=n,h[0]=this.gl.drawingBufferWidth,h[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=h},u.unbind=function(){this.vao.unbind()},u.update=function(t,e,r,n,a){var o=[];function s(t,e,r,n,a,s){var c=l[r];c||(c=l[r]={});var u=c[e];u||(u=c[e]=function(t,e){try{return i(t,e)}catch(e){return console.warn('error vectorizing text:"'+t+'" error:',e),{cells:[],positions:[]}}}(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle",lineSpacing:a,styletags:s}));for(var h=(n||12)/12,f=u.positions,p=u.cells,d=0,g=p.length;d<g;++d)for(var m=p[d],v=2;v>=0;--v){var y=f[m[v]];o.push(h*y[0],-h*y[1],t)}}for(var c=[0,0,0],u=[0,0,0],h=[0,0,0],f=[0,0,0],p={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},d=0;d<3;++d){h[d]=o.length/3|0,s(.5*(t[0][d]+t[1][d]),e[d],r[d],12,1.25,p),f[d]=(o.length/3|0)-h[d],c[d]=o.length/3|0;for(var g=0;g<n[d].length;++g)n[d][g].text&&s(n[d][g].x,n[d][g].text,n[d][g].font||a,n[d][g].fontSize||12,1.25,p);u[d]=(o.length/3|0)-c[d]}this.buffer.update(o),this.tickOffset=c,this.tickCount=u,this.labelOffset=h,this.labelCount=f},u.drawTicks=function(t,e,r,n,a,i,o,s){this.tickCount[t]&&(this.shader.uniforms.axis=i,this.shader.uniforms.color=a,this.shader.uniforms.angle=r,this.shader.uniforms.scale=e,this.shader.uniforms.offset=n,this.shader.uniforms.alignDir=o,this.shader.uniforms.alignOpt=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[t],this.tickOffset[t]))},u.drawLabel=function(t,e,r,n,a,i,o,s){this.labelCount[t]&&(this.shader.uniforms.axis=i,this.shader.uniforms.color=a,this.shader.uniforms.angle=r,this.shader.uniforms.scale=e,this.shader.uniforms.offset=n,this.shader.uniforms.alignDir=o,this.shader.uniforms.alignOpt=s,this.vao.draw(this.gl.TRIANGLES,this.labelCount[t],this.labelOffset[t]))},u.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()}}).call(this,t("_process"))},{"./shaders":249,_process:480,"gl-buffer":253,"gl-vao":327,"vectorize-text":552}],251:[function(t,e,r){"use strict";function n(t,e){var r=t+"",n=r.indexOf("."),a=0;n>=0&&(a=r.length-n-1);var i=Math.pow(10,a),o=Math.round(t*e*i),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/i,c=o%i;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(o<0&&(u="-"+u),a){for(var h=""+c;h.length<a;)h="0"+h;return u+"."+h}return u}r.create=function(t,e){for(var r=[],a=0;a<3;++a){for(var i=[],o=(t[0][a],t[1][a],0);o*e[a]<=t[1][a];++o)i.push({x:o*e[a],text:n(e[a],o)});for(o=-1;o*e[a]>=t[0][a];--o)i.push({x:o*e[a],text:n(e[a],o)});r.push(i)}return r},r.equal=function(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;++n){var a=t[r][n],i=e[r][n];if(a.x!==i.x||a.text!==i.text||a.font!==i.font||a.fontColor!==i.fontColor||a.fontSize!==i.fontSize||a.dx!==i.dx||a.dy!==i.dy)return!1}}return!0}},{}],252:[function(t,e,r){"use strict";e.exports=function(t,e,r,l,h){var f=e.model||c,p=e.view||c,v=e.projection||c,y=e._ortho||!1,x=t.bounds,b=(h=h||i(f,p,v,x,y)).axis;o(u,p,f),o(u,v,u);for(var _=g,w=0;w<3;++w)_[w].lo=1/0,_[w].hi=-1/0,_[w].pixelsPerDataUnit=1/0;var T=n(s(u,u));s(u,u);for(var k=0;k<3;++k){var A=(k+1)%3,M=(k+2)%3,S=m;t:for(w=0;w<2;++w){var E=[];if(b[k]<0!=!!w){S[k]=x[w][k];for(var C=0;C<2;++C){S[A]=x[C^w][A];for(var L=0;L<2;++L)S[M]=x[L^C^w][M],E.push(S.slice())}var P=y?5:4;for(C=P;C===P;++C){if(0===E.length)continue t;E=a.positive(E,T[C])}for(C=0;C<E.length;++C){M=E[C];var I=d(m,u,M,r,l);for(L=0;L<3;++L)_[L].lo=Math.min(_[L].lo,M[L]),_[L].hi=Math.max(_[L].hi,M[L]),L!==k&&(_[L].pixelsPerDataUnit=Math.min(_[L].pixelsPerDataUnit,Math.abs(I[L])))}}}}return _};var n=t("extract-frustum-planes"),a=t("split-polygon"),i=t("./lib/cube.js"),o=t("gl-mat4/multiply"),s=t("gl-mat4/transpose"),l=t("gl-vec4/transformMat4"),c=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),u=new Float32Array(16);function h(t,e,r){this.lo=t,this.hi=e,this.pixelsPerDataUnit=r}var f=[0,0,0,1],p=[0,0,0,1];function d(t,e,r,n,a){for(var i=0;i<3;++i){for(var o=f,s=p,c=0;c<3;++c)s[c]=o[c]=r[c];s[3]=o[3]=1,s[i]+=1,l(s,s,e),s[3]<0&&(t[i]=1/0),o[i]-=1,l(o,o,e),o[3]<0&&(t[i]=1/0);var u=(o[0]/o[3]-s[0]/s[3])*n,h=(o[1]/o[3]-s[1]/s[3])*a;t[i]=.25*Math.sqrt(u*u+h*h)}return t}var g=[new h(1/0,-1/0,1/0),new h(1/0,-1/0,1/0),new h(1/0,-1/0,1/0)],m=[0,0,0]},{"./lib/cube.js":247,"extract-frustum-planes":235,"gl-mat4/multiply":275,"gl-mat4/transpose":284,"gl-vec4/transformMat4":398,"split-polygon":518}],253:[function(t,e,r){"use strict";var n=t("typedarray-pool"),a=t("ndarray-ops"),i=t("ndarray"),o=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"];function s(t,e,r,n,a){this.gl=t,this.type=e,this.handle=r,this.length=n,this.usage=a}var l=s.prototype;function c(t,e,r,n,a,i){var o=a.length*a.BYTES_PER_ELEMENT;if(i<0)return t.bufferData(e,a,n),o;if(o+i>r)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,i,a),r}function u(t,e){for(var r=n.malloc(t.length,e),a=t.length,i=0;i<a;++i)r[i]=t[i];return r}l.bind=function(){this.gl.bindBuffer(this.type,this.handle)},l.unbind=function(){this.gl.bindBuffer(this.type,null)},l.dispose=function(){this.gl.deleteBuffer(this.handle)},l.update=function(t,e){if("number"!=typeof e&&(e=-1),this.bind(),"object"==typeof t&&"undefined"!=typeof t.shape){var r=t.dtype;if(o.indexOf(r)<0&&(r="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER)r=gl.getExtension("OES_element_index_uint")&&"uint16"!==r?"uint32":"uint16";if(r===t.dtype&&function(t,e){for(var r=1,n=e.length-1;n>=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=c(this.gl,this.type,this.length,this.usage,t.data,e):this.length=c(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=i(s,t.shape);a.assign(l,t),this.length=c(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var h;h=this.type===this.gl.ELEMENT_ARRAY_BUFFER?u(t,"uint16"):u(t,"float32"),this.length=c(this.gl,this.type,this.length,this.usage,e<0?h:h.subarray(0,t.length),e),n.free(h)}else if("object"==typeof t&&"number"==typeof t.length)this.length=c(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(t|=0)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var a=t.createBuffer(),i=new s(t,r,a,0,n);return i.update(e),i}},{ndarray:448,"ndarray-ops":443,"typedarray-pool":547}],254:[function(t,e,r){"use strict";var n=t("gl-vec3");e.exports=function(t,e){var r=t.positions,a=t.vectors,i={positions:[],vertexIntensity:[],vertexIntensityBounds:t.vertexIntensityBounds,vectors:[],cells:[],coneOffset:t.coneOffset,colormap:t.colormap};if(0===t.positions.length)return e&&(e[0]=[0,0,0],e[1]=[0,0,0]),i;for(var o=0,s=1/0,l=-1/0,c=1/0,u=-1/0,h=1/0,f=-1/0,p=null,d=null,g=[],m=1/0,v=!1,y=0;y<r.length;y++){var x=r[y];s=Math.min(x[0],s),l=Math.max(x[0],l),c=Math.min(x[1],c),u=Math.max(x[1],u),h=Math.min(x[2],h),f=Math.max(x[2],f);var b=a[y];if(n.length(b)>o&&(o=n.length(b)),y){var _=2*n.distance(p,x)/(n.length(d)+n.length(b));_?(m=Math.min(m,_),v=!1):v=!0}v||(p=x,d=b),g.push(b)}var w=[s,c,h],T=[l,u,f];e&&(e[0]=w,e[1]=T),0===o&&(o=1);var k=1/o;isFinite(m)||(m=1),i.vectorScale=m;var A=t.coneSize||.5;t.absoluteConeSize&&(A=t.absoluteConeSize*k),i.coneScale=A;y=0;for(var M=0;y<r.length;y++)for(var S=(x=r[y])[0],E=x[1],C=x[2],L=g[y],P=n.length(L)*k,I=0;I<8;I++){i.positions.push([S,E,C,M++]),i.positions.push([S,E,C,M++]),i.positions.push([S,E,C,M++]),i.positions.push([S,E,C,M++]),i.positions.push([S,E,C,M++]),i.positions.push([S,E,C,M++]),i.vectors.push(L),i.vectors.push(L),i.vectors.push(L),i.vectors.push(L),i.vectors.push(L),i.vectors.push(L),i.vertexIntensity.push(P,P,P),i.vertexIntensity.push(P,P,P);var z=i.positions.length;i.cells.push([z-6,z-5,z-4],[z-3,z-2,z-1])}return i};var a=t("./lib/shaders");e.exports.createMesh=t("./create_mesh"),e.exports.createConeMesh=function(t,r){return e.exports.createMesh(t,r,{shaders:a,traceType:"cone"})}},{"./create_mesh":255,"./lib/shaders":256,"gl-vec3":346}],255:[function(t,e,r){"use strict";var n=t("gl-shader"),a=t("gl-buffer"),i=t("gl-vao"),o=t("gl-texture2d"),s=t("gl-mat4/multiply"),l=t("gl-mat4/invert"),c=t("ndarray"),u=t("colormap"),h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function f(t,e,r,n,a,i,o,s,l,c,u){this.gl=t,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.pickShader=n,this.trianglePositions=a,this.triangleVectors=i,this.triangleColors=s,this.triangleUVs=l,this.triangleIds=o,this.triangleVAO=c,this.triangleCount=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.traceType=u,this.tubeScale=1,this.coneScale=2,this.vectorScale=1,this.coneOffset=.25,this._model=h,this._view=h,this._projection=h,this._resolution=[1,1]}var p=f.prototype;function d(t,e){var r=n(t,e.meshShader.vertex,e.meshShader.fragment,null,e.meshShader.attributes);return r.attributes.position.location=0,r.attributes.color.location=2,r.attributes.uv.location=3,r.attributes.vector.location=4,r}function g(t,e){var r=n(t,e.pickShader.vertex,e.pickShader.fragment,null,e.pickShader.attributes);return r.attributes.position.location=0,r.attributes.id.location=1,r.attributes.vector.location=4,r}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.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,"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),void 0!==t.tubeScale&&(this.tubeScale=t.tubeScale),void 0!==t.vectorScale&&(this.vectorScale=t.vectorScale),void 0!==t.coneScale&&(this.coneScale=t.coneScale),void 0!==t.coneOffset&&(this.coneOffset=t.coneOffset),t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(function(t){for(var e=u({colormap:t,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var a=e[n],i=0;i<3;++i)r[4*n+i]=a[i];r[4*n+3]=255*a[3]}return c(r,[256,256,4],[4,0,1])}(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions,a=t.vectors;if(n&&r&&a){var i=[],o=[],s=[],l=[],h=[];this.cells=r,this.positions=n,this.vectors=a;var f=t.meshColor||[1,1,1,1],p=t.vertexIntensity,d=1/0,g=-1/0;if(p)if(t.vertexIntensityBounds)d=+t.vertexIntensityBounds[0],g=+t.vertexIntensityBounds[1];else for(var m=0;m<p.length;++m){var v=p[m];d=Math.min(d,v),g=Math.max(g,v)}else for(m=0;m<n.length;++m){v=n[m][2];d=Math.min(d,v),g=Math.max(g,v)}this.intensity=p||function(t){for(var e=t.length,r=new Array(e),n=0;n<e;++n)r[n]=t[n][2];return r}(n),this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(m=0;m<n.length;++m)for(var y=n[m],x=0;x<3;++x)!isNaN(y[x])&&isFinite(y[x])&&(this.bounds[0][x]=Math.min(this.bounds[0][x],y[x]),this.bounds[1][x]=Math.max(this.bounds[1][x],y[x]));var b=0;t:for(m=0;m<r.length;++m){var _=r[m];switch(_.length){case 3:for(x=0;x<3;++x){y=n[T=_[x]];for(var w=0;w<3;++w)if(isNaN(y[w])||!isFinite(y[w]))continue t}for(x=0;x<3;++x){var T;y=n[T=_[2-x]];i.push(y[0],y[1],y[2],y[3]);var k=a[T];o.push(k[0],k[1],k[2],k[3]||0);var A,M=f;3===M.length?s.push(M[0],M[1],M[2],1):s.push(M[0],M[1],M[2],M[3]),A=p?[(p[T]-d)/(g-d),0]:[(y[2]-d)/(g-d),0],l.push(A[0],A[1]),h.push(m)}b+=1}}this.triangleCount=b,this.trianglePositions.update(i),this.triangleVectors.update(o),this.triangleColors.update(s),this.triangleUVs.update(l),this.triangleIds.update(new Uint32Array(h))}},p.drawTransparent=p.draw=function(t){t=t||{};for(var e=this.gl,r=t.model||h,n=t.view||h,a=t.projection||h,i=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)i[0][o]=Math.max(i[0][o],this.clipBounds[0][o]),i[1][o]=Math.min(i[1][o],this.clipBounds[1][o]);var c={model:r,view:n,projection:a,inverseModel:h.slice(),clipBounds:i,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,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,texture:0};c.inverseModel=l(c.inverseModel,c.model),e.disable(e.CULL_FACE),this.texture.bind(0);var u=new Array(16);s(u,c.view,c.model),s(u,c.projection,u),l(u,u);for(o=0;o<3;++o)c.eyePosition[o]=u[12+o]/u[15];var f=u[15];for(o=0;o<3;++o)f+=this.lightPosition[o]*u[4*o+3];for(o=0;o<3;++o){for(var p=u[12+o],d=0;d<3;++d)p+=u[4*d+o]*this.lightPosition[d];c.lightPosition[o]=p/f}if(this.triangleCount>0){var g=this.triShader;g.bind(),g.uniforms=c,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},p.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||h,n=t.view||h,a=t.projection||h,i=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)i[0][o]=Math.max(i[0][o],this.clipBounds[0][o]),i[1][o]=Math.min(i[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(a),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:a,clipBounds:i,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,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())},p.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3),a={position:n,dataCoordinate:n,index:Math.floor(r[1]/48)};return"cone"===this.traceType?a.index=Math.floor(r[1]/48):"streamtube"===this.traceType&&(a.intensity=this.intensity[r[1]],a.velocity=this.vectors[r[1]].slice(0,3),a.divergence=this.vectors[r[1]][3],a.index=e),a},p.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},e.exports=function(t,e,r){var n=r.shaders;1===arguments.length&&(t=(e=t).gl);var s=d(t,n),l=g(t,n),u=o(t,c(new Uint8Array([255,255,255,255]),[1,1,4]));u.generateMipmap(),u.minFilter=t.LINEAR_MIPMAP_LINEAR,u.magFilter=t.LINEAR;var h=a(t),p=a(t),m=a(t),v=a(t),y=a(t),x=i(t,[{buffer:h,type:t.FLOAT,size:4},{buffer:y,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:m,type:t.FLOAT,size:4},{buffer:v,type:t.FLOAT,size:2},{buffer:p,type:t.FLOAT,size:4}]),b=new f(t,u,s,l,h,p,y,m,v,x,r.traceType||"cone");return b.update(e),b}},{colormap:128,"gl-buffer":253,"gl-mat4/invert":273,"gl-mat4/multiply":275,"gl-shader":307,"gl-texture2d":322,"gl-vao":327,ndarray:448}],256:[function(t,e,r){var n=t("glslify"),a=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),i=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float vectorScale, coneScale, coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * view * conePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},{glslify:408}],257:[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"}},{}],258:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":257}],259:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e),o=a(e,[{buffer:r,type:e.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:e.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:e.FLOAT,size:3,offset:28,stride:40}]),l=i(e);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var c=new s(e,r,o,l);return c.update(t),c};var n=t("gl-buffer"),a=t("gl-vao"),i=t("./shaders/index"),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var l=s.prototype;function c(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||o,a=r.projection=t.projection||o;r.model=t.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var i=n[12],s=n[13],l=n[14],c=n[15],u=(t._ortho||!1?2:1)*this.pixelRatio*(a[3]*i+a[7]*s+a[11]*l+a[15]*c)/e.drawingBufferHeight;this.vao.bind();for(var h=0;h<3;++h)e.lineWidth(this.lineWidth[h]*this.pixelRatio),r.capSize=this.capSize[h]*u,this.lineCount[h]&&e.drawArrays(e.LINES,this.lineOffset[h],this.lineCount[h]);this.vao.unbind()};var u=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var a=-1;a<=1;a+=2){var i=[0,0,0];i[(n+e)%3]=a,r.push(i)}t[e]=r}return t}();function h(t,e,r,n){for(var a=u[n],i=0;i<a.length;++i){var o=a[i];t.push(e[0],e[1],e[2],r[0],r[1],r[2],r[3],o[0],o[1],o[2])}return a.length}l.update=function(t){"lineWidth"in(t=t||{})&&(this.lineWidth=t.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),"capSize"in t&&(this.capSize=t.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),this.hasAlpha=!1,"opacity"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));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 a=[],i=r.length,o=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var s=0;s<3;++s){this.lineOffset[s]=o;t:for(var l=0;l<i;++l){for(var u=r[l],f=0;f<3;++f)if(isNaN(u[f])||!isFinite(u[f]))continue t;var p=n[l],d=e[s];if(Array.isArray(d[0])&&(d=e[l]),3===d.length?d=[d[0],d[1],d[2],1]:4===d.length&&(d=[d[0],d[1],d[2],d[3]],!this.hasAlpha&&d[3]<1&&(this.hasAlpha=!0)),!isNaN(p[0][s])&&!isNaN(p[1][s])){var g;if(p[0][s]<0)(g=u.slice())[s]+=p[0][s],a.push(u[0],u[1],u[2],d[0],d[1],d[2],d[3],0,0,0,g[0],g[1],g[2],d[0],d[1],d[2],d[3],0,0,0),c(this.bounds,g),o+=2+h(a,g,d,s);if(p[1][s]>0)(g=u.slice())[s]+=p[1][s],a.push(u[0],u[1],u[2],d[0],d[1],d[2],d[3],0,0,0,g[0],g[1],g[2],d[0],d[1],d[2],d[3],0,0,0),c(this.bounds,g),o+=2+h(a,g,d,s)}}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(a)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":260,"gl-buffer":253,"gl-vao":327}],260:[function(t,e,r){"use strict";var n=t("glslify"),a=t("gl-shader"),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * view * worldPosition;\n fragColor = color;\n fragPosition = position;\n}"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);e.exports=function(t){return a(t,i,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},{"gl-shader":307,glslify:408}],261:[function(t,e,r){"use strict";var n=t("gl-texture2d");e.exports=function(t,e,r,n){a||(a=t.FRAMEBUFFER_UNSUPPORTED,i=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var c=t.getExtension("WEBGL_draw_buffers");!l&&c&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var a=new Array(r),i=0;i<n;++i)a[i]=t.COLOR_ATTACHMENT0+i;for(i=n;i<r;++i)a[i]=t.NONE;l[n]=a}}(t,c);Array.isArray(e)&&(n=r,r=0|e[1],e=0|e[0]);if("number"!=typeof e)throw new Error("gl-fbo: Missing shape parameter");var u=t.getParameter(t.MAX_RENDERBUFFER_SIZE);if(e<0||e>u||r<0||r>u)throw new Error("gl-fbo: Parameters are too large for FBO");var h=1;if("color"in(n=n||{})){if((h=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(h>1){if(!c)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(h>t.getParameter(c.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+h+" draw buffers")}}var f=t.UNSIGNED_BYTE,p=t.getExtension("OES_texture_float");if(n.float&&h>0){if(!p)throw new Error("gl-fbo: Context does not support floating point textures");f=t.FLOAT}else n.preferFloat&&h>0&&p&&(f=t.FLOAT);var g=!0;"depth"in n&&(g=!!n.depth);var m=!1;"stencil"in n&&(m=!!n.stencil);return new d(t,e,r,f,h,g,m,c)};var a,i,o,s,l=null;function c(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function u(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function h(t){switch(t){case a:throw new Error("gl-fbo: Framebuffer unsupported");case i:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function f(t,e,r,a,i,o){if(!a)return null;var s=n(t,e,r,i,a);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function p(t,e,r,n,a){var i=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,i),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,a,t.RENDERBUFFER,i),i}function d(t,e,r,n,a,i,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(a);for(var d=0;d<a;++d)this.color[d]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=n,this._useDepth=i,this._useStencil=o;var g=this,m=[0|e,0|r];Object.defineProperties(m,{0:{get:function(){return g._shape[0]},set:function(t){return g.width=t}},1:{get:function(){return g._shape[1]},set:function(t){return g.height=t}}}),this._shapeVector=m,function(t){var e=c(t.gl),r=t.gl,n=t.handle=r.createFramebuffer(),a=t._shape[0],i=t._shape[1],o=t.color.length,s=t._ext,d=t._useStencil,g=t._useDepth,m=t._colorType;r.bindFramebuffer(r.FRAMEBUFFER,n);for(var v=0;v<o;++v)t.color[v]=f(r,a,i,m,r.RGBA,r.COLOR_ATTACHMENT0+v);0===o?(t._color_rb=p(r,a,i,r.RGBA4,r.COLOR_ATTACHMENT0),s&&s.drawBuffersWEBGL(l[0])):o>1&&s.drawBuffersWEBGL(l[o]);var y=r.getExtension("WEBGL_depth_texture");y?d?t.depth=f(r,a,i,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):g&&(t.depth=f(r,a,i,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):g&&d?t._depth_rb=p(r,a,i,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):g?t._depth_rb=p(r,a,i,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=p(r,a,i,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==r.FRAMEBUFFER_COMPLETE){t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null);for(v=0;v<t.color.length;++v)t.color[v].dispose(),t.color[v]=null;t._color_rb&&(r.deleteRenderbuffer(t._color_rb),t._color_rb=null),u(r,e),h(x)}u(r,e)}(this)}var g=d.prototype;function m(t,e,r){if(t._destroyed)throw new Error("gl-fbo: Can't resize destroyed FBO");if(t._shape[0]!==e||t._shape[1]!==r){var n=t.gl,a=n.getParameter(n.MAX_RENDERBUFFER_SIZE);if(e<0||e>a||r<0||r>a)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var i=c(n),o=0;o<t.color.length;++o)t.color[o].shape=t._shape;t._color_rb&&(n.bindRenderbuffer(n.RENDERBUFFER,t._color_rb),n.renderbufferStorage(n.RENDERBUFFER,n.RGBA4,t._shape[0],t._shape[1])),t.depth&&(t.depth.shape=t._shape),t._depth_rb&&(n.bindRenderbuffer(n.RENDERBUFFER,t._depth_rb),t._useDepth&&t._useStencil?n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,t._shape[0],t._shape[1]):t._useDepth?n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,t._shape[0],t._shape[1]):t._useStencil&&n.renderbufferStorage(n.RENDERBUFFER,n.STENCIL_INDEX,t._shape[0],t._shape[1])),n.bindFramebuffer(n.FRAMEBUFFER,t.handle);var s=n.checkFramebufferStatus(n.FRAMEBUFFER);s!==n.FRAMEBUFFER_COMPLETE&&(t.dispose(),u(n,i),h(s)),u(n,i)}}Object.defineProperties(g,{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 m(this,e,r),[e,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return m(this,t|=0,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t|=0,m(this,this._shape[0],t),t},enumerable:!1}}),g.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])}},g.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":322}],262:[function(t,e,r){var n=t("sprintf-js").sprintf,a=t("gl-constants/lookup"),i=t("glsl-shader-name"),o=t("add-line-numbers");e.exports=function(t,e,r){"use strict";var s=i(e)||"of unknown name (see npm glsl-shader-name)",l="unknown type";void 0!==r&&(l=r===a.FRAGMENT_SHADER?"fragment":"vertex");for(var c=n("Error compiling %s shader %s:\n",l,s),u=n("%s%s",c,t),h=t.split("\n"),f={},p=0;p<h.length;p++){var d=h[p];if(""!==d&&"\0"!==d){var g=parseInt(d.split(":")[2]);if(isNaN(g))throw new Error(n("Could not parse error: %s",d));f[g]=d}}var m=o(e).split("\n");for(p=0;p<m.length;p++)if(f[p+3]||f[p+2]||f[p+1]){var v=m[p];if(c+=v+"\n",f[p+1]){var y=f[p+1];y=y.substr(y.split(":",3).join(":").length+1).trim(),c+=n("^^^ %s\n\n",y)}}return{long:c.trim(),short:u.trim()}}},{"add-line-numbers":64,"gl-constants/lookup":258,"glsl-shader-name":400,"sprintf-js":519}],263:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.gl,n=o(r,l.vertex,l.fragment),a=o(r,l.pickVertex,l.pickFragment),i=s(r),u=s(r),h=s(r),f=s(r),p=new c(t,n,a,i,u,h,f);return p.update(e),t.addObject(p),p};var n=t("binary-search-bounds"),a=t("iota-array"),i=t("typedarray-pool"),o=t("gl-shader"),s=t("gl-buffer"),l=t("./lib/shaders");function c(t,e,r,n,a,i,o){this.plot=t,this.shader=e,this.pickShader=r,this.positionBuffer=n,this.weightBuffer=a,this.colorBuffer=i,this.idBuffer=o,this.xData=[],this.yData=[],this.shape=[0,0],this.bounds=[1/0,1/0,-1/0,-1/0],this.pickOffset=0}var u,h=c.prototype,f=[0,0,1,0,0,1,1,0,1,1,0,1];h.draw=(u=[1,0,0,0,1,0,0,0,1],function(){var t=this.plot,e=this.shader,r=this.bounds,n=this.numVertices;if(!(n<=0)){var a=t.gl,i=t.dataBox,o=r[2]-r[0],s=r[3]-r[1],l=i[2]-i[0],c=i[3]-i[1];u[0]=2*o/l,u[4]=2*s/c,u[6]=2*(r[0]-i[0])/l-1,u[7]=2*(r[1]-i[1])/c-1,e.bind();var h=e.uniforms;h.viewTransform=u,h.shape=this.shape;var f=e.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,n)}}),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,a=this.pickShader,i=this.bounds,o=this.numVertices;if(!(o<=0)){var s=n.gl,l=n.dataBox,c=i[2]-i[0],u=i[3]-i[1],h=l[2]-l[0],f=l[3]-l[1];t[0]=2*c/h,t[4]=2*u/f,t[6]=2*(i[0]-l[0])/h-1,t[7]=2*(i[1]-l[1])/f-1;for(var p=0;p<4;++p)e[p]=r>>8*p&255;this.pickOffset=r,a.bind();var d=a.uniforms;d.viewTransform=t,d.pickOffset=e,d.shape=this.shape;var g=a.attributes;return this.positionBuffer.bind(),g.position.pointer(),this.weightBuffer.bind(),g.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),g.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,a=this.shape[0]*this.shape[1];if(r<n||r>=n+a)return null;var i=r-n,o=this.xData,s=this.yData;return{object:this,pointId:i,dataCoord:[o[i%this.shape[0]],s[i/this.shape[0]|0]]}},h.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||a(e[0]),o=t.y||a(e[1]),s=t.z||new Float32Array(e[0]*e[1]);this.xData=r,this.yData=o;var l=t.colorLevels||[0],c=t.colorValues||[0,0,0,1],u=l.length,h=this.bounds,p=h[0]=r[0],d=h[1]=o[0],g=1/((h[2]=r[r.length-1])-p),m=1/((h[3]=o[o.length-1])-d),v=e[0],y=e[1];this.shape=[v,y];var x=(v-1)*(y-1)*(f.length>>>1);this.numVertices=x;for(var b=i.mallocUint8(4*x),_=i.mallocFloat32(2*x),w=i.mallocUint8(2*x),T=i.mallocUint32(x),k=0,A=0;A<y-1;++A)for(var M=m*(o[A]-d),S=m*(o[A+1]-d),E=0;E<v-1;++E)for(var C=g*(r[E]-p),L=g*(r[E+1]-p),P=0;P<f.length;P+=2){var I,z,O,D,R=f[P],F=f[P+1],B=s[(A+F)*v+(E+R)],N=n.le(l,B);if(N<0)I=c[0],z=c[1],O=c[2],D=c[3];else if(N===u-1)I=c[4*u-4],z=c[4*u-3],O=c[4*u-2],D=c[4*u-1];else{var j=(B-l[N])/(l[N+1]-l[N]),V=1-j,U=4*N,q=4*(N+1);I=V*c[U]+j*c[q],z=V*c[U+1]+j*c[q+1],O=V*c[U+2]+j*c[q+2],D=V*c[U+3]+j*c[q+3]}b[4*k]=255*I,b[4*k+1]=255*z,b[4*k+2]=255*O,b[4*k+3]=255*D,_[2*k]=.5*C+.5*L,_[2*k+1]=.5*M+.5*S,w[2*k]=R,w[2*k+1]=F,T[k]=A*v+E,k+=1}this.positionBuffer.update(_),this.weightBuffer.update(w),this.colorBuffer.update(b),this.idBuffer.update(T),i.free(_),i.free(b),i.free(w),i.free(T)},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":264,"binary-search-bounds":94,"gl-buffer":253,"gl-shader":307,"iota-array":416,"typedarray-pool":547}],264:[function(t,e,r){"use strict";var n=t("glslify");e.exports={fragment:n(["precision lowp float;\n#define GLSLIFY 1\nvarying vec4 fragColor;\nvoid main() {\n gl_FragColor = vec4(fragColor.rgb * fragColor.a, fragColor.a);\n}\n"]),vertex:n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 color;\nattribute vec2 weight;\n\nuniform vec2 shape;\nuniform mat3 viewTransform;\n\nvarying vec4 fragColor;\n\nvoid main() {\n vec3 vPosition = viewTransform * vec3( position + (weight-.5)/(shape-1.) , 1.0);\n fragColor = color;\n gl_Position = vec4(vPosition.xy, 0, vPosition.z);\n}\n"]),pickFragment:n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragId;\nvarying vec2 vWeight;\n\nuniform vec2 shape;\nuniform vec4 pickOffset;\n\nvoid main() {\n vec2 d = step(.5, vWeight);\n vec4 id = fragId + pickOffset;\n id.x += d.x + d.y*shape.x;\n\n id.y += floor(id.x / 256.0);\n id.x -= floor(id.x / 256.0) * 256.0;\n\n id.z += floor(id.y / 256.0);\n id.y -= floor(id.y / 256.0) * 256.0;\n\n id.w += floor(id.z / 256.0);\n id.z -= floor(id.z / 256.0) * 256.0;\n\n gl_FragColor = id/255.;\n}\n"]),pickVertex:n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 pickId;\nattribute vec2 weight;\n\nuniform vec2 shape;\nuniform mat3 viewTransform;\n\nvarying vec4 fragId;\nvarying vec2 vWeight;\n\nvoid main() {\n vWeight = weight;\n\n fragId = pickId;\n\n vec3 vPosition = viewTransform * vec3( position + (weight-.5)/(shape-1.) , 1.0);\n gl_Position = vec4(vPosition.xy, 0, vPosition.z);\n}\n"])}},{glslify:408}],265:[function(t,e,r){var n=t("glslify"),a=t("gl-shader"),i=n(["precision highp 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\nvec4 project(vec3 p) {\n return projection * view * model * vec4(p, 1.0);\n}\n\nvoid main() {\n vec4 startPoint = project(position);\n vec4 endPoint = project(nextPosition);\n\n vec2 A = startPoint.xy / startPoint.w;\n vec2 B = endPoint.xy / endPoint.w;\n\n float clipAngle = atan(\n (B.y - A.y) * screenShape.y,\n (B.x - A.x) * screenShape.x\n );\n\n vec2 offset = 0.5 * pixelRatio * lineWidth * vec2(\n sin(clipAngle),\n -cos(clipAngle)\n ) / screenShape;\n\n gl_Position = vec4(startPoint.xy + startPoint.w * offset, startPoint.zw);\n\n worldPosition = position;\n pixelArcLength = arcLength;\n fragColor = color;\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n if(dashWeight < 0.5) {\n discard;\n }\n gl_FragColor = fragColor * opacity;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\nvec4 packFloat(float v) {\n 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 vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n float e = floor(log2(av));\n 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 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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\n}"]),l=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];r.createShader=function(t){return a(t,i,o,null,l)},r.createPickShader=function(t){return a(t,i,s,null,l)}},{"gl-shader":307,glslify:408}],266:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=h(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var o=f(e);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(e),l=a(e,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),u=c(new Array(1024),[256,1,4]),p=0;p<1024;++p)u.data[p]=255;var d=i(e,u);d.wrap=e.REPEAT;var g=new v(e,r,o,s,l,d);return g.update(t),g};var n=t("gl-buffer"),a=t("gl-vao"),i=t("gl-texture2d"),o=new Uint8Array(4),s=new Float32Array(o.buffer);var l=t("binary-search-bounds"),c=t("ndarray"),u=t("./lib/shaders"),h=u.createShader,f=u.createPickShader,p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function d(t,e){for(var r=0,n=0;n<3;++n){var a=t[n]-e[n];r+=a*a}return Math.sqrt(r)}function g(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function m(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function v(t,e,r,n,a,i){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=a,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=i,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var y=v.prototype;y.isTransparent=function(){return this.hasAlpha},y.isOpaque=function(){return!this.hasAlpha},y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.drawTransparent=y.draw=function(t){if(this.vertexCount){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,clipBounds:g(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},y.drawPick=function(t){if(this.vertexCount){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,pickId:this.pickId,clipBounds:g(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},y.update=function(t){var e,r;this.dirty=!0;var n=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),this.hasAlpha=!1,"opacity"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));var a=[],i=[],o=[],s=0,u=0,h=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],f=t.position||t.positions;if(f){var p=t.color||t.colors||[0,0,0,1],g=t.lineWidth||1,m=!1;t:for(e=1;e<f.length;++e){var v,y,x,b=f[e-1],_=f[e];for(i.push(s),o.push(b.slice()),r=0;r<3;++r){if(isNaN(b[r])||isNaN(_[r])||!isFinite(b[r])||!isFinite(_[r])){if(!n&&a.length>0){for(var w=0;w<24;++w)a.push(a[a.length-12]);u+=2,m=!0}continue t}h[0][r]=Math.min(h[0][r],b[r],_[r]),h[1][r]=Math.max(h[1][r],b[r],_[r])}Array.isArray(p[0])?(v=p.length>e-1?p[e-1]:p.length>0?p[p.length-1]:[0,0,0,1],y=p.length>e?p[e]:p.length>0?p[p.length-1]:[0,0,0,1]):v=y=p,3===v.length&&(v=[v[0],v[1],v[2],1]),3===y.length&&(y=[y[0],y[1],y[2],1]),!this.hasAlpha&&v[3]<1&&(this.hasAlpha=!0),x=Array.isArray(g)?g.length>e-1?g[e-1]:g.length>0?g[g.length-1]:[0,0,0,1]:g;var T=s;if(s+=d(b,_),m){for(r=0;r<2;++r)a.push(b[0],b[1],b[2],_[0],_[1],_[2],T,x,v[0],v[1],v[2],v[3]);u+=2,m=!1}a.push(b[0],b[1],b[2],_[0],_[1],_[2],T,x,v[0],v[1],v[2],v[3],b[0],b[1],b[2],_[0],_[1],_[2],T,-x,v[0],v[1],v[2],v[3],_[0],_[1],_[2],b[0],b[1],b[2],s,-x,y[0],y[1],y[2],y[3],_[0],_[1],_[2],b[0],b[1],b[2],s,x,y[0],y[1],y[2],y[3]),u+=4}}if(this.buffer.update(a),i.push(s),o.push(f[f.length-1].slice()),this.bounds=h,this.vertexCount=u,this.points=o,this.arcLength=i,"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=c(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&l.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=function(t,e,r,n){return o[0]=n,o[1]=r,o[2]=e,o[3]=t,s[0]}(t.value[0],t.value[1],t.value[2],0),r=l.le(this.arcLength,e);if(r<0)return null;if(r===this.arcLength.length-1)return new m(this.arcLength[this.arcLength.length-1],this.points[this.points.length-1].slice(),r);for(var n=this.points[r],a=this.points[Math.min(r+1,this.points.length-1)],i=(e-this.arcLength[r])/(this.arcLength[r+1]-this.arcLength[r]),c=1-i,u=[0,0,0],h=0;h<3;++h)u[h]=c*n[h]+i*a[h];var f=Math.min(i<.5?r:r+1,this.points.length-1);return new m(e,u,f,this.points[f])}},{"./lib/shaders":265,"binary-search-bounds":94,"gl-buffer":253,"gl-texture2d":322,"gl-vao":327,ndarray:448}],267:[function(t,e,r){e.exports=function(t){var e=new Float32Array(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},{}],268:[function(t,e,r){e.exports=function(){var t=new Float32Array(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],269:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],a=t[3],i=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],f=t[11],p=t[12],d=t[13],g=t[14],m=t[15];return(e*o-r*i)*(h*m-f*g)-(e*s-n*i)*(u*m-f*d)+(e*l-a*i)*(u*g-h*d)+(r*s-n*o)*(c*m-f*p)-(r*l-a*o)*(c*g-h*p)+(n*l-a*s)*(c*d-u*p)}},{}],270:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=r+r,s=n+n,l=a+a,c=r*o,u=n*o,h=n*s,f=a*o,p=a*s,d=a*l,g=i*o,m=i*s,v=i*l;return t[0]=1-h-d,t[1]=u+v,t[2]=f-m,t[3]=0,t[4]=u-v,t[5]=1-c-d,t[6]=p+g,t[7]=0,t[8]=f+m,t[9]=p-g,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],271:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=e[3],s=n+n,l=a+a,c=i+i,u=n*s,h=n*l,f=n*c,p=a*l,d=a*c,g=i*c,m=o*s,v=o*l,y=o*c;return t[0]=1-(p+g),t[1]=h+y,t[2]=f-v,t[3]=0,t[4]=h-y,t[5]=1-(u+g),t[6]=d+m,t[7]=0,t[8]=f+v,t[9]=d-m,t[10]=1-(u+p),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}},{}],272:[function(t,e,r){e.exports=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],273:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],f=e[10],p=e[11],d=e[12],g=e[13],m=e[14],v=e[15],y=r*s-n*o,x=r*l-a*o,b=r*c-i*o,_=n*l-a*s,w=n*c-i*s,T=a*c-i*l,k=u*g-h*d,A=u*m-f*d,M=u*v-p*d,S=h*m-f*g,E=h*v-p*g,C=f*v-p*m,L=y*C-x*E+b*S+_*M-w*A+T*k;if(!L)return null;return L=1/L,t[0]=(s*C-l*E+c*S)*L,t[1]=(a*E-n*C-i*S)*L,t[2]=(g*T-m*w+v*_)*L,t[3]=(f*w-h*T-p*_)*L,t[4]=(l*M-o*C-c*A)*L,t[5]=(r*C-a*M+i*A)*L,t[6]=(m*b-d*T-v*x)*L,t[7]=(u*T-f*b+p*x)*L,t[8]=(o*E-s*M+c*k)*L,t[9]=(n*M-r*E-i*k)*L,t[10]=(d*w-g*b+v*y)*L,t[11]=(h*b-u*w-p*y)*L,t[12]=(s*A-o*S-l*k)*L,t[13]=(r*S-n*A+a*k)*L,t[14]=(g*x-d*_-m*y)*L,t[15]=(u*_-h*x+f*y)*L,t}},{}],274:[function(t,e,r){var n=t("./identity");e.exports=function(t,e,r,a){var i,o,s,l,c,u,h,f,p,d,g=e[0],m=e[1],v=e[2],y=a[0],x=a[1],b=a[2],_=r[0],w=r[1],T=r[2];if(Math.abs(g-_)<1e-6&&Math.abs(m-w)<1e-6&&Math.abs(v-T)<1e-6)return n(t);h=g-_,f=m-w,p=v-T,d=1/Math.sqrt(h*h+f*f+p*p),i=x*(p*=d)-b*(f*=d),o=b*(h*=d)-y*p,s=y*f-x*h,(d=Math.sqrt(i*i+o*o+s*s))?(i*=d=1/d,o*=d,s*=d):(i=0,o=0,s=0);l=f*s-p*o,c=p*i-h*s,u=h*o-f*i,(d=Math.sqrt(l*l+c*c+u*u))?(l*=d=1/d,c*=d,u*=d):(l=0,c=0,u=0);return t[0]=i,t[1]=l,t[2]=h,t[3]=0,t[4]=o,t[5]=c,t[6]=f,t[7]=0,t[8]=s,t[9]=u,t[10]=p,t[11]=0,t[12]=-(i*g+o*m+s*v),t[13]=-(l*g+c*m+u*v),t[14]=-(h*g+f*m+p*v),t[15]=1,t}},{"./identity":272}],275:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],f=e[9],p=e[10],d=e[11],g=e[12],m=e[13],v=e[14],y=e[15],x=r[0],b=r[1],_=r[2],w=r[3];return t[0]=x*n+b*s+_*h+w*g,t[1]=x*a+b*l+_*f+w*m,t[2]=x*i+b*c+_*p+w*v,t[3]=x*o+b*u+_*d+w*y,x=r[4],b=r[5],_=r[6],w=r[7],t[4]=x*n+b*s+_*h+w*g,t[5]=x*a+b*l+_*f+w*m,t[6]=x*i+b*c+_*p+w*v,t[7]=x*o+b*u+_*d+w*y,x=r[8],b=r[9],_=r[10],w=r[11],t[8]=x*n+b*s+_*h+w*g,t[9]=x*a+b*l+_*f+w*m,t[10]=x*i+b*c+_*p+w*v,t[11]=x*o+b*u+_*d+w*y,x=r[12],b=r[13],_=r[14],w=r[15],t[12]=x*n+b*s+_*h+w*g,t[13]=x*a+b*l+_*f+w*m,t[14]=x*i+b*c+_*p+w*v,t[15]=x*o+b*u+_*d+w*y,t}},{}],276:[function(t,e,r){e.exports=function(t,e,r,n,a,i,o){var s=1/(e-r),l=1/(n-a),c=1/(i-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(a+n)*l,t[14]=(o+i)*c,t[15]=1,t}},{}],277:[function(t,e,r){e.exports=function(t,e,r,n,a){var i=1/Math.tan(e/2),o=1/(n-a);return t[0]=i/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(a+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*a*n*o,t[15]=0,t}},{}],278:[function(t,e,r){e.exports=function(t,e,r,n){var a,i,o,s,l,c,u,h,f,p,d,g,m,v,y,x,b,_,w,T,k,A,M,S,E=n[0],C=n[1],L=n[2],P=Math.sqrt(E*E+C*C+L*L);if(Math.abs(P)<1e-6)return null;E*=P=1/P,C*=P,L*=P,a=Math.sin(r),i=Math.cos(r),o=1-i,s=e[0],l=e[1],c=e[2],u=e[3],h=e[4],f=e[5],p=e[6],d=e[7],g=e[8],m=e[9],v=e[10],y=e[11],x=E*E*o+i,b=C*E*o+L*a,_=L*E*o-C*a,w=E*C*o-L*a,T=C*C*o+i,k=L*C*o+E*a,A=E*L*o+C*a,M=C*L*o-E*a,S=L*L*o+i,t[0]=s*x+h*b+g*_,t[1]=l*x+f*b+m*_,t[2]=c*x+p*b+v*_,t[3]=u*x+d*b+y*_,t[4]=s*w+h*T+g*k,t[5]=l*w+f*T+m*k,t[6]=c*w+p*T+v*k,t[7]=u*w+d*T+y*k,t[8]=s*A+h*M+g*S,t[9]=l*A+f*M+m*S,t[10]=c*A+p*M+v*S,t[11]=u*A+d*M+y*S,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t}},{}],279:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),a=Math.cos(r),i=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=e[9],h=e[10],f=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t[4]=i*a+c*n,t[5]=o*a+u*n,t[6]=s*a+h*n,t[7]=l*a+f*n,t[8]=c*a-i*n,t[9]=u*a-o*n,t[10]=h*a-s*n,t[11]=f*a-l*n,t}},{}],280:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),a=Math.cos(r),i=e[0],o=e[1],s=e[2],l=e[3],c=e[8],u=e[9],h=e[10],f=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t[0]=i*a-c*n,t[1]=o*a-u*n,t[2]=s*a-h*n,t[3]=l*a-f*n,t[8]=i*n+c*a,t[9]=o*n+u*a,t[10]=s*n+h*a,t[11]=l*n+f*a,t}},{}],281:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),a=Math.cos(r),i=e[0],o=e[1],s=e[2],l=e[3],c=e[4],u=e[5],h=e[6],f=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t[0]=i*a+c*n,t[1]=o*a+u*n,t[2]=s*a+h*n,t[3]=l*a+f*n,t[4]=c*a-i*n,t[5]=u*a-o*n,t[6]=h*a-s*n,t[7]=f*a-l*n,t}},{}],282:[function(t,e,r){e.exports=function(t,e,r){var n=r[0],a=r[1],i=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]*a,t[5]=e[5]*a,t[6]=e[6]*a,t[7]=e[7]*a,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},{}],283:[function(t,e,r){e.exports=function(t,e,r){var n,a,i,o,s,l,c,u,h,f,p,d,g=r[0],m=r[1],v=r[2];e===t?(t[12]=e[0]*g+e[4]*m+e[8]*v+e[12],t[13]=e[1]*g+e[5]*m+e[9]*v+e[13],t[14]=e[2]*g+e[6]*m+e[10]*v+e[14],t[15]=e[3]*g+e[7]*m+e[11]*v+e[15]):(n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],f=e[9],p=e[10],d=e[11],t[0]=n,t[1]=a,t[2]=i,t[3]=o,t[4]=s,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=f,t[10]=p,t[11]=d,t[12]=n*g+s*m+h*v+e[12],t[13]=a*g+l*m+f*v+e[13],t[14]=i*g+c*m+p*v+e[14],t[15]=o*g+u*m+d*v+e[15]);return t}},{}],284:[function(t,e,r){e.exports=function(t,e){if(t===e){var r=e[1],n=e[2],a=e[3],i=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]=i,t[11]=e[14],t[12]=a,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}},{}],285:[function(t,e,r){"use strict";var n=t("barycentric"),a=t("polytope-closest-point/lib/closest_point_2d.js");function i(t,e){for(var r=[0,0,0,0],n=0;n<4;++n)for(var a=0;a<4;++a)r[a]+=t[4*n+a]*e[n];return r}function o(t,e,r,n,a){for(var o=i(n,i(r,i(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 s(t,e){for(var r=[0,0,0],n=0;n<t.length;++n)for(var a=t[n],i=e[n],o=0;o<3;++o)r[o]+=i*a[o];return r}e.exports=function(t,e,r,i,l,c){if(1===t.length)return[0,t[0].slice()];for(var u=new Array(t.length),h=0;h<t.length;++h)u[h]=o(t[h],r,i,l,c);var f=0,p=1/0;for(h=0;h<u.length;++h){for(var d=0,g=0;g<2;++g)d+=Math.pow(u[h][g]-e[g],2);d<p&&(p=d,f=h)}var m=function(t,e){if(2===t.length){for(var r=0,i=0,o=0;o<2;++o)r+=Math.pow(e[o]-t[0][o],2),i+=Math.pow(e[o]-t[1][o],2);return r=Math.sqrt(r),i=Math.sqrt(i),r+i<1e-6?[1,0]:[i/(r+i),r/(i+r)]}if(3===t.length){var s=[0,0];return a(t[0],t[1],t[2],e,s),n(t,s)}return[]}(u,e),v=0;for(h=0;h<3;++h){if(m[h]<-.001||m[h]>1.0001)return null;v+=m[h]}if(Math.abs(v-1)>.001)return null;return[f,s(t,m),m]}},{barycentric:76,"polytope-closest-point/lib/closest_point_2d.js":479}],286:[function(t,e,r){var n=t("glslify"),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\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\nvec4 project(vec3 p) {\n return projection * view * model * vec4(p, 1.0);\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]),i=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\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 (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * 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 * f_color.a;\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_color = color;\n f_data = position;\n f_uv = uv;\n}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),u=n(["precision highp 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}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),f=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 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}"]),p=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n}"]),d=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);r.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:l,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:u,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:f,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:p,fragment:d,attributes:[{name:"position",type:"vec3"}]}},{glslify:408}],287:[function(t,e,r){"use strict";var n=t("gl-shader"),a=t("gl-buffer"),i=t("gl-vao"),o=t("gl-texture2d"),s=t("normals"),l=t("gl-mat4/multiply"),c=t("gl-mat4/invert"),u=t("ndarray"),h=t("colormap"),f=t("simplicial-complex-contour"),p=t("typedarray-pool"),d=t("./lib/shaders"),g=t("./lib/closest-point"),m=d.meshShader,v=d.wireShader,y=d.pointShader,x=d.pickShader,b=d.pointPickShader,_=d.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function T(t,e,r,n,a,i,o,s,l,c,u,h,f,p,d,g,m,v,y,x,b,_,T,k,A,M,S){this.gl=t,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=a,this.pickShader=i,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=u,this.triangleNormals=f,this.triangleUVs=h,this.triangleIds=c,this.triangleVAO=p,this.triangleCount=0,this.lineWidth=1,this.edgePositions=d,this.edgeColors=m,this.edgeUVs=v,this.edgeIds=g,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=T,this.pointSizes=k,this.pointIds=b,this.pointVAO=A,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=M,this.contourVAO=S,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!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.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var k=T.prototype;function A(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;r<e.length;++r){if(e.length<2)return 1;if(e[r][0]===t)return e[r][1];if(e[r][0]>t&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}function M(t){var e=n(t,m.vertex,m.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.normal.location=4,e}function S(t){var e=n(t,v.vertex,v.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e}function E(t){var e=n(t,y.vertex,y.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}function C(t){var e=n(t,x.vertex,x.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e}function L(t){var e=n(t,b.vertex,b.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function P(t){var e=n(t,_.vertex,_.fragment);return e.attributes.position.location=0,e}k.isOpaque=function(){return!this.hasAlpha},k.isTransparent=function(){return this.hasAlpha},k.pickSlots=1,k.setPickBase=function(t){this.pickId=t},k.highlight=function(t){if(t&&this.contourEnable){for(var e=f(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,a=e.vertexWeights,i=r.length,o=p.mallocFloat32(6*i),s=0,l=0;l<i;++l)for(var c=r[l],u=0;u<2;++u){var h=c[0];2===c.length&&(h=c[u]);for(var d=n[h][0],g=n[h][1],m=a[h],v=1-m,y=this.positions[d],x=this.positions[g],b=0;b<3;++b)o[s++]=m*y[b]+v*x[b]}this.contourCount=s/3|0,this.contourPositions.update(o.subarray(0,s)),p.free(o)}else this.contourCount=0},k.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,"contourEnable"in t&&(this.contourEnable=t.contourEnable),"contourColor"in t&&(this.contourColor=t.contourColor),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"lightPosition"in t&&(this.lightPosition=t.lightPosition),this.hasAlpha=!1,"opacity"in t&&(this.opacity=t.opacity,this.opacity<1&&(this.hasAlpha=!0)),"opacityscale"in t&&(this.opacityscale=t.opacityscale,this.hasAlpha=!0),"ambient"in t&&(this.ambientLight=t.ambient),"diffuse"in t&&(this.diffuseLight=t.diffuse),"specular"in t&&(this.specularLight=t.specular),"roughness"in t&&(this.roughness=t.roughness),"fresnel"in t&&(this.fresnel=t.fresnel),t.texture?(this.texture.dispose(),this.texture=o(e,t.texture)):t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(function(t,e){for(var r=h({colormap:t,nshades:256,format:"rgba"}),n=new Uint8Array(1024),a=0;a<256;++a){for(var i=r[a],o=0;o<3;++o)n[4*a+o]=i[o];n[4*a+3]=e?255*A(a/255,e):255*i[3]}return u(n,[256,256,4],[4,0,1])}(t.colormap,this.opacityscale)),this.texture.generateMipmap());var r=t.cells,n=t.positions;if(n&&r){var a=[],i=[],l=[],c=[],f=[],p=[],d=[],g=[],m=[],v=[],y=[],x=[],b=[],_=[];this.cells=r,this.positions=n;var w=t.vertexNormals,T=t.cellNormals,k=void 0===t.vertexNormalsEpsilon?1e-6:t.vertexNormalsEpsilon,M=void 0===t.faceNormalsEpsilon?1e-6:t.faceNormalsEpsilon;t.useFacetNormals&&!T&&(T=s.faceNormals(r,n,M)),T||w||(w=s.vertexNormals(r,n,k));var S=t.vertexColors,E=t.cellColors,C=t.meshColor||[1,1,1,1],L=t.vertexUVs,P=t.vertexIntensity,I=t.cellUVs,z=t.cellIntensity,O=1/0,D=-1/0;if(!L&&!I)if(P)if(t.vertexIntensityBounds)O=+t.vertexIntensityBounds[0],D=+t.vertexIntensityBounds[1];else for(var R=0;R<P.length;++R){var F=P[R];O=Math.min(O,F),D=Math.max(D,F)}else if(z)if(t.cellIntensityBounds)O=+t.cellIntensityBounds[0],D=+t.cellIntensityBounds[1];else for(R=0;R<z.length;++R){F=z[R];O=Math.min(O,F),D=Math.max(D,F)}else for(R=0;R<n.length;++R){F=n[R][2];O=Math.min(O,F),D=Math.max(D,F)}this.intensity=P||(z||function(t){for(var e=t.length,r=new Array(e),n=0;n<e;++n)r[n]=t[n][2];return r}(n)),this.pickVertex=!(z||E);var B=t.pointSizes,N=t.pointSize||1;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(R=0;R<n.length;++R)for(var j=n[R],V=0;V<3;++V)!isNaN(j[V])&&isFinite(j[V])&&(this.bounds[0][V]=Math.min(this.bounds[0][V],j[V]),this.bounds[1][V]=Math.max(this.bounds[1][V],j[V]));var U=0,q=0,H=0;t:for(R=0;R<r.length;++R){var G=r[R];switch(G.length){case 1:for(j=n[W=G[0]],V=0;V<3;++V)if(isNaN(j[V])||!isFinite(j[V]))continue t;v.push(j[0],j[1],j[2]),Z=S?S[W]:E?E[R]:C,this.opacityscale&&P?i.push(Z[0],Z[1],Z[2],this.opacity*A((P[W]-O)/(D-O),this.opacityscale)):3===Z.length?y.push(Z[0],Z[1],Z[2],this.opacity):(y.push(Z[0],Z[1],Z[2],Z[3]*this.opacity),Z[3]<1&&(this.hasAlpha=!0)),X=L?L[W]:P?[(P[W]-O)/(D-O),0]:I?I[R]:z?[(z[R]-O)/(D-O),0]:[(j[2]-O)/(D-O),0],x.push(X[0],X[1]),B?b.push(B[W]):b.push(N),_.push(R),H+=1;break;case 2:for(V=0;V<2;++V){j=n[W=G[V]];for(var Y=0;Y<3;++Y)if(isNaN(j[Y])||!isFinite(j[Y]))continue t}for(V=0;V<2;++V){j=n[W=G[V]];p.push(j[0],j[1],j[2]),Z=S?S[W]:E?E[R]:C,this.opacityscale&&P?i.push(Z[0],Z[1],Z[2],this.opacity*A((P[W]-O)/(D-O),this.opacityscale)):3===Z.length?d.push(Z[0],Z[1],Z[2],this.opacity):(d.push(Z[0],Z[1],Z[2],Z[3]*this.opacity),Z[3]<1&&(this.hasAlpha=!0)),X=L?L[W]:P?[(P[W]-O)/(D-O),0]:I?I[R]:z?[(z[R]-O)/(D-O),0]:[(j[2]-O)/(D-O),0],g.push(X[0],X[1]),m.push(R)}q+=1;break;case 3:for(V=0;V<3;++V)for(j=n[W=G[V]],Y=0;Y<3;++Y)if(isNaN(j[Y])||!isFinite(j[Y]))continue t;for(V=0;V<3;++V){var W,Z,X,J;j=n[W=G[2-V]];a.push(j[0],j[1],j[2]),(Z=S?S[W]:E?E[R]:C)?this.opacityscale&&P?i.push(Z[0],Z[1],Z[2],this.opacity*A((P[W]-O)/(D-O),this.opacityscale)):3===Z.length?i.push(Z[0],Z[1],Z[2],this.opacity):(i.push(Z[0],Z[1],Z[2],Z[3]*this.opacity),Z[3]<1&&(this.hasAlpha=!0)):i.push(.5,.5,.5,1),X=L?L[W]:P?[(P[W]-O)/(D-O),0]:I?I[R]:z?[(z[R]-O)/(D-O),0]:[(j[2]-O)/(D-O),0],c.push(X[0],X[1]),J=w?w[W]:T[R],l.push(J[0],J[1],J[2]),f.push(R)}U+=1}}this.pointCount=H,this.edgeCount=q,this.triangleCount=U,this.pointPositions.update(v),this.pointColors.update(y),this.pointUVs.update(x),this.pointSizes.update(b),this.pointIds.update(new Uint32Array(_)),this.edgePositions.update(p),this.edgeColors.update(d),this.edgeUVs.update(g),this.edgeIds.update(new Uint32Array(m)),this.trianglePositions.update(a),this.triangleColors.update(i),this.triangleUVs.update(c),this.triangleNormals.update(l),this.triangleIds.update(new Uint32Array(f))}},k.drawTransparent=k.draw=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,a=t.projection||w,i=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)i[0][o]=Math.max(i[0][o],this.clipBounds[0][o]),i[1][o]=Math.min(i[1][o],this.clipBounds[1][o]);var s={model:r,view:n,projection:a,inverseModel:w.slice(),clipBounds:i,kambient:this.ambientLight,kdiffuse:this.diffuseLight,kspecular:this.specularLight,roughness:this.roughness,fresnel:this.fresnel,eyePosition:[0,0,0],lightPosition:[0,0,0],contourColor:this.contourColor,texture:0};s.inverseModel=c(s.inverseModel,s.model),e.disable(e.CULL_FACE),this.texture.bind(0);var u=new Array(16);l(u,s.view,s.model),l(u,s.projection,u),c(u,u);for(o=0;o<3;++o)s.eyePosition[o]=u[12+o]/u[15];var h,f=u[15];for(o=0;o<3;++o)f+=this.lightPosition[o]*u[4*o+3];for(o=0;o<3;++o){for(var p=u[12+o],d=0;d<3;++d)p+=u[4*d+o]*this.lightPosition[d];s.lightPosition[o]=p/f}this.triangleCount>0&&((h=this.triShader).bind(),h.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind());this.edgeCount>0&&this.lineWidth>0&&((h=this.lineShader).bind(),h.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind());this.pointCount>0&&((h=this.pointShader).bind(),h.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind());this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((h=this.contourShader).bind(),h.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},k.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,a=t.projection||w,i=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)i[0][o]=Math.max(i[0][o],this.clipBounds[0][o]),i[1][o]=Math.min(i[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(a),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s,l={model:r,view:n,projection:a,clipBounds:i,pickId:this.pickId/255};((s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0)&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},k.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,a=new Array(r.length),i=0;i<r.length;++i)a[i]=n[r[i]];var o=t.coord[0],s=t.coord[1];if(!this.pickVertex){var l=this.positions[r[0]],c=this.positions[r[1]],u=this.positions[r[2]],h=[(l[0]+c[0]+u[0])/3,(l[1]+c[1]+u[1])/3,(l[2]+c[2]+u[2])/3];return{_cellCenter:!0,position:[o,s],index:e,cell:r,cellId:e,intensity:this.intensity[e],dataCoordinate:h}}var f=g(a,[o*this.pixelRatio,this._resolution[1]-s*this.pixelRatio],this._model,this._view,this._projection,this._resolution);if(!f)return null;var p=f[2],d=0;for(i=0;i<r.length;++i)d+=p[i]*this.intensity[r[i]];return{position:f[1],index:r[f[0]],cell:r,cellId:e,intensity:d,dataCoordinate:this.positions[r[f[0]]]}},k.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.lineShader.dispose(),this.pointShader.dispose(),this.pickShader.dispose(),this.pointPickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose(),this.contourShader.dispose()},e.exports=function(t,e){1===arguments.length&&(t=(e=t).gl);var r=t.getExtension("OES_standard_derivatives")||t.getExtension("MOZ_OES_standard_derivatives")||t.getExtension("WEBKIT_OES_standard_derivatives");if(!r)throw new Error("derivatives not supported");var n=M(t),s=S(t),l=E(t),c=C(t),h=L(t),f=P(t),p=o(t,u(new Uint8Array([255,255,255,255]),[1,1,4]));p.generateMipmap(),p.minFilter=t.LINEAR_MIPMAP_LINEAR,p.magFilter=t.LINEAR;var d=a(t),g=a(t),m=a(t),v=a(t),y=a(t),x=i(t,[{buffer:d,type:t.FLOAT,size:3},{buffer:y,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:g,type:t.FLOAT,size:4},{buffer:m,type:t.FLOAT,size:2},{buffer:v,type:t.FLOAT,size:3}]),b=a(t),_=a(t),w=a(t),k=a(t),A=i(t,[{buffer:b,type:t.FLOAT,size:3},{buffer:k,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:_,type:t.FLOAT,size:4},{buffer:w,type:t.FLOAT,size:2}]),I=a(t),z=a(t),O=a(t),D=a(t),R=a(t),F=i(t,[{buffer:I,type:t.FLOAT,size:3},{buffer:R,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:z,type:t.FLOAT,size:4},{buffer:O,type:t.FLOAT,size:2},{buffer:D,type:t.FLOAT,size:1}]),B=a(t),N=i(t,[{buffer:B,type:t.FLOAT,size:3}]),j=new T(t,p,n,s,l,c,h,f,d,y,g,m,v,x,b,k,_,w,A,I,R,z,O,D,F,B,N);return j.update(e),j}},{"./lib/closest-point":285,"./lib/shaders":286,colormap:128,"gl-buffer":253,"gl-mat4/invert":273,"gl-mat4/multiply":275,"gl-shader":307,"gl-texture2d":322,"gl-vao":327,ndarray:448,normals:451,"simplicial-complex-contour":508,"typedarray-pool":547}],288:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e,[0,0,0,1,1,0,1,1]),s=a(e,i.boxVert,i.lineFrag);return new o(t,r,s)};var n=t("gl-buffer"),a=t("gl-shader"),i=t("./shaders");function o(t,e,r){this.plot=t,this.vbo=e,this.shader=r}var s,l,c=o.prototype;c.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},c.drawBox=(s=[0,0],l=[0,0],function(t,e,r,n,a){var i=this.plot,o=this.shader,c=i.gl;s[0]=t,s[1]=e,l[0]=r,l[1]=n,o.uniforms.lo=s,o.uniforms.hi=l,o.uniforms.color=a,c.drawArrays(c.TRIANGLE_STRIP,0,4)}),c.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":291,"gl-buffer":253,"gl-shader":307}],289:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e),i=a(e,o.gridVert,o.gridFrag),l=a(e,o.tickVert,o.gridFrag);return new s(t,r,i,l)};var n=t("gl-buffer"),a=t("gl-shader"),i=t("binary-search-bounds"),o=t("./shaders");function s(t,e,r,n){this.plot=t,this.vbo=e,this.shader=r,this.tickShader=n,this.ticks=[[],[]]}function l(t,e){return t-e}var c,u,h,f,p,d=s.prototype;d.draw=(c=[0,0],u=[0,0],h=[0,0],function(){for(var t=this.plot,e=this.vbo,r=this.shader,n=this.ticks,a=t.gl,i=t._tickBounds,o=t.dataBox,s=t.viewBox,l=t.gridLineWidth,f=t.gridLineColor,p=t.gridLineEnable,d=t.pixelRatio,g=0;g<2;++g){var m=i[g],v=i[g+2]-m,y=.5*(o[g+2]+o[g]),x=o[g+2]-o[g];u[g]=2*v/x,c[g]=2*(m-y)/x}r.bind(),e.bind(),r.attributes.dataCoord.pointer(),r.uniforms.dataShift=c,r.uniforms.dataScale=u;var b=0;for(g=0;g<2;++g){h[0]=h[1]=0,h[g]=1,r.uniforms.dataAxis=h,r.uniforms.lineWidth=l[g]/(s[g+2]-s[g])*d,r.uniforms.color=f[g];var _=6*n[g].length;p[g]&&_&&a.drawArrays(a.TRIANGLES,b,_),b+=_}}),d.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,c=this.vbo,u=this.tickShader,h=this.ticks,f=s.gl,p=s._tickBounds,d=s.dataBox,g=s.viewBox,m=s.pixelRatio,v=s.screenBox,y=v[2]-v[0],x=v[3]-v[1],b=g[2]-g[0],_=g[3]-g[1],w=0;w<2;++w){var T=p[w],k=p[w+2]-T,A=.5*(d[w+2]+d[w]),M=d[w+2]-d[w];e[w]=2*k/M,t[w]=2*(T-A)/M}e[0]*=b/y,t[0]*=b/y,e[1]*=_/x,t[1]*=_/x,u.bind(),c.bind(),u.attributes.dataCoord.pointer();var S=u.uniforms;S.dataShift=t,S.dataScale=e;var E=s.tickMarkLength,C=s.tickMarkWidth,L=s.tickMarkColor,P=6*h[0].length,I=Math.min(i.ge(h[0],(d[0]-p[0])/(p[2]-p[0]),l),h[0].length),z=Math.min(i.gt(h[0],(d[2]-p[0])/(p[2]-p[0]),l),h[0].length),O=0+6*I,D=6*Math.max(0,z-I),R=Math.min(i.ge(h[1],(d[1]-p[1])/(p[3]-p[1]),l),h[1].length),F=Math.min(i.gt(h[1],(d[3]-p[1])/(p[3]-p[1]),l),h[1].length),B=P+6*R,N=6*Math.max(0,F-R);a[0]=2*(g[0]-E[1])/y-1,a[1]=(g[3]+g[1])/x-1,o[0]=E[1]*m/y,o[1]=C[1]*m/x,N&&(S.color=L[1],S.tickScale=o,S.dataAxis=n,S.screenOffset=a,f.drawArrays(f.TRIANGLES,B,N)),a[0]=(g[2]+g[0])/y-1,a[1]=2*(g[1]-E[0])/x-1,o[0]=C[0]*m/y,o[1]=E[0]*m/x,D&&(S.color=L[0],S.tickScale=o,S.dataAxis=r,S.screenOffset=a,f.drawArrays(f.TRIANGLES,O,D)),a[0]=2*(g[2]+E[3])/y-1,a[1]=(g[3]+g[1])/x-1,o[0]=E[3]*m/y,o[1]=C[3]*m/x,N&&(S.color=L[3],S.tickScale=o,S.dataAxis=n,S.screenOffset=a,f.drawArrays(f.TRIANGLES,B,N)),a[0]=(g[2]+g[0])/y-1,a[1]=2*(g[3]+E[2])/x-1,o[0]=C[2]*m/y,o[1]=E[2]*m/x,D&&(S.color=L[2],S.tickScale=o,S.dataAxis=r,S.screenOffset=a,f.drawArrays(f.TRIANGLES,O,D))}}(),d.update=(f=[1,1,-1,-1,1,-1],p=[1,-1,1,1,-1,-1],function(t){for(var e=t.ticks,r=t.bounds,n=new Float32Array(18*(e[0].length+e[1].length)),a=(this.plot.zeroLineEnable,0),i=[[],[]],o=0;o<2;++o)for(var s=i[o],l=e[o],c=r[o],u=r[o+2],h=0;h<l.length;++h){var d=(l[h].x-c)/(u-c);s.push(d);for(var g=0;g<6;++g)n[a++]=d,n[a++]=f[g],n[a++]=p[g]}this.ticks=i,this.vbo.update(n)}),d.dispose=function(){this.vbo.dispose(),this.shader.dispose(),this.tickShader.dispose()}},{"./shaders":291,"binary-search-bounds":94,"gl-buffer":253,"gl-shader":307}],290:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e,[-1,-1,-1,1,1,-1,1,1]),s=a(e,i.lineVert,i.lineFrag);return new o(t,r,s)};var n=t("gl-buffer"),a=t("gl-shader"),i=t("./shaders");function o(t,e,r){this.plot=t,this.vbo=e,this.shader=r}var s,l,c=o.prototype;c.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},c.drawLine=(s=[0,0],l=[0,0],function(t,e,r,n,a,i){var o=this.plot,c=this.shader,u=o.gl;s[0]=t,s[1]=e,l[0]=r,l[1]=n,c.uniforms.start=s,c.uniforms.end=l,c.uniforms.width=a*o.pixelRatio,c.uniforms.color=i,u.drawArrays(u.TRIANGLE_STRIP,0,4)}),c.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":291,"gl-buffer":253,"gl-shader":307}],291:[function(t,e,r){"use strict";var n=t("glslify"),a=n(["precision lowp float;\n#define GLSLIFY 1\nuniform vec4 color;\nvoid main() {\n gl_FragColor = vec4(color.xyz * color.w, color.w);\n}\n"]);e.exports={lineVert:n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 coord;\n\nuniform vec4 screenBox;\nuniform vec2 start, end;\nuniform float width;\n\nvec2 perp(vec2 v) {\n return vec2(v.y, -v.x);\n}\n\nvec2 screen(vec2 v) {\n return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\n}\n\nvoid main() {\n vec2 delta = normalize(perp(start - end));\n vec2 offset = mix(start, end, 0.5 * (coord.y+1.0));\n gl_Position = vec4(screen(offset + 0.5 * width * delta * coord.x), 0, 1);\n}\n"]),lineFrag:a,textVert:n(["#define GLSLIFY 1\nattribute vec3 textCoordinate;\n\nuniform vec2 dataScale, dataShift, dataAxis, screenOffset, textScale;\nuniform float angle;\n\nvoid main() {\n float dataOffset = textCoordinate.z;\n vec2 glyphOffset = textCoordinate.xy;\n mat2 glyphMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n vec2 screenCoordinate = dataAxis * (dataScale * dataOffset + dataShift) +\n glyphMatrix * glyphOffset * textScale + screenOffset;\n gl_Position = vec4(screenCoordinate, 0, 1);\n}\n"]),textFrag:a,gridVert:n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 dataCoord;\n\nuniform vec2 dataAxis, dataShift, dataScale;\nuniform float lineWidth;\n\nvoid main() {\n vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\n pos += 10.0 * dataCoord.y * vec2(dataAxis.y, -dataAxis.x) + dataCoord.z * lineWidth;\n gl_Position = vec4(pos, 0, 1);\n}\n"]),gridFrag:a,boxVert:n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 coord;\n\nuniform vec4 screenBox;\nuniform vec2 lo, hi;\n\nvec2 screen(vec2 v) {\n return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\n}\n\nvoid main() {\n gl_Position = vec4(screen(mix(lo, hi, coord)), 0, 1);\n}\n"]),tickVert:n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 dataCoord;\n\nuniform vec2 dataAxis, dataShift, dataScale, screenOffset, tickScale;\n\nvoid main() {\n vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\n gl_Position = vec4(pos + tickScale*dataCoord.yz + screenOffset, 0, 1);\n}\n"])}},{glslify:408}],292:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e),i=a(e,s.textVert,s.textFrag);return new l(t,r,i)};var n=t("gl-buffer"),a=t("gl-shader"),i=t("text-cache"),o=t("binary-search-bounds"),s=t("./shaders");function l(t,e,r){this.plot=t,this.vbo=e,this.shader=r,this.tickOffset=[[],[]],this.tickX=[[],[]],this.labelOffset=[0,0],this.labelCount=[0,0]}var c,u,h,f,p,d,g=l.prototype;g.drawTicks=(c=[0,0],u=[0,0],h=[0,0],function(t){var e=this.plot,r=this.shader,n=this.tickX[t],a=this.tickOffset[t],i=e.gl,s=e.viewBox,l=e.dataBox,f=e.screenBox,p=e.pixelRatio,d=e.tickEnable,g=e.tickPad,m=e.tickColor,v=e.tickAngle,y=e.labelEnable,x=e.labelPad,b=e.labelColor,_=e.labelAngle,w=this.labelOffset[t],T=this.labelCount[t],k=o.lt(n,l[t]),A=o.le(n,l[t+2]);c[0]=c[1]=0,c[t]=1,u[t]=(s[2+t]+s[t])/(f[2+t]-f[t])-1;var M=2/f[2+(1^t)]-f[1^t];u[1^t]=M*s[1^t]-1,d[t]&&(u[1^t]-=M*p*g[t],k<A&&a[A]>a[k]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=m[t],r.uniforms.angle=v[t],i.drawArrays(i.TRIANGLES,a[k],a[A]-a[k]))),y[t]&&T&&(u[1^t]-=M*p*x[t],r.uniforms.dataAxis=h,r.uniforms.screenOffset=u,r.uniforms.color=b[t],r.uniforms.angle=_[t],i.drawArrays(i.TRIANGLES,w,T)),u[1^t]=M*s[2+(1^t)]-1,d[t+2]&&(u[1^t]+=M*p*g[t+2],k<A&&a[A]>a[k]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=m[t+2],r.uniforms.angle=v[t+2],i.drawArrays(i.TRIANGLES,a[k],a[A]-a[k]))),y[t+2]&&T&&(u[1^t]+=M*p*x[t+2],r.uniforms.dataAxis=h,r.uniforms.screenOffset=u,r.uniforms.color=b[t+2],r.uniforms.angle=_[t+2],i.drawArrays(i.TRIANGLES,w,T))}),g.drawTitle=function(){var t=[0,0],e=[0,0];return function(){var r=this.plot,n=this.shader,a=r.gl,i=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,c=r.pixelRatio;if(this.titleCount){for(var u=0;u<2;++u)e[u]=2*(o[u]*c-i[u])/(i[2+u]-i[u])-1;n.bind(),n.uniforms.dataAxis=t,n.uniforms.screenOffset=e,n.uniforms.angle=s,n.uniforms.color=l,a.drawArrays(a.TRIANGLES,this.titleOffset,this.titleCount)}}}(),g.bind=(f=[0,0],p=[0,0],d=[0,0],function(){var t=this.plot,e=this.shader,r=t._tickBounds,n=t.dataBox,a=t.screenBox,i=t.viewBox;e.bind();for(var o=0;o<2;++o){var s=r[o],l=r[o+2]-s,c=.5*(n[o+2]+n[o]),u=n[o+2]-n[o],h=i[o],g=i[o+2]-h,m=a[o],v=a[o+2]-m;p[o]=2*l/u*g/v,f[o]=2*(s-c)/u*g/v}d[1]=2*t.pixelRatio/(a[3]-a[1]),d[0]=d[1]*(a[3]-a[1])/(a[2]-a[0]),e.uniforms.dataScale=p,e.uniforms.dataShift=f,e.uniforms.textScale=d,this.vbo.bind(),e.attributes.textCoordinate.pointer()}),g.update=function(t){var e,r,n,a,o,s=[],l=t.ticks,c=t.bounds;for(o=0;o<2;++o){var u=[Math.floor(s.length/3)],h=[-1/0],f=l[o];for(e=0;e<f.length;++e){var p=f[e],d=p.x,g=p.text,m=p.font||"sans-serif";a=p.fontSize||12;for(var v=1/(c[o+2]-c[o]),y=c[o],x=g.split("\n"),b=0;b<x.length;b++)for(n=i(m,x[b]).data,r=0;r<n.length;r+=2)s.push(n[r]*a,-n[r+1]*a-b*a*1.2,(d-y)*v);u.push(Math.floor(s.length/3)),h.push(d)}this.tickOffset[o]=u,this.tickX[o]=h}for(o=0;o<2;++o){for(this.labelOffset[o]=Math.floor(s.length/3),n=i(t.labelFont[o],t.labels[o],{textAlign:"center"}).data,a=t.labelSize[o],e=0;e<n.length;e+=2)s.push(n[e]*a,-n[e+1]*a,0);this.labelCount[o]=Math.floor(s.length/3)-this.labelOffset[o]}for(this.titleOffset=Math.floor(s.length/3),n=i(t.titleFont,t.title).data,a=t.titleSize,e=0;e<n.length;e+=2)s.push(n[e]*a,-n[e+1]*a,0);this.titleCount=Math.floor(s.length/3)-this.titleOffset,this.vbo.update(s)},g.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":291,"binary-search-bounds":94,"gl-buffer":253,"gl-shader":307,"text-cache":527}],293:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e,[e.drawingBufferWidth,e.drawingBufferHeight]),c=new l(e,r);return c.grid=a(c),c.text=i(c),c.line=o(c),c.box=s(c),c.update(t),c};var n=t("gl-select-static"),a=t("./lib/grid"),i=t("./lib/text"),o=t("./lib/line"),s=t("./lib/box");function l(t,e){this.gl=t,this.pickBuffer=e,this.screenBox=[0,0,t.drawingBufferWidth,t.drawingBufferHeight],this.viewBox=[0,0,0,0],this.dataBox=[-10,-10,10,10],this.gridLineEnable=[!0,!0],this.gridLineWidth=[1,1],this.gridLineColor=[[0,0,0,1],[0,0,0,1]],this.pixelRatio=1,this.tickMarkLength=[0,0,0,0],this.tickMarkWidth=[0,0,0,0],this.tickMarkColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[15,15,15,15],this.tickAngle=[0,0,0,0],this.tickEnable=[!0,!0,!0,!0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[15,15,15,15],this.labelAngle=[0,Math.PI/2,0,3*Math.PI/2],this.labelEnable=[!0,!0,!0,!0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.titleCenter=[0,0],this.titleEnable=!0,this.titleAngle=0,this.titleColor=[0,0,0,1],this.borderColor=[0,0,0,0],this.backgroundColor=[0,0,0,0],this.zeroLineEnable=[!0,!0],this.zeroLineWidth=[4,4],this.zeroLineColor=[[0,0,0,1],[0,0,0,1]],this.borderLineEnable=[!0,!0,!0,!0],this.borderLineWidth=[2,2,2,2],this.borderLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.grid=null,this.text=null,this.line=null,this.box=null,this.objects=[],this.overlays=[],this._tickBounds=[1/0,1/0,-1/0,-1/0],this.static=!1,this.dirty=!1,this.pickDirty=!1,this.pickDelay=120,this.pickRadius=10,this._pickTimeout=null,this._drawPick=this.drawPick.bind(this),this._depthCounter=0}var c=l.prototype;function u(t){for(var e=t.slice(),r=0;r<e.length;++r)e[r]=e[r].slice();return e}function h(t,e){return t.x-e.x}c.setDirty=function(){this.dirty=this.pickDirty=!0},c.setOverlayDirty=function(){this.dirty=!0},c.nextDepthValue=function(){return this._depthCounter++/65536},c.draw=function(){var t=this.gl,e=this.screenBox,r=this.viewBox,n=this.dataBox,a=this.pixelRatio,i=this.grid,o=this.line,s=this.text,l=this.objects;if(this._depthCounter=0,this.pickDirty&&(this._pickTimeout&&clearTimeout(this._pickTimeout),this.pickDirty=!1,this._pickTimeout=setTimeout(this._drawPick,this.pickDelay)),this.dirty){if(this.dirty=!1,t.bindFramebuffer(t.FRAMEBUFFER,null),t.enable(t.SCISSOR_TEST),t.disable(t.DEPTH_TEST),t.depthFunc(t.LESS),t.depthMask(!1),t.enable(t.BLEND),t.blendEquation(t.FUNC_ADD,t.FUNC_ADD),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),this.borderColor){t.scissor(e[0],e[1],e[2]-e[0],e[3]-e[1]);var c=this.borderColor;t.clearColor(c[0]*c[3],c[1]*c[3],c[2]*c[3],c[3]),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT)}t.scissor(r[0],r[1],r[2]-r[0],r[3]-r[1]),t.viewport(r[0],r[1],r[2]-r[0],r[3]-r[1]);var u=this.backgroundColor;t.clearColor(u[0]*u[3],u[1]*u[3],u[2]*u[3],u[3]),t.clear(t.COLOR_BUFFER_BIT),i.draw();var h=this.zeroLineEnable,f=this.zeroLineColor,p=this.zeroLineWidth;if(h[0]||h[1]){o.bind();for(var d=0;d<2;++d)if(h[d]&&n[d]<=0&&n[d+2]>=0){var g=e[d]-n[d]*(e[d+2]-e[d])/(n[d+2]-n[d]);0===d?o.drawLine(g,e[1],g,e[3],p[d],f[d]):o.drawLine(e[0],g,e[2],g,p[d],f[d])}}for(d=0;d<l.length;++d)l[d].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,v=this.borderLineWidth,y=this.borderLineColor;for(m[1]&&o.drawLine(r[0],r[1]-.5*v[1]*a,r[0],r[3]+.5*v[3]*a,v[1],y[1]),m[0]&&o.drawLine(r[0]-.5*v[0]*a,r[1],r[2]+.5*v[2]*a,r[1],v[0],y[0]),m[3]&&o.drawLine(r[2],r[1]-.5*v[1]*a,r[2],r[3]+.5*v[3]*a,v[3],y[3]),m[2]&&o.drawLine(r[0]-.5*v[0]*a,r[3],r[2]+.5*v[2]*a,r[3],v[2],y[2]),s.bind(),d=0;d<2;++d)s.drawTicks(d);this.titleEnable&&s.drawTitle();var x=this.overlays;for(d=0;d<x.length;++d)x[d].draw();t.disable(t.SCISSOR_TEST),t.disable(t.BLEND),t.depthMask(!0)}},c.drawPick=function(){if(!this.static){var t=this.pickBuffer;this.gl,this._pickTimeout=null,t.begin();for(var e=1,r=this.objects,n=0;n<r.length;++n)e=r[n].drawPick(e);t.end()}},c.pick=function(t,e){if(!this.static){var r=this.pixelRatio,n=this.pickPixelRatio,a=this.viewBox,i=0|Math.round((t-a[0]/r)*n),o=0|Math.round((e-a[1]/r)*n),s=this.pickBuffer.query(i,o,this.pickRadius);if(!s)return null;for(var l=s.id+(s.value[0]<<8)+(s.value[1]<<16)+(s.value[2]<<24),c=this.objects,u=0;u<c.length;++u){var h=c[u].pick(i,o,l);if(h)return h}return null}},c.setScreenBox=function(t){var e=this.screenBox,r=this.pixelRatio;e[0]=0|Math.round(t[0]*r),e[1]=0|Math.round(t[1]*r),e[2]=0|Math.round(t[2]*r),e[3]=0|Math.round(t[3]*r),this.setDirty()},c.setDataBox=function(t){var e=this.dataBox;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3])&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],this.setDirty())},c.setViewBox=function(t){var e=this.pixelRatio,r=this.viewBox;r[0]=0|Math.round(t[0]*e),r[1]=0|Math.round(t[1]*e),r[2]=0|Math.round(t[2]*e),r[3]=0|Math.round(t[3]*e);var n=this.pickPixelRatio;this.pickBuffer.shape=[0|Math.round((t[2]-t[0])*n),0|Math.round((t[3]-t[1])*n)],this.setDirty()},c.update=function(t){t=t||{};var e=this.gl;this.pixelRatio=t.pixelRatio||1;var r=this.pixelRatio;this.pickPixelRatio=Math.max(r,1),this.setScreenBox(t.screenBox||[0,0,e.drawingBufferWidth/r,e.drawingBufferHeight/r]);this.screenBox;this.setViewBox(t.viewBox||[.125*(this.screenBox[2]-this.screenBox[0])/r,.125*(this.screenBox[3]-this.screenBox[1])/r,.875*(this.screenBox[2]-this.screenBox[0])/r,.875*(this.screenBox[3]-this.screenBox[1])/r]);var n=this.viewBox,a=(n[2]-n[0])/(n[3]-n[1]);this.setDataBox(t.dataBox||[-10,-10/a,10,10/a]),this.borderColor=!1!==t.borderColor&&(t.borderColor||[0,0,0,0]).slice(),this.backgroundColor=(t.backgroundColor||[0,0,0,0]).slice(),this.gridLineEnable=(t.gridLineEnable||[!0,!0]).slice(),this.gridLineWidth=(t.gridLineWidth||[1,1]).slice(),this.gridLineColor=u(t.gridLineColor||[[.5,.5,.5,1],[.5,.5,.5,1]]),this.zeroLineEnable=(t.zeroLineEnable||[!0,!0]).slice(),this.zeroLineWidth=(t.zeroLineWidth||[4,4]).slice(),this.zeroLineColor=u(t.zeroLineColor||[[0,0,0,1],[0,0,0,1]]),this.tickMarkLength=(t.tickMarkLength||[0,0,0,0]).slice(),this.tickMarkWidth=(t.tickMarkWidth||[0,0,0,0]).slice(),this.tickMarkColor=u(t.tickMarkColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.titleCenter=(t.titleCenter||[.5*(n[0]+n[2])/r,(n[3]+120)/r]).slice(),this.titleEnable=!("titleEnable"in t)||!!t.titleEnable,this.titleAngle=t.titleAngle||0,this.titleColor=(t.titleColor||[0,0,0,1]).slice(),this.labelPad=(t.labelPad||[15,15,15,15]).slice(),this.labelAngle=(t.labelAngle||[0,Math.PI/2,0,3*Math.PI/2]).slice(),this.labelEnable=(t.labelEnable||[!0,!0,!0,!0]).slice(),this.labelColor=u(t.labelColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.tickPad=(t.tickPad||[15,15,15,15]).slice(),this.tickAngle=(t.tickAngle||[0,0,0,0]).slice(),this.tickEnable=(t.tickEnable||[!0,!0,!0,!0]).slice(),this.tickColor=u(t.tickColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.borderLineEnable=(t.borderLineEnable||[!0,!0,!0,!0]).slice(),this.borderLineWidth=(t.borderLineWidth||[2,2,2,2]).slice(),this.borderLineColor=u(t.borderLineColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);var i=t.ticks||[[],[]],o=this._tickBounds;o[0]=o[1]=1/0,o[2]=o[3]=-1/0;for(var s=0;s<2;++s){var l=i[s].slice(0);0!==l.length&&(l.sort(h),o[s]=Math.min(o[s],l[0].x),o[s+2]=Math.max(o[s+2],l[l.length-1].x))}this.grid.update({bounds:o,ticks:i}),this.text.update({bounds:o,ticks:i,labels:t.labels||["x","y"],labelSize:t.labelSize||[12,12],labelFont:t.labelFont||["sans-serif","sans-serif"],title:t.title||"",titleSize:t.titleSize||18,titleFont:t.titleFont||"sans-serif"}),this.static=!!t.static,this.setDirty()},c.dispose=function(){this.box.dispose(),this.grid.dispose(),this.text.dispose(),this.line.dispose();for(var t=this.objects.length-1;t>=0;--t)this.objects[t].dispose();this.objects.length=0;for(t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},c.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},c.removeObject=function(t){for(var e=this.objects,r=0;r<e.length;++r)if(e[r]===t){e.splice(r,1),this.setDirty();break}},c.addOverlay=function(t){this.overlays.indexOf(t)<0&&(this.overlays.push(t),this.setOverlayDirty())},c.removeOverlay=function(t){for(var e=this.overlays,r=0;r<e.length;++r)if(e[r]===t){e.splice(r,1),this.setOverlayDirty();break}}},{"./lib/box":288,"./lib/grid":289,"./lib/line":290,"./lib/text":292,"gl-select-static":306}],294:[function(t,e,r){"use strict";e.exports=function(t,e){t=t||document.body,e=e||{};var r=[.01,1/0];"distanceLimits"in e&&(r[0]=e.distanceLimits[0],r[1]=e.distanceLimits[1]);"zoomMin"in e&&(r[0]=e.zoomMin);"zoomMax"in e&&(r[1]=e.zoomMax);var c=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}),u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h=0,f=t.clientWidth,p=t.clientHeight,d={keyBindingMode:"rotate",enableWheel:!0,view:c,element:t,delay:e.delay||16,rotateSpeed:e.rotateSpeed||1,zoomSpeed:e.zoomSpeed||1,translateSpeed:e.translateSpeed||1,flipX:!!e.flipX,flipY:!!e.flipY,modes:c.modes,_ortho:e._ortho||e.projection&&"orthographic"===e.projection.type||!1,tick:function(){var e=n(),r=this.delay,a=e-2*r;c.idle(e-r),c.recalcMatrix(a),c.flush(e-(100+2*r));for(var i=!0,o=c.computedMatrix,s=0;s<16;++s)i=i&&u[s]===o[s],u[s]=o[s];var l=t.clientWidth===f&&t.clientHeight===p;return f=t.clientWidth,p=t.clientHeight,i?!l:(h=Math.exp(c.computedRadius[0]),!0)},lookAt:function(t,e,r){c.lookAt(c.lastT(),t,e,r)},rotate:function(t,e,r){c.rotate(c.lastT(),t,e,r)},pan:function(t,e,r){c.pan(c.lastT(),t,e,r)},translate:function(t,e,r){c.translate(c.lastT(),t,e,r)}};return Object.defineProperties(d,{matrix:{get:function(){return c.computedMatrix},set:function(t){return c.setMatrix(c.lastT(),t),c.computedMatrix},enumerable:!0},mode:{get:function(){return c.getMode()},set:function(t){var e=c.computedUp.slice(),r=c.computedEye.slice(),a=c.computedCenter.slice();if(c.setMode(t),"turntable"===t){var i=n();c._active.lookAt(i,r,a,e),c._active.lookAt(i+500,r,a,[0,0,1]),c._active.flush(i)}return c.getMode()},enumerable:!0},center:{get:function(){return c.computedCenter},set:function(t){return c.lookAt(c.lastT(),null,t),c.computedCenter},enumerable:!0},eye:{get:function(){return c.computedEye},set:function(t){return c.lookAt(c.lastT(),t),c.computedEye},enumerable:!0},up:{get:function(){return c.computedUp},set:function(t){return c.lookAt(c.lastT(),null,null,t),c.computedUp},enumerable:!0},distance:{get:function(){return h},set:function(t){return c.setDistance(c.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return c.getDistanceLimits(r)},set:function(t){return c.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),d._lastX=-1,d._lastY=-1,d._lastMods={shift:!1,control:!1,alt:!1,meta:!1},d.enableMouseListeners=function(){function e(e,r,a,i){var o=d.keyBindingMode;if(!1!==o){var s="rotate"===o,l="pan"===o,u="zoom"===o,f=!!i.control,p=!!i.alt,g=!!i.shift,m=!!(1&e),v=!!(2&e),y=!!(4&e),x=1/t.clientHeight,b=x*(r-d._lastX),_=x*(a-d._lastY),w=d.flipX?1:-1,T=d.flipY?1:-1,k=Math.PI*d.rotateSpeed,A=n();if(-1!==d._lastX&&-1!==d._lastY&&((s&&m&&!f&&!p&&!g||m&&!f&&!p&&g)&&c.rotate(A,w*k*b,-T*k*_,0),(l&&m&&!f&&!p&&!g||v||m&&f&&!p&&!g)&&c.pan(A,-d.translateSpeed*b*h,d.translateSpeed*_*h,0),u&&m&&!f&&!p&&!g||y||m&&!f&&p&&!g)){var M=-d.zoomSpeed*_/window.innerHeight*(A-c.lastT())*100;c.pan(A,0,0,h*(Math.exp(M)-1))}return d._lastX=r,d._lastY=a,d._lastMods=i,!0}}d.mouseListener=i(t,e),t.addEventListener("touchstart",(function(r){var n=s(r.changedTouches[0],t);e(0,n[0],n[1],d._lastMods),e(1,n[0],n[1],d._lastMods),r.preventDefault()}),!!l&&{passive:!1}),t.addEventListener("touchmove",(function(r){var n=s(r.changedTouches[0],t);e(1,n[0],n[1],d._lastMods),r.preventDefault()}),!!l&&{passive:!1}),t.addEventListener("touchend",(function(t){e(0,d._lastX,d._lastY,d._lastMods),t.preventDefault()}),!!l&&{passive:!1}),d.wheelListener=o(t,(function(t,e){if(!1!==d.keyBindingMode&&d.enableWheel){var r=d.flipX?1:-1,a=d.flipY?1:-1,i=n();if(Math.abs(t)>Math.abs(e))c.rotate(i,0,0,-t*r*Math.PI*d.rotateSpeed/window.innerWidth);else if(!d._ortho){var o=-d.zoomSpeed*a*e/window.innerHeight*(i-c.lastT())/20;c.pan(i,0,0,h*(Math.exp(o)-1))}}}),!0)},d.enableMouseListeners(),d};var n=t("right-now"),a=t("3d-view"),i=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset"),l=t("has-passive-events")},{"3d-view":54,"has-passive-events":410,"mouse-change":436,"mouse-event-offset":437,"mouse-wheel":439,"right-now":494}],295:[function(t,e,r){var n=t("glslify"),a=t("gl-shader"),i=n(["precision mediump float;\n#define GLSLIFY 1\nattribute vec2 position;\nvarying vec2 uv;\nvoid main() {\n uv = position;\n gl_Position = vec4(position, 0, 1);\n}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}"]);e.exports=function(t){return a(t,i,o,null,[{name:"position",type:"vec2"}])}},{"gl-shader":307,glslify:408}],296:[function(t,e,r){"use strict";var n=t("./camera.js"),a=t("gl-axes3d"),i=t("gl-axes3d/properties"),o=t("gl-spikes3d"),s=t("gl-select-static"),l=t("gl-fbo"),c=t("a-big-triangle"),u=t("mouse-change"),h=t("gl-mat4/perspective"),f=t("gl-mat4/ortho"),p=t("./lib/shader"),d=t("is-mobile")({tablet:!0,featureDetect:!0});function g(){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 m(t){var e=Math.round(Math.log(Math.abs(t))/Math.log(10));if(e<0){var r=Math.round(Math.pow(10,-e));return Math.ceil(t*r)/r}if(e>0){r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function v(t){return"boolean"!=typeof t||t}e.exports={createScene:function(t){(t=t||{}).camera=t.camera||{};var e=t.canvas;if(!e){if(e=document.createElement("canvas"),t.container)t.container.appendChild(e);else document.body.appendChild(e)}var r=t.gl;r||(t.glOptions&&(d=!!t.glOptions.preserveDrawingBuffer),r=function(t,e){var r=null;try{(r=t.getContext("webgl",e))||(r=t.getContext("experimental-webgl",e))}catch(t){return null}return r}(e,t.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:d}));if(!r)throw new Error("webgl not supported");var y=t.bounds||[[-10,-10,-10],[10,10,10]],x=new g,b=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!d}),_=p(r),w=t.cameraObject&&!0===t.cameraObject._ortho||t.camera.projection&&"orthographic"===t.camera.projection.type||!1,T={eye:t.camera.eye||[2,0,0],center:t.camera.center||[0,0,0],up:t.camera.up||[0,1,0],zoomMin:t.camera.zoomMax||.1,zoomMax:t.camera.zoomMin||100,mode:t.camera.mode||"turntable",_ortho:w},k=t.axes||{},A=a(r,k);A.enable=!k.disable;var M=t.spikes||{},S=o(r,M),E=[],C=[],L=[],P=[],I=!0,z=!0,O=new Array(16),D=new Array(16),R={view:null,projection:O,model:D,_ortho:!1},F=(z=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),B=t.cameraObject||n(e,T),N={gl:r,contextLost:!1,pixelRatio:t.pixelRatio||1,canvas:e,selection:x,camera:B,axes:A,axesPixels:null,spikes:S,bounds:y,objects:E,shape:F,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:v(t.autoResize),autoBounds:v(t.autoBounds),autoScale:!!t.autoScale,autoCenter:v(t.autoCenter),clipToBounds:v(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:R,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(t){this.aspect[0]=t.x,this.aspect[1]=t.y,this.aspect[2]=t.z,z=!0},setBounds:function(t,e){this.bounds[0][t]=e.min,this.bounds[1][t]=e.max},setClearColor:function(t){this.clearColor=t},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},j=[r.drawingBufferWidth/N.pixelRatio|0,r.drawingBufferHeight/N.pixelRatio|0];function V(){if(!N._stopped&&N.autoResize){var t=e.parentNode,r=1,n=1;t&&t!==document.body?(r=t.clientWidth,n=t.clientHeight):(r=window.innerWidth,n=window.innerHeight);var a=0|Math.ceil(r*N.pixelRatio),i=0|Math.ceil(n*N.pixelRatio);if(a!==e.width||i!==e.height){e.width=a,e.height=i;var o=e.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=n+"px",I=!0}}}N.autoResize&&V();function U(){for(var t=E.length,e=P.length,n=0;n<e;++n)L[n]=0;t:for(n=0;n<t;++n){var a=E[n],i=a.pickSlots;if(i){for(var o=0;o<e;++o)if(L[o]+i<255){C[n]=o,a.setPickBase(L[o]+1),L[o]+=i;continue t}var l=s(r,F);C[n]=e,P.push(l),L.push(i),a.setPickBase(1),e+=1}else C[n]=-1}for(;e>0&&0===L[e-1];)L.pop(),P.pop().dispose()}function q(){if(N.contextLost)return!0;r.isContextLost()&&(N.contextLost=!0,N.mouseListener.enabled=!1,N.selection.object=null,N.oncontextloss&&N.oncontextloss())}window.addEventListener("resize",V),N.update=function(t){N._stopped||(t=t||{},I=!0,z=!0)},N.add=function(t){N._stopped||(t.axes=A,E.push(t),C.push(-1),I=!0,z=!0,U())},N.remove=function(t){if(!N._stopped){var e=E.indexOf(t);e<0||(E.splice(e,1),C.pop(),I=!0,z=!0,U())}},N.dispose=function(){if(!N._stopped&&(N._stopped=!0,window.removeEventListener("resize",V),e.removeEventListener("webglcontextlost",q),N.mouseListener.enabled=!1,!N.contextLost)){A.dispose(),S.dispose();for(var t=0;t<E.length;++t)E[t].dispose();b.dispose();for(t=0;t<P.length;++t)P[t].dispose();_.dispose(),r=null,A=null,S=null,E=[]}},N._mouseRotating=!1,N._prevButtons=0,N.enableMouseListeners=function(){N.mouseListener=u(e,(function(t,e,r){if(!N._stopped){var n=P.length,a=E.length,i=x.object;x.distance=1/0,x.mouse[0]=e,x.mouse[1]=r,x.object=null,x.screen=null,x.dataCoordinate=x.dataPosition=null;var o=!1;if(t&&N._prevButtons)N._mouseRotating=!0;else{N._mouseRotating&&(z=!0),N._mouseRotating=!1;for(var s=0;s<n;++s){var l=P[s].query(e,j[1]-r-1,N.pickRadius);if(l){if(l.distance>x.distance)continue;for(var c=0;c<a;++c){var u=E[c];if(C[c]===s){var h=u.pick(l);h&&(x.buttons=t,x.screen=l.coord,x.distance=l.distance,x.object=u,x.index=h.distance,x.dataPosition=h.position,x.dataCoordinate=h.dataCoordinate,x.data=h,o=!0)}}}}}i&&i!==x.object&&(i.highlight&&i.highlight(null),I=!0),x.object&&(x.object.highlight&&x.object.highlight(x.data),I=!0),(o=o||x.object!==i)&&N.onselect&&N.onselect(x),1&t&&!(1&N._prevButtons)&&N.onclick&&N.onclick(x),N._prevButtons=t}}))},e.addEventListener("webglcontextlost",q);var H=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],G=[H[0].slice(),H[1].slice()];function Y(){if(!q()){V();var t=N.camera.tick();R.view=N.camera.matrix,I=I||t,z=z||t,A.pixelRatio=N.pixelRatio,S.pixelRatio=N.pixelRatio;var e=E.length,n=H[0],a=H[1];n[0]=n[1]=n[2]=1/0,a[0]=a[1]=a[2]=-1/0;for(var o=0;o<e;++o){(L=E[o]).pixelRatio=N.pixelRatio,L.axes=N.axes,I=I||!!L.dirty,z=z||!!L.dirty;var s=L.bounds;if(s)for(var l=s[0],u=s[1],p=0;p<3;++p)n[p]=Math.min(n[p],l[p]),a[p]=Math.max(a[p],u[p])}var d=N.bounds;if(N.autoBounds)for(p=0;p<3;++p){if(a[p]<n[p])n[p]=-1,a[p]=1;else{n[p]===a[p]&&(n[p]-=1,a[p]+=1);var g=.05*(a[p]-n[p]);n[p]=n[p]-g,a[p]=a[p]+g}d[0][p]=n[p],d[1][p]=a[p]}var v=!1;for(p=0;p<3;++p)v=v||G[0][p]!==d[0][p]||G[1][p]!==d[1][p],G[0][p]=d[0][p],G[1][p]=d[1][p];if(z=z||v,I=I||v){if(v){var y=[0,0,0];for(o=0;o<3;++o)y[o]=m((d[1][o]-d[0][o])/10);A.autoTicks?A.update({bounds:d,tickSpacing:y}):A.update({bounds:d})}var T=r.drawingBufferWidth,k=r.drawingBufferHeight;F[0]=T,F[1]=k,j[0]=0|Math.max(T/N.pixelRatio,1),j[1]=0|Math.max(k/N.pixelRatio,1),function(t,e){var r=t.bounds,n=t.cameraParams,a=n.projection,i=n.model,o=t.gl.drawingBufferWidth,s=t.gl.drawingBufferHeight,l=t.zNear,c=t.zFar,u=t.fovy,p=o/s;e?(f(a,-p,p,-1,1,l,c),n._ortho=!0):(h(a,u,p,l,c),n._ortho=!1);for(var d=0;d<16;++d)i[d]=0;i[15]=1;var g=0;for(d=0;d<3;++d)g=Math.max(g,r[1][d]-r[0][d]);for(d=0;d<3;++d)t.autoScale?i[5*d]=t.aspect[d]/(r[1][d]-r[0][d]):i[5*d]=1/g,t.autoCenter&&(i[12+d]=.5*-i[5*d]*(r[0][d]+r[1][d]))}(N,w);for(o=0;o<e;++o){(L=E[o]).axesBounds=d,N.clipToBounds&&(L.clipBounds=d)}x.object&&(N.snapToData?S.position=x.dataCoordinate:S.position=x.dataPosition,S.bounds=d),z&&(z=!1,function(){if(!q()){r.colorMask(!0,!0,!0,!0),r.depthMask(!0),r.disable(r.BLEND),r.enable(r.DEPTH_TEST),r.depthFunc(r.LEQUAL);for(var t=E.length,e=P.length,n=0;n<e;++n){var a=P[n];a.shape=j,a.begin();for(var i=0;i<t;++i)if(C[i]===n){var o=E[i];o.drawPick&&(o.pixelRatio=1,o.drawPick(R))}a.end()}}}()),N.axesPixels=i(N.axes,R,T,k),N.onrender&&N.onrender(),r.bindFramebuffer(r.FRAMEBUFFER,null),r.viewport(0,0,T,k),N.clearRGBA(),r.depthMask(!0),r.colorMask(!0,!0,!0,!0),r.enable(r.DEPTH_TEST),r.depthFunc(r.LEQUAL),r.disable(r.BLEND),r.disable(r.CULL_FACE);var M=!1;A.enable&&(M=M||A.isTransparent(),A.draw(R)),S.axes=A,x.object&&S.draw(R),r.disable(r.CULL_FACE);for(o=0;o<e;++o){(L=E[o]).axes=A,L.pixelRatio=N.pixelRatio,L.isOpaque&&L.isOpaque()&&L.draw(R),L.isTransparent&&L.isTransparent()&&(M=!0)}if(M){b.shape=F,b.bind(),r.clear(r.DEPTH_BUFFER_BIT),r.colorMask(!1,!1,!1,!1),r.depthMask(!0),r.depthFunc(r.LESS),A.enable&&A.isTransparent()&&A.drawTransparent(R);for(o=0;o<e;++o){(L=E[o]).isOpaque&&L.isOpaque()&&L.draw(R)}r.enable(r.BLEND),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA),r.colorMask(!0,!0,!0,!0),r.depthMask(!1),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),A.isTransparent()&&A.drawTransparent(R);for(o=0;o<e;++o){var L;(L=E[o]).isTransparent&&L.isTransparent()&&L.drawTransparent(R)}r.bindFramebuffer(r.FRAMEBUFFER,null),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA),r.disable(r.DEPTH_TEST),_.bind(),b.color[0].bind(0),_.uniforms.accumBuffer=0,c(r),r.disable(r.BLEND)}I=!1;for(o=0;o<e;++o)E[o].dirty=!1}}}return N.enableMouseListeners(),function t(){if(N._stopped||N.contextLost)return;Y(),requestAnimationFrame(t)}(),N.redraw=function(){N._stopped||(I=!0,Y())},N},createCamera:n}},{"./camera.js":294,"./lib/shader":295,"a-big-triangle":62,"gl-axes3d":245,"gl-axes3d/properties":252,"gl-fbo":261,"gl-mat4/ortho":276,"gl-mat4/perspective":277,"gl-select-static":306,"gl-spikes3d":316,"is-mobile":420,"mouse-change":436}],297:[function(t,e,r){var n=t("glslify");r.pointVertex=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\n\nuniform mat3 matrix;\nuniform float pointSize;\nuniform float pointCloud;\n\nhighp float rand(vec2 co) {\n highp float a = 12.9898;\n highp float b = 78.233;\n highp float c = 43758.5453;\n highp float d = dot(co.xy, vec2(a, b));\n highp float e = mod(d, 3.14);\n return fract(sin(e) * c);\n}\n\nvoid main() {\n vec3 hgPosition = matrix * vec3(position, 1);\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\n // if we don't jitter the point size a bit, overall point cloud\n // saturation 'jumps' on zooming, which is disturbing and confusing\n gl_PointSize = pointSize * ((19.5 + rand(position)) / 20.0);\n if(pointCloud != 0.0) { // pointCloud is truthy\n // get the same square surface as circle would be\n gl_PointSize *= 0.886;\n }\n}"]),r.pointFragment=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color, borderColor;\nuniform float centerFraction;\nuniform float pointCloud;\n\nvoid main() {\n float radius;\n vec4 baseColor;\n if(pointCloud != 0.0) { // pointCloud is truthy\n if(centerFraction == 1.0) {\n gl_FragColor = color;\n } else {\n gl_FragColor = mix(borderColor, color, centerFraction);\n }\n } else {\n radius = length(2.0 * gl_PointCoord.xy - 1.0);\n if(radius > 1.0) {\n discard;\n }\n baseColor = mix(borderColor, color, step(radius, centerFraction));\n gl_FragColor = vec4(baseColor.rgb * baseColor.a, baseColor.a);\n }\n}\n"]),r.pickVertex=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 pickId;\n\nuniform mat3 matrix;\nuniform float pointSize;\nuniform vec4 pickOffset;\n\nvarying vec4 fragId;\n\nvoid main() {\n vec3 hgPosition = matrix * vec3(position, 1);\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\n gl_PointSize = pointSize;\n\n vec4 id = pickId + pickOffset;\n id.y += floor(id.x / 256.0);\n id.x -= floor(id.x / 256.0) * 256.0;\n\n id.z += floor(id.y / 256.0);\n id.y -= floor(id.y / 256.0) * 256.0;\n\n id.w += floor(id.z / 256.0);\n id.z -= floor(id.z / 256.0) * 256.0;\n\n fragId = id;\n}\n"]),r.pickFragment=n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragId;\n\nvoid main() {\n float radius = length(2.0 * gl_PointCoord.xy - 1.0);\n if(radius > 1.0) {\n discard;\n }\n gl_FragColor = fragId / 255.0;\n}\n"])},{glslify:408}],298:[function(t,e,r){"use strict";var n=t("gl-shader"),a=t("gl-buffer"),i=t("typedarray-pool"),o=t("./lib/shader");function s(t,e,r,n,a){this.plot=t,this.offsetBuffer=e,this.pickBuffer=r,this.shader=n,this.pickShader=a,this.sizeMin=.5,this.sizeMinCap=2,this.sizeMax=20,this.areaRatio=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.blend=!1,this.pickOffset=0,this.points=null}e.exports=function(t,e){var r=t.gl,i=a(r),l=a(r),c=n(r,o.pointVertex,o.pointFragment),u=n(r,o.pickVertex,o.pickFragment),h=new s(t,i,l,c,u);return h.update(e),t.addObject(h),h};var l,c,u=s.prototype;u.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},u.update=function(t){var e;function r(e,r){return e in t?t[e]:r}t=t||{},this.sizeMin=r("sizeMin",.5),this.sizeMax=r("sizeMax",20),this.color=r("color",[1,0,0,1]).slice(),this.areaRatio=r("areaRatio",1),this.borderColor=r("borderColor",[0,0,0,1]).slice(),this.blend=r("blend",!1);var n=t.positions.length>>>1,a=t.positions instanceof Float32Array,o=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=a?s:i.mallocFloat32(s.length),c=o?t.idToIndex:i.mallocInt32(n);if(a||l.set(s),!o)for(l.set(s),e=0;e<n;e++)c[e]=e;this.points=s,this.offsetBuffer.update(l),this.pickBuffer.update(c),a||i.free(l),o||i.free(c),this.pointCount=n,this.pickOffset=0},u.unifiedDraw=(l=[1,0,0,0,1,0,0,0,1],c=[0,0,0,0],function(t){var e=void 0!==t,r=e?this.pickShader:this.shader,n=this.plot.gl,a=this.plot.dataBox;if(0===this.pointCount)return t;var i=a[2]-a[0],o=a[3]-a[1],s=function(t,e){var r,n=0,a=t.length>>>1;for(r=0;r<a;r++){var i=t[2*r],o=t[2*r+1];i>=e[0]&&i<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}(this.points,a),u=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(s,.33333)));l[0]=2/i,l[4]=2/o,l[6]=-2*a[0]/i-1,l[7]=-2*a[1]/o-1,this.offsetBuffer.bind(),r.bind(),r.attributes.position.pointer(),r.uniforms.matrix=l,r.uniforms.color=this.color,r.uniforms.borderColor=this.borderColor,r.uniforms.pointCloud=u<5,r.uniforms.pointSize=u,r.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),e&&(c[0]=255&t,c[1]=t>>8&255,c[2]=t>>16&255,c[3]=t>>24&255,this.pickBuffer.bind(),r.attributes.pickId.pointer(n.UNSIGNED_BYTE),r.uniforms.pickOffset=c,this.pickOffset=t);var h=n.getParameter(n.BLEND),f=n.getParameter(n.DITHER);return h&&!this.blend&&n.disable(n.BLEND),f&&n.disable(n.DITHER),n.drawArrays(n.POINTS,0,this.pointCount),h&&!this.blend&&n.enable(n.BLEND),f&&n.enable(n.DITHER),t+this.pointCount}),u.draw=u.unifiedDraw,u.drawPick=u.unifiedDraw,u.pick=function(t,e,r){var n=this.pickOffset,a=this.pointCount;if(r<n||r>=n+a)return null;var i=r-n,o=this.points;return{object:this,pointId:i,dataCoord:[o[2*i],o[2*i+1]]}}},{"./lib/shader":297,"gl-buffer":253,"gl-shader":307,"typedarray-pool":547}],299:[function(t,e,r){e.exports=function(t,e,r,n){var a,i,o,s,l,c=e[0],u=e[1],h=e[2],f=e[3],p=r[0],d=r[1],g=r[2],m=r[3];(i=c*p+u*d+h*g+f*m)<0&&(i=-i,p=-p,d=-d,g=-g,m=-m);1-i>1e-6?(a=Math.acos(i),o=Math.sin(a),s=Math.sin((1-n)*a)/o,l=Math.sin(n*a)/o):(s=1-n,l=n);return t[0]=s*c+l*p,t[1]=s*u+l*d,t[2]=s*h+l*g,t[3]=s*f+l*m,t}},{}],300:[function(t,e,r){"use strict";e.exports=function(t){return t||0===t?t.toString():""}},{}],301:[function(t,e,r){"use strict";var n=t("vectorize-text");e.exports=function(t,e,r){var i=a[e];i||(i=a[e]={});if(t in i)return i[t];var o={textAlign:"center",textBaseline:"middle",lineHeight:1,font:e,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},s=n(t,o);o.triangles=!1;var l,c,u=n(t,o);if(r&&1!==r){for(l=0;l<s.positions.length;++l)for(c=0;c<s.positions[l].length;++c)s.positions[l][c]/=r;for(l=0;l<u.positions.length;++l)for(c=0;c<u.positions[l].length;++c)u.positions[l][c]/=r}var h=[[1/0,1/0],[-1/0,-1/0]],f=u.positions.length;for(l=0;l<f;++l){var p=u.positions[l];for(c=0;c<2;++c)h[0][c]=Math.min(h[0][c],p[c]),h[1][c]=Math.max(h[1][c],p[c])}return i[t]=[s,u,h]};var a={}},{"vectorize-text":552}],302:[function(t,e,r){var n=t("gl-shader"),a=t("glslify"),i=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),c=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),u=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],h={vertex:i,fragment:l,attributes:u},f={vertex:o,fragment:l,attributes:u},p={vertex:s,fragment:l,attributes:u},d={vertex:i,fragment:c,attributes:u},g={vertex:o,fragment:c,attributes:u},m={vertex:s,fragment:c,attributes:u};function v(t,e){var r=n(t,e),a=r.attributes;return a.position.location=0,a.color.location=1,a.glyph.location=2,a.id.location=3,r}r.createPerspective=function(t){return v(t,h)},r.createOrtho=function(t){return v(t,f)},r.createProject=function(t){return v(t,p)},r.createPickPerspective=function(t){return v(t,d)},r.createPickOrtho=function(t){return v(t,g)},r.createPickProject=function(t){return v(t,m)}},{"gl-shader":307,glslify:408}],303:[function(t,e,r){"use strict";var n=t("is-string-blank"),a=t("gl-buffer"),i=t("gl-vao"),o=t("typedarray-pool"),s=t("gl-mat4/multiply"),l=t("./lib/shaders"),c=t("./lib/glyphs"),u=t("./lib/get-simple-string"),h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function f(t,e){var r=t[0],n=t[1],a=t[2],i=t[3];return t[0]=e[0]*r+e[4]*n+e[8]*a+e[12]*i,t[1]=e[1]*r+e[5]*n+e[9]*a+e[13]*i,t[2]=e[2]*r+e[6]*n+e[10]*a+e[14]*i,t[3]=e[3]*r+e[7]*n+e[11]*a+e[15]*i,t}function p(t,e,r,n){return f(n,n),f(n,n),f(n,n)}function d(t,e){this.index=t,this.dataCoordinate=this.position=e}function g(t){return!0===t||t>1?1:t}function m(t,e,r,n,a,i,o,s,l,c,u,h){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=a,this.colorBuffer=i,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=c,this.pickOrthoShader=u,this.pickProjectShader=h,this.points=[],this._selectResult=new d(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}e.exports=function(t){var e=t.gl,r=l.createPerspective(e),n=l.createOrtho(e),o=l.createProject(e),s=l.createPickPerspective(e),c=l.createPickOrtho(e),u=l.createPickProject(e),h=a(e),f=a(e),p=a(e),d=a(e),g=i(e,[{buffer:h,size:3,type:e.FLOAT},{buffer:f,size:4,type:e.FLOAT},{buffer:p,size:2,type:e.FLOAT},{buffer:d,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),v=new m(e,r,n,o,h,f,p,d,g,s,c,u);return v.update(t),v};var v=m.prototype;v.pickSlots=1,v.setPickBase=function(t){this.pickId=t},v.isTransparent=function(){if(this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectHasAlpha)return!0;return!1},v.isOpaque=function(){if(!this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&!this.projectHasAlpha)return!0;return!1};var y=[0,0],x=[0,0,0],b=[0,0,0],_=[0,0,0,1],w=[0,0,0,1],T=h.slice(),k=[0,0,0],A=[[0,0,0],[0,0,0]];function M(t){return t[0]=t[1]=t[2]=0,t}function S(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function E(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function C(t,e,r,n){var a,i=e.axesProject,o=e.gl,l=t.uniforms,c=r.model||h,u=r.view||h,f=r.projection||h,d=e.axesBounds,g=function(t){for(var e=A,r=0;r<2;++r)for(var n=0;n<3;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}(e.clipBounds);a=e.axes&&e.axes.lastCubeProps?e.axes.lastCubeProps.axis:[1,1,1],y[0]=2/o.drawingBufferWidth,y[1]=2/o.drawingBufferHeight,t.bind(),l.view=u,l.projection=f,l.screenSize=y,l.highlightId=e.highlightId,l.highlightScale=e.highlightScale,l.clipBounds=g,l.pickGroup=e.pickId/255,l.pixelRatio=n;for(var m=0;m<3;++m)if(i[m]){l.scale=e.projectScale[m],l.opacity=e.projectOpacity[m];for(var v=T,C=0;C<16;++C)v[C]=0;for(C=0;C<4;++C)v[5*C]=1;v[5*m]=0,a[m]<0?v[12+m]=d[0][m]:v[12+m]=d[1][m],s(v,c,v),l.model=v;var L=(m+1)%3,P=(m+2)%3,I=M(x),z=M(b);I[L]=1,z[P]=1;var O=p(0,0,0,S(_,I)),D=p(0,0,0,S(w,z));if(Math.abs(O[1])>Math.abs(D[1])){var R=O;O=D,D=R,R=I,I=z,z=R;var F=L;L=P,P=F}O[0]<0&&(I[L]=-1),D[1]>0&&(z[P]=-1);var B=0,N=0;for(C=0;C<4;++C)B+=Math.pow(c[4*L+C],2),N+=Math.pow(c[4*P+C],2);I[L]/=Math.sqrt(B),z[P]/=Math.sqrt(N),l.axes[0]=I,l.axes[1]=z,l.fragClipBounds[0]=E(k,g[0],m,-1e8),l.fragClipBounds[1]=E(k,g[1],m,1e8),e.vao.bind(),e.vao.draw(o.TRIANGLES,e.vertexCount),e.lineWidth>0&&(o.lineWidth(e.lineWidth*n),e.vao.draw(o.LINES,e.lineVertexCount,e.vertexCount)),e.vao.unbind()}}var L=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function P(t,e,r,n,a,i,o){var s=r.gl;if((i===r.projectHasAlpha||o)&&C(e,r,n,a),i===r.hasAlpha||o){t.bind();var l=t.uniforms;l.model=n.model||h,l.view=n.view||h,l.projection=n.projection||h,y[0]=2/s.drawingBufferWidth,y[1]=2/s.drawingBufferHeight,l.screenSize=y,l.highlightId=r.highlightId,l.highlightScale=r.highlightScale,l.fragClipBounds=L,l.clipBounds=r.axes.bounds,l.opacity=r.opacity,l.pickGroup=r.pickId/255,l.pixelRatio=a,r.vao.bind(),r.vao.draw(s.TRIANGLES,r.vertexCount),r.lineWidth>0&&(s.lineWidth(r.lineWidth*a),r.vao.draw(s.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function I(t,e,r,a){var i;i=Array.isArray(t)?e<t.length?t[e]:void 0:t,i=u(i);var o=!0;n(i)&&(i="\u25bc",o=!1);var s=c(i,r,a);return{mesh:s[0],lines:s[1],bounds:s[2],visible:o}}v.draw=function(t){P(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,this.pixelRatio,!1,!1)},v.drawTransparent=function(t){P(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,this.pixelRatio,!0,!1)},v.drawPick=function(t){P(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,1,!0,!0)},v.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 a=0;a<3;++a)n.position[a]=n.dataCoordinate[a]=r[a];return n},v.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,a=e>>16&255;this.highlightId=[r/255,n/255,a/255,0]}else this.highlightId=[1,1,1,1]},v.update=function(t){if("perspective"in(t=t||{})&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if(this.projectHasAlpha=!1,"projectOpacity"in t){if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{r=+t.projectOpacity;this.projectOpacity=[r,r,r]}for(var n=0;n<3;++n)this.projectOpacity[n]=g(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in t&&(this.opacity=g(t.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var a,i,s=t.position,l=t.font||"normal",c=t.alignment||[0,0];if(2===c.length)a=c[0],i=c[1];else{a=[],i=[];for(n=0;n<c.length;++n)a[n]=c[n][0],i[n]=c[n][1]}var u=[1/0,1/0,1/0],h=[-1/0,-1/0,-1/0],f=t.glyph,p=t.color,d=t.size,m=t.angle,v=t.lineColor,y=-1,x=0,b=0,_=0;if(s.length){_=s.length;t:for(n=0;n<_;++n){for(var w=s[n],T=0;T<3;++T)if(isNaN(w[T])||!isFinite(w[T]))continue t;var k=(N=I(f,n,l,this.pixelRatio)).mesh,A=N.lines,M=N.bounds;x+=3*k.cells.length,b+=2*A.edges.length}}var S=x+b,E=o.mallocFloat(3*S),C=o.mallocFloat(4*S),L=o.mallocFloat(2*S),P=o.mallocUint32(S);if(S>0){var z=0,O=x,D=[0,0,0,1],R=[0,0,0,1],F=Array.isArray(p)&&Array.isArray(p[0]),B=Array.isArray(v)&&Array.isArray(v[0]);t:for(n=0;n<_;++n){y+=1;for(w=s[n],T=0;T<3;++T){if(isNaN(w[T])||!isFinite(w[T]))continue t;h[T]=Math.max(h[T],w[T]),u[T]=Math.min(u[T],w[T])}k=(N=I(f,n,l,this.pixelRatio)).mesh,A=N.lines,M=N.bounds;var N,j=N.visible;if(j)if(Array.isArray(p)){if(3===(V=F?n<p.length?p[n]:[0,0,0,0]:p).length){for(T=0;T<3;++T)D[T]=V[T];D[3]=1}else if(4===V.length){for(T=0;T<4;++T)D[T]=V[T];!this.hasAlpha&&V[3]<1&&(this.hasAlpha=!0)}}else D[0]=D[1]=D[2]=0,D[3]=1;else D=[1,1,1,0];if(j)if(Array.isArray(v)){var V;if(3===(V=B?n<v.length?v[n]:[0,0,0,0]:v).length){for(T=0;T<3;++T)R[T]=V[T];R[T]=1}else if(4===V.length){for(T=0;T<4;++T)R[T]=V[T];!this.hasAlpha&&V[3]<1&&(this.hasAlpha=!0)}}else R[0]=R[1]=R[2]=0,R[3]=1;else R=[1,1,1,0];var U=.5;j?Array.isArray(d)?U=n<d.length?+d[n]:12:d?U=+d:this.useOrtho&&(U=12):U=0;var q=0;Array.isArray(m)?q=n<m.length?+m[n]:0:m&&(q=+m);var H=Math.cos(q),G=Math.sin(q);for(w=s[n],T=0;T<3;++T)h[T]=Math.max(h[T],w[T]),u[T]=Math.min(u[T],w[T]);var Y=a,W=i;Y=0;Array.isArray(a)?Y=n<a.length?a[n]:0:a&&(Y=a);W=0;Array.isArray(i)?W=n<i.length?i[n]:0:i&&(W=i);var Z=[Y*=Y>0?1-M[0][0]:Y<0?1+M[1][0]:1,W*=W>0?1-M[0][1]:W<0?1+M[1][1]:1],X=k.cells||[],J=k.positions||[];for(T=0;T<X.length;++T)for(var K=X[T],Q=0;Q<3;++Q){for(var $=0;$<3;++$)E[3*z+$]=w[$];for($=0;$<4;++$)C[4*z+$]=D[$];P[z]=y;var tt=J[K[Q]];L[2*z]=U*(H*tt[0]-G*tt[1]+Z[0]),L[2*z+1]=U*(G*tt[0]+H*tt[1]+Z[1]),z+=1}for(X=A.edges,J=A.positions,T=0;T<X.length;++T)for(K=X[T],Q=0;Q<2;++Q){for($=0;$<3;++$)E[3*O+$]=w[$];for($=0;$<4;++$)C[4*O+$]=R[$];P[O]=y;tt=J[K[Q]];L[2*O]=U*(H*tt[0]-G*tt[1]+Z[0]),L[2*O+1]=U*(G*tt[0]+H*tt[1]+Z[1]),O+=1}}}this.bounds=[u,h],this.points=s,this.pointCount=s.length,this.vertexCount=x,this.lineVertexCount=b,this.pointBuffer.update(E),this.colorBuffer.update(C),this.glyphBuffer.update(L),this.idBuffer.update(P),o.free(E),o.free(C),o.free(L),o.free(P)},v.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/get-simple-string":300,"./lib/glyphs":301,"./lib/shaders":302,"gl-buffer":253,"gl-mat4/multiply":275,"gl-vao":327,"is-string-blank":423,"typedarray-pool":547}],304:[function(t,e,r){"use strict";var n=t("glslify");r.boxVertex=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 vertex;\n\nuniform vec2 cornerA, cornerB;\n\nvoid main() {\n gl_Position = vec4(mix(cornerA, cornerB, vertex), 0, 1);\n}\n"]),r.boxFragment=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color;\n\nvoid main() {\n gl_FragColor = color;\n}\n"])},{glslify:408}],305:[function(t,e,r){"use strict";var n=t("gl-shader"),a=t("gl-buffer"),i=t("./lib/shaders");function o(t,e,r){this.plot=t,this.boxBuffer=e,this.boxShader=r,this.enabled=!0,this.selectBox=[1/0,1/0,-1/0,-1/0],this.borderColor=[0,0,0,1],this.innerFill=!1,this.innerColor=[0,0,0,.25],this.outerFill=!0,this.outerColor=[0,0,0,.5],this.borderWidth=10}e.exports=function(t,e){var r=t.gl,s=a(r,[0,0,0,1,1,0,1,1]),l=n(r,i.boxVertex,i.boxFragment),c=new o(t,s,l);return c.update(e),t.addOverlay(c),c};var s=o.prototype;s.draw=function(){if(this.enabled){var t=this.plot,e=this.selectBox,r=this.borderWidth,n=(this.innerFill,this.innerColor),a=(this.outerFill,this.outerColor),i=this.borderColor,o=t.box,s=t.screenBox,l=t.dataBox,c=t.viewBox,u=t.pixelRatio,h=(e[0]-l[0])*(c[2]-c[0])/(l[2]-l[0])+c[0],f=(e[1]-l[1])*(c[3]-c[1])/(l[3]-l[1])+c[1],p=(e[2]-l[0])*(c[2]-c[0])/(l[2]-l[0])+c[0],d=(e[3]-l[1])*(c[3]-c[1])/(l[3]-l[1])+c[1];if(h=Math.max(h,c[0]),f=Math.max(f,c[1]),p=Math.min(p,c[2]),d=Math.min(d,c[3]),!(p<h||d<f)){o.bind();var g=s[2]-s[0],m=s[3]-s[1];if(this.outerFill&&(o.drawBox(0,0,g,f,a),o.drawBox(0,f,h,d,a),o.drawBox(0,d,g,m,a),o.drawBox(p,f,g,d,a)),this.innerFill&&o.drawBox(h,f,p,d,n),r>0){var v=r*u;o.drawBox(h-v,f-v,p+v,f+v,i),o.drawBox(h-v,d-v,p+v,d+v,i),o.drawBox(h-v,f-v,h+v,d+v,i),o.drawBox(p-v,f-v,p+v,d+v,i)}}}},s.update=function(t){t=t||{},this.innerFill=!!t.innerFill,this.outerFill=!!t.outerFill,this.innerColor=(t.innerColor||[0,0,0,.5]).slice(),this.outerColor=(t.outerColor||[0,0,0,.5]).slice(),this.borderColor=(t.borderColor||[0,0,0,1]).slice(),this.borderWidth=t.borderWidth||0,this.selectBox=(t.selectBox||this.selectBox).slice()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":304,"gl-buffer":253,"gl-shader":307}],306:[function(t,e,r){"use strict";e.exports=function(t,e){var r=e[0],i=e[1],o=n(t,r,i,{}),s=a.mallocUint8(r*i*4);return new l(t,o,s)};var n=t("gl-fbo"),a=t("typedarray-pool"),i=t("ndarray"),o=t("bit-twiddle").nextPow2;function s(t,e,r,n,a){this.coord=[t,e],this.id=r,this.value=n,this.distance=a}function l(t,e,r){this.gl=t,this.fbo=e,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}var c=l.prototype;Object.defineProperty(c,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(t){if(this.gl){this.fbo.shape=t;var e=this.fbo.shape[0],r=this.fbo.shape[1];if(r*e*4>this.buffer.length){a.free(this.buffer);for(var n=this.buffer=a.mallocUint8(o(r*e*4)),i=0;i<r*e*4;++i)n[i]=255}return t}}}),c.begin=function(){var t=this.gl;this.shape;t&&(this.fbo.bind(),t.clearColor(1,1,1,1),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT))},c.end=function(){var t=this.gl;t&&(t.bindFramebuffer(t.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},c.query=function(t,e,r){if(!this.gl)return null;var n=this.fbo.shape.slice();t|=0,e|=0,"number"!=typeof r&&(r=1);var a=0|Math.min(Math.max(t-r,0),n[0]),o=0|Math.min(Math.max(t+r,0),n[0]),l=0|Math.min(Math.max(e-r,0),n[1]),c=0|Math.min(Math.max(e+r,0),n[1]);if(o<=a||c<=l)return null;var u=[o-a,c-l],h=i(this.buffer,[u[0],u[1],4],[4,4*n[0],1],4*(a+n[0]*l)),f=function(t,e,r){for(var n=1e8,a=-1,i=-1,o=t.shape[0],s=t.shape[1],l=0;l<o;l++)for(var c=0;c<s;c++){var u=t.get(l,c,0),h=t.get(l,c,1),f=t.get(l,c,2),p=t.get(l,c,3);if(u<255||h<255||f<255||p<255){var d=e-l,g=r-c,m=d*d+g*g;m<n&&(n=m,a=l,i=c)}}return[a,i,n]}(h.hi(u[0],u[1],1),r,r),p=f[0],d=f[1];return p<0||Math.pow(this.radius,2)<f[2]?null:new s(p+a|0,d+l|0,h.get(p,d,0),[h.get(p,d,1),h.get(p,d,2),h.get(p,d,3)],Math.sqrt(f[2]))},c.dispose=function(){this.gl&&(this.fbo.dispose(),a.free(this.buffer),this.gl=null,this._readTimeout&&clearTimeout(this._readTimeout))}},{"bit-twiddle":95,"gl-fbo":261,ndarray:448,"typedarray-pool":547}],307:[function(t,e,r){"use strict";var n=t("./lib/create-uniforms"),a=t("./lib/create-attributes"),i=t("./lib/reflect"),o=t("./lib/shader-cache"),s=t("./lib/runtime-reflect"),l=t("./lib/GLError");function c(t){this.gl=t,this.gl.lastAttribCount=0,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}var u=c.prototype;function h(t,e){return t.name<e.name?-1:1}u.bind=function(){var t;this.program||this._relink();var e=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES),r=this.gl.lastAttribCount;if(e>r)for(t=r;t<e;t++)this.gl.enableVertexAttribArray(t);else if(r>e)for(t=e;t<r;t++)this.gl.disableVertexAttribArray(t);this.gl.lastAttribCount=e,this.gl.useProgram(this.program)},u.dispose=function(){for(var t=this.gl.lastAttribCount,e=0;e<t;e++)this.gl.disableVertexAttribArray(e);this.gl.lastAttribCount=0,this._fref&&this._fref.dispose(),this._vref&&this._vref.dispose(),this.attributes=this.types=this.vertShader=this.fragShader=this.program=this._relink=this._fref=this._vref=null},u.update=function(t,e,r,c){if(!e||1===arguments.length){var u=t;t=u.vertex,e=u.fragment,r=u.uniforms,c=u.attributes}var f=this,p=f.gl,d=f._vref;f._vref=o.shader(p,p.VERTEX_SHADER,t),d&&d.dispose(),f.vertShader=f._vref.shader;var g=this._fref;if(f._fref=o.shader(p,p.FRAGMENT_SHADER,e),g&&g.dispose(),f.fragShader=f._fref.shader,!r||!c){var m=p.createProgram();if(p.attachShader(m,f.fragShader),p.attachShader(m,f.vertShader),p.linkProgram(m),!p.getProgramParameter(m,p.LINK_STATUS)){var v=p.getProgramInfoLog(m);throw new l(v,"Error linking program:"+v)}r=r||s.uniforms(p,m),c=c||s.attributes(p,m),p.deleteProgram(m)}(c=c.slice()).sort(h);var y,x=[],b=[],_=[];for(y=0;y<c.length;++y){var w=c[y];if(w.type.indexOf("mat")>=0){for(var T=0|w.type.charAt(w.type.length-1),k=new Array(T),A=0;A<T;++A)k[A]=_.length,b.push(w.name+"["+A+"]"),"number"==typeof w.location?_.push(w.location+A):Array.isArray(w.location)&&w.location.length===T&&"number"==typeof w.location[A]?_.push(0|w.location[A]):_.push(-1);x.push({name:w.name,type:w.type,locations:k})}else x.push({name:w.name,type:w.type,locations:[_.length]}),b.push(w.name),"number"==typeof w.location?_.push(0|w.location):_.push(-1)}var M=0;for(y=0;y<_.length;++y)if(_[y]<0){for(;_.indexOf(M)>=0;)M+=1;_[y]=M}var S=new Array(r.length);function E(){f.program=o.program(p,f._vref,f._fref,b,_);for(var t=0;t<r.length;++t)S[t]=p.getUniformLocation(f.program,r[t].name)}E(),f._relink=E,f.types={uniforms:i(r),attributes:i(c)},f.attributes=a(p,f,x,_),Object.defineProperty(f,"uniforms",n(p,f,r,S))},e.exports=function(t,e,r,n,a){var i=new c(t);return i.update(e,r,n,a),i}},{"./lib/GLError":308,"./lib/create-attributes":309,"./lib/create-uniforms":310,"./lib/reflect":311,"./lib/runtime-reflect":312,"./lib/shader-cache":313}],308:[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},{}],309:[function(t,e,r){"use strict";e.exports=function(t,e,r,a){for(var i={},l=0,c=r.length;l<c;++l){var u=r[l],h=u.name,f=u.type,p=u.locations;switch(f){case"bool":case"int":case"float":o(t,e,p[0],a,1,i,h);break;default:if(f.indexOf("vec")>=0){if((d=f.charCodeAt(f.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+h+": "+f);o(t,e,p[0],a,d,i,h)}else{if(!(f.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+h+": "+f);var d;if((d=f.charCodeAt(f.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+h+": "+f);s(t,e,p,a,d,i,h)}}}return i};var n=t("./GLError");function a(t,e,r,n,a,i){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=a,this._constFunc=i}var i=a.prototype;function o(t,e,r,n,i,o,s){for(var l=["gl","v"],c=[],u=0;u<i;++u)l.push("x"+u),c.push("x"+u);l.push("if(x0.length===void 0){return gl.vertexAttrib"+i+"f(v,"+c.join()+")}else{return gl.vertexAttrib"+i+"fv(v,x0)}");var h=Function.apply(null,l),f=new a(t,e,r,n,i,h);Object.defineProperty(o,s,{set:function(e){return t.disableVertexAttribArray(n[r]),h(t,n[r],e),e},get:function(){return f},enumerable:!0})}function s(t,e,r,n,a,i,s){for(var l=new Array(a),c=new Array(a),u=0;u<a;++u)o(t,e,r[u],n,a,l,u),c[u]=l[u];Object.defineProperty(l,"location",{set:function(t){if(Array.isArray(t))for(var e=0;e<a;++e)c[e].location=t[e];else for(e=0;e<a;++e)c[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 c=n[r[l]];t.vertexAttribPointer(c,a,e,i,o,s+l*a),t.enableVertexAttribArray(c)}};var h=new Array(a),f=t["vertexAttrib"+a+"fv"];Object.defineProperty(i,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})}i.pointer=function(t,e,r,n){var a=this._gl,i=this._locations[this._index];a.vertexAttribPointer(i,this._dimension,t||a.FLOAT,!!e,r||0,n||0),a.enableVertexAttribArray(i)},i.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(i,"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":308}],310:[function(t,e,r){"use strict";var n=t("./reflect"),a=t("./GLError");function i(t){return new Function("y","return function(){return y}")(t)}function o(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=e;return r}e.exports=function(t,e,r,s){function l(t,e,r){switch(r){case"bool":case"int":case"sampler2D":case"samplerCube":return"gl.uniform1i(locations["+e+"],obj"+t+")";case"float":return"gl.uniform1f(locations["+e+"],obj"+t+")";default:var n=r.indexOf("vec");if(!(0<=n&&n<=1&&r.length===4+n)){if(0===r.indexOf("mat")&&4===r.length){var i;if((i=r.charCodeAt(r.length-1)-48)<2||i>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+i+"fv(locations["+e+"],false,obj"+t+")"}throw new a("","Unknown uniform data type for "+name+": "+r)}if((i=r.charCodeAt(r.length-1)-48)<2||i>4)throw new a("","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 a("","Unrecognized data type for vector "+name+": "+r)}}}function c(e){for(var n=["return function updateProperty(obj){"],a=function t(e,r){if("object"!=typeof r)return[[e,r]];var n=[];for(var a in r){var i=r[a],o=e;parseInt(a)+""===a?o+="["+a+"]":o+="."+a,"object"==typeof i?n.push.apply(n,t(o,i)):n.push([o,i])}return n}("",e),i=0;i<a.length;++i){var o=a[i],c=o[0],u=o[1];s[u]&&n.push(l(c,u,r[u].type))}return n.push("return obj}"),new Function("gl","locations",n.join("\n"))(t,s)}function u(n,l,u){if("object"==typeof u){var f=h(u);Object.defineProperty(n,l,{get:i(f),set:c(u),enumerable:!0,configurable:!1})}else s[u]?Object.defineProperty(n,l,{get:(p=u,new Function("gl","wrapper","locations","return function(){return gl.getUniform(wrapper.program,locations["+p+"])}")(t,e,s)),set:c(u),enumerable:!0,configurable:!1}):n[l]=function(t){switch(t){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var e=t.indexOf("vec");if(0<=e&&e<=1&&t.length===4+e){if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new a("","Invalid data type");return"b"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r;if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+t);return o(r*r,0)}throw new a("","Unknown uniform data type for "+name+": "+t)}}(r[u].type);var p}function h(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r<t.length;++r)u(e,r,t[r])}else for(var n in e={},t)u(e,n,t[n]);return e}var f=n(r,!0);return{get:i(h(f)),set:c(f),enumerable:!0,configurable:!0}}},{"./GLError":308,"./reflect":311}],311:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r={},n=0;n<t.length;++n)for(var a=t[n].name.split("."),i=r,o=0;o<a.length;++o){var s=a[o].split("[");if(s.length>1){s[0]in i||(i[s[0]]=[]),i=i[s[0]];for(var l=1;l<s.length;++l){var c=parseInt(s[l]);l<s.length-1||o<a.length-1?(c in i||(l<s.length-1?i[c]=[]:i[c]={}),i=i[c]):i[c]=e?n:t[n].type}}else o<a.length-1?(s[0]in i||(i[s[0]]={}),i=i[s[0]]):i[s[0]]=e?n:t[n].type}return r}},{}],312:[function(t,e,r){"use strict";r.uniforms=function(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),n=[],a=0;a<r;++a){var o=t.getActiveUniform(e,a);if(o){var s=i(t,o.type);if(o.size>1)for(var l=0;l<o.size;++l)n.push({name:o.name.replace("[0]","["+l+"]"),type:s});else n.push({name:o.name,type:s})}}return n},r.attributes=function(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),n=[],a=0;a<r;++a){var o=t.getActiveAttrib(e,a);o&&n.push({name:o.name,type:i(t,o.type)})}return n};var n={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},a=null;function i(t,e){if(!a){var r=Object.keys(n);a={};for(var i=0;i<r.length;++i){var o=r[i];a[t[o]]=n[o]}}return a[e]}},{}],313:[function(t,e,r){"use strict";r.shader=function(t,e,r){return u(t).getShaderReference(e,r)},r.program=function(t,e,r,n,a){return u(t).getProgram(e,r,n,a)};var n=t("./GLError"),a=t("gl-format-compiler-error"),i=new("undefined"==typeof WeakMap?t("weakmap-shim"):WeakMap),o=0;function s(t,e,r,n,a,i,o){this.id=t,this.src=e,this.type=r,this.shader=n,this.count=i,this.programs=[],this.cache=o}function l(t){this.gl=t,this.shaders=[{},{}],this.programs={}}s.prototype.dispose=function(){if(0==--this.count){for(var t=this.cache,e=t.gl,r=this.programs,n=0,a=r.length;n<a;++n){var i=t.programs[r[n]];i&&(delete t.programs[n],e.deleteProgram(i))}e.deleteShader(this.shader),delete t.shaders[this.type===e.FRAGMENT_SHADER|0][this.src]}};var c=l.prototype;function u(t){var e=i.get(t);return e||(e=new l(t),i.set(t,e)),e}c.getShaderReference=function(t,e){var r=this.gl,i=this.shaders[t===r.FRAGMENT_SHADER|0],l=i[e];if(l&&r.isShader(l.shader))l.count+=1;else{var c=function(t,e,r){var i=t.createShader(e);if(t.shaderSource(i,r),t.compileShader(i),!t.getShaderParameter(i,t.COMPILE_STATUS)){var o=t.getShaderInfoLog(i);try{var s=a(o,r,e)}catch(t){throw console.warn("Failed to format compiler error: "+t),new n(o,"Error compiling shader:\n"+o)}throw new n(o,s.short,s.long)}return i}(r,t,e);l=i[e]=new s(o++,e,t,c,[],1,this)}return l},c.getProgram=function(t,e,r,a){var i=[t.id,e.id,r.join(":"),a.join(":")].join("@"),o=this.programs[i];return o&&this.gl.isProgram(o)||(this.programs[i]=o=function(t,e,r,a,i){var o=t.createProgram();t.attachShader(o,e),t.attachShader(o,r);for(var s=0;s<a.length;++s)t.bindAttribLocation(o,i[s],a[s]);if(t.linkProgram(o),!t.getProgramParameter(o,t.LINK_STATUS)){var l=t.getProgramInfoLog(o);throw new n(l,"Error linking program: "+l)}return o}(this.gl,t.shader,e.shader,r,a),t.programs.push(i),e.programs.push(i)),o}},{"./GLError":308,"gl-format-compiler-error":262,"weakmap-shim":557}],314:[function(t,e,r){"use strict";function n(t){this.plot=t,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}e.exports=function(t,e){var r=new n(t);return r.update(e),t.addOverlay(r),r};var 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,a=this.plot,i=a.line,o=a.dataBox,s=a.viewBox;if(i.bind(),o[0]<=n[0]&&n[0]<=o[2]&&o[1]<=n[1]&&n[1]<=o[3]){var l=s[0]+(n[0]-o[0])/(o[2]-o[0])*(s[2]-s[0]),c=s[1]+(n[1]-o[1])/(o[3]-o[1])*(s[3]-s[1]);t[0]&&i.drawLine(l,c,s[0],c,e[0],r[0]),t[1]&&i.drawLine(l,c,l,s[1],e[1],r[1]),t[2]&&i.drawLine(l,c,s[2],c,e[2],r[2]),t[3]&&i.drawLine(l,c,l,s[3],e[3],r[3])}},a.dispose=function(){this.plot.removeOverlay(this)}},{}],315:[function(t,e,r){"use strict";var n=t("glslify"),a=t("gl-shader"),i=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, color;\nattribute float weight;\n\nuniform mat4 model, view, projection;\nuniform vec3 coordinates[3];\nuniform vec4 colors[3];\nuniform vec2 screenShape;\nuniform float lineWidth;\n\nvarying vec4 fragColor;\n\nvoid main() {\n vec3 vertexPosition = mix(coordinates[0],\n mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\n\n vec4 clipPos = projection * view * model * vec4(vertexPosition, 1.0);\n vec2 clipOffset = (projection * view * model * vec4(color, 0.0)).xy;\n vec2 delta = weight * clipOffset * screenShape;\n vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\n\n gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\n fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\n}\n"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}"]);e.exports=function(t){return a(t,i,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},{"gl-shader":307,glslify:408}],316:[function(t,e,r){"use strict";var n=t("gl-buffer"),a=t("gl-vao"),i=t("./shaders/index");e.exports=function(t,e){var r=[];function o(t,e,n,a,i,o){var s=[t,e,n,0,0,0,1];s[a+3]=1,s[a]=i,r.push.apply(r,s),s[6]=-1,r.push.apply(r,s),s[a]=o,r.push.apply(r,s),r.push.apply(r,s),s[6]=1,r.push.apply(r,s),s[a]=i,r.push.apply(r,s)}o(0,0,0,0,0,1),o(0,0,0,1,0,1),o(0,0,0,2,0,1),o(1,0,0,1,-1,1),o(1,0,0,2,-1,1),o(0,1,0,0,-1,1),o(0,1,0,2,-1,1),o(0,0,1,0,-1,1),o(0,0,1,1,-1,1);var l=n(t,r),c=a(t,[{type:t.FLOAT,buffer:l,size:3,offset:0,stride:28},{type:t.FLOAT,buffer:l,size:3,offset:12,stride:28},{type:t.FLOAT,buffer:l,size:1,offset:24,stride:28}]),u=i(t);u.attributes.position.location=0,u.attributes.color.location=1,u.attributes.weight.location=2;var h=new s(t,l,c,u);return h.update(e),h};var o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}var l=s.prototype,c=[0,0,0],u=[0,0,0],h=[0,0];l.isTransparent=function(){return!1},l.drawTransparent=function(t){},l.draw=function(t){var e=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var a,i=t.model||o,s=t.view||o,l=t.projection||o;this.axes&&(a=this.axes.lastCubeProps.axis);for(var f=c,p=u,d=0;d<3;++d)a&&a[d]<0?(f[d]=this.bounds[0][d],p[d]=this.bounds[1][d]):(f[d]=this.bounds[1][d],p[d]=this.bounds[0][d]);h[0]=e.drawingBufferWidth,h[1]=e.drawingBufferHeight,n.uniforms.model=i,n.uniforms.view=s,n.uniforms.projection=l,n.uniforms.coordinates=[this.position,f,p],n.uniforms.colors=this.colors,n.uniforms.screenShape=h;for(d=0;d<3;++d)n.uniforms.lineWidth=this.lineWidth[d]*this.pixelRatio,this.enabled[d]&&(r.draw(e.TRIANGLES,6,6*d),this.drawSides[d]&&r.draw(e.TRIANGLES,12,18+12*d));r.unbind()},l.update=function(t){t&&("bounds"in t&&(this.bounds=t.bounds),"position"in t&&(this.position=t.position),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"colors"in t&&(this.colors=t.colors),"enabled"in t&&(this.enabled=t.enabled),"drawSides"in t&&(this.drawSides=t.drawSides))},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders/index":315,"gl-buffer":253,"gl-vao":327}],317:[function(t,e,r){var n=t("glslify"),a=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),i=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * view * tubePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},{glslify:408}],318:[function(t,e,r){"use strict";var n=t("gl-vec3"),a=t("gl-vec4"),i=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(t,e,r,i){for(var o=0,s=0;s<t.length;s++)for(var l=t[s].velocities,c=0;c<l.length;c++)o=Math.max(o,n.length(l[c]));var u=t.map((function(t){return function(t,e,r,i){for(var o=t.points,s=t.velocities,l=t.divergences,c=[],u=[],h=[],f=[],p=[],d=[],g=0,m=0,v=a.create(),y=a.create(),x=0;x<o.length;x++){var b=o[x],_=s[x],w=l[x];0===e&&(w=.05*r),m=n.length(_)/i,v=a.create(),n.copy(v,_),v[3]=w;for(var T=0;T<8;T++)p[T]=[b[0],b[1],b[2],T];if(f.length>0)for(T=0;T<8;T++){var k=(T+1)%8;c.push(f[T],p[T],p[k],p[k],f[k],f[T]),h.push(y,v,v,v,y,y),d.push(g,m,m,m,g,g);var A=c.length;u.push([A-6,A-5,A-4],[A-3,A-2,A-1])}var M=f;f=p,p=M;var S=y;y=v,v=S;var E=g;g=m,m=E}return{positions:c,cells:u,vectors:h,vertexIntensity:d}}(t,r,i,o)})),h=[],f=[],p=[],d=[];for(s=0;s<u.length;s++){var g=u[s],m=h.length;h=h.concat(g.positions),p=p.concat(g.vectors),d=d.concat(g.vertexIntensity);for(c=0;c<g.cells.length;c++){var v=g.cells[c],y=[];f.push(y);for(var x=0;x<v.length;x++)y.push(v[x]+m)}}return{positions:h,cells:f,vectors:p,vertexIntensity:d,colormap:e}},s=function(t,e){var r,n=t.length;for(r=0;r<n;r++){var a=t[r];if(a===e)return r;if(a>e)return r-1}return r},l=function(t,e,r){return t<e?e:t>r?r:t},c=function(t){var e=1/0;t.sort((function(t,e){return t-e}));for(var r=t.length,n=1;n<r;n++){var a=Math.abs(t[n]-t[n-1]);a<e&&(e=a)}return e};e.exports=function(t,e){var r=t.startingPositions,a=t.maxLength||1e3,u=t.tubeSize||1,h=t.absoluteTubeSize,f=t.gridFill||"+x+y+z",p={};-1!==f.indexOf("-x")&&(p.reversedX=!0),-1!==f.indexOf("-y")&&(p.reversedY=!0),-1!==f.indexOf("-z")&&(p.reversedZ=!0),p.filled=i.indexOf(f.replace(/-/g,"").replace(/\+/g,""));var d=t.getVelocity||function(e){return function(t,e,r){var a=e.vectors,i=e.meshgrid,o=t[0],c=t[1],u=t[2],h=i[0].length,f=i[1].length,p=i[2].length,d=s(i[0],o),g=s(i[1],c),m=s(i[2],u),v=d+1,y=g+1,x=m+1;if(d=l(d,0,h-1),v=l(v,0,h-1),g=l(g,0,f-1),y=l(y,0,f-1),m=l(m,0,p-1),x=l(x,0,p-1),d<0||g<0||m<0||v>h-1||y>f-1||x>p-1)return n.create();var b,_,w,T,k,A,M=i[0][d],S=i[0][v],E=i[1][g],C=i[1][y],L=i[2][m],P=(o-M)/(S-M),I=(c-E)/(C-E),z=(u-L)/(i[2][x]-L);switch(isFinite(P)||(P=.5),isFinite(I)||(I=.5),isFinite(z)||(z=.5),r.reversedX&&(d=h-1-d,v=h-1-v),r.reversedY&&(g=f-1-g,y=f-1-y),r.reversedZ&&(m=p-1-m,x=p-1-x),r.filled){case 5:k=m,A=x,w=g*p,T=y*p,b=d*p*f,_=v*p*f;break;case 4:k=m,A=x,b=d*p,_=v*p,w=g*p*h,T=y*p*h;break;case 3:w=g,T=y,k=m*f,A=x*f,b=d*f*p,_=v*f*p;break;case 2:w=g,T=y,b=d*f,_=v*f,k=m*f*h,A=x*f*h;break;case 1:b=d,_=v,k=m*h,A=x*h,w=g*h*p,T=y*h*p;break;default:b=d,_=v,w=g*h,T=y*h,k=m*h*f,A=x*h*f}var O=a[b+w+k],D=a[b+w+A],R=a[b+T+k],F=a[b+T+A],B=a[_+w+k],N=a[_+w+A],j=a[_+T+k],V=a[_+T+A],U=n.create(),q=n.create(),H=n.create(),G=n.create();n.lerp(U,O,B,P),n.lerp(q,D,N,P),n.lerp(H,R,j,P),n.lerp(G,F,V,P);var Y=n.create(),W=n.create();n.lerp(Y,U,H,I),n.lerp(W,q,G,I);var Z=n.create();return n.lerp(Z,Y,W,z),Z}(e,t,p)},g=t.getDivergence||function(t,e){var r=n.create(),a=1e-4;n.add(r,t,[a,0,0]);var i=d(r);n.subtract(i,i,e),n.scale(i,i,1/a),n.add(r,t,[0,a,0]);var o=d(r);n.subtract(o,o,e),n.scale(o,o,1/a),n.add(r,t,[0,0,a]);var s=d(r);return n.subtract(s,s,e),n.scale(s,s,1/a),n.add(r,i,o),n.add(r,r,s),r},m=[],v=e[0][0],y=e[0][1],x=e[0][2],b=e[1][0],_=e[1][1],w=e[1][2],T=function(t){var e=t[0],r=t[1],n=t[2];return!(e<v||e>b||r<y||r>_||n<x||n>w)},k=10*n.distance(e[0],e[1])/a,A=k*k,M=1,S=0,E=r.length;E>1&&(M=function(t){for(var e=[],r=[],n=[],a={},i={},o={},s=t.length,l=0;l<s;l++){var u=t[l],h=u[0],f=u[1],p=u[2];a[h]||(e.push(h),a[h]=!0),i[f]||(r.push(f),i[f]=!0),o[p]||(n.push(p),o[p]=!0)}var d=c(e),g=c(r),m=c(n),v=Math.min(d,g,m);return isFinite(v)?v:1}(r));for(var C=0;C<E;C++){var L=n.create();n.copy(L,r[C]);var P=[L],I=[],z=d(L),O=L;I.push(z);var D=[],R=g(L,z),F=n.length(R);isFinite(F)&&F>S&&(S=F),D.push(F),m.push({points:P,velocities:I,divergences:D});for(var B=0;B<100*a&&P.length<a&&T(L);){B++;var N=n.clone(z),j=n.squaredLength(N);if(0===j)break;if(j>A&&n.scale(N,N,k/Math.sqrt(j)),n.add(N,N,L),z=d(N),n.squaredDistance(O,N)-A>-1e-4*A){P.push(N),O=N,I.push(z);R=g(N,z),F=n.length(R);isFinite(F)&&F>S&&(S=F),D.push(F)}L=N}}var V=o(m,t.colormap,S,M);return h?V.tubeScale=h:(0===S&&(S=1),V.tubeScale=.5*u*M/S),V};var u=t("./lib/shaders"),h=t("gl-cone3d").createMesh;e.exports.createTubeMesh=function(t,e){return h(t,e,{shaders:u,traceType:"streamtube"})}},{"./lib/shaders":317,"gl-cone3d":254,"gl-vec3":346,"gl-vec4":382}],319:[function(t,e,r){var n=t("gl-shader"),a=t("glslify"),i=a(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform vec3 objectOffset;\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 vec3 localCoordinate = vec3(uv.zw, f.x);\n worldCoordinate = objectOffset + localCoordinate;\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n vec4 clipPosition = projection * view * worldPosition;\n gl_Position = clipPosition;\n kill = f.y;\n value = f.z;\n planeCoordinate = uv.xy;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n"]),o=a(["precision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat beckmannSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\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 (\n kill > 0.0 ||\n vColor.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\n ) discard;\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color \u2014 in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n"]),s=a(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\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 worldCoordinate = objectOffset + dataCoordinate;\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n"]),l=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) 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,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createPickShader=function(t){var e=n(t,i,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createContourShader=function(t){var e=n(t,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":307,glslify:408}],320:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=y(e),n=b(e),s=x(e),l=_(e),c=a(e),u=i(e,[{buffer:c,size:4,stride:40,offset:0},{buffer:c,size:3,stride:40,offset:16},{buffer:c,size:3,stride:40,offset:28}]),h=a(e),f=i(e,[{buffer:h,size:4,stride:20,offset:0},{buffer:h,size:1,stride:20,offset:16}]),p=a(e),d=i(e,[{buffer:p,size:2,type:e.FLOAT}]),g=o(e,1,256,e.RGBA,e.UNSIGNED_BYTE);g.minFilter=e.LINEAR,g.magFilter=e.LINEAR;var m=new M(e,[0,0],[[0,0,0],[0,0,0]],r,n,c,u,g,s,l,h,f,p,d,[0,0,0]),v={levels:[[],[],[]]};for(var w in t)v[w]=t[w];return v.colormap=v.colormap||"jet",m.update(v),m};var n=t("bit-twiddle"),a=t("gl-buffer"),i=t("gl-vao"),o=t("gl-texture2d"),s=t("typedarray-pool"),l=t("colormap"),c=t("ndarray-ops"),u=t("ndarray-pack"),h=t("ndarray"),f=t("surface-nets"),p=t("gl-mat4/multiply"),d=t("gl-mat4/invert"),g=t("binary-search-bounds"),m=t("ndarray-gradient"),v=t("./lib/shaders"),y=v.createShader,x=v.createContourShader,b=v.createPickShader,_=v.createPickContourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],T=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],k=[[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 A(t,e,r,n,a){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=a}!function(){for(var t=0;t<3;++t){var e=k[t],r=(t+2)%3;e[(t+1)%3+0]=1,e[r+3]=1,e[t+6]=1}}();function M(t,e,r,n,a,i,o,l,c,u,f,p,d,g,m){this.gl=t,this.shape=e,this.bounds=r,this.objectOffset=m,this.intensityBounds=[],this._shader=n,this._pickShader=a,this._coordinateBuffer=i,this._vao=o,this._colorMap=l,this._contourShader=c,this._contourPickShader=u,this._contourBuffer=f,this._contourVAO=p,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new A([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=g,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=[h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.opacityscale=!1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var S=M.prototype;S.isTransparent=function(){return this.opacity<1||this.opacityscale},S.isOpaque=function(){if(this.opacityscale)return!1;if(this.opacity<1)return!1;if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this._contourCounts[t].length>0)return!0;return!1},S.pickSlots=1,S.setPickBase=function(t){this.pickId=t};var E=[0,0,0],C={showSurface:!1,showContour:!1,projections:[w.slice(),w.slice(),w.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function L(t,e){var r,n,a,i=e.axes&&e.axes.lastCubeProps.axis||E,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=C.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(i[r]>0)][r],p(l,t.model,l);var c=C.clipBounds[r];for(a=0;a<2;++a)for(n=0;n<3;++n)c[a][n]=t.clipBounds[a][n];c[0][r]=-1e8,c[1][r]=1e8}return C.showSurface=o,C.showContour=s,C}var P={model:w,view:w,projection:w,inverseModel:w.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,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},I=w.slice(),z=[1,0,0,0,1,0,0,0,1];function O(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=P;n.model=t.model||w,n.view=t.view||w,n.projection=t.projection||w,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.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=d(n.inverseModel,n.model);for(var a=0;a<2;++a)for(var i=n.clipBounds[a],o=0;o<3;++o)i[o]=Math.min(Math.max(this.clipBounds[a][o],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=z,n.vertexColor=this.vertexColor;var s=I;for(p(s,n.view,n.model),p(s,n.projection,s),d(s,s),a=0;a<3;++a)n.eyePosition[a]=s[12+a]/s[15];var l=s[15];for(a=0;a<3;++a)l+=this.lightPosition[a]*s[4*a+3];for(a=0;a<3;++a){var c=s[12+a];for(o=0;o<3;++o)c+=s[4*o+a]*this.lightPosition[o];n.lightPosition[a]=c/l}var u=L(n,this);if(u.showSurface){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),a=0;a<3;++a)this.surfaceProject[a]&&this.vertexCount&&(this._shader.uniforms.model=u.projections[a],this._shader.uniforms.clipBounds=u.clipBounds[a],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(u.showContour){var h=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,h.bind(),h.uniforms=n;var f=this._contourVAO;for(f.bind(),a=0;a<3;++a)for(h.uniforms.permutation=k[a],r.lineWidth(this.contourWidth[a]*this.pixelRatio),o=0;o<this.contourLevels[a].length;++o)o===this.highlightLevel[a]?(h.uniforms.contourColor=this.highlightColor[a],h.uniforms.contourTint=this.highlightTint[a]):0!==o&&o-1!==this.highlightLevel[a]||(h.uniforms.contourColor=this.contourColor[a],h.uniforms.contourTint=this.contourTint[a]),this._contourCounts[a][o]&&(h.uniforms.height=this.contourLevels[a][o],f.draw(r.LINES,this._contourCounts[a][o],this._contourOffsets[a][o]));for(a=0;a<3;++a)for(h.uniforms.model=u.projections[a],h.uniforms.clipBounds=u.clipBounds[a],o=0;o<3;++o)if(this.contourProject[a][o]){h.uniforms.permutation=k[o],r.lineWidth(this.contourWidth[o]*this.pixelRatio);for(var g=0;g<this.contourLevels[o].length;++g)g===this.highlightLevel[o]?(h.uniforms.contourColor=this.highlightColor[o],h.uniforms.contourTint=this.highlightTint[o]):0!==g&&g-1!==this.highlightLevel[o]||(h.uniforms.contourColor=this.contourColor[o],h.uniforms.contourTint=this.contourTint[o]),this._contourCounts[o][g]&&(h.uniforms.height=this.contourLevels[o][g],f.draw(r.LINES,this._contourCounts[o][g],this._contourOffsets[o][g]))}for(f.unbind(),(f=this._dynamicVAO).bind(),a=0;a<3;++a)if(0!==this._dynamicCounts[a])for(h.uniforms.model=n.model,h.uniforms.clipBounds=n.clipBounds,h.uniforms.permutation=k[a],r.lineWidth(this.dynamicWidth[a]*this.pixelRatio),h.uniforms.contourColor=this.dynamicColor[a],h.uniforms.contourTint=this.dynamicTint[a],h.uniforms.height=this.dynamicLevel[a],f.draw(r.LINES,this._dynamicCounts[a],this._dynamicOffsets[a]),o=0;o<3;++o)this.contourProject[o][a]&&(h.uniforms.model=u.projections[o],h.uniforms.clipBounds=u.clipBounds[o],f.draw(r.LINES,this._dynamicCounts[a],this._dynamicOffsets[a]));f.unbind()}}S.draw=function(t){return O.call(this,t,!1)},S.drawTransparent=function(t){return O.call(this,t,!0)};var D={model:w,view:w,projection:w,inverseModel:w,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,objectOffset:[0,0,0],permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};function R(t,e){return Array.isArray(t)?[e(t[0]),e(t[1]),e(t[2])]:[e(t),e(t),e(t)]}function F(t){return Array.isArray(t)?3===t.length?[t[0],t[1],t[2],1]:[t[0],t[1],t[2],t[3]]:[0,0,0,1]}function B(t){if(Array.isArray(t)){if(Array.isArray(t))return[F(t[0]),F(t[1]),F(t[2])];var e=F(t);return[e.slice(),e.slice(),e.slice()]}}S.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=D;r.model=t.model||w,r.view=t.view||w,r.projection=t.projection||w,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.objectOffset=this.objectOffset,r.permutation=z;for(var n=0;n<2;++n)for(var a=r.clipBounds[n],i=0;i<3;++i)a[i]=Math.min(Math.max(this.clipBounds[n][i],-1e8),1e8);var o=L(r,this);if(o.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(e.TRIANGLES,this._vertexCount),n=0;n<3;++n)this.surfaceProject[n]&&(this._pickShader.uniforms.model=o.projections[n],this._pickShader.uniforms.clipBounds=o.clipBounds[n],this._vao.draw(e.TRIANGLES,this._vertexCount));this._vao.unbind()}if(o.showContour){var s=this._contourPickShader;s.bind(),s.uniforms=r;var l=this._contourVAO;for(l.bind(),i=0;i<3;++i)for(e.lineWidth(this.contourWidth[i]*this.pixelRatio),s.uniforms.permutation=k[i],n=0;n<this.contourLevels[i].length;++n)this._contourCounts[i][n]&&(s.uniforms.height=this.contourLevels[i][n],l.draw(e.LINES,this._contourCounts[i][n],this._contourOffsets[i][n]));for(n=0;n<3;++n)for(s.uniforms.model=o.projections[n],s.uniforms.clipBounds=o.clipBounds[n],i=0;i<3;++i)if(this.contourProject[n][i]){s.uniforms.permutation=k[i],e.lineWidth(this.contourWidth[i]*this.pixelRatio);for(var c=0;c<this.contourLevels[i].length;++c)this._contourCounts[i][c]&&(s.uniforms.height=this.contourLevels[i][c],l.draw(e.LINES,this._contourCounts[i][c],this._contourOffsets[i][c]))}l.unbind()}},S.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=this._field[2].shape,r=this._pickResult,n=e[0]*(t.value[0]+(t.value[2]>>4)/16)/255,a=Math.floor(n),i=n-a,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;a+=1,s+=1;var c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var h=u?i:1-i,f=0;f<2;++f)for(var p=a+u,d=s+f,m=h*(f?l:1-l),v=0;v<3;++v)c[v]+=this._field[v].get(p,d)*m;for(var y=this._pickResult.level,x=0;x<3;++x)if(y[x]=g.le(this.contourLevels[x],c[x]),y[x]<0)this.contourLevels[x].length>0&&(y[x]=0);else if(y[x]<this.contourLevels[x].length-1){var b=this.contourLevels[x][y[x]],_=this.contourLevels[x][y[x]+1];Math.abs(b-c[x])>Math.abs(_-c[x])&&(y[x]+=1)}for(r.index[0]=i<.5?a:a+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],v=0;v<3;++v)r.dataCoordinate[v]=this._field[v].get(r.index[0],r.index[1]);return r},S.padField=function(t,e){var r=e.shape.slice(),n=t.shape.slice();c.assign(t.lo(1,1).hi(r[0],r[1]),e),c.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),c.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),c.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),c.assign(t.lo(n[0]-1,1).hi(1,r[1]),e.lo(r[0]-1)),t.set(0,0,e.get(0,0)),t.set(0,n[1]-1,e.get(0,r[1]-1)),t.set(n[0]-1,0,e.get(r[0]-1,0)),t.set(n[0]-1,n[1]-1,e.get(r[0]-1,r[1]-1))},S.update=function(t){t=t||{},this.objectOffset=t.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in t&&(this.contourWidth=R(t.contourWidth,Number)),"showContour"in t&&(this.showContour=R(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=R(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=B(t.contourColor)),"contourProject"in t&&(this.contourProject=R(t.contourProject,(function(t){return R(t,Boolean)}))),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=B(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=R(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=R(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"opacityscale"in t&&(this.opacityscale=t.opacityscale),"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 a=(e.shape[0]+2)*(e.shape[1]+2);a>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(a))),this._field[2]=h(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),this.padField(this._field[2],e),this.shape=e.shape.slice();for(var i=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=h(this._field[o].data,[i[0]+2,i[1]+2]);if(t.coords){var p=t.coords;if(!Array.isArray(p)||3!==p.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var d=p[o];for(b=0;b<2;++b)if(d.shape[b]!==i[b])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],d)}}else if(t.ticks){var g=t.ticks;if(!Array.isArray(g)||2!==g.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var v=g[o];if((Array.isArray(v)||v.length)&&(v=h(v)),v.shape[0]!==i[o])throw new Error("gl-surface: invalid tick length");var y=h(v.data,i);y.stride[o]=v.stride[0],y.stride[1^o]=0,this.padField(this._field[o],y)}}else{for(o=0;o<2;++o){var x=[0,0];x[o]=1,this._field[o]=h(this._field[o].data,[i[0]+2,i[1]+2],x,0)}this._field[0].set(0,0,0);for(var b=0;b<i[0];++b)this._field[0].set(b+1,0,b);for(this._field[0].set(i[0]+1,0,i[0]-1),this._field[1].set(0,0,0),b=0;b<i[1];++b)this._field[1].set(0,b+1,b);this._field[1].set(0,i[1]+1,i[1]-1)}var _=this._field,w=h(s.mallocFloat(3*_[2].size*2),[3,i[0]+2,i[1]+2,2]);for(o=0;o<3;++o)m(w.pick(o),_[o],"mirror");var k=h(s.mallocFloat(3*_[2].size),[i[0]+2,i[1]+2,3]);for(o=0;o<i[0]+2;++o)for(b=0;b<i[1]+2;++b){var A=w.get(0,o,b,0),M=w.get(0,o,b,1),S=w.get(1,o,b,0),E=w.get(1,o,b,1),C=w.get(2,o,b,0),L=w.get(2,o,b,1),P=S*L-E*C,I=C*M-L*A,z=A*E-M*S,O=Math.sqrt(P*P+I*I+z*z);O<1e-8?(O=Math.max(Math.abs(P),Math.abs(I),Math.abs(z)))<1e-8?(z=1,I=P=0,O=1):O=1/O:O=1/Math.sqrt(O),k.set(o,b,0,P*O),k.set(o,b,1,I*O),k.set(o,b,2,z*O)}s.free(w.data);var D=[1/0,1/0,1/0],F=[-1/0,-1/0,-1/0],N=1/0,j=-1/0,V=(i[0]-1)*(i[1]-1)*6,U=s.mallocFloat(n.nextPow2(10*V)),q=0,H=0;for(o=0;o<i[0]-1;++o)t:for(b=0;b<i[1]-1;++b){for(var G=0;G<2;++G)for(var Y=0;Y<2;++Y)for(var W=0;W<3;++W){var Z=this._field[W].get(1+o+G,1+b+Y);if(isNaN(Z)||!isFinite(Z))continue t}for(W=0;W<6;++W){var X=o+T[W][0],J=b+T[W][1],K=this._field[0].get(X+1,J+1),Q=this._field[1].get(X+1,J+1);Z=this._field[2].get(X+1,J+1),P=k.get(X+1,J+1,0),I=k.get(X+1,J+1,1),z=k.get(X+1,J+1,2),t.intensity&&($=t.intensity.get(X,J));var $=t.intensity?t.intensity.get(X,J):Z+this.objectOffset[2];U[q++]=X,U[q++]=J,U[q++]=K,U[q++]=Q,U[q++]=Z,U[q++]=0,U[q++]=$,U[q++]=P,U[q++]=I,U[q++]=z,D[0]=Math.min(D[0],K+this.objectOffset[0]),D[1]=Math.min(D[1],Q+this.objectOffset[1]),D[2]=Math.min(D[2],Z+this.objectOffset[2]),N=Math.min(N,$),F[0]=Math.max(F[0],K+this.objectOffset[0]),F[1]=Math.max(F[1],Q+this.objectOffset[1]),F[2]=Math.max(F[2],Z+this.objectOffset[2]),j=Math.max(j,$),H+=1}}for(t.intensityBounds&&(N=+t.intensityBounds[0],j=+t.intensityBounds[1]),o=6;o<q;o+=10)U[o]=(U[o]-N)/(j-N);this._vertexCount=H,this._coordinateBuffer.update(U.subarray(0,q)),s.freeFloat(U),s.free(k.data),this.bounds=[D,F],this.intensity=t.intensity||this._field[2],this.intensityBounds[0]===N&&this.intensityBounds[1]===j||(r=!0),this.intensityBounds=[N,j]}if("levels"in t){var tt=t.levels;for(tt=Array.isArray(tt[0])?tt.slice():[[],[],tt],o=0;o<3;++o)tt[o]=tt[o].slice(),tt[o].sort((function(t,e){return t-e}));for(o=0;o<3;++o)for(b=0;b<tt[o].length;++b)tt[o][b]-=this.objectOffset[o];t:for(o=0;o<3;++o){if(tt[o].length!==this.contourLevels[o].length){r=!0;break}for(b=0;b<tt[o].length;++b)if(tt[o][b]!==this.contourLevels[o][b]){r=!0;break t}}this.contourLevels=tt}if(r){_=this._field,i=this.shape;for(var et=[],rt=0;rt<3;++rt){var nt=this.contourLevels[rt],at=[],it=[],ot=[0,0,0];for(o=0;o<nt.length;++o){var st=f(this._field[rt],nt[o]);at.push(et.length/5|0),H=0;t:for(b=0;b<st.cells.length;++b){var lt=st.cells[b];for(W=0;W<2;++W){var ct=st.positions[lt[W]],ut=ct[0],ht=0|Math.floor(ut),ft=ut-ht,pt=ct[1],dt=0|Math.floor(pt),gt=pt-dt,mt=!1;e:for(var vt=0;vt<3;++vt){ot[vt]=0;var yt=(rt+vt+1)%3;for(G=0;G<2;++G){var xt=G?ft:1-ft;for(X=0|Math.min(Math.max(ht+G,0),i[0]),Y=0;Y<2;++Y){var bt=Y?gt:1-gt;if(J=0|Math.min(Math.max(dt+Y,0),i[1]),Z=vt<2?this._field[yt].get(X,J):(this.intensity.get(X,J)-this.intensityBounds[0])/(this.intensityBounds[1]-this.intensityBounds[0]),!isFinite(Z)||isNaN(Z)){mt=!0;break e}var _t=xt*bt;ot[vt]+=_t*Z}}}if(mt){if(W>0){for(var wt=0;wt<5;++wt)et.pop();H-=1}continue t}et.push(ot[0],ot[1],ct[0],ct[1],ot[2]),H+=1}}it.push(H)}this._contourOffsets[rt]=at,this._contourCounts[rt]=it}var Tt=s.mallocFloat(et.length);for(o=0;o<et.length;++o)Tt[o]=et[o];this._contourBuffer.update(Tt),s.freeFloat(Tt)}t.colormap&&this._colorMap.setPixels(function(t,e){var r=u([l({colormap:t,nshades:256,format:"rgba"}).map((function(t,r){var n=e?function(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;r<e.length;++r){if(e.length<2)return 1;if(e[r][0]===t)return e[r][1];if(e[r][0]>t&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}(r/255,e):1;return[t[0],t[1],t[2],255*n]}))]);return c.divseq(r,255),r}(t.colormap,this.opacityscale))},S.dispose=function(){this._shader.dispose(),this._vao.dispose(),this._coordinateBuffer.dispose(),this._colorMap.dispose(),this._contourBuffer.dispose(),this._contourVAO.dispose(),this._contourShader.dispose(),this._contourPickShader.dispose(),this._dynamicBuffer.dispose(),this._dynamicVAO.dispose();for(var t=0;t<3;++t)s.freeFloat(this._field[t].data)},S.highlight=function(t){var e,r;if(!t)return this._dynamicCounts=[0,0,0],this.dyanamicLevel=[NaN,NaN,NaN],void(this.highlightLevel=[-1,-1,-1]);for(e=0;e<3;++e)this.enableHighlight[e]?this.highlightLevel[e]=t.level[e]:this.highlightLevel[e]=-1;for(r=this.snapToData?t.dataCoordinate:t.position,e=0;e<3;++e)r[e]-=this.objectOffset[e];if(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,a=this.shape,i=s.mallocFloat(12*a[0]*a[1]),o=0;o<3;++o)if(this.enableDynamic[o]){this.dynamicLevel[o]=r[o];var l=(o+1)%3,c=(o+2)%3,u=this._field[o],h=this._field[l],p=this._field[c],d=f(u,r[o]),g=d.cells,m=d.positions;for(this._dynamicOffsets[o]=n,e=0;e<g.length;++e)for(var v=g[e],y=0;y<2;++y){var x=m[v[y]],b=+x[0],_=0|b,w=0|Math.min(_+1,a[0]),T=b-_,k=1-T,A=+x[1],M=0|A,S=0|Math.min(M+1,a[1]),E=A-M,C=1-E,L=k*C,P=k*E,I=T*C,z=T*E,O=L*h.get(_,M)+P*h.get(_,S)+I*h.get(w,M)+z*h.get(w,S),D=L*p.get(_,M)+P*p.get(_,S)+I*p.get(w,M)+z*p.get(w,S);if(isNaN(O)||isNaN(D)){y&&(n-=1);break}i[2*n+0]=O,i[2*n+1]=D,n+=1}this._dynamicCounts[o]=n-this._dynamicOffsets[o]}else this.dynamicLevel[o]=NaN,this._dynamicCounts[o]=0;this._dynamicBuffer.update(i.subarray(0,2*n)),s.freeFloat(i)}}},{"./lib/shaders":319,"binary-search-bounds":94,"bit-twiddle":95,colormap:128,"gl-buffer":253,"gl-mat4/invert":273,"gl-mat4/multiply":275,"gl-texture2d":322,"gl-vao":327,ndarray:448,"ndarray-gradient":441,"ndarray-ops":443,"ndarray-pack":444,"surface-nets":522,"typedarray-pool":547}],321:[function(t,e,r){"use strict";var n=t("css-font"),a=t("pick-by-alias"),i=t("regl"),o=t("gl-util/context"),s=t("es6-weak-map"),l=t("color-normalize"),c=t("font-atlas"),u=t("typedarray-pool"),h=t("parse-rect"),f=t("is-plain-obj"),p=t("parse-unit"),d=t("to-px"),g=t("detect-kerning"),m=t("object-assign"),v=t("font-measure"),y=t("flatten-vertex-data"),x=t("bit-twiddle").nextPow2,b=new s,_=!1;if(document.body){var w=document.body.appendChild(document.createElement("div"));w.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(w).fontStretch&&(_=!0),document.body.removeChild(w)}var T=function(t){!function(t){return"function"==typeof t&&t._gl&&t.prop&&t.texture&&t.buffer}(t)?this.gl=o(t):(t={regl:t},this.gl=t.regl._gl),this.shader=b.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=t.regl||i({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),b.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(f(t)?t:{})};T.prototype.createShader=function(){var t=this.regl,e=t({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:t.prop("count"),offset:t.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:t.this("sizeBuffer")},width:{offset:0,stride:8,buffer:t.this("sizeBuffer")},char:t.this("charBuffer"),position:t.this("position")},uniforms:{atlasSize:function(t,e){return[e.atlas.width,e.atlas.height]},atlasDim:function(t,e){return[e.atlas.cols,e.atlas.rows]},atlas:function(t,e){return e.atlas.texture},charStep:function(t,e){return e.atlas.step},em:function(t,e){return e.atlas.em},color:t.prop("color"),opacity:t.prop("opacity"),viewport:t.this("viewportArray"),scale:t.this("scale"),align:t.prop("align"),baseline:t.prop("baseline"),translate:t.this("translate"),positionOffset:t.prop("positionOffset")},primitive:"points",viewport:t.this("viewport"),vert:"\n\t\t\tprecision highp float;\n\t\t\tattribute float width, charOffset, char;\n\t\t\tattribute vec2 position;\n\t\t\tuniform float fontSize, charStep, em, align, baseline;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform vec4 color;\n\t\t\tuniform vec2 atlasSize, atlasDim, scale, translate, positionOffset;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvoid main () {\n\t\t\t\t"+(T.normalViewport?"":"vec2 positionOffset = vec2(positionOffset.x,- positionOffset.y);")+"\n\n\t\t\t\tvec2 offset = floor(em * (vec2(align + charOffset, baseline)\n\t\t\t\t\t+ positionOffset))\n\t\t\t\t\t/ (viewport.zw * scale.xy);\n\n\t\t\t\tvec2 position = (position + translate) * scale;\n\t\t\t\tposition += offset * scale;\n\n\t\t\t\t"+(T.normalViewport?"position.y = 1. - position.y;":"")+"\n\n\t\t\t\tcharCoord = position * viewport.zw + viewport.xy;\n\n\t\t\t\tgl_Position = vec4(position * 2. - 1., 0, 1);\n\n\t\t\t\tgl_PointSize = charStep;\n\n\t\t\t\tcharId.x = mod(char, atlasDim.x);\n\t\t\t\tcharId.y = floor(char / atlasDim.x);\n\n\t\t\t\tcharWidth = width * em;\n\n\t\t\t\tfontColor = color / 255.;\n\t\t\t}",frag:"\n\t\t\tprecision highp float;\n\t\t\tuniform sampler2D atlas;\n\t\t\tuniform float fontSize, charStep, opacity;\n\t\t\tuniform vec2 atlasSize;\n\t\t\tuniform vec4 viewport;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\n\t\t\tfloat lightness(vec4 color) {\n\t\t\t\treturn color.r * 0.299 + color.g * 0.587 + color.b * 0.114;\n\t\t\t}\n\n\t\t\tvoid main () {\n\t\t\t\tvec2 uv = gl_FragCoord.xy - charCoord + charStep * .5;\n\t\t\t\tfloat halfCharStep = floor(charStep * .5 + .5);\n\n\t\t\t\t// invert y and shift by 1px (FF expecially needs that)\n\t\t\t\tuv.y = charStep - uv.y;\n\n\t\t\t\t// ignore points outside of character bounding box\n\t\t\t\tfloat halfCharWidth = ceil(charWidth * .5);\n\t\t\t\tif (floor(uv.x) > halfCharStep + halfCharWidth ||\n\t\t\t\t\tfloor(uv.x) < halfCharStep - halfCharWidth) return;\n\n\t\t\t\tuv += charId * charStep;\n\t\t\t\tuv = uv / atlasSize;\n\n\t\t\t\tvec4 color = fontColor;\n\t\t\t\tvec4 mask = texture2D(atlas, uv);\n\n\t\t\t\tfloat maskY = lightness(mask);\n\t\t\t\t// float colorY = lightness(color);\n\t\t\t\tcolor.a *= maskY;\n\t\t\t\tcolor.a *= opacity;\n\n\t\t\t\t// color.a += .1;\n\n\t\t\t\t// antialiasing, see yiq color space y-channel formula\n\t\t\t\t// color.rgb += (1. - color.rgb) * (1. - mask.rgb);\n\n\t\t\t\tgl_FragColor = color;\n\t\t\t}"});return{regl:t,draw:e,atlas:{}}},T.prototype.update=function(t){var e=this;if("string"==typeof t)t={text:t};else if(!t)return;null!=(t=a(t,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0)).opacity&&(Array.isArray(t.opacity)?this.opacity=t.opacity.map((function(t){return parseFloat(t)})):this.opacity=parseFloat(t.opacity)),null!=t.viewport&&(this.viewport=h(t.viewport),T.normalViewport&&(this.viewport.y=this.canvas.height-this.viewport.y-this.viewport.height),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null!=t.kerning&&(this.kerning=t.kerning),null!=t.offset&&("number"==typeof t.offset&&(t.offset=[t.offset,0]),this.positionOffset=y(t.offset)),t.direction&&(this.direction=t.direction),t.range&&(this.range=t.range,this.scale=[1/(t.range[2]-t.range[0]),1/(t.range[3]-t.range[1])],this.translate=[-t.range[0],-t.range[1]]),t.scale&&(this.scale=t.scale),t.translate&&(this.translate=t.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),this.font.length||t.font||(t.font=T.baseFontSize+"px sans-serif");var r,i=!1,o=!1;if(t.font&&(Array.isArray(t.font)?t.font:[t.font]).forEach((function(t,r){if("string"==typeof t)try{t=n.parse(t)}catch(e){t=n.parse(T.baseFontSize+"px "+t)}else t=n.parse(n.stringify(t));var a=n.stringify({size:T.baseFontSize,family:t.family,stretch:_?t.stretch:void 0,variant:t.variant,weight:t.weight,style:t.style}),s=p(t.size),l=Math.round(s[0]*d(s[1]));if(l!==e.fontSize[r]&&(o=!0,e.fontSize[r]=l),!(e.font[r]&&a==e.font[r].baseString||(i=!0,e.font[r]=T.fonts[a],e.font[r]))){var c=t.family.join(", "),u=[t.style];t.style!=t.variant&&u.push(t.variant),t.variant!=t.weight&&u.push(t.weight),_&&t.weight!=t.stretch&&u.push(t.stretch),e.font[r]={baseString:a,family:c,weight:t.weight,stretch:t.stretch,style:t.style,variant:t.variant,width:{},kerning:{},metrics:v(c,{origin:"top",fontSize:T.baseFontSize,fontStyle:u.join(" ")})},T.fonts[a]=e.font[r]}})),(i||o)&&this.font.forEach((function(r,a){var i=n.stringify({size:e.fontSize[a],family:r.family,stretch:_?r.stretch:void 0,variant:r.variant,weight:r.weight,style:r.style});if(e.fontAtlas[a]=e.shader.atlas[i],!e.fontAtlas[a]){var o=r.metrics;e.shader.atlas[i]=e.fontAtlas[a]={fontString:i,step:2*Math.ceil(e.fontSize[a]*o.bottom*.5),em:e.fontSize[a],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:e.regl.texture()}}null==t.text&&(t.text=e.text)})),"string"==typeof t.text&&t.position&&t.position.length>2){for(var s=Array(.5*t.position.length),f=0;f<s.length;f++)s[f]=t.text;t.text=s}if(null!=t.text||i){if(this.textOffsets=[0],Array.isArray(t.text)){this.count=t.text[0].length,this.counts=[this.count];for(var b=1;b<t.text.length;b++)this.textOffsets[b]=this.textOffsets[b-1]+t.text[b-1].length,this.count+=t.text[b].length,this.counts.push(t.text[b].length);this.text=t.text.join("")}else this.text=t.text,this.count=this.text.length,this.counts=[this.count];r=[],this.font.forEach((function(t,n){T.atlasContext.font=t.baseString;for(var a=e.fontAtlas[n],i=0;i<e.text.length;i++){var o=e.text.charAt(i);if(null==a.ids[o]&&(a.ids[o]=a.chars.length,a.chars.push(o),r.push(o)),null==t.width[o]&&(t.width[o]=T.atlasContext.measureText(o).width/T.baseFontSize,e.kerning)){var s=[];for(var l in t.width)s.push(l+o,o+l);m(t.kerning,g(t.family,{pairs:s}))}}}))}if(t.position)if(t.position.length>2){for(var w=!t.position[0].length,k=u.mallocFloat(2*this.count),A=0,M=0;A<this.counts.length;A++){var S=this.counts[A];if(w)for(var E=0;E<S;E++)k[M++]=t.position[2*A],k[M++]=t.position[2*A+1];else for(var C=0;C<S;C++)k[M++]=t.position[A][0],k[M++]=t.position[A][1]}this.position.call?this.position({type:"float",data:k}):this.position=this.regl.buffer({type:"float",data:k}),u.freeFloat(k)}else this.position.destroy&&this.position.destroy(),this.position={constant:t.position};if(t.text||i){var L=u.mallocUint8(this.count),P=u.mallocFloat(2*this.count);this.textWidth=[];for(var I=0,z=0;I<this.counts.length;I++){for(var O=this.counts[I],D=this.font[I]||this.font[0],R=this.fontAtlas[I]||this.fontAtlas[0],F=0;F<O;F++){var B=this.text.charAt(z),N=this.text.charAt(z-1);if(L[z]=R.ids[B],P[2*z]=D.width[B],F){var j=P[2*z-2],V=P[2*z],U=P[2*z-1]+.5*j+.5*V;if(this.kerning){var q=D.kerning[N+B];q&&(U+=.001*q)}P[2*z+1]=U}else P[2*z+1]=.5*P[2*z];z++}this.textWidth.push(P.length?.5*P[2*z-2]+P[2*z-1]:0)}t.align||(t.align=this.align),this.charBuffer({data:L,type:"uint8",usage:"stream"}),this.sizeBuffer({data:P,type:"float",usage:"stream"}),u.freeUint8(L),u.freeFloat(P),r.length&&this.font.forEach((function(t,r){var n=e.fontAtlas[r],a=n.step,i=Math.floor(T.maxAtlasSize/a),o=Math.min(i,n.chars.length),s=Math.ceil(n.chars.length/o),l=x(o*a),u=x(s*a);n.width=l,n.height=u,n.rows=s,n.cols=o,n.em&&n.texture({data:c({canvas:T.atlasCanvas,font:n.fontString,chars:n.chars,shape:[l,u],step:[a,a]})})}))}if(t.align&&(this.align=t.align,this.alignOffset=this.textWidth.map((function(t,r){var n=Array.isArray(e.align)?e.align.length>1?e.align[r]:e.align[0]:e.align;if("number"==typeof n)return n;switch(n){case"right":case"end":return-t;case"center":case"centre":case"middle":return.5*-t}return 0}))),null==this.baseline&&null==t.baseline&&(t.baseline=0),null!=t.baseline&&(this.baseline=t.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map((function(t,r){var n=(e.font[r]||e.font[0]).metrics,a=0;return a+=.5*n.bottom,a+="number"==typeof t?t-n.baseline:-n[t],T.normalViewport||(a*=-1),a}))),null!=t.color)if(t.color||(t.color="transparent"),"string"!=typeof t.color&&isNaN(t.color)){var H;if("number"==typeof t.color[0]&&t.color.length>this.counts.length){var G=t.color.length;H=u.mallocUint8(G);for(var Y=(t.color.subarray||t.color.slice).bind(t.color),W=0;W<G;W+=4)H.set(l(Y(W,W+4),"uint8"),W)}else{var Z=t.color.length;H=u.mallocUint8(4*Z);for(var X=0;X<Z;X++)H.set(l(t.color[X]||0,"uint8"),4*X)}this.color=H}else this.color=l(t.color,"uint8");if(t.position||t.text||t.color||t.baseline||t.align||t.font||t.offset||t.opacity)if(this.color.length>4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var J=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array(J);for(var K=0;K<this.batch.length;K++)this.batch[K]={count:this.counts.length>1?this.counts[K]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[K]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*K,4*K+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[K]:this.opacity,baseline:null!=this.baselineOffset[K]?this.baselineOffset[K]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[K]?this.alignOffset[K]:this.alignOffset[0]:0,atlas:this.fontAtlas[K]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*K,2*K+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]},T.prototype.destroy=function(){},T.prototype.kerning=!0,T.prototype.position={constant:new Float32Array(2)},T.prototype.translate=null,T.prototype.scale=null,T.prototype.font=null,T.prototype.text="",T.prototype.positionOffset=[0,0],T.prototype.opacity=1,T.prototype.color=new Uint8Array([0,0,0,255]),T.prototype.alignOffset=[0,0],T.normalViewport=!1,T.maxAtlasSize=1024,T.atlasCanvas=document.createElement("canvas"),T.atlasContext=T.atlasCanvas.getContext("2d",{alpha:!1}),T.baseFontSize=64,T.fonts={},e.exports=T},{"bit-twiddle":95,"color-normalize":122,"css-font":141,"detect-kerning":167,"es6-weak-map":228,"flatten-vertex-data":239,"font-atlas":240,"font-measure":241,"gl-util/context":323,"is-plain-obj":422,"object-assign":452,"parse-rect":457,"parse-unit":459,"pick-by-alias":463,regl:492,"to-px":530,"typedarray-pool":547}],322:[function(t,e,r){"use strict";var n=t("ndarray"),a=t("ndarray-ops"),i=t("typedarray-pool");e.exports=function(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");o||c(t);if("number"==typeof arguments[1])return v(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return v(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1],r=u(e)?e:e.raw;if(r)return y(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 x(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function c(t){o=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],s=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],l=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}function u(t){return"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement||"undefined"!=typeof ImageData&&t instanceof ImageData}var h=function(t,e){a.muls(t,e,255)};function f(t,e,r){var n=t.gl,a=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)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 p(t,e,r,n,a,i){this.gl=t,this.handle=e,this.format=a,this.type=i,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}var d=p.prototype;function g(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function m(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function v(t,e,r,n,a){var i=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture shape");if(a===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=m(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,a,null),new p(t,o,e,r,n,a)}function y(t,e,r,n,a,i){var o=m(t);return t.texImage2D(t.TEXTURE_2D,0,a,a,i,e),new p(t,o,r,n,a,i)}function x(t,e){var r=e.dtype,o=e.shape.slice(),s=t.getParameter(t.MAX_TEXTURE_SIZE);if(o[0]<0||o[0]>s||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=g(o,e.stride.slice()),c=0;"float32"===r?c=t.FLOAT:"float64"===r?(c=t.FLOAT,l=!1,r="float32"):"uint8"===r?c=t.UNSIGNED_BYTE:(c=t.UNSIGNED_BYTE,l=!1,r="uint8");var u,f,d=0;if(2===o.length)d=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])d=t.ALPHA;else if(2===o[2])d=t.LUMINANCE_ALPHA;else if(3===o[2])d=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");d=t.RGBA}}c!==t.FLOAT||t.getExtension("OES_texture_float")||(c=t.UNSIGNED_BYTE,l=!1);var v=e.size;if(l)u=0===e.offset&&e.data.length===v?e.data:e.data.subarray(e.offset,e.offset+v);else{var y=[o[2],o[2]*o[0],1];f=i.malloc(v,r);var x=n(f,o,y,0);"float32"!==r&&"float64"!==r||c!==t.UNSIGNED_BYTE?a.assign(x,e):h(x,e),u=f.subarray(0,v)}var b=m(t);return t.texImage2D(t.TEXTURE_2D,0,d,o[0],o[1],0,d,c,u),l||i.free(f),new p(t,b,o[0],o[1],d,c)}Object.defineProperties(d,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(l.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return f(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return f(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,f(this,this._shape[0],t),t}}}),d.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},d.dispose=function(){this.gl.deleteTexture(this.handle)},d.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},d.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=u(t)?t:t.raw;if(l){this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l)}else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,o,s,l,c,u){var f=u.dtype,p=u.shape.slice();if(p.length<2||p.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var d=0,m=0,v=g(p,u.stride.slice());"float32"===f?d=t.FLOAT:"float64"===f?(d=t.FLOAT,v=!1,f="float32"):"uint8"===f?d=t.UNSIGNED_BYTE:(d=t.UNSIGNED_BYTE,v=!1,f="uint8");if(2===p.length)m=t.LUMINANCE,p=[p[0],p[1],1],u=n(u.data,p,[u.stride[0],u.stride[1],1],u.offset);else{if(3!==p.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===p[2])m=t.ALPHA;else if(2===p[2])m=t.LUMINANCE_ALPHA;else if(3===p[2])m=t.RGB;else{if(4!==p[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");m=t.RGBA}p[2]}m!==t.LUMINANCE&&m!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(m=s);if(m!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=u.size,x=c.indexOf(o)<0;x&&c.push(o);if(d===l&&v)0===u.offset&&u.data.length===y?x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,u.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,u.data):x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,u.data.subarray(u.offset,u.offset+y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,u.data.subarray(u.offset,u.offset+y));else{var b;b=l===t.FLOAT?i.mallocFloat32(y):i.mallocUint8(y);var _=n(b,p,[p[2],p[2]*p[0],1]);d===t.FLOAT&&l===t.UNSIGNED_BYTE?h(_,u):a.assign(_,u),x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,b.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,b.subarray(0,y)),l===t.FLOAT?i.freeFloat32(b):i.freeUint8(b)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},{ndarray:448,"ndarray-ops":443,"typedarray-pool":547}],323:[function(t,e,r){(function(r){"use strict";var n=t("pick-by-alias");function a(t){if(t.container)if(t.container==document.body)document.body.style.width||(t.canvas.width=t.width||t.pixelRatio*r.innerWidth),document.body.style.height||(t.canvas.height=t.height||t.pixelRatio*r.innerHeight);else{var e=t.container.getBoundingClientRect();t.canvas.width=t.width||e.right-e.left,t.canvas.height=t.height||e.bottom-e.top}}function i(t){return"function"==typeof t.getContext&&"width"in t&&"height"in t}function o(){var t=document.createElement("canvas");return t.style.position="absolute",t.style.top=0,t.style.left=0,t}e.exports=function(t){var e;if(t?"string"==typeof t&&(t={container:t}):t={},i(t)?t={container:t}:t="string"==typeof(e=t).nodeName&&"function"==typeof e.appendChild&&"function"==typeof e.getBoundingClientRect?{container:t}:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(t)?{gl:t}:n(t,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0),t.pixelRatio||(t.pixelRatio=r.pixelRatio||1),t.gl)return t.gl;if(t.canvas&&(t.container=t.canvas.parentNode),t.container){if("string"==typeof t.container){var s=document.querySelector(t.container);if(!s)throw Error("Element "+t.container+" is not found");t.container=s}i(t.container)?(t.canvas=t.container,t.container=t.canvas.parentNode):t.canvas||(t.canvas=o(),t.container.appendChild(t.canvas),a(t))}else if(!t.canvas){if("undefined"==typeof document)throw Error("Not DOM environment. Use headless-gl.");t.container=document.body||document.documentElement,t.canvas=o(),t.container.appendChild(t.canvas),a(t)}if(!t.gl)try{t.gl=t.canvas.getContext("webgl",t.attrs)}catch(e){try{t.gl=t.canvas.getContext("experimental-webgl",t.attrs)}catch(e){t.gl=t.canvas.getContext("webgl-experimental",t.attrs)}}return t.gl}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"pick-by-alias":463}],324:[function(t,e,r){"use strict";e.exports=function(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var a=0;a<r.length;++a){var i=r[a];if(i.buffer){var o=i.buffer,s=i.size||4,l=i.type||t.FLOAT,c=!!i.normalized,u=i.stride||0,h=i.offset||0;o.bind(),t.enableVertexAttribArray(a),t.vertexAttribPointer(a,s,l,c,u,h)}else{if("number"==typeof i)t.vertexAttrib1f(a,i);else if(1===i.length)t.vertexAttrib1f(a,i[0]);else if(2===i.length)t.vertexAttrib2f(a,i[0],i[1]);else if(3===i.length)t.vertexAttrib3f(a,i[0],i[1],i[2]);else{if(4!==i.length)throw new Error("gl-vao: Invalid vertex attribute");t.vertexAttrib4f(a,i[0],i[1],i[2],i[3])}t.disableVertexAttribArray(a)}}for(;a<n;++a)t.disableVertexAttribArray(a)}else{t.bindBuffer(t.ARRAY_BUFFER,null);for(a=0;a<n;++a)t.disableVertexAttribArray(a)}}},{}],325:[function(t,e,r){"use strict";var n=t("./do-bind.js");function a(t){this.gl=t,this._elements=null,this._attributes=null,this._elementsType=t.UNSIGNED_SHORT}a.prototype.bind=function(){n(this.gl,this._elements,this._attributes)},a.prototype.update=function(t,e,r){this._elements=e,this._attributes=t,this._elementsType=r||this.gl.UNSIGNED_SHORT},a.prototype.dispose=function(){},a.prototype.unbind=function(){},a.prototype.draw=function(t,e,r){r=r||0;var n=this.gl;this._elements?n.drawElements(t,e,this._elementsType,r):n.drawArrays(t,r,e)},e.exports=function(t){return new a(t)}},{"./do-bind.js":324}],326:[function(t,e,r){"use strict";var n=t("./do-bind.js");function a(t,e,r,n,a,i){this.location=t,this.dimension=e,this.a=r,this.b=n,this.c=a,this.d=i}function i(t,e,r){this.gl=t,this._ext=e,this.handle=r,this._attribs=[],this._useElements=!1,this._elementsType=t.UNSIGNED_SHORT}a.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(),n(this.gl,e,t),this.unbind(),this._attribs.length=0,t)for(var i=0;i<t.length;++i){var o=t[i];"number"==typeof o?this._attribs.push(new a(i,1,o)):Array.isArray(o)&&this._attribs.push(new a(i,o.length,o[0],o[1],o[2],o[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=function(t,e){return new i(t,e,e.createVertexArrayOES())}},{"./do-bind.js":324}],327:[function(t,e,r){"use strict";var n=t("./lib/vao-native.js"),a=t("./lib/vao-emulated.js");function i(t){this.bindVertexArrayOES=t.bindVertexArray.bind(t),this.createVertexArrayOES=t.createVertexArray.bind(t),this.deleteVertexArrayOES=t.deleteVertexArray.bind(t)}e.exports=function(t,e,r,o){var s,l=t.createVertexArray?new i(t):t.getExtension("OES_vertex_array_object");return(s=l?n(t,l):a(t)).update(e,r,o),s}},{"./lib/vao-emulated.js":325,"./lib/vao-native.js":326}],328:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}},{}],329:[function(t,e,r){e.exports=function(t,e){var r=n(t[0],t[1],t[2]),o=n(e[0],e[1],e[2]);a(r,r),a(o,o);var s=i(r,o);return s>1?0:Math.acos(s)};var n=t("./fromValues"),a=t("./normalize"),i=t("./dot")},{"./dot":339,"./fromValues":345,"./normalize":356}],330:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}},{}],331:[function(t,e,r){e.exports=function(t){var e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},{}],332:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},{}],333:[function(t,e,r){e.exports=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}},{}],334:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=r[0],s=r[1],l=r[2];return t[0]=a*l-i*s,t[1]=i*o-n*l,t[2]=n*s-a*o,t}},{}],335:[function(t,e,r){e.exports=t("./distance")},{"./distance":336}],336:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],a=e[2]-t[2];return Math.sqrt(r*r+n*n+a*a)}},{}],337:[function(t,e,r){e.exports=t("./divide")},{"./divide":338}],338:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}},{}],339:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},{}],340:[function(t,e,r){e.exports=1e-6},{}],341:[function(t,e,r){e.exports=function(t,e){var r=t[0],a=t[1],i=t[2],o=e[0],s=e[1],l=e[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(a-s)<=n*Math.max(1,Math.abs(a),Math.abs(s))&&Math.abs(i-l)<=n*Math.max(1,Math.abs(i),Math.abs(l))};var n=t("./epsilon")},{"./epsilon":340}],342:[function(t,e,r){e.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}},{}],343:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}},{}],344:[function(t,e,r){e.exports=function(t,e,r,a,i,o){var s,l;e||(e=3);r||(r=0);l=a?Math.min(a*e+r,t.length):t.length;for(s=r;s<l;s+=e)n[0]=t[s],n[1]=t[s+1],n[2]=t[s+2],i(n,n,o),t[s]=n[0],t[s+1]=n[1],t[s+2]=n[2];return t};var n=t("./create")()},{"./create":333}],345:[function(t,e,r){e.exports=function(t,e,r){var n=new Float32Array(3);return n[0]=t,n[1]=e,n[2]=r,n}},{}],346:[function(t,e,r){e.exports={EPSILON:t("./epsilon"),create:t("./create"),clone:t("./clone"),angle:t("./angle"),fromValues:t("./fromValues"),copy:t("./copy"),set:t("./set"),equals:t("./equals"),exactEquals:t("./exactEquals"),add:t("./add"),subtract:t("./subtract"),sub:t("./sub"),multiply:t("./multiply"),mul:t("./mul"),divide:t("./divide"),div:t("./div"),min:t("./min"),max:t("./max"),floor:t("./floor"),ceil:t("./ceil"),round:t("./round"),scale:t("./scale"),scaleAndAdd:t("./scaleAndAdd"),distance:t("./distance"),dist:t("./dist"),squaredDistance:t("./squaredDistance"),sqrDist:t("./sqrDist"),length:t("./length"),len:t("./len"),squaredLength:t("./squaredLength"),sqrLen:t("./sqrLen"),negate:t("./negate"),inverse:t("./inverse"),normalize:t("./normalize"),dot:t("./dot"),cross:t("./cross"),lerp:t("./lerp"),random:t("./random"),transformMat4:t("./transformMat4"),transformMat3:t("./transformMat3"),transformQuat:t("./transformQuat"),rotateX:t("./rotateX"),rotateY:t("./rotateY"),rotateZ:t("./rotateZ"),forEach:t("./forEach")}},{"./add":328,"./angle":329,"./ceil":330,"./clone":331,"./copy":332,"./create":333,"./cross":334,"./dist":335,"./distance":336,"./div":337,"./divide":338,"./dot":339,"./epsilon":340,"./equals":341,"./exactEquals":342,"./floor":343,"./forEach":344,"./fromValues":345,"./inverse":347,"./len":348,"./length":349,"./lerp":350,"./max":351,"./min":352,"./mul":353,"./multiply":354,"./negate":355,"./normalize":356,"./random":357,"./rotateX":358,"./rotateY":359,"./rotateZ":360,"./round":361,"./scale":362,"./scaleAndAdd":363,"./set":364,"./sqrDist":365,"./sqrLen":366,"./squaredDistance":367,"./squaredLength":368,"./sub":369,"./subtract":370,"./transformMat3":371,"./transformMat4":372,"./transformQuat":373}],347:[function(t,e,r){e.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}},{}],348:[function(t,e,r){e.exports=t("./length")},{"./length":349}],349:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}},{}],350:[function(t,e,r){e.exports=function(t,e,r,n){var a=e[0],i=e[1],o=e[2];return t[0]=a+n*(r[0]-a),t[1]=i+n*(r[1]-i),t[2]=o+n*(r[2]-o),t}},{}],351:[function(t,e,r){e.exports=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}},{}],352:[function(t,e,r){e.exports=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}},{}],353:[function(t,e,r){e.exports=t("./multiply")},{"./multiply":354}],354:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}},{}],355:[function(t,e,r){e.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}},{}],356:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=r*r+n*n+a*a;i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i);return t}},{}],357:[function(t,e,r){e.exports=function(t,e){e=e||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,a=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*a,t[1]=Math.sin(r)*a,t[2]=n*e,t}},{}],358:[function(t,e,r){e.exports=function(t,e,r,n){var a=r[1],i=r[2],o=e[1]-a,s=e[2]-i,l=Math.sin(n),c=Math.cos(n);return t[0]=e[0],t[1]=a+o*c-s*l,t[2]=i+o*l+s*c,t}},{}],359:[function(t,e,r){e.exports=function(t,e,r,n){var a=r[0],i=r[2],o=e[0]-a,s=e[2]-i,l=Math.sin(n),c=Math.cos(n);return t[0]=a+s*l+o*c,t[1]=e[1],t[2]=i+s*c-o*l,t}},{}],360:[function(t,e,r){e.exports=function(t,e,r,n){var a=r[0],i=r[1],o=e[0]-a,s=e[1]-i,l=Math.sin(n),c=Math.cos(n);return t[0]=a+o*c-s*l,t[1]=i+o*l+s*c,t[2]=e[2],t}},{}],361:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}},{}],362:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}},{}],363:[function(t,e,r){e.exports=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}},{}],364:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}},{}],365:[function(t,e,r){e.exports=t("./squaredDistance")},{"./squaredDistance":367}],366:[function(t,e,r){e.exports=t("./squaredLength")},{"./squaredLength":368}],367:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],a=e[2]-t[2];return r*r+n*n+a*a}},{}],368:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}},{}],369:[function(t,e,r){e.exports=t("./subtract")},{"./subtract":370}],370:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}},{}],371:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2];return t[0]=n*r[0]+a*r[3]+i*r[6],t[1]=n*r[1]+a*r[4]+i*r[7],t[2]=n*r[2]+a*r[5]+i*r[8],t}},{}],372:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=r[3]*n+r[7]*a+r[11]*i+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*a+r[8]*i+r[12])/o,t[1]=(r[1]*n+r[5]*a+r[9]*i+r[13])/o,t[2]=(r[2]*n+r[6]*a+r[10]*i+r[14])/o,t}},{}],373:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*i-l*a,h=c*a+l*n-o*i,f=c*i+o*a-s*n,p=-o*n-s*a-l*i;return t[0]=u*c+p*-o+h*-l-f*-s,t[1]=h*c+p*-s+f*-o-u*-l,t[2]=f*c+p*-l+u*-s-h*-o,t}},{}],374:[function(t,e,r){e.exports=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}},{}],375:[function(t,e,r){e.exports=function(t){var e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},{}],376:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},{}],377:[function(t,e,r){e.exports=function(){var t=new Float32Array(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}},{}],378:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],a=e[2]-t[2],i=e[3]-t[3];return Math.sqrt(r*r+n*n+a*a+i*i)}},{}],379:[function(t,e,r){e.exports=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}},{}],380:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}},{}],381:[function(t,e,r){e.exports=function(t,e,r,n){var a=new Float32Array(4);return a[0]=t,a[1]=e,a[2]=r,a[3]=n,a}},{}],382:[function(t,e,r){e.exports={create:t("./create"),clone:t("./clone"),fromValues:t("./fromValues"),copy:t("./copy"),set:t("./set"),add:t("./add"),subtract:t("./subtract"),multiply:t("./multiply"),divide:t("./divide"),min:t("./min"),max:t("./max"),scale:t("./scale"),scaleAndAdd:t("./scaleAndAdd"),distance:t("./distance"),squaredDistance:t("./squaredDistance"),length:t("./length"),squaredLength:t("./squaredLength"),negate:t("./negate"),inverse:t("./inverse"),normalize:t("./normalize"),dot:t("./dot"),lerp:t("./lerp"),random:t("./random"),transformMat4:t("./transformMat4"),transformQuat:t("./transformQuat")}},{"./add":374,"./clone":375,"./copy":376,"./create":377,"./distance":378,"./divide":379,"./dot":380,"./fromValues":381,"./inverse":383,"./length":384,"./lerp":385,"./max":386,"./min":387,"./multiply":388,"./negate":389,"./normalize":390,"./random":391,"./scale":392,"./scaleAndAdd":393,"./set":394,"./squaredDistance":395,"./squaredLength":396,"./subtract":397,"./transformMat4":398,"./transformQuat":399}],383:[function(t,e,r){e.exports=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}},{}],384:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],a=t[3];return Math.sqrt(e*e+r*r+n*n+a*a)}},{}],385:[function(t,e,r){e.exports=function(t,e,r,n){var a=e[0],i=e[1],o=e[2],s=e[3];return t[0]=a+n*(r[0]-a),t[1]=i+n*(r[1]-i),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t}},{}],386:[function(t,e,r){e.exports=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}},{}],387:[function(t,e,r){e.exports=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}},{}],388:[function(t,e,r){e.exports=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}},{}],389:[function(t,e,r){e.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}},{}],390:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=r*r+n*n+a*a+i*i;o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=a*o,t[3]=i*o);return t}},{}],391:[function(t,e,r){var n=t("./normalize"),a=t("./scale");e.exports=function(t,e){return e=e||1,t[0]=Math.random(),t[1]=Math.random(),t[2]=Math.random(),t[3]=Math.random(),n(t,t),a(t,t,e),t}},{"./normalize":390,"./scale":392}],392:[function(t,e,r){e.exports=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}},{}],393:[function(t,e,r){e.exports=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}},{}],394:[function(t,e,r){e.exports=function(t,e,r,n,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=a,t}},{}],395:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],a=e[2]-t[2],i=e[3]-t[3];return r*r+n*n+a*a+i*i}},{}],396:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],a=t[3];return e*e+r*r+n*n+a*a}},{}],397:[function(t,e,r){e.exports=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}},{}],398:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=e[3];return t[0]=r[0]*n+r[4]*a+r[8]*i+r[12]*o,t[1]=r[1]*n+r[5]*a+r[9]*i+r[13]*o,t[2]=r[2]*n+r[6]*a+r[10]*i+r[14]*o,t[3]=r[3]*n+r[7]*a+r[11]*i+r[15]*o,t}},{}],399:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*i-l*a,h=c*a+l*n-o*i,f=c*i+o*a-s*n,p=-o*n-s*a-l*i;return t[0]=u*c+p*-o+h*-l-f*-s,t[1]=h*c+p*-s+f*-o-u*-l,t[2]=f*c+p*-l+u*-s-h*-o,t[3]=e[3],t}},{}],400:[function(t,e,r){var n=t("glsl-tokenizer"),a=t("atob-lite");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r<e.length;r++){var i=e[r];if("preprocessor"===i.type){var o=i.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()}}}}},{"atob-lite":75,"glsl-tokenizer":407}],401:[function(t,e,r){e.exports=function(t){var e,r,c,u=0,h=0,f=999,p=[],d=[],g=1,m=0,v=0,y=!1,x=!1,b="",_=i,w=n;"300 es"===(t=t||{}).version&&(_=s,w=o);var T={},k={};for(u=0;u<_.length;u++)T[_[u]]=!0;for(u=0;u<w.length;u++)k[w[u]]=!0;return function(t){return d=[],null!==t?function(t){u=0,t.toString&&(t=t.toString());var r;b+=t.replace(/\r\n/g,"\n"),c=b.length;for(;e=b[u],u<c;){switch(r=u,f){case 0:u=C();break;case 1:case 2:u=E();break;case 3:u=L();break;case 4:u=z();break;case 11:u=I();break;case 5:u=O();break;case 9999:u=D();break;case 9:u=S();break;case 999:u=M()}if(r!==u)switch(b[r]){case"\n":m=0,++g;break;default:++m}}return h+=u,b=b.slice(u),d}(t):function(t){p.length&&A(p.join(""));return f=10,A("(eof)"),d}()};function A(t){t.length&&d.push({type:l[f],data:t,position:v,line:g,column:m})}function M(){return p=p.length?[]:p,"/"===r&&"*"===e?(v=h+u-1,f=0,r=e,u+1):"/"===r&&"/"===e?(v=h+u-1,f=1,r=e,u+1):"#"===e?(f=2,v=h+u,u):/\s/.test(e)?(f=9,v=h+u,u):(y=/\d/.test(e),x=/[^\w_]/.test(e),v=h+u,f=y?4:x?3:9999,u)}function S(){return/[^\s]/g.test(e)?(A(p.join("")),f=999,u):(p.push(e),r=e,u+1)}function E(){return"\r"!==e&&"\n"!==e||"\\"===r?(p.push(e),r=e,u+1):(A(p.join("")),f=999,u)}function C(){return"/"===e&&"*"===r?(p.push(e),A(p.join("")),f=999,u+1):(p.push(e),r=e,u+1)}function L(){if("."===r&&/\d/.test(e))return f=5,u;if("/"===r&&"*"===e)return f=0,u;if("/"===r&&"/"===e)return f=1,u;if("."===e&&p.length){for(;P(p););return f=5,u}if(";"===e||")"===e||"("===e){if(p.length)for(;P(p););return A(e),f=999,u+1}var t=2===p.length&&"="!==e;if(/[\w_\d\s]/.test(e)||t){for(;P(p););return f=999,u}return p.push(e),r=e,u+1}function P(t){for(var e,r,n=0;;){if(e=a.indexOf(t.slice(0,t.length+n).join("")),r=a[e],-1===e){if(n--+t.length>0)continue;r=t.slice(0,1).join("")}return A(r),v+=r.length,(p=p.slice(r.length)).length}}function I(){return/[^a-fA-F0-9]/.test(e)?(A(p.join("")),f=999,u):(p.push(e),r=e,u+1)}function z(){return"."===e||/[eE]/.test(e)?(p.push(e),f=5,r=e,u+1):"x"===e&&1===p.length&&"0"===p[0]?(f=11,p.push(e),r=e,u+1):/[^\d]/.test(e)?(A(p.join("")),f=999,u):(p.push(e),r=e,u+1)}function O(){return"f"===e&&(p.push(e),r=e,u+=1),/[eE]/.test(e)?(p.push(e),r=e,u+1):("-"!==e&&"+"!==e||!/[eE]/.test(r))&&/[^\d]/.test(e)?(A(p.join("")),f=999,u):(p.push(e),r=e,u+1)}function D(){if(/[^\d\w_]/.test(e)){var t=p.join("");return f=k[t]?8:T[t]?7:6,A(p.join("")),f=999,u}return p.push(e),r=e,u+1}};var n=t("./lib/literals"),a=t("./lib/operators"),i=t("./lib/builtins"),o=t("./lib/literals-300es"),s=t("./lib/builtins-300es"),l=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":403,"./lib/builtins-300es":402,"./lib/literals":405,"./lib/literals-300es":404,"./lib/operators":406}],402:[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":403}],403:[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"]},{}],404:[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","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":405}],405:[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","uint","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"]},{}],406:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],407:[function(t,e,r){var n=t("./index");e.exports=function(t,e){var r=n(e),a=[];return a=(a=a.concat(r(t))).concat(r(null))}},{"./index":401}],408:[function(t,e,r){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n<t.length-1;n++)r.push(t[n],e[n]||"");return r.push(t[n]),r.join("")}},{}],409:[function(t,e,r){(function(r){"use strict";var n,a=t("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:a,e.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":417}],410:[function(t,e,r){"use strict";var n=t("is-browser");e.exports=n&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}()},{"is-browser":417}],411:[function(t,e,r){r.read=function(t,e,r,n,a){var i,o,s=8*a-n-1,l=(1<<s)-1,c=l>>1,u=-7,h=r?a-1:0,f=r?-1:1,p=t[e+h];for(h+=f,i=p&(1<<-u)-1,p>>=-u,u+=s;u>0;i=256*i+t[e+h],h+=f,u-=8);for(o=i&(1<<-u)-1,i>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=f,u-=8);if(0===i)i=1-c;else{if(i===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),i-=c}return(p?-1:1)*o*Math.pow(2,i-n)},r.write=function(t,e,r,n,a,i){var o,s,l,c=8*i-a-1,u=(1<<c)-1,h=u>>1,f=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(e*l-1)*Math.pow(2,a),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,a),o=0));a>=8;t[r+p]=255&s,p+=d,s/=256,a-=8);for(o=o<<a|s,c+=a;c>0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*g}},{}],412:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.length;if(0===r)throw new Error("Must have at least d+1 points");var a=t[0].length;if(r<=a)throw new Error("Must input at least d+1 points");var o=t.slice(0,a+1),s=n.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var l=new Array(a+1),u=0;u<=a;++u)l[u]=u;s<0&&(l[0]=1,l[1]=0);var h=new i(l,new Array(a+1),!1),f=h.adjacent,p=new Array(a+2);for(u=0;u<=a;++u){for(var d=l.slice(),g=0;g<=a;++g)g===u&&(d[g]=-1);var m=d[0];d[0]=d[1],d[1]=m;var v=new i(d,new Array(a+1),!0);f[u]=v,p[u]=v}p[a+1]=h;for(u=0;u<=a;++u){d=f[u].vertices;var y=f[u].adjacent;for(g=0;g<=a;++g){var x=d[g];if(x<0)y[g]=h;else for(var b=0;b<=a;++b)f[b].vertices.indexOf(x)<0&&(y[g]=f[b])}}var _=new c(a,o,p),w=!!e;for(u=a+1;u<r;++u)_.insert(t[u],w);return _.boundary()};var n=t("robust-orientation"),a=t("simplicial-complex").compareCells;function i(t,e,r){this.vertices=t,this.adjacent=e,this.boundary=r,this.lastVisited=-1}function o(t,e,r){this.vertices=t,this.cell=e,this.index=r}function s(t,e){return a(t.vertices,e.vertices)}i.prototype.flip=function(){var t=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=t;var e=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=e};var l=[];function c(t,e,r){this.dimension=t,this.vertices=e,this.simplices=r,this.interior=r.filter((function(t){return!t.boundary})),this.tuple=new Array(t+1);for(var a=0;a<=t;++a)this.tuple[a]=this.vertices[a];var i=l[t];i||(i=l[t]=function(t){for(var e=["function orient(){var tuple=this.tuple;return test("],r=0;r<=t;++r)r>0&&e.push(","),e.push("tuple[",r,"]");e.push(")}return orient");var a=new Function("test",e.join("")),i=n[t+1];return i||(i=n),a(i)}(t)),this.orient=i}var u=c.prototype;u.handleBoundaryDegeneracy=function(t,e){var r=this.dimension,n=this.vertices.length-1,a=this.tuple,i=this.vertices,o=[t];for(t.lastVisited=-n;o.length>0;){(t=o.pop()).vertices;for(var s=t.adjacent,l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,h=0;h<=r;++h){var f=u[h];a[h]=f<0?e:i[f]}var p=this.orient();if(p>0)return c;c.lastVisited=-n,0===p&&o.push(c)}}}return null},u.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,a=this.vertices,i=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,c=s.adjacent,u=0;u<=n;++u)i[u]=a[l[u]];s.lastVisited=r;for(u=0;u<=n;++u){var h=c[u];if(!(h.lastVisited>=r)){var f=i[u];i[u]=t;var p=this.orient();if(i[u]=f,p<0){s=h;continue t}h.boundary?h.lastVisited=-r:h.lastVisited=r}}return}return s},u.addPeaks=function(t,e){var r=this.vertices.length-1,n=this.dimension,a=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,h=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,c.push(e);for(var f=[];h.length>0;){var p=(e=h.pop()).vertices,d=e.adjacent,g=p.indexOf(r);if(!(g<0))for(var m=0;m<=n;++m)if(m!==g){var v=d[m];if(v.boundary&&!(v.lastVisited>=r)){var y=v.vertices;if(v.lastVisited!==-r){for(var x=0,b=0;b<=n;++b)y[b]<0?(x=b,l[b]=t):l[b]=a[y[b]];if(this.orient()>0){y[x]=r,v.boundary=!1,c.push(v),h.push(v),v.lastVisited=r;continue}v.lastVisited=-r}var _=v.adjacent,w=p.slice(),T=d.slice(),k=new i(w,T,!0);u.push(k);var A=_.indexOf(e);if(!(A<0)){_[A]=k,T[g]=v,w[m]=-1,T[m]=e,d[m]=k,k.flip();for(b=0;b<=n;++b){var M=w[b];if(!(M<0||M===r)){for(var S=new Array(n-1),E=0,C=0;C<=n;++C){var L=w[C];L<0||C===b||(S[E++]=L)}f.push(new o(S,k,b))}}}}}}f.sort(s);for(m=0;m+1<f.length;m+=2){var P=f[m],I=f[m+1],z=P.index,O=I.index;z<0||O<0||(P.cell.adjacent[P.index]=I.cell,I.cell.adjacent[I.index]=P.cell)}},u.insert=function(t,e){var r=this.vertices;r.push(t);var n=this.walk(t,e);if(n){for(var a=this.dimension,i=this.tuple,o=0;o<=a;++o){var s=n.vertices[o];i[o]=s<0?t:r[s]}var l=this.orient(i);l<0||(0!==l||(n=this.handleBoundaryDegeneracy(n,t)))&&this.addPeaks(t,n)}},u.boundary=function(){for(var t=this.dimension,e=[],r=this.simplices,n=r.length,a=0;a<n;++a){var i=r[a];if(i.boundary){for(var o=new Array(t),s=i.vertices,l=0,c=0,u=0;u<=t;++u)s[u]>=0?o[l++]=s[u]:c=1&u;if(c===(1&t)){var h=o[0];o[0]=o[1],o[1]=h}e.push(o)}}return e}},{"robust-orientation":500,"simplicial-complex":510}],413:[function(t,e,r){"use strict";var n=t("binary-search-bounds");function a(t,e,r,n,a){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=a,this.count=(e?e.count:0)+(r?r.count:0)+n.length}e.exports=function(t){if(!t||0===t.length)return new v(null);return new v(m(t))};var i=a.prototype;function o(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 s(t,e){var r=m(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 l(t,e){var r=t.intervals([]);r.push(e),s(t,r)}function c(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?0:(r.splice(n,1),s(t,r),1)}function u(t,e,r){for(var n=0;n<t.length&&t[n][0]<=e;++n){var a=r(t[n]);if(a)return a}}function h(t,e,r){for(var n=t.length-1;n>=0&&t[n][1]>=e;--n){var a=r(t[n]);if(a)return a}}function f(t,e){for(var r=0;r<t.length;++r){var n=e(t[r]);if(n)return n}}function p(t,e){return t-e}function d(t,e){var r=t[0]-e[0];return r||t[1]-e[1]}function g(t,e){var r=t[1]-e[1];return r||t[0]-e[0]}function m(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(p);var n=e[e.length>>1],i=[],o=[],s=[];for(r=0;r<t.length;++r){var l=t[r];l[1]<n?i.push(l):n<l[0]?o.push(l):s.push(l)}var c=s,u=s.slice();return c.sort(d),u.sort(g),new a(n,m(i),m(o),c,u)}function v(t){this.root=t}i.intervals=function(t){return t.push.apply(t,this.leftPoints),this.left&&this.left.intervals(t),this.right&&this.right.intervals(t),t},i.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)?l(this,t):this.left.insert(t):this.left=m([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?l(this,t):this.right.insert(t):this.right=m([t]);else{var r=n.ge(this.leftPoints,t,d),a=n.ge(this.rightPoints,t,g);this.leftPoints.splice(r,0,t),this.rightPoints.splice(a,0,t)}},i.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)?c(this,t):2===(s=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?c(this,t):2===(s=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,a=this.left;a.right;)r=a,a=a.right;if(r===this)a.right=this.right;else{var i=this.left,s=this.right;r.count-=a.count,r.right=a.left,a.left=i,a.right=s}o(this,a),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(i=n.ge(this.leftPoints,t,d);i<this.leftPoints.length&&this.leftPoints[i][0]===t[0];++i)if(this.leftPoints[i]===t){this.count-=1,this.leftPoints.splice(i,1);for(s=n.ge(this.rightPoints,t,g);s<this.rightPoints.length&&this.rightPoints[s][1]===t[1];++s)if(this.rightPoints[s]===t)return this.rightPoints.splice(s,1),1}return 0},i.queryPoint=function(t,e){if(t<this.mid){if(this.left)if(r=this.left.queryPoint(t,e))return r;return u(this.leftPoints,t,e)}if(t>this.mid){var r;if(this.right)if(r=this.right.queryPoint(t,e))return r;return h(this.rightPoints,t,e)}return f(this.leftPoints,e)},i.queryInterval=function(t,e,r){var n;if(t<this.mid&&this.left&&(n=this.left.queryInterval(t,e,r)))return n;if(e>this.mid&&this.right&&(n=this.right.queryInterval(t,e,r)))return n;return e<this.mid?u(this.leftPoints,e,r):t>this.mid?h(this.rightPoints,t,r):f(this.leftPoints,r)};var y=v.prototype;y.insert=function(t){this.root?this.root.insert(t):this.root=new a(t[0],null,null,[t],[t])},y.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),0!==e}return!1},y.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},y.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(y,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(y,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":414}],414:[function(t,e,r){arguments[4][238][0].apply(r,arguments)},{dup:238}],415:[function(t,e,r){"use strict";e.exports=function(t,e){e=e||new Array(t.length);for(var r=0;r<t.length;++r)e[t[r]]=r;return e}},{}],416:[function(t,e,r){"use strict";e.exports=function(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=r;return e}},{}],417:[function(t,e,r){e.exports=!0},{}],418:[function(t,e,r){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
e.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},{}],419:[function(t,e,r){"use strict";e.exports="undefined"!=typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))},{}],420:[function(t,e,r){"use strict";e.exports=i,e.exports.isMobile=i,e.exports.default=i;var n=/(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[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,a=/(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[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i;function i(t){t||(t={});var e=t.ua;if(e||"undefined"==typeof navigator||(e=navigator.userAgent),e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),"string"!=typeof e)return!1;var r=t.tablet?a.test(e):n.test(e);return!r&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==e.indexOf("Macintosh")&&-1!==e.indexOf("Safari")&&(r=!0),r}},{}],421:[function(t,e,r){"use strict";e.exports=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}},{}],422:[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({}))}},{}],423:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=0;n<r;n++)if(((e=t.charCodeAt(n))<9||e>13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}},{}],424:[function(t,e,r){"use strict";e.exports=function(t){return"string"==typeof t&&(t=t.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(t)&&/[\dz]$/i.test(t)&&t.length>4))}},{}],425:[function(t,e,r){e.exports=function(t,e,r){return t*(1-r)+e*r}},{}],426:[function(t,e,r){!function(t,n){"object"==typeof r&&"undefined"!=typeof e?e.exports=n():(t=t||self).mapboxgl=n()}(this,(function(){"use strict";var t,e,r;function n(n,a){if(t)if(e){var i="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",o={};t(o),(r=a(o)).workerUrl=window.URL.createObjectURL(new Blob([i],{type:"text/javascript"}))}else e=a;else t=a}return n(0,(function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=n;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}n.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},n.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},n.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},n.prototype.solveCurveX=function(t,e){var r,n,a,i,o;for(void 0===e&&(e=1e-6),a=t,o=0;o<8;o++){if(i=this.sampleCurveX(a)-t,Math.abs(i)<e)return a;var s=this.sampleCurveDerivativeX(a);if(Math.abs(s)<1e-6)break;a-=i/s}if((a=t)<(r=0))return r;if(a>(n=1))return n;for(;r<n;){if(i=this.sampleCurveX(a),Math.abs(i-t)<e)return a;t>i?r=a:n=a,a=.5*(n-r)+r}return a},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var a=i;function i(t,e){this.x=t,this.y=e}function o(t,e,n,a){var i=new r(t,e,n,a);return function(t){return i.solve(t)}}i.prototype={clone:function(){return new i(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(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)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},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[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,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},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,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=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),a=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-n*(this.y-e.y),this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},i.convert=function(t){return t instanceof i?t:Array.isArray(t)?new i(t[0],t[1]):t};var s=o(.25,.1,.25,1);function l(t,e,r){return Math.min(r,Math.max(e,t))}function c(t,e,r){var n=r-e,a=((t-e)%n+n)%n+e;return a===e?r:a}function u(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,a=e;n<a.length;n+=1){var i=a[n];for(var o in i)t[o]=i[o]}return t}var h=1;function f(){return h++}function p(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function d(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function g(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function m(t,e){return-1!==t.indexOf(e,t.length-e.length)}function v(t,e,r){var n={};for(var a in t)n[a]=e.call(r||this,t[a],a,t);return n}function y(t,e,r){var n={};for(var a in t)e.call(r||this,t[a],a,t)&&(n[a]=t[a]);return n}function x(t){return Array.isArray(t)?t.map(x):"object"==typeof t&&t?v(t,x):t}var b={};function _(t){b[t]||("undefined"!=typeof console&&console.warn(t),b[t]=!0)}function w(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function T(t){for(var e=0,r=0,n=t.length,a=n-1,i=void 0,o=void 0;r<n;a=r++)e+=((o=t[a]).x-(i=t[r]).x)*(i.y+o.y);return e}function k(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function A(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,a){var i=n||a;return e[r]=!i||i.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var M=null;function S(t){if(null==M){var e=t.navigator?t.navigator.userAgent:null;M=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return M}function E(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var C,L,P,I,z=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),O=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,D=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,R={now:z,frame:function(t){var e=O(t);return{cancel:function(){return D(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=self.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return C||(C=self.document.createElement("a")),C.href=t,C.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return!!self.matchMedia&&(null==L&&(L=self.matchMedia("(prefers-reduced-motion: reduce)")),L.matches)}},F={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},B={supported:!1,testSupport:function(t){!N&&I&&(j?V(t):P=t)}},N=!1,j=!1;function V(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,I),t.isContextLost())return;B.supported=!0}catch(t){}t.deleteTexture(e),N=!0}self.document&&((I=self.document.createElement("img")).onload=function(){P&&V(P),P=null,j=!0},I.onerror=function(){N=!0,P=null},I.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var U="01",q=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function H(t){return 0===t.indexOf("mapbox:")}q.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",U,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},q.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},q.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},q.prototype.normalizeStyleURL=function(t,e){if(!H(t))return t;var r=Z(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeGlyphsURL=function(t,e){if(!H(t))return t;var r=Z(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeSourceURL=function(t,e){if(!H(t))return t;var r=Z(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeSpriteURL=function(t,e,r,n){var a=Z(t);return H(t)?(a.path="/styles/v1"+a.path+"/sprite"+e+r,this._makeAPIURL(a,this._customAccessToken||n)):(a.path+=""+e+r,X(a))},q.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!H(t))return t;var r=Z(t);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(R.devicePixelRatio>=2||512===e?"@2x":"")+(B.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var n=this._customAccessToken||function(t){for(var e=0,r=t;e<r.length;e+=1){var n=r[e].match(/^access_token=(.*)$/);if(n)return n[1]}return null}(r.params)||F.ACCESS_TOKEN;return F.REQUIRE_ACCESS_TOKEN&&n&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,n)},q.prototype.canonicalizeTileURL=function(t,e){var r=Z(t);if(!r.path.match(/(^\/v4\/)/)||!r.path.match(/\.[\w]+$/))return t;var n="mapbox://tiles/";n+=r.path.replace("/v4/","");var a=r.params;return e&&(a=a.filter((function(t){return!t.match(/^access_token=/)}))),a.length&&(n+="?"+a.join("&")),n},q.prototype.canonicalizeTileset=function(t,e){for(var r=!!e&&H(e),n=[],a=0,i=t.tiles||[];a<i.length;a+=1){var o=i[a];Y(o)?n.push(this.canonicalizeTileURL(o,r)):n.push(o)}return n},q.prototype._makeAPIURL=function(t,e){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",n=Z(F.API_URL);if(t.protocol=n.protocol,t.authority=n.authority,"/"!==n.path&&(t.path=""+n.path+t.path),!F.REQUIRE_ACCESS_TOKEN)return X(t);if(!(e=e||F.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),X(t)};var G=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Y(t){return G.test(t)}var W=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Z(t){var e=t.match(W);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function X(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function J(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(self.atob(e[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}var K=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};K.prototype.getStorageKey=function(t){var e,r=J(F.ACCESS_TOKEN);return e=r&&r.u?self.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))}))):F.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+e:"mapbox.eventData:"+e},K.prototype.fetchEventData=function(){var t=E("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var n=self.localStorage.getItem(e);n&&(this.eventData=JSON.parse(n));var a=self.localStorage.getItem(r);a&&(this.anonId=a)}catch(t){_("Unable to read from LocalStorage")}},K.prototype.saveEventData=function(){var t=E("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{self.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){_("Unable to write to LocalStorage")}},K.prototype.processRequests=function(t){},K.prototype.postEvent=function(t,e,r,n){var a=this;if(F.EVENTS_URL){var i=Z(F.EVENTS_URL);i.params.push("access_token="+(n||F.ACCESS_TOKEN||""));var o={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.10.1",skuId:U,userId:this.anonId},s=e?u(o,e):o,l={url:X(i),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=xt(l,(function(t){a.pendingRequest=null,r(t),a.saveEventData(),a.processRequests(n)}))}},K.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var Q,$,tt=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(F.EVENTS_URL&&n||F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return H(t)||Y(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,a=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),d(this.anonId)||(this.anonId=p()),this.postEvent(a,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}(K),et=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postTurnstileEvent=function(t,e){F.EVENTS_URL&&F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return H(t)||Y(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=J(F.ACCESS_TOKEN),n=r?r.u:F.ACCESS_TOKEN,a=n!==this.eventData.tokenU;d(this.anonId)||(this.anonId=p(),a=!0);var i=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(i),l=(i-this.eventData.lastSuccess)/864e5;a=a||l>=1||l<-1||o.getDate()!==s.getDate()}else a=!0;if(!a)return this.processRequests();this.postEvent(i,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=i,e.eventData.tokenU=n)}),t)}},e}(K)),rt=et.postTurnstileEvent.bind(et),nt=new tt,at=nt.postMapLoadEvent.bind(nt),it=500,ot=50;function st(){self.caches&&!Q&&(Q=self.caches.open("mapbox-tiles"))}function lt(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var ct,ut=1/0;function ht(){return null==ct&&(ct=self.OffscreenCanvas&&new self.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),ct}var ft={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(ft);var pt,dt,gt=function(t){function e(e,r,n){401===r&&Y(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),mt=k()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===self.location.protocol?self.parent:self).location.href},vt=function(t,e){if(!(/^file:/.test(r=t.url)||/^file:/.test(mt())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return function(t,e){var r,n=new self.AbortController,a=new self.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:mt(),signal:n.signal}),i=!1,o=!1,s=(r=a.url).indexOf("sku=")>0&&Y(r);"json"===t.type&&a.headers.set("Accept","application/json");var l=function(r,n,i){if(!o){if(r&&"SecurityError"!==r.message&&_(r),n&&i)return c(n);var l=Date.now();self.fetch(a).then((function(r){if(r.ok){var n=s?r.clone():null;return c(r,n,l)}return e(new gt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},c=function(r,n,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){o||(n&&s&&function(t,e,r){if(st(),Q){var n={status:e.status,statusText:e.statusText,headers:new self.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var a=A(e.headers.get("Cache-Control")||"");a["no-store"]||(a["max-age"]&&n.headers.set("Expires",new Date(r+1e3*a["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===$)try{new Response(new ReadableStream),$=!0}catch(t){$=!1}$?e(t.body):t.blob().then(e)}(e,(function(e){var r=new self.Response(e,n);st(),Q&&Q.then((function(e){return e.put(lt(t.url),r)})).catch((function(t){return _(t.message)}))})))}}(a,n,s),i=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){o||e(new Error(t.message))}))};return s?function(t,e){if(st(),!Q)return e(null);var r=lt(t.url);Q.then((function(t){t.match(r).then((function(n){var a=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=A(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),a&&t.put(r,n.clone()),e(null,n,a)})).catch(e)})).catch(e)}(a,l):l(null,null),{cancel:function(){o=!0,i||n.abort()}}}(t,e);if(k()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){var r=new self.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new gt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},yt=function(t,e){return vt(u(t,{type:"arrayBuffer"}),e)},xt=function(t,e){return vt(u(t,{method:"POST"}),e)};pt=[],dt=0;var bt=function(t,e){if(B.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),dt>=F.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return pt.push(r),r}dt++;var n=!1,a=function(){if(!n)for(n=!0,dt--;pt.length&&dt<F.MAX_PARALLEL_IMAGE_REQUESTS;){var t=pt.shift();t.cancelled||(t.cancel=bt(t.requestParameters,t.callback).cancel)}},i=yt(t,(function(t,r,n,i){a(),t?e(t):r&&(ht()?function(t,e){var r=new self.Blob([new Uint8Array(t)],{type:"image/png"});self.createImageBitmap(r).then((function(t){e(null,t)})).catch((function(t){e(new Error("Could not load image because of "+t.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}))}(r,e):function(t,e,r,n){var a=new self.Image,i=self.URL;a.onload=function(){e(null,a),i.revokeObjectURL(a.src)},a.onerror=function(){return e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var o=new self.Blob([new Uint8Array(t)],{type:"image/png"});a.cacheControl=r,a.expires=n,a.src=t.byteLength?i.createObjectURL(o):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}(r,e,n,i))}));return{cancel:function(){i.cancel(),a()}}};function _t(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function wt(t,e,r){if(r&&r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}var Tt=function(t,e){void 0===e&&(e={}),u(this,e),this.type=t},kt=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",u({error:e},r))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Tt),At=function(){};At.prototype.on=function(t,e){return this._listeners=this._listeners||{},_t(t,e,this._listeners),this},At.prototype.off=function(t,e){return wt(t,e,this._listeners),wt(t,e,this._oneTimeListeners),this},At.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},_t(t,e,this._oneTimeListeners),this},At.prototype.fire=function(t,e){"string"==typeof t&&(t=new Tt(t,e||{}));var r=t.type;if(this.listens(r)){t.target=this;for(var n=0,a=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];n<a.length;n+=1)a[n].call(this,t);for(var i=0,o=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];i<o.length;i+=1){var s=o[i];wt(r,s,this._oneTimeListeners),s.call(this,t)}var l=this._eventedParent;l&&(u(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),l.fire(t))}else t instanceof kt&&console.error(t.error);return this},At.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},At.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Mt={$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"},light:{type:"light"},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_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},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:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},St=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Et(t){var e=t.value;return e?[new St(t.key,e,"constants have been deprecated as of v8")]:[]}function Ct(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,a=e;n<a.length;n+=1){var i=a[n];for(var o in i)t[o]=i[o]}return t}function Lt(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Pt(t){if(Array.isArray(t))return t.map(Pt);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=Pt(t[r]);return e}return Lt(t)}var It=function(t){function e(e,r){t.call(this,r),this.message=r,this.key=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Error),zt=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,n=e;r<n.length;r+=1){var a=n[r];this.bindings[a[0]]=a[1]}};zt.prototype.concat=function(t){return new zt(this,t)},zt.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},zt.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var Ot={kind:"null"},Dt={kind:"number"},Rt={kind:"string"},Ft={kind:"boolean"},Bt={kind:"color"},Nt={kind:"object"},jt={kind:"value"},Vt={kind:"collator"},Ut={kind:"formatted"},qt={kind:"resolvedImage"};function Ht(t,e){return{kind:"array",itemType:t,N:e}}function Gt(t){if("array"===t.kind){var e=Gt(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Yt=[Ot,Dt,Rt,Ft,Bt,Ut,Nt,Ht(jt),qt];function Wt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Wt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=Yt;r<n.length;r+=1)if(!Wt(n[r],e))return null}return"Expected "+Gt(t)+" but found "+Gt(e)+" instead."}function Zt(t,e){return e.some((function(e){return e.kind===t.kind}))}function Xt(t,e){return e.some((function(e){return"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t}))}var Jt=e((function(t,e){var r={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function a(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function i(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function o(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,s=t.replace(/ /g,"").toLowerCase();if(s in r)return r[s].slice();if("#"===s[0])return 4===s.length?(e=parseInt(s.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===s.length&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=s.indexOf("("),c=s.indexOf(")");if(-1!==l&&c+1===s.length){var u=s.substr(0,l),h=s.substr(l+1,c-(l+1)).split(","),f=1;switch(u){case"rgba":if(4!==h.length)return null;f=i(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=i(h.pop());case"hsl":if(3!==h.length)return null;var p=(parseFloat(h[0])%360+360)%360/360,d=i(h[1]),g=i(h[2]),m=g<=.5?g*(d+1):g+d-g*d,v=2*g-m;return[n(255*o(v,m,p+1/3)),n(255*o(v,m,p)),n(255*o(v,m,p-1/3)),f];default:return null}}return null}}catch(t){}})).parseCSSColor,Kt=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};Kt.parse=function(t){if(t){if(t instanceof Kt)return t;if("string"==typeof t){var e=Jt(t);if(e)return new Kt(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},Kt.prototype.toString=function(){var t=this.toArray(),e=t[1],r=t[2],n=t[3];return"rgba("+Math.round(t[0])+","+Math.round(e)+","+Math.round(r)+","+n+")"},Kt.prototype.toArray=function(){var t=this.a;return 0===t?[0,0,0,0]:[255*this.r/t,255*this.g/t,255*this.b/t,t]},Kt.black=new Kt(0,0,0,1),Kt.white=new Kt(1,1,1,1),Kt.transparent=new Kt(0,0,0,0),Kt.red=new Kt(1,0,0,1);var Qt=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Qt.prototype.compare=function(t,e){return this.collator.compare(t,e)},Qt.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var $t=function(t,e,r,n,a){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=a},te=function(t){this.sections=t};te.fromString=function(t){return new te([new $t(t,null,null,null,null)])},te.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},te.factory=function(t){return t instanceof te?t:te.fromString(t)},te.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},te.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];if(n.image)t.push(["image",n.image.name]);else{t.push(n.text);var a={};n.fontStack&&(a["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(a["font-scale"]=n.scale),n.textColor&&(a["text-color"]=["rgba"].concat(n.textColor.toArray())),t.push(a)}}return t};var ee=function(t){this.name=t.name,this.available=t.available};function re(t,e,r,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ne(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof Kt)return!0;if(t instanceof Qt)return!0;if(t instanceof te)return!0;if(t instanceof ee)return!0;if(Array.isArray(t)){for(var e=0,r=t;e<r.length;e+=1)if(!ne(r[e]))return!1;return!0}if("object"==typeof t){for(var n in t)if(!ne(t[n]))return!1;return!0}return!1}function ae(t){if(null===t)return Ot;if("string"==typeof t)return Rt;if("boolean"==typeof t)return Ft;if("number"==typeof t)return Dt;if(t instanceof Kt)return Bt;if(t instanceof Qt)return Vt;if(t instanceof te)return Ut;if(t instanceof ee)return qt;if(Array.isArray(t)){for(var e,r=t.length,n=0,a=t;n<a.length;n+=1){var i=ae(a[n]);if(e){if(e===i)continue;e=jt;break}e=i}return Ht(e||jt,r)}return Nt}function ie(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Kt||t instanceof te||t instanceof ee?t.toString():JSON.stringify(t)}ee.prototype.toString=function(){return this.name},ee.fromString=function(t){return t?new ee({name:t,available:!1}):null},ee.prototype.serialize=function(){return["image",this.name]};var oe=function(t,e){this.type=t,this.value=e};oe.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!ne(t[1]))return e.error("invalid value");var r=t[1],n=ae(r),a=e.expectedType;return"array"!==n.kind||0!==n.N||!a||"array"!==a.kind||"number"==typeof a.N&&0!==a.N||(n=a),new oe(n,r)},oe.prototype.evaluate=function(){return this.value},oe.prototype.eachChild=function(){},oe.prototype.outputDefined=function(){return!0},oe.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Kt?["rgba"].concat(this.value.toArray()):this.value instanceof te?this.value.serialize():this.value};var se=function(t){this.name="ExpressionEvaluationError",this.message=t};se.prototype.toJSON=function(){return this.message};var le={string:Rt,number:Dt,boolean:Ft,object:Nt},ce=function(t,e){this.type=t,this.args=e};ce.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r,n=1,a=t[0];if("array"===a){var i,o;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in le)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);i=le[s],n++}else i=jt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],n++}r=Ht(i,o)}else r=le[a];for(var l=[];n<t.length;n++){var c=e.parse(t[n],n,jt);if(!c)return null;l.push(c)}return new ce(r,l)},ce.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!Wt(this.type,ae(r)))return r;if(e===this.args.length-1)throw new se("Expected value to be of type "+Gt(this.type)+", but found "+Gt(ae(r))+" instead.")}return null},ce.prototype.eachChild=function(t){this.args.forEach(t)},ce.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ce.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);var n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var ue=function(t){this.type=Ut,this.sections=t};ue.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],a=!1,i=1;i<=t.length-1;++i){var o=t[i];if(a&&"object"==typeof o&&!Array.isArray(o)){a=!1;var s=null;if(o["font-scale"]&&!(s=e.parse(o["font-scale"],1,Dt)))return null;var l=null;if(o["text-font"]&&!(l=e.parse(o["text-font"],1,Ht(Rt))))return null;var c=null;if(o["text-color"]&&!(c=e.parse(o["text-color"],1,Bt)))return null;var u=n[n.length-1];u.scale=s,u.font=l,u.textColor=c}else{var h=e.parse(t[i],1,jt);if(!h)return null;var f=h.type.kind;if("string"!==f&&"value"!==f&&"null"!==f&&"resolvedImage"!==f)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");a=!0,n.push({content:h,scale:null,font:null,textColor:null})}}return new ue(n)},ue.prototype.evaluate=function(t){return new te(this.sections.map((function(e){var r=e.content.evaluate(t);return ae(r)===qt?new $t("",r,null,null,null):new $t(ie(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},ue.prototype.eachChild=function(t){for(var e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t(n.content),n.scale&&t(n.scale),n.font&&t(n.font),n.textColor&&t(n.textColor)}},ue.prototype.outputDefined=function(){return!1},ue.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t.push(n.content.serialize());var a={};n.scale&&(a["font-scale"]=n.scale.serialize()),n.font&&(a["text-font"]=n.font.serialize()),n.textColor&&(a["text-color"]=n.textColor.serialize()),t.push(a)}return t};var he=function(t){this.type=qt,this.input=t};he.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Rt);return r?new he(r):e.error("No image name provided.")},he.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=ee.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r},he.prototype.eachChild=function(t){t(this.input)},he.prototype.outputDefined=function(){return!1},he.prototype.serialize=function(){return["image",this.input.serialize()]};var fe={"to-boolean":Ft,"to-color":Bt,"to-number":Dt,"to-string":Rt},pe=function(t,e){this.type=t,this.args=e};pe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=fe[r],a=[],i=1;i<t.length;i++){var o=e.parse(t[i],i,jt);if(!o)return null;a.push(o)}return new pe(n,a)},pe.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,r,n=0,a=this.args;n<a.length;n+=1){if(r=null,(e=a[n].evaluate(t))instanceof Kt)return e;if("string"==typeof e){var i=t.parseColor(e);if(i)return i}else if(Array.isArray(e)&&!(r=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":re(e[0],e[1],e[2],e[3])))return new Kt(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new se(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s<l.length;s+=1){if(null===(o=l[s].evaluate(t)))return 0;var c=Number(o);if(!isNaN(c))return c}throw new se("Could not convert "+JSON.stringify(o)+" to number.")}return"formatted"===this.type.kind?te.fromString(ie(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?ee.fromString(ie(this.args[0].evaluate(t))):ie(this.args[0].evaluate(t))},pe.prototype.eachChild=function(t){this.args.forEach(t)},pe.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},pe.prototype.serialize=function(){if("formatted"===this.type.kind)return new ue([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new he(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var de=["Unknown","Point","LineString","Polygon"],ge=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};ge.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},ge.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?de[this.feature.type]:this.feature.type:null},ge.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},ge.prototype.canonicalID=function(){return this.canonical},ge.prototype.properties=function(){return this.feature&&this.feature.properties||{}},ge.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Kt.parse(t)),e};var me=function(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n};me.prototype.evaluate=function(t){return this._evaluate(t,this.args)},me.prototype.eachChild=function(t){this.args.forEach(t)},me.prototype.outputDefined=function(){return!1},me.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},me.parse=function(t,e){var r,n=t[0],a=me.definitions[n];if(!a)return e.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0);for(var i=Array.isArray(a)?a[0]:a.type,o=Array.isArray(a)?[[a[1],a[2]]]:a.overloads,s=o.filter((function(e){var r=e[0];return!Array.isArray(r)||r.length===t.length-1})),l=null,c=0,u=s;c<u.length;c+=1){var h=u[c],f=h[0],p=h[1];l=new Be(e.registry,e.path,null,e.scope);for(var d=[],g=!1,m=1;m<t.length;m++){var v=t[m],y=Array.isArray(f)?f[m-1]:f.type,x=l.parse(v,1+d.length,y);if(!x){g=!0;break}d.push(x)}if(!g)if(Array.isArray(f)&&f.length!==d.length)l.error("Expected "+f.length+" arguments, but found "+d.length+" instead.");else{for(var b=0;b<d.length;b++){var _=Array.isArray(f)?f[b]:f.type,w=d[b];l.concat(b+1).checkSubtype(_,w.type)}if(0===l.errors.length)return new me(n,i,p,d)}}if(1===s.length)(r=e.errors).push.apply(r,l.errors);else{for(var T=(s.length?s:o).map((function(t){var e;return e=t[0],Array.isArray(e)?"("+e.map(Gt).join(", ")+")":"("+Gt(e.type)+"...)"})).join(" | "),k=[],A=1;A<t.length;A++){var M=e.parse(t[A],1+k.length);if(!M)return null;k.push(Gt(M.type))}e.error("Expected arguments of type "+T+", but found ("+k.join(", ")+") instead.")}return null},me.register=function(t,e){for(var r in me.definitions=e,e)t[r]=me};var ve=function(t,e,r){this.type=Vt,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e};function ye(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function xe(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function be(t,e){var r=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,a=Math.pow(2,e.z);return[Math.round(r*a*8192),Math.round(n*a*8192)]}function _e(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function we(t,e){for(var r,n,a,i,o,s,l,c=!1,u=0,h=e.length;u<h;u++)for(var f=e[u],p=0,d=f.length;p<d-1;p++){if((i=(r=t)[0]-(n=f[p])[0])*(l=r[1]-(a=f[p+1])[1])-(s=r[0]-a[0])*(o=r[1]-n[1])==0&&i*s<=0&&o*l<=0)return!1;_e(t,f[p],f[p+1])&&(c=!c)}return c}function Te(t,e){for(var r=0;r<e.length;r++)if(we(t,e[r]))return!0;return!1}function ke(t,e,r,n){var a=n[0]-r[0],i=n[1]-r[1],o=(t[0]-r[0])*i-a*(t[1]-r[1]),s=(e[0]-r[0])*i-a*(e[1]-r[1]);return o>0&&s<0||o<0&&s>0}function Ae(t,e,r){for(var n=0,a=r;n<a.length;n+=1)for(var i=a[n],o=0;o<i.length-1;++o)if(0!=(h=[(u=i[o+1])[0]-(c=i[o])[0],u[1]-c[1]])[0]*(f=[(l=e)[0]-(s=t)[0],l[1]-s[1]])[1]-h[1]*f[0]&&ke(s,l,c,u)&&ke(c,u,s,l))return!0;var s,l,c,u,h,f;return!1}function Me(t,e){for(var r=0;r<t.length;++r)if(!we(t[r],e))return!1;for(var n=0;n<t.length-1;++n)if(Ae(t[n],t[n+1],e))return!1;return!0}function Se(t,e){for(var r=0;r<e.length;r++)if(Me(t,e[r]))return!0;return!1}function Ee(t,e,r){for(var n=[],a=0;a<t.length;a++){for(var i=[],o=0;o<t[a].length;o++){var s=be(t[a][o],r);ye(e,s),i.push(s)}n.push(i)}return n}function Ce(t,e,r){for(var n=[],a=0;a<t.length;a++){var i=Ee(t[a],e,r);n.push(i)}return n}function Le(t,e,r,n){if(t[0]<r[0]||t[0]>r[2]){var a=.5*n,i=t[0]-r[0]>a?-n:r[0]-t[0]>a?n:0;0===i&&(i=t[0]-r[2]>a?-n:r[2]-t[0]>a?n:0),t[0]+=i}ye(e,t)}function Pe(t,e,r,n){for(var a=8192*Math.pow(2,n.z),i=[8192*n.x,8192*n.y],o=[],s=0,l=t;s<l.length;s+=1)for(var c=0,u=l[s];c<u.length;c+=1){var h=u[c],f=[h.x+i[0],h.y+i[1]];Le(f,e,r,a),o.push(f)}return o}function Ie(t,e,r,n){for(var a,i=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],s=[],l=0,c=t;l<c.length;l+=1){for(var u=[],h=0,f=c[l];h<f.length;h+=1){var p=f[h],d=[p.x+o[0],p.y+o[1]];ye(e,d),u.push(d)}s.push(u)}if(e[2]-e[0]<=i/2){(a=e)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(var g=0,m=s;g<m.length;g+=1)for(var v=0,y=m[g];v<y.length;v+=1)Le(y[v],e,r,i)}return s}ve.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var n=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,Ft);if(!n)return null;var a=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Ft);if(!a)return null;var i=null;return r.locale&&!(i=e.parse(r.locale,1,Rt))?null:new ve(n,a,i)},ve.prototype.evaluate=function(t){return new Qt(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},ve.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},ve.prototype.outputDefined=function(){return!1},ve.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var ze=function(t,e){this.type=Ft,this.geojson=t,this.geometries=e};function Oe(t){if(t instanceof me){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof ze)return!1;var e=!0;return t.eachChild((function(t){e&&!Oe(t)&&(e=!1)})),e}function De(t){if(t instanceof me&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!De(t)&&(e=!1)})),e}function Re(t,e){if(t instanceof me&&e.indexOf(t.name)>=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Re(t,e)&&(r=!1)})),r}ze.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(ne(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;n<r.features.length;++n){var a=r.features[n].geometry.type;if("Polygon"===a||"MultiPolygon"===a)return new ze(r,r.features[n].geometry)}else if("Feature"===r.type){var i=r.geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new ze(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new ze(r,r)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},ze.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],a=t.canonicalID();if("Polygon"===e.type){var i=Ee(e.coordinates,n,a),o=Pe(t.geometry(),r,n,a);if(!xe(r,n))return!1;for(var s=0,l=o;s<l.length;s+=1)if(!we(l[s],i))return!1}if("MultiPolygon"===e.type){var c=Ce(e.coordinates,n,a),u=Pe(t.geometry(),r,n,a);if(!xe(r,n))return!1;for(var h=0,f=u;h<f.length;h+=1)if(!Te(f[h],c))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],a=t.canonicalID();if("Polygon"===e.type){var i=Ee(e.coordinates,n,a),o=Ie(t.geometry(),r,n,a);if(!xe(r,n))return!1;for(var s=0,l=o;s<l.length;s+=1)if(!Me(l[s],i))return!1}if("MultiPolygon"===e.type){var c=Ce(e.coordinates,n,a),u=Ie(t.geometry(),r,n,a);if(!xe(r,n))return!1;for(var h=0,f=u;h<f.length;h+=1)if(!Se(f[h],c))return!1}return!0}(t,this.geometries)}return!1},ze.prototype.eachChild=function(){},ze.prototype.outputDefined=function(){return!0},ze.prototype.serialize=function(){return["within",this.geojson]};var Fe=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};Fe.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var r=t[1];return e.scope.has(r)?new Fe(r,e.scope.get(r)):e.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},Fe.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Fe.prototype.eachChild=function(){},Fe.prototype.outputDefined=function(){return!1},Fe.prototype.serialize=function(){return["var",this.name]};var Be=function(t,e,r,n,a){void 0===e&&(e=[]),void 0===n&&(n=new zt),void 0===a&&(a=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=n,this.errors=a,this.expectedType=r};function Ne(t,e){for(var r,n=t.length-1,a=0,i=n,o=0;a<=i;)if((r=t[o=Math.floor((a+i)/2)])<=e){if(o===n||e<t[o+1])return o;a=o+1}else{if(!(r>e))throw new se("Input is not a number.");i=o-1}return 0}Be.prototype.parse=function(t,e,r,n,a){return void 0===a&&(a={}),e?this.concat(e,r,n)._parse(t,a):this._parse(t,a)},Be.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new ce(e,[t]):"coerce"===r?new pe(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var a=this.registry[n];if(a){var i=a.parse(t,this);if(!i)return null;if(this.expectedType){var o=this.expectedType,s=i.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else i=r(i,o,e.typeAnnotation||"coerce");else i=r(i,o,e.typeAnnotation||"assert")}if(!(i instanceof oe)&&"resolvedImage"!==i.type.kind&&function t(e){if(e instanceof Fe)return t(e.boundExpression);if(e instanceof me&&"error"===e.name)return!1;if(e instanceof ve)return!1;if(e instanceof ze)return!1;var r=e instanceof pe||e instanceof ce,n=!0;return e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof oe})),!!n&&Oe(e)&&Re(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(i)){var l=new ge;try{i=new oe(i.type,i.evaluate(l))}catch(t){return this.error(t.message),null}}return i}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},Be.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,a=r?this.scope.concat(r):this.scope;return new Be(this.registry,n,e||null,a,this.errors)},Be.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new It(n,t))},Be.prototype.checkSubtype=function(t,e){var r=Wt(t,e);return r&&this.error(r),r};var je=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,a=r;n<a.length;n+=1){var i=a[n],o=i[1];this.labels.push(i[0]),this.outputs.push(o)}};function Ve(t,e,r){return t*(1-r)+e*r}je.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var r=e.parse(t[1],1,Dt);if(!r)return null;var n=[],a=null;e.expectedType&&"value"!==e.expectedType.kind&&(a=e.expectedType);for(var i=1;i<t.length;i+=2){var o=1===i?-1/0:t[i],s=t[i+1],l=i,c=i+1;if("number"!=typeof o)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(n.length&&n[n.length-1][0]>=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var u=e.parse(s,c,a);if(!u)return null;a=a||u.type,n.push([o,u])}return new je(a,r,n)},je.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var a=e.length;return n>=e[a-1]?r[a-1].evaluate(t):r[Ne(e,n)].evaluate(t)},je.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},je.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},je.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Ue=Object.freeze({__proto__:null,number:Ve,color:function(t,e,r){return new Kt(Ve(t.r,e.r,r),Ve(t.g,e.g,r),Ve(t.b,e.b,r),Ve(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return Ve(t,e[n],r)}))}}),qe=6/29*3*(6/29),He=Math.PI/180,Ge=180/Math.PI;function Ye(t){return t>.008856451679035631?Math.pow(t,1/3):t/qe+4/29}function We(t){return t>6/29?t*t*t:qe*(t-4/29)}function Ze(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Xe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Je(t){var e=Xe(t.r),r=Xe(t.g),n=Xe(t.b),a=Ye((.4124564*e+.3575761*r+.1804375*n)/.95047),i=Ye((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*i-16,a:500*(a-i),b:200*(i-Ye((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function Ke(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*We(e),r=.95047*We(r),n=1.08883*We(n),new Kt(Ze(3.2404542*r-1.5371385*e-.4985314*n),Ze(-.969266*r+1.8760108*e+.041556*n),Ze(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function Qe(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var $e={forward:Je,reverse:Ke,interpolate:function(t,e,r){return{l:Ve(t.l,e.l,r),a:Ve(t.a,e.a,r),b:Ve(t.b,e.b,r),alpha:Ve(t.alpha,e.alpha,r)}}},tr={forward:function(t){var e=Je(t),r=e.l,n=e.a,a=e.b,i=Math.atan2(a,n)*Ge;return{h:i<0?i+360:i,c:Math.sqrt(n*n+a*a),l:r,alpha:t.a}},reverse:function(t){var e=t.h*He,r=t.c;return Ke({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:Qe(t.h,e.h,r),c:Ve(t.c,e.c,r),l:Ve(t.l,e.l,r),alpha:Ve(t.alpha,e.alpha,r)}}},er=Object.freeze({__proto__:null,lab:$e,hcl:tr}),rr=function(t,e,r,n,a){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var i=0,o=a;i<o.length;i+=1){var s=o[i],l=s[1];this.labels.push(s[0]),this.outputs.push(l)}};function nr(t,e,r,n){var a=n-r,i=t-r;return 0===a?0:1===e?i/a:(Math.pow(e,i)-1)/(Math.pow(e,a)-1)}rr.interpolationFactor=function(t,e,n,a){var i=0;if("exponential"===t.name)i=nr(e,t.base,n,a);else if("linear"===t.name)i=nr(e,1,n,a);else if("cubic-bezier"===t.name){var o=t.controlPoints;i=new r(o[0],o[1],o[2],o[3]).solve(nr(e,1,n,a))}return i},rr.parse=function(t,e){var r=t[0],n=t[1],a=t[2],i=t.slice(3);if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){var o=n[1];if("number"!=typeof o)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:o}}else{if("cubic-bezier"!==n[0])return e.error("Unknown interpolation type "+String(n[0]),1,0);var s=n.slice(1);if(4!==s.length||s.some((function(t){return"number"!=typeof t||t<0||t>1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(a=e.parse(a,2,Dt)))return null;var l=[],c=null;"interpolate-hcl"===r||"interpolate-lab"===r?c=Bt:e.expectedType&&"value"!==e.expectedType.kind&&(c=e.expectedType);for(var u=0;u<i.length;u+=2){var h=i[u],f=i[u+1],p=u+3,d=u+4;if("number"!=typeof h)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',p);if(l.length&&l[l.length-1][0]>=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);var g=e.parse(f,d,c);if(!g)return null;c=c||g.type,l.push([h,g])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"==typeof c.N?new rr(c,r,n,a,l):e.error("Type "+Gt(c)+" is not interpolatable.")},rr.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var a=e.length;if(n>=e[a-1])return r[a-1].evaluate(t);var i=Ne(e,n),o=rr.interpolationFactor(this.interpolation,n,e[i],e[i+1]),s=r[i].evaluate(t),l=r[i+1].evaluate(t);return"interpolate"===this.operator?Ue[this.type.kind.toLowerCase()](s,l,o):"interpolate-hcl"===this.operator?tr.reverse(tr.interpolate(tr.forward(s),tr.forward(l),o)):$e.reverse($e.interpolate($e.forward(s),$e.forward(l),o))},rr.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},rr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},rr.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],r=0;r<this.labels.length;r++)e.push(this.labels[r],this.outputs[r].serialize());return e};var ar=function(t,e){this.type=t,this.args=e};ar.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var r=null,n=e.expectedType;n&&"value"!==n.kind&&(r=n);for(var a=[],i=0,o=t.slice(1);i<o.length;i+=1){var s=e.parse(o[i],1+a.length,r,void 0,{typeAnnotation:"omit"});if(!s)return null;r=r||s.type,a.push(s)}var l=n&&a.some((function(t){return Wt(n,t.type)}));return new ar(l?jt:r,a)},ar.prototype.evaluate=function(t){for(var e,r=null,n=0,a=0,i=this.args;a<i.length&&(n++,(r=i[a].evaluate(t))&&r instanceof ee&&!r.available&&(e||(e=r.name),r=null,n===this.args.length&&(r=e)),null===r);a+=1);return r},ar.prototype.eachChild=function(t){this.args.forEach(t)},ar.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ar.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var ir=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};ir.prototype.evaluate=function(t){return this.result.evaluate(t)},ir.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1)t(r[e][1]);t(this.result)},ir.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var r=[],n=1;n<t.length-1;n+=2){var a=t[n];if("string"!=typeof a)return e.error("Expected string, but found "+typeof a+" instead.",n);if(/[^a-zA-Z0-9_]/.test(a))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);var i=e.parse(t[n+1],n+1);if(!i)return null;r.push([a,i])}var o=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return o?new ir(r,o):null},ir.prototype.outputDefined=function(){return this.result.outputDefined()},ir.prototype.serialize=function(){for(var t=["let"],e=0,r=this.bindings;e<r.length;e+=1){var n=r[e];t.push(n[0],n[1].serialize())}return t.push(this.result.serialize()),t};var or=function(t,e,r){this.type=t,this.index=e,this.input=r};or.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Dt),n=e.parse(t[2],2,Ht(e.expectedType||jt));return r&&n?new or(n.type.itemType,r,n):null},or.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new se("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new se("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new se("Array index must be an integer, but found "+e+" instead.");return r[e]},or.prototype.eachChild=function(t){t(this.index),t(this.input)},or.prototype.outputDefined=function(){return!1},or.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var sr=function(t,e){this.type=Ft,this.needle=t,this.haystack=e};sr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,jt),n=e.parse(t[2],2,jt);return r&&n?Zt(r.type,[Ft,Rt,Dt,Ot,jt])?new sr(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Gt(r.type)+" instead"):null},sr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!Xt(e,["boolean","string","number","null"]))throw new se("Expected first argument to be of type boolean, string, number or null, but found "+Gt(ae(e))+" instead.");if(!Xt(r,["string","array"]))throw new se("Expected second argument to be of type array or string, but found "+Gt(ae(r))+" instead.");return r.indexOf(e)>=0},sr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},sr.prototype.outputDefined=function(){return!0},sr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var lr=function(t,e,r){this.type=Dt,this.needle=t,this.haystack=e,this.fromIndex=r};lr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,jt),n=e.parse(t[2],2,jt);if(!r||!n)return null;if(!Zt(r.type,[Ft,Rt,Dt,Ot,jt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Gt(r.type)+" instead");if(4===t.length){var a=e.parse(t[3],3,Dt);return a?new lr(r,n,a):null}return new lr(r,n)},lr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!Xt(e,["boolean","string","number","null"]))throw new se("Expected first argument to be of type boolean, string, number or null, but found "+Gt(ae(e))+" instead.");if(!Xt(r,["string","array"]))throw new se("Expected second argument to be of type array or string, but found "+Gt(ae(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},lr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},lr.prototype.outputDefined=function(){return!1},lr.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var cr=function(t,e,r,n,a,i){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=a,this.otherwise=i};cr.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var a={},i=[],o=2;o<t.length-1;o+=2){var s=t[o],l=t[o+1];Array.isArray(s)||(s=[s]);var c=e.concat(o);if(0===s.length)return c.error("Expected at least one branch label.");for(var u=0,h=s;u<h.length;u+=1){var f=h[u];if("number"!=typeof f&&"string"!=typeof f)return c.error("Branch labels must be numbers or strings.");if("number"==typeof f&&Math.abs(f)>Number.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof f&&Math.floor(f)!==f)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,ae(f)))return null}else r=ae(f);if(void 0!==a[String(f)])return c.error("Branch labels must be unique.");a[String(f)]=i.length}var p=e.parse(l,o,n);if(!p)return null;n=n||p.type,i.push(p)}var d=e.parse(t[1],1,jt);if(!d)return null;var g=e.parse(t[t.length-1],t.length-1,n);return g?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new cr(r,n,d,a,i,g):null},cr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(ae(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},cr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},cr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},cr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},a=0,i=Object.keys(this.cases).sort();a<i.length;a+=1){var o=i[a];void 0===(h=n[this.cases[o]])?(n[this.cases[o]]=r.length,r.push([this.cases[o],[o]])):r[h][1].push(o)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},l=0,c=r;l<c.length;l+=1){var u=c[l],h=u[0],f=u[1];e.push(1===f.length?s(f[0]):f.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var ur=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r};ur.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var n=[],a=1;a<t.length-1;a+=2){var i=e.parse(t[a],a,Ft);if(!i)return null;var o=e.parse(t[a+1],a+1,r);if(!o)return null;n.push([i,o]),r=r||o.type}var s=e.parse(t[t.length-1],t.length-1,r);return s?new ur(r,n,s):null},ur.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],a=n[1];if(n[0].evaluate(t))return a.evaluate(t)}return this.otherwise.evaluate(t)},ur.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],a=n[1];t(n[0]),t(a)}t(this.otherwise)},ur.prototype.outputDefined=function(){return this.branches.every((function(t){return t[1].outputDefined()}))&&this.otherwise.outputDefined()},ur.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var hr=function(t,e,r,n){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=n};function fr(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function pr(t,e,r,n){return 0===n.compare(e,r)}function dr(t,e,r){var n="=="!==t&&"!="!==t;return function(){function a(t,e,r){this.type=Ft,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return a.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],i=e.parse(t[1],1,jt);if(!i)return null;if(!fr(r,i.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+Gt(i.type)+"'.");var o=e.parse(t[2],2,jt);if(!o)return null;if(!fr(r,o.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+Gt(o.type)+"'.");if(i.type.kind!==o.type.kind&&"value"!==i.type.kind&&"value"!==o.type.kind)return e.error("Cannot compare types '"+Gt(i.type)+"' and '"+Gt(o.type)+"'.");n&&("value"===i.type.kind&&"value"!==o.type.kind?i=new ce(o.type,[i]):"value"!==i.type.kind&&"value"===o.type.kind&&(o=new ce(i.type,[o])));var s=null;if(4===t.length){if("string"!==i.type.kind&&"string"!==o.type.kind&&"value"!==i.type.kind&&"value"!==o.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,Vt)))return null}return new a(i,o,s)},a.prototype.evaluate=function(a){var i=this.lhs.evaluate(a),o=this.rhs.evaluate(a);if(n&&this.hasUntypedArgument){var s=ae(i),l=ae(o);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new se('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var c=ae(i),u=ae(o);if("string"!==c.kind||"string"!==u.kind)return e(a,i,o)}return this.collator?r(a,i,o,this.collator.evaluate(a)):e(a,i,o)},a.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},a.prototype.outputDefined=function(){return!0},a.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},a}()}hr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,jt),n=e.parse(t[2],2,Dt);if(!r||!n)return null;if(!Zt(r.type,[Ht(jt),Rt,jt]))return e.error("Expected first argument to be of type array or string, but found "+Gt(r.type)+" instead");if(4===t.length){var a=e.parse(t[3],3,Dt);return a?new hr(r.type,r,n,a):null}return new hr(r.type,r,n)},hr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!Xt(e,["string","array"]))throw new se("Expected first argument to be of type array or string, but found "+Gt(ae(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},hr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},hr.prototype.outputDefined=function(){return!1},hr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var gr=dr("==",(function(t,e,r){return e===r}),pr),mr=dr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!pr(0,e,r,n)})),vr=dr("<",(function(t,e,r){return e<r}),(function(t,e,r,n){return n.compare(e,r)<0})),yr=dr(">",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),xr=dr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),br=dr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),_r=function(t,e,r,n,a){this.type=Rt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=a};_r.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Dt);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var a=null;if(n.locale&&!(a=e.parse(n.locale,1,Rt)))return null;var i=null;if(n.currency&&!(i=e.parse(n.currency,1,Rt)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=e.parse(n["min-fraction-digits"],1,Dt)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Dt))?null:new _r(r,a,i,o,s)},_r.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},_r.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},_r.prototype.outputDefined=function(){return!1},_r.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var wr=function(t){this.type=Dt,this.input=t};wr.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+Gt(r.type)+" instead."):new wr(r):null},wr.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new se("Expected value to be of type string or array, but found "+Gt(ae(e))+" instead.")},wr.prototype.eachChild=function(t){t(this.input)},wr.prototype.outputDefined=function(){return!1},wr.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Tr={"==":gr,"!=":mr,">":yr,"<":vr,">=":br,"<=":xr,array:ce,at:or,boolean:ce,case:ur,coalesce:ar,collator:ve,format:ue,image:he,in:sr,"index-of":lr,interpolate:rr,"interpolate-hcl":rr,"interpolate-lab":rr,length:wr,let:ir,literal:oe,match:cr,number:ce,"number-format":_r,object:ce,slice:hr,step:je,string:ce,"to-boolean":pe,"to-color":pe,"to-number":pe,"to-string":pe,var:Fe,within:ze};function kr(t,e){var r=e[0],n=e[1],a=e[2],i=e[3];r=r.evaluate(t),n=n.evaluate(t),a=a.evaluate(t);var o=i?i.evaluate(t):1,s=re(r,n,a,o);if(s)throw new se(s);return new Kt(r/255*o,n/255*o,a/255*o,o)}function Ar(t,e){return t in e}function Mr(t,e){var r=e[t];return void 0===r?null:r}function Sr(t){return{type:t}}function Er(t){return{result:"success",value:t}}function Cr(t){return{result:"error",value:t}}function Lr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Pr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Ir(t){return!!t.expression&&t.expression.interpolated}function zr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Or(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Dr(t){return t}function Rr(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Fr(t,e,r,n,a){return Rr(typeof r===a?n[r]:void 0,t.default,e.default)}function Br(t,e,r){if("number"!==zr(r))return Rr(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var a=Ne(t.stops.map((function(t){return t[0]})),r);return t.stops[a][1]}function Nr(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==zr(r))return Rr(t.default,e.default);var a=t.stops.length;if(1===a)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[a-1][0])return t.stops[a-1][1];var i=Ne(t.stops.map((function(t){return t[0]})),r),o=function(t,e,r,n){var a=n-r,i=t-r;return 0===a?0:1===e?i/a:(Math.pow(e,i)-1)/(Math.pow(e,a)-1)}(r,n,t.stops[i][0],t.stops[i+1][0]),s=t.stops[i][1],l=t.stops[i+1][1],c=Ue[e.type]||Dr;if(t.colorSpace&&"rgb"!==t.colorSpace){var u=er[t.colorSpace];c=function(t,e){return u.reverse(u.interpolate(u.forward(t),u.forward(e),o))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return c(r,n,o)}}:c(s,l,o)}function jr(t,e,r){return"color"===e.type?r=Kt.parse(r):"formatted"===e.type?r=te.fromString(r.toString()):"resolvedImage"===e.type?r=ee.fromString(r.toString()):zr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Rr(r,t.default,e.default)}me.register(Tr,{error:[{kind:"error"},[Rt],function(t,e){throw new se(e[0].evaluate(t))}],typeof:[Rt,[jt],function(t,e){return Gt(ae(e[0].evaluate(t)))}],"to-rgba":[Ht(Dt,4),[Bt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Bt,[Dt,Dt,Dt],kr],rgba:[Bt,[Dt,Dt,Dt,Dt],kr],has:{type:Ft,overloads:[[[Rt],function(t,e){return Ar(e[0].evaluate(t),t.properties())}],[[Rt,Nt],function(t,e){var r=e[1];return Ar(e[0].evaluate(t),r.evaluate(t))}]]},get:{type:jt,overloads:[[[Rt],function(t,e){return Mr(e[0].evaluate(t),t.properties())}],[[Rt,Nt],function(t,e){var r=e[1];return Mr(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[jt,[Rt],function(t,e){return Mr(e[0].evaluate(t),t.featureState||{})}],properties:[Nt,[],function(t){return t.properties()}],"geometry-type":[Rt,[],function(t){return t.geometryType()}],id:[jt,[],function(t){return t.id()}],zoom:[Dt,[],function(t){return t.globals.zoom}],"heatmap-density":[Dt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Dt,[],function(t){return t.globals.lineProgress||0}],accumulated:[jt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Dt,Sr(Dt),function(t,e){for(var r=0,n=0,a=e;n<a.length;n+=1)r+=a[n].evaluate(t);return r}],"*":[Dt,Sr(Dt),function(t,e){for(var r=1,n=0,a=e;n<a.length;n+=1)r*=a[n].evaluate(t);return r}],"-":{type:Dt,overloads:[[[Dt,Dt],function(t,e){var r=e[1];return e[0].evaluate(t)-r.evaluate(t)}],[[Dt],function(t,e){return-e[0].evaluate(t)}]]},"/":[Dt,[Dt,Dt],function(t,e){var r=e[1];return e[0].evaluate(t)/r.evaluate(t)}],"%":[Dt,[Dt,Dt],function(t,e){var r=e[1];return e[0].evaluate(t)%r.evaluate(t)}],ln2:[Dt,[],function(){return Math.LN2}],pi:[Dt,[],function(){return Math.PI}],e:[Dt,[],function(){return Math.E}],"^":[Dt,[Dt,Dt],function(t,e){var r=e[1];return Math.pow(e[0].evaluate(t),r.evaluate(t))}],sqrt:[Dt,[Dt],function(t,e){return Math.sqrt(e[0].evaluate(t))}],log10:[Dt,[Dt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN10}],ln:[Dt,[Dt],function(t,e){return Math.log(e[0].evaluate(t))}],log2:[Dt,[Dt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN2}],sin:[Dt,[Dt],function(t,e){return Math.sin(e[0].evaluate(t))}],cos:[Dt,[Dt],function(t,e){return Math.cos(e[0].evaluate(t))}],tan:[Dt,[Dt],function(t,e){return Math.tan(e[0].evaluate(t))}],asin:[Dt,[Dt],function(t,e){return Math.asin(e[0].evaluate(t))}],acos:[Dt,[Dt],function(t,e){return Math.acos(e[0].evaluate(t))}],atan:[Dt,[Dt],function(t,e){return Math.atan(e[0].evaluate(t))}],min:[Dt,Sr(Dt),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[Dt,Sr(Dt),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[Dt,[Dt],function(t,e){return Math.abs(e[0].evaluate(t))}],round:[Dt,[Dt],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[Dt,[Dt],function(t,e){return Math.floor(e[0].evaluate(t))}],ceil:[Dt,[Dt],function(t,e){return Math.ceil(e[0].evaluate(t))}],"filter-==":[Ft,[Rt,jt],function(t,e){var r=e[0],n=e[1];return t.properties()[r.value]===n.value}],"filter-id-==":[Ft,[jt],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[Ft,[Rt],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[Ft,[Rt,jt],function(t,e){var r=e[0],n=e[1],a=t.properties()[r.value],i=n.value;return typeof a==typeof i&&a<i}],"filter-id-<":[Ft,[jt],function(t,e){var r=e[0],n=t.id(),a=r.value;return typeof n==typeof a&&n<a}],"filter->":[Ft,[Rt,jt],function(t,e){var r=e[0],n=e[1],a=t.properties()[r.value],i=n.value;return typeof a==typeof i&&a>i}],"filter-id->":[Ft,[jt],function(t,e){var r=e[0],n=t.id(),a=r.value;return typeof n==typeof a&&n>a}],"filter-<=":[Ft,[Rt,jt],function(t,e){var r=e[0],n=e[1],a=t.properties()[r.value],i=n.value;return typeof a==typeof i&&a<=i}],"filter-id-<=":[Ft,[jt],function(t,e){var r=e[0],n=t.id(),a=r.value;return typeof n==typeof a&&n<=a}],"filter->=":[Ft,[Rt,jt],function(t,e){var r=e[0],n=e[1],a=t.properties()[r.value],i=n.value;return typeof a==typeof i&&a>=i}],"filter-id->=":[Ft,[jt],function(t,e){var r=e[0],n=t.id(),a=r.value;return typeof n==typeof a&&n>=a}],"filter-has":[Ft,[jt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Ft,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Ft,[Ht(Rt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Ft,[Ht(jt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Ft,[Rt,Ht(jt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Ft,[Rt,Ht(jt)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var a=r+n>>1;if(e[a]===t)return!0;e[a]>t?n=a-1:r=a+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:Ft,overloads:[[[Ft,Ft],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[Sr(Ft),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(!n[r].evaluate(t))return!1;return!0}]]},any:{type:Ft,overloads:[[[Ft,Ft],function(t,e){var r=e[1];return e[0].evaluate(t)||r.evaluate(t)}],[Sr(Ft),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(n[r].evaluate(t))return!0;return!1}]]},"!":[Ft,[Ft],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[Ft,[Rt],function(t,e){var r=t.globals&&t.globals.isSupportedScript;return!r||r(e[0].evaluate(t))}],upcase:[Rt,[Rt],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[Rt,[Rt],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[Rt,Sr(jt),function(t,e){return e.map((function(e){return ie(e.evaluate(t))})).join("")}],"resolved-locale":[Rt,[Vt],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var Vr=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new ge,this._defaultValue=e?function(t){return"color"===t.type&&Or(t.default)?new Kt(0,0,0,0):"color"===t.type?Kt.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null};function Ur(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Tr}function qr(t,e){var r=new Be(Tr,[],e?function(t){var e={color:Bt,string:Rt,number:Dt,enum:Rt,boolean:Ft,formatted:Ut,resolvedImage:qt};return"array"===t.type?Ht(e[t.value]||jt,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Er(new Vr(n,e)):Cr(r.errors)}Vr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,a,i){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=i,this.expression.evaluate(this._evaluator)},Vr.prototype.evaluate=function(t,e,r,n,a,i){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=i||null;try{var o=this.expression.evaluate(this._evaluator);if(null==o||"number"==typeof o&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new se("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Hr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!De(e.expression)};Hr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,a,i){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,a,i)},Hr.prototype.evaluate=function(t,e,r,n,a,i){return this._styleExpression.evaluate(t,e,r,n,a,i)};var Gr=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!De(e.expression),this.interpolationType=n};function Yr(t,e){if("error"===(t=qr(t,e)).result)return t;var r=t.value.expression,n=Oe(r);if(!n&&!Lr(e))return Cr([new It("","data expressions not supported")]);var a=Re(r,["zoom"]);if(!a&&!Pr(e))return Cr([new It("","zoom expressions not supported")]);var i=function t(e){var r=null;if(e instanceof ir)r=t(e.result);else if(e instanceof ar)for(var n=0,a=e.args;n<a.length&&!(r=t(a[n]));n+=1);else(e instanceof je||e instanceof rr)&&e.input instanceof me&&"zoom"===e.input.name&&(r=e);return r instanceof It||e.eachChild((function(e){var n=t(e);n instanceof It?r=n:!r&&n?r=new It("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&n&&r!==n&&(r=new It("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),r}(r);return i||a?i instanceof It?Cr([i]):i instanceof rr&&!Ir(e)?Cr([new It("",'"interpolate" expressions cannot be used with this property')]):Er(i?new Gr(n?"camera":"composite",t.value,i.labels,i instanceof rr?i.interpolation:void 0):new Hr(n?"constant":"source",t.value)):Cr([new It("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Gr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,a,i){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,a,i)},Gr.prototype.evaluate=function(t,e,r,n,a,i){return this._styleExpression.evaluate(t,e,r,n,a,i)},Gr.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?rr.interpolationFactor(this.interpolationType,t,e,r):0};var Wr=function(t,e){this._parameters=t,this._specification=e,Ct(this,function t(e,r){var n,a,i,o="color"===r.type,s=e.stops&&"object"==typeof e.stops[0][0],l=s||!(s||void 0!==e.property),c=e.type||(Ir(r)?"exponential":"interval");if(o&&((e=Ct({},e)).stops&&(e.stops=e.stops.map((function(t){return[t[0],Kt.parse(t[1])]}))),e.default=Kt.parse(e.default?e.default:r.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!er[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===c)n=Nr;else if("interval"===c)n=Br;else if("categorical"===c){n=Fr,a=Object.create(null);for(var u=0,h=e.stops;u<h.length;u+=1){var f=h[u];a[f[0]]=f[1]}i=typeof e.stops[0][0]}else{if("identity"!==c)throw new Error('Unknown function type "'+c+'"');n=jr}if(s){for(var p={},d=[],g=0;g<e.stops.length;g++){var m=e.stops[g],v=m[0].zoom;void 0===p[v]&&(p[v]={zoom:v,type:e.type,property:e.property,default:e.default,stops:[]},d.push(v)),p[v].stops.push([m[0].value,m[1]])}for(var y=[],x=0,b=d;x<b.length;x+=1){var _=b[x];y.push([p[_].zoom,t(p[_],r)])}var w={name:"linear"};return{kind:"composite",interpolationType:w,interpolationFactor:rr.interpolationFactor.bind(void 0,w),zoomStops:y.map((function(t){return t[0]})),evaluate:function(t,n){var a=t.zoom;return Nr({stops:y,base:e.base},r,a).evaluate(a,n)}}}if(l){var T="exponential"===c?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:T,interpolationFactor:rr.interpolationFactor.bind(void 0,T),zoomStops:e.stops.map((function(t){return t[0]})),evaluate:f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment