Skip to content

Instantly share code, notes, and snippets.

@osamutake
Created April 5, 2018 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save osamutake/da4856f49e025e4646214a0ce690ba06 to your computer and use it in GitHub Desktop.
Save osamutake/da4856f49e025e4646214a0ce690ba06 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"metadata": {
"trusted": true
},
"cell_type": "code",
"source": "using Plots",
"execution_count": 1,
"outputs": []
},
{
"metadata": {
"trusted": true
},
"cell_type": "code",
"source": "y=rand(10);",
"execution_count": 2,
"outputs": []
},
{
"metadata": {
"trusted": true
},
"cell_type": "code",
"source": "example = () -> plot(\n plot(y),\n plot(y,seriestype=:scatter),\n plot(y,seriestype=:bar),\n plot(y,seriestype=:pie),\n layout=(2,2)\n)",
"execution_count": 3,
"outputs": [
{
"output_type": "execute_result",
"execution_count": 3,
"data": {
"text/plain": "(::#1) (generic function with 1 method)"
},
"metadata": {}
}
]
},
{
"metadata": {
"trusted": true
},
"cell_type": "code",
"source": "gr(); example()",
"execution_count": 4,
"outputs": [
{
"output_type": "execute_result",
"execution_count": 4,
"data": {
"text/html": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\" viewBox=\"0 0 600 400\">\n<defs>\n <clipPath id=\"clip1000\">\n <rect x=\"0\" y=\"0\" width=\"600\" height=\"400\"/>\n </clipPath>\n</defs>\n<polygon clip-path=\"url(#clip1000)\" points=\"\n0,400 600,400 600,0 0,0 \n \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n<defs>\n <clipPath id=\"clip1001\">\n <rect x=\"120\" y=\"0\" width=\"421\" height=\"400\"/>\n </clipPath>\n</defs>\n<polygon clip-path=\"url(#clip1000)\" points=\"\n32.4745,175.869 280.315,175.869 280.315,11.811 32.4745,11.811 \n \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n<defs>\n <clipPath id=\"clip1002\">\n <rect x=\"32\" y=\"11\" width=\"249\" height=\"165\"/>\n </clipPath>\n</defs>\n<polyline clip-path=\"url(#clip1002)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 60.0123,175.869 60.0123,11.811 \n \"/>\n<polyline clip-path=\"url(#clip1002)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 115.088,175.869 115.088,11.811 \n \"/>\n<polyline clip-path=\"url(#clip1002)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 170.164,175.869 170.164,11.811 \n \"/>\n<polyline clip-path=\"url(#clip1002)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 225.239,175.869 225.239,11.811 \n \"/>\n<polyline clip-path=\"url(#clip1002)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 280.315,175.869 280.315,11.811 \n \"/>\n<polyline clip-path=\"url(#clip1002)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 32.4745,168.074 280.315,168.074 \n \"/>\n<polyline clip-path=\"url(#clip1002)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 32.4745,141.551 280.315,141.551 \n \"/>\n<polyline clip-path=\"url(#clip1002)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 32.4745,115.027 280.315,115.027 \n \"/>\n<polyline clip-path=\"url(#clip1002)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 32.4745,88.5043 280.315,88.5043 \n \"/>\n<polyline clip-path=\"url(#clip1002)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 32.4745,61.9812 280.315,61.9812 \n \"/>\n<polyline clip-path=\"url(#clip1002)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 32.4745,35.4581 280.315,35.4581 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 32.4745,175.869 280.315,175.869 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 32.4745,175.869 32.4745,11.811 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 60.0123,175.869 60.0123,173.408 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 115.088,175.869 115.088,173.408 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 170.164,175.869 170.164,173.408 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 225.239,175.869 225.239,173.408 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 280.315,175.869 280.315,173.408 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 32.4745,168.074 36.1921,168.074 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 32.4745,141.551 36.1921,141.551 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 32.4745,115.027 36.1921,115.027 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 32.4745,88.5043 36.1921,88.5043 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 32.4745,61.9812 36.1921,61.9812 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 32.4745,35.4581 36.1921,35.4581 \n \"/>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 60.0123, 189.669)\" x=\"60.0123\" y=\"189.669\">2</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 115.088, 189.669)\" x=\"115.088\" y=\"189.669\">4</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 170.164, 189.669)\" x=\"170.164\" y=\"189.669\">6</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 225.239, 189.669)\" x=\"225.239\" y=\"189.669\">8</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 280.315, 189.669)\" x=\"280.315\" y=\"189.669\">10</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 26.4745, 172.574)\" x=\"26.4745\" y=\"172.574\">0.1</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 26.4745, 146.051)\" x=\"26.4745\" y=\"146.051\">0.2</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 26.4745, 119.527)\" x=\"26.4745\" y=\"119.527\">0.3</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 26.4745, 93.0043)\" x=\"26.4745\" y=\"93.0043\">0.4</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 26.4745, 66.4812)\" x=\"26.4745\" y=\"66.4812\">0.5</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 26.4745, 39.9581)\" x=\"26.4745\" y=\"39.9581\">0.6</text>\n</g>\n<polyline clip-path=\"url(#clip1002)\" style=\"stroke:#009af9; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 32.4745,167.159 60.0123,11.811 87.5502,165.702 115.088,63.8323 142.626,29.4607 170.164,94.8812 197.701,73.942 225.239,58.5524 252.777,175.869 280.315,52.5932 \n \n \"/>\n<polygon clip-path=\"url(#clip1000)\" points=\"\n189.608,62.931 262.315,62.931 262.315,32.691 189.608,32.691 \n \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 189.608,62.931 262.315,62.931 262.315,32.691 189.608,32.691 189.608,62.931 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#009af9; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 195.608,47.811 231.608,47.811 \n \"/>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:start;\" transform=\"rotate(0, 237.608, 52.311)\" x=\"237.608\" y=\"52.311\">y1</text>\n</g>\n<polygon clip-path=\"url(#clip1000)\" points=\"\n332.474,175.869 580.315,175.869 580.315,11.811 332.474,11.811 \n \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n<defs>\n <clipPath id=\"clip1003\">\n <rect x=\"332\" y=\"11\" width=\"249\" height=\"165\"/>\n </clipPath>\n</defs>\n<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 365.468,175.869 365.468,11.811 \n \"/>\n<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 417.426,175.869 417.426,11.811 \n \"/>\n<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 469.384,175.869 469.384,11.811 \n \"/>\n<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 521.342,175.869 521.342,11.811 \n \"/>\n<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 573.301,175.869 573.301,11.811 \n \"/>\n<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 332.474,163.872 580.315,163.872 \n \"/>\n<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 332.474,138.85 580.315,138.85 \n \"/>\n<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 332.474,113.828 580.315,113.828 \n \"/>\n<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 332.474,88.8063 580.315,88.8063 \n \"/>\n<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 332.474,63.7845 580.315,63.7845 \n \"/>\n<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 332.474,38.7627 580.315,38.7627 \n \"/>\n<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 332.474,13.7409 580.315,13.7409 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 332.474,175.869 580.315,175.869 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 332.474,175.869 332.474,11.811 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 365.468,175.869 365.468,173.408 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 417.426,175.869 417.426,173.408 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 469.384,175.869 469.384,173.408 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 521.342,175.869 521.342,173.408 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 573.301,175.869 573.301,173.408 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 332.474,163.872 336.192,163.872 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 332.474,138.85 336.192,138.85 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 332.474,113.828 336.192,113.828 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 332.474,88.8063 336.192,88.8063 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 332.474,63.7845 336.192,63.7845 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 332.474,38.7627 336.192,38.7627 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 332.474,13.7409 336.192,13.7409 \n \"/>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 365.468, 189.669)\" x=\"365.468\" y=\"189.669\">2</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 417.426, 189.669)\" x=\"417.426\" y=\"189.669\">4</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 469.384, 189.669)\" x=\"469.384\" y=\"189.669\">6</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 521.342, 189.669)\" x=\"521.342\" y=\"189.669\">8</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 573.301, 189.669)\" x=\"573.301\" y=\"189.669\">10</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 326.474, 168.372)\" x=\"326.474\" y=\"168.372\">0.1</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 326.474, 143.35)\" x=\"326.474\" y=\"143.35\">0.2</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 326.474, 118.328)\" x=\"326.474\" y=\"118.328\">0.3</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 326.474, 93.3063)\" x=\"326.474\" y=\"93.3063\">0.4</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 326.474, 68.2845)\" x=\"326.474\" y=\"68.2845\">0.5</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 326.474, 43.2627)\" x=\"326.474\" y=\"43.2627\">0.6</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 326.474, 18.2409)\" x=\"326.474\" y=\"18.2409\">0.7</text>\n</g>\n<circle clip-path=\"url(#clip1003)\" style=\"fill:#000000; stroke:none; fill-opacity:1\" cx=\"339.489\" cy=\"163.009\" r=\"4\"/>\n<circle clip-path=\"url(#clip1003)\" style=\"fill:#009af9; stroke:none; fill-opacity:1\" cx=\"339.489\" cy=\"163.009\" r=\"3\"/>\n<circle clip-path=\"url(#clip1003)\" style=\"fill:#000000; stroke:none; fill-opacity:1\" cx=\"365.468\" cy=\"16.4542\" r=\"4\"/>\n<circle clip-path=\"url(#clip1003)\" style=\"fill:#009af9; stroke:none; fill-opacity:1\" cx=\"365.468\" cy=\"16.4542\" r=\"3\"/>\n<circle clip-path=\"url(#clip1003)\" style=\"fill:#000000; stroke:none; fill-opacity:1\" cx=\"391.447\" cy=\"161.634\" r=\"4\"/>\n<circle clip-path=\"url(#clip1003)\" style=\"fill:#009af9; stroke:none; fill-opacity:1\" cx=\"391.447\" cy=\"161.634\" r=\"3\"/>\n<circle clip-path=\"url(#clip1003)\" style=\"fill:#000000; stroke:none; fill-opacity:1\" cx=\"417.426\" cy=\"65.5308\" r=\"4\"/>\n<circle clip-path=\"url(#clip1003)\" style=\"fill:#009af9; stroke:none; fill-opacity:1\" cx=\"417.426\" cy=\"65.5308\" r=\"3\"/>\n<circle clip-path=\"url(#clip1003)\" style=\"fill:#000000; stroke:none; fill-opacity:1\" cx=\"443.405\" cy=\"33.1048\" r=\"4\"/>\n<circle clip-path=\"url(#clip1003)\" style=\"fill:#009af9; stroke:none; fill-opacity:1\" cx=\"443.405\" cy=\"33.1048\" r=\"3\"/>\n<circle clip-path=\"url(#clip1003)\" style=\"fill:#000000; stroke:none; fill-opacity:1\" cx=\"469.384\" cy=\"94.8222\" r=\"4\"/>\n<circle clip-path=\"url(#clip1003)\" style=\"fill:#009af9; stroke:none; fill-opacity:1\" cx=\"469.384\" cy=\"94.8222\" r=\"3\"/>\n<circle clip-path=\"url(#clip1003)\" style=\"fill:#000000; stroke:none; fill-opacity:1\" cx=\"495.363\" cy=\"75.0683\" r=\"4\"/>\n<circle clip-path=\"url(#clip1003)\" style=\"fill:#009af9; stroke:none; fill-opacity:1\" cx=\"495.363\" cy=\"75.0683\" r=\"3\"/>\n<circle clip-path=\"url(#clip1003)\" style=\"fill:#000000; stroke:none; fill-opacity:1\" cx=\"521.342\" cy=\"60.5498\" r=\"4\"/>\n<circle clip-path=\"url(#clip1003)\" style=\"fill:#009af9; stroke:none; fill-opacity:1\" cx=\"521.342\" cy=\"60.5498\" r=\"3\"/>\n<circle clip-path=\"url(#clip1003)\" style=\"fill:#000000; stroke:none; fill-opacity:1\" cx=\"547.322\" cy=\"171.226\" r=\"4\"/>\n<circle clip-path=\"url(#clip1003)\" style=\"fill:#009af9; stroke:none; fill-opacity:1\" cx=\"547.322\" cy=\"171.226\" r=\"3\"/>\n<circle clip-path=\"url(#clip1003)\" style=\"fill:#000000; stroke:none; fill-opacity:1\" cx=\"573.301\" cy=\"54.928\" r=\"4\"/>\n<circle clip-path=\"url(#clip1003)\" style=\"fill:#009af9; stroke:none; fill-opacity:1\" cx=\"573.301\" cy=\"54.928\" r=\"3\"/>\n<polygon clip-path=\"url(#clip1000)\" points=\"\n489.608,62.931 562.315,62.931 562.315,32.691 489.608,32.691 \n \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 489.608,62.931 562.315,62.931 562.315,32.691 489.608,32.691 489.608,62.931 \n \"/>\n<circle clip-path=\"url(#clip1000)\" style=\"fill:#000000; stroke:none; fill-opacity:1\" cx=\"516.608\" cy=\"47.811\" r=\"6\"/>\n<circle clip-path=\"url(#clip1000)\" style=\"fill:#009af9; stroke:none; fill-opacity:1\" cx=\"516.608\" cy=\"47.811\" r=\"5\"/>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:start;\" transform=\"rotate(0, 537.608, 52.311)\" x=\"537.608\" y=\"52.311\">y1</text>\n</g>\n<polygon clip-path=\"url(#clip1000)\" points=\"\n32.4745,375.869 280.315,375.869 280.315,211.811 32.4745,211.811 \n \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n<defs>\n <clipPath id=\"clip1004\">\n <rect x=\"32\" y=\"211\" width=\"249\" height=\"165\"/>\n </clipPath>\n</defs>\n<polyline clip-path=\"url(#clip1004)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 72.8905,375.869 72.8905,211.811 \n \"/>\n<polyline clip-path=\"url(#clip1004)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 120.607,375.869 120.607,211.811 \n \"/>\n<polyline clip-path=\"url(#clip1004)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 168.324,375.869 168.324,211.811 \n \"/>\n<polyline clip-path=\"url(#clip1004)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 216.041,375.869 216.041,211.811 \n \"/>\n<polyline clip-path=\"url(#clip1004)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 263.757,375.869 263.757,211.811 \n \"/>\n<polyline clip-path=\"url(#clip1004)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 32.4745,375.869 280.315,375.869 \n \"/>\n<polyline clip-path=\"url(#clip1004)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 32.4745,352.063 280.315,352.063 \n \"/>\n<polyline clip-path=\"url(#clip1004)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 32.4745,328.258 280.315,328.258 \n \"/>\n<polyline clip-path=\"url(#clip1004)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 32.4745,304.452 280.315,304.452 \n \"/>\n<polyline clip-path=\"url(#clip1004)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 32.4745,280.646 280.315,280.646 \n \"/>\n<polyline clip-path=\"url(#clip1004)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 32.4745,256.841 280.315,256.841 \n \"/>\n<polyline clip-path=\"url(#clip1004)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n 32.4745,233.035 280.315,233.035 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 32.4745,375.869 280.315,375.869 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 32.4745,375.869 32.4745,211.811 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 72.8905,375.869 72.8905,373.408 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 120.607,375.869 120.607,373.408 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 168.324,375.869 168.324,373.408 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 216.041,375.869 216.041,373.408 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 263.757,375.869 263.757,373.408 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 32.4745,375.869 36.1921,375.869 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 32.4745,352.063 36.1921,352.063 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 32.4745,328.258 36.1921,328.258 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 32.4745,304.452 36.1921,304.452 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 32.4745,280.646 36.1921,280.646 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 32.4745,256.841 36.1921,256.841 \n \"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 32.4745,233.035 36.1921,233.035 \n \"/>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 72.8905, 389.669)\" x=\"72.8905\" y=\"389.669\">2</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 120.607, 389.669)\" x=\"120.607\" y=\"389.669\">4</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 168.324, 389.669)\" x=\"168.324\" y=\"389.669\">6</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 216.041, 389.669)\" x=\"216.041\" y=\"389.669\">8</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 263.757, 389.669)\" x=\"263.757\" y=\"389.669\">10</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 26.4745, 380.369)\" x=\"26.4745\" y=\"380.369\">0.0</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 26.4745, 356.563)\" x=\"26.4745\" y=\"356.563\">0.1</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 26.4745, 332.758)\" x=\"26.4745\" y=\"332.758\">0.2</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 26.4745, 308.952)\" x=\"26.4745\" y=\"308.952\">0.3</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 26.4745, 285.146)\" x=\"26.4745\" y=\"285.146\">0.4</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 26.4745, 261.341)\" x=\"26.4745\" y=\"261.341\">0.5</text>\n</g>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 26.4745, 237.535)\" x=\"26.4745\" y=\"237.535\">0.6</text>\n</g>\n<polygon clip-path=\"url(#clip1004)\" points=\"\n39.4888,351.242 39.4888,375.869 58.5755,375.869 58.5755,351.242 39.4888,351.242 39.4888,351.242 \n \" fill=\"#009af9\" fill-opacity=\"1\"/>\n<polyline clip-path=\"url(#clip1004)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 39.4888,351.242 39.4888,375.869 58.5755,375.869 58.5755,351.242 39.4888,351.242 \n \"/>\n<polygon clip-path=\"url(#clip1004)\" points=\"\n63.3472,211.811 63.3472,375.869 82.4339,375.869 82.4339,211.811 63.3472,211.811 63.3472,211.811 \n \" fill=\"#009af9\" fill-opacity=\"1\"/>\n<polyline clip-path=\"url(#clip1004)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 63.3472,211.811 63.3472,375.869 82.4339,375.869 82.4339,211.811 63.3472,211.811 \n \"/>\n<polygon clip-path=\"url(#clip1004)\" points=\"\n87.2055,349.934 87.2055,375.869 106.292,375.869 106.292,349.934 87.2055,349.934 87.2055,349.934 \n \" fill=\"#009af9\" fill-opacity=\"1\"/>\n<polyline clip-path=\"url(#clip1004)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 87.2055,349.934 87.2055,375.869 106.292,375.869 106.292,349.934 87.2055,349.934 \n \"/>\n<polygon clip-path=\"url(#clip1004)\" points=\"\n111.064,258.502 111.064,375.869 130.151,375.869 130.151,258.502 111.064,258.502 111.064,258.502 \n \" fill=\"#009af9\" fill-opacity=\"1\"/>\n<polyline clip-path=\"url(#clip1004)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 111.064,258.502 111.064,375.869 130.151,375.869 130.151,258.502 111.064,258.502 \n \"/>\n<polygon clip-path=\"url(#clip1004)\" points=\"\n134.922,227.652 134.922,375.869 154.009,375.869 154.009,227.652 134.922,227.652 134.922,227.652 \n \" fill=\"#009af9\" fill-opacity=\"1\"/>\n<polyline clip-path=\"url(#clip1004)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 134.922,227.652 134.922,375.869 154.009,375.869 154.009,227.652 134.922,227.652 \n \"/>\n<polygon clip-path=\"url(#clip1004)\" points=\"\n158.781,286.37 158.781,375.869 177.867,375.869 177.867,286.37 158.781,286.37 158.781,286.37 \n \" fill=\"#009af9\" fill-opacity=\"1\"/>\n<polyline clip-path=\"url(#clip1004)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 158.781,286.37 158.781,375.869 177.867,375.869 177.867,286.37 158.781,286.37 \n \"/>\n<polygon clip-path=\"url(#clip1004)\" points=\"\n182.639,267.576 182.639,375.869 201.726,375.869 201.726,267.576 182.639,267.576 182.639,267.576 \n \" fill=\"#009af9\" fill-opacity=\"1\"/>\n<polyline clip-path=\"url(#clip1004)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 182.639,267.576 182.639,375.869 201.726,375.869 201.726,267.576 182.639,267.576 \n \"/>\n<polygon clip-path=\"url(#clip1004)\" points=\"\n206.497,253.763 206.497,375.869 225.584,375.869 225.584,253.763 206.497,253.763 206.497,253.763 \n \" fill=\"#009af9\" fill-opacity=\"1\"/>\n<polyline clip-path=\"url(#clip1004)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 206.497,253.763 206.497,375.869 225.584,375.869 225.584,253.763 206.497,253.763 \n \"/>\n<polygon clip-path=\"url(#clip1004)\" points=\"\n230.356,359.059 230.356,375.869 249.442,375.869 249.442,359.059 230.356,359.059 230.356,359.059 \n \" fill=\"#009af9\" fill-opacity=\"1\"/>\n<polyline clip-path=\"url(#clip1004)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 230.356,359.059 230.356,375.869 249.442,375.869 249.442,359.059 230.356,359.059 \n \"/>\n<polygon clip-path=\"url(#clip1004)\" points=\"\n254.214,248.415 254.214,375.869 273.301,375.869 273.301,248.415 254.214,248.415 254.214,248.415 \n \" fill=\"#009af9\" fill-opacity=\"1\"/>\n<polyline clip-path=\"url(#clip1004)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 254.214,248.415 254.214,375.869 273.301,375.869 273.301,248.415 254.214,248.415 \n \"/>\n<polygon clip-path=\"url(#clip1000)\" points=\"\n189.608,262.931 262.315,262.931 262.315,232.691 189.608,232.691 \n \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 189.608,262.931 262.315,262.931 262.315,232.691 189.608,232.691 189.608,262.931 \n \"/>\n<polygon clip-path=\"url(#clip1000)\" points=\"\n195.608,253.859 231.608,253.859 231.608,241.763 195.608,241.763 195.608,253.859 \n \" fill=\"#009af9\" fill-opacity=\"1\"/>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 195.608,253.859 231.608,253.859 231.608,241.763 195.608,241.763 195.608,253.859 \n \"/>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:start;\" transform=\"rotate(0, 237.608, 252.311)\" x=\"237.608\" y=\"252.311\">y1</text>\n</g>\n<polygon clip-path=\"url(#clip1000)\" points=\"\n332.474,375.869 580.315,375.869 580.315,211.811 332.474,211.811 \n \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n<defs>\n <clipPath id=\"clip1005\">\n <rect x=\"332\" y=\"211\" width=\"249\" height=\"165\"/>\n </clipPath>\n</defs>\n<polygon clip-path=\"url(#clip1000)\" points=\"\n456.395,306.232 526.032,306.232 526.021,305.017 525.989,303.802 525.936,302.587 525.862,301.374 525.767,300.163 525.65,298.953 525.512,297.745 525.354,296.54 \n 525.174,295.338 \n \" fill=\"#ffb200\" fill-opacity=\"1\"/>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:start;\" transform=\"rotate(0, 568.759, 304.722)\" x=\"568.759\" y=\"304.722\">1</text>\n</g>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 525.817,300.768 532.759,300.222 562.759,300.222 \n \"/>\n<polygon clip-path=\"url(#clip1000)\" points=\"\n456.395,306.232 525.174,295.338 524.974,294.14 524.752,292.945 524.51,291.754 524.247,290.567 523.963,289.385 523.659,288.209 523.334,287.037 522.989,285.872 \n 522.623,284.713 522.238,283.56 521.832,282.415 521.406,281.276 520.961,280.145 520.496,279.023 520.011,277.908 519.507,276.802 518.984,275.705 518.442,274.617 \n 517.88,273.539 517.3,272.471 516.702,271.413 516.085,270.366 515.45,269.33 514.797,268.305 514.126,267.291 513.438,266.29 512.732,265.3 512.009,264.323 \n 511.269,263.359 510.513,262.408 509.74,261.47 508.95,260.546 508.145,259.636 507.324,258.74 506.487,257.858 505.635,256.991 504.769,256.139 503.887,255.303 \n 502.991,254.482 502.081,253.676 501.156,252.887 500.219,252.114 499.267,251.357 498.303,250.617 497.326,249.895 496.337,249.189 495.335,248.5 494.322,247.83 \n 493.297,247.177 492.26,246.541 491.213,245.925 490.155,245.326 489.087,244.746 488.009,244.185 486.921,243.643 485.825,243.119 484.719,242.615 483.604,242.131 \n 482.481,241.666 481.35,241.22 480.212,240.795 479.066,240.389 477.914,240.003 \n \" fill=\"#7f3e74\" fill-opacity=\"1\"/>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:start;\" transform=\"rotate(0, 550.642, 260.984)\" x=\"550.642\" y=\"260.984\">2</text>\n</g>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 509.347,261.006 514.642,256.484 544.642,256.484 \n \"/>\n<polygon clip-path=\"url(#clip1000)\" points=\"\n456.395,306.232 477.914,240.003 476.755,239.638 475.589,239.293 474.418,238.968 473.241,238.664 472.06,238.38 470.873,238.117 469.682,237.874 468.487,237.653 \n 467.288,237.452 466.086,237.273 \n \" fill=\"#ff6700\" fill-opacity=\"1\"/>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:start;\" transform=\"rotate(0, 509.626, 236.095)\" x=\"509.626\" y=\"236.095\">3</text>\n</g>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 472.06,238.38 473.626,231.595 503.626,231.595 \n \"/>\n<polygon clip-path=\"url(#clip1000)\" points=\"\n456.395,306.232 466.086,237.273 464.881,237.114 463.674,236.977 462.464,236.86 461.252,236.765 460.039,236.691 458.825,236.637 457.61,236.606 456.395,236.595 \n 455.179,236.606 453.964,236.637 452.75,236.691 451.537,236.765 450.325,236.86 449.116,236.977 447.908,237.114 446.703,237.273 445.501,237.452 444.302,237.653 \n 443.107,237.874 441.916,238.117 440.73,238.38 439.548,238.664 438.371,238.968 437.2,239.293 436.035,239.638 434.876,240.003 433.723,240.389 432.578,240.795 \n 431.439,241.22 430.308,241.666 429.185,242.131 428.071,242.615 426.965,243.119 425.868,243.643 424.78,244.185 423.702,244.746 422.634,245.326 421.576,245.925 \n 420.529,246.541 419.493,247.177 418.468,247.83 417.454,248.5 416.453,249.189 415.463,249.895 414.486,250.617 \n \" fill=\"#59a3c0\" fill-opacity=\"1\"/>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 401.215, 236.571)\" x=\"401.215\" y=\"236.571\">4</text>\n</g>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 438.959,238.813 437.215,232.071 407.215,232.071 \n \"/>\n<polygon clip-path=\"url(#clip1000)\" points=\"\n456.395,306.232 414.486,250.617 413.522,251.357 412.571,252.114 411.633,252.887 410.709,253.676 409.799,254.482 408.903,255.303 408.021,256.139 407.154,256.991 \n 406.302,257.858 405.466,258.74 404.644,259.636 403.839,260.546 403.05,261.47 402.277,262.408 401.52,263.359 400.78,264.323 400.057,265.3 399.352,266.29 \n 398.663,267.291 397.992,268.305 397.339,269.33 396.704,270.366 396.087,271.413 395.489,272.471 394.909,273.539 394.348,274.617 393.806,275.705 393.282,276.802 \n 392.778,277.908 392.294,279.023 391.829,280.145 391.383,281.276 390.958,282.415 390.552,283.56 390.166,284.713 389.801,285.872 389.456,287.037 389.131,288.209 \n 388.826,289.385 388.543,290.567 388.28,291.754 388.037,292.945 387.816,294.14 387.615,295.338 387.436,296.54 387.277,297.745 387.139,298.953 387.023,300.163 \n 386.928,301.374 386.853,302.587 386.8,303.802 386.769,305.017 386.758,306.232 386.769,307.447 386.8,308.662 386.853,309.876 386.928,311.089 \n \" fill=\"#c0001f\" fill-opacity=\"1\"/>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 350.691, 278.966)\" x=\"350.691\" y=\"278.966\">5</text>\n</g>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 393.028,277.354 386.691,274.466 356.691,274.466 \n \"/>\n<polygon clip-path=\"url(#clip1000)\" points=\"\n456.395,306.232 386.928,311.089 387.023,312.301 387.139,313.511 387.277,314.718 387.436,315.923 387.615,317.125 387.816,318.324 388.037,319.519 388.28,320.71 \n 388.543,321.897 388.826,323.079 389.131,324.255 389.456,325.426 389.801,326.592 390.166,327.751 390.552,328.903 390.958,330.049 391.383,331.187 391.829,332.318 \n 392.294,333.441 392.778,334.556 393.282,335.662 393.806,336.759 394.348,337.846 394.909,338.924 395.489,339.992 396.087,341.05 396.704,342.097 397.339,343.134 \n 397.992,344.159 398.663,345.172 399.352,346.174 400.057,347.163 400.78,348.14 401.52,349.105 \n \" fill=\"#cda161\" fill-opacity=\"1\"/>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 348.882, 338.183)\" x=\"348.882\" y=\"338.183\">6</text>\n</g>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 391.383,331.187 384.882,333.683 354.882,333.683 \n \"/>\n<polygon clip-path=\"url(#clip1000)\" points=\"\n456.395,306.232 401.52,349.105 402.277,350.056 403.05,350.994 403.839,351.918 404.644,352.828 405.466,353.724 406.302,354.606 407.154,355.473 408.021,356.324 \n 408.903,357.161 409.799,357.982 410.709,358.787 411.633,359.577 412.571,360.35 413.522,361.106 414.486,361.846 415.463,362.569 416.453,363.275 417.454,363.963 \n 418.468,364.634 419.493,365.287 420.529,365.922 421.576,366.539 422.634,367.138 423.702,367.718 424.78,368.279 425.868,368.821 426.965,369.344 428.071,369.848 \n 429.185,370.333 430.308,370.798 431.439,371.243 432.578,371.669 433.723,372.075 434.876,372.46 436.035,372.826 437.2,373.171 438.371,373.496 439.548,373.8 \n 440.73,374.084 441.916,374.347 443.107,374.589 \n \" fill=\"#807066\" fill-opacity=\"1\"/>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 380.371, 376.045)\" x=\"380.371\" y=\"376.045\">7</text>\n</g>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 420.01,365.607 416.371,371.545 386.371,371.545 \n \"/>\n<polygon clip-path=\"url(#clip1000)\" points=\"\n456.395,306.232 443.107,374.589 444.302,374.811 445.501,375.011 446.703,375.191 447.908,375.35 449.116,375.487 450.325,375.604 451.537,375.699 452.75,375.773 \n 453.964,375.826 455.179,375.858 456.395,375.869 457.61,375.858 458.825,375.826 460.039,375.773 461.252,375.699 462.464,375.604 463.674,375.487 464.881,375.35 \n 466.086,375.191 467.288,375.011 468.487,374.811 469.682,374.589 470.873,374.347 472.06,374.084 473.241,373.8 474.418,373.496 475.589,373.171 476.755,372.826 \n 477.914,372.46 479.066,372.075 480.212,371.669 481.35,371.243 482.481,370.798 483.604,370.333 484.719,369.848 485.825,369.344 486.921,368.821 488.009,368.279 \n 489.087,367.718 490.155,367.138 491.213,366.539 492.26,365.922 493.297,365.287 494.322,364.634 495.335,363.963 496.337,363.275 497.326,362.569 \n \" fill=\"#007d33\" fill-opacity=\"1\"/>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:start;\" transform=\"rotate(0, 508.974, 385.517)\" x=\"508.974\" y=\"385.517\">8</text>\n</g>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 471.467,374.218 472.974,381.017 502.974,381.017 \n \"/>\n<polygon clip-path=\"url(#clip1000)\" points=\"\n456.395,306.232 497.326,362.569 498.303,361.846 499.267,361.106 500.219,360.35 501.156,359.577 502.081,358.787 502.991,357.982 \n \" fill=\"#f6768d\" fill-opacity=\"1\"/>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:start;\" transform=\"rotate(0, 540.601, 370.262)\" x=\"540.601\" y=\"370.262\">9</text>\n</g>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 500.219,360.35 504.601,365.762 534.601,365.762 \n \"/>\n<polygon clip-path=\"url(#clip1000)\" points=\"\n456.395,306.232 502.991,357.982 503.887,357.161 504.769,356.324 505.635,355.473 506.487,354.606 507.324,353.724 508.145,352.828 508.95,351.918 509.74,350.994 \n 510.513,350.056 511.269,349.105 512.009,348.14 512.732,347.163 513.438,346.174 514.126,345.172 514.797,344.159 515.45,343.134 516.085,342.097 516.702,341.05 \n 517.3,339.992 517.88,338.924 518.442,337.846 518.984,336.759 519.507,335.662 520.011,334.556 520.496,333.441 520.961,332.318 521.406,331.187 521.832,330.049 \n 522.238,328.903 522.623,327.751 522.989,326.592 523.334,325.426 523.659,324.255 523.963,323.079 524.247,321.897 524.51,320.71 524.752,319.519 524.974,318.324 \n 525.174,317.125 525.354,315.923 525.512,314.718 525.65,313.511 525.767,312.301 525.862,311.089 525.936,309.876 525.989,308.662 526.021,307.447 526.032,306.232 \n 526.021,305.017 \n \" fill=\"#00528a\" fill-opacity=\"1\"/>\n<g clip-path=\"url(#clip1000)\">\n<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:start;\" transform=\"rotate(0, 562.642, 341.276)\" x=\"562.642\" y=\"341.276\">10</text>\n</g>\n<polyline clip-path=\"url(#clip1000)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n 520.256,333.999 526.642,336.776 556.642,336.776 \n \"/>\n</svg>\n"
},
"metadata": {}
}
]
},
{
"metadata": {
"trusted": true
},
"cell_type": "code",
"source": "plotly(); example()",
"execution_count": 5,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/html": " <script type='text/javascript'>\n define('plotly', function(require, exports, module) {\n /**\n* plotly.js v1.34.0\n* Copyright 2012-2018, Plotly, Inc.\n* All rights reserved.\n* Licensed under the MIT license\n*/\n!function(t){if(\"object\"==typeof exports&&\"undefined\"!=typeof module)module.exports=t();else if(\"function\"==typeof define&&define.amd)define([],t);else{(\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:this).Plotly=t()}}(function(){return function t(e,r,n){function i(o,s){if(!r[o]){if(!e[o]){var l=\"function\"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var c=new Error(\"Cannot find module '\"+o+\"'\");throw c.code=\"MODULE_NOT_FOUND\",c}var u=r[o]={exports:{}};e[o][0].call(u.exports,function(t){var r=e[o][1][t];return i(r||t)},u,u.exports,t,e,r,n)}return r[o].exports}for(var a=\"function\"==typeof require&&require,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(t,e,r){\"use strict\";var n=t(\"../src/lib\"),i={\"X,X div\":\"font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;\",\"X input,X button\":\"font-family:'Open Sans', verdana, arial, sans-serif;\",\"X input:focus,X button:focus\":\"outline:none;\",\"X a\":\"text-decoration:none;\",\"X a:hover\":\"text-decoration:none;\",\"X .crisp\":\"shape-rendering:crispEdges;\",\"X .user-select-none\":\"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;\",\"X svg\":\"overflow:hidden;\",\"X svg a\":\"fill:#447adb;\",\"X svg a:hover\":\"fill:#3c6dc5;\",\"X .main-svg\":\"position:absolute;top:0;left:0;pointer-events:none;\",\"X .main-svg .draglayer\":\"pointer-events:all;\",\"X .cursor-default\":\"cursor:default;\",\"X .cursor-pointer\":\"cursor:pointer;\",\"X .cursor-crosshair\":\"cursor:crosshair;\",\"X .cursor-move\":\"cursor:move;\",\"X .cursor-col-resize\":\"cursor:col-resize;\",\"X .cursor-row-resize\":\"cursor:row-resize;\",\"X .cursor-ns-resize\":\"cursor:ns-resize;\",\"X .cursor-ew-resize\":\"cursor:ew-resize;\",\"X .cursor-sw-resize\":\"cursor:sw-resize;\",\"X .cursor-s-resize\":\"cursor:s-resize;\",\"X .cursor-se-resize\":\"cursor:se-resize;\",\"X .cursor-w-resize\":\"cursor:w-resize;\",\"X .cursor-e-resize\":\"cursor:e-resize;\",\"X .cursor-nw-resize\":\"cursor:nw-resize;\",\"X .cursor-n-resize\":\"cursor:n-resize;\",\"X .cursor-ne-resize\":\"cursor:ne-resize;\",\"X .modebar\":\"position:absolute;top:2px;right:2px;z-index:1001;background:rgba(255,255,255,0.7);\",\"X .modebar--hover\":\"opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;\",\"X:hover .modebar--hover\":\"opacity:1;\",\"X .modebar-group\":\"float:left;display:inline-block;box-sizing:border-box;margin-left:8px;position:relative;vertical-align:middle;white-space:nowrap;\",\"X .modebar-group:first-child\":\"margin-left:0px;\",\"X .modebar-btn\":\"position:relative;font-size:16px;padding:3px 4px;cursor:pointer;line-height:normal;box-sizing:border-box;\",\"X .modebar-btn svg\":\"position:relative;top:2px;\",\"X .modebar-btn path\":\"fill:rgba(0,31,95,0.3);\",\"X .modebar-btn.active path,X .modebar-btn:hover path\":\"fill:rgba(0,22,72,0.5);\",\"X .modebar-btn.modebar-btn--logo\":\"padding:3px 1px;\",\"X .modebar-btn.modebar-btn--logo path\":\"fill:#447adb !important;\",\"X [data-title]:before,X [data-title]:after\":\"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;\",\"X [data-title]:hover:before,X [data-title]:hover:after\":\"display:block;opacity:1;\",\"X [data-title]:before\":\"content:'';position:absolute;background:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;\",\"X [data-title]:after\":\"content:attr(data-title);background:#69738a;color:white;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;\",\"X .select-outline\":\"fill:none;stroke-width:1;shape-rendering:crispEdges;\",\"X .select-outline-1\":\"stroke:white;\",\"X .select-outline-2\":\"stroke:black;stroke-dasharray:2px 2px;\",Y:\"font-family:'Open Sans';position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;\",\"Y p\":\"margin:0;\",\"Y .notifier-note\":\"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,0.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;\",\"Y .notifier-close\":\"color:#fff;opacity:0.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;\",\"Y .notifier-close:hover\":\"color:#444;text-decoration:none;cursor:pointer;\"};for(var a in i){var o=a.replace(/^,/,\" ,\").replace(/X/g,\".js-plotly-plot .plotly\").replace(/Y/g,\".plotly-notifier\");n.addStyleRule(o,i[a])}},{\"../src/lib\":724}],2:[function(t,e,r){\"use strict\";e.exports={undo:{width:857.1,path:\"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z\",ascent:850,descent:-150},home:{width:928.6,path:\"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z\",ascent:850,descent:-150},\"camera-retro\":{width:1e3,path:\"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z\",ascent:850,descent:-150},zoombox:{width:1e3,path:\"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z\",ascent:850,descent:-150},pan:{width:1e3,path:\"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z\",ascent:850,descent:-150},zoom_plus:{width:1e3,path:\"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z\",ascent:850,descent:-150},zoom_minus:{width:1e3,path:\"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z\",ascent:850,descent:-150},autoscale:{width:1e3,path:\"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z\",ascent:850,descent:-150},tooltip_basic:{width:1500,path:\"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z\",ascent:850,descent:-150},tooltip_compare:{width:1125,path:\"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z\",ascent:850,descent:-150},plotlylogo:{width:1542,path:\"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z\",ascent:850,descent:-150},\"z-axis\":{width:1e3,path:\"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z\",ascent:850,descent:-150},\"3d_rotate\":{width:1e3,path:\"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z\",ascent:850,descent:-150},camera:{width:1e3,path:\"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z\",ascent:850,descent:-150},movie:{width:1e3,path:\"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z\",ascent:850,descent:-150},question:{width:857.1,path:\"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z\",ascent:850,descent:-150},disk:{width:857.1,path:\"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z\",ascent:850,descent:-150},lasso:{width:1031,path:\"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z\",ascent:850,descent:-150},selectbox:{width:1e3,path:\"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z\",ascent:850,descent:-150},spikeline:{width:1e3,path:\"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z\",ascent:850,descent:-150}}},{}],3:[function(t,e,r){\"use strict\";e.exports=t(\"../src/transforms/aggregate\")},{\"../src/transforms/aggregate\":1148}],4:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/bar\")},{\"../src/traces/bar\":868}],5:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/box\")},{\"../src/traces/box\":881}],6:[function(t,e,r){\"use strict\";e.exports=t(\"../src/components/calendars\")},{\"../src/components/calendars\":596}],7:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/candlestick\")},{\"../src/traces/candlestick\":890}],8:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/carpet\")},{\"../src/traces/carpet\":911}],9:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/choropleth\")},{\"../src/traces/choropleth\":926}],10:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/contour\")},{\"../src/traces/contour\":944}],11:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/contourcarpet\")},{\"../src/traces/contourcarpet\":955}],12:[function(t,e,r){\"use strict\";e.exports=t(\"../src/core\")},{\"../src/core\":705}],13:[function(t,e,r){\"use strict\";e.exports=t(\"../src/transforms/filter\")},{\"../src/transforms/filter\":1149}],14:[function(t,e,r){\"use strict\";e.exports=t(\"../src/transforms/groupby\")},{\"../src/transforms/groupby\":1150}],15:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/heatmap\")},{\"../src/traces/heatmap\":968}],16:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/heatmapgl\")},{\"../src/traces/heatmapgl\":978}],17:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/histogram\")},{\"../src/traces/histogram\":989}],18:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/histogram2d\")},{\"../src/traces/histogram2d\":995}],19:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/histogram2dcontour\")},{\"../src/traces/histogram2dcontour\":999}],20:[function(t,e,r){\"use strict\";var n=t(\"./core\");n.register([t(\"./bar\"),t(\"./box\"),t(\"./heatmap\"),t(\"./histogram\"),t(\"./histogram2d\"),t(\"./histogram2dcontour\"),t(\"./pie\"),t(\"./contour\"),t(\"./scatterternary\"),t(\"./violin\"),t(\"./scatter3d\"),t(\"./surface\"),t(\"./mesh3d\"),t(\"./scattergeo\"),t(\"./choropleth\"),t(\"./scattergl\"),t(\"./pointcloud\"),t(\"./heatmapgl\"),t(\"./parcoords\"),t(\"./scattermapbox\"),t(\"./sankey\"),t(\"./table\"),t(\"./carpet\"),t(\"./scattercarpet\"),t(\"./contourcarpet\"),t(\"./ohlc\"),t(\"./candlestick\"),t(\"./scatterpolar\"),t(\"./scatterpolargl\")]),n.register([t(\"./aggregate\"),t(\"./filter\"),t(\"./groupby\"),t(\"./sort\")]),n.register([t(\"./calendars\")]),e.exports=n},{\"./aggregate\":3,\"./bar\":4,\"./box\":5,\"./calendars\":6,\"./candlestick\":7,\"./carpet\":8,\"./choropleth\":9,\"./contour\":10,\"./contourcarpet\":11,\"./core\":12,\"./filter\":13,\"./groupby\":14,\"./heatmap\":15,\"./heatmapgl\":16,\"./histogram\":17,\"./histogram2d\":18,\"./histogram2dcontour\":19,\"./mesh3d\":21,\"./ohlc\":22,\"./parcoords\":23,\"./pie\":24,\"./pointcloud\":25,\"./sankey\":26,\"./scatter3d\":27,\"./scattercarpet\":28,\"./scattergeo\":29,\"./scattergl\":30,\"./scattermapbox\":31,\"./scatterpolar\":32,\"./scatterpolargl\":33,\"./scatterternary\":34,\"./sort\":35,\"./surface\":36,\"./table\":37,\"./violin\":38}],21:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/mesh3d\")},{\"../src/traces/mesh3d\":1005}],22:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/ohlc\")},{\"../src/traces/ohlc\":1010}],23:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/parcoords\")},{\"../src/traces/parcoords\":1019}],24:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/pie\")},{\"../src/traces/pie\":1029}],25:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/pointcloud\")},{\"../src/traces/pointcloud\":1038}],26:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/sankey\")},{\"../src/traces/sankey\":1044}],27:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scatter3d\")},{\"../src/traces/scatter3d\":1078}],28:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scattercarpet\")},{\"../src/traces/scattercarpet\":1084}],29:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scattergeo\")},{\"../src/traces/scattergeo\":1091}],30:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scattergl\")},{\"../src/traces/scattergl\":1097}],31:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scattermapbox\")},{\"../src/traces/scattermapbox\":1103}],32:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scatterpolar\")},{\"../src/traces/scatterpolar\":1110}],33:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scatterpolargl\")},{\"../src/traces/scatterpolargl\":1114}],34:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scatterternary\")},{\"../src/traces/scatterternary\":1120}],35:[function(t,e,r){\"use strict\";e.exports=t(\"../src/transforms/sort\")},{\"../src/transforms/sort\":1152}],36:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/surface\")},{\"../src/traces/surface\":1127}],37:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/table\")},{\"../src/traces/table\":1135}],38:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/violin\")},{\"../src/traces/violin\":1142}],39:[function(t,e,r){\"use strict\";e.exports=function(t,e){t=t||document.body,e=e||{};var r=[.01,1/0];\"distanceLimits\"in e&&(r[0]=e.distanceLimits[0],r[1]=e.distanceLimits[1]);\"zoomMin\"in e&&(r[0]=e.zoomMin);\"zoomMax\"in e&&(r[1]=e.zoomMax);var c=i({center:e.center||[0,0,0],up:e.up||[0,1,0],eye:e.eye||[0,0,10],mode:e.mode||\"orbit\",distanceLimits:r}),u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],f=0,h=t.clientWidth,d=t.clientHeight,p={view:c,element:t,delay:e.delay||16,rotateSpeed:e.rotateSpeed||1,zoomSpeed:e.zoomSpeed||1,translateSpeed:e.translateSpeed||1,flipX:!!e.flipX,flipY:!!e.flipY,modes:c.modes,tick:function(){var e=n(),r=this.delay;c.idle(e-r),c.flush(e-(100+2*r));var i=e-2*r;c.recalcMatrix(i);for(var a=!0,o=c.computedMatrix,s=0;s<16;++s)a=a&&u[s]===o[s],u[s]=o[s];var l=t.clientWidth===h&&t.clientHeight===d;return h=t.clientWidth,d=t.clientHeight,a?!l:(f=Math.exp(c.computedRadius[0]),!0)},lookAt:function(t,e,r){c.lookAt(c.lastT(),t,e,r)},rotate:function(t,e,r){c.rotate(c.lastT(),t,e,r)},pan:function(t,e,r){c.pan(c.lastT(),t,e,r)},translate:function(t,e,r){c.translate(c.lastT(),t,e,r)}};Object.defineProperties(p,{matrix:{get:function(){return c.computedMatrix},set:function(t){return c.setMatrix(c.lastT(),t),c.computedMatrix},enumerable:!0},mode:{get:function(){return c.getMode()},set:function(t){return c.setMode(t),c.getMode()},enumerable:!0},center:{get:function(){return c.computedCenter},set:function(t){return c.lookAt(c.lastT(),t),c.computedCenter},enumerable:!0},eye:{get:function(){return c.computedEye},set:function(t){return c.lookAt(c.lastT(),null,t),c.computedEye},enumerable:!0},up:{get:function(){return c.computedUp},set:function(t){return c.lookAt(c.lastT(),null,null,t),c.computedUp},enumerable:!0},distance:{get:function(){return f},set:function(t){return c.setDistance(c.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return c.getDistanceLimits(r)},set:function(t){return c.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener(\"contextmenu\",function(t){return t.preventDefault(),!1});var m=0,v=0,g={shift:!1,control:!1,alt:!1,meta:!1};function y(e,r,i,a){var o=1/t.clientHeight,s=o*(r-m),l=o*(i-v),u=p.flipX?1:-1,h=p.flipY?1:-1,d=Math.PI*p.rotateSpeed,y=n();if(1&e)a.shift?c.rotate(y,0,0,-s*d):c.rotate(y,u*d*s,-h*d*l,0);else if(2&e)c.pan(y,-p.translateSpeed*s*f,p.translateSpeed*l*f,0);else if(4&e){var b=p.zoomSpeed*l/window.innerHeight*(y-c.lastT())*50;c.pan(y,0,0,f*(Math.exp(b)-1))}m=r,v=i,g=a}return a(t,y),t.addEventListener(\"touchstart\",function(e){var r=s(e.changedTouches[0],t);y(0,r[0],r[1],g),y(1,r[0],r[1],g),e.preventDefault()},!!l&&{passive:!1}),t.addEventListener(\"touchmove\",function(e){var r=s(e.changedTouches[0],t);y(1,r[0],r[1],g),e.preventDefault()},!!l&&{passive:!1}),t.addEventListener(\"touchend\",function(e){s(e.changedTouches[0],t),y(0,m,v,g),e.preventDefault()},!!l&&{passive:!1}),o(t,function(t,e,r){var i=p.flipX?1:-1,a=p.flipY?1:-1,o=n();if(Math.abs(t)>Math.abs(e))c.rotate(o,0,0,-t*i*Math.PI*p.rotateSpeed/window.innerWidth);else{var s=p.zoomSpeed*a*e/window.innerHeight*(o-c.lastT())/100;c.pan(o,0,0,f*(Math.exp(s)-1))}},!0),p};var n=t(\"right-now\"),i=t(\"3d-view\"),a=t(\"mouse-change\"),o=t(\"mouse-wheel\"),s=t(\"mouse-event-offset\"),l=t(\"has-passive-events\")},{\"3d-view\":40,\"has-passive-events\":256,\"mouse-change\":424,\"mouse-event-offset\":425,\"mouse-wheel\":427,\"right-now\":489}],40:[function(t,e,r){\"use strict\";e.exports=function(t){var e=(t=t||{}).eye||[0,0,1],r=t.center||[0,0,0],s=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],c=t.mode||\"turntable\",u=n(),f=i(),h=a();return u.setDistanceLimits(l[0],l[1]),u.lookAt(0,e,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),new o({turntable:u,orbit:f,matrix:h},c)};var n=t(\"turntable-camera-controller\"),i=t(\"orbit-camera-controller\"),a=t(\"matrix-camera-controller\");function o(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map(function(e){return t[e]}),this._mode=e,this._active=t[e],this._active||(this._mode=\"turntable\",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=o.prototype;[[\"flush\",1],[\"idle\",1],[\"lookAt\",4],[\"rotate\",4],[\"pan\",4],[\"translate\",4],[\"setMatrix\",2],[\"setDistanceLimits\",2],[\"setDistance\",2]].forEach(function(t){for(var e=t[0],r=[],n=0;n<t[1];++n)r.push(\"a\"+n);var i=\"var cc=this._controllerList;for(var i=0;i<cc.length;++i){cc[i].\"+t[0]+\"(\"+r.join()+\")}\";s[e]=Function.apply(null,r.concat(i))}),s.recalcMatrix=function(t){this._active.recalcMatrix(t)},s.getDistance=function(t){return this._active.getDistance(t)},s.getDistanceLimits=function(t){return this._active.getDistanceLimits(t)},s.lastT=function(){return this._active.lastT()},s.setMode=function(t){if(t!==this._mode){var e=this._controllerNames.indexOf(t);if(!(e<0)){var r=this._active,n=this._controllerList[e],i=Math.max(r.lastT(),n.lastT());r.recalcMatrix(i),n.setMatrix(i,r.computedMatrix),this._active=n,this._mode=t,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}}},s.getMode=function(){return this._mode}},{\"matrix-camera-controller\":422,\"orbit-camera-controller\":445,\"turntable-camera-controller\":531}],41:[function(t,e,r){var n,i;n=this,i=function(t,e,r,n){\"use strict\";t.sankey=function(){var t={},i=24,a=8,o=[1,1],s=[],l=[];function c(){function t(t,e){return t.source.y-e.source.y||t.originalIndex-e.originalIndex}function e(t,e){return t.target.y-e.target.y||t.originalIndex-e.originalIndex}s.forEach(function(r){r.sourceLinks.sort(e),r.targetLinks.sort(t)}),s.forEach(function(t){var e=0,r=0;t.sourceLinks.forEach(function(t){t.sy=e,e+=t.dy}),t.targetLinks.forEach(function(t){t.ty=r,r+=t.dy})})}function u(t){return t.y+t.dy/2}function f(t){return t.value}return t.nodeWidth=function(e){return arguments.length?(i=+e,t):i},t.nodePadding=function(e){return arguments.length?(a=+e,t):a},t.nodes=function(e){return arguments.length?(s=e,t):s},t.links=function(e){return arguments.length?(l=e,t):l},t.size=function(e){return arguments.length?(o=e,t):o},t.layout=function(n){return s.forEach(function(t){t.sourceLinks=[],t.targetLinks=[]}),l.forEach(function(t,e){var r=t.source,n=t.target;\"number\"==typeof r&&(r=t.source=s[t.source]),\"number\"==typeof n&&(n=t.target=s[t.target]),t.originalIndex=e,r.sourceLinks.push(t),n.targetLinks.push(t)}),s.forEach(function(t){t.value=Math.max(e.sum(t.sourceLinks,f),e.sum(t.targetLinks,f))}),function(){for(var t,e,r=s,n=0;r.length;)t=[],r.forEach(function(e){e.x=n,e.dx=i,e.sourceLinks.forEach(function(e){t.indexOf(e.target)<0&&t.push(e.target)})}),r=t,++n;(function(t){s.forEach(function(e){e.sourceLinks.length||(e.x=t-1)})})(n),e=(o[0]-i)/(n-1),s.forEach(function(t){t.x*=e})}(),function(t){var n,i=r.nest().key(function(t){return t.x}).sortKeys(e.ascending).entries(s).map(function(t){return t.values});n=e.min(i,function(t){return(o[1]-(t.length-1)*a)/e.sum(t,f)}),i.forEach(function(t){t.forEach(function(t,e){t.y=e,t.dy=t.value*n})}),l.forEach(function(t){t.dy=t.value*n}),p();for(var c=1;t>0;--t)d(c*=.99),p(),h(c),p();function h(t){function r(t){return u(t.source)*t.value}i.forEach(function(n){n.forEach(function(n){if(n.targetLinks.length){var i=e.sum(n.targetLinks,r)/e.sum(n.targetLinks,f);n.y+=(i-u(n))*t}})})}function d(t){function r(t){return u(t.target)*t.value}i.slice().reverse().forEach(function(n){n.forEach(function(n){if(n.sourceLinks.length){var i=e.sum(n.sourceLinks,r)/e.sum(n.sourceLinks,f);n.y+=(i-u(n))*t}})})}function p(){i.forEach(function(t){var e,r,n,i=0,s=t.length;for(t.sort(m),n=0;n<s;++n)e=t[n],(r=i-e.y)>0&&(e.y+=r),i=e.y+e.dy+a;if((r=i-a-o[1])>0)for(i=e.y-=r,n=s-2;n>=0;--n)e=t[n],(r=e.y+e.dy+a-i)>0&&(e.y-=r),i=e.y})}function m(t,e){return t.y-e.y}}(n),c(),t},t.relayout=function(){return c(),t},t.link=function(){var t=.5;function e(e){var r=e.source.x+e.source.dx,i=e.target.x,a=n.interpolateNumber(r,i),o=a(t),s=a(1-t),l=e.source.y+e.sy,c=l+e.dy,u=e.target.y+e.ty,f=u+e.dy;return\"M\"+r+\",\"+l+\"C\"+o+\",\"+l+\" \"+s+\",\"+u+\" \"+i+\",\"+u+\"L\"+i+\",\"+f+\"C\"+s+\",\"+f+\" \"+o+\",\"+c+\" \"+r+\",\"+c+\"Z\"}return e.curvature=function(r){return arguments.length?(t=+r,e):t},e},t},Object.defineProperty(t,\"__esModule\",{value:!0})},\"object\"==typeof r&&void 0!==e?i(r,t(\"d3-array\"),t(\"d3-collection\"),t(\"d3-interpolate\")):i(n.d3=n.d3||{},n.d3,n.d3,n.d3)},{\"d3-array\":120,\"d3-collection\":121,\"d3-interpolate\":125}],42:[function(t,e,r){\"use strict\";var n=\"undefined\"==typeof WeakMap?t(\"weak-map\"):WeakMap,i=t(\"gl-buffer\"),a=t(\"gl-vao\"),o=new n;e.exports=function(t){var e=o.get(t),r=e&&(e._triangleBuffer.handle||e._triangleBuffer.buffer);if(!r||!t.isBuffer(r)){var n=i(t,new Float32Array([-1,-1,-1,4,4,-1]));(e=a(t,[{buffer:n,type:t.FLOAT,size:2}]))._triangleBuffer=n,o.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}},{\"gl-buffer\":165,\"gl-vao\":237,\"weak-map\":553}],43:[function(t,e,r){e.exports=function(t){var e=0,r=0,n=0,i=0;return t.map(function(t){var a=(t=t.slice())[0],o=a.toUpperCase();if(a!=o)switch(t[0]=o,a){case\"a\":t[6]+=n,t[7]+=i;break;case\"v\":t[1]+=i;break;case\"h\":t[1]+=n;break;default:for(var s=1;s<t.length;)t[s++]+=n,t[s++]+=i}switch(o){case\"Z\":n=e,i=r;break;case\"H\":n=t[1];break;case\"V\":i=t[1];break;case\"M\":n=e=t[1],i=r=t[2];break;default:n=t[t.length-2],i=t[t.length-1]}return t})}},{}],44:[function(t,e,r){var n=t(\"pad-left\");e.exports=function(t,e,r){e=\"number\"==typeof e?e:1,r=r||\": \";var i=t.split(/\\r?\\n/),a=String(i.length+e-1).length;return i.map(function(t,i){var o=i+e,s=String(o).length,l=n(o,a-s);return l+r+t}).join(\"\\n\")}},{\"pad-left\":446}],45:[function(t,e,r){\"use strict\";e.exports=function(t){var e=t.length;if(0===e)return[];if(1===e)return[0];for(var r=t[0].length,n=[t[0]],a=[0],o=1;o<e;++o)if(n.push(t[o]),i(n,r)){if(a.push(o),a.length===r+1)return a}else n.pop();return a};var n=t(\"robust-orientation\");function i(t,e){for(var r=new Array(e+1),i=0;i<t.length;++i)r[i]=t[i];for(i=0;i<=t.length;++i){for(var a=t.length;a<=e;++a){for(var o=new Array(e),s=0;s<e;++s)o[s]=Math.pow(a+1-i,s);r[a]=o}if(n.apply(void 0,r))return!0}return!1}},{\"robust-orientation\":495}],46:[function(t,e,r){\"use strict\";e.exports=function(t,e){return n(e).filter(function(r){for(var n=new Array(r.length),a=0;a<r.length;++a)n[a]=e[r[a]];return i(n)*t<1})};var n=t(\"delaunay-triangulate\"),i=t(\"circumradius\")},{circumradius:93,\"delaunay-triangulate\":130}],47:[function(t,e,r){e.exports=function(t,e){return i(n(t,e))};var n=t(\"alpha-complex\"),i=t(\"simplicial-complex-boundary\")},{\"alpha-complex\":46,\"simplicial-complex-boundary\":503}],48:[function(t,e,r){\"use strict\";e.exports=function(t,e){if(!t||null==t.length)throw Error(\"Argument should be an array\");e=null==e?1:Math.floor(e);for(var r=Array(2*e),n=0;n<e;n++){for(var i=-1/0,a=1/0,o=n,s=t.length;o<s;o+=e)t[o]>i&&(i=t[o]),t[o]<a&&(a=t[o]);r[n]=a,r[e+n]=i}return r}},{}],49:[function(t,e,r){\"use strict\";var n=t(\"array-bounds\");e.exports=function(t,e,r){if(!t||null==t.length)throw Error(\"Argument should be an array\");null==e&&(e=1);null==r&&(r=n(t,e));for(var i=0;i<e;i++){var a=r[e+i],o=r[i],s=i,l=t.length;if(a===1/0&&o===-1/0)for(s=i;s<l;s+=e)t[s]=t[s]===a?1:t[s]===o?0:.5;else if(a===1/0)for(s=i;s<l;s+=e)t[s]=t[s]===a?1:0;else if(o===-1/0)for(s=i;s<l;s+=e)t[s]=t[s]===o?0:1;else{var c=a-o;for(s=i;s<l;s+=e)t[s]=0===c?.5:(t[s]-o)/c}}return t}},{\"array-bounds\":48}],50:[function(t,e,r){e.exports=function(t,e){var r=\"number\"==typeof t,n=\"number\"==typeof e;r&&!n?(e=t,t=0):r||n||(t=0,e=0);var i=(e|=0)-(t|=0);if(i<0)throw new Error(\"array length must be positive\");for(var a=new Array(i),o=0,s=t;o<i;o++,s++)a[o]=s;return a}},{}],51:[function(t,e,r){(function(r){\"use strict\";function n(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i<a;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}function i(t){return r.Buffer&&\"function\"==typeof r.Buffer.isBuffer?r.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}var a=t(\"util/\"),o=Object.prototype.hasOwnProperty,s=Array.prototype.slice,l=\"foo\"===function(){}.name;function c(t){return Object.prototype.toString.call(t)}function u(t){return!i(t)&&(\"function\"==typeof r.ArrayBuffer&&(\"function\"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}var f=e.exports=g,h=/\\s*function\\s+([^\\(\\s]*)\\s*/;function d(t){if(a.isFunction(t)){if(l)return t.name;var e=t.toString().match(h);return e&&e[1]}}function p(t,e){return\"string\"==typeof t?t.length<e?t:t.slice(0,e):t}function m(t){if(l||!a.isFunction(t))return a.inspect(t);var e=d(t);return\"[Function\"+(e?\": \"+e:\"\")+\"]\"}function v(t,e,r,n,i){throw new f.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:i})}function g(t,e){t||v(t,!0,e,\"==\",f.ok)}function y(t,e,r,o){if(t===e)return!0;if(i(t)&&i(e))return 0===n(t,e);if(a.isDate(t)&&a.isDate(e))return t.getTime()===e.getTime();if(a.isRegExp(t)&&a.isRegExp(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&\"object\"==typeof t||null!==e&&\"object\"==typeof e){if(u(t)&&u(e)&&c(t)===c(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===n(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(i(t)!==i(e))return!1;var l=(o=o||{actual:[],expected:[]}).actual.indexOf(t);return-1!==l&&l===o.expected.indexOf(e)||(o.actual.push(t),o.expected.push(e),function(t,e,r,n){if(null===t||void 0===t||null===e||void 0===e)return!1;if(a.isPrimitive(t)||a.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var i=b(t),o=b(e);if(i&&!o||!i&&o)return!1;if(i)return t=s.call(t),e=s.call(e),y(t,e,r);var l,c,u=w(t),f=w(e);if(u.length!==f.length)return!1;for(u.sort(),f.sort(),c=u.length-1;c>=0;c--)if(u[c]!==f[c])return!1;for(c=u.length-1;c>=0;c--)if(l=u[c],!y(t[l],e[l],r,n))return!1;return!0}(t,e,r,o))}return r?t===e:t==e}function b(t){return\"[object Arguments]\"==Object.prototype.toString.call(t)}function x(t,e){if(!t||!e)return!1;if(\"[object RegExp]\"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function _(t,e,r,n){var i;if(\"function\"!=typeof e)throw new TypeError('\"block\" argument must be a function');\"string\"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?\" (\"+r.name+\").\":\".\")+(n?\" \"+n:\".\"),t&&!i&&v(i,r,\"Missing expected exception\"+n);var o=\"string\"==typeof n,s=!t&&a.isError(i),l=!t&&i&&!r;if((s&&o&&x(i,r)||l)&&v(i,r,\"Got unwanted exception\"+n),t&&i&&r&&!x(i,r)||!t&&i)throw i}f.AssertionError=function(t){var e;this.name=\"AssertionError\",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=p(m((e=this).actual),128)+\" \"+e.operator+\" \"+p(m(e.expected),128),this.generatedMessage=!0);var r=t.stackStartFunction||v;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var n=new Error;if(n.stack){var i=n.stack,a=d(r),o=i.indexOf(\"\\n\"+a);if(o>=0){var s=i.indexOf(\"\\n\",o+1);i=i.substring(s+1)}this.stack=i}}},a.inherits(f.AssertionError,Error),f.fail=v,f.ok=g,f.equal=function(t,e,r){t!=e&&v(t,e,r,\"==\",f.equal)},f.notEqual=function(t,e,r){t==e&&v(t,e,r,\"!=\",f.notEqual)},f.deepEqual=function(t,e,r){y(t,e,!1)||v(t,e,r,\"deepEqual\",f.deepEqual)},f.deepStrictEqual=function(t,e,r){y(t,e,!0)||v(t,e,r,\"deepStrictEqual\",f.deepStrictEqual)},f.notDeepEqual=function(t,e,r){y(t,e,!1)&&v(t,e,r,\"notDeepEqual\",f.notDeepEqual)},f.notDeepStrictEqual=function t(e,r,n){y(e,r,!0)&&v(e,r,n,\"notDeepStrictEqual\",t)},f.strictEqual=function(t,e,r){t!==e&&v(t,e,r,\"===\",f.strictEqual)},f.notStrictEqual=function(t,e,r){t===e&&v(t,e,r,\"!==\",f.notStrictEqual)},f.throws=function(t,e,r){_(!0,t,e,r)},f.doesNotThrow=function(t,e,r){_(!1,t,e,r)},f.ifError=function(t){if(t)throw t};var w=Object.keys||function(t){var e=[];for(var r in t)o.call(t,r)&&e.push(r);return e}}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{\"util/\":543}],52:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],53:[function(t,e,r){\"use strict\";e.exports=function(t,e){for(var r=e.length,a=new Array(r+1),o=0;o<r;++o){for(var s=new Array(r+1),l=0;l<=r;++l)s[l]=t[l][o];a[o]=s}a[r]=new Array(r+1);for(var o=0;o<=r;++o)a[r][o]=1;for(var c=new Array(r+1),o=0;o<r;++o)c[o]=e[o];c[r]=1;var u=n(a,c),f=i(u[r+1]);0===f&&(f=1);for(var h=new Array(r+1),o=0;o<=r;++o)h[o]=i(u[o])/f;return h};var n=t(\"robust-linear-solve\");function i(t){for(var e=0,r=0;r<t.length;++r)e+=t[r];return e}},{\"robust-linear-solve\":494}],54:[function(t,e,r){\"use strict\";var n=t(\"./lib/rationalize\");e.exports=function(t,e){return n(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}},{\"./lib/rationalize\":64}],55:[function(t,e,r){\"use strict\";e.exports=function(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}},{}],56:[function(t,e,r){\"use strict\";var n=t(\"./lib/rationalize\");e.exports=function(t,e){return n(t[0].mul(e[1]),t[1].mul(e[0]))}},{\"./lib/rationalize\":64}],57:[function(t,e,r){\"use strict\";var n=t(\"./is-rat\"),i=t(\"./lib/is-bn\"),a=t(\"./lib/num-to-bn\"),o=t(\"./lib/str-to-bn\"),s=t(\"./lib/rationalize\"),l=t(\"./div\");e.exports=function t(e,r){if(n(e))return r?l(e,t(r)):[e[0].clone(),e[1].clone()];var c=0;var u,f;if(i(e))u=e.clone();else if(\"string\"==typeof e)u=o(e);else{if(0===e)return[a(0),a(1)];if(e===Math.floor(e))u=a(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),c-=256;u=a(e)}}if(n(r))u.mul(r[1]),f=r[0].clone();else if(i(r))f=r.clone();else if(\"string\"==typeof r)f=o(r);else if(r)if(r===Math.floor(r))f=a(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),c+=256;f=a(r)}else f=a(1);c>0?u=u.ushln(c):c<0&&(f=f.ushln(-c));return s(u,f)}},{\"./div\":56,\"./is-rat\":58,\"./lib/is-bn\":62,\"./lib/num-to-bn\":63,\"./lib/rationalize\":64,\"./lib/str-to-bn\":65}],58:[function(t,e,r){\"use strict\";var n=t(\"./lib/is-bn\");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{\"./lib/is-bn\":62}],59:[function(t,e,r){\"use strict\";var n=t(\"bn.js\");e.exports=function(t){return t.cmp(new n(0))}},{\"bn.js\":73}],60:[function(t,e,r){\"use strict\";var n=t(\"./bn-sign\");e.exports=function(t){var e=t.length,r=t.words,i=0;if(1===e)i=r[0];else if(2===e)i=r[0]+67108864*r[1];else for(var a=0;a<e;a++){var o=r[a];i+=o*Math.pow(67108864,a)}return n(t)*i}},{\"./bn-sign\":59}],61:[function(t,e,r){\"use strict\";var n=t(\"double-bits\"),i=t(\"bit-twiddle\").countTrailingZeros;e.exports=function(t){var e=i(n.lo(t));if(e<32)return e;var r=i(n.hi(t));if(r>20)return 52;return r+32}},{\"bit-twiddle\":71,\"double-bits\":131}],62:[function(t,e,r){\"use strict\";t(\"bn.js\");e.exports=function(t){return t&&\"object\"==typeof t&&Boolean(t.words)}},{\"bn.js\":73}],63:[function(t,e,r){\"use strict\";var n=t(\"bn.js\"),i=t(\"double-bits\");e.exports=function(t){var e=i.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},{\"bn.js\":73,\"double-bits\":131}],64:[function(t,e,r){\"use strict\";var n=t(\"./num-to-bn\"),i=t(\"./bn-sign\");e.exports=function(t,e){var r=i(t),a=i(e);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);if(o.cmpn(1))return[t.div(o),e.div(o)];return[t,e]}},{\"./bn-sign\":59,\"./num-to-bn\":63}],65:[function(t,e,r){\"use strict\";var n=t(\"bn.js\");e.exports=function(t){return new n(t)}},{\"bn.js\":73}],66:[function(t,e,r){\"use strict\";var n=t(\"./lib/rationalize\");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{\"./lib/rationalize\":64}],67:[function(t,e,r){\"use strict\";var n=t(\"./lib/bn-sign\");e.exports=function(t){return n(t[0])*n(t[1])}},{\"./lib/bn-sign\":59}],68:[function(t,e,r){\"use strict\";var n=t(\"./lib/rationalize\");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{\"./lib/rationalize\":64}],69:[function(t,e,r){\"use strict\";var n=t(\"./lib/bn-to-num\"),i=t(\"./lib/ctz\");e.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var a=e.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,c=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=i(s)+4,f=n(l.ushln(u).divRound(r));return c*(s+f*Math.pow(2,-u))}var h=r.bitLength()-l.bitLength()+53,f=n(l.ushln(h).divRound(r));return h<1023?c*f*Math.pow(2,-h):(f*=Math.pow(2,-1023),c*f*Math.pow(2,1023-h))}},{\"./lib/bn-to-num\":60,\"./lib/ctz\":61}],70:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a){var o=[\"function \",t,\"(a,l,h,\",n.join(\",\"),\"){\",a?\"\":\"var i=\",r?\"l-1\":\"h+1\",\";while(l<=h){var m=(l+h)>>>1,x=a\",i?\".get(m)\":\"[m]\"];return a?e.indexOf(\"c\")<0?o.push(\";if(x===y){return m}else if(x<=y){\"):o.push(\";var p=c(x,y);if(p===0){return m}else if(p<=0){\"):o.push(\";if(\",e,\"){i=m;\"),r?o.push(\"l=m+1}else{h=m-1}\"):o.push(\"h=m-1}else{l=m+1}\"),o.push(\"}\"),a?o.push(\"return -1};\"):o.push(\"return i};\"),o.join(\"\")}function i(t,e,r,i){return new Function([n(\"A\",\"x\"+t+\"y\",e,[\"y\"],!1,i),n(\"B\",\"x\"+t+\"y\",e,[\"y\"],!0,i),n(\"P\",\"c(x,y)\"+t+\"0\",e,[\"y\",\"c\"],!1,i),n(\"Q\",\"c(x,y)\"+t+\"0\",e,[\"y\",\"c\"],!0,i),\"function dispatchBsearch\",r,\"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch\",r].join(\"\"))()}e.exports={ge:i(\">=\",!1,\"GE\"),gt:i(\">\",!1,\"GT\"),lt:i(\"<\",!0,\"LT\"),le:i(\"<=\",!0,\"LE\"),eq:i(\"-\",!0,\"EQ\",!0)}},{}],71:[function(t,e,r){\"use strict\";\"use restrict\";function n(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t<e)},r.max=function(t,e){return t^(t^e)&-(t<e)},r.isPow2=function(t){return!(t&t-1||!t)},r.log2=function(t){var e,r;return e=(t>65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<<i&255}}(i),r.reverse=function(t){return i[255&t]<<24|i[t>>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255]},r.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},r.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],72:[function(t,e,r){\"use strict\";var n=t(\"clamp\");e.exports=function(t,e){e||(e={});var r,o,s,l,c,u,f,h,d,p,m,v=null==e.cutoff?.25:e.cutoff,g=null==e.radius?8:e.radius,y=e.channel||0;if(ArrayBuffer.isView(t)||Array.isArray(t)){if(!e.width||!e.height)throw Error(\"For raw data width and height should be provided by options\");r=e.width,o=e.height,l=t,u=e.stride?e.stride:Math.floor(t.length/r/o)}else window.HTMLCanvasElement&&t instanceof window.HTMLCanvasElement?(f=(h=t).getContext(\"2d\"),r=h.width,o=h.height,d=f.getImageData(0,0,r,o),l=d.data,u=4):window.CanvasRenderingContext2D&&t instanceof window.CanvasRenderingContext2D?(h=t.canvas,f=t,r=h.width,o=h.height,d=f.getImageData(0,0,r,o),l=d.data,u=4):window.ImageData&&t instanceof window.ImageData&&(d=t,r=t.width,o=t.height,l=d.data,u=4);if(s=Math.max(r,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(c=l,l=Array(r*o),p=0,m=c.length;p<m;p++)l[p]=c[p*u+y]/255;else if(1!==u)throw Error(\"Raw data can have only 1 value per pixel\");var b=Array(r*o),x=Array(r*o),_=Array(s),w=Array(s),M=Array(s+1),k=Array(s);for(p=0,m=r*o;p<m;p++){var A=l[p];b[p]=1===A?0:0===A?i:Math.pow(Math.max(0,.5-A),2),x[p]=1===A?i:0===A?0:Math.pow(Math.max(0,A-.5),2)}a(b,r,o,_,w,k,M),a(x,r,o,_,w,k,M);var T=window.Float32Array?new Float32Array(r*o):new Array(r*o);for(p=0,m=r*o;p<m;p++)T[p]=n(1-((b[p]-x[p])/g+v),0,1);return T};var i=1e20;function a(t,e,r,n,i,a,s){for(var l=0;l<e;l++){for(var c=0;c<r;c++)n[c]=t[c*e+l];for(o(n,i,a,s,r),c=0;c<r;c++)t[c*e+l]=i[c]}for(c=0;c<r;c++){for(l=0;l<e;l++)n[l]=t[c*e+l];for(o(n,i,a,s,e),l=0;l<e;l++)t[c*e+l]=Math.sqrt(i[l])}}function o(t,e,r,n,a){r[0]=0,n[0]=-i,n[1]=+i;for(var o=1,s=0;o<a;o++){for(var l=(t[o]+o*o-(t[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);l<=n[s];)s--,l=(t[o]+o*o-(t[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);r[++s]=o,n[s]=l,n[s+1]=+i}for(o=0,s=0;o<a;o++){for(;n[s+1]<o;)s++;e[o]=(o-r[s])*(o-r[s])+t[r[s]]}}},{clamp:94}],73:[function(t,e,r){!function(e,r){\"use strict\";function n(t,e){if(!t)throw new Error(e||\"Assertion failed\")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){if(a.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(\"le\"!==e&&\"be\"!==e||(r=e,e=10),this._init(t||0,e||10,r||\"be\"))}var o;\"object\"==typeof e?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;try{o=t(\"buffer\").Buffer}catch(t){}function s(t,e,r){for(var n=0,i=Math.min(t.length,r),a=e;a<i;a++){var o=t.charCodeAt(a)-48;n<<=4,n|=o>=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function l(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o<a;o++){var s=t.charCodeAt(o)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(t){return t instanceof a||null!==t&&\"object\"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if(\"number\"==typeof t)return this._initNumber(t,e,r);if(\"object\"==typeof t)return this._initArray(t,e,r);\"hex\"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;\"-\"===(t=t.toString().replace(/\\s+/g,\"\"))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),\"-\"===t[0]&&(this.negative=1),this.strip(),\"le\"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),\"le\"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(n(\"number\"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,o,s=0;if(\"be\"===r)for(i=t.length-1,a=0;i>=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if(\"le\"===r)for(i=0,a=0;i<t.length;i+=3)o=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,a=0;for(r=t.length-6,n=0;r>=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<<a&67108863,this.words[n+1]|=i>>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<<a&67108863,this.words[n+1]|=i>>>26-a&4194303),this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,s=Math.min(a,a-o)+r,c=0,u=r;u<s;u+=n)c=l(t,u,u+n,e),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==o){var f=1;for(c=l(t,u,t.length,e),u=0;u<o;u++)f*=e;this.imuln(f),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}},a.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},a.prototype.clone=function(){var t=new a(null);return this.copy(t),t},a.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?\"<BN-R: \":\"<BN: \")+this.toString(16)+\">\"};var c=[\"\",\"0\",\"00\",\"000\",\"0000\",\"00000\",\"000000\",\"0000000\",\"00000000\",\"000000000\",\"0000000000\",\"00000000000\",\"000000000000\",\"0000000000000\",\"00000000000000\",\"000000000000000\",\"0000000000000000\",\"00000000000000000\",\"000000000000000000\",\"0000000000000000000\",\"00000000000000000000\",\"000000000000000000000\",\"0000000000000000000000\",\"00000000000000000000000\",\"000000000000000000000000\",\"0000000000000000000000000\"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var c=1;c<n;c++){for(var u=l>>>26,f=67108863&l,h=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=h;d++){var p=c-d|0;u+=(o=(i=0|t.words[p])*(a=0|e.words[d])+f)/67108864|0,f=67108863&o}r.words[c]=0|f,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}a.prototype.toString=function(t,e){var r;if(t=t||10,e=0|e||1,16===t||\"hex\"===t){r=\"\";for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],l=(16777215&(s<<i|a)).toString(16);r=0!==(a=s>>>24-i&16777215)||o!==this.length-1?c[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!=0;)r=\"0\"+r;return 0!==this.negative&&(r=\"-\"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=u[t],d=f[t];r=\"\";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:c[h-m.length]+m+r}for(this.isZero()&&(r=\"0\"+r);r.length%e!=0;)r=\"0\"+r;return 0!==this.negative&&(r=\"-\"+r),r}n(!1,\"Base should be between 2 and 36\")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,\"Number can only safely store up to 53 bits\"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,\"byte array longer than desired length\"),n(a>0,\"Requested array length <= 0\"),this.strip();var o,s,l=\"le\"===e,c=new t(a),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[s]=o;for(;s<a;s++)c[s]=0}else{for(s=0;s<a-i;s++)c[s]=0;for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[a-s-1]=o}return c},Math.clz32?a.prototype._countBits=function(t){return 32-Math.clz32(t)}:a.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},a.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},a.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},a.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},a.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},a.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},a.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},a.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n(\"number\"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n(\"number\"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},a.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a<n.length;a++)e=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&e,i=e>>>26;for(;0!==i&&a<r.length;a++)e=(0|r.words[a])+i,this.words[a]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},a.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var a=0,o=0;o<n.length;o++)a=(e=(0|r.words[o])-(0|n.words[o])+a)>>26,this.words[o]=67108863&e;for(;0!==a&&o<r.length;o++)a=(e=(0|r.words[o])+a)>>26,this.words[o]=67108863&e;if(0===a&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(t){return this.clone().isub(t)};var d=function(t,e,r){var n,i,a,o=t.words,s=e.words,l=r.words,c=0,u=0|o[0],f=8191&u,h=u>>>13,d=0|o[1],p=8191&d,m=d>>>13,v=0|o[2],g=8191&v,y=v>>>13,b=0|o[3],x=8191&b,_=b>>>13,w=0|o[4],M=8191&w,k=w>>>13,A=0|o[5],T=8191&A,E=A>>>13,S=0|o[6],L=8191&S,C=S>>>13,P=0|o[7],z=8191&P,O=P>>>13,D=0|o[8],I=8191&D,R=D>>>13,N=0|o[9],F=8191&N,j=N>>>13,B=0|s[0],U=8191&B,V=B>>>13,q=0|s[1],H=8191&q,G=q>>>13,Y=0|s[2],W=8191&Y,X=Y>>>13,Z=0|s[3],J=8191&Z,K=Z>>>13,Q=0|s[4],$=8191&Q,tt=Q>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ct=st>>>13,ut=0|s[8],ft=8191&ut,ht=ut>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(c+(n=Math.imul(f,U))|0)+((8191&(i=(i=Math.imul(f,V))+Math.imul(h,U)|0))<<13)|0;c=((a=Math.imul(h,V))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,V))+Math.imul(m,U)|0,a=Math.imul(m,V);var gt=(c+(n=n+Math.imul(f,H)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(h,H)|0))<<13)|0;c=((a=a+Math.imul(h,G)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,U),i=(i=Math.imul(g,V))+Math.imul(y,U)|0,a=Math.imul(y,V),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,H)|0,a=a+Math.imul(m,G)|0;var yt=(c+(n=n+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(h,W)|0))<<13)|0;c=((a=a+Math.imul(h,X)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,V))+Math.imul(_,U)|0,a=Math.imul(_,V),n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,G)|0)+Math.imul(y,H)|0,a=a+Math.imul(y,G)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,X)|0;var bt=(c+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(h,J)|0))<<13)|0;c=((a=a+Math.imul(h,K)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,U),i=(i=Math.imul(M,V))+Math.imul(k,U)|0,a=Math.imul(k,V),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(_,H)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(g,W)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(y,W)|0,a=a+Math.imul(y,X)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,J)|0,a=a+Math.imul(m,K)|0;var xt=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,$)|0))<<13)|0;c=((a=a+Math.imul(h,tt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,V))+Math.imul(E,U)|0,a=Math.imul(E,V),n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(k,H)|0,a=a+Math.imul(k,G)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,K)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,K)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((a=a+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(L,U),i=(i=Math.imul(L,V))+Math.imul(C,U)|0,a=Math.imul(C,V),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(E,H)|0,a=a+Math.imul(E,G)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,X)|0,n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,K)|0,n=n+Math.imul(g,$)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,$)|0,a=a+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,a=a+Math.imul(m,nt)|0;var wt=(c+(n=n+Math.imul(f,at)|0)|0)+((8191&(i=(i=i+Math.imul(f,ot)|0)+Math.imul(h,at)|0))<<13)|0;c=((a=a+Math.imul(h,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(z,U),i=(i=Math.imul(z,V))+Math.imul(O,U)|0,a=Math.imul(O,V),n=n+Math.imul(L,H)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(C,H)|0,a=a+Math.imul(C,G)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(E,W)|0,a=a+Math.imul(E,X)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,K)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(_,$)|0,a=a+Math.imul(_,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,a=a+Math.imul(y,nt)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ot)|0)+Math.imul(m,at)|0,a=a+Math.imul(m,ot)|0;var Mt=(c+(n=n+Math.imul(f,lt)|0)|0)+((8191&(i=(i=i+Math.imul(f,ct)|0)+Math.imul(h,lt)|0))<<13)|0;c=((a=a+Math.imul(h,ct)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,V))+Math.imul(R,U)|0,a=Math.imul(R,V),n=n+Math.imul(z,H)|0,i=(i=i+Math.imul(z,G)|0)+Math.imul(O,H)|0,a=a+Math.imul(O,G)|0,n=n+Math.imul(L,W)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(C,W)|0,a=a+Math.imul(C,X)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(E,J)|0,a=a+Math.imul(E,K)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(_,rt)|0,a=a+Math.imul(_,nt)|0,n=n+Math.imul(g,at)|0,i=(i=i+Math.imul(g,ot)|0)+Math.imul(y,at)|0,a=a+Math.imul(y,ot)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,a=a+Math.imul(m,ct)|0;var kt=(c+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;c=((a=a+Math.imul(h,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(F,U),i=(i=Math.imul(F,V))+Math.imul(j,U)|0,a=Math.imul(j,V),n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(R,H)|0,a=a+Math.imul(R,G)|0,n=n+Math.imul(z,W)|0,i=(i=i+Math.imul(z,X)|0)+Math.imul(O,W)|0,a=a+Math.imul(O,X)|0,n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,K)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,K)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(E,$)|0,a=a+Math.imul(E,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(k,rt)|0,a=a+Math.imul(k,nt)|0,n=n+Math.imul(x,at)|0,i=(i=i+Math.imul(x,ot)|0)+Math.imul(_,at)|0,a=a+Math.imul(_,ot)|0,n=n+Math.imul(g,lt)|0,i=(i=i+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,a=a+Math.imul(y,ct)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ft)|0,a=a+Math.imul(m,ht)|0;var At=(c+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((a=a+Math.imul(h,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(F,H),i=(i=Math.imul(F,G))+Math.imul(j,H)|0,a=Math.imul(j,G),n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(R,W)|0,a=a+Math.imul(R,X)|0,n=n+Math.imul(z,J)|0,i=(i=i+Math.imul(z,K)|0)+Math.imul(O,J)|0,a=a+Math.imul(O,K)|0,n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(E,rt)|0,a=a+Math.imul(E,nt)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ot)|0)+Math.imul(k,at)|0,a=a+Math.imul(k,ot)|0,n=n+Math.imul(x,lt)|0,i=(i=i+Math.imul(x,ct)|0)+Math.imul(_,lt)|0,a=a+Math.imul(_,ct)|0,n=n+Math.imul(g,ft)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(y,ft)|0,a=a+Math.imul(y,ht)|0;var Tt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((a=a+Math.imul(m,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(F,W),i=(i=Math.imul(F,X))+Math.imul(j,W)|0,a=Math.imul(j,X),n=n+Math.imul(I,J)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(R,J)|0,a=a+Math.imul(R,K)|0,n=n+Math.imul(z,$)|0,i=(i=i+Math.imul(z,tt)|0)+Math.imul(O,$)|0,a=a+Math.imul(O,tt)|0,n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(C,rt)|0,a=a+Math.imul(C,nt)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ot)|0)+Math.imul(E,at)|0,a=a+Math.imul(E,ot)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(k,lt)|0,a=a+Math.imul(k,ct)|0,n=n+Math.imul(x,ft)|0,i=(i=i+Math.imul(x,ht)|0)+Math.imul(_,ft)|0,a=a+Math.imul(_,ht)|0;var Et=(c+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((a=a+Math.imul(y,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(F,J),i=(i=Math.imul(F,K))+Math.imul(j,J)|0,a=Math.imul(j,K),n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(R,$)|0,a=a+Math.imul(R,tt)|0,n=n+Math.imul(z,rt)|0,i=(i=i+Math.imul(z,nt)|0)+Math.imul(O,rt)|0,a=a+Math.imul(O,nt)|0,n=n+Math.imul(L,at)|0,i=(i=i+Math.imul(L,ot)|0)+Math.imul(C,at)|0,a=a+Math.imul(C,ot)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(E,lt)|0,a=a+Math.imul(E,ct)|0,n=n+Math.imul(M,ft)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(k,ft)|0,a=a+Math.imul(k,ht)|0;var St=(c+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((a=a+Math.imul(_,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(F,$),i=(i=Math.imul(F,tt))+Math.imul(j,$)|0,a=Math.imul(j,tt),n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(R,rt)|0,a=a+Math.imul(R,nt)|0,n=n+Math.imul(z,at)|0,i=(i=i+Math.imul(z,ot)|0)+Math.imul(O,at)|0,a=a+Math.imul(O,ot)|0,n=n+Math.imul(L,lt)|0,i=(i=i+Math.imul(L,ct)|0)+Math.imul(C,lt)|0,a=a+Math.imul(C,ct)|0,n=n+Math.imul(T,ft)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(E,ft)|0,a=a+Math.imul(E,ht)|0;var Lt=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((a=a+Math.imul(k,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(F,rt),i=(i=Math.imul(F,nt))+Math.imul(j,rt)|0,a=Math.imul(j,nt),n=n+Math.imul(I,at)|0,i=(i=i+Math.imul(I,ot)|0)+Math.imul(R,at)|0,a=a+Math.imul(R,ot)|0,n=n+Math.imul(z,lt)|0,i=(i=i+Math.imul(z,ct)|0)+Math.imul(O,lt)|0,a=a+Math.imul(O,ct)|0,n=n+Math.imul(L,ft)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(C,ft)|0,a=a+Math.imul(C,ht)|0;var Ct=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(E,pt)|0))<<13)|0;c=((a=a+Math.imul(E,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(F,at),i=(i=Math.imul(F,ot))+Math.imul(j,at)|0,a=Math.imul(j,ot),n=n+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(R,lt)|0,a=a+Math.imul(R,ct)|0,n=n+Math.imul(z,ft)|0,i=(i=i+Math.imul(z,ht)|0)+Math.imul(O,ft)|0,a=a+Math.imul(O,ht)|0;var Pt=(c+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((a=a+Math.imul(C,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(F,lt),i=(i=Math.imul(F,ct))+Math.imul(j,lt)|0,a=Math.imul(j,ct),n=n+Math.imul(I,ft)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(R,ft)|0,a=a+Math.imul(R,ht)|0;var zt=(c+(n=n+Math.imul(z,pt)|0)|0)+((8191&(i=(i=i+Math.imul(z,mt)|0)+Math.imul(O,pt)|0))<<13)|0;c=((a=a+Math.imul(O,mt)|0)+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863,n=Math.imul(F,ft),i=(i=Math.imul(F,ht))+Math.imul(j,ft)|0,a=Math.imul(j,ht);var Ot=(c+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(R,pt)|0))<<13)|0;c=((a=a+Math.imul(R,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Dt=(c+(n=Math.imul(F,pt))|0)+((8191&(i=(i=Math.imul(F,mt))+Math.imul(j,pt)|0))<<13)|0;return c=((a=Math.imul(j,mt))+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,l[0]=vt,l[1]=gt,l[2]=yt,l[3]=bt,l[4]=xt,l[5]=_t,l[6]=wt,l[7]=Mt,l[8]=kt,l[9]=At,l[10]=Tt,l[11]=Et,l[12]=St,l[13]=Lt,l[14]=Ct,l[15]=Pt,l[16]=zt,l[17]=Ot,l[18]=Dt,0!==c&&(l[19]=c,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=h),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?h(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var o=i;i=0;for(var s=67108863&n,l=Math.min(a,e.length-1),c=Math.max(0,a-t.length+1);c<=l;c++){var u=a-c,f=(0|t.words[u])*(0|e.words[c]),h=67108863&f;s=67108863&(h=h+s|0),i+=(o=(o=o+(f/67108864|0)|0)+(h>>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},m.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},m.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o<a;o++)n[o]=e[t[o]],i[o]=r[t[o]]},m.prototype.transform=function(t,e,r,n,i,a){this.permute(a,t,e,r,n,i);for(var o=1;o<i;o<<=1)for(var s=o<<1,l=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),u=0;u<i;u+=s)for(var f=l,h=c,d=0;d<o;d++){var p=r[u+d],m=n[u+d],v=r[u+d+o],g=n[u+d+o],y=f*v-h*g;g=f*g+h*v,v=y,r[u+d]=p+v,n[u+d]=m+g,r[u+d+o]=p-v,n[u+d+o]=m-g,d!==s&&(y=l*f-c*h,h=l*h+c*f,f=y)}},m.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},m.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},m.prototype.convert13b=function(t,e,r,i){for(var a=0,o=0;o<e;o++)a+=0|t[o],r[2*o]=8191&a,a>>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o<i;++o)r[o]=0;n(0===a),n(0==(-8192&a))},m.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},m.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),a=this.stub(n),o=new Array(n),s=new Array(n),l=new Array(n),c=new Array(n),u=new Array(n),f=new Array(n),h=r.words;h.length=n,this.convert13b(t.words,t.length,o,n),this.convert13b(e.words,e.length,c,n),this.transform(o,a,s,l,n,i),this.transform(c,a,u,f,n,i);for(var d=0;d<n;d++){var p=s[d]*u[d]-l[d]*f[d];l[d]=s[d]*f[d]+l[d]*u[d],s[d]=p}return this.conjugate(s,l,n),this.transform(s,l,h,a,n,i),this.conjugate(h,a,n),this.normalize13b(h,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},a.prototype.mul=function(t){var e=new a(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},a.prototype.mulf=function(t){var e=new a(null);return e.words=new Array(this.length+t.length),p(this,t,e)},a.prototype.imul=function(t){return this.clone().mulTo(t,this)},a.prototype.imuln=function(t){n(\"number\"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,a=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},a.prototype.iushln=function(t){n(\"number\"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var s=this.words[e]&a,l=(0|this.words[e])-s<<r;this.words[e]=l|o,o=s>>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},a.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},a.prototype.iushrn=function(t,e,r){var i;n(\"number\"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<<a,l=r;if(i-=o,i=Math.max(0,i),l){for(var c=0;c<o;c++)l.words[c]=this.words[c];l.length=o}if(0===o);else if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var u=0;for(c=this.length-1;c>=0&&(0!==u||c>=i);c--){var f=0|this.words[c];this.words[c]=u<<26-a|f>>>a,u=f&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n(\"number\"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},a.prototype.imaskn=function(t){n(\"number\"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,\"imaskn works only with positive numbers\"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},a.prototype.maskn=function(t){return this.clone().imaskn(t)},a.prototype.iaddn=function(t){return n(\"number\"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},a.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(n(\"number\"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},a.prototype.addn=function(t){return this.clone().iaddn(t)},a.prototype.subn=function(t){return this.clone().isubn(t)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(t,e,r){var i,a,o=t.length+r;this._expand(o);var s=0;for(i=0;i<t.length;i++){a=(0|this.words[i+r])+s;var l=(0|t.words[i])*e;s=((a-=67108863&l)>>26)-(l/67108864|0),this.words[i+r]=67108863&a}for(;i<this.length-r;i++)s=(a=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(a=-(0|this.words[i])+s)>>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if(\"mod\"!==e){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var u=n.clone()._ishlnsubmul(i,1,l);0===u.negative&&(n=u,s&&(s.words[l]=1));for(var f=l-1;f>=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),n.strip(),\"div\"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),\"mod\"!==e&&(i=s.div.neg()),\"div\"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),\"mod\"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),\"div\"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?\"div\"===e?{div:this.divn(t.words[0]),mod:null}:\"mod\"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,o,s},a.prototype.div=function(t){return this.divmod(t,\"div\",!1).div},a.prototype.mod=function(t){return this.divmod(t,\"mod\",!1).mod},a.prototype.umod=function(t){return this.divmod(t,\"mod\",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),f=e.clone();!e.isZero();){for(var h=0,d=1;0==(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(f)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(l)):(r.isub(e),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(c)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,o=new a(1),s=new a(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;0==(e.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(e.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(i=0===e.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(t),i},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n(\"number\"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,o=r;0!==a&&o<this.length;o++){var s=0|this.words[o];a=(s+=a)>>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,\"Number is too big\");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},a.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},a.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new w(t)},a.prototype.toRed=function(t){return n(!this.red,\"Already a number in reduction context\"),n(0===this.negative,\"red works only with positives\"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,\"fromRed works only with numbers in reduction context\"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,\"Already a number in reduction context\"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,\"redAdd works only with red numbers\"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,\"redIAdd works only with red numbers\"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,\"redSub works only with red numbers\"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,\"redISub works only with red numbers\"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,\"redShl works only with red numbers\"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,\"redMul works only with red numbers\"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,\"redMul works only with red numbers\"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,\"redSqr works only with red numbers\"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,\"redISqr works only with red numbers\"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,\"redSqrt works only with red numbers\"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,\"redInvm works only with red numbers\"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,\"redNeg works only with red numbers\"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,\"redPow(normalNum)\"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,\"k256\",\"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\")}function b(){g.call(this,\"p224\",\"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\")}function x(){g.call(this,\"p192\",\"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\")}function _(){g.call(this,\"25519\",\"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\")}function w(t){if(\"string\"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),\"modulus must be greater than 1\"),this.m=t,this.prime=null}function M(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},i(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var a=0|t.words[n];t.words[n-10]=(4194303&a)<<4|i>>>22,i=a}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(b,g),i(x,g),i(_,g),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(v[t])return v[t];var e;if(\"k256\"===t)e=new y;else if(\"p224\"===t)e=new b;else if(\"p192\"===t)e=new x;else{if(\"p25519\"!==t)throw new Error(\"Unknown prime \"+t);e=new _}return v[t]=e,e},w.prototype._verify1=function(t){n(0===t.negative,\"red works only with positives\"),n(t.red,\"red works only with red numbers\")},w.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),\"red works only with positives\"),n(t.red&&t.red===e.red,\"red works only with red numbers\")},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},w.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},w.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var f=this.pow(u,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=o;0!==d.cmp(s);){for(var m=d,v=0;0!==m.cmp(s);v++)m=m.redSqr();n(v<p);var g=this.pow(f,new a(1).iushln(p-v-1));h=h.redMul(g),f=g.redSqr(),d=d.redMul(f),p=v}return h},w.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},w.prototype.pow=function(t,e){if(e.isZero())return new a(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new a(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],o=0,s=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],u=l-1;u>=0;u--){var f=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new M(t)},i(M,w),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:82}],74:[function(t,e,r){\"use strict\";e.exports=function(t){var e,r,n,i=t.length,a=0;for(e=0;e<i;++e)a+=t[e].length;var o=new Array(a),s=0;for(e=0;e<i;++e){var l=t[e],c=l.length;for(r=0;r<c;++r){var u=o[s++]=new Array(c-1),f=0;for(n=0;n<c;++n)n!==r&&(u[f++]=l[n]);if(1&r){var h=u[1];u[1]=u[0],u[0]=h}}}return o}},{}],75:[function(t,e,r){\"use strict\";e.exports=function(t,e,r){switch(arguments.length){case 1:return n=[],c(i=t,i,u,!0),n;case 2:return\"function\"==typeof e?c(t,t,e,!0):function(t,e){return n=[],c(t,e,u,!1),n}(t,e);case 3:return c(t,e,r,!1);default:throw new Error(\"box-intersect: Invalid arguments\")}var i};var n,i=t(\"typedarray-pool\"),a=t(\"./lib/sweep\"),o=t(\"./lib/intersect\");function s(t,e){for(var r=0;r<t;++r)if(!(e[r]<=e[r+t]))return!0;return!1}function l(t,e,r,n){for(var i=0,a=0,o=0,l=t.length;o<l;++o){var c=t[o];if(!s(e,c)){for(var u=0;u<2*e;++u)r[i++]=c[u];n[a++]=o}}return a}function c(t,e,r,n){var s=t.length,c=e.length;if(!(s<=0||c<=0)){var u=t[0].length>>>1;if(!(u<=0)){var f,h=i.mallocDouble(2*u*s),d=i.mallocInt32(s);if((s=l(t,u,h,d))>0){if(1===u&&n)a.init(s),f=a.sweepComplete(u,r,0,s,h,d,0,s,h,d);else{var p=i.mallocDouble(2*u*c),m=i.mallocInt32(c);(c=l(e,u,p,m))>0&&(a.init(s+c),f=1===u?a.sweepBipartite(u,r,0,s,h,d,0,c,p,m):o(u,r,n,s,h,d,c,p,m),i.free(p),i.free(m))}i.free(h),i.free(d)}return f}}}function u(t,e){n.push([t,e])}},{\"./lib/intersect\":77,\"./lib/sweep\":81,\"typedarray-pool\":534}],76:[function(t,e,r){\"use strict\";var n=\"d\",i=\"ax\",a=\"vv\",o=\"fp\",s=\"es\",l=\"rs\",c=\"re\",u=\"rb\",f=\"ri\",h=\"rp\",d=\"bs\",p=\"be\",m=\"bb\",v=\"bi\",g=\"bp\",y=\"rv\",b=\"Q\",x=[n,i,a,l,c,u,f,d,p,m,v];function _(t){var e=\"bruteForce\"+(t?\"Full\":\"Partial\"),r=[],_=x.slice();t||_.splice(3,0,o);var w=[\"function \"+e+\"(\"+_.join()+\"){\"];function M(e,o){var _=function(t,e,r){var o=\"bruteForce\"+(t?\"Red\":\"Blue\")+(e?\"Flip\":\"\")+(r?\"Full\":\"\"),_=[\"function \",o,\"(\",x.join(),\"){\",\"var \",s,\"=2*\",n,\";\"],w=\"for(var i=\"+l+\",\"+h+\"=\"+s+\"*\"+l+\";i<\"+c+\";++i,\"+h+\"+=\"+s+\"){var x0=\"+u+\"[\"+i+\"+\"+h+\"],x1=\"+u+\"[\"+i+\"+\"+h+\"+\"+n+\"],xi=\"+f+\"[i];\",M=\"for(var j=\"+d+\",\"+g+\"=\"+s+\"*\"+d+\";j<\"+p+\";++j,\"+g+\"+=\"+s+\"){var y0=\"+m+\"[\"+i+\"+\"+g+\"],\"+(r?\"y1=\"+m+\"[\"+i+\"+\"+g+\"+\"+n+\"],\":\"\")+\"yi=\"+v+\"[j];\";return t?_.push(w,b,\":\",M):_.push(M,b,\":\",w),r?_.push(\"if(y1<x0||x1<y0)continue;\"):e?_.push(\"if(y0<=x0||x1<y0)continue;\"):_.push(\"if(y0<x0||x1<y0)continue;\"),_.push(\"for(var k=\"+i+\"+1;k<\"+n+\";++k){var r0=\"+u+\"[k+\"+h+\"],r1=\"+u+\"[k+\"+n+\"+\"+h+\"],b0=\"+m+\"[k+\"+g+\"],b1=\"+m+\"[k+\"+n+\"+\"+g+\"];if(r1<b0||b1<r0)continue \"+b+\";}var \"+y+\"=\"+a+\"(\"),e?_.push(\"yi,xi\"):_.push(\"xi,yi\"),_.push(\");if(\"+y+\"!==void 0)return \"+y+\";}}}\"),{name:o,code:_.join(\"\")}}(e,o,t);r.push(_.code),w.push(\"return \"+_.name+\"(\"+x.join()+\");\")}w.push(\"if(\"+c+\"-\"+l+\">\"+p+\"-\"+d+\"){\"),t?(M(!0,!1),w.push(\"}else{\"),M(!1,!1)):(w.push(\"if(\"+o+\"){\"),M(!0,!0),w.push(\"}else{\"),M(!0,!1),w.push(\"}}else{if(\"+o+\"){\"),M(!1,!0),w.push(\"}else{\"),M(!1,!1),w.push(\"}\")),w.push(\"}}return \"+e);var k=r.join(\"\")+w.join(\"\");return new Function(k)()}r.partial=_(!1),r.full=_(!0)},{}],77:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,a,u,E,S,L,C){!function(t,e){var r=8*i.log2(e+1)*(t+1)|0,a=i.nextPow2(x*r);w.length<a&&(n.free(w),w=n.mallocInt32(a));var o=i.nextPow2(_*r);M<o&&(n.free(M),M=n.mallocDouble(o))}(t,a+S);var P,z=0,O=2*t;k(z++,0,0,a,0,S,r?16:0,-1/0,1/0),r||k(z++,0,0,S,0,a,1,-1/0,1/0);for(;z>0;){var D=(z-=1)*x,I=w[D],R=w[D+1],N=w[D+2],F=w[D+3],j=w[D+4],B=w[D+5],U=z*_,V=M[U],q=M[U+1],H=1&B,G=!!(16&B),Y=u,W=E,X=L,Z=C;if(H&&(Y=L,W=C,X=u,Z=E),!(2&B&&(N=v(t,I,R,N,Y,W,q),R>=N)||4&B&&(R=g(t,I,R,N,Y,W,V))>=N)){var J=N-R,K=j-F;if(G){if(t*J*(J+K)<d){if(void 0!==(P=l.scanComplete(t,I,e,R,N,Y,W,F,j,X,Z)))return P;continue}}else{if(t*Math.min(J,K)<f){if(void 0!==(P=o(t,I,e,H,R,N,Y,W,F,j,X,Z)))return P;continue}if(t*J*K<h){if(void 0!==(P=l.scanBipartite(t,I,e,H,R,N,Y,W,F,j,X,Z)))return P;continue}}var Q=p(t,I,R,N,Y,W,V,q);if(R<Q)if(t*(Q-R)<f){if(void 0!==(P=s(t,I+1,e,R,Q,Y,W,F,j,X,Z)))return P}else if(I===t-2){if(void 0!==(P=H?l.sweepBipartite(t,e,F,j,X,Z,R,Q,Y,W):l.sweepBipartite(t,e,R,Q,Y,W,F,j,X,Z)))return P}else k(z++,I+1,R,Q,F,j,H,-1/0,1/0),k(z++,I+1,F,j,R,Q,1^H,-1/0,1/0);if(Q<N){var $=c(t,I,F,j,X,Z),tt=X[O*$+I],et=m(t,I,$,j,X,Z,tt);if(et<j&&k(z++,I,Q,N,et,j,(4|H)+(G?16:0),tt,q),F<$&&k(z++,I,Q,N,F,$,(2|H)+(G?16:0),V,tt),$+1===et){if(void 0!==(P=G?T(t,I,e,Q,N,Y,W,$,X,Z[$]):A(t,I,e,H,Q,N,Y,W,$,X,Z[$])))return P}else if($<et){var rt;if(G){if(rt=y(t,I,Q,N,Y,W,tt),Q<rt){var nt=m(t,I,Q,rt,Y,W,tt);if(I===t-2){if(Q<nt&&void 0!==(P=l.sweepComplete(t,e,Q,nt,Y,W,$,et,X,Z)))return P;if(nt<rt&&void 0!==(P=l.sweepBipartite(t,e,nt,rt,Y,W,$,et,X,Z)))return P}else Q<nt&&k(z++,I+1,Q,nt,$,et,16,-1/0,1/0),nt<rt&&(k(z++,I+1,nt,rt,$,et,0,-1/0,1/0),k(z++,I+1,$,et,nt,rt,1,-1/0,1/0))}}else rt=H?b(t,I,Q,N,Y,W,tt):y(t,I,Q,N,Y,W,tt),Q<rt&&(I===t-2?P=H?l.sweepBipartite(t,e,$,et,X,Z,Q,rt,Y,W):l.sweepBipartite(t,e,Q,rt,Y,W,$,et,X,Z):(k(z++,I+1,Q,rt,$,et,H,-1/0,1/0),k(z++,I+1,$,et,Q,rt,1^H,-1/0,1/0)))}}}}};var n=t(\"typedarray-pool\"),i=t(\"bit-twiddle\"),a=t(\"./brute\"),o=a.partial,s=a.full,l=t(\"./sweep\"),c=t(\"./median\"),u=t(\"./partition\"),f=128,h=1<<22,d=1<<22,p=u(\"!(lo>=p0)&&!(p1>=hi)\",[\"p0\",\"p1\"]),m=u(\"lo===p0\",[\"p0\"]),v=u(\"lo<p0\",[\"p0\"]),g=u(\"hi<=p0\",[\"p0\"]),y=u(\"lo<=p0&&p0<=hi\",[\"p0\"]),b=u(\"lo<p0&&p0<=hi\",[\"p0\"]),x=6,_=2,w=n.mallocInt32(1024),M=n.mallocDouble(1024);function k(t,e,r,n,i,a,o,s,l){var c=x*t;w[c]=e,w[c+1]=r,w[c+2]=n,w[c+3]=i,w[c+4]=a,w[c+5]=o;var u=_*t;M[u]=s,M[u+1]=l}function A(t,e,r,n,i,a,o,s,l,c,u){var f=2*t,h=l*f,d=c[h+e];t:for(var p=i,m=i*f;p<a;++p,m+=f){var v=o[m+e],g=o[m+e+t];if(!(d<v||g<d)&&(!n||d!==v)){for(var y,b=s[p],x=e+1;x<t;++x){v=o[m+x],g=o[m+x+t];var _=c[h+x],w=c[h+x+t];if(g<_||w<v)continue t}if(void 0!==(y=n?r(u,b):r(b,u)))return y}}}function T(t,e,r,n,i,a,o,s,l,c){var u=2*t,f=s*u,h=l[f+e];t:for(var d=n,p=n*u;d<i;++d,p+=u){var m=o[d];if(m!==c){var v=a[p+e],g=a[p+e+t];if(!(h<v||g<h)){for(var y=e+1;y<t;++y){v=a[p+y],g=a[p+y+t];var b=l[f+y],x=l[f+y+t];if(g<b||x<v)continue t}var _=r(m,c);if(void 0!==_)return _}}}}},{\"./brute\":76,\"./median\":78,\"./partition\":79,\"./sweep\":81,\"bit-twiddle\":71,\"typedarray-pool\":534}],78:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,o,s,l){if(o<=r+1)return r;var c=r,u=o,f=o+r>>>1,h=2*t,d=f,p=s[h*f+e];for(;c<u;){if(u-c<i){a(t,e,c,u,s,l),p=s[h*f+e];break}var m=u-c,v=Math.random()*m+c|0,g=s[h*v+e],y=Math.random()*m+c|0,b=s[h*y+e],x=Math.random()*m+c|0,_=s[h*x+e];g<=b?_>=b?(d=y,p=b):g>=_?(d=v,p=g):(d=x,p=_):b>=_?(d=y,p=b):_>=g?(d=v,p=g):(d=x,p=_);for(var w=h*(u-1),M=h*d,k=0;k<h;++k,++w,++M){var A=s[w];s[w]=s[M],s[M]=A}var T=l[u-1];l[u-1]=l[d],l[d]=T,d=n(t,e,c,u-1,s,l,p);for(var w=h*(u-1),M=h*d,k=0;k<h;++k,++w,++M){var A=s[w];s[w]=s[M],s[M]=A}var T=l[u-1];if(l[u-1]=l[d],l[d]=T,f<d){for(u=d-1;c<u&&s[h*(u-1)+e]===p;)u-=1;u+=1}else{if(!(d<f))break;for(c=d+1;c<u&&s[h*c+e]===p;)c+=1}}return n(t,e,r,f,s,l,s[h*f+e])};var n=t(\"./partition\")(\"lo<p0\",[\"p0\"]),i=8;function a(t,e,r,n,i,a){for(var o=2*t,s=o*(r+1)+e,l=r+1;l<n;++l,s+=o)for(var c=i[s],u=l,f=o*(l-1);u>r&&i[f+e]>c;--u,f-=o){for(var h=f,d=f+o,p=0;p<o;++p,++h,++d){var m=i[h];i[h]=i[d],i[d]=m}var v=a[u];a[u]=a[u-1],a[u-1]=v}}},{\"./partition\":79}],79:[function(t,e,r){\"use strict\";e.exports=function(t,e){var r=\"abcdef\".split(\"\").concat(e),i=[];t.indexOf(\"lo\")>=0&&i.push(\"lo=e[k+n]\");t.indexOf(\"hi\")>=0&&i.push(\"hi=e[k+o]\");return r.push(n.replace(\"_\",i.join()).replace(\"$\",t)),Function.apply(void 0,r)};var n=\"for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m\"},{}],80:[function(t,e,r){\"use strict\";e.exports=function(t,e){e<=4*n?i(0,e-1,t):function t(e,r,f){var h=(r-e+1)/6|0,d=e+h,p=r-h,m=e+r>>1,v=m-h,g=m+h,y=d,b=v,x=m,_=g,w=p,M=e+1,k=r-1,A=0;c(y,b,f)&&(A=y,y=b,b=A);c(_,w,f)&&(A=_,_=w,w=A);c(y,x,f)&&(A=y,y=x,x=A);c(b,x,f)&&(A=b,b=x,x=A);c(y,_,f)&&(A=y,y=_,_=A);c(x,_,f)&&(A=x,x=_,_=A);c(b,w,f)&&(A=b,b=w,w=A);c(b,x,f)&&(A=b,b=x,x=A);c(_,w,f)&&(A=_,_=w,w=A);var T=f[2*b];var E=f[2*b+1];var S=f[2*_];var L=f[2*_+1];var C=2*y;var P=2*x;var z=2*w;var O=2*d;var D=2*m;var I=2*p;for(var R=0;R<2;++R){var N=f[C+R],F=f[P+R],j=f[z+R];f[O+R]=N,f[D+R]=F,f[I+R]=j}o(v,e,f);o(g,r,f);for(var B=M;B<=k;++B)if(u(B,T,E,f))B!==M&&a(B,M,f),++M;else if(!u(B,S,L,f))for(;;){if(u(k,S,L,f)){u(k,T,E,f)?(s(B,M,k,f),++M,--k):(a(B,k,f),--k);break}if(--k<B)break}l(e,M-1,T,E,f);l(r,k+1,S,L,f);M-2-e<=n?i(e,M-2,f):t(e,M-2,f);r-(k+2)<=n?i(k+2,r,f):t(k+2,r,f);k-M<=n?i(M,k,f):t(M,k,f)}(0,e-1,t)};var n=32;function i(t,e,r){for(var n=2*(t+1),i=t+1;i<=e;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-- >t;){var c=r[l-2],u=r[l-1];if(c<a)break;if(c===a&&u<o)break;r[l]=c,r[l+1]=u,l-=2}r[l]=a,r[l+1]=o}}function a(t,e,r){e*=2;var n=r[t*=2],i=r[t+1];r[t]=r[e],r[t+1]=r[e+1],r[e]=n,r[e+1]=i}function o(t,e,r){e*=2,r[t*=2]=r[e],r[t+1]=r[e+1]}function s(t,e,r,n){e*=2,r*=2;var i=n[t*=2],a=n[t+1];n[t]=n[e],n[t+1]=n[e+1],n[e]=n[r],n[e+1]=n[r+1],n[r]=i,n[r+1]=a}function l(t,e,r,n,i){e*=2,i[t*=2]=i[e],i[e]=r,i[t+1]=i[e+1],i[e+1]=n}function c(t,e,r){e*=2;var n=r[t*=2],i=r[e];return!(n<i)&&(n!==i||r[t+1]>r[e+1])}function u(t,e,r,n){var i=n[t*=2];return i<e||i===e&&n[t+1]<r}},{}],81:[function(t,e,r){\"use strict\";e.exports={init:function(t){var e=i.nextPow2(t);s.length<e&&(n.free(s),s=n.mallocInt32(e));l.length<e&&(n.free(l),l=n.mallocInt32(e));c.length<e&&(n.free(c),c=n.mallocInt32(e));u.length<e&&(n.free(u),u=n.mallocInt32(e));f.length<e&&(n.free(f),f=n.mallocInt32(e));h.length<e&&(n.free(h),h=n.mallocInt32(e));var r=8*e;d.length<r&&(n.free(d),d=n.mallocDouble(r))},sweepBipartite:function(t,e,r,n,i,f,h,v,g,y){for(var b=0,x=2*t,_=t-1,w=x-1,M=r;M<n;++M){var k=f[M],A=x*M;d[b++]=i[A+_],d[b++]=-(k+1),d[b++]=i[A+w],d[b++]=k}for(var M=h;M<v;++M){var k=y[M]+o,T=x*M;d[b++]=g[T+_],d[b++]=-k,d[b++]=g[T+w],d[b++]=k}var E=b>>>1;a(d,E);for(var S=0,L=0,M=0;M<E;++M){var C=0|d[2*M+1];if(C>=o)p(c,u,L--,C=C-o|0);else if(C>=0)p(s,l,S--,C);else if(C<=-o){C=-C-o|0;for(var P=0;P<S;++P){var z=e(s[P],C);if(void 0!==z)return z}m(c,u,L++,C)}else{C=-C-1|0;for(var P=0;P<L;++P){var z=e(C,c[P]);if(void 0!==z)return z}m(s,l,S++,C)}}},sweepComplete:function(t,e,r,n,i,o,v,g,y,b){for(var x=0,_=2*t,w=t-1,M=_-1,k=r;k<n;++k){var A=o[k]+1<<1,T=_*k;d[x++]=i[T+w],d[x++]=-A,d[x++]=i[T+M],d[x++]=A}for(var k=v;k<g;++k){var A=b[k]+1<<1,E=_*k;d[x++]=y[E+w],d[x++]=1|-A,d[x++]=y[E+M],d[x++]=1|A}var S=x>>>1;a(d,S);for(var L=0,C=0,P=0,k=0;k<S;++k){var z=0|d[2*k+1],O=1&z;if(k<S-1&&z>>1==d[2*k+3]>>1&&(O=2,k+=1),z<0){for(var D=-(z>>1)-1,I=0;I<P;++I){var R=e(f[I],D);if(void 0!==R)return R}if(0!==O)for(var I=0;I<L;++I){var R=e(s[I],D);if(void 0!==R)return R}if(1!==O)for(var I=0;I<C;++I){var R=e(c[I],D);if(void 0!==R)return R}0===O?m(s,l,L++,D):1===O?m(c,u,C++,D):2===O&&m(f,h,P++,D)}else{var D=(z>>1)-1;0===O?p(s,l,L--,D):1===O?p(c,u,C--,D):2===O&&p(f,h,P--,D)}}},scanBipartite:function(t,e,r,n,i,c,u,f,h,v,g,y){var b=0,x=2*t,_=e,w=e+t,M=1,k=1;n?k=o:M=o;for(var A=i;A<c;++A){var T=A+M,E=x*A;d[b++]=u[E+_],d[b++]=-T,d[b++]=u[E+w],d[b++]=T}for(var A=h;A<v;++A){var T=A+k,S=x*A;d[b++]=g[S+_],d[b++]=-T}var L=b>>>1;a(d,L);for(var C=0,A=0;A<L;++A){var P=0|d[2*A+1];if(P<0){var T=-P,z=!1;if(T>=o?(z=!n,T-=o):(z=!!n,T-=1),z)m(s,l,C++,T);else{var O=y[T],D=x*T,I=g[D+e+1],R=g[D+e+1+t];t:for(var N=0;N<C;++N){var F=s[N],j=x*F;if(!(R<u[j+e+1]||u[j+e+1+t]<I)){for(var B=e+2;B<t;++B)if(g[D+B+t]<u[j+B]||u[j+B+t]<g[D+B])continue t;var U,V=f[F];if(void 0!==(U=n?r(O,V):r(V,O)))return U}}}}else p(s,l,C--,P-M)}},scanComplete:function(t,e,r,n,i,l,c,u,f,h,p){for(var m=0,v=2*t,g=e,y=e+t,b=n;b<i;++b){var x=b+o,_=v*b;d[m++]=l[_+g],d[m++]=-x,d[m++]=l[_+y],d[m++]=x}for(var b=u;b<f;++b){var x=b+1,w=v*b;d[m++]=h[w+g],d[m++]=-x}var M=m>>>1;a(d,M);for(var k=0,b=0;b<M;++b){var A=0|d[2*b+1];if(A<0){var x=-A;if(x>=o)s[k++]=x-o;else{var T=p[x-=1],E=v*x,S=h[E+e+1],L=h[E+e+1+t];t:for(var C=0;C<k;++C){var P=s[C],z=c[P];if(z===T)break;var O=v*P;if(!(L<l[O+e+1]||l[O+e+1+t]<S)){for(var D=e+2;D<t;++D)if(h[E+D+t]<l[O+D]||l[O+D+t]<h[E+D])continue t;var I=r(z,T);if(void 0!==I)return I}}}}else{for(var x=A-o,C=k-1;C>=0;--C)if(s[C]===x){for(var D=C+1;D<k;++D)s[D-1]=s[D];break}--k}}}};var n=t(\"typedarray-pool\"),i=t(\"bit-twiddle\"),a=t(\"./sort\"),o=1<<28,s=n.mallocInt32(1024),l=n.mallocInt32(1024),c=n.mallocInt32(1024),u=n.mallocInt32(1024),f=n.mallocInt32(1024),h=n.mallocInt32(1024),d=n.mallocDouble(8192);function p(t,e,r,n){var i=e[n],a=t[r-1];t[i]=a,e[a]=i}function m(t,e,r,n){t[r]=n,e[n]=r}},{\"./sort\":80,\"bit-twiddle\":71,\"typedarray-pool\":534}],82:[function(t,e,r){},{}],83:[function(t,e,r){\"use strict\";var n=t(\"base64-js\"),i=t(\"ieee754\");r.Buffer=s,r.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},r.INSPECT_MAX_BYTES=50;var a=2147483647;function o(t){if(t>a)throw new RangeError(\"Invalid typed array length\");var e=new Uint8Array(t);return e.__proto__=s.prototype,e}function s(t,e,r){if(\"number\"==typeof t){if(\"string\"==typeof e)throw new Error(\"If encoding is specified then the first argument must be a string\");return u(t)}return l(t,e,r)}function l(t,e,r){if(\"number\"==typeof t)throw new TypeError('\"value\" argument must not be a number');return B(t)?function(t,e,r){if(e<0||t.byteLength<e)throw new RangeError(\"'offset' is out of bounds\");if(t.byteLength<e+(r||0))throw new RangeError(\"'length' is out of bounds\");var n;n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r);return n.__proto__=s.prototype,n}(t,e,r):\"string\"==typeof t?function(t,e){\"string\"==typeof e&&\"\"!==e||(e=\"utf8\");if(!s.isEncoding(e))throw new TypeError('\"encoding\" must be a valid string encoding');var r=0|d(t,e),n=o(r),i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e):function(t){if(s.isBuffer(t)){var e=0|h(t.length),r=o(e);return 0===r.length?r:(t.copy(r,0,0,e),r)}if(t){if(U(t)||\"length\"in t)return\"number\"!=typeof t.length||V(t.length)?o(0):f(t);if(\"Buffer\"===t.type&&Array.isArray(t.data))return f(t.data)}throw new TypeError(\"First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.\")}(t)}function c(t){if(\"number\"!=typeof t)throw new TypeError('\"size\" argument must be a number');if(t<0)throw new RangeError('\"size\" argument must not be negative')}function u(t){return c(t),o(t<0?0:0|h(t))}function f(t){for(var e=t.length<0?0:0|h(t.length),r=o(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function h(t){if(t>=a)throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+a.toString(16)+\" bytes\");return 0|t}function d(t,e){if(s.isBuffer(t))return t.length;if(U(t)||B(t))return t.byteLength;\"string\"!=typeof t&&(t=\"\"+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case\"ascii\":case\"latin1\":case\"binary\":return r;case\"utf8\":case\"utf-8\":case void 0:return N(t).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*r;case\"hex\":return r>>>1;case\"base64\":return F(t).length;default:if(n)return N(t).length;e=(\"\"+e).toLowerCase(),n=!0}}function p(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,i){if(0===t.length)return-1;if(\"string\"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),V(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if(\"string\"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if(\"number\"==typeof e)return e&=255,\"function\"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError(\"val must be string, number or Buffer\")}function v(t,e,r,n,i){var a,o=1,s=t.length,l=e.length;if(void 0!==n&&(\"ucs2\"===(n=String(n).toLowerCase())||\"ucs-2\"===n||\"utf16le\"===n||\"utf-16le\"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var u=-1;for(a=r;a<s;a++)if(c(t,a)===c(e,-1===u?0:a-u)){if(-1===u&&(u=a),a-u+1===l)return u*o}else-1!==u&&(a-=a-u),u=-1}else for(r+l>s&&(r=s-l),a=r;a>=0;a--){for(var f=!0,h=0;h<l;h++)if(c(t,a+h)!==c(e,h)){f=!1;break}if(f)return a}return-1}function g(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a=e.length;if(a%2!=0)throw new TypeError(\"Invalid hex string\");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(e.substr(2*o,2),16);if(V(s))return o;t[r+o]=s}return o}function y(t,e,r,n){return j(N(e,t.length-r),t,r,n)}function b(t,e,r,n){return j(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function x(t,e,r,n){return b(t,e,r,n)}function _(t,e,r,n){return j(F(e),t,r,n)}function w(t,e,r,n){return j(function(t,e){for(var r,n,i,a=[],o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),n=r>>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function M(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function k(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var a,o,s,l,c=t[i],u=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(u=c);break;case 2:128==(192&(a=t[i+1]))&&(l=(31&c)<<6|63&a)>127&&(u=l);break;case 3:a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&(l=(15&c)<<12|(63&a)<<6|63&o)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(l=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,f=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=f}return function(t){var e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);var r=\"\",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=A));return r}(n)}r.kMaxLength=a,s.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),s.TYPED_ARRAY_SUPPORT||\"undefined\"==typeof console||\"function\"!=typeof console.error||console.error(\"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.\"),\"undefined\"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),s.poolSize=8192,s.from=function(t,e,r){return l(t,e,r)},s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,s.alloc=function(t,e,r){return function(t,e,r){return c(t),t<=0?o(t):void 0!==e?\"string\"==typeof r?o(t).fill(e,r):o(t).fill(e):o(t)}(t,e,r)},s.allocUnsafe=function(t){return u(t)},s.allocUnsafeSlow=function(t){return u(t)},s.isBuffer=function(t){return null!=t&&!0===t._isBuffer},s.compare=function(t,e){if(!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError(\"Arguments must be Buffers\");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i<a;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},s.isEncoding=function(t){switch(String(t).toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"latin1\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return!0;default:return!1}},s.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('\"list\" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=s.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var a=t[r];if(!s.isBuffer(a))throw new TypeError('\"list\" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},s.byteLength=d,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError(\"Buffer size must be a multiple of 16-bits\");for(var e=0;e<t;e+=2)p(this,e,e+1);return this},s.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError(\"Buffer size must be a multiple of 32-bits\");for(var e=0;e<t;e+=4)p(this,e,e+3),p(this,e+1,e+2);return this},s.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError(\"Buffer size must be a multiple of 64-bits\");for(var e=0;e<t;e+=8)p(this,e,e+7),p(this,e+1,e+6),p(this,e+2,e+5),p(this,e+3,e+4);return this},s.prototype.toString=function(){var t=this.length;return 0===t?\"\":0===arguments.length?k(this,0,t):function(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return\"\";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return\"\";if((r>>>=0)<=(e>>>=0))return\"\";for(t||(t=\"utf8\");;)switch(t){case\"hex\":return S(this,e,r);case\"utf8\":case\"utf-8\":return k(this,e,r);case\"ascii\":return T(this,e,r);case\"latin1\":case\"binary\":return E(this,e,r);case\"base64\":return M(this,e,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return L(this,e,r);default:if(n)throw new TypeError(\"Unknown encoding: \"+t);t=(t+\"\").toLowerCase(),n=!0}}.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError(\"Argument must be a Buffer\");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t=\"\",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString(\"hex\",0,e).match(/.{2}/g).join(\" \"),this.length>e&&(t+=\" ... \")),\"<Buffer \"+t+\">\"},s.prototype.compare=function(t,e,r,n,i){if(!s.isBuffer(t))throw new TypeError(\"Argument must be a Buffer\");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError(\"out of range index\");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var a=i-n,o=r-e,l=Math.min(a,o),c=this.slice(n,i),u=t.slice(e,r),f=0;f<l;++f)if(c[f]!==u[f]){a=c[f],o=u[f];break}return a<o?-1:o<a?1:0},s.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},s.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},s.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},s.prototype.write=function(t,e,r,n){if(void 0===e)n=\"utf8\",r=this.length,e=0;else if(void 0===r&&\"string\"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n=\"utf8\")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");n||(n=\"utf8\");for(var a=!1;;)switch(n){case\"hex\":return g(this,t,e,r);case\"utf8\":case\"utf-8\":return y(this,t,e,r);case\"ascii\":return b(this,t,e,r);case\"latin1\":case\"binary\":return x(this,t,e,r);case\"base64\":return _(this,t,e,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return w(this,t,e,r);default:if(a)throw new TypeError(\"Unknown encoding: \"+n);n=(\"\"+n).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function T(t,e,r){var n=\"\";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function E(t,e,r){var n=\"\";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function S(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i=\"\",a=e;a<r;++a)i+=R(t[a]);return i}function L(t,e,r){for(var n=t.slice(e,r),i=\"\",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function C(t,e,r){if(t%1!=0||t<0)throw new RangeError(\"offset is not uint\");if(t+e>r)throw new RangeError(\"Trying to access beyond buffer length\")}function P(t,e,r,n,i,a){if(!s.isBuffer(t))throw new TypeError('\"buffer\" argument must be a Buffer instance');if(e>i||e<a)throw new RangeError('\"value\" argument is out of bounds');if(r+n>t.length)throw new RangeError(\"Index out of range\")}function z(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError(\"Index out of range\");if(r<0)throw new RangeError(\"Index out of range\")}function O(t,e,r,n,a){return e=+e,r>>>=0,a||z(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,a){return e=+e,r>>>=0,a||z(t,0,r,8),i.write(t,e,r,n,52,8),r+8}s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return n.__proto__=s.prototype,n},s.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return n},s.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*e)),a},s.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||C(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||P(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[e]=255&t;++a<r&&(i*=256);)this[e+a]=t/i&255;return e+r},s.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||P(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);P(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a<r&&(o*=256);)t<0&&0===s&&0!==this[e+a-1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);P(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return O(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return O(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError(\"targetStart out of bounds\");if(r<0||r>=this.length)throw new RangeError(\"sourceStart out of bounds\");if(n<0)throw new RangeError(\"sourceEnd out of bounds\");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,a=n-r;if(this===t&&r<e&&e<n)for(i=a-1;i>=0;--i)t[i+e]=this[i+r];else if(a<1e3)for(i=0;i<a;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+a),e);return a},s.prototype.fill=function(t,e,r,n){if(\"string\"==typeof t){if(\"string\"==typeof e?(n=e,e=0,r=this.length):\"string\"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&\"string\"!=typeof n)throw new TypeError(\"encoding must be a string\");if(\"string\"==typeof n&&!s.isEncoding(n))throw new TypeError(\"Unknown encoding: \"+n)}else\"number\"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError(\"Out of range index\");if(r<=e)return this;var a;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),\"number\"==typeof t)for(a=e;a<r;++a)this[a]=t;else{var o=s.isBuffer(t)?t:new s(t,n),l=o.length;for(a=0;a<r-e;++a)this[a+e]=o[a%l]}return this};var I=/[^+/0-9A-Za-z-_]/g;function R(t){return t<16?\"0\"+t.toString(16):t.toString(16)}function N(t,e){var r;e=e||1/0;for(var n=t.length,i=null,a=[],o=0;o<n;++o){if((r=t.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error(\"Invalid code point\");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function F(t){return n.toByteArray(function(t){if((t=t.trim().replace(I,\"\")).length<2)return\"\";for(;t.length%4!=0;)t+=\"=\";return t}(t))}function j(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function B(t){return t instanceof ArrayBuffer||null!=t&&null!=t.constructor&&\"ArrayBuffer\"===t.constructor.name&&\"number\"==typeof t.byteLength}function U(t){return\"function\"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function V(t){return t!=t}},{\"base64-js\":84,ieee754:257}],84:[function(t,e,r){\"use strict\";r.byteLength=function(t){return 3*t.length/4-c(t)},r.toByteArray=function(t){var e,r,n,o,s,l=t.length;o=c(t),s=new a(3*l/4-o),r=o>0?l-4:l;var u=0;for(e=0;e<r;e+=4)n=i[t.charCodeAt(e)]<<18|i[t.charCodeAt(e+1)]<<12|i[t.charCodeAt(e+2)]<<6|i[t.charCodeAt(e+3)],s[u++]=n>>16&255,s[u++]=n>>8&255,s[u++]=255&n;2===o?(n=i[t.charCodeAt(e)]<<2|i[t.charCodeAt(e+1)]>>4,s[u++]=255&n):1===o&&(n=i[t.charCodeAt(e)]<<10|i[t.charCodeAt(e+1)]<<4|i[t.charCodeAt(e+2)]>>2,s[u++]=n>>8&255,s[u++]=255&n);return s},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,a=\"\",o=[],s=0,l=r-i;s<l;s+=16383)o.push(u(t,s,s+16383>l?l:s+16383));1===i?(e=t[r-1],a+=n[e>>2],a+=n[e<<4&63],a+=\"==\"):2===i&&(e=(t[r-2]<<8)+t[r-1],a+=n[e>>10],a+=n[e>>4&63],a+=n[e<<2&63],a+=\"=\");return o.push(a),o.join(\"\")};for(var n=[],i=[],a=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,o=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",s=0,l=o.length;s<l;++s)n[s]=o[s],i[o.charCodeAt(s)]=s;function c(t){var e=t.length;if(e%4>0)throw new Error(\"Invalid string. Length must be a multiple of 4\");return\"=\"===t[e-2]?2:\"=\"===t[e-1]?1:0}function u(t,e,r){for(var i,a,o=[],s=e;s<r;s+=3)i=(t[s]<<16)+(t[s+1]<<8)+t[s+2],o.push(n[(a=i)>>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join(\"\")}i[\"-\".charCodeAt(0)]=62,i[\"_\".charCodeAt(0)]=63},{}],85:[function(t,e,r){\"use strict\";var n=t(\"./lib/monotone\"),i=t(\"./lib/triangulation\"),a=t(\"./lib/delaunay\"),o=t(\"./lib/filter\");function s(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function l(t,e){return t[0]-e[0]||t[1]-e[1]}function c(t,e,r){return e in t?t[e]:r}e.exports=function(t,e,r){Array.isArray(e)?(r=r||{},e=e||[]):(r=e||{},e=[]);var u=!!c(r,\"delaunay\",!0),f=!!c(r,\"interior\",!0),h=!!c(r,\"exterior\",!0),d=!!c(r,\"infinity\",!1);if(!f&&!h||0===t.length)return[];var p=n(t,e);if(u||f!==h||d){for(var m=i(t.length,function(t){return t.map(s).sort(l)}(e)),v=0;v<p.length;++v){var g=p[v];m.addTriangle(g[0],g[1],g[2])}return u&&a(t,m),h?f?d?o(m,0,d):m.cells():o(m,1,d):o(m,-1)}return p}},{\"./lib/delaunay\":86,\"./lib/filter\":87,\"./lib/monotone\":88,\"./lib/triangulation\":89}],86:[function(t,e,r){\"use strict\";var n=t(\"robust-in-sphere\")[4];t(\"binary-search-bounds\");function i(t,e,r,i,a,o){var s=e.opposite(i,a);if(!(s<0)){if(a<i){var l=i;i=a,a=l,l=o,o=s,s=l}e.isConstraint(i,a)||n(t[i],t[a],t[o],t[s])<0&&r.push(i,a)}}e.exports=function(t,e){for(var r=[],a=t.length,o=e.stars,s=0;s<a;++s)for(var l=o[s],c=1;c<l.length;c+=2){var u=l[c];if(!(u<s)&&!e.isConstraint(s,u)){for(var f=l[c-1],h=-1,d=1;d<l.length;d+=2)if(l[d-1]===u){h=l[d];break}h<0||n(t[s],t[u],t[f],t[h])<0&&r.push(s,u)}}for(;r.length>0;){for(var u=r.pop(),s=r.pop(),f=-1,h=-1,l=o[s],p=1;p<l.length;p+=2){var m=l[p-1],v=l[p];m===u?h=v:v===u&&(f=m)}f<0||h<0||(n(t[s],t[u],t[f],t[h])>=0||(e.flip(s,u),i(t,e,r,f,s,h),i(t,e,r,s,h,f),i(t,e,r,h,u,f),i(t,e,r,u,f,h)))}}},{\"binary-search-bounds\":90,\"robust-in-sphere\":493}],87:[function(t,e,r){\"use strict\";var n,i=t(\"binary-search-bounds\");function a(t,e,r,n,i,a,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function o(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}e.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,i=0;i<n;++i){var s=r[i],l=s[0],c=s[1],u=s[2];c<u?c<l&&(s[0]=c,s[1]=u,s[2]=l):u<l&&(s[0]=u,s[1]=l,s[2]=c)}r.sort(o);for(var f=new Array(n),i=0;i<f.length;++i)f[i]=0;var h=[],d=[],p=new Array(3*n),m=new Array(3*n),v=null;e&&(v=[]);for(var g=new a(r,p,m,f,h,d,v),i=0;i<n;++i)for(var s=r[i],y=0;y<3;++y){var l=s[y],c=s[(y+1)%3],b=p[3*i+y]=g.locate(c,l,t.opposite(c,l)),x=m[3*i+y]=t.isConstraint(l,c);b<0&&(x?d.push(i):(h.push(i),f[i]=1),e&&v.push([c,l,-1]))}return g}(t,r);if(0===e)return r?n.cells.concat(n.boundary):n.cells;var i=1,s=n.active,l=n.next,c=n.flags,u=n.cells,f=n.constraint,h=n.neighbor;for(;s.length>0||l.length>0;){for(;s.length>0;){var d=s.pop();if(c[d]!==-i){c[d]=i;u[d];for(var p=0;p<3;++p){var m=h[3*d+p];m>=0&&0===c[m]&&(f[3*d+p]?l.push(m):(s.push(m),c[m]=i))}}}var v=l;l=s,s=v,l.length=0,i=-i}var g=function(t,e,r){for(var n=0,i=0;i<t.length;++i)e[i]===r&&(t[n++]=t[i]);return t.length=n,t}(u,c,e);if(r)return g.concat(n.boundary);return g},a.prototype.locate=(n=[0,0,0],function(t,e,r){var a=t,s=e,l=r;return e<r?e<t&&(a=e,s=r,l=t):r<t&&(a=r,s=t,l=e),a<0?-1:(n[0]=a,n[1]=s,n[2]=l,i.eq(this.cells,n,o))})},{\"binary-search-bounds\":90}],88:[function(t,e,r){\"use strict\";var n=t(\"binary-search-bounds\"),i=t(\"robust-orientation\")[3],a=0,o=1,s=2;function l(t,e,r,n,i){this.a=t,this.b=e,this.idx=r,this.lowerIds=n,this.upperIds=i}function c(t,e,r,n){this.a=t,this.b=e,this.type=r,this.idx=n}function u(t,e){var r=t.a[0]-e.a[0]||t.a[1]-e.a[1]||t.type-e.type;return r||(t.type!==a&&(r=i(t.a,t.b,e.b))?r:t.idx-e.idx)}function f(t,e){return i(t.a,t.b,e)}function h(t,e,r,a,o){for(var s=n.lt(e,a,f),l=n.gt(e,a,f),c=s;c<l;++c){for(var u=e[c],h=u.lowerIds,d=h.length;d>1&&i(r[h[d-2]],r[h[d-1]],a)>0;)t.push([h[d-1],h[d-2],o]),d-=1;h.length=d,h.push(o);var p=u.upperIds;for(d=p.length;d>1&&i(r[p[d-2]],r[p[d-1]],a)<0;)t.push([p[d-2],p[d-1],o]),d-=1;p.length=d,p.push(o)}}function d(t,e){var r;return(r=t.a[0]<e.a[0]?i(t.a,t.b,e.a):i(e.b,e.a,t.a))?r:(r=e.b[0]<t.b[0]?i(t.a,t.b,e.b):i(e.b,e.a,t.b))||t.idx-e.idx}function p(t,e,r){var i=n.le(t,r,d),a=t[i],o=a.upperIds,s=o[o.length-1];a.upperIds=[s],t.splice(i+1,0,new l(r.a,r.b,r.idx,[s],o))}function m(t,e,r){var i=r.a;r.a=r.b,r.b=i;var a=n.eq(t,r,d),o=t[a];t[a-1].upperIds=o.upperIds,t.splice(a,1)}e.exports=function(t,e){for(var r=t.length,n=e.length,i=[],f=0;f<r;++f)i.push(new c(t[f],null,a,f));for(var f=0;f<n;++f){var d=e[f],v=t[d[0]],g=t[d[1]];v[0]<g[0]?i.push(new c(v,g,s,f),new c(g,v,o,f)):v[0]>g[0]&&i.push(new c(g,v,s,f),new c(v,g,o,f))}i.sort(u);for(var y=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),b=[new l([y,1],[y,0],-1,[],[],[],[])],x=[],f=0,_=i.length;f<_;++f){var w=i[f],M=w.type;M===a?h(x,b,t,w.a,w.idx):M===s?p(b,t,w):m(b,t,w)}return x}},{\"binary-search-bounds\":90,\"robust-orientation\":495}],89:[function(t,e,r){\"use strict\";var n=t(\"binary-search-bounds\");function i(t,e){this.stars=t,this.edges=e}e.exports=function(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=[];return new i(r,e)};var a=i.prototype;function o(t,e,r){for(var n=1,i=t.length;n<i;n+=2)if(t[n-1]===e&&t[n]===r)return t[n-1]=t[i-2],t[n]=t[i-1],void(t.length=i-2)}a.isConstraint=function(){var t=[0,0];function e(t,e){return t[0]-e[0]||t[1]-e[1]}return function(r,i){return t[0]=Math.min(r,i),t[1]=Math.max(r,i),n.eq(this.edges,t,e)>=0}}(),a.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},a.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},a.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;n<i;n+=2)if(r[n]===t)return r[n-1];return-1},a.flip=function(t,e){var r=this.opposite(t,e),n=this.opposite(e,t);this.removeTriangle(t,e,r),this.removeTriangle(e,t,n),this.addTriangle(t,n,r),this.addTriangle(e,r,n)},a.edges=function(){for(var t=this.stars,e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,o=i.length;a<o;a+=2)e.push([i[a],i[a+1]]);return e},a.cells=function(){for(var t=this.stars,e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,o=i.length;a<o;a+=2){var s=i[a],l=i[a+1];r<Math.min(s,l)&&e.push([r,s,l])}return e}},{\"binary-search-bounds\":90}],90:[function(t,e,r){\"use strict\";function n(t,e,r,n,i){var a=[\"function \",t,\"(a,l,h,\",n.join(\",\"),\"){\",i?\"\":\"var i=\",r?\"l-1\":\"h+1\",\";while(l<=h){var m=(l+h)>>>1,x=a[m]\"];return i?e.indexOf(\"c\")<0?a.push(\";if(x===y){return m}else if(x<=y){\"):a.push(\";var p=c(x,y);if(p===0){return m}else if(p<=0){\"):a.push(\";if(\",e,\"){i=m;\"),r?a.push(\"l=m+1}else{h=m-1}\"):a.push(\"h=m-1}else{l=m+1}\"),a.push(\"}\"),i?a.push(\"return -1};\"):a.push(\"return i};\"),a.join(\"\")}function i(t,e,r,i){return new Function([n(\"A\",\"x\"+t+\"y\",e,[\"y\"],i),n(\"P\",\"c(x,y)\"+t+\"0\",e,[\"y\",\"c\"],i),\"function dispatchBsearch\",r,\"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch\",r].join(\"\"))()}e.exports={ge:i(\">=\",!1,\"GE\"),gt:i(\">\",!1,\"GT\"),lt:i(\"<\",!0,\"LT\"),le:i(\"<=\",!0,\"LE\"),eq:i(\"-\",!0,\"EQ\",!0)}},{}],91:[function(t,e,r){\"use strict\";e.exports=function(t){for(var e=1,r=1;r<t.length;++r)for(var n=0;n<r;++n)if(t[r]<t[n])e=-e;else if(t[n]===t[r])return 0;return e}},{}],92:[function(t,e,r){\"use strict\";var n=t(\"dup\"),i=t(\"robust-linear-solve\");function a(t,e){for(var r=0,n=t.length,i=0;i<n;++i)r+=t[i]*e[i];return r}function o(t){var e=t.length;if(0===e)return[];t[0].length;var r=n([t.length+1,t.length+1],1),o=n([t.length+1],1);r[e][e]=0;for(var s=0;s<e;++s){for(var l=0;l<=s;++l)r[l][s]=r[s][l]=2*a(t[s],t[l]);o[s]=a(t[s],t[s])}var c=i(r,o),u=0,f=c[e+1];for(s=0;s<f.length;++s)u+=f[s];var h=new Array(e);for(s=0;s<e;++s){f=c[s];var d=0;for(l=0;l<f.length;++l)d+=f[l];h[s]=d/u}return h}function s(t){if(0===t.length)return[];for(var e=t[0].length,r=n([e]),i=o(t),a=0;a<t.length;++a)for(var s=0;s<e;++s)r[s]+=t[a][s]*i[a];return r}s.barycenetric=o,e.exports=s},{dup:134,\"robust-linear-solve\":494}],93:[function(t,e,r){e.exports=function(t){for(var e=n(t),r=0,i=0;i<t.length;++i)for(var a=t[i],o=0;o<e.length;++o)r+=Math.pow(a[o]-e[o],2);return Math.sqrt(r/t.length)};var n=t(\"circumcenter\")},{circumcenter:92}],94:[function(t,e,r){e.exports=function(t,e,r){return e<r?t<e?e:t>r?r:t:t<r?r:t>e?e:t}},{}],95:[function(t,e,r){\"use strict\";e.exports=function(t,e,r){var n;if(r){n=e;for(var i=new Array(e.length),a=0;a<e.length;++a){var o=e[a];i[a]=[o[0],o[1],r[a]]}e=i}var s=function(t,e,r){var n=p(t,[],d(t));return g(e,n,r),!!n}(t,e,!!r);for(;y(t,e,!!r);)s=!0;if(r&&s){n.length=0,r.length=0;for(var a=0;a<e.length;++a){var o=e[a];n.push([o[0],o[1]]),r.push(o[2])}}return s};var n=t(\"union-find\"),i=t(\"box-intersect\"),a=t(\"robust-segment-intersect\"),o=t(\"big-rat\"),s=t(\"big-rat/cmp\"),l=t(\"big-rat/to-float\"),c=t(\"rat-vec\"),u=t(\"nextafter\"),f=t(\"./lib/rat-seg-intersect\");function h(t){var e=l(t);return[u(e,-1/0),u(e,1/0)]}function d(t){for(var e=new Array(t.length),r=0;r<t.length;++r){var n=t[r];e[r]=[u(n[0],-1/0),u(n[1],-1/0),u(n[0],1/0),u(n[1],1/0)]}return e}function p(t,e,r){for(var a=e.length,o=new n(a),s=[],l=0;l<e.length;++l){var c=e[l],f=h(c[0]),d=h(c[1]);s.push([u(f[0],-1/0),u(d[0],-1/0),u(f[1],1/0),u(d[1],1/0)])}i(s,function(t,e){o.link(t,e)});var p=!0,m=new Array(a);for(l=0;l<a;++l){(g=o.find(l))!==l&&(p=!1,t[g]=[Math.min(t[l][0],t[g][0]),Math.min(t[l][1],t[g][1])])}if(p)return null;var v=0;for(l=0;l<a;++l){var g;(g=o.find(l))===l?(m[l]=v,t[v++]=t[l]):m[l]=-1}t.length=v;for(l=0;l<a;++l)m[l]<0&&(m[l]=m[o.find(l)]);return m}function m(t,e){return t[0]-e[0]||t[1]-e[1]}function v(t,e){var r=t[0]-e[0]||t[1]-e[1];return r||(t[2]<e[2]?-1:t[2]>e[2]?1:0)}function g(t,e,r){if(0!==t.length){if(e)for(var n=0;n<t.length;++n){var i=e[(o=t[n])[0]],a=e[o[1]];o[0]=Math.min(i,a),o[1]=Math.max(i,a)}else for(n=0;n<t.length;++n){var o;i=(o=t[n])[0],a=o[1];o[0]=Math.min(i,a),o[1]=Math.max(i,a)}r?t.sort(v):t.sort(m);var s=1;for(n=1;n<t.length;++n){var l=t[n-1],c=t[n];(c[0]!==l[0]||c[1]!==l[1]||r&&c[2]!==l[2])&&(t[s++]=c)}t.length=s}}function y(t,e,r){var n=function(t,e){for(var r=new Array(e.length),n=0;n<e.length;++n){var i=e[n],a=t[i[0]],o=t[i[1]];r[n]=[u(Math.min(a[0],o[0]),-1/0),u(Math.min(a[1],o[1]),-1/0),u(Math.max(a[0],o[0]),1/0),u(Math.max(a[1],o[1]),1/0)]}return r}(t,e),h=function(t,e,r){var n=[];return i(r,function(r,i){var o=e[r],s=e[i];if(o[0]!==s[0]&&o[0]!==s[1]&&o[1]!==s[0]&&o[1]!==s[1]){var l=t[o[0]],c=t[o[1]],u=t[s[0]],f=t[s[1]];a(l,c,u,f)&&n.push([r,i])}}),n}(t,e,n),m=d(t),v=function(t,e,r,n){var o=[];return i(r,n,function(r,n){var i=e[r];if(i[0]!==n&&i[1]!==n){var s=t[n],l=t[i[0]],c=t[i[1]];a(l,c,s,s)&&o.push([r,n])}}),o}(t,e,n,m),y=p(t,function(t,e,r,n,i){var a,u,h=t.map(function(t){return[o(t[0]),o(t[1])]});for(a=0;a<r.length;++a){var d=r[a];u=d[0];var p=d[1],m=e[u],v=e[p],g=f(c(t[m[0]]),c(t[m[1]]),c(t[v[0]]),c(t[v[1]]));if(g){var y=t.length;t.push([l(g[0]),l(g[1])]),h.push(g),n.push([u,y],[p,y])}}for(n.sort(function(t,e){if(t[0]!==e[0])return t[0]-e[0];var r=h[t[1]],n=h[e[1]];return s(r[0],n[0])||s(r[1],n[1])}),a=n.length-1;a>=0;--a){var b=e[u=(E=n[a])[0]],x=b[0],_=b[1],w=t[x],M=t[_];if((w[0]-M[0]||w[1]-M[1])<0){var k=x;x=_,_=k}b[0]=x;var A,T=b[1]=E[1];for(i&&(A=b[2]);a>0&&n[a-1][0]===u;){var E,S=(E=n[--a])[1];i?e.push([T,S,A]):e.push([T,S]),T=S}i?e.push([T,_,A]):e.push([T,_])}return h}(t,e,h,v,r));return g(e,y,r),!!y||(h.length>0||v.length>0)}},{\"./lib/rat-seg-intersect\":96,\"big-rat\":57,\"big-rat/cmp\":55,\"big-rat/to-float\":69,\"box-intersect\":75,nextafter:440,\"rat-vec\":477,\"robust-segment-intersect\":498,\"union-find\":535}],96:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,n){var a=s(e,t),f=s(n,r),h=u(a,f);if(0===o(h))return null;var d=s(t,r),p=u(f,d),m=i(p,h),v=c(a,m);return l(t,v)};var n=t(\"big-rat/mul\"),i=t(\"big-rat/div\"),a=t(\"big-rat/sub\"),o=t(\"big-rat/sign\"),s=t(\"rat-vec/sub\"),l=t(\"rat-vec/add\"),c=t(\"rat-vec/muls\");function u(t,e){return a(n(t[0],e[1]),n(t[1],e[0]))}},{\"big-rat/div\":56,\"big-rat/mul\":66,\"big-rat/sign\":67,\"big-rat/sub\":68,\"rat-vec/add\":476,\"rat-vec/muls\":478,\"rat-vec/sub\":479}],97:[function(t,e,r){\"use strict\";var n=t(\"clamp\");function i(t,e){null==e&&(e=!0);var r=t[0],i=t[1],a=t[2],o=t[3];return null==o&&(o=e?1:255),e&&(r*=255,i*=255,a*=255,o*=255),16777216*(r=255&n(r,0,255))+((i=255&n(i,0,255))<<16)+((a=255&n(a,0,255))<<8)+(o=255&n(o,0,255))}e.exports=i,e.exports.to=i,e.exports.from=function(t,e){var r=(t=+t)>>>24,n=(16711680&t)>>>16,i=(65280&t)>>>8,a=255&t;return!1===e?[r,n,i,a]:[r/255,n/255,i/255,a/255]}},{clamp:94}],98:[function(t,e,r){\"use strict\";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],99:[function(t,e,r){\"use strict\";var n=t(\"color-rgba\"),i=t(\"clamp\"),a=t(\"dtype\");e.exports=function(t,e){\"float\"!==e&&e||(e=\"array\"),\"uint\"===e&&(e=\"uint8\"),\"uint_clamped\"===e&&(e=\"uint8_clamped\");var r=a(e),o=new r(4);if(t instanceof r)return Array.isArray(t)?t.slice():(o.set(t),o);var s=\"uint8\"!==e&&\"uint8_clamped\"!==e;return t instanceof Uint8Array||t instanceof Uint8ClampedArray?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:255,s&&(o[0]/=255,o[1]/=255,o[2]/=255,o[3]/=255),o):(t.length&&\"string\"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),s?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:1):(o[0]=i(Math.round(255*t[0]),0,255),o[1]=i(Math.round(255*t[1]),0,255),o[2]=i(Math.round(255*t[2]),0,255),o[3]=null==t[3]?255:i(Math.floor(255*t[3]),0,255)),o)}},{clamp:94,\"color-rgba\":101,dtype:133}],100:[function(t,e,r){(function(r){\"use strict\";var n=t(\"color-name\"),i=t(\"is-plain-obj\"),a=t(\"defined\");e.exports=function(t){var e,s,l=[],c=1;if(\"string\"==typeof t)if(n[t])l=n[t].slice(),s=\"rgb\";else if(\"transparent\"===t)c=0,s=\"rgb\",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var u=t.slice(1),f=u.length,h=f<=4;c=1,h?(l=[parseInt(u[0]+u[0],16),parseInt(u[1]+u[1],16),parseInt(u[2]+u[2],16)],4===f&&(c=parseInt(u[3]+u[3],16)/255)):(l=[parseInt(u[0]+u[1],16),parseInt(u[2]+u[3],16),parseInt(u[4]+u[5],16)],8===f&&(c=parseInt(u[6]+u[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s=\"rgb\"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\\s*\\(([^\\)]*)\\)/.exec(t)){var d=e[1],u=d.replace(/a$/,\"\");s=u;var f=\"cmyk\"===u?4:\"gray\"===u?1:3;l=e[2].trim().split(/\\s*,\\s*/).map(function(t,e){if(/%$/.test(t))return e===f?parseFloat(t)/100:\"rgb\"===u?255*parseFloat(t)/100:parseFloat(t);if(\"h\"===u[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)}),d===u&&l.push(1),c=void 0===l[f]?1:l[f],l=l.slice(0,f)}else t.length>10&&/[0-9](?:\\s|\\/)/.test(t)&&(l=t.match(/([0-9]+)/g).map(function(t){return parseFloat(t)}),s=t.match(/([a-z])/gi).join(\"\").toLowerCase());else if(\"number\"==typeof t)s=\"rgb\",l=[t>>>16,(65280&t)>>>8,255&t];else if(i(t)){var p=a(t.r,t.red,t.R,null);null!==p?(s=\"rgb\",l=[p,a(t.g,t.green,t.G),a(t.b,t.blue,t.B)]):(s=\"hsl\",l=[a(t.h,t.hue,t.H),a(t.s,t.saturation,t.S),a(t.l,t.lightness,t.L,t.b,t.brightness)]),c=a(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(c/=100)}else(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(l=[t[0],t[1],t[2]],s=\"rgb\",c=4===t.length?t[3]:1);return{space:s,values:l,alpha:c}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{\"color-name\":98,defined:129,\"is-plain-obj\":266}],101:[function(t,e,r){\"use strict\";var n=t(\"color-parse\"),i=t(\"color-space/hsl\"),a=t(\"clamp\");e.exports=function(t){var e;if(\"string\"!=typeof t)throw Error(\"Argument should be a string\");var r=n(t);return r.space?((e=Array(3))[0]=a(r.values[0],0,255),e[1]=a(r.values[1],0,255),e[2]=a(r.values[2],0,255),\"h\"===r.space[0]&&(e=i.rgb(e)),e.push(a(r.alpha,0,1)),e):[]}},{clamp:94,\"color-parse\":100,\"color-space/hsl\":102}],102:[function(t,e,r){\"use strict\";var n=t(\"./rgb\");e.exports={name:\"hsl\",min:[0,0,0],max:[360,100,100],channel:[\"hue\",\"saturation\",\"lightness\"],alias:[\"HSL\"],rgb:function(t){var e,r,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[a=255*l,a,a];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var c=0;c<3;c++)(n=o+1/3*-(c-1))<0?n++:n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[c]=255*a;return i}},n.hsl=function(t){var e,r,n=t[0]/255,i=t[1]/255,a=t[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o;return s===o?e=0:n===s?e=(i-a)/l:i===s?e=2+(a-n)/l:a===s&&(e=4+(n-i)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(o+s)/2,[e,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}},{\"./rgb\":103}],103:[function(t,e,r){\"use strict\";e.exports={name:\"rgb\",min:[0,0,0],max:[255,255,255],channel:[\"red\",\"green\",\"blue\"],alias:[\"RGB\"]}},{}],104:[function(t,e,r){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],\"rainbow-soft\":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],\"freesurface-blue\":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],\"freesurface-red\":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],\"velocity-blue\":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],\"velocity-green\":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},{}],105:[function(t,e,r){\"use strict\";var n=t(\"./colorScale\"),i=t(\"lerp\");function a(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function o(t){for(var e,r=\"#\",n=0;n<3;++n)r+=(\"00\"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function s(t){return\"rgba(\"+t.join(\",\")+\")\"}e.exports=function(t){var e,r,l,c,u,f,h,d,p,m;t||(t={});d=(t.nshades||72)-1,h=t.format||\"hex\",(f=t.colormap)||(f=\"jet\");if(\"string\"==typeof f){if(f=f.toLowerCase(),!n[f])throw Error(f+\" not a supported colorscale\");u=n[f]}else{if(!Array.isArray(f))throw Error(\"unsupported colormap option\",f);u=f.slice()}if(u.length>d)throw new Error(f+\" map requires nshades to be at least size \"+u.length);p=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():\"number\"==typeof t.alpha?[t.alpha,t.alpha]:[1,1];e=u.map(function(t){return Math.round(t.index*d)}),p[0]=Math.min(Math.max(p[0],0),1),p[1]=Math.min(Math.max(p[1],0),1);var v=u.map(function(t,e){var r=u[e].index,n=u[e].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1?n:(n[3]=p[0]+(p[1]-p[0])*r,n)}),g=[];for(m=0;m<e.length-1;++m){c=e[m+1]-e[m],r=v[m],l=v[m+1];for(var y=0;y<c;y++){var b=y/c;g.push([Math.round(i(r[0],l[0],b)),Math.round(i(r[1],l[1],b)),Math.round(i(r[2],l[2],b)),i(r[3],l[3],b)])}}g.push(u[u.length-1].rgb.concat(p[1])),\"hex\"===h?g=g.map(o):\"rgbaString\"===h?g=g.map(s):\"float\"===h&&(g=g.map(a));return g}},{\"./colorScale\":104,lerp:273}],106:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,a){var o=n(e,r,a);if(0===o){var s=i(n(t,e,r)),c=i(n(t,e,a));if(s===c){if(0===s){var u=l(t,e,r),f=l(t,e,a);return u===f?0:u?1:-1}return 0}return 0===c?s>0?-1:l(t,e,a)?-1:1:0===s?c>0?1:l(t,e,r)?1:-1:i(c-s)}var h=n(t,e,r);if(h>0)return o>0&&n(t,e,a)>0?1:-1;if(h<0)return o>0||n(t,e,a)>0?1:-1;var d=n(t,e,a);return d>0?1:l(t,e,r)?1:-1};var n=t(\"robust-orientation\"),i=t(\"signum\"),a=t(\"two-sum\"),o=t(\"robust-product\"),s=t(\"robust-sum\");function l(t,e,r){var n=a(t[0],-e[0]),i=a(t[1],-e[1]),l=a(r[0],-e[0]),c=a(r[1],-e[1]),u=s(o(n,l),o(i,c));return u[u.length-1]>=0}},{\"robust-orientation\":495,\"robust-product\":496,\"robust-sum\":500,signum:502,\"two-sum\":533}],107:[function(t,e,r){e.exports=function(t,e){var r=t.length,a=t.length-e.length;if(a)return a;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||n(t[0],t[1])-n(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(a=o+t[2]-(s+e[2]))return a;var l=n(t[0],t[1]),c=n(e[0],e[1]);return n(l,t[2])-n(c,e[2])||n(l+t[2],o)-n(c+e[2],s);case 4:var u=t[0],f=t[1],h=t[2],d=t[3],p=e[0],m=e[1],v=e[2],g=e[3];return u+f+h+d-(p+m+v+g)||n(u,f,h,d)-n(p,m,v,g,p)||n(u+f,u+h,u+d,f+h,f+d,h+d)-n(p+m,p+v,p+g,m+v,m+g,v+g)||n(u+f+h,u+f+d,u+h+d,f+h+d)-n(p+m+v,p+m+g,p+v+g,m+v+g);default:for(var y=t.slice().sort(i),b=e.slice().sort(i),x=0;x<r;++x)if(a=y[x]-b[x])return a;return 0}};var n=Math.min;function i(t,e){return t-e}},{}],108:[function(t,e,r){\"use strict\";var n=t(\"compare-cell\"),i=t(\"cell-orientation\");e.exports=function(t,e){return n(t,e)||i(t)-i(e)}},{\"cell-orientation\":91,\"compare-cell\":107}],109:[function(t,e,r){\"use strict\";var n=t(\"./lib/ch1d\"),i=t(\"./lib/ch2d\"),a=t(\"./lib/chnd\");e.exports=function(t){var e=t.length;if(0===e)return[];if(1===e)return[[0]];var r=t[0].length;if(0===r)return[];if(1===r)return n(t);if(2===r)return i(t);return a(t,r)}},{\"./lib/ch1d\":110,\"./lib/ch2d\":111,\"./lib/chnd\":112}],110:[function(t,e,r){\"use strict\";e.exports=function(t){for(var e=0,r=0,n=1;n<t.length;++n)t[n][0]<t[e][0]&&(e=n),t[n][0]>t[r][0]&&(r=n);return e<r?[[e],[r]]:e>r?[[r],[e]]:[[e]]}},{}],111:[function(t,e,r){\"use strict\";e.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var i=new Array(r),a=e[r-1],o=0;o<r;++o){var s=e[o];i[o]=[a,s],a=s}return i};var n=t(\"monotone-convex-hull-2d\")},{\"monotone-convex-hull-2d\":423}],112:[function(t,e,r){\"use strict\";e.exports=function(t,e){try{return n(t,!0)}catch(s){var r=i(t);if(r.length<=e)return[];var a=function(t,e){for(var r=t.length,n=new Array(r),i=0;i<e.length;++i)n[i]=t[e[i]];for(var a=e.length,i=0;i<r;++i)e.indexOf(i)<0&&(n[a++]=t[i]);return n}(t,r),o=n(a,!0);return function(t,e){for(var r=t.length,n=e.length,i=0;i<r;++i)for(var a=t[i],o=0;o<a.length;++o){var s=a[o];if(s<n)a[o]=e[s];else{s-=n;for(var l=0;l<n;++l)s>=e[l]&&(s+=1);a[o]=s}}return t}(o,r)}};var n=t(\"incremental-convex-hull\"),i=t(\"affine-hull\")},{\"affine-hull\":45,\"incremental-convex-hull\":258}],113:[function(t,e,r){e.exports={AFG:\"afghan\",ALA:\"\\\\b\\\\wland\",ALB:\"albania\",DZA:\"algeria\",ASM:\"^(?=.*americ).*samoa\",AND:\"andorra\",AGO:\"angola\",AIA:\"anguill?a\",ATA:\"antarctica\",ATG:\"antigua\",ARG:\"argentin\",ARM:\"armenia\",ABW:\"^(?!.*bonaire).*\\\\baruba\",AUS:\"australia\",AUT:\"^(?!.*hungary).*austria|\\\\baustri.*\\\\bemp\",AZE:\"azerbaijan\",BHS:\"bahamas\",BHR:\"bahrain\",BGD:\"bangladesh|^(?=.*east).*paki?stan\",BRB:\"barbados\",BLR:\"belarus|byelo\",BEL:\"^(?!.*luxem).*belgium\",BLZ:\"belize|^(?=.*british).*honduras\",BEN:\"benin|dahome\",BMU:\"bermuda\",BTN:\"bhutan\",BOL:\"bolivia\",BES:\"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\\\bbes.?islands\",BIH:\"herzegovina|bosnia\",BWA:\"botswana|bechuana\",BVT:\"bouvet\",BRA:\"brazil\",IOT:\"british.?indian.?ocean\",BRN:\"brunei\",BGR:\"bulgaria\",BFA:\"burkina|\\\\bfaso|upper.?volta\",BDI:\"burundi\",CPV:\"verde\",KHM:\"cambodia|kampuchea|khmer\",CMR:\"cameroon\",CAN:\"canada\",CYM:\"cayman\",CAF:\"\\\\bcentral.african.republic\",TCD:\"\\\\bchad\",CHL:\"\\\\bchile\",CHN:\"^(?!.*\\\\bmac)(?!.*\\\\bhong)(?!.*\\\\btai)(?!.*\\\\brep).*china|^(?=.*peo)(?=.*rep).*china\",CXR:\"christmas\",CCK:\"\\\\bcocos|keeling\",COL:\"colombia\",COM:\"comoro\",COG:\"^(?!.*\\\\bdem)(?!.*\\\\bd[\\\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\\\bcongo\",COK:\"\\\\bcook\",CRI:\"costa.?rica\",CIV:\"ivoire|ivory\",HRV:\"croatia\",CUB:\"\\\\bcuba\",CUW:\"^(?!.*bonaire).*\\\\bcura(c|\\xe7)ao\",CYP:\"cyprus\",CSK:\"czechoslovakia\",CZE:\"^(?=.*rep).*czech|czechia|bohemia\",COD:\"\\\\bdem.*congo|congo.*\\\\bdem|congo.*\\\\bd[\\\\.]?r|\\\\bd[\\\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc\",DNK:\"denmark\",DJI:\"djibouti\",DMA:\"dominica(?!n)\",DOM:\"dominican.rep\",ECU:\"ecuador\",EGY:\"egypt\",SLV:\"el.?salvador\",GNQ:\"guine.*eq|eq.*guine|^(?=.*span).*guinea\",ERI:\"eritrea\",EST:\"estonia\",ETH:\"ethiopia|abyssinia\",FLK:\"falkland|malvinas\",FRO:\"faroe|faeroe\",FJI:\"fiji\",FIN:\"finland\",FRA:\"^(?!.*\\\\bdep)(?!.*martinique).*france|french.?republic|\\\\bgaul\",GUF:\"^(?=.*french).*guiana\",PYF:\"french.?polynesia|tahiti\",ATF:\"french.?southern\",GAB:\"gabon\",GMB:\"gambia\",GEO:\"^(?!.*south).*georgia\",DDR:\"german.?democratic.?republic|democratic.?republic.*germany|east.germany\",DEU:\"^(?!.*east).*germany|^(?=.*\\\\bfed.*\\\\brep).*german\",GHA:\"ghana|gold.?coast\",GIB:\"gibraltar\",GRC:\"greece|hellenic|hellas\",GRL:\"greenland\",GRD:\"grenada\",GLP:\"guadeloupe\",GUM:\"\\\\bguam\",GTM:\"guatemala\",GGY:\"guernsey\",GIN:\"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea\",GNB:\"bissau|^(?=.*portu).*guinea\",GUY:\"guyana|british.?guiana\",HTI:\"haiti\",HMD:\"heard.*mcdonald\",VAT:\"holy.?see|vatican|papal.?st\",HND:\"^(?!.*brit).*honduras\",HKG:\"hong.?kong\",HUN:\"^(?!.*austr).*hungary\",ISL:\"iceland\",IND:\"india(?!.*ocea)\",IDN:\"indonesia\",IRN:\"\\\\biran|persia\",IRQ:\"\\\\biraq|mesopotamia\",IRL:\"(^ireland)|(^republic.*ireland)\",IMN:\"^(?=.*isle).*\\\\bman\",ISR:\"israel\",ITA:\"italy\",JAM:\"jamaica\",JPN:\"japan\",JEY:\"jersey\",JOR:\"jordan\",KAZ:\"kazak\",KEN:\"kenya|british.?east.?africa|east.?africa.?prot\",KIR:\"kiribati\",PRK:\"^(?=.*democrat|people|north|d.*p.*.r).*\\\\bkorea|dprk|korea.*(d.*p.*r)\",KWT:\"kuwait\",KGZ:\"kyrgyz|kirghiz\",LAO:\"\\\\blaos?\\\\b\",LVA:\"latvia\",LBN:\"lebanon\",LSO:\"lesotho|basuto\",LBR:\"liberia\",LBY:\"libya\",LIE:\"liechtenstein\",LTU:\"lithuania\",LUX:\"^(?!.*belg).*luxem\",MAC:\"maca(o|u)\",MDG:\"madagascar|malagasy\",MWI:\"malawi|nyasa\",MYS:\"malaysia\",MDV:\"maldive\",MLI:\"\\\\bmali\\\\b\",MLT:\"\\\\bmalta\",MHL:\"marshall\",MTQ:\"martinique\",MRT:\"mauritania\",MUS:\"mauritius\",MYT:\"\\\\bmayotte\",MEX:\"\\\\bmexic\",FSM:\"fed.*micronesia|micronesia.*fed\",MCO:\"monaco\",MNG:\"mongolia\",MNE:\"^(?!.*serbia).*montenegro\",MSR:\"montserrat\",MAR:\"morocco|\\\\bmaroc\",MOZ:\"mozambique\",MMR:\"myanmar|burma\",NAM:\"namibia\",NRU:\"nauru\",NPL:\"nepal\",NLD:\"^(?!.*\\\\bant)(?!.*\\\\bcarib).*netherlands\",ANT:\"^(?=.*\\\\bant).*(nether|dutch)\",NCL:\"new.?caledonia\",NZL:\"new.?zealand\",NIC:\"nicaragua\",NER:\"\\\\bniger(?!ia)\",NGA:\"nigeria\",NIU:\"niue\",NFK:\"norfolk\",MNP:\"mariana\",NOR:\"norway\",OMN:\"\\\\boman|trucial\",PAK:\"^(?!.*east).*paki?stan\",PLW:\"palau\",PSE:\"palestin|\\\\bgaza|west.?bank\",PAN:\"panama\",PNG:\"papua|new.?guinea\",PRY:\"paraguay\",PER:\"peru\",PHL:\"philippines\",PCN:\"pitcairn\",POL:\"poland\",PRT:\"portugal\",PRI:\"puerto.?rico\",QAT:\"qatar\",KOR:\"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\\\bkorea(?!.*d.*p.*r)\",MDA:\"moldov|b(a|e)ssarabia\",REU:\"r(e|\\xe9)union\",ROU:\"r(o|u|ou)mania\",RUS:\"\\\\brussia|soviet.?union|u\\\\.?s\\\\.?s\\\\.?r|socialist.?republics\",RWA:\"rwanda\",BLM:\"barth(e|\\xe9)lemy\",SHN:\"helena\",KNA:\"kitts|\\\\bnevis\",LCA:\"\\\\blucia\",MAF:\"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)\",SPM:\"miquelon\",VCT:\"vincent\",WSM:\"^(?!.*amer).*samoa\",SMR:\"san.?marino\",STP:\"\\\\bs(a|\\xe3)o.?tom(e|\\xe9)\",SAU:\"\\\\bsa\\\\w*.?arabia\",SEN:\"senegal\",SRB:\"^(?!.*monte).*serbia\",SYC:\"seychell\",SLE:\"sierra\",SGP:\"singapore\",SXM:\"^(?!.*martin)(?!.*saba).*maarten\",SVK:\"^(?!.*cze).*slovak\",SVN:\"slovenia\",SLB:\"solomon\",SOM:\"somali\",ZAF:\"south.africa|s\\\\\\\\..?africa\",SGS:\"south.?georgia|sandwich\",SSD:\"\\\\bs\\\\w*.?sudan\",ESP:\"spain\",LKA:\"sri.?lanka|ceylon\",SDN:\"^(?!.*\\\\bs(?!u)).*sudan\",SUR:\"surinam|dutch.?guiana\",SJM:\"svalbard\",SWZ:\"swaziland\",SWE:\"sweden\",CHE:\"switz|swiss\",SYR:\"syria\",TWN:\"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china\",TJK:\"tajik\",THA:\"thailand|\\\\bsiam\",MKD:\"macedonia|fyrom\",TLS:\"^(?=.*leste).*timor|^(?=.*east).*timor\",TGO:\"togo\",TKL:\"tokelau\",TON:\"tonga\",TTO:\"trinidad|tobago\",TUN:\"tunisia\",TUR:\"turkey\",TKM:\"turkmen\",TCA:\"turks\",TUV:\"tuvalu\",UGA:\"uganda\",UKR:\"ukrain\",ARE:\"emirates|^u\\\\.?a\\\\.?e\\\\.?$|united.?arab.?em\",GBR:\"united.?kingdom|britain|^u\\\\.?k\\\\.?$\",TZA:\"tanzania\",USA:\"united.?states\\\\b(?!.*islands)|\\\\bu\\\\.?s\\\\.?a\\\\.?\\\\b|^\\\\s*u\\\\.?s\\\\.?\\\\b(?!.*islands)\",UMI:\"minor.?outlying.?is\",URY:\"uruguay\",UZB:\"uzbek\",VUT:\"vanuatu|new.?hebrides\",VEN:\"venezuela\",VNM:\"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam\",VGB:\"^(?=.*\\\\bu\\\\.?\\\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin\",VIR:\"^(?=.*\\\\bu\\\\.?\\\\s?s).*virgin|^(?=.*states).*virgin\",WLF:\"futuna|wallis\",ESH:\"western.sahara\",YEM:\"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\\\bp\\\\.?d\\\\.?r).*yemen\",YMD:\"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\\\bp\\\\.?d\\\\.?r).*yemen\",YUG:\"yugoslavia\",ZMB:\"zambia|northern.?rhodesia\",EAZ:\"zanzibar\",ZWE:\"zimbabwe|^(?!.*northern).*rhodesia\"}},{}],114:[function(t,e,r){var n={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function i(t){return(t=Math.round(t))<0?0:t>255?255:t}function a(t){return t<0?0:t>1?1:t}function o(t){return\"%\"===t[t.length-1]?i(parseFloat(t)/100*255):i(parseInt(t))}function s(t){return\"%\"===t[t.length-1]?a(parseFloat(t)/100):a(parseFloat(t))}function l(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{r.parseCSSColor=function(t){var e,r=t.replace(/ /g,\"\").toLowerCase();if(r in n)return n[r].slice();if(\"#\"===r[0])return 4===r.length?(e=parseInt(r.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===r.length&&(e=parseInt(r.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var a=r.indexOf(\"(\"),c=r.indexOf(\")\");if(-1!==a&&c+1===r.length){var u=r.substr(0,a),f=r.substr(a+1,c-(a+1)).split(\",\"),h=1;switch(u){case\"rgba\":if(4!==f.length)return null;h=s(f.pop());case\"rgb\":return 3!==f.length?null:[o(f[0]),o(f[1]),o(f[2]),h];case\"hsla\":if(4!==f.length)return null;h=s(f.pop());case\"hsl\":if(3!==f.length)return null;var d=(parseFloat(f[0])%360+360)%360/360,p=s(f[1]),m=s(f[2]),v=m<=.5?m*(p+1):m+p-m*p,g=2*m-v;return[i(255*l(g,v,d+1/3)),i(255*l(g,v,d)),i(255*l(g,v,d-1/3)),h];default:return null}}return null}}catch(t){}},{}],115:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,c=(1+2*i)*l,u=i*l,f=s*(3-2*i),h=s*o;if(t.length){a||(a=new Array(t.length));for(var d=t.length-1;d>=0;--d)a[d]=c*t[d]+u*e[d]+f*r[d]+h*n[d];return a}return c*t+u*e+f*r+h*n},e.exports.derivative=function(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,c=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var u=t.length-1;u>=0;--u)a[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return a}return o*t+s*e+l*r[u]+c*n}},{}],116:[function(t,e,r){\"use strict\";var n=t(\"./lib/thunk.js\");e.exports=function(t){var e=new function(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName=\"\",this.pre=null,this.body=null,this.post=null,this.debug=!1};e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var i=0;i<r.length;++i){var a=r[i];if(\"array\"===a||\"object\"==typeof a&&a.blockIndices){if(e.argTypes[i]=\"array\",e.arrayArgs.push(i),e.arrayBlockIndices.push(a.blockIndices?a.blockIndices:0),e.shimArgs.push(\"array\"+i),i<e.pre.args.length&&e.pre.args[i].count>0)throw new Error(\"cwise: pre() block may not reference array args\");if(i<e.post.args.length&&e.post.args[i].count>0)throw new Error(\"cwise: post() block may not reference array args\")}else if(\"scalar\"===a)e.scalarArgs.push(i),e.shimArgs.push(\"scalar\"+i);else if(\"index\"===a){if(e.indexArgs.push(i),i<e.pre.args.length&&e.pre.args[i].count>0)throw new Error(\"cwise: pre() block may not reference array index\");if(i<e.body.args.length&&e.body.args[i].lvalue)throw new Error(\"cwise: body() block may not write to array index\");if(i<e.post.args.length&&e.post.args[i].count>0)throw new Error(\"cwise: post() block may not reference array index\")}else if(\"shape\"===a){if(e.shapeArgs.push(i),i<e.pre.args.length&&e.pre.args[i].lvalue)throw new Error(\"cwise: pre() block may not write to array shape\");if(i<e.body.args.length&&e.body.args[i].lvalue)throw new Error(\"cwise: body() block may not write to array shape\");if(i<e.post.args.length&&e.post.args[i].lvalue)throw new Error(\"cwise: post() block may not write to array shape\")}else{if(\"object\"!=typeof a||!a.offset)throw new Error(\"cwise: Unknown argument type \"+r[i]);e.argTypes[i]=\"offset\",e.offsetArgs.push({array:a.array,offset:a.offset}),e.offsetArgIndex.push(i)}}if(e.arrayArgs.length<=0)throw new Error(\"cwise: No array arguments specified\");if(e.pre.args.length>r.length)throw new Error(\"cwise: Too many arguments in pre() block\");if(e.body.args.length>r.length)throw new Error(\"cwise: Too many arguments in body() block\");if(e.post.args.length>r.length)throw new Error(\"cwise: Too many arguments in post() block\");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||\"cwise\",e.blockSize=t.blockSize||64,n(e)}},{\"./lib/thunk.js\":118}],117:[function(t,e,r){\"use strict\";var n=t(\"uniq\");function i(t,e,r){var n,i,a=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],c=[],u=0,f=0;for(n=0;n<a;++n)c.push([\"i\",n,\"=0\"].join(\"\"));for(i=0;i<o;++i)for(n=0;n<a;++n)f=u,u=t[n],0===n?c.push([\"d\",i,\"s\",n,\"=t\",i,\"p\",u].join(\"\")):c.push([\"d\",i,\"s\",n,\"=(t\",i,\"p\",u,\"-s\",f,\"*t\",i,\"p\",f,\")\"].join(\"\"));for(c.length>0&&l.push(\"var \"+c.join(\",\")),n=a-1;n>=0;--n)u=t[n],l.push([\"for(i\",n,\"=0;i\",n,\"<s\",u,\";++i\",n,\"){\"].join(\"\"));for(l.push(r),n=0;n<a;++n){for(f=u,u=t[n],i=0;i<o;++i)l.push([\"p\",i,\"+=d\",i,\"s\",n].join(\"\"));s&&(n>0&&l.push([\"index[\",f,\"]-=s\",f].join(\"\")),l.push([\"++index[\",u,\"]\"].join(\"\"))),l.push(\"}\")}return l.join(\"\\n\")}function a(t,e,r){for(var n=t.body,i=[],a=[],o=0;o<t.args.length;++o){var s=t.args[o];if(!(s.count<=0)){var l=new RegExp(s.name,\"g\"),c=\"\",u=e.arrayArgs.indexOf(o);switch(e.argTypes[o]){case\"offset\":var f=e.offsetArgIndex.indexOf(o);u=e.offsetArgs[f].array,c=\"+q\"+f;case\"array\":c=\"p\"+u+c;var h=\"l\"+o,d=\"a\"+u;if(0===e.arrayBlockIndices[u])1===s.count?\"generic\"===r[u]?s.lvalue?(i.push([\"var \",h,\"=\",d,\".get(\",c,\")\"].join(\"\")),n=n.replace(l,h),a.push([d,\".set(\",c,\",\",h,\")\"].join(\"\"))):n=n.replace(l,[d,\".get(\",c,\")\"].join(\"\")):n=n.replace(l,[d,\"[\",c,\"]\"].join(\"\")):\"generic\"===r[u]?(i.push([\"var \",h,\"=\",d,\".get(\",c,\")\"].join(\"\")),n=n.replace(l,h),s.lvalue&&a.push([d,\".set(\",c,\",\",h,\")\"].join(\"\"))):(i.push([\"var \",h,\"=\",d,\"[\",c,\"]\"].join(\"\")),n=n.replace(l,h),s.lvalue&&a.push([d,\"[\",c,\"]=\",h].join(\"\")));else{for(var p=[s.name],m=[c],v=0;v<Math.abs(e.arrayBlockIndices[u]);v++)p.push(\"\\\\s*\\\\[([^\\\\]]+)\\\\]\"),m.push(\"$\"+(v+1)+\"*t\"+u+\"b\"+v);if(l=new RegExp(p.join(\"\"),\"g\"),c=m.join(\"+\"),\"generic\"===r[u])throw new Error(\"cwise: Generic arrays not supported in combination with blocks!\");n=n.replace(l,[d,\"[\",c,\"]\"].join(\"\"))}break;case\"scalar\":n=n.replace(l,\"Y\"+e.scalarArgs.indexOf(o));break;case\"index\":n=n.replace(l,\"index\");break;case\"shape\":n=n.replace(l,\"shape\")}}}return[i.join(\"\\n\"),n,a.join(\"\\n\")].join(\"\\n\").trim()}e.exports=function(t,e){for(var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,o=new Array(t.arrayArgs.length),s=new Array(t.arrayArgs.length),l=0;l<t.arrayArgs.length;++l)s[l]=e[2*l],o[l]=e[2*l+1];var c=[],u=[],f=[],h=[],d=[];for(l=0;l<t.arrayArgs.length;++l){t.arrayBlockIndices[l]<0?(f.push(0),h.push(r),c.push(r),u.push(r+t.arrayBlockIndices[l])):(f.push(t.arrayBlockIndices[l]),h.push(t.arrayBlockIndices[l]+r),c.push(0),u.push(t.arrayBlockIndices[l]));for(var p=[],m=0;m<o[l].length;m++)f[l]<=o[l][m]&&o[l][m]<h[l]&&p.push(o[l][m]-f[l]);d.push(p)}var v=[\"SS\"],g=[\"'use strict'\"],y=[];for(m=0;m<r;++m)y.push([\"s\",m,\"=SS[\",m,\"]\"].join(\"\"));for(l=0;l<t.arrayArgs.length;++l){for(v.push(\"a\"+l),v.push(\"t\"+l),v.push(\"p\"+l),m=0;m<r;++m)y.push([\"t\",l,\"p\",m,\"=t\",l,\"[\",f[l]+m,\"]\"].join(\"\"));for(m=0;m<Math.abs(t.arrayBlockIndices[l]);++m)y.push([\"t\",l,\"b\",m,\"=t\",l,\"[\",c[l]+m,\"]\"].join(\"\"))}for(l=0;l<t.scalarArgs.length;++l)v.push(\"Y\"+l);if(t.shapeArgs.length>0&&y.push(\"shape=SS.slice(0)\"),t.indexArgs.length>0){var b=new Array(r);for(l=0;l<r;++l)b[l]=\"0\";y.push([\"index=[\",b.join(\",\"),\"]\"].join(\"\"))}for(l=0;l<t.offsetArgs.length;++l){var x=t.offsetArgs[l],_=[];for(m=0;m<x.offset.length;++m)0!==x.offset[m]&&(1===x.offset[m]?_.push([\"t\",x.array,\"p\",m].join(\"\")):_.push([x.offset[m],\"*t\",x.array,\"p\",m].join(\"\")));0===_.length?y.push(\"q\"+l+\"=0\"):y.push([\"q\",l,\"=\",_.join(\"+\")].join(\"\"))}var w=n([].concat(t.pre.thisVars).concat(t.body.thisVars).concat(t.post.thisVars));for((y=y.concat(w)).length>0&&g.push(\"var \"+y.join(\",\")),l=0;l<t.arrayArgs.length;++l)g.push(\"p\"+l+\"|=0\");t.pre.body.length>3&&g.push(a(t.pre,t,s));var M=a(t.body,t,s),k=function(t){for(var e=0,r=t[0].length;e<r;){for(var n=1;n<t.length;++n)if(t[n][e]!==t[0][e])return e;++e}return e}(d);k<r?g.push(function(t,e,r,n){for(var a=e.length,o=r.arrayArgs.length,s=r.blockSize,l=r.indexArgs.length>0,c=[],u=0;u<o;++u)c.push([\"var offset\",u,\"=p\",u].join(\"\"));for(u=t;u<a;++u)c.push([\"for(var j\"+u+\"=SS[\",e[u],\"]|0;j\",u,\">0;){\"].join(\"\")),c.push([\"if(j\",u,\"<\",s,\"){\"].join(\"\")),c.push([\"s\",e[u],\"=j\",u].join(\"\")),c.push([\"j\",u,\"=0\"].join(\"\")),c.push([\"}else{s\",e[u],\"=\",s].join(\"\")),c.push([\"j\",u,\"-=\",s,\"}\"].join(\"\")),l&&c.push([\"index[\",e[u],\"]=j\",u].join(\"\"));for(u=0;u<o;++u){for(var f=[\"offset\"+u],h=t;h<a;++h)f.push([\"j\",h,\"*t\",u,\"p\",e[h]].join(\"\"));c.push([\"p\",u,\"=(\",f.join(\"+\"),\")\"].join(\"\"))}for(c.push(i(e,r,n)),u=t;u<a;++u)c.push(\"}\");return c.join(\"\\n\")}(k,d[0],t,M)):g.push(i(d[0],t,M)),t.post.body.length>3&&g.push(a(t.post,t,s)),t.debug&&console.log(\"-----Generated cwise routine for \",e,\":\\n\"+g.join(\"\\n\")+\"\\n----------\");var A=[t.funcName||\"unnamed\",\"_cwise_loop_\",o[0].join(\"s\"),\"m\",k,function(t){for(var e=new Array(t.length),r=!0,n=0;n<t.length;++n){var i=t[n],a=i.match(/\\d+/);a=a?a[0]:\"\",0===i.charAt(0)?e[n]=\"u\"+i.charAt(1)+a:e[n]=i.charAt(0)+a,n>0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join(\"\")}(s)].join(\"\");return new Function([\"function \",A,\"(\",v.join(\",\"),\"){\",g.join(\"\\n\"),\"} return \",A].join(\"\"))()}},{uniq:536}],118:[function(t,e,r){\"use strict\";var n=t(\"./compile.js\");e.exports=function(t){var e=[\"'use strict'\",\"var CACHED={}\"],r=[],i=t.funcName+\"_cwise_thunk\";e.push([\"return function \",i,\"(\",t.shimArgs.join(\",\"),\"){\"].join(\"\"));for(var a=[],o=[],s=[[\"array\",t.arrayArgs[0],\".shape.slice(\",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?\",\"+t.arrayBlockIndices[0]+\")\":\")\"].join(\"\")],l=[],c=[],u=0;u<t.arrayArgs.length;++u){var f=t.arrayArgs[u];r.push([\"t\",f,\"=array\",f,\".dtype,\",\"r\",f,\"=array\",f,\".order\"].join(\"\")),a.push(\"t\"+f),a.push(\"r\"+f),o.push(\"t\"+f),o.push(\"r\"+f+\".join()\"),s.push(\"array\"+f+\".data\"),s.push(\"array\"+f+\".stride\"),s.push(\"array\"+f+\".offset|0\"),u>0&&(l.push(\"array\"+t.arrayArgs[0]+\".shape.length===array\"+f+\".shape.length+\"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[u]))),c.push(\"array\"+t.arrayArgs[0]+\".shape[shapeIndex+\"+Math.max(0,t.arrayBlockIndices[0])+\"]===array\"+f+\".shape[shapeIndex+\"+Math.max(0,t.arrayBlockIndices[u])+\"]\"))}for(t.arrayArgs.length>1&&(e.push(\"if (!(\"+l.join(\" && \")+\")) throw new Error('cwise: Arrays do not all have the same dimensionality!')\"),e.push(\"for(var shapeIndex=array\"+t.arrayArgs[0]+\".shape.length-\"+Math.abs(t.arrayBlockIndices[0])+\"; shapeIndex--\\x3e0;) {\"),e.push(\"if (!(\"+c.join(\" && \")+\")) throw new Error('cwise: Arrays do not all have the same shape!')\"),e.push(\"}\")),u=0;u<t.scalarArgs.length;++u)s.push(\"scalar\"+t.scalarArgs[u]);return r.push([\"type=[\",o.join(\",\"),\"].join()\"].join(\"\")),r.push(\"proc=CACHED[type]\"),e.push(\"var \"+r.join(\",\")),e.push([\"if(!proc){\",\"CACHED[type]=proc=compile([\",a.join(\",\"),\"])}\",\"return proc(\",s.join(\",\"),\")}\"].join(\"\")),t.debug&&console.log(\"-----Generated thunk:\\n\"+e.join(\"\\n\")+\"\\n----------\"),new Function(\"compile\",e.join(\"\\n\"))(n.bind(void 0,t))}},{\"./compile.js\":117}],119:[function(t,e,r){e.exports=t(\"cwise-compiler\")},{\"cwise-compiler\":116}],120:[function(t,e,r){var n;n=this,function(t){\"use strict\";var e=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN},r=function(t){var r;return 1===t.length&&(r=t,t=function(t,n){return e(r(t),n)}),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)>0?i=a:n=a+1}return n}}};var n=r(e),i=n.right,a=n.left;function o(t,e){return[t,e]}var s=function(t){return null===t?NaN:+t},l=function(t,e){var r,n,i=t.length,a=0,o=-1,l=0,c=0;if(null==e)for(;++o<i;)isNaN(r=s(t[o]))||(c+=(n=r-l)*(r-(l+=n/++a)));else for(;++o<i;)isNaN(r=s(e(t[o],o,t)))||(c+=(n=r-l)*(r-(l+=n/++a)));if(a>1)return c/(a-1)},c=function(t,e){var r=l(t,e);return r?Math.sqrt(r):r},u=function(t,e){var r,n,i,a=t.length,o=-1;if(null==e){for(;++o<a;)if(null!=(r=t[o])&&r>=r)for(n=i=r;++o<a;)null!=(r=t[o])&&(n>r&&(n=r),i<r&&(i=r))}else for(;++o<a;)if(null!=(r=e(t[o],o,t))&&r>=r)for(n=i=r;++o<a;)null!=(r=e(t[o],o,t))&&(n>r&&(n=r),i<r&&(i=r));return[n,i]},f=Array.prototype,h=f.slice,d=f.map,p=function(t){return function(){return t}},m=function(t){return t},v=function(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=0|Math.max(0,Math.ceil((e-t)/r)),a=new Array(i);++n<i;)a[n]=t+n*r;return a},g=Math.sqrt(50),y=Math.sqrt(10),b=Math.sqrt(2);function x(t,e,r){var n=(e-t)/Math.max(0,r),i=Math.floor(Math.log(n)/Math.LN10),a=n/Math.pow(10,i);return i>=0?(a>=g?10:a>=y?5:a>=b?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=g?10:a>=y?5:a>=b?2:1)}function _(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=g?i*=10:a>=y?i*=5:a>=b&&(i*=2),e<t?-i:i}var w=function(t){return Math.ceil(Math.log(t.length)/Math.LN2)+1},M=function(t,e,r){if(null==r&&(r=s),n=t.length){if((e=+e)<=0||n<2)return+r(t[0],0,t);if(e>=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t);return o+(+r(t[a+1],a+1,t)-o)*(i-a)}},k=function(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a<i;)if(null!=(r=t[a])&&r>=r)for(n=r;++a<i;)null!=(r=t[a])&&n>r&&(n=r)}else for(;++a<i;)if(null!=(r=e(t[a],a,t))&&r>=r)for(n=r;++a<i;)null!=(r=e(t[a],a,t))&&n>r&&(n=r);return n},A=function(t){if(!(i=t.length))return[];for(var e=-1,r=k(t,T),n=new Array(r);++e<r;)for(var i,a=-1,o=n[e]=new Array(i);++a<i;)o[a]=t[a][e];return n};function T(t){return t.length}t.bisect=i,t.bisectRight=i,t.bisectLeft=a,t.ascending=e,t.bisector=r,t.cross=function(t,e,r){var n,i,a,s,l=t.length,c=e.length,u=new Array(l*c);for(null==r&&(r=o),n=a=0;n<l;++n)for(s=t[n],i=0;i<c;++i,++a)u[a]=r(s,e[i]);return u},t.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},t.deviation=c,t.extent=u,t.histogram=function(){var t=m,e=u,r=w;function n(n){var a,o,s=n.length,l=new Array(s);for(a=0;a<s;++a)l[a]=t(n[a],a,n);var c=e(l),u=c[0],f=c[1],h=r(l,u,f);Array.isArray(h)||(h=_(u,f,h),h=v(Math.ceil(u/h)*h,Math.floor(f/h)*h,h));for(var d=h.length;h[0]<=u;)h.shift(),--d;for(;h[d-1]>f;)h.pop(),--d;var p,m=new Array(d+1);for(a=0;a<=d;++a)(p=m[a]=[]).x0=a>0?h[a-1]:u,p.x1=a<d?h[a]:f;for(a=0;a<s;++a)u<=(o=l[a])&&o<=f&&m[i(h,o,0,d)].push(n[a]);return m}return n.value=function(e){return arguments.length?(t=\"function\"==typeof e?e:p(e),n):t},n.domain=function(t){return arguments.length?(e=\"function\"==typeof t?t:p([t[0],t[1]]),n):e},n.thresholds=function(t){return arguments.length?(r=\"function\"==typeof t?t:Array.isArray(t)?p(h.call(t)):p(t),n):r},n},t.thresholdFreedmanDiaconis=function(t,r,n){return t=d.call(t,s).sort(e),Math.ceil((n-r)/(2*(M(t,.75)-M(t,.25))*Math.pow(t.length,-1/3)))},t.thresholdScott=function(t,e,r){return Math.ceil((r-e)/(3.5*c(t)*Math.pow(t.length,-1/3)))},t.thresholdSturges=w,t.max=function(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a<i;)if(null!=(r=t[a])&&r>=r)for(n=r;++a<i;)null!=(r=t[a])&&r>n&&(n=r)}else for(;++a<i;)if(null!=(r=e(t[a],a,t))&&r>=r)for(n=r;++a<i;)null!=(r=e(t[a],a,t))&&r>n&&(n=r);return n},t.mean=function(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a<n;)isNaN(r=s(t[a]))?--i:o+=r;else for(;++a<n;)isNaN(r=s(e(t[a],a,t)))?--i:o+=r;if(i)return o/i},t.median=function(t,r){var n,i=t.length,a=-1,o=[];if(null==r)for(;++a<i;)isNaN(n=s(t[a]))||o.push(n);else for(;++a<i;)isNaN(n=s(r(t[a],a,t)))||o.push(n);return M(o.sort(e),.5)},t.merge=function(t){for(var e,r,n,i=t.length,a=-1,o=0;++a<i;)o+=t[a].length;for(r=new Array(o);--i>=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r},t.min=k,t.pairs=function(t,e){null==e&&(e=o);for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r<n;)a[r]=e(i,i=t[++r]);return a},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.quantile=M,t.range=v,t.scan=function(t,r){if(n=t.length){var n,i,a=0,o=0,s=t[o];for(null==r&&(r=e);++a<n;)(r(i=t[a],s)<0||0!==r(s,s))&&(s=i,o=a);return 0===r(s,s)?o:void 0}},t.shuffle=function(t,e,r){for(var n,i,a=(null==r?t.length:r)-(e=null==e?0:+e);a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},t.sum=function(t,e){var r,n=t.length,i=-1,a=0;if(null==e)for(;++i<n;)(r=+t[i])&&(a+=r);else for(;++i<n;)(r=+e(t[i],i,t))&&(a+=r);return a},t.ticks=function(t,e,r){var n,i,a,o,s=-1;if(r=+r,(t=+t)==(e=+e)&&r>0)return[t];if((n=e<t)&&(i=t,t=e,e=i),0===(o=x(t,e,r))||!isFinite(o))return[];if(o>0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++s<i;)a[s]=(t+s)*o;else for(t=Math.floor(t*o),e=Math.ceil(e*o),a=new Array(i=Math.ceil(t-e+1));++s<i;)a[s]=(t-s)/o;return n&&a.reverse(),a},t.tickIncrement=x,t.tickStep=_,t.transpose=A,t.variance=l,t.zip=function(){return A(arguments)},Object.defineProperty(t,\"__esModule\",{value:!0})}(\"object\"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],121:[function(t,e,r){var n;n=this,function(t){\"use strict\";function e(){}function r(t,r){var n=new e;if(t instanceof e)t.each(function(t,e){n.set(e,t)});else if(Array.isArray(t)){var i,a=-1,o=t.length;if(null==r)for(;++a<o;)n.set(a,t[a]);else for(;++a<o;)n.set(r(i=t[a],a,t),i)}else if(t)for(var s in t)n.set(s,t[s]);return n}e.prototype=r.prototype={constructor:e,has:function(t){return\"$\"+t in this},get:function(t){return this[\"$\"+t]},set:function(t,e){return this[\"$\"+t]=e,this},remove:function(t){var e=\"$\"+t;return e in this&&delete this[e]},clear:function(){for(var t in this)\"$\"===t[0]&&delete this[t]},keys:function(){var t=[];for(var e in this)\"$\"===e[0]&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)\"$\"===e[0]&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)\"$\"===e[0]&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)\"$\"===e[0]&&++t;return t},empty:function(){for(var t in this)if(\"$\"===t[0])return!1;return!0},each:function(t){for(var e in this)\"$\"===e[0]&&t(this[e],e.slice(1),this)}};function n(){return{}}function i(t,e,r){t[e]=r}function a(){return r()}function o(t,e,r){t.set(e,r)}function s(){}var l=r.prototype;function c(t,e){var r=new s;if(t instanceof s)t.each(function(t){r.add(t)});else if(t){var n=-1,i=t.length;if(null==e)for(;++n<i;)r.add(t[n]);else for(;++n<i;)r.add(e(t[n],n,t))}return r}s.prototype=c.prototype={constructor:s,has:l.has,add:function(t){return this[\"$\"+(t+=\"\")]=t,this},remove:l.remove,clear:l.clear,values:l.keys,size:l.size,empty:l.empty,each:l.each};t.nest=function(){var t,e,s,l=[],c=[];function u(n,i,a,o){if(i>=l.length)return null!=t&&n.sort(t),null!=e?e(n):n;for(var s,c,f,h=-1,d=n.length,p=l[i++],m=r(),v=a();++h<d;)(f=m.get(s=p(c=n[h])+\"\"))?f.push(c):m.set(s,[c]);return m.each(function(t,e){o(v,e,u(t,i,a,o))}),v}return s={object:function(t){return u(t,0,n,i)},map:function(t){return u(t,0,a,o)},entries:function(t){return function t(r,n){if(++n>l.length)return r;var i,a=c[n-1];return null!=e&&n>=l.length?i=r.entries():(i=[],r.each(function(e,r){i.push({key:r,values:t(e,n)})})),null!=a?i.sort(function(t,e){return a(t.key,e.key)}):i}(u(t,0,a,o),0)},key:function(t){return l.push(t),s},sortKeys:function(t){return c[l.length-1]=t,s},sortValues:function(e){return t=e,s},rollup:function(t){return e=t,s}}},t.set=c,t.map=r,t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},Object.defineProperty(t,\"__esModule\",{value:!0})}(\"object\"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],122:[function(t,e,r){var n;n=this,function(t){\"use strict\";var e=function(t,e,r){t.prototype=e.prototype=r,r.constructor=t};function r(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function n(){}var i=\"\\\\s*([+-]?\\\\d+)\\\\s*\",a=\"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",o=\"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",s=/^#([0-9a-f]{3})$/,l=/^#([0-9a-f]{6})$/,c=new RegExp(\"^rgb\\\\(\"+[i,i,i]+\"\\\\)$\"),u=new RegExp(\"^rgb\\\\(\"+[o,o,o]+\"\\\\)$\"),f=new RegExp(\"^rgba\\\\(\"+[i,i,i,a]+\"\\\\)$\"),h=new RegExp(\"^rgba\\\\(\"+[o,o,o,a]+\"\\\\)$\"),d=new RegExp(\"^hsl\\\\(\"+[a,o,o]+\"\\\\)$\"),p=new RegExp(\"^hsla\\\\(\"+[a,o,o,a]+\"\\\\)$\"),m={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function v(t){var e;return t=(t+\"\").trim().toLowerCase(),(e=s.exec(t))?new _((e=parseInt(e[1],16))>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=l.exec(t))?g(parseInt(e[1],16)):(e=c.exec(t))?new _(e[1],e[2],e[3],1):(e=u.exec(t))?new _(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=f.exec(t))?y(e[1],e[2],e[3],e[4]):(e=h.exec(t))?y(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=d.exec(t))?w(e[1],e[2]/100,e[3]/100,1):(e=p.exec(t))?w(e[1],e[2]/100,e[3]/100,e[4]):m.hasOwnProperty(t)?g(m[t]):\"transparent\"===t?new _(NaN,NaN,NaN,0):null}function g(t){return new _(t>>16&255,t>>8&255,255&t,1)}function y(t,e,r,n){return n<=0&&(t=e=r=NaN),new _(t,e,r,n)}function b(t){return t instanceof n||(t=v(t)),t?new _((t=t.rgb()).r,t.g,t.b,t.opacity):new _}function x(t,e,r,n){return 1===arguments.length?b(t):new _(t,e,r,null==n?1:n)}function _(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function w(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new k(t,e,r,n)}function M(t,e,r,i){return 1===arguments.length?function(t){if(t instanceof k)return new k(t.h,t.s,t.l,t.opacity);if(t instanceof n||(t=v(t)),!t)return new k;if(t instanceof k)return t;var e=(t=t.rgb()).r/255,r=t.g/255,i=t.b/255,a=Math.min(e,r,i),o=Math.max(e,r,i),s=NaN,l=o-a,c=(o+a)/2;return l?(s=e===o?(r-i)/l+6*(r<i):r===o?(i-e)/l+2:(e-r)/l+4,l/=c<.5?o+a:2-o-a,s*=60):l=c>0&&c<1?0:s,new k(s,l,c,t.opacity)}(t):new k(t,e,r,null==i?1:i)}function k(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function A(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}e(n,v,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+\"\"}}),e(_,x,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new _(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new _(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?\"rgb(\":\"rgba(\")+Math.max(0,Math.min(255,Math.round(this.r)||0))+\", \"+Math.max(0,Math.min(255,Math.round(this.g)||0))+\", \"+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?\")\":\", \"+t+\")\")}})),e(k,M,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new k(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new k(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new _(A(t>=240?t-240:t+120,i,n),A(t,i,n),A(t<120?t+240:t-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var T=Math.PI/180,E=180/Math.PI,S=.95047,L=1,C=1.08883,P=4/29,z=6/29,O=3*z*z,D=z*z*z;function I(t){if(t instanceof N)return new N(t.l,t.a,t.b,t.opacity);if(t instanceof q){var e=t.h*T;return new N(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof _||(t=b(t));var r=U(t.r),n=U(t.g),i=U(t.b),a=F((.4124564*r+.3575761*n+.1804375*i)/S),o=F((.2126729*r+.7151522*n+.072175*i)/L);return new N(116*o-16,500*(a-o),200*(o-F((.0193339*r+.119192*n+.9503041*i)/C)),t.opacity)}function R(t,e,r,n){return 1===arguments.length?I(t):new N(t,e,r,null==n?1:n)}function N(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function F(t){return t>D?Math.pow(t,1/3):t/O+P}function j(t){return t>z?t*t*t:O*(t-P)}function B(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function U(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function V(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof q)return new q(t.h,t.c,t.l,t.opacity);t instanceof N||(t=I(t));var e=Math.atan2(t.b,t.a)*E;return new q(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new q(t,e,r,null==n?1:n)}function q(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}e(N,R,r(n,{brighter:function(t){return new N(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new N(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return t=L*j(t),new _(B(3.2404542*(e=S*j(e))-1.5371385*t-.4985314*(r=C*j(r))),B(-.969266*e+1.8760108*t+.041556*r),B(.0556434*e-.2040259*t+1.0572252*r),this.opacity)}})),e(q,V,r(n,{brighter:function(t){return new q(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new q(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return I(this).rgb()}}));var H=-.14861,G=1.78277,Y=-.29227,W=-.90649,X=1.97294,Z=X*W,J=X*G,K=G*Y-W*H;function Q(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof $)return new $(t.h,t.s,t.l,t.opacity);t instanceof _||(t=b(t));var e=t.r/255,r=t.g/255,n=t.b/255,i=(K*n+Z*e-J*r)/(K+Z-J),a=n-i,o=(X*(r-i)-Y*a)/W,s=Math.sqrt(o*o+a*a)/(X*i*(1-i)),l=s?Math.atan2(o,a)*E-120:NaN;return new $(l<0?l+360:l,s,i,t.opacity)}(t):new $(t,e,r,null==n?1:n)}function $(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}e($,Q,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new $(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new $(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*T,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),i=Math.sin(t);return new _(255*(e+r*(H*n+G*i)),255*(e+r*(Y*n+W*i)),255*(e+r*(X*n)),this.opacity)}})),t.color=v,t.rgb=x,t.hsl=M,t.lab=R,t.hcl=V,t.cubehelix=Q,Object.defineProperty(t,\"__esModule\",{value:!0})}(\"object\"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],123:[function(t,e,r){var n;n=this,function(t){\"use strict\";var e={value:function(){}};function r(){for(var t,e=0,r=arguments.length,i={};e<r;++e){if(!(t=arguments[e]+\"\")||t in i)throw new Error(\"illegal type: \"+t);i[t]=[]}return new n(i)}function n(t){this._=t}function i(t,e){for(var r,n=0,i=t.length;n<i;++n)if((r=t[n]).name===e)return r.value}function a(t,r,n){for(var i=0,a=t.length;i<a;++i)if(t[i].name===r){t[i]=e,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:r,value:n}),t}n.prototype=r.prototype={constructor:n,on:function(t,e){var r,n,o=this._,s=(n=o,(t+\"\").trim().split(/^|\\s+/).map(function(t){var e=\"\",r=t.indexOf(\".\");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error(\"unknown type: \"+t);return{type:t,name:e}})),l=-1,c=s.length;if(!(arguments.length<2)){if(null!=e&&\"function\"!=typeof e)throw new Error(\"invalid callback: \"+e);for(;++l<c;)if(r=(t=s[l]).type)o[r]=a(o[r],t.name,e);else if(null==e)for(r in o)o[r]=a(o[r],t.name,null);return this}for(;++l<c;)if((r=(t=s[l]).type)&&(r=i(o[r],t.name)))return r},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new n(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var r,n,i=new Array(r),a=0;a<r;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error(\"unknown type: \"+t);for(a=0,r=(n=this._[t]).length;a<r;++a)n[a].value.apply(e,i)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error(\"unknown type: \"+t);for(var n=this._[t],i=0,a=n.length;i<a;++i)n[i].value.apply(e,r)}},t.dispatch=r,Object.defineProperty(t,\"__esModule\",{value:!0})}(\"object\"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],124:[function(t,e,r){var n,i;n=this,i=function(t,e,r,n,i){\"use strict\";var a=function(t){return function(){return t}},o=function(){return 1e-6*(Math.random()-.5)};function s(t){return t.x+t.vx}function l(t){return t.y+t.vy}function c(t){return t.index}function u(t,e){var r=t.get(e);if(!r)throw new Error(\"missing: \"+e);return r}function f(t){return t.x}function h(t){return t.y}var d=10,p=Math.PI*(3-Math.sqrt(5));t.forceCenter=function(t,e){var r;function n(){var n,i,a=r.length,o=0,s=0;for(n=0;n<a;++n)o+=(i=r[n]).x,s+=i.y;for(o=o/a-t,s=s/a-e,n=0;n<a;++n)(i=r[n]).x-=o,i.y-=s}return null==t&&(t=0),null==e&&(e=0),n.initialize=function(t){r=t},n.x=function(e){return arguments.length?(t=+e,n):t},n.y=function(t){return arguments.length?(e=+t,n):e},n},t.forceCollide=function(t){var r,n,i=1,c=1;function u(){for(var t,a,u,h,d,p,m,v=r.length,g=0;g<c;++g)for(a=e.quadtree(r,s,l).visitAfter(f),t=0;t<v;++t)u=r[t],p=n[u.index],m=p*p,h=u.x+u.vx,d=u.y+u.vy,a.visit(y);function y(t,e,r,n,a){var s=t.data,l=t.r,c=p+l;if(!s)return e>h+c||n<h-c||r>d+c||a<d-c;if(s.index>u.index){var f=h-s.x-s.vx,v=d-s.y-s.vy,g=f*f+v*v;g<c*c&&(0===f&&(g+=(f=o())*f),0===v&&(g+=(v=o())*v),g=(c-(g=Math.sqrt(g)))/g*i,u.vx+=(f*=g)*(c=(l*=l)/(m+l)),u.vy+=(v*=g)*c,s.vx-=f*(c=1-c),s.vy-=v*c)}}}function f(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function h(){if(r){var e,i,a=r.length;for(n=new Array(a),e=0;e<a;++e)i=r[e],n[i.index]=+t(i,e,r)}}return\"function\"!=typeof t&&(t=a(null==t?1:+t)),u.initialize=function(t){r=t,h()},u.iterations=function(t){return arguments.length?(c=+t,u):c},u.strength=function(t){return arguments.length?(i=+t,u):i},u.radius=function(e){return arguments.length?(t=\"function\"==typeof e?e:a(+e),h(),u):t},u},t.forceLink=function(t){var e,n,i,s,l,f=c,h=function(t){return 1/Math.min(s[t.source.index],s[t.target.index])},d=a(30),p=1;function m(r){for(var i=0,a=t.length;i<p;++i)for(var s,c,u,f,h,d,m,v=0;v<a;++v)c=(s=t[v]).source,f=(u=s.target).x+u.vx-c.x-c.vx||o(),h=u.y+u.vy-c.y-c.vy||o(),f*=d=((d=Math.sqrt(f*f+h*h))-n[v])/d*r*e[v],h*=d,u.vx-=f*(m=l[v]),u.vy-=h*m,c.vx+=f*(m=1-m),c.vy+=h*m}function v(){if(i){var a,o,c=i.length,h=t.length,d=r.map(i,f);for(a=0,s=new Array(c);a<h;++a)(o=t[a]).index=a,\"object\"!=typeof o.source&&(o.source=u(d,o.source)),\"object\"!=typeof o.target&&(o.target=u(d,o.target)),s[o.source.index]=(s[o.source.index]||0)+1,s[o.target.index]=(s[o.target.index]||0)+1;for(a=0,l=new Array(h);a<h;++a)o=t[a],l[a]=s[o.source.index]/(s[o.source.index]+s[o.target.index]);e=new Array(h),g(),n=new Array(h),y()}}function g(){if(i)for(var r=0,n=t.length;r<n;++r)e[r]=+h(t[r],r,t)}function y(){if(i)for(var e=0,r=t.length;e<r;++e)n[e]=+d(t[e],e,t)}return null==t&&(t=[]),m.initialize=function(t){i=t,v()},m.links=function(e){return arguments.length?(t=e,v(),m):t},m.id=function(t){return arguments.length?(f=t,m):f},m.iterations=function(t){return arguments.length?(p=+t,m):p},m.strength=function(t){return arguments.length?(h=\"function\"==typeof t?t:a(+t),g(),m):h},m.distance=function(t){return arguments.length?(d=\"function\"==typeof t?t:a(+t),y(),m):d},m},t.forceManyBody=function(){var t,r,n,i,s=a(-30),l=1,c=1/0,u=.81;function d(i){var a,o=t.length,s=e.quadtree(t,f,h).visitAfter(m);for(n=i,a=0;a<o;++a)r=t[a],s.visit(v)}function p(){if(t){var e,r,n=t.length;for(i=new Array(n),e=0;e<n;++e)r=t[e],i[r.index]=+s(r,e,t)}}function m(t){var e,r,n,a,o,s=0,l=0;if(t.length){for(n=a=o=0;o<4;++o)(e=t[o])&&(r=Math.abs(e.value))&&(s+=e.value,l+=r,n+=r*e.x,a+=r*e.y);t.x=n/l,t.y=a/l}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=i[e.data.index]}while(e=e.next)}t.value=s}function v(t,e,a,s){if(!t.value)return!0;var f=t.x-r.x,h=t.y-r.y,d=s-e,p=f*f+h*h;if(d*d/u<p)return p<c&&(0===f&&(p+=(f=o())*f),0===h&&(p+=(h=o())*h),p<l&&(p=Math.sqrt(l*p)),r.vx+=f*t.value*n/p,r.vy+=h*t.value*n/p),!0;if(!(t.length||p>=c)){(t.data!==r||t.next)&&(0===f&&(p+=(f=o())*f),0===h&&(p+=(h=o())*h),p<l&&(p=Math.sqrt(l*p)));do{t.data!==r&&(d=i[t.data.index]*n/p,r.vx+=f*d,r.vy+=h*d)}while(t=t.next)}}return d.initialize=function(e){t=e,p()},d.strength=function(t){return arguments.length?(s=\"function\"==typeof t?t:a(+t),p(),d):s},d.distanceMin=function(t){return arguments.length?(l=t*t,d):Math.sqrt(l)},d.distanceMax=function(t){return arguments.length?(c=t*t,d):Math.sqrt(c)},d.theta=function(t){return arguments.length?(u=t*t,d):Math.sqrt(u)},d},t.forceRadial=function(t,e,r){var n,i,o,s=a(.1);function l(t){for(var a=0,s=n.length;a<s;++a){var l=n[a],c=l.x-e||1e-6,u=l.y-r||1e-6,f=Math.sqrt(c*c+u*u),h=(o[a]-f)*i[a]*t/f;l.vx+=c*h,l.vy+=u*h}}function c(){if(n){var e,r=n.length;for(i=new Array(r),o=new Array(r),e=0;e<r;++e)o[e]=+t(n[e],e,n),i[e]=isNaN(o[e])?0:+s(n[e],e,n)}}return\"function\"!=typeof t&&(t=a(+t)),null==e&&(e=0),null==r&&(r=0),l.initialize=function(t){n=t,c()},l.strength=function(t){return arguments.length?(s=\"function\"==typeof t?t:a(+t),c(),l):s},l.radius=function(e){return arguments.length?(t=\"function\"==typeof e?e:a(+e),c(),l):t},l.x=function(t){return arguments.length?(e=+t,l):e},l.y=function(t){return arguments.length?(r=+t,l):r},l},t.forceSimulation=function(t){var e,a=1,o=.001,s=1-Math.pow(o,1/300),l=0,c=.6,u=r.map(),f=i.timer(m),h=n.dispatch(\"tick\",\"end\");function m(){v(),h.call(\"tick\",e),a<o&&(f.stop(),h.call(\"end\",e))}function v(){var e,r,n=t.length;for(a+=(l-a)*s,u.each(function(t){t(a)}),e=0;e<n;++e)null==(r=t[e]).fx?r.x+=r.vx*=c:(r.x=r.fx,r.vx=0),null==r.fy?r.y+=r.vy*=c:(r.y=r.fy,r.vy=0)}function g(){for(var e,r=0,n=t.length;r<n;++r){if((e=t[r]).index=r,isNaN(e.x)||isNaN(e.y)){var i=d*Math.sqrt(r),a=r*p;e.x=i*Math.cos(a),e.y=i*Math.sin(a)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function y(e){return e.initialize&&e.initialize(t),e}return null==t&&(t=[]),g(),e={tick:v,restart:function(){return f.restart(m),e},stop:function(){return f.stop(),e},nodes:function(r){return arguments.length?(t=r,g(),u.each(y),e):t},alpha:function(t){return arguments.length?(a=+t,e):a},alphaMin:function(t){return arguments.length?(o=+t,e):o},alphaDecay:function(t){return arguments.length?(s=+t,e):+s},alphaTarget:function(t){return arguments.length?(l=+t,e):l},velocityDecay:function(t){return arguments.length?(c=1-t,e):1-c},force:function(t,r){return arguments.length>1?(null==r?u.remove(t):u.set(t,y(r)),e):u.get(t)},find:function(e,r,n){var i,a,o,s,l,c=0,u=t.length;for(null==n?n=1/0:n*=n,c=0;c<u;++c)(o=(i=e-(s=t[c]).x)*i+(a=r-s.y)*a)<n&&(l=s,n=o);return l},on:function(t,r){return arguments.length>1?(h.on(t,r),e):h.on(t)}}},t.forceX=function(t){var e,r,n,i=a(.1);function o(t){for(var i,a=0,o=e.length;a<o;++a)(i=e[a]).vx+=(n[a]-i.x)*r[a]*t}function s(){if(e){var a,o=e.length;for(r=new Array(o),n=new Array(o),a=0;a<o;++a)r[a]=isNaN(n[a]=+t(e[a],a,e))?0:+i(e[a],a,e)}}return\"function\"!=typeof t&&(t=a(null==t?0:+t)),o.initialize=function(t){e=t,s()},o.strength=function(t){return arguments.length?(i=\"function\"==typeof t?t:a(+t),s(),o):i},o.x=function(e){return arguments.length?(t=\"function\"==typeof e?e:a(+e),s(),o):t},o},t.forceY=function(t){var e,r,n,i=a(.1);function o(t){for(var i,a=0,o=e.length;a<o;++a)(i=e[a]).vy+=(n[a]-i.y)*r[a]*t}function s(){if(e){var a,o=e.length;for(r=new Array(o),n=new Array(o),a=0;a<o;++a)r[a]=isNaN(n[a]=+t(e[a],a,e))?0:+i(e[a],a,e)}}return\"function\"!=typeof t&&(t=a(null==t?0:+t)),o.initialize=function(t){e=t,s()},o.strength=function(t){return arguments.length?(i=\"function\"==typeof t?t:a(+t),s(),o):i},o.y=function(e){return arguments.length?(t=\"function\"==typeof e?e:a(+e),s(),o):t},o},Object.defineProperty(t,\"__esModule\",{value:!0})},\"object\"==typeof r&&void 0!==e?i(r,t(\"d3-quadtree\"),t(\"d3-collection\"),t(\"d3-dispatch\"),t(\"d3-timer\")):i(n.d3=n.d3||{},n.d3,n.d3,n.d3,n.d3)},{\"d3-collection\":121,\"d3-dispatch\":123,\"d3-quadtree\":126,\"d3-timer\":127}],125:[function(t,e,r){var n,i;n=this,i=function(t,e){\"use strict\";function r(t,e,r,n,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*r+(1+3*t+3*a-3*o)*n+o*i)/6}var n=function(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),a=t[i],o=t[i+1],s=i>0?t[i-1]:2*a-o,l=i<e-1?t[i+2]:2*o-a;return r((n-i/e)*e,s,a,o,l)}},i=function(t){var e=t.length;return function(n){var i=Math.floor(((n%=1)<0?++n:n)*e),a=t[(i+e-1)%e],o=t[i%e],s=t[(i+1)%e],l=t[(i+2)%e];return r((n-i/e)*e,a,o,s,l)}},a=function(t){return function(){return t}};function o(t,e){return function(r){return t+r*e}}function s(t,e){var r=e-t;return r?o(t,r>180||r<-180?r-360*Math.round(r/360):r):a(isNaN(t)?e:t)}function l(t){return 1==(t=+t)?c:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):a(isNaN(e)?r:e)}}function c(t,e){var r=e-t;return r?o(t,r):a(isNaN(t)?e:t)}var u=function t(r){var n=l(r);function i(t,r){var i=n((t=e.rgb(t)).r,(r=e.rgb(r)).r),a=n(t.g,r.g),o=n(t.b,r.b),s=c(t.opacity,r.opacity);return function(e){return t.r=i(e),t.g=a(e),t.b=o(e),t.opacity=s(e),t+\"\"}}return i.gamma=t,i}(1);function f(t){return function(r){var n,i,a=r.length,o=new Array(a),s=new Array(a),l=new Array(a);for(n=0;n<a;++n)i=e.rgb(r[n]),o[n]=i.r||0,s[n]=i.g||0,l[n]=i.b||0;return o=t(o),s=t(s),l=t(l),i.opacity=1,function(t){return i.r=o(t),i.g=s(t),i.b=l(t),i+\"\"}}}var h=f(n),d=f(i),p=function(t,e){var r,n=e?e.length:0,i=t?Math.min(n,t.length):0,a=new Array(i),o=new Array(n);for(r=0;r<i;++r)a[r]=A(t[r],e[r]);for(;r<n;++r)o[r]=e[r];return function(t){for(r=0;r<i;++r)o[r]=a[r](t);return o}},m=function(t,e){var r=new Date;return e-=t=+t,function(n){return r.setTime(t+e*n),r}},v=function(t,e){return e-=t=+t,function(r){return t+e*r}},g=function(t,e){var r,n={},i={};for(r in null!==t&&\"object\"==typeof t||(t={}),null!==e&&\"object\"==typeof e||(e={}),e)r in t?n[r]=A(t[r],e[r]):i[r]=e[r];return function(t){for(r in n)i[r]=n[r](t);return i}},y=/[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,b=new RegExp(y.source,\"g\");var x,_,w,M,k=function(t,e){var r,n,i,a=y.lastIndex=b.lastIndex=0,o=-1,s=[],l=[];for(t+=\"\",e+=\"\";(r=y.exec(t))&&(n=b.exec(e));)(i=n.index)>a&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:v(r,n)})),a=b.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?function(t){return function(e){return t(e)+\"\"}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var r,n=0;n<e;++n)s[(r=l[n]).i]=r.x(t);return s.join(\"\")})},A=function(t,r){var n,i=typeof r;return null==r||\"boolean\"===i?a(r):(\"number\"===i?v:\"string\"===i?(n=e.color(r))?(r=n,u):k:r instanceof e.color?u:r instanceof Date?m:Array.isArray(r)?p:\"function\"!=typeof r.valueOf&&\"function\"!=typeof r.toString||isNaN(r)?g:v)(t,r)},T=180/Math.PI,E={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},S=function(t,e,r,n,i,a){var o,s,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*r+e*n)&&(r-=t*l,n-=e*l),(s=Math.sqrt(r*r+n*n))&&(r/=s,n/=s,l/=s),t*n<e*r&&(t=-t,e=-e,l=-l,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*T,skewX:Math.atan(l)*T,scaleX:o,scaleY:s}};function L(t,e,r,n){function i(t){return t.length?t.pop()+\" \":\"\"}return function(a,o){var s=[],l=[];return a=t(a),o=t(o),function(t,n,i,a,o,s){if(t!==i||n!==a){var l=o.push(\"translate(\",null,e,null,r);s.push({i:l-4,x:v(t,i)},{i:l-2,x:v(n,a)})}else(i||a)&&o.push(\"translate(\"+i+e+a+r)}(a.translateX,a.translateY,o.translateX,o.translateY,s,l),function(t,e,r,a){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+\"rotate(\",null,n)-2,x:v(t,e)})):e&&r.push(i(r)+\"rotate(\"+e+n)}(a.rotate,o.rotate,s,l),function(t,e,r,a){t!==e?a.push({i:r.push(i(r)+\"skewX(\",null,n)-2,x:v(t,e)}):e&&r.push(i(r)+\"skewX(\"+e+n)}(a.skewX,o.skewX,s,l),function(t,e,r,n,a,o){if(t!==r||e!==n){var s=a.push(i(a)+\"scale(\",null,\",\",null,\")\");o.push({i:s-4,x:v(t,r)},{i:s-2,x:v(e,n)})}else 1===r&&1===n||a.push(i(a)+\"scale(\"+r+\",\"+n+\")\")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(t){for(var e,r=-1,n=l.length;++r<n;)s[(e=l[r]).i]=e.x(t);return s.join(\"\")}}}var C=L(function(t){return\"none\"===t?E:(x||(x=document.createElement(\"DIV\"),_=document.documentElement,w=document.defaultView),x.style.transform=t,t=w.getComputedStyle(_.appendChild(x),null).getPropertyValue(\"transform\"),_.removeChild(x),t=t.slice(7,-1).split(\",\"),S(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))},\"px, \",\"px)\",\"deg)\"),P=L(function(t){return null==t?E:(M||(M=document.createElementNS(\"http://www.w3.org/2000/svg\",\"g\")),M.setAttribute(\"transform\",t),(t=M.transform.baseVal.consolidate())?(t=t.matrix,S(t.a,t.b,t.c,t.d,t.e,t.f)):E)},\", \",\")\",\")\"),z=Math.SQRT2;function O(t){return((t=Math.exp(t))+1/t)/2}function D(t){return function(r,n){var i=t((r=e.hsl(r)).h,(n=e.hsl(n)).h),a=c(r.s,n.s),o=c(r.l,n.l),s=c(r.opacity,n.opacity);return function(t){return r.h=i(t),r.s=a(t),r.l=o(t),r.opacity=s(t),r+\"\"}}}var I=D(s),R=D(c);function N(t){return function(r,n){var i=t((r=e.hcl(r)).h,(n=e.hcl(n)).h),a=c(r.c,n.c),o=c(r.l,n.l),s=c(r.opacity,n.opacity);return function(t){return r.h=i(t),r.c=a(t),r.l=o(t),r.opacity=s(t),r+\"\"}}}var F=N(s),j=N(c);function B(t){return function r(n){function i(r,i){var a=t((r=e.cubehelix(r)).h,(i=e.cubehelix(i)).h),o=c(r.s,i.s),s=c(r.l,i.l),l=c(r.opacity,i.opacity);return function(t){return r.h=a(t),r.s=o(t),r.l=s(Math.pow(t,n)),r.opacity=l(t),r+\"\"}}return n=+n,i.gamma=r,i}(1)}var U=B(s),V=B(c);t.interpolate=A,t.interpolateArray=p,t.interpolateBasis=n,t.interpolateBasisClosed=i,t.interpolateDate=m,t.interpolateNumber=v,t.interpolateObject=g,t.interpolateRound=function(t,e){return e-=t=+t,function(r){return Math.round(t+e*r)}},t.interpolateString=k,t.interpolateTransformCss=C,t.interpolateTransformSvg=P,t.interpolateZoom=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],c=e[2],u=s-i,f=l-a,h=u*u+f*f;if(h<1e-12)n=Math.log(c/o)/z,r=function(t){return[i+t*u,a+t*f,o*Math.exp(z*t*n)]};else{var d=Math.sqrt(h),p=(c*c-o*o+4*h)/(2*o*2*d),m=(c*c-o*o-4*h)/(2*c*2*d),v=Math.log(Math.sqrt(p*p+1)-p),g=Math.log(Math.sqrt(m*m+1)-m);n=(g-v)/z,r=function(t){var e,r=t*n,s=O(v),l=o/(2*d)*(s*(e=z*r+v,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(v));return[i+l*u,a+l*f,o*s/O(z*r+v)]}}return r.duration=1e3*n,r},t.interpolateRgb=u,t.interpolateRgbBasis=h,t.interpolateRgbBasisClosed=d,t.interpolateHsl=I,t.interpolateHslLong=R,t.interpolateLab=function(t,r){var n=c((t=e.lab(t)).l,(r=e.lab(r)).l),i=c(t.a,r.a),a=c(t.b,r.b),o=c(t.opacity,r.opacity);return function(e){return t.l=n(e),t.a=i(e),t.b=a(e),t.opacity=o(e),t+\"\"}},t.interpolateHcl=F,t.interpolateHclLong=j,t.interpolateCubehelix=U,t.interpolateCubehelixLong=V,t.quantize=function(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t(n/(e-1));return r},Object.defineProperty(t,\"__esModule\",{value:!0})},\"object\"==typeof r&&void 0!==e?i(r,t(\"d3-color\")):i(n.d3=n.d3||{},n.d3)},{\"d3-color\":122}],126:[function(t,e,r){var n;n=this,function(t){\"use strict\";function e(t,e,r,n){if(isNaN(e)||isNaN(r))return t;var i,a,o,s,l,c,u,f,h,d=t._root,p={data:n},m=t._x0,v=t._y0,g=t._x1,y=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((c=e>=(a=(m+g)/2))?m=a:g=a,(u=r>=(o=(v+y)/2))?v=o:y=o,i=d,!(d=d[f=u<<1|c]))return i[f]=p,t;if(s=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===s&&r===l)return p.next=d,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(c=e>=(a=(m+g)/2))?m=a:g=a,(u=r>=(o=(v+y)/2))?v=o:y=o}while((f=u<<1|c)==(h=(l>=o)<<1|s>=a));return i[h]=d,i[f]=p,t}var r=function(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i};function n(t){return t[0]}function i(t){return t[1]}function a(t,e,r){var a=new o(null==e?n:e,null==r?i:r,NaN,NaN,NaN,NaN);return null==t?a:a.addAll(t)}function o(t,e,r,n,i,a){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function s(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var l=a.prototype=o.prototype;l.copy=function(){var t,e,r=new o(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=s(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=s(e));return r},l.add=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},l.addAll=function(t){var r,n,i,a,o=t.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,f=-1/0,h=-1/0;for(n=0;n<o;++n)isNaN(i=+this._x.call(null,r=t[n]))||isNaN(a=+this._y.call(null,r))||(s[n]=i,l[n]=a,i<c&&(c=i),i>f&&(f=i),a<u&&(u=a),a>h&&(h=a));for(f<c&&(c=this._x0,f=this._x1),h<u&&(u=this._y0,h=this._y1),this.cover(c,u).cover(f,h),n=0;n<o;++n)e(this,s[n],l[n],t[n]);return this},l.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var r=this._x0,n=this._y0,i=this._x1,a=this._y1;if(isNaN(r))i=(r=Math.floor(t))+1,a=(n=Math.floor(e))+1;else{if(!(r>t||t>i||n>e||e>a))return this;var o,s,l=i-r,c=this._root;switch(s=(e<(n+a)/2)<<1|t<(r+i)/2){case 0:do{(o=new Array(4))[s]=c,c=o}while(a=n+(l*=2),t>(i=r+l)||e>a);break;case 1:do{(o=new Array(4))[s]=c,c=o}while(a=n+(l*=2),(r=i-l)>t||e>a);break;case 2:do{(o=new Array(4))[s]=c,c=o}while(n=a-(l*=2),t>(i=r+l)||n>e);break;case 3:do{(o=new Array(4))[s]=c,c=o}while(n=a-(l*=2),(r=i-l)>t||n>e)}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=i,this._y1=a,this},l.data=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},l.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},l.find=function(t,e,n){var i,a,o,s,l,c,u,f=this._x0,h=this._y0,d=this._x1,p=this._y1,m=[],v=this._root;for(v&&m.push(new r(v,f,h,d,p)),null==n?n=1/0:(f=t-n,h=e-n,d=t+n,p=e+n,n*=n);c=m.pop();)if(!(!(v=c.node)||(a=c.x0)>d||(o=c.y0)>p||(s=c.x1)<f||(l=c.y1)<h))if(v.length){var g=(a+s)/2,y=(o+l)/2;m.push(new r(v[3],g,y,s,l),new r(v[2],a,y,g,l),new r(v[1],g,o,s,y),new r(v[0],a,o,g,y)),(u=(e>=y)<<1|t>=g)&&(c=m[m.length-1],m[m.length-1]=m[m.length-1-u],m[m.length-1-u]=c)}else{var b=t-+this._x.call(null,v.data),x=e-+this._y.call(null,v.data),_=b*b+x*x;if(_<n){var w=Math.sqrt(n=_);f=t-w,h=e-w,d=t+w,p=e+w,i=v.data}}return i},l.remove=function(t){if(isNaN(a=+this._x.call(null,t))||isNaN(o=+this._y.call(null,t)))return this;var e,r,n,i,a,o,s,l,c,u,f,h,d=this._root,p=this._x0,m=this._y0,v=this._x1,g=this._y1;if(!d)return this;if(d.length)for(;;){if((c=a>=(s=(p+v)/2))?p=s:v=s,(u=o>=(l=(m+g)/2))?m=l:g=l,e=d,!(d=d[f=u<<1|c]))return this;if(!d.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(r=e,h=f)}for(;d.data!==t;)if(n=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,n?(i?n.next=i:delete n.next,this):e?(i?e[f]=i:delete e[f],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(r?r[h]=d:this._root=d),this):(this._root=i,this)},l.removeAll=function(t){for(var e=0,r=t.length;e<r;++e)this.remove(t[e]);return this},l.root=function(){return this._root},l.size=function(){var t=0;return this.visit(function(e){if(!e.length)do{++t}while(e=e.next)}),t},l.visit=function(t){var e,n,i,a,o,s,l=[],c=this._root;for(c&&l.push(new r(c,this._x0,this._y0,this._x1,this._y1));e=l.pop();)if(!t(c=e.node,i=e.x0,a=e.y0,o=e.x1,s=e.y1)&&c.length){var u=(i+o)/2,f=(a+s)/2;(n=c[3])&&l.push(new r(n,u,f,o,s)),(n=c[2])&&l.push(new r(n,i,f,u,s)),(n=c[1])&&l.push(new r(n,u,a,o,f)),(n=c[0])&&l.push(new r(n,i,a,u,f))}return this},l.visitAfter=function(t){var e,n=[],i=[];for(this._root&&n.push(new r(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var a=e.node;if(a.length){var o,s=e.x0,l=e.y0,c=e.x1,u=e.y1,f=(s+c)/2,h=(l+u)/2;(o=a[0])&&n.push(new r(o,s,l,f,h)),(o=a[1])&&n.push(new r(o,f,l,c,h)),(o=a[2])&&n.push(new r(o,s,h,f,u)),(o=a[3])&&n.push(new r(o,f,h,c,u))}i.push(e)}for(;e=i.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},l.x=function(t){return arguments.length?(this._x=t,this):this._x},l.y=function(t){return arguments.length?(this._y=t,this):this._y},t.quadtree=a,Object.defineProperty(t,\"__esModule\",{value:!0})}(\"object\"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],127:[function(t,e,r){var n;n=this,function(t){\"use strict\";var e,r,n=0,i=0,a=0,o=1e3,s=0,l=0,c=0,u=\"object\"==typeof performance&&performance.now?performance:Date,f=\"object\"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function h(){return l||(f(d),l=u.now()+c)}function d(){l=0}function p(){this._call=this._time=this._next=null}function m(t,e,r){var n=new p;return n.restart(t,e,r),n}function v(){h(),++n;for(var t,r=e;r;)(t=l-r._time)>=0&&r._call.call(null,t),r=r._next;--n}function g(){l=(s=u.now())+c,n=i=0;try{v()}finally{n=0,function(){var t,n,i=e,a=1/0;for(;i;)i._call?(a>i._time&&(a=i._time),t=i,i=i._next):(n=i._next,i._next=null,i=t?t._next=n:e=n);r=t,b(a)}(),l=0}}function y(){var t=u.now(),e=t-s;e>o&&(c-=e,s=t)}function b(t){n||(i&&(i=clearTimeout(i)),t-l>24?(t<1/0&&(i=setTimeout(g,t-u.now()-c)),a&&(a=clearInterval(a))):(a||(s=u.now(),a=setInterval(y,o)),n=1,f(g)))}p.prototype=m.prototype={constructor:p,restart:function(t,n,i){if(\"function\"!=typeof t)throw new TypeError(\"callback is not a function\");i=(null==i?h():+i)+(null==n?0:+n),this._next||r===this||(r?r._next=this:e=this,r=this),this._call=t,this._time=i,b()},stop:function(){this._call&&(this._call=null,this._time=1/0,b())}};t.now=h,t.timer=m,t.timerFlush=v,t.timeout=function(t,e,r){var n=new p;return e=null==e?0:+e,n.restart(function(r){n.stop(),t(r+e)},e,r),n},t.interval=function(t,e,r){var n=new p,i=e;return null==e?(n.restart(t,e,r),n):(e=+e,r=null==r?h():+r,n.restart(function a(o){o+=i,n.restart(a,i+=e,r),t(o)},e,r),n)},Object.defineProperty(t,\"__esModule\",{value:!0})}(\"object\"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],128:[function(t,e,r){!function(){var t={version:\"3.5.17\"},r=[].slice,n=function(t){return r.call(t)},i=this.document;function a(t){return t&&(t.ownerDocument||t.document||t).documentElement}function o(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(i)try{n(i.documentElement.childNodes)[0].nodeType}catch(t){n=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),i)try{i.createElement(\"DIV\").style.setProperty(\"opacity\",0,\"\")}catch(t){var s=this.Element.prototype,l=s.setAttribute,c=s.setAttributeNS,u=this.CSSStyleDeclaration.prototype,f=u.setProperty;s.setAttribute=function(t,e){l.call(this,t,e+\"\")},s.setAttributeNS=function(t,e,r){c.call(this,t,e,r+\"\")},u.setProperty=function(t,e,r){f.call(this,t,e+\"\",r)}}function h(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function d(t){return null===t?NaN:+t}function p(t){return!isNaN(t)}function m(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}t.ascending=h,t.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},t.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i<a;)if(null!=(n=t[i])&&n>=n){r=n;break}for(;++i<a;)null!=(n=t[i])&&r>n&&(r=n)}else{for(;++i<a;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=n;break}for(;++i<a;)null!=(n=e.call(t,t[i],i))&&r>n&&(r=n)}return r},t.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i<a;)if(null!=(n=t[i])&&n>=n){r=n;break}for(;++i<a;)null!=(n=t[i])&&n>r&&(r=n)}else{for(;++i<a;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=n;break}for(;++i<a;)null!=(n=e.call(t,t[i],i))&&n>r&&(r=n)}return r},t.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a<o;)if(null!=(n=t[a])&&n>=n){r=i=n;break}for(;++a<o;)null!=(n=t[a])&&(r>n&&(r=n),i<n&&(i=n))}else{for(;++a<o;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=i=n;break}for(;++a<o;)null!=(n=e.call(t,t[a],a))&&(r>n&&(r=n),i<n&&(i=n))}return[r,i]},t.sum=function(t,e){var r,n=0,i=t.length,a=-1;if(1===arguments.length)for(;++a<i;)p(r=+t[a])&&(n+=r);else for(;++a<i;)p(r=+e.call(t,t[a],a))&&(n+=r);return n},t.mean=function(t,e){var r,n=0,i=t.length,a=-1,o=i;if(1===arguments.length)for(;++a<i;)p(r=d(t[a]))?n+=r:--o;else for(;++a<i;)p(r=d(e.call(t,t[a],a)))?n+=r:--o;if(o)return n/o},t.quantile=function(t,e){var r=(t.length-1)*e+1,n=Math.floor(r),i=+t[n-1],a=r-n;return a?i+a*(t[n]-i):i},t.median=function(e,r){var n,i=[],a=e.length,o=-1;if(1===arguments.length)for(;++o<a;)p(n=d(e[o]))&&i.push(n);else for(;++o<a;)p(n=d(r.call(e,e[o],o)))&&i.push(n);if(i.length)return t.quantile(i.sort(h),.5)},t.variance=function(t,e){var r,n,i=t.length,a=0,o=0,s=-1,l=0;if(1===arguments.length)for(;++s<i;)p(r=d(t[s]))&&(o+=(n=r-a)*(r-(a+=n/++l)));else for(;++s<i;)p(r=d(e.call(t,t[s],s)))&&(o+=(n=r-a)*(r-(a+=n/++l)));if(l>1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var v=m(h);function g(t){return t.length}t.bisectLeft=v.left,t.bisect=t.bisectRight=v.right,t.bisector=function(t){return m(1===t.length?function(e,r){return h(t(e),r)}:t)},t.shuffle=function(t,e,r){(a=arguments.length)<3&&(r=t.length,a<2&&(e=0));for(var n,i,a=r-e;a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],i=new Array(r<0?0:r);e<r;)i[e]=[n,n=t[++e]];return i},t.transpose=function(e){if(!(a=e.length))return[];for(var r=-1,n=t.min(e,g),i=new Array(n);++r<n;)for(var a,o=-1,s=i[r]=new Array(a);++o<a;)s[o]=e[o][r];return i},t.zip=function(){return t.transpose(arguments)},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},t.merge=function(t){for(var e,r,n,i=t.length,a=-1,o=0;++a<i;)o+=t[a].length;for(r=new Array(o);--i>=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r};var y=Math.abs;function b(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function x(){this._=Object.create(null)}t.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r==1/0)throw new Error(\"infinite range\");var n,i=[],a=function(t){var e=1;for(;t*e%1;)e*=10;return e}(y(r)),o=-1;if(t*=a,e*=a,(r*=a)<0)for(;(n=t+r*++o)>e;)i.push(n/a);else for(;(n=t+r*++o)<e;)i.push(n/a);return i},t.map=function(t,e){var r=new x;if(t instanceof x)t.forEach(function(t,e){r.set(t,e)});else if(Array.isArray(t)){var n,i=-1,a=t.length;if(1===arguments.length)for(;++i<a;)r.set(i,t[i]);else for(;++i<a;)r.set(e.call(t,n=t[i],i),n)}else for(var o in t)r.set(o,t[o]);return r};var _=\"__proto__\",w=\"\\0\";function M(t){return(t+=\"\")===_||t[0]===w?w+t:t}function k(t){return(t+=\"\")[0]===w?t.slice(1):t}function A(t){return M(t)in this._}function T(t){return(t=M(t))in this._&&delete this._[t]}function E(){var t=[];for(var e in this._)t.push(k(e));return t}function S(){var t=0;for(var e in this._)++t;return t}function L(){for(var t in this._)return!1;return!0}function C(){this._=Object.create(null)}function P(t){return t}function z(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function O(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=D.length;r<n;++r){var i=D[r]+e;if(i in t)return i}}b(x,{has:A,get:function(t){return this._[M(t)]},set:function(t,e){return this._[M(t)]=e},remove:T,keys:E,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:k(e),value:this._[e]});return t},size:S,empty:L,forEach:function(t){for(var e in this._)t.call(this,k(e),this._[e])}}),t.nest=function(){var e,r,n={},i=[],a=[];function o(t,a,s){if(s>=i.length)return r?r.call(n,a):e?a.sort(e):a;for(var l,c,u,f,h=-1,d=a.length,p=i[s++],m=new x;++h<d;)(f=m.get(l=p(c=a[h])))?f.push(c):m.set(l,[c]);return t?(c=t(),u=function(e,r){c.set(e,o(t,r,s))}):(c={},u=function(e,r){c[e]=o(t,r,s)}),m.forEach(u),c}return n.map=function(t,e){return o(e,t,0)},n.entries=function(e){return function t(e,r){if(r>=i.length)return e;var n=[],o=a[r++];return e.forEach(function(e,i){n.push({key:e,values:t(i,r)})}),o?n.sort(function(t,e){return o(t.key,e.key)}):n}(o(t.map,e,0),0)},n.key=function(t){return i.push(t),n},n.sortKeys=function(t){return a[i.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new C;if(t)for(var r=0,n=t.length;r<n;++r)e.add(t[r]);return e},b(C,{has:A,add:function(t){return this._[M(t+=\"\")]=!0,t},remove:T,values:E,size:S,empty:L,forEach:function(t){for(var e in this._)t.call(this,k(e))}}),t.behavior={},t.rebind=function(t,e){for(var r,n=1,i=arguments.length;++n<i;)t[r=arguments[n]]=z(t,e,e[r]);return t};var D=[\"webkit\",\"ms\",\"moz\",\"Moz\",\"o\",\"O\"];function I(){}function R(){}function N(t){var e=[],r=new x;function n(){for(var r,n=e,i=-1,a=n.length;++i<a;)(r=n[i].on)&&r.apply(this,arguments);return t}return n.on=function(n,i){var a,o=r.get(n);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,a=e.indexOf(o)).concat(e.slice(a+1)),r.remove(n)),i&&e.push(r.set(n,{on:i})),t)},n}function F(){t.event.preventDefault()}function j(){for(var e,r=t.event;e=r.sourceEvent;)r=e;return r}function B(e){for(var r=new R,n=0,i=arguments.length;++n<i;)r[arguments[n]]=N(r);return r.of=function(n,i){return function(a){try{var o=a.sourceEvent=t.event;a.target=e,t.event=a,r[a.type].apply(n,i)}finally{t.event=o}}},r}t.dispatch=function(){for(var t=new R,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=N(t);return t},R.prototype.on=function(t,e){var r=t.indexOf(\".\"),n=\"\";if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},t.event=null,t.requote=function(t){return t.replace(U,\"\\\\$&\")};var U=/[\\\\\\^\\$\\*\\+\\?\\|\\[\\]\\(\\)\\.\\{\\}]/g,V={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function q(t){return V(t,W),t}var H=function(t,e){return e.querySelector(t)},G=function(t,e){return e.querySelectorAll(t)},Y=function(t,e){var r=t.matches||t[O(t,\"matchesSelector\")];return(Y=function(t,e){return r.call(t,e)})(t,e)};\"function\"==typeof Sizzle&&(H=function(t,e){return Sizzle(t,e)[0]||null},G=Sizzle,Y=Sizzle.matchesSelector),t.selection=function(){return t.select(i.documentElement)};var W=t.selection.prototype=[];function X(t){return\"function\"==typeof t?t:function(){return H(t,this)}}function Z(t){return\"function\"==typeof t?t:function(){return G(t,this)}}W.select=function(t){var e,r,n,i,a=[];t=X(t);for(var o=-1,s=this.length;++o<s;){a.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var l=-1,c=n.length;++l<c;)(i=n[l])?(e.push(r=t.call(i,i.__data__,l,o)),r&&\"__data__\"in i&&(r.__data__=i.__data__)):e.push(null)}return q(a)},W.selectAll=function(t){var e,r,i=[];t=Z(t);for(var a=-1,o=this.length;++a<o;)for(var s=this[a],l=-1,c=s.length;++l<c;)(r=s[l])&&(i.push(e=n(t.call(r,r.__data__,l,a))),e.parentNode=r);return q(i)};var J=\"http://www.w3.org/1999/xhtml\",K={svg:\"http://www.w3.org/2000/svg\",xhtml:J,xlink:\"http://www.w3.org/1999/xlink\",xml:\"http://www.w3.org/XML/1998/namespace\",xmlns:\"http://www.w3.org/2000/xmlns/\"};function Q(e,r){return e=t.ns.qualify(e),null==r?e.local?function(){this.removeAttributeNS(e.space,e.local)}:function(){this.removeAttribute(e)}:\"function\"==typeof r?e.local?function(){var t=r.apply(this,arguments);null==t?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,t)}:function(){var t=r.apply(this,arguments);null==t?this.removeAttribute(e):this.setAttribute(e,t)}:e.local?function(){this.setAttributeNS(e.space,e.local,r)}:function(){this.setAttribute(e,r)}}function $(t){return t.trim().replace(/\\s+/g,\" \")}function tt(e){return new RegExp(\"(?:^|\\\\s+)\"+t.requote(e)+\"(?:\\\\s+|$)\",\"g\")}function et(t){return(t+\"\").trim().split(/^|\\s+/)}function rt(t,e){var r=(t=et(t).map(nt)).length;return\"function\"==typeof e?function(){for(var n=-1,i=e.apply(this,arguments);++n<r;)t[n](this,i)}:function(){for(var n=-1;++n<r;)t[n](this,e)}}function nt(t){var e=tt(t);return function(r,n){if(i=r.classList)return n?i.add(t):i.remove(t);var i=r.getAttribute(\"class\")||\"\";n?(e.lastIndex=0,e.test(i)||r.setAttribute(\"class\",$(i+\" \"+t))):r.setAttribute(\"class\",$(i.replace(e,\" \")))}}function it(t,e,r){return null==e?function(){this.style.removeProperty(t)}:\"function\"==typeof e?function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}:function(){this.style.setProperty(t,e,r)}}function at(t,e){return null==e?function(){delete this[t]}:\"function\"==typeof e?function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}:function(){this[t]=e}}function ot(e){return\"function\"==typeof e?e:(e=t.ns.qualify(e)).local?function(){return this.ownerDocument.createElementNS(e.space,e.local)}:function(){var t=this.ownerDocument,r=this.namespaceURI;return r===J&&t.documentElement.namespaceURI===J?t.createElement(e):t.createElementNS(r,e)}}function st(){var t=this.parentNode;t&&t.removeChild(this)}function lt(t){return{__data__:t}}function ct(t){return function(){return Y(this,t)}}function ut(t,e){for(var r=0,n=t.length;r<n;r++)for(var i,a=t[r],o=0,s=a.length;o<s;o++)(i=a[o])&&e(i,o,r);return t}function ft(t){return V(t,ht),t}t.ns={prefix:K,qualify:function(t){var e=t.indexOf(\":\"),r=t;return e>=0&&\"xmlns\"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),K.hasOwnProperty(r)?{space:K[r],local:t}:t}},W.attr=function(e,r){if(arguments.length<2){if(\"string\"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(Q(r,e[r]));return this}return this.each(Q(e,r))},W.classed=function(t,e){if(arguments.length<2){if(\"string\"==typeof t){var r=this.node(),n=(t=et(t)).length,i=-1;if(e=r.classList){for(;++i<n;)if(!e.contains(t[i]))return!1}else for(e=r.getAttribute(\"class\");++i<n;)if(!tt(t[i]).test(e))return!1;return!0}for(e in t)this.each(rt(e,t[e]));return this}return this.each(rt(t,e))},W.style=function(t,e,r){var n=arguments.length;if(n<3){if(\"string\"!=typeof t){for(r in n<2&&(e=\"\"),t)this.each(it(r,t[r],e));return this}if(n<2){var i=this.node();return o(i).getComputedStyle(i,null).getPropertyValue(t)}r=\"\"}return this.each(it(t,e,r))},W.property=function(t,e){if(arguments.length<2){if(\"string\"==typeof t)return this.node()[t];for(e in t)this.each(at(e,t[e]));return this}return this.each(at(t,e))},W.text=function(t){return arguments.length?this.each(\"function\"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?\"\":e}:null==t?function(){this.textContent=\"\"}:function(){this.textContent=t}):this.node().textContent},W.html=function(t){return arguments.length?this.each(\"function\"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?\"\":e}:null==t?function(){this.innerHTML=\"\"}:function(){this.innerHTML=t}):this.node().innerHTML},W.append=function(t){return t=ot(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},W.insert=function(t,e){return t=ot(t),e=X(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},W.remove=function(){return this.each(st)},W.data=function(t,e){var r,n,i=-1,a=this.length;if(!arguments.length){for(t=new Array(a=(r=this[0]).length);++i<a;)(n=r[i])&&(t[i]=n.__data__);return t}function o(t,r){var n,i,a,o=t.length,u=r.length,f=Math.min(o,u),h=new Array(u),d=new Array(u),p=new Array(o);if(e){var m,v=new x,g=new Array(o);for(n=-1;++n<o;)(i=t[n])&&(v.has(m=e.call(i,i.__data__,n))?p[n]=i:v.set(m,i),g[n]=m);for(n=-1;++n<u;)(i=v.get(m=e.call(r,a=r[n],n)))?!0!==i&&(h[n]=i,i.__data__=a):d[n]=lt(a),v.set(m,!0);for(n=-1;++n<o;)n in g&&!0!==v.get(g[n])&&(p[n]=t[n])}else{for(n=-1;++n<f;)i=t[n],a=r[n],i?(i.__data__=a,h[n]=i):d[n]=lt(a);for(;n<u;++n)d[n]=lt(r[n]);for(;n<o;++n)p[n]=t[n]}d.update=h,d.parentNode=h.parentNode=p.parentNode=t.parentNode,s.push(d),l.push(h),c.push(p)}var s=ft([]),l=q([]),c=q([]);if(\"function\"==typeof t)for(;++i<a;)o(r=this[i],t.call(r,r.parentNode.__data__,i));else for(;++i<a;)o(r=this[i],t);return l.enter=function(){return s},l.exit=function(){return c},l},W.datum=function(t){return arguments.length?this.property(\"__data__\",t):this.property(\"__data__\")},W.filter=function(t){var e,r,n,i=[];\"function\"!=typeof t&&(t=ct(t));for(var a=0,o=this.length;a<o;a++){i.push(e=[]),e.parentNode=(r=this[a]).parentNode;for(var s=0,l=r.length;s<l;s++)(n=r[s])&&t.call(n,n.__data__,s,a)&&e.push(n)}return q(i)},W.order=function(){for(var t=-1,e=this.length;++t<e;)for(var r,n=this[t],i=n.length-1,a=n[i];--i>=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},W.sort=function(t){t=function(t){arguments.length||(t=h);return function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}.apply(this,arguments);for(var e=-1,r=this.length;++e<r;)this[e].sort(t);return this.order()},W.each=function(t){return ut(this,function(e,r,n){t.call(e,e.__data__,r,n)})},W.call=function(t){var e=n(arguments);return t.apply(e[0]=this,e),this},W.empty=function(){return!this.node()},W.node=function(){for(var t=0,e=this.length;t<e;t++)for(var r=this[t],n=0,i=r.length;n<i;n++){var a=r[n];if(a)return a}return null},W.size=function(){var t=0;return ut(this,function(){++t}),t};var ht=[];function dt(e,r,i){var a=\"__on\"+e,o=e.indexOf(\".\"),s=mt;o>0&&(e=e.slice(0,o));var l=pt.get(e);function c(){var t=this[a];t&&(this.removeEventListener(e,t,t.$),delete this[a])}return l&&(e=l,s=vt),o?r?function(){var t=s(r,n(arguments));c.call(this),this.addEventListener(e,this[a]=t,t.$=i),t._=r}:c:r?I:function(){var r,n=new RegExp(\"^__on([^.]+)\"+t.requote(e)+\"$\");for(var i in this)if(r=i.match(n)){var a=this[i];this.removeEventListener(r[1],a,a.$),delete this[i]}}}t.selection.enter=ft,t.selection.enter.prototype=ht,ht.append=W.append,ht.empty=W.empty,ht.node=W.node,ht.call=W.call,ht.size=W.size,ht.select=function(t){for(var e,r,n,i,a,o=[],s=-1,l=this.length;++s<l;){n=(i=this[s]).update,o.push(e=[]),e.parentNode=i.parentNode;for(var c=-1,u=i.length;++c<u;)(a=i[c])?(e.push(n[c]=r=t.call(i.parentNode,a.__data__,c,s)),r.__data__=a.__data__):e.push(null)}return q(o)},ht.insert=function(t,e){var r,n,i;return arguments.length<2&&(r=this,e=function(t,e,a){var o,s=r[a].update,l=s.length;for(a!=i&&(i=a,n=0),e>=n&&(n=e+1);!(o=s[n])&&++n<l;);return o}),W.insert.call(this,t,e)},t.select=function(t){var e;return\"string\"==typeof t?(e=[H(t,i)]).parentNode=i.documentElement:(e=[t]).parentNode=a(t),q([e])},t.selectAll=function(t){var e;return\"string\"==typeof t?(e=n(G(t,i))).parentNode=i.documentElement:(e=n(t)).parentNode=null,q([e])},W.on=function(t,e,r){var n=arguments.length;if(n<3){if(\"string\"!=typeof t){for(r in n<2&&(e=!1),t)this.each(dt(r,t[r],e));return this}if(n<2)return(n=this.node()[\"__on\"+t])&&n._;r=!1}return this.each(dt(t,e,r))};var pt=t.map({mouseenter:\"mouseover\",mouseleave:\"mouseout\"});function mt(e,r){return function(n){var i=t.event;t.event=n,r[0]=this.__data__;try{e.apply(this,r)}finally{t.event=i}}}function vt(t,e){var r=mt(t,e);return function(t){var e=t.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||r.call(this,t)}}i&&pt.forEach(function(t){\"on\"+t in i&&pt.remove(t)});var gt,yt=0;function bt(e){var r=\".dragsuppress-\"+ ++yt,n=\"click\"+r,i=t.select(o(e)).on(\"touchmove\"+r,F).on(\"dragstart\"+r,F).on(\"selectstart\"+r,F);if(null==gt&&(gt=!(\"onselectstart\"in e)&&O(e.style,\"userSelect\")),gt){var s=a(e).style,l=s[gt];s[gt]=\"none\"}return function(t){if(i.on(r,null),gt&&(s[gt]=l),t){var e=function(){i.on(n,null)};i.on(n,function(){F(),e()},!0),setTimeout(e,0)}}}t.mouse=function(t){return _t(t,j())};var xt=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function _t(e,r){r.changedTouches&&(r=r.changedTouches[0]);var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();if(xt<0){var a=o(e);if(a.scrollX||a.scrollY){var s=(n=t.select(\"body\").append(\"svg\").style({position:\"absolute\",top:0,left:0,margin:0,padding:0,border:\"none\"},\"important\"))[0][0].getScreenCTM();xt=!(s.f||s.e),n.remove()}}return xt?(i.x=r.pageX,i.y=r.pageY):(i.x=r.clientX,i.y=r.clientY),[(i=i.matrixTransform(e.getScreenCTM().inverse())).x,i.y]}var l=e.getBoundingClientRect();return[r.clientX-l.left-e.clientLeft,r.clientY-l.top-e.clientTop]}function wt(){return t.event.changedTouches[0].identifier}t.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=j().changedTouches),e)for(var n,i=0,a=e.length;i<a;++i)if((n=e[i]).identifier===r)return _t(t,n)},t.behavior.drag=function(){var e=B(a,\"drag\",\"dragstart\",\"dragend\"),r=null,n=s(I,t.mouse,o,\"mousemove\",\"mouseup\"),i=s(wt,t.touch,P,\"touchmove\",\"touchend\");function a(){this.on(\"mousedown.drag\",n).on(\"touchstart.drag\",i)}function s(n,i,a,o,s){return function(){var l,c=t.event.target.correspondingElement||t.event.target,u=this.parentNode,f=e.of(this,arguments),h=0,d=n(),p=\".drag\"+(null==d?\"\":\"-\"+d),m=t.select(a(c)).on(o+p,function(){var t,e,r=i(u,d);if(!r)return;t=r[0]-g[0],e=r[1]-g[1],h|=t|e,g=r,f({type:\"drag\",x:r[0]+l[0],y:r[1]+l[1],dx:t,dy:e})}).on(s+p,function(){if(!i(u,d))return;m.on(o+p,null).on(s+p,null),v(h),f({type:\"dragend\"})}),v=bt(c),g=i(u,d);l=r?[(l=r.apply(this,arguments)).x-g[0],l.y-g[1]]:[0,0],f({type:\"dragstart\"})}}return a.origin=function(t){return arguments.length?(r=t,a):r},t.rebind(a,e,\"on\")},t.touches=function(t,e){return arguments.length<2&&(e=j().touches),e?n(e).map(function(e){var r=_t(t,e);return r.identifier=e.identifier,r}):[]};var Mt=1e-6,kt=Mt*Mt,At=Math.PI,Tt=2*At,Et=Tt-Mt,St=At/2,Lt=At/180,Ct=180/At;function Pt(t){return t>0?1:t<0?-1:0}function zt(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function Ot(t){return t>1?0:t<-1?At:Math.acos(t)}function Dt(t){return t>1?St:t<-1?-St:Math.asin(t)}function It(t){return((t=Math.exp(t))+1/t)/2}function Rt(t){return(t=Math.sin(t/2))*t}var Nt=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],c=e[2],u=s-i,f=l-a,h=u*u+f*f;if(h<kt)n=Math.log(c/o)/Nt,r=function(t){return[i+t*u,a+t*f,o*Math.exp(Nt*t*n)]};else{var d=Math.sqrt(h),p=(c*c-o*o+4*h)/(2*o*2*d),m=(c*c-o*o-4*h)/(2*c*2*d),v=Math.log(Math.sqrt(p*p+1)-p),g=Math.log(Math.sqrt(m*m+1)-m);n=(g-v)/Nt,r=function(t){var e,r=t*n,s=It(v),l=o/(2*d)*(s*(e=Nt*r+v,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(v));return[i+l*u,a+l*f,o*s/It(Nt*r+v)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,a,s,l,c,u,f,h={x:0,y:0,k:1},d=[960,500],p=Bt,m=250,v=0,g=\"mousedown.zoom\",y=\"mousemove.zoom\",b=\"mouseup.zoom\",x=\"touchstart.zoom\",_=B(w,\"zoomstart\",\"zoom\",\"zoomend\");function w(t){t.on(g,P).on(jt+\".zoom\",O).on(\"dblclick.zoom\",D).on(x,z)}function M(t){return[(t[0]-h.x)/h.k,(t[1]-h.y)/h.k]}function k(t){h.k=Math.max(p[0],Math.min(p[1],t))}function A(t,e){e=function(t){return[t[0]*h.k+h.x,t[1]*h.k+h.y]}(e),h.x+=t[0]-e[0],h.y+=t[1]-e[1]}function T(e,n,i,a){e.__chart__={x:h.x,y:h.y,k:h.k},k(Math.pow(2,a)),A(r=n,i),e=t.select(e),m>0&&(e=e.transition().duration(m)),e.call(w.event)}function E(){c&&c.domain(l.range().map(function(t){return(t-h.x)/h.k}).map(l.invert)),f&&f.domain(u.range().map(function(t){return(t-h.y)/h.k}).map(u.invert))}function S(t){v++||t({type:\"zoomstart\"})}function L(t){E(),t({type:\"zoom\",scale:h.k,translate:[h.x,h.y]})}function C(t){--v||(t({type:\"zoomend\"}),r=null)}function P(){var e=this,r=_.of(e,arguments),n=0,i=t.select(o(e)).on(y,function(){n=1,A(t.mouse(e),a),L(r)}).on(b,function(){i.on(y,null).on(b,null),s(n),C(r)}),a=M(t.mouse(e)),s=bt(e);ss.call(e),S(r)}function z(){var e,r=this,n=_.of(r,arguments),i={},a=0,o=\".zoom-\"+t.event.changedTouches[0].identifier,l=\"touchmove\"+o,c=\"touchend\"+o,u=[],f=t.select(r),d=bt(r);function p(){var n=t.touches(r);return e=h.k,n.forEach(function(t){t.identifier in i&&(i[t.identifier]=M(t))}),n}function m(){var e=t.event.target;t.select(e).on(l,v).on(c,y),u.push(e);for(var n=t.event.changedTouches,o=0,f=n.length;o<f;++o)i[n[o].identifier]=null;var d=p(),m=Date.now();if(1===d.length){if(m-s<500){var g=d[0];T(r,g,i[g.identifier],Math.floor(Math.log(h.k)/Math.LN2)+1),F()}s=m}else if(d.length>1){g=d[0];var b=d[1],x=g[0]-b[0],_=g[1]-b[1];a=x*x+_*_}}function v(){var o,l,c,u,f=t.touches(r);ss.call(r);for(var h=0,d=f.length;h<d;++h,u=null)if(c=f[h],u=i[c.identifier]){if(l)break;o=c,l=u}if(u){var p=(p=c[0]-o[0])*p+(p=c[1]-o[1])*p,m=a&&Math.sqrt(p/a);o=[(o[0]+c[0])/2,(o[1]+c[1])/2],l=[(l[0]+u[0])/2,(l[1]+u[1])/2],k(m*e)}s=null,A(o,l),L(n)}function y(){if(t.event.touches.length){for(var e=t.event.changedTouches,r=0,a=e.length;r<a;++r)delete i[e[r].identifier];for(var s in i)return void p()}t.selectAll(u).on(o,null),f.on(g,P).on(x,z),d(),C(n)}m(),S(n),f.on(g,null).on(x,m)}function O(){var i=_.of(this,arguments);a?clearTimeout(a):(ss.call(this),e=M(r=n||t.mouse(this)),S(i)),a=setTimeout(function(){a=null,C(i)},50),F(),k(Math.pow(2,.002*Ft())*h.k),A(r,e),L(i)}function D(){var e=t.mouse(this),r=Math.log(h.k)/Math.LN2;T(this,e,M(e),t.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}return jt||(jt=\"onwheel\"in i?(Ft=function(){return-t.event.deltaY*(t.event.deltaMode?120:1)},\"wheel\"):\"onmousewheel\"in i?(Ft=function(){return t.event.wheelDelta},\"mousewheel\"):(Ft=function(){return-t.event.detail},\"MozMousePixelScroll\")),w.event=function(e){e.each(function(){var e=_.of(this,arguments),n=h;us?t.select(this).transition().each(\"start.zoom\",function(){h=this.__chart__||{x:0,y:0,k:1},S(e)}).tween(\"zoom:zoom\",function(){var i=d[0],a=d[1],o=r?r[0]:i/2,s=r?r[1]:a/2,l=t.interpolateZoom([(o-h.x)/h.k,(s-h.y)/h.k,i/h.k],[(o-n.x)/n.k,(s-n.y)/n.k,i/n.k]);return function(t){var r=l(t),n=i/r[2];this.__chart__=h={x:o-r[0]*n,y:s-r[1]*n,k:n},L(e)}}).each(\"interrupt.zoom\",function(){C(e)}).each(\"end.zoom\",function(){C(e)}):(this.__chart__=h,S(e),L(e),C(e))})},w.translate=function(t){return arguments.length?(h={x:+t[0],y:+t[1],k:h.k},E(),w):[h.x,h.y]},w.scale=function(t){return arguments.length?(h={x:h.x,y:h.y,k:null},k(+t),E(),w):h.k},w.scaleExtent=function(t){return arguments.length?(p=null==t?Bt:[+t[0],+t[1]],w):p},w.center=function(t){return arguments.length?(n=t&&[+t[0],+t[1]],w):n},w.size=function(t){return arguments.length?(d=t&&[+t[0],+t[1]],w):d},w.duration=function(t){return arguments.length?(m=+t,w):m},w.x=function(t){return arguments.length?(c=t,l=t.copy(),h={x:0,y:0,k:1},w):c},w.y=function(t){return arguments.length?(f=t,u=t.copy(),h={x:0,y:0,k:1},w):f},t.rebind(w,_,\"on\")};var Ft,jt,Bt=[0,1/0];function Ut(){}function Vt(t,e,r){return this instanceof Vt?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof Vt?new Vt(t.h,t.s,t.l):ue(\"\"+t,fe,Vt):new Vt(t,e,r)}t.color=Ut,Ut.prototype.toString=function(){return this.rgb()+\"\"},t.hsl=Vt;var qt=Vt.prototype=new Ut;function Ht(t,e,r){var n,i;function a(t){return Math.round(255*function(t){return t>360?t-=360:t<0&&(t+=360),t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+e):r+e-r*e),new ae(a(t+120),a(t),a(t-120))}function Gt(e,r,n){return this instanceof Gt?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Gt?new Gt(e.h,e.c,e.l):ee(e instanceof Xt?e.l:(e=he((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Gt(e,r,n)}qt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Vt(this.h,this.s,this.l/t)},qt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Vt(this.h,this.s,t*this.l)},qt.rgb=function(){return Ht(this.h,this.s,this.l)},t.hcl=Gt;var Yt=Gt.prototype=new Ut;function Wt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Xt(r,Math.cos(t*=Lt)*e,Math.sin(t)*e)}function Xt(t,e,r){return this instanceof Xt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Xt?new Xt(t.l,t.a,t.b):t instanceof Gt?Wt(t.h,t.c,t.l):he((t=ae(t)).r,t.g,t.b):new Xt(t,e,r)}Yt.brighter=function(t){return new Gt(this.h,this.c,Math.min(100,this.l+Zt*(arguments.length?t:1)))},Yt.darker=function(t){return new Gt(this.h,this.c,Math.max(0,this.l-Zt*(arguments.length?t:1)))},Yt.rgb=function(){return Wt(this.h,this.c,this.l).rgb()},t.lab=Xt;var Zt=18,Jt=.95047,Kt=1,Qt=1.08883,$t=Xt.prototype=new Ut;function te(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return new ae(ie(3.2404542*(i=re(i)*Jt)-1.5371385*(n=re(n)*Kt)-.4985314*(a=re(a)*Qt)),ie(-.969266*i+1.8760108*n+.041556*a),ie(.0556434*i-.2040259*n+1.0572252*a))}function ee(t,e,r){return t>0?new Gt(Math.atan2(r,e)*Ct,Math.sqrt(e*e+r*r),t):new Gt(NaN,NaN,t)}function re(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ne(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ie(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ae(t,e,r){return this instanceof ae?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ae?new ae(t.r,t.g,t.b):ue(\"\"+t,ae,Ht):new ae(t,e,r)}function oe(t){return new ae(t>>16,t>>8&255,255&t)}function se(t){return oe(t)+\"\"}$t.brighter=function(t){return new Xt(Math.min(100,this.l+Zt*(arguments.length?t:1)),this.a,this.b)},$t.darker=function(t){return new Xt(Math.max(0,this.l-Zt*(arguments.length?t:1)),this.a,this.b)},$t.rgb=function(){return te(this.l,this.a,this.b)},t.rgb=ae;var le=ae.prototype=new Ut;function ce(t){return t<16?\"0\"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ue(t,e,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\\((.*)\\)/.exec(t=t.toLowerCase()))switch(i=n[2].split(\",\"),n[1]){case\"hsl\":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case\"rgb\":return e(pe(i[0]),pe(i[1]),pe(i[2]))}return(a=me.get(t))?e(a.r,a.g,a.b):(null==t||\"#\"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function fe(t,e,r){var n,i,a=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=t==o?(e-r)/s+(e<r?6:0):e==o?(r-t)/s+2:(t-e)/s+4,n*=60):(n=NaN,i=l>0&&l<1?0:n),new Vt(n,i,l)}function he(t,e,r){var n=ne((.4124564*(t=de(t))+.3575761*(e=de(e))+.1804375*(r=de(r)))/Jt),i=ne((.2126729*t+.7151522*e+.072175*r)/Kt);return Xt(116*i-16,500*(n-i),200*(i-ne((.0193339*t+.119192*e+.9503041*r)/Qt)))}function de(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function pe(t){var e=parseFloat(t);return\"%\"===t.charAt(t.length-1)?Math.round(2.55*e):e}le.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,i=30;return e||r||n?(e&&e<i&&(e=i),r&&r<i&&(r=i),n&&n<i&&(n=i),new ae(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new ae(i,i,i)},le.darker=function(t){return new ae((t=Math.pow(.7,arguments.length?t:1))*this.r,t*this.g,t*this.b)},le.hsl=function(){return fe(this.r,this.g,this.b)},le.toString=function(){return\"#\"+ce(this.r)+ce(this.g)+ce(this.b)};var me=t.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});function ve(t){return\"function\"==typeof t?t:function(){return t}}function ge(t){return function(e,r,n){return 2===arguments.length&&\"function\"==typeof r&&(n=r,r=null),ye(e,r,t,n)}}function ye(e,r,i,a){var o={},s=t.dispatch(\"beforesend\",\"progress\",\"load\",\"error\"),l={},c=new XMLHttpRequest,u=null;function f(){var t,e=c.status;if(!e&&function(t){var e=t.responseType;return e&&\"text\"!==e?t.response:t.responseText}(c)||e>=200&&e<300||304===e){try{t=i.call(o,c)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,c)}return!this.XDomainRequest||\"withCredentials\"in c||!/^(http(s)?:)?\\/\\//.test(e)||(c=new XDomainRequest),\"onload\"in c?c.onload=c.onerror=f:c.onreadystatechange=function(){c.readyState>3&&f()},c.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,c)}finally{t.event=r}},o.header=function(t,e){return t=(t+\"\").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+\"\",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+\"\",o):r},o.responseType=function(t){return arguments.length?(u=t,o):u},o.response=function(t){return i=t,o},[\"get\",\"post\"].forEach(function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}}),o.send=function(t,n,i){if(2===arguments.length&&\"function\"==typeof n&&(i=n,n=null),c.open(t,e,!0),null==r||\"accept\"in l||(l.accept=r+\",*/*\"),c.setRequestHeader)for(var a in l)c.setRequestHeader(a,l[a]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),null!=i&&o.on(\"error\",i).on(\"load\",function(t){i(null,t)}),s.beforesend.call(o,c),c.send(null==n?null:n),o},o.abort=function(){return c.abort(),o},t.rebind(o,s,\"on\"),null==a?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(a))}me.forEach(function(t,e){me.set(t,oe(e))}),t.functor=ve,t.xhr=ge(P),t.dsv=function(t,e){var r=new RegExp('[\"'+t+\"\\n]\"),n=t.charCodeAt(0);function i(t,r,n){arguments.length<3&&(n=r,r=null);var i=ye(t,e,null==r?a:o(r),n);return i.row=function(t){return arguments.length?i.response(null==(r=t)?a:o(t)):r},i}function a(t){return i.parse(t.responseText)}function o(t){return function(e){return i.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'\"'+t.replace(/\\\"/g,'\"\"')+'\"':t}return i.parse=function(t,e){var r;return i.parseRows(t,function(t,n){if(r)return r(t,n-1);var i=new Function(\"d\",\"return {\"+t.map(function(t,e){return JSON.stringify(t)+\": d[\"+e+\"]\"}).join(\",\")+\"}\");r=e?function(t,r){return e(i(t),r)}:i})},i.parseRows=function(t,e){var r,i,a={},o={},s=[],l=t.length,c=0,u=0;function f(){if(c>=l)return o;if(i)return i=!1,a;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++<l;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}return c=r+2,13===(s=t.charCodeAt(r+1))?(i=!0,10===t.charCodeAt(r+2)&&++c):10===s&&(i=!0),t.slice(e+1,r).replace(/\"\"/g,'\"')}for(;c<l;){var s,u=1;if(10===(s=t.charCodeAt(c++)))i=!0;else if(13===s)i=!0,10===t.charCodeAt(c)&&(++c,++u);else if(s!==n)continue;return t.slice(e,c-u)}return t.slice(e)}for(;(r=f())!==o;){for(var h=[];r!==a&&r!==o;)h.push(r),r=f();e&&null==(h=e(h,u++))||s.push(h)}return s},i.format=function(e){if(Array.isArray(e[0]))return i.formatRows(e);var r=new C,n=[];return e.forEach(function(t){for(var e in t)r.has(e)||n.push(r.add(e))}),[n.map(l).join(t)].concat(e.map(function(e){return n.map(function(t){return l(e[t])}).join(t)})).join(\"\\n\")},i.formatRows=function(t){return t.map(s).join(\"\\n\")},i},t.csv=t.dsv(\",\",\"text/csv\"),t.tsv=t.dsv(\"\\t\",\"text/tab-separated-values\");var be,xe,_e,we,Me=this[O(this,\"requestAnimationFrame\")]||function(t){setTimeout(t,17)};function ke(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var i={c:t,t:r+e,n:null};return xe?xe.n=i:be=i,xe=i,_e||(we=clearTimeout(we),_e=1,Me(Ae)),i}function Ae(){var t=Te(),e=Ee()-t;e>24?(isFinite(e)&&(clearTimeout(we),we=setTimeout(Ae,e)),_e=0):(_e=1,Me(Ae))}function Te(){for(var t=Date.now(),e=be;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Ee(){for(var t,e=be,r=1/0;e;)e.c?(e.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:be=e.n;return xe=t,r}function Se(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}t.timer=function(){ke.apply(this,arguments)},t.timer.flush=function(){Te(),Ee()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var Le=[\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"\\xb5\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"].map(function(t,e){var r=Math.pow(10,3*y(8-e));return{scale:e>8?function(t){return t/r}:function(t){return t*r},symbol:t}});t.formatPrefix=function(e,r){var n=0;return(e=+e)&&(e<0&&(e*=-1),r&&(e=t.round(e,Se(e,r))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Le[8+n/3]};var Ce=/(?:([^{])?([<>=^]))?([+\\- ])?([$#])?(0)?(\\d+)?(,)?(\\.-?\\d+)?([a-z%])?/i,Pe=t.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(e,r){return(e=t.round(e,Se(e,r))).toFixed(Math.max(0,Math.min(20,Se(e*(1+1e-15),r))))}});function ze(t){return t+\"\"}var Oe=t.time={},De=Date;function Ie(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Ie.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Re.setUTCDate.apply(this._,arguments)},setDay:function(){Re.setUTCDay.apply(this._,arguments)},setFullYear:function(){Re.setUTCFullYear.apply(this._,arguments)},setHours:function(){Re.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Re.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Re.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Re.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Re.setUTCSeconds.apply(this._,arguments)},setTime:function(){Re.setTime.apply(this._,arguments)}};var Re=Date.prototype;function Ne(t,e,r){function n(e){var r=t(e),n=a(r,1);return e-r<n-e?r:n}function i(r){return e(r=t(new De(r-1)),1),r}function a(t,r){return e(t=new De(+t),r),t}function o(t,n,a){var o=i(t),s=[];if(a>1)for(;o<n;)r(o)%a||s.push(new Date(+o)),e(o,1);else for(;o<n;)s.push(new Date(+o)),e(o,1);return s}t.floor=t,t.round=n,t.ceil=i,t.offset=a,t.range=o;var s=t.utc=Fe(t);return s.floor=s,s.round=Fe(n),s.ceil=Fe(i),s.offset=Fe(a),s.range=function(t,e,r){try{De=Ie;var n=new Ie;return n._=t,o(n,e,r)}finally{De=Date}},t}function Fe(t){return function(e,r){try{De=Ie;var n=new Ie;return n._=e,t(n,r)._}finally{De=Date}}}Oe.year=Ne(function(t){return(t=Oe.day(t)).setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),Oe.years=Oe.year.range,Oe.years.utc=Oe.year.utc.range,Oe.day=Ne(function(t){var e=new De(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),Oe.days=Oe.day.range,Oe.days.utc=Oe.day.utc.range,Oe.dayOfYear=function(t){var e=Oe.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},[\"sunday\",\"monday\",\"tuesday\",\"wednesday\",\"thursday\",\"friday\",\"saturday\"].forEach(function(t,e){e=7-e;var r=Oe[t]=Ne(function(t){return(t=Oe.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var r=Oe.year(t).getDay();return Math.floor((Oe.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});Oe[t+\"s\"]=r.range,Oe[t+\"s\"].utc=r.utc.range,Oe[t+\"OfYear\"]=function(t){var r=Oe.year(t).getDay();return Math.floor((Oe.dayOfYear(t)+(r+e)%7)/7)}}),Oe.week=Oe.sunday,Oe.weeks=Oe.sunday.range,Oe.weeks.utc=Oe.sunday.utc.range,Oe.weekOfYear=Oe.sundayOfYear;var je={\"-\":\"\",_:\" \",0:\"0\"},Be=/^\\s*\\d+/,Ue=/^%/;function Ve(t,e,r){var n=t<0?\"-\":\"\",i=(n?-t:t)+\"\",a=i.length;return n+(a<r?new Array(r-a+1).join(e)+i:i)}function qe(e){return new RegExp(\"^(?:\"+e.map(t.requote).join(\"|\")+\")\",\"i\")}function He(t){for(var e=new x,r=-1,n=t.length;++r<n;)e.set(t[r].toLowerCase(),r);return e}function Ge(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Ye(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r));return n?(t.U=+n[0],r+n[0].length):-1}function We(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r));return n?(t.W=+n[0],r+n[0].length):-1}function Xe(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Ze(t,e,r){Be.lastIndex=0;var n,i=Be.exec(e.slice(r,r+2));return i?(t.y=(n=+i[0])+(n>68?1900:2e3),r+i[0].length):-1}function Je(t,e,r){return/^[+-]\\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Ke(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Qe(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function $e(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function tr(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function er(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function rr(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function nr(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function ir(t){var e=t.getTimezoneOffset(),r=e>0?\"-\":\"+\",n=y(e)/60|0,i=y(e)%60;return r+Ve(n,\"0\",2)+Ve(i,\"0\",2)}function ar(t,e,r){Ue.lastIndex=0;var n=Ue.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function or(t){for(var e=t.length,r=-1;++r<e;)t[r][0]=this(t[r][0]);return function(e){for(var r=0,n=t[r];!n[1](e);)n=t[++r];return n[0](e)}}t.locale=function(e){return{numberFormat:function(e){var r=e.decimal,n=e.thousands,i=e.grouping,a=e.currency,o=i&&n?function(t,e){for(var r=t.length,a=[],o=0,s=i[0],l=0;r>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(r-=s,r+s)),!((l+=s+1)>e));)s=i[o=(o+1)%i.length];return a.reverse().join(n)}:P;return function(e){var n=Ce.exec(e),i=n[1]||\" \",s=n[2]||\">\",l=n[3]||\"-\",c=n[4]||\"\",u=n[5],f=+n[6],h=n[7],d=n[8],p=n[9],m=1,v=\"\",g=\"\",y=!1,b=!0;switch(d&&(d=+d.substring(1)),(u||\"0\"===i&&\"=\"===s)&&(u=i=\"0\",s=\"=\"),p){case\"n\":h=!0,p=\"g\";break;case\"%\":m=100,g=\"%\",p=\"f\";break;case\"p\":m=100,g=\"%\",p=\"r\";break;case\"b\":case\"o\":case\"x\":case\"X\":\"#\"===c&&(v=\"0\"+p.toLowerCase());case\"c\":b=!1;case\"d\":y=!0,d=0;break;case\"s\":m=-1,p=\"r\"}\"$\"===c&&(v=a[0],g=a[1]),\"r\"!=p||d||(p=\"g\"),null!=d&&(\"g\"==p?d=Math.max(1,Math.min(21,d)):\"e\"!=p&&\"f\"!=p||(d=Math.max(0,Math.min(20,d)))),p=Pe.get(p)||ze;var x=u&&h;return function(e){var n=g;if(y&&e%1)return\"\";var a=e<0||0===e&&1/e<0?(e=-e,\"-\"):\"-\"===l?\"\":l;if(m<0){var c=t.formatPrefix(e,d);e=c.scale(e),n=c.symbol+g}else e*=m;var _,w,M=(e=p(e,d)).lastIndexOf(\".\");if(M<0){var k=b?e.lastIndexOf(\"e\"):-1;k<0?(_=e,w=\"\"):(_=e.substring(0,k),w=e.substring(k))}else _=e.substring(0,M),w=r+e.substring(M+1);!u&&h&&(_=o(_,1/0));var A=v.length+_.length+w.length+(x?0:a.length),T=A<f?new Array(A=f-A+1).join(i):\"\";return x&&(_=o(T+_,T.length?f-w.length:1/0)),a+=v,e=_+w,(\"<\"===s?a+e+T:\">\"===s?T+a+e:\"^\"===s?T.substring(0,A>>=1)+a+e+T.substring(A):a+(x?e:T+e))+n}}}(e),timeFormat:function(e){var r=e.dateTime,n=e.date,i=e.time,a=e.periods,o=e.days,s=e.shortDays,l=e.months,c=e.shortMonths;function u(t){var e=t.length;function r(r){for(var n,i,a,o=[],s=-1,l=0;++s<e;)37===t.charCodeAt(s)&&(o.push(t.slice(l,s)),null!=(i=je[n=t.charAt(++s)])&&(n=t.charAt(++s)),(a=_[n])&&(n=a(r,null==i?\"e\"===n?\" \":\"0\":i)),o.push(n),l=s+1);return o.push(t.slice(l,s)),o.join(\"\")}return r.parse=function(e){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(f(r,t,e,0)!=e.length)return null;\"p\"in r&&(r.H=r.H%12+12*r.p);var n=null!=r.Z&&De!==Ie,i=new(n?Ie:De);return\"j\"in r?i.setFullYear(r.y,0,r.j):\"W\"in r||\"U\"in r?(\"w\"in r||(r.w=\"W\"in r?1:0),i.setFullYear(r.y,0,1),i.setFullYear(r.y,0,\"W\"in r?(r.w+6)%7+7*r.W-(i.getDay()+5)%7:r.w+7*r.U-(i.getDay()+6)%7)):i.setFullYear(r.y,r.m,r.d),i.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),n?i._:i},r.toString=function(){return t},r}function f(t,e,r,n){for(var i,a,o,s=0,l=e.length,c=r.length;s<l;){if(n>=c)return-1;if(37===(i=e.charCodeAt(s++))){if(o=e.charAt(s++),!(a=w[o in je?e.charAt(s++):o])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}u.utc=function(t){var e=u(t);function r(t){try{var r=new(De=Ie);return r._=t,e(r)}finally{De=Date}}return r.parse=function(t){try{De=Ie;var r=e.parse(t);return r&&r._}finally{De=Date}},r.toString=e.toString,r},u.multi=u.utc.multi=or;var h=t.map(),d=qe(o),p=He(o),m=qe(s),v=He(s),g=qe(l),y=He(l),b=qe(c),x=He(c);a.forEach(function(t,e){h.set(t.toLowerCase(),e)});var _={a:function(t){return s[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return l[t.getMonth()]},c:u(r),d:function(t,e){return Ve(t.getDate(),e,2)},e:function(t,e){return Ve(t.getDate(),e,2)},H:function(t,e){return Ve(t.getHours(),e,2)},I:function(t,e){return Ve(t.getHours()%12||12,e,2)},j:function(t,e){return Ve(1+Oe.dayOfYear(t),e,3)},L:function(t,e){return Ve(t.getMilliseconds(),e,3)},m:function(t,e){return Ve(t.getMonth()+1,e,2)},M:function(t,e){return Ve(t.getMinutes(),e,2)},p:function(t){return a[+(t.getHours()>=12)]},S:function(t,e){return Ve(t.getSeconds(),e,2)},U:function(t,e){return Ve(Oe.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Ve(Oe.mondayOfYear(t),e,2)},x:u(n),X:u(i),y:function(t,e){return Ve(t.getFullYear()%100,e,2)},Y:function(t,e){return Ve(t.getFullYear()%1e4,e,4)},Z:ir,\"%\":function(){return\"%\"}},w={a:function(t,e,r){m.lastIndex=0;var n=m.exec(e.slice(r));return n?(t.w=v.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){d.lastIndex=0;var n=d.exec(e.slice(r));return n?(t.w=p.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){b.lastIndex=0;var n=b.exec(e.slice(r));return n?(t.m=x.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){g.lastIndex=0;var n=g.exec(e.slice(r));return n?(t.m=y.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,r){return f(t,_.c.toString(),e,r)},d:Qe,e:Qe,H:tr,I:tr,j:$e,L:nr,m:Ke,M:er,p:function(t,e,r){var n=h.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:rr,U:Ye,w:Ge,W:We,x:function(t,e,r){return f(t,_.x.toString(),e,r)},X:function(t,e,r){return f(t,_.X.toString(),e,r)},y:Ze,Y:Xe,Z:Je,\"%\":ar};return u}(e)}};var sr=t.locale({decimal:\".\",thousands:\",\",grouping:[3],currency:[\"$\",\"\"],dateTime:\"%a %b %e %X %Y\",date:\"%m/%d/%Y\",time:\"%H:%M:%S\",periods:[\"AM\",\"PM\"],days:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],shortDays:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],months:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],shortMonths:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"]});function lr(){}t.format=sr.numberFormat,t.geo={},lr.prototype={s:0,t:0,add:function(t){ur(t,this.t,cr),ur(cr.s,this.s,this),this.s?this.t+=cr.t:this.s=cr.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var cr=new lr;function ur(t,e,r){var n=r.s=t+e,i=n-t,a=n-i;r.t=t-a+(e-i)}function fr(t,e){t&&dr.hasOwnProperty(t.type)&&dr[t.type](t,e)}t.geo.stream=function(t,e){t&&hr.hasOwnProperty(t.type)?hr[t.type](t,e):fr(t,e)};var hr={Feature:function(t,e){fr(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n<i;)fr(r[n].geometry,e)}},dr={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)t=r[n],e.point(t[0],t[1],t[2])},LineString:function(t,e){pr(t.coordinates,e,0)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)pr(r[n],e,0)},Polygon:function(t,e){mr(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)mr(r[n],e)},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,i=r.length;++n<i;)fr(r[n],e)}};function pr(t,e,r){var n,i=-1,a=t.length-r;for(e.lineStart();++i<a;)n=t[i],e.point(n[0],n[1],n[2]);e.lineEnd()}function mr(t,e){var r=-1,n=t.length;for(e.polygonStart();++r<n;)pr(t[r],e,1);e.polygonEnd()}t.geo.area=function(e){return vr=0,t.geo.stream(e,Lr),vr};var vr,gr,yr,br,xr,_r,wr,Mr,kr,Ar,Tr,Er,Sr=new lr,Lr={sphere:function(){vr+=4*At},point:I,lineStart:I,lineEnd:I,polygonStart:function(){Sr.reset(),Lr.lineStart=Cr},polygonEnd:function(){var t=2*Sr;vr+=t<0?4*At+t:t,Lr.lineStart=Lr.lineEnd=Lr.point=I}};function Cr(){var t,e,r,n,i;function a(t,e){e=e*Lt/2+At/4;var a=(t*=Lt)-r,o=a>=0?1:-1,s=o*a,l=Math.cos(e),c=Math.sin(e),u=i*c,f=n*l+u*Math.cos(s),h=u*o*Math.sin(s);Sr.add(Math.atan2(h,f)),r=t,n=l,i=c}Lr.point=function(o,s){Lr.point=a,r=(t=o)*Lt,n=Math.cos(s=(e=s)*Lt/2+At/4),i=Math.sin(s)},Lr.lineEnd=function(){a(t,e)}}function Pr(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function zr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Or(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Dr(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Ir(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Rr(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Nr(t){return[Math.atan2(t[1],t[0]),Dt(t[2])]}function Fr(t,e){return y(t[0]-e[0])<Mt&&y(t[1]-e[1])<Mt}t.geo.bounds=function(){var e,r,n,i,a,o,s,l,c,u,f,h={point:d,lineStart:m,lineEnd:v,polygonStart:function(){h.point=g,h.lineStart=b,h.lineEnd=x,c=0,Lr.polygonStart()},polygonEnd:function(){Lr.polygonEnd(),h.point=d,h.lineStart=m,h.lineEnd=v,Sr<0?(e=-(n=180),r=-(i=90)):c>Mt?i=90:c<-Mt&&(r=-90),f[0]=e,f[1]=n}};function d(t,a){u.push(f=[e=t,n=t]),a<r&&(r=a),a>i&&(i=a)}function p(t,o){var s=Pr([t*Lt,o*Lt]);if(l){var c=Or(l,s),u=Or([c[1],-c[0],0],c);Rr(u),u=Nr(u);var f=t-a,h=f>0?1:-1,p=u[0]*Ct*h,m=y(f)>180;if(m^(h*a<p&&p<h*t))(v=u[1]*Ct)>i&&(i=v);else if(m^(h*a<(p=(p+360)%360-180)&&p<h*t)){var v;(v=-u[1]*Ct)<r&&(r=v)}else o<r&&(r=o),o>i&&(i=o);m?t<a?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t):n>=e?(t<e&&(e=t),t>n&&(n=t)):t>a?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t)}else d(t,o);l=s,a=t}function m(){h.point=p}function v(){f[0]=e,f[1]=n,h.point=d,l=null}function g(t,e){if(l){var r=t-a;c+=y(r)>180?r+(r>0?360:-360):r}else o=t,s=e;Lr.point(t,e),p(t,e)}function b(){Lr.lineStart()}function x(){g(o,s),Lr.lineEnd(),y(c)>Mt&&(e=-(n=180)),f[0]=e,f[1]=n,l=null}function _(t,e){return(e-=t)<0?e+360:e}function w(t,e){return t[0]-e[0]}function M(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}return function(a){if(i=n=-(e=r=1/0),u=[],t.geo.stream(a,h),c=u.length){u.sort(w);for(var o=1,s=[m=u[0]];o<c;++o)M((d=u[o])[0],m)||M(d[1],m)?(_(m[0],d[1])>_(m[0],m[1])&&(m[1]=d[1]),_(d[0],m[1])>_(m[0],m[1])&&(m[0]=d[0])):s.push(m=d);for(var l,c,d,p=-1/0,m=(o=0,s[c=s.length-1]);o<=c;m=d,++o)d=s[o],(l=_(m[1],d[0]))>p&&(p=l,e=d[0],n=m[1])}return u=f=null,e===1/0||r===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,r],[n,i]]}}(),t.geo.centroid=function(e){gr=yr=br=xr=_r=wr=Mr=kr=Ar=Tr=Er=0,t.geo.stream(e,jr);var r=Ar,n=Tr,i=Er,a=r*r+n*n+i*i;return a<kt&&(r=wr,n=Mr,i=kr,yr<Mt&&(r=br,n=xr,i=_r),(a=r*r+n*n+i*i)<kt)?[NaN,NaN]:[Math.atan2(n,r)*Ct,Dt(i/Math.sqrt(a))*Ct]};var jr={sphere:I,point:Br,lineStart:Vr,lineEnd:qr,polygonStart:function(){jr.lineStart=Hr},polygonEnd:function(){jr.lineStart=Vr}};function Br(t,e){t*=Lt;var r=Math.cos(e*=Lt);Ur(r*Math.cos(t),r*Math.sin(t),Math.sin(e))}function Ur(t,e,r){br+=(t-br)/++gr,xr+=(e-xr)/gr,_r+=(r-_r)/gr}function Vr(){var t,e,r;function n(n,i){n*=Lt;var a=Math.cos(i*=Lt),o=a*Math.cos(n),s=a*Math.sin(n),l=Math.sin(i),c=Math.atan2(Math.sqrt((c=e*l-r*s)*c+(c=r*o-t*l)*c+(c=t*s-e*o)*c),t*o+e*s+r*l);yr+=c,wr+=c*(t+(t=o)),Mr+=c*(e+(e=s)),kr+=c*(r+(r=l)),Ur(t,e,r)}jr.point=function(i,a){i*=Lt;var o=Math.cos(a*=Lt);t=o*Math.cos(i),e=o*Math.sin(i),r=Math.sin(a),jr.point=n,Ur(t,e,r)}}function qr(){jr.point=Br}function Hr(){var t,e,r,n,i;function a(t,e){t*=Lt;var a=Math.cos(e*=Lt),o=a*Math.cos(t),s=a*Math.sin(t),l=Math.sin(e),c=n*l-i*s,u=i*o-r*l,f=r*s-n*o,h=Math.sqrt(c*c+u*u+f*f),d=r*o+n*s+i*l,p=h&&-Ot(d)/h,m=Math.atan2(h,d);Ar+=p*c,Tr+=p*u,Er+=p*f,yr+=m,wr+=m*(r+(r=o)),Mr+=m*(n+(n=s)),kr+=m*(i+(i=l)),Ur(r,n,i)}jr.point=function(o,s){t=o,e=s,jr.point=a,o*=Lt;var l=Math.cos(s*=Lt);r=l*Math.cos(o),n=l*Math.sin(o),i=Math.sin(s),Ur(r,n,i)},jr.lineEnd=function(){a(t,e),jr.lineEnd=qr,jr.point=Br}}function Gr(t,e){function r(r,n){return r=t(r,n),e(r[0],r[1])}return t.invert&&e.invert&&(r.invert=function(r,n){return(r=e.invert(r,n))&&t.invert(r[0],r[1])}),r}function Yr(){return!0}function Wr(t,e,r,n,i){var a=[],o=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,r=t[0],n=t[e];if(Fr(r,n)){i.lineStart();for(var s=0;s<e;++s)i.point((r=t[s])[0],r[1]);i.lineEnd()}else{var l=new Zr(r,t,null,!0),c=new Zr(r,null,l,!1);l.o=c,a.push(l),o.push(c),c=new Zr(n,null,l=new Zr(n,t,null,!1),!0),l.o=c,a.push(l),o.push(c)}}}),o.sort(e),Xr(a),Xr(o),a.length){for(var s=0,l=r,c=o.length;s<c;++s)o[s].e=l=!l;for(var u,f,h=a[0];;){for(var d=h,p=!0;d.v;)if((d=d.n)===h)return;u=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(p)for(s=0,c=u.length;s<c;++s)i.point((f=u[s])[0],f[1]);else n(d.x,d.n.x,1,i);d=d.n}else{if(p)for(s=(u=d.p.z).length-1;s>=0;--s)i.point((f=u[s])[0],f[1]);else n(d.x,d.p.x,-1,i);d=d.p}u=(d=d.o).z,p=!p}while(!d.v);i.lineEnd()}}}function Xr(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n<e;)i.n=r=t[n],r.p=i,i=r;i.n=r=t[0],r.p=i}}function Zr(t,e,r,n){this.x=t,this.z=e,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function Jr(e,r,n,i){return function(a,o){var s,l=r(o),c=a.invert(i[0],i[1]),u={point:f,lineStart:d,lineEnd:p,polygonStart:function(){u.point=x,u.lineStart=_,u.lineEnd=w,s=[],m=[]},polygonEnd:function(){u.point=f,u.lineStart=d,u.lineEnd=p,s=t.merge(s);var e=function(t,e){var r=t[0],n=t[1],i=[Math.sin(r),-Math.cos(r),0],a=0,o=0;Sr.reset();for(var s=0,l=e.length;s<l;++s){var c=e[s],u=c.length;if(u)for(var f=c[0],h=f[0],d=f[1]/2+At/4,p=Math.sin(d),m=Math.cos(d),v=1;;){v===u&&(v=0);var g=(t=c[v])[0],y=t[1]/2+At/4,b=Math.sin(y),x=Math.cos(y),_=g-h,w=_>=0?1:-1,M=w*_,k=M>At,A=p*b;if(Sr.add(Math.atan2(A*w*Math.sin(M),m*x+A*Math.cos(M))),a+=k?_+w*Tt:_,k^h>=r^g>=r){var T=Or(Pr(f),Pr(t));Rr(T);var E=Or(i,T);Rr(E);var S=(k^_>=0?-1:1)*Dt(E[2]);(n>S||n===S&&(T[0]||T[1]))&&(o+=k^_>=0?1:-1)}if(!v++)break;h=g,p=b,m=x,f=t}}return(a<-Mt||a<Mt&&Sr<-Mt)^1&o}(c,m);s.length?(b||(o.polygonStart(),b=!0),Wr(s,$r,e,n,o)):e&&(b||(o.polygonStart(),b=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),b&&(o.polygonEnd(),b=!1),s=m=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function f(t,r){var n=a(t,r);e(t=n[0],r=n[1])&&o.point(t,r)}function h(t,e){var r=a(t,e);l.point(r[0],r[1])}function d(){u.point=h,l.lineStart()}function p(){u.point=f,l.lineEnd()}var m,v,g=Qr(),y=r(g),b=!1;function x(t,e){v.push([t,e]);var r=a(t,e);y.point(r[0],r[1])}function _(){y.lineStart(),v=[]}function w(){x(v[0][0],v[0][1]),y.lineEnd();var t,e=y.clean(),r=g.buffer(),n=r.length;if(v.pop(),m.push(v),v=null,n)if(1&e){var i,a=-1;if((n=(t=r[0]).length-1)>0){for(b||(o.polygonStart(),b=!0),o.lineStart();++a<n;)o.point((i=t[a])[0],i[1]);o.lineEnd()}}else n>1&&2&e&&r.push(r.pop().concat(r.shift())),s.push(r.filter(Kr))}return u}}function Kr(t){return t.length>1}function Qr(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:I,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function $r(t,e){return((t=t.x)[0]<0?t[1]-St-Mt:St-t[1])-((e=e.x)[0]<0?e[1]-St-Mt:St-e[1])}var tn=Jr(Yr,function(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?At:-At,l=y(a-r);y(l-At)<Mt?(t.point(r,n=(n+o)/2>0?St:-St),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=At&&(y(r-i)<Mt&&(r-=i*Mt),y(a-s)<Mt&&(a-=s*Mt),n=function(t,e,r,n){var i,a,o=Math.sin(t-r);return y(o)>Mt?Math.atan((Math.sin(e)*(a=Math.cos(n))*Math.sin(r)-Math.sin(n)*(i=Math.cos(e))*Math.sin(t))/(i*a*o)):(e+n)/2}(r,n,a,o),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=a,n=o),i=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}},function(t,e,r,n){var i;if(null==t)i=r*St,n.point(-At,i),n.point(0,i),n.point(At,i),n.point(At,0),n.point(At,-i),n.point(0,-i),n.point(-At,-i),n.point(-At,0),n.point(-At,i);else if(y(t[0]-e[0])>Mt){var a=t[0]<e[0]?At:-At;i=r*a/2,n.point(-a,i),n.point(0,i),n.point(a,i)}else n.point(e[0],e[1])},[-At,-At/2]);function en(t,e,r,n){return function(i){var a,o=i.a,s=i.b,l=o.x,c=o.y,u=0,f=1,h=s.x-l,d=s.y-c;if(a=t-l,h||!(a>0)){if(a/=h,h<0){if(a<u)return;a<f&&(f=a)}else if(h>0){if(a>f)return;a>u&&(u=a)}if(a=r-l,h||!(a<0)){if(a/=h,h<0){if(a>f)return;a>u&&(u=a)}else if(h>0){if(a<u)return;a<f&&(f=a)}if(a=e-c,d||!(a>0)){if(a/=d,d<0){if(a<u)return;a<f&&(f=a)}else if(d>0){if(a>f)return;a>u&&(u=a)}if(a=n-c,d||!(a<0)){if(a/=d,d<0){if(a>f)return;a>u&&(u=a)}else if(d>0){if(a<u)return;a<f&&(f=a)}return u>0&&(i.a={x:l+u*h,y:c+u*d}),f<1&&(i.b={x:l+f*h,y:c+f*d}),i}}}}}}var rn=1e9;function nn(e,r,n,i){return function(l){var c,u,f,h,d,p,m,v,g,y,b,x=l,_=Qr(),w=en(e,r,n,i),M={point:T,lineStart:function(){M.point=E,u&&u.push(f=[]);y=!0,g=!1,m=v=NaN},lineEnd:function(){c&&(E(h,d),p&&g&&_.rejoin(),c.push(_.buffer()));M.point=T,g&&l.lineEnd()},polygonStart:function(){l=_,c=[],u=[],b=!0},polygonEnd:function(){l=x,c=t.merge(c);var r=function(t){for(var e=0,r=u.length,n=t[1],i=0;i<r;++i)for(var a,o=1,s=u[i],l=s.length,c=s[0];o<l;++o)a=s[o],c[1]<=n?a[1]>n&&zt(c,a,t)>0&&++e:a[1]<=n&&zt(c,a,t)<0&&--e,c=a;return 0!==e}([e,i]),n=b&&r,a=c.length;(n||a)&&(l.polygonStart(),n&&(l.lineStart(),k(null,null,1,l),l.lineEnd()),a&&Wr(c,o,r,k,l),l.polygonEnd()),c=u=f=null}};function k(t,o,l,c){var u=0,f=0;if(null==t||(u=a(t,l))!==(f=a(o,l))||s(t,o)<0^l>0)do{c.point(0===u||3===u?e:n,u>1?i:r)}while((u=(u+l+4)%4)!==f);else c.point(o[0],o[1])}function A(t,a){return e<=t&&t<=n&&r<=a&&a<=i}function T(t,e){A(t,e)&&l.point(t,e)}function E(t,e){var r=A(t=Math.max(-rn,Math.min(rn,t)),e=Math.max(-rn,Math.min(rn,e)));if(u&&f.push([t,e]),y)h=t,d=e,p=r,y=!1,r&&(l.lineStart(),l.point(t,e));else if(r&&g)l.point(t,e);else{var n={a:{x:m,y:v},b:{x:t,y:e}};w(n)?(g||(l.lineStart(),l.point(n.a.x,n.a.y)),l.point(n.b.x,n.b.y),r||l.lineEnd(),b=!1):r&&(l.lineStart(),l.point(t,e),b=!1)}m=t,v=e,g=r}return M};function a(t,i){return y(t[0]-e)<Mt?i>0?0:3:y(t[0]-n)<Mt?i>0?2:1:y(t[1]-r)<Mt?i>0?1:0:i>0?3:2}function o(t,e){return s(t.x,e.x)}function s(t,e){var r=a(t,1),n=a(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}}function an(t){var e=0,r=At/3,n=En(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*At/180,r=t[1]*At/180):[e/At*180,r/At*180]},i}function on(t,e){var r=Math.sin(t),n=(r+Math.sin(e))/2,i=1+r*(2*n-r),a=Math.sqrt(i)/n;function o(t,e){var r=Math.sqrt(i-2*n*Math.sin(e))/n;return[r*Math.sin(t*=n),a-r*Math.cos(t)]}return o.invert=function(t,e){var r=a-e;return[Math.atan2(t,r)/n,Dt((i-(t*t+r*r)*n*n)/(2*n))]},o}t.geo.clipExtent=function(){var t,e,r,n,i,a,o={stream:function(t){return i&&(i.valid=!1),(i=a(t)).valid=!0,i},extent:function(s){return arguments.length?(a=nn(t=+s[0][0],e=+s[0][1],r=+s[1][0],n=+s[1][1]),i&&(i.valid=!1,i=null),o):[[t,e],[r,n]]}};return o.extent([[0,0],[960,500]])},(t.geo.conicEqualArea=function(){return an(on)}).raw=on,t.geo.albers=function(){return t.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},t.geo.albersUsa=function(){var e,r,n,i,a=t.geo.albers(),o=t.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=t.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,r){e=[t,r]}};function c(t){var a=t[0],o=t[1];return e=null,r(a,o),e||(n(a,o),e)||i(a,o),e}return c.invert=function(t){var e=a.scale(),r=a.translate(),n=(t[0]-r[0])/e,i=(t[1]-r[1])/e;return(i>=.12&&i<.234&&n>=-.425&&n<-.214?o:i>=.166&&i<.234&&n>=-.214&&n<-.115?s:a).invert(t)},c.stream=function(t){var e=a.stream(t),r=o.stream(t),n=s.stream(t);return{point:function(t,i){e.point(t,i),r.point(t,i),n.point(t,i)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},c.precision=function(t){return arguments.length?(a.precision(t),o.precision(t),s.precision(t),c):a.precision()},c.scale=function(t){return arguments.length?(a.scale(t),o.scale(.35*t),s.scale(t),c.translate(a.translate())):a.scale()},c.translate=function(t){if(!arguments.length)return a.translate();var e=a.scale(),u=+t[0],f=+t[1];return r=a.translate(t).clipExtent([[u-.455*e,f-.238*e],[u+.455*e,f+.238*e]]).stream(l).point,n=o.translate([u-.307*e,f+.201*e]).clipExtent([[u-.425*e+Mt,f+.12*e+Mt],[u-.214*e-Mt,f+.234*e-Mt]]).stream(l).point,i=s.translate([u-.205*e,f+.212*e]).clipExtent([[u-.214*e+Mt,f+.166*e+Mt],[u-.115*e-Mt,f+.234*e-Mt]]).stream(l).point,c},c.scale(1070)};var sn,ln,cn,un,fn,hn,dn={point:I,lineStart:I,lineEnd:I,polygonStart:function(){ln=0,dn.lineStart=pn},polygonEnd:function(){dn.lineStart=dn.lineEnd=dn.point=I,sn+=y(ln/2)}};function pn(){var t,e,r,n;function i(t,e){ln+=n*t-r*e,r=t,n=e}dn.point=function(a,o){dn.point=i,t=r=a,e=n=o},dn.lineEnd=function(){i(t,e)}}var mn={point:function(t,e){t<cn&&(cn=t);t>fn&&(fn=t);e<un&&(un=e);e>hn&&(hn=e)},lineStart:I,lineEnd:I,polygonStart:I,polygonEnd:I};function vn(t){return\"m0,\"+t+\"a\"+t+\",\"+t+\" 0 1,1 0,\"+-2*t+\"a\"+t+\",\"+t+\" 0 1,1 0,\"+2*t+\"z\"}var gn,yn={point:bn,lineStart:xn,lineEnd:_n,polygonStart:function(){yn.lineStart=wn},polygonEnd:function(){yn.point=bn,yn.lineStart=xn,yn.lineEnd=_n}};function bn(t,e){br+=t,xr+=e,++_r}function xn(){var t,e;function r(r,n){var i=r-t,a=n-e,o=Math.sqrt(i*i+a*a);wr+=o*(t+r)/2,Mr+=o*(e+n)/2,kr+=o,bn(t=r,e=n)}yn.point=function(n,i){yn.point=r,bn(t=n,e=i)}}function _n(){yn.point=bn}function wn(){var t,e,r,n;function i(t,e){var i=t-r,a=e-n,o=Math.sqrt(i*i+a*a);wr+=o*(r+t)/2,Mr+=o*(n+e)/2,kr+=o,Ar+=(o=n*t-r*e)*(r+t),Tr+=o*(n+e),Er+=3*o,bn(r=t,n=e)}yn.point=function(a,o){yn.point=i,bn(t=r=a,e=n=o)},yn.lineEnd=function(){i(t,e)}}function Mn(t){var e=.5,r=Math.cos(30*Lt),n=16;function i(e){return(n?function(e){var r,i,o,s,l,c,u,f,h,d,p,m,v={point:g,lineStart:y,lineEnd:x,polygonStart:function(){e.polygonStart(),v.lineStart=_},polygonEnd:function(){e.polygonEnd(),v.lineStart=y}};function g(r,n){r=t(r,n),e.point(r[0],r[1])}function y(){f=NaN,v.point=b,e.lineStart()}function b(r,i){var o=Pr([r,i]),s=t(r,i);a(f,h,u,d,p,m,f=s[0],h=s[1],u=r,d=o[0],p=o[1],m=o[2],n,e),e.point(f,h)}function x(){v.point=g,e.lineEnd()}function _(){y(),v.point=w,v.lineEnd=M}function w(t,e){b(r=t,e),i=f,o=h,s=d,l=p,c=m,v.point=b}function M(){a(f,h,u,d,p,m,i,o,r,s,l,c,n,e),v.lineEnd=x,x()}return v}:function(e){return An(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})})(e)}function a(n,i,o,s,l,c,u,f,h,d,p,m,v,g){var b=u-n,x=f-i,_=b*b+x*x;if(_>4*e&&v--){var w=s+d,M=l+p,k=c+m,A=Math.sqrt(w*w+M*M+k*k),T=Math.asin(k/=A),E=y(y(k)-1)<Mt||y(o-h)<Mt?(o+h)/2:Math.atan2(M,w),S=t(E,T),L=S[0],C=S[1],P=L-n,z=C-i,O=x*P-b*z;(O*O/_>e||y((b*P+x*z)/_-.5)>.3||s*d+l*p+c*m<r)&&(a(n,i,o,s,l,c,L,C,E,w/=A,M/=A,k,v,g),g.point(L,C),a(L,C,E,w,M,k,u,f,h,d,p,m,v,g))}}return i.precision=function(t){return arguments.length?(n=(e=t*t)>0&&16,i):Math.sqrt(e)},i}function kn(t){this.stream=t}function An(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function Tn(t){return En(function(){return t})()}function En(e){var r,n,i,a,o,s,l=Mn(function(t,e){return[(t=r(t,e))[0]*c+a,o-t[1]*c]}),c=150,u=480,f=250,h=0,d=0,p=0,m=0,v=0,g=tn,b=P,x=null,_=null;function w(t){return[(t=i(t[0]*Lt,t[1]*Lt))[0]*c+a,o-t[1]*c]}function M(t){return(t=i.invert((t[0]-a)/c,(o-t[1])/c))&&[t[0]*Ct,t[1]*Ct]}function k(){i=Gr(n=Pn(p,m,v),r);var t=r(h,d);return a=u-t[0]*c,o=f+t[1]*c,A()}function A(){return s&&(s.valid=!1,s=null),w}return w.stream=function(t){return s&&(s.valid=!1),(s=Sn(g(n,l(b(t))))).valid=!0,s},w.clipAngle=function(t){return arguments.length?(g=null==t?(x=t,tn):function(t){var e=Math.cos(t),r=e>0,n=y(e)>Mt;return Jr(i,function(t){var e,s,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(f,h){var d,p=[f,h],m=i(f,h),v=r?m?0:o(f,h):m?o(f+(f<0?At:-At),h):0;if(!e&&(c=l=m)&&t.lineStart(),m!==l&&(d=a(e,p),(Fr(e,d)||Fr(p,d))&&(p[0]+=Mt,p[1]+=Mt,m=i(p[0],p[1]))),m!==l)u=0,m?(t.lineStart(),d=a(p,e),t.point(d[0],d[1])):(d=a(e,p),t.point(d[0],d[1]),t.lineEnd()),e=d;else if(n&&e&&r^m){var g;v&s||!(g=a(p,e,!0))||(u=0,r?(t.lineStart(),t.point(g[0][0],g[0][1]),t.point(g[1][0],g[1][1]),t.lineEnd()):(t.point(g[1][0],g[1][1]),t.lineEnd(),t.lineStart(),t.point(g[0][0],g[0][1])))}!m||e&&Fr(e,p)||t.point(p[0],p[1]),e=p,l=m,s=v},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return u|(c&&l)<<1}}},In(t,6*Lt),r?[0,-t]:[-At,t-At]);function i(t,r){return Math.cos(t)*Math.cos(r)>e}function a(t,r,n){var i=[1,0,0],a=Or(Pr(t),Pr(r)),o=zr(a,a),s=a[0],l=o-s*s;if(!l)return!n&&t;var c=e*o/l,u=-e*s/l,f=Or(i,a),h=Ir(i,c);Dr(h,Ir(a,u));var d=f,p=zr(h,d),m=zr(d,d),v=p*p-m*(zr(h,h)-1);if(!(v<0)){var g=Math.sqrt(v),b=Ir(d,(-p-g)/m);if(Dr(b,h),b=Nr(b),!n)return b;var x,_=t[0],w=r[0],M=t[1],k=r[1];w<_&&(x=_,_=w,w=x);var A=w-_,T=y(A-At)<Mt;if(!T&&k<M&&(x=M,M=k,k=x),T||A<Mt?T?M+k>0^b[1]<(y(b[0]-_)<Mt?M:k):M<=b[1]&&b[1]<=k:A>At^(_<=b[0]&&b[0]<=w)){var E=Ir(d,(-p+g)/m);return Dr(E,h),[b,Nr(E)]}}}function o(e,n){var i=r?t:At-t,a=0;return e<-i?a|=1:e>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}}((x=+t)*Lt),A()):x},w.clipExtent=function(t){return arguments.length?(_=t,b=t?nn(t[0][0],t[0][1],t[1][0],t[1][1]):P,A()):_},w.scale=function(t){return arguments.length?(c=+t,k()):c},w.translate=function(t){return arguments.length?(u=+t[0],f=+t[1],k()):[u,f]},w.center=function(t){return arguments.length?(h=t[0]%360*Lt,d=t[1]%360*Lt,k()):[h*Ct,d*Ct]},w.rotate=function(t){return arguments.length?(p=t[0]%360*Lt,m=t[1]%360*Lt,v=t.length>2?t[2]%360*Lt:0,k()):[p*Ct,m*Ct,v*Ct]},t.rebind(w,l,\"precision\"),function(){return r=e.apply(this,arguments),w.invert=r.invert&&M,k()}}function Sn(t){return An(t,function(e,r){t.point(e*Lt,r*Lt)})}function Ln(t,e){return[t,e]}function Cn(t,e){return[t>At?t-Tt:t<-At?t+Tt:t,e]}function Pn(t,e,r){return t?e||r?Gr(On(t),Dn(e,r)):On(t):e||r?Dn(e,r):Cn}function zn(t){return function(e,r){return[(e+=t)>At?e-Tt:e<-At?e+Tt:e,r]}}function On(t){var e=zn(t);return e.invert=zn(-t),e}function Dn(t,e){var r=Math.cos(t),n=Math.sin(t),i=Math.cos(e),a=Math.sin(e);function o(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,c=Math.sin(e),u=c*r+s*n;return[Math.atan2(l*i-u*a,s*r-c*n),Dt(u*i+l*a)]}return o.invert=function(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,c=Math.sin(e),u=c*i-l*a;return[Math.atan2(l*i+c*a,s*r+u*n),Dt(u*r-s*n)]},o}function In(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=Rn(r,i),a=Rn(r,a),(o>0?i<a:i>a)&&(i+=o*Tt)):(i=t+o*Tt,a=t-.5*l);for(var c,u=i;o>0?u>a:u<a;u-=l)s.point((c=Nr([r,-n*Math.cos(u),-n*Math.sin(u)]))[0],c[1])}}function Rn(t,e){var r=Pr(e);r[0]-=t,Rr(r);var n=Ot(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-Mt)%(2*Math.PI)}function Nn(e,r,n){var i=t.range(e,r-Mt,n).concat(r);return function(t){return i.map(function(e){return[t,e]})}}function Fn(e,r,n){var i=t.range(e,r-Mt,n).concat(r);return function(t){return i.map(function(e){return[e,t]})}}function jn(t){return t.source}function Bn(t){return t.target}t.geo.path=function(){var e,r,n,i,a,o=4.5;function s(e){return e&&(\"function\"==typeof o&&i.pointRadius(+o.apply(this,arguments)),a&&a.valid||(a=n(i)),t.geo.stream(e,a)),i.result()}function l(){return a=null,s}return s.area=function(e){return sn=0,t.geo.stream(e,n(dn)),sn},s.centroid=function(e){return br=xr=_r=wr=Mr=kr=Ar=Tr=Er=0,t.geo.stream(e,n(yn)),Er?[Ar/Er,Tr/Er]:kr?[wr/kr,Mr/kr]:_r?[br/_r,xr/_r]:[NaN,NaN]},s.bounds=function(e){return fn=hn=-(cn=un=1/0),t.geo.stream(e,n(mn)),[[cn,un],[fn,hn]]},s.projection=function(t){return arguments.length?(n=(e=t)?t.stream||(r=t,i=Mn(function(t,e){return r([t*Ct,e*Ct])}),function(t){return Sn(i(t))}):P,l()):e;var r,i},s.context=function(t){return arguments.length?(i=null==(r=t)?new function(){var t=vn(4.5),e=[],r={point:n,lineStart:function(){r.point=i},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(e){return t=vn(e),r},result:function(){if(e.length){var t=e.join(\"\");return e=[],t}}};function n(r,n){e.push(\"M\",r,\",\",n,t)}function i(t,n){e.push(\"M\",t,\",\",n),r.point=a}function a(t,r){e.push(\"L\",t,\",\",r)}function o(){r.point=n}function s(){e.push(\"Z\")}return r}:new function(t){var e=4.5,r={point:n,lineStart:function(){r.point=i},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(t){return e=t,r},result:I};function n(r,n){t.moveTo(r+e,n),t.arc(r,n,e,0,Tt)}function i(e,n){t.moveTo(e,n),r.point=a}function a(e,r){t.lineTo(e,r)}function o(){r.point=n}function s(){t.closePath()}return r}(t),\"function\"!=typeof o&&i.pointRadius(o),l()):r},s.pointRadius=function(t){return arguments.length?(o=\"function\"==typeof t?t:(i.pointRadius(+t),+t),s):o},s.projection(t.geo.albersUsa()).context(null)},t.geo.transform=function(t){return{stream:function(e){var r=new kn(e);for(var n in t)r[n]=t[n];return r}}},kn.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},t.geo.projection=Tn,t.geo.projectionMutator=En,(t.geo.equirectangular=function(){return Tn(Ln)}).raw=Ln.invert=Ln,t.geo.rotation=function(t){function e(e){return(e=t(e[0]*Lt,e[1]*Lt))[0]*=Ct,e[1]*=Ct,e}return t=Pn(t[0]%360*Lt,t[1]*Lt,t.length>2?t[2]*Lt:0),e.invert=function(e){return(e=t.invert(e[0]*Lt,e[1]*Lt))[0]*=Ct,e[1]*=Ct,e},e},Cn.invert=Ln,t.geo.circle=function(){var t,e,r=[0,0],n=6;function i(){var t=\"function\"==typeof r?r.apply(this,arguments):r,n=Pn(-t[0]*Lt,-t[1]*Lt,0).invert,i=[];return e(null,null,1,{point:function(t,e){i.push(t=n(t,e)),t[0]*=Ct,t[1]*=Ct}}),{type:\"Polygon\",coordinates:[i]}}return i.origin=function(t){return arguments.length?(r=t,i):r},i.angle=function(r){return arguments.length?(e=In((t=+r)*Lt,n*Lt),i):t},i.precision=function(r){return arguments.length?(e=In(t*Lt,(n=+r)*Lt),i):n},i.angle(90)},t.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Lt,i=t[1]*Lt,a=e[1]*Lt,o=Math.sin(n),s=Math.cos(n),l=Math.sin(i),c=Math.cos(i),u=Math.sin(a),f=Math.cos(a);return Math.atan2(Math.sqrt((r=f*o)*r+(r=c*u-l*f*s)*r),l*u+c*f*s)},t.geo.graticule=function(){var e,r,n,i,a,o,s,l,c,u,f,h,d=10,p=d,m=90,v=360,g=2.5;function b(){return{type:\"MultiLineString\",coordinates:x()}}function x(){return t.range(Math.ceil(i/m)*m,n,m).map(f).concat(t.range(Math.ceil(l/v)*v,s,v).map(h)).concat(t.range(Math.ceil(r/d)*d,e,d).filter(function(t){return y(t%m)>Mt}).map(c)).concat(t.range(Math.ceil(o/p)*p,a,p).filter(function(t){return y(t%v)>Mt}).map(u))}return b.lines=function(){return x().map(function(t){return{type:\"LineString\",coordinates:t}})},b.outline=function(){return{type:\"Polygon\",coordinates:[f(i).concat(h(s).slice(1),f(n).reverse().slice(1),h(l).reverse().slice(1))]}},b.extent=function(t){return arguments.length?b.majorExtent(t).minorExtent(t):b.minorExtent()},b.majorExtent=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],l=+t[0][1],s=+t[1][1],i>n&&(t=i,i=n,n=t),l>s&&(t=l,l=s,s=t),b.precision(g)):[[i,l],[n,s]]},b.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],o=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),o>a&&(t=o,o=a,a=t),b.precision(g)):[[r,o],[e,a]]},b.step=function(t){return arguments.length?b.majorStep(t).minorStep(t):b.minorStep()},b.majorStep=function(t){return arguments.length?(m=+t[0],v=+t[1],b):[m,v]},b.minorStep=function(t){return arguments.length?(d=+t[0],p=+t[1],b):[d,p]},b.precision=function(t){return arguments.length?(g=+t,c=Nn(o,a,90),u=Fn(r,e,g),f=Nn(l,s,90),h=Fn(i,n,g),b):g},b.majorExtent([[-180,-90+Mt],[180,90-Mt]]).minorExtent([[-180,-80-Mt],[180,80+Mt]])},t.geo.greatArc=function(){var e,r,n=jn,i=Bn;function a(){return{type:\"LineString\",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}return a.distance=function(){return t.geo.distance(e||n.apply(this,arguments),r||i.apply(this,arguments))},a.source=function(t){return arguments.length?(n=t,e=\"function\"==typeof t?null:t,a):n},a.target=function(t){return arguments.length?(i=t,r=\"function\"==typeof t?null:t,a):i},a.precision=function(){return arguments.length?a:0},a},t.geo.interpolate=function(t,e){return r=t[0]*Lt,n=t[1]*Lt,i=e[0]*Lt,a=e[1]*Lt,o=Math.cos(n),s=Math.sin(n),l=Math.cos(a),c=Math.sin(a),u=o*Math.cos(r),f=o*Math.sin(r),h=l*Math.cos(i),d=l*Math.sin(i),p=2*Math.asin(Math.sqrt(Rt(a-n)+o*l*Rt(i-r))),m=1/Math.sin(p),(v=p?function(t){var e=Math.sin(t*=p)*m,r=Math.sin(p-t)*m,n=r*u+e*h,i=r*f+e*d,a=r*s+e*c;return[Math.atan2(i,n)*Ct,Math.atan2(a,Math.sqrt(n*n+i*i))*Ct]}:function(){return[r*Ct,n*Ct]}).distance=p,v;var r,n,i,a,o,s,l,c,u,f,h,d,p,m,v},t.geo.length=function(e){return gn=0,t.geo.stream(e,Un),gn};var Un={sphere:I,point:I,lineStart:function(){var t,e,r;function n(n,i){var a=Math.sin(i*=Lt),o=Math.cos(i),s=y((n*=Lt)-t),l=Math.cos(s);gn+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=r*a-e*o*l)*s),e*a+r*o*l),t=n,e=a,r=o}Un.point=function(i,a){t=i*Lt,e=Math.sin(a*=Lt),r=Math.cos(a),Un.point=n},Un.lineEnd=function(){Un.point=Un.lineEnd=I}},lineEnd:I,polygonStart:I,polygonEnd:I};function Vn(t,e){function r(e,r){var n=Math.cos(e),i=Math.cos(r),a=t(n*i);return[a*i*Math.sin(e),a*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),i=e(n),a=Math.sin(i),o=Math.cos(i);return[Math.atan2(t*a,n*o),Math.asin(n&&r*a/n)]},r}var qn=Vn(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(t.geo.azimuthalEqualArea=function(){return Tn(qn)}).raw=qn;var Hn=Vn(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},P);function Gn(t,e){var r=Math.cos(t),n=function(t){return Math.tan(At/4+t/2)},i=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(n(e)/n(t)),a=r*Math.pow(n(t),i)/i;if(!i)return Xn;function o(t,e){a>0?e<-St+Mt&&(e=-St+Mt):e>St-Mt&&(e=St-Mt);var r=a/Math.pow(n(e),i);return[r*Math.sin(i*t),a-r*Math.cos(i*t)]}return o.invert=function(t,e){var r=a-e,n=Pt(i)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/i,2*Math.atan(Math.pow(a/n,1/i))-St]},o}function Yn(t,e){var r=Math.cos(t),n=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),i=r/n+t;if(y(n)<Mt)return Ln;function a(t,e){var r=i-e;return[r*Math.sin(n*t),i-r*Math.cos(n*t)]}return a.invert=function(t,e){var r=i-e;return[Math.atan2(t,r)/n,i-Pt(n)*Math.sqrt(t*t+r*r)]},a}(t.geo.azimuthalEquidistant=function(){return Tn(Hn)}).raw=Hn,(t.geo.conicConformal=function(){return an(Gn)}).raw=Gn,(t.geo.conicEquidistant=function(){return an(Yn)}).raw=Yn;var Wn=Vn(function(t){return 1/t},Math.atan);function Xn(t,e){return[t,Math.log(Math.tan(At/4+e/2))]}function Zn(t){var e,r=Tn(t),n=r.scale,i=r.translate,a=r.clipExtent;return r.scale=function(){var t=n.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.translate=function(){var t=i.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.clipExtent=function(t){var o=a.apply(r,arguments);if(o===r){if(e=null==t){var s=At*n(),l=i();a([[l[0]-s,l[1]-s],[l[0]+s,l[1]+s]])}}else e&&(o=null);return o},r.clipExtent(null)}(t.geo.gnomonic=function(){return Tn(Wn)}).raw=Wn,Xn.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-St]},(t.geo.mercator=function(){return Zn(Xn)}).raw=Xn;var Jn=Vn(function(){return 1},Math.asin);(t.geo.orthographic=function(){return Tn(Jn)}).raw=Jn;var Kn=Vn(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});function Qn(t,e){return[Math.log(Math.tan(At/4+e/2)),-t]}function $n(t){return t[0]}function ti(t){return t[1]}function ei(t){for(var e=t.length,r=[0,1],n=2,i=2;i<e;i++){for(;n>1&&zt(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function ri(t,e){return t[0]-e[0]||t[1]-e[1]}(t.geo.stereographic=function(){return Tn(Kn)}).raw=Kn,Qn.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-St]},(t.geo.transverseMercator=function(){var t=Zn(Qn),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90])}).raw=Qn,t.geom={},t.geom.hull=function(t){var e=$n,r=ti;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,i=ve(e),a=ve(r),o=t.length,s=[],l=[];for(n=0;n<o;n++)s.push([+i.call(this,t[n],n),+a.call(this,t[n],n),n]);for(s.sort(ri),n=0;n<o;n++)l.push([s[n][0],-s[n][1]]);var c=ei(s),u=ei(l),f=u[0]===c[0],h=u[u.length-1]===c[c.length-1],d=[];for(n=c.length-1;n>=0;--n)d.push(t[s[c[n]][2]]);for(n=+f;n<u.length-h;++n)d.push(t[s[u[n]][2]]);return d}return n.x=function(t){return arguments.length?(e=t,n):e},n.y=function(t){return arguments.length?(r=t,n):r},n},t.geom.polygon=function(t){return V(t,ni),t};var ni=t.geom.polygon.prototype=[];function ii(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function ai(t,e,r,n){var i=t[0],a=r[0],o=e[0]-i,s=n[0]-a,l=t[1],c=r[1],u=e[1]-l,f=n[1]-c,h=(s*(l-c)-f*(i-a))/(f*o-s*u);return[i+h*o,l+h*u]}function oi(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}ni.area=function(){for(var t,e=-1,r=this.length,n=this[r-1],i=0;++e<r;)t=n,n=this[e],i+=t[1]*n[0]-t[0]*n[1];return.5*i},ni.centroid=function(t){var e,r,n=-1,i=this.length,a=0,o=0,s=this[i-1];for(arguments.length||(t=-1/(6*this.area()));++n<i;)e=s,s=this[n],r=e[0]*s[1]-s[0]*e[1],a+=(e[0]+s[0])*r,o+=(e[1]+s[1])*r;return[a*t,o*t]},ni.clip=function(t){for(var e,r,n,i,a,o,s=oi(t),l=-1,c=this.length-oi(this),u=this[c-1];++l<c;){for(e=t.slice(),t.length=0,i=this[l],a=e[(n=e.length-s)-1],r=-1;++r<n;)ii(o=e[r],u,i)?(ii(a,u,i)||t.push(ai(a,o,u,i)),t.push(o)):ii(a,u,i)&&t.push(ai(a,o,u,i)),a=o;s&&t.push(t[0]),u=i}return t};var si,li,ci,ui,fi,hi=[],di=[];function pi(t){var e=hi.pop()||new function(){Ci(this),this.edge=this.site=this.circle=null};return e.site=t,e}function mi(t){Mi(t),ci.remove(t),hi.push(t),Ci(t)}function vi(t){var e=t.circle,r=e.x,n=e.cy,i={x:r,y:n},a=t.P,o=t.N,s=[t];mi(t);for(var l=a;l.circle&&y(r-l.circle.x)<Mt&&y(n-l.circle.cy)<Mt;)a=l.P,s.unshift(l),mi(l),l=a;s.unshift(l),Mi(l);for(var c=o;c.circle&&y(r-c.circle.x)<Mt&&y(n-c.circle.cy)<Mt;)o=c.N,s.push(c),mi(c),c=o;s.push(c),Mi(c);var u,f=s.length;for(u=1;u<f;++u)c=s[u],l=s[u-1],Ei(c.edge,l.site,c.site,i);l=s[0],(c=s[f-1]).edge=Ti(l.site,c.site,null,i),wi(l),wi(c)}function gi(t){for(var e,r,n,i,a=t.x,o=t.y,s=ci._;s;)if((n=yi(s,o)-a)>Mt)s=s.L;else{if(!((i=a-bi(s,o))>Mt)){n>-Mt?(e=s.P,r=s):i>-Mt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=pi(t);if(ci.insert(e,l),e||r){if(e===r)return Mi(e),r=pi(e.site),ci.insert(l,r),l.edge=r.edge=Ti(e.site,l.site),wi(e),void wi(r);if(r){Mi(e),Mi(r);var c=e.site,u=c.x,f=c.y,h=t.x-u,d=t.y-f,p=r.site,m=p.x-u,v=p.y-f,g=2*(h*v-d*m),y=h*h+d*d,b=m*m+v*v,x={x:(v*y-d*b)/g+u,y:(h*b-m*y)/g+f};Ei(r.edge,c,p,x),l.edge=Ti(c,t,null,x),r.edge=Ti(t,p,null,x),wi(e),wi(r)}else l.edge=Ti(e.site,l.site)}}function yi(t,e){var r=t.site,n=r.x,i=r.y,a=i-e;if(!a)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,c=l-e;if(!c)return s;var u=s-n,f=1/a-1/c,h=u/c;return f?(-h+Math.sqrt(h*h-2*f*(u*u/(-2*c)-l+c/2+i-a/2)))/f+n:(n+s)/2}function bi(t,e){var r=t.N;if(r)return yi(r,e);var n=t.site;return n.y===e?n.x:1/0}function xi(t){this.site=t,this.edges=[]}function _i(t,e){return e.angle-t.angle}function wi(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,i=t.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,c=n.y-s,u=a.x-o,f=2*(l*(v=a.y-s)-c*u);if(!(f>=-kt)){var h=l*l+c*c,d=u*u+v*v,p=(v*h-c*d)/f,m=(l*d-u*h)/f,v=m+s,g=di.pop()||new function(){Ci(this),this.x=this.y=this.arc=this.site=this.cy=null};g.arc=t,g.site=i,g.x=p+o,g.y=v+Math.sqrt(p*p+m*m),g.cy=v,t.circle=g;for(var y=null,b=fi._;b;)if(g.y<b.y||g.y===b.y&&g.x<=b.x){if(!b.L){y=b.P;break}b=b.L}else{if(!b.R){y=b;break}b=b.R}fi.insert(y,g),y||(ui=g)}}}}function Mi(t){var e=t.circle;e&&(e.P||(ui=e.N),fi.remove(e),di.push(e),Ci(e),t.circle=null)}function ki(t,e){var r=t.b;if(r)return!0;var n,i,a=t.a,o=e[0][0],s=e[1][0],l=e[0][1],c=e[1][1],u=t.l,f=t.r,h=u.x,d=u.y,p=f.x,m=f.y,v=(h+p)/2,g=(d+m)/2;if(m===d){if(v<o||v>=s)return;if(h>p){if(a){if(a.y>=c)return}else a={x:v,y:l};r={x:v,y:c}}else{if(a){if(a.y<l)return}else a={x:v,y:c};r={x:v,y:l}}}else if(i=g-(n=(h-p)/(m-d))*v,n<-1||n>1)if(h>p){if(a){if(a.y>=c)return}else a={x:(l-i)/n,y:l};r={x:(c-i)/n,y:c}}else{if(a){if(a.y<l)return}else a={x:(c-i)/n,y:c};r={x:(l-i)/n,y:l}}else if(d<m){if(a){if(a.x>=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.x<o)return}else a={x:s,y:n*s+i};r={x:o,y:n*o+i}}return t.a=a,t.b=r,!0}function Ai(t,e){this.l=t,this.r=e,this.a=this.b=null}function Ti(t,e,r,n){var i=new Ai(t,e);return si.push(i),r&&Ei(i,t,e,r),n&&Ei(i,e,t,n),li[t.i].edges.push(new Si(i,t,e)),li[e.i].edges.push(new Si(i,e,t)),i}function Ei(t,e,r,n){t.a||t.b?t.l===r?t.b=n:t.a=n:(t.a=n,t.l=e,t.r=r)}function Si(t,e,r){var n=t.a,i=t.b;this.edge=t,this.site=e,this.angle=r?Math.atan2(r.y-e.y,r.x-e.x):t.l===e?Math.atan2(i.x-n.x,n.y-i.y):Math.atan2(n.x-i.x,i.y-n.y)}function Li(){this._=null}function Ci(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Pi(t,e){var r=e,n=e.R,i=r.U;i?i.L===r?i.L=n:i.R=n:t._=n,n.U=i,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}function zi(t,e){var r=e,n=e.L,i=r.U;i?i.L===r?i.L=n:i.R=n:t._=n,n.U=i,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}function Oi(t){for(;t.L;)t=t.L;return t}function Di(t,e){var r,n,i,a=t.sort(Ii).pop();for(si=[],li=new Array(t.length),ci=new Li,fi=new Li;;)if(i=ui,a&&(!i||a.y<i.y||a.y===i.y&&a.x<i.x))a.x===r&&a.y===n||(li[a.i]=new xi(a),gi(a),r=a.x,n=a.y),a=t.pop();else{if(!i)break;vi(i.arc)}e&&(function(t){for(var e,r=si,n=en(t[0][0],t[0][1],t[1][0],t[1][1]),i=r.length;i--;)(!ki(e=r[i],t)||!n(e)||y(e.a.x-e.b.x)<Mt&&y(e.a.y-e.b.y)<Mt)&&(e.a=e.b=null,r.splice(i,1))}(e),function(t){for(var e,r,n,i,a,o,s,l,c,u,f=t[0][0],h=t[1][0],d=t[0][1],p=t[1][1],m=li,v=m.length;v--;)if((a=m[v])&&a.prepare())for(l=(s=a.edges).length,o=0;o<l;)n=(u=s[o].end()).x,i=u.y,e=(c=s[++o%l].start()).x,r=c.y,(y(n-e)>Mt||y(i-r)>Mt)&&(s.splice(o,0,new Si((g=a.site,b=u,x=y(n-f)<Mt&&p-i>Mt?{x:f,y:y(e-f)<Mt?r:p}:y(i-p)<Mt&&h-n>Mt?{x:y(r-p)<Mt?e:h,y:p}:y(n-h)<Mt&&i-d>Mt?{x:h,y:y(e-h)<Mt?r:d}:y(i-d)<Mt&&n-f>Mt?{x:y(r-d)<Mt?e:f,y:d}:null,_=void 0,_=new Ai(g,null),_.a=b,_.b=x,si.push(_),_),a.site,null)),++l);var g,b,x,_}(e));var o={cells:li,edges:si};return ci=fi=si=li=null,o}function Ii(t,e){return e.y-t.y||e.x-t.x}xi.prototype.prepare=function(){for(var t,e=this.edges,r=e.length;r--;)(t=e[r].edge).b&&t.a||e.splice(r,1);return e.sort(_i),e.length},Si.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},Li.prototype={insert:function(t,e){var r,n,i;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;r=t}else this._?(t=Oi(this._),e.P=null,e.N=t,t.P=t.L=e,r=t):(e.P=e.N=null,this._=e,r=null);for(e.L=e.R=null,e.U=r,e.C=!0,t=e;r&&r.C;)r===(n=r.U).L?(i=n.R)&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.R&&(Pi(this,r),r=(t=r).U),r.C=!1,n.C=!0,zi(this,n)):(i=n.L)&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.L&&(zi(this,r),r=(t=r).U),r.C=!1,n.C=!0,Pi(this,n)),r=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,r,n,i=t.U,a=t.L,o=t.R;if(r=a?o?Oi(o):a:o,i?i.L===t?i.L=r:i.R=r:this._=r,a&&o?(n=r.C,r.C=t.C,r.L=a,a.U=r,r!==o?(i=r.U,r.U=t.U,t=r.R,i.L=t,r.R=o,o.U=r):(r.U=i,i=r,t=r.R)):(n=t.C,t=r),t&&(t.U=i),!n)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((e=i.R).C&&(e.C=!1,i.C=!0,Pi(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,zi(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,Pi(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,zi(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,Pi(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,zi(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}},t.geom.voronoi=function(t){var e=$n,r=ti,n=e,i=r,a=Ri;if(t)return o(t);function o(t){var e=new Array(t.length),r=a[0][0],n=a[0][1],i=a[1][0],o=a[1][1];return Di(s(t),a).cells.forEach(function(a,s){var l=a.edges,c=a.site;(e[s]=l.length?l.map(function(t){var e=t.start();return[e.x,e.y]}):c.x>=r&&c.x<=i&&c.y>=n&&c.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=t[s]}),e}function s(t){return t.map(function(t,e){return{x:Math.round(n(t,e)/Mt)*Mt,y:Math.round(i(t,e)/Mt)*Mt,i:e}})}return o.links=function(t){return Di(s(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},o.triangles=function(t){var e=[];return Di(s(t)).cells.forEach(function(r,n){for(var i,a,o,s,l=r.site,c=r.edges.sort(_i),u=-1,f=c.length,h=c[f-1].edge,d=h.l===l?h.r:h.l;++u<f;)h,i=d,d=(h=c[u].edge).l===l?h.r:h.l,n<i.i&&n<d.i&&(o=i,s=d,((a=l).x-s.x)*(o.y-a.y)-(a.x-o.x)*(s.y-a.y)<0)&&e.push([t[n],t[i.i],t[d.i]])}),e},o.x=function(t){return arguments.length?(n=ve(e=t),o):e},o.y=function(t){return arguments.length?(i=ve(r=t),o):r},o.clipExtent=function(t){return arguments.length?(a=null==t?Ri:t,o):a===Ri?null:a},o.size=function(t){return arguments.length?o.clipExtent(t&&[[0,0],t]):a===Ri?null:a&&a[1]},o};var Ri=[[-1e6,-1e6],[1e6,1e6]];function Ni(t){return t.x}function Fi(t){return t.y}function ji(e,r){e=t.rgb(e),r=t.rgb(r);var n=e.r,i=e.g,a=e.b,o=r.r-n,s=r.g-i,l=r.b-a;return function(t){return\"#\"+ce(Math.round(n+o*t))+ce(Math.round(i+s*t))+ce(Math.round(a+l*t))}}function Bi(t,e){var r,n={},i={};for(r in t)r in e?n[r]=Gi(t[r],e[r]):i[r]=t[r];for(r in e)r in t||(i[r]=e[r]);return function(t){for(r in n)i[r]=n[r](t);return i}}function Ui(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Vi(t,e){var r,n,i,a=qi.lastIndex=Hi.lastIndex=0,o=-1,s=[],l=[];for(t+=\"\",e+=\"\";(r=qi.exec(t))&&(n=Hi.exec(e));)(i=n.index)>a&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:Ui(r,n)})),a=Hi.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?(e=l[0].x,function(t){return e(t)+\"\"}):function(){return e}:(e=l.length,function(t){for(var r,n=0;n<e;++n)s[(r=l[n]).i]=r.x(t);return s.join(\"\")})}t.geom.delaunay=function(e){return t.geom.voronoi().triangles(e)},t.geom.quadtree=function(t,e,r,n,i){var a,o=$n,s=ti;if(a=arguments.length)return o=Ni,s=Fi,3===a&&(i=r,n=e,r=e=0),l(t);function l(t){var l,c,u,f,h,d,p,m,v,g=ve(o),b=ve(s);if(null!=e)d=e,p=r,m=n,v=i;else if(m=v=-(d=p=1/0),c=[],u=[],h=t.length,a)for(f=0;f<h;++f)(l=t[f]).x<d&&(d=l.x),l.y<p&&(p=l.y),l.x>m&&(m=l.x),l.y>v&&(v=l.y),c.push(l.x),u.push(l.y);else for(f=0;f<h;++f){var x=+g(l=t[f],f),_=+b(l,f);x<d&&(d=x),_<p&&(p=_),x>m&&(m=x),_>v&&(v=_),c.push(x),u.push(_)}var w=m-d,M=v-p;function k(t,e,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,c=t.y;if(null!=l)if(y(l-r)+y(c-n)<.01)A(t,e,r,n,i,a,o,s);else{var u=t.point;t.x=t.y=t.point=null,A(t,u,l,c,i,a,o,s),A(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else A(t,e,r,n,i,a,o,s)}function A(t,e,r,n,i,a,o,s){var l=.5*(i+o),c=.5*(a+s),u=r>=l,f=n>=c,h=f<<1|u;t.leaf=!1,t=t.nodes[h]||(t.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){k(T,t,+g(t,++f),+b(t,f),d,p,m,v)}}),u?i=l:o=l,f?a=c:s=c,k(t,e,r,n,i,a,o,s)}w>M?v=p+w:m=d+M;var T={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){k(T,t,+g(t,++f),+b(t,f),d,p,m,v)}};if(T.visit=function(t){!function t(e,r,n,i,a,o){if(!e(r,n,i,a,o)){var s=.5*(n+a),l=.5*(i+o),c=r.nodes;c[0]&&t(e,c[0],n,i,s,l),c[1]&&t(e,c[1],s,i,a,l),c[2]&&t(e,c[2],n,l,s,o),c[3]&&t(e,c[3],s,l,a,o)}}(t,T,d,p,m,v)},T.find=function(t){return function(t,e,r,n,i,a,o){var s,l=1/0;return function t(c,u,f,h,d){if(!(u>a||f>o||h<n||d<i)){if(p=c.point){var p,m=e-c.x,v=r-c.y,g=m*m+v*v;if(g<l){var y=Math.sqrt(l=g);n=e-y,i=r-y,a=e+y,o=r+y,s=p}}for(var b=c.nodes,x=.5*(u+h),_=.5*(f+d),w=(r>=_)<<1|e>=x,M=w+4;w<M;++w)if(c=b[3&w])switch(3&w){case 0:t(c,u,f,x,_);break;case 1:t(c,x,f,h,_);break;case 2:t(c,u,_,x,d);break;case 3:t(c,x,_,h,d)}}}(t,n,i,a,o),s}(T,t[0],t[1],d,p,m,v)},f=-1,null==e){for(;++f<h;)k(T,t[f],c[f],u[f],d,p,m,v);--f}else t.forEach(T.add);return c=u=t=l=null,T}return l.x=function(t){return arguments.length?(o=t,l):o},l.y=function(t){return arguments.length?(s=t,l):s},l.extent=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=+t[0][0],r=+t[0][1],n=+t[1][0],i=+t[1][1]),l):null==e?null:[[e,r],[n,i]]},l.size=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=r=0,n=+t[0],i=+t[1]),l):null==e?null:[n-e,i-r]},l},t.interpolateRgb=ji,t.interpolateObject=Bi,t.interpolateNumber=Ui,t.interpolateString=Vi;var qi=/[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,Hi=new RegExp(qi.source,\"g\");function Gi(e,r){for(var n,i=t.interpolators.length;--i>=0&&!(n=t.interpolators[i](e,r)););return n}function Yi(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r<s;++r)n.push(Gi(t[r],e[r]));for(;r<a;++r)i[r]=t[r];for(;r<o;++r)i[r]=e[r];return function(t){for(r=0;r<s;++r)i[r]=n[r](t);return i}}t.interpolate=Gi,t.interpolators=[function(t,e){var r=typeof e;return(\"string\"===r?me.has(e.toLowerCase())||/^(#|rgb\\(|hsl\\()/i.test(e)?ji:Vi:e instanceof Ut?ji:Array.isArray(e)?Yi:\"object\"===r&&isNaN(e)?Bi:Ui)(t,e)}],t.interpolateArray=Yi;var Wi=function(){return P},Xi=t.map({linear:Wi,poly:function(t){return function(e){return Math.pow(e,t)}},quad:function(){return Qi},cubic:function(){return $i},sin:function(){return ea},exp:function(){return ra},circle:function(){return na},elastic:function(t,e){var r;arguments.length<2&&(e=.45);arguments.length?r=e/Tt*Math.asin(1/t):(t=1,r=e/4);return function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*Tt/e)}},back:function(t){t||(t=1.70158);return function(e){return e*e*((t+1)*e-t)}},bounce:function(){return ia}}),Zi=t.map({in:P,out:Ji,\"in-out\":Ki,\"out-in\":function(t){return Ki(Ji(t))}});function Ji(t){return function(e){return 1-t(1-e)}}function Ki(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Qi(t){return t*t}function $i(t){return t*t*t}function ta(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function ea(t){return 1-Math.cos(t*St)}function ra(t){return Math.pow(2,10*(t-1))}function na(t){return 1-Math.sqrt(1-t*t)}function ia(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function aa(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function oa(t){var e,r,n,i=[t.a,t.b],a=[t.c,t.d],o=la(i),s=sa(i,a),l=la(((e=a)[0]+=(n=-s)*(r=i)[0],e[1]+=n*r[1],e))||0;i[0]*a[1]<a[0]*i[1]&&(i[0]*=-1,i[1]*=-1,o*=-1,s*=-1),this.rotate=(o?Math.atan2(i[1],i[0]):Math.atan2(-a[0],a[1]))*Ct,this.translate=[t.e,t.f],this.scale=[o,l],this.skew=l?Math.atan2(s,l)*Ct:0}function sa(t,e){return t[0]*e[0]+t[1]*e[1]}function la(t){var e=Math.sqrt(sa(t,t));return e&&(t[0]/=e,t[1]/=e),e}t.ease=function(t){var e,n=t.indexOf(\"-\"),i=n>=0?t.slice(0,n):t,a=n>=0?t.slice(n+1):\"in\";return i=Xi.get(i)||Wi,a=Zi.get(a)||P,e=a(i.apply(null,r.call(arguments,1))),function(t){return t<=0?0:t>=1?1:e(t)}},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,i=e.c,a=e.l,o=r.h-n,s=r.c-i,l=r.l-a;isNaN(s)&&(s=0,i=isNaN(i)?r.c:i);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Wt(n+o*t,i+s*t,a+l*t)+\"\"}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,i=e.s,a=e.l,o=r.h-n,s=r.s-i,l=r.l-a;isNaN(s)&&(s=0,i=isNaN(i)?r.s:i);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Ht(n+o*t,i+s*t,a+l*t)+\"\"}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,i=e.a,a=e.b,o=r.l-n,s=r.a-i,l=r.b-a;return function(t){return te(n+o*t,i+s*t,a+l*t)+\"\"}},t.interpolateRound=aa,t.transform=function(e){var r=i.createElementNS(t.ns.prefix.svg,\"g\");return(t.transform=function(t){if(null!=t){r.setAttribute(\"transform\",t);var e=r.transform.baseVal.consolidate()}return new oa(e?e.matrix:ca)})(e)},oa.prototype.toString=function(){return\"translate(\"+this.translate+\")rotate(\"+this.rotate+\")skewX(\"+this.skew+\")scale(\"+this.scale+\")\"};var ca={a:1,b:0,c:0,d:1,e:0,f:0};function ua(t){return t.length?t.pop()+\",\":\"\"}function fa(e,r){var n=[],i=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(\"translate(\",null,\",\",null,\")\");n.push({i:i-4,x:Ui(t[0],e[0])},{i:i-2,x:Ui(t[1],e[1])})}else(e[0]||e[1])&&r.push(\"translate(\"+e+\")\")}(e.translate,r.translate,n,i),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(ua(r)+\"rotate(\",null,\")\")-2,x:Ui(t,e)})):e&&r.push(ua(r)+\"rotate(\"+e+\")\")}(e.rotate,r.rotate,n,i),function(t,e,r,n){t!==e?n.push({i:r.push(ua(r)+\"skewX(\",null,\")\")-2,x:Ui(t,e)}):e&&r.push(ua(r)+\"skewX(\"+e+\")\")}(e.skew,r.skew,n,i),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(ua(r)+\"scale(\",null,\",\",null,\")\");n.push({i:i-4,x:Ui(t[0],e[0])},{i:i-2,x:Ui(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(ua(r)+\"scale(\"+e+\")\")}(e.scale,r.scale,n,i),e=r=null,function(t){for(var e,r=-1,a=i.length;++r<a;)n[(e=i[r]).i]=e.x(t);return n.join(\"\")}}function ha(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function da(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function pa(t){for(var e=t.source,r=t.target,n=function(t,e){if(t===e)return t;var r=ma(t),n=ma(e),i=r.pop(),a=n.pop(),o=null;for(;i===a;)o=i,i=r.pop(),a=n.pop();return o}(e,r),i=[e];e!==n;)e=e.parent,i.push(e);for(var a=i.length;r!==n;)i.splice(a,0,r),r=r.parent;return i}function ma(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function va(t){t.fixed|=2}function ga(t){t.fixed&=-7}function ya(t){t.fixed|=4,t.px=t.x,t.py=t.y}function ba(t){t.fixed&=-5}t.interpolateTransform=fa,t.layout={},t.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r<n;)e.push(pa(t[r]));return e}},t.layout.chord=function(){var e,r,n,i,a,o,s,l={},c=0;function u(){var l,u,h,d,p,m={},v=[],g=t.range(i),y=[];for(e=[],r=[],l=0,d=-1;++d<i;){for(u=0,p=-1;++p<i;)u+=n[d][p];v.push(u),y.push(t.range(i)),l+=u}for(a&&g.sort(function(t,e){return a(v[t],v[e])}),o&&y.forEach(function(t,e){t.sort(function(t,r){return o(n[e][t],n[e][r])})}),l=(Tt-c*i)/l,u=0,d=-1;++d<i;){for(h=u,p=-1;++p<i;){var b=g[d],x=y[b][p],_=n[b][x],w=u,M=u+=_*l;m[b+\"-\"+x]={index:b,subindex:x,startAngle:w,endAngle:M,value:_}}r[b]={index:b,startAngle:h,endAngle:u,value:v[b]},u+=c}for(d=-1;++d<i;)for(p=d-1;++p<i;){var k=m[d+\"-\"+p],A=m[p+\"-\"+d];(k.value||A.value)&&e.push(k.value<A.value?{source:A,target:k}:{source:k,target:A})}s&&f()}function f(){e.sort(function(t,e){return s((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}return l.matrix=function(t){return arguments.length?(i=(n=t)&&n.length,e=r=null,l):n},l.padding=function(t){return arguments.length?(c=t,e=r=null,l):c},l.sortGroups=function(t){return arguments.length?(a=t,e=r=null,l):a},l.sortSubgroups=function(t){return arguments.length?(o=t,e=null,l):o},l.sortChords=function(t){return arguments.length?(s=t,e&&f(),l):s},l.chords=function(){return e||u(),e},l.groups=function(){return r||u(),r},l},t.layout.force=function(){var e,r,n,i,a,o,s={},l=t.dispatch(\"start\",\"tick\",\"end\"),c=[1,1],u=.9,f=xa,h=_a,d=-30,p=wa,m=.1,v=.64,g=[],y=[];function b(t){return function(e,r,n,i){if(e.point!==t){var a=e.cx-t.x,o=e.cy-t.y,s=i-r,l=a*a+o*o;if(s*s/v<l){if(l<p){var c=e.charge/l;t.px-=a*c,t.py-=o*c}return!0}if(e.point&&l&&l<p){c=e.pointCharge/l;t.px-=a*c,t.py-=o*c}}return!e.charge}}function x(e){e.px=t.event.x,e.py=t.event.y,s.resume()}return s.tick=function(){if((n*=.99)<.005)return e=null,l.end({type:\"end\",alpha:n=0}),!0;var r,s,f,h,p,v,x,_,w,M=g.length,k=y.length;for(s=0;s<k;++s)h=(f=y[s]).source,(v=(_=(p=f.target).x-h.x)*_+(w=p.y-h.y)*w)&&(_*=v=n*a[s]*((v=Math.sqrt(v))-i[s])/v,w*=v,p.x-=_*(x=h.weight+p.weight?h.weight/(h.weight+p.weight):.5),p.y-=w*x,h.x+=_*(x=1-x),h.y+=w*x);if((x=n*m)&&(_=c[0]/2,w=c[1]/2,s=-1,x))for(;++s<M;)(f=g[s]).x+=(_-f.x)*x,f.y+=(w-f.y)*x;if(d)for(!function t(e,r,n){var i=0,a=0;e.charge=0;if(!e.leaf)for(var o,s=e.nodes,l=s.length,c=-1;++c<l;)null!=(o=s[c])&&(t(o,r,n),e.charge+=o.charge,i+=o.charge*o.cx,a+=o.charge*o.cy);if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var u=r*n[e.point.index];e.charge+=e.pointCharge=u,i+=u*e.point.x,a+=u*e.point.y}e.cx=i/e.charge;e.cy=a/e.charge}(r=t.geom.quadtree(g),n,o),s=-1;++s<M;)(f=g[s]).fixed||r.visit(b(f));for(s=-1;++s<M;)(f=g[s]).fixed?(f.x=f.px,f.y=f.py):(f.x-=(f.px-(f.px=f.x))*u,f.y-=(f.py-(f.py=f.y))*u);l.tick({type:\"tick\",alpha:n})},s.nodes=function(t){return arguments.length?(g=t,s):g},s.links=function(t){return arguments.length?(y=t,s):y},s.size=function(t){return arguments.length?(c=t,s):c},s.linkDistance=function(t){return arguments.length?(f=\"function\"==typeof t?t:+t,s):f},s.distance=s.linkDistance,s.linkStrength=function(t){return arguments.length?(h=\"function\"==typeof t?t:+t,s):h},s.friction=function(t){return arguments.length?(u=+t,s):u},s.charge=function(t){return arguments.length?(d=\"function\"==typeof t?t:+t,s):d},s.chargeDistance=function(t){return arguments.length?(p=t*t,s):Math.sqrt(p)},s.gravity=function(t){return arguments.length?(m=+t,s):m},s.theta=function(t){return arguments.length?(v=t*t,s):Math.sqrt(v)},s.alpha=function(t){return arguments.length?(t=+t,n?t>0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:\"end\",alpha:n=0})):t>0&&(l.start({type:\"start\",alpha:n=t}),e=ke(s.tick)),s):n},s.start=function(){var t,e,r,n=g.length,l=y.length,u=c[0],p=c[1];for(t=0;t<n;++t)(r=g[t]).index=t,r.weight=0;for(t=0;t<l;++t)\"number\"==typeof(r=y[t]).source&&(r.source=g[r.source]),\"number\"==typeof r.target&&(r.target=g[r.target]),++r.source.weight,++r.target.weight;for(t=0;t<n;++t)r=g[t],isNaN(r.x)&&(r.x=m(\"x\",u)),isNaN(r.y)&&(r.y=m(\"y\",p)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],\"function\"==typeof f)for(t=0;t<l;++t)i[t]=+f.call(this,y[t],t);else for(t=0;t<l;++t)i[t]=f;if(a=[],\"function\"==typeof h)for(t=0;t<l;++t)a[t]=+h.call(this,y[t],t);else for(t=0;t<l;++t)a[t]=h;if(o=[],\"function\"==typeof d)for(t=0;t<n;++t)o[t]=+d.call(this,g[t],t);else for(t=0;t<n;++t)o[t]=d;function m(r,i){if(!e){for(e=new Array(n),c=0;c<n;++c)e[c]=[];for(c=0;c<l;++c){var a=y[c];e[a.source.index].push(a.target),e[a.target.index].push(a.source)}}for(var o,s=e[t],c=-1,u=s.length;++c<u;)if(!isNaN(o=s[c][r]))return o;return Math.random()*i}return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){if(r||(r=t.behavior.drag().origin(P).on(\"dragstart.force\",va).on(\"drag.force\",x).on(\"dragend.force\",ga)),!arguments.length)return r;this.on(\"mouseover.force\",ya).on(\"mouseout.force\",ba).call(r)},t.rebind(s,l,\"on\")};var xa=20,_a=1,wa=1/0;function Ma(e,r){return t.rebind(e,r,\"sort\",\"children\",\"value\"),e.nodes=e,e.links=La,e}function ka(t,e){for(var r=[t];null!=(t=r.pop());)if(e(t),(i=t.children)&&(n=i.length))for(var n,i;--n>=0;)r.push(i[n])}function Aa(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(a=t.children)&&(i=a.length))for(var i,a,o=-1;++o<i;)r.push(a[o]);for(;null!=(t=n.pop());)e(t)}function Ta(t){return t.children}function Ea(t){return t.value}function Sa(t,e){return e.value-t.value}function La(e){return t.merge(e.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}t.layout.hierarchy=function(){var t=Sa,e=Ta,r=Ea;function n(i){var a,o=[i],s=[];for(i.depth=0;null!=(a=o.pop());)if(s.push(a),(c=e.call(n,a,a.depth))&&(l=c.length)){for(var l,c,u;--l>=0;)o.push(u=c[l]),u.parent=a,u.depth=a.depth+1;r&&(a.value=0),a.children=c}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return Aa(i,function(e){var n,i;t&&(n=e.children)&&n.sort(t),r&&(i=e.parent)&&(i.value+=e.value)}),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(ka(t,function(t){t.children&&(t.value=0)}),Aa(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,n){var i=e.call(this,t,n);return function t(e,r,n,i){var a=e.children;if(e.x=r,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(o=a.length)){var o,s,l,c=-1;for(n=e.value?n/e.value:0;++c<o;)t(s=a[c],r,l=s.value*n,i),r+=l}}(i[0],0,r[0],r[1]/function t(e){var r=e.children,n=0;if(r&&(i=r.length))for(var i,a=-1;++a<i;)n=Math.max(n,t(r[a]));return 1+n}(i[0])),i}return n.size=function(t){return arguments.length?(r=t,n):r},Ma(n,e)},t.layout.pie=function(){var e=Number,r=Ca,n=0,i=Tt,a=0;function o(s){var l,c=s.length,u=s.map(function(t,r){return+e.call(o,t,r)}),f=+(\"function\"==typeof n?n.apply(this,arguments):n),h=(\"function\"==typeof i?i.apply(this,arguments):i)-f,d=Math.min(Math.abs(h)/c,+(\"function\"==typeof a?a.apply(this,arguments):a)),p=d*(h<0?-1:1),m=t.sum(u),v=m?(h-c*p)/m:0,g=t.range(c),y=[];return null!=r&&g.sort(r===Ca?function(t,e){return u[e]-u[t]}:function(t,e){return r(s[t],s[e])}),g.forEach(function(t){y[t]={data:s[t],value:l=u[t],startAngle:f,endAngle:f+=l*v+p,padAngle:d}}),y}return o.value=function(t){return arguments.length?(e=t,o):e},o.sort=function(t){return arguments.length?(r=t,o):r},o.startAngle=function(t){return arguments.length?(n=t,o):n},o.endAngle=function(t){return arguments.length?(i=t,o):i},o.padAngle=function(t){return arguments.length?(a=t,o):a},o};var Ca={};function Pa(t){return t.x}function za(t){return t.y}function Oa(t,e,r){t.y0=e,t.y=r}t.layout.stack=function(){var e=P,r=Ra,n=Na,i=Oa,a=Pa,o=za;function s(l,c){if(!(d=l.length))return l;var u=l.map(function(t,r){return e.call(s,t,r)}),f=u.map(function(t){return t.map(function(t,e){return[a.call(s,t,e),o.call(s,t,e)]})}),h=r.call(s,f,c);u=t.permute(u,h),f=t.permute(f,h);var d,p,m,v,g=n.call(s,f,c),y=u[0].length;for(m=0;m<y;++m)for(i.call(s,u[0][m],v=g[m],f[0][m][1]),p=1;p<d;++p)i.call(s,u[p][m],v+=f[p-1][m][1],f[p][m][1]);return l}return s.values=function(t){return arguments.length?(e=t,s):e},s.order=function(t){return arguments.length?(r=\"function\"==typeof t?t:Da.get(t)||Ra,s):r},s.offset=function(t){return arguments.length?(n=\"function\"==typeof t?t:Ia.get(t)||Na,s):n},s.x=function(t){return arguments.length?(a=t,s):a},s.y=function(t){return arguments.length?(o=t,s):o},s.out=function(t){return arguments.length?(i=t,s):i},s};var Da=t.map({\"inside-out\":function(e){var r,n,i=e.length,a=e.map(Fa),o=e.map(ja),s=t.range(i).sort(function(t,e){return a[t]-a[e]}),l=0,c=0,u=[],f=[];for(r=0;r<i;++r)n=s[r],l<c?(l+=o[n],u.push(n)):(c+=o[n],f.push(n));return f.reverse().concat(u)},reverse:function(e){return t.range(e.length).reverse()},default:Ra}),Ia=t.map({silhouette:function(t){var e,r,n,i=t.length,a=t[0].length,o=[],s=0,l=[];for(r=0;r<a;++r){for(e=0,n=0;e<i;e++)n+=t[e][r][1];n>s&&(s=n),o.push(n)}for(r=0;r<a;++r)l[r]=(s-o[r])/2;return l},wiggle:function(t){var e,r,n,i,a,o,s,l,c,u=t.length,f=t[0],h=f.length,d=[];for(d[0]=l=c=0,r=1;r<h;++r){for(e=0,i=0;e<u;++e)i+=t[e][r][1];for(e=0,a=0,s=f[r][0]-f[r-1][0];e<u;++e){for(n=0,o=(t[e][r][1]-t[e][r-1][1])/(2*s);n<e;++n)o+=(t[n][r][1]-t[n][r-1][1])/s;a+=o*t[e][r][1]}d[r]=l-=i?a/i*s:0,l<c&&(c=l)}for(r=0;r<h;++r)d[r]-=c;return d},expand:function(t){var e,r,n,i=t.length,a=t[0].length,o=1/i,s=[];for(r=0;r<a;++r){for(e=0,n=0;e<i;e++)n+=t[e][r][1];if(n)for(e=0;e<i;e++)t[e][r][1]/=n;else for(e=0;e<i;e++)t[e][r][1]=o}for(r=0;r<a;++r)s[r]=0;return s},zero:Na});function Ra(e){return t.range(e.length)}function Na(t){for(var e=-1,r=t[0].length,n=[];++e<r;)n[e]=0;return n}function Fa(t){for(var e,r=1,n=0,i=t[0][1],a=t.length;r<a;++r)(e=t[r][1])>i&&(n=r,i=e);return n}function ja(t){return t.reduce(Ba,0)}function Ba(t,e){return t+e[1]}function Ua(t,e){return Va(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Va(t,e){for(var r=-1,n=+t[0],i=(t[1]-n)/e,a=[];++r<=e;)a[r]=i*r+n;return a}function qa(e){return[t.min(e),t.max(e)]}function Ha(t,e){return t.value-e.value}function Ga(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Ya(t,e){t._pack_next=e,e._pack_prev=t}function Wa(t,e){var r=e.x-t.x,n=e.y-t.y,i=t.r+e.r;return.999*i*i>r*r+n*n}function Xa(t){if((e=t.children)&&(l=e.length)){var e,r,n,i,a,o,s,l,c=1/0,u=-1/0,f=1/0,h=-1/0;if(e.forEach(Za),(r=e[0]).x=-r.r,r.y=0,b(r),l>1&&((n=e[1]).x=n.r,n.y=0,b(n),l>2))for(Ka(r,n,i=e[2]),b(i),Ga(r,i),r._pack_prev=i,Ga(i,n),n=r._pack_next,a=3;a<l;a++){Ka(r,n,i=e[a]);var d=0,p=1,m=1;for(o=n._pack_next;o!==n;o=o._pack_next,p++)if(Wa(o,i)){d=1;break}if(1==d)for(s=r._pack_prev;s!==o._pack_prev&&!Wa(s,i);s=s._pack_prev,m++);d?(p<m||p==m&&n.r<r.r?Ya(r,n=o):Ya(r=s,n),a--):(Ga(r,i),n=i,b(i))}var v=(c+u)/2,g=(f+h)/2,y=0;for(a=0;a<l;a++)(i=e[a]).x-=v,i.y-=g,y=Math.max(y,i.r+Math.sqrt(i.x*i.x+i.y*i.y));t.r=y,e.forEach(Ja)}function b(t){c=Math.min(t.x-t.r,c),u=Math.max(t.x+t.r,u),f=Math.min(t.y-t.r,f),h=Math.max(t.y+t.r,h)}}function Za(t){t._pack_next=t._pack_prev=t}function Ja(t){delete t._pack_next,delete t._pack_prev}function Ka(t,e,r){var n=t.r+r.r,i=e.x-t.x,a=e.y-t.y;if(n&&(i||a)){var o=e.r+r.r,s=i*i+a*a,l=.5+((n*=n)-(o*=o))/(2*s),c=Math.sqrt(Math.max(0,2*o*(n+s)-(n-=s)*n-o*o))/(2*s);r.x=t.x+l*i+c*a,r.y=t.y+l*a-c*i}else r.x=t.x+n,r.y=t.y}function Qa(t,e){return t.parent==e.parent?1:2}function $a(t){var e=t.children;return e.length?e[0]:t.t}function to(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function eo(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}function ro(t,e,r){return t.a.parent===e.parent?t.a:r}function no(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function io(t,e){var r=t.x+e[3],n=t.y+e[0],i=t.dx-e[1]-e[3],a=t.dy-e[0]-e[2];return i<0&&(r+=i/2,i=0),a<0&&(n+=a/2,a=0),{x:r,y:n,dx:i,dy:a}}function ao(t){var e=t[0],r=t[t.length-1];return e<r?[e,r]:[r,e]}function oo(t){return t.rangeExtent?t.rangeExtent():ao(t.range())}function so(t,e,r,n){var i=r(t[0],t[1]),a=n(e[0],e[1]);return function(t){return a(i(t))}}function lo(t,e){var r,n=0,i=t.length-1,a=t[n],o=t[i];return o<a&&(r=n,n=i,i=r,r=a,a=o,o=r),t[n]=e.floor(a),t[i]=e.ceil(o),t}function co(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:uo}t.layout.histogram=function(){var e=!0,r=Number,n=qa,i=Ua;function a(a,o){for(var s,l,c=[],u=a.map(r,this),f=n.call(this,u,o),h=i.call(this,f,u,o),d=(o=-1,u.length),p=h.length-1,m=e?1:1/d;++o<p;)(s=c[o]=[]).dx=h[o+1]-(s.x=h[o]),s.y=0;if(p>0)for(o=-1;++o<d;)(l=u[o])>=f[0]&&l<=f[1]&&((s=c[t.bisect(h,l,1,p)-1]).y+=m,s.push(a[o]));return c}return a.value=function(t){return arguments.length?(r=t,a):r},a.range=function(t){return arguments.length?(n=ve(t),a):n},a.bins=function(t){return arguments.length?(i=\"number\"==typeof t?function(e){return Va(e,t)}:ve(t),a):i},a.frequency=function(t){return arguments.length?(e=!!t,a):e},a},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(Ha),n=0,i=[1,1];function a(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],c=i[1],u=null==e?Math.sqrt:\"function\"==typeof e?e:function(){return e};if(s.x=s.y=0,Aa(s,function(t){t.r=+u(t.value)}),Aa(s,Xa),n){var f=n*(e?1:Math.max(2*s.r/l,2*s.r/c))/2;Aa(s,function(t){t.r+=f}),Aa(s,Xa),Aa(s,function(t){t.r-=f})}return function t(e,r,n,i){var a=e.children;e.x=r+=i*e.x;e.y=n+=i*e.y;e.r*=i;if(a)for(var o=-1,s=a.length;++o<s;)t(a[o],r,n,i)}(s,l/2,c/2,e?1:1/Math.max(2*s.r/l,2*s.r/c)),o}return a.size=function(t){return arguments.length?(i=t,a):i},a.radius=function(t){return arguments.length?(e=null==t||\"function\"==typeof t?t:+t,a):e},a.padding=function(t){return arguments.length?(n=+t,a):n},Ma(a,r)},t.layout.tree=function(){var e=t.layout.hierarchy().sort(null).value(null),r=Qa,n=[1,1],i=null;function a(t,a){var c=e.call(this,t,a),u=c[0],f=function(t){var e,r={A:null,children:[t]},n=[r];for(;null!=(e=n.pop());)for(var i,a=e.children,o=0,s=a.length;o<s;++o)n.push((a[o]=i={_:a[o],parent:e,children:(i=a[o].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=i);return r.children[0]}(u);if(Aa(f,o),f.parent.m=-f.z,ka(f,s),i)ka(u,l);else{var h=u,d=u,p=u;ka(u,function(t){t.x<h.x&&(h=t),t.x>d.x&&(d=t),t.depth>p.depth&&(p=t)});var m=r(h,d)/2-h.x,v=n[0]/(d.x+r(d,h)/2+m),g=n[1]/(p.depth||1);ka(u,function(t){t.x=(t.x+m)*v,t.y=t.depth*g})}return c}function o(t){var e=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,r=0,n=0,i=t.children,a=i.length;for(;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var a=(e[0].z+e[e.length-1].z)/2;i?(t.z=i.z+r(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+r(t._,i._));t.parent.A=function(t,e,n){if(e){for(var i,a=t,o=t,s=e,l=a.parent.children[0],c=a.m,u=o.m,f=s.m,h=l.m;s=to(s),a=$a(a),s&&a;)l=$a(l),(o=to(o)).a=t,(i=s.z+f-a.z-c+r(s._,a._))>0&&(eo(ro(s,t,n),t,i),c+=i,u+=i),f+=s.m,c+=a.m,h+=l.m,u+=o.m;s&&!to(o)&&(o.t=s,o.m+=f-u),a&&!$a(l)&&(l.t=a,l.m+=c-h,n=t)}return n}(t,i,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t)?l:null,a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null==(n=t)?null:l,a):i?n:null},Ma(a,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=Qa,n=[1,1],i=!1;function a(a,o){var s,l=e.call(this,a,o),c=l[0],u=0;Aa(c,function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}(n),e.y=function(e){return 1+t.max(e,function(t){return t.y})}(n)):(e.x=s?u+=r(e,s):0,e.y=0,s=e)});var f=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(c),h=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(c),d=f.x-r(f,h)/2,p=h.x+r(h,f)/2;return Aa(c,i?function(t){t.x=(t.x-c.x)*n[0],t.y=(c.y-t.y)*n[1]}:function(t){t.x=(t.x-d)/(p-d)*n[0],t.y=(1-(c.y?t.y/c.y:1))*n[1]}),l}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t),a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null!=(n=t),a):i?n:null},Ma(a,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,i=[1,1],a=null,o=no,s=!1,l=\"squarify\",c=.5*(1+Math.sqrt(5));function u(t,e){for(var r,n,i=-1,a=t.length;++i<a;)n=(r=t[i]).value*(e<0?0:e),r.area=isNaN(n)||n<=0?0:n}function f(t){var e=t.children;if(e&&e.length){var r,n,i,a=o(t),s=[],c=e.slice(),h=1/0,m=\"slice\"===l?a.dx:\"dice\"===l?a.dy:\"slice-dice\"===l?1&t.depth?a.dy:a.dx:Math.min(a.dx,a.dy);for(u(c,a.dx*a.dy/t.value),s.area=0;(i=c.length)>0;)s.push(r=c[i-1]),s.area+=r.area,\"squarify\"!==l||(n=d(s,m))<=h?(c.pop(),h=n):(s.area-=s.pop().area,p(s,m,a,!1),m=Math.min(a.dx,a.dy),s.length=s.area=0,h=1/0);s.length&&(p(s,m,a,!0),s.length=s.area=0),e.forEach(f)}}function h(t){var e=t.children;if(e&&e.length){var r,n=o(t),i=e.slice(),a=[];for(u(i,n.dx*n.dy/t.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(p(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);e.forEach(h)}}function d(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++o<s;)(r=t[o].area)&&(r<a&&(a=r),r>i&&(i=r));return e*=e,(n*=n)?Math.max(e*i*c/n,n/(e*a*c)):1/0}function p(t,e,r,i){var a,o=-1,s=t.length,l=r.x,c=r.y,u=e?n(t.area/e):0;if(e==r.dx){for((i||u>r.dy)&&(u=r.dy);++o<s;)(a=t[o]).x=l,a.y=c,a.dy=u,l+=a.dx=Math.min(r.x+r.dx-l,u?n(a.area/u):0);a.z=!0,a.dx+=r.x+r.dx-l,r.y+=u,r.dy-=u}else{for((i||u>r.dx)&&(u=r.dx);++o<s;)(a=t[o]).x=l,a.y=c,a.dx=u,c+=a.dy=Math.min(r.y+r.dy-c,u?n(a.area/u):0);a.z=!1,a.dy+=r.y+r.dy-c,r.x+=u,r.dx-=u}}function m(t){var n=e||r(t),a=n[0];return a.x=a.y=0,a.value?(a.dx=i[0],a.dy=i[1]):a.dx=a.dy=0,e&&r.revalue(a),u([a],a.dx*a.dy/a.value),(e?h:f)(a),s&&(e=n),n}return m.size=function(t){return arguments.length?(i=t,m):i},m.padding=function(t){if(!arguments.length)return a;function e(e){return io(e,t)}var r;return o=null==(a=t)?no:\"function\"==(r=typeof t)?function(e){var r=t.call(m,e,e.depth);return null==r?no(e):io(e,\"number\"==typeof r?[r,r,r,r]:r)}:\"number\"===r?(t=[t,t,t,t],e):e,m},m.round=function(t){return arguments.length?(n=t?Math.round:Number,m):n!=Number},m.sticky=function(t){return arguments.length?(s=t,e=null,m):s},m.ratio=function(t){return arguments.length?(c=t,m):c},m.mode=function(t){return arguments.length?(l=t+\"\",m):l},Ma(m,r)},t.random={normal:function(t,e){var r=arguments.length;return r<2&&(e=1),r<1&&(t=0),function(){var r,n,i;do{i=(r=2*Math.random()-1)*r+(n=2*Math.random()-1)*n}while(!i||i>1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r<t;r++)e+=Math.random();return e}}},t.scale={};var uo={floor:P,ceil:P};function fo(e,r,n,i){var a=[],o=[],s=0,l=Math.min(e.length,r.length)-1;for(e[l]<e[0]&&(e=e.slice().reverse(),r=r.slice().reverse());++s<=l;)a.push(n(e[s-1],e[s])),o.push(i(r[s-1],r[s]));return function(r){var n=t.bisect(e,r,1,l)-1;return o[n](a[n](r))}}function ho(e,r){return t.rebind(e,r,\"range\",\"rangeRound\",\"interpolate\",\"clamp\")}function po(t,e){return lo(t,co(mo(t,e)[2])),lo(t,co(mo(t,e)[2])),t}function mo(t,e){null==e&&(e=10);var r=ao(t),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),a=e/n*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function vo(e,r){return t.range.apply(t,mo(e,r))}function go(e,r,n){var i=mo(e,r);if(n){var a=Ce.exec(n);if(a.shift(),\"s\"===a[8]){var o=t.formatPrefix(Math.max(y(i[0]),y(i[1])));return a[7]||(a[7]=\".\"+bo(o.scale(i[2]))),a[8]=\"f\",n=t.format(a.join(\"\")),function(t){return n(o.scale(t))+o.symbol}}a[7]||(a[7]=\".\"+function(t,e){var r=bo(e[2]);return t in yo?Math.abs(r-bo(Math.max(y(e[0]),y(e[1]))))+ +(\"e\"!==t):r-2*(\"%\"===t)}(a[8],i)),n=a.join(\"\")}else n=\",.\"+bo(i[2])+\"f\";return t.format(n)}t.scale.linear=function(){return function t(e,r,n,i){var a,o;function s(){var t=Math.min(e.length,r.length)>2?fo:so,s=i?da:ha;return a=t(e,r,s,n),o=t(r,e,s,Gi),l}function l(t){return a(t)}l.invert=function(t){return o(t)};l.domain=function(t){return arguments.length?(e=t.map(Number),s()):e};l.range=function(t){return arguments.length?(r=t,s()):r};l.rangeRound=function(t){return l.range(t).interpolate(aa)};l.clamp=function(t){return arguments.length?(i=t,s()):i};l.interpolate=function(t){return arguments.length?(n=t,s()):n};l.ticks=function(t){return vo(e,t)};l.tickFormat=function(t,r){return go(e,t,r)};l.nice=function(t){return po(e,t),s()};l.copy=function(){return t(e,r,n,i)};return s()}([0,1],[0,1],Gi,!1)};var yo={s:1,g:1,p:1,r:1,e:1};function bo(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}t.scale.log=function(){return function e(r,n,i,a){function o(t){return(i?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(n)}function s(t){return i?Math.pow(n,t):-Math.pow(n,-t)}function l(t){return r(o(t))}l.invert=function(t){return s(r.invert(t))};l.domain=function(t){return arguments.length?(i=t[0]>=0,r.domain((a=t.map(Number)).map(o)),l):a};l.base=function(t){return arguments.length?(n=+t,r.domain(a.map(o)),l):n};l.nice=function(){var t=lo(a.map(o),i?Math:_o);return r.domain(t),a=t.map(s),l};l.ticks=function(){var t=ao(a),e=[],r=t[0],l=t[1],c=Math.floor(o(r)),u=Math.ceil(o(l)),f=n%1?2:n;if(isFinite(u-c)){if(i){for(;c<u;c++)for(var h=1;h<f;h++)e.push(s(c)*h);e.push(s(c))}else for(e.push(s(c));c++<u;)for(var h=f-1;h>0;h--)e.push(s(c)*h);for(c=0;e[c]<r;c++);for(u=e.length;e[u-1]>l;u--);e=e.slice(c,u)}return e};l.tickFormat=function(e,r){if(!arguments.length)return xo;arguments.length<2?r=xo:\"function\"!=typeof r&&(r=t.format(r));var i=Math.max(1,n*e/l.ticks().length);return function(t){var e=t/s(Math.round(o(t)));return e*n<n-.5&&(e*=n),e<=i?r(t):\"\"}};l.copy=function(){return e(r.copy(),n,i,a)};return ho(l,r)}(t.scale.linear().domain([0,1]),10,!0,[1,10])};var xo=t.format(\".0e\"),_o={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function wo(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}t.scale.pow=function(){return function t(e,r,n){var i=wo(r),a=wo(1/r);function o(t){return e(i(t))}o.invert=function(t){return a(e.invert(t))};o.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(i)),o):n};o.ticks=function(t){return vo(n,t)};o.tickFormat=function(t,e){return go(n,t,e)};o.nice=function(t){return o.domain(po(n,t))};o.exponent=function(t){return arguments.length?(i=wo(r=t),a=wo(1/r),e.domain(n.map(i)),o):r};o.copy=function(){return t(e.copy(),r,n)};return ho(o,e)}(t.scale.linear(),1,[0,1])},t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return function e(r,n){var i,a,o;function s(t){return a[((i.get(t)||(\"range\"===n.t?i.set(t,r.push(t)):NaN))-1)%a.length]}function l(e,n){return t.range(r.length).map(function(t){return e+n*t})}s.domain=function(t){if(!arguments.length)return r;r=[],i=new x;for(var e,a=-1,o=t.length;++a<o;)i.has(e=t[a])||i.set(e,r.push(e));return s[n.t].apply(s,n.a)};s.range=function(t){return arguments.length?(a=t,o=0,n={t:\"range\",a:arguments},s):a};s.rangePoints=function(t,e){arguments.length<2&&(e=0);var i=t[0],c=t[1],u=r.length<2?(i=(i+c)/2,0):(c-i)/(r.length-1+e);return a=l(i+u*e/2,u),o=0,n={t:\"rangePoints\",a:arguments},s};s.rangeRoundPoints=function(t,e){arguments.length<2&&(e=0);var i=t[0],c=t[1],u=r.length<2?(i=c=Math.round((i+c)/2),0):(c-i)/(r.length-1+e)|0;return a=l(i+Math.round(u*e/2+(c-i-(r.length-1+e)*u)/2),u),o=0,n={t:\"rangeRoundPoints\",a:arguments},s};s.rangeBands=function(t,e,i){arguments.length<2&&(e=0),arguments.length<3&&(i=e);var c=t[1]<t[0],u=t[c-0],f=t[1-c],h=(f-u)/(r.length-e+2*i);return a=l(u+h*i,h),c&&a.reverse(),o=h*(1-e),n={t:\"rangeBands\",a:arguments},s};s.rangeRoundBands=function(t,e,i){arguments.length<2&&(e=0),arguments.length<3&&(i=e);var c=t[1]<t[0],u=t[c-0],f=t[1-c],h=Math.floor((f-u)/(r.length-e+2*i));return a=l(u+Math.round((f-u-(r.length-e)*h)/2),h),c&&a.reverse(),o=Math.round(h*(1-e)),n={t:\"rangeRoundBands\",a:arguments},s};s.rangeBand=function(){return o};s.rangeExtent=function(){return ao(n.a[0])};s.copy=function(){return e(r,n)};return s.domain(r)}([],{t:\"range\",a:[[]]})},t.scale.category10=function(){return t.scale.ordinal().range(Mo)},t.scale.category20=function(){return t.scale.ordinal().range(ko)},t.scale.category20b=function(){return t.scale.ordinal().range(Ao)},t.scale.category20c=function(){return t.scale.ordinal().range(To)};var Mo=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(se),ko=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(se),Ao=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(se),To=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(se);function Eo(){return 0}t.scale.quantile=function(){return function e(r,n){var i;function a(){var e=0,a=n.length;for(i=[];++e<a;)i[e-1]=t.quantile(r,e/a);return o}function o(e){if(!isNaN(e=+e))return n[t.bisect(i,e)]}o.domain=function(t){return arguments.length?(r=t.map(d).filter(p).sort(h),a()):r};o.range=function(t){return arguments.length?(n=t,a()):n};o.quantiles=function(){return i};o.invertExtent=function(t){return(t=n.indexOf(t))<0?[NaN,NaN]:[t>0?i[t-1]:r[0],t<i.length?i[t]:r[r.length-1]]};o.copy=function(){return e(r,n)};return a()}([],[])},t.scale.quantize=function(){return function t(e,r,n){var i,a;function o(t){return n[Math.max(0,Math.min(a,Math.floor(i*(t-e))))]}function s(){return i=n.length/(r-e),a=n.length-1,o}o.domain=function(t){return arguments.length?(e=+t[0],r=+t[t.length-1],s()):[e,r]};o.range=function(t){return arguments.length?(n=t,s()):n};o.invertExtent=function(t){return[t=(t=n.indexOf(t))<0?NaN:t/i+e,t+1/i]};o.copy=function(){return t(e,r,n)};return s()}(0,1,[0,1])},t.scale.threshold=function(){return function e(r,n){function i(e){if(e<=e)return n[t.bisect(r,e)]}i.domain=function(t){return arguments.length?(r=t,i):r};i.range=function(t){return arguments.length?(n=t,i):n};i.invertExtent=function(t){return t=n.indexOf(t),[r[t-1],r[t]]};i.copy=function(){return e(r,n)};return i}([.5],[0,1])},t.scale.identity=function(){return function t(e){function r(t){return+t}r.invert=r;r.domain=r.range=function(t){return arguments.length?(e=t.map(r),r):e};r.ticks=function(t){return vo(e,t)};r.tickFormat=function(t,r){return go(e,t,r)};r.copy=function(){return t(e)};return r}([0,1])},t.svg={},t.svg.arc=function(){var t=Lo,e=Co,r=Eo,n=So,i=Po,a=zo,o=Oo;function s(){var s=Math.max(0,+t.apply(this,arguments)),c=Math.max(0,+e.apply(this,arguments)),u=i.apply(this,arguments)-St,f=a.apply(this,arguments)-St,h=Math.abs(f-u),d=u>f?0:1;if(c<s&&(p=c,c=s,s=p),h>=Et)return l(c,d)+(s?l(s,1-d):\"\")+\"Z\";var p,m,v,g,y,b,x,_,w,M,k,A,T=0,E=0,S=[];if((g=(+o.apply(this,arguments)||0)/2)&&(v=n===So?Math.sqrt(s*s+c*c):+n.apply(this,arguments),d||(E*=-1),c&&(E=Dt(v/c*Math.sin(g))),s&&(T=Dt(v/s*Math.sin(g)))),c){y=c*Math.cos(u+E),b=c*Math.sin(u+E),x=c*Math.cos(f-E),_=c*Math.sin(f-E);var L=Math.abs(f-u-2*E)<=At?0:1;if(E&&Do(y,b,x,_)===d^L){var C=(u+f)/2;y=c*Math.cos(C),b=c*Math.sin(C),x=_=null}}else y=b=0;if(s){w=s*Math.cos(f-T),M=s*Math.sin(f-T),k=s*Math.cos(u+T),A=s*Math.sin(u+T);var P=Math.abs(u-f+2*T)<=At?0:1;if(T&&Do(w,M,k,A)===1-d^P){var z=(u+f)/2;w=s*Math.cos(z),M=s*Math.sin(z),k=A=null}}else w=M=0;if(h>Mt&&(p=Math.min(Math.abs(c-s)/2,+r.apply(this,arguments)))>.001){m=s<c^d?0:1;var O=p,D=p;if(h<At){var I=null==k?[w,M]:null==x?[y,b]:ai([y,b],[k,A],[x,_],[w,M]),R=y-I[0],N=b-I[1],F=x-I[0],j=_-I[1],B=1/Math.sin(Math.acos((R*F+N*j)/(Math.sqrt(R*R+N*N)*Math.sqrt(F*F+j*j)))/2),U=Math.sqrt(I[0]*I[0]+I[1]*I[1]);D=Math.min(p,(s-U)/(B-1)),O=Math.min(p,(c-U)/(B+1))}if(null!=x){var V=Io(null==k?[w,M]:[k,A],[y,b],c,O,d),q=Io([x,_],[w,M],c,O,d);p===O?S.push(\"M\",V[0],\"A\",O,\",\",O,\" 0 0,\",m,\" \",V[1],\"A\",c,\",\",c,\" 0 \",1-d^Do(V[1][0],V[1][1],q[1][0],q[1][1]),\",\",d,\" \",q[1],\"A\",O,\",\",O,\" 0 0,\",m,\" \",q[0]):S.push(\"M\",V[0],\"A\",O,\",\",O,\" 0 1,\",m,\" \",q[0])}else S.push(\"M\",y,\",\",b);if(null!=k){var H=Io([y,b],[k,A],s,-D,d),G=Io([w,M],null==x?[y,b]:[x,_],s,-D,d);p===D?S.push(\"L\",G[0],\"A\",D,\",\",D,\" 0 0,\",m,\" \",G[1],\"A\",s,\",\",s,\" 0 \",d^Do(G[1][0],G[1][1],H[1][0],H[1][1]),\",\",1-d,\" \",H[1],\"A\",D,\",\",D,\" 0 0,\",m,\" \",H[0]):S.push(\"L\",G[0],\"A\",D,\",\",D,\" 0 0,\",m,\" \",H[0])}else S.push(\"L\",w,\",\",M)}else S.push(\"M\",y,\",\",b),null!=x&&S.push(\"A\",c,\",\",c,\" 0 \",L,\",\",d,\" \",x,\",\",_),S.push(\"L\",w,\",\",M),null!=k&&S.push(\"A\",s,\",\",s,\" 0 \",P,\",\",1-d,\" \",k,\",\",A);return S.push(\"Z\"),S.join(\"\")}function l(t,e){return\"M0,\"+t+\"A\"+t+\",\"+t+\" 0 1,\"+e+\" 0,\"+-t+\"A\"+t+\",\"+t+\" 0 1,\"+e+\" 0,\"+t}return s.innerRadius=function(e){return arguments.length?(t=ve(e),s):t},s.outerRadius=function(t){return arguments.length?(e=ve(t),s):e},s.cornerRadius=function(t){return arguments.length?(r=ve(t),s):r},s.padRadius=function(t){return arguments.length?(n=t==So?So:ve(t),s):n},s.startAngle=function(t){return arguments.length?(i=ve(t),s):i},s.endAngle=function(t){return arguments.length?(a=ve(t),s):a},s.padAngle=function(t){return arguments.length?(o=ve(t),s):o},s.centroid=function(){var r=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-St;return[Math.cos(n)*r,Math.sin(n)*r]},s};var So=\"auto\";function Lo(t){return t.innerRadius}function Co(t){return t.outerRadius}function Po(t){return t.startAngle}function zo(t){return t.endAngle}function Oo(t){return t&&t.padAngle}function Do(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function Io(t,e,r,n,i){var a=t[0]-e[0],o=t[1]-e[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,c=-s*a,u=t[0]+l,f=t[1]+c,h=e[0]+l,d=e[1]+c,p=(u+h)/2,m=(f+d)/2,v=h-u,g=d-f,y=v*v+g*g,b=r-n,x=u*d-h*f,_=(g<0?-1:1)*Math.sqrt(Math.max(0,b*b*y-x*x)),w=(x*g-v*_)/y,M=(-x*v-g*_)/y,k=(x*g+v*_)/y,A=(-x*v+g*_)/y,T=w-p,E=M-m,S=k-p,L=A-m;return T*T+E*E>S*S+L*L&&(w=k,M=A),[[w-l,M-c],[w*r/b,M*r/b]]}function Ro(t){var e=$n,r=ti,n=Yr,i=Fo,a=i.key,o=.7;function s(a){var s,l=[],c=[],u=-1,f=a.length,h=ve(e),d=ve(r);function p(){l.push(\"M\",i(t(c),o))}for(;++u<f;)n.call(this,s=a[u],u)?c.push([+h.call(this,s,u),+d.call(this,s,u)]):c.length&&(p(),c=[]);return c.length&&p(),l.length?l.join(\"\"):null}return s.x=function(t){return arguments.length?(e=t,s):e},s.y=function(t){return arguments.length?(r=t,s):r},s.defined=function(t){return arguments.length?(n=t,s):n},s.interpolate=function(t){return arguments.length?(a=\"function\"==typeof t?i=t:(i=No.get(t)||Fo).key,s):a},s.tension=function(t){return arguments.length?(o=t,s):o},s}t.svg.line=function(){return Ro(P)};var No=t.map({linear:Fo,\"linear-closed\":jo,step:function(t){var e=0,r=t.length,n=t[0],i=[n[0],\",\",n[1]];for(;++e<r;)i.push(\"H\",(n[0]+(n=t[e])[0])/2,\"V\",n[1]);r>1&&i.push(\"H\",n[0]);return i.join(\"\")},\"step-before\":Bo,\"step-after\":Uo,basis:Ho,\"basis-open\":function(t){if(t.length<4)return Fo(t);var e,r=[],n=-1,i=t.length,a=[0],o=[0];for(;++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);r.push(Go(Xo,a)+\",\"+Go(Xo,o)),--n;for(;++n<i;)e=t[n],a.shift(),a.push(e[0]),o.shift(),o.push(e[1]),Zo(r,a,o);return r.join(\"\")},\"basis-closed\":function(t){var e,r,n=-1,i=t.length,a=i+4,o=[],s=[];for(;++n<4;)r=t[n%i],o.push(r[0]),s.push(r[1]);e=[Go(Xo,o),\",\",Go(Xo,s)],--n;for(;++n<a;)r=t[n%i],o.shift(),o.push(r[0]),s.shift(),s.push(r[1]),Zo(e,o,s);return e.join(\"\")},bundle:function(t,e){var r=t.length-1;if(r)for(var n,i,a=t[0][0],o=t[0][1],s=t[r][0]-a,l=t[r][1]-o,c=-1;++c<=r;)n=t[c],i=c/r,n[0]=e*n[0]+(1-e)*(a+i*s),n[1]=e*n[1]+(1-e)*(o+i*l);return Ho(t)},cardinal:function(t,e){return t.length<3?Fo(t):t[0]+Vo(t,qo(t,e))},\"cardinal-open\":function(t,e){return t.length<4?Fo(t):t[1]+Vo(t.slice(1,-1),qo(t,e))},\"cardinal-closed\":function(t,e){return t.length<3?jo(t):t[0]+Vo((t.push(t[0]),t),qo([t[t.length-2]].concat(t,[t[1]]),e))},monotone:function(t){return t.length<3?Fo(t):t[0]+Vo(t,function(t){var e,r,n,i,a=[],o=function(t){var e=0,r=t.length-1,n=[],i=t[0],a=t[1],o=n[0]=Jo(i,a);for(;++e<r;)n[e]=(o+(o=Jo(i=a,a=t[e+1])))/2;return n[e]=o,n}(t),s=-1,l=t.length-1;for(;++s<l;)e=Jo(t[s],t[s+1]),y(e)<Mt?o[s]=o[s+1]=0:(r=o[s]/e,n=o[s+1]/e,(i=r*r+n*n)>9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n));s=-1;for(;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}(t))}});function Fo(t){return t.length>1?t.join(\"L\"):t+\"Z\"}function jo(t){return t.join(\"L\")+\"Z\"}function Bo(t){for(var e=0,r=t.length,n=t[0],i=[n[0],\",\",n[1]];++e<r;)i.push(\"V\",(n=t[e])[1],\"H\",n[0]);return i.join(\"\")}function Uo(t){for(var e=0,r=t.length,n=t[0],i=[n[0],\",\",n[1]];++e<r;)i.push(\"H\",(n=t[e])[0],\"V\",n[1]);return i.join(\"\")}function Vo(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return Fo(t);var r=t.length!=e.length,n=\"\",i=t[0],a=t[1],o=e[0],s=o,l=1;if(r&&(n+=\"Q\"+(a[0]-2*o[0]/3)+\",\"+(a[1]-2*o[1]/3)+\",\"+a[0]+\",\"+a[1],i=t[1],l=2),e.length>1){s=e[1],a=t[l],l++,n+=\"C\"+(i[0]+o[0])+\",\"+(i[1]+o[1])+\",\"+(a[0]-s[0])+\",\"+(a[1]-s[1])+\",\"+a[0]+\",\"+a[1];for(var c=2;c<e.length;c++,l++)a=t[l],s=e[c],n+=\"S\"+(a[0]-s[0])+\",\"+(a[1]-s[1])+\",\"+a[0]+\",\"+a[1]}if(r){var u=t[l];n+=\"Q\"+(a[0]+2*s[0]/3)+\",\"+(a[1]+2*s[1]/3)+\",\"+u[0]+\",\"+u[1]}return n}function qo(t,e){for(var r,n=[],i=(1-e)/2,a=t[0],o=t[1],s=1,l=t.length;++s<l;)r=a,a=o,o=t[s],n.push([i*(o[0]-r[0]),i*(o[1]-r[1])]);return n}function Ho(t){if(t.length<3)return Fo(t);var e=1,r=t.length,n=t[0],i=n[0],a=n[1],o=[i,i,i,(n=t[1])[0]],s=[a,a,a,n[1]],l=[i,\",\",a,\"L\",Go(Xo,o),\",\",Go(Xo,s)];for(t.push(t[r-1]);++e<=r;)n=t[e],o.shift(),o.push(n[0]),s.shift(),s.push(n[1]),Zo(l,o,s);return t.pop(),l.push(\"L\",n),l.join(\"\")}function Go(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}No.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Yo=[0,2/3,1/3,0],Wo=[0,1/3,2/3,0],Xo=[0,1/6,2/3,1/6];function Zo(t,e,r){t.push(\"C\",Go(Yo,e),\",\",Go(Yo,r),\",\",Go(Wo,e),\",\",Go(Wo,r),\",\",Go(Xo,e),\",\",Go(Xo,r))}function Jo(t,e){return(e[1]-t[1])/(e[0]-t[0])}function Ko(t){for(var e,r,n,i=-1,a=t.length;++i<a;)r=(e=t[i])[0],n=e[1]-St,e[0]=r*Math.cos(n),e[1]=r*Math.sin(n);return t}function Qo(t){var e=$n,r=$n,n=0,i=ti,a=Yr,o=Fo,s=o.key,l=o,c=\"L\",u=.7;function f(s){var f,h,d,p=[],m=[],v=[],g=-1,y=s.length,b=ve(e),x=ve(n),_=e===r?function(){return h}:ve(r),w=n===i?function(){return d}:ve(i);function M(){p.push(\"M\",o(t(v),u),c,l(t(m.reverse()),u),\"Z\")}for(;++g<y;)a.call(this,f=s[g],g)?(m.push([h=+b.call(this,f,g),d=+x.call(this,f,g)]),v.push([+_.call(this,f,g),+w.call(this,f,g)])):m.length&&(M(),m=[],v=[]);return m.length&&M(),p.length?p.join(\"\"):null}return f.x=function(t){return arguments.length?(e=r=t,f):r},f.x0=function(t){return arguments.length?(e=t,f):e},f.x1=function(t){return arguments.length?(r=t,f):r},f.y=function(t){return arguments.length?(n=i=t,f):i},f.y0=function(t){return arguments.length?(n=t,f):n},f.y1=function(t){return arguments.length?(i=t,f):i},f.defined=function(t){return arguments.length?(a=t,f):a},f.interpolate=function(t){return arguments.length?(s=\"function\"==typeof t?o=t:(o=No.get(t)||Fo).key,l=o.reverse||o,c=o.closed?\"M\":\"L\",f):s},f.tension=function(t){return arguments.length?(u=t,f):u},f}function $o(t){return t.radius}function ts(t){return[t.x,t.y]}function es(){return 64}function rs(){return\"circle\"}function ns(t){var e=Math.sqrt(t/At);return\"M0,\"+e+\"A\"+e+\",\"+e+\" 0 1,1 0,\"+-e+\"A\"+e+\",\"+e+\" 0 1,1 0,\"+e+\"Z\"}t.svg.line.radial=function(){var t=Ro(Ko);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},Bo.reverse=Uo,Uo.reverse=Bo,t.svg.area=function(){return Qo(P)},t.svg.area.radial=function(){var t=Qo(Ko);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},t.svg.chord=function(){var t=jn,e=Bn,r=$o,n=Po,i=zo;function a(r,n){var i,a,c=o(this,t,r,n),u=o(this,e,r,n);return\"M\"+c.p0+s(c.r,c.p1,c.a1-c.a0)+(a=u,(i=c).a0==a.a0&&i.a1==a.a1?l(c.r,c.p1,c.r,c.p0):l(c.r,c.p1,u.r,u.p0)+s(u.r,u.p1,u.a1-u.a0)+l(u.r,u.p1,c.r,c.p0))+\"Z\"}function o(t,e,a,o){var s=e.call(t,a,o),l=r.call(t,s,o),c=n.call(t,s,o)-St,u=i.call(t,s,o)-St;return{r:l,a0:c,a1:u,p0:[l*Math.cos(c),l*Math.sin(c)],p1:[l*Math.cos(u),l*Math.sin(u)]}}function s(t,e,r){return\"A\"+t+\",\"+t+\" 0 \"+ +(r>At)+\",1 \"+e}function l(t,e,r,n){return\"Q 0,0 \"+n}return a.radius=function(t){return arguments.length?(r=ve(t),a):r},a.source=function(e){return arguments.length?(t=ve(e),a):t},a.target=function(t){return arguments.length?(e=ve(t),a):e},a.startAngle=function(t){return arguments.length?(n=ve(t),a):n},a.endAngle=function(t){return arguments.length?(i=ve(t),a):i},a},t.svg.diagonal=function(){var t=jn,e=Bn,r=ts;function n(n,i){var a=t.call(this,n,i),o=e.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return\"M\"+(l=l.map(r))[0]+\"C\"+l[1]+\" \"+l[2]+\" \"+l[3]}return n.source=function(e){return arguments.length?(t=ve(e),n):t},n.target=function(t){return arguments.length?(e=ve(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=ts,n=e.projection;return e.projection=function(t){return arguments.length?n(function(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-St;return[r*Math.cos(n),r*Math.sin(n)]}}(r=t)):r},e},t.svg.symbol=function(){var t=rs,e=es;function r(r,n){return(is.get(t.call(this,r,n))||ns)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=ve(e),r):t},r.size=function(t){return arguments.length?(e=ve(t),r):e},r};var is=t.map({circle:ns,cross:function(t){var e=Math.sqrt(t/5)/2;return\"M\"+-3*e+\",\"+-e+\"H\"+-e+\"V\"+-3*e+\"H\"+e+\"V\"+-e+\"H\"+3*e+\"V\"+e+\"H\"+e+\"V\"+3*e+\"H\"+-e+\"V\"+e+\"H\"+-3*e+\"Z\"},diamond:function(t){var e=Math.sqrt(t/(2*os)),r=e*os;return\"M0,\"+-e+\"L\"+r+\",0 0,\"+e+\" \"+-r+\",0Z\"},square:function(t){var e=Math.sqrt(t)/2;return\"M\"+-e+\",\"+-e+\"L\"+e+\",\"+-e+\" \"+e+\",\"+e+\" \"+-e+\",\"+e+\"Z\"},\"triangle-down\":function(t){var e=Math.sqrt(t/as),r=e*as/2;return\"M0,\"+r+\"L\"+e+\",\"+-r+\" \"+-e+\",\"+-r+\"Z\"},\"triangle-up\":function(t){var e=Math.sqrt(t/as),r=e*as/2;return\"M0,\"+-r+\"L\"+e+\",\"+r+\" \"+-e+\",\"+r+\"Z\"}});t.svg.symbolTypes=is.keys();var as=Math.sqrt(3),os=Math.tan(30*Lt);W.transition=function(t){for(var e,r,n=us||++ds,i=vs(t),a=[],o=fs||{time:Date.now(),ease:ta,delay:0,duration:250},s=-1,l=this.length;++s<l;){a.push(e=[]);for(var c=this[s],u=-1,f=c.length;++u<f;)(r=c[u])&&gs(r,u,i,n,o),e.push(r)}return cs(a,i,n)},W.interrupt=function(t){return this.each(null==t?ss:ls(vs(t)))};var ss=ls(vs());function ls(t){return function(){var e,r,n;(e=this[t])&&(n=e[r=e.active])&&(n.timer.c=null,n.timer.t=NaN,--e.count?delete e[r]:delete this[t],e.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function cs(t,e,r){return V(t,hs),t.namespace=e,t.id=r,t}var us,fs,hs=[],ds=0;function ps(t,e,r,n){var i=t.id,a=t.namespace;return ut(t,\"function\"==typeof r?function(t,o,s){t[a][i].tween.set(e,n(r.call(t,t.__data__,o,s)))}:(r=n(r),function(t){t[a][i].tween.set(e,r)}))}function ms(t){return null==t&&(t=\"\"),function(){this.textContent=t}}function vs(t){return null==t?\"__transition__\":\"__transition_\"+t+\"__\"}function gs(t,e,r,n,i){var a,o,s,l,c,u=t[r]||(t[r]={active:0,count:0}),f=u[n];function h(r){var i=u.active,h=u[i];for(var p in h&&(h.timer.c=null,h.timer.t=NaN,--u.count,delete u[i],h.event&&h.event.interrupt.call(t,t.__data__,h.index)),u)if(+p<n){var m=u[p];m.timer.c=null,m.timer.t=NaN,--u.count,delete u[p]}o.c=d,ke(function(){return o.c&&d(r||1)&&(o.c=null,o.t=NaN),1},0,a),u.active=n,f.event&&f.event.start.call(t,t.__data__,e),c=[],f.tween.forEach(function(r,n){(n=n.call(t,t.__data__,e))&&c.push(n)}),l=f.ease,s=f.duration}function d(i){for(var a=i/s,o=l(a),h=c.length;h>0;)c[--h].call(t,o);if(a>=1)return f.event&&f.event.end.call(t,t.__data__,e),--u.count?delete u[n]:delete t[r],1}f||(a=i.time,o=ke(function(t){var e=f.delay;if(o.t=e+a,e<=t)return h(t-e);o.c=h},0,a),f=u[n]={tween:new x,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++u.count)}hs.call=W.call,hs.empty=W.empty,hs.node=W.node,hs.size=W.size,t.transition=function(e,r){return e&&e.transition?us?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=hs,hs.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=X(t);for(var s=-1,l=this.length;++s<l;){o.push(e=[]);for(var c=this[s],u=-1,f=c.length;++u<f;)(n=c[u])&&(r=t.call(n,n.__data__,u,s))?(\"__data__\"in n&&(r.__data__=n.__data__),gs(r,u,a,i,n[a][i]),e.push(r)):e.push(null)}return cs(o,a,i)},hs.selectAll=function(t){var e,r,n,i,a,o=this.id,s=this.namespace,l=[];t=Z(t);for(var c=-1,u=this.length;++c<u;)for(var f=this[c],h=-1,d=f.length;++h<d;)if(n=f[h]){a=n[s][o],r=t.call(n,n.__data__,h,c),l.push(e=[]);for(var p=-1,m=r.length;++p<m;)(i=r[p])&&gs(i,p,s,o,a),e.push(i)}return cs(l,s,o)},hs.filter=function(t){var e,r,n=[];\"function\"!=typeof t&&(t=ct(t));for(var i=0,a=this.length;i<a;i++){n.push(e=[]);for(var o,s=0,l=(o=this[i]).length;s<l;s++)(r=o[s])&&t.call(r,r.__data__,s,i)&&e.push(r)}return cs(n,this.namespace,this.id)},hs.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):ut(this,null==e?function(e){e[n][r].tween.remove(t)}:function(i){i[n][r].tween.set(t,e)})},hs.attr=function(e,r){if(arguments.length<2){for(r in e)this.attr(r,e[r]);return this}var n=\"transform\"==e?fa:Gi,i=t.ns.qualify(e);function a(){this.removeAttribute(i)}function o(){this.removeAttributeNS(i.space,i.local)}return ps(this,\"attr.\"+e,r,i.local?function(t){return null==t?o:(t+=\"\",function(){var e,r=this.getAttributeNS(i.space,i.local);return r!==t&&(e=n(r,t),function(t){this.setAttributeNS(i.space,i.local,e(t))})})}:function(t){return null==t?a:(t+=\"\",function(){var e,r=this.getAttribute(i);return r!==t&&(e=n(r,t),function(t){this.setAttribute(i,e(t))})})})},hs.attrTween=function(e,r){var n=t.ns.qualify(e);return this.tween(\"attr.\"+e,n.local?function(t,e){var i=r.call(this,t,e,this.getAttributeNS(n.space,n.local));return i&&function(t){this.setAttributeNS(n.space,n.local,i(t))}}:function(t,e){var i=r.call(this,t,e,this.getAttribute(n));return i&&function(t){this.setAttribute(n,i(t))}})},hs.style=function(t,e,r){var n=arguments.length;if(n<3){if(\"string\"!=typeof t){for(r in n<2&&(e=\"\"),t)this.style(r,t[r],e);return this}r=\"\"}function i(){this.style.removeProperty(t)}return ps(this,\"style.\"+t,e,function(e){return null==e?i:(e+=\"\",function(){var n,i=o(this).getComputedStyle(this,null).getPropertyValue(t);return i!==e&&(n=Gi(i,e),function(e){this.style.setProperty(t,n(e),r)})})})},hs.styleTween=function(t,e,r){return arguments.length<3&&(r=\"\"),this.tween(\"style.\"+t,function(n,i){var a=e.call(this,n,i,o(this).getComputedStyle(this,null).getPropertyValue(t));return a&&function(e){this.style.setProperty(t,a(e),r)}})},hs.text=function(t){return ps(this,\"text\",t,ms)},hs.remove=function(){var t=this.namespace;return this.each(\"end.transition\",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},hs.ease=function(e){var r=this.id,n=this.namespace;return arguments.length<1?this.node()[n][r].ease:(\"function\"!=typeof e&&(e=t.ease.apply(t,arguments)),ut(this,function(t){t[n][r].ease=e}))},hs.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:ut(this,\"function\"==typeof t?function(n,i,a){n[r][e].delay=+t.call(n,n.__data__,i,a)}:(t=+t,function(n){n[r][e].delay=t}))},hs.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:ut(this,\"function\"==typeof t?function(n,i,a){n[r][e].duration=Math.max(1,t.call(n,n.__data__,i,a))}:(t=Math.max(1,t),function(n){n[r][e].duration=t}))},hs.each=function(e,r){var n=this.id,i=this.namespace;if(arguments.length<2){var a=fs,o=us;try{us=n,ut(this,function(t,r,a){fs=t[i][n],e.call(t,t.__data__,r,a)})}finally{fs=a,us=o}}else ut(this,function(a){var o=a[i][n];(o.event||(o.event=t.dispatch(\"start\",\"end\",\"interrupt\"))).on(e,r)});return this},hs.transition=function(){for(var t,e,r,n=this.id,i=++ds,a=this.namespace,o=[],s=0,l=this.length;s<l;s++){o.push(t=[]);for(var c,u=0,f=(c=this[s]).length;u<f;u++)(e=c[u])&&gs(e,u,a,i,{time:(r=e[a][n]).time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration}),t.push(e)}return cs(o,a,i)},t.svg.axis=function(){var e,r=t.scale.linear(),i=ys,a=6,o=6,s=3,l=[10],c=null;function u(n){n.each(function(){var n,u=t.select(this),f=this.__chart__||r,h=this.__chart__=r.copy(),d=null==c?h.ticks?h.ticks.apply(h,l):h.domain():c,p=null==e?h.tickFormat?h.tickFormat.apply(h,l):P:e,m=u.selectAll(\".tick\").data(d,h),v=m.enter().insert(\"g\",\".domain\").attr(\"class\",\"tick\").style(\"opacity\",Mt),g=t.transition(m.exit()).style(\"opacity\",Mt).remove(),y=t.transition(m.order()).style(\"opacity\",1),b=Math.max(a,0)+s,x=oo(h),_=u.selectAll(\".domain\").data([0]),w=(_.enter().append(\"path\").attr(\"class\",\"domain\"),t.transition(_));v.append(\"line\"),v.append(\"text\");var M,k,A,T,E=v.select(\"line\"),S=y.select(\"line\"),L=m.select(\"text\").text(p),C=v.select(\"text\"),z=y.select(\"text\"),O=\"top\"===i||\"left\"===i?-1:1;if(\"bottom\"===i||\"top\"===i?(n=xs,M=\"x\",A=\"y\",k=\"x2\",T=\"y2\",L.attr(\"dy\",O<0?\"0em\":\".71em\").style(\"text-anchor\",\"middle\"),w.attr(\"d\",\"M\"+x[0]+\",\"+O*o+\"V0H\"+x[1]+\"V\"+O*o)):(n=_s,M=\"y\",A=\"x\",k=\"y2\",T=\"x2\",L.attr(\"dy\",\".32em\").style(\"text-anchor\",O<0?\"end\":\"start\"),w.attr(\"d\",\"M\"+O*o+\",\"+x[0]+\"H0V\"+x[1]+\"H\"+O*o)),E.attr(T,O*a),C.attr(A,O*b),S.attr(k,0).attr(T,O*a),z.attr(M,0).attr(A,O*b),h.rangeBand){var D=h,I=D.rangeBand()/2;f=h=function(t){return D(t)+I}}else f.rangeBand?f=h:g.call(n,h,f);v.call(n,f,h),y.call(n,h,h)})}return u.scale=function(t){return arguments.length?(r=t,u):r},u.orient=function(t){return arguments.length?(i=t in bs?t+\"\":ys,u):i},u.ticks=function(){return arguments.length?(l=n(arguments),u):l},u.tickValues=function(t){return arguments.length?(c=t,u):c},u.tickFormat=function(t){return arguments.length?(e=t,u):e},u.tickSize=function(t){var e=arguments.length;return e?(a=+t,o=+arguments[e-1],u):a},u.innerTickSize=function(t){return arguments.length?(a=+t,u):a},u.outerTickSize=function(t){return arguments.length?(o=+t,u):o},u.tickPadding=function(t){return arguments.length?(s=+t,u):s},u.tickSubdivide=function(){return arguments.length&&u},u};var ys=\"bottom\",bs={top:1,right:1,bottom:1,left:1};function xs(t,e,r){t.attr(\"transform\",function(t){var n=e(t);return\"translate(\"+(isFinite(n)?n:r(t))+\",0)\"})}function _s(t,e,r){t.attr(\"transform\",function(t){var n=e(t);return\"translate(0,\"+(isFinite(n)?n:r(t))+\")\"})}t.svg.brush=function(){var e,r,n=B(h,\"brushstart\",\"brush\",\"brushend\"),i=null,a=null,s=[0,0],l=[0,0],c=!0,u=!0,f=Ms[0];function h(e){e.each(function(){var e=t.select(this).style(\"pointer-events\",\"all\").style(\"-webkit-tap-highlight-color\",\"rgba(0,0,0,0)\").on(\"mousedown.brush\",v).on(\"touchstart.brush\",v),r=e.selectAll(\".background\").data([0]);r.enter().append(\"rect\").attr(\"class\",\"background\").style(\"visibility\",\"hidden\").style(\"cursor\",\"crosshair\"),e.selectAll(\".extent\").data([0]).enter().append(\"rect\").attr(\"class\",\"extent\").style(\"cursor\",\"move\");var n=e.selectAll(\".resize\").data(f,P);n.exit().remove(),n.enter().append(\"g\").attr(\"class\",function(t){return\"resize \"+t}).style(\"cursor\",function(t){return ws[t]}).append(\"rect\").attr(\"x\",function(t){return/[ew]$/.test(t)?-3:null}).attr(\"y\",function(t){return/^[ns]/.test(t)?-3:null}).attr(\"width\",6).attr(\"height\",6).style(\"visibility\",\"hidden\"),n.style(\"display\",h.empty()?\"none\":null);var o,s=t.transition(e),l=t.transition(r);i&&(o=oo(i),l.attr(\"x\",o[0]).attr(\"width\",o[1]-o[0]),p(s)),a&&(o=oo(a),l.attr(\"y\",o[0]).attr(\"height\",o[1]-o[0]),m(s)),d(s)})}function d(t){t.selectAll(\".resize\").attr(\"transform\",function(t){return\"translate(\"+s[+/e$/.test(t)]+\",\"+l[+/^s/.test(t)]+\")\"})}function p(t){t.select(\".extent\").attr(\"x\",s[0]),t.selectAll(\".extent,.n>rect,.s>rect\").attr(\"width\",s[1]-s[0])}function m(t){t.select(\".extent\").attr(\"y\",l[0]),t.selectAll(\".extent,.e>rect,.w>rect\").attr(\"height\",l[1]-l[0])}function v(){var f,v,g=this,y=t.select(t.event.target),b=n.of(g,arguments),x=t.select(g),_=y.datum(),w=!/^(n|s)$/.test(_)&&i,M=!/^(e|w)$/.test(_)&&a,k=y.classed(\"extent\"),A=bt(g),T=t.mouse(g),E=t.select(o(g)).on(\"keydown.brush\",function(){32==t.event.keyCode&&(k||(f=null,T[0]-=s[1],T[1]-=l[1],k=2),F())}).on(\"keyup.brush\",function(){32==t.event.keyCode&&2==k&&(T[0]+=s[1],T[1]+=l[1],k=0,F())});if(t.event.changedTouches?E.on(\"touchmove.brush\",C).on(\"touchend.brush\",z):E.on(\"mousemove.brush\",C).on(\"mouseup.brush\",z),x.interrupt().selectAll(\"*\").interrupt(),k)T[0]=s[0]-T[0],T[1]=l[0]-T[1];else if(_){var S=+/w$/.test(_),L=+/^n/.test(_);v=[s[1-S]-T[0],l[1-L]-T[1]],T[0]=s[S],T[1]=l[L]}else t.event.altKey&&(f=T.slice());function C(){var e=t.mouse(g),r=!1;v&&(e[0]+=v[0],e[1]+=v[1]),k||(t.event.altKey?(f||(f=[(s[0]+s[1])/2,(l[0]+l[1])/2]),T[0]=s[+(e[0]<f[0])],T[1]=l[+(e[1]<f[1])]):f=null),w&&P(e,i,0)&&(p(x),r=!0),M&&P(e,a,1)&&(m(x),r=!0),r&&(d(x),b({type:\"brush\",mode:k?\"move\":\"resize\"}))}function P(t,n,i){var a,o,h=oo(n),d=h[0],p=h[1],m=T[i],v=i?l:s,g=v[1]-v[0];if(k&&(d-=m,p-=g+m),a=(i?u:c)?Math.max(d,Math.min(p,t[i])):t[i],k?o=(a+=m)+g:(f&&(m=Math.max(d,Math.min(p,2*f[i]-a))),m<a?(o=a,a=m):o=m),v[0]!=a||v[1]!=o)return i?r=null:e=null,v[0]=a,v[1]=o,!0}function z(){C(),x.style(\"pointer-events\",\"all\").selectAll(\".resize\").style(\"display\",h.empty()?\"none\":null),t.select(\"body\").style(\"cursor\",null),E.on(\"mousemove.brush\",null).on(\"mouseup.brush\",null).on(\"touchmove.brush\",null).on(\"touchend.brush\",null).on(\"keydown.brush\",null).on(\"keyup.brush\",null),A(),b({type:\"brushend\"})}x.style(\"pointer-events\",\"none\").selectAll(\".resize\").style(\"display\",null),t.select(\"body\").style(\"cursor\",y.style(\"cursor\")),b({type:\"brushstart\"}),C()}return h.event=function(i){i.each(function(){var i=n.of(this,arguments),a={x:s,y:l,i:e,j:r},o=this.__chart__||a;this.__chart__=a,us?t.select(this).transition().each(\"start.brush\",function(){e=o.i,r=o.j,s=o.x,l=o.y,i({type:\"brushstart\"})}).tween(\"brush:brush\",function(){var t=Yi(s,a.x),n=Yi(l,a.y);return e=r=null,function(e){s=a.x=t(e),l=a.y=n(e),i({type:\"brush\",mode:\"resize\"})}}).each(\"end.brush\",function(){e=a.i,r=a.j,i({type:\"brush\",mode:\"resize\"}),i({type:\"brushend\"})}):(i({type:\"brushstart\"}),i({type:\"brush\",mode:\"resize\"}),i({type:\"brushend\"}))})},h.x=function(t){return arguments.length?(f=Ms[!(i=t)<<1|!a],h):i},h.y=function(t){return arguments.length?(f=Ms[!i<<1|!(a=t)],h):a},h.clamp=function(t){return arguments.length?(i&&a?(c=!!t[0],u=!!t[1]):i?c=!!t:a&&(u=!!t),h):i&&a?[c,u]:i?c:a?u:null},h.extent=function(t){var n,o,c,u,f;return arguments.length?(i&&(n=t[0],o=t[1],a&&(n=n[0],o=o[0]),e=[n,o],i.invert&&(n=i(n),o=i(o)),o<n&&(f=n,n=o,o=f),n==s[0]&&o==s[1]||(s=[n,o])),a&&(c=t[0],u=t[1],i&&(c=c[1],u=u[1]),r=[c,u],a.invert&&(c=a(c),u=a(u)),u<c&&(f=c,c=u,u=f),c==l[0]&&u==l[1]||(l=[c,u])),h):(i&&(e?(n=e[0],o=e[1]):(n=s[0],o=s[1],i.invert&&(n=i.invert(n),o=i.invert(o)),o<n&&(f=n,n=o,o=f))),a&&(r?(c=r[0],u=r[1]):(c=l[0],u=l[1],a.invert&&(c=a.invert(c),u=a.invert(u)),u<c&&(f=c,c=u,u=f))),i&&a?[[n,c],[o,u]]:i?[n,o]:a&&[c,u])},h.clear=function(){return h.empty()||(s=[0,0],l=[0,0],e=r=null),h},h.empty=function(){return!!i&&s[0]==s[1]||!!a&&l[0]==l[1]},t.rebind(h,n,\"on\")};var ws={n:\"ns-resize\",e:\"ew-resize\",s:\"ns-resize\",w:\"ew-resize\",nw:\"nwse-resize\",ne:\"nesw-resize\",se:\"nwse-resize\",sw:\"nesw-resize\"},Ms=[[\"n\",\"e\",\"s\",\"w\",\"nw\",\"ne\",\"se\",\"sw\"],[\"e\",\"w\"],[\"n\",\"s\"],[]],ks=Oe.format=sr.timeFormat,As=ks.utc,Ts=As(\"%Y-%m-%dT%H:%M:%S.%LZ\");function Es(t){return t.toISOString()}function Ss(e,r,n){function i(t){return e(t)}function a(e,n){var i=(e[1]-e[0])/n,a=t.bisect(Cs,i);return a==Cs.length?[r.year,mo(e.map(function(t){return t/31536e6}),n)[2]]:a?r[i/Cs[a-1]<Cs[a]/i?a-1:a]:[Os,mo(e,n)[2]]}return i.invert=function(t){return Ls(e.invert(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain().map(Ls)},i.nice=function(t,e){var r=i.domain(),n=ao(r),o=null==t?a(n,10):\"number\"==typeof t&&a(n,t);function s(r){return!isNaN(r)&&!t.range(r,Ls(+r+1),e).length}return o&&(t=o[0],e=o[1]),i.domain(lo(r,e>1?{floor:function(e){for(;s(e=t.floor(e));)e=Ls(e-1);return e},ceil:function(e){for(;s(e=t.ceil(e));)e=Ls(+e+1);return e}}:t))},i.ticks=function(t,e){var r=ao(i.domain()),n=null==t?a(r,10):\"number\"==typeof t?a(r,t):!t.range&&[{range:t},e];return n&&(t=n[0],e=n[1]),t.range(r[0],Ls(+r[1]+1),e<1?1:e)},i.tickFormat=function(){return n},i.copy=function(){return Ss(e.copy(),r,n)},ho(i,e)}function Ls(t){return new Date(t)}ks.iso=Date.prototype.toISOString&&+new Date(\"2000-01-01T00:00:00.000Z\")?Es:Ts,Es.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Es.toString=Ts.toString,Oe.second=Ne(function(t){return new De(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),Oe.seconds=Oe.second.range,Oe.seconds.utc=Oe.second.utc.range,Oe.minute=Ne(function(t){return new De(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),Oe.minutes=Oe.minute.range,Oe.minutes.utc=Oe.minute.utc.range,Oe.hour=Ne(function(t){var e=t.getTimezoneOffset()/60;return new De(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),Oe.hours=Oe.hour.range,Oe.hours.utc=Oe.hour.utc.range,Oe.month=Ne(function(t){return(t=Oe.day(t)).setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),Oe.months=Oe.month.range,Oe.months.utc=Oe.month.utc.range;var Cs=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Ps=[[Oe.second,1],[Oe.second,5],[Oe.second,15],[Oe.second,30],[Oe.minute,1],[Oe.minute,5],[Oe.minute,15],[Oe.minute,30],[Oe.hour,1],[Oe.hour,3],[Oe.hour,6],[Oe.hour,12],[Oe.day,1],[Oe.day,2],[Oe.week,1],[Oe.month,1],[Oe.month,3],[Oe.year,1]],zs=ks.multi([[\".%L\",function(t){return t.getMilliseconds()}],[\":%S\",function(t){return t.getSeconds()}],[\"%I:%M\",function(t){return t.getMinutes()}],[\"%I %p\",function(t){return t.getHours()}],[\"%a %d\",function(t){return t.getDay()&&1!=t.getDate()}],[\"%b %d\",function(t){return 1!=t.getDate()}],[\"%B\",function(t){return t.getMonth()}],[\"%Y\",Yr]]),Os={range:function(e,r,n){return t.range(Math.ceil(e/n)*n,+r,n).map(Ls)},floor:P,ceil:P};Ps.year=Oe.year,Oe.scale=function(){return Ss(t.scale.linear(),Ps,zs)};var Ds=Ps.map(function(t){return[t[0].utc,t[1]]}),Is=As.multi([[\".%L\",function(t){return t.getUTCMilliseconds()}],[\":%S\",function(t){return t.getUTCSeconds()}],[\"%I:%M\",function(t){return t.getUTCMinutes()}],[\"%I %p\",function(t){return t.getUTCHours()}],[\"%a %d\",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],[\"%b %d\",function(t){return 1!=t.getUTCDate()}],[\"%B\",function(t){return t.getUTCMonth()}],[\"%Y\",Yr]]);function Rs(t){return JSON.parse(t.responseText)}function Ns(t){var e=i.createRange();return e.selectNode(i.body),e.createContextualFragment(t.responseText)}Ds.year=Oe.year.utc,Oe.scale.utc=function(){return Ss(t.scale.linear(),Ds,Is)},t.text=ge(function(t){return t.responseText}),t.json=function(t,e){return ye(t,\"application/json\",Rs,e)},t.html=function(t,e){return ye(t,\"text/html\",Ns,e)},t.xml=ge(function(t){return t.responseXML}),\"object\"==typeof e&&e.exports?e.exports=t:this.d3=t}()},{}],129:[function(t,e,r){e.exports=function(){for(var t=0;t<arguments.length;t++)if(void 0!==arguments[t])return arguments[t]}},{}],130:[function(t,e,r){\"use strict\";var n=t(\"incremental-convex-hull\"),i=t(\"uniq\");function a(t,e){this.point=t,this.index=e}function o(t,e){for(var r=t.point,n=e.point,i=r.length,a=0;a<i;++a){var o=n[a]-r[a];if(o)return o}return 0}e.exports=function(t,e){var r=t.length;if(0===r)return[];var s=t[0].length;if(s<1)return[];if(1===s)return function(t,e,r){if(1===t)return r?[[-1,0]]:[];var n=e.map(function(t,e){return[t[0],e]});n.sort(function(t,e){return t[0]-e[0]});for(var i=new Array(t-1),a=1;a<t;++a){var o=n[a-1],s=n[a];i[a-1]=[o[1],s[1]]}r&&i.push([-1,i[0][1]],[i[t-1][1],-1]);return i}(r,t,e);for(var l=new Array(r),c=1,u=0;u<r;++u){for(var f=t[u],h=new Array(s+1),d=0,p=0;p<s;++p){var m=f[p];h[p]=m,d+=m*m}h[s]=d,l[u]=new a(h,u),c=Math.max(d,c)}i(l,o),r=l.length;for(var v=new Array(r+s+1),g=new Array(r+s+1),y=(s+1)*(s+1)*c,b=new Array(s+1),u=0;u<=s;++u)b[u]=0;b[s]=y,v[0]=b.slice(),g[0]=-1;for(var u=0;u<=s;++u){var h=b.slice();h[u]=1,v[u+1]=h,g[u+1]=-1}for(var u=0;u<r;++u){var x=l[u];v[u+s+1]=x.point,g[u+s+1]=x.index}var _=n(v,!1);_=e?_.filter(function(t){for(var e=0,r=0;r<=s;++r){var n=g[t[r]];if(n<0&&++e>=2)return!1;t[r]=n}return!0}):_.filter(function(t){for(var e=0;e<=s;++e){var r=g[t[e]];if(r<0)return!1;t[e]=r}return!0});if(1&s)for(var u=0;u<_.length;++u){var x=_[u],h=x[0];x[0]=x[1],x[1]=h}return _}},{\"incremental-convex-hull\":258,uniq:536}],131:[function(t,e,r){(function(t){var r=!1;if(\"undefined\"!=typeof Float64Array){var n=new Float64Array(1),i=new Uint32Array(n.buffer);if(n[0]=1,r=!0,1072693248===i[1]){e.exports=function(t){return n[0]=t,[i[0],i[1]]},e.exports.pack=function(t,e){return i[0]=t,i[1]=e,n[0]},e.exports.lo=function(t){return n[0]=t,i[0]},e.exports.hi=function(t){return n[0]=t,i[1]}}else if(1072693248===i[0]){e.exports=function(t){return n[0]=t,[i[1],i[0]]},e.exports.pack=function(t,e){return i[1]=t,i[0]=e,n[0]},e.exports.lo=function(t){return n[0]=t,i[1]},e.exports.hi=function(t){return n[0]=t,i[0]}}else r=!1}if(!r){var a=new t(8);e.exports=function(t){return a.writeDoubleLE(t,0,!0),[a.readUInt32LE(0,!0),a.readUInt32LE(4,!0)]},e.exports.pack=function(t,e){return a.writeUInt32LE(t,0,!0),a.writeUInt32LE(e,4,!0),a.readDoubleLE(0,!0)},e.exports.lo=function(t){return a.writeDoubleLE(t,0,!0),a.readUInt32LE(0,!0)},e.exports.hi=function(t){return a.writeDoubleLE(t,0,!0),a.readUInt32LE(4,!0)}}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this,t(\"buffer\").Buffer)},{buffer:83}],132:[function(t,e,r){var n=t(\"abs-svg-path\"),i=t(\"normalize-svg-path\"),a={M:\"moveTo\",C:\"bezierCurveTo\"};e.exports=function(t,e){t.beginPath(),i(n(e)).forEach(function(e){var r=e[0],n=e.slice(1);t[a[r]].apply(t,n)}),t.closePath()}},{\"abs-svg-path\":43,\"normalize-svg-path\":441}],133:[function(t,e,r){e.exports=function(t){switch(t){case\"int8\":return Int8Array;case\"int16\":return Int16Array;case\"int32\":return Int32Array;case\"uint8\":return Uint8Array;case\"uint16\":return Uint16Array;case\"uint32\":return Uint32Array;case\"float32\":return Float32Array;case\"float64\":return Float64Array;case\"array\":return Array;case\"uint8_clamped\":return Uint8ClampedArray}}},{}],134:[function(t,e,r){\"use strict\";e.exports=function(t,e){switch(void 0===e&&(e=0),typeof t){case\"number\":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n<t;++n)r[n]=e;return r}(0|t,e);break;case\"object\":if(\"number\"==typeof t.length)return function t(e,r,n){var i=0|e[n];if(i<=0)return[];var a,o=new Array(i);if(n===e.length-1)for(a=0;a<i;++a)o[a]=r;else for(a=0;a<i;++a)o[a]=t(e,r,n+1);return o}(t,e,0)}return[]}},{}],135:[function(t,e,r){\"use strict\";function n(t,e,r){r=r||2;var n,s,l,c,u,d,m,v=e&&e.length,g=v?e[0]*r:t.length,y=i(t,0,g,r,!0),b=[];if(!y)return b;if(v&&(y=function(t,e,r,n){var o,s,l,c,u,d=[];for(o=0,s=e.length;o<s;o++)l=e[o]*n,c=o<s-1?e[o+1]*n:t.length,(u=i(t,l,c,n,!1))===u.next&&(u.steiner=!0),d.push(p(u));for(d.sort(f),o=0;o<d.length;o++)h(d[o],r),r=a(r,r.next);return r}(t,e,y,r)),t.length>80*r){n=l=t[0],s=c=t[1];for(var x=r;x<g;x+=r)u=t[x],d=t[x+1],u<n&&(n=u),d<s&&(s=d),u>l&&(l=u),d>c&&(c=d);m=0!==(m=Math.max(l-n,c-s))?1/m:0}return o(y,b,r,n,s,m),b}function i(t,e,r,n,i){var a,o;if(i===A(t,e,r,n)>0)for(a=e;a<r;a+=n)o=w(a,t[a],t[a+1],o);else for(a=r-n;a>=e;a-=n)o=w(a,t[a],t[a+1],o);return o&&y(o,o.next)&&(M(o),o=o.next),o}function a(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!y(n,n.next)&&0!==g(n.prev,n,n.next))n=n.next;else{if(M(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,i,f,h){if(t){!h&&f&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=d(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e<c&&(s++,n=n.nextZ);e++);for(l=c;s>0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(t,n,i,f);for(var p,m,v=t;t.prev!==t.next;)if(p=t.prev,m=t.next,f?l(t,n,i,f):s(t))e.push(p.i/r),e.push(t.i/r),e.push(m.i/r),M(t),t=m.next,v=m.next;else if((t=m)===v){h?1===h?o(t=c(t,e,r),e,r,n,i,f,2):2===h&&u(t,e,r,n,i,f):o(a(t),e,r,n,i,f,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(g(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(m(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&g(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function l(t,e,r,n){var i=t.prev,a=t,o=t.next;if(g(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,l=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,c=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=d(s,l,e,r,n),h=d(c,u,e,r,n),p=t.prevZ,v=t.nextZ;p&&p.z>=f&&v&&v.z<=h;){if(p!==t.prev&&p!==t.next&&m(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&g(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,v!==t.prev&&v!==t.next&&m(i.x,i.y,a.x,a.y,o.x,o.y,v.x,v.y)&&g(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;p&&p.z>=f;){if(p!==t.prev&&p!==t.next&&m(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&g(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;v&&v.z<=h;){if(v!==t.prev&&v!==t.next&&m(i.x,i.y,a.x,a.y,o.x,o.y,v.x,v.y)&&g(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function c(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!y(i,a)&&b(i,n,n.next,a)&&x(i,a)&&x(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),M(n),M(n.next),n=t=a),n=n.next}while(n!==t);return n}function u(t,e,r,n,i,s){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&v(l,c)){var u=_(l,c);return l=a(l,l.next),u=a(u,u.next),o(l,e,r,n,i,s),void o(u,e,r,n,i,s)}c=c.next}l=l.next}while(l!==t)}function f(t,e){return t.x-e.x}function h(t,e){if(e=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!r)return null;if(i===o)return r.prev;var l,c=r,u=r.x,f=r.y,h=1/0;n=r.next;for(;n!==c;)i>=n.x&&n.x>=u&&i!==n.x&&m(a<f?i:o,a,u,f,a<f?o:i,a,n.x,n.y)&&((l=Math.abs(a-n.y)/(i-n.x))<h||l===h&&n.x>r.x)&&x(n,t)&&(r=n,h=l),n=n.next;return r}(t,e)){var r=_(e,t);a(r,r.next)}}function d(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,r=t;do{e.x<r.x&&(r=e),e=e.next}while(e!==t);return r}function m(t,e,r,n,i,a,o,s){return(i-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&b(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&x(t,e)&&x(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)}function g(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function b(t,e,r,n){return!!(y(t,e)&&y(r,n)||y(t,n)&&y(r,e))||g(t,e,r)>0!=g(t,e,n)>0&&g(r,n,t)>0!=g(r,n,e)>0}function x(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function _(t,e){var r=new k(t.i,t.x,t.y),n=new k(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function w(t,e,r,n){var i=new k(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function M(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function k(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(t,e,r,n){for(var i=0,a=e,o=r-n;a<r;a+=n)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}e.exports=n,e.exports.default=n,n.deviation=function(t,e,r,n){var i=e&&e.length,a=i?e[0]*r:t.length,o=Math.abs(A(t,0,a,r));if(i)for(var s=0,l=e.length;s<l;s++){var c=e[s]*r,u=s<l-1?e[s+1]*r:t.length;o-=Math.abs(A(t,c,u,r))}var f=0;for(s=0;s<n.length;s+=3){var h=n[s]*r,d=n[s+1]*r,p=n[s+2]*r;f+=Math.abs((t[h]-t[p])*(t[d+1]-t[h+1])-(t[h]-t[d])*(t[p+1]-t[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},n.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var a=0;a<t[i].length;a++)for(var o=0;o<e;o++)r.vertices.push(t[i][a][o]);i>0&&(n+=t[i-1].length,r.holes.push(n))}return r}},{}],136:[function(t,e,r){\"use strict\";e.exports=function(t,e){var r=t.length;if(\"number\"!=typeof e){e=0;for(var i=0;i<r;++i){var a=t[i];e=Math.max(e,a[0],a[1])}e=1+(0|e)}e|=0;for(var o=new Array(e),i=0;i<e;++i)o[i]=[];for(var i=0;i<r;++i){var a=t[i];o[a[0]].push(a[1]),o[a[1]].push(a[0])}for(var s=0;s<e;++s)n(o[s],function(t,e){return t-e});return o};var n=t(\"uniq\")},{uniq:536}],137:[function(t,e,r){(function(n,i){!function(t,n){\"object\"==typeof r&&void 0!==e?e.exports=n():t.ES6Promise=n()}(this,function(){\"use strict\";function e(t){return\"function\"==typeof t}var r=Array.isArray?Array.isArray:function(t){return\"[object Array]\"===Object.prototype.toString.call(t)},a=0,o=void 0,s=void 0,l=function(t,e){m[a]=t,m[a+1]=e,2===(a+=2)&&(s?s(v):_())};var c=\"undefined\"!=typeof window?window:void 0,u=c||{},f=u.MutationObserver||u.WebKitMutationObserver,h=\"undefined\"==typeof self&&void 0!==n&&\"[object process]\"==={}.toString.call(n),d=\"undefined\"!=typeof Uint8ClampedArray&&\"undefined\"!=typeof importScripts&&\"undefined\"!=typeof MessageChannel;function p(){var t=setTimeout;return function(){return t(v,1)}}var m=new Array(1e3);function v(){for(var t=0;t<a;t+=2){(0,m[t])(m[t+1]),m[t]=void 0,m[t+1]=void 0}a=0}var g,y,b,x,_=void 0;function w(t,e){var r=arguments,n=this,i=new this.constructor(A);void 0===i[k]&&V(i);var a,o=n._state;return o?(a=r[o-1],l(function(){return B(o,i,a,n._result)})):R(n,i,t,e),i}function M(t){if(t&&\"object\"==typeof t&&t.constructor===this)return t;var e=new this(A);return z(e,t),e}h?_=function(){return n.nextTick(v)}:f?(y=0,b=new f(v),x=document.createTextNode(\"\"),b.observe(x,{characterData:!0}),_=function(){x.data=y=++y%2}):d?((g=new MessageChannel).port1.onmessage=v,_=function(){return g.port2.postMessage(0)}):_=void 0===c&&\"function\"==typeof t?function(){try{var e=t(\"vertx\");return o=e.runOnLoop||e.runOnContext,function(){o(v)}}catch(t){return p()}}():p();var k=Math.random().toString(36).substring(16);function A(){}var T=void 0,E=1,S=2,L=new F;function C(t){try{return t.then}catch(t){return L.error=t,L}}function P(t,r,n){r.constructor===t.constructor&&n===w&&r.constructor.resolve===M?function(t,e){e._state===E?D(t,e._result):e._state===S?I(t,e._result):R(e,void 0,function(e){return z(t,e)},function(e){return I(t,e)})}(t,r):n===L?I(t,L.error):void 0===n?D(t,r):e(n)?function(t,e,r){l(function(t){var n=!1,i=function(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}(r,e,function(r){n||(n=!0,e!==r?z(t,r):D(t,r))},function(e){n||(n=!0,I(t,e))},t._label);!n&&i&&(n=!0,I(t,i))},t)}(t,r,n):D(t,r)}function z(t,e){var r;t===e?I(t,new TypeError(\"You cannot resolve a promise with itself\")):\"function\"==typeof(r=e)||\"object\"==typeof r&&null!==r?P(t,e,C(e)):D(t,e)}function O(t){t._onerror&&t._onerror(t._result),N(t)}function D(t,e){t._state===T&&(t._result=e,t._state=E,0!==t._subscribers.length&&l(N,t))}function I(t,e){t._state===T&&(t._state=S,t._result=e,l(O,t))}function R(t,e,r,n){var i=t._subscribers,a=i.length;t._onerror=null,i[a]=e,i[a+E]=r,i[a+S]=n,0===a&&t._state&&l(N,t)}function N(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,i=void 0,a=t._result,o=0;o<e.length;o+=3)n=e[o],i=e[o+r],n?B(r,n,i,a):i(a);t._subscribers.length=0}}function F(){this.error=null}var j=new F;function B(t,r,n,i){var a=e(n),o=void 0,s=void 0,l=void 0,c=void 0;if(a){if((o=function(t,e){try{return t(e)}catch(t){return j.error=t,j}}(n,i))===j?(c=!0,s=o.error,o=null):l=!0,r===o)return void I(r,new TypeError(\"A promises callback cannot return that same promise.\"))}else o=i,l=!0;r._state!==T||(a&&l?z(r,o):c?I(r,s):t===E?D(r,o):t===S&&I(r,o))}var U=0;function V(t){t[k]=U++,t._state=void 0,t._result=void 0,t._subscribers=[]}function q(t,e){this._instanceConstructor=t,this.promise=new t(A),this.promise[k]||V(this.promise),r(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?D(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&D(this.promise,this._result))):I(this.promise,new Error(\"Array Methods must be provided an Array\"))}function H(t){this[k]=U++,this._result=this._state=void 0,this._subscribers=[],A!==t&&(\"function\"!=typeof t&&function(){throw new TypeError(\"You must pass a resolver function as the first argument to the promise constructor\")}(),this instanceof H?function(t,e){try{e(function(e){z(t,e)},function(e){I(t,e)})}catch(e){I(t,e)}}(this,t):function(){throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\")}())}function G(){var t=void 0;if(void 0!==i)t=i;else if(\"undefined\"!=typeof self)t=self;else try{t=Function(\"return this\")()}catch(t){throw new Error(\"polyfill failed because global object is unavailable in this environment\")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if(\"[object Promise]\"===r&&!e.cast)return}t.Promise=H}return q.prototype._enumerate=function(){for(var t=this.length,e=this._input,r=0;this._state===T&&r<t;r++)this._eachEntry(e[r],r)},q.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===M){var i=C(t);if(i===w&&t._state!==T)this._settledAt(t._state,e,t._result);else if(\"function\"!=typeof i)this._remaining--,this._result[e]=t;else if(r===H){var a=new r(A);P(a,t,i),this._willSettleAt(a,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},q.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===T&&(this._remaining--,t===S?I(n,r):this._result[e]=r),0===this._remaining&&D(n,this._result)},q.prototype._willSettleAt=function(t,e){var r=this;R(t,void 0,function(t){return r._settledAt(E,e,t)},function(t){return r._settledAt(S,e,t)})},H.all=function(t){return new q(this,t).promise},H.race=function(t){var e=this;return r(t)?new e(function(r,n){for(var i=t.length,a=0;a<i;a++)e.resolve(t[a]).then(r,n)}):new e(function(t,e){return e(new TypeError(\"You must pass an array to race.\"))})},H.resolve=M,H.reject=function(t){var e=new this(A);return I(e,t),e},H._setScheduler=function(t){s=t},H._setAsap=function(t){l=t},H._asap=l,H.prototype={constructor:H,then:w,catch:function(t){return this.then(null,t)}},G(),H.polyfill=G,H.Promise=H,H})}).call(this,t(\"_process\"),\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{_process:469}],138:[function(t,e,r){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return\"function\"==typeof t}function a(t){return\"object\"==typeof t&&null!==t}function o(t){return void 0===t}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(\"number\"!=typeof t||t<0||isNaN(t))throw TypeError(\"n must be a positive number\");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,r,n,s,l,c;if(this._events||(this._events={}),\"error\"===t&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var u=new Error('Uncaught, unspecified \"error\" event. ('+e+\")\");throw u.context=e,u}if(o(r=this._events[t]))return!1;if(i(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(a(r))for(s=Array.prototype.slice.call(arguments,1),n=(c=r.slice()).length,l=0;l<n;l++)c[l].apply(this,s);return!0},n.prototype.addListener=function(t,e){var r;if(!i(e))throw TypeError(\"listener must be a function\");return this._events||(this._events={}),this._events.newListener&&this.emit(\"newListener\",t,i(e.listener)?e.listener:e),this._events[t]?a(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,a(this._events[t])&&!this._events[t].warned&&(r=o(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&r>0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error(\"(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.\",this._events[t].length),\"function\"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){if(!i(e))throw TypeError(\"listener must be a function\");var r=!1;function n(){this.removeListener(t,n),r||(r=!0,e.apply(this,arguments))}return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var r,n,o,s;if(!i(e))throw TypeError(\"listener must be a function\");if(!this._events||!this._events[t])return this;if(o=(r=this._events[t]).length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit(\"removeListener\",t,e);else if(a(r)){for(s=o;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit(\"removeListener\",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)\"removeListener\"!==e&&this.removeAllListeners(e);return this.removeAllListeners(\"removeListener\"),this._events={},this}if(i(r=this._events[t]))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],139:[function(t,e,r){\"use strict\";e.exports=function(t,e,r){var n=e||0,i=r||1;return[[t[12]+t[0],t[13]+t[1],t[14]+t[2],t[15]+t[3]],[t[12]-t[0],t[13]-t[1],t[14]-t[2],t[15]-t[3]],[t[12]+t[4],t[13]+t[5],t[14]+t[6],t[15]+t[7]],[t[12]-t[4],t[13]-t[5],t[14]-t[6],t[15]-t[7]],[n*t[12]+t[8],n*t[13]+t[9],n*t[14]+t[10],n*t[15]+t[11]],[i*t[12]-t[8],i*t[13]-t[9],i*t[14]-t[10],i*t[15]-t[11]]]}},{}],140:[function(t,e,r){\"use strict\";e.exports=function(t){var e=typeof t;if(\"string\"===e){var r=t;if(0===(t=+t)&&function(t){for(var e,r=t.length,n=0;n<r;n++)if(((e=t.charCodeAt(n))<9||e>13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}(r))return!1}else if(\"number\"!==e)return!1;return t-t<1}},{}],141:[function(t,e,r){\"use strict\";e.exports=function(t){return new Function(\"f\",\"var p = (f && f.properties || {}); return \"+i(t))};var n=[\"Unknown\",\"Point\",\"LineString\",\"Polygon\"];function i(t){if(!t)return\"true\";var e=t[0];return t.length<=1?\"any\"===e?\"false\":\"true\":\"(\"+(\"==\"===e?o(t[1],t[2],\"===\",!1):\"!=\"===e?o(t[1],t[2],\"!==\",!1):\"<\"===e||\">\"===e||\"<=\"===e||\">=\"===e?o(t[1],t[2],e,!0):\"any\"===e?s(t.slice(1),\"||\"):\"all\"===e?s(t.slice(1),\"&&\"):\"none\"===e?u(s(t.slice(1),\"||\")):\"in\"===e?l(t[1],t.slice(2)):\"!in\"===e?u(l(t[1],t.slice(2))):\"has\"===e?c(t[1]):\"!has\"===e?u(c([t[1]])):\"true\")+\")\"}function a(t){return\"$type\"===t?\"f.type\":\"$id\"===t?\"f.id\":\"p[\"+JSON.stringify(t)+\"]\"}function o(t,e,r,i){var o=a(t),s=\"$type\"===t?n.indexOf(e):JSON.stringify(e);return(i?\"typeof \"+o+\"=== typeof \"+s+\"&&\":\"\")+o+r+s}function s(t,e){return t.map(i).join(e)}function l(t,e){\"$type\"===t&&(e=e.map(function(t){return n.indexOf(t)}));var r=JSON.stringify(e.sort(f)),i=a(t);return e.length<=200?r+\".indexOf(\"+i+\") !== -1\":\"function(v, a, i, j) {while (i <= j) { var m = (i + j) >> 1; if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;}return false; }(\"+i+\", \"+r+\",0,\"+(e.length-1)+\")\"}function c(t){return JSON.stringify(t)+\" in p\"}function u(t){return\"!(\"+t+\")\"}function f(t,e){return t<e?-1:t>e?1:0}},{}],142:[function(t,e,r){\"use strict\";e.exports=function(t,e,r){switch(arguments.length){case 0:return new o([0],[0],0);case 1:if(\"number\"==typeof t){var n=l(t);return new o(n,n,0)}return new o(t,l(t.length),0);case 2:if(\"number\"==typeof e){var n=l(t.length);return new o(t,n,+e)}r=0;case 3:if(t.length!==e.length)throw new Error(\"state and velocity lengths must match\");return new o(t,e,r)}};var n=t(\"cubic-hermite\"),i=t(\"binary-search-bounds\");function a(t,e,r){return Math.min(e,Math.max(t,r))}function o(t,e,r){this.dimension=t.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;n<this.dimension;++n)this.bounds[0][n]=-1/0,this.bounds[1][n]=1/0;this._state=t.slice().reverse(),this._velocity=e.slice().reverse(),this._time=[r],this._scratch=[t.slice(),t.slice(),t.slice(),t.slice(),t.slice()]}var s=o.prototype;function l(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=0;return e}s.flush=function(t){var e=i.gt(this._time,t)-1;e<=0||(this._time.splice(0,e),this._state.splice(0,e*this.dimension),this._velocity.splice(0,e*this.dimension))},s.curve=function(t){var e=this._time,r=e.length,o=i.le(e,t),s=this._scratch[0],l=this._state,c=this._velocity,u=this.dimension,f=this.bounds;if(o<0)for(var h=u-1,d=0;d<u;++d,--h)s[d]=l[h];else if(o>=r-1){h=l.length-1;var p=t-e[r-1];for(d=0;d<u;++d,--h)s[d]=l[h]+p*c[h]}else{h=u*(o+1)-1;var m=e[o],v=e[o+1]-m||1,g=this._scratch[1],y=this._scratch[2],b=this._scratch[3],x=this._scratch[4],_=!0;for(d=0;d<u;++d,--h)g[d]=l[h],b[d]=c[h]*v,y[d]=l[h+u],x[d]=c[h+u]*v,_=_&&g[d]===y[d]&&b[d]===x[d]&&0===b[d];if(_)for(d=0;d<u;++d)s[d]=g[d];else n(g,b,y,x,(t-m)/v,s)}var w=f[0],M=f[1];for(d=0;d<u;++d)s[d]=a(w[d],M[d],s[d]);return s},s.dcurve=function(t){var e=this._time,r=e.length,a=i.le(e,t),o=this._scratch[0],s=this._state,l=this._velocity,c=this.dimension;if(a>=r-1)for(var u=s.length-1,f=(e[r-1],0);f<c;++f,--u)o[f]=l[u];else{u=c*(a+1)-1;var h=e[a],d=e[a+1]-h||1,p=this._scratch[1],m=this._scratch[2],v=this._scratch[3],g=this._scratch[4],y=!0;for(f=0;f<c;++f,--u)p[f]=s[u],v[f]=l[u]*d,m[f]=s[u+c],g[f]=l[u+c]*d,y=y&&p[f]===m[f]&&v[f]===g[f]&&0===v[f];if(y)for(f=0;f<c;++f)o[f]=0;else{n.derivative(p,v,m,g,(t-h)/d,o);for(f=0;f<c;++f)o[f]/=d}}return o},s.lastT=function(){var t=this._time;return t[t.length-1]},s.stable=function(){for(var t=this._velocity,e=t.length,r=this.dimension-1;r>=0;--r)if(t[--e])return!1;return!0},s.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t<e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1];this._time.push(e,t);for(var u=0;u<2;++u)for(var f=0;f<r;++f)n.push(n[o++]),i.push(0);this._time.push(t);for(f=r;f>0;--f)n.push(a(l[f-1],c[f-1],arguments[f])),i.push(0)}},s.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t<e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=t-e,l=this.bounds,c=l[0],u=l[1],f=s>1e-6?1/s:0;this._time.push(t);for(var h=r;h>0;--h){var d=a(c[h-1],u[h-1],arguments[h]);n.push(d),i.push((d-n[o++])*f)}}},s.set=function(t){var e=this.dimension;if(!(t<this.lastT()||arguments.length!==e+1)){var r=this._state,n=this._velocity,i=this.bounds,o=i[0],s=i[1];this._time.push(t);for(var l=e;l>0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=t-e,f=u>1e-6?1/u:0;this._time.push(t);for(var h=r;h>0;--h){var d=arguments[h];n.push(a(l[h-1],c[h-1],n[o++]+d)),i.push(d*f)}}},s.idle=function(t){var e=this.lastT();if(!(t<e)){var r=this.dimension,n=this._state,i=this._velocity,o=n.length-r,s=this.bounds,l=s[0],c=s[1],u=t-e;this._time.push(t);for(var f=r-1;f>=0;--f)n.push(a(l[f],c[f],n[o]+u*i[o])),i.push(0),o+=1}}},{\"binary-search-bounds\":70,\"cubic-hermite\":115}],143:[function(t,e,r){var n=t(\"dtype\");e.exports=function(t,e,r){if(!t)throw new TypeError(\"must specify data as first parameter\");if(r=0|+(r||0),Array.isArray(t)&&Array.isArray(t[0])){var i=t[0].length,a=t.length*i;e&&\"string\"!=typeof e||(e=new(n(e||\"float32\"))(a+r));var o=e.length-r;if(a!==o)throw new Error(\"source length \"+a+\" (\"+i+\"x\"+t.length+\") does not match destination length \"+o);for(var s=0,l=r;s<t.length;s++)for(var c=0;c<i;c++)e[l++]=t[s][c]}else if(e&&\"string\"!=typeof e)e.set(t,r);else{var u=n(e||\"float32\");0===r?e=new u(t):(e=new u(t.length+r)).set(t,r)}return e}},{dtype:133}],144:[function(t,e,r){\"use strict\";e.exports=function(t){return new c(t||p,null)};var n=0,i=1;function a(t,e,r,n,i,a){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=a}function o(t){return new a(t._color,t.key,t.value,t.left,t.right,t._count)}function s(t,e){return new a(t,e.key,e.value,e.left,e.right,e._count)}function l(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function c(t,e){this._compare=t,this.root=e}var u=c.prototype;function f(t,e){this.tree=t,this._stack=e}Object.defineProperty(u,\"keys\",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(u,\"values\",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(u,\"length\",{get:function(){return this.root?this.root._count:0}}),u.insert=function(t,e){for(var r=this._compare,o=this.root,u=[],f=[];o;){var h=r(t,o.key);u.push(o),f.push(h),o=h<=0?o.left:o.right}u.push(new a(n,t,e,null,null,1));for(var d=u.length-2;d>=0;--d){o=u[d];f[d]<=0?u[d]=new a(o._color,o.key,o.value,u[d+1],o.right,o._count+1):u[d]=new a(o._color,o.key,o.value,o.left,u[d+1],o._count+1)}for(d=u.length-1;d>1;--d){var p=u[d-1];o=u[d];if(p._color===i||o._color===i)break;var m=u[d-2];if(m.left===p)if(p.left===o){if(!(v=m.right)||v._color!==n){if(m._color=n,m.left=p.right,p._color=i,p.right=m,u[d-2]=p,u[d-1]=o,l(m),l(p),d>=3)(g=u[d-3]).left===m?g.left=p:g.right=p;break}p._color=i,m.right=s(i,v),m._color=n,d-=1}else{if(!(v=m.right)||v._color!==n){if(p.right=o.left,m._color=n,m.left=o.right,o._color=i,o.left=p,o.right=m,u[d-2]=o,u[d-1]=p,l(m),l(p),l(o),d>=3)(g=u[d-3]).left===m?g.left=o:g.right=o;break}p._color=i,m.right=s(i,v),m._color=n,d-=1}else if(p.right===o){if(!(v=m.left)||v._color!==n){if(m._color=n,m.right=p.left,p._color=i,p.left=m,u[d-2]=p,u[d-1]=o,l(m),l(p),d>=3)(g=u[d-3]).right===m?g.right=p:g.left=p;break}p._color=i,m.left=s(i,v),m._color=n,d-=1}else{var v;if(!(v=m.left)||v._color!==n){var g;if(p.left=o.right,m._color=n,m.right=o.left,o._color=i,o.right=p,o.left=m,u[d-2]=o,u[d-1]=p,l(m),l(p),l(o),d>=3)(g=u[d-3]).right===m?g.right=o:g.left=o;break}p._color=i,m.left=s(i,v),m._color=n,d-=1}}return u[0]._color=i,new c(r,u[0])},u.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return function t(e,r){var n;if(r.left&&(n=t(e,r.left)))return n;return(n=e(r.key,r.value))||(r.right?t(e,r.right):void 0)}(t,this.root);case 2:return function t(e,r,n,i){if(r(e,i.key)<=0){var a;if(i.left&&(a=t(e,r,n,i.left)))return a;if(a=n(i.key,i.value))return a}if(i.right)return t(e,r,n,i.right)}(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return function t(e,r,n,i,a){var o,s=n(e,a.key),l=n(r,a.key);if(s<=0){if(a.left&&(o=t(e,r,n,i,a.left)))return o;if(l>0&&(o=i(a.key,a.value)))return o}if(l>0&&a.right)return t(e,r,n,i,a.right)}(e,r,this._compare,t,this.root)}},Object.defineProperty(u,\"begin\",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new f(this,t)}}),Object.defineProperty(u,\"end\",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new f(this,t)}}),u.at=function(t){if(t<0)return new f(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t<e.left._count){e=e.left;continue}t-=e.left._count}if(!t)return new f(this,r);if(t-=1,!e.right)break;if(t>=e.right._count)break;e=e.right}return new f(this,[])},u.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new f(this,n)},u.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new f(this,n)},u.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new f(this,n)},u.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new f(this,n)},u.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new f(this,n);r=i<=0?r.left:r.right}return new f(this,[])},u.remove=function(t){var e=this.find(t);return e?e.remove():this},u.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var h=f.prototype;function d(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function p(t,e){return t<e?-1:t>e?1:0}Object.defineProperty(h,\"valid\",{get:function(){return this._stack.length>0}}),Object.defineProperty(h,\"node\",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),h.clone=function(){return new f(this.tree,this._stack.slice())},h.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new a(r._color,r.key,r.value,r.left,r.right,r._count);for(var u=t.length-2;u>=0;--u){(r=t[u]).left===t[u+1]?e[u]=new a(r._color,r.key,r.value,e[u+1],r.right,r._count):e[u]=new a(r._color,r.key,r.value,r.left,e[u+1],r._count)}if((r=e[e.length-1]).left&&r.right){var f=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var h=e[f-1];e.push(new a(r._color,h.key,h.value,r.left,r.right,r._count)),e[f-1].key=r.key,e[f-1].value=r.value;for(u=e.length-2;u>=f;--u)r=e[u],e[u]=new a(r._color,r.key,r.value,r.left,e[u+1],r._count);e[f-1].left=e[f]}if((r=e[e.length-1])._color===n){var p=e[e.length-2];p.left===r?p.left=null:p.right===r&&(p.right=null),e.pop();for(u=0;u<e.length;++u)e[u]._count--;return new c(this.tree._compare,e[0])}if(r.left||r.right){r.left?d(r,r.left):r.right&&d(r,r.right),r._color=i;for(u=0;u<e.length-1;++u)e[u]._count--;return new c(this.tree._compare,e[0])}if(1===e.length)return new c(this.tree._compare,null);for(u=0;u<e.length;++u)e[u]._count--;var m=e[e.length-2];return function(t){for(var e,r,a,c,u=t.length-1;u>=0;--u){if(e=t[u],0===u)return void(e._color=i);if((r=t[u-1]).left===e){if((a=r.right).right&&a.right._color===n)return c=(a=r.right=o(a)).right=o(a.right),r.right=a.left,a.left=r,a.right=c,a._color=r._color,e._color=i,r._color=i,c._color=i,l(r),l(a),u>1&&((f=t[u-2]).left===r?f.left=a:f.right=a),void(t[u-1]=a);if(a.left&&a.left._color===n)return c=(a=r.right=o(a)).left=o(a.left),r.right=c.left,a.left=c.right,c.left=r,c.right=a,c._color=r._color,r._color=i,a._color=i,e._color=i,l(r),l(a),l(c),u>1&&((f=t[u-2]).left===r?f.left=c:f.right=c),void(t[u-1]=c);if(a._color===i){if(r._color===n)return r._color=i,void(r.right=s(n,a));r.right=s(n,a);continue}a=o(a),r.right=a.left,a.left=r,a._color=r._color,r._color=n,l(r),l(a),u>1&&((f=t[u-2]).left===r?f.left=a:f.right=a),t[u-1]=a,t[u]=r,u+1<t.length?t[u+1]=e:t.push(e),u+=2}else{if((a=r.left).left&&a.left._color===n)return c=(a=r.left=o(a)).left=o(a.left),r.left=a.right,a.right=r,a.left=c,a._color=r._color,e._color=i,r._color=i,c._color=i,l(r),l(a),u>1&&((f=t[u-2]).right===r?f.right=a:f.left=a),void(t[u-1]=a);if(a.right&&a.right._color===n)return c=(a=r.left=o(a)).right=o(a.right),r.left=c.right,a.right=c.left,c.right=r,c.left=a,c._color=r._color,r._color=i,a._color=i,e._color=i,l(r),l(a),l(c),u>1&&((f=t[u-2]).right===r?f.right=c:f.left=c),void(t[u-1]=c);if(a._color===i){if(r._color===n)return r._color=i,void(r.left=s(n,a));r.left=s(n,a);continue}var f;a=o(a),r.left=a.right,a.right=r,a._color=r._color,r._color=n,l(r),l(a),u>1&&((f=t[u-2]).right===r?f.right=a:f.left=a),t[u-1]=a,t[u]=r,u+1<t.length?t[u+1]=e:t.push(e),u+=2}}}(e),m.left===r?m.left=null:m.right=null,new c(this.tree._compare,e[0])},Object.defineProperty(h,\"key\",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(h,\"value\",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(h,\"index\",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),h.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,\"hasNext\",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),h.update=function(t){var e=this._stack;if(0===e.length)throw new Error(\"Can't update empty node!\");var r=new Array(e.length),n=e[e.length-1];r[r.length-1]=new a(n._color,n.key,t,n.left,n.right,n._count);for(var i=e.length-2;i>=0;--i)(n=e[i]).left===e[i+1]?r[i]=new a(n._color,n.key,n.value,r[i+1],n.right,n._count):r[i]=new a(n._color,n.key,n.value,n.left,r[i+1],n._count);return new c(this.tree._compare,r[0])},h.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,\"hasPrev\",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},{}],145:[function(t,e,r){var n=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],i=607/128,a=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];function o(t){if(t<0)return Number(\"0/0\");for(var e=a[0],r=a.length-1;r>0;--r)e+=a[r]/(t+r);var n=t+i+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}e.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(o(e));e-=1;for(var r=n[0],i=1;i<9;i++)r+=n[i]/(e+i);var a=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(a,e+.5)*Math.exp(-a)*r},e.exports.log=o},{}],146:[function(t,e,r){var n=t(\"wgs84\");function i(t){var e=0;if(t&&t.length>0){e+=Math.abs(a(t[0]));for(var r=1;r<t.length;r++)e-=Math.abs(a(t[r]))}return e}function a(t){var e=0;if(t.length>2){for(var r,i,a=0;a<t.length-1;a++)r=t[a],e+=o((i=t[a+1])[0]-r[0])*(2+Math.sin(o(r[1]))+Math.sin(o(i[1])));e=e*n.RADIUS*n.RADIUS/2}return e}function o(t){return t*Math.PI/180}e.exports.geometry=function(t){if(\"Polygon\"===t.type)return i(t.coordinates);if(\"MultiPolygon\"===t.type){for(var e=0,r=0;r<t.coordinates.length;r++)e+=i(t.coordinates[r]);return e}return null},e.exports.ring=a},{wgs84:559}],147:[function(t,e,r){var n=t(\"geojson-area\");function i(t,e){return function(r){return t(r,e)}}function a(t,e){e=!!e,t[0]=o(t[0],!e);for(var r=1;r<t.length;r++)t[r]=o(t[r],e);return t}function o(t,e){return function(t){return n.ring(t)>=0}(t)===e?t:t.reverse()}e.exports=function t(e,r){switch(e&&e.type||null){case\"FeatureCollection\":return e.features=e.features.map(i(t,r)),e;case\"Feature\":return e.geometry=t(e.geometry,r),e;case\"Polygon\":case\"MultiPolygon\":return function(t,e){\"Polygon\"===t.type?t.coordinates=a(t.coordinates,e):\"MultiPolygon\"===t.type&&(t.coordinates=t.coordinates.map(i(a,e)));return t}(e,r);default:return e}}},{\"geojson-area\":146}],148:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,o,s,l,c,u){if(o/=e,c>=(r/=e)&&u<=o)return t;if(c>o||u<r)return null;for(var f=[],h=0;h<t.length;h++){var d,p,m=t[h],v=m.geometry,g=m.type;if(d=m.min[s],p=m.max[s],d>=r&&p<=o)f.push(m);else if(!(d>o||p<r)){var y=1===g?i(v,r,o,s):a(v,r,o,s,l,3===g);y.length&&f.push(n(m.tags,g,y,m.id))}}return f.length?f:null};var n=t(\"./feature\");function i(t,e,r,n){for(var i=[],a=0;a<t.length;a++){var o=t[a],s=o[n];s>=e&&s<=r&&i.push(o)}return i}function a(t,e,r,n,i,a){for(var s=[],l=0;l<t.length;l++){var c,u,f,h=0,d=0,p=null,m=t[l],v=m.area,g=m.dist,y=m.outer,b=m.length,x=[];for(u=0;u<b-1;u++)c=p||m[u],p=m[u+1],h=d||c[n],d=p[n],h<e?d>r?(x.push(i(c,p,e),i(c,p,r)),a||(x=o(s,x,v,g,y))):d>=e&&x.push(i(c,p,e)):h>r?d<e?(x.push(i(c,p,r),i(c,p,e)),a||(x=o(s,x,v,g,y))):d<=r&&x.push(i(c,p,r)):(x.push(c),d<e?(x.push(i(c,p,e)),a||(x=o(s,x,v,g,y))):d>r&&(x.push(i(c,p,r)),a||(x=o(s,x,v,g,y))));(h=(c=m[b-1])[n])>=e&&h<=r&&x.push(c),f=x[x.length-1],a&&f&&(x[0][0]!==f[0]||x[0][1]!==f[1])&&x.push(x[0]),o(s,x,v,g,y)}return s}function o(t,e,r,n,i){return e.length&&(e.area=r,e.dist=n,void 0!==i&&(e.outer=i),t.push(e)),[]}},{\"./feature\":150}],149:[function(t,e,r){\"use strict\";e.exports=function(t,e){var r=[];if(\"FeatureCollection\"===t.type)for(var n=0;n<t.features.length;n++)a(r,t.features[n],e);else\"Feature\"===t.type?a(r,t,e):a(r,{geometry:t},e);return r};var n=t(\"./simplify\"),i=t(\"./feature\");function a(t,e,r){if(null!==e.geometry){var n,l,c,u,f=e.geometry,h=f.type,d=f.coordinates,p=e.properties,m=e.id;if(\"Point\"===h)t.push(i(p,1,[s(d)],m));else if(\"MultiPoint\"===h)t.push(i(p,1,o(d),m));else if(\"LineString\"===h)t.push(i(p,2,[o(d,r)],m));else if(\"MultiLineString\"===h||\"Polygon\"===h){for(c=[],n=0;n<d.length;n++)u=o(d[n],r),\"Polygon\"===h&&(u.outer=0===n),c.push(u);t.push(i(p,\"Polygon\"===h?3:2,c,m))}else if(\"MultiPolygon\"===h){for(c=[],n=0;n<d.length;n++)for(l=0;l<d[n].length;l++)(u=o(d[n][l],r)).outer=0===l,c.push(u);t.push(i(p,3,c,m))}else{if(\"GeometryCollection\"!==h)throw new Error(\"Input data is not a valid GeoJSON object.\");for(n=0;n<f.geometries.length;n++)a(t,{geometry:f.geometries[n],properties:p},r)}}}function o(t,e){for(var r=[],i=0;i<t.length;i++)r.push(s(t[i]));return e&&(n(r,e),function(t){for(var e,r,n=0,i=0,a=0;a<t.length-1;a++)e=r||t[a],r=t[a+1],n+=e[0]*r[1]-r[0]*e[1],i+=Math.abs(r[0]-e[0])+Math.abs(r[1]-e[1]);t.area=Math.abs(n/2),t.dist=i}(r)),r}function s(t){var e=Math.sin(t[1]*Math.PI/180),r=t[0]/360+.5,n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return[r,n=n<0?0:n>1?1:n,0]}},{\"./feature\":150,\"./simplify\":152}],150:[function(t,e,r){\"use strict\";function n(t,e,r){for(var n,i=0;i<r.length;i++)n=r[i],t[0]=Math.min(n[0],t[0]),e[0]=Math.max(n[0],e[0]),t[1]=Math.min(n[1],t[1]),e[1]=Math.max(n[1],e[1])}e.exports=function(t,e,r,i){var a={id:i||null,type:e,geometry:r,tags:t||null,min:[1/0,1/0],max:[-1/0,-1/0]};return function(t){var e=t.geometry,r=t.min,i=t.max;if(1===t.type)n(r,i,e);else for(var a=0;a<e.length;a++)n(r,i,e[a])}(a),a}},{}],151:[function(t,e,r){\"use strict\";e.exports=function(t,e){return new l(t,e)};var n=t(\"./convert\"),i=t(\"./transform\"),a=t(\"./clip\"),o=t(\"./wrap\"),s=t(\"./tile\");function l(t,e){var r=(e=this.options=function(t,e){for(var r in e)t[r]=e[r];return t}(Object.create(this.options),e)).debug;r&&console.time(\"preprocess data\");var i=1<<e.maxZoom,a=n(t,e.tolerance/(i*e.extent));this.tiles={},this.tileCoords=[],r&&(console.timeEnd(\"preprocess data\"),console.log(\"index: maxZoom: %d, maxPoints: %d\",e.indexMaxZoom,e.indexMaxPoints),console.time(\"generate tiles\"),this.stats={},this.total=0),(a=o(a,e.buffer/e.extent,u)).length&&this.splitTile(a,0,0,0),r&&(a.length&&console.log(\"features: %d, points: %d\",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd(\"generate tiles\"),console.log(\"tiles generated:\",this.total,JSON.stringify(this.stats)))}function c(t,e,r){return 32*((1<<t)*r+e)+t}function u(t,e,r){return[r,(r-t[0])*(e[1]-t[1])/(e[0]-t[0])+t[1],1]}function f(t,e,r){return[(r-t[1])*(e[0]-t[0])/(e[1]-t[1])+t[0],r,1]}function h(t,e,r){var n=t.source;if(1!==n.length)return!1;var a=n[0];if(3!==a.type||a.geometry.length>1)return!1;var o=a.geometry[0].length;if(5!==o)return!1;for(var s=0;s<o;s++){var l=i.point(a.geometry[0][s],e,t.z2,t.x,t.y);if(l[0]!==-r&&l[0]!==e+r||l[1]!==-r&&l[1]!==e+r)return!1}return!0}l.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,solidChildren:!1,tolerance:3,extent:4096,buffer:64,debug:0},l.prototype.splitTile=function(t,e,r,n,i,o,l){for(var d=[t,e,r,n],p=this.options,m=p.debug,v=null;d.length;){n=d.pop(),r=d.pop(),e=d.pop(),t=d.pop();var g=1<<e,y=c(e,r,n),b=this.tiles[y],x=e===p.maxZoom?0:p.tolerance/(g*p.extent);if(!b&&(m>1&&console.time(\"creation\"),b=this.tiles[y]=s(t,g,r,n,x,e===p.maxZoom),this.tileCoords.push({z:e,x:r,y:n}),m)){m>1&&(console.log(\"tile z%d-%d-%d (features: %d, points: %d, simplified: %d)\",e,r,n,b.numFeatures,b.numPoints,b.numSimplified),console.timeEnd(\"creation\"));var _=\"z\"+e;this.stats[_]=(this.stats[_]||0)+1,this.total++}if(b.source=t,i){if(e===p.maxZoom||e===i)continue;var w=1<<i-e;if(r!==Math.floor(o/w)||n!==Math.floor(l/w))continue}else if(e===p.indexMaxZoom||b.numPoints<=p.indexMaxPoints)continue;if(p.solidChildren||!h(b,p.extent,p.buffer)){b.source=null,m>1&&console.time(\"clipping\");var M,k,A,T,E,S,L=.5*p.buffer/p.extent,C=.5-L,P=.5+L,z=1+L;M=k=A=T=null,E=a(t,g,r-L,r+P,0,u,b.min[0],b.max[0]),S=a(t,g,r+C,r+z,0,u,b.min[0],b.max[0]),E&&(M=a(E,g,n-L,n+P,1,f,b.min[1],b.max[1]),k=a(E,g,n+C,n+z,1,f,b.min[1],b.max[1])),S&&(A=a(S,g,n-L,n+P,1,f,b.min[1],b.max[1]),T=a(S,g,n+C,n+z,1,f,b.min[1],b.max[1])),m>1&&console.timeEnd(\"clipping\"),t.length&&(d.push(M||[],e+1,2*r,2*n),d.push(k||[],e+1,2*r,2*n+1),d.push(A||[],e+1,2*r+1,2*n),d.push(T||[],e+1,2*r+1,2*n+1))}else i&&(v=e)}return v},l.prototype.getTile=function(t,e,r){var n=this.options,a=n.extent,o=n.debug,s=1<<t,l=c(t,e=(e%s+s)%s,r);if(this.tiles[l])return i.tile(this.tiles[l],a);o>1&&console.log(\"drilling down to z%d-%d-%d\",t,e,r);for(var u,f=t,d=e,p=r;!u&&f>0;)f--,d=Math.floor(d/2),p=Math.floor(p/2),u=this.tiles[c(f,d,p)];if(!u||!u.source)return null;if(o>1&&console.log(\"found parent tile z%d-%d-%d\",f,d,p),h(u,a,n.buffer))return i.tile(u,a);o>1&&console.time(\"drilling down\");var m=this.splitTile(u.source,f,d,p,t,e,r);if(o>1&&console.timeEnd(\"drilling down\"),null!==m){var v=1<<t-m;l=c(m,Math.floor(e/v),Math.floor(r/v))}return this.tiles[l]?i.tile(this.tiles[l],a):null}},{\"./clip\":148,\"./convert\":149,\"./tile\":153,\"./transform\":154,\"./wrap\":155}],152:[function(t,e,r){\"use strict\";function n(t,e,r){var n=e[0],i=e[1],a=r[0],o=r[1],s=t[0],l=t[1],c=a-n,u=o-i;if(0!==c||0!==u){var f=((s-n)*c+(l-i)*u)/(c*c+u*u);f>1?(n=a,i=o):f>0&&(n+=c*f,i+=u*f)}return(c=s-n)*c+(u=l-i)*u}e.exports=function(t,e){var r,i,a,o,s=e*e,l=0,c=t.length-1,u=[];t[l][2]=1,t[c][2]=1;for(;c;){for(i=0,r=l+1;r<c;r++)(a=n(t[r],t[l],t[c]))>i&&(o=r,i=a);i>s?(t[o][2]=i,u.push(l),u.push(o),l=o):(c=u.pop(),l=u.pop())}}},{}],153:[function(t,e,r){\"use strict\";function n(t,e,r,n){var a,o,s,l,c=e.geometry,u=e.type,f=[],h=r*r;if(1===u)for(a=0;a<c.length;a++)f.push(c[a]),t.numPoints++,t.numSimplified++;else for(a=0;a<c.length;a++)if(s=c[a],n||!(2===u&&s.dist<r||3===u&&s.area<h)){var d=[];for(o=0;o<s.length;o++)l=s[o],(n||l[2]>h)&&(d.push(l),t.numSimplified++),t.numPoints++;3===u&&i(d,s.outer),f.push(d)}else t.numPoints+=s.length;if(f.length){var p={geometry:f,type:u,tags:e.tags||null};null!==e.id&&(p.id=e.id),t.features.push(p)}}function i(t,e){(function(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i<a;o=i++)e=t[i],r=t[o],n+=(r[0]-e[0])*(e[1]+r[1]);return n})(t)<0===e&&t.reverse()}e.exports=function(t,e,r,i,a,o){for(var s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:i,z2:e,transformed:!1,min:[2,1],max:[-1,0]},l=0;l<t.length;l++){s.numFeatures++,n(s,t[l],a,o);var c=t[l].min,u=t[l].max;c[0]<s.min[0]&&(s.min[0]=c[0]),c[1]<s.min[1]&&(s.min[1]=c[1]),u[0]>s.max[0]&&(s.max[0]=u[0]),u[1]>s.max[1]&&(s.max[1]=u[1])}return s}},{}],154:[function(t,e,r){\"use strict\";function n(t,e,r,n,i){return[Math.round(e*(t[0]*r-n)),Math.round(e*(t[1]*r-i))]}r.tile=function(t,e){if(t.transformed)return t;var r,i,a,o=t.z2,s=t.x,l=t.y;for(r=0;r<t.features.length;r++){var c=t.features[r],u=c.geometry,f=c.type;if(1===f)for(i=0;i<u.length;i++)u[i]=n(u[i],e,o,s,l);else for(i=0;i<u.length;i++){var h=u[i];for(a=0;a<h.length;a++)h[a]=n(h[a],e,o,s,l)}}return t.transformed=!0,t},r.point=n},{}],155:[function(t,e,r){\"use strict\";var n=t(\"./clip\"),i=t(\"./feature\");function a(t,e){for(var r=[],n=0;n<t.length;n++){var a,s=t[n],l=s.type;if(1===l)a=o(s.geometry,e);else{a=[];for(var c=0;c<s.geometry.length;c++)a.push(o(s.geometry[c],e))}r.push(i(s.tags,l,a,s.id))}return r}function o(t,e){var r=[];r.area=t.area,r.dist=t.dist;for(var n=0;n<t.length;n++)r.push([t[n][0]+e,t[n][1],t[n][2]]);return r}e.exports=function(t,e,r){var i=t,o=n(t,1,-1-e,e,0,r,-1,2),s=n(t,1,1-e,2+e,0,r,-1,2);(o||s)&&(i=n(t,1,-e,1+e,0,r,-1,2)||[],o&&(i=a(o,1).concat(i)),s&&(i=i.concat(a(s,-1))));return i}},{\"./clip\":148,\"./feature\":150}],156:[function(t,e,r){e.exports=function(t,e){if(\"string\"!=typeof t)throw new TypeError(\"must specify type string\");if(e=e||{},\"undefined\"==typeof document&&!e.canvas)return null;var r=e.canvas||document.createElement(\"canvas\");\"number\"==typeof e.width&&(r.width=e.width);\"number\"==typeof e.height&&(r.height=e.height);var n,i=e;try{var a=[t];0===t.indexOf(\"webgl\")&&a.push(\"experimental-\"+t);for(var o=0;o<a.length;o++)if(n=r.getContext(a[o],i))return n}catch(t){n=null}return n||null}},{}],157:[function(t,e,r){\"use strict\";e.exports=function(t,e){var r=new u(t);return r.update(e),r};var n=t(\"./lib/text.js\"),i=t(\"./lib/lines.js\"),a=t(\"./lib/background.js\"),o=t(\"./lib/cube.js\"),s=t(\"./lib/ticks.js\"),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);function c(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function u(t){this.gl=t,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=[\"sans-serif\",\"sans-serif\",\"sans-serif\"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=[\"x\",\"y\",\"z\"],this.labelEnable=[!0,!0,!0],this.labelFont=\"sans-serif\",this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=a(t)}var f=u.prototype;function h(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}f.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?Array.isArray(a)&&Array.isArray(a[0]):Array.isArray(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}t=t||{};var r,a=e.bind(this,!1,Number),o=e.bind(this,!1,Boolean),l=e.bind(this,!1,String),c=e.bind(this,!0,function(t){if(Array.isArray(t)){if(3===t.length)return[+t[0],+t[1],+t[2],1];if(4===t.length)return[+t[0],+t[1],+t[2],+t[3]]}return[0,0,0,1]}),u=!1,f=!1;if(\"bounds\"in t)for(var h=t.bounds,d=0;d<2;++d)for(var p=0;p<3;++p)h[d][p]!==this.bounds[d][p]&&(f=!0),this.bounds[d][p]=h[d][p];if(\"ticks\"in t){r=t.ticks,u=!0,this.autoTicks=!1;for(d=0;d<3;++d)this.tickSpacing[d]=0}else a(\"tickSpacing\")&&(this.autoTicks=!0,f=!0);if(this._firstInit&&(\"ticks\"in t||\"tickSpacing\"in t||(this.autoTicks=!0),f=!0,u=!0,this._firstInit=!1),f&&this.autoTicks&&(r=s.create(this.bounds,this.tickSpacing),u=!0),u){for(d=0;d<3;++d)r[d].sort(function(t,e){return t.x-e.x});s.equal(r,this.ticks)?u=!1:this.ticks=r}o(\"tickEnable\"),l(\"tickFont\")&&(u=!0),a(\"tickSize\"),a(\"tickAngle\"),a(\"tickPad\"),c(\"tickColor\");var m=l(\"labels\");l(\"labelFont\")&&(m=!0),o(\"labelEnable\"),a(\"labelSize\"),a(\"labelPad\"),c(\"labelColor\"),o(\"lineEnable\"),o(\"lineMirror\"),a(\"lineWidth\"),c(\"lineColor\"),o(\"lineTickEnable\"),o(\"lineTickMirror\"),a(\"lineTickLength\"),a(\"lineTickWidth\"),c(\"lineTickColor\"),o(\"gridEnable\"),a(\"gridWidth\"),c(\"gridColor\"),o(\"zeroEnable\"),c(\"zeroLineColor\"),a(\"zeroLineWidth\"),o(\"backgroundEnable\"),c(\"backgroundColor\"),this._text?this._text&&(m||u)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=n(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&u&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=i(this.gl,this.bounds,this.ticks))};var d=[new h,new h,new h];function p(t,e,r,n,i){for(var a=t.primalOffset,o=t.primalMinor,s=t.mirrorOffset,l=t.mirrorMinor,c=n[e],u=0;u<3;++u)if(e!==u){var f=a,h=s,d=o,p=l;c&1<<u&&(f=s,h=a,d=l,p=o),f[u]=r[0][u],h[u]=r[1][u],i[u]>0?(d[u]=-1,p[u]=0):(d[u]=0,p[u]=1)}}var m=[0,0,0],v={model:l,view:l,projection:l};f.isOpaque=function(){return!0},f.isTransparent=function(){return!1},f.drawTransparent=function(t){};var g=[0,0,0],y=[0,0,0],b=[0,0,0];f.draw=function(t){t=t||v;for(var e=this.gl,r=t.model||l,n=t.view||l,i=t.projection||l,a=this.bounds,s=o(r,n,i,a),u=s.cubeEdges,f=s.axis,h=n[12],x=n[13],_=n[14],w=n[15],M=this.pixelRatio*(i[3]*h+i[7]*x+i[11]*_+i[15]*w)/e.drawingBufferHeight,k=0;k<3;++k)this.lastCubeProps.cubeEdges[k]=u[k],this.lastCubeProps.axis[k]=f[k];var A=d;for(k=0;k<3;++k)p(d[k],k,this.bounds,u,f);e=this.gl;var T=m;for(k=0;k<3;++k)this.backgroundEnable[k]?T[k]=f[k]:T[k]=0;this._background.draw(r,n,i,a,T,this.backgroundColor),this._lines.bind(r,n,i,this);for(k=0;k<3;++k){var E=[0,0,0];f[k]>0?E[k]=a[1][k]:E[k]=a[0][k];for(var S=0;S<2;++S){var L=(k+1+S)%3,C=(k+1+(1^S))%3;this.gridEnable[L]&&this._lines.drawGrid(L,C,this.bounds,E,this.gridColor[L],this.gridWidth[L]*this.pixelRatio)}for(S=0;S<2;++S){L=(k+1+S)%3,C=(k+1+(1^S))%3;this.zeroEnable[C]&&a[0][C]<=0&&a[1][C]>=0&&this._lines.drawZero(L,C,this.bounds,E,this.zeroLineColor[C],this.zeroLineWidth[C]*this.pixelRatio)}}for(k=0;k<3;++k){this.lineEnable[k]&&this._lines.drawAxisLine(k,this.bounds,A[k].primalOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio),this.lineMirror[k]&&this._lines.drawAxisLine(k,this.bounds,A[k].mirrorOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio);var P=c(g,A[k].primalMinor),z=c(y,A[k].mirrorMinor),O=this.lineTickLength;for(S=0;S<3;++S){var D=M/r[5*S];P[S]*=O[S]*D,z[S]*=O[S]*D}this.lineTickEnable[k]&&this._lines.drawAxisTicks(k,A[k].primalOffset,P,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio),this.lineTickMirror[k]&&this._lines.drawAxisTicks(k,A[k].mirrorOffset,z,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio)}this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio);for(k=0;k<3;++k){var I=A[k].primalMinor,R=c(b,A[k].primalOffset);for(S=0;S<3;++S)this.lineTickEnable[k]&&(R[S]+=M*I[S]*Math.max(this.lineTickLength[S],0)/r[5*S]);if(this.tickEnable[k]){for(S=0;S<3;++S)R[S]+=M*I[S]*this.tickPad[S]/r[5*S];this._text.drawTicks(k,this.tickSize[k],this.tickAngle[k],R,this.tickColor[k])}if(this.labelEnable[k]){for(S=0;S<3;++S)R[S]+=M*I[S]*this.labelPad[S]/r[5*S];R[k]+=.5*(a[0][k]+a[1][k]),this._text.drawLabel(k,this.labelSize[k],this.labelAngle[k],R,this.labelColor[k])}}this._text.unbind()},f.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{\"./lib/background.js\":158,\"./lib/cube.js\":159,\"./lib/lines.js\":160,\"./lib/text.js\":162,\"./lib/ticks.js\":163}],158:[function(t,e,r){\"use strict\";e.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(l+2)%3,f=[0,0,0],h=[0,0,0],d=-1;d<=1;d+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),f[l]=d,h[l]=d;for(var p=-1;p<=1;p+=2){f[c]=p;for(var m=-1;m<=1;m+=2)f[u]=m,e.push(f[0],f[1],f[2],h[0],h[1],h[2]),s+=1}var v=c;c=u,u=v}var g=n(t,new Float32Array(e)),y=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),b=i(t,[{buffer:g,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:g,type:t.FLOAT,size:3,offset:12,stride:24}],y),x=a(t);return x.attributes.position.location=0,x.attributes.normal.location=1,new o(t,g,b,x)};var n=t(\"gl-buffer\"),i=t(\"gl-vao\"),a=t(\"./shaders\").bg;function o(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(t,e,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{\"./shaders\":161,\"gl-buffer\":165,\"gl-vao\":237}],159:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,a){i(s,e,t),i(s,r,s);for(var d=0,y=0;y<2;++y){u[2]=a[y][2];for(var b=0;b<2;++b){u[1]=a[b][1];for(var x=0;x<2;++x)u[0]=a[x][0],h(l[d],u,s),d+=1}}for(var _=-1,y=0;y<8;++y){for(var w=l[y][3],M=0;M<3;++M)c[y][M]=l[y][M]/w;w<0&&(_<0?_=y:c[y][2]<c[_][2]&&(_=y))}if(_<0){_=0;for(var k=0;k<3;++k){for(var A=(k+2)%3,T=(k+1)%3,E=-1,S=-1,L=0;L<2;++L){var C=L<<k,P=C+(L<<A)+(1-L<<T),z=C+(1-L<<A)+(L<<T);o(c[C],c[P],c[z],f)<0||(L?E=1:S=1)}if(E<0||S<0)S>E&&(_|=1<<k);else{for(var L=0;L<2;++L){var C=L<<k,P=C+(L<<A)+(1-L<<T),z=C+(1-L<<A)+(L<<T),O=p([l[C],l[P],l[z],l[C+(1<<A)+(1<<T)]]);L?E=O:S=O}S>E&&(_|=1<<k)}}}for(var D=7^_,I=-1,y=0;y<8;++y)y!==_&&y!==D&&(I<0?I=y:c[I][1]>c[y][1]&&(I=y));for(var R=-1,y=0;y<3;++y){var N=I^1<<y;if(N!==_&&N!==D){R<0&&(R=N);var T=c[N];T[0]<c[R][0]&&(R=N)}}for(var F=-1,y=0;y<3;++y){var N=I^1<<y;if(N!==_&&N!==D&&N!==R){F<0&&(F=N);var T=c[N];T[0]>c[F][0]&&(F=N)}}var j=m;j[0]=j[1]=j[2]=0,j[n.log2(R^I)]=I&R,j[n.log2(I^F)]=I&F;var B=7^F;B===_||B===D?(B=7^R,j[n.log2(F^B)]=B&F):j[n.log2(R^B)]=B&R;for(var U=v,V=_,k=0;k<3;++k)U[k]=V&1<<k?-1:1;return g};var n=t(\"bit-twiddle\"),i=t(\"gl-mat4/multiply\"),a=(t(\"gl-mat4/invert\"),t(\"split-polygon\")),o=t(\"robust-orientation\"),s=new Array(16),l=(new Array(16),new Array(8)),c=new Array(8),u=new Array(3),f=[0,0,0];function h(t,e,r){for(var n=0;n<4;++n){t[n]=r[12+n];for(var i=0;i<3;++i)t[n]+=e[i]*r[4*i+n]}}!function(){for(var t=0;t<8;++t)l[t]=[1,1,1,1],c[t]=[1,1,1]}();var d=[[0,0,1,0,0],[0,0,-1,1,0],[0,-1,0,1,0],[0,1,0,1,0],[-1,0,0,1,0],[1,0,0,1,0]];function p(t){for(var e=0;e<d.length;++e)if((t=a.positive(t,d[e])).length<3)return 0;var r=t[0],n=r[0]/r[3],i=r[1]/r[3],o=0;for(e=1;e+1<t.length;++e){var s=t[e],l=t[e+1],c=s[0]/s[3]-n,u=s[1]/s[3]-i,f=l[0]/l[3]-n,h=l[1]/l[3]-i;o+=Math.abs(c*h-u*f)}return o}var m=[1,1,1],v=[0,0,0],g={cubeEdges:m,axis:v}},{\"bit-twiddle\":71,\"gl-mat4/invert\":186,\"gl-mat4/multiply\":188,\"robust-orientation\":495,\"split-polygon\":515}],160:[function(t,e,r){\"use strict\";e.exports=function(t,e,r){var o=[],s=[0,0,0],l=[0,0,0],c=[0,0,0],u=[0,0,0];o.push(0,0,1,0,1,1,0,0,-1,0,0,-1,0,1,1,0,1,-1);for(var f=0;f<3;++f){for(var h=o.length/3|0,p=0;p<r[f].length;++p){var m=+r[f][p].x;o.push(m,0,1,m,1,1,m,0,-1,m,0,-1,m,1,1,m,1,-1)}var v=o.length/3|0;s[f]=h,l[f]=v-h;for(var h=o.length/3|0,g=0;g<r[f].length;++g){var m=+r[f][g].x;o.push(m,0,1,m,1,1,m,0,-1,m,0,-1,m,1,1,m,1,-1)}var v=o.length/3|0;c[f]=h,u[f]=v-h}var y=n(t,new Float32Array(o)),b=i(t,[{buffer:y,type:t.FLOAT,size:3,stride:0,offset:0}]),x=a(t);return x.attributes.position.location=0,new d(t,y,b,x,l,s,u,c)};var n=t(\"gl-buffer\"),i=t(\"gl-vao\"),a=t(\"./shaders\").line,o=[0,0,0],s=[0,0,0],l=[0,0,0],c=[0,0,0],u=[1,1];function f(t){return t[0]=t[1]=t[2]=0,t}function h(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function d(t,e,r,n,i,a,o,s){this.gl=t,this.vertBuffer=e,this.vao=r,this.shader=n,this.tickCount=i,this.tickOffset=a,this.gridCount=o,this.gridOffset=s}var p=d.prototype;p.bind=function(t,e,r){this.shader.bind(),this.shader.uniforms.model=t,this.shader.uniforms.view=e,this.shader.uniforms.projection=r,u[0]=this.gl.drawingBufferWidth,u[1]=this.gl.drawingBufferHeight,this.shader.uniforms.screenShape=u,this.vao.bind()},p.unbind=function(){this.vao.unbind()},p.drawAxisLine=function(t,e,r,n,i){var a=f(s);this.shader.uniforms.majorAxis=s,a[t]=e[1][t]-e[0][t],this.shader.uniforms.minorAxis=a;var o,u=h(c,r);u[t]+=e[0][t],this.shader.uniforms.offset=u,this.shader.uniforms.lineWidth=i,this.shader.uniforms.color=n,(o=f(l))[(t+2)%3]=1,this.shader.uniforms.screenAxis=o,this.vao.draw(this.gl.TRIANGLES,6),(o=f(l))[(t+1)%3]=1,this.shader.uniforms.screenAxis=o,this.vao.draw(this.gl.TRIANGLES,6)},p.drawAxisTicks=function(t,e,r,n,i){if(this.tickCount[t]){var a=f(o);a[t]=1,this.shader.uniforms.majorAxis=a,this.shader.uniforms.offset=e,this.shader.uniforms.minorAxis=r,this.shader.uniforms.color=n,this.shader.uniforms.lineWidth=i;var s=f(l);s[t]=1,this.shader.uniforms.screenAxis=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[t],this.tickOffset[t])}},p.drawGrid=function(t,e,r,n,i,a){if(this.gridCount[t]){var u=f(s);u[e]=r[1][e]-r[0][e],this.shader.uniforms.minorAxis=u;var d=h(c,n);d[e]+=r[0][e],this.shader.uniforms.offset=d;var p=f(o);p[t]=1,this.shader.uniforms.majorAxis=p;var m=f(l);m[t]=1,this.shader.uniforms.screenAxis=m,this.shader.uniforms.lineWidth=a,this.shader.uniforms.color=i,this.vao.draw(this.gl.TRIANGLES,this.gridCount[t],this.gridOffset[t])}},p.drawZero=function(t,e,r,n,i,a){var o=f(s);this.shader.uniforms.majorAxis=o,o[t]=r[1][t]-r[0][t],this.shader.uniforms.minorAxis=o;var u=h(c,n);u[t]+=r[0][t],this.shader.uniforms.offset=u;var d=f(l);d[e]=1,this.shader.uniforms.screenAxis=d,this.shader.uniforms.lineWidth=a,this.shader.uniforms.color=i,this.vao.draw(this.gl.TRIANGLES,6)},p.dispose=function(){this.vao.dispose(),this.vertBuffer.dispose(),this.shader.dispose()}},{\"./shaders\":161,\"gl-buffer\":165,\"gl-vao\":237}],161:[function(t,e,r){\"use strict\";var n=t(\"glslify\"),i=t(\"gl-shader\"),a=n([\"#define GLSLIFY 1\\nattribute vec3 position;\\n\\nuniform mat4 model, view, projection;\\nuniform vec3 offset, majorAxis, minorAxis, screenAxis;\\nuniform float lineWidth;\\nuniform vec2 screenShape;\\n\\nvec3 project(vec3 p) {\\n vec4 pp = projection * view * model * vec4(p, 1.0);\\n return pp.xyz / max(pp.w, 0.0001);\\n}\\n\\nvoid main() {\\n vec3 major = position.x * majorAxis;\\n vec3 minor = position.y * minorAxis;\\n\\n vec3 vPosition = major + minor + offset;\\n vec3 pPosition = project(vPosition);\\n vec3 offset = project(vPosition + screenAxis * position.z);\\n\\n vec2 screen = normalize((offset - pPosition).xy * screenShape) / screenShape;\\n\\n gl_Position = vec4(pPosition + vec3(0.5 * screen * lineWidth, 0), 1.0);\\n}\\n\"]),o=n([\"precision mediump float;\\n#define GLSLIFY 1\\nuniform vec4 color;\\nvoid main() {\\n gl_FragColor = color;\\n}\"]);r.line=function(t){return i(t,a,o,null,[{name:\"position\",type:\"vec3\"}])};var s=n([\"#define GLSLIFY 1\\nattribute vec3 position;\\n\\nuniform mat4 model, view, projection;\\nuniform vec3 offset, axis;\\nuniform float scale, angle, pixelScale;\\nuniform vec2 resolution;\\n\\nvoid main() { \\n //Compute plane offset\\n vec2 planeCoord = position.xy * pixelScale;\\n mat2 planeXform = scale * mat2(cos(angle), sin(angle),\\n -sin(angle), cos(angle));\\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\\n\\n //Compute world offset\\n float axisDistance = position.z;\\n vec3 dataPosition = axisDistance * axis + offset;\\n vec4 worldPosition = model * vec4(dataPosition, 1);\\n \\n //Compute clip position\\n vec4 viewPosition = view * worldPosition;\\n vec4 clipPosition = projection * viewPosition;\\n clipPosition /= clipPosition.w;\\n\\n //Apply text offset in clip coordinates\\n clipPosition += vec4(viewOffset, 0, 0);\\n\\n //Done\\n gl_Position = clipPosition;\\n}\"]),l=n([\"precision mediump float;\\n#define GLSLIFY 1\\nuniform vec4 color;\\nvoid main() {\\n gl_FragColor = color;\\n}\"]);r.text=function(t){return i(t,s,l,null,[{name:\"position\",type:\"vec3\"}])};var c=n([\"#define GLSLIFY 1\\nattribute vec3 position;\\nattribute vec3 normal;\\n\\nuniform mat4 model, view, projection;\\nuniform vec3 enable;\\nuniform vec3 bounds[2];\\n\\nvarying vec3 colorChannel;\\n\\nvoid main() {\\n if(dot(normal, enable) > 0.0) {\\n vec3 nPosition = mix(bounds[0], bounds[1], 0.5 * (position + 1.0));\\n gl_Position = projection * view * model * vec4(nPosition, 1.0);\\n } else {\\n gl_Position = vec4(0,0,0,0);\\n }\\n colorChannel = abs(normal);\\n}\"]),u=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec4 colors[3];\\n\\nvarying vec3 colorChannel;\\n\\nvoid main() {\\n gl_FragColor = colorChannel.x * colors[0] + \\n colorChannel.y * colors[1] +\\n colorChannel.z * colors[2];\\n}\"]);r.bg=function(t){return i(t,c,u,null,[{name:\"position\",type:\"vec3\"},{name:\"normal\",type:\"vec3\"}])}},{\"gl-shader\":220,glslify:253}],162:[function(t,e,r){(function(r){\"use strict\";e.exports=function(t,e,r,a,s,l){var u=n(t),f=i(t,[{buffer:u,size:3}]),h=o(t);h.attributes.position.location=0;var d=new c(t,h,u,f);return d.update(e,r,a,s,l),d};var n=t(\"gl-buffer\"),i=t(\"gl-vao\"),a=t(\"vectorize-text\"),o=t(\"./shaders\").text,s=window||r.global||{},l=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};function c(t,e,r,n){this.gl=t,this.shader=e,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var u=c.prototype,f=[0,0];u.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=t,i.view=e,i.projection=r,i.pixelScale=n,f[0]=this.gl.drawingBufferWidth,f[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=f},u.unbind=function(){this.vao.unbind()},u.update=function(t,e,r,n,i){this.gl;var o=[];function s(t,e,r,n){var i=l[r];i||(i=l[r]={});var s=i[e];s||(s=i[e]=function(t,e){try{return a(t,e)}catch(t){return console.warn(\"error vectorizing text:\",t),{cells:[],positions:[]}}}(e,{triangles:!0,font:r,textAlign:\"center\",textBaseline:\"middle\"}));for(var c=(n||12)/12,u=s.positions,f=s.cells,h=0,d=f.length;h<d;++h)for(var p=f[h],m=2;m>=0;--m){var v=u[p[m]];o.push(c*v[0],-c*v[1],t)}}for(var c=[0,0,0],u=[0,0,0],f=[0,0,0],h=[0,0,0],d=0;d<3;++d){f[d]=o.length/3|0,s(.5*(t[0][d]+t[1][d]),e[d],r),h[d]=(o.length/3|0)-f[d],c[d]=o.length/3|0;for(var p=0;p<n[d].length;++p)n[d][p].text&&s(n[d][p].x,n[d][p].text,n[d][p].font||i,n[d][p].fontSize||12);u[d]=(o.length/3|0)-c[d]}this.buffer.update(o),this.tickOffset=c,this.tickCount=u,this.labelOffset=f,this.labelCount=h};var h=[0,0,0];u.drawTicks=function(t,e,r,n,i){if(this.tickCount[t]){var a=h;a[0]=a[1]=a[2]=0,a[t]=1,this.shader.uniforms.axis=a,this.shader.uniforms.color=i,this.shader.uniforms.angle=r,this.shader.uniforms.scale=e,this.shader.uniforms.offset=n,this.vao.draw(this.gl.TRIANGLES,this.tickCount[t],this.tickOffset[t])}};var d=[0,0,0];u.drawLabel=function(t,e,r,n,i){this.labelCount[t]&&(this.shader.uniforms.axis=d,this.shader.uniforms.color=i,this.shader.uniforms.angle=r,this.shader.uniforms.scale=e,this.shader.uniforms.offset=n,this.vao.draw(this.gl.TRIANGLES,this.labelCount[t],this.labelOffset[t]))},u.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()}}).call(this,t(\"_process\"))},{\"./shaders\":161,_process:469,\"gl-buffer\":165,\"gl-vao\":237,\"vectorize-text\":548}],163:[function(t,e,r){\"use strict\";function n(t,e){var r=t+\"\",n=r.indexOf(\".\"),i=0;n>=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(t*e*a),s=o+\"\";if(s.indexOf(\"e\")>=0)return s;var l=o/a,c=o%a;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=\"\"+l;if(o<0&&(u=\"-\"+u),i){for(var f=\"\"+c;f.length<i;)f=\"0\"+f;return u+\".\"+f}return u}r.create=function(t,e){for(var r=[],i=0;i<3;++i){for(var a=[],o=(t[0][i],t[1][i],0);o*e[i]<=t[1][i];++o)a.push({x:o*e[i],text:n(e[i],o)});for(var o=-1;o*e[i]>=t[0][i];--o)a.push({x:o*e[i],text:n(e[i],o)});r.push(a)}return r},r.equal=function(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;++n){var i=t[r][n],a=e[r][n];if(i.x!==a.x||i.text!==a.text||i.font!==a.font||i.fontColor!==a.fontColor||i.fontSize!==a.fontSize||i.dx!==a.dx||i.dy!==a.dy)return!1}}return!0}},{}],164:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,l,f){var h=e.model||c,d=e.view||c,g=e.projection||c,y=t.bounds,b=(f=f||a(h,d,g,y)).axis;f.edges;o(u,d,h),o(u,g,u);for(var x=m,_=0;_<3;++_)x[_].lo=1/0,x[_].hi=-1/0,x[_].pixelsPerDataUnit=1/0;var w=n(s(u,u));s(u,u);for(var M=0;M<3;++M){var k=(M+1)%3,A=(M+2)%3,T=v;t:for(var _=0;_<2;++_){var E=[];if(b[M]<0!=!!_){T[M]=y[_][M];for(var S=0;S<2;++S){T[k]=y[S^_][k];for(var L=0;L<2;++L)T[A]=y[L^S^_][A],E.push(T.slice())}for(var S=0;S<w.length;++S){if(0===E.length)continue t;E=i.positive(E,w[S])}for(var S=0;S<E.length;++S)for(var A=E[S],C=p(v,u,A,r,l),L=0;L<3;++L)x[L].lo=Math.min(x[L].lo,A[L]),x[L].hi=Math.max(x[L].hi,A[L]),L!==M&&(x[L].pixelsPerDataUnit=Math.min(x[L].pixelsPerDataUnit,Math.abs(C[L])))}}}return x};var n=t(\"extract-frustum-planes\"),i=t(\"split-polygon\"),a=t(\"./lib/cube.js\"),o=t(\"gl-mat4/multiply\"),s=t(\"gl-mat4/transpose\"),l=t(\"gl-vec4/transformMat4\"),c=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),u=new Float32Array(16);function f(t,e,r){this.lo=t,this.hi=e,this.pixelsPerDataUnit=r}var h=[0,0,0,1],d=[0,0,0,1];function p(t,e,r,n,i){for(var a=0;a<3;++a){for(var o=h,s=d,c=0;c<3;++c)s[c]=o[c]=r[c];s[3]=o[3]=1,s[a]+=1,l(s,s,e),s[3]<0&&(t[a]=1/0),o[a]-=1,l(o,o,e),o[3]<0&&(t[a]=1/0);var u=(o[0]/o[3]-s[0]/s[3])*n,f=(o[1]/o[3]-s[1]/s[3])*i;t[a]=.25*Math.sqrt(u*u+f*f)}return t}var m=[new f(1/0,-1/0,1/0),new f(1/0,-1/0,1/0),new f(1/0,-1/0,1/0)],v=[0,0,0]},{\"./lib/cube.js\":159,\"extract-frustum-planes\":139,\"gl-mat4/multiply\":188,\"gl-mat4/transpose\":196,\"gl-vec4/transformMat4\":243,\"split-polygon\":515}],165:[function(t,e,r){\"use strict\";var n=t(\"typedarray-pool\"),i=t(\"ndarray-ops\"),a=t(\"ndarray\"),o=[\"uint8\",\"uint8_clamped\",\"uint16\",\"uint32\",\"int8\",\"int16\",\"int32\",\"float32\"];function s(t,e,r,n,i){this.gl=t,this.type=e,this.handle=r,this.length=n,this.usage=i}var l=s.prototype;function c(t,e,r,n,i,a){var o=i.length*i.BYTES_PER_ELEMENT;if(a<0)return t.bufferData(e,i,n),o;if(o+a>r)throw new Error(\"gl-buffer: If resizing buffer, must not specify offset\");return t.bufferSubData(e,a,i),r}function u(t,e){for(var r=n.malloc(t.length,e),i=t.length,a=0;a<i;++a)r[a]=t[a];return r}l.bind=function(){this.gl.bindBuffer(this.type,this.handle)},l.unbind=function(){this.gl.bindBuffer(this.type,null)},l.dispose=function(){this.gl.deleteBuffer(this.handle)},l.update=function(t,e){if(\"number\"!=typeof e&&(e=-1),this.bind(),\"object\"==typeof t&&void 0!==t.shape){var r=t.dtype;if(o.indexOf(r)<0&&(r=\"float32\"),this.type===this.gl.ELEMENT_ARRAY_BUFFER)r=gl.getExtension(\"OES_element_index_uint\")&&\"uint16\"!==r?\"uint32\":\"uint16\";if(r===t.dtype&&function(t,e){for(var r=1,n=e.length-1;n>=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=c(this.gl,this.type,this.length,this.usage,t.data,e):this.length=c(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=a(s,t.shape);i.assign(l,t),this.length=c(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?u(t,\"uint16\"):u(t,\"float32\"),this.length=c(this.gl,this.type,this.length,this.usage,e<0?f:f.subarray(0,t.length),e),n.free(f)}else if(\"object\"==typeof t&&\"number\"==typeof t.length)this.length=c(this.gl,this.type,this.length,this.usage,t,e);else{if(\"number\"!=typeof t&&void 0!==t)throw new Error(\"gl-buffer: Invalid data type\");if(e>=0)throw new Error(\"gl-buffer: Cannot specify offset when resizing buffer\");(t|=0)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error(\"gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER\");if(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==t.STREAM_DRAW)throw new Error(\"gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW\");var i=new s(t,r,t.createBuffer(),0,n);return i.update(e),i}},{ndarray:439,\"ndarray-ops\":433,\"typedarray-pool\":534}],166:[function(t,e,r){e.exports={0:\"NONE\",1:\"ONE\",2:\"LINE_LOOP\",3:\"LINE_STRIP\",4:\"TRIANGLES\",5:\"TRIANGLE_STRIP\",6:\"TRIANGLE_FAN\",256:\"DEPTH_BUFFER_BIT\",512:\"NEVER\",513:\"LESS\",514:\"EQUAL\",515:\"LEQUAL\",516:\"GREATER\",517:\"NOTEQUAL\",518:\"GEQUAL\",519:\"ALWAYS\",768:\"SRC_COLOR\",769:\"ONE_MINUS_SRC_COLOR\",770:\"SRC_ALPHA\",771:\"ONE_MINUS_SRC_ALPHA\",772:\"DST_ALPHA\",773:\"ONE_MINUS_DST_ALPHA\",774:\"DST_COLOR\",775:\"ONE_MINUS_DST_COLOR\",776:\"SRC_ALPHA_SATURATE\",1024:\"STENCIL_BUFFER_BIT\",1028:\"FRONT\",1029:\"BACK\",1032:\"FRONT_AND_BACK\",1280:\"INVALID_ENUM\",1281:\"INVALID_VALUE\",1282:\"INVALID_OPERATION\",1285:\"OUT_OF_MEMORY\",1286:\"INVALID_FRAMEBUFFER_OPERATION\",2304:\"CW\",2305:\"CCW\",2849:\"LINE_WIDTH\",2884:\"CULL_FACE\",2885:\"CULL_FACE_MODE\",2886:\"FRONT_FACE\",2928:\"DEPTH_RANGE\",2929:\"DEPTH_TEST\",2930:\"DEPTH_WRITEMASK\",2931:\"DEPTH_CLEAR_VALUE\",2932:\"DEPTH_FUNC\",2960:\"STENCIL_TEST\",2961:\"STENCIL_CLEAR_VALUE\",2962:\"STENCIL_FUNC\",2963:\"STENCIL_VALUE_MASK\",2964:\"STENCIL_FAIL\",2965:\"STENCIL_PASS_DEPTH_FAIL\",2966:\"STENCIL_PASS_DEPTH_PASS\",2967:\"STENCIL_REF\",2968:\"STENCIL_WRITEMASK\",2978:\"VIEWPORT\",3024:\"DITHER\",3042:\"BLEND\",3088:\"SCISSOR_BOX\",3089:\"SCISSOR_TEST\",3106:\"COLOR_CLEAR_VALUE\",3107:\"COLOR_WRITEMASK\",3317:\"UNPACK_ALIGNMENT\",3333:\"PACK_ALIGNMENT\",3379:\"MAX_TEXTURE_SIZE\",3386:\"MAX_VIEWPORT_DIMS\",3408:\"SUBPIXEL_BITS\",3410:\"RED_BITS\",3411:\"GREEN_BITS\",3412:\"BLUE_BITS\",3413:\"ALPHA_BITS\",3414:\"DEPTH_BITS\",3415:\"STENCIL_BITS\",3553:\"TEXTURE_2D\",4352:\"DONT_CARE\",4353:\"FASTEST\",4354:\"NICEST\",5120:\"BYTE\",5121:\"UNSIGNED_BYTE\",5122:\"SHORT\",5123:\"UNSIGNED_SHORT\",5124:\"INT\",5125:\"UNSIGNED_INT\",5126:\"FLOAT\",5386:\"INVERT\",5890:\"TEXTURE\",6401:\"STENCIL_INDEX\",6402:\"DEPTH_COMPONENT\",6406:\"ALPHA\",6407:\"RGB\",6408:\"RGBA\",6409:\"LUMINANCE\",6410:\"LUMINANCE_ALPHA\",7680:\"KEEP\",7681:\"REPLACE\",7682:\"INCR\",7683:\"DECR\",7936:\"VENDOR\",7937:\"RENDERER\",7938:\"VERSION\",9728:\"NEAREST\",9729:\"LINEAR\",9984:\"NEAREST_MIPMAP_NEAREST\",9985:\"LINEAR_MIPMAP_NEAREST\",9986:\"NEAREST_MIPMAP_LINEAR\",9987:\"LINEAR_MIPMAP_LINEAR\",10240:\"TEXTURE_MAG_FILTER\",10241:\"TEXTURE_MIN_FILTER\",10242:\"TEXTURE_WRAP_S\",10243:\"TEXTURE_WRAP_T\",10497:\"REPEAT\",10752:\"POLYGON_OFFSET_UNITS\",16384:\"COLOR_BUFFER_BIT\",32769:\"CONSTANT_COLOR\",32770:\"ONE_MINUS_CONSTANT_COLOR\",32771:\"CONSTANT_ALPHA\",32772:\"ONE_MINUS_CONSTANT_ALPHA\",32773:\"BLEND_COLOR\",32774:\"FUNC_ADD\",32777:\"BLEND_EQUATION_RGB\",32778:\"FUNC_SUBTRACT\",32779:\"FUNC_REVERSE_SUBTRACT\",32819:\"UNSIGNED_SHORT_4_4_4_4\",32820:\"UNSIGNED_SHORT_5_5_5_1\",32823:\"POLYGON_OFFSET_FILL\",32824:\"POLYGON_OFFSET_FACTOR\",32854:\"RGBA4\",32855:\"RGB5_A1\",32873:\"TEXTURE_BINDING_2D\",32926:\"SAMPLE_ALPHA_TO_COVERAGE\",32928:\"SAMPLE_COVERAGE\",32936:\"SAMPLE_BUFFERS\",32937:\"SAMPLES\",32938:\"SAMPLE_COVERAGE_VALUE\",32939:\"SAMPLE_COVERAGE_INVERT\",32968:\"BLEND_DST_RGB\",32969:\"BLEND_SRC_RGB\",32970:\"BLEND_DST_ALPHA\",32971:\"BLEND_SRC_ALPHA\",33071:\"CLAMP_TO_EDGE\",33170:\"GENERATE_MIPMAP_HINT\",33189:\"DEPTH_COMPONENT16\",33306:\"DEPTH_STENCIL_ATTACHMENT\",33635:\"UNSIGNED_SHORT_5_6_5\",33648:\"MIRRORED_REPEAT\",33901:\"ALIASED_POINT_SIZE_RANGE\",33902:\"ALIASED_LINE_WIDTH_RANGE\",33984:\"TEXTURE0\",33985:\"TEXTURE1\",33986:\"TEXTURE2\",33987:\"TEXTURE3\",33988:\"TEXTURE4\",33989:\"TEXTURE5\",33990:\"TEXTURE6\",33991:\"TEXTURE7\",33992:\"TEXTURE8\",33993:\"TEXTURE9\",33994:\"TEXTURE10\",33995:\"TEXTURE11\",33996:\"TEXTURE12\",33997:\"TEXTURE13\",33998:\"TEXTURE14\",33999:\"TEXTURE15\",34000:\"TEXTURE16\",34001:\"TEXTURE17\",34002:\"TEXTURE18\",34003:\"TEXTURE19\",34004:\"TEXTURE20\",34005:\"TEXTURE21\",34006:\"TEXTURE22\",34007:\"TEXTURE23\",34008:\"TEXTURE24\",34009:\"TEXTURE25\",34010:\"TEXTURE26\",34011:\"TEXTURE27\",34012:\"TEXTURE28\",34013:\"TEXTURE29\",34014:\"TEXTURE30\",34015:\"TEXTURE31\",34016:\"ACTIVE_TEXTURE\",34024:\"MAX_RENDERBUFFER_SIZE\",34041:\"DEPTH_STENCIL\",34055:\"INCR_WRAP\",34056:\"DECR_WRAP\",34067:\"TEXTURE_CUBE_MAP\",34068:\"TEXTURE_BINDING_CUBE_MAP\",34069:\"TEXTURE_CUBE_MAP_POSITIVE_X\",34070:\"TEXTURE_CUBE_MAP_NEGATIVE_X\",34071:\"TEXTURE_CUBE_MAP_POSITIVE_Y\",34072:\"TEXTURE_CUBE_MAP_NEGATIVE_Y\",34073:\"TEXTURE_CUBE_MAP_POSITIVE_Z\",34074:\"TEXTURE_CUBE_MAP_NEGATIVE_Z\",34076:\"MAX_CUBE_MAP_TEXTURE_SIZE\",34338:\"VERTEX_ATTRIB_ARRAY_ENABLED\",34339:\"VERTEX_ATTRIB_ARRAY_SIZE\",34340:\"VERTEX_ATTRIB_ARRAY_STRIDE\",34341:\"VERTEX_ATTRIB_ARRAY_TYPE\",34342:\"CURRENT_VERTEX_ATTRIB\",34373:\"VERTEX_ATTRIB_ARRAY_POINTER\",34466:\"NUM_COMPRESSED_TEXTURE_FORMATS\",34467:\"COMPRESSED_TEXTURE_FORMATS\",34660:\"BUFFER_SIZE\",34661:\"BUFFER_USAGE\",34816:\"STENCIL_BACK_FUNC\",34817:\"STENCIL_BACK_FAIL\",34818:\"STENCIL_BACK_PASS_DEPTH_FAIL\",34819:\"STENCIL_BACK_PASS_DEPTH_PASS\",34877:\"BLEND_EQUATION_ALPHA\",34921:\"MAX_VERTEX_ATTRIBS\",34922:\"VERTEX_ATTRIB_ARRAY_NORMALIZED\",34930:\"MAX_TEXTURE_IMAGE_UNITS\",34962:\"ARRAY_BUFFER\",34963:\"ELEMENT_ARRAY_BUFFER\",34964:\"ARRAY_BUFFER_BINDING\",34965:\"ELEMENT_ARRAY_BUFFER_BINDING\",34975:\"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING\",35040:\"STREAM_DRAW\",35044:\"STATIC_DRAW\",35048:\"DYNAMIC_DRAW\",35632:\"FRAGMENT_SHADER\",35633:\"VERTEX_SHADER\",35660:\"MAX_VERTEX_TEXTURE_IMAGE_UNITS\",35661:\"MAX_COMBINED_TEXTURE_IMAGE_UNITS\",35663:\"SHADER_TYPE\",35664:\"FLOAT_VEC2\",35665:\"FLOAT_VEC3\",35666:\"FLOAT_VEC4\",35667:\"INT_VEC2\",35668:\"INT_VEC3\",35669:\"INT_VEC4\",35670:\"BOOL\",35671:\"BOOL_VEC2\",35672:\"BOOL_VEC3\",35673:\"BOOL_VEC4\",35674:\"FLOAT_MAT2\",35675:\"FLOAT_MAT3\",35676:\"FLOAT_MAT4\",35678:\"SAMPLER_2D\",35680:\"SAMPLER_CUBE\",35712:\"DELETE_STATUS\",35713:\"COMPILE_STATUS\",35714:\"LINK_STATUS\",35715:\"VALIDATE_STATUS\",35716:\"INFO_LOG_LENGTH\",35717:\"ATTACHED_SHADERS\",35718:\"ACTIVE_UNIFORMS\",35719:\"ACTIVE_UNIFORM_MAX_LENGTH\",35720:\"SHADER_SOURCE_LENGTH\",35721:\"ACTIVE_ATTRIBUTES\",35722:\"ACTIVE_ATTRIBUTE_MAX_LENGTH\",35724:\"SHADING_LANGUAGE_VERSION\",35725:\"CURRENT_PROGRAM\",36003:\"STENCIL_BACK_REF\",36004:\"STENCIL_BACK_VALUE_MASK\",36005:\"STENCIL_BACK_WRITEMASK\",36006:\"FRAMEBUFFER_BINDING\",36007:\"RENDERBUFFER_BINDING\",36048:\"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE\",36049:\"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME\",36050:\"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL\",36051:\"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE\",36053:\"FRAMEBUFFER_COMPLETE\",36054:\"FRAMEBUFFER_INCOMPLETE_ATTACHMENT\",36055:\"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT\",36057:\"FRAMEBUFFER_INCOMPLETE_DIMENSIONS\",36061:\"FRAMEBUFFER_UNSUPPORTED\",36064:\"COLOR_ATTACHMENT0\",36096:\"DEPTH_ATTACHMENT\",36128:\"STENCIL_ATTACHMENT\",36160:\"FRAMEBUFFER\",36161:\"RENDERBUFFER\",36162:\"RENDERBUFFER_WIDTH\",36163:\"RENDERBUFFER_HEIGHT\",36164:\"RENDERBUFFER_INTERNAL_FORMAT\",36168:\"STENCIL_INDEX8\",36176:\"RENDERBUFFER_RED_SIZE\",36177:\"RENDERBUFFER_GREEN_SIZE\",36178:\"RENDERBUFFER_BLUE_SIZE\",36179:\"RENDERBUFFER_ALPHA_SIZE\",36180:\"RENDERBUFFER_DEPTH_SIZE\",36181:\"RENDERBUFFER_STENCIL_SIZE\",36194:\"RGB565\",36336:\"LOW_FLOAT\",36337:\"MEDIUM_FLOAT\",36338:\"HIGH_FLOAT\",36339:\"LOW_INT\",36340:\"MEDIUM_INT\",36341:\"HIGH_INT\",36346:\"SHADER_COMPILER\",36347:\"MAX_VERTEX_UNIFORM_VECTORS\",36348:\"MAX_VARYING_VECTORS\",36349:\"MAX_FRAGMENT_UNIFORM_VECTORS\",37440:\"UNPACK_FLIP_Y_WEBGL\",37441:\"UNPACK_PREMULTIPLY_ALPHA_WEBGL\",37442:\"CONTEXT_LOST_WEBGL\",37443:\"UNPACK_COLORSPACE_CONVERSION_WEBGL\",37444:\"BROWSER_DEFAULT_WEBGL\"}},{}],167:[function(t,e,r){var n=t(\"./1.0/numbers\");e.exports=function(t){return n[t]}},{\"./1.0/numbers\":166}],168:[function(t,e,r){\"use strict\";e.exports=function(t){var e=t.gl,r=n(e),o=i(e,[{buffer:r,type:e.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:e.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:e.FLOAT,size:3,offset:28,stride:40}]),l=a(e);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var c=new s(e,r,o,l);return c.update(t),c};var n=t(\"gl-buffer\"),i=t(\"gl-vao\"),a=t(\"./shaders/index\"),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1}var l=s.prototype;function c(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}l.isOpaque=function(){return this.opacity>=1},l.isTransparent=function(){return this.opacity<1},l.drawTransparent=l.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||o,i=r.projection=t.projection||o;r.model=t.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],c=n[15],u=this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*c)/e.drawingBufferHeight;this.vao.bind();for(var f=0;f<3;++f)e.lineWidth(this.lineWidth[f]),r.capSize=this.capSize[f]*u,this.lineCount[f]&&e.drawArrays(e.LINES,this.lineOffset[f],this.lineCount[f]);this.vao.unbind()};var u=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=[0,0,0];a[(n+e)%3]=i,r.push(a)}t[e]=r}return t}();function f(t,e,r,n){for(var i=u[n],a=0;a<i.length;++a){var o=i[a];t.push(e[0],e[1],e[2],r[0],r[1],r[2],r[3],o[0],o[1],o[2])}return i.length}l.update=function(t){\"lineWidth\"in(t=t||{})&&(this.lineWidth=t.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),\"capSize\"in t&&(this.capSize=t.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),\"opacity\"in t&&(this.opacity=t.opacity);var e=t.color||[[0,0,0],[0,0,0],[0,0,0]],r=t.position,n=t.error;if(Array.isArray(e[0])||(e=[e,e,e]),r&&n){var i=[],a=r.length,o=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var s=0;s<3;++s){this.lineOffset[s]=o;t:for(var l=0;l<a;++l){for(var u=r[l],h=0;h<3;++h)if(isNaN(u[h])||!isFinite(u[h]))continue t;var d=n[l],p=e[s];if(Array.isArray(p[0])&&(p=e[l]),3===p.length&&(p=[p[0],p[1],p[2],1]),!isNaN(d[0][s])&&!isNaN(d[1][s])){var m;if(d[0][s]<0)(m=u.slice())[s]+=d[0][s],i.push(u[0],u[1],u[2],p[0],p[1],p[2],p[3],0,0,0,m[0],m[1],m[2],p[0],p[1],p[2],p[3],0,0,0),c(this.bounds,m),o+=2+f(i,m,p,s);if(d[1][s]>0)(m=u.slice())[s]+=d[1][s],i.push(u[0],u[1],u[2],p[0],p[1],p[2],p[3],0,0,0,m[0],m[1],m[2],p[0],p[1],p[2],p[3],0,0,0),c(this.bounds,m),o+=2+f(i,m,p,s)}}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{\"./shaders/index\":170,\"gl-buffer\":165,\"gl-vao\":237}],169:[function(t,e,r){e.exports=function(t){\"string\"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n<t.length-1;n++)r.push(t[n],e[n]||\"\");return r.push(t[n]),r.join(\"\")}},{}],170:[function(t,e,r){\"use strict\";var n=t(\"glslify\"),i=t(\"gl-shader\"),a=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position, offset;\\nattribute vec4 color;\\nuniform mat4 model, view, projection;\\nuniform float capSize;\\nvarying vec4 fragColor;\\nvarying vec3 fragPosition;\\n\\nvoid main() {\\n vec4 worldPosition = model * vec4(position, 1.0);\\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\\n gl_Position = projection * view * worldPosition;\\n fragColor = color;\\n fragPosition = position;\\n}\"]),o=n([\"precision mediump float;\\n#define GLSLIFY 1\\nuniform vec3 clipBounds[2];\\nuniform float opacity;\\nvarying vec3 fragPosition;\\nvarying vec4 fragColor;\\n\\nvoid main() {\\n if(any(lessThan(fragPosition, clipBounds[0])) || any(greaterThan(fragPosition, clipBounds[1]))) {\\n discard;\\n }\\n gl_FragColor = opacity * fragColor;\\n}\"]);e.exports=function(t){return i(t,a,o,null,[{name:\"position\",type:\"vec3\"},{name:\"color\",type:\"vec4\"},{name:\"offset\",type:\"vec3\"}])}},{\"gl-shader\":220,glslify:169}],171:[function(t,e,r){\"use strict\";var n=t(\"gl-texture2d\");e.exports=function(t,e,r,n){i||(i=t.FRAMEBUFFER_UNSUPPORTED,a=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var c=t.getExtension(\"WEBGL_draw_buffers\");!l&&c&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;a<n;++a)i[a]=t.COLOR_ATTACHMENT0+a;for(var a=n;a<r;++a)i[a]=t.NONE;l[n]=i}}(t,c);Array.isArray(e)&&(n=r,r=0|e[1],e=0|e[0]);if(\"number\"!=typeof e)throw new Error(\"gl-fbo: Missing shape parameter\");var u=t.getParameter(t.MAX_RENDERBUFFER_SIZE);if(e<0||e>u||r<0||r>u)throw new Error(\"gl-fbo: Parameters are too large for FBO\");var f=1;if(\"color\"in(n=n||{})){if((f=Math.max(0|n.color,0))<0)throw new Error(\"gl-fbo: Must specify a nonnegative number of colors\");if(f>1){if(!c)throw new Error(\"gl-fbo: Multiple draw buffer extension not supported\");if(f>t.getParameter(c.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error(\"gl-fbo: Context does not support \"+f+\" draw buffers\")}}var h=t.UNSIGNED_BYTE,d=t.getExtension(\"OES_texture_float\");if(n.float&&f>0){if(!d)throw new Error(\"gl-fbo: Context does not support floating point textures\");h=t.FLOAT}else n.preferFloat&&f>0&&d&&(h=t.FLOAT);var m=!0;\"depth\"in n&&(m=!!n.depth);var v=!1;\"stencil\"in n&&(v=!!n.stencil);return new p(t,e,r,h,f,m,v,c)};var i,a,o,s,l=null;function c(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function u(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function f(t){switch(t){case i:throw new Error(\"gl-fbo: Framebuffer unsupported\");case a:throw new Error(\"gl-fbo: Framebuffer incomplete attachment\");case o:throw new Error(\"gl-fbo: Framebuffer incomplete dimensions\");case s:throw new Error(\"gl-fbo: Framebuffer incomplete missing attachment\");default:throw new Error(\"gl-fbo: Framebuffer failed for unspecified reason\")}}function h(t,e,r,i,a,o){if(!i)return null;var s=n(t,e,r,a,i);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function d(t,e,r,n,i){var a=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,a),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,i,t.RENDERBUFFER,a),a}function p(t,e,r,n,i,a,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var p=0;p<i;++p)this.color[p]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=n,this._useDepth=a,this._useStencil=o;var m=this,v=[0|e,0|r];Object.defineProperties(v,{0:{get:function(){return m._shape[0]},set:function(t){return m.width=t}},1:{get:function(){return m._shape[1]},set:function(t){return m.height=t}}}),this._shapeVector=v,function(t){var e=c(t.gl),r=t.gl,n=t.handle=r.createFramebuffer(),i=t._shape[0],a=t._shape[1],o=t.color.length,s=t._ext,p=t._useStencil,m=t._useDepth,v=t._colorType;r.bindFramebuffer(r.FRAMEBUFFER,n);for(var g=0;g<o;++g)t.color[g]=h(r,i,a,v,r.RGBA,r.COLOR_ATTACHMENT0+g);0===o?(t._color_rb=d(r,i,a,r.RGBA4,r.COLOR_ATTACHMENT0),s&&s.drawBuffersWEBGL(l[0])):o>1&&s.drawBuffersWEBGL(l[o]);var y=r.getExtension(\"WEBGL_depth_texture\");y?p?t.depth=h(r,i,a,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m&&(t.depth=h(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):m&&p?t._depth_rb=d(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m?t._depth_rb=d(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):p&&(t._depth_rb=d(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var b=r.checkFramebufferStatus(r.FRAMEBUFFER);if(b!==r.FRAMEBUFFER_COMPLETE){for(t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null),g=0;g<t.color.length;++g)t.color[g].dispose(),t.color[g]=null;t._color_rb&&(r.deleteRenderbuffer(t._color_rb),t._color_rb=null),u(r,e),f(b)}u(r,e)}(this)}var m=p.prototype;function v(t,e,r){if(t._destroyed)throw new Error(\"gl-fbo: Can't resize destroyed FBO\");if(t._shape[0]!==e||t._shape[1]!==r){var n=t.gl,i=n.getParameter(n.MAX_RENDERBUFFER_SIZE);if(e<0||e>i||r<0||r>i)throw new Error(\"gl-fbo: Can't resize FBO, invalid dimensions\");t._shape[0]=e,t._shape[1]=r;for(var a=c(n),o=0;o<t.color.length;++o)t.color[o].shape=t._shape;t._color_rb&&(n.bindRenderbuffer(n.RENDERBUFFER,t._color_rb),n.renderbufferStorage(n.RENDERBUFFER,n.RGBA4,t._shape[0],t._shape[1])),t.depth&&(t.depth.shape=t._shape),t._depth_rb&&(n.bindRenderbuffer(n.RENDERBUFFER,t._depth_rb),t._useDepth&&t._useStencil?n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,t._shape[0],t._shape[1]):t._useDepth?n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,t._shape[0],t._shape[1]):t._useStencil&&n.renderbufferStorage(n.RENDERBUFFER,n.STENCIL_INDEX,t._shape[0],t._shape[1])),n.bindFramebuffer(n.FRAMEBUFFER,t.handle);var s=n.checkFramebufferStatus(n.FRAMEBUFFER);s!==n.FRAMEBUFFER_COMPLETE&&(t.dispose(),u(n,a),f(s)),u(n,a)}}Object.defineProperties(m,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(t){if(Array.isArray(t)||(t=[0|t,0|t]),2!==t.length)throw new Error(\"gl-fbo: Shape vector must be length 2\");var e=0|t[0],r=0|t[1];return v(this,e,r),[e,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return v(this,t|=0,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t|=0,v(this,this._shape[0],t),t},enumerable:!1}}),m.bind=function(){if(!this._destroyed){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.handle),t.viewport(0,0,this._shape[0],this._shape[1])}},m.dispose=function(){if(!this._destroyed){this._destroyed=!0;var t=this.gl;t.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(t.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var e=0;e<this.color.length;++e)this.color[e].dispose(),this.color[e]=null;this._color_rb&&(t.deleteRenderbuffer(this._color_rb),this._color_rb=null)}}},{\"gl-texture2d\":233}],172:[function(t,e,r){var n=t(\"sprintf-js\").sprintf,i=t(\"gl-constants/lookup\"),a=t(\"glsl-shader-name\"),o=t(\"add-line-numbers\");e.exports=function(t,e,r){\"use strict\";var s=a(e)||\"of unknown name (see npm glsl-shader-name)\",l=\"unknown type\";void 0!==r&&(l=r===i.FRAGMENT_SHADER?\"fragment\":\"vertex\");for(var c=n(\"Error compiling %s shader %s:\\n\",l,s),u=n(\"%s%s\",c,t),f=t.split(\"\\n\"),h={},d=0;d<f.length;d++){var p=f[d];if(\"\"!==p&&\"\\0\"!==p){var m=parseInt(p.split(\":\")[2]);if(isNaN(m))throw new Error(n(\"Could not parse error: %s\",p));h[m]=p}}for(var v=o(e).split(\"\\n\"),d=0;d<v.length;d++)if(h[d+3]||h[d+2]||h[d+1]){var g=v[d];if(c+=g+\"\\n\",h[d+1]){var y=h[d+1];y=y.substr(y.split(\":\",3).join(\":\").length+1).trim(),c+=n(\"^^^ %s\\n\\n\",y)}}return{long:c.trim(),short:u.trim()}}},{\"add-line-numbers\":44,\"gl-constants/lookup\":167,\"glsl-shader-name\":245,\"sprintf-js\":516}],173:[function(t,e,r){\"use strict\";e.exports=function(t,e){var r=t.gl,n=o(r,l.vertex,l.fragment),i=o(r,l.pickVertex,l.pickFragment),a=s(r),u=s(r),f=s(r),h=s(r),d=new c(t,n,i,a,u,f,h);return d.update(e),t.addObject(d),d};var n=t(\"binary-search-bounds\"),i=t(\"iota-array\"),a=t(\"typedarray-pool\"),o=t(\"gl-shader\"),s=t(\"gl-buffer\"),l=t(\"./lib/shaders\");function c(t,e,r,n,i,a,o){this.plot=t,this.shader=e,this.pickShader=r,this.positionBuffer=n,this.weightBuffer=i,this.colorBuffer=a,this.idBuffer=o,this.xData=[],this.yData=[],this.shape=[0,0],this.bounds=[1/0,1/0,-1/0,-1/0],this.pickOffset=0}var u,f=c.prototype,h=[0,0,1,0,0,1,1,0,1,1,0,1];f.draw=(u=[1,0,0,0,1,0,0,0,1],function(){var t=this.plot,e=this.shader,r=this.bounds,n=this.numVertices;if(!(n<=0)){var i=t.gl,a=t.dataBox,o=r[2]-r[0],s=r[3]-r[1],l=a[2]-a[0],c=a[3]-a[1];u[0]=2*o/l,u[4]=2*s/c,u[6]=2*(r[0]-a[0])/l-1,u[7]=2*(r[1]-a[1])/c-1,e.bind();var f=e.uniforms;f.viewTransform=u,f.shape=this.shape;var h=e.attributes;this.positionBuffer.bind(),h.position.pointer(),this.weightBuffer.bind(),h.weight.pointer(i.UNSIGNED_BYTE,!1),this.colorBuffer.bind(),h.color.pointer(i.UNSIGNED_BYTE,!0),i.drawArrays(i.TRIANGLES,0,n)}}),f.drawPick=function(){var t=[1,0,0,0,1,0,0,0,1],e=[0,0,0,0];return function(r){var n=this.plot,i=this.pickShader,a=this.bounds,o=this.numVertices;if(!(o<=0)){var s=n.gl,l=n.dataBox,c=a[2]-a[0],u=a[3]-a[1],f=l[2]-l[0],h=l[3]-l[1];t[0]=2*c/f,t[4]=2*u/h,t[6]=2*(a[0]-l[0])/f-1,t[7]=2*(a[1]-l[1])/h-1;for(var d=0;d<4;++d)e[d]=r>>8*d&255;this.pickOffset=r,i.bind();var p=i.uniforms;p.viewTransform=t,p.pickOffset=e,p.shape=this.shape;var m=i.attributes;return this.positionBuffer.bind(),m.position.pointer(),this.weightBuffer.bind(),m.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),m.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),f.pick=function(t,e,r){var n=this.pickOffset,i=this.shape[0]*this.shape[1];if(r<n||r>=n+i)return null;var a=r-n,o=this.xData,s=this.yData;return{object:this,pointId:a,dataCoord:[o[a%this.shape[0]],s[a/this.shape[0]|0]]}},f.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||i(e[0]),o=t.y||i(e[1]),s=t.z||new Float32Array(e[0]*e[1]);this.xData=r,this.yData=o;var l=t.colorLevels||[0],c=t.colorValues||[0,0,0,1],u=l.length,f=this.bounds,d=f[0]=r[0],p=f[1]=o[0],m=1/((f[2]=r[r.length-1])-d),v=1/((f[3]=o[o.length-1])-p),g=e[0],y=e[1];this.shape=[g,y];var b=(g-1)*(y-1)*(h.length>>>1);this.numVertices=b;for(var x=a.mallocUint8(4*b),_=a.mallocFloat32(2*b),w=a.mallocUint8(2*b),M=a.mallocUint32(b),k=0,A=0;A<y-1;++A)for(var T=v*(o[A]-p),E=v*(o[A+1]-p),S=0;S<g-1;++S)for(var L=m*(r[S]-d),C=m*(r[S+1]-d),P=0;P<h.length;P+=2){var z,O,D,I,R=h[P],N=h[P+1],F=s[(A+N)*g+(S+R)],j=n.le(l,F);if(j<0)z=c[0],O=c[1],D=c[2],I=c[3];else if(j===u-1)z=c[4*u-4],O=c[4*u-3],D=c[4*u-2],I=c[4*u-1];else{var B=(F-l[j])/(l[j+1]-l[j]),U=1-B,V=4*j,q=4*(j+1);z=U*c[V]+B*c[q],O=U*c[V+1]+B*c[q+1],D=U*c[V+2]+B*c[q+2],I=U*c[V+3]+B*c[q+3]}x[4*k]=255*z,x[4*k+1]=255*O,x[4*k+2]=255*D,x[4*k+3]=255*I,_[2*k]=.5*L+.5*C,_[2*k+1]=.5*T+.5*E,w[2*k]=R,w[2*k+1]=N,M[k]=A*g+S,k+=1}this.positionBuffer.update(_),this.weightBuffer.update(w),this.colorBuffer.update(x),this.idBuffer.update(M),a.free(_),a.free(x),a.free(w),a.free(M)},f.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.positionBuffer.dispose(),this.weightBuffer.dispose(),this.colorBuffer.dispose(),this.idBuffer.dispose(),this.plot.removeObject(this)}},{\"./lib/shaders\":174,\"binary-search-bounds\":175,\"gl-buffer\":165,\"gl-shader\":220,\"iota-array\":261,\"typedarray-pool\":534}],174:[function(t,e,r){\"use strict\";var n=t(\"glslify\");e.exports={fragment:n([\"precision lowp float;\\n#define GLSLIFY 1\\nvarying vec4 fragColor;\\nvoid main() {\\n gl_FragColor = vec4(fragColor.rgb * fragColor.a, fragColor.a);\\n}\\n\"]),vertex:n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec2 position;\\nattribute vec4 color;\\nattribute vec2 weight;\\n\\nuniform vec2 shape;\\nuniform mat3 viewTransform;\\n\\nvarying vec4 fragColor;\\n\\nvoid main() {\\n vec3 vPosition = viewTransform * vec3( position + (weight-.5)/(shape-1.) , 1.0);\\n fragColor = color;\\n gl_Position = vec4(vPosition.xy, 0, vPosition.z);\\n}\\n\"]),pickFragment:n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nvarying vec4 fragId;\\nvarying vec2 vWeight;\\n\\nuniform vec2 shape;\\nuniform vec4 pickOffset;\\n\\nvoid main() {\\n vec2 d = step(.5, vWeight);\\n vec4 id = fragId + pickOffset;\\n id.x += d.x + d.y*shape.x;\\n\\n id.y += floor(id.x / 256.0);\\n id.x -= floor(id.x / 256.0) * 256.0;\\n\\n id.z += floor(id.y / 256.0);\\n id.y -= floor(id.y / 256.0) * 256.0;\\n\\n id.w += floor(id.z / 256.0);\\n id.z -= floor(id.z / 256.0) * 256.0;\\n\\n gl_FragColor = id/255.;\\n}\\n\"]),pickVertex:n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec2 position;\\nattribute vec4 pickId;\\nattribute vec2 weight;\\n\\nuniform vec2 shape;\\nuniform mat3 viewTransform;\\n\\nvarying vec4 fragId;\\nvarying vec2 vWeight;\\n\\nvoid main() {\\n vWeight = weight;\\n\\n fragId = pickId;\\n\\n vec3 vPosition = viewTransform * vec3( position + (weight-.5)/(shape-1.) , 1.0);\\n gl_Position = vec4(vPosition.xy, 0, vPosition.z);\\n}\\n\"])}},{glslify:253}],175:[function(t,e,r){arguments[4][90][0].apply(r,arguments)},{dup:90}],176:[function(t,e,r){var n=t(\"glslify\"),i=t(\"gl-shader\"),a=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position, nextPosition;\\nattribute float arcLength, lineWidth;\\nattribute vec4 color;\\n\\nuniform vec2 screenShape;\\nuniform float pixelRatio;\\nuniform mat4 model, view, projection;\\n\\nvarying vec4 fragColor;\\nvarying vec3 worldPosition;\\nvarying float pixelArcLength;\\n\\nvoid main() {\\n vec4 projected = projection * view * model * vec4(position, 1.0);\\n vec4 tangentClip = projection * view * model * vec4(nextPosition - position, 0.0);\\n vec2 tangent = normalize(screenShape * tangentClip.xy);\\n vec2 offset = 0.5 * pixelRatio * lineWidth * vec2(tangent.y, -tangent.x) / screenShape;\\n\\n gl_Position = vec4(projected.xy + projected.w * offset, projected.zw);\\n\\n worldPosition = position;\\n pixelArcLength = arcLength;\\n fragColor = color;\\n}\\n\"]),o=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec3 clipBounds[2];\\nuniform sampler2D dashTexture;\\nuniform float dashScale;\\nuniform float opacity;\\n\\nvarying vec3 worldPosition;\\nvarying float pixelArcLength;\\nvarying vec4 fragColor;\\n\\nvoid main() {\\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\\n discard;\\n }\\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\\n if(dashWeight < 0.5) {\\n discard;\\n }\\n gl_FragColor = fragColor * opacity;\\n}\\n\"]),s=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\n#define FLOAT_MAX 1.70141184e38\\n#define FLOAT_MIN 1.17549435e-38\\n\\nlowp vec4 encode_float_1540259130(highp float v) {\\n highp float av = abs(v);\\n\\n //Handle special cases\\n if(av < FLOAT_MIN) {\\n return vec4(0.0, 0.0, 0.0, 0.0);\\n } else if(v > FLOAT_MAX) {\\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\\n } else if(v < -FLOAT_MAX) {\\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\\n }\\n\\n highp vec4 c = vec4(0,0,0,0);\\n\\n //Compute exponent and mantissa\\n highp float e = floor(log2(av));\\n highp float m = av * pow(2.0, -e) - 1.0;\\n \\n //Unpack mantissa\\n c[1] = floor(128.0 * m);\\n m -= c[1] / 128.0;\\n c[2] = floor(32768.0 * m);\\n m -= c[2] / 32768.0;\\n c[3] = floor(8388608.0 * m);\\n \\n //Unpack exponent\\n highp float ebias = e + 127.0;\\n c[0] = floor(ebias / 2.0);\\n ebias -= c[0] * 2.0;\\n c[1] += floor(ebias) * 128.0; \\n\\n //Unpack sign bit\\n c[0] += 128.0 * step(0.0, -v);\\n\\n //Scale back to range\\n return c / 255.0;\\n}\\n\\nuniform float pickId;\\nuniform vec3 clipBounds[2];\\n\\nvarying vec3 worldPosition;\\nvarying float pixelArcLength;\\nvarying vec4 fragColor;\\n\\nvoid main() {\\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\\n discard;\\n }\\n gl_FragColor = vec4(pickId/255.0, encode_float_1540259130(pixelArcLength).xyz);\\n}\"]),l=[{name:\"position\",type:\"vec3\"},{name:\"nextPosition\",type:\"vec3\"},{name:\"arcLength\",type:\"float\"},{name:\"lineWidth\",type:\"float\"},{name:\"color\",type:\"vec4\"}];r.createShader=function(t){return i(t,a,o,null,l)},r.createPickShader=function(t){return i(t,a,s,null,l)}},{\"gl-shader\":220,glslify:253}],177:[function(t,e,r){\"use strict\";e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=u(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var o=f(e);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(e),c=i(e,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),h=l(new Array(1024),[256,1,4]),d=0;d<1024;++d)h.data[d]=255;var p=a(e,h);p.wrap=e.REPEAT;var m=new v(e,r,o,s,c,p);return m.update(t),m};var n=t(\"gl-buffer\"),i=t(\"gl-vao\"),a=t(\"gl-texture2d\"),o=t(\"glsl-read-float\"),s=t(\"binary-search-bounds\"),l=t(\"ndarray\"),c=t(\"./lib/shaders\"),u=c.createShader,f=c.createPickShader,h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function d(t,e){for(var r=0,n=0;n<3;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function p(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function m(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function v(t,e,r,n,i,a){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.dirty=!0,this.pixelRatio=1}var g=v.prototype;g.isTransparent=function(){return this.opacity<1},g.isOpaque=function(){return this.opacity>=1},g.pickSlots=1,g.setPickBase=function(t){this.pickId=t},g.drawTransparent=g.draw=function(t){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||h,view:t.view||h,projection:t.projection||h,clipBounds:p(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()},g.drawPick=function(t){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||h,view:t.view||h,projection:t.projection||h,pickId:this.pickId,clipBounds:p(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()},g.update=function(t){var e,r;this.dirty=!0;var n=!!t.connectGaps;\"dashScale\"in t&&(this.dashScale=t.dashScale),\"opacity\"in t&&(this.opacity=+t.opacity);var i=t.position||t.positions;if(i){var a=t.color||t.colors||[0,0,0,1],o=t.lineWidth||1,c=[],u=[],f=[],h=0,p=0,m=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],v=!1;t:for(e=1;e<i.length;++e){var g,y,b,x=i[e-1],_=i[e];for(u.push(h),f.push(x.slice()),r=0;r<3;++r){if(isNaN(x[r])||isNaN(_[r])||!isFinite(x[r])||!isFinite(_[r])){if(!n&&c.length>0){for(var w=0;w<24;++w)c.push(c[c.length-12]);p+=2,v=!0}continue t}m[0][r]=Math.min(m[0][r],x[r],_[r]),m[1][r]=Math.max(m[1][r],x[r],_[r])}Array.isArray(a[0])?(g=a[e-1],y=a[e]):g=y=a,3===g.length&&(g=[g[0],g[1],g[2],1]),3===y.length&&(y=[y[0],y[1],y[2],1]),b=Array.isArray(o)?o[e-1]:o;var M=h;if(h+=d(x,_),v){for(r=0;r<2;++r)c.push(x[0],x[1],x[2],_[0],_[1],_[2],M,b,g[0],g[1],g[2],g[3]);p+=2,v=!1}c.push(x[0],x[1],x[2],_[0],_[1],_[2],M,b,g[0],g[1],g[2],g[3],x[0],x[1],x[2],_[0],_[1],_[2],M,-b,g[0],g[1],g[2],g[3],_[0],_[1],_[2],x[0],x[1],x[2],h,-b,y[0],y[1],y[2],y[3],_[0],_[1],_[2],x[0],x[1],x[2],h,b,y[0],y[1],y[2],y[3]),p+=4}if(this.buffer.update(c),u.push(h),f.push(i[i.length-1].slice()),this.bounds=m,this.vertexCount=p,this.points=f,this.arcLength=u,\"dashes\"in t){var k=t.dashes.slice();for(k.unshift(0),e=1;e<k.length;++e)k[e]=k[e-1]+k[e];var A=l(new Array(1024),[256,1,4]);for(e=0;e<256;++e){for(r=0;r<4;++r)A.set(e,0,r,0);1&s.le(k,k[k.length-1]*e/255)?A.set(e,0,0,0):A.set(e,0,0,255)}this.texture.setPixels(A)}}},g.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()},g.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=o(t.value[0],t.value[1],t.value[2],0),r=s.le(this.arcLength,e);if(r<0)return null;if(r===this.arcLength.length-1)return new m(this.arcLength[this.arcLength.length-1],this.points[this.points.length-1].slice(),r);for(var n=this.points[r],i=this.points[Math.min(r+1,this.points.length-1)],a=(e-this.arcLength[r])/(this.arcLength[r+1]-this.arcLength[r]),l=1-a,c=[0,0,0],u=0;u<3;++u)c[u]=l*n[u]+a*i[u];var f=Math.min(a<.5?r:r+1,this.points.length-1);return new m(e,c,f,this.points[f])}},{\"./lib/shaders\":176,\"binary-search-bounds\":70,\"gl-buffer\":165,\"gl-texture2d\":233,\"gl-vao\":237,\"glsl-read-float\":244,ndarray:439}],178:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*a-i*n;return o?(o=1/o,t[0]=a*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}},{}],179:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=u*o-s*c,h=-u*a+s*l,d=c*a-o*l,p=r*f+n*h+i*d;return p?(p=1/p,t[0]=f*p,t[1]=(-u*n+i*c)*p,t[2]=(s*n-i*o)*p,t[3]=h*p,t[4]=(u*r-i*l)*p,t[5]=(-s*r+i*a)*p,t[6]=d*p,t[7]=(-c*r+n*l)*p,t[8]=(o*r-n*a)*p,t):null}},{}],180:[function(t,e,r){e.exports=function(t){var e=new Float32Array(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},{}],181:[function(t,e,r){e.exports=function(){var t=new Float32Array(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],182:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],f=t[10],h=t[11],d=t[12],p=t[13],m=t[14],v=t[15];return(e*o-r*a)*(f*v-h*m)-(e*s-n*a)*(u*v-h*p)+(e*l-i*a)*(u*m-f*p)+(r*s-n*o)*(c*v-h*d)-(r*l-i*o)*(c*m-f*d)+(n*l-i*s)*(c*p-u*d)}},{}],183:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,c=r*o,u=n*o,f=n*s,h=i*o,d=i*s,p=i*l,m=a*o,v=a*s,g=a*l;return t[0]=1-f-p,t[1]=u+g,t[2]=h-v,t[3]=0,t[4]=u-g,t[5]=1-c-p,t[6]=d+m,t[7]=0,t[8]=h+v,t[9]=d-m,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],184:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=n+n,l=i+i,c=a+a,u=n*s,f=n*l,h=n*c,d=i*l,p=i*c,m=a*c,v=o*s,g=o*l,y=o*c;return t[0]=1-(d+m),t[1]=f+y,t[2]=h-g,t[3]=0,t[4]=f-y,t[5]=1-(u+m),t[6]=p+v,t[7]=0,t[8]=h+g,t[9]=p-v,t[10]=1-(u+d),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}},{}],185:[function(t,e,r){e.exports=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],186:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],m=e[13],v=e[14],g=e[15],y=r*s-n*o,b=r*l-i*o,x=r*c-a*o,_=n*l-i*s,w=n*c-a*s,M=i*c-a*l,k=u*m-f*p,A=u*v-h*p,T=u*g-d*p,E=f*v-h*m,S=f*g-d*m,L=h*g-d*v,C=y*L-b*S+x*E+_*T-w*A+M*k;if(!C)return null;return C=1/C,t[0]=(s*L-l*S+c*E)*C,t[1]=(i*S-n*L-a*E)*C,t[2]=(m*M-v*w+g*_)*C,t[3]=(h*w-f*M-d*_)*C,t[4]=(l*T-o*L-c*A)*C,t[5]=(r*L-i*T+a*A)*C,t[6]=(v*x-p*M-g*b)*C,t[7]=(u*M-h*x+d*b)*C,t[8]=(o*S-s*T+c*k)*C,t[9]=(n*T-r*S-a*k)*C,t[10]=(p*w-m*x+g*y)*C,t[11]=(f*x-u*w-d*y)*C,t[12]=(s*A-o*E-l*k)*C,t[13]=(r*E-n*A+i*k)*C,t[14]=(m*b-p*_-v*y)*C,t[15]=(u*_-f*b+h*y)*C,t}},{}],187:[function(t,e,r){var n=t(\"./identity\");e.exports=function(t,e,r,i){var a,o,s,l,c,u,f,h,d,p,m=e[0],v=e[1],g=e[2],y=i[0],b=i[1],x=i[2],_=r[0],w=r[1],M=r[2];if(Math.abs(m-_)<1e-6&&Math.abs(v-w)<1e-6&&Math.abs(g-M)<1e-6)return n(t);f=m-_,h=v-w,d=g-M,p=1/Math.sqrt(f*f+h*h+d*d),a=b*(d*=p)-x*(h*=p),o=x*(f*=p)-y*d,s=y*h-b*f,(p=Math.sqrt(a*a+o*o+s*s))?(a*=p=1/p,o*=p,s*=p):(a=0,o=0,s=0);l=h*s-d*o,c=d*a-f*s,u=f*o-h*a,(p=Math.sqrt(l*l+c*c+u*u))?(l*=p=1/p,c*=p,u*=p):(l=0,c=0,u=0);return t[0]=a,t[1]=l,t[2]=f,t[3]=0,t[4]=o,t[5]=c,t[6]=h,t[7]=0,t[8]=s,t[9]=u,t[10]=d,t[11]=0,t[12]=-(a*m+o*v+s*g),t[13]=-(l*m+c*v+u*g),t[14]=-(f*m+h*v+d*g),t[15]=1,t}},{\"./identity\":185}],188:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],m=e[12],v=e[13],g=e[14],y=e[15],b=r[0],x=r[1],_=r[2],w=r[3];return t[0]=b*n+x*s+_*f+w*m,t[1]=b*i+x*l+_*h+w*v,t[2]=b*a+x*c+_*d+w*g,t[3]=b*o+x*u+_*p+w*y,b=r[4],x=r[5],_=r[6],w=r[7],t[4]=b*n+x*s+_*f+w*m,t[5]=b*i+x*l+_*h+w*v,t[6]=b*a+x*c+_*d+w*g,t[7]=b*o+x*u+_*p+w*y,b=r[8],x=r[9],_=r[10],w=r[11],t[8]=b*n+x*s+_*f+w*m,t[9]=b*i+x*l+_*h+w*v,t[10]=b*a+x*c+_*d+w*g,t[11]=b*o+x*u+_*p+w*y,b=r[12],x=r[13],_=r[14],w=r[15],t[12]=b*n+x*s+_*f+w*m,t[13]=b*i+x*l+_*h+w*v,t[14]=b*a+x*c+_*d+w*g,t[15]=b*o+x*u+_*p+w*y,t}},{}],189:[function(t,e,r){e.exports=function(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t}},{}],190:[function(t,e,r){e.exports=function(t,e,r,n){var i,a,o,s,l,c,u,f,h,d,p,m,v,g,y,b,x,_,w,M,k,A,T,E,S=n[0],L=n[1],C=n[2],P=Math.sqrt(S*S+L*L+C*C);if(Math.abs(P)<1e-6)return null;S*=P=1/P,L*=P,C*=P,i=Math.sin(r),a=Math.cos(r),o=1-a,s=e[0],l=e[1],c=e[2],u=e[3],f=e[4],h=e[5],d=e[6],p=e[7],m=e[8],v=e[9],g=e[10],y=e[11],b=S*S*o+a,x=L*S*o+C*i,_=C*S*o-L*i,w=S*L*o-C*i,M=L*L*o+a,k=C*L*o+S*i,A=S*C*o+L*i,T=L*C*o-S*i,E=C*C*o+a,t[0]=s*b+f*x+m*_,t[1]=l*b+h*x+v*_,t[2]=c*b+d*x+g*_,t[3]=u*b+p*x+y*_,t[4]=s*w+f*M+m*k,t[5]=l*w+h*M+v*k,t[6]=c*w+d*M+g*k,t[7]=u*w+p*M+y*k,t[8]=s*A+f*T+m*E,t[9]=l*A+h*T+v*E,t[10]=c*A+d*T+g*E,t[11]=u*A+p*T+y*E,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t}},{}],191:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=e[9],f=e[10],h=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t[4]=a*i+c*n,t[5]=o*i+u*n,t[6]=s*i+f*n,t[7]=l*i+h*n,t[8]=c*i-a*n,t[9]=u*i-o*n,t[10]=f*i-s*n,t[11]=h*i-l*n,t}},{}],192:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],c=e[8],u=e[9],f=e[10],h=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t[0]=a*i-c*n,t[1]=o*i-u*n,t[2]=s*i-f*n,t[3]=l*i-h*n,t[8]=a*n+c*i,t[9]=o*n+u*i,t[10]=s*n+f*i,t[11]=l*n+h*i,t}},{}],193:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],c=e[4],u=e[5],f=e[6],h=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t[0]=a*i+c*n,t[1]=o*i+u*n,t[2]=s*i+f*n,t[3]=l*i+h*n,t[4]=c*i-a*n,t[5]=u*i-o*n,t[6]=f*i-s*n,t[7]=h*i-l*n,t}},{}],194:[function(t,e,r){e.exports=function(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},{}],195:[function(t,e,r){e.exports=function(t,e,r){var n,i,a,o,s,l,c,u,f,h,d,p,m=r[0],v=r[1],g=r[2];e===t?(t[12]=e[0]*m+e[4]*v+e[8]*g+e[12],t[13]=e[1]*m+e[5]*v+e[9]*g+e[13],t[14]=e[2]*m+e[6]*v+e[10]*g+e[14],t[15]=e[3]*m+e[7]*v+e[11]*g+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=c,t[7]=u,t[8]=f,t[9]=h,t[10]=d,t[11]=p,t[12]=n*m+s*v+f*g+e[12],t[13]=i*m+l*v+h*g+e[13],t[14]=a*m+c*v+d*g+e[14],t[15]=o*m+u*v+p*g+e[15]);return t}},{}],196:[function(t,e,r){e.exports=function(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}},{}],197:[function(t,e,r){\"use strict\";e.exports=function(t,e){switch(e.length){case 0:break;case 1:t[0]=1/e[0];break;case 4:n(t,e);break;case 9:i(t,e);break;case 16:a(t,e);break;default:throw new Error(\"currently supports matrices up to 4x4\")}return t};var n=t(\"gl-mat2/invert\"),i=t(\"gl-mat3/invert\"),a=t(\"gl-mat4/invert\")},{\"gl-mat2/invert\":178,\"gl-mat3/invert\":179,\"gl-mat4/invert\":186}],198:[function(t,e,r){!function(t,n){if(\"object\"==typeof r&&\"object\"==typeof e)e.exports=n();else{var i=n();for(var a in i)(\"object\"==typeof r?r:t)[a]=i[a]}}(this,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,\"a\",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p=\"\",r(r.s=4)}([function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.setMatrixArrayType=function(t){e.ARRAY_TYPE=t},e.toRadian=function(t){return t*i},e.equals=function(t,e){return Math.abs(t-e)<=n*Math.max(1,Math.abs(t),Math.abs(e))};var n=e.EPSILON=1e-6;e.ARRAY_TYPE=\"undefined\"!=typeof Float32Array?Float32Array:Array,e.RANDOM=Math.random;var i=Math.PI/180},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new n.ARRAY_TYPE(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},e.clone=function(t){var e=new n.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromValues=function(t,e,r,i,a,o,s,l,c){var u=new n.ARRAY_TYPE(9);return u[0]=t,u[1]=e,u[2]=r,u[3]=i,u[4]=a,u[5]=o,u[6]=s,u[7]=l,u[8]=c,u},e.set=function(t,e,r,n,i,a,o,s,l,c){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=l,t[8]=c,t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.transpose=function(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},e.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=u*o-s*c,h=-u*a+s*l,d=c*a-o*l,p=r*f+n*h+i*d;if(!p)return null;return p=1/p,t[0]=f*p,t[1]=(-u*n+i*c)*p,t[2]=(s*n-i*o)*p,t[3]=h*p,t[4]=(u*r-i*l)*p,t[5]=(-s*r+i*a)*p,t[6]=d*p,t[7]=(-c*r+n*l)*p,t[8]=(o*r-n*a)*p,t},e.adjoint=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8];return t[0]=o*u-s*c,t[1]=i*c-n*u,t[2]=n*s-i*o,t[3]=s*l-a*u,t[4]=r*u-i*l,t[5]=i*a-r*s,t[6]=a*c-o*l,t[7]=n*l-r*c,t[8]=r*o-n*a,t},e.determinant=function(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=t[8];return e*(c*a-o*l)+r*(-c*i+o*s)+n*(l*i-a*s)},e.multiply=i,e.translate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=e[8],h=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=h*n+d*o+c,t[7]=h*i+d*s+u,t[8]=h*a+d*l+f,t},e.rotate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=e[8],h=Math.sin(r),d=Math.cos(r);return t[0]=d*n+h*o,t[1]=d*i+h*s,t[2]=d*a+h*l,t[3]=d*o-h*n,t[4]=d*s-h*i,t[5]=d*l-h*a,t[6]=c,t[7]=u,t[8]=f,t},e.scale=function(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},e.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},e.fromQuat=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,c=r*o,u=n*o,f=n*s,h=i*o,d=i*s,p=i*l,m=a*o,v=a*s,g=a*l;return t[0]=1-f-p,t[3]=u-g,t[6]=h+v,t[1]=u+g,t[4]=1-c-p,t[7]=d-m,t[2]=h-v,t[5]=d+m,t[8]=1-c-f,t},e.normalFromMat4=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],m=e[13],v=e[14],g=e[15],y=r*s-n*o,b=r*l-i*o,x=r*c-a*o,_=n*l-i*s,w=n*c-a*s,M=i*c-a*l,k=u*m-f*p,A=u*v-h*p,T=u*g-d*p,E=f*v-h*m,S=f*g-d*m,L=h*g-d*v,C=y*L-b*S+x*E+_*T-w*A+M*k;if(!C)return null;return C=1/C,t[0]=(s*L-l*S+c*E)*C,t[1]=(l*T-o*L-c*A)*C,t[2]=(o*S-s*T+c*k)*C,t[3]=(i*S-n*L-a*E)*C,t[4]=(r*L-i*T+a*A)*C,t[5]=(n*T-r*S-a*k)*C,t[6]=(m*M-v*w+g*_)*C,t[7]=(v*x-p*M-g*b)*C,t[8]=(p*w-m*x+g*y)*C,t},e.projection=function(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},e.str=function(t){return\"mat3(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\")\"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},e.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t},e.subtract=a,e.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t},e.multiplyScalarAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},e.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],f=t[8],h=e[0],d=e[1],p=e[2],m=e[3],v=e[4],g=e[5],y=e[6],b=e[7],x=e[8];return Math.abs(r-h)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(i-d)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(a-p)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(o-m)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(s-v)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(l-g)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(c-y)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(y))&&Math.abs(u-b)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(b))&&Math.abs(f-x)<=n.EPSILON*Math.max(1,Math.abs(f),Math.abs(x))};var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(0));function i(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=e[8],h=r[0],d=r[1],p=r[2],m=r[3],v=r[4],g=r[5],y=r[6],b=r[7],x=r[8];return t[0]=h*n+d*o+p*c,t[1]=h*i+d*s+p*u,t[2]=h*a+d*l+p*f,t[3]=m*n+v*o+g*c,t[4]=m*i+v*s+g*u,t[5]=m*a+v*l+g*f,t[6]=y*n+b*o+x*c,t[7]=y*i+b*s+x*u,t[8]=y*a+b*l+x*f,t}function a(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}e.mul=i,e.sub=a},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.forEach=e.sqrLen=e.len=e.sqrDist=e.dist=e.div=e.mul=e.sub=void 0,e.create=i,e.clone=function(t){var e=new n.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},e.length=a,e.fromValues=o,e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},e.set=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t},e.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t},e.subtract=s,e.multiply=l,e.divide=c,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t},e.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t},e.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t},e.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t},e.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t},e.distance=u,e.squaredDistance=f,e.squaredLength=h,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t},e.normalize=d,e.dot=p,e.cross=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t},e.lerp=function(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t},e.hermite=function(t,e,r,n,i,a){var o=a*a,s=o*(2*a-3)+1,l=o*(a-2)+a,c=o*(a-1),u=o*(3-2*a);return t[0]=e[0]*s+r[0]*l+n[0]*c+i[0]*u,t[1]=e[1]*s+r[1]*l+n[1]*c+i[1]*u,t[2]=e[2]*s+r[2]*l+n[2]*c+i[2]*u,t},e.bezier=function(t,e,r,n,i,a){var o=1-a,s=o*o,l=a*a,c=s*o,u=3*a*s,f=3*l*o,h=l*a;return t[0]=e[0]*c+r[0]*u+n[0]*f+i[0]*h,t[1]=e[1]*c+r[1]*u+n[1]*f+i[1]*h,t[2]=e[2]*c+r[2]*u+n[2]*f+i[2]*h,t},e.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI,i=2*n.RANDOM()-1,a=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*a,t[1]=Math.sin(r)*a,t[2]=i*e,t},e.transformMat4=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,t},e.transformMat3=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t},e.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=u*c+d*-o+f*-l-h*-s,t[1]=f*c+d*-s+h*-o-u*-l,t[2]=h*c+d*-l+u*-s-f*-o,t},e.rotateX=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},e.rotateY=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},e.rotateZ=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},e.angle=function(t,e){var r=o(t[0],t[1],t[2]),n=o(e[0],e[1],e[2]);d(r,r),d(n,n);var i=p(r,n);return i>1?0:i<-1?Math.PI:Math.acos(i)},e.str=function(t){return\"vec3(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\")\"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},e.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=e[0],s=e[1],l=e[2];return Math.abs(r-o)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(l))};var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(0));function i(){var t=new n.ARRAY_TYPE(3);return t[0]=0,t[1]=0,t[2]=0,t}function a(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}function o(t,e,r){var i=new n.ARRAY_TYPE(3);return i[0]=t,i[1]=e,i[2]=r,i}function s(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function l(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function c(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function u(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(r*r+n*n+i*i)}function f(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function h(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function d(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}function p(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}var m;e.sub=s,e.mul=l,e.div=c,e.dist=u,e.sqrDist=f,e.len=a,e.sqrLen=h,e.forEach=(m=i(),function(t,e,r,n,i,a){var o=void 0,s=void 0;for(e||(e=3),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,o=r;o<s;o+=e)m[0]=t[o],m[1]=t[o+1],m[2]=t[o+2],i(m,m,a),t[o]=m[0],t[o+1]=m[1],t[o+2]=m[2];return t})},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.forEach=e.sqrLen=e.len=e.sqrDist=e.dist=e.div=e.mul=e.sub=void 0,e.create=i,e.clone=function(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},e.fromValues=function(t,e,r,i){var a=new n.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},e.set=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t},e.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t},e.subtract=a,e.multiply=o,e.divide=s,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},e.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t},e.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},e.scale=l,e.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t},e.distance=c,e.squaredDistance=u,e.length=f,e.squaredLength=h,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},e.normalize=d,e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},e.lerp=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t},e.random=function(t,e){return e=e||1,t[0]=n.RANDOM(),t[1]=n.RANDOM(),t[2]=n.RANDOM(),t[3]=n.RANDOM(),d(t,t),l(t,t,e),t},e.transformMat4=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t},e.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=u*c+d*-o+f*-l-h*-s,t[1]=f*c+d*-s+h*-o-u*-l,t[2]=h*c+d*-l+u*-s-f*-o,t[3]=e[3],t},e.str=function(t){return\"vec4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=e[0],l=e[1],c=e[2],u=e[3];return Math.abs(r-s)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-l)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-c)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(o-u)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))};var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(0));function i(){var t=new n.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function a(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function o(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}function s(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}function l(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function c(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(r*r+n*n+i*i+a*a)}function u(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return r*r+n*n+i*i+a*a}function f(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)}function h(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function d(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o),t}var p;e.sub=a,e.mul=o,e.div=s,e.dist=c,e.sqrDist=u,e.len=f,e.sqrLen=h,e.forEach=(p=i(),function(t,e,r,n,i,a){var o=void 0,s=void 0;for(e||(e=4),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,o=r;o<s;o+=e)p[0]=t[o],p[1]=t[o+1],p[2]=t[o+2],p[3]=t[o+3],i(p,p,a),t[o]=p[0],t[o+1]=p[1],t[o+2]=p[2],t[o+3]=p[3];return t})},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.vec4=e.vec3=e.vec2=e.quat=e.mat4=e.mat3=e.mat2d=e.mat2=e.glMatrix=void 0;var n=h(r(0)),i=h(r(5)),a=h(r(6)),o=h(r(1)),s=h(r(7)),l=h(r(8)),c=h(r(9)),u=h(r(2)),f=h(r(3));function h(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}e.glMatrix=n,e.mat2=i,e.mat2d=a,e.mat3=o,e.mat4=s,e.quat=l,e.vec2=c,e.vec3=u,e.vec4=f},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},e.clone=function(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},e.fromValues=function(t,e,r,i){var a=new n.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a},e.set=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t},e.transpose=function(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},e.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*a-i*n;if(!o)return null;return o=1/o,t[0]=a*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t},e.adjoint=function(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t},e.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},e.multiply=i,e.rotate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+a*s,t[1]=i*l+o*s,t[2]=n*-s+a*l,t[3]=i*-s+o*l,t},e.scale=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1];return t[0]=n*s,t[1]=i*s,t[2]=a*l,t[3]=o*l,t},e.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t},e.str=function(t){return\"mat2(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},e.LDU=function(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]},e.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t},e.subtract=a,e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=e[0],l=e[1],c=e[2],u=e[3];return Math.abs(r-s)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-l)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-c)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(o-u)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))},e.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},e.multiplyScalarAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t};var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(0));function i(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1],c=r[2],u=r[3];return t[0]=n*s+a*l,t[1]=i*s+o*l,t[2]=n*c+a*u,t[3]=i*c+o*u,t}function a(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}e.mul=i,e.sub=a},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new n.ARRAY_TYPE(6);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},e.clone=function(t){var e=new n.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},e.fromValues=function(t,e,r,i,a,o){var s=new n.ARRAY_TYPE(6);return s[0]=t,s[1]=e,s[2]=r,s[3]=i,s[4]=a,s[5]=o,s},e.set=function(t,e,r,n,i,a,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t},e.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=r*a-n*i;if(!l)return null;return l=1/l,t[0]=a*l,t[1]=-n*l,t[2]=-i*l,t[3]=r*l,t[4]=(i*s-a*o)*l,t[5]=(n*o-r*s)*l,t},e.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},e.multiply=i,e.rotate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=Math.sin(r),u=Math.cos(r);return t[0]=n*u+a*c,t[1]=i*u+o*c,t[2]=n*-c+a*u,t[3]=i*-c+o*u,t[4]=s,t[5]=l,t},e.scale=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=r[0],u=r[1];return t[0]=n*c,t[1]=i*c,t[2]=a*u,t[3]=o*u,t[4]=s,t[5]=l,t},e.translate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=r[0],u=r[1];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=n*c+a*u+s,t[5]=i*c+o*u+l,t},e.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t},e.str=function(t){return\"mat2d(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\")\"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},e.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t},e.subtract=a,e.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t},e.multiplyScalarAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},e.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=e[0],u=e[1],f=e[2],h=e[3],d=e[4],p=e[5];return Math.abs(r-c)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(i-u)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-f)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(f))&&Math.abs(o-h)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(h))&&Math.abs(s-d)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(l-p)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(p))};var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(0));function i(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=r[0],u=r[1],f=r[2],h=r[3],d=r[4],p=r[5];return t[0]=n*c+a*u,t[1]=i*c+o*u,t[2]=n*f+a*h,t[3]=i*f+o*h,t[4]=n*d+a*p+s,t[5]=i*d+o*p+l,t}function a(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}e.mul=i,e.sub=a},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new n.ARRAY_TYPE(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.clone=function(t){var e=new n.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.fromValues=function(t,e,r,i,a,o,s,l,c,u,f,h,d,p,m,v){var g=new n.ARRAY_TYPE(16);return g[0]=t,g[1]=e,g[2]=r,g[3]=i,g[4]=a,g[5]=o,g[6]=s,g[7]=l,g[8]=c,g[9]=u,g[10]=f,g[11]=h,g[12]=d,g[13]=p,g[14]=m,g[15]=v,g},e.set=function(t,e,r,n,i,a,o,s,l,c,u,f,h,d,p,m,v){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=l,t[8]=c,t[9]=u,t[10]=f,t[11]=h,t[12]=d,t[13]=p,t[14]=m,t[15]=v,t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.transpose=function(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},e.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],m=e[13],v=e[14],g=e[15],y=r*s-n*o,b=r*l-i*o,x=r*c-a*o,_=n*l-i*s,w=n*c-a*s,M=i*c-a*l,k=u*m-f*p,A=u*v-h*p,T=u*g-d*p,E=f*v-h*m,S=f*g-d*m,L=h*g-d*v,C=y*L-b*S+x*E+_*T-w*A+M*k;if(!C)return null;return C=1/C,t[0]=(s*L-l*S+c*E)*C,t[1]=(i*S-n*L-a*E)*C,t[2]=(m*M-v*w+g*_)*C,t[3]=(h*w-f*M-d*_)*C,t[4]=(l*T-o*L-c*A)*C,t[5]=(r*L-i*T+a*A)*C,t[6]=(v*x-p*M-g*b)*C,t[7]=(u*M-h*x+d*b)*C,t[8]=(o*S-s*T+c*k)*C,t[9]=(n*T-r*S-a*k)*C,t[10]=(p*w-m*x+g*y)*C,t[11]=(f*x-u*w-d*y)*C,t[12]=(s*A-o*E-l*k)*C,t[13]=(r*E-n*A+i*k)*C,t[14]=(m*b-p*_-v*y)*C,t[15]=(u*_-f*b+h*y)*C,t},e.adjoint=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],m=e[13],v=e[14],g=e[15];return t[0]=s*(h*g-d*v)-f*(l*g-c*v)+m*(l*d-c*h),t[1]=-(n*(h*g-d*v)-f*(i*g-a*v)+m*(i*d-a*h)),t[2]=n*(l*g-c*v)-s*(i*g-a*v)+m*(i*c-a*l),t[3]=-(n*(l*d-c*h)-s*(i*d-a*h)+f*(i*c-a*l)),t[4]=-(o*(h*g-d*v)-u*(l*g-c*v)+p*(l*d-c*h)),t[5]=r*(h*g-d*v)-u*(i*g-a*v)+p*(i*d-a*h),t[6]=-(r*(l*g-c*v)-o*(i*g-a*v)+p*(i*c-a*l)),t[7]=r*(l*d-c*h)-o*(i*d-a*h)+u*(i*c-a*l),t[8]=o*(f*g-d*m)-u*(s*g-c*m)+p*(s*d-c*f),t[9]=-(r*(f*g-d*m)-u*(n*g-a*m)+p*(n*d-a*f)),t[10]=r*(s*g-c*m)-o*(n*g-a*m)+p*(n*c-a*s),t[11]=-(r*(s*d-c*f)-o*(n*d-a*f)+u*(n*c-a*s)),t[12]=-(o*(f*v-h*m)-u*(s*v-l*m)+p*(s*h-l*f)),t[13]=r*(f*v-h*m)-u*(n*v-i*m)+p*(n*h-i*f),t[14]=-(r*(s*v-l*m)-o*(n*v-i*m)+p*(n*l-i*s)),t[15]=r*(s*h-l*f)-o*(n*h-i*f)+u*(n*l-i*s),t},e.determinant=function(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],f=t[10],h=t[11],d=t[12],p=t[13],m=t[14],v=t[15];return(e*o-r*a)*(f*v-h*m)-(e*s-n*a)*(u*v-h*p)+(e*l-i*a)*(u*m-f*p)+(r*s-n*o)*(c*v-h*d)-(r*l-i*o)*(c*m-f*d)+(n*l-i*s)*(c*p-u*d)},e.multiply=i,e.translate=function(t,e,r){var n=r[0],i=r[1],a=r[2],o=void 0,s=void 0,l=void 0,c=void 0,u=void 0,f=void 0,h=void 0,d=void 0,p=void 0,m=void 0,v=void 0,g=void 0;e===t?(t[12]=e[0]*n+e[4]*i+e[8]*a+e[12],t[13]=e[1]*n+e[5]*i+e[9]*a+e[13],t[14]=e[2]*n+e[6]*i+e[10]*a+e[14],t[15]=e[3]*n+e[7]*i+e[11]*a+e[15]):(o=e[0],s=e[1],l=e[2],c=e[3],u=e[4],f=e[5],h=e[6],d=e[7],p=e[8],m=e[9],v=e[10],g=e[11],t[0]=o,t[1]=s,t[2]=l,t[3]=c,t[4]=u,t[5]=f,t[6]=h,t[7]=d,t[8]=p,t[9]=m,t[10]=v,t[11]=g,t[12]=o*n+u*i+p*a+e[12],t[13]=s*n+f*i+m*a+e[13],t[14]=l*n+h*i+v*a+e[14],t[15]=c*n+d*i+g*a+e[15]);return t},e.scale=function(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.rotate=function(t,e,r,i){var a=i[0],o=i[1],s=i[2],l=Math.sqrt(a*a+o*o+s*s),c=void 0,u=void 0,f=void 0,h=void 0,d=void 0,p=void 0,m=void 0,v=void 0,g=void 0,y=void 0,b=void 0,x=void 0,_=void 0,w=void 0,M=void 0,k=void 0,A=void 0,T=void 0,E=void 0,S=void 0,L=void 0,C=void 0,P=void 0,z=void 0;if(Math.abs(l)<n.EPSILON)return null;a*=l=1/l,o*=l,s*=l,c=Math.sin(r),u=Math.cos(r),f=1-u,h=e[0],d=e[1],p=e[2],m=e[3],v=e[4],g=e[5],y=e[6],b=e[7],x=e[8],_=e[9],w=e[10],M=e[11],k=a*a*f+u,A=o*a*f+s*c,T=s*a*f-o*c,E=a*o*f-s*c,S=o*o*f+u,L=s*o*f+a*c,C=a*s*f+o*c,P=o*s*f-a*c,z=s*s*f+u,t[0]=h*k+v*A+x*T,t[1]=d*k+g*A+_*T,t[2]=p*k+y*A+w*T,t[3]=m*k+b*A+M*T,t[4]=h*E+v*S+x*L,t[5]=d*E+g*S+_*L,t[6]=p*E+y*S+w*L,t[7]=m*E+b*S+M*L,t[8]=h*C+v*P+x*z,t[9]=d*C+g*P+_*z,t[10]=p*C+y*P+w*z,t[11]=m*C+b*P+M*z,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t},e.rotateX=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=e[9],f=e[10],h=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t[4]=a*i+c*n,t[5]=o*i+u*n,t[6]=s*i+f*n,t[7]=l*i+h*n,t[8]=c*i-a*n,t[9]=u*i-o*n,t[10]=f*i-s*n,t[11]=h*i-l*n,t},e.rotateY=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],c=e[8],u=e[9],f=e[10],h=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t[0]=a*i-c*n,t[1]=o*i-u*n,t[2]=s*i-f*n,t[3]=l*i-h*n,t[8]=a*n+c*i,t[9]=o*n+u*i,t[10]=s*n+f*i,t[11]=l*n+h*i,t},e.rotateZ=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],c=e[4],u=e[5],f=e[6],h=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t[0]=a*i+c*n,t[1]=o*i+u*n,t[2]=s*i+f*n,t[3]=l*i+h*n,t[4]=c*i-a*n,t[5]=u*i-o*n,t[6]=f*i-s*n,t[7]=h*i-l*n,t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.fromRotation=function(t,e,r){var i=r[0],a=r[1],o=r[2],s=Math.sqrt(i*i+a*a+o*o),l=void 0,c=void 0,u=void 0;if(Math.abs(s)<n.EPSILON)return null;return i*=s=1/s,a*=s,o*=s,l=Math.sin(e),c=Math.cos(e),u=1-c,t[0]=i*i*u+c,t[1]=a*i*u+o*l,t[2]=o*i*u-a*l,t[3]=0,t[4]=i*a*u-o*l,t[5]=a*a*u+c,t[6]=o*a*u+i*l,t[7]=0,t[8]=i*o*u+a*l,t[9]=a*o*u-i*l,t[10]=o*o*u+c,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.fromXRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.fromYRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.fromZRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.fromRotationTranslation=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=n+n,l=i+i,c=a+a,u=n*s,f=n*l,h=n*c,d=i*l,p=i*c,m=a*c,v=o*s,g=o*l,y=o*c;return t[0]=1-(d+m),t[1]=f+y,t[2]=h-g,t[3]=0,t[4]=f-y,t[5]=1-(u+m),t[6]=p+v,t[7]=0,t[8]=h+g,t[9]=p-v,t[10]=1-(u+d),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},e.getTranslation=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},e.getScaling=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[4],o=e[5],s=e[6],l=e[8],c=e[9],u=e[10];return t[0]=Math.sqrt(r*r+n*n+i*i),t[1]=Math.sqrt(a*a+o*o+s*s),t[2]=Math.sqrt(l*l+c*c+u*u),t},e.getRotation=function(t,e){var r=e[0]+e[5]+e[10],n=0;r>0?(n=2*Math.sqrt(r+1),t[3]=.25*n,t[0]=(e[6]-e[9])/n,t[1]=(e[8]-e[2])/n,t[2]=(e[1]-e[4])/n):e[0]>e[5]&e[0]>e[10]?(n=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/n,t[0]=.25*n,t[1]=(e[1]+e[4])/n,t[2]=(e[8]+e[2])/n):e[5]>e[10]?(n=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/n,t[0]=(e[1]+e[4])/n,t[1]=.25*n,t[2]=(e[6]+e[9])/n):(n=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/n,t[0]=(e[8]+e[2])/n,t[1]=(e[6]+e[9])/n,t[2]=.25*n);return t},e.fromRotationTranslationScale=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3],l=i+i,c=a+a,u=o+o,f=i*l,h=i*c,d=i*u,p=a*c,m=a*u,v=o*u,g=s*l,y=s*c,b=s*u,x=n[0],_=n[1],w=n[2];return t[0]=(1-(p+v))*x,t[1]=(h+b)*x,t[2]=(d-y)*x,t[3]=0,t[4]=(h-b)*_,t[5]=(1-(f+v))*_,t[6]=(m+g)*_,t[7]=0,t[8]=(d+y)*w,t[9]=(m-g)*w,t[10]=(1-(f+p))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},e.fromRotationTranslationScaleOrigin=function(t,e,r,n,i){var a=e[0],o=e[1],s=e[2],l=e[3],c=a+a,u=o+o,f=s+s,h=a*c,d=a*u,p=a*f,m=o*u,v=o*f,g=s*f,y=l*c,b=l*u,x=l*f,_=n[0],w=n[1],M=n[2],k=i[0],A=i[1],T=i[2];return t[0]=(1-(m+g))*_,t[1]=(d+x)*_,t[2]=(p-b)*_,t[3]=0,t[4]=(d-x)*w,t[5]=(1-(h+g))*w,t[6]=(v+y)*w,t[7]=0,t[8]=(p+b)*M,t[9]=(v-y)*M,t[10]=(1-(h+m))*M,t[11]=0,t[12]=r[0]+k-(t[0]*k+t[4]*A+t[8]*T),t[13]=r[1]+A-(t[1]*k+t[5]*A+t[9]*T),t[14]=r[2]+T-(t[2]*k+t[6]*A+t[10]*T),t[15]=1,t},e.fromQuat=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,c=r*o,u=n*o,f=n*s,h=i*o,d=i*s,p=i*l,m=a*o,v=a*s,g=a*l;return t[0]=1-f-p,t[1]=u+g,t[2]=h-v,t[3]=0,t[4]=u-g,t[5]=1-c-p,t[6]=d+m,t[7]=0,t[8]=h+v,t[9]=d-m,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.frustum=function(t,e,r,n,i,a,o){var s=1/(r-e),l=1/(i-n),c=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*l,t[10]=(o+a)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*c,t[15]=0,t},e.perspective=function(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t},e.perspectiveFromFieldOfView=function(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),c=2/(i+a);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(o-s)*l*.5,t[9]=(i-a)*c*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t},e.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,t[15]=1,t},e.lookAt=function(t,e,r,i){var a=void 0,o=void 0,s=void 0,l=void 0,c=void 0,u=void 0,f=void 0,h=void 0,d=void 0,p=void 0,m=e[0],v=e[1],g=e[2],y=i[0],b=i[1],x=i[2],_=r[0],w=r[1],M=r[2];if(Math.abs(m-_)<n.EPSILON&&Math.abs(v-w)<n.EPSILON&&Math.abs(g-M)<n.EPSILON)return mat4.identity(t);f=m-_,h=v-w,d=g-M,p=1/Math.sqrt(f*f+h*h+d*d),a=b*(d*=p)-x*(h*=p),o=x*(f*=p)-y*d,s=y*h-b*f,(p=Math.sqrt(a*a+o*o+s*s))?(a*=p=1/p,o*=p,s*=p):(a=0,o=0,s=0);l=h*s-d*o,c=d*a-f*s,u=f*o-h*a,(p=Math.sqrt(l*l+c*c+u*u))?(l*=p=1/p,c*=p,u*=p):(l=0,c=0,u=0);return t[0]=a,t[1]=l,t[2]=f,t[3]=0,t[4]=o,t[5]=c,t[6]=h,t[7]=0,t[8]=s,t[9]=u,t[10]=d,t[11]=0,t[12]=-(a*m+o*v+s*g),t[13]=-(l*m+c*v+u*g),t[14]=-(f*m+h*v+d*g),t[15]=1,t},e.targetTo=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=n[0],l=n[1],c=n[2],u=i-r[0],f=a-r[1],h=o-r[2],d=u*u+f*f+h*h;d>0&&(d=1/Math.sqrt(d),u*=d,f*=d,h*=d);var p=l*h-c*f,m=c*u-s*h,v=s*f-l*u;return t[0]=p,t[1]=m,t[2]=v,t[3]=0,t[4]=f*v-h*m,t[5]=h*p-u*v,t[6]=u*m-f*p,t[7]=0,t[8]=u,t[9]=f,t[10]=h,t[11]=0,t[12]=i,t[13]=a,t[14]=o,t[15]=1,t},e.str=function(t){return\"mat4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\", \"+t[9]+\", \"+t[10]+\", \"+t[11]+\", \"+t[12]+\", \"+t[13]+\", \"+t[14]+\", \"+t[15]+\")\"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},e.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t},e.subtract=a,e.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t},e.multiplyScalarAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},e.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],f=t[8],h=t[9],d=t[10],p=t[11],m=t[12],v=t[13],g=t[14],y=t[15],b=e[0],x=e[1],_=e[2],w=e[3],M=e[4],k=e[5],A=e[6],T=e[7],E=e[8],S=e[9],L=e[10],C=e[11],P=e[12],z=e[13],O=e[14],D=e[15];return Math.abs(r-b)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(a-_)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(o-w)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-M)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(l-k)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(k))&&Math.abs(c-A)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(u-T)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(f-E)<=n.EPSILON*Math.max(1,Math.abs(f),Math.abs(E))&&Math.abs(h-S)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(d-L)<=n.EPSILON*Math.max(1,Math.abs(d),Math.abs(L))&&Math.abs(p-C)<=n.EPSILON*Math.max(1,Math.abs(p),Math.abs(C))&&Math.abs(m-P)<=n.EPSILON*Math.max(1,Math.abs(m),Math.abs(P))&&Math.abs(v-z)<=n.EPSILON*Math.max(1,Math.abs(v),Math.abs(z))&&Math.abs(g-O)<=n.EPSILON*Math.max(1,Math.abs(g),Math.abs(O))&&Math.abs(y-D)<=n.EPSILON*Math.max(1,Math.abs(y),Math.abs(D))};var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(0));function i(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],m=e[12],v=e[13],g=e[14],y=e[15],b=r[0],x=r[1],_=r[2],w=r[3];return t[0]=b*n+x*s+_*f+w*m,t[1]=b*i+x*l+_*h+w*v,t[2]=b*a+x*c+_*d+w*g,t[3]=b*o+x*u+_*p+w*y,b=r[4],x=r[5],_=r[6],w=r[7],t[4]=b*n+x*s+_*f+w*m,t[5]=b*i+x*l+_*h+w*v,t[6]=b*a+x*c+_*d+w*g,t[7]=b*o+x*u+_*p+w*y,b=r[8],x=r[9],_=r[10],w=r[11],t[8]=b*n+x*s+_*f+w*m,t[9]=b*i+x*l+_*h+w*v,t[10]=b*a+x*c+_*d+w*g,t[11]=b*o+x*u+_*p+w*y,b=r[12],x=r[13],_=r[14],w=r[15],t[12]=b*n+x*s+_*f+w*m,t[13]=b*i+x*l+_*h+w*v,t[14]=b*a+x*c+_*d+w*g,t[15]=b*o+x*u+_*p+w*y,t}function a(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}e.mul=i,e.sub=a},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.setAxes=e.sqlerp=e.rotationTo=e.equals=e.exactEquals=e.normalize=e.sqrLen=e.squaredLength=e.len=e.length=e.lerp=e.dot=e.scale=e.mul=e.add=e.set=e.copy=e.fromValues=e.clone=void 0,e.create=l,e.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},e.setAxisAngle=c,e.getAxisAngle=function(t,e){var r=2*Math.acos(e[3]),n=Math.sin(r/2);0!=n?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0);return r},e.multiply=u,e.rotateX=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+o*s,t[1]=i*l+a*s,t[2]=a*l-i*s,t[3]=o*l-n*s,t},e.rotateY=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l-a*s,t[1]=i*l+o*s,t[2]=a*l+n*s,t[3]=o*l-i*s,t},e.rotateZ=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+i*s,t[1]=i*l-n*s,t[2]=a*l+o*s,t[3]=o*l-a*s,t},e.calculateW=function(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t},e.slerp=f,e.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;return t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=a*s,t},e.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},e.fromMat3=h,e.fromEuler=function(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var a=Math.sin(e),o=Math.cos(e),s=Math.sin(r),l=Math.cos(r),c=Math.sin(n),u=Math.cos(n);return t[0]=a*l*u-o*s*c,t[1]=o*s*u+a*l*c,t[2]=o*l*c-a*s*u,t[3]=o*l*u+a*s*c,t},e.str=function(t){return\"quat(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"};var n=s(r(0)),i=s(r(1)),a=s(r(2)),o=s(r(3));function s(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function l(){var t=new n.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function c(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function u(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1],c=r[2],u=r[3];return t[0]=n*u+o*s+i*c-a*l,t[1]=i*u+o*l+a*s-n*c,t[2]=a*u+o*c+n*l-i*s,t[3]=o*u-n*s-i*l-a*c,t}function f(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3],l=r[0],c=r[1],u=r[2],f=r[3],h=void 0,d=void 0,p=void 0,m=void 0,v=void 0;return(d=i*l+a*c+o*u+s*f)<0&&(d=-d,l=-l,c=-c,u=-u,f=-f),1-d>1e-6?(h=Math.acos(d),p=Math.sin(h),m=Math.sin((1-n)*h)/p,v=Math.sin(n*h)/p):(m=1-n,v=n),t[0]=m*i+v*l,t[1]=m*a+v*c,t[2]=m*o+v*u,t[3]=m*s+v*f,t}function h(t,e){var r=e[0]+e[4]+e[8],n=void 0;if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;n=Math.sqrt(e[3*i+i]-e[3*a+a]-e[3*o+o]+1),t[i]=.5*n,n=.5/n,t[3]=(e[3*a+o]-e[3*o+a])*n,t[a]=(e[3*a+i]+e[3*i+a])*n,t[o]=(e[3*o+i]+e[3*i+o])*n}return t}e.clone=o.clone,e.fromValues=o.fromValues,e.copy=o.copy,e.set=o.set,e.add=o.add,e.mul=u,e.scale=o.scale,e.dot=o.dot,e.lerp=o.lerp;var d,p,m,v,g,y,b=e.length=o.length,x=(e.len=b,e.squaredLength=o.squaredLength),_=(e.sqrLen=x,e.normalize=o.normalize);e.exactEquals=o.exactEquals,e.equals=o.equals,e.rotationTo=(d=a.create(),p=a.fromValues(1,0,0),m=a.fromValues(0,1,0),function(t,e,r){var n=a.dot(e,r);return n<-.999999?(a.cross(d,p,e),a.len(d)<1e-6&&a.cross(d,m,e),a.normalize(d,d),c(t,d,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(a.cross(d,e,r),t[0]=d[0],t[1]=d[1],t[2]=d[2],t[3]=1+n,_(t,t))}),e.sqlerp=(v=l(),g=l(),function(t,e,r,n,i,a){return f(v,e,i,a),f(g,r,n,a),f(t,v,g,2*a*(1-a)),t}),e.setAxes=(y=i.create(),function(t,e,r,n){return y[0]=r[0],y[3]=r[1],y[6]=r[2],y[1]=n[0],y[4]=n[1],y[7]=n[2],y[2]=-e[0],y[5]=-e[1],y[8]=-e[2],_(t,h(t,y))})},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.forEach=e.sqrLen=e.sqrDist=e.dist=e.div=e.mul=e.sub=e.len=void 0,e.create=i,e.clone=function(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},e.fromValues=function(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},e.set=function(t,e,r){return t[0]=e,t[1]=r,t},e.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t},e.subtract=a,e.multiply=o,e.divide=s,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},e.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t},e.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},e.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t},e.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t},e.distance=l,e.squaredDistance=c,e.length=u,e.squaredLength=f,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},e.normalize=function(t,e){var r=e[0],n=e[1],i=r*r+n*n;i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i);return t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},e.cross=function(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t},e.lerp=function(t,e,r,n){var i=e[0],a=e[1];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t},e.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t},e.transformMat2=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t},e.transformMat2d=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t},e.transformMat3=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t},e.transformMat4=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t},e.str=function(t){return\"vec2(\"+t[0]+\", \"+t[1]+\")\"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},e.equals=function(t,e){var r=t[0],i=t[1],a=e[0],o=e[1];return Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-o)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))};var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(0));function i(){var t=new n.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t}function a(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function o(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function s(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function l(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(r*r+n*n)}function c(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function u(t){var e=t[0],r=t[1];return Math.sqrt(e*e+r*r)}function f(t){var e=t[0],r=t[1];return e*e+r*r}var h;e.len=u,e.sub=a,e.mul=o,e.div=s,e.dist=l,e.sqrDist=c,e.sqrLen=f,e.forEach=(h=i(),function(t,e,r,n,i,a){var o=void 0,s=void 0;for(e||(e=2),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,o=r;o<s;o+=e)h[0]=t[o],h[1]=t[o+1],i(h,h,a),t[o]=h[0],t[o+1]=h[1];return t})}])})},{}],199:[function(t,e,r){\"use strict\";var n=t(\"barycentric\"),i=t(\"polytope-closest-point/lib/closest_point_2d.js\");function a(t,e){for(var r=[0,0,0,0],n=0;n<4;++n)for(var i=0;i<4;++i)r[i]+=t[4*n+i]*e[n];return r}function o(t,e,r,n,i){for(var o=a(n,a(r,a(e,[t[0],t[1],t[2],1]))),s=0;s<3;++s)o[s]/=o[3];return[.5*i[0]*(1+o[0]),.5*i[1]*(1-o[1])]}e.exports=function(t,e,r,a,s,l){if(1===t.length)return[0,t[0].slice()];for(var c=new Array(t.length),u=0;u<t.length;++u)c[u]=o(t[u],r,a,s,l);for(var f=0,h=1/0,u=0;u<c.length;++u){for(var d=0,p=0;p<2;++p)d+=Math.pow(c[u][p]-e[p],2);d<h&&(h=d,f=u)}for(var m=function(t,e){if(2===t.length){for(var r=0,a=0,o=0;o<2;++o)r+=Math.pow(e[o]-t[0][o],2),a+=Math.pow(e[o]-t[1][o],2);return r=Math.sqrt(r),a=Math.sqrt(a),r+a<1e-6?[1,0]:[a/(r+a),r/(a+r)]}if(3===t.length){var s=[0,0];return i(t[0],t[1],t[2],e,s),n(t,s)}return[]}(c,e),v=0,u=0;u<3;++u){if(m[u]<-.001||m[u]>1.0001)return null;v+=m[u]}if(Math.abs(v-1)>.001)return null;return[f,function(t,e){for(var r=[0,0,0],n=0;n<t.length;++n)for(var i=t[n],a=e[n],o=0;o<3;++o)r[o]+=a*i[o];return r}(t,m),m]}},{barycentric:53,\"polytope-closest-point/lib/closest_point_2d.js\":468}],200:[function(t,e,r){var n=t(\"glslify\"),i=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position, normal;\\nattribute vec4 color;\\nattribute vec2 uv;\\n\\nuniform mat4 model\\n , view\\n , projection;\\nuniform vec3 eyePosition\\n , lightPosition;\\n\\nvarying vec3 f_normal\\n , f_lightDirection\\n , f_eyeDirection\\n , f_data;\\nvarying vec4 f_color;\\nvarying vec2 f_uv;\\n\\nvoid main() {\\n vec4 m_position = model * vec4(position, 1.0);\\n vec4 t_position = view * m_position;\\n gl_Position = projection * t_position;\\n f_color = color;\\n f_normal = normal;\\n f_data = position;\\n f_eyeDirection = eyePosition - position;\\n f_lightDirection = lightPosition - position;\\n f_uv = uv;\\n}\"]),a=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nfloat beckmannDistribution(float x, float roughness) {\\n float NdotH = max(x, 0.0001);\\n float cos2Alpha = NdotH * NdotH;\\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\\n float roughness2 = roughness * roughness;\\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\\n return exp(tan2Alpha / roughness2) / denom;\\n}\\n\\nfloat cookTorranceSpecular(\\n vec3 lightDirection,\\n vec3 viewDirection,\\n vec3 surfaceNormal,\\n float roughness,\\n float fresnel) {\\n\\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\\n\\n //Half angle vector\\n vec3 H = normalize(lightDirection + viewDirection);\\n\\n //Geometric term\\n float NdotH = max(dot(surfaceNormal, H), 0.0);\\n float VdotH = max(dot(viewDirection, H), 0.000001);\\n float LdotH = max(dot(lightDirection, H), 0.000001);\\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\\n float G = min(1.0, min(G1, G2));\\n \\n //Distribution term\\n float D = beckmannDistribution(NdotH, roughness);\\n\\n //Fresnel term\\n float F = pow(1.0 - VdotN, fresnel);\\n\\n //Multiply terms and done\\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\\n}\\n\\nuniform vec3 clipBounds[2];\\nuniform float roughness\\n , fresnel\\n , kambient\\n , kdiffuse\\n , kspecular\\n , opacity;\\nuniform sampler2D texture;\\n\\nvarying vec3 f_normal\\n , f_lightDirection\\n , f_eyeDirection\\n , f_data;\\nvarying vec4 f_color;\\nvarying vec2 f_uv;\\n\\nvoid main() {\\n if(any(lessThan(f_data, clipBounds[0])) || \\n any(greaterThan(f_data, clipBounds[1]))) {\\n discard;\\n }\\n\\n vec3 N = normalize(f_normal);\\n vec3 L = normalize(f_lightDirection);\\n vec3 V = normalize(f_eyeDirection);\\n \\n if(!gl_FrontFacing) {\\n N = -N;\\n }\\n\\n float specular = cookTorranceSpecular(L, V, N, roughness, fresnel);\\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\\n\\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\\n\\n gl_FragColor = litColor * opacity;\\n}\"]),o=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position;\\nattribute vec4 color;\\nattribute vec2 uv;\\n\\nuniform mat4 model, view, projection;\\n\\nvarying vec4 f_color;\\nvarying vec3 f_data;\\nvarying vec2 f_uv;\\n\\nvoid main() {\\n gl_Position = projection * view * model * vec4(position, 1.0);\\n f_color = color;\\n f_data = position;\\n f_uv = uv;\\n}\"]),s=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec3 clipBounds[2];\\nuniform sampler2D texture;\\nuniform float opacity;\\n\\nvarying vec4 f_color;\\nvarying vec3 f_data;\\nvarying vec2 f_uv;\\n\\nvoid main() {\\n if(any(lessThan(f_data, clipBounds[0])) || \\n any(greaterThan(f_data, clipBounds[1]))) {\\n discard;\\n }\\n\\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\\n}\"]),l=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position;\\nattribute vec4 color;\\nattribute vec2 uv;\\nattribute float pointSize;\\n\\nuniform mat4 model, view, projection;\\nuniform vec3 clipBounds[2];\\n\\nvarying vec4 f_color;\\nvarying vec2 f_uv;\\n\\nvoid main() {\\n if(any(lessThan(position, clipBounds[0])) || \\n any(greaterThan(position, clipBounds[1]))) {\\n gl_Position = vec4(0,0,0,0);\\n } else {\\n gl_Position = projection * view * model * vec4(position, 1.0);\\n }\\n gl_PointSize = pointSize;\\n f_color = color;\\n f_uv = uv;\\n}\"]),c=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform sampler2D texture;\\nuniform float opacity;\\n\\nvarying vec4 f_color;\\nvarying vec2 f_uv;\\n\\nvoid main() {\\n vec2 pointR = gl_PointCoord.xy - vec2(0.5,0.5);\\n if(dot(pointR, pointR) > 0.25) {\\n discard;\\n }\\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\\n}\"]),u=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position;\\nattribute vec4 id;\\n\\nuniform mat4 model, view, projection;\\n\\nvarying vec3 f_position;\\nvarying vec4 f_id;\\n\\nvoid main() {\\n gl_Position = projection * view * model * vec4(position, 1.0);\\n f_id = id;\\n f_position = position;\\n}\"]),f=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec3 clipBounds[2];\\nuniform float pickId;\\n\\nvarying vec3 f_position;\\nvarying vec4 f_id;\\n\\nvoid main() {\\n if(any(lessThan(f_position, clipBounds[0])) || \\n any(greaterThan(f_position, clipBounds[1]))) {\\n discard;\\n }\\n gl_FragColor = vec4(pickId, f_id.xyz);\\n}\"]),h=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position;\\nattribute float pointSize;\\nattribute vec4 id;\\n\\nuniform mat4 model, view, projection;\\nuniform vec3 clipBounds[2];\\n\\nvarying vec3 f_position;\\nvarying vec4 f_id;\\n\\nvoid main() {\\n if(any(lessThan(position, clipBounds[0])) || \\n any(greaterThan(position, clipBounds[1]))) {\\n gl_Position = vec4(0,0,0,0);\\n } else {\\n gl_Position = projection * view * model * vec4(position, 1.0);\\n gl_PointSize = pointSize;\\n }\\n f_id = id;\\n f_position = position;\\n}\"]),d=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position;\\n\\nuniform mat4 model, view, projection;\\n\\nvoid main() {\\n gl_Position = projection * view * model * vec4(position, 1.0);\\n}\"]),p=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec3 contourColor;\\n\\nvoid main() {\\n gl_FragColor = vec4(contourColor,1);\\n}\\n\"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:\"position\",type:\"vec3\"},{name:\"normal\",type:\"vec3\"},{name:\"color\",type:\"vec4\"},{name:\"uv\",type:\"vec2\"}]},r.wireShader={vertex:o,fragment:s,attributes:[{name:\"position\",type:\"vec3\"},{name:\"color\",type:\"vec4\"},{name:\"uv\",type:\"vec2\"}]},r.pointShader={vertex:l,fragment:c,attributes:[{name:\"position\",type:\"vec3\"},{name:\"color\",type:\"vec4\"},{name:\"uv\",type:\"vec2\"},{name:\"pointSize\",type:\"float\"}]},r.pickShader={vertex:u,fragment:f,attributes:[{name:\"position\",type:\"vec3\"},{name:\"id\",type:\"vec4\"}]},r.pointPickShader={vertex:h,fragment:f,attributes:[{name:\"position\",type:\"vec3\"},{name:\"pointSize\",type:\"float\"},{name:\"id\",type:\"vec4\"}]},r.contourShader={vertex:d,fragment:p,attributes:[{name:\"position\",type:\"vec3\"}]}},{glslify:253}],201:[function(t,e,r){\"use strict\";var n=t(\"gl-shader\"),i=t(\"gl-buffer\"),a=t(\"gl-vao\"),o=t(\"gl-texture2d\"),s=t(\"normals\"),l=t(\"gl-mat4/multiply\"),c=t(\"gl-mat4/invert\"),u=t(\"ndarray\"),f=t(\"colormap\"),h=t(\"simplicial-complex-contour\"),d=t(\"typedarray-pool\"),p=t(\"./lib/shaders\"),m=t(\"./lib/closest-point\"),v=p.meshShader,g=p.wireShader,y=p.pointShader,b=p.pickShader,x=p.pointPickShader,_=p.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function M(t,e,r,n,i,a,o,s,l,c,u,f,h,d,p,m,v,g,y,b,x,_,M,k,A,T,E){this.gl=t,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=u,this.triangleNormals=h,this.triangleUVs=f,this.triangleIds=c,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=v,this.edgeUVs=g,this.edgeIds=m,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=b,this.pointColors=_,this.pointUVs=M,this.pointSizes=k,this.pointIds=x,this.pointVAO=A,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=T,this.contourVAO=E,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var k=M.prototype;function A(t){var e=n(t,y.vertex,y.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}function T(t){var e=n(t,b.vertex,b.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e}function E(t){var e=n(t,x.vertex,x.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function S(t){var e=n(t,_.vertex,_.fragment);return e.attributes.position.location=0,e}k.isOpaque=function(){return this.opacity>=1},k.isTransparent=function(){return this.opacity<1},k.pickSlots=1,k.setPickBase=function(t){this.pickId=t},k.highlight=function(t){if(t&&this.contourEnable){for(var e=h(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=d.mallocFloat32(6*a),s=0,l=0;l<a;++l)for(var c=r[l],u=0;u<2;++u){var f=c[0];2===c.length&&(f=c[u]);for(var p=n[f][0],m=n[f][1],v=i[f],g=1-v,y=this.positions[p],b=this.positions[m],x=0;x<3;++x)o[s++]=v*y[x]+g*b[x]}this.contourCount=s/3|0,this.contourPositions.update(o.subarray(0,s)),d.free(o)}else this.contourCount=0},k.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,\"contourEnable\"in t&&(this.contourEnable=t.contourEnable),\"contourColor\"in t&&(this.contourColor=t.contourColor),\"lineWidth\"in t&&(this.lineWidth=t.lineWidth),\"lightPosition\"in t&&(this.lightPosition=t.lightPosition),\"opacity\"in t&&(this.opacity=t.opacity),\"ambient\"in t&&(this.ambientLight=t.ambient),\"diffuse\"in t&&(this.diffuseLight=t.diffuse),\"specular\"in t&&(this.specularLight=t.specular),\"roughness\"in t&&(this.roughness=t.roughness),\"fresnel\"in t&&(this.fresnel=t.fresnel),t.texture?(this.texture.dispose(),this.texture=o(e,t.texture)):t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(function(t){for(var e=f({colormap:t,nshades:256,format:\"rgba\"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var i=e[n],a=0;a<3;++a)r[4*n+a]=i[a];r[4*n+3]=255*i[3]}return u(r,[256,256,4],[4,0,1])}(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions;if(n&&r){var i=[],a=[],l=[],c=[],h=[],d=[],p=[],m=[],v=[],g=[],y=[],b=[],x=[],_=[];this.cells=r,this.positions=n;var w=t.vertexNormals,M=t.cellNormals,k=void 0===t.vertexNormalsEpsilon?1e-6:t.vertexNormalsEpsilon,A=void 0===t.faceNormalsEpsilon?1e-6:t.faceNormalsEpsilon;t.useFacetNormals&&!M&&(M=s.faceNormals(r,n,A)),M||w||(w=s.vertexNormals(r,n,k));var T=t.vertexColors,E=t.cellColors,S=t.meshColor||[1,1,1,1],L=t.vertexUVs,C=t.vertexIntensity,P=t.cellUVs,z=t.cellIntensity,O=1/0,D=-1/0;if(!L&&!P)if(C)if(t.vertexIntensityBounds)O=+t.vertexIntensityBounds[0],D=+t.vertexIntensityBounds[1];else for(var I=0;I<C.length;++I){var R=C[I];O=Math.min(O,R),D=Math.max(D,R)}else if(z)for(I=0;I<z.length;++I){R=z[I];O=Math.min(O,R),D=Math.max(D,R)}else for(I=0;I<n.length;++I){R=n[I][2];O=Math.min(O,R),D=Math.max(D,R)}this.intensity=C||(z?function(t,e,r){for(var n=new Array(e),i=0;i<e;++i)n[i]=0;var a=t.length;for(i=0;i<a;++i)for(var o=t[i],s=0;s<o.length;++s)n[o[s]]=r[i];return n}(r,n.length,z):function(t){for(var e=t.length,r=new Array(e),n=0;n<e;++n)r[n]=t[n][2];return r}(n));var N=t.pointSizes,F=t.pointSize||1;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(I=0;I<n.length;++I)for(var j=n[I],B=0;B<3;++B)!isNaN(j[B])&&isFinite(j[B])&&(this.bounds[0][B]=Math.min(this.bounds[0][B],j[B]),this.bounds[1][B]=Math.max(this.bounds[1][B],j[B]));var U=0,V=0,q=0;t:for(I=0;I<r.length;++I){var H=r[I];switch(H.length){case 1:for(j=n[Y=H[0]],B=0;B<3;++B)if(isNaN(j[B])||!isFinite(j[B]))continue t;g.push(j[0],j[1],j[2]),3===(W=T?T[Y]:E?E[I]:S).length?y.push(W[0],W[1],W[2],1):y.push(W[0],W[1],W[2],W[3]),X=L?L[Y]:C?[(C[Y]-O)/(D-O),0]:P?P[I]:z?[(z[I]-O)/(D-O),0]:[(j[2]-O)/(D-O),0],b.push(X[0],X[1]),N?x.push(N[Y]):x.push(F),_.push(I),q+=1;break;case 2:for(B=0;B<2;++B){j=n[Y=H[B]];for(var G=0;G<3;++G)if(isNaN(j[G])||!isFinite(j[G]))continue t}for(B=0;B<2;++B){j=n[Y=H[B]];d.push(j[0],j[1],j[2]),3===(W=T?T[Y]:E?E[I]:S).length?p.push(W[0],W[1],W[2],1):p.push(W[0],W[1],W[2],W[3]),X=L?L[Y]:C?[(C[Y]-O)/(D-O),0]:P?P[I]:z?[(z[I]-O)/(D-O),0]:[(j[2]-O)/(D-O),0],m.push(X[0],X[1]),v.push(I)}V+=1;break;case 3:for(B=0;B<3;++B)for(j=n[Y=H[B]],G=0;G<3;++G)if(isNaN(j[G])||!isFinite(j[G]))continue t;for(B=0;B<3;++B){var Y,W,X,Z;j=n[Y=H[B]];i.push(j[0],j[1],j[2]),3===(W=T?T[Y]:E?E[I]:S).length?a.push(W[0],W[1],W[2],1):a.push(W[0],W[1],W[2],W[3]),X=L?L[Y]:C?[(C[Y]-O)/(D-O),0]:P?P[I]:z?[(z[I]-O)/(D-O),0]:[(j[2]-O)/(D-O),0],c.push(X[0],X[1]),Z=w?w[Y]:M[I],l.push(Z[0],Z[1],Z[2]),h.push(I)}U+=1}}this.pointCount=q,this.edgeCount=V,this.triangleCount=U,this.pointPositions.update(g),this.pointColors.update(y),this.pointUVs.update(b),this.pointSizes.update(x),this.pointIds.update(new Uint32Array(_)),this.edgePositions.update(d),this.edgeColors.update(p),this.edgeUVs.update(m),this.edgeIds.update(new Uint32Array(v)),this.trianglePositions.update(i),this.triangleColors.update(a),this.triangleUVs.update(c),this.triangleNormals.update(l),this.triangleIds.update(new Uint32Array(h))}},k.drawTransparent=k.draw=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,i=t.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);var s={model:r,view:n,projection:i,clipBounds:a,kambient:this.ambientLight,kdiffuse:this.diffuseLight,kspecular:this.specularLight,roughness:this.roughness,fresnel:this.fresnel,eyePosition:[0,0,0],lightPosition:[0,0,0],opacity:this.opacity,contourColor:this.contourColor,texture:0};this.texture.bind(0);var u=new Array(16);l(u,s.view,s.model),l(u,s.projection,u),c(u,u);for(o=0;o<3;++o)s.eyePosition[o]=u[12+o]/u[15];var f,h=u[15];for(o=0;o<3;++o)h+=this.lightPosition[o]*u[4*o+3];for(o=0;o<3;++o){for(var d=u[12+o],p=0;p<3;++p)d+=u[4*p+o]*this.lightPosition[p];s.lightPosition[o]=d/h}this.triangleCount>0&&((f=this.triShader).bind(),f.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind());this.edgeCount>0&&this.lineWidth>0&&((f=this.lineShader).bind(),f.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind());this.pointCount>0&&((f=this.pointShader).bind(),f.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind());this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((f=this.contourShader).bind(),f.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},k.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,i=t.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};((s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0)&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},k.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,i=new Array(r.length),a=0;a<r.length;++a)i[a]=n[r[a]];var o=m(i,[t.coord[0],this._resolution[1]-t.coord[1]],this._model,this._view,this._projection,this._resolution);if(!o)return null;var s=o[2],l=0;for(a=0;a<r.length;++a)l+=s[a]*this.intensity[r[a]];return{position:o[1],index:r[o[0]],cell:r,cellId:e,intensity:l,dataCoordinate:this.positions[r[o[0]]]}},k.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.lineShader.dispose(),this.pointShader.dispose(),this.pickShader.dispose(),this.pointPickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose(),this.contourShader.dispose()},e.exports=function(t,e){1===arguments.length&&(t=(e=t).gl);var r=function(t){var e=n(t,v.vertex,v.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.normal.location=4,e}(t),s=function(t){var e=n(t,g.vertex,g.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e}(t),l=A(t),c=T(t),f=E(t),h=S(t),d=o(t,u(new Uint8Array([255,255,255,255]),[1,1,4]));d.generateMipmap(),d.minFilter=t.LINEAR_MIPMAP_LINEAR,d.magFilter=t.LINEAR;var p=i(t),m=i(t),y=i(t),b=i(t),x=i(t),_=a(t,[{buffer:p,type:t.FLOAT,size:3},{buffer:x,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:m,type:t.FLOAT,size:4},{buffer:y,type:t.FLOAT,size:2},{buffer:b,type:t.FLOAT,size:3}]),w=i(t),k=i(t),L=i(t),C=i(t),P=a(t,[{buffer:w,type:t.FLOAT,size:3},{buffer:C,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:k,type:t.FLOAT,size:4},{buffer:L,type:t.FLOAT,size:2}]),z=i(t),O=i(t),D=i(t),I=i(t),R=i(t),N=a(t,[{buffer:z,type:t.FLOAT,size:3},{buffer:R,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:O,type:t.FLOAT,size:4},{buffer:D,type:t.FLOAT,size:2},{buffer:I,type:t.FLOAT,size:1}]),F=i(t),j=new M(t,d,r,s,l,c,f,h,p,x,m,y,b,_,w,C,k,L,P,z,R,O,D,I,N,F,a(t,[{buffer:F,type:t.FLOAT,size:3}]));return j.update(e),j}},{\"./lib/closest-point\":199,\"./lib/shaders\":200,colormap:105,\"gl-buffer\":165,\"gl-mat4/invert\":186,\"gl-mat4/multiply\":188,\"gl-shader\":220,\"gl-texture2d\":233,\"gl-vao\":237,ndarray:439,normals:442,\"simplicial-complex-contour\":504,\"typedarray-pool\":534}],202:[function(t,e,r){\"use strict\";e.exports=function(t){var e=t.gl,r=n(e,[0,0,0,1,1,0,1,1]),s=i(e,a.boxVert,a.lineFrag);return new o(t,r,s)};var n=t(\"gl-buffer\"),i=t(\"gl-shader\"),a=t(\"./shaders\");function o(t,e,r){this.plot=t,this.vbo=e,this.shader=r}var s,l,c=o.prototype;c.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},c.drawBox=(s=[0,0],l=[0,0],function(t,e,r,n,i){var a=this.plot,o=this.shader,c=a.gl;s[0]=t,s[1]=e,l[0]=r,l[1]=n,o.uniforms.lo=s,o.uniforms.hi=l,o.uniforms.color=i,c.drawArrays(c.TRIANGLE_STRIP,0,4)}),c.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{\"./shaders\":205,\"gl-buffer\":165,\"gl-shader\":220}],203:[function(t,e,r){\"use strict\";e.exports=function(t){var e=t.gl,r=n(e),a=i(e,o.gridVert,o.gridFrag),l=i(e,o.tickVert,o.gridFrag);return new s(t,r,a,l)};var n=t(\"gl-buffer\"),i=t(\"gl-shader\"),a=t(\"binary-search-bounds\"),o=t(\"./shaders\");function s(t,e,r,n){this.plot=t,this.vbo=e,this.shader=r,this.tickShader=n,this.ticks=[[],[]]}function l(t,e){return t-e}var c,u,f,h,d,p=s.prototype;p.draw=(c=[0,0],u=[0,0],f=[0,0],function(){for(var t=this.plot,e=this.vbo,r=this.shader,n=this.ticks,i=t.gl,a=t._tickBounds,o=t.dataBox,s=t.viewBox,l=t.gridLineWidth,h=t.gridLineColor,d=t.gridLineEnable,p=t.pixelRatio,m=0;m<2;++m){var v=a[m],g=a[m+2]-v,y=.5*(o[m+2]+o[m]),b=o[m+2]-o[m];u[m]=2*g/b,c[m]=2*(v-y)/b}r.bind(),e.bind(),r.attributes.dataCoord.pointer(),r.uniforms.dataShift=c,r.uniforms.dataScale=u;var x=0;for(m=0;m<2;++m){f[0]=f[1]=0,f[m]=1,r.uniforms.dataAxis=f,r.uniforms.lineWidth=l[m]/(s[m+2]-s[m])*p,r.uniforms.color=h[m];var _=6*n[m].length;d[m]&&_&&i.drawArrays(i.TRIANGLES,x,_),x+=_}}),p.drawTickMarks=function(){var t=[0,0],e=[0,0],r=[1,0],n=[0,1],i=[0,0],o=[0,0];return function(){for(var s=this.plot,c=this.vbo,u=this.tickShader,f=this.ticks,h=s.gl,d=s._tickBounds,p=s.dataBox,m=s.viewBox,v=s.pixelRatio,g=s.screenBox,y=g[2]-g[0],b=g[3]-g[1],x=m[2]-m[0],_=m[3]-m[1],w=0;w<2;++w){var M=d[w],k=d[w+2]-M,A=.5*(p[w+2]+p[w]),T=p[w+2]-p[w];e[w]=2*k/T,t[w]=2*(M-A)/T}e[0]*=x/y,t[0]*=x/y,e[1]*=_/b,t[1]*=_/b,u.bind(),c.bind(),u.attributes.dataCoord.pointer();var E=u.uniforms;E.dataShift=t,E.dataScale=e;var S=s.tickMarkLength,L=s.tickMarkWidth,C=s.tickMarkColor,P=6*f[0].length,z=Math.min(a.ge(f[0],(p[0]-d[0])/(d[2]-d[0]),l),f[0].length),O=Math.min(a.gt(f[0],(p[2]-d[0])/(d[2]-d[0]),l),f[0].length),D=0+6*z,I=6*Math.max(0,O-z),R=Math.min(a.ge(f[1],(p[1]-d[1])/(d[3]-d[1]),l),f[1].length),N=Math.min(a.gt(f[1],(p[3]-d[1])/(d[3]-d[1]),l),f[1].length),F=P+6*R,j=6*Math.max(0,N-R);i[0]=2*(m[0]-S[1])/y-1,i[1]=(m[3]+m[1])/b-1,o[0]=S[1]*v/y,o[1]=L[1]*v/b,j&&(E.color=C[1],E.tickScale=o,E.dataAxis=n,E.screenOffset=i,h.drawArrays(h.TRIANGLES,F,j)),i[0]=(m[2]+m[0])/y-1,i[1]=2*(m[1]-S[0])/b-1,o[0]=L[0]*v/y,o[1]=S[0]*v/b,I&&(E.color=C[0],E.tickScale=o,E.dataAxis=r,E.screenOffset=i,h.drawArrays(h.TRIANGLES,D,I)),i[0]=2*(m[2]+S[3])/y-1,i[1]=(m[3]+m[1])/b-1,o[0]=S[3]*v/y,o[1]=L[3]*v/b,j&&(E.color=C[3],E.tickScale=o,E.dataAxis=n,E.screenOffset=i,h.drawArrays(h.TRIANGLES,F,j)),i[0]=(m[2]+m[0])/y-1,i[1]=2*(m[3]+S[2])/b-1,o[0]=L[2]*v/y,o[1]=S[2]*v/b,I&&(E.color=C[2],E.tickScale=o,E.dataAxis=r,E.screenOffset=i,h.drawArrays(h.TRIANGLES,D,I))}}(),p.update=(h=[1,1,-1,-1,1,-1],d=[1,-1,1,1,-1,-1],function(t){for(var e=t.ticks,r=t.bounds,n=new Float32Array(18*(e[0].length+e[1].length)),i=(this.plot.zeroLineEnable,0),a=[[],[]],o=0;o<2;++o)for(var s=a[o],l=e[o],c=r[o],u=r[o+2],f=0;f<l.length;++f){var p=(l[f].x-c)/(u-c);s.push(p);for(var m=0;m<6;++m)n[i++]=p,n[i++]=h[m],n[i++]=d[m]}this.ticks=a,this.vbo.update(n)}),p.dispose=function(){this.vbo.dispose(),this.shader.dispose(),this.tickShader.dispose()}},{\"./shaders\":205,\"binary-search-bounds\":207,\"gl-buffer\":165,\"gl-shader\":220}],204:[function(t,e,r){\"use strict\";e.exports=function(t){var e=t.gl,r=n(e,[-1,-1,-1,1,1,-1,1,1]),s=i(e,a.lineVert,a.lineFrag);return new o(t,r,s)};var n=t(\"gl-buffer\"),i=t(\"gl-shader\"),a=t(\"./shaders\");function o(t,e,r){this.plot=t,this.vbo=e,this.shader=r}var s,l,c=o.prototype;c.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},c.drawLine=(s=[0,0],l=[0,0],function(t,e,r,n,i,a){var o=this.plot,c=this.shader,u=o.gl;s[0]=t,s[1]=e,l[0]=r,l[1]=n,c.uniforms.start=s,c.uniforms.end=l,c.uniforms.width=i*o.pixelRatio,c.uniforms.color=a,u.drawArrays(u.TRIANGLE_STRIP,0,4)}),c.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{\"./shaders\":205,\"gl-buffer\":165,\"gl-shader\":220}],205:[function(t,e,r){\"use strict\";var n=t(\"glslify\"),i=n([\"precision lowp float;\\n#define GLSLIFY 1\\nuniform vec4 color;\\nvoid main() {\\n gl_FragColor = vec4(color.xyz * color.w, color.w);\\n}\\n\"]);e.exports={lineVert:n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec2 coord;\\n\\nuniform vec4 screenBox;\\nuniform vec2 start, end;\\nuniform float width;\\n\\nvec2 perp(vec2 v) {\\n return vec2(v.y, -v.x);\\n}\\n\\nvec2 screen(vec2 v) {\\n return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\\n}\\n\\nvoid main() {\\n vec2 delta = normalize(perp(start - end));\\n vec2 offset = mix(start, end, 0.5 * (coord.y+1.0));\\n gl_Position = vec4(screen(offset + 0.5 * width * delta * coord.x), 0, 1);\\n}\\n\"]),lineFrag:i,textVert:n([\"#define GLSLIFY 1\\nattribute vec3 textCoordinate;\\n\\nuniform vec2 dataScale, dataShift, dataAxis, screenOffset, textScale;\\nuniform float angle;\\n\\nvoid main() {\\n float dataOffset = textCoordinate.z;\\n vec2 glyphOffset = textCoordinate.xy;\\n mat2 glyphMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\\n vec2 screenCoordinate = dataAxis * (dataScale * dataOffset + dataShift) +\\n glyphMatrix * glyphOffset * textScale + screenOffset;\\n gl_Position = vec4(screenCoordinate, 0, 1);\\n}\\n\"]),textFrag:i,gridVert:n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 dataCoord;\\n\\nuniform vec2 dataAxis, dataShift, dataScale;\\nuniform float lineWidth;\\n\\nvoid main() {\\n vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\\n pos += 10.0 * dataCoord.y * vec2(dataAxis.y, -dataAxis.x) + dataCoord.z * lineWidth;\\n gl_Position = vec4(pos, 0, 1);\\n}\\n\"]),gridFrag:i,boxVert:n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec2 coord;\\n\\nuniform vec4 screenBox;\\nuniform vec2 lo, hi;\\n\\nvec2 screen(vec2 v) {\\n return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\\n}\\n\\nvoid main() {\\n gl_Position = vec4(screen(mix(lo, hi, coord)), 0, 1);\\n}\\n\"]),tickVert:n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 dataCoord;\\n\\nuniform vec2 dataAxis, dataShift, dataScale, screenOffset, tickScale;\\n\\nvoid main() {\\n vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\\n gl_Position = vec4(pos + tickScale*dataCoord.yz + screenOffset, 0, 1);\\n}\\n\"])}},{glslify:253}],206:[function(t,e,r){\"use strict\";e.exports=function(t){var e=t.gl,r=n(e),a=i(e,s.textVert,s.textFrag);return new l(t,r,a)};var n=t(\"gl-buffer\"),i=t(\"gl-shader\"),a=t(\"text-cache\"),o=t(\"binary-search-bounds\"),s=t(\"./shaders\");function l(t,e,r){this.plot=t,this.vbo=e,this.shader=r,this.tickOffset=[[],[]],this.tickX=[[],[]],this.labelOffset=[0,0],this.labelCount=[0,0]}var c,u,f,h,d,p,m=l.prototype;m.drawTicks=(c=[0,0],u=[0,0],f=[0,0],function(t){var e=this.plot,r=this.shader,n=this.tickX[t],i=this.tickOffset[t],a=e.gl,s=e.viewBox,l=e.dataBox,h=e.screenBox,d=e.pixelRatio,p=e.tickEnable,m=e.tickPad,v=e.tickColor,g=e.tickAngle,y=e.labelEnable,b=e.labelPad,x=e.labelColor,_=e.labelAngle,w=this.labelOffset[t],M=this.labelCount[t],k=o.lt(n,l[t]),A=o.le(n,l[t+2]);c[0]=c[1]=0,c[t]=1,u[t]=(s[2+t]+s[t])/(h[2+t]-h[t])-1;var T=2/h[2+(1^t)]-h[1^t];u[1^t]=T*s[1^t]-1,p[t]&&(u[1^t]-=T*d*m[t],k<A&&i[A]>i[k]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=v[t],r.uniforms.angle=g[t],a.drawArrays(a.TRIANGLES,i[k],i[A]-i[k]))),y[t]&&M&&(u[1^t]-=T*d*b[t],r.uniforms.dataAxis=f,r.uniforms.screenOffset=u,r.uniforms.color=x[t],r.uniforms.angle=_[t],a.drawArrays(a.TRIANGLES,w,M)),u[1^t]=T*s[2+(1^t)]-1,p[t+2]&&(u[1^t]+=T*d*m[t+2],k<A&&i[A]>i[k]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=v[t+2],r.uniforms.angle=g[t+2],a.drawArrays(a.TRIANGLES,i[k],i[A]-i[k]))),y[t+2]&&M&&(u[1^t]+=T*d*b[t+2],r.uniforms.dataAxis=f,r.uniforms.screenOffset=u,r.uniforms.color=x[t+2],r.uniforms.angle=_[t+2],a.drawArrays(a.TRIANGLES,w,M))}),m.drawTitle=function(){var t=[0,0],e=[0,0];return function(){var r=this.plot,n=this.shader,i=r.gl,a=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,c=r.pixelRatio;if(this.titleCount){for(var u=0;u<2;++u)e[u]=2*(o[u]*c-a[u])/(a[2+u]-a[u])-1;n.bind(),n.uniforms.dataAxis=t,n.uniforms.screenOffset=e,n.uniforms.angle=s,n.uniforms.color=l,i.drawArrays(i.TRIANGLES,this.titleOffset,this.titleCount)}}}(),m.bind=(h=[0,0],d=[0,0],p=[0,0],function(){var t=this.plot,e=this.shader,r=t._tickBounds,n=t.dataBox,i=t.screenBox,a=t.viewBox;e.bind();for(var o=0;o<2;++o){var s=r[o],l=r[o+2]-s,c=.5*(n[o+2]+n[o]),u=n[o+2]-n[o],f=a[o],m=a[o+2]-f,v=i[o],g=i[o+2]-v;d[o]=2*l/u*m/g,h[o]=2*(s-c)/u*m/g}p[1]=2*t.pixelRatio/(i[3]-i[1]),p[0]=p[1]*(i[3]-i[1])/(i[2]-i[0]),e.uniforms.dataScale=d,e.uniforms.dataShift=h,e.uniforms.textScale=p,this.vbo.bind(),e.attributes.textCoordinate.pointer()}),m.update=function(t){var e,r,n,i,o,s=[],l=t.ticks,c=t.bounds;for(o=0;o<2;++o){var u=[Math.floor(s.length/3)],f=[-1/0],h=l[o];for(e=0;e<h.length;++e){var d=h[e],p=d.x,m=d.text,v=d.font||\"sans-serif\";i=d.fontSize||12;for(var g=1/(c[o+2]-c[o]),y=c[o],b=m.split(\"\\n\"),x=0;x<b.length;x++)for(n=a(v,b[x]).data,r=0;r<n.length;r+=2)s.push(n[r]*i,-n[r+1]*i-x*i*1.2,(p-y)*g);u.push(Math.floor(s.length/3)),f.push(p)}this.tickOffset[o]=u,this.tickX[o]=f}for(o=0;o<2;++o){for(this.labelOffset[o]=Math.floor(s.length/3),n=a(t.labelFont[o],t.labels[o],{textAlign:\"center\"}).data,i=t.labelSize[o],e=0;e<n.length;e+=2)s.push(n[e]*i,-n[e+1]*i,0);this.labelCount[o]=Math.floor(s.length/3)-this.labelOffset[o]}for(this.titleOffset=Math.floor(s.length/3),n=a(t.titleFont,t.title).data,i=t.titleSize,e=0;e<n.length;e+=2)s.push(n[e]*i,-n[e+1]*i,0);this.titleCount=Math.floor(s.length/3)-this.titleOffset,this.vbo.update(s)},m.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{\"./shaders\":205,\"binary-search-bounds\":207,\"gl-buffer\":165,\"gl-shader\":220,\"text-cache\":525}],207:[function(t,e,r){arguments[4][90][0].apply(r,arguments)},{dup:90}],208:[function(t,e,r){\"use strict\";e.exports=function(t){var e=t.gl,r=n(e,[e.drawingBufferWidth,e.drawingBufferHeight]),c=new l(e,r);return c.grid=i(c),c.text=a(c),c.line=o(c),c.box=s(c),c.update(t),c};var n=t(\"gl-select-static\"),i=t(\"./lib/grid\"),a=t(\"./lib/text\"),o=t(\"./lib/line\"),s=t(\"./lib/box\");function l(t,e){this.gl=t,this.pickBuffer=e,this.screenBox=[0,0,t.drawingBufferWidth,t.drawingBufferHeight],this.viewBox=[0,0,0,0],this.dataBox=[-10,-10,10,10],this.gridLineEnable=[!0,!0],this.gridLineWidth=[1,1],this.gridLineColor=[[0,0,0,1],[0,0,0,1]],this.pixelRatio=1,this.tickMarkLength=[0,0,0,0],this.tickMarkWidth=[0,0,0,0],this.tickMarkColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[15,15,15,15],this.tickAngle=[0,0,0,0],this.tickEnable=[!0,!0,!0,!0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[15,15,15,15],this.labelAngle=[0,Math.PI/2,0,3*Math.PI/2],this.labelEnable=[!0,!0,!0,!0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.titleCenter=[0,0],this.titleEnable=!0,this.titleAngle=0,this.titleColor=[0,0,0,1],this.borderColor=[0,0,0,0],this.backgroundColor=[0,0,0,0],this.zeroLineEnable=[!0,!0],this.zeroLineWidth=[4,4],this.zeroLineColor=[[0,0,0,1],[0,0,0,1]],this.borderLineEnable=[!0,!0,!0,!0],this.borderLineWidth=[2,2,2,2],this.borderLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.grid=null,this.text=null,this.line=null,this.box=null,this.objects=[],this.overlays=[],this._tickBounds=[1/0,1/0,-1/0,-1/0],this.static=!1,this.dirty=!1,this.pickDirty=!1,this.pickDelay=120,this.pickRadius=10,this._pickTimeout=null,this._drawPick=this.drawPick.bind(this),this._depthCounter=0}var c=l.prototype;function u(t){for(var e=t.slice(),r=0;r<e.length;++r)e[r]=e[r].slice();return e}function f(t,e){return t.x-e.x}c.setDirty=function(){this.dirty=this.pickDirty=!0},c.setOverlayDirty=function(){this.dirty=!0},c.nextDepthValue=function(){return this._depthCounter++/65536},c.draw=function(){var t=this.gl,e=this.screenBox,r=this.viewBox,n=this.dataBox,i=this.pixelRatio,a=this.grid,o=this.line,s=this.text,l=this.objects;if(this._depthCounter=0,this.pickDirty&&(this._pickTimeout&&clearTimeout(this._pickTimeout),this.pickDirty=!1,this._pickTimeout=setTimeout(this._drawPick,this.pickDelay)),this.dirty){if(this.dirty=!1,t.bindFramebuffer(t.FRAMEBUFFER,null),t.enable(t.SCISSOR_TEST),t.disable(t.DEPTH_TEST),t.depthFunc(t.LESS),t.depthMask(!1),t.enable(t.BLEND),t.blendEquation(t.FUNC_ADD,t.FUNC_ADD),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),this.borderColor){t.scissor(e[0],e[1],e[2]-e[0],e[3]-e[1]);var c=this.borderColor;t.clearColor(c[0]*c[3],c[1]*c[3],c[2]*c[3],c[3]),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT)}t.scissor(r[0],r[1],r[2]-r[0],r[3]-r[1]),t.viewport(r[0],r[1],r[2]-r[0],r[3]-r[1]);var u=this.backgroundColor;t.clearColor(u[0]*u[3],u[1]*u[3],u[2]*u[3],u[3]),t.clear(t.COLOR_BUFFER_BIT),a.draw();var f=this.zeroLineEnable,h=this.zeroLineColor,d=this.zeroLineWidth;if(f[0]||f[1]){o.bind();for(var p=0;p<2;++p)if(f[p]&&n[p]<=0&&n[p+2]>=0){var m=e[p]-n[p]*(e[p+2]-e[p])/(n[p+2]-n[p]);0===p?o.drawLine(m,e[1],m,e[3],d[p],h[p]):o.drawLine(e[0],m,e[2],m,d[p],h[p])}}for(p=0;p<l.length;++p)l[p].draw();t.viewport(e[0],e[1],e[2]-e[0],e[3]-e[1]),t.scissor(e[0],e[1],e[2]-e[0],e[3]-e[1]),this.grid.drawTickMarks(),o.bind();var v=this.borderLineEnable,g=this.borderLineWidth,y=this.borderLineColor;for(v[1]&&o.drawLine(r[0],r[1]-.5*g[1]*i,r[0],r[3]+.5*g[3]*i,g[1],y[1]),v[0]&&o.drawLine(r[0]-.5*g[0]*i,r[1],r[2]+.5*g[2]*i,r[1],g[0],y[0]),v[3]&&o.drawLine(r[2],r[1]-.5*g[1]*i,r[2],r[3]+.5*g[3]*i,g[3],y[3]),v[2]&&o.drawLine(r[0]-.5*g[0]*i,r[3],r[2]+.5*g[2]*i,r[3],g[2],y[2]),s.bind(),p=0;p<2;++p)s.drawTicks(p);this.titleEnable&&s.drawTitle();var b=this.overlays;for(p=0;p<b.length;++p)b[p].draw();t.disable(t.SCISSOR_TEST),t.disable(t.BLEND),t.depthMask(!0)}},c.drawPick=function(){if(!this.static){var t=this.pickBuffer;this.gl;this._pickTimeout=null,t.begin();for(var e=1,r=this.objects,n=0;n<r.length;++n)e=r[n].drawPick(e);t.end()}},c.pick=function(t,e){if(!this.static){var r=this.pixelRatio,n=this.pickPixelRatio,i=this.viewBox,a=0|Math.round((t-i[0]/r)*n),o=0|Math.round((e-i[1]/r)*n),s=this.pickBuffer.query(a,o,this.pickRadius);if(!s)return null;for(var l=s.id+(s.value[0]<<8)+(s.value[1]<<16)+(s.value[2]<<24),c=this.objects,u=0;u<c.length;++u){var f=c[u].pick(a,o,l);if(f)return f}return null}},c.setScreenBox=function(t){var e=this.screenBox,r=this.pixelRatio;e[0]=0|Math.round(t[0]*r),e[1]=0|Math.round(t[1]*r),e[2]=0|Math.round(t[2]*r),e[3]=0|Math.round(t[3]*r),this.setDirty()},c.setDataBox=function(t){var e=this.dataBox;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3])&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],this.setDirty())},c.setViewBox=function(t){var e=this.pixelRatio,r=this.viewBox;r[0]=0|Math.round(t[0]*e),r[1]=0|Math.round(t[1]*e),r[2]=0|Math.round(t[2]*e),r[3]=0|Math.round(t[3]*e);var n=this.pickPixelRatio;this.pickBuffer.shape=[0|Math.round((t[2]-t[0])*n),0|Math.round((t[3]-t[1])*n)],this.setDirty()},c.update=function(t){t=t||{};var e=this.gl;this.pixelRatio=t.pixelRatio||1;var r=this.pixelRatio;this.pickPixelRatio=Math.max(r,1),this.setScreenBox(t.screenBox||[0,0,e.drawingBufferWidth/r,e.drawingBufferHeight/r]);this.screenBox;this.setViewBox(t.viewBox||[.125*(this.screenBox[2]-this.screenBox[0])/r,.125*(this.screenBox[3]-this.screenBox[1])/r,.875*(this.screenBox[2]-this.screenBox[0])/r,.875*(this.screenBox[3]-this.screenBox[1])/r]);var n=this.viewBox,i=(n[2]-n[0])/(n[3]-n[1]);this.setDataBox(t.dataBox||[-10,-10/i,10,10/i]),this.borderColor=!1!==t.borderColor&&(t.borderColor||[0,0,0,0]).slice(),this.backgroundColor=(t.backgroundColor||[0,0,0,0]).slice(),this.gridLineEnable=(t.gridLineEnable||[!0,!0]).slice(),this.gridLineWidth=(t.gridLineWidth||[1,1]).slice(),this.gridLineColor=u(t.gridLineColor||[[.5,.5,.5,1],[.5,.5,.5,1]]),this.zeroLineEnable=(t.zeroLineEnable||[!0,!0]).slice(),this.zeroLineWidth=(t.zeroLineWidth||[4,4]).slice(),this.zeroLineColor=u(t.zeroLineColor||[[0,0,0,1],[0,0,0,1]]),this.tickMarkLength=(t.tickMarkLength||[0,0,0,0]).slice(),this.tickMarkWidth=(t.tickMarkWidth||[0,0,0,0]).slice(),this.tickMarkColor=u(t.tickMarkColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.titleCenter=(t.titleCenter||[.5*(n[0]+n[2])/r,(n[3]+120)/r]).slice(),this.titleEnable=!(\"titleEnable\"in t&&!t.titleEnable),this.titleAngle=t.titleAngle||0,this.titleColor=(t.titleColor||[0,0,0,1]).slice(),this.labelPad=(t.labelPad||[15,15,15,15]).slice(),this.labelAngle=(t.labelAngle||[0,Math.PI/2,0,3*Math.PI/2]).slice(),this.labelEnable=(t.labelEnable||[!0,!0,!0,!0]).slice(),this.labelColor=u(t.labelColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.tickPad=(t.tickPad||[15,15,15,15]).slice(),this.tickAngle=(t.tickAngle||[0,0,0,0]).slice(),this.tickEnable=(t.tickEnable||[!0,!0,!0,!0]).slice(),this.tickColor=u(t.tickColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.borderLineEnable=(t.borderLineEnable||[!0,!0,!0,!0]).slice(),this.borderLineWidth=(t.borderLineWidth||[2,2,2,2]).slice(),this.borderLineColor=u(t.borderLineColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);var a=t.ticks||[[],[]],o=this._tickBounds;o[0]=o[1]=1/0,o[2]=o[3]=-1/0;for(var s=0;s<2;++s){var l=a[s].slice(0);0!==l.length&&(l.sort(f),o[s]=Math.min(o[s],l[0].x),o[s+2]=Math.max(o[s+2],l[l.length-1].x))}this.grid.update({bounds:o,ticks:a}),this.text.update({bounds:o,ticks:a,labels:t.labels||[\"x\",\"y\"],labelSize:t.labelSize||[12,12],labelFont:t.labelFont||[\"sans-serif\",\"sans-serif\"],title:t.title||\"\",titleSize:t.titleSize||18,titleFont:t.titleFont||\"sans-serif\"}),this.static=!!t.static,this.setDirty()},c.dispose=function(){this.box.dispose(),this.grid.dispose(),this.text.dispose(),this.line.dispose();for(var t=this.objects.length-1;t>=0;--t)this.objects[t].dispose();this.objects.length=0;for(t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},c.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},c.removeObject=function(t){for(var e=this.objects,r=0;r<e.length;++r)if(e[r]===t){e.splice(r,1),this.setDirty();break}},c.addOverlay=function(t){this.overlays.indexOf(t)<0&&(this.overlays.push(t),this.setOverlayDirty())},c.removeOverlay=function(t){for(var e=this.overlays,r=0;r<e.length;++r)if(e[r]===t){e.splice(r,1),this.setOverlayDirty();break}}},{\"./lib/box\":202,\"./lib/grid\":203,\"./lib/line\":204,\"./lib/text\":206,\"gl-select-static\":219}],209:[function(t,e,r){var n=t(\"glslify\"),i=t(\"gl-shader\"),a=n([\"precision mediump float;\\n#define GLSLIFY 1\\nattribute vec2 position;\\nvarying vec2 uv;\\nvoid main() {\\n uv = position;\\n gl_Position = vec4(position, 0, 1);\\n}\"]),o=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform sampler2D accumBuffer;\\nvarying vec2 uv;\\n\\nvoid main() {\\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\\n gl_FragColor = min(vec4(1,1,1,1), accum);\\n}\"]);e.exports=function(t){return i(t,a,o,null,[{name:\"position\",type:\"vec2\"}])}},{\"gl-shader\":220,glslify:253}],210:[function(t,e,r){\"use strict\";e.exports=function(t){var e=!1,r=((t=t||{}).pixelRatio||parseFloat(window.devicePixelRatio),t.canvas);if(!r)if(r=document.createElement(\"canvas\"),t.container){var v=t.container;v.appendChild(r)}else document.body.appendChild(r);var g=t.gl;g||(g=function(t,e){var r=null;try{(r=t.getContext(\"webgl\",e))||(r=t.getContext(\"experimental-webgl\",e))}catch(t){return null}return r}(r,t.glOptions||{premultipliedAlpha:!0,antialias:!0}));if(!g)throw new Error(\"webgl not supported\");var y=t.bounds||[[-10,-10,-10],[10,10,10]],b=new function(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null},x=l(g,[g.drawingBufferWidth,g.drawingBufferHeight],{preferFloat:!d}),_=h(g),w=t.camera||{eye:[2,0,0],center:[0,0,0],up:[0,1,0],zoomMin:.1,zoomMax:100,mode:\"turntable\"},M=t.axes||{},k=i(g,M);k.enable=!M.disable;var A=t.spikes||{},T=o(g,A),E=[],S=[],L=[],C=[],P=!0,z=!0,O=new Array(16),D=new Array(16),I={view:null,projection:O,model:D},z=!0,R=[g.drawingBufferWidth,g.drawingBufferHeight],N={gl:g,contextLost:!1,pixelRatio:t.pixelRatio||parseFloat(window.devicePixelRatio),canvas:r,selection:b,camera:n(r,w),axes:k,axesPixels:null,spikes:T,bounds:y,objects:E,shape:R,aspect:t.aspectRatio||[1,1,1],pickRadius:t.pickRadius||10,zNear:t.zNear||.01,zFar:t.zFar||1e3,fovy:t.fovy||Math.PI/4,clearColor:t.clearColor||[0,0,0,0],autoResize:m(t.autoResize),autoBounds:m(t.autoBounds),autoScale:!!t.autoScale,autoCenter:m(t.autoCenter),clipToBounds:m(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:I,oncontextloss:null,mouseListener:null},F=[g.drawingBufferWidth/N.pixelRatio|0,g.drawingBufferHeight/N.pixelRatio|0];function j(){if(!e&&N.autoResize){var t=r.parentNode,n=1,i=1;t&&t!==document.body?(n=t.clientWidth,i=t.clientHeight):(n=window.innerWidth,i=window.innerHeight);var a=0|Math.ceil(n*N.pixelRatio),o=0|Math.ceil(i*N.pixelRatio);if(a!==r.width||o!==r.height){r.width=a,r.height=o;var s=r.style;s.position=s.position||\"absolute\",s.left=\"0px\",s.top=\"0px\",s.width=n+\"px\",s.height=i+\"px\",P=!0}}}N.autoResize&&j();function B(){for(var t=E.length,e=C.length,r=0;r<e;++r)L[r]=0;t:for(var r=0;r<t;++r){var n=E[r],i=n.pickSlots;if(i){for(var a=0;a<e;++a)if(L[a]+i<255){S[r]=a,n.setPickBase(L[a]+1),L[a]+=i;continue t}var o=s(g,R);S[r]=e,C.push(o),L.push(i),n.setPickBase(1),e+=1}else S[r]=-1}for(;e>0&&0===L[e-1];)L.pop(),C.pop().dispose()}window.addEventListener(\"resize\",j),N.update=function(t){e||(t=t||{},P=!0,z=!0)},N.add=function(t){e||(t.axes=k,E.push(t),S.push(-1),P=!0,z=!0,B())},N.remove=function(t){if(!e){var r=E.indexOf(t);r<0||(E.splice(r,1),S.pop(),P=!0,z=!0,B())}},N.dispose=function(){if(!e&&(e=!0,window.removeEventListener(\"resize\",j),r.removeEventListener(\"webglcontextlost\",q),N.mouseListener.enabled=!1,!N.contextLost)){k.dispose(),T.dispose();for(var t=0;t<E.length;++t)E[t].dispose();x.dispose();for(var t=0;t<C.length;++t)C[t].dispose();_.dispose(),g=null,k=null,T=null,E=[]}};var U=!1,V=0;function q(){if(N.contextLost)return!0;g.isContextLost()&&(N.contextLost=!0,N.mouseListener.enabled=!1,N.selection.object=null,N.oncontextloss&&N.oncontextloss())}N.mouseListener=u(r,function(t,r,n){if(!e){var i=C.length,a=E.length,o=b.object;b.distance=1/0,b.mouse[0]=r,b.mouse[1]=n,b.object=null,b.screen=null,b.dataCoordinate=b.dataPosition=null;var s=!1;if(t&&V)U=!0;else{U&&(z=!0),U=!1;for(var l=0;l<i;++l){var c=C[l].query(r,F[1]-n-1,N.pickRadius);if(c){if(c.distance>b.distance)continue;for(var u=0;u<a;++u){var f=E[u];if(S[u]===l){var h=f.pick(c);h&&(b.buttons=t,b.screen=c.coord,b.distance=c.distance,b.object=f,b.index=h.distance,b.dataPosition=h.position,b.dataCoordinate=h.dataCoordinate,b.data=h,s=!0)}}}}}o&&o!==b.object&&(o.highlight&&o.highlight(null),P=!0),b.object&&(b.object.highlight&&b.object.highlight(b.data),P=!0),(s=s||b.object!==o)&&N.onselect&&N.onselect(b),1&t&&!(1&V)&&N.onclick&&N.onclick(b),V=t}}),r.addEventListener(\"webglcontextlost\",q);var H=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],G=[H[0].slice(),H[1].slice()];function Y(){if(!q()){j();var t=N.camera.tick();I.view=N.camera.matrix,P=P||t,z=z||t,k.pixelRatio=N.pixelRatio,T.pixelRatio=N.pixelRatio;var e=E.length,r=H[0],n=H[1];r[0]=r[1]=r[2]=1/0,n[0]=n[1]=n[2]=-1/0;for(var i=0;i<e;++i){var o=E[i];o.pixelRatio=N.pixelRatio,o.axes=N.axes,P=P||!!o.dirty,z=z||!!o.dirty;var s=o.bounds;if(s)for(var l=s[0],u=s[1],h=0;h<3;++h)r[h]=Math.min(r[h],l[h]),n[h]=Math.max(n[h],u[h])}var d=N.bounds;if(N.autoBounds)for(var h=0;h<3;++h){if(n[h]<r[h])r[h]=-1,n[h]=1;else{r[h]===n[h]&&(r[h]-=1,n[h]+=1);var m=.05*(n[h]-r[h]);r[h]=r[h]-m,n[h]=n[h]+m}d[0][h]=r[h],d[1][h]=n[h]}for(var v=!1,h=0;h<3;++h)v=v||G[0][h]!==d[0][h]||G[1][h]!==d[1][h],G[0][h]=d[0][h],G[1][h]=d[1][h];if(z=z||v,P=P||v){if(v){for(var y=[0,0,0],i=0;i<3;++i)y[i]=p((d[1][i]-d[0][i])/10);k.autoTicks?k.update({bounds:d,tickSpacing:y}):k.update({bounds:d})}var w=g.drawingBufferWidth,M=g.drawingBufferHeight;R[0]=w,R[1]=M,F[0]=0|Math.max(w/N.pixelRatio,1),F[1]=0|Math.max(M/N.pixelRatio,1),f(O,N.fovy,w/M,N.zNear,N.zFar);for(var i=0;i<16;++i)D[i]=0;D[15]=1;for(var A=0,i=0;i<3;++i)A=Math.max(A,d[1][i]-d[0][i]);for(var i=0;i<3;++i)N.autoScale?D[5*i]=N.aspect[i]/(d[1][i]-d[0][i]):D[5*i]=1/A,N.autoCenter&&(D[12+i]=.5*-D[5*i]*(d[0][i]+d[1][i]));for(var i=0;i<e;++i){var o=E[i];o.axesBounds=d,N.clipToBounds&&(o.clipBounds=d)}b.object&&(N.snapToData?T.position=b.dataCoordinate:T.position=b.dataPosition,T.bounds=d),z&&(z=!1,function(){if(q())return;g.colorMask(!0,!0,!0,!0),g.depthMask(!0),g.disable(g.BLEND),g.enable(g.DEPTH_TEST);for(var t=E.length,e=C.length,r=0;r<e;++r){var n=C[r];n.shape=F,n.begin();for(var i=0;i<t;++i)if(S[i]===r){var a=E[i];a.drawPick&&(a.pixelRatio=1,a.drawPick(I))}n.end()}}()),N.axesPixels=a(N.axes,I,w,M),N.onrender&&N.onrender(),g.bindFramebuffer(g.FRAMEBUFFER,null),g.viewport(0,0,w,M);var L=N.clearColor;g.clearColor(L[0],L[1],L[2],L[3]),g.clear(g.COLOR_BUFFER_BIT|g.DEPTH_BUFFER_BIT),g.depthMask(!0),g.colorMask(!0,!0,!0,!0),g.enable(g.DEPTH_TEST),g.depthFunc(g.LEQUAL),g.disable(g.BLEND),g.disable(g.CULL_FACE);var B=!1;k.enable&&(B=B||k.isTransparent(),k.draw(I)),T.axes=k,b.object&&T.draw(I),g.disable(g.CULL_FACE);for(var i=0;i<e;++i){var o=E[i];o.axes=k,o.pixelRatio=N.pixelRatio,o.isOpaque&&o.isOpaque()&&o.draw(I),o.isTransparent&&o.isTransparent()&&(B=!0)}if(B){x.shape=R,x.bind(),g.clear(g.DEPTH_BUFFER_BIT),g.colorMask(!1,!1,!1,!1),g.depthMask(!0),g.depthFunc(g.LESS),k.enable&&k.isTransparent()&&k.drawTransparent(I);for(var i=0;i<e;++i){var o=E[i];o.isOpaque&&o.isOpaque()&&o.draw(I)}g.enable(g.BLEND),g.blendEquation(g.FUNC_ADD),g.blendFunc(g.ONE,g.ONE_MINUS_SRC_ALPHA),g.colorMask(!0,!0,!0,!0),g.depthMask(!1),g.clearColor(0,0,0,0),g.clear(g.COLOR_BUFFER_BIT),k.isTransparent()&&k.drawTransparent(I);for(var i=0;i<e;++i){var o=E[i];o.isTransparent&&o.isTransparent()&&o.drawTransparent(I)}g.bindFramebuffer(g.FRAMEBUFFER,null),g.blendFunc(g.ONE,g.ONE_MINUS_SRC_ALPHA),g.disable(g.DEPTH_TEST),_.bind(),x.color[0].bind(0),_.uniforms.accumBuffer=0,c(g),g.disable(g.BLEND)}P=!1;for(var i=0;i<e;++i)E[i].dirty=!1}}}return function t(){e||N.contextLost||(requestAnimationFrame(t),Y())}(),N.redraw=function(){e||(P=!0,Y())},N};var n=t(\"3d-view-controls\"),i=t(\"gl-axes3d\"),a=t(\"gl-axes3d/properties\"),o=t(\"gl-spikes3d\"),s=t(\"gl-select-static\"),l=t(\"gl-fbo\"),c=t(\"a-big-triangle\"),u=t(\"mouse-change\"),f=t(\"gl-mat4/perspective\"),h=t(\"./lib/shader\"),d=t(\"is-mobile\")();function p(t){var e=Math.round(Math.log(Math.abs(t))/Math.log(10));if(e<0){var r=Math.round(Math.pow(10,-e));return Math.ceil(t*r)/r}if(e>0){r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function m(t){return\"boolean\"!=typeof t||t}},{\"./lib/shader\":209,\"3d-view-controls\":39,\"a-big-triangle\":42,\"gl-axes3d\":157,\"gl-axes3d/properties\":164,\"gl-fbo\":171,\"gl-mat4/perspective\":189,\"gl-select-static\":219,\"gl-spikes3d\":229,\"is-mobile\":265,\"mouse-change\":424}],211:[function(t,e,r){var n=t(\"glslify\");r.pointVertex=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec2 position;\\n\\nuniform mat3 matrix;\\nuniform float pointSize;\\nuniform float pointCloud;\\n\\nhighp float rand(vec2 co) {\\n highp float a = 12.9898;\\n highp float b = 78.233;\\n highp float c = 43758.5453;\\n highp float d = dot(co.xy, vec2(a, b));\\n highp float e = mod(d, 3.14);\\n return fract(sin(e) * c);\\n}\\n\\nvoid main() {\\n vec3 hgPosition = matrix * vec3(position, 1);\\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\\n // if we don't jitter the point size a bit, overall point cloud\\n // saturation 'jumps' on zooming, which is disturbing and confusing\\n gl_PointSize = pointSize * ((19.5 + rand(position)) / 20.0);\\n if(pointCloud != 0.0) { // pointCloud is truthy\\n // get the same square surface as circle would be\\n gl_PointSize *= 0.886;\\n }\\n}\"]),r.pointFragment=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec4 color, borderColor;\\nuniform float centerFraction;\\nuniform float pointCloud;\\n\\nvoid main() {\\n float radius;\\n vec4 baseColor;\\n if(pointCloud != 0.0) { // pointCloud is truthy\\n if(centerFraction == 1.0) {\\n gl_FragColor = color;\\n } else {\\n gl_FragColor = mix(borderColor, color, centerFraction);\\n }\\n } else {\\n radius = length(2.0 * gl_PointCoord.xy - 1.0);\\n if(radius > 1.0) {\\n discard;\\n }\\n baseColor = mix(borderColor, color, step(radius, centerFraction));\\n gl_FragColor = vec4(baseColor.rgb * baseColor.a, baseColor.a);\\n }\\n}\\n\"]),r.pickVertex=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec2 position;\\nattribute vec4 pickId;\\n\\nuniform mat3 matrix;\\nuniform float pointSize;\\nuniform vec4 pickOffset;\\n\\nvarying vec4 fragId;\\n\\nvoid main() {\\n vec3 hgPosition = matrix * vec3(position, 1);\\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\\n gl_PointSize = pointSize;\\n\\n vec4 id = pickId + pickOffset;\\n id.y += floor(id.x / 256.0);\\n id.x -= floor(id.x / 256.0) * 256.0;\\n\\n id.z += floor(id.y / 256.0);\\n id.y -= floor(id.y / 256.0) * 256.0;\\n\\n id.w += floor(id.z / 256.0);\\n id.z -= floor(id.z / 256.0) * 256.0;\\n\\n fragId = id;\\n}\\n\"]),r.pickFragment=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nvarying vec4 fragId;\\n\\nvoid main() {\\n float radius = length(2.0 * gl_PointCoord.xy - 1.0);\\n if(radius > 1.0) {\\n discard;\\n }\\n gl_FragColor = fragId / 255.0;\\n}\\n\"])},{glslify:253}],212:[function(t,e,r){\"use strict\";var n=t(\"gl-shader\"),i=t(\"gl-buffer\"),a=t(\"typedarray-pool\"),o=t(\"./lib/shader\");function s(t,e,r,n,i){this.plot=t,this.offsetBuffer=e,this.pickBuffer=r,this.shader=n,this.pickShader=i,this.sizeMin=.5,this.sizeMinCap=2,this.sizeMax=20,this.areaRatio=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.blend=!1,this.pickOffset=0,this.points=null}e.exports=function(t,e){var r=t.gl,a=i(r),l=i(r),c=n(r,o.pointVertex,o.pointFragment),u=n(r,o.pickVertex,o.pickFragment),f=new s(t,a,l,c,u);return f.update(e),t.addObject(f),f};var l,c,u=s.prototype;u.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},u.update=function(t){var e;function r(e,r){return e in t?t[e]:r}t=t||{},this.sizeMin=r(\"sizeMin\",.5),this.sizeMax=r(\"sizeMax\",20),this.color=r(\"color\",[1,0,0,1]).slice(),this.areaRatio=r(\"areaRatio\",1),this.borderColor=r(\"borderColor\",[0,0,0,1]).slice(),this.blend=r(\"blend\",!1);var n=t.positions.length>>>1,i=t.positions instanceof Float32Array,o=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=i?s:a.mallocFloat32(s.length),c=o?t.idToIndex:a.mallocInt32(n);if(i||l.set(s),!o)for(l.set(s),e=0;e<n;e++)c[e]=e;this.points=s,this.offsetBuffer.update(l),this.pickBuffer.update(c),i||a.free(l),o||a.free(c),this.pointCount=n,this.pickOffset=0},u.unifiedDraw=(l=[1,0,0,0,1,0,0,0,1],c=[0,0,0,0],function(t){var e=void 0!==t,r=e?this.pickShader:this.shader,n=this.plot.gl,i=this.plot.dataBox;if(0===this.pointCount)return t;var a=i[2]-i[0],o=i[3]-i[1],s=function(t,e){var r,n=0,i=t.length>>>1;for(r=0;r<i;r++){var a=t[2*r],o=t[2*r+1];a>=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}(this.points,i),u=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(s,.33333)));l[0]=2/a,l[4]=2/o,l[6]=-2*i[0]/a-1,l[7]=-2*i[1]/o-1,this.offsetBuffer.bind(),r.bind(),r.attributes.position.pointer(),r.uniforms.matrix=l,r.uniforms.color=this.color,r.uniforms.borderColor=this.borderColor,r.uniforms.pointCloud=u<5,r.uniforms.pointSize=u,r.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),e&&(c[0]=255&t,c[1]=t>>8&255,c[2]=t>>16&255,c[3]=t>>24&255,this.pickBuffer.bind(),r.attributes.pickId.pointer(n.UNSIGNED_BYTE),r.uniforms.pickOffset=c,this.pickOffset=t);var f=n.getParameter(n.BLEND),h=n.getParameter(n.DITHER);return f&&!this.blend&&n.disable(n.BLEND),h&&n.disable(n.DITHER),n.drawArrays(n.POINTS,0,this.pointCount),f&&!this.blend&&n.enable(n.BLEND),h&&n.enable(n.DITHER),t+this.pointCount}),u.draw=u.unifiedDraw,u.drawPick=u.unifiedDraw,u.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(r<n||r>=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}}},{\"./lib/shader\":211,\"gl-buffer\":165,\"gl-shader\":220,\"typedarray-pool\":534}],213:[function(t,e,r){e.exports=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],f=e[2],h=e[3],d=r[0],p=r[1],m=r[2],v=r[3];(a=c*d+u*p+f*m+h*v)<0&&(a=-a,d=-d,p=-p,m=-m,v=-v);1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n);return t[0]=s*c+l*d,t[1]=s*u+l*p,t[2]=s*f+l*m,t[3]=s*h+l*v,t}},{}],214:[function(t,e,r){\"use strict\";var n=t(\"vectorize-text\");e.exports=function(t,e){var r=i[e];r||(r=i[e]={});if(t in r)return r[t];for(var a=n(t,{textAlign:\"center\",textBaseline:\"middle\",lineHeight:1,font:e}),o=n(t,{triangles:!0,textAlign:\"center\",textBaseline:\"middle\",lineHeight:1,font:e}),s=[[1/0,1/0],[-1/0,-1/0]],l=0;l<a.positions.length;++l)for(var c=a.positions[l],u=0;u<2;++u)s[0][u]=Math.min(s[0][u],c[u]),s[1][u]=Math.max(s[1][u],c[u]);return r[t]=[o,a,s]};var i={}},{\"vectorize-text\":548}],215:[function(t,e,r){var n=t(\"gl-shader\"),i=t(\"glslify\"),a=i([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position;\\nattribute vec4 color;\\nattribute vec2 glyph;\\nattribute vec4 id;\\n\\nuniform vec4 highlightId;\\nuniform float highlightScale;\\nuniform mat4 model, view, projection;\\nuniform vec3 clipBounds[2];\\n\\nvarying vec4 interpColor;\\nvarying vec4 pickId;\\nvarying vec3 dataCoordinate;\\n\\nvoid main() {\\n if(any(lessThan(position, clipBounds[0])) || \\n any(greaterThan(position, clipBounds[1])) ) {\\n gl_Position = vec4(0,0,0,0);\\n } else {\\n float scale = 1.0;\\n if(distance(highlightId, id) < 0.0001) {\\n scale = highlightScale;\\n }\\n\\n vec4 worldPosition = model * vec4(position, 1);\\n vec4 viewPosition = view * worldPosition;\\n viewPosition = viewPosition / viewPosition.w;\\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\\n \\n gl_Position = clipPosition;\\n interpColor = color;\\n pickId = id;\\n dataCoordinate = position;\\n }\\n}\"]),o=i([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position;\\nattribute vec4 color;\\nattribute vec2 glyph;\\nattribute vec4 id;\\n\\nuniform mat4 model, view, projection;\\nuniform vec2 screenSize;\\nuniform vec3 clipBounds[2];\\nuniform float highlightScale, pixelRatio;\\nuniform vec4 highlightId;\\n\\nvarying vec4 interpColor;\\nvarying vec4 pickId;\\nvarying vec3 dataCoordinate;\\n\\nvoid main() {\\n if(any(lessThan(position, clipBounds[0])) || any(greaterThan(position, clipBounds[1]))) {\\n gl_Position = vec4(0,0,0,0);\\n } else {\\n float scale = pixelRatio;\\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\\n scale *= highlightScale;\\n }\\n\\n vec4 worldPosition = model * vec4(position, 1.0);\\n vec4 viewPosition = view * worldPosition;\\n vec4 clipPosition = projection * viewPosition;\\n clipPosition /= clipPosition.w;\\n \\n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\\n interpColor = color;\\n pickId = id;\\n dataCoordinate = position;\\n }\\n}\"]),s=i([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position;\\nattribute vec4 color;\\nattribute vec2 glyph;\\nattribute vec4 id;\\n\\nuniform float highlightScale;\\nuniform vec4 highlightId;\\nuniform vec3 axes[2];\\nuniform mat4 model, view, projection;\\nuniform vec2 screenSize;\\nuniform vec3 clipBounds[2];\\nuniform float scale, pixelRatio;\\n\\nvarying vec4 interpColor;\\nvarying vec4 pickId;\\nvarying vec3 dataCoordinate;\\n\\nvoid main() {\\n if(any(lessThan(position, clipBounds[0])) ||\\n any(greaterThan(position, clipBounds[1])) ) {\\n gl_Position = vec4(0,0,0,0);\\n } else {\\n float lscale = pixelRatio * scale;\\n if(distance(highlightId, id) < 0.0001) {\\n lscale *= highlightScale;\\n }\\n\\n vec4 clipCenter = projection * view * model * vec4(position, 1);\\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\\n vec4 clipPosition = projection * view * model * vec4(dataPosition, 1);\\n\\n gl_Position = clipPosition;\\n interpColor = color;\\n pickId = id;\\n dataCoordinate = dataPosition;\\n }\\n}\\n\"]),l=i([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec3 fragClipBounds[2];\\nuniform float opacity;\\n\\nvarying vec4 interpColor;\\nvarying vec4 pickId;\\nvarying vec3 dataCoordinate;\\n\\nvoid main() {\\n if(any(lessThan(dataCoordinate, fragClipBounds[0])) ||\\n any(greaterThan(dataCoordinate, fragClipBounds[1])) ) {\\n discard;\\n } else {\\n gl_FragColor = interpColor * opacity;\\n }\\n}\\n\"]),c=i([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec3 fragClipBounds[2];\\nuniform float pickGroup;\\n\\nvarying vec4 pickId;\\nvarying vec3 dataCoordinate;\\n\\nvoid main() {\\n if(any(lessThan(dataCoordinate, fragClipBounds[0])) || \\n any(greaterThan(dataCoordinate, fragClipBounds[1])) ) {\\n discard;\\n } else {\\n gl_FragColor = vec4(pickGroup, pickId.bgr);\\n }\\n}\"]),u=[{name:\"position\",type:\"vec3\"},{name:\"color\",type:\"vec4\"},{name:\"glyph\",type:\"vec2\"},{name:\"id\",type:\"vec4\"}],f={vertex:a,fragment:l,attributes:u},h={vertex:o,fragment:l,attributes:u},d={vertex:s,fragment:l,attributes:u},p={vertex:a,fragment:c,attributes:u},m={vertex:o,fragment:c,attributes:u},v={vertex:s,fragment:c,attributes:u};function g(t,e){var r=n(t,e),i=r.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,r}r.createPerspective=function(t){return g(t,f)},r.createOrtho=function(t){return g(t,h)},r.createProject=function(t){return g(t,d)},r.createPickPerspective=function(t){return g(t,p)},r.createPickOrtho=function(t){return g(t,m)},r.createPickProject=function(t){return g(t,v)}},{\"gl-shader\":220,glslify:253}],216:[function(t,e,r){\"use strict\";var n=t(\"gl-buffer\"),i=t(\"gl-vao\"),a=t(\"typedarray-pool\"),o=t(\"gl-mat4/multiply\"),s=t(\"./lib/shaders\"),l=t(\"./lib/glyphs\"),c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function u(t,e){var r=t[0],n=t[1],i=t[2],a=t[3];return t[0]=e[0]*r+e[4]*n+e[8]*i+e[12]*a,t[1]=e[1]*r+e[5]*n+e[9]*i+e[13]*a,t[2]=e[2]*r+e[6]*n+e[10]*i+e[14]*a,t[3]=e[3]*r+e[7]*n+e[11]*i+e[15]*a,t}function f(t,e,r,n){return u(n,n),u(n,n),u(n,n)}function h(t,e,r,n,i,a,o,s,l,c,u,f){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.pickId=0,this.pickPerspectiveShader=c,this.pickOrthoShader=u,this.pickProjectShader=f,this.points=[],this._selectResult=new function(t,e){this.index=t,this.dataCoordinate=this.position=e}(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}e.exports=function(t){var e=t.gl,r=s.createPerspective(e),a=s.createOrtho(e),o=s.createProject(e),l=s.createPickPerspective(e),c=s.createPickOrtho(e),u=s.createPickProject(e),f=n(e),d=n(e),p=n(e),m=n(e),v=i(e,[{buffer:f,size:3,type:e.FLOAT},{buffer:d,size:4,type:e.FLOAT},{buffer:p,size:2,type:e.FLOAT},{buffer:m,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),g=new h(e,r,a,o,f,d,p,m,v,l,c,u);return g.update(t),g};var d=h.prototype;d.pickSlots=1,d.setPickBase=function(t){this.pickId=t},d.isTransparent=function(){if(this.opacity<1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]<1)return!0;return!1},d.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var p=[0,0],m=[0,0,0],v=[0,0,0],g=[0,0,0,1],y=[0,0,0,1],b=c.slice(),x=[0,0,0],_=[[0,0,0],[0,0,0]];function w(t){return t[0]=t[1]=t[2]=0,t}function M(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function k(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function A(t,e,r,n,i){var a,s=e.axesProject,l=e.gl,u=t.uniforms,h=r.model||c,d=r.view||c,A=r.projection||c,T=e.axesBounds,E=function(t){for(var e=_,r=0;r<2;++r)for(var n=0;n<3;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}(e.clipBounds);a=e.axes&&e.axes.lastCubeProps?e.axes.lastCubeProps.axis:[1,1,1],p[0]=2/l.drawingBufferWidth,p[1]=2/l.drawingBufferHeight,t.bind(),u.view=d,u.projection=A,u.screenSize=p,u.highlightId=e.highlightId,u.highlightScale=e.highlightScale,u.clipBounds=E,u.pickGroup=e.pickId/255,u.pixelRatio=e.pixelRatio;for(var S=0;S<3;++S)if(s[S]&&e.projectOpacity[S]<1===n){u.scale=e.projectScale[S],u.opacity=e.projectOpacity[S];for(var L=b,C=0;C<16;++C)L[C]=0;for(C=0;C<4;++C)L[5*C]=1;L[5*S]=0,a[S]<0?L[12+S]=T[0][S]:L[12+S]=T[1][S],o(L,h,L),u.model=L;var P=(S+1)%3,z=(S+2)%3,O=w(m),D=w(v);O[P]=1,D[z]=1;var I=f(0,0,0,M(g,O)),R=f(0,0,0,M(y,D));if(Math.abs(I[1])>Math.abs(R[1])){var N=I;I=R,R=N,N=O,O=D,D=N;var F=P;P=z,z=F}I[0]<0&&(O[P]=-1),R[1]>0&&(D[z]=-1);var j=0,B=0;for(C=0;C<4;++C)j+=Math.pow(h[4*P+C],2),B+=Math.pow(h[4*z+C],2);O[P]/=Math.sqrt(j),D[z]/=Math.sqrt(B),u.axes[0]=O,u.axes[1]=D,u.fragClipBounds[0]=k(x,E[0],S,-1e8),u.fragClipBounds[1]=k(x,E[1],S,1e8),e.vao.draw(l.TRIANGLES,e.vertexCount),e.lineWidth>0&&(l.lineWidth(e.lineWidth),e.vao.draw(l.LINES,e.lineVertexCount,e.vertexCount))}}var T=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function E(t,e,r,n,i,a){var o=r.gl;if(r.vao.bind(),i===r.opacity<1||a){t.bind();var s=t.uniforms;s.model=n.model||c,s.view=n.view||c,s.projection=n.projection||c,p[0]=2/o.drawingBufferWidth,p[1]=2/o.drawingBufferHeight,s.screenSize=p,s.highlightId=r.highlightId,s.highlightScale=r.highlightScale,s.fragClipBounds=T,s.clipBounds=r.axes.bounds,s.opacity=r.opacity,s.pickGroup=r.pickId/255,s.pixelRatio=r.pixelRatio,r.vao.draw(o.TRIANGLES,r.vertexCount),r.lineWidth>0&&(o.lineWidth(r.lineWidth),r.vao.draw(o.LINES,r.lineVertexCount,r.vertexCount))}A(e,r,n,i),r.vao.unbind()}d.draw=function(t){E(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!1,!1)},d.drawTransparent=function(t){E(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!0,!1)},d.drawPick=function(t){E(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,!1,!0)},d.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(e>=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},d.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},d.update=function(t){if(\"perspective\"in(t=t||{})&&(this.useOrtho=!t.perspective),\"orthographic\"in t&&(this.useOrtho=!!t.orthographic),\"lineWidth\"in t&&(this.lineWidth=t.lineWidth),\"project\"in t)if(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if(\"projectScale\"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if(\"projectOpacity\"in t)if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{r=+t.projectOpacity;this.projectOpacity=[r,r,r]}\"opacity\"in t&&(this.opacity=t.opacity),this.dirty=!0;var n=t.position;if(n){var i=t.font||\"normal\",o=t.alignment||[0,0],s=[1/0,1/0,1/0],c=[-1/0,-1/0,-1/0],u=t.glyph,f=t.color,h=t.size,d=t.angle,p=t.lineColor,m=0,v=0,g=0,y=n.length;t:for(var b=0;b<y;++b){for(var x=n[b],_=0;_<3;++_)if(isNaN(x[_])||!isFinite(x[_]))continue t;var w=(N=Array.isArray(u)?l(u[b],i):l(u||\"\\u25cf\",i))[0],M=N[1],k=N[2];v+=3*w.cells.length,g+=2*M.edges.length}var A=v+g,T=a.mallocFloat(3*A),E=a.mallocFloat(4*A),S=a.mallocFloat(2*A),L=a.mallocUint32(A),C=[0,o[1]],P=0,z=v,O=[0,0,0,1],D=[0,0,0,1],I=Array.isArray(f)&&Array.isArray(f[0]),R=Array.isArray(p)&&Array.isArray(p[0]);t:for(b=0;b<y;++b){var N;for(x=n[b],_=0;_<3;++_){if(isNaN(x[_])||!isFinite(x[_])){m+=1;continue t}c[_]=Math.max(c[_],x[_]),s[_]=Math.min(s[_],x[_])}var F;w=(N=Array.isArray(u)?l(u[b],i):l(u||\"\\u25cf\",i))[0],M=N[1],k=N[2];if(Array.isArray(f)){if(3===(F=I?f[b]:f).length){for(_=0;_<3;++_)O[_]=F[_];O[3]=1}else if(4===F.length)for(_=0;_<4;++_)O[_]=F[_]}else O[0]=O[1]=O[2]=0,O[3]=1;if(Array.isArray(p)){if(3===(F=R?p[b]:p).length){for(_=0;_<3;++_)D[_]=F[_];D[_]=1}else if(4===F.length)for(_=0;_<4;++_)D[_]=F[_]}else D[0]=D[1]=D[2]=0,D[3]=1;var j=.5;Array.isArray(h)?j=+h[b]:h?j=+h:this.useOrtho&&(j=12);var B=0;Array.isArray(d)?B=+d[b]:d&&(B=+d);var U=Math.cos(B),V=Math.sin(B);for(x=n[b],_=0;_<3;++_)c[_]=Math.max(c[_],x[_]),s[_]=Math.min(s[_],x[_]);o[0]<0?C[0]=o[0]*(1+k[1][0]):o[0]>0&&(C[0]=-o[0]*(1+k[0][0]));var q=w.cells,H=w.positions;for(_=0;_<q.length;++_)for(var G=q[_],Y=0;Y<3;++Y){for(var W=0;W<3;++W)T[3*P+W]=x[W];for(W=0;W<4;++W)E[4*P+W]=O[W];L[P]=m;var X=H[G[Y]];S[2*P]=j*(U*X[0]-V*X[1]+C[0]),S[2*P+1]=j*(V*X[0]+U*X[1]+C[1]),P+=1}for(q=M.edges,H=M.positions,_=0;_<q.length;++_)for(G=q[_],Y=0;Y<2;++Y){for(W=0;W<3;++W)T[3*z+W]=x[W];for(W=0;W<4;++W)E[4*z+W]=D[W];L[z]=m;X=H[G[Y]];S[2*z]=j*(U*X[0]-V*X[1]+C[0]),S[2*z+1]=j*(V*X[0]+U*X[1]+C[1]),z+=1}m+=1}this.vertexCount=v,this.lineVertexCount=g,this.pointBuffer.update(T),this.colorBuffer.update(E),this.glyphBuffer.update(S),this.idBuffer.update(new Uint32Array(L)),a.free(T),a.free(E),a.free(S),a.free(L),this.bounds=[s,c],this.points=n,this.pointCount=n.length}},d.dispose=function(){this.shader.dispose(),this.orthoShader.dispose(),this.pickPerspectiveShader.dispose(),this.pickOrthoShader.dispose(),this.vao.dispose(),this.pointBuffer.dispose(),this.colorBuffer.dispose(),this.glyphBuffer.dispose(),this.idBuffer.dispose()}},{\"./lib/glyphs\":214,\"./lib/shaders\":215,\"gl-buffer\":165,\"gl-mat4/multiply\":188,\"gl-vao\":237,\"typedarray-pool\":534}],217:[function(t,e,r){\"use strict\";var n=t(\"glslify\");r.boxVertex=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec2 vertex;\\n\\nuniform vec2 cornerA, cornerB;\\n\\nvoid main() {\\n gl_Position = vec4(mix(cornerA, cornerB, vertex), 0, 1);\\n}\\n\"]),r.boxFragment=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec4 color;\\n\\nvoid main() {\\n gl_FragColor = color;\\n}\\n\"])},{glslify:253}],218:[function(t,e,r){\"use strict\";var n=t(\"gl-shader\"),i=t(\"gl-buffer\"),a=t(\"./lib/shaders\");function o(t,e,r){this.plot=t,this.boxBuffer=e,this.boxShader=r,this.enabled=!0,this.selectBox=[1/0,1/0,-1/0,-1/0],this.borderColor=[0,0,0,1],this.innerFill=!1,this.innerColor=[0,0,0,.25],this.outerFill=!0,this.outerColor=[0,0,0,.5],this.borderWidth=10}e.exports=function(t,e){var r=t.gl,s=i(r,[0,0,0,1,1,0,1,1]),l=n(r,a.boxVertex,a.boxFragment),c=new o(t,s,l);return c.update(e),t.addOverlay(c),c};var s=o.prototype;s.draw=function(){if(this.enabled){var t=this.plot,e=this.selectBox,r=this.borderWidth,n=(this.innerFill,this.innerColor),i=(this.outerFill,this.outerColor),a=this.borderColor,o=t.box,s=t.screenBox,l=t.dataBox,c=t.viewBox,u=t.pixelRatio,f=(e[0]-l[0])*(c[2]-c[0])/(l[2]-l[0])+c[0],h=(e[1]-l[1])*(c[3]-c[1])/(l[3]-l[1])+c[1],d=(e[2]-l[0])*(c[2]-c[0])/(l[2]-l[0])+c[0],p=(e[3]-l[1])*(c[3]-c[1])/(l[3]-l[1])+c[1];if(f=Math.max(f,c[0]),h=Math.max(h,c[1]),d=Math.min(d,c[2]),p=Math.min(p,c[3]),!(d<f||p<h)){o.bind();var m=s[2]-s[0],v=s[3]-s[1];if(this.outerFill&&(o.drawBox(0,0,m,h,i),o.drawBox(0,h,f,p,i),o.drawBox(0,p,m,v,i),o.drawBox(d,h,m,p,i)),this.innerFill&&o.drawBox(f,h,d,p,n),r>0){var g=r*u;o.drawBox(f-g,h-g,d+g,h+g,a),o.drawBox(f-g,p-g,d+g,p+g,a),o.drawBox(f-g,h-g,f+g,p+g,a),o.drawBox(d-g,h-g,d+g,p+g,a)}}}},s.update=function(t){t=t||{},this.innerFill=!!t.innerFill,this.outerFill=!!t.outerFill,this.innerColor=(t.innerColor||[0,0,0,.5]).slice(),this.outerColor=(t.outerColor||[0,0,0,.5]).slice(),this.borderColor=(t.borderColor||[0,0,0,1]).slice(),this.borderWidth=t.borderWidth||0,this.selectBox=(t.selectBox||this.selectBox).slice()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{\"./lib/shaders\":217,\"gl-buffer\":165,\"gl-shader\":220}],219:[function(t,e,r){\"use strict\";e.exports=function(t,e){var r=n(t,e),a=i.mallocUint8(e[0]*e[1]*4);return new l(t,r,a)};var n=t(\"gl-fbo\"),i=t(\"typedarray-pool\"),a=t(\"ndarray\"),o=t(\"bit-twiddle\").nextPow2,s=t(\"cwise/lib/wrapper\")({args:[\"array\",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},\"scalar\",\"scalar\",\"index\"],pre:{body:\"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}\",args:[],thisVars:[\"this_closestD2\",\"this_closestX\",\"this_closestY\"],localVars:[]},body:{body:\"{if(_inline_46_arg0_<255||_inline_46_arg1_<255||_inline_46_arg2_<255||_inline_46_arg3_<255){var _inline_46_l=_inline_46_arg4_-_inline_46_arg6_[0],_inline_46_a=_inline_46_arg5_-_inline_46_arg6_[1],_inline_46_f=_inline_46_l*_inline_46_l+_inline_46_a*_inline_46_a;_inline_46_f<this_closestD2&&(this_closestD2=_inline_46_f,this_closestX=_inline_46_arg6_[0],this_closestY=_inline_46_arg6_[1])}}\",args:[{name:\"_inline_46_arg0_\",lvalue:!1,rvalue:!0,count:1},{name:\"_inline_46_arg1_\",lvalue:!1,rvalue:!0,count:1},{name:\"_inline_46_arg2_\",lvalue:!1,rvalue:!0,count:1},{name:\"_inline_46_arg3_\",lvalue:!1,rvalue:!0,count:1},{name:\"_inline_46_arg4_\",lvalue:!1,rvalue:!0,count:1},{name:\"_inline_46_arg5_\",lvalue:!1,rvalue:!0,count:1},{name:\"_inline_46_arg6_\",lvalue:!1,rvalue:!0,count:4}],thisVars:[\"this_closestD2\",\"this_closestX\",\"this_closestY\"],localVars:[\"_inline_46_a\",\"_inline_46_f\",\"_inline_46_l\"]},post:{body:\"{return[this_closestX,this_closestY,this_closestD2]}\",args:[],thisVars:[\"this_closestD2\",\"this_closestX\",\"this_closestY\"],localVars:[]},debug:!1,funcName:\"cwise\",blockSize:64});function l(t,e,r){this.gl=t,this.fbo=e,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}var c=l.prototype;Object.defineProperty(c,\"shape\",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(t){if(this.gl){this.fbo.shape=t;var e=this.fbo.shape[0],r=this.fbo.shape[1];if(r*e*4>this.buffer.length){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*e*4)),a=0;a<r*e*4;++a)n[a]=255}return t}}}),c.begin=function(){var t=this.gl;this.shape;t&&(this.fbo.bind(),t.clearColor(1,1,1,1),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT))},c.end=function(){var t=this.gl;t&&(t.bindFramebuffer(t.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},c.query=function(t,e,r){if(!this.gl)return null;var n=this.fbo.shape.slice();t|=0,e|=0,\"number\"!=typeof r&&(r=1);var i=0|Math.min(Math.max(t-r,0),n[0]),o=0|Math.min(Math.max(t+r,0),n[0]),l=0|Math.min(Math.max(e-r,0),n[1]),c=0|Math.min(Math.max(e+r,0),n[1]);if(o<=i||c<=l)return null;var u=[o-i,c-l],f=a(this.buffer,[u[0],u[1],4],[4,4*n[0],1],4*(i+n[0]*l)),h=s(f.hi(u[0],u[1],1),r,r),d=h[0],p=h[1];return d<0||Math.pow(this.radius,2)<h[2]?null:new function(t,e,r,n,i){this.coord=[t,e],this.id=r,this.value=n,this.distance=i}(d+i|0,p+l|0,f.get(d,p,0),[f.get(d,p,1),f.get(d,p,2),f.get(d,p,3)],Math.sqrt(h[2]))},c.dispose=function(){this.gl&&(this.fbo.dispose(),i.free(this.buffer),this.gl=null,this._readTimeout&&clearTimeout(this._readTimeout))}},{\"bit-twiddle\":71,\"cwise/lib/wrapper\":119,\"gl-fbo\":171,ndarray:439,\"typedarray-pool\":534}],220:[function(t,e,r){\"use strict\";var n=t(\"./lib/create-uniforms\"),i=t(\"./lib/create-attributes\"),a=t(\"./lib/reflect\"),o=t(\"./lib/shader-cache\"),s=t(\"./lib/runtime-reflect\"),l=t(\"./lib/GLError\");function c(t){this.gl=t,this.gl.lastAttribCount=0,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}var u=c.prototype;function f(t,e){return t.name<e.name?-1:1}u.bind=function(){var t;this.program||this._relink();var e=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES),r=this.gl.lastAttribCount;if(e>r)for(t=r;t<e;t++)this.gl.enableVertexAttribArray(t);else if(r>e)for(t=e;t<r;t++)this.gl.disableVertexAttribArray(t);this.gl.lastAttribCount=e,this.gl.useProgram(this.program)},u.dispose=function(){for(var t=this.gl.lastAttribCount,e=0;e<t;e++)this.gl.disableVertexAttribArray(e);this.gl.lastAttribCount=0,this._fref&&this._fref.dispose(),this._vref&&this._vref.dispose(),this.attributes=this.types=this.vertShader=this.fragShader=this.program=this._relink=this._fref=this._vref=null},u.update=function(t,e,r,c){if(!e||1===arguments.length){var u=t;t=u.vertex,e=u.fragment,r=u.uniforms,c=u.attributes}var h=this,d=h.gl,p=h._vref;h._vref=o.shader(d,d.VERTEX_SHADER,t),p&&p.dispose(),h.vertShader=h._vref.shader;var m=this._fref;if(h._fref=o.shader(d,d.FRAGMENT_SHADER,e),m&&m.dispose(),h.fragShader=h._fref.shader,!r||!c){var v=d.createProgram();if(d.attachShader(v,h.fragShader),d.attachShader(v,h.vertShader),d.linkProgram(v),!d.getProgramParameter(v,d.LINK_STATUS)){var g=d.getProgramInfoLog(v);throw new l(g,\"Error linking program:\"+g)}r=r||s.uniforms(d,v),c=c||s.attributes(d,v),d.deleteProgram(v)}(c=c.slice()).sort(f);var y,b=[],x=[],_=[];for(y=0;y<c.length;++y){var w=c[y];if(w.type.indexOf(\"mat\")>=0){for(var M=0|w.type.charAt(w.type.length-1),k=new Array(M),A=0;A<M;++A)k[A]=_.length,x.push(w.name+\"[\"+A+\"]\"),\"number\"==typeof w.location?_.push(w.location+A):Array.isArray(w.location)&&w.location.length===M&&\"number\"==typeof w.location[A]?_.push(0|w.location[A]):_.push(-1);b.push({name:w.name,type:w.type,locations:k})}else b.push({name:w.name,type:w.type,locations:[_.length]}),x.push(w.name),\"number\"==typeof w.location?_.push(0|w.location):_.push(-1)}var T=0;for(y=0;y<_.length;++y)if(_[y]<0){for(;_.indexOf(T)>=0;)T+=1;_[y]=T}var E=new Array(r.length);function S(){h.program=o.program(d,h._vref,h._fref,x,_);for(var t=0;t<r.length;++t)E[t]=d.getUniformLocation(h.program,r[t].name)}S(),h._relink=S,h.types={uniforms:a(r),attributes:a(c)},h.attributes=i(d,h,b,_),Object.defineProperty(h,\"uniforms\",n(d,h,r,E))},e.exports=function(t,e,r,n,i){var a=new c(t);return a.update(e,r,n,i),a}},{\"./lib/GLError\":221,\"./lib/create-attributes\":222,\"./lib/create-uniforms\":223,\"./lib/reflect\":224,\"./lib/runtime-reflect\":225,\"./lib/shader-cache\":226}],221:[function(t,e,r){function n(t,e,r){this.shortMessage=e||\"\",this.longMessage=r||\"\",this.rawError=t||\"\",this.message=\"gl-shader: \"+(e||t||\"\")+(r?\"\\n\"+r:\"\"),this.stack=(new Error).stack}n.prototype=new Error,n.prototype.name=\"GLError\",n.prototype.constructor=n,e.exports=n},{}],222:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,i){for(var a={},l=0,c=r.length;l<c;++l){var u=r[l],f=u.name,h=u.type,d=u.locations;switch(h){case\"bool\":case\"int\":case\"float\":o(t,e,d[0],i,1,a,f);break;default:if(h.indexOf(\"vec\")>=0){var p=h.charCodeAt(h.length-1)-48;if(p<2||p>4)throw new n(\"\",\"Invalid data type for attribute \"+f+\": \"+h);o(t,e,d[0],i,p,a,f)}else{if(!(h.indexOf(\"mat\")>=0))throw new n(\"\",\"Unknown data type for attribute \"+f+\": \"+h);var p=h.charCodeAt(h.length-1)-48;if(p<2||p>4)throw new n(\"\",\"Invalid data type for attribute \"+f+\": \"+h);s(t,e,d,i,p,a,f)}}}return a};var n=t(\"./GLError\");function i(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;function o(t,e,r,n,a,o,s){for(var l=[\"gl\",\"v\"],c=[],u=0;u<a;++u)l.push(\"x\"+u),c.push(\"x\"+u);l.push(\"if(x0.length===void 0){return gl.vertexAttrib\"+a+\"f(v,\"+c.join()+\")}else{return gl.vertexAttrib\"+a+\"fv(v,x0)}\");var f=Function.apply(null,l),h=new i(t,e,r,n,a,f);Object.defineProperty(o,s,{set:function(e){return t.disableVertexAttribArray(n[r]),f(t,n[r],e),e},get:function(){return h},enumerable:!0})}function s(t,e,r,n,i,a,s){for(var l=new Array(i),c=new Array(i),u=0;u<i;++u)o(t,e,r[u],n,i,l,u),c[u]=l[u];Object.defineProperty(l,\"location\",{set:function(t){if(Array.isArray(t))for(var e=0;e<i;++e)c[e].location=t[e];else for(e=0;e<i;++e)c[e].location=t+e;return t},get:function(){for(var t=new Array(i),e=0;e<i;++e)t[e]=n[r[e]];return t},enumerable:!0}),l.pointer=function(e,a,o,s){e=e||t.FLOAT,a=!!a,o=o||i*i,s=s||0;for(var l=0;l<i;++l){var c=n[r[l]];t.vertexAttribPointer(c,i,e,a,o,s+l*i),t.enableVertexAttribArray(c)}};var f=new Array(i),h=t[\"vertexAttrib\"+i+\"fv\"];Object.defineProperty(a,s,{set:function(e){for(var a=0;a<i;++a){var o=n[r[a]];if(t.disableVertexAttribArray(o),Array.isArray(e[0]))h.call(t,o,e[a]);else{for(var s=0;s<i;++s)f[s]=e[i*a+s];h.call(t,o,f)}}return e},get:function(){return l},enumerable:!0})}a.pointer=function(t,e,r,n){var i=this._gl,a=this._locations[this._index];i.vertexAttribPointer(a,this._dimension,t||i.FLOAT,!!e,r||0,n||0),i.enableVertexAttribArray(a)},a.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(a,\"location\",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}})},{\"./GLError\":221}],223:[function(t,e,r){\"use strict\";var n=t(\"./reflect\"),i=t(\"./GLError\");function a(t){return new Function(\"y\",\"return function(){return y}\")(t)}function o(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=e;return r}e.exports=function(t,e,r,s){function l(t,e,r){switch(r){case\"bool\":case\"int\":case\"sampler2D\":case\"samplerCube\":return\"gl.uniform1i(locations[\"+e+\"],obj\"+t+\")\";case\"float\":return\"gl.uniform1f(locations[\"+e+\"],obj\"+t+\")\";default:var n=r.indexOf(\"vec\");if(!(0<=n&&n<=1&&r.length===4+n)){if(0===r.indexOf(\"mat\")&&4===r.length){var a=r.charCodeAt(r.length-1)-48;if(a<2||a>4)throw new i(\"\",\"Invalid uniform dimension type for matrix \"+name+\": \"+r);return\"gl.uniformMatrix\"+a+\"fv(locations[\"+e+\"],false,obj\"+t+\")\"}throw new i(\"\",\"Unknown uniform data type for \"+name+\": \"+r)}var a=r.charCodeAt(r.length-1)-48;if(a<2||a>4)throw new i(\"\",\"Invalid data type\");switch(r.charAt(0)){case\"b\":case\"i\":return\"gl.uniform\"+a+\"iv(locations[\"+e+\"],obj\"+t+\")\";case\"v\":return\"gl.uniform\"+a+\"fv(locations[\"+e+\"],obj\"+t+\")\";default:throw new i(\"\",\"Unrecognized data type for vector \"+name+\": \"+r)}}}function c(e){for(var n=[\"return function updateProperty(obj){\"],i=function t(e,r){if(\"object\"!=typeof r)return[[e,r]];var n=[];for(var i in r){var a=r[i],o=e;parseInt(i)+\"\"===i?o+=\"[\"+i+\"]\":o+=\".\"+i,\"object\"==typeof a?n.push.apply(n,t(o,a)):n.push([o,a])}return n}(\"\",e),a=0;a<i.length;++a){var o=i[a],c=o[0],u=o[1];s[u]&&n.push(l(c,u,r[u].type))}n.push(\"return obj}\");var f=new Function(\"gl\",\"locations\",n.join(\"\\n\"));return f(t,s)}function u(n,l,u){if(\"object\"==typeof u){var h=f(u);Object.defineProperty(n,l,{get:a(h),set:c(u),enumerable:!0,configurable:!1})}else s[u]?Object.defineProperty(n,l,{get:(d=u,new Function(\"gl\",\"wrapper\",\"locations\",\"return function(){return gl.getUniform(wrapper.program,locations[\"+d+\"])}\")(t,e,s)),set:c(u),enumerable:!0,configurable:!1}):n[l]=function(t){switch(t){case\"bool\":return!1;case\"int\":case\"sampler2D\":case\"samplerCube\":case\"float\":return 0;default:var e=t.indexOf(\"vec\");if(0<=e&&e<=1&&t.length===4+e){var r=t.charCodeAt(t.length-1)-48;if(r<2||r>4)throw new i(\"\",\"Invalid data type\");return\"b\"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf(\"mat\")&&4===t.length){var r=t.charCodeAt(t.length-1)-48;if(r<2||r>4)throw new i(\"\",\"Invalid uniform dimension type for matrix \"+name+\": \"+t);return o(r*r,0)}throw new i(\"\",\"Unknown uniform data type for \"+name+\": \"+t)}}(r[u].type);var d}function f(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r<t.length;++r)u(e,r,t[r])}else for(var n in e={},t)u(e,n,t[n]);return e}var h=n(r,!0);return{get:a(f(h)),set:c(h),enumerable:!0,configurable:!0}}},{\"./GLError\":221,\"./reflect\":224}],224:[function(t,e,r){\"use strict\";e.exports=function(t,e){for(var r={},n=0;n<t.length;++n)for(var i=t[n].name,a=i.split(\".\"),o=r,s=0;s<a.length;++s){var l=a[s].split(\"[\");if(l.length>1){l[0]in o||(o[l[0]]=[]),o=o[l[0]];for(var c=1;c<l.length;++c){var u=parseInt(l[c]);c<l.length-1||s<a.length-1?(u in o||(c<l.length-1?o[u]=[]:o[u]={}),o=o[u]):o[u]=e?n:t[n].type}}else s<a.length-1?(l[0]in o||(o[l[0]]={}),o=o[l[0]]):o[l[0]]=e?n:t[n].type}return r}},{}],225:[function(t,e,r){\"use strict\";r.uniforms=function(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),n=[],i=0;i<r;++i){var o=t.getActiveUniform(e,i);if(o){var s=a(t,o.type);if(o.size>1)for(var l=0;l<o.size;++l)n.push({name:o.name.replace(\"[0]\",\"[\"+l+\"]\"),type:s});else n.push({name:o.name,type:s})}}return n},r.attributes=function(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),n=[],i=0;i<r;++i){var o=t.getActiveAttrib(e,i);o&&n.push({name:o.name,type:a(t,o.type)})}return n};var n={FLOAT:\"float\",FLOAT_VEC2:\"vec2\",FLOAT_VEC3:\"vec3\",FLOAT_VEC4:\"vec4\",INT:\"int\",INT_VEC2:\"ivec2\",INT_VEC3:\"ivec3\",INT_VEC4:\"ivec4\",BOOL:\"bool\",BOOL_VEC2:\"bvec2\",BOOL_VEC3:\"bvec3\",BOOL_VEC4:\"bvec4\",FLOAT_MAT2:\"mat2\",FLOAT_MAT3:\"mat3\",FLOAT_MAT4:\"mat4\",SAMPLER_2D:\"sampler2D\",SAMPLER_CUBE:\"samplerCube\"},i=null;function a(t,e){if(!i){var r=Object.keys(n);i={};for(var a=0;a<r.length;++a){var o=r[a];i[t[o]]=n[o]}}return i[e]}},{}],226:[function(t,e,r){\"use strict\";r.shader=function(t,e,r){return u(t).getShaderReference(e,r)},r.program=function(t,e,r,n,i){return u(t).getProgram(e,r,n,i)};var n=t(\"./GLError\"),i=t(\"gl-format-compiler-error\"),a=new(\"undefined\"==typeof WeakMap?t(\"weakmap-shim\"):WeakMap),o=0;function s(t,e,r,n,i,a,o){this.id=t,this.src=e,this.type=r,this.shader=n,this.count=a,this.programs=[],this.cache=o}function l(t){this.gl=t,this.shaders=[{},{}],this.programs={}}s.prototype.dispose=function(){if(0==--this.count){for(var t=this.cache,e=t.gl,r=this.programs,n=0,i=r.length;n<i;++n){var a=t.programs[r[n]];a&&(delete t.programs[n],e.deleteProgram(a))}e.deleteShader(this.shader),delete t.shaders[this.type===e.FRAGMENT_SHADER|0][this.src]}};var c=l.prototype;function u(t){var e=a.get(t);return e||(e=new l(t),a.set(t,e)),e}c.getShaderReference=function(t,e){var r=this.gl,a=this.shaders[t===r.FRAGMENT_SHADER|0],l=a[e];if(l&&r.isShader(l.shader))l.count+=1;else{var c=function(t,e,r){var a=t.createShader(e);if(t.shaderSource(a,r),t.compileShader(a),!t.getShaderParameter(a,t.COMPILE_STATUS)){var o=t.getShaderInfoLog(a);try{var s=i(o,r,e)}catch(t){throw console.warn(\"Failed to format compiler error: \"+t),new n(o,\"Error compiling shader:\\n\"+o)}throw new n(o,s.short,s.long)}return a}(r,t,e);l=a[e]=new s(o++,e,t,c,[],1,this)}return l},c.getProgram=function(t,e,r,i){var a=[t.id,e.id,r.join(\":\"),i.join(\":\")].join(\"@\"),o=this.programs[a];return o&&this.gl.isProgram(o)||(this.programs[a]=o=function(t,e,r,i,a){var o=t.createProgram();t.attachShader(o,e),t.attachShader(o,r);for(var s=0;s<i.length;++s)t.bindAttribLocation(o,a[s],i[s]);if(t.linkProgram(o),!t.getProgramParameter(o,t.LINK_STATUS)){var l=t.getProgramInfoLog(o);throw new n(l,\"Error linking program: \"+l)}return o}(this.gl,t.shader,e.shader,r,i),t.programs.push(a),e.programs.push(a)),o}},{\"./GLError\":221,\"gl-format-compiler-error\":172,\"weakmap-shim\":556}],227:[function(t,e,r){\"use strict\";function n(t){this.plot=t,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}e.exports=function(t,e){var r=new n(t);return r.update(e),t.addOverlay(r),r};var i=n.prototype;i.update=function(t){t=t||{},this.enable=(t.enable||[!0,!0,!1,!1]).slice(),this.width=(t.width||[1,1,1,1]).slice(),this.color=(t.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map(function(t){return t.slice()}),this.center=(t.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},i.draw=function(){var t=this.enable,e=this.width,r=this.color,n=this.center,i=this.plot,a=i.line,o=i.dataBox,s=i.viewBox;if(a.bind(),o[0]<=n[0]&&n[0]<=o[2]&&o[1]<=n[1]&&n[1]<=o[3]){var l=s[0]+(n[0]-o[0])/(o[2]-o[0])*(s[2]-s[0]),c=s[1]+(n[1]-o[1])/(o[3]-o[1])*(s[3]-s[1]);t[0]&&a.drawLine(l,c,s[0],c,e[0],r[0]),t[1]&&a.drawLine(l,c,l,s[1],e[1],r[1]),t[2]&&a.drawLine(l,c,s[2],c,e[2],r[2]),t[3]&&a.drawLine(l,c,l,s[3],e[3],r[3])}},i.dispose=function(){this.plot.removeOverlay(this)}},{}],228:[function(t,e,r){\"use strict\";var n=t(\"glslify\"),i=t(\"gl-shader\"),a=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position, color;\\nattribute float weight;\\n\\nuniform mat4 model, view, projection;\\nuniform vec3 coordinates[3];\\nuniform vec4 colors[3];\\nuniform vec2 screenShape;\\nuniform float lineWidth;\\n\\nvarying vec4 fragColor;\\n\\nvoid main() {\\n vec3 vertexPosition = mix(coordinates[0],\\n mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\\n\\n vec4 clipPos = projection * view * model * vec4(vertexPosition, 1.0);\\n vec2 clipOffset = (projection * view * model * vec4(color, 0.0)).xy;\\n vec2 delta = weight * clipOffset * screenShape;\\n vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\\n\\n gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\\n fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\\n}\\n\"]),o=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nvarying vec4 fragColor;\\n\\nvoid main() {\\n gl_FragColor = fragColor;\\n}\"]);e.exports=function(t){return i(t,a,o,null,[{name:\"position\",type:\"vec3\"},{name:\"color\",type:\"vec3\"},{name:\"weight\",type:\"float\"}])}},{\"gl-shader\":220,glslify:253}],229:[function(t,e,r){\"use strict\";var n=t(\"gl-buffer\"),i=t(\"gl-vao\"),a=t(\"./shaders/index\");e.exports=function(t,e){var r=[];function o(t,e,n,i,a,o){var s=[t,e,n,0,0,0,1];s[i+3]=1,s[i]=a,r.push.apply(r,s),s[6]=-1,r.push.apply(r,s),s[i]=o,r.push.apply(r,s),r.push.apply(r,s),s[6]=1,r.push.apply(r,s),s[i]=a,r.push.apply(r,s)}o(0,0,0,0,0,1),o(0,0,0,1,0,1),o(0,0,0,2,0,1),o(1,0,0,1,-1,1),o(1,0,0,2,-1,1),o(0,1,0,0,-1,1),o(0,1,0,2,-1,1),o(0,0,1,0,-1,1),o(0,0,1,1,-1,1);var l=n(t,r),c=i(t,[{type:t.FLOAT,buffer:l,size:3,offset:0,stride:28},{type:t.FLOAT,buffer:l,size:3,offset:12,stride:28},{type:t.FLOAT,buffer:l,size:1,offset:24,stride:28}]),u=a(t);u.attributes.position.location=0,u.attributes.color.location=1,u.attributes.weight.location=2;var f=new s(t,l,c,u);return f.update(e),f};var o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}var l=s.prototype,c=[0,0,0],u=[0,0,0],f=[0,0];l.isTransparent=function(){return!1},l.drawTransparent=function(t){},l.draw=function(t){var e=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var i,a=t.model||o,s=t.view||o,l=t.projection||o;this.axes&&(i=this.axes.lastCubeProps.axis);for(var h=c,d=u,p=0;p<3;++p)i&&i[p]<0?(h[p]=this.bounds[0][p],d[p]=this.bounds[1][p]):(h[p]=this.bounds[1][p],d[p]=this.bounds[0][p]);f[0]=e.drawingBufferWidth,f[1]=e.drawingBufferHeight,n.uniforms.model=a,n.uniforms.view=s,n.uniforms.projection=l,n.uniforms.coordinates=[this.position,h,d],n.uniforms.colors=this.colors,n.uniforms.screenShape=f;for(p=0;p<3;++p)n.uniforms.lineWidth=this.lineWidth[p]*this.pixelRatio,this.enabled[p]&&(r.draw(e.TRIANGLES,6,6*p),this.drawSides[p]&&r.draw(e.TRIANGLES,12,18+12*p));r.unbind()},l.update=function(t){t&&(\"bounds\"in t&&(this.bounds=t.bounds),\"position\"in t&&(this.position=t.position),\"lineWidth\"in t&&(this.lineWidth=t.lineWidth),\"colors\"in t&&(this.colors=t.colors),\"enabled\"in t&&(this.enabled=t.enabled),\"drawSides\"in t&&(this.drawSides=t.drawSides))},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{\"./shaders/index\":228,\"gl-buffer\":165,\"gl-vao\":237}],230:[function(t,e,r){var n=t(\"gl-shader\"),i=t(\"glslify\"),a=i([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec4 uv;\\nattribute vec3 f;\\nattribute vec3 normal;\\n\\nuniform mat4 model, view, projection, inverseModel;\\nuniform vec3 lightPosition, eyePosition;\\nuniform sampler2D colormap;\\n\\nvarying float value, kill;\\nvarying vec3 worldCoordinate;\\nvarying vec2 planeCoordinate;\\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\\nvarying vec4 vColor;\\n\\nvoid main() {\\n worldCoordinate = vec3(uv.zw, f.x);\\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\\n vec4 clipPosition = projection * view * worldPosition;\\n gl_Position = clipPosition;\\n kill = f.y;\\n value = f.z;\\n planeCoordinate = uv.xy;\\n\\n vColor = texture2D(colormap, vec2(value, value));\\n\\n //Lighting geometry parameters\\n vec4 cameraCoordinate = view * worldPosition;\\n cameraCoordinate.xyz /= cameraCoordinate.w;\\n lightDirection = lightPosition - cameraCoordinate.xyz;\\n eyeDirection = eyePosition - cameraCoordinate.xyz;\\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\\n}\\n\"]),o=i([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nfloat beckmannDistribution(float x, float roughness) {\\n float NdotH = max(x, 0.0001);\\n float cos2Alpha = NdotH * NdotH;\\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\\n float roughness2 = roughness * roughness;\\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\\n return exp(tan2Alpha / roughness2) / denom;\\n}\\n\\nfloat beckmannSpecular(\\n vec3 lightDirection,\\n vec3 viewDirection,\\n vec3 surfaceNormal,\\n float roughness) {\\n return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\\n}\\n\\nuniform vec3 lowerBound, upperBound;\\nuniform float contourTint;\\nuniform vec4 contourColor;\\nuniform sampler2D colormap;\\nuniform vec3 clipBounds[2];\\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\\nuniform float vertexColor;\\n\\nvarying float value, kill;\\nvarying vec3 worldCoordinate;\\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\\nvarying vec4 vColor;\\n\\nvoid main() {\\n if (kill > 0.0 ||\\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\\n discard;\\n }\\n\\n vec3 N = normalize(surfaceNormal);\\n vec3 V = normalize(eyeDirection);\\n vec3 L = normalize(lightDirection);\\n\\n if(gl_FrontFacing) {\\n N = -N;\\n }\\n\\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\\n\\n //decide how to interpolate color \\u2014 in vertex or in fragment\\n vec4 surfaceColor = step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + step(.5, vertexColor) * vColor;\\n\\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\\n\\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\\n}\\n\"]),s=i([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec4 uv;\\nattribute float f;\\n\\nuniform mat3 permutation;\\nuniform mat4 model, view, projection;\\nuniform float height, zOffset;\\nuniform sampler2D colormap;\\n\\nvarying float value, kill;\\nvarying vec3 worldCoordinate;\\nvarying vec2 planeCoordinate;\\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\\nvarying vec4 vColor;\\n\\nvoid main() {\\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\\n vec4 worldPosition = model * vec4(dataCoordinate, 1.0);\\n\\n vec4 clipPosition = projection * view * worldPosition;\\n clipPosition.z = clipPosition.z + zOffset;\\n\\n gl_Position = clipPosition;\\n value = f;\\n kill = -1.0;\\n worldCoordinate = dataCoordinate;\\n planeCoordinate = uv.zw;\\n\\n vColor = texture2D(colormap, vec2(value, value));\\n\\n //Don't do lighting for contours\\n surfaceNormal = vec3(1,0,0);\\n eyeDirection = vec3(0,1,0);\\n lightDirection = vec3(0,0,1);\\n}\\n\"]),l=i([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec2 shape;\\nuniform vec3 clipBounds[2];\\nuniform float pickId;\\n\\nvarying float value, kill;\\nvarying vec3 worldCoordinate;\\nvarying vec2 planeCoordinate;\\nvarying vec3 surfaceNormal;\\n\\nvec2 splitFloat(float v) {\\n float vh = 255.0 * v;\\n float upper = floor(vh);\\n float lower = fract(vh);\\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\\n}\\n\\nvoid main() {\\n if(kill > 0.0 ||\\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\\n discard;\\n }\\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\\n}\\n\"]);r.createShader=function(t){var e=n(t,a,o,null,[{name:\"uv\",type:\"vec4\"},{name:\"f\",type:\"vec3\"},{name:\"normal\",type:\"vec3\"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createPickShader=function(t){var e=n(t,a,l,null,[{name:\"uv\",type:\"vec4\"},{name:\"f\",type:\"vec3\"},{name:\"normal\",type:\"vec3\"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createContourShader=function(t){var e=n(t,s,o,null,[{name:\"uv\",type:\"vec4\"},{name:\"f\",type:\"float\"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,s,l,null,[{name:\"uv\",type:\"vec4\"},{name:\"f\",type:\"float\"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{\"gl-shader\":220,glslify:231}],231:[function(t,e,r){arguments[4][169][0].apply(r,arguments)},{dup:169}],232:[function(t,e,r){\"use strict\";e.exports=function(t){var e=t.gl,r=y(e),n=x(e),s=b(e),l=_(e),c=i(e),u=a(e,[{buffer:c,size:4,stride:w,offset:0},{buffer:c,size:3,stride:w,offset:16},{buffer:c,size:3,stride:w,offset:28}]),f=i(e),h=a(e,[{buffer:f,size:4,stride:20,offset:0},{buffer:f,size:1,stride:20,offset:16}]),d=i(e),p=a(e,[{buffer:d,size:2,type:e.FLOAT}]),m=o(e,1,T,e.RGBA,e.UNSIGNED_BYTE);m.minFilter=e.LINEAR,m.magFilter=e.LINEAR;var v=new E(e,[0,0],[[0,0,0],[0,0,0]],r,n,c,u,m,s,l,f,h,d,p),g={levels:[[],[],[]]};for(var M in t)g[M]=t[M];return g.colormap=g.colormap||\"jet\",v.update(g),v};var n=t(\"bit-twiddle\"),i=t(\"gl-buffer\"),a=t(\"gl-vao\"),o=t(\"gl-texture2d\"),s=t(\"typedarray-pool\"),l=t(\"colormap\"),c=t(\"ndarray-ops\"),u=t(\"ndarray-pack\"),f=t(\"ndarray\"),h=t(\"surface-nets\"),d=t(\"gl-mat4/multiply\"),p=t(\"gl-mat4/invert\"),m=t(\"binary-search-bounds\"),v=t(\"ndarray-gradient\"),g=t(\"./lib/shaders\"),y=g.createShader,b=g.createContourShader,x=g.createPickShader,_=g.createPickContourShader,w=40,M=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],k=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],A=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];!function(){for(var t=0;t<3;++t){var e=A[t],r=(t+2)%3;e[(t+1)%3+0]=1,e[r+3]=1,e[t+6]=1}}();var T=256;function E(t,e,r,n,i,a,o,l,c,u,h,d,p,m){this.gl=t,this.shape=e,this.bounds=r,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=c,this._contourPickShader=u,this._contourBuffer=h,this._contourVAO=d,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new function(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=p,this._dynamicVAO=m,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var S=E.prototype;S.isTransparent=function(){return this.opacity<1},S.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},S.pickSlots=1,S.setPickBase=function(t){this.pickId=t};var L=[0,0,0],C={showSurface:!1,showContour:!1,projections:[M.slice(),M.slice(),M.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function P(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||L,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=C.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(a[r]>0)][r],d(l,t.model,l);var c=C.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=t.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return C.showSurface=o,C.showContour=s,C}var z={model:M,view:M,projection:M,inverseModel:M.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},O=M.slice(),D=[1,0,0,0,1,0,0,0,1];function I(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=z;n.model=t.model||M,n.view=t.view||M,n.projection=t.projection||M,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.contourColor=this.contourColor[0],n.inverseModel=p(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=D,n.vertexColor=this.vertexColor;var s=O;for(d(s,n.view,n.model),d(s,n.projection,s),p(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var c=s[12+i];for(o=0;o<3;++o)c+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=c/l}var u=P(n,this);if(u.showSurface&&e===this.opacity<1){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=u.projections[i],this._shader.uniforms.clipBounds=u.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(u.showContour&&!e){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var h=this._contourVAO;for(h.bind(),i=0;i<3;++i)for(f.uniforms.permutation=A[i],r.lineWidth(this.contourWidth[i]),o=0;o<this.contourLevels[i].length;++o)this._contourCounts[i][o]&&(o===this.highlightLevel[i]?(f.uniforms.contourColor=this.highlightColor[i],f.uniforms.contourTint=this.highlightTint[i]):0!==o&&o-1!==this.highlightLevel[i]||(f.uniforms.contourColor=this.contourColor[i],f.uniforms.contourTint=this.contourTint[i]),f.uniforms.height=this.contourLevels[i][o],h.draw(r.LINES,this._contourCounts[i][o],this._contourOffsets[i][o]));for(i=0;i<3;++i)for(f.uniforms.model=u.projections[i],f.uniforms.clipBounds=u.clipBounds[i],o=0;o<3;++o)if(this.contourProject[i][o]){f.uniforms.permutation=A[o],r.lineWidth(this.contourWidth[o]);for(var m=0;m<this.contourLevels[o].length;++m)m===this.highlightLevel[o]?(f.uniforms.contourColor=this.highlightColor[o],f.uniforms.contourTint=this.highlightTint[o]):0!==m&&m-1!==this.highlightLevel[o]||(f.uniforms.contourColor=this.contourColor[o],f.uniforms.contourTint=this.contourTint[o]),f.uniforms.height=this.contourLevels[o][m],h.draw(r.LINES,this._contourCounts[o][m],this._contourOffsets[o][m])}for(h.unbind(),(h=this._dynamicVAO).bind(),i=0;i<3;++i)if(0!==this._dynamicCounts[i])for(f.uniforms.model=n.model,f.uniforms.clipBounds=n.clipBounds,f.uniforms.permutation=A[i],r.lineWidth(this.dynamicWidth[i]),f.uniforms.contourColor=this.dynamicColor[i],f.uniforms.contourTint=this.dynamicTint[i],f.uniforms.height=this.dynamicLevel[i],h.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]),o=0;o<3;++o)this.contourProject[o][i]&&(f.uniforms.model=u.projections[o],f.uniforms.clipBounds=u.clipBounds[o],h.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]));h.unbind()}}S.draw=function(t){return I.call(this,t,!1)},S.drawTransparent=function(t){return I.call(this,t,!0)};var R={model:M,view:M,projection:M,inverseModel:M,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};function N(t,e){var r=e.shape.slice(),n=t.shape.slice();c.assign(t.lo(1,1).hi(r[0],r[1]),e),c.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),c.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),c.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),c.assign(t.lo(n[0]-1,1).hi(1,r[1]),e.lo(r[0]-1)),t.set(0,0,e.get(0,0)),t.set(0,n[1]-1,e.get(0,r[1]-1)),t.set(n[0]-1,0,e.get(r[0]-1,0)),t.set(n[0]-1,n[1]-1,e.get(r[0]-1,r[1]-1))}function F(t,e){return Array.isArray(t)?[e(t[0]),e(t[1]),e(t[2])]:[e(t),e(t),e(t)]}function j(t){return Array.isArray(t)?3===t.length?[t[0],t[1],t[2],1]:[t[0],t[1],t[2],t[3]]:[0,0,0,1]}function B(t){if(Array.isArray(t)){if(Array.isArray(t))return[j(t[0]),j(t[1]),j(t[2])];var e=j(t);return[e.slice(),e.slice(),e.slice()]}}S.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=R;r.model=t.model||M,r.view=t.view||M,r.projection=t.projection||M,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.permutation=D;for(var n=0;n<2;++n)for(var i=r.clipBounds[n],a=0;a<3;++a)i[a]=Math.min(Math.max(this.clipBounds[n][a],-1e8),1e8);var o=P(r,this);if(o.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(e.TRIANGLES,this._vertexCount),n=0;n<3;++n)this.surfaceProject[n]&&(this._pickShader.uniforms.model=o.projections[n],this._pickShader.uniforms.clipBounds=o.clipBounds[n],this._vao.draw(e.TRIANGLES,this._vertexCount));this._vao.unbind()}if(o.showContour){var s=this._contourPickShader;s.bind(),s.uniforms=r;var l=this._contourVAO;for(l.bind(),a=0;a<3;++a)for(e.lineWidth(this.contourWidth[a]),s.uniforms.permutation=A[a],n=0;n<this.contourLevels[a].length;++n)this._contourCounts[a][n]&&(s.uniforms.height=this.contourLevels[a][n],l.draw(e.LINES,this._contourCounts[a][n],this._contourOffsets[a][n]));for(n=0;n<3;++n)for(s.uniforms.model=o.projections[n],s.uniforms.clipBounds=o.clipBounds[n],a=0;a<3;++a)if(this.contourProject[n][a]){s.uniforms.permutation=A[a],e.lineWidth(this.contourWidth[a]);for(var c=0;c<this.contourLevels[a].length;++c)this._contourCounts[a][c]&&(s.uniforms.height=this.contourLevels[a][c],l.draw(e.LINES,this._contourCounts[a][c],this._contourOffsets[a][c]))}l.unbind()}},S.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=this._field[2].shape,r=this._pickResult,n=e[0]*(t.value[0]+(t.value[2]>>4)/16)/255,i=Math.floor(n),a=n-i,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var f=u?a:1-a,h=0;h<2;++h)for(var d=i+u,p=s+h,v=f*(h?l:1-l),g=0;g<3;++g)c[g]+=this._field[g].get(d,p)*v;for(var y=this._pickResult.level,b=0;b<3;++b)if(y[b]=m.le(this.contourLevels[b],c[b]),y[b]<0)this.contourLevels[b].length>0&&(y[b]=0);else if(y[b]<this.contourLevels[b].length-1){var x=this.contourLevels[b][y[b]],_=this.contourLevels[b][y[b]+1];Math.abs(x-c[b])>Math.abs(_-c[b])&&(y[b]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],g=0;g<3;++g)r.dataCoordinate[g]=this._field[g].get(r.index[0],r.index[1]);return r},S.update=function(t){t=t||{},this.dirty=!0,\"contourWidth\"in t&&(this.contourWidth=F(t.contourWidth,Number)),\"showContour\"in t&&(this.showContour=F(t.showContour,Boolean)),\"showSurface\"in t&&(this.showSurface=!!t.showSurface),\"contourTint\"in t&&(this.contourTint=F(t.contourTint,Boolean)),\"contourColor\"in t&&(this.contourColor=B(t.contourColor)),\"contourProject\"in t&&(this.contourProject=F(t.contourProject,function(t){return F(t,Boolean)})),\"surfaceProject\"in t&&(this.surfaceProject=t.surfaceProject),\"dynamicColor\"in t&&(this.dynamicColor=B(t.dynamicColor)),\"dynamicTint\"in t&&(this.dynamicTint=F(t.dynamicTint,Number)),\"dynamicWidth\"in t&&(this.dynamicWidth=F(t.dynamicWidth,Number)),\"opacity\"in t&&(this.opacity=t.opacity),\"colorBounds\"in t&&(this.colorBounds=t.colorBounds),\"vertexColor\"in t&&(this.vertexColor=t.vertexColor?1:0);var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),\"field\"in t||\"coords\"in t){var i=(e.shape[0]+2)*(e.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=f(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),N(this._field[2],e),this.shape=e.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var d=t.coords;if(!Array.isArray(d)||3!==d.length)throw new Error(\"gl-surface: invalid coordinates for x/y\");for(o=0;o<2;++o){var p=d[o];for(x=0;x<2;++x)if(p.shape[x]!==a[x])throw new Error(\"gl-surface: coords have incorrect shape\");N(this._field[o],p)}}else if(t.ticks){var m=t.ticks;if(!Array.isArray(m)||2!==m.length)throw new Error(\"gl-surface: invalid ticks\");for(o=0;o<2;++o){var g=m[o];if((Array.isArray(g)||g.length)&&(g=f(g)),g.shape[0]!==a[o])throw new Error(\"gl-surface: invalid tick length\");var y=f(g.data,a);y.stride[o]=g.stride[0],y.stride[1^o]=0,N(this._field[o],y)}}else{for(o=0;o<2;++o){var b=[0,0];b[o]=1,this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2],b,0)}this._field[0].set(0,0,0);for(var x=0;x<a[0];++x)this._field[0].set(x+1,0,x);for(this._field[0].set(a[0]+1,0,a[0]-1),this._field[1].set(0,0,0),x=0;x<a[1];++x)this._field[1].set(0,x+1,x);this._field[1].set(0,a[1]+1,a[1]-1)}var _=this._field,w=f(s.mallocFloat(3*_[2].size*2),[3,a[0]+2,a[1]+2,2]);for(o=0;o<3;++o)v(w.pick(o),_[o],\"mirror\");var M=f(s.mallocFloat(3*_[2].size),[a[0]+2,a[1]+2,3]);for(o=0;o<a[0]+2;++o)for(x=0;x<a[1]+2;++x){var A=w.get(0,o,x,0),E=w.get(0,o,x,1),S=w.get(1,o,x,0),L=w.get(1,o,x,1),C=w.get(2,o,x,0),P=w.get(2,o,x,1),z=S*P-L*C,O=C*E-P*A,D=A*L-E*S,I=Math.sqrt(z*z+O*O+D*D);I<1e-8?(I=Math.max(Math.abs(z),Math.abs(O),Math.abs(D)))<1e-8?(D=1,O=z=0,I=1):I=1/I:I=1/Math.sqrt(I),M.set(o,x,0,z*I),M.set(o,x,1,O*I),M.set(o,x,2,D*I)}s.free(w.data);var R=[1/0,1/0,1/0],j=[-1/0,-1/0,-1/0],U=1/0,V=-1/0,q=(a[0]-1)*(a[1]-1)*6,H=s.mallocFloat(n.nextPow2(10*q)),G=0,Y=0;for(o=0;o<a[0]-1;++o)t:for(x=0;x<a[1]-1;++x){for(var W=0;W<2;++W)for(var X=0;X<2;++X)for(var Z=0;Z<3;++Z){var J=this._field[Z].get(1+o+W,1+x+X);if(isNaN(J)||!isFinite(J))continue t}for(Z=0;Z<6;++Z){var K=o+k[Z][0],Q=x+k[Z][1],$=this._field[0].get(K+1,Q+1),tt=this._field[1].get(K+1,Q+1),et=J=this._field[2].get(K+1,Q+1);z=M.get(K+1,Q+1,0),O=M.get(K+1,Q+1,1),D=M.get(K+1,Q+1,2),t.intensity&&(et=t.intensity.get(K,Q)),H[G++]=K,H[G++]=Q,H[G++]=$,H[G++]=tt,H[G++]=J,H[G++]=0,H[G++]=et,H[G++]=z,H[G++]=O,H[G++]=D,R[0]=Math.min(R[0],$),R[1]=Math.min(R[1],tt),R[2]=Math.min(R[2],J),U=Math.min(U,et),j[0]=Math.max(j[0],$),j[1]=Math.max(j[1],tt),j[2]=Math.max(j[2],J),V=Math.max(V,et),Y+=1}}for(t.intensityBounds&&(U=+t.intensityBounds[0],V=+t.intensityBounds[1]),o=6;o<G;o+=10)H[o]=(H[o]-U)/(V-U);this._vertexCount=Y,this._coordinateBuffer.update(H.subarray(0,G)),s.freeFloat(H),s.free(M.data),this.bounds=[R,j],this.intensity=t.intensity||this._field[2],this.intensityBounds[0]===U&&this.intensityBounds[1]===V||(r=!0),this.intensityBounds=[U,V]}if(\"levels\"in t){var rt=t.levels;for(rt=Array.isArray(rt[0])?rt.slice():[[],[],rt],o=0;o<3;++o)rt[o]=rt[o].slice(),rt.sort(function(t,e){return t-e});t:for(o=0;o<3;++o){if(rt[o].length!==this.contourLevels[o].length){r=!0;break}for(x=0;x<rt[o].length;++x)if(rt[o][x]!==this.contourLevels[o][x]){r=!0;break t}}this.contourLevels=rt}if(r){_=this._field,a=this.shape;for(var nt=[],it=0;it<3;++it){rt=this.contourLevels[it];var at=[],ot=[],st=[0,0,0];for(o=0;o<rt.length;++o){var lt=h(this._field[it],rt[o]);at.push(nt.length/5|0),Y=0;t:for(x=0;x<lt.cells.length;++x){var ct=lt.cells[x];for(Z=0;Z<2;++Z){var ut=lt.positions[ct[Z]],ft=ut[0],ht=0|Math.floor(ft),dt=ft-ht,pt=ut[1],mt=0|Math.floor(pt),vt=pt-mt,gt=!1;e:for(var yt=0;yt<3;++yt){st[yt]=0;var bt=(it+yt+1)%3;for(W=0;W<2;++W){var xt=W?dt:1-dt;for(K=0|Math.min(Math.max(ht+W,0),a[0]),X=0;X<2;++X){var _t=X?vt:1-vt;if(Q=0|Math.min(Math.max(mt+X,0),a[1]),J=yt<2?this._field[bt].get(K,Q):(this.intensity.get(K,Q)-this.intensityBounds[0])/(this.intensityBounds[1]-this.intensityBounds[0]),!isFinite(J)||isNaN(J)){gt=!0;break e}var wt=xt*_t;st[yt]+=wt*J}}}if(gt){if(Z>0){for(var Mt=0;Mt<5;++Mt)nt.pop();Y-=1}continue t}nt.push(st[0],st[1],ut[0],ut[1],st[2]),Y+=1}}ot.push(Y)}this._contourOffsets[it]=at,this._contourCounts[it]=ot}var kt=s.mallocFloat(nt.length);for(o=0;o<nt.length;++o)kt[o]=nt[o];this._contourBuffer.update(kt),s.freeFloat(kt)}t.colormap&&this._colorMap.setPixels(function(t){var e=u([l({colormap:t,nshades:T,format:\"rgba\"}).map(function(t){return[t[0],t[1],t[2],255*t[3]]})]);return c.divseq(e,255),e}(t.colormap))},S.dispose=function(){this._shader.dispose(),this._vao.dispose(),this._coordinateBuffer.dispose(),this._colorMap.dispose(),this._contourBuffer.dispose(),this._contourVAO.dispose(),this._contourShader.dispose(),this._contourPickShader.dispose(),this._dynamicBuffer.dispose(),this._dynamicVAO.dispose();for(var t=0;t<3;++t)s.freeFloat(this._field[t].data)},S.highlight=function(t){if(!t)return this._dynamicCounts=[0,0,0],this.dyanamicLevel=[NaN,NaN,NaN],void(this.highlightLevel=[-1,-1,-1]);for(var e=0;e<3;++e)this.enableHighlight[e]?this.highlightLevel[e]=t.level[e]:this.highlightLevel[e]=-1;var r;if(r=this.snapToData?t.dataCoordinate:t.position,this.enableDynamic[0]&&r[0]!==this.dynamicLevel[0]||this.enableDynamic[1]&&r[1]!==this.dynamicLevel[1]||this.enableDynamic[2]&&r[2]!==this.dynamicLevel[2]){for(var n=0,i=this.shape,a=s.mallocFloat(12*i[0]*i[1]),o=0;o<3;++o)if(this.enableDynamic[o]){this.dynamicLevel[o]=r[o];var l=(o+1)%3,c=(o+2)%3,u=this._field[o],f=this._field[l],d=this._field[c],p=(this.intensity,h(u,r[o])),m=p.cells,v=p.positions;for(this._dynamicOffsets[o]=n,e=0;e<m.length;++e)for(var g=m[e],y=0;y<2;++y){var b=v[g[y]],x=+b[0],_=0|x,w=0|Math.min(_+1,i[0]),M=x-_,k=1-M,A=+b[1],T=0|A,E=0|Math.min(T+1,i[1]),S=A-T,L=1-S,C=k*L,P=k*S,z=M*L,O=M*S,D=C*f.get(_,T)+P*f.get(_,E)+z*f.get(w,T)+O*f.get(w,E),I=C*d.get(_,T)+P*d.get(_,E)+z*d.get(w,T)+O*d.get(w,E);if(isNaN(D)||isNaN(I)){y&&(n-=1);break}a[2*n+0]=D,a[2*n+1]=I,n+=1}this._dynamicCounts[o]=n-this._dynamicOffsets[o]}else this.dynamicLevel[o]=NaN,this._dynamicCounts[o]=0;this._dynamicBuffer.update(a.subarray(0,2*n)),s.freeFloat(a)}}},{\"./lib/shaders\":230,\"binary-search-bounds\":70,\"bit-twiddle\":71,colormap:105,\"gl-buffer\":165,\"gl-mat4/invert\":186,\"gl-mat4/multiply\":188,\"gl-texture2d\":233,\"gl-vao\":237,ndarray:439,\"ndarray-gradient\":430,\"ndarray-ops\":433,\"ndarray-pack\":434,\"surface-nets\":520,\"typedarray-pool\":534}],233:[function(t,e,r){\"use strict\";var n=t(\"ndarray\"),i=t(\"ndarray-ops\"),a=t(\"typedarray-pool\");e.exports=function(t){if(arguments.length<=1)throw new Error(\"gl-texture2d: Missing arguments for texture2d constructor\");o||function(t){o=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],s=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],l=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}(t);if(\"number\"==typeof arguments[1])return v(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return v(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(\"object\"==typeof arguments[1]){var e=arguments[1],r=c(e)?e:e.raw;if(r)return function(t,e,r,n,i,a){var o=m(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,a,e),new h(t,o,r,n,i,a)}(t,r,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return function(t,e){var r=e.dtype,o=e.shape.slice(),s=t.getParameter(t.MAX_TEXTURE_SIZE);if(o[0]<0||o[0]>s||o[1]<0||o[1]>s)throw new Error(\"gl-texture2d: Invalid texture size\");var l=p(o,e.stride.slice()),c=0;\"float32\"===r?c=t.FLOAT:\"float64\"===r?(c=t.FLOAT,l=!1,r=\"float32\"):\"uint8\"===r?c=t.UNSIGNED_BYTE:(c=t.UNSIGNED_BYTE,l=!1,r=\"uint8\");var f,d,v=0;if(2===o.length)v=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error(\"gl-texture2d: Invalid shape for texture\");if(1===o[2])v=t.ALPHA;else if(2===o[2])v=t.LUMINANCE_ALPHA;else if(3===o[2])v=t.RGB;else{if(4!==o[2])throw new Error(\"gl-texture2d: Invalid shape for pixel coords\");v=t.RGBA}}c!==t.FLOAT||t.getExtension(\"OES_texture_float\")||(c=t.UNSIGNED_BYTE,l=!1);var g=e.size;if(l)f=0===e.offset&&e.data.length===g?e.data:e.data.subarray(e.offset,e.offset+g);else{var y=[o[2],o[2]*o[0],1];d=a.malloc(g,r);var b=n(d,o,y,0);\"float32\"!==r&&\"float64\"!==r||c!==t.UNSIGNED_BYTE?i.assign(b,e):u(b,e),f=d.subarray(0,g)}var x=m(t);t.texImage2D(t.TEXTURE_2D,0,v,o[0],o[1],0,v,c,f),l||a.free(d);return new h(t,x,o[0],o[1],v,c)}(t,e)}throw new Error(\"gl-texture2d: Invalid arguments for texture2d constructor\")};var o=null,s=null,l=null;function c(t){return\"undefined\"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||\"undefined\"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||\"undefined\"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement||\"undefined\"!=typeof ImageData&&t instanceof ImageData}var u=function(t,e){i.muls(t,e,255)};function f(t,e,r){var n=t.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error(\"gl-texture2d: Invalid texture size\");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function h(t,e,r,n,i,a){this.gl=t,this.handle=e,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}var d=h.prototype;function p(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function m(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function v(t,e,r,n,i){var a=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error(\"gl-texture2d: Invalid texture shape\");if(i===t.FLOAT&&!t.getExtension(\"OES_texture_float\"))throw new Error(\"gl-texture2d: Floating point textures not supported on this platform\");var o=m(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new h(t,o,e,r,n,i)}Object.defineProperties(d,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension(\"OES_texture_float_linear\")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error(\"gl-texture2d: Unknown filter mode \"+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension(\"OES_texture_float_linear\")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error(\"gl-texture2d: Unknown filter mode \"+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension(\"EXT_texture_filter_anisotropic\");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error(\"gl-texture2d: Unknown wrap mode \"+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error(\"gl-texture2d: Unknown wrap mode \"+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error(\"gl-texture2d: Must specify wrap mode for rows and columns\");for(var e=0;e<2;++e)if(l.indexOf(t[e])<0)throw new Error(\"gl-texture2d: Unknown wrap mode \"+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error(\"gl-texture2d: Invalid texture shape\")}else t=[0|t,0|t];return f(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return f(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,f(this,this._shape[0],t),t}}}),d.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},d.dispose=function(){this.gl.deleteTexture(this.handle)},d.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},d.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=c(t)?t:t.raw;if(l){this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l)}else{if(!(t.shape&&t.stride&&t.data))throw new Error(\"gl-texture2d: Unsupported data type\");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error(\"gl-texture2d: Texture dimensions are out of bounds\");!function(t,e,r,o,s,l,c,f){var h=f.dtype,d=f.shape.slice();if(d.length<2||d.length>3)throw new Error(\"gl-texture2d: Invalid ndarray, must be 2d or 3d\");var m=0,v=0,g=p(d,f.stride.slice());\"float32\"===h?m=t.FLOAT:\"float64\"===h?(m=t.FLOAT,g=!1,h=\"float32\"):\"uint8\"===h?m=t.UNSIGNED_BYTE:(m=t.UNSIGNED_BYTE,g=!1,h=\"uint8\");if(2===d.length)v=t.LUMINANCE,d=[d[0],d[1],1],f=n(f.data,d,[f.stride[0],f.stride[1],1],f.offset);else{if(3!==d.length)throw new Error(\"gl-texture2d: Invalid shape for texture\");if(1===d[2])v=t.ALPHA;else if(2===d[2])v=t.LUMINANCE_ALPHA;else if(3===d[2])v=t.RGB;else{if(4!==d[2])throw new Error(\"gl-texture2d: Invalid shape for pixel coords\");v=t.RGBA}d[2]}v!==t.LUMINANCE&&v!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(v=s);if(v!==s)throw new Error(\"gl-texture2d: Incompatible texture format for setPixels\");var y=f.size,b=c.indexOf(o)<0;b&&c.push(o);if(m===l&&g)0===f.offset&&f.data.length===y?b?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,f.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,f.data):b?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,f.data.subarray(f.offset,f.offset+y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,f.data.subarray(f.offset,f.offset+y));else{var x;x=l===t.FLOAT?a.mallocFloat32(y):a.mallocUint8(y);var _=n(x,d,[d[2],d[2]*d[0],1]);m===t.FLOAT&&l===t.UNSIGNED_BYTE?u(_,f):i.assign(_,f),b?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,x.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,x.subarray(0,y)),l===t.FLOAT?a.freeFloat32(x):a.freeUint8(x)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},{ndarray:439,\"ndarray-ops\":433,\"typedarray-pool\":534}],234:[function(t,e,r){\"use strict\";e.exports=function(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error(\"gl-vao: Too many vertex attributes\");for(var i=0;i<r.length;++i){var a=r[i];if(a.buffer){var o=a.buffer,s=a.size||4,l=a.type||t.FLOAT,c=!!a.normalized,u=a.stride||0,f=a.offset||0;o.bind(),t.enableVertexAttribArray(i),t.vertexAttribPointer(i,s,l,c,u,f)}else{if(\"number\"==typeof a)t.vertexAttrib1f(i,a);else if(1===a.length)t.vertexAttrib1f(i,a[0]);else if(2===a.length)t.vertexAttrib2f(i,a[0],a[1]);else if(3===a.length)t.vertexAttrib3f(i,a[0],a[1],a[2]);else{if(4!==a.length)throw new Error(\"gl-vao: Invalid vertex attribute\");t.vertexAttrib4f(i,a[0],a[1],a[2],a[3])}t.disableVertexAttribArray(i)}}for(;i<n;++i)t.disableVertexAttribArray(i)}else for(t.bindBuffer(t.ARRAY_BUFFER,null),i=0;i<n;++i)t.disableVertexAttribArray(i)}},{}],235:[function(t,e,r){\"use strict\";var n=t(\"./do-bind.js\");function i(t){this.gl=t,this._elements=null,this._attributes=null,this._elementsType=t.UNSIGNED_SHORT}i.prototype.bind=function(){n(this.gl,this._elements,this._attributes)},i.prototype.update=function(t,e,r){this._elements=e,this._attributes=t,this._elementsType=r||this.gl.UNSIGNED_SHORT},i.prototype.dispose=function(){},i.prototype.unbind=function(){},i.prototype.draw=function(t,e,r){r=r||0;var n=this.gl;this._elements?n.drawElements(t,e,this._elementsType,r):n.drawArrays(t,r,e)},e.exports=function(t){return new i(t)}},{\"./do-bind.js\":234}],236:[function(t,e,r){\"use strict\";var n=t(\"./do-bind.js\");function i(t,e,r,n,i,a){this.location=t,this.dimension=e,this.a=r,this.b=n,this.c=i,this.d=a}function a(t,e,r){this.gl=t,this._ext=e,this.handle=r,this._attribs=[],this._useElements=!1,this._elementsType=t.UNSIGNED_SHORT}i.prototype.bind=function(t){switch(this.dimension){case 1:t.vertexAttrib1f(this.location,this.a);break;case 2:t.vertexAttrib2f(this.location,this.a,this.b);break;case 3:t.vertexAttrib3f(this.location,this.a,this.b,this.c);break;case 4:t.vertexAttrib4f(this.location,this.a,this.b,this.c,this.d)}},a.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var t=0;t<this._attribs.length;++t)this._attribs[t].bind(this.gl)},a.prototype.unbind=function(){this._ext.bindVertexArrayOES(null)},a.prototype.dispose=function(){this._ext.deleteVertexArrayOES(this.handle)},a.prototype.update=function(t,e,r){if(this.bind(),n(this.gl,e,t),this.unbind(),this._attribs.length=0,t)for(var a=0;a<t.length;++a){var o=t[a];\"number\"==typeof o?this._attribs.push(new i(a,1,o)):Array.isArray(o)&&this._attribs.push(new i(a,o.length,o[0],o[1],o[2],o[3]))}this._useElements=!!e,this._elementsType=r||this.gl.UNSIGNED_SHORT},a.prototype.draw=function(t,e,r){r=r||0;var n=this.gl;this._useElements?n.drawElements(t,e,this._elementsType,r):n.drawArrays(t,r,e)},e.exports=function(t,e){return new a(t,e,e.createVertexArrayOES())}},{\"./do-bind.js\":234}],237:[function(t,e,r){\"use strict\";var n=t(\"./lib/vao-native.js\"),i=t(\"./lib/vao-emulated.js\");e.exports=function(t,e,r,a){var o,s=t.createVertexArray?new function(t){this.bindVertexArrayOES=t.bindVertexArray.bind(t),this.createVertexArrayOES=t.createVertexArray.bind(t),this.deleteVertexArrayOES=t.deleteVertexArray.bind(t)}(t):t.getExtension(\"OES_vertex_array_object\");return(o=s?n(t,s):i(t)).update(e,r,a),o}},{\"./lib/vao-emulated.js\":235,\"./lib/vao-native.js\":236}],238:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}},{}],239:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},{}],240:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}},{}],241:[function(t,e,r){e.exports=function(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t}},{}],242:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a);return t}},{}],243:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}},{}],244:[function(t,e,r){e.exports=function(t,e,r,a){return n[0]=a,n[1]=r,n[2]=e,n[3]=t,i[0]};var n=new Uint8Array(4),i=new Float32Array(n.buffer)},{}],245:[function(t,e,r){var n=t(\"glsl-tokenizer\"),i=t(\"atob-lite\");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r<e.length;r++){var a=e[r];if(\"preprocessor\"===a.type){var o=a.data.match(/\\#define\\s+SHADER_NAME(_B64)?\\s+(.+)$/);if(o&&o[2]){var s=o[1],l=o[2];return(s?i(l):l).trim()}}}}},{\"atob-lite\":52,\"glsl-tokenizer\":252}],246:[function(t,e,r){e.exports=function(t){var e,r,M,k=0,A=0,T=l,E=[],S=[],L=1,C=0,P=0,z=!1,O=!1,D=\"\",I=a,R=n;\"300 es\"===(t=t||{}).version&&(I=s,R=o);return function(t){return S=[],null!==t?function(t){var r;k=0,M=(D+=t).length;for(;e=D[k],k<M;){switch(r=k,T){case u:k=U();break;case f:case h:k=B();break;case d:k=V();break;case p:k=G();break;case _:k=H();break;case m:k=Y();break;case c:k=W();break;case b:k=j();break;case l:k=F()}if(r!==k)switch(D[r]){case\"\\n\":C=0,++L;break;default:++C}}return A+=k,D=D.slice(k),S}(t.replace?t.replace(/\\r\\n/g,\"\\n\"):t):function(t){E.length&&N(E.join(\"\"));return T=x,N(\"(eof)\"),S}()};function N(t){t.length&&S.push({type:w[T],data:t,position:P,line:L,column:C})}function F(){return E=E.length?[]:E,\"/\"===r&&\"*\"===e?(P=A+k-1,T=u,r=e,k+1):\"/\"===r&&\"/\"===e?(P=A+k-1,T=f,r=e,k+1):\"#\"===e?(T=h,P=A+k,k):/\\s/.test(e)?(T=b,P=A+k,k):(z=/\\d/.test(e),O=/[^\\w_]/.test(e),P=A+k,T=z?p:O?d:c,k)}function j(){return/[^\\s]/g.test(e)?(N(E.join(\"\")),T=l,k):(E.push(e),r=e,k+1)}function B(){return\"\\r\"!==e&&\"\\n\"!==e||\"\\\\\"===r?(E.push(e),r=e,k+1):(N(E.join(\"\")),T=l,k)}function U(){return\"/\"===e&&\"*\"===r?(E.push(e),N(E.join(\"\")),T=l,k+1):(E.push(e),r=e,k+1)}function V(){if(\".\"===r&&/\\d/.test(e))return T=m,k;if(\"/\"===r&&\"*\"===e)return T=u,k;if(\"/\"===r&&\"/\"===e)return T=f,k;if(\".\"===e&&E.length){for(;q(E););return T=m,k}if(\";\"===e||\")\"===e||\"(\"===e){if(E.length)for(;q(E););return N(e),T=l,k+1}var t=2===E.length&&\"=\"!==e;if(/[\\w_\\d\\s]/.test(e)||t){for(;q(E););return T=l,k}return E.push(e),r=e,k+1}function q(t){for(var e,r,n=0;;){if(e=i.indexOf(t.slice(0,t.length+n).join(\"\")),r=i[e],-1===e){if(n--+t.length>0)continue;r=t.slice(0,1).join(\"\")}return N(r),P+=r.length,(E=E.slice(r.length)).length}}function H(){return/[^a-fA-F0-9]/.test(e)?(N(E.join(\"\")),T=l,k):(E.push(e),r=e,k+1)}function G(){return\".\"===e?(E.push(e),T=m,r=e,k+1):/[eE]/.test(e)?(E.push(e),T=m,r=e,k+1):\"x\"===e&&1===E.length&&\"0\"===E[0]?(T=_,E.push(e),r=e,k+1):/[^\\d]/.test(e)?(N(E.join(\"\")),T=l,k):(E.push(e),r=e,k+1)}function Y(){return\"f\"===e&&(E.push(e),r=e,k+=1),/[eE]/.test(e)?(E.push(e),r=e,k+1):\"-\"===e&&/[eE]/.test(r)?(E.push(e),r=e,k+1):/[^\\d]/.test(e)?(N(E.join(\"\")),T=l,k):(E.push(e),r=e,k+1)}function W(){if(/[^\\d\\w_]/.test(e)){var t=E.join(\"\");return T=R.indexOf(t)>-1?y:I.indexOf(t)>-1?g:v,N(E.join(\"\")),T=l,k}return E.push(e),r=e,k+1}};var n=t(\"./lib/literals\"),i=t(\"./lib/operators\"),a=t(\"./lib/builtins\"),o=t(\"./lib/literals-300es\"),s=t(\"./lib/builtins-300es\"),l=999,c=9999,u=0,f=1,h=2,d=3,p=4,m=5,v=6,g=7,y=8,b=9,x=10,_=11,w=[\"block-comment\",\"line-comment\",\"preprocessor\",\"operator\",\"integer\",\"float\",\"ident\",\"builtin\",\"keyword\",\"whitespace\",\"eof\",\"integer\"]},{\"./lib/builtins\":248,\"./lib/builtins-300es\":247,\"./lib/literals\":250,\"./lib/literals-300es\":249,\"./lib/operators\":251}],247:[function(t,e,r){var n=t(\"./builtins\");n=n.slice().filter(function(t){return!/^(gl\\_|texture)/.test(t)}),e.exports=n.concat([\"gl_VertexID\",\"gl_InstanceID\",\"gl_Position\",\"gl_PointSize\",\"gl_FragCoord\",\"gl_FrontFacing\",\"gl_FragDepth\",\"gl_PointCoord\",\"gl_MaxVertexAttribs\",\"gl_MaxVertexUniformVectors\",\"gl_MaxVertexOutputVectors\",\"gl_MaxFragmentInputVectors\",\"gl_MaxVertexTextureImageUnits\",\"gl_MaxCombinedTextureImageUnits\",\"gl_MaxTextureImageUnits\",\"gl_MaxFragmentUniformVectors\",\"gl_MaxDrawBuffers\",\"gl_MinProgramTexelOffset\",\"gl_MaxProgramTexelOffset\",\"gl_DepthRangeParameters\",\"gl_DepthRange\",\"trunc\",\"round\",\"roundEven\",\"isnan\",\"isinf\",\"floatBitsToInt\",\"floatBitsToUint\",\"intBitsToFloat\",\"uintBitsToFloat\",\"packSnorm2x16\",\"unpackSnorm2x16\",\"packUnorm2x16\",\"unpackUnorm2x16\",\"packHalf2x16\",\"unpackHalf2x16\",\"outerProduct\",\"transpose\",\"determinant\",\"inverse\",\"texture\",\"textureSize\",\"textureProj\",\"textureLod\",\"textureOffset\",\"texelFetch\",\"texelFetchOffset\",\"textureProjOffset\",\"textureLodOffset\",\"textureProjLod\",\"textureProjLodOffset\",\"textureGrad\",\"textureGradOffset\",\"textureProjGrad\",\"textureProjGradOffset\"])},{\"./builtins\":248}],248:[function(t,e,r){e.exports=[\"abs\",\"acos\",\"all\",\"any\",\"asin\",\"atan\",\"ceil\",\"clamp\",\"cos\",\"cross\",\"dFdx\",\"dFdy\",\"degrees\",\"distance\",\"dot\",\"equal\",\"exp\",\"exp2\",\"faceforward\",\"floor\",\"fract\",\"gl_BackColor\",\"gl_BackLightModelProduct\",\"gl_BackLightProduct\",\"gl_BackMaterial\",\"gl_BackSecondaryColor\",\"gl_ClipPlane\",\"gl_ClipVertex\",\"gl_Color\",\"gl_DepthRange\",\"gl_DepthRangeParameters\",\"gl_EyePlaneQ\",\"gl_EyePlaneR\",\"gl_EyePlaneS\",\"gl_EyePlaneT\",\"gl_Fog\",\"gl_FogCoord\",\"gl_FogFragCoord\",\"gl_FogParameters\",\"gl_FragColor\",\"gl_FragCoord\",\"gl_FragData\",\"gl_FragDepth\",\"gl_FragDepthEXT\",\"gl_FrontColor\",\"gl_FrontFacing\",\"gl_FrontLightModelProduct\",\"gl_FrontLightProduct\",\"gl_FrontMaterial\",\"gl_FrontSecondaryColor\",\"gl_LightModel\",\"gl_LightModelParameters\",\"gl_LightModelProducts\",\"gl_LightProducts\",\"gl_LightSource\",\"gl_LightSourceParameters\",\"gl_MaterialParameters\",\"gl_MaxClipPlanes\",\"gl_MaxCombinedTextureImageUnits\",\"gl_MaxDrawBuffers\",\"gl_MaxFragmentUniformComponents\",\"gl_MaxLights\",\"gl_MaxTextureCoords\",\"gl_MaxTextureImageUnits\",\"gl_MaxTextureUnits\",\"gl_MaxVaryingFloats\",\"gl_MaxVertexAttribs\",\"gl_MaxVertexTextureImageUnits\",\"gl_MaxVertexUniformComponents\",\"gl_ModelViewMatrix\",\"gl_ModelViewMatrixInverse\",\"gl_ModelViewMatrixInverseTranspose\",\"gl_ModelViewMatrixTranspose\",\"gl_ModelViewProjectionMatrix\",\"gl_ModelViewProjectionMatrixInverse\",\"gl_ModelViewProjectionMatrixInverseTranspose\",\"gl_ModelViewProjectionMatrixTranspose\",\"gl_MultiTexCoord0\",\"gl_MultiTexCoord1\",\"gl_MultiTexCoord2\",\"gl_MultiTexCoord3\",\"gl_MultiTexCoord4\",\"gl_MultiTexCoord5\",\"gl_MultiTexCoord6\",\"gl_MultiTexCoord7\",\"gl_Normal\",\"gl_NormalMatrix\",\"gl_NormalScale\",\"gl_ObjectPlaneQ\",\"gl_ObjectPlaneR\",\"gl_ObjectPlaneS\",\"gl_ObjectPlaneT\",\"gl_Point\",\"gl_PointCoord\",\"gl_PointParameters\",\"gl_PointSize\",\"gl_Position\",\"gl_ProjectionMatrix\",\"gl_ProjectionMatrixInverse\",\"gl_ProjectionMatrixInverseTranspose\",\"gl_ProjectionMatrixTranspose\",\"gl_SecondaryColor\",\"gl_TexCoord\",\"gl_TextureEnvColor\",\"gl_TextureMatrix\",\"gl_TextureMatrixInverse\",\"gl_TextureMatrixInverseTranspose\",\"gl_TextureMatrixTranspose\",\"gl_Vertex\",\"greaterThan\",\"greaterThanEqual\",\"inversesqrt\",\"length\",\"lessThan\",\"lessThanEqual\",\"log\",\"log2\",\"matrixCompMult\",\"max\",\"min\",\"mix\",\"mod\",\"normalize\",\"not\",\"notEqual\",\"pow\",\"radians\",\"reflect\",\"refract\",\"sign\",\"sin\",\"smoothstep\",\"sqrt\",\"step\",\"tan\",\"texture2D\",\"texture2DLod\",\"texture2DProj\",\"texture2DProjLod\",\"textureCube\",\"textureCubeLod\",\"texture2DLodEXT\",\"texture2DProjLodEXT\",\"textureCubeLodEXT\",\"texture2DGradEXT\",\"texture2DProjGradEXT\",\"textureCubeGradEXT\"]},{}],249:[function(t,e,r){var n=t(\"./literals\");e.exports=n.slice().concat([\"layout\",\"centroid\",\"smooth\",\"case\",\"mat2x2\",\"mat2x3\",\"mat2x4\",\"mat3x2\",\"mat3x3\",\"mat3x4\",\"mat4x2\",\"mat4x3\",\"mat4x4\",\"uint\",\"uvec2\",\"uvec3\",\"uvec4\",\"samplerCubeShadow\",\"sampler2DArray\",\"sampler2DArrayShadow\",\"isampler2D\",\"isampler3D\",\"isamplerCube\",\"isampler2DArray\",\"usampler2D\",\"usampler3D\",\"usamplerCube\",\"usampler2DArray\",\"coherent\",\"restrict\",\"readonly\",\"writeonly\",\"resource\",\"atomic_uint\",\"noperspective\",\"patch\",\"sample\",\"subroutine\",\"common\",\"partition\",\"active\",\"filter\",\"image1D\",\"image2D\",\"image3D\",\"imageCube\",\"iimage1D\",\"iimage2D\",\"iimage3D\",\"iimageCube\",\"uimage1D\",\"uimage2D\",\"uimage3D\",\"uimageCube\",\"image1DArray\",\"image2DArray\",\"iimage1DArray\",\"iimage2DArray\",\"uimage1DArray\",\"uimage2DArray\",\"image1DShadow\",\"image2DShadow\",\"image1DArrayShadow\",\"image2DArrayShadow\",\"imageBuffer\",\"iimageBuffer\",\"uimageBuffer\",\"sampler1DArray\",\"sampler1DArrayShadow\",\"isampler1D\",\"isampler1DArray\",\"usampler1D\",\"usampler1DArray\",\"isampler2DRect\",\"usampler2DRect\",\"samplerBuffer\",\"isamplerBuffer\",\"usamplerBuffer\",\"sampler2DMS\",\"isampler2DMS\",\"usampler2DMS\",\"sampler2DMSArray\",\"isampler2DMSArray\",\"usampler2DMSArray\"])},{\"./literals\":250}],250:[function(t,e,r){e.exports=[\"precision\",\"highp\",\"mediump\",\"lowp\",\"attribute\",\"const\",\"uniform\",\"varying\",\"break\",\"continue\",\"do\",\"for\",\"while\",\"if\",\"else\",\"in\",\"out\",\"inout\",\"float\",\"int\",\"void\",\"bool\",\"true\",\"false\",\"discard\",\"return\",\"mat2\",\"mat3\",\"mat4\",\"vec2\",\"vec3\",\"vec4\",\"ivec2\",\"ivec3\",\"ivec4\",\"bvec2\",\"bvec3\",\"bvec4\",\"sampler1D\",\"sampler2D\",\"sampler3D\",\"samplerCube\",\"sampler1DShadow\",\"sampler2DShadow\",\"struct\",\"asm\",\"class\",\"union\",\"enum\",\"typedef\",\"template\",\"this\",\"packed\",\"goto\",\"switch\",\"default\",\"inline\",\"noinline\",\"volatile\",\"public\",\"static\",\"extern\",\"external\",\"interface\",\"long\",\"short\",\"double\",\"half\",\"fixed\",\"unsigned\",\"input\",\"output\",\"hvec2\",\"hvec3\",\"hvec4\",\"dvec2\",\"dvec3\",\"dvec4\",\"fvec2\",\"fvec3\",\"fvec4\",\"sampler2DRect\",\"sampler3DRect\",\"sampler2DRectShadow\",\"sizeof\",\"cast\",\"namespace\",\"using\"]},{}],251:[function(t,e,r){e.exports=[\"<<=\",\">>=\",\"++\",\"--\",\"<<\",\">>\",\"<=\",\">=\",\"==\",\"!=\",\"&&\",\"||\",\"+=\",\"-=\",\"*=\",\"/=\",\"%=\",\"&=\",\"^^\",\"^=\",\"|=\",\"(\",\")\",\"[\",\"]\",\".\",\"!\",\"~\",\"*\",\"/\",\"%\",\"+\",\"-\",\"<\",\">\",\"&\",\"^\",\"|\",\"?\",\":\",\"=\",\",\",\";\",\"{\",\"}\"]},{}],252:[function(t,e,r){var n=t(\"./index\");e.exports=function(t,e){var r=n(e),i=[];return i=(i=i.concat(r(t))).concat(r(null))}},{\"./index\":246}],253:[function(t,e,r){arguments[4][169][0].apply(r,arguments)},{dup:169}],254:[function(t,e,r){\"use strict\";e.exports=i;var n=3;function i(t,e,r){var i=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var a=new Int32Array(this.arrayBuffer);t=a[0],e=a[1],r=a[2],this.d=e+2*r;for(var o=0;o<this.d*this.d;o++){var s=a[n+o],l=a[n+o+1];i.push(s===l?null:a.subarray(s,l))}var c=a[n+i.length],u=a[n+i.length+1];this.keys=a.subarray(c,u),this.bboxes=a.subarray(u),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var f=0;f<this.d*this.d;f++)i.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var h=r/e*t;this.min=-h,this.max=t+h}i.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},i.prototype._insertReadonly=function(){throw\"Cannot insert into a GridIndex created from an ArrayBuffer.\"},i.prototype._insertCell=function(t,e,r,n,i,a){this.cells[i].push(a)},i.prototype.query=function(t,e,r,n){var i=this.min,a=this.max;if(t<=i&&e<=i&&a<=r&&a<=n)return Array.prototype.slice.call(this.keys);var o=[];return this._forEachCell(t,e,r,n,this._queryCell,o,{}),o},i.prototype._queryCell=function(t,e,r,n,i,a,o){var s=this.cells[i];if(null!==s)for(var l=this.keys,c=this.bboxes,u=0;u<s.length;u++){var f=s[u];if(void 0===o[f]){var h=4*f;t<=c[h+2]&&e<=c[h+3]&&r>=c[h+0]&&n>=c[h+1]?(o[f]=!0,a.push(l[f])):o[f]=!1}}},i.prototype._forEachCell=function(t,e,r,n,i,a,o){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),c=this._convertToCellCoord(r),u=this._convertToCellCoord(n),f=s;f<=c;f++)for(var h=l;h<=u;h++){var d=this.d*h+f;if(i.call(this,t,e,r,n,d,a,o))return}},i.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},i.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=n+this.cells.length+1+1,r=0,i=0;i<this.cells.length;i++)r+=this.cells[i].length;var a=new Int32Array(e+r+this.keys.length+this.bboxes.length);a[0]=this.extent,a[1]=this.n,a[2]=this.padding;for(var o=e,s=0;s<t.length;s++){var l=t[s];a[n+s]=o,a.set(l,o),o+=l.length}return a[n+t.length]=o,a.set(this.keys,o),o+=this.keys.length,a[n+t.length+1]=o,a.set(this.bboxes,o),o+=this.bboxes.length,a.buffer}},{}],255:[function(t,e,r){(function(r){\"use strict\";var n,i=t(\"is-browser\");n=\"function\"==typeof r.matchMedia?!r.matchMedia(\"(hover: none)\").matches:i,e.exports=n}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{\"is-browser\":262}],256:[function(t,e,r){\"use strict\";var n=t(\"is-browser\");e.exports=n&&function(){var t=!1;try{var e=Object.defineProperty({},\"passive\",{get:function(){t=!0}});window.addEventListener(\"test\",null,e),window.removeEventListener(\"test\",null,e)}catch(e){t=!1}return t}()},{\"is-browser\":262}],257:[function(t,e,r){r.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,c=l>>1,u=-7,f=r?i-1:0,h=r?-1:1,d=t[e+f];for(f+=h,a=d&(1<<-u)-1,d>>=-u,u+=s;u>0;a=256*a+t[e+f],f+=h,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+f],f+=h,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<<c)-1,f=u>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=u?(s=0,o=u):o+f>=1?(s=(e*l-1)*Math.pow(2,i),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;t[r+d]=255&o,d+=p,o/=256,c-=8);t[r+d-p]|=128*m}},{}],258:[function(t,e,r){\"use strict\";e.exports=function(t,e){var r=t.length;if(0===r)throw new Error(\"Must have at least d+1 points\");var i=t[0].length;if(r<=i)throw new Error(\"Must input at least d+1 points\");var o=t.slice(0,i+1),s=n.apply(void 0,o);if(0===s)throw new Error(\"Input not in general position\");for(var l=new Array(i+1),u=0;u<=i;++u)l[u]=u;s<0&&(l[0]=1,l[1]=0);for(var f=new a(l,new Array(i+1),!1),h=f.adjacent,d=new Array(i+2),u=0;u<=i;++u){for(var p=l.slice(),m=0;m<=i;++m)m===u&&(p[m]=-1);var v=p[0];p[0]=p[1],p[1]=v;var g=new a(p,new Array(i+1),!0);h[u]=g,d[u]=g}d[i+1]=f;for(var u=0;u<=i;++u)for(var p=h[u].vertices,y=h[u].adjacent,m=0;m<=i;++m){var b=p[m];if(b<0)y[m]=f;else for(var x=0;x<=i;++x)h[x].vertices.indexOf(b)<0&&(y[m]=h[x])}for(var _=new c(i,o,d),w=!!e,u=i+1;u<r;++u)_.insert(t[u],w);return _.boundary()};var n=t(\"robust-orientation\"),i=t(\"simplicial-complex\").compareCells;function a(t,e,r){this.vertices=t,this.adjacent=e,this.boundary=r,this.lastVisited=-1}function o(t,e,r){this.vertices=t,this.cell=e,this.index=r}function s(t,e){return i(t.vertices,e.vertices)}a.prototype.flip=function(){var t=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=t;var e=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=e};var l=[];function c(t,e,r){this.dimension=t,this.vertices=e,this.simplices=r,this.interior=r.filter(function(t){return!t.boundary}),this.tuple=new Array(t+1);for(var i=0;i<=t;++i)this.tuple[i]=this.vertices[i];var a=l[t];a||(a=l[t]=function(t){for(var e=[\"function orient(){var tuple=this.tuple;return test(\"],r=0;r<=t;++r)r>0&&e.push(\",\"),e.push(\"tuple[\",r,\"]\");e.push(\")}return orient\");var i=new Function(\"test\",e.join(\"\")),a=n[t+1];return a||(a=n),i(a)}(t)),this.orient=a}var u=c.prototype;u.handleBoundaryDegeneracy=function(t,e){var r=this.dimension,n=this.vertices.length-1,i=this.tuple,a=this.vertices,o=[t];for(t.lastVisited=-n;o.length>0;){(t=o.pop()).vertices;for(var s=t.adjacent,l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,f=0;f<=r;++f){var h=u[f];i[f]=h<0?e:a[h]}var d=this.orient();if(d>0)return c;c.lastVisited=-n,0===d&&o.push(c)}}}return null},u.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,c=s.adjacent,u=0;u<=n;++u)a[u]=i[l[u]];s.lastVisited=r;for(u=0;u<=n;++u){var f=c[u];if(!(f.lastVisited>=r)){var h=a[u];a[u]=t;var d=this.orient();if(a[u]=h,d<0){s=f;continue t}f.boundary?f.lastVisited=-r:f.lastVisited=r}}return}return s},u.addPeaks=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,f=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,c.push(e);for(var h=[];f.length>0;){var d=(e=f.pop()).vertices,p=e.adjacent,m=d.indexOf(r);if(!(m<0))for(var v=0;v<=n;++v)if(v!==m){var g=p[v];if(g.boundary&&!(g.lastVisited>=r)){var y=g.vertices;if(g.lastVisited!==-r){for(var b=0,x=0;x<=n;++x)y[x]<0?(b=x,l[x]=t):l[x]=i[y[x]];if(this.orient()>0){y[b]=r,g.boundary=!1,c.push(g),f.push(g),g.lastVisited=r;continue}g.lastVisited=-r}var _=g.adjacent,w=d.slice(),M=p.slice(),k=new a(w,M,!0);u.push(k);var A=_.indexOf(e);if(!(A<0)){_[A]=k,M[m]=g,w[v]=-1,M[v]=e,p[v]=k,k.flip();for(x=0;x<=n;++x){var T=w[x];if(!(T<0||T===r)){for(var E=new Array(n-1),S=0,L=0;L<=n;++L){var C=w[L];C<0||L===x||(E[S++]=C)}h.push(new o(E,k,x))}}}}}}h.sort(s);for(v=0;v+1<h.length;v+=2){var P=h[v],z=h[v+1],O=P.index,D=z.index;O<0||D<0||(P.cell.adjacent[P.index]=z.cell,z.cell.adjacent[z.index]=P.cell)}},u.insert=function(t,e){var r=this.vertices;r.push(t);var n=this.walk(t,e);if(n){for(var i=this.dimension,a=this.tuple,o=0;o<=i;++o){var s=n.vertices[o];a[o]=s<0?t:r[s]}var l=this.orient(a);l<0||(0!==l||(n=this.handleBoundaryDegeneracy(n,t)))&&this.addPeaks(t,n)}},u.boundary=function(){for(var t=this.dimension,e=[],r=this.simplices,n=r.length,i=0;i<n;++i){var a=r[i];if(a.boundary){for(var o=new Array(t),s=a.vertices,l=0,c=0,u=0;u<=t;++u)s[u]>=0?o[l++]=s[u]:c=1&u;if(c===(1&t)){var f=o[0];o[0]=o[1],o[1]=f}e.push(o)}}return e}},{\"robust-orientation\":495,\"simplicial-complex\":506}],259:[function(t,e,r){\"use strict\";var n=t(\"binary-search-bounds\"),i=0,a=1;function o(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}e.exports=function(t){if(!t||0===t.length)return new b(null);return new b(y(t))};var s=o.prototype;function l(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function c(t,e){var r=y(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function u(t,e){var r=t.intervals([]);r.push(e),c(t,r)}function f(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?i:(r.splice(n,1),c(t,r),a)}function h(t,e,r){for(var n=0;n<t.length&&t[n][0]<=e;++n){var i=r(t[n]);if(i)return i}}function d(t,e,r){for(var n=t.length-1;n>=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function p(t,e){for(var r=0;r<t.length;++r){var n=e(t[r]);if(n)return n}}function m(t,e){return t-e}function v(t,e){var r=t[0]-e[0];return r||t[1]-e[1]}function g(t,e){var r=t[1]-e[1];return r||t[0]-e[0]}function y(t){if(0===t.length)return null;for(var e=[],r=0;r<t.length;++r)e.push(t[r][0],t[r][1]);e.sort(m);var n=e[e.length>>1],i=[],a=[],s=[];for(r=0;r<t.length;++r){var l=t[r];l[1]<n?i.push(l):n<l[0]?a.push(l):s.push(l)}var c=s,u=s.slice();return c.sort(v),u.sort(g),new o(n,y(i),y(a),c,u)}function b(t){this.root=t}s.intervals=function(t){return t.push.apply(t,this.leftPoints),this.left&&this.left.intervals(t),this.right&&this.right.intervals(t),t},s.insert=function(t){var e=this.count-this.leftPoints.length;if(this.count+=1,t[1]<this.mid)this.left?4*(this.left.count+1)>3*(e+1)?u(this,t):this.left.insert(t):this.left=y([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?u(this,t):this.right.insert(t):this.right=y([t]);else{var r=n.ge(this.leftPoints,t,v),i=n.ge(this.rightPoints,t,g);this.leftPoints.splice(r,0,t),this.rightPoints.splice(i,0,t)}},s.remove=function(t){var e=this.count-this.leftPoints;if(t[1]<this.mid){return this.left?4*(this.right?this.right.count:0)>3*(e-1)?f(this,t):2===(c=this.left.remove(t))?(this.left=null,this.count-=1,a):(c===a&&(this.count-=1),c):i}else{if(!(t[0]>this.mid)){if(1===this.count)return this.leftPoints[0]===t?2:i;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,o=this.left;o.right;)r=o,o=o.right;if(r===this)o.right=this.right;else{var s=this.left;c=this.right;r.count-=o.count,r.right=o.left,o.left=s,o.right=c}l(this,o),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?l(this,this.left):l(this,this.right);return a}for(s=n.ge(this.leftPoints,t,v);s<this.leftPoints.length&&this.leftPoints[s][0]===t[0];++s)if(this.leftPoints[s]===t){this.count-=1,this.leftPoints.splice(s,1);for(c=n.ge(this.rightPoints,t,g);c<this.rightPoints.length&&this.rightPoints[c][1]===t[1];++c)if(this.rightPoints[c]===t)return this.rightPoints.splice(c,1),a}return i}return this.right?4*(this.left?this.left.count:0)>3*(e-1)?f(this,t):2===(c=this.right.remove(t))?(this.right=null,this.count-=1,a):(c===a&&(this.count-=1),c):i;var c}},s.queryPoint=function(t,e){if(t<this.mid){if(this.left)if(r=this.left.queryPoint(t,e))return r;return h(this.leftPoints,t,e)}if(t>this.mid){var r;if(this.right)if(r=this.right.queryPoint(t,e))return r;return d(this.rightPoints,t,e)}return p(this.leftPoints,e)},s.queryInterval=function(t,e,r){var n;if(t<this.mid&&this.left&&(n=this.left.queryInterval(t,e,r)))return n;if(e>this.mid&&this.right&&(n=this.right.queryInterval(t,e,r)))return n;return e<this.mid?h(this.leftPoints,e,r):t>this.mid?d(this.rightPoints,t,r):p(this.leftPoints,r)};var x=b.prototype;x.insert=function(t){this.root?this.root.insert(t):this.root=new o(t[0],null,null,[t],[t])},x.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),e!==i}return!1},x.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},x.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(x,\"count\",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(x,\"intervals\",{get:function(){return this.root?this.root.intervals([]):[]}})},{\"binary-search-bounds\":70}],260:[function(t,e,r){\"use strict\";e.exports=function(t,e){e=e||new Array(t.length);for(var r=0;r<t.length;++r)e[t[r]]=r;return e}},{}],261:[function(t,e,r){\"use strict\";e.exports=function(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=r;return e}},{}],262:[function(t,e,r){e.exports=!0},{}],263:[function(t,e,r){function n(t){return!!t.constructor&&\"function\"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}e.exports=function(t){return null!=t&&(n(t)||function(t){return\"function\"==typeof t.readFloatLE&&\"function\"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},{}],264:[function(t,e,r){\"use strict\";e.exports=\"undefined\"!=typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\\//.test(navigator.appVersion))},{}],265:[function(t,e,r){e.exports=function(t){t||\"undefined\"==typeof navigator||(t=navigator.userAgent);t&&t.headers&&\"string\"==typeof t.headers[\"user-agent\"]&&(t=t.headers[\"user-agent\"]);return\"string\"==typeof t&&(/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(t.substr(0,4)))}},{}],266:[function(t,e,r){\"use strict\";var n=Object.prototype.toString;e.exports=function(t){var e;return\"[object Object]\"===n.call(t)&&(null===(e=Object.getPrototypeOf(t))||e===Object.getPrototypeOf({}))}},{}],267:[function(t,e,r){\"use strict\";e.exports=function(t){return\"string\"==typeof t&&(t=t.trim(),!!(/^[mzlhvcsqta]\\s*[-+.0-9][^mlhvzcsqta]+/i.test(t)&&/[\\dz]$/i.test(t)&&t.length>4))}},{}],268:[function(t,e,r){\"use strict\";var n=t(\"./sort\"),i=t(\"./range\"),a=t(\"./within\");function o(t,e,r,i,a){e=e||s,r=r||l,a=a||Array,this.nodeSize=i||64,this.points=t,this.ids=new a(t.length),this.coords=new a(2*t.length);for(var o=0;o<t.length;o++)this.ids[o]=o,this.coords[2*o]=e(t[o]),this.coords[2*o+1]=r(t[o]);n(this.ids,this.coords,this.nodeSize,0,this.ids.length-1,0)}function s(t){return t[0]}function l(t){return t[1]}e.exports=function(t,e,r,n,i){return new o(t,e,r,n,i)},o.prototype={range:function(t,e,r,n){return i(this.ids,this.coords,t,e,r,n,this.nodeSize)},within:function(t,e,r){return a(this.ids,this.coords,t,e,r,this.nodeSize)}}},{\"./range\":269,\"./sort\":270,\"./within\":271}],269:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,n,i,a,o){var s,l,c=[0,t.length-1,0],u=[];for(;c.length;){var f=c.pop(),h=c.pop(),d=c.pop();if(h-d<=o)for(var p=d;p<=h;p++)s=e[2*p],l=e[2*p+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(t[p]);else{var m=Math.floor((d+h)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(t[m]);var v=(f+1)%2;(0===f?r<=s:n<=l)&&(c.push(d),c.push(m-1),c.push(v)),(0===f?i>=s:a>=l)&&(c.push(m+1),c.push(h),c.push(v))}}return u}},{}],270:[function(t,e,r){\"use strict\";function n(t,e,r,n){i(t,r,n),i(e,2*r,2*n),i(e,2*r+1,2*n+1)}function i(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=function t(e,r,i,a,o,s){if(o-a<=i)return;var l=Math.floor((a+o)/2);!function t(e,r,i,a,o,s){for(;o>a;){if(o-a>600){var l=o-a+1,c=i-a+1,u=Math.log(l),f=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1),d=Math.max(a,Math.floor(i-c*f/l+h)),p=Math.min(o,Math.floor(i+(l-c)*f/l+h));t(e,r,i,d,p,s)}var m=r[2*i+s],v=a,g=o;for(n(e,r,a,i),r[2*o+s]>m&&n(e,r,a,o);v<g;){for(n(e,r,v,g),v++,g--;r[2*v+s]<m;)v++;for(;r[2*g+s]>m;)g--}r[2*a+s]===m?n(e,r,a,g):n(e,r,++g,o),g<=i&&(a=g+1),i<=g&&(o=g-1)}}(e,r,l,a,o,s%2);t(e,r,i,a,l-1,s+1);t(e,r,i,l+1,o,s+1)}},{}],271:[function(t,e,r){\"use strict\";function n(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}e.exports=function(t,e,r,i,a,o){var s=[0,t.length-1,0],l=[],c=a*a;for(;s.length;){var u=s.pop(),f=s.pop(),h=s.pop();if(f-h<=o)for(var d=h;d<=f;d++)n(e[2*d],e[2*d+1],r,i)<=c&&l.push(t[d]);else{var p=Math.floor((h+f)/2),m=e[2*p],v=e[2*p+1];n(m,v,r,i)<=c&&l.push(t[p]);var g=(u+1)%2;(0===u?r-a<=m:i-a<=v)&&(s.push(h),s.push(p-1),s.push(g)),(0===u?r+a>=m:i+a>=v)&&(s.push(p+1),s.push(f),s.push(g))}}return l}},{}],272:[function(t,e,r){\"use strict\";function n(t,e){if(!(this instanceof n))return new n(t,e);this.nodeSize=e||64,this.coords=t.slice();var r=Math.floor(t.length/2);this.ids=Array(r);for(var i=0;i<r;i++)this.ids[i]=i;!function t(e,r,n,i,o,s){if(o-i<=n)return;var l=Math.floor((i+o)/2);!function t(e,r,n,i,o,s){for(;o>i;){if(o-i>600){var l=o-i+1,c=n-i+1,u=Math.log(l),f=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1),d=Math.max(i,Math.floor(n-c*f/l+h)),p=Math.min(o,Math.floor(n+(l-c)*f/l+h));t(e,r,n,d,p,s)}var m=r[2*n+s],v=i,g=o;for(a(e,r,i,n),r[2*o+s]>m&&a(e,r,i,o);v<g;){for(a(e,r,v,g),v++,g--;r[2*v+s]<m;)v++;for(;r[2*g+s]>m;)g--}r[2*i+s]===m?a(e,r,i,g):a(e,r,++g,o),g<=n&&(i=g+1),n<=g&&(o=g-1)}}(e,r,l,i,o,s%2);t(e,r,n,i,l-1,s+1);t(e,r,n,l+1,o,s+1)}(this.ids,this.coords,this.nodeSize,0,this.ids.length-1,0)}function i(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}function a(t,e,r,n){o(t,r,n),o(e,2*r,2*n),o(e,2*r+1,2*n+1)}function o(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n,n.prototype.range=function(t,e,r,n){for(var i,a,o=this.ids,s=this.coords,l=this.nodeSize,c=[0,o.length-1,0],u=[];c.length;){var f=c.pop(),h=c.pop(),d=c.pop();if(h-d<=l)for(var p=d;p<=h;p++)i=s[2*p],a=s[2*p+1],i>=t&&i<=r&&a>=e&&a<=n&&u.push(o[p]);else{var m=Math.floor((d+h)/2);i=s[2*m],a=s[2*m+1],i>=t&&i<=r&&a>=e&&a<=n&&u.push(o[m]);var v=(f+1)%2;(0===f?t<=i:e<=a)&&(c.push(d),c.push(m-1),c.push(v)),(0===f?r>=i:n>=a)&&(c.push(m+1),c.push(h),c.push(v))}}return u},n.prototype.within=function(t,e,r){for(var n=this.ids,a=this.coords,o=this.nodeSize,s=[0,n.length-1,0],l=[],c=r*r;s.length;){var u=s.pop(),f=s.pop(),h=s.pop();if(f-h<=o)for(var d=h;d<=f;d++)i(a[2*d],a[2*d+1],t,e)<=c&&l.push(n[d]);else{var p=Math.floor((h+f)/2),m=a[2*p],v=a[2*p+1];i(m,v,t,e)<=c&&l.push(n[p]);var g=(u+1)%2;(0===u?t-r<=m:e-r<=v)&&(s.push(h),s.push(p-1),s.push(g)),(0===u?t+r>=m:e+r>=v)&&(s.push(p+1),s.push(f),s.push(g))}}return l}},{}],273:[function(t,e,r){e.exports=function(t,e,r){return t*(1-r)+e*r}},{}],274:[function(t,e,r){\"use strict\";function n(t,e){var r;if(c(t)){var l,u=t.stops&&\"object\"==typeof t.stops[0][0],f=u||void 0!==t.property,h=u||!f,d=t.type||e||\"exponential\";if(\"exponential\"===d)l=o;else if(\"interval\"===d)l=a;else if(\"categorical\"===d)l=i;else{if(\"identity\"!==d)throw new Error('Unknown function type \"'+d+'\"');l=s}if(u){for(var p={},m=[],v=0;v<t.stops.length;v++){var g=t.stops[v];void 0===p[g[0].zoom]&&(p[g[0].zoom]={zoom:g[0].zoom,type:t.type,property:t.property,stops:[]}),p[g[0].zoom].stops.push([g[0].value,g[1]])}for(var y in p)m.push([p[y].zoom,n(p[y])]);(r=function(e,r){return o({stops:m,base:t.base},e)(e,r)}).isFeatureConstant=!1,r.isZoomConstant=!1}else h?((r=function(e){return l(t,e)}).isFeatureConstant=!0,r.isZoomConstant=!1):((r=function(e,r){return l(t,r[t.property])}).isFeatureConstant=!1,r.isZoomConstant=!0)}else(r=function(){return t}).isFeatureConstant=!0,r.isZoomConstant=!0;return r}function i(t,e){for(var r=0;r<t.stops.length;r++)if(e===t.stops[r][0])return t.stops[r][1];return t.stops[0][1]}function a(t,e){for(var r=0;r<t.stops.length&&!(e<t.stops[r][0]);r++);return t.stops[Math.max(r-1,0)][1]}function o(t,e){for(var r=void 0!==t.base?t.base:1,n=0;!(n>=t.stops.length||e<=t.stops[n][0]);)n++;return 0===n?t.stops[n][1]:n===t.stops.length?t.stops[n-1][1]:function t(e,r,n,i,a,o){return\"function\"==typeof a?function(){var s=a.apply(void 0,arguments),l=o.apply(void 0,arguments);return t(e,r,n,i,s,l)}:a.length?function(t,e,r,n,i,a){for(var o=[],s=0;s<i.length;s++)o[s]=l(t,e,r,n,i[s],a[s]);return o}(e,r,n,i,a,o):l(e,r,n,i,a,o)}(e,r,t.stops[n-1][0],t.stops[n][0],t.stops[n-1][1],t.stops[n][1])}function s(t,e){return e}function l(t,e,r,n,i,a){var o,s=n-r,l=t-r;return i*(1-(o=1===e?l/s:(Math.pow(e,l)-1)/(Math.pow(e,s)-1)))+a*o}function c(t){return\"object\"==typeof t&&(t.stops||\"identity\"===t.type)}e.exports.isFunctionDefinition=c,e.exports.interpolated=function(t){return n(t,\"exponential\")},e.exports[\"piecewise-constant\"]=function(t){return n(t,\"interval\")}},{}],275:[function(t,e,r){t(\"path\");e.exports={debug:{fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform lowp vec4 u_color;\\n\\nvoid main() {\\n gl_FragColor = u_color;\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nattribute vec2 a_pos;\\n\\nuniform mat4 u_matrix;\\n\\nvoid main() {\\n gl_Position = u_matrix * vec4(a_pos, step(32767.0, a_pos.x), 1);\\n}\\n\"},fill:{fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\n#pragma mapbox: define lowp vec4 color\\n#pragma mapbox: define lowp float opacity\\n\\nvoid main() {\\n #pragma mapbox: initialize lowp vec4 color\\n #pragma mapbox: initialize lowp float opacity\\n\\n gl_FragColor = color * opacity;\\n\\n#ifdef OVERDRAW_INSPECTOR\\n gl_FragColor = vec4(1.0);\\n#endif\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nattribute vec2 a_pos;\\n\\nuniform mat4 u_matrix;\\n\\n#pragma mapbox: define lowp vec4 color\\n#pragma mapbox: define lowp float opacity\\n\\nvoid main() {\\n #pragma mapbox: initialize lowp vec4 color\\n #pragma mapbox: initialize lowp float opacity\\n\\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\\n}\\n\"},circle:{fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\n#pragma mapbox: define lowp vec4 color\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\n\\nvarying vec2 v_extrude;\\nvarying lowp float v_antialiasblur;\\n\\nvoid main() {\\n #pragma mapbox: initialize lowp vec4 color\\n #pragma mapbox: initialize lowp float blur\\n #pragma mapbox: initialize lowp float opacity\\n\\n float t = smoothstep(1.0 - max(blur, v_antialiasblur), 1.0, length(v_extrude));\\n gl_FragColor = color * (1.0 - t) * opacity;\\n\\n#ifdef OVERDRAW_INSPECTOR\\n gl_FragColor = vec4(1.0);\\n#endif\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform mat4 u_matrix;\\nuniform bool u_scale_with_map;\\nuniform vec2 u_extrude_scale;\\nuniform float u_devicepixelratio;\\n\\nattribute vec2 a_pos;\\n\\n#pragma mapbox: define lowp vec4 color\\n#pragma mapbox: define mediump float radius\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\n\\nvarying vec2 v_extrude;\\nvarying lowp float v_antialiasblur;\\n\\nvoid main(void) {\\n #pragma mapbox: initialize lowp vec4 color\\n #pragma mapbox: initialize mediump float radius\\n #pragma mapbox: initialize lowp float blur\\n #pragma mapbox: initialize lowp float opacity\\n\\n // unencode the extrusion vector that we snuck into the a_pos vector\\n v_extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\\n\\n vec2 extrude = v_extrude * radius * u_extrude_scale;\\n // multiply a_pos by 0.5, since we had it * 2 in order to sneak\\n // in extrusion data\\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5), 0, 1);\\n\\n if (u_scale_with_map) {\\n gl_Position.xy += extrude;\\n } else {\\n gl_Position.xy += extrude * gl_Position.w;\\n }\\n\\n // This is a minimum blur distance that serves as a faux-antialiasing for\\n // the circle. since blur is a ratio of the circle's size and the intent is\\n // to keep the blur at roughly 1px, the two are inversely related.\\n v_antialiasblur = 1.0 / u_devicepixelratio / radius;\\n}\\n\"},line:{fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform lowp vec4 u_color;\\nuniform lowp float u_opacity;\\nuniform float u_blur;\\n\\nvarying vec2 v_linewidth;\\nvarying vec2 v_normal;\\nvarying float v_gamma_scale;\\n\\nvoid main() {\\n // Calculate the distance of the pixel from the line in pixels.\\n float dist = length(v_normal) * v_linewidth.s;\\n\\n // Calculate the antialiasing fade factor. This is either when fading in\\n // the line in case of an offset line (v_linewidth.t) or when fading out\\n // (v_linewidth.s)\\n float blur = u_blur * v_gamma_scale;\\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\\n\\n gl_FragColor = u_color * (alpha * u_opacity);\\n\\n#ifdef OVERDRAW_INSPECTOR\\n gl_FragColor = vec4(1.0);\\n#endif\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\n// floor(127 / 2) == 63.0\\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\\n// there are also \\\"special\\\" normals that have a bigger length (of up to 126 in\\n// this case).\\n// #define scale 63.0\\n#define scale 0.015873016\\n\\nattribute vec2 a_pos;\\nattribute vec4 a_data;\\n\\nuniform mat4 u_matrix;\\nuniform mediump float u_ratio;\\nuniform mediump float u_linewidth;\\nuniform mediump float u_gapwidth;\\nuniform mediump float u_antialiasing;\\nuniform mediump float u_extra;\\nuniform mat2 u_antialiasingmatrix;\\nuniform mediump float u_offset;\\nuniform mediump float u_blur;\\n\\nvarying vec2 v_normal;\\nvarying vec2 v_linewidth;\\nvarying float v_gamma_scale;\\n\\nvoid main() {\\n vec2 a_extrude = a_data.xy - 128.0;\\n float a_direction = mod(a_data.z, 4.0) - 1.0;\\n\\n // We store the texture normals in the most insignificant bit\\n // transform y so that 0 => -1 and 1 => 1\\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\\n // y is 1 if the normal points up, and -1 if it points down\\n mediump vec2 normal = mod(a_pos, 2.0);\\n normal.y = sign(normal.y - 0.5);\\n v_normal = normal;\\n\\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\\n\\n // Scale the extrusion vector down to a normal and then up by the line width\\n // of this vertex.\\n mediump vec2 dist = outset * a_extrude * scale;\\n\\n // Calculate the offset when drawing a line that is to the side of the actual line.\\n // We do this by creating a vector that points towards the extrude, but rotate\\n // it when we're drawing round end points (a_direction = -1 or 1) since their\\n // extrude vector points in another direction.\\n mediump float u = 0.5 * a_direction;\\n mediump float t = 1.0 - abs(u);\\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\\n\\n // Remove the texture normal bit of the position before scaling it with the\\n // model/view matrix.\\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\\n\\n // position of y on the screen\\n float y = gl_Position.y / gl_Position.w;\\n\\n // how much features are squished in the y direction by the tilt\\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\\n\\n // how much features are squished in all directions by the perspectiveness\\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\\n\\n v_linewidth = vec2(outset, inset);\\n v_gamma_scale = perspective_scale * squish_scale;\\n}\\n\"},linepattern:{fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform float u_blur;\\n\\nuniform vec2 u_pattern_size_a;\\nuniform vec2 u_pattern_size_b;\\nuniform vec2 u_pattern_tl_a;\\nuniform vec2 u_pattern_br_a;\\nuniform vec2 u_pattern_tl_b;\\nuniform vec2 u_pattern_br_b;\\nuniform float u_fade;\\nuniform float u_opacity;\\n\\nuniform sampler2D u_image;\\n\\nvarying vec2 v_normal;\\nvarying vec2 v_linewidth;\\nvarying float v_linesofar;\\nvarying float v_gamma_scale;\\n\\nvoid main() {\\n // Calculate the distance of the pixel from the line in pixels.\\n float dist = length(v_normal) * v_linewidth.s;\\n\\n // Calculate the antialiasing fade factor. This is either when fading in\\n // the line in case of an offset line (v_linewidth.t) or when fading out\\n // (v_linewidth.s)\\n float blur = u_blur * v_gamma_scale;\\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\\n\\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\\n float y_a = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_a.y);\\n float y_b = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_b.y);\\n vec2 pos_a = mix(u_pattern_tl_a, u_pattern_br_a, vec2(x_a, y_a));\\n vec2 pos_b = mix(u_pattern_tl_b, u_pattern_br_b, vec2(x_b, y_b));\\n\\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\\n\\n alpha *= u_opacity;\\n\\n gl_FragColor = color * alpha;\\n\\n#ifdef OVERDRAW_INSPECTOR\\n gl_FragColor = vec4(1.0);\\n#endif\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\n// floor(127 / 2) == 63.0\\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\\n// there are also \\\"special\\\" normals that have a bigger length (of up to 126 in\\n// this case).\\n// #define scale 63.0\\n#define scale 0.015873016\\n\\n// We scale the distance before adding it to the buffers so that we can store\\n// long distances for long segments. Use this value to unscale the distance.\\n#define LINE_DISTANCE_SCALE 2.0\\n\\nattribute vec2 a_pos;\\nattribute vec4 a_data;\\n\\nuniform mat4 u_matrix;\\nuniform mediump float u_ratio;\\nuniform mediump float u_linewidth;\\nuniform mediump float u_gapwidth;\\nuniform mediump float u_antialiasing;\\nuniform mediump float u_extra;\\nuniform mat2 u_antialiasingmatrix;\\nuniform mediump float u_offset;\\n\\nvarying vec2 v_normal;\\nvarying vec2 v_linewidth;\\nvarying float v_linesofar;\\nvarying float v_gamma_scale;\\n\\nvoid main() {\\n vec2 a_extrude = a_data.xy - 128.0;\\n float a_direction = mod(a_data.z, 4.0) - 1.0;\\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\\n\\n // We store the texture normals in the most insignificant bit\\n // transform y so that 0 => -1 and 1 => 1\\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\\n // y is 1 if the normal points up, and -1 if it points down\\n mediump vec2 normal = mod(a_pos, 2.0);\\n normal.y = sign(normal.y - 0.5);\\n v_normal = normal;\\n\\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\\n\\n // Scale the extrusion vector down to a normal and then up by the line width\\n // of this vertex.\\n mediump vec2 dist = outset * a_extrude * scale;\\n\\n // Calculate the offset when drawing a line that is to the side of the actual line.\\n // We do this by creating a vector that points towards the extrude, but rotate\\n // it when we're drawing round end points (a_direction = -1 or 1) since their\\n // extrude vector points in another direction.\\n mediump float u = 0.5 * a_direction;\\n mediump float t = 1.0 - abs(u);\\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\\n\\n // Remove the texture normal bit of the position before scaling it with the\\n // model/view matrix.\\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\\n v_linesofar = a_linesofar;\\n\\n // position of y on the screen\\n float y = gl_Position.y / gl_Position.w;\\n\\n // how much features are squished in the y direction by the tilt\\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\\n\\n // how much features are squished in all directions by the perspectiveness\\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\\n\\n v_linewidth = vec2(outset, inset);\\n v_gamma_scale = perspective_scale * squish_scale;\\n}\\n\"},linesdfpattern:{fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform lowp vec4 u_color;\\nuniform lowp float u_opacity;\\n\\nuniform float u_blur;\\nuniform sampler2D u_image;\\nuniform float u_sdfgamma;\\nuniform float u_mix;\\n\\nvarying vec2 v_normal;\\nvarying vec2 v_linewidth;\\nvarying vec2 v_tex_a;\\nvarying vec2 v_tex_b;\\nvarying float v_gamma_scale;\\n\\nvoid main() {\\n // Calculate the distance of the pixel from the line in pixels.\\n float dist = length(v_normal) * v_linewidth.s;\\n\\n // Calculate the antialiasing fade factor. This is either when fading in\\n // the line in case of an offset line (v_linewidth.t) or when fading out\\n // (v_linewidth.s)\\n float blur = u_blur * v_gamma_scale;\\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\\n\\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\\n alpha *= smoothstep(0.5 - u_sdfgamma, 0.5 + u_sdfgamma, sdfdist);\\n\\n gl_FragColor = u_color * (alpha * u_opacity);\\n\\n#ifdef OVERDRAW_INSPECTOR\\n gl_FragColor = vec4(1.0);\\n#endif\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\n// floor(127 / 2) == 63.0\\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\\n// there are also \\\"special\\\" normals that have a bigger length (of up to 126 in\\n// this case).\\n// #define scale 63.0\\n#define scale 0.015873016\\n\\n// We scale the distance before adding it to the buffers so that we can store\\n// long distances for long segments. Use this value to unscale the distance.\\n#define LINE_DISTANCE_SCALE 2.0\\n\\nattribute vec2 a_pos;\\nattribute vec4 a_data;\\n\\nuniform mat4 u_matrix;\\nuniform mediump float u_ratio;\\nuniform mediump float u_linewidth;\\nuniform mediump float u_gapwidth;\\nuniform mediump float u_antialiasing;\\nuniform vec2 u_patternscale_a;\\nuniform float u_tex_y_a;\\nuniform vec2 u_patternscale_b;\\nuniform float u_tex_y_b;\\nuniform float u_extra;\\nuniform mat2 u_antialiasingmatrix;\\nuniform mediump float u_offset;\\n\\nvarying vec2 v_normal;\\nvarying vec2 v_linewidth;\\nvarying vec2 v_tex_a;\\nvarying vec2 v_tex_b;\\nvarying float v_gamma_scale;\\n\\nvoid main() {\\n vec2 a_extrude = a_data.xy - 128.0;\\n float a_direction = mod(a_data.z, 4.0) - 1.0;\\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\\n\\n // We store the texture normals in the most insignificant bit\\n // transform y so that 0 => -1 and 1 => 1\\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\\n // y is 1 if the normal points up, and -1 if it points down\\n mediump vec2 normal = mod(a_pos, 2.0);\\n normal.y = sign(normal.y - 0.5);\\n v_normal = normal;\\n\\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\\n\\n // Scale the extrusion vector down to a normal and then up by the line width\\n // of this vertex.\\n mediump vec2 dist = outset * a_extrude * scale;\\n\\n // Calculate the offset when drawing a line that is to the side of the actual line.\\n // We do this by creating a vector that points towards the extrude, but rotate\\n // it when we're drawing round end points (a_direction = -1 or 1) since their\\n // extrude vector points in another direction.\\n mediump float u = 0.5 * a_direction;\\n mediump float t = 1.0 - abs(u);\\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\\n\\n // Remove the texture normal bit of the position before scaling it with the\\n // model/view matrix.\\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\\n\\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x, normal.y * u_patternscale_a.y + u_tex_y_a);\\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x, normal.y * u_patternscale_b.y + u_tex_y_b);\\n\\n // position of y on the screen\\n float y = gl_Position.y / gl_Position.w;\\n\\n // how much features are squished in the y direction by the tilt\\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\\n\\n // how much features are squished in all directions by the perspectiveness\\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\\n\\n v_linewidth = vec2(outset, inset);\\n v_gamma_scale = perspective_scale * squish_scale;\\n}\\n\"},outline:{fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\n#pragma mapbox: define lowp vec4 outline_color\\n#pragma mapbox: define lowp float opacity\\n\\nvarying vec2 v_pos;\\n\\nvoid main() {\\n #pragma mapbox: initialize lowp vec4 outline_color\\n #pragma mapbox: initialize lowp float opacity\\n\\n float dist = length(v_pos - gl_FragCoord.xy);\\n float alpha = smoothstep(1.0, 0.0, dist);\\n gl_FragColor = outline_color * (alpha * opacity);\\n\\n#ifdef OVERDRAW_INSPECTOR\\n gl_FragColor = vec4(1.0);\\n#endif\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nattribute vec2 a_pos;\\n\\nuniform mat4 u_matrix;\\nuniform vec2 u_world;\\n\\nvarying vec2 v_pos;\\n\\n#pragma mapbox: define lowp vec4 outline_color\\n#pragma mapbox: define lowp float opacity\\n\\nvoid main() {\\n #pragma mapbox: initialize lowp vec4 outline_color\\n #pragma mapbox: initialize lowp float opacity\\n\\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\\n}\\n\"},outlinepattern:{fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform float u_opacity;\\nuniform vec2 u_pattern_tl_a;\\nuniform vec2 u_pattern_br_a;\\nuniform vec2 u_pattern_tl_b;\\nuniform vec2 u_pattern_br_b;\\nuniform float u_mix;\\n\\nuniform sampler2D u_image;\\n\\nvarying vec2 v_pos_a;\\nvarying vec2 v_pos_b;\\nvarying vec2 v_pos;\\n\\nvoid main() {\\n vec2 imagecoord = mod(v_pos_a, 1.0);\\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\\n vec4 color1 = texture2D(u_image, pos);\\n\\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\\n vec4 color2 = texture2D(u_image, pos2);\\n\\n // find distance to outline for alpha interpolation\\n\\n float dist = length(v_pos - gl_FragCoord.xy);\\n float alpha = smoothstep(1.0, 0.0, dist);\\n \\n\\n gl_FragColor = mix(color1, color2, u_mix) * alpha * u_opacity;\\n\\n#ifdef OVERDRAW_INSPECTOR\\n gl_FragColor = vec4(1.0);\\n#endif\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform vec2 u_pattern_size_a;\\nuniform vec2 u_pattern_size_b;\\nuniform vec2 u_pixel_coord_upper;\\nuniform vec2 u_pixel_coord_lower;\\nuniform float u_scale_a;\\nuniform float u_scale_b;\\nuniform float u_tile_units_to_pixels;\\n\\nattribute vec2 a_pos;\\n\\nuniform mat4 u_matrix;\\nuniform vec2 u_world;\\n\\nvarying vec2 v_pos_a;\\nvarying vec2 v_pos_b;\\nvarying vec2 v_pos;\\n\\nvoid main() {\\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\\n\\n // the correct offset needs to be calculated.\\n //\\n // The offset depends on how many pixels are between the world origin and\\n // the edge of the tile:\\n // vec2 offset = mod(pixel_coord, size)\\n //\\n // At high zoom levels there are a ton of pixels between the world origin\\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\\n // precision for highp floats. We need more than that.\\n //\\n // The pixel_coord is passed in as two 16 bit values:\\n // pixel_coord_upper = floor(pixel_coord / 2^16)\\n // pixel_coord_lower = mod(pixel_coord, 2^16)\\n //\\n // The offset is calculated in a series of steps that should preserve this precision:\\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\\n\\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\\n\\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\\n}\\n\"},pattern:{fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform float u_opacity;\\nuniform vec2 u_pattern_tl_a;\\nuniform vec2 u_pattern_br_a;\\nuniform vec2 u_pattern_tl_b;\\nuniform vec2 u_pattern_br_b;\\nuniform float u_mix;\\n\\nuniform sampler2D u_image;\\n\\nvarying vec2 v_pos_a;\\nvarying vec2 v_pos_b;\\n\\nvoid main() {\\n\\n vec2 imagecoord = mod(v_pos_a, 1.0);\\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\\n vec4 color1 = texture2D(u_image, pos);\\n\\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\\n vec4 color2 = texture2D(u_image, pos2);\\n\\n gl_FragColor = mix(color1, color2, u_mix) * u_opacity;\\n\\n#ifdef OVERDRAW_INSPECTOR\\n gl_FragColor = vec4(1.0);\\n#endif\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform mat4 u_matrix;\\nuniform vec2 u_pattern_size_a;\\nuniform vec2 u_pattern_size_b;\\nuniform vec2 u_pixel_coord_upper;\\nuniform vec2 u_pixel_coord_lower;\\nuniform float u_scale_a;\\nuniform float u_scale_b;\\nuniform float u_tile_units_to_pixels;\\n\\nattribute vec2 a_pos;\\n\\nvarying vec2 v_pos_a;\\nvarying vec2 v_pos_b;\\n\\nvoid main() {\\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\\n\\n // the correct offset needs to be calculated.\\n //\\n // The offset depends on how many pixels are between the world origin and\\n // the edge of the tile:\\n // vec2 offset = mod(pixel_coord, size)\\n //\\n // At high zoom levels there are a ton of pixels between the world origin\\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\\n // precision for highp floats. We need more than that.\\n //\\n // The pixel_coord is passed in as two 16 bit values:\\n // pixel_coord_upper = floor(pixel_coord / 2^16)\\n // pixel_coord_lower = mod(pixel_coord, 2^16)\\n //\\n // The offset is calculated in a series of steps that should preserve this precision:\\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\\n\\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\\n}\\n\"},raster:{fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform float u_opacity0;\\nuniform float u_opacity1;\\nuniform sampler2D u_image0;\\nuniform sampler2D u_image1;\\nvarying vec2 v_pos0;\\nvarying vec2 v_pos1;\\n\\nuniform float u_brightness_low;\\nuniform float u_brightness_high;\\n\\nuniform float u_saturation_factor;\\nuniform float u_contrast_factor;\\nuniform vec3 u_spin_weights;\\n\\nvoid main() {\\n\\n // read and cross-fade colors from the main and parent tiles\\n vec4 color0 = texture2D(u_image0, v_pos0);\\n vec4 color1 = texture2D(u_image1, v_pos1);\\n vec4 color = color0 * u_opacity0 + color1 * u_opacity1;\\n vec3 rgb = color.rgb;\\n\\n // spin\\n rgb = vec3(\\n dot(rgb, u_spin_weights.xyz),\\n dot(rgb, u_spin_weights.zxy),\\n dot(rgb, u_spin_weights.yzx));\\n\\n // saturation\\n float average = (color.r + color.g + color.b) / 3.0;\\n rgb += (average - rgb) * u_saturation_factor;\\n\\n // contrast\\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\\n\\n // brightness\\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\\n\\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb), color.a);\\n\\n#ifdef OVERDRAW_INSPECTOR\\n gl_FragColor = vec4(1.0);\\n#endif\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform mat4 u_matrix;\\nuniform vec2 u_tl_parent;\\nuniform float u_scale_parent;\\nuniform float u_buffer_scale;\\n\\nattribute vec2 a_pos;\\nattribute vec2 a_texture_pos;\\n\\nvarying vec2 v_pos0;\\nvarying vec2 v_pos1;\\n\\nvoid main() {\\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\\n v_pos0 = (((a_texture_pos / 32767.0) - 0.5) / u_buffer_scale ) + 0.5;\\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\\n}\\n\"},icon:{fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform sampler2D u_texture;\\nuniform sampler2D u_fadetexture;\\nuniform lowp float u_opacity;\\n\\nvarying vec2 v_tex;\\nvarying vec2 v_fade_tex;\\n\\nvoid main() {\\n lowp float alpha = texture2D(u_fadetexture, v_fade_tex).a * u_opacity;\\n gl_FragColor = texture2D(u_texture, v_tex) * alpha;\\n\\n#ifdef OVERDRAW_INSPECTOR\\n gl_FragColor = vec4(1.0);\\n#endif\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nattribute vec2 a_pos;\\nattribute vec2 a_offset;\\nattribute vec2 a_texture_pos;\\nattribute vec4 a_data;\\n\\n\\n// matrix is for the vertex position.\\nuniform mat4 u_matrix;\\n\\nuniform mediump float u_zoom;\\nuniform bool u_rotate_with_map;\\nuniform vec2 u_extrude_scale;\\n\\nuniform vec2 u_texsize;\\n\\nvarying vec2 v_tex;\\nvarying vec2 v_fade_tex;\\n\\nvoid main() {\\n vec2 a_tex = a_texture_pos.xy;\\n mediump float a_labelminzoom = a_data[0];\\n mediump vec2 a_zoom = a_data.pq;\\n mediump float a_minzoom = a_zoom[0];\\n mediump float a_maxzoom = a_zoom[1];\\n\\n // u_zoom is the current zoom level adjusted for the change in font size\\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\\n\\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\\n if (u_rotate_with_map) {\\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\\n gl_Position.z += z * gl_Position.w;\\n } else {\\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\\n }\\n\\n v_tex = a_tex / u_texsize;\\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\\n}\\n\"},sdf:{fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform sampler2D u_texture;\\nuniform sampler2D u_fadetexture;\\nuniform lowp vec4 u_color;\\nuniform lowp float u_opacity;\\nuniform lowp float u_buffer;\\nuniform lowp float u_gamma;\\n\\nvarying vec2 v_tex;\\nvarying vec2 v_fade_tex;\\nvarying float v_gamma_scale;\\n\\nvoid main() {\\n lowp float dist = texture2D(u_texture, v_tex).a;\\n lowp float fade_alpha = texture2D(u_fadetexture, v_fade_tex).a;\\n lowp float gamma = u_gamma * v_gamma_scale;\\n lowp float alpha = smoothstep(u_buffer - gamma, u_buffer + gamma, dist) * fade_alpha;\\n\\n gl_FragColor = u_color * (alpha * u_opacity);\\n\\n#ifdef OVERDRAW_INSPECTOR\\n gl_FragColor = vec4(1.0);\\n#endif\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nconst float PI = 3.141592653589793;\\n\\nattribute vec2 a_pos;\\nattribute vec2 a_offset;\\nattribute vec2 a_texture_pos;\\nattribute vec4 a_data;\\n\\n\\n// matrix is for the vertex position.\\nuniform mat4 u_matrix;\\n\\nuniform mediump float u_zoom;\\nuniform bool u_rotate_with_map;\\nuniform bool u_pitch_with_map;\\nuniform mediump float u_pitch;\\nuniform mediump float u_bearing;\\nuniform mediump float u_aspect_ratio;\\nuniform vec2 u_extrude_scale;\\n\\nuniform vec2 u_texsize;\\n\\nvarying vec2 v_tex;\\nvarying vec2 v_fade_tex;\\nvarying float v_gamma_scale;\\n\\nvoid main() {\\n vec2 a_tex = a_texture_pos.xy;\\n mediump float a_labelminzoom = a_data[0];\\n mediump vec2 a_zoom = a_data.pq;\\n mediump float a_minzoom = a_zoom[0];\\n mediump float a_maxzoom = a_zoom[1];\\n\\n // u_zoom is the current zoom level adjusted for the change in font size\\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\\n\\n // pitch-alignment: map\\n // rotation-alignment: map | viewport\\n if (u_pitch_with_map) {\\n lowp float angle = u_rotate_with_map ? (a_data[1] / 256.0 * 2.0 * PI) : u_bearing;\\n lowp float asin = sin(angle);\\n lowp float acos = cos(angle);\\n mat2 RotationMatrix = mat2(acos, asin, -1.0 * asin, acos);\\n vec2 offset = RotationMatrix * a_offset;\\n vec2 extrude = u_extrude_scale * (offset / 64.0);\\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\\n gl_Position.z += z * gl_Position.w;\\n // pitch-alignment: viewport\\n // rotation-alignment: map\\n } else if (u_rotate_with_map) {\\n // foreshortening factor to apply on pitched maps\\n // as a label goes from horizontal <=> vertical in angle\\n // it goes from 0% foreshortening to up to around 70% foreshortening\\n lowp float pitchfactor = 1.0 - cos(u_pitch * sin(u_pitch * 0.75));\\n\\n lowp float lineangle = a_data[1] / 256.0 * 2.0 * PI;\\n\\n // use the lineangle to position points a,b along the line\\n // project the points and calculate the label angle in projected space\\n // this calculation allows labels to be rendered unskewed on pitched maps\\n vec4 a = u_matrix * vec4(a_pos, 0, 1);\\n vec4 b = u_matrix * vec4(a_pos + vec2(cos(lineangle),sin(lineangle)), 0, 1);\\n lowp float angle = atan((b[1]/b[3] - a[1]/a[3])/u_aspect_ratio, b[0]/b[3] - a[0]/a[3]);\\n lowp float asin = sin(angle);\\n lowp float acos = cos(angle);\\n mat2 RotationMatrix = mat2(acos, -1.0 * asin, asin, acos);\\n\\n vec2 offset = RotationMatrix * (vec2((1.0-pitchfactor)+(pitchfactor*cos(angle*2.0)), 1.0) * a_offset);\\n vec2 extrude = u_extrude_scale * (offset / 64.0);\\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\\n gl_Position.z += z * gl_Position.w;\\n // pitch-alignment: viewport\\n // rotation-alignment: viewport\\n } else {\\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\\n }\\n\\n v_gamma_scale = (gl_Position.w - 0.5);\\n\\n v_tex = a_tex / u_texsize;\\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\\n}\\n\"},collisionbox:{fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform float u_zoom;\\nuniform float u_maxzoom;\\n\\nvarying float v_max_zoom;\\nvarying float v_placement_zoom;\\n\\nvoid main() {\\n\\n float alpha = 0.5;\\n\\n gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0) * alpha;\\n\\n if (v_placement_zoom > u_zoom) {\\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\\n }\\n\\n if (u_zoom >= v_max_zoom) {\\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0) * alpha * 0.25;\\n }\\n\\n if (v_placement_zoom >= u_maxzoom) {\\n gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0) * alpha * 0.2;\\n }\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nattribute vec2 a_pos;\\nattribute vec2 a_extrude;\\nattribute vec2 a_data;\\n\\nuniform mat4 u_matrix;\\nuniform float u_scale;\\n\\nvarying float v_max_zoom;\\nvarying float v_placement_zoom;\\n\\nvoid main() {\\n gl_Position = u_matrix * vec4(a_pos + a_extrude / u_scale, 0.0, 1.0);\\n\\n v_max_zoom = a_data.x;\\n v_placement_zoom = a_data.y;\\n}\\n\"}},e.exports.util=\"float evaluate_zoom_function_1(const vec4 values, const float t) {\\n if (t < 1.0) {\\n return mix(values[0], values[1], t);\\n } else if (t < 2.0) {\\n return mix(values[1], values[2], t - 1.0);\\n } else {\\n return mix(values[2], values[3], t - 2.0);\\n }\\n}\\nvec4 evaluate_zoom_function_4(const vec4 value0, const vec4 value1, const vec4 value2, const vec4 value3, const float t) {\\n if (t < 1.0) {\\n return mix(value0, value1, t);\\n } else if (t < 2.0) {\\n return mix(value1, value2, t - 1.0);\\n } else {\\n return mix(value2, value3, t - 2.0);\\n }\\n}\\n\"},{path:449}],276:[function(t,e,r){\"use strict\";var n=t(\"util\").format;e.exports=function(t,e){this.message=(t?t+\": \":\"\")+n.apply(n,Array.prototype.slice.call(arguments,2)),null!==e&&void 0!==e&&e.__line__&&(this.line=e.__line__)}},{util:543}],277:[function(t,e,r){\"use strict\";e.exports=function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)t[n]=r[n]}return t}},{}],278:[function(t,e,r){\"use strict\";e.exports=function(t){return t instanceof Number?\"number\":t instanceof String?\"string\":t instanceof Boolean?\"boolean\":Array.isArray(t)?\"array\":null===t?\"null\":typeof t}},{}],279:[function(t,e,r){\"use strict\";e.exports=function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}},{}],280:[function(t,e,r){\"use strict\";var n=t(\"../error/validation_error\"),i=t(\"../util/get_type\"),a=t(\"../util/extend\");e.exports=function(e){var r=t(\"./validate_function\"),o=t(\"./validate_object\"),s={\"*\":function(){return[]},array:t(\"./validate_array\"),boolean:t(\"./validate_boolean\"),number:t(\"./validate_number\"),color:t(\"./validate_color\"),constants:t(\"./validate_constants\"),enum:t(\"./validate_enum\"),filter:t(\"./validate_filter\"),function:t(\"./validate_function\"),layer:t(\"./validate_layer\"),object:t(\"./validate_object\"),source:t(\"./validate_source\"),string:t(\"./validate_string\")},l=e.value,c=e.valueSpec,u=e.key,f=e.styleSpec,h=e.style;if(\"string\"===i(l)&&\"@\"===l[0]){if(f.$version>7)return[new n(u,l,\"constants have been deprecated as of v8\")];if(!(l in h.constants))return[new n(u,l,'constant \"%s\" not found',l)];e=a({},e,{value:h.constants[l]})}return c.function&&\"object\"===i(l)?r(e):c.type&&s[c.type]?s[c.type](e):o(a({},e,{valueSpec:c.type?f[c.type]:c}))}},{\"../error/validation_error\":276,\"../util/extend\":277,\"../util/get_type\":278,\"./validate_array\":281,\"./validate_boolean\":282,\"./validate_color\":283,\"./validate_constants\":284,\"./validate_enum\":285,\"./validate_filter\":286,\"./validate_function\":287,\"./validate_layer\":289,\"./validate_number\":291,\"./validate_object\":292,\"./validate_source\":294,\"./validate_string\":295}],281:[function(t,e,r){\"use strict\";var n=t(\"../util/get_type\"),i=t(\"./validate\"),a=t(\"../error/validation_error\");e.exports=function(t){var e=t.value,r=t.valueSpec,o=t.style,s=t.styleSpec,l=t.key,c=t.arrayElementValidator||i;if(\"array\"!==n(e))return[new a(l,e,\"array expected, %s found\",n(e))];if(r.length&&e.length!==r.length)return[new a(l,e,\"array length %d expected, length %d found\",r.length,e.length)];if(r[\"min-length\"]&&e.length<r[\"min-length\"])return[new a(l,e,\"array length at least %d expected, length %d found\",r[\"min-length\"],e.length)];var u={type:r.value};s.$version<7&&(u.function=r.function),\"object\"===n(r.value)&&(u=r.value);for(var f=[],h=0;h<e.length;h++)f=f.concat(c({array:e,arrayIndex:h,value:e[h],valueSpec:u,style:o,styleSpec:s,key:l+\"[\"+h+\"]\"}));return f}},{\"../error/validation_error\":276,\"../util/get_type\":278,\"./validate\":280}],282:[function(t,e,r){\"use strict\";var n=t(\"../util/get_type\"),i=t(\"../error/validation_error\");e.exports=function(t){var e=t.value,r=t.key,a=n(e);return\"boolean\"!==a?[new i(r,e,\"boolean expected, %s found\",a)]:[]}},{\"../error/validation_error\":276,\"../util/get_type\":278}],283:[function(t,e,r){\"use strict\";var n=t(\"../error/validation_error\"),i=t(\"../util/get_type\"),a=t(\"csscolorparser\").parseCSSColor;e.exports=function(t){var e=t.key,r=t.value,o=i(r);return\"string\"!==o?[new n(e,r,\"color expected, %s found\",o)]:null===a(r)?[new n(e,r,'color expected, \"%s\" found',r)]:[]}},{\"../error/validation_error\":276,\"../util/get_type\":278,csscolorparser:114}],284:[function(t,e,r){\"use strict\";var n=t(\"../error/validation_error\"),i=t(\"../util/get_type\");e.exports=function(t){var e=t.key,r=t.value;if(t.styleSpec.$version>7)return r?[new n(e,r,\"constants have been deprecated as of v8\")]:[];var a=i(r);if(\"object\"!==a)return[new n(e,r,\"object expected, %s found\",a)];var o=[];for(var s in r)\"@\"!==s[0]&&o.push(new n(e+\".\"+s,r[s],'constants must start with \"@\"'));return o}},{\"../error/validation_error\":276,\"../util/get_type\":278}],285:[function(t,e,r){\"use strict\";var n=t(\"../error/validation_error\"),i=t(\"../util/unbundle_jsonlint\");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec,o=[];return-1===a.values.indexOf(i(r))&&o.push(new n(e,r,\"expected one of [%s], %s found\",a.values.join(\", \"),r)),o}},{\"../error/validation_error\":276,\"../util/unbundle_jsonlint\":279}],286:[function(t,e,r){\"use strict\";var n=t(\"../error/validation_error\"),i=t(\"./validate_enum\"),a=t(\"../util/get_type\"),o=t(\"../util/unbundle_jsonlint\");e.exports=function t(e){var r,s=e.value,l=e.key,c=e.styleSpec,u=[];if(\"array\"!==a(s))return[new n(l,s,\"array expected, %s found\",a(s))];if(s.length<1)return[new n(l,s,\"filter array must have at least 1 element\")];switch(u=u.concat(i({key:l+\"[0]\",value:s[0],valueSpec:c.filter_operator,style:e.style,styleSpec:e.styleSpec})),o(s[0])){case\"<\":case\"<=\":case\">\":case\">=\":s.length>=2&&\"$type\"==s[1]&&u.push(new n(l,s,'\"$type\" cannot be use with operator \"%s\"',s[0]));case\"==\":case\"!=\":3!=s.length&&u.push(new n(l,s,'filter array for operator \"%s\" must have 3 elements',s[0]));case\"in\":case\"!in\":s.length>=2&&(\"string\"!==(r=a(s[1]))?u.push(new n(l+\"[1]\",s[1],\"string expected, %s found\",r)):\"@\"===s[1][0]&&u.push(new n(l+\"[1]\",s[1],\"filter key cannot be a constant\")));for(var f=2;f<s.length;f++)r=a(s[f]),\"$type\"==s[1]?u=u.concat(i({key:l+\"[\"+f+\"]\",value:s[f],valueSpec:c.geometry_type,style:e.style,styleSpec:e.styleSpec})):\"string\"===r&&\"@\"===s[f][0]?u.push(new n(l+\"[\"+f+\"]\",s[f],\"filter value cannot be a constant\")):\"string\"!==r&&\"number\"!==r&&\"boolean\"!==r&&u.push(new n(l+\"[\"+f+\"]\",s[f],\"string, number, or boolean expected, %s found\",r));break;case\"any\":case\"all\":case\"none\":for(f=1;f<s.length;f++)u=u.concat(t({key:l+\"[\"+f+\"]\",value:s[f],style:e.style,styleSpec:e.styleSpec}));break;case\"has\":case\"!has\":r=a(s[1]),2!==s.length?u.push(new n(l,s,'filter array for \"%s\" operator must have 2 elements',s[0])):\"string\"!==r?u.push(new n(l+\"[1]\",s[1],\"string expected, %s found\",r)):\"@\"===s[1][0]&&u.push(new n(l+\"[1]\",s[1],\"filter key cannot be a constant\"))}return u}},{\"../error/validation_error\":276,\"../util/get_type\":278,\"../util/unbundle_jsonlint\":279,\"./validate_enum\":285}],287:[function(t,e,r){\"use strict\";var n=t(\"../error/validation_error\"),i=t(\"../util/get_type\"),a=t(\"./validate\"),o=t(\"./validate_object\"),s=t(\"./validate_array\"),l=t(\"./validate_number\");e.exports=function(t){var e,r=t.valueSpec,c=void 0!==t.value.property||\"object\"===e,u=void 0===t.value.property||\"object\"===e,f=o({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){var e=[],r=t.value;e=e.concat(s({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),\"array\"===i(r)&&0===r.length&&e.push(new n(t.key,r,\"array must have at least one stop\"));return e}}});return t.styleSpec.$version>=8&&(c&&!t.valueSpec[\"property-function\"]?f.push(new n(t.key,t.value,\"property functions not supported\")):u&&!t.valueSpec[\"zoom-function\"]&&f.push(new n(t.key,t.value,\"zoom functions not supported\"))),f;function h(t){var s=[],c=t.value,f=t.key;if(\"array\"!==i(c))return[new n(f,c,\"array expected, %s found\",i(c))];if(2!==c.length)return[new n(f,c,\"array length %d expected, length %d found\",2,c.length)];var h=i(c[0]);if(e||(e=h),h!==e)return[new n(f,c,\"%s stop key type must match previous stop key type %s\",h,e)];if(\"object\"===h){if(void 0===c[0].zoom)return[new n(f,c,\"object stop key must have zoom\")];if(void 0===c[0].value)return[new n(f,c,\"object stop key must have value\")];s=s.concat(o({key:f+\"[0]\",value:c[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:l,value:d}}))}else s=s.concat((u?l:d)({key:f+\"[0]\",value:c[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec}));return s=s.concat(a({key:f+\"[1]\",value:c[1],valueSpec:r,style:t.style,styleSpec:t.styleSpec})),\"number\"===i(c[0])&&(\"piecewise-constant\"===r.function&&c[0]%1!=0&&s.push(new n(f+\"[0]\",c[0],\"zoom level for piecewise-constant functions must be an integer\")),0!==t.arrayIndex&&c[0]<t.array[t.arrayIndex-1][0]&&s.push(new n(f+\"[0]\",c[0],\"array stops must appear in ascending order\"))),s}function d(t){var e=[],r=i(t.value);return\"number\"!==r&&\"string\"!==r&&\"array\"!==r&&e.push(new n(t.key,t.value,\"property value must be a number, string or array\")),e}}},{\"../error/validation_error\":276,\"../util/get_type\":278,\"./validate\":280,\"./validate_array\":281,\"./validate_number\":291,\"./validate_object\":292}],288:[function(t,e,r){\"use strict\";var n=t(\"../error/validation_error\"),i=t(\"./validate_string\");e.exports=function(t){var e=t.value,r=t.key,a=i(t);return a.length?a:(-1===e.indexOf(\"{fontstack}\")&&a.push(new n(r,e,'\"glyphs\" url must include a \"{fontstack}\" token')),-1===e.indexOf(\"{range}\")&&a.push(new n(r,e,'\"glyphs\" url must include a \"{range}\" token')),a)}},{\"../error/validation_error\":276,\"./validate_string\":295}],289:[function(t,e,r){\"use strict\";var n=t(\"../error/validation_error\"),i=t(\"../util/unbundle_jsonlint\"),a=t(\"./validate_object\"),o=t(\"./validate_filter\"),s=t(\"./validate_paint_property\"),l=t(\"./validate_layout_property\"),c=t(\"../util/extend\");e.exports=function(t){var e=[],r=t.value,u=t.key,f=t.style,h=t.styleSpec;r.type||r.ref||e.push(new n(u,r,'either \"type\" or \"ref\" is required'));var d,p=i(r.type),m=i(r.ref);if(r.id)for(var v=0;v<t.arrayIndex;v++){var g=f.layers[v];i(g.id)===i(r.id)&&e.push(new n(u,r.id,'duplicate layer id \"%s\", previously used at line %d',r.id,g.id.__line__))}if(\"ref\"in r)[\"type\",\"source\",\"source-layer\",\"filter\",\"layout\"].forEach(function(t){t in r&&e.push(new n(u,r[t],'\"%s\" is prohibited for ref layers',t))}),f.layers.forEach(function(t){t.id==m&&(d=t)}),d?d.ref?e.push(new n(u,r.ref,\"ref cannot reference another ref layer\")):p=i(d.type):e.push(new n(u,r.ref,'ref layer \"%s\" not found',m));else if(\"background\"!==p)if(r.source){var y=f.sources&&f.sources[r.source];y?\"vector\"==y.type&&\"raster\"==p?e.push(new n(u,r.source,'layer \"%s\" requires a raster source',r.id)):\"raster\"==y.type&&\"raster\"!=p?e.push(new n(u,r.source,'layer \"%s\" requires a vector source',r.id)):\"vector\"!=y.type||r[\"source-layer\"]||e.push(new n(u,r,'layer \"%s\" must specify a \"source-layer\"',r.id)):e.push(new n(u,r.source,'source \"%s\" not found',r.source))}else e.push(new n(u,r,'missing required property \"source\"'));return e=e.concat(a({key:u,value:r,valueSpec:h.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{filter:o,layout:function(t){return a({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{\"*\":function(t){return l(c({layerType:p},t))}}})},paint:function(t){return a({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{\"*\":function(t){return s(c({layerType:p},t))}}})}}}))}},{\"../error/validation_error\":276,\"../util/extend\":277,\"../util/unbundle_jsonlint\":279,\"./validate_filter\":286,\"./validate_layout_property\":290,\"./validate_object\":292,\"./validate_paint_property\":293}],290:[function(t,e,r){\"use strict\";var n=t(\"./validate\"),i=t(\"../error/validation_error\");e.exports=function(t){var e=t.key,r=t.style,a=t.styleSpec,o=t.value,s=t.objectKey,l=a[\"layout_\"+t.layerType];if(t.valueSpec||l[s]){var c=[];return\"symbol\"===t.layerType&&(\"icon-image\"===s&&r&&!r.sprite?c.push(new i(e,o,'use of \"icon-image\" requires a style \"sprite\" property')):\"text-field\"===s&&r&&!r.glyphs&&c.push(new i(e,o,'use of \"text-field\" requires a style \"glyphs\" property'))),c.concat(n({key:t.key,value:o,valueSpec:t.valueSpec||l[s],style:r,styleSpec:a}))}return[new i(e,o,'unknown property \"%s\"',s)]}},{\"../error/validation_error\":276,\"./validate\":280}],291:[function(t,e,r){\"use strict\";var n=t(\"../util/get_type\"),i=t(\"../error/validation_error\");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec,o=n(r);return\"number\"!==o?[new i(e,r,\"number expected, %s found\",o)]:\"minimum\"in a&&r<a.minimum?[new i(e,r,\"%s is less than the minimum value %s\",r,a.minimum)]:\"maximum\"in a&&r>a.maximum?[new i(e,r,\"%s is greater than the maximum value %s\",r,a.maximum)]:[]}},{\"../error/validation_error\":276,\"../util/get_type\":278}],292:[function(t,e,r){\"use strict\";var n=t(\"../error/validation_error\"),i=t(\"../util/get_type\"),a=t(\"./validate\");e.exports=function(t){var e=t.key,r=t.value,o=t.valueSpec,s=t.objectElementValidators||{},l=t.style,c=t.styleSpec,u=[],f=i(r);if(\"object\"!==f)return[new n(e,r,\"object expected, %s found\",f)];for(var h in r){var d=h.split(\".\")[0],p=o&&(o[d]||o[\"*\"]),m=s[d]||s[\"*\"];p||m?u=u.concat((m||a)({key:(e?e+\".\":e)+h,value:r[h],valueSpec:p,style:l,styleSpec:c,object:r,objectKey:h})):\"\"!==e&&1!==e.split(\".\").length&&u.push(new n(e,r[h],'unknown property \"%s\"',h))}for(d in o)o[d].required&&void 0===o[d].default&&void 0===r[d]&&u.push(new n(e,r,'missing required property \"%s\"',d));return u}},{\"../error/validation_error\":276,\"../util/get_type\":278,\"./validate\":280}],293:[function(t,e,r){\"use strict\";var n=t(\"./validate\"),i=t(\"../error/validation_error\");e.exports=function(t){var e=t.key,r=t.style,a=t.styleSpec,o=t.value,s=t.objectKey,l=a[\"paint_\"+t.layerType],c=s.match(/^(.*)-transition$/);return c&&l[c[1]]&&l[c[1]].transition?n({key:e,value:o,valueSpec:a.transition,style:r,styleSpec:a}):t.valueSpec||l[s]?n({key:t.key,value:o,valueSpec:t.valueSpec||l[s],style:r,styleSpec:a}):[new i(e,o,'unknown property \"%s\"',s)]}},{\"../error/validation_error\":276,\"./validate\":280}],294:[function(t,e,r){\"use strict\";var n=t(\"../error/validation_error\"),i=t(\"../util/unbundle_jsonlint\"),a=t(\"./validate_object\"),o=t(\"./validate_enum\");e.exports=function(t){var e=t.value,r=t.key,s=t.styleSpec,l=t.style;if(!e.type)return[new n(r,e,'\"type\" is required')];switch(i(e.type)){case\"vector\":case\"raster\":var c=[];if(c=c.concat(a({key:r,value:e,valueSpec:s.source_tile,style:t.style,styleSpec:s})),\"url\"in e)for(var u in e)[\"type\",\"url\",\"tileSize\"].indexOf(u)<0&&c.push(new n(r+\".\"+u,e[u],'a source with a \"url\" property may not include a \"%s\" property',u));return c;case\"geojson\":return a({key:r,value:e,valueSpec:s.source_geojson,style:l,styleSpec:s});case\"video\":return a({key:r,value:e,valueSpec:s.source_video,style:l,styleSpec:s});case\"image\":return a({key:r,value:e,valueSpec:s.source_image,style:l,styleSpec:s});default:return o({key:r+\".type\",value:e.type,valueSpec:{values:[\"vector\",\"raster\",\"geojson\",\"video\",\"image\"]},style:l,styleSpec:s})}}},{\"../error/validation_error\":276,\"../util/unbundle_jsonlint\":279,\"./validate_enum\":285,\"./validate_object\":292}],295:[function(t,e,r){\"use strict\";var n=t(\"../util/get_type\"),i=t(\"../error/validation_error\");e.exports=function(t){var e=t.value,r=t.key,a=n(e);return\"string\"!==a?[new i(r,e,\"string expected, %s found\",a)]:[]}},{\"../error/validation_error\":276,\"../util/get_type\":278}],296:[function(t,e,r){\"use strict\";var n=t(\"./validate/validate_constants\"),i=t(\"./validate/validate\"),a=t(\"../reference/latest.min\"),o=t(\"./validate/validate_glyphs_url\");function s(t,e){e=e||a;var r=[];return r=r.concat(i({key:\"\",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:o}})),e.$version>7&&t.constants&&(r=r.concat(n({key:\"constants\",value:t.constants,style:t,styleSpec:e}))),l(r)}function l(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function c(t){return function(){return l(t.apply(this,arguments))}}s.source=c(t(\"./validate/validate_source\")),s.layer=c(t(\"./validate/validate_layer\")),s.filter=c(t(\"./validate/validate_filter\")),s.paintProperty=c(t(\"./validate/validate_paint_property\")),s.layoutProperty=c(t(\"./validate/validate_layout_property\")),e.exports=s},{\"../reference/latest.min\":297,\"./validate/validate\":280,\"./validate/validate_constants\":284,\"./validate/validate_filter\":286,\"./validate/validate_glyphs_url\":288,\"./validate/validate_layer\":289,\"./validate/validate_layout_property\":290,\"./validate/validate_paint_property\":293,\"./validate/validate_source\":294}],297:[function(t,e,r){e.exports=t(\"./v8.min.json\")},{\"./v8.min.json\":298}],298:[function(t,e,r){e.exports={$version:8,$root:{version:{required:!0,type:\"enum\",values:[8]},name:{type:\"string\"},metadata:{type:\"*\"},center:{type:\"array\",value:\"number\"},zoom:{type:\"number\"},bearing:{type:\"number\",default:0,period:360,units:\"degrees\"},pitch:{type:\"number\",default:0,units:\"degrees\"},sources:{required:!0,type:\"sources\"},sprite:{type:\"string\"},glyphs:{type:\"string\"},transition:{type:\"transition\"},layers:{required:!0,type:\"array\",value:\"layer\"}},sources:{\"*\":{type:\"source\"}},source:[\"source_tile\",\"source_geojson\",\"source_video\",\"source_image\"],source_tile:{type:{required:!0,type:\"enum\",values:[\"vector\",\"raster\"]},url:{type:\"string\"},tiles:{type:\"array\",value:\"string\"},minzoom:{type:\"number\",default:0},maxzoom:{type:\"number\",default:22},tileSize:{type:\"number\",default:512,units:\"pixels\"},\"*\":{type:\"*\"}},source_geojson:{type:{required:!0,type:\"enum\",values:[\"geojson\"]},data:{type:\"*\"},maxzoom:{type:\"number\",default:14},buffer:{type:\"number\",default:64},tolerance:{type:\"number\",default:3},cluster:{type:\"boolean\",default:!1},clusterRadius:{type:\"number\",default:400},clusterMaxZoom:{type:\"number\"}},source_video:{type:{required:!0,type:\"enum\",values:[\"video\"]},urls:{required:!0,type:\"array\",value:\"string\"},coordinates:{required:!0,type:\"array\",length:4,value:{type:\"array\",length:2,value:\"number\"}}},source_image:{type:{required:!0,type:\"enum\",values:[\"image\"]},url:{required:!0,type:\"string\"},coordinates:{required:!0,type:\"array\",length:4,value:{type:\"array\",length:2,value:\"number\"}}},layer:{id:{type:\"string\",required:!0},type:{type:\"enum\",values:[\"fill\",\"line\",\"symbol\",\"circle\",\"raster\",\"background\"]},metadata:{type:\"*\"},ref:{type:\"string\"},source:{type:\"string\"},\"source-layer\":{type:\"string\"},minzoom:{type:\"number\",minimum:0,maximum:22},maxzoom:{type:\"number\",minimum:0,maximum:22},interactive:{type:\"boolean\",default:!1},filter:{type:\"filter\"},layout:{type:\"layout\"},paint:{type:\"paint\"},\"paint.*\":{type:\"paint\"}},layout:[\"layout_fill\",\"layout_line\",\"layout_circle\",\"layout_symbol\",\"layout_raster\",\"layout_background\"],layout_background:{visibility:{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,values:[\"visible\",\"none\"],default:\"visible\"}},layout_fill:{visibility:{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,values:[\"visible\",\"none\"],default:\"visible\"}},layout_circle:{visibility:{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,values:[\"visible\",\"none\"],default:\"visible\"}},layout_line:{\"line-cap\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"butt\",\"round\",\"square\"],default:\"butt\"},\"line-join\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"bevel\",\"round\",\"miter\"],default:\"miter\"},\"line-miter-limit\":{type:\"number\",default:2,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,requires:[{\"line-join\":\"miter\"}]},\"line-round-limit\":{type:\"number\",default:1.05,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,requires:[{\"line-join\":\"round\"}]},visibility:{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,values:[\"visible\",\"none\"],default:\"visible\"}},layout_symbol:{\"symbol-placement\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"point\",\"line\"],default:\"point\"},\"symbol-spacing\":{type:\"number\",default:250,minimum:1,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,units:\"pixels\",requires:[{\"symbol-placement\":\"line\"}]},\"symbol-avoid-edges\":{type:\"boolean\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,default:!1},\"icon-allow-overlap\":{type:\"boolean\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,default:!1,requires:[\"icon-image\"]},\"icon-ignore-placement\":{type:\"boolean\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,default:!1,requires:[\"icon-image\"]},\"icon-optional\":{type:\"boolean\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,default:!1,requires:[\"icon-image\",\"text-field\"]},\"icon-rotation-alignment\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"map\",\"viewport\"],default:\"viewport\",requires:[\"icon-image\"]},\"icon-size\":{type:\"number\",default:1,minimum:0,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,requires:[\"icon-image\"]},\"icon-text-fit\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!1,values:[\"none\",\"both\",\"width\",\"height\"],default:\"none\",requires:[\"icon-image\",\"text-field\"]},\"icon-text-fit-padding\":{type:\"array\",value:\"number\",length:4,default:[0,0,0,0],units:\"pixels\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,requires:[\"icon-image\",\"icon-text-fit\",\"text-field\"]},\"icon-image\":{type:\"string\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,tokens:!0},\"icon-rotate\":{type:\"number\",default:0,period:360,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,units:\"degrees\",requires:[\"icon-image\"]},\"icon-padding\":{type:\"number\",default:2,minimum:0,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,units:\"pixels\",requires:[\"icon-image\"]},\"icon-keep-upright\":{type:\"boolean\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,default:!1,requires:[\"icon-image\",{\"icon-rotation-alignment\":\"map\"},{\"symbol-placement\":\"line\"}]},\"icon-offset\":{type:\"array\",value:\"number\",length:2,default:[0,0],function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,requires:[\"icon-image\"]},\"text-pitch-alignment\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"map\",\"viewport\"],requires:[\"text-field\"]},\"text-rotation-alignment\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"map\",\"viewport\"],default:\"viewport\",requires:[\"text-field\"]},\"text-field\":{type:\"string\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,default:\"\",tokens:!0},\"text-font\":{type:\"array\",value:\"string\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,default:[\"Open Sans Regular\",\"Arial Unicode MS Regular\"],requires:[\"text-field\"]},\"text-size\":{type:\"number\",default:16,minimum:0,units:\"pixels\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,requires:[\"text-field\"]},\"text-max-width\":{type:\"number\",default:10,minimum:0,units:\"em\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,requires:[\"text-field\"]},\"text-line-height\":{type:\"number\",default:1.2,units:\"em\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,requires:[\"text-field\"]},\"text-letter-spacing\":{type:\"number\",default:0,units:\"em\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,requires:[\"text-field\"]},\"text-justify\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"left\",\"center\",\"right\"],default:\"center\",requires:[\"text-field\"]},\"text-anchor\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"center\",\"left\",\"right\",\"top\",\"bottom\",\"top-left\",\"top-right\",\"bottom-left\",\"bottom-right\"],default:\"center\",requires:[\"text-field\"]},\"text-max-angle\":{type:\"number\",default:45,units:\"degrees\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,requires:[\"text-field\",{\"symbol-placement\":\"line\"}]},\"text-rotate\":{type:\"number\",default:0,period:360,units:\"degrees\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,requires:[\"text-field\"]},\"text-padding\":{type:\"number\",default:2,minimum:0,units:\"pixels\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,requires:[\"text-field\"]},\"text-keep-upright\":{type:\"boolean\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,default:!0,requires:[\"text-field\",{\"text-rotation-alignment\":\"map\"},{\"symbol-placement\":\"line\"}]},\"text-transform\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"none\",\"uppercase\",\"lowercase\"],default:\"none\",requires:[\"text-field\"]},\"text-offset\":{type:\"array\",value:\"number\",units:\"ems\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,length:2,default:[0,0],requires:[\"text-field\"]},\"text-allow-overlap\":{type:\"boolean\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,default:!1,requires:[\"text-field\"]},\"text-ignore-placement\":{type:\"boolean\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,default:!1,requires:[\"text-field\"]},\"text-optional\":{type:\"boolean\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,default:!1,requires:[\"text-field\",\"icon-image\"]},visibility:{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,values:[\"visible\",\"none\"],default:\"visible\"}},layout_raster:{visibility:{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,values:[\"visible\",\"none\"],default:\"visible\"}},filter:{type:\"array\",value:\"*\"},filter_operator:{type:\"enum\",values:[\"==\",\"!=\",\">\",\">=\",\"<\",\"<=\",\"in\",\"!in\",\"all\",\"any\",\"none\",\"has\",\"!has\"]},geometry_type:{type:\"enum\",values:[\"Point\",\"LineString\",\"Polygon\"]},color_operation:{type:\"enum\",values:[\"lighten\",\"saturate\",\"spin\",\"fade\",\"mix\"]},function:{stops:{type:\"array\",required:!0,value:\"function_stop\"},base:{type:\"number\",default:1,minimum:0},property:{type:\"string\",default:\"$zoom\"},type:{type:\"enum\",values:[\"exponential\",\"interval\",\"categorical\"],default:\"exponential\"}},function_stop:{type:\"array\",minimum:0,maximum:22,value:[\"number\",\"color\"],length:2},paint:[\"paint_fill\",\"paint_line\",\"paint_circle\",\"paint_symbol\",\"paint_raster\",\"paint_background\"],paint_fill:{\"fill-antialias\":{type:\"boolean\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,default:!0},\"fill-opacity\":{type:\"number\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,default:1,minimum:0,maximum:1,transition:!0},\"fill-color\":{type:\"color\",default:\"#000000\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,requires:[{\"!\":\"fill-pattern\"}]},\"fill-outline-color\":{type:\"color\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,requires:[{\"!\":\"fill-pattern\"},{\"fill-antialias\":!0}]},\"fill-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\"},\"fill-translate-anchor\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"map\",\"viewport\"],default:\"map\",requires:[\"fill-translate\"]},\"fill-pattern\":{type:\"string\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,transition:!0}},paint_line:{\"line-opacity\":{type:\"number\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,default:1,minimum:0,maximum:1,transition:!0},\"line-color\":{type:\"color\",default:\"#000000\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,requires:[{\"!\":\"line-pattern\"}]},\"line-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\"},\"line-translate-anchor\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"map\",\"viewport\"],default:\"map\",requires:[\"line-translate\"]},\"line-width\":{type:\"number\",default:1,minimum:0,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\"},\"line-gap-width\":{type:\"number\",default:0,minimum:0,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\"},\"line-offset\":{type:\"number\",default:0,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\"},\"line-blur\":{type:\"number\",default:0,minimum:0,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\"},\"line-dasharray\":{type:\"array\",value:\"number\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,minimum:0,transition:!0,units:\"line widths\",requires:[{\"!\":\"line-pattern\"}]},\"line-pattern\":{type:\"string\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,transition:!0}},paint_circle:{\"circle-radius\":{type:\"number\",default:5,minimum:0,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\"},\"circle-color\":{type:\"color\",default:\"#000000\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0},\"circle-blur\":{type:\"number\",default:0,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0},\"circle-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0},\"circle-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\"},\"circle-translate-anchor\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"map\",\"viewport\"],default:\"map\",requires:[\"circle-translate\"]},\"circle-pitch-scale\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"map\",\"viewport\"],default:\"map\"}},paint_symbol:{\"icon-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,requires:[\"icon-image\"]},\"icon-color\":{type:\"color\",default:\"#000000\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,requires:[\"icon-image\"]},\"icon-halo-color\":{type:\"color\",default:\"rgba(0, 0, 0, 0)\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,requires:[\"icon-image\"]},\"icon-halo-width\":{type:\"number\",default:0,minimum:0,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\",requires:[\"icon-image\"]},\"icon-halo-blur\":{type:\"number\",default:0,minimum:0,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\",requires:[\"icon-image\"]},\"icon-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\",requires:[\"icon-image\"]},\"icon-translate-anchor\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"map\",\"viewport\"],default:\"map\",requires:[\"icon-image\",\"icon-translate\"]},\"text-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,requires:[\"text-field\"]},\"text-color\":{type:\"color\",default:\"#000000\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,requires:[\"text-field\"]},\"text-halo-color\":{type:\"color\",default:\"rgba(0, 0, 0, 0)\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,requires:[\"text-field\"]},\"text-halo-width\":{type:\"number\",default:0,minimum:0,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\",requires:[\"text-field\"]},\"text-halo-blur\":{type:\"number\",default:0,minimum:0,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\",requires:[\"text-field\"]},\"text-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\",requires:[\"text-field\"]},\"text-translate-anchor\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"map\",\"viewport\"],default:\"map\",requires:[\"text-field\",\"text-translate\"]}},paint_raster:{\"raster-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,function:\"interpolated\",\"zoom-function\":!0,transition:!0},\"raster-hue-rotate\":{type:\"number\",default:0,period:360,function:\"interpolated\",\"zoom-function\":!0,transition:!0,units:\"degrees\"},\"raster-brightness-min\":{type:\"number\",function:\"interpolated\",\"zoom-function\":!0,default:0,minimum:0,maximum:1,transition:!0},\"raster-brightness-max\":{type:\"number\",function:\"interpolated\",\"zoom-function\":!0,default:1,minimum:0,maximum:1,transition:!0},\"raster-saturation\":{type:\"number\",default:0,minimum:-1,maximum:1,function:\"interpolated\",\"zoom-function\":!0,transition:!0},\"raster-contrast\":{type:\"number\",default:0,minimum:-1,maximum:1,function:\"interpolated\",\"zoom-function\":!0,transition:!0},\"raster-fade-duration\":{type:\"number\",default:300,minimum:0,function:\"interpolated\",\"zoom-function\":!0,transition:!0,units:\"milliseconds\"}},paint_background:{\"background-color\":{type:\"color\",default:\"#000000\",function:\"interpolated\",\"zoom-function\":!0,transition:!0,requires:[{\"!\":\"background-pattern\"}]},\"background-pattern\":{type:\"string\",function:\"piecewise-constant\",\"zoom-function\":!0,transition:!0},\"background-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,function:\"interpolated\",\"zoom-function\":!0,transition:!0}},transition:{duration:{type:\"number\",default:300,minimum:0,units:\"milliseconds\"},delay:{type:\"number\",default:0,minimum:0,units:\"milliseconds\"}}}},{}],299:[function(t,e,r){\"use strict\";function n(t){return!!(\"undefined\"!=typeof window&&\"undefined\"!=typeof document&&Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray&&Function.prototype&&Function.prototype.bind&&Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions&&\"JSON\"in window&&\"parse\"in JSON&&\"stringify\"in JSON&&\"Worker\"in window&&\"Uint8ClampedArray\"in window&&function(t){void 0===i[t]&&(i[t]=function(t){var e=document.createElement(\"canvas\"),r=Object.create(n.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,e.probablySupportsContext?e.probablySupportsContext(\"webgl\",r)||e.probablySupportsContext(\"experimental-webgl\",r):e.supportsContext?e.supportsContext(\"webgl\",r)||e.supportsContext(\"experimental-webgl\",r):e.getContext(\"webgl\",r)||e.getContext(\"experimental-webgl\",r)}(t));return i[t]}(t&&t.failIfMajorPerformanceCaveat))}void 0!==e&&e.exports?e.exports=n:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=n);var i={};n.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],300:[function(t,e,r){\"use strict\";var n=t(\"../util/util\");function i(t){var e=t.layoutVertexArrayType;this.layoutVertexArray=new e;var r=t.elementArrayType;r&&(this.elementArray=new r);var i=t.elementArrayType2;i&&(this.elementArray2=new i),this.paintVertexArrays=n.mapObject(t.paintVertexArrayTypes,function(t){return new t})}e.exports=i,i.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,i.prototype.hasCapacityFor=function(t){return this.layoutVertexArray.length+t<=i.MAX_VERTEX_ARRAY_LENGTH},i.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},i.prototype.trim=function(){for(var t in this.layoutVertexArray.trim(),this.elementArray&&this.elementArray.trim(),this.elementArray2&&this.elementArray2.trim(),this.paintVertexArrays)this.paintVertexArrays[t].trim()},i.prototype.serialize=function(){return{layoutVertexArray:this.layoutVertexArray.serialize(),elementArray:this.elementArray&&this.elementArray.serialize(),elementArray2:this.elementArray2&&this.elementArray2.serialize(),paintVertexArrays:n.mapObject(this.paintVertexArrays,function(t){return t.serialize()})}},i.prototype.getTransferables=function(t){for(var e in t.push(this.layoutVertexArray.arrayBuffer),this.elementArray&&t.push(this.elementArray.arrayBuffer),this.elementArray2&&t.push(this.elementArray2.arrayBuffer),this.paintVertexArrays)t.push(this.paintVertexArrays[e].arrayBuffer)}},{\"../util/util\":414}],301:[function(t,e,r){\"use strict\";var n=t(\"feature-filter\"),i=t(\"./array_group\"),a=t(\"./buffer_group\"),o=t(\"../util/util\"),s=t(\"../util/struct_array\"),l=t(\"assert\");function c(t){if(this.zoom=t.zoom,this.overscaling=t.overscaling,this.layer=t.layer,this.childLayers=t.childLayers,this.type=this.layer.type,this.features=[],this.id=this.layer.id,this.index=t.index,this.sourceLayer=this.layer.sourceLayer,this.sourceLayerIndex=t.sourceLayerIndex,this.minZoom=this.layer.minzoom,this.maxZoom=this.layer.maxzoom,this.paintAttributes=function(t){var e={};for(var r in t.programInterfaces){for(var n=e[r]={},i=0;i<t.childLayers.length;i++){var a=t.childLayers[i];n[a.id]={attributes:[],uniforms:[],defines:[],vertexPragmas:{define:{},initialize:{}},fragmentPragmas:{define:{},initialize:{}}}}var s=t.programInterfaces[r];if(s.paintAttributes)for(var c=\"{precision}\",u=\"{type}\",d=0;d<s.paintAttributes.length;d++){var p=s.paintAttributes[d];p.multiplier=p.multiplier||1;for(var m=0;m<t.childLayers.length;m++){var v=t.childLayers[m],g=n[v.id],y=p.name;l(\"a_\"===p.name.slice(0,2));var b,x=p.name.slice(2);if(g.fragmentPragmas.initialize[x]=\"\",v.isPaintValueFeatureConstant(p.paintProperty))g.uniforms.push(p),g.fragmentPragmas.define[x]=g.vertexPragmas.define[x]=[\"uniform\",c,u,y].join(\" \")+\";\",g.fragmentPragmas.initialize[x]=g.vertexPragmas.initialize[x]=[c,u,x,\"=\",y].join(\" \")+\";\\n\";else if(v.isPaintValueZoomConstant(p.paintProperty)){g.attributes.push(o.extend({},p,{name:y})),b=[\"varying\",c,u,x].join(\" \")+\";\\n\";var _=[g.fragmentPragmas.define[x],\"attribute\",c,u,y].join(\" \")+\";\\n\";g.fragmentPragmas.define[x]=b,g.vertexPragmas.define[x]=b+_,g.vertexPragmas.initialize[x]=[x,\"=\",y,\"/\",p.multiplier.toFixed(1)].join(\" \")+\";\\n\"}else{for(var w=\"u_\"+y.slice(2)+\"_t\",M=v.getPaintValueStopZoomLevels(p.paintProperty),k=0;k<M.length&&M[k]<t.zoom;)k++;for(var A=Math.max(0,Math.min(M.length-4,k-2)),T=[],E=0;E<4;E++)T.push(M[Math.min(A+E,M.length-1)]);b=[\"varying\",c,u,x].join(\" \")+\";\\n\",g.vertexPragmas.define[x]=b+[\"uniform\",\"lowp\",\"float\",w].join(\" \")+\";\\n\",g.fragmentPragmas.define[x]=b,g.uniforms.push(o.extend({},p,{name:w,getValue:h(p,A),components:1}));var S=p.components;if(1===S)g.attributes.push(o.extend({},p,{getValue:f(p,T),isFunction:!0,components:4*S})),g.vertexPragmas.define[x]+=[\"attribute\",c,\"vec4\",y].join(\" \")+\";\\n\",g.vertexPragmas.initialize[x]=[x,\"=\",\"evaluate_zoom_function_1(\"+y+\", \"+w+\")\",\"/\",p.multiplier.toFixed(1)].join(\" \")+\";\\n\";else{for(var L=[],C=0;C<4;C++)L.push(y+C),g.attributes.push(o.extend({},p,{getValue:f(p,[T[C]]),isFunction:!0,name:y+C})),g.vertexPragmas.define[x]+=[\"attribute\",c,u,y+C].join(\" \")+\";\\n\";g.vertexPragmas.initialize[x]=[x,\" = \",\"evaluate_zoom_function_4(\"+L.join(\", \")+\", \"+w+\")\",\"/\",p.multiplier.toFixed(1)].join(\" \")+\";\\n\"}}}}}return e}(this),t.arrays){var e=this.programInterfaces;this.bufferGroups=o.mapObject(t.arrays,function(r,n){var i=e[n],o=t.paintVertexArrayTypes[n];return r.map(function(t){return new a(t,{layoutVertexArrayType:i.layoutVertexArrayType.serialize(),elementArrayType:i.elementArrayType&&i.elementArrayType.serialize(),elementArrayType2:i.elementArrayType2&&i.elementArrayType2.serialize(),paintVertexArrayTypes:o})})})}}e.exports=c,c.create=function(e){return new({fill:t(\"./bucket/fill_bucket\"),line:t(\"./bucket/line_bucket\"),circle:t(\"./bucket/circle_bucket\"),symbol:t(\"./bucket/symbol_bucket\")}[e.layer.type])(e)},c.EXTENT=8192,c.prototype.populateArrays=function(){this.createArrays(),this.recalculateStyleLayers();for(var t=0;t<this.features.length;t++)this.addFeature(this.features[t]);this.trimArrays()},c.prototype.prepareArrayGroup=function(t,e){var r=this.arrayGroups[t],n=r.length&&r[r.length-1];return n&&n.hasCapacityFor(e)||((n=new i({layoutVertexArrayType:this.programInterfaces[t].layoutVertexArrayType,elementArrayType:this.programInterfaces[t].elementArrayType,elementArrayType2:this.programInterfaces[t].elementArrayType2,paintVertexArrayTypes:this.paintVertexArrayTypes[t]})).index=r.length,r.push(n)),n},c.prototype.createArrays=function(){for(var t in this.arrayGroups={},this.paintVertexArrayTypes={},this.programInterfaces){this.arrayGroups[t]=[];var e=this.paintVertexArrayTypes[t]={},r=this.paintAttributes[t];for(var n in r)e[n]=new c.VertexArrayType(r[n].attributes)}},c.prototype.destroy=function(t){for(var e in this.bufferGroups)for(var r=this.bufferGroups[e],n=0;n<r.length;n++)r[n].destroy(t)},c.prototype.trimArrays=function(){for(var t in this.arrayGroups)for(var e=this.arrayGroups[t],r=0;r<e.length;r++)e[r].trim()},c.prototype.isEmpty=function(){for(var t in this.arrayGroups)for(var e=this.arrayGroups[t],r=0;r<e.length;r++)if(!e[r].isEmpty())return!1;return!0},c.prototype.getTransferables=function(t){for(var e in this.arrayGroups)for(var r=this.arrayGroups[e],n=0;n<r.length;n++)r[n].getTransferables(t)},c.prototype.setUniforms=function(t,e,r,n,i){for(var a=this.paintAttributes[e][n.id].uniforms,o=0;o<a.length;o++){var s=a[o],l=r[s.name];t[\"uniform\"+s.components+\"fv\"](l,s.getValue(n,i))}},c.prototype.serialize=function(){return{layerId:this.layer.id,zoom:this.zoom,arrays:o.mapObject(this.arrayGroups,function(t){return t.map(function(t){return t.serialize()})}),paintVertexArrayTypes:o.mapObject(this.paintVertexArrayTypes,function(t){return o.mapObject(t,function(t){return t.serialize()})}),childLayerIds:this.childLayers.map(function(t){return t.id})}},c.prototype.createFilter=function(){this.filter||(this.filter=n(this.layer.filter))};var u={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0};function f(t,e){return function(r,n,i){if(1===e.length)return t.getValue(r,o.extend({},n,{zoom:e[0]}),i);for(var a=[],s=0;s<e.length;s++){var l=e[s];a.push(t.getValue(r,o.extend({},n,{zoom:l}),i)[0])}return a}}function h(t,e){return function(r,n){var i=r.getPaintInterpolationT(t.paintProperty,n.zoom);return[Math.max(0,Math.min(4,i-e))]}}c.prototype.recalculateStyleLayers=function(){for(var t=0;t<this.childLayers.length;t++)this.childLayers[t].recalculate(this.zoom,u)},c.prototype.populatePaintArrays=function(t,e,r,n,i){for(var a=0;a<this.childLayers.length;a++)for(var o=this.childLayers[a],s=this.arrayGroups[t],l=n.index;l<s.length;l++){var c=s[l],u=c.layoutVertexArray.length,f=c.paintVertexArrays[o.id];f.resize(u);for(var h=this.paintAttributes[t][o.id].attributes,d=0;d<h.length;d++)for(var p=h[d],m=p.getValue(o,e,r),v=p.multiplier||1,g=p.components||1,y=l===n.index?i:0;y<u;y++)for(var b=f.get(y),x=0;x<g;x++){b[g>1?p.name+x:p.name]=m[x]*v}}},c.VertexArrayType=function(t){return new s({members:t,alignment:4})},c.ElementArrayType=function(t){return new s({members:[{type:\"Uint16\",name:\"vertices\",components:t||3}]})}},{\"../util/struct_array\":412,\"../util/util\":414,\"./array_group\":300,\"./bucket/circle_bucket\":302,\"./bucket/fill_bucket\":303,\"./bucket/line_bucket\":304,\"./bucket/symbol_bucket\":305,\"./buffer_group\":307,assert:51,\"feature-filter\":141}],302:[function(t,e,r){\"use strict\";var n=t(\"../bucket\"),i=t(\"../../util/util\"),a=t(\"../load_geometry\"),o=n.EXTENT;function s(){n.apply(this,arguments)}e.exports=s,s.prototype=i.inherit(n,{}),s.prototype.addCircleVertex=function(t,e,r,n,i){return t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)},s.prototype.programInterfaces={circle:{layoutVertexArrayType:new n.VertexArrayType([{name:\"a_pos\",components:2,type:\"Int16\"}]),elementArrayType:new n.ElementArrayType,paintAttributes:[{name:\"a_color\",components:4,type:\"Uint8\",getValue:function(t,e,r){return t.getPaintValue(\"circle-color\",e,r)},multiplier:255,paintProperty:\"circle-color\"},{name:\"a_radius\",components:1,type:\"Uint16\",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue(\"circle-radius\",e,r)]},multiplier:10,paintProperty:\"circle-radius\"},{name:\"a_blur\",components:1,type:\"Uint16\",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue(\"circle-blur\",e,r)]},multiplier:10,paintProperty:\"circle-blur\"},{name:\"a_opacity\",components:1,type:\"Uint16\",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue(\"circle-opacity\",e,r)]},multiplier:255,paintProperty:\"circle-opacity\"}]}},s.prototype.addFeature=function(t){for(var e={zoom:this.zoom},r=a(t),n=this.prepareArrayGroup(\"circle\",0),i=n.layoutVertexArray.length,s=0;s<r.length;s++)for(var l=0;l<r[s].length;l++){var c=r[s][l].x,u=r[s][l].y;if(!(c<0||c>=o||u<0||u>=o)){var f=this.prepareArrayGroup(\"circle\",4),h=f.layoutVertexArray,d=this.addCircleVertex(h,c,u,-1,-1);this.addCircleVertex(h,c,u,1,-1),this.addCircleVertex(h,c,u,1,1),this.addCircleVertex(h,c,u,-1,1),f.elementArray.emplaceBack(d,d+1,d+2),f.elementArray.emplaceBack(d,d+3,d+2)}}this.populatePaintArrays(\"circle\",e,t.properties,n,i)}},{\"../../util/util\":414,\"../bucket\":301,\"../load_geometry\":309}],303:[function(t,e,r){\"use strict\";var n=t(\"../bucket\"),i=t(\"../../util/util\"),a=t(\"../load_geometry\"),o=t(\"earcut\"),s=t(\"../../util/classify_rings\");function l(){n.apply(this,arguments)}e.exports=l,l.prototype=i.inherit(n,{}),l.prototype.programInterfaces={fill:{layoutVertexArrayType:new n.VertexArrayType([{name:\"a_pos\",components:2,type:\"Int16\"}]),elementArrayType:new n.ElementArrayType(1),elementArrayType2:new n.ElementArrayType(2),paintAttributes:[{name:\"a_color\",components:4,type:\"Uint8\",getValue:function(t,e,r){return t.getPaintValue(\"fill-color\",e,r)},multiplier:255,paintProperty:\"fill-color\"},{name:\"a_outline_color\",components:4,type:\"Uint8\",getValue:function(t,e,r){return t.getPaintValue(\"fill-outline-color\",e,r)},multiplier:255,paintProperty:\"fill-outline-color\"},{name:\"a_opacity\",components:1,type:\"Uint8\",getValue:function(t,e,r){return[t.getPaintValue(\"fill-opacity\",e,r)]},multiplier:255,paintProperty:\"fill-opacity\"}]}},l.prototype.addFeature=function(t){for(var e=a(t),r=s(e,500),n=this.prepareArrayGroup(\"fill\",0),i=n.layoutVertexArray.length,o=0;o<r.length;o++)this.addPolygon(r[o]);this.populatePaintArrays(\"fill\",{zoom:this.zoom},t.properties,n,i)},l.prototype.addPolygon=function(t){for(var e=0,r=0;r<t.length;r++)e+=t[r].length;for(var n=this.prepareArrayGroup(\"fill\",e),i=[],a=[],s=n.layoutVertexArray.length,l=0;l<t.length;l++){var c=t[l];l>0&&a.push(i.length/2);for(var u=0;u<c.length;u++){var f=c[u],h=n.layoutVertexArray.emplaceBack(f.x,f.y);u>=1&&n.elementArray2.emplaceBack(h-1,h),i.push(f.x),i.push(f.y)}}for(var d=o(i,a),p=0;p<d.length;p++)n.elementArray.emplaceBack(d[p]+s)}},{\"../../util/classify_rings\":402,\"../../util/util\":414,\"../bucket\":301,\"../load_geometry\":309,earcut:135}],304:[function(t,e,r){\"use strict\";var n=t(\"../bucket\"),i=t(\"../../util/util\"),a=t(\"../load_geometry\"),o=n.EXTENT,s=Math.cos(Math.PI/180*37.5),l=Math.pow(2,14)/.5;function c(){n.apply(this,arguments)}e.exports=c,c.prototype=i.inherit(n,{}),c.prototype.addLineVertex=function(t,e,r,n,i,a,o){return t.emplaceBack(e.x<<1|n,e.y<<1|i,Math.round(63*r.x)+128,Math.round(63*r.y)+128,1+(0===a?0:a<0?-1:1)|(.5*o&63)<<2,.5*o>>6)},c.prototype.programInterfaces={line:{layoutVertexArrayType:new n.VertexArrayType([{name:\"a_pos\",components:2,type:\"Int16\"},{name:\"a_data\",components:4,type:\"Uint8\"}]),elementArrayType:new n.ElementArrayType}},c.prototype.addFeature=function(t){for(var e=a(t,15),r=0;r<e.length;r++)this.addLine(e[r],this.layer.layout[\"line-join\"],this.layer.layout[\"line-cap\"],this.layer.layout[\"line-miter-limit\"],this.layer.layout[\"line-round-limit\"])},c.prototype.addLine=function(t,e,r,n,i){for(var a=t.length;a>2&&t[a-1].equals(t[a-2]);)a--;if(!(t.length<2)){\"bevel\"===e&&(n=1.05);var l=o/(512*this.overscaling)*15,c=t[0],u=t[a-1],f=c.equals(u);if(this.prepareArrayGroup(\"line\",10*a),2!==a||!f){this.distance=0;var h,d,p,m,v,g,y,b=r,x=f?\"butt\":r,_=!0;this.e1=this.e2=this.e3=-1,f&&(h=t[a-2],v=c.sub(h)._unit()._perp());for(var w=0;w<a;w++)if(!(p=f&&w===a-1?t[1]:t[w+1])||!t[w].equals(p)){v&&(m=v),h&&(d=h),h=t[w],v=p?p.sub(h)._unit()._perp():m;var M=(m=m||v).add(v)._unit(),k=M.x*v.x+M.y*v.y,A=1/k,T=k<s&&d&&p;if(T&&w>0){var E=h.dist(d);if(E>2*l){var S=h.sub(h.sub(d)._mult(l/E)._round());this.distance+=S.dist(d),this.addCurrentVertex(S,this.distance,m.mult(1),0,0,!1),d=S}}var L=d&&p,C=L?e:p?b:x;if(L&&\"round\"===C&&(A<i?C=\"miter\":A<=2&&(C=\"fakeround\")),\"miter\"===C&&A>n&&(C=\"bevel\"),\"bevel\"===C&&(A>2&&(C=\"flipbevel\"),A<n&&(C=\"miter\")),d&&(this.distance+=h.dist(d)),\"miter\"===C)M._mult(A),this.addCurrentVertex(h,this.distance,M,0,0,!1);else if(\"flipbevel\"===C){if(A>100)M=v.clone();else{var P=m.x*v.y-m.y*v.x>0?-1:1,z=A*m.add(v).mag()/m.sub(v).mag();M._perp()._mult(z*P)}this.addCurrentVertex(h,this.distance,M,0,0,!1),this.addCurrentVertex(h,this.distance,M.mult(-1),0,0,!1)}else if(\"bevel\"===C||\"fakeround\"===C){var O=m.x*v.y-m.y*v.x>0,D=-Math.sqrt(A*A-1);if(O?(y=0,g=D):(g=0,y=D),_||this.addCurrentVertex(h,this.distance,m,g,y,!1),\"fakeround\"===C){for(var I,R=Math.floor(8*(.5-(k-.5))),N=0;N<R;N++)I=v.mult((N+1)/(R+1))._add(m)._unit(),this.addPieSliceVertex(h,this.distance,I,O);this.addPieSliceVertex(h,this.distance,M,O);for(var F=R-1;F>=0;F--)I=m.mult((F+1)/(R+1))._add(v)._unit(),this.addPieSliceVertex(h,this.distance,I,O)}p&&this.addCurrentVertex(h,this.distance,v,-g,-y,!1)}else\"butt\"===C?(_||this.addCurrentVertex(h,this.distance,m,0,0,!1),p&&this.addCurrentVertex(h,this.distance,v,0,0,!1)):\"square\"===C?(_||(this.addCurrentVertex(h,this.distance,m,1,1,!1),this.e1=this.e2=-1),p&&this.addCurrentVertex(h,this.distance,v,-1,-1,!1)):\"round\"===C&&(_||(this.addCurrentVertex(h,this.distance,m,0,0,!1),this.addCurrentVertex(h,this.distance,m,1,1,!0),this.e1=this.e2=-1),p&&(this.addCurrentVertex(h,this.distance,v,-1,-1,!0),this.addCurrentVertex(h,this.distance,v,0,0,!1)));if(T&&w<a-1){var j=h.dist(p);if(j>2*l){var B=h.add(p.sub(h)._mult(l/j)._round());this.distance+=B.dist(h),this.addCurrentVertex(B,this.distance,v.mult(1),0,0,!1),h=B}}_=!1}}}},c.prototype.addCurrentVertex=function(t,e,r,n,i,a){var o,s=a?1:0,c=this.arrayGroups.line[this.arrayGroups.line.length-1],u=c.layoutVertexArray,f=c.elementArray;o=r.clone(),n&&o._sub(r.perp()._mult(n)),this.e3=this.addLineVertex(u,t,o,s,0,n,e),this.e1>=0&&this.e2>=0&&f.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,o=r.mult(-1),i&&o._sub(r.perp()._mult(i)),this.e3=this.addLineVertex(u,t,o,s,1,-i,e),this.e1>=0&&this.e2>=0&&f.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,e>l/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,i,a))},c.prototype.addPieSliceVertex=function(t,e,r,n){var i=n?1:0;r=r.mult(n?-1:1);var a=this.arrayGroups.line[this.arrayGroups.line.length-1],o=a.layoutVertexArray,s=a.elementArray;this.e3=this.addLineVertex(o,t,r,0,i,0,e),this.e1>=0&&this.e2>=0&&s.emplaceBack(this.e1,this.e2,this.e3),n?this.e2=this.e3:this.e1=this.e3}},{\"../../util/util\":414,\"../bucket\":301,\"../load_geometry\":309}],305:[function(t,e,r){\"use strict\";var n=t(\"point-geometry\"),i=t(\"../bucket\"),a=t(\"../../symbol/anchor\"),o=t(\"../../symbol/get_anchors\"),s=t(\"../../util/token\"),l=t(\"../../symbol/quads\"),c=t(\"../../symbol/shaping\"),u=t(\"../../symbol/resolve_text\"),f=t(\"../../symbol/mergelines\"),h=t(\"../../symbol/clip_line\"),d=t(\"../../util/util\"),p=t(\"../load_geometry\"),m=t(\"../../symbol/collision_feature\"),v=c.shapeText,g=c.shapeIcon,y=l.getGlyphQuads,b=l.getIconQuads,x=i.EXTENT;function _(t){i.apply(this,arguments),this.showCollisionBoxes=t.showCollisionBoxes,this.overscaling=t.overscaling,this.collisionBoxArray=t.collisionBoxArray,this.symbolQuadsArray=t.symbolQuadsArray,this.symbolInstancesArray=t.symbolInstancesArray,this.sdfIcons=t.sdfIcons,this.iconsNeedLinear=t.iconsNeedLinear,this.adjustedTextSize=t.adjustedTextSize,this.adjustedIconSize=t.adjustedIconSize,this.fontstack=t.fontstack}e.exports=_,_.MAX_QUADS=65535,_.prototype=d.inherit(i,{}),_.prototype.serialize=function(){var t=i.prototype.serialize.apply(this);return t.sdfIcons=this.sdfIcons,t.iconsNeedLinear=this.iconsNeedLinear,t.adjustedTextSize=this.adjustedTextSize,t.adjustedIconSize=this.adjustedIconSize,t.fontstack=this.fontstack,t};var w=new i.VertexArrayType([{name:\"a_pos\",components:2,type:\"Int16\"},{name:\"a_offset\",components:2,type:\"Int16\"},{name:\"a_texture_pos\",components:2,type:\"Uint16\"},{name:\"a_data\",components:4,type:\"Uint8\"}]),M=new i.ElementArrayType;function k(t,e,r,n,i,a,o,s,l,c,u){return t.emplaceBack(e,r,Math.round(64*n),Math.round(64*i),a/4,o/4,10*(c||0),u,10*(s||0),10*Math.min(l||25,25))}_.prototype.addCollisionBoxVertex=function(t,e,r,n,i){return t.emplaceBack(e.x,e.y,Math.round(r.x),Math.round(r.y),10*n,10*i)},_.prototype.programInterfaces={glyph:{layoutVertexArrayType:w,elementArrayType:M},icon:{layoutVertexArrayType:w,elementArrayType:M},collisionBox:{layoutVertexArrayType:new i.VertexArrayType([{name:\"a_pos\",components:2,type:\"Int16\"},{name:\"a_extrude\",components:2,type:\"Int16\"},{name:\"a_data\",components:2,type:\"Uint8\"}])}},_.prototype.populateArrays=function(t,e,r){var n={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0};this.adjustedTextMaxSize=this.layer.getLayoutValue(\"text-size\",{zoom:18,zoomHistory:n}),this.adjustedTextSize=this.layer.getLayoutValue(\"text-size\",{zoom:this.zoom+1,zoomHistory:n}),this.adjustedIconMaxSize=this.layer.getLayoutValue(\"icon-size\",{zoom:18,zoomHistory:n}),this.adjustedIconSize=this.layer.getLayoutValue(\"icon-size\",{zoom:this.zoom+1,zoomHistory:n});var i=512*this.overscaling;this.tilePixelRatio=x/i,this.compareText={},this.iconsNeedLinear=!1,this.symbolInstancesStartIndex=this.symbolInstancesArray.length;var a=this.layer.layout,o=this.features,l=this.textFeatures,c=.5,u=.5;switch(a[\"text-anchor\"]){case\"right\":case\"top-right\":case\"bottom-right\":c=1;break;case\"left\":case\"top-left\":case\"bottom-left\":c=0}switch(a[\"text-anchor\"]){case\"bottom\":case\"bottom-right\":case\"bottom-left\":u=1;break;case\"top\":case\"top-right\":case\"top-left\":u=0}for(var h,m,y=\"right\"===a[\"text-justify\"]?1:\"left\"===a[\"text-justify\"]?0:.5,b=24*a[\"text-line-height\"],_=\"line\"!==a[\"symbol-placement\"]?24*a[\"text-max-width\"]:0,w=24*a[\"text-letter-spacing\"],M=[24*a[\"text-offset\"][0],24*a[\"text-offset\"][1]],k=this.fontstack=a[\"text-font\"].join(\",\"),A=[],T=0;T<o.length;T++)A.push(p(o[T]));if(\"line\"===a[\"symbol-placement\"]){var E=f(o,l,A);A=E.geometries,o=E.features,l=E.textFeatures}for(var S=0;S<o.length;S++)if(A[S]){if(h=l[S]?v(l[S],e[k],_,b,c,u,y,w,M):null,a[\"icon-image\"]){var L=r[s(o[S].properties,a[\"icon-image\"])];m=g(L,a),L&&(void 0===this.sdfIcons?this.sdfIcons=L.sdf:this.sdfIcons!==L.sdf&&d.warnOnce(\"Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer\"),1!==L.pixelRatio?this.iconsNeedLinear=!0:0===a[\"icon-rotate\"]&&this.layer.isLayoutValueFeatureConstant(\"icon-rotate\")||(this.iconsNeedLinear=!0))}else m=null;(h||m)&&this.addFeature(A[S],h,m,o[S])}this.symbolInstancesEndIndex=this.symbolInstancesArray.length,this.placeFeatures(t,this.showCollisionBoxes),this.trimArrays()},_.prototype.addFeature=function(t,e,r,n){var i=this.layer.layout,s=this.adjustedTextSize/24,l=void 0!==this.adjustedTextMaxSize?this.adjustedTextMaxSize:this.adjustedTextSize,c=this.tilePixelRatio*s,u=this.tilePixelRatio*l/24,f=this.tilePixelRatio*this.adjustedIconSize,d=this.tilePixelRatio*i[\"symbol-spacing\"],p=i[\"symbol-avoid-edges\"],m=i[\"text-padding\"]*this.tilePixelRatio,v=i[\"icon-padding\"]*this.tilePixelRatio,g=i[\"text-max-angle\"]/180*Math.PI,y=\"map\"===i[\"text-rotation-alignment\"]&&\"line\"===i[\"symbol-placement\"],b=\"map\"===i[\"icon-rotation-alignment\"]&&\"line\"===i[\"symbol-placement\"],_=i[\"text-allow-overlap\"]||i[\"icon-allow-overlap\"]||i[\"text-ignore-placement\"]||i[\"icon-ignore-placement\"],w=\"line\"===i[\"symbol-placement\"],M=d/2;w&&(t=h(t,0,0,x,x));for(var k=0;k<t.length;k++)for(var A,T=t[k],E=0,S=(A=w?o(T,d,g,e,r,24,u,this.overscaling,x):[new a(T[0].x,T[0].y,0)]).length;E<S;E++){var L=A[E];if(!(e&&w&&this.anchorIsTooClose(e.text,M,L))){var C=!(L.x<0||L.x>x||L.y<0||L.y>x);if(!p||C){var P=C||_;this.addSymbolInstance(L,T,e,r,this.layer,P,this.symbolInstancesArray.length,this.collisionBoxArray,n.index,this.sourceLayerIndex,this.index,c,m,y,f,v,b,{zoom:this.zoom},n.properties)}}}},_.prototype.anchorIsTooClose=function(t,e,r){var n=this.compareText;if(t in n){for(var i=n[t],a=i.length-1;a>=0;a--)if(r.dist(i[a])<e)return!0}else n[t]=[];return n[t].push(r),!1},_.prototype.placeFeatures=function(t,e){this.recalculateStyleLayers(),this.createArrays();var r=this.layer.layout,n=t.maxScale,i=\"map\"===r[\"text-rotation-alignment\"]&&\"line\"===r[\"symbol-placement\"],a=\"map\"===r[\"icon-rotation-alignment\"]&&\"line\"===r[\"symbol-placement\"];if(r[\"text-allow-overlap\"]||r[\"icon-allow-overlap\"]||r[\"text-ignore-placement\"]||r[\"icon-ignore-placement\"]){var o=this.symbolInstancesArray.toArray(this.symbolInstancesStartIndex,this.symbolInstancesEndIndex),s=t.angle,l=Math.sin(s),c=Math.cos(s);this.sortedSymbolInstances=o.sort(function(t,e){return(l*t.anchorPointX+c*t.anchorPointY|0)-(l*e.anchorPointX+c*e.anchorPointY|0)||e.index-t.index})}for(var u=this.symbolInstancesStartIndex;u<this.symbolInstancesEndIndex;u++){var f=this.sortedSymbolInstances?this.sortedSymbolInstances[u-this.symbolInstancesStartIndex]:this.symbolInstancesArray.get(u),h={boxStartIndex:f.textBoxStartIndex,boxEndIndex:f.textBoxEndIndex},d={boxStartIndex:f.iconBoxStartIndex,boxEndIndex:f.iconBoxEndIndex},p=!(f.textBoxStartIndex===f.textBoxEndIndex),m=!(f.iconBoxStartIndex===f.iconBoxEndIndex),v=r[\"text-optional\"]||!p,g=r[\"icon-optional\"]||!m,y=p?t.placeCollisionFeature(h,r[\"text-allow-overlap\"],r[\"symbol-avoid-edges\"]):t.minScale,b=m?t.placeCollisionFeature(d,r[\"icon-allow-overlap\"],r[\"symbol-avoid-edges\"]):t.minScale;v||g?!g&&y?y=Math.max(b,y):!v&&b&&(b=Math.max(b,y)):b=y=Math.max(b,y),p&&(t.insertCollisionFeature(h,y,r[\"text-ignore-placement\"]),y<=n&&this.addSymbols(\"glyph\",f.glyphQuadStartIndex,f.glyphQuadEndIndex,y,r[\"text-keep-upright\"],i,t.angle)),m&&(t.insertCollisionFeature(d,b,r[\"icon-ignore-placement\"]),b<=n&&this.addSymbols(\"icon\",f.iconQuadStartIndex,f.iconQuadEndIndex,b,r[\"icon-keep-upright\"],a,t.angle))}e&&this.addToDebugBuffers(t)},_.prototype.addSymbols=function(t,e,r,n,i,a,o){for(var s=this.prepareArrayGroup(t,4*(r-e)),l=s.elementArray,c=s.layoutVertexArray,u=this.zoom,f=Math.max(Math.log(n)/Math.LN2+u,0),h=e;h<r;h++){var d=this.symbolQuadsArray.get(h).SymbolQuad,p=(d.anchorAngle+o+Math.PI)%(2*Math.PI);if(!(i&&a&&(p<=Math.PI/2||p>3*Math.PI/2))){var m=d.tl,v=d.tr,g=d.bl,y=d.br,b=d.tex,x=d.anchorPoint,_=Math.max(u+Math.log(d.minScale)/Math.LN2,f),w=Math.min(u+Math.log(d.maxScale)/Math.LN2,25);if(!(w<=_)){_===f&&(_=0);var M=Math.round(d.glyphAngle/(2*Math.PI)*256),A=k(c,x.x,x.y,m.x,m.y,b.x,b.y,_,w,f,M);k(c,x.x,x.y,v.x,v.y,b.x+b.w,b.y,_,w,f,M),k(c,x.x,x.y,g.x,g.y,b.x,b.y+b.h,_,w,f,M),k(c,x.x,x.y,y.x,y.y,b.x+b.w,b.y+b.h,_,w,f,M),l.emplaceBack(A,A+1,A+2),l.emplaceBack(A+1,A+2,A+3)}}}},_.prototype.updateIcons=function(t){this.recalculateStyleLayers();var e=this.layer.layout[\"icon-image\"];if(e)for(var r=0;r<this.features.length;r++){var n=s(this.features[r].properties,e);n&&(t[n]=!0)}},_.prototype.updateFont=function(t){this.recalculateStyleLayers();var e=this.layer.layout[\"text-font\"],r=t[e]=t[e]||{};this.textFeatures=u(this.features,this.layer.layout,r)},_.prototype.addToDebugBuffers=function(t){for(var e=this.prepareArrayGroup(\"collisionBox\",0).layoutVertexArray,r=-t.angle,i=t.yStretch,a=this.symbolInstancesStartIndex;a<this.symbolInstancesEndIndex;a++){var o=this.symbolInstancesArray.get(a);o.textCollisionFeature={boxStartIndex:o.textBoxStartIndex,boxEndIndex:o.textBoxEndIndex},o.iconCollisionFeature={boxStartIndex:o.iconBoxStartIndex,boxEndIndex:o.iconBoxEndIndex};for(var s=0;s<2;s++){var l=o[0===s?\"textCollisionFeature\":\"iconCollisionFeature\"];if(l)for(var c=l.boxStartIndex;c<l.boxEndIndex;c++){var u=this.collisionBoxArray.get(c),f=u.anchorPoint,h=new n(u.x1,u.y1*i)._rotate(r),d=new n(u.x2,u.y1*i)._rotate(r),p=new n(u.x1,u.y2*i)._rotate(r),m=new n(u.x2,u.y2*i)._rotate(r),v=Math.max(0,Math.min(25,this.zoom+Math.log(u.maxScale)/Math.LN2)),g=Math.max(0,Math.min(25,this.zoom+Math.log(u.placementScale)/Math.LN2));this.addCollisionBoxVertex(e,f,h,v,g),this.addCollisionBoxVertex(e,f,d,v,g),this.addCollisionBoxVertex(e,f,d,v,g),this.addCollisionBoxVertex(e,f,m,v,g),this.addCollisionBoxVertex(e,f,m,v,g),this.addCollisionBoxVertex(e,f,p,v,g),this.addCollisionBoxVertex(e,f,p,v,g),this.addCollisionBoxVertex(e,f,h,v,g)}}}},_.prototype.addSymbolInstance=function(t,e,r,n,i,a,o,s,l,c,u,f,h,p,v,g,x,w,M){var k,A,T,E,S,L,C,P;if(r&&(C=a?y(t,r,f,e,i,p):[],S=new m(s,e,t,l,c,u,r,f,h,p,!1)),k=this.symbolQuadsArray.length,C&&C.length)for(var z=0;z<C.length;z++)this.addSymbolQuad(C[z]);A=this.symbolQuadsArray.length;var O=S?S.boxStartIndex:this.collisionBoxArray.length,D=S?S.boxEndIndex:this.collisionBoxArray.length;n&&(P=a?b(t,n,v,e,i,x,r,w,M):[],L=new m(s,e,t,l,c,u,n,v,g,x,!0)),T=this.symbolQuadsArray.length,P&&1===P.length&&this.addSymbolQuad(P[0]),E=this.symbolQuadsArray.length;var I=L?L.boxStartIndex:this.collisionBoxArray.length,R=L?L.boxEndIndex:this.collisionBoxArray.length;return E>_.MAX_QUADS&&d.warnOnce(\"Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907\"),A>_.MAX_QUADS&&d.warnOnce(\"Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907\"),this.symbolInstancesArray.emplaceBack(O,D,I,R,k,A,T,E,t.x,t.y,o)},_.prototype.addSymbolQuad=function(t){return this.symbolQuadsArray.emplaceBack(t.anchorPoint.x,t.anchorPoint.y,t.tl.x,t.tl.y,t.tr.x,t.tr.y,t.bl.x,t.bl.y,t.br.x,t.br.y,t.tex.h,t.tex.w,t.tex.x,t.tex.y,t.anchorAngle,t.glyphAngle,t.maxScale,t.minScale)}},{\"../../symbol/anchor\":363,\"../../symbol/clip_line\":365,\"../../symbol/collision_feature\":367,\"../../symbol/get_anchors\":369,\"../../symbol/mergelines\":372,\"../../symbol/quads\":373,\"../../symbol/resolve_text\":374,\"../../symbol/shaping\":375,\"../../util/token\":413,\"../../util/util\":414,\"../bucket\":301,\"../load_geometry\":309,\"point-geometry\":458}],306:[function(t,e,r){\"use strict\";function n(t,e,r){this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.attributes=e.members,this.itemSize=e.bytesPerElement,this.type=r,this.arrayType=e}e.exports=n,n.prototype.bind=function(t){var e=t[this.type];this.buffer?t.bindBuffer(e,this.buffer):(this.buffer=t.createBuffer(),t.bindBuffer(e,this.buffer),t.bufferData(e,this.arrayBuffer,t.STATIC_DRAW),this.arrayBuffer=null)};var i={Int8:\"BYTE\",Uint8:\"UNSIGNED_BYTE\",Int16:\"SHORT\",Uint16:\"UNSIGNED_SHORT\"};n.prototype.setVertexAttribPointers=function(t,e){for(var r=0;r<this.attributes.length;r++){var n=this.attributes[r],a=e[n.name];void 0!==a&&t.vertexAttribPointer(a,n.components,t[i[n.type]],!1,this.arrayType.bytesPerElement,n.offset)}},n.prototype.destroy=function(t){this.buffer&&t.deleteBuffer(this.buffer)},n.BufferType={VERTEX:\"ARRAY_BUFFER\",ELEMENT:\"ELEMENT_ARRAY_BUFFER\"}},{}],307:[function(t,e,r){\"use strict\";var n=t(\"../util/util\"),i=t(\"./buffer\"),a=t(\"../render/vertex_array_object\");function o(t,e){this.layoutVertexBuffer=new i(t.layoutVertexArray,e.layoutVertexArrayType,i.BufferType.VERTEX),t.elementArray&&(this.elementBuffer=new i(t.elementArray,e.elementArrayType,i.BufferType.ELEMENT));var r,o=this.vaos={};t.elementArray2&&(this.elementBuffer2=new i(t.elementArray2,e.elementArrayType2,i.BufferType.ELEMENT),r=this.secondVaos={}),this.paintVertexBuffers=n.mapObject(t.paintVertexArrays,function(n,s){return o[s]=new a,t.elementArray2&&(r[s]=new a),new i(n,e.paintVertexArrayTypes[s],i.BufferType.VERTEX)})}e.exports=o,o.prototype.destroy=function(t){for(var e in this.layoutVertexBuffer.destroy(t),this.elementBuffer&&this.elementBuffer.destroy(t),this.elementBuffer2&&this.elementBuffer2.destroy(t),this.paintVertexBuffers)this.paintVertexBuffers[e].destroy(t);for(var r in this.vaos)this.vaos[r].destroy(t);for(var n in this.secondVaos)this.secondVaos[n].destroy(t)}},{\"../render/vertex_array_object\":329,\"../util/util\":414,\"./buffer\":306}],308:[function(t,e,r){\"use strict\";var n=t(\"point-geometry\"),i=t(\"./load_geometry\"),a=t(\"./bucket\").EXTENT,o=t(\"feature-filter\"),s=t(\"../util/struct_array\"),l=t(\"grid-index\"),c=t(\"../util/dictionary_coder\"),u=t(\"vector-tile\"),f=t(\"pbf\"),h=t(\"../util/vectortile_to_geojson\"),d=t(\"../util/util\").arraysIntersect,p=t(\"../util/intersection_tests\"),m=p.multiPolygonIntersectsBufferedMultiPoint,v=p.multiPolygonIntersectsMultiPolygon,g=p.multiPolygonIntersectsBufferedMultiLine,y=new s({members:[{type:\"Uint32\",name:\"featureIndex\"},{type:\"Uint16\",name:\"sourceLayerIndex\"},{type:\"Uint16\",name:\"bucketIndex\"}]});function b(t,e,r){if(t.grid){var n=t,i=e;t=n.coord,e=n.overscaling,this.grid=new l(n.grid),this.featureIndexArray=new y(n.featureIndexArray),this.rawTileData=i,this.bucketLayerIDs=n.bucketLayerIDs}else this.grid=new l(a,16,0),this.featureIndexArray=new y;this.coord=t,this.overscaling=e,this.x=t.x,this.y=t.y,this.z=t.z-Math.log(e)/Math.LN2,this.setCollisionTile(r)}function x(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function _(t,e){return e-t}function w(t){return t[\"line-gap-width\"]>0?t[\"line-gap-width\"]+2*t[\"line-width\"]:t[\"line-width\"]}function M(t,e,r,i,a){if(!e[0]&&!e[1])return t;e=n.convert(e),\"viewport\"===r&&e._rotate(-i);for(var o=[],s=0;s<t.length;s++){for(var l=t[s],c=[],u=0;u<l.length;u++)c.push(l[u].sub(e._mult(a)));o.push(c)}return o}function k(t,e){for(var r=[],i=new n(0,0),a=0;a<t.length;a++){for(var o=t[a],s=[],l=0;l<o.length;l++){var c=o[l-1],u=o[l],f=o[l+1],h=0===l?i:u.sub(c)._unit()._perp(),d=l===o.length-1?i:f.sub(u)._unit()._perp(),p=h._add(d)._unit(),m=p.x*d.x+p.y*d.y;p._mult(1/m),s.push(p._mult(e)._add(u))}r.push(s)}return r}e.exports=b,b.prototype.insert=function(t,e,r,n){var a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(e,r,n);for(var o=i(t),s=0;s<o.length;s++){for(var l=o[s],c=[1/0,1/0,-1/0,-1/0],u=0;u<l.length;u++){var f=l[u];c[0]=Math.min(c[0],f.x),c[1]=Math.min(c[1],f.y),c[2]=Math.max(c[2],f.x),c[3]=Math.max(c[3],f.y)}this.grid.insert(a,c[0],c[1],c[2],c[3])}},b.prototype.setCollisionTile=function(t){this.collisionTile=t},b.prototype.serialize=function(){var t={coord:this.coord,overscaling:this.overscaling,grid:this.grid.toArrayBuffer(),featureIndexArray:this.featureIndexArray.serialize(),bucketLayerIDs:this.bucketLayerIDs};return{data:t,transferables:[t.grid,t.featureIndexArray.arrayBuffer]}},b.prototype.query=function(t,e){this.vtLayers||(this.vtLayers=new u.VectorTile(new f(new Uint8Array(this.rawTileData))).layers,this.sourceLayerCoder=new c(this.vtLayers?Object.keys(this.vtLayers).sort():[\"_geojsonTileLayer\"]));var r={},i=t.params||{},s=a/t.tileSize/t.scale,l=o(i.filter),h=0;for(var d in e){var p=e[d],m=p.paint,v=0;\"line\"===p.type?v=w(m)/2+Math.abs(m[\"line-offset\"])+x(m[\"line-translate\"]):\"fill\"===p.type?v=x(m[\"fill-translate\"]):\"circle\"===p.type&&(v=m[\"circle-radius\"]+x(m[\"circle-translate\"])),h=Math.max(h,v*s)}for(var g=t.queryGeometry.map(function(t){return t.map(function(t){return new n(t.x,t.y)})}),y=1/0,b=1/0,M=-1/0,k=-1/0,A=0;A<g.length;A++)for(var T=g[A],E=0;E<T.length;E++){var S=T[E];y=Math.min(y,S.x),b=Math.min(b,S.y),M=Math.max(M,S.x),k=Math.max(k,S.y)}var L=this.grid.query(y-h,b-h,M+h,k+h);L.sort(_),this.filterMatching(r,L,this.featureIndexArray,g,l,i.layers,e,t.bearing,s);var C=this.collisionTile.queryRenderedSymbols(y,b,M,k,t.scale);return C.sort(),this.filterMatching(r,C,this.collisionTile.collisionBoxArray,g,l,i.layers,e,t.bearing,s),r},b.prototype.filterMatching=function(t,e,r,n,a,o,s,l,c){for(var u,f=0;f<e.length;f++){var p=e[f];if(p!==u){u=p;var y=r.get(p),b=this.bucketLayerIDs[y.bucketIndex];if(!o||d(o,b)){var x=this.sourceLayerCoder.decode(y.sourceLayerIndex),_=this.vtLayers[x].feature(y.featureIndex);if(a(_))for(var A=null,T=0;T<b.length;T++){var E=b[T];if(!(o&&o.indexOf(E)<0)){var S=s[E];if(S){var L;if(\"symbol\"!==S.type){A||(A=i(_));var C=S.paint;if(\"line\"===S.type){L=M(n,C[\"line-translate\"],C[\"line-translate-anchor\"],l,c);var P=w(C)/2*c;if(C[\"line-offset\"]&&(A=k(A,C[\"line-offset\"]*c)),!g(L,A,P))continue}else if(\"fill\"===S.type){if(L=M(n,C[\"fill-translate\"],C[\"fill-translate-anchor\"],l,c),!v(L,A))continue}else if(\"circle\"===S.type){L=M(n,C[\"circle-translate\"],C[\"circle-translate-anchor\"],l,c);var z=C[\"circle-radius\"]*c;if(!m(L,A,z))continue}}var O=new h(_,this.z,this.x,this.y);O.layer=S.serialize({includeRefProperties:!0});var D=t[E];void 0===D&&(D=t[E]=[]),D.push(O)}}}}}}}},{\"../util/dictionary_coder\":404,\"../util/intersection_tests\":409,\"../util/struct_array\":412,\"../util/util\":414,\"../util/vectortile_to_geojson\":415,\"./bucket\":301,\"./load_geometry\":309,\"feature-filter\":141,\"grid-index\":254,pbf:451,\"point-geometry\":458,\"vector-tile\":544}],309:[function(t,e,r){\"use strict\";var n=t(\"../util/util\"),i=t(\"./bucket\").EXTENT,a=t(\"assert\");function o(t){return{min:-1*Math.pow(2,t-1),max:Math.pow(2,t-1)-1}}var s={15:o(15),16:o(16)};e.exports=function(t,e){var r=s[e||16];a(r);for(var o=i/t.extent,l=t.loadGeometry(),c=0;c<l.length;c++)for(var u=l[c],f=0;f<u.length;f++){var h=u[f];h.x=Math.round(h.x*o),h.y=Math.round(h.y*o),(h.x<r.min||h.x>r.max||h.y<r.min||h.y>r.max)&&n.warnOnce(\"Geometry exceeds allowed extent, reduce your vector tile buffer size\")}return l}},{\"../util/util\":414,\"./bucket\":301,assert:51}],310:[function(t,e,r){\"use strict\";function n(t,e,r){this.column=t,this.row=e,this.zoom=r}e.exports=n,n.prototype={clone:function(){return new n(this.column,this.row,this.zoom)},zoomTo:function(t){return this.clone()._zoomTo(t)},sub:function(t){return this.clone()._sub(t)},_zoomTo:function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this},_sub:function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this}}},{}],311:[function(t,e,r){\"use strict\";e.exports=i;var n=t(\"../util/util\").wrap;function i(t,e){if(isNaN(t)||isNaN(e))throw new Error(\"Invalid LngLat object: (\"+t+\", \"+e+\")\");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error(\"Invalid LngLat latitude value: must be between -90 and 90\")}i.prototype.wrap=function(){return new i(n(this.lng,-180,180),this.lat)},i.prototype.toArray=function(){return[this.lng,this.lat]},i.prototype.toString=function(){return\"LngLat(\"+this.lng+\", \"+this.lat+\")\"},i.convert=function(t){return t instanceof i?t:Array.isArray(t)?new i(t[0],t[1]):t}},{\"../util/util\":414}],312:[function(t,e,r){\"use strict\";e.exports=i;var n=t(\"./lng_lat\");function i(t,e){t&&(e?this.extend(t).extend(e):4===t.length?this.extend([t[0],t[1]]).extend([t[2],t[3]]):this.extend(t[0]).extend(t[1]))}i.prototype={extend:function(t){var e,r,a=this._sw,o=this._ne;if(t instanceof n)e=t,r=t;else{if(!(t instanceof i))return t?this.extend(n.convert(t)||i.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return a||o?(a.lng=Math.min(e.lng,a.lng),a.lat=Math.min(e.lat,a.lat),o.lng=Math.max(r.lng,o.lng),o.lat=Math.max(r.lat,o.lat)):(this._sw=new n(e.lng,e.lat),this._ne=new n(r.lng,r.lat)),this},getCenter:function(){return new n((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},getSouthWest:function(){return this._sw},getNorthEast:function(){return this._ne},getNorthWest:function(){return new n(this.getWest(),this.getNorth())},getSouthEast:function(){return new n(this.getEast(),this.getSouth())},getWest:function(){return this._sw.lng},getSouth:function(){return this._sw.lat},getEast:function(){return this._ne.lng},getNorth:function(){return this._ne.lat},toArray:function(){return[this._sw.toArray(),this._ne.toArray()]},toString:function(){return\"LngLatBounds(\"+this._sw.toString()+\", \"+this._ne.toString()+\")\"}},i.convert=function(t){return!t||t instanceof i?t:new i(t)}},{\"./lng_lat\":311}],313:[function(t,e,r){\"use strict\";var n=t(\"./lng_lat\"),i=t(\"point-geometry\"),a=t(\"./coordinate\"),o=t(\"../util/util\").wrap,s=t(\"../util/interpolate\"),l=t(\"../source/tile_coord\"),c=t(\"../data/bucket\").EXTENT,u=t(\"gl-matrix\"),f=u.vec4,h=u.mat4,d=u.mat2;function p(t,e){this.tileSize=512,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new n(0,0),this.zoom=0,this.angle=0,this._altitude=1.5,this._pitch=0,this._unmodified=!0}e.exports=p,p.prototype={get minZoom(){return this._minZoom},set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},get maxZoom(){return this._maxZoom},set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},get worldSize(){return this.tileSize*this.scale},get centerPoint(){return this.size._div(2)},get size(){return new i(this.width,this.height)},get bearing(){return-this.angle/Math.PI*180},set bearing(t){var e=-o(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=d.create(),d.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},get pitch(){return this._pitch/Math.PI*180},set pitch(t){var e=Math.min(60,t)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},get altitude(){return this._altitude},set altitude(t){var e=Math.max(.75,t);this._altitude!==e&&(this._unmodified=!1,this._altitude=e,this._calcMatrices())},get zoom(){return this._zoom},set zoom(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._calcMatrices(),this._constrain())},get center(){return this._center},set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._calcMatrices(),this._constrain())},coveringZoomLevel:function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},coveringTiles:function(t){var e=this.coveringZoomLevel(t),r=e;if(e<t.minzoom)return[];e>t.maxzoom&&(e=t.maxzoom);var n=this,a=n.locationCoordinate(n.center)._zoomTo(e),o=new i(a.column-.5,a.row-.5);return l.cover(e,[n.pointCoordinate(new i(0,0))._zoomTo(e),n.pointCoordinate(new i(n.width,0))._zoomTo(e),n.pointCoordinate(new i(n.width,n.height))._zoomTo(e),n.pointCoordinate(new i(0,n.height))._zoomTo(e)],t.reparseOverscaled?r:e).sort(function(t,e){return o.dist(t)-o.dist(e)})},resize:function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._calcMatrices(),this._constrain()},get unmodified(){return this._unmodified},zoomScale:function(t){return Math.pow(2,t)},scaleZoom:function(t){return Math.log(t)/Math.LN2},project:function(t,e){return new i(this.lngX(t.lng,e),this.latY(t.lat,e))},unproject:function(t,e){return new n(this.xLng(t.x,e),this.yLat(t.y,e))},get x(){return this.lngX(this.center.lng)},get y(){return this.latY(this.center.lat)},get point(){return new i(this.x,this.y)},lngX:function(t,e){return(180+t)*(e||this.worldSize)/360},latY:function(t,e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))*(e||this.worldSize)/360},xLng:function(t,e){return 360*t/(e||this.worldSize)-180},yLat:function(t,e){var r=180-360*t/(e||this.worldSize);return 360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90},panBy:function(t){var e=this.centerPoint._add(t);this.center=this.pointLocation(e)},setLocationAtPoint:function(t,e){var r=this.locationCoordinate(t),n=this.pointCoordinate(e),i=this.pointCoordinate(this.centerPoint),a=n._sub(r);this._unmodified=!1,this.center=this.coordinateLocation(i._sub(a))},locationPoint:function(t){return this.coordinatePoint(this.locationCoordinate(t))},pointLocation:function(t){return this.coordinateLocation(this.pointCoordinate(t))},locationCoordinate:function(t){var e=this.zoomScale(this.tileZoom)/this.worldSize,r=n.convert(t);return new a(this.lngX(r.lng)*e,this.latY(r.lat)*e,this.tileZoom)},coordinateLocation:function(t){var e=this.zoomScale(t.zoom);return new n(this.xLng(t.column,e),this.yLat(t.row,e))},pointCoordinate:function(t){var e=[t.x,t.y,0,1],r=[t.x,t.y,1,1];f.transformMat4(e,e,this.pixelMatrixInverse),f.transformMat4(r,r,this.pixelMatrixInverse);var n=e[3],i=r[3],o=e[0]/n,l=r[0]/i,c=e[1]/n,u=r[1]/i,h=e[2]/n,d=r[2]/i,p=h===d?0:(0-h)/(d-h),m=this.worldSize/this.zoomScale(this.tileZoom);return new a(s(o,l,p)/m,s(c,u,p)/m,this.tileZoom)},coordinatePoint:function(t){var e=this.worldSize/this.zoomScale(t.zoom),r=[t.column*e,t.row*e,0,1];return f.transformMat4(r,r,this.pixelMatrix),new i(r[0]/r[3],r[1]/r[3])},calculatePosMatrix:function(t,e){void 0===e&&(e=1/0),t instanceof l&&(t=t.toCoordinate(e));var r=Math.min(t.zoom,e),n=this.worldSize/Math.pow(2,r),i=new Float64Array(16);return h.identity(i),h.translate(i,i,[t.column*n,t.row*n,0]),h.scale(i,i,[n/c,n/c,1]),h.multiply(i,this.projMatrix,i),new Float32Array(i)},_constrain:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,n,a,o,s,l,c=this.size,u=this._unmodified;this.latRange&&(t=this.latY(this.latRange[1]),a=(e=this.latY(this.latRange[0]))-t<c.y?c.y/(e-t):0),this.lngRange&&(r=this.lngX(this.lngRange[0]),o=(n=this.lngX(this.lngRange[1]))-r<c.x?c.x/(n-r):0);var f=Math.max(o||0,a||0);if(f)return this.center=this.unproject(new i(o?(n+r)/2:this.x,a?(e+t)/2:this.y)),this.zoom+=this.scaleZoom(f),this._unmodified=u,void(this._constraining=!1);if(this.latRange){var h=this.y,d=c.y/2;h-d<t&&(l=t+d),h+d>e&&(l=e-d)}if(this.lngRange){var p=this.x,m=c.x/2;p-m<r&&(s=r+m),p+m>n&&(s=n-m)}void 0===s&&void 0===l||(this.center=this.unproject(new i(void 0!==s?s:this.x,void 0!==l?l:this.y))),this._unmodified=u,this._constraining=!1}},_calcMatrices:function(){if(this.height){var t=Math.atan(.5/this.altitude),e=Math.sin(t)*this.altitude/Math.sin(Math.PI/2-this._pitch-t),r=Math.cos(Math.PI/2-this._pitch)*e+this.altitude,n=new Float64Array(16);if(h.perspective(n,2*Math.atan(this.height/2/this.altitude),this.width/this.height,.1,r),h.translate(n,n,[0,0,-this.altitude]),h.scale(n,n,[1,-1,1/this.height]),h.rotateX(n,n,this._pitch),h.rotateZ(n,n,this.angle),h.translate(n,n,[-this.x,-this.y,0]),this.projMatrix=n,n=h.create(),h.scale(n,n,[this.width/2,-this.height/2,1]),h.translate(n,n,[1,-1,0]),this.pixelMatrix=h.multiply(new Float64Array(16),n,this.projMatrix),!(n=h.invert(new Float64Array(16),this.pixelMatrix)))throw new Error(\"failed to invert matrix\");this.pixelMatrixInverse=n}}}},{\"../data/bucket\":301,\"../source/tile_coord\":341,\"../util/interpolate\":408,\"../util/util\":414,\"./coordinate\":310,\"./lng_lat\":311,\"gl-matrix\":198,\"point-geometry\":458}],314:[function(t,e,r){\"use strict\";var n={\" \":[16,[]],\"!\":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'\"':[16,[4,21,4,14,-1,-1,12,21,12,14]],\"#\":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],\"%\":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],\"&\":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],\"'\":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],\"(\":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],\")\":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],\"*\":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],\"+\":[26,[13,18,13,0,-1,-1,4,9,22,9]],\",\":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],\"-\":[26,[4,9,22,9]],\".\":[10,[5,2,4,1,5,0,6,1,5,2]],\"/\":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],\":\":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],\";\":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],\"<\":[24,[20,18,4,9,20,0]],\"=\":[26,[4,12,22,12,-1,-1,4,6,22,6]],\">\":[24,[4,18,20,9,4,0]],\"?\":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],\"@\":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],\"[\":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],\"\\\\\":[14,[0,21,14,-3]],\"]\":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],\"^\":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],\"`\":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],\"{\":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],\"|\":[8,[4,25,4,-7]],\"}\":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],\"~\":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]};e.exports=function(t,e,r,i){i=i||1;var a,o,s,l,c,u,f,h,d=[];for(a=0,o=t.length;a<o;a++)if(c=n[t[a]]){for(h=null,s=0,l=c[1].length;s<l;s+=2)-1===c[1][s]&&-1===c[1][s+1]?h=null:(u=e+c[1][s]*i,f=r-c[1][s+1]*i,h&&d.push(h.x,h.y,u,f),h={x:u,y:f});e+=c[0]*i}return d}},{}],315:[function(t,e,r){\"use strict\";var n=e.exports={};n.version=t(\"../package.json\").version,n.Map=t(\"./ui/map\"),n.Control=t(\"./ui/control/control\"),n.Navigation=t(\"./ui/control/navigation\"),n.Geolocate=t(\"./ui/control/geolocate\"),n.Attribution=t(\"./ui/control/attribution\"),n.Popup=t(\"./ui/popup\"),n.Marker=t(\"./ui/marker\"),n.Style=t(\"./style/style\"),n.LngLat=t(\"./geo/lng_lat\"),n.LngLatBounds=t(\"./geo/lng_lat_bounds\"),n.Point=t(\"point-geometry\"),n.Evented=t(\"./util/evented\"),n.util=t(\"./util/util\"),n.supported=t(\"./util/browser\").supported;var i=t(\"./util/ajax\");n.util.getJSON=i.getJSON,n.util.getArrayBuffer=i.getArrayBuffer;var a=t(\"./util/config\");n.config=a,Object.defineProperty(n,\"accessToken\",{get:function(){return a.ACCESS_TOKEN},set:function(t){a.ACCESS_TOKEN=t}})},{\"../package.json\":416,\"./geo/lng_lat\":311,\"./geo/lng_lat_bounds\":312,\"./style/style\":350,\"./ui/control/attribution\":381,\"./ui/control/control\":382,\"./ui/control/geolocate\":383,\"./ui/control/navigation\":384,\"./ui/map\":393,\"./ui/marker\":394,\"./ui/popup\":395,\"./util/ajax\":397,\"./util/browser\":398,\"./util/config\":403,\"./util/evented\":406,\"./util/util\":414,\"point-geometry\":458}],316:[function(t,e,r){\"use strict\";var n=t(\"assert\");e.exports=function(t){for(var e={define:{},initialize:{}},r=0;r<t.length;r++){var i=t[r];n(\"u_\"===i.name.slice(0,2));var a=\"{precision} \"+(1===i.components?\"float\":\"vec\"+i.components);e.define[i.name.slice(2)]=\"uniform \"+a+\" \"+i.name+\";\\n\",e.initialize[i.name.slice(2)]=a+\" \"+i.name.slice(2)+\" = \"+i.name+\";\\n\"}return e}},{assert:51}],317:[function(t,e,r){\"use strict\";var n=t(\"../source/pixels_to_tile_units\"),i=t(\"./create_uniform_pragmas\"),a=512;e.exports=function(t,e,r){var o,s=t.gl,l=t.transform,c=r.paint[\"background-color\"],u=r.paint[\"background-pattern\"],f=r.paint[\"background-opacity\"],h=u?t.spriteAtlas.getPosition(u.from,!0):null,d=u?t.spriteAtlas.getPosition(u.to,!0):null;if(t.setDepthSublayer(0),h&&d){if(t.isOpaquePass)return;o=t.useProgram(\"pattern\"),s.uniform1i(o.u_image,0),s.uniform2fv(o.u_pattern_tl_a,h.tl),s.uniform2fv(o.u_pattern_br_a,h.br),s.uniform2fv(o.u_pattern_tl_b,d.tl),s.uniform2fv(o.u_pattern_br_b,d.br),s.uniform1f(o.u_opacity,f),s.uniform1f(o.u_mix,u.t),s.uniform2fv(o.u_pattern_size_a,h.size),s.uniform2fv(o.u_pattern_size_b,d.size),s.uniform1f(o.u_scale_a,u.fromScale),s.uniform1f(o.u_scale_b,u.toScale),s.activeTexture(s.TEXTURE0),t.spriteAtlas.bind(s,!0),t.tileExtentPatternVAO.bind(s,o,t.tileExtentBuffer)}else{if(t.isOpaquePass!==(1===c[3]))return;var p=i([{name:\"u_color\",components:4},{name:\"u_opacity\",components:1}]);o=t.useProgram(\"fill\",[],p,p),s.uniform4fv(o.u_color,c),s.uniform1f(o.u_opacity,f),t.tileExtentVAO.bind(s,o,t.tileExtentBuffer)}s.disable(s.STENCIL_TEST);for(var m=l.coveringTiles({tileSize:a}),v=0;v<m.length;v++){var g=m[v];if(h&&d){var y={coord:g,tileSize:a};s.uniform1f(o.u_tile_units_to_pixels,1/n(y,1,t.transform.tileZoom));var b=y.tileSize*Math.pow(2,t.transform.tileZoom-y.coord.z),x=b*(y.coord.x+g.w*Math.pow(2,y.coord.z)),_=b*y.coord.y;s.uniform2f(o.u_pixel_coord_upper,x>>16,_>>16),s.uniform2f(o.u_pixel_coord_lower,65535&x,65535&_)}s.uniformMatrix4fv(o.u_matrix,!1,t.transform.calculatePosMatrix(g)),s.drawArrays(s.TRIANGLE_STRIP,0,t.tileExtentBuffer.length)}s.stencilMask(0),s.stencilFunc(s.EQUAL,128,128)}},{\"../source/pixels_to_tile_units\":335,\"./create_uniform_pragmas\":316}],318:[function(t,e,r){\"use strict\";var n=t(\"../util/browser\");e.exports=function(t,e,r,i){if(t.isOpaquePass)return;var a=t.gl;t.setDepthSublayer(0),t.depthMask(!1),a.disable(a.STENCIL_TEST);for(var o=0;o<i.length;o++){var s=i[o],l=e.getTile(s),c=l.getBucket(r);if(c){var u=c.bufferGroups.circle;if(u){var f=c.paintAttributes.circle[r.id],h=t.useProgram(\"circle\",f.defines,f.vertexPragmas,f.fragmentPragmas);\"map\"===r.paint[\"circle-pitch-scale\"]?(a.uniform1i(h.u_scale_with_map,!0),a.uniform2f(h.u_extrude_scale,t.transform.pixelsToGLUnits[0]*t.transform.altitude,t.transform.pixelsToGLUnits[1]*t.transform.altitude)):(a.uniform1i(h.u_scale_with_map,!1),a.uniform2fv(h.u_extrude_scale,t.transform.pixelsToGLUnits)),a.uniform1f(h.u_devicepixelratio,n.devicePixelRatio),a.uniformMatrix4fv(h.u_matrix,!1,t.translatePosMatrix(s.posMatrix,l,r.paint[\"circle-translate\"],r.paint[\"circle-translate-anchor\"])),c.setUniforms(a,\"circle\",h,r,{zoom:t.transform.zoom});for(var d=0;d<u.length;d++){var p=u[d];p.vaos[r.id].bind(a,h,p.layoutVertexBuffer,p.elementBuffer,p.paintVertexBuffers[r.id]),a.drawElements(a.TRIANGLES,3*p.elementBuffer.length,a.UNSIGNED_SHORT,0)}}}}}},{\"../util/browser\":398}],319:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,n){var i=t.gl;i.enable(i.STENCIL_TEST);for(var a=t.useProgram(\"collisionbox\"),o=0;o<n.length;o++){var s=n[o],l=e.getTile(s),c=l.getBucket(r);if(c){var u=c.bufferGroups.collisionBox;if(u&&u.length){var f=u[0];0!==f.layoutVertexBuffer.length&&(i.uniformMatrix4fv(a.u_matrix,!1,s.posMatrix),t.enableTileClippingMask(s),t.lineWidth(1),i.uniform1f(a.u_scale,Math.pow(2,t.transform.zoom-l.coord.z)),i.uniform1f(a.u_zoom,10*t.transform.zoom),i.uniform1f(a.u_maxzoom,10*(l.coord.z+1)),f.vaos[r.id].bind(i,a,f.layoutVertexBuffer),i.drawArrays(i.LINES,0,f.layoutVertexBuffer.length))}}}}},{}],320:[function(t,e,r){\"use strict\";var n=t(\"../lib/debugtext\"),i=t(\"../util/browser\"),a=t(\"gl-matrix\").mat4,o=t(\"../data/bucket\").EXTENT,s=t(\"../data/buffer\"),l=t(\"./vertex_array_object\");function c(t,e,r){var c=t.gl;c.disable(c.STENCIL_TEST),t.lineWidth(1*i.devicePixelRatio);var u=r.posMatrix,f=t.useProgram(\"debug\");c.uniformMatrix4fv(f.u_matrix,!1,u),c.uniform4f(f.u_color,1,0,0,1),t.debugVAO.bind(c,f,t.debugBuffer),c.drawArrays(c.LINE_STRIP,0,t.debugBuffer.length);for(var h=n(r.toString(),50,200,5),d=new t.PosArray,p=0;p<h.length;p+=2)d.emplaceBack(h[p],h[p+1]);var m=new s(d.serialize(),t.PosArray.serialize(),s.BufferType.VERTEX);(new l).bind(c,f,m),c.uniform4f(f.u_color,1,1,1,1);for(var v=e.getTile(r).tileSize,g=o/(Math.pow(2,t.transform.zoom-r.z)*v),y=[[-1,-1],[-1,1],[1,-1],[1,1]],b=0;b<y.length;b++){var x=y[b];c.uniformMatrix4fv(f.u_matrix,!1,a.translate([],u,[g*x[0],g*x[1],0])),c.drawArrays(c.LINES,0,m.length)}c.uniform4f(f.u_color,0,0,0,1),c.uniformMatrix4fv(f.u_matrix,!1,u),c.drawArrays(c.LINES,0,m.length)}e.exports=function(t,e,r){if(t.isOpaquePass)return;if(!t.options.debug)return;for(var n=0;n<r.length;n++)c(t,e,r[n])}},{\"../data/bucket\":301,\"../data/buffer\":306,\"../lib/debugtext\":314,\"../util/browser\":398,\"./vertex_array_object\":329,\"gl-matrix\":198}],321:[function(t,e,r){\"use strict\";var n=t(\"../source/pixels_to_tile_units\");function i(t,e,r,n){var i=e.getTile(n),a=i.getBucket(r);if(a){var s=a.bufferGroups.fill;if(s){var l,c=t.gl,u=r.paint[\"fill-pattern\"];if(u)l=t.useProgram(\"pattern\"),o(u,r.paint[\"fill-opacity\"],i,n,t,l),c.activeTexture(c.TEXTURE0),t.spriteAtlas.bind(c,!0);else{var f=a.paintAttributes.fill[r.id];l=t.useProgram(\"fill\",f.defines,f.vertexPragmas,f.fragmentPragmas),a.setUniforms(c,\"fill\",l,r,{zoom:t.transform.zoom})}c.uniformMatrix4fv(l.u_matrix,!1,t.translatePosMatrix(n.posMatrix,i,r.paint[\"fill-translate\"],r.paint[\"fill-translate-anchor\"])),t.enableTileClippingMask(n);for(var h=0;h<s.length;h++){var d=s[h];d.vaos[r.id].bind(c,l,d.layoutVertexBuffer,d.elementBuffer,d.paintVertexBuffers[r.id]),c.drawElements(c.TRIANGLES,d.elementBuffer.length,c.UNSIGNED_SHORT,0)}}}}function a(t,e,r,n){var i=e.getTile(n),a=i.getBucket(r);if(a){var s,l=t.gl,c=a.bufferGroups.fill,u=r.paint[\"fill-pattern\"],f=r.paint[\"fill-opacity\"],h=r.getPaintProperty(\"fill-outline-color\");if(u&&!h)s=t.useProgram(\"outlinepattern\"),l.uniform2f(s.u_world,l.drawingBufferWidth,l.drawingBufferHeight);else{var d=a.paintAttributes.fill[r.id];s=t.useProgram(\"outline\",d.defines,d.vertexPragmas,d.fragmentPragmas),l.uniform2f(s.u_world,l.drawingBufferWidth,l.drawingBufferHeight),l.uniform1f(s.u_opacity,f),a.setUniforms(l,\"fill\",s,r,{zoom:t.transform.zoom})}l.uniformMatrix4fv(s.u_matrix,!1,t.translatePosMatrix(n.posMatrix,i,r.paint[\"fill-translate\"],r.paint[\"fill-translate-anchor\"])),u&&o(u,f,i,n,t,s),t.enableTileClippingMask(n);for(var p=0;p<c.length;p++){var m=c[p];m.secondVaos[r.id].bind(l,s,m.layoutVertexBuffer,m.elementBuffer2,m.paintVertexBuffers[r.id]),l.drawElements(l.LINES,2*m.elementBuffer2.length,l.UNSIGNED_SHORT,0)}}}function o(t,e,r,i,a,o){var s=a.gl,l=a.spriteAtlas.getPosition(t.from,!0),c=a.spriteAtlas.getPosition(t.to,!0);if(l&&c){s.uniform1i(o.u_image,0),s.uniform2fv(o.u_pattern_tl_a,l.tl),s.uniform2fv(o.u_pattern_br_a,l.br),s.uniform2fv(o.u_pattern_tl_b,c.tl),s.uniform2fv(o.u_pattern_br_b,c.br),s.uniform1f(o.u_opacity,e),s.uniform1f(o.u_mix,t.t),s.uniform1f(o.u_tile_units_to_pixels,1/n(r,1,a.transform.tileZoom)),s.uniform2fv(o.u_pattern_size_a,l.size),s.uniform2fv(o.u_pattern_size_b,c.size),s.uniform1f(o.u_scale_a,t.fromScale),s.uniform1f(o.u_scale_b,t.toScale);var u=r.tileSize*Math.pow(2,a.transform.tileZoom-r.coord.z),f=u*(r.coord.x+i.w*Math.pow(2,r.coord.z)),h=u*r.coord.y;s.uniform2f(o.u_pixel_coord_upper,f>>16,h>>16),s.uniform2f(o.u_pixel_coord_lower,65535&f,65535&h),s.activeTexture(s.TEXTURE0),a.spriteAtlas.bind(s,!0)}}e.exports=function(t,e,r,n){var o,s=t.gl;s.enable(s.STENCIL_TEST),o=!r.paint[\"fill-pattern\"]&&(r.isPaintValueFeatureConstant(\"fill-color\")&&r.isPaintValueFeatureConstant(\"fill-opacity\")&&1===r.paint[\"fill-color\"][3]&&1===r.paint[\"fill-opacity\"]);if(t.isOpaquePass===o){t.setDepthSublayer(1);for(var l=0;l<n.length;l++)i(t,e,r,n[l])}if(!t.isOpaquePass&&r.paint[\"fill-antialias\"]){t.lineWidth(2),t.depthMask(!1);var c=r.getPaintProperty(\"fill-outline-color\");(c||!r.paint[\"fill-pattern\"])&&c?t.setDepthSublayer(2):t.setDepthSublayer(0);for(var u=0;u<n.length;u++)a(t,e,r,n[u])}}},{\"../source/pixels_to_tile_units\":335}],322:[function(t,e,r){\"use strict\";var n=t(\"../util/browser\"),i=t(\"gl-matrix\").mat2,a=t(\"../source/pixels_to_tile_units\");e.exports=function(t,e,r,o){if(!t.isOpaquePass){t.setDepthSublayer(0),t.depthMask(!1);var s=t.gl;if(s.enable(s.STENCIL_TEST),!(r.paint[\"line-width\"]<=0)){var l=1/n.devicePixelRatio,c=r.paint[\"line-blur\"]+l,u=r.paint[\"line-color\"],f=t.transform,h=i.create();i.scale(h,h,[1,Math.cos(f._pitch)]),i.rotate(h,h,t.transform.angle);var d,p,m,v,g,y=Math.sqrt(f.height*f.height/4*(1+f.altitude*f.altitude)),b=(y+f.height/2*Math.tan(f._pitch))/y-1,x=r.paint[\"line-dasharray\"],_=r.paint[\"line-pattern\"];if(x)d=t.useProgram(\"linesdfpattern\"),s.uniform1f(d.u_linewidth,r.paint[\"line-width\"]/2),s.uniform1f(d.u_gapwidth,r.paint[\"line-gap-width\"]/2),s.uniform1f(d.u_antialiasing,l/2),s.uniform1f(d.u_blur,c),s.uniform4fv(d.u_color,u),s.uniform1f(d.u_opacity,r.paint[\"line-opacity\"]),p=t.lineAtlas.getDash(x.from,\"round\"===r.layout[\"line-cap\"]),m=t.lineAtlas.getDash(x.to,\"round\"===r.layout[\"line-cap\"]),s.uniform1i(d.u_image,0),s.activeTexture(s.TEXTURE0),t.lineAtlas.bind(s),s.uniform1f(d.u_tex_y_a,p.y),s.uniform1f(d.u_tex_y_b,m.y),s.uniform1f(d.u_mix,x.t),s.uniform1f(d.u_extra,b),s.uniform1f(d.u_offset,-r.paint[\"line-offset\"]),s.uniformMatrix2fv(d.u_antialiasingmatrix,!1,h);else if(_){if(v=t.spriteAtlas.getPosition(_.from,!0),g=t.spriteAtlas.getPosition(_.to,!0),!v||!g)return;d=t.useProgram(\"linepattern\"),s.uniform1i(d.u_image,0),s.activeTexture(s.TEXTURE0),t.spriteAtlas.bind(s,!0),s.uniform1f(d.u_linewidth,r.paint[\"line-width\"]/2),s.uniform1f(d.u_gapwidth,r.paint[\"line-gap-width\"]/2),s.uniform1f(d.u_antialiasing,l/2),s.uniform1f(d.u_blur,c),s.uniform2fv(d.u_pattern_tl_a,v.tl),s.uniform2fv(d.u_pattern_br_a,v.br),s.uniform2fv(d.u_pattern_tl_b,g.tl),s.uniform2fv(d.u_pattern_br_b,g.br),s.uniform1f(d.u_fade,_.t),s.uniform1f(d.u_opacity,r.paint[\"line-opacity\"]),s.uniform1f(d.u_extra,b),s.uniform1f(d.u_offset,-r.paint[\"line-offset\"]),s.uniformMatrix2fv(d.u_antialiasingmatrix,!1,h)}else d=t.useProgram(\"line\"),s.uniform1f(d.u_linewidth,r.paint[\"line-width\"]/2),s.uniform1f(d.u_gapwidth,r.paint[\"line-gap-width\"]/2),s.uniform1f(d.u_antialiasing,l/2),s.uniform1f(d.u_blur,c),s.uniform1f(d.u_extra,b),s.uniform1f(d.u_offset,-r.paint[\"line-offset\"]),s.uniformMatrix2fv(d.u_antialiasingmatrix,!1,h),s.uniform4fv(d.u_color,u),s.uniform1f(d.u_opacity,r.paint[\"line-opacity\"]);for(var w=0;w<o.length;w++){var M=o[w],k=e.getTile(M),A=k.getBucket(r);if(A){var T=A.bufferGroups.line;if(T){t.enableTileClippingMask(M);var E=t.translatePosMatrix(M.posMatrix,k,r.paint[\"line-translate\"],r.paint[\"line-translate-anchor\"]);s.uniformMatrix4fv(d.u_matrix,!1,E);var S=1/a(k,1,t.transform.zoom);if(x){var L=p.width*x.fromScale,C=m.width*x.toScale,P=[1/a(k,L,t.transform.tileZoom),-p.height/2],z=[1/a(k,C,t.transform.tileZoom),-m.height/2],O=t.lineAtlas.width/(256*Math.min(L,C)*n.devicePixelRatio)/2;s.uniform1f(d.u_ratio,S),s.uniform2fv(d.u_patternscale_a,P),s.uniform2fv(d.u_patternscale_b,z),s.uniform1f(d.u_sdfgamma,O)}else _?(s.uniform1f(d.u_ratio,S),s.uniform2fv(d.u_pattern_size_a,[a(k,v.size[0]*_.fromScale,t.transform.tileZoom),g.size[1]]),s.uniform2fv(d.u_pattern_size_b,[a(k,g.size[0]*_.toScale,t.transform.tileZoom),g.size[1]])):s.uniform1f(d.u_ratio,S);for(var D=0;D<T.length;D++){var I=T[D];I.vaos[r.id].bind(s,d,I.layoutVertexBuffer,I.elementBuffer),s.drawElements(s.TRIANGLES,3*I.elementBuffer.length,s.UNSIGNED_SHORT,0)}}}}}}}},{\"../source/pixels_to_tile_units\":335,\"../util/browser\":398,\"gl-matrix\":198}],323:[function(t,e,r){\"use strict\";var n=t(\"../util/util\"),i=t(\"../util/struct_array\");function a(t,e,r,n){if(!t.isOpaquePass){var i=t.gl;i.enable(i.DEPTH_TEST),t.depthMask(!0),i.depthFunc(i.LESS);for(var a=n.length&&n[0].z,s=0;s<n.length;s++){var l=n[s];t.setDepthSublayer(l.z-a),o(t,e,r,l)}i.depthFunc(i.LEQUAL)}}function o(t,e,r,i){var a=t.gl;a.disable(a.STENCIL_TEST);var o,s,l=e.getTile(i),c=t.transform.calculatePosMatrix(i,e.maxzoom),u=t.useProgram(\"raster\");a.uniformMatrix4fv(u.u_matrix,!1,c),a.uniform1f(u.u_brightness_low,r.paint[\"raster-brightness-min\"]),a.uniform1f(u.u_brightness_high,r.paint[\"raster-brightness-max\"]),a.uniform1f(u.u_saturation_factor,(o=r.paint[\"raster-saturation\"])>0?1-1/(1.001-o):-o),a.uniform1f(u.u_contrast_factor,(s=r.paint[\"raster-contrast\"])>0?1/(1-s):1+s),a.uniform3fv(u.u_spin_weights,function(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}(r.paint[\"raster-hue-rotate\"]));var f,h,d=l.source&&l.source.findLoadedParent(i,0,{}),p=function(t,e,r,i){var a=[1,0],o=r.paint[\"raster-fade-duration\"];if(t.source&&o>0){var s=(new Date).getTime(),l=(s-t.timeAdded)/o,c=e?(s-e.timeAdded)/o:-1,u=i.coveringZoomLevel(t.source),f=!!e&&Math.abs(e.coord.z-u)>Math.abs(t.coord.z-u);!e||f?(a[0]=n.clamp(l,0,1),a[1]=1-a[0]):(a[0]=n.clamp(1-c,0,1),a[1]=1-a[0])}var h=r.paint[\"raster-opacity\"];return a[0]*=h,a[1]*=h,a}(l,d,r,t.transform);a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,l.texture),a.activeTexture(a.TEXTURE1),d?(a.bindTexture(a.TEXTURE_2D,d.texture),f=Math.pow(2,d.coord.z-l.coord.z),h=[l.coord.x*f%1,l.coord.y*f%1]):(a.bindTexture(a.TEXTURE_2D,l.texture),p[1]=0),a.uniform2fv(u.u_tl_parent,h||[0,0]),a.uniform1f(u.u_scale_parent,f||1),a.uniform1f(u.u_buffer_scale,1),a.uniform1f(u.u_opacity0,p[0]),a.uniform1f(u.u_opacity1,p[1]),a.uniform1i(u.u_image0,0),a.uniform1i(u.u_image1,1);var m=l.boundsBuffer||t.rasterBoundsBuffer;(l.boundsVAO||t.rasterBoundsVAO).bind(a,u,m),a.drawArrays(a.TRIANGLE_STRIP,0,m.length)}e.exports=a,a.RasterBoundsArray=new i({members:[{name:\"a_pos\",type:\"Int16\",components:2},{name:\"a_texture_pos\",type:\"Int16\",components:2}]})},{\"../util/struct_array\":412,\"../util/util\":414}],324:[function(t,e,r){\"use strict\";var n=t(\"../util/browser\"),i=t(\"./draw_collision_debug\"),a=t(\"../source/pixels_to_tile_units\");function o(t,e,r,n,i,a,o,l,c,u,f,h,d,p,m){for(var v=0;v<n.length;v++){var g=e.getTile(n[v]),y=g.getBucket(r);if(y){var b=y.bufferGroups,x=i?b.glyph:b.icon;x.length&&(t.enableTileClippingMask(n[v]),s(t,r,n[v].posMatrix,g,y,x,i,i||y.sdfIcons,!i&&y.iconsNeedLinear,i?y.adjustedTextSize:y.adjustedIconSize,y.fontstack,a,o,l,c,u,f,h,d,p,m))}}}function s(t,e,r,i,o,s,l,c,u,f,h,d,p,m,v,g,y,b,x,_,w){var M,k,A,T=t.gl,E=t.transform,S=\"map\"===m,L=\"map\"===v,C=l?24:1,P=g/C;if(L?(k=a(i,1,t.transform.zoom)*P,A=1/Math.cos(E._pitch),M=[k,k]):(k=t.transform.altitude*P,A=1,M=[E.pixelsToGLUnits[0]*k,E.pixelsToGLUnits[1]*k]),l||t.style.sprite.loaded()){var z=t.useProgram(c?\"sdf\":\"icon\");if(T.uniformMatrix4fv(z.u_matrix,!1,t.translatePosMatrix(r,i,d,p)),T.uniform1i(z.u_rotate_with_map,S),T.uniform1i(z.u_pitch_with_map,L),T.uniform2fv(z.u_extrude_scale,M),T.activeTexture(T.TEXTURE0),T.uniform1i(z.u_texture,0),l){var O=h&&t.glyphSource.getGlyphAtlas(h);if(!O)return;O.updateTexture(T),T.uniform2f(z.u_texsize,O.width/4,O.height/4)}else{var D=t.options.rotating||t.options.zooming,I=1!==P||n.devicePixelRatio!==t.spriteAtlas.pixelRatio||u,R=L||t.transform.pitch;t.spriteAtlas.bind(T,c||D||I||R),T.uniform2f(z.u_texsize,t.spriteAtlas.width/4,t.spriteAtlas.height/4)}var N,F=Math.log(g/f)/Math.LN2||0;if(T.uniform1f(z.u_zoom,10*(t.transform.zoom-F)),T.activeTexture(T.TEXTURE1),t.frameHistory.bind(T),T.uniform1i(z.u_fadetexture,1),c){var j=.105*C/g/n.devicePixelRatio;if(y){T.uniform1f(z.u_gamma,(1.19*x/P/8+j)*A),T.uniform4fv(z.u_color,b),T.uniform1f(z.u_opacity,_),T.uniform1f(z.u_buffer,(6-y/P)/8);for(var B=0;B<s.length;B++)(N=s[B]).vaos[e.id].bind(T,z,N.layoutVertexBuffer,N.elementBuffer),T.drawElements(T.TRIANGLES,3*N.elementBuffer.length,T.UNSIGNED_SHORT,0)}T.uniform1f(z.u_gamma,j*A),T.uniform4fv(z.u_color,w),T.uniform1f(z.u_opacity,_),T.uniform1f(z.u_buffer,.75),T.uniform1f(z.u_pitch,E.pitch/360*2*Math.PI),T.uniform1f(z.u_bearing,E.bearing/360*2*Math.PI),T.uniform1f(z.u_aspect_ratio,E.width/E.height);for(var U=0;U<s.length;U++)(N=s[U]).vaos[e.id].bind(T,z,N.layoutVertexBuffer,N.elementBuffer),T.drawElements(T.TRIANGLES,3*N.elementBuffer.length,T.UNSIGNED_SHORT,0)}else{T.uniform1f(z.u_opacity,_);for(var V=0;V<s.length;V++)(N=s[V]).vaos[e.id].bind(T,z,N.layoutVertexBuffer,N.elementBuffer),T.drawElements(T.TRIANGLES,3*N.elementBuffer.length,T.UNSIGNED_SHORT,0)}}}e.exports=function(t,e,r,n){if(t.isOpaquePass)return;var a=!(r.layout[\"text-allow-overlap\"]||r.layout[\"icon-allow-overlap\"]||r.layout[\"text-ignore-placement\"]||r.layout[\"icon-ignore-placement\"]),s=t.gl;a?s.disable(s.STENCIL_TEST):s.enable(s.STENCIL_TEST);t.setDepthSublayer(0),t.depthMask(!1),s.disable(s.DEPTH_TEST),o(t,e,r,n,!1,r.paint[\"icon-translate\"],r.paint[\"icon-translate-anchor\"],r.layout[\"icon-rotation-alignment\"],r.layout[\"icon-rotation-alignment\"],r.layout[\"icon-size\"],r.paint[\"icon-halo-width\"],r.paint[\"icon-halo-color\"],r.paint[\"icon-halo-blur\"],r.paint[\"icon-opacity\"],r.paint[\"icon-color\"]),o(t,e,r,n,!0,r.paint[\"text-translate\"],r.paint[\"text-translate-anchor\"],r.layout[\"text-rotation-alignment\"],r.layout[\"text-pitch-alignment\"],r.layout[\"text-size\"],r.paint[\"text-halo-width\"],r.paint[\"text-halo-color\"],r.paint[\"text-halo-blur\"],r.paint[\"text-opacity\"],r.paint[\"text-color\"]),s.enable(s.DEPTH_TEST),e.map.showCollisionBoxes&&i(t,e,r,n)}},{\"../source/pixels_to_tile_units\":335,\"../util/browser\":398,\"./draw_collision_debug\":319}],325:[function(t,e,r){\"use strict\";function n(){this.changeTimes=new Float64Array(256),this.changeOpacities=new Uint8Array(256),this.opacities=new Uint8ClampedArray(256),this.array=new Uint8Array(this.opacities.buffer),this.fadeDuration=300,this.previousZoom=0,this.firstFrame=!0}e.exports=n,n.prototype.record=function(t){var e,r=Date.now();if(this.firstFrame&&(r=0,this.firstFrame=!1),(t=Math.floor(10*t))<this.previousZoom)for(e=t+1;e<=this.previousZoom;e++)this.changeTimes[e]=r,this.changeOpacities[e]=this.opacities[e];else for(e=t;e>this.previousZoom;e--)this.changeTimes[e]=r,this.changeOpacities[e]=this.opacities[e];for(e=0;e<256;e++){var n=(r-this.changeTimes[e])/this.fadeDuration*255;this.opacities[e]=e<=t?this.changeOpacities[e]+n:this.changeOpacities[e]-n}this.changed=!0,this.previousZoom=t},n.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.changed&&(t.texSubImage2D(t.TEXTURE_2D,0,0,0,256,1,t.ALPHA,t.UNSIGNED_BYTE,this.array),this.changed=!1)):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,256,1,0,t.ALPHA,t.UNSIGNED_BYTE,this.array))}},{}],326:[function(t,e,r){\"use strict\";var n=t(\"../util/util\");function i(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}}e.exports=i,i.prototype.setSprite=function(t){this.sprite=t},i.prototype.getDash=function(t,e){var r=t.join(\",\")+e;return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},i.prototype.addDash=function(t,e){var r=e?7:0,i=2*r+1;if(this.nextRow+i>this.height)return n.warnOnce(\"LineAtlas out of space\"),null;for(var a=0,o=0;o<t.length;o++)a+=t[o];for(var s=this.width/a,l=s/2,c=t.length%2==1,u=-r;u<=r;u++)for(var f=this.nextRow+r+u,h=this.width*f,d=c?-t[t.length-1]:0,p=t[0],m=1,v=0;v<this.width;v++){for(;p<v/s;)d=p,p+=t[m],c&&m===t.length-1&&(p+=t[0]),m++;var g,y=Math.abs(v-d*s),b=Math.abs(v-p*s),x=Math.min(y,b),_=m%2==1;if(e){var w=r?u/r*(l+1):0;if(_){var M=l-Math.abs(w);g=Math.sqrt(x*x+M*M)}else g=l-Math.sqrt(x*x+w*w)}else g=(_?1:-1)*x;this.data[3+4*(h+v)]=Math.max(0,Math.min(255,g+128))}var k={y:(this.nextRow+r+.5)/this.height,height:2*r/this.height,width:a};return this.nextRow+=i,this.dirty=!0,k},i.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.RGBA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,this.data))}},{\"../util/util\":414}],327:[function(t,e,r){\"use strict\";var n=t(\"../util/browser\"),i=t(\"gl-matrix\").mat4,a=t(\"./frame_history\"),o=t(\"../source/source_cache\"),s=t(\"../data/bucket\").EXTENT,l=t(\"../source/pixels_to_tile_units\"),c=t(\"../util/util\"),u=t(\"../util/struct_array\"),f=t(\"../data/buffer\"),h=t(\"./vertex_array_object\"),d=t(\"./draw_raster\").RasterBoundsArray,p=t(\"./create_uniform_pragmas\");function m(t,e){this.gl=t,this.transform=e,this.reusableTextures={},this.preFbos={},this.frameHistory=new a,this.setup(),this.numSublayers=o.maxUnderzooming+o.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.lineWidthRange=t.getParameter(t.ALIASED_LINE_WIDTH_RANGE)}e.exports=m,c.extend(m.prototype,t(\"./painter/use_program\")),m.prototype.resize=function(t,e){var r=this.gl;this.width=t*n.devicePixelRatio,this.height=e*n.devicePixelRatio,r.viewport(0,0,this.width,this.height)},m.prototype.setup=function(){var t=this.gl;t.verbose=!0,t.enable(t.BLEND),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),t.enable(t.STENCIL_TEST),t.enable(t.DEPTH_TEST),t.depthFunc(t.LEQUAL),this._depthMask=!1,t.depthMask(!1);var e=this.PosArray=new u({members:[{name:\"a_pos\",type:\"Int16\",components:2}]}),r=new e;r.emplaceBack(0,0),r.emplaceBack(s,0),r.emplaceBack(0,s),r.emplaceBack(s,s),this.tileExtentBuffer=new f(r.serialize(),e.serialize(),f.BufferType.VERTEX),this.tileExtentVAO=new h,this.tileExtentPatternVAO=new h;var n=new e;n.emplaceBack(0,0),n.emplaceBack(s,0),n.emplaceBack(s,s),n.emplaceBack(0,s),n.emplaceBack(0,0),this.debugBuffer=new f(n.serialize(),e.serialize(),f.BufferType.VERTEX),this.debugVAO=new h;var i=new d;i.emplaceBack(0,0,0,0),i.emplaceBack(s,0,32767,0),i.emplaceBack(0,s,0,32767),i.emplaceBack(s,s,32767,32767),this.rasterBoundsBuffer=new f(i.serialize(),d.serialize(),f.BufferType.VERTEX),this.rasterBoundsVAO=new h},m.prototype.clearColor=function(){var t=this.gl;t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT)},m.prototype.clearStencil=function(){var t=this.gl;t.clearStencil(0),t.stencilMask(255),t.clear(t.STENCIL_BUFFER_BIT)},m.prototype.clearDepth=function(){var t=this.gl;t.clearDepth(1),this.depthMask(!0),t.clear(t.DEPTH_BUFFER_BIT)},m.prototype._renderTileClippingMasks=function(t){var e=this.gl;e.colorMask(!1,!1,!1,!1),this.depthMask(!1),e.disable(e.DEPTH_TEST),e.enable(e.STENCIL_TEST),e.stencilMask(248),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE);var r=1;this._tileClippingMaskIDs={};for(var n=0;n<t.length;n++){var i=t[n],a=this._tileClippingMaskIDs[i.id]=r++<<3;e.stencilFunc(e.ALWAYS,a,248);var o=p([{name:\"u_color\",components:4},{name:\"u_opacity\",components:1}]),s=this.useProgram(\"fill\",[],o,o);e.uniformMatrix4fv(s.u_matrix,!1,i.posMatrix),this.tileExtentVAO.bind(e,s,this.tileExtentBuffer),e.drawArrays(e.TRIANGLE_STRIP,0,this.tileExtentBuffer.length)}e.stencilMask(0),e.colorMask(!0,!0,!0,!0),this.depthMask(!0),e.enable(e.DEPTH_TEST)},m.prototype.enableTileClippingMask=function(t){var e=this.gl;e.stencilFunc(e.EQUAL,this._tileClippingMaskIDs[t.id],248)},m.prototype.prepareBuffers=function(){},m.prototype.bindDefaultFramebuffer=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,null)};var v={symbol:t(\"./draw_symbol\"),circle:t(\"./draw_circle\"),line:t(\"./draw_line\"),fill:t(\"./draw_fill\"),raster:t(\"./draw_raster\"),background:t(\"./draw_background\"),debug:t(\"./draw_debug\")};m.prototype.render=function(t,e){this.style=t,this.options=e,this.lineAtlas=t.lineAtlas,this.spriteAtlas=t.spriteAtlas,this.spriteAtlas.setSprite(t.sprite),this.glyphSource=t.glyphSource,this.frameHistory.record(this.transform.zoom),this.prepareBuffers(),this.clearColor(),this.clearDepth(),this.showOverdrawInspector(e.showOverdrawInspector),this.depthRange=(t._order.length+2)*this.numSublayers*this.depthEpsilon,this.renderPass({isOpaquePass:!0}),this.renderPass({isOpaquePass:!1})},m.prototype.renderPass=function(t){var e=this.style._groups,r=t.isOpaquePass;this.currentLayer=r?this.style._order.length:-1;for(var n=0;n<e.length;n++){var i,a=e[r?e.length-1-n:n],o=this.style.sources[a.source],s=[];if(o){for(s=o.getVisibleCoordinates(),i=0;i<s.length;i++)s[i].posMatrix=this.transform.calculatePosMatrix(s[i],o.maxzoom);this.clearStencil(),o.prepare&&o.prepare(),o.isTileClipped&&this._renderTileClippingMasks(s)}for(r?(this._showOverdrawInspector||this.gl.disable(this.gl.BLEND),this.isOpaquePass=!0):(this.gl.enable(this.gl.BLEND),this.isOpaquePass=!1,s.reverse()),i=0;i<a.length;i++){var l=a[r?a.length-1-i:i];this.currentLayer+=r?-1:1,this.renderLayer(this,o,l,s)}o&&v.debug(this,o,s)}},m.prototype.depthMask=function(t){t!==this._depthMask&&(this._depthMask=t,this.gl.depthMask(t))},m.prototype.renderLayer=function(t,e,r,n){r.isHidden(this.transform.zoom)||(\"background\"===r.type||n.length)&&(this.id=r.id,v[r.type](t,e,r,n))},m.prototype.setDepthSublayer=function(t){var e=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon,r=e-1+this.depthRange;this.gl.depthRange(r,e)},m.prototype.translatePosMatrix=function(t,e,r,n){if(!r[0]&&!r[1])return t;if(\"viewport\"===n){var a=Math.sin(-this.transform.angle),o=Math.cos(-this.transform.angle);r=[r[0]*o-r[1]*a,r[0]*a+r[1]*o]}var s=[l(e,r[0],this.transform.zoom),l(e,r[1],this.transform.zoom),0],c=new Float32Array(16);return i.translate(c,t,s),c},m.prototype.saveTexture=function(t){var e=this.reusableTextures[t.size];e?e.push(t):this.reusableTextures[t.size]=[t]},m.prototype.getTexture=function(t){var e=this.reusableTextures[t];return e&&e.length>0?e.pop():null},m.prototype.lineWidth=function(t){this.gl.lineWidth(c.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},m.prototype.showOverdrawInspector=function(t){if(t||this._showOverdrawInspector){this._showOverdrawInspector=t;var e=this.gl;if(t){e.blendFunc(e.CONSTANT_COLOR,e.ONE);e.blendColor(1/8,1/8,1/8,0),e.clearColor(0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)}else e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}}},{\"../data/bucket\":301,\"../data/buffer\":306,\"../source/pixels_to_tile_units\":335,\"../source/source_cache\":339,\"../util/browser\":398,\"../util/struct_array\":412,\"../util/util\":414,\"./create_uniform_pragmas\":316,\"./draw_background\":317,\"./draw_circle\":318,\"./draw_debug\":320,\"./draw_fill\":321,\"./draw_line\":322,\"./draw_raster\":323,\"./draw_symbol\":324,\"./frame_history\":325,\"./painter/use_program\":328,\"./vertex_array_object\":329,\"gl-matrix\":198}],328:[function(t,e,r){\"use strict\";var n=t(\"assert\"),i=t(\"../../util/util\"),a=t(\"mapbox-gl-shaders\"),o=a.util;function s(t,e){return t.replace(/#pragma mapbox: ([\\w]+) ([\\w]+) ([\\w]+) ([\\w]+)/g,function(t,r,n,i,a){return e[r][a].replace(/{type}/g,i).replace(/{precision}/g,n)})}e.exports._createProgram=function(t,e,r,l){for(var c=this.gl,u=c.createProgram(),f=a[t],h=\"#define MAPBOX_GL_JS;\\n\",d=0;d<e.length;d++)h+=\"#define \"+e[d]+\";\\n\";var p=c.createShader(c.FRAGMENT_SHADER);c.shaderSource(p,s(h+f.fragmentSource,l)),c.compileShader(p),n(c.getShaderParameter(p,c.COMPILE_STATUS),c.getShaderInfoLog(p)),c.attachShader(u,p);var m=c.createShader(c.VERTEX_SHADER);c.shaderSource(m,s(h+o+f.vertexSource,r)),c.compileShader(m),n(c.getShaderParameter(m,c.COMPILE_STATUS),c.getShaderInfoLog(m)),c.attachShader(u,m),c.linkProgram(u),n(c.getProgramParameter(u,c.LINK_STATUS),c.getProgramInfoLog(u));for(var v={},g=c.getProgramParameter(u,c.ACTIVE_ATTRIBUTES),y=0;y<g;y++){var b=c.getActiveAttrib(u,y);v[b.name]=c.getAttribLocation(u,b.name)}for(var x={},_=c.getProgramParameter(u,c.ACTIVE_UNIFORMS),w=0;w<_;w++){var M=c.getActiveUniform(u,w);x[M.name]=c.getUniformLocation(u,M.name)}return i.extend({program:u,definition:f,attributes:v,numAttributes:g},v,x)},e.exports._createProgramCached=function(t,e,r,n){this.cache=this.cache||{};var i=JSON.stringify({name:t,defines:e,vertexPragmas:r,fragmentPragmas:n});return this.cache[i]||(this.cache[i]=this._createProgram(t,e,r,n)),this.cache[i]},e.exports.useProgram=function(t,e,r,n){var i=this.gl;e=e||[],this._showOverdrawInspector&&(e=e.concat(\"OVERDRAW_INSPECTOR\"));var a=this._createProgramCached(t,e,r,n);return this.currentProgram!==a&&(i.useProgram(a.program),this.currentProgram=a),a}},{\"../../util/util\":414,assert:51,\"mapbox-gl-shaders\":275}],329:[function(t,e,r){\"use strict\";var n=t(\"assert\");function i(){this.boundProgram=null,this.boundVertexBuffer=null,this.boundVertexBuffer2=null,this.boundElementBuffer=null,this.vao=null}e.exports=i,i.prototype.bind=function(t,e,r,n,i){void 0===t.extVertexArrayObject&&(t.extVertexArrayObject=t.getExtension(\"OES_vertex_array_object\"));var a=!this.vao||this.boundProgram!==e||this.boundVertexBuffer!==r||this.boundVertexBuffer2!==i||this.boundElementBuffer!==n;!t.extVertexArrayObject||a?this.freshBind(t,e,r,n,i):t.extVertexArrayObject.bindVertexArrayOES(this.vao)},i.prototype.freshBind=function(t,e,r,i,a){var o,s=e.numAttributes;if(t.extVertexArrayObject)this.vao&&this.destroy(t),this.vao=t.extVertexArrayObject.createVertexArrayOES(),t.extVertexArrayObject.bindVertexArrayOES(this.vao),o=0,this.boundProgram=e,this.boundVertexBuffer=r,this.boundVertexBuffer2=a,this.boundElementBuffer=i;else{o=t.currentNumAttributes||0;for(var l=s;l<o;l++)n(0!==l),t.disableVertexAttribArray(l)}for(var c=o;c<s;c++)t.enableVertexAttribArray(c);r.bind(t),r.setVertexAttribPointers(t,e),a&&(a.bind(t),a.setVertexAttribPointers(t,e)),i&&i.bind(t),t.currentNumAttributes=s},i.prototype.unbind=function(t){var e=t.extVertexArrayObject;e&&e.bindVertexArrayOES(null)},i.prototype.destroy=function(t){var e=t.extVertexArrayObject;e&&this.vao&&(e.deleteVertexArrayOES(this.vao),this.vao=null)}},{assert:51}],330:[function(t,e,r){\"use strict\";var n=t(\"../util/evented\"),i=t(\"../util/util\"),a=t(\"resolve-url\"),o=t(\"../data/bucket\").EXTENT;function s(t,e,r){e=e||{},this.id=t,this.dispatcher=r,this._data=e.data,void 0!==e.maxzoom&&(this.maxzoom=e.maxzoom),e.type&&(this.type=e.type);var n=o/this.tileSize;this.workerOptions=i.extend({source:this.id,cluster:e.cluster||!1,geojsonVtOptions:{buffer:(void 0!==e.buffer?e.buffer:128)*n,tolerance:(void 0!==e.tolerance?e.tolerance:.375)*n,extent:o,maxZoom:this.maxzoom},superclusterOptions:{maxZoom:Math.min(e.clusterMaxZoom,this.maxzoom-1)||this.maxzoom-1,extent:o,radius:(e.clusterRadius||50)*n,log:!1}},e.workerOptions),this._updateWorkerData(function(t){t?this.fire(\"error\",{error:t}):this.fire(\"load\")}.bind(this))}e.exports=s,s.prototype=i.inherit(n,{type:\"geojson\",minzoom:0,maxzoom:18,tileSize:512,isTileClipped:!0,reparseOverscaled:!0,onAdd:function(t){this.map=t},setData:function(t){return this._data=t,this._updateWorkerData(function(t){if(t)return this.fire(\"error\",{error:t});this.fire(\"change\")}.bind(this)),this},_updateWorkerData:function(t){var e=i.extend({},this.workerOptions),r=this._data;\"string\"==typeof r?e.url=\"undefined\"!=typeof window?a(window.location.href,r):r:e.data=JSON.stringify(r),this.workerID=this.dispatcher.send(this.type+\".loadData\",e,function(e){this._loaded=!0,t(e)}.bind(this))},loadTile:function(t,e){var r=t.coord.z>this.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,n={type:this.type,uid:t.uid,coord:t.coord,zoom:t.coord.z,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,overscaling:r,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send(\"load tile\",n,function(r,n){if(t.unloadVectorData(this.map.painter),!t.aborted)return r?e(r):(t.loadVectorData(n,this.map.style),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(this)),e(null))}.bind(this),this.workerID)},abortTile:function(t){t.aborted=!0},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send(\"remove tile\",{uid:t.uid,source:this.id},function(){},t.workerID)},serialize:function(){return{type:this.type,data:this._data}}})},{\"../data/bucket\":301,\"../util/evented\":406,\"../util/util\":414,\"resolve-url\":488}],331:[function(t,e,r){\"use strict\";var n=t(\"../util/util\"),i=t(\"../util/ajax\"),a=t(\"geojson-rewind\"),o=t(\"./geojson_wrapper\"),s=t(\"vt-pbf\"),l=t(\"supercluster\"),c=t(\"geojson-vt\"),u=t(\"./vector_tile_worker_source\");function f(t,e,r){r&&(this.loadGeoJSON=r),u.call(this,t,e)}e.exports=f,f.prototype=n.inherit(u,{_geoJSONIndexes:{},loadVectorData:function(t,e){var r=t.source,n=t.coord;if(!this._geoJSONIndexes[r])return e(null,null);var i=this._geoJSONIndexes[r].getTile(Math.min(n.z,t.maxZoom),n.x,n.y);if(!i)return e(null,null);var a=new o(i.features);a.name=\"_geojsonTileLayer\";var l=s({layers:{_geojsonTileLayer:a}});0===l.byteOffset&&l.byteLength===l.buffer.byteLength||(l=new Uint8Array(l)),e(null,{tile:a,rawTileData:l.buffer})},loadData:function(t,e){var r=function(r,n){return r?e(r):\"object\"!=typeof n?e(new Error(\"Input data is not a valid GeoJSON object.\")):(a(n,!0),void this._indexData(n,t,function(r,n){if(r)return e(r);this._geoJSONIndexes[t.source]=n,e(null)}.bind(this)))}.bind(this);this.loadGeoJSON(t,r)},loadGeoJSON:function(t,e){if(t.url)i.getJSON(t.url,e);else{if(\"string\"!=typeof t.data)return e(new Error(\"Input data is not a valid GeoJSON object.\"));try{return e(null,JSON.parse(t.data))}catch(t){return e(new Error(\"Input data is not a valid GeoJSON object.\"))}}},_indexData:function(t,e,r){try{e.cluster?r(null,l(e.superclusterOptions).load(t.features)):r(null,c(t,e.geojsonVtOptions))}catch(t){return r(t)}}})},{\"../util/ajax\":397,\"../util/util\":414,\"./geojson_wrapper\":332,\"./vector_tile_worker_source\":343,\"geojson-rewind\":147,\"geojson-vt\":151,supercluster:518,\"vt-pbf\":550}],332:[function(t,e,r){\"use strict\";var n=t(\"point-geometry\"),i=t(\"vector-tile\").VectorTileFeature,a=t(\"../data/bucket\").EXTENT;function o(t){this.features=t,this.length=t.length,this.extent=a}function s(t){if(this.type=t.type,1===t.type){this.rawGeometry=[];for(var e=0;e<t.geometry.length;e++)this.rawGeometry.push([t.geometry[e]])}else this.rawGeometry=t.geometry;this.properties=t.tags,this.extent=a}e.exports=o,o.prototype.feature=function(t){return new s(this.features[t])},s.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var r=t[e],i=[],a=0;a<r.length;a++)i.push(new n(r[a][0],r[a][1]));this.geometry.push(i)}return this.geometry},s.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-1/0,n=1/0,i=-1/0,a=0;a<t.length;a++)for(var o=t[a],s=0;s<o.length;s++){var l=o[s];e=Math.min(e,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.y)}return[e,n,r,i]},s.prototype.toGeoJSON=i.prototype.toGeoJSON},{\"../data/bucket\":301,\"point-geometry\":458,\"vector-tile\":544}],333:[function(t,e,r){\"use strict\";var n=t(\"../util/util\"),i=t(\"./tile_coord\"),a=t(\"../geo/lng_lat\"),o=t(\"point-geometry\"),s=t(\"../util/evented\"),l=t(\"../util/ajax\"),c=t(\"../data/bucket\").EXTENT,u=t(\"../render/draw_raster\").RasterBoundsArray,f=t(\"../data/buffer\"),h=t(\"../render/vertex_array_object\");function d(t,e,r){this.id=t,this.dispatcher=r,this.url=e.url,this.coordinates=e.coordinates,l.getImage(e.url,function(t,r){if(t)return this.fire(\"error\",{error:t});this.image=r,this.image.addEventListener(\"load\",function(){this.map._rerender()}.bind(this)),this._loaded=!0,this.fire(\"load\"),this.map&&this.setCoordinates(e.coordinates)}.bind(this))}e.exports=d,d.prototype=n.inherit(s,{minzoom:0,maxzoom:22,tileSize:512,onAdd:function(t){this.map=t,this.image&&this.setCoordinates(this.coordinates)},setCoordinates:function(t){this.coordinates=t;var e=this.map,r=t.map(function(t){return e.transform.locationCoordinate(a.convert(t)).zoomTo(0)}),s=this.centerCoord=n.getCoordinatesCenter(r);return s.column=Math.round(s.column),s.row=Math.round(s.row),this.minzoom=this.maxzoom=s.zoom,this._coord=new i(s.zoom,s.column,s.row),this._tileCoords=r.map(function(t){var e=t.zoomTo(s.zoom);return new o(Math.round((e.column-s.column)*c),Math.round((e.row-s.row)*c))}),this.fire(\"change\"),this},_setTile:function(t){this._prepared=!1,this.tile=t;var e=new u;e.emplaceBack(this._tileCoords[0].x,this._tileCoords[0].y,0,0),e.emplaceBack(this._tileCoords[1].x,this._tileCoords[1].y,32767,0),e.emplaceBack(this._tileCoords[3].x,this._tileCoords[3].y,0,32767),e.emplaceBack(this._tileCoords[2].x,this._tileCoords[2].y,32767,32767),this.tile.buckets={},this.tile.boundsBuffer=new f(e.serialize(),u.serialize(),f.BufferType.VERTEX),this.tile.boundsVAO=new h,this.tile.state=\"loaded\"},prepare:function(){if(this._loaded&&this.image&&this.image.complete&&this.tile){var t=this.map.painter.gl;this._prepared?(t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,this.image)):(this.tile.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.image))}},loadTile:function(t,e){this._coord&&this._coord.toString()===t.coord.toString()?(this._setTile(t),e(null)):(t.state=\"errored\",e(null))},serialize:function(){return{type:\"image\",urls:this.url,coordinates:this.coordinates}}})},{\"../data/bucket\":301,\"../data/buffer\":306,\"../geo/lng_lat\":311,\"../render/draw_raster\":323,\"../render/vertex_array_object\":329,\"../util/ajax\":397,\"../util/evented\":406,\"../util/util\":414,\"./tile_coord\":341,\"point-geometry\":458}],334:[function(t,e,r){\"use strict\";var n=t(\"../util/util\"),i=t(\"../util/ajax\"),a=t(\"../util/browser\"),o=t(\"../util/mapbox\").normalizeSourceURL;e.exports=function(t,e){var r=function(t,r){if(t)return e(t);var i=n.pick(r,[\"tiles\",\"minzoom\",\"maxzoom\",\"attribution\"]);r.vector_layers&&(i.vectorLayers=r.vector_layers,i.vectorLayerIds=i.vectorLayers.map(function(t){return t.id})),e(null,i)};t.url?i.getJSON(o(t.url),r):a.frame(r.bind(null,null,t))}},{\"../util/ajax\":397,\"../util/browser\":398,\"../util/mapbox\":411,\"../util/util\":414}],335:[function(t,e,r){\"use strict\";var n=t(\"../data/bucket\");e.exports=function(t,e,r){return e*(n.EXTENT/(t.tileSize*Math.pow(2,r-t.coord.z)))}},{\"../data/bucket\":301}],336:[function(t,e,r){\"use strict\";var n=t(\"./tile_coord\");function i(t,e){var r=t.coord,n=e.coord;return r.z-n.z||r.y-n.y||r.w-n.w||r.x-n.x}r.rendered=function(t,e,r,n,a,o){var s=t.tilesIn(r);s.sort(i);for(var l=[],c=0;c<s.length;c++){var u=s[c];u.tile.featureIndex&&l.push(u.tile.featureIndex.query({queryGeometry:u.queryGeometry,scale:u.scale,tileSize:u.tile.tileSize,bearing:o,params:n},e))}return function(t){for(var e=t[0]||{},r=1;r<t.length;r++){var n=t[r];for(var i in n){var a=n[i],o=e[i];if(void 0===o)o=e[i]=a;else for(var s=0;s<a.length;s++)o.push(a[s])}}return e}(l)},r.source=function(t,e){for(var r=t.getRenderableIds().map(function(e){return t.getTileByID(e)}),i=[],a={},o=0;o<r.length;o++){var s=r[o],l=new n(Math.min(s.sourceMaxZoom,s.coord.z),s.coord.x,s.coord.y,0).id;a[l]||(a[l]=!0,s.querySourceFeatures(i,e))}return i}},{\"./tile_coord\":341}],337:[function(t,e,r){\"use strict\";var n=t(\"../util/util\"),i=t(\"../util/ajax\"),a=t(\"../util/evented\"),o=t(\"./load_tilejson\"),s=t(\"../util/mapbox\").normalizeTileURL;function l(t,e,r){this.id=t,this.dispatcher=r,n.extend(this,n.pick(e,[\"url\",\"scheme\",\"tileSize\"])),o(e,function(t,e){if(t)return this.fire(\"error\",t);n.extend(this,e),this.fire(\"load\")}.bind(this))}e.exports=l,l.prototype=n.inherit(a,{minzoom:0,maxzoom:22,roundZoom:!0,scheme:\"xyz\",tileSize:512,_loaded:!1,onAdd:function(t){this.map=t},serialize:function(){return{type:\"raster\",url:this.url,tileSize:this.tileSize}},loadTile:function(t,e){var r=s(t.coord.url(this.tiles,null,this.scheme),this.url,this.tileSize);t.request=i.getImage(r,function(r,n){if(delete t.request,t.aborted)return;if(r)return e(r);var i=this.map.painter.gl;t.texture=this.map.painter.getTexture(n.width),t.texture?(i.bindTexture(i.TEXTURE_2D,t.texture),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,n)):(t.texture=i.createTexture(),i.bindTexture(i.TEXTURE_2D,t.texture),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR_MIPMAP_NEAREST),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,n),t.texture.size=n.width);i.generateMipmap(i.TEXTURE_2D),this.map.animationLoop.set(this.map.style.rasterFadeDuration),t.state=\"loaded\",e(null)}.bind(this))},abortTile:function(t){t.request&&(t.request.abort(),delete t.request)},unloadTile:function(t){t.texture&&this.map.painter.saveTexture(t.texture)}})},{\"../util/ajax\":397,\"../util/evented\":406,\"../util/mapbox\":411,\"../util/util\":414,\"./load_tilejson\":334}],338:[function(t,e,r){\"use strict\";var n=t(\"../util/util\"),i={vector:t(\"../source/vector_tile_source\"),raster:t(\"../source/raster_tile_source\"),geojson:t(\"../source/geojson_source\"),video:t(\"../source/video_source\"),image:t(\"../source/image_source\")};r.create=function(t,e,r){if((e=new i[e.type](t,e,r)).id!==t)throw new Error(\"Expected Source id to be \"+t+\" instead of \"+e.id);return n.bindAll([\"load\",\"abort\",\"unload\",\"serialize\",\"prepare\"],e),e},r.getType=function(t){return i[t]},r.setType=function(t,e){i[t]=e}},{\"../source/geojson_source\":330,\"../source/image_source\":333,\"../source/raster_tile_source\":337,\"../source/vector_tile_source\":342,\"../source/video_source\":344,\"../util/util\":414}],339:[function(t,e,r){\"use strict\";var n=t(\"./source\"),i=t(\"./tile\"),a=t(\"../util/evented\"),o=t(\"./tile_coord\"),s=t(\"../util/lru_cache\"),l=t(\"../geo/coordinate\"),c=t(\"../util/util\"),u=t(\"../data/bucket\").EXTENT;function f(t,e,r){this.id=t,this.dispatcher=r;var i=this._source=n.create(t,e,r).on(\"load\",function(){this.map&&this._source.onAdd&&this._source.onAdd(this.map),this._sourceLoaded=!0,this.tileSize=i.tileSize,this.minzoom=i.minzoom,this.maxzoom=i.maxzoom,this.roundZoom=i.roundZoom,this.reparseOverscaled=i.reparseOverscaled,this.isTileClipped=i.isTileClipped,this.attribution=i.attribution,this.vectorLayerIds=i.vectorLayerIds,this.fire(\"load\")}.bind(this)).on(\"error\",function(t){this._sourceErrored=!0,this.fire(\"error\",t)}.bind(this)).on(\"change\",function(){this.reload(),this.transform&&this.update(this.transform,this.map&&this.map.style.rasterFadeDuration),this.fire(\"change\")}.bind(this));this._tiles={},this._cache=new s(0,this.unloadTile.bind(this)),this._isIdRenderable=this._isIdRenderable.bind(this)}function h(t,e,r){var n=r.zoomTo(Math.min(t.z,e));return{x:(n.column-(t.x+t.w*Math.pow(2,t.z)))*u,y:(n.row-t.y)*u}}function d(t,e){return t%32-e%32}e.exports=f,f.maxOverzooming=10,f.maxUnderzooming=3,f.prototype=c.inherit(a,{onAdd:function(t){this.map=t,this._source&&this._source.onAdd&&this._source.onAdd(t)},loaded:function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;for(var t in this._tiles){var e=this._tiles[t];if(\"loaded\"!==e.state&&\"errored\"!==e.state)return!1}return!0},getSource:function(){return this._source},loadTile:function(t,e){return this._source.loadTile(t,e)},unloadTile:function(t){if(this._source.unloadTile)return this._source.unloadTile(t)},abortTile:function(t){if(this._source.abortTile)return this._source.abortTile(t)},serialize:function(){return this._source.serialize()},prepare:function(){if(this._sourceLoaded&&this._source.prepare)return this._source.prepare()},getIds:function(){return Object.keys(this._tiles).map(Number).sort(d)},getRenderableIds:function(){return this.getIds().filter(this._isIdRenderable)},_isIdRenderable:function(t){return this._tiles[t].isRenderable()&&!this._coveredTiles[t]},reload:function(){for(var t in this._cache.reset(),this._tiles){var e=this._tiles[t];\"loading\"!==e.state&&(e.state=\"reloading\"),this.loadTile(this._tiles[t],this._tileLoaded.bind(this,this._tiles[t]))}},_tileLoaded:function(t,e){if(e)return t.state=\"errored\",this.fire(\"tile.error\",{tile:t,error:e}),void this._source.fire(\"tile.error\",{tile:t,error:e});t.source=this,t.timeAdded=(new Date).getTime(),this.fire(\"tile.load\",{tile:t}),this._source.fire(\"tile.load\",{tile:t})},getTile:function(t){return this.getTileByID(t.id)},getTileByID:function(t){return this._tiles[t]},getZoom:function(t){return t.zoom+t.scaleZoom(t.tileSize/this.tileSize)},findLoadedChildren:function(t,e,r){var n=!1;for(var i in this._tiles){var a=this._tiles[i];if(!(r[i]||!a.isRenderable()||a.coord.z<=t.z||a.coord.z>e)){var o=Math.pow(2,Math.min(a.coord.z,this.maxzoom)-Math.min(t.z,this.maxzoom));if(Math.floor(a.coord.x/o)===t.x&&Math.floor(a.coord.y/o)===t.y)for(r[i]=!0,n=!0;a&&a.coord.z-1>t.z;){var s=a.coord.parent(this.maxzoom).id;(a=this._tiles[s])&&a.isRenderable()&&(delete r[i],r[s]=!0)}}}return n},findLoadedParent:function(t,e,r){for(var n=t.z-1;n>=e;n--){t=t.parent(this.maxzoom);var i=this._tiles[t.id];if(i&&i.isRenderable())return r[t.id]=!0,i;if(this._cache.has(t.id))return this.addTile(t),r[t.id]=!0,this._tiles[t.id]}},updateCacheSize:function(t){var e=(Math.ceil(t.width/t.tileSize)+1)*(Math.ceil(t.height/t.tileSize)+1);this._cache.setMaxSize(Math.floor(5*e))},update:function(t,e){if(this._sourceLoaded){var r,n,i;this.updateCacheSize(t);var a=(this.roundZoom?Math.round:Math.floor)(this.getZoom(t)),s=Math.max(a-f.maxOverzooming,this.minzoom),l=Math.max(a+f.maxUnderzooming,this.minzoom),u={},h=(new Date).getTime();this._coveredTiles={};var d=this.used?t.coveringTiles(this._source):[];for(r=0;r<d.length;r++)n=d[r],i=this.addTile(n),u[n.id]=!0,i.isRenderable()||this.findLoadedChildren(n,l,u)||this.findLoadedParent(n,s,u);for(var p,m={},v=Object.keys(u),g=0;g<v.length;g++){var y=v[g];n=o.fromID(y),(i=this._tiles[y])&&i.timeAdded>h-(e||0)&&(this.findLoadedChildren(n,l,u)&&(u[y]=!0),this.findLoadedParent(n,s,m))}for(p in m)u[p]||(this._coveredTiles[p]=!0);for(p in m)u[p]=!0;var b=c.keysDifference(this._tiles,u);for(r=0;r<b.length;r++)this.removeTile(+b[r]);this.transform=t}},addTile:function(t){var e=this._tiles[t.id];if(e)return e;var r=t.wrapped();if((e=this._tiles[r.id])||(e=this._cache.get(r.id))&&this._redoPlacement&&this._redoPlacement(e),!e){var n=t.z,a=n>this.maxzoom?Math.pow(2,n-this.maxzoom):1;e=new i(r,this.tileSize*a,this.maxzoom),this.loadTile(e,this._tileLoaded.bind(this,e))}return e.uses++,this._tiles[t.id]=e,this.fire(\"tile.add\",{tile:e}),this._source.fire(\"tile.add\",{tile:e}),e},removeTile:function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this.fire(\"tile.remove\",{tile:e}),this._source.fire(\"tile.remove\",{tile:e}),e.uses>0||(e.isRenderable()?this._cache.add(e.coord.wrapped().id,e):(e.aborted=!0,this.abortTile(e),this.unloadTile(e))))},clearTiles:function(){for(var t in this._tiles)this.removeTile(t);this._cache.reset()},tilesIn:function(t){for(var e={},r=this.getIds(),n=1/0,i=1/0,a=-1/0,s=-1/0,c=t[0].zoom,f=0;f<t.length;f++){var d=t[f];n=Math.min(n,d.column),i=Math.min(i,d.row),a=Math.max(a,d.column),s=Math.max(s,d.row)}for(var p=0;p<r.length;p++){var m=this._tiles[r[p]],v=o.fromID(r[p]),g=[h(v,m.sourceMaxZoom,new l(n,i,c)),h(v,m.sourceMaxZoom,new l(a,s,c))];if(g[0].x<u&&g[0].y<u&&g[1].x>=0&&g[1].y>=0){for(var y=[],b=0;b<t.length;b++)y.push(h(v,m.sourceMaxZoom,t[b]));var x=e[m.coord.id];void 0===x&&(x=e[m.coord.id]={tile:m,coord:v,queryGeometry:[],scale:Math.pow(2,this.transform.zoom-m.coord.z)}),x.queryGeometry.push(y)}}var _=[];for(var w in e)_.push(e[w]);return _},redoPlacement:function(){for(var t=this.getIds(),e=0;e<t.length;e++){this.getTileByID(t[e]).redoPlacement(this)}},getVisibleCoordinates:function(){return this.getRenderableIds().map(o.fromID)}})},{\"../data/bucket\":301,\"../geo/coordinate\":310,\"../util/evented\":406,\"../util/lru_cache\":410,\"../util/util\":414,\"./source\":338,\"./tile\":340,\"./tile_coord\":341}],340:[function(t,e,r){\"use strict\";var n=t(\"../util/util\"),i=t(\"../data/bucket\"),a=t(\"../data/feature_index\"),o=t(\"vector-tile\"),s=t(\"pbf\"),l=t(\"../util/vectortile_to_geojson\"),c=t(\"feature-filter\"),u=t(\"../symbol/collision_tile\"),f=t(\"../symbol/collision_box\"),h=t(\"../symbol/symbol_instances\"),d=t(\"../symbol/symbol_quads\");function p(t,e,r){this.coord=t,this.uid=n.uniqueId(),this.uses=0,this.tileSize=e,this.sourceMaxZoom=r,this.buckets={},this.state=\"loading\"}function m(t,e){if(e){for(var r={},a=0;a<t.length;a++){var o=e.getLayer(t[a].layerId);if(o){var s=i.create(n.extend({layer:o,childLayers:t[a].childLayerIds.map(e.getLayer.bind(e)).filter(function(t){return t})},t[a]));r[s.id]=s}}return r}}e.exports=p,p.prototype={loadVectorData:function(t,e){this.state=\"loaded\",t&&(this.collisionBoxArray=new f(t.collisionBoxArray),this.collisionTile=new u(t.collisionTile,this.collisionBoxArray),this.symbolInstancesArray=new h(t.symbolInstancesArray),this.symbolQuadsArray=new d(t.symbolQuadsArray),this.featureIndex=new a(t.featureIndex,t.rawTileData,this.collisionTile),this.rawTileData=t.rawTileData,this.buckets=m(t.buckets,e))},reloadSymbolData:function(t,e,r){if(\"unloaded\"!==this.state){for(var i in this.collisionTile=new u(t.collisionTile,this.collisionBoxArray),this.featureIndex.setCollisionTile(this.collisionTile),this.buckets){var a=this.buckets[i];\"symbol\"===a.type&&(a.destroy(e.gl),delete this.buckets[i])}n.extend(this.buckets,m(t.buckets,r))}},unloadVectorData:function(t){for(var e in this.buckets){this.buckets[e].destroy(t.gl)}this.collisionBoxArray=null,this.symbolQuadsArray=null,this.symbolInstancesArray=null,this.collisionTile=null,this.featureIndex=null,this.rawTileData=null,this.buckets=null,this.state=\"unloaded\"},redoPlacement:function(t){\"loaded\"===this.state&&\"reloading\"!==this.state?(this.state=\"reloading\",t.dispatcher.send(\"redo placement\",{uid:this.uid,source:t.id,angle:t.map.transform.angle,pitch:t.map.transform.pitch,showCollisionBoxes:t.map.showCollisionBoxes},function(e,r){this.reloadSymbolData(r,t.map.painter,t.map.style),t.fire(\"tile.load\",{tile:this}),this.state=\"loaded\",this.redoWhenDone&&(this.redoPlacement(t),this.redoWhenDone=!1)}.bind(this),this.workerID)):this.redoWhenDone=!0},getBucket:function(t){return this.buckets&&this.buckets[t.ref||t.id]},querySourceFeatures:function(t,e){if(this.rawTileData){this.vtLayers||(this.vtLayers=new o.VectorTile(new s(new Uint8Array(this.rawTileData))).layers);var r=this.vtLayers._geojsonTileLayer||this.vtLayers[e.sourceLayer];if(r)for(var n=c(e.filter),i={z:this.coord.z,x:this.coord.x,y:this.coord.y},a=0;a<r.length;a++){var u=r.feature(a);if(n(u)){var f=new l(u,this.coord.z,this.coord.x,this.coord.y);f.tile=i,t.push(f)}}}},isRenderable:function(){return\"loaded\"===this.state||\"reloading\"===this.state}}},{\"../data/bucket\":301,\"../data/feature_index\":308,\"../symbol/collision_box\":366,\"../symbol/collision_tile\":368,\"../symbol/symbol_instances\":377,\"../symbol/symbol_quads\":378,\"../util/util\":414,\"../util/vectortile_to_geojson\":415,\"feature-filter\":141,pbf:451,\"vector-tile\":544}],341:[function(t,e,r){\"use strict\";var n=t(\"assert\"),i=t(\"whoots-js\"),a=t(\"../geo/coordinate\");function o(t,e,r,i){n(!isNaN(t)&&t>=0&&t%1==0),n(!isNaN(e)&&e>=0&&e%1==0),n(!isNaN(r)&&r>=0&&r%1==0),isNaN(i)&&(i=0),this.z=+t,this.x=+e,this.y=+r,this.w=+i,(i*=2)<0&&(i=-1*i-1);var a=1<<this.z;this.id=32*(a*a*i+a*this.y+this.x)+this.z,this.posMatrix=null}function s(t,e){if(t.row>e.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function l(t,e,r,n,i){var a=Math.max(r,Math.floor(e.y0)),o=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx<e.x1:t.x1-e.dy/t.dy*t.dx<e.x0){var s=t;t=e,e=s}for(var l=t.dx/t.dy,c=e.dx/e.dy,u=t.dx>0,f=e.dx<0,h=a;h<o;h++){var d=l*Math.max(0,Math.min(t.dy,h+u-t.y0))+t.x0,p=c*Math.max(0,Math.min(e.dy,h+f-e.y0))+e.x0;i(Math.floor(p),Math.ceil(d),h)}}function c(t,e,r,n,i,a){var o,c=s(t,e),u=s(e,r),f=s(r,t);c.dy>u.dy&&(o=c,c=u,u=o),c.dy>f.dy&&(o=c,c=f,f=o),u.dy>f.dy&&(o=u,u=f,f=o),c.dy&&l(f,c,n,i,a),u.dy&&l(f,u,n,i,a)}e.exports=o,o.prototype.toString=function(){return this.z+\"/\"+this.x+\"/\"+this.y},o.prototype.toCoordinate=function(t){var e=Math.min(this.z,t),r=Math.pow(2,e),n=this.y,i=this.x+r*this.w;return new a(i,n,e)},o.fromID=function(t){var e=t%32,r=1<<e,n=(t-e)/32,i=n%r,a=(n-i)/r%r,s=Math.floor(n/(r*r));return s%2!=0&&(s=-1*s-1),new o(e,i,a,s/=2)},o.prototype.url=function(t,e,r){var n=i.getTileBBox(this.x,this.y,this.z),a=function(t,e,r){for(var n,i=\"\",a=t;a>0;a--)i+=(e&(n=1<<a-1)?1:0)+(r&n?2:0);return i}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(\"{prefix}\",(this.x%16).toString(16)+(this.y%16).toString(16)).replace(\"{z}\",Math.min(this.z,e||this.z)).replace(\"{x}\",this.x).replace(\"{y}\",\"tms\"===r?Math.pow(2,this.z)-this.y-1:this.y).replace(\"{quadkey}\",a).replace(\"{bbox-epsg-3857}\",n)},o.prototype.parent=function(t){return 0===this.z?null:this.z>t?new o(this.z-1,this.x,this.y,this.w):new o(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},o.prototype.wrapped=function(){return new o(this.z,this.x,this.y,0)},o.prototype.children=function(t){if(this.z>=t)return[new o(this.z+1,this.x,this.y,this.w)];var e=this.z+1,r=2*this.x,n=2*this.y;return[new o(e,r,n,this.w),new o(e,r+1,n,this.w),new o(e,r,n+1,this.w),new o(e,r+1,n+1,this.w)]},o.cover=function(t,e,r){var n=1<<t,i={};function a(t,e,a){var s,l;if(a>=0&&a<=n)for(s=t;s<e;s++)l=new o(r,(s%n+n)%n,a,Math.floor(s/n)),i[l.id]=l}return c(e[0],e[1],e[2],0,n,a),c(e[2],e[3],e[0],0,n,a),Object.keys(i).map(function(t){return i[t]})}},{\"../geo/coordinate\":310,assert:51,\"whoots-js\":560}],342:[function(t,e,r){\"use strict\";var n=t(\"../util/evented\"),i=t(\"../util/util\"),a=t(\"./load_tilejson\"),o=t(\"../util/mapbox\").normalizeTileURL;function s(t,e,r){if(this.id=t,this.dispatcher=r,i.extend(this,i.pick(e,[\"url\",\"scheme\",\"tileSize\"])),this._options=i.extend({type:\"vector\"},e),512!==this.tileSize)throw new Error(\"vector tile sources must have a tileSize of 512\");a(e,function(t,e){t?this.fire(\"error\",t):(i.extend(this,e),this.fire(\"load\"))}.bind(this))}e.exports=s,s.prototype=i.inherit(n,{minzoom:0,maxzoom:22,scheme:\"xyz\",tileSize:512,reparseOverscaled:!0,isTileClipped:!0,onAdd:function(t){this.map=t},serialize:function(){return i.extend({},this._options)},loadTile:function(t,e){var r=t.coord.z>this.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,n={url:o(t.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),uid:t.uid,coord:t.coord,zoom:t.coord.z,tileSize:this.tileSize*r,source:this.id,overscaling:r,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};function i(r,n){if(!t.aborted){if(r)return e(r);t.loadVectorData(n,this.map.style),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(this)),e(null),t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)}}t.workerID?\"loading\"===t.state?t.reloadCallback=e:(n.rawTileData=t.rawTileData,this.dispatcher.send(\"reload tile\",n,i.bind(this),t.workerID)):t.workerID=this.dispatcher.send(\"load tile\",n,i.bind(this))},abortTile:function(t){this.dispatcher.send(\"abort tile\",{uid:t.uid,source:this.id},null,t.workerID)},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send(\"remove tile\",{uid:t.uid,source:this.id},null,t.workerID)}})},{\"../util/evented\":406,\"../util/mapbox\":411,\"../util/util\":414,\"./load_tilejson\":334}],343:[function(t,e,r){\"use strict\";var n=t(\"../util/ajax\"),i=t(\"vector-tile\"),a=t(\"pbf\"),o=t(\"./worker_tile\");function s(t,e,r){this.actor=t,this.styleLayers=e,r&&(this.loadVectorData=r),this.loading={},this.loaded={}}e.exports=s,s.prototype={loadTile:function(t,e){var r=t.source,n=t.uid;this.loading[r]||(this.loading[r]={});var i=this.loading[r][n]=new o(t);i.abort=this.loadVectorData(t,function(t,a){if(delete this.loading[r][n],t)return e(t);if(!a)return e(null,null);i.data=a.tile,i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,a.rawTileData,e),this.loaded[r]=this.loaded[r]||{},this.loaded[r][n]=i}.bind(this))},reloadTile:function(t,e){var r=this.loaded[t.source],n=t.uid;if(r&&r[n]){var i=r[n];i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,t.rawTileData,e)}},abortTile:function(t){var e=this.loading[t.source],r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort(),delete e[r])},removeTile:function(t){var e=this.loaded[t.source],r=t.uid;e&&e[r]&&delete e[r]},loadVectorData:function(t,e){var r=n.getArrayBuffer(t.url,function(t,r){if(t)return e(t);var n=new i.VectorTile(new a(new Uint8Array(r)));e(t,{tile:n,rawTileData:r})}.bind(this));return function(){r.abort()}},redoPlacement:function(t,e){var r=this.loaded[t.source],n=this.loading[t.source],i=t.uid;if(r&&r[i]){var a=r[i].redoPlacement(t.angle,t.pitch,t.showCollisionBoxes);a.result&&e(null,a.result,a.transferables)}else n&&n[i]&&(n[i].angle=t.angle)}}},{\"../util/ajax\":397,\"./worker_tile\":346,pbf:451,\"vector-tile\":544}],344:[function(t,e,r){\"use strict\";var n=t(\"../util/util\"),i=t(\"./tile_coord\"),a=t(\"../geo/lng_lat\"),o=t(\"point-geometry\"),s=t(\"../util/evented\"),l=t(\"../util/ajax\"),c=t(\"../data/bucket\").EXTENT,u=t(\"../render/draw_raster\").RasterBoundsArray,f=t(\"../data/buffer\"),h=t(\"../render/vertex_array_object\");function d(t,e){this.id=t,this.urls=e.urls,this.coordinates=e.coordinates,l.getVideo(e.urls,function(t,r){if(t)return this.fire(\"error\",{error:t});var n;this.video=r,this.video.loop=!0,this.video.addEventListener(\"playing\",function(){n=this.map.style.animationLoop.set(1/0),this.map._rerender()}.bind(this)),this.video.addEventListener(\"pause\",function(){this.map.style.animationLoop.cancel(n)}.bind(this)),this.map&&(this.video.play(),this.setCoordinates(e.coordinates)),this.fire(\"load\")}.bind(this))}e.exports=d,d.prototype=n.inherit(s,{minzoom:0,maxzoom:22,tileSize:512,roundZoom:!0,getVideo:function(){return this.video},onAdd:function(t){this.map||(this.map=t,this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},setCoordinates:function(t){this.coordinates=t;var e=this.map,r=t.map(function(t){return e.transform.locationCoordinate(a.convert(t)).zoomTo(0)}),s=this.centerCoord=n.getCoordinatesCenter(r);return s.column=Math.round(s.column),s.row=Math.round(s.row),this.minzoom=this.maxzoom=s.zoom,this._coord=new i(s.zoom,s.column,s.row),this._tileCoords=r.map(function(t){var e=t.zoomTo(s.zoom);return new o(Math.round((e.column-s.column)*c),Math.round((e.row-s.row)*c))}),this.fire(\"change\"),this},_setTile:function(t){this._prepared=!1,this.tile=t;var e=ne
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment